react-kui 2.0.0 → 3.0.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.en-US.md +23 -0
- package/AI.md +76 -0
- package/LICENSE +21 -21
- package/README.zh-CN.md +142 -0
- package/ai/behaviors.json +16 -0
- package/ai/cli.mjs +27 -0
- package/ai/evals/README.md +59 -0
- package/ai/evals/cases.json +207 -0
- package/ai/evals/config.json +4 -0
- package/ai/evals/evaluate.mjs +267 -0
- package/ai/evals/run.mjs +118 -0
- package/ai/kui-components.json +58292 -0
- package/ai/kui-components.schema.json +143 -0
- package/ai/mcp.mjs +290 -0
- package/ai/skills/react-kui/SKILL.md +16 -0
- package/ai/skills/react-kui/references/components.md +9 -0
- package/ai/skills/react-kui/references/mcp.md +14 -0
- package/ai/templates/form.tsx +69 -0
- package/ai/templates/index.json +23 -0
- package/ai/templates/modal-editor.tsx +80 -0
- package/ai/templates/table.tsx +85 -0
- package/ai/validate.d.mts +16 -0
- package/ai/validate.mjs +184 -0
- package/es/_virtual/_rolldown/runtime.js +21 -0
- package/es/affix/index.js +222 -0
- package/es/alert/index.js +71 -0
- package/es/anchor/anchor-context.js +13 -0
- package/es/anchor/anchor-link.js +121 -0
- package/es/anchor/anchor.js +431 -0
- package/es/auto-complete/index.js +692 -0
- package/es/avatar/avatar-group-context.js +13 -0
- package/es/avatar/avatar-group.js +145 -0
- package/es/avatar/avatar.js +204 -0
- package/es/back-top/index.js +224 -0
- package/es/badge/index.js +66 -0
- package/es/base/teleport.js +83 -0
- package/es/base/transition-props.js +56 -0
- package/es/base/transition.js +108 -0
- package/es/breadcrumb/breadcrumb-context.js +13 -0
- package/es/breadcrumb/breadcrumb-item.js +128 -0
- package/es/breadcrumb/breadcrumb.js +75 -0
- package/es/button/button-group-context.js +13 -0
- package/es/button/button-group.js +100 -0
- package/es/button/button.js +99 -0
- package/es/calendar/index.js +271 -0
- package/es/card/index.js +157 -0
- package/es/carousel/carousel-context.js +17 -0
- package/es/carousel/carousel-item.js +71 -0
- package/es/carousel/carousel.js +453 -0
- package/es/cascader/index.js +435 -0
- package/es/check-card/check-card-group.js +211 -0
- package/es/check-card/check-card.js +326 -0
- package/es/check-card/context.js +13 -0
- package/es/checkbox/checkbox-group-context.js +13 -0
- package/es/checkbox/checkbox-group.js +168 -0
- package/es/checkbox/checkbox.js +270 -0
- package/es/checkbox/index.js +14 -0
- package/es/collapse/collapse-panel.js +233 -0
- package/es/collapse/collapse.js +186 -0
- package/es/color-picker/alpha.js +131 -0
- package/es/color-picker/hue.js +111 -0
- package/es/color-picker/index.js +329 -0
- package/es/color-picker/mode.js +178 -0
- package/es/color-picker/paint.js +175 -0
- package/es/color-picker/presets.js +80 -0
- package/es/components.js +260 -0
- package/es/config/config-context.js +13 -0
- package/es/config/context.js +26 -0
- package/es/config/index.js +52 -0
- package/es/config/size-context.js +13 -0
- package/es/config/use-config-appearance.js +39 -0
- package/es/const/var.js +31 -0
- package/es/date-picker/index.js +1257 -0
- package/es/descriptions/descriptions-item.js +25 -0
- package/es/descriptions/descriptions.js +285 -0
- package/es/divider/index.js +38 -0
- package/es/drawer/index.js +432 -0
- package/es/dropdown/dropdown-button.js +139 -0
- package/es/dropdown/dropdown-context.js +16 -0
- package/es/dropdown/dropdown.js +351 -0
- package/es/dropdown/trigger.js +88 -0
- package/es/empty/index.js +133 -0
- package/es/feature-card/index.js +74 -0
- package/es/feedback-panel/index.js +179 -0
- package/es/flame-wrap/index.js +262 -0
- package/es/flame-wrap/types.js +593 -0
- package/es/flex/index.js +46 -0
- package/es/form/field-context.js +102 -0
- package/es/form/form-context.js +13 -0
- package/es/form/form-item.js +327 -0
- package/es/form/form.js +303 -0
- package/es/form/utils.js +44 -0
- package/es/grid/grid-item.js +130 -0
- package/es/grid/grid.js +177 -0
- package/es/grid/useBreakpoint.js +64 -0
- package/es/icon/index.js +161 -0
- package/es/image/group.js +121 -0
- package/es/image/image-group-context.js +13 -0
- package/es/image/image.js +314 -0
- package/es/image/instance.js +47 -0
- package/es/image/preview.js +383 -0
- package/es/image/utils.js +39 -0
- package/es/index.js +129 -0
- package/es/input/index.js +15 -0
- package/es/input/input-box.js +40 -0
- package/es/input/input-group.js +150 -0
- package/es/input/input.js +203 -0
- package/es/input/textarea.js +135 -0
- package/es/input-number/index.js +153 -0
- package/es/input-otp/index.js +142 -0
- package/es/input-tag/index.js +178 -0
- package/es/kanban/index.js +254 -0
- package/es/layout/index.js +256 -0
- package/es/layout/layout-context.js +13 -0
- package/es/list-panel/index.js +194 -0
- package/es/loading/index.js +69 -0
- package/es/loading/loading-bar.js +133 -0
- package/es/locale/de.js +69 -0
- package/es/locale/el.js +69 -0
- package/es/locale/en.js +69 -0
- package/es/locale/fr.js +69 -0
- package/es/locale/it.js +69 -0
- package/es/locale/ja.js +69 -0
- package/es/locale/ko.js +69 -0
- package/es/locale/ru.js +69 -0
- package/es/locale/th.js +69 -0
- package/es/locale/uk.js +69 -0
- package/es/locale/vi.js +69 -0
- package/es/locale/zh-CN.js +69 -0
- package/es/locale/zh-TW.js +69 -0
- package/es/mentions/index.js +710 -0
- package/es/menu/menu-context.js +20 -0
- package/es/menu/menu-divider.js +29 -0
- package/es/menu/menu-group.js +49 -0
- package/es/menu/menu-item.js +79 -0
- package/es/menu/menu-keyboard.js +35 -0
- package/es/menu/menu.js +484 -0
- package/es/menu/recursive-menu.js +68 -0
- package/es/menu/sub-menu.js +256 -0
- package/es/message/index.js +67 -0
- package/es/modal/api.js +62 -0
- package/es/modal/modal.js +589 -0
- package/es/modal/toast.js +99 -0
- package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +189 -0
- package/es/notice/container.js +123 -0
- package/es/notice/content.js +92 -0
- package/es/notice/index.js +52 -0
- package/es/notice/instance.js +65 -0
- package/es/page/index.js +275 -0
- package/es/page-header/index.js +134 -0
- package/es/popconfirm/index.js +275 -0
- package/es/poptip/index.js +270 -0
- package/es/progress/index.js +253 -0
- package/es/qrcode/index.js +204 -0
- package/es/radio/radio-button.js +158 -0
- package/es/radio/radio-group-context.js +13 -0
- package/es/radio/radio-group.js +264 -0
- package/es/radio/radio.js +232 -0
- package/es/rate/index.js +253 -0
- package/es/rate/star.js +150 -0
- package/es/result/index.js +147 -0
- package/es/ripple/index.js +245 -0
- package/es/ripple/types.js +433 -0
- package/es/row-col/col.js +163 -0
- package/es/row-col/row.js +37 -0
- package/es/segmented/index.js +240 -0
- package/es/select/option.js +124 -0
- package/es/select/select.js +655 -0
- package/es/skeleton/skeleton-avatar.js +44 -0
- package/es/skeleton/skeleton-button.js +43 -0
- package/es/skeleton/skeleton-image.js +131 -0
- package/es/skeleton/skeleton-text.js +113 -0
- package/es/skeleton/skeleton.js +148 -0
- package/es/skeleton/use-skeleton-loading.js +53 -0
- package/es/slider/index.js +484 -0
- package/es/slider/thumb.js +158 -0
- package/es/space/index.js +94 -0
- package/es/spin/index.js +61 -0
- package/es/splitter/splitter-panel.js +50 -0
- package/es/splitter/splitter.js +310 -0
- package/es/stat-card/countup.js +157 -0
- package/es/stat-card/stat-card.js +63 -0
- package/es/stat-card/stat-number.js +125 -0
- package/es/stat-card/utils/countup.js +291 -0
- package/es/stat-card/utils/odometer.js +129 -0
- package/es/steps/index.js +139 -0
- package/es/switch/index.js +72 -0
- package/es/table/column-setting.js +179 -0
- package/es/table/index.js +506 -0
- package/es/table/utils.js +34 -0
- package/es/tabs/tab-panel.js +86 -0
- package/es/tabs/tabs.js +263 -0
- package/es/tag/index.js +74 -0
- package/es/time-line/timeline-item.js +133 -0
- package/es/time-line/timeline.js +55 -0
- package/es/tooltip/index.js +278 -0
- package/es/tour/index.js +379 -0
- package/es/transfer/index.js +511 -0
- package/es/tree/index.js +488 -0
- package/es/tree/utils.js +101 -0
- package/es/tree-select/index.js +938 -0
- package/es/typography/index.js +359 -0
- package/es/upload/file-list.js +143 -0
- package/es/upload/index.js +434 -0
- package/es/upload/picture-sort.js +142 -0
- package/es/upload/selector.js +207 -0
- package/es/utils/checked.js +24 -0
- package/es/utils/color.js +15 -0
- package/es/utils/number.js +74 -0
- package/es/utils/placement.js +151 -0
- package/es/utils/react-node.js +63 -0
- package/es/utils/share.js +12 -0
- package/es/utils/theme.js +57 -0
- package/es/utils/transition.js +58 -0
- package/es/utils/use-value.js +60 -0
- package/es/virtual-list/index.js +252 -0
- package/es/virtual-list/range.js +27 -0
- package/es/watermark/index.js +313 -0
- package/lib/index.cjs +9 -0
- package/lib/locale/de.cjs +9 -0
- package/lib/locale/el.cjs +9 -0
- package/lib/locale/en.cjs +9 -0
- package/lib/locale/fr.cjs +9 -0
- package/lib/locale/it.cjs +9 -0
- package/lib/locale/ja.cjs +9 -0
- package/lib/locale/ko.cjs +9 -0
- package/lib/locale/ru.cjs +9 -0
- package/lib/locale/th.cjs +9 -0
- package/lib/locale/uk.cjs +9 -0
- package/lib/locale/vi.cjs +9 -0
- package/lib/locale/zh-CN.cjs +9 -0
- package/lib/locale/zh-TW.cjs +9 -0
- package/package.json +175 -94
- package/readme.md +142 -82
- package/style/base.css +9 -0
- package/style/components.css +9 -0
- package/style/index.css +9 -0
- package/style/theme.css +9 -0
- package/types/affix/index.d.cts +9 -0
- package/types/affix/index.d.ts +9 -0
- package/types/alert/index.d.cts +18 -0
- package/types/alert/index.d.ts +18 -0
- package/types/anchor/anchor-context.d.cts +7 -0
- package/types/anchor/anchor-context.d.ts +7 -0
- package/types/anchor/anchor-link.d.cts +6 -0
- package/types/anchor/anchor-link.d.ts +6 -0
- package/types/anchor/anchor.d.cts +10 -0
- package/types/anchor/anchor.d.ts +10 -0
- package/types/anchor/index.d.cts +5 -0
- package/types/anchor/index.d.ts +5 -0
- package/types/auto-complete/index.d.cts +28 -0
- package/types/auto-complete/index.d.ts +28 -0
- package/types/avatar/avatar-group-context.d.cts +7 -0
- package/types/avatar/avatar-group-context.d.ts +7 -0
- package/types/avatar/avatar-group.d.cts +11 -0
- package/types/avatar/avatar-group.d.ts +11 -0
- package/types/avatar/avatar.d.cts +14 -0
- package/types/avatar/avatar.d.ts +14 -0
- package/types/avatar/index.d.cts +5 -0
- package/types/avatar/index.d.ts +5 -0
- package/types/back-top/index.d.cts +11 -0
- package/types/back-top/index.d.ts +11 -0
- package/types/badge/index.d.cts +15 -0
- package/types/badge/index.d.ts +15 -0
- package/types/base/teleport.d.cts +13 -0
- package/types/base/teleport.d.ts +13 -0
- package/types/base/transition-props.d.cts +4 -0
- package/types/base/transition-props.d.ts +4 -0
- package/types/base/transition.d.cts +27 -0
- package/types/base/transition.d.ts +27 -0
- package/types/breadcrumb/breadcrumb-context.d.cts +2 -0
- package/types/breadcrumb/breadcrumb-context.d.ts +2 -0
- package/types/breadcrumb/breadcrumb-item.d.cts +11 -0
- package/types/breadcrumb/breadcrumb-item.d.ts +11 -0
- package/types/breadcrumb/breadcrumb.d.cts +7 -0
- package/types/breadcrumb/breadcrumb.d.ts +7 -0
- package/types/breadcrumb/index.d.cts +5 -0
- package/types/breadcrumb/index.d.ts +5 -0
- package/types/button/button-group-context.d.cts +6 -0
- package/types/button/button-group-context.d.ts +6 -0
- package/types/button/button-group.d.cts +9 -0
- package/types/button/button-group.d.ts +9 -0
- package/types/button/button.d.cts +20 -0
- package/types/button/button.d.ts +20 -0
- package/types/button/index.d.cts +5 -0
- package/types/button/index.d.ts +5 -0
- package/types/calendar/index.d.cts +36 -0
- package/types/calendar/index.d.ts +36 -0
- package/types/card/index.d.cts +22 -0
- package/types/card/index.d.ts +22 -0
- package/types/carousel/carousel-context.d.cts +6 -0
- package/types/carousel/carousel-context.d.ts +6 -0
- package/types/carousel/carousel-item.d.cts +3 -0
- package/types/carousel/carousel-item.d.ts +3 -0
- package/types/carousel/carousel.d.cts +18 -0
- package/types/carousel/carousel.d.ts +18 -0
- package/types/carousel/index.d.cts +5 -0
- package/types/carousel/index.d.ts +5 -0
- package/types/cascader/index.d.cts +5 -0
- package/types/cascader/index.d.ts +5 -0
- package/types/cascader/types.d.cts +38 -0
- package/types/cascader/types.d.ts +38 -0
- package/types/check-card/check-card-group.d.cts +4 -0
- package/types/check-card/check-card-group.d.ts +4 -0
- package/types/check-card/check-card.d.cts +4 -0
- package/types/check-card/check-card.d.ts +4 -0
- package/types/check-card/context.d.cts +14 -0
- package/types/check-card/context.d.ts +14 -0
- package/types/check-card/index.d.cts +4 -0
- package/types/check-card/index.d.ts +4 -0
- package/types/check-card/types.d.cts +46 -0
- package/types/check-card/types.d.ts +46 -0
- package/types/checkbox/checkbox-group-context.d.cts +11 -0
- package/types/checkbox/checkbox-group-context.d.ts +11 -0
- package/types/checkbox/checkbox-group.d.cts +22 -0
- package/types/checkbox/checkbox-group.d.ts +22 -0
- package/types/checkbox/checkbox.d.cts +23 -0
- package/types/checkbox/checkbox.d.ts +23 -0
- package/types/checkbox/index.d.cts +6 -0
- package/types/checkbox/index.d.ts +6 -0
- package/types/collapse/collapse-panel.d.cts +12 -0
- package/types/collapse/collapse-panel.d.ts +12 -0
- package/types/collapse/collapse.d.cts +15 -0
- package/types/collapse/collapse.d.ts +15 -0
- package/types/collapse/index.d.cts +6 -0
- package/types/collapse/index.d.ts +6 -0
- package/types/color-picker/alpha.d.cts +6 -0
- package/types/color-picker/alpha.d.ts +6 -0
- package/types/color-picker/hue.d.cts +5 -0
- package/types/color-picker/hue.d.ts +5 -0
- package/types/color-picker/index.d.cts +30 -0
- package/types/color-picker/index.d.ts +30 -0
- package/types/color-picker/mode.d.cts +10 -0
- package/types/color-picker/mode.d.ts +10 -0
- package/types/color-picker/paint.d.cts +7 -0
- package/types/color-picker/paint.d.ts +7 -0
- package/types/color-picker/presets.d.cts +7 -0
- package/types/color-picker/presets.d.ts +7 -0
- package/types/components.d.cts +165 -0
- package/types/components.d.ts +165 -0
- package/types/config/config-context.d.cts +11 -0
- package/types/config/config-context.d.ts +11 -0
- package/types/config/context.d.cts +7 -0
- package/types/config/context.d.ts +7 -0
- package/types/config/index.d.cts +14 -0
- package/types/config/index.d.ts +14 -0
- package/types/config/size-context.d.cts +3 -0
- package/types/config/size-context.d.ts +3 -0
- package/types/config/use-config-appearance.d.cts +7 -0
- package/types/config/use-config-appearance.d.ts +7 -0
- package/types/const/types.d.cts +22 -0
- package/types/const/types.d.ts +22 -0
- package/types/const/var.d.cts +1 -0
- package/types/const/var.d.ts +1 -0
- package/types/date-picker/index.d.cts +54 -0
- package/types/date-picker/index.d.ts +54 -0
- package/types/descriptions/descriptions-item.d.cts +5 -0
- package/types/descriptions/descriptions-item.d.ts +5 -0
- package/types/descriptions/descriptions.d.cts +21 -0
- package/types/descriptions/descriptions.d.ts +21 -0
- package/types/descriptions/index.d.cts +4 -0
- package/types/descriptions/index.d.ts +4 -0
- package/types/directives/outsiteclick.d.cts +3 -0
- package/types/directives/outsiteclick.d.ts +3 -0
- package/types/directives/resize.d.cts +3 -0
- package/types/directives/resize.d.ts +3 -0
- package/types/directives/scroll.d.cts +3 -0
- package/types/directives/scroll.d.ts +3 -0
- package/types/directives/transfer.d.cts +2 -0
- package/types/directives/transfer.d.ts +2 -0
- package/types/divider/index.d.cts +14 -0
- package/types/divider/index.d.ts +14 -0
- package/types/drawer/index.d.cts +27 -0
- package/types/drawer/index.d.ts +27 -0
- package/types/dropdown/dropdown-button.d.cts +17 -0
- package/types/dropdown/dropdown-button.d.ts +17 -0
- package/types/dropdown/dropdown-context.d.cts +11 -0
- package/types/dropdown/dropdown-context.d.ts +11 -0
- package/types/dropdown/dropdown.d.cts +18 -0
- package/types/dropdown/dropdown.d.ts +18 -0
- package/types/dropdown/index.d.cts +4 -0
- package/types/dropdown/index.d.ts +4 -0
- package/types/dropdown/trigger.d.cts +9 -0
- package/types/dropdown/trigger.d.ts +9 -0
- package/types/empty/index.d.cts +9 -0
- package/types/empty/index.d.ts +9 -0
- package/types/feature-card/index.d.cts +20 -0
- package/types/feature-card/index.d.ts +20 -0
- package/types/feedback-panel/index.d.cts +15 -0
- package/types/feedback-panel/index.d.ts +15 -0
- package/types/flame-wrap/index.d.cts +3 -0
- package/types/flame-wrap/index.d.ts +3 -0
- package/types/flame-wrap/types.d.cts +71 -0
- package/types/flame-wrap/types.d.ts +71 -0
- package/types/flex/index.d.cts +15 -0
- package/types/flex/index.d.ts +15 -0
- package/types/form/field-context.d.cts +39 -0
- package/types/form/field-context.d.ts +39 -0
- package/types/form/form-context.d.cts +22 -0
- package/types/form/form-context.d.ts +22 -0
- package/types/form/form-item.d.cts +12 -0
- package/types/form/form-item.d.ts +12 -0
- package/types/form/form.d.cts +40 -0
- package/types/form/form.d.ts +40 -0
- package/types/form/index.d.cts +7 -0
- package/types/form/index.d.ts +7 -0
- package/types/form/types.d.cts +20 -0
- package/types/form/types.d.ts +20 -0
- package/types/form/utils.d.cts +6 -0
- package/types/form/utils.d.ts +6 -0
- package/types/grid/grid-item.d.cts +10 -0
- package/types/grid/grid-item.d.ts +10 -0
- package/types/grid/grid.d.cts +17 -0
- package/types/grid/grid.d.ts +17 -0
- package/types/grid/index.d.cts +6 -0
- package/types/grid/index.d.ts +6 -0
- package/types/grid/useBreakpoint.d.cts +11 -0
- package/types/grid/useBreakpoint.d.ts +11 -0
- package/types/icon/index.d.cts +15 -0
- package/types/icon/index.d.ts +15 -0
- package/types/image/group.d.cts +5 -0
- package/types/image/group.d.ts +5 -0
- package/types/image/image-group-context.d.cts +8 -0
- package/types/image/image-group-context.d.ts +8 -0
- package/types/image/image.d.cts +28 -0
- package/types/image/image.d.ts +28 -0
- package/types/image/index.d.cts +6 -0
- package/types/image/index.d.ts +6 -0
- package/types/image/instance.d.cts +5 -0
- package/types/image/instance.d.ts +5 -0
- package/types/image/preview.d.cts +19 -0
- package/types/image/preview.d.ts +19 -0
- package/types/image/utils.d.cts +6 -0
- package/types/image/utils.d.ts +6 -0
- package/types/index.d.cts +8 -0
- package/types/index.d.ts +8 -0
- package/types/input/index.d.cts +8 -0
- package/types/input/index.d.ts +8 -0
- package/types/input/input-box.d.cts +14 -0
- package/types/input/input-box.d.ts +14 -0
- package/types/input/input-group.d.cts +11 -0
- package/types/input/input-group.d.ts +11 -0
- package/types/input/input.d.cts +28 -0
- package/types/input/input.d.ts +28 -0
- package/types/input/textarea.d.cts +11 -0
- package/types/input/textarea.d.ts +11 -0
- package/types/input-number/index.d.cts +27 -0
- package/types/input-number/index.d.ts +27 -0
- package/types/input-otp/index.d.cts +27 -0
- package/types/input-otp/index.d.ts +27 -0
- package/types/input-tag/index.d.cts +23 -0
- package/types/input-tag/index.d.ts +23 -0
- package/types/kanban/index.d.cts +31 -0
- package/types/kanban/index.d.ts +31 -0
- package/types/layout/index.d.cts +29 -0
- package/types/layout/index.d.ts +29 -0
- package/types/layout/layout-context.d.cts +1 -0
- package/types/layout/layout-context.d.ts +1 -0
- package/types/list-panel/index.d.cts +16 -0
- package/types/list-panel/index.d.ts +16 -0
- package/types/loading/index.d.cts +10 -0
- package/types/loading/index.d.ts +10 -0
- package/types/loading/loading-bar.d.cts +12 -0
- package/types/loading/loading-bar.d.ts +12 -0
- package/types/locale/de.d.cts +65 -0
- package/types/locale/de.d.ts +65 -0
- package/types/locale/el.d.cts +65 -0
- package/types/locale/el.d.ts +65 -0
- package/types/locale/en.d.cts +65 -0
- package/types/locale/en.d.ts +65 -0
- package/types/locale/fr.d.cts +65 -0
- package/types/locale/fr.d.ts +65 -0
- package/types/locale/it.d.cts +65 -0
- package/types/locale/it.d.ts +65 -0
- package/types/locale/ja.d.cts +65 -0
- package/types/locale/ja.d.ts +65 -0
- package/types/locale/ko.d.cts +65 -0
- package/types/locale/ko.d.ts +65 -0
- package/types/locale/ru.d.cts +65 -0
- package/types/locale/ru.d.ts +65 -0
- package/types/locale/th.d.cts +65 -0
- package/types/locale/th.d.ts +65 -0
- package/types/locale/uk.d.cts +65 -0
- package/types/locale/uk.d.ts +65 -0
- package/types/locale/vi.d.cts +65 -0
- package/types/locale/vi.d.ts +65 -0
- package/types/locale/zh-CN.d.cts +65 -0
- package/types/locale/zh-CN.d.ts +65 -0
- package/types/locale/zh-TW.d.cts +65 -0
- package/types/locale/zh-TW.d.ts +65 -0
- package/types/mentions/index.d.cts +28 -0
- package/types/mentions/index.d.ts +28 -0
- package/types/menu/index.d.cts +7 -0
- package/types/menu/index.d.ts +7 -0
- package/types/menu/menu-context.d.cts +24 -0
- package/types/menu/menu-context.d.ts +24 -0
- package/types/menu/menu-divider.d.cts +3 -0
- package/types/menu/menu-divider.d.ts +3 -0
- package/types/menu/menu-group.d.cts +7 -0
- package/types/menu/menu-group.d.ts +7 -0
- package/types/menu/menu-item.d.cts +15 -0
- package/types/menu/menu-item.d.ts +15 -0
- package/types/menu/menu-keyboard.d.cts +7 -0
- package/types/menu/menu-keyboard.d.ts +7 -0
- package/types/menu/menu.d.cts +33 -0
- package/types/menu/menu.d.ts +33 -0
- package/types/menu/recursive-menu.d.cts +7 -0
- package/types/menu/recursive-menu.d.ts +7 -0
- package/types/menu/sub-menu.d.cts +12 -0
- package/types/menu/sub-menu.d.ts +12 -0
- package/types/message/index.d.cts +24 -0
- package/types/message/index.d.ts +24 -0
- package/types/modal/api.d.cts +26 -0
- package/types/modal/api.d.ts +26 -0
- package/types/modal/index.d.cts +4 -0
- package/types/modal/index.d.ts +4 -0
- package/types/modal/modal.d.cts +32 -0
- package/types/modal/modal.d.ts +32 -0
- package/types/modal/toast.d.cts +15 -0
- package/types/modal/toast.d.ts +15 -0
- package/types/notice/container.d.cts +9 -0
- package/types/notice/container.d.ts +9 -0
- package/types/notice/content.d.cts +22 -0
- package/types/notice/content.d.ts +22 -0
- package/types/notice/index.d.cts +24 -0
- package/types/notice/index.d.ts +24 -0
- package/types/notice/instance.d.cts +7 -0
- package/types/notice/instance.d.ts +7 -0
- package/types/page/index.d.cts +19 -0
- package/types/page/index.d.ts +19 -0
- package/types/page-header/index.d.cts +10 -0
- package/types/page-header/index.d.ts +10 -0
- package/types/popconfirm/index.d.cts +27 -0
- package/types/popconfirm/index.d.ts +27 -0
- package/types/poptip/index.d.cts +25 -0
- package/types/poptip/index.d.ts +25 -0
- package/types/progress/index.d.cts +21 -0
- package/types/progress/index.d.ts +21 -0
- package/types/qrcode/index.d.cts +28 -0
- package/types/qrcode/index.d.ts +28 -0
- package/types/radio/index.d.cts +7 -0
- package/types/radio/index.d.ts +7 -0
- package/types/radio/radio-button.d.cts +20 -0
- package/types/radio/radio-button.d.ts +20 -0
- package/types/radio/radio-group-context.d.cts +13 -0
- package/types/radio/radio-group-context.d.ts +13 -0
- package/types/radio/radio-group.d.cts +26 -0
- package/types/radio/radio-group.d.ts +26 -0
- package/types/radio/radio.d.cts +17 -0
- package/types/radio/radio.d.ts +17 -0
- package/types/radio/types.d.cts +5 -0
- package/types/radio/types.d.ts +5 -0
- package/types/rate/index.d.cts +22 -0
- package/types/rate/index.d.ts +22 -0
- package/types/rate/star.d.cts +19 -0
- package/types/rate/star.d.ts +19 -0
- package/types/result/index.d.cts +12 -0
- package/types/result/index.d.ts +12 -0
- package/types/ripple/index.d.cts +10 -0
- package/types/ripple/index.d.ts +10 -0
- package/types/ripple/types.d.cts +48 -0
- package/types/ripple/types.d.ts +48 -0
- package/types/row-col/col.d.cts +26 -0
- package/types/row-col/col.d.ts +26 -0
- package/types/row-col/index.d.cts +5 -0
- package/types/row-col/index.d.ts +5 -0
- package/types/row-col/row.d.cts +9 -0
- package/types/row-col/row.d.ts +9 -0
- package/types/segmented/index.d.cts +25 -0
- package/types/segmented/index.d.ts +25 -0
- package/types/select/index.d.cts +5 -0
- package/types/select/index.d.ts +5 -0
- package/types/select/option.d.cts +17 -0
- package/types/select/option.d.ts +17 -0
- package/types/select/select.d.cts +51 -0
- package/types/select/select.d.ts +51 -0
- package/types/skeleton/index.d.cts +11 -0
- package/types/skeleton/index.d.ts +11 -0
- package/types/skeleton/skeleton-avatar.d.cts +13 -0
- package/types/skeleton/skeleton-avatar.d.ts +13 -0
- package/types/skeleton/skeleton-button.d.cts +14 -0
- package/types/skeleton/skeleton-button.d.ts +14 -0
- package/types/skeleton/skeleton-image.d.cts +11 -0
- package/types/skeleton/skeleton-image.d.ts +11 -0
- package/types/skeleton/skeleton-text.d.cts +12 -0
- package/types/skeleton/skeleton-text.d.ts +12 -0
- package/types/skeleton/skeleton.d.cts +19 -0
- package/types/skeleton/skeleton.d.ts +19 -0
- package/types/skeleton/use-skeleton-loading.d.cts +1 -0
- package/types/skeleton/use-skeleton-loading.d.ts +1 -0
- package/types/slider/index.d.cts +21 -0
- package/types/slider/index.d.ts +21 -0
- package/types/slider/thumb.d.cts +17 -0
- package/types/slider/thumb.d.ts +17 -0
- package/types/space/index.d.cts +15 -0
- package/types/space/index.d.ts +15 -0
- package/types/spin/index.d.cts +11 -0
- package/types/spin/index.d.ts +11 -0
- package/types/splitter/index.d.cts +4 -0
- package/types/splitter/index.d.ts +4 -0
- package/types/splitter/splitter-panel.d.cts +7 -0
- package/types/splitter/splitter-panel.d.ts +7 -0
- package/types/splitter/splitter.d.cts +9 -0
- package/types/splitter/splitter.d.ts +9 -0
- package/types/stat-card/countup.d.cts +11 -0
- package/types/stat-card/countup.d.ts +11 -0
- package/types/stat-card/index.d.cts +5 -0
- package/types/stat-card/index.d.ts +5 -0
- package/types/stat-card/rollup.d.cts +7 -0
- package/types/stat-card/rollup.d.ts +7 -0
- package/types/stat-card/stat-card.d.cts +31 -0
- package/types/stat-card/stat-card.d.ts +31 -0
- package/types/stat-card/stat-number.d.cts +13 -0
- package/types/stat-card/stat-number.d.ts +13 -0
- package/types/stat-card/utils/countup.d.cts +128 -0
- package/types/stat-card/utils/countup.d.ts +128 -0
- package/types/stat-card/utils/odometer.d.cts +14 -0
- package/types/stat-card/utils/odometer.d.ts +14 -0
- package/types/steps/index.d.cts +20 -0
- package/types/steps/index.d.ts +20 -0
- package/types/switch/index.d.cts +21 -0
- package/types/switch/index.d.ts +21 -0
- package/types/table/column-setting.d.cts +28 -0
- package/types/table/column-setting.d.ts +28 -0
- package/types/table/index.d.cts +5 -0
- package/types/table/index.d.ts +5 -0
- package/types/table/types.d.cts +66 -0
- package/types/table/types.d.ts +66 -0
- package/types/table/utils.d.cts +14 -0
- package/types/table/utils.d.ts +14 -0
- package/types/tabs/index.d.cts +5 -0
- package/types/tabs/index.d.ts +5 -0
- package/types/tabs/tab-panel.d.cts +17 -0
- package/types/tabs/tab-panel.d.ts +17 -0
- package/types/tabs/tabs.d.cts +16 -0
- package/types/tabs/tabs.d.ts +16 -0
- package/types/tabs/types.d.cts +16 -0
- package/types/tabs/types.d.ts +16 -0
- package/types/tag/index.d.cts +16 -0
- package/types/tag/index.d.ts +16 -0
- package/types/time-line/index.d.cts +5 -0
- package/types/time-line/index.d.ts +5 -0
- package/types/time-line/timeline-item.d.cts +10 -0
- package/types/time-line/timeline-item.d.ts +10 -0
- package/types/time-line/timeline.d.cts +6 -0
- package/types/time-line/timeline.d.ts +6 -0
- package/types/tooltip/index.d.cts +23 -0
- package/types/tooltip/index.d.ts +23 -0
- package/types/tour/index.d.cts +22 -0
- package/types/tour/index.d.ts +22 -0
- package/types/transfer/index.d.cts +33 -0
- package/types/transfer/index.d.ts +33 -0
- package/types/tree/index.d.cts +51 -0
- package/types/tree/index.d.ts +51 -0
- package/types/tree/types.d.cts +27 -0
- package/types/tree/types.d.ts +27 -0
- package/types/tree/utils.d.cts +33 -0
- package/types/tree/utils.d.ts +33 -0
- package/types/tree-select/index.d.cts +60 -0
- package/types/tree-select/index.d.ts +60 -0
- package/types/typography/index.d.cts +40 -0
- package/types/typography/index.d.ts +40 -0
- package/types/upload/file-list.d.cts +19 -0
- package/types/upload/file-list.d.ts +19 -0
- package/types/upload/index.d.cts +90 -0
- package/types/upload/index.d.ts +90 -0
- package/types/upload/picture-sort.d.cts +2 -0
- package/types/upload/picture-sort.d.ts +2 -0
- package/types/upload/selector.d.cts +21 -0
- package/types/upload/selector.d.ts +21 -0
- package/types/utils/checked.d.cts +2 -0
- package/types/utils/checked.d.ts +2 -0
- package/types/utils/color.d.cts +1 -0
- package/types/utils/color.d.ts +1 -0
- package/types/utils/element.d.cts +2 -0
- package/types/utils/element.d.ts +2 -0
- package/types/utils/mouse.d.cts +1 -0
- package/types/utils/mouse.d.ts +1 -0
- package/types/utils/number.d.cts +6 -0
- package/types/utils/number.d.ts +6 -0
- package/types/utils/placement.d.cts +16 -0
- package/types/utils/placement.d.ts +16 -0
- package/types/utils/react-node.d.cts +5 -0
- package/types/utils/react-node.d.ts +5 -0
- package/types/utils/share.d.cts +12 -0
- package/types/utils/share.d.ts +12 -0
- package/types/utils/theme.d.cts +5 -0
- package/types/utils/theme.d.ts +5 -0
- package/types/utils/transition.d.cts +3 -0
- package/types/utils/transition.d.ts +3 -0
- package/types/utils/use-value.d.cts +2 -0
- package/types/utils/use-value.d.ts +2 -0
- package/types/virtual-list/index.d.cts +17 -0
- package/types/virtual-list/index.d.ts +17 -0
- package/types/virtual-list/range.d.cts +15 -0
- package/types/virtual-list/range.d.ts +15 -0
- package/types/watermark/index.d.cts +27 -0
- package/types/watermark/index.d.ts +27 -0
- package/dist/k-ui.css +0 -7
- package/dist/k-ui.js +0 -13
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* react-kui v3.0.0
|
|
3
|
+
* Copyright 2017-present, kui-react.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Homepage: https://react.k-ui.cn
|
|
6
|
+
* Author: Qiu / https://chuchur.com
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import zh_CN_default from "../locale/zh-CN.js";
|
|
10
|
+
import { ConfigContext } from "../config/config-context.js";
|
|
11
|
+
import { X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
12
|
+
import { toggleContainerScroll } from "../utils/react-node.js";
|
|
13
|
+
import Button from "../button/button.js";
|
|
14
|
+
import Teleport from "../base/teleport.js";
|
|
15
|
+
import { Transition } from "../base/transition.js";
|
|
16
|
+
import { c } from "react/compiler-runtime";
|
|
17
|
+
import clsx from "clsx";
|
|
18
|
+
import { useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
19
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
//#region components/drawer/index.tsx
|
|
21
|
+
var getBody = () => document.body;
|
|
22
|
+
var ensurePositioningContext = (element) => {
|
|
23
|
+
if (element === document.body) return;
|
|
24
|
+
const computedPosition = getComputedStyle(element).position;
|
|
25
|
+
if (computedPosition && computedPosition !== "static") return;
|
|
26
|
+
const position = element.style.position;
|
|
27
|
+
element.style.position = "relative";
|
|
28
|
+
return () => {
|
|
29
|
+
if (element.style.position === "relative") element.style.position = position;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
var Drawer = (t0) => {
|
|
33
|
+
const $ = c(93);
|
|
34
|
+
const { open, defaultOpen: t1, title: t2, width: t3, height: t4, okText, cancelText, placement: t5, closable: t6, footer: t7, maskClosable: t8, target: t9, mask: t10, loading: t11, escKey: t12, onOk, onCancel, onClose, onOpenChange, children } = t0;
|
|
35
|
+
const defaultOpen = t1 === void 0 ? false : t1;
|
|
36
|
+
const title = t2 === void 0 ? "Title" : t2;
|
|
37
|
+
const width = t3 === void 0 ? 520 : t3;
|
|
38
|
+
const height = t4 === void 0 ? 520 : t4;
|
|
39
|
+
const placement = t5 === void 0 ? "right" : t5;
|
|
40
|
+
const closable = t6 === void 0 ? true : t6;
|
|
41
|
+
const footer = t7 === void 0 ? true : t7;
|
|
42
|
+
const maskClosable = t8 === void 0 ? true : t8;
|
|
43
|
+
const target = t9 === void 0 ? getBody : t9;
|
|
44
|
+
const mask = t10 === void 0 ? true : t10;
|
|
45
|
+
const loading = t11 === void 0 ? false : t11;
|
|
46
|
+
const escKey = t12 === void 0 ? true : t12;
|
|
47
|
+
const locale = useContext(ConfigContext)?.locale || zh_CN_default;
|
|
48
|
+
const [innerOpen, setInnerOpen] = useState(defaultOpen);
|
|
49
|
+
const currentOpen = open ?? innerOpen;
|
|
50
|
+
const [visible, setVisible] = useState(false);
|
|
51
|
+
const [rendered, setRendered] = useState(false);
|
|
52
|
+
const [targetEl, setTargetEl] = useState(null);
|
|
53
|
+
const wrapRef = useRef(null);
|
|
54
|
+
const previousFocus = useRef(null);
|
|
55
|
+
let t13;
|
|
56
|
+
if ($[0] !== visible) {
|
|
57
|
+
t13 = (node) => {
|
|
58
|
+
wrapRef.current = node;
|
|
59
|
+
if (node && visible) node.focus();
|
|
60
|
+
};
|
|
61
|
+
$[0] = visible;
|
|
62
|
+
$[1] = t13;
|
|
63
|
+
} else t13 = $[1];
|
|
64
|
+
const setWrapRef = t13;
|
|
65
|
+
let t14;
|
|
66
|
+
if ($[2] !== target) {
|
|
67
|
+
t14 = () => {
|
|
68
|
+
const candidate = typeof target === "function" ? target() : target;
|
|
69
|
+
if (candidate && "current" in candidate) return candidate.current;
|
|
70
|
+
return candidate ?? null;
|
|
71
|
+
};
|
|
72
|
+
$[2] = target;
|
|
73
|
+
$[3] = t14;
|
|
74
|
+
} else t14 = $[3];
|
|
75
|
+
const resolveTarget = t14;
|
|
76
|
+
const isBody = targetEl === document.body;
|
|
77
|
+
let t15;
|
|
78
|
+
if ($[4] !== resolveTarget) {
|
|
79
|
+
t15 = () => {
|
|
80
|
+
const frame = requestAnimationFrame(() => {
|
|
81
|
+
const nextTarget = resolveTarget();
|
|
82
|
+
setTargetEl((current) => current === nextTarget ? current : nextTarget);
|
|
83
|
+
});
|
|
84
|
+
return () => cancelAnimationFrame(frame);
|
|
85
|
+
};
|
|
86
|
+
$[4] = resolveTarget;
|
|
87
|
+
$[5] = t15;
|
|
88
|
+
} else t15 = $[5];
|
|
89
|
+
let t16;
|
|
90
|
+
if ($[6] !== currentOpen || $[7] !== resolveTarget) {
|
|
91
|
+
t16 = [currentOpen, resolveTarget];
|
|
92
|
+
$[6] = currentOpen;
|
|
93
|
+
$[7] = resolveTarget;
|
|
94
|
+
$[8] = t16;
|
|
95
|
+
} else t16 = $[8];
|
|
96
|
+
useLayoutEffect(t15, t16);
|
|
97
|
+
let t17;
|
|
98
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
99
|
+
t17 = (value) => {
|
|
100
|
+
if (value) {
|
|
101
|
+
previousFocus.current = document.activeElement;
|
|
102
|
+
setRendered(true);
|
|
103
|
+
setTimeout(() => {
|
|
104
|
+
setVisible(true);
|
|
105
|
+
wrapRef.current?.focus();
|
|
106
|
+
}, 0);
|
|
107
|
+
} else {
|
|
108
|
+
setVisible(false);
|
|
109
|
+
previousFocus.current?.focus();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
$[9] = t17;
|
|
113
|
+
} else t17 = $[9];
|
|
114
|
+
const toggle = t17;
|
|
115
|
+
let t18;
|
|
116
|
+
if ($[10] !== onOpenChange || $[11] !== open) {
|
|
117
|
+
t18 = (next) => {
|
|
118
|
+
if (open === void 0) setInnerOpen(next);
|
|
119
|
+
onOpenChange?.(next);
|
|
120
|
+
};
|
|
121
|
+
$[10] = onOpenChange;
|
|
122
|
+
$[11] = open;
|
|
123
|
+
$[12] = t18;
|
|
124
|
+
} else t18 = $[12];
|
|
125
|
+
const requestOpen = t18;
|
|
126
|
+
let t19;
|
|
127
|
+
if ($[13] !== onClose || $[14] !== requestOpen) {
|
|
128
|
+
t19 = () => {
|
|
129
|
+
requestOpen(false);
|
|
130
|
+
onClose?.();
|
|
131
|
+
};
|
|
132
|
+
$[13] = onClose;
|
|
133
|
+
$[14] = requestOpen;
|
|
134
|
+
$[15] = t19;
|
|
135
|
+
} else t19 = $[15];
|
|
136
|
+
const close = t19;
|
|
137
|
+
let t20;
|
|
138
|
+
if ($[16] !== close) {
|
|
139
|
+
t20 = (e) => {
|
|
140
|
+
if (e.key === "Escape") close();
|
|
141
|
+
};
|
|
142
|
+
$[16] = close;
|
|
143
|
+
$[17] = t20;
|
|
144
|
+
} else t20 = $[17];
|
|
145
|
+
const escToClose = t20;
|
|
146
|
+
let t21;
|
|
147
|
+
let t22;
|
|
148
|
+
if ($[18] !== currentOpen || $[19] !== targetEl) {
|
|
149
|
+
t21 = () => {
|
|
150
|
+
if (currentOpen && !targetEl) return;
|
|
151
|
+
const timer = setTimeout(() => toggle(currentOpen), 0);
|
|
152
|
+
return () => clearTimeout(timer);
|
|
153
|
+
};
|
|
154
|
+
t22 = [
|
|
155
|
+
currentOpen,
|
|
156
|
+
targetEl,
|
|
157
|
+
toggle
|
|
158
|
+
];
|
|
159
|
+
$[18] = currentOpen;
|
|
160
|
+
$[19] = targetEl;
|
|
161
|
+
$[20] = t21;
|
|
162
|
+
$[21] = t22;
|
|
163
|
+
} else {
|
|
164
|
+
t21 = $[20];
|
|
165
|
+
t22 = $[21];
|
|
166
|
+
}
|
|
167
|
+
useEffect(t21, t22);
|
|
168
|
+
let t23;
|
|
169
|
+
let t24;
|
|
170
|
+
if ($[22] !== escKey || $[23] !== escToClose) {
|
|
171
|
+
t23 = () => {
|
|
172
|
+
if (escKey) document.addEventListener("keydown", escToClose);
|
|
173
|
+
return () => {
|
|
174
|
+
if (escKey) document.removeEventListener("keydown", escToClose);
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
t24 = [escKey, escToClose];
|
|
178
|
+
$[22] = escKey;
|
|
179
|
+
$[23] = escToClose;
|
|
180
|
+
$[24] = t23;
|
|
181
|
+
$[25] = t24;
|
|
182
|
+
} else {
|
|
183
|
+
t23 = $[24];
|
|
184
|
+
t24 = $[25];
|
|
185
|
+
}
|
|
186
|
+
useEffect(t23, t24);
|
|
187
|
+
let t25;
|
|
188
|
+
let t26;
|
|
189
|
+
if ($[26] !== currentOpen || $[27] !== targetEl) {
|
|
190
|
+
t25 = () => {
|
|
191
|
+
if (!targetEl) return;
|
|
192
|
+
toggleContainerScroll(targetEl, currentOpen);
|
|
193
|
+
return () => toggleContainerScroll(targetEl, false);
|
|
194
|
+
};
|
|
195
|
+
t26 = [currentOpen, targetEl];
|
|
196
|
+
$[26] = currentOpen;
|
|
197
|
+
$[27] = targetEl;
|
|
198
|
+
$[28] = t25;
|
|
199
|
+
$[29] = t26;
|
|
200
|
+
} else {
|
|
201
|
+
t25 = $[28];
|
|
202
|
+
t26 = $[29];
|
|
203
|
+
}
|
|
204
|
+
useEffect(t25, t26);
|
|
205
|
+
let t27;
|
|
206
|
+
let t28;
|
|
207
|
+
if ($[30] !== rendered || $[31] !== targetEl) {
|
|
208
|
+
t27 = () => {
|
|
209
|
+
if (rendered && targetEl) return ensurePositioningContext(targetEl);
|
|
210
|
+
};
|
|
211
|
+
t28 = [rendered, targetEl];
|
|
212
|
+
$[30] = rendered;
|
|
213
|
+
$[31] = targetEl;
|
|
214
|
+
$[32] = t27;
|
|
215
|
+
$[33] = t28;
|
|
216
|
+
} else {
|
|
217
|
+
t27 = $[32];
|
|
218
|
+
t28 = $[33];
|
|
219
|
+
}
|
|
220
|
+
useLayoutEffect(t27, t28);
|
|
221
|
+
let t29;
|
|
222
|
+
if ($[34] !== onCancel || $[35] !== requestOpen) {
|
|
223
|
+
t29 = () => {
|
|
224
|
+
onCancel?.();
|
|
225
|
+
requestOpen(false);
|
|
226
|
+
};
|
|
227
|
+
$[34] = onCancel;
|
|
228
|
+
$[35] = requestOpen;
|
|
229
|
+
$[36] = t29;
|
|
230
|
+
} else t29 = $[36];
|
|
231
|
+
const cancel = t29;
|
|
232
|
+
let t30;
|
|
233
|
+
if ($[37] !== onOk) {
|
|
234
|
+
t30 = () => onOk?.();
|
|
235
|
+
$[37] = onOk;
|
|
236
|
+
$[38] = t30;
|
|
237
|
+
} else t30 = $[38];
|
|
238
|
+
const ok = t30;
|
|
239
|
+
const okLabel = okText || locale?.k?.common?.ok;
|
|
240
|
+
const cancelLabel = cancelText || locale?.k?.common?.cancel;
|
|
241
|
+
const hasFooter = footer !== false && footer != null;
|
|
242
|
+
let t31;
|
|
243
|
+
if ($[39] !== cancel || $[40] !== cancelLabel || $[41] !== footer || $[42] !== hasFooter || $[43] !== loading || $[44] !== ok || $[45] !== okLabel) {
|
|
244
|
+
t31 = hasFooter ? /* @__PURE__ */ jsx("div", {
|
|
245
|
+
className: "k-drawer-footer",
|
|
246
|
+
children: footer === true ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
247
|
+
onClick: cancel,
|
|
248
|
+
children: cancelLabel
|
|
249
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
250
|
+
type: "primary",
|
|
251
|
+
onClick: ok,
|
|
252
|
+
loading,
|
|
253
|
+
children: okLabel
|
|
254
|
+
})] }) : footer
|
|
255
|
+
}) : null;
|
|
256
|
+
$[39] = cancel;
|
|
257
|
+
$[40] = cancelLabel;
|
|
258
|
+
$[41] = footer;
|
|
259
|
+
$[42] = hasFooter;
|
|
260
|
+
$[43] = loading;
|
|
261
|
+
$[44] = ok;
|
|
262
|
+
$[45] = okLabel;
|
|
263
|
+
$[46] = t31;
|
|
264
|
+
} else t31 = $[46];
|
|
265
|
+
const footerNode = t31;
|
|
266
|
+
let t32;
|
|
267
|
+
if ($[47] !== closable || $[48] !== close) {
|
|
268
|
+
t32 = closable ? /* @__PURE__ */ jsx(Button, {
|
|
269
|
+
className: "k-drawer-close",
|
|
270
|
+
size: "small",
|
|
271
|
+
type: "text",
|
|
272
|
+
onClick: close,
|
|
273
|
+
icon: X
|
|
274
|
+
}) : null;
|
|
275
|
+
$[47] = closable;
|
|
276
|
+
$[48] = close;
|
|
277
|
+
$[49] = t32;
|
|
278
|
+
} else t32 = $[49];
|
|
279
|
+
const closeNode = t32;
|
|
280
|
+
let drawerStyle;
|
|
281
|
+
if ($[50] !== height || $[51] !== placement || $[52] !== width) {
|
|
282
|
+
drawerStyle = {};
|
|
283
|
+
if (placement === "left" || placement === "right") drawerStyle.width = typeof width === "number" ? `${width}px` : width;
|
|
284
|
+
if (placement === "top" || placement === "bottom") drawerStyle.height = typeof height === "number" ? `${height}px` : height;
|
|
285
|
+
$[50] = height;
|
|
286
|
+
$[51] = placement;
|
|
287
|
+
$[52] = width;
|
|
288
|
+
$[53] = drawerStyle;
|
|
289
|
+
} else drawerStyle = $[53];
|
|
290
|
+
const t33 = `k-drawer-${placement}`;
|
|
291
|
+
const t34 = !mask;
|
|
292
|
+
let t35;
|
|
293
|
+
if ($[54] !== hasFooter || $[55] !== isBody || $[56] !== t33 || $[57] !== t34) {
|
|
294
|
+
t35 = clsx("k-drawer", t33, {
|
|
295
|
+
"k-drawer-has-footer": hasFooter,
|
|
296
|
+
"k-drawer-to-body": isBody,
|
|
297
|
+
"k-drawer-no-mask": t34
|
|
298
|
+
});
|
|
299
|
+
$[54] = hasFooter;
|
|
300
|
+
$[55] = isBody;
|
|
301
|
+
$[56] = t33;
|
|
302
|
+
$[57] = t34;
|
|
303
|
+
$[58] = t35;
|
|
304
|
+
} else t35 = $[58];
|
|
305
|
+
const classes = t35;
|
|
306
|
+
if (!rendered || !targetEl) return null;
|
|
307
|
+
let t36;
|
|
308
|
+
if ($[59] !== close || $[60] !== isBody || $[61] !== mask || $[62] !== maskClosable || $[63] !== visible) {
|
|
309
|
+
t36 = mask && /* @__PURE__ */ jsx(Transition, {
|
|
310
|
+
name: "k-drawer-fade",
|
|
311
|
+
show: visible,
|
|
312
|
+
timeout: 400,
|
|
313
|
+
appear: true,
|
|
314
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
315
|
+
className: clsx("k-drawer-mask", { "k-drawer-mask-to-body": isBody }),
|
|
316
|
+
onClick: maskClosable ? close : void 0
|
|
317
|
+
})
|
|
318
|
+
});
|
|
319
|
+
$[59] = close;
|
|
320
|
+
$[60] = isBody;
|
|
321
|
+
$[61] = mask;
|
|
322
|
+
$[62] = maskClosable;
|
|
323
|
+
$[63] = visible;
|
|
324
|
+
$[64] = t36;
|
|
325
|
+
} else t36 = $[64];
|
|
326
|
+
const t37 = `k-drawer-${placement}`;
|
|
327
|
+
let t38;
|
|
328
|
+
if ($[65] !== title) {
|
|
329
|
+
t38 = /* @__PURE__ */ jsx("div", {
|
|
330
|
+
className: "k-drawer-header-inner",
|
|
331
|
+
children: title
|
|
332
|
+
});
|
|
333
|
+
$[65] = title;
|
|
334
|
+
$[66] = t38;
|
|
335
|
+
} else t38 = $[66];
|
|
336
|
+
let t39;
|
|
337
|
+
if ($[67] !== closeNode || $[68] !== t38) {
|
|
338
|
+
t39 = /* @__PURE__ */ jsxs("div", {
|
|
339
|
+
className: "k-drawer-header",
|
|
340
|
+
children: [closeNode, t38]
|
|
341
|
+
});
|
|
342
|
+
$[67] = closeNode;
|
|
343
|
+
$[68] = t38;
|
|
344
|
+
$[69] = t39;
|
|
345
|
+
} else t39 = $[69];
|
|
346
|
+
let t40;
|
|
347
|
+
if ($[70] !== children) {
|
|
348
|
+
t40 = /* @__PURE__ */ jsx("div", {
|
|
349
|
+
className: "k-drawer-body",
|
|
350
|
+
children
|
|
351
|
+
});
|
|
352
|
+
$[70] = children;
|
|
353
|
+
$[71] = t40;
|
|
354
|
+
} else t40 = $[71];
|
|
355
|
+
let t41;
|
|
356
|
+
if ($[72] !== footerNode || $[73] !== t39 || $[74] !== t40) {
|
|
357
|
+
t41 = /* @__PURE__ */ jsxs("div", {
|
|
358
|
+
className: "k-drawer-content",
|
|
359
|
+
children: [
|
|
360
|
+
t39,
|
|
361
|
+
t40,
|
|
362
|
+
footerNode
|
|
363
|
+
]
|
|
364
|
+
});
|
|
365
|
+
$[72] = footerNode;
|
|
366
|
+
$[73] = t39;
|
|
367
|
+
$[74] = t40;
|
|
368
|
+
$[75] = t41;
|
|
369
|
+
} else t41 = $[75];
|
|
370
|
+
let t42;
|
|
371
|
+
if ($[76] !== drawerStyle || $[77] !== t41) {
|
|
372
|
+
t42 = /* @__PURE__ */ jsx("div", {
|
|
373
|
+
className: "k-drawer-box",
|
|
374
|
+
style: drawerStyle,
|
|
375
|
+
children: t41
|
|
376
|
+
});
|
|
377
|
+
$[76] = drawerStyle;
|
|
378
|
+
$[77] = t41;
|
|
379
|
+
$[78] = t42;
|
|
380
|
+
} else t42 = $[78];
|
|
381
|
+
let t43;
|
|
382
|
+
if ($[79] !== t37 || $[80] !== t42 || $[81] !== visible) {
|
|
383
|
+
t43 = /* @__PURE__ */ jsx(Transition, {
|
|
384
|
+
show: visible,
|
|
385
|
+
name: t37,
|
|
386
|
+
timeout: 200,
|
|
387
|
+
appear: true,
|
|
388
|
+
children: t42
|
|
389
|
+
});
|
|
390
|
+
$[79] = t37;
|
|
391
|
+
$[80] = t42;
|
|
392
|
+
$[81] = visible;
|
|
393
|
+
$[82] = t43;
|
|
394
|
+
} else t43 = $[82];
|
|
395
|
+
let t44;
|
|
396
|
+
if ($[83] !== setWrapRef || $[84] !== t43) {
|
|
397
|
+
t44 = /* @__PURE__ */ jsx("div", {
|
|
398
|
+
ref: setWrapRef,
|
|
399
|
+
className: "k-drawer-wrap",
|
|
400
|
+
tabIndex: -1,
|
|
401
|
+
children: t43
|
|
402
|
+
});
|
|
403
|
+
$[83] = setWrapRef;
|
|
404
|
+
$[84] = t43;
|
|
405
|
+
$[85] = t44;
|
|
406
|
+
} else t44 = $[85];
|
|
407
|
+
let t45;
|
|
408
|
+
if ($[86] !== classes || $[87] !== t36 || $[88] !== t44) {
|
|
409
|
+
t45 = /* @__PURE__ */ jsxs("div", {
|
|
410
|
+
className: classes,
|
|
411
|
+
children: [t36, t44]
|
|
412
|
+
});
|
|
413
|
+
$[86] = classes;
|
|
414
|
+
$[87] = t36;
|
|
415
|
+
$[88] = t44;
|
|
416
|
+
$[89] = t45;
|
|
417
|
+
} else t45 = $[89];
|
|
418
|
+
const drawerEl = t45;
|
|
419
|
+
let t46;
|
|
420
|
+
if ($[90] !== drawerEl || $[91] !== targetEl) {
|
|
421
|
+
t46 = /* @__PURE__ */ jsx(Teleport, {
|
|
422
|
+
to: targetEl,
|
|
423
|
+
children: drawerEl
|
|
424
|
+
});
|
|
425
|
+
$[90] = drawerEl;
|
|
426
|
+
$[91] = targetEl;
|
|
427
|
+
$[92] = t46;
|
|
428
|
+
} else t46 = $[92];
|
|
429
|
+
return t46;
|
|
430
|
+
};
|
|
431
|
+
//#endregion
|
|
432
|
+
export { Drawer as default };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* react-kui v3.0.0
|
|
3
|
+
* Copyright 2017-present, kui-react.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Homepage: https://react.k-ui.cn
|
|
6
|
+
* Author: Qiu / https://chuchur.com
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
|
+
import { Ellipsis } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
11
|
+
import Button from "../button/button.js";
|
|
12
|
+
import ButtonGroup from "../button/button-group.js";
|
|
13
|
+
import Dropdown from "./dropdown.js";
|
|
14
|
+
import TriggerButton from "./trigger.js";
|
|
15
|
+
import { c } from "react/compiler-runtime";
|
|
16
|
+
import { useRef } from "react";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
//#region components/dropdown/dropdown-button.tsx
|
|
19
|
+
var DropdownButton = (t0) => {
|
|
20
|
+
const $ = c(35);
|
|
21
|
+
let children;
|
|
22
|
+
let icon;
|
|
23
|
+
let onClick;
|
|
24
|
+
let overlay;
|
|
25
|
+
let rest;
|
|
26
|
+
let shapeProp;
|
|
27
|
+
let sizeProp;
|
|
28
|
+
let t1;
|
|
29
|
+
let t2;
|
|
30
|
+
let t3;
|
|
31
|
+
let t4;
|
|
32
|
+
let themeProp;
|
|
33
|
+
if ($[0] !== t0) {
|
|
34
|
+
({size: sizeProp, shape: shapeProp, disabled: t1, icon, theme: themeProp, arrow: t2, placement: t3, onClick, overlay, children, className: t4, ...rest} = t0);
|
|
35
|
+
$[0] = t0;
|
|
36
|
+
$[1] = children;
|
|
37
|
+
$[2] = icon;
|
|
38
|
+
$[3] = onClick;
|
|
39
|
+
$[4] = overlay;
|
|
40
|
+
$[5] = rest;
|
|
41
|
+
$[6] = shapeProp;
|
|
42
|
+
$[7] = sizeProp;
|
|
43
|
+
$[8] = t1;
|
|
44
|
+
$[9] = t2;
|
|
45
|
+
$[10] = t3;
|
|
46
|
+
$[11] = t4;
|
|
47
|
+
$[12] = themeProp;
|
|
48
|
+
} else {
|
|
49
|
+
children = $[1];
|
|
50
|
+
icon = $[2];
|
|
51
|
+
onClick = $[3];
|
|
52
|
+
overlay = $[4];
|
|
53
|
+
rest = $[5];
|
|
54
|
+
shapeProp = $[6];
|
|
55
|
+
sizeProp = $[7];
|
|
56
|
+
t1 = $[8];
|
|
57
|
+
t2 = $[9];
|
|
58
|
+
t3 = $[10];
|
|
59
|
+
t4 = $[11];
|
|
60
|
+
themeProp = $[12];
|
|
61
|
+
}
|
|
62
|
+
const disabled = t1 === void 0 ? false : t1;
|
|
63
|
+
const arrow = t2 === void 0 ? false : t2;
|
|
64
|
+
const placement = t3 === void 0 ? "bottom-right" : t3;
|
|
65
|
+
const className = t4 === void 0 ? "" : t4;
|
|
66
|
+
const inheritedAppearance = useConfigAppearance();
|
|
67
|
+
const size = sizeProp ?? inheritedAppearance.size;
|
|
68
|
+
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
69
|
+
const theme = themeProp ?? inheritedAppearance.theme;
|
|
70
|
+
const refTrigger = useRef(null);
|
|
71
|
+
let t5;
|
|
72
|
+
if ($[13] !== children || $[14] !== disabled || $[15] !== onClick || $[16] !== theme) {
|
|
73
|
+
t5 = /* @__PURE__ */ jsx(Button, {
|
|
74
|
+
disabled,
|
|
75
|
+
theme,
|
|
76
|
+
onClick,
|
|
77
|
+
children
|
|
78
|
+
});
|
|
79
|
+
$[13] = children;
|
|
80
|
+
$[14] = disabled;
|
|
81
|
+
$[15] = onClick;
|
|
82
|
+
$[16] = theme;
|
|
83
|
+
$[17] = t5;
|
|
84
|
+
} else t5 = $[17];
|
|
85
|
+
const t6 = !icon ? Ellipsis : icon;
|
|
86
|
+
let t7;
|
|
87
|
+
if ($[18] !== disabled || $[19] !== t6 || $[20] !== theme) {
|
|
88
|
+
t7 = /* @__PURE__ */ jsx(TriggerButton, {
|
|
89
|
+
disabled,
|
|
90
|
+
theme,
|
|
91
|
+
ref: refTrigger,
|
|
92
|
+
icon: t6,
|
|
93
|
+
className: "k-dropdown-trigger"
|
|
94
|
+
});
|
|
95
|
+
$[18] = disabled;
|
|
96
|
+
$[19] = t6;
|
|
97
|
+
$[20] = theme;
|
|
98
|
+
$[21] = t7;
|
|
99
|
+
} else t7 = $[21];
|
|
100
|
+
let t8;
|
|
101
|
+
if ($[22] !== shape || $[23] !== size || $[24] !== t5 || $[25] !== t7) {
|
|
102
|
+
t8 = /* @__PURE__ */ jsxs(ButtonGroup, {
|
|
103
|
+
className: "k-dropdown-button",
|
|
104
|
+
size,
|
|
105
|
+
shape,
|
|
106
|
+
children: [t5, t7]
|
|
107
|
+
});
|
|
108
|
+
$[22] = shape;
|
|
109
|
+
$[23] = size;
|
|
110
|
+
$[24] = t5;
|
|
111
|
+
$[25] = t7;
|
|
112
|
+
$[26] = t8;
|
|
113
|
+
} else t8 = $[26];
|
|
114
|
+
const triggerNode = t8;
|
|
115
|
+
let t9;
|
|
116
|
+
if ($[27] !== arrow || $[28] !== className || $[29] !== disabled || $[30] !== overlay || $[31] !== placement || $[32] !== rest || $[33] !== triggerNode) {
|
|
117
|
+
t9 = /* @__PURE__ */ jsx(Dropdown, {
|
|
118
|
+
arrow,
|
|
119
|
+
placement,
|
|
120
|
+
target: refTrigger,
|
|
121
|
+
disabled,
|
|
122
|
+
overlay,
|
|
123
|
+
className,
|
|
124
|
+
...rest,
|
|
125
|
+
children: triggerNode
|
|
126
|
+
});
|
|
127
|
+
$[27] = arrow;
|
|
128
|
+
$[28] = className;
|
|
129
|
+
$[29] = disabled;
|
|
130
|
+
$[30] = overlay;
|
|
131
|
+
$[31] = placement;
|
|
132
|
+
$[32] = rest;
|
|
133
|
+
$[33] = triggerNode;
|
|
134
|
+
$[34] = t9;
|
|
135
|
+
} else t9 = $[34];
|
|
136
|
+
return t9;
|
|
137
|
+
};
|
|
138
|
+
//#endregion
|
|
139
|
+
export { DropdownButton as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* react-kui v3.0.0
|
|
3
|
+
* Copyright 2017-present, kui-react.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Homepage: https://react.k-ui.cn
|
|
6
|
+
* Author: Qiu / https://chuchur.com
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { createContext, useContext } from "react";
|
|
10
|
+
//#region components/dropdown/dropdown-context.ts
|
|
11
|
+
var DropdownContext = createContext(null);
|
|
12
|
+
var useDropdownContext = () => {
|
|
13
|
+
return useContext(DropdownContext);
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DropdownContext, useDropdownContext };
|