react-kui 3.0.0 → 3.1.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/ai/behaviors.json +3 -3
- package/ai/cli.mjs +0 -0
- package/ai/kui-components.json +1552 -1280
- package/ai/mcp.mjs +0 -0
- package/es/_virtual/_rolldown/runtime.js +1 -1
- package/es/affix/index.js +1 -1
- package/es/alert/index.js +29 -15
- package/es/anchor/anchor-context.js +1 -1
- package/es/anchor/anchor-link.js +1 -1
- package/es/anchor/anchor.js +1 -1
- package/es/auto-complete/index.js +378 -437
- package/es/avatar/avatar-group-context.js +1 -1
- package/es/avatar/avatar-group.js +1 -1
- package/es/avatar/avatar.js +2 -2
- package/es/back-top/index.js +3 -3
- package/es/badge/index.js +6 -2
- package/es/base/teleport.js +19 -30
- package/es/base/transition-props.js +1 -1
- package/es/base/transition.js +3 -3
- package/es/breadcrumb/breadcrumb-context.js +1 -1
- package/es/breadcrumb/breadcrumb-item.js +1 -1
- package/es/breadcrumb/breadcrumb.js +1 -1
- package/es/button/button-group-context.js +1 -1
- package/es/button/button-group.js +1 -1
- package/es/button/button.js +2 -2
- package/es/calendar/index.js +1 -1
- package/es/card/index.js +1 -1
- package/es/carousel/carousel-context.js +1 -1
- package/es/carousel/carousel-item.js +1 -1
- package/es/carousel/carousel.js +1 -1
- package/es/cascader/index.js +104 -170
- package/es/check-card/check-card-group.js +1 -1
- package/es/check-card/check-card.js +143 -143
- package/es/check-card/context.js +1 -1
- package/es/checkbox/checkbox-group-context.js +1 -1
- package/es/checkbox/checkbox-group.js +1 -1
- package/es/checkbox/checkbox.js +131 -112
- package/es/checkbox/index.js +1 -1
- package/es/collapse/collapse-panel.js +2 -2
- package/es/collapse/collapse.js +96 -103
- package/es/color-picker/alpha.js +81 -63
- package/es/color-picker/hue.js +69 -51
- package/es/color-picker/index.js +79 -128
- package/es/color-picker/mode.js +1 -1
- package/es/color-picker/paint.js +85 -67
- package/es/color-picker/presets.js +1 -1
- package/es/components.js +4 -2
- package/es/config/config-context.js +1 -1
- package/es/config/context.js +1 -1
- package/es/config/index.js +1 -1
- package/es/config/size-context.js +1 -1
- package/es/config/use-config-appearance.js +1 -1
- package/es/const/var.js +1 -1
- package/es/date-picker/index.js +591 -678
- package/es/descriptions/descriptions-item.js +1 -1
- package/es/descriptions/descriptions.js +2 -2
- package/es/divider/index.js +1 -1
- package/es/drawer/index.js +193 -190
- package/es/dropdown/dropdown-button.js +1 -1
- package/es/dropdown/dropdown-context.js +1 -1
- package/es/dropdown/dropdown.js +173 -331
- package/es/dropdown/trigger.js +1 -1
- package/es/empty/index.js +1 -1
- package/es/feature-card/index.js +1 -1
- package/es/feedback-panel/index.js +1 -1
- package/es/flame-wrap/index.js +1 -1
- package/es/flame-wrap/types.js +1 -1
- package/es/flex/index.js +1 -1
- package/es/form/field-context.js +1 -1
- package/es/form/form-context.js +1 -1
- package/es/form/form-item.js +2 -2
- package/es/form/form.js +1 -1
- package/es/form/utils.js +1 -1
- package/es/grid/grid-item.js +1 -1
- package/es/grid/grid.js +1 -1
- package/es/grid/useBreakpoint.js +1 -1
- package/es/icon/index.js +1 -1
- package/es/image/group.js +1 -1
- package/es/image/image-group-context.js +1 -1
- package/es/image/image.js +1 -1
- package/es/image/instance.js +1 -1
- package/es/image/preview.js +2 -2
- package/es/image/utils.js +1 -1
- package/es/index.js +3 -2
- package/es/input/index.js +1 -1
- package/es/input/input-box.js +1 -1
- package/es/input/input-group.js +2 -2
- package/es/input/input.js +1 -1
- package/es/input/textarea.js +1 -1
- package/es/input-number/index.js +1 -1
- package/es/input-otp/index.js +2 -1
- package/es/input-tag/index.js +13 -43
- package/es/kanban/index.js +1 -1
- package/es/layout/index.js +1 -1
- package/es/layout/layout-context.js +1 -1
- package/es/list-panel/index.js +1 -1
- package/es/loading/index.js +1 -1
- package/es/loading/loading-bar.js +1 -1
- package/es/locale/de.js +1 -1
- package/es/locale/el.js +1 -1
- package/es/locale/en.js +1 -1
- package/es/locale/fr.js +1 -1
- package/es/locale/it.js +1 -1
- package/es/locale/ja.js +1 -1
- package/es/locale/ko.js +1 -1
- package/es/locale/ru.js +1 -1
- package/es/locale/th.js +1 -1
- package/es/locale/uk.js +1 -1
- package/es/locale/vi.js +1 -1
- package/es/locale/zh-CN.js +1 -1
- package/es/locale/zh-TW.js +1 -1
- package/es/mentions/index.js +341 -387
- package/es/menu/menu-context.js +1 -1
- package/es/menu/menu-divider.js +1 -1
- package/es/menu/menu-group.js +1 -1
- package/es/menu/menu-item.js +3 -3
- package/es/menu/menu-keyboard.js +1 -1
- package/es/menu/menu.js +215 -220
- package/es/menu/recursive-menu.js +1 -1
- package/es/menu/sub-menu.js +3 -3
- package/es/message/index.js +1 -1
- package/es/modal/api.js +1 -1
- package/es/modal/modal.js +247 -244
- package/es/modal/toast.js +1 -1
- package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +1 -1
- package/es/notice/container.js +1 -1
- package/es/notice/content.js +1 -1
- package/es/notice/index.js +1 -1
- package/es/notice/instance.js +1 -1
- package/es/page/index.js +3 -3
- package/es/page-header/index.js +1 -1
- package/es/popconfirm/index.js +89 -241
- package/es/poptip/index.js +83 -243
- package/es/popup/index.js +429 -0
- package/es/popup/layers.js +33 -0
- package/es/progress/index.js +1 -1
- package/es/qrcode/index.js +1 -1
- package/es/radio/radio-button.js +53 -53
- package/es/radio/radio-group-context.js +1 -1
- package/es/radio/radio-group.js +1 -1
- package/es/radio/radio.js +110 -91
- package/es/rate/index.js +58 -57
- package/es/rate/star.js +1 -1
- package/es/result/index.js +1 -1
- package/es/ripple/index.js +1 -1
- package/es/ripple/types.js +1 -1
- package/es/row-col/col.js +1 -1
- package/es/row-col/row.js +1 -1
- package/es/segmented/index.js +1 -1
- package/es/select/option.js +69 -61
- package/es/select/select.js +78 -213
- package/es/skeleton/skeleton-avatar.js +1 -1
- package/es/skeleton/skeleton-button.js +1 -1
- package/es/skeleton/skeleton-image.js +1 -1
- package/es/skeleton/skeleton-text.js +1 -1
- package/es/skeleton/skeleton.js +1 -1
- package/es/skeleton/use-skeleton-loading.js +1 -1
- package/es/slider/index.js +89 -55
- package/es/slider/thumb.js +2 -1
- package/es/space/index.js +2 -2
- package/es/spin/index.js +1 -1
- package/es/splitter/splitter-panel.js +1 -1
- package/es/splitter/splitter.js +1 -1
- package/es/stat-card/countup.js +8 -4
- package/es/stat-card/rollup.js +122 -0
- package/es/stat-card/stat-card.js +1 -1
- package/es/stat-card/stat-number.js +1 -1
- package/es/stat-card/utils/countup.js +2 -2
- package/es/stat-card/utils/odometer.js +104 -107
- package/es/steps/index.js +1 -1
- package/es/switch/index.js +7 -6
- package/es/table/column-setting.js +1 -1
- package/es/table/index.js +33 -29
- package/es/table/utils.js +1 -1
- package/es/tabs/tab-panel.js +1 -1
- package/es/tabs/tabs.js +15 -6
- package/es/tag/index.js +9 -5
- package/es/time-line/timeline-item.js +1 -1
- package/es/time-line/timeline.js +1 -1
- package/es/tooltip/index.js +127 -248
- package/es/tour/index.js +198 -193
- package/es/transfer/index.js +245 -246
- package/es/tree/index.js +72 -67
- package/es/tree/utils.js +1 -1
- package/es/tree-select/index.js +562 -655
- package/es/typography/index.js +1 -1
- package/es/upload/file-list.js +3 -1
- package/es/upload/index.js +8 -8
- package/es/upload/picture-sort.js +1 -1
- package/es/upload/selector.js +121 -116
- package/es/utils/checked.js +1 -1
- package/es/utils/color.js +1 -1
- package/es/utils/number.js +1 -1
- package/es/utils/placement.js +1 -1
- package/es/utils/popup.js +42 -0
- package/es/utils/react-node.js +1 -1
- package/es/utils/selection-tags.js +55 -0
- package/es/utils/share.js +1 -1
- package/es/utils/theme.js +1 -1
- package/es/utils/transition.js +1 -1
- package/es/utils/use-value.js +1 -1
- package/es/virtual-list/index.js +1 -1
- package/es/virtual-list/range.js +1 -1
- package/es/watermark/index.js +1 -1
- package/lib/index.cjs +2 -2
- package/lib/locale/de.cjs +1 -1
- package/lib/locale/el.cjs +1 -1
- package/lib/locale/en.cjs +1 -1
- package/lib/locale/fr.cjs +1 -1
- package/lib/locale/it.cjs +1 -1
- package/lib/locale/ja.cjs +1 -1
- package/lib/locale/ko.cjs +1 -1
- package/lib/locale/ru.cjs +1 -1
- package/lib/locale/th.cjs +1 -1
- package/lib/locale/uk.cjs +1 -1
- package/lib/locale/vi.cjs +1 -1
- package/lib/locale/zh-CN.cjs +1 -1
- package/lib/locale/zh-TW.cjs +1 -1
- package/package.json +32 -29
- package/style/base.css +1 -1
- package/style/components.css +2 -2
- package/style/index.css +2 -2
- package/style/theme.css +2 -2
- package/types/affix/index.d.cts +1 -1
- package/types/affix/index.d.ts +1 -1
- package/types/alert/index.d.cts +2 -1
- package/types/alert/index.d.ts +2 -1
- package/types/anchor/anchor-link.d.cts +1 -1
- package/types/anchor/anchor-link.d.ts +1 -1
- package/types/anchor/anchor.d.cts +1 -1
- package/types/anchor/anchor.d.ts +1 -1
- package/types/auto-complete/index.d.cts +1 -2
- package/types/auto-complete/index.d.ts +1 -2
- package/types/avatar/avatar-group.d.cts +1 -1
- package/types/avatar/avatar-group.d.ts +1 -1
- package/types/avatar/avatar.d.cts +1 -1
- package/types/avatar/avatar.d.ts +1 -1
- package/types/back-top/index.d.cts +1 -1
- package/types/back-top/index.d.ts +1 -1
- package/types/badge/index.d.cts +1 -1
- package/types/badge/index.d.ts +1 -1
- package/types/base/transition.d.cts +1 -0
- package/types/base/transition.d.ts +1 -0
- package/types/breadcrumb/breadcrumb-item.d.cts +1 -1
- package/types/breadcrumb/breadcrumb-item.d.ts +1 -1
- package/types/breadcrumb/breadcrumb.d.cts +1 -1
- package/types/breadcrumb/breadcrumb.d.ts +1 -1
- package/types/button/button-group.d.cts +1 -1
- package/types/button/button-group.d.ts +1 -1
- package/types/button/button.d.cts +1 -1
- package/types/button/button.d.ts +1 -1
- package/types/calendar/index.d.cts +1 -1
- package/types/calendar/index.d.ts +1 -1
- package/types/card/index.d.cts +2 -2
- package/types/card/index.d.ts +2 -2
- package/types/carousel/carousel-item.d.cts +1 -1
- package/types/carousel/carousel-item.d.ts +1 -1
- package/types/carousel/carousel.d.cts +1 -1
- package/types/carousel/carousel.d.ts +1 -1
- package/types/cascader/index.d.cts +1 -1
- package/types/cascader/index.d.ts +1 -1
- package/types/cascader/types.d.cts +1 -2
- package/types/cascader/types.d.ts +1 -2
- package/types/check-card/types.d.cts +2 -3
- package/types/check-card/types.d.ts +2 -3
- package/types/checkbox/checkbox-group.d.cts +1 -1
- package/types/checkbox/checkbox-group.d.ts +1 -1
- package/types/checkbox/checkbox.d.cts +1 -2
- package/types/checkbox/checkbox.d.ts +1 -2
- package/types/checkbox/index.d.cts +1 -1
- package/types/checkbox/index.d.ts +1 -1
- package/types/collapse/collapse-panel.d.cts +1 -1
- package/types/collapse/collapse-panel.d.ts +1 -1
- package/types/collapse/collapse.d.cts +1 -2
- package/types/collapse/collapse.d.ts +1 -2
- package/types/color-picker/alpha.d.cts +2 -1
- package/types/color-picker/alpha.d.ts +2 -1
- package/types/color-picker/hue.d.cts +2 -1
- package/types/color-picker/hue.d.ts +2 -1
- package/types/color-picker/index.d.cts +3 -4
- package/types/color-picker/index.d.ts +3 -4
- package/types/color-picker/paint.d.cts +2 -1
- package/types/color-picker/paint.d.ts +2 -1
- package/types/components.d.cts +17 -13
- package/types/components.d.ts +17 -13
- package/types/date-picker/index.d.cts +3 -4
- package/types/date-picker/index.d.ts +3 -4
- package/types/descriptions/descriptions.d.cts +1 -1
- package/types/descriptions/descriptions.d.ts +1 -1
- package/types/divider/index.d.cts +1 -1
- package/types/divider/index.d.ts +1 -1
- package/types/drawer/index.d.cts +0 -1
- package/types/drawer/index.d.ts +0 -1
- package/types/dropdown/dropdown-button.d.cts +1 -1
- package/types/dropdown/dropdown-button.d.ts +1 -1
- package/types/dropdown/dropdown.d.cts +1 -2
- package/types/dropdown/dropdown.d.ts +1 -2
- package/types/empty/index.d.cts +1 -1
- package/types/empty/index.d.ts +1 -1
- package/types/feature-card/index.d.cts +1 -1
- package/types/feature-card/index.d.ts +1 -1
- package/types/feedback-panel/index.d.cts +1 -1
- package/types/feedback-panel/index.d.ts +1 -1
- package/types/flex/index.d.cts +1 -1
- package/types/flex/index.d.ts +1 -1
- package/types/form/form.d.cts +1 -1
- package/types/form/form.d.ts +1 -1
- package/types/grid/grid-item.d.cts +1 -1
- package/types/grid/grid-item.d.ts +1 -1
- package/types/grid/grid.d.cts +1 -1
- package/types/grid/grid.d.ts +1 -1
- package/types/icon/index.d.cts +1 -1
- package/types/icon/index.d.ts +1 -1
- package/types/image/group.d.cts +1 -1
- package/types/image/group.d.ts +1 -1
- package/types/image/image.d.cts +1 -1
- package/types/image/image.d.ts +1 -1
- package/types/input/index.d.cts +1 -1
- package/types/input/index.d.ts +1 -1
- package/types/input/input-box.d.cts +1 -1
- package/types/input/input-box.d.ts +1 -1
- package/types/input/input-group.d.cts +1 -1
- package/types/input/input-group.d.ts +1 -1
- package/types/input/input.d.cts +1 -1
- package/types/input/input.d.ts +1 -1
- package/types/input/textarea.d.cts +1 -1
- package/types/input/textarea.d.ts +1 -1
- package/types/input-number/index.d.cts +1 -1
- package/types/input-number/index.d.ts +1 -1
- package/types/input-otp/index.d.cts +1 -1
- package/types/input-otp/index.d.ts +1 -1
- package/types/input-tag/index.d.cts +1 -1
- package/types/input-tag/index.d.ts +1 -1
- package/types/kanban/index.d.cts +1 -1
- package/types/kanban/index.d.ts +1 -1
- package/types/layout/index.d.cts +2 -2
- package/types/layout/index.d.ts +2 -2
- package/types/list-panel/index.d.cts +1 -1
- package/types/list-panel/index.d.ts +1 -1
- package/types/mentions/index.d.cts +1 -1
- package/types/mentions/index.d.ts +1 -1
- package/types/menu/menu.d.cts +1 -2
- package/types/menu/menu.d.ts +1 -2
- package/types/modal/modal.d.cts +1 -2
- package/types/modal/modal.d.ts +1 -2
- package/types/page/index.d.cts +1 -1
- package/types/page/index.d.ts +1 -1
- package/types/page-header/index.d.cts +1 -1
- package/types/page-header/index.d.ts +1 -1
- package/types/popconfirm/index.d.cts +1 -2
- package/types/popconfirm/index.d.ts +1 -2
- package/types/poptip/index.d.cts +1 -2
- package/types/poptip/index.d.ts +1 -2
- package/types/popup/index.d.cts +48 -0
- package/types/popup/index.d.ts +48 -0
- package/types/popup/layers.d.cts +9 -0
- package/types/popup/layers.d.ts +9 -0
- package/types/popup/types.d.cts +15 -0
- package/types/popup/types.d.ts +15 -0
- package/types/progress/index.d.cts +1 -1
- package/types/progress/index.d.ts +1 -1
- package/types/qrcode/index.d.cts +1 -1
- package/types/qrcode/index.d.ts +1 -1
- package/types/radio/index.d.cts +1 -0
- package/types/radio/index.d.ts +1 -0
- package/types/radio/radio-button.d.cts +1 -2
- package/types/radio/radio-button.d.ts +1 -2
- package/types/radio/radio-group.d.cts +1 -1
- package/types/radio/radio-group.d.ts +1 -1
- package/types/radio/radio.d.cts +1 -2
- package/types/radio/radio.d.ts +1 -2
- package/types/rate/index.d.cts +1 -1
- package/types/rate/index.d.ts +1 -1
- package/types/result/index.d.cts +1 -1
- package/types/result/index.d.ts +1 -1
- package/types/row-col/col.d.cts +1 -1
- package/types/row-col/col.d.ts +1 -1
- package/types/row-col/row.d.cts +1 -1
- package/types/row-col/row.d.ts +1 -1
- package/types/segmented/index.d.cts +1 -1
- package/types/segmented/index.d.ts +1 -1
- package/types/select/index.d.cts +2 -2
- package/types/select/index.d.ts +2 -2
- package/types/select/option.d.cts +1 -1
- package/types/select/option.d.ts +1 -1
- package/types/select/select.d.cts +1 -2
- package/types/select/select.d.ts +1 -2
- package/types/skeleton/skeleton-avatar.d.cts +1 -1
- package/types/skeleton/skeleton-avatar.d.ts +1 -1
- package/types/skeleton/skeleton-button.d.cts +1 -1
- package/types/skeleton/skeleton-button.d.ts +1 -1
- package/types/skeleton/skeleton-image.d.cts +1 -1
- package/types/skeleton/skeleton-image.d.ts +1 -1
- package/types/skeleton/skeleton-text.d.cts +1 -1
- package/types/skeleton/skeleton-text.d.ts +1 -1
- package/types/skeleton/skeleton.d.cts +1 -1
- package/types/skeleton/skeleton.d.ts +1 -1
- package/types/slider/index.d.cts +1 -1
- package/types/slider/index.d.ts +1 -1
- package/types/space/index.d.cts +1 -1
- package/types/space/index.d.ts +1 -1
- package/types/spin/index.d.cts +1 -1
- package/types/spin/index.d.ts +1 -1
- package/types/splitter/splitter-panel.d.cts +1 -1
- package/types/splitter/splitter-panel.d.ts +1 -1
- package/types/splitter/splitter.d.cts +1 -1
- package/types/splitter/splitter.d.ts +1 -1
- package/types/stat-card/countup.d.cts +1 -1
- package/types/stat-card/countup.d.ts +1 -1
- package/types/stat-card/rollup.d.cts +3 -2
- package/types/stat-card/rollup.d.ts +3 -2
- package/types/stat-card/stat-card.d.cts +1 -1
- package/types/stat-card/stat-card.d.ts +1 -1
- package/types/stat-card/stat-number.d.cts +1 -1
- package/types/stat-card/stat-number.d.ts +1 -1
- package/types/stat-card/utils/countup.d.cts +1 -1
- package/types/stat-card/utils/countup.d.ts +1 -1
- package/types/stat-card/utils/odometer.d.cts +7 -4
- package/types/stat-card/utils/odometer.d.ts +7 -4
- package/types/steps/index.d.cts +1 -1
- package/types/steps/index.d.ts +1 -1
- package/types/switch/index.d.cts +1 -2
- package/types/switch/index.d.ts +1 -2
- package/types/table/index.d.cts +1 -1
- package/types/table/index.d.ts +1 -1
- package/types/table/types.d.cts +2 -4
- package/types/table/types.d.ts +2 -4
- package/types/tabs/index.d.cts +1 -0
- package/types/tabs/index.d.ts +1 -0
- package/types/tabs/tab-panel.d.cts +1 -1
- package/types/tabs/tab-panel.d.ts +1 -1
- package/types/tabs/tabs.d.cts +1 -1
- package/types/tabs/tabs.d.ts +1 -1
- package/types/tag/index.d.cts +2 -1
- package/types/tag/index.d.ts +2 -1
- package/types/time-line/timeline-item.d.cts +1 -1
- package/types/time-line/timeline-item.d.ts +1 -1
- package/types/time-line/timeline.d.cts +1 -1
- package/types/time-line/timeline.d.ts +1 -1
- package/types/tooltip/index.d.cts +2 -2
- package/types/tooltip/index.d.ts +2 -2
- package/types/tour/index.d.cts +0 -2
- package/types/tour/index.d.ts +0 -2
- package/types/transfer/index.d.cts +2 -3
- package/types/transfer/index.d.ts +2 -3
- package/types/tree/index.d.cts +2 -4
- package/types/tree/index.d.ts +2 -4
- package/types/tree-select/index.d.cts +2 -3
- package/types/tree-select/index.d.ts +2 -3
- package/types/typography/index.d.cts +1 -1
- package/types/typography/index.d.ts +1 -1
- package/types/upload/index.d.cts +1 -2
- package/types/upload/index.d.ts +1 -2
- package/types/upload/selector.d.cts +1 -1
- package/types/upload/selector.d.ts +1 -1
- package/types/utils/popup.d.cts +11 -0
- package/types/utils/popup.d.ts +11 -0
- package/types/utils/selection-tags.d.cts +19 -0
- package/types/utils/selection-tags.d.ts +19 -0
- package/types/virtual-list/index.d.cts +1 -1
- package/types/virtual-list/index.d.ts +1 -1
- package/types/watermark/index.d.cts +1 -1
- package/types/watermark/index.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.1.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -7,122 +7,119 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
//#region components/stat-card/utils/odometer.ts
|
|
10
|
-
|
|
10
|
+
/** Bounded digit tracks shared by statistical numbers and badges. */
|
|
11
11
|
var Odometer = class {
|
|
12
|
-
|
|
12
|
+
previous;
|
|
13
|
+
timer;
|
|
14
|
+
frame;
|
|
15
|
+
revision = 0;
|
|
13
16
|
options;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
lastDigitDelay: .25
|
|
17
|
-
};
|
|
18
|
-
cell_digits = null;
|
|
19
|
-
constructor(options) {
|
|
20
|
-
this.options = {
|
|
21
|
-
...this.defaults,
|
|
22
|
-
...options
|
|
23
|
-
};
|
|
24
|
-
this.cell_digits = null;
|
|
17
|
+
constructor(options = {}) {
|
|
18
|
+
this.options = options;
|
|
25
19
|
}
|
|
26
20
|
destroy() {
|
|
27
|
-
this.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.cell_digits = null;
|
|
21
|
+
this.revision++;
|
|
22
|
+
clearTimeout(this.timer);
|
|
23
|
+
if (this.frame !== void 0) cancelAnimationFrame(this.frame);
|
|
24
|
+
this.previous = void 0;
|
|
32
25
|
}
|
|
33
|
-
render(elem,
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
26
|
+
render(elem, text, value = Number(text.replaceAll(",", ""))) {
|
|
27
|
+
const previous = this.previous;
|
|
28
|
+
this.previous = {
|
|
29
|
+
text,
|
|
30
|
+
value
|
|
31
|
+
};
|
|
32
|
+
if (previous?.text === text) return;
|
|
33
|
+
this.revision++;
|
|
34
|
+
const revision = this.revision;
|
|
35
|
+
clearTimeout(this.timer);
|
|
36
|
+
if (this.frame !== void 0) cancelAnimationFrame(this.frame);
|
|
37
|
+
const rawDuration = this.options.duration ?? .8;
|
|
38
|
+
const duration = Number.isFinite(rawDuration) ? Math.max(0, rawDuration) : 0;
|
|
39
|
+
const reducedMotion = typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
40
|
+
const direction = previous && value < previous.value ? "down" : "up";
|
|
41
|
+
const wrapper = document.createElement("span");
|
|
42
|
+
wrapper.className = "odometer-numbers";
|
|
43
|
+
wrapper.setAttribute("role", "img");
|
|
44
|
+
wrapper.setAttribute("aria-label", text);
|
|
45
|
+
wrapper.style.cssText = "display:inline-flex;line-height:1;vertical-align:middle";
|
|
46
|
+
const settle = () => {
|
|
47
|
+
if (revision !== this.revision) return;
|
|
48
|
+
wrapper.textContent = text;
|
|
49
|
+
wrapper.removeAttribute("data-direction");
|
|
50
|
+
};
|
|
51
|
+
elem.replaceChildren(wrapper);
|
|
52
|
+
if (!previous || previous.text === text || value === previous.value || duration === 0 || reducedMotion) {
|
|
53
|
+
settle();
|
|
54
|
+
return;
|
|
60
55
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
if (this.options.mode !== "continuous") wrapper.dataset.direction = direction;
|
|
57
|
+
const length = Math.max(previous.text.length, text.length);
|
|
58
|
+
const before = previous.text.padStart(length, " ");
|
|
59
|
+
const after = text.padStart(length, " ");
|
|
60
|
+
const continuous = this.options.mode === "continuous";
|
|
61
|
+
const rollingDigits = Array.from(after).filter((character, index) => character !== before[index] && (/\d/.test(character) || /\d/.test(before[index]))).length;
|
|
62
|
+
let digitOrder = 0;
|
|
63
|
+
const tracks = [];
|
|
64
|
+
for (let index = 0; index < length; index++) {
|
|
65
|
+
const oldCharacter = before[index];
|
|
66
|
+
const character = after[index];
|
|
67
|
+
const slot = document.createElement("span");
|
|
68
|
+
slot.setAttribute("aria-hidden", "true");
|
|
69
|
+
slot.style.cssText = "display:inline-block;height:1em;overflow:hidden";
|
|
70
|
+
const isDigit = /\d/.test(character) || /\d/.test(oldCharacter);
|
|
71
|
+
const rollContinuously = continuous && character !== oldCharacter && isDigit;
|
|
72
|
+
if (!rollContinuously && character === oldCharacter || !isDigit) slot.textContent = character === " " ? "" : character;
|
|
73
|
+
else {
|
|
74
|
+
const track = document.createElement("span");
|
|
75
|
+
track.className = "odometer-track";
|
|
76
|
+
track.style.cssText = "display:flex;flex-direction:column;transition:none";
|
|
77
|
+
let characters = [oldCharacter, character];
|
|
78
|
+
let trackDuration = duration;
|
|
79
|
+
let trackDirection = direction;
|
|
80
|
+
if (rollContinuously) {
|
|
81
|
+
const start = /\d/.test(oldCharacter) ? Number(oldCharacter) : 0;
|
|
82
|
+
const end = /\d/.test(character) ? Number(character) : 0;
|
|
83
|
+
trackDirection = end < start ? "down" : end > start ? "up" : direction;
|
|
84
|
+
const step = trackDirection === "up" ? 1 : -1;
|
|
85
|
+
const distance = ((end - start) * step + 10) % 10 + Math.min(digitOrder, 2) * 10;
|
|
86
|
+
characters = Array.from({ length: distance + 1 }, (_, offset) => String((start + step * offset % 10 + 10) % 10));
|
|
87
|
+
characters[0] = oldCharacter;
|
|
88
|
+
characters[characters.length - 1] = character;
|
|
89
|
+
if (characters.length === 1) characters = [oldCharacter, character];
|
|
90
|
+
trackDuration = duration * (rollingDigits <= 1 ? 1 : .75 + .25 * digitOrder / (rollingDigits - 1));
|
|
91
|
+
digitOrder++;
|
|
92
|
+
}
|
|
93
|
+
const distance = characters.length - 1;
|
|
94
|
+
track.dataset.direction = trackDirection;
|
|
95
|
+
if (trackDirection === "down") characters.reverse();
|
|
96
|
+
for (const item of characters) {
|
|
97
|
+
const digit = document.createElement("span");
|
|
98
|
+
digit.textContent = item === " " ? "\xA0" : item;
|
|
99
|
+
digit.style.cssText = "display:block;flex:none;height:1em;line-height:1";
|
|
100
|
+
track.appendChild(digit);
|
|
101
|
+
}
|
|
102
|
+
track.style.transform = trackDirection === "up" ? "translateY(0)" : `translateY(-${distance}em)`;
|
|
103
|
+
slot.appendChild(track);
|
|
104
|
+
tracks.push({
|
|
105
|
+
element: track,
|
|
106
|
+
distance,
|
|
107
|
+
duration: trackDuration,
|
|
108
|
+
direction: trackDirection
|
|
69
109
|
});
|
|
70
|
-
} else cell.container.style.transform = `translateY(${cell.position}em)`;
|
|
71
|
-
}
|
|
72
|
-
function pushDigit(cell, newDigit) {
|
|
73
|
-
const { lastDigitDelay = .25, duration = .8 } = options;
|
|
74
|
-
if (cell.nextToAdd) {
|
|
75
|
-
appendDigit(cell, cell.nextToAdd);
|
|
76
|
-
clearTimeout(cell.lastTimer);
|
|
77
|
-
cell.nextToAdd = null;
|
|
78
|
-
}
|
|
79
|
-
const now = +/* @__PURE__ */ new Date();
|
|
80
|
-
const lastTimeAdd = cell.lastTimeAdd ?? 0;
|
|
81
|
-
const delayTime = lastDigitDelay * 1e3 - (now - lastTimeAdd);
|
|
82
|
-
if (lastDigitDelay <= 0 || now - lastTimeAdd >= delayTime * 1.05) {
|
|
83
|
-
appendDigit(cell, newDigit);
|
|
84
|
-
cell.nextToAdd = null;
|
|
85
|
-
} else {
|
|
86
|
-
cell.nextToAdd = newDigit;
|
|
87
|
-
cell.lastTimer = setTimeout(() => {
|
|
88
|
-
if (cell.nextToAdd) appendDigit(cell, cell.nextToAdd);
|
|
89
|
-
cell.nextToAdd = null;
|
|
90
|
-
}, duration * 1e3);
|
|
91
110
|
}
|
|
111
|
+
wrapper.appendChild(slot);
|
|
92
112
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
newDigit.innerHTML = ch === null ? blank : ch;
|
|
101
|
-
if (cell.container.children.length < 4) appendDigit(cell, newDigit);
|
|
102
|
-
else pushDigit(cell, newDigit);
|
|
103
|
-
if (cell.timerClean) clearTimeout(cell.timerClean);
|
|
104
|
-
cell.timerClean = setTimeout(function() {
|
|
105
|
-
cell.timerClean = null;
|
|
106
|
-
if (cell.container.children.length < 3) return;
|
|
107
|
-
cell.container.style.transition = "none";
|
|
108
|
-
rAF(() => {
|
|
109
|
-
cell.position = -1;
|
|
110
|
-
while (cell.container.children.length > 1) {
|
|
111
|
-
const firstChild = cell.container.firstChild;
|
|
112
|
-
if (!firstChild) break;
|
|
113
|
-
cell.container.removeChild(firstChild);
|
|
114
|
-
}
|
|
115
|
-
const digitBlank = document.createElement("span");
|
|
116
|
-
digitBlank.innerHTML = blank;
|
|
117
|
-
cell.container.insertBefore(digitBlank, cell.container.firstChild);
|
|
118
|
-
cell.container.style.transform = `translateY(${cell.position}em)`;
|
|
119
|
-
rAF(() => {
|
|
120
|
-
cell.container.style.transition = transitionDigit;
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
}, ((options.duration || .8) + (options.duration || .25)) * 1e3 + 2500);
|
|
113
|
+
wrapper.offsetHeight;
|
|
114
|
+
this.frame = requestAnimationFrame(() => {
|
|
115
|
+
if (revision !== this.revision) return;
|
|
116
|
+
this.frame = void 0;
|
|
117
|
+
for (const track of tracks) {
|
|
118
|
+
track.element.style.transition = `transform ${track.duration}s cubic-bezier(0.4, 0, 0.2, 1)`;
|
|
119
|
+
track.element.style.transform = track.direction === "up" ? `translateY(-${track.distance}em)` : "translateY(0)";
|
|
124
120
|
}
|
|
125
|
-
|
|
121
|
+
this.timer = setTimeout(settle, duration * 1e3);
|
|
122
|
+
});
|
|
126
123
|
}
|
|
127
124
|
};
|
|
128
125
|
//#endregion
|
package/es/steps/index.js
CHANGED
package/es/switch/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.1.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -9,22 +9,23 @@
|
|
|
9
9
|
import { useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import { Loading } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
11
11
|
import Icon from "../icon/index.js";
|
|
12
|
+
import { useValue } from "../utils/use-value.js";
|
|
12
13
|
import { createFormFieldComponent } from "../form/field-context.js";
|
|
13
14
|
import { getValueWithType } from "../utils/checked.js";
|
|
14
15
|
import clsx from "clsx";
|
|
15
|
-
import
|
|
16
|
+
import "react";
|
|
16
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
18
|
//#region components/switch/index.tsx
|
|
18
|
-
var Switch = ({ checked,
|
|
19
|
+
var Switch = ({ checked, valueType = "boolean", type, color, disabled = false, readOnly = false, loading = false, size: sizeProp, shape: shapeProp, trueText, falseText, checkedChildren, unCheckedChildren, onChange, className = "", style, onClick, ...rest }) => {
|
|
19
20
|
const inheritedAppearance = useConfigAppearance();
|
|
20
21
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
21
22
|
const shape = shapeProp ?? inheritedAppearance.shape ?? "round";
|
|
22
|
-
const [innerChecked, setInnerChecked] =
|
|
23
|
-
const currentChecked =
|
|
23
|
+
const [innerChecked, setInnerChecked] = useValue(checked, (next) => next ?? false);
|
|
24
|
+
const currentChecked = innerChecked;
|
|
24
25
|
const change = (e) => {
|
|
25
26
|
if (disabled || readOnly || loading) return;
|
|
26
27
|
const nextChecked = !currentChecked;
|
|
27
|
-
|
|
28
|
+
setInnerChecked(nextChecked);
|
|
28
29
|
const val = getValueWithType(nextChecked, valueType);
|
|
29
30
|
onChange?.(val);
|
|
30
31
|
onClick?.(e);
|
package/es/table/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.1.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { normalizeSurfaceShape, useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import { ChevronDown, ChevronRight, Triangle } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
11
11
|
import Icon from "../icon/index.js";
|
|
12
|
+
import { useValue } from "../utils/use-value.js";
|
|
12
13
|
import Empty from "../empty/index.js";
|
|
13
14
|
import checkbox_default from "../checkbox/checkbox.js";
|
|
14
15
|
import { getVirtualRange } from "../virtual-list/range.js";
|
|
@@ -20,16 +21,19 @@ import { useEffect, useMemo, useRef, useState } from "react";
|
|
|
20
21
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
22
|
import { flushSync } from "react-dom";
|
|
22
23
|
//#region components/table/index.tsx
|
|
23
|
-
function Table({ data = [], columns = [], selectedKeys,
|
|
24
|
+
function Table({ data = [], columns = [], selectedKeys, disabledKeys = [], rowKey = "key", childrenColumnName = "children", expandedKeys, expandAllRows = false, expandRowByClick = false, indentSize = 20, scroll = {}, size: sizeProp, striped, bordered = false, shape: shapeProp, checkable, loading, emptyText, header, footer, virtual = false, itemHeight = 44, overscan = 5, hiddenColumnKeys = [], onSort, onRowClick, onSelect, onSelectAll, onSelectedKeysChange, onExpand, onExpandedKeysChange, className, ...rest }) {
|
|
24
25
|
const inheritedAppearance = useConfigAppearance();
|
|
25
26
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
26
27
|
const shape = normalizeSurfaceShape(shapeProp ?? inheritedAppearance.shape ?? "round");
|
|
27
28
|
const headerRef = useRef(null);
|
|
28
29
|
const bodyRef = useRef(null);
|
|
29
30
|
const scrollFrameRef = useRef(0);
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const [innerSelected, setInnerSelected] = useValue(selectedKeys, (next) => new Set(next ?? []));
|
|
32
|
+
const expansionSource = useMemo(() => ({
|
|
33
|
+
expandedKeys,
|
|
34
|
+
expandAllRows
|
|
35
|
+
}), [expandedKeys, expandAllRows]);
|
|
36
|
+
const [innerExpanded, setInnerExpanded] = useValue(expansionSource, (source) => new Set(source.expandedKeys ?? (source.expandAllRows ? flattenTreeData({
|
|
33
37
|
data,
|
|
34
38
|
childrenColumnName,
|
|
35
39
|
getKey: (record) => {
|
|
@@ -37,7 +41,7 @@ function Table({ data = [], columns = [], selectedKeys, defaultSelectedKeys = []
|
|
|
37
41
|
const key = getRecordValue(record, rowKey);
|
|
38
42
|
return typeof key === "string" || typeof key === "number" ? key : "";
|
|
39
43
|
}
|
|
40
|
-
}).filter((row) => row.hasChildren).map((row_0) => typeof rowKey === "function" ? rowKey(row_0.record) : getRecordValue(row_0.record, rowKey) ?? "") :
|
|
44
|
+
}).filter((row) => row.hasChildren).map((row_0) => typeof rowKey === "function" ? rowKey(row_0.record) : getRecordValue(row_0.record, rowKey) ?? "") : [])));
|
|
41
45
|
const [sort, setSort] = useState({
|
|
42
46
|
key: "",
|
|
43
47
|
order: null
|
|
@@ -49,8 +53,8 @@ function Table({ data = [], columns = [], selectedKeys, defaultSelectedKeys = []
|
|
|
49
53
|
const [scrollbarWidth, setScrollbarWidth] = useState(0);
|
|
50
54
|
const [scrollTop, setScrollTop] = useState(0);
|
|
51
55
|
const [viewportHeight, setViewportHeight] = useState(0);
|
|
52
|
-
const selected =
|
|
53
|
-
const currentExpanded =
|
|
56
|
+
const selected = innerSelected;
|
|
57
|
+
const currentExpanded = innerExpanded;
|
|
54
58
|
const visibleColumns = useMemo(() => {
|
|
55
59
|
const filter = (items) => items.flatMap((column) => {
|
|
56
60
|
if (hiddenColumnKeys.includes(column.key)) return [];
|
|
@@ -219,52 +223,52 @@ function Table({ data = [], columns = [], selectedKeys, defaultSelectedKeys = []
|
|
|
219
223
|
const checkedCount = enabled.filter((record_3) => selected.has(keyOf(record_3))).length;
|
|
220
224
|
const allChecked = enabled.length > 0 && checkedCount === enabled.length;
|
|
221
225
|
const indeterminate = checkedCount > 0 && checkedCount < enabled.length;
|
|
222
|
-
const commitSelection = (
|
|
223
|
-
const keys = [...
|
|
224
|
-
|
|
226
|
+
const commitSelection = (next_0) => {
|
|
227
|
+
const keys = [...next_0];
|
|
228
|
+
setInnerSelected(next_0);
|
|
225
229
|
onSelectedKeysChange?.(keys);
|
|
226
230
|
return keys;
|
|
227
231
|
};
|
|
228
232
|
const toggleAll = ({ checked }) => {
|
|
229
|
-
const
|
|
233
|
+
const next_1 = new Set(selected);
|
|
230
234
|
allRows.forEach(({ record: record_4 }) => {
|
|
231
235
|
const key_2 = keyOf(record_4);
|
|
232
236
|
if (!isDisabled(key_2)) {
|
|
233
|
-
if (checked)
|
|
234
|
-
else
|
|
237
|
+
if (checked) next_1.add(key_2);
|
|
238
|
+
else next_1.delete(key_2);
|
|
235
239
|
}
|
|
236
240
|
});
|
|
237
|
-
const keys_0 = commitSelection(
|
|
241
|
+
const keys_0 = commitSelection(next_1);
|
|
238
242
|
onSelectAll?.(checked, keys_0);
|
|
239
243
|
};
|
|
240
244
|
const toggleOne = (event, record_5) => {
|
|
241
245
|
const key_3 = keyOf(record_5);
|
|
242
246
|
if (isDisabled(key_3)) return;
|
|
243
|
-
const
|
|
244
|
-
if (event.checked)
|
|
245
|
-
else
|
|
246
|
-
const keys_1 = commitSelection(
|
|
247
|
+
const next_2 = new Set(selected);
|
|
248
|
+
if (event.checked) next_2.add(key_3);
|
|
249
|
+
else next_2.delete(key_3);
|
|
250
|
+
const keys_1 = commitSelection(next_2);
|
|
247
251
|
onSelect?.(record_5, event.checked, keys_1);
|
|
248
252
|
};
|
|
249
253
|
const toggleExpand = (record_6) => {
|
|
250
254
|
const key_4 = keyOf(record_6);
|
|
251
|
-
const
|
|
252
|
-
const nextExpanded = !
|
|
253
|
-
if (nextExpanded)
|
|
254
|
-
else
|
|
255
|
-
|
|
256
|
-
onExpandedKeysChange?.([...
|
|
255
|
+
const next_3 = new Set(currentExpanded);
|
|
256
|
+
const nextExpanded = !next_3.has(key_4);
|
|
257
|
+
if (nextExpanded) next_3.add(key_4);
|
|
258
|
+
else next_3.delete(key_4);
|
|
259
|
+
setInnerExpanded(next_3);
|
|
260
|
+
onExpandedKeysChange?.([...next_3]);
|
|
257
261
|
onExpand?.(nextExpanded, record_6);
|
|
258
262
|
};
|
|
259
263
|
const changeSort = (column_7) => {
|
|
260
264
|
if (!column_7.sorter) return;
|
|
261
|
-
const
|
|
265
|
+
const next_4 = {
|
|
262
266
|
key: column_7.key,
|
|
263
267
|
order: sort.key !== column_7.key ? "asc" : sort.order === "asc" ? "desc" : sort.order === "desc" ? null : "asc"
|
|
264
268
|
};
|
|
265
|
-
setSort(
|
|
266
|
-
if (typeof column_7.sorter === "function") column_7.sorter(
|
|
267
|
-
onSort?.(
|
|
269
|
+
setSort(next_4);
|
|
270
|
+
if (typeof column_7.sorter === "function") column_7.sorter(next_4);
|
|
271
|
+
onSort?.(next_4);
|
|
268
272
|
};
|
|
269
273
|
const handleScroll = (event_0) => {
|
|
270
274
|
const target = event_0.currentTarget;
|
package/es/table/utils.js
CHANGED
package/es/tabs/tab-panel.js
CHANGED
package/es/tabs/tabs.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.1.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
6
6
|
* Author: Qiu / https://chuchur.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { getChildren } from "../utils/react-node.js";
|
|
9
10
|
import { ChevronDown, X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
10
11
|
import Icon from "../icon/index.js";
|
|
11
12
|
import { useValue } from "../utils/use-value.js";
|
|
12
|
-
import { getChildren } from "../utils/react-node.js";
|
|
13
13
|
import Button from "../button/button.js";
|
|
14
14
|
import Dropdown from "../dropdown/dropdown.js";
|
|
15
15
|
import { MenuItem } from "../menu/menu-item.js";
|
|
@@ -153,7 +153,9 @@ var Tabs = ({ value, variant, card = false, sample = false, centered = false, an
|
|
|
153
153
|
"k-tabs-tab-disabled": isDisabled
|
|
154
154
|
}),
|
|
155
155
|
onClick: () => tabClick(key_3, isDisabled),
|
|
156
|
-
onKeyDown: (event_0) =>
|
|
156
|
+
onKeyDown: (event_0) => {
|
|
157
|
+
if (!isDisabled) moveTabFocus(event_0, panel_1);
|
|
158
|
+
},
|
|
157
159
|
id: `${tabsId}-tab-${key_3}`,
|
|
158
160
|
role: "tab",
|
|
159
161
|
tabIndex: key_3 === activeKey && !isDisabled ? 0 : -1,
|
|
@@ -170,11 +172,18 @@ var Tabs = ({ value, variant, card = false, sample = false, centered = false, an
|
|
|
170
172
|
type: X,
|
|
171
173
|
className: "k-tabs-close",
|
|
172
174
|
role: "button",
|
|
173
|
-
tabIndex: 0,
|
|
175
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
174
176
|
"aria-label": "Close",
|
|
175
|
-
|
|
177
|
+
"aria-disabled": isDisabled || void 0,
|
|
178
|
+
onClick: (e_0) => {
|
|
179
|
+
if (isDisabled) {
|
|
180
|
+
e_0.stopPropagation();
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
closeTab(key_3, e_0);
|
|
184
|
+
},
|
|
176
185
|
onKeyDown: (e_1) => {
|
|
177
|
-
if (e_1.key === "Enter" || e_1.key === " ") {
|
|
186
|
+
if (!isDisabled && (e_1.key === "Enter" || e_1.key === " ")) {
|
|
178
187
|
e_1.preventDefault();
|
|
179
188
|
closeTab(key_3, e_1);
|
|
180
189
|
}
|
package/es/tag/index.js
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.1.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
6
6
|
* Author: Qiu / https://chuchur.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { Transition } from "../base/transition.js";
|
|
9
10
|
import { useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
11
|
import { X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
11
12
|
import Icon from "../icon/index.js";
|
|
12
13
|
import { colors } from "../const/var.js";
|
|
13
|
-
import { Transition } from "../base/transition.js";
|
|
14
14
|
import { isColor } from "../utils/color.js";
|
|
15
15
|
import clsx from "clsx";
|
|
16
|
-
import { useState } from "react";
|
|
16
|
+
import { useRef, useState } from "react";
|
|
17
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
18
|
//#region components/tag/index.tsx
|
|
19
|
-
var Tag = ({ closeable = false, compact = false, color, shape: shapeProp, icon, size: sizeProp, theme: themeProp, onClose, children, className = "", style, ...rest }) => {
|
|
19
|
+
var Tag = ({ closeable = false, compact = false, color, shape: shapeProp, icon, size: sizeProp, theme: themeProp, onClose, onAfterClose, children, className = "", style, ...rest }) => {
|
|
20
20
|
const inheritedAppearance = useConfigAppearance();
|
|
21
21
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
22
22
|
const size = sizeProp ?? inheritedAppearance.size ?? "small";
|
|
23
23
|
const theme = themeProp ?? inheritedAppearance.theme ?? "fill";
|
|
24
24
|
const [visible, setVisible] = useState(true);
|
|
25
|
+
const closing = useRef(false);
|
|
25
26
|
const closeHandler = (e) => {
|
|
26
27
|
e.stopPropagation();
|
|
27
|
-
|
|
28
|
+
if (closing.current) return;
|
|
29
|
+
closing.current = true;
|
|
28
30
|
setVisible(false);
|
|
31
|
+
onClose?.();
|
|
29
32
|
};
|
|
30
33
|
const isPresetColor = color !== void 0 && colors.some((preset) => preset === color);
|
|
31
34
|
const isCustomColor = color && isColor(color) && !isPresetColor;
|
|
@@ -48,6 +51,7 @@ var Tag = ({ closeable = false, compact = false, color, shape: shapeProp, icon,
|
|
|
48
51
|
show: visible,
|
|
49
52
|
name: "k-tag",
|
|
50
53
|
timeout: 200,
|
|
54
|
+
onAfterLeave: onAfterClose,
|
|
51
55
|
children: /* @__PURE__ */ jsxs("div", {
|
|
52
56
|
className: tagClasses,
|
|
53
57
|
style: tagStyle,
|
package/es/time-line/timeline.js
CHANGED