@ioca/react 1.3.61 → 1.3.63
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/lib/cjs/components/affix/affix.js +3 -3
- package/lib/cjs/components/affix/affix.js.map +1 -1
- package/lib/cjs/components/affix/totop.js +3 -3
- package/lib/cjs/components/affix/totop.js.map +1 -1
- package/lib/cjs/components/badge/badge.js +3 -3
- package/lib/cjs/components/badge/badge.js.map +1 -1
- package/lib/cjs/components/button/button.js +3 -3
- package/lib/cjs/components/button/button.js.map +1 -1
- package/lib/cjs/components/button/group.js +3 -3
- package/lib/cjs/components/button/group.js.map +1 -1
- package/lib/cjs/components/button/toggle.js +3 -3
- package/lib/cjs/components/button/toggle.js.map +1 -1
- package/lib/cjs/components/card/card.js +3 -3
- package/lib/cjs/components/card/card.js.map +1 -1
- package/lib/cjs/components/checkbox/checkbox.js +4 -4
- package/lib/cjs/components/checkbox/checkbox.js.map +1 -1
- package/lib/cjs/components/checkbox/item.js +4 -4
- package/lib/cjs/components/checkbox/item.js.map +1 -1
- package/lib/cjs/components/collapse/collapse.js +4 -4
- package/lib/cjs/components/collapse/collapse.js.map +1 -1
- package/lib/cjs/components/datagrid/cell.js +4 -4
- package/lib/cjs/components/datagrid/cell.js.map +1 -1
- package/lib/cjs/components/datagrid/datagrid.js +4 -4
- package/lib/cjs/components/datagrid/datagrid.js.map +1 -1
- package/lib/cjs/components/datagrid/row.js +4 -4
- package/lib/cjs/components/datagrid/row.js.map +1 -1
- package/lib/cjs/components/datagrid/sorter.js +3 -3
- package/lib/cjs/components/datagrid/sorter.js.map +1 -1
- package/lib/cjs/components/description/description.js +4 -4
- package/lib/cjs/components/description/description.js.map +1 -1
- package/lib/cjs/components/drawer/drawer.js +4 -4
- package/lib/cjs/components/drawer/drawer.js.map +1 -1
- package/lib/cjs/components/editor/controls.js +2 -2
- package/lib/cjs/components/editor/controls.js.map +1 -1
- package/lib/cjs/components/editor/editor.js +6 -6
- package/lib/cjs/components/editor/editor.js.map +1 -1
- package/lib/cjs/components/flex/flex.js +3 -3
- package/lib/cjs/components/flex/flex.js.map +1 -1
- package/lib/cjs/components/form/field.js +7 -7
- package/lib/cjs/components/form/field.js.map +1 -1
- package/lib/cjs/components/form/form.js +6 -6
- package/lib/cjs/components/form/form.js.map +1 -1
- package/lib/cjs/components/form/useForm.js +9 -9
- package/lib/cjs/components/form/useForm.js.map +1 -1
- package/lib/cjs/components/icon/icon.js +3 -3
- package/lib/cjs/components/icon/icon.js.map +1 -1
- package/lib/cjs/components/image/image.js +4 -4
- package/lib/cjs/components/image/image.js.map +1 -1
- package/lib/cjs/components/input/container.js +4 -4
- package/lib/cjs/components/input/container.js.map +1 -1
- package/lib/cjs/components/input/input.js +4 -4
- package/lib/cjs/components/input/input.js.map +1 -1
- package/lib/cjs/components/input/number.js +3 -3
- package/lib/cjs/components/input/number.js.map +1 -1
- package/lib/cjs/components/input/range.js +3 -3
- package/lib/cjs/components/input/range.js.map +1 -1
- package/lib/cjs/components/input/textarea.js +3 -3
- package/lib/cjs/components/input/textarea.js.map +1 -1
- package/lib/cjs/components/list/item.js +3 -3
- package/lib/cjs/components/list/item.js.map +1 -1
- package/lib/cjs/components/list/list.js +3 -3
- package/lib/cjs/components/list/list.js.map +1 -1
- package/lib/cjs/components/loading/loading.js +3 -3
- package/lib/cjs/components/loading/loading.js.map +1 -1
- package/lib/cjs/components/message/message.js +3 -3
- package/lib/cjs/components/message/message.js.map +1 -1
- package/lib/cjs/components/modal/modal.js +4 -4
- package/lib/cjs/components/modal/modal.js.map +1 -1
- package/lib/cjs/components/pagination/page.js +3 -3
- package/lib/cjs/components/pagination/page.js.map +1 -1
- package/lib/cjs/components/pagination/pagination.js +3 -3
- package/lib/cjs/components/pagination/pagination.js.map +1 -1
- package/lib/cjs/components/picker/colors/handle.js +3 -3
- package/lib/cjs/components/picker/colors/handle.js.map +1 -1
- package/lib/cjs/components/picker/colors/index.js +4 -4
- package/lib/cjs/components/picker/colors/index.js.map +1 -1
- package/lib/cjs/components/picker/dates/dates.js +5 -5
- package/lib/cjs/components/picker/dates/dates.js.map +1 -1
- package/lib/cjs/components/picker/dates/index.js +6 -6
- package/lib/cjs/components/picker/dates/index.js.map +1 -1
- package/lib/cjs/components/picker/dates/panel.js +9 -9
- package/lib/cjs/components/picker/dates/panel.js.map +1 -1
- package/lib/cjs/components/picker/time/item.js +3 -3
- package/lib/cjs/components/picker/time/item.js.map +1 -1
- package/lib/cjs/components/popup/content.js +3 -3
- package/lib/cjs/components/popup/content.js.map +1 -1
- package/lib/cjs/components/progress/line.js +4 -4
- package/lib/cjs/components/progress/line.js.map +1 -1
- package/lib/cjs/components/progress/progress.js +3 -3
- package/lib/cjs/components/progress/progress.js.map +1 -1
- package/lib/cjs/components/radio/item.js +4 -4
- package/lib/cjs/components/radio/item.js.map +1 -1
- package/lib/cjs/components/radio/radio.js +4 -4
- package/lib/cjs/components/radio/radio.js.map +1 -1
- package/lib/cjs/components/resizable/resizable.js +4 -4
- package/lib/cjs/components/resizable/resizable.js.map +1 -1
- package/lib/cjs/components/select/options.js +3 -3
- package/lib/cjs/components/select/options.js.map +1 -1
- package/lib/cjs/components/select/select.js +5 -5
- package/lib/cjs/components/select/select.js.map +1 -1
- package/lib/cjs/components/step/item.js +3 -3
- package/lib/cjs/components/step/item.js.map +1 -1
- package/lib/cjs/components/step/step.js +3 -3
- package/lib/cjs/components/step/step.js.map +1 -1
- package/lib/cjs/components/swiper/item.js +3 -3
- package/lib/cjs/components/swiper/item.js.map +1 -1
- package/lib/cjs/components/swiper/swiper.js +6 -6
- package/lib/cjs/components/swiper/swiper.js.map +1 -1
- package/lib/cjs/components/tabs/tabs.js +8 -8
- package/lib/cjs/components/tabs/tabs.js.map +1 -1
- package/lib/cjs/components/tag/tag.js +4 -4
- package/lib/cjs/components/tag/tag.js.map +1 -1
- package/lib/cjs/components/text/text.js +3 -3
- package/lib/cjs/components/text/text.js.map +1 -1
- package/lib/cjs/components/tree/item.js +5 -5
- package/lib/cjs/components/tree/item.js.map +1 -1
- package/lib/cjs/components/upload/renderFile.js +3 -3
- package/lib/cjs/components/upload/renderFile.js.map +1 -1
- package/lib/cjs/components/upload/upload.js +3 -3
- package/lib/cjs/components/upload/upload.js.map +1 -1
- package/lib/cjs/components/utils/empty/index.js +3 -3
- package/lib/cjs/components/utils/empty/index.js.map +1 -1
- package/lib/cjs/components/utils/helpericon/helpericon.js +3 -3
- package/lib/cjs/components/utils/helpericon/helpericon.js.map +1 -1
- package/lib/cjs/components/video/video.js +3 -3
- package/lib/cjs/components/video/video.js.map +1 -1
- package/lib/cjs/js/usePreview/content.js +4 -4
- package/lib/cjs/js/usePreview/content.js.map +1 -1
- package/lib/cjs/js/utils.js +9 -0
- package/lib/cjs/js/utils.js.map +1 -1
- package/lib/css/index.css +1 -1
- package/lib/css/index.css.map +1 -1
- package/lib/es/components/editor/controls.js +1 -1
- package/lib/es/components/editor/controls.js.map +1 -1
- package/lib/es/js/utils.js +5 -1
- package/lib/es/js/utils.js.map +1 -1
- package/lib/index.js +4 -1
- package/package.json +1 -1
|
@@ -7,9 +7,9 @@ var classNames = require('classnames');
|
|
|
7
7
|
var react = require('react');
|
|
8
8
|
var loading = require('../loading/loading.js');
|
|
9
9
|
|
|
10
|
-
function
|
|
10
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
11
11
|
|
|
12
|
-
var classNames__default = /*#__PURE__*/
|
|
12
|
+
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
13
13
|
|
|
14
14
|
const Page = (props) => {
|
|
15
15
|
const { page, active, children, onChange } = props;
|
|
@@ -21,7 +21,7 @@ const Page = (props) => {
|
|
|
21
21
|
await onChange?.(page);
|
|
22
22
|
setLoading(false);
|
|
23
23
|
};
|
|
24
|
-
return (jsxRuntime.jsxs("a", { className: classNames__default
|
|
24
|
+
return (jsxRuntime.jsxs("a", { className: classNames__default("i-page", {
|
|
25
25
|
"i-page-active": active,
|
|
26
26
|
"i-page-loading": loading$1,
|
|
27
27
|
"i-page-disabled": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sources":["../../../../packages/components/pagination/page.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useState } from \"react\";\nimport Loading from \"../loading\";\nimport { IPageItem } from \"./type\";\n\nconst Page = (props: IPageItem) => {\n\tconst { page, active, children, onChange } = props;\n\tconst [loading, setLoading] = useState(false);\n\n\tconst handleClick = async () => {\n\t\tif (active || loading) return;\n\n\t\tsetLoading(true);\n\t\tawait onChange?.(page);\n\t\tsetLoading(false);\n\t};\n\n\treturn (\n\t\t<a\n\t\t\tclassName={classNames(\"i-page\", {\n\t\t\t\t\"i-page-active\": active,\n\t\t\t\t\"i-page-loading\": loading,\n\t\t\t\t\"i-page-disabled\": false,\n\t\t\t})}\n\t\t\tdata-page={page}\n\t\t\tonClick={handleClick}\n\t\t>\n\t\t\t{loading && <Loading />}\n\t\t\t{children}\n\t\t</a>\n\t);\n};\n\nexport default Page;\n"],"names":["loading","useState","_jsxs","classNames","_jsx","Loading"],"mappings":";;;;;;;;;;;;;AAKA,MAAM,IAAI,GAAG,CAAC,KAAgB,KAAI;IACjC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK;IAClD,MAAM,CAACA,SAAO,EAAE,UAAU,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;AAE7C,IAAA,MAAM,WAAW,GAAG,YAAW;QAC9B,IAAI,MAAM,IAAID,SAAO;YAAE;QAEvB,UAAU,CAAC,IAAI,CAAC;AAChB,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC;QACtB,UAAU,CAAC,KAAK,CAAC;AAClB,KAAC;AAED,IAAA,QACCE,eACC,CAAA,GAAA,EAAA,EAAA,SAAS,EAAEC,
|
|
1
|
+
{"version":3,"file":"page.js","sources":["../../../../packages/components/pagination/page.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useState } from \"react\";\nimport Loading from \"../loading\";\nimport { IPageItem } from \"./type\";\n\nconst Page = (props: IPageItem) => {\n\tconst { page, active, children, onChange } = props;\n\tconst [loading, setLoading] = useState(false);\n\n\tconst handleClick = async () => {\n\t\tif (active || loading) return;\n\n\t\tsetLoading(true);\n\t\tawait onChange?.(page);\n\t\tsetLoading(false);\n\t};\n\n\treturn (\n\t\t<a\n\t\t\tclassName={classNames(\"i-page\", {\n\t\t\t\t\"i-page-active\": active,\n\t\t\t\t\"i-page-loading\": loading,\n\t\t\t\t\"i-page-disabled\": false,\n\t\t\t})}\n\t\t\tdata-page={page}\n\t\t\tonClick={handleClick}\n\t\t>\n\t\t\t{loading && <Loading />}\n\t\t\t{children}\n\t\t</a>\n\t);\n};\n\nexport default Page;\n"],"names":["loading","useState","_jsxs","classNames","_jsx","Loading"],"mappings":";;;;;;;;;;;;;AAKA,MAAM,IAAI,GAAG,CAAC,KAAgB,KAAI;IACjC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK;IAClD,MAAM,CAACA,SAAO,EAAE,UAAU,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;AAE7C,IAAA,MAAM,WAAW,GAAG,YAAW;QAC9B,IAAI,MAAM,IAAID,SAAO;YAAE;QAEvB,UAAU,CAAC,IAAI,CAAC;AAChB,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC;QACtB,UAAU,CAAC,KAAK,CAAC;AAClB,KAAC;AAED,IAAA,QACCE,eACC,CAAA,GAAA,EAAA,EAAA,SAAS,EAAEC,mBAAU,CAAC,QAAQ,EAAE;AAC/B,YAAA,eAAe,EAAE,MAAM;AACvB,YAAA,gBAAgB,EAAEH,SAAO;AACzB,YAAA,iBAAiB,EAAE,KAAK;AACxB,SAAA,CAAC,eACS,IAAI,EACf,OAAO,EAAE,WAAW,EAEnB,QAAA,EAAA,CAAAA,SAAO,IAAII,cAAA,CAACC,eAAO,EAAG,EAAA,CAAA,EACtB,QAAQ,CAAA,EAAA,CACN;AAEN;;;;"}
|
|
@@ -9,9 +9,9 @@ var react = require('react');
|
|
|
9
9
|
var icon = require('../icon/icon.js');
|
|
10
10
|
var page = require('./page.js');
|
|
11
11
|
|
|
12
|
-
function
|
|
12
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
13
13
|
|
|
14
|
-
var classNames__default = /*#__PURE__*/
|
|
14
|
+
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
15
15
|
|
|
16
16
|
const Pagination = (props) => {
|
|
17
17
|
const { page: defaultPage = 1, size = 10, total = 0, sibling = 2, prev = jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.KeyboardArrowLeftRound, {}) }), next = jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.KeyboardArrowRightRound, {}) }), simple, jumper, className, renderEllipsis = () => (jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.MoreHorizRound, {}), className: 'color-7' })), renderPage = (i) => i, onChange, ...restProps } = props;
|
|
@@ -43,7 +43,7 @@ const Pagination = (props) => {
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
react.useEffect(() => setPage(defaultPage), [defaultPage]);
|
|
46
|
-
return (jsxRuntime.jsxs("div", { className: classNames__default
|
|
46
|
+
return (jsxRuntime.jsxs("div", { className: classNames__default("i-pagination", className), ...restProps, children: [prev && (jsxRuntime.jsx(page.default, { page: page$1 - 1 || 1, onChange: handlePageChange, children: prev })), start > 1 && (jsxRuntime.jsx(page.default, { page: 1, onChange: handlePageChange, children: renderPage(1) })), start > 2 && renderEllipsis(), loop.map((p) => {
|
|
47
47
|
return (jsxRuntime.jsx(page.default, { page: p, active: p === page$1, onChange: handlePageChange, children: renderPage(p) }, p));
|
|
48
48
|
}), end < totalPage - 1 && renderEllipsis(), end < totalPage && (jsxRuntime.jsx(page.default, { page: totalPage, onChange: handlePageChange, children: renderPage(totalPage) })), next && (jsxRuntime.jsx(page.default, { page: page$1 + 1, onChange: handlePageChange, children: next }))] }));
|
|
49
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sources":["../../../../packages/components/pagination/pagination.tsx"],"sourcesContent":["import {\n\tKeyboardArrowLeftRound,\n\tKeyboardArrowRightRound,\n\tMoreHorizRound,\n} from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport Icon from \"../icon\";\nimport \"./index.css\";\nimport Page from \"./page\";\nimport { IPagination } from \"./type\";\n\nconst Pagination = (props: IPagination) => {\n\tconst {\n\t\tpage: defaultPage = 1,\n\t\tsize = 10,\n\t\ttotal = 0,\n\t\tsibling = 2,\n\t\tprev = <Icon icon={<KeyboardArrowLeftRound />} />,\n\t\tnext = <Icon icon={<KeyboardArrowRightRound />} />,\n\t\tsimple,\n\t\tjumper,\n\t\tclassName,\n\t\trenderEllipsis = () => (\n\t\t\t<Icon icon={<MoreHorizRound />} className='color-7' />\n\t\t),\n\t\trenderPage = (i) => i,\n\t\tonChange,\n\t\t...restProps\n\t} = props;\n\n\tconst [page, setPage] = useState(defaultPage);\n\tconst [loading, setLoading] = useState(false);\n\n\tconst totalPage = useMemo(() => Math.ceil(total / size), [size, total]);\n\n\tconst [start, end, loop] = useMemo(() => {\n\t\tconst start = Math.max(1, page - sibling);\n\t\tconst end = Math.min(totalPage, page + sibling);\n\n\t\treturn [\n\t\t\tstart,\n\t\t\tend,\n\t\t\tArray.from({ length: end - start + 1 }).map((n, i) => start + i),\n\t\t];\n\t}, [page, totalPage, sibling]);\n\n\tif (totalPage <= page && page === 1) return <></>;\n\n\tconst handlePageChange = async (p?: number) => {\n\t\tif (!onChange || loading) return;\n\t\tsetLoading(true);\n\n\t\treturn new Promise<void>(async (resolve) => {\n\t\t\tif (p === undefined) return;\n\t\t\tawait onChange(p);\n\t\t\tsetPage(p);\n\t\t\tsetLoading(false);\n\t\t\tresolve();\n\t\t});\n\t};\n\n\tuseEffect(() => setPage(defaultPage), [defaultPage]);\n\n\treturn (\n\t\t<div className={classNames(\"i-pagination\", className)} {...restProps}>\n\t\t\t{prev && (\n\t\t\t\t<Page page={page - 1 || 1} onChange={handlePageChange}>\n\t\t\t\t\t{prev}\n\t\t\t\t</Page>\n\t\t\t)}\n\n\t\t\t{start > 1 && (\n\t\t\t\t<Page page={1} onChange={handlePageChange}>\n\t\t\t\t\t{renderPage(1)}\n\t\t\t\t</Page>\n\t\t\t)}\n\n\t\t\t{start > 2 && renderEllipsis()}\n\n\t\t\t{loop.map((p) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Page\n\t\t\t\t\t\tkey={p}\n\t\t\t\t\t\tpage={p}\n\t\t\t\t\t\tactive={p === page}\n\t\t\t\t\t\tonChange={handlePageChange}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderPage(p)}\n\t\t\t\t\t</Page>\n\t\t\t\t);\n\t\t\t})}\n\n\t\t\t{end < totalPage - 1 && renderEllipsis()}\n\n\t\t\t{end < totalPage && (\n\t\t\t\t<Page page={totalPage} onChange={handlePageChange}>\n\t\t\t\t\t{renderPage(totalPage)}\n\t\t\t\t</Page>\n\t\t\t)}\n\n\t\t\t{next && (\n\t\t\t\t<Page page={page + 1} onChange={handlePageChange}>\n\t\t\t\t\t{next}\n\t\t\t\t</Page>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Pagination;\n"],"names":["_jsx","Icon","KeyboardArrowLeftRound","KeyboardArrowRightRound","MoreHorizRound","page","useState","useMemo","useEffect","_jsxs","classNames","Page"],"mappings":";;;;;;;;;;;;;;;AAYA,MAAM,UAAU,GAAG,CAAC,KAAkB,KAAI;AACzC,IAAA,MAAM,EACL,IAAI,EAAE,WAAW,GAAG,CAAC,EACrB,IAAI,GAAG,EAAE,EACT,KAAK,GAAG,CAAC,EACT,OAAO,GAAG,CAAC,EACX,IAAI,GAAGA,cA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C,CAAC;AAE9B,IAAA,IAAI,SAAS,IAAIA,MAAI,IAAIA,MAAI,KAAK,CAAC;AAAE,QAAA,OAAOL,uCAAK;AAEjD,IAAA,MAAM,gBAAgB,GAAG,OAAO,CAAU,KAAI;QAC7C,IAAI,CAAC,QAAQ,IAAI,OAAO;YAAE;QAC1B,UAAU,CAAC,IAAI,CAAC;AAEhB,QAAA,OAAO,IAAI,OAAO,CAAO,OAAO,OAAO,KAAI;YAC1C,IAAI,CAAC,KAAK,SAAS;gBAAE;AACrB,YAAA,MAAM,QAAQ,CAAC,CAAC,CAAC;YACjB,OAAO,CAAC,CAAC,CAAC;YACV,UAAU,CAAC,KAAK,CAAC;AACjB,YAAA,OAAO,EAAE;AACV,SAAC,CAAC;AACH,KAAC;AAED,IAAAQ,eAAS,CAAC,MAAM,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;AAEpD,IAAA,QACCC,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,
|
|
1
|
+
{"version":3,"file":"pagination.js","sources":["../../../../packages/components/pagination/pagination.tsx"],"sourcesContent":["import {\n\tKeyboardArrowLeftRound,\n\tKeyboardArrowRightRound,\n\tMoreHorizRound,\n} from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport Icon from \"../icon\";\nimport \"./index.css\";\nimport Page from \"./page\";\nimport { IPagination } from \"./type\";\n\nconst Pagination = (props: IPagination) => {\n\tconst {\n\t\tpage: defaultPage = 1,\n\t\tsize = 10,\n\t\ttotal = 0,\n\t\tsibling = 2,\n\t\tprev = <Icon icon={<KeyboardArrowLeftRound />} />,\n\t\tnext = <Icon icon={<KeyboardArrowRightRound />} />,\n\t\tsimple,\n\t\tjumper,\n\t\tclassName,\n\t\trenderEllipsis = () => (\n\t\t\t<Icon icon={<MoreHorizRound />} className='color-7' />\n\t\t),\n\t\trenderPage = (i) => i,\n\t\tonChange,\n\t\t...restProps\n\t} = props;\n\n\tconst [page, setPage] = useState(defaultPage);\n\tconst [loading, setLoading] = useState(false);\n\n\tconst totalPage = useMemo(() => Math.ceil(total / size), [size, total]);\n\n\tconst [start, end, loop] = useMemo(() => {\n\t\tconst start = Math.max(1, page - sibling);\n\t\tconst end = Math.min(totalPage, page + sibling);\n\n\t\treturn [\n\t\t\tstart,\n\t\t\tend,\n\t\t\tArray.from({ length: end - start + 1 }).map((n, i) => start + i),\n\t\t];\n\t}, [page, totalPage, sibling]);\n\n\tif (totalPage <= page && page === 1) return <></>;\n\n\tconst handlePageChange = async (p?: number) => {\n\t\tif (!onChange || loading) return;\n\t\tsetLoading(true);\n\n\t\treturn new Promise<void>(async (resolve) => {\n\t\t\tif (p === undefined) return;\n\t\t\tawait onChange(p);\n\t\t\tsetPage(p);\n\t\t\tsetLoading(false);\n\t\t\tresolve();\n\t\t});\n\t};\n\n\tuseEffect(() => setPage(defaultPage), [defaultPage]);\n\n\treturn (\n\t\t<div className={classNames(\"i-pagination\", className)} {...restProps}>\n\t\t\t{prev && (\n\t\t\t\t<Page page={page - 1 || 1} onChange={handlePageChange}>\n\t\t\t\t\t{prev}\n\t\t\t\t</Page>\n\t\t\t)}\n\n\t\t\t{start > 1 && (\n\t\t\t\t<Page page={1} onChange={handlePageChange}>\n\t\t\t\t\t{renderPage(1)}\n\t\t\t\t</Page>\n\t\t\t)}\n\n\t\t\t{start > 2 && renderEllipsis()}\n\n\t\t\t{loop.map((p) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Page\n\t\t\t\t\t\tkey={p}\n\t\t\t\t\t\tpage={p}\n\t\t\t\t\t\tactive={p === page}\n\t\t\t\t\t\tonChange={handlePageChange}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderPage(p)}\n\t\t\t\t\t</Page>\n\t\t\t\t);\n\t\t\t})}\n\n\t\t\t{end < totalPage - 1 && renderEllipsis()}\n\n\t\t\t{end < totalPage && (\n\t\t\t\t<Page page={totalPage} onChange={handlePageChange}>\n\t\t\t\t\t{renderPage(totalPage)}\n\t\t\t\t</Page>\n\t\t\t)}\n\n\t\t\t{next && (\n\t\t\t\t<Page page={page + 1} onChange={handlePageChange}>\n\t\t\t\t\t{next}\n\t\t\t\t</Page>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Pagination;\n"],"names":["_jsx","Icon","KeyboardArrowLeftRound","KeyboardArrowRightRound","MoreHorizRound","page","useState","useMemo","useEffect","_jsxs","classNames","Page"],"mappings":";;;;;;;;;;;;;;;AAYA,MAAM,UAAU,GAAG,CAAC,KAAkB,KAAI;AACzC,IAAA,MAAM,EACL,IAAI,EAAE,WAAW,GAAG,CAAC,EACrB,IAAI,GAAG,EAAE,EACT,KAAK,GAAG,CAAC,EACT,OAAO,GAAG,CAAC,EACX,IAAI,GAAGA,cAAA,CAACC,YAAI,EAAC,EAAA,IAAI,EAAED,cAAC,CAAAE,+BAAsB,KAAG,EAAI,CAAA,EACjD,IAAI,GAAGF,cAAA,CAACC,YAAI,EAAC,EAAA,IAAI,EAAED,cAAC,CAAAG,gCAAuB,KAAG,EAAI,CAAA,EAClD,MAAM,EACN,MAAM,EACN,SAAS,EACT,cAAc,GAAG,OAChBH,cAAA,CAACC,YAAI,EAAC,EAAA,IAAI,EAAED,cAAC,CAAAI,uBAAc,KAAG,EAAE,SAAS,EAAC,SAAS,GAAG,CACtD,EACD,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,EACrB,QAAQ,EACR,GAAG,SAAS,EACZ,GAAG,KAAK;IAET,MAAM,CAACC,MAAI,EAAE,OAAO,CAAC,GAAGC,cAAQ,CAAC,WAAW,CAAC;IAC7C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;IAE7C,MAAM,SAAS,GAAGC,aAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAEvE,MAAM,CAAC,KAAK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AC,IAAI,EAAEN,MAAI,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAA,QAAA,EACnD,IAAI,EAAA,CACC,CACP,EAEA,KAAK,GAAG,CAAC,KACTL,cAAC,CAAAW,YAAI,IAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EACvC,QAAA,EAAA,UAAU,CAAC,CAAC,CAAC,EACR,CAAA,CACP,EAEA,KAAK,GAAG,CAAC,IAAI,cAAc,EAAE,EAE7B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAI;gBACf,QACCX,cAAC,CAAAW,YAAI,EAEJ,EAAA,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,KAAKN,MAAI,EAClB,QAAQ,EAAE,gBAAgB,EAAA,QAAA,EAEzB,UAAU,CAAC,CAAC,CAAC,EALT,EAAA,CAAC,CAMA;aAER,CAAC,EAED,GAAG,GAAG,SAAS,GAAG,CAAC,IAAI,cAAc,EAAE,EAEvC,GAAG,GAAG,SAAS,KACfL,cAAA,CAACW,YAAI,EAAA,EAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAA,QAAA,EAC/C,UAAU,CAAC,SAAS,CAAC,EAAA,CAChB,CACP,EAEA,IAAI,KACJX,cAAA,CAACW,YAAI,EAAA,EAAC,IAAI,EAAEN,MAAI,GAAG,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAC9C,QAAA,EAAA,IAAI,EACC,CAAA,CACP,CACI,EAAA,CAAA;AAER;;;;"}
|
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var classNames = require('classnames');
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
9
9
|
|
|
10
|
-
var classNames__default = /*#__PURE__*/
|
|
10
|
+
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
11
11
|
|
|
12
12
|
const Handle = (props) => {
|
|
13
13
|
const { ref, color, handle, placeholder, className, ...restProps } = props;
|
|
14
|
-
return (jsxRuntime.jsxs("div", { ref: ref, className: classNames__default
|
|
14
|
+
return (jsxRuntime.jsxs("div", { ref: ref, className: classNames__default("i-colorpicker-handle", className), ...restProps, children: [handle !== "text" && (jsxRuntime.jsx("i", { className: 'i-colorpicker-square', style: { background: color } })), handle !== "square" && (jsxRuntime.jsx("span", { className: 'i-colorpicker-text', style: { color }, children: color ?? placeholder }))] }));
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
exports.default = Handle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.js","sources":["../../../../../packages/components/picker/colors/handle.tsx"],"sourcesContent":["import classNames from \"classnames\";\n\nconst Handle = (props) => {\n\tconst { ref, color, handle, placeholder, className, ...restProps } = props;\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-colorpicker-handle\", className)}\n\t\t\t{...restProps}\n\t\t>\n\t\t\t{handle !== \"text\" && (\n\t\t\t\t<i\n\t\t\t\t\tclassName='i-colorpicker-square'\n\t\t\t\t\tstyle={{ background: color }}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{handle !== \"square\" && (\n\t\t\t\t<span className='i-colorpicker-text' style={{ color }}>\n\t\t\t\t\t{color ?? placeholder}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Handle;\n"],"names":["_jsxs","classNames","_jsx"],"mappings":";;;;;;;;;;;AAEA,MAAM,MAAM,GAAG,CAAC,KAAK,KAAI;AACxB,IAAA,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AAE1E,IAAA,QACCA,eAAA,CAAA,KAAA,EAAA,EACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAEC,
|
|
1
|
+
{"version":3,"file":"handle.js","sources":["../../../../../packages/components/picker/colors/handle.tsx"],"sourcesContent":["import classNames from \"classnames\";\n\nconst Handle = (props) => {\n\tconst { ref, color, handle, placeholder, className, ...restProps } = props;\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-colorpicker-handle\", className)}\n\t\t\t{...restProps}\n\t\t>\n\t\t\t{handle !== \"text\" && (\n\t\t\t\t<i\n\t\t\t\t\tclassName='i-colorpicker-square'\n\t\t\t\t\tstyle={{ background: color }}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{handle !== \"square\" && (\n\t\t\t\t<span className='i-colorpicker-text' style={{ color }}>\n\t\t\t\t\t{color ?? placeholder}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Handle;\n"],"names":["_jsxs","classNames","_jsx"],"mappings":";;;;;;;;;;;AAEA,MAAM,MAAM,GAAG,CAAC,KAAK,KAAI;AACxB,IAAA,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AAE1E,IAAA,QACCA,eAAA,CAAA,KAAA,EAAA,EACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAEC,mBAAU,CAAC,sBAAsB,EAAE,SAAS,CAAC,EACpD,GAAA,SAAS,EAEZ,QAAA,EAAA,CAAA,MAAM,KAAK,MAAM,KACjBC,cACC,CAAA,GAAA,EAAA,EAAA,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAC3B,CAAA,CACF,EAEA,MAAM,KAAK,QAAQ,KACnBA,cAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EACnD,QAAA,EAAA,KAAK,IAAI,WAAW,EACf,CAAA,CACP,CACI,EAAA,CAAA;AAER;;;;"}
|
|
@@ -10,9 +10,9 @@ var popup = require('../../popup/popup.js');
|
|
|
10
10
|
var footer = require('./footer.js');
|
|
11
11
|
var handle = require('./handle.js');
|
|
12
12
|
|
|
13
|
-
function
|
|
13
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
14
14
|
|
|
15
|
-
var ColorsPanel__default = /*#__PURE__*/
|
|
15
|
+
var ColorsPanel__default = /*#__PURE__*/_interopDefaultCompat(ColorsPanel);
|
|
16
16
|
|
|
17
17
|
function ColorPicker(props) {
|
|
18
18
|
const { value, type = "HEX", disabledAlpha, children, usePanel, handle: handle$1 = "both", placeholder = "Colors", popupProps, onChange, } = props;
|
|
@@ -54,9 +54,9 @@ function ColorPicker(props) {
|
|
|
54
54
|
state.value = value;
|
|
55
55
|
}, [value]);
|
|
56
56
|
if (usePanel) {
|
|
57
|
-
return jsxRuntime.jsx(ColorsPanel__default
|
|
57
|
+
return jsxRuntime.jsx(ColorsPanel__default, { ...props });
|
|
58
58
|
}
|
|
59
|
-
return (jsxRuntime.jsx(popup.default, { trigger: 'click', touchable: true, position: 'bottom', ...popupProps, visible: state.visible, content: jsxRuntime.jsx(ColorsPanel__default
|
|
59
|
+
return (jsxRuntime.jsx(popup.default, { trigger: 'click', touchable: true, position: 'bottom', ...popupProps, visible: state.visible, content: jsxRuntime.jsx(ColorsPanel__default, { value: state.syncValue, disabledAlpha: disabledAlpha, panelRender: (panel) => {
|
|
60
60
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [panel, jsxRuntime.jsx(footer.default, { value: state.value, type: state.type, onTypeChange: handleTypeChange, onChange: handleValueChange, onOk: handleOk })] }));
|
|
61
61
|
}, onChange: handleChange, onChangeComplete: handleComplete }), onVisibleChange: handleVisibleChange, children: children ?? (jsxRuntime.jsx(handle.default, { color: value, handle: handle$1, placeholder: placeholder })) }));
|
|
62
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/components/picker/colors/index.tsx"],"sourcesContent":["import ColorsPanel from \"@rc-component/color-picker\";\nimport { useReactive } from \"ahooks\";\nimport { useEffect } from \"react\";\nimport Popup from \"../../popup\";\nimport { IColorPicker } from \"../type\";\nimport Footer, { ColorMethods } from \"./footer\";\nimport Handle from \"./handle\";\nimport \"./index.css\";\n\nexport default function ColorPicker(props: IColorPicker) {\n\tconst {\n\t\tvalue,\n\t\ttype = \"HEX\",\n\t\tdisabledAlpha,\n\t\tchildren,\n\t\tusePanel,\n\t\thandle = \"both\",\n\t\tplaceholder = \"Colors\",\n\t\tpopupProps,\n\t\tonChange,\n\t} = props;\n\n\tconst state = useReactive({\n\t\ttype,\n\t\tvalue,\n\t\tsyncValue: value,\n\t\tvisible: popupProps?.visible,\n\t});\n\n\tconst handleChange = (target) => {\n\t\tstate.syncValue = target;\n\t};\n\n\tconst handleComplete = (target) => {\n\t\tconst method = ColorMethods[state.type];\n\n\t\tif (target.a !== 1) {\n\t\t\ttarget.a = parseFloat(target.a.toFixed(3));\n\t\t}\n\n\t\tstate.value = target[method]?.();\n\t};\n\n\tconst handleVisibleChange = (v: boolean) => {\n\t\tstate.visible = v;\n\t\tpopupProps?.onVisibleChange?.(v);\n\t};\n\n\tconst handleTypeChange = (t) => {\n\t\tconst method = ColorMethods[t];\n\n\t\tstate.type = t;\n\t\tstate.value = state.syncValue[method]?.();\n\t};\n\n\tconst handleValueChange = (v) => {\n\t\tstate.value = v;\n\t\tstate.syncValue = v;\n\t};\n\n\tconst handleOk = () => {\n\t\tonChange?.(state.value);\n\t\tstate.visible = false;\n\t};\n\n\tuseEffect(() => {\n\t\tstate.syncValue = value;\n\t\tstate.value = value;\n\t}, [value]);\n\n\tif (usePanel) {\n\t\treturn <ColorsPanel {...props} />;\n\t}\n\n\treturn (\n\t\t<Popup\n\t\t\ttrigger='click'\n\t\t\ttouchable\n\t\t\tposition='bottom'\n\t\t\t{...popupProps}\n\t\t\tvisible={state.visible}\n\t\t\tcontent={\n\t\t\t\t<ColorsPanel\n\t\t\t\t\tvalue={state.syncValue}\n\t\t\t\t\tdisabledAlpha={disabledAlpha}\n\t\t\t\t\tpanelRender={(panel) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{panel}\n\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\tvalue={state.value}\n\t\t\t\t\t\t\t\t\ttype={state.type}\n\t\t\t\t\t\t\t\t\tonTypeChange={handleTypeChange}\n\t\t\t\t\t\t\t\t\tonChange={handleValueChange}\n\t\t\t\t\t\t\t\t\tonOk={handleOk}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonChangeComplete={handleComplete}\n\t\t\t\t/>\n\t\t\t}\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t>\n\t\t\t{children ?? (\n\t\t\t\t<Handle\n\t\t\t\t\tcolor={value}\n\t\t\t\t\thandle={handle}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</Popup>\n\t);\n}\n"],"names":["handle","useReactive","ColorMethods","useEffect","_jsx","ColorsPanel","Popup","_jsxs","_Fragment","Footer","Handle"],"mappings":";;;;;;;;;;;;;;;;AASwB,SAAA,WAAW,CAAC,KAAmB,EAAA;IACtD,MAAM,EACL,KAAK,EACL,IAAI,GAAG,KAAK,EACZ,aAAa,EACb,QAAQ,EACR,QAAQ,UACRA,QAAM,GAAG,MAAM,EACf,WAAW,GAAG,QAAQ,EACtB,UAAU,EACV,QAAQ,GACR,GAAG,KAAK;IAET,MAAM,KAAK,GAAGC,kBAAW,CAAC;QACzB,IAAI;QACJ,KAAK;AACL,QAAA,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,UAAU,EAAE,OAAO;AAC5B,KAAA,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KAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAEX,IAAI,QAAQ,EAAE;AACb,QAAA,OAAOC,cAAC,CAAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/components/picker/colors/index.tsx"],"sourcesContent":["import ColorsPanel from \"@rc-component/color-picker\";\nimport { useReactive } from \"ahooks\";\nimport { useEffect } from \"react\";\nimport Popup from \"../../popup\";\nimport { IColorPicker } from \"../type\";\nimport Footer, { ColorMethods } from \"./footer\";\nimport Handle from \"./handle\";\nimport \"./index.css\";\n\nexport default function ColorPicker(props: IColorPicker) {\n\tconst {\n\t\tvalue,\n\t\ttype = \"HEX\",\n\t\tdisabledAlpha,\n\t\tchildren,\n\t\tusePanel,\n\t\thandle = \"both\",\n\t\tplaceholder = \"Colors\",\n\t\tpopupProps,\n\t\tonChange,\n\t} = props;\n\n\tconst state = useReactive({\n\t\ttype,\n\t\tvalue,\n\t\tsyncValue: value,\n\t\tvisible: popupProps?.visible,\n\t});\n\n\tconst handleChange = (target) => {\n\t\tstate.syncValue = target;\n\t};\n\n\tconst handleComplete = (target) => {\n\t\tconst method = ColorMethods[state.type];\n\n\t\tif (target.a !== 1) {\n\t\t\ttarget.a = parseFloat(target.a.toFixed(3));\n\t\t}\n\n\t\tstate.value = target[method]?.();\n\t};\n\n\tconst handleVisibleChange = (v: boolean) => {\n\t\tstate.visible = v;\n\t\tpopupProps?.onVisibleChange?.(v);\n\t};\n\n\tconst handleTypeChange = (t) => {\n\t\tconst method = ColorMethods[t];\n\n\t\tstate.type = t;\n\t\tstate.value = state.syncValue[method]?.();\n\t};\n\n\tconst handleValueChange = (v) => {\n\t\tstate.value = v;\n\t\tstate.syncValue = v;\n\t};\n\n\tconst handleOk = () => {\n\t\tonChange?.(state.value);\n\t\tstate.visible = false;\n\t};\n\n\tuseEffect(() => {\n\t\tstate.syncValue = value;\n\t\tstate.value = value;\n\t}, [value]);\n\n\tif (usePanel) {\n\t\treturn <ColorsPanel {...props} />;\n\t}\n\n\treturn (\n\t\t<Popup\n\t\t\ttrigger='click'\n\t\t\ttouchable\n\t\t\tposition='bottom'\n\t\t\t{...popupProps}\n\t\t\tvisible={state.visible}\n\t\t\tcontent={\n\t\t\t\t<ColorsPanel\n\t\t\t\t\tvalue={state.syncValue}\n\t\t\t\t\tdisabledAlpha={disabledAlpha}\n\t\t\t\t\tpanelRender={(panel) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{panel}\n\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\tvalue={state.value}\n\t\t\t\t\t\t\t\t\ttype={state.type}\n\t\t\t\t\t\t\t\t\tonTypeChange={handleTypeChange}\n\t\t\t\t\t\t\t\t\tonChange={handleValueChange}\n\t\t\t\t\t\t\t\t\tonOk={handleOk}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonChangeComplete={handleComplete}\n\t\t\t\t/>\n\t\t\t}\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t>\n\t\t\t{children ?? (\n\t\t\t\t<Handle\n\t\t\t\t\tcolor={value}\n\t\t\t\t\thandle={handle}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</Popup>\n\t);\n}\n"],"names":["handle","useReactive","ColorMethods","useEffect","_jsx","ColorsPanel","Popup","_jsxs","_Fragment","Footer","Handle"],"mappings":";;;;;;;;;;;;;;;;AASwB,SAAA,WAAW,CAAC,KAAmB,EAAA;IACtD,MAAM,EACL,KAAK,EACL,IAAI,GAAG,KAAK,EACZ,aAAa,EACb,QAAQ,EACR,QAAQ,UACRA,QAAM,GAAG,MAAM,EACf,WAAW,GAAG,QAAQ,EACtB,UAAU,EACV,QAAQ,GACR,GAAG,KAAK;IAET,MAAM,KAAK,GAAGC,kBAAW,CAAC;QACzB,IAAI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K;AACd,QAAA,KAAK,CAAC,SAAS,GAAG,KAAK;AACvB,QAAA,KAAK,CAAC,KAAK,GAAG,KAAK;AACpB,KAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAEX,IAAI,QAAQ,EAAE;AACb,QAAA,OAAOC,cAAC,CAAAC,oBAAW,EAAK,EAAA,GAAA,KAAK,GAAI;;AAGlC,IAAA,QACCD,cAAC,CAAAE,aAAK,IACL,OAAO,EAAC,OAAO,EACf,SAAS,QACT,QAAQ,EAAC,QAAQ,EACb,GAAA,UAAU,EACd,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EACNF,cAAC,CAAAC,oBAAW,IACX,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,CAAC,KAAK,KAAI;AACtB,gBAAA,QACCE,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA,CACE,KAAK,EACNJ,eAACK,cAAM,EAAA,EACN,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,QAAQ,EACb,CAAA,CAAA,EAAA,CACA;AAEL,aAAC,EACD,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAAE,cAAc,EAAA,CAC/B,EAEH,eAAe,EAAE,mBAAmB,EAAA,QAAA,EAEnC,QAAQ,KACRL,cAAC,CAAAM,cAAM,IACN,KAAK,EAAE,KAAK,EACZ,MAAM,EAAEV,QAAM,EACd,WAAW,EAAE,WAAW,EAAA,CACvB,CACF,EAAA,CACM;AAEV;;;;"}
|
|
@@ -7,14 +7,14 @@ var classNames = require('classnames');
|
|
|
7
7
|
var dayjs = require('dayjs');
|
|
8
8
|
var react = require('react');
|
|
9
9
|
|
|
10
|
-
function
|
|
10
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
11
11
|
|
|
12
|
-
var classNames__default = /*#__PURE__*/
|
|
13
|
-
var dayjs__default = /*#__PURE__*/
|
|
12
|
+
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
13
|
+
var dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs);
|
|
14
14
|
|
|
15
15
|
const Dates = (props) => {
|
|
16
16
|
const { value, month, weeks = ["一", "二", "三", "四", "五", "六", "日"], renderDate = (date) => date.date(), disabledDate, onDateClick, } = props;
|
|
17
|
-
const today = dayjs__default
|
|
17
|
+
const today = dayjs__default();
|
|
18
18
|
const dates = react.useMemo(() => {
|
|
19
19
|
const dates = [];
|
|
20
20
|
const lastDateOfLastMonth = month.add(-1, "month").endOf("month");
|
|
@@ -42,7 +42,7 @@ const Dates = (props) => {
|
|
|
42
42
|
const isSameMonth = date.isSame(month, "month");
|
|
43
43
|
const isToday = date.isSame(today, "day");
|
|
44
44
|
const disabled = disabledDate?.(date);
|
|
45
|
-
return (jsxRuntime.jsx("div", { className: classNames__default
|
|
45
|
+
return (jsxRuntime.jsx("div", { className: classNames__default("i-datepicker-item", {
|
|
46
46
|
"i-datepicker-active": active,
|
|
47
47
|
"i-datepicker-same-month": isSameMonth,
|
|
48
48
|
"i-datepicker-today": isToday,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dates.js","sources":["../../../../../packages/components/picker/dates/dates.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport { ReactNode, useMemo } from \"react\";\nimport { IBaseDates } from \"../type\";\n\nconst Dates = (\n\tprops: IBaseDates & {\n\t\tmonth: any;\n\t}\n) => {\n\tconst {\n\t\tvalue,\n\t\tmonth,\n\t\tweeks = [\"一\", \"二\", \"三\", \"四\", \"五\", \"六\", \"日\"],\n\t\trenderDate = (date: Dayjs) => date.date(),\n\t\tdisabledDate,\n\t\tonDateClick,\n\t} = props;\n\tconst today = dayjs();\n\n\tconst dates = useMemo(() => {\n\t\tconst dates: Dayjs[] = [];\n\n\t\tconst lastDateOfLastMonth = month.add(-1, \"month\").endOf(\"month\");\n\t\tlet { $W, $D } = lastDateOfLastMonth;\n\n\t\tif ($W !== 0) {\n\t\t\tconst lastMonthDates = Array.from({ length: $W }).map(\n\t\t\t\t(whatever, i) => lastDateOfLastMonth.add(i + 1 - $W, \"day\")\n\t\t\t);\n\t\t\tdates.push(...lastMonthDates);\n\t\t}\n\n\t\tconst lastDate = month.endOf(\"month\");\n\t\t$D = lastDate.$D;\n\t\t$W = lastDate.$W;\n\t\tdates.push(\n\t\t\t...Array.from({ length: $D }).map((whatever, i) =>\n\t\t\t\tlastDate.add(i + 1 - $D, \"day\")\n\t\t\t)\n\t\t);\n\n\t\tif ($W !== 0) {\n\t\t\tdates.push(\n\t\t\t\t...Array.from({ length: 7 - $W }).map((whatever, i) =>\n\t\t\t\t\tlastDate.add(i + 1, \"day\")\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn dates;\n\t}, [month]);\n\n\tconst handleDateClick = (date: Dayjs) => {\n\t\tif (disabledDate?.(date)) return;\n\n\t\tonDateClick?.(date);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<div className='i-datepicker-weeks'>\n\t\t\t\t{weeks.map((week: ReactNode, i: number) => (\n\t\t\t\t\t<span key={i} className='i-datepicker-week'>\n\t\t\t\t\t\t{week}\n\t\t\t\t\t</span>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t\t<div className='i-datepicker-dates'>\n\t\t\t\t{dates.map((date, i: number) => {\n\t\t\t\t\tconst active = date.isSame(value, \"day\");\n\t\t\t\t\tconst isSameMonth = date.isSame(month, \"month\");\n\t\t\t\t\tconst isToday = date.isSame(today, \"day\");\n\t\t\t\t\tconst disabled = disabledDate?.(date);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-item\", {\n\t\t\t\t\t\t\t\t\"i-datepicker-active\": active,\n\t\t\t\t\t\t\t\t\"i-datepicker-same-month\": isSameMonth,\n\t\t\t\t\t\t\t\t\"i-datepicker-today\": isToday,\n\t\t\t\t\t\t\t\t\"i-datepicker-disabled\": disabled,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() => handleDateClick(date)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderDate(date)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Dates;\n"],"names":["dayjs","useMemo","_jsxs","_jsx","classNames"],"mappings":";;;;;;;;;;;;;;AAKA,MAAM,KAAK,GAAG,CACb,KAEC,KACE;AACH,IAAA,MAAM,EACL,KAAK,EACL,KAAK,EACL,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAC3C,UAAU,GAAG,CAAC,IAAW,KAAK,IAAI,CAAC,IAAI,EAAE,EACzC,YAAY,EACZ,WAAW,GACX,GAAG,KAAK;AACT,IAAA,MAAM,KAAK,GAAGA,
|
|
1
|
+
{"version":3,"file":"dates.js","sources":["../../../../../packages/components/picker/dates/dates.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport { ReactNode, useMemo } from \"react\";\nimport { IBaseDates } from \"../type\";\n\nconst Dates = (\n\tprops: IBaseDates & {\n\t\tmonth: any;\n\t}\n) => {\n\tconst {\n\t\tvalue,\n\t\tmonth,\n\t\tweeks = [\"一\", \"二\", \"三\", \"四\", \"五\", \"六\", \"日\"],\n\t\trenderDate = (date: Dayjs) => date.date(),\n\t\tdisabledDate,\n\t\tonDateClick,\n\t} = props;\n\tconst today = dayjs();\n\n\tconst dates = useMemo(() => {\n\t\tconst dates: Dayjs[] = [];\n\n\t\tconst lastDateOfLastMonth = month.add(-1, \"month\").endOf(\"month\");\n\t\tlet { $W, $D } = lastDateOfLastMonth;\n\n\t\tif ($W !== 0) {\n\t\t\tconst lastMonthDates = Array.from({ length: $W }).map(\n\t\t\t\t(whatever, i) => lastDateOfLastMonth.add(i + 1 - $W, \"day\")\n\t\t\t);\n\t\t\tdates.push(...lastMonthDates);\n\t\t}\n\n\t\tconst lastDate = month.endOf(\"month\");\n\t\t$D = lastDate.$D;\n\t\t$W = lastDate.$W;\n\t\tdates.push(\n\t\t\t...Array.from({ length: $D }).map((whatever, i) =>\n\t\t\t\tlastDate.add(i + 1 - $D, \"day\")\n\t\t\t)\n\t\t);\n\n\t\tif ($W !== 0) {\n\t\t\tdates.push(\n\t\t\t\t...Array.from({ length: 7 - $W }).map((whatever, i) =>\n\t\t\t\t\tlastDate.add(i + 1, \"day\")\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn dates;\n\t}, [month]);\n\n\tconst handleDateClick = (date: Dayjs) => {\n\t\tif (disabledDate?.(date)) return;\n\n\t\tonDateClick?.(date);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<div className='i-datepicker-weeks'>\n\t\t\t\t{weeks.map((week: ReactNode, i: number) => (\n\t\t\t\t\t<span key={i} className='i-datepicker-week'>\n\t\t\t\t\t\t{week}\n\t\t\t\t\t</span>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t\t<div className='i-datepicker-dates'>\n\t\t\t\t{dates.map((date, i: number) => {\n\t\t\t\t\tconst active = date.isSame(value, \"day\");\n\t\t\t\t\tconst isSameMonth = date.isSame(month, \"month\");\n\t\t\t\t\tconst isToday = date.isSame(today, \"day\");\n\t\t\t\t\tconst disabled = disabledDate?.(date);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-item\", {\n\t\t\t\t\t\t\t\t\"i-datepicker-active\": active,\n\t\t\t\t\t\t\t\t\"i-datepicker-same-month\": isSameMonth,\n\t\t\t\t\t\t\t\t\"i-datepicker-today\": isToday,\n\t\t\t\t\t\t\t\t\"i-datepicker-disabled\": disabled,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() => handleDateClick(date)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderDate(date)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Dates;\n"],"names":["dayjs","useMemo","_jsxs","_jsx","classNames"],"mappings":";;;;;;;;;;;;;;AAKA,MAAM,KAAK,GAAG,CACb,KAEC,KACE;AACH,IAAA,MAAM,EACL,KAAK,EACL,KAAK,EACL,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAC3C,UAAU,GAAG,CAAC,IAAW,KAAK,IAAI,CAAC,IAAI,EAAE,EACzC,YAAY,EACZ,WAAW,GACX,GAAG,KAAK;AACT,IAAA,MAAM,KAAK,GAAGA,cAAK,EAAE;AAErB,IAAA,MAAM,KAAK,GAAGC,aAAO,CAAC,MAAK;QAC1B,MAAM,KAAK,GAAY,EAAE;AAEzB,QAAA,MAAM,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;AACjE,QAAA,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,mBAAmB;AAEpC,QAAA,IAAI,EAAE,KAAK,CAAC,EAAE;AACb,YAAA,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,CACpD,CAAC,QAAQ,EAAE,CAAC,KAAK,mBAAmB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAC3D;AACD,YAAA,KAAK,CAAC,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AC,IAAI,EAAE,CAAS,KAAI;oBAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;oBACxC,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;oBAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;AACzC,oBAAA,MAAM,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC;AAErC,oBAAA,QACCA,cAEC,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEC,mBAAU,CAAC,mBAAmB,EAAE;AAC1C,4BAAA,qBAAqB,EAAE,MAAM;AAC7B,4BAAA,yBAAyB,EAAE,WAAW;AACtC,4BAAA,oBAAoB,EAAE,OAAO;AAC7B,4BAAA,uBAAuB,EAAE,QAAQ;AACjC,yBAAA,CAAC,EACF,OAAO,EAAE,MAAM,eAAe,CAAC,IAAI,CAAC,EAEnC,QAAA,EAAA,UAAU,CAAC,IAAI,CAAC,IATZ,CAAC,CAUD;AAER,iBAAC,CAAC,EAAA,CACG,CACJ,EAAA,CAAA;AAEL;;;;"}
|
|
@@ -14,12 +14,12 @@ var popup = require('../../popup/popup.js');
|
|
|
14
14
|
var panel = require('./panel.js');
|
|
15
15
|
var input = require('../../input/input.js');
|
|
16
16
|
|
|
17
|
-
function
|
|
17
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
18
18
|
|
|
19
|
-
var dayjs__default = /*#__PURE__*/
|
|
20
|
-
var customParseFormat__default = /*#__PURE__*/
|
|
19
|
+
var dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs);
|
|
20
|
+
var customParseFormat__default = /*#__PURE__*/_interopDefaultCompat(customParseFormat);
|
|
21
21
|
|
|
22
|
-
dayjs__default.
|
|
22
|
+
dayjs__default.extend(customParseFormat__default);
|
|
23
23
|
const FORMATTYPES = ["YYYY-MM-DD", "YYYY-M-D", "YYYY/MM/DD", "YYYY/M/D"];
|
|
24
24
|
const FORMAT = "YYYY-MM-DD";
|
|
25
25
|
const Datepicker = (props) => {
|
|
@@ -31,7 +31,7 @@ const Datepicker = (props) => {
|
|
|
31
31
|
const dayJsValue = react.useMemo(() => {
|
|
32
32
|
if (!state.value)
|
|
33
33
|
return null;
|
|
34
|
-
const date = dayjs__default
|
|
34
|
+
const date = dayjs__default(state.value, format, true);
|
|
35
35
|
if (date.isValid())
|
|
36
36
|
return date;
|
|
37
37
|
return null;
|
|
@@ -46,7 +46,7 @@ const Datepicker = (props) => {
|
|
|
46
46
|
const handleSetDate = () => {
|
|
47
47
|
if (!state.value)
|
|
48
48
|
return;
|
|
49
|
-
const date = dayjs__default
|
|
49
|
+
const date = dayjs__default(state.value, FORMATTYPES, true);
|
|
50
50
|
if (date.isValid()) {
|
|
51
51
|
handleChange(date.format(format));
|
|
52
52
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/components/picker/dates/index.tsx"],"sourcesContent":["import { CalendarMonthTwotone } from \"@ricons/material\";\nimport { useReactive } from \"ahooks\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Popup from \"../../popup\";\nimport { IDatePicker } from \"../type\";\nimport \"./index.css\";\nimport Panel from \"./panel\";\n\ndayjs.extend(customParseFormat);\n\nconst FORMATTYPES = [\"YYYY-MM-DD\", \"YYYY-M-D\", \"YYYY/MM/DD\", \"YYYY/M/D\"];\nconst FORMAT = \"YYYY-MM-DD\";\n\nconst Datepicker = (props: IDatePicker) => {\n\tconst {\n\t\tname,\n\t\tvalue,\n\t\tweeks,\n\t\tformat = FORMAT,\n\t\tplaceholder = props.format ?? FORMAT,\n\t\trenderDate,\n\t\trenderMonth,\n\t\trenderYear,\n\t\tpopupProps,\n\t\tdisabledDate,\n\t\tonDateClick,\n\t\tonChange,\n\t\tonBlur,\n\t\t...restProps\n\t} = props;\n\n\tconst state = useReactive({\n\t\tvalue,\n\t});\n\n\tconst [active, setActive] = useState<boolean>(false);\n\n\tconst dayJsValue = useMemo(() => {\n\t\tif (!state.value) return null;\n\n\t\tconst date = dayjs(state.value as string, format, true);\n\n\t\tif (date.isValid()) return date;\n\n\t\treturn null;\n\t}, [state.value]);\n\n\tconst handleDateClick = (date: Dayjs) => {\n\t\thandleChange(date.format(format));\n\t};\n\n\tconst handleChange = (v) => {\n\t\tstate.value = v;\n\t\tonChange?.(v);\n\t};\n\n\tconst handleSetDate = () => {\n\t\tif (!state.value) return;\n\n\t\tconst date = dayjs(state.value as string, FORMATTYPES, true);\n\n\t\tif (date.isValid()) {\n\t\t\thandleChange(date.format(format));\n\t\t\treturn;\n\t\t}\n\n\t\thandleChange(\"\");\n\t};\n\n\tconst handleBlur = (e) => {\n\t\tonBlur?.(e);\n\t\thandleSetDate();\n\t};\n\n\tconst handleVisibleChange = (v) => {\n\t\tpopupProps?.onVisibleChange?.(v);\n\t\tsetActive(v);\n\t};\n\n\tuseEffect(() => {\n\t\tstate.value = value;\n\t}, [value]);\n\n\treturn (\n\t\t<Popup\n\t\t\tvisible={active}\n\t\t\ttrigger='click'\n\t\t\tposition='bottom'\n\t\t\tarrow={false}\n\t\t\talign='start'\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t\twatchResize\n\t\t\tcontent={\n\t\t\t\t<Panel\n\t\t\t\t\tvalue={dayJsValue}\n\t\t\t\t\tweeks={weeks}\n\t\t\t\t\trenderDate={renderDate}\n\t\t\t\t\trenderMonth={renderMonth}\n\t\t\t\t\trenderYear={renderYear}\n\t\t\t\t\tdisabledDate={disabledDate}\n\t\t\t\t\tonDateClick={handleDateClick}\n\t\t\t\t/>\n\t\t\t}\n\t\t\t{...popupProps}\n\t\t>\n\t\t\t<Input\n\t\t\t\tvalue={state.value}\n\t\t\t\tappend={\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<CalendarMonthTwotone />}\n\t\t\t\t\t\tclassName='i-datepicker-icon'\n\t\t\t\t\t\tsize='1em'\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonEnter={handleSetDate}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t</Popup>\n\t);\n};\n\nexport default Datepicker;\n"],"names":["dayjs","customParseFormat","useReactive","useState","useMemo","useEffect","_jsx","Popup","Panel","Input","Icon","CalendarMonthTwotone"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYAA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/components/picker/dates/index.tsx"],"sourcesContent":["import { CalendarMonthTwotone } from \"@ricons/material\";\nimport { useReactive } from \"ahooks\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Popup from \"../../popup\";\nimport { IDatePicker } from \"../type\";\nimport \"./index.css\";\nimport Panel from \"./panel\";\n\ndayjs.extend(customParseFormat);\n\nconst FORMATTYPES = [\"YYYY-MM-DD\", \"YYYY-M-D\", \"YYYY/MM/DD\", \"YYYY/M/D\"];\nconst FORMAT = \"YYYY-MM-DD\";\n\nconst Datepicker = (props: IDatePicker) => {\n\tconst {\n\t\tname,\n\t\tvalue,\n\t\tweeks,\n\t\tformat = FORMAT,\n\t\tplaceholder = props.format ?? FORMAT,\n\t\trenderDate,\n\t\trenderMonth,\n\t\trenderYear,\n\t\tpopupProps,\n\t\tdisabledDate,\n\t\tonDateClick,\n\t\tonChange,\n\t\tonBlur,\n\t\t...restProps\n\t} = props;\n\n\tconst state = useReactive({\n\t\tvalue,\n\t});\n\n\tconst [active, setActive] = useState<boolean>(false);\n\n\tconst dayJsValue = useMemo(() => {\n\t\tif (!state.value) return null;\n\n\t\tconst date = dayjs(state.value as string, format, true);\n\n\t\tif (date.isValid()) return date;\n\n\t\treturn null;\n\t}, [state.value]);\n\n\tconst handleDateClick = (date: Dayjs) => {\n\t\thandleChange(date.format(format));\n\t};\n\n\tconst handleChange = (v) => {\n\t\tstate.value = v;\n\t\tonChange?.(v);\n\t};\n\n\tconst handleSetDate = () => {\n\t\tif (!state.value) return;\n\n\t\tconst date = dayjs(state.value as string, FORMATTYPES, true);\n\n\t\tif (date.isValid()) {\n\t\t\thandleChange(date.format(format));\n\t\t\treturn;\n\t\t}\n\n\t\thandleChange(\"\");\n\t};\n\n\tconst handleBlur = (e) => {\n\t\tonBlur?.(e);\n\t\thandleSetDate();\n\t};\n\n\tconst handleVisibleChange = (v) => {\n\t\tpopupProps?.onVisibleChange?.(v);\n\t\tsetActive(v);\n\t};\n\n\tuseEffect(() => {\n\t\tstate.value = value;\n\t}, [value]);\n\n\treturn (\n\t\t<Popup\n\t\t\tvisible={active}\n\t\t\ttrigger='click'\n\t\t\tposition='bottom'\n\t\t\tarrow={false}\n\t\t\talign='start'\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t\twatchResize\n\t\t\tcontent={\n\t\t\t\t<Panel\n\t\t\t\t\tvalue={dayJsValue}\n\t\t\t\t\tweeks={weeks}\n\t\t\t\t\trenderDate={renderDate}\n\t\t\t\t\trenderMonth={renderMonth}\n\t\t\t\t\trenderYear={renderYear}\n\t\t\t\t\tdisabledDate={disabledDate}\n\t\t\t\t\tonDateClick={handleDateClick}\n\t\t\t\t/>\n\t\t\t}\n\t\t\t{...popupProps}\n\t\t>\n\t\t\t<Input\n\t\t\t\tvalue={state.value}\n\t\t\t\tappend={\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<CalendarMonthTwotone />}\n\t\t\t\t\t\tclassName='i-datepicker-icon'\n\t\t\t\t\t\tsize='1em'\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonEnter={handleSetDate}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t</Popup>\n\t);\n};\n\nexport default Datepicker;\n"],"names":["dayjs","customParseFormat","useReactive","useState","useMemo","useEffect","_jsx","Popup","Panel","Input","Icon","CalendarMonthTwotone"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYAA,cAAK,CAAC,MAAM,CAACC,0BAAiB,CAAC;AAE/B,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC;AACxE,MAAM,MAAM,GAAG,YAAY;AAE3B,MAAM,UAAU,GAAG,CAAC,KAAkB,KAAI;AACzC,IAAA,MAAM,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,GAAG,MAAM,EACf,WAAW,GAAG,KAAK,CAAC,MAAM,IAAI,MAAM,EACpC,UAAU,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,MAAM,EACN,GAAG,SAAS,EACZ,GAAG,KAAK;IAET,MAAM,KAAK,GAAGC,kBAAW,CAAC;QACzB,KAAK;AACL,KAAA,CAAC;IAEF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAGC,cAAQ,CAAU,KAAK,CAAC;AAEpD,IAAA,MAAM,UAAU,GAAGC,aAAO,CAAC,MAAK;QAC/B,IAAI,CAAC,KAAK,CAAC,KAAK;AAAE,YAAA,OAAO,IAAI;AAE7B,QAAA,MAAM,IAAI,GAAGJ,cAAK,CAAC,KAAK,CAAC,KAAe,EAAE,MAAM,EAAE,IAAI,CAAC;QAEvD,IAAI,IAAI,CAAC,OAAO,EAAE;AAAE,YAAA,OAAO,IAAI;AAE/B,QAAA,OAAO,IAAI;AACZ,KAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAEjB,IAAA,MA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AU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,eAAe,EAC3B,CAAA,EAAA,GAEC,UAAU,EAAA,QAAA,EAEdF,cAAC,CAAAG,aAAK,EACL,EAAA,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,MAAM,EACLH,cAAC,CAAAI,YAAI,EACJ,EAAA,IAAI,EAAEJ,cAAA,CAACK,6BAAoB,EAAA,EAAA,CAAG,EAC9B,SAAS,EAAC,mBAAmB,EAC7B,IAAI,EAAC,KAAK,EAAA,CACT,EAEH,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,aAAa,EAAA,GAClB,SAAS,EAAA,CACZ,EACK,CAAA;AAEV;;;;"}
|
|
@@ -13,10 +13,10 @@ var icon = require('../../icon/icon.js');
|
|
|
13
13
|
var helpericon = require('../../utils/helpericon/helpericon.js');
|
|
14
14
|
var dates = require('./dates.js');
|
|
15
15
|
|
|
16
|
-
function
|
|
16
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
17
17
|
|
|
18
|
-
var classNames__default = /*#__PURE__*/
|
|
19
|
-
var dayjs__default = /*#__PURE__*/
|
|
18
|
+
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
19
|
+
var dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs);
|
|
20
20
|
|
|
21
21
|
const MONTHS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
22
22
|
const YearMonth = (props) => {
|
|
@@ -27,8 +27,8 @@ const Panel = (props) => {
|
|
|
27
27
|
const { value, unitYear, unitMonth, renderDate, renderMonth = (m) => m, renderYear = (y) => y, disabledDate, onDateClick, } = props;
|
|
28
28
|
const state = ahooks.useReactive({
|
|
29
29
|
today: value,
|
|
30
|
-
month: value || dayjs__default
|
|
31
|
-
selectedYear: dayjs__default
|
|
30
|
+
month: value || dayjs__default(),
|
|
31
|
+
selectedYear: dayjs__default(),
|
|
32
32
|
years: [],
|
|
33
33
|
selectable: false,
|
|
34
34
|
});
|
|
@@ -65,18 +65,18 @@ const Panel = (props) => {
|
|
|
65
65
|
}, [state.selectable]);
|
|
66
66
|
react.useEffect(() => {
|
|
67
67
|
state.today = value;
|
|
68
|
-
state.month = value || dayjs__default
|
|
68
|
+
state.month = value || dayjs__default();
|
|
69
69
|
}, [value]);
|
|
70
|
-
return (jsxRuntime.jsxs("div", { className: 'i-datepicker', children: [jsxRuntime.jsxs("div", { className: 'i-datepicker-units', children: [jsxRuntime.jsx(YearMonth, { value: state.month, unitYear: unitYear, unitMonth: unitMonth, renderMonth: renderMonth, renderYear: renderYear, onClick: () => (state.selectable = true) }), jsxRuntime.jsx("a", { className: 'ml-auto i-datepicker-action', "data-ripple": true, onClick: () => handleOperateMonth(false), children: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.KeyboardArrowLeftRound, {}) }) }), jsxRuntime.jsx("a", { className: 'i-datepicker-action', "data-ripple": true, onClick: () => handleOperateMonth(true), children: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.KeyboardArrowRightRound, {}) }) })] }), jsxRuntime.jsxs("div", { className: classNames__default
|
|
70
|
+
return (jsxRuntime.jsxs("div", { className: 'i-datepicker', children: [jsxRuntime.jsxs("div", { className: 'i-datepicker-units', children: [jsxRuntime.jsx(YearMonth, { value: state.month, unitYear: unitYear, unitMonth: unitMonth, renderMonth: renderMonth, renderYear: renderYear, onClick: () => (state.selectable = true) }), jsxRuntime.jsx("a", { className: 'ml-auto i-datepicker-action', "data-ripple": true, onClick: () => handleOperateMonth(false), children: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.KeyboardArrowLeftRound, {}) }) }), jsxRuntime.jsx("a", { className: 'i-datepicker-action', "data-ripple": true, onClick: () => handleOperateMonth(true), children: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.KeyboardArrowRightRound, {}) }) })] }), jsxRuntime.jsxs("div", { className: classNames__default("i-datepicker-ym", {
|
|
71
71
|
"i-datepicker-active": state.selectable,
|
|
72
72
|
}), children: [jsxRuntime.jsx(helpericon.default, { active: true, className: 'i-datepicker-close', onClick: (e) => {
|
|
73
73
|
e.stopPropagation();
|
|
74
74
|
state.selectable = false;
|
|
75
|
-
} }), jsxRuntime.jsx("div", { ref: $years, className: 'i-datepicker-years', onWheel: getMoreYears, children: state.years.map((y) => (jsxRuntime.jsx("a", { className: classNames__default
|
|
75
|
+
} }), jsxRuntime.jsx("div", { ref: $years, className: 'i-datepicker-years', onWheel: getMoreYears, children: state.years.map((y) => (jsxRuntime.jsx("a", { className: classNames__default("i-datepicker-year", {
|
|
76
76
|
"i-datepicker-active": y === state.selectedYear.year(),
|
|
77
77
|
}), onClick: () => (state.selectedYear =
|
|
78
78
|
state.selectedYear.year(y)), children: renderYear(y) }, y))) }), jsxRuntime.jsx("div", { className: 'i-datepicker-months', children: MONTHS.map((m) => {
|
|
79
|
-
return (jsxRuntime.jsx("a", { className: classNames__default
|
|
79
|
+
return (jsxRuntime.jsx("a", { className: classNames__default("i-datepicker-month", {
|
|
80
80
|
"i-datepicker-active": m === state.month.month() + 1,
|
|
81
81
|
}), onClick: () => handleChangeMonth(m), children: renderMonth(m) }, m));
|
|
82
82
|
}) })] }), jsxRuntime.jsx(dates.default, { value: state.today, month: state.month, disabledDate: disabledDate, onDateClick: handleChangeDate, renderDate: renderDate })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.js","sources":["../../../../../packages/components/picker/dates/panel.tsx"],"sourcesContent":["import {\n\tKeyboardArrowLeftRound,\n\tKeyboardArrowRightRound,\n} from \"@ricons/material\";\nimport { useReactive } from \"ahooks\";\nimport classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport { throttle } from \"radash\";\nimport { ReactNode, useEffect, useRef } from \"react\";\nimport Icon from \"../../icon\";\nimport Helpericon from \"../../utils/helpericon\";\nimport { IBaseDates } from \"../type\";\nimport Dates from \"./dates\";\n\nconst MONTHS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\n\nconst YearMonth = (\n\tprops: IBaseDates & {\n\t\tonClick?: () => void;\n\t}\n) => {\n\tconst {\n\t\tvalue,\n\t\tunitMonth = \"月\",\n\t\tunitYear = \"年\",\n\t\trenderYear,\n\t\trenderMonth,\n\t\tonClick,\n\t} = props;\n\n\treturn (\n\t\t<a className='i-datepicker-action' data-ripple onClick={onClick}>\n\t\t\t<span>{renderYear?.(value.year())}</span>\n\t\t\t{unitYear}\n\t\t\t<span>{renderMonth?.(value.month() + 1)}</span>\n\t\t\t{unitMonth}\n\t\t</a>\n\t);\n};\n\nconst Panel = (props: IBaseDates) => {\n\tconst {\n\t\tvalue,\n\t\tunitYear,\n\t\tunitMonth,\n\t\trenderDate,\n\t\trenderMonth = (m: ReactNode) => m,\n\t\trenderYear = (y: ReactNode) => y,\n\t\tdisabledDate,\n\t\tonDateClick,\n\t} = props;\n\n\tconst state = useReactive({\n\t\ttoday: value,\n\t\tmonth: value || dayjs(),\n\t\tselectedYear: dayjs(),\n\t\tyears: [] as number[],\n\t\tselectable: false,\n\t});\n\n\tconst $years = useRef<HTMLDivElement>(null);\n\n\tconst handleOperateMonth = (next: boolean) => {\n\t\tstate.month = state.month[next ? \"add\" : \"subtract\"](1, \"month\");\n\t};\n\n\tconst handleChangeDate = (date: Dayjs) => {\n\t\tif (date.isSame(state.today, \"day\")) return;\n\n\t\tif (!date.isSame(state.month, \"month\")) {\n\t\t\tstate.month = date;\n\t\t}\n\n\t\tstate.today = date;\n\t\tonDateClick?.(date);\n\t};\n\n\tconst handleChangeMonth = (month: number) => {\n\t\tstate.month = state.month\n\t\t\t.year(state.selectedYear.year())\n\t\t\t.month(month - 1);\n\t\tstate.selectable = false;\n\t};\n\n\tconst getMoreYears = throttle({ interval: 100 }, (e) => {\n\t\tconst isUp = e.deltaY < 0;\n\n\t\tstate.years = state.years.map((y) => (y += isUp ? -1 : 1));\n\t});\n\n\tuseEffect(() => {\n\t\tif (!state.selectable) return;\n\n\t\tstate.selectedYear = state.month;\n\t\tconst y = state.selectedYear.year();\n\t\tconst years = Array.from({ length: 7 }).map((_, i) => y - 3 + i);\n\n\t\tstate.years = [...years];\n\t}, [state.selectable]);\n\n\tuseEffect(() => {\n\t\tstate.today = value;\n\t\tstate.month = value || dayjs();\n\t}, [value]);\n\n\treturn (\n\t\t<div className='i-datepicker'>\n\t\t\t<div className='i-datepicker-units'>\n\t\t\t\t<YearMonth\n\t\t\t\t\tvalue={state.month}\n\t\t\t\t\tunitYear={unitYear}\n\t\t\t\t\tunitMonth={unitMonth}\n\t\t\t\t\trenderMonth={renderMonth}\n\t\t\t\t\trenderYear={renderYear}\n\t\t\t\t\tonClick={() => (state.selectable = true)}\n\t\t\t\t/>\n\t\t\t\t<a\n\t\t\t\t\tclassName='ml-auto i-datepicker-action'\n\t\t\t\t\tdata-ripple\n\t\t\t\t\tonClick={() => handleOperateMonth(false)}\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={<KeyboardArrowLeftRound />} />\n\t\t\t\t</a>\n\t\t\t\t<a\n\t\t\t\t\tclassName='i-datepicker-action'\n\t\t\t\t\tdata-ripple\n\t\t\t\t\tonClick={() => handleOperateMonth(true)}\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={<KeyboardArrowRightRound />} />\n\t\t\t\t</a>\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-datepicker-ym\", {\n\t\t\t\t\t\"i-datepicker-active\": state.selectable,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<Helpericon\n\t\t\t\t\tactive\n\t\t\t\t\tclassName='i-datepicker-close'\n\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\tstate.selectable = false;\n\t\t\t\t\t}}\n\t\t\t\t/>\n\n\t\t\t\t<div\n\t\t\t\t\tref={$years}\n\t\t\t\t\tclassName='i-datepicker-years'\n\t\t\t\t\tonWheel={getMoreYears}\n\t\t\t\t>\n\t\t\t\t\t{state.years.map((y) => (\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tkey={y}\n\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-year\", {\n\t\t\t\t\t\t\t\t\"i-datepicker-active\":\n\t\t\t\t\t\t\t\t\ty === state.selectedYear.year(),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t(state.selectedYear =\n\t\t\t\t\t\t\t\t\tstate.selectedYear.year(y))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderYear(y)}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\n\t\t\t\t<div className='i-datepicker-months'>\n\t\t\t\t\t{MONTHS.map((m) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tkey={m}\n\t\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-month\", {\n\t\t\t\t\t\t\t\t\t\"i-datepicker-active\":\n\t\t\t\t\t\t\t\t\t\tm === state.month.month() + 1,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tonClick={() => handleChangeMonth(m)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{renderMonth(m)}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<Dates\n\t\t\t\tvalue={state.today}\n\t\t\t\tmonth={state.month}\n\t\t\t\tdisabledDate={disabledDate}\n\t\t\t\tonDateClick={handleChangeDate}\n\t\t\t\trenderDate={renderDate}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nexport default Panel;\n"],"names":["_jsxs","_jsx","useReactive","dayjs","useRef","throttle","useEffect","Icon","KeyboardArrowLeftRound","KeyboardArrowRightRound","classNames","Helpericon","Dates"],"mappings":";;;;;;;;;;;;;;;;;;;;AAcA,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAEtD,MAAM,SAAS,GAAG,CACjB,KAEC,KACE;AACH,IAAA,MAAM,EACL,KAAK,EACL,SAAS,GAAG,GAAG,EACf,QAAQ,GAAG,GAAG,EACd,UAAU,EACV,WAAW,EACX,OAAO,GACP,GAAG,KAAK;AAET,IAAA,QACCA,eAAG,CAAA,GAAA,EAAA,EAAA,SAAS,EAAC,qBAAqB,uBAAa,OAAO,EAAE,OAAO,EAAA,QAAA,EAAA,CAC9DC,mCAAO,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,EAAQ,CAAA,EACxC,QAAQ,EACTA,cAAA,CAAA,MAAA,EAAA,EAAA,QAAA,EAAO,WAAW,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,EAAA,CAAQ,EAC9C,SAAS,CAAA,EAAA,CACP;AAEN,CAAC;AAED,MAAM,KAAK,GAAG,CAAC,KAAiB,KAAI;AACnC,IAAA,MAAM,EACL,KAAK,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,WAAW,GAAG,CAAC,CAAY,KAAK,CAAC,EACjC,UAAU,GAAG,CAAC,CAAY,KAAK,CAAC,EAChC,YAAY,EACZ,WAAW,GACX,GAAG,KAAK;IAET,MAAM,KAAK,GAAGC,kBAAW,CAAC;AACzB,QAAA,KAAK,EAAE,KAAK;AACZ,QAAA,KAAK,EAAE,KAAK,IAAIC,
|
|
1
|
+
{"version":3,"file":"panel.js","sources":["../../../../../packages/components/picker/dates/panel.tsx"],"sourcesContent":["import {\n\tKeyboardArrowLeftRound,\n\tKeyboardArrowRightRound,\n} from \"@ricons/material\";\nimport { useReactive } from \"ahooks\";\nimport classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport { throttle } from \"radash\";\nimport { ReactNode, useEffect, useRef } from \"react\";\nimport Icon from \"../../icon\";\nimport Helpericon from \"../../utils/helpericon\";\nimport { IBaseDates } from \"../type\";\nimport Dates from \"./dates\";\n\nconst MONTHS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\n\nconst YearMonth = (\n\tprops: IBaseDates & {\n\t\tonClick?: () => void;\n\t}\n) => {\n\tconst {\n\t\tvalue,\n\t\tunitMonth = \"月\",\n\t\tunitYear = \"年\",\n\t\trenderYear,\n\t\trenderMonth,\n\t\tonClick,\n\t} = props;\n\n\treturn (\n\t\t<a className='i-datepicker-action' data-ripple onClick={onClick}>\n\t\t\t<span>{renderYear?.(value.year())}</span>\n\t\t\t{unitYear}\n\t\t\t<span>{renderMonth?.(value.month() + 1)}</span>\n\t\t\t{unitMonth}\n\t\t</a>\n\t);\n};\n\nconst Panel = (props: IBaseDates) => {\n\tconst {\n\t\tvalue,\n\t\tunitYear,\n\t\tunitMonth,\n\t\trenderDate,\n\t\trenderMonth = (m: ReactNode) => m,\n\t\trenderYear = (y: ReactNode) => y,\n\t\tdisabledDate,\n\t\tonDateClick,\n\t} = props;\n\n\tconst state = useReactive({\n\t\ttoday: value,\n\t\tmonth: value || dayjs(),\n\t\tselectedYear: dayjs(),\n\t\tyears: [] as number[],\n\t\tselectable: false,\n\t});\n\n\tconst $years = useRef<HTMLDivElement>(null);\n\n\tconst handleOperateMonth = (next: boolean) => {\n\t\tstate.month = state.month[next ? \"add\" : \"subtract\"](1, \"month\");\n\t};\n\n\tconst handleChangeDate = (date: Dayjs) => {\n\t\tif (date.isSame(state.today, \"day\")) return;\n\n\t\tif (!date.isSame(state.month, \"month\")) {\n\t\t\tstate.month = date;\n\t\t}\n\n\t\tstate.today = date;\n\t\tonDateClick?.(date);\n\t};\n\n\tconst handleChangeMonth = (month: number) => {\n\t\tstate.month = state.month\n\t\t\t.year(state.selectedYear.year())\n\t\t\t.month(month - 1);\n\t\tstate.selectable = false;\n\t};\n\n\tconst getMoreYears = throttle({ interval: 100 }, (e) => {\n\t\tconst isUp = e.deltaY < 0;\n\n\t\tstate.years = state.years.map((y) => (y += isUp ? -1 : 1));\n\t});\n\n\tuseEffect(() => {\n\t\tif (!state.selectable) return;\n\n\t\tstate.selectedYear = state.month;\n\t\tconst y = state.selectedYear.year();\n\t\tconst years = Array.from({ length: 7 }).map((_, i) => y - 3 + i);\n\n\t\tstate.years = [...years];\n\t}, [state.selectable]);\n\n\tuseEffect(() => {\n\t\tstate.today = value;\n\t\tstate.month = value || dayjs();\n\t}, [value]);\n\n\treturn (\n\t\t<div className='i-datepicker'>\n\t\t\t<div className='i-datepicker-units'>\n\t\t\t\t<YearMonth\n\t\t\t\t\tvalue={state.month}\n\t\t\t\t\tunitYear={unitYear}\n\t\t\t\t\tunitMonth={unitMonth}\n\t\t\t\t\trenderMonth={renderMonth}\n\t\t\t\t\trenderYear={renderYear}\n\t\t\t\t\tonClick={() => (state.selectable = true)}\n\t\t\t\t/>\n\t\t\t\t<a\n\t\t\t\t\tclassName='ml-auto i-datepicker-action'\n\t\t\t\t\tdata-ripple\n\t\t\t\t\tonClick={() => handleOperateMonth(false)}\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={<KeyboardArrowLeftRound />} />\n\t\t\t\t</a>\n\t\t\t\t<a\n\t\t\t\t\tclassName='i-datepicker-action'\n\t\t\t\t\tdata-ripple\n\t\t\t\t\tonClick={() => handleOperateMonth(true)}\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={<KeyboardArrowRightRound />} />\n\t\t\t\t</a>\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-datepicker-ym\", {\n\t\t\t\t\t\"i-datepicker-active\": state.selectable,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<Helpericon\n\t\t\t\t\tactive\n\t\t\t\t\tclassName='i-datepicker-close'\n\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\tstate.selectable = false;\n\t\t\t\t\t}}\n\t\t\t\t/>\n\n\t\t\t\t<div\n\t\t\t\t\tref={$years}\n\t\t\t\t\tclassName='i-datepicker-years'\n\t\t\t\t\tonWheel={getMoreYears}\n\t\t\t\t>\n\t\t\t\t\t{state.years.map((y) => (\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tkey={y}\n\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-year\", {\n\t\t\t\t\t\t\t\t\"i-datepicker-active\":\n\t\t\t\t\t\t\t\t\ty === state.selectedYear.year(),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t(state.selectedYear =\n\t\t\t\t\t\t\t\t\tstate.selectedYear.year(y))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderYear(y)}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\n\t\t\t\t<div className='i-datepicker-months'>\n\t\t\t\t\t{MONTHS.map((m) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tkey={m}\n\t\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-month\", {\n\t\t\t\t\t\t\t\t\t\"i-datepicker-active\":\n\t\t\t\t\t\t\t\t\t\tm === state.month.month() + 1,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tonClick={() => handleChangeMonth(m)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{renderMonth(m)}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<Dates\n\t\t\t\tvalue={state.today}\n\t\t\t\tmonth={state.month}\n\t\t\t\tdisabledDate={disabledDate}\n\t\t\t\tonDateClick={handleChangeDate}\n\t\t\t\trenderDate={renderDate}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nexport default Panel;\n"],"names":["_jsxs","_jsx","useReactive","dayjs","useRef","throttle","useEffect","Icon","KeyboardArrowLeftRound","KeyboardArrowRightRound","classNames","Helpericon","Dates"],"mappings":";;;;;;;;;;;;;;;;;;;;AAcA,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAEtD,MAAM,SAAS,GAAG,CACjB,KAEC,KACE;AACH,IAAA,MAAM,EACL,KAAK,EACL,SAAS,GAAG,GAAG,EACf,QAAQ,GAAG,GAAG,EACd,UAAU,EACV,WAAW,EACX,OAAO,GACP,GAAG,KAAK;AAET,IAAA,QACCA,eAAG,CAAA,GAAA,EAAA,EAAA,SAAS,EAAC,qBAAqB,uBAAa,OAAO,EAAE,OAAO,EAAA,QAAA,EAAA,CAC9DC,mCAAO,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,EAAQ,CAAA,EACxC,QAAQ,EACTA,cAAA,CAAA,MAAA,EAAA,EAAA,QAAA,EAAO,WAAW,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,EAAA,CAAQ,EAC9C,SAAS,CAAA,EAAA,CACP;AAEN,CAAC;AAED,MAAM,KAAK,GAAG,CAAC,KAAiB,KAAI;AACnC,IAAA,MAAM,EACL,KAAK,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,WAAW,GAAG,CAAC,CAAY,KAAK,CAAC,EACjC,UAAU,GAAG,CAAC,CAAY,KAAK,CAAC,EAChC,YAAY,EACZ,WAAW,GACX,GAAG,KAAK;IAET,MAAM,KAAK,GAAGC,kBAAW,C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5B,UAAU,CAAC,CAAC,CAAC,IAVT,CAAC,CAWH,CACJ,CAAC,EACG,CAAA,EAENT,cAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,qBAAqB,EAAA,QAAA,EAClC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAI;AACjB,4BAAA,QACCA,cAEC,CAAA,GAAA,EAAA,EAAA,SAAS,EAAES,mBAAU,CAAC,oBAAoB,EAAE;oCAC3C,qBAAqB,EACpB,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;AAC9B,iCAAA,CAAC,EACF,OAAO,EAAE,MAAM,iBAAiB,CAAC,CAAC,CAAC,EAElC,QAAA,EAAA,WAAW,CAAC,CAAC,CAAC,IAPV,CAAC,CAQH;AAEN,yBAAC,CAAC,EAAA,CACG,CACD,EAAA,CAAA,EAENT,eAACW,aAAK,EAAA,EACL,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,gBAAgB,EAC7B,UAAU,EAAE,UAAU,EACrB,CAAA,CAAA,EAAA,CACG;AAER;;;;"}
|
|
@@ -5,15 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var classNames = require('classnames');
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
9
9
|
|
|
10
|
-
var classNames__default = /*#__PURE__*/
|
|
10
|
+
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
11
11
|
|
|
12
12
|
function Items(props) {
|
|
13
13
|
const { items = [], active, renderItem, unit, onClick } = props;
|
|
14
14
|
return items.map((n) => {
|
|
15
15
|
const isActive = n === active;
|
|
16
|
-
return (jsxRuntime.jsx("a", { className: classNames__default
|
|
16
|
+
return (jsxRuntime.jsx("a", { className: classNames__default("i-timepicker-item", {
|
|
17
17
|
"i-timepicker-item-active": isActive,
|
|
18
18
|
}), onClick: () => onClick(n), children: renderItem?.(n, isActive, unit) ?? (n < 10 ? `0${n}` : n) }, n));
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sources":["../../../../../packages/components/picker/time/item.tsx"],"sourcesContent":["import classNames from \"classnames\";\n\nexport default function Items(props) {\n\tconst { items = [], active, renderItem, unit, onClick } = props;\n\n\treturn items.map((n) => {\n\t\tconst isActive = n === active;\n\n\t\treturn (\n\t\t\t<a\n\t\t\t\tkey={n}\n\t\t\t\tclassName={classNames(\"i-timepicker-item\", {\n\t\t\t\t\t\"i-timepicker-item-active\": isActive,\n\t\t\t\t})}\n\t\t\t\tonClick={() => onClick(n)}\n\t\t\t>\n\t\t\t\t{renderItem?.(n, isActive, unit) ?? (n < 10 ? `0${n}` : n)}\n\t\t\t</a>\n\t\t);\n\t});\n}\n"],"names":["_jsx","classNames"],"mappings":";;;;;;;;;;;AAEwB,SAAA,KAAK,CAAC,KAAK,EAAA;AAClC,IAAA,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK;AAE/D,IAAA,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAI;AACtB,QAAA,MAAM,QAAQ,GAAG,CAAC,KAAK,MAAM;AAE7B,QAAA,QACCA,cAEC,CAAA,GAAA,EAAA,EAAA,SAAS,EAAEC,
|
|
1
|
+
{"version":3,"file":"item.js","sources":["../../../../../packages/components/picker/time/item.tsx"],"sourcesContent":["import classNames from \"classnames\";\n\nexport default function Items(props) {\n\tconst { items = [], active, renderItem, unit, onClick } = props;\n\n\treturn items.map((n) => {\n\t\tconst isActive = n === active;\n\n\t\treturn (\n\t\t\t<a\n\t\t\t\tkey={n}\n\t\t\t\tclassName={classNames(\"i-timepicker-item\", {\n\t\t\t\t\t\"i-timepicker-item-active\": isActive,\n\t\t\t\t})}\n\t\t\t\tonClick={() => onClick(n)}\n\t\t\t>\n\t\t\t\t{renderItem?.(n, isActive, unit) ?? (n < 10 ? `0${n}` : n)}\n\t\t\t</a>\n\t\t);\n\t});\n}\n"],"names":["_jsx","classNames"],"mappings":";;;;;;;;;;;AAEwB,SAAA,KAAK,CAAC,KAAK,EAAA;AAClC,IAAA,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK;AAE/D,IAAA,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAI;AACtB,QAAA,MAAM,QAAQ,GAAG,CAAC,KAAK,MAAM;AAE7B,QAAA,QACCA,cAEC,CAAA,GAAA,EAAA,EAAA,SAAS,EAAEC,mBAAU,CAAC,mBAAmB,EAAE;AAC1C,gBAAA,0BAA0B,EAAE,QAAQ;AACpC,aAAA,CAAC,EACF,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAA,QAAA,EAExB,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA,CAAE,GAAG,CAAC,CAAC,IANrD,CAAC,CAOH;AAEN,KAAC,CAAC;AACH;;;;"}
|
|
@@ -7,9 +7,9 @@ var classNames = require('classnames');
|
|
|
7
7
|
var react = require('react');
|
|
8
8
|
var reactDom = require('react-dom');
|
|
9
9
|
|
|
10
|
-
function
|
|
10
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
11
11
|
|
|
12
|
-
var classNames__default = /*#__PURE__*/
|
|
12
|
+
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
13
13
|
|
|
14
14
|
const Content = (props) => {
|
|
15
15
|
const { ref, getContainer = (trigger) => trigger?.offsetParent ?? document.body, trigger, arrow, arrowProps = {}, className, children, ...restProps } = props;
|
|
@@ -40,7 +40,7 @@ const Content = (props) => {
|
|
|
40
40
|
transform,
|
|
41
41
|
};
|
|
42
42
|
}, [arrowProps]);
|
|
43
|
-
const content = (jsxRuntime.jsxs("div", { ref: ref, className: classNames__default
|
|
43
|
+
const content = (jsxRuntime.jsxs("div", { ref: ref, className: classNames__default("i-popup", className), ...restProps, children: [arrow && (jsxRuntime.jsx("svg", { xmlns: 'http://www.w3.org/2000/svg', className: 'i-popup-arrow', style: arrowCSS, children: jsxRuntime.jsx("path", { d: 'M0.5 0L1.5 0C1.5 4, 3 5.5, 5 7.5S8,10 8,12S7 14.5, 5 16.5S1.5,20 1.5,24L0.5 24L0.5 0z' }) })), children] }));
|
|
44
44
|
return reactDom.createPortal(content, getContainer(trigger));
|
|
45
45
|
};
|
|
46
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sources":["../../../../packages/components/popup/content.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useMemo } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { IPopupContent } from \"./type\";\n\nconst Content = (props: IPopupContent) => {\n\tconst {\n\t\tref,\n\t\tgetContainer = (trigger) => trigger?.offsetParent ?? document.body,\n\t\ttrigger,\n\t\tarrow,\n\t\tarrowProps = {},\n\t\tclassName,\n\t\tchildren,\n\t\t...restProps\n\t} = props;\n\n\tconst arrowCSS = useMemo(() => {\n\t\tlet { left, top, pos } = arrowProps;\n\t\tlet transform = \"\";\n\n\t\tswitch (pos) {\n\t\t\tcase \"left\":\n\t\t\t\tleft += 2;\n\t\t\t\ttransform = `translate(-100%, -50%) rotate(180deg)`;\n\t\t\t\tbreak;\n\t\t\tcase \"right\":\n\t\t\t\tleft -= 2;\n\t\t\t\ttransform = `translate(0, -50%)`;\n\t\t\t\tbreak;\n\t\t\tcase \"top\":\n\t\t\t\ttop -= 2;\n\t\t\t\ttransform = `translate(-50%, -50%) rotate(-90deg)`;\n\t\t\t\tbreak;\n\t\t\tcase \"bottom\":\n\t\t\t\ttop += 2;\n\t\t\t\ttransform = `translate(-50%, -50%) rotate(90deg)`;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn {\n\t\t\tleft,\n\t\t\ttop,\n\t\t\ttransform,\n\t\t};\n\t}, [arrowProps]);\n\n\tconst content = (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-popup\", className)}\n\t\t\t{...restProps}\n\t\t>\n\t\t\t{arrow && (\n\t\t\t\t<svg\n\t\t\t\t\txmlns='http://www.w3.org/2000/svg'\n\t\t\t\t\tclassName='i-popup-arrow'\n\t\t\t\t\tstyle={arrowCSS}\n\t\t\t\t>\n\t\t\t\t\t<path d='M0.5 0L1.5 0C1.5 4, 3 5.5, 5 7.5S8,10 8,12S7 14.5, 5 16.5S1.5,20 1.5,24L0.5 24L0.5 0z' />\n\t\t\t\t</svg>\n\t\t\t)}\n\n\t\t\t{children}\n\t\t</div>\n\t);\n\n\treturn createPortal(content, getContainer(trigger));\n};\n\nexport default Content;\n"],"names":["useMemo","_jsxs","classNames","_jsx","createPortal"],"mappings":";;;;;;;;;;;;;AAKA,MAAM,OAAO,GAAG,CAAC,KAAoB,KAAI;AACxC,IAAA,MAAM,EACL,GAAG,EACH,YAAY,GAAG,CAAC,OAAO,KAAK,OAAO,EAAE,YAAY,IAAI,QAAQ,CAAC,IAAI,EAClE,OAAO,EACP,KAAK,EACL,UAAU,GAAG,EAAE,EACf,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EACZ,GAAG,KAAK;AAET,IAAA,MAAM,QAAQ,GAAGA,aAAO,CAAC,MAAK;QAC7B,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,UAAU;QACnC,IAAI,SAAS,GAAG,EAAE;QAElB,QAAQ,GAAG;AACV,YAAA,KAAK,MAAM;gBACV,IAAI,IAAI,CAAC;gBACT,SAAS,GAAG,uCAAuC;gBACnD;AACD,YAAA,KAAK,OAAO;gBACX,IAAI,IAAI,CAAC;gBACT,SAAS,GAAG,oBAAoB;gBAChC;AACD,YAAA,KAAK,KAAK;gBACT,GAAG,IAAI,CAAC;gBACR,SAAS,GAAG,sCAAsC;gBAClD;AACD,YAAA,KAAK,QAAQ;gBACZ,GAAG,IAAI,CAAC;gBACR,SAAS,GAAG,qCAAqC;gBACjD;;QAKF,OAAO;YACN,IAAI;YACJ,GAAG;YACH,SAAS;SACT;AACF,KAAC,EAAE,CAAC,UAAU,CAAC,CAAC;IAEhB,MAAM,OAAO,IACZC,eAAA,CAAA,KAAA,EAAA,EACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAEC,
|
|
1
|
+
{"version":3,"file":"content.js","sources":["../../../../packages/components/popup/content.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useMemo } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { IPopupContent } from \"./type\";\n\nconst Content = (props: IPopupContent) => {\n\tconst {\n\t\tref,\n\t\tgetContainer = (trigger) => trigger?.offsetParent ?? document.body,\n\t\ttrigger,\n\t\tarrow,\n\t\tarrowProps = {},\n\t\tclassName,\n\t\tchildren,\n\t\t...restProps\n\t} = props;\n\n\tconst arrowCSS = useMemo(() => {\n\t\tlet { left, top, pos } = arrowProps;\n\t\tlet transform = \"\";\n\n\t\tswitch (pos) {\n\t\t\tcase \"left\":\n\t\t\t\tleft += 2;\n\t\t\t\ttransform = `translate(-100%, -50%) rotate(180deg)`;\n\t\t\t\tbreak;\n\t\t\tcase \"right\":\n\t\t\t\tleft -= 2;\n\t\t\t\ttransform = `translate(0, -50%)`;\n\t\t\t\tbreak;\n\t\t\tcase \"top\":\n\t\t\t\ttop -= 2;\n\t\t\t\ttransform = `translate(-50%, -50%) rotate(-90deg)`;\n\t\t\t\tbreak;\n\t\t\tcase \"bottom\":\n\t\t\t\ttop += 2;\n\t\t\t\ttransform = `translate(-50%, -50%) rotate(90deg)`;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn {\n\t\t\tleft,\n\t\t\ttop,\n\t\t\ttransform,\n\t\t};\n\t}, [arrowProps]);\n\n\tconst content = (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-popup\", className)}\n\t\t\t{...restProps}\n\t\t>\n\t\t\t{arrow && (\n\t\t\t\t<svg\n\t\t\t\t\txmlns='http://www.w3.org/2000/svg'\n\t\t\t\t\tclassName='i-popup-arrow'\n\t\t\t\t\tstyle={arrowCSS}\n\t\t\t\t>\n\t\t\t\t\t<path d='M0.5 0L1.5 0C1.5 4, 3 5.5, 5 7.5S8,10 8,12S7 14.5, 5 16.5S1.5,20 1.5,24L0.5 24L0.5 0z' />\n\t\t\t\t</svg>\n\t\t\t)}\n\n\t\t\t{children}\n\t\t</div>\n\t);\n\n\treturn createPortal(content, getContainer(trigger));\n};\n\nexport default Content;\n"],"names":["useMemo","_jsxs","classNames","_jsx","createPortal"],"mappings":";;;;;;;;;;;;;AAKA,MAAM,OAAO,GAAG,CAAC,KAAoB,KAAI;AACxC,IAAA,MAAM,EACL,GAAG,EACH,YAAY,GAAG,CAAC,OAAO,KAAK,OAAO,EAAE,YAAY,IAAI,QAAQ,CAAC,IAAI,EAClE,OAAO,EACP,KAAK,EACL,UAAU,GAAG,EAAE,EACf,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EACZ,GAAG,KAAK;AAET,IAAA,MAAM,QAAQ,GAAGA,aAAO,CAAC,MAAK;QAC7B,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,UAAU;QACnC,IAAI,SAAS,GAAG,EAAE;QAElB,QAAQ,GAAG;AACV,YAAA,KAAK,MAAM;gBACV,IAAI,IAAI,CAAC;gBACT,SAAS,GAAG,uCAAuC;gBACnD;AACD,YAAA,KAAK,OAAO;gBACX,IAAI,IAAI,CAAC;gBACT,SAAS,GAAG,oBAAoB;gBAChC;AACD,YAAA,KAAK,KAAK;gBACT,GAAG,IAAI,CAAC;gBACR,SAAS,GAAG,sCAAsC;gBAClD;AACD,YAAA,KAAK,QAAQ;gBACZ,GAAG,IAAI,CAAC;gBACR,SAAS,GAAG,qCAAqC;gBACjD;;QAKF,OAAO;YACN,IAAI;YACJ,GAAG;YACH,SAAS;SACT;AACF,KAAC,EAAE,CAAC,UAAU,CAAC,CAAC;IAEhB,MAAM,OAAO,IACZC,eAAA,CAAA,KAAA,EAAA,EACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAEC,mBAAU,CAAC,SAAS,EAAE,SAAS,CAAC,KACvC,SAAS,EAAA,QAAA,EAAA,CAEZ,KAAK,KACLC,cAAA,CAAA,KAAA,EAAA,EACC,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAC,eAAe,EACzB,KAAK,EAAE,QAAQ,EAAA,QAAA,EAEfA,yBAAM,CAAC,EAAC,uFAAuF,EAAG,CAAA,EAAA,CAC7F,CACN,EAEA,QAAQ,CACJ,EAAA,CAAA,CACN;IAED,OAAOC,qBAAY,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;AACpD;;;;"}
|
|
@@ -5,15 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var classNames = require('classnames');
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
9
9
|
|
|
10
|
-
var classNames__default = /*#__PURE__*/
|
|
10
|
+
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
11
11
|
|
|
12
12
|
const Line = (props) => {
|
|
13
13
|
const { ref, value, lineWidth, vertical, barClass, dragging, renderCursor, onMouseDown, onTouchStart, } = props;
|
|
14
|
-
return (jsxRuntime.jsx("div", { ref: ref, className: classNames__default
|
|
14
|
+
return (jsxRuntime.jsx("div", { ref: ref, className: classNames__default("i-progress", {
|
|
15
15
|
"i-progress-vertical": vertical,
|
|
16
|
-
}), style: { [vertical ? "width" : "height"]: lineWidth }, onMouseDown: onMouseDown, onTouchStart: onTouchStart, children: jsxRuntime.jsx("div", { className: classNames__default
|
|
16
|
+
}), style: { [vertical ? "width" : "height"]: lineWidth }, onMouseDown: onMouseDown, onTouchStart: onTouchStart, children: jsxRuntime.jsx("div", { className: classNames__default("i-progress-bar", barClass, {
|
|
17
17
|
"no-transition": dragging,
|
|
18
18
|
}), style: { [vertical ? "height" : "width"]: `${value}%` }, children: renderCursor && (jsxRuntime.jsx("a", { className: 'i-progress-cursor', children: renderCursor(value ?? 0) })) }) }));
|
|
19
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.js","sources":["../../../../packages/components/progress/line.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { MouseEvent, RefObject } from \"react\";\nimport { IProgress } from \"./type\";\n\nconst Line = (\n\tprops: Pick<\n\t\tIProgress,\n\t\t\"value\" | \"vertical\" | \"lineWidth\" | \"barClass\" | \"renderCursor\"\n\t> & {\n\t\tref: RefObject<HTMLDivElement | null>;\n\t\tdragging: boolean;\n\t\tonMouseDown: (e: MouseEvent) => void;\n\t\tonTouchStart: (e) => void;\n\t}\n) => {\n\tconst {\n\t\tref,\n\t\tvalue,\n\t\tlineWidth,\n\t\tvertical,\n\t\tbarClass,\n\t\tdragging,\n\t\trenderCursor,\n\t\tonMouseDown,\n\t\tonTouchStart,\n\t} = props;\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-progress\", {\n\t\t\t\t\"i-progress-vertical\": vertical,\n\t\t\t})}\n\t\t\tstyle={{ [vertical ? \"width\" : \"height\"]: lineWidth }}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonTouchStart={onTouchStart}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-progress-bar\", barClass, {\n\t\t\t\t\t\"no-transition\": dragging,\n\t\t\t\t})}\n\t\t\t\tstyle={{ [vertical ? \"height\" : \"width\"]: `${value}%` }}\n\t\t\t>\n\t\t\t\t{renderCursor && (\n\t\t\t\t\t<a className='i-progress-cursor'>\n\t\t\t\t\t\t{renderCursor(value ?? 0)}\n\t\t\t\t\t</a>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default Line;\n"],"names":["_jsx","classNames"],"mappings":";;;;;;;;;;;AAIA,MAAM,IAAI,GAAG,CACZ,KAQC,KACE;IACH,MAAM,EACL,GAAG,EACH,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,YAAY,GACZ,GAAG,KAAK;IAET,QACCA,cACC,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,GAAG,EACR,SAAS,EAAEC,
|
|
1
|
+
{"version":3,"file":"line.js","sources":["../../../../packages/components/progress/line.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { MouseEvent, RefObject } from \"react\";\nimport { IProgress } from \"./type\";\n\nconst Line = (\n\tprops: Pick<\n\t\tIProgress,\n\t\t\"value\" | \"vertical\" | \"lineWidth\" | \"barClass\" | \"renderCursor\"\n\t> & {\n\t\tref: RefObject<HTMLDivElement | null>;\n\t\tdragging: boolean;\n\t\tonMouseDown: (e: MouseEvent) => void;\n\t\tonTouchStart: (e) => void;\n\t}\n) => {\n\tconst {\n\t\tref,\n\t\tvalue,\n\t\tlineWidth,\n\t\tvertical,\n\t\tbarClass,\n\t\tdragging,\n\t\trenderCursor,\n\t\tonMouseDown,\n\t\tonTouchStart,\n\t} = props;\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-progress\", {\n\t\t\t\t\"i-progress-vertical\": vertical,\n\t\t\t})}\n\t\t\tstyle={{ [vertical ? \"width\" : \"height\"]: lineWidth }}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonTouchStart={onTouchStart}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-progress-bar\", barClass, {\n\t\t\t\t\t\"no-transition\": dragging,\n\t\t\t\t})}\n\t\t\t\tstyle={{ [vertical ? \"height\" : \"width\"]: `${value}%` }}\n\t\t\t>\n\t\t\t\t{renderCursor && (\n\t\t\t\t\t<a className='i-progress-cursor'>\n\t\t\t\t\t\t{renderCursor(value ?? 0)}\n\t\t\t\t\t</a>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default Line;\n"],"names":["_jsx","classNames"],"mappings":";;;;;;;;;;;AAIA,MAAM,IAAI,GAAG,CACZ,KAQC,KACE;IACH,MAAM,EACL,GAAG,EACH,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,YAAY,GACZ,GAAG,KAAK;IAET,QACCA,cACC,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,GAAG,EACR,SAAS,EAAEC,mBAAU,CAAC,YAAY,EAAE;AACnC,YAAA,qBAAqB,EAAE,QAAQ;AAC/B,SAAA,CAAC,EACF,KAAK,EAAE,EAAE,CAAC,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,EACrD,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAAA,QAAA,EAE1BD,cACC,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEC,mBAAU,CAAC,gBAAgB,EAAE,QAAQ,EAAE;AACjD,gBAAA,eAAe,EAAE,QAAQ;AACzB,aAAA,CAAC,EACF,KAAK,EAAE,EAAE,CAAC,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,CAAA,EAAG,KAAK,CAAG,CAAA,CAAA,EAAE,EAEtD,QAAA,EAAA,YAAY,KACZD,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,mBAAmB,YAC9B,YAAY,CAAC,KAAK,IAAI,CAAC,CAAC,EAAA,CACtB,CACJ,EACI,CAAA,EAAA,CACD;AAER;;;;"}
|
|
@@ -10,9 +10,9 @@ var hooks = require('../../js/hooks.js');
|
|
|
10
10
|
var circle = require('./circle.js');
|
|
11
11
|
var line = require('./line.js');
|
|
12
12
|
|
|
13
|
-
function
|
|
13
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
14
14
|
|
|
15
|
-
var classNames__default = /*#__PURE__*/
|
|
15
|
+
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
16
16
|
|
|
17
17
|
const Progress = (props) => {
|
|
18
18
|
const { value = 0, lineWidth = 8, circleSize = 40, precision = 0, style, draggable = true, type = "line", barClass, vertical, label, labelInline, className, renderCursor, onChange, onDraggingChange, } = props;
|
|
@@ -82,7 +82,7 @@ const Progress = (props) => {
|
|
|
82
82
|
}
|
|
83
83
|
state.value = value;
|
|
84
84
|
}, [value]);
|
|
85
|
-
return (jsxRuntime.jsxs("div", { className: classNames__default
|
|
85
|
+
return (jsxRuntime.jsxs("div", { className: classNames__default("i-input-label", className, {
|
|
86
86
|
"i-input-inline": labelInline,
|
|
87
87
|
}), style: style, children: [label && jsxRuntime.jsx("span", { className: 'i-input-label-text', children: label }), type === "line" && (jsxRuntime.jsx(line.default, { ref: ref, vertical: vertical, lineWidth: lineWidth, barClass: barClass, dragging: state.dragging, value: state.value, renderCursor: renderCursor, onMouseDown: handleMouseDown, onTouchStart: handleMouseDown })), type === "circle" && (jsxRuntime.jsx(circle.default, { value: state.value, circleSize: circleSize, lineWidth: lineWidth }))] }));
|
|
88
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sources":["../../../../packages/components/progress/progress.tsx"],"sourcesContent":["import { useReactive } from \"ahooks\";\nimport classNames from \"classnames\";\nimport { useEffect, useMemo, useRef } from \"react\";\nimport \"../../css/input.css\";\nimport { useMouseMove, useMouseUp } from \"../../js/hooks\";\nimport Circle from \"./circle\";\nimport \"./index.css\";\nimport Line from \"./line\";\nimport { IProgress } from \"./type\";\n\nconst Progress = (props: IProgress) => {\n\tconst {\n\t\tvalue = 0,\n\t\tlineWidth = 8,\n\t\tcircleSize = 40,\n\t\tprecision = 0,\n\t\tstyle,\n\t\tdraggable = true,\n\t\ttype = \"line\",\n\t\tbarClass,\n\t\tvertical,\n\t\tlabel,\n\t\tlabelInline,\n\t\tclassName,\n\t\trenderCursor,\n\t\tonChange,\n\t\tonDraggingChange,\n\t} = props;\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst state = useReactive({\n\t\tvalue,\n\t\tdragging: false,\n\t\tsize: 0,\n\t\tstart: 0,\n\t});\n\n\tconst pageXY = vertical ? \"pageY\" : \"pageX\";\n\tconst rectTL = vertical ? \"top\" : \"left\";\n\tconst rectWH = vertical ? \"height\" : \"width\";\n\n\tconst toFixedValue = useMemo(() => {\n\t\tlet value = +state.value.toFixed(precision);\n\t\tvalue = Math.min(100, value);\n\t\tvalue = Math.max(0, value);\n\n\t\treturn value;\n\t}, [state.value, precision]);\n\n\tconst handleMouseDown = (e) => {\n\t\tif (!ref.current || !draggable) return;\n\n\t\tif (e.touches) {\n\t\t\te = e.touches[0];\n\t\t}\n\n\t\tconst rect = ref.current.getBoundingClientRect();\n\t\tconst value = ((e[pageXY] - rect[rectTL]) * 100) / rect[rectWH];\n\n\t\tObject.assign(state, {\n\t\t\tvalue: vertical ? 100 - value : value,\n\t\t\tsize: rect[rectWH],\n\t\t\tstart: rect[rectTL],\n\t\t\tdragging: true,\n\t\t});\n\t\tonDraggingChange?.(true);\n\t};\n\n\tconst handleMouseMove = (e) => {\n\t\tif (!state.dragging || !draggable) return;\n\t\te.preventDefault();\n\n\t\tif (e.touches) {\n\t\t\te = e.touches[0];\n\t\t}\n\n\t\tconst { start, size } = state;\n\t\tconst offset = e[pageXY] - start;\n\n\t\tif (offset < 0 || offset > size) return;\n\n\t\tconst value = ((e[pageXY] - start) * 100) / size;\n\t\tstate.value = vertical ? 100 - value : value;\n\t};\n\n\tconst handleMouseUp = () => {\n\t\tif (!state.dragging || !draggable) return;\n\n\t\tonChange?.(toFixedValue);\n\t\tstate.dragging = false;\n\t\tonDraggingChange?.(false);\n\t};\n\n\tuseMouseMove(handleMouseMove);\n\tuseMouseUp(handleMouseUp);\n\n\tuseEffect(() => {\n\t\tif (value > 100) {\n\t\t\tstate.value = 100;\n\t\t\treturn;\n\t\t}\n\n\t\tif (value < 0) {\n\t\t\tstate.value = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tstate.value = value;\n\t}, [value]);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\"i-input-label\", className, {\n\t\t\t\t\"i-input-inline\": labelInline,\n\t\t\t})}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t{label && <span className='i-input-label-text'>{label}</span>}\n\n\t\t\t{type === \"line\" && (\n\t\t\t\t<Line\n\t\t\t\t\tref={ref}\n\t\t\t\t\tvertical={vertical}\n\t\t\t\t\tlineWidth={lineWidth}\n\t\t\t\t\tbarClass={barClass}\n\t\t\t\t\tdragging={state.dragging}\n\t\t\t\t\tvalue={state.value}\n\t\t\t\t\trenderCursor={renderCursor}\n\t\t\t\t\tonMouseDown={handleMouseDown}\n\t\t\t\t\tonTouchStart={handleMouseDown}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{type === \"circle\" && (\n\t\t\t\t<Circle\n\t\t\t\t\tvalue={state.value}\n\t\t\t\t\tcircleSize={circleSize}\n\t\t\t\t\tlineWidth={lineWidth}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Progress;\n"],"names":["useRef","useReactive","useMemo","useMouseMove","useMouseUp","useEffect","_jsxs","classNames","_jsx","Line","Circle"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,QAAQ,GAAG,CAAC,KAAgB,KAAI;IACrC,MAAM,EACL,KAAK,GAAG,CAAC,EACT,SAAS,GAAG,CAAC,EACb,UAAU,GA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AACtB,QAAA,gBAAgB,GAAG,KAAK,CAAC;AAC1B,KAAC;IAEDC,kBAAY,CAAC,eAAe,CAAC;IAC7BC,gBAAU,CAAC,aAAa,CAAC;IAEzBC,eAAS,CAAC,MAAK;AACd,QAAA,IAAI,KAAK,GAAG,GAAG,EAAE;AAChB,YAAA,KAAK,CAAC,KAAK,GAAG,GAAG;YACjB;;AAGD,QAAA,IAAI,KAAK,GAAG,CAAC,EAAE;AACd,YAAA,KAAK,CAAC,KAAK,GAAG,CAAC;YACf;;AAGD,QAAA,KAAK,CAAC,KAAK,GAAG,KAAK;AACpB,KAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAEX,QACCC,yBACC,SAAS,EAAEC,
|
|
1
|
+
{"version":3,"file":"progress.js","sources":["../../../../packages/components/progress/progress.tsx"],"sourcesContent":["import { useReactive } from \"ahooks\";\nimport classNames from \"classnames\";\nimport { useEffect, useMemo, useRef } from \"react\";\nimport \"../../css/input.css\";\nimport { useMouseMove, useMouseUp } from \"../../js/hooks\";\nimport Circle from \"./circle\";\nimport \"./index.css\";\nimport Line from \"./line\";\nimport { IProgress } from \"./type\";\n\nconst Progress = (props: IProgress) => {\n\tconst {\n\t\tvalue = 0,\n\t\tlineWidth = 8,\n\t\tcircleSize = 40,\n\t\tprecision = 0,\n\t\tstyle,\n\t\tdraggable = true,\n\t\ttype = \"line\",\n\t\tbarClass,\n\t\tvertical,\n\t\tlabel,\n\t\tlabelInline,\n\t\tclassName,\n\t\trenderCursor,\n\t\tonChange,\n\t\tonDraggingChange,\n\t} = props;\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst state = useReactive({\n\t\tvalue,\n\t\tdragging: false,\n\t\tsize: 0,\n\t\tstart: 0,\n\t});\n\n\tconst pageXY = vertical ? \"pageY\" : \"pageX\";\n\tconst rectTL = vertical ? \"top\" : \"left\";\n\tconst rectWH = vertical ? \"height\" : \"width\";\n\n\tconst toFixedValue = useMemo(() => {\n\t\tlet value = +state.value.toFixed(precision);\n\t\tvalue = Math.min(100, value);\n\t\tvalue = Math.max(0, value);\n\n\t\treturn value;\n\t}, [state.value, precision]);\n\n\tconst handleMouseDown = (e) => {\n\t\tif (!ref.current || !draggable) return;\n\n\t\tif (e.touches) {\n\t\t\te = e.touches[0];\n\t\t}\n\n\t\tconst rect = ref.current.getBoundingClientRect();\n\t\tconst value = ((e[pageXY] - rect[rectTL]) * 100) / rect[rectWH];\n\n\t\tObject.assign(state, {\n\t\t\tvalue: vertical ? 100 - value : value,\n\t\t\tsize: rect[rectWH],\n\t\t\tstart: rect[rectTL],\n\t\t\tdragging: true,\n\t\t});\n\t\tonDraggingChange?.(true);\n\t};\n\n\tconst handleMouseMove = (e) => {\n\t\tif (!state.dragging || !draggable) return;\n\t\te.preventDefault();\n\n\t\tif (e.touches) {\n\t\t\te = e.touches[0];\n\t\t}\n\n\t\tconst { start, size } = state;\n\t\tconst offset = e[pageXY] - start;\n\n\t\tif (offset < 0 || offset > size) return;\n\n\t\tconst value = ((e[pageXY] - start) * 100) / size;\n\t\tstate.value = vertical ? 100 - value : value;\n\t};\n\n\tconst handleMouseUp = () => {\n\t\tif (!state.dragging || !draggable) return;\n\n\t\tonChange?.(toFixedValue);\n\t\tstate.dragging = false;\n\t\tonDraggingChange?.(false);\n\t};\n\n\tuseMouseMove(handleMouseMove);\n\tuseMouseUp(handleMouseUp);\n\n\tuseEffect(() => {\n\t\tif (value > 100) {\n\t\t\tstate.value = 100;\n\t\t\treturn;\n\t\t}\n\n\t\tif (value < 0) {\n\t\t\tstate.value = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tstate.value = value;\n\t}, [value]);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\"i-input-label\", className, {\n\t\t\t\t\"i-input-inline\": labelInline,\n\t\t\t})}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t{label && <span className='i-input-label-text'>{label}</span>}\n\n\t\t\t{type === \"line\" && (\n\t\t\t\t<Line\n\t\t\t\t\tref={ref}\n\t\t\t\t\tvertical={vertical}\n\t\t\t\t\tlineWidth={lineWidth}\n\t\t\t\t\tbarClass={barClass}\n\t\t\t\t\tdragging={state.dragging}\n\t\t\t\t\tvalue={state.value}\n\t\t\t\t\trenderCursor={renderCursor}\n\t\t\t\t\tonMouseDown={handleMouseDown}\n\t\t\t\t\tonTouchStart={handleMouseDown}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{type === \"circle\" && (\n\t\t\t\t<Circle\n\t\t\t\t\tvalue={state.value}\n\t\t\t\t\tcircleSize={circleSize}\n\t\t\t\t\tlineWidth={lineWidth}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Progress;\n"],"names":["useRef","useReactive","useMemo","useMouseMove","useMouseUp","useEffect","_jsxs","classNames","_jsx","Line","Circle"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,QAAQ,GAAG,CAAC,KAAgB,KAAI;IACrC,MAAM,EACL,KAAK,GAAG,CAAC,EACT,SAAS,GAAG,CAAC,EACb,UAAU,GAAG,EAAE,EACf,SAAS,GAAG,CAAC,EACb,KAAK,EACL,SAAS,GAAG,IAAI,EAChB,IAAI,GAAG,MAAM,EACb,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,gBAAgB,GAChB,GAAG,KAAK;AAET,IAAA,MAAM,GAAG,GAAGA,YAAM,CAAiB,IAAI,CAAC;IACxC,MAAM,KAAK,GAAGC,kBAAW,CAAC;QACzB,KAAK;AACL,QAAA,QAAQ,EAAE,KAAK;AACf,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,KAAK,EAAE,CAAC;AACR,KAAA,CAAC;IAEF,MAAM,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO;IAC3C,MAAM,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM;IACxC,MAAM,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO;AAE5C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