@webitel/ui-sdk 26.6.13 → 26.6.14

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 (135) hide show
  1. package/dist/{contacts-BaxyRLLM.js → contacts-Bn25LSM7.js} +2 -2
  2. package/dist/{index-CigyElUb.js → index-CIA7dKZk.js} +1 -1
  3. package/dist/{index-DApIkp62.js → index-DEyszQsx.js} +1 -1
  4. package/dist/{install-DawOaJvS.js → install-BLruag0s.js} +14002 -12926
  5. package/dist/{isObject-CYCEPn3N.js → isObject-wgGRYtgO.js} +1 -1
  6. package/dist/ui-sdk.css +1 -1
  7. package/dist/ui-sdk.js +1 -1
  8. package/dist/ui-sdk.umd.cjs +565 -279
  9. package/dist/{useVidstackSrc-DyrOa4mk.js → useVidstackSrc-BBi5oq8T.js} +1 -1
  10. package/dist/{vidstack-Bq6c3Bam-CAY97-jZ.js → vidstack-Bq6c3Bam-DXIHaRU6.js} +3 -3
  11. package/dist/{vidstack-D2pY00kU-CueRPheM.js → vidstack-D2pY00kU-BE_AqirM.js} +3 -3
  12. package/dist/{vidstack-DDXt6fpN-BRLi6AkS.js → vidstack-DDXt6fpN-D3xykUxG.js} +2 -2
  13. package/dist/{vidstack-D_-9AA6_-Dc5WN-OL.js → vidstack-D_-9AA6_-BDS42mA3.js} +2 -2
  14. package/dist/{vidstack-DqAw8m9J-D32aS290.js → vidstack-DqAw8m9J-DtFh5mkx.js} +1 -1
  15. package/dist/{vidstack-audio-BbddnRPa.js → vidstack-audio-BwtaRJRZ.js} +2 -2
  16. package/dist/{vidstack-dash-BNYPf-SD.js → vidstack-dash-CT0qNTAI.js} +4 -4
  17. package/dist/{vidstack-google-cast-f5Q76VEc.js → vidstack-google-cast-C4kSroiv.js} +4 -4
  18. package/dist/{vidstack-hls-hJ9GD_pP.js → vidstack-hls-CtCsnt_W.js} +4 -4
  19. package/dist/{vidstack-video-qY9NJ4Rl.js → vidstack-video-Bzwbx0RC.js} +3 -3
  20. package/dist/{vidstack-vimeo-Dcb0hTaj.js → vidstack-vimeo-CjK5ElAg.js} +4 -4
  21. package/dist/{vidstack-youtube-B29lleYJ.js → vidstack-youtube-C9_vpuPD.js} +3 -3
  22. package/dist/{wt-action-bar-ChN3mio6.js → wt-action-bar-Bc_GH6kU.js} +1 -1
  23. package/dist/{wt-button-select-KD0cPK4H.js → wt-button-select-Cc9o-NiI.js} +1 -1
  24. package/dist/{wt-call-media-action-BvM04q4r.js → wt-call-media-action-sWq9pI2N.js} +1 -1
  25. package/dist/wt-chat-emoji-Cl3YsoL-.js +2909 -0
  26. package/dist/{wt-confirm-dialog-DMquYnrJ.js → wt-confirm-dialog-yyIkkLwI.js} +1 -1
  27. package/dist/{wt-context-menu-ToE9-ffe.js → wt-context-menu-6WwSx8qR.js} +1 -1
  28. package/dist/{wt-copy-action-Bylf142B.js → wt-copy-action-Ea6x__OX.js} +1 -1
  29. package/dist/{wt-datepicker-BV7rf6Wk.js → wt-datepicker-Bi8iXDQC.js} +1 -1
  30. package/dist/{wt-display-chip-items-CXv8kX5b.js → wt-display-chip-items-CyshgAI0.js} +11 -11
  31. package/dist/{wt-dual-panel-Jmj4ip6N.js → wt-dual-panel-C3lUe446.js} +1 -1
  32. package/dist/{wt-dummy-BxEArso4.js → wt-dummy-07cnh7OP.js} +1 -1
  33. package/dist/{wt-error-page-rcqO8ZX0.js → wt-error-page-P4gAwDj2.js} +1 -1
  34. package/dist/{wt-expansion-card-By036A5Q.js → wt-expansion-card-DsLok2qe.js} +5 -5
  35. package/dist/{wt-expansion-panel-BFYozFsJ.js → wt-expansion-panel-BLgze326.js} +9 -9
  36. package/dist/{wt-filters-panel-wrapper-C49nxd6Z.js → wt-filters-panel-wrapper-BI7tOtsM.js} +1 -1
  37. package/dist/{wt-galleria-72LEmzfX.js → wt-galleria-DjUSBG29.js} +1 -1
  38. package/dist/{wt-inline-add-panel-CL0aM32a.js → wt-inline-add-panel-Bg32h70I.js} +1 -1
  39. package/dist/{wt-navigation-menu-B87j3Gxu.js → wt-navigation-menu-BhoGF372.js} +1 -1
  40. package/dist/{wt-notifications-bar-DJ7zMmH9.js → wt-notifications-bar-o6ePcWRj.js} +2 -2
  41. package/dist/{wt-pagination-D1kszR59.js → wt-pagination-DXVZMbtn.js} +1 -1
  42. package/dist/{wt-player-1VkST0ny.js → wt-player-Dv6UMcr3.js} +2 -2
  43. package/dist/{wt-screen-recordings-action-Boy3xJvB.js → wt-screen-recordings-action-BjIRc7t6.js} +1 -1
  44. package/dist/{wt-search-bar-D1qU-jDZ.js → wt-search-bar-CiyJ55hK.js} +1 -1
  45. package/dist/{wt-selection-popup-Bwa7CJym.js → wt-selection-popup-DLkerKfA.js} +1 -1
  46. package/dist/{wt-send-message-popup-1NrObXfW.js → wt-send-message-popup-CjfsCxfI.js} +18 -18
  47. package/dist/{wt-start-page-D3XXOoLT.js → wt-start-page-C-3-3fZc.js} +1 -1
  48. package/dist/{wt-status-select-BOPkG0nj.js → wt-status-select-CiKHudco.js} +1 -1
  49. package/dist/{wt-stepper-2TcrBla0.js → wt-stepper-CvqNjYsK.js} +1 -1
  50. package/dist/{wt-table-DpasMSII.js → wt-table-CBRWEe6H.js} +2 -2
  51. package/dist/{wt-table-actions-CQ67TwoU.js → wt-table-actions-ByAbJLsX.js} +1 -1
  52. package/dist/{wt-table-column-select-BZH5aqRk.js → wt-table-column-select-BsRkHmev.js} +2 -2
  53. package/dist/{wt-tabs-DOiZ6vld.js → wt-tabs-CtNBd15N.js} +1 -1
  54. package/dist/{wt-tags-input-DrP4EVai.js → wt-tags-input-DD9rSzuh.js} +2 -2
  55. package/dist/{wt-timepicker-CenAtHJ9.js → wt-timepicker-Cka-r9m0.js} +1 -1
  56. package/dist/{wt-tree-vAsblHJz.js → wt-tree-sZocE-Ui.js} +2 -2
  57. package/dist/{wt-tree-table-Bu35HIvM.js → wt-tree-table-D8JL2d1D.js} +2 -2
  58. package/dist/{wt-type-extension-value-input-B6k7nGgn.js → wt-type-extension-value-input-C1Ez10TA.js} +3 -3
  59. package/dist/{wt-vidstack-player-NmB4VBNR.js → wt-vidstack-player-Bv44QAeW.js} +10 -10
  60. package/package.json +1 -1
  61. package/src/components/_internals/composables/index.ts +7 -0
  62. package/src/components/_internals/composables/useSelect/useSelect.ts +101 -0
  63. package/src/components/_internals/composables/useSelect/useSelectCustomValues.ts +89 -0
  64. package/src/components/_internals/composables/useSelect/useSelectDropdown.ts +93 -0
  65. package/src/components/_internals/composables/useSelect/useSelectOptions.ts +198 -0
  66. package/src/components/_internals/composables/useSelect/useSelectUtils.ts +32 -0
  67. package/src/{composables → components/_internals/composables}/useWtTable/useWtTable.ts +1 -1
  68. package/src/components/index.js +6 -0
  69. package/src/components/wt-chip/wt-chip.vue +11 -2
  70. package/src/components/wt-expansion-card/wt-expansion-card.vue +1 -1
  71. package/src/components/wt-expansion-panel/wt-expansion-panel.vue +1 -1
  72. package/src/components/wt-galleria/wt-galleria.vue +4 -2
  73. package/src/components/wt-input-number/wt-input-number.vue +1 -2
  74. package/src/components/wt-input-text/wt-input-text.vue +3 -2
  75. package/src/components/wt-multi-select/wt-multi-select.vue +254 -0
  76. package/src/components/wt-password/wt-password.vue +1 -2
  77. package/src/components/wt-single-select/wt-single-select.vue +229 -0
  78. package/src/components/wt-table/wt-table.vue +1 -2
  79. package/src/components/wt-tree-table/wt-tree-table.vue +1 -2
  80. package/src/composables/index.ts +0 -6
  81. package/src/locale/en/en.js +3 -0
  82. package/src/locale/es/es.js +3 -0
  83. package/src/locale/kz/kz.js +3 -0
  84. package/src/locale/pl/pl.js +3 -0
  85. package/src/locale/ro/ro.js +3 -0
  86. package/src/locale/ru/ru.js +3 -0
  87. package/src/locale/uk/uk.js +3 -0
  88. package/src/locale/uz/uz.js +3 -0
  89. package/src/locale/vi/vi.js +3 -0
  90. package/src/plugins/primevue/primevue.plugin.js +4 -0
  91. package/src/plugins/primevue/theme/components/checkbox/checkbox.js +1 -1
  92. package/src/plugins/primevue/theme/components/components.js +4 -0
  93. package/src/plugins/primevue/theme/components/multi-select/multi-select.js +32 -0
  94. package/src/plugins/primevue/theme/components/single-select/single-select.js +24 -0
  95. package/types/components/_internals/composables/index.d.ts +7 -0
  96. package/types/components/_internals/composables/useSelect/useSelect.d.ts +29 -0
  97. package/types/components/_internals/composables/useSelect/useSelectCustomValues.d.ts +16 -0
  98. package/types/components/_internals/composables/useSelect/useSelectDropdown.d.ts +20 -0
  99. package/types/components/_internals/composables/useSelect/useSelectOptions.d.ts +20 -0
  100. package/types/components/_internals/composables/useSelect/useSelectUtils.d.ts +3 -0
  101. package/types/{composables → components/_internals/composables}/useWtTable/useWtTable.d.ts +0 -1
  102. package/types/components/wt-chip/wt-chip.vue.d.ts +5 -1
  103. package/types/components/wt-multi-select/wt-multi-select.vue.d.ts +82 -0
  104. package/types/components/wt-select/wt-select.vue.d.ts +1 -1
  105. package/types/components/wt-single-select/wt-single-select.vue.d.ts +83 -0
  106. package/types/components/wt-table/wt-table.vue.d.ts +1 -1
  107. package/types/components/wt-tree-table/wt-tree-table.vue.d.ts +1 -1
  108. package/types/composables/index.d.ts +0 -6
  109. package/types/locale/en/en.d.ts +3 -0
  110. package/types/locale/es/es.d.ts +3 -0
  111. package/types/locale/i18n.d.ts +27 -0
  112. package/types/locale/index.d.ts +27 -0
  113. package/types/locale/kz/kz.d.ts +3 -0
  114. package/types/locale/pl/pl.d.ts +3 -0
  115. package/types/locale/ro/ro.d.ts +3 -0
  116. package/types/locale/ru/ru.d.ts +3 -0
  117. package/types/locale/uk/uk.d.ts +3 -0
  118. package/types/locale/uz/uz.d.ts +3 -0
  119. package/types/locale/vi/vi.d.ts +3 -0
  120. package/types/plugins/primevue/theme/components/components.d.ts +4 -0
  121. package/types/plugins/primevue/theme/components/multi-select/multi-select.d.ts +151 -0
  122. package/types/plugins/primevue/theme/components/single-select/single-select.d.ts +157 -0
  123. package/dist/wt-chat-emoji-0UBEtnmy.js +0 -2429
  124. package/src/components/wt-select/wt-select-v2.vue +0 -244
  125. package/types/components/wt-select/wt-select-v2.vue.d.ts +0 -77
  126. /package/src/{composables → components/_internals/composables}/useExpansion/useExpansion.ts +0 -0
  127. /package/src/{composables → components/_internals/composables}/useGalleriaFullscreen/useGalleriaFullscreen.ts +0 -0
  128. /package/src/{composables → components/_internals/composables}/useGalleriaMaskClick/useGalleriaMaskClick.ts +0 -0
  129. /package/src/{composables → components/_internals/composables}/useInputControl/useInputControl.ts +0 -0
  130. /package/src/{composables → components/_internals/composables}/useTableColumnDrag/useTableColumnDrag.ts +0 -0
  131. /package/types/{composables → components/_internals/composables}/useExpansion/useExpansion.d.ts +0 -0
  132. /package/types/{composables → components/_internals/composables}/useGalleriaFullscreen/useGalleriaFullscreen.d.ts +0 -0
  133. /package/types/{composables → components/_internals/composables}/useGalleriaMaskClick/useGalleriaMaskClick.d.ts +0 -0
  134. /package/types/{composables → components/_internals/composables}/useInputControl/useInputControl.d.ts +0 -0
  135. /package/types/{composables → components/_internals/composables}/useTableColumnDrag/useTableColumnDrag.d.ts +0 -0
@@ -0,0 +1,254 @@
1
+ <template>
2
+ <div class="wt-multi-select">
3
+ <wt-label
4
+ v-if="hasLabel"
5
+ :disabled="disabled"
6
+ :invalid="invalid"
7
+ class="wt-select__label"
8
+ v-bind="labelProps">
9
+ <!-- @slot Custom input label -->
10
+ <slot name="label" v-bind="{ label }">
11
+ {{ requiredLabel }}
12
+ </slot>
13
+ </wt-label>
14
+ <p-multi-select
15
+ ref="selectRef"
16
+ v-model="model"
17
+ fluid
18
+ input-class="typo-body-1"
19
+ :display="chipsView ? 'chip' : 'comma'"
20
+ :show-toggle-all="false"
21
+ :invalid="invalid"
22
+ :id="selectId"
23
+ :show-clear="showClear"
24
+ :disabled="disabled"
25
+ :placeholder="placeholder || label"
26
+ :option-disabled="() => disabledOptions"
27
+ :options="filteredOptions"
28
+ :option-label="(option) => getOptionLabel(option)"
29
+ :option-value="optionValue"
30
+ :loading="isLoading"
31
+ :max-selected-labels="MAX_SELECTED_LABELS"
32
+ :selectedItemsLabel="`${model.length} ${t('webitelUI.select.selectedItemsLabel')}`"
33
+ :data-key="dataKey"
34
+ v-bind="$attrs"
35
+ @before-show="onDropdownBeforeShow"
36
+ @before-hide="onDropdownBeforeHide"
37
+ @show="onDropdownShow"
38
+ @hide="onDropdownHide"
39
+ >
40
+ <template #header>
41
+ <wt-input-text
42
+ v-if="filterable"
43
+ ref="filterInput"
44
+ :model-value="filterText"
45
+ @update:model-value="filterOptions($event)"
46
+ @keydown.enter.stop="onInputKeydown"
47
+ >
48
+ <template #suffix>
49
+ <wt-icon v-if="allowCustomValues && filterText" icon="select-custom-value-enter" />
50
+ <wt-icon icon="search" />
51
+ </template>
52
+ </wt-input-text>
53
+ </template>
54
+ <template #option="{ option }">
55
+ <span
56
+ class="wt-multi-select__option-label"
57
+ v-tooltip="getOptionLabel(option)"
58
+ >
59
+ {{ getOptionLabel(option) }}
60
+ </span>
61
+ </template>
62
+ <template #itemcheckboxicon="{checked}">
63
+ <wt-checkbox
64
+ :selected="checked"
65
+ class="wt-multi-select__option-checkbox"
66
+ />
67
+ </template>
68
+ <template #clearicon>
69
+ <wt-icon-btn
70
+ v-if="showClear && model"
71
+ icon="close"
72
+ @click="clearValue"
73
+ />
74
+ </template>
75
+ <template #dropdownicon>
76
+ <wt-icon :icon="isDropdownOpen ? 'arrow-up' : 'arrow-down'" />
77
+ </template>
78
+ <template #loadingicon>
79
+ <wt-loader :size="ComponentSize.SM" />
80
+ </template>
81
+ <template #chip="{ value, removeCallback }">
82
+ <wt-chip
83
+ removable
84
+ :color="ChipColor.SECONDARY"
85
+ @remove="removeCallback($event)"
86
+ >
87
+ {{ getOptionLabel(value) }}
88
+ </wt-chip>
89
+ </template>
90
+ </p-multi-select>
91
+ <wt-message
92
+ v-if="isValidation && validationText"
93
+ :color="validationTextColor"
94
+ :variant="MessageVariant.SIMPLE"
95
+ :size="ComponentSize.SM"
96
+ >
97
+ {{ validationText }}
98
+ </wt-message>
99
+ </div>
100
+ </template>
101
+
102
+ <script setup lang="ts">
103
+ import type { SelectProps } from 'primevue';
104
+ import { computed, onMounted, toRefs, useSlots, useTemplateRef } from 'vue';
105
+ import { useI18n } from 'vue-i18n';
106
+ import { ChipColor, ComponentSize, MessageVariant } from '../../enums';
107
+ import { useValidation } from '../../mixins/validationMixin/useValidation';
108
+ import { useSelect } from '../_internals/composables/useSelect/useSelect';
109
+ import { toArray } from '../_internals/composables/useSelect/useSelectUtils';
110
+
111
+ interface Props extends SelectProps {
112
+ label?: string;
113
+ placeholder?: string;
114
+ required?: boolean;
115
+ disabled?: boolean;
116
+ /**
117
+ * true disables all options but keeps dropdown visible
118
+ */
119
+ disabledOptions?: boolean;
120
+ /**
121
+ * false disables options search
122
+ */
123
+ filterable?: boolean;
124
+ /**
125
+ * true shows the clear button
126
+ */
127
+ showClear?: boolean;
128
+ options?: unknown[];
129
+ optionLabel?: string;
130
+ optionValue?: string;
131
+ /**
132
+ * A property to uniquely identify an option.
133
+ */
134
+ dataKey?: string;
135
+ /**
136
+ * Function that returns filtered options for server-side search
137
+ */
138
+ searchMethod?: () => void;
139
+ /**
140
+ * true allows adding custom values through the filter input
141
+ */
142
+ allowCustomValues?: boolean;
143
+ /**
144
+ * true emits custom values through the filter input instead of adding them automatically
145
+ */
146
+ manualCustomValues?: boolean;
147
+ chipsView?: boolean;
148
+ labelProps?: object;
149
+ v?: Record<string, unknown>;
150
+ regleValidation?: RegleFieldStatus<string>;
151
+ customValidators?: unknown[];
152
+ }
153
+
154
+ const props = withDefaults(defineProps<Props>(), {
155
+ filterable: true,
156
+ showClear: true,
157
+ options: () => [],
158
+ optionLabel: 'label',
159
+ dataKey: 'id',
160
+ labelProps: () => ({}),
161
+ customValidators: () => [],
162
+ });
163
+
164
+ const model = defineModel({
165
+ default: [],
166
+ get(value) {
167
+ return toArray(value);
168
+ },
169
+ });
170
+
171
+ const { t } = useI18n();
172
+
173
+ const MAX_SELECTED_LABELS = 3;
174
+
175
+ const selectId = `select-${Math.random().toString(36).slice(2, 11)}`;
176
+
177
+ const filterInput = useTemplateRef('filterInput');
178
+ const selectRef = useTemplateRef('selectRef');
179
+
180
+ const emit = defineEmits<{
181
+ 'add:custom-value': [
182
+ value: string,
183
+ ];
184
+ reset: [];
185
+ }>();
186
+
187
+ const {
188
+ isLoading,
189
+ isDropdownOpen,
190
+ filterText,
191
+ filteredOptions,
192
+ getOptionLabel,
193
+ fetchOptions,
194
+ onDropdownBeforeShow,
195
+ onDropdownBeforeHide,
196
+ onDropdownShow,
197
+ onDropdownHide,
198
+ filterOptions,
199
+ onInputKeydown,
200
+ clearValue,
201
+ } = useSelect({
202
+ selected: model,
203
+ options: computed(() => props.options),
204
+ optionLabel: computed(() => props.optionLabel),
205
+ optionValue: computed(() => props.optionValue),
206
+ dataKey: computed(() => props.dataKey),
207
+ allowCustomValues: computed(() => props.allowCustomValues),
208
+ manualCustomValues: computed(() => props.manualCustomValues),
209
+ filterInput,
210
+ selectRef,
211
+ searchMethod: computed(() => props.searchMethod),
212
+ selectId: computed(() => selectId),
213
+ isSingle: false,
214
+ emit,
215
+ });
216
+
217
+ const slots = useSlots();
218
+
219
+ const { v, customValidators, regleValidation } = toRefs(props);
220
+
221
+ const { isValidation, invalid, validationText, validationTextColor } =
222
+ useValidation({
223
+ v,
224
+ customValidators,
225
+ regleValidation,
226
+ });
227
+
228
+ const hasLabel = computed(() => {
229
+ return props.label || slots.label;
230
+ });
231
+
232
+ const requiredLabel = computed(() => {
233
+ return props.required ? `${props.label}*` : props.label;
234
+ });
235
+
236
+ onMounted(() => {
237
+ if (props.searchMethod) fetchOptions();
238
+ });
239
+ </script>
240
+
241
+ <style scoped>
242
+ .wt-multi-select {
243
+ width: 100%;
244
+ min-width: 0;
245
+ }
246
+
247
+ .wt-multi-select__option-label {
248
+ user-select: none;
249
+ }
250
+
251
+ .wt-multi-select__option-checkbox {
252
+ pointer-events: none;
253
+ }
254
+ </style>
@@ -60,10 +60,9 @@ import {
60
60
  useSlots,
61
61
  useTemplateRef,
62
62
  } from 'vue';
63
-
64
- import { useInputControl } from '../../composables';
65
63
  import { ComponentSize, MessageColor, MessageVariant } from '../../enums';
66
64
  import { useValidation } from '../../mixins/validationMixin/useValidation';
65
+ import { useInputControl } from '../_internals/composables';
67
66
 
68
67
  interface WtPasswordProps extends /* @vue-ignore */ PasswordProps {
69
68
  label?: string;
@@ -0,0 +1,229 @@
1
+ <template>
2
+ <div class="wt-single-select">
3
+ <wt-label
4
+ v-if="hasLabel"
5
+ :disabled="disabled"
6
+ :invalid="invalid"
7
+ class="wt-select__label"
8
+ v-bind="labelProps">
9
+ <!-- @slot Custom input label -->
10
+ <slot name="label" v-bind="{ label }">
11
+ {{ requiredLabel }}
12
+ </slot>
13
+ </wt-label>
14
+ <p-select
15
+ ref="selectRef"
16
+ v-model="model"
17
+ fluid
18
+ input-class="typo-body-1"
19
+ :invalid="invalid"
20
+ :id="selectId"
21
+ :show-clear="showClear"
22
+ :disabled="disabled"
23
+ :placeholder="placeholder || label"
24
+ :option-disabled="() => disabledOptions"
25
+ :options="filteredOptions"
26
+ :option-label="(option) => getOptionLabel(option)"
27
+ :option-value="optionValue"
28
+ :loading="isLoading"
29
+ :data-key="dataKey"
30
+ v-bind="$attrs"
31
+ @before-show="onDropdownBeforeShow"
32
+ @before-hide="onDropdownBeforeHide"
33
+ @show="onDropdownShow"
34
+ @hide="onDropdownHide"
35
+ >
36
+ <template #header>
37
+ <wt-input-text
38
+ v-if="filterable"
39
+ ref="filterInput"
40
+ :model-value="filterText"
41
+ @update:model-value="filterOptions($event)"
42
+ @keydown.enter.stop="onInputKeydown"
43
+ >
44
+ <template #suffix>
45
+ <wt-icon v-if="allowCustomValues && filterText" icon="select-custom-value-enter" />
46
+ <wt-icon icon="search" />
47
+ </template>
48
+ </wt-input-text>
49
+ </template>
50
+ <template v-if="model" #value="{ value, placeholder }">
51
+ <slot name="value" v-bind="{ value, getOptionLabel, placeholder }">
52
+ <span
53
+ v-tooltip="getOptionLabel(value)"
54
+ >
55
+ {{ getOptionLabel(value) || placeholder }}
56
+ </span>
57
+ </slot>
58
+ </template>
59
+ <template #option="{ option }">
60
+ <slot name="option" v-bind="{ option, getOptionLabel }">
61
+ <span
62
+ class="wt-single-select__option-label"
63
+ v-tooltip="getOptionLabel(option)"
64
+ >
65
+ {{ getOptionLabel(option) }}
66
+ </span>
67
+ </slot>
68
+ </template>
69
+ <template #clearicon>
70
+ <wt-icon-btn
71
+ v-if="showClear && model"
72
+ icon="close"
73
+ @click="clearValue"
74
+ />
75
+ </template>
76
+ <template #dropdownicon>
77
+ <wt-icon :icon="isDropdownOpen ? 'arrow-up' : 'arrow-down'" />
78
+ </template>
79
+ <template #loadingicon>
80
+ <wt-loader :size="ComponentSize.SM" />
81
+ </template>
82
+ </p-select>
83
+ <wt-message
84
+ v-if="isValidation && validationText"
85
+ :color="validationTextColor"
86
+ :variant="MessageVariant.SIMPLE"
87
+ :size="ComponentSize.SM"
88
+ >
89
+ {{ validationText }}
90
+ </wt-message>
91
+ </div>
92
+ </template>
93
+
94
+ <script setup lang="ts">
95
+ import type { SelectProps } from 'primevue';
96
+ import { computed, onMounted, toRefs, useSlots, useTemplateRef } from 'vue';
97
+ import { ComponentSize, MessageColor, MessageVariant } from '../../enums';
98
+ import { useValidation } from '../../mixins/validationMixin/useValidation';
99
+ import { useSelect } from '../_internals/composables/useSelect/useSelect';
100
+
101
+ interface Props extends SelectProps {
102
+ label?: string;
103
+ placeholder?: string;
104
+ required?: boolean;
105
+ disabled?: boolean;
106
+ /**
107
+ * true disables all options but keeps dropdown visible
108
+ */
109
+ disabledOptions?: boolean;
110
+ /**
111
+ * false disables options search
112
+ */
113
+ filterable?: boolean;
114
+ /**
115
+ * true shows the clear button
116
+ */
117
+ showClear?: boolean;
118
+ options?: unknown[];
119
+ optionLabel?: string;
120
+ optionValue?: string;
121
+ /**
122
+ * A property to uniquely identify an option.
123
+ */
124
+ dataKey?: string;
125
+ /**
126
+ * Function that returns filtered options for server-side search
127
+ */
128
+ searchMethod?: () => void;
129
+ /**
130
+ * true allows adding custom values through the filter input
131
+ */
132
+ allowCustomValues?: boolean;
133
+ labelProps?: object;
134
+ v?: Record<string, unknown>;
135
+ regleValidation?: RegleFieldStatus<string>;
136
+ customValidators?: unknown[];
137
+ }
138
+
139
+ const props = withDefaults(defineProps<Props>(), {
140
+ filterable: true,
141
+ showClear: true,
142
+ options: () => [],
143
+ optionLabel: 'label',
144
+ dataKey: 'id',
145
+ labelProps: () => ({}),
146
+ customValidators: () => [],
147
+ });
148
+
149
+ const model = defineModel<string>({
150
+ default: '',
151
+ get: (value) => {
152
+ if (value == null) return '';
153
+ if (typeof value !== 'object') return value;
154
+ return Object.keys(value).length > 0 ? value : '';
155
+ },
156
+ });
157
+
158
+ const emit = defineEmits<{
159
+ reset: [];
160
+ }>();
161
+
162
+ const selectId = `select-${Math.random().toString(36).slice(2, 11)}`;
163
+
164
+ const filterInput = useTemplateRef('filterInput');
165
+ const selectRef = useTemplateRef('selectRef');
166
+
167
+ const {
168
+ isLoading,
169
+ isDropdownOpen,
170
+ filterText,
171
+ filteredOptions,
172
+ getOptionLabel,
173
+ fetchOptions,
174
+ onDropdownBeforeShow,
175
+ onDropdownBeforeHide,
176
+ onDropdownShow,
177
+ onDropdownHide,
178
+ filterOptions,
179
+ onInputKeydown,
180
+ clearValue,
181
+ } = useSelect({
182
+ selected: model,
183
+ options: computed(() => props.options),
184
+ optionLabel: computed(() => props.optionLabel),
185
+ optionValue: computed(() => props.optionValue),
186
+ dataKey: computed(() => props.dataKey),
187
+ allowCustomValues: computed(() => props.allowCustomValues),
188
+ filterInput,
189
+ selectRef,
190
+ searchMethod: computed(() => props.searchMethod),
191
+ selectId: computed(() => selectId),
192
+ isSingle: true,
193
+ emit,
194
+ });
195
+
196
+ const slots = useSlots();
197
+
198
+ const { v, customValidators, regleValidation } = toRefs(props);
199
+
200
+ const { isValidation, invalid, validationText, validationTextColor } =
201
+ useValidation({
202
+ v,
203
+ customValidators,
204
+ regleValidation,
205
+ });
206
+
207
+ const hasLabel = computed(() => {
208
+ return props.label || slots.label;
209
+ });
210
+
211
+ const requiredLabel = computed(() => {
212
+ return props.required ? `${props.label}*` : props.label;
213
+ });
214
+
215
+ onMounted(() => {
216
+ if (props.searchMethod) fetchOptions();
217
+ });
218
+ </script>
219
+
220
+ <style scoped>
221
+ .wt-single-select {
222
+ width: 100%;
223
+ min-width: 0;
224
+ }
225
+
226
+ .wt-single-select__option-label {
227
+ user-select: none;
228
+ }
229
+ </style>
@@ -228,9 +228,8 @@ import {
228
228
  useTemplateRef,
229
229
  } from 'vue';
230
230
  import { useI18n } from 'vue-i18n';
231
-
232
- import { useTableColumnDrag } from '../../composables';
233
231
  import { getNextSortOrder } from '../../scripts/sortQueryAdapters.js';
232
+ import { useTableColumnDrag } from '../_internals/composables';
234
233
  import type { WtTableHeader } from './types/WtTable';
235
234
 
236
235
  /**
@@ -100,9 +100,8 @@
100
100
  lang="ts"
101
101
  >
102
102
  import { computed, toRef } from 'vue';
103
-
104
- import { useWtTable } from '../../composables/useWtTable/useWtTable';
105
103
  import { getNextSortOrder } from '../../scripts/sortQueryAdapters';
104
+ import { useWtTable } from '../_internals/composables/useWtTable/useWtTable';
106
105
  import WtCheckbox from '../wt-checkbox/wt-checkbox.vue';
107
106
  import type { WtTableHeader } from '../wt-table/types/WtTable.d.ts';
108
107
  import WtTreeTableRow from '../wt-tree-table-row/wt-tree-table-row.vue';
@@ -4,11 +4,5 @@ export * from './useCard/useCardComponent';
4
4
  export * from './useCard/useCardTabs';
5
5
  export * from './useClose/useClose';
6
6
  export * from './useDestroyableSortable/useDestroyableSortable';
7
- export * from './useExpansion/useExpansion';
8
- export * from './useGalleriaFullscreen/useGalleriaFullscreen';
9
- export * from './useGalleriaMaskClick/useGalleriaMaskClick';
10
- export * from './useInputControl/useInputControl';
11
7
  export * from './useRepresentableAgentPauseCause/useRepresentableAgentPauseCause';
12
- export * from './useTableColumnDrag/useTableColumnDrag';
13
8
  export * from './useValidate/useValidate';
14
- export * from './useWtTable/useWtTable';
@@ -845,6 +845,9 @@ export default deepmerge(
845
845
  },
846
846
  },
847
847
  },
848
+ select: {
849
+ selectedItemsLabel: 'items selected',
850
+ },
848
851
  },
849
852
  systemNotifications: {
850
853
  success: {
@@ -832,6 +832,9 @@ export default {
832
832
  },
833
833
  },
834
834
  },
835
+ select: {
836
+ selectedItemsLabel: 'elementos seleccionados',
837
+ },
835
838
  systemNotifications: {
836
839
  success: {
837
840
  update: ({ named }) =>
@@ -835,6 +835,9 @@ export default {
835
835
  },
836
836
  },
837
837
  },
838
+ select: {
839
+ selectedItemsLabel: 'элемент таңдалды',
840
+ },
838
841
  systemNotifications: {
839
842
  success: {
840
843
  update: ({ named }) => `${named('entity').toLowerCase()} жаңартылды`,
@@ -834,6 +834,9 @@ export default {
834
834
  },
835
835
  },
836
836
  },
837
+ select: {
838
+ selectedItemsLabel: 'elementów wybranych',
839
+ },
837
840
  systemNotifications: {
838
841
  success: {
839
842
  update: ({ named }) =>
@@ -839,6 +839,9 @@ export default {
839
839
  },
840
840
  },
841
841
  },
842
+ select: {
843
+ selectedItemsLabel: 'elemente selectate',
844
+ },
842
845
  systemNotifications: {
843
846
  success: {
844
847
  update: ({ named }) =>
@@ -830,6 +830,9 @@ export default {
830
830
  },
831
831
  },
832
832
  },
833
+ select: {
834
+ selectedItemsLabel: 'элементов выбрано',
835
+ },
833
836
  systemNotifications: {
834
837
  success: {
835
838
  update: ({ named }) => `${named('entity')} был обновлён`,
@@ -829,6 +829,9 @@ export default {
829
829
  },
830
830
  },
831
831
  },
832
+ select: {
833
+ selectedItemsLabel: 'елементів вибрано',
834
+ },
832
835
  systemNotifications: {
833
836
  success: {
834
837
  update: ({ named }) => `${named('entity')} було оновлено`,
@@ -838,6 +838,9 @@ export default {
838
838
  },
839
839
  },
840
840
  },
841
+ select: {
842
+ selectedItemsLabel: 'ta element tanlandi',
843
+ },
841
844
  systemNotifications: {
842
845
  success: {
843
846
  update: ({ named }) => `${named('entity').toLowerCase()} yangilandi`,
@@ -837,6 +837,9 @@ export default {
837
837
  },
838
838
  },
839
839
  },
840
+ select: {
841
+ selectedItemsLabel: 'mục đã chọn',
842
+ },
840
843
  systemNotifications: {
841
844
  success: {
842
845
  update: ({ named }) =>
@@ -17,9 +17,11 @@ import PInputNumber from 'primevue/inputnumber';
17
17
  import PInputText from 'primevue/inputtext';
18
18
  import PMenubar from 'primevue/menubar';
19
19
  import PMessage from 'primevue/message';
20
+ import PMultiSelect from 'primevue/multiselect';
20
21
  import PPassword from 'primevue/password';
21
22
  import PPopover from 'primevue/popover';
22
23
  import PRadio from 'primevue/radiobutton';
24
+ import PSelect from 'primevue/select';
23
25
  import PSlider from 'primevue/slider';
24
26
  import PTextarea from 'primevue/textarea';
25
27
  import PToggleSwitch from 'primevue/toggleswitch';
@@ -80,6 +82,8 @@ const initPrimevue = (app) => {
80
82
  changeComponentCompatMode(PInputGroupAddon),
81
83
  );
82
84
  app.component('PMessage', changeComponentCompatMode(PMessage));
85
+ app.component('PMultiSelect', changeComponentCompatMode(PMultiSelect));
86
+ app.component('PSelect', changeComponentCompatMode(PSelect));
83
87
 
84
88
  app.directive('tooltip', Tooltip);
85
89
  };
@@ -6,7 +6,7 @@ const checkbox = {
6
6
 
7
7
  css: ({ dt }) => `
8
8
  .p-checkbox {
9
- width: ${dt('checkbox.root.wrapperWidth')};
9
+ min-width: ${dt('checkbox.root.wrapperWidth')};
10
10
  height: ${dt('checkbox.root.wrapperHeight')};
11
11
  align-items: center;
12
12
  justify-content: center;
@@ -13,9 +13,11 @@ import inputNumber from './input-number/input-number.js';
13
13
  import inputText from './input-text/input-text.js';
14
14
  import menubar from './menubar/menubar.js';
15
15
  import message from './message/message.js';
16
+ import multiSelect from './multi-select/multi-select.js';
16
17
  import password from './password/password.js';
17
18
  import popover from './popover/popover.js';
18
19
  import radio from './radio/radio.js';
20
+ import singleSelect from './single-select/single-select.js';
19
21
  import slider from './slider/slider.js';
20
22
  import switcher from './switcher/switcher.js';
21
23
  import table from './table/table.js';
@@ -48,6 +50,8 @@ const components = {
48
50
  datatable: table,
49
51
  toolbar,
50
52
  galleria,
53
+ multiselect: multiSelect,
54
+ select: singleSelect,
51
55
  };
52
56
 
53
57
  export default components;