react-kui 3.0.0 → 3.1.1
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.en-US.md +86 -1
- package/AI.md +68 -4
- package/ai/behaviors.json +114 -14
- package/ai/cli.mjs +180 -17
- package/ai/descriptions.json +446 -0
- package/ai/kui-components.json +4591 -3846
- package/ai/mcp.mjs +2 -189
- package/ai/query.mjs +195 -0
- package/ai/skills/react-kui/SKILL.md +41 -9
- package/ai/skills/react-kui/references/mcp.md +11 -1
- package/ai/skills/react-kui/references/react-to-vue.md +110 -0
- package/ai/skills/react-kui/references/vue-to-react.md +86 -0
- package/ai/validate.mjs +18 -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 +522 -274
- package/es/carousel/drag.js +169 -0
- 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-base.js +202 -0
- package/es/input/input-box.js +1 -1
- package/es/input/input-group.js +2 -2
- package/es/input/input.js +19 -188
- package/es/input/textarea.js +1 -1
- package/es/input-number/index.js +4 -4
- 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 +101 -78
- package/es/page/responsive.js +96 -0
- 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 +35 -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 +2 -1
- package/types/carousel/carousel.d.ts +2 -1
- package/types/carousel/drag.d.cts +19 -0
- package/types/carousel/drag.d.ts +19 -0
- 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-base.d.cts +31 -0
- package/types/input/input-base.d.ts +31 -0
- 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 +2 -25
- package/types/input/input.d.ts +2 -25
- 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 +2 -1
- package/types/page/index.d.ts +2 -1
- package/types/page/responsive.d.cts +1 -0
- package/types/page/responsive.d.ts +1 -0
- 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.1
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -9,15 +9,16 @@
|
|
|
9
9
|
import { useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import { Check } 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 { CheckCardGroupContext } from "./context.js";
|
|
14
15
|
import { c } from "react/compiler-runtime";
|
|
15
16
|
import clsx from "clsx";
|
|
16
|
-
import React, { useContext, useEffect, useRef
|
|
17
|
+
import React, { useContext, useEffect, useRef } from "react";
|
|
17
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
19
|
//#region components/check-card/check-card.tsx
|
|
19
20
|
var CheckCard = React.forwardRef((t0, forwardedRef) => {
|
|
20
|
-
const $ = c(
|
|
21
|
+
const $ = c(80);
|
|
21
22
|
let checked;
|
|
22
23
|
let checkedSymbol;
|
|
23
24
|
let children;
|
|
@@ -31,12 +32,11 @@ var CheckCard = React.forwardRef((t0, forwardedRef) => {
|
|
|
31
32
|
let t1;
|
|
32
33
|
let t2;
|
|
33
34
|
let t3;
|
|
34
|
-
let t4;
|
|
35
35
|
let themeProp;
|
|
36
36
|
let title;
|
|
37
37
|
let value;
|
|
38
38
|
if ($[0] !== t0) {
|
|
39
|
-
({checked,
|
|
39
|
+
({checked, value, title, description, symbol, checkedSymbol, showIndicator: t1, disabled: t2, readOnly: t3, theme: themeProp, size: sizeProp, shape: shapeProp, onChange, className, children, ...rest} = t0);
|
|
40
40
|
$[0] = t0;
|
|
41
41
|
$[1] = checked;
|
|
42
42
|
$[2] = checkedSymbol;
|
|
@@ -51,10 +51,9 @@ var CheckCard = React.forwardRef((t0, forwardedRef) => {
|
|
|
51
51
|
$[11] = t1;
|
|
52
52
|
$[12] = t2;
|
|
53
53
|
$[13] = t3;
|
|
54
|
-
$[14] =
|
|
55
|
-
$[15] =
|
|
56
|
-
$[16] =
|
|
57
|
-
$[17] = value;
|
|
54
|
+
$[14] = themeProp;
|
|
55
|
+
$[15] = title;
|
|
56
|
+
$[16] = value;
|
|
58
57
|
} else {
|
|
59
58
|
checked = $[1];
|
|
60
59
|
checkedSymbol = $[2];
|
|
@@ -69,71 +68,69 @@ var CheckCard = React.forwardRef((t0, forwardedRef) => {
|
|
|
69
68
|
t1 = $[11];
|
|
70
69
|
t2 = $[12];
|
|
71
70
|
t3 = $[13];
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
value = $[17];
|
|
71
|
+
themeProp = $[14];
|
|
72
|
+
title = $[15];
|
|
73
|
+
value = $[16];
|
|
76
74
|
}
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
const readOnly = t4 === void 0 ? false : t4;
|
|
75
|
+
const showIndicator = t1 === void 0 ? true : t1;
|
|
76
|
+
const disabled = t2 === void 0 ? false : t2;
|
|
77
|
+
const readOnly = t3 === void 0 ? false : t3;
|
|
81
78
|
const inheritedAppearance = useConfigAppearance();
|
|
82
79
|
const theme = themeProp ?? inheritedAppearance.theme ?? "outline";
|
|
83
80
|
const size = sizeProp ?? inheritedAppearance.size ?? "medium";
|
|
84
81
|
const shape = shapeProp ?? inheritedAppearance.shape ?? "round";
|
|
85
82
|
const group = useContext(CheckCardGroupContext);
|
|
86
83
|
const rootRef = useRef(null);
|
|
87
|
-
const [localChecked, setLocalChecked] =
|
|
84
|
+
const [localChecked, setLocalChecked] = useValue(checked, _temp);
|
|
88
85
|
const grouped = !!group && value !== void 0;
|
|
89
|
-
const isChecked = grouped ? group.value === value :
|
|
86
|
+
const isChecked = grouped ? group.value === value : localChecked;
|
|
90
87
|
const isDisabled = disabled || !!group?.disabled;
|
|
91
88
|
const isReadOnly = readOnly || !!group?.readOnly;
|
|
92
89
|
const currentTheme = themeProp ?? group?.theme ?? theme;
|
|
93
90
|
const currentSize = sizeProp ?? group?.size ?? size;
|
|
94
91
|
const currentShape = shapeProp ?? group?.shape ?? shape;
|
|
92
|
+
let t4;
|
|
95
93
|
let t5;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
t5 = () => {
|
|
94
|
+
if ($[17] !== group || $[18] !== grouped || $[19] !== isDisabled || $[20] !== isReadOnly || $[21] !== value) {
|
|
95
|
+
t4 = () => {
|
|
99
96
|
if (grouped && value !== void 0 && rootRef.current) {
|
|
100
97
|
group?.register(value, rootRef.current, isDisabled || isReadOnly);
|
|
101
98
|
return () => group.unregister(value);
|
|
102
99
|
}
|
|
103
100
|
};
|
|
104
|
-
|
|
101
|
+
t5 = [
|
|
105
102
|
group,
|
|
106
103
|
grouped,
|
|
107
104
|
isDisabled,
|
|
108
105
|
isReadOnly,
|
|
109
106
|
value
|
|
110
107
|
];
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
108
|
+
$[17] = group;
|
|
109
|
+
$[18] = grouped;
|
|
110
|
+
$[19] = isDisabled;
|
|
111
|
+
$[20] = isReadOnly;
|
|
112
|
+
$[21] = value;
|
|
113
|
+
$[22] = t4;
|
|
116
114
|
$[23] = t5;
|
|
117
|
-
$[24] = t6;
|
|
118
115
|
} else {
|
|
116
|
+
t4 = $[22];
|
|
119
117
|
t5 = $[23];
|
|
120
|
-
t6 = $[24];
|
|
121
118
|
}
|
|
122
|
-
useEffect(
|
|
123
|
-
let
|
|
124
|
-
if ($[
|
|
125
|
-
|
|
119
|
+
useEffect(t4, t5);
|
|
120
|
+
let t6;
|
|
121
|
+
if ($[24] !== forwardedRef) {
|
|
122
|
+
t6 = (element) => {
|
|
126
123
|
rootRef.current = element;
|
|
127
124
|
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
128
125
|
else if (forwardedRef) forwardedRef.current = element;
|
|
129
126
|
};
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
} else
|
|
133
|
-
const setRefs =
|
|
134
|
-
let
|
|
135
|
-
if ($[
|
|
136
|
-
|
|
127
|
+
$[24] = forwardedRef;
|
|
128
|
+
$[25] = t6;
|
|
129
|
+
} else t6 = $[25];
|
|
130
|
+
const setRefs = t6;
|
|
131
|
+
let t7;
|
|
132
|
+
if ($[26] !== group || $[27] !== grouped || $[28] !== isChecked || $[29] !== isDisabled || $[30] !== isReadOnly || $[31] !== onChange || $[32] !== setLocalChecked || $[33] !== value) {
|
|
133
|
+
t7 = () => {
|
|
137
134
|
if (isDisabled || isReadOnly) return;
|
|
138
135
|
if (grouped && value !== void 0) {
|
|
139
136
|
if (isChecked) return;
|
|
@@ -144,27 +141,27 @@ var CheckCard = React.forwardRef((t0, forwardedRef) => {
|
|
|
144
141
|
});
|
|
145
142
|
return;
|
|
146
143
|
}
|
|
147
|
-
const
|
|
148
|
-
|
|
144
|
+
const next_0 = !isChecked;
|
|
145
|
+
setLocalChecked(next_0);
|
|
149
146
|
onChange?.({
|
|
150
|
-
checked:
|
|
147
|
+
checked: next_0,
|
|
151
148
|
value
|
|
152
149
|
});
|
|
153
150
|
};
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
} else
|
|
164
|
-
const select =
|
|
165
|
-
let
|
|
166
|
-
if ($[
|
|
167
|
-
|
|
151
|
+
$[26] = group;
|
|
152
|
+
$[27] = grouped;
|
|
153
|
+
$[28] = isChecked;
|
|
154
|
+
$[29] = isDisabled;
|
|
155
|
+
$[30] = isReadOnly;
|
|
156
|
+
$[31] = onChange;
|
|
157
|
+
$[32] = setLocalChecked;
|
|
158
|
+
$[33] = value;
|
|
159
|
+
$[34] = t7;
|
|
160
|
+
} else t7 = $[34];
|
|
161
|
+
const select = t7;
|
|
162
|
+
let t8;
|
|
163
|
+
if ($[35] !== group || $[36] !== grouped || $[37] !== isDisabled || $[38] !== isReadOnly || $[39] !== select || $[40] !== value) {
|
|
164
|
+
t8 = (event) => {
|
|
168
165
|
if (isDisabled || isReadOnly) return;
|
|
169
166
|
if (event.key === " " || event.key === "Enter") {
|
|
170
167
|
event.preventDefault();
|
|
@@ -182,139 +179,139 @@ var CheckCard = React.forwardRef((t0, forwardedRef) => {
|
|
|
182
179
|
group.selectRelative(value, event.key === "ArrowRight" || event.key === "ArrowDown" ? 1 : -1);
|
|
183
180
|
}
|
|
184
181
|
};
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
} else
|
|
193
|
-
const handleKeyDown =
|
|
182
|
+
$[35] = group;
|
|
183
|
+
$[36] = grouped;
|
|
184
|
+
$[37] = isDisabled;
|
|
185
|
+
$[38] = isReadOnly;
|
|
186
|
+
$[39] = select;
|
|
187
|
+
$[40] = value;
|
|
188
|
+
$[41] = t8;
|
|
189
|
+
} else t8 = $[41];
|
|
190
|
+
const handleKeyDown = t8;
|
|
194
191
|
const symbolType = isChecked ? checkedSymbol ?? symbol : symbol;
|
|
195
|
-
let
|
|
196
|
-
if ($[
|
|
197
|
-
|
|
192
|
+
let t9;
|
|
193
|
+
if ($[42] !== symbolType) {
|
|
194
|
+
t9 = symbolType ? /* @__PURE__ */ jsx(Icon, {
|
|
198
195
|
className: "k-check-card-symbol-icon",
|
|
199
196
|
type: symbolType
|
|
200
197
|
}) : null;
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
} else
|
|
204
|
-
const symbolNode =
|
|
205
|
-
const
|
|
206
|
-
const
|
|
207
|
-
const
|
|
208
|
-
const
|
|
209
|
-
let
|
|
210
|
-
if ($[
|
|
211
|
-
|
|
198
|
+
$[42] = symbolType;
|
|
199
|
+
$[43] = t9;
|
|
200
|
+
} else t9 = $[43];
|
|
201
|
+
const symbolNode = t9;
|
|
202
|
+
const t10 = `k-check-card-${currentTheme}`;
|
|
203
|
+
const t11 = `k-check-card-${currentSize}`;
|
|
204
|
+
const t12 = `k-check-card-${currentShape}`;
|
|
205
|
+
const t13 = !!symbolNode;
|
|
206
|
+
let t14;
|
|
207
|
+
if ($[44] !== className || $[45] !== isChecked || $[46] !== isDisabled || $[47] !== isReadOnly || $[48] !== t10 || $[49] !== t11 || $[50] !== t12 || $[51] !== t13) {
|
|
208
|
+
t14 = clsx("k-check-card", t10, t11, t12, {
|
|
212
209
|
"is-checked": isChecked,
|
|
213
210
|
"is-disabled": isDisabled,
|
|
214
211
|
"is-readonly": isReadOnly,
|
|
215
|
-
"has-symbol":
|
|
212
|
+
"has-symbol": t13
|
|
216
213
|
}, className);
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
214
|
+
$[44] = className;
|
|
215
|
+
$[45] = isChecked;
|
|
216
|
+
$[46] = isDisabled;
|
|
217
|
+
$[47] = isReadOnly;
|
|
218
|
+
$[48] = t10;
|
|
221
219
|
$[49] = t11;
|
|
222
220
|
$[50] = t12;
|
|
223
221
|
$[51] = t13;
|
|
224
222
|
$[52] = t14;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const t16 =
|
|
228
|
-
const t17 =
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
t19 = symbolNode ? /* @__PURE__ */ jsx("div", {
|
|
223
|
+
} else t14 = $[52];
|
|
224
|
+
const t15 = grouped ? "radio" : "checkbox";
|
|
225
|
+
const t16 = isReadOnly || void 0;
|
|
226
|
+
const t17 = isDisabled ? -1 : isChecked || !grouped ? 0 : -1;
|
|
227
|
+
let t18;
|
|
228
|
+
if ($[53] !== symbolNode) {
|
|
229
|
+
t18 = symbolNode ? /* @__PURE__ */ jsx("div", {
|
|
233
230
|
className: "k-check-card-symbol",
|
|
234
231
|
children: symbolNode
|
|
235
232
|
}) : null;
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
} else
|
|
239
|
-
let
|
|
240
|
-
if ($[
|
|
241
|
-
|
|
233
|
+
$[53] = symbolNode;
|
|
234
|
+
$[54] = t18;
|
|
235
|
+
} else t18 = $[54];
|
|
236
|
+
let t19;
|
|
237
|
+
if ($[55] !== title) {
|
|
238
|
+
t19 = title !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
242
239
|
className: "k-check-card-title",
|
|
243
240
|
children: title
|
|
244
241
|
}) : null;
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
247
|
-
} else
|
|
248
|
-
let
|
|
249
|
-
if ($[
|
|
250
|
-
|
|
242
|
+
$[55] = title;
|
|
243
|
+
$[56] = t19;
|
|
244
|
+
} else t19 = $[56];
|
|
245
|
+
let t20;
|
|
246
|
+
if ($[57] !== description) {
|
|
247
|
+
t20 = description !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
251
248
|
className: "k-check-card-description",
|
|
252
249
|
children: description
|
|
253
250
|
}) : null;
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
} else
|
|
257
|
-
let
|
|
258
|
-
if ($[
|
|
259
|
-
|
|
251
|
+
$[57] = description;
|
|
252
|
+
$[58] = t20;
|
|
253
|
+
} else t20 = $[58];
|
|
254
|
+
let t21;
|
|
255
|
+
if ($[59] !== children || $[60] !== t19 || $[61] !== t20) {
|
|
256
|
+
t21 = /* @__PURE__ */ jsxs("div", {
|
|
260
257
|
className: "k-check-card-content",
|
|
261
258
|
children: [
|
|
259
|
+
t19,
|
|
262
260
|
t20,
|
|
263
|
-
t21,
|
|
264
261
|
children
|
|
265
262
|
]
|
|
266
263
|
});
|
|
267
|
-
$[
|
|
264
|
+
$[59] = children;
|
|
265
|
+
$[60] = t19;
|
|
268
266
|
$[61] = t20;
|
|
269
267
|
$[62] = t21;
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
t23 = showIndicator ? /* @__PURE__ */ jsx("span", {
|
|
268
|
+
} else t21 = $[62];
|
|
269
|
+
let t22;
|
|
270
|
+
if ($[63] !== isChecked || $[64] !== showIndicator) {
|
|
271
|
+
t22 = showIndicator ? /* @__PURE__ */ jsx("span", {
|
|
275
272
|
className: "k-check-card-indicator",
|
|
276
273
|
"aria-hidden": "true",
|
|
277
274
|
children: isChecked ? /* @__PURE__ */ jsx(Icon, { type: Check }) : null
|
|
278
275
|
}) : null;
|
|
279
|
-
$[
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
} else
|
|
283
|
-
let
|
|
284
|
-
if ($[
|
|
285
|
-
|
|
276
|
+
$[63] = isChecked;
|
|
277
|
+
$[64] = showIndicator;
|
|
278
|
+
$[65] = t22;
|
|
279
|
+
} else t22 = $[65];
|
|
280
|
+
let t23;
|
|
281
|
+
if ($[66] !== handleKeyDown || $[67] !== isChecked || $[68] !== isDisabled || $[69] !== rest || $[70] !== select || $[71] !== setRefs || $[72] !== t14 || $[73] !== t15 || $[74] !== t16 || $[75] !== t17 || $[76] !== t18 || $[77] !== t21 || $[78] !== t22) {
|
|
282
|
+
t23 = /* @__PURE__ */ jsxs("div", {
|
|
286
283
|
...rest,
|
|
287
284
|
ref: setRefs,
|
|
288
|
-
className:
|
|
289
|
-
role:
|
|
285
|
+
className: t14,
|
|
286
|
+
role: t15,
|
|
290
287
|
"aria-checked": isChecked,
|
|
291
288
|
"aria-disabled": isDisabled,
|
|
292
|
-
"aria-readonly":
|
|
293
|
-
tabIndex:
|
|
289
|
+
"aria-readonly": t16,
|
|
290
|
+
tabIndex: t17,
|
|
294
291
|
onClick: select,
|
|
295
292
|
onKeyDown: handleKeyDown,
|
|
296
293
|
children: [
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
294
|
+
t18,
|
|
295
|
+
t21,
|
|
296
|
+
t22
|
|
300
297
|
]
|
|
301
298
|
});
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
299
|
+
$[66] = handleKeyDown;
|
|
300
|
+
$[67] = isChecked;
|
|
301
|
+
$[68] = isDisabled;
|
|
302
|
+
$[69] = rest;
|
|
303
|
+
$[70] = select;
|
|
304
|
+
$[71] = setRefs;
|
|
305
|
+
$[72] = t14;
|
|
308
306
|
$[73] = t15;
|
|
309
307
|
$[74] = t16;
|
|
310
308
|
$[75] = t17;
|
|
311
309
|
$[76] = t18;
|
|
312
|
-
$[77] =
|
|
310
|
+
$[77] = t21;
|
|
313
311
|
$[78] = t22;
|
|
314
312
|
$[79] = t23;
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
return t24;
|
|
313
|
+
} else t23 = $[79];
|
|
314
|
+
return t23;
|
|
318
315
|
});
|
|
319
316
|
CheckCard.displayName = "CheckCard";
|
|
320
317
|
var check_card_default = createFormFieldComponent(CheckCard, {
|
|
@@ -322,5 +319,8 @@ var check_card_default = createFormFieldComponent(CheckCard, {
|
|
|
322
319
|
getFieldValue: (value) => value === true || value === 1 || value === "1",
|
|
323
320
|
getChangeValue: (event) => event.checked
|
|
324
321
|
});
|
|
322
|
+
function _temp(next) {
|
|
323
|
+
return next ?? false;
|
|
324
|
+
}
|
|
325
325
|
//#endregion
|
|
326
326
|
export { check_card_default as default };
|
package/es/check-card/context.js
CHANGED