react-kui 3.2.1 → 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 +819 -162
- 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 +66 -210
- 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 +8 -9
- package/es/table/utils.js +2 -3
- 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/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/utils/css.js
CHANGED
|
@@ -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/utils/css.ts
|
|
10
10
|
var numericLengthPattern = /^-?(?:\d+\.?\d*|\.\d+)$/;
|
|
11
11
|
var toCssLength = (value) => {
|
|
12
12
|
if (typeof value === "number") return Number.isFinite(value) ? `${value}px` : void 0;
|
|
@@ -15,5 +15,4 @@ var toCssLength = (value) => {
|
|
|
15
15
|
if (!normalized) return void 0;
|
|
16
16
|
return numericLengthPattern.test(normalized) ? `${normalized}px` : normalized;
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
export { toCssLength };
|
package/es/utils/focus.js
CHANGED
|
@@ -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/utils/focus.ts
|
|
10
10
|
var focusableSelector = [
|
|
11
11
|
"[autofocus]",
|
|
12
12
|
"button:not([disabled])",
|
|
@@ -59,5 +59,4 @@ var createFocusTrap = (getContainer) => {
|
|
|
59
59
|
handleKeydown
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
//#endregion
|
|
63
62
|
export { createFocusTrap };
|
package/es/utils/number.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,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import Big from "big.js";
|
|
10
|
-
|
|
10
|
+
// components/utils/number.ts
|
|
11
11
|
var isBigSource = (value) => typeof value === "string" || typeof value === "number" || typeof value === "bigint" || value instanceof Big;
|
|
12
12
|
var isEmpty = (value) => {
|
|
13
13
|
return value == null || typeof value === "string" && value.trim() === "" || Array.isArray(value) && value.length === 0 || typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0;
|
|
@@ -70,5 +70,4 @@ var getClosestStep = (val, { min = 0, max = 100, step = 1, marks }) => {
|
|
|
70
70
|
if (closest.lt(bMin)) return Number(bMin.toFixed());
|
|
71
71
|
return Number(closest.toFixed());
|
|
72
72
|
};
|
|
73
|
-
//#endregion
|
|
74
73
|
export { getClosestStep, isEmpty, isRealNum, isValidBig, normalize };
|
|
@@ -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/utils/overlay-order.ts
|
|
10
10
|
/**
|
|
11
11
|
* 遮罩层(Modal / Drawer)与弹层(Popup)共用一个"打开顺序"时钟:数值越大越晚打开,也就越靠上。
|
|
12
12
|
* 两边各自有注册表(弹层要算子孙,语义不一样),但必须用同一个时钟才能互相比较谁压在上面。
|
|
@@ -14,5 +14,4 @@
|
|
|
14
14
|
*/
|
|
15
15
|
var order = 0;
|
|
16
16
|
var nextOverlayOrder = () => ++order;
|
|
17
|
-
//#endregion
|
|
18
17
|
export { nextOverlayOrder };
|
|
@@ -1,14 +1,14 @@
|
|
|
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 { nextOverlayOrder } from "./overlay-order.js";
|
|
10
9
|
import { latestPopupLayerOrder } from "../popup/layers.js";
|
|
11
|
-
|
|
10
|
+
import { nextOverlayOrder } from "./overlay-order.js";
|
|
11
|
+
// components/utils/overlay-stack.ts
|
|
12
12
|
var overlays = [];
|
|
13
13
|
function pushOverlay() {
|
|
14
14
|
const order = nextOverlayOrder();
|
|
@@ -29,5 +29,4 @@ function pushOverlay() {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { pushOverlay };
|
package/es/utils/placement.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
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
|
+
import { measurePopupArrow } from "./popup-arrow.js";
|
|
10
|
+
// components/utils/placement.ts
|
|
10
11
|
var popupAppearanceSources = /* @__PURE__ */ new Map();
|
|
11
12
|
var popupAppearanceObserver = null;
|
|
12
13
|
var inheritedAppearanceAttributes = ["theme-mode", "shape-mode"];
|
|
@@ -38,7 +39,7 @@ var inheritPopupAppearance = (popup, source) => {
|
|
|
38
39
|
subtree: true
|
|
39
40
|
});
|
|
40
41
|
};
|
|
41
|
-
function setPlacement({ refSelection, refPopper, currentPlacement, position = null, transOrigin, top, left, offset = 3 }) {
|
|
42
|
+
function setPlacement({ refSelection, refPopper, currentPlacement, position = null, transOrigin, top, left, offset = 3, arrowPointAtCenter = false }) {
|
|
42
43
|
if (!refPopper) return;
|
|
43
44
|
if (refPopper.current && refSelection.current) inheritPopupAppearance(refPopper.current, refSelection.current);
|
|
44
45
|
const isMouseMode = position && typeof position.x === "number" && typeof position.y === "number";
|
|
@@ -129,12 +130,24 @@ function setPlacement({ refSelection, refPopper, currentPlacement, position = nu
|
|
|
129
130
|
calcLeft = rect.left + (rect.width - pickerW) / 2;
|
|
130
131
|
originX = "center";
|
|
131
132
|
}
|
|
133
|
+
const popupArrow = refPopper.current ? measurePopupArrow(refPopper.current, finalPlacement, arrowPointAtCenter && !isMouseMode) : void 0;
|
|
134
|
+
const horizontalArrow = side === "top" || side === "bottom";
|
|
135
|
+
if (popupArrow) {
|
|
136
|
+
if (horizontalArrow) calcLeft = rect.left + rect.width / 2 - popupArrow.center;
|
|
137
|
+
else calcTop = rect.top + rect.height / 2 - popupArrow.center;
|
|
138
|
+
}
|
|
132
139
|
if (rect.bottom > 0 && rect.top < clientHeight && rect.right > 0 && rect.left < clientWidth) {
|
|
133
140
|
if (calcLeft < 0) calcLeft = 0;
|
|
134
141
|
else if (calcLeft + pickerW > clientWidth) calcLeft = clientWidth - pickerW;
|
|
135
142
|
if (calcTop < 0) calcTop = 0;
|
|
136
143
|
else if (calcTop + pickerH > clientHeight) calcTop = clientHeight - pickerH;
|
|
137
144
|
}
|
|
145
|
+
if (popupArrow) {
|
|
146
|
+
const target = horizontalArrow ? rect.left + rect.width / 2 - calcLeft : rect.top + rect.height / 2 - calcTop;
|
|
147
|
+
popupArrow.shift(target);
|
|
148
|
+
if (horizontalArrow) originX = `${target}px`;
|
|
149
|
+
else originY = `${target}px`;
|
|
150
|
+
}
|
|
138
151
|
const offsetParent = refPopper.current?.offsetParent;
|
|
139
152
|
if (!offsetParent || offsetParent === document.body || offsetParent === document.documentElement) {
|
|
140
153
|
top.current = calcTop + scrollTop;
|
|
@@ -147,5 +160,4 @@ function setPlacement({ refSelection, refPopper, currentPlacement, position = nu
|
|
|
147
160
|
transOrigin.current = `${originX} ${originY}`;
|
|
148
161
|
if (currentPlacement.current !== finalPlacement) currentPlacement.current = finalPlacement;
|
|
149
162
|
}
|
|
150
|
-
//#endregion
|
|
151
163
|
export { setPlacement };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* react-kui v3.3.0
|
|
3
|
+
* Copyright 2017-present, kui-react.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Homepage: https://react.k-ui.cn
|
|
6
|
+
* Author: Qiu / https://chuchur.com
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// components/utils/popup-arrow.ts
|
|
10
|
+
var margins = /* @__PURE__ */ new WeakMap();
|
|
11
|
+
/** Measure the painted arrow after placement CSS has been applied, including rotation. */
|
|
12
|
+
function measurePopupArrow(popup, placement, enabled) {
|
|
13
|
+
const arrow = popup.querySelector("[data-popup-arrow]");
|
|
14
|
+
if (!arrow) return;
|
|
15
|
+
const saved = margins.get(arrow);
|
|
16
|
+
if (saved) {
|
|
17
|
+
arrow.style.marginLeft = saved.left;
|
|
18
|
+
arrow.style.marginTop = saved.top;
|
|
19
|
+
}
|
|
20
|
+
if (!enabled) return;
|
|
21
|
+
popup.setAttribute("k-placement", placement);
|
|
22
|
+
const rect = popup.getBoundingClientRect();
|
|
23
|
+
const arrowRect = arrow.getBoundingClientRect();
|
|
24
|
+
const horizontal = placement.startsWith("top") || placement.startsWith("bottom");
|
|
25
|
+
const scale = horizontal ? rect.width / popup.offsetWidth : rect.height / popup.offsetHeight;
|
|
26
|
+
if (!Number.isFinite(scale) || scale <= 0) return;
|
|
27
|
+
const center = horizontal ? (arrowRect.left + arrowRect.width / 2 - rect.left) / scale : (arrowRect.top + arrowRect.height / 2 - rect.top) / scale;
|
|
28
|
+
const half = (horizontal ? arrowRect.width : arrowRect.height) / scale / 2;
|
|
29
|
+
const style = getComputedStyle(arrow);
|
|
30
|
+
const margin = parseFloat(horizontal ? style.marginLeft : style.marginTop) || 0;
|
|
31
|
+
if (!saved) margins.set(arrow, {
|
|
32
|
+
left: arrow.style.marginLeft,
|
|
33
|
+
top: arrow.style.marginTop
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
center,
|
|
37
|
+
shift(target) {
|
|
38
|
+
const size = horizontal ? popup.offsetWidth : popup.offsetHeight;
|
|
39
|
+
const safe = Math.max(half, Math.min(size - half, target));
|
|
40
|
+
if (horizontal) arrow.style.marginLeft = `${margin + safe - center}px`;
|
|
41
|
+
else arrow.style.marginTop = `${margin + safe - center}px`;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export { measurePopupArrow };
|
package/es/utils/popup.js
CHANGED
|
@@ -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/utils/popup.ts
|
|
10
10
|
/** One pending frame per owner; callbacks are replaced by the latest request. */
|
|
11
11
|
function createFrameScheduler() {
|
|
12
12
|
let frame;
|
|
@@ -38,5 +38,4 @@ function isEventOutside(event, elements, requireAll = true) {
|
|
|
38
38
|
const path = event.composedPath();
|
|
39
39
|
return nodes.every((node) => !node || !node.contains(target) && !path.includes(node));
|
|
40
40
|
}
|
|
41
|
-
//#endregion
|
|
42
41
|
export { createFrameScheduler, isEventOutside };
|
package/es/utils/promise.js
CHANGED
|
@@ -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/utils/promise.ts
|
|
10
10
|
/**
|
|
11
11
|
* onOk / validate 这类回调允许返回 Promise,组件得先认出 thenable 才决定要不要挂 loading。
|
|
12
12
|
* 两个仓库这份实现逐字符相同。
|
|
@@ -14,5 +14,4 @@
|
|
|
14
14
|
function isPromiseLike(value) {
|
|
15
15
|
return typeof value === "object" && value !== null && typeof value.then === "function";
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
export { isPromiseLike };
|
package/es/utils/react-node.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
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import React from "react";
|
|
10
10
|
import "react/jsx-runtime";
|
|
11
|
-
|
|
11
|
+
// components/utils/react-node.tsx
|
|
12
12
|
function setRef(ref, node) {
|
|
13
13
|
if (typeof ref === "function") ref(node);
|
|
14
14
|
else if (ref) ref.current = node;
|
|
@@ -84,5 +84,4 @@ var toggleContainerScroll = (target, lock) => {
|
|
|
84
84
|
if (!state.hadLockClass) target.classList.remove("k-scroll-locked");
|
|
85
85
|
scrollLocks.delete(target);
|
|
86
86
|
};
|
|
87
|
-
//#endregion
|
|
88
87
|
export { getChildren, hasRenderableContent, setRef, toggleContainerScroll };
|
|
@@ -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
|
|
@@ -11,7 +11,7 @@ import Space from "../space/index.js";
|
|
|
11
11
|
import Tag from "../tag/index.js";
|
|
12
12
|
import Tooltip from "../tooltip/index.js";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
|
|
14
|
+
// components/utils/selection-tags.tsx
|
|
15
15
|
function renderSelectionTags({ labels, maxTagCount, size = "medium", shape, theme, disabled, readOnly, onRemove, overflowSize = size, tagClass, restClass, tooltipClass, keys }) {
|
|
16
16
|
const count = typeof maxTagCount === "number" && Number.isFinite(maxTagCount) ? Math.max(0, Math.floor(maxTagCount)) : labels.length;
|
|
17
17
|
const chipTheme = resolvePaintedTheme(theme, SURFACE_THEMES) ?? "fill";
|
|
@@ -53,5 +53,4 @@ function renderSelectionTags({ labels, maxTagCount, size = "medium", shape, them
|
|
|
53
53
|
}, "tag-more"));
|
|
54
54
|
return tags;
|
|
55
55
|
}
|
|
56
|
-
//#endregion
|
|
57
56
|
export { renderSelectionTags };
|
package/es/utils/share.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
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/utils/share.ts
|
|
10
10
|
var assert = (condition, ...infos) => {
|
|
11
11
|
if (!condition) console.warn(...infos);
|
|
12
12
|
};
|
|
13
13
|
var clamp = (n, min, max) => Math.min(max, Math.max(min, n));
|
|
14
|
-
//#endregion
|
|
15
14
|
export { assert, clamp };
|
package/es/utils/theme.js
CHANGED
|
@@ -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/utils/theme.ts
|
|
10
10
|
var THEME_KEY = "theme-mode";
|
|
11
11
|
var toggleTheme = () => {
|
|
12
12
|
const isDark = document.documentElement.getAttribute(THEME_KEY) === "dark";
|
|
@@ -53,5 +53,4 @@ var Theme = {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
//#endregion
|
|
57
56
|
export { Theme as default };
|
package/es/utils/transition.js
CHANGED
|
@@ -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/utils/transition.ts
|
|
10
10
|
function getTransitionProp(name) {
|
|
11
11
|
return {
|
|
12
12
|
name,
|
|
@@ -54,5 +54,4 @@ function getTransitionProp(name) {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
//#endregion
|
|
58
57
|
export { getTransitionProp };
|
package/es/utils/use-value.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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 { c } from "react/compiler-runtime";
|
|
10
9
|
import { useState } from "react";
|
|
11
|
-
|
|
10
|
+
import { c } from "react/compiler-runtime";
|
|
11
|
+
// components/utils/use-value.ts
|
|
12
12
|
function useValue(source, normalize) {
|
|
13
13
|
const $ = c(9);
|
|
14
14
|
let t0;
|
|
@@ -56,5 +56,4 @@ function useValue(source, normalize) {
|
|
|
56
56
|
} else t2 = $[8];
|
|
57
57
|
return t2;
|
|
58
58
|
}
|
|
59
|
-
//#endregion
|
|
60
59
|
export { useValue };
|
package/es/virtual-list/index.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,53 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { getVirtualRange, normalizeItemHeight } from "./range.js";
|
|
10
|
-
import { c } from "react/compiler-runtime";
|
|
11
10
|
import clsx from "clsx";
|
|
12
11
|
import React, { useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
13
12
|
import { jsx } from "react/jsx-runtime";
|
|
14
13
|
import { flushSync } from "react-dom";
|
|
15
|
-
|
|
16
|
-
function VirtualListInner(
|
|
17
|
-
const $ = c(43);
|
|
18
|
-
let children;
|
|
19
|
-
let className;
|
|
20
|
-
let itemKey;
|
|
21
|
-
let onScroll;
|
|
22
|
-
let rest;
|
|
23
|
-
let style;
|
|
24
|
-
let t1;
|
|
25
|
-
let t2;
|
|
26
|
-
let t3;
|
|
27
|
-
let t4;
|
|
28
|
-
if ($[0] !== t0) {
|
|
29
|
-
({data: t1, height: t2, itemHeight: t3, overscan: t4, itemKey, children, className, style, onScroll, ...rest} = t0);
|
|
30
|
-
$[0] = t0;
|
|
31
|
-
$[1] = children;
|
|
32
|
-
$[2] = className;
|
|
33
|
-
$[3] = itemKey;
|
|
34
|
-
$[4] = onScroll;
|
|
35
|
-
$[5] = rest;
|
|
36
|
-
$[6] = style;
|
|
37
|
-
$[7] = t1;
|
|
38
|
-
$[8] = t2;
|
|
39
|
-
$[9] = t3;
|
|
40
|
-
$[10] = t4;
|
|
41
|
-
} else {
|
|
42
|
-
children = $[1];
|
|
43
|
-
className = $[2];
|
|
44
|
-
itemKey = $[3];
|
|
45
|
-
onScroll = $[4];
|
|
46
|
-
rest = $[5];
|
|
47
|
-
style = $[6];
|
|
48
|
-
t1 = $[7];
|
|
49
|
-
t2 = $[8];
|
|
50
|
-
t3 = $[9];
|
|
51
|
-
t4 = $[10];
|
|
52
|
-
}
|
|
53
|
-
const data = t1 === void 0 ? [] : t1;
|
|
54
|
-
const height = t2 === void 0 ? 300 : t2;
|
|
55
|
-
const itemHeight = t3 === void 0 ? 32 : t3;
|
|
56
|
-
const overscan = t4 === void 0 ? 5 : t4;
|
|
14
|
+
// components/virtual-list/index.tsx
|
|
15
|
+
function VirtualListInner({ data = [], height = 300, itemHeight = 32, overscan = 5, itemKey, children, className, style, onScroll, ...rest }, forwardedRef) {
|
|
57
16
|
const containerRef = useRef(null);
|
|
58
17
|
const scrollFrameRef = useRef(0);
|
|
59
18
|
const pendingScrollTopRef = useRef(0);
|
|
@@ -67,39 +26,17 @@ function VirtualListInner(t0, forwardedRef) {
|
|
|
67
26
|
itemHeight: safeItemHeight,
|
|
68
27
|
overscan
|
|
69
28
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
t6 = [];
|
|
82
|
-
$[11] = t5;
|
|
83
|
-
$[12] = t6;
|
|
84
|
-
} else {
|
|
85
|
-
t5 = $[11];
|
|
86
|
-
t6 = $[12];
|
|
87
|
-
}
|
|
88
|
-
useEffect(t5, t6);
|
|
89
|
-
let t7;
|
|
90
|
-
let t8;
|
|
91
|
-
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
92
|
-
t7 = () => () => {
|
|
93
|
-
cancelAnimationFrame(scrollFrameRef.current);
|
|
94
|
-
};
|
|
95
|
-
t8 = [];
|
|
96
|
-
$[13] = t7;
|
|
97
|
-
$[14] = t8;
|
|
98
|
-
} else {
|
|
99
|
-
t7 = $[13];
|
|
100
|
-
t8 = $[14];
|
|
101
|
-
}
|
|
102
|
-
useEffect(t7, t8);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const update = () => setViewportHeight(containerRef.current?.clientHeight ?? 0);
|
|
31
|
+
update();
|
|
32
|
+
if (typeof ResizeObserver === "undefined" || !containerRef.current) return;
|
|
33
|
+
const observer = new ResizeObserver(update);
|
|
34
|
+
observer.observe(containerRef.current);
|
|
35
|
+
return () => observer.disconnect();
|
|
36
|
+
}, []);
|
|
37
|
+
useEffect(() => () => {
|
|
38
|
+
cancelAnimationFrame(scrollFrameRef.current);
|
|
39
|
+
}, []);
|
|
103
40
|
useEffect(() => {
|
|
104
41
|
const container = containerRef.current;
|
|
105
42
|
if (!container) return;
|
|
@@ -109,17 +46,9 @@ function VirtualListInner(t0, forwardedRef) {
|
|
|
109
46
|
setScrollTop(maxScrollTop);
|
|
110
47
|
}
|
|
111
48
|
}, [data.length, safeItemHeight]);
|
|
112
|
-
let t10;
|
|
113
|
-
if ($[15] !== data || $[16] !== safeItemHeight) {
|
|
114
|
-
t10 = [data.length, safeItemHeight];
|
|
115
|
-
$[15] = data;
|
|
116
|
-
$[16] = safeItemHeight;
|
|
117
|
-
$[17] = t10;
|
|
118
|
-
} else t10 = $[17];
|
|
119
49
|
useImperativeHandle(forwardedRef, () => ({
|
|
120
50
|
container: containerRef.current,
|
|
121
|
-
scrollToIndex(index,
|
|
122
|
-
const align = t9 === void 0 ? "auto" : t9;
|
|
51
|
+
scrollToIndex(index, align = "auto") {
|
|
123
52
|
const container_0 = containerRef.current;
|
|
124
53
|
if (!container_0 || !data.length) return;
|
|
125
54
|
const top = Math.max(0, Math.min(Number.isFinite(index) ? Math.floor(index) : 0, data.length - 1)) * safeItemHeight;
|
|
@@ -134,119 +63,52 @@ function VirtualListInner(t0, forwardedRef) {
|
|
|
134
63
|
container_0.scrollTop = Math.max(0, Math.min(nextScrollTop, maxScrollTop_0));
|
|
135
64
|
setScrollTop(container_0.scrollTop);
|
|
136
65
|
}
|
|
137
|
-
}),
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (typeof
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return index_0;
|
|
147
|
-
};
|
|
148
|
-
$[18] = itemKey;
|
|
149
|
-
$[19] = t11;
|
|
150
|
-
} else t11 = $[19];
|
|
151
|
-
const getKey = t11;
|
|
66
|
+
}), [data.length, safeItemHeight]);
|
|
67
|
+
const getKey = (item, index_0) => {
|
|
68
|
+
if (typeof itemKey === "function") return itemKey(item, index_0);
|
|
69
|
+
if (typeof itemKey === "string" && item && typeof item === "object") {
|
|
70
|
+
const value = item[itemKey];
|
|
71
|
+
if (typeof value === "string" || typeof value === "number") return value;
|
|
72
|
+
}
|
|
73
|
+
return index_0;
|
|
74
|
+
};
|
|
152
75
|
const actualHeight = typeof height === "number" ? `${height}px` : height;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
} else t12 = $[21];
|
|
159
|
-
let t13;
|
|
160
|
-
if ($[22] !== actualHeight || $[23] !== style) {
|
|
161
|
-
t13 = {
|
|
76
|
+
return /* @__PURE__ */ jsx("div", {
|
|
77
|
+
...rest,
|
|
78
|
+
ref: containerRef,
|
|
79
|
+
className: clsx("k-virtual-list", "k-scroll", className),
|
|
80
|
+
style: {
|
|
162
81
|
...style,
|
|
163
82
|
height: actualHeight
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
$[23] = style;
|
|
167
|
-
$[24] = t13;
|
|
168
|
-
} else t13 = $[24];
|
|
169
|
-
let t14;
|
|
170
|
-
if ($[25] !== onScroll) {
|
|
171
|
-
t14 = (event) => {
|
|
83
|
+
},
|
|
84
|
+
onScroll: (event) => {
|
|
172
85
|
pendingScrollTopRef.current = event.currentTarget.scrollTop;
|
|
173
86
|
if (!scrollFrameRef.current) scrollFrameRef.current = requestAnimationFrame(() => {
|
|
174
87
|
scrollFrameRef.current = 0;
|
|
175
88
|
flushSync(() => setScrollTop(pendingScrollTopRef.current));
|
|
176
89
|
});
|
|
177
90
|
onScroll?.(event);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
$[30] = t20;
|
|
197
|
-
} else t20 = $[30];
|
|
198
|
-
const t21 = data.slice(range.start, range.end).map((item_0, localIndex) => {
|
|
199
|
-
const index_1 = range.start + localIndex;
|
|
200
|
-
return /* @__PURE__ */ jsx("div", {
|
|
201
|
-
className: "k-virtual-list-item",
|
|
202
|
-
style: { height: `${safeItemHeight}px` },
|
|
203
|
-
"data-index": index_1,
|
|
204
|
-
children: children?.(item_0, index_1)
|
|
205
|
-
}, getKey(item_0, index_1));
|
|
91
|
+
},
|
|
92
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
93
|
+
className: "k-virtual-list-spacer",
|
|
94
|
+
style: { height: `${range.total}px` },
|
|
95
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
96
|
+
className: "k-virtual-list-items",
|
|
97
|
+
style: { transform: `translateY(${range.offset}px)` },
|
|
98
|
+
children: data.slice(range.start, range.end).map((item_0, localIndex) => {
|
|
99
|
+
const index_1 = range.start + localIndex;
|
|
100
|
+
return /* @__PURE__ */ jsx("div", {
|
|
101
|
+
className: "k-virtual-list-item",
|
|
102
|
+
style: { height: `${safeItemHeight}px` },
|
|
103
|
+
"data-index": index_1,
|
|
104
|
+
children: children?.(item_0, index_1)
|
|
105
|
+
}, getKey(item_0, index_1));
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
})
|
|
206
109
|
});
|
|
207
|
-
let t22;
|
|
208
|
-
if ($[31] !== t20 || $[32] !== t21) {
|
|
209
|
-
t22 = /* @__PURE__ */ jsx("div", {
|
|
210
|
-
className: t18,
|
|
211
|
-
style: t20,
|
|
212
|
-
children: t21
|
|
213
|
-
});
|
|
214
|
-
$[31] = t20;
|
|
215
|
-
$[32] = t21;
|
|
216
|
-
$[33] = t22;
|
|
217
|
-
} else t22 = $[33];
|
|
218
|
-
let t23;
|
|
219
|
-
if ($[34] !== t17 || $[35] !== t22) {
|
|
220
|
-
t23 = /* @__PURE__ */ jsx("div", {
|
|
221
|
-
className: t15,
|
|
222
|
-
style: t17,
|
|
223
|
-
children: t22
|
|
224
|
-
});
|
|
225
|
-
$[34] = t17;
|
|
226
|
-
$[35] = t22;
|
|
227
|
-
$[36] = t23;
|
|
228
|
-
} else t23 = $[36];
|
|
229
|
-
let t24;
|
|
230
|
-
if ($[37] !== rest || $[38] !== t12 || $[39] !== t13 || $[40] !== t14 || $[41] !== t23) {
|
|
231
|
-
t24 = /* @__PURE__ */ jsx("div", {
|
|
232
|
-
...rest,
|
|
233
|
-
ref: containerRef,
|
|
234
|
-
className: t12,
|
|
235
|
-
style: t13,
|
|
236
|
-
onScroll: t14,
|
|
237
|
-
children: t23
|
|
238
|
-
});
|
|
239
|
-
$[37] = rest;
|
|
240
|
-
$[38] = t12;
|
|
241
|
-
$[39] = t13;
|
|
242
|
-
$[40] = t14;
|
|
243
|
-
$[41] = t23;
|
|
244
|
-
$[42] = t24;
|
|
245
|
-
} else t24 = $[42];
|
|
246
|
-
return t24;
|
|
247
110
|
}
|
|
248
111
|
var VirtualListBase = React.forwardRef(VirtualListInner);
|
|
249
112
|
VirtualListBase.displayName = "VirtualList";
|
|
250
113
|
var VirtualList = VirtualListBase;
|
|
251
|
-
//#endregion
|
|
252
114
|
export { VirtualList as default };
|