@ironsource/shared-ui 2.1.11-test.5 → 2.1.11-test.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 (182) 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_8f96cf5a_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/EmptyStateV4.vue_vue_type_style_index_0_scoped_18728498_lang.css +1 -0
  16. package/FiltersPanelV4.vue_vue_type_style_index_0_scoped_383011d3_lang.css +1 -0
  17. package/FormCard.vue_vue_type_style_index_0_scoped_86feae7b_lang.css +1 -0
  18. package/InlineCopy.vue_vue_type_style_index_0_scoped_ad48b61e_lang.css +1 -0
  19. package/OptionV4.vue_vue_type_style_index_0_scoped_2c2947b3_lang.css +1 -0
  20. package/PopoverV4.vue_vue_type_style_index_0_scoped_66694b4e_lang.css +1 -0
  21. package/README.md +4 -15
  22. package/SnackbarV4.vue_vue_type_style_index_0_scoped_89fe8aa1_lang.css +1 -0
  23. package/SortableItem.vue_vue_type_style_index_0_scoped_7cb676f1_lang.css +1 -0
  24. package/SortableItemLabel.vue_vue_type_style_index_0_scoped_f2ced2f4_lang.css +1 -0
  25. package/SortableList.vue_vue_type_style_index_0_scoped_156c01ca_lang.css +1 -0
  26. package/TextField.vue_vue_type_style_index_0_scoped_2e327aa1_lang.css +1 -0
  27. package/ThemeWrapper.vue_vue_type_style_index_1_lang.css +1 -1
  28. package/ToggleButtonGroupAB.vue_vue_type_style_index_0_scoped_c81a7d3e_lang.css +1 -0
  29. package/TooltipV4.vue_vue_type_style_index_0_scoped_82b46d6d_lang.css +1 -0
  30. package/TreeDropdown.vue_vue_type_style_index_0_scoped_b883d1fa_lang.css +1 -0
  31. package/Typography.vue_vue_type_style_index_0_scoped_a14013a5_lang.css +1 -0
  32. package/components/autocomplete/Autocomplete.vue2.js +3 -2
  33. package/components/button/v3/Button.vue.d.ts +6 -6
  34. package/components/button/v3/index.d.ts +14 -14
  35. package/components/button/v4/ToggleButtonGroupAB.vue.d.ts +3 -1
  36. package/components/button/v4/ToggleButtonGroupAB.vue.js +2 -2
  37. package/components/button/v4/ToggleButtonGroupAB.vue2.js +44 -39
  38. package/components/button/v4/index.d.ts +9 -3
  39. package/components/chart/Chart.vue.d.ts +17 -4
  40. package/components/chart/Chart.vue.js +5 -5
  41. package/components/chart/Chart.vue2.js +127 -110
  42. package/components/chart/ChartHeader.vue.d.ts +13 -6
  43. package/components/chart/ChartHeader.vue.js +2 -2
  44. package/components/chart/ChartHeader.vue2.js +32 -29
  45. package/components/chart/ChartLegend.vue.d.ts +5 -0
  46. package/components/chart/ChartLegend.vue.js +3 -3
  47. package/components/chart/ChartLegend.vue2.js +99 -49
  48. package/components/chart/ChartTooltip.vue.d.ts +4 -5
  49. package/components/chart/ChartTooltip.vue.js +2 -2
  50. package/components/chart/ChartTooltip.vue2.js +64 -43
  51. package/components/chart/SettingsHeader.vue2.js +3 -2
  52. package/components/chart/index.d.ts +74 -35
  53. package/components/chart/mockData.d.ts +15 -2
  54. package/components/chart/types.d.ts +15 -1
  55. package/components/chart/utils/utils.js +5 -5
  56. package/components/checkbox/v4/CheckboxV4.vue.js +3 -3
  57. package/components/checkbox/v4/CheckboxV4.vue2.js +2 -2
  58. package/components/datePicker/v4/DatePickerV4.vue2.js +8 -7
  59. package/components/dateRange/v4/DateRangeV4.vue.js +2 -2
  60. package/components/dateRange/v4/DateRangeV4.vue2.js +9 -9
  61. package/components/dialog/v4/DialogV4.vue.d.ts +15 -0
  62. package/components/dialog/v4/DialogV4.vue.js +3 -3
  63. package/components/dialog/v4/DialogV4.vue2.js +80 -73
  64. package/components/dialog/v4/index.d.ts +58 -1
  65. package/components/dropdown/common/Dropdown.common.js +200 -189
  66. package/components/dropdown/v3/Dropdown.vue.d.ts +2 -2
  67. package/components/dropdown/v3/index.d.ts +39 -39
  68. package/components/dropdown/v4/AppDropdownTrigger.vue.d.ts +1 -1
  69. package/components/dropdown/v4/ButtonDropdownTrigger.vue.d.ts +15 -0
  70. package/components/dropdown/v4/ButtonDropdownTrigger.vue.js +2 -2
  71. package/components/dropdown/v4/ButtonDropdownTrigger.vue2.js +42 -20
  72. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue.js +2 -2
  73. package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue2.js +7 -7
  74. package/components/dropdown/v4/ChipDropdownTrigger.vue.d.ts +10 -0
  75. package/components/dropdown/v4/ChipDropdownTrigger.vue.js +3 -3
  76. package/components/dropdown/v4/ChipDropdownTrigger.vue2.js +88 -47
  77. package/components/dropdown/v4/ConditionalDropdown.vue.d.ts +110 -0
  78. package/components/dropdown/v4/ConditionalDropdown.vue.js +7 -0
  79. package/components/dropdown/v4/ConditionalDropdown.vue2.js +224 -0
  80. package/components/dropdown/v4/DropdownV4.vue.d.ts +32 -11
  81. package/components/dropdown/v4/DropdownV4.vue.js +3 -3
  82. package/components/dropdown/v4/DropdownV4.vue2.js +153 -138
  83. package/components/dropdown/v4/OptionV4.vue.d.ts +10 -0
  84. package/components/dropdown/v4/OptionV4.vue.js +2 -2
  85. package/components/dropdown/v4/OptionV4.vue2.js +135 -98
  86. package/components/dropdown/v4/TreeDropdown.vue.d.ts +6 -1
  87. package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
  88. package/components/dropdown/v4/TreeDropdown.vue2.js +165 -120
  89. package/components/dropdown/v4/index.d.ts +443 -110
  90. package/components/dropdown/v4/index.js +6 -3
  91. package/components/emptyState/v3/EmptyState.vue.d.ts +3 -3
  92. package/components/emptyState/v3/index.d.ts +7 -7
  93. package/components/emptyState/v4/EmptyStateV4.vue.js +3 -3
  94. package/components/emptyState/v4/EmptyStateV4.vue2.js +1 -1
  95. package/components/filtersPanel/v4/FiltersPanelV4.vue.js +2 -2
  96. package/components/filtersPanel/v4/FiltersPanelV4.vue2.js +8 -9
  97. package/components/forms/FormCard.vue.js +3 -3
  98. package/components/forms/FormCard.vue2.js +1 -1
  99. package/components/icon/v4/consts.d.ts +1 -1
  100. package/components/icon/v4/consts.js +1 -1
  101. package/components/inlineCopy/InlineCopy.vue.d.ts +5 -0
  102. package/components/inlineCopy/InlineCopy.vue.js +2 -2
  103. package/components/inlineCopy/InlineCopy.vue2.js +24 -22
  104. package/components/inlineCopy/index.d.ts +9 -0
  105. package/components/input/v4/TextField.vue.js +3 -3
  106. package/components/input/v4/TextField.vue2.js +12 -12
  107. package/components/multibar/MultiBarMenu.vue2.js +3 -2
  108. package/components/popover/v4/PopoverV4.vue.d.ts +14 -2
  109. package/components/popover/v4/PopoverV4.vue.js +4 -3
  110. package/components/popover/v4/PopoverV4.vue2.js +40 -24
  111. package/components/popover/v4/index.d.ts +55 -11
  112. package/components/snackbar/v4/SnackbarV4.vue.d.ts +7 -116
  113. package/components/snackbar/v4/SnackbarV4.vue.js +5 -5
  114. package/components/snackbar/v4/SnackbarV4.vue2.js +62 -60
  115. package/components/sortableList/SortableItem.vue.js +3 -3
  116. package/components/sortableList/SortableItem.vue2.js +57 -56
  117. package/components/sortableList/SortableItemLabel.vue.js +3 -3
  118. package/components/sortableList/SortableItemLabel.vue2.js +20 -23
  119. package/components/sortableList/SortableList.vue.d.ts +1 -1
  120. package/components/sortableList/SortableList.vue.js +3 -3
  121. package/components/sortableList/SortableList.vue2.js +82 -76
  122. package/components/sortableList/index.d.ts +4 -4
  123. package/components/table/common/Table.common.d.ts +1 -1
  124. package/components/table/common/Table.common.js +83 -77
  125. package/components/table/common/Table.types.d.ts +1 -1
  126. package/components/table/common/consts.d.ts +4 -0
  127. package/components/table/common/consts.js +7 -0
  128. package/components/table/v3/Table.vue.d.ts +1 -1
  129. package/components/table/v3/index.d.ts +5 -5
  130. package/components/table/v4/DataGrid.vue.d.ts +12 -2
  131. package/components/table/v4/DataGrid.vue.js +2 -2
  132. package/components/table/v4/DataGrid.vue2.js +164 -155
  133. package/components/table/v4/DataGridMenu.vue.js +5 -5
  134. package/components/table/v4/DataGridMenu.vue2.js +4 -3
  135. package/components/table/v4/index.d.ts +64 -26
  136. package/components/table-cells/common/Editable.common.js +24 -19
  137. package/components/tooltip/v4/TooltipV4.vue.d.ts +10 -0
  138. package/components/tooltip/v4/TooltipV4.vue.js +2 -2
  139. package/components/tooltip/v4/TooltipV4.vue2.js +24 -21
  140. package/components/tooltip/v4/index.d.ts +39 -1
  141. package/components/typography/v4/Typography.vue.js +3 -3
  142. package/components/typography/v4/Typography.vue2.js +24 -18
  143. package/composables/useFormValidation.d.ts +1 -1
  144. package/design-foundation.stories/icons/iconsData.d.ts +1 -1
  145. package/index.d.ts +1426 -320
  146. package/index.js +1 -1
  147. package/mocks/options.d.ts +48 -6
  148. package/mocks/words.d.ts +1 -1
  149. package/package.json +3 -239
  150. package/style/v4/grid.css +1 -1
  151. package/style/v4/grid.css.map +1 -1
  152. package/style/v4/spacings.scss +1 -0
  153. package/testids/index.d.ts +1 -0
  154. package/testids/index.js +13 -13
  155. package/ButtonDropdownTrigger.vue_vue_type_style_index_0_scoped_76c74f58_lang.css +0 -1
  156. package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_7f750550_lang.css +0 -1
  157. package/Chart.vue_vue_type_style_index_0_scoped_ea1e5c3e_lang.css +0 -1
  158. package/ChartHeader.vue_vue_type_style_index_0_scoped_4c37736e_lang.css +0 -1
  159. package/ChartLegend.vue_vue_type_style_index_0_scoped_c0f71a49_lang.css +0 -1
  160. package/ChartTooltip.vue_vue_type_style_index_0_scoped_ec636f18_lang.css +0 -1
  161. package/CheckboxV4.vue_vue_type_style_index_0_scoped_8e5b619a_lang.css +0 -1
  162. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_49bd7193_lang.css +0 -1
  163. package/DataGrid.vue_vue_type_style_index_0_scoped_0cd8af73_lang.css +0 -1
  164. package/DataGridMenu.vue_vue_type_style_index_0_scoped_a6e4672f_lang.css +0 -1
  165. package/DateRangeV4.vue_vue_type_style_index_0_scoped_f81413ec_lang.css +0 -1
  166. package/DialogV4.vue_vue_type_style_index_0_scoped_09c488cf_lang.css +0 -1
  167. package/DropdownV4.vue_vue_type_style_index_0_scoped_e899ec7a_lang.css +0 -1
  168. package/EmptyStateV4.vue_vue_type_style_index_0_scoped_24001caa_lang.css +0 -1
  169. package/FiltersPanelV4.vue_vue_type_style_index_0_scoped_39061862_lang.css +0 -1
  170. package/FormCard.vue_vue_type_style_index_0_scoped_c7965a69_lang.css +0 -1
  171. package/InlineCopy.vue_vue_type_style_index_0_scoped_893a203c_lang.css +0 -1
  172. package/OptionV4.vue_vue_type_style_index_0_scoped_4070942a_lang.css +0 -1
  173. package/PopoverV4.vue_vue_type_style_index_0_scoped_74bbce13_lang.css +0 -1
  174. package/SnackbarV4.vue_vue_type_style_index_0_scoped_49c5ccea_lang.css +0 -1
  175. package/SortableItem.vue_vue_type_style_index_0_scoped_9dd4d372_lang.css +0 -1
  176. package/SortableItemLabel.vue_vue_type_style_index_0_scoped_1386ae20_lang.css +0 -1
  177. package/SortableList.vue_vue_type_style_index_0_scoped_e9cd63b8_lang.css +0 -1
  178. package/TextField.vue_vue_type_style_index_0_scoped_4d9bf5b2_lang.css +0 -1
  179. package/ToggleButtonGroupAB.vue_vue_type_style_index_0_scoped_9d9e51c0_lang.css +0 -1
  180. package/TooltipV4.vue_vue_type_style_index_0_scoped_fcdb9d02_lang.css +0 -1
  181. package/TreeDropdown.vue_vue_type_style_index_0_scoped_6ac5f602_lang.css +0 -1
  182. package/Typography.vue_vue_type_style_index_0_scoped_992962bc_lang.css +0 -1
@@ -1,21 +1,21 @@
1
- import "../../SortableList.vue_vue_type_style_index_0_scoped_e9cd63b8_lang.css"; import { defineComponent as F, computed as f, ref as P, openBlock as s, createElementBlock as i, mergeProps as T, unref as l, createBlock as g, isRef as N, createCommentVNode as y, withCtx as m, Fragment as V, renderList as D, renderSlot as S, createElementVNode as G, createVNode as $, createTextVNode as U, toDisplayString as M } from "vue";
2
- import { VueDraggable as K } from "vue-draggable-plus";
3
- import w from "./SortableItem.vue.js";
4
- import Q from "../search/v4/SearchV4.vue.js";
5
- import j from "../typography/v4/Typography.vue.js";
6
- import z from "../skeleton/v4/SkeletonV4.vue.js";
7
- import { useVModel as J } from "@vueuse/core";
8
- import { matchString as x } from "../../utils/search.js";
9
- import { useTestIdAttrs as W } from "../../utils/testIds.js";
1
+ import "../../SortableList.vue_vue_type_style_index_0_scoped_156c01ca_lang.css"; import { defineComponent as G, useSlots as U, computed as p, ref as M, openBlock as s, createElementBlock as i, mergeProps as T, unref as l, createBlock as g, isRef as $, createCommentVNode as m, withCtx as y, Fragment as V, renderList as D, createSlots as w, renderSlot as S, createElementVNode as K, createVNode as x, createTextVNode as Q, toDisplayString as j } from "vue";
2
+ import { VueDraggable as z } from "vue-draggable-plus";
3
+ import q from "./SortableItem.vue.js";
4
+ import J from "../search/v4/SearchV4.vue.js";
5
+ import W from "../typography/v4/Typography.vue.js";
6
+ import X from "../skeleton/v4/SkeletonV4.vue.js";
7
+ import { useVModel as Y } from "@vueuse/core";
8
+ import { matchString as H } from "../../utils/search.js";
9
+ import { useTestIdAttrs as Z } from "../../utils/testIds.js";
10
10
  import { SortableListTestIdModifiers as I } from "../../testids/index.js";
11
- import { DRAG_CURSOR_CSS_CLASS as q } from "./consts.js";
12
- const X = {
11
+ import { DRAG_CURSOR_CSS_CLASS as O } from "./consts.js";
12
+ const _ = {
13
13
  key: 1,
14
14
  class: "sortable-list-container"
15
- }, Y = { class: "loader-bars" }, Z = {
15
+ }, ee = { class: "loader-bars" }, te = {
16
16
  key: 3,
17
17
  class: "empty-state-title"
18
- }, ue = /* @__PURE__ */ F({
18
+ }, fe = /* @__PURE__ */ G({
19
19
  __name: "SortableList",
20
20
  props: {
21
21
  items: { default: () => [] },
@@ -34,127 +34,133 @@ const X = {
34
34
  },
35
35
  emits: ["sortableItemDragged", "update:items", "update:openId", "update:selectedId", "update:selectedChildId", "update:search", "clearSearch"],
36
36
  setup(d, { emit: o }) {
37
- const n = d, u = J(n, "search", o), v = f(() => !!u.value?.trim()), C = f(() => v.value ? n.items.filter((t) => {
37
+ const r = d, R = U(), u = Y(r, "search", o), v = p(() => !!u.value?.trim()), C = p(() => v.value ? r.items.filter((t) => {
38
38
  const a = t.children || [], e = u.value;
39
- return n.searchHandler ? n.searchHandler(t, e) : x(t.displayText, e) || // match parent item
40
- a.some((r) => x(r.displayText, e));
41
- }) : n.items), h = f({
39
+ return r.searchHandler ? r.searchHandler(t, e) : H(t.displayText, e) || // match parent item
40
+ a.some((n) => H(n.displayText, e));
41
+ }) : r.items), h = p({
42
42
  get() {
43
43
  return C.value.filter((t) => !t.isLocked);
44
44
  },
45
45
  set(t) {
46
- o("update:items", [...t, ...b.value]);
46
+ o("update:items", [...t, ...k.value]);
47
47
  }
48
- }), b = f(
48
+ }), k = p(
49
49
  () => C.value.filter((t) => t.isLocked)
50
- ), k = P(!1), H = (t) => {
51
- k.value = !0, setTimeout(() => t.target.classList.add(q), 50);
52
- }, O = (t) => {
53
- const { target: a, item: e, newIndex: r } = t;
54
- k.value = !1, a.classList.remove(q);
50
+ ), b = M(!1), F = (t) => {
51
+ b.value = !0, setTimeout(() => t.target.classList.add(O), 50);
52
+ }, P = (t) => {
53
+ const { target: a, item: e, newIndex: n } = t;
54
+ b.value = !1, a.classList.remove(O);
55
55
  const c = e.attributes["data-id"]?.value;
56
- o("sortableItemDragged", { id: c, newIndex: r });
57
- }, R = (t) => (v.value || t.id === n.openId) && !k.value, A = (t, a) => {
56
+ o("sortableItemDragged", { id: c, newIndex: n });
57
+ }, A = (t) => (v.value || t.id === r.openId) && !b.value, B = (t, a) => {
58
58
  a ? o("update:openId", t.id) : o("update:openId", null);
59
- }, p = (t) => t.id === n.selectedId, B = (t) => {
59
+ }, f = (t) => t.id === r.selectedId, E = (t) => {
60
60
  o("update:selectedId", t.id), o("update:selectedChildId", null);
61
- }, E = (t, a) => {
61
+ }, N = (t, a) => {
62
62
  o("update:selectedChildId", t.id), o("update:selectedId", a.id), o("update:openId", a.id);
63
- }, L = W(n.testId, I);
63
+ }, L = Z(r.testId, I);
64
64
  return (t, a) => (s(), i("div", T({ class: "sortable-list-and-search-container" }, l(L)[l(I).CONTAINER]), [
65
- d.showSearch ? (s(), g(l(Q), {
65
+ d.showSearch ? (s(), g(l(J), {
66
66
  key: 0,
67
67
  modelValue: l(u),
68
- "onUpdate:modelValue": a[0] || (a[0] = (e) => N(u) ? u.value = e : null),
68
+ "onUpdate:modelValue": a[0] || (a[0] = (e) => $(u) ? u.value = e : null),
69
69
  class: "list-search",
70
70
  placeholder: d.searchPlaceholder,
71
71
  "test-id": d.testId,
72
72
  onOnClear: a[1] || (a[1] = (e) => o("clearSearch"))
73
- }, null, 8, ["modelValue", "placeholder", "test-id"])) : y("", !0),
73
+ }, null, 8, ["modelValue", "placeholder", "test-id"])) : m("", !0),
74
74
  d.isLoading ? S(t.$slots, "loader", { key: 2 }, () => [
75
- G("div", Y, [
75
+ K("div", ee, [
76
76
  (s(!0), i(V, null, D(d.loadingRowCount, (e) => (s(), i("div", { key: e }, [
77
- $(l(z), {
77
+ x(l(X), {
78
78
  round: "",
79
79
  class: "loader-bar"
80
80
  })
81
81
  ]))), 128))
82
82
  ])
83
- ], !0) : (s(), i("div", X, [
84
- l(h).length ? (s(), g(l(K), T({
83
+ ], !0) : (s(), i("div", _, [
84
+ l(h).length ? (s(), g(l(z), T({
85
85
  key: 0,
86
86
  modelValue: l(h),
87
- "onUpdate:modelValue": a[2] || (a[2] = (e) => N(h) ? h.value = e : null),
87
+ "onUpdate:modelValue": a[2] || (a[2] = (e) => $(h) ? h.value = e : null),
88
88
  class: "sortable-list",
89
89
  filter: ".expand-icon",
90
90
  animation: 150,
91
91
  handle: ".draggable-handle",
92
92
  disabled: l(v)
93
93
  }, l(L)[l(I).DRAGGABLE_LIST], {
94
- onStart: H,
95
- onEnd: O
94
+ onStart: F,
95
+ onEnd: P
96
96
  }), {
97
- default: m(() => [
98
- (s(!0), i(V, null, D(l(h), (e, r) => (s(), g(w, {
97
+ default: y(() => [
98
+ (s(!0), i(V, null, D(l(h), (e, n) => (s(), g(q, {
99
99
  key: e.id,
100
100
  "data-id": e.id,
101
101
  item: e,
102
- index: r,
103
- "is-open": R(e),
104
- "is-selected": p(e),
105
- "selected-child-id": p(e) ? d.selectedChildId : null,
102
+ index: n,
103
+ "is-open": A(e),
104
+ "is-selected": f(e),
105
+ "selected-child-id": f(e) ? d.selectedChildId : null,
106
106
  "display-value": d.displayValue,
107
107
  "search-query": l(u),
108
108
  "search-handler": d.searchHandler,
109
- onToggle: (c) => A(e, c),
110
- onSelect: (c) => B(e),
111
- onSelectChild: (c) => E(c, e)
112
- }, {
113
- menu: m(() => [
114
- S(t.$slots, "menu", { item: e }, void 0, !0)
115
- ]),
116
- _: 2
117
- }, 1032, ["data-id", "item", "index", "is-open", "is-selected", "selected-child-id", "display-value", "search-query", "search-handler", "onToggle", "onSelect", "onSelectChild"]))), 128))
109
+ onToggle: (c) => B(e, c),
110
+ onSelect: (c) => E(e),
111
+ onSelectChild: (c) => N(c, e)
112
+ }, w({ _: 2 }, [
113
+ l(R).menu ? {
114
+ name: "menu",
115
+ fn: y(() => [
116
+ S(t.$slots, "menu", { item: e }, void 0, !0)
117
+ ]),
118
+ key: "0"
119
+ } : void 0
120
+ ]), 1032, ["data-id", "item", "index", "is-open", "is-selected", "selected-child-id", "display-value", "search-query", "search-handler", "onToggle", "onSelect", "onSelectChild"]))), 128))
118
121
  ]),
119
122
  _: 3
120
- }, 16, ["modelValue", "disabled"])) : y("", !0),
121
- l(b).length ? (s(), i("div", T({
123
+ }, 16, ["modelValue", "disabled"])) : m("", !0),
124
+ l(k).length ? (s(), i("div", T({
122
125
  key: 1,
123
126
  class: "locked-list"
124
127
  }, l(L)[l(I).LOCKED_LIST]), [
125
- (s(!0), i(V, null, D(l(b), (e) => (s(), g(w, {
128
+ (s(!0), i(V, null, D(l(k), (e) => (s(), g(q, {
126
129
  key: e.id,
127
130
  item: e,
128
- "is-open": R(e),
129
- "is-selected": p(e),
130
- "selected-child-id": p(e) ? d.selectedChildId : null,
131
+ "is-open": A(e),
132
+ "is-selected": f(e),
133
+ "selected-child-id": f(e) ? d.selectedChildId : null,
131
134
  "display-value": d.displayValue,
132
135
  "search-query": l(u),
133
136
  "on-search": d.searchHandler,
134
- onToggle: (r) => A(e, r),
135
- onSelect: (r) => B(e),
136
- onSelectChild: (r) => E(r, e)
137
- }, {
138
- menu: m(() => [
139
- S(t.$slots, "menu", { item: e }, void 0, !0)
140
- ]),
141
- _: 2
142
- }, 1032, ["item", "is-open", "is-selected", "selected-child-id", "display-value", "search-query", "on-search", "onToggle", "onSelect", "onSelectChild"]))), 128))
143
- ], 16)) : y("", !0)
137
+ onToggle: (n) => B(e, n),
138
+ onSelect: (n) => E(e),
139
+ onSelectChild: (n) => N(n, e)
140
+ }, w({ _: 2 }, [
141
+ l(R).menu ? {
142
+ name: "menu",
143
+ fn: y(() => [
144
+ S(t.$slots, "menu", { item: e }, void 0, !0)
145
+ ]),
146
+ key: "0"
147
+ } : void 0
148
+ ]), 1032, ["item", "is-open", "is-selected", "selected-child-id", "display-value", "search-query", "on-search", "onToggle", "onSelect", "onSelectChild"]))), 128))
149
+ ], 16)) : m("", !0)
144
150
  ])),
145
- !l(C).length && !d.isLoading ? (s(), i("div", Z, [
151
+ !l(C).length && !d.isLoading ? (s(), i("div", te, [
146
152
  S(t.$slots, "empty-state", {}, () => [
147
- $(l(j), { variant: "body2" }, {
148
- default: m(() => [
149
- U(M(d.emptyStateTitle), 1)
153
+ x(l(W), { variant: "body2" }, {
154
+ default: y(() => [
155
+ Q(j(d.emptyStateTitle), 1)
150
156
  ]),
151
157
  _: 1
152
158
  })
153
159
  ], !0)
154
- ])) : y("", !0)
160
+ ])) : m("", !0)
155
161
  ], 16));
156
162
  }
157
163
  });
158
164
  export {
159
- ue as default
165
+ fe as default
160
166
  };
@@ -73,6 +73,7 @@ declare const SortableListTypes: () => ({
73
73
  default: string;
74
74
  };
75
75
  }>> & {
76
+ onClearSearch?: () => any;
76
77
  onSortableItemDragged?: (event: {
77
78
  id: string;
78
79
  newIndex: number;
@@ -82,7 +83,6 @@ declare const SortableListTypes: () => ({
82
83
  "onUpdate:selectedId"?: (id: string | number) => any;
83
84
  "onUpdate:selectedChildId"?: (id: string | number) => any;
84
85
  "onUpdate:search"?: (query: string) => any;
85
- onClearSearch?: () => any;
86
86
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "search" | "testId" | "isLoading" | "displayValue" | "searchPlaceholder" | "items" | "selectedChildId" | "searchHandler" | "openId" | "selectedId" | "showSearch" | "loadingRowCount" | "emptyStateTitle">;
87
87
  $attrs: {
88
88
  [x: string]: unknown;
@@ -156,6 +156,7 @@ declare const SortableListTypes: () => ({
156
156
  default: string;
157
157
  };
158
158
  }>> & {
159
+ onClearSearch?: () => any;
159
160
  onSortableItemDragged?: (event: {
160
161
  id: string;
161
162
  newIndex: number;
@@ -165,7 +166,6 @@ declare const SortableListTypes: () => ({
165
166
  "onUpdate:selectedId"?: (id: string | number) => any;
166
167
  "onUpdate:selectedChildId"?: (id: string | number) => any;
167
168
  "onUpdate:search"?: (query: string) => any;
168
- onClearSearch?: () => any;
169
169
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
170
170
  sortableItemDragged: (event: {
171
171
  id: string;
@@ -267,6 +267,7 @@ declare const SortableListTypes: () => ({
267
267
  default: string;
268
268
  };
269
269
  }>> & {
270
+ onClearSearch?: () => any;
270
271
  onSortableItemDragged?: (event: {
271
272
  id: string;
272
273
  newIndex: number;
@@ -276,7 +277,6 @@ declare const SortableListTypes: () => ({
276
277
  "onUpdate:selectedId"?: (id: string | number) => any;
277
278
  "onUpdate:selectedChildId"?: (id: string | number) => any;
278
279
  "onUpdate:search"?: (query: string) => any;
279
- onClearSearch?: () => any;
280
280
  } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
281
281
  __isFragment?: never;
282
282
  __isTeleport?: never;
@@ -337,6 +337,7 @@ declare const SortableListTypes: () => ({
337
337
  default: string;
338
338
  };
339
339
  }>> & {
340
+ onClearSearch?: () => any;
340
341
  onSortableItemDragged?: (event: {
341
342
  id: string;
342
343
  newIndex: number;
@@ -346,7 +347,6 @@ declare const SortableListTypes: () => ({
346
347
  "onUpdate:selectedId"?: (id: string | number) => any;
347
348
  "onUpdate:selectedChildId"?: (id: string | number) => any;
348
349
  "onUpdate:search"?: (query: string) => any;
349
- onClearSearch?: () => any;
350
350
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
351
351
  sortableItemDragged: (event: {
352
352
  id: string;
@@ -19,7 +19,7 @@ export declare const tableCommon: (props: any, emit: any) => {
19
19
  floatingActionRef: import("vue").Ref<HTMLDivElement>;
20
20
  scrollToTop: () => void;
21
21
  toggleSortOrder: (column: Column) => void;
22
- columnsStickyPositions: import("vue").ComputedRef<Record<string, string>>;
22
+ columnsStickyPositions: import("vue").ComputedRef<Record<string, CSSProperties>>;
23
23
  hasSearchSlot: import("vue").ComputedRef<boolean>;
24
24
  showBackToTopButton: import("vue").ComputedRef<boolean>;
25
25
  containerStyle: import("vue").ComputedRef<CSSProperties>;
@@ -1,125 +1,131 @@
1
- import { useSlots as G, ref as c, provide as N, computed as s, onMounted as V, nextTick as j } from "vue";
2
- import { useVirtualList as q, useInfiniteScroll as F } from "@vueuse/core";
3
- import { TableContext as J } from "./TableContext.js";
4
- const Q = 46, U = 46, tt = (e, u) => {
5
- const S = G(), a = c([]);
6
- N(J, {
7
- onClose({ rowIndex: t, cellIndex: o, value: n } = {}) {
8
- n && (a.value = [...a.value, t], u("saveRow", {
1
+ import { useSlots as V, ref as a, provide as Y, computed as n, onMounted as j, nextTick as q } from "vue";
2
+ import { useVirtualList as F, useInfiniteScroll as J } from "@vueuse/core";
3
+ import { TableContext as Q } from "./TableContext.js";
4
+ import { CHECKBOX_STICKY_COL_WIDTH as Z, CHECKBOX_COL_WIDTH as p, EXPAND_COL_WIDTH as tt, CHECKBOX_COLUMN_ID as et } from "./consts.js";
5
+ const rt = (e, d) => {
6
+ const x = V(), u = a([]);
7
+ Y(Q, {
8
+ onClose({ rowIndex: t, cellIndex: o, value: i } = {}) {
9
+ u.value = [...u.value, t], d("saveRow", {
9
10
  rowIndex: t,
10
11
  cellIndex: o,
11
- value: n,
12
+ value: i,
12
13
  confirm: () => {
13
- a.value = a.value.filter(
14
- (i) => i !== t
15
- );
14
+ u.value = u.value.filter((l) => l !== t);
16
15
  }
17
- }));
16
+ });
18
17
  },
19
18
  setActiveMenuRow(t) {
20
- x.value = t;
19
+ R.value = t;
21
20
  }
22
21
  });
23
- const y = s(() => !!e.selection), C = s(() => {
24
- const t = (y.value ? `${U}px ` : "") + (g.value ? `${Q}px ` : "");
25
- return e.columns.reduce((o, n) => {
26
- const i = n.width ? `${n.width}px` : `${n.colSpan || 1}fr`;
27
- return `${o} ${i}`;
22
+ const h = n(() => !!e.selection), T = n(() => e.isSelectionSticky ? Z : p), b = n(() => {
23
+ const t = (h.value ? `${T.value}px ` : "") + (v.value ? `${tt}px ` : "");
24
+ return e.columns.reduce((o, { width: i, colSpan: l }) => {
25
+ const s = typeof i == "number" ? `${i}px` : i, S = s || `${l || 1}fr`;
26
+ return `${o} ${S}`;
28
27
  }, t);
29
- }), g = s(() => !!S.expanded), A = c(null), x = c(null), R = s(() => Array(e.loadingRowCount).fill(
28
+ }), v = n(() => !!x.expanded), O = a(null), R = a(null), k = n(() => Array(e.loadingRowCount).fill(
30
29
  Array(e.columns.length).fill("")
31
- )), H = s(() => e.rows.length && Array.isArray(e.rows[0]) ? e.isLoading ? [...e.rows, ...R.value] : e.rows : e.isLoading ? [
30
+ )), I = n(() => e.rows.length && Array.isArray(e.rows[0]) ? e.isLoading ? [...e.rows, ...k.value] : e.rows : e.isLoading ? [
32
31
  ...e.rows.map((o) => o[e.rowDataKey]),
33
- ...R.value
34
- ] : e.rows.map((o) => o[e.rowDataKey])), { list: T, containerProps: l, wrapperProps: $, scrollTo: b } = q(
35
- H,
32
+ ...k.value
33
+ ] : e.rows.map((o) => o[e.rowDataKey])), { list: H, containerProps: r, wrapperProps: A, scrollTo: B } = F(
34
+ I,
36
35
  {
37
- itemHeight: g.value ? (t) => w[t] ?? e.rowHeight : e.rowHeight
36
+ itemHeight: v.value ? (t) => m[t] ?? e.rowHeight : e.rowHeight
38
37
  }
39
- ), k = c(null), h = c(0), B = s(() => !!S.search), I = (t) => {
40
- l.onScroll(), h.value = t.target.scrollLeft + t.target.getBoundingClientRect().width, u("onScroll", t.target.scrollTop);
38
+ ), $ = a(null), w = a(0), L = n(() => !!x.search), _ = (t) => {
39
+ r.onScroll(), w.value = t.target.scrollLeft + t.target.getBoundingClientRect().width, d("onScroll", t.target.scrollTop);
41
40
  };
42
- V(() => {
43
- h.value = l.ref.value?.getBoundingClientRect().width, e.defaultScrollPosition && setTimeout(() => {
44
- l.ref.value?.scrollTo({
41
+ j(() => {
42
+ w.value = r.ref.value?.getBoundingClientRect().width, e.defaultScrollPosition && setTimeout(() => {
43
+ r.ref.value?.scrollTo({
45
44
  top: e.defaultScrollPosition,
46
45
  behavior: "smooth"
47
46
  });
48
47
  }, 300);
49
48
  });
50
- const O = s(() => {
51
- const [t] = T.value;
49
+ const E = n(() => {
50
+ const [t] = H.value;
52
51
  return t && t.index > 0;
53
- }), P = s(() => l.style), L = s(() => e.columns.reduce((t, o) => (o.isSticky && (t[o.id] = M(o)), t), {}));
54
- F(
55
- l.ref,
52
+ }), P = n(() => r.style), D = n(() => {
53
+ const t = {
54
+ id: et,
55
+ isSticky: e.isSelectionSticky,
56
+ width: T.value
57
+ };
58
+ return h.value ? [t] : [];
59
+ }), f = n(() => [...D.value, ...e.columns]), K = n(() => f.value.reduce((t, o) => (o.isSticky && (t[o.id] = X(o)), t), {}));
60
+ J(
61
+ r.ref,
56
62
  () => {
57
- e.isInfiniteScroll && u("loadMore");
63
+ e.isInfiniteScroll && d("loadMore");
58
64
  },
59
65
  { distance: e.infiniteScrollThreshold }
60
66
  );
61
- function E() {
62
- l.ref.value?.scrollTo({
67
+ function M() {
68
+ r.ref.value?.scrollTo({
63
69
  top: 0,
64
70
  behavior: "smooth"
65
71
  });
66
72
  }
67
- function D(t) {
73
+ function W(t) {
68
74
  if (!e.sort)
69
75
  return;
70
76
  const o = e.sort.sortBy === t.id;
71
77
  if (!(t.isSortable || t.isSortable === void 0))
72
78
  return;
73
- let i = e.sort.sortOrder, f = e.sort.sortBy;
74
- o ? i = e.sort.sortOrder === "asc" ? "desc" : "asc" : f = t.id, u("update:sort", { sortBy: f, sortOrder: i });
79
+ let l = e.sort.sortOrder, s = e.sort.sortBy;
80
+ o ? l = e.sort.sortOrder === "asc" ? "desc" : "asc" : s = t.id, d("update:sort", { sortBy: s, sortOrder: l });
75
81
  }
76
- function M(t) {
77
- const { isSticky: o, width: n } = t;
78
- if (!o || !n)
82
+ function X(t) {
83
+ const { isSticky: o, width: i } = t;
84
+ if (!o || !i)
79
85
  return null;
80
- const i = e.columns.findIndex((r) => r.id === t.id), f = e.columns.reduce((r, v, m) => m < i ? r + v.width : r, 0), z = e.columns.reduce((r, v, m) => m > i ? r + v.width : r, 0);
86
+ const l = f.value.findIndex((c) => c.id === t.id), s = f.value.reduce((c, C, y) => y < l ? c + C.width : c, 0), S = f.value.reduce((c, C, y) => y > l ? c + C.width : c, 0);
81
87
  return {
82
- ...t.isStickyRight ? { right: `${z}px` } : { left: `${f}px` },
88
+ ...t.isStickyRight ? { right: `${S}px` } : { left: `${s}px` },
83
89
  zIndex: 1
84
90
  };
85
91
  }
86
- const d = c([]), w = {}, _ = (t) => d.value.includes(t), K = async (t, o) => {
87
- const n = d.value.indexOf(t);
88
- if (n === -1) {
89
- d.value.push(t);
90
- const i = o.target.closest("tr");
91
- await j(), i && (w[t] = i.offsetHeight);
92
+ const g = a([]), m = {}, N = (t) => g.value.includes(t), z = async (t, o) => {
93
+ const i = g.value.indexOf(t);
94
+ if (i === -1) {
95
+ g.value.push(t);
96
+ const l = o.target.closest("tr");
97
+ await q(), l && (m[t] = l.offsetHeight);
92
98
  } else
93
- d.value.splice(n, 1), delete w[t];
94
- }, W = s(() => `${e.rowHeight}px`), X = s(
99
+ g.value.splice(i, 1), delete m[t];
100
+ }, G = n(() => `${e.rowHeight}px`), U = n(
95
101
  () => `1 / span ${e.columns.length + 1}`
96
102
  );
97
103
  return {
98
- list: T,
99
- containerProps: l,
100
- wrapperProps: $,
101
- activeRow: A,
102
- gridColumnTemplate: C,
103
- floatingActionRef: k,
104
- scrollToTop: E,
105
- toggleSortOrder: D,
106
- columnsStickyPositions: L,
107
- hasSearchSlot: B,
108
- showBackToTopButton: O,
104
+ list: H,
105
+ containerProps: r,
106
+ wrapperProps: A,
107
+ activeRow: O,
108
+ gridColumnTemplate: b,
109
+ floatingActionRef: $,
110
+ scrollToTop: M,
111
+ toggleSortOrder: W,
112
+ columnsStickyPositions: K,
113
+ hasSearchSlot: L,
114
+ showBackToTopButton: E,
109
115
  containerStyle: P,
110
- onScroll: I,
111
- scrollTo: b,
112
- savingRows: a,
113
- floatingActionPosition: h,
114
- hasExpandSlot: g,
115
- hasCheckboxes: y,
116
- toggleExpandRow: K,
117
- isRowExpanded: _,
118
- cssRowHeight: W,
119
- cssExpandGridCol: X,
120
- activeMenuRow: x
116
+ onScroll: _,
117
+ scrollTo: B,
118
+ savingRows: u,
119
+ floatingActionPosition: w,
120
+ hasExpandSlot: v,
121
+ hasCheckboxes: h,
122
+ toggleExpandRow: z,
123
+ isRowExpanded: N,
124
+ cssRowHeight: G,
125
+ cssExpandGridCol: U,
126
+ activeMenuRow: R
121
127
  };
122
128
  };
123
129
  export {
124
- tt as tableCommon
130
+ rt as tableCommon
125
131
  };
@@ -7,7 +7,7 @@ export type Column = {
7
7
  isBordered?: boolean;
8
8
  isSortable?: boolean;
9
9
  colSpan?: number;
10
- width?: number;
10
+ width?: number | string;
11
11
  isTextRight?: boolean;
12
12
  isStickyRight?: boolean;
13
13
  helpText?: string;
@@ -0,0 +1,4 @@
1
+ export declare const CHECKBOX_COLUMN_ID = "__CHECKBOX_COLUMN_ID__";
2
+ export declare const EXPAND_COL_WIDTH = 46;
3
+ export declare const CHECKBOX_COL_WIDTH = 46;
4
+ export declare const CHECKBOX_STICKY_COL_WIDTH = 57;
@@ -0,0 +1,7 @@
1
+ const _ = "__CHECKBOX_COLUMN_ID__", C = 46, O = 46, H = 57;
2
+ export {
3
+ _ as CHECKBOX_COLUMN_ID,
4
+ O as CHECKBOX_COL_WIDTH,
5
+ H as CHECKBOX_STICKY_COL_WIDTH,
6
+ C as EXPAND_COL_WIDTH
7
+ };
@@ -67,10 +67,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
67
67
  defaultScrollPosition: any;
68
68
  testId: string;
69
69
  }>>> & {
70
+ onLoadMore?: () => any;
70
71
  onOnScroll?: (event: Event) => any;
71
72
  "onUpdate:sort"?: (newSort: Sort) => any;
72
73
  onSaveRow?: (args_0: SaveRowEvent) => any;
73
- onLoadMore?: () => any;
74
74
  }, {
75
75
  testId: string;
76
76
  isLoading: boolean;
@@ -81,10 +81,10 @@ declare const TableTypes: () => (import("vue").InjectionKey<import("../common/Ta
81
81
  default: any;
82
82
  };
83
83
  }>> & {
84
+ onLoadMore?: () => any;
84
85
  onOnScroll?: (event: Event) => any;
85
86
  "onUpdate:sort"?: (newSort: import("../common/Table.types").Sort) => any;
86
87
  onSaveRow?: (args_0: import("../common/Table.types").SaveRowEvent) => any;
87
- onLoadMore?: () => any;
88
88
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "testId" | "isLoading" | "loadingRowCount" | "emptyStateTitle" | "isSticky" | "sections" | "isStickyHeader" | "emptyStateSubtitle" | "isInfiniteScroll" | "infiniteScrollThreshold" | "rowHeight" | "defaultScrollPosition">;
89
89
  $attrs: {
90
90
  [x: string]: unknown;
@@ -97,7 +97,7 @@ declare const TableTypes: () => (import("vue").InjectionKey<import("../common/Ta
97
97
  }>;
98
98
  $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
99
99
  $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
100
- $emit: ((event: "onScroll", event: Event) => void) & ((event: "update:sort", newSort: import("../common/Table.types").Sort) => void) & ((event: "saveRow", args_0: import("../common/Table.types").SaveRowEvent) => void) & ((event: "loadMore") => void);
100
+ $emit: ((event: "onScroll", event: Event) => void) & ((event: "loadMore") => void) & ((event: "update:sort", newSort: import("../common/Table.types").Sort) => void) & ((event: "saveRow", args_0: import("../common/Table.types").SaveRowEvent) => void);
101
101
  $el: any;
102
102
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
103
103
  sort: {
@@ -165,10 +165,10 @@ declare const TableTypes: () => (import("vue").InjectionKey<import("../common/Ta
165
165
  default: any;
166
166
  };
167
167
  }>> & {
168
+ onLoadMore?: () => any;
168
169
  onOnScroll?: (event: Event) => any;
169
170
  "onUpdate:sort"?: (newSort: import("../common/Table.types").Sort) => any;
170
171
  onSaveRow?: (args_0: import("../common/Table.types").SaveRowEvent) => any;
171
- onLoadMore?: () => any;
172
172
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
173
173
  "update:sort": (newSort: import("../common/Table.types").Sort) => void;
174
174
  onScroll: (event: Event) => void;
@@ -273,10 +273,10 @@ declare const TableTypes: () => (import("vue").InjectionKey<import("../common/Ta
273
273
  default: any;
274
274
  };
275
275
  }>> & {
276
+ onLoadMore?: () => any;
276
277
  onOnScroll?: (event: Event) => any;
277
278
  "onUpdate:sort"?: (newSort: import("../common/Table.types").Sort) => any;
278
279
  onSaveRow?: (args_0: import("../common/Table.types").SaveRowEvent) => any;
279
- onLoadMore?: () => any;
280
280
  } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
281
281
  __isFragment?: never;
282
282
  __isTeleport?: never;
@@ -347,10 +347,10 @@ declare const TableTypes: () => (import("vue").InjectionKey<import("../common/Ta
347
347
  default: any;
348
348
  };
349
349
  }>> & {
350
+ onLoadMore?: () => any;
350
351
  onOnScroll?: (event: Event) => any;
351
352
  "onUpdate:sort"?: (newSort: import("../common/Table.types").Sort) => any;
352
353
  onSaveRow?: (args_0: import("../common/Table.types").SaveRowEvent) => any;
353
- onLoadMore?: () => any;
354
354
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
355
355
  "update:sort": (newSort: import("../common/Table.types").Sort) => void;
356
356
  onScroll: (event: Event) => void;