@bysages/react 0.3.0 → 0.4.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/{ai-response-jZy-0Tvv.mjs → ai-response-B4DX7nmJ.mjs} +10 -4
- package/dist/chevron-a2nIZKN4.mjs +6 -0
- package/dist/components/accordion/index.d.mts +22 -4
- package/dist/components/accordion/index.mjs +31 -1
- package/dist/components/affix/index.d.mts +4 -1
- package/dist/components/affix/index.mjs +5 -3
- package/dist/components/ai/index.d.mts +2 -2
- package/dist/components/ai/index.mjs +29 -12
- package/dist/components/ai-action/index.d.mts +4 -1
- package/dist/components/ai-action/index.mjs +3 -1
- package/dist/components/ai-attachments/index.d.mts +10 -4
- package/dist/components/ai-attachments/index.mjs +19 -45
- package/dist/components/ai-message/index.d.mts +4 -1
- package/dist/components/ai-message/index.mjs +3 -1
- package/dist/components/ai-prompt-input/index.d.mts +5 -2
- package/dist/components/ai-prompt-input/index.mjs +17 -17
- package/dist/components/ai-reasoning/index.d.mts +4 -1
- package/dist/components/ai-reasoning/index.mjs +4 -2
- package/dist/components/ai-response/index.d.mts +8 -3
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/ai-source/index.d.mts +8 -2
- package/dist/components/ai-source/index.mjs +5 -2
- package/dist/components/ai-suggestion/index.d.mts +4 -1
- package/dist/components/ai-suggestion/index.mjs +3 -1
- package/dist/components/ai-tool/index.d.mts +4 -1
- package/dist/components/ai-tool/index.mjs +4 -2
- package/dist/components/alert/index.d.mts +2 -0
- package/dist/components/alert/index.mjs +11 -18
- package/dist/components/angle-slider/index.d.mts +19 -2
- package/dist/components/angle-slider/index.mjs +31 -8
- package/dist/components/aspect-ratio/index.d.mts +4 -1
- package/dist/components/aspect-ratio/index.mjs +3 -1
- package/dist/components/autocomplete/index.d.mts +3 -1
- package/dist/components/autocomplete/index.mjs +9 -2
- package/dist/components/avatar/index.d.mts +2 -2
- package/dist/components/avatar/index.mjs +9 -2
- package/dist/components/avatar-group/index.d.mts +4 -1
- package/dist/components/avatar-group/index.mjs +3 -1
- package/dist/components/back-top/index.d.mts +7 -1
- package/dist/components/back-top/index.mjs +12 -17
- package/dist/components/badge/index.d.mts +4 -1
- package/dist/components/badge/index.mjs +3 -1
- package/dist/components/banner/index.mjs +13 -18
- package/dist/components/block-ui/index.d.mts +4 -1
- package/dist/components/block-ui/index.mjs +3 -1
- package/dist/components/breadcrumb/index.d.mts +3 -8
- package/dist/components/breadcrumb/index.mjs +11 -1
- package/dist/components/button/index.d.mts +4 -1
- package/dist/components/button/index.mjs +3 -1
- package/dist/components/calendar/index.d.mts +3 -1
- package/dist/components/calendar/index.mjs +9 -10
- package/dist/components/carousel/index.d.mts +21 -1
- package/dist/components/carousel/index.mjs +43 -2
- package/dist/components/cascade-select/index.d.mts +6 -1
- package/dist/components/cascade-select/index.mjs +18 -37
- package/dist/components/checkbox/index.d.mts +20 -2
- package/dist/components/checkbox/index.mjs +28 -8
- package/dist/components/checkbox-group/index.d.mts +8 -6
- package/dist/components/checkbox-group/index.mjs +44 -48
- package/dist/components/chip/index.d.mts +4 -1
- package/dist/components/chip/index.mjs +3 -1
- package/dist/components/client-only/index.d.mts +7 -2
- package/dist/components/client-only/index.mjs +5 -1
- package/dist/components/clipboard/index.d.mts +17 -4
- package/dist/components/clipboard/index.mjs +33 -5
- package/dist/components/collapsible/index.d.mts +16 -4
- package/dist/components/collapsible/index.mjs +25 -1
- package/dist/components/color-picker/index.d.mts +20 -4
- package/dist/components/color-picker/index.mjs +56 -14
- package/dist/components/combobox/index.d.mts +27 -1
- package/dist/components/combobox/index.mjs +62 -5
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +15 -3
- package/dist/components/comment/index.d.mts +4 -1
- package/dist/components/comment/index.mjs +3 -1
- package/dist/components/config-provider/index.d.mts +8 -2
- package/dist/components/config-provider/index.mjs +5 -2
- package/dist/components/container/index.d.mts +4 -1
- package/dist/components/container/index.mjs +3 -1
- package/dist/components/data-view/index.d.mts +4 -1
- package/dist/components/data-view/index.mjs +7 -3
- package/dist/components/date-input/index.d.mts +19 -4
- package/dist/components/date-input/index.mjs +33 -9
- package/dist/components/date-picker/index.d.mts +21 -4
- package/dist/components/date-picker/index.mjs +58 -11
- package/dist/components/deferred-content/index.d.mts +4 -1
- package/dist/components/deferred-content/index.mjs +3 -1
- package/dist/components/descriptions/index.d.mts +10 -2
- package/dist/components/descriptions/index.mjs +13 -8
- package/dist/components/dialog/index.d.mts +18 -5
- package/dist/components/dialog/index.mjs +43 -1
- package/dist/components/download-trigger/index.d.mts +7 -2
- package/dist/components/download-trigger/index.mjs +5 -1
- package/dist/components/drawer/index.d.mts +18 -6
- package/dist/components/drawer/index.mjs +40 -1
- package/dist/components/dynamic-input/index.d.mts +4 -1
- package/dist/components/dynamic-input/index.mjs +13 -19
- package/dist/components/editable/index.d.mts +28 -7
- package/dist/components/editable/index.mjs +43 -4
- package/dist/components/ellipsis/index.d.mts +4 -1
- package/dist/components/ellipsis/index.mjs +3 -1
- package/dist/components/field/index.d.mts +30 -5
- package/dist/components/field/index.mjs +36 -3
- package/dist/components/fieldset/index.d.mts +19 -4
- package/dist/components/fieldset/index.mjs +28 -3
- package/dist/components/file-upload/index.d.mts +36 -9
- package/dist/components/file-upload/index.mjs +66 -11
- package/dist/components/float-button/index.mjs +3 -1
- package/dist/components/floating-panel/index.d.mts +18 -6
- package/dist/components/floating-panel/index.mjs +55 -1
- package/dist/components/focus-trap/index.d.mts +7 -2
- package/dist/components/focus-trap/index.mjs +5 -1
- package/dist/components/form/index.d.mts +1 -1
- package/dist/components/form/index.mjs +5 -2
- package/dist/components/frame/index.d.mts +4 -8
- package/dist/components/frame/index.mjs +13 -1
- package/dist/components/grid/index.d.mts +4 -1
- package/dist/components/grid/index.mjs +3 -1
- package/dist/components/highlight/index.d.mts +3 -5
- package/dist/components/highlight/index.mjs +6 -1
- package/dist/components/hover-card/index.d.mts +20 -4
- package/dist/components/hover-card/index.mjs +32 -1
- package/dist/components/icon/index.d.mts +10 -8
- package/dist/components/icon/index.mjs +5 -3
- package/dist/components/image/index.d.mts +11 -2
- package/dist/components/image/index.mjs +16 -29
- package/dist/components/image-cropper/index.d.mts +13 -2
- package/dist/components/image-cropper/index.mjs +34 -2
- package/dist/components/image-viewer/index.d.mts +2 -18
- package/dist/components/image-viewer/index.mjs +3 -109
- package/dist/components/input/index.d.mts +3 -1
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/json-tree-view/index.d.mts +20 -4
- package/dist/components/json-tree-view/index.mjs +38 -4
- package/dist/components/kbd/index.d.mts +4 -1
- package/dist/components/kbd/index.mjs +3 -1
- package/dist/components/layout/index.d.mts +25 -7
- package/dist/components/layout/index.mjs +159 -63
- package/dist/components/link/index.d.mts +4 -1
- package/dist/components/link/index.mjs +3 -1
- package/dist/components/list/index.d.mts +5 -4
- package/dist/components/list/index.mjs +10 -1
- package/dist/components/listbox/index.d.mts +22 -1
- package/dist/components/listbox/index.mjs +36 -4
- package/dist/components/marquee/index.d.mts +18 -1
- package/dist/components/marquee/index.mjs +34 -2
- package/dist/components/masonry/index.d.mts +4 -1
- package/dist/components/masonry/index.mjs +3 -1
- package/dist/components/media-player/index.d.mts +2 -0
- package/dist/components/media-player/index.mjs +2 -0
- package/dist/components/mentions/index.d.mts +1 -1
- package/dist/components/mentions/index.mjs +1 -1
- package/dist/components/menu/index.d.mts +29 -11
- package/dist/components/menu/index.mjs +34 -12
- package/dist/components/menubar/index.d.mts +3 -1
- package/dist/components/menubar/index.mjs +7 -1
- package/dist/components/navigation-menu/index.d.mts +25 -1
- package/dist/components/navigation-menu/index.mjs +36 -1
- package/dist/components/number-input/index.d.mts +28 -6
- package/dist/components/number-input/index.mjs +33 -8
- package/dist/components/order-list/index.d.mts +4 -1
- package/dist/components/order-list/index.mjs +34 -33
- package/dist/components/pagination/index.d.mts +23 -3
- package/dist/components/pagination/index.mjs +57 -12
- package/dist/components/password-input/index.d.mts +24 -6
- package/dist/components/password-input/index.mjs +31 -8
- package/dist/components/pin-input/index.d.mts +23 -5
- package/dist/components/pin-input/index.mjs +29 -7
- package/dist/components/popconfirm/index.d.mts +9 -5
- package/dist/components/popconfirm/index.mjs +23 -18
- package/dist/components/popover/index.d.mts +2 -8
- package/dist/components/popover/index.mjs +44 -4
- package/dist/components/presence/index.d.mts +10 -2
- package/dist/components/presence/index.mjs +6 -1
- package/dist/components/progress/index.d.mts +18 -3
- package/dist/components/progress/index.mjs +34 -9
- package/dist/components/progress-group/index.d.mts +4 -1
- package/dist/components/progress-group/index.mjs +4 -2
- package/dist/components/qr-code/index.d.mts +14 -1
- package/dist/components/qr-code/index.mjs +26 -2
- package/dist/components/radio-group/index.d.mts +27 -2
- package/dist/components/radio-group/index.mjs +32 -8
- package/dist/components/rating-group/index.d.mts +20 -3
- package/dist/components/rating-group/index.mjs +26 -8
- package/dist/components/result/index.d.mts +1 -1
- package/dist/components/result/index.mjs +2 -2
- package/dist/components/scroll-area/index.d.mts +14 -1
- package/dist/components/scroll-area/index.mjs +32 -2
- package/dist/components/segment-group/index.d.mts +28 -2
- package/dist/components/segment-group/index.mjs +34 -7
- package/dist/components/select/index.d.mts +2 -2
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/separator/index.d.mts +4 -1
- package/dist/components/separator/index.mjs +3 -1
- package/dist/components/signature-pad/index.d.mts +25 -5
- package/dist/components/signature-pad/index.mjs +37 -3
- package/dist/components/skeleton/index.d.mts +4 -1
- package/dist/components/skeleton/index.mjs +3 -1
- package/dist/components/slider/index.d.mts +21 -2
- package/dist/components/slider/index.mjs +31 -8
- package/dist/components/spinner/index.d.mts +4 -1
- package/dist/components/spinner/index.mjs +6 -2
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +15 -18
- package/dist/components/splitter/index.d.mts +17 -4
- package/dist/components/splitter/index.mjs +35 -1
- package/dist/components/spotlight/index.d.mts +4 -1
- package/dist/components/spotlight/index.mjs +3 -1
- package/dist/components/stack/index.d.mts +4 -1
- package/dist/components/stack/index.mjs +6 -4
- package/dist/components/steps/index.d.mts +27 -3
- package/dist/components/steps/index.mjs +36 -12
- package/dist/components/swap/index.d.mts +11 -5
- package/dist/components/swap/index.mjs +30 -3
- package/dist/components/switch/index.d.mts +20 -2
- package/dist/components/switch/index.mjs +27 -8
- package/dist/components/table/index.d.mts +4 -1
- package/dist/components/table/index.mjs +44 -70
- package/dist/components/tabs/index.d.mts +24 -2
- package/dist/components/tabs/index.mjs +25 -9
- package/dist/components/tags-input/index.d.mts +33 -8
- package/dist/components/tags-input/index.mjs +41 -9
- package/dist/components/terminal/index.d.mts +4 -1
- package/dist/components/terminal/index.mjs +8 -3
- package/dist/components/textarea/index.d.mts +4 -1
- package/dist/components/textarea/index.mjs +3 -1
- package/dist/components/timer/index.d.mts +18 -1
- package/dist/components/timer/index.mjs +51 -2
- package/dist/components/toast/index.d.mts +3 -6
- package/dist/components/toast/index.mjs +22 -2
- package/dist/components/toc/index.d.mts +24 -4
- package/dist/components/toc/index.mjs +41 -3
- package/dist/components/toggle/index.d.mts +11 -4
- package/dist/components/toggle/index.mjs +21 -1
- package/dist/components/toggle-group/index.d.mts +26 -2
- package/dist/components/toggle-group/index.mjs +31 -6
- package/dist/components/toolbar/index.d.mts +4 -1
- package/dist/components/toolbar/index.mjs +3 -1
- package/dist/components/tooltip/index.d.mts +17 -4
- package/dist/components/tooltip/index.mjs +28 -1
- package/dist/components/tour/index.d.mts +18 -9
- package/dist/components/tour/index.mjs +44 -2
- package/dist/components/transfer/index.d.mts +3 -1
- package/dist/components/transfer/index.mjs +20 -30
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +15 -24
- package/dist/components/tree-view/index.d.mts +30 -1
- package/dist/components/tree-view/index.mjs +69 -6
- package/dist/components/typography/index.d.mts +4 -0
- package/dist/components/typography/index.mjs +1 -0
- package/dist/components/user/index.d.mts +4 -1
- package/dist/components/user/index.mjs +3 -1
- package/dist/components/virtual-list/index.d.mts +4 -1
- package/dist/components/virtual-list/index.mjs +11 -12
- package/dist/components/watermark/index.d.mts +4 -1
- package/dist/components/watermark/index.mjs +4 -2
- package/dist/family-DE_GQeeM.mjs +9 -0
- package/dist/icon-BALgGtNK.mjs +18 -0
- package/dist/id-C37UYLwJ.mjs +13 -0
- package/dist/image-viewer-Cf6thHax.mjs +141 -0
- package/dist/{index-Uefyw7Im.d.mts → index-Bbg4heDO.d.mts} +12 -7
- package/dist/index-BcRdWGY-.d.mts +115 -0
- package/dist/{index-DFN9F5Zt.d.mts → index-D_iKc2Uw.d.mts} +32 -3
- package/dist/{index-CsfxYv6J.d.mts → index-DdNKngUQ.d.mts} +63 -39
- package/dist/index-Dj8S4eyJ.d.mts +41 -0
- package/dist/index-Eu-Bttta.d.mts +24 -0
- package/dist/{index-uPyYiWaL.d.mts → index-PsgGWW3m.d.mts} +8 -2
- package/dist/index.d.mts +36 -35
- package/dist/index.mjs +13 -12
- package/dist/{input-2oezH-dY.mjs → input-C21Zzuy6.mjs} +3 -1
- package/dist/media-player-gQrnxU52.mjs +554 -0
- package/dist/{mentions-DMIBCBOd.mjs → mentions-BuWibdci.mjs} +74 -42
- package/dist/messages-1jJWtaYU.mjs +16 -0
- package/dist/select-ozUFq0zd.mjs +121 -0
- package/package.json +3 -3
- package/dist/chevron-BeHvt46K.mjs +0 -17
- package/dist/select-D1xiT1oJ.mjs +0 -68
|
@@ -1,10 +1,44 @@
|
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as Fragment$1 } from "react";
|
|
2
5
|
import { Splitter as Splitter$1 } from "@ark-ui/react/splitter";
|
|
3
6
|
//#region src/components/splitter/index.tsx
|
|
4
7
|
/** Ark's Splitter, dressed in the paper-and-ink system: panels divide on
|
|
5
8
|
* a hairline and a small paper-seal thumb answers the hand. The API is
|
|
6
9
|
* Ark's own — Root, Panel, ResizeTrigger, ResizeTriggerIndicator. */
|
|
7
|
-
|
|
10
|
+
function SplitterRoot(props) {
|
|
11
|
+
const id = useElementId("splitter", props);
|
|
12
|
+
return /* @__PURE__ */ jsx(Splitter$1.Root, {
|
|
13
|
+
...props,
|
|
14
|
+
id
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function SplitterFacade({ items, defaultValue, value, orientation = "horizontal", className }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(SplitterRoot, {
|
|
19
|
+
className,
|
|
20
|
+
orientation,
|
|
21
|
+
panels: items.map((item) => ({ id: item.id })),
|
|
22
|
+
...defaultValue === void 0 ? {} : { defaultSize: defaultValue },
|
|
23
|
+
...value === void 0 ? {} : { size: value },
|
|
24
|
+
children: items.map((item, index) => {
|
|
25
|
+
const next = items.at(index + 1);
|
|
26
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Splitter$1.Panel, {
|
|
27
|
+
id: item.id,
|
|
28
|
+
children: item.label
|
|
29
|
+
}), next ? /* @__PURE__ */ jsx(Splitter$1.ResizeTrigger, {
|
|
30
|
+
id: `${item.id}:${next.id}`,
|
|
31
|
+
"aria-label": "Resize panels",
|
|
32
|
+
children: /* @__PURE__ */ jsx(Splitter$1.ResizeTriggerIndicator, {})
|
|
33
|
+
}) : null] }, item.id);
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
SplitterFacade.displayName = "SSplitter";
|
|
38
|
+
const Splitter = Object.assign(SplitterFacade, {
|
|
39
|
+
...Splitter$1,
|
|
40
|
+
Root: SplitterRoot
|
|
41
|
+
});
|
|
8
42
|
injectComponentStyle("splitter");
|
|
9
43
|
//#endregion
|
|
10
44
|
export { Splitter };
|
|
@@ -8,5 +8,8 @@ export interface SpotlightProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
8
8
|
/** The ink-light card: a vessel whose rim and face take light from the
|
|
9
9
|
* reader's hand. The wrapper only measures and writes the geometry —
|
|
10
10
|
* the lamp itself is the two layers the stylesheet paints. */
|
|
11
|
-
|
|
11
|
+
declare function SpotlightImpl({ radius, children, ...rest }: SpotlightProps): import("react").JSX.Element;
|
|
12
|
+
export declare const Spotlight: typeof SpotlightImpl & {
|
|
13
|
+
Root: typeof SpotlightImpl;
|
|
14
|
+
};
|
|
12
15
|
//#endregion
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/spotlight/index.tsx
|
|
4
5
|
/** The ink-light card: a vessel whose rim and face take light from the
|
|
5
6
|
* reader's hand. The wrapper only measures and writes the geometry —
|
|
6
7
|
* the lamp itself is the two layers the stylesheet paints. */
|
|
7
|
-
function
|
|
8
|
+
function SpotlightImpl({ radius, children, ...rest }) {
|
|
8
9
|
injectComponentStyle("spotlight");
|
|
9
10
|
const track = (event) => {
|
|
10
11
|
const host = event.currentTarget;
|
|
@@ -29,5 +30,6 @@ function Spotlight({ radius, children, ...rest }) {
|
|
|
29
30
|
children
|
|
30
31
|
});
|
|
31
32
|
}
|
|
33
|
+
const Spotlight = withSelfRoot(SpotlightImpl);
|
|
32
34
|
//#endregion
|
|
33
35
|
export { Spotlight };
|
|
@@ -7,5 +7,8 @@ export interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
align?: string;
|
|
8
8
|
justify?: string;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
declare function StackImpl({ direction, gap, wrap, align, justify, ...rest }: StackProps): import("react").JSX.Element;
|
|
11
|
+
export declare const Stack: typeof StackImpl & {
|
|
12
|
+
Root: typeof StackImpl;
|
|
13
|
+
};
|
|
11
14
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/stack/index.tsx
|
|
@@ -11,14 +12,14 @@ const gapVars = {
|
|
|
11
12
|
lg: "var(--bs-gap-lg)",
|
|
12
13
|
xl: "var(--bs-gap-xl)"
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
+
function StackImpl({ direction = "column", gap = "md", wrap = false, align, justify, ...rest }) {
|
|
15
16
|
injectComponentStyle("stack");
|
|
16
17
|
const style = {
|
|
17
18
|
...rest.style,
|
|
18
19
|
"--bs-stack-gap": gapVars[gap] ?? gapVars.md,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
"--bs-stack-align": align,
|
|
21
|
+
"--bs-stack-justify": justify,
|
|
22
|
+
"--bs-stack-wrap": wrap ? "wrap" : void 0
|
|
22
23
|
};
|
|
23
24
|
return /* @__PURE__ */ jsx("div", {
|
|
24
25
|
...rest,
|
|
@@ -28,5 +29,6 @@ function Stack({ direction = "column", gap = "md", wrap = false, align, justify,
|
|
|
28
29
|
"data-direction": direction
|
|
29
30
|
});
|
|
30
31
|
}
|
|
32
|
+
const Stack = withSelfRoot(StackImpl);
|
|
31
33
|
//#endregion
|
|
32
34
|
export { Stack };
|
|
@@ -5,7 +5,28 @@ type StepsRootProps = ComponentProps<typeof Steps$1.Root> & {
|
|
|
5
5
|
/** One rung of the control-height ladder every indicator stands on. */
|
|
6
6
|
size?: "sm" | "md" | "lg";
|
|
7
7
|
};
|
|
8
|
-
declare function StepsRoot(
|
|
8
|
+
declare function StepsRoot(props: StepsRootProps): import("react").JSX.Element;
|
|
9
|
+
type StepsItem = {
|
|
10
|
+
title: string;
|
|
11
|
+
};
|
|
12
|
+
export interface StepsFacadeProps {
|
|
13
|
+
items: StepsItem[];
|
|
14
|
+
step?: number;
|
|
15
|
+
defaultStep?: number;
|
|
16
|
+
linear?: boolean;
|
|
17
|
+
orientation?: "horizontal" | "vertical";
|
|
18
|
+
/** One rung of the control-height ladder every indicator stands on. */
|
|
19
|
+
size?: "sm" | "md" | "lg";
|
|
20
|
+
className?: string;
|
|
21
|
+
onStepChange?: (step: number) => void;
|
|
22
|
+
}
|
|
23
|
+
declare function StepsFacade({ items, step, defaultStep, linear, orientation, size, className, onStepChange }: StepsFacadeProps): import("react").JSX.Element;
|
|
24
|
+
declare namespace StepsFacade {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
27
|
+
/** The machine wraps each tab in an item div; presentation keeps the
|
|
28
|
+
* tablist owned children legal while the tab itself keeps its role. */
|
|
29
|
+
declare function StepsItem(props: ComponentProps<typeof Steps$1.Item>): import("react").JSX.Element;
|
|
9
30
|
/**
|
|
10
31
|
* Steps — linear progress through a sequence.
|
|
11
32
|
*
|
|
@@ -13,7 +34,10 @@ declare function StepsRoot({ size, ...rest }: StepsRootProps): import("react").J
|
|
|
13
34
|
* PrevTrigger, NextTrigger, Progress. Indicator and Separator carry
|
|
14
35
|
* data-complete / data-current / data-incomplete.
|
|
15
36
|
*/
|
|
16
|
-
|
|
37
|
+
type StepsParts = Omit<typeof Steps$1, "Root" | "Item"> & {
|
|
17
38
|
Root: typeof StepsRoot;
|
|
39
|
+
Item: typeof StepsItem;
|
|
18
40
|
};
|
|
19
|
-
|
|
41
|
+
export declare const Steps: typeof StepsFacade & StepsParts;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { StepsItem };
|
|
@@ -1,24 +1,48 @@
|
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { Steps as Steps$1 } from "@ark-ui/react/steps";
|
|
4
5
|
//#region src/components/steps/index.tsx
|
|
5
|
-
function StepsRoot(
|
|
6
|
+
function StepsRoot(props) {
|
|
7
|
+
const id = useElementId("steps", props);
|
|
8
|
+
const { size = "md", ...rest } = props;
|
|
6
9
|
return /* @__PURE__ */ jsx(Steps$1.Root, {
|
|
7
10
|
...rest,
|
|
11
|
+
id,
|
|
8
12
|
"data-size": size
|
|
9
13
|
});
|
|
10
14
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
function StepsFacade({ items, step, defaultStep = 0, linear = false, orientation = "horizontal", size = "md", className, onStepChange }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(StepsRoot, {
|
|
17
|
+
className,
|
|
18
|
+
size,
|
|
19
|
+
count: items.length,
|
|
20
|
+
linear,
|
|
21
|
+
orientation,
|
|
22
|
+
defaultStep,
|
|
23
|
+
...step === void 0 ? {} : { step },
|
|
24
|
+
onStepChange: (details) => onStepChange?.(details.step),
|
|
25
|
+
children: /* @__PURE__ */ jsx(Steps$1.List, { children: items.map((item, index) => /* @__PURE__ */ jsxs(Steps$1.Item, {
|
|
26
|
+
index,
|
|
27
|
+
role: "presentation",
|
|
28
|
+
children: [/* @__PURE__ */ jsxs(Steps$1.Trigger, { children: [/* @__PURE__ */ jsx(Steps$1.Indicator, { children: String(index + 1) }), item.title] }), /* @__PURE__ */ jsx(Steps$1.Separator, {})]
|
|
29
|
+
}, item.title)) })
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
StepsFacade.displayName = "SSteps";
|
|
33
|
+
/** The machine wraps each tab in an item div; presentation keeps the
|
|
34
|
+
* tablist owned children legal while the tab itself keeps its role. */
|
|
35
|
+
function StepsItem(props) {
|
|
36
|
+
return /* @__PURE__ */ jsx(Steps$1.Item, {
|
|
37
|
+
...props,
|
|
38
|
+
role: "presentation"
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const Steps = Object.assign(StepsFacade, {
|
|
19
42
|
...Steps$1,
|
|
20
|
-
Root: StepsRoot
|
|
21
|
-
|
|
43
|
+
Root: StepsRoot,
|
|
44
|
+
Item: StepsItem
|
|
45
|
+
});
|
|
22
46
|
injectComponentStyle("steps");
|
|
23
47
|
//#endregion
|
|
24
48
|
export { Steps };
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
1
2
|
import { Swap as Swap$1 } from "@ark-ui/react/swap";
|
|
2
3
|
//#region src/components/swap/index.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
interface SwapFacadeProps {
|
|
5
|
+
swap?: boolean;
|
|
6
|
+
on?: ReactNode;
|
|
7
|
+
off?: ReactNode;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** The one-tag path for the default check/cross impression; custom
|
|
11
|
+
* transitions and indicators stay on the anatomy. */
|
|
12
|
+
declare function SwapFacade({ swap, on, off }: SwapFacadeProps): import("react").JSX.Element;
|
|
13
|
+
export declare const Swap: typeof SwapFacade & typeof Swap$1;
|
|
8
14
|
//#endregion
|
|
@@ -1,11 +1,38 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
5
|
import { Swap as Swap$1 } from "@ark-ui/react/swap";
|
|
3
6
|
//#region src/components/swap/index.tsx
|
|
4
|
-
/**
|
|
7
|
+
/** Swap, dressed in the paper-and-ink system: two impressions
|
|
5
8
|
* occupying one seal, the arriving one growing into place on the spring
|
|
6
|
-
* while the departing one shrinks away. The
|
|
9
|
+
* while the departing one shrinks away. The parts — Root,
|
|
7
10
|
* Indicator (type="on" | "off"), RootProvider. */
|
|
8
|
-
|
|
11
|
+
function SwapRoot(props) {
|
|
12
|
+
const id = useElementId("swap", props);
|
|
13
|
+
return /* @__PURE__ */ jsx(Swap$1.Root, {
|
|
14
|
+
...props,
|
|
15
|
+
id
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/** The one-tag path for the default check/cross impression; custom
|
|
19
|
+
* transitions and indicators stay on the anatomy. */
|
|
20
|
+
function SwapFacade({ swap = false, on, off }) {
|
|
21
|
+
return /* @__PURE__ */ jsxs(SwapRoot, {
|
|
22
|
+
swap,
|
|
23
|
+
children: [/* @__PURE__ */ jsx(Swap$1.Indicator, {
|
|
24
|
+
type: "on",
|
|
25
|
+
children: on ?? iconNode("check")
|
|
26
|
+
}), /* @__PURE__ */ jsx(Swap$1.Indicator, {
|
|
27
|
+
type: "off",
|
|
28
|
+
children: off ?? iconNode("x")
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const Swap = Object.assign(SwapFacade, {
|
|
33
|
+
...Swap$1,
|
|
34
|
+
Root: SwapRoot
|
|
35
|
+
});
|
|
9
36
|
injectComponentStyle("swap");
|
|
10
37
|
//#endregion
|
|
11
38
|
export { Swap };
|
|
@@ -5,12 +5,30 @@ type SwitchRootProps = ComponentProps<typeof Switch$1.Root> & {
|
|
|
5
5
|
/** One rung for the thumb; the track travels with it. */
|
|
6
6
|
size?: "sm" | "md" | "lg";
|
|
7
7
|
};
|
|
8
|
-
declare function SwitchRoot(
|
|
8
|
+
declare function SwitchRoot(props: SwitchRootProps): import("react").JSX.Element;
|
|
9
|
+
export interface SwitchFacadeProps {
|
|
10
|
+
value?: boolean;
|
|
11
|
+
defaultValue?: boolean;
|
|
12
|
+
label?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
invalid?: boolean;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
/** One rung for the thumb; the track travels with it. */
|
|
18
|
+
size?: "sm" | "md" | "lg";
|
|
19
|
+
className?: string;
|
|
20
|
+
onValueChange?: (value: boolean) => void;
|
|
21
|
+
}
|
|
22
|
+
declare function SwitchFacade({ value, defaultValue, label, disabled, invalid, required, readOnly, size, className, onValueChange }: SwitchFacadeProps): import("react").JSX.Element;
|
|
23
|
+
declare namespace SwitchFacade {
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
9
26
|
/** Ark's Switch, dressed in the paper-and-ink system: a track that rests
|
|
10
27
|
* in the inset shade of the paper and fills flat with primary ink when on,
|
|
11
28
|
* the thumb sliding on the spring. The API is Ark's own — Root, Label,
|
|
12
29
|
* Control, Thumb, HiddenInput. */
|
|
13
|
-
|
|
30
|
+
type SwitchParts = Omit<typeof Switch$1, "Root"> & {
|
|
14
31
|
Root: typeof SwitchRoot;
|
|
15
32
|
};
|
|
33
|
+
export declare const Switch: typeof SwitchFacade & SwitchParts;
|
|
16
34
|
//#endregion
|
|
@@ -1,21 +1,40 @@
|
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { Switch as Switch$1 } from "@ark-ui/react/switch";
|
|
4
5
|
//#region src/components/switch/index.tsx
|
|
5
|
-
function SwitchRoot(
|
|
6
|
+
function SwitchRoot(props) {
|
|
7
|
+
const id = useElementId("switch", props);
|
|
8
|
+
const { size = "md", ...rest } = props;
|
|
6
9
|
return /* @__PURE__ */ jsx(Switch$1.Root, {
|
|
7
10
|
...rest,
|
|
11
|
+
id,
|
|
8
12
|
"data-size": size
|
|
9
13
|
});
|
|
10
14
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
function SwitchFacade({ value, defaultValue = false, label, disabled = false, invalid = false, required = false, readOnly = false, size = "md", className, onValueChange }) {
|
|
16
|
+
return /* @__PURE__ */ jsxs(SwitchRoot, {
|
|
17
|
+
className,
|
|
18
|
+
size,
|
|
19
|
+
disabled,
|
|
20
|
+
invalid,
|
|
21
|
+
readOnly,
|
|
22
|
+
required,
|
|
23
|
+
defaultChecked: defaultValue,
|
|
24
|
+
...value === void 0 ? {} : { checked: value },
|
|
25
|
+
onCheckedChange: (details) => onValueChange?.(details.checked),
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ jsx(Switch$1.Control, { children: /* @__PURE__ */ jsx(Switch$1.Thumb, {}) }),
|
|
28
|
+
label ? /* @__PURE__ */ jsx(Switch$1.Label, { children: label }) : null,
|
|
29
|
+
/* @__PURE__ */ jsx(Switch$1.HiddenInput, {})
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
SwitchFacade.displayName = "SSwitch";
|
|
34
|
+
const Switch = Object.assign(SwitchFacade, {
|
|
16
35
|
...Switch$1,
|
|
17
36
|
Root: SwitchRoot
|
|
18
|
-
};
|
|
37
|
+
});
|
|
19
38
|
injectComponentStyle("switch");
|
|
20
39
|
//#endregion
|
|
21
40
|
export { Switch };
|
|
@@ -74,6 +74,9 @@ export interface DataTableProps {
|
|
|
74
74
|
/** Applied to the root vessel. */
|
|
75
75
|
style?: CSSProperties;
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
declare function DataTableImpl(rawProps: DataTableProps): import("react").JSX.Element;
|
|
78
|
+
export declare const DataTable: typeof DataTableImpl & {
|
|
79
|
+
Root: typeof DataTableImpl;
|
|
80
|
+
};
|
|
78
81
|
//#endregion
|
|
79
82
|
export { type ColumnDef, FlexRender, type SortingState, createColumnHelper };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
3
|
+
import { n as useComponentMessages, t as formatMessage } from "../../messages-1jJWtaYU.mjs";
|
|
1
4
|
import { Pagination } from "../pagination/index.mjs";
|
|
2
|
-
import { t as Select$1 } from "../../select-
|
|
5
|
+
import { t as Select$1 } from "../../select-ozUFq0zd.mjs";
|
|
3
6
|
import { injectComponentStyle } from "@bysages/core";
|
|
4
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
8
|
import { useEffect, useLayoutEffect, useMemo, useReducer, useRef } from "react";
|
|
@@ -7,36 +10,16 @@ import { createListCollection } from "@ark-ui/react/select";
|
|
|
7
10
|
import { FlexRender, cellSpanningFeature, columnFilteringFeature, columnOrderingFeature, columnPinningFeature, columnSizingFeature, columnVisibilityFeature, createColumnHelper, createExpandedRowModel, createFilteredRowModel, createPaginatedRowModel, createSortedRowModel, filterFn_arrIncludes, filterFn_equals, filterFn_inDateRange, filterFn_inNumberRange, filterFn_includesString, filterFn_weakEquals, globalFilteringFeature, rowExpandingFeature, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_alphanumericCaseSensitive, sortFn_basic, sortFn_datetime, sortFn_text, sortFn_textCaseSensitive, tableFeatures, useTable } from "@tanstack/react-table";
|
|
8
11
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
9
12
|
//#region src/components/table/index.tsx
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
13
|
-
viewBox: "0 0 24 24",
|
|
13
|
+
function pageIcon(direction) {
|
|
14
|
+
return iconNode(direction === "start" ? "chevron-left" : "chevron-right", {
|
|
14
15
|
width: 14,
|
|
15
|
-
height: 14
|
|
16
|
-
fill: "none",
|
|
17
|
-
stroke: "currentColor",
|
|
18
|
-
strokeWidth: 2,
|
|
19
|
-
strokeLinecap: "round",
|
|
20
|
-
strokeLinejoin: "round",
|
|
21
|
-
"aria-hidden": "true",
|
|
22
|
-
children: /* @__PURE__ */ jsx("path", { d: direction === "start" ? "m15 18-6-6 6-6" : "m9 18 6-6-6-6" })
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
/** The page-size select's pointing chevron. */
|
|
26
|
-
function chevronDownGlyph() {
|
|
27
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
28
|
-
viewBox: "0 0 24 24",
|
|
29
|
-
width: 14,
|
|
30
|
-
height: 14,
|
|
31
|
-
fill: "none",
|
|
32
|
-
stroke: "currentColor",
|
|
33
|
-
strokeWidth: 2.5,
|
|
34
|
-
strokeLinecap: "round",
|
|
35
|
-
strokeLinejoin: "round",
|
|
36
|
-
"aria-hidden": "true",
|
|
37
|
-
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
16
|
+
height: 14
|
|
38
17
|
});
|
|
39
18
|
}
|
|
19
|
+
const chevronDownIcon = iconNode("chevron-down", {
|
|
20
|
+
width: 14,
|
|
21
|
+
height: 14
|
|
22
|
+
});
|
|
40
23
|
const SELECT_COL_ID = "__select";
|
|
41
24
|
const SELECT_COL_WIDTH = 48;
|
|
42
25
|
/** The list holding `id` and the index inside it, or null when absent. */
|
|
@@ -87,18 +70,7 @@ function mark(el, attr, on) {
|
|
|
87
70
|
if (on) el.setAttribute(attr, "");
|
|
88
71
|
else el.removeAttribute(attr);
|
|
89
72
|
}
|
|
90
|
-
|
|
91
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
92
|
-
viewBox: "0 0 24 24",
|
|
93
|
-
fill: "none",
|
|
94
|
-
stroke: "currentColor",
|
|
95
|
-
strokeWidth: 2.5,
|
|
96
|
-
strokeLinecap: "round",
|
|
97
|
-
strokeLinejoin: "round",
|
|
98
|
-
"aria-hidden": true,
|
|
99
|
-
children: /* @__PURE__ */ jsx("path", { d: "m9 6 6 6-6 6" })
|
|
100
|
-
});
|
|
101
|
-
}
|
|
73
|
+
const chevronIcon = iconNode("chevron-right");
|
|
102
74
|
/** React keeps `indeterminate` off the JSX types; the DOM property is the
|
|
103
75
|
* only channel, so the checkbox owns its ref. */
|
|
104
76
|
function SelectBox(props) {
|
|
@@ -114,15 +86,17 @@ function SelectBox(props) {
|
|
|
114
86
|
onChange: props.onToggle
|
|
115
87
|
});
|
|
116
88
|
}
|
|
117
|
-
function
|
|
89
|
+
function DataTableImpl(rawProps) {
|
|
118
90
|
injectComponentStyle("table");
|
|
119
91
|
const props = rawProps;
|
|
120
92
|
const { selectable = false, sortable = true, filterable = false, showToolbar = true, tree = false, virtual: virtualProp = false, rowHeight = 40, paginated = false, pageSize = 10, pageSizeOptions = [
|
|
121
93
|
10,
|
|
122
94
|
20,
|
|
123
95
|
50
|
|
124
|
-
], globalFilterPlaceholder
|
|
96
|
+
], globalFilterPlaceholder, emptyText, reorderable = false } = props;
|
|
125
97
|
const merge = props.merge;
|
|
98
|
+
const messages = useComponentMessages();
|
|
99
|
+
const globalFilterText = globalFilterPlaceholder ?? messages.table.filterAll;
|
|
126
100
|
const virtual = virtualProp && !merge;
|
|
127
101
|
const mergeMode = !virtualProp && !!merge;
|
|
128
102
|
/** Features follow the construction-time switches: sorting, selection,
|
|
@@ -428,14 +402,14 @@ function DataTable(rawProps) {
|
|
|
428
402
|
const style = { ...pin.style };
|
|
429
403
|
delete pin.style;
|
|
430
404
|
const rowSpan = cell.getRowSpan();
|
|
431
|
-
if (rowSpan > 1) style
|
|
405
|
+
if (rowSpan > 1) style["--bs-table-row-span"] = String(rowSpan);
|
|
432
406
|
const spanned = rowSpan > 1 ? { "data-spanned": "" } : {};
|
|
433
407
|
let content;
|
|
434
408
|
if (column.id === SELECT_COL_ID) content = /* @__PURE__ */ jsx(SelectBox, {
|
|
435
409
|
checked: row.getIsSelected(),
|
|
436
410
|
indeterminate: false,
|
|
437
411
|
onToggle: () => row.toggleSelected(!row.getIsSelected()),
|
|
438
|
-
label:
|
|
412
|
+
label: messages.table.selectRow
|
|
439
413
|
});
|
|
440
414
|
else if (isExpandHost) content = /* @__PURE__ */ jsxs("div", {
|
|
441
415
|
"data-scope": "table",
|
|
@@ -447,9 +421,9 @@ function DataTable(rawProps) {
|
|
|
447
421
|
"data-part": "expander",
|
|
448
422
|
"data-expanded": row.getIsExpanded() || void 0,
|
|
449
423
|
"data-leaf": !row.getCanExpand() || void 0,
|
|
450
|
-
"aria-label": row.getIsExpanded() ?
|
|
424
|
+
"aria-label": row.getIsExpanded() ? messages.table.collapseRow : messages.table.expandRow,
|
|
451
425
|
onClick: () => row.toggleExpanded(),
|
|
452
|
-
children:
|
|
426
|
+
children: chevronIcon
|
|
453
427
|
}), /* @__PURE__ */ jsx(FlexRender, { cell })]
|
|
454
428
|
});
|
|
455
429
|
else content = /* @__PURE__ */ jsx(FlexRender, { cell });
|
|
@@ -492,9 +466,9 @@ function DataTable(rawProps) {
|
|
|
492
466
|
type: "text",
|
|
493
467
|
"data-scope": "table",
|
|
494
468
|
"data-part": "header-filter",
|
|
495
|
-
"aria-label":
|
|
469
|
+
"aria-label": formatMessage(messages.table.filterColumn, { name: column.id }),
|
|
496
470
|
value: column.getFilterValue() ?? "",
|
|
497
|
-
placeholder:
|
|
471
|
+
placeholder: messages.command.filter,
|
|
498
472
|
draggable: false,
|
|
499
473
|
onClick: (e) => e.stopPropagation(),
|
|
500
474
|
onDragStart: (e) => e.stopPropagation(),
|
|
@@ -506,11 +480,8 @@ function DataTable(rawProps) {
|
|
|
506
480
|
const style = {};
|
|
507
481
|
if (virtual) {
|
|
508
482
|
const item = virtualRows[virtualIndex];
|
|
509
|
-
style
|
|
510
|
-
style
|
|
511
|
-
style.inlineSize = "100%";
|
|
512
|
-
style.transform = `translateY(${item.start}px)`;
|
|
513
|
-
style.blockSize = `${item.size}px`;
|
|
483
|
+
style["--bs-table-virtual-row-start"] = `${item.start}px`;
|
|
484
|
+
style["--bs-table-virtual-row-size"] = `${item.size}px`;
|
|
514
485
|
}
|
|
515
486
|
return /* @__PURE__ */ jsx("div", {
|
|
516
487
|
role: "row",
|
|
@@ -548,7 +519,7 @@ function DataTable(rawProps) {
|
|
|
548
519
|
checked: all,
|
|
549
520
|
indeterminate: table.getIsSomeRowsSelected() && !all,
|
|
550
521
|
onToggle: () => table.toggleAllRowsSelected(!all),
|
|
551
|
-
label:
|
|
522
|
+
label: messages.table.selectAllRows
|
|
552
523
|
})
|
|
553
524
|
}, column.id);
|
|
554
525
|
}
|
|
@@ -561,14 +532,12 @@ function DataTable(rawProps) {
|
|
|
561
532
|
"data-scope": "table",
|
|
562
533
|
"data-part": "body",
|
|
563
534
|
"data-merge": mergeMode || void 0,
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
blockSize: `${totalSize}px`
|
|
567
|
-
} : void 0,
|
|
535
|
+
"data-virtual": virtual || void 0,
|
|
536
|
+
style: virtual ? { "--bs-table-virtual-total": `${totalSize}px` } : void 0,
|
|
568
537
|
children: [virtual ? virtualRows.map((_, index) => renderRow(rows[index], index)) : rows.map((row) => renderRow(row, -1)), rows.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
569
538
|
"data-scope": "table",
|
|
570
539
|
"data-part": "empty",
|
|
571
|
-
children: emptyText
|
|
540
|
+
children: emptyText ?? messages.table.empty
|
|
572
541
|
}) : null]
|
|
573
542
|
});
|
|
574
543
|
const hasFooters = table.getFooterGroups().some((group) => group.headers.some((header) => header.column.columnDef.footer));
|
|
@@ -581,7 +550,7 @@ function DataTable(rawProps) {
|
|
|
581
550
|
"data-scope": "table",
|
|
582
551
|
"data-part": "row",
|
|
583
552
|
children: group.headers.map((header) => /* @__PURE__ */ jsx("div", {
|
|
584
|
-
role: "
|
|
553
|
+
role: "cell",
|
|
585
554
|
"data-scope": "table",
|
|
586
555
|
"data-part": "footer-cell",
|
|
587
556
|
"data-numeric": header.column.columnDef.meta?.numeric ? "" : void 0,
|
|
@@ -596,7 +565,7 @@ function DataTable(rawProps) {
|
|
|
596
565
|
const pagination = table.atoms.pagination.get();
|
|
597
566
|
const rowCount = table.getRowCount();
|
|
598
567
|
const sizeItems = createListCollection({ items: pageSizeOptions.map((size) => ({
|
|
599
|
-
label:
|
|
568
|
+
label: formatMessage(messages.table.perPage, { size }),
|
|
600
569
|
value: String(size)
|
|
601
570
|
})) });
|
|
602
571
|
const pageSize = /* @__PURE__ */ jsxs(Select$1.Root, {
|
|
@@ -605,11 +574,14 @@ function DataTable(rawProps) {
|
|
|
605
574
|
onValueChange: (details) => table.setPageSize(Number(details.value[0])),
|
|
606
575
|
positioning: { placement: "top-start" },
|
|
607
576
|
children: [/* @__PURE__ */ jsx(Select$1.Control, { children: /* @__PURE__ */ jsxs(Select$1.Trigger, {
|
|
608
|
-
"aria-label":
|
|
609
|
-
children: [/* @__PURE__ */ jsx(Select$1.ValueText, {}), /* @__PURE__ */ jsx(Select$1.Indicator, { children:
|
|
577
|
+
"aria-label": messages.table.rowsPerPage,
|
|
578
|
+
children: [/* @__PURE__ */ jsx(Select$1.ValueText, {}), /* @__PURE__ */ jsx(Select$1.Indicator, { children: chevronDownIcon })]
|
|
610
579
|
}) }), /* @__PURE__ */ jsx(Select$1.Positioner, { children: /* @__PURE__ */ jsx(Select$1.Content, { children: sizeItems.items.map((item) => /* @__PURE__ */ jsxs(Select$1.Item, {
|
|
611
580
|
item,
|
|
612
|
-
children: [/* @__PURE__ */ jsx(Select$1.ItemText, { children: item.label }), /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: "
|
|
581
|
+
children: [/* @__PURE__ */ jsx(Select$1.ItemText, { children: item.label }), /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: iconNode("check", {
|
|
582
|
+
width: 14,
|
|
583
|
+
height: 14
|
|
584
|
+
}) })]
|
|
613
585
|
}, item.value)) }) })]
|
|
614
586
|
});
|
|
615
587
|
const pager = /* @__PURE__ */ jsxs(Pagination.Root, {
|
|
@@ -618,22 +590,22 @@ function DataTable(rawProps) {
|
|
|
618
590
|
page: pagination.pageIndex + 1,
|
|
619
591
|
onPageChange: (details) => table.setPageIndex(details.page - 1),
|
|
620
592
|
children: [
|
|
621
|
-
/* @__PURE__ */ jsx(Pagination.PrevTrigger, { children:
|
|
593
|
+
/* @__PURE__ */ jsx(Pagination.PrevTrigger, { children: pageIcon("start") }),
|
|
622
594
|
/* @__PURE__ */ jsx(Pagination.Context, { children: (scope) => scope.pages.map((page, index) => page.type === "ellipsis" ? /* @__PURE__ */ jsx(Pagination.Ellipsis, { index }, `e${index}`) : /* @__PURE__ */ jsx(Pagination.Item, {
|
|
623
595
|
type: "page",
|
|
624
596
|
value: page.value,
|
|
625
597
|
children: String(page.value)
|
|
626
598
|
}, page.value)) }),
|
|
627
|
-
/* @__PURE__ */ jsx(Pagination.NextTrigger, { children:
|
|
599
|
+
/* @__PURE__ */ jsx(Pagination.NextTrigger, { children: pageIcon("end") })
|
|
628
600
|
]
|
|
629
601
|
});
|
|
630
602
|
return /* @__PURE__ */ jsxs("div", {
|
|
631
603
|
"data-scope": "table",
|
|
632
604
|
"data-part": "pagination",
|
|
633
|
-
children: [/* @__PURE__ */
|
|
605
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
634
606
|
"data-scope": "table",
|
|
635
607
|
"data-part": "page-status",
|
|
636
|
-
children:
|
|
608
|
+
children: formatMessage(messages.table.rowsCount, { count: rowCount })
|
|
637
609
|
}), /* @__PURE__ */ jsxs("div", {
|
|
638
610
|
"data-scope": "table",
|
|
639
611
|
"data-part": "page-nav",
|
|
@@ -648,8 +620,8 @@ function DataTable(rawProps) {
|
|
|
648
620
|
type: "search",
|
|
649
621
|
"data-scope": "table",
|
|
650
622
|
"data-part": "global-filter",
|
|
651
|
-
"aria-label":
|
|
652
|
-
placeholder:
|
|
623
|
+
"aria-label": messages.table.filterAll,
|
|
624
|
+
placeholder: globalFilterText,
|
|
653
625
|
value: table.atoms.globalFilter.get() ?? "",
|
|
654
626
|
onInput: (e) => table.setGlobalFilter(e.target.value)
|
|
655
627
|
})
|
|
@@ -668,6 +640,7 @@ function DataTable(rawProps) {
|
|
|
668
640
|
"data-scope": "table",
|
|
669
641
|
"data-part": "viewport",
|
|
670
642
|
ref: viewport,
|
|
643
|
+
tabIndex: 0,
|
|
671
644
|
children: /* @__PURE__ */ jsxs("div", {
|
|
672
645
|
role: "table",
|
|
673
646
|
"data-scope": "table",
|
|
@@ -684,5 +657,6 @@ function DataTable(rawProps) {
|
|
|
684
657
|
]
|
|
685
658
|
});
|
|
686
659
|
}
|
|
660
|
+
const DataTable = withSelfRoot(DataTableImpl);
|
|
687
661
|
//#endregion
|
|
688
662
|
export { DataTable, FlexRender, createColumnHelper };
|