@finema/core 2.59.2 → 2.61.0

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 (49) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
  4. package/dist/runtime/components/Form/Fields.vue +13 -18
  5. package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
  6. package/dist/runtime/components/Form/InputDateTime/index.vue +5 -13
  7. package/dist/runtime/components/Form/InputDateTimeRange/index.vue +13 -29
  8. package/dist/runtime/components/Form/InputMonth/index.vue +51 -52
  9. package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
  10. package/dist/runtime/components/Form/InputSelect/index.vue +38 -46
  11. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +43 -62
  12. package/dist/runtime/components/Form/InputTags/index.d.vue.ts +0 -2
  13. package/dist/runtime/components/Form/InputTags/index.vue +25 -179
  14. package/dist/runtime/components/Form/InputTags/index.vue.d.ts +0 -2
  15. package/dist/runtime/components/Form/InputTags/types.d.ts +3 -5
  16. package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
  17. package/dist/runtime/components/Form/InputTime/index.vue +38 -39
  18. package/dist/runtime/components/Form/InputToggle/index.vue +17 -17
  19. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +30 -30
  20. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +50 -50
  21. package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
  22. package/dist/runtime/components/Form/fileState/FailedState.vue +33 -33
  23. package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
  24. package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
  25. package/dist/runtime/components/Form/index.vue +5 -5
  26. package/dist/runtime/components/Form/types.d.ts +1 -3
  27. package/dist/runtime/components/Form/types.js +0 -1
  28. package/dist/runtime/components/Image.vue +28 -28
  29. package/dist/runtime/components/Log/index.vue +17 -17
  30. package/dist/runtime/components/Table/ColumnDate.vue +1 -1
  31. package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
  32. package/dist/runtime/components/Table/ColumnImage.vue +4 -4
  33. package/dist/runtime/components/Table/ColumnText.d.vue.ts +1 -5
  34. package/dist/runtime/components/Table/ColumnText.vue +1 -1
  35. package/dist/runtime/components/Table/ColumnText.vue.d.ts +1 -5
  36. package/dist/runtime/components/Table/Pagination.vue +46 -46
  37. package/dist/runtime/components/Table/Simple.vue +17 -17
  38. package/dist/runtime/server/tsconfig.json +3 -3
  39. package/dist/runtime/styles/main.css +1 -1
  40. package/dist/runtime/theme/selectMenu.js +2 -2
  41. package/dist/runtime/theme/table.js +1 -1
  42. package/dist/runtime/utils/TimeHelper.d.ts +5 -15
  43. package/dist/runtime/utils/TimeHelper.js +11 -34
  44. package/package.json +1 -1
  45. package/dist/runtime/components/Form/InputCheckboxGroup/index.d.vue.ts +0 -8
  46. package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +0 -59
  47. package/dist/runtime/components/Form/InputCheckboxGroup/index.vue.d.ts +0 -8
  48. package/dist/runtime/components/Form/InputCheckboxGroup/types.d.ts +0 -21
  49. package/dist/runtime/components/Form/InputCheckboxGroup/types.js +0 -0
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.59.2",
3
+ "version": "2.61.0",
4
4
  "configKey": "core",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import * as lodash from 'lodash-es';
4
4
  import * as theme from '../dist/runtime/theme/index.js';
5
5
 
6
6
  const name = "@finema/core";
7
- const version = "2.59.2";
7
+ const version = "2.61.0";
8
8
 
9
9
  const nuxtAppOptions = {
10
10
  head: {
@@ -1,17 +1,17 @@
1
1
  <template>
2
- <FormField
3
- :label="label"
4
- :name="name"
5
- :description="description"
6
- :hint="hint"
7
- :data-testid="name"
8
- :help="help"
9
- :error="errorMessage"
10
- :required="!!required"
11
- :ui="containerUi"
12
- >
13
- <slot />
14
- </FormField>
2
+ <FormField
3
+ :label="label"
4
+ :name="name"
5
+ :description="description"
6
+ :hint="hint"
7
+ :data-testid="name"
8
+ :help="help"
9
+ :error="errorMessage"
10
+ :required="!!required"
11
+ :ui="containerUi"
12
+ >
13
+ <slot />
14
+ </FormField>
15
15
  </template>
16
16
 
17
17
  <script setup>
@@ -1,22 +1,22 @@
1
1
  <template>
2
- <div
2
+ <div
3
3
  :class="[theme.base({
4
4
  class: [$props.class, ui?.base]
5
- })]"
6
- >
7
- <component
8
- :is="componentMap[option.type]?.component"
9
- v-for="option in options.filter((item) => !item.isHide)"
10
- :key="option.props.name"
11
- :class="option.class"
12
- :form="form"
5
+ })]"
6
+ >
7
+ <component
8
+ :is="componentMap[option.type]?.component"
9
+ v-for="option in options.filter((item) => !item.isHide)"
10
+ :key="option.props.name"
11
+ :class="option.class"
12
+ :form="form"
13
13
  v-bind="{
14
14
  ...getFieldBinding(option),
15
15
  ...componentMap[option.type]?.props
16
- }"
17
- v-on="option.on ?? {}"
18
- />
19
- </div>
16
+ }"
17
+ v-on="option.on ?? {}"
18
+ />
19
+ </div>
20
20
  </template>
21
21
 
22
22
  <script setup>
@@ -27,7 +27,6 @@ import FormInputSearch from "./InputSearch/index.vue";
27
27
  import FormInputNumber from "./InputNumber/index.vue";
28
28
  import FormInputToggle from "./InputToggle/index.vue";
29
29
  import FormInputCheckbox from "./InputCheckbox/index.vue";
30
- import FormInputCheckboxGroup from "./InputCheckboxGroup/index.vue";
31
30
  import FormInputSelect from "./InputSelect/index.vue";
32
31
  import FormInputSelectMultiple from "./InputSelectMultiple/index.vue";
33
32
  import FormInputComponent from "./InputComponent/index.vue";
@@ -71,10 +70,6 @@ const componentMap = {
71
70
  component: FormInputCheckbox,
72
71
  props: {}
73
72
  },
74
- [INPUT_TYPES.CHECKBOX_GROUP]: {
75
- component: FormInputCheckboxGroup,
76
- props: {}
77
- },
78
73
  [INPUT_TYPES.SELECT]: {
79
74
  component: FormInputSelect,
80
75
  props: {}
@@ -1,22 +1,22 @@
1
1
  <template>
2
- <FieldWrapper
3
- v-bind="wrapperProps"
4
- label=""
5
- description=""
6
- >
7
- <Checkbox
8
- :model-value="value"
9
- :disabled="wrapperProps.disabled"
10
- :name="name"
11
- :label="label"
12
- :description="description"
13
- :required="required"
14
- :variant="variant"
15
- :indicator="indicator"
16
- :ui="ui"
17
- @update:modelValue="onChange"
18
- />
19
- </FieldWrapper>
2
+ <FieldWrapper
3
+ v-bind="wrapperProps"
4
+ label=""
5
+ description=""
6
+ >
7
+ <Checkbox
8
+ :model-value="value"
9
+ :disabled="wrapperProps.disabled"
10
+ :name="name"
11
+ :label="label"
12
+ :description="description"
13
+ :required="required"
14
+ :variant="variant"
15
+ :indicator="indicator"
16
+ :ui="ui"
17
+ @update:modelValue="onChange"
18
+ />
19
+ </FieldWrapper>
20
20
  </template>
21
21
 
22
22
  <script setup>
@@ -13,22 +13,20 @@
13
13
  :max-date="maxDate"
14
14
  :min-time="minTime"
15
15
  :max-time="maxTime"
16
- :six-weeks="true"
17
16
  :start-time="startTime"
18
17
  :teleport="teleport"
19
18
  :required="required"
20
- :timezone="appConfig.core?.time_zone"
21
19
  :flow="['calendar', 'time']"
22
20
  @update:model-value="onInput"
23
21
  >
24
22
  <template
25
- v-if="appConfig.core?.is_thai_year"
23
+ v-if="appConfig.core?.locale === 'th' && appConfig.core?.is_thai_year"
26
24
  #year="{ value }"
27
25
  >
28
26
  {{ value + 543 }}
29
27
  </template>
30
28
  <template
31
- v-if="appConfig.core?.is_thai_year"
29
+ v-if="appConfig.core?.locale === 'th' && appConfig.core?.is_thai_year"
32
30
  #year-overlay-value="{ value }"
33
31
  >
34
32
  {{ value + 543 }}
@@ -121,19 +119,13 @@ onMounted(() => {
121
119
  });
122
120
  const format = (date) => {
123
121
  if (props.disabledTime) {
124
- return TimeHelper.displayDate(date, {
125
- autoTimezone: true
126
- });
122
+ return TimeHelper.displayDate(date);
127
123
  }
128
- return TimeHelper.displayDateTime(date, {
129
- autoTimezone: true
130
- });
124
+ return TimeHelper.displayDateTime(date);
131
125
  };
132
126
  const onInput = (_value) => {
133
127
  if (props.disabledTime && !props.isReturnISO) {
134
- value.value = TimeHelper.displayDate(_value, {
135
- autoTimezone: true
136
- }) ?? void 0;
128
+ value.value = TimeHelper.getDateFormTime(_value);
137
129
  } else {
138
130
  value.value = _value;
139
131
  }
@@ -15,7 +15,6 @@
15
15
  :max-date="maxDate"
16
16
  :min-time="minTime"
17
17
  :max-time="maxTime"
18
- :six-weeks="true"
19
18
  :start-time="startTime"
20
19
  :multi-calendars="!isDisabledMultiCalendar"
21
20
  :required="required"
@@ -25,13 +24,13 @@
25
24
  @update:model-value="onInput"
26
25
  >
27
26
  <template
28
- v-if="appConfig.core?.is_thai_year"
27
+ v-if="appConfig.core?.locale === 'th' && appConfig.core?.is_thai_year"
29
28
  #year="{ value }"
30
29
  >
31
30
  {{ value + 543 }}
32
31
  </template>
33
32
  <template
34
- v-if="appConfig.core?.is_thai_year"
33
+ v-if="appConfig.core?.locale === 'th' && appConfig.core?.is_thai_year"
35
34
  #year-overlay-value="{ value }"
36
35
  >
37
36
  {{ value + 543 }}
@@ -65,10 +64,9 @@
65
64
  <script setup>
66
65
  import Datepicker from "@vuepic/vue-datepicker";
67
66
  import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
68
- import { ref, useFieldHOC, useAppConfig, computed, useUiConfig, watch, onMounted, TimeHelper } from "#imports";
67
+ import { TimeHelper, ref, useFieldHOC, useAppConfig, computed, useUiConfig, watch, onMounted } from "#imports";
69
68
  import "@vuepic/vue-datepicker/dist/main.css";
70
69
  import { dateTimeTheme } from "#core/theme/dateTime";
71
- import { toZonedTime } from "date-fns-tz";
72
70
  const emits = defineEmits(["change"]);
73
71
  const props = defineProps({
74
72
  isDisabledMultiCalendar: { type: Boolean, required: false },
@@ -105,18 +103,18 @@ const {
105
103
  const innerValueRef = ref([]);
106
104
  const initializeValue = () => {
107
105
  const currentValue = value.value;
108
- if (currentValue && currentValue.start) {
109
- const start = toZonedTime(new Date(currentValue.start), appConfig.core.time_zone);
110
- const end = toZonedTime(new Date(currentValue.end || currentValue.start), appConfig.core.time_zone);
106
+ if (currentValue) {
107
+ const start = typeof currentValue.start === "string" ? new Date(currentValue.start) : currentValue.start;
108
+ const end = typeof currentValue.end === "string" ? new Date(currentValue.end) : currentValue.end;
111
109
  innerValueRef.value = [start, end];
112
110
  } else {
113
111
  innerValueRef.value = [];
114
112
  }
115
113
  };
116
114
  watch(value, (newValue) => {
117
- if (newValue && newValue.start) {
118
- const start = toZonedTime(new Date(newValue.start), appConfig.core.time_zone);
119
- const end = toZonedTime(new Date(newValue.end || newValue.start), appConfig.core.time_zone);
115
+ if (newValue && (newValue.start || newValue.end)) {
116
+ const start = typeof newValue.start === "string" ? new Date(newValue.start) : newValue.start;
117
+ const end = typeof newValue.end === "string" ? new Date(newValue.end) : newValue.end;
120
118
  innerValueRef.value = [start, end];
121
119
  } else if (!newValue) {
122
120
  innerValueRef.value = [];
@@ -129,25 +127,11 @@ onMounted(() => {
129
127
  });
130
128
  const format = (date) => {
131
129
  if (props.disabledTime) {
132
- return date.length > 0 && date[0] ? TimeHelper.displayDate(date[0], {
133
- autoTimezone: true
134
- }) + " - " + TimeHelper.displayDate(date[1] || date[0], {
135
- autoTimezone: true
136
- }) : "";
130
+ return date.length > 0 ? TimeHelper.displayDate(date[0]) + " - " + TimeHelper.displayDate(date[1] ?? date[0]) : "";
137
131
  }
138
- return date.length > 0 && date[0] ? TimeHelper.displayDateTime(date[0], {
139
- autoTimezone: true
140
- }) + " - " + TimeHelper.displayDateTime(date[1] || date[0], {
141
- autoTimezone: true
142
- }) : "";
132
+ return date.length > 0 ? TimeHelper.displayDateTime(date[0]) + " - " + TimeHelper.displayDateTime(date[1] ?? date[0]) : "";
143
133
  };
144
134
  const onInput = (_value) => {
145
- const formattedDates = _value.map((d) => {
146
- const year = d.getFullYear();
147
- const month = String(d.getMonth() + 1).padStart(2, "0");
148
- const day = String(d.getDate()).padStart(2, "0");
149
- return `${year}-${month}-${day}`;
150
- });
151
135
  if (_value === null || _value === void 0) {
152
136
  value.value = void 0;
153
137
  emits("change", void 0);
@@ -155,8 +139,8 @@ const onInput = (_value) => {
155
139
  }
156
140
  if (props.disabledTime && !props.isReturnISO) {
157
141
  value.value = {
158
- start: formattedDates[0],
159
- end: formattedDates[1] || formattedDates[0]
142
+ start: TimeHelper.getDateFormTime(_value[0]),
143
+ end: TimeHelper.getDateFormTime(_value[1] || _value[0])
160
144
  };
161
145
  } else {
162
146
  value.value = {
@@ -1,61 +1,60 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <Datepicker
4
- :model-value="value"
5
- :teleport="teleport"
6
- :disabled="wrapperProps.disabled"
7
- :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
8
- :select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
9
- :locale="appConfig.core?.locale"
10
- :format="appConfig.core?.month_format"
11
- month-picker
12
- :placeholder="wrapperProps.placeholder"
13
- :min-date="minDate"
14
- :max-date="maxDate"
15
- :required="wrapperProps.required"
16
- :clearable="true"
17
- :always-clearable="true"
18
- :timezone="appConfig.core?.time_zone"
19
- @update:model-value="onInput"
20
- >
21
- <template
22
- v-if="appConfig.core?.is_thai_year"
23
- #year="{ year }"
24
- >
25
- {{ year + 543 }}
26
- </template>
27
- <template
28
- v-if="appConfig.core?.is_thai_year"
29
- #year-overlay-value="{ value }"
30
- >
31
- {{ value + 543 }}
32
- </template>
33
- <template #dp-input>
34
- <Input
35
- :trailing-icon="!wrapperProps.required && value ? void 0 : 'i-heroicons-calendar-days'"
36
- type="text"
37
- :disabled="wrapperProps.disabled"
38
- :model-value="formatDisplay(value)"
39
- :placeholder="wrapperProps.placeholder"
40
- :readonly="true"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <Datepicker
4
+ :model-value="value"
5
+ :teleport="teleport"
6
+ :disabled="wrapperProps.disabled"
7
+ :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
8
+ :select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
9
+ :locale="appConfig.core?.locale"
10
+ :format="appConfig.core?.month_format"
11
+ month-picker
12
+ :placeholder="wrapperProps.placeholder"
13
+ :min-date="minDate"
14
+ :max-date="maxDate"
15
+ :required="wrapperProps.required"
16
+ :clearable="true"
17
+ :always-clearable="true"
18
+ @update:model-value="onInput"
19
+ >
20
+ <template
21
+ v-if="appConfig.core?.is_thai_year"
22
+ #year="{ year }"
23
+ >
24
+ {{ year + 543 }}
25
+ </template>
26
+ <template
27
+ v-if="appConfig.core?.is_thai_year"
28
+ #year-overlay-value="{ value }"
29
+ >
30
+ {{ value + 543 }}
31
+ </template>
32
+ <template #dp-input>
33
+ <Input
34
+ :trailing-icon="!wrapperProps.required && value ? void 0 : 'i-heroicons-calendar-days'"
35
+ type="text"
36
+ :disabled="wrapperProps.disabled"
37
+ :model-value="formatDisplay(value)"
38
+ :placeholder="wrapperProps.placeholder"
39
+ :readonly="true"
41
40
  :ui="{
42
41
  base: 'cursor-pointer select-none',
43
42
  trailingIcon: 'cursor-pointer'
44
- }"
45
- />
46
- </template>
47
- <template #clear-icon="{ clear }">
48
- <Icon
49
- v-if="value && !wrapperProps.disabled && !wrapperProps.required"
50
- :name="clearIcon"
43
+ }"
44
+ />
45
+ </template>
46
+ <template #clear-icon="{ clear }">
47
+ <Icon
48
+ v-if="value && !wrapperProps.disabled && !wrapperProps.required"
49
+ :name="clearIcon"
51
50
  :class="theme.clearIcon({
52
51
  class: [ui?.clearIcon]
53
- })"
54
- @click.stop="clear"
55
- />
56
- </template>
57
- </Datepicker>
58
- </FieldWrapper>
52
+ })"
53
+ @click.stop="clear"
54
+ />
55
+ </template>
56
+ </Datepicker>
57
+ </FieldWrapper>
59
58
  </template>
60
59
 
61
60
  <script setup>
@@ -1,24 +1,24 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <InputNumber
4
- :model-value="value"
5
- :disabled="wrapperProps.disabled"
6
- :name="name"
7
- :placeholder="wrapperProps.placeholder"
8
- :autofocus="!!autoFocus"
9
- :readonly="readonly"
10
- :orientation="orientation"
11
- :increment-disabled="incrementDisabled"
12
- :decrement-disabled="decrementDisabled"
13
- :min="min"
14
- :max="max"
15
- :step="step"
16
- :disable-wheel-change="disableWheelChange"
17
- :format-options="formatOptions"
18
- :ui="ui"
19
- @update:model-value="onChange"
20
- />
21
- </FieldWrapper>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <InputNumber
4
+ :model-value="value"
5
+ :disabled="wrapperProps.disabled"
6
+ :name="name"
7
+ :placeholder="wrapperProps.placeholder"
8
+ :autofocus="!!autoFocus"
9
+ :readonly="readonly"
10
+ :orientation="orientation"
11
+ :increment-disabled="incrementDisabled"
12
+ :decrement-disabled="decrementDisabled"
13
+ :min="min"
14
+ :max="max"
15
+ :step="step"
16
+ :disable-wheel-change="disableWheelChange"
17
+ :format-options="formatOptions"
18
+ :ui="ui"
19
+ @update:model-value="onChange"
20
+ />
21
+ </FieldWrapper>
22
22
  </template>
23
23
 
24
24
  <script setup>
@@ -1,56 +1,48 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <SelectMenu
4
- :model-value="value"
5
- :items="options"
6
- :placeholder="wrapperProps.placeholder"
7
- :disabled="wrapperProps.disabled"
8
- :loading="loading"
9
- :search-input="searchInput"
10
- :selected-icon="selectedIcon"
11
- value-key="value"
12
- label-key="label"
13
- :icon="icon"
14
- :ui="ui"
15
- :leading-icon="options.find((item) => item.value === value)?.icon"
16
- :avatar="options.find((item) => item.value === value)?.avatar"
17
- @update:modelValue="onChange"
18
- @update:searchTerm="onSearch"
19
- >
20
- <template #default="{ modelValue, ui: selectMenuUi }">
21
- <Chip
22
- v-if="options.find((item) => item.value === modelValue)?.chip"
23
- v-bind="options.find((item) => item.value === modelValue)?.chip"
24
- inset
25
- standalone
26
- :size="selectMenuUi.itemLeadingChipSize()"
27
- :class="selectMenuUi.itemLeadingChip()"
28
- />
29
- <div
30
- v-if="value"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <SelectMenu
4
+ :model-value="value"
5
+ :items="options"
6
+ :placeholder="wrapperProps.placeholder"
7
+ :disabled="wrapperProps.disabled"
8
+ :loading="loading"
9
+ :search-input="searchInput"
10
+ :selected-icon="selectedIcon"
11
+ value-key="value"
12
+ label-key="label"
13
+ :icon="icon"
14
+ :ui="ui"
15
+ :leading-icon="options.find((item) => item.value === value)?.icon"
16
+ :avatar="options.find((item) => item.value === value)?.avatar"
17
+ @update:modelValue="onChange"
18
+ @update:searchTerm="onSearch"
19
+ >
20
+ <template #default="{ modelValue }">
21
+ <div
22
+ v-if="value"
31
23
  :class="theme.selectedWrapper({
32
24
  class: [ui?.selectedWrapper]
33
- })"
34
- >
35
- <span
25
+ })"
26
+ >
27
+ <span
36
28
  :class="theme.selectedLabel({
37
29
  class: [ui?.selectedLabel]
38
- })"
39
- >
40
- {{ options.find((item) => item.value === modelValue)?.label || modelValue }}
41
- </span>
42
- <Icon
43
- v-if="clearable"
44
- :name="clearIcon"
30
+ })"
31
+ >
32
+ {{ options.find((item) => item.value === modelValue)?.label || modelValue }}
33
+ </span>
34
+ <Icon
35
+ v-if="clearable"
36
+ :name="clearIcon"
45
37
  :class="theme.clearIcon({
46
38
  class: [ui?.clearIcon]
47
- })"
48
- @click.stop="onChange(void 0)"
49
- />
50
- </div>
51
- </template>
52
- </SelectMenu>
53
- </FieldWrapper>
39
+ })"
40
+ @click.stop="onChange(void 0)"
41
+ />
42
+ </div>
43
+ </template>
44
+ </SelectMenu>
45
+ </FieldWrapper>
54
46
  </template>
55
47
 
56
48
  <script setup>
@@ -1,76 +1,57 @@
1
1
  <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <SelectMenu
4
- :model-value="value"
5
- :items="options"
6
- multiple
7
- :placeholder="wrapperProps.placeholder"
8
- :disabled="wrapperProps.disabled"
9
- :loading="loading"
10
- :search-input="searchInput"
11
- :selected-icon="selectedIcon"
12
- value-key="value"
13
- label-key="label"
14
- :icon="icon"
15
- :ui="ui"
16
- :ignore-filter="!!$attrs.onSearch"
17
- @update:model-value="onChange"
18
- @update:searchTerm="onSearch"
19
- >
20
- <template #default="{ modelValue, ui: selectMenuUi }">
21
- <div
22
- v-if="!ArrayHelper.isEmpty(value)"
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <SelectMenu
4
+ :model-value="value"
5
+ :items="options"
6
+ multiple
7
+ :placeholder="wrapperProps.placeholder"
8
+ :disabled="wrapperProps.disabled"
9
+ :loading="loading"
10
+ :search-input="searchInput"
11
+ :selected-icon="selectedIcon"
12
+ value-key="value"
13
+ label-key="label"
14
+ :icon="icon"
15
+ :ui="ui"
16
+ :ignore-filter="!!$attrs.onSearch"
17
+ @update:model-value="onChange"
18
+ @update:searchTerm="onSearch"
19
+ >
20
+ <template #default="{ modelValue }">
21
+ <div
22
+ v-if="!ArrayHelper.isEmpty(value)"
23
23
  :class="theme.tagsWrapper({
24
24
  class: [ui?.tagsWrapper]
25
- })"
26
- >
27
- <div
28
- v-for="_value in ArrayHelper.toArray(modelValue)"
29
- :key="_value"
25
+ })"
26
+ >
27
+ <div
28
+ v-for="_value in ArrayHelper.toArray(modelValue)"
29
+ :key="_value"
30
30
  :class="theme.tagsItem({
31
31
  class: [ui?.tagsItem]
32
- })"
33
- >
34
- <Chip
35
- v-if="options.find((item) => item.value === _value)?.chip"
36
- v-bind="options.find((item) => item.value === _value)?.chip"
37
- inset
38
- standalone
39
- :size="selectMenuUi.itemLeadingChipSize()"
40
- class="p-1"
41
- />
42
- <Icon
43
- v-if="options.find((item) => item.value === _value)?.icon"
44
- :name="options.find((item) => item.value === _value)?.icon"
45
- class="size-4"
46
- />
47
- <Avatar
48
- v-if="options.find((item) => item.value === _value)?.avatar"
49
- v-bind="options.find((item) => item.value === _value)?.avatar"
50
- :class="selectMenuUi.itemLeadingAvatar()"
51
- size="2xs"
52
- />
53
- <div
32
+ })"
33
+ >
34
+ <div
54
35
  :class="theme.tagsItemText({
55
36
  class: [ui?.tagsItemText]
56
- })"
57
- >
58
- {{ options.find((item) => item.value === _value)?.label || _value }}
59
- <Icon
37
+ })"
38
+ >
39
+ {{ options.find((item) => item.value === _value)?.label || _value }}
40
+ <Icon
60
41
  :name="theme.tagsItemDeleteIcon({
61
42
  class: [ui?.tagsItemDeleteIcon]
62
- })"
43
+ })"
63
44
  :class="theme.tagsItemDelete({
64
45
  class: [ui?.tagsItemDelete]
65
- })"
66
- @click.stop="handleDelete(_value)"
67
- />
68
- </div>
69
- </div>
70
- </div>
71
- </template>
72
- </SelectMenu>
73
- </FieldWrapper>
46
+ })"
47
+ @click.stop="handleDelete(_value)"
48
+ />
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </template>
53
+ </SelectMenu>
54
+ </FieldWrapper>
74
55
  </template>
75
56
 
76
57
  <script setup>