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,270 @@
|
|
|
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 { getChildren, setRef } from "../utils/react-node.js";
|
|
10
|
+
import Teleport from "../base/teleport.js";
|
|
11
|
+
import { Transition } from "../base/transition.js";
|
|
12
|
+
import { setPlacement } from "../utils/placement.js";
|
|
13
|
+
import { c } from "react/compiler-runtime";
|
|
14
|
+
import clsx from "clsx";
|
|
15
|
+
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
16
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
//#region components/poptip/index.tsx
|
|
18
|
+
function PoptipPanel(props) {
|
|
19
|
+
const $ = c(2);
|
|
20
|
+
let t0;
|
|
21
|
+
if ($[0] !== props) {
|
|
22
|
+
t0 = /* @__PURE__ */ jsx(Poptip, {
|
|
23
|
+
...props,
|
|
24
|
+
panelOnly: true
|
|
25
|
+
});
|
|
26
|
+
$[0] = props;
|
|
27
|
+
$[1] = t0;
|
|
28
|
+
} else t0 = $[1];
|
|
29
|
+
return t0;
|
|
30
|
+
}
|
|
31
|
+
var Poptip = ({ dark = false, open, defaultOpen = false, show, title, content, width, trigger = "hover", placement = "top", panelOnly = false, onClose, onOpenChange, onShowChange, children }) => {
|
|
32
|
+
const externalOpen = open ?? show;
|
|
33
|
+
const initialOpen = externalOpen ?? defaultOpen;
|
|
34
|
+
const [visible, setVisible] = useState(initialOpen);
|
|
35
|
+
const [rendered, setRendered] = useState(initialOpen);
|
|
36
|
+
const [previousOpen, setPreviousOpen] = useState(externalOpen);
|
|
37
|
+
if (previousOpen !== externalOpen) {
|
|
38
|
+
setPreviousOpen(externalOpen);
|
|
39
|
+
if (externalOpen !== void 0) {
|
|
40
|
+
setVisible(externalOpen);
|
|
41
|
+
if (externalOpen) setRendered(true);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const [left, setLeft] = useState(0);
|
|
45
|
+
const [top, setTop] = useState(0);
|
|
46
|
+
const [currentPlacement, setCurrentPlacement] = useState(placement);
|
|
47
|
+
const [transOrigin, setTransOrigin] = useState("bottom");
|
|
48
|
+
const refPopper = useRef(null);
|
|
49
|
+
const refSelection = useRef(null);
|
|
50
|
+
const placementRef = useRef(placement);
|
|
51
|
+
const transOriginRef = useRef("bottom");
|
|
52
|
+
const topRef = useRef(0);
|
|
53
|
+
const leftRef = useRef(0);
|
|
54
|
+
const hideTimer = useRef(null);
|
|
55
|
+
const showTimer = useRef(null);
|
|
56
|
+
const updatePosition = useCallback(() => {
|
|
57
|
+
if (!refSelection.current || !refPopper.current) return;
|
|
58
|
+
placementRef.current = placement;
|
|
59
|
+
setPlacement({
|
|
60
|
+
refSelection,
|
|
61
|
+
refPopper,
|
|
62
|
+
currentPlacement: placementRef,
|
|
63
|
+
transOrigin: transOriginRef,
|
|
64
|
+
top: topRef,
|
|
65
|
+
left: leftRef
|
|
66
|
+
});
|
|
67
|
+
setCurrentPlacement(placementRef.current);
|
|
68
|
+
setTransOrigin(transOriginRef.current);
|
|
69
|
+
setTop(topRef.current);
|
|
70
|
+
setLeft(leftRef.current);
|
|
71
|
+
}, [placement]);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (panelOnly || !visible) return;
|
|
74
|
+
updatePosition();
|
|
75
|
+
}, [
|
|
76
|
+
panelOnly,
|
|
77
|
+
title,
|
|
78
|
+
updatePosition,
|
|
79
|
+
visible
|
|
80
|
+
]);
|
|
81
|
+
const updateShow = useCallback((value) => {
|
|
82
|
+
if (externalOpen === void 0) setVisible(value);
|
|
83
|
+
onOpenChange?.(value);
|
|
84
|
+
onShowChange?.(value);
|
|
85
|
+
if (!value) onClose?.();
|
|
86
|
+
}, [
|
|
87
|
+
externalOpen,
|
|
88
|
+
onClose,
|
|
89
|
+
onOpenChange,
|
|
90
|
+
onShowChange
|
|
91
|
+
]);
|
|
92
|
+
const outsideClick = useCallback((e) => {
|
|
93
|
+
const ctx = refSelection.current;
|
|
94
|
+
if (refPopper.current && !refPopper.current.contains(e.target) && ctx && !ctx.contains(e.target)) updateShow(false);
|
|
95
|
+
}, [updateShow]);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (panelOnly) return;
|
|
98
|
+
window.addEventListener("resize", updatePosition);
|
|
99
|
+
return () => {
|
|
100
|
+
window.removeEventListener("resize", updatePosition);
|
|
101
|
+
};
|
|
102
|
+
}, [panelOnly, updatePosition]);
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
if (!visible) return;
|
|
105
|
+
document.addEventListener("click", outsideClick);
|
|
106
|
+
return () => document.removeEventListener("click", outsideClick);
|
|
107
|
+
}, [outsideClick, visible]);
|
|
108
|
+
const showPoptip = () => {
|
|
109
|
+
if (showTimer.current) clearTimeout(showTimer.current);
|
|
110
|
+
if (!rendered) {
|
|
111
|
+
setRendered(true);
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
updateShow(true);
|
|
114
|
+
setTimeout(updatePosition, 0);
|
|
115
|
+
}, 0);
|
|
116
|
+
} else {
|
|
117
|
+
updateShow(true);
|
|
118
|
+
setTimeout(updatePosition, 0);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const hidePoptip = () => {
|
|
122
|
+
if (hideTimer.current) clearTimeout(hideTimer.current);
|
|
123
|
+
hideTimer.current = setTimeout(() => {
|
|
124
|
+
updateShow(false);
|
|
125
|
+
}, 300);
|
|
126
|
+
};
|
|
127
|
+
const childList = getChildren(children);
|
|
128
|
+
const firstChild = childList.length === 1 ? childList[0] : null;
|
|
129
|
+
const triggerProps = { onMouseLeave: hidePoptip };
|
|
130
|
+
if (trigger === "click") triggerProps.onClick = showPoptip;
|
|
131
|
+
else if (trigger === "hover") triggerProps.onMouseEnter = showPoptip;
|
|
132
|
+
else if (trigger === "focus") {
|
|
133
|
+
triggerProps.onFocus = showPoptip;
|
|
134
|
+
triggerProps.onBlur = hidePoptip;
|
|
135
|
+
}
|
|
136
|
+
let triggerNode;
|
|
137
|
+
const setSelectionRef = (node) => {
|
|
138
|
+
refSelection.current = node;
|
|
139
|
+
};
|
|
140
|
+
if (firstChild && React.isValidElement(firstChild)) {
|
|
141
|
+
const childProps = firstChild.props;
|
|
142
|
+
const mergedTriggerProps = {
|
|
143
|
+
ref: (node_0) => {
|
|
144
|
+
setRef(childProps.ref, node_0);
|
|
145
|
+
setSelectionRef(node_0);
|
|
146
|
+
},
|
|
147
|
+
onMouseLeave: (event) => {
|
|
148
|
+
childProps.onMouseLeave?.(event);
|
|
149
|
+
hidePoptip();
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
if (trigger === "click") mergedTriggerProps.onClick = (event_0) => {
|
|
153
|
+
childProps.onClick?.(event_0);
|
|
154
|
+
showPoptip();
|
|
155
|
+
};
|
|
156
|
+
else if (trigger === "hover") mergedTriggerProps.onMouseEnter = (event_1) => {
|
|
157
|
+
childProps.onMouseEnter?.(event_1);
|
|
158
|
+
showPoptip();
|
|
159
|
+
};
|
|
160
|
+
else {
|
|
161
|
+
mergedTriggerProps.onFocus = (event_2) => {
|
|
162
|
+
childProps.onFocus?.(event_2);
|
|
163
|
+
showPoptip();
|
|
164
|
+
};
|
|
165
|
+
mergedTriggerProps.onBlur = (event_3) => {
|
|
166
|
+
childProps.onBlur?.(event_3);
|
|
167
|
+
hidePoptip();
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
triggerNode = React.cloneElement(firstChild, { ...mergedTriggerProps });
|
|
171
|
+
} else triggerNode = /* @__PURE__ */ jsx("span", {
|
|
172
|
+
ref: setSelectionRef,
|
|
173
|
+
...triggerProps,
|
|
174
|
+
children
|
|
175
|
+
});
|
|
176
|
+
const preCls = "poptip";
|
|
177
|
+
const overlayNode = rendered ? /* @__PURE__ */ jsx(Transition, {
|
|
178
|
+
show: visible,
|
|
179
|
+
name: `k-${preCls}`,
|
|
180
|
+
nodeRef: refPopper,
|
|
181
|
+
appear: true,
|
|
182
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
183
|
+
ref: refPopper,
|
|
184
|
+
"k-placement": currentPlacement,
|
|
185
|
+
className: clsx(`k-${preCls}`, `k-${preCls}-has-arrow`, { [`k-${preCls}-dark`]: dark }),
|
|
186
|
+
style: {
|
|
187
|
+
left: `${left}px`,
|
|
188
|
+
top: `${top}px`,
|
|
189
|
+
transformOrigin: transOrigin,
|
|
190
|
+
width: width ? typeof width === "number" ? `${width}px` : width : void 0
|
|
191
|
+
},
|
|
192
|
+
onMouseEnter: () => {
|
|
193
|
+
if (hideTimer.current) clearTimeout(hideTimer.current);
|
|
194
|
+
updateShow(true);
|
|
195
|
+
},
|
|
196
|
+
onMouseLeave: () => {
|
|
197
|
+
showTimer.current = setTimeout(() => {
|
|
198
|
+
updateShow(false);
|
|
199
|
+
}, 300);
|
|
200
|
+
},
|
|
201
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
202
|
+
className: `k-${preCls}-content`,
|
|
203
|
+
children: [
|
|
204
|
+
title ? /* @__PURE__ */ jsx("div", {
|
|
205
|
+
className: `k-${preCls}-title`,
|
|
206
|
+
children: title
|
|
207
|
+
}) : null,
|
|
208
|
+
/* @__PURE__ */ jsx("div", {
|
|
209
|
+
className: `k-${preCls}-body`,
|
|
210
|
+
children: content
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ jsx("div", {
|
|
213
|
+
className: `k-${preCls}-arrow`,
|
|
214
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
215
|
+
style: { fill: "currentcolor" },
|
|
216
|
+
viewBox: "0 0 24 8",
|
|
217
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
218
|
+
id: "ot",
|
|
219
|
+
d: "m24,0.97087l0,1c-4,0 -5.5,1 -7.5,3c-2,2 -2.5,3 -4.5,3c-2,0 -2.5,-1 -4.5,-3c-2,-2 -3.5,-3 -7.5,-3l0,-1l24,0z"
|
|
220
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
221
|
+
stroke: "currentcolor",
|
|
222
|
+
id: "in",
|
|
223
|
+
d: "m24,0l0,1c-4,0 -5.5,1 -7.5,3c-2,2 -2.5,3 -4.5,3c-2,0 -2.5,-1 -4.5,-3c-2,-2 -3.5,-3 -7.5,-3l0,-1l24,0z"
|
|
224
|
+
})]
|
|
225
|
+
})
|
|
226
|
+
})
|
|
227
|
+
]
|
|
228
|
+
})
|
|
229
|
+
})
|
|
230
|
+
}) : null;
|
|
231
|
+
if (panelOnly) return /* @__PURE__ */ jsx("div", {
|
|
232
|
+
"k-placement": placement,
|
|
233
|
+
className: clsx(`k-${preCls}`, `k-${preCls}-has-arrow`, `k-${preCls}-panel`, { [`k-${preCls}-dark`]: dark }),
|
|
234
|
+
style: { width: width ? typeof width === "number" ? `${width}px` : width : void 0 },
|
|
235
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
236
|
+
className: `k-${preCls}-content`,
|
|
237
|
+
children: [
|
|
238
|
+
title ? /* @__PURE__ */ jsx("div", {
|
|
239
|
+
className: `k-${preCls}-title`,
|
|
240
|
+
children: title
|
|
241
|
+
}) : null,
|
|
242
|
+
/* @__PURE__ */ jsx("div", {
|
|
243
|
+
className: `k-${preCls}-body`,
|
|
244
|
+
children: content
|
|
245
|
+
}),
|
|
246
|
+
/* @__PURE__ */ jsx("div", {
|
|
247
|
+
className: `k-${preCls}-arrow`,
|
|
248
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
249
|
+
style: { fill: "currentcolor" },
|
|
250
|
+
viewBox: "0 0 24 8",
|
|
251
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
252
|
+
id: "ot",
|
|
253
|
+
d: "m24,0.97087l0,1c-4,0 -5.5,1 -7.5,3c-2,2 -2.5,3 -4.5,3c-2,0 -2.5,-1 -4.5,-3c-2,-2 -3.5,-3 -7.5,-3l0,-1l24,0z"
|
|
254
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
255
|
+
stroke: "currentcolor",
|
|
256
|
+
id: "in",
|
|
257
|
+
d: "m24,0l0,1c-4,0 -5.5,1 -7.5,3c-2,2 -2.5,3 -4.5,3c-2,0 -2.5,-1 -4.5,-3c-2,-2 -3.5,-3 -7.5,-3l0,-1l24,0z"
|
|
258
|
+
})]
|
|
259
|
+
})
|
|
260
|
+
})
|
|
261
|
+
]
|
|
262
|
+
})
|
|
263
|
+
});
|
|
264
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [triggerNode, /* @__PURE__ */ jsx(Teleport, {
|
|
265
|
+
to: "body",
|
|
266
|
+
children: overlayNode
|
|
267
|
+
})] });
|
|
268
|
+
};
|
|
269
|
+
//#endregion
|
|
270
|
+
export { PoptipPanel, Poptip as default };
|
|
@@ -0,0 +1,253 @@
|
|
|
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 { Check, CircleCheck, CircleX, X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
11
|
+
import Icon from "../icon/index.js";
|
|
12
|
+
import { c } from "react/compiler-runtime";
|
|
13
|
+
import clsx from "clsx";
|
|
14
|
+
import "react";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
//#region components/progress/index.tsx
|
|
17
|
+
var Progress = (t0) => {
|
|
18
|
+
const $ = c(54);
|
|
19
|
+
let children;
|
|
20
|
+
let color;
|
|
21
|
+
let format;
|
|
22
|
+
let rest;
|
|
23
|
+
let sizeProp;
|
|
24
|
+
let strokeHeight;
|
|
25
|
+
let style;
|
|
26
|
+
let t1;
|
|
27
|
+
let t2;
|
|
28
|
+
let t3;
|
|
29
|
+
let t4;
|
|
30
|
+
let t5;
|
|
31
|
+
let t6;
|
|
32
|
+
let t7;
|
|
33
|
+
let t8;
|
|
34
|
+
let width;
|
|
35
|
+
if ($[0] !== t0) {
|
|
36
|
+
({percent: t1, strokeWidth: t2, color, format, width, strokeHeight, gapDegree: t3, strokeLinecap: t4, size: sizeProp, status: t5, type: t6, showInfo: t7, children, className: t8, style, ...rest} = t0);
|
|
37
|
+
$[0] = t0;
|
|
38
|
+
$[1] = children;
|
|
39
|
+
$[2] = color;
|
|
40
|
+
$[3] = format;
|
|
41
|
+
$[4] = rest;
|
|
42
|
+
$[5] = sizeProp;
|
|
43
|
+
$[6] = strokeHeight;
|
|
44
|
+
$[7] = style;
|
|
45
|
+
$[8] = t1;
|
|
46
|
+
$[9] = t2;
|
|
47
|
+
$[10] = t3;
|
|
48
|
+
$[11] = t4;
|
|
49
|
+
$[12] = t5;
|
|
50
|
+
$[13] = t6;
|
|
51
|
+
$[14] = t7;
|
|
52
|
+
$[15] = t8;
|
|
53
|
+
$[16] = width;
|
|
54
|
+
} else {
|
|
55
|
+
children = $[1];
|
|
56
|
+
color = $[2];
|
|
57
|
+
format = $[3];
|
|
58
|
+
rest = $[4];
|
|
59
|
+
sizeProp = $[5];
|
|
60
|
+
strokeHeight = $[6];
|
|
61
|
+
style = $[7];
|
|
62
|
+
t1 = $[8];
|
|
63
|
+
t2 = $[9];
|
|
64
|
+
t3 = $[10];
|
|
65
|
+
t4 = $[11];
|
|
66
|
+
t5 = $[12];
|
|
67
|
+
t6 = $[13];
|
|
68
|
+
t7 = $[14];
|
|
69
|
+
t8 = $[15];
|
|
70
|
+
width = $[16];
|
|
71
|
+
}
|
|
72
|
+
const percent = t1 === void 0 ? 0 : t1;
|
|
73
|
+
const strokeWidth = t2 === void 0 ? 6 : t2;
|
|
74
|
+
const gapDegree = t3 === void 0 ? 75 : t3;
|
|
75
|
+
const strokeLinecap = t4 === void 0 ? "round" : t4;
|
|
76
|
+
const status = t5 === void 0 ? "normal" : t5;
|
|
77
|
+
const type = t6 === void 0 ? "line" : t6;
|
|
78
|
+
const showInfo = t7 === void 0 ? true : t7;
|
|
79
|
+
const className = t8 === void 0 ? "" : t8;
|
|
80
|
+
const inheritedAppearance = useConfigAppearance();
|
|
81
|
+
const size = sizeProp ?? inheritedAppearance.size;
|
|
82
|
+
const currentPercent = percent;
|
|
83
|
+
let t9;
|
|
84
|
+
if ($[17] !== children || $[18] !== currentPercent || $[19] !== format || $[20] !== showInfo) {
|
|
85
|
+
t9 = (currentStatus, currentType) => {
|
|
86
|
+
if (!showInfo) return null;
|
|
87
|
+
let text = `${currentPercent}%`;
|
|
88
|
+
if (format) text = format(currentPercent);
|
|
89
|
+
else if (currentType === "line") {
|
|
90
|
+
if (currentPercent === 100) text = /* @__PURE__ */ jsx(Icon, { type: CircleCheck });
|
|
91
|
+
if (currentStatus === "exception") text = /* @__PURE__ */ jsx(Icon, { type: CircleX });
|
|
92
|
+
} else if (currentType === "circle" || currentType === "dashboard") {
|
|
93
|
+
if (children) text = children;
|
|
94
|
+
else {
|
|
95
|
+
if (currentPercent === 100) text = /* @__PURE__ */ jsx(Icon, { type: Check });
|
|
96
|
+
if (currentStatus === "exception") text = /* @__PURE__ */ jsx(Icon, { type: X });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return /* @__PURE__ */ jsx("div", {
|
|
100
|
+
className: "k-progress-text",
|
|
101
|
+
children: text
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
$[17] = children;
|
|
105
|
+
$[18] = currentPercent;
|
|
106
|
+
$[19] = format;
|
|
107
|
+
$[20] = showInfo;
|
|
108
|
+
$[21] = t9;
|
|
109
|
+
} else t9 = $[21];
|
|
110
|
+
const renderTip = t9;
|
|
111
|
+
let t10;
|
|
112
|
+
if ($[22] !== gapDegree || $[23] !== strokeLinecap || $[24] !== strokeWidth) {
|
|
113
|
+
t10 = (pct, strokeColor, dashboard) => {
|
|
114
|
+
const radius = 50 - strokeWidth / 2;
|
|
115
|
+
const beginY = radius;
|
|
116
|
+
const endY = 2 * radius;
|
|
117
|
+
let gap = Math.max(0, gapDegree);
|
|
118
|
+
gap = Math.min(259, gap);
|
|
119
|
+
const d = `M 50,50
|
|
120
|
+
m 0, ${beginY}
|
|
121
|
+
a ${radius},${radius} 0 1 1 0, ${-endY}
|
|
122
|
+
a ${radius},${radius} 0 1 1 0,${endY}`;
|
|
123
|
+
const len = Math.PI * 2 * radius;
|
|
124
|
+
const bgStyle = {
|
|
125
|
+
strokeDasharray: `${pct / 100 * (len - (dashboard ? gap : 0))}px ${len}px`,
|
|
126
|
+
transition: "stroke-dasharray .3s ease 0s,opacity 0.3s ease 0s",
|
|
127
|
+
strokeDashoffset: dashboard ? -gap / 2 : 0,
|
|
128
|
+
stroke: strokeColor,
|
|
129
|
+
strokeLinecap,
|
|
130
|
+
opacity: pct === 0 ? 0 : 1
|
|
131
|
+
};
|
|
132
|
+
const ds = {};
|
|
133
|
+
if (dashboard) {
|
|
134
|
+
ds.strokeDasharray = `${len - gap}px ${len}px`;
|
|
135
|
+
ds.strokeDashoffset = -gap / 2;
|
|
136
|
+
ds.strokeLinecap = strokeLinecap;
|
|
137
|
+
}
|
|
138
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
139
|
+
viewBox: "0 0 100 100",
|
|
140
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
141
|
+
strokeWidth,
|
|
142
|
+
d,
|
|
143
|
+
fill: "none",
|
|
144
|
+
style: ds,
|
|
145
|
+
className: "k-progress-inner"
|
|
146
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
147
|
+
strokeWidth,
|
|
148
|
+
d,
|
|
149
|
+
fill: "none",
|
|
150
|
+
style: bgStyle,
|
|
151
|
+
className: "k-progress-bg"
|
|
152
|
+
})]
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
$[22] = gapDegree;
|
|
156
|
+
$[23] = strokeLinecap;
|
|
157
|
+
$[24] = strokeWidth;
|
|
158
|
+
$[25] = t10;
|
|
159
|
+
} else t10 = $[25];
|
|
160
|
+
const renderCircle = t10;
|
|
161
|
+
let t11;
|
|
162
|
+
if ($[26] !== color || $[27] !== currentPercent || $[28] !== renderCircle || $[29] !== strokeHeight || $[30] !== type) {
|
|
163
|
+
t11 = () => {
|
|
164
|
+
if (type === "line") {
|
|
165
|
+
const bgStyle_0 = {
|
|
166
|
+
width: `${currentPercent}%`,
|
|
167
|
+
backgroundColor: color || void 0
|
|
168
|
+
};
|
|
169
|
+
if (strokeHeight) bgStyle_0.height = `${strokeHeight}px`;
|
|
170
|
+
return /* @__PURE__ */ jsx("div", {
|
|
171
|
+
className: "k-progress-inner",
|
|
172
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
173
|
+
className: "k-progress-bg",
|
|
174
|
+
style: bgStyle_0
|
|
175
|
+
})
|
|
176
|
+
});
|
|
177
|
+
} else if (type === "circle") return renderCircle(currentPercent, color, false);
|
|
178
|
+
else if (type === "dashboard") return renderCircle(currentPercent, color, true);
|
|
179
|
+
return null;
|
|
180
|
+
};
|
|
181
|
+
$[26] = color;
|
|
182
|
+
$[27] = currentPercent;
|
|
183
|
+
$[28] = renderCircle;
|
|
184
|
+
$[29] = strokeHeight;
|
|
185
|
+
$[30] = type;
|
|
186
|
+
$[31] = t11;
|
|
187
|
+
} else t11 = $[31];
|
|
188
|
+
const renderBar = t11;
|
|
189
|
+
let finalStatus = status;
|
|
190
|
+
if (currentPercent === 100 && status !== "exception") finalStatus = "success";
|
|
191
|
+
const t12 = `k-progress-${type}`;
|
|
192
|
+
const t13 = `k-progress-${finalStatus}`;
|
|
193
|
+
const t14 = type === "line" && size === "small";
|
|
194
|
+
const t15 = !showInfo;
|
|
195
|
+
let t16;
|
|
196
|
+
if ($[32] !== className || $[33] !== t12 || $[34] !== t13 || $[35] !== t14 || $[36] !== t15) {
|
|
197
|
+
t16 = clsx("k-progress", t12, t13, {
|
|
198
|
+
"k-progress-sm": t14,
|
|
199
|
+
"k-progress-hide-info": t15
|
|
200
|
+
}, className);
|
|
201
|
+
$[32] = className;
|
|
202
|
+
$[33] = t12;
|
|
203
|
+
$[34] = t13;
|
|
204
|
+
$[35] = t14;
|
|
205
|
+
$[36] = t15;
|
|
206
|
+
$[37] = t16;
|
|
207
|
+
} else t16 = $[37];
|
|
208
|
+
const classes = t16;
|
|
209
|
+
let pgStyle;
|
|
210
|
+
if ($[38] !== style || $[39] !== type || $[40] !== width) {
|
|
211
|
+
pgStyle = { ...style };
|
|
212
|
+
if (type !== "line" && width !== void 0 && width > 10) {
|
|
213
|
+
pgStyle.width = `${width}px`;
|
|
214
|
+
pgStyle.height = `${width}px`;
|
|
215
|
+
}
|
|
216
|
+
$[38] = style;
|
|
217
|
+
$[39] = type;
|
|
218
|
+
$[40] = width;
|
|
219
|
+
$[41] = pgStyle;
|
|
220
|
+
} else pgStyle = $[41];
|
|
221
|
+
let t17;
|
|
222
|
+
if ($[42] !== renderBar) {
|
|
223
|
+
t17 = renderBar();
|
|
224
|
+
$[42] = renderBar;
|
|
225
|
+
$[43] = t17;
|
|
226
|
+
} else t17 = $[43];
|
|
227
|
+
let t18;
|
|
228
|
+
if ($[44] !== finalStatus || $[45] !== renderTip || $[46] !== type) {
|
|
229
|
+
t18 = renderTip(finalStatus, type);
|
|
230
|
+
$[44] = finalStatus;
|
|
231
|
+
$[45] = renderTip;
|
|
232
|
+
$[46] = type;
|
|
233
|
+
$[47] = t18;
|
|
234
|
+
} else t18 = $[47];
|
|
235
|
+
let t19;
|
|
236
|
+
if ($[48] !== classes || $[49] !== pgStyle || $[50] !== rest || $[51] !== t17 || $[52] !== t18) {
|
|
237
|
+
t19 = /* @__PURE__ */ jsxs("div", {
|
|
238
|
+
className: classes,
|
|
239
|
+
style: pgStyle,
|
|
240
|
+
...rest,
|
|
241
|
+
children: [t17, t18]
|
|
242
|
+
});
|
|
243
|
+
$[48] = classes;
|
|
244
|
+
$[49] = pgStyle;
|
|
245
|
+
$[50] = rest;
|
|
246
|
+
$[51] = t17;
|
|
247
|
+
$[52] = t18;
|
|
248
|
+
$[53] = t19;
|
|
249
|
+
} else t19 = $[53];
|
|
250
|
+
return t19;
|
|
251
|
+
};
|
|
252
|
+
//#endregion
|
|
253
|
+
export { Progress as default };
|