@cascivo/react 0.12.0 → 0.13.1
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/accordion/accordion.js +46 -44
- package/dist/action-sheet/action-sheet.js +16 -16
- package/dist/alert-dialog/alert-dialog.js +34 -34
- package/dist/app-shell/app-shell.css +1 -1
- package/dist/app-shell/app-shell.js +36 -33
- package/dist/app-shell/app-shell.module.js +8 -8
- package/dist/avatar-group/avatar-group.js +6 -6
- package/dist/badge/badge.js +17 -10
- package/dist/bottom-sheet/bottom-sheet.js +18 -18
- package/dist/button/button.css +1 -1
- package/dist/button/button.js +15 -12
- package/dist/button/button.module.js +1 -1
- package/dist/button-group/button-group.js +8 -8
- package/dist/card/card.css +1 -1
- package/dist/card/card.module.js +8 -8
- package/dist/carousel/carousel.js +20 -20
- package/dist/checkbox/checkbox.js +21 -21
- package/dist/checkbox-card/checkbox-card.js +15 -13
- package/dist/collapsible/collapsible.js +7 -7
- package/dist/color-picker/color-picker.js +26 -26
- package/dist/combobox/combobox.css +1 -1
- package/dist/combobox/combobox.js +86 -86
- package/dist/combobox/combobox.module.js +15 -15
- package/dist/command-menu/command-menu.js +111 -111
- package/dist/comparison/comparison.js +10 -10
- package/dist/context-menu/context-menu.js +9 -9
- package/dist/copy-button/copy-button.js +18 -16
- package/dist/data-table/data-table.css +1 -1
- package/dist/data-table/data-table.js +8 -2
- package/dist/data-table/data-table.module.js +29 -29
- package/dist/date-picker/date-picker.css +1 -1
- package/dist/date-picker/date-picker.js +25 -25
- package/dist/date-picker/date-picker.module.js +19 -19
- package/dist/date-range-picker/date-range-picker.js +26 -26
- package/dist/drawer/drawer.css +1 -1
- package/dist/drawer/drawer.js +18 -17
- package/dist/drawer/drawer.module.js +9 -9
- package/dist/dropdown/dropdown.js +48 -48
- package/dist/editable/editable.js +11 -11
- package/dist/fab/fab.js +53 -53
- package/dist/field/field.js +8 -8
- package/dist/file-uploader/file-uploader.css +1 -1
- package/dist/file-uploader/file-uploader.js +19 -19
- package/dist/file-uploader/file-uploader.module.js +14 -14
- package/dist/filter/filter.js +10 -9
- package/dist/header-panel/header-panel.js +31 -31
- package/dist/hover-card/hover-card.js +21 -21
- package/dist/icon-button/icon-button.css +1 -1
- package/dist/icon-button/icon-button.js +5 -5
- package/dist/icon-button/icon-button.module.js +1 -1
- package/dist/index.d.ts +1475 -251
- package/dist/input/input.css +1 -1
- package/dist/input/input.js +22 -21
- package/dist/input/input.module.js +5 -5
- package/dist/item/item.css +1 -1
- package/dist/item/item.module.js +6 -6
- package/dist/layouts/src/page-header/page-header.css +1 -0
- package/dist/layouts/src/page-header/page-header.js +33 -0
- package/dist/layouts/src/page-header/page-header.module.js +13 -0
- package/dist/link/link.js +14 -12
- package/dist/log-viewer/log-viewer.js +26 -26
- package/dist/menu/menu.js +20 -20
- package/dist/menu-button/menu-button.js +48 -48
- package/dist/menubar/menubar.js +42 -42
- package/dist/modal/modal.css +1 -1
- package/dist/modal/modal.js +41 -35
- package/dist/modal/modal.module.js +8 -7
- package/dist/multi-select/multi-select.css +1 -1
- package/dist/multi-select/multi-select.js +57 -57
- package/dist/multi-select/multi-select.module.js +11 -11
- package/dist/native-select/native-select.js +13 -11
- package/dist/navigation-menu/navigation-menu.js +46 -46
- package/dist/node/accordion/accordion.js +46 -44
- package/dist/node/action-sheet/action-sheet.js +16 -16
- package/dist/node/alert-dialog/alert-dialog.js +34 -34
- package/dist/node/app-shell/app-shell.js +36 -33
- package/dist/node/app-shell/app-shell.module.js +8 -8
- package/dist/node/avatar-group/avatar-group.js +6 -6
- package/dist/node/badge/badge.js +17 -10
- package/dist/node/bottom-sheet/bottom-sheet.js +18 -18
- package/dist/node/button/button.js +15 -12
- package/dist/node/button/button.module.js +1 -1
- package/dist/node/button-group/button-group.js +8 -8
- package/dist/node/card/card.module.js +8 -8
- package/dist/node/carousel/carousel.js +20 -20
- package/dist/node/checkbox/checkbox.js +21 -21
- package/dist/node/checkbox-card/checkbox-card.js +15 -13
- package/dist/node/collapsible/collapsible.js +7 -7
- package/dist/node/color-picker/color-picker.js +26 -26
- package/dist/node/combobox/combobox.js +86 -86
- package/dist/node/combobox/combobox.module.js +15 -15
- package/dist/node/command-menu/command-menu.js +111 -111
- package/dist/node/comparison/comparison.js +10 -10
- package/dist/node/context-menu/context-menu.js +9 -9
- package/dist/node/copy-button/copy-button.js +18 -16
- package/dist/node/data-table/data-table.js +8 -2
- package/dist/node/data-table/data-table.module.js +29 -29
- package/dist/node/date-picker/date-picker.js +25 -25
- package/dist/node/date-picker/date-picker.module.js +19 -19
- package/dist/node/date-range-picker/date-range-picker.js +26 -26
- package/dist/node/drawer/drawer.js +18 -17
- package/dist/node/drawer/drawer.module.js +9 -9
- package/dist/node/dropdown/dropdown.js +48 -48
- package/dist/node/editable/editable.js +11 -11
- package/dist/node/fab/fab.js +53 -53
- package/dist/node/field/field.js +8 -8
- package/dist/node/file-uploader/file-uploader.js +19 -19
- package/dist/node/file-uploader/file-uploader.module.js +14 -14
- package/dist/node/filter/filter.js +10 -9
- package/dist/node/header-panel/header-panel.js +31 -31
- package/dist/node/hover-card/hover-card.js +21 -21
- package/dist/node/icon-button/icon-button.js +5 -5
- package/dist/node/icon-button/icon-button.module.js +1 -1
- package/dist/node/input/input.js +22 -21
- package/dist/node/input/input.module.js +5 -5
- package/dist/node/item/item.module.js +6 -6
- package/dist/node/layouts/src/page-header/page-header.js +33 -0
- package/dist/node/layouts/src/page-header/page-header.module.js +12 -0
- package/dist/node/link/link.js +14 -12
- package/dist/node/log-viewer/log-viewer.js +26 -26
- package/dist/node/menu/menu.js +20 -20
- package/dist/node/menu-button/menu-button.js +48 -48
- package/dist/node/menubar/menubar.js +42 -42
- package/dist/node/modal/modal.js +41 -35
- package/dist/node/modal/modal.module.js +8 -7
- package/dist/node/multi-select/multi-select.js +57 -57
- package/dist/node/multi-select/multi-select.module.js +11 -11
- package/dist/node/native-select/native-select.js +13 -11
- package/dist/node/navigation-menu/navigation-menu.js +46 -46
- package/dist/node/notification/notification.js +50 -44
- package/dist/node/notification/notification.module.js +7 -7
- package/dist/node/number-input/number-input.js +52 -50
- package/dist/node/number-input/number-input.module.js +8 -8
- package/dist/node/otp-input/otp-input.js +8 -8
- package/dist/node/otp-input/otp-input.module.js +2 -2
- package/dist/node/overflow-menu/overflow-menu.js +18 -13
- package/dist/node/password-input/password-input.js +28 -27
- package/dist/node/password-input/password-input.module.js +7 -7
- package/dist/node/popover/popover.js +26 -24
- package/dist/node/progress/progress.js +3 -2
- package/dist/node/pull-to-refresh/pull-to-refresh.js +13 -13
- package/dist/node/radial-progress/radial-progress.js +5 -5
- package/dist/node/radio/radio.js +23 -22
- package/dist/node/radio-card/radio-card.js +27 -26
- package/dist/node/react/src/index.js +4 -3
- package/dist/node/react/src/theme.js +30 -19
- package/dist/node/resizable/resizable.js +11 -11
- package/dist/node/scroll-area/scroll-area.js +4 -4
- package/dist/node/search/search.js +49 -49
- package/dist/node/search/search.module.js +5 -5
- package/dist/node/select/select.js +27 -26
- package/dist/node/sheet/sheet.js +11 -10
- package/dist/node/sheet/sheet.module.js +5 -5
- package/dist/node/side-nav/side-nav.js +91 -91
- package/dist/node/skip-nav/skip-nav.js +12 -12
- package/dist/node/slider/slider.js +13 -11
- package/dist/node/stat/stat.js +6 -5
- package/dist/node/stat/stat.module.js +7 -7
- package/dist/node/status/status.js +18 -11
- package/dist/node/steps/steps.js +23 -23
- package/dist/node/structured-list/structured-list.js +33 -32
- package/dist/node/tabs/tabs.js +49 -47
- package/dist/node/tag/tag.js +22 -15
- package/dist/node/tags-input/tags-input.js +35 -35
- package/dist/node/tags-input/tags-input.module.js +4 -4
- package/dist/node/textarea/textarea.js +22 -21
- package/dist/node/tile/tile.module.js +3 -3
- package/dist/node/time-picker/time-picker.js +22 -21
- package/dist/node/time-picker/time-picker.module.js +5 -5
- package/dist/node/timeline/timeline.js +22 -16
- package/dist/node/toast/toast.js +15 -15
- package/dist/node/toc/toc.js +8 -8
- package/dist/node/toggle/toggle.js +15 -13
- package/dist/node/toggle-group/toggle-group.js +10 -10
- package/dist/node/toggletip/toggletip.js +9 -9
- package/dist/node/tooltip/tooltip.js +5 -5
- package/dist/node/tree-view/tree-view.js +32 -32
- package/dist/notification/notification.css +1 -1
- package/dist/notification/notification.js +50 -44
- package/dist/notification/notification.module.js +7 -7
- package/dist/number-input/number-input.css +1 -1
- package/dist/number-input/number-input.js +52 -50
- package/dist/number-input/number-input.module.js +8 -8
- package/dist/otp-input/otp-input.css +1 -1
- package/dist/otp-input/otp-input.js +8 -8
- package/dist/otp-input/otp-input.module.js +2 -2
- package/dist/overflow-menu/overflow-menu.js +18 -13
- package/dist/password-input/password-input.css +1 -1
- package/dist/password-input/password-input.js +28 -27
- package/dist/password-input/password-input.module.js +7 -7
- package/dist/popover/popover.js +26 -24
- package/dist/progress/progress.js +3 -2
- package/dist/pull-to-refresh/pull-to-refresh.js +13 -13
- package/dist/radial-progress/radial-progress.js +5 -5
- package/dist/radio/radio.js +23 -22
- package/dist/radio-card/radio-card.js +27 -26
- package/dist/react/src/index.js +4 -3
- package/dist/react/src/theme.js +30 -19
- package/dist/resizable/resizable.js +11 -11
- package/dist/scroll-area/scroll-area.js +4 -4
- package/dist/search/search.css +1 -1
- package/dist/search/search.js +49 -49
- package/dist/search/search.module.js +5 -5
- package/dist/select/select.js +27 -26
- package/dist/sheet/sheet.css +1 -1
- package/dist/sheet/sheet.js +11 -10
- package/dist/sheet/sheet.module.js +5 -5
- package/dist/side-nav/side-nav.js +91 -91
- package/dist/skip-nav/skip-nav.js +12 -12
- package/dist/slider/slider.js +13 -11
- package/dist/stat/stat.css +1 -1
- package/dist/stat/stat.js +6 -5
- package/dist/stat/stat.module.js +7 -7
- package/dist/status/status.js +18 -11
- package/dist/steps/steps.js +23 -23
- package/dist/structured-list/structured-list.js +33 -32
- package/dist/styles.css +87 -23
- package/dist/tabs/tabs.js +49 -47
- package/dist/tag/tag.js +22 -15
- package/dist/tags-input/tags-input.css +1 -1
- package/dist/tags-input/tags-input.js +35 -35
- package/dist/tags-input/tags-input.module.js +4 -4
- package/dist/textarea/textarea.js +22 -21
- package/dist/tile/tile.css +1 -1
- package/dist/tile/tile.module.js +3 -3
- package/dist/time-picker/time-picker.css +1 -1
- package/dist/time-picker/time-picker.js +22 -21
- package/dist/time-picker/time-picker.module.js +5 -5
- package/dist/timeline/timeline.js +22 -16
- package/dist/toast/toast.js +15 -15
- package/dist/toc/toc.js +8 -8
- package/dist/toggle/toggle.js +15 -13
- package/dist/toggle-group/toggle-group.js +10 -10
- package/dist/toggletip/toggletip.js +9 -9
- package/dist/tooltip/tooltip.js +5 -5
- package/dist/tree-view/tree-view.js +32 -32
- package/package.json +10 -4
|
@@ -4,9 +4,9 @@ import { Button as e } from "../button/button.js";
|
|
|
4
4
|
import { Checkbox as t } from "../checkbox/checkbox.js";
|
|
5
5
|
import n from "./data-table.module.js";
|
|
6
6
|
import { batch as r, cn as i, useComputed as a, useSignal as o, useSignalEffect as ee, useSignals as te } from "@cascivo/core";
|
|
7
|
+
import { Fragment as ne, useId as re, useRef as ie } from "react";
|
|
7
8
|
import { builtin as s, t as c } from "@cascivo/i18n";
|
|
8
9
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
-
import { Fragment as ne, useId as re, useRef as ie } from "react";
|
|
10
10
|
import { flushSync as ae } from "react-dom";
|
|
11
11
|
//#region ../components/src/data-table/data-table.tsx
|
|
12
12
|
function d(e, t) {
|
|
@@ -117,6 +117,7 @@ function f({ columns: f, rows: se, getRowId: ce, sort: p, defaultSort: le, sortM
|
|
|
117
117
|
"data-zebra": pe || void 0,
|
|
118
118
|
"data-sticky-header": me || void 0,
|
|
119
119
|
"data-paginated": h ? !0 : void 0,
|
|
120
|
+
"data-fixed-layout": f.every((e) => e.width !== void 0) || void 0,
|
|
120
121
|
children: [
|
|
121
122
|
/* @__PURE__ */ l("span", {
|
|
122
123
|
"aria-live": "polite",
|
|
@@ -176,7 +177,10 @@ function f({ columns: f, rows: se, getRowId: ce, sort: p, defaultSort: le, sortM
|
|
|
176
177
|
/* @__PURE__ */ u("colgroup", { children: [
|
|
177
178
|
v && /* @__PURE__ */ l("col", { className: n.controlCol }),
|
|
178
179
|
g && /* @__PURE__ */ l("col", { className: n.controlCol }),
|
|
179
|
-
f.map((e) => /* @__PURE__ */ l("col", { style: e.width
|
|
180
|
+
f.map((e) => /* @__PURE__ */ l("col", { style: e.width !== void 0 || e.minWidth !== void 0 ? {
|
|
181
|
+
...e.width === void 0 ? {} : { width: e.width },
|
|
182
|
+
...e.minWidth === void 0 ? {} : { minWidth: e.minWidth }
|
|
183
|
+
} : void 0 }, e.key))
|
|
180
184
|
] }),
|
|
181
185
|
/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ u("tr", { children: [
|
|
182
186
|
v && /* @__PURE__ */ l("th", {
|
|
@@ -205,6 +209,7 @@ function f({ columns: f, rows: se, getRowId: ce, sort: p, defaultSort: le, sortM
|
|
|
205
209
|
return /* @__PURE__ */ l("th", {
|
|
206
210
|
scope: "col",
|
|
207
211
|
"data-align": e.align ?? "start",
|
|
212
|
+
"data-sized": e.width !== void 0 || void 0,
|
|
208
213
|
"aria-sort": e.sortable ? r : void 0,
|
|
209
214
|
children: e.sortable ? /* @__PURE__ */ l("button", {
|
|
210
215
|
type: "button",
|
|
@@ -269,6 +274,7 @@ function f({ columns: f, rows: se, getRowId: ce, sort: p, defaultSort: le, sortM
|
|
|
269
274
|
}),
|
|
270
275
|
f.map((t) => /* @__PURE__ */ l("td", {
|
|
271
276
|
"data-align": t.align ?? "start",
|
|
277
|
+
"data-sized": t.width !== void 0 || void 0,
|
|
272
278
|
children: t.render ? t.render(e.row) : String(d(e.row, t.key) ?? "")
|
|
273
279
|
}, t.key))
|
|
274
280
|
]
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
var e = {
|
|
4
|
-
root: "
|
|
5
|
-
toolbar: "
|
|
6
|
-
heading: "
|
|
7
|
-
title: "
|
|
8
|
-
description: "
|
|
9
|
-
search: "
|
|
10
|
-
batchBar: "
|
|
11
|
-
batchCount: "
|
|
12
|
-
batchActions: "
|
|
13
|
-
scroller: "
|
|
14
|
-
scrollerVirtualized: "
|
|
15
|
-
table: "
|
|
16
|
-
row: "
|
|
17
|
-
controlCol: "
|
|
18
|
-
controlCell: "
|
|
19
|
-
sortButton: "
|
|
20
|
-
emptyCell: "
|
|
21
|
-
expansionRow: "
|
|
22
|
-
expansionGrid: "
|
|
23
|
-
expansionInner: "
|
|
24
|
-
expandButton: "
|
|
25
|
-
chevron: "
|
|
26
|
-
shimmer: "
|
|
27
|
-
footer: "
|
|
28
|
-
pageSize: "
|
|
29
|
-
range: "
|
|
30
|
-
pageButtons: "
|
|
31
|
-
pageButton: "
|
|
32
|
-
srOnly: "
|
|
4
|
+
root: "_root_ulang_2",
|
|
5
|
+
toolbar: "_toolbar_ulang_26",
|
|
6
|
+
heading: "_heading_ulang_35",
|
|
7
|
+
title: "_title_ulang_41",
|
|
8
|
+
description: "_description_ulang_47",
|
|
9
|
+
search: "_search_ulang_52",
|
|
10
|
+
batchBar: "_batchBar_ulang_79",
|
|
11
|
+
batchCount: "_batchCount_ulang_89",
|
|
12
|
+
batchActions: "_batchActions_ulang_95",
|
|
13
|
+
scroller: "_scroller_ulang_101",
|
|
14
|
+
scrollerVirtualized: "_scrollerVirtualized_ulang_106",
|
|
15
|
+
table: "_table_ulang_112",
|
|
16
|
+
row: "_row_ulang_182",
|
|
17
|
+
controlCol: "_controlCol_ulang_188",
|
|
18
|
+
controlCell: "_controlCell_ulang_192",
|
|
19
|
+
sortButton: "_sortButton_ulang_198",
|
|
20
|
+
emptyCell: "_emptyCell_ulang_246",
|
|
21
|
+
expansionRow: "_expansionRow_ulang_253",
|
|
22
|
+
expansionGrid: "_expansionGrid_ulang_259",
|
|
23
|
+
expansionInner: "_expansionInner_ulang_263",
|
|
24
|
+
expandButton: "_expandButton_ulang_268",
|
|
25
|
+
chevron: "_chevron_ulang_291",
|
|
26
|
+
shimmer: "_shimmer_ulang_306",
|
|
27
|
+
footer: "_footer_ulang_333",
|
|
28
|
+
pageSize: "_pageSize_ulang_343",
|
|
29
|
+
range: "_range_ulang_369",
|
|
30
|
+
pageButtons: "_pageButtons_ulang_374",
|
|
31
|
+
pageButton: "_pageButton_ulang_374",
|
|
32
|
+
srOnly: "_srOnly_ulang_415"
|
|
33
33
|
};
|
|
34
34
|
//#endregion
|
|
35
35
|
export { e as default };
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./date-picker.module.js";
|
|
4
4
|
import { batch as t, cn as n, createMachine as r, useMachine as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useId as c, useRef as ee } from "react";
|
|
6
|
+
import { builtin as l, currentLocale as te, t as u } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/date-picker/date-picker.tsx
|
|
9
9
|
var p = r({
|
|
10
10
|
initial: "closed",
|
|
@@ -41,9 +41,9 @@ function _(e) {
|
|
|
41
41
|
}
|
|
42
42
|
function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, max: S, clearable: C = !1, label: w, hint: T, error: E, size: D = "md", disabled: O = !1, labels: k, className: re, id: A }) {
|
|
43
43
|
s();
|
|
44
|
-
let [j, M] = i(p), N =
|
|
44
|
+
let [j, M] = i(p), N = c(), P = A ?? `cascade-date-picker-${N}`, F = `${N}-grid`, I = te(), ie = k?.placeholder ?? u(l.datePicker.placeholder), ae = k?.previousMonth ?? u(l.datePicker.previousMonth), L = k?.nextMonth ?? u(l.datePicker.nextMonth), R = k?.clear ?? u(l.datePicker.clear), z = /* @__PURE__ */ new Date(), B = g(z), V = a(r ?? v);
|
|
45
45
|
r !== void 0 && (V.value = r);
|
|
46
|
-
let H = a(V.value ? _(V.value).getUTCFullYear() : z.getUTCFullYear()), U = a(V.value ? _(V.value).getUTCMonth() : z.getUTCMonth()), W = a(V.value), G =
|
|
46
|
+
let H = a(V.value ? _(V.value).getUTCFullYear() : z.getUTCFullYear()), U = a(V.value ? _(V.value).getUTCMonth() : z.getUTCMonth()), W = a(V.value), G = ee(null);
|
|
47
47
|
o(() => {
|
|
48
48
|
if (j.value !== "open") return;
|
|
49
49
|
let e = (e) => {
|
|
@@ -94,20 +94,20 @@ function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, m
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
}, $ = V.value ? h(_(V.value), I) : "";
|
|
97
|
-
return /* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ f("div", {
|
|
98
98
|
ref: G,
|
|
99
99
|
className: n(e.wrapper, re),
|
|
100
100
|
"data-state": E ? "error" : j.value,
|
|
101
101
|
"data-size": D,
|
|
102
102
|
children: [
|
|
103
|
-
w && /* @__PURE__ */
|
|
103
|
+
w && /* @__PURE__ */ d("label", {
|
|
104
104
|
className: e.label,
|
|
105
105
|
htmlFor: P,
|
|
106
106
|
children: w
|
|
107
107
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ f("div", {
|
|
109
109
|
className: e.field,
|
|
110
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ f("button", {
|
|
111
111
|
id: P,
|
|
112
112
|
type: "button",
|
|
113
113
|
role: "combobox",
|
|
@@ -119,15 +119,15 @@ function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, m
|
|
|
119
119
|
className: e.trigger,
|
|
120
120
|
disabled: O,
|
|
121
121
|
onClick: j.value === "open" ? q : K,
|
|
122
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ d("span", {
|
|
123
123
|
className: n(e.value, $ ? void 0 : e.placeholder),
|
|
124
124
|
children: $ || ie
|
|
125
|
-
}), /* @__PURE__ */
|
|
125
|
+
}), /* @__PURE__ */ d("span", {
|
|
126
126
|
className: e.icon,
|
|
127
127
|
"aria-hidden": "true",
|
|
128
128
|
children: "📅"
|
|
129
129
|
})]
|
|
130
|
-
}), C && V.value !== void 0 && /* @__PURE__ */
|
|
130
|
+
}), C && V.value !== void 0 && /* @__PURE__ */ d("button", {
|
|
131
131
|
type: "button",
|
|
132
132
|
className: e.clear,
|
|
133
133
|
"aria-label": R,
|
|
@@ -135,29 +135,29 @@ function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, m
|
|
|
135
135
|
children: "✕"
|
|
136
136
|
})]
|
|
137
137
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ f("div", {
|
|
139
139
|
id: F,
|
|
140
140
|
role: "dialog",
|
|
141
141
|
"aria-label": Q,
|
|
142
142
|
className: e.calendar,
|
|
143
143
|
"data-state": j.value,
|
|
144
144
|
onKeyDown: de,
|
|
145
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ f("div", {
|
|
146
146
|
className: e.header,
|
|
147
147
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ d("button", {
|
|
149
149
|
type: "button",
|
|
150
150
|
className: e.navButton,
|
|
151
151
|
"aria-label": ae,
|
|
152
152
|
onClick: se,
|
|
153
153
|
children: "‹"
|
|
154
154
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ d("span", {
|
|
156
156
|
className: e.monthLabel,
|
|
157
157
|
"aria-live": "polite",
|
|
158
158
|
children: Q
|
|
159
159
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ d("button", {
|
|
161
161
|
type: "button",
|
|
162
162
|
className: e.navButton,
|
|
163
163
|
"aria-label": L,
|
|
@@ -165,20 +165,20 @@ function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, m
|
|
|
165
165
|
children: "›"
|
|
166
166
|
})
|
|
167
167
|
]
|
|
168
|
-
}), /* @__PURE__ */
|
|
168
|
+
}), /* @__PURE__ */ f("table", {
|
|
169
169
|
role: "grid",
|
|
170
170
|
className: e.grid,
|
|
171
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: ue.map((t) => /* @__PURE__ */ d("th", {
|
|
172
172
|
className: e.weekday,
|
|
173
173
|
abbr: t,
|
|
174
174
|
scope: "col",
|
|
175
175
|
children: t
|
|
176
|
-
}, t)) }) }), /* @__PURE__ */
|
|
177
|
-
if (!t) return /* @__PURE__ */
|
|
176
|
+
}, t)) }) }), /* @__PURE__ */ d("tbody", { children: Z.map((t, n) => /* @__PURE__ */ d("tr", { children: t.map((t, n) => {
|
|
177
|
+
if (!t) return /* @__PURE__ */ d("td", { className: e.empty }, n);
|
|
178
178
|
let r = g(t), i = r === V.value, a = r === B, o = r === W.value, s = x !== void 0 && r < x || S !== void 0 && r > S;
|
|
179
|
-
return /* @__PURE__ */
|
|
179
|
+
return /* @__PURE__ */ d("td", {
|
|
180
180
|
className: e.cell,
|
|
181
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ d("button", {
|
|
182
182
|
type: "button",
|
|
183
183
|
className: e.day,
|
|
184
184
|
tabIndex: o ? 0 : -1,
|
|
@@ -200,13 +200,13 @@ function v({ value: r, defaultValue: v, onValueChange: y, onChange: b, min: x, m
|
|
|
200
200
|
}) }, n)) })]
|
|
201
201
|
})]
|
|
202
202
|
}),
|
|
203
|
-
E && /* @__PURE__ */
|
|
203
|
+
E && /* @__PURE__ */ d("span", {
|
|
204
204
|
id: `${N}-error`,
|
|
205
205
|
className: e.error,
|
|
206
206
|
role: "alert",
|
|
207
207
|
children: E
|
|
208
208
|
}),
|
|
209
|
-
!E && T && /* @__PURE__ */
|
|
209
|
+
!E && T && /* @__PURE__ */ d("span", {
|
|
210
210
|
id: `${N}-hint`,
|
|
211
211
|
className: e.hint,
|
|
212
212
|
children: T
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
var e = {
|
|
4
|
-
wrapper: "
|
|
5
|
-
label: "
|
|
6
|
-
field: "
|
|
7
|
-
trigger: "
|
|
8
|
-
value: "
|
|
9
|
-
placeholder: "
|
|
10
|
-
icon: "
|
|
11
|
-
clear: "
|
|
12
|
-
calendar: "
|
|
13
|
-
header: "
|
|
14
|
-
monthLabel: "
|
|
15
|
-
navButton: "
|
|
16
|
-
grid: "
|
|
17
|
-
weekday: "
|
|
18
|
-
cell: "
|
|
19
|
-
empty: "
|
|
20
|
-
day: "
|
|
21
|
-
error: "
|
|
22
|
-
hint: "
|
|
4
|
+
wrapper: "_wrapper_1hgll_2",
|
|
5
|
+
label: "_label_1hgll_31",
|
|
6
|
+
field: "_field_1hgll_38",
|
|
7
|
+
trigger: "_trigger_1hgll_44",
|
|
8
|
+
value: "_value_1hgll_82",
|
|
9
|
+
placeholder: "_placeholder_1hgll_88",
|
|
10
|
+
icon: "_icon_1hgll_91",
|
|
11
|
+
clear: "_clear_1hgll_96",
|
|
12
|
+
calendar: "_calendar_1hgll_121",
|
|
13
|
+
header: "_header_1hgll_153",
|
|
14
|
+
monthLabel: "_monthLabel_1hgll_160",
|
|
15
|
+
navButton: "_navButton_1hgll_166",
|
|
16
|
+
grid: "_grid_1hgll_188",
|
|
17
|
+
weekday: "_weekday_1hgll_193",
|
|
18
|
+
cell: "_cell_1hgll_202",
|
|
19
|
+
empty: "_empty_1hgll_206",
|
|
20
|
+
day: "_day_1hgll_210",
|
|
21
|
+
error: "_error_1hgll_245",
|
|
22
|
+
hint: "_hint_1hgll_249"
|
|
23
23
|
};
|
|
24
24
|
//#endregion
|
|
25
25
|
export { e as default };
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { Calendar as e } from "../calendar/calendar.js";
|
|
4
4
|
import t from "./date-range-picker.module.js";
|
|
5
|
-
import { batch as n, cn as r, useControllableSignal as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { batch as n, cn as r, useControllableSignal as ee, useSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
|
|
6
|
+
import { useRef as s } from "react";
|
|
7
|
+
import { builtin as c, currentLocale as l, t as u } from "@cascivo/i18n";
|
|
8
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
9
|
//#region ../components/src/date-range-picker/date-range-picker.tsx
|
|
10
10
|
function p(e) {
|
|
11
11
|
return Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate());
|
|
@@ -21,15 +21,15 @@ function h(e, t, n) {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
function g({ value: g, defaultValue: _, onValueChange: te, min: v, max: y, disabled: b, presets: x, locale: S, placeholder: C, size: w = "md", labels: T, className: ne }) {
|
|
24
|
-
|
|
25
|
-
let E = S ??
|
|
24
|
+
o();
|
|
25
|
+
let E = S ?? l(), re = C ?? u(c.dateRangePicker.placeholder), D = T?.apply ?? u(c.dateRangePicker.apply), O = T?.clear ?? u(c.dateRangePicker.clear), k = T?.previousMonth ?? u(c.calendar.previousMonth), A = T?.nextMonth ?? u(c.calendar.nextMonth), [j, M] = ee({
|
|
26
26
|
value: g === void 0 ? void 0 : g,
|
|
27
27
|
defaultValue: _ ?? null,
|
|
28
28
|
onChange: (e) => {
|
|
29
29
|
e && te?.(e);
|
|
30
30
|
}
|
|
31
|
-
}), N =
|
|
32
|
-
|
|
31
|
+
}), N = i(!1), P = i(null), F = i(null), I = j.value?.start ?? _?.start ?? /* @__PURE__ */ new Date(), L = i(I.getUTCFullYear()), R = i(I.getUTCMonth()), z = s(null);
|
|
32
|
+
a(() => {
|
|
33
33
|
if (!N.value) return;
|
|
34
34
|
let e = (e) => {
|
|
35
35
|
z.current && !z.current.contains(e.target) && (N.value = !1);
|
|
@@ -102,49 +102,49 @@ function g({ value: g, defaultValue: _, onValueChange: te, min: v, max: y, disab
|
|
|
102
102
|
nextMonth: A
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
return /* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ f("div", {
|
|
106
106
|
ref: z,
|
|
107
107
|
className: r(t.wrapper, ne),
|
|
108
108
|
"data-size": w,
|
|
109
109
|
onKeyDown: (e) => {
|
|
110
110
|
e.key === "Escape" && N.value && (e.stopPropagation(), V());
|
|
111
111
|
},
|
|
112
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ f("button", {
|
|
113
113
|
type: "button",
|
|
114
114
|
role: "combobox",
|
|
115
115
|
"aria-expanded": N.value,
|
|
116
116
|
"aria-haspopup": "dialog",
|
|
117
|
-
"aria-label": T?.label ??
|
|
117
|
+
"aria-label": T?.label ?? u(c.dateRangePicker.label),
|
|
118
118
|
className: t.trigger,
|
|
119
119
|
onClick: N.value ? V : B,
|
|
120
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ d("span", {
|
|
121
121
|
className: r(t.value, Z ? void 0 : t.placeholder),
|
|
122
122
|
children: Z || re
|
|
123
|
-
}), /* @__PURE__ */
|
|
123
|
+
}), /* @__PURE__ */ d("span", {
|
|
124
124
|
className: t.icon,
|
|
125
125
|
"aria-hidden": "true",
|
|
126
126
|
children: "📅"
|
|
127
127
|
})]
|
|
128
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ f("div", {
|
|
129
129
|
role: "dialog",
|
|
130
130
|
className: t.panel,
|
|
131
131
|
"data-state": N.value ? "open" : "closed",
|
|
132
132
|
children: [
|
|
133
|
-
x && x.length > 0 && /* @__PURE__ */
|
|
133
|
+
x && x.length > 0 && /* @__PURE__ */ d("div", {
|
|
134
134
|
className: t.presets,
|
|
135
|
-
children: x.map((e) => /* @__PURE__ */
|
|
135
|
+
children: x.map((e) => /* @__PURE__ */ d("button", {
|
|
136
136
|
type: "button",
|
|
137
137
|
className: t.preset,
|
|
138
138
|
onClick: () => W(e),
|
|
139
139
|
children: e.label
|
|
140
140
|
}, e.label))
|
|
141
141
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ f("div", {
|
|
143
143
|
className: t.calendars,
|
|
144
144
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ d("div", {
|
|
146
146
|
className: t.calNav,
|
|
147
|
-
children: /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ d("button", {
|
|
148
148
|
type: "button",
|
|
149
149
|
className: t.navButton,
|
|
150
150
|
"aria-label": k,
|
|
@@ -152,19 +152,19 @@ function g({ value: g, defaultValue: _, onValueChange: te, min: v, max: y, disab
|
|
|
152
152
|
children: "‹"
|
|
153
153
|
})
|
|
154
154
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ d(e, {
|
|
156
156
|
month: R.value,
|
|
157
157
|
year: L.value,
|
|
158
158
|
...$
|
|
159
159
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ d(e, {
|
|
161
161
|
month: Q.month,
|
|
162
162
|
year: Q.year,
|
|
163
163
|
...$
|
|
164
164
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ d("div", {
|
|
166
166
|
className: t.calNav,
|
|
167
|
-
children: /* @__PURE__ */
|
|
167
|
+
children: /* @__PURE__ */ d("button", {
|
|
168
168
|
type: "button",
|
|
169
169
|
className: t.navButton,
|
|
170
170
|
"aria-label": A,
|
|
@@ -174,14 +174,14 @@ function g({ value: g, defaultValue: _, onValueChange: te, min: v, max: y, disab
|
|
|
174
174
|
})
|
|
175
175
|
]
|
|
176
176
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ f("div", {
|
|
178
178
|
className: t.footer,
|
|
179
|
-
children: [/* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ d("button", {
|
|
180
180
|
type: "button",
|
|
181
181
|
className: t.clearBtn,
|
|
182
182
|
onClick: G,
|
|
183
183
|
children: O
|
|
184
|
-
}), /* @__PURE__ */
|
|
184
|
+
}), /* @__PURE__ */ d("button", {
|
|
185
185
|
type: "button",
|
|
186
186
|
className: t.applyBtn,
|
|
187
187
|
onClick: V,
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./drawer.module.js";
|
|
4
4
|
import { DismissableLayer as t, FocusScope as n, Portal as r, Presence as i, cn as a, useControllableSignal as o, useDraggable as s, useScrollLock as c, useSignals as l } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useId as u } from "react";
|
|
6
|
+
import { builtin as d, t as f } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/drawer/drawer.tsx
|
|
9
9
|
var h = 80;
|
|
10
10
|
function g({ open: g, defaultOpen: _, onOpenChange: v, side: y = "end", size: b, title: x, description: S, children: C, labels: w, className: T, swipeToDismiss: E = !1 }) {
|
|
@@ -22,25 +22,25 @@ function g({ open: g, defaultOpen: _, onOpenChange: v, side: y = "end", size: b,
|
|
|
22
22
|
let t = k === "y" ? e.y : e.x, n = y === "end" && t > h || y === "start" && t < -80 || y === "bottom" && t > h || y === "top" && t < -80;
|
|
23
23
|
N(), n && O(!1);
|
|
24
24
|
}
|
|
25
|
-
}), P =
|
|
25
|
+
}), P = u(), F = u(), I = w?.close ?? f(d.drawer.close), L = {
|
|
26
26
|
...b ? { "--_drawer-size": b } : {},
|
|
27
27
|
...E ? {
|
|
28
28
|
"--_drawer-drag-x": `${j.value.x}px`,
|
|
29
29
|
"--_drawer-drag-y": `${j.value.y}px`
|
|
30
30
|
} : {}
|
|
31
31
|
};
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ p(r, { children: /* @__PURE__ */ p(i, {
|
|
33
33
|
present: D,
|
|
34
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ p("div", {
|
|
35
35
|
className: e.overlay,
|
|
36
36
|
"data-side": y,
|
|
37
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ p(t, {
|
|
38
38
|
onDismiss: () => O(!1),
|
|
39
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ p(n, {
|
|
40
40
|
trapped: !0,
|
|
41
41
|
restoreFocus: !0,
|
|
42
42
|
autoFocus: !0,
|
|
43
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ m("div", {
|
|
44
44
|
role: "dialog",
|
|
45
45
|
"aria-modal": "true",
|
|
46
46
|
"aria-labelledby": x ? P : void 0,
|
|
@@ -49,30 +49,30 @@ function g({ open: g, defaultOpen: _, onOpenChange: v, side: y = "end", size: b,
|
|
|
49
49
|
"data-dragging": E && M.value ? "" : void 0,
|
|
50
50
|
className: a(e.panel, T),
|
|
51
51
|
style: L,
|
|
52
|
-
children: [(x || S) && /* @__PURE__ */
|
|
52
|
+
children: [(x || S) && /* @__PURE__ */ m("div", {
|
|
53
53
|
className: e.header,
|
|
54
54
|
ref: E ? A : void 0,
|
|
55
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ m("div", {
|
|
56
56
|
className: e.heading,
|
|
57
|
-
children: [x && /* @__PURE__ */
|
|
57
|
+
children: [x && /* @__PURE__ */ p("h2", {
|
|
58
58
|
id: P,
|
|
59
59
|
className: e.title,
|
|
60
60
|
children: x
|
|
61
|
-
}), S && /* @__PURE__ */
|
|
61
|
+
}), S && /* @__PURE__ */ p("p", {
|
|
62
62
|
id: F,
|
|
63
63
|
className: e.description,
|
|
64
64
|
children: S
|
|
65
65
|
})]
|
|
66
|
-
}), /* @__PURE__ */
|
|
66
|
+
}), /* @__PURE__ */ p("button", {
|
|
67
67
|
type: "button",
|
|
68
68
|
"aria-label": I,
|
|
69
69
|
onClick: () => O(!1),
|
|
70
70
|
className: e.close,
|
|
71
|
-
children: /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ p("svg", {
|
|
72
72
|
"aria-hidden": "true",
|
|
73
73
|
viewBox: "0 0 16 16",
|
|
74
74
|
className: e.closeIcon,
|
|
75
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ p("path", {
|
|
76
76
|
d: "M4 4l8 8M12 4l-8 8",
|
|
77
77
|
fill: "none",
|
|
78
78
|
stroke: "currentColor",
|
|
@@ -81,8 +81,9 @@ function g({ open: g, defaultOpen: _, onOpenChange: v, side: y = "end", size: b,
|
|
|
81
81
|
})
|
|
82
82
|
})
|
|
83
83
|
})]
|
|
84
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ p("div", {
|
|
85
85
|
className: e.body,
|
|
86
|
+
"data-cascivo-drawer-body": "",
|
|
86
87
|
children: C
|
|
87
88
|
})]
|
|
88
89
|
})
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
var e = {
|
|
4
|
-
overlay: "
|
|
5
|
-
panel: "
|
|
6
|
-
header: "
|
|
7
|
-
heading: "
|
|
8
|
-
title: "
|
|
9
|
-
description: "
|
|
10
|
-
close: "
|
|
11
|
-
closeIcon: "
|
|
12
|
-
body: "
|
|
4
|
+
overlay: "_overlay_1q94b_2",
|
|
5
|
+
panel: "_panel_1q94b_39",
|
|
6
|
+
header: "_header_1q94b_124",
|
|
7
|
+
heading: "_heading_1q94b_134",
|
|
8
|
+
title: "_title_1q94b_140",
|
|
9
|
+
description: "_description_1q94b_147",
|
|
10
|
+
close: "_close_1q94b_153",
|
|
11
|
+
closeIcon: "_closeIcon_1q94b_181",
|
|
12
|
+
body: "_body_1q94b_186"
|
|
13
13
|
};
|
|
14
14
|
//#endregion
|
|
15
15
|
export { e as default };
|