react-kui 3.2.0 → 3.3.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/kui-components.json +825 -168
- package/es/_virtual/_rolldown/runtime.js +2 -3
- package/es/affix/index.js +73 -185
- package/es/alert/index.js +3 -4
- package/es/anchor/anchor-context.js +2 -3
- package/es/anchor/anchor-link.js +3 -4
- package/es/anchor/anchor.js +195 -398
- package/es/auto-complete/index.js +160 -561
- package/es/avatar/avatar-group-context.js +2 -3
- package/es/avatar/avatar-group.js +32 -124
- package/es/avatar/avatar.js +58 -159
- package/es/back-top/index.js +66 -201
- package/es/badge/index.js +4 -5
- package/es/base/teleport.js +22 -54
- package/es/base/transition-props.js +2 -3
- package/es/base/transition.js +2 -3
- package/es/breadcrumb/breadcrumb-context.js +2 -3
- package/es/breadcrumb/breadcrumb-item.js +19 -102
- package/es/breadcrumb/breadcrumb.js +10 -59
- package/es/button/button-group-context.js +2 -3
- package/es/button/button-group.js +15 -75
- package/es/button/button.js +4 -5
- package/es/calendar/index.js +4 -5
- package/es/card/index.js +4 -5
- package/es/carousel/carousel-context.js +2 -3
- package/es/carousel/carousel-item.js +3 -4
- package/es/carousel/carousel.js +281 -628
- package/es/carousel/drag.js +2 -3
- package/es/cascader/index.js +7 -8
- package/es/check-card/check-card-group.js +53 -179
- package/es/check-card/check-card.js +100 -293
- package/es/check-card/context.js +2 -3
- package/es/checkbox/checkbox-group-context.js +2 -3
- package/es/checkbox/checkbox-group.js +34 -138
- package/es/checkbox/checkbox.js +4 -5
- package/es/checkbox/index.js +2 -3
- package/es/collapse/collapse-panel.js +84 -206
- package/es/collapse/collapse.js +38 -170
- package/es/color-picker/alpha.js +44 -125
- package/es/color-picker/hue.js +39 -108
- package/es/color-picker/index.js +7 -6
- package/es/color-picker/mode.js +76 -159
- package/es/color-picker/paint.js +66 -163
- package/es/color-picker/presets.js +12 -44
- package/es/components.js +37 -32
- package/es/config/config-context.js +2 -3
- package/es/config/context.js +2 -3
- package/es/config/index.js +3 -4
- package/es/config/popup-host.js +3 -4
- package/es/config/size-context.js +2 -3
- package/es/config/use-config-appearance.js +3 -4
- package/es/const/var.js +2 -3
- package/es/date-picker/index.js +8 -9
- package/es/descriptions/descriptions-item.js +3 -4
- package/es/descriptions/descriptions.js +53 -144
- package/es/divider/index.js +2 -3
- package/es/drawer/index.js +171 -465
- package/es/dropdown/dropdown-button.js +25 -128
- package/es/dropdown/dropdown-context.js +2 -3
- package/es/dropdown/dropdown.js +56 -207
- package/es/dropdown/trigger.js +37 -125
- package/es/empty/index.js +34 -111
- package/es/feature-card/index.js +2 -3
- package/es/feedback-panel/index.js +30 -155
- package/es/flame-wrap/index.js +3 -4
- package/es/flame-wrap/types.js +2 -3
- package/es/flex/index.js +2 -3
- package/es/form/field-context.js +3 -4
- package/es/form/form-context.js +2 -3
- package/es/form/form-item.js +4 -5
- package/es/form/form.js +108 -279
- package/es/form/utils.js +2 -3
- package/es/gradient-picker/corners.js +55 -0
- package/es/gradient-picker/index.js +191 -0
- package/es/gradient-picker/stops.js +219 -0
- package/es/gradient-picker/types.js +147 -0
- package/es/grid/grid-item.js +25 -116
- package/es/grid/grid.js +40 -151
- package/es/grid/useBreakpoint.js +3 -4
- package/es/icon/index.js +24 -126
- package/es/image/group.js +3 -4
- package/es/image/image-group-context.js +2 -3
- package/es/image/image.js +5 -6
- package/es/image/instance.js +2 -3
- package/es/image/preview.js +4 -5
- package/es/image/utils.js +2 -3
- package/es/index.js +5 -4
- package/es/input/index.js +2 -3
- package/es/input/input-base.js +4 -5
- package/es/input/input-box.js +2 -3
- package/es/input/input-group.js +4 -5
- package/es/input/input.js +3 -4
- package/es/input/textarea.js +3 -4
- package/es/input-number/drag.js +63 -0
- package/es/input-number/index.js +41 -11
- package/es/input-otp/index.js +3 -4
- package/es/input-tag/index.js +5 -6
- package/es/kanban/index.js +31 -168
- package/es/layout/index.js +43 -215
- package/es/layout/layout-context.js +2 -3
- package/es/list-panel/index.js +47 -185
- package/es/loading/index.js +2 -3
- package/es/loading/loading-bar.js +54 -114
- package/es/locale/de.js +2 -3
- package/es/locale/el.js +2 -3
- package/es/locale/en.js +2 -3
- package/es/locale/fr.js +2 -3
- package/es/locale/it.js +2 -3
- package/es/locale/ja.js +2 -3
- package/es/locale/ko.js +2 -3
- package/es/locale/ru.js +2 -3
- package/es/locale/th.js +2 -3
- package/es/locale/uk.js +2 -3
- package/es/locale/vi.js +2 -3
- package/es/locale/zh-CN.js +2 -3
- package/es/locale/zh-TW.js +2 -3
- package/es/mentions/index.js +214 -581
- package/es/menu/menu-context.js +2 -3
- package/es/menu/menu-divider.js +3 -4
- package/es/menu/menu-group.js +3 -4
- package/es/menu/menu-item.js +2 -3
- package/es/menu/menu-keyboard.js +2 -3
- package/es/menu/menu.js +184 -442
- package/es/menu/recursive-menu.js +3 -4
- package/es/menu/sub-menu.js +5 -6
- package/es/message/index.js +2 -3
- package/es/modal/api.js +2 -3
- package/es/modal/modal.js +263 -599
- package/es/modal/toast.js +63 -179
- package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +2 -3
- package/es/notice/container.js +2 -3
- package/es/notice/content.js +4 -5
- package/es/notice/index.js +2 -3
- package/es/notice/instance.js +2 -3
- package/es/page/index.js +4 -5
- package/es/page/responsive.js +2 -3
- package/es/page-header/index.js +3 -4
- package/es/popconfirm/index.js +24 -70
- package/es/poptip/index.js +29 -88
- package/es/popup/index.js +8 -6
- package/es/popup/layers.js +2 -3
- package/es/progress/index.js +95 -229
- package/es/qrcode/index.js +3 -4
- package/es/radio/radio-button.js +37 -131
- package/es/radio/radio-group-context.js +2 -3
- package/es/radio/radio-group.js +69 -223
- package/es/radio/radio.js +3 -4
- package/es/rate/index.js +68 -226
- package/es/rate/star.js +38 -129
- package/es/result/index.js +35 -127
- package/es/ripple/index.js +3 -4
- package/es/ripple/types.js +2 -3
- package/es/row-col/col.js +59 -149
- package/es/row-col/row.js +2 -3
- package/es/segmented/index.js +72 -196
- package/es/select/option.js +23 -116
- package/es/select/select.js +9 -10
- package/es/skeleton/skeleton-avatar.js +2 -3
- package/es/skeleton/skeleton-button.js +2 -3
- package/es/skeleton/skeleton-image.js +28 -108
- package/es/skeleton/skeleton-text.js +17 -93
- package/es/skeleton/skeleton.js +46 -133
- package/es/skeleton/use-skeleton-loading.js +3 -4
- package/es/slider/index.js +92 -286
- package/es/slider/thumb.js +43 -133
- package/es/space/index.js +3 -4
- package/es/spin/index.js +2 -3
- package/es/splitter/splitter-panel.js +3 -4
- package/es/splitter/splitter.js +77 -219
- package/es/stat-card/countup.js +46 -141
- package/es/stat-card/rollup.js +27 -105
- package/es/stat-card/stat-card.js +3 -4
- package/es/stat-card/stat-number.js +26 -113
- package/es/stat-card/utils/countup.js +2 -3
- package/es/stat-card/utils/odometer.js +2 -3
- package/es/stat-card/utils/stat-item-key.js +2 -3
- package/es/steps/index.js +45 -123
- package/es/switch/index.js +4 -5
- package/es/table/column-setting.js +43 -139
- package/es/table/index.js +25 -15
- package/es/table/utils.js +3 -5
- package/es/tabs/tab-panel.js +19 -71
- package/es/tabs/tabs.js +6 -7
- package/es/tag/index.js +4 -5
- package/es/time-line/timeline-item.js +3 -4
- package/es/time-line/timeline.js +8 -44
- package/es/tooltip/index.js +41 -142
- package/es/tour/index.js +138 -356
- package/es/transfer/index.js +184 -487
- package/es/tree/index.js +8 -9
- package/es/tree/utils.js +2 -3
- package/es/tree-select/index.js +8 -9
- package/es/typography/index.js +75 -306
- package/es/upload/file-list.js +95 -119
- package/es/upload/index.js +8 -9
- package/es/upload/picture-sort.js +2 -3
- package/es/upload/selector.js +63 -193
- package/es/utils/checked.js +2 -3
- package/es/utils/color.js +2 -3
- package/es/utils/css.js +2 -3
- package/es/utils/focus.js +2 -3
- package/es/utils/number.js +2 -3
- package/es/utils/overlay-order.js +2 -3
- package/es/utils/overlay-stack.js +3 -4
- package/es/utils/placement.js +16 -4
- package/es/utils/popup-arrow.js +45 -0
- package/es/utils/popup.js +2 -3
- package/es/utils/promise.js +2 -3
- package/es/utils/react-node.js +2 -3
- package/es/utils/selection-tags.js +2 -3
- package/es/utils/share.js +2 -3
- package/es/utils/theme.js +2 -3
- package/es/utils/transition.js +2 -3
- package/es/utils/use-value.js +3 -4
- package/es/virtual-list/index.js +49 -187
- package/es/virtual-list/range.js +2 -3
- package/es/watermark/index.js +149 -289
- 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 +24 -24
- package/style/base.css +1 -1
- package/style/components.css +2 -2
- package/style/index.css +2 -2
- package/style/theme.css +1 -1
- package/types/affix/index.d.cts +1 -1
- package/types/affix/index.d.ts +1 -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/back-top/index.d.cts +1 -1
- package/types/back-top/index.d.ts +1 -1
- package/types/carousel/carousel-item.d.cts +1 -1
- package/types/carousel/carousel-item.d.ts +1 -1
- package/types/cascader/index.d.cts +1 -1
- package/types/cascader/index.d.ts +1 -1
- package/types/color-picker/alpha.d.cts +1 -1
- package/types/color-picker/alpha.d.ts +1 -1
- package/types/color-picker/hue.d.cts +1 -1
- package/types/color-picker/hue.d.ts +1 -1
- package/types/color-picker/index.d.cts +3 -2
- package/types/color-picker/index.d.ts +3 -2
- package/types/color-picker/mode.d.cts +1 -1
- package/types/color-picker/mode.d.ts +1 -1
- package/types/color-picker/paint.d.cts +1 -1
- package/types/color-picker/paint.d.ts +1 -1
- package/types/color-picker/presets.d.cts +1 -1
- package/types/color-picker/presets.d.ts +1 -1
- package/types/components.d.cts +3 -0
- package/types/components.d.ts +3 -0
- package/types/date-picker/index.d.cts +2 -2
- package/types/date-picker/index.d.ts +2 -2
- 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/flame-wrap/index.d.cts +1 -1
- package/types/flame-wrap/index.d.ts +1 -1
- package/types/form/form-item.d.cts +1 -1
- package/types/form/form-item.d.ts +1 -1
- package/types/gradient-picker/corners.d.cts +8 -0
- package/types/gradient-picker/corners.d.ts +8 -0
- package/types/gradient-picker/index.d.cts +25 -0
- package/types/gradient-picker/index.d.ts +25 -0
- package/types/gradient-picker/stops.d.cts +12 -0
- package/types/gradient-picker/stops.d.ts +12 -0
- package/types/gradient-picker/types.d.cts +34 -0
- package/types/gradient-picker/types.d.ts +34 -0
- 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/image/group.d.cts +1 -1
- package/types/image/group.d.ts +1 -1
- package/types/input-number/drag.d.cts +9 -0
- package/types/input-number/drag.d.ts +9 -0
- package/types/input-number/index.d.cts +1 -0
- package/types/input-number/index.d.ts +1 -0
- package/types/kanban/index.d.cts +1 -1
- package/types/kanban/index.d.ts +1 -1
- package/types/list-panel/index.d.cts +1 -1
- package/types/list-panel/index.d.ts +1 -1
- package/types/loading/loading-bar.d.cts +1 -1
- package/types/loading/loading-bar.d.ts +1 -1
- package/types/modal/toast.d.cts +1 -1
- package/types/modal/toast.d.ts +1 -1
- package/types/notice/content.d.cts +2 -2
- package/types/notice/content.d.ts +2 -2
- 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 -0
- package/types/popconfirm/index.d.ts +1 -0
- package/types/poptip/index.d.cts +1 -0
- package/types/poptip/index.d.ts +1 -0
- package/types/popup/index.d.cts +1 -0
- package/types/popup/index.d.ts +1 -0
- package/types/result/index.d.cts +1 -1
- package/types/result/index.d.ts +1 -1
- package/types/ripple/index.d.cts +1 -1
- package/types/ripple/index.d.ts +1 -1
- package/types/segmented/index.d.cts +2 -1
- package/types/segmented/index.d.ts +2 -1
- package/types/slider/index.d.cts +1 -1
- package/types/slider/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 +1 -1
- package/types/stat-card/rollup.d.ts +1 -1
- 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/table/column-setting.d.cts +1 -1
- package/types/table/column-setting.d.ts +1 -1
- package/types/table/index.d.cts +1 -1
- package/types/table/index.d.ts +1 -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 +1 -0
- package/types/tooltip/index.d.ts +1 -0
- package/types/transfer/index.d.cts +1 -1
- package/types/transfer/index.d.ts +1 -1
- package/types/tree-select/index.d.cts +1 -1
- package/types/tree-select/index.d.ts +1 -1
- package/types/upload/file-list.d.cts +1 -1
- package/types/upload/file-list.d.ts +1 -1
- package/types/upload/selector.d.cts +1 -1
- package/types/upload/selector.d.ts +1 -1
- package/types/utils/placement.d.cts +2 -1
- package/types/utils/placement.d.ts +2 -1
- package/types/utils/popup-arrow.d.cts +5 -0
- package/types/utils/popup-arrow.d.ts +5 -0
- package/types/utils/selection-tags.d.cts +1 -1
- package/types/utils/selection-tags.d.ts +1 -1
- package/types/watermark/index.d.cts +1 -1
- package/types/watermark/index.d.ts +1 -1
package/es/tour/index.js
CHANGED
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.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 { useValue } from "../utils/use-value.js";
|
|
10
|
+
import { X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
9
11
|
import Teleport from "../base/teleport.js";
|
|
10
12
|
import { Transition } from "../base/transition.js";
|
|
11
|
-
import { toggleContainerScroll } from "../utils/react-node.js";
|
|
12
|
-
import { X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
13
|
-
import { useValue } from "../utils/use-value.js";
|
|
14
13
|
import Button from "../button/button.js";
|
|
15
|
-
import {
|
|
14
|
+
import { toggleContainerScroll } from "../utils/react-node.js";
|
|
16
15
|
import clsx from "clsx";
|
|
17
16
|
import { useEffect, useState } from "react";
|
|
18
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
|
|
20
|
-
var Tour = (
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const mask = t1 === void 0 ? true : t1;
|
|
24
|
-
const closable = t2 === void 0 ? true : t2;
|
|
25
|
-
const [innerOpen, setInnerOpen] = useValue(open, _temp);
|
|
26
|
-
const [innerCurrent, setInnerCurrent] = useValue(current, _temp2);
|
|
18
|
+
// components/tour/index.tsx
|
|
19
|
+
var Tour = ({ open, current, steps, mask = true, closable = true, onChange, onOpenChange, onFinish }) => {
|
|
20
|
+
const [innerOpen, setInnerOpen] = useValue(open, (next) => next ?? false);
|
|
21
|
+
const [innerCurrent, setInnerCurrent] = useValue(current, (next_0) => next_0 ?? 0);
|
|
27
22
|
const [, refresh] = useState(0);
|
|
28
23
|
const visible = innerOpen;
|
|
29
24
|
const [rendered, setRendered] = useState(visible);
|
|
@@ -34,351 +29,138 @@ var Tour = (t0) => {
|
|
|
34
29
|
}
|
|
35
30
|
const index = innerCurrent;
|
|
36
31
|
const step = steps[index];
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
toggleContainerScroll(document.body, visible);
|
|
34
|
+
return () => toggleContainerScroll(document.body, false);
|
|
35
|
+
}, [visible]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!visible) return;
|
|
38
|
+
const update = () => refresh((n) => n + 1);
|
|
39
|
+
window.addEventListener("resize", update);
|
|
40
|
+
window.addEventListener("scroll", update, true);
|
|
41
|
+
return () => {
|
|
42
|
+
window.removeEventListener("resize", update);
|
|
43
|
+
window.removeEventListener("scroll", update, true);
|
|
43
44
|
};
|
|
44
|
-
|
|
45
|
-
$[0] = visible;
|
|
46
|
-
$[1] = t3;
|
|
47
|
-
$[2] = t4;
|
|
48
|
-
} else {
|
|
49
|
-
t3 = $[1];
|
|
50
|
-
t4 = $[2];
|
|
51
|
-
}
|
|
52
|
-
useEffect(t3, t4);
|
|
53
|
-
let t5;
|
|
54
|
-
if ($[3] !== refresh || $[4] !== visible) {
|
|
55
|
-
t5 = () => {
|
|
56
|
-
if (!visible) return;
|
|
57
|
-
const update = () => refresh(_temp4);
|
|
58
|
-
window.addEventListener("resize", update);
|
|
59
|
-
window.addEventListener("scroll", update, true);
|
|
60
|
-
return () => {
|
|
61
|
-
window.removeEventListener("resize", update);
|
|
62
|
-
window.removeEventListener("scroll", update, true);
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
$[3] = refresh;
|
|
66
|
-
$[4] = visible;
|
|
67
|
-
$[5] = t5;
|
|
68
|
-
} else t5 = $[5];
|
|
69
|
-
let t6;
|
|
70
|
-
if ($[6] !== visible) {
|
|
71
|
-
t6 = [visible];
|
|
72
|
-
$[6] = visible;
|
|
73
|
-
$[7] = t6;
|
|
74
|
-
} else t6 = $[7];
|
|
75
|
-
useEffect(t5, t6);
|
|
45
|
+
}, [visible]);
|
|
76
46
|
if (!rendered || !step || typeof document === "undefined") return null;
|
|
77
|
-
|
|
78
|
-
if ($[8] !== step) {
|
|
79
|
-
t7 = typeof step.target === "function" ? step.target() : step.target;
|
|
80
|
-
$[8] = step;
|
|
81
|
-
$[9] = t7;
|
|
82
|
-
} else t7 = $[9];
|
|
83
|
-
const target = t7;
|
|
84
|
-
let t8;
|
|
85
|
-
if ($[10] !== target) {
|
|
86
|
-
t8 = target?.getBoundingClientRect();
|
|
87
|
-
$[10] = target;
|
|
88
|
-
$[11] = t8;
|
|
89
|
-
} else t8 = $[11];
|
|
90
|
-
const rect = t8;
|
|
47
|
+
const rect = (typeof step.target === "function" ? step.target() : step.target)?.getBoundingClientRect();
|
|
91
48
|
const placement = step.placement ?? "bottom";
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
"aria-hidden": "true",
|
|
209
|
-
children: /* @__PURE__ */ jsxs("svg", {
|
|
210
|
-
viewBox: "0 0 24 8",
|
|
211
|
-
children: [/* @__PURE__ */ jsx("path", {
|
|
212
|
-
className: "k-tour-arrow-outline",
|
|
213
|
-
d: "m24,0.97087l0,1c-4,0 -5.5,1 -7.5,3c-2,2 -2.5,3 -4.5,3c-2,0 -2.5,-1 -4.5,-3c-2,-2 -3.5,-3 -7.5,-3l0,-1l24,0z"
|
|
214
|
-
}), /* @__PURE__ */ jsx("path", {
|
|
215
|
-
className: "k-tour-arrow-inner",
|
|
216
|
-
d: "m24,0l0,1c-4,0 -5.5,1 -7.5,3c-2,2 -2.5,3 -4.5,3c-2,0 -2.5,-1 -4.5,-3c-2,-2 -3.5,-3 -7.5,-3l0,-1l24,0z"
|
|
217
|
-
})]
|
|
218
|
-
})
|
|
219
|
-
});
|
|
220
|
-
$[38] = rect;
|
|
221
|
-
$[39] = t20;
|
|
222
|
-
} else t20 = $[39];
|
|
223
|
-
let t21;
|
|
224
|
-
if ($[40] !== closable || $[41] !== close) {
|
|
225
|
-
t21 = closable && /* @__PURE__ */ jsx(Button, {
|
|
226
|
-
className: "k-tour-close",
|
|
227
|
-
type: "text",
|
|
228
|
-
size: "small",
|
|
229
|
-
"aria-label": "Close",
|
|
230
|
-
onClick: close,
|
|
231
|
-
icon: X
|
|
232
|
-
});
|
|
233
|
-
$[40] = closable;
|
|
234
|
-
$[41] = close;
|
|
235
|
-
$[42] = t21;
|
|
236
|
-
} else t21 = $[42];
|
|
237
|
-
let t22;
|
|
238
|
-
if ($[43] !== step.cover) {
|
|
239
|
-
t22 = step.cover && /* @__PURE__ */ jsx("div", {
|
|
240
|
-
className: "k-tour-cover",
|
|
241
|
-
children: step.cover
|
|
242
|
-
});
|
|
243
|
-
$[43] = step.cover;
|
|
244
|
-
$[44] = t22;
|
|
245
|
-
} else t22 = $[44];
|
|
246
|
-
let t23;
|
|
247
|
-
if ($[45] !== step.title) {
|
|
248
|
-
t23 = step.title && /* @__PURE__ */ jsx("h3", { children: step.title });
|
|
249
|
-
$[45] = step.title;
|
|
250
|
-
$[46] = t23;
|
|
251
|
-
} else t23 = $[46];
|
|
252
|
-
let t24;
|
|
253
|
-
if ($[47] !== step.description) {
|
|
254
|
-
t24 = /* @__PURE__ */ jsx("div", {
|
|
255
|
-
className: "k-tour-description",
|
|
256
|
-
children: step.description
|
|
257
|
-
});
|
|
258
|
-
$[47] = step.description;
|
|
259
|
-
$[48] = t24;
|
|
260
|
-
} else t24 = $[48];
|
|
261
|
-
const t25 = index + 1;
|
|
262
|
-
let t26;
|
|
263
|
-
if ($[49] !== steps.length || $[50] !== t25) {
|
|
264
|
-
t26 = /* @__PURE__ */ jsxs("span", { children: [
|
|
265
|
-
t25,
|
|
266
|
-
" / ",
|
|
267
|
-
steps.length
|
|
268
|
-
] });
|
|
269
|
-
$[49] = steps.length;
|
|
270
|
-
$[50] = t25;
|
|
271
|
-
$[51] = t26;
|
|
272
|
-
} else t26 = $[51];
|
|
273
|
-
let t27;
|
|
274
|
-
if ($[52] !== go || $[53] !== index) {
|
|
275
|
-
t27 = index > 0 && /* @__PURE__ */ jsx(Button, {
|
|
276
|
-
size: "small",
|
|
277
|
-
onClick: () => go(index - 1),
|
|
278
|
-
children: "上一步"
|
|
279
|
-
});
|
|
280
|
-
$[52] = go;
|
|
281
|
-
$[53] = index;
|
|
282
|
-
$[54] = t27;
|
|
283
|
-
} else t27 = $[54];
|
|
284
|
-
let t28;
|
|
285
|
-
if ($[55] !== close || $[56] !== go || $[57] !== index || $[58] !== onFinish || $[59] !== steps.length) {
|
|
286
|
-
t28 = () => {
|
|
287
|
-
if (index < steps.length - 1) go(index + 1);
|
|
288
|
-
else {
|
|
289
|
-
onFinish?.();
|
|
290
|
-
close();
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
$[55] = close;
|
|
294
|
-
$[56] = go;
|
|
295
|
-
$[57] = index;
|
|
296
|
-
$[58] = onFinish;
|
|
297
|
-
$[59] = steps.length;
|
|
298
|
-
$[60] = t28;
|
|
299
|
-
} else t28 = $[60];
|
|
300
|
-
const t29 = index < steps.length - 1 ? "下一步" : "完成";
|
|
301
|
-
let t30;
|
|
302
|
-
if ($[61] !== t28 || $[62] !== t29) {
|
|
303
|
-
t30 = /* @__PURE__ */ jsx(Button, {
|
|
304
|
-
size: "small",
|
|
305
|
-
type: "primary",
|
|
306
|
-
onClick: t28,
|
|
307
|
-
children: t29
|
|
308
|
-
});
|
|
309
|
-
$[61] = t28;
|
|
310
|
-
$[62] = t29;
|
|
311
|
-
$[63] = t30;
|
|
312
|
-
} else t30 = $[63];
|
|
313
|
-
let t31;
|
|
314
|
-
if ($[64] !== t27 || $[65] !== t30) {
|
|
315
|
-
t31 = /* @__PURE__ */ jsxs("div", {
|
|
316
|
-
className: "k-tour-actions",
|
|
317
|
-
children: [t27, t30]
|
|
318
|
-
});
|
|
319
|
-
$[64] = t27;
|
|
320
|
-
$[65] = t30;
|
|
321
|
-
$[66] = t31;
|
|
322
|
-
} else t31 = $[66];
|
|
323
|
-
let t32;
|
|
324
|
-
if ($[67] !== t26 || $[68] !== t31) {
|
|
325
|
-
t32 = /* @__PURE__ */ jsxs("footer", { children: [t26, t31] });
|
|
326
|
-
$[67] = t26;
|
|
327
|
-
$[68] = t31;
|
|
328
|
-
$[69] = t32;
|
|
329
|
-
} else t32 = $[69];
|
|
330
|
-
let t33;
|
|
331
|
-
if ($[70] !== t17 || $[71] !== t19 || $[72] !== t20 || $[73] !== t21 || $[74] !== t22 || $[75] !== t23 || $[76] !== t24 || $[77] !== t32) {
|
|
332
|
-
t33 = /* @__PURE__ */ jsxs("section", {
|
|
333
|
-
className: t17,
|
|
334
|
-
style: t19,
|
|
335
|
-
role: "dialog",
|
|
336
|
-
"aria-modal": "true",
|
|
337
|
-
children: [
|
|
338
|
-
t20,
|
|
339
|
-
t21,
|
|
340
|
-
t22,
|
|
341
|
-
t23,
|
|
342
|
-
t24,
|
|
343
|
-
t32
|
|
344
|
-
]
|
|
345
|
-
});
|
|
346
|
-
$[70] = t17;
|
|
347
|
-
$[71] = t19;
|
|
348
|
-
$[72] = t20;
|
|
349
|
-
$[73] = t21;
|
|
350
|
-
$[74] = t22;
|
|
351
|
-
$[75] = t23;
|
|
352
|
-
$[76] = t24;
|
|
353
|
-
$[77] = t32;
|
|
354
|
-
$[78] = t33;
|
|
355
|
-
} else t33 = $[78];
|
|
356
|
-
let t34;
|
|
357
|
-
if ($[79] !== t15 || $[80] !== t33) {
|
|
358
|
-
t34 = /* @__PURE__ */ jsx(Teleport, {
|
|
359
|
-
to: "body",
|
|
360
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
361
|
-
className: "k-tour-root",
|
|
362
|
-
children: [t15, t33]
|
|
363
|
-
})
|
|
364
|
-
});
|
|
365
|
-
$[79] = t15;
|
|
366
|
-
$[80] = t33;
|
|
367
|
-
$[81] = t34;
|
|
368
|
-
} else t34 = $[81];
|
|
369
|
-
return t34;
|
|
49
|
+
const close = () => {
|
|
50
|
+
setInnerOpen(false);
|
|
51
|
+
onOpenChange?.(false);
|
|
52
|
+
};
|
|
53
|
+
const go = (next_1) => {
|
|
54
|
+
setInnerCurrent(next_1);
|
|
55
|
+
onChange?.(next_1);
|
|
56
|
+
};
|
|
57
|
+
const panelStyle = rect ? placement === "top" ? {
|
|
58
|
+
left: rect.left + rect.width / 2,
|
|
59
|
+
top: rect.top - 12,
|
|
60
|
+
transform: "translate(-50%, -100%)"
|
|
61
|
+
} : placement === "left" ? {
|
|
62
|
+
left: rect.left - 12,
|
|
63
|
+
top: rect.top + rect.height / 2,
|
|
64
|
+
transform: "translate(-100%, -50%)"
|
|
65
|
+
} : placement === "right" ? {
|
|
66
|
+
left: rect.right + 12,
|
|
67
|
+
top: rect.top + rect.height / 2,
|
|
68
|
+
transform: "translateY(-50%)"
|
|
69
|
+
} : {
|
|
70
|
+
left: rect.left + rect.width / 2,
|
|
71
|
+
top: rect.bottom + 12,
|
|
72
|
+
transform: "translateX(-50%)"
|
|
73
|
+
} : {
|
|
74
|
+
left: "50%",
|
|
75
|
+
top: "50%",
|
|
76
|
+
transform: "translate(-50%, -50%)"
|
|
77
|
+
};
|
|
78
|
+
return /* @__PURE__ */ jsx(Teleport, {
|
|
79
|
+
to: "body",
|
|
80
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
81
|
+
className: "k-tour-root",
|
|
82
|
+
children: [/* @__PURE__ */ jsx(Transition, {
|
|
83
|
+
show: visible,
|
|
84
|
+
name: "k-modal-fade",
|
|
85
|
+
appear: true,
|
|
86
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
87
|
+
className: "k-tour-overlay",
|
|
88
|
+
children: [mask && /* @__PURE__ */ jsx("div", { className: clsx("k-tour-mask", { "k-tour-mask-spotlight": !!rect }) }), mask && rect && /* @__PURE__ */ jsx("div", {
|
|
89
|
+
className: "k-tour-focus",
|
|
90
|
+
style: {
|
|
91
|
+
left: rect.left - 5,
|
|
92
|
+
top: rect.top - 5,
|
|
93
|
+
width: rect.width + 10,
|
|
94
|
+
height: rect.height + 10
|
|
95
|
+
}
|
|
96
|
+
})]
|
|
97
|
+
})
|
|
98
|
+
}), /* @__PURE__ */ jsxs("section", {
|
|
99
|
+
className: clsx("k-tour-panel", `k-tour-${placement}`),
|
|
100
|
+
style: {
|
|
101
|
+
...panelStyle,
|
|
102
|
+
display: visible ? void 0 : "none"
|
|
103
|
+
},
|
|
104
|
+
role: "dialog",
|
|
105
|
+
"aria-modal": "true",
|
|
106
|
+
children: [
|
|
107
|
+
rect && /* @__PURE__ */ jsx("div", {
|
|
108
|
+
className: "k-tour-arrow",
|
|
109
|
+
"aria-hidden": "true",
|
|
110
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
111
|
+
viewBox: "0 0 24 8",
|
|
112
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
113
|
+
className: "k-tour-arrow-outline",
|
|
114
|
+
d: "m24,0.97087l0,1c-4,0 -5.5,1 -7.5,3c-2,2 -2.5,3 -4.5,3c-2,0 -2.5,-1 -4.5,-3c-2,-2 -3.5,-3 -7.5,-3l0,-1l24,0z"
|
|
115
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
116
|
+
className: "k-tour-arrow-inner",
|
|
117
|
+
d: "m24,0l0,1c-4,0 -5.5,1 -7.5,3c-2,2 -2.5,3 -4.5,3c-2,0 -2.5,-1 -4.5,-3c-2,-2 -3.5,-3 -7.5,-3l0,-1l24,0z"
|
|
118
|
+
})]
|
|
119
|
+
})
|
|
120
|
+
}),
|
|
121
|
+
closable && /* @__PURE__ */ jsx(Button, {
|
|
122
|
+
className: "k-tour-close",
|
|
123
|
+
type: "text",
|
|
124
|
+
size: "small",
|
|
125
|
+
"aria-label": "Close",
|
|
126
|
+
onClick: close,
|
|
127
|
+
icon: X
|
|
128
|
+
}),
|
|
129
|
+
step.cover && /* @__PURE__ */ jsx("div", {
|
|
130
|
+
className: "k-tour-cover",
|
|
131
|
+
children: step.cover
|
|
132
|
+
}),
|
|
133
|
+
step.title && /* @__PURE__ */ jsx("h3", { children: step.title }),
|
|
134
|
+
/* @__PURE__ */ jsx("div", {
|
|
135
|
+
className: "k-tour-description",
|
|
136
|
+
children: step.description
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ jsxs("footer", { children: [/* @__PURE__ */ jsxs("span", { children: [
|
|
139
|
+
index + 1,
|
|
140
|
+
" / ",
|
|
141
|
+
steps.length
|
|
142
|
+
] }), /* @__PURE__ */ jsxs("div", {
|
|
143
|
+
className: "k-tour-actions",
|
|
144
|
+
children: [index > 0 && /* @__PURE__ */ jsx(Button, {
|
|
145
|
+
size: "small",
|
|
146
|
+
onClick: () => go(index - 1),
|
|
147
|
+
children: "上一步"
|
|
148
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
149
|
+
size: "small",
|
|
150
|
+
type: "primary",
|
|
151
|
+
onClick: () => {
|
|
152
|
+
if (index < steps.length - 1) go(index + 1);
|
|
153
|
+
else {
|
|
154
|
+
onFinish?.();
|
|
155
|
+
close();
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
children: index < steps.length - 1 ? "下一步" : "完成"
|
|
159
|
+
})]
|
|
160
|
+
})] })
|
|
161
|
+
]
|
|
162
|
+
})]
|
|
163
|
+
})
|
|
164
|
+
});
|
|
370
165
|
};
|
|
371
|
-
function _temp(next) {
|
|
372
|
-
return next ?? false;
|
|
373
|
-
}
|
|
374
|
-
function _temp2(next_0) {
|
|
375
|
-
return next_0 ?? 0;
|
|
376
|
-
}
|
|
377
|
-
function _temp3() {
|
|
378
|
-
return toggleContainerScroll(document.body, false);
|
|
379
|
-
}
|
|
380
|
-
function _temp4(n) {
|
|
381
|
-
return n + 1;
|
|
382
|
-
}
|
|
383
|
-
//#endregion
|
|
384
166
|
export { Tour as default };
|