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/steps/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
|
|
@@ -8,132 +8,54 @@
|
|
|
8
8
|
|
|
9
9
|
import { Check, X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
10
10
|
import Icon from "../icon/index.js";
|
|
11
|
-
import { c } from "react/compiler-runtime";
|
|
12
11
|
import clsx from "clsx";
|
|
13
12
|
import React from "react";
|
|
14
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
|
|
14
|
+
// components/steps/index.tsx
|
|
16
15
|
var Step = () => null;
|
|
17
|
-
var Steps = (
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
$[10] = items;
|
|
56
|
-
$[11] = t4;
|
|
57
|
-
} else t4 = $[11];
|
|
58
|
-
const data = t4;
|
|
59
|
-
const t5 = `k-steps-${direction}`;
|
|
60
|
-
let t6;
|
|
61
|
-
if ($[12] !== className || $[13] !== t5) {
|
|
62
|
-
t6 = clsx("k-steps", t5, className);
|
|
63
|
-
$[12] = className;
|
|
64
|
-
$[13] = t5;
|
|
65
|
-
$[14] = t6;
|
|
66
|
-
} else t6 = $[14];
|
|
67
|
-
let t7;
|
|
68
|
-
if ($[15] !== current || $[16] !== data || $[17] !== onChange || $[18] !== status) {
|
|
69
|
-
let t8;
|
|
70
|
-
if ($[20] !== current || $[21] !== onChange || $[22] !== status) {
|
|
71
|
-
t8 = (item, index) => {
|
|
72
|
-
const state = item.status ?? (index < current ? "finish" : index === current ? status : "wait");
|
|
73
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
74
|
-
className: clsx("k-step", `k-step-${state}`, {
|
|
75
|
-
"k-step-clickable": !!onChange && !item.disabled,
|
|
76
|
-
"k-step-disabled": item.disabled
|
|
77
|
-
}),
|
|
78
|
-
role: "listitem",
|
|
79
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
80
|
-
className: "k-step-main",
|
|
81
|
-
role: onChange ? "button" : void 0,
|
|
82
|
-
tabIndex: onChange && !item.disabled ? 0 : void 0,
|
|
83
|
-
"aria-current": index === current ? "step" : void 0,
|
|
84
|
-
"aria-disabled": item.disabled || void 0,
|
|
85
|
-
onClick: () => !item.disabled && onChange?.(index),
|
|
86
|
-
onKeyDown: (event) => {
|
|
87
|
-
if (!item.disabled && (event.key === "Enter" || event.key === " ")) {
|
|
88
|
-
event.preventDefault();
|
|
89
|
-
onChange?.(index);
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
93
|
-
className: "k-step-dot",
|
|
94
|
-
children: item.icon ?? (state === "finish" ? /* @__PURE__ */ jsx(Icon, { type: Check }) : state === "error" ? /* @__PURE__ */ jsx(Icon, { type: X }) : index + 1)
|
|
95
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
96
|
-
className: "k-step-content",
|
|
97
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
98
|
-
className: "k-step-title",
|
|
99
|
-
children: item.title
|
|
100
|
-
}), item.description != null && /* @__PURE__ */ jsx("div", {
|
|
101
|
-
className: "k-step-description",
|
|
102
|
-
children: item.description
|
|
103
|
-
})]
|
|
16
|
+
var Steps = ({ current = 0, direction = "horizontal", status = "process", items, onChange, children, className, ...rest }) => {
|
|
17
|
+
const data = items ?? React.Children.toArray(children).flatMap((child) => React.isValidElement(child) && child.type === Step ? [child.props] : []);
|
|
18
|
+
return /* @__PURE__ */ jsx("div", {
|
|
19
|
+
...rest,
|
|
20
|
+
className: clsx("k-steps", `k-steps-${direction}`, className),
|
|
21
|
+
role: "list",
|
|
22
|
+
children: data.map((item, index) => {
|
|
23
|
+
const state = item.status ?? (index < current ? "finish" : index === current ? status : "wait");
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
25
|
+
className: clsx("k-step", `k-step-${state}`, {
|
|
26
|
+
"k-step-clickable": !!onChange && !item.disabled,
|
|
27
|
+
"k-step-disabled": item.disabled
|
|
28
|
+
}),
|
|
29
|
+
role: "listitem",
|
|
30
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
31
|
+
className: "k-step-main",
|
|
32
|
+
role: onChange ? "button" : void 0,
|
|
33
|
+
tabIndex: onChange && !item.disabled ? 0 : void 0,
|
|
34
|
+
"aria-current": index === current ? "step" : void 0,
|
|
35
|
+
"aria-disabled": item.disabled || void 0,
|
|
36
|
+
onClick: () => !item.disabled && onChange?.(index),
|
|
37
|
+
onKeyDown: (event) => {
|
|
38
|
+
if (!item.disabled && (event.key === "Enter" || event.key === " ")) {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
onChange?.(index);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
44
|
+
className: "k-step-dot",
|
|
45
|
+
children: item.icon ?? (state === "finish" ? /* @__PURE__ */ jsx(Icon, { type: Check }) : state === "error" ? /* @__PURE__ */ jsx(Icon, { type: X }) : index + 1)
|
|
46
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
47
|
+
className: "k-step-content",
|
|
48
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: "k-step-title",
|
|
50
|
+
children: item.title
|
|
51
|
+
}), item.description != null && /* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: "k-step-description",
|
|
53
|
+
children: item.description
|
|
104
54
|
})]
|
|
105
|
-
})
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
$[22] = status;
|
|
111
|
-
$[23] = t8;
|
|
112
|
-
} else t8 = $[23];
|
|
113
|
-
t7 = data.map(t8);
|
|
114
|
-
$[15] = current;
|
|
115
|
-
$[16] = data;
|
|
116
|
-
$[17] = onChange;
|
|
117
|
-
$[18] = status;
|
|
118
|
-
$[19] = t7;
|
|
119
|
-
} else t7 = $[19];
|
|
120
|
-
let t8;
|
|
121
|
-
if ($[24] !== rest || $[25] !== t6 || $[26] !== t7) {
|
|
122
|
-
t8 = /* @__PURE__ */ jsx("div", {
|
|
123
|
-
...rest,
|
|
124
|
-
className: t6,
|
|
125
|
-
role: "list",
|
|
126
|
-
children: t7
|
|
127
|
-
});
|
|
128
|
-
$[24] = rest;
|
|
129
|
-
$[25] = t6;
|
|
130
|
-
$[26] = t7;
|
|
131
|
-
$[27] = t8;
|
|
132
|
-
} else t8 = $[27];
|
|
133
|
-
return t8;
|
|
55
|
+
})]
|
|
56
|
+
}), /* @__PURE__ */ jsx("span", { className: "k-step-line" })]
|
|
57
|
+
}, index);
|
|
58
|
+
})
|
|
59
|
+
});
|
|
134
60
|
};
|
|
135
|
-
function _temp(child) {
|
|
136
|
-
return React.isValidElement(child) && child.type === Step ? [child.props] : [];
|
|
137
|
-
}
|
|
138
|
-
//#endregion
|
|
139
61
|
export { Step, Steps as default };
|
package/es/switch/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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";
|
|
9
10
|
import { useFormAppearance } from "../config/use-config-appearance.js";
|
|
11
|
+
import { createFormFieldComponent } from "../form/field-context.js";
|
|
10
12
|
import { Loading } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
11
13
|
import Icon from "../icon/index.js";
|
|
12
|
-
import { useValue } from "../utils/use-value.js";
|
|
13
|
-
import { createFormFieldComponent } from "../form/field-context.js";
|
|
14
14
|
import { getValueWithType } from "../utils/checked.js";
|
|
15
15
|
import clsx from "clsx";
|
|
16
16
|
import "react";
|
|
17
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
-
|
|
18
|
+
// components/switch/index.tsx
|
|
19
19
|
var Switch = ({ checked, valueType = "boolean", type, color, disabled = false, readOnly = false, loading = false, size: sizeProp, shape: shapeProp, trueText, falseText, checkedChildren, unCheckedChildren, onChange, className = "", style, onClick, ...rest }) => {
|
|
20
20
|
const inheritedAppearance = useFormAppearance();
|
|
21
21
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
@@ -69,5 +69,4 @@ var switch_default = createFormFieldComponent(Switch, {
|
|
|
69
69
|
valueProp: "checked",
|
|
70
70
|
getFieldValue: (value) => value === true || value === 1 || value === "1"
|
|
71
71
|
});
|
|
72
|
-
//#endregion
|
|
73
72
|
export { switch_default as default };
|
|
@@ -1,36 +1,23 @@
|
|
|
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 { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
|
|
10
9
|
import Button from "../button/button.js";
|
|
11
10
|
import checkbox_group_default from "../checkbox/checkbox-group.js";
|
|
11
|
+
import { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
|
|
12
12
|
import Poptip from "../poptip/index.js";
|
|
13
|
-
import { c } from "react/compiler-runtime";
|
|
14
13
|
import { useContext, useState } from "react";
|
|
15
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
|
|
15
|
+
// components/table/column-setting.tsx
|
|
17
16
|
/**
|
|
18
17
|
* 表格列设置组件,用于动态显示/隐藏列
|
|
19
18
|
* 与 kui-vue 一致,使用 CheckboxGroup 简单列表
|
|
20
19
|
*/
|
|
21
|
-
function TableColumnSetting(
|
|
22
|
-
const $ = c(33);
|
|
23
|
-
const { columns: t1, hiddenKeys: t2, onHiddenKeysChange, disabledKeys: t3, title: titleProp, resetText: resetTextProp, size, showReset: t4, children } = t0;
|
|
24
|
-
const columns = t1 === void 0 ? [] : t1;
|
|
25
|
-
let t5;
|
|
26
|
-
if ($[0] !== t2) {
|
|
27
|
-
t5 = t2 === void 0 ? [] : t2;
|
|
28
|
-
$[0] = t2;
|
|
29
|
-
$[1] = t5;
|
|
30
|
-
} else t5 = $[1];
|
|
31
|
-
const hiddenKeys = t5;
|
|
32
|
-
const disabledKeys = t3 === void 0 ? [] : t3;
|
|
33
|
-
const showReset = t4 === void 0 ? true : t4;
|
|
20
|
+
function TableColumnSetting({ columns = [], hiddenKeys = [], onHiddenKeysChange, disabledKeys = [], title: titleProp, resetText: resetTextProp, size, showReset = true, children }) {
|
|
34
21
|
const [open, setOpen] = useState(false);
|
|
35
22
|
const locale = useContext(ConfigContext)?.locale || DEFAULT_LOCALE;
|
|
36
23
|
const title = titleProp || locale?.k?.table?.columnSettings || "Column settings";
|
|
@@ -39,130 +26,47 @@ function TableColumnSetting(t0) {
|
|
|
39
26
|
const collectLeaves = (items) => items.forEach((column) => column.children?.length ? collectLeaves(column.children) : leafColumns.push(column));
|
|
40
27
|
collectLeaves(columns);
|
|
41
28
|
const configurableColumns = leafColumns.filter((col) => !disabledKeys.includes(col.key));
|
|
42
|
-
const visibleKeys = configurableColumns.map(
|
|
43
|
-
|
|
44
|
-
if ($[2] !== configurableColumns) {
|
|
45
|
-
t6 = configurableColumns.map(_temp2);
|
|
46
|
-
$[2] = configurableColumns;
|
|
47
|
-
$[3] = t6;
|
|
48
|
-
} else t6 = $[3];
|
|
49
|
-
const options = t6;
|
|
50
|
-
let t7;
|
|
51
|
-
if ($[4] !== configurableColumns || $[5] !== hiddenKeys || $[6] !== onHiddenKeysChange) {
|
|
52
|
-
t7 = (values) => {
|
|
53
|
-
const selected = new Set(values.map(String));
|
|
54
|
-
const configurable = new Set(configurableColumns.map(_temp3));
|
|
55
|
-
const next = [...hiddenKeys.filter((key_0) => !configurable.has(String(key_0))), ...configurableColumns.map(_temp4).filter((key_1) => !selected.has(String(key_1)))];
|
|
56
|
-
onHiddenKeysChange?.(next);
|
|
57
|
-
};
|
|
58
|
-
$[4] = configurableColumns;
|
|
59
|
-
$[5] = hiddenKeys;
|
|
60
|
-
$[6] = onHiddenKeysChange;
|
|
61
|
-
$[7] = t7;
|
|
62
|
-
} else t7 = $[7];
|
|
63
|
-
const handleUpdate = t7;
|
|
64
|
-
let t8;
|
|
65
|
-
if ($[8] !== configurableColumns || $[9] !== handleUpdate) {
|
|
66
|
-
t8 = () => {
|
|
67
|
-
handleUpdate(configurableColumns.map(_temp5));
|
|
68
|
-
};
|
|
69
|
-
$[8] = configurableColumns;
|
|
70
|
-
$[9] = handleUpdate;
|
|
71
|
-
$[10] = t8;
|
|
72
|
-
} else t8 = $[10];
|
|
73
|
-
const handleReset = t8;
|
|
74
|
-
let t9;
|
|
75
|
-
if ($[11] !== handleUpdate || $[12] !== options || $[13] !== size || $[14] !== visibleKeys) {
|
|
76
|
-
t9 = /* @__PURE__ */ jsx(checkbox_group_default, {
|
|
77
|
-
value: visibleKeys,
|
|
78
|
-
options,
|
|
79
|
-
direction: "vertical",
|
|
80
|
-
size,
|
|
81
|
-
onChange: handleUpdate
|
|
82
|
-
});
|
|
83
|
-
$[11] = handleUpdate;
|
|
84
|
-
$[12] = options;
|
|
85
|
-
$[13] = size;
|
|
86
|
-
$[14] = visibleKeys;
|
|
87
|
-
$[15] = t9;
|
|
88
|
-
} else t9 = $[15];
|
|
89
|
-
let t10;
|
|
90
|
-
if ($[16] !== handleReset || $[17] !== resetText || $[18] !== showReset) {
|
|
91
|
-
t10 = showReset && /* @__PURE__ */ jsx(Button, {
|
|
92
|
-
className: "k-table-column-setting-reset",
|
|
93
|
-
theme: "plain",
|
|
94
|
-
size: "small",
|
|
95
|
-
onClick: handleReset,
|
|
96
|
-
children: resetText
|
|
97
|
-
});
|
|
98
|
-
$[16] = handleReset;
|
|
99
|
-
$[17] = resetText;
|
|
100
|
-
$[18] = showReset;
|
|
101
|
-
$[19] = t10;
|
|
102
|
-
} else t10 = $[19];
|
|
103
|
-
let t11;
|
|
104
|
-
if ($[20] !== t10 || $[21] !== t9) {
|
|
105
|
-
t11 = /* @__PURE__ */ jsxs("div", {
|
|
106
|
-
className: "k-table-column-setting",
|
|
107
|
-
onClick: _temp6,
|
|
108
|
-
children: [t9, t10]
|
|
109
|
-
});
|
|
110
|
-
$[20] = t10;
|
|
111
|
-
$[21] = t9;
|
|
112
|
-
$[22] = t11;
|
|
113
|
-
} else t11 = $[22];
|
|
114
|
-
const content = t11;
|
|
115
|
-
let t12;
|
|
116
|
-
if ($[23] !== children || $[24] !== size || $[25] !== title) {
|
|
117
|
-
t12 = children ?? /* @__PURE__ */ jsx(Button, {
|
|
118
|
-
size,
|
|
119
|
-
children: title
|
|
120
|
-
});
|
|
121
|
-
$[23] = children;
|
|
122
|
-
$[24] = size;
|
|
123
|
-
$[25] = title;
|
|
124
|
-
$[26] = t12;
|
|
125
|
-
} else t12 = $[26];
|
|
126
|
-
let t13;
|
|
127
|
-
if ($[27] !== content || $[28] !== open || $[29] !== setOpen || $[30] !== t12 || $[31] !== title) {
|
|
128
|
-
t13 = /* @__PURE__ */ jsx(Poptip, {
|
|
129
|
-
trigger: "click",
|
|
130
|
-
placement: "bottom-right",
|
|
131
|
-
title,
|
|
132
|
-
content,
|
|
133
|
-
open,
|
|
134
|
-
onOpenChange: setOpen,
|
|
135
|
-
children: t12
|
|
136
|
-
});
|
|
137
|
-
$[27] = content;
|
|
138
|
-
$[28] = open;
|
|
139
|
-
$[29] = setOpen;
|
|
140
|
-
$[30] = t12;
|
|
141
|
-
$[31] = title;
|
|
142
|
-
$[32] = t13;
|
|
143
|
-
} else t13 = $[32];
|
|
144
|
-
return t13;
|
|
145
|
-
}
|
|
146
|
-
function _temp6(e) {
|
|
147
|
-
return e.stopPropagation();
|
|
148
|
-
}
|
|
149
|
-
function _temp5(col_4) {
|
|
150
|
-
return col_4.key;
|
|
151
|
-
}
|
|
152
|
-
function _temp4(col_3) {
|
|
153
|
-
return col_3.key;
|
|
154
|
-
}
|
|
155
|
-
function _temp3(col_2) {
|
|
156
|
-
return String(col_2.key);
|
|
157
|
-
}
|
|
158
|
-
function _temp2(col_1) {
|
|
159
|
-
return {
|
|
29
|
+
const visibleKeys = configurableColumns.map((col_0) => col_0.key).filter((key) => !hiddenKeys.includes(key));
|
|
30
|
+
const options = configurableColumns.map((col_1) => ({
|
|
160
31
|
label: String(col_1.title),
|
|
161
32
|
value: col_1.key
|
|
33
|
+
}));
|
|
34
|
+
const handleUpdate = (values) => {
|
|
35
|
+
const selected = new Set(values.map(String));
|
|
36
|
+
const configurable = new Set(configurableColumns.map((col_2) => String(col_2.key)));
|
|
37
|
+
const next = [...hiddenKeys.filter((key_0) => !configurable.has(String(key_0))), ...configurableColumns.map((col_3) => col_3.key).filter((key_1) => !selected.has(String(key_1)))];
|
|
38
|
+
onHiddenKeysChange?.(next);
|
|
162
39
|
};
|
|
40
|
+
const handleReset = () => {
|
|
41
|
+
handleUpdate(configurableColumns.map((col_4) => col_4.key));
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ jsx(Poptip, {
|
|
44
|
+
trigger: "click",
|
|
45
|
+
placement: "bottom-right",
|
|
46
|
+
title,
|
|
47
|
+
content: /* @__PURE__ */ jsxs("div", {
|
|
48
|
+
className: "k-table-column-setting",
|
|
49
|
+
onClick: (e) => e.stopPropagation(),
|
|
50
|
+
children: [/* @__PURE__ */ jsx(checkbox_group_default, {
|
|
51
|
+
value: visibleKeys,
|
|
52
|
+
options,
|
|
53
|
+
direction: "vertical",
|
|
54
|
+
size,
|
|
55
|
+
onChange: handleUpdate
|
|
56
|
+
}), showReset && /* @__PURE__ */ jsx(Button, {
|
|
57
|
+
className: "k-table-column-setting-reset",
|
|
58
|
+
theme: "plain",
|
|
59
|
+
size: "small",
|
|
60
|
+
onClick: handleReset,
|
|
61
|
+
children: resetText
|
|
62
|
+
})]
|
|
63
|
+
}),
|
|
64
|
+
open,
|
|
65
|
+
onOpenChange: setOpen,
|
|
66
|
+
children: children ?? /* @__PURE__ */ jsx(Button, {
|
|
67
|
+
size,
|
|
68
|
+
children: title
|
|
69
|
+
})
|
|
70
|
+
});
|
|
163
71
|
}
|
|
164
|
-
function _temp(col_0) {
|
|
165
|
-
return col_0.key;
|
|
166
|
-
}
|
|
167
|
-
//#endregion
|
|
168
72
|
export { TableColumnSetting };
|
package/es/table/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
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 {
|
|
9
|
+
import { useValue } from "../utils/use-value.js";
|
|
10
10
|
import { normalizeSurfaceShape, useConfigAppearance } from "../config/use-config-appearance.js";
|
|
11
11
|
import { ChevronDown, ChevronRight, Triangle } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
12
|
-
import Icon from "../icon/index.js";
|
|
13
|
-
import { useValue } from "../utils/use-value.js";
|
|
14
|
-
import Empty from "../empty/index.js";
|
|
15
12
|
import checkbox_default from "../checkbox/checkbox.js";
|
|
13
|
+
import { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
|
|
14
|
+
import Empty from "../empty/index.js";
|
|
15
|
+
import Icon from "../icon/index.js";
|
|
16
|
+
import Spin from "../spin/index.js";
|
|
16
17
|
import Tooltip from "../tooltip/index.js";
|
|
17
18
|
import { getVirtualRange } from "../virtual-list/range.js";
|
|
18
|
-
import Spin from "../spin/index.js";
|
|
19
19
|
import { compareSortValues, countColumnLeaves, flattenColumns, flattenTreeData, getRecordValue, inheritColumnFixed, mergeExpandAllRows, resolveCellEllipsis, resolveRowKey } from "./utils.js";
|
|
20
20
|
import { TableColumnSetting } from "./column-setting.js";
|
|
21
|
-
import { c } from "react/compiler-runtime";
|
|
22
21
|
import clsx from "clsx";
|
|
23
|
-
import { useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
22
|
+
import { isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
24
23
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { c } from "react/compiler-runtime";
|
|
25
25
|
import { flushSync } from "react-dom";
|
|
26
|
-
|
|
26
|
+
// components/table/index.tsx
|
|
27
27
|
/**
|
|
28
28
|
* 默认值必须是稳定引用。每次渲染都新建的 `[]` / `{}` 会让
|
|
29
29
|
* `visibleColumns → leaves → sortRecords → rows → matrix` 这条 memo 链整段失效,
|
|
@@ -155,6 +155,17 @@ var EllipsisCell = (t0) => {
|
|
|
155
155
|
return t8;
|
|
156
156
|
};
|
|
157
157
|
/**
|
|
158
|
+
* 单元格原始值的渲染兜底,与 kui-vue 同口径(vue 的渲染器会把对象子节点转成文本:普通对象与
|
|
159
|
+
* `Date` 调 `String()`,数组逐项展开)。React 遇到同样的对象会直接抛
|
|
160
|
+
* "Objects are not valid as a React child" 把整张表打崩,所以先在这一层转掉。
|
|
161
|
+
* React 元素原样保留,数组继续按子节点序列交给 React(`[1, 2]` 两边都渲染成 "12")。
|
|
162
|
+
*/
|
|
163
|
+
var renderRawValue = (value) => {
|
|
164
|
+
if (Array.isArray(value)) return value.map(renderRawValue);
|
|
165
|
+
if (value !== null && typeof value === "object" && !isValidElement(value)) return String(value);
|
|
166
|
+
return value;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
158
169
|
* 行展开状态。`expandedKeys` 提供时完全受控;否则 `expandAllRows` 决定初始是否全部展开,
|
|
159
170
|
* 并且此后 `data` 变化只补“新出现的父行”(见 `mergeExpandAllRows`),
|
|
160
171
|
* 用户手动展开或折叠过的行不会被异步到达的数据覆盖。
|
|
@@ -414,7 +425,7 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
|
|
|
414
425
|
]);
|
|
415
426
|
const fixedClass = (column_4, index_2, colSpan = 1) => clsx({
|
|
416
427
|
"k-table-cell-fix-left": column_4.fixed === "left",
|
|
417
|
-
"k-table-cell-fix-left-last": column_4.fixed === "left" && leaves[index_2 +
|
|
428
|
+
"k-table-cell-fix-left-last": column_4.fixed === "left" && leaves[index_2 + colSpan]?.fixed !== "left",
|
|
418
429
|
"k-table-cell-fix-right": column_4.fixed === "right",
|
|
419
430
|
"k-table-cell-fix-right-first": column_4.fixed === "right" && leaves[index_2 - 1]?.fixed !== "right",
|
|
420
431
|
"k-table-cell-sorter": column_4.sorter,
|
|
@@ -638,7 +649,7 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
|
|
|
638
649
|
const thead = /* @__PURE__ */ jsx("thead", { children: headerInfo.rows.map((row_5, rowIndex) => /* @__PURE__ */ jsxs("tr", { children: [checkable && rowIndex === 0 && /* @__PURE__ */ jsx("th", {
|
|
639
650
|
rowSpan: headerInfo.maxDepth,
|
|
640
651
|
className: clsx("k-table-cell-fix-left", {
|
|
641
|
-
"k-table-cell-fix-left-last": ping.left,
|
|
652
|
+
"k-table-cell-fix-left-last": ping.left && leaves[0]?.fixed !== "left",
|
|
642
653
|
"k-table-cell-last-column": !leaves.length
|
|
643
654
|
}),
|
|
644
655
|
style: { left: 0 },
|
|
@@ -707,7 +718,7 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
|
|
|
707
718
|
},
|
|
708
719
|
children: [checkable && /* @__PURE__ */ jsx("td", {
|
|
709
720
|
className: clsx("k-table-cell-fix-left", {
|
|
710
|
-
"k-table-cell-fix-left-last": ping.left,
|
|
721
|
+
"k-table-cell-fix-left-last": ping.left && leaves[0]?.fixed !== "left",
|
|
711
722
|
"k-table-cell-last-column": !leaves.length
|
|
712
723
|
}),
|
|
713
724
|
style: {
|
|
@@ -728,7 +739,7 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
|
|
|
728
739
|
};
|
|
729
740
|
if (!cell_2.show) return null;
|
|
730
741
|
const value = getRecordValue(record_6, column_11.key);
|
|
731
|
-
const content = column_11.render?.(value, record_6, rowIndex_0, column_11) ?? value;
|
|
742
|
+
const content = column_11.render?.(value, record_6, rowIndex_0, column_11) ?? renderRawValue(value);
|
|
732
743
|
const ellipsis = cellEllipsis.get(column_11.key);
|
|
733
744
|
return /* @__PURE__ */ jsx("td", {
|
|
734
745
|
"aria-labelledby": splitHeader ? headCellIds.get(column_11.key) : void 0,
|
|
@@ -816,7 +827,7 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
|
|
|
816
827
|
ref: bodyRef,
|
|
817
828
|
style: {
|
|
818
829
|
overflowY: scroll.y ? "scroll" : "auto",
|
|
819
|
-
overflowX:
|
|
830
|
+
overflowX: "auto",
|
|
820
831
|
maxHeight: scroll.y
|
|
821
832
|
},
|
|
822
833
|
onScroll: handleScroll,
|
|
@@ -844,5 +855,4 @@ function Table({ data = EMPTY_DATA, columns = EMPTY_COLUMNS, ellipsis: tableElli
|
|
|
844
855
|
]
|
|
845
856
|
});
|
|
846
857
|
}
|
|
847
|
-
//#endregion
|
|
848
858
|
export { TableColumnSetting, Table as default };
|
package/es/table/utils.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 { assert } from "../utils/share.js";
|
|
10
|
-
|
|
10
|
+
// components/table/utils.ts
|
|
11
11
|
var flattenColumns = (columns) => columns.flatMap((column) => column.children?.length ? flattenColumns(column.children) : column);
|
|
12
12
|
var countColumnLeaves = (column) => column.children?.length ? column.children.reduce((sum, child) => sum + countColumnLeaves(child), 0) : 1;
|
|
13
13
|
/**
|
|
@@ -109,8 +109,7 @@ var getSyntheticRowKey = (record) => {
|
|
|
109
109
|
* 本函数与上面的 `getSyntheticRowKey` 在两个仓库里是逐字节相同的副本,改一边必须同步另一边。
|
|
110
110
|
*/
|
|
111
111
|
var resolveRowKey = (record, rowKey) => {
|
|
112
|
-
|
|
113
|
-
const value = getRecordValue(record, rowKey);
|
|
112
|
+
const value = typeof rowKey === "function" ? rowKey(record) : getRecordValue(record, rowKey);
|
|
114
113
|
return typeof value === "string" || typeof value === "number" ? value : getSyntheticRowKey(record);
|
|
115
114
|
};
|
|
116
115
|
var flattenTreeData = ({ data, childrenColumnName, expandedKeys, getKey, sortRecords = (records) => records }) => {
|
|
@@ -168,5 +167,4 @@ var resolveCellEllipsis = (columnValue, tableValue) => {
|
|
|
168
167
|
tooltip: options.tooltip
|
|
169
168
|
};
|
|
170
169
|
};
|
|
171
|
-
//#endregion
|
|
172
170
|
export { compareSortValues, countColumnLeaves, flattenColumns, flattenTreeData, getRecordValue, getSyntheticRowKey, getTreeChildren, inheritColumnFixed, mergeExpandAllRows, resolveCellEllipsis, resolveRowKey };
|
package/es/tabs/tab-panel.js
CHANGED
|
@@ -1,86 +1,34 @@
|
|
|
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 clsx from "clsx";
|
|
11
10
|
import "react";
|
|
12
11
|
import { jsx } from "react/jsx-runtime";
|
|
13
|
-
|
|
12
|
+
// components/tabs/tab-panel.tsx
|
|
14
13
|
var TabPanel = (props) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
({tabKey, activeKey, tabsId, children, className: t0, ...rest} = props);
|
|
24
|
-
$[0] = props;
|
|
25
|
-
$[1] = activeKey;
|
|
26
|
-
$[2] = children;
|
|
27
|
-
$[3] = rest;
|
|
28
|
-
$[4] = t0;
|
|
29
|
-
$[5] = tabKey;
|
|
30
|
-
$[6] = tabsId;
|
|
31
|
-
} else {
|
|
32
|
-
activeKey = $[1];
|
|
33
|
-
children = $[2];
|
|
34
|
-
rest = $[3];
|
|
35
|
-
t0 = $[4];
|
|
36
|
-
tabKey = $[5];
|
|
37
|
-
tabsId = $[6];
|
|
38
|
-
}
|
|
39
|
-
const className = t0 === void 0 ? "" : t0;
|
|
40
|
-
let domProps;
|
|
41
|
-
if ($[7] !== rest) {
|
|
42
|
-
domProps = {
|
|
43
|
-
...rest,
|
|
44
|
-
title: void 0
|
|
45
|
-
};
|
|
46
|
-
delete domProps.icon;
|
|
47
|
-
delete domProps.disabled;
|
|
48
|
-
delete domProps.closable;
|
|
49
|
-
$[7] = rest;
|
|
50
|
-
$[8] = domProps;
|
|
51
|
-
} else domProps = $[8];
|
|
14
|
+
const { tabKey, activeKey, tabsId, children, className = "", ...rest } = props;
|
|
15
|
+
const domProps = {
|
|
16
|
+
...rest,
|
|
17
|
+
title: void 0
|
|
18
|
+
};
|
|
19
|
+
delete domProps.icon;
|
|
20
|
+
delete domProps.disabled;
|
|
21
|
+
delete domProps.closable;
|
|
52
22
|
const htmlProps = domProps;
|
|
53
23
|
const isActive = tabKey !== void 0 && String(activeKey) === String(tabKey);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const t4 = !isActive;
|
|
64
|
-
let t5;
|
|
65
|
-
if ($[12] !== children || $[13] !== htmlProps || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 || $[17] !== t4) {
|
|
66
|
-
t5 = /* @__PURE__ */ jsx("div", {
|
|
67
|
-
className: t1,
|
|
68
|
-
id: t2,
|
|
69
|
-
role: "tabpanel",
|
|
70
|
-
"aria-labelledby": t3,
|
|
71
|
-
"aria-hidden": t4,
|
|
72
|
-
...htmlProps,
|
|
73
|
-
children
|
|
74
|
-
});
|
|
75
|
-
$[12] = children;
|
|
76
|
-
$[13] = htmlProps;
|
|
77
|
-
$[14] = t1;
|
|
78
|
-
$[15] = t2;
|
|
79
|
-
$[16] = t3;
|
|
80
|
-
$[17] = t4;
|
|
81
|
-
$[18] = t5;
|
|
82
|
-
} else t5 = $[18];
|
|
83
|
-
return t5;
|
|
24
|
+
return /* @__PURE__ */ jsx("div", {
|
|
25
|
+
className: clsx("k-tabs-tabpanel", { "k-tabs-tabpanel-active": isActive }, className),
|
|
26
|
+
id: tabKey !== void 0 ? `${tabsId}-panel-${String(tabKey)}` : void 0,
|
|
27
|
+
role: "tabpanel",
|
|
28
|
+
"aria-labelledby": tabKey !== void 0 ? `${tabsId}-tab-${String(tabKey)}` : void 0,
|
|
29
|
+
"aria-hidden": !isActive,
|
|
30
|
+
...htmlProps,
|
|
31
|
+
children
|
|
32
|
+
});
|
|
84
33
|
};
|
|
85
|
-
//#endregion
|
|
86
34
|
export { TabPanel as default };
|