@webitel/ui-sdk 26.6.12 → 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.
- package/dist/{contacts-BNeuB8IG.js → contacts-Bn25LSM7.js} +2 -2
- package/dist/{index-zPIqrQ5N.js → index-CIA7dKZk.js} +59 -59
- package/dist/{index-CXuua1os.js → index-DEyszQsx.js} +1 -1
- package/dist/{install-BjrTYVuH.js → install-BLruag0s.js} +13988 -12912
- package/dist/{isObject-SoSngRgc.js → isObject-wgGRYtgO.js} +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +3 -3
- package/dist/ui-sdk.umd.cjs +565 -279
- package/dist/{useVidstackSrc-DDO7Varm.js → useVidstackSrc-BBi5oq8T.js} +1 -1
- package/dist/{vidstack-Bq6c3Bam-B3uuwZ-b.js → vidstack-Bq6c3Bam-DXIHaRU6.js} +3 -3
- package/dist/{vidstack-D2pY00kU-Diq_9isr.js → vidstack-D2pY00kU-BE_AqirM.js} +3 -3
- package/dist/{vidstack-DDXt6fpN-CaMFUyJ8.js → vidstack-DDXt6fpN-D3xykUxG.js} +2 -2
- package/dist/{vidstack-D_-9AA6_-Bx6tzAhj.js → vidstack-D_-9AA6_-BDS42mA3.js} +2 -2
- package/dist/{vidstack-DqAw8m9J-BWMJ1klt.js → vidstack-DqAw8m9J-DtFh5mkx.js} +1 -1
- package/dist/{vidstack-audio-DJxrwNnm.js → vidstack-audio-BwtaRJRZ.js} +2 -2
- package/dist/{vidstack-dash-DfiQRJoI.js → vidstack-dash-CT0qNTAI.js} +4 -4
- package/dist/{vidstack-google-cast-DnCFt073.js → vidstack-google-cast-C4kSroiv.js} +4 -4
- package/dist/{vidstack-hls-Rp7tO2GF.js → vidstack-hls-CtCsnt_W.js} +4 -4
- package/dist/{vidstack-video-DlMUdTFO.js → vidstack-video-Bzwbx0RC.js} +3 -3
- package/dist/{vidstack-vimeo-DJHkA2Lp.js → vidstack-vimeo-CjK5ElAg.js} +4 -4
- package/dist/{vidstack-youtube-DG2-kzhq.js → vidstack-youtube-C9_vpuPD.js} +3 -3
- package/dist/{wt-action-bar-y0Z_PcDO.js → wt-action-bar-Bc_GH6kU.js} +1 -1
- package/dist/{wt-button-select-DlvGzhui.js → wt-button-select-Cc9o-NiI.js} +1 -1
- package/dist/{wt-call-media-action-Cdas1rBf.js → wt-call-media-action-sWq9pI2N.js} +1 -1
- package/dist/wt-chat-emoji-Cl3YsoL-.js +2909 -0
- package/dist/{wt-confirm-dialog-Dsa9e01T.js → wt-confirm-dialog-yyIkkLwI.js} +1 -1
- package/dist/{wt-context-menu-B43q5hgv.js → wt-context-menu-6WwSx8qR.js} +1 -1
- package/dist/{wt-copy-action-BkjbwUra.js → wt-copy-action-Ea6x__OX.js} +1 -1
- package/dist/{wt-datepicker-C9ra8YDO.js → wt-datepicker-Bi8iXDQC.js} +1 -1
- package/dist/{wt-display-chip-items-BJBcrF_I.js → wt-display-chip-items-CyshgAI0.js} +8 -8
- package/dist/{wt-dual-panel-BHxaWhEJ.js → wt-dual-panel-C3lUe446.js} +1 -1
- package/dist/{wt-dummy-DvlpQwdd.js → wt-dummy-07cnh7OP.js} +1 -1
- package/dist/{wt-error-page-CZ21yq7F.js → wt-error-page-P4gAwDj2.js} +1 -1
- package/dist/{wt-expansion-card-BnOn_xtW.js → wt-expansion-card-DsLok2qe.js} +5 -5
- package/dist/{wt-expansion-panel-BiGgAJP9.js → wt-expansion-panel-BLgze326.js} +9 -9
- package/dist/{wt-filters-panel-wrapper-DZAZUPuS.js → wt-filters-panel-wrapper-BI7tOtsM.js} +1 -1
- package/dist/{wt-galleria-DuA5s2p9.js → wt-galleria-DjUSBG29.js} +1 -1
- package/dist/{wt-inline-add-panel-D-huzxeZ.js → wt-inline-add-panel-Bg32h70I.js} +1 -1
- package/dist/{wt-navigation-menu-Djvm50Oh.js → wt-navigation-menu-BhoGF372.js} +1 -1
- package/dist/{wt-notifications-bar-Ds1CdGwf.js → wt-notifications-bar-o6ePcWRj.js} +2 -2
- package/dist/{wt-pagination-DfcicBop.js → wt-pagination-DXVZMbtn.js} +1 -1
- package/dist/wt-player-Dv6UMcr3.js +291 -0
- package/dist/wt-popover-BPVcjYrX.js +4 -0
- package/dist/{wt-popover-U7JE0uoX.js → wt-popover.vue_vue_type_script_setup_true_lang-BxD5Zt_u.js} +1 -1
- package/dist/{wt-screen-recordings-action-Cq3rkUYN.js → wt-screen-recordings-action-BjIRc7t6.js} +1 -1
- package/dist/{wt-search-bar-C83XJkVf.js → wt-search-bar-CiyJ55hK.js} +1 -1
- package/dist/{wt-selection-popup-D1_D542Y.js → wt-selection-popup-DLkerKfA.js} +1 -1
- package/dist/{wt-send-message-popup-C6UA_uEZ.js → wt-send-message-popup-CjfsCxfI.js} +18 -18
- package/dist/{wt-start-page-CJ0aR8_R.js → wt-start-page-C-3-3fZc.js} +11 -11
- package/dist/{wt-status-select-tB1EnTb8.js → wt-status-select-CiKHudco.js} +1 -1
- package/dist/{wt-stepper-D0Nr0ou6.js → wt-stepper-CvqNjYsK.js} +1 -1
- package/dist/{wt-table-WSCWJ0kN.js → wt-table-CBRWEe6H.js} +10 -10
- package/dist/{wt-table-actions-E-qeuwCv.js → wt-table-actions-ByAbJLsX.js} +1 -1
- package/dist/{wt-table-column-select-DUjDNDdD.js → wt-table-column-select-BsRkHmev.js} +2 -2
- package/dist/{wt-tabs-CkOB-0eU.js → wt-tabs-CtNBd15N.js} +1 -1
- package/dist/{wt-tags-input-D8gx3PLP.js → wt-tags-input-DD9rSzuh.js} +12 -12
- package/dist/{wt-timepicker-D8XuVSbS.js → wt-timepicker-Cka-r9m0.js} +1 -1
- package/dist/{wt-tree-Dw96n1ZK.js → wt-tree-sZocE-Ui.js} +2 -2
- package/dist/{wt-tree-table-B_tmJ7aV.js → wt-tree-table-D8JL2d1D.js} +29 -29
- package/dist/{wt-type-extension-value-input-Di67yDwH.js → wt-type-extension-value-input-C1Ez10TA.js} +3 -3
- package/dist/{wt-vidstack-player-zDlHHScB.js → wt-vidstack-player-Bv44QAeW.js} +10 -10
- package/package.json +1 -1
- package/src/components/_internals/composables/index.ts +7 -0
- package/src/components/_internals/composables/useSelect/useSelect.ts +101 -0
- package/src/components/_internals/composables/useSelect/useSelectCustomValues.ts +89 -0
- package/src/components/_internals/composables/useSelect/useSelectDropdown.ts +93 -0
- package/src/components/_internals/composables/useSelect/useSelectOptions.ts +198 -0
- package/src/components/_internals/composables/useSelect/useSelectUtils.ts +32 -0
- package/src/{composables → components/_internals/composables}/useWtTable/useWtTable.ts +1 -1
- package/src/components/_shared/settings-panel/components/speed-settings/speed-settings.vue +3 -1
- package/src/components/_shared/settings-panel/settings-panel.vue +2 -2
- package/src/components/index.js +6 -0
- package/src/components/wt-chip/wt-chip.vue +11 -2
- package/src/components/wt-expansion-card/wt-expansion-card.vue +1 -1
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +1 -1
- package/src/components/wt-galleria/wt-galleria.vue +4 -2
- package/src/components/wt-input-number/wt-input-number.vue +1 -2
- package/src/components/wt-input-text/wt-input-text.vue +3 -2
- package/src/components/wt-multi-select/wt-multi-select.vue +254 -0
- package/src/components/wt-password/wt-password.vue +1 -2
- package/src/components/wt-player/wt-player.vue +12 -1
- package/src/components/wt-single-select/wt-single-select.vue +229 -0
- package/src/components/wt-table/wt-table.vue +1 -2
- package/src/components/wt-tree-table/wt-tree-table.vue +1 -2
- package/src/composables/index.ts +0 -6
- package/src/locale/en/en.js +3 -0
- package/src/locale/es/es.js +3 -0
- package/src/locale/kz/kz.js +3 -0
- package/src/locale/pl/pl.js +3 -0
- package/src/locale/ro/ro.js +3 -0
- package/src/locale/ru/ru.js +3 -0
- package/src/locale/uk/uk.js +3 -0
- package/src/locale/uz/uz.js +3 -0
- package/src/locale/vi/vi.js +3 -0
- package/src/plugins/primevue/primevue.plugin.js +4 -0
- package/src/plugins/primevue/theme/components/checkbox/checkbox.js +1 -1
- package/src/plugins/primevue/theme/components/components.js +4 -0
- package/src/plugins/primevue/theme/components/multi-select/multi-select.js +32 -0
- package/src/plugins/primevue/theme/components/single-select/single-select.js +24 -0
- package/types/components/_internals/composables/index.d.ts +7 -0
- package/types/components/_internals/composables/useSelect/useSelect.d.ts +29 -0
- package/types/components/_internals/composables/useSelect/useSelectCustomValues.d.ts +16 -0
- package/types/components/_internals/composables/useSelect/useSelectDropdown.d.ts +20 -0
- package/types/components/_internals/composables/useSelect/useSelectOptions.d.ts +20 -0
- package/types/components/_internals/composables/useSelect/useSelectUtils.d.ts +3 -0
- package/types/{composables → components/_internals/composables}/useWtTable/useWtTable.d.ts +0 -1
- package/types/components/wt-chip/wt-chip.vue.d.ts +5 -1
- package/types/components/wt-multi-select/wt-multi-select.vue.d.ts +82 -0
- package/types/components/wt-select/wt-select.vue.d.ts +1 -1
- package/types/components/wt-single-select/wt-single-select.vue.d.ts +83 -0
- package/types/components/wt-table/wt-table.vue.d.ts +1 -1
- package/types/components/wt-tree-table/wt-tree-table.vue.d.ts +1 -1
- package/types/composables/index.d.ts +0 -6
- package/types/locale/en/en.d.ts +3 -0
- package/types/locale/es/es.d.ts +3 -0
- package/types/locale/i18n.d.ts +27 -0
- package/types/locale/index.d.ts +27 -0
- package/types/locale/kz/kz.d.ts +3 -0
- package/types/locale/pl/pl.d.ts +3 -0
- package/types/locale/ro/ro.d.ts +3 -0
- package/types/locale/ru/ru.d.ts +3 -0
- package/types/locale/uk/uk.d.ts +3 -0
- package/types/locale/uz/uz.d.ts +3 -0
- package/types/locale/vi/vi.d.ts +3 -0
- package/types/plugins/primevue/theme/components/components.d.ts +4 -0
- package/types/plugins/primevue/theme/components/multi-select/multi-select.d.ts +151 -0
- package/types/plugins/primevue/theme/components/single-select/single-select.d.ts +157 -0
- package/dist/wt-chat-emoji-C6ouRDpj.js +0 -2429
- package/dist/wt-player-CQhYaufW.js +0 -282
- package/src/components/wt-select/wt-select-v2.vue +0 -244
- package/types/components/wt-select/wt-select-v2.vue.d.ts +0 -77
- /package/src/{composables → components/_internals/composables}/useExpansion/useExpansion.ts +0 -0
- /package/src/{composables → components/_internals/composables}/useGalleriaFullscreen/useGalleriaFullscreen.ts +0 -0
- /package/src/{composables → components/_internals/composables}/useGalleriaMaskClick/useGalleriaMaskClick.ts +0 -0
- /package/src/{composables → components/_internals/composables}/useInputControl/useInputControl.ts +0 -0
- /package/src/{composables → components/_internals/composables}/useTableColumnDrag/useTableColumnDrag.ts +0 -0
- /package/types/{composables → components/_internals/composables}/useExpansion/useExpansion.d.ts +0 -0
- /package/types/{composables → components/_internals/composables}/useGalleriaFullscreen/useGalleriaFullscreen.d.ts +0 -0
- /package/types/{composables → components/_internals/composables}/useGalleriaMaskClick/useGalleriaMaskClick.d.ts +0 -0
- /package/types/{composables → components/_internals/composables}/useInputControl/useInputControl.d.ts +0 -0
- /package/types/{composables → components/_internals/composables}/useTableColumnDrag/useTableColumnDrag.d.ts +0 -0
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
>
|
|
22
22
|
<slot name="prefix" />
|
|
23
23
|
</p-input-group-addon>
|
|
24
|
+
<!-- $listeners is because of compat using in applications -->
|
|
24
25
|
<p-input-text
|
|
25
26
|
:id="inputId"
|
|
26
27
|
ref="inputText"
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
class="wt-input-text__input typo-body-1"
|
|
32
33
|
:inputmode="type"
|
|
33
34
|
v-bind="$attrs"
|
|
35
|
+
v-on="$listeners"
|
|
34
36
|
@update:model-value="inputHandler"
|
|
35
37
|
@keyup="handleKeyup"
|
|
36
38
|
/>
|
|
@@ -56,10 +58,9 @@
|
|
|
56
58
|
import type { RegleFieldStatus } from '@regle/core';
|
|
57
59
|
import type { InputTextProps } from 'primevue';
|
|
58
60
|
import { computed, defineModel, toRefs, useSlots, useTemplateRef } from 'vue';
|
|
59
|
-
|
|
60
|
-
import { useInputControl } from '../../composables';
|
|
61
61
|
import { ComponentSize, MessageColor, MessageVariant } from '../../enums';
|
|
62
62
|
import { useValidation } from '../../mixins/validationMixin/useValidation';
|
|
63
|
+
import { useInputControl } from '../_internals/composables';
|
|
63
64
|
|
|
64
65
|
interface WtInputTextProps extends /* @vue-ignore */ InputTextProps {
|
|
65
66
|
label?: string;
|
|
@@ -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;
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
>
|
|
57
57
|
import 'vidstack/bundle';
|
|
58
58
|
import type { MediaSrc } from 'vidstack';
|
|
59
|
-
import { ref, toRefs } from 'vue';
|
|
59
|
+
import { ref, toRefs, watch } from 'vue';
|
|
60
60
|
import { ComponentSize } from '../../enums';
|
|
61
61
|
import SettingsPanel, {
|
|
62
62
|
type MediaSettings,
|
|
@@ -203,6 +203,17 @@ function handleEnded(event: Event) {
|
|
|
203
203
|
const player = event.target as HTMLMediaElement;
|
|
204
204
|
player.currentTime = 0;
|
|
205
205
|
}
|
|
206
|
+
|
|
207
|
+
function resetPlayerSettings() {
|
|
208
|
+
playerSettings.value.playbackRate = 1;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
watch(
|
|
212
|
+
() => props.src,
|
|
213
|
+
() => {
|
|
214
|
+
resetPlayerSettings();
|
|
215
|
+
},
|
|
216
|
+
);
|
|
206
217
|
</script>
|
|
207
218
|
|
|
208
219
|
<style scoped>
|
|
@@ -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';
|
package/src/composables/index.ts
CHANGED
|
@@ -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';
|
package/src/locale/en/en.js
CHANGED
package/src/locale/es/es.js
CHANGED
package/src/locale/kz/kz.js
CHANGED
package/src/locale/pl/pl.js
CHANGED
package/src/locale/ro/ro.js
CHANGED
package/src/locale/ru/ru.js
CHANGED
package/src/locale/uk/uk.js
CHANGED
package/src/locale/uz/uz.js
CHANGED