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/upload/file-list.js
CHANGED
|
@@ -1,37 +1,25 @@
|
|
|
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 { startPictureSort } from "./picture-sort.js";
|
|
9
10
|
import { CircleCheck, CircleX, FileText, Info, RotateCcw, X } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
10
|
-
import Icon from "../icon/index.js";
|
|
11
11
|
import Button from "../button/button.js";
|
|
12
|
-
import
|
|
12
|
+
import Icon from "../icon/index.js";
|
|
13
13
|
import KImage from "../image/image.js";
|
|
14
14
|
import Progress from "../progress/index.js";
|
|
15
|
-
import
|
|
16
|
-
import { c } from "react/compiler-runtime";
|
|
15
|
+
import Tooltip from "../tooltip/index.js";
|
|
17
16
|
import clsx from "clsx";
|
|
18
17
|
import { useEffect, useRef } from "react";
|
|
19
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
-
|
|
21
|
-
function FileList(
|
|
22
|
-
const $ = c(5);
|
|
23
|
-
const { showUploadList: t1, locale, type: t2, fileList: t3, disabled, readOnly, selector, onRemove, sortable, preview: t4, onSort, onAbort, onRetry } = t0;
|
|
24
|
-
const showUploadList = t1 === void 0 ? true : t1;
|
|
25
|
-
const type = t2 === void 0 ? "list" : t2;
|
|
26
|
-
const fileList = t3 === void 0 ? [] : t3;
|
|
27
|
-
const previewEnabled = t4 === void 0 ? true : t4;
|
|
19
|
+
// components/upload/file-list.tsx
|
|
20
|
+
function FileList({ showUploadList = true, locale, type = "list", fileList = [], disabled, readOnly, selector, onRemove, sortable, preview: previewEnabled = true, onSort, onAbort, onRetry }) {
|
|
28
21
|
const cancelSort = useRef(void 0);
|
|
29
|
-
|
|
30
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
-
t5 = () => () => cancelSort.current?.();
|
|
32
|
-
$[0] = t5;
|
|
33
|
-
} else t5 = $[0];
|
|
34
|
-
useEffect(t5, [
|
|
22
|
+
useEffect(() => () => cancelSort.current?.(), [
|
|
35
23
|
fileList,
|
|
36
24
|
sortable,
|
|
37
25
|
disabled,
|
|
@@ -39,107 +27,95 @@ function FileList(t0) {
|
|
|
39
27
|
]);
|
|
40
28
|
const picture = type === "picture";
|
|
41
29
|
if (!showUploadList && !picture) return null;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
31
|
+
className: `k-upload-${picture ? "picture" : "file"}-list`,
|
|
32
|
+
children: [fileList.map((item, index) => {
|
|
33
|
+
const statusText = item.status === "success" ? locale?.k.upload.successful : item.errorText || locale?.k.upload.failed;
|
|
34
|
+
const source = item.preview || item.url;
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: clsx(`k-upload-file-${type}-item`, `k-upload-file-status-${item.status}`),
|
|
37
|
+
"data-sortable": picture && sortable && !disabled && !readOnly || void 0,
|
|
38
|
+
onDragStart: (event) => {
|
|
39
|
+
if (picture && sortable) event.preventDefault();
|
|
40
|
+
},
|
|
41
|
+
onPointerDown: (event_0) => {
|
|
42
|
+
if (!picture || !sortable || disabled || readOnly) return;
|
|
43
|
+
cancelSort.current?.();
|
|
44
|
+
cancelSort.current = startPictureSort(event_0.nativeEvent, event_0.currentTarget, (from, to) => onSort?.(from, to));
|
|
45
|
+
},
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: `k-upload-${picture ? "picture" : "file"}-preview`,
|
|
49
|
+
children: source ? previewEnabled ? /* @__PURE__ */ jsx(KImage, {
|
|
50
|
+
src: source,
|
|
51
|
+
width: "100%",
|
|
52
|
+
height: "100%",
|
|
53
|
+
shape: "square"
|
|
54
|
+
}) : /* @__PURE__ */ jsx("img", {
|
|
55
|
+
src: source,
|
|
56
|
+
alt: ""
|
|
57
|
+
}) : /* @__PURE__ */ jsx(Icon, {
|
|
58
|
+
type: FileText,
|
|
59
|
+
strokeWidth: 1,
|
|
60
|
+
size: 30
|
|
61
|
+
})
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ jsxs("div", {
|
|
64
|
+
className: "k-upload-file-item-info",
|
|
65
|
+
children: [!picture && /* @__PURE__ */ jsxs("div", {
|
|
66
|
+
className: "k-upload-file-main",
|
|
67
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
68
|
+
className: "k-upload-file-name",
|
|
69
|
+
children: item.filename
|
|
70
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
71
|
+
className: "k-upload-file-size",
|
|
72
|
+
children: item.size
|
|
73
|
+
})]
|
|
74
|
+
}), item.status !== "waiting" && /* @__PURE__ */ jsx("div", {
|
|
75
|
+
className: "k-upload-file-status",
|
|
76
|
+
children: item.status === "uploading" ? /* @__PURE__ */ jsx(Progress, {
|
|
77
|
+
percent: item.percent,
|
|
78
|
+
type: picture ? "circle" : "line",
|
|
79
|
+
size: "small",
|
|
80
|
+
showInfo: false,
|
|
81
|
+
status: "active",
|
|
82
|
+
strokeWidth: 15
|
|
83
|
+
}) : statusText && !picture ? /* @__PURE__ */ jsxs("div", {
|
|
84
|
+
className: "k-upload-file-status-text",
|
|
85
|
+
children: [/* @__PURE__ */ jsx(Icon, { type: item.status === "success" ? CircleCheck : CircleX }), statusText]
|
|
86
|
+
}) : picture && item.status === "error" ? /* @__PURE__ */ jsx(Tooltip, {
|
|
87
|
+
title: statusText,
|
|
88
|
+
placement: "bottom",
|
|
89
|
+
children: /* @__PURE__ */ jsx(Icon, { type: Info })
|
|
90
|
+
}) : null
|
|
84
91
|
})]
|
|
85
|
-
}),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
type: "text",
|
|
113
|
-
size: "small",
|
|
114
|
-
icon: RotateCcw,
|
|
115
|
-
title: "Retry upload",
|
|
116
|
-
disabled,
|
|
117
|
-
onClick: () => onRetry?.(item)
|
|
118
|
-
}) : null),
|
|
119
|
-
!readOnly && /* @__PURE__ */ jsx(Button, {
|
|
120
|
-
type: "text",
|
|
121
|
-
size: "small",
|
|
122
|
-
icon: X,
|
|
123
|
-
disabled,
|
|
124
|
-
className: `k-upload-file-${picture ? "picture" : "item"}-remove`,
|
|
125
|
-
onClick: () => onRemove?.(index, item)
|
|
126
|
-
})
|
|
127
|
-
]
|
|
128
|
-
}, item.uid ?? index);
|
|
92
|
+
}),
|
|
93
|
+
!readOnly && (item.status === "uploading" ? /* @__PURE__ */ jsx(Button, {
|
|
94
|
+
type: "text",
|
|
95
|
+
size: "small",
|
|
96
|
+
icon: X,
|
|
97
|
+
title: "Cancel upload",
|
|
98
|
+
disabled,
|
|
99
|
+
onClick: () => onAbort?.(item)
|
|
100
|
+
}) : item.status === "error" ? /* @__PURE__ */ jsx(Button, {
|
|
101
|
+
type: "text",
|
|
102
|
+
size: "small",
|
|
103
|
+
icon: RotateCcw,
|
|
104
|
+
title: "Retry upload",
|
|
105
|
+
disabled,
|
|
106
|
+
onClick: () => onRetry?.(item)
|
|
107
|
+
}) : null),
|
|
108
|
+
!readOnly && /* @__PURE__ */ jsx(Button, {
|
|
109
|
+
type: "text",
|
|
110
|
+
size: "small",
|
|
111
|
+
icon: X,
|
|
112
|
+
disabled,
|
|
113
|
+
className: `k-upload-file-${picture ? "picture" : "item"}-remove`,
|
|
114
|
+
onClick: () => onRemove?.(index, item)
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
}, item.uid ?? index);
|
|
118
|
+
}), picture && selector]
|
|
129
119
|
});
|
|
130
|
-
const t8 = picture && selector;
|
|
131
|
-
let t9;
|
|
132
|
-
if ($[1] !== t6 || $[2] !== t7 || $[3] !== t8) {
|
|
133
|
-
t9 = /* @__PURE__ */ jsxs("div", {
|
|
134
|
-
className: t6,
|
|
135
|
-
children: [t7, t8]
|
|
136
|
-
});
|
|
137
|
-
$[1] = t6;
|
|
138
|
-
$[2] = t7;
|
|
139
|
-
$[3] = t8;
|
|
140
|
-
$[4] = t9;
|
|
141
|
-
} else t9 = $[4];
|
|
142
|
-
return t9;
|
|
143
120
|
}
|
|
144
|
-
//#endregion
|
|
145
121
|
export { FileList as default };
|
package/es/upload/index.js
CHANGED
|
@@ -1,23 +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 { createFormFieldComponent } from "../form/field-context.js";
|
|
10
|
+
import { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
|
|
11
11
|
import FileList from "./file-list.js";
|
|
12
12
|
import Selector from "./selector.js";
|
|
13
13
|
import clsx from "clsx";
|
|
14
14
|
import { forwardRef, useContext, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
15
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
|
|
16
|
+
// components/upload/index.tsx
|
|
17
17
|
var uploadUid = 0;
|
|
18
18
|
var createUploadUid = () => globalThis.crypto?.randomUUID?.() ?? `k-upload-${Date.now().toString(36)}-${uploadUid++}`;
|
|
19
19
|
var formatSize = (size) => size < 1024 ? `${size}B` : size < 1024 ** 2 ? `${(size / 1024).toFixed(2)}KB` : size < 1024 ** 3 ? `${(size / 1024 ** 2).toFixed(2)}MB` : `${(size / 1024 ** 3).toFixed(2)}GB`;
|
|
20
|
-
var Upload = forwardRef(function Upload({ method = "post", name = "file", action, type = "list", data = {}, disabled, readOnly, directory, multiple, accept, headers, withCredentials = false, timeout = 0, customRequest, parseResponse, showUploadList = true, transformFile, fileList, autoTrigger = true, limit, minSize, maxSize, uploadText, uploadSubText, uploadIcon, draggable, sortable, preview = true, validateAccept = true, maxConcurrent = Infinity, onChange, onRemove, onSelectFiles, onExceed, onSizeError, onTypeError, onSort, onBeforeUpload, className, children, ...rest }, ref) {
|
|
20
|
+
var Upload = forwardRef(function Upload({ method = "post", name = "file", action, type = "list", data = {}, disabled, readOnly, directory, multiple, accept, headers, withCredentials = false, timeout = 0, customRequest, parseResponse, showUploadList = true, transformFile, fileList, autoTrigger = true, limit, minSize, maxSize, uploadText, uploadSubText, uploadIcon, draggable, sortable, preview: preview_0 = true, validateAccept = true, maxConcurrent = Infinity, onChange, onRemove, onSelectFiles, onExceed, onSizeError, onTypeError, onSort, onBeforeUpload, className, children, ...rest }, ref) {
|
|
21
21
|
const { locale } = useContext(ConfigContext);
|
|
22
22
|
const messages = locale ?? DEFAULT_LOCALE;
|
|
23
23
|
const [files, setFiles] = useState(fileList ?? []);
|
|
@@ -243,15 +243,15 @@ var Upload = forwardRef(function Upload({ method = "post", name = "file", action
|
|
|
243
243
|
exceeded = true;
|
|
244
244
|
continue;
|
|
245
245
|
}
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
246
|
+
const preview = file_2.type.startsWith("image/") || /\.(png|jpe?g|gif|webp|bmp|ico|svg|avif|apng)$/i.test(file_2.name) ? URL.createObjectURL(file_2) : null;
|
|
247
|
+
if (preview) generatedPreviewUrlsRef.current.add(preview);
|
|
248
248
|
const item_9 = {
|
|
249
249
|
uid: createUploadUid(),
|
|
250
250
|
filename: file_2.name,
|
|
251
251
|
size: formatSize(file_2.size),
|
|
252
252
|
status: "waiting",
|
|
253
253
|
percent: 0,
|
|
254
|
-
preview
|
|
254
|
+
preview
|
|
255
255
|
};
|
|
256
256
|
const acceptedType = !accept || !validateAccept || accept.split(",").some((rule) => {
|
|
257
257
|
const value_2 = rule.trim().toLowerCase();
|
|
@@ -414,7 +414,7 @@ var Upload = forwardRef(function Upload({ method = "post", name = "file", action
|
|
|
414
414
|
locale: messages,
|
|
415
415
|
onRemove: remove,
|
|
416
416
|
sortable: sortable && type === "picture",
|
|
417
|
-
preview,
|
|
417
|
+
preview: preview_0,
|
|
418
418
|
onSort: sort,
|
|
419
419
|
onAbort: abort,
|
|
420
420
|
onRetry: retry,
|
|
@@ -429,5 +429,4 @@ var upload_default = createFormFieldComponent(Upload, {
|
|
|
429
429
|
getChangeValue: (event) => event.fileList,
|
|
430
430
|
inherit: ["disabled", "readOnly"]
|
|
431
431
|
});
|
|
432
|
-
//#endregion
|
|
433
432
|
export { upload_default as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
6
6
|
* Author: Qiu / https://chuchur.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// components/upload/picture-sort.ts
|
|
10
10
|
/** Preview a reorder with transforms; commit data only after the card settles. */
|
|
11
11
|
function startPictureSort(event, card, onSort) {
|
|
12
12
|
const parent = card.parentElement;
|
|
@@ -138,5 +138,4 @@ function startPictureSort(event, card, onSort) {
|
|
|
138
138
|
window.addEventListener("resize", cancel);
|
|
139
139
|
return cleanup;
|
|
140
140
|
}
|
|
141
|
-
//#endregion
|
|
142
141
|
export { startPictureSort };
|
package/es/upload/selector.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,205 +8,75 @@
|
|
|
8
8
|
|
|
9
9
|
import { Plus } 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 { useRef, useState } from "react";
|
|
14
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
|
|
16
|
-
function Selector(
|
|
17
|
-
const $ = c(58);
|
|
18
|
-
const { disabled, name: t1, accept, multiple, directory, limit, uploadText, uploadSubText, draggable, locale, fileList: t2, uploadIcon, type: t3, onSelect, children } = t0;
|
|
19
|
-
const name = t1 === void 0 ? "file" : t1;
|
|
20
|
-
const fileList = t2 === void 0 ? [] : t2;
|
|
21
|
-
const type = t3 === void 0 ? "list" : t3;
|
|
14
|
+
// components/upload/selector.tsx
|
|
15
|
+
function Selector({ disabled, name = "file", accept, multiple, directory, limit, uploadText, uploadSubText, draggable, locale, fileList = [], uploadIcon, type = "list", onSelect, children }) {
|
|
22
16
|
const [dragOver, setDragOver] = useState(false);
|
|
23
17
|
if (disabled && dragOver) setDragOver(false);
|
|
24
18
|
const inputRef = useRef(null);
|
|
25
|
-
|
|
26
|
-
if ($[0] !== directory) {
|
|
27
|
-
t4 = directory ? { webkitdirectory: "" } : {};
|
|
28
|
-
$[0] = directory;
|
|
29
|
-
$[1] = t4;
|
|
30
|
-
} else t4 = $[1];
|
|
31
|
-
const directoryProps = t4;
|
|
19
|
+
const directoryProps = directory ? { webkitdirectory: "" } : {};
|
|
32
20
|
const normalizedLimit = limit != null && limit >= 0 ? Math.floor(limit) : void 0;
|
|
33
21
|
if (type === "picture" && normalizedLimit !== void 0 && fileList.length >= normalizedLimit) return null;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if ($[16] !== disabled || $[17] !== draggable) {
|
|
94
|
-
t14 = draggable && !disabled ? (event_2) => {
|
|
95
|
-
event_2.preventDefault();
|
|
96
|
-
setDragOver(true);
|
|
97
|
-
} : void 0;
|
|
98
|
-
$[16] = disabled;
|
|
99
|
-
$[17] = draggable;
|
|
100
|
-
$[18] = t14;
|
|
101
|
-
} else t14 = $[18];
|
|
102
|
-
let t15;
|
|
103
|
-
if ($[19] !== draggable) {
|
|
104
|
-
t15 = draggable ? () => setDragOver(false) : void 0;
|
|
105
|
-
$[19] = draggable;
|
|
106
|
-
$[20] = t15;
|
|
107
|
-
} else t15 = $[20];
|
|
108
|
-
const t16 = draggable && !disabled ? drop : void 0;
|
|
109
|
-
let t17;
|
|
110
|
-
if ($[21] !== select) {
|
|
111
|
-
t17 = (event_3) => {
|
|
112
|
-
select(event_3.target.files);
|
|
113
|
-
event_3.target.value = "";
|
|
114
|
-
};
|
|
115
|
-
$[21] = select;
|
|
116
|
-
$[22] = t17;
|
|
117
|
-
} else t17 = $[22];
|
|
118
|
-
let t18;
|
|
119
|
-
if ($[23] !== accept || $[24] !== directoryProps || $[25] !== disabled || $[26] !== multiple || $[27] !== name || $[28] !== t17) {
|
|
120
|
-
t18 = /* @__PURE__ */ jsx("input", {
|
|
121
|
-
ref: inputRef,
|
|
122
|
-
type: "file",
|
|
123
|
-
className: "k-upload-file",
|
|
124
|
-
name,
|
|
125
|
-
accept,
|
|
126
|
-
disabled,
|
|
127
|
-
multiple,
|
|
128
|
-
...directoryProps,
|
|
129
|
-
onChange: t17
|
|
130
|
-
});
|
|
131
|
-
$[23] = accept;
|
|
132
|
-
$[24] = directoryProps;
|
|
133
|
-
$[25] = disabled;
|
|
134
|
-
$[26] = multiple;
|
|
135
|
-
$[27] = name;
|
|
136
|
-
$[28] = t17;
|
|
137
|
-
$[29] = t18;
|
|
138
|
-
} else t18 = $[29];
|
|
139
|
-
let t19;
|
|
140
|
-
if ($[30] !== children || $[31] !== draggable || $[32] !== type || $[33] !== uploadIcon) {
|
|
141
|
-
t19 = type === "picture" || draggable ? /* @__PURE__ */ jsx(Icon, { type: uploadIcon ?? Plus }) : children;
|
|
142
|
-
$[30] = children;
|
|
143
|
-
$[31] = draggable;
|
|
144
|
-
$[32] = type;
|
|
145
|
-
$[33] = uploadIcon;
|
|
146
|
-
$[34] = t19;
|
|
147
|
-
} else t19 = $[34];
|
|
148
|
-
let t20;
|
|
149
|
-
if ($[35] !== draggable || $[36] !== type || $[37] !== uploadText) {
|
|
150
|
-
t20 = (type === "picture" || draggable && uploadText) && /* @__PURE__ */ jsx("span", {
|
|
151
|
-
className: "k-upload-text",
|
|
152
|
-
children: uploadText
|
|
153
|
-
});
|
|
154
|
-
$[35] = draggable;
|
|
155
|
-
$[36] = type;
|
|
156
|
-
$[37] = uploadText;
|
|
157
|
-
$[38] = t20;
|
|
158
|
-
} else t20 = $[38];
|
|
159
|
-
let t21;
|
|
160
|
-
if ($[39] !== dragOver || $[40] !== draggable || $[41] !== locale?.k || $[42] !== uploadSubText) {
|
|
161
|
-
t21 = draggable && uploadSubText && /* @__PURE__ */ jsx("span", {
|
|
162
|
-
className: "k-upload-sub-text",
|
|
163
|
-
children: dragOver ? locale?.k.upload.releaseToUpload : uploadSubText
|
|
164
|
-
});
|
|
165
|
-
$[39] = dragOver;
|
|
166
|
-
$[40] = draggable;
|
|
167
|
-
$[41] = locale?.k;
|
|
168
|
-
$[42] = uploadSubText;
|
|
169
|
-
$[43] = t21;
|
|
170
|
-
} else t21 = $[43];
|
|
171
|
-
let t22;
|
|
172
|
-
if ($[44] !== t10 || $[45] !== t11 || $[46] !== t12 || $[47] !== t13 || $[48] !== t14 || $[49] !== t15 || $[50] !== t16 || $[51] !== t18 || $[52] !== t19 || $[53] !== t20 || $[54] !== t21 || $[55] !== t8 || $[56] !== t9) {
|
|
173
|
-
t22 = /* @__PURE__ */ jsx("div", {
|
|
174
|
-
className: "k-upload-select",
|
|
175
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
176
|
-
className: t8,
|
|
177
|
-
role: "button",
|
|
178
|
-
tabIndex: t9,
|
|
179
|
-
"aria-disabled": t10,
|
|
180
|
-
onClick: t11,
|
|
181
|
-
onKeyDown: t12,
|
|
182
|
-
onDragEnter: t13,
|
|
183
|
-
onDragOver: t14,
|
|
184
|
-
onDragLeave: t15,
|
|
185
|
-
onDrop: t16,
|
|
186
|
-
children: [
|
|
187
|
-
t18,
|
|
188
|
-
t19,
|
|
189
|
-
t20,
|
|
190
|
-
t21
|
|
191
|
-
]
|
|
192
|
-
})
|
|
193
|
-
});
|
|
194
|
-
$[44] = t10;
|
|
195
|
-
$[45] = t11;
|
|
196
|
-
$[46] = t12;
|
|
197
|
-
$[47] = t13;
|
|
198
|
-
$[48] = t14;
|
|
199
|
-
$[49] = t15;
|
|
200
|
-
$[50] = t16;
|
|
201
|
-
$[51] = t18;
|
|
202
|
-
$[52] = t19;
|
|
203
|
-
$[53] = t20;
|
|
204
|
-
$[54] = t21;
|
|
205
|
-
$[55] = t8;
|
|
206
|
-
$[56] = t9;
|
|
207
|
-
$[57] = t22;
|
|
208
|
-
} else t22 = $[57];
|
|
209
|
-
return t22;
|
|
22
|
+
const select = (files) => {
|
|
23
|
+
if (!disabled && files?.length) onSelect?.(files);
|
|
24
|
+
setDragOver(false);
|
|
25
|
+
};
|
|
26
|
+
const drop = (event) => {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
if (!disabled) select(event.dataTransfer.files);
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: "k-upload-select",
|
|
32
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: clsx("k-upload-add", { "k-upload-drag-over": dragOver && !disabled }),
|
|
34
|
+
role: "button",
|
|
35
|
+
tabIndex: disabled ? -1 : 0,
|
|
36
|
+
"aria-disabled": disabled || void 0,
|
|
37
|
+
onClick: () => !disabled && inputRef.current?.click(),
|
|
38
|
+
onKeyDown: (event_0) => {
|
|
39
|
+
if (event_0.key === "Enter" || event_0.key === " ") {
|
|
40
|
+
event_0.preventDefault();
|
|
41
|
+
if (!disabled) inputRef.current?.click();
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
onDragEnter: draggable && !disabled ? (event_1) => {
|
|
45
|
+
event_1.preventDefault();
|
|
46
|
+
setDragOver(true);
|
|
47
|
+
} : void 0,
|
|
48
|
+
onDragOver: draggable && !disabled ? (event_2) => {
|
|
49
|
+
event_2.preventDefault();
|
|
50
|
+
setDragOver(true);
|
|
51
|
+
} : void 0,
|
|
52
|
+
onDragLeave: draggable ? () => setDragOver(false) : void 0,
|
|
53
|
+
onDrop: draggable && !disabled ? drop : void 0,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsx("input", {
|
|
56
|
+
ref: inputRef,
|
|
57
|
+
type: "file",
|
|
58
|
+
className: "k-upload-file",
|
|
59
|
+
name,
|
|
60
|
+
accept,
|
|
61
|
+
disabled,
|
|
62
|
+
multiple,
|
|
63
|
+
...directoryProps,
|
|
64
|
+
onChange: (event_3) => {
|
|
65
|
+
select(event_3.target.files);
|
|
66
|
+
event_3.target.value = "";
|
|
67
|
+
}
|
|
68
|
+
}),
|
|
69
|
+
type === "picture" || draggable ? /* @__PURE__ */ jsx(Icon, { type: uploadIcon ?? Plus }) : children,
|
|
70
|
+
(type === "picture" || draggable && uploadText) && /* @__PURE__ */ jsx("span", {
|
|
71
|
+
className: "k-upload-text",
|
|
72
|
+
children: uploadText
|
|
73
|
+
}),
|
|
74
|
+
draggable && uploadSubText && /* @__PURE__ */ jsx("span", {
|
|
75
|
+
className: "k-upload-sub-text",
|
|
76
|
+
children: dragOver ? locale?.k.upload.releaseToUpload : uploadSubText
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
});
|
|
210
81
|
}
|
|
211
|
-
//#endregion
|
|
212
82
|
export { Selector as default };
|
package/es/utils/checked.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/checked.ts
|
|
10
10
|
var getValueWithType = (checked, vType) => {
|
|
11
11
|
let value = checked;
|
|
12
12
|
switch (vType) {
|
|
@@ -20,5 +20,4 @@ var getValueWithType = (checked, vType) => {
|
|
|
20
20
|
}
|
|
21
21
|
return value;
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
export { getValueWithType };
|
package/es/utils/color.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 Color from "color";
|
|
10
|
-
|
|
10
|
+
// components/utils/color.ts
|
|
11
11
|
function isColor(value) {
|
|
12
12
|
if (typeof value !== "string" || typeof CSS === "undefined" || !CSS.supports) return false;
|
|
13
13
|
return CSS.supports("color", value);
|
|
@@ -34,5 +34,4 @@ function wash(value, share) {
|
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
//#endregion
|
|
38
37
|
export { isColor, wash };
|