@dative-gpi/foundation-shared-components 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/{models/FSButtons.ts → aliases/FSButton.ts} +24 -21
  2. package/aliases/index.ts +1 -0
  3. package/components/FSAutocompleteField.vue +207 -0
  4. package/components/FSBadge.vue +38 -0
  5. package/components/FSBreadcrumbs.vue +49 -55
  6. package/components/FSButton.vue +116 -101
  7. package/components/FSCalendar.vue +184 -0
  8. package/components/FSCalendarTwin.vue +412 -0
  9. package/components/FSCard.vue +77 -0
  10. package/components/FSCarousel.vue +63 -0
  11. package/components/FSCheckbox.vue +111 -104
  12. package/components/FSChip.vue +140 -0
  13. package/components/FSClock.vue +172 -0
  14. package/components/FSCol.vue +104 -98
  15. package/components/FSColor.vue +61 -64
  16. package/components/FSColorIcon.vue +67 -0
  17. package/components/FSContainer.vue +64 -0
  18. package/components/FSDateField.vue +211 -0
  19. package/components/FSDateRangeField.vue +225 -0
  20. package/components/FSDateTimeField.vue +257 -0
  21. package/components/FSDateTimeRangeField.vue +286 -0
  22. package/components/FSDialog.vue +103 -0
  23. package/components/FSDivider.vue +39 -0
  24. package/components/FSFadeOut.vue +49 -59
  25. package/components/FSFileButton.vue +245 -0
  26. package/components/FSHeaderButton.vue +17 -0
  27. package/components/FSIcon.vue +23 -23
  28. package/components/FSIconField.vue +232 -0
  29. package/components/FSImage.vue +142 -0
  30. package/components/FSLoadTile.vue +93 -0
  31. package/components/FSNumberField.vue +51 -53
  32. package/components/FSPasswordField.vue +99 -99
  33. package/components/FSRadio.vue +107 -110
  34. package/components/FSRadioGroup.vue +55 -57
  35. package/components/FSRemoveDialog.vue +123 -0
  36. package/components/FSRichTextField.vue +551 -0
  37. package/components/FSRow.vue +110 -104
  38. package/components/FSSearchField.vue +114 -105
  39. package/components/FSSelectField.vue +188 -0
  40. package/components/FSSlideGroup.vue +45 -49
  41. package/components/FSSlider.vue +130 -0
  42. package/components/FSSpan.vue +53 -37
  43. package/components/FSSubmitDialog.vue +165 -0
  44. package/components/FSSwitch.vue +110 -109
  45. package/components/FSTab.vue +61 -61
  46. package/components/FSTabs.vue +53 -55
  47. package/components/FSTag.vue +88 -84
  48. package/components/FSTagField.vue +183 -128
  49. package/components/FSTagGroup.vue +38 -45
  50. package/components/FSText.vue +74 -64
  51. package/components/FSTextArea.vue +209 -0
  52. package/components/FSTextField.vue +152 -149
  53. package/components/FSTile.vue +90 -0
  54. package/components/FSToggleSet.vue +282 -0
  55. package/components/FSTooltip.vue +21 -0
  56. package/components/FSWindow.vue +26 -16
  57. package/components/FSWrapGroup.vue +44 -47
  58. package/components/deviceOrganisations/FSConnectivity.vue +114 -0
  59. package/components/deviceOrganisations/FSStatus.vue +117 -0
  60. package/components/deviceOrganisations/FSStatusesCarousel.vue +105 -0
  61. package/components/deviceOrganisations/FSStatusesRow.vue +66 -0
  62. package/components/deviceOrganisations/FSWorstAlert.vue +165 -0
  63. package/components/lists/FSDataIteratorGroup.vue +7 -0
  64. package/components/lists/FSDataIteratorItem.vue +103 -0
  65. package/components/lists/FSDataTable.vue +964 -0
  66. package/components/lists/FSFilterButton.vue +176 -0
  67. package/components/lists/FSHeaderButton.vue +99 -0
  68. package/components/lists/FSHiddenButton.vue +79 -0
  69. package/components/tiles/FSDeviceOrganisationTileUI.vue +232 -0
  70. package/components/tiles/FSGroupTileUI.vue +192 -0
  71. package/composables/index.ts +2 -1
  72. package/composables/useBreakpoints.ts +33 -0
  73. package/composables/useColors.ts +53 -23
  74. package/composables/useSlots.ts +43 -0
  75. package/index.ts +6 -0
  76. package/models/breadcrumbs.ts +8 -0
  77. package/models/colors.ts +17 -0
  78. package/models/deviceAlerts.ts +10 -0
  79. package/models/deviceConnectivities.ts +11 -0
  80. package/models/deviceStatuses.ts +16 -0
  81. package/models/dispositions.ts +33 -0
  82. package/models/index.ts +9 -0
  83. package/models/modelStatuses.ts +11 -0
  84. package/models/rules.ts +50 -0
  85. package/models/toggleSets.ts +7 -0
  86. package/package.json +13 -4
  87. package/plugins/colorPlugin.ts +2 -2
  88. package/shims-plugin.d.ts +1 -1
  89. package/styles/components/fs_autocomplete_field.scss +123 -0
  90. package/styles/components/fs_button.scss +4 -14
  91. package/styles/components/fs_calendar.scss +138 -0
  92. package/styles/components/fs_card.scss +4 -0
  93. package/styles/components/fs_carousel.scss +4 -0
  94. package/styles/components/fs_chip.scss +33 -0
  95. package/styles/components/fs_clock.scss +43 -0
  96. package/styles/components/fs_col.scss +2 -0
  97. package/styles/components/fs_color_icon.scss +37 -0
  98. package/styles/components/fs_container.scss +16 -0
  99. package/styles/components/fs_data_iterator_item.scss +19 -0
  100. package/styles/components/fs_data_table.scss +97 -0
  101. package/styles/components/fs_date_field.scss +8 -0
  102. package/styles/components/fs_dialog.scss +30 -0
  103. package/styles/components/fs_divider.scss +5 -0
  104. package/styles/components/fs_fade_out.scss +10 -2
  105. package/styles/components/fs_filter_button.scss +12 -0
  106. package/styles/components/fs_header_button.scss +4 -0
  107. package/styles/components/fs_icon.scss +14 -4
  108. package/styles/components/fs_icon_field.scss +12 -0
  109. package/styles/components/fs_image.scss +7 -0
  110. package/styles/components/fs_load_tile.scss +49 -0
  111. package/styles/components/fs_password_field.scss +2 -2
  112. package/styles/components/fs_rich_text_field.scss +67 -0
  113. package/styles/components/fs_row.scss +4 -1
  114. package/styles/components/fs_select_field.scss +71 -0
  115. package/styles/components/fs_slide_group.scss +6 -0
  116. package/styles/components/fs_slider.scss +40 -0
  117. package/styles/components/fs_span.scss +8 -0
  118. package/styles/components/fs_submit_dialog.scss +9 -0
  119. package/styles/components/fs_tabs.scss +4 -0
  120. package/styles/components/fs_tag_field.scss +6 -8
  121. package/styles/components/fs_text_area.scss +105 -0
  122. package/styles/components/fs_text_field.scss +23 -15
  123. package/styles/components/fs_tile.scss +33 -0
  124. package/styles/components/fs_tooltip.scss +5 -0
  125. package/styles/components/fs_wrap_group.scss +7 -8
  126. package/styles/components/index.scss +26 -0
  127. package/styles/globals/breakpoints.scss +7 -0
  128. package/styles/globals/overrides.scss +20 -7
  129. package/styles/globals/text_fonts.scss +8 -8
  130. package/themes/default.ts +1 -11
  131. package/utils/css.ts +11 -0
  132. package/utils/icons.ts +75416 -0
  133. package/utils/index.ts +5 -0
  134. package/utils/levenshtein.ts +97 -0
  135. package/utils/lexical.ts +27 -0
  136. package/utils/sort.ts +9 -0
  137. package/composables/useTouch.ts +0 -9
  138. package/models/FSTags.ts +0 -8
  139. package/models/FSTextFields.ts +0 -17
@@ -1,102 +1,106 @@
1
1
  <template>
2
- <FSRow
3
- class="fs-tag"
4
- width="hug"
5
- align="center-left"
6
- :style="style"
7
- v-bind="$attrs"
8
- >
9
- <slot name="default" v-bind="{ color, colors }">
10
- <FSSpan class="fs-tag-label">
11
- {{ $props.label }}
12
- </FSSpan>
13
- </slot>
14
- <slot name="button" v-bind="{ color, colors }">
15
- <v-btn
16
- v-if="$props.editable"
17
- class="fs-tag-button"
18
- :ripple="false"
19
- @click="$emit('remove')"
20
- >
21
- <FSIcon size="s">
22
- mdi-close
23
- </FSIcon>
24
- </v-btn>
25
- </slot>
26
- </FSRow>
2
+ <FSRow
3
+ class="fs-tag"
4
+ width="hug"
5
+ align="center-left"
6
+ :style="style"
7
+ :wrap="false"
8
+ v-bind="$attrs"
9
+ >
10
+ <slot v-bind="{ color: $props.color, colors }">
11
+ <FSSpan
12
+ v-if="$props.label"
13
+ class="fs-tag-label"
14
+ >
15
+ {{ $props.label }}
16
+ </FSSpan>
17
+ </slot>
18
+ <slot name="button" v-bind="{ color: $props.color, colors }">
19
+ <v-btn
20
+ v-if="$props.editable"
21
+ class="fs-tag-button"
22
+ :ripple="false"
23
+ @click="$emit('remove')"
24
+ >
25
+ <FSIcon
26
+ size="s"
27
+ >
28
+ mdi-close
29
+ </FSIcon>
30
+ </v-btn>
31
+ </slot>
32
+ </FSRow>
27
33
  </template>
28
34
 
29
35
  <script lang="ts">
30
- import { computed, defineComponent, PropType, toRefs } from "vue";
36
+ import { computed, defineComponent, PropType } from "vue";
31
37
 
38
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
32
39
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
33
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
34
40
 
35
41
  import FSIcon from "./FSIcon.vue";
36
42
  import FSSpan from "./FSSpan.vue";
37
43
  import FSRow from "./FSRow.vue";
38
44
 
39
45
  export default defineComponent({
40
- name: "FSTag",
41
- components: {
42
- FSIcon,
43
- FSSpan,
44
- FSRow
46
+ name: "FSTag",
47
+ components: {
48
+ FSIcon,
49
+ FSSpan,
50
+ FSRow
51
+ },
52
+ props: {
53
+ label: {
54
+ type: String,
55
+ required: false,
56
+ default: null
45
57
  },
46
- props: {
47
- label: {
48
- type: String,
49
- required: true
50
- },
51
- variant: {
52
- type: String as PropType<"standard" | "full">,
53
- required: false,
54
- default: "full"
55
- },
56
- color: {
57
- type: String as PropType<ColorBase>,
58
- required: false,
59
- default: ColorBase.Primary
60
- },
61
- editable: {
62
- type: Boolean,
63
- required: false,
64
- default: true
65
- }
58
+ variant: {
59
+ type: String as PropType<"standard" | "full">,
60
+ required: false,
61
+ default: "full"
66
62
  },
67
- emits: ["remove"],
68
- setup(props) {
69
- const { variant, color } = toRefs(props);
70
-
71
- const textColors = useColors().getContrasts(color.value);
72
- const colors = useColors().getColors(color.value);
73
-
74
- const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
75
- switch (variant.value) {
76
- case "standard": return {
77
- "--fs-tag-background-color": colors.light,
78
- "--fs-tag-color": textColors.base,
79
- "--fs-tag-hover-background-color": colors.base,
80
- "--fs-tag-hover-color": textColors.light,
81
- "--fs-tag-active-background-color": colors.dark,
82
- "--fs-tag-active-color": textColors.light
83
- };
84
- case "full": return {
85
- "--fs-tag-background-color": colors.base,
86
- "--fs-tag-color": textColors.light,
87
- "--fs-tag-hover-background-color": colors.base,
88
- "--fs-tag-hover-color": textColors.light,
89
- "--fs-tag-active-background-color": colors.dark,
90
- "--fs-tag-active-color": textColors.light
91
- };
92
- }
93
- });
63
+ color: {
64
+ type: String as PropType<ColorBase>,
65
+ required: false,
66
+ default: ColorEnum.Primary
67
+ },
68
+ editable: {
69
+ type: Boolean,
70
+ required: false,
71
+ default: true
72
+ }
73
+ },
74
+ emits: ["remove"],
75
+ setup(props) {
76
+ const textColors = computed(() => useColors().getContrasts(props.color));
77
+ const colors = computed(() => useColors().getColors(props.color));
94
78
 
95
- return {
96
- colors,
97
- color,
98
- style
79
+ const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
80
+ switch (props.variant) {
81
+ case "standard": return {
82
+ "--fs-tag-background-color" : colors.value.light,
83
+ "--fs-tag-color" : textColors.value.base,
84
+ "--fs-tag-hover-background-color" : colors.value.base,
85
+ "--fs-tag-hover-color" : textColors.value.light,
86
+ "--fs-tag-active-background-color": colors.value.dark,
87
+ "--fs-tag-active-color" : textColors.value.light
99
88
  };
100
- }
89
+ case "full": return {
90
+ "--fs-tag-background-color" : colors.value.base,
91
+ "--fs-tag-color" : textColors.value.light,
92
+ "--fs-tag-hover-background-color" : colors.value.base,
93
+ "--fs-tag-hover-color" : textColors.value.light,
94
+ "--fs-tag-active-background-color": colors.value.dark,
95
+ "--fs-tag-active-color" : textColors.value.light
96
+ };
97
+ }
98
+ });
99
+
100
+ return {
101
+ colors,
102
+ style
103
+ };
104
+ }
101
105
  });
102
106
  </script>
@@ -1,152 +1,207 @@
1
1
  <template>
2
- <FSCol>
3
- <FSTextField
4
- :label="$props.label"
5
- :description="$props.description"
6
- :type="type"
7
- :color="$props.color"
8
- :required="$props.required"
2
+ <FSCol>
3
+ <FSTextField
4
+ :label="$props.label"
5
+ :description="$props.description"
6
+ :hideHeader="$props.hideHeader"
7
+ :required="$props.required"
8
+ :editable="$props.editable"
9
+ :error="messages.length > 0"
10
+ @keydown.enter="onAdd"
11
+ v-model="innerValue"
12
+ v-bind="$attrs"
13
+ >
14
+ <template v-if="!$props.hideHeader" #label>
15
+ <slot name="label">
16
+ <FSRow :wrap="false">
17
+ <FSSpan
18
+ v-if="$props.label"
19
+ class="fs-tag-field-label"
20
+ font="text-overline"
21
+ :style="style"
22
+ >
23
+ {{ $props.label }}
24
+ </FSSpan>
25
+ <FSSpan
26
+ v-if="$props.label && $props.required"
27
+ class="fs-tag-field-label"
28
+ style="margin-left: -8px;"
29
+ font="text-overline"
30
+ :ellipsis="false"
31
+ :style="style"
32
+ >
33
+ *
34
+ </FSSpan>
35
+ <v-spacer style="min-width: 40px;" />
36
+ <FSSpan
37
+ v-if="messages.length > 0"
38
+ class="fs-tag-field-messages"
39
+ font="text-overline"
40
+ :style="style"
41
+ >
42
+ {{ messages.join(", ") }}
43
+ </FSSpan>
44
+ </FSRow>
45
+ </slot>
46
+ </template>
47
+ <template #append-inner>
48
+ <slot name="append-inner">
49
+ <FSButton
50
+ variant="icon"
51
+ icon="mdi-tag-outline"
9
52
  :editable="$props.editable"
10
- :value="innerValue"
11
- @update:value="(value) => innerValue = value"
12
- @keydown.enter="onAdd"
13
- v-bind="$attrs"
14
- >
15
- <template #append-inner>
16
- <FSIcon
17
- class="fs-tag-field-icon"
18
- size="m"
19
- :style="style"
20
- @click="onAdd"
21
- >
22
- mdi-tag-outline
23
- </FSIcon>
24
- </template>
25
- <template v-for="(_, name) in $slots" v-slot:[name]="slotData">
26
- <slot :name="name" v-bind="slotData" />
27
- </template>
28
- </FSTextField>
29
- <FSTagGroup
30
- :tags="$props.value"
31
- :variant="$props.variant"
32
- :color="$props.tagColor"
33
- :editable="$props.editable"
34
- @remove="onRemove"
35
- />
36
- </FSCol>
53
+ :color="ColorEnum.Dark"
54
+ @click="onAdd"
55
+ />
56
+ </slot>
57
+ </template>
58
+ <template v-for="(_, name) in $slots" v-slot:[name]="slotData">
59
+ <slot :name="name" v-bind="slotData" />
60
+ </template>
61
+ </FSTextField>
62
+ <FSTagGroup
63
+ :tags="$props.modelValue"
64
+ :variant="$props.tagVariant"
65
+ :color="$props.tagColor"
66
+ :editable="$props.editable"
67
+ @remove="onRemove"
68
+ />
69
+ </FSCol>
37
70
  </template>
38
71
 
39
72
  <script lang="ts">
40
- import { computed, defineComponent, PropType, ref, toRefs } from "vue";
73
+ import { computed, defineComponent, PropType, ref } from "vue";
41
74
 
75
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
42
76
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
43
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
44
77
 
45
78
  import FSTextField from "./FSTextField.vue";
46
79
  import FSTagGroup from "./FSTagGroup.vue";
47
- import FSCol from "./FSCol.vue"
80
+ import FSButton from "./FSButton.vue";
81
+ import FSSpan from "./FSSpan.vue";
82
+ import FSCol from "./FSCol.vue";
83
+ import FSRow from "./FSRow.vue";
48
84
 
49
85
  export default defineComponent({
50
- name: "FSTagField",
51
- components: {
52
- FSTextField,
53
- FSTagGroup,
54
- FSCol
86
+ name: "FSTagField",
87
+ components: {
88
+ FSTextField,
89
+ FSTagGroup,
90
+ FSButton,
91
+ FSSpan,
92
+ FSCol,
93
+ FSRow
94
+ },
95
+ props: {
96
+ label: {
97
+ type: String,
98
+ required: false,
99
+ default: null
55
100
  },
56
- props: {
57
- label: {
58
- type: String,
59
- required: false,
60
- default: null
61
- },
62
- description: {
63
- type: String,
64
- required: false,
65
- default: null
66
- },
67
- value: {
68
- type: Array as PropType<string[]>,
69
- required: false,
70
- default: () => []
71
- },
72
- variant: {
73
- type: String as PropType<"standard" | "full">,
74
- required: false,
75
- default: "full"
76
- },
77
- color: {
78
- type: String as PropType<ColorBase>,
79
- required: false,
80
- default: ColorBase.Primary
81
- },
82
- tagColor: {
83
- type: String as PropType<ColorBase>,
84
- required: false,
85
- default: ColorBase.Primary
86
- },
87
- required: {
88
- type: Boolean,
89
- required: false,
90
- default: false
91
- },
92
- editable: {
93
- type: Boolean,
94
- required: false,
95
- default: true
96
- }
101
+ description: {
102
+ type: String,
103
+ required: false,
104
+ default: null
105
+ },
106
+ modelValue: {
107
+ type: Array as PropType<string[]>,
108
+ required: false,
109
+ default: () => []
110
+ },
111
+ tagVariant: {
112
+ type: String as PropType<"standard" | "full">,
113
+ required: false,
114
+ default: "full"
115
+ },
116
+ tagColor: {
117
+ type: String as PropType<ColorBase>,
118
+ required: false,
119
+ default: ColorEnum.Primary
120
+ },
121
+ hideHeader: {
122
+ type: Boolean,
123
+ required: false,
124
+ default: false
125
+ },
126
+ required: {
127
+ type: Boolean,
128
+ required: false,
129
+ default: false
130
+ },
131
+ rules: {
132
+ type: Array as PropType<Function[]>,
133
+ required: false,
134
+ default: () => []
97
135
  },
98
- emits: ["update:value"],
99
- setup(props, { emit }) {
100
- const { value, editable } = toRefs(props);
136
+ editable: {
137
+ type: Boolean,
138
+ required: false,
139
+ default: true
140
+ }
141
+ },
142
+ emits: ["update:modelValue"],
143
+ setup(props, { emit }) {
101
144
 
102
- const innerValue = ref("");
145
+ const errors = useColors().getColors(ColorEnum.Error);
146
+ const lights = useColors().getColors(ColorEnum.Light);
147
+ const darks = useColors().getColors(ColorEnum.Dark);
103
148
 
104
- const darks = useColors().getColors(ColorBase.Dark);
149
+ const innerValue = ref("");
105
150
 
106
- const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
107
- if (!editable.value) {
108
- return {
109
- "--fs-tag-field-cursor" : "default",
110
- "--fs-tag-field-base-text": darks.light,
111
- "--fs-tag-field-dark-text": darks.light
112
- };
113
- }
114
- return {
115
- "--fs-tag-field-cursor" : "pointer",
116
- "--fs-tag-field-base-text": darks.base,
117
- "--fs-tag-field-dark-text": darks.dark
118
- };
119
- });
151
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
152
+ if (!props.editable) {
153
+ return {
154
+ "--fs-tag-field-color": lights.dark
155
+ };
156
+ }
157
+ return {
158
+ "--fs-tag-field-color" : darks.base,
159
+ "--fs-tag-field-error-color": errors.base
160
+ };
161
+ });
120
162
 
121
- const onAdd = (): void => {
122
- if (!editable.value) {
123
- return;
124
- }
125
- const tags = value.value ?? [];
126
- if (!innerValue.value.length || tags.includes(innerValue.value)) {
127
- return;
128
- }
129
- emit("update:value", tags.concat(innerValue.value));
130
- innerValue.value = "";
163
+ const messages = computed((): string[] => {
164
+ const messages = [];
165
+ for (const rule of props.rules) {
166
+ const message = rule(props.modelValue);
167
+ if (typeof(message) === "string") {
168
+ messages.push(message);
131
169
  }
170
+ }
171
+ return messages;
172
+ });
132
173
 
133
- const onRemove = (label: string): void => {
134
- if (!editable.value) {
135
- return;
136
- }
137
- const tags = value.value ?? [];
138
- if (!tags.length || !tags.includes(label)) {
139
- return;
140
- }
141
- emit("update:value", tags.filter(t => t !== label));
142
- }
174
+ const onAdd = (): void => {
175
+ if (!props.editable) {
176
+ return;
177
+ }
178
+ const tags = props.modelValue ?? [];
179
+ if (!innerValue.value.length || tags.includes(innerValue.value)) {
180
+ return;
181
+ }
182
+ emit("update:modelValue", tags.concat(innerValue.value));
183
+ innerValue.value = "";
184
+ }
143
185
 
144
- return {
145
- innerValue,
146
- style,
147
- onAdd,
148
- onRemove
149
- };
186
+ const onRemove = (label: string): void => {
187
+ if (!props.editable) {
188
+ return;
189
+ }
190
+ const tags = props.modelValue ?? [];
191
+ if (!tags.length || !tags.includes(label)) {
192
+ return;
193
+ }
194
+ emit("update:modelValue", tags.filter(t => t !== label));
150
195
  }
196
+
197
+ return {
198
+ ColorEnum,
199
+ innerValue,
200
+ messages,
201
+ style,
202
+ onAdd,
203
+ onRemove
204
+ };
205
+ }
151
206
  });
152
207
  </script>
@@ -1,60 +1,53 @@
1
1
  <template>
2
- <FSWrapGroup v-bind="$attrs">
3
- <FSTag
4
- v-for="(tag, index) in $props.tags"
5
- :key="index"
6
- :label="tag"
7
- :variant="$props.variant"
8
- :color="$props.color"
9
- :editable="$props.editable"
10
- @remove="() => $emit('remove', tag)"
11
- />
12
- <slot name="default" />
13
- </FSWrapGroup>
2
+ <FSWrapGroup v-bind="$attrs">
3
+ <FSTag
4
+ v-for="(tag, index) in $props.tags"
5
+ :key="index"
6
+ :label="tag"
7
+ :variant="$props.variant"
8
+ :color="$props.color"
9
+ :editable="$props.editable"
10
+ @remove="() => $emit('remove', tag)"
11
+ />
12
+ <slot />
13
+ </FSWrapGroup>
14
14
  </template>
15
15
 
16
16
  <script lang="ts">
17
17
  import { defineComponent, PropType } from "vue";
18
18
 
19
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
19
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
20
20
 
21
21
  import FSWrapGroup from "./FSWrapGroup.vue";
22
22
  import FSTag from "./FSTag.vue";
23
23
 
24
- export interface FSTagItem {
25
- label: string,
26
- variant: "standard" | "full",
27
- color: ColorBase,
28
- editable: boolean
29
- }
30
-
31
24
  export default defineComponent({
32
- name: "FSTagGroup",
33
- components: {
34
- FSWrapGroup,
35
- FSTag
25
+ name: "FSTagGroup",
26
+ components: {
27
+ FSWrapGroup,
28
+ FSTag
29
+ },
30
+ props: {
31
+ tags: {
32
+ type: Array as PropType<string[]>,
33
+ required: false,
34
+ default: () => []
35
+ },
36
+ variant: {
37
+ type: String as PropType<"standard" | "full">,
38
+ required: false,
39
+ default: "full"
40
+ },
41
+ color: {
42
+ type: String as PropType<ColorBase>,
43
+ required: false,
44
+ default: ColorEnum.Primary
36
45
  },
37
- props: {
38
- tags: {
39
- type: Array as PropType<Array<String>>,
40
- required: false,
41
- default: () => []
42
- },
43
- variant: {
44
- type: String as PropType<"standard" | "full">,
45
- required: false,
46
- default: "full"
47
- },
48
- color: {
49
- type: String as PropType<ColorBase>,
50
- required: false,
51
- default: ColorBase.Primary
52
- },
53
- editable: {
54
- type: Boolean,
55
- required: false,
56
- default: true
57
- }
46
+ editable: {
47
+ type: Boolean,
48
+ required: false,
49
+ default: true
58
50
  }
51
+ }
59
52
  });
60
53
  </script>