@ironsource/shared-ui 1.4.3-rc.4 → 1.4.3

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 (137) hide show
  1. package/AddFilterButton.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  2. package/AppTrigger.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  3. package/AutocompleteInput.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  4. package/Banner.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  5. package/Button.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  6. package/ButtonBase.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  7. package/CalendarMonth.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  8. package/Chip.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  9. package/DateRange.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  10. package/Dialog.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  11. package/Dropdown.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  12. package/Dropdown.vue_vue_type_style_index_1_lang.css +1 -1
  13. package/Editable.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  14. package/EmptyState.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  15. package/FilterSearchInput.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  16. package/FloatingToolbar.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  17. package/IconButton.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  18. package/IncludeExclude.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  19. package/IncludeExcludeAppTrigger.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  20. package/IncludeExcludeChipFilter.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  21. package/IncludeExcludeDragDrop.vue_vue_type_style_index_0_scoped_true_lang.css +1 -0
  22. package/IncludeExcludeOptionDraggable.vue_vue_type_style_index_0_scoped_true_lang.css +1 -0
  23. package/Input.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  24. package/Menu.vue_vue_type_style_index_1_lang.css +1 -1
  25. package/MenuItem.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  26. package/Popover.vue_vue_type_style_index_0_lang.css +1 -1
  27. package/README.md +36 -21
  28. package/ScrollButton.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  29. package/Search.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  30. package/SearchInput.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  31. package/Snackbar.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  32. package/Switch.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  33. package/Table.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  34. package/Table.vue_vue_type_style_index_1_lang.css +1 -1
  35. package/Tabs.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  36. package/TextArea.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  37. package/Toggle.vue_vue_type_style_index_0_scoped_true_lang.css +1 -1
  38. package/components/appTrigger/AppTrigger.vue.js +3 -3
  39. package/components/autocompleteDropdown/AutocompleteDropdown.vue.js +1 -2
  40. package/components/button/{common/ButtonSuper.vue.js → Button.vue.js} +7 -7
  41. package/components/button/{common/ButtonBase.vue.d.ts → ButtonBase.vue.d.ts} +9 -9
  42. package/components/button/{common/ButtonBase.vue.js → ButtonBase.vue.js} +8 -8
  43. package/components/button/{v3/IconButton.vue.js → IconButton.vue.js} +7 -7
  44. package/components/button/{v3/ScrollButton.vue.js → ScrollButton.vue.js} +6 -6
  45. package/components/button/index.d.ts +126 -0
  46. package/components/checkbox/Checkbox.vue.d.ts +1 -1
  47. package/components/checkbox/index.d.ts +9 -9
  48. package/components/chip/{v3/Chip.vue.js → Chip.vue.js} +5 -5
  49. package/components/dateRange/CalendarMonth.vue.js +3 -3
  50. package/components/dateRange/DateRange.vue.js +4 -4
  51. package/components/dateRange/consts.d.ts +5 -0
  52. package/components/dateRange/consts.vue.js +8 -0
  53. package/components/dateRange/index.d.ts +3 -3
  54. package/components/dialog/Dialog.vue.d.ts +1 -1
  55. package/components/dialog/Dialog.vue.js +6 -7
  56. package/components/dialog/index.d.ts +11 -11
  57. package/components/dropdown/Dropdown.vue.d.ts +2 -2
  58. package/components/dropdown/Dropdown.vue.js +5 -5
  59. package/components/dropdown/SearchInput.vue.js +5 -6
  60. package/components/dropdown/index.d.ts +16 -16
  61. package/components/emptyState/EmptyState.vue.d.ts +1 -1
  62. package/components/emptyState/EmptyState.vue.js +4 -4
  63. package/components/emptyState/index.d.ts +14 -14
  64. package/components/filterDropdown/AddFilterButton.vue.js +2 -2
  65. package/components/filterDropdown/FilterDropdown.vue.js +1 -2
  66. package/components/filtersPanel/FilterSearchInput.vue.js +2 -2
  67. package/components/floatingToolbar/FloatingToolbar.vue.js +5 -6
  68. package/components/icon/Icon.vue.js +2 -0
  69. package/components/icon/icons/Hammer.vue.d.ts +2 -0
  70. package/components/icon/icons/Hammer.vue.js +26 -0
  71. package/components/icon/icons/TableEdit.vue.d.ts +2 -0
  72. package/components/icon/icons/TableEdit.vue.js +24 -0
  73. package/components/icon/icons/index.d.ts +6 -0
  74. package/components/icon/icons/index.vue.js +6 -0
  75. package/components/icon/index.d.ts +6 -0
  76. package/components/includeExclude/IncludeExclude.vue.js +5 -5
  77. package/components/includeExclude/IncludeExcludeAppHeader.vue.js +7 -4
  78. package/components/includeExclude/IncludeExcludeAppTrigger.vue.js +3 -3
  79. package/components/includeExclude/IncludeExcludeChipFilter.vue.js +8 -6
  80. package/components/includeExclude/IncludeExcludeDragDrop.vue.d.ts +125 -0
  81. package/components/includeExclude/IncludeExcludeDragDrop.vue.js +610 -0
  82. package/components/{chip/v4/ChipV4.vue.d.ts → includeExclude/IncludeExcludeOptionDraggable.vue.d.ts} +18 -23
  83. package/components/includeExclude/IncludeExcludeOptionDraggable.vue.js +126 -0
  84. package/components/includeExclude/includeExcludeMocks.d.ts +12 -0
  85. package/components/includeExclude/index.d.ts +228 -7
  86. package/components/includeExclude/index.vue.js +6 -0
  87. package/components/input/Input.vue.d.ts +2 -2
  88. package/components/input/Input.vue.js +3 -3
  89. package/components/input/index.d.ts +16 -16
  90. package/components/menu/Menu.vue.d.ts +1 -1
  91. package/components/menu/index.d.ts +5 -5
  92. package/components/snackbar/Snackbar.vue.d.ts +1 -1
  93. package/components/snackbar/Snackbar.vue.js +5 -6
  94. package/components/switch/{v3/Switch.vue.js → Switch.vue.js} +5 -5
  95. package/components/table/Table.types.d.ts +1 -0
  96. package/components/table/Table.vue.d.ts +13 -0
  97. package/components/table/Table.vue.js +34 -12
  98. package/components/table/index.d.ts +25 -0
  99. package/components/table-cells/Editable.vue.js +1 -1
  100. package/components/tooltip/Tooltip.vue.d.ts +1 -1
  101. package/components/tooltip/index.d.ts +5 -5
  102. package/components/typography/index.d.ts +9 -9
  103. package/index.d.ts +3 -429
  104. package/index.vue.js +11 -18
  105. package/package.json +13 -21
  106. package/styleguide.scss +78 -77
  107. package/ButtonBase.vue_vue_type_style_index_1_scoped_true_lang.css +0 -1
  108. package/ButtonSuper.vue_vue_type_style_index_0_scoped_true_lang.css +0 -1
  109. package/ButtonV4.vue_vue_type_style_index_0_scoped_true_lang.css +0 -1
  110. package/ChipV4.vue_vue_type_style_index_0_scoped_true_lang.css +0 -1
  111. package/SwitchV4.vue_vue_type_style_index_0_scoped_true_lang.css +0 -1
  112. package/components/ThemeWrapper/ThemeStrore.d.ts +0 -4
  113. package/components/ThemeWrapper/ThemeWrapper.vue.d.ts +0 -15
  114. package/components/button/common/ButtonSuper.vue.d.ts +0 -42
  115. package/components/button/v3/Button.vue.js +0 -40
  116. package/components/button/v3/index.d.ts +0 -126
  117. package/components/button/v4/ButtonV4.vue.d.ts +0 -52
  118. package/components/button/v4/ButtonV4.vue.js +0 -44
  119. package/components/button/v4/index.d.ts +0 -72
  120. package/components/button/v4/index.vue.js +0 -6
  121. package/components/chip/v4/ChipV4.vue.js +0 -76
  122. package/components/chip/v4/index.d.ts +0 -63
  123. package/components/chip/v4/index.vue.js +0 -6
  124. package/components/switch/v4/SwitchV4.vue.d.ts +0 -37
  125. package/components/switch/v4/SwitchV4.vue.js +0 -87
  126. package/components/switch/v4/index.d.ts +0 -46
  127. package/components/switch/v4/index.vue.js +0 -6
  128. /package/components/button/{v3/Button.vue.d.ts → Button.vue.d.ts} +0 -0
  129. /package/components/button/{v3/IconButton.vue.d.ts → IconButton.vue.d.ts} +0 -0
  130. /package/components/button/{v3/ScrollButton.vue.d.ts → ScrollButton.vue.d.ts} +0 -0
  131. /package/components/button/{v3/index.vue.js → index.vue.js} +0 -0
  132. /package/components/chip/{v3/Chip.vue.d.ts → Chip.vue.d.ts} +0 -0
  133. /package/components/chip/{v3/index.d.ts → index.d.ts} +0 -0
  134. /package/components/chip/{v3/index.vue.js → index.vue.js} +0 -0
  135. /package/components/switch/{v3/Switch.vue.d.ts → Switch.vue.d.ts} +0 -0
  136. /package/components/switch/{v3/index.d.ts → index.d.ts} +0 -0
  137. /package/components/switch/{v3/index.vue.js → index.vue.js} +0 -0
@@ -0,0 +1,610 @@
1
+ import { defineComponent, computed, ref, watch, provide, openBlock, createBlock, unref, withCtx, createElementVNode, renderSlot, normalizeClass, createTextVNode, toDisplayString, createCommentVNode, createVNode, Transition, createElementBlock, mergeProps, Fragment, renderList, toRaw, isRef, nextTick } from 'vue';
2
+ import _sfc_main$1 from '../popover/Popover.vue.js';
3
+ import Button from '../button/Button.vue.js';
4
+ /* empty css */import _export_sfc from '../../_virtual/plugin-vue_export-helper.vue.js';
5
+ /* empty css */import Text from '../typography/Text.vue.js';
6
+ /* empty css *//* empty css *//* empty css */import 'floating-vue';
7
+ /* empty css *//* empty css */import Search from '../search/Search.vue.js';
8
+ import Checkbox from '../checkbox/Checkbox.vue.js';
9
+ import Skeleton from '../skeleton/Skeleton.vue.js';
10
+ import EmptyState from '../emptyState/EmptyState.vue.js';
11
+ import { useToggle } from '../../composables/useToggle.vue.js';
12
+ import { IncludeExcludeContext } from './IncludeExcludeContext.vue.js';
13
+ import { onClickOutside, useClamp, useVirtualList } from '@vueuse/core';
14
+ import draggable from 'vuedraggable';
15
+ /* empty css */
16
+ import "../../IncludeExcludeDragDrop.vue_vue_type_style_index_0_scoped_true_lang.css";
17
+ const _hoisted_1 = { class: "include-exclude-header" };
18
+ const _hoisted_2 = { class: "include-exclude-header-left-section" };
19
+ const _hoisted_3 = { class: "include-exclude-header-right-section" };
20
+ const _hoisted_4 = { class: "include-exclude-container-wrapper" };
21
+ const _hoisted_5 = {
22
+ key: 0,
23
+ class: "include-exclude-container"
24
+ };
25
+ const _hoisted_6 = {
26
+ key: 1,
27
+ class: "include-exclude-container"
28
+ };
29
+ const _hoisted_7 = { class: "include-exclude-list-wrapper" };
30
+ const _hoisted_8 = {
31
+ key: 1,
32
+ class: "loader-wrapper"
33
+ };
34
+ const _hoisted_9 = ["aria-selected", "aria-disabled", "onClick"];
35
+ const _hoisted_10 = ["onClick"];
36
+ const _hoisted_11 = { key: 1 };
37
+ const _hoisted_12 = { class: "loader-wrapper" };
38
+ const _hoisted_13 = { class: "include-exclude-selected-wrapper" };
39
+ const _hoisted_14 = {
40
+ key: 0,
41
+ class: "loader-wrapper"
42
+ };
43
+ const _hoisted_15 = { class: "include-exclude-selected-header-left" };
44
+ const _hoisted_16 = { class: "include-exclude-selected-header-right" };
45
+ const _hoisted_17 = { class: "drag-item" };
46
+ const _hoisted_18 = { key: 1 };
47
+ const _hoisted_19 = { class: "loader-wrapper" };
48
+ const _hoisted_20 = { class: "include-exclude-footer" };
49
+ const _hoisted_21 = { class: "include-exclude-footer-buttons" };
50
+ const _sfc_main = /* @__PURE__ */ defineComponent({
51
+ __name: "IncludeExcludeDragDrop",
52
+ props: {
53
+ titleText: { default: "" },
54
+ loading: { type: Boolean, default: false },
55
+ disabled: { type: Boolean, default: false },
56
+ modelValue: null,
57
+ clearable: { type: Boolean },
58
+ placement: { default: "bottom-start" },
59
+ options: null,
60
+ autoFocus: { type: Boolean, default: true },
61
+ onSearch: { type: Function, default: () => true },
62
+ searchPlaceholder: { default: "Search" },
63
+ isOnTop: { type: Boolean, default: false },
64
+ alwayesOpen: { type: Boolean, default: false },
65
+ defaultOpen: { type: Boolean, default: false },
66
+ showClearAll: { type: Boolean, default: true },
67
+ distance: { default: 0 },
68
+ distanceOffset: { default: 0 },
69
+ skiddingOffset: { default: 0 },
70
+ hasSubtitle: { type: Boolean, default: false },
71
+ keyField: null,
72
+ isDraggable: { type: Boolean, default: false },
73
+ draggableArgs: { default: null }
74
+ },
75
+ emits: ["update:modelValue", "changeDragDrop", "clickOutside"],
76
+ setup(__props, { emit }) {
77
+ const props = __props;
78
+ const scrollPrerenderedItems = 50;
79
+ const skeletonItems = 3;
80
+ const boxDistanceBottom = 6;
81
+ const OPTION_HEIGHT = 32;
82
+ const OPTION_WITH_SUBTITLE_HEIGHT = 48;
83
+ const popoverDistance = computed(() => {
84
+ const notTopDistance = props.placement?.includes("bottom") ? boxDistanceBottom : 0;
85
+ return props.isOnTop ? -buttonRef.value?.getBoundingClientRect().height : notTopDistance;
86
+ });
87
+ const listRef = ref(null);
88
+ const query = ref("");
89
+ const shouldResetAfterCancel = ref(false);
90
+ const buttonRef = ref(null);
91
+ const apply = ref(null);
92
+ const cancel = ref(null);
93
+ const inputRef = ref(null);
94
+ const searchRef = ref(null);
95
+ const activeOption = ref(null);
96
+ const selectedOptionRef = ref(props.modelValue);
97
+ const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay));
98
+ const selectedOption = computed({
99
+ get() {
100
+ return selectedOptionRef.value;
101
+ },
102
+ set(value) {
103
+ emit("update:modelValue", value);
104
+ }
105
+ });
106
+ const onCancel = () => {
107
+ if (selectedOption.value?.length !== props.options?.length) {
108
+ shouldResetAfterCancel.value = true;
109
+ }
110
+ toggleMenu(false);
111
+ };
112
+ watch(
113
+ () => props.modelValue,
114
+ () => {
115
+ selectedOptionRef.value = props.modelValue;
116
+ }
117
+ );
118
+ watch(
119
+ () => selectedOptionRef.value,
120
+ () => {
121
+ emit("update:modelValue", selectedOptionRef.value);
122
+ }
123
+ );
124
+ const selectedOptionFiltered = computed(() => {
125
+ return selectedOptionRef.value.filter(
126
+ (x) => props.onSearch(x, query.value)
127
+ );
128
+ });
129
+ const filteredOptionsWithoutGroup = computed(() => {
130
+ return filteredOptions.value.filter(
131
+ (option) => !option?.groupOption
132
+ );
133
+ });
134
+ const onApply = () => {
135
+ if (selectedOption.value?.length !== props.options?.length) {
136
+ selectedOption.value = selectedOptionRef.value;
137
+ }
138
+ toggleMenu(false);
139
+ };
140
+ const triggerAction = () => {
141
+ toggleMenu();
142
+ };
143
+ const clearSelections = () => {
144
+ selectedOptionRef.value = [];
145
+ };
146
+ const optionHeight = computed(() => {
147
+ return () => props.hasSubtitle ? OPTION_WITH_SUBTITLE_HEIGHT : OPTION_HEIGHT;
148
+ });
149
+ const isIn = computed(
150
+ () => (arr1, arr2) => arr1.every(
151
+ (val) => arr2.some((val2) => val2[props.keyField] === val[props.keyField])
152
+ )
153
+ );
154
+ const isAllFilteredSelected = computed(() => {
155
+ if (!open.value) {
156
+ return false;
157
+ }
158
+ const selected = selectedOptionRef.value;
159
+ const filtered = filteredOptionsWithoutGroup.value || filteredOptions.value;
160
+ if (selected === filtered) {
161
+ return true;
162
+ }
163
+ if (selected?.length !== filtered?.length) {
164
+ return false;
165
+ }
166
+ return isIn.value(selected, filtered) && isIn.value(filtered, selected);
167
+ });
168
+ const popoverWrapperRef = ref(null);
169
+ const [open, toggle] = useToggle({
170
+ disabled: props.disabled,
171
+ initialValue: props.defaultOpen
172
+ });
173
+ const afterClose = (delay = 300) => {
174
+ const isAllOptionsSelected = selectedOption.value?.length === props.options?.length;
175
+ nextTick(async () => {
176
+ if (isAllOptionsSelected) {
177
+ selectedOption.value = [];
178
+ }
179
+ await sleep(delay);
180
+ api.resetInput();
181
+ });
182
+ };
183
+ watch(
184
+ () => [open.value, searchRef?.value?.inputRef],
185
+ ([isOpen, searchInput]) => {
186
+ if (isOpen && searchInput) {
187
+ afterOpen();
188
+ }
189
+ }
190
+ );
191
+ const focusOnSearch = () => {
192
+ if (!props.autoFocus) {
193
+ return;
194
+ }
195
+ searchRef.value?.inputRef.focus();
196
+ };
197
+ const afterOpen = async (delay = 300) => {
198
+ await sleep(delay);
199
+ focusOnSearch();
200
+ };
201
+ const toggleMenu = (value) => {
202
+ if (props.disabled) {
203
+ return;
204
+ }
205
+ if (!value) {
206
+ afterClose();
207
+ }
208
+ toggle(value);
209
+ expandCollapseIds.value = [];
210
+ };
211
+ onClickOutside(popoverWrapperRef, () => {
212
+ if (open.value) {
213
+ onCancel();
214
+ emit("clickOutside", selectedOptionRef.value);
215
+ }
216
+ });
217
+ const optionsIds = ref([]);
218
+ const maxClamped = computed(() => {
219
+ return filteredOptions.value?.length - 1;
220
+ });
221
+ const queryChanged = (value) => {
222
+ query.value = value;
223
+ };
224
+ const activeIndex = useClamp(0, 0, maxClamped);
225
+ const onSelect = (option) => {
226
+ if (option?.groupOption) {
227
+ return;
228
+ }
229
+ inputRef.value?.focus();
230
+ const rawSelectedOption = selectedOptionRef.value;
231
+ if (rawSelectedOption.includes(option)) {
232
+ selectedOptionRef.value = rawSelectedOption.filter(
233
+ (item) => item !== option
234
+ );
235
+ } else {
236
+ selectedOptionRef.value = [.../* @__PURE__ */ new Set([...rawSelectedOption, option])];
237
+ }
238
+ };
239
+ const removeSelection = (option) => {
240
+ onSelect(option);
241
+ };
242
+ const api = {
243
+ toggle: toggleMenu,
244
+ disabled: props.disabled,
245
+ options: optionsIds,
246
+ clearable: props.clearable,
247
+ resetInput: () => {
248
+ queryChanged("");
249
+ if (inputRef.value) {
250
+ inputRef.value.value = "";
251
+ }
252
+ if (shouldResetAfterCancel.value) {
253
+ selectedOptionRef.value = props.modelValue;
254
+ shouldResetAfterCancel.value = false;
255
+ }
256
+ },
257
+ search: queryChanged,
258
+ select: onSelect,
259
+ activeIndex,
260
+ selectedOption,
261
+ activeOption,
262
+ listRef,
263
+ query,
264
+ open,
265
+ removeSelection
266
+ };
267
+ const toggleSelectAll = () => {
268
+ selectedOptionRef.value = selectedOptionRef.value?.length !== filteredOptionsWithoutGroup.value?.length ? filteredOptionsWithoutGroup.value : [];
269
+ setTimeout(() => {
270
+ scrollToEnd(selectedOptionRef.value.length);
271
+ }, 300);
272
+ };
273
+ provide(IncludeExcludeContext, api);
274
+ const filteredOptions = computed(() => {
275
+ if (!query.value?.length) {
276
+ return props.options;
277
+ }
278
+ return props.options?.filter((option) => props.onSearch(option, query.value));
279
+ });
280
+ const {
281
+ list: virtualOptions,
282
+ containerProps,
283
+ wrapperProps
284
+ } = useVirtualList(filteredOptions, {
285
+ itemHeight: optionHeight.value,
286
+ overscan: scrollPrerenderedItems
287
+ });
288
+ const {
289
+ list: virtualOptionsSelected,
290
+ containerProps: containerPropsSelected,
291
+ wrapperProps: wrapperPropsSelected,
292
+ scrollTo: scrollToEnd
293
+ } = useVirtualList(selectedOptionFiltered, {
294
+ itemHeight: optionHeight.value,
295
+ overscan: scrollPrerenderedItems
296
+ });
297
+ const onButtonKeydown = (event) => {
298
+ if (["Enter", " ", "Space"].includes(event.key)) {
299
+ toggleMenu();
300
+ return;
301
+ }
302
+ if (event.key === "ArrowUp") {
303
+ toggleMenu(false);
304
+ return;
305
+ }
306
+ if (event.key === "ArrowDown") {
307
+ toggleMenu(true);
308
+ event.preventDefault();
309
+ }
310
+ };
311
+ const expandCollapseIds = ref([]);
312
+ const isCollapsed = (option) => {
313
+ return expandCollapseIds.value.includes(option?.[props.keyField]);
314
+ };
315
+ const toggleCollapse = (option) => {
316
+ if (option.groupOption) {
317
+ option.groupOption.isCollapse = !option?.groupOption.isCollapse;
318
+ }
319
+ expandCollapseIds.value = virtualOptions.value.filter((item) => item?.data?.groupOption?.isCollapse).flatMap((item) => item?.data?.groupOption?.childOptionsIds || []);
320
+ };
321
+ const onChangeDragDrop = () => {
322
+ emit("changeDragDrop", virtualOptionsSelected.value);
323
+ };
324
+ return (_ctx, _cache) => {
325
+ return openBlock(), createBlock(unref(_sfc_main$1), {
326
+ distance: unref(popoverDistance) + __props.distanceOffset,
327
+ skidding: __props.skiddingOffset,
328
+ trigger: "managed",
329
+ open: unref(open) || __props.alwayesOpen,
330
+ placement: __props.placement
331
+ }, {
332
+ trigger: withCtx(() => [
333
+ createElementVNode("div", {
334
+ ref_key: "buttonRef",
335
+ ref: buttonRef,
336
+ class: "include-exclude-trigger",
337
+ tabindex: "0",
338
+ onClick: triggerAction,
339
+ onKeydown: onButtonKeydown
340
+ }, [
341
+ renderSlot(_ctx.$slots, "trigger", {}, () => [
342
+ createElementVNode("button", {
343
+ ref_key: "buttonRef",
344
+ ref: buttonRef
345
+ }, "Default trigger", 512)
346
+ ], true)
347
+ ], 544)
348
+ ]),
349
+ content: withCtx(() => [
350
+ createElementVNode("div", {
351
+ ref_key: "popoverWrapperRef",
352
+ ref: popoverWrapperRef,
353
+ class: normalizeClass(["include-exclude-content", {
354
+ "include-exclude-content-draggable": __props.isDraggable
355
+ }])
356
+ }, [
357
+ createElementVNode("div", _hoisted_1, [
358
+ createElementVNode("div", _hoisted_2, [
359
+ renderSlot(_ctx.$slots, "header-left-section", {}, () => [
360
+ __props.titleText ? (openBlock(), createBlock(unref(Text), {
361
+ key: 0,
362
+ class: "include-exclude-header-left-section-title",
363
+ size: "md",
364
+ strong: ""
365
+ }, {
366
+ default: withCtx(() => [
367
+ createTextVNode(toDisplayString(__props.titleText), 1)
368
+ ]),
369
+ _: 1
370
+ })) : createCommentVNode("", true)
371
+ ], true)
372
+ ]),
373
+ createElementVNode("div", _hoisted_3, [
374
+ renderSlot(_ctx.$slots, "header-right-section", {}, () => [
375
+ createVNode(unref(Search), {
376
+ ref_key: "searchRef",
377
+ ref: searchRef,
378
+ modelValue: query.value,
379
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => query.value = $event),
380
+ class: "include-exclude-header-right-section-search-input",
381
+ variant: "transparent",
382
+ placeholder: __props.searchPlaceholder,
383
+ disabled: __props.loading
384
+ }, null, 8, ["modelValue", "placeholder", "disabled"])
385
+ ], true)
386
+ ])
387
+ ]),
388
+ createElementVNode("div", _hoisted_4, [
389
+ createVNode(Transition, {
390
+ name: "switch",
391
+ mode: "out-in"
392
+ }, {
393
+ default: withCtx(() => [
394
+ !unref(filteredOptions)?.length && !__props.loading ? (openBlock(), createElementBlock("div", _hoisted_5, [
395
+ renderSlot(_ctx.$slots, "no-result", {}, () => [
396
+ createVNode(unref(EmptyState), {
397
+ size: "lg",
398
+ title: "No results found",
399
+ subtitle: "Try diffrent keyword",
400
+ "icon-width": 72,
401
+ "icon-height": 72
402
+ })
403
+ ], true)
404
+ ])) : (openBlock(), createElementBlock("div", _hoisted_6, [
405
+ createElementVNode("div", _hoisted_7, [
406
+ createElementVNode("div", {
407
+ class: normalizeClass(["include-exclude-list-header", {
408
+ "include-exclude-list-header-loading": __props.loading,
409
+ "include-exclude-list-header-loaded": !__props.loading
410
+ }])
411
+ }, [
412
+ !__props.loading ? (openBlock(), createBlock(unref(Checkbox), {
413
+ key: 0,
414
+ size: "sm",
415
+ "is-checked": unref(isAllFilteredSelected),
416
+ "is-indeterminate": unref(selectedOption)?.length > 0 && !unref(isAllFilteredSelected),
417
+ disabled: !unref(filteredOptions)?.length,
418
+ label: "Select all",
419
+ onClick: toggleSelectAll
420
+ }, null, 8, ["is-checked", "is-indeterminate", "disabled"])) : createCommentVNode("", true),
421
+ __props.loading ? (openBlock(), createElementBlock("div", _hoisted_8, [
422
+ createVNode(unref(Skeleton), {
423
+ class: "dot-skeleton",
424
+ round: ""
425
+ }),
426
+ createVNode(unref(Skeleton), { round: "" })
427
+ ])) : createCommentVNode("", true)
428
+ ], 2),
429
+ createElementVNode("div", mergeProps({ class: "include-exclude-list" }, unref(containerProps), {
430
+ class: {
431
+ "include-exclude-list-draggable": __props.isDraggable
432
+ }
433
+ }), [
434
+ !__props.loading ? (openBlock(), createElementBlock("ul", mergeProps({ key: 0 }, unref(wrapperProps), {
435
+ ref_key: "listRef",
436
+ ref: listRef,
437
+ tabindex: "1"
438
+ }), [
439
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(virtualOptions), ({ data, index }) => {
440
+ return openBlock(), createElementBlock("li", {
441
+ key: index,
442
+ "aria-selected": toRaw(unref(selectedOption)) === data,
443
+ "aria-disabled": !!__props.disabled,
444
+ onClick: () => onSelect(data)
445
+ }, [
446
+ data.groupOption ? (openBlock(), createElementBlock("div", {
447
+ key: 0,
448
+ class: "option-collapse",
449
+ onClick: ($event) => toggleCollapse(data)
450
+ }, [
451
+ renderSlot(_ctx.$slots, "option-group", { option: data }, void 0, true)
452
+ ], 8, _hoisted_10)) : createCommentVNode("", true),
453
+ !data.groupOption && !isCollapsed(data) ? renderSlot(_ctx.$slots, "option", {
454
+ key: 1,
455
+ showCheckbox: true,
456
+ option: data,
457
+ selected: toRaw(unref(selectedOption)) === data,
458
+ active: toRaw(unref(activeIndex)) === index
459
+ }, void 0, true) : createCommentVNode("", true)
460
+ ], 8, _hoisted_9);
461
+ }), 128))
462
+ ], 16)) : createCommentVNode("", true),
463
+ __props.loading ? (openBlock(), createElementBlock("ul", _hoisted_11, [
464
+ (openBlock(), createElementBlock(Fragment, null, renderList(skeletonItems, (n) => {
465
+ return createElementVNode("li", {
466
+ key: n,
467
+ class: "include-exclude-list-item-skeleton"
468
+ }, [
469
+ createElementVNode("div", _hoisted_12, [
470
+ createVNode(unref(Skeleton), {
471
+ class: "dot-skeleton",
472
+ round: ""
473
+ }),
474
+ createVNode(unref(Skeleton), { round: "" })
475
+ ])
476
+ ]);
477
+ }), 64))
478
+ ])) : createCommentVNode("", true)
479
+ ], 16)
480
+ ]),
481
+ createElementVNode("div", _hoisted_13, [
482
+ createElementVNode("div", {
483
+ class: normalizeClass(["include-exclude-selected-header", {
484
+ "include-exclude-list-selected-header-loading": __props.loading,
485
+ "include-exclude-list-header-loaded": !__props.loading
486
+ }])
487
+ }, [
488
+ __props.loading ? (openBlock(), createElementBlock("div", _hoisted_14, [
489
+ createVNode(unref(Skeleton), { round: "" })
490
+ ])) : createCommentVNode("", true),
491
+ createElementVNode("div", _hoisted_15, [
492
+ !__props.loading ? (openBlock(), createBlock(unref(Text), {
493
+ key: 0,
494
+ class: "include-exclude-selected-header-left-selected",
495
+ size: "sm"
496
+ }, {
497
+ default: withCtx(() => [
498
+ createTextVNode(toDisplayString(unref(selectedOption)?.length) + " Selected", 1)
499
+ ]),
500
+ _: 1
501
+ })) : createCommentVNode("", true)
502
+ ]),
503
+ createElementVNode("div", _hoisted_16, [
504
+ renderSlot(_ctx.$slots, "selected-header-right", {}, () => [
505
+ unref(selectedOption)?.length && !__props.loading && __props.showClearAll ? (openBlock(), createBlock(unref(Button), {
506
+ key: 0,
507
+ variant: "link",
508
+ theme: "third",
509
+ size: "md",
510
+ strong: false,
511
+ onClick: clearSelections
512
+ }, {
513
+ default: withCtx(() => [
514
+ createTextVNode("Clear all")
515
+ ]),
516
+ _: 1
517
+ })) : createCommentVNode("", true)
518
+ ], true)
519
+ ])
520
+ ], 2),
521
+ createElementVNode("div", mergeProps({
522
+ class: ["include-exclude-selected-list", {
523
+ "include-exclude-list-draggable": __props.isDraggable
524
+ }]
525
+ }, unref(containerPropsSelected)), [
526
+ unref(selectedOption)?.length && !__props.loading && __props.isDraggable ? (openBlock(), createElementBlock("ul", mergeProps({ key: 0 }, unref(wrapperPropsSelected), {
527
+ ref: "SelectedlistRef",
528
+ tabindex: "2"
529
+ }), [
530
+ createVNode(unref(draggable), mergeProps({
531
+ modelValue: unref(virtualOptionsSelected),
532
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(virtualOptionsSelected) ? virtualOptionsSelected.value = $event : null)
533
+ }, __props.draggableArgs, { onChange: onChangeDragDrop }), {
534
+ item: withCtx(({ element }) => [
535
+ createElementVNode("div", _hoisted_17, [
536
+ renderSlot(_ctx.$slots, "selected_option_draggable", {
537
+ option: element.data,
538
+ selected: toRaw(unref(selectedOption)) === element.data,
539
+ active: toRaw(unref(activeIndex)) === element.data.draggableItemKey
540
+ }, void 0, true)
541
+ ])
542
+ ]),
543
+ _: 3
544
+ }, 16, ["modelValue"])
545
+ ], 16)) : createCommentVNode("", true),
546
+ __props.loading ? (openBlock(), createElementBlock("ul", _hoisted_18, [
547
+ (openBlock(), createElementBlock(Fragment, null, renderList(skeletonItems, (n) => {
548
+ return createElementVNode("li", {
549
+ key: n,
550
+ class: "include-exclude-list-item-skeleton"
551
+ }, [
552
+ createElementVNode("div", _hoisted_19, [
553
+ createVNode(unref(Skeleton), { round: "" })
554
+ ])
555
+ ]);
556
+ }), 64))
557
+ ])) : createCommentVNode("", true)
558
+ ], 16)
559
+ ])
560
+ ]))
561
+ ]),
562
+ _: 3
563
+ })
564
+ ]),
565
+ renderSlot(_ctx.$slots, "footer", {
566
+ handleApply: onApply,
567
+ handleCancel: onCancel
568
+ }, () => [
569
+ createElementVNode("div", _hoisted_20, [
570
+ createElementVNode("div", _hoisted_21, [
571
+ createVNode(unref(Button), {
572
+ ref_key: "cancel",
573
+ ref: cancel,
574
+ size: "sm",
575
+ variant: "border",
576
+ theme: "third",
577
+ text: "Cancel",
578
+ onClick: onCancel
579
+ }, {
580
+ default: withCtx(() => [
581
+ createTextVNode("Cancel")
582
+ ]),
583
+ _: 1
584
+ }, 512),
585
+ createVNode(unref(Button), {
586
+ ref_key: "apply",
587
+ ref: apply,
588
+ size: "sm",
589
+ theme: "primary",
590
+ text: "Apply",
591
+ onClick: onApply
592
+ }, {
593
+ default: withCtx(() => [
594
+ createTextVNode("Apply")
595
+ ]),
596
+ _: 1
597
+ }, 512)
598
+ ])
599
+ ])
600
+ ], true)
601
+ ], 2)
602
+ ]),
603
+ _: 3
604
+ }, 8, ["distance", "skidding", "open", "placement"]);
605
+ };
606
+ }
607
+ });
608
+ var IncludeExcludeDragDrop = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-22459799"]]);
609
+
610
+ export { IncludeExcludeDragDrop as default };
@@ -1,35 +1,30 @@
1
1
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
- selected?: boolean;
3
- clearable?: boolean;
4
- prefix?: string;
2
+ option: unknown;
3
+ subtitle?: string;
5
4
  disabled?: boolean;
6
- testId?: string;
5
+ clearable?: boolean;
6
+ titleText?: string;
7
7
  }>, {
8
- selected: boolean;
9
- clearable: boolean;
10
- prefix: any;
8
+ subtitle: string;
11
9
  disabled: boolean;
12
- testId: string;
13
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "cleared"[], "cleared", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
14
- selected?: boolean;
15
- clearable?: boolean;
16
- prefix?: string;
10
+ clearable: boolean;
11
+ titleText: string;
12
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
13
+ option: unknown;
14
+ subtitle?: string;
17
15
  disabled?: boolean;
18
- testId?: string;
16
+ clearable?: boolean;
17
+ titleText?: string;
19
18
  }>, {
20
- selected: boolean;
21
- clearable: boolean;
22
- prefix: any;
19
+ subtitle: string;
23
20
  disabled: boolean;
24
- testId: string;
25
- }>>> & {
26
- onCleared?: (...args: any[]) => any;
27
- }, {
28
- testId: string;
21
+ clearable: boolean;
22
+ titleText: string;
23
+ }>>>, {
29
24
  disabled: boolean;
30
- selected: boolean;
25
+ subtitle: string;
31
26
  clearable: boolean;
32
- prefix: string;
27
+ titleText: string;
33
28
  }>;
34
29
  export default _default;
35
30
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;