@ironsource/shared-ui 2.1.11-rc.5 → 2.1.11-rc.51

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