@ryuzaki13/react-foundation-ui 3.4.3 → 3.5.0

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 (168) hide show
  1. package/dist/badge/index.js +65 -2
  2. package/dist/badge/index.js.map +1 -0
  3. package/dist/barcode-scanner/index.js +18 -18
  4. package/dist/base-table/index.js +2 -2
  5. package/dist/button/index.js +1 -1
  6. package/dist/check-box/index.js +1 -1
  7. package/dist/chunks/{CalendarView-Dm55k0bN.js → CalendarView-CwbPJG2Y.js} +86 -86
  8. package/dist/chunks/{CalendarView-Dm55k0bN.js.map → CalendarView-CwbPJG2Y.js.map} +1 -1
  9. package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js → ImageViewerRuntime-DZpgxzF1.js} +25 -25
  10. package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js.map → ImageViewerRuntime-DZpgxzF1.js.map} +1 -1
  11. package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js → TextEditorLexicalClient-BRp8jHId.js} +354 -354
  12. package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js.map → TextEditorLexicalClient-BRp8jHId.js.map} +1 -1
  13. package/dist/chunks/{base-table-BWvKfI2W.js → base-table-BHmboNzl.js} +138 -138
  14. package/dist/chunks/{base-table-BWvKfI2W.js.map → base-table-BHmboNzl.js.map} +1 -1
  15. package/dist/chunks/{button-DF21yxVp.js → button-D7GAU2Wa.js} +20 -20
  16. package/dist/chunks/{button-DF21yxVp.js.map → button-D7GAU2Wa.js.map} +1 -1
  17. package/dist/chunks/{check-box-CZyhzmR0.js → check-box-D_Y6iIWv.js} +19 -19
  18. package/dist/chunks/{check-box-CZyhzmR0.js.map → check-box-D_Y6iIWv.js.map} +1 -1
  19. package/dist/chunks/{context-menu-DgvXGCuI.js → context-menu-BQePxRpu.js} +159 -159
  20. package/dist/chunks/{context-menu-DgvXGCuI.js.map → context-menu-BQePxRpu.js.map} +1 -1
  21. package/dist/chunks/{date-input-D7aBsPJc.js → date-input-Crijdmmq.js} +67 -67
  22. package/dist/chunks/{date-input-D7aBsPJc.js.map → date-input-Crijdmmq.js.map} +1 -1
  23. package/dist/chunks/{date-range-preset-select-BLnY47cv.js → date-range-preset-select-CyzGMvVp.js} +6 -6
  24. package/dist/chunks/{date-range-preset-select-BLnY47cv.js.map → date-range-preset-select-CyzGMvVp.js.map} +1 -1
  25. package/dist/chunks/{dialog-1Z1zCNCe.js → dialog-BcQGVNbu.js} +13 -13
  26. package/dist/chunks/{dialog-1Z1zCNCe.js.map → dialog-BcQGVNbu.js.map} +1 -1
  27. package/dist/chunks/{flex-C7njxZ74.js → flex-DtXK7OM4.js} +29 -29
  28. package/dist/chunks/{flex-C7njxZ74.js.map → flex-DtXK7OM4.js.map} +1 -1
  29. package/dist/chunks/{floating-arrow-DPKwJfww.js → floating-arrow-DKUKx2ZQ.js} +7 -7
  30. package/dist/chunks/{floating-arrow-DPKwJfww.js.map → floating-arrow-DKUKx2ZQ.js.map} +1 -1
  31. package/dist/chunks/{input-DSPKgiCK.js → input-CuRK9Vbz.js} +78 -78
  32. package/dist/chunks/{input-DSPKgiCK.js.map → input-CuRK9Vbz.js.map} +1 -1
  33. package/dist/chunks/{input-files-tIS17-zX.js → input-files-B8j6Pb_M.js} +31 -31
  34. package/dist/chunks/{input-files-tIS17-zX.js.map → input-files-B8j6Pb_M.js.map} +1 -1
  35. package/dist/chunks/{misc-DeGboAt-.js → misc-CGQOXXCy.js} +110 -110
  36. package/dist/chunks/{misc-DeGboAt-.js.map → misc-CGQOXXCy.js.map} +1 -1
  37. package/dist/chunks/{modal-dplfAaER.js → modal-febBsMyR.js} +58 -58
  38. package/dist/chunks/{modal-dplfAaER.js.map → modal-febBsMyR.js.map} +1 -1
  39. package/dist/chunks/{picker-lvm82d0A.js → picker-BA6okKnz.js} +91 -91
  40. package/dist/chunks/{picker-lvm82d0A.js.map → picker-BA6okKnz.js.map} +1 -1
  41. package/dist/chunks/popover-yl5DVe06.js +245 -0
  42. package/dist/chunks/{popover-Bne-Ljbs.js.map → popover-yl5DVe06.js.map} +1 -1
  43. package/dist/chunks/radio-group-CW-K1n9c.js +125 -0
  44. package/dist/chunks/{radio-group-sSnlYjAX.js.map → radio-group-CW-K1n9c.js.map} +1 -1
  45. package/dist/chunks/select-DblNSc5H.js +363 -0
  46. package/dist/chunks/{select-aTGupQan.js.map → select-DblNSc5H.js.map} +1 -1
  47. package/dist/chunks/{separator-B72Aq-6a.js → separator-CIqnk2z9.js} +2 -2
  48. package/dist/chunks/{separator-B72Aq-6a.js.map → separator-CIqnk2z9.js.map} +1 -1
  49. package/dist/chunks/{sortable-BKIwlqhI.js → sortable-CQmMHAF8.js} +38 -38
  50. package/dist/chunks/{sortable-BKIwlqhI.js.map → sortable-CQmMHAF8.js.map} +1 -1
  51. package/dist/chunks/{table-DxoSOvQK.js → table-BnvjPaE1.js} +18 -18
  52. package/dist/chunks/{table-DxoSOvQK.js.map → table-BnvjPaE1.js.map} +1 -1
  53. package/dist/chunks/{table-column-interactions-DzEvVuXe.js → table-column-interactions-Do8LFtiv.js} +20 -20
  54. package/dist/chunks/{table-column-interactions-DzEvVuXe.js.map → table-column-interactions-Do8LFtiv.js.map} +1 -1
  55. package/dist/chunks/{types-D9Wj9wrg.js → types-CxXyru6U.js} +21 -21
  56. package/dist/chunks/{types-D9Wj9wrg.js.map → types-CxXyru6U.js.map} +1 -1
  57. package/dist/chunks/{useODataSelectBase-DR4PrY1j.js → useODataSelectBase-DwR4Lfv-.js} +5 -5
  58. package/dist/chunks/{useODataSelectBase-DR4PrY1j.js.map → useODataSelectBase-DwR4Lfv-.js.map} +1 -1
  59. package/dist/chunks/{wheel-picker-FS58cRsQ.js → wheel-picker-DUHGy7wE.js} +23 -23
  60. package/dist/chunks/{wheel-picker-FS58cRsQ.js.map → wheel-picker-DUHGy7wE.js.map} +1 -1
  61. package/dist/context-menu/index.js +1 -1
  62. package/dist/date-input/index.js +2 -2
  63. package/dist/date-range-preset-select/index.js +1 -1
  64. package/dist/date-time-input/index.js +122 -122
  65. package/dist/date-time-input/index.js.map +1 -1
  66. package/dist/detail/index.js +22 -22
  67. package/dist/dialog/index.js +1 -1
  68. package/dist/disclosure/index.js +9 -9
  69. package/dist/drop-zone/index.js +21 -21
  70. package/dist/errors/index.js +50 -50
  71. package/dist/expandable-action-panel/index.js +24 -24
  72. package/dist/flex/index.js +1 -1
  73. package/dist/flex/useFlexClasses.d.ts +1 -1
  74. package/dist/floating-arrow/index.js +1 -1
  75. package/dist/fullscreen-portal/index.js +8 -8
  76. package/dist/image/index.js +119 -119
  77. package/dist/input/index.js +1 -1
  78. package/dist/input-date-time/index.js +55 -55
  79. package/dist/input-file/index.js +16 -16
  80. package/dist/input-files/index.js +1 -1
  81. package/dist/input-image/index.js +17 -17
  82. package/dist/input-search/index.js +30 -2
  83. package/dist/input-search/index.js.map +1 -0
  84. package/dist/layout-picker/index.js +93 -93
  85. package/dist/layout-picker/index.js.map +1 -1
  86. package/dist/list/index.js +39 -39
  87. package/dist/listbox/index.js +33 -33
  88. package/dist/misc/index.js +1 -1
  89. package/dist/modal/index.js +1 -1
  90. package/dist/multi-select/index.js +466 -2
  91. package/dist/multi-select/index.js.map +1 -0
  92. package/dist/notifications/index.js +45 -45
  93. package/dist/option/index.js +30 -30
  94. package/dist/period-select/index.js +7 -7
  95. package/dist/picker/index.js +1 -1
  96. package/dist/popover/index.js +1 -1
  97. package/dist/preset-range-date-input/index.js +10 -10
  98. package/dist/preset-select/index.js +1 -1
  99. package/dist/radio-button/index.js +9 -9
  100. package/dist/radio-group/index.js +1 -1
  101. package/dist/select/index.js +1 -1
  102. package/dist/separator/index.js +1 -1
  103. package/dist/simple-table/index.js +5 -5
  104. package/dist/slider/index.js +82 -82
  105. package/dist/slider/index.js.map +1 -1
  106. package/dist/sortable/index.js +1 -1
  107. package/dist/splitter/index.js +55 -55
  108. package/dist/state-select/index.js +17 -17
  109. package/dist/styles.css +1 -1
  110. package/dist/switch/index.js +18 -18
  111. package/dist/table/index.js +1 -1
  112. package/dist/table-column-interactions/index.js +1 -1
  113. package/dist/table-editor/index.js +99 -99
  114. package/dist/table-sorting/index.js +13 -13
  115. package/dist/tabs/index.js +83 -83
  116. package/dist/tag-input/index.js +58 -58
  117. package/dist/tag-input/index.js.map +1 -1
  118. package/dist/text/index.js +18 -18
  119. package/dist/text-editor/index.js +3 -3
  120. package/dist/textarea/index.js +1 -1
  121. package/dist/three-scene/index.js +7 -7
  122. package/dist/toggle/index.js +20 -20
  123. package/dist/toolbar/index.js +16 -16
  124. package/dist/tree/index.js +24 -24
  125. package/dist/tree-select/index.js +189 -189
  126. package/dist/tree-select/index.js.map +1 -1
  127. package/dist/tree-table/index.js +33 -33
  128. package/dist/tree-table/index.js.map +1 -1
  129. package/dist/wheel-picker/index.js +1 -1
  130. package/package.json +1 -5
  131. package/storybook-static/project.json +1 -1
  132. package/dist/advanced-search/index.d.ts +0 -3
  133. package/dist/advanced-search/index.d.ts.map +0 -1
  134. package/dist/advanced-search/index.js +0 -399
  135. package/dist/advanced-search/index.js.map +0 -1
  136. package/dist/advanced-search/lib/index.d.ts +0 -2
  137. package/dist/advanced-search/lib/index.d.ts.map +0 -1
  138. package/dist/advanced-search/lib/searchParts.d.ts +0 -3
  139. package/dist/advanced-search/lib/searchParts.d.ts.map +0 -1
  140. package/dist/advanced-search/model/index.d.ts +0 -5
  141. package/dist/advanced-search/model/index.d.ts.map +0 -1
  142. package/dist/advanced-search/model/types.d.ts +0 -55
  143. package/dist/advanced-search/model/types.d.ts.map +0 -1
  144. package/dist/advanced-search/model/useAdvancedSearch.d.ts +0 -11
  145. package/dist/advanced-search/model/useAdvancedSearch.d.ts.map +0 -1
  146. package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts +0 -6
  147. package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts.map +0 -1
  148. package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts +0 -13
  149. package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts.map +0 -1
  150. package/dist/advanced-search/ui/AdvancedSearchModal.d.ts +0 -23
  151. package/dist/advanced-search/ui/AdvancedSearchModal.d.ts.map +0 -1
  152. package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts +0 -16
  153. package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts.map +0 -1
  154. package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts +0 -9
  155. package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts.map +0 -1
  156. package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts +0 -9
  157. package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts.map +0 -1
  158. package/dist/advanced-search/ui/index.d.ts +0 -2
  159. package/dist/advanced-search/ui/index.d.ts.map +0 -1
  160. package/dist/chunks/badge-6mXO9BWP.js +0 -65
  161. package/dist/chunks/badge-6mXO9BWP.js.map +0 -1
  162. package/dist/chunks/input-search-Cat4c7SM.js +0 -30
  163. package/dist/chunks/input-search-Cat4c7SM.js.map +0 -1
  164. package/dist/chunks/multi-select-BZ9N6Dal.js +0 -466
  165. package/dist/chunks/multi-select-BZ9N6Dal.js.map +0 -1
  166. package/dist/chunks/popover-Bne-Ljbs.js +0 -245
  167. package/dist/chunks/radio-group-sSnlYjAX.js +0 -125
  168. package/dist/chunks/select-aTGupQan.js +0 -363
@@ -1,9 +1,9 @@
1
- import { CustomOptionButton as e, Option as t, OptionButton as n } from "../option/index.js";
2
- import { h as r, v as i } from "../chunks/picker-lvm82d0A.js";
3
- import { useEffect as a, useLayoutEffect as o, useMemo as s, useRef as c, useState as l } from "react";
4
- import { findFirstEnabledIndex as u, findLastEnabledIndex as d, findNextEnabledIndex as f, handleKeyboardActivation as p } from "@ryuzaki13/react-foundation-lib/utils";
5
- import { jsx as m } from "react/jsx-runtime";
6
- import { CheckIcon as h } from "lucide-react";
1
+ import { h as e, v as t } from "../chunks/picker-BA6okKnz.js";
2
+ import { CustomOptionButton as n, Option as r, OptionButton as i } from "../option/index.js";
3
+ import { findFirstEnabledIndex as a, findLastEnabledIndex as o, findNextEnabledIndex as s, handleKeyboardActivation as c } from "@ryuzaki13/react-foundation-lib/utils";
4
+ import { CheckIcon as l } from "lucide-react";
5
+ import { jsx as u } from "react/jsx-runtime";
6
+ import { useEffect as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
7
7
  //#region src/listbox/Listbox.tsx
8
8
  var g = (e) => e.disabled === !0;
9
9
  function _(e, t, n) {
@@ -12,16 +12,16 @@ function _(e, t, n) {
12
12
  let n = e.findIndex((e) => t.includes(e.value) && !e.disabled);
13
13
  if (n >= 0) return n;
14
14
  }
15
- return u(e, g);
15
+ return a(e, g);
16
16
  }
17
17
  if (t !== void 0) {
18
18
  let n = e.findIndex((e) => e.value === t && !e.disabled);
19
19
  if (n >= 0) return n;
20
20
  }
21
- return u(e, g);
21
+ return a(e, g);
22
22
  }
23
23
  function v(v) {
24
- let { value: y, defaultValue: b, multiple: x, label: S, description: C, disabled: w, size: T, focusOnMount: E, renderItem: D, getKey: O, options: k, onChange: A, id: j, ...M } = v, N = y !== void 0, [P, F] = l(b), I = c(null), [L, R] = l(() => _(k, y ?? b, x)), z = c(!1), B = s(() => (N ? y : P) ?? (x ? [] : null), [
24
+ let { value: y, defaultValue: b, multiple: x, label: S, description: C, disabled: w, size: T, focusOnMount: E, renderItem: D, getKey: O, options: k, onChange: A, id: j, ...M } = v, N = y !== void 0, [P, F] = h(b), I = m(null), [L, R] = h(() => _(k, y ?? b, x)), z = m(!1), B = p(() => (N ? y : P) ?? (x ? [] : null), [
25
25
  P,
26
26
  N,
27
27
  x,
@@ -37,35 +37,35 @@ function v(v) {
37
37
  }
38
38
  }, U = (e) => {
39
39
  if (!w) {
40
- if (e.key === "ArrowDown") e.preventDefault(), z.current = !0, R((e) => f(k, e, 1, g));
41
- else if (e.key === "ArrowUp") e.preventDefault(), z.current = !0, R((e) => f(k, e, -1, g));
42
- else if (e.key === "Home") e.preventDefault(), z.current = !0, R(u(k, g));
43
- else if (e.key === "End") e.preventDefault(), z.current = !0, R(d(k, g));
44
- else if (p(e, () => {
40
+ if (e.key === "ArrowDown") e.preventDefault(), z.current = !0, R((e) => s(k, e, 1, g));
41
+ else if (e.key === "ArrowUp") e.preventDefault(), z.current = !0, R((e) => s(k, e, -1, g));
42
+ else if (e.key === "Home") e.preventDefault(), z.current = !0, R(a(k, g));
43
+ else if (e.key === "End") e.preventDefault(), z.current = !0, R(o(k, g));
44
+ else if (c(e, () => {
45
45
  let e = k[V];
46
46
  e && H(e);
47
47
  })) return;
48
48
  }
49
49
  };
50
- return a(() => {
50
+ return d(() => {
51
51
  if (!z.current) return;
52
52
  z.current = !1;
53
53
  let e = I.current?.querySelectorAll("[role=\"option\"]")[V];
54
54
  e && e.scrollIntoView({ block: "nearest" });
55
- }, [V]), o(() => {
55
+ }, [V]), f(() => {
56
56
  E && I.current?.focus();
57
- }, [E]), /* @__PURE__ */ m(i, {
57
+ }, [E]), /* @__PURE__ */ u(t, {
58
58
  id: j,
59
59
  label: S,
60
60
  description: C,
61
61
  disabled: w,
62
62
  size: T,
63
- children: ({ controlId: i, labelId: a, describedBy: o }) => /* @__PURE__ */ m(r, {
63
+ children: ({ controlId: t, labelId: a, describedBy: o }) => /* @__PURE__ */ u(e, {
64
64
  rootRef: I,
65
- id: i,
65
+ id: t,
66
66
  role: "listbox",
67
67
  "aria-multiselectable": x || void 0,
68
- "aria-activedescendant": V >= 0 ? `${i}-option-${V}` : void 0,
68
+ "aria-activedescendant": V >= 0 ? `${t}-option-${V}` : void 0,
69
69
  onKeyDown: U,
70
70
  ...M,
71
71
  "aria-labelledby": a ?? M["aria-labelledby"],
@@ -73,31 +73,31 @@ function v(v) {
73
73
  "aria-disabled": w || void 0,
74
74
  tabIndex: w ? -1 : 0,
75
75
  className: M.className,
76
- children: k.map((r, a) => {
77
- let o = x ? Array.isArray(B) && B.includes(r.value) : B === r.value, s = a === V, c = w || r.disabled || void 0, l = (e) => {
78
- e.preventDefault(), !c && (R(a), H(r));
76
+ children: k.map((e, a) => {
77
+ let o = x ? Array.isArray(B) && B.includes(e.value) : B === e.value, s = a === V, c = w || e.disabled || void 0, d = (t) => {
78
+ t.preventDefault(), !c && (R(a), H(e));
79
79
  };
80
- return /* @__PURE__ */ m(t, {
81
- id: `${i}-option-${a}`,
80
+ return /* @__PURE__ */ u(r, {
81
+ id: `${t}-option-${a}`,
82
82
  role: "option",
83
83
  "aria-selected": o,
84
84
  "aria-disabled": c,
85
85
  disabled: c,
86
86
  active: s,
87
87
  selected: o,
88
- children: D ? /* @__PURE__ */ m(e, {
88
+ children: D ? /* @__PURE__ */ u(n, {
89
89
  tabIndex: -1,
90
90
  disabled: c,
91
- onMouseDown: l,
92
- children: D(r, o, s)
93
- }) : /* @__PURE__ */ m(n, {
91
+ onMouseDown: d,
92
+ children: D(e, o, s)
93
+ }) : /* @__PURE__ */ u(i, {
94
94
  tabIndex: -1,
95
95
  disabled: c,
96
- onMouseDown: l,
97
- icon: m(o ? h : "span", {}),
98
- text: r.label ?? String(r.value)
96
+ onMouseDown: d,
97
+ icon: u(o ? l : "span", {}),
98
+ text: e.label ?? String(e.value)
99
99
  })
100
- }, O ? O(r, a) : a);
100
+ }, O ? O(e, a) : a);
101
101
  })
102
102
  })
103
103
  });
@@ -1,2 +1,2 @@
1
- import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, y } from "../chunks/misc-DeGboAt-.js";
1
+ import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, y } from "../chunks/misc-CGQOXXCy.js";
2
2
  export { n as AnimatedLogo, y as AnimatedLogoSegment, v as CopyTextWrapper, d as ErrorIcon, e as IconWrapper, m as InformationIcon, u as LazyDynamicComponent, a as LazyValue, s as LoadingMessage, o as Message, i as NoData, _ as Notice, l as OneStepScroller, c as RenderStateIcon, r as Scrollable, p as SkeletonLine, t as StateIcon, g as StateWrapper, f as SuccessIcon, h as WarningIcon };
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../chunks/modal-dplfAaER.js";
1
+ import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../chunks/modal-febBsMyR.js";
2
2
  export { n as Modal, i as ModalContent, t as ModalFooter, r as ModalManagerContext, o as ModalManagerProvider, e as ModalToolbar, a as useModalManager };
@@ -1,2 +1,466 @@
1
- import { a as e, i as t, n, r, t as i } from "../chunks/multi-select-BZ9N6Dal.js";
2
- export { e as MultiSelect, n as ODataDependentMultiSelect, r as ODataDependentSegmentMultiSelect, t as ODataMultiSelect, i as SerializableMultiSelect };
1
+ import { Text as e } from "../text/index.js";
2
+ import { t } from "../chunks/ui.module-oRwY3Zli.js";
3
+ import { a as n, f as r, i, n as a, r as o, s, t as c, u as l, v as u } from "../chunks/picker-BA6okKnz.js";
4
+ import { t as d } from "../chunks/separator-CIqnk2z9.js";
5
+ import { Option as f, OptionButton as p } from "../option/index.js";
6
+ import { t as m } from "../chunks/check-box-D_Y6iIWv.js";
7
+ import { t as h } from "../chunks/odata-dependent-C_DCbKY2.js";
8
+ import { n as g, t as _ } from "../chunks/useODataSelectBase-DwR4Lfv-.js";
9
+ import { i as v, n as y, t as b } from "../chunks/defaultRenderers-u_Vep6Pj.js";
10
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
11
+ import { forwardRef as ee, useCallback as te, useMemo as w, useRef as ne, useState as re } from "react";
12
+ import { flattenODataDependentServices as ie, useODataCollectionModel as T } from "@ryuzaki13/react-foundation-api/odata";
13
+ var ae = {
14
+ multiSelect: "_9oSdQi",
15
+ optionCheckBox: "d9SDKQ"
16
+ };
17
+ //#endregion
18
+ //#region src/multi-select/ui/MultiSelectOptionSkeleton.tsx
19
+ function E({ text: n, isError: r }) {
20
+ return /* @__PURE__ */ C("div", {
21
+ className: t.uiPopupOption,
22
+ children: [/* @__PURE__ */ S("span", { className: t.uiPopupOptionIcon }), /* @__PURE__ */ S(e, {
23
+ color: r ? "error" : "primary",
24
+ children: n
25
+ })]
26
+ });
27
+ }
28
+ //#endregion
29
+ //#region src/multi-select/ui/MultiSelect.tsx
30
+ function oe({ isNoData: e, error: t, children: n }) {
31
+ return e ? /* @__PURE__ */ S(l, { emptyState: /* @__PURE__ */ S(E, { text: "Нет данных" }) }) : t ? /* @__PURE__ */ S(l, { errorState: /* @__PURE__ */ S(E, {
32
+ isError: !0,
33
+ text: "Ошибка загрузки"
34
+ }) }) : /* @__PURE__ */ S(x, { children: n });
35
+ }
36
+ var se = [];
37
+ function D(e, t) {
38
+ return e[t];
39
+ }
40
+ function ce(e, t, n) {
41
+ return Array.from(/* @__PURE__ */ new Set([
42
+ e[n],
43
+ e[t],
44
+ ...Object.values(e)
45
+ ]));
46
+ }
47
+ function le(e, t, n) {
48
+ if (e.length !== t.length) return !1;
49
+ let r = new Set(t.map((e) => D(e, n)));
50
+ return e.every((e) => r.has(D(e, n)));
51
+ }
52
+ function ue({ entries: e, listId: t, activeIndex: n, selectedKeys: r, codeKey: i, query: a, highlightQuery: o, getOptionDisabled: s, getOptionId: c, setOptionRef: l, toggleOption: u, selectOnlyOption: d, renderItem: h }) {
53
+ return e.map(({ item: e, index: g }) => {
54
+ let _ = g === n, v = D(e, i), y = r.has(v), b = s?.(e) ?? !1, x = h(e, {
55
+ selected: y,
56
+ active: _,
57
+ disabled: b,
58
+ query: a,
59
+ highlightQuery: o
60
+ });
61
+ return /* @__PURE__ */ C(f, {
62
+ id: c(t, g),
63
+ ref: (e) => l(g, e),
64
+ role: "option",
65
+ "aria-selected": y,
66
+ "aria-disabled": b || void 0,
67
+ selected: y,
68
+ active: _,
69
+ disabled: b,
70
+ children: [/* @__PURE__ */ S("div", {
71
+ className: ae.optionCheckBox,
72
+ onMouseDown: (e) => e.stopPropagation(),
73
+ onClick: (e) => e.stopPropagation(),
74
+ children: /* @__PURE__ */ S(m, {
75
+ value: y,
76
+ disabled: b,
77
+ "aria-label": `Выбрать ${o ?? v}`,
78
+ onChange: () => u(e)
79
+ })
80
+ }), /* @__PURE__ */ S(p, {
81
+ tabIndex: -1,
82
+ disabled: b,
83
+ text: x.text,
84
+ code: x.code,
85
+ searchText: o,
86
+ onMouseDown: (e) => e.preventDefault(),
87
+ onClick: () => d(e)
88
+ })]
89
+ }, `${v}-${g}`);
90
+ });
91
+ }
92
+ var O = ee(({ codeKey: e, textKey: t, hideCode: l, items: f, value: p, onChange: m, label: h, description: g, placeholder: _, size: ee, query: ie, defaultQuery: T, highlightQuery: E, onQuery: O, defaultFilter: k = !0, onOpen: A, onClose: j, getOptionDisabled: M, disabled: N, error: P, isLoading: F, renderToken: de, renderToolbar: I, renderItem: fe }, L) => {
93
+ let pe = ne(null), [R, me] = re(!1), z = "search-multi", B = p ?? se, he = w(() => new Set(B.map((t) => D(t, e))), [e, B]), ge = w(() => f.filter((t) => !he.has(D(t, e))), [
94
+ e,
95
+ he,
96
+ f
97
+ ]), V = w(() => v([...B, ...f], e, t), [
98
+ e,
99
+ B,
100
+ f,
101
+ t
102
+ ]), { query: H, setQuery: _e, resetQueryOnClose: ve } = o({
103
+ query: ie,
104
+ defaultQuery: T,
105
+ onQuery: O,
106
+ triggerMode: z
107
+ }), ye = (e) => {
108
+ R && !e && ve && _e(""), me(e);
109
+ }, U = n({
110
+ options: B,
111
+ query: H,
112
+ enabled: k,
113
+ getSearchText: (t) => ce(t, e, V)
114
+ }), W = n({
115
+ options: ge,
116
+ query: H,
117
+ enabled: k,
118
+ getSearchText: (t) => ce(t, e, V)
119
+ }), G = w(() => [...U, ...W], [W, U]), be = U.length > 0 ? 0 : -1, { draftValue: K, setDraftValue: q, prepareOpen: xe } = a({
120
+ value: B,
121
+ open: R,
122
+ onCommit: m,
123
+ onOpen: A,
124
+ onClose: j,
125
+ isEqual: (t, n) => le(t, n, e)
126
+ }), J = w(() => new Set(K.map((t) => D(t, e))), [e, K]), Se = w(() => ({
127
+ selectedItems: K,
128
+ committedSelectedItems: B,
129
+ selectedKeys: J,
130
+ open: R
131
+ }), [
132
+ B,
133
+ K,
134
+ R,
135
+ J
136
+ ]), Y = te((e) => M?.(e, Se) ?? !1, [M, Se]), { activeIndex: X, context: Ce, floatingStyles: we, getFloatingProps: Te, setReference: Ee, setFloating: De, setOptionRef: Oe, close: ke, openList: Ae, toggleOpen: je, selectActiveOption: Me, handleReferenceKeyDown: Ne, handleFloatingKeyDown: Pe, getOptionId: Fe, getActiveOptionId: Ie } = i({
137
+ options: G,
138
+ selectedIndex: be,
139
+ open: R,
140
+ onOpenChange: ye,
141
+ onSelect: void 0,
142
+ disabled: N,
143
+ getOptionDisabled: Y,
144
+ closeOnSelect: !1,
145
+ allowOpenWithoutOptions: !0,
146
+ triggerMode: z
147
+ }), Le = E ?? H, Z = (t) => {
148
+ let n = D(t, e);
149
+ q((r) => r.some((t) => D(t, e) === n) ? r.filter((t) => D(t, e) !== n) : Y(t) ? r : [...r, t]);
150
+ }, Re = (e) => {
151
+ if (pe.current = e, typeof L == "function") {
152
+ L(e);
153
+ return;
154
+ }
155
+ L && (L.current = e);
156
+ }, ze = () => {
157
+ q([]), R || m([]);
158
+ }, Be = () => {
159
+ q((t) => {
160
+ let n = [...t], r = new Set(t.map((t) => D(t, e)));
161
+ for (let t of G) {
162
+ let i = D(t, e);
163
+ !r.has(i) && !Y(t) && (r.add(i), n.push(t));
164
+ }
165
+ return n;
166
+ });
167
+ }, Ve = () => {
168
+ q([]);
169
+ }, He = (e) => {
170
+ Y(e) || (q([e]), ke());
171
+ }, Ue = R ? K : B, We = Ue.length > 0, Ge = {
172
+ selectedItems: Ue,
173
+ committedSelectedItems: B,
174
+ availableItems: W,
175
+ query: H,
176
+ open: R,
177
+ clearSelection: ze,
178
+ selectAll: Be,
179
+ deselectAll: Ve
180
+ }, Ke = de === void 0 ? y({
181
+ codeKey: e,
182
+ textKey: V
183
+ }) : de, qe = fe ?? b({
184
+ codeKey: e,
185
+ textKey: V,
186
+ hideCode: l
187
+ }), Je = typeof Ke == "function" ? Ke(Ge) : null, Ye = typeof I == "function" ? I(Ge) : I, Q = U.map((e, t) => ({
188
+ item: e,
189
+ index: t
190
+ })), Xe = W.map((e, t) => ({
191
+ item: e,
192
+ index: t + Q.length
193
+ })), Ze = !F && !P && G.length === 0, $ = c({
194
+ mode: z,
195
+ open: R,
196
+ currentQuery: H,
197
+ hasDisplayValue: !1,
198
+ inputRef: pe,
199
+ setQuery: _e,
200
+ openList: Ae,
201
+ close: ke,
202
+ toggleOpen: je,
203
+ onBeforeOpen: () => {
204
+ R || xe();
205
+ }
206
+ });
207
+ return /* @__PURE__ */ S(u, {
208
+ label: h,
209
+ description: g,
210
+ disabled: N,
211
+ size: ee,
212
+ className: ae.multiSelect,
213
+ children: ({ controlId: t, labelId: n, describedBy: i }) => {
214
+ let a = `${t}-listbox`;
215
+ return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(s, {
216
+ ref: Re,
217
+ rootRef: Ee,
218
+ id: t,
219
+ type: "text",
220
+ role: "combobox",
221
+ autoComplete: "off",
222
+ isLoading: F,
223
+ disabled: N,
224
+ open: R,
225
+ optionCount: f.length,
226
+ label: h,
227
+ placeholder: _,
228
+ placeholderFallback: "Выберите значения",
229
+ value: H,
230
+ selectedValue: Je,
231
+ hasSelection: We,
232
+ showSelectedValue: We && H.length === 0,
233
+ clearable: !0,
234
+ onClear: ze,
235
+ clearAriaLabel: "Очистить все",
236
+ onToggleMouseDown: $.handleToggleMouseDown,
237
+ onToggleClick: $.handleToggleClick,
238
+ "aria-labelledby": n,
239
+ "aria-describedby": i,
240
+ "aria-haspopup": "listbox",
241
+ "aria-expanded": R,
242
+ "aria-controls": R ? a : void 0,
243
+ "aria-autocomplete": "list",
244
+ "aria-activedescendant": R ? Ie(a) : void 0,
245
+ rootClassName: "flex alignItemsCenter",
246
+ onChange: (e) => {
247
+ $.handleTriggerInputChange(e.target.value);
248
+ },
249
+ onClick: $.handleTriggerClick,
250
+ onFocus: (e) => {
251
+ $.handleTriggerFocus(e.currentTarget);
252
+ },
253
+ onKeyDown: (e) => {
254
+ Ne(e), !e.defaultPrevented && $.handleTriggerKeyDown({
255
+ event: e,
256
+ onActivateWhenOpen: () => {
257
+ if (X >= 0) {
258
+ let e = G[X];
259
+ if (e) {
260
+ Z(e);
261
+ return;
262
+ }
263
+ }
264
+ Me();
265
+ },
266
+ enableClosedArrowDownOpen: !0,
267
+ suppressClosedArrowUp: !0
268
+ });
269
+ }
270
+ }), /* @__PURE__ */ S(r, {
271
+ open: R,
272
+ context: Ce,
273
+ floatingStyles: we,
274
+ listId: a,
275
+ labelId: n,
276
+ descriptionId: i,
277
+ activeOptionId: R ? Ie(a) : void 0,
278
+ setFloating: De,
279
+ getFloatingProps: Te,
280
+ onKeyDown: Pe,
281
+ initialFocus: -1,
282
+ returnFocus: !1,
283
+ tabIndex: -1,
284
+ toolbar: Ye,
285
+ selectionActions: I === void 0 ? {
286
+ onSelectAll: Be,
287
+ onDeselectAll: Ve
288
+ } : void 0,
289
+ children: /* @__PURE__ */ S(oe, {
290
+ isNoData: Ze,
291
+ error: P,
292
+ children: /* @__PURE__ */ C("div", {
293
+ className: "scrollable overscroll h100",
294
+ children: [
295
+ /* @__PURE__ */ S(ue, {
296
+ entries: Q,
297
+ listId: a,
298
+ activeIndex: X,
299
+ selectedKeys: J,
300
+ codeKey: e,
301
+ query: H,
302
+ highlightQuery: Le,
303
+ getOptionDisabled: Y,
304
+ getOptionId: Fe,
305
+ setOptionRef: Oe,
306
+ toggleOption: Z,
307
+ selectOnlyOption: He,
308
+ renderItem: qe
309
+ }),
310
+ Q.length > 0 && ge.length > 0 && /* @__PURE__ */ S(d, { className: "marginBlockSm" }),
311
+ /* @__PURE__ */ S(ue, {
312
+ entries: Xe,
313
+ listId: a,
314
+ activeIndex: X,
315
+ selectedKeys: J,
316
+ codeKey: e,
317
+ query: H,
318
+ highlightQuery: Le,
319
+ getOptionDisabled: Y,
320
+ getOptionId: Fe,
321
+ setOptionRef: Oe,
322
+ toggleOption: Z,
323
+ selectOnlyOption: He,
324
+ renderItem: qe
325
+ })
326
+ ]
327
+ })
328
+ })
329
+ })] });
330
+ }
331
+ });
332
+ });
333
+ O.displayName = "MultiSelect";
334
+ //#endregion
335
+ //#region src/multi-select/model/useODataMultiSelect.ts
336
+ function k({ odata: e, segment: t, model: n, value: r, dependencies: i, onChange: a }) {
337
+ let o = g({
338
+ odata: e,
339
+ segment: t,
340
+ model: n,
341
+ value: r,
342
+ dependencies: i
343
+ }), s = (e) => {
344
+ a(_(e, o.selectionKey));
345
+ };
346
+ return {
347
+ ...o,
348
+ handleChange: s
349
+ };
350
+ }
351
+ //#endregion
352
+ //#region src/multi-select/ui/ODataMultiSelect.tsx
353
+ var A = ({ odata: e, segment: t, model: n, label: r, description: i, disabled: a, value: o, dependencies: s, onChange: c, size: l }) => {
354
+ let u = k({
355
+ odata: e,
356
+ segment: t,
357
+ model: T(n),
358
+ value: o,
359
+ dependencies: s,
360
+ onChange: c
361
+ });
362
+ return /* @__PURE__ */ S(O, {
363
+ label: r,
364
+ description: i,
365
+ size: l,
366
+ codeKey: u.codeKey,
367
+ textKey: u.textKey,
368
+ hideCode: t.hideCode ?? e.hideCode,
369
+ items: u.filteredItems,
370
+ value: u.selectedItems,
371
+ onChange: u.handleChange,
372
+ onQuery: u.setQuery,
373
+ query: u.query,
374
+ defaultFilter: !1,
375
+ highlightQuery: u.debouncedQuery,
376
+ isLoading: u.isLoading,
377
+ disabled: a,
378
+ placeholder: u.placeholder,
379
+ error: u.isError ? "Ошибка загрузки" : void 0
380
+ });
381
+ };
382
+ //#endregion
383
+ //#region src/multi-select/ui/ODataDependentSegmentMultiSelect.tsx
384
+ function j(e) {
385
+ let { item: t, disabled: n, label: r, description: i, size: a, width: o = 15 } = e, s = h(e), { updateSegment: c } = s, l = `calc(${o}em + var(--width-add))`, u = te((e) => {
386
+ c(t.id, e);
387
+ }, [t.id, c]);
388
+ return /* @__PURE__ */ S("div", {
389
+ style: {
390
+ maxWidth: l,
391
+ minWidth: l
392
+ },
393
+ children: /* @__PURE__ */ S(A, {
394
+ odata: t.odata,
395
+ segment: t.segment,
396
+ model: t.model,
397
+ dependencies: s.values,
398
+ value: s.values[t.id],
399
+ onChange: u,
400
+ disabled: n || s.isSegmentDisabled(t.id),
401
+ label: r,
402
+ description: i,
403
+ size: a
404
+ })
405
+ });
406
+ }
407
+ //#endregion
408
+ //#region src/multi-select/ui/ODataDependentMultiSelect.tsx
409
+ function M(e) {
410
+ let { width: t = 15, odata: n, segments: r, model: i, values: a, defaultValues: o, onChange: s, selectionMode: c, segmentOrder: l } = e, u = h({
411
+ values: a,
412
+ defaultValues: o,
413
+ onChange: s
414
+ }), d = c === "sequential" ? {
415
+ selectionMode: "sequential",
416
+ segmentOrder: l
417
+ } : {
418
+ selectionMode: c,
419
+ segmentOrder: l
420
+ };
421
+ return ie([{
422
+ odata: n,
423
+ segments: r,
424
+ model: i
425
+ }]).map((e) => /* @__PURE__ */ S(j, {
426
+ item: e,
427
+ values: u.values,
428
+ onChange: u.updateValues,
429
+ ...d,
430
+ width: t
431
+ }, e.id));
432
+ }
433
+ //#endregion
434
+ //#region src/multi-select/ui/SerializableMultiSelect.tsx
435
+ function N(e, t) {
436
+ return e[t];
437
+ }
438
+ function P(e, t, n) {
439
+ let r = e[t];
440
+ if (typeof r == "string") return r;
441
+ let i = N(e, n);
442
+ return typeof i == "string" ? i : String(i);
443
+ }
444
+ function F({ label: e, description: t, disabled: n, placeholder: r, size: i, options: a, value: o, onChange: s, optionKey: c, optionLabel: l, renderCode: u }) {
445
+ let d = a.map((e) => ({
446
+ key: String(N(e, c)),
447
+ text: P(e, l, c)
448
+ })), f = new Set((o ?? []).map((e) => String(e))), p = d.filter((e) => f.has(e.key));
449
+ return /* @__PURE__ */ S(O, {
450
+ label: e,
451
+ description: t,
452
+ disabled: n,
453
+ placeholder: r,
454
+ size: i,
455
+ items: d,
456
+ codeKey: "key",
457
+ textKey: "text",
458
+ hideCode: !u || void 0,
459
+ value: p,
460
+ onChange: (e) => s(e.map((e) => e.key))
461
+ });
462
+ }
463
+ //#endregion
464
+ export { O as MultiSelect, M as ODataDependentMultiSelect, j as ODataDependentSegmentMultiSelect, A as ODataMultiSelect, F as SerializableMultiSelect };
465
+
466
+ //# sourceMappingURL=index.js.map