react-kui 3.0.0 → 3.1.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/behaviors.json +3 -3
- package/ai/cli.mjs +0 -0
- package/ai/kui-components.json +1552 -1280
- package/ai/mcp.mjs +0 -0
- package/es/_virtual/_rolldown/runtime.js +1 -1
- package/es/affix/index.js +1 -1
- package/es/alert/index.js +29 -15
- package/es/anchor/anchor-context.js +1 -1
- package/es/anchor/anchor-link.js +1 -1
- package/es/anchor/anchor.js +1 -1
- package/es/auto-complete/index.js +378 -437
- package/es/avatar/avatar-group-context.js +1 -1
- package/es/avatar/avatar-group.js +1 -1
- package/es/avatar/avatar.js +2 -2
- package/es/back-top/index.js +3 -3
- package/es/badge/index.js +6 -2
- package/es/base/teleport.js +19 -30
- package/es/base/transition-props.js +1 -1
- package/es/base/transition.js +3 -3
- package/es/breadcrumb/breadcrumb-context.js +1 -1
- package/es/breadcrumb/breadcrumb-item.js +1 -1
- package/es/breadcrumb/breadcrumb.js +1 -1
- package/es/button/button-group-context.js +1 -1
- package/es/button/button-group.js +1 -1
- package/es/button/button.js +2 -2
- package/es/calendar/index.js +1 -1
- package/es/card/index.js +1 -1
- package/es/carousel/carousel-context.js +1 -1
- package/es/carousel/carousel-item.js +1 -1
- package/es/carousel/carousel.js +1 -1
- package/es/cascader/index.js +104 -170
- package/es/check-card/check-card-group.js +1 -1
- package/es/check-card/check-card.js +143 -143
- package/es/check-card/context.js +1 -1
- package/es/checkbox/checkbox-group-context.js +1 -1
- package/es/checkbox/checkbox-group.js +1 -1
- package/es/checkbox/checkbox.js +131 -112
- package/es/checkbox/index.js +1 -1
- package/es/collapse/collapse-panel.js +2 -2
- package/es/collapse/collapse.js +96 -103
- package/es/color-picker/alpha.js +81 -63
- package/es/color-picker/hue.js +69 -51
- package/es/color-picker/index.js +79 -128
- package/es/color-picker/mode.js +1 -1
- package/es/color-picker/paint.js +85 -67
- package/es/color-picker/presets.js +1 -1
- package/es/components.js +4 -2
- package/es/config/config-context.js +1 -1
- package/es/config/context.js +1 -1
- package/es/config/index.js +1 -1
- package/es/config/size-context.js +1 -1
- package/es/config/use-config-appearance.js +1 -1
- package/es/const/var.js +1 -1
- package/es/date-picker/index.js +591 -678
- package/es/descriptions/descriptions-item.js +1 -1
- package/es/descriptions/descriptions.js +2 -2
- package/es/divider/index.js +1 -1
- package/es/drawer/index.js +193 -190
- package/es/dropdown/dropdown-button.js +1 -1
- package/es/dropdown/dropdown-context.js +1 -1
- package/es/dropdown/dropdown.js +173 -331
- package/es/dropdown/trigger.js +1 -1
- package/es/empty/index.js +1 -1
- package/es/feature-card/index.js +1 -1
- package/es/feedback-panel/index.js +1 -1
- package/es/flame-wrap/index.js +1 -1
- package/es/flame-wrap/types.js +1 -1
- package/es/flex/index.js +1 -1
- package/es/form/field-context.js +1 -1
- package/es/form/form-context.js +1 -1
- package/es/form/form-item.js +2 -2
- package/es/form/form.js +1 -1
- package/es/form/utils.js +1 -1
- package/es/grid/grid-item.js +1 -1
- package/es/grid/grid.js +1 -1
- package/es/grid/useBreakpoint.js +1 -1
- package/es/icon/index.js +1 -1
- package/es/image/group.js +1 -1
- package/es/image/image-group-context.js +1 -1
- package/es/image/image.js +1 -1
- package/es/image/instance.js +1 -1
- package/es/image/preview.js +2 -2
- package/es/image/utils.js +1 -1
- package/es/index.js +3 -2
- package/es/input/index.js +1 -1
- package/es/input/input-box.js +1 -1
- package/es/input/input-group.js +2 -2
- package/es/input/input.js +1 -1
- package/es/input/textarea.js +1 -1
- package/es/input-number/index.js +1 -1
- package/es/input-otp/index.js +2 -1
- package/es/input-tag/index.js +13 -43
- package/es/kanban/index.js +1 -1
- package/es/layout/index.js +1 -1
- package/es/layout/layout-context.js +1 -1
- package/es/list-panel/index.js +1 -1
- package/es/loading/index.js +1 -1
- package/es/loading/loading-bar.js +1 -1
- package/es/locale/de.js +1 -1
- package/es/locale/el.js +1 -1
- package/es/locale/en.js +1 -1
- package/es/locale/fr.js +1 -1
- package/es/locale/it.js +1 -1
- package/es/locale/ja.js +1 -1
- package/es/locale/ko.js +1 -1
- package/es/locale/ru.js +1 -1
- package/es/locale/th.js +1 -1
- package/es/locale/uk.js +1 -1
- package/es/locale/vi.js +1 -1
- package/es/locale/zh-CN.js +1 -1
- package/es/locale/zh-TW.js +1 -1
- package/es/mentions/index.js +341 -387
- package/es/menu/menu-context.js +1 -1
- package/es/menu/menu-divider.js +1 -1
- package/es/menu/menu-group.js +1 -1
- package/es/menu/menu-item.js +3 -3
- package/es/menu/menu-keyboard.js +1 -1
- package/es/menu/menu.js +215 -220
- package/es/menu/recursive-menu.js +1 -1
- package/es/menu/sub-menu.js +3 -3
- package/es/message/index.js +1 -1
- package/es/modal/api.js +1 -1
- package/es/modal/modal.js +247 -244
- package/es/modal/toast.js +1 -1
- package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +1 -1
- package/es/notice/container.js +1 -1
- package/es/notice/content.js +1 -1
- package/es/notice/index.js +1 -1
- package/es/notice/instance.js +1 -1
- package/es/page/index.js +3 -3
- package/es/page-header/index.js +1 -1
- package/es/popconfirm/index.js +89 -241
- package/es/poptip/index.js +83 -243
- package/es/popup/index.js +429 -0
- package/es/popup/layers.js +33 -0
- package/es/progress/index.js +1 -1
- package/es/qrcode/index.js +1 -1
- package/es/radio/radio-button.js +53 -53
- package/es/radio/radio-group-context.js +1 -1
- package/es/radio/radio-group.js +1 -1
- package/es/radio/radio.js +110 -91
- package/es/rate/index.js +58 -57
- package/es/rate/star.js +1 -1
- package/es/result/index.js +1 -1
- package/es/ripple/index.js +1 -1
- package/es/ripple/types.js +1 -1
- package/es/row-col/col.js +1 -1
- package/es/row-col/row.js +1 -1
- package/es/segmented/index.js +1 -1
- package/es/select/option.js +69 -61
- package/es/select/select.js +78 -213
- package/es/skeleton/skeleton-avatar.js +1 -1
- package/es/skeleton/skeleton-button.js +1 -1
- package/es/skeleton/skeleton-image.js +1 -1
- package/es/skeleton/skeleton-text.js +1 -1
- package/es/skeleton/skeleton.js +1 -1
- package/es/skeleton/use-skeleton-loading.js +1 -1
- package/es/slider/index.js +89 -55
- package/es/slider/thumb.js +2 -1
- package/es/space/index.js +2 -2
- package/es/spin/index.js +1 -1
- package/es/splitter/splitter-panel.js +1 -1
- package/es/splitter/splitter.js +1 -1
- package/es/stat-card/countup.js +8 -4
- package/es/stat-card/rollup.js +122 -0
- package/es/stat-card/stat-card.js +1 -1
- package/es/stat-card/stat-number.js +1 -1
- package/es/stat-card/utils/countup.js +2 -2
- package/es/stat-card/utils/odometer.js +104 -107
- package/es/steps/index.js +1 -1
- package/es/switch/index.js +7 -6
- package/es/table/column-setting.js +1 -1
- package/es/table/index.js +33 -29
- package/es/table/utils.js +1 -1
- package/es/tabs/tab-panel.js +1 -1
- package/es/tabs/tabs.js +15 -6
- package/es/tag/index.js +9 -5
- package/es/time-line/timeline-item.js +1 -1
- package/es/time-line/timeline.js +1 -1
- package/es/tooltip/index.js +127 -248
- package/es/tour/index.js +198 -193
- package/es/transfer/index.js +245 -246
- package/es/tree/index.js +72 -67
- package/es/tree/utils.js +1 -1
- package/es/tree-select/index.js +562 -655
- package/es/typography/index.js +1 -1
- package/es/upload/file-list.js +3 -1
- package/es/upload/index.js +8 -8
- package/es/upload/picture-sort.js +1 -1
- package/es/upload/selector.js +121 -116
- package/es/utils/checked.js +1 -1
- package/es/utils/color.js +1 -1
- package/es/utils/number.js +1 -1
- package/es/utils/placement.js +1 -1
- package/es/utils/popup.js +42 -0
- package/es/utils/react-node.js +1 -1
- package/es/utils/selection-tags.js +55 -0
- package/es/utils/share.js +1 -1
- package/es/utils/theme.js +1 -1
- package/es/utils/transition.js +1 -1
- package/es/utils/use-value.js +1 -1
- package/es/virtual-list/index.js +1 -1
- package/es/virtual-list/range.js +1 -1
- package/es/watermark/index.js +1 -1
- package/lib/index.cjs +2 -2
- package/lib/locale/de.cjs +1 -1
- package/lib/locale/el.cjs +1 -1
- package/lib/locale/en.cjs +1 -1
- package/lib/locale/fr.cjs +1 -1
- package/lib/locale/it.cjs +1 -1
- package/lib/locale/ja.cjs +1 -1
- package/lib/locale/ko.cjs +1 -1
- package/lib/locale/ru.cjs +1 -1
- package/lib/locale/th.cjs +1 -1
- package/lib/locale/uk.cjs +1 -1
- package/lib/locale/vi.cjs +1 -1
- package/lib/locale/zh-CN.cjs +1 -1
- package/lib/locale/zh-TW.cjs +1 -1
- package/package.json +32 -29
- package/style/base.css +1 -1
- package/style/components.css +2 -2
- package/style/index.css +2 -2
- package/style/theme.css +2 -2
- package/types/affix/index.d.cts +1 -1
- package/types/affix/index.d.ts +1 -1
- package/types/alert/index.d.cts +2 -1
- package/types/alert/index.d.ts +2 -1
- package/types/anchor/anchor-link.d.cts +1 -1
- package/types/anchor/anchor-link.d.ts +1 -1
- package/types/anchor/anchor.d.cts +1 -1
- package/types/anchor/anchor.d.ts +1 -1
- package/types/auto-complete/index.d.cts +1 -2
- package/types/auto-complete/index.d.ts +1 -2
- package/types/avatar/avatar-group.d.cts +1 -1
- package/types/avatar/avatar-group.d.ts +1 -1
- package/types/avatar/avatar.d.cts +1 -1
- package/types/avatar/avatar.d.ts +1 -1
- package/types/back-top/index.d.cts +1 -1
- package/types/back-top/index.d.ts +1 -1
- package/types/badge/index.d.cts +1 -1
- package/types/badge/index.d.ts +1 -1
- package/types/base/transition.d.cts +1 -0
- package/types/base/transition.d.ts +1 -0
- package/types/breadcrumb/breadcrumb-item.d.cts +1 -1
- package/types/breadcrumb/breadcrumb-item.d.ts +1 -1
- package/types/breadcrumb/breadcrumb.d.cts +1 -1
- package/types/breadcrumb/breadcrumb.d.ts +1 -1
- package/types/button/button-group.d.cts +1 -1
- package/types/button/button-group.d.ts +1 -1
- package/types/button/button.d.cts +1 -1
- package/types/button/button.d.ts +1 -1
- package/types/calendar/index.d.cts +1 -1
- package/types/calendar/index.d.ts +1 -1
- package/types/card/index.d.cts +2 -2
- package/types/card/index.d.ts +2 -2
- package/types/carousel/carousel-item.d.cts +1 -1
- package/types/carousel/carousel-item.d.ts +1 -1
- package/types/carousel/carousel.d.cts +1 -1
- package/types/carousel/carousel.d.ts +1 -1
- package/types/cascader/index.d.cts +1 -1
- package/types/cascader/index.d.ts +1 -1
- package/types/cascader/types.d.cts +1 -2
- package/types/cascader/types.d.ts +1 -2
- package/types/check-card/types.d.cts +2 -3
- package/types/check-card/types.d.ts +2 -3
- package/types/checkbox/checkbox-group.d.cts +1 -1
- package/types/checkbox/checkbox-group.d.ts +1 -1
- package/types/checkbox/checkbox.d.cts +1 -2
- package/types/checkbox/checkbox.d.ts +1 -2
- package/types/checkbox/index.d.cts +1 -1
- package/types/checkbox/index.d.ts +1 -1
- package/types/collapse/collapse-panel.d.cts +1 -1
- package/types/collapse/collapse-panel.d.ts +1 -1
- package/types/collapse/collapse.d.cts +1 -2
- package/types/collapse/collapse.d.ts +1 -2
- package/types/color-picker/alpha.d.cts +2 -1
- package/types/color-picker/alpha.d.ts +2 -1
- package/types/color-picker/hue.d.cts +2 -1
- package/types/color-picker/hue.d.ts +2 -1
- package/types/color-picker/index.d.cts +3 -4
- package/types/color-picker/index.d.ts +3 -4
- package/types/color-picker/paint.d.cts +2 -1
- package/types/color-picker/paint.d.ts +2 -1
- package/types/components.d.cts +17 -13
- package/types/components.d.ts +17 -13
- package/types/date-picker/index.d.cts +3 -4
- package/types/date-picker/index.d.ts +3 -4
- package/types/descriptions/descriptions.d.cts +1 -1
- package/types/descriptions/descriptions.d.ts +1 -1
- package/types/divider/index.d.cts +1 -1
- package/types/divider/index.d.ts +1 -1
- package/types/drawer/index.d.cts +0 -1
- package/types/drawer/index.d.ts +0 -1
- package/types/dropdown/dropdown-button.d.cts +1 -1
- package/types/dropdown/dropdown-button.d.ts +1 -1
- package/types/dropdown/dropdown.d.cts +1 -2
- package/types/dropdown/dropdown.d.ts +1 -2
- package/types/empty/index.d.cts +1 -1
- package/types/empty/index.d.ts +1 -1
- package/types/feature-card/index.d.cts +1 -1
- package/types/feature-card/index.d.ts +1 -1
- package/types/feedback-panel/index.d.cts +1 -1
- package/types/feedback-panel/index.d.ts +1 -1
- package/types/flex/index.d.cts +1 -1
- package/types/flex/index.d.ts +1 -1
- package/types/form/form.d.cts +1 -1
- package/types/form/form.d.ts +1 -1
- package/types/grid/grid-item.d.cts +1 -1
- package/types/grid/grid-item.d.ts +1 -1
- package/types/grid/grid.d.cts +1 -1
- package/types/grid/grid.d.ts +1 -1
- package/types/icon/index.d.cts +1 -1
- package/types/icon/index.d.ts +1 -1
- package/types/image/group.d.cts +1 -1
- package/types/image/group.d.ts +1 -1
- package/types/image/image.d.cts +1 -1
- package/types/image/image.d.ts +1 -1
- package/types/input/index.d.cts +1 -1
- package/types/input/index.d.ts +1 -1
- package/types/input/input-box.d.cts +1 -1
- package/types/input/input-box.d.ts +1 -1
- package/types/input/input-group.d.cts +1 -1
- package/types/input/input-group.d.ts +1 -1
- package/types/input/input.d.cts +1 -1
- package/types/input/input.d.ts +1 -1
- package/types/input/textarea.d.cts +1 -1
- package/types/input/textarea.d.ts +1 -1
- package/types/input-number/index.d.cts +1 -1
- package/types/input-number/index.d.ts +1 -1
- package/types/input-otp/index.d.cts +1 -1
- package/types/input-otp/index.d.ts +1 -1
- package/types/input-tag/index.d.cts +1 -1
- package/types/input-tag/index.d.ts +1 -1
- package/types/kanban/index.d.cts +1 -1
- package/types/kanban/index.d.ts +1 -1
- package/types/layout/index.d.cts +2 -2
- package/types/layout/index.d.ts +2 -2
- package/types/list-panel/index.d.cts +1 -1
- package/types/list-panel/index.d.ts +1 -1
- package/types/mentions/index.d.cts +1 -1
- package/types/mentions/index.d.ts +1 -1
- package/types/menu/menu.d.cts +1 -2
- package/types/menu/menu.d.ts +1 -2
- package/types/modal/modal.d.cts +1 -2
- package/types/modal/modal.d.ts +1 -2
- package/types/page/index.d.cts +1 -1
- package/types/page/index.d.ts +1 -1
- package/types/page-header/index.d.cts +1 -1
- package/types/page-header/index.d.ts +1 -1
- package/types/popconfirm/index.d.cts +1 -2
- package/types/popconfirm/index.d.ts +1 -2
- package/types/poptip/index.d.cts +1 -2
- package/types/poptip/index.d.ts +1 -2
- package/types/popup/index.d.cts +48 -0
- package/types/popup/index.d.ts +48 -0
- package/types/popup/layers.d.cts +9 -0
- package/types/popup/layers.d.ts +9 -0
- package/types/popup/types.d.cts +15 -0
- package/types/popup/types.d.ts +15 -0
- package/types/progress/index.d.cts +1 -1
- package/types/progress/index.d.ts +1 -1
- package/types/qrcode/index.d.cts +1 -1
- package/types/qrcode/index.d.ts +1 -1
- package/types/radio/index.d.cts +1 -0
- package/types/radio/index.d.ts +1 -0
- package/types/radio/radio-button.d.cts +1 -2
- package/types/radio/radio-button.d.ts +1 -2
- package/types/radio/radio-group.d.cts +1 -1
- package/types/radio/radio-group.d.ts +1 -1
- package/types/radio/radio.d.cts +1 -2
- package/types/radio/radio.d.ts +1 -2
- package/types/rate/index.d.cts +1 -1
- package/types/rate/index.d.ts +1 -1
- package/types/result/index.d.cts +1 -1
- package/types/result/index.d.ts +1 -1
- package/types/row-col/col.d.cts +1 -1
- package/types/row-col/col.d.ts +1 -1
- package/types/row-col/row.d.cts +1 -1
- package/types/row-col/row.d.ts +1 -1
- package/types/segmented/index.d.cts +1 -1
- package/types/segmented/index.d.ts +1 -1
- package/types/select/index.d.cts +2 -2
- package/types/select/index.d.ts +2 -2
- package/types/select/option.d.cts +1 -1
- package/types/select/option.d.ts +1 -1
- package/types/select/select.d.cts +1 -2
- package/types/select/select.d.ts +1 -2
- package/types/skeleton/skeleton-avatar.d.cts +1 -1
- package/types/skeleton/skeleton-avatar.d.ts +1 -1
- package/types/skeleton/skeleton-button.d.cts +1 -1
- package/types/skeleton/skeleton-button.d.ts +1 -1
- package/types/skeleton/skeleton-image.d.cts +1 -1
- package/types/skeleton/skeleton-image.d.ts +1 -1
- package/types/skeleton/skeleton-text.d.cts +1 -1
- package/types/skeleton/skeleton-text.d.ts +1 -1
- package/types/skeleton/skeleton.d.cts +1 -1
- package/types/skeleton/skeleton.d.ts +1 -1
- package/types/slider/index.d.cts +1 -1
- package/types/slider/index.d.ts +1 -1
- package/types/space/index.d.cts +1 -1
- package/types/space/index.d.ts +1 -1
- package/types/spin/index.d.cts +1 -1
- package/types/spin/index.d.ts +1 -1
- package/types/splitter/splitter-panel.d.cts +1 -1
- package/types/splitter/splitter-panel.d.ts +1 -1
- package/types/splitter/splitter.d.cts +1 -1
- package/types/splitter/splitter.d.ts +1 -1
- package/types/stat-card/countup.d.cts +1 -1
- package/types/stat-card/countup.d.ts +1 -1
- package/types/stat-card/rollup.d.cts +3 -2
- package/types/stat-card/rollup.d.ts +3 -2
- package/types/stat-card/stat-card.d.cts +1 -1
- package/types/stat-card/stat-card.d.ts +1 -1
- package/types/stat-card/stat-number.d.cts +1 -1
- package/types/stat-card/stat-number.d.ts +1 -1
- package/types/stat-card/utils/countup.d.cts +1 -1
- package/types/stat-card/utils/countup.d.ts +1 -1
- package/types/stat-card/utils/odometer.d.cts +7 -4
- package/types/stat-card/utils/odometer.d.ts +7 -4
- package/types/steps/index.d.cts +1 -1
- package/types/steps/index.d.ts +1 -1
- package/types/switch/index.d.cts +1 -2
- package/types/switch/index.d.ts +1 -2
- package/types/table/index.d.cts +1 -1
- package/types/table/index.d.ts +1 -1
- package/types/table/types.d.cts +2 -4
- package/types/table/types.d.ts +2 -4
- package/types/tabs/index.d.cts +1 -0
- package/types/tabs/index.d.ts +1 -0
- package/types/tabs/tab-panel.d.cts +1 -1
- package/types/tabs/tab-panel.d.ts +1 -1
- package/types/tabs/tabs.d.cts +1 -1
- package/types/tabs/tabs.d.ts +1 -1
- package/types/tag/index.d.cts +2 -1
- package/types/tag/index.d.ts +2 -1
- package/types/time-line/timeline-item.d.cts +1 -1
- package/types/time-line/timeline-item.d.ts +1 -1
- package/types/time-line/timeline.d.cts +1 -1
- package/types/time-line/timeline.d.ts +1 -1
- package/types/tooltip/index.d.cts +2 -2
- package/types/tooltip/index.d.ts +2 -2
- package/types/tour/index.d.cts +0 -2
- package/types/tour/index.d.ts +0 -2
- package/types/transfer/index.d.cts +2 -3
- package/types/transfer/index.d.ts +2 -3
- package/types/tree/index.d.cts +2 -4
- package/types/tree/index.d.ts +2 -4
- package/types/tree-select/index.d.cts +2 -3
- package/types/tree-select/index.d.ts +2 -3
- package/types/typography/index.d.cts +1 -1
- package/types/typography/index.d.ts +1 -1
- package/types/upload/index.d.cts +1 -2
- package/types/upload/index.d.ts +1 -2
- package/types/upload/selector.d.cts +1 -1
- package/types/upload/selector.d.ts +1 -1
- package/types/utils/popup.d.cts +11 -0
- package/types/utils/popup.d.ts +11 -0
- package/types/utils/selection-tags.d.cts +19 -0
- package/types/utils/selection-tags.d.ts +19 -0
- package/types/virtual-list/index.d.cts +1 -1
- package/types/virtual-list/index.d.ts +1 -1
- package/types/watermark/index.d.cts +1 -1
- package/types/watermark/index.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.1.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -8,15 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
import zh_CN_default from "../locale/zh-CN.js";
|
|
10
10
|
import { ConfigContext } from "../config/config-context.js";
|
|
11
|
+
import Popup from "../popup/index.js";
|
|
11
12
|
import { useConfigAppearance } from "../config/use-config-appearance.js";
|
|
12
13
|
import { Loading } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
13
14
|
import Icon from "../icon/index.js";
|
|
14
15
|
import { useValue } from "../utils/use-value.js";
|
|
15
16
|
import { createFormFieldComponent } from "../form/field-context.js";
|
|
16
|
-
import Teleport from "../base/teleport.js";
|
|
17
|
-
import { Transition } from "../base/transition.js";
|
|
18
17
|
import input_default from "../input/input.js";
|
|
19
|
-
import { setPlacement } from "../utils/placement.js";
|
|
20
18
|
import { c } from "react/compiler-runtime";
|
|
21
19
|
import clsx from "clsx";
|
|
22
20
|
import { useContext, useEffect, useEffectEvent, useId, useRef, useState } from "react";
|
|
@@ -24,7 +22,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
24
22
|
//#region components/auto-complete/index.tsx
|
|
25
23
|
var EMPTY_OPTIONS = [];
|
|
26
24
|
var AutoComplete = (t0) => {
|
|
27
|
-
const $ = c(
|
|
25
|
+
const $ = c(165);
|
|
28
26
|
let className;
|
|
29
27
|
let disabled;
|
|
30
28
|
let loadingText;
|
|
@@ -48,11 +46,10 @@ var AutoComplete = (t0) => {
|
|
|
48
46
|
let t3;
|
|
49
47
|
let t4;
|
|
50
48
|
let t5;
|
|
51
|
-
let t6;
|
|
52
49
|
let themeProp;
|
|
53
50
|
let value;
|
|
54
51
|
if ($[0] !== t0) {
|
|
55
|
-
({value, options: t1, open,
|
|
52
|
+
({value, options: t1, open, showOnEmpty: t2, clearable: t3, loading: t4, loadingText, size: sizeProp, shape: shapeProp, theme: themeProp, filterOption: t5, onChange, onClear, onSearch, onSelect, onOpenChange, className, disabled, readOnly, onFocus, onBlur, onKeyDown, onCompositionStart, onCompositionEnd, ...rest} = t0);
|
|
56
53
|
$[0] = t0;
|
|
57
54
|
$[1] = className;
|
|
58
55
|
$[2] = disabled;
|
|
@@ -77,9 +74,8 @@ var AutoComplete = (t0) => {
|
|
|
77
74
|
$[21] = t3;
|
|
78
75
|
$[22] = t4;
|
|
79
76
|
$[23] = t5;
|
|
80
|
-
$[24] =
|
|
81
|
-
$[25] =
|
|
82
|
-
$[26] = value;
|
|
77
|
+
$[24] = themeProp;
|
|
78
|
+
$[25] = value;
|
|
83
79
|
} else {
|
|
84
80
|
className = $[1];
|
|
85
81
|
disabled = $[2];
|
|
@@ -104,173 +100,122 @@ var AutoComplete = (t0) => {
|
|
|
104
100
|
t3 = $[21];
|
|
105
101
|
t4 = $[22];
|
|
106
102
|
t5 = $[23];
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
value = $[26];
|
|
103
|
+
themeProp = $[24];
|
|
104
|
+
value = $[25];
|
|
110
105
|
}
|
|
111
106
|
const options = t1 === void 0 ? EMPTY_OPTIONS : t1;
|
|
112
|
-
const
|
|
113
|
-
const
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
const filterOption = t6 === void 0 ? true : t6;
|
|
107
|
+
const showOnEmpty = t2 === void 0 ? false : t2;
|
|
108
|
+
const clearable = t3 === void 0 ? false : t3;
|
|
109
|
+
const loading = t4 === void 0 ? false : t4;
|
|
110
|
+
const filterOption = t5 === void 0 ? true : t5;
|
|
117
111
|
const inheritedAppearance = useConfigAppearance();
|
|
118
112
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
119
113
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
120
114
|
const theme = themeProp ?? inheritedAppearance.theme ?? "fill";
|
|
121
115
|
const locale = useContext(ConfigContext)?.locale || zh_CN_default;
|
|
122
|
-
const
|
|
123
|
-
let
|
|
124
|
-
if ($[
|
|
125
|
-
let
|
|
126
|
-
if ($[
|
|
127
|
-
|
|
128
|
-
$[
|
|
129
|
-
} else
|
|
130
|
-
|
|
116
|
+
const t6 = useId();
|
|
117
|
+
let t7;
|
|
118
|
+
if ($[26] !== t6) {
|
|
119
|
+
let t8;
|
|
120
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
121
|
+
t8 = /:/g;
|
|
122
|
+
$[28] = t8;
|
|
123
|
+
} else t8 = $[28];
|
|
124
|
+
t7 = t6.replace(t8, "");
|
|
125
|
+
$[26] = t6;
|
|
131
126
|
$[27] = t7;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
$[30] =
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const normalized = t9;
|
|
127
|
+
} else t7 = $[27];
|
|
128
|
+
const listboxId = `k-auto-complete-listbox-${t7}`;
|
|
129
|
+
let t8;
|
|
130
|
+
if ($[29] !== options) {
|
|
131
|
+
t8 = options.map(_temp);
|
|
132
|
+
$[29] = options;
|
|
133
|
+
$[30] = t8;
|
|
134
|
+
} else t8 = $[30];
|
|
135
|
+
const normalized = t8;
|
|
142
136
|
const initialCurrent = value ?? "";
|
|
143
|
-
const initiallyOpen = open ??
|
|
144
|
-
let
|
|
145
|
-
if ($[
|
|
146
|
-
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
} else
|
|
155
|
-
const initialShownOptions =
|
|
137
|
+
const initiallyOpen = open ?? false;
|
|
138
|
+
let t9;
|
|
139
|
+
if ($[31] !== filterOption || $[32] !== initialCurrent || $[33] !== initiallyOpen || $[34] !== loading || $[35] !== normalized || $[36] !== showOnEmpty) {
|
|
140
|
+
t9 = initiallyOpen && (initialCurrent || showOnEmpty) && !loading ? normalized.filter((option) => typeof filterOption === "function" ? filterOption(initialCurrent, option) : !filterOption || option.value.toLocaleLowerCase().includes(initialCurrent.toLocaleLowerCase())) : [];
|
|
141
|
+
$[31] = filterOption;
|
|
142
|
+
$[32] = initialCurrent;
|
|
143
|
+
$[33] = initiallyOpen;
|
|
144
|
+
$[34] = loading;
|
|
145
|
+
$[35] = normalized;
|
|
146
|
+
$[36] = showOnEmpty;
|
|
147
|
+
$[37] = t9;
|
|
148
|
+
} else t9 = $[37];
|
|
149
|
+
const initialShownOptions = t9;
|
|
156
150
|
const [innerValue, setInnerValue] = useValue(value, _temp2);
|
|
157
|
-
const [innerOpen, setInnerOpen] =
|
|
158
|
-
const [rendered, setRendered] = useState(initiallyOpen && (loading || initialShownOptions.length > 0));
|
|
159
|
-
const [positioned, setPositioned] = useState(false);
|
|
151
|
+
const [innerOpen, setInnerOpen] = useValue(open, _temp3);
|
|
160
152
|
const [active, setActive] = useState(-1);
|
|
161
153
|
const [shownOptions, setShownOptions] = useState(initialShownOptions);
|
|
162
154
|
const [suppressRemoteOptions, setSuppressRemoteOptions] = useState(false);
|
|
163
155
|
const [syncedOpenChange, setSyncedOpenChange] = useState(null);
|
|
164
|
-
let t11;
|
|
165
|
-
if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
|
|
166
|
-
t11 = {
|
|
167
|
-
left: 0,
|
|
168
|
-
top: 0,
|
|
169
|
-
origin: "left top",
|
|
170
|
-
width: 0
|
|
171
|
-
};
|
|
172
|
-
$[39] = t11;
|
|
173
|
-
} else t11 = $[39];
|
|
174
|
-
const [position, setPosition] = useState(t11);
|
|
175
156
|
const rootRef = useRef(null);
|
|
176
157
|
const dropdownRef = useRef(null);
|
|
177
158
|
const blurTimer = useRef(void 0);
|
|
178
159
|
const composing = useRef(false);
|
|
179
|
-
const placementRef = useRef("bottom-left");
|
|
180
|
-
const originRef = useRef("left top");
|
|
181
|
-
const topRef = useRef(0);
|
|
182
|
-
const leftRef = useRef(0);
|
|
183
160
|
const current = innerValue;
|
|
184
|
-
const requestedOpen =
|
|
161
|
+
const requestedOpen = innerOpen;
|
|
185
162
|
const visible = (loading || !suppressRemoteOptions && shownOptions.length > 0) && requestedOpen;
|
|
186
|
-
let
|
|
187
|
-
if ($[
|
|
188
|
-
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
} else
|
|
193
|
-
const getMatches =
|
|
194
|
-
let
|
|
195
|
-
if ($[
|
|
196
|
-
|
|
197
|
-
if (
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
if (open === void 0) setInnerOpen(next_0);
|
|
204
|
-
if (!next_0) setActive(-1);
|
|
205
|
-
onOpenChange?.(next_0);
|
|
163
|
+
let t10;
|
|
164
|
+
if ($[38] !== filterOption || $[39] !== normalized) {
|
|
165
|
+
t10 = (input) => normalized.filter((option_0) => typeof filterOption === "function" ? filterOption(input, option_0) : !filterOption || option_0.value.toLocaleLowerCase().includes(input.toLocaleLowerCase()));
|
|
166
|
+
$[38] = filterOption;
|
|
167
|
+
$[39] = normalized;
|
|
168
|
+
$[40] = t10;
|
|
169
|
+
} else t10 = $[40];
|
|
170
|
+
const getMatches = t10;
|
|
171
|
+
let t11;
|
|
172
|
+
if ($[41] !== disabled || $[42] !== loading || $[43] !== onOpenChange || $[44] !== readOnly || $[45] !== setInnerOpen || $[46] !== suppressRemoteOptions) {
|
|
173
|
+
t11 = (next_1) => {
|
|
174
|
+
if (next_1 && (disabled || readOnly)) return;
|
|
175
|
+
if (next_1 && suppressRemoteOptions && !loading) return;
|
|
176
|
+
setInnerOpen(next_1);
|
|
177
|
+
if (!next_1) setActive(-1);
|
|
178
|
+
onOpenChange?.(next_1);
|
|
206
179
|
};
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
} else
|
|
215
|
-
const setOpen =
|
|
216
|
-
let
|
|
217
|
-
if ($[
|
|
218
|
-
|
|
180
|
+
$[41] = disabled;
|
|
181
|
+
$[42] = loading;
|
|
182
|
+
$[43] = onOpenChange;
|
|
183
|
+
$[44] = readOnly;
|
|
184
|
+
$[45] = setInnerOpen;
|
|
185
|
+
$[46] = suppressRemoteOptions;
|
|
186
|
+
$[47] = t11;
|
|
187
|
+
} else t11 = $[47];
|
|
188
|
+
const setOpen = t11;
|
|
189
|
+
let t12;
|
|
190
|
+
if ($[48] !== getMatches) {
|
|
191
|
+
t12 = (input_0) => {
|
|
219
192
|
const matches = getMatches(input_0);
|
|
220
193
|
if (matches.length) setShownOptions(matches);
|
|
221
194
|
return matches.length > 0;
|
|
222
195
|
};
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
} else
|
|
226
|
-
const commitMatches =
|
|
227
|
-
const syncOpen = (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
if (!requestedOpen) setPositioned(false);
|
|
231
|
-
}
|
|
232
|
-
if (open === void 0) setInnerOpen(next_1);
|
|
233
|
-
if (!next_1) setActive(-1);
|
|
196
|
+
$[48] = getMatches;
|
|
197
|
+
$[49] = t12;
|
|
198
|
+
} else t12 = $[49];
|
|
199
|
+
const commitMatches = t12;
|
|
200
|
+
const syncOpen = (next_2) => {
|
|
201
|
+
setInnerOpen(next_2);
|
|
202
|
+
if (!next_2) setActive(-1);
|
|
234
203
|
setSyncedOpenChange((state) => ({
|
|
235
|
-
value:
|
|
204
|
+
value: next_2,
|
|
236
205
|
revision: (state?.revision ?? 0) + 1
|
|
237
206
|
}));
|
|
238
207
|
};
|
|
239
|
-
let
|
|
240
|
-
if ($[
|
|
241
|
-
|
|
242
|
-
if (!rootRef.current || !dropdownRef.current) return;
|
|
243
|
-
setPlacement({
|
|
244
|
-
refSelection: rootRef,
|
|
245
|
-
refPopper: dropdownRef,
|
|
246
|
-
currentPlacement: placementRef,
|
|
247
|
-
transOrigin: originRef,
|
|
248
|
-
top: topRef,
|
|
249
|
-
left: leftRef,
|
|
250
|
-
offset: 6
|
|
251
|
-
});
|
|
252
|
-
setPosition({
|
|
253
|
-
left: leftRef.current,
|
|
254
|
-
top: topRef.current,
|
|
255
|
-
origin: originRef.current,
|
|
256
|
-
width: rootRef.current.offsetWidth
|
|
257
|
-
});
|
|
258
|
-
setPositioned(true);
|
|
259
|
-
};
|
|
260
|
-
$[52] = t15;
|
|
261
|
-
} else t15 = $[52];
|
|
262
|
-
const updatePosition = t15;
|
|
263
|
-
let t16;
|
|
264
|
-
if ($[53] !== loading || $[54] !== normalized) {
|
|
265
|
-
t16 = {
|
|
208
|
+
let t13;
|
|
209
|
+
if ($[50] !== loading || $[51] !== normalized) {
|
|
210
|
+
t13 = {
|
|
266
211
|
loading,
|
|
267
212
|
normalized
|
|
268
213
|
};
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
} else
|
|
273
|
-
const [previousRemoteState, setPreviousRemoteState] = useState(
|
|
214
|
+
$[50] = loading;
|
|
215
|
+
$[51] = normalized;
|
|
216
|
+
$[52] = t13;
|
|
217
|
+
} else t13 = $[52];
|
|
218
|
+
const [previousRemoteState, setPreviousRemoteState] = useState(t13);
|
|
274
219
|
if (previousRemoteState.loading !== loading || previousRemoteState.normalized !== normalized) {
|
|
275
220
|
setPreviousRemoteState({
|
|
276
221
|
loading,
|
|
@@ -288,171 +233,144 @@ var AutoComplete = (t0) => {
|
|
|
288
233
|
syncOpen(matched);
|
|
289
234
|
}
|
|
290
235
|
}
|
|
291
|
-
|
|
292
|
-
if (
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
236
|
+
const [previousOpen, setPreviousOpen] = useState(open);
|
|
237
|
+
if (previousOpen !== open) {
|
|
238
|
+
setPreviousOpen(open);
|
|
239
|
+
if (open) {
|
|
240
|
+
setShownOptions(current || showOnEmpty ? getMatches(current) : []);
|
|
241
|
+
setSuppressRemoteOptions(false);
|
|
242
|
+
} else setActive(-1);
|
|
243
|
+
}
|
|
244
|
+
let t14;
|
|
245
|
+
if ($[53] !== onOpenChange) {
|
|
246
|
+
t14 = (next_3) => onOpenChange?.(next_3);
|
|
247
|
+
$[53] = onOpenChange;
|
|
248
|
+
$[54] = t14;
|
|
249
|
+
} else t14 = $[54];
|
|
250
|
+
const emitSyncedOpen = useEffectEvent(t14);
|
|
251
|
+
let t15;
|
|
252
|
+
if ($[55] !== emitSyncedOpen || $[56] !== syncedOpenChange) {
|
|
253
|
+
t15 = () => {
|
|
301
254
|
if (syncedOpenChange) emitSyncedOpen(syncedOpenChange.value);
|
|
302
255
|
};
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
} else
|
|
307
|
-
let
|
|
308
|
-
if ($[
|
|
309
|
-
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
} else
|
|
313
|
-
useEffect(
|
|
314
|
-
let
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
frame = requestAnimationFrame(updatePosition);
|
|
322
|
-
};
|
|
323
|
-
const observer = new ResizeObserver(update);
|
|
324
|
-
if (rootRef.current) observer.observe(rootRef.current);
|
|
325
|
-
if (dropdownRef.current) observer.observe(dropdownRef.current);
|
|
326
|
-
update();
|
|
327
|
-
document.addEventListener("scroll", update, true);
|
|
328
|
-
window.addEventListener("resize", update);
|
|
329
|
-
return () => {
|
|
330
|
-
cancelAnimationFrame(frame);
|
|
331
|
-
observer.disconnect();
|
|
332
|
-
document.removeEventListener("scroll", update, true);
|
|
333
|
-
window.removeEventListener("resize", update);
|
|
334
|
-
};
|
|
335
|
-
};
|
|
336
|
-
$[63] = visible;
|
|
337
|
-
$[64] = t20;
|
|
338
|
-
} else t20 = $[64];
|
|
339
|
-
let t21;
|
|
340
|
-
if ($[65] !== loading || $[66] !== shownOptions || $[67] !== visible) {
|
|
341
|
-
t21 = [
|
|
342
|
-
visible,
|
|
343
|
-
shownOptions,
|
|
344
|
-
loading
|
|
345
|
-
];
|
|
346
|
-
$[65] = loading;
|
|
347
|
-
$[66] = shownOptions;
|
|
348
|
-
$[67] = visible;
|
|
349
|
-
$[68] = t21;
|
|
350
|
-
} else t21 = $[68];
|
|
351
|
-
useEffect(t20, t21);
|
|
352
|
-
let t22;
|
|
353
|
-
let t23;
|
|
354
|
-
if ($[69] === Symbol.for("react.memo_cache_sentinel")) {
|
|
355
|
-
t22 = () => () => clearTimeout(blurTimer.current);
|
|
356
|
-
t23 = [];
|
|
357
|
-
$[69] = t22;
|
|
358
|
-
$[70] = t23;
|
|
256
|
+
$[55] = emitSyncedOpen;
|
|
257
|
+
$[56] = syncedOpenChange;
|
|
258
|
+
$[57] = t15;
|
|
259
|
+
} else t15 = $[57];
|
|
260
|
+
let t16;
|
|
261
|
+
if ($[58] !== syncedOpenChange) {
|
|
262
|
+
t16 = [syncedOpenChange];
|
|
263
|
+
$[58] = syncedOpenChange;
|
|
264
|
+
$[59] = t16;
|
|
265
|
+
} else t16 = $[59];
|
|
266
|
+
useEffect(t15, t16);
|
|
267
|
+
let t17;
|
|
268
|
+
let t18;
|
|
269
|
+
if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
|
|
270
|
+
t17 = () => () => clearTimeout(blurTimer.current);
|
|
271
|
+
t18 = [];
|
|
272
|
+
$[60] = t17;
|
|
273
|
+
$[61] = t18;
|
|
359
274
|
} else {
|
|
360
|
-
|
|
361
|
-
|
|
275
|
+
t17 = $[60];
|
|
276
|
+
t18 = $[61];
|
|
362
277
|
}
|
|
363
|
-
useEffect(
|
|
364
|
-
let
|
|
365
|
-
let
|
|
366
|
-
if ($[
|
|
367
|
-
|
|
278
|
+
useEffect(t17, t18);
|
|
279
|
+
let t19;
|
|
280
|
+
let t20;
|
|
281
|
+
if ($[62] !== active || $[63] !== listboxId) {
|
|
282
|
+
t19 = () => {
|
|
368
283
|
(dropdownRef.current?.querySelector(`#${listboxId}-option-${active}`))?.scrollIntoView?.({ block: "nearest" });
|
|
369
284
|
};
|
|
370
|
-
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
285
|
+
t20 = [active, listboxId];
|
|
286
|
+
$[62] = active;
|
|
287
|
+
$[63] = listboxId;
|
|
288
|
+
$[64] = t19;
|
|
289
|
+
$[65] = t20;
|
|
375
290
|
} else {
|
|
376
|
-
|
|
377
|
-
|
|
291
|
+
t19 = $[64];
|
|
292
|
+
t20 = $[65];
|
|
378
293
|
}
|
|
379
|
-
useEffect(
|
|
380
|
-
let
|
|
381
|
-
if ($[
|
|
382
|
-
|
|
383
|
-
if (readOnly) return;
|
|
384
|
-
setInnerValue(
|
|
385
|
-
onChange?.(
|
|
294
|
+
useEffect(t19, t20);
|
|
295
|
+
let t21;
|
|
296
|
+
if ($[66] !== disabled || $[67] !== onChange || $[68] !== readOnly || $[69] !== setInnerValue) {
|
|
297
|
+
t21 = (next_4) => {
|
|
298
|
+
if (disabled || readOnly) return;
|
|
299
|
+
setInnerValue(next_4);
|
|
300
|
+
onChange?.(next_4);
|
|
386
301
|
};
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
302
|
+
$[66] = disabled;
|
|
303
|
+
$[67] = onChange;
|
|
304
|
+
$[68] = readOnly;
|
|
305
|
+
$[69] = setInnerValue;
|
|
306
|
+
$[70] = t21;
|
|
307
|
+
} else t21 = $[70];
|
|
308
|
+
const update = t21;
|
|
309
|
+
let t22;
|
|
310
|
+
if ($[71] !== disabled || $[72] !== onSelect || $[73] !== readOnly || $[74] !== setOpen || $[75] !== update) {
|
|
311
|
+
t22 = (option_2) => {
|
|
312
|
+
if (disabled || readOnly || option_2.disabled) return;
|
|
313
|
+
update(option_2.value);
|
|
398
314
|
onSelect?.(option_2.value, option_2);
|
|
399
315
|
setOpen(false);
|
|
400
316
|
setActive(-1);
|
|
401
317
|
};
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
|
|
408
|
-
|
|
318
|
+
$[71] = disabled;
|
|
319
|
+
$[72] = onSelect;
|
|
320
|
+
$[73] = readOnly;
|
|
321
|
+
$[74] = setOpen;
|
|
322
|
+
$[75] = update;
|
|
323
|
+
$[76] = t22;
|
|
324
|
+
} else t22 = $[76];
|
|
325
|
+
const choose = t22;
|
|
409
326
|
let handleInput;
|
|
410
327
|
let search;
|
|
411
|
-
if ($[
|
|
412
|
-
handleInput = (
|
|
413
|
-
if (readOnly) return;
|
|
414
|
-
|
|
328
|
+
if ($[77] !== commitMatches || $[78] !== disabled || $[79] !== loading || $[80] !== onSearch || $[81] !== readOnly || $[82] !== setOpen || $[83] !== showOnEmpty || $[84] !== update) {
|
|
329
|
+
handleInput = (next_5) => {
|
|
330
|
+
if (disabled || readOnly) return;
|
|
331
|
+
update(next_5);
|
|
415
332
|
if (composing.current) return;
|
|
416
|
-
search(
|
|
333
|
+
search(next_5);
|
|
417
334
|
};
|
|
418
|
-
search = (
|
|
419
|
-
onSearch?.(
|
|
420
|
-
if (!
|
|
335
|
+
search = (next_6) => {
|
|
336
|
+
onSearch?.(next_6);
|
|
337
|
+
if (!next_6 && !showOnEmpty) {
|
|
421
338
|
setSuppressRemoteOptions(!!onSearch);
|
|
422
339
|
setOpen(false);
|
|
423
340
|
} else if (loading) {
|
|
424
341
|
setSuppressRemoteOptions(false);
|
|
425
342
|
setOpen(true);
|
|
426
343
|
} else {
|
|
427
|
-
const matched_0 = commitMatches(
|
|
344
|
+
const matched_0 = commitMatches(next_6);
|
|
428
345
|
setSuppressRemoteOptions(!!onSearch && !matched_0);
|
|
429
346
|
setOpen(matched_0);
|
|
430
347
|
}
|
|
431
348
|
setActive(-1);
|
|
432
349
|
};
|
|
433
|
-
$[
|
|
434
|
-
$[
|
|
435
|
-
$[
|
|
436
|
-
$[
|
|
437
|
-
$[
|
|
438
|
-
$[
|
|
439
|
-
$[
|
|
440
|
-
$[
|
|
441
|
-
$[
|
|
350
|
+
$[77] = commitMatches;
|
|
351
|
+
$[78] = disabled;
|
|
352
|
+
$[79] = loading;
|
|
353
|
+
$[80] = onSearch;
|
|
354
|
+
$[81] = readOnly;
|
|
355
|
+
$[82] = setOpen;
|
|
356
|
+
$[83] = showOnEmpty;
|
|
357
|
+
$[84] = update;
|
|
358
|
+
$[85] = handleInput;
|
|
359
|
+
$[86] = search;
|
|
442
360
|
} else {
|
|
443
|
-
handleInput = $[
|
|
444
|
-
search = $[
|
|
361
|
+
handleInput = $[85];
|
|
362
|
+
search = $[86];
|
|
445
363
|
}
|
|
446
|
-
let
|
|
447
|
-
if ($[
|
|
448
|
-
|
|
449
|
-
if (readOnly) return;
|
|
364
|
+
let t23;
|
|
365
|
+
if ($[87] !== active || $[88] !== choose || $[89] !== current || $[90] !== disabled || $[91] !== getMatches || $[92] !== readOnly || $[93] !== setOpen || $[94] !== showOnEmpty || $[95] !== shownOptions || $[96] !== suppressRemoteOptions || $[97] !== visible) {
|
|
366
|
+
t23 = (event) => {
|
|
367
|
+
if (disabled || readOnly) return;
|
|
450
368
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
451
369
|
if (!current && !showOnEmpty || suppressRemoteOptions) return;
|
|
452
370
|
if (!getMatches(current).length) return;
|
|
453
371
|
if (!shownOptions.length) return;
|
|
454
372
|
if (!visible) setOpen(true);
|
|
455
|
-
const enabled = shownOptions.map(
|
|
373
|
+
const enabled = shownOptions.map(_temp4).filter(_temp5);
|
|
456
374
|
if (!enabled.length) return;
|
|
457
375
|
const currentIndex = enabled.indexOf(active);
|
|
458
376
|
setActive(currentIndex < 0 ? enabled[event.key === "ArrowDown" ? 0 : enabled.length - 1] : enabled[(currentIndex + (event.key === "ArrowDown" ? 1 : -1) + enabled.length) % enabled.length]);
|
|
@@ -467,92 +385,93 @@ var AutoComplete = (t0) => {
|
|
|
467
385
|
setOpen(false);
|
|
468
386
|
}
|
|
469
387
|
};
|
|
470
|
-
$[
|
|
471
|
-
$[
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
$[
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
388
|
+
$[87] = active;
|
|
389
|
+
$[88] = choose;
|
|
390
|
+
$[89] = current;
|
|
391
|
+
$[90] = disabled;
|
|
392
|
+
$[91] = getMatches;
|
|
393
|
+
$[92] = readOnly;
|
|
394
|
+
$[93] = setOpen;
|
|
395
|
+
$[94] = showOnEmpty;
|
|
396
|
+
$[95] = shownOptions;
|
|
397
|
+
$[96] = suppressRemoteOptions;
|
|
398
|
+
$[97] = visible;
|
|
399
|
+
$[98] = t23;
|
|
400
|
+
} else t23 = $[98];
|
|
401
|
+
const handleKeyDown = t23;
|
|
402
|
+
let t24;
|
|
403
|
+
if ($[99] !== className) {
|
|
404
|
+
t24 = clsx("k-auto-complete", className);
|
|
405
|
+
$[99] = className;
|
|
406
|
+
$[100] = t24;
|
|
407
|
+
} else t24 = $[100];
|
|
408
|
+
const t25 = visible ? listboxId : void 0;
|
|
409
|
+
const t26 = visible && active >= 0 ? `${listboxId}-option-${active}` : void 0;
|
|
410
|
+
let t27;
|
|
411
|
+
if ($[101] !== current || $[102] !== disabled || $[103] !== getMatches || $[104] !== loading || $[105] !== onFocus || $[106] !== readOnly || $[107] !== setOpen || $[108] !== showOnEmpty) {
|
|
412
|
+
t27 = (event_0) => {
|
|
494
413
|
onFocus?.(event_0);
|
|
495
414
|
if (event_0.defaultPrevented) return;
|
|
496
415
|
if (disabled || readOnly) return;
|
|
497
|
-
const
|
|
498
|
-
if (
|
|
499
|
-
if ((current || showOnEmpty) && (
|
|
416
|
+
const matches_1 = getMatches(current);
|
|
417
|
+
if (matches_1.length) setShownOptions(matches_1);
|
|
418
|
+
if ((current || showOnEmpty) && (matches_1.length || loading)) setOpen(true);
|
|
500
419
|
};
|
|
501
|
-
$[
|
|
502
|
-
$[
|
|
503
|
-
$[
|
|
504
|
-
$[
|
|
505
|
-
$[
|
|
506
|
-
$[
|
|
507
|
-
$[
|
|
508
|
-
$[
|
|
509
|
-
$[
|
|
510
|
-
} else
|
|
511
|
-
let
|
|
512
|
-
if ($[
|
|
513
|
-
|
|
420
|
+
$[101] = current;
|
|
421
|
+
$[102] = disabled;
|
|
422
|
+
$[103] = getMatches;
|
|
423
|
+
$[104] = loading;
|
|
424
|
+
$[105] = onFocus;
|
|
425
|
+
$[106] = readOnly;
|
|
426
|
+
$[107] = setOpen;
|
|
427
|
+
$[108] = showOnEmpty;
|
|
428
|
+
$[109] = t27;
|
|
429
|
+
} else t27 = $[109];
|
|
430
|
+
let t28;
|
|
431
|
+
if ($[110] !== onBlur || $[111] !== setOpen) {
|
|
432
|
+
t28 = (event_1) => {
|
|
514
433
|
onBlur?.(event_1);
|
|
515
434
|
if (event_1.defaultPrevented) return;
|
|
516
435
|
clearTimeout(blurTimer.current);
|
|
517
436
|
blurTimer.current = setTimeout(() => setOpen(false), 120);
|
|
518
437
|
};
|
|
519
|
-
$[
|
|
520
|
-
$[
|
|
521
|
-
$[
|
|
522
|
-
} else
|
|
523
|
-
let
|
|
524
|
-
if ($[
|
|
525
|
-
|
|
438
|
+
$[110] = onBlur;
|
|
439
|
+
$[111] = setOpen;
|
|
440
|
+
$[112] = t28;
|
|
441
|
+
} else t28 = $[112];
|
|
442
|
+
let t29;
|
|
443
|
+
if ($[113] !== onCompositionStart) {
|
|
444
|
+
t29 = (event_2) => {
|
|
526
445
|
composing.current = true;
|
|
527
446
|
onCompositionStart?.(event_2);
|
|
528
447
|
};
|
|
529
|
-
$[
|
|
530
|
-
$[
|
|
531
|
-
} else
|
|
532
|
-
let
|
|
533
|
-
if ($[
|
|
534
|
-
|
|
448
|
+
$[113] = onCompositionStart;
|
|
449
|
+
$[114] = t29;
|
|
450
|
+
} else t29 = $[114];
|
|
451
|
+
let t30;
|
|
452
|
+
if ($[115] !== onCompositionEnd || $[116] !== search) {
|
|
453
|
+
t30 = (event_3) => {
|
|
535
454
|
composing.current = false;
|
|
536
455
|
onCompositionEnd?.(event_3);
|
|
537
456
|
if (!event_3.defaultPrevented) search(event_3.currentTarget.value);
|
|
538
457
|
};
|
|
539
|
-
$[
|
|
540
|
-
$[
|
|
541
|
-
$[
|
|
542
|
-
} else
|
|
543
|
-
let
|
|
544
|
-
if ($[
|
|
545
|
-
|
|
458
|
+
$[115] = onCompositionEnd;
|
|
459
|
+
$[116] = search;
|
|
460
|
+
$[117] = t30;
|
|
461
|
+
} else t30 = $[117];
|
|
462
|
+
let t31;
|
|
463
|
+
if ($[118] !== handleKeyDown || $[119] !== onKeyDown) {
|
|
464
|
+
t31 = (event_4) => {
|
|
546
465
|
onKeyDown?.(event_4);
|
|
547
466
|
if (!event_4.defaultPrevented) handleKeyDown(event_4);
|
|
548
467
|
};
|
|
549
|
-
$[
|
|
550
|
-
$[
|
|
551
|
-
$[
|
|
552
|
-
} else
|
|
553
|
-
let
|
|
554
|
-
if ($[
|
|
555
|
-
|
|
468
|
+
$[118] = handleKeyDown;
|
|
469
|
+
$[119] = onKeyDown;
|
|
470
|
+
$[120] = t31;
|
|
471
|
+
} else t31 = $[120];
|
|
472
|
+
let t32;
|
|
473
|
+
if ($[121] !== clearable || $[122] !== current || $[123] !== disabled || $[124] !== handleInput || $[125] !== onClear || $[126] !== readOnly || $[127] !== rest || $[128] !== shape || $[129] !== size || $[130] !== t25 || $[131] !== t26 || $[132] !== t27 || $[133] !== t28 || $[134] !== t29 || $[135] !== t30 || $[136] !== t31 || $[137] !== theme || $[138] !== visible) {
|
|
474
|
+
t32 = /* @__PURE__ */ jsx(input_default, {
|
|
556
475
|
...rest,
|
|
557
476
|
value: current,
|
|
558
477
|
disabled,
|
|
@@ -564,109 +483,128 @@ var AutoComplete = (t0) => {
|
|
|
564
483
|
role: "combobox",
|
|
565
484
|
"aria-autocomplete": "list",
|
|
566
485
|
"aria-expanded": visible,
|
|
567
|
-
"aria-controls":
|
|
568
|
-
"aria-activedescendant":
|
|
569
|
-
onFocus:
|
|
570
|
-
onBlur:
|
|
571
|
-
onCompositionStart:
|
|
572
|
-
onCompositionEnd:
|
|
486
|
+
"aria-controls": t25,
|
|
487
|
+
"aria-activedescendant": t26,
|
|
488
|
+
onFocus: t27,
|
|
489
|
+
onBlur: t28,
|
|
490
|
+
onCompositionStart: t29,
|
|
491
|
+
onCompositionEnd: t30,
|
|
573
492
|
onClear,
|
|
574
493
|
onChange: handleInput,
|
|
575
|
-
onKeyDown:
|
|
494
|
+
onKeyDown: t31
|
|
576
495
|
});
|
|
577
|
-
$[
|
|
578
|
-
$[
|
|
579
|
-
$[
|
|
580
|
-
$[
|
|
581
|
-
$[
|
|
582
|
-
$[
|
|
583
|
-
$[
|
|
584
|
-
$[
|
|
585
|
-
$[
|
|
496
|
+
$[121] = clearable;
|
|
497
|
+
$[122] = current;
|
|
498
|
+
$[123] = disabled;
|
|
499
|
+
$[124] = handleInput;
|
|
500
|
+
$[125] = onClear;
|
|
501
|
+
$[126] = readOnly;
|
|
502
|
+
$[127] = rest;
|
|
503
|
+
$[128] = shape;
|
|
504
|
+
$[129] = size;
|
|
505
|
+
$[130] = t25;
|
|
506
|
+
$[131] = t26;
|
|
507
|
+
$[132] = t27;
|
|
508
|
+
$[133] = t28;
|
|
509
|
+
$[134] = t29;
|
|
586
510
|
$[135] = t30;
|
|
587
511
|
$[136] = t31;
|
|
588
|
-
$[137] =
|
|
589
|
-
$[138] =
|
|
590
|
-
$[139] =
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
512
|
+
$[137] = theme;
|
|
513
|
+
$[138] = visible;
|
|
514
|
+
$[139] = t32;
|
|
515
|
+
} else t32 = $[139];
|
|
516
|
+
const t33 = size === "small";
|
|
517
|
+
const t34 = size === "large";
|
|
518
|
+
let t35;
|
|
519
|
+
if ($[140] !== t33 || $[141] !== t34) {
|
|
520
|
+
t35 = clsx("k-select-dropdown", "k-auto-complete-dropdown", {
|
|
521
|
+
"k-select-dropdown-sm": t33,
|
|
522
|
+
"k-select-dropdown-lg": t34
|
|
523
|
+
});
|
|
524
|
+
$[140] = t33;
|
|
525
|
+
$[141] = t34;
|
|
526
|
+
$[142] = t35;
|
|
527
|
+
} else t35 = $[142];
|
|
528
|
+
let t36;
|
|
529
|
+
if ($[143] !== active || $[144] !== choose || $[145] !== disabled || $[146] !== listboxId || $[147] !== loading || $[148] !== loadingText || $[149] !== locale || $[150] !== readOnly || $[151] !== shownOptions) {
|
|
530
|
+
t36 = loading ? /* @__PURE__ */ jsxs("div", {
|
|
531
|
+
className: "k-select-loading",
|
|
532
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
533
|
+
type: Loading,
|
|
534
|
+
spin: true
|
|
535
|
+
}), /* @__PURE__ */ jsx("span", { children: loadingText || locale.k.select.loading })]
|
|
536
|
+
}) : /* @__PURE__ */ jsx("ul", { children: shownOptions.map((option_5, index_1) => /* @__PURE__ */ jsx("li", {
|
|
537
|
+
id: `${listboxId}-option-${index_1}`,
|
|
538
|
+
role: "option",
|
|
539
|
+
"aria-selected": active === index_1,
|
|
540
|
+
"aria-disabled": option_5.disabled || void 0,
|
|
541
|
+
className: clsx("k-select-item", {
|
|
542
|
+
"k-select-item-active": active === index_1,
|
|
543
|
+
"k-select-item-disabled": option_5.disabled
|
|
544
|
+
}),
|
|
545
|
+
onMouseDown: _temp6,
|
|
546
|
+
onMouseEnter: () => !disabled && !readOnly && !option_5.disabled && setActive(index_1),
|
|
547
|
+
onClick: () => choose(option_5),
|
|
548
|
+
children: option_5.label ?? option_5.value
|
|
549
|
+
}, option_5.value)) });
|
|
550
|
+
$[143] = active;
|
|
551
|
+
$[144] = choose;
|
|
552
|
+
$[145] = disabled;
|
|
553
|
+
$[146] = listboxId;
|
|
554
|
+
$[147] = loading;
|
|
555
|
+
$[148] = loadingText;
|
|
556
|
+
$[149] = locale;
|
|
557
|
+
$[150] = readOnly;
|
|
558
|
+
$[151] = shownOptions;
|
|
559
|
+
$[152] = t36;
|
|
560
|
+
} else t36 = $[152];
|
|
561
|
+
let t37;
|
|
562
|
+
if ($[153] !== listboxId || $[154] !== t35 || $[155] !== t36) {
|
|
563
|
+
t37 = /* @__PURE__ */ jsx("div", {
|
|
564
|
+
ref: dropdownRef,
|
|
565
|
+
id: listboxId,
|
|
566
|
+
className: t35,
|
|
567
|
+
role: "listbox",
|
|
568
|
+
children: t36
|
|
569
|
+
});
|
|
570
|
+
$[153] = listboxId;
|
|
571
|
+
$[154] = t35;
|
|
572
|
+
$[155] = t36;
|
|
573
|
+
$[156] = t37;
|
|
574
|
+
} else t37 = $[156];
|
|
597
575
|
let t38;
|
|
598
|
-
if ($[
|
|
599
|
-
t38 =
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
}),
|
|
613
|
-
style: {
|
|
614
|
-
left: position.left,
|
|
615
|
-
top: position.top,
|
|
616
|
-
minWidth: position.width,
|
|
617
|
-
visibility: positioned ? void 0 : "hidden",
|
|
618
|
-
transformOrigin: position.origin
|
|
619
|
-
},
|
|
620
|
-
role: "listbox",
|
|
621
|
-
children: loading ? /* @__PURE__ */ jsxs("div", {
|
|
622
|
-
className: "k-select-loading",
|
|
623
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
624
|
-
type: Loading,
|
|
625
|
-
spin: true
|
|
626
|
-
}), /* @__PURE__ */ jsx("span", { children: loadingText || locale.k.select.loading })]
|
|
627
|
-
}) : /* @__PURE__ */ jsx("ul", { children: shownOptions.map((option_5, index_1) => /* @__PURE__ */ jsx("li", {
|
|
628
|
-
id: `${listboxId}-option-${index_1}`,
|
|
629
|
-
role: "option",
|
|
630
|
-
"aria-selected": active === index_1,
|
|
631
|
-
"aria-disabled": option_5.disabled || void 0,
|
|
632
|
-
className: clsx("k-select-item", {
|
|
633
|
-
"k-select-item-active": active === index_1,
|
|
634
|
-
"k-select-item-disabled": option_5.disabled
|
|
635
|
-
}),
|
|
636
|
-
onMouseDown: _temp5,
|
|
637
|
-
onMouseEnter: () => !option_5.disabled && setActive(index_1),
|
|
638
|
-
onClick: () => choose(option_5),
|
|
639
|
-
children: option_5.label ?? option_5.value
|
|
640
|
-
}, option_5.value)) })
|
|
641
|
-
})
|
|
642
|
-
})
|
|
576
|
+
if ($[157] !== setOpen || $[158] !== t37 || $[159] !== visible) {
|
|
577
|
+
t38 = /* @__PURE__ */ jsx(Popup, {
|
|
578
|
+
raw: true,
|
|
579
|
+
open: visible,
|
|
580
|
+
target: rootRef,
|
|
581
|
+
trigger: "manual",
|
|
582
|
+
placement: "bottom-left",
|
|
583
|
+
prefixCls: "k-auto-complete-dropdown",
|
|
584
|
+
transitionName: "k-select",
|
|
585
|
+
offset: 6,
|
|
586
|
+
matchTriggerWidth: true,
|
|
587
|
+
destroyOnClose: true,
|
|
588
|
+
onOpenChange: setOpen,
|
|
589
|
+
overlay: t37
|
|
643
590
|
});
|
|
644
|
-
$[
|
|
645
|
-
$[
|
|
646
|
-
$[
|
|
647
|
-
$[
|
|
648
|
-
|
|
649
|
-
$[150] = locale;
|
|
650
|
-
$[151] = position;
|
|
651
|
-
$[152] = positioned;
|
|
652
|
-
$[153] = rendered;
|
|
653
|
-
$[154] = shownOptions;
|
|
654
|
-
$[155] = size;
|
|
655
|
-
$[156] = visible;
|
|
656
|
-
$[157] = t38;
|
|
657
|
-
} else t38 = $[157];
|
|
591
|
+
$[157] = setOpen;
|
|
592
|
+
$[158] = t37;
|
|
593
|
+
$[159] = visible;
|
|
594
|
+
$[160] = t38;
|
|
595
|
+
} else t38 = $[160];
|
|
658
596
|
let t39;
|
|
659
|
-
if ($[
|
|
597
|
+
if ($[161] !== t24 || $[162] !== t32 || $[163] !== t38) {
|
|
660
598
|
t39 = /* @__PURE__ */ jsxs("div", {
|
|
661
599
|
ref: rootRef,
|
|
662
|
-
className:
|
|
663
|
-
children: [
|
|
600
|
+
className: t24,
|
|
601
|
+
children: [t32, t38]
|
|
664
602
|
});
|
|
665
|
-
$[
|
|
666
|
-
$[
|
|
667
|
-
$[
|
|
668
|
-
$[
|
|
669
|
-
} else t39 = $[
|
|
603
|
+
$[161] = t24;
|
|
604
|
+
$[162] = t32;
|
|
605
|
+
$[163] = t38;
|
|
606
|
+
$[164] = t39;
|
|
607
|
+
} else t39 = $[164];
|
|
670
608
|
return t39;
|
|
671
609
|
};
|
|
672
610
|
var auto_complete_default = createFormFieldComponent(AutoComplete);
|
|
@@ -679,13 +617,16 @@ function _temp(item) {
|
|
|
679
617
|
function _temp2(next) {
|
|
680
618
|
return next ?? "";
|
|
681
619
|
}
|
|
682
|
-
function _temp3(
|
|
620
|
+
function _temp3(next_0) {
|
|
621
|
+
return next_0 ?? false;
|
|
622
|
+
}
|
|
623
|
+
function _temp4(option_3, index) {
|
|
683
624
|
return !option_3.disabled ? index : -1;
|
|
684
625
|
}
|
|
685
|
-
function
|
|
626
|
+
function _temp5(index_0) {
|
|
686
627
|
return index_0 >= 0;
|
|
687
628
|
}
|
|
688
|
-
function
|
|
629
|
+
function _temp6(event_5) {
|
|
689
630
|
return event_5.preventDefault();
|
|
690
631
|
}
|
|
691
632
|
//#endregion
|