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/skeleton/skeleton.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,142 +7,55 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { useSkeletonLoading } from "./use-skeleton-loading.js";
|
|
10
|
-
import { c } from "react/compiler-runtime";
|
|
11
10
|
import clsx from "clsx";
|
|
12
11
|
import "react";
|
|
13
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
|
|
15
|
-
var Skeleton = (
|
|
16
|
-
const $ = c(30);
|
|
17
|
-
let avatar;
|
|
18
|
-
let children;
|
|
19
|
-
let rest;
|
|
20
|
-
let t1;
|
|
21
|
-
let t2;
|
|
22
|
-
let t3;
|
|
23
|
-
let t4;
|
|
24
|
-
let t5;
|
|
25
|
-
let t6;
|
|
26
|
-
let title;
|
|
27
|
-
if ($[0] !== t0) {
|
|
28
|
-
({animated: t1, loading: t2, delay: t3, title, titleWidth: t4, rows: t5, avatar, children, className: t6, ...rest} = t0);
|
|
29
|
-
$[0] = t0;
|
|
30
|
-
$[1] = avatar;
|
|
31
|
-
$[2] = children;
|
|
32
|
-
$[3] = rest;
|
|
33
|
-
$[4] = t1;
|
|
34
|
-
$[5] = t2;
|
|
35
|
-
$[6] = t3;
|
|
36
|
-
$[7] = t4;
|
|
37
|
-
$[8] = t5;
|
|
38
|
-
$[9] = t6;
|
|
39
|
-
$[10] = title;
|
|
40
|
-
} else {
|
|
41
|
-
avatar = $[1];
|
|
42
|
-
children = $[2];
|
|
43
|
-
rest = $[3];
|
|
44
|
-
t1 = $[4];
|
|
45
|
-
t2 = $[5];
|
|
46
|
-
t3 = $[6];
|
|
47
|
-
t4 = $[7];
|
|
48
|
-
t5 = $[8];
|
|
49
|
-
t6 = $[9];
|
|
50
|
-
title = $[10];
|
|
51
|
-
}
|
|
52
|
-
const animated = t1 === void 0 ? false : t1;
|
|
53
|
-
const loading = t2 === void 0 ? false : t2;
|
|
54
|
-
const delay = t3 === void 0 ? 500 : t3;
|
|
55
|
-
const titleWidth = t4 === void 0 ? 35 : t4;
|
|
56
|
-
const rows = t5 === void 0 ? 3 : t5;
|
|
57
|
-
const className = t6 === void 0 ? "" : t6;
|
|
13
|
+
// components/skeleton/skeleton.tsx
|
|
14
|
+
var Skeleton = ({ animated = false, loading = false, delay = 500, title, titleWidth = 35, rows = 3, avatar, children, className = "", ...rest }) => {
|
|
58
15
|
const show = useSkeletonLoading(loading, delay);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"k-skeleton-avatar-circle": shape === "circle",
|
|
73
|
-
"k-skeleton-avatar-square": shape === "square"
|
|
74
|
-
});
|
|
75
|
-
return /* @__PURE__ */ jsx("div", {
|
|
76
|
-
className: "k-skeleton-header",
|
|
77
|
-
"aria-hidden": "true",
|
|
78
|
-
children: /* @__PURE__ */ jsx("span", { className: avatarClasses })
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
$[11] = avatar;
|
|
82
|
-
$[12] = t7;
|
|
83
|
-
} else t7 = $[12];
|
|
84
|
-
const renderAvatar = t7;
|
|
85
|
-
let t8;
|
|
86
|
-
if ($[13] !== rows || $[14] !== title || $[15] !== titleWidth) {
|
|
87
|
-
t8 = () => {
|
|
88
|
-
const rowCount = Number.isFinite(rows) ? Math.max(0, Math.floor(rows)) : 3;
|
|
89
|
-
const rawTitleWidth = title ?? titleWidth;
|
|
90
|
-
const normalizedTitleWidth = Number.isFinite(rawTitleWidth) ? Math.min(100, Math.max(0, rawTitleWidth)) : 35;
|
|
91
|
-
const lines = new Array(rowCount).fill("");
|
|
92
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
93
|
-
className: "k-skeleton-content",
|
|
94
|
-
"aria-hidden": "true",
|
|
95
|
-
children: [normalizedTitleWidth > 0 ? /* @__PURE__ */ jsx("div", {
|
|
96
|
-
className: "k-skeleton-title",
|
|
97
|
-
style: { width: `${normalizedTitleWidth}%` }
|
|
98
|
-
}) : null, /* @__PURE__ */ jsx("ul", {
|
|
99
|
-
className: "k-skeleton-paragraph",
|
|
100
|
-
children: lines.map(_temp)
|
|
101
|
-
})]
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
$[13] = rows;
|
|
105
|
-
$[14] = title;
|
|
106
|
-
$[15] = titleWidth;
|
|
107
|
-
$[16] = t8;
|
|
108
|
-
} else t8 = $[16];
|
|
109
|
-
const renderContent = t8;
|
|
110
|
-
let t9;
|
|
111
|
-
if ($[17] !== animated || $[18] !== className) {
|
|
112
|
-
t9 = clsx("k-skeleton", { "k-skeleton-animated": animated }, className);
|
|
113
|
-
$[17] = animated;
|
|
114
|
-
$[18] = className;
|
|
115
|
-
$[19] = t9;
|
|
116
|
-
} else t9 = $[19];
|
|
117
|
-
const classes = t9;
|
|
118
|
-
const t10 = loading || void 0;
|
|
119
|
-
let t11;
|
|
120
|
-
if ($[20] !== children || $[21] !== renderAvatar || $[22] !== renderContent || $[23] !== show) {
|
|
121
|
-
t11 = children != null && !show ? children : /* @__PURE__ */ jsxs(Fragment$1, { children: [renderAvatar(), renderContent()] });
|
|
122
|
-
$[20] = children;
|
|
123
|
-
$[21] = renderAvatar;
|
|
124
|
-
$[22] = renderContent;
|
|
125
|
-
$[23] = show;
|
|
126
|
-
$[24] = t11;
|
|
127
|
-
} else t11 = $[24];
|
|
128
|
-
let t12;
|
|
129
|
-
if ($[25] !== classes || $[26] !== rest || $[27] !== t10 || $[28] !== t11) {
|
|
130
|
-
t12 = /* @__PURE__ */ jsx("div", {
|
|
131
|
-
className: classes,
|
|
132
|
-
...rest,
|
|
133
|
-
"aria-busy": t10,
|
|
134
|
-
children: t11
|
|
16
|
+
const renderAvatar = () => {
|
|
17
|
+
if (!avatar) return null;
|
|
18
|
+
let size = "large";
|
|
19
|
+
let shape = "circle";
|
|
20
|
+
if (typeof avatar === "object") {
|
|
21
|
+
if (avatar.size) size = avatar.size;
|
|
22
|
+
if (avatar.shape) shape = avatar.shape;
|
|
23
|
+
}
|
|
24
|
+
const avatarClasses = clsx("k-skeleton-avatar", {
|
|
25
|
+
"k-skeleton-avatar-lg": size === "large",
|
|
26
|
+
"k-skeleton-avatar-sm": size === "small",
|
|
27
|
+
"k-skeleton-avatar-circle": shape === "circle",
|
|
28
|
+
"k-skeleton-avatar-square": shape === "square"
|
|
135
29
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
30
|
+
return /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: "k-skeleton-header",
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
children: /* @__PURE__ */ jsx("span", { className: avatarClasses })
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
const renderContent = () => {
|
|
37
|
+
const rowCount = Number.isFinite(rows) ? Math.max(0, Math.floor(rows)) : 3;
|
|
38
|
+
const rawTitleWidth = title ?? titleWidth;
|
|
39
|
+
const normalizedTitleWidth = Number.isFinite(rawTitleWidth) ? Math.min(100, Math.max(0, rawTitleWidth)) : 35;
|
|
40
|
+
const lines = new Array(rowCount).fill("");
|
|
41
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
42
|
+
className: "k-skeleton-content",
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
children: [normalizedTitleWidth > 0 ? /* @__PURE__ */ jsx("div", {
|
|
45
|
+
className: "k-skeleton-title",
|
|
46
|
+
style: { width: `${normalizedTitleWidth}%` }
|
|
47
|
+
}) : null, /* @__PURE__ */ jsx("ul", {
|
|
48
|
+
className: "k-skeleton-paragraph",
|
|
49
|
+
children: lines.map((_, i) => /* @__PURE__ */ jsx("li", {}, i))
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
const classes = clsx("k-skeleton", { "k-skeleton-animated": animated }, className);
|
|
54
|
+
return /* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: classes,
|
|
56
|
+
...rest,
|
|
57
|
+
"aria-busy": loading || void 0,
|
|
58
|
+
children: children != null && !show ? children : /* @__PURE__ */ jsxs(Fragment$1, { children: [renderAvatar(), renderContent()] })
|
|
59
|
+
});
|
|
143
60
|
};
|
|
144
|
-
function _temp(_, i) {
|
|
145
|
-
return /* @__PURE__ */ jsx("li", {}, i);
|
|
146
|
-
}
|
|
147
|
-
//#endregion
|
|
148
61
|
export { Skeleton as default };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
6
6
|
* Author: Qiu / https://chuchur.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { c } from "react/compiler-runtime";
|
|
10
9
|
import { useEffect, useState } from "react";
|
|
11
|
-
|
|
10
|
+
import { c } from "react/compiler-runtime";
|
|
11
|
+
// components/skeleton/use-skeleton-loading.ts
|
|
12
12
|
var useSkeletonLoading = (loading, delay) => {
|
|
13
13
|
const $ = c(7);
|
|
14
14
|
let t0;
|
|
@@ -49,5 +49,4 @@ var useSkeletonLoading = (loading, delay) => {
|
|
|
49
49
|
useEffect(t1, t2);
|
|
50
50
|
return show;
|
|
51
51
|
};
|
|
52
|
-
//#endregion
|
|
53
52
|
export { useSkeletonLoading };
|
package/es/slider/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.3.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -7,155 +7,45 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
|
-
import { SizeContext } from "../config/size-context.js";
|
|
11
10
|
import { createFormFieldComponent } from "../form/field-context.js";
|
|
11
|
+
import { SizeContext } from "../config/size-context.js";
|
|
12
12
|
import { getClosestStep } from "../utils/number.js";
|
|
13
13
|
import Thumb from "./thumb.js";
|
|
14
|
-
import { c } from "react/compiler-runtime";
|
|
15
14
|
import clsx from "clsx";
|
|
16
|
-
import { useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
15
|
+
import { useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
17
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
17
|
import Big from "big.js";
|
|
19
|
-
|
|
20
|
-
function Slider(
|
|
21
|
-
const $ = c(65);
|
|
22
|
-
let className;
|
|
23
|
-
let marks;
|
|
24
|
-
let onChange;
|
|
25
|
-
let rest;
|
|
26
|
-
let sizeProp;
|
|
27
|
-
let t1;
|
|
28
|
-
let t10;
|
|
29
|
-
let t2;
|
|
30
|
-
let t3;
|
|
31
|
-
let t4;
|
|
32
|
-
let t5;
|
|
33
|
-
let t6;
|
|
34
|
-
let t7;
|
|
35
|
-
let t8;
|
|
36
|
-
let t9;
|
|
37
|
-
let tipFormatter;
|
|
38
|
-
let value;
|
|
39
|
-
if ($[0] !== t0) {
|
|
40
|
-
({value, min: t1, max: t2, step: t3, disabled: t4, readOnly: t5, vertical: t6, reverse: t7, range: t8, marks, size: sizeProp, included: t9, tipFormatter, tooltipVisible: t10, onChange, className, ...rest} = t0);
|
|
41
|
-
$[0] = t0;
|
|
42
|
-
$[1] = className;
|
|
43
|
-
$[2] = marks;
|
|
44
|
-
$[3] = onChange;
|
|
45
|
-
$[4] = rest;
|
|
46
|
-
$[5] = sizeProp;
|
|
47
|
-
$[6] = t1;
|
|
48
|
-
$[7] = t10;
|
|
49
|
-
$[8] = t2;
|
|
50
|
-
$[9] = t3;
|
|
51
|
-
$[10] = t4;
|
|
52
|
-
$[11] = t5;
|
|
53
|
-
$[12] = t6;
|
|
54
|
-
$[13] = t7;
|
|
55
|
-
$[14] = t8;
|
|
56
|
-
$[15] = t9;
|
|
57
|
-
$[16] = tipFormatter;
|
|
58
|
-
$[17] = value;
|
|
59
|
-
} else {
|
|
60
|
-
className = $[1];
|
|
61
|
-
marks = $[2];
|
|
62
|
-
onChange = $[3];
|
|
63
|
-
rest = $[4];
|
|
64
|
-
sizeProp = $[5];
|
|
65
|
-
t1 = $[6];
|
|
66
|
-
t10 = $[7];
|
|
67
|
-
t2 = $[8];
|
|
68
|
-
t3 = $[9];
|
|
69
|
-
t4 = $[10];
|
|
70
|
-
t5 = $[11];
|
|
71
|
-
t6 = $[12];
|
|
72
|
-
t7 = $[13];
|
|
73
|
-
t8 = $[14];
|
|
74
|
-
t9 = $[15];
|
|
75
|
-
tipFormatter = $[16];
|
|
76
|
-
value = $[17];
|
|
77
|
-
}
|
|
78
|
-
const min = t1 === void 0 ? 0 : t1;
|
|
79
|
-
const max = t2 === void 0 ? 100 : t2;
|
|
80
|
-
const step = t3 === void 0 ? 1 : t3;
|
|
81
|
-
const disabled = t4 === void 0 ? false : t4;
|
|
82
|
-
const readOnly = t5 === void 0 ? false : t5;
|
|
83
|
-
const vertical = t6 === void 0 ? false : t6;
|
|
84
|
-
const reverse = t7 === void 0 ? false : t7;
|
|
85
|
-
const range = t8 === void 0 ? false : t8;
|
|
86
|
-
const included = t9 === void 0 ? true : t9;
|
|
87
|
-
const tooltipVisible = t10 === void 0 ? null : t10;
|
|
18
|
+
// components/slider/index.tsx
|
|
19
|
+
function Slider({ value, min = 0, max = 100, step = 1, disabled = false, readOnly = false, vertical = false, reverse = false, range = false, marks, size: sizeProp, included = true, tipFormatter, tooltipVisible = null, onChange, className, ...rest }) {
|
|
88
20
|
const inheritedAppearance = useConfigAppearance();
|
|
89
21
|
const contextSize = useContext(SizeContext) ?? inheritedAppearance.size;
|
|
90
22
|
const size = sizeProp ?? (contextSize === "small" ? "small" : void 0);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
118
|
-
$[23] = config;
|
|
119
|
-
$[24] = min;
|
|
120
|
-
$[25] = range;
|
|
121
|
-
$[26] = t12;
|
|
122
|
-
} else t12 = $[26];
|
|
123
|
-
const formatValue = t12;
|
|
124
|
-
let t13;
|
|
125
|
-
if ($[27] !== min || $[28] !== range) {
|
|
126
|
-
t13 = range ? [min, min] : min;
|
|
127
|
-
$[27] = min;
|
|
128
|
-
$[28] = range;
|
|
129
|
-
$[29] = t13;
|
|
130
|
-
} else t13 = $[29];
|
|
131
|
-
const sourceValue = value ?? t13;
|
|
132
|
-
let t14;
|
|
133
|
-
if ($[30] !== formatValue || $[31] !== sourceValue) {
|
|
134
|
-
t14 = () => formatValue(sourceValue);
|
|
135
|
-
$[30] = formatValue;
|
|
136
|
-
$[31] = sourceValue;
|
|
137
|
-
$[32] = t14;
|
|
138
|
-
} else t14 = $[32];
|
|
139
|
-
const [internalValue, setInternalValue] = useState(t14);
|
|
140
|
-
let t15;
|
|
141
|
-
if ($[33] !== marks || $[34] !== max || $[35] !== min || $[36] !== range || $[37] !== step || $[38] !== value) {
|
|
142
|
-
t15 = {
|
|
143
|
-
value,
|
|
144
|
-
min,
|
|
145
|
-
max,
|
|
146
|
-
step,
|
|
147
|
-
range,
|
|
148
|
-
marks
|
|
149
|
-
};
|
|
150
|
-
$[33] = marks;
|
|
151
|
-
$[34] = max;
|
|
152
|
-
$[35] = min;
|
|
153
|
-
$[36] = range;
|
|
154
|
-
$[37] = step;
|
|
155
|
-
$[38] = value;
|
|
156
|
-
$[39] = t15;
|
|
157
|
-
} else t15 = $[39];
|
|
158
|
-
const [syncedSource, setSyncedSource] = useState(t15);
|
|
23
|
+
const config = {
|
|
24
|
+
min,
|
|
25
|
+
max,
|
|
26
|
+
step,
|
|
27
|
+
marks
|
|
28
|
+
};
|
|
29
|
+
const sortValue = (next) => Array.isArray(next) ? [...next].sort((a, b) => a - b) : next;
|
|
30
|
+
const formatValue = (next_0) => {
|
|
31
|
+
if (range) {
|
|
32
|
+
const values = Array.isArray(next_0) ? next_0 : [min, min];
|
|
33
|
+
const first = values[0] ?? min;
|
|
34
|
+
const second = values[1] ?? first;
|
|
35
|
+
return sortValue([first, second].map((item) => getClosestStep(item, config)));
|
|
36
|
+
}
|
|
37
|
+
return getClosestStep(Array.isArray(next_0) ? next_0[0] ?? min : next_0, config);
|
|
38
|
+
};
|
|
39
|
+
const sourceValue = value ?? (range ? [min, min] : min);
|
|
40
|
+
const [internalValue, setInternalValue] = useState(() => formatValue(sourceValue));
|
|
41
|
+
const [syncedSource, setSyncedSource] = useState({
|
|
42
|
+
value,
|
|
43
|
+
min,
|
|
44
|
+
max,
|
|
45
|
+
step,
|
|
46
|
+
range,
|
|
47
|
+
marks
|
|
48
|
+
});
|
|
159
49
|
const [railWidth, setRailWidth] = useState(0);
|
|
160
50
|
const [draggingIndex, setDraggingIndex] = useState(-1);
|
|
161
51
|
const draggingIndexRef = useRef(-1);
|
|
@@ -177,25 +67,45 @@ function Slider(t0) {
|
|
|
177
67
|
});
|
|
178
68
|
setInternalValue(next_1);
|
|
179
69
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
internalValueRef.current = internalValue;
|
|
72
|
+
}, [internalValue]);
|
|
73
|
+
const detachDragListeners = useCallback(() => {
|
|
74
|
+
draggingIndexRef.current = -1;
|
|
75
|
+
if (activeMoveRef.current) {
|
|
76
|
+
document.removeEventListener("mousemove", activeMoveRef.current);
|
|
77
|
+
document.removeEventListener("touchmove", activeMoveRef.current);
|
|
78
|
+
}
|
|
79
|
+
if (activeUpRef.current) {
|
|
80
|
+
document.removeEventListener("mouseup", activeUpRef.current);
|
|
81
|
+
document.removeEventListener("touchend", activeUpRef.current);
|
|
82
|
+
document.removeEventListener("touchcancel", activeUpRef.current);
|
|
83
|
+
}
|
|
84
|
+
activeMoveRef.current = null;
|
|
85
|
+
activeUpRef.current = null;
|
|
86
|
+
}, []);
|
|
87
|
+
const stopDragging = () => {
|
|
88
|
+
setDraggingIndex(-1);
|
|
89
|
+
detachDragListeners();
|
|
90
|
+
};
|
|
91
|
+
useLayoutEffect(() => {
|
|
92
|
+
if (disabled || readOnly) detachDragListeners();
|
|
93
|
+
}, [
|
|
94
|
+
disabled,
|
|
95
|
+
readOnly,
|
|
96
|
+
detachDragListeners
|
|
97
|
+
]);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
const updateSize = () => {
|
|
100
|
+
if (railRef.current) setRailWidth(vertical ? railRef.current.offsetHeight : railRef.current.offsetWidth);
|
|
185
101
|
};
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
useEffect(t16, t17);
|
|
195
|
-
let t18;
|
|
196
|
-
if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
|
|
197
|
-
t18 = () => {
|
|
198
|
-
draggingIndexRef.current = -1;
|
|
102
|
+
updateSize();
|
|
103
|
+
window.addEventListener("resize", updateSize);
|
|
104
|
+
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(updateSize);
|
|
105
|
+
if (railRef.current) observer?.observe(railRef.current);
|
|
106
|
+
return () => {
|
|
107
|
+
observer?.disconnect();
|
|
108
|
+
window.removeEventListener("resize", updateSize);
|
|
199
109
|
if (activeMoveRef.current) {
|
|
200
110
|
document.removeEventListener("mousemove", activeMoveRef.current);
|
|
201
111
|
document.removeEventListener("touchmove", activeMoveRef.current);
|
|
@@ -205,86 +115,12 @@ function Slider(t0) {
|
|
|
205
115
|
document.removeEventListener("touchend", activeUpRef.current);
|
|
206
116
|
document.removeEventListener("touchcancel", activeUpRef.current);
|
|
207
117
|
}
|
|
208
|
-
activeMoveRef.current = null;
|
|
209
|
-
activeUpRef.current = null;
|
|
210
|
-
};
|
|
211
|
-
$[43] = t18;
|
|
212
|
-
} else t18 = $[43];
|
|
213
|
-
const detachDragListeners = t18;
|
|
214
|
-
let t19;
|
|
215
|
-
if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
|
|
216
|
-
t19 = () => {
|
|
217
|
-
setDraggingIndex(-1);
|
|
218
|
-
detachDragListeners();
|
|
219
|
-
};
|
|
220
|
-
$[44] = t19;
|
|
221
|
-
} else t19 = $[44];
|
|
222
|
-
const stopDragging = t19;
|
|
223
|
-
let t20;
|
|
224
|
-
let t21;
|
|
225
|
-
if ($[45] !== disabled || $[46] !== readOnly) {
|
|
226
|
-
t20 = () => {
|
|
227
|
-
if (disabled || readOnly) detachDragListeners();
|
|
228
|
-
};
|
|
229
|
-
t21 = [
|
|
230
|
-
disabled,
|
|
231
|
-
readOnly,
|
|
232
|
-
detachDragListeners
|
|
233
|
-
];
|
|
234
|
-
$[45] = disabled;
|
|
235
|
-
$[46] = readOnly;
|
|
236
|
-
$[47] = t20;
|
|
237
|
-
$[48] = t21;
|
|
238
|
-
} else {
|
|
239
|
-
t20 = $[47];
|
|
240
|
-
t21 = $[48];
|
|
241
|
-
}
|
|
242
|
-
useLayoutEffect(t20, t21);
|
|
243
|
-
let t22;
|
|
244
|
-
let t23;
|
|
245
|
-
if ($[49] !== vertical) {
|
|
246
|
-
t22 = () => {
|
|
247
|
-
const updateSize = () => {
|
|
248
|
-
if (railRef.current) setRailWidth(vertical ? railRef.current.offsetHeight : railRef.current.offsetWidth);
|
|
249
|
-
};
|
|
250
|
-
updateSize();
|
|
251
|
-
window.addEventListener("resize", updateSize);
|
|
252
|
-
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(updateSize);
|
|
253
|
-
if (railRef.current) observer?.observe(railRef.current);
|
|
254
|
-
return () => {
|
|
255
|
-
observer?.disconnect();
|
|
256
|
-
window.removeEventListener("resize", updateSize);
|
|
257
|
-
if (activeMoveRef.current) {
|
|
258
|
-
document.removeEventListener("mousemove", activeMoveRef.current);
|
|
259
|
-
document.removeEventListener("touchmove", activeMoveRef.current);
|
|
260
|
-
}
|
|
261
|
-
if (activeUpRef.current) {
|
|
262
|
-
document.removeEventListener("mouseup", activeUpRef.current);
|
|
263
|
-
document.removeEventListener("touchend", activeUpRef.current);
|
|
264
|
-
document.removeEventListener("touchcancel", activeUpRef.current);
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
118
|
};
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
t22 = $[50];
|
|
274
|
-
t23 = $[51];
|
|
275
|
-
}
|
|
276
|
-
useEffect(t22, t23);
|
|
277
|
-
let t24;
|
|
278
|
-
if ($[52] !== max || $[53] !== min) {
|
|
279
|
-
t24 = (next_2) => {
|
|
280
|
-
const difference = max - min;
|
|
281
|
-
return difference === 0 ? 0 : Math.max(0, Math.min(100, (next_2 - min) / difference * 100));
|
|
282
|
-
};
|
|
283
|
-
$[52] = max;
|
|
284
|
-
$[53] = min;
|
|
285
|
-
$[54] = t24;
|
|
286
|
-
} else t24 = $[54];
|
|
287
|
-
const getPercent = t24;
|
|
119
|
+
}, [vertical]);
|
|
120
|
+
const getPercent = (next_2) => {
|
|
121
|
+
const difference = max - min;
|
|
122
|
+
return difference === 0 ? 0 : Math.max(0, Math.min(100, (next_2 - min) / difference * 100));
|
|
123
|
+
};
|
|
288
124
|
const getValueFromEvent = (event) => {
|
|
289
125
|
const rect = railRef.current.getBoundingClientRect();
|
|
290
126
|
const width = vertical ? rect.height : rect.width;
|
|
@@ -353,7 +189,7 @@ function Slider(t0) {
|
|
|
353
189
|
const targetValue = currentValues[index_0];
|
|
354
190
|
let nextValue_1;
|
|
355
191
|
if (typeof step !== "number") {
|
|
356
|
-
const markValues = Object.keys(marks ?? {}).map(Number).filter((item_0) => Number.isFinite(item_0) && item_0 >= min && item_0 <= max).sort(
|
|
192
|
+
const markValues = Object.keys(marks ?? {}).map(Number).filter((item_0) => Number.isFinite(item_0) && item_0 >= min && item_0 <= max).sort((a_0, b_0) => a_0 - b_0);
|
|
357
193
|
if (!markValues.length) return;
|
|
358
194
|
const currentIndex = markValues.indexOf(getClosestStep(targetValue, config));
|
|
359
195
|
nextValue_1 = markValues[Math.max(0, Math.min(markValues.length - 1, currentIndex + (isPlus ? 1 : -1)))];
|
|
@@ -365,7 +201,7 @@ function Slider(t0) {
|
|
|
365
201
|
const nextInternal_0 = [];
|
|
366
202
|
nextInternal_0[index_0] = otherValue;
|
|
367
203
|
nextInternal_0[otherIndex] = getClosestStep(nextValue_1, config);
|
|
368
|
-
commit(nextInternal_0.sort(
|
|
204
|
+
commit(nextInternal_0.sort((a_1, b_1) => a_1 - b_1));
|
|
369
205
|
requestAnimationFrame(() => thumbRefs.current[otherIndex]?.focus());
|
|
370
206
|
} else {
|
|
371
207
|
currentValues[index_0] = nextValue_1;
|
|
@@ -373,24 +209,17 @@ function Slider(t0) {
|
|
|
373
209
|
}
|
|
374
210
|
} else commit(formatValue(nextValue_1));
|
|
375
211
|
};
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
};
|
|
388
|
-
$[55] = getPercent;
|
|
389
|
-
$[56] = railWidth;
|
|
390
|
-
$[57] = size;
|
|
391
|
-
$[58] = t25;
|
|
392
|
-
} else t25 = $[58];
|
|
393
|
-
const getCoord = t25;
|
|
212
|
+
const getCoord = (next_4) => {
|
|
213
|
+
const percent_0 = getPercent(next_4) / 100;
|
|
214
|
+
const thumbSize_0 = size === "small" ? 18 : 24;
|
|
215
|
+
const radius_0 = thumbSize_0 / 2;
|
|
216
|
+
if (railWidth === 0) return 0;
|
|
217
|
+
const edge = 18;
|
|
218
|
+
const thumbPosition = percent_0 * (railWidth - thumbSize_0) + radius_0;
|
|
219
|
+
if (thumbPosition < edge) return (thumbPosition - radius_0) / (edge - radius_0) * edge;
|
|
220
|
+
if (thumbPosition > railWidth - edge) return railWidth - edge + (thumbPosition - (railWidth - edge)) / (edge - radius_0) * edge;
|
|
221
|
+
return thumbPosition;
|
|
222
|
+
};
|
|
394
223
|
const values_0 = range ? internalValue : [internalValue];
|
|
395
224
|
const renderTrack = () => {
|
|
396
225
|
if (!included && marks) return null;
|
|
@@ -417,25 +246,15 @@ function Slider(t0) {
|
|
|
417
246
|
});
|
|
418
247
|
};
|
|
419
248
|
const markValues_0 = Object.keys(marks ?? {}).map(Number).filter((item_1) => Number.isFinite(item_1) && item_1 >= min && item_1 <= max);
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
249
|
+
return /* @__PURE__ */ jsx("div", {
|
|
250
|
+
...rest,
|
|
251
|
+
"aria-readonly": readOnly || void 0,
|
|
252
|
+
className: clsx("k-slider", {
|
|
423
253
|
"k-slider-disabled": disabled,
|
|
424
254
|
"k-slider-readonly": readOnly,
|
|
425
255
|
"k-slider-vertical": vertical,
|
|
426
256
|
"k-slider-reverse": reverse
|
|
427
|
-
}, className)
|
|
428
|
-
$[59] = className;
|
|
429
|
-
$[60] = disabled;
|
|
430
|
-
$[61] = readOnly;
|
|
431
|
-
$[62] = reverse;
|
|
432
|
-
$[63] = vertical;
|
|
433
|
-
$[64] = t26;
|
|
434
|
-
} else t26 = $[64];
|
|
435
|
-
return /* @__PURE__ */ jsx("div", {
|
|
436
|
-
...rest,
|
|
437
|
-
"aria-readonly": readOnly || void 0,
|
|
438
|
-
className: t26,
|
|
257
|
+
}, className),
|
|
439
258
|
children: /* @__PURE__ */ jsxs("div", {
|
|
440
259
|
className: "k-slider-bar",
|
|
441
260
|
children: [
|
|
@@ -501,18 +320,5 @@ function Slider(t0) {
|
|
|
501
320
|
})
|
|
502
321
|
});
|
|
503
322
|
}
|
|
504
|
-
function _temp4(a_1, b_1) {
|
|
505
|
-
return a_1 - b_1;
|
|
506
|
-
}
|
|
507
|
-
function _temp3(a_0, b_0) {
|
|
508
|
-
return a_0 - b_0;
|
|
509
|
-
}
|
|
510
|
-
function _temp2(next) {
|
|
511
|
-
return Array.isArray(next) ? [...next].sort(_temp) : next;
|
|
512
|
-
}
|
|
513
|
-
function _temp(a, b) {
|
|
514
|
-
return a - b;
|
|
515
|
-
}
|
|
516
323
|
var slider_default = createFormFieldComponent(Slider, { inherit: ["size", "disabled"] });
|
|
517
|
-
//#endregion
|
|
518
324
|
export { slider_default as default };
|