@xanui/ui 1.1.37 → 1.1.40
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.cjs +96 -0
- package/Accordion/index.cjs.map +1 -0
- package/Accordion/index.js +19 -21
- package/Accordion/index.js.map +1 -1
- package/Alert/index.cjs +121 -0
- package/Alert/index.cjs.map +1 -0
- package/Alert/index.js +33 -35
- package/Alert/index.js.map +1 -1
- package/Autocomplete/index.cjs +136 -0
- package/Autocomplete/index.cjs.map +1 -0
- package/Autocomplete/index.js +23 -25
- package/Autocomplete/index.js.map +1 -1
- package/Avatar/index.cjs +50 -0
- package/Avatar/index.cjs.map +1 -0
- package/Avatar/index.js +15 -17
- package/Avatar/index.js.map +1 -1
- package/Badge/index.cjs +109 -0
- package/Badge/index.cjs.map +1 -0
- package/Badge/index.js +12 -14
- package/Badge/index.js.map +1 -1
- package/Box/index.cjs +14 -0
- package/Box/index.cjs.map +1 -0
- package/Box/index.js +7 -9
- package/Box/index.js.map +1 -1
- package/Button/index.cjs +94 -0
- package/Button/index.cjs.map +1 -0
- package/Button/index.js +17 -19
- package/Button/index.js.map +1 -1
- package/ButtonGroup/index.cjs +58 -0
- package/ButtonGroup/index.cjs.map +1 -0
- package/ButtonGroup/index.js +12 -14
- package/ButtonGroup/index.js.map +1 -1
- package/Calendar/index.cjs +174 -0
- package/Calendar/index.cjs.map +1 -0
- package/Calendar/index.js +39 -41
- package/Calendar/index.js.map +1 -1
- package/CalendarInput/index.cjs +34 -0
- package/CalendarInput/index.cjs.map +1 -0
- package/CalendarInput/index.js +19 -21
- package/CalendarInput/index.js.map +1 -1
- package/Checkbox/index.cjs +58 -0
- package/Checkbox/index.cjs.map +1 -0
- package/Checkbox/index.js +14 -16
- package/Checkbox/index.js.map +1 -1
- package/Chip/index.cjs +76 -0
- package/Chip/index.cjs.map +1 -0
- package/Chip/index.js +12 -14
- package/Chip/index.js.map +1 -1
- package/CircleProgress/index.cjs +129 -0
- package/CircleProgress/index.cjs.map +1 -0
- package/CircleProgress/index.js +13 -15
- package/CircleProgress/index.js.map +1 -1
- package/ClickOutside/index.cjs +37 -0
- package/ClickOutside/index.cjs.map +1 -0
- package/ClickOutside/index.js +9 -11
- package/ClickOutside/index.js.map +1 -1
- package/Collaps/index.cjs +26 -0
- package/Collaps/index.cjs.map +1 -0
- package/Collaps/index.js +9 -11
- package/Collaps/index.js.map +1 -1
- package/Container/index.cjs +29 -0
- package/Container/index.cjs.map +1 -0
- package/Container/index.js +9 -11
- package/Container/index.js.map +1 -1
- package/DataFilter/index.cjs +78 -0
- package/DataFilter/index.cjs.map +1 -0
- package/DataFilter/index.js +30 -41
- package/DataFilter/index.js.map +1 -1
- package/DataFilter/options/DateFilter.cjs +32 -0
- package/DataFilter/options/DateFilter.cjs.map +1 -0
- package/DataFilter/options/DateFilter.js +16 -18
- package/DataFilter/options/DateFilter.js.map +1 -1
- package/DataFilter/options/DateRangeFilter.cjs +27 -0
- package/DataFilter/options/DateRangeFilter.cjs.map +1 -0
- package/DataFilter/options/DateRangeFilter.js +12 -14
- package/DataFilter/options/DateRangeFilter.js.map +1 -1
- package/DataFilter/options/MultiSelectFilter.cjs +38 -0
- package/DataFilter/options/MultiSelectFilter.cjs.map +1 -0
- package/DataFilter/options/MultiSelectFilter.js +20 -22
- package/DataFilter/options/MultiSelectFilter.js.map +1 -1
- package/DataFilter/options/NumberFilter.cjs +24 -0
- package/DataFilter/options/NumberFilter.cjs.map +1 -0
- package/DataFilter/options/NumberFilter.js +11 -13
- package/DataFilter/options/NumberFilter.js.map +1 -1
- package/DataFilter/options/NumberRangeFilter.cjs +29 -0
- package/DataFilter/options/NumberRangeFilter.cjs.map +1 -0
- package/DataFilter/options/NumberRangeFilter.js +12 -14
- package/DataFilter/options/NumberRangeFilter.js.map +1 -1
- package/DataFilter/options/SelectFilter.cjs +34 -0
- package/DataFilter/options/SelectFilter.cjs.map +1 -0
- package/DataFilter/options/SelectFilter.js +18 -20
- package/DataFilter/options/SelectFilter.js.map +1 -1
- package/DataFilter/options/TextFilter.cjs +24 -0
- package/DataFilter/options/TextFilter.cjs.map +1 -0
- package/DataFilter/options/TextFilter.js +11 -13
- package/DataFilter/options/TextFilter.js.map +1 -1
- package/Datatable/FilterBox.cjs +39 -0
- package/Datatable/FilterBox.cjs.map +1 -0
- package/Datatable/FilterBox.js +21 -23
- package/Datatable/FilterBox.js.map +1 -1
- package/Datatable/Row.cjs +59 -0
- package/Datatable/Row.cjs.map +1 -0
- package/Datatable/Row.js +19 -21
- package/Datatable/Row.js.map +1 -1
- package/Datatable/SelectedBox.cjs +21 -0
- package/Datatable/SelectedBox.cjs.map +1 -0
- package/Datatable/SelectedBox.js +10 -12
- package/Datatable/SelectedBox.js.map +1 -1
- package/Datatable/Table.cjs +23 -0
- package/Datatable/Table.cjs.map +1 -0
- package/Datatable/Table.js +8 -10
- package/Datatable/Table.js.map +1 -1
- package/Datatable/TableHead.cjs +61 -0
- package/Datatable/TableHead.cjs.map +1 -0
- package/Datatable/TableHead.js +18 -20
- package/Datatable/TableHead.js.map +1 -1
- package/Datatable/index.cjs +93 -0
- package/Datatable/index.cjs.map +1 -0
- package/Datatable/index.js +21 -23
- package/Datatable/index.js.map +1 -1
- package/Divider/index.cjs +31 -0
- package/Divider/index.cjs.map +1 -0
- package/Divider/index.js +8 -10
- package/Divider/index.js.map +1 -1
- package/Drawer/index.cjs +78 -0
- package/Drawer/index.cjs.map +1 -0
- package/Drawer/index.js +12 -14
- package/Drawer/index.js.map +1 -1
- package/Form/index.cjs +45 -0
- package/Form/index.cjs.map +1 -0
- package/Form/index.js +8 -10
- package/Form/index.js.map +1 -1
- package/GridContainer/index.cjs +19 -0
- package/GridContainer/index.cjs.map +1 -0
- package/GridContainer/index.js +7 -9
- package/GridContainer/index.js.map +1 -1
- package/GridItem/index.cjs +20 -0
- package/GridItem/index.cjs.map +1 -0
- package/GridItem/index.js +7 -9
- package/GridItem/index.js.map +1 -1
- package/IconButton/index.cjs +64 -0
- package/IconButton/index.cjs.map +1 -0
- package/IconButton/index.js +12 -14
- package/IconButton/index.js.map +1 -1
- package/Image/index.cjs +27 -0
- package/Image/index.cjs.map +1 -0
- package/Image/index.js +9 -11
- package/Image/index.js.map +1 -1
- package/Input/index.cjs +144 -0
- package/Input/index.cjs.map +1 -0
- package/Input/index.js +18 -20
- package/Input/index.js.map +1 -1
- package/InputNumber/index.cjs +32 -0
- package/InputNumber/index.cjs.map +1 -0
- package/InputNumber/index.js +6 -8
- package/InputNumber/index.js.map +1 -1
- package/Label/index.cjs +24 -0
- package/Label/index.cjs.map +1 -0
- package/Label/index.js +7 -9
- package/Label/index.js.map +1 -1
- package/Layer/index.cjs +62 -0
- package/Layer/index.cjs.map +1 -0
- package/Layer/index.js +19 -21
- package/Layer/index.js.map +1 -1
- package/LineProgress/index.cjs +59 -0
- package/LineProgress/index.cjs.map +1 -0
- package/LineProgress/index.js +11 -13
- package/LineProgress/index.js.map +1 -1
- package/List/ListContext.cjs +11 -0
- package/List/ListContext.cjs.map +1 -0
- package/List/ListContext.js +2 -5
- package/List/ListContext.js.map +1 -1
- package/List/index.cjs +63 -0
- package/List/index.cjs.map +1 -0
- package/List/index.js +12 -14
- package/List/index.js.map +1 -1
- package/ListItem/index.cjs +54 -0
- package/ListItem/index.cjs.map +1 -0
- package/ListItem/index.js +12 -14
- package/ListItem/index.js.map +1 -1
- package/LoadingBox/index.cjs +32 -0
- package/LoadingBox/index.cjs.map +1 -0
- package/LoadingBox/index.js +11 -13
- package/LoadingBox/index.js.map +1 -1
- package/Menu/index.cjs +150 -0
- package/Menu/index.cjs.map +1 -0
- package/Menu/index.js +18 -20
- package/Menu/index.js.map +1 -1
- package/Modal/index.cjs +59 -0
- package/Modal/index.cjs.map +1 -0
- package/Modal/index.js +15 -17
- package/Modal/index.js.map +1 -1
- package/NoSSR/index.cjs +15 -0
- package/NoSSR/index.cjs.map +1 -0
- package/NoSSR/index.js +4 -6
- package/NoSSR/index.js.map +1 -1
- package/Option/index.cjs +14 -0
- package/Option/index.cjs.map +1 -0
- package/Option/index.js +7 -9
- package/Option/index.js.map +1 -1
- package/Paper/index.cjs +15 -0
- package/Paper/index.cjs.map +1 -0
- package/Paper/index.js +8 -10
- package/Paper/index.js.map +1 -1
- package/Portal/index.cjs +27 -0
- package/Portal/index.cjs.map +1 -0
- package/Portal/index.js +9 -11
- package/Portal/index.js.map +1 -1
- package/Radio/index.cjs +16 -0
- package/Radio/index.cjs.map +1 -0
- package/Radio/index.js +9 -11
- package/Radio/index.js.map +1 -1
- package/Scrollbar/index.cjs +59 -0
- package/Scrollbar/index.cjs.map +1 -0
- package/Scrollbar/index.js +10 -12
- package/Scrollbar/index.js.map +1 -1
- package/Select/index.cjs +59 -0
- package/Select/index.cjs.map +1 -0
- package/Select/index.js +22 -24
- package/Select/index.js.map +1 -1
- package/Skeleton/index.cjs +60 -0
- package/Skeleton/index.cjs.map +1 -0
- package/Skeleton/index.js +7 -9
- package/Skeleton/index.js.map +1 -1
- package/Stack/index.cjs +17 -0
- package/Stack/index.cjs.map +1 -0
- package/Stack/index.js +7 -9
- package/Stack/index.js.map +1 -1
- package/Switch/index.cjs +79 -0
- package/Switch/index.cjs.map +1 -0
- package/Switch/index.js +12 -14
- package/Switch/index.js.map +1 -1
- package/Tab/index.cjs +17 -0
- package/Tab/index.cjs.map +1 -0
- package/Tab/index.js +9 -11
- package/Tab/index.js.map +1 -1
- package/Table/index.cjs +88 -0
- package/Table/index.cjs.map +1 -0
- package/Table/index.js +13 -15
- package/Table/index.js.map +1 -1
- package/TableBody/index.cjs +14 -0
- package/TableBody/index.cjs.map +1 -0
- package/TableBody/index.js +7 -9
- package/TableBody/index.js.map +1 -1
- package/TableCell/index.cjs +14 -0
- package/TableCell/index.cjs.map +1 -0
- package/TableCell/index.js +7 -9
- package/TableCell/index.js.map +1 -1
- package/TableFooter/index.cjs +14 -0
- package/TableFooter/index.cjs.map +1 -0
- package/TableFooter/index.js +7 -9
- package/TableFooter/index.js.map +1 -1
- package/TableHead/index.cjs +14 -0
- package/TableHead/index.cjs.map +1 -0
- package/TableHead/index.js +7 -9
- package/TableHead/index.js.map +1 -1
- package/TablePagination/index.cjs +59 -0
- package/TablePagination/index.cjs.map +1 -0
- package/TablePagination/index.js +21 -23
- package/TablePagination/index.js.map +1 -1
- package/TableRow/index.cjs +14 -0
- package/TableRow/index.cjs.map +1 -0
- package/TableRow/index.js +7 -9
- package/TableRow/index.js.map +1 -1
- package/Tabs/index.cjs +201 -0
- package/Tabs/index.cjs.map +1 -0
- package/Tabs/index.js +19 -21
- package/Tabs/index.js.map +1 -1
- package/Text/index.cjs +25 -0
- package/Text/index.cjs.map +1 -0
- package/Text/index.js +8 -10
- package/Text/index.js.map +1 -1
- package/Toast/index.cjs +120 -0
- package/Toast/index.cjs.map +1 -0
- package/Toast/index.js +18 -20
- package/Toast/index.js.map +1 -1
- package/Tooltip/index.cjs +40 -0
- package/Tooltip/index.cjs.map +1 -0
- package/Tooltip/index.js +11 -13
- package/Tooltip/index.js.map +1 -1
- package/ViewBox/index.cjs +32 -0
- package/ViewBox/index.cjs.map +1 -0
- package/ViewBox/index.js +11 -13
- package/ViewBox/index.js.map +1 -1
- package/index.cjs +134 -0
- package/index.cjs.map +1 -0
- package/index.js +64 -133
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/readme.md +4 -4
- package/useAlert/index.cjs +94 -0
- package/useAlert/index.cjs.map +1 -0
- package/useAlert/index.js +12 -14
- package/useAlert/index.js.map +1 -1
- package/useBlurCss/index.cjs +19 -0
- package/useBlurCss/index.cjs.map +1 -0
- package/useBlurCss/index.js +5 -7
- package/useBlurCss/index.js.map +1 -1
- package/useCorner/index.cjs +22 -0
- package/useCorner/index.cjs.map +1 -0
- package/useCorner/index.js +1 -3
- package/useCorner/index.js.map +1 -1
- package/useLayer/index.cjs +38 -0
- package/useLayer/index.cjs.map +1 -0
- package/useLayer/index.js +7 -9
- package/useLayer/index.js.map +1 -1
- package/useModal/index.cjs +37 -0
- package/useModal/index.cjs.map +1 -0
- package/useModal/index.js +8 -10
- package/useModal/index.js.map +1 -1
package/Modal/index.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var index = require('../useModal/index.js');
|
|
8
|
-
var core = require('@xanui/core');
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { useRef, useEffect } from 'react';
|
|
5
|
+
import useModal from '../useModal/index.js';
|
|
6
|
+
import { Tag, Renderar } from '@xanui/core';
|
|
9
7
|
|
|
10
8
|
const Modal = (_a) => {
|
|
11
|
-
var { children, open } = _a, props =
|
|
12
|
-
const ref =
|
|
13
|
-
const modal =
|
|
9
|
+
var { children, open } = _a, props = __rest(_a, ["children", "open"]);
|
|
10
|
+
const ref = useRef(null);
|
|
11
|
+
const modal = useModal(jsx(Fragment, { children: children }), Object.assign(Object.assign({}, props), { onClickOutside: () => {
|
|
14
12
|
if (props === null || props === void 0 ? void 0 : props.onClickOutside) {
|
|
15
13
|
props.onClickOutside();
|
|
16
14
|
}
|
|
@@ -21,7 +19,7 @@ const Modal = (_a) => {
|
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
} }));
|
|
24
|
-
|
|
22
|
+
useEffect(() => {
|
|
25
23
|
if (open) {
|
|
26
24
|
modal.open();
|
|
27
25
|
}
|
|
@@ -29,14 +27,14 @@ const Modal = (_a) => {
|
|
|
29
27
|
modal.close();
|
|
30
28
|
}
|
|
31
29
|
}, [open]);
|
|
32
|
-
return
|
|
30
|
+
return jsx(Tag, { ref: ref });
|
|
33
31
|
};
|
|
34
32
|
const ActionModal = (_a) => {
|
|
35
|
-
var { children } = _a, props =
|
|
36
|
-
return (
|
|
33
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
34
|
+
return (jsx(Modal, Object.assign({}, props, { children: children })));
|
|
37
35
|
};
|
|
38
36
|
Modal.open = (children, props) => {
|
|
39
|
-
const m =
|
|
37
|
+
const m = Renderar.render(ActionModal, Object.assign(Object.assign({ open: true }, props), { children, onClosed: () => {
|
|
40
38
|
m.unrender();
|
|
41
39
|
if (props === null || props === void 0 ? void 0 : props.onClosed) {
|
|
42
40
|
props.onClosed();
|
|
@@ -52,8 +50,8 @@ Modal.open = (children, props) => {
|
|
|
52
50
|
};
|
|
53
51
|
};
|
|
54
52
|
Modal.close = () => {
|
|
55
|
-
|
|
53
|
+
Renderar.unrender(ActionModal);
|
|
56
54
|
};
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
export { Modal as default };
|
|
59
57
|
//# sourceMappingURL=index.js.map
|
package/Modal/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Modal/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Modal/index.tsx"],"sourcesContent":["'use client'\r\nimport { ReactNode, useEffect, useRef } from \"react\";\r\nimport useModal, { UseModalProps } from \"../useModal\";\r\nimport { Renderar, Tag } from \"@xanui/core\";\r\n\r\nexport type ModalProps = UseModalProps & {\r\n children: ReactNode;\r\n open: boolean;\r\n}\r\n\r\nconst Modal = ({ children, open, ...props }: ModalProps) => {\r\n const ref = useRef<HTMLDivElement>(null);\r\n\r\n const modal = useModal(<>{children}</>, {\r\n ...props,\r\n onClickOutside: () => {\r\n if (props?.onClickOutside) {\r\n props.onClickOutside()\r\n }\r\n },\r\n slotProps: {\r\n layer: {\r\n portal: {\r\n container: ref?.current || undefined\r\n }\r\n }\r\n }\r\n })\r\n\r\n useEffect(() => {\r\n if (open) {\r\n modal.open()\r\n } else {\r\n modal.close()\r\n }\r\n }, [open])\r\n return <Tag ref={ref}></Tag>\r\n}\r\n\r\nconst ActionModal = ({ children, ...props }: ModalProps) => {\r\n return (\r\n <Modal {...props}>\r\n {children}\r\n </Modal>\r\n )\r\n}\r\n\r\nModal.open = (children: ModalProps['children'], props?: Omit<ModalProps, 'children' | \"open\">) => {\r\n const m = Renderar.render(ActionModal as any, {\r\n open: true,\r\n ...props,\r\n children,\r\n onClosed: () => {\r\n m.unrender()\r\n if (props?.onClosed) {\r\n props.onClosed()\r\n }\r\n }\r\n })\r\n\r\n return {\r\n open: () => {\r\n m.updateProps({ open: true })\r\n },\r\n close: () => {\r\n m.updateProps({ open: false })\r\n },\r\n }\r\n};\r\n\r\nModal.close = () => {\r\n Renderar.unrender(ActionModal as any)\r\n}\r\n\r\nexport default Modal;"],"names":[],"mappings":";;;;;;;AAUA;;AACG;AAEA;;;;;AAQM;AACG;;AAEC;AACH;AACH;;;;;;;;AASJ;AACA;AACH;AAEA;AAAqB;;AAMrB;AAEA;AACG;;;;;AASG;;;;;;;;;AAWN;AAEA;AACG;AACH;;"}
|
package/NoSSR/index.cjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
const NoSSR = ({ children }) => {
|
|
7
|
+
const [isClient, setIsClient] = React.useState(false);
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
setIsClient(true);
|
|
10
|
+
}, []);
|
|
11
|
+
return isClient ? children : null;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
module.exports = NoSSR;
|
|
15
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/NoSSR/index.tsx"],"sourcesContent":["'use client'\r\nimport { useEffect, useState } from \"react\";\r\n\r\nconst NoSSR = ({ children }: any) => {\r\n const [isClient, setIsClient] = useState(false);\r\n useEffect(() => {\r\n setIsClient(true);\r\n }, [])\r\n return isClient ? children : null\r\n}\r\n\r\nexport default NoSSR"],"names":[],"mappings":";;;;;AAGA;;;;;;AAMA;;"}
|
package/NoSSR/index.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var React = require('react');
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
5
3
|
|
|
6
4
|
const NoSSR = ({ children }) => {
|
|
7
|
-
const [isClient, setIsClient] =
|
|
8
|
-
|
|
5
|
+
const [isClient, setIsClient] = useState(false);
|
|
6
|
+
useEffect(() => {
|
|
9
7
|
setIsClient(true);
|
|
10
8
|
}, []);
|
|
11
9
|
return isClient ? children : null;
|
|
12
10
|
};
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
export { NoSSR as default };
|
|
15
13
|
//# sourceMappingURL=index.js.map
|
package/NoSSR/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/NoSSR/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/NoSSR/index.tsx"],"sourcesContent":["'use client'\r\nimport { useEffect, useState } from \"react\";\r\n\r\nconst NoSSR = ({ children }: any) => {\r\n const [isClient, setIsClient] = useState(false);\r\n useEffect(() => {\r\n setIsClient(true);\r\n }, [])\r\n return isClient ? children : null\r\n}\r\n\r\nexport default NoSSR"],"names":[],"mappings":";;;AAGA;;;;;;AAMA;;"}
|
package/Option/index.cjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var index = require('../ListItem/index.cjs');
|
|
7
|
+
|
|
8
|
+
const Option = React.forwardRef((_a, ref) => {
|
|
9
|
+
var { value, children } = _a, props = tslib.__rest(_a, ["value", "children"]);
|
|
10
|
+
return (jsxRuntime.jsx(index, Object.assign({}, props, { ref: ref, children: children })));
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
module.exports = Option;
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Option/index.tsx"],"sourcesContent":["\r\nimport React from 'react'\r\nimport ListItem, { ListItemProps } from '../ListItem'\r\n\r\nexport type OptionProps = ListItemProps & {\r\n value: string | number;\r\n}\r\n\r\nconst Option = React.forwardRef(({ value, children, ...props }: OptionProps, ref: React.Ref<any>) => {\r\n return (\r\n <ListItem {...props} ref={ref}>{children}</ListItem>\r\n )\r\n})\r\n\r\nexport default Option"],"names":["__rest","_jsx","ListItem"],"mappings":";;;;;;;AAQA,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAA0C,EAAE,GAAmB,KAAI;QAAnE,EAAE,KAAK,EAAE,QAAQ,EAAA,GAAA,EAAyB,EAApB,KAAK,GAAAA,YAAA,CAAA,EAAA,EAA3B,qBAA6B,CAAF;AACxD,IAAA,QACIC,cAAA,CAACC,KAAQ,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,KAAK,EAAA,EAAE,GAAG,EAAE,GAAG,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAA,CAAY;AAE5D,CAAC;;;;"}
|
package/Option/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var index = require('../ListItem/index.js');
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import ListItem from '../ListItem/index.js';
|
|
7
5
|
|
|
8
6
|
const Option = React.forwardRef((_a, ref) => {
|
|
9
|
-
var { value, children } = _a, props =
|
|
10
|
-
return (
|
|
7
|
+
var { value, children } = _a, props = __rest(_a, ["value", "children"]);
|
|
8
|
+
return (jsx(ListItem, Object.assign({}, props, { ref: ref, children: children })));
|
|
11
9
|
});
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
export { Option as default };
|
|
14
12
|
//# sourceMappingURL=index.js.map
|
package/Option/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Option/index.tsx"],"sourcesContent":["\r\nimport React from 'react'\r\nimport ListItem, { ListItemProps } from '../ListItem'\r\n\r\nexport type OptionProps = ListItemProps & {\r\n value: string | number;\r\n}\r\n\r\nconst Option = React.forwardRef(({ value, children, ...props }: OptionProps, ref: React.Ref<any>) => {\r\n return (\r\n <ListItem {...props} ref={ref}>{children}</ListItem>\r\n )\r\n})\r\n\r\nexport default Option"],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Option/index.tsx"],"sourcesContent":["\r\nimport React from 'react'\r\nimport ListItem, { ListItemProps } from '../ListItem'\r\n\r\nexport type OptionProps = ListItemProps & {\r\n value: string | number;\r\n}\r\n\r\nconst Option = React.forwardRef(({ value, children, ...props }: OptionProps, ref: React.Ref<any>) => {\r\n return (\r\n <ListItem {...props} ref={ref}>{children}</ListItem>\r\n )\r\n})\r\n\r\nexport default Option"],"names":["_jsx"],"mappings":";;;;;AAQA,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAA0C,EAAE,GAAmB,KAAI;QAAnE,EAAE,KAAK,EAAE,QAAQ,EAAA,GAAA,EAAyB,EAApB,KAAK,GAAA,MAAA,CAAA,EAAA,EAA3B,qBAA6B,CAAF;AACxD,IAAA,QACIA,GAAA,CAAC,QAAQ,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,KAAK,EAAA,EAAE,GAAG,EAAE,GAAG,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAA,CAAY;AAE5D,CAAC;;;;"}
|
package/Paper/index.cjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var core = require('@xanui/core');
|
|
7
|
+
|
|
8
|
+
const Paper = React.forwardRef((_a, ref) => {
|
|
9
|
+
var { children } = _a, rest = tslib.__rest(_a, ["children"]);
|
|
10
|
+
let [props] = core.useInterface("Paper", rest, {});
|
|
11
|
+
return (jsxRuntime.jsx(core.Tag, Object.assign({}, props, { sxr: Object.assign({ shadow: 1, radius: 1, p: 1.5, bgcolor: "background.secondary", color: "text.primary" }, props === null || props === void 0 ? void 0 : props.sx), baseClass: 'paper', ref: ref, children: children })));
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
module.exports = Paper;
|
|
15
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Paper/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType, useInterface } from '@xanui/core';\r\n\r\nexport type PaperProps<T extends TagComponentType = \"div\"> = TagProps<T>\r\n\r\nconst Paper = React.forwardRef(<T extends TagComponentType = \"div\">({ children, ...rest }: PaperProps<T>, ref?: React.Ref<any>) => {\r\n let [props] = useInterface<any>(\"Paper\", rest, {})\r\n return (\r\n <Tag\r\n {...props}\r\n sxr={{\r\n shadow: 1,\r\n radius: 1,\r\n p: 1.5,\r\n bgcolor: \"background.secondary\",\r\n color: \"text.primary\",\r\n ...props?.sx\r\n }}\r\n baseClass='paper'\r\n ref={ref}\r\n >{children}</Tag>\r\n )\r\n})\r\n\r\nexport default Paper\r\n"],"names":["__rest","useInterface","_jsx","Tag"],"mappings":";;;;;;;AAMA,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAqC,EAAoC,EAAE,GAAoB,KAAI;AAA9D,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAA0B,EAArB,IAAI,GAAAA,YAAA,CAAA,EAAA,EAAnB,YAAqB,CAAF;AACnF,IAAA,IAAI,CAAC,KAAK,CAAC,GAAGC,iBAAY,CAAM,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;IAClD,QACIC,eAACC,QAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACI,KAAK,EAAA,EACT,GAAG,kBACC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,EACT,CAAC,EAAE,GAAG,EACN,OAAO,EAAE,sBAAsB,EAC/B,KAAK,EAAE,cAAc,EAAA,EAClB,KAAK,aAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,EAAE,CAAA,EAEhB,SAAS,EAAC,OAAO,EACjB,GAAG,EAAE,GAAG,EAAA,QAAA,EACV,QAAQ,EAAA,CAAA,CAAO;AAEzB,CAAC;;;;"}
|
package/Paper/index.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
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 { useInterface, Tag } from '@xanui/core';
|
|
7
5
|
|
|
8
6
|
const Paper = React.forwardRef((_a, ref) => {
|
|
9
|
-
var { children } = _a, rest =
|
|
10
|
-
let [props] =
|
|
11
|
-
return (
|
|
7
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
8
|
+
let [props] = useInterface("Paper", rest, {});
|
|
9
|
+
return (jsx(Tag, Object.assign({}, props, { sxr: Object.assign({ shadow: 1, radius: 1, p: 1.5, bgcolor: "background.secondary", color: "text.primary" }, props === null || props === void 0 ? void 0 : props.sx), baseClass: 'paper', ref: ref, children: children })));
|
|
12
10
|
});
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
export { Paper as default };
|
|
15
13
|
//# sourceMappingURL=index.js.map
|
package/Paper/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Paper/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType, useInterface } from '@xanui/core';\r\n\r\nexport type PaperProps<T extends TagComponentType = \"div\"> = TagProps<T>\r\n\r\nconst Paper = React.forwardRef(<T extends TagComponentType = \"div\">({ children, ...rest }: PaperProps<T>, ref?: React.Ref<any>) => {\r\n let [props] = useInterface<any>(\"Paper\", rest, {})\r\n return (\r\n <Tag\r\n {...props}\r\n sxr={{\r\n shadow: 1,\r\n radius: 1,\r\n p: 1.5,\r\n bgcolor: \"background.secondary\",\r\n color: \"text.primary\",\r\n ...props?.sx\r\n }}\r\n baseClass='paper'\r\n ref={ref}\r\n >{children}</Tag>\r\n )\r\n})\r\n\r\nexport default Paper\r\n"],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Paper/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { Tag, TagProps, TagComponentType, useInterface } from '@xanui/core';\r\n\r\nexport type PaperProps<T extends TagComponentType = \"div\"> = TagProps<T>\r\n\r\nconst Paper = React.forwardRef(<T extends TagComponentType = \"div\">({ children, ...rest }: PaperProps<T>, ref?: React.Ref<any>) => {\r\n let [props] = useInterface<any>(\"Paper\", rest, {})\r\n return (\r\n <Tag\r\n {...props}\r\n sxr={{\r\n shadow: 1,\r\n radius: 1,\r\n p: 1.5,\r\n bgcolor: \"background.secondary\",\r\n color: \"text.primary\",\r\n ...props?.sx\r\n }}\r\n baseClass='paper'\r\n ref={ref}\r\n >{children}</Tag>\r\n )\r\n})\r\n\r\nexport default Paper\r\n"],"names":["_jsx"],"mappings":";;;;;AAMA,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAqC,EAAoC,EAAE,GAAoB,KAAI;AAA9D,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAA0B,EAArB,IAAI,GAAA,MAAA,CAAA,EAAA,EAAnB,YAAqB,CAAF;AACnF,IAAA,IAAI,CAAC,KAAK,CAAC,GAAG,YAAY,CAAM,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;IAClD,QACIA,IAAC,GAAG,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACI,KAAK,EAAA,EACT,GAAG,kBACC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,EACT,CAAC,EAAE,GAAG,EACN,OAAO,EAAE,sBAAsB,EAC/B,KAAK,EAAE,cAAc,EAAA,EAClB,KAAK,aAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,EAAE,CAAA,EAEhB,SAAS,EAAC,OAAO,EACjB,GAAG,EAAE,GAAG,EAAA,QAAA,EACV,QAAQ,EAAA,CAAA,CAAO;AAEzB,CAAC;;;;"}
|
package/Portal/index.cjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var ReactDOM = require('react-dom');
|
|
7
|
+
var core = require('@xanui/core');
|
|
8
|
+
|
|
9
|
+
const Portal = ({ children, appendTo, container }) => {
|
|
10
|
+
const theme = core.useTheme();
|
|
11
|
+
appendTo = appendTo || document.body;
|
|
12
|
+
const c = React.useMemo(() => {
|
|
13
|
+
let _con = container || document.createElement("div");
|
|
14
|
+
appendTo.appendChild(_con);
|
|
15
|
+
_con.className = "xui-portal";
|
|
16
|
+
return _con;
|
|
17
|
+
}, [container]);
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
return () => {
|
|
20
|
+
appendTo.removeChild(c);
|
|
21
|
+
};
|
|
22
|
+
}, []);
|
|
23
|
+
return ReactDOM.createPortal(jsxRuntime.jsx(core.ThemeProvider, { theme: theme.name, children: children }), c);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
module.exports = Portal;
|
|
27
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Portal/index.tsx"],"sourcesContent":["'use client'\r\nimport React, { useEffect, useMemo } from 'react'\r\nimport ReactDOM from 'react-dom';\r\nimport { useTheme, ThemeProvider } from '@xanui/core';\r\nexport type PortalProps = {\r\n children?: React.ReactNode;\r\n appendTo?: HTMLElement;\r\n container?: HTMLElement;\r\n}\r\n\r\nconst Portal = ({ children, appendTo, container }: PortalProps) => {\r\n const theme = useTheme()\r\n appendTo = appendTo || document.body\r\n\r\n const c = useMemo(() => {\r\n let _con: HTMLElement = container || document.createElement(\"div\");\r\n appendTo.appendChild(_con);\r\n _con.className = \"xui-portal\"\r\n return _con\r\n }, [container])\r\n\r\n useEffect(() => {\r\n return () => {\r\n (appendTo as any).removeChild(c);\r\n }\r\n }, [])\r\n\r\n return ReactDOM.createPortal(\r\n <ThemeProvider theme={theme.name}>\r\n {children}\r\n </ThemeProvider>,\r\n c,\r\n );\r\n}\r\n\r\nexport default Portal"],"names":[],"mappings":";;;;;;;;AAUA;AACI;AACA;AAEA;;AAEI;AACA;AACA;AACJ;;AAGI;AACK;AACL;;AAGJ;AAMJ;;"}
|
package/Portal/index.js
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var ReactDOM = require('react-dom');
|
|
7
|
-
var core = require('@xanui/core');
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useMemo, useEffect } from 'react';
|
|
4
|
+
import ReactDOM from 'react-dom';
|
|
5
|
+
import { useTheme, ThemeProvider } from '@xanui/core';
|
|
8
6
|
|
|
9
7
|
const Portal = ({ children, appendTo, container }) => {
|
|
10
|
-
const theme =
|
|
8
|
+
const theme = useTheme();
|
|
11
9
|
appendTo = appendTo || document.body;
|
|
12
|
-
const c =
|
|
10
|
+
const c = useMemo(() => {
|
|
13
11
|
let _con = container || document.createElement("div");
|
|
14
12
|
appendTo.appendChild(_con);
|
|
15
13
|
_con.className = "xui-portal";
|
|
16
14
|
return _con;
|
|
17
15
|
}, [container]);
|
|
18
|
-
|
|
16
|
+
useEffect(() => {
|
|
19
17
|
return () => {
|
|
20
18
|
appendTo.removeChild(c);
|
|
21
19
|
};
|
|
22
20
|
}, []);
|
|
23
|
-
return ReactDOM.createPortal(
|
|
21
|
+
return ReactDOM.createPortal(jsx(ThemeProvider, { theme: theme.name, children: children }), c);
|
|
24
22
|
};
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
export { Portal as default };
|
|
27
25
|
//# sourceMappingURL=index.js.map
|
package/Portal/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Portal/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Portal/index.tsx"],"sourcesContent":["'use client'\r\nimport React, { useEffect, useMemo } from 'react'\r\nimport ReactDOM from 'react-dom';\r\nimport { useTheme, ThemeProvider } from '@xanui/core';\r\nexport type PortalProps = {\r\n children?: React.ReactNode;\r\n appendTo?: HTMLElement;\r\n container?: HTMLElement;\r\n}\r\n\r\nconst Portal = ({ children, appendTo, container }: PortalProps) => {\r\n const theme = useTheme()\r\n appendTo = appendTo || document.body\r\n\r\n const c = useMemo(() => {\r\n let _con: HTMLElement = container || document.createElement(\"div\");\r\n appendTo.appendChild(_con);\r\n _con.className = \"xui-portal\"\r\n return _con\r\n }, [container])\r\n\r\n useEffect(() => {\r\n return () => {\r\n (appendTo as any).removeChild(c);\r\n }\r\n }, [])\r\n\r\n return ReactDOM.createPortal(\r\n <ThemeProvider theme={theme.name}>\r\n {children}\r\n </ThemeProvider>,\r\n c,\r\n );\r\n}\r\n\r\nexport default Portal"],"names":[],"mappings":";;;;;;AAUA;AACI;AACA;AAEA;;AAEI;AACA;AACA;AACJ;;AAGI;AACK;AACL;;AAGJ;AAMJ;;"}
|
package/Radio/index.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var core = require('@xanui/core');
|
|
6
|
+
var CheckIcon = require('@xanui/icons/RadioButtonChecked');
|
|
7
|
+
var UnCheckIcon = require('@xanui/icons/RadioButtonUnchecked');
|
|
8
|
+
var index = require('../Checkbox/index.cjs');
|
|
9
|
+
|
|
10
|
+
const Radio = React.forwardRef((props, ref) => {
|
|
11
|
+
let [rest] = core.useInterface("Radio", props, {});
|
|
12
|
+
return jsxRuntime.jsx(index, Object.assign({ checkIcon: jsxRuntime.jsx(CheckIcon, {}), uncheckIcon: jsxRuntime.jsx(UnCheckIcon, {}) }, rest, { type: "radio", ref: ref, classNames: ['radio', ...((rest === null || rest === void 0 ? void 0 : rest.classNames) || [])] }));
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
module.exports = Radio;
|
|
16
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Radio/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { useInterface } from '@xanui/core';\r\nimport CheckIcon from '@xanui/icons/RadioButtonChecked'\r\nimport UnCheckIcon from '@xanui/icons/RadioButtonUnchecked'\r\nimport Checkbox, { CheckboxProps } from '../Checkbox';\r\n\r\nexport type RadioProps = CheckboxProps\r\nconst Radio = React.forwardRef((props: RadioProps, ref?: React.Ref<any>) => {\r\n let [rest] = useInterface<any>(\"Radio\", props, {})\r\n return <Checkbox\r\n checkIcon={<CheckIcon />}\r\n uncheckIcon={<UnCheckIcon />}\r\n {...rest}\r\n type=\"radio\"\r\n ref={ref}\r\n classNames={['radio', ...(rest?.classNames || [])]}\r\n />\r\n})\r\n\r\nexport default Radio\r\n"],"names":["useInterface","_jsx","Checkbox"],"mappings":";;;;;;;;;AAQA,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAiB,EAAE,GAAoB,KAAI;AACvE,IAAA,IAAI,CAAC,IAAI,CAAC,GAAGA,iBAAY,CAAM,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;IAClD,OAAOC,cAAA,CAACC,KAAQ,EAAA,MAAA,CAAA,MAAA,CAAA,EACZ,SAAS,EAAED,cAAA,CAAC,SAAS,KAAG,EACxB,WAAW,EAAEA,cAAA,CAAC,WAAW,KAAG,EAAA,EACxB,IAAI,IACR,IAAI,EAAC,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,CAAC,OAAO,EAAE,IAAI,CAAA,IAAI,aAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,UAAU,KAAI,EAAE,CAAC,CAAC,EAAA,CAAA,CACpD;AACN,CAAC;;;;"}
|
package/Radio/index.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var UnCheckIcon = require('@xanui/icons/RadioButtonUnchecked');
|
|
8
|
-
var index = require('../Checkbox/index.js');
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useInterface } from '@xanui/core';
|
|
4
|
+
import CheckIcon from '@xanui/icons/RadioButtonChecked';
|
|
5
|
+
import UnCheckIcon from '@xanui/icons/RadioButtonUnchecked';
|
|
6
|
+
import Checkbox from '../Checkbox/index.js';
|
|
9
7
|
|
|
10
8
|
const Radio = React.forwardRef((props, ref) => {
|
|
11
|
-
let [rest] =
|
|
12
|
-
return
|
|
9
|
+
let [rest] = useInterface("Radio", props, {});
|
|
10
|
+
return jsx(Checkbox, Object.assign({ checkIcon: jsx(CheckIcon, {}), uncheckIcon: jsx(UnCheckIcon, {}) }, rest, { type: "radio", ref: ref, classNames: ['radio', ...((rest === null || rest === void 0 ? void 0 : rest.classNames) || [])] }));
|
|
13
11
|
});
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
export { Radio as default };
|
|
16
14
|
//# sourceMappingURL=index.js.map
|
package/Radio/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Radio/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { useInterface } from '@xanui/core';\r\nimport CheckIcon from '@xanui/icons/RadioButtonChecked'\r\nimport UnCheckIcon from '@xanui/icons/RadioButtonUnchecked'\r\nimport Checkbox, { CheckboxProps } from '../Checkbox';\r\n\r\nexport type RadioProps = CheckboxProps\r\nconst Radio = React.forwardRef((props: RadioProps, ref?: React.Ref<any>) => {\r\n let [rest] = useInterface<any>(\"Radio\", props, {})\r\n return <Checkbox\r\n checkIcon={<CheckIcon />}\r\n uncheckIcon={<UnCheckIcon />}\r\n {...rest}\r\n type=\"radio\"\r\n ref={ref}\r\n classNames={['radio', ...(rest?.classNames || [])]}\r\n />\r\n})\r\n\r\nexport default Radio\r\n"],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Radio/index.tsx"],"sourcesContent":["\r\nimport React from 'react';\r\nimport { useInterface } from '@xanui/core';\r\nimport CheckIcon from '@xanui/icons/RadioButtonChecked'\r\nimport UnCheckIcon from '@xanui/icons/RadioButtonUnchecked'\r\nimport Checkbox, { CheckboxProps } from '../Checkbox';\r\n\r\nexport type RadioProps = CheckboxProps\r\nconst Radio = React.forwardRef((props: RadioProps, ref?: React.Ref<any>) => {\r\n let [rest] = useInterface<any>(\"Radio\", props, {})\r\n return <Checkbox\r\n checkIcon={<CheckIcon />}\r\n uncheckIcon={<UnCheckIcon />}\r\n {...rest}\r\n type=\"radio\"\r\n ref={ref}\r\n classNames={['radio', ...(rest?.classNames || [])]}\r\n />\r\n})\r\n\r\nexport default Radio\r\n"],"names":["_jsx"],"mappings":";;;;;;;AAQA,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAiB,EAAE,GAAoB,KAAI;AACvE,IAAA,IAAI,CAAC,IAAI,CAAC,GAAG,YAAY,CAAM,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;IAClD,OAAOA,GAAA,CAAC,QAAQ,EAAA,MAAA,CAAA,MAAA,CAAA,EACZ,SAAS,EAAEA,GAAA,CAAC,SAAS,KAAG,EACxB,WAAW,EAAEA,GAAA,CAAC,WAAW,KAAG,EAAA,EACxB,IAAI,IACR,IAAI,EAAC,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,CAAC,OAAO,EAAE,IAAI,CAAA,IAAI,aAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,UAAU,KAAI,EAAE,CAAC,CAAC,EAAA,CAAA,CACpD;AACN,CAAC;;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var tslib = require('tslib');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var core = require('@xanui/core');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
|
|
9
|
+
const Scrollbar = React.forwardRef((_a, ref) => {
|
|
10
|
+
var { children } = _a, rest = tslib.__rest(_a, ["children"]);
|
|
11
|
+
let [_b] = core.useInterface("Scrollbar", rest, {}), { onScroll, onScrollEnd } = _b, props = tslib.__rest(_b, ["onScroll", "onScrollEnd"]);
|
|
12
|
+
const innerRef = React.useRef(null);
|
|
13
|
+
React.useImperativeHandle(ref, () => ({
|
|
14
|
+
scrollTo(pos) {
|
|
15
|
+
var _a;
|
|
16
|
+
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
17
|
+
top: pos,
|
|
18
|
+
behavior: "smooth"
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
scrollToBottom() {
|
|
22
|
+
if (!innerRef.current)
|
|
23
|
+
return;
|
|
24
|
+
const ele = innerRef.current;
|
|
25
|
+
ele.scrollTo({
|
|
26
|
+
top: ele.scrollHeight,
|
|
27
|
+
behavior: "smooth"
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
scrollToTop() {
|
|
31
|
+
var _a;
|
|
32
|
+
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
33
|
+
top: 0,
|
|
34
|
+
behavior: "smooth"
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
if (onScroll || onScrollEnd) {
|
|
39
|
+
props.onScroll = (e) => {
|
|
40
|
+
if (onScrollEnd) {
|
|
41
|
+
const ele = e.target;
|
|
42
|
+
const scrollTop = ele.scrollTop;
|
|
43
|
+
const scrollHeight = ele.scrollHeight;
|
|
44
|
+
const clientHeight = ele.clientHeight;
|
|
45
|
+
const isScrollDown = scrollHeight - scrollTop <= clientHeight + 1;
|
|
46
|
+
isScrollDown && onScrollEnd(e);
|
|
47
|
+
}
|
|
48
|
+
onScroll && onScroll(e);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return (jsxRuntime.jsx(core.Tag, Object.assign({}, props, { ref: innerRef, baseClass: 'scrollbar', sxr: {
|
|
52
|
+
height: "100%",
|
|
53
|
+
width: "100%",
|
|
54
|
+
overflow: "auto",
|
|
55
|
+
}, children: children })));
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
module.exports = Scrollbar;
|
|
59
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Scrollbar/index.tsx"],"sourcesContent":["'use client'\r\n\r\nimport { Tag, TagComponentType, TagProps, useInterface } from '@xanui/core';\r\nimport React, { ReactNode, UIEvent, useImperativeHandle, useRef } from 'react'\r\n\r\nexport type ScrollbarProps<T extends TagComponentType = \"div\"> = TagProps<T> & {\r\n children?: ReactNode;\r\n onScrollEnd?: (e: UIEvent<HTMLDivElement>) => void;\r\n}\r\n\r\nexport type ScrollbarHandle = {\r\n scrollTo: (pos: number) => void;\r\n scrollToBottom: () => void;\r\n scrollToTop: () => void;\r\n};\r\n\r\nconst Scrollbar = React.forwardRef(<T extends TagComponentType = \"div\">({ children, ...rest }: ScrollbarProps<T>, ref: React.Ref<ScrollbarHandle>) => {\r\n let [{ onScroll, onScrollEnd, ...props }] = useInterface<any>(\"Scrollbar\", rest, {})\r\n const innerRef = useRef<HTMLDivElement>(null);\r\n\r\n useImperativeHandle(ref, () => ({\r\n scrollTo(pos: number) {\r\n innerRef.current?.scrollTo({\r\n top: pos,\r\n behavior: \"smooth\"\r\n });\r\n },\r\n scrollToBottom() {\r\n if (!innerRef.current) return;\r\n const ele = innerRef.current;\r\n ele.scrollTo({\r\n top: ele.scrollHeight,\r\n behavior: \"smooth\"\r\n });\r\n },\r\n scrollToTop() {\r\n innerRef.current?.scrollTo({\r\n top: 0,\r\n behavior: \"smooth\"\r\n });\r\n }\r\n }));\r\n\r\n if (onScroll || onScrollEnd) {\r\n props.onScroll = (e: UIEvent<HTMLDivElement>) => {\r\n if (onScrollEnd) {\r\n const ele: any = e.target\r\n const scrollTop = ele.scrollTop\r\n const scrollHeight = ele.scrollHeight\r\n const clientHeight = ele.clientHeight\r\n const isScrollDown = scrollHeight - scrollTop <= clientHeight + 1\r\n isScrollDown && onScrollEnd(e)\r\n }\r\n onScroll && onScroll(e)\r\n }\r\n }\r\n\r\n return (\r\n <Tag\r\n {...props}\r\n ref={innerRef}\r\n baseClass='scrollbar'\r\n sxr={{\r\n height: \"100%\",\r\n width: \"100%\",\r\n overflow: \"auto\",\r\n }}\r\n >\r\n {children}\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default Scrollbar "],"names":[],"mappings":";;;;;;;;AAgBA;AAAwE;;AAEpE;AAEA;AACI;;AACI;AACI;AACA;AACH;;;;;AAID;;;AAGI;AACH;;;;AAGD;AACI;AACA;AACH;;AAER;AAED;AACI;;AAEQ;AACA;AACA;AACA;;AAEA;;AAEJ;AACJ;;AAGJ;AAMY;AACA;AACA;;AAMhB;;"}
|
package/Scrollbar/index.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var core = require('@xanui/core');
|
|
7
|
-
var React = require('react');
|
|
2
|
+
import { __rest } from 'tslib';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useInterface, Tag } from '@xanui/core';
|
|
5
|
+
import React, { useRef, useImperativeHandle } from 'react';
|
|
8
6
|
|
|
9
7
|
const Scrollbar = React.forwardRef((_a, ref) => {
|
|
10
|
-
var { children } = _a, rest =
|
|
11
|
-
let [_b] =
|
|
12
|
-
const innerRef =
|
|
13
|
-
|
|
8
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
9
|
+
let [_b] = useInterface("Scrollbar", rest, {}), { onScroll, onScrollEnd } = _b, props = __rest(_b, ["onScroll", "onScrollEnd"]);
|
|
10
|
+
const innerRef = useRef(null);
|
|
11
|
+
useImperativeHandle(ref, () => ({
|
|
14
12
|
scrollTo(pos) {
|
|
15
13
|
var _a;
|
|
16
14
|
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
@@ -48,12 +46,12 @@ const Scrollbar = React.forwardRef((_a, ref) => {
|
|
|
48
46
|
onScroll && onScroll(e);
|
|
49
47
|
};
|
|
50
48
|
}
|
|
51
|
-
return (
|
|
49
|
+
return (jsx(Tag, Object.assign({}, props, { ref: innerRef, baseClass: 'scrollbar', sxr: {
|
|
52
50
|
height: "100%",
|
|
53
51
|
width: "100%",
|
|
54
52
|
overflow: "auto",
|
|
55
53
|
}, children: children })));
|
|
56
54
|
});
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
export { Scrollbar as default };
|
|
59
57
|
//# sourceMappingURL=index.js.map
|
package/Scrollbar/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Scrollbar/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/Scrollbar/index.tsx"],"sourcesContent":["'use client'\r\n\r\nimport { Tag, TagComponentType, TagProps, useInterface } from '@xanui/core';\r\nimport React, { ReactNode, UIEvent, useImperativeHandle, useRef } from 'react'\r\n\r\nexport type ScrollbarProps<T extends TagComponentType = \"div\"> = TagProps<T> & {\r\n children?: ReactNode;\r\n onScrollEnd?: (e: UIEvent<HTMLDivElement>) => void;\r\n}\r\n\r\nexport type ScrollbarHandle = {\r\n scrollTo: (pos: number) => void;\r\n scrollToBottom: () => void;\r\n scrollToTop: () => void;\r\n};\r\n\r\nconst Scrollbar = React.forwardRef(<T extends TagComponentType = \"div\">({ children, ...rest }: ScrollbarProps<T>, ref: React.Ref<ScrollbarHandle>) => {\r\n let [{ onScroll, onScrollEnd, ...props }] = useInterface<any>(\"Scrollbar\", rest, {})\r\n const innerRef = useRef<HTMLDivElement>(null);\r\n\r\n useImperativeHandle(ref, () => ({\r\n scrollTo(pos: number) {\r\n innerRef.current?.scrollTo({\r\n top: pos,\r\n behavior: \"smooth\"\r\n });\r\n },\r\n scrollToBottom() {\r\n if (!innerRef.current) return;\r\n const ele = innerRef.current;\r\n ele.scrollTo({\r\n top: ele.scrollHeight,\r\n behavior: \"smooth\"\r\n });\r\n },\r\n scrollToTop() {\r\n innerRef.current?.scrollTo({\r\n top: 0,\r\n behavior: \"smooth\"\r\n });\r\n }\r\n }));\r\n\r\n if (onScroll || onScrollEnd) {\r\n props.onScroll = (e: UIEvent<HTMLDivElement>) => {\r\n if (onScrollEnd) {\r\n const ele: any = e.target\r\n const scrollTop = ele.scrollTop\r\n const scrollHeight = ele.scrollHeight\r\n const clientHeight = ele.clientHeight\r\n const isScrollDown = scrollHeight - scrollTop <= clientHeight + 1\r\n isScrollDown && onScrollEnd(e)\r\n }\r\n onScroll && onScroll(e)\r\n }\r\n }\r\n\r\n return (\r\n <Tag\r\n {...props}\r\n ref={innerRef}\r\n baseClass='scrollbar'\r\n sxr={{\r\n height: \"100%\",\r\n width: \"100%\",\r\n overflow: \"auto\",\r\n }}\r\n >\r\n {children}\r\n </Tag>\r\n )\r\n})\r\n\r\nexport default Scrollbar "],"names":[],"mappings":";;;;;;AAgBA;AAAwE;;AAEpE;AAEA;AACI;;AACI;AACI;AACA;AACH;;;;;AAID;;;AAGI;AACH;;;;AAGD;AACI;AACA;AACH;;AAER;AAED;AACI;;AAEQ;AACA;AACA;AACA;;AAEA;;AAEJ;AACJ;;AAGJ;AAMY;AACA;AACA;;AAMhB;;"}
|
package/Select/index.cjs
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var tslib = require('tslib');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var index = require('../Input/index.cjs');
|
|
8
|
+
var index$3 = require('../List/index.cjs');
|
|
9
|
+
var index$2 = require('../Menu/index.cjs');
|
|
10
|
+
var index$1 = require('../Stack/index.cjs');
|
|
11
|
+
var DownIcon = require('@xanui/icons/KeyboardArrowDown');
|
|
12
|
+
var UpIcon = require('@xanui/icons/KeyboardArrowUp');
|
|
13
|
+
var core = require('@xanui/core');
|
|
14
|
+
|
|
15
|
+
const Select = React.forwardRef((_a, ref) => {
|
|
16
|
+
var _b, _c, _d, _e, _f, _g;
|
|
17
|
+
var { onChange, value, children, error, helperText, name, refs } = _a, props = tslib.__rest(_a, ["onChange", "value", "children", "error", "helperText", "name", "refs"]);
|
|
18
|
+
let [_h] = core.useInterface("Select", props, {}), { slotProps, color, variant } = _h, inputProps = tslib.__rest(_h, ["slotProps", "color", "variant"]);
|
|
19
|
+
color !== null && color !== void 0 ? color : (color = "brand");
|
|
20
|
+
variant !== null && variant !== void 0 ? variant : (variant = "fill");
|
|
21
|
+
const [target, setTarget] = React.useState();
|
|
22
|
+
const conRef = React.useRef(null);
|
|
23
|
+
const { childs, selectedProps } = React.useMemo(() => {
|
|
24
|
+
let sProps = {};
|
|
25
|
+
const c = React.Children.map(children, (child) => {
|
|
26
|
+
let selected = child.props.value === value;
|
|
27
|
+
if (selected)
|
|
28
|
+
sProps = child.props;
|
|
29
|
+
return React.cloneElement(child, {
|
|
30
|
+
value: undefined,
|
|
31
|
+
selected,
|
|
32
|
+
onClick: () => {
|
|
33
|
+
setTarget(null);
|
|
34
|
+
onChange && onChange(child.props.value);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
childs: c,
|
|
40
|
+
selectedProps: sProps
|
|
41
|
+
};
|
|
42
|
+
}, [children, value]);
|
|
43
|
+
const mergeRefs = core.useMergeRefs(ref, conRef);
|
|
44
|
+
const toggleMenu = () => setTarget(target ? null : conRef.current);
|
|
45
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(index, Object.assign({ ref: mergeRefs, color: color, variant: variant === "soft" ? "fill" : variant, endIcon: jsxRuntime.jsxs(index$1, { flexDirection: "row", component: "span", children: [" ", (target ? jsxRuntime.jsx(UpIcon, {}) : jsxRuntime.jsx(DownIcon, {}))] }), readOnly: true, value: typeof selectedProps.children === 'string' ? selectedProps.children : value, cursor: "pointer", userSelect: "none", startIcon: selectedProps.startIcon, focused: !!target, error: error, helperText: helperText, name: name }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.input, inputProps, { refs: Object.assign({ input: refs === null || refs === void 0 ? void 0 : refs.input }, (_b = slotProps === null || slotProps === void 0 ? void 0 : slotProps.input) === null || _b === void 0 ? void 0 : _b.refs), slotProps: {
|
|
46
|
+
rootContainer: Object.assign(Object.assign({ cursor: "pointer", userSelect: "none" }, (((_d = (_c = slotProps === null || slotProps === void 0 ? void 0 : slotProps.input) === null || _c === void 0 ? void 0 : _c.slotProps) === null || _d === void 0 ? void 0 : _d.container) || {})), { onClick: () => {
|
|
47
|
+
if (!target) {
|
|
48
|
+
toggleMenu();
|
|
49
|
+
}
|
|
50
|
+
} })
|
|
51
|
+
} })), jsxRuntime.jsx(index$2, Object.assign({ ref: refs === null || refs === void 0 ? void 0 : refs.menu, target: target, placement: "bottom-left" }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.menu, { slotProps: Object.assign(Object.assign({}, (_e = slotProps === null || slotProps === void 0 ? void 0 : slotProps.menu) === null || _e === void 0 ? void 0 : _e.slotProps), { content: Object.assign(Object.assign({ mt: .5 }, (_f = slotProps === null || slotProps === void 0 ? void 0 : slotProps.menu) === null || _f === void 0 ? void 0 : _f.content), { width: conRef && ((_g = conRef === null || conRef === void 0 ? void 0 : conRef.current) === null || _g === void 0 ? void 0 : _g.clientWidth) }) }), onClickOutside: (e) => {
|
|
52
|
+
if (conRef.current.contains(e.target))
|
|
53
|
+
return;
|
|
54
|
+
toggleMenu();
|
|
55
|
+
}, children: jsxRuntime.jsx(index$3, Object.assign({ ref: refs === null || refs === void 0 ? void 0 : refs.list }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.list, { color: color, variant: variant === "outline" ? "fill" : variant, children: childs })) }))] }));
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
module.exports = Select;
|
|
59
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/Select/index.tsx"],"sourcesContent":["'use client'\r\n\r\nimport React, { ReactElement, useMemo, cloneElement, useState, Children, useRef } from 'react'\r\nimport Input, { InputProps } from '../Input'\r\nimport List, { ListProps } from '../List'\r\nimport Menu, { MenuProps } from '../Menu'\r\nimport Stack from '../Stack'\r\nimport { OptionProps } from '../Option'\r\nimport DownIcon from '@xanui/icons/KeyboardArrowDown';\r\nimport UpIcon from '@xanui/icons/KeyboardArrowUp';\r\nimport { useInterface, useMergeRefs } from '@xanui/core'\r\n\r\n\r\nexport type SelectProps = Omit<InputProps, \"onChange\" | \"value\" | \"children\" | \"slotProps\"> & {\r\n value?: string | number;\r\n onChange?: (value: string | number) => void;\r\n children: ReactElement<OptionProps> | ReactElement<OptionProps>[];\r\n\r\n refs?: {\r\n input?: React.Ref<any>;\r\n menu?: React.Ref<any>;\r\n list?: React.Ref<any>;\r\n };\r\n slotProps?: {\r\n menu?: Omit<MenuProps, 'children' | 'target'>;\r\n input?: Omit<InputProps, \"onChange\" | \"value\">;\r\n list?: Omit<ListProps, \"children\">\r\n }\r\n}\r\n\r\nconst Select = React.forwardRef(({ onChange, value, children, error, helperText, name, refs, ...props }: SelectProps, ref: React.Ref<any>) => {\r\n let [{ slotProps, color, variant, ...inputProps }] = useInterface<any>(\"Select\", props, {})\r\n color ??= \"brand\"\r\n variant ??= \"fill\"\r\n const [target, setTarget] = useState<any>()\r\n const conRef = useRef(null)\r\n const { childs, selectedProps } = useMemo(() => {\r\n let sProps: any = {}\r\n const c = Children.map(children, (child: any) => {\r\n let selected = child.props.value === value\r\n if (selected) sProps = child.props\r\n return cloneElement(child, {\r\n value: undefined,\r\n selected,\r\n onClick: () => {\r\n setTarget(null)\r\n onChange && onChange(child.props.value)\r\n }\r\n })\r\n })\r\n return {\r\n childs: c,\r\n selectedProps: sProps as OptionProps\r\n }\r\n }, [children, value])\r\n\r\n const mergeRefs = useMergeRefs(ref, conRef)\r\n const toggleMenu = () => setTarget(target ? null : conRef.current)\r\n\r\n return (\r\n <>\r\n <Input\r\n ref={mergeRefs}\r\n color={color}\r\n variant={variant === \"soft\" ? \"fill\" : variant}\r\n endIcon={<Stack flexDirection=\"row\" component=\"span\" > {(target ? <UpIcon /> : <DownIcon />)}</Stack>}\r\n readOnly\r\n value={typeof selectedProps.children === 'string' ? selectedProps.children : value}\r\n cursor=\"pointer\"\r\n userSelect=\"none\"\r\n startIcon={selectedProps.startIcon}\r\n focused={!!target}\r\n error={error}\r\n helperText={helperText}\r\n name={name}\r\n {...slotProps?.input}\r\n {...inputProps}\r\n refs={{\r\n input: refs?.input,\r\n ...slotProps?.input?.refs\r\n }}\r\n slotProps={{\r\n rootContainer: {\r\n cursor: \"pointer\",\r\n userSelect: \"none\",\r\n ...(slotProps?.input?.slotProps?.container || {}),\r\n onClick: () => {\r\n if (!target) {\r\n toggleMenu()\r\n }\r\n },\r\n }\r\n }}\r\n />\r\n <Menu\r\n ref={refs?.menu}\r\n target={target}\r\n placement=\"bottom-left\"\r\n {...slotProps?.menu}\r\n slotProps={{\r\n ...slotProps?.menu?.slotProps,\r\n content: {\r\n mt: .5,\r\n ...slotProps?.menu?.content,\r\n width: conRef && (conRef?.current as any)?.clientWidth,\r\n }\r\n }}\r\n onClickOutside={(e) => {\r\n if ((conRef.current as any).contains(e.target)) return;\r\n toggleMenu()\r\n }}\r\n >\r\n <List\r\n ref={refs?.list}\r\n {...slotProps?.list}\r\n color={color}\r\n variant={variant === \"outline\" ? \"fill\" : variant}\r\n >\r\n {childs}\r\n </List>\r\n </Menu>\r\n </>\r\n )\r\n})\r\n\r\nexport default Select"],"names":[],"mappings":";;;;;;;;;;;;;;AA8BA;;AAAiC;;;;;AAK7B;;;;;AAKQ;AAAc;;AAEV;;;;;;AAMH;AACL;;AAEI;AACA;;AAER;;AAGA;AAEA;AAuBgB;;AAMY;;AAER;AAEP;;;AAiBG;;AAcpB;;"}
|