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/select/option.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,125 +8,32 @@
|
|
|
8
8
|
|
|
9
9
|
import { Check } 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";
|
|
14
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
|
|
16
|
-
var Option = (
|
|
17
|
-
const $ = c(36);
|
|
18
|
-
let children;
|
|
19
|
-
let label;
|
|
20
|
-
let onClick;
|
|
21
|
-
let onMouseEnter;
|
|
22
|
-
let onSelect;
|
|
23
|
-
let rest;
|
|
24
|
-
let t1;
|
|
25
|
-
let t2;
|
|
26
|
-
let t3;
|
|
27
|
-
let t4;
|
|
28
|
-
let t5;
|
|
29
|
-
let value;
|
|
30
|
-
if ($[0] !== t0) {
|
|
31
|
-
({value, label, disabled: t1, checked: t2, active: t3, multiple: t4, onSelect, onClick, onMouseEnter, children, className: t5, ...rest} = t0);
|
|
32
|
-
$[0] = t0;
|
|
33
|
-
$[1] = children;
|
|
34
|
-
$[2] = label;
|
|
35
|
-
$[3] = onClick;
|
|
36
|
-
$[4] = onMouseEnter;
|
|
37
|
-
$[5] = onSelect;
|
|
38
|
-
$[6] = rest;
|
|
39
|
-
$[7] = t1;
|
|
40
|
-
$[8] = t2;
|
|
41
|
-
$[9] = t3;
|
|
42
|
-
$[10] = t4;
|
|
43
|
-
$[11] = t5;
|
|
44
|
-
$[12] = value;
|
|
45
|
-
} else {
|
|
46
|
-
children = $[1];
|
|
47
|
-
label = $[2];
|
|
48
|
-
onClick = $[3];
|
|
49
|
-
onMouseEnter = $[4];
|
|
50
|
-
onSelect = $[5];
|
|
51
|
-
rest = $[6];
|
|
52
|
-
t1 = $[7];
|
|
53
|
-
t2 = $[8];
|
|
54
|
-
t3 = $[9];
|
|
55
|
-
t4 = $[10];
|
|
56
|
-
t5 = $[11];
|
|
57
|
-
value = $[12];
|
|
58
|
-
}
|
|
59
|
-
const disabled = t1 === void 0 ? false : t1;
|
|
60
|
-
const checked = t2 === void 0 ? false : t2;
|
|
61
|
-
const active = t3 === void 0 ? false : t3;
|
|
62
|
-
const multiple = t4 === void 0 ? false : t4;
|
|
63
|
-
const className = t5 === void 0 ? "" : t5;
|
|
14
|
+
// components/select/option.tsx
|
|
15
|
+
var Option = ({ value, label, disabled = false, checked = false, active = false, multiple = false, onSelect, onClick, onMouseEnter, children, className = "", ...rest }) => {
|
|
64
16
|
const labelText = label ?? children ?? value;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
value,
|
|
71
|
-
label: typeof labelText === "string" || typeof labelText === "number" ? labelText : value
|
|
72
|
-
});
|
|
73
|
-
onClick?.(event);
|
|
74
|
-
};
|
|
75
|
-
$[13] = disabled;
|
|
76
|
-
$[14] = labelText;
|
|
77
|
-
$[15] = onClick;
|
|
78
|
-
$[16] = onSelect;
|
|
79
|
-
$[17] = value;
|
|
80
|
-
$[18] = t6;
|
|
81
|
-
} else t6 = $[18];
|
|
82
|
-
const handleSelect = t6;
|
|
83
|
-
let t7;
|
|
84
|
-
if ($[19] !== active || $[20] !== checked || $[21] !== className || $[22] !== disabled) {
|
|
85
|
-
t7 = clsx("k-select-item", {
|
|
86
|
-
"k-select-item-selected": checked,
|
|
87
|
-
"k-select-item-active": active,
|
|
88
|
-
"k-select-item-disabled": disabled
|
|
89
|
-
}, className);
|
|
90
|
-
$[19] = active;
|
|
91
|
-
$[20] = checked;
|
|
92
|
-
$[21] = className;
|
|
93
|
-
$[22] = disabled;
|
|
94
|
-
$[23] = t7;
|
|
95
|
-
} else t7 = $[23];
|
|
96
|
-
const classes = t7;
|
|
97
|
-
const t8 = disabled ? void 0 : onMouseEnter;
|
|
98
|
-
let t9;
|
|
99
|
-
if ($[24] !== multiple) {
|
|
100
|
-
t9 = multiple ? /* @__PURE__ */ jsx(Icon, { type: Check }) : null;
|
|
101
|
-
$[24] = multiple;
|
|
102
|
-
$[25] = t9;
|
|
103
|
-
} else t9 = $[25];
|
|
104
|
-
let t10;
|
|
105
|
-
if ($[26] !== labelText || $[27] !== t9) {
|
|
106
|
-
t10 = /* @__PURE__ */ jsxs("span", { children: [labelText, t9] });
|
|
107
|
-
$[26] = labelText;
|
|
108
|
-
$[27] = t9;
|
|
109
|
-
$[28] = t10;
|
|
110
|
-
} else t10 = $[28];
|
|
111
|
-
let t11;
|
|
112
|
-
if ($[29] !== classes || $[30] !== disabled || $[31] !== handleSelect || $[32] !== rest || $[33] !== t10 || $[34] !== t8) {
|
|
113
|
-
t11 = /* @__PURE__ */ jsx("li", {
|
|
114
|
-
...rest,
|
|
115
|
-
className: classes,
|
|
116
|
-
onClick: handleSelect,
|
|
117
|
-
onMouseEnter: t8,
|
|
118
|
-
"aria-disabled": disabled,
|
|
119
|
-
children: t10
|
|
17
|
+
const handleSelect = (event) => {
|
|
18
|
+
if (disabled) return;
|
|
19
|
+
onSelect?.({
|
|
20
|
+
value,
|
|
21
|
+
label: typeof labelText === "string" || typeof labelText === "number" ? labelText : value
|
|
120
22
|
});
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
23
|
+
onClick?.(event);
|
|
24
|
+
};
|
|
25
|
+
const classes = clsx("k-select-item", {
|
|
26
|
+
"k-select-item-selected": checked,
|
|
27
|
+
"k-select-item-active": active,
|
|
28
|
+
"k-select-item-disabled": disabled
|
|
29
|
+
}, className);
|
|
30
|
+
return /* @__PURE__ */ jsx("li", {
|
|
31
|
+
...rest,
|
|
32
|
+
className: classes,
|
|
33
|
+
onClick: handleSelect,
|
|
34
|
+
onMouseEnter: disabled ? void 0 : onMouseEnter,
|
|
35
|
+
"aria-disabled": disabled,
|
|
36
|
+
children: /* @__PURE__ */ jsxs("span", { children: [labelText, multiple ? /* @__PURE__ */ jsx(Icon, { type: Check }) : null] })
|
|
37
|
+
});
|
|
130
38
|
};
|
|
131
|
-
//#endregion
|
|
132
39
|
export { Option as default };
|
package/es/select/select.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
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 {
|
|
10
|
-
import {
|
|
11
|
-
import Popup from "../popup/index.js";
|
|
9
|
+
import { renderSelectionTags } from "../utils/selection-tags.js";
|
|
10
|
+
import { useValue } from "../utils/use-value.js";
|
|
12
11
|
import { resolveTheme, useFormAppearance } from "../config/use-config-appearance.js";
|
|
12
|
+
import { createFormFieldComponent } from "../form/field-context.js";
|
|
13
13
|
import { ChevronDown, CircleX, Loading } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
14
|
+
import Popup from "../popup/index.js";
|
|
15
|
+
import { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
|
|
16
16
|
import Empty from "../empty/index.js";
|
|
17
|
-
import
|
|
17
|
+
import Icon from "../icon/index.js";
|
|
18
18
|
import { isEmpty } from "../utils/number.js";
|
|
19
|
+
import { getChildren } from "../utils/react-node.js";
|
|
19
20
|
import Option from "./option.js";
|
|
20
|
-
import { renderSelectionTags } from "../utils/selection-tags.js";
|
|
21
21
|
import VirtualList from "../virtual-list/index.js";
|
|
22
22
|
import clsx from "clsx";
|
|
23
23
|
import React, { useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
24
24
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
-
|
|
25
|
+
// components/select/select.tsx
|
|
26
26
|
var normalizeValue = (value) => {
|
|
27
27
|
if (Array.isArray(value)) return value;
|
|
28
28
|
if (isEmpty(value)) return [];
|
|
@@ -513,5 +513,4 @@ var Select = ({ placeholder, size: sizeProp, placement = "bottom-left", destroyO
|
|
|
513
513
|
});
|
|
514
514
|
};
|
|
515
515
|
var select_default = createFormFieldComponent(Select);
|
|
516
|
-
//#endregion
|
|
517
516
|
export { select_default 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
|
|
@@ -11,7 +11,7 @@ import { useSkeletonLoading } from "./use-skeleton-loading.js";
|
|
|
11
11
|
import clsx from "clsx";
|
|
12
12
|
import "react";
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
|
|
14
|
+
// components/skeleton/skeleton-avatar.tsx
|
|
15
15
|
var SkeletonAvatar = ({ animated = false, radius, loading = false, delay = 500, shape: shapeProp, size: sizeProp, children, className = "", ...rest }) => {
|
|
16
16
|
const inheritedAppearance = useConfigAppearance();
|
|
17
17
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
@@ -40,5 +40,4 @@ var SkeletonAvatar = ({ animated = false, radius, loading = false, delay = 500,
|
|
|
40
40
|
})
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
|
-
//#endregion
|
|
44
43
|
export { SkeletonAvatar 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
|
|
@@ -11,7 +11,7 @@ import { useSkeletonLoading } from "./use-skeleton-loading.js";
|
|
|
11
11
|
import clsx from "clsx";
|
|
12
12
|
import "react";
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
|
|
14
|
+
// components/skeleton/skeleton-button.tsx
|
|
15
15
|
var SkeletonButton = ({ animated = false, loading = false, delay = 500, block = false, width, size: sizeProp, shape: shapeProp, children, className = "", ...rest }) => {
|
|
16
16
|
const inheritedAppearance = useConfigAppearance();
|
|
17
17
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
@@ -39,5 +39,4 @@ var SkeletonButton = ({ animated = false, loading = false, delay = 500, block =
|
|
|
39
39
|
})
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
|
-
//#endregion
|
|
43
42
|
export { SkeletonButton 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
|
|
@@ -9,95 +9,35 @@
|
|
|
9
9
|
import { Images } 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
11
|
import { useSkeletonLoading } from "./use-skeleton-loading.js";
|
|
12
|
-
import { c } from "react/compiler-runtime";
|
|
13
12
|
import clsx from "clsx";
|
|
14
13
|
import "react";
|
|
15
14
|
import { jsx } from "react/jsx-runtime";
|
|
16
|
-
|
|
17
|
-
var SkeletonImage = (
|
|
18
|
-
const $ = c(29);
|
|
19
|
-
let children;
|
|
20
|
-
let radius;
|
|
21
|
-
let rest;
|
|
22
|
-
let size;
|
|
23
|
-
let t1;
|
|
24
|
-
let t2;
|
|
25
|
-
let t3;
|
|
26
|
-
let t4;
|
|
27
|
-
if ($[0] !== t0) {
|
|
28
|
-
({animated: t1, loading: t2, delay: t3, radius, size, children, className: t4, ...rest} = t0);
|
|
29
|
-
$[0] = t0;
|
|
30
|
-
$[1] = children;
|
|
31
|
-
$[2] = radius;
|
|
32
|
-
$[3] = rest;
|
|
33
|
-
$[4] = size;
|
|
34
|
-
$[5] = t1;
|
|
35
|
-
$[6] = t2;
|
|
36
|
-
$[7] = t3;
|
|
37
|
-
$[8] = t4;
|
|
38
|
-
} else {
|
|
39
|
-
children = $[1];
|
|
40
|
-
radius = $[2];
|
|
41
|
-
rest = $[3];
|
|
42
|
-
size = $[4];
|
|
43
|
-
t1 = $[5];
|
|
44
|
-
t2 = $[6];
|
|
45
|
-
t3 = $[7];
|
|
46
|
-
t4 = $[8];
|
|
47
|
-
}
|
|
48
|
-
const animated = t1 === void 0 ? false : t1;
|
|
49
|
-
const loading = t2 === void 0 ? false : t2;
|
|
50
|
-
const delay = t3 === void 0 ? 500 : t3;
|
|
51
|
-
const className = t4 === void 0 ? "" : t4;
|
|
15
|
+
// components/skeleton/skeleton-image.tsx
|
|
16
|
+
var SkeletonImage = ({ animated = false, loading = false, delay = 500, radius, size, children, className = "", ...rest }) => {
|
|
52
17
|
const show = useSkeletonLoading(loading, delay);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
$[15] = size[0];
|
|
77
|
-
$[16] = t6;
|
|
78
|
-
} else t6 = $[16];
|
|
79
|
-
const width = t6;
|
|
80
|
-
let t7;
|
|
81
|
-
if ($[17] !== size[1] || $[18] !== width) {
|
|
82
|
-
t7 = Number.isFinite(size[1]) ? Math.max(0, size[1]) : width;
|
|
83
|
-
$[17] = size[1];
|
|
84
|
-
$[18] = width;
|
|
85
|
-
$[19] = t7;
|
|
86
|
-
} else t7 = $[19];
|
|
87
|
-
const height = t7;
|
|
88
|
-
innerStyle.width = `${width}px`;
|
|
89
|
-
innerStyle.height = `${height}px`;
|
|
90
|
-
innerStyle.minWidth = `${width}px`;
|
|
91
|
-
innerStyle.minHeight = `${height}px`;
|
|
92
|
-
}
|
|
93
|
-
$[12] = radius;
|
|
94
|
-
$[13] = size;
|
|
95
|
-
$[14] = innerStyle;
|
|
96
|
-
} else innerStyle = $[14];
|
|
97
|
-
const t6 = loading || void 0;
|
|
98
|
-
let t7;
|
|
99
|
-
if ($[20] !== children || $[21] !== innerStyle || $[22] !== show) {
|
|
100
|
-
t7 = children != null && !show ? children : /* @__PURE__ */ jsx("span", {
|
|
18
|
+
const wrapperClasses = clsx("k-skeleton k-skeleton-ele", { "k-skeleton-animated": animated }, className);
|
|
19
|
+
const innerStyle = {};
|
|
20
|
+
if (radius !== void 0) innerStyle.borderRadius = `${radius}px`;
|
|
21
|
+
if (typeof size === "number" && Number.isFinite(size)) {
|
|
22
|
+
const value = Math.max(0, size);
|
|
23
|
+
innerStyle.width = `${value}px`;
|
|
24
|
+
innerStyle.height = `${value}px`;
|
|
25
|
+
innerStyle.minWidth = `${value}px`;
|
|
26
|
+
innerStyle.minHeight = `${value}px`;
|
|
27
|
+
}
|
|
28
|
+
if (Array.isArray(size)) {
|
|
29
|
+
const width = Number.isFinite(size[0]) ? Math.max(0, size[0]) : 96;
|
|
30
|
+
const height = Number.isFinite(size[1]) ? Math.max(0, size[1]) : width;
|
|
31
|
+
innerStyle.width = `${width}px`;
|
|
32
|
+
innerStyle.height = `${height}px`;
|
|
33
|
+
innerStyle.minWidth = `${width}px`;
|
|
34
|
+
innerStyle.minHeight = `${height}px`;
|
|
35
|
+
}
|
|
36
|
+
return /* @__PURE__ */ jsx("div", {
|
|
37
|
+
className: wrapperClasses,
|
|
38
|
+
...rest,
|
|
39
|
+
"aria-busy": loading || void 0,
|
|
40
|
+
children: children != null && !show ? children : /* @__PURE__ */ jsx("span", {
|
|
101
41
|
className: "k-skeleton-image",
|
|
102
42
|
style: innerStyle,
|
|
103
43
|
"aria-hidden": "true",
|
|
@@ -105,27 +45,7 @@ var SkeletonImage = (t0) => {
|
|
|
105
45
|
type: Images,
|
|
106
46
|
className: "k-skeleton-image-icon"
|
|
107
47
|
})
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
$[21] = innerStyle;
|
|
111
|
-
$[22] = show;
|
|
112
|
-
$[23] = t7;
|
|
113
|
-
} else t7 = $[23];
|
|
114
|
-
let t8;
|
|
115
|
-
if ($[24] !== rest || $[25] !== t6 || $[26] !== t7 || $[27] !== wrapperClasses) {
|
|
116
|
-
t8 = /* @__PURE__ */ jsx("div", {
|
|
117
|
-
className: wrapperClasses,
|
|
118
|
-
...rest,
|
|
119
|
-
"aria-busy": t6,
|
|
120
|
-
children: t7
|
|
121
|
-
});
|
|
122
|
-
$[24] = rest;
|
|
123
|
-
$[25] = t6;
|
|
124
|
-
$[26] = t7;
|
|
125
|
-
$[27] = wrapperClasses;
|
|
126
|
-
$[28] = t8;
|
|
127
|
-
} else t8 = $[28];
|
|
128
|
-
return t8;
|
|
48
|
+
})
|
|
49
|
+
});
|
|
129
50
|
};
|
|
130
|
-
//#endregion
|
|
131
51
|
export { SkeletonImage 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
|
|
@@ -8,106 +8,30 @@
|
|
|
8
8
|
|
|
9
9
|
import { useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import { useSkeletonLoading } from "./use-skeleton-loading.js";
|
|
11
|
-
import { c } from "react/compiler-runtime";
|
|
12
11
|
import clsx from "clsx";
|
|
13
12
|
import "react";
|
|
14
13
|
import { jsx } from "react/jsx-runtime";
|
|
15
|
-
|
|
16
|
-
var SkeletonText = (
|
|
17
|
-
const $ = c(27);
|
|
18
|
-
let children;
|
|
19
|
-
let rest;
|
|
20
|
-
let sizeProp;
|
|
21
|
-
let t1;
|
|
22
|
-
let t2;
|
|
23
|
-
let t3;
|
|
24
|
-
let t4;
|
|
25
|
-
let width;
|
|
26
|
-
if ($[0] !== t0) {
|
|
27
|
-
({animated: t1, loading: t2, delay: t3, width, size: sizeProp, children, className: t4, ...rest} = t0);
|
|
28
|
-
$[0] = t0;
|
|
29
|
-
$[1] = children;
|
|
30
|
-
$[2] = rest;
|
|
31
|
-
$[3] = sizeProp;
|
|
32
|
-
$[4] = t1;
|
|
33
|
-
$[5] = t2;
|
|
34
|
-
$[6] = t3;
|
|
35
|
-
$[7] = t4;
|
|
36
|
-
$[8] = width;
|
|
37
|
-
} else {
|
|
38
|
-
children = $[1];
|
|
39
|
-
rest = $[2];
|
|
40
|
-
sizeProp = $[3];
|
|
41
|
-
t1 = $[4];
|
|
42
|
-
t2 = $[5];
|
|
43
|
-
t3 = $[6];
|
|
44
|
-
t4 = $[7];
|
|
45
|
-
width = $[8];
|
|
46
|
-
}
|
|
47
|
-
const animated = t1 === void 0 ? false : t1;
|
|
48
|
-
const loading = t2 === void 0 ? false : t2;
|
|
49
|
-
const delay = t3 === void 0 ? 500 : t3;
|
|
50
|
-
const className = t4 === void 0 ? "" : t4;
|
|
14
|
+
// components/skeleton/skeleton-text.tsx
|
|
15
|
+
var SkeletonText = ({ animated = false, loading = false, delay = 500, width, size: sizeProp, children, className = "", ...rest }) => {
|
|
51
16
|
const inheritedAppearance = useConfigAppearance();
|
|
52
17
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
53
18
|
const show = useSkeletonLoading(loading, delay);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
$[12] = width;
|
|
67
|
-
$[13] = innerStyle;
|
|
68
|
-
} else innerStyle = $[13];
|
|
69
|
-
const t6 = size === "large";
|
|
70
|
-
const t7 = size === "small";
|
|
71
|
-
let t8;
|
|
72
|
-
if ($[14] !== t6 || $[15] !== t7) {
|
|
73
|
-
t8 = clsx("k-skeleton-text", {
|
|
74
|
-
"k-skeleton-text-lg": t6,
|
|
75
|
-
"k-skeleton-text-sm": t7
|
|
76
|
-
});
|
|
77
|
-
$[14] = t6;
|
|
78
|
-
$[15] = t7;
|
|
79
|
-
$[16] = t8;
|
|
80
|
-
} else t8 = $[16];
|
|
81
|
-
const innerClasses = t8;
|
|
82
|
-
const t9 = loading || void 0;
|
|
83
|
-
let t10;
|
|
84
|
-
if ($[17] !== children || $[18] !== innerClasses || $[19] !== innerStyle || $[20] !== show) {
|
|
85
|
-
t10 = children != null && !show ? children : /* @__PURE__ */ jsx("span", {
|
|
19
|
+
const wrapperClasses = clsx("k-skeleton k-skeleton-ele", { "k-skeleton-animated": animated }, className);
|
|
20
|
+
const innerStyle = {};
|
|
21
|
+
if (width !== void 0) innerStyle.width = `${width}px`;
|
|
22
|
+
const innerClasses = clsx("k-skeleton-text", {
|
|
23
|
+
"k-skeleton-text-lg": size === "large",
|
|
24
|
+
"k-skeleton-text-sm": size === "small"
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: wrapperClasses,
|
|
28
|
+
...rest,
|
|
29
|
+
"aria-busy": loading || void 0,
|
|
30
|
+
children: children != null && !show ? children : /* @__PURE__ */ jsx("span", {
|
|
86
31
|
className: innerClasses,
|
|
87
32
|
style: innerStyle,
|
|
88
33
|
"aria-hidden": "true"
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
$[18] = innerClasses;
|
|
92
|
-
$[19] = innerStyle;
|
|
93
|
-
$[20] = show;
|
|
94
|
-
$[21] = t10;
|
|
95
|
-
} else t10 = $[21];
|
|
96
|
-
let t11;
|
|
97
|
-
if ($[22] !== rest || $[23] !== t10 || $[24] !== t9 || $[25] !== wrapperClasses) {
|
|
98
|
-
t11 = /* @__PURE__ */ jsx("div", {
|
|
99
|
-
className: wrapperClasses,
|
|
100
|
-
...rest,
|
|
101
|
-
"aria-busy": t9,
|
|
102
|
-
children: t10
|
|
103
|
-
});
|
|
104
|
-
$[22] = rest;
|
|
105
|
-
$[23] = t10;
|
|
106
|
-
$[24] = t9;
|
|
107
|
-
$[25] = wrapperClasses;
|
|
108
|
-
$[26] = t11;
|
|
109
|
-
} else t11 = $[26];
|
|
110
|
-
return t11;
|
|
34
|
+
})
|
|
35
|
+
});
|
|
111
36
|
};
|
|
112
|
-
//#endregion
|
|
113
37
|
export { SkeletonText as default };
|