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