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,121 @@
|
|
|
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 { AnchorContext } from "./anchor-context.js";
|
|
10
|
+
import { c } from "react/compiler-runtime";
|
|
11
|
+
import clsx from "clsx";
|
|
12
|
+
import { useContext, useEffect } from "react";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
//#region components/anchor/anchor-link.tsx
|
|
15
|
+
function AnchorLink(t0) {
|
|
16
|
+
const $ = c(30);
|
|
17
|
+
let children;
|
|
18
|
+
let className;
|
|
19
|
+
let href;
|
|
20
|
+
let onClick;
|
|
21
|
+
let rest;
|
|
22
|
+
let title;
|
|
23
|
+
if ($[0] !== t0) {
|
|
24
|
+
({href, title, className, children, onClick, ...rest} = t0);
|
|
25
|
+
$[0] = t0;
|
|
26
|
+
$[1] = children;
|
|
27
|
+
$[2] = className;
|
|
28
|
+
$[3] = href;
|
|
29
|
+
$[4] = onClick;
|
|
30
|
+
$[5] = rest;
|
|
31
|
+
$[6] = title;
|
|
32
|
+
} else {
|
|
33
|
+
children = $[1];
|
|
34
|
+
className = $[2];
|
|
35
|
+
href = $[3];
|
|
36
|
+
onClick = $[4];
|
|
37
|
+
rest = $[5];
|
|
38
|
+
title = $[6];
|
|
39
|
+
}
|
|
40
|
+
const context = useContext(AnchorContext);
|
|
41
|
+
const registerLink = context?.registerLink;
|
|
42
|
+
const unregisterLink = context?.unregisterLink;
|
|
43
|
+
let t1;
|
|
44
|
+
let t2;
|
|
45
|
+
if ($[7] !== href || $[8] !== registerLink || $[9] !== unregisterLink) {
|
|
46
|
+
t1 = () => {
|
|
47
|
+
registerLink?.(href);
|
|
48
|
+
return () => unregisterLink?.(href);
|
|
49
|
+
};
|
|
50
|
+
t2 = [
|
|
51
|
+
href,
|
|
52
|
+
registerLink,
|
|
53
|
+
unregisterLink
|
|
54
|
+
];
|
|
55
|
+
$[7] = href;
|
|
56
|
+
$[8] = registerLink;
|
|
57
|
+
$[9] = unregisterLink;
|
|
58
|
+
$[10] = t1;
|
|
59
|
+
$[11] = t2;
|
|
60
|
+
} else {
|
|
61
|
+
t1 = $[10];
|
|
62
|
+
t2 = $[11];
|
|
63
|
+
}
|
|
64
|
+
useEffect(t1, t2);
|
|
65
|
+
const t3 = context?.activeLink === href;
|
|
66
|
+
let t4;
|
|
67
|
+
if ($[12] !== t3) {
|
|
68
|
+
t4 = clsx("k-anchor-link", { "k-anchor-link-active": t3 });
|
|
69
|
+
$[12] = t3;
|
|
70
|
+
$[13] = t4;
|
|
71
|
+
} else t4 = $[13];
|
|
72
|
+
let t5;
|
|
73
|
+
if ($[14] !== className) {
|
|
74
|
+
t5 = clsx("k-anchor-link-title", className);
|
|
75
|
+
$[14] = className;
|
|
76
|
+
$[15] = t5;
|
|
77
|
+
} else t5 = $[15];
|
|
78
|
+
let t6;
|
|
79
|
+
if ($[16] !== context || $[17] !== href || $[18] !== onClick) {
|
|
80
|
+
t6 = (event) => {
|
|
81
|
+
onClick?.(event);
|
|
82
|
+
if (event.defaultPrevented) return;
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
context?.scrollTo(href);
|
|
85
|
+
};
|
|
86
|
+
$[16] = context;
|
|
87
|
+
$[17] = href;
|
|
88
|
+
$[18] = onClick;
|
|
89
|
+
$[19] = t6;
|
|
90
|
+
} else t6 = $[19];
|
|
91
|
+
let t7;
|
|
92
|
+
if ($[20] !== href || $[21] !== rest || $[22] !== t5 || $[23] !== t6 || $[24] !== title) {
|
|
93
|
+
t7 = /* @__PURE__ */ jsx("a", {
|
|
94
|
+
...rest,
|
|
95
|
+
href,
|
|
96
|
+
className: t5,
|
|
97
|
+
onClick: t6,
|
|
98
|
+
children: title
|
|
99
|
+
});
|
|
100
|
+
$[20] = href;
|
|
101
|
+
$[21] = rest;
|
|
102
|
+
$[22] = t5;
|
|
103
|
+
$[23] = t6;
|
|
104
|
+
$[24] = title;
|
|
105
|
+
$[25] = t7;
|
|
106
|
+
} else t7 = $[25];
|
|
107
|
+
let t8;
|
|
108
|
+
if ($[26] !== children || $[27] !== t4 || $[28] !== t7) {
|
|
109
|
+
t8 = /* @__PURE__ */ jsxs("div", {
|
|
110
|
+
className: t4,
|
|
111
|
+
children: [t7, children]
|
|
112
|
+
});
|
|
113
|
+
$[26] = children;
|
|
114
|
+
$[27] = t4;
|
|
115
|
+
$[28] = t7;
|
|
116
|
+
$[29] = t8;
|
|
117
|
+
} else t8 = $[29];
|
|
118
|
+
return t8;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { AnchorLink as default };
|
|
@@ -0,0 +1,431 @@
|
|
|
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 { AnchorContext } from "./anchor-context.js";
|
|
10
|
+
import { c } from "react/compiler-runtime";
|
|
11
|
+
import clsx from "clsx";
|
|
12
|
+
import { useEffect, useRef, useState } from "react";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
//#region components/anchor/anchor.tsx
|
|
15
|
+
function Anchor(t0) {
|
|
16
|
+
const $ = c(75);
|
|
17
|
+
let children;
|
|
18
|
+
let className;
|
|
19
|
+
let container;
|
|
20
|
+
let onChange;
|
|
21
|
+
let onClick;
|
|
22
|
+
let rest;
|
|
23
|
+
let style;
|
|
24
|
+
let t1;
|
|
25
|
+
let t2;
|
|
26
|
+
let t3;
|
|
27
|
+
if ($[0] !== t0) {
|
|
28
|
+
({affix: t1, offsetTop: t2, bounds: t3, container, onChange, onClick, className, style, children, ...rest} = t0);
|
|
29
|
+
$[0] = t0;
|
|
30
|
+
$[1] = children;
|
|
31
|
+
$[2] = className;
|
|
32
|
+
$[3] = container;
|
|
33
|
+
$[4] = onChange;
|
|
34
|
+
$[5] = onClick;
|
|
35
|
+
$[6] = rest;
|
|
36
|
+
$[7] = style;
|
|
37
|
+
$[8] = t1;
|
|
38
|
+
$[9] = t2;
|
|
39
|
+
$[10] = t3;
|
|
40
|
+
} else {
|
|
41
|
+
children = $[1];
|
|
42
|
+
className = $[2];
|
|
43
|
+
container = $[3];
|
|
44
|
+
onChange = $[4];
|
|
45
|
+
onClick = $[5];
|
|
46
|
+
rest = $[6];
|
|
47
|
+
style = $[7];
|
|
48
|
+
t1 = $[8];
|
|
49
|
+
t2 = $[9];
|
|
50
|
+
t3 = $[10];
|
|
51
|
+
}
|
|
52
|
+
const affix = t1 === void 0 ? true : t1;
|
|
53
|
+
const offsetTop = t2 === void 0 ? 0 : t2;
|
|
54
|
+
const bounds = t3 === void 0 ? 5 : t3;
|
|
55
|
+
const wrapperRef = useRef(null);
|
|
56
|
+
let t4;
|
|
57
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
58
|
+
t4 = /* @__PURE__ */ new Set();
|
|
59
|
+
$[11] = t4;
|
|
60
|
+
} else t4 = $[11];
|
|
61
|
+
const linksRef = useRef(t4);
|
|
62
|
+
const clickScrollingRef = useRef(false);
|
|
63
|
+
const scrollEndTimerRef = useRef(null);
|
|
64
|
+
const frameRef = useRef(null);
|
|
65
|
+
const unmountedRef = useRef(false);
|
|
66
|
+
const offsetTopRef = useRef(offsetTop);
|
|
67
|
+
const boundsRef = useRef(bounds);
|
|
68
|
+
const onChangeRef = useRef(onChange);
|
|
69
|
+
const onClickRef = useRef(onClick);
|
|
70
|
+
const activeLinkRef = useRef("");
|
|
71
|
+
const [activeLink, setActiveLink] = useState("");
|
|
72
|
+
let t5;
|
|
73
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
74
|
+
t5 = { opacity: 0 };
|
|
75
|
+
$[12] = t5;
|
|
76
|
+
} else t5 = $[12];
|
|
77
|
+
const [inkStyle, setInkStyle] = useState(t5);
|
|
78
|
+
let t6;
|
|
79
|
+
let t7;
|
|
80
|
+
if ($[13] !== bounds || $[14] !== offsetTop || $[15] !== onChange || $[16] !== onClick) {
|
|
81
|
+
t6 = () => {
|
|
82
|
+
offsetTopRef.current = offsetTop;
|
|
83
|
+
boundsRef.current = bounds;
|
|
84
|
+
onChangeRef.current = onChange;
|
|
85
|
+
onClickRef.current = onClick;
|
|
86
|
+
};
|
|
87
|
+
t7 = [
|
|
88
|
+
bounds,
|
|
89
|
+
offsetTop,
|
|
90
|
+
onChange,
|
|
91
|
+
onClick
|
|
92
|
+
];
|
|
93
|
+
$[13] = bounds;
|
|
94
|
+
$[14] = offsetTop;
|
|
95
|
+
$[15] = onChange;
|
|
96
|
+
$[16] = onClick;
|
|
97
|
+
$[17] = t6;
|
|
98
|
+
$[18] = t7;
|
|
99
|
+
} else {
|
|
100
|
+
t6 = $[17];
|
|
101
|
+
t7 = $[18];
|
|
102
|
+
}
|
|
103
|
+
useEffect(t6, t7);
|
|
104
|
+
let t8;
|
|
105
|
+
if ($[19] !== container) {
|
|
106
|
+
t8 = () => {
|
|
107
|
+
if (typeof window === "undefined") return null;
|
|
108
|
+
if (!container) return window;
|
|
109
|
+
if (typeof container === "string") return document.querySelector(container) ?? window;
|
|
110
|
+
return container;
|
|
111
|
+
};
|
|
112
|
+
$[19] = container;
|
|
113
|
+
$[20] = t8;
|
|
114
|
+
} else t8 = $[20];
|
|
115
|
+
const getContainer = t8;
|
|
116
|
+
const getTarget = _temp;
|
|
117
|
+
const getElementTop = _temp2;
|
|
118
|
+
let t9;
|
|
119
|
+
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
120
|
+
t9 = () => {
|
|
121
|
+
const node = wrapperRef.current?.querySelector(".k-anchor-link-active > .k-anchor-link-title");
|
|
122
|
+
const next = node ? {
|
|
123
|
+
top: (node.parentElement?.offsetTop || 0) + 4,
|
|
124
|
+
height: node.clientHeight,
|
|
125
|
+
opacity: 1
|
|
126
|
+
} : {
|
|
127
|
+
top: 0,
|
|
128
|
+
height: 0,
|
|
129
|
+
opacity: 0
|
|
130
|
+
};
|
|
131
|
+
setInkStyle((current) => current.top === next.top && current.height === next.height && current.opacity === next.opacity ? current : next);
|
|
132
|
+
};
|
|
133
|
+
$[21] = t9;
|
|
134
|
+
} else t9 = $[21];
|
|
135
|
+
const updateInk = t9;
|
|
136
|
+
let t10;
|
|
137
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
138
|
+
t10 = (link_0) => {
|
|
139
|
+
if (activeLinkRef.current === link_0) return;
|
|
140
|
+
activeLinkRef.current = link_0;
|
|
141
|
+
setActiveLink(link_0);
|
|
142
|
+
onChangeRef.current?.(link_0);
|
|
143
|
+
};
|
|
144
|
+
$[22] = t10;
|
|
145
|
+
} else t10 = $[22];
|
|
146
|
+
const setCurrentActiveLink = t10;
|
|
147
|
+
let t11;
|
|
148
|
+
if ($[23] !== getContainer) {
|
|
149
|
+
t11 = () => {
|
|
150
|
+
frameRef.current = null;
|
|
151
|
+
if (clickScrollingRef.current) return;
|
|
152
|
+
const scrollContainer_0 = getContainer();
|
|
153
|
+
if (!scrollContainer_0) return;
|
|
154
|
+
const scrollTop = scrollContainer_0 === window ? window.pageYOffset : scrollContainer_0.scrollTop;
|
|
155
|
+
const targets = [...linksRef.current].map((link_1) => {
|
|
156
|
+
const target = getTarget(link_1);
|
|
157
|
+
return target ? {
|
|
158
|
+
link: link_1,
|
|
159
|
+
offsetTop: getElementTop(target, scrollContainer_0)
|
|
160
|
+
} : null;
|
|
161
|
+
}).filter(_temp3).sort(_temp4);
|
|
162
|
+
let next_0 = "";
|
|
163
|
+
for (let index = targets.length - 1; index >= 0; index = index - 1) {
|
|
164
|
+
const target_0 = targets[index];
|
|
165
|
+
if (scrollTop >= target_0.offsetTop - offsetTopRef.current - boundsRef.current) {
|
|
166
|
+
next_0 = target_0.link;
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
setCurrentActiveLink(next_0);
|
|
171
|
+
};
|
|
172
|
+
$[23] = getContainer;
|
|
173
|
+
$[24] = t11;
|
|
174
|
+
} else t11 = $[24];
|
|
175
|
+
const handleScroll = t11;
|
|
176
|
+
let t12;
|
|
177
|
+
if ($[25] !== handleScroll) {
|
|
178
|
+
t12 = () => {
|
|
179
|
+
if (unmountedRef.current || frameRef.current !== null || typeof window === "undefined") return;
|
|
180
|
+
frameRef.current = window.requestAnimationFrame(handleScroll);
|
|
181
|
+
};
|
|
182
|
+
$[25] = handleScroll;
|
|
183
|
+
$[26] = t12;
|
|
184
|
+
} else t12 = $[26];
|
|
185
|
+
const scheduleScroll = t12;
|
|
186
|
+
let t13;
|
|
187
|
+
if ($[27] !== scheduleScroll) {
|
|
188
|
+
t13 = () => {
|
|
189
|
+
clickScrollingRef.current = false;
|
|
190
|
+
scrollEndTimerRef.current = null;
|
|
191
|
+
scheduleScroll();
|
|
192
|
+
updateInk();
|
|
193
|
+
};
|
|
194
|
+
$[27] = scheduleScroll;
|
|
195
|
+
$[28] = t13;
|
|
196
|
+
} else t13 = $[28];
|
|
197
|
+
const finishClickScrolling = t13;
|
|
198
|
+
let t14;
|
|
199
|
+
if ($[29] !== finishClickScrolling || $[30] !== getContainer) {
|
|
200
|
+
t14 = (link_2) => {
|
|
201
|
+
const target_1 = getTarget(link_2);
|
|
202
|
+
const scrollContainer_1 = getContainer();
|
|
203
|
+
if (!target_1 || !scrollContainer_1) return;
|
|
204
|
+
clickScrollingRef.current = true;
|
|
205
|
+
setCurrentActiveLink(link_2);
|
|
206
|
+
onClickRef.current?.(link_2);
|
|
207
|
+
scrollContainer_1.scrollTo({
|
|
208
|
+
top: getElementTop(target_1, scrollContainer_1) - offsetTopRef.current,
|
|
209
|
+
behavior: "smooth"
|
|
210
|
+
});
|
|
211
|
+
if (scrollEndTimerRef.current) clearTimeout(scrollEndTimerRef.current);
|
|
212
|
+
scrollEndTimerRef.current = setTimeout(finishClickScrolling, 1e3);
|
|
213
|
+
};
|
|
214
|
+
$[29] = finishClickScrolling;
|
|
215
|
+
$[30] = getContainer;
|
|
216
|
+
$[31] = t14;
|
|
217
|
+
} else t14 = $[31];
|
|
218
|
+
const scrollTo = t14;
|
|
219
|
+
let t15;
|
|
220
|
+
if ($[32] !== scheduleScroll) {
|
|
221
|
+
t15 = (link_3) => {
|
|
222
|
+
linksRef.current.add(link_3);
|
|
223
|
+
scheduleScroll();
|
|
224
|
+
};
|
|
225
|
+
$[32] = scheduleScroll;
|
|
226
|
+
$[33] = t15;
|
|
227
|
+
} else t15 = $[33];
|
|
228
|
+
const registerLink = t15;
|
|
229
|
+
let t16;
|
|
230
|
+
if ($[34] !== scheduleScroll) {
|
|
231
|
+
t16 = (link_4) => {
|
|
232
|
+
linksRef.current.delete(link_4);
|
|
233
|
+
scheduleScroll();
|
|
234
|
+
};
|
|
235
|
+
$[34] = scheduleScroll;
|
|
236
|
+
$[35] = t16;
|
|
237
|
+
} else t16 = $[35];
|
|
238
|
+
const unregisterLink = t16;
|
|
239
|
+
let t17;
|
|
240
|
+
if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
|
|
241
|
+
t17 = () => {
|
|
242
|
+
updateInk();
|
|
243
|
+
};
|
|
244
|
+
$[36] = t17;
|
|
245
|
+
} else t17 = $[36];
|
|
246
|
+
let t18;
|
|
247
|
+
if ($[37] !== activeLink) {
|
|
248
|
+
t18 = [activeLink, updateInk];
|
|
249
|
+
$[37] = activeLink;
|
|
250
|
+
$[38] = t18;
|
|
251
|
+
} else t18 = $[38];
|
|
252
|
+
useEffect(t17, t18);
|
|
253
|
+
let t19;
|
|
254
|
+
let t20;
|
|
255
|
+
if ($[39] !== finishClickScrolling || $[40] !== getContainer || $[41] !== scheduleScroll) {
|
|
256
|
+
t19 = () => {
|
|
257
|
+
unmountedRef.current = false;
|
|
258
|
+
const scrollContainer_2 = getContainer();
|
|
259
|
+
if (!scrollContainer_2 || typeof window === "undefined") return;
|
|
260
|
+
const handleContainerScroll = () => {
|
|
261
|
+
if (!clickScrollingRef.current) {
|
|
262
|
+
scheduleScroll();
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if (scrollEndTimerRef.current) clearTimeout(scrollEndTimerRef.current);
|
|
266
|
+
scrollEndTimerRef.current = setTimeout(finishClickScrolling, 120);
|
|
267
|
+
};
|
|
268
|
+
const handleResize = () => {
|
|
269
|
+
scheduleScroll();
|
|
270
|
+
updateInk();
|
|
271
|
+
};
|
|
272
|
+
scrollContainer_2.addEventListener("scroll", handleContainerScroll, { passive: true });
|
|
273
|
+
window.addEventListener("resize", handleResize);
|
|
274
|
+
const observer = wrapperRef.current && "ResizeObserver" in window ? new ResizeObserver(updateInk) : null;
|
|
275
|
+
if (wrapperRef.current) observer?.observe(wrapperRef.current);
|
|
276
|
+
const initialTimer = setTimeout(scheduleScroll, 0);
|
|
277
|
+
return () => {
|
|
278
|
+
unmountedRef.current = true;
|
|
279
|
+
scrollContainer_2.removeEventListener("scroll", handleContainerScroll);
|
|
280
|
+
window.removeEventListener("resize", handleResize);
|
|
281
|
+
observer?.disconnect();
|
|
282
|
+
clearTimeout(initialTimer);
|
|
283
|
+
if (scrollEndTimerRef.current) clearTimeout(scrollEndTimerRef.current);
|
|
284
|
+
if (frameRef.current !== null) cancelAnimationFrame(frameRef.current);
|
|
285
|
+
scrollEndTimerRef.current = null;
|
|
286
|
+
frameRef.current = null;
|
|
287
|
+
clickScrollingRef.current = false;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
t20 = [
|
|
291
|
+
finishClickScrolling,
|
|
292
|
+
getContainer,
|
|
293
|
+
scheduleScroll,
|
|
294
|
+
updateInk
|
|
295
|
+
];
|
|
296
|
+
$[39] = finishClickScrolling;
|
|
297
|
+
$[40] = getContainer;
|
|
298
|
+
$[41] = scheduleScroll;
|
|
299
|
+
$[42] = t19;
|
|
300
|
+
$[43] = t20;
|
|
301
|
+
} else {
|
|
302
|
+
t19 = $[42];
|
|
303
|
+
t20 = $[43];
|
|
304
|
+
}
|
|
305
|
+
useEffect(t19, t20);
|
|
306
|
+
let t21;
|
|
307
|
+
if ($[44] !== bounds || $[45] !== offsetTop || $[46] !== scheduleScroll) {
|
|
308
|
+
t21 = [
|
|
309
|
+
bounds,
|
|
310
|
+
offsetTop,
|
|
311
|
+
scheduleScroll
|
|
312
|
+
];
|
|
313
|
+
$[44] = bounds;
|
|
314
|
+
$[45] = offsetTop;
|
|
315
|
+
$[46] = scheduleScroll;
|
|
316
|
+
$[47] = t21;
|
|
317
|
+
} else t21 = $[47];
|
|
318
|
+
useEffect(scheduleScroll, t21);
|
|
319
|
+
let t22;
|
|
320
|
+
if ($[48] !== activeLink || $[49] !== registerLink || $[50] !== scrollTo || $[51] !== unregisterLink) {
|
|
321
|
+
t22 = {
|
|
322
|
+
activeLink,
|
|
323
|
+
registerLink,
|
|
324
|
+
unregisterLink,
|
|
325
|
+
scrollTo
|
|
326
|
+
};
|
|
327
|
+
$[48] = activeLink;
|
|
328
|
+
$[49] = registerLink;
|
|
329
|
+
$[50] = scrollTo;
|
|
330
|
+
$[51] = unregisterLink;
|
|
331
|
+
$[52] = t22;
|
|
332
|
+
} else t22 = $[52];
|
|
333
|
+
const context = t22;
|
|
334
|
+
let t23;
|
|
335
|
+
if ($[53] !== affix || $[54] !== className) {
|
|
336
|
+
t23 = clsx("k-anchor-wrapper", { "k-anchor-affix": affix }, className);
|
|
337
|
+
$[53] = affix;
|
|
338
|
+
$[54] = className;
|
|
339
|
+
$[55] = t23;
|
|
340
|
+
} else t23 = $[55];
|
|
341
|
+
let t24;
|
|
342
|
+
if ($[56] !== affix || $[57] !== offsetTop) {
|
|
343
|
+
t24 = affix ? { top: offsetTop } : {};
|
|
344
|
+
$[56] = affix;
|
|
345
|
+
$[57] = offsetTop;
|
|
346
|
+
$[58] = t24;
|
|
347
|
+
} else t24 = $[58];
|
|
348
|
+
let t25;
|
|
349
|
+
if ($[59] !== style || $[60] !== t24) {
|
|
350
|
+
t25 = {
|
|
351
|
+
...style,
|
|
352
|
+
...t24
|
|
353
|
+
};
|
|
354
|
+
$[59] = style;
|
|
355
|
+
$[60] = t24;
|
|
356
|
+
$[61] = t25;
|
|
357
|
+
} else t25 = $[61];
|
|
358
|
+
let t26;
|
|
359
|
+
if ($[62] !== inkStyle) {
|
|
360
|
+
t26 = /* @__PURE__ */ jsx("span", {
|
|
361
|
+
className: "k-anchor-ink-ball",
|
|
362
|
+
style: inkStyle
|
|
363
|
+
});
|
|
364
|
+
$[62] = inkStyle;
|
|
365
|
+
$[63] = t26;
|
|
366
|
+
} else t26 = $[63];
|
|
367
|
+
let t27;
|
|
368
|
+
if ($[64] !== children || $[65] !== t26) {
|
|
369
|
+
t27 = /* @__PURE__ */ jsxs("div", {
|
|
370
|
+
className: "k-anchor",
|
|
371
|
+
children: [t26, children]
|
|
372
|
+
});
|
|
373
|
+
$[64] = children;
|
|
374
|
+
$[65] = t26;
|
|
375
|
+
$[66] = t27;
|
|
376
|
+
} else t27 = $[66];
|
|
377
|
+
let t28;
|
|
378
|
+
if ($[67] !== rest || $[68] !== t23 || $[69] !== t25 || $[70] !== t27) {
|
|
379
|
+
t28 = /* @__PURE__ */ jsx("div", {
|
|
380
|
+
...rest,
|
|
381
|
+
ref: wrapperRef,
|
|
382
|
+
className: t23,
|
|
383
|
+
style: t25,
|
|
384
|
+
children: t27
|
|
385
|
+
});
|
|
386
|
+
$[67] = rest;
|
|
387
|
+
$[68] = t23;
|
|
388
|
+
$[69] = t25;
|
|
389
|
+
$[70] = t27;
|
|
390
|
+
$[71] = t28;
|
|
391
|
+
} else t28 = $[71];
|
|
392
|
+
let t29;
|
|
393
|
+
if ($[72] !== context || $[73] !== t28) {
|
|
394
|
+
t29 = /* @__PURE__ */ jsx(AnchorContext.Provider, {
|
|
395
|
+
value: context,
|
|
396
|
+
children: t28
|
|
397
|
+
});
|
|
398
|
+
$[72] = context;
|
|
399
|
+
$[73] = t28;
|
|
400
|
+
$[74] = t29;
|
|
401
|
+
} else t29 = $[74];
|
|
402
|
+
return t29;
|
|
403
|
+
}
|
|
404
|
+
function _temp4(a, b) {
|
|
405
|
+
return a.offsetTop - b.offsetTop;
|
|
406
|
+
}
|
|
407
|
+
function _temp3(item) {
|
|
408
|
+
return item !== null;
|
|
409
|
+
}
|
|
410
|
+
function _temp2(element, scrollContainer) {
|
|
411
|
+
const rect = element.getBoundingClientRect();
|
|
412
|
+
if (scrollContainer === window) return rect.top + window.scrollY;
|
|
413
|
+
const containerElement = scrollContainer;
|
|
414
|
+
const containerRect = containerElement.getBoundingClientRect();
|
|
415
|
+
return rect.top - containerRect.top - containerElement.clientTop + containerElement.scrollTop;
|
|
416
|
+
}
|
|
417
|
+
function _temp(link) {
|
|
418
|
+
if (typeof document === "undefined") return null;
|
|
419
|
+
if (link.startsWith("#")) try {
|
|
420
|
+
return document.getElementById(decodeURIComponent(link.slice(1)));
|
|
421
|
+
} catch {
|
|
422
|
+
return null;
|
|
423
|
+
}
|
|
424
|
+
try {
|
|
425
|
+
return document.querySelector(link);
|
|
426
|
+
} catch {
|
|
427
|
+
return null;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
//#endregion
|
|
431
|
+
export { Anchor as default };
|