urfu-ui-kit-react 2.1.7-next.0 → 2.1.7-next.2

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 (75) hide show
  1. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  2. package/dist/components/Calendar/Calendar.js +232 -194
  3. package/dist/components/Calendar/Calendar.types.d.ts +21 -0
  4. package/dist/components/Calendar/Calendar.types.d.ts.map +1 -1
  5. package/dist/components/Calendar/CalendarSelect.js +38 -38
  6. package/dist/components/Calendar/MaskedDateInput.d.ts +2 -0
  7. package/dist/components/Calendar/MaskedDateInput.d.ts.map +1 -1
  8. package/dist/components/Calendar/MaskedDateInput.js +120 -113
  9. package/dist/components/ColumnSettings/ColumnSettings.d.ts.map +1 -1
  10. package/dist/components/ColumnSettings/ColumnSettings.js +22 -21
  11. package/dist/components/ConfirmModal/ConfirmModal.d.ts +0 -1
  12. package/dist/components/ConfirmModal/ConfirmModal.d.ts.map +1 -1
  13. package/dist/components/ConfirmModal/ConfirmModal.js +11 -12
  14. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  15. package/dist/components/Drawer/Drawer.js +23 -22
  16. package/dist/components/ErrorScreen/ErrorScreenIllustration.js +28 -28
  17. package/dist/components/InputExpandTextarea/InputExpandTextarea.js +1 -1
  18. package/dist/components/InputTime/InputTime.js +12 -12
  19. package/dist/components/Menu/Menu.js +11 -11
  20. package/dist/components/Modal/Modal.js +33 -33
  21. package/dist/components/Pagination/Pagination.js +22 -22
  22. package/dist/components/Preloader/Preloader.d.ts.map +1 -1
  23. package/dist/components/Preloader/Preloader.js +13 -13
  24. package/dist/components/Search/Search.d.ts.map +1 -1
  25. package/dist/components/Search/Search.js +28 -23
  26. package/dist/components/Select/Select.d.ts +2 -0
  27. package/dist/components/Select/Select.d.ts.map +1 -1
  28. package/dist/components/Select/Select.js +21 -19
  29. package/dist/components/StickyActionBar/StickyActionBar.d.ts.map +1 -1
  30. package/dist/components/StickyActionBar/StickyActionBar.js +45 -58
  31. package/dist/components/Switch/Switch.d.ts.map +1 -1
  32. package/dist/components/Switch/Switch.js +8 -8
  33. package/dist/components/Table/Filter/FilterStringBox.d.ts.map +1 -1
  34. package/dist/components/Table/Filter/FilterStringBox.js +45 -40
  35. package/dist/components/Table/Filter/SelectFilter.d.ts.map +1 -1
  36. package/dist/components/Table/Filter/SelectFilter.js +24 -22
  37. package/dist/components/Table/Filter/filterLoading.d.ts +4 -1
  38. package/dist/components/Table/Filter/filterLoading.d.ts.map +1 -1
  39. package/dist/components/Table/Filter/filterLoading.js +6 -2
  40. package/dist/components/Table/Filter/useServerFilterOptions.d.ts +4 -1
  41. package/dist/components/Table/Filter/useServerFilterOptions.d.ts.map +1 -1
  42. package/dist/components/Table/Filter/useServerFilterOptions.js +28 -25
  43. package/dist/components/Table/Table.filterTypes.d.ts +5 -0
  44. package/dist/components/Table/Table.filterTypes.d.ts.map +1 -1
  45. package/dist/components/Table/TableHead.js +6 -6
  46. package/dist/components/Table/TableMobileCard.d.ts.map +1 -1
  47. package/dist/components/Table/TableMobileCard.js +27 -26
  48. package/dist/components/Table/TableMobileView.js +46 -46
  49. package/dist/components/Table/TableRow.js +1 -1
  50. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  51. package/dist/components/Tabs/Tabs.js +25 -24
  52. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  53. package/dist/components/Tooltip/Tooltip.js +37 -36
  54. package/dist/dev/index.js +18 -19
  55. package/dist/dev/types/vanilla/src/dev/panelStyles.d.ts +1 -1
  56. package/dist/hooks/useAutoId.js +3 -3
  57. package/dist/index.d.ts +1 -1
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/shared/kitCopy.js +1 -1
  60. package/dist/shared/kitRegistry.d.ts +2 -2
  61. package/dist/shared/optionStateColors.d.ts +2 -2
  62. package/dist/shared/optionStateColors.js +4 -4
  63. package/dist/style-no-fonts.css +1 -1
  64. package/dist/style.css +1 -1
  65. package/dist/style.layer.css +2 -2
  66. package/dist/style.shell.css +3 -3
  67. package/dist/utils/inputMode.d.ts +5 -0
  68. package/dist/utils/inputMode.d.ts.map +1 -1
  69. package/dist/vanilla/core/dateMask.js +1 -1
  70. package/dist/vanilla/core/describeError.js +10 -10
  71. package/dist/vanilla/core/inputMode.js +18 -11
  72. package/package.json +1 -1
  73. package/dist/shared/devLauncherOffset.d.ts +0 -8
  74. package/dist/shared/devLauncherOffset.d.ts.map +0 -1
  75. package/dist/vanilla/core/devLauncherOffset.js +0 -20
@@ -1,41 +1,41 @@
1
- import { jsxs as x, jsx as a } from "react/jsx-runtime";
2
- import { useRef as d, useEffect as h } from "react";
3
- import { useDismiss$u as m } from "../../hooks/useDismiss.js";
1
+ import { jsxs as x, jsx as r } from "react/jsx-runtime";
2
+ import { useRef as d, useEffect as m } from "react";
3
+ import { useDismiss$u as b } from "../../hooks/useDismiss.js";
4
4
  const S = ({
5
- options: i,
6
- value: t,
5
+ options: n,
6
+ value: a,
7
7
  onChange: p,
8
- width: f = 100,
9
- fallbackValue: l,
10
- isOpen: r,
11
- onOpen: v,
12
- onClose: c
8
+ width: v = 100,
9
+ fallbackValue: o,
10
+ isOpen: t,
11
+ onOpen: f,
12
+ onClose: i
13
13
  }) => {
14
- const o = d(null), u = d(null);
15
- m({ refs: [o], onDismiss: c, enabled: r });
16
- const s = i.find((e) => e.value === t);
17
- return h(() => {
18
- if (!r) return;
14
+ const l = d(null), u = d(null);
15
+ b({ refs: [l], onDismiss: i, enabled: t });
16
+ const s = n.find((e) => e.value === a);
17
+ return m(() => {
18
+ if (!t) return;
19
19
  const e = u.current;
20
20
  if (!e) return;
21
- const n = e.querySelector("[data-current='true']") ?? e.querySelector("[data-fallback='true']");
22
- n && (e.scrollTop = n.offsetTop - e.clientHeight / 2 + n.offsetHeight / 2);
23
- }, [r]), /* @__PURE__ */ x(
21
+ const c = e.querySelector("[data-current='true']") ?? e.querySelector("[data-fallback='true']");
22
+ c && (e.scrollTop = c.offsetTop - e.clientHeight / 2 + c.offsetHeight / 2);
23
+ }, [t]), /* @__PURE__ */ x(
24
24
  "div",
25
25
  {
26
- ref: o,
26
+ ref: l,
27
27
  style: {
28
28
  // Ширину задаёт скрытый эталон ниже — по самой длинной подписи. `width`
29
29
  // остаётся нижней границей, чтобы короткие списки не схлопывались.
30
30
  position: "relative",
31
31
  width: "max-content",
32
- minWidth: `calc(${f} * var(--u-unit, 1px))`,
32
+ minWidth: `calc(${v} * var(--u-unit, 1px))`,
33
33
  userSelect: "none",
34
34
  cursor: "pointer"
35
35
  },
36
36
  className: "calendar-custom-select",
37
37
  children: [
38
- /* @__PURE__ */ a(
38
+ /* @__PURE__ */ r(
39
39
  "span",
40
40
  {
41
41
  "aria-hidden": !0,
@@ -45,7 +45,7 @@ const S = ({
45
45
  overflow: "hidden",
46
46
  fontSize: "var(--u-font-size-14, calc(14 * var(--u-unit, 1px)))"
47
47
  },
48
- children: i.map((e) => /* @__PURE__ */ a(
48
+ children: n.map((e) => /* @__PURE__ */ r(
49
49
  "span",
50
50
  {
51
51
  style: {
@@ -62,7 +62,7 @@ const S = ({
62
62
  ))
63
63
  }
64
64
  ),
65
- /* @__PURE__ */ a(
65
+ /* @__PURE__ */ r(
66
66
  "div",
67
67
  {
68
68
  className: "calendar-custom-select-input",
@@ -77,18 +77,18 @@ const S = ({
77
77
  lineHeight: "calc(29 * var(--u-unit, 1px))",
78
78
  // Черта идёт по всей ширине поля, а ширину задаёт эталон по самой
79
79
  // длинной подписи — значит она совпадает с шириной выпадающего списка.
80
- borderBottom: "1px solid #748AB9",
80
+ borderBottom: "1px solid var(--u-color-border, #748AB9)",
81
81
  display: "flex",
82
82
  alignItems: "center",
83
83
  justifyContent: "center"
84
84
  },
85
85
  onClick: (e) => {
86
- e.stopPropagation(), r ? c() : v();
86
+ e.stopPropagation(), t ? i() : f();
87
87
  },
88
- children: /* @__PURE__ */ a("span", { children: s ? s.label : "" })
88
+ children: /* @__PURE__ */ r("span", { children: s ? s.label : "" })
89
89
  }
90
90
  ),
91
- r && /* @__PURE__ */ a(
91
+ t && /* @__PURE__ */ r(
92
92
  "div",
93
93
  {
94
94
  ref: u,
@@ -103,8 +103,8 @@ const S = ({
103
103
  // из-за этого годы обрезались в «202», а месяцы в «Сентябр».
104
104
  width: "100%",
105
105
  scrollbarGutter: "stable",
106
- background: "#fff",
107
- border: "1px solid #748AB9",
106
+ background: "var(--u-color-surface, #fff)",
107
+ border: "1px solid var(--u-color-border, #748AB9)",
108
108
  borderRadius: "calc(4 * var(--u-unit, 1px))",
109
109
  boxShadow: "0 2px 8px rgba(30,67,145,0.08)",
110
110
  zIndex: 10,
@@ -112,29 +112,29 @@ const S = ({
112
112
  overflowY: "auto",
113
113
  fontSize: "var(--u-font-size-14, calc(14 * var(--u-unit, 1px)))"
114
114
  },
115
- children: i.map((e) => /* @__PURE__ */ a(
115
+ children: n.map((e) => /* @__PURE__ */ r(
116
116
  "div",
117
117
  {
118
118
  className: "calendar-custom-select-option",
119
- "data-current": t === e.value ? "true" : void 0,
120
- "data-fallback": l !== void 0 && l === e.value ? "true" : void 0,
119
+ "data-current": a === e.value ? "true" : void 0,
120
+ "data-fallback": o !== void 0 && o === e.value ? "true" : void 0,
121
121
  style: {
122
122
  // Без внешних отступов: они оставляли белые поля вокруг подсветки
123
123
  // выбранного пункта. Воздух даёт паддинг, подсветка идёт от
124
124
  // края до края списка.
125
125
  padding: "calc(6 * var(--u-unit, 1px)) calc(6 * var(--u-unit, 1px))",
126
126
  cursor: "pointer",
127
- background: t === e.value ? "#EAF1FF" : "#fff",
128
- borderRadius: t === e.value ? "4px" : 0,
129
- color: t === e.value ? "#1E4391" : "#222",
127
+ background: a === e.value ? "var(--u-calendar-select-option-active-background, #EAF1FF)" : "var(--u-color-surface, #fff)",
128
+ borderRadius: a === e.value ? "4px" : 0,
129
+ color: a === e.value ? "var(--u-color-primary, #1E4391)" : "var(--u-color-text, #222)",
130
130
  margin: 0,
131
- transition: "background 0.15s",
131
+ transition: "background var(--u-duration-fast, 0.15s)",
132
132
  fontSize: "var(--u-font-size-14, calc(14 * var(--u-unit, 1px)))",
133
133
  // Подписи не переносим: список расширяется по содержимому.
134
134
  whiteSpace: "nowrap"
135
135
  },
136
- onClick: (n) => {
137
- n.stopPropagation(), c(), p(e.value);
136
+ onClick: (c) => {
137
+ c.stopPropagation(), i(), p(e.value);
138
138
  },
139
139
  children: e.label
140
140
  },
@@ -12,6 +12,8 @@ type ExtraDateProps = {
12
12
  /** Включает редактирование сегментов колесом мыши, стрелками ↑↓ и переход по Enter.
13
13
  * По умолчанию выключено — поле работает как обычный masked-input (только ввод). */
14
14
  wheelEdit?: boolean;
15
+ /** Период: маска «дд.мм.гггг - дд.мм.гггг». Колесо и откат неполного значения на blur не работают. */
16
+ range?: boolean;
15
17
  };
16
18
  export declare const MaskedDateInput: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & ExtraDateProps & import("react").RefAttributes<HTMLInputElement>>;
17
19
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"MaskedDateInput.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/MaskedDateInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AAWf,KAAK,cAAc,GAAG;IACpB,oHAAoH;IACpH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,yFAAyF;IACzF,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,oEAAoE;IACpE,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C;+DAC2D;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;yFACqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAqBF,eAAO,MAAM,eAAe,qJA8T1B,CAAC"}
1
+ {"version":3,"file":"MaskedDateInput.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/MaskedDateInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AAWf,KAAK,cAAc,GAAG;IACpB,oHAAoH;IACpH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,yFAAyF;IACzF,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,oEAAoE;IACpE,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C;+DAC2D;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;yFACqF;IACrF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sGAAsG;IACtG,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAoCF,eAAO,MAAM,eAAe,qJAsU1B,CAAC"}
@@ -1,42 +1,45 @@
1
- import { jsx as P } from "react/jsx-runtime";
2
- import { forwardRef as C, useRef as I, useState as _, useCallback as S, useEffect as $, useLayoutEffect as N } from "react";
3
- import { useInputOverflow$u as tt } from "../../hooks/useInputOverflow.js";
4
- import { getSegmentRange$u as U, incrementDateSegment$u as et, parseDateString$u as rt, getSegmentAtCaret$u as M, maskDateValue$u as nt } from "../../vanilla/core/dateMask.js";
5
- const b = /^\d{2}\.\d{2}\.\d{4}$/, ct = (n, i) => {
6
- var l, f;
7
- (f = (l = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")) == null ? void 0 : l.set) == null || f.call(n, i), n.dispatchEvent(new Event("input", { bubbles: !0 }));
8
- }, st = (n, i) => {
9
- const l = n.selectionStart ?? 0, f = n.selectionEnd ?? l;
10
- if (l === f) return !1;
11
- if (l === 0 && f === n.value.length) return !0;
12
- if (!i) return !1;
13
- const [T, d] = U(i);
14
- return l === T && f === d;
15
- }, ut = C(({ value: n, onChange: i, onFocus: l, onBlur: f, onMouseUp: T, onKeyDown: d, onWheelDate: H, onOpenCalendar: R, onFocusChange: E, isClearable: Y, wheelEdit: o = !1, ...w }, A) => {
16
- const s = I(null);
17
- tt(s, n, w.disabled);
18
- const [g, z] = _(null), q = I(null), p = S((t) => {
19
- q.current = t, z(t);
20
- }, []), [B, G] = _(0), [J, Q] = _(0), a = I(typeof n == "string" ? n : ""), L = I(
21
- typeof n == "string" && b.test(n) ? n : ""
22
- ), V = I(!1);
23
- $(() => {
24
- typeof n == "string" && b.test(n) && (L.current = n), V.current || (a.current = typeof n == "string" ? n : "");
25
- }, [n]);
26
- const W = S(
1
+ import { jsx as nt } from "react/jsx-runtime";
2
+ import { forwardRef as ct, useRef as I, useState as O, useCallback as E, useEffect as q, useLayoutEffect as Y } from "react";
3
+ import { useInputOverflow$u as st } from "../../hooks/useInputOverflow.js";
4
+ import { getSegmentRange$u as v, incrementDateSegment$u as ut, parseDateString$u as it, getSegmentAtCaret$u as j, maskDateValue$u as w } from "../../vanilla/core/dateMask.js";
5
+ const S = /^\d{2}\.\d{2}\.\d{4}$/, z = " - ", lt = " — ", at = /\s*[-–—]\s*$/, ft = (r) => r.replace(z, lt), ot = (r) => {
6
+ const s = r.replaceAll(/\D/g, "").slice(0, 16), i = w(s.slice(0, 8));
7
+ return s.length > 8 ? i + z + w(s.slice(8)) : i;
8
+ }, pt = (r, s) => {
9
+ var i, f;
10
+ (f = (i = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")) == null ? void 0 : i.set) == null || f.call(r, s), r.dispatchEvent(new Event("input", { bubbles: !0 }));
11
+ }, mt = (r, s) => {
12
+ const i = r.selectionStart ?? 0, f = r.selectionEnd ?? i;
13
+ if (i === f) return !1;
14
+ if (i === 0 && f === r.value.length) return !0;
15
+ if (!s) return !1;
16
+ const [R, d] = v(s);
17
+ return i === R && f === d;
18
+ }, dt = ct(({ value: r, onChange: s, onFocus: i, onBlur: f, onMouseUp: R, onKeyDown: d, onWheelDate: G, onOpenCalendar: L, onFocusChange: A, isClearable: J, wheelEdit: o = !1, range: V = !1, ...B }, T) => {
19
+ const u = I(null), [Q, U] = O(!1);
20
+ st(u, r, B.disabled);
21
+ const [g, X] = O(null), M = I(null), p = E((t) => {
22
+ M.current = t, X(t);
23
+ }, []), [W, Z] = O(0), [P, h] = O(0), a = I(typeof r == "string" ? r : ""), k = I(
24
+ typeof r == "string" && S.test(r) ? r : ""
25
+ ), _ = I(!1);
26
+ q(() => {
27
+ typeof r == "string" && S.test(r) && (k.current = r), _.current || (a.current = typeof r == "string" ? r : "");
28
+ }, [r]);
29
+ const F = E(
27
30
  (t) => {
28
- s.current = t, typeof A == "function" ? A(t) : A && (A.current = t);
31
+ u.current = t, typeof T == "function" ? T(t) : T && (T.current = t);
29
32
  },
30
- [A]
31
- ), x = S((t) => {
32
- const e = s.current;
33
+ [T]
34
+ ), x = E((t) => {
35
+ const e = u.current;
33
36
  if (!e) return;
34
- const [r, c] = U(t);
35
- e.setSelectionRange(r, c);
36
- }, []), D = S(
37
+ const [n, c] = v(t);
38
+ e.setSelectionRange(n, c);
39
+ }, []), D = E(
37
40
  (t) => {
38
41
  const e = () => {
39
- q.current === t && x(t);
42
+ M.current === t && x(t);
40
43
  };
41
44
  requestAnimationFrame(() => {
42
45
  e(), requestAnimationFrame(e);
@@ -44,86 +47,90 @@ const b = /^\d{2}\.\d{2}\.\d{4}$/, ct = (n, i) => {
44
47
  },
45
48
  [x]
46
49
  );
47
- N(() => {
50
+ Y(() => {
48
51
  if (!o) return;
49
- const t = s.current;
52
+ const t = u.current;
50
53
  !t || document.activeElement !== t || !g || x(g);
51
- }, [n, g, x, o, J]), N(() => {
52
- if (B === 0) return;
53
- const t = s.current;
54
+ }, [r, g, x, o, P]), Y(() => {
55
+ if (W === 0) return;
56
+ const t = u.current;
54
57
  !t || document.activeElement !== t || t.setSelectionRange(0, t.value.length);
55
- }, [B]);
56
- const X = (t) => {
57
- const e = nt(t.target.value);
58
- t.target.value = e, a.current = e, i == null || i(t);
59
- }, Z = (t) => {
60
- if (T == null || T(t), !o) return;
58
+ }, [W]);
59
+ const K = (t) => {
60
+ const e = V ? ot(t.target.value) : w(t.target.value);
61
+ t.target.value = e, a.current = e, s == null || s(t);
62
+ }, C = (t) => {
63
+ if (R == null || R(t), !o) return;
61
64
  if (t.preventDefault(), t.detail >= 2) {
62
- p(null), G((r) => r + 1);
65
+ p(null), Z((n) => n + 1);
63
66
  return;
64
67
  }
65
68
  const e = t.currentTarget.selectionStart ?? 0;
66
- p(M(e)), Q((r) => r + 1);
67
- }, h = (t) => {
68
- var r;
69
- l == null || l(t), E == null || E(!0);
70
- const e = ((r = s.current) == null ? void 0 : r.value) ?? "";
71
- a.current = b.test(e) ? e : typeof n == "string" ? n : "", b.test(a.current) && (L.current = a.current), V.current = !0, o && (p("day"), D("day"));
72
- }, F = (t) => {
69
+ p(j(e)), h((n) => n + 1);
70
+ }, tt = (t) => {
71
+ var n;
72
+ i == null || i(t), A == null || A(!0), U(!0);
73
+ const e = ((n = u.current) == null ? void 0 : n.value) ?? "";
74
+ a.current = S.test(e) ? e : typeof r == "string" ? r : "", S.test(a.current) && (k.current = a.current), _.current = !0, o && (p("day"), D("day"));
75
+ }, et = (t) => {
73
76
  var y;
74
- f == null || f(t), E == null || E(!1), V.current = !1, p(null);
75
- const e = ((y = s.current) == null ? void 0 : y.value) ?? "";
76
- if (b.test(e)) {
77
- a.current = e, L.current = e;
77
+ f == null || f(t), A == null || A(!1), U(!1), _.current = !1, p(null);
78
+ const e = ((y = u.current) == null ? void 0 : y.value) ?? "";
79
+ if (V) {
80
+ a.current = e;
78
81
  return;
79
82
  }
80
- const r = Y && e.trim() === "", c = L.current;
81
- if (!r && b.test(c)) {
83
+ if (S.test(e)) {
84
+ a.current = e, k.current = e;
85
+ return;
86
+ }
87
+ const n = J && e.trim() === "", c = k.current;
88
+ if (!n && S.test(c)) {
82
89
  a.current = c;
83
- const u = s.current;
90
+ const l = u.current;
84
91
  setTimeout(() => {
85
92
  var m;
86
- if (!u) return;
87
- const k = (m = Object.getOwnPropertyDescriptor(
93
+ if (!l) return;
94
+ const b = (m = Object.getOwnPropertyDescriptor(
88
95
  window.HTMLInputElement.prototype,
89
96
  "value"
90
97
  )) == null ? void 0 : m.set;
91
- k == null || k.call(u, c), u.dispatchEvent(new Event("input", { bubbles: !0 }));
98
+ b == null || b.call(l, c), l.dispatchEvent(new Event("input", { bubbles: !0 }));
92
99
  }, 0);
93
100
  return;
94
101
  }
95
102
  a.current = e;
96
- }, j = S(
103
+ }, N = E(
97
104
  (t, e) => {
98
- var k;
99
- V.current = !0;
100
- const r = s.current, c = (r == null ? void 0 : r.value) ?? "", y = b.test(a.current) ? a.current : b.test(c) ? c : "", u = et(y, t, e);
101
- if (a.current = u, L.current = u, R == null || R(), r) {
102
- const m = (k = Object.getOwnPropertyDescriptor(
105
+ var b;
106
+ _.current = !0;
107
+ const n = u.current, c = (n == null ? void 0 : n.value) ?? "", y = S.test(a.current) ? a.current : S.test(c) ? c : "", l = ut(y, t, e);
108
+ if (a.current = l, k.current = l, L == null || L(), n) {
109
+ const m = (b = Object.getOwnPropertyDescriptor(
103
110
  window.HTMLInputElement.prototype,
104
111
  "value"
105
- )) == null ? void 0 : k.set;
106
- m == null || m.call(r, u), r.dispatchEvent(new Event("input", { bubbles: !0 }));
107
- } else if (H) {
108
- const m = rt(u);
109
- m && H(m);
110
- } else i && i({
111
- target: { value: u },
112
- currentTarget: { value: u }
112
+ )) == null ? void 0 : b.set;
113
+ m == null || m.call(n, l), n.dispatchEvent(new Event("input", { bubbles: !0 }));
114
+ } else if (G) {
115
+ const m = it(l);
116
+ m && G(m);
117
+ } else s && s({
118
+ target: { value: l },
119
+ currentTarget: { value: l }
113
120
  });
114
121
  p(t), D(t);
115
122
  },
116
- [i, H, R, D, p]
117
- ), v = S(
123
+ [s, G, L, D, p]
124
+ ), H = E(
118
125
  (t) => {
119
- const e = s.current;
126
+ const e = u.current;
120
127
  if (!e || document.activeElement !== e) return;
121
128
  t.cancelable && t.preventDefault(), t.stopPropagation();
122
- const r = e.selectionStart ?? 0, c = g ?? M(r);
123
- j(c, t.deltaY < 0 ? 1 : -1);
129
+ const n = e.selectionStart ?? 0, c = g ?? j(n);
130
+ N(c, t.deltaY < 0 ? 1 : -1);
124
131
  },
125
- [g, j]
126
- ), K = S(
132
+ [g, N]
133
+ ), rt = E(
127
134
  (t) => {
128
135
  if (!o) {
129
136
  d == null || d(t);
@@ -131,14 +138,14 @@ const b = /^\d{2}\.\d{2}\.\d{4}$/, ct = (n, i) => {
131
138
  }
132
139
  if (t.key === "ArrowUp" || t.key === "ArrowDown") {
133
140
  t.preventDefault();
134
- const e = s.current;
141
+ const e = u.current;
135
142
  if (!e) return;
136
- const r = e.selectionStart ?? 0, c = g ?? M(r);
137
- j(c, t.key === "ArrowUp" ? 1 : -1);
143
+ const n = e.selectionStart ?? 0, c = g ?? j(n);
144
+ N(c, t.key === "ArrowUp" ? 1 : -1);
138
145
  return;
139
146
  }
140
147
  if (t.key === "Enter") {
141
- const e = s.current, r = (e == null ? void 0 : e.selectionStart) ?? 0, c = g ?? M(r);
148
+ const e = u.current, n = (e == null ? void 0 : e.selectionStart) ?? 0, c = g ?? j(n);
142
149
  if (c !== "year") {
143
150
  t.preventDefault();
144
151
  const y = c === "day" ? "month" : "year";
@@ -148,44 +155,44 @@ const b = /^\d{2}\.\d{2}\.\d{4}$/, ct = (n, i) => {
148
155
  }
149
156
  d == null || d(t);
150
157
  },
151
- [g, j, D, d, p, o]
152
- ), O = S(
158
+ [g, N, D, d, p, o]
159
+ ), $ = E(
153
160
  (t) => {
154
- const e = s.current;
161
+ const e = u.current;
155
162
  if (!e) return;
156
- const r = t.inputType === "insertText", c = t.inputType.startsWith("delete") && t.inputType !== "deleteByCut" && t.inputType !== "deleteByDrag", y = q.current;
157
- if (p(null), !(r || c) || !t.cancelable || !st(e, y)) return;
163
+ const n = t.inputType === "insertText", c = t.inputType.startsWith("delete") && t.inputType !== "deleteByCut" && t.inputType !== "deleteByDrag", y = M.current;
164
+ if (p(null), !(n || c) || !t.cancelable || !mt(e, y)) return;
158
165
  t.preventDefault();
159
- const u = r && /^\d$/.test(t.data ?? "");
160
- (u || c) && ct(e, u ? t.data ?? "" : "");
166
+ const l = n && /^\d$/.test(t.data ?? "");
167
+ (l || c) && pt(e, l ? t.data ?? "" : "");
161
168
  },
162
169
  [p]
163
170
  );
164
- return $(() => {
171
+ return q(() => {
165
172
  if (!o) return;
166
- const t = s.current;
173
+ const t = u.current;
167
174
  if (t)
168
- return t.addEventListener("wheel", v, { passive: !1 }), () => t.removeEventListener("wheel", v);
169
- }, [v, o]), $(() => {
175
+ return t.addEventListener("wheel", H, { passive: !1 }), () => t.removeEventListener("wheel", H);
176
+ }, [H, o]), q(() => {
170
177
  if (!o) return;
171
- const t = s.current;
178
+ const t = u.current;
172
179
  if (t)
173
- return t.addEventListener("beforeinput", O), () => t.removeEventListener("beforeinput", O);
174
- }, [O, o]), /* @__PURE__ */ P(
180
+ return t.addEventListener("beforeinput", $), () => t.removeEventListener("beforeinput", $);
181
+ }, [$, o]), /* @__PURE__ */ nt(
175
182
  "input",
176
183
  {
177
- ...w,
178
- value: n,
179
- ref: W,
184
+ ...B,
185
+ value: V && typeof r == "string" ? ft(Q ? r : r.replace(at, "")) : r,
186
+ ref: F,
180
187
  inputMode: "numeric",
181
- maxLength: 10,
182
- onChange: X,
183
- onKeyDown: K,
184
- onMouseUp: Z,
185
- onFocus: h,
186
- onBlur: F
188
+ maxLength: V ? 23 : 10,
189
+ onChange: K,
190
+ onKeyDown: rt,
191
+ onMouseUp: C,
192
+ onFocus: tt,
193
+ onBlur: et
187
194
  }
188
195
  );
189
196
  });
190
- ut.displayName = "MaskedDateInput";
191
- export { ut as MaskedDateInput$u };
197
+ dt.displayName = "MaskedDateInput";
198
+ export { dt as MaskedDateInput$u };
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnSettings.d.ts","sourceRoot":"","sources":["../../../src/components/ColumnSettings/ColumnSettings.tsx"],"names":[],"mappings":"AACA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,EAAE,EACxD,OAAO,EACP,OAAO,EACP,QAAQ,EACR,KAAK,EACL,aAAa,EACb,MAAM,EACN,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,QAAsB,EACtB,OAAmB,EACnB,KAAuC,EACvC,IAAgB,EAChB,WAAiC,EACjC,SAAiB,EACjB,KAAe,EACf,aAAmB,EACnB,SAAc,GACjB,EAAE,mBAAmB,CAAC,GAAG,CAAC,2CA0R1B"}
1
+ {"version":3,"file":"ColumnSettings.d.ts","sourceRoot":"","sources":["../../../src/components/ColumnSettings/ColumnSettings.tsx"],"names":[],"mappings":"AACA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAGlE;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,EAAE,EACxD,OAAO,EACP,OAAO,EACP,QAAQ,EACR,KAAK,EACL,aAAa,EACb,MAAM,EACN,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,QAAsB,EACtB,OAAmB,EACnB,KAAuC,EACvC,IAAgB,EAChB,WAAiC,EACjC,SAAiB,EACjB,KAAe,EACf,aAAmB,EACnB,SAAc,GACjB,EAAE,mBAAmB,CAAC,GAAG,CAAC,2CA0R1B"}
@@ -1,13 +1,14 @@
1
1
  import { jsxs as v, jsx as r, Fragment as re } from "react/jsx-runtime";
2
- import { useState as T, useRef as W, useId as ae, useEffect as V, useLayoutEffect as ce, Fragment as le } from "react";
2
+ import { useState as T, useRef as W, useEffect as V, useLayoutEffect as ae, Fragment as ce } from "react";
3
3
  /* empty css */
4
4
  /* empty css */
5
- import { Button$u as ie } from "../Button/Button.js";
6
- import { Tooltip$u as oe } from "../Tooltip/Tooltip.js";
7
- import { Icon$u as ue } from "../Icon/Icon.js";
5
+ import { Button$u as le } from "../Button/Button.js";
6
+ import { Tooltip$u as ie } from "../Tooltip/Tooltip.js";
7
+ import { Icon$u as oe } from "../Icon/Icon.js";
8
8
  import { Checkbox$u as A } from "../Checkbox/Checkbox.js";
9
+ import { useAutoId$u as ue } from "../../hooks/useAutoId.js";
9
10
  import { reconcileColumnOrder$u as de } from "../../vanilla/core/reconcileColumnOrder.js";
10
- function ke({
11
+ function Se({
11
12
  options: p,
12
13
  visible: N,
13
14
  onChange: Y,
@@ -27,14 +28,14 @@ function ke({
27
28
  maxListHeight: q = 320,
28
29
  className: ee = ""
29
30
  }) {
30
- const [i, F] = T(!1), [L, x] = T(0), [te, ne] = T(""), I = W(null), M = W(null), R = ae(), o = N instanceof Set ? N : new Set(N), m = y instanceof Set ? y : new Set(y), f = b instanceof Set ? b : new Set(b), $ = y !== void 0 && u !== void 0, h = b !== void 0 && d !== void 0, D = $ || h, c = E !== void 0, w = de(p.map((e) => e.key), j), U = new Map(p.map((e) => [e.key, e])), C = j !== void 0 || c ? w.map((e) => U.get(e)) : p, se = (e, n) => {
31
+ const [i, F] = T(!1), [L, x] = T(0), [te, ne] = T(""), I = W(null), M = W(null), R = ue(void 0, "u-column-settings-title"), o = N instanceof Set ? N : new Set(N), m = y instanceof Set ? y : new Set(y), f = b instanceof Set ? b : new Set(b), $ = y !== void 0 && u !== void 0, h = b !== void 0 && d !== void 0, D = $ || h, c = E !== void 0, g = de(p.map((e) => e.key), j), U = new Map(p.map((e) => [e.key, e])), C = j !== void 0 || c ? g.map((e) => U.get(e)) : p, se = (e, n) => {
31
32
  var a;
32
33
  if (!E) return;
33
- const t = w.indexOf(e);
34
- if (t < 0 || n < 0 || n >= w.length || t === n) return;
35
- const s = [...w];
34
+ const t = g.indexOf(e);
35
+ if (t < 0 || n < 0 || n >= g.length || t === n) return;
36
+ const s = [...g];
36
37
  s.splice(t, 1), s.splice(n, 0, e), E(s), ne("Колонка «" + ((a = U.get(e)) == null ? void 0 : a.label) + "»: позиция " + (n + 1) + " из " + s.length);
37
- }, X = (e, n) => se(e, w.indexOf(e) + n);
38
+ }, X = (e, n) => se(e, g.indexOf(e) + n);
38
39
  V(() => {
39
40
  if (!i) return;
40
41
  const e = (t) => {
@@ -50,10 +51,10 @@ function ke({
50
51
  const z = () => {
51
52
  const e = I.current, n = M.current;
52
53
  if (!e || !n) return;
53
- const t = e.getBoundingClientRect(), s = n.offsetWidth, a = B === "right" ? t.right - s : t.left, g = a + s, l = 8;
54
- a < l ? x(l - a) : g > window.innerWidth - l ? x(window.innerWidth - l - g) : x(0);
54
+ const t = e.getBoundingClientRect(), s = n.offsetWidth, a = B === "right" ? t.right - s : t.left, w = a + s, l = 8;
55
+ a < l ? x(l - a) : w > window.innerWidth - l ? x(window.innerWidth - l - w) : x(0);
55
56
  };
56
- ce(() => {
57
+ ae(() => {
57
58
  i ? z() : x(0);
58
59
  });
59
60
  const G = W(z);
@@ -92,18 +93,18 @@ function ke({
92
93
  if (a.has(e)) a.delete(e);
93
94
  else {
94
95
  a.add(e);
95
- const g = n === "left" ? f : m, l = n === "left" ? d : u;
96
- if (g.has(e) && l) {
97
- const Q = new Set(g);
96
+ const w = n === "left" ? f : m, l = n === "left" ? d : u;
97
+ if (w.has(e) && l) {
98
+ const Q = new Set(w);
98
99
  Q.delete(e), l(Q);
99
100
  }
100
101
  }
101
102
  t(a);
102
- }, O = (e, n) => S ? /* @__PURE__ */ r(oe, { tooltipText: n, portalOn: !0, children: e }) : e;
103
+ }, O = (e, n) => S ? /* @__PURE__ */ r(ie, { tooltipText: n, portalOn: !0, children: e }) : e;
103
104
  return /* @__PURE__ */ v("div", { className: `u-react-column-settings u-react-column-settings-${Z}${$ && h ? " u-react-column-settings-both-sides" : ""} ${ee}`.trim(), ref: I, children: [
104
105
  O(
105
106
  /* @__PURE__ */ r(
106
- ie,
107
+ le,
107
108
  {
108
109
  variant: "icon",
109
110
  icon: H,
@@ -190,7 +191,7 @@ function ke({
190
191
  }
191
192
  )
192
193
  ),
193
- c && /* @__PURE__ */ r("span", { className: "u-react-column-settings-order", children: [-1, 1].map((t) => /* @__PURE__ */ r(le, { children: O(/* @__PURE__ */ r(
194
+ c && /* @__PURE__ */ r("span", { className: "u-react-column-settings-order", children: [-1, 1].map((t) => /* @__PURE__ */ r(ce, { children: O(/* @__PURE__ */ r(
194
195
  "button",
195
196
  {
196
197
  type: "button",
@@ -198,7 +199,7 @@ function ke({
198
199
  title: S ? void 0 : t < 0 ? "Переместить выше (Alt+↑)" : "Переместить ниже (Alt+↓)",
199
200
  "aria-disabled": t < 0 ? n === 0 : n === C.length - 1,
200
201
  onClick: () => X(e.key, t),
201
- children: /* @__PURE__ */ r(ue, { name: t < 0 ? "up-arrow" : "down-arrow", size: "16px" })
202
+ children: /* @__PURE__ */ r(oe, { name: t < 0 ? "up-arrow" : "down-arrow", size: "16px" })
202
203
  }
203
204
  ), t < 0 ? "Переместить выше (Alt+↑)" : "Переместить ниже (Alt+↓)") }, t)) })
204
205
  ]
@@ -213,4 +214,4 @@ function ke({
213
214
  )
214
215
  ] });
215
216
  }
216
- export { ke as ColumnSettings$u };
217
+ export { Se as ColumnSettings$u };
@@ -1,4 +1,3 @@
1
- import './ConfirmModal.less';
2
1
 
3
2
  import type { ConfirmModalProperties } from './ConfirmModal.types';
4
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/ConfirmModal/ConfirmModal.tsx"],"names":[],"mappings":"AAGA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,4DAA4D,CAAC;AAEpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,yIAY1B,sBAAsB,4CAwBxB,CAAC"}
1
+ {"version":3,"file":"ConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/ConfirmModal/ConfirmModal.tsx"],"names":[],"mappings":"AAGA,OAAO,4DAA4D,CAAC;AAEpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,yIAY1B,sBAAsB,4CAwBxB,CAAC"}