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,256 @@
|
|
|
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 { SiderHookContext } from "./layout-context.js";
|
|
10
|
+
import { c } from "react/compiler-runtime";
|
|
11
|
+
import clsx from "clsx";
|
|
12
|
+
import { useCallback, useContext, useEffect, useState } from "react";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
//#region components/layout/index.tsx
|
|
15
|
+
function BasicSection(t0) {
|
|
16
|
+
const $ = c(12);
|
|
17
|
+
let children;
|
|
18
|
+
let rest;
|
|
19
|
+
let suffixCls;
|
|
20
|
+
let t1;
|
|
21
|
+
if ($[0] !== t0) {
|
|
22
|
+
({suffixCls, children, className: t1, ...rest} = t0);
|
|
23
|
+
$[0] = t0;
|
|
24
|
+
$[1] = children;
|
|
25
|
+
$[2] = rest;
|
|
26
|
+
$[3] = suffixCls;
|
|
27
|
+
$[4] = t1;
|
|
28
|
+
} else {
|
|
29
|
+
children = $[1];
|
|
30
|
+
rest = $[2];
|
|
31
|
+
suffixCls = $[3];
|
|
32
|
+
t1 = $[4];
|
|
33
|
+
}
|
|
34
|
+
const className = t1 === void 0 ? "" : t1;
|
|
35
|
+
const t2 = `k-${suffixCls}`;
|
|
36
|
+
let t3;
|
|
37
|
+
if ($[5] !== className || $[6] !== t2) {
|
|
38
|
+
t3 = clsx(t2, className);
|
|
39
|
+
$[5] = className;
|
|
40
|
+
$[6] = t2;
|
|
41
|
+
$[7] = t3;
|
|
42
|
+
} else t3 = $[7];
|
|
43
|
+
let t4;
|
|
44
|
+
if ($[8] !== children || $[9] !== rest || $[10] !== t3) {
|
|
45
|
+
t4 = /* @__PURE__ */ jsx("section", {
|
|
46
|
+
className: t3,
|
|
47
|
+
...rest,
|
|
48
|
+
children
|
|
49
|
+
});
|
|
50
|
+
$[8] = children;
|
|
51
|
+
$[9] = rest;
|
|
52
|
+
$[10] = t3;
|
|
53
|
+
$[11] = t4;
|
|
54
|
+
} else t4 = $[11];
|
|
55
|
+
return t4;
|
|
56
|
+
}
|
|
57
|
+
var LayoutMain = ({ suffixCls = "layout", hasSider, children, className = "", ...rest }) => {
|
|
58
|
+
const [siderCount, setSiderCount] = useState(0);
|
|
59
|
+
const collectSider = useCallback((mounted) => {
|
|
60
|
+
setSiderCount((prev) => mounted ? prev + 1 : Math.max(0, prev - 1));
|
|
61
|
+
}, []);
|
|
62
|
+
const classes = clsx(`k-${suffixCls}`, { [`k-${suffixCls}-has-sider`]: hasSider ?? siderCount > 0 }, className);
|
|
63
|
+
return /* @__PURE__ */ jsx(SiderHookContext.Provider, {
|
|
64
|
+
value: collectSider,
|
|
65
|
+
children: /* @__PURE__ */ jsx("section", {
|
|
66
|
+
className: classes,
|
|
67
|
+
...rest,
|
|
68
|
+
children
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
var Sider = (t0) => {
|
|
73
|
+
const $ = c(25);
|
|
74
|
+
let children;
|
|
75
|
+
let collapsed;
|
|
76
|
+
let collapsible;
|
|
77
|
+
let rest;
|
|
78
|
+
let style;
|
|
79
|
+
let t1;
|
|
80
|
+
let t2;
|
|
81
|
+
let t3;
|
|
82
|
+
let t4;
|
|
83
|
+
if ($[0] !== t0) {
|
|
84
|
+
({suffixCls: t1, width: t2, collapsedWidth: t3, collapsible, collapsed, children, className: t4, style, ...rest} = t0);
|
|
85
|
+
$[0] = t0;
|
|
86
|
+
$[1] = children;
|
|
87
|
+
$[2] = collapsed;
|
|
88
|
+
$[3] = collapsible;
|
|
89
|
+
$[4] = rest;
|
|
90
|
+
$[5] = style;
|
|
91
|
+
$[6] = t1;
|
|
92
|
+
$[7] = t2;
|
|
93
|
+
$[8] = t3;
|
|
94
|
+
$[9] = t4;
|
|
95
|
+
} else {
|
|
96
|
+
children = $[1];
|
|
97
|
+
collapsed = $[2];
|
|
98
|
+
collapsible = $[3];
|
|
99
|
+
rest = $[4];
|
|
100
|
+
style = $[5];
|
|
101
|
+
t1 = $[6];
|
|
102
|
+
t2 = $[7];
|
|
103
|
+
t3 = $[8];
|
|
104
|
+
t4 = $[9];
|
|
105
|
+
}
|
|
106
|
+
const suffixCls = t1 === void 0 ? "layout-sider" : t1;
|
|
107
|
+
const width = t2 === void 0 ? 200 : t2;
|
|
108
|
+
const collapsedWidth = t3 === void 0 ? 80 : t3;
|
|
109
|
+
const className = t4 === void 0 ? "" : t4;
|
|
110
|
+
const collectSider = useContext(SiderHookContext);
|
|
111
|
+
let t5;
|
|
112
|
+
let t6;
|
|
113
|
+
if ($[10] !== collectSider) {
|
|
114
|
+
t5 = () => {
|
|
115
|
+
collectSider?.(true);
|
|
116
|
+
return () => {
|
|
117
|
+
collectSider?.(false);
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
t6 = [collectSider];
|
|
121
|
+
$[10] = collectSider;
|
|
122
|
+
$[11] = t5;
|
|
123
|
+
$[12] = t6;
|
|
124
|
+
} else {
|
|
125
|
+
t5 = $[11];
|
|
126
|
+
t6 = $[12];
|
|
127
|
+
}
|
|
128
|
+
useEffect(t5, t6);
|
|
129
|
+
const t7 = `k-${suffixCls}`;
|
|
130
|
+
let t8;
|
|
131
|
+
if ($[13] !== className || $[14] !== t7) {
|
|
132
|
+
t8 = clsx(t7, className);
|
|
133
|
+
$[13] = className;
|
|
134
|
+
$[14] = t7;
|
|
135
|
+
$[15] = t8;
|
|
136
|
+
} else t8 = $[15];
|
|
137
|
+
const classes = t8;
|
|
138
|
+
const siderWidth = style?.width ?? (collapsible && collapsed ? collapsedWidth : width);
|
|
139
|
+
const resolvedWidth = typeof siderWidth === "number" ? `${siderWidth}px` : siderWidth;
|
|
140
|
+
const t9 = `0 0 ${resolvedWidth}`;
|
|
141
|
+
let t10;
|
|
142
|
+
if ($[16] !== resolvedWidth || $[17] !== style || $[18] !== t9) {
|
|
143
|
+
t10 = {
|
|
144
|
+
width: resolvedWidth,
|
|
145
|
+
flex: t9,
|
|
146
|
+
maxWidth: resolvedWidth,
|
|
147
|
+
minWidth: resolvedWidth,
|
|
148
|
+
...style
|
|
149
|
+
};
|
|
150
|
+
$[16] = resolvedWidth;
|
|
151
|
+
$[17] = style;
|
|
152
|
+
$[18] = t9;
|
|
153
|
+
$[19] = t10;
|
|
154
|
+
} else t10 = $[19];
|
|
155
|
+
const siderStyle = t10;
|
|
156
|
+
let t11;
|
|
157
|
+
if ($[20] !== children || $[21] !== classes || $[22] !== rest || $[23] !== siderStyle) {
|
|
158
|
+
t11 = /* @__PURE__ */ jsx("aside", {
|
|
159
|
+
className: classes,
|
|
160
|
+
style: siderStyle,
|
|
161
|
+
...rest,
|
|
162
|
+
children
|
|
163
|
+
});
|
|
164
|
+
$[20] = children;
|
|
165
|
+
$[21] = classes;
|
|
166
|
+
$[22] = rest;
|
|
167
|
+
$[23] = siderStyle;
|
|
168
|
+
$[24] = t11;
|
|
169
|
+
} else t11 = $[24];
|
|
170
|
+
return t11;
|
|
171
|
+
};
|
|
172
|
+
function Content(t0) {
|
|
173
|
+
const $ = c(6);
|
|
174
|
+
let props;
|
|
175
|
+
let t1;
|
|
176
|
+
if ($[0] !== t0) {
|
|
177
|
+
({suffixCls: t1, ...props} = t0);
|
|
178
|
+
$[0] = t0;
|
|
179
|
+
$[1] = props;
|
|
180
|
+
$[2] = t1;
|
|
181
|
+
} else {
|
|
182
|
+
props = $[1];
|
|
183
|
+
t1 = $[2];
|
|
184
|
+
}
|
|
185
|
+
const suffixCls = t1 === void 0 ? "layout-content" : t1;
|
|
186
|
+
let t2;
|
|
187
|
+
if ($[3] !== props || $[4] !== suffixCls) {
|
|
188
|
+
t2 = /* @__PURE__ */ jsx(BasicSection, {
|
|
189
|
+
suffixCls,
|
|
190
|
+
...props
|
|
191
|
+
});
|
|
192
|
+
$[3] = props;
|
|
193
|
+
$[4] = suffixCls;
|
|
194
|
+
$[5] = t2;
|
|
195
|
+
} else t2 = $[5];
|
|
196
|
+
return t2;
|
|
197
|
+
}
|
|
198
|
+
function Header(t0) {
|
|
199
|
+
const $ = c(6);
|
|
200
|
+
let props;
|
|
201
|
+
let t1;
|
|
202
|
+
if ($[0] !== t0) {
|
|
203
|
+
({suffixCls: t1, ...props} = t0);
|
|
204
|
+
$[0] = t0;
|
|
205
|
+
$[1] = props;
|
|
206
|
+
$[2] = t1;
|
|
207
|
+
} else {
|
|
208
|
+
props = $[1];
|
|
209
|
+
t1 = $[2];
|
|
210
|
+
}
|
|
211
|
+
const suffixCls = t1 === void 0 ? "layout-header" : t1;
|
|
212
|
+
let t2;
|
|
213
|
+
if ($[3] !== props || $[4] !== suffixCls) {
|
|
214
|
+
t2 = /* @__PURE__ */ jsx(BasicSection, {
|
|
215
|
+
suffixCls,
|
|
216
|
+
...props
|
|
217
|
+
});
|
|
218
|
+
$[3] = props;
|
|
219
|
+
$[4] = suffixCls;
|
|
220
|
+
$[5] = t2;
|
|
221
|
+
} else t2 = $[5];
|
|
222
|
+
return t2;
|
|
223
|
+
}
|
|
224
|
+
function Footer(t0) {
|
|
225
|
+
const $ = c(6);
|
|
226
|
+
let props;
|
|
227
|
+
let t1;
|
|
228
|
+
if ($[0] !== t0) {
|
|
229
|
+
({suffixCls: t1, ...props} = t0);
|
|
230
|
+
$[0] = t0;
|
|
231
|
+
$[1] = props;
|
|
232
|
+
$[2] = t1;
|
|
233
|
+
} else {
|
|
234
|
+
props = $[1];
|
|
235
|
+
t1 = $[2];
|
|
236
|
+
}
|
|
237
|
+
const suffixCls = t1 === void 0 ? "layout-footer" : t1;
|
|
238
|
+
let t2;
|
|
239
|
+
if ($[3] !== props || $[4] !== suffixCls) {
|
|
240
|
+
t2 = /* @__PURE__ */ jsx(BasicSection, {
|
|
241
|
+
suffixCls,
|
|
242
|
+
...props
|
|
243
|
+
});
|
|
244
|
+
$[3] = props;
|
|
245
|
+
$[4] = suffixCls;
|
|
246
|
+
$[5] = t2;
|
|
247
|
+
} else t2 = $[5];
|
|
248
|
+
return t2;
|
|
249
|
+
}
|
|
250
|
+
var Layout = LayoutMain;
|
|
251
|
+
Layout.Header = Header;
|
|
252
|
+
Layout.Footer = Footer;
|
|
253
|
+
Layout.Content = Content;
|
|
254
|
+
Layout.Sider = Sider;
|
|
255
|
+
//#endregion
|
|
256
|
+
export { Content, Footer, Header, Layout, Layout as default, Sider };
|
|
@@ -0,0 +1,13 @@
|
|
|
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 } from "react";
|
|
10
|
+
//#region components/layout/layout-context.ts
|
|
11
|
+
var SiderHookContext = createContext(null);
|
|
12
|
+
//#endregion
|
|
13
|
+
export { SiderHookContext };
|
|
@@ -0,0 +1,194 @@
|
|
|
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 Card from "../card/index.js";
|
|
11
|
+
import { c } from "react/compiler-runtime";
|
|
12
|
+
import clsx from "clsx";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
//#region components/list-panel/index.tsx
|
|
15
|
+
function ListPanel(t0) {
|
|
16
|
+
const $ = c(51);
|
|
17
|
+
let actions;
|
|
18
|
+
let children;
|
|
19
|
+
let className;
|
|
20
|
+
let filters;
|
|
21
|
+
let footer;
|
|
22
|
+
let rest;
|
|
23
|
+
let selection;
|
|
24
|
+
let shapeProp;
|
|
25
|
+
let sizeProp;
|
|
26
|
+
let summary;
|
|
27
|
+
let t1;
|
|
28
|
+
let t2;
|
|
29
|
+
let themeProp;
|
|
30
|
+
if ($[0] !== t0) {
|
|
31
|
+
({summary, bordered: t1, theme: themeProp, shape: shapeProp, size: sizeProp, selectedCount: t2, filters, actions, selection, footer, children, className, ...rest} = t0);
|
|
32
|
+
$[0] = t0;
|
|
33
|
+
$[1] = actions;
|
|
34
|
+
$[2] = children;
|
|
35
|
+
$[3] = className;
|
|
36
|
+
$[4] = filters;
|
|
37
|
+
$[5] = footer;
|
|
38
|
+
$[6] = rest;
|
|
39
|
+
$[7] = selection;
|
|
40
|
+
$[8] = shapeProp;
|
|
41
|
+
$[9] = sizeProp;
|
|
42
|
+
$[10] = summary;
|
|
43
|
+
$[11] = t1;
|
|
44
|
+
$[12] = t2;
|
|
45
|
+
$[13] = themeProp;
|
|
46
|
+
} else {
|
|
47
|
+
actions = $[1];
|
|
48
|
+
children = $[2];
|
|
49
|
+
className = $[3];
|
|
50
|
+
filters = $[4];
|
|
51
|
+
footer = $[5];
|
|
52
|
+
rest = $[6];
|
|
53
|
+
selection = $[7];
|
|
54
|
+
shapeProp = $[8];
|
|
55
|
+
sizeProp = $[9];
|
|
56
|
+
summary = $[10];
|
|
57
|
+
t1 = $[11];
|
|
58
|
+
t2 = $[12];
|
|
59
|
+
themeProp = $[13];
|
|
60
|
+
}
|
|
61
|
+
const bordered = t1 === void 0 ? true : t1;
|
|
62
|
+
const selectedCount = t2 === void 0 ? 0 : t2;
|
|
63
|
+
const inheritedAppearance = useConfigAppearance();
|
|
64
|
+
const theme = themeProp ?? inheritedAppearance.theme ?? "outline";
|
|
65
|
+
const shape = shapeProp ?? inheritedAppearance.shape ?? "round";
|
|
66
|
+
const size = sizeProp ?? inheritedAppearance.size ?? "medium";
|
|
67
|
+
const hasNode = _temp;
|
|
68
|
+
let T0;
|
|
69
|
+
let t3;
|
|
70
|
+
let t4;
|
|
71
|
+
let t5;
|
|
72
|
+
let t6;
|
|
73
|
+
let t7;
|
|
74
|
+
let t8;
|
|
75
|
+
let t9;
|
|
76
|
+
if ($[14] !== actions || $[15] !== bordered || $[16] !== className || $[17] !== filters || $[18] !== rest || $[19] !== selectedCount || $[20] !== selection || $[21] !== shape || $[22] !== size || $[23] !== summary || $[24] !== theme) {
|
|
77
|
+
const selectionContent = typeof selection === "function" ? selection(selectedCount) : selection;
|
|
78
|
+
const hasSummary = hasNode(summary);
|
|
79
|
+
const hasSelection = Number.isFinite(selectedCount) && selectedCount > 0 && hasNode(selectionContent);
|
|
80
|
+
const hasFilters = hasNode(filters);
|
|
81
|
+
const hasActions = hasNode(actions);
|
|
82
|
+
const hasToolbar = hasFilters || hasActions || hasSummary || hasSelection;
|
|
83
|
+
T0 = Card;
|
|
84
|
+
t3 = rest;
|
|
85
|
+
const t10 = !bordered && "k-list-panel-borderless";
|
|
86
|
+
if ($[33] !== className || $[34] !== t10) {
|
|
87
|
+
t4 = clsx("k-list-panel", t10, className);
|
|
88
|
+
$[33] = className;
|
|
89
|
+
$[34] = t10;
|
|
90
|
+
$[35] = t4;
|
|
91
|
+
} else t4 = $[35];
|
|
92
|
+
t5 = bordered;
|
|
93
|
+
t6 = theme;
|
|
94
|
+
t7 = shape;
|
|
95
|
+
t8 = size;
|
|
96
|
+
t9 = hasToolbar && /* @__PURE__ */ jsx("div", {
|
|
97
|
+
className: clsx("k-list-panel-toolbar", hasSelection && "k-list-panel-toolbar-selection"),
|
|
98
|
+
role: "toolbar",
|
|
99
|
+
children: hasSelection ? /* @__PURE__ */ jsx("div", {
|
|
100
|
+
className: "k-list-panel-selection",
|
|
101
|
+
children: selectionContent
|
|
102
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [hasFilters && /* @__PURE__ */ jsx("div", {
|
|
103
|
+
className: "k-list-panel-filters",
|
|
104
|
+
children: filters
|
|
105
|
+
}), (hasSummary || hasActions) && /* @__PURE__ */ jsxs("div", {
|
|
106
|
+
className: "k-list-panel-toolbar-extra",
|
|
107
|
+
children: [hasSummary && /* @__PURE__ */ jsx("div", {
|
|
108
|
+
className: "k-list-panel-summary",
|
|
109
|
+
"aria-live": "polite",
|
|
110
|
+
children: summary
|
|
111
|
+
}), hasActions && actions]
|
|
112
|
+
})] })
|
|
113
|
+
});
|
|
114
|
+
$[14] = actions;
|
|
115
|
+
$[15] = bordered;
|
|
116
|
+
$[16] = className;
|
|
117
|
+
$[17] = filters;
|
|
118
|
+
$[18] = rest;
|
|
119
|
+
$[19] = selectedCount;
|
|
120
|
+
$[20] = selection;
|
|
121
|
+
$[21] = shape;
|
|
122
|
+
$[22] = size;
|
|
123
|
+
$[23] = summary;
|
|
124
|
+
$[24] = theme;
|
|
125
|
+
$[25] = T0;
|
|
126
|
+
$[26] = t3;
|
|
127
|
+
$[27] = t4;
|
|
128
|
+
$[28] = t5;
|
|
129
|
+
$[29] = t6;
|
|
130
|
+
$[30] = t7;
|
|
131
|
+
$[31] = t8;
|
|
132
|
+
$[32] = t9;
|
|
133
|
+
} else {
|
|
134
|
+
T0 = $[25];
|
|
135
|
+
t3 = $[26];
|
|
136
|
+
t4 = $[27];
|
|
137
|
+
t5 = $[28];
|
|
138
|
+
t6 = $[29];
|
|
139
|
+
t7 = $[30];
|
|
140
|
+
t8 = $[31];
|
|
141
|
+
t9 = $[32];
|
|
142
|
+
}
|
|
143
|
+
let t10;
|
|
144
|
+
if ($[36] !== children) {
|
|
145
|
+
t10 = /* @__PURE__ */ jsx("div", {
|
|
146
|
+
className: "k-list-panel-content",
|
|
147
|
+
children
|
|
148
|
+
});
|
|
149
|
+
$[36] = children;
|
|
150
|
+
$[37] = t10;
|
|
151
|
+
} else t10 = $[37];
|
|
152
|
+
let t11;
|
|
153
|
+
if ($[38] !== footer) {
|
|
154
|
+
t11 = hasNode(footer) && /* @__PURE__ */ jsx("div", {
|
|
155
|
+
className: "k-list-panel-footer",
|
|
156
|
+
children: footer
|
|
157
|
+
});
|
|
158
|
+
$[38] = footer;
|
|
159
|
+
$[39] = t11;
|
|
160
|
+
} else t11 = $[39];
|
|
161
|
+
let t12;
|
|
162
|
+
if ($[40] !== T0 || $[41] !== t10 || $[42] !== t11 || $[43] !== t3 || $[44] !== t4 || $[45] !== t5 || $[46] !== t6 || $[47] !== t7 || $[48] !== t8 || $[49] !== t9) {
|
|
163
|
+
t12 = /* @__PURE__ */ jsxs(T0, {
|
|
164
|
+
...t3,
|
|
165
|
+
className: t4,
|
|
166
|
+
bordered: t5,
|
|
167
|
+
theme: t6,
|
|
168
|
+
shape: t7,
|
|
169
|
+
size: t8,
|
|
170
|
+
children: [
|
|
171
|
+
t9,
|
|
172
|
+
t10,
|
|
173
|
+
t11
|
|
174
|
+
]
|
|
175
|
+
});
|
|
176
|
+
$[40] = T0;
|
|
177
|
+
$[41] = t10;
|
|
178
|
+
$[42] = t11;
|
|
179
|
+
$[43] = t3;
|
|
180
|
+
$[44] = t4;
|
|
181
|
+
$[45] = t5;
|
|
182
|
+
$[46] = t6;
|
|
183
|
+
$[47] = t7;
|
|
184
|
+
$[48] = t8;
|
|
185
|
+
$[49] = t9;
|
|
186
|
+
$[50] = t12;
|
|
187
|
+
} else t12 = $[50];
|
|
188
|
+
return t12;
|
|
189
|
+
}
|
|
190
|
+
function _temp(node) {
|
|
191
|
+
return node !== null && node !== void 0 && node !== false;
|
|
192
|
+
}
|
|
193
|
+
//#endregion
|
|
194
|
+
export { ListPanel as default };
|
|
@@ -0,0 +1,69 @@
|
|
|
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 LoadingBar from "./loading-bar.js";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
import { createRoot } from "react-dom/client";
|
|
12
|
+
//#region components/loading/index.tsx
|
|
13
|
+
var root = null;
|
|
14
|
+
var instance = null;
|
|
15
|
+
var container = null;
|
|
16
|
+
var pending = [];
|
|
17
|
+
function ensureInstance(props) {
|
|
18
|
+
if (instance) return instance;
|
|
19
|
+
if (root) return null;
|
|
20
|
+
container = document.getElementById("k-loading-box") ?? document.createElement("div");
|
|
21
|
+
container.id = "k-loading-box";
|
|
22
|
+
if (!container.parentNode) document.body.appendChild(container);
|
|
23
|
+
root = createRoot(container);
|
|
24
|
+
const currentRoot = root;
|
|
25
|
+
root.render(/* @__PURE__ */ jsx(LoadingBar, {
|
|
26
|
+
...props,
|
|
27
|
+
ref: (value) => {
|
|
28
|
+
if (!value || root !== currentRoot) return;
|
|
29
|
+
instance = value;
|
|
30
|
+
const actions = pending;
|
|
31
|
+
pending = [];
|
|
32
|
+
actions.forEach((action) => action(value));
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
var invoke = (method, value) => {
|
|
38
|
+
const current = ensureInstance();
|
|
39
|
+
const action = (target) => {
|
|
40
|
+
if (method === "update") target.update(value ?? 0);
|
|
41
|
+
else target[method]();
|
|
42
|
+
};
|
|
43
|
+
if (current) action(current);
|
|
44
|
+
else pending.push(action);
|
|
45
|
+
};
|
|
46
|
+
var loading = {
|
|
47
|
+
start: (props) => {
|
|
48
|
+
const current = ensureInstance(props);
|
|
49
|
+
if (current) current.start();
|
|
50
|
+
else pending.push((target) => target.start());
|
|
51
|
+
},
|
|
52
|
+
finish: () => invoke("finish"),
|
|
53
|
+
error: () => invoke("error"),
|
|
54
|
+
update: (percent) => invoke("update", percent),
|
|
55
|
+
destroy() {
|
|
56
|
+
const currentRoot = root;
|
|
57
|
+
const currentContainer = container;
|
|
58
|
+
root = null;
|
|
59
|
+
instance = null;
|
|
60
|
+
container = null;
|
|
61
|
+
pending = [];
|
|
62
|
+
currentContainer?.remove();
|
|
63
|
+
queueMicrotask(() => {
|
|
64
|
+
currentRoot?.unmount();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { loading as default };
|
|
@@ -0,0 +1,133 @@
|
|
|
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 { c } from "react/compiler-runtime";
|
|
10
|
+
import clsx from "clsx";
|
|
11
|
+
import { useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
//#region components/loading/loading-bar.tsx
|
|
14
|
+
function LoadingBar(t0) {
|
|
15
|
+
const $ = c(17);
|
|
16
|
+
const { ref, height: t1 } = t0;
|
|
17
|
+
const height = t1 === void 0 ? 2 : t1;
|
|
18
|
+
const [visible, setVisible] = useState(false);
|
|
19
|
+
const [percent, setPercent] = useState(0);
|
|
20
|
+
const [isError, setIsError] = useState(false);
|
|
21
|
+
const intervalRef = useRef(null);
|
|
22
|
+
const timeoutRef = useRef(null);
|
|
23
|
+
let t2;
|
|
24
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
25
|
+
t2 = () => {
|
|
26
|
+
if (intervalRef.current) clearInterval(intervalRef.current);
|
|
27
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
28
|
+
intervalRef.current = null;
|
|
29
|
+
timeoutRef.current = null;
|
|
30
|
+
};
|
|
31
|
+
$[0] = t2;
|
|
32
|
+
} else t2 = $[0];
|
|
33
|
+
const clearTimers = t2;
|
|
34
|
+
let t3;
|
|
35
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
36
|
+
t3 = () => ({
|
|
37
|
+
start() {
|
|
38
|
+
clearTimers();
|
|
39
|
+
setPercent(0);
|
|
40
|
+
setIsError(false);
|
|
41
|
+
setVisible(true);
|
|
42
|
+
intervalRef.current = setInterval(() => {
|
|
43
|
+
setPercent((current) => {
|
|
44
|
+
const step = current < 80 ? Math.random() * 5 + 2 : Math.random();
|
|
45
|
+
const next = Math.min(current + step, 95);
|
|
46
|
+
if (next >= 95 && intervalRef.current) clearInterval(intervalRef.current);
|
|
47
|
+
return next;
|
|
48
|
+
});
|
|
49
|
+
}, 200);
|
|
50
|
+
},
|
|
51
|
+
finish() {
|
|
52
|
+
clearTimers();
|
|
53
|
+
setPercent(100);
|
|
54
|
+
timeoutRef.current = setTimeout(() => setVisible(false), 500);
|
|
55
|
+
},
|
|
56
|
+
error() {
|
|
57
|
+
clearTimers();
|
|
58
|
+
setIsError(true);
|
|
59
|
+
setPercent(100);
|
|
60
|
+
setVisible(true);
|
|
61
|
+
timeoutRef.current = setTimeout(() => setVisible(false), 500);
|
|
62
|
+
},
|
|
63
|
+
update(value) {
|
|
64
|
+
setIsError(false);
|
|
65
|
+
setVisible(true);
|
|
66
|
+
setPercent(Math.max(0, Math.min(100, value)));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
$[1] = t3;
|
|
70
|
+
} else t3 = $[1];
|
|
71
|
+
useImperativeHandle(ref, t3);
|
|
72
|
+
let t4;
|
|
73
|
+
let t5;
|
|
74
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
75
|
+
t4 = () => clearTimers;
|
|
76
|
+
t5 = [];
|
|
77
|
+
$[2] = t4;
|
|
78
|
+
$[3] = t5;
|
|
79
|
+
} else {
|
|
80
|
+
t4 = $[2];
|
|
81
|
+
t5 = $[3];
|
|
82
|
+
}
|
|
83
|
+
useEffect(t4, t5);
|
|
84
|
+
if (!visible) return null;
|
|
85
|
+
const t6 = `${percent}%`;
|
|
86
|
+
let t7;
|
|
87
|
+
if ($[4] !== height || $[5] !== t6) {
|
|
88
|
+
t7 = {
|
|
89
|
+
width: t6,
|
|
90
|
+
height
|
|
91
|
+
};
|
|
92
|
+
$[4] = height;
|
|
93
|
+
$[5] = t6;
|
|
94
|
+
$[6] = t7;
|
|
95
|
+
} else t7 = $[6];
|
|
96
|
+
const lineStyle = t7;
|
|
97
|
+
let t8;
|
|
98
|
+
if ($[7] !== height) {
|
|
99
|
+
t8 = { height };
|
|
100
|
+
$[7] = height;
|
|
101
|
+
$[8] = t8;
|
|
102
|
+
} else t8 = $[8];
|
|
103
|
+
let t9;
|
|
104
|
+
if ($[9] !== isError) {
|
|
105
|
+
t9 = clsx("k-loading-line", { "k-loading-line-error": isError });
|
|
106
|
+
$[9] = isError;
|
|
107
|
+
$[10] = t9;
|
|
108
|
+
} else t9 = $[10];
|
|
109
|
+
let t10;
|
|
110
|
+
if ($[11] !== lineStyle || $[12] !== t9) {
|
|
111
|
+
t10 = /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className: t9,
|
|
113
|
+
style: lineStyle
|
|
114
|
+
});
|
|
115
|
+
$[11] = lineStyle;
|
|
116
|
+
$[12] = t9;
|
|
117
|
+
$[13] = t10;
|
|
118
|
+
} else t10 = $[13];
|
|
119
|
+
let t11;
|
|
120
|
+
if ($[14] !== t10 || $[15] !== t8) {
|
|
121
|
+
t11 = /* @__PURE__ */ jsx("div", {
|
|
122
|
+
className: "k-loading-container",
|
|
123
|
+
style: t8,
|
|
124
|
+
children: t10
|
|
125
|
+
});
|
|
126
|
+
$[14] = t10;
|
|
127
|
+
$[15] = t8;
|
|
128
|
+
$[16] = t11;
|
|
129
|
+
} else t11 = $[16];
|
|
130
|
+
return t11;
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
export { LoadingBar as default };
|