@ioca/react 1.4.77 → 1.4.78
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/es/components/affix/affix.js +1 -1
- package/lib/es/components/affix/totop.js +1 -1
- package/lib/es/components/affix/totop.js.map +1 -1
- package/lib/es/components/collapse/collapse.js +2 -1
- package/lib/es/components/collapse/collapse.js.map +1 -1
- package/lib/es/components/editor/controls.js +7 -1
- package/lib/es/components/editor/controls.js.map +1 -1
- package/lib/es/components/form/field.js +1 -1
- package/lib/es/components/form/form.js +1 -1
- package/lib/es/components/form/useForm.js +2 -2
- package/lib/es/components/input/input.js +2 -1
- package/lib/es/components/input/input.js.map +1 -1
- package/lib/es/components/input/number.js +3 -1
- package/lib/es/components/input/number.js.map +1 -1
- package/lib/es/components/input/range.js +3 -1
- package/lib/es/components/input/range.js.map +1 -1
- package/lib/es/components/message/message.js +2 -2
- package/lib/es/components/pagination/pagination.js +3 -1
- package/lib/es/components/pagination/pagination.js.map +1 -1
- package/lib/es/components/picker/colors/footer.js +1 -1
- package/lib/es/components/picker/colors/footer.js.map +1 -1
- package/lib/es/components/picker/dates/index.js +2 -2
- package/lib/es/components/picker/dates/index.js.map +1 -1
- package/lib/es/components/picker/dates/panel.js +3 -2
- package/lib/es/components/picker/dates/panel.js.map +1 -1
- package/lib/es/components/picker/time/index.js +1 -1
- package/lib/es/components/picker/time/index.js.map +1 -1
- package/lib/es/components/popconfirm/popconfirm.js +1 -1
- package/lib/es/components/popconfirm/popconfirm.js.map +1 -1
- package/lib/es/components/popup/popup.js +1 -1
- package/lib/es/components/select/options.js +2 -1
- package/lib/es/components/select/options.js.map +1 -1
- package/lib/es/components/select/select.js +2 -2
- package/lib/es/components/select/select.js.map +1 -1
- package/lib/es/components/step/item.js +1 -1
- package/lib/es/components/step/item.js.map +1 -1
- package/lib/es/components/swiper/swiper.js +2 -1
- package/lib/es/components/swiper/swiper.js.map +1 -1
- package/lib/es/components/tabs/tabs.js +1 -1
- package/lib/es/components/tabs/tabs.js.map +1 -1
- package/lib/es/components/text/highlight.js +1 -1
- package/lib/es/components/tree/item.js +1 -1
- package/lib/es/components/tree/item.js.map +1 -1
- package/lib/es/components/upload/renderFile.js +2 -2
- package/lib/es/components/upload/renderFile.js.map +1 -1
- package/lib/es/components/upload/upload.js +3 -2
- package/lib/es/components/upload/upload.js.map +1 -1
- package/lib/es/components/utils/empty/index.js +1 -1
- package/lib/es/components/utils/empty/index.js.map +1 -1
- package/lib/es/components/utils/helpericon/helpericon.js +2 -2
- package/lib/es/components/utils/helpericon/helpericon.js.map +1 -1
- package/lib/es/components/video/video.js +8 -2
- package/lib/es/components/video/video.js.map +1 -1
- package/lib/es/js/usePreview/content.js +9 -2
- package/lib/es/js/usePreview/content.js.map +1 -1
- package/lib/es/js/usePreview/renderFile.js +1 -1
- package/lib/es/js/usePreview/renderFile.js.map +1 -1
- package/lib/es/js/utils.js +1 -1
- package/lib/types/components/affix/affix.js +1 -1
- package/lib/types/components/affix/totop.js +1 -1
- package/lib/types/components/collapse/collapse.js +2 -1
- package/lib/types/components/editor/controls.js +7 -1
- package/lib/types/components/form/field.js +1 -1
- package/lib/types/components/form/form.js +1 -1
- package/lib/types/components/form/useForm.js +2 -2
- package/lib/types/components/input/input.js +2 -1
- package/lib/types/components/input/number.js +3 -1
- package/lib/types/components/input/range.js +3 -1
- package/lib/types/components/message/message.js +2 -2
- package/lib/types/components/pagination/pagination.js +3 -1
- package/lib/types/components/picker/colors/footer.js +1 -1
- package/lib/types/components/picker/dates/index.js +2 -2
- package/lib/types/components/picker/dates/panel.js +3 -2
- package/lib/types/components/picker/time/index.js +1 -1
- package/lib/types/components/popconfirm/popconfirm.js +1 -1
- package/lib/types/components/popup/popup.js +1 -1
- package/lib/types/components/select/options.js +2 -1
- package/lib/types/components/select/select.js +2 -2
- package/lib/types/components/step/item.js +1 -1
- package/lib/types/components/swiper/swiper.js +2 -1
- package/lib/types/components/tabs/tabs.js +1 -1
- package/lib/types/components/text/highlight.js +1 -1
- package/lib/types/components/tree/item.js +1 -1
- package/lib/types/components/upload/renderFile.js +2 -2
- package/lib/types/components/upload/upload.js +3 -2
- package/lib/types/components/utils/empty/index.js +1 -1
- package/lib/types/components/utils/helpericon/helpericon.js +2 -2
- package/lib/types/components/video/video.js +8 -2
- package/lib/types/js/usePreview/content.js +9 -2
- package/lib/types/js/usePreview/renderFile.js +1 -1
- package/lib/types/js/utils.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ToTop from "./totop.js";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import { debounce } from "
|
|
3
|
+
import { debounce } from "radash";
|
|
4
4
|
import { Children, cloneElement, useEffect, useMemo, useState } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region packages/components/affix/affix.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import button_default from "../button/index.js";
|
|
2
2
|
import icon_default from "../icon/index.js";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
import
|
|
4
|
+
import SkipPreviousRound from "@ricons/material/es/SkipPreviousRound.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region packages/components/affix/totop.tsx
|
|
7
7
|
function ToTop(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"totop.js","names":["Button","Icon"],"sources":["../../../../packages/components/affix/totop.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"totop.js","names":["Button","Icon"],"sources":["../../../../packages/components/affix/totop.tsx"],"sourcesContent":["import SkipPreviousRound from \"@ricons/material/es/SkipPreviousRound.js\";\nimport classNames from \"classnames\";\nimport Button from \"../button\";\nimport Icon from \"../icon\";\nimport { IAffix } from \"./type\";\n\nfunction ToTop(props: IAffix) {\n\tconst { style, className, onClick } = props;\n\n\treturn (\n\t\t<Button\n\t\t\tsquare\n\t\t\tclassName={classNames(\"i-affix-totop\", className)}\n\t\t\tstyle={{ ...style }}\n\t\t\tonClick={onClick}\n\t\t>\n\t\t\t<Icon icon={<SkipPreviousRound />} rotate={90} />\n\t\t</Button>\n\t);\n}\n\nexport default ToTop;\n"],"mappings":";;;;;;AAMA,SAAS,MAAM,OAAe;CAC7B,MAAM,EAAE,OAAO,WAAW,YAAY;AAEtC,QACC,oBAACA,gBAAD;EACC,QAAA;EACA,WAAW,WAAW,iBAAiB,UAAU;EACjD,OAAO,EAAE,GAAG,OAAO;EACV;YAET,oBAACC,cAAD;GAAM,MAAM,oBAAC,mBAAD,EAAqB,CAAA;GAAE,QAAQ;GAAM,CAAA;EACzC,CAAA"}
|
|
@@ -2,8 +2,9 @@ import helpericon_default from "../utils/helpericon/index.js";
|
|
|
2
2
|
import Item from "./item.js";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { Children, useMemo, useState } from "react";
|
|
5
|
-
import { MinusRound, PlusRound } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import MinusRound from "@ricons/material/es/MinusRound.js";
|
|
7
|
+
import PlusRound from "@ricons/material/es/PlusRound.js";
|
|
7
8
|
//#region packages/components/collapse/collapse.tsx
|
|
8
9
|
const Collapse = (props) => {
|
|
9
10
|
const { active, items, multiple, border, headerClickable, className, children, renderToggle = (active) => active ? /* @__PURE__ */ jsx(MinusRound, {}) : /* @__PURE__ */ jsx(PlusRound, {}), onCollapse, ...restProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse.js","names":[],"sources":["../../../../packages/components/collapse/collapse.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"collapse.js","names":[],"sources":["../../../../packages/components/collapse/collapse.tsx"],"sourcesContent":["import MinusRound from \"@ricons/material/es/MinusRound.js\";\nimport PlusRound from \"@ricons/material/es/PlusRound.js\";\nimport classNames from \"classnames\";\nimport { Children, useMemo, useState } from \"react\";\nimport Helpericon from \"../utils/helpericon\";\nimport \"./index.css\";\nimport Item from \"./item\";\nimport { ICollapse, ICollapseItem, TKey } from \"./type\";\n\nconst Collapse = (props: ICollapse) => {\n\tconst {\n\t\tactive,\n\t\titems,\n\t\tmultiple,\n\t\tborder,\n\t\theaderClickable,\n\t\tclassName,\n\t\tchildren,\n\t\trenderToggle = (active: boolean) =>\n\t\t\tactive ? <MinusRound /> : <PlusRound />,\n\t\tonCollapse,\n\t\t...restProps\n\t} = props;\n\n\tconst [activeKey, setActiveKey] = useState(active);\n\n\tconst collapses = useMemo(() => {\n\t\tif (!items) {\n\t\t\tif (!children) return [];\n\n\t\t\treturn (\n\t\t\t\tChildren.map(children, (node, i) => {\n\t\t\t\t\tconst { key, props: nodeProps } = node as {\n\t\t\t\t\t\tkey?: TKey;\n\t\t\t\t\t\tprops?: any;\n\t\t\t\t\t};\n\t\t\t\t\tconst { title, children, content, disabled, ...restProps } =\n\t\t\t\t\t\tnodeProps;\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...restProps,\n\t\t\t\t\t\tkey: key || i,\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\tcontent: children || content,\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t};\n\t\t\t\t}) || []\n\t\t\t);\n\t\t}\n\n\t\treturn items;\n\t}, [children]);\n\n\tconst handleHeaderClick = (item: ICollapseItem) => {\n\t\tif (!headerClickable) return;\n\n\t\thandleToggle(item);\n\t};\n\n\tconst handleToggle = (item: ICollapseItem, e?) => {\n\t\tconst { key, disabled } = item;\n\t\te?.stopPropagation();\n\t\tif (disabled) return;\n\n\t\tif (!multiple) {\n\t\t\tconst nextActive = activeKey === key ? undefined : key;\n\t\t\tsetActiveKey(nextActive);\n\t\t\tonCollapse?.(key as TKey, nextActive !== undefined);\n\t\t\treturn;\n\t\t}\n\n\t\tconst group = Array.isArray(activeKey) ? [...activeKey] : [];\n\n\t\tconst i = group.findIndex((k) => k === key);\n\n\t\tif (i > -1) {\n\t\t\tgroup.splice(i, 1);\n\t\t} else {\n\t\t\tkey !== undefined && group.push(key);\n\t\t}\n\t\tsetActiveKey(group as any);\n\t\tonCollapse?.(key as TKey, i < 0);\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t\"i-collapse\",\n\t\t\t\t{\n\t\t\t\t\t\"i-collapse-bordered\": border,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...restProps}\n\t\t>\n\t\t\t{collapses.map((item) => {\n\t\t\t\tconst {\n\t\t\t\t\tkey,\n\t\t\t\t\ttitle,\n\t\t\t\t\tcontent,\n\t\t\t\t\tdisabled,\n\t\t\t\t\tclassName,\n\t\t\t\t\t...restProps\n\t\t\t\t} = item;\n\t\t\t\tconst isActive = multiple\n\t\t\t\t\t? ((activeKey as TKey[]) || []).includes(key)\n\t\t\t\t\t: activeKey === key;\n\n\t\t\t\treturn (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\tclassName={classNames(\"i-collapse-item\", className, {\n\t\t\t\t\t\t\t\"i-collapse-active\": isActive,\n\t\t\t\t\t\t\t\"i-collapse-disabled\": disabled,\n\t\t\t\t\t\t})}\n\t\t\t\t\t\t{...restProps}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName='i-collapse-header'\n\t\t\t\t\t\t\tonClick={() => handleHeaderClick(item)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{title}\n\n\t\t\t\t\t\t\t<Helpericon\n\t\t\t\t\t\t\t\tactive\n\t\t\t\t\t\t\t\tclassName='i-collapse-toggle'\n\t\t\t\t\t\t\t\ticon={renderToggle(isActive)}\n\t\t\t\t\t\t\t\tonClick={(e) => handleToggle(item, e)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className='i-collapse-content'>{content}</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Aa,KAAa,IAAI,EAAE;;AAGjC,QACC,oBAAC,OAAD;EACC,WAAW,WACV,cACA,EACC,uBAAuB,QACvB,EACD,UACA;EACD,GAAI;YAEH,UAAU,KAAK,SAAS;GACxB,MAAM,EACL,KACA,OACA,SACA,UACA,WACA,GAAG,cACA;GACJ,MAAM,WAAW,YACZ,aAAwB,EAAE,EAAE,SAAS,IAAG,GAC1C,cAAc;AAEjB,UACC,qBAAC,OAAD;IAEC,WAAW,WAAW,mBAAmB,WAAW;KACnD,qBAAqB;KACrB,uBAAuB;KACvB,CAAC;IACF,GAAI;cANL,CAQC,qBAAC,OAAD;KACC,WAAU;KACV,eAAe,kBAAkB,KAAK;eAFvC,CAIE,OAED,oBAAC,oBAAD;MACC,QAAA;MACA,WAAU;MACV,MAAM,aAAa,SAAS;MAC5B,UAAU,MAAM,aAAa,MAAM,EAAE;MACrC,CAAA,CACG;QAEL,oBAAC,OAAD;KAAK,WAAU;eAAsB;KAAa,CAAA,CAC9C;MAtBC,IAsBD;IAEL;EACE,CAAA;;AAIP,SAAS,OAAO"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import button_default from "../button/index.js";
|
|
2
2
|
import icon_default from "../icon/index.js";
|
|
3
|
-
import { ClearAllRound, FormatBoldRound, FormatItalicRound, FormatUnderlinedRound, RedoRound, StrikethroughSRound, UndoRound } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
4
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import xss from "xss";
|
|
5
|
+
import ClearAllRound from "@ricons/material/es/ClearAllRound.js";
|
|
6
|
+
import FormatBoldRound from "@ricons/material/es/FormatBoldRound.js";
|
|
7
|
+
import FormatItalicRound from "@ricons/material/es/FormatItalicRound.js";
|
|
8
|
+
import FormatUnderlinedRound from "@ricons/material/es/FormatUnderlinedRound.js";
|
|
9
|
+
import RedoRound from "@ricons/material/es/RedoRound.js";
|
|
10
|
+
import StrikethroughSRound from "@ricons/material/es/StrikethroughSRound.js";
|
|
11
|
+
import UndoRound from "@ricons/material/es/UndoRound.js";
|
|
6
12
|
//#region packages/components/editor/controls.tsx
|
|
7
13
|
const { escapeAttrValue } = xss;
|
|
8
14
|
const exec = (a, b, c) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.js","names":["Button","Icon"],"sources":["../../../../packages/components/editor/controls.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"controls.js","names":["Button","Icon"],"sources":["../../../../packages/components/editor/controls.tsx"],"sourcesContent":["import ClearAllRound from \"@ricons/material/es/ClearAllRound.js\";\nimport FormatBoldRound from \"@ricons/material/es/FormatBoldRound.js\";\nimport FormatItalicRound from \"@ricons/material/es/FormatItalicRound.js\";\nimport FormatUnderlinedRound from \"@ricons/material/es/FormatUnderlinedRound.js\";\nimport RedoRound from \"@ricons/material/es/RedoRound.js\";\nimport StrikethroughSRound from \"@ricons/material/es/StrikethroughSRound.js\";\nimport UndoRound from \"@ricons/material/es/UndoRound.js\";\nimport { Fragment } from \"react/jsx-runtime\";\nimport xss from \"xss\";\nimport Button from \"../button\";\nimport Icon from \"../icon\";\n\nconst { escapeAttrValue } = xss as unknown as {\n\tescapeAttrValue: (value: string) => string;\n};\n\nexport const exec = (a, b?, c?) => {\n\tif (typeof document === \"undefined\") return;\n\treturn document.execCommand(a, b, c);\n};\n\nexport const xssOptions = {\n\tonIgnoreTagAttr: function (tag, name, value) {\n\t\tif ([\"data-\", \"style\"].includes(name.substr(0, 5))) {\n\t\t\treturn name + '=\"' + escapeAttrValue(value) + '\"';\n\t\t}\n\t},\n};\n\nconst fnMap = {\n\tbold: {\n\t\ticon: <FormatBoldRound />,\n\t\tonClick: () => exec(\"bold\"),\n\t\ttip: \"粗体\",\n\t},\n\titalic: {\n\t\ticon: <FormatItalicRound />,\n\t\tonClick: () => exec(\"italic\"),\n\t\ttip: \"斜体\",\n\t},\n\tunderline: {\n\t\ticon: <FormatUnderlinedRound />,\n\t\tonClick: () => exec(\"underline\"),\n\t\ttip: \"下划线\",\n\t},\n\tstrike: {\n\t\ticon: <StrikethroughSRound />,\n\t\tonClick: () => exec(\"strikeThrough\"),\n\t\ttip: \"删除线\",\n\t},\n\tredo: {\n\t\ticon: <RedoRound />,\n\t\tonClick: () => exec(\"redo\"),\n\t\ttip: \"重做\",\n\t},\n\tundo: {\n\t\ticon: <UndoRound />,\n\t\tonClick: () => exec(\"undo\"),\n\t\ttip: \"撤销\",\n\t},\n\t// color: {\n\t// \ticon: <FormatColorTextRound />,\n\t// \tonClick: () => exec(\"foreColor\", false, \"\"),\n\t// },\n\t// backColor: {\n\t// \ticon: <FormatColorFillRound />,\n\t// \tonClick: () => exec(\"backColor\", false, \"\"),\n\t// },\n\tclear: {\n\t\ticon: <ClearAllRound />,\n\t\tonClick: () => exec(\"removeFormat\"),\n\t\ttip: \"清除格式\",\n\t},\n};\n\nconst aliasMap = {\n\tsimple: [\"undo\", \"redo\", \"bold\", \"italic\", \"underline\", \"strike\", \"clear\"],\n\tall: Object.keys(fnMap),\n};\n\nexport default function getControls(fns, options) {\n\tconst { controlBtnProps } = options;\n\tconst keys = typeof fns === \"string\" ? aliasMap[fns] : fns;\n\n\treturn keys.map((k) => {\n\t\tif (fnMap[k]) {\n\t\t\tconst { icon, render, tip, onClick } = fnMap[k];\n\n\t\t\tif (render) {\n\t\t\t\treturn render(options);\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<Button key={k} {...controlBtnProps} onClick={onClick}>\n\t\t\t\t\t<Icon icon={icon} />\n\t\t\t\t\t{tip && <span className='i-editor-control-tip'>{tip}</span>}\n\t\t\t\t</Button>\n\t\t\t);\n\t\t}\n\t\treturn <Fragment key={k} />;\n\t});\n}\n"],"mappings":";;;;;;;;;;;;AAYA,MAAM,EAAE,oBAAoB;AAI5B,MAAa,QAAQ,GAAG,GAAI,MAAO;AAClC,KAAI,OAAO,aAAa,YAAa;AACrC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;AAGvB,UACC,qBAACA,gBAAD;IAAgB,GAAI;IAA0B;cAA9C,CACC,oBAACC,cAAD,EAAY,MAAQ,CAAA,EACnB,OAAO,oBAAC,QAAD;KAAM,WAAU;eAAwB;KAAW,CAAA,CACnD;MAHI,EAGJ;;AAGX,SAAO,oBAAC,UAAD,EAAoB,EAAL,EAAK;GAC1B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Context from "./context.js";
|
|
2
2
|
import { Children, cloneElement, isValidElement, useContext, useEffect, useMemo, useState } from "react";
|
|
3
|
-
import PubSub from "
|
|
3
|
+
import PubSub from "pubsub-js";
|
|
4
4
|
//#region packages/components/form/field.tsx
|
|
5
5
|
function Field(props) {
|
|
6
6
|
const { name, required, children } = props;
|
|
@@ -5,7 +5,7 @@ import useConfig from "./useConfig.js";
|
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import { useEffect, useMemo } from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
import PubSub from "
|
|
8
|
+
import PubSub from "pubsub-js";
|
|
9
9
|
//#region packages/components/form/form.tsx
|
|
10
10
|
const Form = (props) => {
|
|
11
11
|
const { form = {}, rules, initialValues, style, className, width, columns, itemMaxWidth, gap = "1em", labelInline, labelWidth, labelRight, children, onKeyDown, onEnter, onChange, ...restProps } = props;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { uid } from "
|
|
1
|
+
import { uid } from "radash";
|
|
2
2
|
import { useRef } from "react";
|
|
3
|
-
import PubSub from "
|
|
3
|
+
import PubSub from "pubsub-js";
|
|
4
4
|
//#region packages/components/form/useForm.ts
|
|
5
5
|
var IFormInstance = class {
|
|
6
6
|
id;
|
|
@@ -5,8 +5,9 @@ import Range from "./range.js";
|
|
|
5
5
|
import Textarea from "./textarea.js";
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import { useEffect, useMemo, useState } from "react";
|
|
8
|
-
import { VisibilityOffRound, VisibilityRound } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
9
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import VisibilityOffRound from "@ricons/material/es/VisibilityOffRound.js";
|
|
10
|
+
import VisibilityRound from "@ricons/material/es/VisibilityRound.js";
|
|
10
11
|
//#region packages/components/input/input.tsx
|
|
11
12
|
const Input = ((props) => {
|
|
12
13
|
const { ref, type = "text", label, name, value = "", prepend, append, labelInline, className, status = "normal", message, tip, clear, width, hideVisible, border, underline, required, maxLength, onChange, onEnter, onClear, style, ...restProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","names":[],"sources":["../../../../packages/components/input/input.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"input.js","names":[],"sources":["../../../../packages/components/input/input.tsx"],"sourcesContent":["import VisibilityOffRound from \"@ricons/material/es/VisibilityOffRound.js\";\nimport VisibilityRound from \"@ricons/material/es/VisibilityRound.js\";\nimport classNames from \"classnames\";\nimport {\n\tChangeEvent,\n\tuseEffect,\n\tuseMemo,\n\tuseState,\n\ttype KeyboardEvent,\n} from \"react\";\nimport \"../../css/input.css\";\nimport Helpericon from \"../utils/helpericon\";\nimport InputContainer from \"./container\";\nimport Number from \"./number\";\nimport Range from \"./range\";\nimport Textarea from \"./textarea\";\nimport type { CompositionInput, IInput } from \"./type\";\n\nconst Input = ((props: IInput) => {\n\tconst {\n\t\tref,\n\t\ttype = \"text\",\n\t\tlabel,\n\t\tname,\n\t\tvalue = \"\",\n\t\tprepend,\n\t\tappend,\n\t\tlabelInline,\n\t\tclassName,\n\t\tstatus = \"normal\",\n\t\tmessage,\n\t\ttip,\n\t\tclear,\n\t\twidth,\n\t\thideVisible,\n\t\tborder,\n\t\tunderline,\n\t\trequired,\n\t\tmaxLength,\n\t\tonChange,\n\t\tonEnter,\n\t\tonClear,\n\t\tstyle,\n\t\t...restProps\n\t} = props;\n\n\tconst [inputValue, setInputValue] = useState(value);\n\tconst [inputType, setInputType] = useState(type);\n\tconst [visible, setVisible] = useState(false);\n\n\tconst handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n\t\tconst v = e.target.value;\n\n\t\tsetInputValue(v);\n\t\tonChange?.(v, e);\n\t};\n\n\tconst handleKeydown = (e: KeyboardEvent<HTMLInputElement>) => {\n\t\te.code === \"Enter\" && onEnter?.(e);\n\t};\n\n\tconst handleHelperClick = () => {\n\t\tif (type === \"password\" && !hideVisible) {\n\t\t\tsetVisible((v) => {\n\t\t\t\tconst next = !v;\n\t\t\t\tsetInputType(next ? \"text\" : \"password\");\n\t\t\t\treturn next;\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst v = \"\";\n\t\tsetInputValue(v);\n\t\tonChange?.(v);\n\t\tonClear?.();\n\t};\n\n\tconst HelperIcon = useMemo(() => {\n\t\tif (type === \"password\") {\n\t\t\treturn visible ? <VisibilityRound /> : <VisibilityOffRound />;\n\t\t}\n\n\t\treturn undefined;\n\t}, [type, visible]);\n\n\tuseEffect(() => {\n\t\tsetInputValue(value);\n\t}, [value]);\n\n\tconst inputProps = {\n\t\tref,\n\t\ttype: inputType,\n\t\tname,\n\t\tvalue: inputValue,\n\t\tmaxLength,\n\t\tclassName: classNames(\"i-input\", `i-input-${type}`),\n\t\tonChange: handleChange,\n\t\tonKeyDown: handleKeydown,\n\t\t...restProps,\n\t};\n\n\tuseEffect(() => {\n\t\tsetInputType(type);\n\t\tsetVisible(false);\n\t}, [type]);\n\n\tconst clearable = clear && inputValue;\n\tconst showHelper = type === \"password\" && !!inputValue;\n\n\treturn (\n\t\t<InputContainer\n\t\t\tlabel={label}\n\t\t\tlabelInline={labelInline}\n\t\t\tclassName={className}\n\t\t\tstyle={{ width, ...style }}\n\t\t\ttip={message ?? tip}\n\t\t\tstatus={status}\n\t\t\trequired={required}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-input-item\", {\n\t\t\t\t\t[`i-input-${status}`]: status !== \"normal\",\n\t\t\t\t\t\"i-input-borderless\": !border,\n\t\t\t\t\t\"i-input-underline\": underline,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{prepend && <div className='i-input-prepend'>{prepend}</div>}\n\n\t\t\t\t<input {...inputProps} />\n\n\t\t\t\t{maxLength && inputValue?.length > 0 && (\n\t\t\t\t\t<span className='color-8 pr-4 font-sm'>\n\t\t\t\t\t\t{inputValue.length} / {maxLength}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\n\t\t\t\t<Helpericon\n\t\t\t\t\tactive={!!clearable || showHelper}\n\t\t\t\t\ticon={HelperIcon}\n\t\t\t\t\tonClick={handleHelperClick}\n\t\t\t\t/>\n\n\t\t\t\t{append && <div className='i-input-append'>{append}</div>}\n\t\t\t</div>\n\t\t</InputContainer>\n\t);\n}) as CompositionInput;\n\nInput.Textarea = Textarea;\nInput.Number = Number;\nInput.Range = Range;\n\nexport default Input;\n"],"mappings":";;;;;;;;;;;AAkBA,MAAM,UAAU,UAAkB;CACjC,MAAM,EACL,KACA,OAAO,QACP,OACA,MACA,QAAQ,IACR,SACA,QACA,aACA,WACA,SAAS,UACT,SACA,KACA,OACA,OACA,aACA,QACA,WACA,UACA,WACA,UACA,SACA,SACA,OACA,GAAG,cACA;CAEJ,MAAM,CAAC,YAAY,iBAAiB,SAAS,MAAM;CACnD,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAChD,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAE7C,MAAM,gBAAgB,MAAqC;EAC1D,MAAM,IAAI,EAAE,OAAO;AAEnB,gBAAc,EAAE;AAChB,aAAW,GAAG,EAAE;;CAGjB,MAAM,iBAAiB,MAAuC;AAC7D,IAAE,SAAS,WAAW,UAAU,EAAE;;CAGnC,MAAM,0BAA0B;AAC/B,MAAI,SAAS,cAAc,CAAC,aAAa;AACxC,eAAY,MAAM;IACjB,MAAM,OAAO,CAAC;AACd,iBAAa,OAAO,SAAS,WAAW;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import helpericon_default from "../utils/helpericon/index.js";
|
|
|
3
3
|
import InputContainer from "./container.js";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { useEffect, useState } from "react";
|
|
6
|
-
import { KeyboardDoubleArrowUpRound, MinusRound, PlusRound } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import MinusRound from "@ricons/material/es/MinusRound.js";
|
|
8
|
+
import PlusRound from "@ricons/material/es/PlusRound.js";
|
|
9
|
+
import KeyboardDoubleArrowUpRound from "@ricons/material/es/KeyboardDoubleArrowUpRound.js";
|
|
8
10
|
//#region packages/components/input/number.tsx
|
|
9
11
|
const Number = (props) => {
|
|
10
12
|
const { ref, label, name, value = "", labelInline, step = 1, min = -Infinity, max = Infinity, thousand, precision, type, className, width, status = "normal", append, border, prepend, disabled, message, tip, hideControl, showMax, style, onChange, onEnter, onInput, onBlur, ...restProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","names":[],"sources":["../../../../packages/components/input/number.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"number.js","names":[],"sources":["../../../../packages/components/input/number.tsx"],"sourcesContent":["import KeyboardDoubleArrowUpRound from \"@ricons/material/es/KeyboardDoubleArrowUpRound.js\";\nimport MinusRound from \"@ricons/material/es/MinusRound.js\";\nimport PlusRound from \"@ricons/material/es/PlusRound.js\";\nimport classNames from \"classnames\";\nimport {\n\tChangeEvent,\n\tuseEffect,\n\tuseState,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n} from \"react\";\nimport \"../../css/input.css\";\nimport { clamp, formatNumber } from \"../../js/utils\";\nimport Helpericon from \"../utils/helpericon\";\nimport InputContainer from \"./container\";\nimport type { IInputNumber } from \"./type\";\n\nconst Number = (props: IInputNumber) => {\n\tconst {\n\t\tref,\n\t\tlabel,\n\t\tname,\n\t\tvalue = \"\",\n\t\tlabelInline,\n\t\tstep = 1,\n\t\tmin = -Infinity,\n\t\tmax = Infinity,\n\t\tthousand,\n\t\tprecision,\n\t\ttype,\n\t\tclassName,\n\t\twidth,\n\t\tstatus = \"normal\",\n\t\tappend,\n\t\tborder,\n\t\tprepend,\n\t\tdisabled,\n\t\tmessage,\n\t\ttip,\n\t\thideControl,\n\t\tshowMax,\n\t\tstyle,\n\t\tonChange,\n\t\tonEnter,\n\t\tonInput,\n\t\tonBlur,\n\t\t...restProps\n\t} = props;\n\n\tconst [inputValue, setInputValue] = useState<string>(\n\t\tvalue === undefined || value === null ? \"\" : String(value),\n\t);\n\n\tconst formatOut = (num: number) => {\n\t\tconst v = clamp(num, min, max);\n\t\tif (precision !== undefined)\n\t\t\treturn formatNumber(v, { precision, thousand });\n\t\tconst s = String(v);\n\t\tif (!thousand) return s;\n\t\tconst negative = s.startsWith(\"-\");\n\t\tconst body = negative ? s.slice(1) : s;\n\t\tconst [integer, decimal] = body.split(\".\");\n\t\tconst withThousand = integer.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousand);\n\t\treturn decimal\n\t\t\t? `${negative ? \"-\" : \"\"}${withThousand}.${decimal}`\n\t\t\t: `${negative ? \"-\" : \"\"}${withThousand}`;\n\t};\n\n\tconst sanitizeNumberInput = (raw: string) => {\n\t\tconst hasMinus = raw.startsWith(\"-\");\n\t\tlet v = raw.replace(/[^\\d.]/g, \"\");\n\t\tif (hasMinus) v = `-${v}`;\n\n\t\tconst parts = v.split(\".\");\n\t\tif (parts.length > 1) {\n\t\t\tv = `${parts.shift()}.${parts.join(\"\")}`;\n\t\t}\n\n\t\treturn v;\n\t};\n\n\tconst formatInputValue = (v?: string | number) => {\n\t\tif (!v) return \"\";\n\t\tif (typeof v === \"number\") return v.toString();\n\t\tif (!thousand) return v;\n\n\t\treturn v.split(thousand).join(\"\");\n\t};\n\n\tconst handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n\t\tconst { value } = e.target;\n\t\tconst v = sanitizeNumberInput(formatInputValue(value));\n\t\tconst isIntermediate =\n\t\t\tv === \"\" || v === \"-\" || v === \".\" || v === \"-.\" || v.endsWith(\".\");\n\n\t\tsetInputValue(v);\n\t\tif (isIntermediate) return;\n\n\t\tconst num = parseFloat(v);\n\t\tif (globalThis.Number.isNaN(num)) return;\n\n\t\tonChange?.(clamp(num, min, max), e);\n\t\tif (precision !== undefined) setInputValue(formatOut(num));\n\t};\n\n\tconst handleOperate = (param: number) => {\n\t\tconst value = parseFloat(formatInputValue(inputValue)) || 0; // 确保值为数字,默认值为 0\n\t\tconst result = value + param;\n\t\tsetInputValue(formatOut(result));\n\t\tonChange?.(clamp(result, min, max));\n\t};\n\n\tconst handleMax = () => {\n\t\tsetInputValue(formatOut(max));\n\t\tonChange?.(clamp(max, min, max));\n\t};\n\n\tconst handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n\t\tonBlur?.(e);\n\n\t\tconst v = sanitizeNumberInput(formatInputValue(inputValue));\n\t\tif (!v || v === \"-\" || v === \".\" || v === \"-.\") {\n\t\t\tsetInputValue(\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst num = parseFloat(v);\n\t\tif (globalThis.Number.isNaN(num)) return;\n\n\t\tconst numValue = clamp(num, min, max);\n\t\tsetInputValue(formatOut(numValue));\n\t\tonChange?.(numValue, e);\n\t};\n\n\tuseEffect(() => {\n\t\tsetInputValue(\n\t\t\tvalue === undefined || value === null ? \"\" : String(value),\n\t\t);\n\t}, [value]);\n\n\tconst inputProps = {\n\t\tref,\n\t\tname,\n\t\tdisabled,\n\t\tvalue: inputValue,\n\t\tclassName: \"i-input i-input-number\",\n\t\tonChange: handleChange,\n\t\tonKeyDown: (e: KeyboardEvent<HTMLInputElement>) => {\n\t\t\te.code === \"Enter\" && onEnter?.(e);\n\t\t},\n\t\tonInput,\n\t\tonBlur: handleBlur,\n\t\t...restProps,\n\t};\n\n\treturn (\n\t\t<InputContainer\n\t\t\tlabel={label}\n\t\t\tlabelInline={labelInline}\n\t\t\tclassName={className}\n\t\t\tstyle={{ width, ...style }}\n\t\t\ttip={message ?? tip}\n\t\t\tstatus={status}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-input-item\", {\n\t\t\t\t\t[`i-input-${status}`]: status !== \"normal\",\n\t\t\t\t\t\"i-input-borderless\": !border,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{prepend && <div className='i-input-prepend'>{prepend}</div>}\n\n\t\t\t\t{!hideControl && !disabled && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<MinusRound />}\n\t\t\t\t\t\tonClick={() => handleOperate(-step)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t<input {...inputProps} />\n\n\t\t\t\t{!hideControl && !disabled && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<PlusRound />}\n\t\t\t\t\t\tonClick={() => handleOperate(step)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{showMax && max && !disabled && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<KeyboardDoubleArrowUpRound />}\n\t\t\t\t\t\tonClick={handleMax}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{append && <div className='i-input-append'>{append}</div>}\n\t\t\t</div>\n\t\t</InputContainer>\n\t);\n};\n\nexport default Number;\n"],"mappings":";;;;;;;;;;AAiBA,MAAM,UAAU,UAAwB;CACvC,MAAM,EACL,KACA,OACA,MACA,QAAQ,IACR,aACA,OAAO,GACP,MAAM,WACN,MAAM,UACN,UACA,WACA,MACA,WACA,OACA,SAAS,UACT,QACA,QACA,SACA,UACA,SACA,KACA,aACA,SACA,OACA,UACA,SACA,SACA,QACA,GAAG,cACA;CAEJ,MAAM,CAAC,YAAY,iBAAiB,SACnC,UAAU,KAAA,KAAa,UAAU,OAAO,KAAK,OAAO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IAE3D,CAAC,eAAe,CAAC,YACjB,oBAAC,oBAAD;KACC,QAAA;KACA,MAAM,oBAAC,YAAD,EAAc,CAAA;KACpB,eAAe,cAAc,CAAC,KAAK;KACnC,CAAA;IAGF,oBAAC,SAAD,EAAO,GAAI,YAAa,CAAA;IAEvB,CAAC,eAAe,CAAC,YACjB,oBAAC,oBAAD;KACC,QAAA;KACA,MAAM,oBAAC,WAAD,EAAa,CAAA;KACnB,eAAe,cAAc,KAAK;KAClC,CAAA;IAGD,WAAW,OAAO,CAAC,YACnB,oBAAC,oBAAD;KACC,QAAA;KACA,MAAM,oBAAC,4BAAD,EAA8B,CAAA;KACpC,SAAS;KACT,CAAA;IAGD,UAAU,oBAAC,OAAD;KAAK,WAAU;eAAkB;KAAa,CAAA;IACrD;;EACU,CAAA"}
|
|
@@ -3,8 +3,10 @@ import helpericon_default from "../utils/helpericon/index.js";
|
|
|
3
3
|
import InputContainer from "./container.js";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { useEffect, useState } from "react";
|
|
6
|
-
import { MinusRound, PlusRound, SyncAltRound } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import MinusRound from "@ricons/material/es/MinusRound.js";
|
|
8
|
+
import PlusRound from "@ricons/material/es/PlusRound.js";
|
|
9
|
+
import SyncAltRound from "@ricons/material/es/SyncAltRound.js";
|
|
8
10
|
//#region packages/components/input/range.tsx
|
|
9
11
|
const Range = (props) => {
|
|
10
12
|
const { label, name, value, labelInline, min = -Infinity, max = Infinity, type, className, status = "normal", message, tip, append, prepend, step = 1, width, thousand, precision, hideControl, placeholder, border, autoSwitch, onChange, onBlur, style, ...restProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range.js","names":[],"sources":["../../../../packages/components/input/range.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"range.js","names":[],"sources":["../../../../packages/components/input/range.tsx"],"sourcesContent":["import MinusRound from \"@ricons/material/es/MinusRound.js\";\nimport PlusRound from \"@ricons/material/es/PlusRound.js\";\nimport SyncAltRound from \"@ricons/material/es/SyncAltRound.js\";\nimport classNames from \"classnames\";\nimport { ChangeEvent, MouseEvent, useEffect, useState } from \"react\";\nimport \"../../css/input.css\";\nimport { clamp, formatNumber } from \"../../js/utils\";\nimport Helpericon from \"../utils/helpericon\";\nimport InputContainer from \"./container\";\nimport type { IInputRange } from \"./type\";\n\nconst Range = (props: IInputRange) => {\n\tconst {\n\t\tlabel,\n\t\tname,\n\t\tvalue,\n\t\tlabelInline,\n\t\tmin = -Infinity,\n\t\tmax = Infinity,\n\t\ttype,\n\t\tclassName,\n\t\tstatus = \"normal\",\n\t\tmessage,\n\t\ttip,\n\t\tappend,\n\t\tprepend,\n\t\tstep = 1,\n\t\twidth,\n\t\tthousand,\n\t\tprecision,\n\t\thideControl,\n\t\tplaceholder,\n\t\tborder,\n\t\tautoSwitch,\n\t\tonChange,\n\t\tonBlur,\n\t\tstyle,\n\t\t...restProps\n\t} = props;\n\n\tconst [rangeValue, setRangeValue] = useState(value);\n\n\tconst getRangeNumber = (v: number) => clamp(v, min, max);\n\n\tconst getFormatNumber = (v: number) =>\n\t\tformatNumber(v, { precision, thousand });\n\n\tconst formatInputValue = (v?: string | number) => {\n\t\tif (!v) return \"\";\n\t\tif (typeof v === \"number\" || !thousand) return v;\n\n\t\treturn v.replaceAll(thousand, \"\");\n\t};\n\n\tconst handleChange = (e: ChangeEvent<HTMLInputElement>, i: number) => {\n\t\tconst { value } = e.target;\n\t\tconst v = formatInputValue(value.replace(/[^\\d\\.-]/g, \"\"));\n\t\tconst range = Array.isArray(rangeValue) ? [...rangeValue] : [];\n\n\t\trange[i] = v;\n\t\tsetRangeValue(range);\n\t\tonChange?.(range, e);\n\t};\n\n\tconst handleOperate = (\n\t\te: MouseEvent<Element>,\n\t\tparam: number,\n\t\ti: number\n\t) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tconst range = Array.isArray(rangeValue) ? [...rangeValue] : [];\n\t\tconst value = formatInputValue(range[i]) ?? 0;\n\t\tconst result = getRangeNumber(+value + param);\n\n\t\trange[i] = getFormatNumber(result);\n\n\t\tsetRangeValue(range);\n\t\tonChange?.(range, e);\n\t};\n\n\tconst handleSwitch = (e?: MouseEvent) => {\n\t\te?.preventDefault();\n\t\te?.stopPropagation();\n\t\tconst range = Array.isArray(rangeValue) ? [...rangeValue] : [];\n\t\t[range[0], range[1]] = [range[1], range[0]];\n\n\t\tsetRangeValue(range);\n\t\tonChange?.(range);\n\t};\n\n\tuseEffect(() => {\n\t\tsetRangeValue(value);\n\t}, [value]);\n\n\tconst inputProps = {\n\t\tname,\n\t\tclassName: \"i-input i-input-number\",\n\t\t...restProps,\n\t};\n\n\tconst handleBlur = () => {\n\t\tif (!autoSwitch) return;\n\t\tconst range = Array.isArray(rangeValue) ? rangeValue : [];\n\n\t\tif (range.length < 2) return;\n\n\t\tconst [left, right] = range.map(Number);\n\t\tif (left > right) {\n\t\t\thandleSwitch();\n\t\t}\n\t};\n\n\treturn (\n\t\t<InputContainer\n\t\t\tlabel={label}\n\t\t\tlabelInline={labelInline}\n\t\t\tclassName={className}\n\t\t\tstyle={{ width, ...style }}\n\t\t\ttip={message ?? tip}\n\t\t\tstatus={status}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-input-item\", {\n\t\t\t\t\t[`i-input-${status}`]: status !== \"normal\",\n\t\t\t\t\t\"i-input-borderless\": !border,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{prepend && <div className='i-input-prepend'>{prepend}</div>}\n\n\t\t\t\t{!hideControl && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<MinusRound />}\n\t\t\t\t\t\tonClick={(e) => handleOperate(e, -step, 0)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t<input\n\t\t\t\t\tvalue={rangeValue?.[0] || \"\"}\n\t\t\t\t\tplaceholder={placeholder?.[0]}\n\t\t\t\t\t{...inputProps}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tonChange={(e) => handleChange(e, 0)}\n\t\t\t\t/>\n\n\t\t\t\t{!hideControl && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<PlusRound />}\n\t\t\t\t\t\tonClick={(e) => handleOperate(e, step, 0)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<Helpericon\n\t\t\t\t\tactive\n\t\t\t\t\ticon={<SyncAltRound />}\n\t\t\t\t\tstyle={{ margin: 0 }}\n\t\t\t\t\tonClick={handleSwitch}\n\t\t\t\t/>\n\t\t\t\t{!hideControl && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<MinusRound />}\n\t\t\t\t\t\tonClick={(e) => handleOperate(e, -step, 1)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t<input\n\t\t\t\t\tvalue={rangeValue?.[1] || \"\"}\n\t\t\t\t\tplaceholder={placeholder?.[1]}\n\t\t\t\t\t{...inputProps}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tonChange={(e) => handleChange(e, 1)}\n\t\t\t\t/>\n\n\t\t\t\t{!hideControl && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<PlusRound />}\n\t\t\t\t\t\tonClick={(e) => handleOperate(e, step, 1)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{append && <div className='i-input-append'>{append}</div>}\n\t\t\t</div>\n\t\t</InputContainer>\n\t);\n};\n\nexport default Range;\n"],"mappings":";;;;;;;;;;AAWA,MAAM,SAAS,UAAuB;CACrC,MAAM,EACL,OACA,MACA,OACA,aACA,MAAM,WACN,MAAM,UACN,MACA,WACA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KACC,OAAO,aAAa,MAAM;KAC1B,aAAa,cAAc;KAC3B,GAAI;KACJ,QAAQ;KACR,WAAW,MAAM,aAAa,GAAG,EAAE;KACnC,CAAA;IAEA,CAAC,eACD,oBAAC,oBAAD;KACC,QAAA;KACA,MAAM,oBAAC,WAAD,EAAa,CAAA;KACnB,UAAU,MAAM,cAAc,GAAG,MAAM,EAAE;KACzC,CAAA;IAGD,UAAU,oBAAC,OAAD;KAAK,WAAU;eAAkB;KAAa,CAAA;IACrD;;EACU,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useReactive } from "../../js/hooks.js";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import { uid } from "
|
|
3
|
+
import { uid } from "radash";
|
|
4
4
|
import { isValidElement, useEffect, useRef } from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { createRoot } from "
|
|
6
|
+
import { createRoot } from "react-dom/client";
|
|
7
7
|
//#region packages/components/message/message.tsx
|
|
8
8
|
const AlignMap = {
|
|
9
9
|
left: "flex-start",
|
|
@@ -2,8 +2,10 @@ import icon_default from "../icon/index.js";
|
|
|
2
2
|
import Page from "./page.js";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { useEffect, useMemo, useState } from "react";
|
|
5
|
-
import { KeyboardArrowLeftRound, KeyboardArrowRightRound, MoreHorizRound } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
6
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import KeyboardArrowLeftRound from "@ricons/material/es/KeyboardArrowLeftRound.js";
|
|
7
|
+
import KeyboardArrowRightRound from "@ricons/material/es/KeyboardArrowRightRound.js";
|
|
8
|
+
import MoreHorizRound from "@ricons/material/es/MoreHorizRound.js";
|
|
7
9
|
//#region packages/components/pagination/pagination.tsx
|
|
8
10
|
const Pagination = (props) => {
|
|
9
11
|
const { page: defaultPage = 1, size = 10, total = 0, sibling = 2, prev = /* @__PURE__ */ jsx(icon_default, { icon: /* @__PURE__ */ jsx(KeyboardArrowLeftRound, {}) }), next = /* @__PURE__ */ jsx(icon_default, { icon: /* @__PURE__ */ jsx(KeyboardArrowRightRound, {}) }), simple, jumper, className, renderEllipsis = () => /* @__PURE__ */ jsx(icon_default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","names":[],"sources":["../../../../packages/components/pagination/pagination.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"pagination.js","names":[],"sources":["../../../../packages/components/pagination/pagination.tsx"],"sourcesContent":["import KeyboardArrowLeftRound from \"@ricons/material/es/KeyboardArrowLeftRound.js\";\nimport KeyboardArrowRightRound from \"@ricons/material/es/KeyboardArrowRightRound.js\";\nimport MoreHorizRound from \"@ricons/material/es/MoreHorizRound.js\";\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\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\tif (totalPage <= page && page === 1) return <></>;\n\n\treturn (\n\t\t<div className={classNames(\"i-pagination\", className)} {...restProps}>\n\t\t\t{prev && (\n\t\t\t\t<Page\n\t\t\t\t\tpage={page - 1 || 1}\n\t\t\t\t\tdisabled={page === 1}\n\t\t\t\t\tonChange={handlePageChange}\n\t\t\t\t>\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\n\t\t\t\t\tpage={page + 1}\n\t\t\t\t\tdisabled={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S;IACR;;AAGH,iBAAgB,QAAQ,YAAY,EAAE,CAAC,YAAY,CAAC;AAEpD,KAAI,aAAa,QAAQ,SAAS,EAAG,QAAO,oBAAA,YAAA,EAAK,CAAA;AAEjD,QACC,qBAAC,OAAD;EAAK,WAAW,WAAW,gBAAgB,UAAU;EAAE,GAAI;YAA3D;GACE,QACA,oBAAC,MAAD;IACC,MAAM,OAAO,KAAK;IAClB,UAAU,SAAS;IACnB,UAAU;cAET;IACI,CAAA;GAGN,QAAQ,KACR,oBAAC,MAAD;IAAM,MAAM;IAAG,UAAU;cACvB,WAAW,EAAE;IACT,CAAA;GAGN,QAAQ,KAAK,gBAAgB;GAE7B,KAAK,KAAK,MAAM;AAChB,WACC,oBAAC,MAAD;KAEC,MAAM;KACN,QAAQ,MAAM;KACd,UAAU;eAET,WAAW,EAAE;KACT,EANA,EAMA;KAEN;GAED,MAAM,YAAY,KAAK,gBAAgB;GAEvC,MAAM,aACN,oBAAC,MAAD;IAAM,MAAM;IAAW,UAAU;cAC/B,WAAW,UAAU;IACjB,CAAA;GAGN,QACA,oBAAC,MAAD;IACC,MAAM,OAAO;IACb,UAAU,SAAS;IACnB,UAAU;cAET;IACI,CAAA;GAEH"}
|
|
@@ -3,8 +3,8 @@ import icon_default from "../../icon/index.js";
|
|
|
3
3
|
import input_default from "../../input/index.js";
|
|
4
4
|
import select_default from "../../select/index.js";
|
|
5
5
|
import { useEffect, useState } from "react";
|
|
6
|
-
import { CheckRound } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import CheckRound from "@ricons/material/es/CheckRound.js";
|
|
8
8
|
//#region packages/components/picker/colors/footer.tsx
|
|
9
9
|
const ColorMethods = {
|
|
10
10
|
HEX: "toHexString",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.js","names":["Select","Input","Button","Icon"],"sources":["../../../../../packages/components/picker/colors/footer.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"footer.js","names":["Select","Input","Button","Icon"],"sources":["../../../../../packages/components/picker/colors/footer.tsx"],"sourcesContent":["import CheckRound from \"@ricons/material/es/CheckRound.js\";\nimport { useEffect, useState } from \"react\";\nimport Button from \"../../button\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Select from \"../../select\";\n\nexport const ColorMethods = {\n\tHEX: \"toHexString\",\n\tRGB: \"toRgbString\",\n\tHSB: \"toHsbString\",\n};\n\nexport default function Footer(props) {\n\tconst { value, type, onTypeChange, onChange, onOk } = props;\n\tconst [inputValue, setInputValue] = useState(value);\n\tconst [colorType, setColorType] = useState(type);\n\n\tconst handleChange = (v) => {\n\t\tsetInputValue(v);\n\t\tonChange(v);\n\t};\n\n\tconst handleTypeChange = (t) => {\n\t\tsetColorType(t);\n\t\tonTypeChange(t);\n\t};\n\n\tuseEffect(() => {\n\t\tsetInputValue(value);\n\t\tsetColorType(type);\n\t}, [value, type]);\n\n\treturn (\n\t\t<div className='i-colorpicker-footer'>\n\t\t\t<Select\n\t\t\t\treadOnly\n\t\t\t\thideClear\n\t\t\t\thideArrow\n\t\t\t\tstyle={{ width: \"5.6em\" }}\n\t\t\t\toptions={[\"RGB\", \"HEX\", \"HSB\"]}\n\t\t\t\tvalue={colorType}\n\t\t\t\tonChange={handleTypeChange}\n\t\t\t/>\n\t\t\t<Input\n\t\t\t\tplaceholder='color'\n\t\t\t\tvalue={inputValue}\n\t\t\t\tonChange={handleChange}\n\t\t\t/>\n\t\t\t<Button square onClick={onOk}>\n\t\t\t\t<Icon icon={<CheckRound />} />\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAOA,MAAa,eAAe;CAC3B,KAAK;CACL,KAAK;CACL,KAAK;CACL;AAED,SAAwB,OAAO,OAAO;CACrC,MAAM,EAAE,OAAO,MAAM,cAAc,UAAU,SAAS;CACtD,MAAM,CAAC,YAAY,iBAAiB,SAAS,MAAM;CACnD,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAEhD,MAAM,gBAAgB,MAAM;AAC3B,gBAAc,EAAE;AAChB,WAAS,EAAE;;CAGZ,MAAM,oBAAoB,MAAM;AAC/B,eAAa,EAAE;AACf,eAAa,EAAE;;AAGhB,iBAAgB;AACf,gBAAc,MAAM;AACpB,eAAa,KAAK;IAChB,CAAC,OAAO,KAAK,CAAC;AAEjB,QACC,qBAAC,OAAD;EAAK,WAAU;YAAf;GACC,oBAACA,gBAAD;IACC,UAAA;IACA,WAAA;IACA,WAAA;IACA,OAAO,EAAE,OAAO,SAAS;IACzB,SAAS;KAAC;KAAO;KAAO;KAAM;IAC9B,OAAO;IACP,UAAU;IACT,CAAA;GACF,oBAACC,eAAD;IACC,aAAY;IACZ,OAAO;IACP,UAAU;IACT,CAAA;GACF,oBAACC,gBAAD;IAAQ,QAAA;IAAO,SAAS;cACvB,oBAACC,cAAD,EAAM,MAAM,oBAAC,YAAD,EAAc,CAAA,EAAI,CAAA;IACtB,CAAA;GACJ"}
|
|
@@ -4,10 +4,10 @@ import input_default from "../../input/index.js";
|
|
|
4
4
|
import Panel from "./panel.js";
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import { useEffect, useMemo, useState } from "react";
|
|
7
|
-
import { CalendarMonthTwotone } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
8
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import CalendarMonthTwotone from "@ricons/material/es/CalendarMonthTwotone.js";
|
|
9
9
|
import dayjs from "dayjs";
|
|
10
|
-
import customParseFormat from "
|
|
10
|
+
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
11
11
|
//#region packages/components/picker/dates/index.tsx
|
|
12
12
|
dayjs.extend(customParseFormat);
|
|
13
13
|
const FORMATTYPES = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../packages/components/picker/dates/index.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../packages/components/picker/dates/index.tsx"],"sourcesContent":["import CalendarMonthTwotone from \"@ricons/material/es/CalendarMonthTwotone.js\";\nimport classNames from \"classnames\";\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\tclassName,\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 [inputValue, setInputValue] = useState(value);\n\n\tconst [active, setActive] = useState<boolean>(false);\n\n\tconst dayJsValue = useMemo(() => {\n\t\tif (!inputValue) return null;\n\n\t\tconst date = dayjs(inputValue as string, format, true);\n\n\t\tif (date.isValid()) return date;\n\n\t\treturn null;\n\t}, [inputValue, format]);\n\n\tconst handleDateClick = (date: Dayjs) => {\n\t\thandleChange(date.format(format));\n\t};\n\n\tconst handleChange = (v) => {\n\t\tsetInputValue(v);\n\t\tonChange?.(v);\n\t};\n\n\tconst handleSetDate = () => {\n\t\tif (!inputValue) return;\n\n\t\tconst date = dayjs(inputValue 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\tsetInputValue(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\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={inputValue}\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\tclassName={classNames(\"i-datepicker-label\", className)}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t</Popup>\n\t);\n};\n\nexport default Datepicker;\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,OAAO,kBAAkB;AAE/B,MAAM,cAAc;CAAC;CAAc;CAAY;CAAc;CAAW;AACxE,MAAM,SAAS;AAEf,MAAM,cAAc,UA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GACV,QAAQ;GACR,SAAS;GACT,WAAW,WAAW,sBAAsB,UAAU;GACtD,GAAI;GACJ,CAAA;EACK,CAAA"}
|
|
@@ -2,10 +2,11 @@ import icon_default from "../../icon/index.js";
|
|
|
2
2
|
import helpericon_default from "../../utils/helpericon/index.js";
|
|
3
3
|
import Dates from "./dates.js";
|
|
4
4
|
import classNames from "classnames";
|
|
5
|
-
import { throttle } from "
|
|
5
|
+
import { throttle } from "radash";
|
|
6
6
|
import { useEffect, useRef, useState } from "react";
|
|
7
|
-
import { KeyboardArrowLeftRound, KeyboardArrowRightRound } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import KeyboardArrowLeftRound from "@ricons/material/es/KeyboardArrowLeftRound.js";
|
|
9
|
+
import KeyboardArrowRightRound from "@ricons/material/es/KeyboardArrowRightRound.js";
|
|
9
10
|
import dayjs from "dayjs";
|
|
10
11
|
//#region packages/components/picker/dates/panel.tsx
|
|
11
12
|
const MONTHS = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.js","names":["Icon","Helpericon"],"sources":["../../../../../packages/components/picker/dates/panel.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"panel.js","names":["Icon","Helpericon"],"sources":["../../../../../packages/components/picker/dates/panel.tsx"],"sourcesContent":["import KeyboardArrowLeftRound from \"@ricons/material/es/KeyboardArrowLeftRound.js\";\nimport KeyboardArrowRightRound from \"@ricons/material/es/KeyboardArrowRightRound.js\";\nimport classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport { throttle } from \"radash\";\nimport { ReactNode, useEffect, useRef, useState } 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 [today, setToday] = useState(value);\n\tconst [month, setMonth] = useState(value || dayjs());\n\tconst [selectedYear, setSelectedYear] = useState(dayjs());\n\tconst [years, setYears] = useState<number[]>([]);\n\tconst [selectable, setSelectable] = useState(false);\n\n\tconst $years = useRef<HTMLDivElement>(null);\n\n\tconst handleOperateMonth = (next: boolean) => {\n\t\tsetMonth((m) => m[next ? \"add\" : \"subtract\"](1, \"month\"));\n\t};\n\n\tconst handleChangeDate = (date: Dayjs) => {\n\t\tif (date.isSame(today, \"day\")) return;\n\n\t\tif (!date.isSame(month, \"month\")) {\n\t\t\tsetMonth(date);\n\t\t}\n\n\t\tsetToday(date);\n\t\tonDateClick?.(date);\n\t};\n\n\tconst handleChangeMonth = (month: number) => {\n\t\tsetMonth((m) => m.year(selectedYear.year()).month(month - 1));\n\t\tsetSelectable(false);\n\t};\n\n\tconst getMoreYears = throttle({ interval: 100 }, (e) => {\n\t\tconst isUp = e.deltaY < 0;\n\n\t\tsetYears((ys) => ys.map((y) => y + (isUp ? -1 : 1)));\n\t});\n\n\tuseEffect(() => {\n\t\tif (!selectable) return;\n\n\t\tsetSelectedYear(month);\n\t\tconst y = month.year();\n\t\tconst nextYears = Array.from({ length: 7 }).map((_, i) => y - 3 + i);\n\n\t\tsetYears([...nextYears]);\n\t}, [selectable, month]);\n\n\tuseEffect(() => {\n\t\tsetToday(value);\n\t\tsetMonth(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={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={() => setSelectable(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\": 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\tsetSelectable(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{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 === selectedYear.year(),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() => setSelectedYear((sy) => sy.year(y))}\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 === 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={today}\n\t\t\t\tmonth={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"],"mappings":";;;;;;;;;;;AAWA,MAAM,SAAS;CAAC;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAI;CAAI;CAAG;AAEtD,MAAM,aACL,UAGI;CACJ,MAAM,EACL,OACA,YAAY,KACZ,WAAW,KACX,YACA,aACA,YACG;AAEJ,QACC,qBAAC,KAAD;EAA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,WAAW,WAAW,sBAAsB,EAC3C,uBACC,MAAM,MAAM,OAAO,GAAG,GACvB,CAAC;QACF,eAAe,kBAAkB,EAAE;kBAElC,YAAY,EAAE;QACZ,EARE,EAQF;QAEJ;MACG,CAAA;KACD;;GAEN,oBAAC,OAAD;IACC,OAAO;IACA;IACO;IACd,aAAa;IACD;IACX,CAAA;GACG"}
|
|
@@ -4,8 +4,8 @@ import input_default from "../../input/index.js";
|
|
|
4
4
|
import Panel from "./panel.js";
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
|
-
import { AccessTimeRound } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
8
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import AccessTimeRound from "@ricons/material/es/AccessTimeRound.js";
|
|
9
9
|
//#region packages/components/picker/time/index.tsx
|
|
10
10
|
const FORMAT = "hh:mm:ss";
|
|
11
11
|
function TimePicker(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Popup","Input","Icon"],"sources":["../../../../../packages/components/picker/time/index.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","names":["Popup","Input","Icon"],"sources":["../../../../../packages/components/picker/time/index.tsx"],"sourcesContent":["import AccessTimeRound from \"@ricons/material/es/AccessTimeRound.js\";\nimport classNames from \"classnames\";\nimport { useEffect, useState } from \"react\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Popup from \"../../popup\";\nimport { ITimePicker } from \"../type\";\nimport Panel from \"./panel\";\n\nconst FORMAT = \"hh:mm:ss\";\n\nexport default function TimePicker(props: ITimePicker) {\n\tconst {\n\t\tname,\n\t\tvalue,\n\t\tformat = FORMAT,\n\t\tperiods,\n\t\tplaceholder = props.format ?? FORMAT,\n\t\tclassName,\n\t\trenderItem,\n\t\tonChange,\n\t\tonBlur,\n\t\tpopupProps,\n\t\t...restProps\n\t} = props;\n\tconst [timeValue, setTimeValue] = useState(value);\n\tconst [safeValue, setSafeValue] = useState(undefined);\n\tconst [active, setActive] = useState<boolean>(false);\n\n\tconst handleChange = (v) => {\n\t\tsetTimeValue(v);\n\t};\n\n\tconst handleFallback = (v) => {\n\t\tsetSafeValue(v);\n\t};\n\n\tconst handleValidTime = () => {\n\t\tif (!timeValue) return;\n\n\t\tsetTimeValue(safeValue);\n\t};\n\n\tconst handleBlur = (e) => {\n\t\tonBlur?.(e);\n\t\thandleValidTime();\n\t};\n\n\tconst handleVisibleChange = (v) => {\n\t\tpopupProps?.onVisibleChange?.(v);\n\t\tsetActive(v);\n\t};\n\n\tuseEffect(() => {\n\t\tsetTimeValue(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\t{...popupProps}\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t\tcontent={\n\t\t\t\t<Panel\n\t\t\t\t\tvalue={timeValue}\n\t\t\t\t\tformat={format}\n\t\t\t\t\tperiods={periods}\n\t\t\t\t\trenderItem={renderItem}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonFallback={handleFallback}\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t<Input\n\t\t\t\tvalue={timeValue}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tappend={\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<AccessTimeRound />}\n\t\t\t\t\t\tclassName='i-timepicker-icon'\n\t\t\t\t\t\tsize='1em'\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tclassName={classNames(\"i-timepicker-label\", className)}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t</Popup>\n\t);\n}\n"],"mappings":";;;;;;;;;AASA,MAAM,SAAS;AAEf,SAAwB,WAAW,OAAoB;CACtD,MAAM,EACL,MACA,OACA,SAAS,QACT,SACA,cAAc,MAAM,UAAU,QAC9B,WACA,YACA,UACA,QACA,YACA,GAAG,cACA;CACJ,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CACjD,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAA,EAAU;CACrD,MAAM,CAAC,QAAQ,aAAa,SAAkB,MAAM;CAEpD,MAAM,gBAAgB,MAAM;AAC3B,eAAa,EAAE;;CAGhB,MAAM,kBAAkB,MAAM;AAC7B,eAAa,EAAE;;CAGhB,MAAM,wBAAwB;AAC7B,MAAI,CAAC,UAAW;AAEhB,eAAa,UAAU;;CAGxB,MAAM,cAAc,MAAM;AACzB,WAAS,EAAE;AACX,mBAAiB;;CAGlB,MAAM,uBAAuB,MAAM;AAClC,cAAY,kBAAkB,EAAE;AAChC,YAAU,EAAE;;AAGb,iBAAgB;AACf,eAAa,MAAM;IACjB,CAAC,MAAM,CAAC;AAEX,QACC,oBAACA,eAAD;EACC,SAAS;EACT,SAAQ;EACR,UAAS;EACT,OAAO;EACP,OAAM;EACN,GAAI;EACJ,iBAAiB;EACjB,SACC,oBAAC,OAAD;GACC,OAAO;GACC;GACC;GACG;GACZ,UAAU;GACV,YAAY;GACX,CAAA;YAGH,oBAACC,eAAD;GACC,OAAO;GACM;GACb,QACC,oBAACC,cAAD;IACC,MAAM,oBAAC,iBAAD,EAAmB,CAAA;IACzB,WAAU;IACV,MAAK;IACJ,CAAA;GAEH,UAAU;GACV,QAAQ;GACR,WAAW,WAAW,sBAAsB,UAAU;GACtD,GAAI;GACH,CAAA;EACK,CAAA"}
|
|
@@ -3,8 +3,8 @@ import button_default from "../button/index.js";
|
|
|
3
3
|
import icon_default from "../icon/index.js";
|
|
4
4
|
import popup_default from "../popup/index.js";
|
|
5
5
|
import flex_default from "../flex/index.js";
|
|
6
|
-
import { InfoOutlined } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import InfoOutlined from "@ricons/material/es/InfoOutlined.js";
|
|
8
8
|
//#region packages/components/popconfirm/popconfirm.tsx
|
|
9
9
|
const defaultOk = { children: "确定" };
|
|
10
10
|
const defaultCancel = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popconfirm.js","names":[],"sources":["../../../../packages/components/popconfirm/popconfirm.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"popconfirm.js","names":[],"sources":["../../../../packages/components/popconfirm/popconfirm.tsx"],"sourcesContent":["import InfoOutlined from \"@ricons/material/es/InfoOutlined.js\";\nimport { MouseEvent } from \"react\";\nimport { useReactive } from \"../../js/hooks\";\nimport Button from \"../button\";\nimport { IButton } from \"../button/type\";\nimport Flex from \"../flex\";\nimport Icon from \"../icon\";\nimport Popup from \"../popup\";\nimport \"./index.css\";\nimport { IPopconfirm } from \"./type\";\n\nconst defaultOk = {\n\tchildren: \"确定\",\n};\n\nconst defaultCancel = {\n\tchildren: \"取消\",\n\tsecondary: true,\n};\n\nconst Popconfirm = (props: IPopconfirm) => {\n\tconst {\n\t\ttrigger = \"click\",\n\t\tvisible,\n\t\ticon = <Icon icon={<InfoOutlined />} className='error' size='1.2em' />,\n\t\tcontent,\n\t\tokButtonProps,\n\t\tcancelButtonProps,\n\t\tchildren,\n\t\talign,\n\t\tposition = \"top\",\n\t\toffset = 12,\n\t\textra,\n\t\tonOk,\n\t\tonClose,\n\t\t...restProps\n\t} = props;\n\n\tconst state = useReactive({\n\t\tloading: false,\n\t\tvisible,\n\t});\n\n\tconst ok: IButton = okButtonProps\n\t\t? Object.assign({}, defaultOk, okButtonProps)\n\t\t: defaultOk;\n\tconst cancel: IButton = cancelButtonProps\n\t\t? Object.assign({}, defaultCancel, cancelButtonProps)\n\t\t: defaultCancel;\n\n\tconst handleVisibleChange = (v: boolean) => {\n\t\tstate.visible = v;\n\t\trestProps.onVisibleChange?.(v);\n\t};\n\n\tconst handleOk = async (e: MouseEvent<HTMLElement>) => {\n\t\tstate.loading = true;\n\t\tok.onClick?.(e);\n\t\ttry {\n\t\t\tawait onOk?.();\n\t\t\tstate.visible = false;\n\t\t} finally {\n\t\t\tstate.loading = false;\n\t\t}\n\t};\n\n\tconst handleCancel = async (e: MouseEvent<HTMLElement>) => {\n\t\tcancel.onClick?.(e);\n\t\tawait onClose?.();\n\t\tstate.visible = false;\n\t};\n\n\tconst popconfirmContent = (\n\t\t<div className='i-popconfirm'>\n\t\t\t<Flex gap='.5em'>\n\t\t\t\t{icon}\n\t\t\t\t<div className='i-popconfirm-content'>{content}</div>\n\t\t\t</Flex>\n\n\t\t\t<Flex gap={12} justify='flex-end' className='i-popconfirm-footer'>\n\t\t\t\t{cancelButtonProps !== null && (\n\t\t\t\t\t<Button {...cancel} onClick={handleCancel} />\n\t\t\t\t)}\n\t\t\t\t{extra}\n\t\t\t\t{okButtonProps !== null && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tloading={state.loading}\n\t\t\t\t\t\t{...ok}\n\t\t\t\t\t\tonClick={handleOk}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Flex>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<Popup\n\t\t\tcontent={popconfirmContent}\n\t\t\t{...restProps}\n\t\t\ttrigger={trigger}\n\t\t\tvisible={state.visible}\n\t\t\talign={align}\n\t\t\toffset={offset}\n\t\t\tposition={position}\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t>\n\t\t\t{children}\n\t\t</Popup>\n\t);\n};\n\nexport default Popconfirm;\n"],"mappings":";;;;;;;;AAWA,MAAM,YAAY,EACjB,UAAU,MACV;AAED,MAAM,gBAAgB;CACrB,UAAU;CACV,WAAW;CACX;AAED,MAAM,cAAc,UAAuB;CAC1C,MAAM,EACL,UAAU,SACV,SACA,OAAO,oBAAC,cAAD;EAAM,MAAM,oBAAC,cAAD,EAAgB,CAAA;EAAE,WAAU;EAAQ,MAAK;EAAU,CAAA,EACtE,SACA,eACA,mBACA,UACA,OACA,WAAW,OACX,SAAS,IACT,OACA,MACA,SACA,GAAG,cACA;CAEJ,MAAM,QAAQ,YAAY;EACzB,SAAS;EACT;EACA,CAAC;CAEF,MAAM,KAAc,gBACjB,OAAO,OAAO,EAAE,EAAE,WAAW,cAAa,GAC1C;CACH,MAAM,SAAkB,oBACrB,OAAO,OAAO,EAAE,EAAE,eAAe,kBAAiB,GAClD;CAEH,MAAM,uBAAuB,MAAe;AAC3C,QAAM,UAAU;AAChB,YAAU,kBAAkB,EAAE;;CAG/B,MAAM,WAAW,OAAO,MAA+B;AACtD,QAAM,UAAU;AAChB,KAAG,UAAU,EAAE;AACf,MAAI;AACH,SAAM,QAAQ;AACd,SAAM,UAAU;YACP;AACT,SAAM,UAAU;;;CAIlB,MAAM,eAAe,OAAO,MAA+B;AAC1D,SAAO,UAAU,EAAE;AACnB,QAAM,WAAW;AACjB,QAAM,UAAU;;AA0BjB,QACC,oBAAC,eAAD;EACC,SAxBD,qBAAC,OAAD;GAAK,WAAU;aAAf,CACC,qBAAC,cAAD;IAAM,KAAI;cAAV,CACE,MACD,oBAAC,OAAD;KAAK,WAAU;eAAwB;KAAa,CAAA,CAC/C;OAEN,qBAAC,cAAD;IAAM,KAAK;IAAI,SAAQ;IAAW,WAAU;cAA5C;KACE,sBAAsB,QACtB,oBAAC,gBAAD;MAAQ,GAAI;MAAQ,SAAS;MAAe,CAAA;KAE5C;KACA,kBAAkB,QAClB,oBAAC,gBAAD;MACC,SAAS,MAAM;MACf,GAAI;MACJ,SAAS;MACT,CAAA;KAEG;MACF;;EAMJ,GAAI;EACK;EACT,SAAS,MAAM;EACR;EACC;EACE;EACV,iBAAiB;EAEhB;EACK,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMouseUp, useResizeObserver } from "../../js/hooks.js";
|
|
2
2
|
import { getPointPosition, getPosition } from "../../js/utils.js";
|
|
3
3
|
import Content from "./content.js";
|
|
4
|
-
import { debounce } from "
|
|
4
|
+
import { debounce } from "radash";
|
|
5
5
|
import { Children, cloneElement, isValidElement, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region packages/components/popup/popup.tsx
|
|
@@ -3,8 +3,9 @@ import Empty from "../utils/empty/index.js";
|
|
|
3
3
|
import list_default from "../list/index.js";
|
|
4
4
|
import tag_default from "../tag/index.js";
|
|
5
5
|
import classNames from "classnames";
|
|
6
|
-
import { CheckRound, SearchRound } from "/Users/iann/codes/ioca-react/node_modules/.pnpm/@ricons+material@0.12.0/node_modules/@ricons/material/es/index.js";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import CheckRound from "@ricons/material/es/CheckRound.js";
|
|
8
|
+
import SearchRound from "@ricons/material/es/SearchRound.js";
|
|
8
9
|
//#region packages/components/select/options.tsx
|
|
9
10
|
const Options = (props) => {
|
|
10
11
|
const { value: val, options, filter, filterPlaceholder, multiple, empty = /* @__PURE__ */ jsx(Empty, {}), onSelect, onFilter } = props;
|