react-kui 3.1.1 → 3.2.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/README.zh-CN.md +3 -1
- package/ai/kui-components.json +912 -318
- package/es/_virtual/_rolldown/runtime.js +1 -1
- package/es/affix/index.js +1 -1
- package/es/alert/index.js +11 -4
- package/es/anchor/anchor-context.js +1 -1
- package/es/anchor/anchor-link.js +1 -1
- package/es/anchor/anchor.js +1 -1
- package/es/auto-complete/index.js +371 -347
- package/es/avatar/avatar-group-context.js +1 -1
- package/es/avatar/avatar-group.js +1 -1
- package/es/avatar/avatar.js +1 -1
- package/es/back-top/index.js +1 -1
- package/es/badge/index.js +10 -8
- package/es/base/teleport.js +1 -1
- package/es/base/transition-props.js +1 -1
- package/es/base/transition.js +1 -1
- package/es/breadcrumb/breadcrumb-context.js +1 -1
- package/es/breadcrumb/breadcrumb-item.js +1 -1
- package/es/breadcrumb/breadcrumb.js +1 -1
- package/es/button/button-group-context.js +1 -1
- package/es/button/button-group.js +1 -1
- package/es/button/button.js +13 -6
- package/es/calendar/index.js +20 -6
- package/es/card/index.js +11 -4
- package/es/carousel/carousel-context.js +1 -1
- package/es/carousel/carousel-item.js +1 -1
- package/es/carousel/carousel.js +1 -1
- package/es/carousel/drag.js +1 -1
- package/es/cascader/index.js +13 -10
- package/es/check-card/check-card-group.js +3 -3
- package/es/check-card/check-card.js +155 -141
- package/es/check-card/context.js +1 -1
- package/es/checkbox/checkbox-group-context.js +1 -1
- package/es/checkbox/checkbox-group.js +3 -3
- package/es/checkbox/checkbox.js +64 -244
- package/es/checkbox/index.js +1 -1
- package/es/collapse/collapse-panel.js +1 -1
- package/es/collapse/collapse.js +96 -82
- package/es/color-picker/alpha.js +1 -1
- package/es/color-picker/hue.js +1 -1
- package/es/color-picker/index.js +7 -7
- package/es/color-picker/mode.js +2 -2
- package/es/color-picker/paint.js +1 -1
- package/es/color-picker/presets.js +1 -1
- package/es/components.js +4 -4
- package/es/config/config-context.js +16 -3
- package/es/config/context.js +29 -2
- package/es/config/index.js +31 -12
- package/es/config/popup-host.js +106 -0
- package/es/config/size-context.js +1 -1
- package/es/config/use-config-appearance.js +62 -2
- package/es/const/var.js +6 -2
- package/es/date-picker/index.js +404 -885
- package/es/descriptions/descriptions-item.js +1 -1
- package/es/descriptions/descriptions.js +1 -1
- package/es/divider/index.js +1 -1
- package/es/drawer/index.js +328 -240
- package/es/dropdown/dropdown-button.js +69 -51
- package/es/dropdown/dropdown-context.js +1 -1
- package/es/dropdown/dropdown.js +137 -93
- package/es/dropdown/trigger.js +85 -33
- package/es/empty/index.js +3 -4
- package/es/feature-card/index.js +15 -4
- package/es/feedback-panel/index.js +95 -81
- package/es/flame-wrap/index.js +116 -109
- package/es/flame-wrap/types.js +54 -6
- package/es/flex/index.js +1 -1
- package/es/form/field-context.js +16 -2
- package/es/form/form-context.js +1 -1
- package/es/form/form-item.js +7 -6
- package/es/form/form.js +1 -1
- package/es/form/utils.js +1 -1
- package/es/grid/grid-item.js +1 -1
- package/es/grid/grid.js +1 -1
- package/es/grid/useBreakpoint.js +1 -1
- package/es/icon/index.js +1 -1
- package/es/image/group.js +1 -1
- package/es/image/image-group-context.js +1 -1
- package/es/image/image.js +137 -123
- package/es/image/instance.js +1 -1
- package/es/image/preview.js +1 -1
- package/es/image/utils.js +1 -1
- package/es/index.js +3 -3
- package/es/input/index.js +3 -3
- package/es/input/input-base.js +7 -7
- package/es/input/input-box.js +2 -2
- package/es/input/input-group.js +43 -127
- package/es/input/input.js +1 -1
- package/es/input/textarea.js +28 -114
- package/es/input-number/index.js +7 -5
- package/es/input-otp/index.js +5 -5
- package/es/input-tag/index.js +5 -5
- package/es/kanban/index.js +79 -63
- package/es/layout/index.js +1 -1
- package/es/layout/layout-context.js +1 -1
- package/es/list-panel/index.js +96 -83
- package/es/loading/index.js +1 -1
- package/es/loading/loading-bar.js +1 -1
- package/es/locale/de.js +10 -2
- package/es/locale/el.js +10 -2
- package/es/locale/en.js +10 -2
- package/es/locale/fr.js +10 -2
- package/es/locale/it.js +10 -2
- package/es/locale/ja.js +10 -2
- package/es/locale/ko.js +10 -2
- package/es/locale/ru.js +10 -2
- package/es/locale/th.js +10 -2
- package/es/locale/uk.js +10 -2
- package/es/locale/vi.js +10 -2
- package/es/locale/zh-CN.js +10 -2
- package/es/locale/zh-TW.js +10 -2
- package/es/mentions/index.js +291 -286
- package/es/menu/menu-context.js +1 -1
- package/es/menu/menu-divider.js +1 -1
- package/es/menu/menu-group.js +1 -1
- package/es/menu/menu-item.js +1 -1
- package/es/menu/menu-keyboard.js +41 -2
- package/es/menu/menu.js +268 -222
- package/es/menu/recursive-menu.js +1 -1
- package/es/menu/sub-menu.js +81 -23
- package/es/message/index.js +1 -1
- package/es/modal/api.js +46 -12
- package/es/modal/modal.js +441 -345
- package/es/modal/toast.js +177 -64
- package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +1 -1
- package/es/notice/container.js +1 -1
- package/es/notice/content.js +1 -1
- package/es/notice/index.js +1 -1
- package/es/notice/instance.js +1 -1
- package/es/page/index.js +13 -8
- package/es/page/responsive.js +1 -1
- package/es/page-header/index.js +1 -1
- package/es/popconfirm/index.js +36 -35
- package/es/poptip/index.js +47 -45
- package/es/popup/index.js +5 -2
- package/es/popup/layers.js +11 -2
- package/es/progress/index.js +1 -1
- package/es/qrcode/index.js +13 -7
- package/es/radio/radio-button.js +51 -44
- package/es/radio/radio-group-context.js +1 -1
- package/es/radio/radio-group.js +49 -52
- package/es/radio/radio.js +46 -197
- package/es/rate/index.js +1 -1
- package/es/rate/star.js +1 -1
- package/es/result/index.js +1 -1
- package/es/ripple/index.js +104 -97
- package/es/ripple/types.js +71 -18
- package/es/row-col/col.js +1 -1
- package/es/row-col/row.js +1 -1
- package/es/segmented/index.js +3 -3
- package/es/select/option.js +1 -1
- package/es/select/select.js +33 -36
- package/es/skeleton/skeleton-avatar.js +1 -1
- package/es/skeleton/skeleton-button.js +1 -1
- package/es/skeleton/skeleton-image.js +1 -1
- package/es/skeleton/skeleton-text.js +1 -1
- package/es/skeleton/skeleton.js +1 -1
- package/es/skeleton/use-skeleton-loading.js +1 -1
- package/es/slider/index.js +1 -1
- package/es/slider/thumb.js +1 -1
- package/es/space/index.js +1 -1
- package/es/spin/index.js +1 -1
- package/es/splitter/splitter-panel.js +1 -1
- package/es/splitter/splitter.js +1 -1
- package/es/stat-card/countup.js +2 -2
- package/es/stat-card/rollup.js +1 -1
- package/es/stat-card/stat-card.js +16 -7
- package/es/stat-card/stat-number.js +4 -3
- package/es/stat-card/utils/countup.js +1 -1
- package/es/stat-card/utils/odometer.js +1 -1
- package/es/stat-card/utils/stat-item-key.js +22 -0
- package/es/steps/index.js +1 -1
- package/es/switch/index.js +3 -3
- package/es/table/column-setting.js +104 -115
- package/es/table/index.js +544 -206
- package/es/table/utils.js +141 -3
- package/es/tabs/tab-panel.js +1 -1
- package/es/tabs/tabs.js +1 -1
- package/es/tag/index.js +12 -5
- package/es/time-line/timeline-item.js +1 -1
- package/es/time-line/timeline.js +1 -1
- package/es/tooltip/index.js +114 -94
- package/es/tour/index.js +1 -1
- package/es/transfer/index.js +190 -172
- package/es/tree/index.js +55 -44
- package/es/tree/utils.js +1 -1
- package/es/tree-select/index.js +259 -781
- package/es/typography/index.js +1 -1
- package/es/upload/file-list.js +1 -1
- package/es/upload/index.js +5 -6
- package/es/upload/picture-sort.js +1 -1
- package/es/upload/selector.js +1 -1
- package/es/utils/checked.js +1 -1
- package/es/utils/color.js +25 -2
- package/es/utils/css.js +19 -0
- package/es/utils/focus.js +63 -0
- package/es/utils/number.js +1 -1
- package/es/utils/overlay-order.js +18 -0
- package/es/utils/overlay-stack.js +33 -0
- package/es/utils/placement.js +1 -1
- package/es/utils/popup.js +1 -1
- package/es/utils/promise.js +18 -0
- package/es/utils/react-node.js +55 -30
- package/es/utils/selection-tags.js +6 -4
- package/es/utils/share.js +5 -2
- package/es/utils/theme.js +1 -1
- package/es/utils/transition.js +1 -1
- package/es/utils/use-value.js +1 -1
- package/es/virtual-list/index.js +1 -1
- package/es/virtual-list/range.js +3 -2
- package/es/watermark/index.js +1 -1
- package/lib/index.cjs +2 -2
- package/lib/locale/de.cjs +2 -2
- package/lib/locale/el.cjs +2 -2
- package/lib/locale/en.cjs +2 -2
- package/lib/locale/fr.cjs +2 -2
- package/lib/locale/it.cjs +2 -2
- package/lib/locale/ja.cjs +2 -2
- package/lib/locale/ko.cjs +2 -2
- package/lib/locale/ru.cjs +2 -2
- package/lib/locale/th.cjs +2 -2
- package/lib/locale/uk.cjs +2 -2
- package/lib/locale/vi.cjs +2 -2
- package/lib/locale/zh-CN.cjs +2 -2
- package/lib/locale/zh-TW.cjs +2 -2
- package/package.json +4 -3
- package/readme.md +3 -1
- package/style/base.css +2 -2
- package/style/components.css +2 -2
- package/style/index.css +2 -2
- package/style/theme.css +2 -2
- package/types/alert/index.d.cts +2 -2
- package/types/alert/index.d.ts +2 -2
- package/types/auto-complete/index.d.cts +7 -1
- package/types/auto-complete/index.d.ts +7 -1
- package/types/badge/index.d.cts +2 -1
- package/types/badge/index.d.ts +2 -1
- package/types/button/button.d.cts +2 -2
- package/types/button/button.d.ts +2 -2
- package/types/card/index.d.cts +3 -3
- package/types/card/index.d.ts +3 -3
- package/types/cascader/index.d.cts +1 -1
- package/types/cascader/index.d.ts +1 -1
- package/types/cascader/types.d.cts +2 -0
- package/types/cascader/types.d.ts +2 -0
- package/types/check-card/context.d.cts +4 -3
- package/types/check-card/context.d.ts +4 -3
- package/types/check-card/index.d.cts +1 -1
- package/types/check-card/index.d.ts +1 -1
- package/types/check-card/types.d.cts +3 -4
- package/types/check-card/types.d.ts +3 -4
- package/types/checkbox/checkbox-group.d.cts +2 -2
- package/types/checkbox/checkbox-group.d.ts +2 -2
- package/types/checkbox/checkbox.d.cts +2 -2
- package/types/checkbox/checkbox.d.ts +2 -2
- package/types/collapse/collapse.d.cts +3 -3
- package/types/collapse/collapse.d.ts +3 -3
- package/types/color-picker/index.d.cts +3 -1
- package/types/color-picker/index.d.ts +3 -1
- package/types/components.d.cts +2 -2
- package/types/components.d.ts +2 -2
- package/types/config/config-context.d.cts +15 -2
- package/types/config/config-context.d.ts +15 -2
- package/types/config/context.d.cts +6 -0
- package/types/config/context.d.ts +6 -0
- package/types/config/popup-host.d.cts +16 -0
- package/types/config/popup-host.d.ts +16 -0
- package/types/config/use-config-appearance.d.cts +41 -2
- package/types/config/use-config-appearance.d.ts +41 -2
- package/types/const/types.d.cts +30 -1
- package/types/const/types.d.ts +30 -1
- package/types/const/var.d.cts +6 -1
- package/types/const/var.d.ts +6 -1
- package/types/date-picker/index.d.cts +3 -1
- package/types/date-picker/index.d.ts +3 -1
- package/types/descriptions/descriptions.d.cts +2 -2
- package/types/descriptions/descriptions.d.ts +2 -2
- package/types/drawer/index.d.cts +1 -0
- package/types/drawer/index.d.ts +1 -0
- package/types/dropdown/dropdown-button.d.cts +5 -2
- package/types/dropdown/dropdown-button.d.ts +5 -2
- package/types/dropdown/dropdown-context.d.cts +6 -0
- package/types/dropdown/dropdown-context.d.ts +6 -0
- package/types/dropdown/dropdown.d.cts +2 -0
- package/types/dropdown/dropdown.d.ts +2 -0
- package/types/feature-card/index.d.cts +3 -3
- package/types/feature-card/index.d.ts +3 -3
- package/types/feedback-panel/index.d.cts +3 -3
- package/types/feedback-panel/index.d.ts +3 -3
- package/types/flame-wrap/types.d.cts +18 -0
- package/types/flame-wrap/types.d.ts +18 -0
- package/types/form/field-context.d.cts +2 -0
- package/types/form/field-context.d.ts +2 -0
- package/types/image/image.d.cts +2 -2
- package/types/image/image.d.ts +2 -2
- package/types/input/input-group.d.cts +2 -2
- package/types/input/input-group.d.ts +2 -2
- package/types/input-number/index.d.cts +2 -0
- package/types/input-number/index.d.ts +2 -0
- package/types/kanban/index.d.cts +3 -2
- package/types/kanban/index.d.ts +3 -2
- package/types/list-panel/index.d.cts +3 -3
- package/types/list-panel/index.d.ts +3 -3
- package/types/locale/de.d.cts +6 -0
- package/types/locale/de.d.ts +6 -0
- package/types/locale/el.d.cts +6 -0
- package/types/locale/el.d.ts +6 -0
- package/types/locale/en.d.cts +6 -0
- package/types/locale/en.d.ts +6 -0
- package/types/locale/fr.d.cts +6 -0
- package/types/locale/fr.d.ts +6 -0
- package/types/locale/it.d.cts +6 -0
- package/types/locale/it.d.ts +6 -0
- package/types/locale/ja.d.cts +6 -0
- package/types/locale/ja.d.ts +6 -0
- package/types/locale/ko.d.cts +6 -0
- package/types/locale/ko.d.ts +6 -0
- package/types/locale/ru.d.cts +6 -0
- package/types/locale/ru.d.ts +6 -0
- package/types/locale/th.d.cts +6 -0
- package/types/locale/th.d.ts +6 -0
- package/types/locale/uk.d.cts +6 -0
- package/types/locale/uk.d.ts +6 -0
- package/types/locale/vi.d.cts +6 -0
- package/types/locale/vi.d.ts +6 -0
- package/types/locale/zh-CN.d.cts +6 -0
- package/types/locale/zh-CN.d.ts +6 -0
- package/types/locale/zh-TW.d.cts +6 -0
- package/types/locale/zh-TW.d.ts +6 -0
- package/types/mentions/index.d.cts +2 -0
- package/types/mentions/index.d.ts +2 -0
- package/types/menu/menu-keyboard.d.cts +23 -0
- package/types/menu/menu-keyboard.d.ts +23 -0
- package/types/modal/api.d.cts +6 -1
- package/types/modal/api.d.ts +6 -1
- package/types/modal/modal.d.cts +1 -0
- package/types/modal/modal.d.ts +1 -0
- package/types/modal/toast.d.cts +8 -2
- package/types/modal/toast.d.ts +8 -2
- package/types/page/index.d.cts +2 -2
- package/types/page/index.d.ts +2 -2
- package/types/popconfirm/index.d.cts +2 -0
- package/types/popconfirm/index.d.ts +2 -0
- package/types/poptip/index.d.cts +2 -0
- package/types/poptip/index.d.ts +2 -0
- package/types/popup/layers.d.cts +2 -0
- package/types/popup/layers.d.ts +2 -0
- package/types/qrcode/index.d.cts +2 -2
- package/types/qrcode/index.d.ts +2 -2
- package/types/radio/radio-button.d.cts +2 -2
- package/types/radio/radio-button.d.ts +2 -2
- package/types/radio/radio-group.d.cts +2 -2
- package/types/radio/radio-group.d.ts +2 -2
- package/types/radio/radio.d.cts +2 -2
- package/types/radio/radio.d.ts +2 -2
- package/types/ripple/types.d.cts +18 -0
- package/types/ripple/types.d.ts +18 -0
- package/types/select/select.d.cts +2 -0
- package/types/select/select.d.ts +2 -0
- package/types/stat-card/stat-card.d.cts +3 -3
- package/types/stat-card/stat-card.d.ts +3 -3
- package/types/stat-card/utils/stat-item-key.d.cts +11 -0
- package/types/stat-card/utils/stat-item-key.d.ts +11 -0
- package/types/table/column-setting.d.cts +4 -4
- package/types/table/column-setting.d.ts +4 -4
- package/types/table/index.d.cts +2 -2
- package/types/table/index.d.ts +2 -2
- package/types/table/types.d.cts +21 -2
- package/types/table/types.d.ts +21 -2
- package/types/table/utils.d.cts +75 -0
- package/types/table/utils.d.ts +75 -0
- package/types/tag/index.d.cts +2 -2
- package/types/tag/index.d.ts +2 -2
- package/types/tooltip/index.d.cts +2 -0
- package/types/tooltip/index.d.ts +2 -0
- package/types/transfer/index.d.cts +3 -2
- package/types/transfer/index.d.ts +3 -2
- package/types/tree-select/index.d.cts +3 -1
- package/types/tree-select/index.d.ts +3 -1
- package/types/utils/checked.d.cts +1 -1
- package/types/utils/checked.d.ts +1 -1
- package/types/utils/color.d.cts +13 -0
- package/types/utils/color.d.ts +13 -0
- package/types/utils/css.d.cts +2 -0
- package/types/utils/css.d.ts +2 -0
- package/types/utils/focus.d.cts +5 -0
- package/types/utils/focus.d.ts +5 -0
- package/types/utils/overlay-order.d.cts +6 -0
- package/types/utils/overlay-order.d.ts +6 -0
- package/types/utils/overlay-stack.d.cts +13 -0
- package/types/utils/overlay-stack.d.ts +13 -0
- package/types/utils/promise.d.cts +5 -0
- package/types/utils/promise.d.ts +5 -0
- package/types/utils/react-node.d.cts +10 -0
- package/types/utils/react-node.d.ts +10 -0
package/es/ripple/types.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.2.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -21,6 +21,27 @@ var DEFAULTS = {
|
|
|
21
21
|
};
|
|
22
22
|
var MAX_RIPPLES = 12;
|
|
23
23
|
var BASE_SPEED = 340;
|
|
24
|
+
/**
|
|
25
|
+
* Chrome 156 renames the experimental boolean `layoutsubtree` to the
|
|
26
|
+
* standardized `content="drawable"`, and the element handed to
|
|
27
|
+
* `drawElementImage()` now declares itself with its own `drawable` attribute
|
|
28
|
+
* (WICG html-in-canvas issue #169). Browsers advertise the new spelling with a
|
|
29
|
+
* reflected `content` IDL attribute, so the shape is read off the prototype
|
|
30
|
+
* rather than sniffed from a version string: every release only ever sees the
|
|
31
|
+
* attribute it understands.
|
|
32
|
+
*/
|
|
33
|
+
function htmlInCanvasMarkup() {
|
|
34
|
+
const legacy = {
|
|
35
|
+
canvas: { layoutsubtree: "true" },
|
|
36
|
+
element: {}
|
|
37
|
+
};
|
|
38
|
+
if (typeof document === "undefined") return legacy;
|
|
39
|
+
if (!("content" in HTMLCanvasElement.prototype)) return legacy;
|
|
40
|
+
return {
|
|
41
|
+
canvas: { content: "drawable" },
|
|
42
|
+
element: { drawable: "" }
|
|
43
|
+
};
|
|
44
|
+
}
|
|
24
45
|
var VERT = `#version 300 es
|
|
25
46
|
precision highp float;
|
|
26
47
|
layout(location = 0) in vec2 aPos;
|
|
@@ -81,8 +102,15 @@ void main () {
|
|
|
81
102
|
float shade = pow(clamp(-g * 1.6, 0.0, 1.0), 2.0) * uShine * 0.3;
|
|
82
103
|
|
|
83
104
|
if (uHasContent < 0.5) {
|
|
84
|
-
|
|
85
|
-
|
|
105
|
+
// Degraded overlay: the page behind the canvas cannot be sampled here, so
|
|
106
|
+
// the wave has to paint itself. White on the lit flank alone vanishes over
|
|
107
|
+
// light content and black on the shadow flank alone vanishes over dark
|
|
108
|
+
// content, so each ring half takes the tone its slope points at and the
|
|
109
|
+
// ripple stays legible whatever the host page is coloured like.
|
|
110
|
+
float dark = pow(clamp(-g * 1.6, 0.0, 1.0), 2.0) * uShine;
|
|
111
|
+
float a = clamp((glint + dark) * 0.8, 0.0, 0.5);
|
|
112
|
+
vec3 tone = glint > dark ? vec3(1.0) : vec3(0.0);
|
|
113
|
+
outColor = vec4(tone * a, a);
|
|
86
114
|
return;
|
|
87
115
|
}
|
|
88
116
|
|
|
@@ -141,22 +169,46 @@ function createRipple(elements, options = {}) {
|
|
|
141
169
|
let wake = () => {};
|
|
142
170
|
let appearanceFrame = 0;
|
|
143
171
|
let appearanceObserver = null;
|
|
144
|
-
|
|
145
|
-
|
|
172
|
+
let usesPaintEvent = false;
|
|
173
|
+
/**
|
|
174
|
+
* Keep the live DOM copy lined up with the pixels drawn from it, so pointer
|
|
175
|
+
* input, focus rings and screen reader bounds land where the user sees them.
|
|
176
|
+
* Which half of that job the browser does changed twice, so the branch keys
|
|
177
|
+
* off what the draw call actually hands back instead of a version number.
|
|
178
|
+
*/
|
|
179
|
+
function syncGeometry(transform) {
|
|
180
|
+
if (transform && typeof transform.toString === "function") {
|
|
181
|
+
if (paintable.updateElementGeometry) paintable.updateElementGeometry(content, { canvasTransform: transform });
|
|
182
|
+
else content.style.transform = transform.toString();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (content.style.transform) content.style.transform = "";
|
|
186
|
+
}
|
|
187
|
+
function onPaint() {
|
|
188
|
+
try {
|
|
189
|
+
sourceCtx.reset();
|
|
190
|
+
for (const background of getBackgroundStack(content)) {
|
|
191
|
+
sourceCtx.fillStyle = background;
|
|
192
|
+
sourceCtx.fillRect(0, 0, source.width, source.height);
|
|
193
|
+
}
|
|
194
|
+
const transform = sourceCtx.drawElementImage(content, 0, 0);
|
|
195
|
+
contentDirty = true;
|
|
146
196
|
try {
|
|
147
|
-
|
|
148
|
-
for (const background of getBackgroundStack(content)) {
|
|
149
|
-
sourceCtx.fillStyle = background;
|
|
150
|
-
sourceCtx.fillRect(0, 0, source.width, source.height);
|
|
151
|
-
}
|
|
152
|
-
const transform = sourceCtx.drawElementImage(content, 0, 0);
|
|
153
|
-
if (transform) content.style.transform = transform.toString();
|
|
154
|
-
contentDirty = true;
|
|
155
|
-
wake();
|
|
197
|
+
syncGeometry(transform);
|
|
156
198
|
} catch (error) {
|
|
157
|
-
console.error("Ripple failed to
|
|
199
|
+
console.error("Ripple failed to align its HTML content:", error);
|
|
158
200
|
}
|
|
159
|
-
|
|
201
|
+
wake();
|
|
202
|
+
} catch (error) {
|
|
203
|
+
console.error("Ripple failed to capture its HTML content:", error);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (htmlInCanvas) {
|
|
207
|
+
if ("onpaint" in paintable) paintable.onpaint = onPaint;
|
|
208
|
+
else {
|
|
209
|
+
usesPaintEvent = true;
|
|
210
|
+
source.addEventListener("paint", onPaint);
|
|
211
|
+
}
|
|
160
212
|
appearanceObserver = new MutationObserver(() => {
|
|
161
213
|
cancelAnimationFrame(appearanceFrame);
|
|
162
214
|
appearanceFrame = requestAnimationFrame(() => {
|
|
@@ -423,11 +475,12 @@ function createRipple(elements, options = {}) {
|
|
|
423
475
|
gl.deleteShader(fragmentShader);
|
|
424
476
|
gl.deleteBuffer(quad);
|
|
425
477
|
if (htmlInCanvas) {
|
|
426
|
-
|
|
478
|
+
if (usesPaintEvent) source.removeEventListener("paint", onPaint);
|
|
479
|
+
else paintable.onpaint = null;
|
|
427
480
|
content.style.removeProperty("transform");
|
|
428
481
|
}
|
|
429
482
|
}
|
|
430
483
|
};
|
|
431
484
|
}
|
|
432
485
|
//#endregion
|
|
433
|
-
export { createRipple, supportsHtmlInCanvas };
|
|
486
|
+
export { createRipple, htmlInCanvasMarkup, supportsHtmlInCanvas };
|
package/es/row-col/col.js
CHANGED
package/es/row-col/row.js
CHANGED
package/es/segmented/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.2.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
6
6
|
* Author: Qiu / https://chuchur.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { useFormAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import Icon from "../icon/index.js";
|
|
11
11
|
import { useValue } from "../utils/use-value.js";
|
|
12
12
|
import { createFormFieldComponent } from "../form/field-context.js";
|
|
@@ -66,7 +66,7 @@ var Segmented = (t0) => {
|
|
|
66
66
|
const readOnly = t3 === void 0 ? false : t3;
|
|
67
67
|
const block = t4 === void 0 ? false : t4;
|
|
68
68
|
const direction = t5 === void 0 ? "horizontal" : t5;
|
|
69
|
-
const inheritedAppearance =
|
|
69
|
+
const inheritedAppearance = useFormAppearance();
|
|
70
70
|
const size = sizeProp ?? inheritedAppearance.size ?? "medium";
|
|
71
71
|
const shape = shapeProp ?? inheritedAppearance.shape ?? "round";
|
|
72
72
|
const rootRef = useRef(null);
|
package/es/select/option.js
CHANGED
package/es/select/select.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.2.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 { ConfigContext } from "../config/config-context.js";
|
|
9
|
+
import { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
|
|
11
10
|
import { getChildren } from "../utils/react-node.js";
|
|
12
11
|
import Popup from "../popup/index.js";
|
|
13
|
-
import {
|
|
12
|
+
import { resolveTheme, useFormAppearance } from "../config/use-config-appearance.js";
|
|
14
13
|
import { ChevronDown, CircleX, Loading } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
15
14
|
import Icon from "../icon/index.js";
|
|
16
15
|
import { useValue } from "../utils/use-value.js";
|
|
@@ -29,12 +28,13 @@ var normalizeValue = (value) => {
|
|
|
29
28
|
if (isEmpty(value)) return [];
|
|
30
29
|
return typeof value === "string" || typeof value === "number" ? [value] : [];
|
|
31
30
|
};
|
|
32
|
-
var
|
|
33
|
-
|
|
31
|
+
var isSameLabelMap = (next, previous) => next.size === previous.size && [...next].every(([val, label]) => previous.has(val) && Object.is(previous.get(val), label));
|
|
32
|
+
var Select = ({ placeholder, size: sizeProp, placement = "bottom-left", destroyOnClose = true, width, maxTagCount, value, open: openProp, clearable = true, filterable = false, allowCreate = false, block = false, disabled = false, readOnly = false, multiple = false, loading = false, bordered = true, extendWidth = true, showArrow = true, options, theme: themeProp, emptyText, loadingText, icon, shape: shapeProp, virtual = false, itemHeight = 33, overscan = 5, arrowIcon, onSearch, onChange, onSelect, onClear: onClearCallback, onOpenChange, children, className = "", style, ...rest }) => {
|
|
33
|
+
const inheritedAppearance = useFormAppearance();
|
|
34
34
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
35
|
-
const theme = themeProp ?? inheritedAppearance.theme
|
|
35
|
+
const theme = resolveTheme(themeProp ?? inheritedAppearance.theme, "fill");
|
|
36
36
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
37
|
-
const locale = useContext(ConfigContext)?.locale ||
|
|
37
|
+
const locale = useContext(ConfigContext)?.locale || DEFAULT_LOCALE;
|
|
38
38
|
const [innerVisible, setInnerVisible] = useValue(openProp, (next) => next ?? false);
|
|
39
39
|
const visible = innerVisible;
|
|
40
40
|
const setVisible = (next_0) => {
|
|
@@ -99,17 +99,14 @@ var Select = ({ placeholder, size: sizeProp, placement = "bottom-left", width, m
|
|
|
99
99
|
const optionHeight = optionEl.offsetHeight;
|
|
100
100
|
containerEl.scrollTop = optionTop - containerEl.clientHeight / 2 + optionHeight / 2;
|
|
101
101
|
};
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const isChecked = (val_1) => {
|
|
111
|
-
if (multiple) return currentValue.indexOf(val_1) >= 0;
|
|
112
|
-
else return !isEmpty(currentValue) && currentValue[0] === val_1;
|
|
102
|
+
const [selectedLabels, setSelectedLabels] = useState(() => /* @__PURE__ */ new Map());
|
|
103
|
+
const lookup = new Map((loading && options ? options : optionsData).map((item) => [item.value, item.label]));
|
|
104
|
+
const nextLabels = new Map(currentValue.map((val_0) => [val_0, lookup.get(val_0) ?? selectedLabels.get(val_0) ?? val_0]));
|
|
105
|
+
if (!isSameLabelMap(nextLabels, selectedLabels)) setSelectedLabels(nextLabels);
|
|
106
|
+
const labelText = currentValue.map((val_1) => nextLabels.get(val_1));
|
|
107
|
+
const isChecked = (val_2) => {
|
|
108
|
+
if (multiple) return currentValue.indexOf(val_2) >= 0;
|
|
109
|
+
else return !isEmpty(currentValue) && currentValue[0] === val_2;
|
|
113
110
|
};
|
|
114
111
|
function clearQuery() {
|
|
115
112
|
setActiveIndex(-1);
|
|
@@ -130,14 +127,14 @@ var Select = ({ placeholder, size: sizeProp, placement = "bottom-left", width, m
|
|
|
130
127
|
};
|
|
131
128
|
function handleSelect(item_0) {
|
|
132
129
|
if (disabled || readOnly) return;
|
|
133
|
-
const { value:
|
|
130
|
+
const { value: val_3, label: lbl } = item_0;
|
|
134
131
|
let selected = true;
|
|
135
132
|
let nextValue = [...currentValue];
|
|
136
133
|
if (multiple) {
|
|
137
|
-
if (nextValue.indexOf(
|
|
134
|
+
if (nextValue.indexOf(val_3) >= 0) {
|
|
138
135
|
selected = false;
|
|
139
|
-
nextValue = nextValue.filter((v) => v !==
|
|
140
|
-
} else nextValue.push(
|
|
136
|
+
nextValue = nextValue.filter((v) => v !== val_3);
|
|
137
|
+
} else nextValue.push(val_3);
|
|
141
138
|
setTimeout(updatePosition, 0);
|
|
142
139
|
if (searchable) {
|
|
143
140
|
if (queryInputRef.current) {
|
|
@@ -145,11 +142,11 @@ var Select = ({ placeholder, size: sizeProp, placement = "bottom-left", width, m
|
|
|
145
142
|
queryInputRef.current.style.width = "";
|
|
146
143
|
}
|
|
147
144
|
setQueryKey("");
|
|
148
|
-
setActiveIndex(optionsData.findIndex((option_0) => option_0.value ===
|
|
145
|
+
setActiveIndex(optionsData.findIndex((option_0) => option_0.value === val_3));
|
|
149
146
|
showQuery();
|
|
150
147
|
}
|
|
151
148
|
} else {
|
|
152
|
-
nextValue = [
|
|
149
|
+
nextValue = [val_3];
|
|
153
150
|
setVisible(false);
|
|
154
151
|
onOpenChange?.(false);
|
|
155
152
|
clearQuery();
|
|
@@ -159,7 +156,7 @@ var Select = ({ placeholder, size: sizeProp, placement = "bottom-left", width, m
|
|
|
159
156
|
const outputValue = multiple ? nextValue : nextValue[0];
|
|
160
157
|
onChange?.(outputValue);
|
|
161
158
|
onSelect?.({
|
|
162
|
-
value:
|
|
159
|
+
value: val_3,
|
|
163
160
|
label: lbl,
|
|
164
161
|
selected
|
|
165
162
|
});
|
|
@@ -225,15 +222,15 @@ var Select = ({ placeholder, size: sizeProp, placement = "bottom-left", width, m
|
|
|
225
222
|
return filterable && key.trim() !== "" ? optionsData.filter((item_1) => String(item_1.label).toLowerCase().includes(key.toLowerCase())) : optionsData;
|
|
226
223
|
}
|
|
227
224
|
useLayoutEffect(() => {
|
|
228
|
-
if (
|
|
229
|
-
if (queryInputMirrorRef.current && queryInputRef.current) {
|
|
225
|
+
if (queryInputVisible && queryInputMirrorRef.current && queryInputRef.current) {
|
|
230
226
|
const availableWidth = Math.max((refSelection.current?.clientWidth || 0) - 40, 7);
|
|
231
227
|
const contentWidth = Math.max(queryInputMirrorRef.current.offsetWidth + 2, 7);
|
|
232
228
|
queryInputRef.current.style.width = `${Math.min(contentWidth, availableWidth)}px`;
|
|
233
229
|
}
|
|
234
|
-
updatePosition();
|
|
230
|
+
if (visible) updatePosition();
|
|
235
231
|
}, [
|
|
236
232
|
visible,
|
|
233
|
+
queryInputVisible,
|
|
237
234
|
queryKey,
|
|
238
235
|
optionsData,
|
|
239
236
|
loading,
|
|
@@ -322,17 +319,17 @@ var Select = ({ placeholder, size: sizeProp, placement = "bottom-left", width, m
|
|
|
322
319
|
} else if (e_1.key === "Tab") closeDropdown();
|
|
323
320
|
};
|
|
324
321
|
const renderOption = (item_3, index_3) => {
|
|
325
|
-
const { label: label_0, value:
|
|
322
|
+
const { label: label_0, value: val_4, disabled: optionDisabled } = item_3;
|
|
326
323
|
return /* @__PURE__ */ jsx(Option, {
|
|
327
324
|
onSelect: handleSelect,
|
|
328
325
|
onMouseEnter: optionDisabled ? void 0 : () => onMouseenter(index_3),
|
|
329
326
|
active: activeIndex === index_3,
|
|
330
|
-
value:
|
|
327
|
+
value: val_4,
|
|
331
328
|
label: label_0,
|
|
332
329
|
disabled: optionDisabled,
|
|
333
|
-
checked: isChecked(
|
|
330
|
+
checked: isChecked(val_4),
|
|
334
331
|
multiple
|
|
335
|
-
}, `${
|
|
332
|
+
}, `${val_4}-${label_0}`);
|
|
336
333
|
};
|
|
337
334
|
const queryKeydown = (e_2) => {
|
|
338
335
|
if (disabled || readOnly) return;
|
|
@@ -390,7 +387,7 @@ var Select = ({ placeholder, size: sizeProp, placement = "bottom-left", width, m
|
|
|
390
387
|
prefixCls: "k-select-dropdown",
|
|
391
388
|
transitionName: "k-select",
|
|
392
389
|
matchTriggerWidth: extendWidth,
|
|
393
|
-
destroyOnClose
|
|
390
|
+
destroyOnClose,
|
|
394
391
|
onOpenChange: (next_2) => {
|
|
395
392
|
if (!next_2) closeDropdown();
|
|
396
393
|
},
|
|
@@ -461,10 +458,10 @@ var Select = ({ placeholder, size: sizeProp, placement = "bottom-left", width, m
|
|
|
461
458
|
"k-select-readonly": readOnly,
|
|
462
459
|
"k-select-block": block,
|
|
463
460
|
"k-select-opened": visible,
|
|
464
|
-
"k-select-borderless": bordered === false
|
|
461
|
+
"k-select-borderless": bordered === false,
|
|
462
|
+
[`k-select-${theme}`]: true,
|
|
465
463
|
"k-select-lg": size === "large",
|
|
466
464
|
"k-select-sm": size === "small",
|
|
467
|
-
"k-select-fill": theme === "fill",
|
|
468
465
|
"k-select-has-icon": icon,
|
|
469
466
|
"k-select-circle": shape === "circle" && !multiple,
|
|
470
467
|
"k-select-square": shape === "square",
|
package/es/skeleton/skeleton.js
CHANGED
package/es/slider/index.js
CHANGED
package/es/slider/thumb.js
CHANGED
package/es/space/index.js
CHANGED
package/es/spin/index.js
CHANGED
package/es/splitter/splitter.js
CHANGED
package/es/stat-card/countup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.2.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
@@ -79,7 +79,7 @@ function CountUpNumber(t0) {
|
|
|
79
79
|
t9 = () => {
|
|
80
80
|
if (!elementRef.current) return;
|
|
81
81
|
const observeVisibility = autoAnimate && typeof IntersectionObserver !== "undefined";
|
|
82
|
-
const safeDuration = Number.isFinite(duration) ? Math.max(0, duration)
|
|
82
|
+
const safeDuration = typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches || !Number.isFinite(duration) ? 0 : Math.max(0, duration);
|
|
83
83
|
const options = {
|
|
84
84
|
duration: type === "rollup" ? 0 : safeDuration,
|
|
85
85
|
separator,
|
package/es/stat-card/rollup.js
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.2.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
6
6
|
* Author: Qiu / https://chuchur.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { hasRenderableContent } from "../utils/react-node.js";
|
|
10
|
+
import { normalizeSurfaceShape, resolvePaintedTheme, useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
11
|
import StatNumber from "./stat-number.js";
|
|
12
|
+
import { statItemKey } from "./utils/stat-item-key.js";
|
|
11
13
|
import clsx from "clsx";
|
|
12
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
15
|
//#region components/stat-card/stat-card.tsx
|
|
16
|
+
var PAINTED_THEMES = [
|
|
17
|
+
"fill",
|
|
18
|
+
"outline",
|
|
19
|
+
"plain",
|
|
20
|
+
"solid",
|
|
21
|
+
"dashed"
|
|
22
|
+
];
|
|
14
23
|
function StatCard({ title, precision = 0, items = [], separator, statNumberType = "countup", reverse = false, bordered = false, theme: themeProp, shape: shapeProp, size: sizeProp, prefix, suffix, className, ...rest }) {
|
|
15
24
|
const inheritedAppearance = useConfigAppearance();
|
|
16
|
-
const theme = themeProp ?? inheritedAppearance.theme ?? "fill";
|
|
25
|
+
const theme = resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? "fill";
|
|
17
26
|
const shape = normalizeSurfaceShape(shapeProp ?? inheritedAppearance.shape ?? "round");
|
|
18
27
|
const size = sizeProp ?? inheritedAppearance.size ?? "medium";
|
|
19
28
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -24,7 +33,7 @@ function StatCard({ title, precision = 0, items = [], separator, statNumberType
|
|
|
24
33
|
[`k-stat-card-${shape}`]: shape,
|
|
25
34
|
[`k-stat-card-${size}`]: size
|
|
26
35
|
}, className),
|
|
27
|
-
children: [title
|
|
36
|
+
children: [hasRenderableContent(title) && /* @__PURE__ */ jsx("div", {
|
|
28
37
|
className: "k-stat-card-title",
|
|
29
38
|
children: title
|
|
30
39
|
}), /* @__PURE__ */ jsx("div", {
|
|
@@ -46,16 +55,16 @@ function StatCard({ title, precision = 0, items = [], separator, statNumberType
|
|
|
46
55
|
suffix: item.suffix ?? suffix
|
|
47
56
|
})
|
|
48
57
|
}),
|
|
49
|
-
item.desc
|
|
58
|
+
hasRenderableContent(item.desc) && /* @__PURE__ */ jsx("div", {
|
|
50
59
|
className: "k-stat-card-item-desc",
|
|
51
60
|
children: item.desc
|
|
52
61
|
}),
|
|
53
|
-
item.trend
|
|
62
|
+
hasRenderableContent(item.trend) && /* @__PURE__ */ jsx("div", {
|
|
54
63
|
className: clsx("k-stat-card-item-trend", `k-stat-card-item-trend-${item.trendStatus || "default"}`),
|
|
55
64
|
children: item.trend
|
|
56
65
|
})
|
|
57
66
|
]
|
|
58
|
-
},
|
|
67
|
+
}, statItemKey(item, index)))
|
|
59
68
|
})]
|
|
60
69
|
});
|
|
61
70
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.2.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 { hasRenderableContent } from "../utils/react-node.js";
|
|
9
10
|
import CountUpNumber from "./countup.js";
|
|
10
11
|
import { c } from "react/compiler-runtime";
|
|
11
12
|
import clsx from "clsx";
|
|
@@ -64,7 +65,7 @@ function StatNumber(t0) {
|
|
|
64
65
|
} else t6 = $[13];
|
|
65
66
|
let t7;
|
|
66
67
|
if ($[14] !== prefix) {
|
|
67
|
-
t7 = prefix
|
|
68
|
+
t7 = hasRenderableContent(prefix) && /* @__PURE__ */ jsx("span", {
|
|
68
69
|
className: "k-stat-number-prefix",
|
|
69
70
|
children: prefix
|
|
70
71
|
});
|
|
@@ -94,7 +95,7 @@ function StatNumber(t0) {
|
|
|
94
95
|
} else t9 = $[23];
|
|
95
96
|
let t10;
|
|
96
97
|
if ($[24] !== suffix) {
|
|
97
|
-
t10 = suffix
|
|
98
|
+
t10 = hasRenderableContent(suffix) && /* @__PURE__ */ jsx("span", {
|
|
98
99
|
className: "k-stat-number-suffix",
|
|
99
100
|
children: suffix
|
|
100
101
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* react-kui v3.2.0
|
|
3
|
+
* Copyright 2017-present, kui-react.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Homepage: https://react.k-ui.cn
|
|
6
|
+
* Author: Qiu / https://chuchur.com
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
//#region components/stat-card/utils/stat-item-key.ts
|
|
10
|
+
/**
|
|
11
|
+
* Identity of one `items` entry across renders.
|
|
12
|
+
*
|
|
13
|
+
* The `kui-item-` prefix keeps a keyless item's position out of the namespace of
|
|
14
|
+
* caller-supplied keys: without it `[{key: 1}, {}]` hands two different metrics the
|
|
15
|
+
* same key, which lets the diffing move a CountUp instance from one item to the
|
|
16
|
+
* other. This rule and these strings are identical in both builds.
|
|
17
|
+
*/
|
|
18
|
+
function statItemKey(item, index) {
|
|
19
|
+
return String(item.key ?? `kui-item-${index}`);
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { statItemKey };
|
package/es/steps/index.js
CHANGED
package/es/switch/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.2.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
6
6
|
* Author: Qiu / https://chuchur.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { useFormAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import { Loading } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
11
11
|
import Icon from "../icon/index.js";
|
|
12
12
|
import { useValue } from "../utils/use-value.js";
|
|
@@ -17,7 +17,7 @@ import "react";
|
|
|
17
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
18
|
//#region components/switch/index.tsx
|
|
19
19
|
var Switch = ({ checked, valueType = "boolean", type, color, disabled = false, readOnly = false, loading = false, size: sizeProp, shape: shapeProp, trueText, falseText, checkedChildren, unCheckedChildren, onChange, className = "", style, onClick, ...rest }) => {
|
|
20
|
-
const inheritedAppearance =
|
|
20
|
+
const inheritedAppearance = useFormAppearance();
|
|
21
21
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
22
22
|
const shape = shapeProp ?? inheritedAppearance.shape ?? "round";
|
|
23
23
|
const [innerChecked, setInnerChecked] = useValue(checked, (next) => next ?? false);
|