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/mentions/index.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
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 Popup from "../popup/index.js";
|
|
9
10
|
import { useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
11
|
import { CircleX, Loading } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
11
12
|
import Icon from "../icon/index.js";
|
|
12
13
|
import { useValue } from "../utils/use-value.js";
|
|
13
14
|
import Empty from "../empty/index.js";
|
|
14
15
|
import { createFormFieldComponent } from "../form/field-context.js";
|
|
15
|
-
import Teleport from "../base/teleport.js";
|
|
16
|
-
import { Transition } from "../base/transition.js";
|
|
17
16
|
import textarea_default from "../input/textarea.js";
|
|
18
|
-
import { setPlacement } from "../utils/placement.js";
|
|
19
17
|
import { c } from "react/compiler-runtime";
|
|
20
18
|
import clsx from "clsx";
|
|
21
|
-
import { useEffect,
|
|
19
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
22
20
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
21
|
//#region components/mentions/index.tsx
|
|
24
22
|
var caretPosition = (element) => {
|
|
@@ -72,7 +70,7 @@ var caretPosition = (element) => {
|
|
|
72
70
|
};
|
|
73
71
|
var EMPTY_OPTIONS = [];
|
|
74
72
|
var Mentions = (t0) => {
|
|
75
|
-
const $ = c(
|
|
73
|
+
const $ = c(145);
|
|
76
74
|
let className;
|
|
77
75
|
let disabled;
|
|
78
76
|
let emptyText;
|
|
@@ -172,7 +170,6 @@ var Mentions = (t0) => {
|
|
|
172
170
|
} else t9 = $[25];
|
|
173
171
|
const listboxId = `k-mentions-listbox-${t9}`;
|
|
174
172
|
const [query, setQuery] = useState(null);
|
|
175
|
-
const [rendered, setRendered] = useState(false);
|
|
176
173
|
const [active, setActive] = useState(0);
|
|
177
174
|
let t10;
|
|
178
175
|
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -180,117 +177,84 @@ var Mentions = (t0) => {
|
|
|
180
177
|
$[27] = t10;
|
|
181
178
|
} else t10 = $[27];
|
|
182
179
|
const [shown, setShown] = useState(t10);
|
|
183
|
-
const [
|
|
184
|
-
let t11;
|
|
185
|
-
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
186
|
-
t11 = {
|
|
187
|
-
left: 0,
|
|
188
|
-
top: 0,
|
|
189
|
-
origin: "left top",
|
|
190
|
-
width: 260
|
|
191
|
-
};
|
|
192
|
-
$[28] = t11;
|
|
193
|
-
} else t11 = $[28];
|
|
194
|
-
const [position, setPosition] = useState(t11);
|
|
180
|
+
const [popupWidth, setPopupWidth] = useState(260);
|
|
195
181
|
const rootRef = useRef(null);
|
|
196
182
|
const textareaRef = useRef(null);
|
|
197
183
|
const dropdownRef = useRef(null);
|
|
198
|
-
const placementRef = useRef(placement);
|
|
199
|
-
const originRef = useRef("left top");
|
|
200
|
-
const topRef = useRef(0);
|
|
201
|
-
const leftRef = useRef(0);
|
|
202
184
|
const composing = useRef(false);
|
|
203
185
|
const current = inner;
|
|
186
|
+
let t11;
|
|
187
|
+
if ($[28] !== options) {
|
|
188
|
+
t11 = options.map(_temp2);
|
|
189
|
+
$[28] = options;
|
|
190
|
+
$[29] = t11;
|
|
191
|
+
} else t11 = $[29];
|
|
192
|
+
const normalized = t11;
|
|
204
193
|
let t12;
|
|
205
|
-
if ($[
|
|
206
|
-
t12 =
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
} else t12 = $[
|
|
210
|
-
const
|
|
211
|
-
let t13;
|
|
212
|
-
if ($[31] !== triggers) {
|
|
213
|
-
t13 = triggers.filter(Boolean);
|
|
214
|
-
$[31] = triggers;
|
|
215
|
-
$[32] = t13;
|
|
216
|
-
} else t13 = $[32];
|
|
217
|
-
const effectiveTriggers = t13;
|
|
194
|
+
if ($[30] !== triggers) {
|
|
195
|
+
t12 = triggers.filter(Boolean);
|
|
196
|
+
$[30] = triggers;
|
|
197
|
+
$[31] = t12;
|
|
198
|
+
} else t12 = $[31];
|
|
199
|
+
const effectiveTriggers = t12;
|
|
218
200
|
const firstEnabled = _temp4;
|
|
219
|
-
let
|
|
220
|
-
if ($[
|
|
221
|
-
|
|
201
|
+
let t13;
|
|
202
|
+
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
203
|
+
t13 = (items_0) => {
|
|
222
204
|
setShown(items_0);
|
|
223
205
|
setActive(firstEnabled(items_0));
|
|
224
206
|
};
|
|
225
|
-
$[
|
|
226
|
-
} else
|
|
227
|
-
const setMatches =
|
|
228
|
-
let
|
|
229
|
-
if ($[
|
|
230
|
-
|
|
207
|
+
$[32] = t13;
|
|
208
|
+
} else t13 = $[32];
|
|
209
|
+
const setMatches = t13;
|
|
210
|
+
let t14;
|
|
211
|
+
if ($[33] !== active || $[34] !== shown) {
|
|
212
|
+
t14 = (offset) => {
|
|
231
213
|
const enabled = shown.map(_temp5).filter(_temp6);
|
|
232
214
|
if (!enabled.length) return;
|
|
233
215
|
const currentIndex = enabled.indexOf(active);
|
|
234
216
|
setActive(enabled[(Math.max(currentIndex, 0) + offset + enabled.length) % enabled.length]);
|
|
235
217
|
};
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
} else
|
|
240
|
-
const moveActive =
|
|
241
|
-
let
|
|
242
|
-
if ($[
|
|
243
|
-
|
|
218
|
+
$[33] = active;
|
|
219
|
+
$[34] = shown;
|
|
220
|
+
$[35] = t14;
|
|
221
|
+
} else t14 = $[35];
|
|
222
|
+
const moveActive = t14;
|
|
223
|
+
let t15;
|
|
224
|
+
if ($[36] !== filterOption || $[37] !== normalized || $[38] !== onSearch) {
|
|
225
|
+
t15 = (state) => {
|
|
244
226
|
if (onSearch && !filterOption) return normalized;
|
|
245
227
|
return normalized.filter((option_1) => filterOption ? filterOption(state.text, option_1) : option_1.value.toLocaleLowerCase().includes(state.text.toLocaleLowerCase()));
|
|
246
228
|
};
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
} else
|
|
252
|
-
const getMatches =
|
|
229
|
+
$[36] = filterOption;
|
|
230
|
+
$[37] = normalized;
|
|
231
|
+
$[38] = onSearch;
|
|
232
|
+
$[39] = t15;
|
|
233
|
+
} else t15 = $[39];
|
|
234
|
+
const getMatches = t15;
|
|
253
235
|
const [previousNormalized, setPreviousNormalized] = useState(normalized);
|
|
254
236
|
if (previousNormalized !== normalized) {
|
|
255
237
|
setPreviousNormalized(normalized);
|
|
256
238
|
if (query) setMatches(getMatches(query));
|
|
257
239
|
}
|
|
258
|
-
let
|
|
259
|
-
if ($[
|
|
260
|
-
|
|
261
|
-
if (!
|
|
240
|
+
let t16;
|
|
241
|
+
if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
|
|
242
|
+
t16 = () => {
|
|
243
|
+
if (!textareaRef.current) return null;
|
|
262
244
|
const rect = caretPosition(textareaRef.current);
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
transOrigin: originRef,
|
|
269
|
-
top: topRef,
|
|
270
|
-
left: leftRef,
|
|
271
|
-
position: {
|
|
272
|
-
x: rect.left,
|
|
273
|
-
y: rect.bottom
|
|
274
|
-
},
|
|
275
|
-
offset: 4
|
|
276
|
-
});
|
|
277
|
-
setPosition({
|
|
278
|
-
left: leftRef.current,
|
|
279
|
-
top: topRef.current,
|
|
280
|
-
origin: originRef.current,
|
|
281
|
-
width: Math.min(260, rootRef.current?.offsetWidth || 260)
|
|
282
|
-
});
|
|
283
|
-
setPositioned(true);
|
|
245
|
+
setPopupWidth(Math.min(260, rootRef.current?.offsetWidth || 260));
|
|
246
|
+
return {
|
|
247
|
+
x: rect.left,
|
|
248
|
+
y: rect.bottom
|
|
249
|
+
};
|
|
284
250
|
};
|
|
285
|
-
$[
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
t18 = (text, caret, t19) => {
|
|
293
|
-
const search = t19 === void 0 ? false : t19;
|
|
251
|
+
$[40] = t16;
|
|
252
|
+
} else t16 = $[40];
|
|
253
|
+
const getAnchorPosition = t16;
|
|
254
|
+
let t17;
|
|
255
|
+
if ($[41] !== effectiveTriggers || $[42] !== getMatches || $[43] !== onSearch || $[44] !== readOnly) {
|
|
256
|
+
t17 = (text, caret, t18) => {
|
|
257
|
+
const search = t18 === void 0 ? false : t18;
|
|
294
258
|
if (readOnly) {
|
|
295
259
|
setQuery(null);
|
|
296
260
|
return;
|
|
@@ -307,117 +271,70 @@ var Mentions = (t0) => {
|
|
|
307
271
|
});
|
|
308
272
|
const nextQuery = found;
|
|
309
273
|
setQuery(nextQuery);
|
|
310
|
-
if (!query && nextQuery) setPositioned(false);
|
|
311
274
|
if (nextQuery) {
|
|
312
|
-
setRendered(true);
|
|
313
275
|
setMatches(onSearch && search && nextQuery.text ? [] : getMatches(nextQuery));
|
|
314
276
|
if (search && nextQuery.text) onSearch?.(nextQuery.text, nextQuery.trigger);
|
|
315
277
|
} else setMatches([]);
|
|
316
278
|
};
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
const positionDropdown = useEffectEvent(updatePosition);
|
|
279
|
+
$[41] = effectiveTriggers;
|
|
280
|
+
$[42] = getMatches;
|
|
281
|
+
$[43] = onSearch;
|
|
282
|
+
$[44] = readOnly;
|
|
283
|
+
$[45] = t17;
|
|
284
|
+
} else t17 = $[45];
|
|
285
|
+
const updateQuery = t17;
|
|
286
|
+
let t18;
|
|
326
287
|
let t19;
|
|
327
|
-
if ($[
|
|
328
|
-
|
|
329
|
-
if (!query) return;
|
|
330
|
-
let frame = 0;
|
|
331
|
-
const update = () => {
|
|
332
|
-
cancelAnimationFrame(frame);
|
|
333
|
-
frame = requestAnimationFrame(positionDropdown);
|
|
334
|
-
};
|
|
335
|
-
const closeOutside = (event) => {
|
|
336
|
-
const target = event.target;
|
|
337
|
-
if (!rootRef.current?.contains(target) && !dropdownRef.current?.contains(target)) setQuery(null);
|
|
338
|
-
};
|
|
339
|
-
const observer = new ResizeObserver(update);
|
|
340
|
-
if (rootRef.current) observer.observe(rootRef.current);
|
|
341
|
-
if (dropdownRef.current) observer.observe(dropdownRef.current);
|
|
342
|
-
update();
|
|
343
|
-
window.addEventListener("resize", update);
|
|
344
|
-
window.addEventListener("scroll", update, true);
|
|
345
|
-
document.addEventListener("mousedown", closeOutside);
|
|
346
|
-
return () => {
|
|
347
|
-
cancelAnimationFrame(frame);
|
|
348
|
-
observer.disconnect();
|
|
349
|
-
window.removeEventListener("resize", update);
|
|
350
|
-
window.removeEventListener("scroll", update, true);
|
|
351
|
-
document.removeEventListener("mousedown", closeOutside);
|
|
352
|
-
};
|
|
353
|
-
};
|
|
354
|
-
$[50] = positionDropdown;
|
|
355
|
-
$[51] = query;
|
|
356
|
-
$[52] = t19;
|
|
357
|
-
} else t19 = $[52];
|
|
358
|
-
let t20;
|
|
359
|
-
if ($[53] !== placement || $[54] !== query || $[55] !== shown) {
|
|
360
|
-
t20 = [
|
|
361
|
-
query,
|
|
362
|
-
shown,
|
|
363
|
-
placement
|
|
364
|
-
];
|
|
365
|
-
$[53] = placement;
|
|
366
|
-
$[54] = query;
|
|
367
|
-
$[55] = shown;
|
|
368
|
-
$[56] = t20;
|
|
369
|
-
} else t20 = $[56];
|
|
370
|
-
useEffect(t19, t20);
|
|
371
|
-
let t21;
|
|
372
|
-
let t22;
|
|
373
|
-
if ($[57] !== active || $[58] !== listboxId) {
|
|
374
|
-
t21 = () => {
|
|
288
|
+
if ($[46] !== active || $[47] !== listboxId) {
|
|
289
|
+
t18 = () => {
|
|
375
290
|
dropdownRef.current?.querySelector(`#${listboxId}-option-${active}`)?.scrollIntoView({ block: "nearest" });
|
|
376
291
|
};
|
|
377
|
-
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
292
|
+
t19 = [active, listboxId];
|
|
293
|
+
$[46] = active;
|
|
294
|
+
$[47] = listboxId;
|
|
295
|
+
$[48] = t18;
|
|
296
|
+
$[49] = t19;
|
|
382
297
|
} else {
|
|
383
|
-
|
|
384
|
-
|
|
298
|
+
t18 = $[48];
|
|
299
|
+
t19 = $[49];
|
|
385
300
|
}
|
|
386
|
-
useEffect(
|
|
387
|
-
let
|
|
388
|
-
if ($[
|
|
389
|
-
|
|
390
|
-
if (readOnly) return;
|
|
301
|
+
useEffect(t18, t19);
|
|
302
|
+
let t20;
|
|
303
|
+
if ($[50] !== disabled || $[51] !== onChange || $[52] !== readOnly || $[53] !== setInner) {
|
|
304
|
+
t20 = (next_0) => {
|
|
305
|
+
if (disabled || readOnly) return;
|
|
391
306
|
setInner(next_0);
|
|
392
307
|
onChange?.(next_0);
|
|
393
308
|
};
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
309
|
+
$[50] = disabled;
|
|
310
|
+
$[51] = onChange;
|
|
311
|
+
$[52] = readOnly;
|
|
312
|
+
$[53] = setInner;
|
|
313
|
+
$[54] = t20;
|
|
314
|
+
} else t20 = $[54];
|
|
315
|
+
const setValue = t20;
|
|
316
|
+
let t21;
|
|
317
|
+
if ($[55] !== disabled || $[56] !== onClear || $[57] !== readOnly || $[58] !== setValue) {
|
|
318
|
+
t21 = (event) => {
|
|
319
|
+
if (disabled || readOnly) return;
|
|
320
|
+
event.stopPropagation();
|
|
405
321
|
setValue("");
|
|
406
322
|
setQuery(null);
|
|
407
323
|
onClear?.();
|
|
408
324
|
textareaRef.current?.focus();
|
|
409
325
|
};
|
|
410
|
-
$[
|
|
411
|
-
$[
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
326
|
+
$[55] = disabled;
|
|
327
|
+
$[56] = onClear;
|
|
328
|
+
$[57] = readOnly;
|
|
329
|
+
$[58] = setValue;
|
|
330
|
+
$[59] = t21;
|
|
331
|
+
} else t21 = $[59];
|
|
332
|
+
const clear = t21;
|
|
333
|
+
let t22;
|
|
334
|
+
if ($[60] !== current || $[61] !== disabled || $[62] !== onSelect || $[63] !== query || $[64] !== readOnly || $[65] !== setValue) {
|
|
335
|
+
t22 = (option_2) => {
|
|
419
336
|
const textarea = textareaRef.current;
|
|
420
|
-
if (readOnly || !query || option_2.disabled || !textarea) return;
|
|
337
|
+
if (disabled || readOnly || !query || option_2.disabled || !textarea) return;
|
|
421
338
|
const state_0 = query;
|
|
422
339
|
const caret_0 = textarea.selectionStart;
|
|
423
340
|
setValue(`${current.slice(0, state_0.start)}${state_0.trigger}${option_2.value} ${current.slice(caret_0)}`);
|
|
@@ -429,114 +346,115 @@ var Mentions = (t0) => {
|
|
|
429
346
|
textarea.setSelectionRange(at, at);
|
|
430
347
|
});
|
|
431
348
|
};
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
434
|
-
$[
|
|
435
|
-
$[
|
|
436
|
-
$[
|
|
437
|
-
$[
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const
|
|
441
|
-
const
|
|
442
|
-
const
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
"k-mentions-
|
|
349
|
+
$[60] = current;
|
|
350
|
+
$[61] = disabled;
|
|
351
|
+
$[62] = onSelect;
|
|
352
|
+
$[63] = query;
|
|
353
|
+
$[64] = readOnly;
|
|
354
|
+
$[65] = setValue;
|
|
355
|
+
$[66] = t22;
|
|
356
|
+
} else t22 = $[66];
|
|
357
|
+
const choose = t22;
|
|
358
|
+
const t23 = size === "small";
|
|
359
|
+
const t24 = size === "large";
|
|
360
|
+
const t25 = clearable && !!current && !disabled && !readOnly;
|
|
361
|
+
let t26;
|
|
362
|
+
if ($[67] !== className || $[68] !== disabled || $[69] !== readOnly || $[70] !== t23 || $[71] !== t24 || $[72] !== t25) {
|
|
363
|
+
t26 = clsx("k-mentions", className, {
|
|
364
|
+
"k-mentions-sm": t23,
|
|
365
|
+
"k-mentions-lg": t24,
|
|
448
366
|
"k-mentions-disabled": disabled,
|
|
449
367
|
"k-mentions-readonly": readOnly,
|
|
450
|
-
"k-mentions-has-clear":
|
|
368
|
+
"k-mentions-has-clear": t25
|
|
451
369
|
});
|
|
452
|
-
$[
|
|
453
|
-
$[
|
|
454
|
-
$[
|
|
455
|
-
$[
|
|
456
|
-
$[
|
|
457
|
-
$[
|
|
458
|
-
$[
|
|
459
|
-
} else
|
|
460
|
-
const
|
|
461
|
-
const
|
|
462
|
-
const
|
|
463
|
-
let
|
|
464
|
-
if ($[
|
|
465
|
-
|
|
370
|
+
$[67] = className;
|
|
371
|
+
$[68] = disabled;
|
|
372
|
+
$[69] = readOnly;
|
|
373
|
+
$[70] = t23;
|
|
374
|
+
$[71] = t24;
|
|
375
|
+
$[72] = t25;
|
|
376
|
+
$[73] = t26;
|
|
377
|
+
} else t26 = $[73];
|
|
378
|
+
const t27 = Boolean(query);
|
|
379
|
+
const t28 = query ? listboxId : void 0;
|
|
380
|
+
const t29 = query && shown[active] ? `${listboxId}-option-${active}` : void 0;
|
|
381
|
+
let t30;
|
|
382
|
+
if ($[74] !== setValue || $[75] !== updateQuery) {
|
|
383
|
+
t30 = (text_0) => {
|
|
466
384
|
setValue(text_0);
|
|
467
385
|
if (composing.current) return;
|
|
468
386
|
if (textareaRef.current) updateQuery(text_0, textareaRef.current.selectionStart, true);
|
|
469
387
|
};
|
|
470
|
-
$[
|
|
471
|
-
$[
|
|
472
|
-
$[
|
|
473
|
-
} else
|
|
474
|
-
let
|
|
475
|
-
if ($[
|
|
476
|
-
|
|
388
|
+
$[74] = setValue;
|
|
389
|
+
$[75] = updateQuery;
|
|
390
|
+
$[76] = t30;
|
|
391
|
+
} else t30 = $[76];
|
|
392
|
+
let t31;
|
|
393
|
+
if ($[77] === Symbol.for("react.memo_cache_sentinel")) {
|
|
394
|
+
t31 = () => {
|
|
477
395
|
composing.current = true;
|
|
478
396
|
};
|
|
479
|
-
$[
|
|
480
|
-
} else
|
|
481
|
-
let
|
|
482
|
-
if ($[
|
|
483
|
-
|
|
397
|
+
$[77] = t31;
|
|
398
|
+
} else t31 = $[77];
|
|
399
|
+
let t32;
|
|
400
|
+
if ($[78] !== updateQuery) {
|
|
401
|
+
t32 = (event_0) => {
|
|
484
402
|
composing.current = false;
|
|
485
|
-
updateQuery(
|
|
403
|
+
updateQuery(event_0.currentTarget.value, event_0.currentTarget.selectionStart, true);
|
|
486
404
|
};
|
|
487
|
-
$[
|
|
488
|
-
$[
|
|
489
|
-
} else
|
|
490
|
-
let
|
|
491
|
-
let
|
|
492
|
-
let
|
|
493
|
-
if ($[
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
405
|
+
$[78] = updateQuery;
|
|
406
|
+
$[79] = t32;
|
|
407
|
+
} else t32 = $[79];
|
|
408
|
+
let t33;
|
|
409
|
+
let t34;
|
|
410
|
+
let t35;
|
|
411
|
+
if ($[80] !== current || $[81] !== updateQuery) {
|
|
412
|
+
t33 = () => textareaRef.current && updateQuery(current, textareaRef.current.selectionStart);
|
|
413
|
+
t34 = () => textareaRef.current && updateQuery(current, textareaRef.current.selectionStart);
|
|
414
|
+
t35 = (event_1) => {
|
|
497
415
|
if ([
|
|
498
416
|
"ArrowLeft",
|
|
499
417
|
"ArrowRight",
|
|
500
418
|
"Home",
|
|
501
419
|
"End"
|
|
502
|
-
].includes(
|
|
420
|
+
].includes(event_1.key) && textareaRef.current) updateQuery(current, textareaRef.current.selectionStart);
|
|
503
421
|
};
|
|
504
|
-
$[
|
|
505
|
-
$[
|
|
506
|
-
$[
|
|
507
|
-
$[
|
|
508
|
-
$[
|
|
422
|
+
$[80] = current;
|
|
423
|
+
$[81] = updateQuery;
|
|
424
|
+
$[82] = t33;
|
|
425
|
+
$[83] = t34;
|
|
426
|
+
$[84] = t35;
|
|
509
427
|
} else {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
428
|
+
t33 = $[82];
|
|
429
|
+
t34 = $[83];
|
|
430
|
+
t35 = $[84];
|
|
513
431
|
}
|
|
514
|
-
let
|
|
515
|
-
if ($[
|
|
516
|
-
|
|
432
|
+
let t36;
|
|
433
|
+
if ($[85] !== active || $[86] !== choose || $[87] !== moveActive || $[88] !== query || $[89] !== shown) {
|
|
434
|
+
t36 = (event_2) => {
|
|
517
435
|
if (!query) return;
|
|
518
|
-
if ((
|
|
519
|
-
moveActive(
|
|
520
|
-
|
|
521
|
-
} else if (
|
|
436
|
+
if ((event_2.key === "ArrowDown" || event_2.key === "ArrowUp") && shown.length) {
|
|
437
|
+
moveActive(event_2.key === "ArrowDown" ? 1 : -1);
|
|
438
|
+
event_2.preventDefault();
|
|
439
|
+
} else if (event_2.key === "Enter" && shown.length) {
|
|
522
440
|
choose(shown[active]);
|
|
523
|
-
|
|
524
|
-
} else if (
|
|
525
|
-
|
|
526
|
-
|
|
441
|
+
event_2.preventDefault();
|
|
442
|
+
} else if (event_2.key === "Escape") {
|
|
443
|
+
event_2.preventDefault();
|
|
444
|
+
event_2.stopPropagation();
|
|
527
445
|
setQuery(null);
|
|
528
446
|
}
|
|
529
447
|
};
|
|
530
|
-
$[
|
|
531
|
-
$[
|
|
532
|
-
$[
|
|
533
|
-
$[
|
|
534
|
-
$[
|
|
535
|
-
$[
|
|
536
|
-
} else
|
|
537
|
-
let
|
|
538
|
-
if ($[
|
|
539
|
-
|
|
448
|
+
$[85] = active;
|
|
449
|
+
$[86] = choose;
|
|
450
|
+
$[87] = moveActive;
|
|
451
|
+
$[88] = query;
|
|
452
|
+
$[89] = shown;
|
|
453
|
+
$[90] = t36;
|
|
454
|
+
} else t36 = $[90];
|
|
455
|
+
let t37;
|
|
456
|
+
if ($[91] !== current || $[92] !== disabled || $[93] !== readOnly || $[94] !== rest || $[95] !== rows || $[96] !== shape || $[97] !== size || $[98] !== t27 || $[99] !== t28 || $[100] !== t29 || $[101] !== t30 || $[102] !== t32 || $[103] !== t33 || $[104] !== t34 || $[105] !== t35 || $[106] !== t36 || $[107] !== theme) {
|
|
457
|
+
t37 = /* @__PURE__ */ jsx(textarea_default, {
|
|
540
458
|
...rest,
|
|
541
459
|
ref: textareaRef,
|
|
542
460
|
value: current,
|
|
@@ -547,39 +465,39 @@ var Mentions = (t0) => {
|
|
|
547
465
|
disabled,
|
|
548
466
|
readOnly,
|
|
549
467
|
"aria-haspopup": "listbox",
|
|
550
|
-
"aria-expanded":
|
|
551
|
-
"aria-controls":
|
|
552
|
-
"aria-activedescendant":
|
|
553
|
-
onChange:
|
|
554
|
-
onCompositionStart:
|
|
555
|
-
onCompositionEnd:
|
|
556
|
-
onClick:
|
|
557
|
-
onSelect:
|
|
558
|
-
onKeyUp:
|
|
559
|
-
onKeyDown:
|
|
468
|
+
"aria-expanded": t27,
|
|
469
|
+
"aria-controls": t28,
|
|
470
|
+
"aria-activedescendant": t29,
|
|
471
|
+
onChange: t30,
|
|
472
|
+
onCompositionStart: t31,
|
|
473
|
+
onCompositionEnd: t32,
|
|
474
|
+
onClick: t33,
|
|
475
|
+
onSelect: t34,
|
|
476
|
+
onKeyUp: t35,
|
|
477
|
+
onKeyDown: t36
|
|
560
478
|
});
|
|
561
|
-
$[
|
|
562
|
-
$[
|
|
563
|
-
$[
|
|
564
|
-
$[
|
|
565
|
-
$[
|
|
566
|
-
$[
|
|
567
|
-
$[
|
|
568
|
-
$[
|
|
569
|
-
$[
|
|
570
|
-
$[
|
|
571
|
-
$[
|
|
572
|
-
$[
|
|
573
|
-
$[
|
|
574
|
-
$[
|
|
575
|
-
$[
|
|
576
|
-
$[
|
|
577
|
-
$[
|
|
578
|
-
$[
|
|
579
|
-
} else
|
|
580
|
-
let
|
|
581
|
-
if ($[
|
|
582
|
-
|
|
479
|
+
$[91] = current;
|
|
480
|
+
$[92] = disabled;
|
|
481
|
+
$[93] = readOnly;
|
|
482
|
+
$[94] = rest;
|
|
483
|
+
$[95] = rows;
|
|
484
|
+
$[96] = shape;
|
|
485
|
+
$[97] = size;
|
|
486
|
+
$[98] = t27;
|
|
487
|
+
$[99] = t28;
|
|
488
|
+
$[100] = t29;
|
|
489
|
+
$[101] = t30;
|
|
490
|
+
$[102] = t32;
|
|
491
|
+
$[103] = t33;
|
|
492
|
+
$[104] = t34;
|
|
493
|
+
$[105] = t35;
|
|
494
|
+
$[106] = t36;
|
|
495
|
+
$[107] = theme;
|
|
496
|
+
$[108] = t37;
|
|
497
|
+
} else t37 = $[108];
|
|
498
|
+
let t38;
|
|
499
|
+
if ($[109] !== clear || $[110] !== clearable || $[111] !== current || $[112] !== disabled || $[113] !== readOnly) {
|
|
500
|
+
t38 = clearable && current && !disabled && !readOnly && /* @__PURE__ */ jsx(Icon, {
|
|
583
501
|
className: "k-mentions-clearable",
|
|
584
502
|
type: CircleX,
|
|
585
503
|
role: "button",
|
|
@@ -587,95 +505,131 @@ var Mentions = (t0) => {
|
|
|
587
505
|
"aria-label": "Clear",
|
|
588
506
|
onPointerDown: _temp7,
|
|
589
507
|
onClick: clear,
|
|
590
|
-
onKeyDown: (
|
|
591
|
-
if (
|
|
508
|
+
onKeyDown: (event_4) => {
|
|
509
|
+
if (event_4.key === "Enter" || event_4.key === " ") clear(event_4);
|
|
592
510
|
}
|
|
593
511
|
});
|
|
594
|
-
$[
|
|
595
|
-
$[
|
|
596
|
-
$[
|
|
597
|
-
$[
|
|
598
|
-
$[
|
|
599
|
-
$[
|
|
600
|
-
} else
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
transformOrigin: position.origin
|
|
623
|
-
},
|
|
624
|
-
role: "listbox",
|
|
625
|
-
children: loading ? /* @__PURE__ */ jsxs("div", {
|
|
626
|
-
className: "k-select-loading k-mentions-loading",
|
|
627
|
-
children: [/* @__PURE__ */ jsx(Icon, {
|
|
628
|
-
type: Loading,
|
|
629
|
-
spin: true
|
|
630
|
-
}), loadingText && /* @__PURE__ */ jsx("span", { children: loadingText })]
|
|
631
|
-
}) : shown.length ? /* @__PURE__ */ jsx("ul", { children: shown.map((option_3, index_2) => /* @__PURE__ */ jsx("li", {
|
|
632
|
-
id: `${listboxId}-option-${index_2}`,
|
|
633
|
-
role: "option",
|
|
634
|
-
"aria-selected": active === index_2,
|
|
635
|
-
className: clsx("k-select-item", {
|
|
636
|
-
"k-select-item-active": active === index_2,
|
|
637
|
-
"k-select-item-disabled": option_3.disabled
|
|
638
|
-
}),
|
|
639
|
-
onMouseDown: _temp8,
|
|
640
|
-
onMouseEnter: () => !option_3.disabled && setActive(index_2),
|
|
641
|
-
onClick: () => choose(option_3),
|
|
642
|
-
children: option_3.label ?? option_3.value
|
|
643
|
-
}, option_3.value)) }) : /* @__PURE__ */ jsx(Empty, { description: emptyText })
|
|
644
|
-
})
|
|
645
|
-
})
|
|
512
|
+
$[109] = clear;
|
|
513
|
+
$[110] = clearable;
|
|
514
|
+
$[111] = current;
|
|
515
|
+
$[112] = disabled;
|
|
516
|
+
$[113] = readOnly;
|
|
517
|
+
$[114] = t38;
|
|
518
|
+
} else t38 = $[114];
|
|
519
|
+
const t39 = !!query;
|
|
520
|
+
let t40;
|
|
521
|
+
if ($[115] !== popupWidth) {
|
|
522
|
+
t40 = { minWidth: popupWidth };
|
|
523
|
+
$[115] = popupWidth;
|
|
524
|
+
$[116] = t40;
|
|
525
|
+
} else t40 = $[116];
|
|
526
|
+
let t41;
|
|
527
|
+
if ($[117] === Symbol.for("react.memo_cache_sentinel")) {
|
|
528
|
+
t41 = (next_1) => {
|
|
529
|
+
if (!next_1) setQuery(null);
|
|
530
|
+
};
|
|
531
|
+
$[117] = t41;
|
|
532
|
+
} else t41 = $[117];
|
|
533
|
+
const t42 = size === "small";
|
|
534
|
+
const t43 = size === "large";
|
|
535
|
+
let t44;
|
|
536
|
+
if ($[118] !== t42 || $[119] !== t43) {
|
|
537
|
+
t44 = clsx("k-select-dropdown", "k-mentions-dropdown", {
|
|
538
|
+
"k-select-dropdown-sm": t42,
|
|
539
|
+
"k-select-dropdown-lg": t43
|
|
646
540
|
});
|
|
647
|
-
$[
|
|
648
|
-
$[
|
|
649
|
-
$[
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
541
|
+
$[118] = t42;
|
|
542
|
+
$[119] = t43;
|
|
543
|
+
$[120] = t44;
|
|
544
|
+
} else t44 = $[120];
|
|
545
|
+
let t45;
|
|
546
|
+
if ($[121] !== active || $[122] !== choose || $[123] !== disabled || $[124] !== emptyText || $[125] !== listboxId || $[126] !== loading || $[127] !== loadingText || $[128] !== readOnly || $[129] !== shown) {
|
|
547
|
+
t45 = loading ? /* @__PURE__ */ jsxs("div", {
|
|
548
|
+
className: "k-select-loading k-mentions-loading",
|
|
549
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
550
|
+
type: Loading,
|
|
551
|
+
spin: true
|
|
552
|
+
}), loadingText && /* @__PURE__ */ jsx("span", { children: loadingText })]
|
|
553
|
+
}) : shown.length ? /* @__PURE__ */ jsx("ul", { children: shown.map((option_3, index_2) => /* @__PURE__ */ jsx("li", {
|
|
554
|
+
id: `${listboxId}-option-${index_2}`,
|
|
555
|
+
role: "option",
|
|
556
|
+
"aria-selected": active === index_2,
|
|
557
|
+
className: clsx("k-select-item", {
|
|
558
|
+
"k-select-item-active": active === index_2,
|
|
559
|
+
"k-select-item-disabled": option_3.disabled
|
|
560
|
+
}),
|
|
561
|
+
onMouseDown: _temp8,
|
|
562
|
+
onMouseEnter: () => !disabled && !readOnly && !option_3.disabled && setActive(index_2),
|
|
563
|
+
onClick: () => choose(option_3),
|
|
564
|
+
children: option_3.label ?? option_3.value
|
|
565
|
+
}, option_3.value)) }) : /* @__PURE__ */ jsx(Empty, { description: emptyText });
|
|
566
|
+
$[121] = active;
|
|
567
|
+
$[122] = choose;
|
|
568
|
+
$[123] = disabled;
|
|
569
|
+
$[124] = emptyText;
|
|
570
|
+
$[125] = listboxId;
|
|
571
|
+
$[126] = loading;
|
|
572
|
+
$[127] = loadingText;
|
|
573
|
+
$[128] = readOnly;
|
|
574
|
+
$[129] = shown;
|
|
575
|
+
$[130] = t45;
|
|
576
|
+
} else t45 = $[130];
|
|
577
|
+
let t46;
|
|
578
|
+
if ($[131] !== listboxId || $[132] !== t44 || $[133] !== t45) {
|
|
579
|
+
t46 = /* @__PURE__ */ jsx("div", {
|
|
580
|
+
ref: dropdownRef,
|
|
581
|
+
id: listboxId,
|
|
582
|
+
className: t44,
|
|
583
|
+
role: "listbox",
|
|
584
|
+
children: t45
|
|
585
|
+
});
|
|
586
|
+
$[131] = listboxId;
|
|
587
|
+
$[132] = t44;
|
|
588
|
+
$[133] = t45;
|
|
589
|
+
$[134] = t46;
|
|
590
|
+
} else t46 = $[134];
|
|
591
|
+
let t47;
|
|
592
|
+
if ($[135] !== placement || $[136] !== t39 || $[137] !== t40 || $[138] !== t46) {
|
|
593
|
+
t47 = /* @__PURE__ */ jsx(Popup, {
|
|
594
|
+
raw: true,
|
|
595
|
+
open: t39,
|
|
596
|
+
target: rootRef,
|
|
597
|
+
trigger: "manual",
|
|
598
|
+
placement,
|
|
599
|
+
prefixCls: "k-mentions-dropdown",
|
|
600
|
+
transitionName: "k-select",
|
|
601
|
+
offset: 4,
|
|
602
|
+
getAnchorPosition,
|
|
603
|
+
style: t40,
|
|
604
|
+
destroyOnClose: true,
|
|
605
|
+
outsideEvent: "mousedown",
|
|
606
|
+
onOpenChange: t41,
|
|
607
|
+
overlay: t46
|
|
608
|
+
});
|
|
609
|
+
$[135] = placement;
|
|
610
|
+
$[136] = t39;
|
|
611
|
+
$[137] = t40;
|
|
612
|
+
$[138] = t46;
|
|
613
|
+
$[139] = t47;
|
|
614
|
+
} else t47 = $[139];
|
|
615
|
+
let t48;
|
|
616
|
+
if ($[140] !== t26 || $[141] !== t37 || $[142] !== t38 || $[143] !== t47) {
|
|
617
|
+
t48 = /* @__PURE__ */ jsxs("div", {
|
|
664
618
|
ref: rootRef,
|
|
665
|
-
className:
|
|
619
|
+
className: t26,
|
|
666
620
|
children: [
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
621
|
+
t37,
|
|
622
|
+
t38,
|
|
623
|
+
t47
|
|
670
624
|
]
|
|
671
625
|
});
|
|
672
|
-
$[
|
|
673
|
-
$[
|
|
674
|
-
$[
|
|
675
|
-
$[
|
|
676
|
-
$[
|
|
677
|
-
} else
|
|
678
|
-
return
|
|
626
|
+
$[140] = t26;
|
|
627
|
+
$[141] = t37;
|
|
628
|
+
$[142] = t38;
|
|
629
|
+
$[143] = t47;
|
|
630
|
+
$[144] = t48;
|
|
631
|
+
} else t48 = $[144];
|
|
632
|
+
return t48;
|
|
679
633
|
};
|
|
680
634
|
var mentions_default = createFormFieldComponent(Mentions);
|
|
681
635
|
function _temp(next) {
|
|
@@ -700,11 +654,11 @@ function _temp5(option_0, index_0) {
|
|
|
700
654
|
function _temp6(index_1) {
|
|
701
655
|
return index_1 >= 0;
|
|
702
656
|
}
|
|
703
|
-
function _temp7(
|
|
704
|
-
return
|
|
657
|
+
function _temp7(event_3) {
|
|
658
|
+
return event_3.preventDefault();
|
|
705
659
|
}
|
|
706
|
-
function _temp8(
|
|
707
|
-
return
|
|
660
|
+
function _temp8(event_5) {
|
|
661
|
+
return event_5.preventDefault();
|
|
708
662
|
}
|
|
709
663
|
//#endregion
|
|
710
664
|
export { mentions_default as default };
|