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,60 @@
|
|
|
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 { useState } from "react";
|
|
11
|
+
//#region components/utils/use-value.ts
|
|
12
|
+
function useValue(source, normalize) {
|
|
13
|
+
const $ = c(9);
|
|
14
|
+
let t0;
|
|
15
|
+
if ($[0] !== normalize || $[1] !== source) {
|
|
16
|
+
t0 = () => ({
|
|
17
|
+
source,
|
|
18
|
+
value: normalize(source)
|
|
19
|
+
});
|
|
20
|
+
$[0] = normalize;
|
|
21
|
+
$[1] = source;
|
|
22
|
+
$[2] = t0;
|
|
23
|
+
} else t0 = $[2];
|
|
24
|
+
const [state, setState] = useState(t0);
|
|
25
|
+
let current = state.value;
|
|
26
|
+
if (!Object.is(state.source, source)) {
|
|
27
|
+
let t1;
|
|
28
|
+
if ($[3] !== normalize || $[4] !== source) {
|
|
29
|
+
t1 = normalize(source);
|
|
30
|
+
$[3] = normalize;
|
|
31
|
+
$[4] = source;
|
|
32
|
+
$[5] = t1;
|
|
33
|
+
} else t1 = $[5];
|
|
34
|
+
current = t1;
|
|
35
|
+
setState({
|
|
36
|
+
source,
|
|
37
|
+
value: current
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
let t1;
|
|
41
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
42
|
+
t1 = (action) => {
|
|
43
|
+
setState((previous) => ({
|
|
44
|
+
...previous,
|
|
45
|
+
value: typeof action === "function" ? action(previous.value) : action
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
$[6] = t1;
|
|
49
|
+
} else t1 = $[6];
|
|
50
|
+
const setValue = t1;
|
|
51
|
+
let t2;
|
|
52
|
+
if ($[7] !== current) {
|
|
53
|
+
t2 = [current, setValue];
|
|
54
|
+
$[7] = current;
|
|
55
|
+
$[8] = t2;
|
|
56
|
+
} else t2 = $[8];
|
|
57
|
+
return t2;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { useValue };
|
|
@@ -0,0 +1,252 @@
|
|
|
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 { getVirtualRange, normalizeItemHeight } from "./range.js";
|
|
10
|
+
import { c } from "react/compiler-runtime";
|
|
11
|
+
import clsx from "clsx";
|
|
12
|
+
import React, { useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
import { flushSync } from "react-dom";
|
|
15
|
+
//#region components/virtual-list/index.tsx
|
|
16
|
+
function VirtualListInner(t0, forwardedRef) {
|
|
17
|
+
const $ = c(43);
|
|
18
|
+
let children;
|
|
19
|
+
let className;
|
|
20
|
+
let itemKey;
|
|
21
|
+
let onScroll;
|
|
22
|
+
let rest;
|
|
23
|
+
let style;
|
|
24
|
+
let t1;
|
|
25
|
+
let t2;
|
|
26
|
+
let t3;
|
|
27
|
+
let t4;
|
|
28
|
+
if ($[0] !== t0) {
|
|
29
|
+
({data: t1, height: t2, itemHeight: t3, overscan: t4, itemKey, children, className, style, onScroll, ...rest} = t0);
|
|
30
|
+
$[0] = t0;
|
|
31
|
+
$[1] = children;
|
|
32
|
+
$[2] = className;
|
|
33
|
+
$[3] = itemKey;
|
|
34
|
+
$[4] = onScroll;
|
|
35
|
+
$[5] = rest;
|
|
36
|
+
$[6] = style;
|
|
37
|
+
$[7] = t1;
|
|
38
|
+
$[8] = t2;
|
|
39
|
+
$[9] = t3;
|
|
40
|
+
$[10] = t4;
|
|
41
|
+
} else {
|
|
42
|
+
children = $[1];
|
|
43
|
+
className = $[2];
|
|
44
|
+
itemKey = $[3];
|
|
45
|
+
onScroll = $[4];
|
|
46
|
+
rest = $[5];
|
|
47
|
+
style = $[6];
|
|
48
|
+
t1 = $[7];
|
|
49
|
+
t2 = $[8];
|
|
50
|
+
t3 = $[9];
|
|
51
|
+
t4 = $[10];
|
|
52
|
+
}
|
|
53
|
+
const data = t1 === void 0 ? [] : t1;
|
|
54
|
+
const height = t2 === void 0 ? 300 : t2;
|
|
55
|
+
const itemHeight = t3 === void 0 ? 32 : t3;
|
|
56
|
+
const overscan = t4 === void 0 ? 5 : t4;
|
|
57
|
+
const containerRef = useRef(null);
|
|
58
|
+
const scrollFrameRef = useRef(0);
|
|
59
|
+
const pendingScrollTopRef = useRef(0);
|
|
60
|
+
const [scrollTop, setScrollTop] = useState(0);
|
|
61
|
+
const [viewportHeight, setViewportHeight] = useState(0);
|
|
62
|
+
const safeItemHeight = normalizeItemHeight(itemHeight);
|
|
63
|
+
const range = getVirtualRange({
|
|
64
|
+
count: data.length,
|
|
65
|
+
scrollTop,
|
|
66
|
+
viewportHeight,
|
|
67
|
+
itemHeight: safeItemHeight,
|
|
68
|
+
overscan
|
|
69
|
+
});
|
|
70
|
+
let t5;
|
|
71
|
+
let t6;
|
|
72
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
73
|
+
t5 = () => {
|
|
74
|
+
const update = () => setViewportHeight(containerRef.current?.clientHeight ?? 0);
|
|
75
|
+
update();
|
|
76
|
+
if (typeof ResizeObserver === "undefined" || !containerRef.current) return;
|
|
77
|
+
const observer = new ResizeObserver(update);
|
|
78
|
+
observer.observe(containerRef.current);
|
|
79
|
+
return () => observer.disconnect();
|
|
80
|
+
};
|
|
81
|
+
t6 = [];
|
|
82
|
+
$[11] = t5;
|
|
83
|
+
$[12] = t6;
|
|
84
|
+
} else {
|
|
85
|
+
t5 = $[11];
|
|
86
|
+
t6 = $[12];
|
|
87
|
+
}
|
|
88
|
+
useEffect(t5, t6);
|
|
89
|
+
let t7;
|
|
90
|
+
let t8;
|
|
91
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
92
|
+
t7 = () => () => {
|
|
93
|
+
cancelAnimationFrame(scrollFrameRef.current);
|
|
94
|
+
};
|
|
95
|
+
t8 = [];
|
|
96
|
+
$[13] = t7;
|
|
97
|
+
$[14] = t8;
|
|
98
|
+
} else {
|
|
99
|
+
t7 = $[13];
|
|
100
|
+
t8 = $[14];
|
|
101
|
+
}
|
|
102
|
+
useEffect(t7, t8);
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
const container = containerRef.current;
|
|
105
|
+
if (!container) return;
|
|
106
|
+
const maxScrollTop = Math.max(0, data.length * safeItemHeight - container.clientHeight);
|
|
107
|
+
if (container.scrollTop > maxScrollTop) {
|
|
108
|
+
container.scrollTop = maxScrollTop;
|
|
109
|
+
setScrollTop(maxScrollTop);
|
|
110
|
+
}
|
|
111
|
+
}, [data.length, safeItemHeight]);
|
|
112
|
+
let t10;
|
|
113
|
+
if ($[15] !== data || $[16] !== safeItemHeight) {
|
|
114
|
+
t10 = [data.length, safeItemHeight];
|
|
115
|
+
$[15] = data;
|
|
116
|
+
$[16] = safeItemHeight;
|
|
117
|
+
$[17] = t10;
|
|
118
|
+
} else t10 = $[17];
|
|
119
|
+
useImperativeHandle(forwardedRef, () => ({
|
|
120
|
+
container: containerRef.current,
|
|
121
|
+
scrollToIndex(index, t9) {
|
|
122
|
+
const align = t9 === void 0 ? "auto" : t9;
|
|
123
|
+
const container_0 = containerRef.current;
|
|
124
|
+
if (!container_0 || !data.length) return;
|
|
125
|
+
const top = Math.max(0, Math.min(Number.isFinite(index) ? Math.floor(index) : 0, data.length - 1)) * safeItemHeight;
|
|
126
|
+
const bottom = top + safeItemHeight;
|
|
127
|
+
const maxScrollTop_0 = Math.max(0, data.length * safeItemHeight - container_0.clientHeight);
|
|
128
|
+
let nextScrollTop = container_0.scrollTop;
|
|
129
|
+
if (align === "start") nextScrollTop = top;
|
|
130
|
+
else if (align === "center") nextScrollTop = top - container_0.clientHeight / 2 + safeItemHeight / 2;
|
|
131
|
+
else if (align === "end") nextScrollTop = bottom - container_0.clientHeight;
|
|
132
|
+
else if (top < container_0.scrollTop) nextScrollTop = top;
|
|
133
|
+
else if (bottom > container_0.scrollTop + container_0.clientHeight) nextScrollTop = bottom - container_0.clientHeight;
|
|
134
|
+
container_0.scrollTop = Math.max(0, Math.min(nextScrollTop, maxScrollTop_0));
|
|
135
|
+
setScrollTop(container_0.scrollTop);
|
|
136
|
+
}
|
|
137
|
+
}), t10);
|
|
138
|
+
let t11;
|
|
139
|
+
if ($[18] !== itemKey) {
|
|
140
|
+
t11 = (item, index_0) => {
|
|
141
|
+
if (typeof itemKey === "function") return itemKey(item, index_0);
|
|
142
|
+
if (typeof itemKey === "string" && item && typeof item === "object") {
|
|
143
|
+
const value = item[itemKey];
|
|
144
|
+
if (typeof value === "string" || typeof value === "number") return value;
|
|
145
|
+
}
|
|
146
|
+
return index_0;
|
|
147
|
+
};
|
|
148
|
+
$[18] = itemKey;
|
|
149
|
+
$[19] = t11;
|
|
150
|
+
} else t11 = $[19];
|
|
151
|
+
const getKey = t11;
|
|
152
|
+
const actualHeight = typeof height === "number" ? `${height}px` : height;
|
|
153
|
+
let t12;
|
|
154
|
+
if ($[20] !== className) {
|
|
155
|
+
t12 = clsx("k-virtual-list", "k-scroll", className);
|
|
156
|
+
$[20] = className;
|
|
157
|
+
$[21] = t12;
|
|
158
|
+
} else t12 = $[21];
|
|
159
|
+
let t13;
|
|
160
|
+
if ($[22] !== actualHeight || $[23] !== style) {
|
|
161
|
+
t13 = {
|
|
162
|
+
...style,
|
|
163
|
+
height: actualHeight
|
|
164
|
+
};
|
|
165
|
+
$[22] = actualHeight;
|
|
166
|
+
$[23] = style;
|
|
167
|
+
$[24] = t13;
|
|
168
|
+
} else t13 = $[24];
|
|
169
|
+
let t14;
|
|
170
|
+
if ($[25] !== onScroll) {
|
|
171
|
+
t14 = (event) => {
|
|
172
|
+
pendingScrollTopRef.current = event.currentTarget.scrollTop;
|
|
173
|
+
if (!scrollFrameRef.current) scrollFrameRef.current = requestAnimationFrame(() => {
|
|
174
|
+
scrollFrameRef.current = 0;
|
|
175
|
+
flushSync(() => setScrollTop(pendingScrollTopRef.current));
|
|
176
|
+
});
|
|
177
|
+
onScroll?.(event);
|
|
178
|
+
};
|
|
179
|
+
$[25] = onScroll;
|
|
180
|
+
$[26] = t14;
|
|
181
|
+
} else t14 = $[26];
|
|
182
|
+
const t15 = "k-virtual-list-spacer";
|
|
183
|
+
const t16 = `${range.total}px`;
|
|
184
|
+
let t17;
|
|
185
|
+
if ($[27] !== t16) {
|
|
186
|
+
t17 = { height: t16 };
|
|
187
|
+
$[27] = t16;
|
|
188
|
+
$[28] = t17;
|
|
189
|
+
} else t17 = $[28];
|
|
190
|
+
const t18 = "k-virtual-list-items";
|
|
191
|
+
const t19 = `translateY(${range.offset}px)`;
|
|
192
|
+
let t20;
|
|
193
|
+
if ($[29] !== t19) {
|
|
194
|
+
t20 = { transform: t19 };
|
|
195
|
+
$[29] = t19;
|
|
196
|
+
$[30] = t20;
|
|
197
|
+
} else t20 = $[30];
|
|
198
|
+
const t21 = data.slice(range.start, range.end).map((item_0, localIndex) => {
|
|
199
|
+
const index_1 = range.start + localIndex;
|
|
200
|
+
return /* @__PURE__ */ jsx("div", {
|
|
201
|
+
className: "k-virtual-list-item",
|
|
202
|
+
style: { height: `${safeItemHeight}px` },
|
|
203
|
+
"data-index": index_1,
|
|
204
|
+
children: children?.(item_0, index_1)
|
|
205
|
+
}, getKey(item_0, index_1));
|
|
206
|
+
});
|
|
207
|
+
let t22;
|
|
208
|
+
if ($[31] !== t20 || $[32] !== t21) {
|
|
209
|
+
t22 = /* @__PURE__ */ jsx("div", {
|
|
210
|
+
className: t18,
|
|
211
|
+
style: t20,
|
|
212
|
+
children: t21
|
|
213
|
+
});
|
|
214
|
+
$[31] = t20;
|
|
215
|
+
$[32] = t21;
|
|
216
|
+
$[33] = t22;
|
|
217
|
+
} else t22 = $[33];
|
|
218
|
+
let t23;
|
|
219
|
+
if ($[34] !== t17 || $[35] !== t22) {
|
|
220
|
+
t23 = /* @__PURE__ */ jsx("div", {
|
|
221
|
+
className: t15,
|
|
222
|
+
style: t17,
|
|
223
|
+
children: t22
|
|
224
|
+
});
|
|
225
|
+
$[34] = t17;
|
|
226
|
+
$[35] = t22;
|
|
227
|
+
$[36] = t23;
|
|
228
|
+
} else t23 = $[36];
|
|
229
|
+
let t24;
|
|
230
|
+
if ($[37] !== rest || $[38] !== t12 || $[39] !== t13 || $[40] !== t14 || $[41] !== t23) {
|
|
231
|
+
t24 = /* @__PURE__ */ jsx("div", {
|
|
232
|
+
...rest,
|
|
233
|
+
ref: containerRef,
|
|
234
|
+
className: t12,
|
|
235
|
+
style: t13,
|
|
236
|
+
onScroll: t14,
|
|
237
|
+
children: t23
|
|
238
|
+
});
|
|
239
|
+
$[37] = rest;
|
|
240
|
+
$[38] = t12;
|
|
241
|
+
$[39] = t13;
|
|
242
|
+
$[40] = t14;
|
|
243
|
+
$[41] = t23;
|
|
244
|
+
$[42] = t24;
|
|
245
|
+
} else t24 = $[42];
|
|
246
|
+
return t24;
|
|
247
|
+
}
|
|
248
|
+
var VirtualListBase = React.forwardRef(VirtualListInner);
|
|
249
|
+
VirtualListBase.displayName = "VirtualList";
|
|
250
|
+
var VirtualList = VirtualListBase;
|
|
251
|
+
//#endregion
|
|
252
|
+
export { VirtualList as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
//#region components/virtual-list/range.ts
|
|
10
|
+
var normalizeItemHeight = (value) => Number.isFinite(value) && value > 0 ? value : 1;
|
|
11
|
+
var getVirtualRange = ({ count, scrollTop, viewportHeight, itemHeight, overscan }) => {
|
|
12
|
+
const safeCount = Number.isFinite(count) ? Math.max(0, Math.floor(count)) : 0;
|
|
13
|
+
const safeHeight = normalizeItemHeight(itemHeight);
|
|
14
|
+
const safeOverscan = Number.isFinite(overscan) ? Math.max(0, Math.floor(overscan)) : 0;
|
|
15
|
+
const safeViewportHeight = Number.isFinite(viewportHeight) ? Math.max(0, viewportHeight) : 0;
|
|
16
|
+
const safeScrollTop = Number.isFinite(scrollTop) ? Math.max(0, scrollTop) : 0;
|
|
17
|
+
const visibleCount = Math.ceil(safeViewportHeight / safeHeight);
|
|
18
|
+
const start = Math.max(0, Math.floor(safeScrollTop / safeHeight) - safeOverscan);
|
|
19
|
+
return {
|
|
20
|
+
start,
|
|
21
|
+
end: Math.min(safeCount, start + visibleCount + safeOverscan * 2),
|
|
22
|
+
offset: start * safeHeight,
|
|
23
|
+
total: safeCount * safeHeight
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { getVirtualRange, normalizeItemHeight };
|
|
@@ -0,0 +1,313 @@
|
|
|
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, useRef } from "react";
|
|
12
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
13
|
+
//#region components/watermark/index.tsx
|
|
14
|
+
function Watermark(t0) {
|
|
15
|
+
const $ = c(46);
|
|
16
|
+
let children;
|
|
17
|
+
let className;
|
|
18
|
+
let font;
|
|
19
|
+
let rest;
|
|
20
|
+
let style;
|
|
21
|
+
let t1;
|
|
22
|
+
let t10;
|
|
23
|
+
let t11;
|
|
24
|
+
let t2;
|
|
25
|
+
let t3;
|
|
26
|
+
let t4;
|
|
27
|
+
let t5;
|
|
28
|
+
let t6;
|
|
29
|
+
let t7;
|
|
30
|
+
let t8;
|
|
31
|
+
let t9;
|
|
32
|
+
if ($[0] !== t0) {
|
|
33
|
+
({content: t1, image: t2, width: t3, height: t4, rotate: t5, zIndex: t6, fullscreen: t7, antiTamper: t8, font, gap: t9, offset: t10, layout: t11, className, style, children, ...rest} = t0);
|
|
34
|
+
$[0] = t0;
|
|
35
|
+
$[1] = children;
|
|
36
|
+
$[2] = className;
|
|
37
|
+
$[3] = font;
|
|
38
|
+
$[4] = rest;
|
|
39
|
+
$[5] = style;
|
|
40
|
+
$[6] = t1;
|
|
41
|
+
$[7] = t10;
|
|
42
|
+
$[8] = t11;
|
|
43
|
+
$[9] = t2;
|
|
44
|
+
$[10] = t3;
|
|
45
|
+
$[11] = t4;
|
|
46
|
+
$[12] = t5;
|
|
47
|
+
$[13] = t6;
|
|
48
|
+
$[14] = t7;
|
|
49
|
+
$[15] = t8;
|
|
50
|
+
$[16] = t9;
|
|
51
|
+
} else {
|
|
52
|
+
children = $[1];
|
|
53
|
+
className = $[2];
|
|
54
|
+
font = $[3];
|
|
55
|
+
rest = $[4];
|
|
56
|
+
style = $[5];
|
|
57
|
+
t1 = $[6];
|
|
58
|
+
t10 = $[7];
|
|
59
|
+
t11 = $[8];
|
|
60
|
+
t2 = $[9];
|
|
61
|
+
t3 = $[10];
|
|
62
|
+
t4 = $[11];
|
|
63
|
+
t5 = $[12];
|
|
64
|
+
t6 = $[13];
|
|
65
|
+
t7 = $[14];
|
|
66
|
+
t8 = $[15];
|
|
67
|
+
t9 = $[16];
|
|
68
|
+
}
|
|
69
|
+
const content = t1 === void 0 ? "" : t1;
|
|
70
|
+
const image = t2 === void 0 ? "" : t2;
|
|
71
|
+
const width = t3 === void 0 ? 240 : t3;
|
|
72
|
+
const height = t4 === void 0 ? 189 : t4;
|
|
73
|
+
const rotate = t5 === void 0 ? -22 : t5;
|
|
74
|
+
const zIndex = t6 === void 0 ? 999 : t6;
|
|
75
|
+
const fullscreen = t7 === void 0 ? false : t7;
|
|
76
|
+
const antiTamper = t8 === void 0 ? true : t8;
|
|
77
|
+
let t12;
|
|
78
|
+
if ($[17] !== t9) {
|
|
79
|
+
t12 = t9 === void 0 ? [40, 40] : t9;
|
|
80
|
+
$[17] = t9;
|
|
81
|
+
$[18] = t12;
|
|
82
|
+
} else t12 = $[18];
|
|
83
|
+
const gap = t12;
|
|
84
|
+
let t13;
|
|
85
|
+
if ($[19] !== t10) {
|
|
86
|
+
t13 = t10 === void 0 ? [20, 20] : t10;
|
|
87
|
+
$[19] = t10;
|
|
88
|
+
$[20] = t13;
|
|
89
|
+
} else t13 = $[20];
|
|
90
|
+
const offset = t13;
|
|
91
|
+
const layout = t11 === void 0 ? "stagger" : t11;
|
|
92
|
+
const containerRef = useRef(null);
|
|
93
|
+
const watermarkRef = useRef(null);
|
|
94
|
+
const restoringRef = useRef(false);
|
|
95
|
+
let t14;
|
|
96
|
+
let t15;
|
|
97
|
+
if ($[21] !== antiTamper || $[22] !== content || $[23] !== font || $[24] !== fullscreen || $[25] !== gap || $[26] !== height || $[27] !== image || $[28] !== layout || $[29] !== offset || $[30] !== rotate || $[31] !== width || $[32] !== zIndex) {
|
|
98
|
+
t14 = () => {
|
|
99
|
+
if (typeof document === "undefined") return;
|
|
100
|
+
let disposed = false;
|
|
101
|
+
let parentObserver = null;
|
|
102
|
+
let selfObserver = null;
|
|
103
|
+
const target = fullscreen ? document.body : containerRef.current;
|
|
104
|
+
if (!target) return;
|
|
105
|
+
const drawText = (context) => {
|
|
106
|
+
const globalFont = {
|
|
107
|
+
color: "rgba(128, 128, 128, 0.15)",
|
|
108
|
+
fontSize: 15,
|
|
109
|
+
fontWeight: "normal",
|
|
110
|
+
fontFamily: "sans-serif",
|
|
111
|
+
fontStyle: "normal",
|
|
112
|
+
...font
|
|
113
|
+
};
|
|
114
|
+
const lines = (Array.isArray(content) ? content : [content]).map(_temp);
|
|
115
|
+
const heights = lines.map((item_0) => (item_0.fontSize ?? globalFont.fontSize) + 8);
|
|
116
|
+
let y = -heights.reduce(_temp2, 0) / 2;
|
|
117
|
+
context.textAlign = "center";
|
|
118
|
+
context.textBaseline = "middle";
|
|
119
|
+
lines.forEach((item_2, index) => {
|
|
120
|
+
const size = item_2.fontSize ?? globalFont.fontSize;
|
|
121
|
+
context.font = `${item_2.fontStyle ?? globalFont.fontStyle} ${item_2.fontWeight ?? globalFont.fontWeight} ${size}px ${item_2.fontFamily ?? globalFont.fontFamily}`;
|
|
122
|
+
context.fillStyle = item_2.color ?? globalFont.color;
|
|
123
|
+
context.fillText(item_2.text, 0, y + heights[index] / 2);
|
|
124
|
+
y = y + heights[index];
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
const createPattern = () => new Promise((resolve) => {
|
|
128
|
+
const ratio = window.devicePixelRatio || 1;
|
|
129
|
+
const cellWidth = width + gap[0];
|
|
130
|
+
const cellHeight = height + gap[1];
|
|
131
|
+
const staggered = layout === "stagger";
|
|
132
|
+
const canvas = document.createElement("canvas");
|
|
133
|
+
canvas.width = cellWidth * (staggered ? 2 : 1) * ratio;
|
|
134
|
+
canvas.height = cellHeight * (staggered ? 2 : 1) * ratio;
|
|
135
|
+
const context_0 = canvas.getContext("2d");
|
|
136
|
+
if (!context_0) return resolve("");
|
|
137
|
+
context_0.scale(ratio, ratio);
|
|
138
|
+
const drawCell = (x, y_0, source) => {
|
|
139
|
+
context_0.save();
|
|
140
|
+
context_0.translate(x, y_0);
|
|
141
|
+
context_0.rotate(rotate * Math.PI / 180);
|
|
142
|
+
if (source) context_0.drawImage(source, -width / 2, -height / 2, width, height);
|
|
143
|
+
else drawText(context_0);
|
|
144
|
+
context_0.restore();
|
|
145
|
+
};
|
|
146
|
+
const render = (source_0) => {
|
|
147
|
+
const x_0 = offset[0];
|
|
148
|
+
const y_1 = offset[1];
|
|
149
|
+
drawCell(cellWidth / 2 + x_0, cellHeight / 2 + y_1, source_0);
|
|
150
|
+
if (staggered) {
|
|
151
|
+
drawCell(cellWidth * 1.5 + x_0, cellHeight / 2 + y_1, source_0);
|
|
152
|
+
drawCell(x_0, cellHeight * 1.5 + y_1, source_0);
|
|
153
|
+
drawCell(cellWidth + x_0, cellHeight * 1.5 + y_1, source_0);
|
|
154
|
+
drawCell(cellWidth * 2 + x_0, cellHeight * 1.5 + y_1, source_0);
|
|
155
|
+
}
|
|
156
|
+
resolve(canvas.toDataURL());
|
|
157
|
+
};
|
|
158
|
+
if (!image) return render();
|
|
159
|
+
const source_1 = new Image();
|
|
160
|
+
source_1.crossOrigin = "anonymous";
|
|
161
|
+
source_1.onload = () => render(source_1);
|
|
162
|
+
source_1.onerror = () => render();
|
|
163
|
+
source_1.src = image;
|
|
164
|
+
});
|
|
165
|
+
const install = async () => {
|
|
166
|
+
const pattern = await createPattern();
|
|
167
|
+
if (disposed) return;
|
|
168
|
+
parentObserver?.disconnect();
|
|
169
|
+
selfObserver?.disconnect();
|
|
170
|
+
watermarkRef.current?.remove();
|
|
171
|
+
const root = document.createElement("div");
|
|
172
|
+
root.dataset.wmRoot = "true";
|
|
173
|
+
Object.assign(root.style, {
|
|
174
|
+
position: fullscreen ? "fixed" : "absolute",
|
|
175
|
+
inset: "0",
|
|
176
|
+
width: "100%",
|
|
177
|
+
height: "100%",
|
|
178
|
+
pointerEvents: "none",
|
|
179
|
+
zIndex: String(zIndex),
|
|
180
|
+
margin: "0",
|
|
181
|
+
padding: "0"
|
|
182
|
+
});
|
|
183
|
+
const inner = document.createElement("div");
|
|
184
|
+
const cellWidth_0 = width + gap[0];
|
|
185
|
+
const cellHeight_0 = height + gap[1];
|
|
186
|
+
const staggered_0 = layout === "stagger";
|
|
187
|
+
Object.assign(inner.style, {
|
|
188
|
+
width: "100%",
|
|
189
|
+
height: "100%",
|
|
190
|
+
backgroundImage: `url(${pattern})`,
|
|
191
|
+
backgroundRepeat: "repeat",
|
|
192
|
+
backgroundSize: `${cellWidth_0 * (staggered_0 ? 2 : 1)}px ${cellHeight_0 * (staggered_0 ? 2 : 1)}px`,
|
|
193
|
+
pointerEvents: "none"
|
|
194
|
+
});
|
|
195
|
+
root.attachShadow({ mode: "closed" }).appendChild(inner);
|
|
196
|
+
target.appendChild(root);
|
|
197
|
+
watermarkRef.current = root;
|
|
198
|
+
restoringRef.current = false;
|
|
199
|
+
if (!antiTamper) return;
|
|
200
|
+
const restore = () => {
|
|
201
|
+
if (!disposed && !restoringRef.current) {
|
|
202
|
+
restoringRef.current = true;
|
|
203
|
+
install();
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
parentObserver = new MutationObserver((records) => {
|
|
207
|
+
if (records.some((record) => [...record.removedNodes].includes(root))) restore();
|
|
208
|
+
});
|
|
209
|
+
parentObserver.observe(target, { childList: true });
|
|
210
|
+
selfObserver = new MutationObserver(restore);
|
|
211
|
+
selfObserver.observe(root, {
|
|
212
|
+
attributes: true,
|
|
213
|
+
attributeFilter: [
|
|
214
|
+
"style",
|
|
215
|
+
"class",
|
|
216
|
+
"id",
|
|
217
|
+
"hidden"
|
|
218
|
+
]
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
install();
|
|
222
|
+
return () => {
|
|
223
|
+
disposed = true;
|
|
224
|
+
parentObserver?.disconnect();
|
|
225
|
+
selfObserver?.disconnect();
|
|
226
|
+
watermarkRef.current?.remove();
|
|
227
|
+
watermarkRef.current = null;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
t15 = [
|
|
231
|
+
content,
|
|
232
|
+
image,
|
|
233
|
+
width,
|
|
234
|
+
height,
|
|
235
|
+
rotate,
|
|
236
|
+
zIndex,
|
|
237
|
+
fullscreen,
|
|
238
|
+
antiTamper,
|
|
239
|
+
font,
|
|
240
|
+
gap,
|
|
241
|
+
offset,
|
|
242
|
+
layout
|
|
243
|
+
];
|
|
244
|
+
$[21] = antiTamper;
|
|
245
|
+
$[22] = content;
|
|
246
|
+
$[23] = font;
|
|
247
|
+
$[24] = fullscreen;
|
|
248
|
+
$[25] = gap;
|
|
249
|
+
$[26] = height;
|
|
250
|
+
$[27] = image;
|
|
251
|
+
$[28] = layout;
|
|
252
|
+
$[29] = offset;
|
|
253
|
+
$[30] = rotate;
|
|
254
|
+
$[31] = width;
|
|
255
|
+
$[32] = zIndex;
|
|
256
|
+
$[33] = t14;
|
|
257
|
+
$[34] = t15;
|
|
258
|
+
} else {
|
|
259
|
+
t14 = $[33];
|
|
260
|
+
t15 = $[34];
|
|
261
|
+
}
|
|
262
|
+
useEffect(t14, t15);
|
|
263
|
+
if (fullscreen) {
|
|
264
|
+
let t16;
|
|
265
|
+
if ($[35] !== children) {
|
|
266
|
+
t16 = /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
267
|
+
$[35] = children;
|
|
268
|
+
$[36] = t16;
|
|
269
|
+
} else t16 = $[36];
|
|
270
|
+
return t16;
|
|
271
|
+
}
|
|
272
|
+
let t16;
|
|
273
|
+
if ($[37] !== className) {
|
|
274
|
+
t16 = clsx("k-watermark-container", className);
|
|
275
|
+
$[37] = className;
|
|
276
|
+
$[38] = t16;
|
|
277
|
+
} else t16 = $[38];
|
|
278
|
+
let t17;
|
|
279
|
+
if ($[39] !== style) {
|
|
280
|
+
t17 = {
|
|
281
|
+
position: "relative",
|
|
282
|
+
width: "100%",
|
|
283
|
+
height: "100%",
|
|
284
|
+
...style
|
|
285
|
+
};
|
|
286
|
+
$[39] = style;
|
|
287
|
+
$[40] = t17;
|
|
288
|
+
} else t17 = $[40];
|
|
289
|
+
let t18;
|
|
290
|
+
if ($[41] !== children || $[42] !== rest || $[43] !== t16 || $[44] !== t17) {
|
|
291
|
+
t18 = /* @__PURE__ */ jsx("div", {
|
|
292
|
+
...rest,
|
|
293
|
+
ref: containerRef,
|
|
294
|
+
className: t16,
|
|
295
|
+
style: t17,
|
|
296
|
+
children
|
|
297
|
+
});
|
|
298
|
+
$[41] = children;
|
|
299
|
+
$[42] = rest;
|
|
300
|
+
$[43] = t16;
|
|
301
|
+
$[44] = t17;
|
|
302
|
+
$[45] = t18;
|
|
303
|
+
} else t18 = $[45];
|
|
304
|
+
return t18;
|
|
305
|
+
}
|
|
306
|
+
function _temp2(sum, item_1) {
|
|
307
|
+
return sum + item_1;
|
|
308
|
+
}
|
|
309
|
+
function _temp(item) {
|
|
310
|
+
return typeof item === "string" ? { text: item } : item;
|
|
311
|
+
}
|
|
312
|
+
//#endregion
|
|
313
|
+
export { Watermark as default };
|