@vavt/react-ui 1.4.5 → 1.5.0
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/README.md +40 -8
- package/dist/AutoComplete-D8yHFMHQ.js +185 -0
- package/dist/AutoComplete-Drl00grg.cjs +1 -0
- package/dist/Avatar-CVGMy2Ws.cjs +1 -0
- package/dist/Avatar-DiZ9p6tu.js +125 -0
- package/dist/{Badge-FzXPw1qS.js → Badge-CchY6uXz.js} +1 -1
- package/dist/{Badge-BkqoSV-F.cjs → Badge-D3htuSXY.cjs} +1 -1
- package/dist/Breadcrumb-BWR92yK_.cjs +1 -0
- package/dist/Breadcrumb-BmZKaAQx.js +88 -0
- package/dist/Cascader-ZVE95kvm.cjs +1 -0
- package/dist/Cascader-bozg6Ebp.js +268 -0
- package/dist/Collapse-DVxYsq3L.cjs +1 -0
- package/dist/Collapse-DszkYUfD.js +112 -0
- package/dist/{Cron-BVMn9OXM.js → Cron-BWqWgWuv.js} +401 -398
- package/dist/Cron-zcb1FZ09.cjs +1 -0
- package/dist/{DatePicker-3wbkApMJ.js → DatePicker-DBjtTP2Q.js} +1 -1
- package/dist/{DatePicker-B3mA7BzE.cjs → DatePicker-apiCVsKF.cjs} +1 -1
- package/dist/{DateTimePicker-C1bggaBl.cjs → DateTimePicker-2omkPUuf.cjs} +1 -1
- package/dist/{DateTimePicker--A4EWUe-.js → DateTimePicker-IpyJLY4J.js} +1 -1
- package/dist/Descriptions-CmSiqsqf.cjs +1 -0
- package/dist/Descriptions-EL2QcZ1K.js +32 -0
- package/dist/{Drawer-D1elCS8V.js → Drawer--aEf7OiI.js} +8 -8
- package/dist/{Drawer-DbH5rUvZ.cjs → Drawer-BEDZEapD.cjs} +1 -1
- package/dist/Dropdown-FrlX_2wd.js +332 -0
- package/dist/Dropdown-dvIwbqMc.cjs +1 -0
- package/dist/{Form-DiYdJJNH.js → Form-CGJDPj0N.js} +9 -9
- package/dist/{Form-X98FSlHG.cjs → Form-lygZzVRZ.cjs} +1 -1
- package/dist/Image-D7FGl2cQ.cjs +1 -0
- package/dist/Image-DJb-tcA-.js +295 -0
- package/dist/{Input-BbJ4Q_xu.cjs → Input-BI-gwi8w.cjs} +1 -1
- package/dist/{Input-DpoSxIdb.js → Input-CoS-XMv1.js} +5 -5
- package/dist/Layout-CJpTIRSF.cjs +1 -0
- package/dist/Layout-l-rfDdFR.js +60 -0
- package/dist/List-BupBfl-B.js +45 -0
- package/dist/List-DAkXmKFR.cjs +1 -0
- package/dist/{Loading-BAKnIASq.js → Loading-C9LBGbnd.js} +1 -1
- package/dist/{Loading-BSqhKOle.cjs → Loading-CRhiY3Ok.cjs} +1 -1
- package/dist/Menu-CsGCo2ck.cjs +1 -0
- package/dist/Menu-t8GRH6oh.js +168 -0
- package/dist/Message-Bo-hPakI.js +170 -0
- package/dist/Message-D2WGz_wk.cjs +1 -0
- package/dist/{MessageBox-C0dCtUie.js → MessageBox-CaTZOiZC.js} +8 -8
- package/dist/{MessageBox-Bp-3oqz4.cjs → MessageBox-D9rZAvhY.cjs} +1 -1
- package/dist/Modal-BTMB0xbR.js +250 -0
- package/dist/{Modal-BfHARuVJ.cjs → Modal-ToC7SNzp.cjs} +1 -1
- package/dist/Notification-C1lOX5Hn.js +187 -0
- package/dist/Notification-DK5jP-kX.cjs +1 -0
- package/dist/{Pagination-CtnBykzs.cjs → Pagination-D_SAnFOA.cjs} +1 -1
- package/dist/{Pagination-BGbiLFtp.js → Pagination-fbC5EEq-.js} +1 -1
- package/dist/Popconfirm-CQ59-YOh.cjs +1 -0
- package/dist/Popconfirm-D2zgbhKF.js +91 -0
- package/dist/Popover-Cb8BrtQC.js +232 -0
- package/dist/Popover-Dqrb-lKh.cjs +1 -0
- package/dist/Result-C3RqWqnc.cjs +1 -0
- package/dist/Result-CcnBHoE5.js +77 -0
- package/dist/Segmented-CQ18snYg.cjs +1 -0
- package/dist/Segmented-OykaARP4.js +39 -0
- package/dist/Select-CpoP5kRp.js +504 -0
- package/dist/Select-D8udcz4F.cjs +1 -0
- package/dist/Skeleton-B_cZyDWx.cjs +1 -0
- package/dist/Skeleton-C80MPzfN.js +31 -0
- package/dist/Statistic-BitBMhSW.cjs +1 -0
- package/dist/Statistic-DVduwOGW.js +35 -0
- package/dist/Steps-B9phXfUl.cjs +1 -0
- package/dist/Steps-Cnswg-bb.js +85 -0
- package/dist/{Table-CpyEziz5.js → Table-DMqVnyDN.js} +1 -1
- package/dist/{Table-uBqeNSnm.cjs → Table-rgp7iAWc.cjs} +1 -1
- package/dist/TimePicker-BydMgSVN.js +220 -0
- package/dist/TimePicker-t4eGpNEu.cjs +1 -0
- package/dist/Tooltip-CWQDc8Nf.js +201 -0
- package/dist/Tooltip-Cn9pIMfU.cjs +1 -0
- package/dist/Transfer-BRjVUdyi.js +115 -0
- package/dist/Transfer-BfWsmx_x.cjs +1 -0
- package/dist/{Transition-X_89ga-e.cjs → Transition-BBMxZ5_8.cjs} +1 -1
- package/dist/{Transition-DiO4GsP3.js → Transition-CJDv6yI5.js} +2 -2
- package/dist/Tree-BsG6l54c.js +202 -0
- package/dist/Tree-CcSMb0_M.cjs +1 -0
- package/dist/TreeSelect-DBJkW7zM.cjs +1 -0
- package/dist/TreeSelect-DWmDo7pg.js +120 -0
- package/dist/Typography-C9Ef3jN5.js +91 -0
- package/dist/Typography-DLrh1jPn.cjs +1 -0
- package/dist/{Upload-DZ6VaM7r.js → Upload-aLdxGpWh.js} +7 -7
- package/dist/{Upload-wHEEoe1c.cjs → Upload-wt5lnQHc.cjs} +1 -1
- package/dist/base.css +1 -1
- package/dist/choice-popup-Crn_uZzu.cjs +1 -0
- package/dist/choice-popup-CzxryGs6.js +168 -0
- package/dist/cjs/AutoComplete.cjs +1 -0
- package/dist/cjs/Avatar.cjs +1 -0
- package/dist/cjs/Badge.cjs +1 -1
- package/dist/cjs/Breadcrumb.cjs +1 -0
- package/dist/cjs/Cascader.cjs +1 -0
- package/dist/cjs/Collapse.cjs +1 -0
- package/dist/cjs/Cron.cjs +1 -1
- package/dist/cjs/DatePicker.cjs +1 -1
- package/dist/cjs/DateTimePicker.cjs +1 -1
- package/dist/cjs/Descriptions.cjs +1 -0
- package/dist/cjs/Drawer.cjs +1 -1
- package/dist/cjs/Dropdown.cjs +1 -1
- package/dist/cjs/Form.cjs +1 -1
- package/dist/cjs/Image.cjs +1 -0
- package/dist/cjs/Input.cjs +1 -1
- package/dist/cjs/Layout.cjs +1 -0
- package/dist/cjs/List.cjs +1 -0
- package/dist/cjs/Loading.cjs +1 -1
- package/dist/cjs/Menu.cjs +1 -0
- package/dist/cjs/Message.cjs +1 -0
- package/dist/cjs/MessageBox.cjs +1 -1
- package/dist/cjs/Modal.cjs +1 -1
- package/dist/cjs/Notification.cjs +1 -1
- package/dist/cjs/Pagination.cjs +1 -1
- package/dist/cjs/Popconfirm.cjs +1 -0
- package/dist/cjs/Popover.cjs +1 -0
- package/dist/cjs/Result.cjs +1 -0
- package/dist/cjs/Segmented.cjs +1 -0
- package/dist/cjs/Select.cjs +1 -1
- package/dist/cjs/Skeleton.cjs +1 -0
- package/dist/cjs/Statistic.cjs +1 -0
- package/dist/cjs/Steps.cjs +1 -0
- package/dist/cjs/Table.cjs +1 -1
- package/dist/cjs/TimePicker.cjs +1 -1
- package/dist/cjs/Tooltip.cjs +1 -1
- package/dist/cjs/Transfer.cjs +1 -0
- package/dist/cjs/Transition.cjs +1 -1
- package/dist/cjs/Tree.cjs +1 -0
- package/dist/cjs/TreeSelect.cjs +1 -0
- package/dist/cjs/Typography.cjs +1 -0
- package/dist/cjs/Upload.cjs +1 -1
- package/dist/cjs/global.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/register.cjs +1 -1
- package/dist/css/AutoComplete.css +1 -0
- package/dist/css/Avatar.css +1 -0
- package/dist/css/Breadcrumb.css +1 -0
- package/dist/css/Cascader.css +1 -0
- package/dist/css/Checkbox.css +1 -1
- package/dist/css/Collapse.css +1 -0
- package/dist/css/Descriptions.css +1 -0
- package/dist/css/Image.css +1 -0
- package/dist/css/Layout.css +1 -0
- package/dist/css/List.css +1 -0
- package/dist/css/Menu.css +1 -0
- package/dist/css/Message.css +1 -0
- package/dist/css/Popconfirm.css +1 -0
- package/dist/css/Popover.css +1 -0
- package/dist/css/Radio.css +1 -1
- package/dist/css/Result.css +1 -0
- package/dist/css/Segmented.css +1 -0
- package/dist/css/Skeleton.css +1 -0
- package/dist/css/Statistic.css +1 -0
- package/dist/css/Steps.css +1 -0
- package/dist/css/Switch.css +1 -1
- package/dist/css/Transfer.css +1 -0
- package/dist/css/Tree.css +1 -0
- package/dist/css/TreeSelect.css +1 -0
- package/dist/css/Typography.css +1 -0
- package/dist/date-picker-BUZofYHp.js +644 -0
- package/dist/date-picker-CDbRvH7g.cjs +1 -0
- package/dist/dialog-shell-Bv1Jvhjb.js +219 -0
- package/dist/dialog-shell-HPbp3xhc.cjs +1 -0
- package/dist/es/AutoComplete.mjs +3 -0
- package/dist/es/Avatar.mjs +3 -0
- package/dist/es/Badge.mjs +1 -1
- package/dist/es/Breadcrumb.mjs +3 -0
- package/dist/es/Cascader.mjs +3 -0
- package/dist/es/Collapse.mjs +3 -0
- package/dist/es/Cron.mjs +1 -1
- package/dist/es/DatePicker.mjs +1 -1
- package/dist/es/DateTimePicker.mjs +1 -1
- package/dist/es/Descriptions.mjs +3 -0
- package/dist/es/Drawer.mjs +1 -1
- package/dist/es/Dropdown.mjs +1 -1
- package/dist/es/Form.mjs +1 -1
- package/dist/es/Image.mjs +3 -0
- package/dist/es/Input.mjs +1 -1
- package/dist/es/Layout.mjs +3 -0
- package/dist/es/List.mjs +3 -0
- package/dist/es/Loading.mjs +1 -1
- package/dist/es/Menu.mjs +3 -0
- package/dist/es/Message.mjs +3 -0
- package/dist/es/MessageBox.mjs +1 -1
- package/dist/es/Modal.mjs +1 -1
- package/dist/es/Notification.mjs +1 -1
- package/dist/es/Pagination.mjs +1 -1
- package/dist/es/Popconfirm.mjs +3 -0
- package/dist/es/Popover.mjs +3 -0
- package/dist/es/Result.mjs +3 -0
- package/dist/es/Segmented.mjs +3 -0
- package/dist/es/Select.mjs +1 -1
- package/dist/es/Skeleton.mjs +3 -0
- package/dist/es/Statistic.mjs +3 -0
- package/dist/es/Steps.mjs +3 -0
- package/dist/es/Table.mjs +1 -1
- package/dist/es/TimePicker.mjs +1 -1
- package/dist/es/Tooltip.mjs +1 -1
- package/dist/es/Transfer.mjs +3 -0
- package/dist/es/Transition.mjs +1 -1
- package/dist/es/Tree.mjs +3 -0
- package/dist/es/TreeSelect.mjs +3 -0
- package/dist/es/Typography.mjs +3 -0
- package/dist/es/Upload.mjs +1 -1
- package/dist/es/global.mjs +1 -1
- package/dist/es/index.mjs +62 -40
- package/dist/es/register.mjs +1 -1
- package/dist/floating-B6CCQcuK.cjs +1 -0
- package/dist/{floating-BqCWEj83.js → floating-C8pd2mFu.js} +62 -56
- package/dist/index.css +1 -1
- package/dist/layer-B9unaPbV.js +109 -0
- package/dist/layer-BcLkE2NM.cjs +1 -0
- package/dist/notice-timer-BRLTVgTj.js +28 -0
- package/dist/notice-timer-OkrpLRrG.cjs +1 -0
- package/dist/registry-BFCksD7k.js +131 -0
- package/dist/registry-DftkiQnN.cjs +1 -0
- package/dist/style/AutoComplete.cjs +9 -0
- package/dist/style/AutoComplete.mjs +9 -0
- package/dist/style/Avatar.cjs +7 -0
- package/dist/style/Avatar.mjs +7 -0
- package/dist/style/Breadcrumb.cjs +7 -0
- package/dist/style/Breadcrumb.mjs +7 -0
- package/dist/style/Cascader.cjs +9 -0
- package/dist/style/Cascader.mjs +9 -0
- package/dist/style/Collapse.cjs +7 -0
- package/dist/style/Collapse.mjs +7 -0
- package/dist/style/Descriptions.cjs +7 -0
- package/dist/style/Descriptions.mjs +7 -0
- package/dist/style/Image.cjs +10 -0
- package/dist/style/Image.mjs +10 -0
- package/dist/style/Layout.cjs +7 -0
- package/dist/style/Layout.mjs +7 -0
- package/dist/style/List.cjs +9 -0
- package/dist/style/List.mjs +9 -0
- package/dist/style/Menu.cjs +8 -0
- package/dist/style/Menu.mjs +8 -0
- package/dist/style/Message.cjs +8 -0
- package/dist/style/Message.mjs +8 -0
- package/dist/style/Popconfirm.cjs +9 -0
- package/dist/style/Popconfirm.mjs +9 -0
- package/dist/style/Popover.cjs +8 -0
- package/dist/style/Popover.mjs +8 -0
- package/dist/style/Result.cjs +7 -0
- package/dist/style/Result.mjs +7 -0
- package/dist/style/Segmented.cjs +8 -0
- package/dist/style/Segmented.mjs +8 -0
- package/dist/style/Skeleton.cjs +7 -0
- package/dist/style/Skeleton.mjs +7 -0
- package/dist/style/Statistic.cjs +7 -0
- package/dist/style/Statistic.mjs +7 -0
- package/dist/style/Steps.cjs +7 -0
- package/dist/style/Steps.mjs +7 -0
- package/dist/style/Transfer.cjs +11 -0
- package/dist/style/Transfer.mjs +11 -0
- package/dist/style/Tree.cjs +9 -0
- package/dist/style/Tree.mjs +9 -0
- package/dist/style/TreeSelect.cjs +10 -0
- package/dist/style/TreeSelect.mjs +10 -0
- package/dist/style/Typography.cjs +7 -0
- package/dist/style/Typography.mjs +7 -0
- package/dist/types/AutoComplete/AutoComplete.d.cts +6 -0
- package/dist/types/AutoComplete/AutoComplete.d.ts +6 -0
- package/dist/types/AutoComplete/index.d.cts +2 -0
- package/dist/types/AutoComplete/index.d.ts +2 -0
- package/dist/types/AutoComplete/type.d.cts +57 -0
- package/dist/types/AutoComplete/type.d.ts +57 -0
- package/dist/types/Avatar/Avatar.d.cts +4 -0
- package/dist/types/Avatar/Avatar.d.ts +4 -0
- package/dist/types/Avatar/AvatarGroup.d.cts +7 -0
- package/dist/types/Avatar/AvatarGroup.d.ts +7 -0
- package/dist/types/Avatar/context.d.cts +6 -0
- package/dist/types/Avatar/context.d.ts +6 -0
- package/dist/types/Avatar/index.d.cts +7 -0
- package/dist/types/Avatar/index.d.ts +7 -0
- package/dist/types/Avatar/type.d.cts +36 -0
- package/dist/types/Avatar/type.d.ts +36 -0
- package/dist/types/Breadcrumb/Breadcrumb.d.cts +5 -0
- package/dist/types/Breadcrumb/Breadcrumb.d.ts +5 -0
- package/dist/types/Breadcrumb/index.d.cts +6 -0
- package/dist/types/Breadcrumb/index.d.ts +6 -0
- package/dist/types/Breadcrumb/type.d.cts +59 -0
- package/dist/types/Breadcrumb/type.d.ts +59 -0
- package/dist/types/Cascader/Cascader.d.cts +3 -0
- package/dist/types/Cascader/Cascader.d.ts +3 -0
- package/dist/types/Cascader/index.d.cts +2 -0
- package/dist/types/Cascader/index.d.ts +2 -0
- package/dist/types/Cascader/type.d.cts +38 -0
- package/dist/types/Cascader/type.d.ts +38 -0
- package/dist/types/Collapse/Collapse.d.cts +3 -0
- package/dist/types/Collapse/Collapse.d.ts +3 -0
- package/dist/types/Collapse/index.d.cts +4 -0
- package/dist/types/Collapse/index.d.ts +4 -0
- package/dist/types/Collapse/type.d.cts +46 -0
- package/dist/types/Collapse/type.d.ts +46 -0
- package/dist/types/Descriptions/Descriptions.d.cts +3 -0
- package/dist/types/Descriptions/Descriptions.d.ts +3 -0
- package/dist/types/Descriptions/index.d.cts +4 -0
- package/dist/types/Descriptions/index.d.ts +4 -0
- package/dist/types/Descriptions/type.d.cts +20 -0
- package/dist/types/Descriptions/type.d.ts +20 -0
- package/dist/types/Image/Image.d.cts +3 -0
- package/dist/types/Image/Image.d.ts +3 -0
- package/dist/types/Image/ImagePreview.d.cts +4 -0
- package/dist/types/Image/ImagePreview.d.ts +4 -0
- package/dist/types/Image/index.d.cts +3 -0
- package/dist/types/Image/index.d.ts +3 -0
- package/dist/types/Image/type.d.cts +25 -0
- package/dist/types/Image/type.d.ts +25 -0
- package/dist/types/Layout/Layout.d.cts +8 -0
- package/dist/types/Layout/Layout.d.ts +8 -0
- package/dist/types/Layout/index.d.cts +2 -0
- package/dist/types/Layout/index.d.ts +2 -0
- package/dist/types/Layout/type.d.cts +20 -0
- package/dist/types/Layout/type.d.ts +20 -0
- package/dist/types/List/List.d.cts +3 -0
- package/dist/types/List/List.d.ts +3 -0
- package/dist/types/List/index.d.cts +2 -0
- package/dist/types/List/index.d.ts +2 -0
- package/dist/types/List/type.d.cts +15 -0
- package/dist/types/List/type.d.ts +15 -0
- package/dist/types/Menu/Menu.d.cts +4 -0
- package/dist/types/Menu/Menu.d.ts +4 -0
- package/dist/types/Menu/index.d.cts +2 -0
- package/dist/types/Menu/index.d.ts +2 -0
- package/dist/types/Menu/type.d.cts +26 -0
- package/dist/types/Menu/type.d.ts +26 -0
- package/dist/types/Message/Message.d.cts +3 -0
- package/dist/types/Message/Message.d.ts +3 -0
- package/dist/types/Message/host.d.cts +5 -0
- package/dist/types/Message/host.d.ts +5 -0
- package/dist/types/Message/index.d.cts +4 -0
- package/dist/types/Message/index.d.ts +4 -0
- package/dist/types/Message/service.d.cts +4 -0
- package/dist/types/Message/service.d.ts +4 -0
- package/dist/types/Message/type.d.cts +34 -0
- package/dist/types/Message/type.d.ts +34 -0
- package/dist/types/Popconfirm/Popconfirm.d.cts +4 -0
- package/dist/types/Popconfirm/Popconfirm.d.ts +4 -0
- package/dist/types/Popconfirm/index.d.cts +4 -0
- package/dist/types/Popconfirm/index.d.ts +4 -0
- package/dist/types/Popconfirm/type.d.cts +14 -0
- package/dist/types/Popconfirm/type.d.ts +14 -0
- package/dist/types/Popover/Popover.d.cts +3 -0
- package/dist/types/Popover/Popover.d.ts +3 -0
- package/dist/types/Popover/index.d.cts +4 -0
- package/dist/types/Popover/index.d.ts +4 -0
- package/dist/types/Popover/type.d.cts +27 -0
- package/dist/types/Popover/type.d.ts +27 -0
- package/dist/types/Result/Result.d.cts +3 -0
- package/dist/types/Result/Result.d.ts +3 -0
- package/dist/types/Result/index.d.cts +2 -0
- package/dist/types/Result/index.d.ts +2 -0
- package/dist/types/Result/type.d.cts +11 -0
- package/dist/types/Result/type.d.ts +11 -0
- package/dist/types/Segmented/Segmented.d.cts +4 -0
- package/dist/types/Segmented/Segmented.d.ts +4 -0
- package/dist/types/Segmented/index.d.cts +2 -0
- package/dist/types/Segmented/index.d.ts +2 -0
- package/dist/types/Segmented/type.d.cts +21 -0
- package/dist/types/Segmented/type.d.ts +21 -0
- package/dist/types/Skeleton/Skeleton.d.cts +4 -0
- package/dist/types/Skeleton/Skeleton.d.ts +4 -0
- package/dist/types/Skeleton/index.d.cts +4 -0
- package/dist/types/Skeleton/index.d.ts +4 -0
- package/dist/types/Skeleton/type.d.cts +15 -0
- package/dist/types/Skeleton/type.d.ts +15 -0
- package/dist/types/Statistic/Statistic.d.cts +4 -0
- package/dist/types/Statistic/Statistic.d.ts +4 -0
- package/dist/types/Statistic/index.d.cts +2 -0
- package/dist/types/Statistic/index.d.ts +2 -0
- package/dist/types/Statistic/type.d.cts +11 -0
- package/dist/types/Statistic/type.d.ts +11 -0
- package/dist/types/Steps/Steps.d.cts +4 -0
- package/dist/types/Steps/Steps.d.ts +4 -0
- package/dist/types/Steps/index.d.cts +2 -0
- package/dist/types/Steps/index.d.ts +2 -0
- package/dist/types/Steps/type.d.cts +24 -0
- package/dist/types/Steps/type.d.ts +24 -0
- package/dist/types/Transfer/Transfer.d.cts +4 -0
- package/dist/types/Transfer/Transfer.d.ts +4 -0
- package/dist/types/Transfer/index.d.cts +2 -0
- package/dist/types/Transfer/index.d.ts +2 -0
- package/dist/types/Transfer/type.d.cts +24 -0
- package/dist/types/Transfer/type.d.ts +24 -0
- package/dist/types/Transition/type.d.cts +1 -1
- package/dist/types/Transition/type.d.ts +1 -1
- package/dist/types/Tree/Tree.d.cts +3 -0
- package/dist/types/Tree/Tree.d.ts +3 -0
- package/dist/types/Tree/index.d.cts +2 -0
- package/dist/types/Tree/index.d.ts +2 -0
- package/dist/types/Tree/type.d.cts +42 -0
- package/dist/types/Tree/type.d.ts +42 -0
- package/dist/types/TreeSelect/TreeSelect.d.cts +4 -0
- package/dist/types/TreeSelect/TreeSelect.d.ts +4 -0
- package/dist/types/TreeSelect/index.d.cts +3 -0
- package/dist/types/TreeSelect/index.d.ts +3 -0
- package/dist/types/TreeSelect/type.d.cts +26 -0
- package/dist/types/TreeSelect/type.d.ts +26 -0
- package/dist/types/Typography/Typography.d.cts +7 -0
- package/dist/types/Typography/Typography.d.ts +7 -0
- package/dist/types/Typography/index.d.cts +2 -0
- package/dist/types/Typography/index.d.ts +2 -0
- package/dist/types/Typography/type.d.cts +23 -0
- package/dist/types/Typography/type.d.ts +23 -0
- package/dist/types/_shared/choice-popup.d.cts +44 -0
- package/dist/types/_shared/choice-popup.d.ts +44 -0
- package/dist/types/_shared/dialog-layer.d.cts +4 -1
- package/dist/types/_shared/dialog-layer.d.ts +4 -1
- package/dist/types/_shared/dialog.d.cts +4 -1
- package/dist/types/_shared/dialog.d.ts +4 -1
- package/dist/types/_shared/floating.d.cts +3 -3
- package/dist/types/_shared/floating.d.ts +3 -3
- package/dist/types/_shared/focus.d.cts +1 -1
- package/dist/types/_shared/focus.d.ts +1 -1
- package/dist/types/_shared/notice-timer.d.cts +11 -0
- package/dist/types/_shared/notice-timer.d.ts +11 -0
- package/dist/types/_shared/popup-scope.d.cts +30 -0
- package/dist/types/_shared/popup-scope.d.ts +30 -0
- package/dist/types/_shared/tree.d.cts +28 -0
- package/dist/types/_shared/tree.d.ts +28 -0
- package/dist/types/global.d.cts +44 -0
- package/dist/types/global.d.ts +44 -0
- package/dist/types/index.d.cts +22 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/registry.d.cts +26 -0
- package/dist/types/registry.d.ts +26 -0
- package/package.json +3 -2
- package/dist/Cron-2avclmKf.cjs +0 -1
- package/dist/Dropdown-CYo0Ckcg.js +0 -330
- package/dist/Dropdown-DlT_kSLw.cjs +0 -1
- package/dist/Modal-UWOcLzA6.js +0 -250
- package/dist/Notification-CJraaZIi.js +0 -197
- package/dist/Notification-D6m4qHKz.cjs +0 -1
- package/dist/Select-BBw595_R.js +0 -497
- package/dist/Select-CcuSjVhm.cjs +0 -1
- package/dist/TimePicker-BtorXdZv.cjs +0 -1
- package/dist/TimePicker-DxDA8bbO.js +0 -215
- package/dist/Tooltip-2-mZgyai.js +0 -198
- package/dist/Tooltip-BCH9SOnY.cjs +0 -1
- package/dist/date-picker-BrlkzTx6.cjs +0 -1
- package/dist/date-picker-DBzPbLf2.js +0 -639
- package/dist/dialog-shell-DqKDnSak.js +0 -207
- package/dist/dialog-shell-WCsdja9-.cjs +0 -1
- package/dist/floating-BpTI3sWS.cjs +0 -1
- package/dist/focus-BDDJyKk3.js +0 -9
- package/dist/focus-D-h8CbGr.cjs +0 -1
- package/dist/layer-CWiOhvXF.js +0 -53
- package/dist/layer-DfWO72Y-.cjs +0 -1
- package/dist/registry-7LU6RUh_.cjs +0 -1
- package/dist/registry-BYt8u6us.js +0 -87
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./effect-BpNxm_06.cjs"),t=require("./state-BuUx1onZ.cjs"),n=require("./refs-DCqd87V8.cjs"),r=require("./
|
|
1
|
+
const e=require("./effect-BpNxm_06.cjs"),t=require("./state-BuUx1onZ.cjs"),n=require("./refs-DCqd87V8.cjs"),r=require("./client-BkoqeUs3.cjs"),i=require("./number-B7qJF_ZY.cjs"),a=require("./id-CF0zOP1G.cjs"),o=require("./content-DCGQZQp8.cjs"),s=require("./dialog-shell-HPbp3xhc.cjs"),ee=require("./Scrollbar-CEQT6Ao_.cjs");let te=require("lucide-react"),c=require("react"),l=require("react/jsx-runtime");var ne=.25,re=0,ie=e=>{if(typeof e==`number`)return Number.isFinite(e)?e:0;if(typeof e==`string`){let t=e.trim();if(t.endsWith(`vh`)){let e=parseFloat(t);return Number.isFinite(e)?window.innerHeight*e/100:0}if(t.endsWith(`px`)){let e=parseFloat(t);return Number.isFinite(e)?e:0}let n=parseFloat(t);return Number.isFinite(n)?n:0}return 0},u=(0,c.forwardRef)((u,d)=>{let{open:f,defaultOpen:ae=!1,title:p,width:oe=520,offsetY:m=re,center:h=!1,mask:se=!0,closeOnClickOverlay:ce=!0,closeOnPressEscape:le=!0,showClose:g=!0,lockScroll:ue=!0,destroyOnClose:_=!1,draggable:v=!0,fullscreen:y=!1,zIndex:de,header:b,footer:x,className:fe,style:S,children:pe,onClick:me,onChange:he,onOpen:C,onClose:w,onAfterClose:ge,"aria-label":_e,"aria-labelledby":ve,"aria-describedby":ye,...be}=u,T=r.t(),E=(0,c.useRef)(null),xe=(0,c.useMemo)(()=>n.n(E,d),[d]),Se=t.t(u,`open`),[D,O]=t.n({value:!!f,defaultValue:ae,controlled:Se,onChange:he}),[Ce,k]=(0,c.useState)(!1),A=(0,c.useRef)({x:0,y:0}),j=(0,c.useRef)(!1),M=(0,c.useRef)(!1),N=(0,c.useRef)({x:0,y:0}),P=(0,c.useRef)(null),F=(0,c.useRef)(!1),I=(0,c.useRef)(null),L=a.t(`vl-modal-title`),R=(0,c.useCallback)(()=>O(!1),[O]),z=s.r({active:T&&D,zIndex:de??(typeof S?.zIndex==`number`?S.zIndex:void 0),containerRef:E,closeOnPressEscape:le,lockScroll:ue,onRequestClose:R}),{isTopLayer:B}=z,V=(0,c.useCallback)(e=>{E.current&&(E.current.style.visibility=e?`visible`:`hidden`)},[]),H=(0,c.useCallback)((e,t)=>{A.current={x:e,y:t},E.current&&(E.current.style.left=`${e}px`,E.current.style.top=`${t}px`)},[]),U=(0,c.useCallback)((e,t)=>{let n=e.offsetWidth,r=e.offsetHeight;return{width:n,height:r,maxX:Math.max(t,window.innerWidth-n-t),maxY:Math.max(t,window.innerHeight-r-t)}},[]),W=(0,c.useCallback)(()=>{let e=E.current;if(!e||typeof window>`u`)return;if(y){H(0,0),j.current=!1;return}let{width:t,height:n,maxX:r,maxY:a}=U(e,12),o=(window.innerHeight-n)*(h?.5:ne)+ie(m);H(Math.round(i.t((window.innerWidth-t)/2,12,r)),Math.round(i.t(o,12,a)))},[h,y,U,m,H]),G=(0,c.useCallback)(()=>{let e=E.current;if(!e)return;let{maxX:t,maxY:n}=U(e,12);H(Math.round(i.t(A.current.x,12,t)),Math.round(i.t(A.current.y,12,n)))},[U,H]),K=(0,c.useCallback)(()=>{D&&(y||!j.current?W():G())},[D,y,W,G]),q=(0,c.useCallback)((e,t)=>{let n=E.current;if(!n||y)return;let{maxX:r,maxY:a}=U(n,12),o=i.t(e-N.current.x,12,r),s=i.t(t-N.current.y,12,a);H(Math.round(o),Math.round(s)),j.current=!0},[y,U,H]),J=(0,c.useRef)({applyDragPosition:q,syncPosition:K});e.t(()=>{J.current={applyDragPosition:q,syncPosition:K}},[q,K]);let we=(0,c.useCallback)(e=>{M.current&&J.current.applyDragPosition(e.clientX,e.clientY)},[]),Y=(0,c.useCallback)(()=>{I.current?.abort(),I.current=null,P.current?.(),P.current=null},[]),X=(0,c.useCallback)(()=>{M.current&&(M.current=!1,k(!1),Y(),J.current.syncPosition())},[Y]),Te=e=>{if(!v||y||!D||!B()||e.button!==0||e.target.closest(`.vl-modal__close, .vl-modal__title, .vl-message-box__title, [class*='__title'], [data-drag-cancel], button, input, textarea, select, a`))return;let t=E.current;if(!t)return;let n=window.getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),e.preventDefault();let r=t.getBoundingClientRect();N.current={x:e.clientX-r.left,y:e.clientY-r.top},M.current=!0,k(!0),P.current=s.n(),I.current=new AbortController;let{signal:i}=I.current;window.addEventListener(`pointermove`,we,{signal:i}),window.addEventListener(`pointerup`,X,{once:!0,signal:i})};(0,c.useEffect)(()=>{let e=F.current;D&&!e?C?.():!D&&e&&w?.(),F.current=D},[D,C,w]),e.t(()=>{!D||!T||(V(!1),y?W():!_&&j.current?G():W(),V(!0))},[D,T,y,_,W,G,H,V]),(0,c.useEffect)(()=>{D||X()},[D,X]),(0,c.useEffect)(()=>{let e=E.current;if(!D||!T||!e)return;let t=null,n=()=>{M.current||t!==null||(t=window.requestAnimationFrame(()=>{t=null,M.current||K()}))},r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e,{box:`border-box`}),window.addEventListener(`resize`,n,{passive:!0}),()=>{r?.disconnect(),window.removeEventListener(`resize`,n),t!==null&&window.cancelAnimationFrame(t)}},[D,T,K]),(0,c.useEffect)(()=>()=>{Y()},[Y]);let Ee=()=>{ce&&B()&&R()},De=e=>{e.stopPropagation(),me?.(e)},Oe=[`vl-modal`,Ce?`is-dragging`:``,h?`is-center`:``,y?`is-fullscreen`:``,fe||``].filter(Boolean).join(` `),ke=[`vl-modal__header`,v&&!y?`is-draggable`:``].filter(Boolean).join(` `),Z={...S};z.zIndex!==void 0&&(Z.zIndex=z.zIndex),y?(Z.width=`100vw`,Z.height=void 0):Z.width=i.n(oe)??`520px`;let Q=b??(p?(0,l.jsx)(`div`,{id:L,className:`vl-modal__title`,children:p}):null),$=ve??(!b&&p?L:void 0),Ae=_e??($?void 0:typeof p==`string`?p:`对话框`);return(0,l.jsx)(s.i,{value:z,children:(0,l.jsxs)(s.t,{clientReady:T,open:D,mask:se,destroyOnClose:_,maskTransitionName:`vl-modal-mask`,transitionName:`vl-modal`,maskClassName:`vl-modal__mask`,panelClassName:Oe,panelStyle:Z,maskStyle:z.maskZIndex===void 0?void 0:{zIndex:z.maskZIndex},panelRef:xe,role:`dialog`,ariaLabel:Ae,ariaLabelledBy:$,ariaDescribedBy:ye,onMaskClick:Ee,onPanelClick:De,onAfterLeave:()=>{X(),_&&(j.current=!1),z.onAfterLeave(),ge?.()},panelProps:be,children:[o.t(Q)||g?(0,l.jsx)(`div`,{className:ke,onPointerDown:Te,children:(0,l.jsxs)(`div`,{className:`vl-modal__headerInner`,children:[(0,l.jsx)(`div`,{className:`vl-modal__headerMain`,children:Q}),g?(0,l.jsx)(`button`,{type:`button`,className:`vl-modal__close`,"aria-label":`关闭对话框`,onClick:R,children:(0,l.jsx)(te.X,{size:20,"aria-hidden":`true`})}):null]})}):null,(0,l.jsx)(ee.t,{className:`vl-modal__body`,children:pe}),o.t(x)?(0,l.jsx)(`div`,{className:`vl-modal__footer`,children:x}):null]})})});u.displayName=`VlModal`;var d=u,f=u;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { t as e } from "./icon-Cbvuv4yF.js";
|
|
2
|
+
import { t } from "./effect-nifYL_rH.js";
|
|
3
|
+
import { n, t as r } from "./state-BSDh-Ob2.js";
|
|
4
|
+
import { t as i } from "./Transition-CJDv6yI5.js";
|
|
5
|
+
import { t as a } from "./notice-timer-BRLTVgTj.js";
|
|
6
|
+
import { CircleAlert as o, CircleCheck as s, CircleX as c, Info as l, X as u } from "lucide-react";
|
|
7
|
+
import { forwardRef as d, useCallback as f, useEffect as p, useRef as m, useState as h } from "react";
|
|
8
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
9
|
+
import { createPortal as v } from "react-dom";
|
|
10
|
+
import { createRoot as y } from "react-dom/client";
|
|
11
|
+
//#region components/Notification/host.ts
|
|
12
|
+
var b = /* @__PURE__ */ new Map(), x = (e) => {
|
|
13
|
+
let t = b.get(e);
|
|
14
|
+
if (!t || !document.body.contains(t.element)) {
|
|
15
|
+
let n = document.createElement("div");
|
|
16
|
+
n.className = `vl-notification-host is-${e}`, document.body.appendChild(n), t = {
|
|
17
|
+
element: n,
|
|
18
|
+
users: 0
|
|
19
|
+
}, b.set(e, t);
|
|
20
|
+
}
|
|
21
|
+
t.users += 1;
|
|
22
|
+
let n = t;
|
|
23
|
+
return {
|
|
24
|
+
element: n.element,
|
|
25
|
+
release: () => {
|
|
26
|
+
--n.users, !(n.users > 0) && (n.element.remove(), b.get(e) === n && b.delete(e));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}, S = {
|
|
30
|
+
info: l,
|
|
31
|
+
success: s,
|
|
32
|
+
warning: o,
|
|
33
|
+
error: c
|
|
34
|
+
}, C = d((o, s) => {
|
|
35
|
+
let { open: c, defaultOpen: l = !1, title: d, status: y = "info", icon: b, placement: C = "top-right", duration: w = 4500, closable: T = !0, pauseOnHover: E = !0, pauseOnFocus: D = !0, closeOnPressEscape: O = !0, action: k, onChange: A, onClose: j, onAfterClose: M, onMouseEnter: N, onMouseLeave: P, onFocusCapture: F, onBlurCapture: I, onKeyDown: L, role: ee = y === "error" || y === "warning" ? "alert" : "status", className: R, children: z, ...B } = o, [V, H] = n({
|
|
36
|
+
value: !!c,
|
|
37
|
+
defaultValue: l,
|
|
38
|
+
controlled: r(o, "open"),
|
|
39
|
+
onChange: A
|
|
40
|
+
}), [U, W] = h(null), [G, K] = h(!1), [q, J] = h(!1), Y = m(!1), X = m({
|
|
41
|
+
open: V,
|
|
42
|
+
onClose: j
|
|
43
|
+
});
|
|
44
|
+
t(() => {
|
|
45
|
+
X.current = {
|
|
46
|
+
open: V,
|
|
47
|
+
onClose: j
|
|
48
|
+
};
|
|
49
|
+
}), t(() => {
|
|
50
|
+
V && (Y.current = !1);
|
|
51
|
+
}, [V]);
|
|
52
|
+
let Z = f(() => {
|
|
53
|
+
!X.current.open || Y.current || (Y.current = !0, H(!1), X.current.onClose?.());
|
|
54
|
+
}, [H]);
|
|
55
|
+
if (p(() => {
|
|
56
|
+
let e = x(C);
|
|
57
|
+
return W(e.element), e.release;
|
|
58
|
+
}, [C]), p(() => {
|
|
59
|
+
V || (K(!1), J(!1));
|
|
60
|
+
}, [V]), a({
|
|
61
|
+
open: V,
|
|
62
|
+
ready: !!U,
|
|
63
|
+
duration: w,
|
|
64
|
+
paused: E && G || D && q,
|
|
65
|
+
onTimeout: Z
|
|
66
|
+
}), !U) return null;
|
|
67
|
+
let Q = b === void 0 ? S[y] : b, $ = d != null && d !== !1;
|
|
68
|
+
return v(/* @__PURE__ */ g(i, {
|
|
69
|
+
show: V,
|
|
70
|
+
name: "vl-notification-fade",
|
|
71
|
+
onAfterLeave: M,
|
|
72
|
+
children: /* @__PURE__ */ _("div", {
|
|
73
|
+
...B,
|
|
74
|
+
ref: s,
|
|
75
|
+
className: [
|
|
76
|
+
"vl-notification",
|
|
77
|
+
`is-${y}`,
|
|
78
|
+
$ ? "has-title" : "",
|
|
79
|
+
R || ""
|
|
80
|
+
].filter(Boolean).join(" "),
|
|
81
|
+
role: ee,
|
|
82
|
+
"aria-atomic": B["aria-atomic"] ?? !0,
|
|
83
|
+
"aria-hidden": !V || B["aria-hidden"] || void 0,
|
|
84
|
+
onMouseEnter: (e) => {
|
|
85
|
+
K(!0), N?.(e);
|
|
86
|
+
},
|
|
87
|
+
onMouseLeave: (e) => {
|
|
88
|
+
K(!1), P?.(e);
|
|
89
|
+
},
|
|
90
|
+
onFocusCapture: (e) => {
|
|
91
|
+
J(!0), F?.(e);
|
|
92
|
+
},
|
|
93
|
+
onBlurCapture: (e) => {
|
|
94
|
+
e.currentTarget.contains(e.relatedTarget) || J(!1), I?.(e);
|
|
95
|
+
},
|
|
96
|
+
onKeyDown: (e) => {
|
|
97
|
+
L?.(e), !(e.defaultPrevented || e.key !== "Escape" || !O) && (e.stopPropagation(), Z());
|
|
98
|
+
},
|
|
99
|
+
children: [
|
|
100
|
+
Q ? e(Q, "vl-notification__icon") : null,
|
|
101
|
+
/* @__PURE__ */ _("div", {
|
|
102
|
+
className: "vl-notification__body",
|
|
103
|
+
children: [
|
|
104
|
+
$ ? /* @__PURE__ */ g("div", {
|
|
105
|
+
className: "vl-notification__title",
|
|
106
|
+
children: d
|
|
107
|
+
}) : null,
|
|
108
|
+
z === void 0 ? null : /* @__PURE__ */ g("div", {
|
|
109
|
+
className: "vl-notification__content",
|
|
110
|
+
children: z
|
|
111
|
+
}),
|
|
112
|
+
k ? /* @__PURE__ */ g("div", {
|
|
113
|
+
className: "vl-notification__action",
|
|
114
|
+
children: k
|
|
115
|
+
}) : null
|
|
116
|
+
]
|
|
117
|
+
}),
|
|
118
|
+
T ? /* @__PURE__ */ g("button", {
|
|
119
|
+
type: "button",
|
|
120
|
+
className: "vl-notification__close",
|
|
121
|
+
"aria-label": "关闭通知",
|
|
122
|
+
title: "关闭通知",
|
|
123
|
+
disabled: !V,
|
|
124
|
+
onClick: Z,
|
|
125
|
+
children: /* @__PURE__ */ g(u, { "aria-hidden": "true" })
|
|
126
|
+
}) : null
|
|
127
|
+
]
|
|
128
|
+
})
|
|
129
|
+
}), U);
|
|
130
|
+
});
|
|
131
|
+
C.displayName = "VlNotification";
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region components/Notification/service.tsx
|
|
134
|
+
var w = /* @__PURE__ */ new Set(), T = (e) => {
|
|
135
|
+
if (typeof document > "u") throw Error("VlNotification imperative APIs are only available in a browser environment.");
|
|
136
|
+
let { content: t, onClose: n, onAfterClose: r, ...i } = e, a = document.createElement("div");
|
|
137
|
+
a.className = "vl-notification-container", document.body.appendChild(a);
|
|
138
|
+
let o = y(a), s = !0, c = !1, l = !1, u = () => {
|
|
139
|
+
l || (l = !0, w.delete(f), queueMicrotask(() => {
|
|
140
|
+
o.unmount(), a.remove(), r?.();
|
|
141
|
+
}));
|
|
142
|
+
}, d = () => {
|
|
143
|
+
o.render(/* @__PURE__ */ g(C, {
|
|
144
|
+
...i,
|
|
145
|
+
ref: (e) => {
|
|
146
|
+
e && (c = !0);
|
|
147
|
+
},
|
|
148
|
+
open: s,
|
|
149
|
+
onChange: () => f.close(),
|
|
150
|
+
onAfterClose: u,
|
|
151
|
+
children: t
|
|
152
|
+
}));
|
|
153
|
+
}, f = { close: () => {
|
|
154
|
+
if (!(!s || l)) {
|
|
155
|
+
s = !1, w.delete(f);
|
|
156
|
+
try {
|
|
157
|
+
n?.();
|
|
158
|
+
} finally {
|
|
159
|
+
c ? d() : u();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
} };
|
|
163
|
+
return w.add(f), d(), f;
|
|
164
|
+
}, E = Object.assign(C, {
|
|
165
|
+
open: T,
|
|
166
|
+
info: (e) => T({
|
|
167
|
+
...e,
|
|
168
|
+
status: "info"
|
|
169
|
+
}),
|
|
170
|
+
success: (e) => T({
|
|
171
|
+
...e,
|
|
172
|
+
status: "success"
|
|
173
|
+
}),
|
|
174
|
+
warning: (e) => T({
|
|
175
|
+
...e,
|
|
176
|
+
status: "warning"
|
|
177
|
+
}),
|
|
178
|
+
error: (e) => T({
|
|
179
|
+
...e,
|
|
180
|
+
status: "error"
|
|
181
|
+
}),
|
|
182
|
+
closeAll: () => {
|
|
183
|
+
[...w].forEach((e) => e.close());
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
//#endregion
|
|
187
|
+
export { E as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./icon-DRLyKu8p.cjs"),t=require("./effect-BpNxm_06.cjs"),n=require("./state-BuUx1onZ.cjs"),r=require("./Transition-BBMxZ5_8.cjs"),i=require("./notice-timer-OkrpLRrG.cjs");let a=require("lucide-react"),o=require("react"),s=require("react/jsx-runtime"),c=require("react-dom"),l=require("react-dom/client");var u=new Map,d=e=>{let t=u.get(e);if(!t||!document.body.contains(t.element)){let n=document.createElement(`div`);n.className=`vl-notification-host is-${e}`,document.body.appendChild(n),t={element:n,users:0},u.set(e,t)}t.users+=1;let n=t;return{element:n.element,release:()=>{--n.users,!(n.users>0)&&(n.element.remove(),u.get(e)===n&&u.delete(e))}}},f={info:a.Info,success:a.CircleCheck,warning:a.CircleAlert,error:a.CircleX},p=(0,o.forwardRef)((l,u)=>{let{open:p,defaultOpen:m=!1,title:h,status:g=`info`,icon:_,placement:v=`top-right`,duration:y=4500,closable:b=!0,pauseOnHover:x=!0,pauseOnFocus:S=!0,closeOnPressEscape:C=!0,action:w,onChange:T,onClose:E,onAfterClose:D,onMouseEnter:O,onMouseLeave:k,onFocusCapture:A,onBlurCapture:j,onKeyDown:M,role:N=g===`error`||g===`warning`?`alert`:`status`,className:P,children:F,...I}=l,[L,R]=n.n({value:!!p,defaultValue:m,controlled:n.t(l,`open`),onChange:T}),[z,B]=(0,o.useState)(null),[V,H]=(0,o.useState)(!1),[U,W]=(0,o.useState)(!1),G=(0,o.useRef)(!1),K=(0,o.useRef)({open:L,onClose:E});t.t(()=>{K.current={open:L,onClose:E}}),t.t(()=>{L&&(G.current=!1)},[L]);let q=(0,o.useCallback)(()=>{!K.current.open||G.current||(G.current=!0,R(!1),K.current.onClose?.())},[R]);if((0,o.useEffect)(()=>{let e=d(v);return B(e.element),e.release},[v]),(0,o.useEffect)(()=>{L||(H(!1),W(!1))},[L]),i.t({open:L,ready:!!z,duration:y,paused:x&&V||S&&U,onTimeout:q}),!z)return null;let J=_===void 0?f[g]:_,Y=h!=null&&h!==!1;return(0,c.createPortal)((0,s.jsx)(r.t,{show:L,name:`vl-notification-fade`,onAfterLeave:D,children:(0,s.jsxs)(`div`,{...I,ref:u,className:[`vl-notification`,`is-${g}`,Y?`has-title`:``,P||``].filter(Boolean).join(` `),role:N,"aria-atomic":I[`aria-atomic`]??!0,"aria-hidden":!L||I[`aria-hidden`]||void 0,onMouseEnter:e=>{H(!0),O?.(e)},onMouseLeave:e=>{H(!1),k?.(e)},onFocusCapture:e=>{W(!0),A?.(e)},onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||W(!1),j?.(e)},onKeyDown:e=>{M?.(e),!(e.defaultPrevented||e.key!==`Escape`||!C)&&(e.stopPropagation(),q())},children:[J?e.t(J,`vl-notification__icon`):null,(0,s.jsxs)(`div`,{className:`vl-notification__body`,children:[Y?(0,s.jsx)(`div`,{className:`vl-notification__title`,children:h}):null,F===void 0?null:(0,s.jsx)(`div`,{className:`vl-notification__content`,children:F}),w?(0,s.jsx)(`div`,{className:`vl-notification__action`,children:w}):null]}),b?(0,s.jsx)(`button`,{type:`button`,className:`vl-notification__close`,"aria-label":`关闭通知`,title:`关闭通知`,disabled:!L,onClick:q,children:(0,s.jsx)(a.X,{"aria-hidden":`true`})}):null]})}),z)});p.displayName=`VlNotification`;var m=new Set,h=e=>{if(typeof document>`u`)throw Error(`VlNotification imperative APIs are only available in a browser environment.`);let{content:t,onClose:n,onAfterClose:r,...i}=e,a=document.createElement(`div`);a.className=`vl-notification-container`,document.body.appendChild(a);let o=(0,l.createRoot)(a),c=!0,u=!1,d=!1,f=()=>{d||(d=!0,m.delete(g),queueMicrotask(()=>{o.unmount(),a.remove(),r?.()}))},h=()=>{o.render((0,s.jsx)(p,{...i,ref:e=>{e&&(u=!0)},open:c,onChange:()=>g.close(),onAfterClose:f,children:t}))},g={close:()=>{if(!(!c||d)){c=!1,m.delete(g);try{n?.()}finally{u?h():f()}}}};return m.add(g),h(),g},g=Object.assign(p,{open:h,info:e=>h({...e,status:`info`}),success:e=>h({...e,status:`success`}),warning:e=>h({...e,status:`warning`}),error:e=>h({...e,status:`error`}),closeAll:()=>{[...m].forEach(e=>e.close())}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./state-BuUx1onZ.cjs"),t=require("./number-B7qJF_ZY.cjs"),n=require("./Select-
|
|
1
|
+
const e=require("./state-BuUx1onZ.cjs"),t=require("./number-B7qJF_ZY.cjs"),n=require("./Select-D8udcz4F.cjs");let r=require("lucide-react"),i=require("react"),a=require("react/jsx-runtime");var o=[10,20,50,100],s=(e,t)=>typeof e!=`number`||!Number.isFinite(e)?t:Math.max(1,Math.floor(e)),c=e=>typeof e!=`number`||!Number.isFinite(e)?0:Math.max(0,Math.floor(e)),l=(e,t)=>{let n=[...e??o].filter(e=>typeof e==`number`&&Number.isFinite(e)&&e>0).map(e=>Math.floor(e)).filter(e=>e>0).filter((e,t,n)=>n.indexOf(e)===t).sort((e,t)=>e-t);return n.length?n:[t]},u=(e,t)=>{if(e<=7)return Array.from({length:e},(e,t)=>t+1);let n=Math.max(2,t-1),r=Math.min(e-1,t+1),i=n>2,a=r<e-1;return i?a?[1,`ellipsis-start`,n,t,r,`ellipsis-end`,e]:[1,`ellipsis-start`,e-4,e-3,e-2,e-1,e]:[1,2,3,4,5,`ellipsis-end`,e]},d=(0,i.forwardRef)((o,d)=>{let{current:f,defaultCurrent:p=1,total:m=0,pageSize:h,defaultPageSize:g=10,pageSizeOptions:_,showTotal:v=!1,showSizeChanger:y=!1,showQuickJumper:b=!1,size:x=`md`,disabled:S=!1,className:C,id:w,"aria-label":T=`分页导航`,onChange:E,onPageSizeChange:D,...O}=o,k=e.t(o,`current`),A=e.t(o,`pageSize`),j=s(g,10),[M,N]=(0,i.useState)(()=>s(p,1)),[P,F]=(0,i.useState)(j),[I,L]=(0,i.useState)(``),R=c(m),z=s(A?h:P,j),B=Math.max(1,Math.ceil(R/z)),V=t.t(s(k?f:M,1),1,B),H=(0,i.useMemo)(()=>l(_,z),[_,z]),U=(0,i.useMemo)(()=>H.map(e=>({value:e,label:`${e} 条/页`})),[H]),W=(0,i.useMemo)(()=>u(B,V),[B,V]),G=R===0?[0,0]:[(V-1)*z+1,Math.min(V*z,R)];(0,i.useEffect)(()=>{L(String(V))},[V]),(0,i.useEffect)(()=>{!k&&M!==V&&N(V)},[V,k,M]);let K=[`vl-pagination`,`size-${x}`,S?`is-disabled`:``,C||``].filter(Boolean).join(` `),q=(e,t=z)=>{k||N(e),E?.(e,t)},J=e=>{if(S)return;let n=t.t(e,1,B);n!==V&&q(n)},Y=e=>{if(S||e===null||Array.isArray(e))return;let n=s(Number(e),z);if(n===z)return;let r=Math.max(1,Math.ceil(R/n)),i=t.t(V,1,r);A||F(n),k||N(i),D?.(n,i),E?.(i,n)},X=()=>{if(S)return;let e=I.trim();if(!/^\d+$/.test(e))return;let t=Number(e);!Number.isSafeInteger(t)||t<1||t>B||J(t)},Z=e=>{e.key===`Enter`&&(e.preventDefault(),X())},Q=(e,t,n,r)=>{let o=e===`first`||e===`previous`?V<=1:V>=B;return(0,a.jsx)(`button`,{type:`button`,className:`vl-pagination__button vl-pagination__nav-button`,"aria-label":t,disabled:S||o,onClick:()=>J(n),children:(0,i.createElement)(r,{"aria-hidden":!0,focusable:!1})})};return(0,a.jsxs)(`nav`,{ref:d,id:w,className:K,"aria-label":T,"aria-disabled":S||void 0,...O,children:[v?(0,a.jsx)(`span`,{className:`vl-pagination__total`,children:typeof v==`function`?v(R,G):`第 ${G[0]}-${G[1]} 条,共 ${R} 条`}):null,(0,a.jsxs)(`div`,{className:`vl-pagination__controls`,children:[(0,a.jsxs)(`div`,{className:`vl-pagination__pages`,children:[Q(`first`,`第一页`,1,r.ChevronsLeft),Q(`previous`,`上一页`,V-1,r.ChevronLeft),W.map(e=>typeof e==`number`?(0,a.jsx)(`button`,{type:`button`,className:`vl-pagination__button ${e===V?`is-active`:``}`,"aria-label":`第 ${e} 页`,"aria-current":e===V?`page`:void 0,disabled:S,onClick:()=>J(e),children:e},e):(0,a.jsx)(`span`,{className:`vl-pagination__ellipsis`,"aria-hidden":`true`,children:`…`},e)),Q(`next`,`下一页`,V+1,r.ChevronRight),Q(`last`,`最后一页`,B,r.ChevronsRight)]}),y?(0,a.jsx)(`div`,{className:`vl-pagination__size-changer`,children:(0,a.jsx)(n.t,{value:z,options:U,size:x,disabled:S,"aria-label":`每页条数`,onChange:Y})}):null,b?(0,a.jsxs)(`label`,{className:`vl-pagination__quick-jumper`,children:[(0,a.jsx)(`span`,{children:`跳至`}),(0,a.jsx)(`input`,{value:I,type:`text`,inputMode:`numeric`,"aria-label":`跳转到页码`,disabled:S,onChange:e=>L(e.target.value),onKeyDown:Z,onBlur:X}),(0,a.jsx)(`span`,{children:`页`})]}):null]})]})});d.displayName=`VlPagination`;var f=d,p=d;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./state-BSDh-Ob2.js";
|
|
2
2
|
import { t } from "./number-BN2jHM6Z.js";
|
|
3
|
-
import { t as n } from "./Select-
|
|
3
|
+
import { t as n } from "./Select-CpoP5kRp.js";
|
|
4
4
|
import { ChevronLeft as r, ChevronRight as i, ChevronsLeft as a, ChevronsRight as ee } from "lucide-react";
|
|
5
5
|
import { createElement as o, forwardRef as s, useEffect as c, useMemo as l, useState as u } from "react";
|
|
6
6
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./effect-BpNxm_06.cjs"),t=require("./state-BuUx1onZ.cjs"),n=require("./layer-BcLkE2NM.cjs"),r=require("./Button-qURrKHQ0.cjs"),i=require("./Popover-Dqrb-lKh.cjs");let a=require("lucide-react"),o=require("react"),s=require("react/jsx-runtime");var c=(0,o.forwardRef)((c,l)=>{let{open:u,defaultOpen:d=!1,onChange:f,title:p,children:m,onConfirm:h,onConfirmError:g,onCancel:_,confirmButtonText:v=`确定`,cancelButtonText:y=`取消`,closeOnOutsideClick:b=!0,closeOnPressEscape:x=!0,disabled:S=!1,className:C,...w}=c,[T,E]=t.n({value:!!u,defaultValue:d,controlled:t.t(c,`open`),onChange:f}),D=n.f(),O=T&&!S&&D,[k,A]=(0,o.useState)(!1),j=p!=null&&p!==!1&&p!==``,M=(0,o.useRef)(!1),N=(0,o.useRef)(0),P=(0,o.useRef)(!1),F=(0,o.useRef)({open:O,onConfirmError:g});e.t(()=>{F.current={open:O,onConfirmError:g}}),e.t(()=>{O||(N.current+=1,M.current=!1,A(!1))},[O]),e.t(()=>(P.current=!0,()=>{P.current=!1,N.current+=1,M.current=!1}),[]);let I=async e=>{if(M.current||!F.current.open)return;let t=e.currentTarget.closest(`[role="dialog"]`);t?.contains(document.activeElement)&&t.focus({preventScroll:!0}),M.current=!0,A(!0);let n=++N.current;try{if(await h?.(),!P.current||n!==N.current||!F.current.open)return;E(!1)}catch(e){P.current&&n===N.current&&F.current.open&&F.current.onConfirmError?.(e)}finally{P.current&&n===N.current&&(M.current=!1,A(!1))}};return(0,s.jsx)(i.t,{...w,ref:l,title:j?(0,s.jsxs)(`span`,{className:`vl-popconfirm__title`,children:[(0,s.jsx)(a.CircleAlert,{"aria-hidden":`true`}),(0,s.jsx)(`span`,{children:p})]}):p,open:T,disabled:S,trigger:`click`,className:[`vl-popconfirm`,C].filter(Boolean).join(` `),closeOnOutsideClick:b&&!k,closeOnPressEscape:x&&!k,onChange:e=>{M.current||E(e)},children:(0,s.jsxs)(`div`,{className:`vl-popconfirm__body`,"aria-busy":k,children:[m,(0,s.jsxs)(`div`,{className:`vl-popconfirm__actions`,children:[(0,s.jsx)(r.t,{size:`sm`,variant:`text`,disabled:k,"data-vl-autofocus":!0,onClick:()=>{_?.(),E(!1)},children:y}),(0,s.jsx)(r.t,{size:`sm`,status:`primary`,variant:`solid`,loading:k,onClick:I,children:v})]})]})})});c.displayName=`VlPopconfirm`;var l=c,u=c;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { t as e } from "./effect-nifYL_rH.js";
|
|
2
|
+
import { n as t, t as n } from "./state-BSDh-Ob2.js";
|
|
3
|
+
import { f as r } from "./layer-B9unaPbV.js";
|
|
4
|
+
import { t as i } from "./Button-CwkWSWau.js";
|
|
5
|
+
import { t as a } from "./Popover-Cb8BrtQC.js";
|
|
6
|
+
import { CircleAlert as o } from "lucide-react";
|
|
7
|
+
import { forwardRef as s, useRef as c, useState as l } from "react";
|
|
8
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
+
//#region components/Popconfirm/Popconfirm.tsx
|
|
10
|
+
var f = s((s, f) => {
|
|
11
|
+
let { open: p, defaultOpen: m = !1, onChange: h, title: g, children: _, onConfirm: v, onConfirmError: y, onCancel: b, confirmButtonText: x = "确定", cancelButtonText: S = "取消", closeOnOutsideClick: C = !0, closeOnPressEscape: w = !0, disabled: T = !1, className: E, ...D } = s, [O, k] = t({
|
|
12
|
+
value: !!p,
|
|
13
|
+
defaultValue: m,
|
|
14
|
+
controlled: n(s, "open"),
|
|
15
|
+
onChange: h
|
|
16
|
+
}), A = r(), j = O && !T && A, [M, N] = l(!1), P = g != null && g !== !1 && g !== "", F = c(!1), I = c(0), L = c(!1), R = c({
|
|
17
|
+
open: j,
|
|
18
|
+
onConfirmError: y
|
|
19
|
+
});
|
|
20
|
+
e(() => {
|
|
21
|
+
R.current = {
|
|
22
|
+
open: j,
|
|
23
|
+
onConfirmError: y
|
|
24
|
+
};
|
|
25
|
+
}), e(() => {
|
|
26
|
+
j || (I.current += 1, F.current = !1, N(!1));
|
|
27
|
+
}, [j]), e(() => (L.current = !0, () => {
|
|
28
|
+
L.current = !1, I.current += 1, F.current = !1;
|
|
29
|
+
}), []);
|
|
30
|
+
let z = async (e) => {
|
|
31
|
+
if (F.current || !R.current.open) return;
|
|
32
|
+
let t = e.currentTarget.closest("[role=\"dialog\"]");
|
|
33
|
+
t?.contains(document.activeElement) && t.focus({ preventScroll: !0 }), F.current = !0, N(!0);
|
|
34
|
+
let n = ++I.current;
|
|
35
|
+
try {
|
|
36
|
+
if (await v?.(), !L.current || n !== I.current || !R.current.open) return;
|
|
37
|
+
k(!1);
|
|
38
|
+
} catch (e) {
|
|
39
|
+
L.current && n === I.current && R.current.open && R.current.onConfirmError?.(e);
|
|
40
|
+
} finally {
|
|
41
|
+
L.current && n === I.current && (F.current = !1, N(!1));
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ u(a, {
|
|
45
|
+
...D,
|
|
46
|
+
ref: f,
|
|
47
|
+
title: P ? /* @__PURE__ */ d("span", {
|
|
48
|
+
className: "vl-popconfirm__title",
|
|
49
|
+
children: [/* @__PURE__ */ u(o, { "aria-hidden": "true" }), /* @__PURE__ */ u("span", { children: g })]
|
|
50
|
+
}) : g,
|
|
51
|
+
open: O,
|
|
52
|
+
disabled: T,
|
|
53
|
+
trigger: "click",
|
|
54
|
+
className: ["vl-popconfirm", E].filter(Boolean).join(" "),
|
|
55
|
+
closeOnOutsideClick: C && !M,
|
|
56
|
+
closeOnPressEscape: w && !M,
|
|
57
|
+
onChange: (e) => {
|
|
58
|
+
F.current || k(e);
|
|
59
|
+
},
|
|
60
|
+
children: /* @__PURE__ */ d("div", {
|
|
61
|
+
className: "vl-popconfirm__body",
|
|
62
|
+
"aria-busy": M,
|
|
63
|
+
children: [_, /* @__PURE__ */ d("div", {
|
|
64
|
+
className: "vl-popconfirm__actions",
|
|
65
|
+
children: [/* @__PURE__ */ u(i, {
|
|
66
|
+
size: "sm",
|
|
67
|
+
variant: "text",
|
|
68
|
+
disabled: M,
|
|
69
|
+
"data-vl-autofocus": !0,
|
|
70
|
+
onClick: () => {
|
|
71
|
+
b?.(), k(!1);
|
|
72
|
+
},
|
|
73
|
+
children: S
|
|
74
|
+
}), /* @__PURE__ */ u(i, {
|
|
75
|
+
size: "sm",
|
|
76
|
+
status: "primary",
|
|
77
|
+
variant: "solid",
|
|
78
|
+
loading: M,
|
|
79
|
+
onClick: z,
|
|
80
|
+
children: x
|
|
81
|
+
})]
|
|
82
|
+
})]
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
f.displayName = "VlPopconfirm";
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region components/Popconfirm/index.ts
|
|
89
|
+
var p = f, m = f;
|
|
90
|
+
//#endregion
|
|
91
|
+
export { p as n, m as t };
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { t as e } from "./effect-nifYL_rH.js";
|
|
2
|
+
import { n as t, t as n } from "./state-BSDh-Ob2.js";
|
|
3
|
+
import { n as r } from "./refs-D5IYOBaf.js";
|
|
4
|
+
import { t as i } from "./Transition-CJDv6yI5.js";
|
|
5
|
+
import { t as a } from "./client-pj_wzx28.js";
|
|
6
|
+
import { t as ee } from "./number-BN2jHM6Z.js";
|
|
7
|
+
import { c as o, d as s, f as te, g as c, i as ne, l as re, o as ie, s as ae, t as oe, v as l } from "./layer-B9unaPbV.js";
|
|
8
|
+
import { i as se, n as ce, r as le } from "./floating-C8pd2mFu.js";
|
|
9
|
+
import { t as ue } from "./id-CHixuHb7.js";
|
|
10
|
+
import { Fragment as de, cloneElement as fe, forwardRef as u, isValidElement as pe, useCallback as d, useEffect as f, useMemo as me, useRef as p } from "react";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import { createPortal as he } from "react-dom";
|
|
13
|
+
//#region components/Popover/Popover.tsx
|
|
14
|
+
var g = u((u, g) => {
|
|
15
|
+
let { triggerContent: _, title: v, children: ge, open: _e, defaultOpen: ve = !1, onChange: ye, trigger: y = "click", placement: b = "bottom", disabled: x = !1, offset: S = 8, zIndex: be, maxWidth: C = 360, showArrow: xe = !0, showDelay: w = 100, hideDelay: Se = 100, closeOnOutsideClick: Ce = !0, closeOnPressEscape: T = !0, panelLabel: we = "弹出面板", className: Te, onClick: Ee, onKeyDown: De, ...Oe } = u, [E, D] = t({
|
|
16
|
+
value: !!_e,
|
|
17
|
+
defaultValue: ve,
|
|
18
|
+
controlled: n(u, "open"),
|
|
19
|
+
onChange: ye
|
|
20
|
+
}), O = te(), k = E && !x && O, A = a(), j = p(null), M = p(null), N = p(null), ke = me(() => r(j, g), [g]), P = ie({
|
|
21
|
+
defaultZIndex: ne.popover,
|
|
22
|
+
zIndex: be
|
|
23
|
+
}), F = ue("vl-popover"), I = `${F}-title`, L = v != null && v !== !1 && v !== "", [{ style: R, placement: Ae, arrowStyle: je }, z] = se(b), B = p(null), V = p(!1), H = p(!1), U = p(!1), W = p(!1), G = p(!1), K = d(() => {
|
|
24
|
+
B.current !== null && clearTimeout(B.current), B.current = null;
|
|
25
|
+
}, []), q = d(() => {
|
|
26
|
+
let e = M.current && l(M.current)[0];
|
|
27
|
+
H.current = !0, e?.focus({ preventScroll: !0 });
|
|
28
|
+
}, []), J = d((e, t = !1) => {
|
|
29
|
+
K(), !(e && (x || !O)) && (U.current = !e && t, D(e));
|
|
30
|
+
}, [
|
|
31
|
+
K,
|
|
32
|
+
x,
|
|
33
|
+
O,
|
|
34
|
+
D
|
|
35
|
+
]), Y = d(() => {
|
|
36
|
+
let e = M.current, t = N.current;
|
|
37
|
+
if (!k || !e || !t) return;
|
|
38
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = ce({
|
|
39
|
+
anchorRect: n,
|
|
40
|
+
floatingRect: r,
|
|
41
|
+
placement: b,
|
|
42
|
+
offset: S
|
|
43
|
+
}), a = i.placement.startsWith("top") || i.placement.startsWith("bottom"), o = a ? n.left + n.width / 2 - i.x : n.top + n.height / 2 - i.y, s = `${Math.round(ee(o, 12, Math.max(12, (a ? r.width : r.height) - 12)))}px`;
|
|
44
|
+
z({
|
|
45
|
+
placement: i.placement,
|
|
46
|
+
style: {
|
|
47
|
+
left: `${Math.round(i.x)}px`,
|
|
48
|
+
top: `${Math.round(i.y)}px`
|
|
49
|
+
},
|
|
50
|
+
arrowStyle: a ? { left: s } : { top: s }
|
|
51
|
+
});
|
|
52
|
+
}, [
|
|
53
|
+
k,
|
|
54
|
+
b,
|
|
55
|
+
S,
|
|
56
|
+
z
|
|
57
|
+
]), Me = d(() => J(!1), [J]), Ne = d(() => J(!1, !0), [J]), X = le({
|
|
58
|
+
active: k && A,
|
|
59
|
+
rootRef: j,
|
|
60
|
+
floatingRef: N,
|
|
61
|
+
closeOnOutsideClick: Ce,
|
|
62
|
+
onOutsideClick: Me,
|
|
63
|
+
onEscape: T ? Ne : void 0,
|
|
64
|
+
onViewportChange: Y
|
|
65
|
+
});
|
|
66
|
+
e(() => {
|
|
67
|
+
if (!A) return;
|
|
68
|
+
let e = N.current;
|
|
69
|
+
if (!e) return;
|
|
70
|
+
let t = W.current;
|
|
71
|
+
W.current = k;
|
|
72
|
+
let n = document.activeElement !== null && !M.current?.contains(document.activeElement) && s(X, document.activeElement);
|
|
73
|
+
e.toggleAttribute("inert", !k), k ? (Y(), !t && y === "click" && (G.current = !0), G.current && R.left !== void 0 && (G.current = !1, c(e))) : t && O && (U.current || n) && q(), k || (U.current = !1, G.current = !1);
|
|
74
|
+
}, [
|
|
75
|
+
A,
|
|
76
|
+
k,
|
|
77
|
+
y,
|
|
78
|
+
O,
|
|
79
|
+
X,
|
|
80
|
+
Y,
|
|
81
|
+
q,
|
|
82
|
+
R.left
|
|
83
|
+
]), f(() => {
|
|
84
|
+
if (!k || !A) return;
|
|
85
|
+
let e = new ResizeObserver(Y);
|
|
86
|
+
return M.current && e.observe(M.current), N.current && e.observe(N.current), () => e.disconnect();
|
|
87
|
+
}, [
|
|
88
|
+
k,
|
|
89
|
+
A,
|
|
90
|
+
Y
|
|
91
|
+
]), f(() => () => K(), [K]), f(() => {
|
|
92
|
+
!x && O || (K(), E && D(!1));
|
|
93
|
+
}, [
|
|
94
|
+
x,
|
|
95
|
+
O,
|
|
96
|
+
E,
|
|
97
|
+
K,
|
|
98
|
+
D
|
|
99
|
+
]);
|
|
100
|
+
let Z = () => {
|
|
101
|
+
K(), !(x || H.current) && (w <= 0 ? J(!0) : B.current = setTimeout(() => J(!0), w));
|
|
102
|
+
}, Q = (e = !1) => {
|
|
103
|
+
K(), !(V.current || !e && s(X, document.activeElement)) && (B.current = setTimeout(() => {
|
|
104
|
+
!V.current && !s(X, document.activeElement) && J(!1);
|
|
105
|
+
}, Math.max(0, Se)));
|
|
106
|
+
}, Pe = (e) => {
|
|
107
|
+
s(X, e.relatedTarget) || (H.current = !1, y !== "click" && Q(!0));
|
|
108
|
+
}, Fe = (e) => {
|
|
109
|
+
if (De?.(e), e.defaultPrevented || !k) return;
|
|
110
|
+
if (e.key === "Escape" && re(X, e.nativeEvent)) {
|
|
111
|
+
e.preventDefault(), e.stopPropagation(), T && J(!1, !0);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (e.key !== "Tab") return;
|
|
115
|
+
let t = e.target;
|
|
116
|
+
if (M.current?.contains(t)) {
|
|
117
|
+
!e.shiftKey && N.current && (e.preventDefault(), c(N.current));
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (!s(X, t)) return;
|
|
121
|
+
let n = o(X), r = n.indexOf(t) + (e.shiftKey ? -1 : 1);
|
|
122
|
+
if (e.preventDefault(), r >= 0 && r < n.length) n[r].focus();
|
|
123
|
+
else if (J(!1), e.shiftKey) q();
|
|
124
|
+
else {
|
|
125
|
+
let e = l(document.body), t = e.reduce((e, t, n) => M.current?.contains(t) ? n : e, -1), n = e.slice(t + 1).find((e) => !s(X, e));
|
|
126
|
+
n ? n.focus() : q();
|
|
127
|
+
}
|
|
128
|
+
}, Ie = {
|
|
129
|
+
"aria-haspopup": "dialog",
|
|
130
|
+
"aria-expanded": k,
|
|
131
|
+
"aria-controls": F,
|
|
132
|
+
"aria-disabled": x || void 0
|
|
133
|
+
}, Le = pe(_) && _.type !== de ? fe(_, Ie) : /* @__PURE__ */ m("button", {
|
|
134
|
+
type: "button",
|
|
135
|
+
className: "vl-popover__default-trigger",
|
|
136
|
+
disabled: x,
|
|
137
|
+
...Ie,
|
|
138
|
+
children: _ ?? "打开面板"
|
|
139
|
+
}), $ = /* @__PURE__ */ m(i, {
|
|
140
|
+
show: k,
|
|
141
|
+
name: "vl-popover",
|
|
142
|
+
forceMount: A,
|
|
143
|
+
deferEffects: !A,
|
|
144
|
+
onAfterLeave: () => {
|
|
145
|
+
k || z({
|
|
146
|
+
placement: b,
|
|
147
|
+
style: {}
|
|
148
|
+
});
|
|
149
|
+
},
|
|
150
|
+
children: /* @__PURE__ */ h("div", {
|
|
151
|
+
ref: N,
|
|
152
|
+
id: F,
|
|
153
|
+
className: `vl-popover__panel is-${Ae}`,
|
|
154
|
+
role: "dialog",
|
|
155
|
+
tabIndex: -1,
|
|
156
|
+
"aria-labelledby": L ? I : void 0,
|
|
157
|
+
"aria-label": L ? void 0 : we,
|
|
158
|
+
"aria-hidden": !k || void 0,
|
|
159
|
+
style: {
|
|
160
|
+
...R,
|
|
161
|
+
zIndex: P.zIndex,
|
|
162
|
+
maxWidth: `min(${typeof C == "number" ? `${C}px` : C}, calc(100vw - 16px))`,
|
|
163
|
+
visibility: R.left !== void 0 || !A && k ? "visible" : "hidden",
|
|
164
|
+
pointerEvents: k ? "auto" : "none"
|
|
165
|
+
},
|
|
166
|
+
onMouseEnter: () => {
|
|
167
|
+
V.current = !0, K();
|
|
168
|
+
},
|
|
169
|
+
onMouseLeave: (e) => {
|
|
170
|
+
V.current = !1, y === "hover" && !(e.relatedTarget instanceof Node && s(X, e.relatedTarget)) && Q();
|
|
171
|
+
},
|
|
172
|
+
onFocus: K,
|
|
173
|
+
onBlur: Pe,
|
|
174
|
+
children: [
|
|
175
|
+
xe ? /* @__PURE__ */ m("span", {
|
|
176
|
+
className: "vl-popover__arrow",
|
|
177
|
+
style: je,
|
|
178
|
+
"aria-hidden": "true"
|
|
179
|
+
}) : null,
|
|
180
|
+
L ? /* @__PURE__ */ m("div", {
|
|
181
|
+
id: I,
|
|
182
|
+
className: "vl-popover__title",
|
|
183
|
+
children: v
|
|
184
|
+
}) : null,
|
|
185
|
+
/* @__PURE__ */ m("div", {
|
|
186
|
+
className: "vl-popover__content",
|
|
187
|
+
children: ge
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
})
|
|
191
|
+
});
|
|
192
|
+
return /* @__PURE__ */ m(oe, {
|
|
193
|
+
layer: P.layer,
|
|
194
|
+
children: /* @__PURE__ */ h("div", {
|
|
195
|
+
...Oe,
|
|
196
|
+
ref: ke,
|
|
197
|
+
className: [
|
|
198
|
+
"vl-popover",
|
|
199
|
+
x ? "is-disabled" : "",
|
|
200
|
+
Te
|
|
201
|
+
].filter(Boolean).join(" "),
|
|
202
|
+
onKeyDown: Fe,
|
|
203
|
+
onClick: (e) => {
|
|
204
|
+
Ee?.(e), !e.defaultPrevented && y === "click" && M.current?.contains(e.target) && J(!k);
|
|
205
|
+
},
|
|
206
|
+
children: [/* @__PURE__ */ m("div", {
|
|
207
|
+
ref: M,
|
|
208
|
+
className: "vl-popover__trigger",
|
|
209
|
+
onMouseEnter: () => {
|
|
210
|
+
y === "hover" && (V.current = !0, H.current = !1, Z());
|
|
211
|
+
},
|
|
212
|
+
onMouseLeave: (e) => {
|
|
213
|
+
V.current = !1, y === "hover" && !(e.relatedTarget instanceof Node && s(X, e.relatedTarget)) && Q();
|
|
214
|
+
},
|
|
215
|
+
onFocus: () => {
|
|
216
|
+
y !== "click" && Z();
|
|
217
|
+
},
|
|
218
|
+
onBlur: Pe,
|
|
219
|
+
children: Le
|
|
220
|
+
}), /* @__PURE__ */ m(ae, {
|
|
221
|
+
scope: X,
|
|
222
|
+
children: A ? he($, document.body) : $
|
|
223
|
+
})]
|
|
224
|
+
})
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
g.displayName = "VlPopover";
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region components/Popover/index.ts
|
|
230
|
+
var _ = g, v = g;
|
|
231
|
+
//#endregion
|
|
232
|
+
export { _ as n, v as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./effect-BpNxm_06.cjs"),t=require("./state-BuUx1onZ.cjs"),n=require("./refs-DCqd87V8.cjs"),r=require("./Transition-BBMxZ5_8.cjs"),i=require("./client-BkoqeUs3.cjs"),ee=require("./number-B7qJF_ZY.cjs"),a=require("./layer-BcLkE2NM.cjs"),o=require("./floating-B6CCQcuK.cjs"),s=require("./id-CF0zOP1G.cjs");let c=require("react"),l=require("react/jsx-runtime"),te=require("react-dom");var u=(0,c.forwardRef)((u,d)=>{let{triggerContent:f,title:p,children:ne,open:re,defaultOpen:ie=!1,onChange:ae,trigger:m=`click`,placement:h=`bottom`,disabled:g=!1,offset:_=8,zIndex:oe,maxWidth:v=360,showArrow:y=!0,showDelay:b=100,hideDelay:se=100,closeOnOutsideClick:ce=!0,closeOnPressEscape:x=!0,panelLabel:le=`弹出面板`,className:ue,onClick:S,onKeyDown:de,...C}=u,[w,T]=t.n({value:!!re,defaultValue:ie,controlled:t.t(u,`open`),onChange:ae}),E=a.f(),D=w&&!g&&E,O=i.t(),k=(0,c.useRef)(null),A=(0,c.useRef)(null),j=(0,c.useRef)(null),fe=(0,c.useMemo)(()=>n.n(k,d),[d]),M=a.o({defaultZIndex:a.i.popover,zIndex:oe}),N=s.t(`vl-popover`),P=`${N}-title`,F=p!=null&&p!==!1&&p!==``,[{style:I,placement:pe,arrowStyle:me},L]=o.i(h),R=(0,c.useRef)(null),z=(0,c.useRef)(!1),B=(0,c.useRef)(!1),V=(0,c.useRef)(!1),H=(0,c.useRef)(!1),U=(0,c.useRef)(!1),W=(0,c.useCallback)(()=>{R.current!==null&&clearTimeout(R.current),R.current=null},[]),G=(0,c.useCallback)(()=>{let e=A.current&&a.v(A.current)[0];B.current=!0,e?.focus({preventScroll:!0})},[]),K=(0,c.useCallback)((e,t=!1)=>{W(),!(e&&(g||!E))&&(V.current=!e&&t,T(e))},[W,g,E,T]),q=(0,c.useCallback)(()=>{let e=A.current,t=j.current;if(!D||!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=o.n({anchorRect:n,floatingRect:r,placement:h,offset:_}),a=i.placement.startsWith(`top`)||i.placement.startsWith(`bottom`),s=a?n.left+n.width/2-i.x:n.top+n.height/2-i.y,c=`${Math.round(ee.t(s,12,Math.max(12,(a?r.width:r.height)-12)))}px`;L({placement:i.placement,style:{left:`${Math.round(i.x)}px`,top:`${Math.round(i.y)}px`},arrowStyle:a?{left:c}:{top:c}})},[D,h,_,L]),he=(0,c.useCallback)(()=>K(!1),[K]),ge=(0,c.useCallback)(()=>K(!1,!0),[K]),J=o.r({active:D&&O,rootRef:k,floatingRef:j,closeOnOutsideClick:ce,onOutsideClick:he,onEscape:x?ge:void 0,onViewportChange:q});e.t(()=>{if(!O)return;let e=j.current;if(!e)return;let t=H.current;H.current=D;let n=document.activeElement!==null&&!A.current?.contains(document.activeElement)&&a.d(J,document.activeElement);e.toggleAttribute(`inert`,!D),D?(q(),!t&&m===`click`&&(U.current=!0),U.current&&I.left!==void 0&&(U.current=!1,a.g(e))):t&&E&&(V.current||n)&&G(),D||(V.current=!1,U.current=!1)},[O,D,m,E,J,q,G,I.left]),(0,c.useEffect)(()=>{if(!D||!O)return;let e=new ResizeObserver(q);return A.current&&e.observe(A.current),j.current&&e.observe(j.current),()=>e.disconnect()},[D,O,q]),(0,c.useEffect)(()=>()=>W(),[W]),(0,c.useEffect)(()=>{!g&&E||(W(),w&&T(!1))},[g,E,w,W,T]);let Y=()=>{W(),!(g||B.current)&&(b<=0?K(!0):R.current=setTimeout(()=>K(!0),b))},X=(e=!1)=>{W(),!(z.current||!e&&a.d(J,document.activeElement))&&(R.current=setTimeout(()=>{!z.current&&!a.d(J,document.activeElement)&&K(!1)},Math.max(0,se)))},Z=e=>{a.d(J,e.relatedTarget)||(B.current=!1,m!==`click`&&X(!0))},_e=e=>{if(de?.(e),e.defaultPrevented||!D)return;if(e.key===`Escape`&&a.l(J,e.nativeEvent)){e.preventDefault(),e.stopPropagation(),x&&K(!1,!0);return}if(e.key!==`Tab`)return;let t=e.target;if(A.current?.contains(t)){!e.shiftKey&&j.current&&(e.preventDefault(),a.g(j.current));return}if(!a.d(J,t))return;let n=a.c(J),r=n.indexOf(t)+(e.shiftKey?-1:1);if(e.preventDefault(),r>=0&&r<n.length)n[r].focus();else if(K(!1),e.shiftKey)G();else{let e=a.v(document.body),t=e.reduce((e,t,n)=>A.current?.contains(t)?n:e,-1),n=e.slice(t+1).find(e=>!a.d(J,e));n?n.focus():G()}},Q={"aria-haspopup":`dialog`,"aria-expanded":D,"aria-controls":N,"aria-disabled":g||void 0},ve=(0,c.isValidElement)(f)&&f.type!==c.Fragment?(0,c.cloneElement)(f,Q):(0,l.jsx)(`button`,{type:`button`,className:`vl-popover__default-trigger`,disabled:g,...Q,children:f??`打开面板`}),$=(0,l.jsx)(r.t,{show:D,name:`vl-popover`,forceMount:O,deferEffects:!O,onAfterLeave:()=>{D||L({placement:h,style:{}})},children:(0,l.jsxs)(`div`,{ref:j,id:N,className:`vl-popover__panel is-${pe}`,role:`dialog`,tabIndex:-1,"aria-labelledby":F?P:void 0,"aria-label":F?void 0:le,"aria-hidden":!D||void 0,style:{...I,zIndex:M.zIndex,maxWidth:`min(${typeof v==`number`?`${v}px`:v}, calc(100vw - 16px))`,visibility:I.left!==void 0||!O&&D?`visible`:`hidden`,pointerEvents:D?`auto`:`none`},onMouseEnter:()=>{z.current=!0,W()},onMouseLeave:e=>{z.current=!1,m===`hover`&&!(e.relatedTarget instanceof Node&&a.d(J,e.relatedTarget))&&X()},onFocus:W,onBlur:Z,children:[y?(0,l.jsx)(`span`,{className:`vl-popover__arrow`,style:me,"aria-hidden":`true`}):null,F?(0,l.jsx)(`div`,{id:P,className:`vl-popover__title`,children:p}):null,(0,l.jsx)(`div`,{className:`vl-popover__content`,children:ne})]})});return(0,l.jsx)(a.t,{layer:M.layer,children:(0,l.jsxs)(`div`,{...C,ref:fe,className:[`vl-popover`,g?`is-disabled`:``,ue].filter(Boolean).join(` `),onKeyDown:_e,onClick:e=>{S?.(e),!e.defaultPrevented&&m===`click`&&A.current?.contains(e.target)&&K(!D)},children:[(0,l.jsx)(`div`,{ref:A,className:`vl-popover__trigger`,onMouseEnter:()=>{m===`hover`&&(z.current=!0,B.current=!1,Y())},onMouseLeave:e=>{z.current=!1,m===`hover`&&!(e.relatedTarget instanceof Node&&a.d(J,e.relatedTarget))&&X()},onFocus:()=>{m!==`click`&&Y()},onBlur:Z,children:ve}),(0,l.jsx)(a.s,{scope:J,children:O?(0,te.createPortal)($,document.body):$})]})})});u.displayName=`VlPopover`;var d=u,f=u;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./id-CF0zOP1G.cjs"),t=require("./content-DCGQZQp8.cjs");let n=require("lucide-react"),r=require("react"),i=require("react/jsx-runtime");var a={success:{icon:n.CircleCheck,title:`操作成功`},info:{icon:n.Info,title:`提示信息`},warning:{icon:n.TriangleAlert,title:`请注意`},error:{icon:n.CircleX,title:`操作失败`},403:{icon:n.ShieldAlert,title:`403 · 暂无访问权限`},404:{icon:n.FileQuestion,title:`404 · 页面不存在`},500:{icon:n.ServerCrash,title:`500 · 服务暂不可用`}},o=(0,r.forwardRef)(({status:n=`info`,title:r,description:o,icon:s,actions:c,children:l,className:u,"aria-label":d,"aria-labelledby":f,...p},m)=>{let h=e.t(`vl-result-title`),g=a[n],_=g.icon;return(0,i.jsxs)(`div`,{...p,ref:m,role:p.role??`region`,"aria-label":d,"aria-labelledby":f??(d?void 0:h),className:[`vl-result`,`is-${n}`,u].filter(Boolean).join(` `),children:[(0,i.jsx)(`div`,{className:`vl-result__icon${s==null?` is-default`:``}`,"aria-hidden":`true`,children:s??(0,i.jsx)(_,{})}),(0,i.jsx)(`h2`,{id:h,className:`vl-result__title`,children:r??g.title}),t.t(o)?(0,i.jsx)(`div`,{className:`vl-result__description`,children:o}):null,t.t(l)?(0,i.jsx)(`div`,{className:`vl-result__body`,children:l}):null,t.t(c)?(0,i.jsx)(`div`,{className:`vl-result__actions`,children:c}):null]})});o.displayName=`VlResult`,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|