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/back-top/index.js
CHANGED
|
@@ -1,224 +1,89 @@
|
|
|
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 Teleport from "../base/teleport.js";
|
|
10
|
-
import { Transition } from "../base/transition.js";
|
|
11
9
|
import { ArrowUp } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
10
|
+
import { Transition } from "../base/transition.js";
|
|
11
|
+
import Teleport from "../base/teleport.js";
|
|
12
12
|
import Icon from "../icon/index.js";
|
|
13
|
-
import { c } from "react/compiler-runtime";
|
|
14
13
|
import clsx from "clsx";
|
|
15
14
|
import { useEffect, useEffectEvent, useRef, useState } from "react";
|
|
16
15
|
import { jsx } from "react/jsx-runtime";
|
|
17
|
-
|
|
16
|
+
// components/back-top/index.tsx
|
|
18
17
|
var defaultTarget = () => typeof document === "undefined" ? null : document.body;
|
|
19
|
-
function BackTop(
|
|
20
|
-
const $ = c(52);
|
|
21
|
-
let bottom;
|
|
22
|
-
let children;
|
|
23
|
-
let className;
|
|
24
|
-
let onClick;
|
|
25
|
-
let onKeyDown;
|
|
26
|
-
let onVisibleChange;
|
|
27
|
-
let rest;
|
|
28
|
-
let right;
|
|
29
|
-
let style;
|
|
30
|
-
let t1;
|
|
31
|
-
let t2;
|
|
32
|
-
let t3;
|
|
33
|
-
let t4;
|
|
34
|
-
let t5;
|
|
35
|
-
let t6;
|
|
36
|
-
if ($[0] !== t0) {
|
|
37
|
-
({height: t1, right, bottom, behavior: t2, target: t3, onClick, onVisibleChange, onKeyDown, children, className, style, role: t4, tabIndex: t5, "aria-label": t6, ...rest} = t0);
|
|
38
|
-
$[0] = t0;
|
|
39
|
-
$[1] = bottom;
|
|
40
|
-
$[2] = children;
|
|
41
|
-
$[3] = className;
|
|
42
|
-
$[4] = onClick;
|
|
43
|
-
$[5] = onKeyDown;
|
|
44
|
-
$[6] = onVisibleChange;
|
|
45
|
-
$[7] = rest;
|
|
46
|
-
$[8] = right;
|
|
47
|
-
$[9] = style;
|
|
48
|
-
$[10] = t1;
|
|
49
|
-
$[11] = t2;
|
|
50
|
-
$[12] = t3;
|
|
51
|
-
$[13] = t4;
|
|
52
|
-
$[14] = t5;
|
|
53
|
-
$[15] = t6;
|
|
54
|
-
} else {
|
|
55
|
-
bottom = $[1];
|
|
56
|
-
children = $[2];
|
|
57
|
-
className = $[3];
|
|
58
|
-
onClick = $[4];
|
|
59
|
-
onKeyDown = $[5];
|
|
60
|
-
onVisibleChange = $[6];
|
|
61
|
-
rest = $[7];
|
|
62
|
-
right = $[8];
|
|
63
|
-
style = $[9];
|
|
64
|
-
t1 = $[10];
|
|
65
|
-
t2 = $[11];
|
|
66
|
-
t3 = $[12];
|
|
67
|
-
t4 = $[13];
|
|
68
|
-
t5 = $[14];
|
|
69
|
-
t6 = $[15];
|
|
70
|
-
}
|
|
71
|
-
const height = t1 === void 0 ? 100 : t1;
|
|
72
|
-
const behavior = t2 === void 0 ? "smooth" : t2;
|
|
73
|
-
const target = t3 === void 0 ? defaultTarget : t3;
|
|
74
|
-
const role = t4 === void 0 ? "button" : t4;
|
|
75
|
-
const tabIndex = t5 === void 0 ? 0 : t5;
|
|
76
|
-
const ariaLabel = t6 === void 0 ? "Back to top" : t6;
|
|
18
|
+
function BackTop({ height = 100, right, bottom, behavior = "smooth", target = defaultTarget, onClick, onVisibleChange, onKeyDown, children, className, style, role = "button", tabIndex = 0, "aria-label": ariaLabel = "Back to top", ...rest }) {
|
|
77
19
|
const [visible, setVisible] = useState(false);
|
|
78
20
|
const visibleRef = useRef(false);
|
|
79
21
|
const rootRef = useRef(null);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const scrollTarget = target();
|
|
92
|
-
const eventTarget = !scrollTarget || scrollTarget === document.body || scrollTarget === document.documentElement ? window : scrollTarget;
|
|
93
|
-
const update = () => {
|
|
94
|
-
const next_0 = ("scrollTop" in eventTarget ? eventTarget.scrollTop : window.scrollY || document.documentElement.scrollTop || document.body.scrollTop) >= height;
|
|
95
|
-
if (visibleRef.current !== next_0) {
|
|
96
|
-
visibleRef.current = next_0;
|
|
97
|
-
setVisible(next_0);
|
|
98
|
-
emitVisibleChange(next_0);
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
eventTarget.addEventListener("scroll", update, { passive: true });
|
|
102
|
-
update();
|
|
103
|
-
return () => eventTarget.removeEventListener("scroll", update);
|
|
104
|
-
};
|
|
105
|
-
$[18] = emitVisibleChange;
|
|
106
|
-
$[19] = height;
|
|
107
|
-
$[20] = target;
|
|
108
|
-
$[21] = t8;
|
|
109
|
-
} else t8 = $[21];
|
|
110
|
-
let t9;
|
|
111
|
-
if ($[22] !== height || $[23] !== target) {
|
|
112
|
-
t9 = [height, target];
|
|
113
|
-
$[22] = height;
|
|
114
|
-
$[23] = target;
|
|
115
|
-
$[24] = t9;
|
|
116
|
-
} else t9 = $[24];
|
|
117
|
-
useEffect(t8, t9);
|
|
118
|
-
let t10;
|
|
119
|
-
if ($[25] !== behavior || $[26] !== onClick || $[27] !== target) {
|
|
120
|
-
t10 = (event) => {
|
|
121
|
-
onClick?.(event);
|
|
122
|
-
if (event.defaultPrevented) return;
|
|
123
|
-
const scrollTarget_0 = target();
|
|
124
|
-
if (!scrollTarget_0 || scrollTarget_0 === document.body || scrollTarget_0 === document.documentElement) window.scrollTo({
|
|
125
|
-
top: 0,
|
|
126
|
-
behavior
|
|
127
|
-
});
|
|
128
|
-
else scrollTarget_0.scrollTo({
|
|
129
|
-
top: 0,
|
|
130
|
-
behavior
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
$[25] = behavior;
|
|
134
|
-
$[26] = onClick;
|
|
135
|
-
$[27] = target;
|
|
136
|
-
$[28] = t10;
|
|
137
|
-
} else t10 = $[28];
|
|
138
|
-
const handleClick = t10;
|
|
139
|
-
let t11;
|
|
140
|
-
if ($[29] !== bottom || $[30] !== right || $[31] !== style) {
|
|
141
|
-
t11 = {
|
|
142
|
-
...style,
|
|
143
|
-
bottom,
|
|
144
|
-
right
|
|
145
|
-
};
|
|
146
|
-
$[29] = bottom;
|
|
147
|
-
$[30] = right;
|
|
148
|
-
$[31] = style;
|
|
149
|
-
$[32] = t11;
|
|
150
|
-
} else t11 = $[32];
|
|
151
|
-
const rootStyle = t11;
|
|
152
|
-
let t12;
|
|
153
|
-
if ($[33] !== className) {
|
|
154
|
-
t12 = clsx("k-back-top", className);
|
|
155
|
-
$[33] = className;
|
|
156
|
-
$[34] = t12;
|
|
157
|
-
} else t12 = $[34];
|
|
158
|
-
let t13;
|
|
159
|
-
if ($[35] !== onKeyDown) {
|
|
160
|
-
t13 = (event_0) => {
|
|
161
|
-
onKeyDown?.(event_0);
|
|
162
|
-
if (!event_0.defaultPrevented && (event_0.key === "Enter" || event_0.key === " ")) {
|
|
163
|
-
event_0.preventDefault();
|
|
164
|
-
event_0.currentTarget.click();
|
|
22
|
+
const emitVisibleChange = useEffectEvent((next) => onVisibleChange?.(next));
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (typeof window === "undefined") return;
|
|
25
|
+
const scrollTarget = target();
|
|
26
|
+
const eventTarget = !scrollTarget || scrollTarget === document.body || scrollTarget === document.documentElement ? window : scrollTarget;
|
|
27
|
+
const update = () => {
|
|
28
|
+
const next_0 = ("scrollTop" in eventTarget ? eventTarget.scrollTop : window.scrollY || document.documentElement.scrollTop || document.body.scrollTop) >= height;
|
|
29
|
+
if (visibleRef.current !== next_0) {
|
|
30
|
+
visibleRef.current = next_0;
|
|
31
|
+
setVisible(next_0);
|
|
32
|
+
emitVisibleChange(next_0);
|
|
165
33
|
}
|
|
166
34
|
};
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
35
|
+
eventTarget.addEventListener("scroll", update, { passive: true });
|
|
36
|
+
update();
|
|
37
|
+
return () => eventTarget.removeEventListener("scroll", update);
|
|
38
|
+
}, [height, target]);
|
|
39
|
+
const handleClick = (event) => {
|
|
40
|
+
onClick?.(event);
|
|
41
|
+
if (event.defaultPrevented) return;
|
|
42
|
+
const scrollTarget_0 = target();
|
|
43
|
+
if (!scrollTarget_0 || scrollTarget_0 === document.body || scrollTarget_0 === document.documentElement) window.scrollTo({
|
|
44
|
+
top: 0,
|
|
45
|
+
behavior
|
|
175
46
|
});
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
let t15;
|
|
180
|
-
if ($[39] !== ariaLabel || $[40] !== handleClick || $[41] !== rest || $[42] !== role || $[43] !== rootStyle || $[44] !== t12 || $[45] !== t13 || $[46] !== t14 || $[47] !== tabIndex) {
|
|
181
|
-
t15 = /* @__PURE__ */ jsx("div", {
|
|
182
|
-
...rest,
|
|
183
|
-
ref: rootRef,
|
|
184
|
-
className: t12,
|
|
185
|
-
style: rootStyle,
|
|
186
|
-
role,
|
|
187
|
-
tabIndex,
|
|
188
|
-
"aria-label": ariaLabel,
|
|
189
|
-
onClick: handleClick,
|
|
190
|
-
onKeyDown: t13,
|
|
191
|
-
children: t14
|
|
47
|
+
else scrollTarget_0.scrollTo({
|
|
48
|
+
top: 0,
|
|
49
|
+
behavior
|
|
192
50
|
});
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
51
|
+
};
|
|
52
|
+
const rootStyle = {
|
|
53
|
+
...style,
|
|
54
|
+
bottom,
|
|
55
|
+
right
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ jsx(Teleport, {
|
|
58
|
+
to: "body",
|
|
59
|
+
children: /* @__PURE__ */ jsx(Transition, {
|
|
60
|
+
show: visible,
|
|
61
|
+
name: "k-back-top-fade",
|
|
62
|
+
nodeRef: rootRef,
|
|
63
|
+
appear: true,
|
|
64
|
+
timeout: 400,
|
|
65
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
66
|
+
...rest,
|
|
67
|
+
ref: rootRef,
|
|
68
|
+
className: clsx("k-back-top", className),
|
|
69
|
+
style: rootStyle,
|
|
70
|
+
role,
|
|
71
|
+
tabIndex,
|
|
72
|
+
"aria-label": ariaLabel,
|
|
73
|
+
onClick: handleClick,
|
|
74
|
+
onKeyDown: (event_0) => {
|
|
75
|
+
onKeyDown?.(event_0);
|
|
76
|
+
if (!event_0.defaultPrevented && (event_0.key === "Enter" || event_0.key === " ")) {
|
|
77
|
+
event_0.preventDefault();
|
|
78
|
+
event_0.currentTarget.click();
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
children: children ?? /* @__PURE__ */ jsx("div", {
|
|
82
|
+
className: "k-back-top-content",
|
|
83
|
+
children: /* @__PURE__ */ jsx(Icon, { type: ArrowUp })
|
|
84
|
+
})
|
|
215
85
|
})
|
|
216
|
-
})
|
|
217
|
-
|
|
218
|
-
$[50] = visible;
|
|
219
|
-
$[51] = t16;
|
|
220
|
-
} else t16 = $[51];
|
|
221
|
-
return t16;
|
|
86
|
+
})
|
|
87
|
+
});
|
|
222
88
|
}
|
|
223
|
-
//#endregion
|
|
224
89
|
export { BackTop as default };
|
package/es/badge/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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 { getChildren } from "../utils/react-node.js";
|
|
10
|
-
import { isColor } from "../utils/color.js";
|
|
11
9
|
import { colors } from "../const/var.js";
|
|
12
10
|
import RollUp from "../stat-card/rollup.js";
|
|
11
|
+
import { getChildren } from "../utils/react-node.js";
|
|
12
|
+
import { isColor } from "../utils/color.js";
|
|
13
13
|
import clsx from "clsx";
|
|
14
14
|
import "react";
|
|
15
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
|
|
16
|
+
// components/badge/index.tsx
|
|
17
17
|
var Badge = ({ count, dot = false, pill = false, active = false, color, status, text, maxCount = 99, children, className = "", style, ...rest }) => {
|
|
18
18
|
const hasChildren = getChildren(children).length > 0;
|
|
19
19
|
let displayCount = null;
|
|
@@ -68,5 +68,4 @@ var Badge = ({ count, dot = false, pill = false, active = false, color, status,
|
|
|
68
68
|
]
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
|
-
//#endregion
|
|
72
71
|
export { Badge as default };
|
package/es/base/teleport.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
@@ -7,66 +7,34 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { ConfigContext } from "../config/config-context.js";
|
|
10
|
-
import { c } from "react/compiler-runtime";
|
|
11
10
|
import { useContext, useEffect, useLayoutEffect, useState } from "react";
|
|
12
11
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
13
12
|
import { createPortal } from "react-dom";
|
|
14
|
-
|
|
13
|
+
// components/base/teleport.tsx
|
|
15
14
|
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
16
|
-
var Teleport = (
|
|
17
|
-
const $ = c(10);
|
|
18
|
-
const { to, disabled: t1, defer: t2, children } = t0;
|
|
19
|
-
const disabled = t1 === void 0 ? false : t1;
|
|
20
|
-
const defer = t2 === void 0 ? false : t2;
|
|
15
|
+
var Teleport = ({ to, disabled = false, defer = false, children }) => {
|
|
21
16
|
const [container, setContainer] = useState(null);
|
|
22
17
|
const { getPopupContainer } = useContext(ConfigContext);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (typeof to === "string") return document.querySelector(to);
|
|
34
|
-
return to;
|
|
35
|
-
};
|
|
36
|
-
if (defer) {
|
|
37
|
-
const timer = setTimeout(() => {
|
|
38
|
-
setContainer(resolveTarget());
|
|
39
|
-
}, 0);
|
|
40
|
-
return () => clearTimeout(timer);
|
|
41
|
-
} else setContainer(resolveTarget());
|
|
18
|
+
useIsomorphicLayoutEffect(() => {
|
|
19
|
+
if (disabled) {
|
|
20
|
+
setContainer(null);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const resolveTarget = () => {
|
|
24
|
+
if (!to) return getPopupContainer?.() || document.body;
|
|
25
|
+
if (to === "body" && getPopupContainer) return getPopupContainer() || document.body;
|
|
26
|
+
if (typeof to === "string") return document.querySelector(to);
|
|
27
|
+
return to;
|
|
42
28
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (disabled) {
|
|
51
|
-
|
|
52
|
-
if ($[5] !== children) {
|
|
53
|
-
t4 = /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
54
|
-
$[5] = children;
|
|
55
|
-
$[6] = t4;
|
|
56
|
-
} else t4 = $[6];
|
|
57
|
-
return t4;
|
|
58
|
-
}
|
|
59
|
-
if (container) {
|
|
60
|
-
let t4;
|
|
61
|
-
if ($[7] !== children || $[8] !== container) {
|
|
62
|
-
t4 = createPortal(children, container);
|
|
63
|
-
$[7] = children;
|
|
64
|
-
$[8] = container;
|
|
65
|
-
$[9] = t4;
|
|
66
|
-
} else t4 = $[9];
|
|
67
|
-
return t4;
|
|
68
|
-
}
|
|
29
|
+
if (defer) {
|
|
30
|
+
const timer = setTimeout(() => {
|
|
31
|
+
setContainer(resolveTarget());
|
|
32
|
+
}, 0);
|
|
33
|
+
return () => clearTimeout(timer);
|
|
34
|
+
} else setContainer(resolveTarget());
|
|
35
|
+
});
|
|
36
|
+
if (disabled) return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
37
|
+
if (container) return createPortal(children, container);
|
|
69
38
|
return null;
|
|
70
39
|
};
|
|
71
|
-
//#endregion
|
|
72
40
|
export { Teleport as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
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
|
-
|
|
9
|
+
// components/base/transition-props.ts
|
|
10
10
|
function getTransitionProps(name) {
|
|
11
11
|
return {
|
|
12
12
|
name,
|
|
@@ -52,5 +52,4 @@ function getTransitionProps(name) {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
//#endregion
|
|
56
55
|
export { getTransitionProps };
|
package/es/base/transition.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import React, { Fragment, forwardRef, isValidElement, useCallback, useLayoutEffect, useRef } from "react";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
11
|
import { CSSTransition } from "react-transition-group";
|
|
12
|
-
|
|
12
|
+
// components/base/transition.tsx
|
|
13
13
|
function setRef(ref, node) {
|
|
14
14
|
if (typeof ref === "function") ref(node);
|
|
15
15
|
else if (ref) ref.current = node;
|
|
@@ -104,5 +104,4 @@ var Transition = forwardRef(function Transition({ show = false, unmountOnExit =
|
|
|
104
104
|
children: transitionChild
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
|
-
//#endregion
|
|
108
107
|
export { Transition, Transition as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { createContext } from "react";
|
|
10
|
-
|
|
10
|
+
// components/breadcrumb/breadcrumb-context.ts
|
|
11
11
|
var BreadcrumbContext = createContext("/");
|
|
12
|
-
//#endregion
|
|
13
12
|
export { BreadcrumbContext };
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
@@ -8,80 +8,25 @@
|
|
|
8
8
|
|
|
9
9
|
import Icon from "../icon/index.js";
|
|
10
10
|
import { BreadcrumbContext } from "./breadcrumb-context.js";
|
|
11
|
-
import { c } from "react/compiler-runtime";
|
|
12
11
|
import clsx from "clsx";
|
|
13
12
|
import React, { useContext } from "react";
|
|
14
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
|
|
16
|
-
var BreadcrumbItem = (
|
|
17
|
-
const $ = c(31);
|
|
18
|
-
let children;
|
|
19
|
-
let href;
|
|
20
|
-
let icon;
|
|
21
|
-
let onClick;
|
|
22
|
-
let rel;
|
|
23
|
-
let rest;
|
|
24
|
-
let t1;
|
|
25
|
-
let target;
|
|
26
|
-
if ($[0] !== t0) {
|
|
27
|
-
({href, target, rel, icon, children, className: t1, onClick, ...rest} = t0);
|
|
28
|
-
$[0] = t0;
|
|
29
|
-
$[1] = children;
|
|
30
|
-
$[2] = href;
|
|
31
|
-
$[3] = icon;
|
|
32
|
-
$[4] = onClick;
|
|
33
|
-
$[5] = rel;
|
|
34
|
-
$[6] = rest;
|
|
35
|
-
$[7] = t1;
|
|
36
|
-
$[8] = target;
|
|
37
|
-
} else {
|
|
38
|
-
children = $[1];
|
|
39
|
-
href = $[2];
|
|
40
|
-
icon = $[3];
|
|
41
|
-
onClick = $[4];
|
|
42
|
-
rel = $[5];
|
|
43
|
-
rest = $[6];
|
|
44
|
-
t1 = $[7];
|
|
45
|
-
target = $[8];
|
|
46
|
-
}
|
|
47
|
-
const className = t1 === void 0 ? "" : t1;
|
|
14
|
+
// components/breadcrumb/breadcrumb-item.tsx
|
|
15
|
+
var BreadcrumbItem = ({ href, target, rel, icon, children, className = "", onClick, ...rest }) => {
|
|
48
16
|
const separator = useContext(BreadcrumbContext);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if ($[11] !== className) {
|
|
63
|
-
t3 = clsx("k-breadcrumb-item", className);
|
|
64
|
-
$[11] = className;
|
|
65
|
-
$[12] = t3;
|
|
66
|
-
} else t3 = $[12];
|
|
67
|
-
const classes = t3;
|
|
68
|
-
let t4;
|
|
69
|
-
if ($[13] !== renderIcon) {
|
|
70
|
-
t4 = renderIcon();
|
|
71
|
-
$[13] = renderIcon;
|
|
72
|
-
$[14] = t4;
|
|
73
|
-
} else t4 = $[14];
|
|
74
|
-
let t5;
|
|
75
|
-
if ($[15] !== children || $[16] !== t4) {
|
|
76
|
-
t5 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t4, children] });
|
|
77
|
-
$[15] = children;
|
|
78
|
-
$[16] = t4;
|
|
79
|
-
$[17] = t5;
|
|
80
|
-
} else t5 = $[17];
|
|
81
|
-
const content = t5;
|
|
82
|
-
let t6;
|
|
83
|
-
if ($[18] !== content || $[19] !== href || $[20] !== rel || $[21] !== target) {
|
|
84
|
-
t6 = href ? /* @__PURE__ */ jsx("a", {
|
|
17
|
+
const renderIcon = () => {
|
|
18
|
+
if (!icon) return null;
|
|
19
|
+
if (React.isValidElement(icon) || typeof icon === "string") return icon;
|
|
20
|
+
if (Array.isArray(icon)) return /* @__PURE__ */ jsx(Icon, { type: icon });
|
|
21
|
+
return null;
|
|
22
|
+
};
|
|
23
|
+
const classes = clsx("k-breadcrumb-item", className);
|
|
24
|
+
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [renderIcon(), children] });
|
|
25
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
26
|
+
className: classes,
|
|
27
|
+
onClick,
|
|
28
|
+
...rest,
|
|
29
|
+
children: [href ? /* @__PURE__ */ jsx("a", {
|
|
85
30
|
className: "k-breadcrumb-link",
|
|
86
31
|
href,
|
|
87
32
|
target,
|
|
@@ -90,39 +35,11 @@ var BreadcrumbItem = (t0) => {
|
|
|
90
35
|
}) : /* @__PURE__ */ jsx("span", {
|
|
91
36
|
className: "k-breadcrumb-link",
|
|
92
37
|
children: content
|
|
93
|
-
})
|
|
94
|
-
$[18] = content;
|
|
95
|
-
$[19] = href;
|
|
96
|
-
$[20] = rel;
|
|
97
|
-
$[21] = target;
|
|
98
|
-
$[22] = t6;
|
|
99
|
-
} else t6 = $[22];
|
|
100
|
-
let t7;
|
|
101
|
-
if ($[23] !== separator) {
|
|
102
|
-
t7 = /* @__PURE__ */ jsx("span", {
|
|
38
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
103
39
|
className: "k-breadcrumb-separator",
|
|
104
40
|
"aria-hidden": "true",
|
|
105
41
|
children: separator
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
$[24] = t7;
|
|
109
|
-
} else t7 = $[24];
|
|
110
|
-
let t8;
|
|
111
|
-
if ($[25] !== classes || $[26] !== onClick || $[27] !== rest || $[28] !== t6 || $[29] !== t7) {
|
|
112
|
-
t8 = /* @__PURE__ */ jsxs("li", {
|
|
113
|
-
className: classes,
|
|
114
|
-
onClick,
|
|
115
|
-
...rest,
|
|
116
|
-
children: [t6, t7]
|
|
117
|
-
});
|
|
118
|
-
$[25] = classes;
|
|
119
|
-
$[26] = onClick;
|
|
120
|
-
$[27] = rest;
|
|
121
|
-
$[28] = t6;
|
|
122
|
-
$[29] = t7;
|
|
123
|
-
$[30] = t8;
|
|
124
|
-
} else t8 = $[30];
|
|
125
|
-
return t8;
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
126
44
|
};
|
|
127
|
-
//#endregion
|
|
128
45
|
export { BreadcrumbItem as default };
|