react-kui 3.1.1 → 3.2.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/README.zh-CN.md +3 -1
- package/ai/kui-components.json +912 -318
- package/es/_virtual/_rolldown/runtime.js +1 -1
- package/es/affix/index.js +1 -1
- package/es/alert/index.js +11 -4
- 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 +371 -347
- package/es/avatar/avatar-group-context.js +1 -1
- package/es/avatar/avatar-group.js +1 -1
- package/es/avatar/avatar.js +1 -1
- package/es/back-top/index.js +1 -1
- package/es/badge/index.js +10 -8
- package/es/base/teleport.js +1 -1
- package/es/base/transition-props.js +1 -1
- package/es/base/transition.js +1 -1
- 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 +13 -6
- package/es/calendar/index.js +20 -6
- package/es/card/index.js +11 -4
- 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/carousel/drag.js +1 -1
- package/es/cascader/index.js +13 -10
- package/es/check-card/check-card-group.js +3 -3
- package/es/check-card/check-card.js +155 -141
- package/es/check-card/context.js +1 -1
- package/es/checkbox/checkbox-group-context.js +1 -1
- package/es/checkbox/checkbox-group.js +3 -3
- package/es/checkbox/checkbox.js +64 -244
- package/es/checkbox/index.js +1 -1
- package/es/collapse/collapse-panel.js +1 -1
- package/es/collapse/collapse.js +96 -82
- package/es/color-picker/alpha.js +1 -1
- package/es/color-picker/hue.js +1 -1
- package/es/color-picker/index.js +7 -7
- package/es/color-picker/mode.js +2 -2
- package/es/color-picker/paint.js +1 -1
- package/es/color-picker/presets.js +1 -1
- package/es/components.js +4 -4
- package/es/config/config-context.js +16 -3
- package/es/config/context.js +29 -2
- package/es/config/index.js +31 -12
- package/es/config/popup-host.js +106 -0
- package/es/config/size-context.js +1 -1
- package/es/config/use-config-appearance.js +62 -2
- package/es/const/var.js +6 -2
- package/es/date-picker/index.js +404 -885
- package/es/descriptions/descriptions-item.js +1 -1
- package/es/descriptions/descriptions.js +1 -1
- package/es/divider/index.js +1 -1
- package/es/drawer/index.js +328 -240
- package/es/dropdown/dropdown-button.js +69 -51
- package/es/dropdown/dropdown-context.js +1 -1
- package/es/dropdown/dropdown.js +137 -93
- package/es/dropdown/trigger.js +85 -33
- package/es/empty/index.js +3 -4
- package/es/feature-card/index.js +15 -4
- package/es/feedback-panel/index.js +95 -81
- package/es/flame-wrap/index.js +116 -109
- package/es/flame-wrap/types.js +54 -6
- package/es/flex/index.js +1 -1
- package/es/form/field-context.js +16 -2
- package/es/form/form-context.js +1 -1
- package/es/form/form-item.js +7 -6
- 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 +137 -123
- package/es/image/instance.js +1 -1
- package/es/image/preview.js +1 -1
- package/es/image/utils.js +1 -1
- package/es/index.js +3 -3
- package/es/input/index.js +3 -3
- package/es/input/input-base.js +7 -7
- package/es/input/input-box.js +2 -2
- package/es/input/input-group.js +43 -127
- package/es/input/input.js +1 -1
- package/es/input/textarea.js +28 -114
- package/es/input-number/index.js +7 -5
- package/es/input-otp/index.js +5 -5
- package/es/input-tag/index.js +5 -5
- package/es/kanban/index.js +79 -63
- package/es/layout/index.js +1 -1
- package/es/layout/layout-context.js +1 -1
- package/es/list-panel/index.js +96 -83
- package/es/loading/index.js +1 -1
- package/es/loading/loading-bar.js +1 -1
- package/es/locale/de.js +10 -2
- package/es/locale/el.js +10 -2
- package/es/locale/en.js +10 -2
- package/es/locale/fr.js +10 -2
- package/es/locale/it.js +10 -2
- package/es/locale/ja.js +10 -2
- package/es/locale/ko.js +10 -2
- package/es/locale/ru.js +10 -2
- package/es/locale/th.js +10 -2
- package/es/locale/uk.js +10 -2
- package/es/locale/vi.js +10 -2
- package/es/locale/zh-CN.js +10 -2
- package/es/locale/zh-TW.js +10 -2
- package/es/mentions/index.js +291 -286
- 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 +1 -1
- package/es/menu/menu-keyboard.js +41 -2
- package/es/menu/menu.js +268 -222
- package/es/menu/recursive-menu.js +1 -1
- package/es/menu/sub-menu.js +81 -23
- package/es/message/index.js +1 -1
- package/es/modal/api.js +46 -12
- package/es/modal/modal.js +441 -345
- package/es/modal/toast.js +177 -64
- 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 +13 -8
- package/es/page/responsive.js +1 -1
- package/es/page-header/index.js +1 -1
- package/es/popconfirm/index.js +36 -35
- package/es/poptip/index.js +47 -45
- package/es/popup/index.js +5 -2
- package/es/popup/layers.js +11 -2
- package/es/progress/index.js +1 -1
- package/es/qrcode/index.js +13 -7
- package/es/radio/radio-button.js +51 -44
- package/es/radio/radio-group-context.js +1 -1
- package/es/radio/radio-group.js +49 -52
- package/es/radio/radio.js +46 -197
- package/es/rate/index.js +1 -1
- package/es/rate/star.js +1 -1
- package/es/result/index.js +1 -1
- package/es/ripple/index.js +104 -97
- package/es/ripple/types.js +71 -18
- package/es/row-col/col.js +1 -1
- package/es/row-col/row.js +1 -1
- package/es/segmented/index.js +3 -3
- package/es/select/option.js +1 -1
- package/es/select/select.js +33 -36
- 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 +1 -1
- package/es/slider/thumb.js +1 -1
- package/es/space/index.js +1 -1
- 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 +2 -2
- package/es/stat-card/rollup.js +1 -1
- package/es/stat-card/stat-card.js +16 -7
- package/es/stat-card/stat-number.js +4 -3
- package/es/stat-card/utils/countup.js +1 -1
- package/es/stat-card/utils/odometer.js +1 -1
- package/es/stat-card/utils/stat-item-key.js +22 -0
- package/es/steps/index.js +1 -1
- package/es/switch/index.js +3 -3
- package/es/table/column-setting.js +104 -115
- package/es/table/index.js +544 -206
- package/es/table/utils.js +141 -3
- package/es/tabs/tab-panel.js +1 -1
- package/es/tabs/tabs.js +1 -1
- package/es/tag/index.js +12 -5
- package/es/time-line/timeline-item.js +1 -1
- package/es/time-line/timeline.js +1 -1
- package/es/tooltip/index.js +114 -94
- package/es/tour/index.js +1 -1
- package/es/transfer/index.js +190 -172
- package/es/tree/index.js +55 -44
- package/es/tree/utils.js +1 -1
- package/es/tree-select/index.js +259 -781
- package/es/typography/index.js +1 -1
- package/es/upload/file-list.js +1 -1
- package/es/upload/index.js +5 -6
- package/es/upload/picture-sort.js +1 -1
- package/es/upload/selector.js +1 -1
- package/es/utils/checked.js +1 -1
- package/es/utils/color.js +25 -2
- package/es/utils/css.js +19 -0
- package/es/utils/focus.js +63 -0
- package/es/utils/number.js +1 -1
- package/es/utils/overlay-order.js +18 -0
- package/es/utils/overlay-stack.js +33 -0
- package/es/utils/placement.js +1 -1
- package/es/utils/popup.js +1 -1
- package/es/utils/promise.js +18 -0
- package/es/utils/react-node.js +55 -30
- package/es/utils/selection-tags.js +6 -4
- package/es/utils/share.js +5 -2
- 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 +3 -2
- package/es/watermark/index.js +1 -1
- package/lib/index.cjs +2 -2
- package/lib/locale/de.cjs +2 -2
- package/lib/locale/el.cjs +2 -2
- package/lib/locale/en.cjs +2 -2
- package/lib/locale/fr.cjs +2 -2
- package/lib/locale/it.cjs +2 -2
- package/lib/locale/ja.cjs +2 -2
- package/lib/locale/ko.cjs +2 -2
- package/lib/locale/ru.cjs +2 -2
- package/lib/locale/th.cjs +2 -2
- package/lib/locale/uk.cjs +2 -2
- package/lib/locale/vi.cjs +2 -2
- package/lib/locale/zh-CN.cjs +2 -2
- package/lib/locale/zh-TW.cjs +2 -2
- package/package.json +4 -3
- package/readme.md +3 -1
- package/style/base.css +2 -2
- package/style/components.css +2 -2
- package/style/index.css +2 -2
- package/style/theme.css +2 -2
- package/types/alert/index.d.cts +2 -2
- package/types/alert/index.d.ts +2 -2
- package/types/auto-complete/index.d.cts +7 -1
- package/types/auto-complete/index.d.ts +7 -1
- package/types/badge/index.d.cts +2 -1
- package/types/badge/index.d.ts +2 -1
- package/types/button/button.d.cts +2 -2
- package/types/button/button.d.ts +2 -2
- package/types/card/index.d.cts +3 -3
- package/types/card/index.d.ts +3 -3
- package/types/cascader/index.d.cts +1 -1
- package/types/cascader/index.d.ts +1 -1
- package/types/cascader/types.d.cts +2 -0
- package/types/cascader/types.d.ts +2 -0
- package/types/check-card/context.d.cts +4 -3
- package/types/check-card/context.d.ts +4 -3
- package/types/check-card/index.d.cts +1 -1
- package/types/check-card/index.d.ts +1 -1
- package/types/check-card/types.d.cts +3 -4
- package/types/check-card/types.d.ts +3 -4
- package/types/checkbox/checkbox-group.d.cts +2 -2
- package/types/checkbox/checkbox-group.d.ts +2 -2
- package/types/checkbox/checkbox.d.cts +2 -2
- package/types/checkbox/checkbox.d.ts +2 -2
- package/types/collapse/collapse.d.cts +3 -3
- package/types/collapse/collapse.d.ts +3 -3
- package/types/color-picker/index.d.cts +3 -1
- package/types/color-picker/index.d.ts +3 -1
- package/types/components.d.cts +2 -2
- package/types/components.d.ts +2 -2
- package/types/config/config-context.d.cts +15 -2
- package/types/config/config-context.d.ts +15 -2
- package/types/config/context.d.cts +6 -0
- package/types/config/context.d.ts +6 -0
- package/types/config/popup-host.d.cts +16 -0
- package/types/config/popup-host.d.ts +16 -0
- package/types/config/use-config-appearance.d.cts +41 -2
- package/types/config/use-config-appearance.d.ts +41 -2
- package/types/const/types.d.cts +30 -1
- package/types/const/types.d.ts +30 -1
- package/types/const/var.d.cts +6 -1
- package/types/const/var.d.ts +6 -1
- package/types/date-picker/index.d.cts +3 -1
- package/types/date-picker/index.d.ts +3 -1
- package/types/descriptions/descriptions.d.cts +2 -2
- package/types/descriptions/descriptions.d.ts +2 -2
- package/types/drawer/index.d.cts +1 -0
- package/types/drawer/index.d.ts +1 -0
- package/types/dropdown/dropdown-button.d.cts +5 -2
- package/types/dropdown/dropdown-button.d.ts +5 -2
- package/types/dropdown/dropdown-context.d.cts +6 -0
- package/types/dropdown/dropdown-context.d.ts +6 -0
- package/types/dropdown/dropdown.d.cts +2 -0
- package/types/dropdown/dropdown.d.ts +2 -0
- package/types/feature-card/index.d.cts +3 -3
- package/types/feature-card/index.d.ts +3 -3
- package/types/feedback-panel/index.d.cts +3 -3
- package/types/feedback-panel/index.d.ts +3 -3
- package/types/flame-wrap/types.d.cts +18 -0
- package/types/flame-wrap/types.d.ts +18 -0
- package/types/form/field-context.d.cts +2 -0
- package/types/form/field-context.d.ts +2 -0
- package/types/image/image.d.cts +2 -2
- package/types/image/image.d.ts +2 -2
- package/types/input/input-group.d.cts +2 -2
- package/types/input/input-group.d.ts +2 -2
- package/types/input-number/index.d.cts +2 -0
- package/types/input-number/index.d.ts +2 -0
- package/types/kanban/index.d.cts +3 -2
- package/types/kanban/index.d.ts +3 -2
- package/types/list-panel/index.d.cts +3 -3
- package/types/list-panel/index.d.ts +3 -3
- package/types/locale/de.d.cts +6 -0
- package/types/locale/de.d.ts +6 -0
- package/types/locale/el.d.cts +6 -0
- package/types/locale/el.d.ts +6 -0
- package/types/locale/en.d.cts +6 -0
- package/types/locale/en.d.ts +6 -0
- package/types/locale/fr.d.cts +6 -0
- package/types/locale/fr.d.ts +6 -0
- package/types/locale/it.d.cts +6 -0
- package/types/locale/it.d.ts +6 -0
- package/types/locale/ja.d.cts +6 -0
- package/types/locale/ja.d.ts +6 -0
- package/types/locale/ko.d.cts +6 -0
- package/types/locale/ko.d.ts +6 -0
- package/types/locale/ru.d.cts +6 -0
- package/types/locale/ru.d.ts +6 -0
- package/types/locale/th.d.cts +6 -0
- package/types/locale/th.d.ts +6 -0
- package/types/locale/uk.d.cts +6 -0
- package/types/locale/uk.d.ts +6 -0
- package/types/locale/vi.d.cts +6 -0
- package/types/locale/vi.d.ts +6 -0
- package/types/locale/zh-CN.d.cts +6 -0
- package/types/locale/zh-CN.d.ts +6 -0
- package/types/locale/zh-TW.d.cts +6 -0
- package/types/locale/zh-TW.d.ts +6 -0
- package/types/mentions/index.d.cts +2 -0
- package/types/mentions/index.d.ts +2 -0
- package/types/menu/menu-keyboard.d.cts +23 -0
- package/types/menu/menu-keyboard.d.ts +23 -0
- package/types/modal/api.d.cts +6 -1
- package/types/modal/api.d.ts +6 -1
- package/types/modal/modal.d.cts +1 -0
- package/types/modal/modal.d.ts +1 -0
- package/types/modal/toast.d.cts +8 -2
- package/types/modal/toast.d.ts +8 -2
- package/types/page/index.d.cts +2 -2
- package/types/page/index.d.ts +2 -2
- package/types/popconfirm/index.d.cts +2 -0
- package/types/popconfirm/index.d.ts +2 -0
- package/types/poptip/index.d.cts +2 -0
- package/types/poptip/index.d.ts +2 -0
- package/types/popup/layers.d.cts +2 -0
- package/types/popup/layers.d.ts +2 -0
- package/types/qrcode/index.d.cts +2 -2
- package/types/qrcode/index.d.ts +2 -2
- package/types/radio/radio-button.d.cts +2 -2
- package/types/radio/radio-button.d.ts +2 -2
- package/types/radio/radio-group.d.cts +2 -2
- package/types/radio/radio-group.d.ts +2 -2
- package/types/radio/radio.d.cts +2 -2
- package/types/radio/radio.d.ts +2 -2
- package/types/ripple/types.d.cts +18 -0
- package/types/ripple/types.d.ts +18 -0
- package/types/select/select.d.cts +2 -0
- package/types/select/select.d.ts +2 -0
- package/types/stat-card/stat-card.d.cts +3 -3
- package/types/stat-card/stat-card.d.ts +3 -3
- package/types/stat-card/utils/stat-item-key.d.cts +11 -0
- package/types/stat-card/utils/stat-item-key.d.ts +11 -0
- package/types/table/column-setting.d.cts +4 -4
- package/types/table/column-setting.d.ts +4 -4
- package/types/table/index.d.cts +2 -2
- package/types/table/index.d.ts +2 -2
- package/types/table/types.d.cts +21 -2
- package/types/table/types.d.ts +21 -2
- package/types/table/utils.d.cts +75 -0
- package/types/table/utils.d.ts +75 -0
- package/types/tag/index.d.cts +2 -2
- package/types/tag/index.d.ts +2 -2
- package/types/tooltip/index.d.cts +2 -0
- package/types/tooltip/index.d.ts +2 -0
- package/types/transfer/index.d.cts +3 -2
- package/types/transfer/index.d.ts +3 -2
- package/types/tree-select/index.d.cts +3 -1
- package/types/tree-select/index.d.ts +3 -1
- package/types/utils/checked.d.cts +1 -1
- package/types/utils/checked.d.ts +1 -1
- package/types/utils/color.d.cts +13 -0
- package/types/utils/color.d.ts +13 -0
- package/types/utils/css.d.cts +2 -0
- package/types/utils/css.d.ts +2 -0
- package/types/utils/focus.d.cts +5 -0
- package/types/utils/focus.d.ts +5 -0
- package/types/utils/overlay-order.d.cts +6 -0
- package/types/utils/overlay-order.d.ts +6 -0
- package/types/utils/overlay-stack.d.cts +13 -0
- package/types/utils/overlay-stack.d.ts +13 -0
- package/types/utils/promise.d.cts +5 -0
- package/types/utils/promise.d.ts +5 -0
- package/types/utils/react-node.d.cts +10 -0
- package/types/utils/react-node.d.ts +10 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.2.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 { useConfigAppearance } from "../config/use-config-appearance.js";
|
|
9
|
+
import { SURFACE_THEMES, resolvePaintedTheme, useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import { Ellipsis } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
11
11
|
import Button from "../button/button.js";
|
|
12
12
|
import ButtonGroup from "../button/button-group.js";
|
|
@@ -17,7 +17,7 @@ import { useRef } from "react";
|
|
|
17
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
18
|
//#region components/dropdown/dropdown-button.tsx
|
|
19
19
|
var DropdownButton = (t0) => {
|
|
20
|
-
const $ = c(
|
|
20
|
+
const $ = c(41);
|
|
21
21
|
let children;
|
|
22
22
|
let icon;
|
|
23
23
|
let onClick;
|
|
@@ -29,9 +29,11 @@ var DropdownButton = (t0) => {
|
|
|
29
29
|
let t2;
|
|
30
30
|
let t3;
|
|
31
31
|
let t4;
|
|
32
|
+
let t5;
|
|
32
33
|
let themeProp;
|
|
34
|
+
let trigger;
|
|
33
35
|
if ($[0] !== t0) {
|
|
34
|
-
({size: sizeProp, shape: shapeProp, disabled: t1, icon, theme: themeProp, arrow: t2, placement: t3, onClick, overlay, children, className:
|
|
36
|
+
({size: sizeProp, shape: shapeProp, disabled: t1, icon, theme: themeProp, arrow: t2, trigger, placement: t3, destroyOnClose: t4, onClick, overlay, children, className: t5, ...rest} = t0);
|
|
35
37
|
$[0] = t0;
|
|
36
38
|
$[1] = children;
|
|
37
39
|
$[2] = icon;
|
|
@@ -44,7 +46,9 @@ var DropdownButton = (t0) => {
|
|
|
44
46
|
$[9] = t2;
|
|
45
47
|
$[10] = t3;
|
|
46
48
|
$[11] = t4;
|
|
47
|
-
$[12] =
|
|
49
|
+
$[12] = t5;
|
|
50
|
+
$[13] = themeProp;
|
|
51
|
+
$[14] = trigger;
|
|
48
52
|
} else {
|
|
49
53
|
children = $[1];
|
|
50
54
|
icon = $[2];
|
|
@@ -57,66 +61,78 @@ var DropdownButton = (t0) => {
|
|
|
57
61
|
t2 = $[9];
|
|
58
62
|
t3 = $[10];
|
|
59
63
|
t4 = $[11];
|
|
60
|
-
|
|
64
|
+
t5 = $[12];
|
|
65
|
+
themeProp = $[13];
|
|
66
|
+
trigger = $[14];
|
|
61
67
|
}
|
|
62
68
|
const disabled = t1 === void 0 ? false : t1;
|
|
63
69
|
const arrow = t2 === void 0 ? false : t2;
|
|
64
70
|
const placement = t3 === void 0 ? "bottom-right" : t3;
|
|
65
|
-
const
|
|
71
|
+
const destroyOnClose = t4 === void 0 ? true : t4;
|
|
72
|
+
const className = t5 === void 0 ? "" : t5;
|
|
66
73
|
const inheritedAppearance = useConfigAppearance();
|
|
67
74
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
68
75
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
69
|
-
const
|
|
76
|
+
const t6 = themeProp ?? inheritedAppearance.theme;
|
|
77
|
+
let t7;
|
|
78
|
+
if ($[15] !== t6) {
|
|
79
|
+
t7 = resolvePaintedTheme(t6, SURFACE_THEMES);
|
|
80
|
+
$[15] = t6;
|
|
81
|
+
$[16] = t7;
|
|
82
|
+
} else t7 = $[16];
|
|
83
|
+
const theme = t7;
|
|
70
84
|
const refTrigger = useRef(null);
|
|
71
|
-
let
|
|
72
|
-
if ($[
|
|
73
|
-
|
|
85
|
+
let t8;
|
|
86
|
+
if ($[17] !== children || $[18] !== disabled || $[19] !== onClick || $[20] !== theme) {
|
|
87
|
+
t8 = /* @__PURE__ */ jsx(Button, {
|
|
74
88
|
disabled,
|
|
75
89
|
theme,
|
|
76
90
|
onClick,
|
|
77
91
|
children
|
|
78
92
|
});
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
} else
|
|
85
|
-
const
|
|
86
|
-
let
|
|
87
|
-
if ($[
|
|
88
|
-
|
|
93
|
+
$[17] = children;
|
|
94
|
+
$[18] = disabled;
|
|
95
|
+
$[19] = onClick;
|
|
96
|
+
$[20] = theme;
|
|
97
|
+
$[21] = t8;
|
|
98
|
+
} else t8 = $[21];
|
|
99
|
+
const t9 = !icon ? Ellipsis : icon;
|
|
100
|
+
let t10;
|
|
101
|
+
if ($[22] !== disabled || $[23] !== t9 || $[24] !== theme) {
|
|
102
|
+
t10 = /* @__PURE__ */ jsx(TriggerButton, {
|
|
89
103
|
disabled,
|
|
90
104
|
theme,
|
|
91
105
|
ref: refTrigger,
|
|
92
|
-
icon:
|
|
106
|
+
icon: t9,
|
|
93
107
|
className: "k-dropdown-trigger"
|
|
94
108
|
});
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
} else
|
|
100
|
-
let
|
|
101
|
-
if ($[
|
|
102
|
-
|
|
109
|
+
$[22] = disabled;
|
|
110
|
+
$[23] = t9;
|
|
111
|
+
$[24] = theme;
|
|
112
|
+
$[25] = t10;
|
|
113
|
+
} else t10 = $[25];
|
|
114
|
+
let t11;
|
|
115
|
+
if ($[26] !== shape || $[27] !== size || $[28] !== t10 || $[29] !== t8) {
|
|
116
|
+
t11 = /* @__PURE__ */ jsxs(ButtonGroup, {
|
|
103
117
|
className: "k-dropdown-button",
|
|
104
118
|
size,
|
|
105
119
|
shape,
|
|
106
|
-
children: [
|
|
120
|
+
children: [t8, t10]
|
|
107
121
|
});
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
} else
|
|
114
|
-
const triggerNode =
|
|
115
|
-
let
|
|
116
|
-
if ($[
|
|
117
|
-
|
|
122
|
+
$[26] = shape;
|
|
123
|
+
$[27] = size;
|
|
124
|
+
$[28] = t10;
|
|
125
|
+
$[29] = t8;
|
|
126
|
+
$[30] = t11;
|
|
127
|
+
} else t11 = $[30];
|
|
128
|
+
const triggerNode = t11;
|
|
129
|
+
let t12;
|
|
130
|
+
if ($[31] !== arrow || $[32] !== className || $[33] !== destroyOnClose || $[34] !== disabled || $[35] !== overlay || $[36] !== placement || $[37] !== rest || $[38] !== trigger || $[39] !== triggerNode) {
|
|
131
|
+
t12 = /* @__PURE__ */ jsx(Dropdown, {
|
|
118
132
|
arrow,
|
|
133
|
+
trigger,
|
|
119
134
|
placement,
|
|
135
|
+
destroyOnClose,
|
|
120
136
|
target: refTrigger,
|
|
121
137
|
disabled,
|
|
122
138
|
overlay,
|
|
@@ -124,16 +140,18 @@ var DropdownButton = (t0) => {
|
|
|
124
140
|
...rest,
|
|
125
141
|
children: triggerNode
|
|
126
142
|
});
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
|
|
136
|
-
|
|
143
|
+
$[31] = arrow;
|
|
144
|
+
$[32] = className;
|
|
145
|
+
$[33] = destroyOnClose;
|
|
146
|
+
$[34] = disabled;
|
|
147
|
+
$[35] = overlay;
|
|
148
|
+
$[36] = placement;
|
|
149
|
+
$[37] = rest;
|
|
150
|
+
$[38] = trigger;
|
|
151
|
+
$[39] = triggerNode;
|
|
152
|
+
$[40] = t12;
|
|
153
|
+
} else t12 = $[40];
|
|
154
|
+
return t12;
|
|
137
155
|
};
|
|
138
156
|
//#endregion
|
|
139
157
|
export { DropdownButton as default };
|
package/es/dropdown/dropdown.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.2.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
import Popup from "../popup/index.js";
|
|
10
10
|
import { DropdownContext } from "./dropdown-context.js";
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
12
|
-
import { useRef } from "react";
|
|
12
|
+
import { useRef, useState } from "react";
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
14
|
//#region components/dropdown/dropdown.tsx
|
|
15
15
|
var Dropdown = (t0) => {
|
|
16
|
-
const $ = c(
|
|
16
|
+
const $ = c(52);
|
|
17
17
|
let attrs;
|
|
18
18
|
let children;
|
|
19
19
|
let onOpenChange;
|
|
@@ -24,9 +24,10 @@ var Dropdown = (t0) => {
|
|
|
24
24
|
let t2;
|
|
25
25
|
let t3;
|
|
26
26
|
let t4;
|
|
27
|
+
let t5;
|
|
27
28
|
let target;
|
|
28
29
|
if ($[0] !== t0) {
|
|
29
|
-
({trigger: t1, disabled: t2, arrow: t3, open, show, placement: t4, target, onOpenChange, overlay, children, ...attrs} = t0);
|
|
30
|
+
({trigger: t1, disabled: t2, arrow: t3, open, show, placement: t4, destroyOnClose: t5, target, onOpenChange, overlay, children, ...attrs} = t0);
|
|
30
31
|
$[0] = t0;
|
|
31
32
|
$[1] = attrs;
|
|
32
33
|
$[2] = children;
|
|
@@ -38,7 +39,8 @@ var Dropdown = (t0) => {
|
|
|
38
39
|
$[8] = t2;
|
|
39
40
|
$[9] = t3;
|
|
40
41
|
$[10] = t4;
|
|
41
|
-
$[11] =
|
|
42
|
+
$[11] = t5;
|
|
43
|
+
$[12] = target;
|
|
42
44
|
} else {
|
|
43
45
|
attrs = $[1];
|
|
44
46
|
children = $[2];
|
|
@@ -50,47 +52,53 @@ var Dropdown = (t0) => {
|
|
|
50
52
|
t2 = $[8];
|
|
51
53
|
t3 = $[9];
|
|
52
54
|
t4 = $[10];
|
|
53
|
-
|
|
55
|
+
t5 = $[11];
|
|
56
|
+
target = $[12];
|
|
54
57
|
}
|
|
55
58
|
const trigger = t1 === void 0 ? "hover" : t1;
|
|
56
59
|
const disabled = t2 === void 0 ? false : t2;
|
|
57
60
|
const arrow = t3 === void 0 ? false : t3;
|
|
58
61
|
const placement = t4 === void 0 ? "bottom-left" : t4;
|
|
62
|
+
const destroyOnClose = t5 === void 0 ? true : t5;
|
|
59
63
|
const popupRef = useRef(null);
|
|
60
64
|
const pendingFocus = useRef(null);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
const [innerVisible, setInnerVisible] = useState(false);
|
|
66
|
+
const visible = open ?? show ?? innerVisible;
|
|
67
|
+
let t6;
|
|
68
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
69
|
+
t6 = () => {
|
|
64
70
|
if (pendingFocus.current === null) return;
|
|
65
71
|
const items = popupRef.current?.getPopupElement()?.querySelectorAll("[role=\"menuitem\"]:not([aria-disabled=\"true\"])");
|
|
66
72
|
if (!items?.length) return;
|
|
67
73
|
items[pendingFocus.current ? items.length - 1 : 0]?.focus({ preventScroll: true });
|
|
68
74
|
pendingFocus.current = null;
|
|
69
75
|
};
|
|
70
|
-
$[12] = t5;
|
|
71
|
-
} else t5 = $[12];
|
|
72
|
-
const focusMenuItem = t5;
|
|
73
|
-
let t6;
|
|
74
|
-
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
75
|
-
t6 = () => popupRef.current?.cancelClose();
|
|
76
76
|
$[13] = t6;
|
|
77
77
|
} else t6 = $[13];
|
|
78
|
+
const focusMenuItem = t6;
|
|
78
79
|
let t7;
|
|
79
|
-
if ($[14]
|
|
80
|
-
t7 = () => {
|
|
81
|
-
if (
|
|
80
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
81
|
+
t7 = (event) => {
|
|
82
|
+
if (event.key !== "ArrowDown" && event.key !== "ArrowUp") return;
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
pendingFocus.current = event.key === "ArrowUp";
|
|
85
|
+
popupRef.current?.open();
|
|
86
|
+
focusMenuItem();
|
|
82
87
|
};
|
|
83
|
-
$[14] =
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
$[14] = t7;
|
|
89
|
+
} else t7 = $[14];
|
|
90
|
+
const openOnArrowKey = t7;
|
|
86
91
|
let t8;
|
|
87
92
|
let t9;
|
|
88
|
-
if ($[
|
|
89
|
-
t8 = () =>
|
|
93
|
+
if ($[15] !== trigger) {
|
|
94
|
+
t8 = () => {
|
|
95
|
+
if (trigger === "hover") popupRef.current?.open();
|
|
96
|
+
else popupRef.current?.cancelClose();
|
|
97
|
+
};
|
|
90
98
|
t9 = () => {
|
|
91
|
-
popupRef.current?.
|
|
92
|
-
popupRef.current?.getTriggerElement()?.focus({ preventScroll: true });
|
|
99
|
+
if (trigger === "hover") popupRef.current?.scheduleClose();
|
|
93
100
|
};
|
|
101
|
+
$[15] = trigger;
|
|
94
102
|
$[16] = t8;
|
|
95
103
|
$[17] = t9;
|
|
96
104
|
} else {
|
|
@@ -98,96 +106,132 @@ var Dropdown = (t0) => {
|
|
|
98
106
|
t9 = $[17];
|
|
99
107
|
}
|
|
100
108
|
let t10;
|
|
101
|
-
if ($[18] !==
|
|
102
|
-
t10 = {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
menuSelected: t9
|
|
109
|
+
if ($[18] !== trigger || $[19] !== visible) {
|
|
110
|
+
t10 = () => {
|
|
111
|
+
if (trigger !== "click") return;
|
|
112
|
+
if (visible) popupRef.current?.close();
|
|
113
|
+
else popupRef.current?.open();
|
|
107
114
|
};
|
|
108
|
-
$[18] =
|
|
109
|
-
$[19] =
|
|
110
|
-
|
|
111
|
-
|
|
115
|
+
$[18] = trigger;
|
|
116
|
+
$[19] = visible;
|
|
117
|
+
$[20] = t10;
|
|
118
|
+
} else t10 = $[20];
|
|
119
|
+
let t11;
|
|
120
|
+
if ($[21] !== trigger) {
|
|
121
|
+
t11 = () => {
|
|
122
|
+
if (trigger === "contextmenu") popupRef.current?.open();
|
|
123
|
+
};
|
|
124
|
+
$[21] = trigger;
|
|
125
|
+
$[22] = t11;
|
|
126
|
+
} else t11 = $[22];
|
|
112
127
|
let t12;
|
|
113
|
-
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
114
|
-
t12 = { "aria-haspopup": "menu" };
|
|
115
|
-
$[20] = t12;
|
|
116
|
-
} else t12 = $[20];
|
|
117
128
|
let t13;
|
|
118
|
-
if ($[
|
|
119
|
-
|
|
129
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
130
|
+
t12 = () => popupRef.current?.cancelClose();
|
|
131
|
+
t13 = () => {
|
|
132
|
+
popupRef.current?.close();
|
|
133
|
+
popupRef.current?.getTriggerElement()?.focus({ preventScroll: true });
|
|
134
|
+
};
|
|
135
|
+
$[23] = t12;
|
|
136
|
+
$[24] = t13;
|
|
137
|
+
} else {
|
|
138
|
+
t12 = $[23];
|
|
139
|
+
t13 = $[24];
|
|
140
|
+
}
|
|
141
|
+
let t14;
|
|
142
|
+
if ($[25] !== t10 || $[26] !== t11 || $[27] !== t8 || $[28] !== t9 || $[29] !== visible) {
|
|
143
|
+
t14 = {
|
|
144
|
+
expanded: visible,
|
|
145
|
+
onMouseEnter: t8,
|
|
146
|
+
onMouseLeave: t9,
|
|
147
|
+
onClick: t10,
|
|
148
|
+
onContextMenu: t11,
|
|
149
|
+
onTriggerKeydown: openOnArrowKey,
|
|
150
|
+
clearPopTimer: t12,
|
|
151
|
+
menuSelected: t13
|
|
152
|
+
};
|
|
153
|
+
$[25] = t10;
|
|
154
|
+
$[26] = t11;
|
|
155
|
+
$[27] = t8;
|
|
156
|
+
$[28] = t9;
|
|
157
|
+
$[29] = visible;
|
|
158
|
+
$[30] = t14;
|
|
159
|
+
} else t14 = $[30];
|
|
160
|
+
const t15 = open ?? show;
|
|
161
|
+
let t16;
|
|
162
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
163
|
+
t16 = { "aria-haspopup": "menu" };
|
|
164
|
+
$[31] = t16;
|
|
165
|
+
} else t16 = $[31];
|
|
166
|
+
let t17;
|
|
167
|
+
if ($[32] !== onOpenChange) {
|
|
168
|
+
t17 = (next, detail) => {
|
|
169
|
+
setInnerVisible(next);
|
|
120
170
|
if (next && detail.reason === "contextmenu") pendingFocus.current = false;
|
|
121
171
|
if (!next) pendingFocus.current = null;
|
|
122
172
|
onOpenChange?.(next);
|
|
123
173
|
};
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
} else
|
|
127
|
-
let
|
|
128
|
-
if ($[
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
$[23] = t14;
|
|
138
|
-
} else t14 = $[23];
|
|
139
|
-
let t15;
|
|
140
|
-
if ($[24] !== overlay) {
|
|
141
|
-
t15 = /* @__PURE__ */ jsx("div", {
|
|
174
|
+
$[32] = onOpenChange;
|
|
175
|
+
$[33] = t17;
|
|
176
|
+
} else t17 = $[33];
|
|
177
|
+
let t18;
|
|
178
|
+
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
179
|
+
t18 = (event_0) => openOnArrowKey(event_0);
|
|
180
|
+
$[34] = t18;
|
|
181
|
+
} else t18 = $[34];
|
|
182
|
+
let t19;
|
|
183
|
+
if ($[35] !== overlay) {
|
|
184
|
+
t19 = /* @__PURE__ */ jsx("div", {
|
|
142
185
|
className: "k-dropdown-body",
|
|
143
186
|
children: overlay
|
|
144
187
|
});
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
} else
|
|
148
|
-
let
|
|
149
|
-
if ($[
|
|
150
|
-
|
|
188
|
+
$[35] = overlay;
|
|
189
|
+
$[36] = t19;
|
|
190
|
+
} else t19 = $[36];
|
|
191
|
+
let t20;
|
|
192
|
+
if ($[37] !== arrow || $[38] !== attrs || $[39] !== children || $[40] !== destroyOnClose || $[41] !== disabled || $[42] !== placement || $[43] !== t15 || $[44] !== t17 || $[45] !== t19 || $[46] !== target || $[47] !== trigger) {
|
|
193
|
+
t20 = /* @__PURE__ */ jsx(Popup, {
|
|
151
194
|
...attrs,
|
|
152
195
|
ref: popupRef,
|
|
153
|
-
open:
|
|
196
|
+
open: t15,
|
|
154
197
|
trigger,
|
|
155
198
|
disabled,
|
|
156
199
|
arrow,
|
|
157
200
|
placement,
|
|
158
201
|
target,
|
|
159
202
|
prefixCls: "k-dropdown",
|
|
160
|
-
destroyOnClose
|
|
161
|
-
triggerProps:
|
|
162
|
-
onOpenChange:
|
|
163
|
-
onTriggerKeyDown:
|
|
203
|
+
destroyOnClose,
|
|
204
|
+
triggerProps: t16,
|
|
205
|
+
onOpenChange: t17,
|
|
206
|
+
onTriggerKeyDown: t18,
|
|
164
207
|
onAfterOpen: focusMenuItem,
|
|
165
|
-
overlay:
|
|
208
|
+
overlay: t19,
|
|
166
209
|
children
|
|
167
210
|
});
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
211
|
+
$[37] = arrow;
|
|
212
|
+
$[38] = attrs;
|
|
213
|
+
$[39] = children;
|
|
214
|
+
$[40] = destroyOnClose;
|
|
215
|
+
$[41] = disabled;
|
|
216
|
+
$[42] = placement;
|
|
217
|
+
$[43] = t15;
|
|
218
|
+
$[44] = t17;
|
|
219
|
+
$[45] = t19;
|
|
220
|
+
$[46] = target;
|
|
221
|
+
$[47] = trigger;
|
|
222
|
+
$[48] = t20;
|
|
223
|
+
} else t20 = $[48];
|
|
224
|
+
let t21;
|
|
225
|
+
if ($[49] !== t14 || $[50] !== t20) {
|
|
226
|
+
t21 = /* @__PURE__ */ jsx(DropdownContext.Provider, {
|
|
227
|
+
value: t14,
|
|
228
|
+
children: t20
|
|
185
229
|
});
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
} else
|
|
190
|
-
return
|
|
230
|
+
$[49] = t14;
|
|
231
|
+
$[50] = t20;
|
|
232
|
+
$[51] = t21;
|
|
233
|
+
} else t21 = $[51];
|
|
234
|
+
return t21;
|
|
191
235
|
};
|
|
192
236
|
//#endregion
|
|
193
237
|
export { Dropdown as default };
|
package/es/dropdown/trigger.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.2.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -13,75 +13,127 @@ import React from "react";
|
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
14
|
//#region components/dropdown/trigger.tsx
|
|
15
15
|
var TriggerButton = React.forwardRef((t0, ref) => {
|
|
16
|
-
const $ = c(
|
|
16
|
+
const $ = c(37);
|
|
17
17
|
let children;
|
|
18
18
|
let icon;
|
|
19
|
+
let onClick;
|
|
20
|
+
let onContextMenu;
|
|
21
|
+
let onKeyDown;
|
|
19
22
|
let onMouseEnter;
|
|
20
23
|
let onMouseLeave;
|
|
21
24
|
let rest;
|
|
22
25
|
let t1;
|
|
23
26
|
if ($[0] !== t0) {
|
|
24
|
-
({icon, disabled: t1, children, onMouseEnter, onMouseLeave, ...rest} = t0);
|
|
27
|
+
({icon, disabled: t1, children, onMouseEnter, onMouseLeave, onClick, onContextMenu, onKeyDown, ...rest} = t0);
|
|
25
28
|
$[0] = t0;
|
|
26
29
|
$[1] = children;
|
|
27
30
|
$[2] = icon;
|
|
28
|
-
$[3] =
|
|
29
|
-
$[4] =
|
|
30
|
-
$[5] =
|
|
31
|
-
$[6] =
|
|
31
|
+
$[3] = onClick;
|
|
32
|
+
$[4] = onContextMenu;
|
|
33
|
+
$[5] = onKeyDown;
|
|
34
|
+
$[6] = onMouseEnter;
|
|
35
|
+
$[7] = onMouseLeave;
|
|
36
|
+
$[8] = rest;
|
|
37
|
+
$[9] = t1;
|
|
32
38
|
} else {
|
|
33
39
|
children = $[1];
|
|
34
40
|
icon = $[2];
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
onClick = $[3];
|
|
42
|
+
onContextMenu = $[4];
|
|
43
|
+
onKeyDown = $[5];
|
|
44
|
+
onMouseEnter = $[6];
|
|
45
|
+
onMouseLeave = $[7];
|
|
46
|
+
rest = $[8];
|
|
47
|
+
t1 = $[9];
|
|
39
48
|
}
|
|
40
49
|
const disabled = t1 === void 0 ? false : t1;
|
|
41
50
|
const dropdown = useDropdownContext();
|
|
42
51
|
let t2;
|
|
43
|
-
if ($[
|
|
52
|
+
if ($[10] !== dropdown || $[11] !== onMouseEnter) {
|
|
44
53
|
t2 = (e) => {
|
|
45
54
|
dropdown?.onMouseEnter?.();
|
|
46
55
|
onMouseEnter?.(e);
|
|
47
56
|
};
|
|
48
|
-
$[
|
|
49
|
-
$[
|
|
50
|
-
$[
|
|
51
|
-
} else t2 = $[
|
|
57
|
+
$[10] = dropdown;
|
|
58
|
+
$[11] = onMouseEnter;
|
|
59
|
+
$[12] = t2;
|
|
60
|
+
} else t2 = $[12];
|
|
52
61
|
const handleMouseEnter = t2;
|
|
53
62
|
let t3;
|
|
54
|
-
if ($[
|
|
63
|
+
if ($[13] !== dropdown || $[14] !== onMouseLeave) {
|
|
55
64
|
t3 = (e_0) => {
|
|
56
65
|
dropdown?.onMouseLeave?.();
|
|
57
66
|
onMouseLeave?.(e_0);
|
|
58
67
|
};
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
62
|
-
} else t3 = $[
|
|
68
|
+
$[13] = dropdown;
|
|
69
|
+
$[14] = onMouseLeave;
|
|
70
|
+
$[15] = t3;
|
|
71
|
+
} else t3 = $[15];
|
|
63
72
|
const handleMouseLeave = t3;
|
|
64
73
|
let t4;
|
|
65
|
-
if ($[
|
|
66
|
-
t4 =
|
|
74
|
+
if ($[16] !== dropdown || $[17] !== onClick) {
|
|
75
|
+
t4 = (e_1) => {
|
|
76
|
+
dropdown?.onClick?.();
|
|
77
|
+
onClick?.(e_1);
|
|
78
|
+
};
|
|
79
|
+
$[16] = dropdown;
|
|
80
|
+
$[17] = onClick;
|
|
81
|
+
$[18] = t4;
|
|
82
|
+
} else t4 = $[18];
|
|
83
|
+
const handleClick = t4;
|
|
84
|
+
let t5;
|
|
85
|
+
if ($[19] !== dropdown || $[20] !== onContextMenu) {
|
|
86
|
+
t5 = (e_2) => {
|
|
87
|
+
dropdown?.onContextMenu?.();
|
|
88
|
+
onContextMenu?.(e_2);
|
|
89
|
+
};
|
|
90
|
+
$[19] = dropdown;
|
|
91
|
+
$[20] = onContextMenu;
|
|
92
|
+
$[21] = t5;
|
|
93
|
+
} else t5 = $[21];
|
|
94
|
+
const handleContextMenu = t5;
|
|
95
|
+
let t6;
|
|
96
|
+
if ($[22] !== dropdown || $[23] !== onKeyDown) {
|
|
97
|
+
t6 = (e_3) => {
|
|
98
|
+
dropdown?.onTriggerKeydown?.(e_3);
|
|
99
|
+
onKeyDown?.(e_3);
|
|
100
|
+
};
|
|
101
|
+
$[22] = dropdown;
|
|
102
|
+
$[23] = onKeyDown;
|
|
103
|
+
$[24] = t6;
|
|
104
|
+
} else t6 = $[24];
|
|
105
|
+
const handleKeyDown = t6;
|
|
106
|
+
const t7 = !!dropdown?.expanded;
|
|
107
|
+
let t8;
|
|
108
|
+
if ($[25] !== children || $[26] !== disabled || $[27] !== handleClick || $[28] !== handleContextMenu || $[29] !== handleKeyDown || $[30] !== handleMouseEnter || $[31] !== handleMouseLeave || $[32] !== icon || $[33] !== ref || $[34] !== rest || $[35] !== t7) {
|
|
109
|
+
t8 = /* @__PURE__ */ jsx(Button, {
|
|
67
110
|
ref,
|
|
68
111
|
icon,
|
|
69
112
|
disabled,
|
|
113
|
+
"aria-haspopup": "menu",
|
|
114
|
+
"aria-expanded": t7,
|
|
70
115
|
onMouseEnter: handleMouseEnter,
|
|
71
116
|
onMouseLeave: handleMouseLeave,
|
|
117
|
+
onClick: handleClick,
|
|
118
|
+
onContextMenu: handleContextMenu,
|
|
119
|
+
onKeyDown: handleKeyDown,
|
|
72
120
|
...rest,
|
|
73
121
|
children
|
|
74
122
|
});
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
|
|
84
|
-
|
|
123
|
+
$[25] = children;
|
|
124
|
+
$[26] = disabled;
|
|
125
|
+
$[27] = handleClick;
|
|
126
|
+
$[28] = handleContextMenu;
|
|
127
|
+
$[29] = handleKeyDown;
|
|
128
|
+
$[30] = handleMouseEnter;
|
|
129
|
+
$[31] = handleMouseLeave;
|
|
130
|
+
$[32] = icon;
|
|
131
|
+
$[33] = ref;
|
|
132
|
+
$[34] = rest;
|
|
133
|
+
$[35] = t7;
|
|
134
|
+
$[36] = t8;
|
|
135
|
+
} else t8 = $[36];
|
|
136
|
+
return t8;
|
|
85
137
|
});
|
|
86
138
|
TriggerButton.displayName = "TriggerButton";
|
|
87
139
|
//#endregion
|