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/avatar/avatar.js
CHANGED
package/es/back-top/index.js
CHANGED
package/es/badge/index.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
|
|
@@ -7,26 +7,28 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { getChildren } from "../utils/react-node.js";
|
|
10
|
+
import { isColor } from "../utils/color.js";
|
|
11
|
+
import { colors } from "../const/var.js";
|
|
10
12
|
import RollUp from "../stat-card/rollup.js";
|
|
11
13
|
import clsx from "clsx";
|
|
12
14
|
import "react";
|
|
13
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
16
|
//#region components/badge/index.tsx
|
|
15
|
-
var Badge = ({ count, dot = false, pill = false, active = false, color, status
|
|
17
|
+
var Badge = ({ count, dot = false, pill = false, active = false, color, status, text, maxCount = 99, children, className = "", style, ...rest }) => {
|
|
16
18
|
const hasChildren = getChildren(children).length > 0;
|
|
17
19
|
let displayCount = null;
|
|
18
20
|
if (typeof count === "number" && count > 0) displayCount = count > maxCount ? `${maxCount}+` : count;
|
|
19
21
|
else if (typeof count === "string" && count.length > 0) displayCount = count;
|
|
20
22
|
const isStatusType = !hasChildren && (status || color) && !dot;
|
|
23
|
+
const isPresetColor = color !== void 0 && colors.some((preset) => preset === color);
|
|
24
|
+
const isCustomColor = !!color && isColor(color) && !isPresetColor;
|
|
21
25
|
const statusNodes = [];
|
|
22
26
|
if (isStatusType && !displayCount) {
|
|
23
|
-
const isHexColor = color && /^#/.test(color);
|
|
24
27
|
const dotClasses = clsx("k-badge-status-dot", {
|
|
25
28
|
"k-badge-status-active": active,
|
|
26
|
-
[`k-badge-status-${status}`]:
|
|
27
|
-
[`k-badge-status-${color}`]: color && !isHexColor
|
|
29
|
+
[isPresetColor ? `k-badge-status-${color}` : `k-badge-status-${status ?? "default"}`]: true
|
|
28
30
|
});
|
|
29
|
-
const dotStyle = { backgroundColor:
|
|
31
|
+
const dotStyle = { backgroundColor: isCustomColor ? color : void 0 };
|
|
30
32
|
statusNodes.push(/* @__PURE__ */ jsx("span", {
|
|
31
33
|
className: dotClasses,
|
|
32
34
|
style: dotStyle
|
|
@@ -43,11 +45,11 @@ var Badge = ({ count, dot = false, pill = false, active = false, color, status =
|
|
|
43
45
|
"k-badge-count": !dot && displayCount !== null,
|
|
44
46
|
"k-badge-dot": dot,
|
|
45
47
|
"k-badge-no-child": !hasChildren,
|
|
46
|
-
[`k-badge-${
|
|
48
|
+
[`k-badge-${color}`]: isPresetColor
|
|
47
49
|
});
|
|
48
50
|
supNode = /* @__PURE__ */ jsx("sup", {
|
|
49
51
|
className: supClasses,
|
|
50
|
-
style: { backgroundColor: color },
|
|
52
|
+
style: { backgroundColor: isCustomColor ? color : void 0 },
|
|
51
53
|
children: !dot ? typeof displayCount === "number" && Number.isFinite(displayCount) ? /* @__PURE__ */ jsx(RollUp, {
|
|
52
54
|
value: displayCount,
|
|
53
55
|
text: String(displayCount)
|
package/es/base/teleport.js
CHANGED
package/es/base/transition.js
CHANGED
package/es/button/button.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
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { getChildren } from "../utils/react-node.js";
|
|
10
|
-
import { useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
|
+
import { resolvePaintedTheme, useConfigAppearance } from "../config/use-config-appearance.js";
|
|
11
11
|
import { Loading } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
12
12
|
import Icon from "../icon/index.js";
|
|
13
13
|
import { SizeContext } from "../config/size-context.js";
|
|
@@ -17,10 +17,17 @@ import clsx from "clsx";
|
|
|
17
17
|
import React, { useContext } from "react";
|
|
18
18
|
import { jsx } from "react/jsx-runtime";
|
|
19
19
|
//#region components/button/button.tsx
|
|
20
|
+
var PAINTED_THEMES = [
|
|
21
|
+
"fill",
|
|
22
|
+
"outline",
|
|
23
|
+
"plain",
|
|
24
|
+
"solid",
|
|
25
|
+
"dashed"
|
|
26
|
+
];
|
|
20
27
|
var Button = React.forwardRef(({ htmlType = "button", icon, block = false, size: sizeProp, color, loading = false, type = "default", disabled = false, theme: themeProp, shape: shapeProp, href, target, children, className = "", onClick, ...rest }, ref) => {
|
|
21
28
|
const inheritedAppearance = useConfigAppearance();
|
|
22
29
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
23
|
-
const theme = themeProp ?? inheritedAppearance.theme;
|
|
30
|
+
const theme = resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES);
|
|
24
31
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
25
32
|
const buttonGroup = useContext(ButtonGroupContext);
|
|
26
33
|
const parentSize = useContext(SizeContext);
|
|
@@ -42,14 +49,14 @@ var Button = React.forwardRef(({ htmlType = "button", icon, block = false, size:
|
|
|
42
49
|
}
|
|
43
50
|
return false;
|
|
44
51
|
};
|
|
52
|
+
const isPresetColor = !!color && colors.some((preset) => preset === color);
|
|
45
53
|
const classes = clsx("k-btn", {
|
|
46
|
-
[`k-btn-${type}`]: type && !
|
|
47
|
-
"k-btn-outline": theme === "outline",
|
|
54
|
+
[`k-btn-${type}`]: type && !isPresetColor,
|
|
48
55
|
"k-btn-sm": computedSize === "small",
|
|
49
56
|
"k-btn-block": block,
|
|
50
57
|
"k-btn-loading": loading,
|
|
51
58
|
"k-btn-icon-only": iconOnly(),
|
|
52
|
-
[`k-btn-${color}`]:
|
|
59
|
+
[`k-btn-${color}`]: isPresetColor,
|
|
53
60
|
"k-btn-lg": computedSize === "large",
|
|
54
61
|
"k-btn-circle": computedShape === "circle",
|
|
55
62
|
"k-btn-square": computedShape === "square",
|
package/es/calendar/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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
|
|
10
|
-
import { ConfigContext } from "../config/config-context.js";
|
|
9
|
+
import { ConfigContext, DEFAULT_LOCALE } from "../config/config-context.js";
|
|
11
10
|
import { ChevronLeft, ChevronRight } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
12
11
|
import { useValue } from "../utils/use-value.js";
|
|
12
|
+
import { wash } from "../utils/color.js";
|
|
13
13
|
import Button from "../button/button.js";
|
|
14
14
|
import ButtonGroup from "../button/button-group.js";
|
|
15
15
|
import clsx from "clsx";
|
|
@@ -26,9 +26,23 @@ var parseDate = (value) => {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
var toRenderKey = (value) => `${typeof value}:${String(value)}`;
|
|
29
|
+
var EVENT_WASH_SHARE = 11;
|
|
30
|
+
/**
|
|
31
|
+
* The plate behind an event is a wash of the event's colour, and only this file holds that colour —
|
|
32
|
+
* it is a string the data carried. Applying the share here and handing the sheet a plain `rgba()`
|
|
33
|
+
* keeps the mix out of the browser, where `color-mix()` would get no value at all on the Win7
|
|
34
|
+
* Electron build. Events without a colour the code can read keep the sheet's literal default.
|
|
35
|
+
*/
|
|
36
|
+
var eventStyle = (color) => {
|
|
37
|
+
const tint = wash(color, EVENT_WASH_SHARE);
|
|
38
|
+
return {
|
|
39
|
+
"--k-calendar-event-color": color,
|
|
40
|
+
...tint ? { "--k-calendar-event-bg": tint } : {}
|
|
41
|
+
};
|
|
42
|
+
};
|
|
29
43
|
function Calendar({ value, events = [], firstDayOfWeek, maxEvents = 3, showToolbar = true, todayText, weekdays, onChange, onMonthChange, onEventClick, title, extra, dateCell, event: renderEvent, more, className, ...rest }) {
|
|
30
|
-
const locale = useContext(ConfigContext).locale ||
|
|
31
|
-
const localeName = locale.name || "
|
|
44
|
+
const locale = useContext(ConfigContext).locale || DEFAULT_LOCALE;
|
|
45
|
+
const localeName = locale.name || "en";
|
|
32
46
|
const initial = parseDate(value) || /* @__PURE__ */ new Date();
|
|
33
47
|
const [innerValue, setInnerValue] = useValue(value, (next) => next);
|
|
34
48
|
const [view, setView] = useState({
|
|
@@ -248,7 +262,7 @@ function Calendar({ value, events = [], firstDayOfWeek, maxEvents = 3, showToolb
|
|
|
248
262
|
}, toRenderKey(item_0.key)) : /* @__PURE__ */ jsxs("button", {
|
|
249
263
|
type: "button",
|
|
250
264
|
className: "k-calendar-event",
|
|
251
|
-
style:
|
|
265
|
+
style: eventStyle(item_0.color),
|
|
252
266
|
onClick: (e) => {
|
|
253
267
|
e.stopPropagation();
|
|
254
268
|
onEventClick?.(item_0, cell_4);
|
package/es/card/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 { useConfigAppearance } from "../config/use-config-appearance.js";
|
|
9
|
+
import { normalizeSurfaceShape, resolvePaintedTheme, useConfigAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import Icon from "../icon/index.js";
|
|
11
11
|
import Avatar from "../avatar/avatar.js";
|
|
12
12
|
import { c } from "react/compiler-runtime";
|
|
@@ -14,10 +14,17 @@ import clsx from "clsx";
|
|
|
14
14
|
import "react";
|
|
15
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
//#region components/card/index.tsx
|
|
17
|
+
var PAINTED_THEMES = [
|
|
18
|
+
"fill",
|
|
19
|
+
"outline",
|
|
20
|
+
"plain",
|
|
21
|
+
"solid",
|
|
22
|
+
"dashed"
|
|
23
|
+
];
|
|
17
24
|
var Card = ({ bordered = false, theme: themeProp, shape: shapeProp, size: sizeProp, title, icon, extra, cover, children, className = "", ...rest }) => {
|
|
18
25
|
const inheritedAppearance = useConfigAppearance();
|
|
19
|
-
const theme = themeProp ?? inheritedAppearance.theme ?? "fill";
|
|
20
|
-
const shape = shapeProp ?? inheritedAppearance.shape ?? "round";
|
|
26
|
+
const theme = resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? "fill";
|
|
27
|
+
const shape = normalizeSurfaceShape(shapeProp ?? inheritedAppearance.shape ?? "round");
|
|
21
28
|
const size = sizeProp ?? inheritedAppearance.size ?? "medium";
|
|
22
29
|
const iconNode = icon ? /* @__PURE__ */ jsx(Icon, {
|
|
23
30
|
type: icon,
|
package/es/carousel/carousel.js
CHANGED
package/es/carousel/drag.js
CHANGED
package/es/cascader/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
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 Popup from "../popup/index.js";
|
|
10
|
-
import {
|
|
11
|
+
import { resolveTheme, useFormAppearance } from "../config/use-config-appearance.js";
|
|
11
12
|
import { ChevronDown, ChevronRight, CircleAlert, CircleX, Loading } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
|
|
12
13
|
import Icon from "../icon/index.js";
|
|
13
14
|
import { useValue } from "../utils/use-value.js";
|
|
14
15
|
import Empty from "../empty/index.js";
|
|
15
16
|
import { createFormFieldComponent } from "../form/field-context.js";
|
|
16
17
|
import clsx from "clsx";
|
|
17
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
18
|
+
import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
18
19
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
19
20
|
//#region components/cascader/index.tsx
|
|
20
21
|
var EMPTY_OPTIONS = [];
|
|
@@ -29,11 +30,13 @@ var pathFromValue = (options, value, getChildren) => {
|
|
|
29
30
|
}
|
|
30
31
|
return path;
|
|
31
32
|
};
|
|
32
|
-
function Cascader({ value, open: openProp, options: optionsProp, theme: themeProp, bordered = true, shape: shapeProp, showArrow = true, placeholder
|
|
33
|
-
const inheritedAppearance =
|
|
34
|
-
const theme = themeProp ?? inheritedAppearance.theme
|
|
33
|
+
function Cascader({ value, open: openProp, options: optionsProp, theme: themeProp, bordered = true, shape: shapeProp, showArrow = true, placeholder, icon, arrowIcon = ChevronDown, emptyText, loadData, disabled, readOnly, clearable = true, size: sizeProp, expandTrigger = "click", showAllLevels = true, separator = " / ", placement = "bottom-left", destroyOnClose = true, onChange, onExpandChange, onOpenChange, className, style, onClick, onKeyDown, ...rest }) {
|
|
34
|
+
const inheritedAppearance = useFormAppearance();
|
|
35
|
+
const theme = resolveTheme(themeProp ?? inheritedAppearance.theme, "fill");
|
|
35
36
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
36
37
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
38
|
+
const locale = useContext(ConfigContext)?.locale || DEFAULT_LOCALE;
|
|
39
|
+
const placeholderText = placeholder || locale?.k?.select?.placeholder;
|
|
37
40
|
const options = optionsProp ?? EMPTY_OPTIONS;
|
|
38
41
|
const [innerValue, setInnerValue] = useValue(value, (next) => next ?? []);
|
|
39
42
|
const currentValue = innerValue;
|
|
@@ -245,10 +248,10 @@ function Cascader({ value, open: openProp, options: optionsProp, theme: themePro
|
|
|
245
248
|
"k-cascader-disabled": disabled,
|
|
246
249
|
"k-cascader-readonly": readOnly,
|
|
247
250
|
"k-cascader-opened": visible,
|
|
248
|
-
"k-cascader-borderless": !bordered
|
|
251
|
+
"k-cascader-borderless": !bordered,
|
|
252
|
+
[`k-cascader-${theme}`]: true,
|
|
249
253
|
"k-cascader-circle": shape === "circle",
|
|
250
254
|
"k-cascader-square": shape === "square",
|
|
251
|
-
"k-cascader-fill": theme === "fill",
|
|
252
255
|
"k-cascader-lg": size === "large",
|
|
253
256
|
"k-cascader-sm": size === "small",
|
|
254
257
|
"k-cascader-has-clear": showClear
|
|
@@ -284,7 +287,7 @@ function Cascader({ value, open: openProp, options: optionsProp, theme: themePro
|
|
|
284
287
|
children: shownLabel
|
|
285
288
|
}) : /* @__PURE__ */ jsx("div", {
|
|
286
289
|
className: "k-cascader-placeholder",
|
|
287
|
-
children:
|
|
290
|
+
children: placeholderText
|
|
288
291
|
})
|
|
289
292
|
}),
|
|
290
293
|
showArrow && /* @__PURE__ */ jsx(Icon, {
|
|
@@ -315,7 +318,7 @@ function Cascader({ value, open: openProp, options: optionsProp, theme: themePro
|
|
|
315
318
|
transitionName: "k-cascader",
|
|
316
319
|
transitionDuration: 250,
|
|
317
320
|
matchTriggerWidth: true,
|
|
318
|
-
destroyOnClose
|
|
321
|
+
destroyOnClose,
|
|
319
322
|
outsideEvent: "mousedown",
|
|
320
323
|
onOpenChange: setOpen,
|
|
321
324
|
overlay: /* @__PURE__ */ jsx("div", {
|
|
@@ -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 { useValue } from "../utils/use-value.js";
|
|
11
11
|
import { createFormFieldComponent } from "../form/field-context.js";
|
|
12
12
|
import { CheckCardGroupContext } from "./context.js";
|
|
@@ -62,7 +62,7 @@ var CheckCardGroup = React.forwardRef((t0, ref) => {
|
|
|
62
62
|
const disabled = t1 === void 0 ? false : t1;
|
|
63
63
|
const readOnly = t2 === void 0 ? false : t2;
|
|
64
64
|
const direction = t3 === void 0 ? "horizontal" : t3;
|
|
65
|
-
const inheritedAppearance =
|
|
65
|
+
const inheritedAppearance = useFormAppearance();
|
|
66
66
|
const theme = themeProp ?? inheritedAppearance.theme ?? "outline";
|
|
67
67
|
const size = sizeProp ?? inheritedAppearance.size ?? "medium";
|
|
68
68
|
const shape = shapeProp ?? inheritedAppearance.shape ?? "round";
|