@ironsource/shared-ui 2.1.11-test.5 → 2.1.11-test.50

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 (191) hide show
  1. package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_604dfc6f_lang.css +1 -0
  2. package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_1aa6df01_lang.css +1 -0
  3. package/Chart.vue_vue_type_style_index_0_scoped_277fde76_lang.css +1 -0
  4. package/ChartHeader.vue_vue_type_style_index_0_scoped_b8213498_lang.css +1 -0
  5. package/ChartLegend.vue_vue_type_style_index_0_scoped_a1c626cd_lang.css +1 -0
  6. package/ChartTooltip.vue_vue_type_style_index_0_scoped_6744325c_lang.css +1 -0
  7. package/CheckboxV4.vue_vue_type_style_index_0_scoped_af4ae3c3_lang.css +1 -0
  8. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_e43ac1c9_lang.css +1 -0
  9. package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_27802170_lang.css +1 -0
  10. package/DataGrid.vue_vue_type_style_index_0_scoped_26488faf_lang.css +1 -0
  11. package/DataGridMenu.vue_vue_type_style_index_0_scoped_ddfaf207_lang.css +1 -0
  12. package/DateRangeV4.vue_vue_type_style_index_0_scoped_309e5351_lang.css +1 -0
  13. package/DialogV4.vue_vue_type_style_index_0_scoped_37da643b_lang.css +1 -0
  14. package/DropdownV4.vue_vue_type_style_index_0_scoped_75002075_lang.css +1 -0
  15. package/EditableV4.vue_vue_type_style_index_0_scoped_1bbe222a_lang.css +1 -0
  16. package/EmptyStateV4.vue_vue_type_style_index_0_scoped_18728498_lang.css +1 -0
  17. package/FiltersPanelV4.vue_vue_type_style_index_0_scoped_383011d3_lang.css +1 -0
  18. package/FormCard.vue_vue_type_style_index_0_scoped_86feae7b_lang.css +1 -0
  19. package/IconFlag.vue_vue_type_style_index_0_scoped_be9dc7bb_lang.css +1 -0
  20. package/InlineCopy.vue_vue_type_style_index_0_scoped_ad48b61e_lang.css +1 -0
  21. package/OptionV4.vue_vue_type_style_index_0_scoped_2c2947b3_lang.css +1 -0
  22. package/PopoverV4.vue_vue_type_style_index_0_scoped_66694b4e_lang.css +1 -0
  23. package/README.md +4 -15
  24. package/SnackbarV4.vue_vue_type_style_index_0_scoped_89fe8aa1_lang.css +1 -0
  25. package/SortableItem.vue_vue_type_style_index_0_scoped_2ca7b24c_lang.css +1 -0
  26. package/SortableItemLabel.vue_vue_type_style_index_0_scoped_f2ced2f4_lang.css +1 -0
  27. package/SortableList.vue_vue_type_style_index_0_scoped_8f267f88_lang.css +1 -0
  28. package/TextField.vue_vue_type_style_index_0_scoped_fce3948c_lang.css +1 -0
  29. package/ThemeWrapper.vue_vue_type_style_index_1_lang.css +1 -1
  30. package/ToggleButtonGroupAB.vue_vue_type_style_index_0_scoped_c81a7d3e_lang.css +1 -0
  31. package/TooltipV4.vue_vue_type_style_index_0_scoped_66eab856_lang.css +1 -0
  32. package/TooltipV4.vue_vue_type_style_index_1_lang.css +1 -1
  33. package/TreeDropdown.vue_vue_type_style_index_0_scoped_b883d1fa_lang.css +1 -0
  34. package/Typography.vue_vue_type_style_index_0_scoped_5714d43e_lang.css +1 -0
  35. package/components/autocomplete/Autocomplete.vue2.js +3 -2
  36. package/components/button/v4/ToggleButtonGroupAB.vue.d.ts +3 -1
  37. package/components/button/v4/ToggleButtonGroupAB.vue.js +2 -2
  38. package/components/button/v4/ToggleButtonGroupAB.vue2.js +44 -39
  39. package/components/button/v4/index.d.ts +9 -3
  40. package/components/chart/Chart.vue.d.ts +16 -3
  41. package/components/chart/Chart.vue.js +5 -5
  42. package/components/chart/Chart.vue2.js +127 -110
  43. package/components/chart/ChartHeader.vue.d.ts +13 -6
  44. package/components/chart/ChartHeader.vue.js +2 -2
  45. package/components/chart/ChartHeader.vue2.js +32 -29
  46. package/components/chart/ChartLegend.vue.d.ts +5 -0
  47. package/components/chart/ChartLegend.vue.js +3 -3
  48. package/components/chart/ChartLegend.vue2.js +99 -49
  49. package/components/chart/ChartTooltip.vue.d.ts +4 -5
  50. package/components/chart/ChartTooltip.vue.js +2 -2
  51. package/components/chart/ChartTooltip.vue2.js +64 -43
  52. package/components/chart/SettingsHeader.vue2.js +3 -2
  53. package/components/chart/index.d.ts +55 -16
  54. package/components/chart/mockData.d.ts +15 -2
  55. package/components/chart/types.d.ts +15 -1
  56. package/components/chart/utils/utils.js +5 -5
  57. package/components/checkbox/v4/CheckboxV4.vue.js +3 -3
  58. package/components/checkbox/v4/CheckboxV4.vue2.js +2 -2
  59. package/components/datePicker/v4/DatePickerV4.vue2.js +8 -7
  60. package/components/dateRange/v4/DateRangeV4.vue.js +2 -2
  61. package/components/dateRange/v4/DateRangeV4.vue2.js +9 -9
  62. package/components/dialog/v4/DialogV4.vue.d.ts +15 -0
  63. package/components/dialog/v4/DialogV4.vue.js +3 -3
  64. package/components/dialog/v4/DialogV4.vue2.js +80 -73
  65. package/components/dialog/v4/index.d.ts +58 -1
  66. package/components/dropdown/common/Dropdown.common.js +200 -189
  67. package/components/dropdown/v3/Dropdown.vue.d.ts +2 -2
  68. package/components/dropdown/v3/index.d.ts +39 -39
  69. package/components/dropdown/v4/AppDropdownTrigger.vue.d.ts +1 -1
  70. package/components/dropdown/v4/ButtonDropdownTrigger.vue.d.ts +15 -0
  71. package/components/dropdown/v4/ButtonDropdownTrigger.vue.js +2 -2
  72. package/components/dropdown/v4/ButtonDropdownTrigger.vue2.js +42 -20
  73. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue.js +2 -2
  74. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue2.js +7 -7
  75. package/components/dropdown/v4/ChipDropdownTrigger.vue.d.ts +10 -0
  76. package/components/dropdown/v4/ChipDropdownTrigger.vue.js +3 -3
  77. package/components/dropdown/v4/ChipDropdownTrigger.vue2.js +88 -47
  78. package/components/dropdown/v4/ConditionalDropdown.vue.d.ts +110 -0
  79. package/components/dropdown/v4/ConditionalDropdown.vue.js +7 -0
  80. package/components/dropdown/v4/ConditionalDropdown.vue2.js +224 -0
  81. package/components/dropdown/v4/DropdownV4.vue.d.ts +32 -11
  82. package/components/dropdown/v4/DropdownV4.vue.js +3 -3
  83. package/components/dropdown/v4/DropdownV4.vue2.js +153 -138
  84. package/components/dropdown/v4/OptionV4.vue.d.ts +10 -0
  85. package/components/dropdown/v4/OptionV4.vue.js +2 -2
  86. package/components/dropdown/v4/OptionV4.vue2.js +135 -98
  87. package/components/dropdown/v4/TreeDropdown.vue.d.ts +6 -1
  88. package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
  89. package/components/dropdown/v4/TreeDropdown.vue2.js +165 -120
  90. package/components/dropdown/v4/index.d.ts +443 -110
  91. package/components/dropdown/v4/index.js +6 -3
  92. package/components/emptyState/v4/EmptyStateV4.vue.js +3 -3
  93. package/components/emptyState/v4/EmptyStateV4.vue2.js +1 -1
  94. package/components/filtersPanel/v4/FiltersPanelV4.vue.js +2 -2
  95. package/components/filtersPanel/v4/FiltersPanelV4.vue2.js +8 -9
  96. package/components/forms/FormCard.vue.js +3 -3
  97. package/components/forms/FormCard.vue2.js +1 -1
  98. package/components/icon/v4/IconFlag.vue.js +3 -3
  99. package/components/icon/v4/IconFlag.vue2.js +1 -1
  100. package/components/icon/v4/consts.d.ts +1 -1
  101. package/components/icon/v4/consts.js +1 -1
  102. package/components/inlineCopy/InlineCopy.vue.d.ts +5 -0
  103. package/components/inlineCopy/InlineCopy.vue.js +2 -2
  104. package/components/inlineCopy/InlineCopy.vue2.js +24 -22
  105. package/components/inlineCopy/index.d.ts +9 -0
  106. package/components/input/v4/TextField.vue.js +3 -3
  107. package/components/input/v4/TextField.vue2.js +185 -165
  108. package/components/multibar/MultiBarMenu.vue2.js +3 -2
  109. package/components/popover/v4/PopoverV4.vue.d.ts +14 -2
  110. package/components/popover/v4/PopoverV4.vue.js +4 -3
  111. package/components/popover/v4/PopoverV4.vue2.js +40 -24
  112. package/components/popover/v4/index.d.ts +55 -11
  113. package/components/snackbar/v4/SnackbarV4.vue.d.ts +7 -116
  114. package/components/snackbar/v4/SnackbarV4.vue.js +5 -5
  115. package/components/snackbar/v4/SnackbarV4.vue2.js +62 -60
  116. package/components/sortableList/SortableItem.vue.d.ts +5 -0
  117. package/components/sortableList/SortableItem.vue.js +2 -2
  118. package/components/sortableList/SortableItem.vue2.js +86 -70
  119. package/components/sortableList/SortableItemLabel.vue.js +3 -3
  120. package/components/sortableList/SortableItemLabel.vue2.js +20 -23
  121. package/components/sortableList/SortableList.vue.d.ts +17 -1
  122. package/components/sortableList/SortableList.vue.js +4 -4
  123. package/components/sortableList/SortableList.vue2.js +113 -94
  124. package/components/sortableList/index.d.ts +63 -5
  125. package/components/table/common/Table.common.d.ts +1 -1
  126. package/components/table/common/Table.common.js +83 -77
  127. package/components/table/common/Table.types.d.ts +1 -1
  128. package/components/table/common/consts.d.ts +4 -0
  129. package/components/table/common/consts.js +7 -0
  130. package/components/table/v3/Table.vue.d.ts +1 -1
  131. package/components/table/v3/index.d.ts +5 -5
  132. package/components/table/v4/DataGrid.vue.d.ts +12 -2
  133. package/components/table/v4/DataGrid.vue.js +2 -2
  134. package/components/table/v4/DataGrid.vue2.js +164 -155
  135. package/components/table/v4/DataGridMenu.vue.js +5 -5
  136. package/components/table/v4/DataGridMenu.vue2.js +4 -3
  137. package/components/table/v4/MultipleDataGrid.vue.d.ts +1 -1
  138. package/components/table/v4/index.d.ts +84 -46
  139. package/components/table-cells/common/Editable.common.js +29 -23
  140. package/components/table-cells/common/EditableContext.d.ts +1 -0
  141. package/components/table-cells/v4/EditableV4.vue.d.ts +5 -0
  142. package/components/table-cells/v4/EditableV4.vue.js +3 -3
  143. package/components/table-cells/v4/EditableV4.vue2.js +11 -10
  144. package/components/table-cells/v4/index.d.ts +20 -1
  145. package/components/tooltip/v4/TooltipV4.vue.d.ts +10 -0
  146. package/components/tooltip/v4/TooltipV4.vue.js +3 -3
  147. package/components/tooltip/v4/TooltipV4.vue2.js +24 -21
  148. package/components/tooltip/v4/index.d.ts +39 -1
  149. package/components/typography/v4/Typography.vue.js +3 -3
  150. package/components/typography/v4/Typography.vue2.js +24 -18
  151. package/design-foundation.stories/icons/iconsData.d.ts +1 -1
  152. package/index.d.ts +1626 -366
  153. package/index.js +1 -1
  154. package/mocks/options.d.ts +48 -6
  155. package/mocks/words.d.ts +1 -1
  156. package/package.json +2 -1
  157. package/style/v4/grid.css +1 -1
  158. package/style/v4/grid.css.map +1 -1
  159. package/style/v4/spacings.scss +1 -0
  160. package/testids/index.d.ts +2 -0
  161. package/testids/index.js +13 -13
  162. package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_76c74f58_lang.css +0 -1
  163. package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_7f750550_lang.css +0 -1
  164. package/Chart.vue_vue_type_style_index_0_scoped_ea1e5c3e_lang.css +0 -1
  165. package/ChartHeader.vue_vue_type_style_index_0_scoped_4c37736e_lang.css +0 -1
  166. package/ChartLegend.vue_vue_type_style_index_0_scoped_c0f71a49_lang.css +0 -1
  167. package/ChartTooltip.vue_vue_type_style_index_0_scoped_ec636f18_lang.css +0 -1
  168. package/CheckboxV4.vue_vue_type_style_index_0_scoped_8e5b619a_lang.css +0 -1
  169. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_49bd7193_lang.css +0 -1
  170. package/DataGrid.vue_vue_type_style_index_0_scoped_0cd8af73_lang.css +0 -1
  171. package/DataGridMenu.vue_vue_type_style_index_0_scoped_a6e4672f_lang.css +0 -1
  172. package/DateRangeV4.vue_vue_type_style_index_0_scoped_f81413ec_lang.css +0 -1
  173. package/DialogV4.vue_vue_type_style_index_0_scoped_09c488cf_lang.css +0 -1
  174. package/DropdownV4.vue_vue_type_style_index_0_scoped_e899ec7a_lang.css +0 -1
  175. package/EditableV4.vue_vue_type_style_index_0_scoped_e0c047b4_lang.css +0 -1
  176. package/EmptyStateV4.vue_vue_type_style_index_0_scoped_24001caa_lang.css +0 -1
  177. package/FiltersPanelV4.vue_vue_type_style_index_0_scoped_39061862_lang.css +0 -1
  178. package/FormCard.vue_vue_type_style_index_0_scoped_c7965a69_lang.css +0 -1
  179. package/IconFlag.vue_vue_type_style_index_0_scoped_7b09cc85_lang.css +0 -1
  180. package/InlineCopy.vue_vue_type_style_index_0_scoped_893a203c_lang.css +0 -1
  181. package/OptionV4.vue_vue_type_style_index_0_scoped_4070942a_lang.css +0 -1
  182. package/PopoverV4.vue_vue_type_style_index_0_scoped_74bbce13_lang.css +0 -1
  183. package/SnackbarV4.vue_vue_type_style_index_0_scoped_49c5ccea_lang.css +0 -1
  184. package/SortableItem.vue_vue_type_style_index_0_scoped_9dd4d372_lang.css +0 -1
  185. package/SortableItemLabel.vue_vue_type_style_index_0_scoped_1386ae20_lang.css +0 -1
  186. package/SortableList.vue_vue_type_style_index_0_scoped_e9cd63b8_lang.css +0 -1
  187. package/TextField.vue_vue_type_style_index_0_scoped_4d9bf5b2_lang.css +0 -1
  188. package/ToggleButtonGroupAB.vue_vue_type_style_index_0_scoped_9d9e51c0_lang.css +0 -1
  189. package/TooltipV4.vue_vue_type_style_index_0_scoped_fcdb9d02_lang.css +0 -1
  190. package/TreeDropdown.vue_vue_type_style_index_0_scoped_6ac5f602_lang.css +0 -1
  191. package/Typography.vue_vue_type_style_index_0_scoped_992962bc_lang.css +0 -1
@@ -1,10 +1,13 @@
1
- import "../../../ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_49bd7193_lang.css"; import { defineComponent as V, ref as b, computed as p, openBlock as _, createElementBlock as C, mergeProps as n, unref as t, createElementVNode as d, createVNode as c, withCtx as w, createTextVNode as B, toDisplayString as k, withDirectives as u, vShow as f, withModifiers as v } from "vue";
2
- import m from "../../icon/v4/IconV4.vue.js";
1
+ import "../../../ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_e43ac1c9_lang.css"; import { defineComponent as k, ref as f, computed as m, watch as D, openBlock as I, createBlock as S, unref as t, withCtx as y, createElementVNode as c, mergeProps as p, createVNode as d, createTextVNode as V, toDisplayString as v, withDirectives as x, vShow as _, withModifiers as $ } from "vue";
2
+ import b from "../../icon/v4/IconV4.vue.js";
3
3
  import "../../icon/v4/IconFlag.vue.js";
4
- import x from "../../typography/v4/Typography.vue.js";
5
- import { DropdownTestIdModifiers as o } from "../../../testids/index.js";
6
- import { useTestIdAttrs as A } from "../../../utils/testIds.js";
7
- const N = { class: "chip-trigger--content" }, I = { class: "chip-trigger--icon" }, $ = ["onClick"], M = /* @__PURE__ */ V({
4
+ import C from "../../typography/v4/Typography.vue.js";
5
+ import { DropdownTestIdModifiers as i } from "../../../testids/index.js";
6
+ import { useTestIdAttrs as E } from "../../../utils/testIds.js";
7
+ import { isElementTruncated as U } from "../../../utils/text.js";
8
+ import { promiseTimeout as F } from "@vueuse/core";
9
+ import L from "../../tooltip/v4/TooltipV4.vue.js";
10
+ const R = { class: "chip-trigger--icon" }, z = ["onClick"], K = /* @__PURE__ */ k({
8
11
  __name: "ChipDropdownTrigger",
9
12
  props: {
10
13
  label: { default: "Status" },
@@ -17,59 +20,97 @@ const N = { class: "chip-trigger--content" }, I = { class: "chip-trigger--icon"
17
20
  options: null,
18
21
  selectedOption: null,
19
22
  displayValue: null,
20
- multi: { type: Boolean }
23
+ multi: { type: Boolean },
24
+ cancelAllSelectedDisplay: { type: Boolean, default: !1 },
25
+ displayValueInQuotes: { type: Boolean, default: !1 }
21
26
  },
22
27
  emits: ["clear"],
23
- setup(r, { emit: h }) {
24
- const e = r, y = () => {
25
- h("clear");
26
- }, i = b(!0), g = (l) => {
28
+ setup(u, { emit: A }) {
29
+ const e = u, B = () => {
30
+ A("clear");
31
+ }, o = f(null), r = f(!0), T = f(!1), h = (l) => {
27
32
  let a = l;
28
- return Array.isArray(l) && (l.length > 1 ? a = `${l[0]}, +${l[1]}` : a = l[0] ? `${l[0]}` : ""), i.value = !!a, a ? `${e.label}: ${a}` : e.label;
29
- }, T = p(
33
+ Array.isArray(l) && (l.length > 1 ? a = `${l[0]}` : a = l[0] ? `${l[0]}` : ""), r.value = !!a;
34
+ let O = a;
35
+ return e.displayValueInQuotes && (O = `"${a}"`), a ? `${e.label}: ${O}` : e.label;
36
+ }, g = (l) => {
37
+ let a = "";
38
+ return Array.isArray(l) && l.length > 1 && (a = `, +${l[1]}`), a;
39
+ }, N = m(
30
40
  () => e.feedbackVariant ? `state-${e.feedbackVariant}` : ""
31
- ), s = A(e.testId, o), O = p(() => {
41
+ ), s = E(e.testId, i), n = m(() => {
32
42
  if (!e.multi)
33
43
  return e.selectedOption ? e.displayValue(e.selectedOption) : "";
34
44
  if (Array.isArray(e.selectedOption))
35
- return e.selectedOption.length ? e.allSelected ? ["All"] : e.selectedOption.length == 1 && e.displayValue ? [e.displayValue(e.selectedOption[0])] : [
45
+ return e.selectedOption.length ? e.allSelected && !e.cancelAllSelectedDisplay ? ["All"] : e.selectedOption.length == 1 && e.displayValue ? [e.displayValue(e.selectedOption[0])] : [
36
46
  e.displayValue(e.selectedOption[0]),
37
47
  e.selectedOption.length - 1
38
48
  ] : [];
39
49
  });
40
- return (l, a) => (_(), C("div", n({
41
- class: ["chip-trigger", [t(T), { active: i.value, disabled: r.disabled, open: r.open }]]
42
- }, t(s)[t(o).BUTTON]), [
43
- d("div", N, [
44
- c(t(x), n({ variant: "chipLabel" }, t(s)[t(o).BUTTON_CONTENT]), {
45
- default: w(() => [
46
- B(k(g(t(O))), 1)
47
- ]),
48
- _: 1
49
- }, 16),
50
- u(d("div", I, [
51
- c(t(m), {
52
- name: "caret-down",
53
- size: "16px"
54
- })
55
- ], 512), [
56
- [f, !i.value]
57
- ]),
58
- u(d("div", n({ class: "x-circle-wrapper" }, t(s)[t(o).BUTTON_CLEAR], {
59
- onClick: v(y, ["stop"])
60
- }), [
61
- c(t(m), {
62
- name: "x-circle",
63
- size: "16px",
64
- type: "fill"
65
- })
66
- ], 16, $), [
67
- [f, i.value]
68
- ])
69
- ])
70
- ], 16));
50
+ D([() => e.selectedOption, o], async () => {
51
+ await F(100), T.value = o.value && U(o.value);
52
+ });
53
+ const w = m(() => T.value ? `${h(n.value)}${g(
54
+ n.value
55
+ )}` : "");
56
+ return (l, a) => (I(), S(t(L), {
57
+ text: t(w),
58
+ class: "tooltip-option",
59
+ placement: "top"
60
+ }, {
61
+ default: y(() => [
62
+ c("div", p({
63
+ class: ["chip-trigger", [t(N), { active: r.value, disabled: u.disabled, open: u.open }]]
64
+ }, t(s)[t(i).BUTTON]), [
65
+ c("div", {
66
+ ref_key: "textContainerRef",
67
+ ref: o,
68
+ class: "chip-trigger--content"
69
+ }, [
70
+ d(t(C), p({
71
+ class: "chip-trigger--text",
72
+ variant: "chipLabel"
73
+ }, t(s)[t(i).BUTTON_CONTENT]), {
74
+ default: y(() => [
75
+ V(v(h(t(n))), 1)
76
+ ]),
77
+ _: 1
78
+ }, 16),
79
+ d(t(C), p({
80
+ class: "chip-trigger--suffix",
81
+ variant: "chipLabel"
82
+ }, t(s)[t(i).BUTTON_CONTENT_SUFFIX]), {
83
+ default: y(() => [
84
+ V(v(g(t(n))), 1)
85
+ ]),
86
+ _: 1
87
+ }, 16),
88
+ x(c("div", R, [
89
+ d(t(b), {
90
+ name: "caret-down",
91
+ size: "16px"
92
+ })
93
+ ], 512), [
94
+ [_, !r.value]
95
+ ]),
96
+ x(c("div", p({ class: "x-circle-wrapper" }, t(s)[t(i).BUTTON_CLEAR], {
97
+ onClick: $(B, ["stop"])
98
+ }), [
99
+ d(t(b), {
100
+ name: "x-circle",
101
+ size: "16px",
102
+ type: "fill"
103
+ })
104
+ ], 16, z), [
105
+ [_, r.value]
106
+ ])
107
+ ], 512)
108
+ ], 16)
109
+ ]),
110
+ _: 1
111
+ }, 8, ["text"]));
71
112
  }
72
113
  });
73
114
  export {
74
- M as default
115
+ K as default
75
116
  };
@@ -0,0 +1,110 @@
1
+ type SelectedCondition = {
2
+ label: string;
3
+ value: string;
4
+ multi: boolean;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
7
+ selectedCondition: SelectedCondition | null;
8
+ appliedSelections: unknown | unknown[];
9
+ conditionalOptions: SelectedCondition[];
10
+ label: string;
11
+ testId?: string;
12
+ comparingKey: string;
13
+ fetchFnCallback: (q: string) => Promise<unknown[]>;
14
+ optionNameKey: string;
15
+ minCharsToStart?: number;
16
+ isOpen?: boolean;
17
+ searchQuery?: string;
18
+ loadMoreFn?: () => Promise<any[]>;
19
+ infiniteLoading?: boolean;
20
+ fetchDataDebounceTime?: number;
21
+ autoFocusSearch?: boolean;
22
+ groupedOptions?: boolean;
23
+ optionFlagKey?: string;
24
+ }>, {
25
+ label: string;
26
+ testId: string;
27
+ comparingKey: string;
28
+ optionNameKey: string;
29
+ minCharsToStart: number;
30
+ isOpen: boolean;
31
+ searchQuery: string;
32
+ loadMoreFn: any;
33
+ infiniteLoading: boolean;
34
+ fetchDataDebounceTime: number;
35
+ autoFocusSearch: boolean;
36
+ groupedOptions: boolean;
37
+ optionFlagKey: string;
38
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
39
+ "update:selectedCondition": (value: SelectedCondition) => void;
40
+ "update:appliedSelections": (value: unknown) => void;
41
+ clear: () => void;
42
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
43
+ selectedCondition: SelectedCondition | null;
44
+ appliedSelections: unknown | unknown[];
45
+ conditionalOptions: SelectedCondition[];
46
+ label: string;
47
+ testId?: string;
48
+ comparingKey: string;
49
+ fetchFnCallback: (q: string) => Promise<unknown[]>;
50
+ optionNameKey: string;
51
+ minCharsToStart?: number;
52
+ isOpen?: boolean;
53
+ searchQuery?: string;
54
+ loadMoreFn?: () => Promise<any[]>;
55
+ infiniteLoading?: boolean;
56
+ fetchDataDebounceTime?: number;
57
+ autoFocusSearch?: boolean;
58
+ groupedOptions?: boolean;
59
+ optionFlagKey?: string;
60
+ }>, {
61
+ label: string;
62
+ testId: string;
63
+ comparingKey: string;
64
+ optionNameKey: string;
65
+ minCharsToStart: number;
66
+ isOpen: boolean;
67
+ searchQuery: string;
68
+ loadMoreFn: any;
69
+ infiniteLoading: boolean;
70
+ fetchDataDebounceTime: number;
71
+ autoFocusSearch: boolean;
72
+ groupedOptions: boolean;
73
+ optionFlagKey: string;
74
+ }>>> & {
75
+ onClear?: () => any;
76
+ "onUpdate:selectedCondition"?: (value: SelectedCondition) => any;
77
+ "onUpdate:appliedSelections"?: (value: unknown) => any;
78
+ }, {
79
+ label: string;
80
+ testId: string;
81
+ isOpen: boolean;
82
+ infiniteLoading: boolean;
83
+ optionNameKey: string;
84
+ optionFlagKey: string;
85
+ groupedOptions: boolean;
86
+ comparingKey: string;
87
+ minCharsToStart: number;
88
+ searchQuery: string;
89
+ loadMoreFn: () => Promise<any[]>;
90
+ fetchDataDebounceTime: number;
91
+ autoFocusSearch: boolean;
92
+ }>;
93
+ export default _default;
94
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
95
+ type __VLS_TypePropsToRuntimeProps<T> = {
96
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
97
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
98
+ } : {
99
+ type: import('vue').PropType<T[K]>;
100
+ required: true;
101
+ };
102
+ };
103
+ type __VLS_WithDefaults<P, D> = {
104
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
105
+ default: D[K];
106
+ }> : P[K];
107
+ };
108
+ type __VLS_Prettify<T> = {
109
+ [K in keyof T]: T[K];
110
+ } & {};
@@ -0,0 +1,7 @@
1
+ import o from "./ConditionalDropdown.vue2.js";
2
+ /* empty css */import _ from "../../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../../ConditionalDropdown.vue_vue_type_style_index_0_scoped_27802170_lang.css"; //*');
4
+ const n = /* @__PURE__ */ _(o, [["__scopeId", "data-v-27802170"]]);
5
+ export {
6
+ n as default
7
+ };
@@ -0,0 +1,224 @@
1
+ import "../../../ConditionalDropdown.vue_vue_type_style_index_0_scoped_27802170_lang.css"; import { defineComponent as $, computed as C, ref as s, watch as w, onMounted as I, openBlock as T, createBlock as j, unref as d, withCtx as f, createVNode as y, mergeProps as q, createElementVNode as G, isRef as H, normalizeProps as J, guardReactiveProps as W, createElementBlock as X, createTextVNode as Y, toDisplayString as Z, createCommentVNode as _ } from "vue";
2
+ import A from "./DropdownV4.vue.js";
3
+ import "./DefaultDropdownTrigger.vue.js";
4
+ import "./IconButtonDropdownTrigger.vue.js";
5
+ import ee from "./ChipDropdownTrigger.vue.js";
6
+ import "./AppDropdownTrigger.vue.js";
7
+ import le from "./ButtonDropdownTrigger.vue.js";
8
+ import "./ButtonFilterDropdownTrigger.vue.js";
9
+ import "./TreeDropdown.vue.js";
10
+ import "./OptionV4.vue.js";
11
+ import "./ConditionalDropdown.vue.js";
12
+ import ae from "../../search/v4/SearchV4.vue.js";
13
+ import te from "../../typography/v4/Typography.vue.js";
14
+ import { useDebounceFn as oe } from "@vueuse/core";
15
+ const ne = { class: "conditional-container" }, ie = {
16
+ key: 0,
17
+ class: "custom-list-area"
18
+ }, Oe = /* @__PURE__ */ $({
19
+ __name: "ConditionalDropdown",
20
+ props: {
21
+ selectedCondition: null,
22
+ appliedSelections: null,
23
+ conditionalOptions: null,
24
+ label: { default: "" },
25
+ testId: { default: "" },
26
+ comparingKey: { default: "id" },
27
+ fetchFnCallback: null,
28
+ optionNameKey: { default: "name" },
29
+ minCharsToStart: { default: 3 },
30
+ isOpen: { type: Boolean, default: !1 },
31
+ searchQuery: { default: "" },
32
+ loadMoreFn: { type: Function, default: null },
33
+ infiniteLoading: { type: Boolean, default: !1 },
34
+ fetchDataDebounceTime: { default: 400 },
35
+ autoFocusSearch: { type: Boolean, default: !0 },
36
+ groupedOptions: { type: Boolean, default: !1 },
37
+ optionFlagKey: { default: "" }
38
+ },
39
+ emits: ["update:selectedCondition", "update:appliedSelections", "clear"],
40
+ setup(r, { emit: O }) {
41
+ const e = r, h = C({
42
+ get: () => e.appliedSelections,
43
+ set: (l) => {
44
+ O("update:appliedSelections", l);
45
+ }
46
+ }), n = C({
47
+ get: () => e.selectedCondition || e.conditionalOptions[0],
48
+ set: (l) => {
49
+ O("update:selectedCondition", l);
50
+ }
51
+ }), k = s(null), p = s(!0), t = s([]), u = s([]), K = s(!0), c = s(!1), S = s(!1), i = s(e.searchQuery), N = s(""), m = s(e.label), D = s([]), L = C(() => (!i.value || i.value?.length < e.minCharsToStart) && !t.value.length ? `Enter at least ${e.minCharsToStart} keywords to begin` : "No results found"), F = C(() => {
52
+ const l = p.value ? 4 : 4.5, o = t.value.length > 4 ? t.value.length : l;
53
+ if (e.groupedOptions) {
54
+ let a = 0;
55
+ return t.value.forEach((g) => {
56
+ g.options && (a = a + g.options.length);
57
+ }), a > 4 ? a : l;
58
+ }
59
+ return o > l ? o : l;
60
+ }), U = (l, o) => {
61
+ if (e.infiniteLoading && n.value.multi && Array.isArray(u.value) && u.value.length && l && o.length) {
62
+ const a = [], g = u.value.filter(
63
+ (v) => v[e.optionNameKey].includes(l)
64
+ );
65
+ return o.forEach((v) => {
66
+ g.find(
67
+ (z) => z[e.comparingKey] === v[e.comparingKey]
68
+ ) && a.push(v[e.comparingKey]);
69
+ }), g.filter(
70
+ (v) => !a.includes(v[e.comparingKey])
71
+ );
72
+ }
73
+ return [];
74
+ }, B = async (l) => {
75
+ try {
76
+ c.value = !0;
77
+ const o = await e.fetchFnCallback(l), a = U(
78
+ l,
79
+ o
80
+ );
81
+ t.value = [...a, ...o], c.value = !1;
82
+ } catch (o) {
83
+ c.value = !1, console.error("Error fetching data:", o);
84
+ }
85
+ }, M = async () => {
86
+ if (e.infiniteLoading)
87
+ try {
88
+ S.value = !0;
89
+ const l = await e.loadMoreFn();
90
+ S.value = !1, Array.isArray(l) && (t.value = [...t.value, ...l]);
91
+ } catch (l) {
92
+ S.value = !1, console.error("Error fetching data:", l);
93
+ }
94
+ }, E = oe(
95
+ B,
96
+ e.fetchDataDebounceTime
97
+ ), b = (l) => {
98
+ l.length >= e.minCharsToStart ? (E(l), k.value?.scrollTo(0)) : e.infiniteLoading && n.value.multi ? t.value = D.value || [] : t.value = [];
99
+ }, V = () => {
100
+ i.value && t.value.length && !c.value && !n.value.multi ? t.value[0].conditionalOptions ? t.value[0] = {
101
+ name: i.value,
102
+ conditionalOptions: !0,
103
+ conditionalName: n.value.label,
104
+ [e.comparingKey]: i.value
105
+ } : t.value = [
106
+ {
107
+ name: i.value,
108
+ conditionalOptions: !0,
109
+ conditionalName: n.value.label,
110
+ [e.comparingKey]: i.value
111
+ },
112
+ ...t.value
113
+ ] : t.value.length && t.value[0].conditionalOptions && t.value.shift();
114
+ };
115
+ w(i, () => {
116
+ b(i.value);
117
+ }), w([n, t], () => {
118
+ V();
119
+ });
120
+ const x = () => {
121
+ p.value && u.value.length === 0 ? (n.value = null, h.value = [], n.value = null, m.value = e.label) : (N.value = i.value, m.value = `${e.label} ${n.value.label.toLowerCase()}`, h.value = p.value ? [...u.value] : { ...u.value }, K.value = p.value);
122
+ };
123
+ w(n, (l, o) => {
124
+ n.value.multi ? (c.value = !0, !o.multi && l.multi && Array.isArray(e.appliedSelections) && (u.value = e.appliedSelections), setTimeout(() => {
125
+ c.value = !1, p.value = !0;
126
+ }, 100)) : setTimeout(() => {
127
+ p.value = !1;
128
+ }, 100);
129
+ });
130
+ const Q = (l) => {
131
+ D.value = l;
132
+ }, P = () => {
133
+ u.value = [], h.value = [], n.value = null, m.value = e.label, i.value = "", O("clear");
134
+ }, R = (l) => {
135
+ l && n.value.multi && e.infiniteLoading && u.value && (t.value = u.value, i.value && b(i.value));
136
+ };
137
+ return I(() => {
138
+ (e.searchQuery || !e.infiniteLoading) && b(e.searchQuery);
139
+ }), (l, o) => (T(), j(d(A), {
140
+ ref_key: "dropdownRef",
141
+ ref: k,
142
+ selected: u.value,
143
+ "onUpdate:selected": o[2] || (o[2] = (a) => u.value = a),
144
+ "predefined-trigger": "chip",
145
+ "display-value": (a) => a?.[r.optionNameKey],
146
+ multi: p.value,
147
+ options: t.value,
148
+ placeholder: m.value,
149
+ "search-placeholder": "Search",
150
+ "option-name-key": r.optionNameKey,
151
+ "with-conditions": "",
152
+ "inline-search": "",
153
+ "custom-number-of-displayed-options": d(F),
154
+ "options-list-width": "330px",
155
+ loading: c.value,
156
+ "load-more-loading": S.value,
157
+ "comparing-key": r.comparingKey,
158
+ "is-open": r.isOpen,
159
+ "infinite-loading": r.infiniteLoading,
160
+ "show-select-all": !r.infiniteLoading && !i.value,
161
+ "grouped-options": r.groupedOptions,
162
+ "option-flag-key": r.optionFlagKey,
163
+ "onUpdate:isOpen": R,
164
+ onOnsearch: b,
165
+ onApply: x,
166
+ onLoadMore: M,
167
+ onUnsavedSelectionUpdate: Q
168
+ }, {
169
+ "dropdown-trigger": f(({ defaultTriggerProps: a }) => [
170
+ y(d(ee), q(a, {
171
+ label: m.value,
172
+ "selected-option": d(h),
173
+ multi: K.value,
174
+ "cancel-all-selected-display": "",
175
+ "display-value-in-quotes": !Array.isArray(u.value) && u.value.conditionalOptions,
176
+ onClear: P
177
+ }), null, 16, ["label", "selected-option", "multi", "display-value-in-quotes"])
178
+ ]),
179
+ "dropdown-conditions": f(() => [
180
+ G("div", ne, [
181
+ y(d(A), {
182
+ selected: d(n),
183
+ "onUpdate:selected": o[0] || (o[0] = (a) => H(n) ? n.value = a : null),
184
+ options: r.conditionalOptions,
185
+ "option-name-key": "label",
186
+ "display-value": (a) => a?.label,
187
+ container: ".conditional-container",
188
+ size: "small"
189
+ }, {
190
+ "dropdown-trigger": f(({ buttonTriggerProps: a }) => [
191
+ y(d(le), J(W(a)), null, 16)
192
+ ]),
193
+ _: 1
194
+ }, 8, ["selected", "options", "display-value"])
195
+ ])
196
+ ]),
197
+ "inline-search": f(() => [
198
+ y(d(ae), {
199
+ modelValue: i.value,
200
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => i.value = a),
201
+ class: "inline-search",
202
+ placeholder: "Search",
203
+ variant: "transparent",
204
+ size: "md",
205
+ "auto-focus": r.autoFocusSearch
206
+ }, null, 8, ["modelValue", "auto-focus"])
207
+ ]),
208
+ "custom-list-area": f(() => [
209
+ !t.value.length && !c.value ? (T(), X("div", ie, [
210
+ y(te, { variant: "body1" }, {
211
+ default: f(() => [
212
+ Y(Z(d(L)), 1)
213
+ ]),
214
+ _: 1
215
+ })
216
+ ])) : _("", !0)
217
+ ]),
218
+ _: 1
219
+ }, 8, ["selected", "display-value", "multi", "options", "placeholder", "option-name-key", "custom-number-of-displayed-options", "loading", "load-more-loading", "comparing-key", "is-open", "infinite-loading", "show-select-all", "grouped-options", "option-flag-key"]));
220
+ }
221
+ });
222
+ export {
223
+ Oe as default
224
+ };