react-kui 3.1.2 → 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 +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 +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/color-picker/mode.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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 { isColor } from "../utils/color.js";
|
|
9
10
|
import input_default from "../input/input.js";
|
|
10
11
|
import input_number_default from "../input-number/index.js";
|
|
11
|
-
import { isColor } from "../utils/color.js";
|
|
12
12
|
import select_default from "../select/select.js";
|
|
13
13
|
import { c } from "react/compiler-runtime";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/es/color-picker/paint.js
CHANGED
package/es/components.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
|
|
@@ -20,7 +20,7 @@ import Avatar from "./avatar/avatar.js";
|
|
|
20
20
|
import AvatarGroup from "./avatar/avatar-group.js";
|
|
21
21
|
import Card, { CardMeta } from "./card/index.js";
|
|
22
22
|
import ListPanel from "./list-panel/index.js";
|
|
23
|
-
import
|
|
23
|
+
import input_group_default from "./input/input-group.js";
|
|
24
24
|
import input_default from "./input/input.js";
|
|
25
25
|
import textarea_default from "./input/textarea.js";
|
|
26
26
|
import auto_complete_default from "./auto-complete/index.js";
|
|
@@ -177,7 +177,7 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
177
177
|
Icon: () => Icon,
|
|
178
178
|
ImageGroup: () => ImageGroup,
|
|
179
179
|
Input: () => input_default,
|
|
180
|
-
InputGroup: () =>
|
|
180
|
+
InputGroup: () => input_group_default,
|
|
181
181
|
InputNumber: () => input_number_default,
|
|
182
182
|
InputOTP: () => input_otp_default,
|
|
183
183
|
InputTag: () => input_tag_default,
|
|
@@ -259,4 +259,4 @@ var components_exports = /* @__PURE__ */ __exportAll({
|
|
|
259
259
|
theme: () => Theme
|
|
260
260
|
});
|
|
261
261
|
//#endregion
|
|
262
|
-
export { Affix, Alert, Anchor, AnchorLink, auto_complete_default as AutoComplete, Avatar, AvatarGroup, BackTop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, Calendar, Card, CardMeta, Carousel, CarouselItem, cascader_default as Cascader, check_card_default as CheckCard, check_card_group_default as CheckCardGroup, checkbox_default as Checkbox, checkbox_group_default as CheckboxGroup, Col, Collapse, CollapsePanel, color_picker_default as ColorPicker, ColorPickerPanel, ConfigProvider, Content, date_picker_default as DatePicker, DatePickerPanel, Descriptions, DescriptionsItem, Divider, Drawer, Dropdown, DropdownButton, Empty, FeatureCard, FeedbackPanel, FlameWrap, Flex, Footer, Form, FormItem, Grid, GridItem, Header, Icon, ImageGroup, input_default as Input, InputGroup, input_number_default as InputNumber, input_otp_default as InputOTP, input_tag_default as InputTag, KImage, Kanban, Layout, ListPanel, mentions_default as Mentions, Menu, MenuDivider, MenuGroup, MenuItem, MessagePanel, Modal, ModalPanel, NoticePanel, Option, Page, PageHeader, Popconfirm, PopconfirmPanel, Poptip, PoptipPanel, Popup, Progress, QRCode, radio_default as Radio, radio_button_default as RadioButton, radio_group_default as RadioGroup, rate_default as Rate, Result, Ripple, Row, segmented_default as Segmented, select_default as Select, Sider, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonImage, SkeletonText, slider_default as Slider, Space, Spin, Splitter, SplitterPanel, StatCard, StatNumber, Step, Steps, SubMenu, switch_default as Switch, TabPanel, Table, TableColumnSetting, Tabs, Tag, textarea_default as TextArea, TimeLine, TimeLineItem, Tooltip, TooltipPanel, Tour, transfer_default as Transfer, Tree, tree_select_default as TreeSelect, Typography, TypographyParagraph, TypographyText, TypographyTitle, upload_default as Upload, VirtualList, Watermark, components_exports, getVirtualRange, loading, message, modal, notice, Theme as theme };
|
|
262
|
+
export { Affix, Alert, Anchor, AnchorLink, auto_complete_default as AutoComplete, Avatar, AvatarGroup, BackTop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, Calendar, Card, CardMeta, Carousel, CarouselItem, cascader_default as Cascader, check_card_default as CheckCard, check_card_group_default as CheckCardGroup, checkbox_default as Checkbox, checkbox_group_default as CheckboxGroup, Col, Collapse, CollapsePanel, color_picker_default as ColorPicker, ColorPickerPanel, ConfigProvider, Content, date_picker_default as DatePicker, DatePickerPanel, Descriptions, DescriptionsItem, Divider, Drawer, Dropdown, DropdownButton, Empty, FeatureCard, FeedbackPanel, FlameWrap, Flex, Footer, Form, FormItem, Grid, GridItem, Header, Icon, ImageGroup, input_default as Input, input_group_default as InputGroup, input_number_default as InputNumber, input_otp_default as InputOTP, input_tag_default as InputTag, KImage, Kanban, Layout, ListPanel, mentions_default as Mentions, Menu, MenuDivider, MenuGroup, MenuItem, MessagePanel, Modal, ModalPanel, NoticePanel, Option, Page, PageHeader, Popconfirm, PopconfirmPanel, Poptip, PoptipPanel, Popup, Progress, QRCode, radio_default as Radio, radio_button_default as RadioButton, radio_group_default as RadioGroup, rate_default as Rate, Result, Ripple, Row, segmented_default as Segmented, select_default as Select, Sider, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonImage, SkeletonText, slider_default as Slider, Space, Spin, Splitter, SplitterPanel, StatCard, StatNumber, Step, Steps, SubMenu, switch_default as Switch, TabPanel, Table, TableColumnSetting, Tabs, Tag, textarea_default as TextArea, TimeLine, TimeLineItem, Tooltip, TooltipPanel, Tour, transfer_default as Transfer, Tree, tree_select_default as TreeSelect, Typography, TypographyParagraph, TypographyText, TypographyTitle, upload_default as Upload, VirtualList, Watermark, components_exports, getVirtualRange, loading, message, modal, notice, Theme as theme };
|
|
@@ -1,13 +1,26 @@
|
|
|
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 en_default from "../locale/en.js";
|
|
9
10
|
import { createContext } from "react";
|
|
10
11
|
//#region components/config/config-context.ts
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* 没有 ConfigProvider 兜底时用的语言。
|
|
14
|
+
* 默认值只有这一个出处,组件里不许再各自写 `|| zhCN` 之类的兜底;要改库级默认就改这里。
|
|
15
|
+
* 选 `en` 与文档口径一致,也和 dayjs 那侧对得上——中文语言包没注册时月份和星期本来就是英文。
|
|
16
|
+
*/
|
|
17
|
+
var DEFAULT_LOCALE = en_default;
|
|
18
|
+
/**
|
|
19
|
+
* 没有 ConfigProvider 时的默认值。
|
|
20
|
+
* 导出它不是为了让人用,而是让 ConfigProvider 能凭引用认出自己是不是最外层:
|
|
21
|
+
* useContext 拿到这个对象就说明上面没有别的 Provider,这时才需要把配置登记给命令式 API。
|
|
22
|
+
*/
|
|
23
|
+
var EMPTY_CONFIG = { locale: null };
|
|
24
|
+
var ConfigContext = createContext(EMPTY_CONFIG);
|
|
12
25
|
//#endregion
|
|
13
|
-
export { ConfigContext };
|
|
26
|
+
export { ConfigContext, DEFAULT_LOCALE, EMPTY_CONFIG };
|
package/es/config/context.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
|
|
@@ -22,5 +22,32 @@ var getMousePoint = () => {
|
|
|
22
22
|
y: 0
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* 命令式 API(modal.info(...) 这类)是 createRoot 挂出去的独立 React 树,够不着 ConfigProvider,
|
|
27
|
+
* 于是最外层 ConfigProvider 把自己的配置登记到这里,命令式弹窗渲染时再取一次。
|
|
28
|
+
* Vue 侧做的是同一件事,那边用的是 appContext 栈(见 kui-vue/components/config/context.ts)。
|
|
29
|
+
* 用栈而不是单个变量:页面上可能有两个互不相干的根,后挂载的那个才是命令式 API 默认服务的对象。
|
|
30
|
+
*/
|
|
31
|
+
var configs = [];
|
|
32
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
33
|
+
var notify = () => listeners.forEach((listener) => listener());
|
|
34
|
+
var pushConfig = (config) => {
|
|
35
|
+
configs.push(config);
|
|
36
|
+
notify();
|
|
37
|
+
return () => {
|
|
38
|
+
const index = configs.lastIndexOf(config);
|
|
39
|
+
if (index >= 0) configs.splice(index, 1);
|
|
40
|
+
notify();
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/** 当前该给命令式弹窗用的配置;页面上没有 ConfigProvider 时返回 null。 */
|
|
44
|
+
var currentConfig = () => configs.at(-1) ?? null;
|
|
45
|
+
/** 配置换了要通知活着的命令式弹窗重渲染,否则它们会停在打开那一刻的语言/尺寸上。 */
|
|
46
|
+
var subscribeConfig = (listener) => {
|
|
47
|
+
listeners.add(listener);
|
|
48
|
+
return () => {
|
|
49
|
+
listeners.delete(listener);
|
|
50
|
+
};
|
|
51
|
+
};
|
|
25
52
|
//#endregion
|
|
26
|
-
export { getMousePoint, recordMousePoint };
|
|
53
|
+
export { currentConfig, getMousePoint, pushConfig, recordMousePoint, subscribeConfig };
|
package/es/config/index.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
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 { ConfigContext } from "./config-context.js";
|
|
9
|
+
import { ConfigContext, EMPTY_CONFIG } from "./config-context.js";
|
|
10
|
+
import { pushConfig } from "./context.js";
|
|
10
11
|
import { c } from "react/compiler-runtime";
|
|
11
|
-
import { useContext } from "react";
|
|
12
|
+
import { useContext, useEffect } from "react";
|
|
12
13
|
import { jsx } from "react/jsx-runtime";
|
|
13
14
|
//#region components/config/index.tsx
|
|
14
15
|
var ConfigProvider = (t0) => {
|
|
15
|
-
const $ = c(
|
|
16
|
+
const $ = c(13);
|
|
16
17
|
const { locale, getPopupContainer, size, shape, theme, children } = t0;
|
|
17
18
|
const parentConfig = useContext(ConfigContext);
|
|
19
|
+
const isRootProvider = parentConfig === EMPTY_CONFIG;
|
|
18
20
|
const t1 = locale ?? parentConfig.locale;
|
|
19
21
|
const t2 = getPopupContainer ?? parentConfig.getPopupContainer;
|
|
20
22
|
const t3 = size ?? parentConfig.size;
|
|
@@ -36,17 +38,34 @@ var ConfigProvider = (t0) => {
|
|
|
36
38
|
$[4] = t5;
|
|
37
39
|
$[5] = t6;
|
|
38
40
|
} else t6 = $[5];
|
|
41
|
+
const config = t6;
|
|
39
42
|
let t7;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
let t8;
|
|
44
|
+
if ($[6] !== config || $[7] !== isRootProvider) {
|
|
45
|
+
t7 = () => {
|
|
46
|
+
if (isRootProvider) return pushConfig(config);
|
|
47
|
+
};
|
|
48
|
+
t8 = [isRootProvider, config];
|
|
49
|
+
$[6] = config;
|
|
50
|
+
$[7] = isRootProvider;
|
|
51
|
+
$[8] = t7;
|
|
52
|
+
$[9] = t8;
|
|
53
|
+
} else {
|
|
54
|
+
t7 = $[8];
|
|
55
|
+
t8 = $[9];
|
|
56
|
+
}
|
|
57
|
+
useEffect(t7, t8);
|
|
58
|
+
let t9;
|
|
59
|
+
if ($[10] !== children || $[11] !== config) {
|
|
60
|
+
t9 = /* @__PURE__ */ jsx(ConfigContext.Provider, {
|
|
61
|
+
value: config,
|
|
43
62
|
children
|
|
44
63
|
});
|
|
45
|
-
$[
|
|
46
|
-
$[
|
|
47
|
-
$[
|
|
48
|
-
} else
|
|
49
|
-
return
|
|
64
|
+
$[10] = children;
|
|
65
|
+
$[11] = config;
|
|
66
|
+
$[12] = t9;
|
|
67
|
+
} else t9 = $[12];
|
|
68
|
+
return t9;
|
|
50
69
|
};
|
|
51
70
|
//#endregion
|
|
52
71
|
export { ConfigProvider as default };
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
import { c } from "react/compiler-runtime";
|
|
10
|
+
import { createContext, useContext, useEffect, useRef } from "react";
|
|
11
|
+
//#region components/config/popup-host.ts
|
|
12
|
+
/**
|
|
13
|
+
* Modal / Drawer 用它给自己圈一个浮层作用域:挂在里面的 Popup(下拉、气泡、子菜单……)
|
|
14
|
+
* 把关闭方法登记进来,宿主窗口关的时候一起关掉——否则窗口都没了,teleported 的下拉还悬在 body 上。
|
|
15
|
+
* Vue 侧是同名 API 的 provide/inject 版(components/config/popup-host.ts)。
|
|
16
|
+
*/
|
|
17
|
+
var PopupHostContext = createContext(null);
|
|
18
|
+
/** 宿主窗口(Modal / Drawer)用:拿到 register 传给 Provider,关窗时调 closeAll。 */
|
|
19
|
+
function usePopupHostScope() {
|
|
20
|
+
const $ = c(6);
|
|
21
|
+
let t0;
|
|
22
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23
|
+
t0 = /* @__PURE__ */ new Set();
|
|
24
|
+
$[0] = t0;
|
|
25
|
+
} else t0 = $[0];
|
|
26
|
+
const closers = useRef(t0);
|
|
27
|
+
let t1;
|
|
28
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
29
|
+
t1 = (close) => {
|
|
30
|
+
closers.current.add(close);
|
|
31
|
+
return () => {
|
|
32
|
+
closers.current.delete(close);
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
$[1] = t1;
|
|
36
|
+
} else t1 = $[1];
|
|
37
|
+
const register = t1;
|
|
38
|
+
let t2;
|
|
39
|
+
let t3;
|
|
40
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
41
|
+
t2 = () => {
|
|
42
|
+
const set = closers.current;
|
|
43
|
+
return () => set.clear();
|
|
44
|
+
};
|
|
45
|
+
t3 = [];
|
|
46
|
+
$[2] = t2;
|
|
47
|
+
$[3] = t3;
|
|
48
|
+
} else {
|
|
49
|
+
t2 = $[2];
|
|
50
|
+
t3 = $[3];
|
|
51
|
+
}
|
|
52
|
+
useEffect(t2, t3);
|
|
53
|
+
let t4;
|
|
54
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
55
|
+
t4 = () => {
|
|
56
|
+
[...closers.current].forEach(_temp);
|
|
57
|
+
};
|
|
58
|
+
$[4] = t4;
|
|
59
|
+
} else t4 = $[4];
|
|
60
|
+
const closeAll = t4;
|
|
61
|
+
let t5;
|
|
62
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
63
|
+
t5 = {
|
|
64
|
+
register,
|
|
65
|
+
closeAll
|
|
66
|
+
};
|
|
67
|
+
$[5] = t5;
|
|
68
|
+
} else t5 = $[5];
|
|
69
|
+
return t5;
|
|
70
|
+
}
|
|
71
|
+
/** 浮层用:把自己的关闭方法登记给最近的宿主窗口;外面没有宿主时什么都不做。 */
|
|
72
|
+
function _temp(close_0) {
|
|
73
|
+
return close_0();
|
|
74
|
+
}
|
|
75
|
+
function usePopupHost(close) {
|
|
76
|
+
const $ = c(5);
|
|
77
|
+
const register = useContext(PopupHostContext);
|
|
78
|
+
const closeRef = useRef(close);
|
|
79
|
+
let t0;
|
|
80
|
+
if ($[0] !== close) {
|
|
81
|
+
t0 = () => {
|
|
82
|
+
closeRef.current = close;
|
|
83
|
+
};
|
|
84
|
+
$[0] = close;
|
|
85
|
+
$[1] = t0;
|
|
86
|
+
} else t0 = $[1];
|
|
87
|
+
useEffect(t0);
|
|
88
|
+
let t1;
|
|
89
|
+
let t2;
|
|
90
|
+
if ($[2] !== register) {
|
|
91
|
+
t1 = () => {
|
|
92
|
+
if (!register) return;
|
|
93
|
+
return register(() => closeRef.current());
|
|
94
|
+
};
|
|
95
|
+
t2 = [register];
|
|
96
|
+
$[2] = register;
|
|
97
|
+
$[3] = t1;
|
|
98
|
+
$[4] = t2;
|
|
99
|
+
} else {
|
|
100
|
+
t1 = $[3];
|
|
101
|
+
t2 = $[4];
|
|
102
|
+
}
|
|
103
|
+
useEffect(t1, t2);
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { PopupHostContext, usePopupHost, usePopupHostScope };
|
|
@@ -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
|
|
@@ -11,7 +11,31 @@ import { FormContext } from "../form/form-context.js";
|
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
12
12
|
import { useContext } from "react";
|
|
13
13
|
//#region components/config/use-config-appearance.ts
|
|
14
|
+
/**
|
|
15
|
+
* What a `ConfigProvider` says about everything under it. Form is deliberately absent: `Form`'s `size`,
|
|
16
|
+
* `shape` and `theme` are documented as the appearance of its *child controls*, and a Card, Table or Alert
|
|
17
|
+
* sitting inside a form is not one — inheriting there meant `<Form size="small">` shrank every panel around it.
|
|
18
|
+
* Controls call `useFormAppearance` instead, which keeps the same three keys and layers Form on top.
|
|
19
|
+
*/
|
|
14
20
|
function useConfigAppearance() {
|
|
21
|
+
const $ = c(4);
|
|
22
|
+
const config = useContext(ConfigContext);
|
|
23
|
+
let t0;
|
|
24
|
+
if ($[0] !== config.shape || $[1] !== config.size || $[2] !== config.theme) {
|
|
25
|
+
t0 = {
|
|
26
|
+
size: config.size,
|
|
27
|
+
shape: config.shape,
|
|
28
|
+
theme: config.theme
|
|
29
|
+
};
|
|
30
|
+
$[0] = config.shape;
|
|
31
|
+
$[1] = config.size;
|
|
32
|
+
$[2] = config.theme;
|
|
33
|
+
$[3] = t0;
|
|
34
|
+
} else t0 = $[3];
|
|
35
|
+
return t0;
|
|
36
|
+
}
|
|
37
|
+
/** For the controls a `Form` wraps: what the form says, then what the provider says. */
|
|
38
|
+
function useFormAppearance() {
|
|
15
39
|
const $ = c(4);
|
|
16
40
|
const config = useContext(ConfigContext);
|
|
17
41
|
const form = useContext(FormContext);
|
|
@@ -35,5 +59,41 @@ function useConfigAppearance() {
|
|
|
35
59
|
function normalizeSurfaceShape(shape) {
|
|
36
60
|
return shape === "circle" ? "round" : shape;
|
|
37
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Every component that paints tier classes resolves its value here instead of copying the comparison.
|
|
64
|
+
* Writing no `theme` at all is how a caller says "listen to the component", and this returns the tier
|
|
65
|
+
* that component was built to look like — the same class it reaches with no `theme`, so the two can
|
|
66
|
+
* never drift. A component's own default differs (input-family is `fill`, `collapse` is `outline`,
|
|
67
|
+
* `image` is `plain`), which is why the fallback is a parameter rather than a constant.
|
|
68
|
+
*/
|
|
69
|
+
function resolveTheme(theme, fallback) {
|
|
70
|
+
return theme ?? fallback;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The other shape of "listen to the component": some components own no tier class for their default
|
|
74
|
+
* look at all. Button's `k-btn-default` is a *type* class, and a tier the stylesheet never paints —
|
|
75
|
+
* `k-btn-underlined`, since an underline only means something on a control you type into — is a dead
|
|
76
|
+
* class. An unguarded `` [`k-<component>-${theme}`]: theme `` ships both, so a component in this shape
|
|
77
|
+
* resolves through here: a value outside the tiers it actually paints yields `undefined`, emits no tier
|
|
78
|
+
* class, and leaves the component's own look in place.
|
|
79
|
+
*/
|
|
80
|
+
function resolvePaintedTheme(theme, painted) {
|
|
81
|
+
return painted.find((tier) => tier === theme);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The two painted sets as values, for the components that hand a tier *onward* instead of painting it:
|
|
85
|
+
* a group forwarding to its items, a dropdown forwarding to its buttons, a chip list forwarding to
|
|
86
|
+
* `Tag`. Those callers must vouch for what they pass — `theme` is typed by what the receiver paints —
|
|
87
|
+
* so they run the inherited value through the receiver's guard rather than forwarding a tier the
|
|
88
|
+
* receiver would only fall back from. A component that paints its own surface keeps its own
|
|
89
|
+
* `PAINTED_THEMES` list next to its stylesheet, because the style contract reads it from there.
|
|
90
|
+
*/
|
|
91
|
+
var SURFACE_THEMES = [
|
|
92
|
+
"fill",
|
|
93
|
+
"outline",
|
|
94
|
+
"plain",
|
|
95
|
+
"solid",
|
|
96
|
+
"dashed"
|
|
97
|
+
];
|
|
38
98
|
//#endregion
|
|
39
|
-
export { normalizeSurfaceShape, useConfigAppearance };
|
|
99
|
+
export { SURFACE_THEMES, normalizeSurfaceShape, resolvePaintedTheme, resolveTheme, useConfigAppearance, useFormAppearance };
|
package/es/const/var.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
|
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
//#region components/const/var.ts
|
|
10
|
+
/**
|
|
11
|
+
* 预设色值名,`Tag` / `Badge` / `Button` / `Tooltip` 的 `color` 共用这一套。
|
|
12
|
+
* 里面只有能上色的名字:不传 `color` 就是组件自己的那张表面,给它再取一个名字只会让人以为
|
|
13
|
+
* 色板里存在一套跟主题无关的档。
|
|
14
|
+
*/
|
|
10
15
|
var colors = [
|
|
11
|
-
"default",
|
|
12
16
|
"red",
|
|
13
17
|
"orange",
|
|
14
18
|
"yellow",
|