From dca48d7ef40daada0aca3af76c3e89cd43d9b6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bahad=C4=B1r=20Sofuo=C4=9Flu?= Date: Wed, 24 May 2023 14:57:02 +0300 Subject: [PATCH] Refactor #3965 - For Tag --- components/lib/tag/BaseTag.vue | 61 ++++++++++++++++++++++++++++++++++ components/lib/tag/Tag.d.ts | 5 +++ components/lib/tag/Tag.vue | 51 +++------------------------- 3 files changed, 71 insertions(+), 46 deletions(-) create mode 100644 components/lib/tag/BaseTag.vue diff --git a/components/lib/tag/BaseTag.vue b/components/lib/tag/BaseTag.vue new file mode 100644 index 000000000..0cdaaafd1 --- /dev/null +++ b/components/lib/tag/BaseTag.vue @@ -0,0 +1,61 @@ + diff --git a/components/lib/tag/Tag.d.ts b/components/lib/tag/Tag.d.ts index a26f2be0a..7c1b7578d 100644 --- a/components/lib/tag/Tag.d.ts +++ b/components/lib/tag/Tag.d.ts @@ -72,6 +72,11 @@ export interface TagProps { * @type {TagPassThroughOptions} */ pt?: TagPassThroughOptions; + /** + * When enabled, it removes component related styles in the core. + * @defaultValue false + */ + unstyled?: boolean; } /** diff --git a/components/lib/tag/Tag.vue b/components/lib/tag/Tag.vue index d40a853da..a415e6876 100644 --- a/components/lib/tag/Tag.vue +++ b/components/lib/tag/Tag.vue @@ -1,9 +1,9 @@ @@ -13,47 +13,6 @@ import BaseComponent from 'primevue/basecomponent'; export default { name: 'Tag', - extends: BaseComponent, - props: { - value: null, - severity: null, - rounded: Boolean, - icon: String - }, - computed: { - containerClass() { - return [ - 'p-tag p-component', - { - 'p-tag-info': this.severity === 'info', - 'p-tag-success': this.severity === 'success', - 'p-tag-warning': this.severity === 'warning', - 'p-tag-danger': this.severity === 'danger', - 'p-tag-rounded': this.rounded - } - ]; - }, - iconClass() { - return ['p-tag-icon', this.icon]; - } - } + extends: BaseComponent }; - -