@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.
- package/dist/badge/index.js +65 -2
- package/dist/badge/index.js.map +1 -0
- package/dist/barcode-scanner/index.js +18 -18
- package/dist/base-table/index.js +2 -2
- package/dist/button/index.js +1 -1
- package/dist/check-box/index.js +1 -1
- package/dist/chunks/{CalendarView-Dm55k0bN.js → CalendarView-CwbPJG2Y.js} +86 -86
- package/dist/chunks/{CalendarView-Dm55k0bN.js.map → CalendarView-CwbPJG2Y.js.map} +1 -1
- package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js → ImageViewerRuntime-DZpgxzF1.js} +25 -25
- package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js.map → ImageViewerRuntime-DZpgxzF1.js.map} +1 -1
- package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js → TextEditorLexicalClient-BRp8jHId.js} +354 -354
- package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js.map → TextEditorLexicalClient-BRp8jHId.js.map} +1 -1
- package/dist/chunks/{base-table-BWvKfI2W.js → base-table-BHmboNzl.js} +138 -138
- package/dist/chunks/{base-table-BWvKfI2W.js.map → base-table-BHmboNzl.js.map} +1 -1
- package/dist/chunks/{button-DF21yxVp.js → button-D7GAU2Wa.js} +20 -20
- package/dist/chunks/{button-DF21yxVp.js.map → button-D7GAU2Wa.js.map} +1 -1
- package/dist/chunks/{check-box-CZyhzmR0.js → check-box-D_Y6iIWv.js} +19 -19
- package/dist/chunks/{check-box-CZyhzmR0.js.map → check-box-D_Y6iIWv.js.map} +1 -1
- package/dist/chunks/{context-menu-DgvXGCuI.js → context-menu-BQePxRpu.js} +159 -159
- package/dist/chunks/{context-menu-DgvXGCuI.js.map → context-menu-BQePxRpu.js.map} +1 -1
- package/dist/chunks/{date-input-D7aBsPJc.js → date-input-Crijdmmq.js} +67 -67
- package/dist/chunks/{date-input-D7aBsPJc.js.map → date-input-Crijdmmq.js.map} +1 -1
- package/dist/chunks/{date-range-preset-select-BLnY47cv.js → date-range-preset-select-CyzGMvVp.js} +6 -6
- package/dist/chunks/{date-range-preset-select-BLnY47cv.js.map → date-range-preset-select-CyzGMvVp.js.map} +1 -1
- package/dist/chunks/{dialog-1Z1zCNCe.js → dialog-BcQGVNbu.js} +13 -13
- package/dist/chunks/{dialog-1Z1zCNCe.js.map → dialog-BcQGVNbu.js.map} +1 -1
- package/dist/chunks/{flex-C7njxZ74.js → flex-DtXK7OM4.js} +29 -29
- package/dist/chunks/{flex-C7njxZ74.js.map → flex-DtXK7OM4.js.map} +1 -1
- package/dist/chunks/{floating-arrow-DPKwJfww.js → floating-arrow-DKUKx2ZQ.js} +7 -7
- package/dist/chunks/{floating-arrow-DPKwJfww.js.map → floating-arrow-DKUKx2ZQ.js.map} +1 -1
- package/dist/chunks/{input-DSPKgiCK.js → input-CuRK9Vbz.js} +78 -78
- package/dist/chunks/{input-DSPKgiCK.js.map → input-CuRK9Vbz.js.map} +1 -1
- package/dist/chunks/{input-files-tIS17-zX.js → input-files-B8j6Pb_M.js} +31 -31
- package/dist/chunks/{input-files-tIS17-zX.js.map → input-files-B8j6Pb_M.js.map} +1 -1
- package/dist/chunks/{misc-DeGboAt-.js → misc-CGQOXXCy.js} +110 -110
- package/dist/chunks/{misc-DeGboAt-.js.map → misc-CGQOXXCy.js.map} +1 -1
- package/dist/chunks/{modal-dplfAaER.js → modal-febBsMyR.js} +58 -58
- package/dist/chunks/{modal-dplfAaER.js.map → modal-febBsMyR.js.map} +1 -1
- package/dist/chunks/{picker-lvm82d0A.js → picker-BA6okKnz.js} +91 -91
- package/dist/chunks/{picker-lvm82d0A.js.map → picker-BA6okKnz.js.map} +1 -1
- package/dist/chunks/popover-yl5DVe06.js +245 -0
- package/dist/chunks/{popover-Bne-Ljbs.js.map → popover-yl5DVe06.js.map} +1 -1
- package/dist/chunks/radio-group-CW-K1n9c.js +125 -0
- package/dist/chunks/{radio-group-sSnlYjAX.js.map → radio-group-CW-K1n9c.js.map} +1 -1
- package/dist/chunks/select-DblNSc5H.js +363 -0
- package/dist/chunks/{select-aTGupQan.js.map → select-DblNSc5H.js.map} +1 -1
- package/dist/chunks/{separator-B72Aq-6a.js → separator-CIqnk2z9.js} +2 -2
- package/dist/chunks/{separator-B72Aq-6a.js.map → separator-CIqnk2z9.js.map} +1 -1
- package/dist/chunks/{sortable-BKIwlqhI.js → sortable-CQmMHAF8.js} +38 -38
- package/dist/chunks/{sortable-BKIwlqhI.js.map → sortable-CQmMHAF8.js.map} +1 -1
- package/dist/chunks/{table-DxoSOvQK.js → table-BnvjPaE1.js} +18 -18
- package/dist/chunks/{table-DxoSOvQK.js.map → table-BnvjPaE1.js.map} +1 -1
- package/dist/chunks/{table-column-interactions-DzEvVuXe.js → table-column-interactions-Do8LFtiv.js} +20 -20
- package/dist/chunks/{table-column-interactions-DzEvVuXe.js.map → table-column-interactions-Do8LFtiv.js.map} +1 -1
- package/dist/chunks/{types-D9Wj9wrg.js → types-CxXyru6U.js} +21 -21
- package/dist/chunks/{types-D9Wj9wrg.js.map → types-CxXyru6U.js.map} +1 -1
- package/dist/chunks/{useODataSelectBase-DR4PrY1j.js → useODataSelectBase-DwR4Lfv-.js} +5 -5
- package/dist/chunks/{useODataSelectBase-DR4PrY1j.js.map → useODataSelectBase-DwR4Lfv-.js.map} +1 -1
- package/dist/chunks/{wheel-picker-FS58cRsQ.js → wheel-picker-DUHGy7wE.js} +23 -23
- package/dist/chunks/{wheel-picker-FS58cRsQ.js.map → wheel-picker-DUHGy7wE.js.map} +1 -1
- package/dist/context-menu/index.js +1 -1
- package/dist/date-input/index.js +2 -2
- package/dist/date-range-preset-select/index.js +1 -1
- package/dist/date-time-input/index.js +122 -122
- package/dist/date-time-input/index.js.map +1 -1
- package/dist/detail/index.js +22 -22
- package/dist/dialog/index.js +1 -1
- package/dist/disclosure/index.js +9 -9
- package/dist/drop-zone/index.js +21 -21
- package/dist/errors/index.js +50 -50
- package/dist/expandable-action-panel/index.js +24 -24
- package/dist/flex/index.js +1 -1
- package/dist/flex/useFlexClasses.d.ts +1 -1
- package/dist/floating-arrow/index.js +1 -1
- package/dist/fullscreen-portal/index.js +8 -8
- package/dist/image/index.js +119 -119
- package/dist/input/index.js +1 -1
- package/dist/input-date-time/index.js +55 -55
- package/dist/input-file/index.js +16 -16
- package/dist/input-files/index.js +1 -1
- package/dist/input-image/index.js +17 -17
- package/dist/input-search/index.js +30 -2
- package/dist/input-search/index.js.map +1 -0
- package/dist/layout-picker/index.js +93 -93
- package/dist/layout-picker/index.js.map +1 -1
- package/dist/list/index.js +39 -39
- package/dist/listbox/index.js +33 -33
- package/dist/misc/index.js +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/multi-select/index.js +466 -2
- package/dist/multi-select/index.js.map +1 -0
- package/dist/notifications/index.js +45 -45
- package/dist/option/index.js +30 -30
- package/dist/period-select/index.js +7 -7
- package/dist/picker/index.js +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/preset-range-date-input/index.js +10 -10
- package/dist/preset-select/index.js +1 -1
- package/dist/radio-button/index.js +9 -9
- package/dist/radio-group/index.js +1 -1
- package/dist/select/index.js +1 -1
- package/dist/separator/index.js +1 -1
- package/dist/simple-table/index.js +5 -5
- package/dist/slider/index.js +82 -82
- package/dist/slider/index.js.map +1 -1
- package/dist/sortable/index.js +1 -1
- package/dist/splitter/index.js +55 -55
- package/dist/state-select/index.js +17 -17
- package/dist/styles.css +1 -1
- package/dist/switch/index.js +18 -18
- package/dist/table/index.js +1 -1
- package/dist/table-column-interactions/index.js +1 -1
- package/dist/table-editor/index.js +99 -99
- package/dist/table-sorting/index.js +13 -13
- package/dist/tabs/index.js +83 -83
- package/dist/tag-input/index.js +58 -58
- package/dist/tag-input/index.js.map +1 -1
- package/dist/text/index.js +18 -18
- package/dist/text-editor/index.js +3 -3
- package/dist/textarea/index.js +1 -1
- package/dist/three-scene/index.js +7 -7
- package/dist/toggle/index.js +20 -20
- package/dist/toolbar/index.js +16 -16
- package/dist/tree/index.js +24 -24
- package/dist/tree-select/index.js +189 -189
- package/dist/tree-select/index.js.map +1 -1
- package/dist/tree-table/index.js +33 -33
- package/dist/tree-table/index.js.map +1 -1
- package/dist/wheel-picker/index.js +1 -1
- package/package.json +1 -5
- package/storybook-static/project.json +1 -1
- package/dist/advanced-search/index.d.ts +0 -3
- package/dist/advanced-search/index.d.ts.map +0 -1
- package/dist/advanced-search/index.js +0 -399
- package/dist/advanced-search/index.js.map +0 -1
- package/dist/advanced-search/lib/index.d.ts +0 -2
- package/dist/advanced-search/lib/index.d.ts.map +0 -1
- package/dist/advanced-search/lib/searchParts.d.ts +0 -3
- package/dist/advanced-search/lib/searchParts.d.ts.map +0 -1
- package/dist/advanced-search/model/index.d.ts +0 -5
- package/dist/advanced-search/model/index.d.ts.map +0 -1
- package/dist/advanced-search/model/types.d.ts +0 -55
- package/dist/advanced-search/model/types.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearch.d.ts +0 -11
- package/dist/advanced-search/model/useAdvancedSearch.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts +0 -6
- package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts +0 -13
- package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchModal.d.ts +0 -23
- package/dist/advanced-search/ui/AdvancedSearchModal.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts +0 -16
- package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts +0 -9
- package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts +0 -9
- package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts.map +0 -1
- package/dist/advanced-search/ui/index.d.ts +0 -2
- package/dist/advanced-search/ui/index.d.ts.map +0 -1
- package/dist/chunks/badge-6mXO9BWP.js +0 -65
- package/dist/chunks/badge-6mXO9BWP.js.map +0 -1
- package/dist/chunks/input-search-Cat4c7SM.js +0 -30
- package/dist/chunks/input-search-Cat4c7SM.js.map +0 -1
- package/dist/chunks/multi-select-BZ9N6Dal.js +0 -466
- package/dist/chunks/multi-select-BZ9N6Dal.js.map +0 -1
- package/dist/chunks/popover-Bne-Ljbs.js +0 -245
- package/dist/chunks/radio-group-sSnlYjAX.js +0 -125
- package/dist/chunks/select-aTGupQan.js +0 -363
package/dist/tabs/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as e } from "../chunks/ui.module-oRwY3Zli.js";
|
|
2
2
|
import { n as t } from "../chunks/uiClasses-CQj47jkF.js";
|
|
3
|
-
import { d as n, h as r, l as i } from "../chunks/misc-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { d as n, h as r, l as i } from "../chunks/misc-CGQOXXCy.js";
|
|
4
|
+
import { cn as a, getRovingFocusTargetIndex as o } from "@ryuzaki13/react-foundation-lib/utils";
|
|
5
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import { Children as u, isValidElement as d, useId as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
7
7
|
//#region src/tabs/lib/tabs.ts
|
|
8
8
|
function g(e) {
|
|
9
9
|
return e.find((e) => !e.disabled)?.id ?? null;
|
|
@@ -19,8 +19,8 @@ function y({ mountStrategy: e, isSelected: t, isVisited: n }) {
|
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/tabs/model/useTabsState.ts
|
|
22
|
-
function b({ items: e, value: t, defaultValue: n, onValueChange: r, orientation: i = "horizontal", activationMode: a = "automatic", loop:
|
|
23
|
-
let
|
|
22
|
+
function b({ items: e, value: t, defaultValue: n, onValueChange: r, orientation: i = "horizontal", activationMode: a = "automatic", loop: s = !0 }) {
|
|
23
|
+
let c = t !== void 0, l = p(() => v(e), [e]), u = l[0]?.id ?? null, [d, g] = h(() => _(e, n)), [y, b] = h(() => _(e, t ?? n)), x = _(e, t ?? n), [S, C] = h(() => x ? /* @__PURE__ */ new Set([x]) : /* @__PURE__ */ new Set()), w = f(), T = m({}), E = _(e, c ? t : d), D = _(e, y) ?? E ?? u, O = p(() => {
|
|
24
24
|
if (!E || S.has(E)) return S;
|
|
25
25
|
let e = new Set(S);
|
|
26
26
|
return e.add(E), e;
|
|
@@ -30,25 +30,25 @@ function b({ items: e, value: t, defaultValue: n, onValueChange: r, orientation:
|
|
|
30
30
|
if (e.has(n)) return e;
|
|
31
31
|
let t = new Set(e);
|
|
32
32
|
return t.add(n), t;
|
|
33
|
-
}),
|
|
33
|
+
}), c || g(n), r?.(n));
|
|
34
34
|
}, A = (e) => {
|
|
35
35
|
T.current[e]?.focus();
|
|
36
36
|
}, j = (e) => {
|
|
37
|
-
if (
|
|
38
|
-
let t = Math.max(0,
|
|
37
|
+
if (l.length < 2) return;
|
|
38
|
+
let t = Math.max(0, l.findIndex((e) => e.id === (D ?? E ?? u))), n = o({
|
|
39
39
|
currentIndex: t,
|
|
40
|
-
itemCount:
|
|
40
|
+
itemCount: l.length,
|
|
41
41
|
key: e.key,
|
|
42
42
|
orientation: i,
|
|
43
|
-
wrap:
|
|
43
|
+
wrap: s
|
|
44
44
|
});
|
|
45
45
|
if (n === null) return;
|
|
46
46
|
e.preventDefault();
|
|
47
|
-
let r =
|
|
47
|
+
let r = l[n]?.id;
|
|
48
48
|
r && (b(r), A(r), a === "automatic" && k(r));
|
|
49
49
|
}, M = (e) => {
|
|
50
50
|
let t = e.relatedTarget;
|
|
51
|
-
t instanceof Node && e.currentTarget.contains(t) || b(E ??
|
|
51
|
+
t instanceof Node && e.currentTarget.contains(t) || b(E ?? u);
|
|
52
52
|
}, N = (e) => `${w}-tab-${e}`, P = (e) => `${w}-panel-${e}`;
|
|
53
53
|
return {
|
|
54
54
|
activationMode: a,
|
|
@@ -99,28 +99,28 @@ var x = {
|
|
|
99
99
|
};
|
|
100
100
|
//#endregion
|
|
101
101
|
//#region src/tabs/ui/TabsLoadingState.tsx
|
|
102
|
-
function S({ containerClassName: e, tabListClassName: t, panelsClassName: n, panelClassName: i, panelBodyClassName:
|
|
103
|
-
return /* @__PURE__ */
|
|
102
|
+
function S({ containerClassName: e, tabListClassName: t, panelsClassName: n, panelClassName: i, panelBodyClassName: o, loadingText: s }) {
|
|
103
|
+
return /* @__PURE__ */ l("div", {
|
|
104
104
|
className: e,
|
|
105
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ c("div", {
|
|
106
106
|
className: t,
|
|
107
107
|
"aria-hidden": "true",
|
|
108
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ c("button", {
|
|
109
109
|
type: "button",
|
|
110
110
|
disabled: !0,
|
|
111
111
|
"data-disabled": "",
|
|
112
|
-
className:
|
|
112
|
+
className: a(x.tab, "skeletonLine"),
|
|
113
113
|
children: "Загрузка..."
|
|
114
114
|
})
|
|
115
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ c("div", {
|
|
116
116
|
className: n,
|
|
117
117
|
"aria-busy": "true",
|
|
118
|
-
children: /* @__PURE__ */
|
|
118
|
+
children: /* @__PURE__ */ c("div", {
|
|
119
119
|
className: i,
|
|
120
|
-
children: /* @__PURE__ */
|
|
121
|
-
className:
|
|
122
|
-
children: /* @__PURE__ */
|
|
123
|
-
text:
|
|
120
|
+
children: /* @__PURE__ */ c("div", {
|
|
121
|
+
className: o,
|
|
122
|
+
children: /* @__PURE__ */ c(r, {
|
|
123
|
+
text: s,
|
|
124
124
|
className: "radiusSm"
|
|
125
125
|
})
|
|
126
126
|
})
|
|
@@ -131,15 +131,15 @@ function S({ containerClassName: e, tabListClassName: t, panelsClassName: n, pan
|
|
|
131
131
|
//#endregion
|
|
132
132
|
//#region src/tabs/ui/TabsNoDataState.tsx
|
|
133
133
|
function C({ containerClassName: e, panelsClassName: t, panelClassName: r, panelBodyClassName: i }) {
|
|
134
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ c("div", {
|
|
135
135
|
className: e,
|
|
136
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ c("div", {
|
|
137
137
|
className: t,
|
|
138
|
-
children: /* @__PURE__ */
|
|
138
|
+
children: /* @__PURE__ */ c("div", {
|
|
139
139
|
className: r,
|
|
140
|
-
children: /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ c("div", {
|
|
141
141
|
className: i,
|
|
142
|
-
children: /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ c(n, { className: "radiusSm" })
|
|
143
143
|
})
|
|
144
144
|
})
|
|
145
145
|
})
|
|
@@ -148,7 +148,7 @@ function C({ containerClassName: e, panelsClassName: t, panelClassName: r, panel
|
|
|
148
148
|
//#endregion
|
|
149
149
|
//#region src/tabs/ui/TabsPanel.tsx
|
|
150
150
|
function w({ tabId: e, isSelected: t, className: n, getTabElementId: r, getPanelElementId: i, children: a }) {
|
|
151
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ c("div", {
|
|
152
152
|
role: "tabpanel",
|
|
153
153
|
id: i(e),
|
|
154
154
|
"aria-labelledby": r(e),
|
|
@@ -159,73 +159,73 @@ function w({ tabId: e, isSelected: t, className: n, getTabElementId: r, getPanel
|
|
|
159
159
|
}
|
|
160
160
|
//#endregion
|
|
161
161
|
//#region src/tabs/ui/TabsTabList.tsx
|
|
162
|
-
function T({ items: e, state: t, className: n, ariaLabel: r, ariaLabelledBy:
|
|
163
|
-
return /* @__PURE__ */
|
|
162
|
+
function T({ items: e, state: t, className: n, ariaLabel: r, ariaLabelledBy: o }) {
|
|
163
|
+
return /* @__PURE__ */ c("div", {
|
|
164
164
|
className: n,
|
|
165
165
|
role: "tablist",
|
|
166
166
|
"aria-orientation": t.orientation,
|
|
167
167
|
"aria-label": r,
|
|
168
|
-
"aria-labelledby":
|
|
168
|
+
"aria-labelledby": o,
|
|
169
169
|
onKeyDown: t.onTabListKeyDown,
|
|
170
170
|
onBlur: t.onTabListBlur,
|
|
171
|
-
children: ((e) => t.orientation === "horizontal" ? /* @__PURE__ */
|
|
171
|
+
children: ((e) => t.orientation === "horizontal" ? /* @__PURE__ */ c(i, { children: e }) : /* @__PURE__ */ c(s, { children: e }))(e.map((e) => /* @__PURE__ */ c("button", {
|
|
172
172
|
...t.getTabButtonProps(e),
|
|
173
173
|
"data-ui": "tabs-tab",
|
|
174
174
|
"data-action": "select-tab",
|
|
175
|
-
className:
|
|
175
|
+
className: a(x.tab, "textWrap", e.id === t.selectedTabId && x.selected),
|
|
176
176
|
children: e.title
|
|
177
177
|
}, e.id)))
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region src/tabs/ui/TabsBox.tsx
|
|
182
|
-
function E({ items: n, value: r, defaultValue: i, onValueChange:
|
|
182
|
+
function E({ items: n, value: r, defaultValue: i, onValueChange: o, className: s, isLoading: u, loadingText: d, orientation: f = "horizontal", activationMode: p = "automatic", mountStrategy: m = "unmount", loop: h = !0, tone: g = "primary", clean: _ = !1, "aria-label": v, "aria-labelledby": E }) {
|
|
183
183
|
let D = b({
|
|
184
184
|
items: n,
|
|
185
185
|
value: r,
|
|
186
186
|
defaultValue: i,
|
|
187
|
-
onValueChange:
|
|
188
|
-
orientation:
|
|
189
|
-
activationMode:
|
|
190
|
-
loop:
|
|
191
|
-
}), O =
|
|
192
|
-
return
|
|
187
|
+
onValueChange: o,
|
|
188
|
+
orientation: f,
|
|
189
|
+
activationMode: p,
|
|
190
|
+
loop: h
|
|
191
|
+
}), O = a(x.tabsContainer, _ ? x.clean : e.uiFilledPanel, x[f], t(g), s), k = x.tabs, A = a(x.panels, x.panelScrollable, "scrollable overscroll"), j = x.panel, M = x.panelBody;
|
|
192
|
+
return u ? /* @__PURE__ */ c(S, {
|
|
193
193
|
containerClassName: O,
|
|
194
194
|
tabListClassName: k,
|
|
195
195
|
panelsClassName: A,
|
|
196
196
|
panelClassName: j,
|
|
197
197
|
panelBodyClassName: M,
|
|
198
|
-
loadingText:
|
|
199
|
-
}) : n.length ? /* @__PURE__ */
|
|
198
|
+
loadingText: d
|
|
199
|
+
}) : n.length ? /* @__PURE__ */ l("div", {
|
|
200
200
|
className: O,
|
|
201
|
-
children: [/* @__PURE__ */
|
|
201
|
+
children: [/* @__PURE__ */ c(T, {
|
|
202
202
|
items: n,
|
|
203
203
|
state: D,
|
|
204
204
|
className: k,
|
|
205
205
|
ariaLabel: v,
|
|
206
206
|
ariaLabelledBy: E
|
|
207
|
-
}), /* @__PURE__ */
|
|
207
|
+
}), /* @__PURE__ */ c("div", {
|
|
208
208
|
className: A,
|
|
209
209
|
children: n.map((e) => {
|
|
210
210
|
let t = e.id === D.selectedTabId;
|
|
211
211
|
return y({
|
|
212
|
-
mountStrategy:
|
|
212
|
+
mountStrategy: m,
|
|
213
213
|
isSelected: t,
|
|
214
214
|
isVisited: D.isVisited(e.id)
|
|
215
|
-
}) ? /* @__PURE__ */
|
|
215
|
+
}) ? /* @__PURE__ */ c(w, {
|
|
216
216
|
tabId: e.id,
|
|
217
217
|
isSelected: t,
|
|
218
218
|
className: j,
|
|
219
219
|
getTabElementId: D.getTabElementId,
|
|
220
220
|
getPanelElementId: D.getPanelElementId,
|
|
221
|
-
children: /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ c("div", {
|
|
222
222
|
className: M,
|
|
223
223
|
children: e.content
|
|
224
224
|
})
|
|
225
225
|
}, e.id) : null;
|
|
226
226
|
})
|
|
227
227
|
})]
|
|
228
|
-
}) : /* @__PURE__ */
|
|
228
|
+
}) : /* @__PURE__ */ c(C, {
|
|
229
229
|
containerClassName: O,
|
|
230
230
|
panelsClassName: A,
|
|
231
231
|
panelClassName: j,
|
|
@@ -248,41 +248,41 @@ function j(e) {
|
|
|
248
248
|
return null;
|
|
249
249
|
}
|
|
250
250
|
function M(e, t) {
|
|
251
|
-
return
|
|
251
|
+
return d(e) && j(e) === t;
|
|
252
252
|
}
|
|
253
253
|
function N({ children: e }) {
|
|
254
|
-
return /* @__PURE__ */
|
|
254
|
+
return /* @__PURE__ */ c(s, { children: e });
|
|
255
255
|
}
|
|
256
256
|
N.displayName = D;
|
|
257
257
|
function P({ children: e }) {
|
|
258
|
-
return /* @__PURE__ */
|
|
258
|
+
return /* @__PURE__ */ c(s, { children: e });
|
|
259
259
|
}
|
|
260
260
|
P.displayName = O;
|
|
261
261
|
function F({ children: e }) {
|
|
262
|
-
return /* @__PURE__ */
|
|
262
|
+
return /* @__PURE__ */ c(s, { children: e });
|
|
263
263
|
}
|
|
264
264
|
F.displayName = k;
|
|
265
265
|
function I({ children: e }) {
|
|
266
|
-
return /* @__PURE__ */
|
|
266
|
+
return /* @__PURE__ */ c(s, { children: e });
|
|
267
267
|
}
|
|
268
268
|
I.displayName = A;
|
|
269
269
|
function L(e, t) {
|
|
270
270
|
let n = null, r = null, i = null;
|
|
271
|
-
for (let
|
|
272
|
-
if (!
|
|
273
|
-
if (M(
|
|
271
|
+
for (let a of u.toArray(e)) {
|
|
272
|
+
if (!d(a)) throw Error(`TabsLayout.Tab "${t}" поддерживает только дочерние элементы TabsLayout.Toolbar, TabsLayout.Content и TabsLayout.Footer.`);
|
|
273
|
+
if (M(a, O)) {
|
|
274
274
|
if (n) throw Error(`TabsLayout.Tab "${t}" содержит более одного блока TabsLayout.Toolbar.`);
|
|
275
|
-
n =
|
|
275
|
+
n = a.props;
|
|
276
276
|
continue;
|
|
277
277
|
}
|
|
278
|
-
if (M(
|
|
278
|
+
if (M(a, k)) {
|
|
279
279
|
if (r) throw Error(`TabsLayout.Tab "${t}" содержит более одного блока TabsLayout.Content.`);
|
|
280
|
-
r =
|
|
280
|
+
r = a.props;
|
|
281
281
|
continue;
|
|
282
282
|
}
|
|
283
|
-
if (M(
|
|
283
|
+
if (M(a, A)) {
|
|
284
284
|
if (i) throw Error(`TabsLayout.Tab "${t}" содержит более одного блока TabsLayout.Footer.`);
|
|
285
|
-
i =
|
|
285
|
+
i = a.props;
|
|
286
286
|
continue;
|
|
287
287
|
}
|
|
288
288
|
throw Error(`TabsLayout.Tab "${t}" поддерживает только дочерние элементы TabsLayout.Toolbar, TabsLayout.Content и TabsLayout.Footer.`);
|
|
@@ -295,7 +295,7 @@ function L(e, t) {
|
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
297
|
function R(e) {
|
|
298
|
-
return
|
|
298
|
+
return u.toArray(e).map((e) => {
|
|
299
299
|
if (!M(e, D)) throw Error("TabsLayout принимает только дочерние элементы TabsLayout.Tab.");
|
|
300
300
|
return {
|
|
301
301
|
id: e.props.id,
|
|
@@ -305,54 +305,54 @@ function R(e) {
|
|
|
305
305
|
};
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
|
-
var z = ({ children: n, value: r, defaultValue: i, onValueChange:
|
|
309
|
-
let S =
|
|
308
|
+
var z = ({ children: n, value: r, defaultValue: i, onValueChange: o, className: s, orientation: u = "horizontal", activationMode: d = "manual", mountStrategy: f = "lazy", loop: m = !0, tone: h = "primary", clean: g = !1, "aria-label": _, "aria-labelledby": v }) => {
|
|
309
|
+
let S = p(() => R(n), [n]), C = b({
|
|
310
310
|
items: S,
|
|
311
311
|
value: r,
|
|
312
312
|
defaultValue: i,
|
|
313
|
-
onValueChange:
|
|
314
|
-
orientation:
|
|
315
|
-
activationMode:
|
|
316
|
-
loop:
|
|
317
|
-
}), E =
|
|
318
|
-
return /* @__PURE__ */
|
|
313
|
+
onValueChange: o,
|
|
314
|
+
orientation: u,
|
|
315
|
+
activationMode: d,
|
|
316
|
+
loop: m
|
|
317
|
+
}), E = a(x.tabsContainer, g ? x.clean : e.uiFilledPanel, x[u], t(h), s), D = a(x.panels, x.layoutPanels);
|
|
318
|
+
return /* @__PURE__ */ l("div", {
|
|
319
319
|
className: E,
|
|
320
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ c(T, {
|
|
321
321
|
items: S,
|
|
322
322
|
state: C,
|
|
323
323
|
className: x.tabs,
|
|
324
324
|
ariaLabel: _,
|
|
325
325
|
ariaLabelledBy: v
|
|
326
|
-
}), /* @__PURE__ */
|
|
326
|
+
}), /* @__PURE__ */ c("div", {
|
|
327
327
|
className: D,
|
|
328
328
|
children: S.map((e) => {
|
|
329
329
|
let t = e.id === C.selectedTabId;
|
|
330
330
|
if (!y({
|
|
331
|
-
mountStrategy:
|
|
331
|
+
mountStrategy: f,
|
|
332
332
|
isSelected: t,
|
|
333
333
|
isVisited: C.isVisited(e.id)
|
|
334
334
|
})) return null;
|
|
335
335
|
let n = `${e.toolbar ? "auto " : ""}minmax(0, 1fr)${e.footer ? " auto" : ""}`;
|
|
336
|
-
return /* @__PURE__ */
|
|
336
|
+
return /* @__PURE__ */ c(w, {
|
|
337
337
|
tabId: e.id,
|
|
338
338
|
isSelected: t,
|
|
339
339
|
className: x.panel,
|
|
340
340
|
getTabElementId: C.getTabElementId,
|
|
341
341
|
getPanelElementId: C.getPanelElementId,
|
|
342
|
-
children: /* @__PURE__ */
|
|
342
|
+
children: /* @__PURE__ */ l("div", {
|
|
343
343
|
className: x.layoutPanel,
|
|
344
344
|
style: { gridTemplateRows: n },
|
|
345
345
|
children: [
|
|
346
|
-
e.toolbar ? /* @__PURE__ */
|
|
347
|
-
className:
|
|
346
|
+
e.toolbar ? /* @__PURE__ */ c("div", {
|
|
347
|
+
className: a(x.layoutSection, e.toolbar.className),
|
|
348
348
|
children: e.toolbar.children
|
|
349
349
|
}) : null,
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
className:
|
|
350
|
+
/* @__PURE__ */ c("div", {
|
|
351
|
+
className: a(x.layoutSection, x.layoutContent, e.content.className),
|
|
352
352
|
children: e.content.children
|
|
353
353
|
}),
|
|
354
|
-
e.footer ? /* @__PURE__ */
|
|
355
|
-
className:
|
|
354
|
+
e.footer ? /* @__PURE__ */ c("div", {
|
|
355
|
+
className: a(x.layoutSection, e.footer.className),
|
|
356
356
|
children: e.footer.children
|
|
357
357
|
}) : null
|
|
358
358
|
]
|
package/dist/tag-input/index.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { t as e } from "../chunks/ui.module-oRwY3Zli.js";
|
|
2
|
-
import { c as t, d as n } from "../chunks/input-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { jsx as
|
|
6
|
-
import {
|
|
2
|
+
import { c as t, d as n } from "../chunks/input-CuRK9Vbz.js";
|
|
3
|
+
import { cn as r } from "@ryuzaki13/react-foundation-lib/utils";
|
|
4
|
+
import { XIcon as i } from "lucide-react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { useImperativeHandle as s, useRef as c, useState as l } from "react";
|
|
7
7
|
//#region src/tag-input/lib/joinTagInputAriaIds.ts
|
|
8
|
-
function
|
|
8
|
+
function u(...e) {
|
|
9
9
|
return e.filter(Boolean).join(" ") || void 0;
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/tag-input/lib/tagInputDefaults.ts
|
|
13
|
-
function
|
|
13
|
+
function ee(e) {
|
|
14
14
|
return e.trim();
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function te(e) {
|
|
17
17
|
return e;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function d(e) {
|
|
20
20
|
return `Удалить тег «${e}»`;
|
|
21
21
|
}
|
|
22
|
-
var
|
|
22
|
+
var f = {
|
|
23
23
|
control: "AoFB3K",
|
|
24
24
|
tagList: "PvaUEA",
|
|
25
25
|
tag: "FZ-xEM",
|
|
26
26
|
tagText: "-RCqfG",
|
|
27
27
|
removeButton: "ggY643",
|
|
28
28
|
input: "hiZq-y"
|
|
29
|
-
},
|
|
30
|
-
function
|
|
31
|
-
let B =
|
|
32
|
-
id:
|
|
33
|
-
hasLabel:
|
|
34
|
-
hasDescription: !!
|
|
29
|
+
}, p = /[,\r\n]/, m = /[,\r\n]+/;
|
|
30
|
+
function h({ ref: h, value: g, onChange: _, label: v, description: y, placeholder: ne, size: b, disabled: x, readOnly: S = !1, error: C, onClearError: w, maxTags: T, normalizeTag: E = ee, getTagKey: D = te, addOnBlur: O = !0, getRemoveButtonAriaLabel: k = d, tokensAriaLabel: re = "Добавленные теги", inputClassName: ie, className: ae, id: oe, name: A, form: j, required: se, maxLength: M, onKeyDown: ce, onPaste: N, onBlur: P, onCompositionStart: F, onCompositionEnd: I, "aria-describedby": L, "aria-labelledby": R, ...z }) {
|
|
31
|
+
let B = c(null), V = c(null), H = c(!1), [U, W] = l(""), [le, G] = l(""), { controlId: K, labelId: q, descriptionId: ue, errorId: de, describedBy: fe } = n({
|
|
32
|
+
id: oe,
|
|
33
|
+
hasLabel: v != null,
|
|
34
|
+
hasDescription: !!y,
|
|
35
35
|
hasError: !!C
|
|
36
|
-
}), J = T === void 0 ? Infinity : Math.max(0, Math.floor(T)), Y = x || S, X =
|
|
37
|
-
|
|
36
|
+
}), J = T === void 0 ? Infinity : Math.max(0, Math.floor(T)), Y = x || S, X = u(fe, L), pe = u(q, R);
|
|
37
|
+
s(h, () => {
|
|
38
38
|
let e = B.current;
|
|
39
39
|
if (!e) throw Error("TagInput: внутренний input недоступен при создании imperative handle.");
|
|
40
40
|
return e;
|
|
@@ -42,11 +42,11 @@ function m({ ref: m, value: h, onChange: g, label: _, description: v, placeholde
|
|
|
42
42
|
let Z = (e) => {
|
|
43
43
|
if (Y) return;
|
|
44
44
|
w?.();
|
|
45
|
-
let t = [...
|
|
45
|
+
let t = [...g], n = new Set(t.map((e) => D(e))), r = [], i = 0, a = !1;
|
|
46
46
|
for (let o of e) {
|
|
47
47
|
let e = E(o);
|
|
48
48
|
if (!e) continue;
|
|
49
|
-
if (
|
|
49
|
+
if (M !== void 0 && e.length > M) {
|
|
50
50
|
G(`Тег «${e}» длиннее допустимого значения.`);
|
|
51
51
|
continue;
|
|
52
52
|
}
|
|
@@ -61,85 +61,85 @@ function m({ ref: m, value: h, onChange: g, label: _, description: v, placeholde
|
|
|
61
61
|
}
|
|
62
62
|
n.add(s), t.push(e), r.push(e);
|
|
63
63
|
}
|
|
64
|
-
r.length > 0 ? (
|
|
65
|
-
}, Q = () => U ? (Z(U.split(
|
|
64
|
+
r.length > 0 ? (_(t), G(r.length === 1 ? `Добавлен тег «${r[0]}».` : `Добавлено тегов: ${r.length}.`)) : a ? G(`Достигнуто максимальное количество тегов: ${J}.`) : i > 0 && G("Такой тег уже добавлен.");
|
|
65
|
+
}, Q = () => U ? (Z(U.split(m)), W(""), !0) : !1, $ = (e) => {
|
|
66
66
|
if (Y) return;
|
|
67
|
-
let t =
|
|
68
|
-
t !== void 0 && (g
|
|
67
|
+
let t = g[e];
|
|
68
|
+
t !== void 0 && (_(g.filter((t, n) => n !== e)), w?.(), G(`Удалён тег «${t}».`), B.current?.focus());
|
|
69
69
|
}, me = (e) => {
|
|
70
|
-
if (
|
|
70
|
+
if (ce?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing || H.current || Y)) {
|
|
71
71
|
if (e.key === "Enter" || e.key === ",") {
|
|
72
72
|
(Q() || e.key === ",") && e.preventDefault();
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
e.key === "Backspace" && U.length === 0 &&
|
|
75
|
+
e.key === "Backspace" && U.length === 0 && g.length > 0 && (e.preventDefault(), $(g.length - 1));
|
|
76
76
|
}
|
|
77
77
|
}, he = (e) => {
|
|
78
78
|
if (N?.(e), e.defaultPrevented || Y) return;
|
|
79
79
|
let t = e.clipboardData.getData("text");
|
|
80
|
-
if (!
|
|
80
|
+
if (!p.test(t)) return;
|
|
81
81
|
e.preventDefault();
|
|
82
82
|
let n = e.currentTarget.selectionStart ?? U.length, r = e.currentTarget.selectionEnd ?? n, i = `${U.slice(0, n)}${t}${U.slice(r)}`;
|
|
83
|
-
Z(i.split(
|
|
83
|
+
Z(i.split(m)), W("");
|
|
84
84
|
};
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
label:
|
|
87
|
-
description:
|
|
85
|
+
return /* @__PURE__ */ o(t, {
|
|
86
|
+
label: v,
|
|
87
|
+
description: y,
|
|
88
88
|
disabled: x,
|
|
89
|
-
className:
|
|
89
|
+
className: ae,
|
|
90
90
|
size: b,
|
|
91
91
|
error: C,
|
|
92
92
|
controlId: K,
|
|
93
93
|
labelId: q,
|
|
94
94
|
descriptionId: ue,
|
|
95
95
|
errorId: de,
|
|
96
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ o("div", {
|
|
97
97
|
ref: V,
|
|
98
|
-
className:
|
|
98
|
+
className: r(e.uiControl, C && e.invalid, f.control),
|
|
99
99
|
"data-disabled": x ? "" : void 0,
|
|
100
100
|
"data-readonly": S ? "" : void 0,
|
|
101
101
|
"data-invalid": C ? "" : void 0,
|
|
102
102
|
onClick: () => B.current?.focus(),
|
|
103
103
|
children: [
|
|
104
|
-
|
|
105
|
-
className:
|
|
106
|
-
"aria-label":
|
|
107
|
-
children:
|
|
108
|
-
className:
|
|
109
|
-
children: [/* @__PURE__ */
|
|
110
|
-
className:
|
|
104
|
+
g.length > 0 && /* @__PURE__ */ a("ul", {
|
|
105
|
+
className: f.tagList,
|
|
106
|
+
"aria-label": re,
|
|
107
|
+
children: g.map((e, t) => /* @__PURE__ */ o("li", {
|
|
108
|
+
className: f.tag,
|
|
109
|
+
children: [/* @__PURE__ */ a("span", {
|
|
110
|
+
className: f.tagText,
|
|
111
111
|
children: e
|
|
112
|
-
}), !Y && /* @__PURE__ */
|
|
112
|
+
}), !Y && /* @__PURE__ */ a("button", {
|
|
113
113
|
type: "button",
|
|
114
|
-
className:
|
|
114
|
+
className: f.removeButton,
|
|
115
115
|
onClick: (e) => {
|
|
116
116
|
e.stopPropagation(), $(t);
|
|
117
117
|
},
|
|
118
|
-
"aria-label":
|
|
119
|
-
children: /* @__PURE__ */
|
|
118
|
+
"aria-label": k(e, t),
|
|
119
|
+
children: /* @__PURE__ */ a(i, { "aria-hidden": "true" })
|
|
120
120
|
})]
|
|
121
121
|
}, `${D(e)}-${t}`))
|
|
122
122
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ a("input", {
|
|
124
124
|
...z,
|
|
125
125
|
ref: B,
|
|
126
126
|
id: K,
|
|
127
|
-
form:
|
|
127
|
+
form: j,
|
|
128
128
|
disabled: x,
|
|
129
129
|
readOnly: S,
|
|
130
|
-
required:
|
|
131
|
-
maxLength:
|
|
130
|
+
required: se && g.length === 0,
|
|
131
|
+
maxLength: M,
|
|
132
132
|
value: U,
|
|
133
|
-
placeholder:
|
|
133
|
+
placeholder: g.length === 0 ? ne : void 0,
|
|
134
134
|
"aria-invalid": !!C || void 0,
|
|
135
135
|
"aria-labelledby": pe,
|
|
136
136
|
"aria-describedby": X,
|
|
137
|
-
className:
|
|
137
|
+
className: r(f.input, ie),
|
|
138
138
|
onChange: (e) => {
|
|
139
|
-
let t = e.target.value, n =
|
|
139
|
+
let t = e.target.value, n = p.test(t);
|
|
140
140
|
if (H.current) W(t);
|
|
141
141
|
else if (n) {
|
|
142
|
-
let e = t.split(
|
|
142
|
+
let e = t.split(m), n = p.test(t.at(-1) ?? "") ? "" : e.pop() ?? "";
|
|
143
143
|
Z(e), W(n);
|
|
144
144
|
} else W(t);
|
|
145
145
|
(H.current || !n) && w?.();
|
|
@@ -158,15 +158,15 @@ function m({ ref: m, value: h, onChange: g, label: _, description: v, placeholde
|
|
|
158
158
|
!e.defaultPrevented && !n && O && !Y && Q();
|
|
159
159
|
}
|
|
160
160
|
}),
|
|
161
|
-
|
|
161
|
+
A && g.map((e, t) => /* @__PURE__ */ a("input", {
|
|
162
162
|
type: "hidden",
|
|
163
|
-
name:
|
|
163
|
+
name: A,
|
|
164
164
|
value: e,
|
|
165
|
-
form:
|
|
165
|
+
form: j,
|
|
166
166
|
disabled: x
|
|
167
167
|
}, `${D(e)}-${t}`))
|
|
168
168
|
]
|
|
169
|
-
}), /* @__PURE__ */
|
|
169
|
+
}), /* @__PURE__ */ a("span", {
|
|
170
170
|
className: "visuallyHidden",
|
|
171
171
|
"aria-live": "polite",
|
|
172
172
|
"aria-atomic": "true",
|
|
@@ -175,6 +175,6 @@ function m({ ref: m, value: h, onChange: g, label: _, description: v, placeholde
|
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
//#endregion
|
|
178
|
-
export {
|
|
178
|
+
export { h as TagInput };
|
|
179
179
|
|
|
180
180
|
//# sourceMappingURL=index.js.map
|