react-kui 3.1.2 → 3.2.1
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 +918 -324
- 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 +112 -92
- package/es/select/option.js +1 -1
- package/es/select/select.js +29 -29
- 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 +556 -207
- package/es/table/utils.js +140 -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/segmented/index.d.cts +2 -1
- package/types/segmented/index.d.ts +2 -1
- 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/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.1
|
|
2
|
+
* react-kui v3.2.1
|
|
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.1
|
|
2
|
+
* react-kui v3.2.1
|
|
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.1
|
|
2
|
+
* react-kui v3.2.1
|
|
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.1
|
|
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.1
|
|
2
|
+
* react-kui v3.2.1
|
|
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);
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.1
|
|
2
|
+
* react-kui v3.2.1
|
|
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";
|
|
9
10
|
import Button from "../button/button.js";
|
|
10
11
|
import checkbox_group_default from "../checkbox/checkbox-group.js";
|
|
11
12
|
import Poptip from "../poptip/index.js";
|
|
12
13
|
import { c } from "react/compiler-runtime";
|
|
13
|
-
import { useState } from "react";
|
|
14
|
+
import { useContext, useState } from "react";
|
|
14
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
16
|
//#region components/table/column-setting.tsx
|
|
16
17
|
/**
|
|
@@ -18,162 +19,150 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
18
19
|
* 与 kui-vue 一致,使用 CheckboxGroup 简单列表
|
|
19
20
|
*/
|
|
20
21
|
function TableColumnSetting(t0) {
|
|
21
|
-
const $ = c(
|
|
22
|
-
const { columns: t1,
|
|
22
|
+
const $ = c(33);
|
|
23
|
+
const { columns: t1, hiddenKeys: t2, onHiddenKeysChange, disabledKeys: t3, title: titleProp, resetText: resetTextProp, size, showReset: t4, children } = t0;
|
|
23
24
|
const columns = t1 === void 0 ? [] : t1;
|
|
24
|
-
let
|
|
25
|
+
let t5;
|
|
25
26
|
if ($[0] !== t2) {
|
|
26
|
-
|
|
27
|
+
t5 = t2 === void 0 ? [] : t2;
|
|
27
28
|
$[0] = t2;
|
|
28
|
-
$[1] =
|
|
29
|
-
} else
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
t8 = t3 === void 0 ? [] : t3;
|
|
34
|
-
$[2] = t3;
|
|
35
|
-
$[3] = t8;
|
|
36
|
-
} else t8 = $[3];
|
|
37
|
-
const disabledKeys = t8;
|
|
38
|
-
const title = t4 === void 0 ? "Column settings" : t4;
|
|
39
|
-
const resetText = t5 === void 0 ? "Reset" : t5;
|
|
40
|
-
const showReset = t6 === void 0 ? true : t6;
|
|
29
|
+
$[1] = t5;
|
|
30
|
+
} else t5 = $[1];
|
|
31
|
+
const hiddenKeys = t5;
|
|
32
|
+
const disabledKeys = t3 === void 0 ? [] : t3;
|
|
33
|
+
const showReset = t4 === void 0 ? true : t4;
|
|
41
34
|
const [open, setOpen] = useState(false);
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
let
|
|
51
|
-
if ($[
|
|
52
|
-
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
} else
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
t11 = (values) => {
|
|
35
|
+
const locale = useContext(ConfigContext)?.locale || DEFAULT_LOCALE;
|
|
36
|
+
const title = titleProp || locale?.k?.table?.columnSettings || "Column settings";
|
|
37
|
+
const resetText = resetTextProp || locale?.k?.table?.resetColumns || "Reset";
|
|
38
|
+
const leafColumns = [];
|
|
39
|
+
const collectLeaves = (items) => items.forEach((column) => column.children?.length ? collectLeaves(column.children) : leafColumns.push(column));
|
|
40
|
+
collectLeaves(columns);
|
|
41
|
+
const configurableColumns = leafColumns.filter((col) => !disabledKeys.includes(col.key));
|
|
42
|
+
const visibleKeys = configurableColumns.map(_temp).filter((key) => !hiddenKeys.includes(key));
|
|
43
|
+
let t6;
|
|
44
|
+
if ($[2] !== configurableColumns) {
|
|
45
|
+
t6 = configurableColumns.map(_temp2);
|
|
46
|
+
$[2] = configurableColumns;
|
|
47
|
+
$[3] = t6;
|
|
48
|
+
} else t6 = $[3];
|
|
49
|
+
const options = t6;
|
|
50
|
+
let t7;
|
|
51
|
+
if ($[4] !== configurableColumns || $[5] !== hiddenKeys || $[6] !== onHiddenKeysChange) {
|
|
52
|
+
t7 = (values) => {
|
|
61
53
|
const selected = new Set(values.map(String));
|
|
62
|
-
const configurable = new Set(configurableColumns.map(
|
|
63
|
-
const next = [...
|
|
64
|
-
|
|
54
|
+
const configurable = new Set(configurableColumns.map(_temp3));
|
|
55
|
+
const next = [...hiddenKeys.filter((key_0) => !configurable.has(String(key_0))), ...configurableColumns.map(_temp4).filter((key_1) => !selected.has(String(key_1)))];
|
|
56
|
+
onHiddenKeysChange?.(next);
|
|
65
57
|
};
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
69
|
-
$[
|
|
70
|
-
} else
|
|
71
|
-
const handleUpdate =
|
|
72
|
-
let
|
|
73
|
-
if ($[
|
|
74
|
-
|
|
75
|
-
handleUpdate(configurableColumns.map(
|
|
58
|
+
$[4] = configurableColumns;
|
|
59
|
+
$[5] = hiddenKeys;
|
|
60
|
+
$[6] = onHiddenKeysChange;
|
|
61
|
+
$[7] = t7;
|
|
62
|
+
} else t7 = $[7];
|
|
63
|
+
const handleUpdate = t7;
|
|
64
|
+
let t8;
|
|
65
|
+
if ($[8] !== configurableColumns || $[9] !== handleUpdate) {
|
|
66
|
+
t8 = () => {
|
|
67
|
+
handleUpdate(configurableColumns.map(_temp5));
|
|
76
68
|
};
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
} else
|
|
81
|
-
const handleReset =
|
|
82
|
-
let
|
|
83
|
-
if ($[
|
|
84
|
-
|
|
69
|
+
$[8] = configurableColumns;
|
|
70
|
+
$[9] = handleUpdate;
|
|
71
|
+
$[10] = t8;
|
|
72
|
+
} else t8 = $[10];
|
|
73
|
+
const handleReset = t8;
|
|
74
|
+
let t9;
|
|
75
|
+
if ($[11] !== handleUpdate || $[12] !== options || $[13] !== size || $[14] !== visibleKeys) {
|
|
76
|
+
t9 = /* @__PURE__ */ jsx(checkbox_group_default, {
|
|
85
77
|
value: visibleKeys,
|
|
86
78
|
options,
|
|
87
79
|
direction: "vertical",
|
|
88
80
|
size,
|
|
89
81
|
onChange: handleUpdate
|
|
90
82
|
});
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
} else
|
|
97
|
-
let
|
|
98
|
-
if ($[
|
|
99
|
-
|
|
83
|
+
$[11] = handleUpdate;
|
|
84
|
+
$[12] = options;
|
|
85
|
+
$[13] = size;
|
|
86
|
+
$[14] = visibleKeys;
|
|
87
|
+
$[15] = t9;
|
|
88
|
+
} else t9 = $[15];
|
|
89
|
+
let t10;
|
|
90
|
+
if ($[16] !== handleReset || $[17] !== resetText || $[18] !== showReset) {
|
|
91
|
+
t10 = showReset && /* @__PURE__ */ jsx(Button, {
|
|
100
92
|
className: "k-table-column-setting-reset",
|
|
101
93
|
theme: "plain",
|
|
102
94
|
size: "small",
|
|
103
95
|
onClick: handleReset,
|
|
104
96
|
children: resetText
|
|
105
97
|
});
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
} else
|
|
111
|
-
let
|
|
112
|
-
if ($[
|
|
113
|
-
|
|
98
|
+
$[16] = handleReset;
|
|
99
|
+
$[17] = resetText;
|
|
100
|
+
$[18] = showReset;
|
|
101
|
+
$[19] = t10;
|
|
102
|
+
} else t10 = $[19];
|
|
103
|
+
let t11;
|
|
104
|
+
if ($[20] !== t10 || $[21] !== t9) {
|
|
105
|
+
t11 = /* @__PURE__ */ jsxs("div", {
|
|
114
106
|
className: "k-table-column-setting",
|
|
115
|
-
onClick:
|
|
116
|
-
children: [
|
|
107
|
+
onClick: _temp6,
|
|
108
|
+
children: [t9, t10]
|
|
117
109
|
});
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
} else
|
|
122
|
-
const content =
|
|
123
|
-
let
|
|
124
|
-
if ($[
|
|
125
|
-
|
|
110
|
+
$[20] = t10;
|
|
111
|
+
$[21] = t9;
|
|
112
|
+
$[22] = t11;
|
|
113
|
+
} else t11 = $[22];
|
|
114
|
+
const content = t11;
|
|
115
|
+
let t12;
|
|
116
|
+
if ($[23] !== children || $[24] !== size || $[25] !== title) {
|
|
117
|
+
t12 = children ?? /* @__PURE__ */ jsx(Button, {
|
|
126
118
|
size,
|
|
127
119
|
children: title
|
|
128
120
|
});
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
} else
|
|
134
|
-
let
|
|
135
|
-
if ($[
|
|
136
|
-
|
|
121
|
+
$[23] = children;
|
|
122
|
+
$[24] = size;
|
|
123
|
+
$[25] = title;
|
|
124
|
+
$[26] = t12;
|
|
125
|
+
} else t12 = $[26];
|
|
126
|
+
let t13;
|
|
127
|
+
if ($[27] !== content || $[28] !== open || $[29] !== setOpen || $[30] !== t12 || $[31] !== title) {
|
|
128
|
+
t13 = /* @__PURE__ */ jsx(Poptip, {
|
|
137
129
|
trigger: "click",
|
|
138
130
|
placement: "bottom-right",
|
|
139
131
|
title,
|
|
140
132
|
content,
|
|
141
133
|
open,
|
|
142
134
|
onOpenChange: setOpen,
|
|
143
|
-
children:
|
|
135
|
+
children: t12
|
|
144
136
|
});
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
} else
|
|
152
|
-
return
|
|
137
|
+
$[27] = content;
|
|
138
|
+
$[28] = open;
|
|
139
|
+
$[29] = setOpen;
|
|
140
|
+
$[30] = t12;
|
|
141
|
+
$[31] = title;
|
|
142
|
+
$[32] = t13;
|
|
143
|
+
} else t13 = $[32];
|
|
144
|
+
return t13;
|
|
153
145
|
}
|
|
154
|
-
function
|
|
146
|
+
function _temp6(e) {
|
|
155
147
|
return e.stopPropagation();
|
|
156
148
|
}
|
|
157
|
-
function _temp6(col_5) {
|
|
158
|
-
return col_5.key;
|
|
159
|
-
}
|
|
160
149
|
function _temp5(col_4) {
|
|
161
150
|
return col_4.key;
|
|
162
151
|
}
|
|
163
152
|
function _temp4(col_3) {
|
|
164
|
-
return
|
|
153
|
+
return col_3.key;
|
|
165
154
|
}
|
|
166
155
|
function _temp3(col_2) {
|
|
167
|
-
return
|
|
168
|
-
label: String(col_2.title),
|
|
169
|
-
value: col_2.key
|
|
170
|
-
};
|
|
156
|
+
return String(col_2.key);
|
|
171
157
|
}
|
|
172
158
|
function _temp2(col_1) {
|
|
173
|
-
return
|
|
159
|
+
return {
|
|
160
|
+
label: String(col_1.title),
|
|
161
|
+
value: col_1.key
|
|
162
|
+
};
|
|
174
163
|
}
|
|
175
|
-
function _temp(
|
|
176
|
-
return
|
|
164
|
+
function _temp(col_0) {
|
|
165
|
+
return col_0.key;
|
|
177
166
|
}
|
|
178
167
|
//#endregion
|
|
179
168
|
export { TableColumnSetting };
|