@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,5 +1,5 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { Bold as t, Code as n, Heading1 as r, Heading2 as i, Heading3 as a, Heading4 as o, Heading5 as s, Heading6 as c, Highlighter as l, Italic as u, List as d, ListOrdered as f, Pilcrow as p, Strikethrough as m, TextQuote as h, Type as g, Underline as _ } from "lucide-react";
1
+ import { Bold as e, Code as t, Heading1 as n, Heading2 as r, Heading3 as i, Heading4 as a, Heading5 as o, Heading6 as s, Highlighter as c, Italic as l, List as u, ListOrdered as d, Pilcrow as f, Strikethrough as p, TextQuote as m, Type as h, Underline as g } from "lucide-react";
2
+ import { jsx as _ } from "react/jsx-runtime";
3
3
  //#region src/text-editor/editorModel.ts
4
4
  var v = (e) => {
5
5
  if (!e || typeof e != "object") return !1;
@@ -10,109 +10,109 @@ var v = (e) => {
10
10
  label: "Параграф",
11
11
  node: "p",
12
12
  style: "unstyled",
13
- icon: /* @__PURE__ */ e(g, {})
13
+ icon: /* @__PURE__ */ _(h, {})
14
14
  },
15
15
  paragraph: {
16
16
  label: "Параграф",
17
17
  node: "p",
18
18
  style: "paragraph",
19
- icon: /* @__PURE__ */ e(p, {})
19
+ icon: /* @__PURE__ */ _(f, {})
20
20
  },
21
21
  "header-one": {
22
22
  label: "Заголовок первого уровня",
23
23
  node: "h1",
24
24
  style: "header-one",
25
- icon: /* @__PURE__ */ e(r, {})
25
+ icon: /* @__PURE__ */ _(n, {})
26
26
  },
27
27
  "header-two": {
28
28
  label: "Заголовок второго уровня",
29
29
  node: "h2",
30
30
  style: "header-two",
31
- icon: /* @__PURE__ */ e(i, {})
31
+ icon: /* @__PURE__ */ _(r, {})
32
32
  },
33
33
  "header-three": {
34
34
  label: "Заголовок третьего уровня",
35
35
  node: "h3",
36
36
  style: "header-three",
37
- icon: /* @__PURE__ */ e(a, {})
37
+ icon: /* @__PURE__ */ _(i, {})
38
38
  },
39
39
  "header-four": {
40
40
  label: "Заголовок четвертого уровня",
41
41
  node: "h4",
42
42
  style: "header-four",
43
- icon: /* @__PURE__ */ e(o, {})
43
+ icon: /* @__PURE__ */ _(a, {})
44
44
  },
45
45
  "header-five": {
46
46
  label: "Заголовок пятого уровня",
47
47
  node: "h5",
48
48
  style: "header-five",
49
- icon: /* @__PURE__ */ e(s, {})
49
+ icon: /* @__PURE__ */ _(o, {})
50
50
  },
51
51
  "header-six": {
52
52
  label: "Заголовок шестого уровня",
53
53
  node: "h6",
54
54
  style: "header-six",
55
- icon: /* @__PURE__ */ e(c, {})
55
+ icon: /* @__PURE__ */ _(s, {})
56
56
  },
57
57
  "code-block": {
58
58
  label: "Блок кода",
59
59
  node: "pre",
60
60
  style: "code-block",
61
- icon: /* @__PURE__ */ e(n, {})
61
+ icon: /* @__PURE__ */ _(t, {})
62
62
  },
63
63
  blockquote: {
64
64
  label: "Цитата",
65
65
  node: "blockquote",
66
66
  style: "blockquote",
67
- icon: /* @__PURE__ */ e(h, {})
67
+ icon: /* @__PURE__ */ _(m, {})
68
68
  },
69
69
  "unordered-list-item": {
70
70
  label: "Маркированный список",
71
71
  node: "ul",
72
72
  style: "unordered-list-item",
73
- icon: /* @__PURE__ */ e(d, {})
73
+ icon: /* @__PURE__ */ _(u, {})
74
74
  },
75
75
  "ordered-list-item": {
76
76
  label: "Нумерованный список",
77
77
  node: "ol",
78
78
  style: "ordered-list-item",
79
- icon: /* @__PURE__ */ e(f, {})
79
+ icon: /* @__PURE__ */ _(d, {})
80
80
  },
81
81
  CODE: {
82
82
  label: "Моноширинный код",
83
83
  node: "code",
84
84
  style: "CODE",
85
- icon: /* @__PURE__ */ e(n, {})
85
+ icon: /* @__PURE__ */ _(t, {})
86
86
  },
87
87
  BOLD: {
88
88
  label: "Выделение жирным",
89
89
  node: "strong",
90
90
  style: "BOLD",
91
- icon: /* @__PURE__ */ e(t, {})
91
+ icon: /* @__PURE__ */ _(e, {})
92
92
  },
93
93
  UNDERLINE: {
94
94
  label: "Выделение подчеркнутым",
95
95
  node: "u",
96
96
  style: "UNDERLINE",
97
- icon: /* @__PURE__ */ e(_, {})
97
+ icon: /* @__PURE__ */ _(g, {})
98
98
  },
99
99
  STRIKETHROUGH: {
100
100
  label: "Выделение зачеркнутым",
101
101
  node: "s",
102
102
  style: "STRIKETHROUGH",
103
- icon: /* @__PURE__ */ e(m, {})
103
+ icon: /* @__PURE__ */ _(p, {})
104
104
  },
105
105
  HIGHLIGHT: {
106
106
  label: "Подсветка цветом",
107
107
  node: "span",
108
108
  style: "HIGHLIGHT",
109
- icon: /* @__PURE__ */ e(l, {})
109
+ icon: /* @__PURE__ */ _(c, {})
110
110
  },
111
111
  ITALIC: {
112
112
  label: "Выделение курсивным",
113
113
  node: "i",
114
114
  style: "ITALIC",
115
- icon: /* @__PURE__ */ e(u, {})
115
+ icon: /* @__PURE__ */ _(l, {})
116
116
  }
117
117
  }, b = [
118
118
  y.unstyled,
@@ -138,4 +138,4 @@ var v = (e) => {
138
138
  //#endregion
139
139
  export { v as a, x as i, C as n, b as r, S as t };
140
140
 
141
- //# sourceMappingURL=types-D9Wj9wrg.js.map
141
+ //# sourceMappingURL=types-CxXyru6U.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-D9Wj9wrg.js","names":[],"sources":["../../src/text-editor/editorModel.ts","../../src/text-editor/toolbar/types.tsx"],"sourcesContent":["import { ComponentType } from \"react\";\n\nexport type TextEditorLexicalRaw = {\n\tformat: \"lexical\";\n\tversion: 1;\n\teditorState: Record<string, unknown>;\n};\n\nexport type TextEditorData<TRaw = unknown> = {\n\thtml: string;\n\traw: TRaw;\n};\n\nexport interface TextEditorToolbarComponents {\n\tblocks?: boolean;\n\tlinks?: boolean;\n\thistory?: boolean;\n\talignment?: boolean;\n\tinline?: boolean;\n\ttags?: boolean;\n}\n\nexport interface LocalLinkDialogAdapterProps {\n\tisOpen: boolean;\n\tonClose: () => void;\n\tonConfirm: (url: string, ariaLabel: string) => void;\n}\n\nexport interface TextEditorBusinessAdapters {\n\tLocalLinkDialogComponent?: ComponentType<LocalLinkDialogAdapterProps>;\n}\n\nexport interface TextEditorCoreProps<TRaw = unknown> {\n\tinitialData: TextEditorData<TRaw>;\n\tonChange: (data: TextEditorData<TextEditorLexicalRaw>) => void;\n\ttoolbarComponents?: TextEditorToolbarComponents;\n\tbusinessAdapters?: TextEditorBusinessAdapters;\n}\n\nexport const isLexicalTextRaw = (raw: unknown): raw is TextEditorLexicalRaw => {\n\tif (!raw || typeof raw !== \"object\") return false;\n\n\tconst value = raw as Partial<TextEditorLexicalRaw>;\n\treturn value.format === \"lexical\" && value.version === 1 && !!value.editorState && typeof value.editorState === \"object\";\n};\n","import { JSX } from \"react\";\n\nimport {\n\tBold,\n\tCode,\n\tHeading1,\n\tHeading2,\n\tHeading3,\n\tHeading4,\n\tHeading5,\n\tHeading6,\n\tHighlighter,\n\tItalic,\n\tList,\n\tListOrdered,\n\tPilcrow,\n\tStrikethrough,\n\tTextQuote,\n\tType,\n\tUnderline\n} from \"lucide-react\";\n\nimport type { TextEditorElementTypes } from \"../types\";\n\ninterface TextEditorElement {\n\tlabel: string;\n\tstyle: TextEditorElementTypes;\n\tnode: string;\n\ticon: JSX.Element;\n}\n\nconst TextEditorElements: Record<TextEditorElementTypes, TextEditorElement> = {\n\tunstyled: { label: \"Параграф\", node: \"p\", style: \"unstyled\", icon: <Type /> },\n\tparagraph: { label: \"Параграф\", node: \"p\", style: \"paragraph\", icon: <Pilcrow /> },\n\t\"header-one\": { label: \"Заголовок первого уровня\", node: \"h1\", style: \"header-one\", icon: <Heading1 /> },\n\t\"header-two\": { label: \"Заголовок второго уровня\", node: \"h2\", style: \"header-two\", icon: <Heading2 /> },\n\t\"header-three\": { label: \"Заголовок третьего уровня\", node: \"h3\", style: \"header-three\", icon: <Heading3 /> },\n\t\"header-four\": { label: \"Заголовок четвертого уровня\", node: \"h4\", style: \"header-four\", icon: <Heading4 /> },\n\t\"header-five\": { label: \"Заголовок пятого уровня\", node: \"h5\", style: \"header-five\", icon: <Heading5 /> },\n\t\"header-six\": { label: \"Заголовок шестого уровня\", node: \"h6\", style: \"header-six\", icon: <Heading6 /> },\n\t\"code-block\": { label: \"Блок кода\", node: \"pre\", style: \"code-block\", icon: <Code /> },\n\tblockquote: { label: \"Цитата\", node: \"blockquote\", style: \"blockquote\", icon: <TextQuote /> },\n\t\"unordered-list-item\": { label: \"Маркированный список\", node: \"ul\", style: \"unordered-list-item\", icon: <List /> },\n\t\"ordered-list-item\": { label: \"Нумерованный список\", node: \"ol\", style: \"ordered-list-item\", icon: <ListOrdered /> },\n\tCODE: { label: \"Моноширинный код\", node: \"code\", style: \"CODE\", icon: <Code /> },\n\tBOLD: { label: \"Выделение жирным\", node: \"strong\", style: \"BOLD\", icon: <Bold /> },\n\tUNDERLINE: { label: \"Выделение подчеркнутым\", node: \"u\", style: \"UNDERLINE\", icon: <Underline /> },\n\tSTRIKETHROUGH: { label: \"Выделение зачеркнутым\", node: \"s\", style: \"STRIKETHROUGH\", icon: <Strikethrough /> },\n\tHIGHLIGHT: { label: \"Подсветка цветом\", node: \"span\", style: \"HIGHLIGHT\", icon: <Highlighter /> },\n\tITALIC: { label: \"Выделение курсивным\", node: \"i\", style: \"ITALIC\", icon: <Italic /> }\n};\n\nexport const getElementFromElementStyle = (style: TextEditorElementTypes) => {\n\tconst element = TextEditorElements[style];\n\tif (!element) {\n\t\treturn \"div\";\n\t}\n\treturn element.node;\n};\n\nexport const getTagFromElementStyle = (style: TextEditorElementTypes) => {\n\tconst element = TextEditorElements[style];\n\tif (!element) {\n\t\treturn null;\n\t}\n\treturn element.node;\n};\n\nexport const TextEditorBlockControls = [\n\tTextEditorElements.unstyled,\n\tTextEditorElements[\"header-three\"],\n\tTextEditorElements[\"header-four\"],\n\tTextEditorElements[\"header-five\"],\n\tTextEditorElements[\"header-six\"],\n\tTextEditorElements[\"ordered-list-item\"],\n\tTextEditorElements[\"unordered-list-item\"],\n\tTextEditorElements.blockquote\n];\n\nexport const TextEditorInlineControls = [\n\tTextEditorElements.BOLD,\n\tTextEditorElements.ITALIC,\n\tTextEditorElements.UNDERLINE,\n\tTextEditorElements.STRIKETHROUGH,\n\tTextEditorElements.HIGHLIGHT,\n\tTextEditorElements.CODE\n];\n\nexport const TextEditorStyleClasses = {\n\tCODE: {\n\t\tcolor: \"rgb(8, 89, 114)\",\n\t\tpadding: \"0.15em 0.4em\",\n\t\tmargin: \"0\",\n\t\tfontFamily: \"monospace\",\n\t\tfontSize: \"85%\",\n\t\tbackgroundColor: \"rgba(40, 68, 77, 0.05)\",\n\t\tborderRadius: \"var(--radius-md)\",\n\t\tlineHeight: \"1\"\n\t},\n\tHIGHLIGHT: {\n\t\tpaddingInline: \"0.15em\",\n\t\tbackgroundColor: \"rgb(234,255,142)\",\n\t\tborderRadius: \"var(--radius-md)\"\n\t},\n\tunstyled: {\n\t\tmarginBottom: \"1.5em\"\n\t},\n\tBOLD: { fontWeight: \"bold\" },\n\tITALIC: { fontStyle: \"italic\" },\n\tUNDERLINE: { textDecoration: \"underline\" },\n\tSTRIKETHROUGH: { textDecoration: \"line-through\" }\n};\n\nexport enum LinkTypes {\n\tLINK = \"link\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tLOCAL_LINK = \"localLink\",\n\tPHONE = \"phone\",\n\tEMAIL = \"email\"\n}\n\nexport enum TagTypes {\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tabbr = \"abbr\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tlang = \"lang\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\ttime = \"time\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tcite = \"cite\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tins = \"ins\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tdel = \"del\"\n}\n"],"mappings":";;;AAuCA,IAAa,KAAoB,MAA8C;CAC9E,IAAI,CAAC,KAAO,OAAO,KAAQ,UAAU,OAAO;CAE5C,IAAM,IAAQ;CACd,OAAO,EAAM,WAAW,aAAa,EAAM,YAAY,KAAK,CAAC,CAAC,EAAM,eAAe,OAAO,EAAM,eAAgB;AACjH,GCbM,IAAwE;CAC7E,UAAU;EAAE,OAAO;EAAY,MAAM;EAAK,OAAO;EAAY,MAAM,kBAAC,GAAD,CAAO,CAAA;CAAE;CAC5E,WAAW;EAAE,OAAO;EAAY,MAAM;EAAK,OAAO;EAAa,MAAM,kBAAC,GAAD,CAAU,CAAA;CAAE;CACjF,cAAc;EAAE,OAAO;EAA4B,MAAM;EAAM,OAAO;EAAc,MAAM,kBAAC,GAAD,CAAW,CAAA;CAAE;CACvG,cAAc;EAAE,OAAO;EAA4B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EAAQ,OAAO;EAAa,MAAM,kBAAC,GAAD,CAAc,CAAA;CAAE;CAChG,QAAQ;EAAE,OAAO;EAAuB,MAAM;EAAK,OAAO;EAAU,MAAM,kBAAC,GAAD,CAAS,CAAA;CAAE;AACtF,GAkBa,IAA0B;CACtC,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;AACpB,GAEa,IAA2B;CACvC,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;AACpB,GA2BY,IAAL,yBAAA,GAAA;QACN,EAAA,OAAA,QAEA,EAAA,aAAA,aACA,EAAA,QAAA,SACA,EAAA,QAAA;AACD,EAAA,CAAA,CAAA,GAEY,IAAL,yBAAA,GAAA;QAEN,EAAA,OAAA,QAEA,EAAA,OAAA,QAEA,EAAA,OAAA,QAEA,EAAA,OAAA,QAEA,EAAA,MAAA,OAEA,EAAA,MAAA;AACD,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"types-CxXyru6U.js","names":[],"sources":["../../src/text-editor/editorModel.ts","../../src/text-editor/toolbar/types.tsx"],"sourcesContent":["import { ComponentType } from \"react\";\n\nexport type TextEditorLexicalRaw = {\n\tformat: \"lexical\";\n\tversion: 1;\n\teditorState: Record<string, unknown>;\n};\n\nexport type TextEditorData<TRaw = unknown> = {\n\thtml: string;\n\traw: TRaw;\n};\n\nexport interface TextEditorToolbarComponents {\n\tblocks?: boolean;\n\tlinks?: boolean;\n\thistory?: boolean;\n\talignment?: boolean;\n\tinline?: boolean;\n\ttags?: boolean;\n}\n\nexport interface LocalLinkDialogAdapterProps {\n\tisOpen: boolean;\n\tonClose: () => void;\n\tonConfirm: (url: string, ariaLabel: string) => void;\n}\n\nexport interface TextEditorBusinessAdapters {\n\tLocalLinkDialogComponent?: ComponentType<LocalLinkDialogAdapterProps>;\n}\n\nexport interface TextEditorCoreProps<TRaw = unknown> {\n\tinitialData: TextEditorData<TRaw>;\n\tonChange: (data: TextEditorData<TextEditorLexicalRaw>) => void;\n\ttoolbarComponents?: TextEditorToolbarComponents;\n\tbusinessAdapters?: TextEditorBusinessAdapters;\n}\n\nexport const isLexicalTextRaw = (raw: unknown): raw is TextEditorLexicalRaw => {\n\tif (!raw || typeof raw !== \"object\") return false;\n\n\tconst value = raw as Partial<TextEditorLexicalRaw>;\n\treturn value.format === \"lexical\" && value.version === 1 && !!value.editorState && typeof value.editorState === \"object\";\n};\n","import { JSX } from \"react\";\n\nimport {\n\tBold,\n\tCode,\n\tHeading1,\n\tHeading2,\n\tHeading3,\n\tHeading4,\n\tHeading5,\n\tHeading6,\n\tHighlighter,\n\tItalic,\n\tList,\n\tListOrdered,\n\tPilcrow,\n\tStrikethrough,\n\tTextQuote,\n\tType,\n\tUnderline\n} from \"lucide-react\";\n\nimport type { TextEditorElementTypes } from \"../types\";\n\ninterface TextEditorElement {\n\tlabel: string;\n\tstyle: TextEditorElementTypes;\n\tnode: string;\n\ticon: JSX.Element;\n}\n\nconst TextEditorElements: Record<TextEditorElementTypes, TextEditorElement> = {\n\tunstyled: { label: \"Параграф\", node: \"p\", style: \"unstyled\", icon: <Type /> },\n\tparagraph: { label: \"Параграф\", node: \"p\", style: \"paragraph\", icon: <Pilcrow /> },\n\t\"header-one\": { label: \"Заголовок первого уровня\", node: \"h1\", style: \"header-one\", icon: <Heading1 /> },\n\t\"header-two\": { label: \"Заголовок второго уровня\", node: \"h2\", style: \"header-two\", icon: <Heading2 /> },\n\t\"header-three\": { label: \"Заголовок третьего уровня\", node: \"h3\", style: \"header-three\", icon: <Heading3 /> },\n\t\"header-four\": { label: \"Заголовок четвертого уровня\", node: \"h4\", style: \"header-four\", icon: <Heading4 /> },\n\t\"header-five\": { label: \"Заголовок пятого уровня\", node: \"h5\", style: \"header-five\", icon: <Heading5 /> },\n\t\"header-six\": { label: \"Заголовок шестого уровня\", node: \"h6\", style: \"header-six\", icon: <Heading6 /> },\n\t\"code-block\": { label: \"Блок кода\", node: \"pre\", style: \"code-block\", icon: <Code /> },\n\tblockquote: { label: \"Цитата\", node: \"blockquote\", style: \"blockquote\", icon: <TextQuote /> },\n\t\"unordered-list-item\": { label: \"Маркированный список\", node: \"ul\", style: \"unordered-list-item\", icon: <List /> },\n\t\"ordered-list-item\": { label: \"Нумерованный список\", node: \"ol\", style: \"ordered-list-item\", icon: <ListOrdered /> },\n\tCODE: { label: \"Моноширинный код\", node: \"code\", style: \"CODE\", icon: <Code /> },\n\tBOLD: { label: \"Выделение жирным\", node: \"strong\", style: \"BOLD\", icon: <Bold /> },\n\tUNDERLINE: { label: \"Выделение подчеркнутым\", node: \"u\", style: \"UNDERLINE\", icon: <Underline /> },\n\tSTRIKETHROUGH: { label: \"Выделение зачеркнутым\", node: \"s\", style: \"STRIKETHROUGH\", icon: <Strikethrough /> },\n\tHIGHLIGHT: { label: \"Подсветка цветом\", node: \"span\", style: \"HIGHLIGHT\", icon: <Highlighter /> },\n\tITALIC: { label: \"Выделение курсивным\", node: \"i\", style: \"ITALIC\", icon: <Italic /> }\n};\n\nexport const getElementFromElementStyle = (style: TextEditorElementTypes) => {\n\tconst element = TextEditorElements[style];\n\tif (!element) {\n\t\treturn \"div\";\n\t}\n\treturn element.node;\n};\n\nexport const getTagFromElementStyle = (style: TextEditorElementTypes) => {\n\tconst element = TextEditorElements[style];\n\tif (!element) {\n\t\treturn null;\n\t}\n\treturn element.node;\n};\n\nexport const TextEditorBlockControls = [\n\tTextEditorElements.unstyled,\n\tTextEditorElements[\"header-three\"],\n\tTextEditorElements[\"header-four\"],\n\tTextEditorElements[\"header-five\"],\n\tTextEditorElements[\"header-six\"],\n\tTextEditorElements[\"ordered-list-item\"],\n\tTextEditorElements[\"unordered-list-item\"],\n\tTextEditorElements.blockquote\n];\n\nexport const TextEditorInlineControls = [\n\tTextEditorElements.BOLD,\n\tTextEditorElements.ITALIC,\n\tTextEditorElements.UNDERLINE,\n\tTextEditorElements.STRIKETHROUGH,\n\tTextEditorElements.HIGHLIGHT,\n\tTextEditorElements.CODE\n];\n\nexport const TextEditorStyleClasses = {\n\tCODE: {\n\t\tcolor: \"rgb(8, 89, 114)\",\n\t\tpadding: \"0.15em 0.4em\",\n\t\tmargin: \"0\",\n\t\tfontFamily: \"monospace\",\n\t\tfontSize: \"85%\",\n\t\tbackgroundColor: \"rgba(40, 68, 77, 0.05)\",\n\t\tborderRadius: \"var(--radius-md)\",\n\t\tlineHeight: \"1\"\n\t},\n\tHIGHLIGHT: {\n\t\tpaddingInline: \"0.15em\",\n\t\tbackgroundColor: \"rgb(234,255,142)\",\n\t\tborderRadius: \"var(--radius-md)\"\n\t},\n\tunstyled: {\n\t\tmarginBottom: \"1.5em\"\n\t},\n\tBOLD: { fontWeight: \"bold\" },\n\tITALIC: { fontStyle: \"italic\" },\n\tUNDERLINE: { textDecoration: \"underline\" },\n\tSTRIKETHROUGH: { textDecoration: \"line-through\" }\n};\n\nexport enum LinkTypes {\n\tLINK = \"link\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tLOCAL_LINK = \"localLink\",\n\tPHONE = \"phone\",\n\tEMAIL = \"email\"\n}\n\nexport enum TagTypes {\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tabbr = \"abbr\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tlang = \"lang\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\ttime = \"time\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tcite = \"cite\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tins = \"ins\",\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tdel = \"del\"\n}\n"],"mappings":";;;AAuCA,IAAa,KAAoB,MAA8C;CAC9E,IAAI,CAAC,KAAO,OAAO,KAAQ,UAAU,OAAO;CAE5C,IAAM,IAAQ;CACd,OAAO,EAAM,WAAW,aAAa,EAAM,YAAY,KAAK,CAAC,CAAC,EAAM,e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BAAC,GAAD,CAAO,CAAA;CAAE;CAC/E,MAAM;EAAE,OAAO;EAAoB,MAAM;EAAU,OAAO;EAAQ,MAAM,kBAAC,GAAD,CAAO,CAAA;CAAE;CACjF,WAAW;EAAE,OAAO;EAA0B,MAAM;EAAK,OAAO;EAAa,MAAM,kBAAC,GAAD,CAAY,CAAA;CAAE;CACjG,eAAe;EAAE,OAAO;EAAyB,MAAM;EAAK,OAAO;EAAiB,MAAM,kBAAC,GAAD,CAAgB,CAAA;CAAE;CAC5G,WAAW;EAAE,OAAO;EAAoB,MAAM;EAAQ,OAAO;EAAa,MAAM,kBAAC,GAAD,CAAc,CAAA;CAAE;CAChG,QAAQ;EAAE,OAAO;EAAuB,MAAM;EAAK,OAAO;EAAU,MAAM,kBAAC,GAAD,CAAS,CAAA;CAAE;AACtF,GAkBa,IAA0B;CACtC,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;AACpB,GAEa,IAA2B;CACvC,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;CACnB,EAAmB;AACpB,GA2BY,IAAL,yBAAA,GAAA;QACN,EAAA,OAAA,QAEA,EAAA,aAAA,aACA,EAAA,QAAA,SACA,EAAA,QAAA;AACD,EAAA,CAAA,CAAA,GAEY,IAAL,yBAAA,GAAA;QAEN,EAAA,OAAA,QAEA,EAAA,OAAA,QAEA,EAAA,OAAA,QAEA,EAAA,OAAA,QAEA,EAAA,MAAA,OAEA,EAAA,MAAA;AACD,EAAA,CAAA,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { useEffect as e, useMemo as t, useState as n } from "react";
2
- import { useODataCollection as r } from "@ryuzaki13/react-foundation-api/odata";
3
- import { startsWithIgnoringZeros as i } from "@ryuzaki13/react-foundation-lib/formatters";
2
+ import { startsWithIgnoringZeros as r } from "@ryuzaki13/react-foundation-lib/formatters";
3
+ import { useODataCollection as i } from "@ryuzaki13/react-foundation-api/odata";
4
4
  //#region src/select/model/useODataSelectBase.ts
5
5
  var a = "", o = "";
6
6
  function s(e) {
@@ -27,7 +27,7 @@ function l(e) {
27
27
  return t;
28
28
  }
29
29
  function u({ odata: a, segment: o, model: s, value: u, dependencies: d }) {
30
- let [f, p] = n(""), [m, h] = n(""), { codeKey: g, searchDebounceDelay: _, minSearchCodeLength: v, minSearchTextLength: y } = s, { data: b, textKey: x, isLoading: S, isError: C, getItems: w, separatedItems: T, findSourceItemsByKeys: E, setFilteredItems: D, debounce: O } = r({
30
+ let [f, p] = n(""), [m, h] = n(""), { codeKey: g, searchDebounceDelay: _, minSearchCodeLength: v, minSearchTextLength: y } = s, { data: b, textKey: x, isLoading: S, isError: C, getItems: w, separatedItems: T, findSourceItemsByKeys: E, setFilteredItems: D, debounce: O } = i({
31
31
  odata: a,
32
32
  model: s
33
33
  }), k = T.length, A = o.selectText && x ? x : g, j = t(() => b ? c(g, b.keyPairsMap, d) : "", [
@@ -89,7 +89,7 @@ function u({ odata: a, segment: o, model: s, value: u, dependencies: d }) {
89
89
  if (!b) return [];
90
90
  if (!(m.length >= y)) return w(void 0, M);
91
91
  let e = m.length >= y, t = !o.hideCode && m.length >= v && !Number.isNaN(Number(m));
92
- return w((n, r) => !!(n && r && (t && i(n, m) || e && r.toLowerCase().includes(m))), M);
92
+ return w((n, i) => !!(n && i && (t && r(n, m) || e && i.toLowerCase().includes(m))), M);
93
93
  }, [
94
94
  m,
95
95
  w,
@@ -114,4 +114,4 @@ function d(e, t) {
114
114
  //#endregion
115
115
  export { u as n, d as t };
116
116
 
117
- //# sourceMappingURL=useODataSelectBase-DR4PrY1j.js.map
117
+ //# sourceMappingURL=useODataSelectBase-DwR4Lfv-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useODataSelectBase-DR4PrY1j.js","names":[],"sources":["../../src/select/model/useODataSelectBase.ts"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\n\nimport { ODataCollectionModel, ODataSelectBaseProps, useODataCollection } from \"@ryuzaki13/react-foundation-api/odata\";\nimport { startsWithIgnoringZeros } from \"@ryuzaki13/react-foundation-lib/formatters\";\nimport { CollectionItem } from \"@ryuzaki13/react-foundation-lib/odata-service\";\n\ninterface UseODataSelectBaseOptions extends Omit<ODataSelectBaseProps, \"model\" | \"value\"> {\n\tmodel: Required<ODataCollectionModel>;\n\tvalue?: string[];\n}\n\nconst DEPENDENCY_KEY_SEPARATOR = \"\\u0002\";\nconst DEPENDENCY_VALUE_SEPARATOR = \"\\u0001\";\n\nfunction normalizeDependencyValues(values?: readonly string[]) {\n\tif (!values?.length) return [];\n\treturn [...new Set(values)].sort();\n}\n\nfunction createDependencySignature(codeKey: string, availableKeys: Record<string, unknown>, dependencies?: Record<string, string[]>) {\n\tconst parts: string[] = [];\n\n\tfor (const key of Object.keys(availableKeys).sort()) {\n\t\tif (key === codeKey) continue;\n\n\t\tconst values = normalizeDependencyValues(dependencies?.[key]);\n\t\tif (!values.length) continue;\n\n\t\tparts.push(`${key}:${values.join(DEPENDENCY_VALUE_SEPARATOR)}`);\n\t}\n\n\treturn parts.join(DEPENDENCY_KEY_SEPARATOR);\n}\n\nfunction parseDependencySignature(signature: string) {\n\tconst dependencies = new Map<string, string[]>();\n\tif (!signature) return dependencies;\n\n\tfor (const part of signature.split(DEPENDENCY_KEY_SEPARATOR)) {\n\t\tconst separatorIndex = part.indexOf(\":\");\n\t\tif (separatorIndex < 0) continue;\n\n\t\tconst key = part.slice(0, separatorIndex);\n\t\tconst values = part\n\t\t\t.slice(separatorIndex + 1)\n\t\t\t.split(DEPENDENCY_VALUE_SEPARATOR)\n\t\t\t.filter(Boolean);\n\t\tif (key && values.length) {\n\t\t\tdependencies.set(key, values);\n\t\t}\n\t}\n\n\treturn dependencies;\n}\n\nexport function useODataSelectBase({ odata, segment, model, value, dependencies }: UseODataSelectBaseOptions) {\n\tconst [query, setQuery] = useState(\"\");\n\tconst [debouncedQuery, setDebouncedQuery] = useState(\"\");\n\n\tconst { codeKey, searchDebounceDelay, minSearchCodeLength, minSearchTextLength: minSearchLength } = model;\n\n\tconst {\n\t\tdata: rawData,\n\t\ttextKey,\n\t\tisLoading,\n\t\tisError,\n\t\tgetItems,\n\t\tseparatedItems,\n\t\tfindSourceItemsByKeys,\n\t\tsetFilteredItems,\n\t\tdebounce\n\t} = useODataCollection({ odata, model });\n\n\tconst itemsCount = separatedItems.length;\n\tconst selectionKey = segment.selectText && textKey ? textKey : codeKey;\n\n\tconst dependencySignature = useMemo(() => {\n\t\tif (!rawData) return \"\";\n\t\treturn createDependencySignature(codeKey, rawData.keyPairsMap, dependencies);\n\t}, [rawData, codeKey, dependencies]);\n\n\tuseEffect(() => {\n\t\tif (!rawData) return;\n\n\t\tconst selfIndex = rawData.chain.findIndex((c) => c.codeKey === codeKey);\n\t\tconst currentDependencies = parseDependencySignature(dependencySignature);\n\n\t\tconst resolveFilteredItems = (index: number) => {\n\t\t\tconst key = rawData.chain[index].codeKey;\n\t\t\tconst dependenciesValues = currentDependencies.get(key);\n\t\t\tif (dependenciesValues?.length) {\n\t\t\t\treturn findSourceItemsByKeys(key, dependenciesValues);\n\t\t\t}\n\t\t};\n\n\t\tfor (let i = rawData.chain.length - 1; i > selfIndex; i--) {\n\t\t\tconst filteredItems = resolveFilteredItems(i);\n\t\t\tif (filteredItems) {\n\t\t\t\tsetFilteredItems(filteredItems);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < selfIndex; i++) {\n\t\t\tconst filteredItems = resolveFilteredItems(i);\n\t\t\tif (filteredItems) {\n\t\t\t\tsetFilteredItems(filteredItems);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tsetFilteredItems(undefined);\n\t}, [rawData, dependencySignature, codeKey, findSourceItemsByKeys, setFilteredItems]);\n\n\tuseEffect(() => {\n\t\tdebounce(\n\t\t\t\"search\",\n\t\t\t() => {\n\t\t\t\tsetDebouncedQuery(query.trim().toLowerCase());\n\t\t\t},\n\t\t\tsearchDebounceDelay\n\t\t);\n\t}, [debounce, query, searchDebounceDelay]);\n\n\tconst selectedItems = useMemo(() => {\n\t\tif (!value?.length || !selectionKey) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst selectedValues = new Set(value);\n\t\treturn separatedItems.filter((item) => selectedValues.has(item[selectionKey]));\n\t}, [separatedItems, selectionKey, value]);\n\n\tconst filteredItems = useMemo(() => {\n\t\tif (!rawData) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst isFiltered = debouncedQuery.length >= minSearchLength;\n\n\t\tif (!isFiltered) {\n\t\t\treturn getItems(undefined, selectedItems);\n\t\t}\n\n\t\tconst isAheadText = debouncedQuery.length >= minSearchLength;\n\t\tconst isAheadCode = !segment.hideCode && debouncedQuery.length >= minSearchCodeLength && !Number.isNaN(Number(debouncedQuery));\n\n\t\treturn getItems((codeValue: string, textValue: string) => {\n\t\t\tif (codeValue && textValue) {\n\t\t\t\tif (isAheadCode && startsWithIgnoringZeros(codeValue, debouncedQuery)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (isAheadText && textValue.toLowerCase().includes(debouncedQuery)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}, selectedItems);\n\t}, [debouncedQuery, getItems, minSearchCodeLength, minSearchLength, rawData, segment.hideCode, selectedItems]);\n\n\t// const placeholder = useMemo(() => {\n\t// \tconst filteredItemsLength = filteredItems.length;\n\n\t// \tif (!itemsCount) {\n\t// \t\treturn `${segment.placeholder} <пусто>`;\n\t// \t}\n\n\t// \tif (filteredItemsLength < itemsCount) {\n\t// \t\treturn `${segment.placeholder} <${filteredItemsLength}+>`;\n\t// \t}\n\n\t// \treturn `${segment.placeholder} <${itemsCount > model.maxVisibleItems ? `${model.maxVisibleItems}+` : itemsCount}>`;\n\t// }, [filteredItems.length, itemsCount, model.maxVisibleItems, segment.placeholder]);\n\n\treturn {\n\t\tquery,\n\t\tsetQuery,\n\t\tdebouncedQuery,\n\t\tselectedItems,\n\t\tfilteredItems,\n\t\titemsCount,\n\t\tisLoading,\n\t\tisError,\n\t\tcodeKey,\n\t\ttextKey,\n\t\tselectionKey,\n\t\tplaceholder: segment.placeholder\n\t};\n}\n\nexport type ODataSelectBaseModel = ReturnType<typeof useODataSelectBase>;\n\nexport function mapSelectedItemsToValues(items: CollectionItem[], selectionKey: string) {\n\treturn items.map((item) => item[selectionKey]);\n}\n"],"mappings":";;;;AAWA,IAAM,IAA2B,KAC3B,IAA6B;AAEnC,SAAS,EAA0B,GAA4B;CAE9D,OADK,GAAQ,SACN,CAAC,GAAG,IAAI,IAAI,CAAM,CAAC,CAAC,CAAC,KAAK,IADL,CAAC;AAE9B;AAEA,SAAS,EAA0B,GAAiB,GAAwC,GAAyC;CACpI,IAAM,IAAkB,CAAC;CAEzB,KAAK,IAAM,KAAO,OAAO,KAAK,CAAa,CAAC,CAAC,KAAK,GAAG;EACpD,IAAI,MAAQ,GAAS;EAErB,IAAM,IAAS,EAA0B,IAAe,EAAI;EACvD,EAAO,UAEZ,EAAM,KAAK,GAAG,EAAI,GAAG,EAAO,KAAK,CAA0B,GAAG;CAC/D;CAEA,OAAO,EAAM,KAAK,CAAwB;AAC3C;AAEA,SAAS,EAAyB,GAAmB;CACpD,IAAM,oBAAe,IAAI,IAAsB;CAC/C,IAAI,CAAC,GAAW,OAAO;CAEvB,KAAK,IAAM,KAAQ,EAAU,MAAM,CAAwB,GAAG;EAC7D,IAAM,IAAiB,EAAK,QAAQ,GAAG;EACvC,IAAI,IAAiB,GAAG;EAExB,IAAM,IAAM,EAAK,MAAM,GAAG,CAAc,GAClC,IAAS,EACb,MAAM,IAAiB,CAAC,CAAC,CACzB,MAAM,CAA0B,CAAC,CACjC,OAAO,OAAO;EAChB,AAAI,KAAO,EAAO,UACjB,EAAa,IAAI,GAAK,CAAM;CAE9B;CAEA,OAAO;AACR;AAEA,SAAgB,EAAmB,EAAE,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EzC,IAAM,IAAgB,QAAc;EACnC,IAAI,CAAC,GAAO,UAAU,CAAC,GACtB,OAAO,CAAC;EAGT,IAAM,IAAiB,IAAI,IAAI,CAAK;EACpC,OAAO,EAAe,QAAQ,MAAS,EAAe,IAAI,EAAK,EAAa,CAAC;CAC9E,GAAG;EAAC;EAAgB;EAAc;CAAK,CAAC;CA6CxC,OAAO;EACN;EACA;EACA;EACA;EACA,eAhDqB,QAAc;GACnC,IAAI,CAAC,GACJ,OAAO,CAAC;GAKT,IAAI,EAFe,EAAe,UAAU,IAG3C,OAAO,EAAS,KAAA,GAAW,CAAa;GAGzC,IAAM,IAAc,EAAe,UAAU,GACvC,IAAc,CAAC,EAAQ,YAAY,EAAe,UAAU,KAAuB,CAAC,OAAO,MAAM,OAAO,CAAc,CAAC;GAE7H,OAAO,GAAU,GAAmB,MACnC,GAAI,KAAa,MACZ,KAAe,EAAwB,GAAW,CAAc,KAIhE,KAAe,EAAU,YAAY,CAAC,CAAC,SAAS,CAAc,KAMjE,CAAa;EACjB,GAAG;GAAC;GAAgB;GAAU;GAAqB;GAAiB;GAAS,EAAQ;GAAU;EAAa,CAqB3G;EACA;EACA;EACA;EACA;EACA;EACA;EACA,aAAa,EAAQ;CACtB;AACD;AAIA,SAAgB,EAAyB,GAAyB,GAAsB;CACvF,OAAO,EAAM,KAAK,MAAS,EAAK,EAAa;AAC9C"}
1
+ {"version":3,"file":"useODataSelectBase-DwR4Lfv-.js","names":[],"sources":["../../src/select/model/useODataSelectBase.ts"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\n\nimport { ODataCollectionModel, ODataSelectBaseProps, useODataCollection } from \"@ryuzaki13/react-foundation-api/odata\";\nimport { startsWithIgnoringZeros } from \"@ryuzaki13/react-foundation-lib/formatters\";\nimport { CollectionItem } from \"@ryuzaki13/react-foundation-lib/odata-service\";\n\ninterface UseODataSelectBaseOptions extends Omit<ODataSelectBaseProps, \"model\" | \"value\"> {\n\tmodel: Required<ODataCollectionModel>;\n\tvalue?: string[];\n}\n\nconst DEPENDENCY_KEY_SEPARATOR = \"\\u0002\";\nconst DEPENDENCY_VALUE_SEPARATOR = \"\\u0001\";\n\nfunction normalizeDependencyValues(values?: readonly string[]) {\n\tif (!values?.length) return [];\n\treturn [...new Set(values)].sort();\n}\n\nfunction createDependencySignature(codeKey: string, availableKeys: Record<string, unknown>, dependencies?: Record<string, string[]>) {\n\tconst parts: string[] = [];\n\n\tfor (const key of Object.keys(availableKeys).sort()) {\n\t\tif (key === codeKey) continue;\n\n\t\tconst values = normalizeDependencyValues(dependencies?.[key]);\n\t\tif (!values.length) continue;\n\n\t\tparts.push(`${key}:${values.join(DEPENDENCY_VALUE_SEPARATOR)}`);\n\t}\n\n\treturn parts.join(DEPENDENCY_KEY_SEPARATOR);\n}\n\nfunction parseDependencySignature(signature: string) {\n\tconst dependencies = new Map<string, string[]>();\n\tif (!signature) return dependencies;\n\n\tfor (const part of signature.split(DEPENDENCY_KEY_SEPARATOR)) {\n\t\tconst separatorIndex = part.indexOf(\":\");\n\t\tif (separatorIndex < 0) continue;\n\n\t\tconst key = part.slice(0, separatorIndex);\n\t\tconst values = part\n\t\t\t.slice(separatorIndex + 1)\n\t\t\t.split(DEPENDENCY_VALUE_SEPARATOR)\n\t\t\t.filter(Boolean);\n\t\tif (key && values.length) {\n\t\t\tdependencies.set(key, values);\n\t\t}\n\t}\n\n\treturn dependencies;\n}\n\nexport function useODataSelectBase({ odata, segment, model, value, dependencies }: UseODataSelectBaseOptions) {\n\tconst [query, setQuery] = useState(\"\");\n\tconst [debouncedQuery, setDebouncedQuery] = useState(\"\");\n\n\tconst { codeKey, searchDebounceDelay, minSearchCodeLength, minSearchTextLength: minSearchLength } = model;\n\n\tconst {\n\t\tdata: rawData,\n\t\ttextKey,\n\t\tisLoading,\n\t\tisError,\n\t\tgetItems,\n\t\tseparatedItems,\n\t\tfindSourceItemsByKeys,\n\t\tsetFilteredItems,\n\t\tdebounce\n\t} = useODataCollection({ odata, model });\n\n\tconst itemsCount = separatedItems.length;\n\tconst selectionKey = segment.selectText && textKey ? textKey : codeKey;\n\n\tconst dependencySignature = useMemo(() => {\n\t\tif (!rawData) return \"\";\n\t\treturn createDependencySignature(codeKey, rawData.keyPairsMap, dependencies);\n\t}, [rawData, codeKey, dependencies]);\n\n\tuseEffect(() => {\n\t\tif (!rawData) return;\n\n\t\tconst selfIndex = rawData.chain.findIndex((c) => c.codeKey === codeKey);\n\t\tconst currentDependencies = parseDependencySignature(dependencySignature);\n\n\t\tconst resolveFilteredItems = (index: number) => {\n\t\t\tconst key = rawData.chain[index].codeKey;\n\t\t\tconst dependenciesValues = currentDependencies.get(key);\n\t\t\tif (dependenciesValues?.length) {\n\t\t\t\treturn findSourceItemsByKeys(key, dependenciesValues);\n\t\t\t}\n\t\t};\n\n\t\tfor (let i = rawData.chain.length - 1; i > selfIndex; i--) {\n\t\t\tconst filteredItems = resolveFilteredItems(i);\n\t\t\tif (filteredItems) {\n\t\t\t\tsetFilteredItems(filteredItems);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < selfIndex; i++) {\n\t\t\tconst filteredItems = resolveFilteredItems(i);\n\t\t\tif (filteredItems) {\n\t\t\t\tsetFilteredItems(filteredItems);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tsetFilteredItems(undefined);\n\t}, [rawData, dependencySignature, codeKey, findSourceItemsByKeys, setFilteredItems]);\n\n\tuseEffect(() => {\n\t\tdebounce(\n\t\t\t\"search\",\n\t\t\t() => {\n\t\t\t\tsetDebouncedQuery(query.trim().toLowerCase());\n\t\t\t},\n\t\t\tsearchDebounceDelay\n\t\t);\n\t}, [debounce, query, searchDebounceDelay]);\n\n\tconst selectedItems = useMemo(() => {\n\t\tif (!value?.length || !selectionKey) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst selectedValues = new Set(value);\n\t\treturn separatedItems.filter((item) => selectedValues.has(item[selectionKey]));\n\t}, [separatedItems, selectionKey, value]);\n\n\tconst filteredItems = useMemo(() => {\n\t\tif (!rawData) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst isFiltered = debouncedQuery.length >= minSearchLength;\n\n\t\tif (!isFiltered) {\n\t\t\treturn getItems(undefined, selectedItems);\n\t\t}\n\n\t\tconst isAheadText = debouncedQuery.length >= minSearchLength;\n\t\tconst isAheadCode = !segment.hideCode && debouncedQuery.length >= minSearchCodeLength && !Number.isNaN(Number(debouncedQuery));\n\n\t\treturn getItems((codeValue: string, textValue: string) => {\n\t\t\tif (codeValue && textValue) {\n\t\t\t\tif (isAheadCode && startsWithIgnoringZeros(codeValue, debouncedQuery)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (isAheadText && textValue.toLowerCase().includes(debouncedQuery)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}, selectedItems);\n\t}, [debouncedQuery, getItems, minSearchCodeLength, minSearchLength, rawData, segment.hideCode, selectedItems]);\n\n\t// const placeholder = useMemo(() => {\n\t// \tconst filteredItemsLength = filteredItems.length;\n\n\t// \tif (!itemsCount) {\n\t// \t\treturn `${segment.placeholder} <пусто>`;\n\t// \t}\n\n\t// \tif (filteredItemsLength < itemsCount) {\n\t// \t\treturn `${segment.placeholder} <${filteredItemsLength}+>`;\n\t// \t}\n\n\t// \treturn `${segment.placeholder} <${itemsCount > model.maxVisibleItems ? `${model.maxVisibleItems}+` : itemsCount}>`;\n\t// }, [filteredItems.length, itemsCount, model.maxVisibleItems, segment.placeholder]);\n\n\treturn {\n\t\tquery,\n\t\tsetQuery,\n\t\tdebouncedQuery,\n\t\tselectedItems,\n\t\tfilteredItems,\n\t\titemsCount,\n\t\tisLoading,\n\t\tisError,\n\t\tcodeKey,\n\t\ttextKey,\n\t\tselectionKey,\n\t\tplaceholder: segment.placeholder\n\t};\n}\n\nexport type ODataSelectBaseModel = ReturnType<typeof useODataSelectBase>;\n\nexport function mapSelectedItemsTo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ACA;EACA;EACA,eAhDqB,QAAc;GACnC,IAAI,CAAC,GACJ,OAAO,CAAC;GAKT,IAAI,EAFe,EAAe,UAAU,IAG3C,OAAO,EAAS,KAAA,GAAW,CAAa;GAGzC,IAAM,IAAc,EAAe,UAAU,GACvC,IAAc,CAAC,EAAQ,YAAY,EAAe,UAAU,KAAuB,CAAC,OAAO,MAAM,OAAO,CAAc,CAAC;GAE7H,OAAO,GAAU,GAAmB,MACnC,GAAI,KAAa,MACZ,KAAe,EAAwB,GAAW,CAAc,KAIhE,KAAe,EAAU,YAAY,CAAC,CAAC,SAAS,CAAc,KAMjE,CAAa;EACjB,GAAG;GAAC;GAAgB;GAAU;GAAqB;GAAiB;GAAS,EAAQ;GAAU;EAAa,CAqB3G;EACA;EACA;EACA;EACA;EACA;EACA;EACA,aAAa,EAAQ;CACtB;AACD;AAIA,SAAgB,EAAyB,GAAyB,GAAsB;CACvF,OAAO,EAAM,KAAK,MAAS,EAAK,EAAa;AAC9C"}
@@ -1,6 +1,6 @@
1
- import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
- import { cn as a } from "@ryuzaki13/react-foundation-lib/utils";
3
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
1
+ import { cn as e } from "@ryuzaki13/react-foundation-lib/utils";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
4
4
  //#region src/wheel-picker/lib/wheelPickerMath.ts
5
5
  function c(e, t) {
6
6
  return t <= 0 || e < 0 ? 0 : e > t - 1 ? t - 1 : e;
@@ -29,7 +29,7 @@ var m = {
29
29
  selectionFrame: "_--Hsbk"
30
30
  }, h = 192, g = 7, _ = 96;
31
31
  function v({ items: v, value: y, onChange: b, ariaLabel: x, disabled: S, className: C, minHeight: w = h, visibleRows: T = g, formatItem: E, getItemKey: D }) {
32
- let O = r(null), k = r(null), A = r(null), j = n(() => Math.max(0, v.findIndex((e) => Object.is(e, y))), [v, y]), [M, N] = i(0), P = l(M, w), F = u(P, T), I = d(P, F), L = r(j), R = e((e) => Math.round(e.clientHeight), []), z = e(() => {
32
+ let O = o(null), k = o(null), A = o(null), j = a(() => Math.max(0, v.findIndex((e) => Object.is(e, y))), [v, y]), [M, N] = s(0), P = l(M, w), F = u(P, T), I = d(P, F), L = o(j), R = r((e) => Math.round(e.clientHeight), []), z = r(() => {
33
33
  let e = k.current;
34
34
  if (!e || v.length === 0) return;
35
35
  let t = p(e.scrollTop, F, v.length);
@@ -41,12 +41,12 @@ function v({ items: v, value: y, onChange: b, ariaLabel: x, disabled: S, classNa
41
41
  F,
42
42
  v,
43
43
  b
44
- ]), B = e(() => {
44
+ ]), B = r(() => {
45
45
  A.current !== null && window.clearTimeout(A.current), A.current = window.setTimeout(() => {
46
46
  A.current = null, z();
47
47
  }, _);
48
48
  }, [z]);
49
- t(() => {
49
+ i(() => {
50
50
  let e = O.current;
51
51
  if (!e || typeof ResizeObserver > "u") return;
52
52
  let t = (e) => {
@@ -56,7 +56,7 @@ function v({ items: v, value: y, onChange: b, ariaLabel: x, disabled: S, classNa
56
56
  t(i);
57
57
  });
58
58
  return n.observe(e), t(R(e)), () => n.disconnect();
59
- }, [R]), t(() => {
59
+ }, [R]), i(() => {
60
60
  let e = k.current;
61
61
  if (!e || v.length === 0) return;
62
62
  let t = c(j, v.length);
@@ -68,7 +68,7 @@ function v({ items: v, value: y, onChange: b, ariaLabel: x, disabled: S, classNa
68
68
  F,
69
69
  v.length,
70
70
  j
71
- ]), t(() => {
71
+ ]), i(() => {
72
72
  let e = k.current;
73
73
  if (!e) return;
74
74
  let t = () => {
@@ -84,7 +84,7 @@ function v({ items: v, value: y, onChange: b, ariaLabel: x, disabled: S, classNa
84
84
  v,
85
85
  b,
86
86
  B
87
- ]), t(() => () => {
87
+ ]), i(() => () => {
88
88
  A.current !== null && window.clearTimeout(A.current);
89
89
  }, []);
90
90
  let V = (e) => {
@@ -98,13 +98,13 @@ function v({ items: v, value: y, onChange: b, ariaLabel: x, disabled: S, classNa
98
98
  "--wheel-picker-item-height": `${F}px`,
99
99
  "--wheel-picker-edge-padding": `${I}px`
100
100
  };
101
- return /* @__PURE__ */ o("div", {
101
+ return /* @__PURE__ */ t("div", {
102
102
  ref: O,
103
- className: a(m.wheelPicker, C),
103
+ className: e(m.wheelPicker, C),
104
104
  style: H,
105
- children: /* @__PURE__ */ s("div", {
105
+ children: /* @__PURE__ */ n("div", {
106
106
  className: m.viewport,
107
- children: [/* @__PURE__ */ o("div", {
107
+ children: [/* @__PURE__ */ t("div", {
108
108
  ref: k,
109
109
  className: m.scroller,
110
110
  role: "listbox",
@@ -112,25 +112,25 @@ function v({ items: v, value: y, onChange: b, ariaLabel: x, disabled: S, classNa
112
112
  "aria-label": x,
113
113
  "aria-disabled": S || void 0,
114
114
  onKeyDown: V,
115
- children: /* @__PURE__ */ o("div", {
115
+ children: /* @__PURE__ */ t("div", {
116
116
  className: m.items,
117
- children: v.map((e, t) => {
118
- let n = t === j;
119
- return /* @__PURE__ */ o("button", {
117
+ children: v.map((e, n) => {
118
+ let r = n === j;
119
+ return /* @__PURE__ */ t("button", {
120
120
  type: "button",
121
121
  role: "option",
122
- "aria-selected": n,
122
+ "aria-selected": r,
123
123
  className: m.item,
124
- "data-selected": n ? "" : void 0,
124
+ "data-selected": r ? "" : void 0,
125
125
  disabled: S,
126
126
  onClick: () => {
127
- L.current = t, b(e);
127
+ L.current = n, b(e);
128
128
  },
129
129
  children: E?.(e) ?? String(e)
130
- }, D?.(e, t) ?? t);
130
+ }, D?.(e, n) ?? n);
131
131
  })
132
132
  })
133
- }), /* @__PURE__ */ o("div", {
133
+ }), /* @__PURE__ */ t("div", {
134
134
  className: m.selectionFrame,
135
135
  "aria-hidden": "true"
136
136
  })]
@@ -140,4 +140,4 @@ function v({ items: v, value: y, onChange: b, ariaLabel: x, disabled: S, classNa
140
140
  //#endregion
141
141
  export { v as t };
142
142
 
143
- //# sourceMappingURL=wheel-picker-FS58cRsQ.js.map
143
+ //# sourceMappingURL=wheel-picker-DUHGy7wE.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wheel-picker-FS58cRsQ.js","names":[],"sources":["../../src/wheel-picker/lib/wheelPickerMath.ts","../../src/wheel-picker/WheelPicker.module.scss","../../src/wheel-picker/WheelPicker.tsx"],"sourcesContent":["/**\n * Возвращает безопасный индекс внутри диапазона элементов wheel-picker.\n */\nexport function clampWheelIndex(index: number, itemsCount: number): number {\n\tif (itemsCount <= 0) return 0;\n\tif (index < 0) return 0;\n\tif (index > itemsCount - 1) return itemsCount - 1;\n\n\treturn index;\n}\n\n/**\n * Возвращает высоту viewport wheel-picker с учётом минимального значения.\n */\nexport function resolveWheelViewportHeight(measuredHeight: number, minHeight: number): number {\n\tif (!Number.isFinite(measuredHeight) || measuredHeight <= 0) return minHeight;\n\treturn Math.max(measuredHeight, minHeight);\n}\n\n/**\n * Возвращает высоту одной строки picker-а.\n */\nexport function resolveWheelItemHeight(viewportHeight: number, visibleRows: number): number {\n\tconst safeVisibleRows = Math.max(1, visibleRows);\n\treturn Math.max(1, Math.round(viewportHeight / safeVisibleRows));\n}\n\n/**\n * Возвращает отступы сверху и снизу, чтобы выбранное значение всегда было по центру.\n */\nexport function resolveWheelEdgePadding(viewportHeight: number, itemHeight: number): number {\n\treturn Math.max(0, Math.round(viewportHeight / 2 - itemHeight / 2));\n}\n\n/**\n * Возвращает scrollTop, при котором значение с данным индексом окажется в центре viewport.\n */\nexport function resolveWheelScrollTop(index: number, itemHeight: number): number {\n\treturn Math.max(0, Math.round(index * itemHeight));\n}\n\n/**\n * Возвращает ближайший индекс по текущему положению scrollTop.\n */\nexport function resolveClosestWheelIndex(scrollTop: number, itemHeight: number, itemsCount: number): number {\n\tif (itemsCount <= 0 || itemHeight <= 0) return 0;\n\treturn clampWheelIndex(Math.round(scrollTop / itemHeight), itemsCount);\n}\n","@use \"@/styles/mixins\" as *;\n\n.wheelPicker {\n\t--wheel-picker-min-height: 10em;\n\t--wheel-picker-viewport-height: var(--wheel-picker-min-height);\n\t--wheel-picker-item-height: calc(var(--wheel-picker-viewport-height) / 7);\n\t--wheel-picker-edge-padding: calc((var(--wheel-picker-viewport-height) / 2) - (var(--wheel-picker-item-height) / 2));\n\n\tposition: relative;\n\tmin-height: var(--wheel-picker-min-height);\n\theight: 100%;\n\tborder: var(--border);\n\tborder-radius: var(--radius-sm);\n\tbackground: linear-gradient(to bottom, var(--surface-0), transparent 18%, transparent 82%, var(--surface-0)), var(--surface-1);\n\toverflow: hidden;\n}\n\n.viewport {\n\tposition: relative;\n\theight: var(--wheel-picker-viewport-height);\n}\n\n.scroller {\n\theight: 100%;\n\toverflow-y: auto;\n\toverscroll-behavior: contain;\n\tscroll-snap-type: y mandatory;\n\tscrollbar-width: none;\n\tpadding-block: var(--wheel-picker-edge-padding);\n\toutline: none;\n\n\t&::-webkit-scrollbar {\n\t\tdisplay: none;\n\t}\n\n\t&:focus-visible {\n\t\t@include focusVisible;\n\t}\n}\n\n.items {\n\tdisplay: grid;\n}\n\n.item {\n\theight: var(--wheel-picker-item-height);\n\tpadding: 0 var(--space-sm);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tscroll-snap-align: center;\n\tbackground: transparent;\n\tcolor: var(--content-2);\n\tfont-family: var(--font-family-mono);\n\tfont-variant-numeric: tabular-nums;\n\ttransition:\n\t\tcolor var(--transition-fast) ease,\n\t\tbackground-color var(--transition-fast) ease,\n\t\tfont-variation-settings var(--transition-fast) ease;\n\n\t&[data-selected] {\n\t\tcolor: var(--content-0);\n\t\tfont-weight: 600;\n\t\tfont-variation-settings: \"wght\" 600;\n\t}\n\n\t&:hover:not(:disabled) {\n\t\tbackground: color-mix(in srgb, var(--accent-fill) 40%, transparent);\n\t}\n\n\t&:disabled {\n\t\tcursor: default;\n\t}\n}\n\n.selectionFrame {\n\tposition: absolute;\n\ttop: 50%;\n\tleft: 0;\n\tright: 0;\n\theight: var(--wheel-picker-item-height);\n\ttransform: translateY(-50%);\n\tborder-top: var(--border);\n\tborder-bottom: var(--border);\n\t// border-radius: var(--radius-xs);\n\tbackground: color-mix(in srgb, var(--accent-fill) 28%, transparent);\n\tpointer-events: none;\n}\n","import type { CSSProperties, Key, KeyboardEvent, ReactNode } from \"react\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport {\n\tclampWheelIndex,\n\tresolveClosestWheelIndex,\n\tresolveWheelEdgePadding,\n\tresolveWheelItemHeight,\n\tresolveWheelScrollTop,\n\tresolveWheelViewportHeight\n} from \"./lib/wheelPickerMath\";\nimport styles from \"./WheelPicker.module.scss\";\n\n/**\n * Пропсы внутреннего wheel-picker.\n */\nexport interface WheelPickerProps<T> {\n\titems: readonly T[];\n\tvalue: T;\n\tonChange: (value: T) => void;\n\tariaLabel: string;\n\tdisabled?: boolean;\n\tclassName?: string;\n\tminHeight?: number;\n\tvisibleRows?: number;\n\tformatItem?: (item: T) => ReactNode;\n\tgetItemKey?: (item: T, index: number) => Key;\n}\n\nconst DEFAULT_MIN_HEIGHT = 192;\nconst DEFAULT_VISIBLE_ROWS = 7;\nconst SNAP_TIMEOUT_MS = 96;\n\n/**\n * Внутренний wheel-picker со snap-кареткой по центру и блокировкой page scroll.\n */\nexport function WheelPicker<T>({\n\titems,\n\tvalue,\n\tonChange,\n\tariaLabel,\n\tdisabled,\n\tclassName,\n\tminHeight = DEFAULT_MIN_HEIGHT,\n\tvisibleRows = DEFAULT_VISIBLE_ROWS,\n\tformatItem,\n\tgetItemKey\n}: WheelPickerProps<T>) {\n\tconst rootRef = useRef<HTMLDivElement | null>(null);\n\tconst scrollerRef = useRef<HTMLDivElement | null>(null);\n\tconst snapTimeoutRef = useRef<number | null>(null);\n\tconst valueIndex = useMemo(\n\t\t() =>\n\t\t\tMath.max(\n\t\t\t\t0,\n\t\t\t\titems.findIndex((item) => Object.is(item, value))\n\t\t\t),\n\t\t[items, value]\n\t);\n\tconst [measuredHeight, setMeasuredHeight] = useState(0);\n\tconst viewportHeight = resolveWheelViewportHeight(measuredHeight, minHeight);\n\tconst itemHeight = resolveWheelItemHeight(viewportHeight, visibleRows);\n\tconst edgePadding = resolveWheelEdgePadding(viewportHeight, itemHeight);\n\tconst lastAppliedIndexRef = useRef(valueIndex);\n\n\t/**\n\t * Возвращает высоту контентной области wheel без рамок, чтобы избежать накопления высоты.\n\t */\n\tconst readContentHeight = useCallback((element: HTMLDivElement) => Math.round(element.clientHeight), []);\n\n\t/**\n\t * Доводит scroll до ближайшего центра и синхронизирует выбранное значение.\n\t */\n\tconst snapToClosestValue = useCallback(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller || items.length === 0) return;\n\n\t\tconst nextIndex = resolveClosestWheelIndex(scroller.scrollTop, itemHeight, items.length);\n\t\tscroller.scrollTo({\n\t\t\ttop: resolveWheelScrollTop(nextIndex, itemHeight),\n\t\t\tbehavior: \"smooth\"\n\t\t});\n\n\t\tif (nextIndex !== lastAppliedIndexRef.current) {\n\t\t\tlastAppliedIndexRef.current = nextIndex;\n\t\t\tonChange(items[nextIndex]);\n\t\t}\n\t}, [itemHeight, items, onChange]);\n\n\t/**\n\t * Планирует мягкую доводку wheel после завершения scroll/wheel.\n\t */\n\tconst scheduleSnap = useCallback(() => {\n\t\tif (snapTimeoutRef.current !== null) {\n\t\t\twindow.clearTimeout(snapTimeoutRef.current);\n\t\t}\n\n\t\tsnapTimeoutRef.current = window.setTimeout(() => {\n\t\t\tsnapTimeoutRef.current = null;\n\t\t\tsnapToClosestValue();\n\t\t}, SNAP_TIMEOUT_MS);\n\t}, [snapToClosestValue]);\n\n\tuseEffect(() => {\n\t\tconst root = rootRef.current;\n\t\tif (!root || typeof ResizeObserver === \"undefined\") return;\n\n\t\tconst syncMeasuredHeight = (nextHeight: number) => {\n\t\t\tsetMeasuredHeight((prevHeight) => (prevHeight === nextHeight ? prevHeight : nextHeight));\n\t\t};\n\n\t\tconst observer = new ResizeObserver((entries) => {\n\t\t\tconst entry = entries[0];\n\t\t\tconst nextHeight = Math.round(entry?.contentRect.height ?? readContentHeight(root));\n\n\t\t\tsyncMeasuredHeight(nextHeight);\n\t\t});\n\n\t\tobserver.observe(root);\n\t\tsyncMeasuredHeight(readContentHeight(root));\n\n\t\treturn () => observer.disconnect();\n\t}, [readContentHeight]);\n\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller || items.length === 0) return;\n\n\t\tconst targetIndex = clampWheelIndex(valueIndex, items.length);\n\t\tlastAppliedIndexRef.current = targetIndex;\n\t\tscroller.scrollTo({\n\t\t\ttop: resolveWheelScrollTop(targetIndex, itemHeight),\n\t\t\tbehavior: \"auto\"\n\t\t});\n\t}, [itemHeight, items.length, valueIndex]);\n\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) return;\n\n\t\tconst handleScroll = () => {\n\t\t\tif (disabled) return;\n\t\t\tscheduleSnap();\n\t\t};\n\n\t\tconst handleWheel = (event: WheelEvent) => {\n\t\t\tif (disabled) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tscroller.scrollTop += event.deltaY;\n\t\t\tscheduleSnap();\n\t\t};\n\n\t\tscroller.addEventListener(\"scroll\", handleScroll, { passive: true });\n\t\tscroller.addEventListener(\"wheel\", handleWheel, { passive: false });\n\n\t\treturn () => {\n\t\t\tscroller.removeEventListener(\"scroll\", handleScroll);\n\t\t\tscroller.removeEventListener(\"wheel\", handleWheel);\n\t\t};\n\t}, [disabled, items, onChange, scheduleSnap]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (snapTimeoutRef.current !== null) {\n\t\t\t\twindow.clearTimeout(snapTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t/**\n\t * Меняет значение по стрелкам вверх и вниз.\n\t */\n\tconst handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n\t\tif (disabled || items.length === 0) return;\n\n\t\tif (event.key !== \"ArrowUp\" && event.key !== \"ArrowDown\") return;\n\t\tevent.preventDefault();\n\n\t\tconst delta = event.key === \"ArrowUp\" ? -1 : 1;\n\t\tconst nextIndex = clampWheelIndex(valueIndex + delta, items.length);\n\t\tif (nextIndex === valueIndex) return;\n\n\t\tlastAppliedIndexRef.current = nextIndex;\n\t\tonChange(items[nextIndex]);\n\t};\n\n\tconst cssVars = {\n\t\t\"--wheel-picker-min-height\": `${minHeight}px`,\n\t\t\"--wheel-picker-viewport-height\": `${viewportHeight}px`,\n\t\t\"--wheel-picker-item-height\": `${itemHeight}px`,\n\t\t\"--wheel-picker-edge-padding\": `${edgePadding}px`\n\t} as CSSProperties;\n\n\treturn (\n\t\t<div ref={rootRef} className={cn(styles.wheelPicker, className)} style={cssVars}>\n\t\t\t<div className={styles.viewport}>\n\t\t\t\t<div\n\t\t\t\t\tref={scrollerRef}\n\t\t\t\t\tclassName={styles.scroller}\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\ttabIndex={disabled ? -1 : 0}\n\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\taria-disabled={disabled || undefined}\n\t\t\t\t\tonKeyDown={handleKeyDown}>\n\t\t\t\t\t<div className={styles.items}>\n\t\t\t\t\t\t{items.map((item, index) => {\n\t\t\t\t\t\t\tconst selected = index === valueIndex;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\tkey={getItemKey?.(item, index) ?? index}\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\taria-selected={selected}\n\t\t\t\t\t\t\t\t\tclassName={styles.item}\n\t\t\t\t\t\t\t\t\tdata-selected={selected ? \"\" : undefined}\n\t\t\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tlastAppliedIndexRef.current = index;\n\t\t\t\t\t\t\t\t\t\tonChange(item);\n\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t{formatItem?.(item) ?? String(item)}\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div className={styles.selectionFrame} aria-hidden=\"true\" />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;AAGA,SAAgB,EAAgB,GAAe,GAA4B;CAK1E,OAJI,KAAc,KACd,IAAQ,IAAU,IAClB,IAAQ,IAAa,IAAU,IAAa,IAEzC;AACR;AAKA,SAAgB,EAA2B,GAAwB,GAA2B;CAE7F,OADI,CAAC,OAAO,SAAS,CAAc,KAAK,KAAkB,IAAU,IAC7D,KAAK,IAAI,GAAgB,CAAS;AAC1C;AAKA,SAAgB,EAAuB,GAAwB,GAA6B;CAE3F,OAAO,KAAK,IAAI,GAAG,KAAK,MAAM,IADN,KAAK,IAAI,GAAG,CACW,CAAe,CAAC;AAChE;AAKA,SAAgB,EAAwB,GAAwB,GAA4B;CAC3F,OAAO,KAAK,IAAI,GAAG,KAAK,MAAM,IAAiB,IAAI,IAAa,CAAC,CAAC;AACnE;AAKA,SAAgB,EAAsB,GAAe,GAA4B;CAChF,OAAO,KAAK,IAAI,GAAG,KAAK,MAAM,IAAQ,CAAU,CAAC;AAClD;AAKA,SAAgB,EAAyB,GAAmB,GAAoB,GAA4B;CAE3G,OADI,KAAc,KAAK,KAAc,IAAU,IACxC,EAAgB,KAAK,MAAM,IAAY,CAAU,GAAG,CAAU;AACtE;;;;;;;;GEhBM,IAAqB,KACrB,IAAuB,GACvB,IAAkB;AAKxB,SAAgB,EAAe,EAC9B,UACA,UACA,aACA,cACA,aACA,cACA,eAAY,GACZ,iBAAc,GACd,eACA,iBACuB;CACvB,IAAM,IAAU,EAA8B,IAAI,GAC5C,IAAc,EAA8B,IAAI,GAChD,IAAiB,EAAsB,IA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e;EACpD,8BAA8B,GAAG,EAAW;EAC5C,+BAA+B,GAAG,EAAY;CAC/C;CAEA,OACC,kBAAC,OAAD;EAAK,KAAK;EAAS,WAAW,EAAG,EAAO,aAAa,CAAS;EAAG,OAAO;EACvE,UAAA,kBAAC,OAAD;GAAK,WAAW,EAAO;GAAvB,UAAA,CACC,kBAAC,OAAD;IACC,KAAK;IACL,WAAW,EAAO;IAClB,MAAK;IACL,UAAU,IAAW,KAAK;IAC1B,cAAY;IACZ,iBAAe,KAAY,KAAA;IAC3B,WAAW;IACX,UAAA,kBAAC,OAAD;KAAK,WAAW,EAAO;KACrB,UAAA,EAAM,KAAK,GAAM,MAAU;MAC3B,IAAM,IAAW,MAAU;MAE3B,OACC,kBAAC,UAAD;OAEC,MAAK;OACL,MAAK;OACL,iBAAe;OACf,WAAW,EAAO;OAClB,iBAAe,IAAW,KAAK,KAAA;OACrB;OACV,eAAe;QAEd,AADA,EAAoB,UAAU,GAC9B,EAAS,CAAI;OACd;OACC,UAAA,IAAa,CAAI,KAAK,OAAO,CAAI;MAC3B,GAZF,IAAa,GAAM,CAAK,KAAK,CAY3B;KAEV,CAAC;IACG,CAAA;GACD,CAAA,GAEL,kBAAC,OAAD;IAAK,WAAW,EAAO;IAAgB,eAAY;GAAQ,CAAA,CACvD;;CACD,CAAA;AAEP"}
1
+ {"version":3,"file":"wheel-picker-DUHGy7wE.js","names":[],"sources":["../../src/wheel-picker/lib/wheelPickerMath.ts","../../src/wheel-picker/WheelPicker.module.scss","../../src/wheel-picker/WheelPicker.tsx"],"sourcesContent":["/**\n * Возвращает безопасный индекс внутри диапазона элементов wheel-picker.\n */\nexport function clampWheelIndex(index: number, itemsCount: number): number {\n\tif (itemsCount <= 0) return 0;\n\tif (index < 0) return 0;\n\tif (index > itemsCount - 1) return itemsCount - 1;\n\n\treturn index;\n}\n\n/**\n * Возвращает высоту viewport wheel-picker с учётом минимального значения.\n */\nexport function resolveWheelViewportHeight(measuredHeight: number, minHeight: number): number {\n\tif (!Number.isFinite(measuredHeight) || measuredHeight <= 0) return minHeight;\n\treturn Math.max(measuredHeight, minHeight);\n}\n\n/**\n * Возвращает высоту одной строки picker-а.\n */\nexport function resolveWheelItemHeight(viewportHeight: number, visibleRows: number): number {\n\tconst safeVisibleRows = Math.max(1, visibleRows);\n\treturn Math.max(1, Math.round(viewportHeight / safeVisibleRows));\n}\n\n/**\n * Возвращает отступы сверху и снизу, чтобы выбранное значение всегда было по центру.\n */\nexport function resolveWheelEdgePadding(viewportHeight: number, itemHeight: number): number {\n\treturn Math.max(0, Math.round(viewportHeight / 2 - itemHeight / 2));\n}\n\n/**\n * Возвращает scrollTop, при котором значение с данным индексом окажется в центре viewport.\n */\nexport function resolveWheelScrollTop(index: number, itemHeight: number): number {\n\treturn Math.max(0, Math.round(index * itemHeight));\n}\n\n/**\n * Возвращает ближайший индекс по текущему положению scrollTop.\n */\nexport function resolveClosestWheelIndex(scrollTop: number, itemHeight: number, itemsCount: number): number {\n\tif (itemsCount <= 0 || itemHeight <= 0) return 0;\n\treturn clampWheelIndex(Math.round(scrollTop / itemHeight), itemsCount);\n}\n","@use \"@/styles/mixins\" as *;\n\n.wheelPicker {\n\t--wheel-picker-min-height: 10em;\n\t--wheel-picker-viewport-height: var(--wheel-picker-min-height);\n\t--wheel-picker-item-height: calc(var(--wheel-picker-viewport-height) / 7);\n\t--wheel-picker-edge-padding: calc((var(--wheel-picker-viewport-height) / 2) - (var(--wheel-picker-item-height) / 2));\n\n\tposition: relative;\n\tmin-height: var(--wheel-picker-min-height);\n\theight: 100%;\n\tborder: var(--border);\n\tborder-radius: var(--radius-sm);\n\tbackground: linear-gradient(to bottom, var(--surface-0), transparent 18%, transparent 82%, var(--surface-0)), var(--surface-1);\n\toverflow: hidden;\n}\n\n.viewport {\n\tposition: relative;\n\theight: var(--wheel-picker-viewport-height);\n}\n\n.scroller {\n\theight: 100%;\n\toverflow-y: auto;\n\toverscroll-behavior: contain;\n\tscroll-snap-type: y mandatory;\n\tscrollbar-width: none;\n\tpadding-block: var(--wheel-picker-edge-padding);\n\toutline: none;\n\n\t&::-webkit-scrollbar {\n\t\tdisplay: none;\n\t}\n\n\t&:focus-visible {\n\t\t@include focusVisible;\n\t}\n}\n\n.items {\n\tdisplay: grid;\n}\n\n.item {\n\theight: var(--wheel-picker-item-height);\n\tpadding: 0 var(--space-sm);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tscroll-snap-align: center;\n\tbackground: transparent;\n\tcolor: var(--content-2);\n\tfont-family: var(--font-family-mono);\n\tfont-variant-numeric: tabular-nums;\n\ttransition:\n\t\tcolor var(--transition-fast) ease,\n\t\tbackground-color var(--transition-fast) ease,\n\t\tfont-variation-settings var(--transition-fast) ease;\n\n\t&[data-selected] {\n\t\tcolor: var(--content-0);\n\t\tfont-weight: 600;\n\t\tfont-variation-settings: \"wght\" 600;\n\t}\n\n\t&:hover:not(:disabled) {\n\t\tbackground: color-mix(in srgb, var(--accent-fill) 40%, transparent);\n\t}\n\n\t&:disabled {\n\t\tcursor: default;\n\t}\n}\n\n.selectionFrame {\n\tposition: absolute;\n\ttop: 50%;\n\tleft: 0;\n\tright: 0;\n\theight: var(--wheel-picker-item-height);\n\ttransform: translateY(-50%);\n\tborder-top: var(--border);\n\tborder-bottom: var(--border);\n\t// border-radius: var(--radius-xs);\n\tbackground: color-mix(in srgb, var(--accent-fill) 28%, transparent);\n\tpointer-events: none;\n}\n","import type { CSSProperties, Key, KeyboardEvent, ReactNode } from \"react\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport {\n\tclampWheelIndex,\n\tresolveClosestWheelIndex,\n\tresolveWheelEdgePadding,\n\tresolveWheelItemHeight,\n\tresolveWheelScrollTop,\n\tresolveWheelViewportHeight\n} from \"./lib/wheelPickerMath\";\nimport styles from \"./WheelPicker.module.scss\";\n\n/**\n * Пропсы внутреннего wheel-picker.\n */\nexport interface WheelPickerProps<T> {\n\titems: readonly T[];\n\tvalue: T;\n\tonChange: (value: T) => void;\n\tariaLabel: string;\n\tdisabled?: boolean;\n\tclassName?: string;\n\tminHeight?: number;\n\tvisibleRows?: number;\n\tformatItem?: (item: T) => ReactNode;\n\tgetItemKey?: (item: T, index: number) => Key;\n}\n\nconst DEFAULT_MIN_HEIGHT = 192;\nconst DEFAULT_VISIBLE_ROWS = 7;\nconst SNAP_TIMEOUT_MS = 96;\n\n/**\n * Внутренний wheel-picker со snap-кареткой по центру и блокировкой page scroll.\n */\nexport function WheelPicker<T>({\n\titems,\n\tvalue,\n\tonChange,\n\tariaLabel,\n\tdisabled,\n\tclassName,\n\tminHeight = DEFAULT_MIN_HEIGHT,\n\tvisibleRows = DEFAULT_VISIBLE_ROWS,\n\tformatItem,\n\tgetItemKey\n}: WheelPickerProps<T>) {\n\tconst rootRef = useRef<HTMLDivElement | null>(null);\n\tconst scrollerRef = useRef<HTMLDivElement | null>(null);\n\tconst snapTimeoutRef = useRef<number | null>(null);\n\tconst valueIndex = useMemo(\n\t\t() =>\n\t\t\tMath.max(\n\t\t\t\t0,\n\t\t\t\titems.findIndex((item) => Object.is(item, value))\n\t\t\t),\n\t\t[items, value]\n\t);\n\tconst [measuredHeight, setMeasuredHeight] = useState(0);\n\tconst viewportHeight = resolveWheelViewportHeight(measuredHeight, minHeight);\n\tconst itemHeight = resolveWheelItemHeight(viewportHeight, visibleRows);\n\tconst edgePadding = resolveWheelEdgePadding(viewportHeight, itemHeight);\n\tconst lastAppliedIndexRef = useRef(valueIndex);\n\n\t/**\n\t * Возвращает высоту контентной области wheel без рамок, чтобы избежать накопления высоты.\n\t */\n\tconst readContentHeight = useCallback((element: HTMLDivElement) => Math.round(element.clientHeight), []);\n\n\t/**\n\t * Доводит scroll до ближайшего центра и синхронизирует выбранное значение.\n\t */\n\tconst snapToClosestValue = useCallback(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller || items.length === 0) return;\n\n\t\tconst nextIndex = resolveClosestWheelIndex(scroller.scrollTop, itemHeight, items.length);\n\t\tscroller.scrollTo({\n\t\t\ttop: resolveWheelScrollTop(nextIndex, itemHeight),\n\t\t\tbehavior: \"smooth\"\n\t\t});\n\n\t\tif (nextIndex !== lastAppliedIndexRef.current) {\n\t\t\tlastAppliedIndexRef.current = nextIndex;\n\t\t\tonChange(items[nextIndex]);\n\t\t}\n\t}, [itemHeight, items, onChange]);\n\n\t/**\n\t * Планирует мягкую доводку wheel после завершения scroll/wheel.\n\t */\n\tconst scheduleSnap = useCallback(() => {\n\t\tif (snapTimeoutRef.current !== null) {\n\t\t\twindow.clearTimeout(snapTimeoutRef.current);\n\t\t}\n\n\t\tsnapTimeoutRef.current = window.setTimeout(() => {\n\t\t\tsnapTimeoutRef.current = null;\n\t\t\tsnapToClosestValue();\n\t\t}, SNAP_TIMEOUT_MS);\n\t}, [snapToClosestValue]);\n\n\tuseEffect(() => {\n\t\tconst root = rootRef.current;\n\t\tif (!root || typeof ResizeObserver === \"undefined\") return;\n\n\t\tconst syncMeasuredHeight = (nextHeight: number) => {\n\t\t\tsetMeasuredHeight((prevHeight) => (prevHeight === nextHeight ? prevHeight : nextHeight));\n\t\t};\n\n\t\tconst observer = new ResizeObserver((entries) => {\n\t\t\tconst entry = entries[0];\n\t\t\tconst nextHeight = Math.round(entry?.contentRect.height ?? readContentHeight(root));\n\n\t\t\tsyncMeasuredHeight(nextHeight);\n\t\t});\n\n\t\tobserver.observe(root);\n\t\tsyncMeasuredHeight(readContentHeight(root));\n\n\t\treturn () => observer.disconnect();\n\t}, [readContentHeight]);\n\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller || items.length === 0) return;\n\n\t\tconst targetIndex = clampWheelIndex(valueIndex, items.length);\n\t\tlastAppliedIndexRef.current = targetIndex;\n\t\tscroller.scrollTo({\n\t\t\ttop: resolveWheelScrollTop(targetIndex, itemHeight),\n\t\t\tbehavior: \"auto\"\n\t\t});\n\t}, [itemHeight, items.length, valueIndex]);\n\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) return;\n\n\t\tconst handleScroll = () => {\n\t\t\tif (disabled) return;\n\t\t\tscheduleSnap();\n\t\t};\n\n\t\tconst handleWheel = (event: WheelEvent) => {\n\t\t\tif (disabled) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tscroller.scrollTop += event.deltaY;\n\t\t\tscheduleSnap();\n\t\t};\n\n\t\tscroller.addEventListener(\"scroll\", handleScroll, { passive: true });\n\t\tscroller.addEventListener(\"wheel\", handleWheel, { passive: false });\n\n\t\treturn () => {\n\t\t\tscroller.removeEventListener(\"scroll\", handleScroll);\n\t\t\tscroller.removeEventListener(\"wheel\", handleWheel);\n\t\t};\n\t}, [disabled, items, onChange, scheduleSnap]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (snapTimeoutRef.current !== null) {\n\t\t\t\twindow.clearTimeout(snapTimeoutRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t/**\n\t * Меняет значение по стрелкам вверх и вниз.\n\t */\n\tconst handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n\t\tif (disabled || items.length === 0) return;\n\n\t\tif (event.key !== \"ArrowUp\" && event.key !== \"ArrowDown\") return;\n\t\tevent.preventDefault();\n\n\t\tconst delta = event.key === \"ArrowUp\" ? -1 : 1;\n\t\tconst nextIndex = clampWheelIndex(valueIndex + delta, items.length);\n\t\tif (nextIndex === valueIndex) return;\n\n\t\tlastAppliedIndexRef.current = nextIndex;\n\t\tonChange(items[nextIndex]);\n\t};\n\n\tconst cssVars = {\n\t\t\"--wheel-picker-min-height\": `${minHeight}px`,\n\t\t\"--wheel-picker-viewport-height\": `${viewportHeight}px`,\n\t\t\"--wheel-picker-item-height\": `${itemHeight}px`,\n\t\t\"--wheel-picker-edge-padding\": `${edgePadding}px`\n\t} as CSSProperties;\n\n\treturn (\n\t\t<div ref={rootRef} className={cn(styles.wheelPicker, className)} style={cssVars}>\n\t\t\t<div className={styles.viewport}>\n\t\t\t\t<div\n\t\t\t\t\tref={scrollerRef}\n\t\t\t\t\tclassName={styles.scroller}\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\ttabIndex={disabled ? -1 : 0}\n\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\taria-disabled={disabled || undefined}\n\t\t\t\t\tonKeyDown={handleKeyDown}>\n\t\t\t\t\t<div className={styles.items}>\n\t\t\t\t\t\t{items.map((item, index) => {\n\t\t\t\t\t\t\tconst selected = index === valueIndex;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\tkey={getItemKey?.(item, index) ?? index}\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\taria-selected={selected}\n\t\t\t\t\t\t\t\t\tclassName={styles.item}\n\t\t\t\t\t\t\t\t\tdata-selected={selected ? \"\" : undefined}\n\t\t\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tlastAppliedIndexRef.current = index;\n\t\t\t\t\t\t\t\t\t\tonChange(item);\n\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t{formatItem?.(item) ?? String(item)}\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div className={styles.selectionFrame} aria-hidden=\"true\" />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;AAGA,SAAgB,EAAgB,GAAe,GAA4B;CAK1E,OAJI,KAAc,KACd,IAAQ,IAAU,IAClB,IAAQ,IAAa,IAAU,IAAa,IAEzC;AACR;AAKA,SAAgB,EAA2B,GAAwB,GAA2B;CAE7F,OADI,CAAC,OAAO,SAAS,CAAc,KAAK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,MAAK;OACL,iBAAe;OACf,WAAW,EAAO;OAClB,iBAAe,IAAW,KAAK,KAAA;OACrB;OACV,eAAe;QAEd,AADA,EAAoB,UAAU,GAC9B,EAAS,CAAI;OACd;OACC,UAAA,IAAa,CAAI,KAAK,OAAO,CAAI;MAC3B,GAZF,IAAa,GAAM,CAAK,KAAK,CAY3B;KAEV,CAAC;IACG,CAAA;GACD,CAAA,GAEL,kBAAC,OAAD;IAAK,WAAW,EAAO;IAAgB,eAAY;GAAQ,CAAA,CACvD;;CACD,CAAA;AAEP"}
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../chunks/context-menu-DgvXGCuI.js";
1
+ import { n as e, t } from "../chunks/context-menu-BQePxRpu.js";
2
2
  export { e as ContextMenu, t as DropdownMenu };
@@ -1,3 +1,3 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../chunks/CalendarView-Dm55k0bN.js";
2
- import { _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, l as g, m as _, n as v, o as y, p as b, r as x, s as S, t as C, u as w, v as T, y as E } from "../chunks/date-input-D7aBsPJc.js";
1
+ import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../chunks/CalendarView-CwbPJG2Y.js";
2
+ import { _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, l as g, m as _, n as v, o as y, p as b, r as x, s as S, t as C, u as w, v as T, y as E } from "../chunks/date-input-Crijdmmq.js";
3
3
  export { o as CalendarView, p as DATE_INPUT_SELECTION_MODES, s as DATE_INPUT_SELECTION_MODE_OPTIONS, n as DATE_INPUT_WEEK_END_DAYS, i as DATE_PICKER_LEVELS, x as DEFAULT_DATE_INPUT_FORMAT, h as DEFAULT_DATE_INPUT_PRESET, C as RangeDateInput, v as SingleDateInput, c as areRangeDateValuesEqual, y as areSingleDateValuesEqual, S as formatDateInputValue, u as formatRangeDateValue, g as formatSingleDateValue, t as getDatePickerLevelForSelectionMode, T as isDateInputSelectionMode, e as isDatePickerLevelAvailable, E as normalizeDateInputSelectionModes, w as normalizeRangeDateValue, d as normalizeRangeEndDateValue, f as normalizeSingleDateValue, b as parseRangeDateValue, _ as parseRangeEndDateValue, m as parseSingleDateValue, r as resolveAvailableDatePickerLevel, a as resolveDateInputPeriodRangeState, l as resolveDateInputSelectionModeOptionsByModes };
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "../chunks/date-range-preset-select-BLnY47cv.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "../chunks/date-range-preset-select-CyzGMvVp.js";
2
2
  export { i as DATE_RANGE_PRESET_OPTIONS, o as DEFAULT_DATE_RANGE_PRESET_IDS, n as DEFAULT_DATE_RANGE_PRESET_OPTIONS, c as DateRangePresetSelect, e as getDateRangePresetOption, a as isDateRangePresetId, s as normalizeDateRangePresetIds, t as resolveDateRangePresetIdByRange, r as resolveDateRangePresetOptionsByIds, l as resolveDateRangePresetPayload };