@ryuzaki13/react-foundation-ui 1.5.10 → 1.5.11

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 (107) hide show
  1. package/dist/advanced-search/index.js +182 -148
  2. package/dist/advanced-search/index.js.map +1 -1
  3. package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts +1 -1
  4. package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts.map +1 -1
  5. package/dist/advanced-search/ui/AdvancedSearchModal.d.ts +12 -3
  6. package/dist/advanced-search/ui/AdvancedSearchModal.d.ts.map +1 -1
  7. package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts +15 -0
  8. package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts.map +1 -0
  9. package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts.map +1 -1
  10. package/dist/badge/index.js +1 -1
  11. package/dist/base-table/index.js +1 -1
  12. package/dist/button/index.js +1 -1
  13. package/dist/check-box/index.js +1 -1
  14. package/dist/chunks/{CalendarView-BSshXZAX.js → CalendarView-DqA-PbAU.js} +42 -42
  15. package/dist/chunks/{CalendarView-BSshXZAX.js.map → CalendarView-DqA-PbAU.js.map} +1 -1
  16. package/dist/chunks/{ImageViewerRuntime-BMs3BBkV.js → ImageViewerRuntime-HGBWp9NM.js} +18 -18
  17. package/dist/chunks/{ImageViewerRuntime-BMs3BBkV.js.map → ImageViewerRuntime-HGBWp9NM.js.map} +1 -1
  18. package/dist/chunks/{TextEditorLexicalClient-CLjpATRu.js → TextEditorLexicalClient-B084kVzu.js} +322 -322
  19. package/dist/chunks/{TextEditorLexicalClient-CLjpATRu.js.map → TextEditorLexicalClient-B084kVzu.js.map} +1 -1
  20. package/dist/chunks/{badge-CaooZXYD.js → badge-DMM8cOHd.js} +16 -16
  21. package/dist/chunks/{badge-CaooZXYD.js.map → badge-DMM8cOHd.js.map} +1 -1
  22. package/dist/chunks/{base-table-fUJY__6M.js → base-table-CJdKCKhb.js} +125 -125
  23. package/dist/chunks/{base-table-fUJY__6M.js.map → base-table-CJdKCKhb.js.map} +1 -1
  24. package/dist/chunks/{button-C--u7uJj.js → button-CzUO5rzq.js} +17 -17
  25. package/dist/chunks/{button-C--u7uJj.js.map → button-CzUO5rzq.js.map} +1 -1
  26. package/dist/chunks/{check-box-BZiEBR9c.js → check-box-sfGjYczQ.js} +11 -11
  27. package/dist/chunks/{check-box-BZiEBR9c.js.map → check-box-sfGjYczQ.js.map} +1 -1
  28. package/dist/chunks/{context-menu-XZ-e0f6_.js → context-menu-6nJkPmKV.js} +83 -83
  29. package/dist/chunks/{context-menu-XZ-e0f6_.js.map → context-menu-6nJkPmKV.js.map} +1 -1
  30. package/dist/chunks/date-input-9T8AoG5U.js +341 -0
  31. package/dist/chunks/{date-input-Dr5QNVT6.js.map → date-input-9T8AoG5U.js.map} +1 -1
  32. package/dist/chunks/{input-BNszawm6.js → input-VC8jEoTa.js} +37 -37
  33. package/dist/chunks/{input-BNszawm6.js.map → input-VC8jEoTa.js.map} +1 -1
  34. package/dist/chunks/{input-files-DxLVr2PF.js → input-files-CoMjadk7.js} +22 -22
  35. package/dist/chunks/{input-files-DxLVr2PF.js.map → input-files-CoMjadk7.js.map} +1 -1
  36. package/dist/chunks/{input-search-C2OOhZlw.js → input-search-Bs_9SxT0.js} +2 -2
  37. package/dist/chunks/{input-search-C2OOhZlw.js.map → input-search-Bs_9SxT0.js.map} +1 -1
  38. package/dist/chunks/{misc-Cp_r022Z.js → misc-CkRRma5E.js} +55 -55
  39. package/dist/chunks/{misc-Cp_r022Z.js.map → misc-CkRRma5E.js.map} +1 -1
  40. package/dist/chunks/{modal-DK9M7lT5.js → modal-LHkNxBko.js} +38 -38
  41. package/dist/chunks/{modal-DK9M7lT5.js.map → modal-LHkNxBko.js.map} +1 -1
  42. package/dist/chunks/{multi-select-CFHaQPot.js → multi-select-BJ6Lst1E.js} +44 -44
  43. package/dist/chunks/{multi-select-CFHaQPot.js.map → multi-select-BJ6Lst1E.js.map} +1 -1
  44. package/dist/chunks/{picker-D3Fc15JH.js → picker-DLnfOgZj.js} +34 -34
  45. package/dist/chunks/{picker-D3Fc15JH.js.map → picker-DLnfOgZj.js.map} +1 -1
  46. package/dist/chunks/{popover-BTT7zSqx.js → popover-IExDrsF6.js} +67 -67
  47. package/dist/chunks/{popover-BTT7zSqx.js.map → popover-IExDrsF6.js.map} +1 -1
  48. package/dist/chunks/{select-BolFlcoY.js → select-CysiIrej.js} +5 -5
  49. package/dist/chunks/{select-BolFlcoY.js.map → select-CysiIrej.js.map} +1 -1
  50. package/dist/chunks/{sortable-DcTIAbjD.js → sortable-BKIwlqhI.js} +17 -17
  51. package/dist/chunks/{sortable-DcTIAbjD.js.map → sortable-BKIwlqhI.js.map} +1 -1
  52. package/dist/chunks/{table-BChs6bgR.js → table-CIWdAcPY.js} +2 -2
  53. package/dist/chunks/{table-BChs6bgR.js.map → table-CIWdAcPY.js.map} +1 -1
  54. package/dist/chunks/{types-CxXyru6U.js → types-D9Wj9wrg.js} +21 -21
  55. package/dist/chunks/{types-CxXyru6U.js.map → types-D9Wj9wrg.js.map} +1 -1
  56. package/dist/chunks/{useODataSelectBase-BhCMCzv_.js → useODataSelectBase-Bq36Wp1U.js} +8 -8
  57. package/dist/chunks/{useODataSelectBase-BhCMCzv_.js.map → useODataSelectBase-Bq36Wp1U.js.map} +1 -1
  58. package/dist/context-menu/index.js +1 -1
  59. package/dist/date-input/index.js +2 -2
  60. package/dist/date-time-input/index.js +32 -32
  61. package/dist/dialog/index.js +9 -9
  62. package/dist/disclosure/index.js +10 -10
  63. package/dist/drop-zone/index.js +8 -8
  64. package/dist/errors/index.js +8 -8
  65. package/dist/expandable-action-panel/index.js +16 -16
  66. package/dist/flex/useFlexClasses.d.ts +1 -1
  67. package/dist/fullscreen-portal/index.js +7 -7
  68. package/dist/image/index.js +27 -27
  69. package/dist/input/index.js +1 -1
  70. package/dist/input-date-time/index.js +1 -1
  71. package/dist/input-file/index.js +1 -1
  72. package/dist/input-files/index.js +1 -1
  73. package/dist/input-image/index.js +1 -1
  74. package/dist/input-search/index.js +1 -1
  75. package/dist/layout-picker/index.js +1 -1
  76. package/dist/list/index.js +25 -25
  77. package/dist/listbox/index.js +5 -5
  78. package/dist/misc/index.js +1 -1
  79. package/dist/modal/index.js +1 -1
  80. package/dist/multi-select/index.js +1 -1
  81. package/dist/notifications/index.js +30 -30
  82. package/dist/picker/index.js +1 -1
  83. package/dist/popover/index.js +1 -1
  84. package/dist/preset-range-date-input/index.js +1 -1
  85. package/dist/preset-select/index.js +1 -1
  86. package/dist/radio-button/index.js +10 -10
  87. package/dist/select/index.js +1 -1
  88. package/dist/simple-table/index.js +1 -1
  89. package/dist/slider/index.js +3 -3
  90. package/dist/sortable/index.js +1 -1
  91. package/dist/state-select/index.js +1 -1
  92. package/dist/styles.css +1 -1
  93. package/dist/switch/index.js +11 -11
  94. package/dist/table/index.js +1 -1
  95. package/dist/table-sorting/index.js +13 -13
  96. package/dist/tabs/index.js +1 -1
  97. package/dist/tag-input/index.js +55 -55
  98. package/dist/tag-input/index.js.map +1 -1
  99. package/dist/text/index.js +1 -1
  100. package/dist/text-editor/index.js +3 -3
  101. package/dist/textarea/index.js +1 -1
  102. package/dist/tree-select/index.js +134 -134
  103. package/dist/tree-select/index.js.map +1 -1
  104. package/dist/tree-table/index.js +16 -16
  105. package/package.json +1 -1
  106. package/storybook-static/project.json +1 -1
  107. package/dist/chunks/date-input-Dr5QNVT6.js +0 -341
@@ -1,341 +0,0 @@
1
- import { r as e } from "./popover-BTT7zSqx.js";
2
- import { t } from "./ui.module-DHVTOqZ0.js";
3
- import { o as n } from "./input-BNszawm6.js";
4
- import { n as r, o as i, s as a, t as o } from "./CalendarView-BSshXZAX.js";
5
- import { n as s } from "./radio-group-BRR1ZQDA.js";
6
- import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
7
- import { CalendarDaysIcon as p } from "lucide-react";
8
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
- import { DEFAULT_DATE_PRESET_NAMES as g, formatDate as _, formatDateRange as v, getCalendarPeriod as y, getDatePreset as b, isDateRangeTuple as x, parseDateByFormat as S, resolveDateFormatName as C } from "@ryuzaki13/react-foundation-lib/formatters";
10
- //#region src/date-input/lib/dateInputValue.ts
11
- var w = g.date, T = "dd.MM.yyyy", E = " - ";
12
- function D(e) {
13
- return e.selectionMode === "day" || e.selectionMode === "week" ? "day" : e.selectionMode === "month" || e.selectionMode === "year" ? e.selectionMode : e.datePickerLevel ?? "day";
14
- }
15
- function O(e) {
16
- return {
17
- selectionMode: e?.selectionMode,
18
- weekEndDay: e?.weekEndDay
19
- };
20
- }
21
- function k(e, t) {
22
- return typeof e == "string" || e === void 0 ? {
23
- datePreset: e,
24
- datePickerLevel: t
25
- } : t && e.datePickerLevel === void 0 ? {
26
- ...e,
27
- datePickerLevel: t
28
- } : e;
29
- }
30
- function A(e) {
31
- let t = C(e, w);
32
- return b(t) ? t : w;
33
- }
34
- function j(e, t) {
35
- return S(e, A(t.datePreset), {
36
- defaultFormat: w,
37
- precision: D(t),
38
- referenceDate: t.referenceDate
39
- })?.date ?? null;
40
- }
41
- function M(e, t) {
42
- return y(e, O(t))?.start ?? null;
43
- }
44
- function N(e, t) {
45
- if (!x(e)) return null;
46
- let [n, r] = e;
47
- return [M(n, t), P(r, t)];
48
- }
49
- function P(e, t) {
50
- return y(e, O(t))?.end ?? null;
51
- }
52
- function F(e) {
53
- return e?.getTime() ?? null;
54
- }
55
- function I(e, t, n) {
56
- return F(M(e, n)) === F(M(t, n));
57
- }
58
- function L(e, t, n) {
59
- let r = N(e, n), i = N(t, n);
60
- return F(r?.[0] ?? null) === F(i?.[0] ?? null) && F(r?.[1] ?? null) === F(i?.[1] ?? null);
61
- }
62
- function R(e, t, n) {
63
- if (!e) return "";
64
- let r = k(t, n), i = y(e, O(r));
65
- return r.selectionMode === "week" && i ? v(i.start, i.end, A(r.datePreset), { precision: D(r) }) : _(e, A(r.datePreset), { precision: D(r) });
66
- }
67
- function z(e, t, n) {
68
- if (!x(e)) return "";
69
- let r = k(t, n), [i, a] = e;
70
- return i && a ? v(i, a, A(r.datePreset), { precision: D(r) }) : i ? `${_(i, A(r.datePreset), { precision: D(r) })}${E}` : "";
71
- }
72
- function B(e, t, n) {
73
- return x(e) ? z(e, t, n) : R(e, t, n);
74
- }
75
- function V(e, t, n) {
76
- let r = k(t, n);
77
- return M(j(r.selectionMode === "week" ? e.split(E)[0] ?? "" : e, r), r);
78
- }
79
- function H(e, t, n) {
80
- let r = k(t, n), [i = "", a = ""] = e.split(E);
81
- return [V(i, r), U(a, r)];
82
- }
83
- function U(e, t, n) {
84
- let r = k(t, n);
85
- return P(j(e, r), r);
86
- }
87
- //#endregion
88
- //#region src/date-input/model/useDateInput.ts
89
- function W(e) {
90
- return x(e) ? e[0] ?? e[1] ?? void 0 : e ?? void 0;
91
- }
92
- var G = (e) => {
93
- let t = u(() => {
94
- let t = {
95
- selectionMode: e.selectionMode,
96
- weekEndDay: e.weekEndDay
97
- };
98
- return e.selectsRange ? N(e.value, t) : M(e.value, t);
99
- }, [
100
- e.selectsRange,
101
- e.selectionMode,
102
- e.value,
103
- e.weekEndDay
104
- ]), n = u(() => ({
105
- datePreset: e.datePreset,
106
- datePickerLevel: e.datePickerLevel,
107
- selectionMode: e.selectionMode,
108
- weekEndDay: e.weekEndDay
109
- }), [
110
- e.datePickerLevel,
111
- e.datePreset,
112
- e.selectionMode,
113
- e.weekEndDay
114
- ]), r = B(t, n), i = JSON.stringify([
115
- e.selectsRange,
116
- e.datePreset ?? null,
117
- e.datePickerLevel ?? null,
118
- e.selectionMode ?? null,
119
- e.weekEndDay ?? null,
120
- x(t) ? [t[0]?.getTime() ?? null, t[1]?.getTime() ?? null] : t?.getTime() ?? null
121
- ]), [a, o] = f(() => ({
122
- sourceSignature: i,
123
- selectedDate: t,
124
- inputValue: r
125
- })), s = a.sourceSignature === i, c = s ? a.selectedDate : t, l = s ? a.inputValue : r, d = (e) => {
126
- o((n) => {
127
- let r = n.sourceSignature === i ? n.selectedDate : t;
128
- return {
129
- sourceSignature: i,
130
- selectedDate: r,
131
- inputValue: e
132
- };
133
- });
134
- }, p = (e) => {
135
- o((t) => {
136
- let n = t.sourceSignature === i ? t.inputValue : r;
137
- return {
138
- sourceSignature: i,
139
- selectedDate: e,
140
- inputValue: n
141
- };
142
- });
143
- }, m = (e) => B(e, n);
144
- return {
145
- inputValue: l,
146
- setInputValue: d,
147
- selectedDate: c,
148
- setSelectedDate: p,
149
- handleSelect: (t) => {
150
- let [r, a] = Array.isArray(t) ? t : [t, null];
151
- if (e.selectsRange) {
152
- let t = M(r, n), s = P(a, n);
153
- if (t && s) {
154
- if (s < t) {
155
- let t = [M(a, n), P(r, n)];
156
- o({
157
- sourceSignature: i,
158
- selectedDate: t,
159
- inputValue: m(t)
160
- }), e.onChange(t);
161
- } else {
162
- let n = [t, s];
163
- o({
164
- sourceSignature: i,
165
- selectedDate: n,
166
- inputValue: m(n)
167
- }), e.onChange(n);
168
- }
169
- return !0;
170
- }
171
- let c = [t, null];
172
- return o({
173
- sourceSignature: i,
174
- selectedDate: c,
175
- inputValue: m(c)
176
- }), !1;
177
- }
178
- let s = M(r, n);
179
- return o({
180
- sourceSignature: i,
181
- selectedDate: s,
182
- inputValue: m(s)
183
- }), e.onChange(s), !0;
184
- },
185
- formatDate: m,
186
- parseDate: (t) => {
187
- let r = {
188
- ...n,
189
- referenceDate: W(c)
190
- };
191
- return e.selectsRange ? H(t, r) : V(t, r);
192
- }
193
- };
194
- }, K = { selectionModeControl: "-tM-kj" }, q = {
195
- day: "День",
196
- week: "Неделя",
197
- month: "Месяц",
198
- year: "Год"
199
- };
200
- function ee(e, t) {
201
- let n = new Set(e?.length ? e : r);
202
- return n.add(t), r.filter((e) => n.has(e));
203
- }
204
- function J({ placeholder: r, disabled: u, error: g, onClearError: _, minDate: v, maxDate: y, datePickerLevel: b, selectionMode: S, weekEndDay: C = "sunday", allowSelectionModeChange: w, selectionModeOptions: T, onSelectionModeChange: E, ...D }) {
205
- let [O, k] = f(!1), [A, j] = f(S ?? "day"), M = S ?? A, N = b ?? "day", P = a(M, N), [F, R] = f(() => ({
206
- view: P,
207
- selectionMode: M,
208
- minDatePickerLevel: N
209
- })), z = F.selectionMode === M && F.minDatePickerLevel === N && i(F.view, N) ? F.view : P, B = d(D.value), V = {
210
- selectionMode: M,
211
- weekEndDay: C
212
- }, { inputValue: H, setInputValue: U, selectedDate: W, setSelectedDate: J, handleSelect: Y, formatDate: X, parseDate: te } = G({
213
- ...D,
214
- datePickerLevel: N,
215
- selectionMode: M,
216
- weekEndDay: C
217
- }), Z = D.selectsRange ? D.onChange : void 0, ne = c((e) => {
218
- i(e, N) && R({
219
- view: e,
220
- selectionMode: M,
221
- minDatePickerLevel: N
222
- });
223
- }, [N, M]);
224
- l(() => {
225
- B.current = D.value;
226
- }, [D.value]);
227
- let Q = () => {
228
- if (H) {
229
- let e = te(H);
230
- if (e) {
231
- if (U(X(e)), D.selectsRange && x(e)) {
232
- if (L(e, x(W) ? W : null, V)) return;
233
- J(e), D.onChange(e);
234
- } else if (!D.selectsRange && e instanceof Date) {
235
- if (I(e, W instanceof Date ? W : null, V)) return;
236
- J(e), D.onChange(e);
237
- }
238
- }
239
- }
240
- }, re = (e) => {
241
- e.key === "Enter" && (e.preventDefault(), Q());
242
- }, ie = c((e) => {
243
- Y(e) && k(!1);
244
- }, [Y]), ae = c((e) => {
245
- S === void 0 && j(e), E?.(e), R({
246
- view: a(e, N),
247
- selectionMode: e,
248
- minDatePickerLevel: N
249
- });
250
- }, [
251
- S,
252
- N,
253
- E
254
- ]), oe = c(() => {
255
- if (Z) {
256
- let [, e] = x(W) ? W : [null, null];
257
- if (!e) {
258
- let e = B.current, t = Array.isArray(e) ? e : null, n = t?.[0] ?? null, r = t?.[1] ?? null;
259
- if (n && r) {
260
- let e = [n, r];
261
- J(e), U(X(e)), Z(e);
262
- } else J([null, null]), U(""), Z([null, null]);
263
- }
264
- }
265
- }, [
266
- Z,
267
- W,
268
- J,
269
- U,
270
- X
271
- ]), $ = ee(T, M), se = w && $.length > 1;
272
- return /* @__PURE__ */ h(e, {
273
- open: O,
274
- onOpenChange: (e) => {
275
- k(e), e || oe();
276
- },
277
- children: [/* @__PURE__ */ m(n, {
278
- label: D.label,
279
- description: D.description,
280
- size: D.size,
281
- value: H,
282
- onChange: U,
283
- onBlur: Q,
284
- onKeyUp: re,
285
- placeholder: r,
286
- disabled: u,
287
- error: g,
288
- onClearError: _,
289
- endAdornmentWidth: "var(--control-height)",
290
- endAdornment: /* @__PURE__ */ m(e.Trigger, { children: /* @__PURE__ */ m("div", {
291
- className: t.uiToggleButtonContainer,
292
- children: /* @__PURE__ */ m("button", {
293
- type: "button",
294
- disabled: u,
295
- "aria-label": "Открыть календарь",
296
- className: t.uiToggleButton,
297
- children: /* @__PURE__ */ m(p, {})
298
- })
299
- }) })
300
- }), /* @__PURE__ */ h(e.Content, {
301
- background: "primary",
302
- children: [/* @__PURE__ */ m(o, {
303
- view: z,
304
- datePickerLevel: N,
305
- selectionMode: M,
306
- weekEndDay: C,
307
- onViewChange: ne,
308
- value: W ?? null,
309
- onChange: ie,
310
- minDate: v,
311
- maxDate: y,
312
- selectsRange: !!D.selectsRange
313
- }), se && /* @__PURE__ */ m("div", {
314
- className: K.selectionModeControl,
315
- children: /* @__PURE__ */ m(s, {
316
- value: M,
317
- onChange: ae,
318
- noWrap: !0,
319
- "aria-label": "Режим выбора даты",
320
- children: $.map((e) => /* @__PURE__ */ m(s.Option, {
321
- value: e,
322
- label: q[e]
323
- }, e))
324
- })
325
- })]
326
- })]
327
- });
328
- }
329
- function Y(e) {
330
- return /* @__PURE__ */ m(J, { ...e });
331
- }
332
- function X(e) {
333
- return /* @__PURE__ */ m(J, {
334
- ...e,
335
- selectsRange: !0
336
- });
337
- }
338
- //#endregion
339
- export { L as a, z as c, P as d, M as f, V as h, w as i, R as l, U as m, Y as n, I as o, H as p, T as r, B as s, X as t, N as u };
340
-
341
- //# sourceMappingURL=date-input-Dr5QNVT6.js.map