@xanui/ui 1.1.36 → 1.1.38
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/Accordion/index.js +19 -21
- package/Accordion/index.js.map +1 -1
- package/Alert/index.js +33 -35
- package/Alert/index.js.map +1 -1
- package/Autocomplete/index.js +23 -25
- package/Autocomplete/index.js.map +1 -1
- package/Avatar/index.js +15 -17
- package/Avatar/index.js.map +1 -1
- package/Badge/index.js +12 -14
- package/Badge/index.js.map +1 -1
- package/Box/index.js +7 -9
- package/Box/index.js.map +1 -1
- package/Button/index.js +17 -19
- package/Button/index.js.map +1 -1
- package/ButtonGroup/index.js +12 -14
- package/ButtonGroup/index.js.map +1 -1
- package/Calendar/index.js +39 -41
- package/Calendar/index.js.map +1 -1
- package/CalendarInput/index.js +19 -21
- package/CalendarInput/index.js.map +1 -1
- package/Checkbox/index.js +14 -16
- package/Checkbox/index.js.map +1 -1
- package/Chip/index.js +12 -14
- package/Chip/index.js.map +1 -1
- package/CircleProgress/index.js +13 -15
- package/CircleProgress/index.js.map +1 -1
- package/ClickOutside/index.js +9 -11
- package/ClickOutside/index.js.map +1 -1
- package/Collaps/index.js +9 -11
- package/Collaps/index.js.map +1 -1
- package/Container/index.js +9 -11
- package/Container/index.js.map +1 -1
- package/DataFilter/index.js +30 -41
- package/DataFilter/index.js.map +1 -1
- package/DataFilter/options/DateFilter.js +16 -18
- package/DataFilter/options/DateFilter.js.map +1 -1
- package/DataFilter/options/DateRangeFilter.js +12 -14
- package/DataFilter/options/DateRangeFilter.js.map +1 -1
- package/DataFilter/options/MultiSelectFilter.js +20 -22
- package/DataFilter/options/MultiSelectFilter.js.map +1 -1
- package/DataFilter/options/NumberFilter.js +11 -13
- package/DataFilter/options/NumberFilter.js.map +1 -1
- package/DataFilter/options/NumberRangeFilter.js +12 -14
- package/DataFilter/options/NumberRangeFilter.js.map +1 -1
- package/DataFilter/options/SelectFilter.js +18 -20
- package/DataFilter/options/SelectFilter.js.map +1 -1
- package/DataFilter/options/TextFilter.js +11 -13
- package/DataFilter/options/TextFilter.js.map +1 -1
- package/Datatable/FilterBox.js +21 -23
- package/Datatable/FilterBox.js.map +1 -1
- package/Datatable/Row.js +19 -21
- package/Datatable/Row.js.map +1 -1
- package/Datatable/SelectedBox.js +10 -12
- package/Datatable/SelectedBox.js.map +1 -1
- package/Datatable/Table.js +8 -10
- package/Datatable/Table.js.map +1 -1
- package/Datatable/TableHead.js +18 -20
- package/Datatable/TableHead.js.map +1 -1
- package/Datatable/index.js +21 -23
- package/Datatable/index.js.map +1 -1
- package/Divider/index.js +8 -10
- package/Divider/index.js.map +1 -1
- package/Drawer/index.js +12 -14
- package/Drawer/index.js.map +1 -1
- package/Form/index.js +8 -10
- package/Form/index.js.map +1 -1
- package/GridContainer/index.js +7 -9
- package/GridContainer/index.js.map +1 -1
- package/GridItem/index.js +7 -9
- package/GridItem/index.js.map +1 -1
- package/IconButton/index.js +12 -14
- package/IconButton/index.js.map +1 -1
- package/Image/index.js +9 -11
- package/Image/index.js.map +1 -1
- package/Input/index.js +18 -20
- package/Input/index.js.map +1 -1
- package/InputNumber/index.js +6 -8
- package/InputNumber/index.js.map +1 -1
- package/Label/index.js +7 -9
- package/Label/index.js.map +1 -1
- package/Layer/index.js +19 -21
- package/Layer/index.js.map +1 -1
- package/LineProgress/index.js +11 -13
- package/LineProgress/index.js.map +1 -1
- package/List/ListContext.js +2 -5
- package/List/ListContext.js.map +1 -1
- package/List/index.js +12 -14
- package/List/index.js.map +1 -1
- package/ListItem/index.js +12 -14
- package/ListItem/index.js.map +1 -1
- package/LoadingBox/index.js +11 -13
- package/LoadingBox/index.js.map +1 -1
- package/Menu/index.js +18 -20
- package/Menu/index.js.map +1 -1
- package/Modal/index.js +15 -17
- package/Modal/index.js.map +1 -1
- package/NoSSR/index.js +4 -6
- package/NoSSR/index.js.map +1 -1
- package/Option/index.js +7 -9
- package/Option/index.js.map +1 -1
- package/Paper/index.js +8 -10
- package/Paper/index.js.map +1 -1
- package/Portal/index.js +9 -11
- package/Portal/index.js.map +1 -1
- package/Radio/index.js +9 -11
- package/Radio/index.js.map +1 -1
- package/Scrollbar/index.js +10 -12
- package/Scrollbar/index.js.map +1 -1
- package/Select/index.js +22 -24
- package/Select/index.js.map +1 -1
- package/Skeleton/index.js +7 -9
- package/Skeleton/index.js.map +1 -1
- package/Stack/index.js +7 -9
- package/Stack/index.js.map +1 -1
- package/Switch/index.js +12 -14
- package/Switch/index.js.map +1 -1
- package/Tab/index.js +9 -11
- package/Tab/index.js.map +1 -1
- package/Table/index.js +13 -15
- package/Table/index.js.map +1 -1
- package/TableBody/index.js +7 -9
- package/TableBody/index.js.map +1 -1
- package/TableCell/index.js +7 -9
- package/TableCell/index.js.map +1 -1
- package/TableFooter/index.js +7 -9
- package/TableFooter/index.js.map +1 -1
- package/TableHead/index.js +7 -9
- package/TableHead/index.js.map +1 -1
- package/TablePagination/index.js +21 -23
- package/TablePagination/index.js.map +1 -1
- package/TableRow/index.js +7 -9
- package/TableRow/index.js.map +1 -1
- package/Tabs/index.js +19 -21
- package/Tabs/index.js.map +1 -1
- package/Text/index.js +8 -10
- package/Text/index.js.map +1 -1
- package/Toast/index.js +18 -20
- package/Toast/index.js.map +1 -1
- package/Tooltip/index.js +11 -13
- package/Tooltip/index.js.map +1 -1
- package/ViewBox/index.js +11 -13
- package/ViewBox/index.js.map +1 -1
- package/index.js +64 -133
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/useAlert/index.js +12 -14
- package/useAlert/index.js.map +1 -1
- package/useBlurCss/index.js +5 -7
- package/useBlurCss/index.js.map +1 -1
- package/useCorner/index.js +1 -3
- package/useCorner/index.js.map +1 -1
- package/useLayer/index.js +7 -9
- package/useLayer/index.js.map +1 -1
- package/useModal/index.js +8 -10
- package/useModal/index.js.map +1 -1
package/Skeleton/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var core = require('@xanui/core');
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Tag } from '@xanui/core';
|
|
7
5
|
|
|
8
6
|
const Skeleton = React.forwardRef((_a, ref) => {
|
|
9
|
-
var { children, loading, color, animation } = _a, props =
|
|
7
|
+
var { children, loading, color, animation } = _a, props = __rest(_a, ["children", "loading", "color", "animation"]);
|
|
10
8
|
if (!children)
|
|
11
9
|
loading = true;
|
|
12
10
|
if (loading) {
|
|
@@ -51,10 +49,10 @@ const Skeleton = React.forwardRef((_a, ref) => {
|
|
|
51
49
|
};
|
|
52
50
|
break;
|
|
53
51
|
}
|
|
54
|
-
return (
|
|
52
|
+
return (jsx(Tag, Object.assign({}, props, { baseClass: 'skeleton', ref: ref, sxr: sxr })));
|
|
55
53
|
}
|
|
56
54
|
return children;
|
|
57
55
|
});
|
|
58
56
|
|
|
59
|
-
|
|
57
|
+
export { Skeleton as default };
|
|
60
58
|
//# sourceMappingURL=index.js.map
|
package/Skeleton/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Skeleton/index.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type SkeletonProps<T extends TagComponentType = \"div\"> = TagProps<T> & {\r\n animation?: 'pulse' | 'wave' | 'none';\r\n loading?: boolean;\r\n}\r\n\r\nconst Skeleton = React.forwardRef(<T extends TagComponentType = \"div\">({ children, loading, color, animation, ...props }: SkeletonProps<T>, ref: React.Ref<any>) => {\r\n\r\n if (!children) loading = true\r\n\r\n if (loading) {\r\n animation ??= 'pulse'\r\n color ??= \"default\"\r\n let sxr: any = {}\r\n switch (animation) {\r\n case 'pulse':\r\n sxr = {\r\n bgcolor: \"divider.primary\",\r\n width: \"100%\",\r\n animation: 'skpulse 1.5s infinite',\r\n \"@keyframes skpulse\": {\r\n '0%, 100%': {\r\n opacity: 1,\r\n },\r\n '50%': {\r\n opacity: 0.4,\r\n },\r\n }\r\n }\r\n break;\r\n case 'wave':\r\n sxr = {\r\n position: 'relative',\r\n overflow: 'hidden',\r\n bgcolor: \"divider.primary\",\r\n \"&::after\": {\r\n content: '\"\"',\r\n position: 'absolute',\r\n top: 0,\r\n left: \"0%\",\r\n width: '100%',\r\n height: '100%',\r\n animation: 'skwave 2s infinite',\r\n background: `linear-gradient(90deg, transparent 0%, var(--color-divider-secondary) 50%, transparent 100%)`,\r\n },\r\n \"@keyframes skwave\": {\r\n '0%': { left: '-100%' },\r\n '100%': { left: '100%' }\r\n }\r\n }\r\n break;\r\n }\r\n return (\r\n <Tag\r\n {...props}\r\n baseClass='skeleton'\r\n ref={ref}\r\n sxr={sxr}\r\n />\r\n )\r\n }\r\n\r\n return children\r\n})\r\n\r\nexport default Skeleton\r\n\r\n"],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Skeleton/index.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type SkeletonProps<T extends TagComponentType = \"div\"> = TagProps<T> & {\r\n animation?: 'pulse' | 'wave' | 'none';\r\n loading?: boolean;\r\n}\r\n\r\nconst Skeleton = React.forwardRef(<T extends TagComponentType = \"div\">({ children, loading, color, animation, ...props }: SkeletonProps<T>, ref: React.Ref<any>) => {\r\n\r\n if (!children) loading = true\r\n\r\n if (loading) {\r\n animation ??= 'pulse'\r\n color ??= \"default\"\r\n let sxr: any = {}\r\n switch (animation) {\r\n case 'pulse':\r\n sxr = {\r\n bgcolor: \"divider.primary\",\r\n width: \"100%\",\r\n animation: 'skpulse 1.5s infinite',\r\n \"@keyframes skpulse\": {\r\n '0%, 100%': {\r\n opacity: 1,\r\n },\r\n '50%': {\r\n opacity: 0.4,\r\n },\r\n }\r\n }\r\n break;\r\n case 'wave':\r\n sxr = {\r\n position: 'relative',\r\n overflow: 'hidden',\r\n bgcolor: \"divider.primary\",\r\n \"&::after\": {\r\n content: '\"\"',\r\n position: 'absolute',\r\n top: 0,\r\n left: \"0%\",\r\n width: '100%',\r\n height: '100%',\r\n animation: 'skwave 2s infinite',\r\n background: `linear-gradient(90deg, transparent 0%, var(--color-divider-secondary) 50%, transparent 100%)`,\r\n },\r\n \"@keyframes skwave\": {\r\n '0%': { left: '-100%' },\r\n '100%': { left: '100%' }\r\n }\r\n }\r\n break;\r\n }\r\n return (\r\n <Tag\r\n {...props}\r\n baseClass='skeleton'\r\n ref={ref}\r\n sxr={sxr}\r\n />\r\n )\r\n }\r\n\r\n return children\r\n})\r\n\r\nexport default Skeleton\r\n\r\n"],"names":["_jsx"],"mappings":";;;;;AAQA,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAqC,EAAmE,EAAE,GAAmB,KAAI;AAA5F,IAAA,IAAA,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAA,GAAA,EAA8B,EAAzB,KAAK,GAAA,MAAA,CAAA,EAAA,EAA/C,CAAA,UAAA,EAAA,SAAA,EAAA,OAAA,EAAA,WAAA,CAAiD,CAAF;AAEnH,IAAA,IAAI,CAAC,QAAQ;QAAE,OAAO,GAAG,IAAI;IAE7B,IAAI,OAAO,EAAE;QACV,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,MAAA,GAAT,SAAS,IAAT,SAAS,GAAK,OAAO,CAAA;QACrB,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAL,KAAK,IAAL,KAAK,GAAK,SAAS,CAAA;QACnB,IAAI,GAAG,GAAQ,EAAE;QACjB,QAAQ,SAAS;AACd,YAAA,KAAK,OAAO;AACT,gBAAA,GAAG,GAAG;AACH,oBAAA,OAAO,EAAE,iBAAiB;AAC1B,oBAAA,KAAK,EAAE,MAAM;AACb,oBAAA,SAAS,EAAE,uBAAuB;AAClC,oBAAA,oBAAoB,EAAE;AACnB,wBAAA,UAAU,EAAE;AACT,4BAAA,OAAO,EAAE,CAAC;AACZ,yBAAA;AACD,wBAAA,KAAK,EAAE;AACJ,4BAAA,OAAO,EAAE,GAAG;AACd,yBAAA;AACH;iBACH;gBACD;AACH,YAAA,KAAK,MAAM;AACR,gBAAA,GAAG,GAAG;AACH,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,QAAQ,EAAE,QAAQ;AAClB,oBAAA,OAAO,EAAE,iBAAiB;AAC1B,oBAAA,UAAU,EAAE;AACT,wBAAA,OAAO,EAAE,IAAI;AACb,wBAAA,QAAQ,EAAE,UAAU;AACpB,wBAAA,GAAG,EAAE,CAAC;AACN,wBAAA,IAAI,EAAE,IAAI;AACV,wBAAA,KAAK,EAAE,MAAM;AACb,wBAAA,MAAM,EAAE,MAAM;AACd,wBAAA,SAAS,EAAE,oBAAoB;AAC/B,wBAAA,UAAU,EAAE,CAAA,4FAAA,CAA8F;AAC5G,qBAAA;AACD,oBAAA,mBAAmB,EAAE;AAClB,wBAAA,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;AACvB,wBAAA,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM;AACxB;iBACH;gBACD;;AAEN,QAAA,QACGA,GAAA,CAAC,GAAG,oBACG,KAAK,EAAA,EACT,SAAS,EAAC,UAAU,EACpB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EAAA,CAAA,CACT;IAER;AAEA,IAAA,OAAO,QAAQ;AAClB,CAAC;;;;"}
|
package/Stack/index.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var core = require('@xanui/core');
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Tag } from '@xanui/core';
|
|
7
5
|
|
|
8
6
|
const Stack = React.forwardRef((_a, ref) => {
|
|
9
|
-
var { children } = _a, props =
|
|
10
|
-
return (
|
|
7
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
8
|
+
return (jsx(Tag, Object.assign({}, props, { sxr: {
|
|
11
9
|
display: "flex",
|
|
12
10
|
flexDirection: "column",
|
|
13
11
|
}, baseClass: 'stack', ref: ref, children: children })));
|
|
14
12
|
});
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
export { Stack as default };
|
|
17
15
|
//# sourceMappingURL=index.js.map
|
package/Stack/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Stack/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type StackProps<T extends TagComponentType = \"div\"> = TagProps<T>\r\n\r\nconst Stack = React.forwardRef(<T extends TagComponentType = \"div\">({ children, ...props }: StackProps<T>, ref?: React.Ref<any>) => {\r\n return (\r\n <Tag\r\n {...props}\r\n sxr={{\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n }}\r\n baseClass='stack'\r\n ref={ref}\r\n >{children}</Tag>\r\n )\r\n})\r\n\r\nexport default Stack\r\n"],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Stack/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type StackProps<T extends TagComponentType = \"div\"> = TagProps<T>\r\n\r\nconst Stack = React.forwardRef(<T extends TagComponentType = \"div\">({ children, ...props }: StackProps<T>, ref?: React.Ref<any>) => {\r\n return (\r\n <Tag\r\n {...props}\r\n sxr={{\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n }}\r\n baseClass='stack'\r\n ref={ref}\r\n >{children}</Tag>\r\n )\r\n})\r\n\r\nexport default Stack\r\n"],"names":["_jsx"],"mappings":";;;;;AAMA,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAqC,EAAqC,EAAE,GAAoB,KAAI;AAA/D,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAA2B,EAAtB,KAAK,GAAA,MAAA,CAAA,EAAA,EAApB,YAAsB,CAAF;AACpF,IAAA,QACIA,GAAA,CAAC,GAAG,oBACI,KAAK,EAAA,EACT,GAAG,EAAE;AACD,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,aAAa,EAAE,QAAQ;SAC1B,EACD,SAAS,EAAC,OAAO,EACjB,GAAG,EAAE,GAAG,EAAA,QAAA,EACV,QAAQ,EAAA,CAAA,CAAO;AAEzB,CAAC;;;;"}
|
package/Switch/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var core = require('@xanui/core');
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
import { useInterface, useBreakpointProps, Tag } from '@xanui/core';
|
|
8
6
|
|
|
9
7
|
const Switch = React.forwardRef((props, ref) => {
|
|
10
8
|
var _a, _b;
|
|
11
|
-
let [_c] =
|
|
9
|
+
let [_c] = useInterface("Switch", props, {}), { size, checked, color, disabled, icon, onChange, trackSize, slotProps } = _c, rest = __rest(_c, ["size", "checked", "color", "disabled", "icon", "onChange", "trackSize", "slotProps"]);
|
|
12
10
|
const _p = {};
|
|
13
11
|
if (size)
|
|
14
12
|
_p.size = size;
|
|
@@ -20,13 +18,13 @@ const Switch = React.forwardRef((props, ref) => {
|
|
|
20
18
|
_p.trackSize = trackSize;
|
|
21
19
|
if (icon)
|
|
22
20
|
_p.icon = icon;
|
|
23
|
-
const p =
|
|
21
|
+
const p = useBreakpointProps(_p);
|
|
24
22
|
size = (_a = p.size) !== null && _a !== void 0 ? _a : "medium";
|
|
25
23
|
color = (_b = p.color) !== null && _b !== void 0 ? _b : "brand";
|
|
26
24
|
disabled = p.disabled;
|
|
27
25
|
trackSize = p.trackSize;
|
|
28
26
|
icon = p.icon;
|
|
29
|
-
const [c, set] =
|
|
27
|
+
const [c, set] = useState(false);
|
|
30
28
|
checked !== null && checked !== void 0 ? checked : (checked = c);
|
|
31
29
|
onChange = onChange || (() => set(!c));
|
|
32
30
|
let sizes = {
|
|
@@ -42,13 +40,13 @@ const Switch = React.forwardRef((props, ref) => {
|
|
|
42
40
|
if (!isNormalSize) {
|
|
43
41
|
transform = checked ? "100%" : "-10%";
|
|
44
42
|
}
|
|
45
|
-
return (
|
|
43
|
+
return (jsxs(Tag, { disabled: disabled, sxr: {
|
|
46
44
|
width: _size,
|
|
47
45
|
height: height,
|
|
48
46
|
position: "relative",
|
|
49
47
|
cursor: "pointer",
|
|
50
48
|
display: "inline-block"
|
|
51
|
-
}, onClick: onChange, children: [
|
|
49
|
+
}, onClick: onChange, children: [jsx(Tag, Object.assign({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.track, { baseClass: 'switch-track-bar', sxr: {
|
|
52
50
|
width: _size,
|
|
53
51
|
height: trackSize,
|
|
54
52
|
borderRadius: height,
|
|
@@ -56,7 +54,7 @@ const Switch = React.forwardRef((props, ref) => {
|
|
|
56
54
|
top: "50%",
|
|
57
55
|
transform: "translateY(-50%)",
|
|
58
56
|
bgcolor: checked ? color : "divider",
|
|
59
|
-
} })),
|
|
57
|
+
} })), jsx(Tag, Object.assign({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.thumb, { baseClass: 'switch-thumb', sxr: {
|
|
60
58
|
transition: "all .25s",
|
|
61
59
|
width: height,
|
|
62
60
|
height: height,
|
|
@@ -70,10 +68,10 @@ const Switch = React.forwardRef((props, ref) => {
|
|
|
70
68
|
display: "flex",
|
|
71
69
|
justifyContent: "center",
|
|
72
70
|
alignItems: "center"
|
|
73
|
-
}, children: icon })),
|
|
71
|
+
}, children: icon })), jsx(Tag, Object.assign({}, rest, { component: 'input', ref: ref, type: "radio", readOnly: true, checked: checked, sxr: {
|
|
74
72
|
display: "none!important"
|
|
75
73
|
} }))] }));
|
|
76
74
|
});
|
|
77
75
|
|
|
78
|
-
|
|
76
|
+
export { Switch as default };
|
|
79
77
|
//# sourceMappingURL=index.js.map
|
package/Switch/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Switch/index.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { ReactElement, useState } from 'react';\r\nimport { Tag, TagProps, useBreakpointProps, UseColorTemplateColor, useInterface, useBreakpointPropsType } from '@xanui/core';\r\n\r\n\r\nexport type SwitchProps = Omit<TagProps<\"input\">, \"color\" | \"size\" | \"component\" | \"type\" | \"checked\"> & {\r\n checked?: boolean;\r\n size?: useBreakpointPropsType<number | \"small\" | \"medium\" | \"large\">;\r\n color?: useBreakpointPropsType<Omit<UseColorTemplateColor, \"default\">>;\r\n disabled?: useBreakpointPropsType<boolean>;\r\n trackSize?: useBreakpointPropsType<number>;\r\n icon?: useBreakpointPropsType<ReactElement>;\r\n slotProps?: {\r\n thumb?: Omit<TagProps, 'children'>;\r\n track?: Omit<TagProps, 'children'>;\r\n }\r\n}\r\n\r\nconst Switch = React.forwardRef((props: SwitchProps, ref?: React.Ref<any>) => {\r\n let [{ size, checked, color, disabled, icon, onChange, trackSize, slotProps, ...rest }] = useInterface<any>(\"Switch\", props, {})\r\n const _p: any = {}\r\n if (size) _p.size = size\r\n if (color) _p.color = color\r\n if (disabled) _p.disabled = disabled\r\n if (trackSize) _p.trackSize = trackSize\r\n if (icon) _p.icon = icon\r\n const p: any = useBreakpointProps(_p)\r\n size = p.size ?? \"medium\"\r\n color = p.color ?? \"brand\"\r\n disabled = p.disabled\r\n trackSize = p.trackSize\r\n icon = p.icon\r\n\r\n const [c, set] = useState(false)\r\n checked ??= c\r\n\r\n onChange = onChange || (() => set(!c));\r\n\r\n let sizes: any = {\r\n small: 32,\r\n medium: 48,\r\n large: 60\r\n }\r\n let _size = sizes[size as any] || size\r\n\r\n let height = (_size / 2)\r\n trackSize ??= height + 4\r\n let isNormalSize = (height + 4) === trackSize\r\n let transform = checked ? \"92%\" : \"8%\"\r\n if (!isNormalSize) {\r\n transform = checked ? \"100%\" : \"-10%\"\r\n }\r\n\r\n return (\r\n <Tag\r\n disabled={disabled}\r\n sxr={{\r\n width: _size,\r\n height: height,\r\n position: \"relative\",\r\n cursor: \"pointer\",\r\n display: \"inline-block\"\r\n }}\r\n onClick={onChange}\r\n >\r\n <Tag\r\n {...slotProps?.track}\r\n baseClass='switch-track-bar'\r\n sxr={{\r\n width: _size,\r\n height: trackSize,\r\n borderRadius: height,\r\n position: 'absolute',\r\n top: \"50%\",\r\n transform: \"translateY(-50%)\",\r\n bgcolor: checked ? color : \"divider\",\r\n\r\n }}\r\n >\r\n </Tag>\r\n <Tag\r\n {...slotProps?.thumb}\r\n baseClass='switch-thumb'\r\n sxr={{\r\n transition: \"all .25s\",\r\n width: height,\r\n height: height,\r\n radius: height,\r\n bgcolor: \"#FFFFFF\",\r\n position: \"absolute\",\r\n top: \"50%\",\r\n border: isNormalSize ? 0 : 1,\r\n left: 0,\r\n transform: `translate(${transform}, -50%)`,\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n alignItems: \"center\"\r\n }}\r\n >\r\n {\r\n icon\r\n }\r\n </Tag>\r\n <Tag\r\n {...rest}\r\n component='input'\r\n ref={ref}\r\n type=\"radio\"\r\n readOnly\r\n checked={checked}\r\n sxr={{\r\n display: \"none!important\"\r\n }}\r\n />\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default Switch\r\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Switch/index.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { ReactElement, useState } from 'react';\r\nimport { Tag, TagProps, useBreakpointProps, UseColorTemplateColor, useInterface, useBreakpointPropsType } from '@xanui/core';\r\n\r\n\r\nexport type SwitchProps = Omit<TagProps<\"input\">, \"color\" | \"size\" | \"component\" | \"type\" | \"checked\"> & {\r\n checked?: boolean;\r\n size?: useBreakpointPropsType<number | \"small\" | \"medium\" | \"large\">;\r\n color?: useBreakpointPropsType<Omit<UseColorTemplateColor, \"default\">>;\r\n disabled?: useBreakpointPropsType<boolean>;\r\n trackSize?: useBreakpointPropsType<number>;\r\n icon?: useBreakpointPropsType<ReactElement>;\r\n slotProps?: {\r\n thumb?: Omit<TagProps, 'children'>;\r\n track?: Omit<TagProps, 'children'>;\r\n }\r\n}\r\n\r\nconst Switch = React.forwardRef((props: SwitchProps, ref?: React.Ref<any>) => {\r\n let [{ size, checked, color, disabled, icon, onChange, trackSize, slotProps, ...rest }] = useInterface<any>(\"Switch\", props, {})\r\n const _p: any = {}\r\n if (size) _p.size = size\r\n if (color) _p.color = color\r\n if (disabled) _p.disabled = disabled\r\n if (trackSize) _p.trackSize = trackSize\r\n if (icon) _p.icon = icon\r\n const p: any = useBreakpointProps(_p)\r\n size = p.size ?? \"medium\"\r\n color = p.color ?? \"brand\"\r\n disabled = p.disabled\r\n trackSize = p.trackSize\r\n icon = p.icon\r\n\r\n const [c, set] = useState(false)\r\n checked ??= c\r\n\r\n onChange = onChange || (() => set(!c));\r\n\r\n let sizes: any = {\r\n small: 32,\r\n medium: 48,\r\n large: 60\r\n }\r\n let _size = sizes[size as any] || size\r\n\r\n let height = (_size / 2)\r\n trackSize ??= height + 4\r\n let isNormalSize = (height + 4) === trackSize\r\n let transform = checked ? \"92%\" : \"8%\"\r\n if (!isNormalSize) {\r\n transform = checked ? \"100%\" : \"-10%\"\r\n }\r\n\r\n return (\r\n <Tag\r\n disabled={disabled}\r\n sxr={{\r\n width: _size,\r\n height: height,\r\n position: \"relative\",\r\n cursor: \"pointer\",\r\n display: \"inline-block\"\r\n }}\r\n onClick={onChange}\r\n >\r\n <Tag\r\n {...slotProps?.track}\r\n baseClass='switch-track-bar'\r\n sxr={{\r\n width: _size,\r\n height: trackSize,\r\n borderRadius: height,\r\n position: 'absolute',\r\n top: \"50%\",\r\n transform: \"translateY(-50%)\",\r\n bgcolor: checked ? color : \"divider\",\r\n\r\n }}\r\n >\r\n </Tag>\r\n <Tag\r\n {...slotProps?.thumb}\r\n baseClass='switch-thumb'\r\n sxr={{\r\n transition: \"all .25s\",\r\n width: height,\r\n height: height,\r\n radius: height,\r\n bgcolor: \"#FFFFFF\",\r\n position: \"absolute\",\r\n top: \"50%\",\r\n border: isNormalSize ? 0 : 1,\r\n left: 0,\r\n transform: `translate(${transform}, -50%)`,\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n alignItems: \"center\"\r\n }}\r\n >\r\n {\r\n icon\r\n }\r\n </Tag>\r\n <Tag\r\n {...rest}\r\n component='input'\r\n ref={ref}\r\n type=\"radio\"\r\n readOnly\r\n checked={checked}\r\n sxr={{\r\n display: \"none!important\"\r\n }}\r\n />\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default Switch\r\n"],"names":[],"mappings":";;;;;;AAmBA;;AACI;;AAEA;AAAU;AACV;AAAW;AACX;AAAc;AACd;AAAe;AACf;AAAU;AACV;AACA;AACA;AACA;AACA;AACA;;;AAKA;AAEA;AACI;AACA;AACA;;;AAIJ;;;;;;;;AAYY;AACA;AACA;AACA;AACA;;AAQI;AACA;AACA;AACA;AACA;AACA;;AAGH;AAOG;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAeA;;AAKpB;;"}
|
package/Tab/index.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var core = require('@xanui/core');
|
|
8
|
-
var index = require('../Button/index.js');
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { useInterface } from '@xanui/core';
|
|
6
|
+
import Button from '../Button/index.js';
|
|
9
7
|
|
|
10
8
|
const Tab = React.forwardRef((_a, ref) => {
|
|
11
|
-
var { children } = _a, props =
|
|
12
|
-
let [_props] =
|
|
13
|
-
return (
|
|
9
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
10
|
+
let [_props] = useInterface("Tab", props, {});
|
|
11
|
+
return (jsx(Button, Object.assign({}, _props, { classNames: ["tab", ...((_props === null || _props === void 0 ? void 0 : _props.classNames) || [])], ref: ref, children: children })));
|
|
14
12
|
});
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
export { Tab as default };
|
|
17
15
|
//# sourceMappingURL=index.js.map
|
package/Tab/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Tab/index.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React from 'react'\r\nimport { TagComponentType, useInterface } from '@xanui/core';\r\nimport Button, { ButtonProps } from '../Button';\r\n\r\nexport type TabProps<T extends TagComponentType = \"button\"> = ButtonProps<T> & {\r\n value?: string | number\r\n}\r\n\r\nconst Tab = React.forwardRef(<T extends TagComponentType = \"div\">({ children, ...props }: TabProps<T>, ref: React.Ref<any>) => {\r\n let [_props] = useInterface<any>(\"Tab\", props, {})\r\n return (\r\n <Button\r\n {..._props}\r\n classNames={[\"tab\", ...(_props?.classNames || [])]}\r\n ref={ref}\r\n >\r\n {children}\r\n </Button>\r\n )\r\n})\r\n\r\nexport default Tab"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Tab/index.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React from 'react'\r\nimport { TagComponentType, useInterface } from '@xanui/core';\r\nimport Button, { ButtonProps } from '../Button';\r\n\r\nexport type TabProps<T extends TagComponentType = \"button\"> = ButtonProps<T> & {\r\n value?: string | number\r\n}\r\n\r\nconst Tab = React.forwardRef(<T extends TagComponentType = \"div\">({ children, ...props }: TabProps<T>, ref: React.Ref<any>) => {\r\n let [_props] = useInterface<any>(\"Tab\", props, {})\r\n return (\r\n <Button\r\n {..._props}\r\n classNames={[\"tab\", ...(_props?.classNames || [])]}\r\n ref={ref}\r\n >\r\n {children}\r\n </Button>\r\n )\r\n})\r\n\r\nexport default Tab"],"names":[],"mappings":";;;;;;;AAUA;AAAkE;AAC9D;AACA;AASJ;;"}
|
package/Table/index.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var core = require('@xanui/core');
|
|
7
|
-
var index = require('../Scrollbar/index.js');
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useInterface, useBreakpointProps, useColorTemplate, Tag } from '@xanui/core';
|
|
5
|
+
import Scrollbar from '../Scrollbar/index.js';
|
|
8
6
|
|
|
9
7
|
const Table = React.forwardRef((_a, ref) => {
|
|
10
8
|
var _b, _c, _d, _e;
|
|
11
|
-
var { children } = _a, props =
|
|
12
|
-
let [_f] =
|
|
9
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
10
|
+
let [_f] = useInterface("Table", props, {}), { evenColor, size, color, variant, borderType } = _f, rest = __rest(_f, ["evenColor", "size", "color", "variant", "borderType"]);
|
|
13
11
|
const _p = {};
|
|
14
12
|
if (evenColor)
|
|
15
13
|
_p.evenColor = evenColor;
|
|
@@ -21,14 +19,14 @@ const Table = React.forwardRef((_a, ref) => {
|
|
|
21
19
|
_p.variant = variant;
|
|
22
20
|
if (borderType)
|
|
23
21
|
_p.borderType = borderType;
|
|
24
|
-
const p =
|
|
22
|
+
const p = useBreakpointProps(_p);
|
|
25
23
|
evenColor = p.evenColor;
|
|
26
24
|
size = (_b = p.size) !== null && _b !== void 0 ? _b : "medium";
|
|
27
25
|
color = (_c = p.color) !== null && _c !== void 0 ? _c : 'default';
|
|
28
26
|
variant = (_d = p.variant) !== null && _d !== void 0 ? _d : "fill";
|
|
29
27
|
borderType = (_e = p.borderType) !== null && _e !== void 0 ? _e : "line";
|
|
30
|
-
const main =
|
|
31
|
-
const soft =
|
|
28
|
+
const main = useColorTemplate(color, variant);
|
|
29
|
+
const soft = useColorTemplate(color, "soft");
|
|
32
30
|
let sx = {};
|
|
33
31
|
if (evenColor) {
|
|
34
32
|
sx = {
|
|
@@ -68,9 +66,9 @@ const Table = React.forwardRef((_a, ref) => {
|
|
|
68
66
|
},
|
|
69
67
|
none: {}
|
|
70
68
|
};
|
|
71
|
-
return (
|
|
69
|
+
return (jsx(Scrollbar, { style: {
|
|
72
70
|
overflowY: "hidden"
|
|
73
|
-
}, children:
|
|
71
|
+
}, children: jsx(Tag, Object.assign({}, rest, { baseClass: 'table', sxr: Object.assign(Object.assign({ color: "text.primary", fontSize: size === "small" ? "text" : "text", width: "100%", "& thead, & tfoot": {
|
|
74
72
|
bgcolor: main.primary.bgcolor,
|
|
75
73
|
"& th": {
|
|
76
74
|
color: main.primary.color
|
|
@@ -84,5 +82,5 @@ const Table = React.forwardRef((_a, ref) => {
|
|
|
84
82
|
} }, sx), (rest.sx || {})), component: "table", ref: ref, children: children })) }));
|
|
85
83
|
});
|
|
86
84
|
|
|
87
|
-
|
|
85
|
+
export { Table as default };
|
|
88
86
|
//# sourceMappingURL=index.js.map
|
package/Table/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Table/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType, UseColorTemplateColor, useInterface, useColorTemplate, UseColorTemplateType, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\r\nimport Scrollbar from '../Scrollbar';\r\n\r\n\r\nexport type TableProps<T extends TagComponentType = \"table\"> = Omit<TagProps<T>, \"color\" | \"size\"> & {\r\n evenColor?: useBreakpointPropsType<boolean>;\r\n size?: useBreakpointPropsType<\"small\" | \"medium\" | \"large\" | number>;\r\n color?: useBreakpointPropsType<UseColorTemplateColor>;\r\n variant?: useBreakpointPropsType<Omit<UseColorTemplateType, \"outline\">>;\r\n borderType?: useBreakpointPropsType<\"box\" | \"line\" | \"none\">;\r\n}\r\n\r\nconst Table = React.forwardRef(<T extends TagComponentType = \"table\">({ children, ...props }: TableProps<T>, ref: React.Ref<any>) => {\r\n let [{ evenColor, size, color, variant, borderType, ...rest }] = useInterface<any>(\"Table\", props, {})\r\n const _p: any = {}\r\n if (evenColor) _p.evenColor = evenColor\r\n if (size) _p.size = size\r\n if (color) _p.color = color\r\n if (variant) _p.variant = variant\r\n if (borderType) _p.borderType = borderType\r\n const p: any = useBreakpointProps(_p)\r\n evenColor = p.evenColor\r\n size = p.size ?? \"medium\"\r\n color = p.color ?? 'default'\r\n variant = p.variant ?? \"fill\"\r\n borderType = p.borderType ?? \"line\"\r\n\r\n const main = useColorTemplate(color, variant)\r\n const soft = useColorTemplate(color, \"soft\")\r\n\r\n let sx: any = {}\r\n if (evenColor) {\r\n sx = {\r\n \"& tbody tr:nth-child(even)\": {\r\n bgcolor: soft.primary.bgcolor\r\n }\r\n }\r\n }\r\n if (borderType === 'box') {\r\n sx = {\r\n ...sx,\r\n \"& tr:last-child td\": {\r\n borderBottom: 0\r\n },\r\n \"& tr:first-child th\": {\r\n borderTop: 0\r\n },\r\n \"& tr td:first-child, & tr th:first-child\": {\r\n borderLeft: 0\r\n },\r\n \"& tr td:last-child, & tr th:last-child\": {\r\n borderRight: 0\r\n },\r\n }\r\n }\r\n let _size = size\r\n let sizes: any = {\r\n small: .4,\r\n medium: .8,\r\n large: 2\r\n }\r\n\r\n if (typeof size === 'string' && sizes[size]) {\r\n _size = sizes[size]\r\n }\r\n let border: any = {\r\n line: {\r\n borderBottom: \"1px solid\",\r\n borderColor: \"divider\",\r\n },\r\n box: {\r\n border: \"1px solid\",\r\n borderColor: \"divider\",\r\n },\r\n none: {}\r\n }\r\n\r\n return (\r\n <Scrollbar\r\n style={{\r\n overflowY: \"hidden\"\r\n }}\r\n >\r\n <Tag\r\n {...rest}\r\n baseClass='table'\r\n sxr={{\r\n color: \"text.primary\",\r\n fontSize: size === \"small\" ? \"text\" : \"text\",\r\n width: \"100%\",\r\n \"& thead, & tfoot\": {\r\n bgcolor: main.primary.bgcolor,\r\n \"& th\": {\r\n color: main.primary.color\r\n }\r\n },\r\n \"& td, & th\": {\r\n p: _size,\r\n px: 1,\r\n ...border[borderType],\r\n },\r\n \"& tr:last-child td\": {\r\n borderBottom: 0\r\n },\r\n \"& tr:first-child th\": {\r\n borderTop: 0\r\n },\r\n \"& tbody tr:hover\": {\r\n bgcolor: soft.primary.bgcolor\r\n },\r\n ...sx,\r\n ...((rest as any).sx || {})\r\n }}\r\n component=\"table\"\r\n ref={ref}\r\n >{children}</Tag>\r\n </Scrollbar>\r\n )\r\n})\r\n\r\nexport default Table"],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Table/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType, UseColorTemplateColor, useInterface, useColorTemplate, UseColorTemplateType, useBreakpointProps, useBreakpointPropsType } from '@xanui/core';\r\nimport Scrollbar from '../Scrollbar';\r\n\r\n\r\nexport type TableProps<T extends TagComponentType = \"table\"> = Omit<TagProps<T>, \"color\" | \"size\"> & {\r\n evenColor?: useBreakpointPropsType<boolean>;\r\n size?: useBreakpointPropsType<\"small\" | \"medium\" | \"large\" | number>;\r\n color?: useBreakpointPropsType<UseColorTemplateColor>;\r\n variant?: useBreakpointPropsType<Omit<UseColorTemplateType, \"outline\">>;\r\n borderType?: useBreakpointPropsType<\"box\" | \"line\" | \"none\">;\r\n}\r\n\r\nconst Table = React.forwardRef(<T extends TagComponentType = \"table\">({ children, ...props }: TableProps<T>, ref: React.Ref<any>) => {\r\n let [{ evenColor, size, color, variant, borderType, ...rest }] = useInterface<any>(\"Table\", props, {})\r\n const _p: any = {}\r\n if (evenColor) _p.evenColor = evenColor\r\n if (size) _p.size = size\r\n if (color) _p.color = color\r\n if (variant) _p.variant = variant\r\n if (borderType) _p.borderType = borderType\r\n const p: any = useBreakpointProps(_p)\r\n evenColor = p.evenColor\r\n size = p.size ?? \"medium\"\r\n color = p.color ?? 'default'\r\n variant = p.variant ?? \"fill\"\r\n borderType = p.borderType ?? \"line\"\r\n\r\n const main = useColorTemplate(color, variant)\r\n const soft = useColorTemplate(color, \"soft\")\r\n\r\n let sx: any = {}\r\n if (evenColor) {\r\n sx = {\r\n \"& tbody tr:nth-child(even)\": {\r\n bgcolor: soft.primary.bgcolor\r\n }\r\n }\r\n }\r\n if (borderType === 'box') {\r\n sx = {\r\n ...sx,\r\n \"& tr:last-child td\": {\r\n borderBottom: 0\r\n },\r\n \"& tr:first-child th\": {\r\n borderTop: 0\r\n },\r\n \"& tr td:first-child, & tr th:first-child\": {\r\n borderLeft: 0\r\n },\r\n \"& tr td:last-child, & tr th:last-child\": {\r\n borderRight: 0\r\n },\r\n }\r\n }\r\n let _size = size\r\n let sizes: any = {\r\n small: .4,\r\n medium: .8,\r\n large: 2\r\n }\r\n\r\n if (typeof size === 'string' && sizes[size]) {\r\n _size = sizes[size]\r\n }\r\n let border: any = {\r\n line: {\r\n borderBottom: \"1px solid\",\r\n borderColor: \"divider\",\r\n },\r\n box: {\r\n border: \"1px solid\",\r\n borderColor: \"divider\",\r\n },\r\n none: {}\r\n }\r\n\r\n return (\r\n <Scrollbar\r\n style={{\r\n overflowY: \"hidden\"\r\n }}\r\n >\r\n <Tag\r\n {...rest}\r\n baseClass='table'\r\n sxr={{\r\n color: \"text.primary\",\r\n fontSize: size === \"small\" ? \"text\" : \"text\",\r\n width: \"100%\",\r\n \"& thead, & tfoot\": {\r\n bgcolor: main.primary.bgcolor,\r\n \"& th\": {\r\n color: main.primary.color\r\n }\r\n },\r\n \"& td, & th\": {\r\n p: _size,\r\n px: 1,\r\n ...border[borderType],\r\n },\r\n \"& tr:last-child td\": {\r\n borderBottom: 0\r\n },\r\n \"& tr:first-child th\": {\r\n borderTop: 0\r\n },\r\n \"& tbody tr:hover\": {\r\n bgcolor: soft.primary.bgcolor\r\n },\r\n ...sx,\r\n ...((rest as any).sx || {})\r\n }}\r\n component=\"table\"\r\n ref={ref}\r\n >{children}</Tag>\r\n </Scrollbar>\r\n )\r\n})\r\n\r\nexport default Table"],"names":["_jsx"],"mappings":"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"}
|
package/TableBody/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var core = require('@xanui/core');
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Tag } from '@xanui/core';
|
|
7
5
|
|
|
8
6
|
const TableBody = React.forwardRef((_a, ref) => {
|
|
9
|
-
var { children } = _a, rest =
|
|
10
|
-
return (
|
|
7
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
8
|
+
return (jsx(Tag, Object.assign({}, rest, { baseClass: 'table-body', component: "tbody", ref: ref, children: children })));
|
|
11
9
|
});
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
export { TableBody as default };
|
|
14
12
|
//# sourceMappingURL=index.js.map
|
package/TableBody/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/TableBody/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type TableBodyProps<T extends TagComponentType = \"tbody\"> = TagProps<T>\r\n\r\nconst TableBody = React.forwardRef(<T extends TagComponentType = \"tbody\">({ children, ...rest }: TableBodyProps<T>, ref: React.Ref<any>) => {\r\n return (\r\n <Tag\r\n {...rest}\r\n baseClass='table-body'\r\n component=\"tbody\"\r\n ref={ref}\r\n >{children}</Tag>\r\n )\r\n})\r\n\r\nexport default TableBody"],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/TableBody/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type TableBodyProps<T extends TagComponentType = \"tbody\"> = TagProps<T>\r\n\r\nconst TableBody = React.forwardRef(<T extends TagComponentType = \"tbody\">({ children, ...rest }: TableBodyProps<T>, ref: React.Ref<any>) => {\r\n return (\r\n <Tag\r\n {...rest}\r\n baseClass='table-body'\r\n component=\"tbody\"\r\n ref={ref}\r\n >{children}</Tag>\r\n )\r\n})\r\n\r\nexport default TableBody"],"names":["_jsx"],"mappings":";;;;;AAMA,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,CAAuC,EAAwC,EAAE,GAAmB,KAAI;AAAjE,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAA8B,EAAzB,IAAI,GAAA,MAAA,CAAA,EAAA,EAAnB,YAAqB,CAAF;IACzF,QACIA,IAAC,GAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACI,IAAI,EAAA,EACR,SAAS,EAAC,YAAY,EACtB,SAAS,EAAC,OAAO,EACjB,GAAG,EAAE,GAAG,EAAA,QAAA,EACV,QAAQ,EAAA,CAAA,CAAO;AAEzB,CAAC;;;;"}
|
package/TableCell/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var core = require('@xanui/core');
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Tag } from '@xanui/core';
|
|
7
5
|
|
|
8
6
|
const TableCell = React.forwardRef((_a, ref) => {
|
|
9
|
-
var { children, th } = _a, rest =
|
|
10
|
-
return (
|
|
7
|
+
var { children, th } = _a, rest = __rest(_a, ["children", "th"]);
|
|
8
|
+
return (jsx(Tag, Object.assign({}, rest, { sxr: Object.assign({ verticalAlign: "inherit", textAlign: "left", fontSize: "inherit", color: "text.primary" }, ((rest === null || rest === void 0 ? void 0 : rest.sx) || {})), baseClass: 'table-cell', component: th ? "th" : "td", ref: ref, children: children })));
|
|
11
9
|
});
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
export { TableCell as default };
|
|
14
12
|
//# sourceMappingURL=index.js.map
|
package/TableCell/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/TableCell/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type TableColumnProps<T extends TagComponentType = \"td\"> = TagProps<T> & {\r\n th?: boolean\r\n}\r\n\r\nconst TableCell = React.forwardRef(<T extends TagComponentType = \"td\">({ children, th, ...rest }: TableColumnProps<T>, ref: React.Ref<any>) => {\r\n return (\r\n <Tag\r\n {...rest}\r\n sxr={{\r\n verticalAlign: \"inherit\",\r\n textAlign: \"left\",\r\n fontSize: \"inherit\",\r\n color: \"text.primary\",\r\n ...((rest as any)?.sx || {})\r\n }}\r\n baseClass='table-cell'\r\n component={th ? \"th\" : \"td\"} ref={ref}\r\n >\r\n {children}\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default TableCell"],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/TableCell/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type TableColumnProps<T extends TagComponentType = \"td\"> = TagProps<T> & {\r\n th?: boolean\r\n}\r\n\r\nconst TableCell = React.forwardRef(<T extends TagComponentType = \"td\">({ children, th, ...rest }: TableColumnProps<T>, ref: React.Ref<any>) => {\r\n return (\r\n <Tag\r\n {...rest}\r\n sxr={{\r\n verticalAlign: \"inherit\",\r\n textAlign: \"left\",\r\n fontSize: \"inherit\",\r\n color: \"text.primary\",\r\n ...((rest as any)?.sx || {})\r\n }}\r\n baseClass='table-cell'\r\n component={th ? \"th\" : \"td\"} ref={ref}\r\n >\r\n {children}\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default TableCell"],"names":["_jsx"],"mappings":";;;;;AAQA,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,CAAoC,EAA8C,EAAE,GAAmB,KAAI;QAAvE,EAAE,QAAQ,EAAE,EAAE,EAAA,GAAA,EAAgC,EAA3B,IAAI,GAAA,MAAA,CAAA,EAAA,EAAvB,kBAAyB,CAAF;AAC1F,IAAA,QACIA,GAAA,CAAC,GAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACI,IAAI,EAAA,EACR,GAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EACC,aAAa,EAAE,SAAS,EACxB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,cAAc,EAAA,GACjB,CAAC,IAAY,KAAA,IAAA,IAAZ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAU,EAAE,KAAI,EAAE,EAAC,EAEhC,SAAS,EAAC,YAAY,EACtB,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,EAAA,QAAA,EAEpC,QAAQ,EAAA,CAAA,CACP;AAEd,CAAC;;;;"}
|
package/TableFooter/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var core = require('@xanui/core');
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Tag } from '@xanui/core';
|
|
7
5
|
|
|
8
6
|
const TableFooter = React.forwardRef((_a, ref) => {
|
|
9
|
-
var { children } = _a, rest =
|
|
10
|
-
return (
|
|
7
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
8
|
+
return (jsx(Tag, Object.assign({}, rest, { baseClass: 'table-footer', component: "tfoot", ref: ref, children: children })));
|
|
11
9
|
});
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
export { TableFooter as default };
|
|
14
12
|
//# sourceMappingURL=index.js.map
|
package/TableFooter/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/TableFooter/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type TableFooterProps<T extends TagComponentType = \"tfoot\"> = TagProps<T>\r\n\r\nconst TableFooter = React.forwardRef(<T extends TagComponentType = \"tfoot\">({ children, ...rest }: TableFooterProps<T>, ref: React.Ref<any>) => {\r\n return (\r\n <Tag\r\n {...rest}\r\n baseClass='table-footer'\r\n component=\"tfoot\"\r\n ref={ref}\r\n >{children}</Tag>\r\n )\r\n})\r\n\r\nexport default TableFooter"],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/TableFooter/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type TableFooterProps<T extends TagComponentType = \"tfoot\"> = TagProps<T>\r\n\r\nconst TableFooter = React.forwardRef(<T extends TagComponentType = \"tfoot\">({ children, ...rest }: TableFooterProps<T>, ref: React.Ref<any>) => {\r\n return (\r\n <Tag\r\n {...rest}\r\n baseClass='table-footer'\r\n component=\"tfoot\"\r\n ref={ref}\r\n >{children}</Tag>\r\n )\r\n})\r\n\r\nexport default TableFooter"],"names":["_jsx"],"mappings":";;;;;AAMA,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,CAAuC,EAA0C,EAAE,GAAmB,KAAI;AAAnE,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAAgC,EAA3B,IAAI,GAAA,MAAA,CAAA,EAAA,EAAnB,YAAqB,CAAF;IAC3F,QACIA,IAAC,GAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACI,IAAI,EAAA,EACR,SAAS,EAAC,cAAc,EACxB,SAAS,EAAC,OAAO,EACjB,GAAG,EAAE,GAAG,EAAA,QAAA,EACV,QAAQ,EAAA,CAAA,CAAO;AAEzB,CAAC;;;;"}
|
package/TableHead/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var core = require('@xanui/core');
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Tag } from '@xanui/core';
|
|
7
5
|
|
|
8
6
|
const TableHead = React.forwardRef((_a, ref) => {
|
|
9
|
-
var { children } = _a, rest =
|
|
10
|
-
return (
|
|
7
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
8
|
+
return (jsx(Tag, Object.assign({}, rest, { baseClass: 'table-head', component: "thead", ref: ref, children: children })));
|
|
11
9
|
});
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
export { TableHead as default };
|
|
14
12
|
//# sourceMappingURL=index.js.map
|
package/TableHead/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/TableHead/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type TableHeadProps<T extends TagComponentType = \"thead\"> = TagProps<T>\r\n\r\nconst TableHead = React.forwardRef(<T extends TagComponentType = \"thead\">({ children, ...rest }: TableHeadProps<T>, ref: React.Ref<any>) => {\r\n return (\r\n <Tag\r\n {...rest}\r\n baseClass='table-head'\r\n component=\"thead\"\r\n ref={ref}\r\n >{children}</Tag>\r\n )\r\n})\r\n\r\nexport default TableHead "],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/TableHead/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType } from '@xanui/core';\r\n\r\nexport type TableHeadProps<T extends TagComponentType = \"thead\"> = TagProps<T>\r\n\r\nconst TableHead = React.forwardRef(<T extends TagComponentType = \"thead\">({ children, ...rest }: TableHeadProps<T>, ref: React.Ref<any>) => {\r\n return (\r\n <Tag\r\n {...rest}\r\n baseClass='table-head'\r\n component=\"thead\"\r\n ref={ref}\r\n >{children}</Tag>\r\n )\r\n})\r\n\r\nexport default TableHead "],"names":["_jsx"],"mappings":";;;;;AAMA,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,CAAuC,EAAwC,EAAE,GAAmB,KAAI;AAAjE,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAA8B,EAAzB,IAAI,GAAA,MAAA,CAAA,EAAA,EAAnB,YAAqB,CAAF;IACzF,QACIA,IAAC,GAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACI,IAAI,EAAA,EACR,SAAS,EAAC,YAAY,EACtB,SAAS,EAAC,OAAO,EACjB,GAAG,EAAE,GAAG,EAAA,QAAA,EACV,QAAQ,EAAA,CAAA,CAAO;AAEzB,CAAC;;;;"}
|
package/TablePagination/index.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var IconKeyboardArrowRight = require('@xanui/icons/KeyboardArrowRight');
|
|
13
|
-
var core = require('@xanui/core');
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
import Text from '../Text/index.js';
|
|
5
|
+
import Select from '../Select/index.js';
|
|
6
|
+
import Option from '../Option/index.js';
|
|
7
|
+
import IconButton from '../IconButton/index.js';
|
|
8
|
+
import React, { useMemo } from 'react';
|
|
9
|
+
import IconKeyboardArrowLeft from '@xanui/icons/KeyboardArrowLeft';
|
|
10
|
+
import IconKeyboardArrowRight from '@xanui/icons/KeyboardArrowRight';
|
|
11
|
+
import { useInterface, Tag } from '@xanui/core';
|
|
14
12
|
|
|
15
13
|
const TablePagination = React.forwardRef((_a, ref) => {
|
|
16
|
-
var { page, total, perpage, onChange } = _a, rest =
|
|
17
|
-
let [_b] =
|
|
14
|
+
var { page, total, perpage, onChange } = _a, rest = __rest(_a, ["page", "total", "perpage", "onChange"]);
|
|
15
|
+
let [_b] = useInterface("TablePagination", rest, {}), { perpages, color, variant, slotProps } = _b, props = __rest(_b, ["perpages", "color", "variant", "slotProps"]);
|
|
18
16
|
color !== null && color !== void 0 ? color : (color = "default");
|
|
19
17
|
variant !== null && variant !== void 0 ? variant : (variant = "fill");
|
|
20
18
|
perpages !== null && perpages !== void 0 ? perpages : (perpages = [30, 50, 100]);
|
|
21
19
|
perpage = perpage || perpages[0];
|
|
22
20
|
const isPerpage = perpages[0] && perpages.length >= 1;
|
|
23
|
-
const chunks =
|
|
21
|
+
const chunks = useMemo(() => {
|
|
24
22
|
const chunks = [];
|
|
25
23
|
let _page = 1;
|
|
26
24
|
for (let from = 0; from < total; from += perpage) {
|
|
@@ -31,29 +29,29 @@ const TablePagination = React.forwardRef((_a, ref) => {
|
|
|
31
29
|
return chunks;
|
|
32
30
|
}, [perpage, perpages, total]);
|
|
33
31
|
if (!chunks.length) {
|
|
34
|
-
return
|
|
32
|
+
return jsx(Fragment, {});
|
|
35
33
|
}
|
|
36
34
|
const current = chunks[page] || chunks[1];
|
|
37
35
|
const hasNext = !!chunks[page + 1];
|
|
38
36
|
const hasPrev = !!chunks[page - 1];
|
|
39
|
-
return (
|
|
37
|
+
return (jsxs(Tag, Object.assign({}, props, { sxr: {
|
|
40
38
|
display: "flex",
|
|
41
39
|
flexDirection: "row",
|
|
42
40
|
gap: 1,
|
|
43
41
|
alignItems: "center"
|
|
44
|
-
}, baseClass: 'table-pagination', ref: ref, children: [isPerpage &&
|
|
42
|
+
}, baseClass: 'table-pagination', ref: ref, children: [isPerpage && jsxs(Tag, { baseClass: 'table-pagination-perpage', flexBox: true, flexRow: true, gap: 1, alignItems: "center", children: [jsx(Text, { fontSize: "button", children: "PER PAGE" }), jsx(Select, Object.assign({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.select, { width: (perpage.toString().length * 10) + 60, minWidth: "auto", maxWidth: "auto", value: perpage, onChange: (value) => {
|
|
45
43
|
onChange && onChange({ page: 1, perpage: value, from: 1, to: Math.min(value, total) });
|
|
46
|
-
}, children: perpages.map((p) =>
|
|
44
|
+
}, children: perpages.map((p) => jsx(Option, { value: p, children: p }, p)) }))] }), jsxs(Tag, { sxr: {
|
|
47
45
|
display: "flex",
|
|
48
46
|
flexDirection: "row",
|
|
49
47
|
gap: 1,
|
|
50
48
|
alignItems: 'center'
|
|
51
|
-
}, children: [
|
|
49
|
+
}, children: [jsxs(Text, { fontSize: "button", children: [current === null || current === void 0 ? void 0 : current.from, "-", current.to] }), jsx(Text, { color: "text.secondary", children: "of" }), jsx(Text, { fontSize: "button", children: total })] }), jsxs(Tag, { baseClass: 'table-pagination-navigation', flexBox: true, flexRow: true, gap: .4, children: [jsx(IconButton, Object.assign({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.button, { color: color, variant: variant, size: 30, disabled: !hasPrev, onClick: () => {
|
|
52
50
|
onChange && onChange(chunks[page - 1]);
|
|
53
|
-
}, children:
|
|
51
|
+
}, children: jsx(IconKeyboardArrowLeft, {}) })), jsx(IconButton, Object.assign({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.button, { color: color, variant: variant, size: 30, disabled: !hasNext, onClick: () => {
|
|
54
52
|
onChange && onChange(chunks[page + 1]);
|
|
55
|
-
}, children:
|
|
53
|
+
}, children: jsx(IconKeyboardArrowRight, {}) }))] })] })));
|
|
56
54
|
});
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
export { TablePagination as default };
|
|
59
57
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/TablePagination/index.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport Text from '../Text'\r\nimport Select, { SelectProps } from '../Select'\r\nimport Option from '../Option'\r\nimport IconButton, { IconButtonProps } from '../IconButton'\r\nimport React, { useMemo } from 'react'\r\nimport PrevIcon from '@xanui/icons/KeyboardArrowLeft'\r\nimport NextIcon from '@xanui/icons/KeyboardArrowRight'\r\nimport { TagProps, Tag, useInterface, UseColorTemplateColor, UseColorTemplateType, useBreakpointPropsType } from '@xanui/core';\r\n\r\n\r\nexport type TablePaginationState = { page: number, perpage: number, from: number, to: number }\r\nexport type TablePaginationProps = Omit<TagProps, \"children\" | \"onChange\"> & {\r\n page: number;\r\n total: number;\r\n perpage?: number;\r\n perpages?: number[];\r\n color?: useBreakpointPropsType<UseColorTemplateColor>;\r\n variant?: useBreakpointPropsType<UseColorTemplateType>;\r\n onChange?: (state: TablePaginationState) => void;\r\n\r\n slotProps?: {\r\n button?: Omit<IconButtonProps, \"children\" | \"color\" | \"variant\">;\r\n select?: Omit<SelectProps, \"value\" | \"onChange\" | \"children\">;\r\n }\r\n}\r\n\r\nconst TablePagination = React.forwardRef(({ page, total, perpage, onChange, ...rest }: TablePaginationProps, ref: React.Ref<any>) => {\r\n let [{ perpages, color, variant, slotProps, ...props }] = useInterface<any>(\"TablePagination\", rest, {})\r\n color ??= \"default\"\r\n variant ??= \"fill\"\r\n perpages ??= [30, 50, 100]\r\n perpage = perpage || perpages[0] as number\r\n const isPerpage = perpages[0] && perpages.length >= 1\r\n\r\n\r\n const chunks = useMemo(() => {\r\n const chunks: any = [];\r\n let _page = 1;\r\n for (let from = 0; from < total; from += perpage) {\r\n const to = Math.min(from + perpage, total)\r\n chunks[_page] = { from: from + 1, to, page: _page, perpage }\r\n _page++\r\n }\r\n return chunks\r\n }, [perpage, perpages, total])\r\n\r\n if (!chunks.length) {\r\n return <></>\r\n }\r\n\r\n const current = chunks[page] || chunks[1]\r\n const hasNext = !!chunks[page + 1]\r\n const hasPrev = !!chunks[page - 1]\r\n\r\n return (\r\n <Tag\r\n {...props}\r\n sxr={{\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n gap: 1,\r\n alignItems: \"center\"\r\n }}\r\n baseClass='table-pagination'\r\n ref={ref}\r\n >\r\n {\r\n isPerpage && <Tag baseClass='table-pagination-perpage' flexBox flexRow gap={1} alignItems=\"center\">\r\n <Text fontSize=\"button\">PER PAGE</Text>\r\n <Select\r\n {...slotProps?.select}\r\n width={(perpage.toString().length * 10) + 60}\r\n minWidth={\"auto\"}\r\n maxWidth={\"auto\"}\r\n value={perpage}\r\n onChange={(value: any) => {\r\n onChange && onChange({ page: 1, perpage: value, from: 1, to: Math.min(value, total) })\r\n }}\r\n >\r\n {perpages.map((p: number) => <Option key={p} value={p}>{p}</Option>)}\r\n </Select>\r\n </Tag>\r\n }\r\n <Tag\r\n sxr={{\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n gap: 1,\r\n alignItems: 'center'\r\n }}\r\n >\r\n <Text fontSize=\"button\">{current?.from}-{current.to}</Text>\r\n <Text color=\"text.secondary\">of</Text>\r\n <Text fontSize=\"button\">{total}</Text>\r\n </Tag>\r\n <Tag baseClass='table-pagination-navigation' flexBox flexRow gap={.4} >\r\n <IconButton\r\n {...slotProps?.button}\r\n color={color}\r\n variant={variant}\r\n size={30}\r\n disabled={!hasPrev}\r\n onClick={() => {\r\n onChange && onChange(chunks[page - 1]);\r\n }}\r\n >\r\n <PrevIcon />\r\n </IconButton>\r\n <IconButton\r\n {...slotProps?.button}\r\n color={color}\r\n variant={variant}\r\n size={30}\r\n disabled={!hasNext}\r\n onClick={() => {\r\n onChange && onChange(chunks[page + 1]);\r\n }}\r\n >\r\n <NextIcon />\r\n </IconButton>\r\n </Tag>\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default TablePagination"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/TablePagination/index.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport Text from '../Text'\r\nimport Select, { SelectProps } from '../Select'\r\nimport Option from '../Option'\r\nimport IconButton, { IconButtonProps } from '../IconButton'\r\nimport React, { useMemo } from 'react'\r\nimport PrevIcon from '@xanui/icons/KeyboardArrowLeft'\r\nimport NextIcon from '@xanui/icons/KeyboardArrowRight'\r\nimport { TagProps, Tag, useInterface, UseColorTemplateColor, UseColorTemplateType, useBreakpointPropsType } from '@xanui/core';\r\n\r\n\r\nexport type TablePaginationState = { page: number, perpage: number, from: number, to: number }\r\nexport type TablePaginationProps = Omit<TagProps, \"children\" | \"onChange\"> & {\r\n page: number;\r\n total: number;\r\n perpage?: number;\r\n perpages?: number[];\r\n color?: useBreakpointPropsType<UseColorTemplateColor>;\r\n variant?: useBreakpointPropsType<UseColorTemplateType>;\r\n onChange?: (state: TablePaginationState) => void;\r\n\r\n slotProps?: {\r\n button?: Omit<IconButtonProps, \"children\" | \"color\" | \"variant\">;\r\n select?: Omit<SelectProps, \"value\" | \"onChange\" | \"children\">;\r\n }\r\n}\r\n\r\nconst TablePagination = React.forwardRef(({ page, total, perpage, onChange, ...rest }: TablePaginationProps, ref: React.Ref<any>) => {\r\n let [{ perpages, color, variant, slotProps, ...props }] = useInterface<any>(\"TablePagination\", rest, {})\r\n color ??= \"default\"\r\n variant ??= \"fill\"\r\n perpages ??= [30, 50, 100]\r\n perpage = perpage || perpages[0] as number\r\n const isPerpage = perpages[0] && perpages.length >= 1\r\n\r\n\r\n const chunks = useMemo(() => {\r\n const chunks: any = [];\r\n let _page = 1;\r\n for (let from = 0; from < total; from += perpage) {\r\n const to = Math.min(from + perpage, total)\r\n chunks[_page] = { from: from + 1, to, page: _page, perpage }\r\n _page++\r\n }\r\n return chunks\r\n }, [perpage, perpages, total])\r\n\r\n if (!chunks.length) {\r\n return <></>\r\n }\r\n\r\n const current = chunks[page] || chunks[1]\r\n const hasNext = !!chunks[page + 1]\r\n const hasPrev = !!chunks[page - 1]\r\n\r\n return (\r\n <Tag\r\n {...props}\r\n sxr={{\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n gap: 1,\r\n alignItems: \"center\"\r\n }}\r\n baseClass='table-pagination'\r\n ref={ref}\r\n >\r\n {\r\n isPerpage && <Tag baseClass='table-pagination-perpage' flexBox flexRow gap={1} alignItems=\"center\">\r\n <Text fontSize=\"button\">PER PAGE</Text>\r\n <Select\r\n {...slotProps?.select}\r\n width={(perpage.toString().length * 10) + 60}\r\n minWidth={\"auto\"}\r\n maxWidth={\"auto\"}\r\n value={perpage}\r\n onChange={(value: any) => {\r\n onChange && onChange({ page: 1, perpage: value, from: 1, to: Math.min(value, total) })\r\n }}\r\n >\r\n {perpages.map((p: number) => <Option key={p} value={p}>{p}</Option>)}\r\n </Select>\r\n </Tag>\r\n }\r\n <Tag\r\n sxr={{\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n gap: 1,\r\n alignItems: 'center'\r\n }}\r\n >\r\n <Text fontSize=\"button\">{current?.from}-{current.to}</Text>\r\n <Text color=\"text.secondary\">of</Text>\r\n <Text fontSize=\"button\">{total}</Text>\r\n </Tag>\r\n <Tag baseClass='table-pagination-navigation' flexBox flexRow gap={.4} >\r\n <IconButton\r\n {...slotProps?.button}\r\n color={color}\r\n variant={variant}\r\n size={30}\r\n disabled={!hasPrev}\r\n onClick={() => {\r\n onChange && onChange(chunks[page - 1]);\r\n }}\r\n >\r\n <PrevIcon />\r\n </IconButton>\r\n <IconButton\r\n {...slotProps?.button}\r\n color={color}\r\n variant={variant}\r\n size={30}\r\n disabled={!hasNext}\r\n onClick={() => {\r\n onChange && onChange(chunks[page + 1]);\r\n }}\r\n >\r\n <NextIcon />\r\n </IconButton>\r\n </Tag>\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default TablePagination"],"names":[],"mappings":";;;;;;;;;;;;AA4BA;AAA0C;;;;AAItC;AACA;AACA;AAGA;;;AAGI;AACI;AACA;AACA;;AAEJ;;AAGJ;AACI;;;;;AAOJ;AAIY;AACA;AACA;AACA;AACH;AAce;AACJ;AAQJ;AACA;AACA;AACA;AACH;;AAeG;;;AAmBpB;;"}
|
package/TableRow/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var core = require('@xanui/core');
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Tag } from '@xanui/core';
|
|
7
5
|
|
|
8
6
|
const TableRow = React.forwardRef((_a, ref) => {
|
|
9
|
-
var { children } = _a, rest =
|
|
10
|
-
return (
|
|
7
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
8
|
+
return (jsx(Tag, Object.assign({ baseClass: 'table-row', verticalAlign: "middle" }, rest, { component: "tr", ref: ref, children: children })));
|
|
11
9
|
});
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
export { TableRow as default };
|
|
14
12
|
//# sourceMappingURL=index.js.map
|