react-kui 3.1.2 → 3.2.1
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 +918 -324
- 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 +112 -92
- package/es/select/option.js +1 -1
- package/es/select/select.js +29 -29
- 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 +556 -207
- package/es/table/utils.js +140 -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/segmented/index.d.cts +2 -1
- package/types/segmented/index.d.ts +2 -1
- 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
package/es/modal/modal.js
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.1
|
|
2
|
+
* react-kui v3.2.1
|
|
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 { ConfigContext } from "../config/config-context.js";
|
|
9
|
+
import { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
|
|
11
10
|
import Teleport from "../base/teleport.js";
|
|
12
11
|
import { Transition } from "../base/transition.js";
|
|
12
|
+
import { PopupHostContext, usePopupHostScope } from "../config/popup-host.js";
|
|
13
|
+
import { toggleContainerScroll } from "../utils/react-node.js";
|
|
13
14
|
import { X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
14
15
|
import { useValue } from "../utils/use-value.js";
|
|
15
16
|
import Button from "../button/button.js";
|
|
17
|
+
import { toCssLength } from "../utils/css.js";
|
|
18
|
+
import { pushOverlay } from "../utils/overlay-stack.js";
|
|
16
19
|
import { getMousePoint } from "../config/context.js";
|
|
20
|
+
import { createFocusTrap } from "../utils/focus.js";
|
|
17
21
|
import { c } from "react/compiler-runtime";
|
|
18
22
|
import clsx from "clsx";
|
|
19
23
|
import { useContext, useEffect, useRef, useState } from "react";
|
|
20
24
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
21
25
|
//#region components/modal/modal.tsx
|
|
22
26
|
var Modal = (t0) => {
|
|
23
|
-
const $ = c(
|
|
24
|
-
const { className, open, title, okText, cancelText, width: t1, top: t2, mask: t3, maskClosable: t4, maximized: t5, centered: t6, draggable: t7, showClose: t8, loading: t9, footer: t10, escKey: t11, panelOnly: t12, onClose, onOk, onCancel, onOpenChange, onAfterClose, content, children } = t0;
|
|
27
|
+
const $ = c(137);
|
|
28
|
+
const { className, open, title, okText, cancelText, width: t1, top: t2, mask: t3, maskClosable: t4, maximized: t5, centered: t6, draggable: t7, showClose: t8, loading: t9, footer: t10, escKey: t11, panelOnly: t12, destroyOnClose: t13, onClose, onOk, onCancel, onOpenChange, onAfterClose, content, children } = t0;
|
|
25
29
|
const width = t1 === void 0 ? 520 : t1;
|
|
26
30
|
const top = t2 === void 0 ? 100 : t2;
|
|
27
31
|
const mask = t3 === void 0 ? true : t3;
|
|
@@ -34,90 +38,132 @@ var Modal = (t0) => {
|
|
|
34
38
|
const footer = t10 === void 0 ? true : t10;
|
|
35
39
|
const escKey = t11 === void 0 ? true : t11;
|
|
36
40
|
const panelOnly = t12 === void 0 ? false : t12;
|
|
37
|
-
const
|
|
41
|
+
const destroyOnClose = t13 === void 0 ? true : t13;
|
|
42
|
+
const locale = useContext(ConfigContext)?.locale || DEFAULT_LOCALE;
|
|
43
|
+
const { register: registerHostedPopup, closeAll: closeHostedPopups } = usePopupHostScope();
|
|
38
44
|
const [innerOpen, setInnerOpen] = useValue(open, _temp);
|
|
39
45
|
const currentOpen = innerOpen;
|
|
40
|
-
const [visible, setVisible] = useState(
|
|
41
|
-
const [showInner, setShowInner] = useState(
|
|
42
|
-
const [rendered, setRendered] = useState(
|
|
46
|
+
const [visible, setVisible] = useState(panelOnly);
|
|
47
|
+
const [showInner, setShowInner] = useState(panelOnly);
|
|
48
|
+
const [rendered, setRendered] = useState(panelOnly);
|
|
43
49
|
const [leftPos, setLeftPos] = useState(0);
|
|
44
50
|
const [topPos, setTopPos] = useState(top);
|
|
45
51
|
const [isMousePressed, setIsMousePressed] = useState(false);
|
|
46
52
|
const [mousedownIn, setMousedownIn] = useState(false);
|
|
47
|
-
let
|
|
53
|
+
let t14;
|
|
48
54
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
49
|
-
|
|
55
|
+
t14 = {
|
|
50
56
|
x: 0,
|
|
51
57
|
y: 0
|
|
52
58
|
};
|
|
53
|
-
$[0] =
|
|
54
|
-
} else
|
|
55
|
-
const startPos = useRef(
|
|
59
|
+
$[0] = t14;
|
|
60
|
+
} else t14 = $[0];
|
|
61
|
+
const startPos = useRef(t14);
|
|
56
62
|
const refModal = useRef(null);
|
|
57
63
|
const refWrap = useRef(null);
|
|
58
64
|
const refHeader = useRef(null);
|
|
59
|
-
const previousActiveRef = useRef(null);
|
|
60
65
|
const hideTimerRef = useRef(null);
|
|
61
|
-
const
|
|
62
|
-
let
|
|
66
|
+
const focusTrapRef = useRef(null);
|
|
67
|
+
let t15;
|
|
63
68
|
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
64
|
-
|
|
69
|
+
t15 = (event) => {
|
|
70
|
+
focusTrapRef.current?.handleKeydown(event.nativeEvent);
|
|
71
|
+
};
|
|
72
|
+
$[1] = t15;
|
|
73
|
+
} else t15 = $[1];
|
|
74
|
+
const handleModalKeydown = t15;
|
|
75
|
+
const scrollLockedRef = useRef(false);
|
|
76
|
+
const overlayRef = useRef(null);
|
|
77
|
+
let t16;
|
|
78
|
+
if ($[2] !== panelOnly) {
|
|
79
|
+
t16 = (lock) => {
|
|
80
|
+
if (panelOnly || scrollLockedRef.current === lock) return;
|
|
81
|
+
toggleContainerScroll(typeof document === "undefined" ? null : document.body, lock);
|
|
82
|
+
scrollLockedRef.current = lock;
|
|
83
|
+
};
|
|
84
|
+
$[2] = panelOnly;
|
|
85
|
+
$[3] = t16;
|
|
86
|
+
} else t16 = $[3];
|
|
87
|
+
const updateScrollLock = t16;
|
|
88
|
+
const getOffset = _temp2;
|
|
89
|
+
let t17;
|
|
90
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
91
|
+
t17 = () => {
|
|
92
|
+
if (hideTimerRef.current === null) return;
|
|
93
|
+
clearTimeout(hideTimerRef.current);
|
|
94
|
+
hideTimerRef.current = null;
|
|
95
|
+
};
|
|
96
|
+
$[4] = t17;
|
|
97
|
+
} else t17 = $[4];
|
|
98
|
+
const cancelHide = t17;
|
|
99
|
+
let t18;
|
|
100
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
101
|
+
t18 = () => {
|
|
65
102
|
if (refModal.current) {
|
|
66
103
|
const { x, y } = getMousePoint();
|
|
67
104
|
const p = getOffset(refModal.current);
|
|
68
105
|
refModal.current.style.transformOrigin = `${x - p.left}px ${y - p.top}px`;
|
|
69
106
|
}
|
|
70
107
|
};
|
|
71
|
-
$[
|
|
72
|
-
} else
|
|
73
|
-
const updateOrigin =
|
|
74
|
-
let
|
|
75
|
-
if ($[
|
|
76
|
-
|
|
108
|
+
$[5] = t18;
|
|
109
|
+
} else t18 = $[5];
|
|
110
|
+
const updateOrigin = t18;
|
|
111
|
+
let t19;
|
|
112
|
+
if ($[6] !== closeHostedPopups || $[7] !== destroyOnClose || $[8] !== draggable || $[9] !== panelOnly || $[10] !== rendered || $[11] !== top || $[12] !== updateScrollLock) {
|
|
113
|
+
t19 = (value) => {
|
|
114
|
+
if (value) cancelHide();
|
|
77
115
|
if (!rendered && value) {
|
|
78
116
|
setRendered(true);
|
|
79
117
|
return;
|
|
80
118
|
}
|
|
81
119
|
if (value) {
|
|
82
|
-
|
|
120
|
+
updateScrollLock(true);
|
|
83
121
|
setLeftPos(0);
|
|
84
122
|
setTopPos(top);
|
|
85
123
|
setVisible(true);
|
|
86
124
|
setShowInner(true);
|
|
87
|
-
refWrap.current?.focus();
|
|
88
125
|
setTimeout(() => {
|
|
89
126
|
if (draggable && refModal.current) setLeftPos((document.body.offsetWidth - refModal.current.offsetWidth) / 2);
|
|
90
127
|
updateOrigin();
|
|
91
128
|
}, 100);
|
|
92
129
|
} else {
|
|
130
|
+
closeHostedPopups();
|
|
131
|
+
focusTrapRef.current?.deactivate();
|
|
132
|
+
updateScrollLock(false);
|
|
93
133
|
setVisible(false);
|
|
94
|
-
|
|
134
|
+
cancelHide();
|
|
95
135
|
hideTimerRef.current = setTimeout(() => {
|
|
136
|
+
hideTimerRef.current = null;
|
|
96
137
|
setShowInner(false);
|
|
138
|
+
if (destroyOnClose && !panelOnly) setRendered(false);
|
|
97
139
|
}, 300);
|
|
98
140
|
}
|
|
99
141
|
};
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
142
|
+
$[6] = closeHostedPopups;
|
|
143
|
+
$[7] = destroyOnClose;
|
|
144
|
+
$[8] = draggable;
|
|
145
|
+
$[9] = panelOnly;
|
|
146
|
+
$[10] = rendered;
|
|
147
|
+
$[11] = top;
|
|
148
|
+
$[12] = updateScrollLock;
|
|
149
|
+
$[13] = t19;
|
|
150
|
+
} else t19 = $[13];
|
|
151
|
+
const toggle = t19;
|
|
152
|
+
let t20;
|
|
153
|
+
if ($[14] !== onOpenChange || $[15] !== setInnerOpen) {
|
|
154
|
+
t20 = (next_0) => {
|
|
109
155
|
setInnerOpen(next_0);
|
|
110
156
|
onOpenChange?.(next_0);
|
|
111
157
|
};
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
} else
|
|
116
|
-
const requestOpen =
|
|
117
|
-
let
|
|
118
|
-
let
|
|
119
|
-
if ($[
|
|
120
|
-
|
|
158
|
+
$[14] = onOpenChange;
|
|
159
|
+
$[15] = setInnerOpen;
|
|
160
|
+
$[16] = t20;
|
|
161
|
+
} else t20 = $[16];
|
|
162
|
+
const requestOpen = t20;
|
|
163
|
+
let t21;
|
|
164
|
+
let t22;
|
|
165
|
+
if ($[17] !== currentOpen || $[18] !== panelOnly || $[19] !== rendered || $[20] !== toggle || $[21] !== visible) {
|
|
166
|
+
t21 = () => {
|
|
121
167
|
if (panelOnly) return;
|
|
122
168
|
const timer = setTimeout(() => {
|
|
123
169
|
if (currentOpen && !rendered) {
|
|
@@ -127,128 +173,185 @@ var Modal = (t0) => {
|
|
|
127
173
|
}, 0);
|
|
128
174
|
return () => clearTimeout(timer);
|
|
129
175
|
};
|
|
130
|
-
|
|
176
|
+
t22 = [
|
|
131
177
|
currentOpen,
|
|
132
178
|
panelOnly,
|
|
133
179
|
toggle,
|
|
134
180
|
rendered,
|
|
135
181
|
visible
|
|
136
182
|
];
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
183
|
+
$[17] = currentOpen;
|
|
184
|
+
$[18] = panelOnly;
|
|
185
|
+
$[19] = rendered;
|
|
186
|
+
$[20] = toggle;
|
|
187
|
+
$[21] = visible;
|
|
188
|
+
$[22] = t21;
|
|
189
|
+
$[23] = t22;
|
|
144
190
|
} else {
|
|
145
|
-
|
|
146
|
-
|
|
191
|
+
t21 = $[22];
|
|
192
|
+
t22 = $[23];
|
|
147
193
|
}
|
|
148
|
-
useEffect(
|
|
149
|
-
let
|
|
150
|
-
let
|
|
151
|
-
if ($[
|
|
152
|
-
|
|
153
|
-
|
|
194
|
+
useEffect(t21, t22);
|
|
195
|
+
let t23;
|
|
196
|
+
let t24;
|
|
197
|
+
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
198
|
+
t23 = () => () => {
|
|
199
|
+
cancelHide();
|
|
200
|
+
if (scrollLockedRef.current) {
|
|
201
|
+
toggleContainerScroll(document.body, false);
|
|
202
|
+
scrollLockedRef.current = false;
|
|
203
|
+
}
|
|
204
|
+
focusTrapRef.current?.deactivate();
|
|
154
205
|
};
|
|
155
|
-
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
206
|
+
t24 = [cancelHide];
|
|
207
|
+
$[24] = t23;
|
|
208
|
+
$[25] = t24;
|
|
158
209
|
} else {
|
|
159
|
-
|
|
160
|
-
|
|
210
|
+
t23 = $[24];
|
|
211
|
+
t24 = $[25];
|
|
161
212
|
}
|
|
162
|
-
useEffect(
|
|
163
|
-
let
|
|
164
|
-
|
|
165
|
-
|
|
213
|
+
useEffect(t23, t24);
|
|
214
|
+
let t25;
|
|
215
|
+
let t26;
|
|
216
|
+
if ($[26] !== panelOnly || $[27] !== rendered || $[28] !== visible) {
|
|
217
|
+
t25 = () => {
|
|
218
|
+
if (panelOnly || !rendered || !visible) return;
|
|
219
|
+
if (!focusTrapRef.current) focusTrapRef.current = createFocusTrap(() => refModal.current);
|
|
220
|
+
focusTrapRef.current.activate();
|
|
221
|
+
};
|
|
222
|
+
t26 = [
|
|
223
|
+
panelOnly,
|
|
224
|
+
rendered,
|
|
225
|
+
visible
|
|
226
|
+
];
|
|
227
|
+
$[26] = panelOnly;
|
|
228
|
+
$[27] = rendered;
|
|
229
|
+
$[28] = visible;
|
|
230
|
+
$[29] = t25;
|
|
231
|
+
$[30] = t26;
|
|
232
|
+
} else {
|
|
233
|
+
t25 = $[29];
|
|
234
|
+
t26 = $[30];
|
|
235
|
+
}
|
|
236
|
+
useEffect(t25, t26);
|
|
237
|
+
let t27;
|
|
238
|
+
let t28;
|
|
239
|
+
if ($[31] !== panelOnly || $[32] !== rendered || $[33] !== visible) {
|
|
240
|
+
t27 = () => {
|
|
241
|
+
if (panelOnly || !rendered || !visible) return;
|
|
242
|
+
const handle = pushOverlay();
|
|
243
|
+
overlayRef.current = handle;
|
|
244
|
+
return () => {
|
|
245
|
+
handle.release();
|
|
246
|
+
if (overlayRef.current === handle) overlayRef.current = null;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
t28 = [
|
|
250
|
+
panelOnly,
|
|
251
|
+
rendered,
|
|
252
|
+
visible
|
|
253
|
+
];
|
|
254
|
+
$[31] = panelOnly;
|
|
255
|
+
$[32] = rendered;
|
|
256
|
+
$[33] = visible;
|
|
257
|
+
$[34] = t27;
|
|
258
|
+
$[35] = t28;
|
|
259
|
+
} else {
|
|
260
|
+
t27 = $[34];
|
|
261
|
+
t28 = $[35];
|
|
262
|
+
}
|
|
263
|
+
useEffect(t27, t28);
|
|
264
|
+
let t29;
|
|
265
|
+
if ($[36] !== onClose || $[37] !== requestOpen) {
|
|
266
|
+
t29 = () => {
|
|
166
267
|
requestOpen(false);
|
|
167
268
|
onClose?.();
|
|
168
269
|
};
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
} else
|
|
173
|
-
const close =
|
|
174
|
-
let
|
|
175
|
-
if ($[
|
|
176
|
-
|
|
177
|
-
if (e.key
|
|
270
|
+
$[36] = onClose;
|
|
271
|
+
$[37] = requestOpen;
|
|
272
|
+
$[38] = t29;
|
|
273
|
+
} else t29 = $[38];
|
|
274
|
+
const close = t29;
|
|
275
|
+
let t30;
|
|
276
|
+
if ($[39] !== close || $[40] !== visible) {
|
|
277
|
+
t30 = (e) => {
|
|
278
|
+
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
279
|
+
if (!visible) return;
|
|
280
|
+
if (!overlayRef.current?.isTop()) return;
|
|
281
|
+
close();
|
|
178
282
|
};
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
let
|
|
185
|
-
|
|
186
|
-
|
|
283
|
+
$[39] = close;
|
|
284
|
+
$[40] = visible;
|
|
285
|
+
$[41] = t30;
|
|
286
|
+
} else t30 = $[41];
|
|
287
|
+
const escToClose = t30;
|
|
288
|
+
let t31;
|
|
289
|
+
let t32;
|
|
290
|
+
if ($[42] !== escKey || $[43] !== escToClose || $[44] !== panelOnly) {
|
|
291
|
+
t31 = () => {
|
|
187
292
|
if (panelOnly || !escKey) return;
|
|
188
293
|
document.addEventListener("keydown", escToClose);
|
|
189
294
|
return () => {
|
|
190
295
|
document.removeEventListener("keydown", escToClose);
|
|
191
296
|
};
|
|
192
297
|
};
|
|
193
|
-
|
|
298
|
+
t32 = [
|
|
194
299
|
escKey,
|
|
195
300
|
escToClose,
|
|
196
301
|
panelOnly
|
|
197
302
|
];
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
303
|
+
$[42] = escKey;
|
|
304
|
+
$[43] = escToClose;
|
|
305
|
+
$[44] = panelOnly;
|
|
306
|
+
$[45] = t31;
|
|
307
|
+
$[46] = t32;
|
|
203
308
|
} else {
|
|
204
|
-
|
|
205
|
-
|
|
309
|
+
t31 = $[45];
|
|
310
|
+
t32 = $[46];
|
|
206
311
|
}
|
|
207
|
-
useEffect(
|
|
208
|
-
let
|
|
209
|
-
if ($[
|
|
210
|
-
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
} else
|
|
214
|
-
const ok =
|
|
215
|
-
let
|
|
216
|
-
if ($[
|
|
217
|
-
|
|
312
|
+
useEffect(t31, t32);
|
|
313
|
+
let t33;
|
|
314
|
+
if ($[47] !== onOk) {
|
|
315
|
+
t33 = () => onOk?.();
|
|
316
|
+
$[47] = onOk;
|
|
317
|
+
$[48] = t33;
|
|
318
|
+
} else t33 = $[48];
|
|
319
|
+
const ok = t33;
|
|
320
|
+
let t34;
|
|
321
|
+
if ($[49] !== onCancel || $[50] !== requestOpen) {
|
|
322
|
+
t34 = () => {
|
|
218
323
|
requestOpen(false);
|
|
219
324
|
onCancel?.();
|
|
220
325
|
};
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
} else
|
|
225
|
-
const cancel =
|
|
226
|
-
let
|
|
227
|
-
if ($[
|
|
228
|
-
|
|
229
|
-
previousActiveRef.current?.focus();
|
|
230
|
-
previousActiveRef.current = null;
|
|
326
|
+
$[49] = onCancel;
|
|
327
|
+
$[50] = requestOpen;
|
|
328
|
+
$[51] = t34;
|
|
329
|
+
} else t34 = $[51];
|
|
330
|
+
const cancel = t34;
|
|
331
|
+
let t35;
|
|
332
|
+
if ($[52] !== onAfterClose) {
|
|
333
|
+
t35 = () => {
|
|
231
334
|
onAfterClose?.();
|
|
232
335
|
};
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
} else
|
|
236
|
-
const afterClose =
|
|
237
|
-
let
|
|
238
|
-
if ($[
|
|
239
|
-
|
|
336
|
+
$[52] = onAfterClose;
|
|
337
|
+
$[53] = t35;
|
|
338
|
+
} else t35 = $[53];
|
|
339
|
+
const afterClose = t35;
|
|
340
|
+
let t36;
|
|
341
|
+
if ($[54] !== close || $[55] !== loading || $[56] !== maskClosable || $[57] !== mousedownIn) {
|
|
342
|
+
t36 = (e_0) => {
|
|
240
343
|
if (!loading && maskClosable && !refModal.current?.contains(e_0.target) && !mousedownIn) close();
|
|
241
344
|
};
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
247
|
-
} else
|
|
248
|
-
const clickMaskToClose =
|
|
249
|
-
let
|
|
250
|
-
if ($[
|
|
251
|
-
|
|
345
|
+
$[54] = close;
|
|
346
|
+
$[55] = loading;
|
|
347
|
+
$[56] = maskClosable;
|
|
348
|
+
$[57] = mousedownIn;
|
|
349
|
+
$[58] = t36;
|
|
350
|
+
} else t36 = $[58];
|
|
351
|
+
const clickMaskToClose = t36;
|
|
352
|
+
let t37;
|
|
353
|
+
if ($[59] !== draggable || $[60] !== isMousePressed) {
|
|
354
|
+
t37 = (e_1) => {
|
|
252
355
|
if (isMousePressed && draggable) {
|
|
253
356
|
const { x: x_0, y: y_0 } = startPos.current;
|
|
254
357
|
setLeftPos((prev) => prev + e_1.clientX - x_0);
|
|
@@ -261,22 +364,22 @@ var Modal = (t0) => {
|
|
|
261
364
|
e_1.preventDefault();
|
|
262
365
|
}
|
|
263
366
|
};
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
} else
|
|
268
|
-
const mousemove =
|
|
269
|
-
let
|
|
270
|
-
if ($[
|
|
271
|
-
|
|
367
|
+
$[59] = draggable;
|
|
368
|
+
$[60] = isMousePressed;
|
|
369
|
+
$[61] = t37;
|
|
370
|
+
} else t37 = $[61];
|
|
371
|
+
const mousemove = t37;
|
|
372
|
+
let t38;
|
|
373
|
+
if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
|
|
374
|
+
t38 = () => {
|
|
272
375
|
setIsMousePressed(false);
|
|
273
376
|
};
|
|
274
|
-
$[
|
|
275
|
-
} else
|
|
276
|
-
const mouseup =
|
|
277
|
-
let
|
|
278
|
-
if ($[
|
|
279
|
-
|
|
377
|
+
$[62] = t38;
|
|
378
|
+
} else t38 = $[62];
|
|
379
|
+
const mouseup = t38;
|
|
380
|
+
let t39;
|
|
381
|
+
if ($[63] !== draggable || $[64] !== visible) {
|
|
382
|
+
t39 = (e_2) => {
|
|
280
383
|
if (e_2.button === 0 && draggable && refHeader.current && refHeader.current.contains(e_2.target)) {
|
|
281
384
|
setIsMousePressed(true);
|
|
282
385
|
startPos.current = {
|
|
@@ -286,15 +389,15 @@ var Modal = (t0) => {
|
|
|
286
389
|
}
|
|
287
390
|
setMousedownIn(visible && !!refModal.current?.contains(e_2.target));
|
|
288
391
|
};
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
} else
|
|
293
|
-
const handleMouseDown =
|
|
294
|
-
let
|
|
295
|
-
let
|
|
296
|
-
if ($[
|
|
297
|
-
|
|
392
|
+
$[63] = draggable;
|
|
393
|
+
$[64] = visible;
|
|
394
|
+
$[65] = t39;
|
|
395
|
+
} else t39 = $[65];
|
|
396
|
+
const handleMouseDown = t39;
|
|
397
|
+
let t40;
|
|
398
|
+
let t41;
|
|
399
|
+
if ($[66] !== handleMouseDown || $[67] !== mousemove || $[68] !== panelOnly) {
|
|
400
|
+
t40 = () => {
|
|
298
401
|
if (panelOnly) return;
|
|
299
402
|
document.addEventListener("mousedown", handleMouseDown);
|
|
300
403
|
document.addEventListener("mousemove", mousemove);
|
|
@@ -305,29 +408,29 @@ var Modal = (t0) => {
|
|
|
305
408
|
document.removeEventListener("mouseup", mouseup);
|
|
306
409
|
};
|
|
307
410
|
};
|
|
308
|
-
|
|
411
|
+
t41 = [
|
|
309
412
|
handleMouseDown,
|
|
310
413
|
mousemove,
|
|
311
414
|
mouseup,
|
|
312
415
|
panelOnly
|
|
313
416
|
];
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
417
|
+
$[66] = handleMouseDown;
|
|
418
|
+
$[67] = mousemove;
|
|
419
|
+
$[68] = panelOnly;
|
|
420
|
+
$[69] = t40;
|
|
421
|
+
$[70] = t41;
|
|
319
422
|
} else {
|
|
320
|
-
|
|
321
|
-
|
|
423
|
+
t40 = $[69];
|
|
424
|
+
t41 = $[70];
|
|
322
425
|
}
|
|
323
|
-
useEffect(
|
|
426
|
+
useEffect(t40, t41);
|
|
324
427
|
const okLabel = okText || locale?.k?.common?.ok;
|
|
325
428
|
const cancelLabel = cancelText || locale?.k?.common?.cancel;
|
|
326
429
|
let contentNode = content;
|
|
327
430
|
if (!contentNode) {
|
|
328
|
-
let
|
|
329
|
-
if ($[
|
|
330
|
-
|
|
431
|
+
let t42;
|
|
432
|
+
if ($[71] !== cancel || $[72] !== cancelLabel || $[73] !== footer || $[74] !== loading || $[75] !== ok || $[76] !== okLabel) {
|
|
433
|
+
t42 = footer === true ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
331
434
|
onClick: cancel,
|
|
332
435
|
children: cancelLabel
|
|
333
436
|
}), /* @__PURE__ */ jsx(Button, {
|
|
@@ -336,31 +439,31 @@ var Modal = (t0) => {
|
|
|
336
439
|
loading,
|
|
337
440
|
children: okLabel
|
|
338
441
|
})] }) : footer;
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
341
|
-
$[
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
} else
|
|
347
|
-
const footerContent =
|
|
348
|
-
let
|
|
349
|
-
if ($[
|
|
350
|
-
|
|
442
|
+
$[71] = cancel;
|
|
443
|
+
$[72] = cancelLabel;
|
|
444
|
+
$[73] = footer;
|
|
445
|
+
$[74] = loading;
|
|
446
|
+
$[75] = ok;
|
|
447
|
+
$[76] = okLabel;
|
|
448
|
+
$[77] = t42;
|
|
449
|
+
} else t42 = $[77];
|
|
450
|
+
const footerContent = t42;
|
|
451
|
+
let t43;
|
|
452
|
+
if ($[78] !== close || $[79] !== showClose) {
|
|
453
|
+
t43 = showClose && /* @__PURE__ */ jsx(Button, {
|
|
351
454
|
icon: X,
|
|
352
455
|
size: "small",
|
|
353
456
|
onClick: close,
|
|
354
457
|
className: "k-modal-close",
|
|
355
458
|
type: "text"
|
|
356
459
|
});
|
|
357
|
-
$[
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
360
|
-
} else
|
|
361
|
-
let
|
|
362
|
-
if ($[
|
|
363
|
-
|
|
460
|
+
$[78] = close;
|
|
461
|
+
$[79] = showClose;
|
|
462
|
+
$[80] = t43;
|
|
463
|
+
} else t43 = $[80];
|
|
464
|
+
let t44;
|
|
465
|
+
if ($[81] !== title) {
|
|
466
|
+
t44 = title != null && /* @__PURE__ */ jsx("div", {
|
|
364
467
|
className: "k-modal-header",
|
|
365
468
|
ref: refHeader,
|
|
366
469
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -368,203 +471,194 @@ var Modal = (t0) => {
|
|
|
368
471
|
children: title
|
|
369
472
|
})
|
|
370
473
|
});
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
373
|
-
} else
|
|
374
|
-
let
|
|
375
|
-
if ($[
|
|
376
|
-
|
|
474
|
+
$[81] = title;
|
|
475
|
+
$[82] = t44;
|
|
476
|
+
} else t44 = $[82];
|
|
477
|
+
let t45;
|
|
478
|
+
if ($[83] !== children) {
|
|
479
|
+
t45 = /* @__PURE__ */ jsx("div", {
|
|
377
480
|
className: "k-modal-body",
|
|
378
481
|
children
|
|
379
482
|
});
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
} else
|
|
383
|
-
let
|
|
384
|
-
if ($[
|
|
385
|
-
|
|
483
|
+
$[83] = children;
|
|
484
|
+
$[84] = t45;
|
|
485
|
+
} else t45 = $[84];
|
|
486
|
+
let t46;
|
|
487
|
+
if ($[85] !== footer || $[86] !== footerContent) {
|
|
488
|
+
t46 = footer && /* @__PURE__ */ jsx("div", {
|
|
386
489
|
className: "k-modal-footer",
|
|
387
490
|
children: footerContent
|
|
388
491
|
});
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
391
|
-
$[
|
|
392
|
-
} else
|
|
393
|
-
let
|
|
394
|
-
if ($[
|
|
395
|
-
|
|
492
|
+
$[85] = footer;
|
|
493
|
+
$[86] = footerContent;
|
|
494
|
+
$[87] = t46;
|
|
495
|
+
} else t46 = $[87];
|
|
496
|
+
let t47;
|
|
497
|
+
if ($[88] !== t43 || $[89] !== t44 || $[90] !== t45 || $[91] !== t46) {
|
|
498
|
+
t47 = /* @__PURE__ */ jsxs("div", {
|
|
396
499
|
className: "k-modal-content",
|
|
397
500
|
tabIndex: 0,
|
|
398
501
|
children: [
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
502
|
+
t43,
|
|
503
|
+
t44,
|
|
504
|
+
t45,
|
|
505
|
+
t46
|
|
403
506
|
]
|
|
404
507
|
});
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
} else
|
|
411
|
-
contentNode =
|
|
412
|
-
}
|
|
413
|
-
if (panelOnly) {
|
|
414
|
-
let t34;
|
|
415
|
-
if ($[74] !== className) {
|
|
416
|
-
t34 = clsx("k-modal", "k-modal-panel", className);
|
|
417
|
-
$[74] = className;
|
|
418
|
-
$[75] = t34;
|
|
419
|
-
} else t34 = $[75];
|
|
420
|
-
const t35 = typeof width === "number" ? `${width}px` : width;
|
|
421
|
-
let t36;
|
|
422
|
-
if ($[76] !== t35) {
|
|
423
|
-
t36 = { width: t35 };
|
|
424
|
-
$[76] = t35;
|
|
425
|
-
$[77] = t36;
|
|
426
|
-
} else t36 = $[77];
|
|
427
|
-
let t37;
|
|
428
|
-
if ($[78] !== contentNode) {
|
|
429
|
-
t37 = /* @__PURE__ */ jsx("div", {
|
|
430
|
-
className: "k-modal-wrap",
|
|
431
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
432
|
-
className: "k-modal-inner",
|
|
433
|
-
children: contentNode
|
|
434
|
-
})
|
|
435
|
-
});
|
|
436
|
-
$[78] = contentNode;
|
|
437
|
-
$[79] = t37;
|
|
438
|
-
} else t37 = $[79];
|
|
439
|
-
let t38;
|
|
440
|
-
if ($[80] !== t34 || $[81] !== t36 || $[82] !== t37) {
|
|
441
|
-
t38 = /* @__PURE__ */ jsx("div", {
|
|
442
|
-
className: t34,
|
|
443
|
-
style: t36,
|
|
444
|
-
children: t37
|
|
445
|
-
});
|
|
446
|
-
$[80] = t34;
|
|
447
|
-
$[81] = t36;
|
|
448
|
-
$[82] = t37;
|
|
449
|
-
$[83] = t38;
|
|
450
|
-
} else t38 = $[83];
|
|
451
|
-
return t38;
|
|
508
|
+
$[88] = t43;
|
|
509
|
+
$[89] = t44;
|
|
510
|
+
$[90] = t45;
|
|
511
|
+
$[91] = t46;
|
|
512
|
+
$[92] = t47;
|
|
513
|
+
} else t47 = $[92];
|
|
514
|
+
contentNode = t47;
|
|
452
515
|
}
|
|
453
|
-
let
|
|
454
|
-
if ($[
|
|
455
|
-
|
|
456
|
-
width:
|
|
457
|
-
top: `${topPos}px`,
|
|
458
|
-
left: draggable ? `${leftPos}px` : void 0
|
|
516
|
+
let t42;
|
|
517
|
+
if ($[93] !== centered || $[94] !== draggable || $[95] !== leftPos || $[96] !== maximized || $[97] !== topPos || $[98] !== width) {
|
|
518
|
+
t42 = maximized ? null : {
|
|
519
|
+
width: toCssLength(width),
|
|
520
|
+
top: centered ? void 0 : `${topPos}px`,
|
|
521
|
+
left: draggable && !centered ? `${leftPos}px` : void 0
|
|
459
522
|
};
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
523
|
+
$[93] = centered;
|
|
524
|
+
$[94] = draggable;
|
|
525
|
+
$[95] = leftPos;
|
|
526
|
+
$[96] = maximized;
|
|
527
|
+
$[97] = topPos;
|
|
528
|
+
$[98] = width;
|
|
529
|
+
$[99] = t42;
|
|
530
|
+
} else t42 = $[99];
|
|
531
|
+
const modalStyle = t42;
|
|
532
|
+
const t43 = Boolean(footer);
|
|
533
|
+
let t44;
|
|
534
|
+
if ($[100] !== centered || $[101] !== className || $[102] !== draggable || $[103] !== maximized || $[104] !== panelOnly || $[105] !== t43) {
|
|
535
|
+
t44 = clsx("k-modal", className, {
|
|
472
536
|
"k-modal-draggable": draggable,
|
|
473
537
|
"k-modal-maximized": maximized,
|
|
474
538
|
"k-modal-centered": centered,
|
|
475
|
-
"k-modal-has-footer":
|
|
539
|
+
"k-modal-has-footer": t43,
|
|
540
|
+
"k-modal-panel": panelOnly
|
|
476
541
|
});
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
$[
|
|
482
|
-
$[
|
|
483
|
-
|
|
484
|
-
|
|
542
|
+
$[100] = centered;
|
|
543
|
+
$[101] = className;
|
|
544
|
+
$[102] = draggable;
|
|
545
|
+
$[103] = maximized;
|
|
546
|
+
$[104] = panelOnly;
|
|
547
|
+
$[105] = t43;
|
|
548
|
+
$[106] = t44;
|
|
549
|
+
} else t44 = $[106];
|
|
550
|
+
const classes = t44;
|
|
485
551
|
if (!rendered) return null;
|
|
486
|
-
let
|
|
487
|
-
if ($[
|
|
488
|
-
|
|
552
|
+
let t45;
|
|
553
|
+
if ($[107] !== destroyOnClose || $[108] !== mask || $[109] !== visible) {
|
|
554
|
+
t45 = mask && /* @__PURE__ */ jsx(Transition, {
|
|
489
555
|
show: visible,
|
|
490
556
|
name: "k-modal-fade",
|
|
491
557
|
timeout: 400,
|
|
558
|
+
unmountOnExit: destroyOnClose,
|
|
492
559
|
children: /* @__PURE__ */ jsx("div", { className: "k-modal-mask" })
|
|
493
560
|
});
|
|
494
|
-
$[
|
|
495
|
-
$[
|
|
496
|
-
$[
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
561
|
+
$[107] = destroyOnClose;
|
|
562
|
+
$[108] = mask;
|
|
563
|
+
$[109] = visible;
|
|
564
|
+
$[110] = t45;
|
|
565
|
+
} else t45 = $[110];
|
|
566
|
+
const t46 = !panelOnly && mask ? true : void 0;
|
|
567
|
+
const t47 = showInner ? void 0 : "none";
|
|
568
|
+
let t48;
|
|
569
|
+
if ($[111] !== t47) {
|
|
570
|
+
t48 = { display: t47 };
|
|
571
|
+
$[111] = t47;
|
|
572
|
+
$[112] = t48;
|
|
573
|
+
} else t48 = $[112];
|
|
574
|
+
const t49 = modalStyle || void 0;
|
|
575
|
+
let t50;
|
|
576
|
+
if ($[113] === Symbol.for("react.memo_cache_sentinel")) {
|
|
577
|
+
t50 = /* @__PURE__ */ jsx("div", { tabIndex: 0 });
|
|
578
|
+
$[113] = t50;
|
|
579
|
+
} else t50 = $[113];
|
|
580
|
+
let t51;
|
|
581
|
+
if ($[114] !== contentNode || $[115] !== t49) {
|
|
582
|
+
t51 = /* @__PURE__ */ jsxs("div", {
|
|
514
583
|
ref: refModal,
|
|
515
584
|
className: "k-modal-inner",
|
|
516
|
-
|
|
517
|
-
|
|
585
|
+
tabIndex: -1,
|
|
586
|
+
style: t49,
|
|
587
|
+
onKeyDown: handleModalKeydown,
|
|
588
|
+
children: [contentNode, t50]
|
|
518
589
|
});
|
|
519
|
-
$[
|
|
520
|
-
$[
|
|
521
|
-
$[
|
|
522
|
-
} else
|
|
523
|
-
let
|
|
524
|
-
if ($[
|
|
525
|
-
|
|
590
|
+
$[114] = contentNode;
|
|
591
|
+
$[115] = t49;
|
|
592
|
+
$[116] = t51;
|
|
593
|
+
} else t51 = $[116];
|
|
594
|
+
let t52;
|
|
595
|
+
if ($[117] !== afterClose || $[118] !== destroyOnClose || $[119] !== t51 || $[120] !== visible) {
|
|
596
|
+
t52 = /* @__PURE__ */ jsx(Transition, {
|
|
526
597
|
show: visible,
|
|
527
598
|
name: "k-modal-zoom",
|
|
528
599
|
timeout: 250,
|
|
600
|
+
unmountOnExit: destroyOnClose,
|
|
529
601
|
onAfterLeave: afterClose,
|
|
530
|
-
children:
|
|
602
|
+
children: t51
|
|
531
603
|
});
|
|
532
|
-
$[
|
|
533
|
-
$[
|
|
534
|
-
$[
|
|
535
|
-
$[
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
604
|
+
$[117] = afterClose;
|
|
605
|
+
$[118] = destroyOnClose;
|
|
606
|
+
$[119] = t51;
|
|
607
|
+
$[120] = visible;
|
|
608
|
+
$[121] = t52;
|
|
609
|
+
} else t52 = $[121];
|
|
610
|
+
let t53;
|
|
611
|
+
if ($[122] !== clickMaskToClose || $[123] !== t46 || $[124] !== t48 || $[125] !== t52) {
|
|
612
|
+
t53 = /* @__PURE__ */ jsx("div", {
|
|
540
613
|
ref: refWrap,
|
|
541
614
|
className: "k-modal-wrap",
|
|
542
615
|
tabIndex: -1,
|
|
543
616
|
role: "dialog",
|
|
544
|
-
|
|
617
|
+
"aria-modal": t46,
|
|
618
|
+
style: t48,
|
|
545
619
|
onClick: clickMaskToClose,
|
|
546
|
-
children:
|
|
620
|
+
children: t52
|
|
547
621
|
});
|
|
548
|
-
$[
|
|
549
|
-
$[
|
|
550
|
-
$[
|
|
551
|
-
$[
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
622
|
+
$[122] = clickMaskToClose;
|
|
623
|
+
$[123] = t46;
|
|
624
|
+
$[124] = t48;
|
|
625
|
+
$[125] = t52;
|
|
626
|
+
$[126] = t53;
|
|
627
|
+
} else t53 = $[126];
|
|
628
|
+
let t54;
|
|
629
|
+
if ($[127] !== classes || $[128] !== t45 || $[129] !== t53) {
|
|
630
|
+
t54 = /* @__PURE__ */ jsxs("div", {
|
|
631
|
+
className: classes,
|
|
632
|
+
children: [t45, t53]
|
|
633
|
+
});
|
|
634
|
+
$[127] = classes;
|
|
635
|
+
$[128] = t45;
|
|
636
|
+
$[129] = t53;
|
|
637
|
+
$[130] = t54;
|
|
638
|
+
} else t54 = $[130];
|
|
639
|
+
const modalEl = t54;
|
|
640
|
+
let t55;
|
|
641
|
+
if ($[131] !== modalEl || $[132] !== registerHostedPopup) {
|
|
642
|
+
t55 = /* @__PURE__ */ jsx(PopupHostContext.Provider, {
|
|
643
|
+
value: registerHostedPopup,
|
|
644
|
+
children: modalEl
|
|
645
|
+
});
|
|
646
|
+
$[131] = modalEl;
|
|
647
|
+
$[132] = registerHostedPopup;
|
|
648
|
+
$[133] = t55;
|
|
649
|
+
} else t55 = $[133];
|
|
650
|
+
const hosted = t55;
|
|
651
|
+
let t56;
|
|
652
|
+
if ($[134] !== hosted || $[135] !== panelOnly) {
|
|
653
|
+
t56 = panelOnly ? hosted : /* @__PURE__ */ jsx(Teleport, {
|
|
556
654
|
to: "body",
|
|
557
|
-
children:
|
|
558
|
-
className: classes,
|
|
559
|
-
children: [t37, t44]
|
|
560
|
-
})
|
|
655
|
+
children: hosted
|
|
561
656
|
});
|
|
562
|
-
$[
|
|
563
|
-
$[
|
|
564
|
-
$[
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
return t45;
|
|
657
|
+
$[134] = hosted;
|
|
658
|
+
$[135] = panelOnly;
|
|
659
|
+
$[136] = t56;
|
|
660
|
+
} else t56 = $[136];
|
|
661
|
+
return t56;
|
|
568
662
|
};
|
|
569
663
|
function ModalPanel(props) {
|
|
570
664
|
const $ = c(2);
|
|
@@ -572,6 +666,8 @@ function ModalPanel(props) {
|
|
|
572
666
|
if ($[0] !== props) {
|
|
573
667
|
t0 = /* @__PURE__ */ jsx(Modal, {
|
|
574
668
|
...props,
|
|
669
|
+
open: true,
|
|
670
|
+
mask: false,
|
|
575
671
|
panelOnly: true
|
|
576
672
|
});
|
|
577
673
|
$[0] = props;
|