@finema/core 3.23.2 → 3.24.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.
- package/README.md +22 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -14
- package/dist/runtime/components/DevToolsWindow/index.vue +24 -26
- package/dist/runtime/components/Dialog/index.vue +11 -10
- package/dist/runtime/components/Empty.d.vue.ts +1 -1
- package/dist/runtime/components/Empty.vue +16 -12
- package/dist/runtime/components/Empty.vue.d.ts +1 -1
- package/dist/runtime/components/FlexDeck/index.vue +85 -92
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/Fields.d.vue.ts +1 -1
- package/dist/runtime/components/Form/Fields.vue +17 -11
- package/dist/runtime/components/Form/Fields.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputCheckbox/index.vue +19 -23
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +1 -5
- package/dist/runtime/components/Form/InputCurrency/index.vue +56 -57
- package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +2 -0
- package/dist/runtime/components/Form/InputDateTime/index.vue +70 -80
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +78 -75
- package/dist/runtime/components/Form/InputMonth/index.vue +7 -10
- package/dist/runtime/components/Form/InputNumber/index.vue +21 -25
- package/dist/runtime/components/Form/InputRadio/index.d.vue.ts +1 -1
- package/dist/runtime/components/Form/InputRadio/index.vue +1 -5
- package/dist/runtime/components/Form/InputRadio/index.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputRating/index.vue +1 -5
- package/dist/runtime/components/Form/InputSearch/index.vue +2 -8
- package/dist/runtime/components/Form/InputSelect/index.vue +112 -122
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +121 -133
- package/dist/runtime/components/Form/InputTags/index.vue +55 -59
- package/dist/runtime/components/Form/InputText/index.vue +122 -133
- package/dist/runtime/components/Form/InputTextarea/index.vue +19 -23
- package/dist/runtime/components/Form/InputTime/index.vue +63 -63
- package/dist/runtime/components/Form/InputToggle/index.vue +18 -21
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +46 -49
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +57 -63
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +57 -64
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +57 -63
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImagePasteExtension.js +7 -6
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadExtension.js +13 -12
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +21 -19
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +85 -87
- package/dist/runtime/components/Form/InputWYSIWYG/README.md +96 -96
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue +178 -157
- package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
- package/dist/runtime/components/Form/fileState/FailedState.vue +34 -36
- package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +74 -78
- package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
- package/dist/runtime/components/Form/fileState/SuccessState.vue +3 -12
- package/dist/runtime/components/Form/fileState/useFileState.js +2 -10
- package/dist/runtime/components/Form/fileState/useUploadImageState.js +1 -3
- package/dist/runtime/components/Form/fileState/useUploadState.js +8 -19
- package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +25 -30
- package/dist/runtime/components/Form/index.vue +5 -5
- package/dist/runtime/components/Image.vue +22 -28
- package/dist/runtime/components/Loader.d.vue.ts +1 -1
- package/dist/runtime/components/Loader.vue +10 -7
- package/dist/runtime/components/Loader.vue.d.ts +1 -1
- package/dist/runtime/components/Log/LogItem.vue +1 -3
- package/dist/runtime/components/Log/index.vue +1 -3
- package/dist/runtime/components/Table/Base.vue +117 -137
- package/dist/runtime/components/Table/ColumnDate.vue +1 -1
- package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
- package/dist/runtime/components/Table/ColumnImage.vue +4 -4
- package/dist/runtime/components/Table/ColumnText.vue +10 -10
- package/dist/runtime/components/Table/Pagination.vue +71 -77
- package/dist/runtime/components/Table/Simple.vue +19 -19
- package/dist/runtime/components/Table/index.vue +36 -42
- package/dist/runtime/composables/loaderList.js +1 -3
- package/dist/runtime/composables/loaderPage.js +156 -133
- package/dist/runtime/composables/useConfig.js +1 -1
- package/dist/runtime/composables/useDialog.js +1 -3
- package/dist/runtime/composables/useForm.d.ts +1 -1
- package/dist/runtime/composables/useForm.js +1 -3
- package/dist/runtime/composables/useTable.js +2 -14
- package/dist/runtime/helpers/apiBaseHelper.js +6 -24
- package/dist/runtime/helpers/apiListHelper.js +2 -5
- package/dist/runtime/helpers/apiObjectHelper.js +2 -5
- package/dist/runtime/helpers/apiPageHelper.js +19 -38
- package/dist/runtime/helpers/componentHelper.js +2 -6
- package/dist/runtime/helpers/uploadCore.js +1 -4
- package/dist/runtime/locale/index.js +1 -4
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/styles/main.css +1 -1
- package/package.json +39 -26
|
@@ -62,11 +62,7 @@ const props = defineProps({
|
|
|
62
62
|
ui: { type: null, required: false },
|
|
63
63
|
containerUi: { type: null, required: false }
|
|
64
64
|
});
|
|
65
|
-
const {
|
|
66
|
-
value,
|
|
67
|
-
wrapperProps,
|
|
68
|
-
handleChange
|
|
69
|
-
} = useFieldHOC(props);
|
|
65
|
+
const { value, wrapperProps, handleChange } = useFieldHOC(props);
|
|
70
66
|
const onInput = (newValue) => {
|
|
71
67
|
handleChange(newValue);
|
|
72
68
|
emits("change", newValue);
|
|
@@ -78,7 +74,5 @@ const onClear = () => {
|
|
|
78
74
|
emits("clear");
|
|
79
75
|
emits("search", "");
|
|
80
76
|
};
|
|
81
|
-
const {
|
|
82
|
-
messages
|
|
83
|
-
} = useCoreMessages();
|
|
77
|
+
const { messages } = useCoreMessages();
|
|
84
78
|
</script>
|
|
@@ -1,135 +1,131 @@
|
|
|
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 ?? void 0"
|
|
10
|
-
:selected-icon="selectedIcon"
|
|
11
|
-
value-key="value"
|
|
12
|
-
label-key="label"
|
|
13
|
-
:icon="icon"
|
|
14
|
-
:ui="ui"
|
|
15
|
-
:variant="variant"
|
|
16
|
-
:ignore-filter="ignoreFilter"
|
|
17
|
-
:leading-icon="options.find((item2) => item2.value === value)?.icon"
|
|
18
|
-
:avatar="options.find((item2) => item2.value === value)?.avatar"
|
|
19
|
-
@update:modelValue="onChange"
|
|
20
|
-
@update:searchTerm="onSearch"
|
|
21
|
-
>
|
|
22
|
-
<template #default="{ modelValue, ui: selectMenuUi }">
|
|
23
|
-
<Chip
|
|
24
|
-
v-if="options.find((item2) => item2.value === modelValue)?.chip"
|
|
25
|
-
v-bind="options.find((item2) => item2.value === modelValue)?.chip"
|
|
26
|
-
inset
|
|
27
|
-
standalone
|
|
28
|
-
:size="selectMenuUi.itemLeadingChipSize()"
|
|
29
|
-
:class="selectMenuUi.itemLeadingChip()"
|
|
30
|
-
/>
|
|
31
|
-
<div
|
|
32
|
-
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 ?? void 0"
|
|
10
|
+
:selected-icon="selectedIcon"
|
|
11
|
+
value-key="value"
|
|
12
|
+
label-key="label"
|
|
13
|
+
:icon="icon"
|
|
14
|
+
:ui="ui"
|
|
15
|
+
:variant="variant"
|
|
16
|
+
:ignore-filter="ignoreFilter"
|
|
17
|
+
:leading-icon="options.find((item2) => item2.value === value)?.icon"
|
|
18
|
+
:avatar="options.find((item2) => item2.value === value)?.avatar"
|
|
19
|
+
@update:modelValue="onChange"
|
|
20
|
+
@update:searchTerm="onSearch"
|
|
21
|
+
>
|
|
22
|
+
<template #default="{ modelValue, ui: selectMenuUi }">
|
|
23
|
+
<Chip
|
|
24
|
+
v-if="options.find((item2) => item2.value === modelValue)?.chip"
|
|
25
|
+
v-bind="options.find((item2) => item2.value === modelValue)?.chip"
|
|
26
|
+
inset
|
|
27
|
+
standalone
|
|
28
|
+
:size="selectMenuUi.itemLeadingChipSize()"
|
|
29
|
+
:class="selectMenuUi.itemLeadingChip()"
|
|
30
|
+
/>
|
|
31
|
+
<div
|
|
32
|
+
v-if="value"
|
|
33
33
|
:class="
|
|
34
34
|
theme.selectedWrapper({
|
|
35
35
|
class: [ui?.selectedWrapper]
|
|
36
36
|
})
|
|
37
|
-
"
|
|
38
|
-
>
|
|
39
|
-
<div class="flex min-w-0 flex-1 items-center gap-x-2 overflow-hidden">
|
|
40
|
-
<component
|
|
41
|
-
:is="selectedOption.component"
|
|
42
|
-
v-if="
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/>
|
|
47
|
-
<span
|
|
37
|
+
"
|
|
38
|
+
>
|
|
39
|
+
<div class="flex min-w-0 flex-1 items-center gap-x-2 overflow-hidden">
|
|
40
|
+
<component
|
|
41
|
+
:is="selectedOption.component"
|
|
42
|
+
v-if="componentPosition === 'leading' && selectedOption?.component"
|
|
43
|
+
v-bind="selectedOption.componentProps"
|
|
44
|
+
/>
|
|
45
|
+
<span
|
|
48
46
|
:class="[
|
|
49
47
|
'min-w-0 flex-1',
|
|
50
48
|
theme.selectedLabel({
|
|
51
49
|
class: [ui?.selectedLabel]
|
|
52
50
|
})
|
|
53
|
-
]"
|
|
54
|
-
>
|
|
55
|
-
<span
|
|
51
|
+
]"
|
|
52
|
+
>
|
|
53
|
+
<span
|
|
56
54
|
:class="[
|
|
57
55
|
props.selectedLabelLines && props.selectedLabelLines > 1 ? 'block min-w-0 break-words whitespace-normal' : 'block min-w-0 truncate'
|
|
58
|
-
]"
|
|
59
|
-
:style="selectedLabelStyle"
|
|
60
|
-
>
|
|
61
|
-
{{ selectedOption?.label ?? modelValue }}
|
|
62
|
-
</span>
|
|
63
|
-
</span>
|
|
64
|
-
<component
|
|
65
|
-
:is="selectedOption.component"
|
|
66
|
-
v-if="
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
v-if="clearable"
|
|
74
|
-
:name="clearIcon"
|
|
56
|
+
]"
|
|
57
|
+
:style="selectedLabelStyle"
|
|
58
|
+
>
|
|
59
|
+
{{ selectedOption?.label ?? modelValue }}
|
|
60
|
+
</span>
|
|
61
|
+
</span>
|
|
62
|
+
<component
|
|
63
|
+
:is="selectedOption.component"
|
|
64
|
+
v-if="componentPosition === 'trailing' && selectedOption?.component"
|
|
65
|
+
v-bind="selectedOption.componentProps"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
<Icon
|
|
69
|
+
v-if="clearable"
|
|
70
|
+
:name="clearIcon"
|
|
75
71
|
:class="
|
|
76
72
|
theme.clearIcon({
|
|
77
73
|
class: [ui?.clearIcon]
|
|
78
74
|
})
|
|
79
|
-
"
|
|
80
|
-
@click.stop="onChange(void 0)"
|
|
81
|
-
/>
|
|
82
|
-
</div>
|
|
83
|
-
</template>
|
|
84
|
-
|
|
85
|
-
<template #item="{ item }">
|
|
86
|
-
<div
|
|
87
|
-
v-if="item?.type === 'separator'"
|
|
88
|
-
class="my-1 h-px bg-gray-200"
|
|
89
|
-
/>
|
|
90
|
-
<div
|
|
91
|
-
v-else
|
|
92
|
-
class="flex min-w-0 items-center gap-x-2"
|
|
93
|
-
>
|
|
94
|
-
<Chip
|
|
95
|
-
v-if="item?.chip"
|
|
96
|
-
v-bind="item.chip"
|
|
97
|
-
inset
|
|
98
|
-
standalone
|
|
99
|
-
size="2xs"
|
|
100
|
-
/>
|
|
101
|
-
<Icon
|
|
102
|
-
v-if="item?.icon"
|
|
103
|
-
:name="item.icon"
|
|
104
|
-
class="size-4"
|
|
105
|
-
/>
|
|
106
|
-
<Avatar
|
|
107
|
-
v-if="item?.avatar"
|
|
108
|
-
v-bind="item.avatar"
|
|
109
|
-
size="2xs"
|
|
110
|
-
/>
|
|
111
|
-
<component
|
|
112
|
-
:is="item?.component"
|
|
113
|
-
v-if="componentPosition === 'leading' && item?.component"
|
|
114
|
-
v-bind="item?.componentProps"
|
|
115
|
-
/>
|
|
116
|
-
<span
|
|
75
|
+
"
|
|
76
|
+
@click.stop="onChange(void 0)"
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<template #item="{ item }">
|
|
82
|
+
<div
|
|
83
|
+
v-if="item?.type === 'separator'"
|
|
84
|
+
class="my-1 h-px bg-gray-200"
|
|
85
|
+
/>
|
|
86
|
+
<div
|
|
87
|
+
v-else
|
|
88
|
+
class="flex min-w-0 items-center gap-x-2"
|
|
89
|
+
>
|
|
90
|
+
<Chip
|
|
91
|
+
v-if="item?.chip"
|
|
92
|
+
v-bind="item.chip"
|
|
93
|
+
inset
|
|
94
|
+
standalone
|
|
95
|
+
size="2xs"
|
|
96
|
+
/>
|
|
97
|
+
<Icon
|
|
98
|
+
v-if="item?.icon"
|
|
99
|
+
:name="item.icon"
|
|
100
|
+
class="size-4"
|
|
101
|
+
/>
|
|
102
|
+
<Avatar
|
|
103
|
+
v-if="item?.avatar"
|
|
104
|
+
v-bind="item.avatar"
|
|
105
|
+
size="2xs"
|
|
106
|
+
/>
|
|
107
|
+
<component
|
|
108
|
+
:is="item?.component"
|
|
109
|
+
v-if="componentPosition === 'leading' && item?.component"
|
|
110
|
+
v-bind="item?.componentProps"
|
|
111
|
+
/>
|
|
112
|
+
<span
|
|
117
113
|
:class="[
|
|
118
114
|
props.menuLabelLines && props.menuLabelLines > 1 ? 'min-w-0 break-words whitespace-normal' : 'truncate'
|
|
119
|
-
]"
|
|
120
|
-
:style="menuLabelStyle"
|
|
121
|
-
>
|
|
122
|
-
{{ item?.label ?? item?.value }}
|
|
123
|
-
</span>
|
|
124
|
-
<component
|
|
125
|
-
:is="item?.component"
|
|
126
|
-
v-if="componentPosition === 'trailing' && item?.component"
|
|
127
|
-
v-bind="item?.componentProps"
|
|
128
|
-
/>
|
|
129
|
-
</div>
|
|
130
|
-
</template>
|
|
131
|
-
</SelectMenu>
|
|
132
|
-
</FieldWrapper>
|
|
115
|
+
]"
|
|
116
|
+
:style="menuLabelStyle"
|
|
117
|
+
>
|
|
118
|
+
{{ item?.label ?? item?.value }}
|
|
119
|
+
</span>
|
|
120
|
+
<component
|
|
121
|
+
:is="item?.component"
|
|
122
|
+
v-if="componentPosition === 'trailing' && item?.component"
|
|
123
|
+
v-bind="item?.componentProps"
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
</template>
|
|
127
|
+
</SelectMenu>
|
|
128
|
+
</FieldWrapper>
|
|
133
129
|
</template>
|
|
134
130
|
|
|
135
131
|
<script setup>
|
|
@@ -170,14 +166,8 @@ const props = defineProps({
|
|
|
170
166
|
containerUi: { type: null, required: false }
|
|
171
167
|
});
|
|
172
168
|
const theme = computed(() => useUiConfig(selectMenuTheme, "selectMenu")());
|
|
173
|
-
const {
|
|
174
|
-
|
|
175
|
-
wrapperProps,
|
|
176
|
-
handleChange
|
|
177
|
-
} = useFieldHOC(props);
|
|
178
|
-
const selectedOption = computed(
|
|
179
|
-
() => props.options.find((item) => item.value === value.value)
|
|
180
|
-
);
|
|
169
|
+
const { value, wrapperProps, handleChange } = useFieldHOC(props);
|
|
170
|
+
const selectedOption = computed(() => props.options.find((item) => item.value === value.value));
|
|
181
171
|
const menuLabelStyle = computed(() => {
|
|
182
172
|
const lines = props.menuLabelLines ?? 1;
|
|
183
173
|
if (lines <= 1) return void 0;
|
|
@@ -1,148 +1,144 @@
|
|
|
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
|
-
:variant="variant"
|
|
15
|
-
:icon="icon"
|
|
16
|
-
:ui="ui"
|
|
17
|
-
:ignore-filter="ignoreFilter"
|
|
18
|
-
@update:model-value="onChange"
|
|
19
|
-
@update:searchTerm="onSearch"
|
|
20
|
-
>
|
|
21
|
-
<template #default="{ modelValue, ui: selectMenuUi }">
|
|
22
|
-
<div
|
|
23
|
-
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
|
+
:variant="variant"
|
|
15
|
+
:icon="icon"
|
|
16
|
+
:ui="ui"
|
|
17
|
+
:ignore-filter="ignoreFilter"
|
|
18
|
+
@update:model-value="onChange"
|
|
19
|
+
@update:searchTerm="onSearch"
|
|
20
|
+
>
|
|
21
|
+
<template #default="{ modelValue, ui: selectMenuUi }">
|
|
22
|
+
<div
|
|
23
|
+
v-if="!ArrayHelper.isEmpty(value)"
|
|
24
24
|
:class="
|
|
25
25
|
theme.tagsWrapper({
|
|
26
26
|
class: [ui?.tagsWrapper]
|
|
27
27
|
})
|
|
28
|
-
"
|
|
29
|
-
>
|
|
30
|
-
<div
|
|
31
|
-
v-for="_value in ArrayHelper.toArray(modelValue)"
|
|
32
|
-
:key="_value"
|
|
28
|
+
"
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
v-for="_value in ArrayHelper.toArray(modelValue)"
|
|
32
|
+
:key="_value"
|
|
33
33
|
:class="
|
|
34
34
|
theme.tagsItem({
|
|
35
35
|
class: [ui?.tagsItem]
|
|
36
36
|
})
|
|
37
|
-
"
|
|
38
|
-
>
|
|
39
|
-
<Chip
|
|
40
|
-
v-if="options.find((item2) => item2.value === _value)?.chip"
|
|
41
|
-
v-bind="options.find((item2) => item2.value === _value)?.chip"
|
|
42
|
-
inset
|
|
43
|
-
standalone
|
|
44
|
-
:size="selectMenuUi.itemLeadingChipSize()"
|
|
45
|
-
class="p-1"
|
|
46
|
-
/>
|
|
47
|
-
<Icon
|
|
48
|
-
v-if="options.find((item2) => item2.value === _value)?.icon"
|
|
49
|
-
:name="options.find((item2) => item2.value === _value)?.icon"
|
|
50
|
-
class="size-4"
|
|
51
|
-
/>
|
|
52
|
-
<Avatar
|
|
53
|
-
v-if="options.find((item2) => item2.value === _value)?.avatar"
|
|
54
|
-
v-bind="options.find((item2) => item2.value === _value)?.avatar"
|
|
55
|
-
:class="selectMenuUi.itemLeadingAvatar()"
|
|
56
|
-
size="2xs"
|
|
57
|
-
/>
|
|
58
|
-
<component
|
|
59
|
-
:is="getOption(_value)?.component"
|
|
60
|
-
v-if="
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/>
|
|
65
|
-
<div
|
|
37
|
+
"
|
|
38
|
+
>
|
|
39
|
+
<Chip
|
|
40
|
+
v-if="options.find((item2) => item2.value === _value)?.chip"
|
|
41
|
+
v-bind="options.find((item2) => item2.value === _value)?.chip"
|
|
42
|
+
inset
|
|
43
|
+
standalone
|
|
44
|
+
:size="selectMenuUi.itemLeadingChipSize()"
|
|
45
|
+
class="p-1"
|
|
46
|
+
/>
|
|
47
|
+
<Icon
|
|
48
|
+
v-if="options.find((item2) => item2.value === _value)?.icon"
|
|
49
|
+
:name="options.find((item2) => item2.value === _value)?.icon"
|
|
50
|
+
class="size-4"
|
|
51
|
+
/>
|
|
52
|
+
<Avatar
|
|
53
|
+
v-if="options.find((item2) => item2.value === _value)?.avatar"
|
|
54
|
+
v-bind="options.find((item2) => item2.value === _value)?.avatar"
|
|
55
|
+
:class="selectMenuUi.itemLeadingAvatar()"
|
|
56
|
+
size="2xs"
|
|
57
|
+
/>
|
|
58
|
+
<component
|
|
59
|
+
:is="getOption(_value)?.component"
|
|
60
|
+
v-if="componentPosition === 'leading' && getOption(_value)?.component"
|
|
61
|
+
v-bind="getOption(_value)?.componentProps"
|
|
62
|
+
/>
|
|
63
|
+
<div
|
|
66
64
|
:class="
|
|
67
65
|
theme.tagsItemText({
|
|
68
66
|
class: [ui?.tagsItemText]
|
|
69
67
|
})
|
|
70
|
-
"
|
|
71
|
-
>
|
|
72
|
-
{{ getOption(_value)?.label ?? _value }}
|
|
73
|
-
<component
|
|
74
|
-
:is="getOption(_value)?.component"
|
|
75
|
-
v-if="
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/>
|
|
80
|
-
<Icon
|
|
68
|
+
"
|
|
69
|
+
>
|
|
70
|
+
{{ getOption(_value)?.label ?? _value }}
|
|
71
|
+
<component
|
|
72
|
+
:is="getOption(_value)?.component"
|
|
73
|
+
v-if="componentPosition === 'trailing' && getOption(_value)?.component"
|
|
74
|
+
v-bind="getOption(_value)?.componentProps"
|
|
75
|
+
/>
|
|
76
|
+
<Icon
|
|
81
77
|
:name="
|
|
82
78
|
theme.tagsItemDeleteIcon({
|
|
83
79
|
class: [ui?.tagsItemDeleteIcon]
|
|
84
80
|
})
|
|
85
|
-
"
|
|
81
|
+
"
|
|
86
82
|
:class="
|
|
87
83
|
theme.tagsItemDelete({
|
|
88
84
|
class: [ui?.tagsItemDelete]
|
|
89
85
|
})
|
|
90
|
-
"
|
|
91
|
-
@click.stop="handleDelete(_value)"
|
|
92
|
-
/>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
</template>
|
|
97
|
-
|
|
98
|
-
<template #item="{ item }">
|
|
99
|
-
<div
|
|
100
|
-
v-if="item?.type === 'separator'"
|
|
101
|
-
class="my-1 h-px bg-gray-200"
|
|
102
|
-
/>
|
|
103
|
-
<div
|
|
104
|
-
v-else
|
|
105
|
-
class="flex min-w-0 items-center gap-x-2"
|
|
106
|
-
>
|
|
107
|
-
<Chip
|
|
108
|
-
v-if="item?.chip"
|
|
109
|
-
v-bind="item.chip"
|
|
110
|
-
inset
|
|
111
|
-
standalone
|
|
112
|
-
size="2xs"
|
|
113
|
-
/>
|
|
114
|
-
<Icon
|
|
115
|
-
v-if="item?.icon"
|
|
116
|
-
:name="item.icon"
|
|
117
|
-
class="size-4"
|
|
118
|
-
/>
|
|
119
|
-
<Avatar
|
|
120
|
-
v-if="item?.avatar"
|
|
121
|
-
v-bind="item.avatar"
|
|
122
|
-
size="2xs"
|
|
123
|
-
/>
|
|
124
|
-
<component
|
|
125
|
-
:is="item?.component"
|
|
126
|
-
v-if="componentPosition === 'leading' && item?.component"
|
|
127
|
-
v-bind="item?.componentProps"
|
|
128
|
-
/>
|
|
129
|
-
<span
|
|
86
|
+
"
|
|
87
|
+
@click.stop="handleDelete(_value)"
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<template #item="{ item }">
|
|
95
|
+
<div
|
|
96
|
+
v-if="item?.type === 'separator'"
|
|
97
|
+
class="my-1 h-px bg-gray-200"
|
|
98
|
+
/>
|
|
99
|
+
<div
|
|
100
|
+
v-else
|
|
101
|
+
class="flex min-w-0 items-center gap-x-2"
|
|
102
|
+
>
|
|
103
|
+
<Chip
|
|
104
|
+
v-if="item?.chip"
|
|
105
|
+
v-bind="item.chip"
|
|
106
|
+
inset
|
|
107
|
+
standalone
|
|
108
|
+
size="2xs"
|
|
109
|
+
/>
|
|
110
|
+
<Icon
|
|
111
|
+
v-if="item?.icon"
|
|
112
|
+
:name="item.icon"
|
|
113
|
+
class="size-4"
|
|
114
|
+
/>
|
|
115
|
+
<Avatar
|
|
116
|
+
v-if="item?.avatar"
|
|
117
|
+
v-bind="item.avatar"
|
|
118
|
+
size="2xs"
|
|
119
|
+
/>
|
|
120
|
+
<component
|
|
121
|
+
:is="item?.component"
|
|
122
|
+
v-if="componentPosition === 'leading' && item?.component"
|
|
123
|
+
v-bind="item?.componentProps"
|
|
124
|
+
/>
|
|
125
|
+
<span
|
|
130
126
|
:class="[
|
|
131
127
|
props.menuLabelLines && props.menuLabelLines > 1 ? 'min-w-0 break-words whitespace-normal' : 'truncate'
|
|
132
|
-
]"
|
|
133
|
-
:style="menuLabelStyle"
|
|
134
|
-
>
|
|
135
|
-
{{ item?.label ?? item?.value }}
|
|
136
|
-
</span>
|
|
137
|
-
<component
|
|
138
|
-
:is="item?.component"
|
|
139
|
-
v-if="componentPosition === 'trailing' && item?.component"
|
|
140
|
-
v-bind="item?.componentProps"
|
|
141
|
-
/>
|
|
142
|
-
</div>
|
|
143
|
-
</template>
|
|
144
|
-
</SelectMenu>
|
|
145
|
-
</FieldWrapper>
|
|
128
|
+
]"
|
|
129
|
+
:style="menuLabelStyle"
|
|
130
|
+
>
|
|
131
|
+
{{ item?.label ?? item?.value }}
|
|
132
|
+
</span>
|
|
133
|
+
<component
|
|
134
|
+
:is="item?.component"
|
|
135
|
+
v-if="componentPosition === 'trailing' && item?.component"
|
|
136
|
+
v-bind="item?.componentProps"
|
|
137
|
+
/>
|
|
138
|
+
</div>
|
|
139
|
+
</template>
|
|
140
|
+
</SelectMenu>
|
|
141
|
+
</FieldWrapper>
|
|
146
142
|
</template>
|
|
147
143
|
|
|
148
144
|
<script setup>
|
|
@@ -184,14 +180,8 @@ const props = defineProps({
|
|
|
184
180
|
containerUi: { type: null, required: false }
|
|
185
181
|
});
|
|
186
182
|
const theme = computed(() => useUiConfig(selectMenuTheme, "select")());
|
|
187
|
-
const {
|
|
188
|
-
|
|
189
|
-
wrapperProps,
|
|
190
|
-
handleChange
|
|
191
|
-
} = useFieldHOC(props);
|
|
192
|
-
const optionByValue = computed(
|
|
193
|
-
() => new Map(props.options.map((opt) => [opt.value, opt]))
|
|
194
|
-
);
|
|
183
|
+
const { value, wrapperProps, handleChange } = useFieldHOC(props);
|
|
184
|
+
const optionByValue = computed(() => new Map(props.options.map((opt) => [opt.value, opt])));
|
|
195
185
|
const getOption = (_value) => optionByValue.value.get(_value);
|
|
196
186
|
const componentPosition = computed(() => props.componentPosition);
|
|
197
187
|
const menuLabelStyle = computed(() => {
|
|
@@ -212,8 +202,6 @@ const onSearch = (value2) => {
|
|
|
212
202
|
emits("search", value2);
|
|
213
203
|
};
|
|
214
204
|
const handleDelete = (_value) => {
|
|
215
|
-
value.value = ArrayHelper.toArray(value.value).filter(
|
|
216
|
-
(item) => item !== _value
|
|
217
|
-
);
|
|
205
|
+
value.value = ArrayHelper.toArray(value.value).filter((item) => item !== _value);
|
|
218
206
|
};
|
|
219
207
|
</script>
|