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
|
@@ -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 { resolvePaintedTheme, useFormAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import { Check } 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,8 +17,15 @@ import clsx from "clsx";
|
|
|
17
17
|
import React, { useContext, useEffect, useRef } from "react";
|
|
18
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
//#region components/check-card/check-card.tsx
|
|
20
|
+
var PAINTED_THEMES = [
|
|
21
|
+
"fill",
|
|
22
|
+
"outline",
|
|
23
|
+
"plain",
|
|
24
|
+
"solid",
|
|
25
|
+
"dashed"
|
|
26
|
+
];
|
|
20
27
|
var CheckCard = React.forwardRef((t0, forwardedRef) => {
|
|
21
|
-
const $ = c(
|
|
28
|
+
const $ = c(84);
|
|
22
29
|
let checked;
|
|
23
30
|
let checkedSymbol;
|
|
24
31
|
let children;
|
|
@@ -75,8 +82,7 @@ var CheckCard = React.forwardRef((t0, forwardedRef) => {
|
|
|
75
82
|
const showIndicator = t1 === void 0 ? true : t1;
|
|
76
83
|
const disabled = t2 === void 0 ? false : t2;
|
|
77
84
|
const readOnly = t3 === void 0 ? false : t3;
|
|
78
|
-
const inheritedAppearance =
|
|
79
|
-
const theme = themeProp ?? inheritedAppearance.theme ?? "outline";
|
|
85
|
+
const inheritedAppearance = useFormAppearance();
|
|
80
86
|
const size = sizeProp ?? inheritedAppearance.size ?? "medium";
|
|
81
87
|
const shape = shapeProp ?? inheritedAppearance.shape ?? "round";
|
|
82
88
|
const group = useContext(CheckCardGroupContext);
|
|
@@ -86,51 +92,59 @@ var CheckCard = React.forwardRef((t0, forwardedRef) => {
|
|
|
86
92
|
const isChecked = grouped ? group.value === value : localChecked;
|
|
87
93
|
const isDisabled = disabled || !!group?.disabled;
|
|
88
94
|
const isReadOnly = readOnly || !!group?.readOnly;
|
|
89
|
-
|
|
95
|
+
let t4;
|
|
96
|
+
if ($[17] !== group?.theme || $[18] !== inheritedAppearance || $[19] !== themeProp) {
|
|
97
|
+
t4 = resolvePaintedTheme(themeProp ?? group?.theme ?? inheritedAppearance.theme, PAINTED_THEMES) ?? "outline";
|
|
98
|
+
$[17] = group?.theme;
|
|
99
|
+
$[18] = inheritedAppearance;
|
|
100
|
+
$[19] = themeProp;
|
|
101
|
+
$[20] = t4;
|
|
102
|
+
} else t4 = $[20];
|
|
103
|
+
const currentTheme = t4;
|
|
90
104
|
const currentSize = sizeProp ?? group?.size ?? size;
|
|
91
105
|
const currentShape = shapeProp ?? group?.shape ?? shape;
|
|
92
|
-
let t4;
|
|
93
106
|
let t5;
|
|
94
|
-
|
|
95
|
-
|
|
107
|
+
let t6;
|
|
108
|
+
if ($[21] !== group || $[22] !== grouped || $[23] !== isDisabled || $[24] !== isReadOnly || $[25] !== value) {
|
|
109
|
+
t5 = () => {
|
|
96
110
|
if (grouped && value !== void 0 && rootRef.current) {
|
|
97
111
|
group?.register(value, rootRef.current, isDisabled || isReadOnly);
|
|
98
112
|
return () => group.unregister(value);
|
|
99
113
|
}
|
|
100
114
|
};
|
|
101
|
-
|
|
115
|
+
t6 = [
|
|
102
116
|
group,
|
|
103
117
|
grouped,
|
|
104
118
|
isDisabled,
|
|
105
119
|
isReadOnly,
|
|
106
120
|
value
|
|
107
121
|
];
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
122
|
+
$[21] = group;
|
|
123
|
+
$[22] = grouped;
|
|
124
|
+
$[23] = isDisabled;
|
|
125
|
+
$[24] = isReadOnly;
|
|
126
|
+
$[25] = value;
|
|
127
|
+
$[26] = t5;
|
|
128
|
+
$[27] = t6;
|
|
115
129
|
} else {
|
|
116
|
-
|
|
117
|
-
|
|
130
|
+
t5 = $[26];
|
|
131
|
+
t6 = $[27];
|
|
118
132
|
}
|
|
119
|
-
useEffect(
|
|
120
|
-
let
|
|
121
|
-
if ($[
|
|
122
|
-
|
|
133
|
+
useEffect(t5, t6);
|
|
134
|
+
let t7;
|
|
135
|
+
if ($[28] !== forwardedRef) {
|
|
136
|
+
t7 = (element) => {
|
|
123
137
|
rootRef.current = element;
|
|
124
138
|
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
125
139
|
else if (forwardedRef) forwardedRef.current = element;
|
|
126
140
|
};
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
} else
|
|
130
|
-
const setRefs =
|
|
131
|
-
let
|
|
132
|
-
if ($[
|
|
133
|
-
|
|
141
|
+
$[28] = forwardedRef;
|
|
142
|
+
$[29] = t7;
|
|
143
|
+
} else t7 = $[29];
|
|
144
|
+
const setRefs = t7;
|
|
145
|
+
let t8;
|
|
146
|
+
if ($[30] !== group || $[31] !== grouped || $[32] !== isChecked || $[33] !== isDisabled || $[34] !== isReadOnly || $[35] !== onChange || $[36] !== setLocalChecked || $[37] !== value) {
|
|
147
|
+
t8 = () => {
|
|
134
148
|
if (isDisabled || isReadOnly) return;
|
|
135
149
|
if (grouped && value !== void 0) {
|
|
136
150
|
if (isChecked) return;
|
|
@@ -148,20 +162,20 @@ var CheckCard = React.forwardRef((t0, forwardedRef) => {
|
|
|
148
162
|
value
|
|
149
163
|
});
|
|
150
164
|
};
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
} else
|
|
161
|
-
const select =
|
|
162
|
-
let
|
|
163
|
-
if ($[
|
|
164
|
-
|
|
165
|
+
$[30] = group;
|
|
166
|
+
$[31] = grouped;
|
|
167
|
+
$[32] = isChecked;
|
|
168
|
+
$[33] = isDisabled;
|
|
169
|
+
$[34] = isReadOnly;
|
|
170
|
+
$[35] = onChange;
|
|
171
|
+
$[36] = setLocalChecked;
|
|
172
|
+
$[37] = value;
|
|
173
|
+
$[38] = t8;
|
|
174
|
+
} else t8 = $[38];
|
|
175
|
+
const select = t8;
|
|
176
|
+
let t9;
|
|
177
|
+
if ($[39] !== group || $[40] !== grouped || $[41] !== isDisabled || $[42] !== isReadOnly || $[43] !== select || $[44] !== value) {
|
|
178
|
+
t9 = (event) => {
|
|
165
179
|
if (isDisabled || isReadOnly) return;
|
|
166
180
|
if (event.key === " " || event.key === "Enter") {
|
|
167
181
|
event.preventDefault();
|
|
@@ -179,139 +193,139 @@ var CheckCard = React.forwardRef((t0, forwardedRef) => {
|
|
|
179
193
|
group.selectRelative(value, event.key === "ArrowRight" || event.key === "ArrowDown" ? 1 : -1);
|
|
180
194
|
}
|
|
181
195
|
};
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
} else
|
|
190
|
-
const handleKeyDown =
|
|
196
|
+
$[39] = group;
|
|
197
|
+
$[40] = grouped;
|
|
198
|
+
$[41] = isDisabled;
|
|
199
|
+
$[42] = isReadOnly;
|
|
200
|
+
$[43] = select;
|
|
201
|
+
$[44] = value;
|
|
202
|
+
$[45] = t9;
|
|
203
|
+
} else t9 = $[45];
|
|
204
|
+
const handleKeyDown = t9;
|
|
191
205
|
const symbolType = isChecked ? checkedSymbol ?? symbol : symbol;
|
|
192
|
-
let
|
|
193
|
-
if ($[
|
|
194
|
-
|
|
206
|
+
let t10;
|
|
207
|
+
if ($[46] !== symbolType) {
|
|
208
|
+
t10 = symbolType ? /* @__PURE__ */ jsx(Icon, {
|
|
195
209
|
className: "k-check-card-symbol-icon",
|
|
196
210
|
type: symbolType
|
|
197
211
|
}) : null;
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
} else
|
|
201
|
-
const symbolNode =
|
|
202
|
-
const
|
|
203
|
-
const
|
|
204
|
-
const
|
|
205
|
-
const
|
|
206
|
-
let
|
|
207
|
-
if ($[
|
|
208
|
-
|
|
212
|
+
$[46] = symbolType;
|
|
213
|
+
$[47] = t10;
|
|
214
|
+
} else t10 = $[47];
|
|
215
|
+
const symbolNode = t10;
|
|
216
|
+
const t11 = `k-check-card-${currentTheme}`;
|
|
217
|
+
const t12 = `k-check-card-${currentSize}`;
|
|
218
|
+
const t13 = `k-check-card-${currentShape}`;
|
|
219
|
+
const t14 = !!symbolNode;
|
|
220
|
+
let t15;
|
|
221
|
+
if ($[48] !== className || $[49] !== isChecked || $[50] !== isDisabled || $[51] !== isReadOnly || $[52] !== t11 || $[53] !== t12 || $[54] !== t13 || $[55] !== t14) {
|
|
222
|
+
t15 = clsx("k-check-card", t11, t12, t13, {
|
|
209
223
|
"is-checked": isChecked,
|
|
210
224
|
"is-disabled": isDisabled,
|
|
211
225
|
"is-readonly": isReadOnly,
|
|
212
|
-
"has-symbol":
|
|
226
|
+
"has-symbol": t14
|
|
213
227
|
}, className);
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
} else
|
|
224
|
-
const
|
|
225
|
-
const
|
|
226
|
-
const
|
|
227
|
-
let
|
|
228
|
-
if ($[
|
|
229
|
-
|
|
228
|
+
$[48] = className;
|
|
229
|
+
$[49] = isChecked;
|
|
230
|
+
$[50] = isDisabled;
|
|
231
|
+
$[51] = isReadOnly;
|
|
232
|
+
$[52] = t11;
|
|
233
|
+
$[53] = t12;
|
|
234
|
+
$[54] = t13;
|
|
235
|
+
$[55] = t14;
|
|
236
|
+
$[56] = t15;
|
|
237
|
+
} else t15 = $[56];
|
|
238
|
+
const t16 = grouped ? "radio" : "checkbox";
|
|
239
|
+
const t17 = isReadOnly || void 0;
|
|
240
|
+
const t18 = isDisabled ? -1 : isChecked || !grouped ? 0 : -1;
|
|
241
|
+
let t19;
|
|
242
|
+
if ($[57] !== symbolNode) {
|
|
243
|
+
t19 = symbolNode ? /* @__PURE__ */ jsx("div", {
|
|
230
244
|
className: "k-check-card-symbol",
|
|
231
245
|
children: symbolNode
|
|
232
246
|
}) : null;
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
} else
|
|
236
|
-
let
|
|
237
|
-
if ($[
|
|
238
|
-
|
|
247
|
+
$[57] = symbolNode;
|
|
248
|
+
$[58] = t19;
|
|
249
|
+
} else t19 = $[58];
|
|
250
|
+
let t20;
|
|
251
|
+
if ($[59] !== title) {
|
|
252
|
+
t20 = title !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
239
253
|
className: "k-check-card-title",
|
|
240
254
|
children: title
|
|
241
255
|
}) : null;
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
} else
|
|
245
|
-
let
|
|
246
|
-
if ($[
|
|
247
|
-
|
|
256
|
+
$[59] = title;
|
|
257
|
+
$[60] = t20;
|
|
258
|
+
} else t20 = $[60];
|
|
259
|
+
let t21;
|
|
260
|
+
if ($[61] !== description) {
|
|
261
|
+
t21 = description !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
248
262
|
className: "k-check-card-description",
|
|
249
263
|
children: description
|
|
250
264
|
}) : null;
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
} else
|
|
254
|
-
let
|
|
255
|
-
if ($[
|
|
256
|
-
|
|
265
|
+
$[61] = description;
|
|
266
|
+
$[62] = t21;
|
|
267
|
+
} else t21 = $[62];
|
|
268
|
+
let t22;
|
|
269
|
+
if ($[63] !== children || $[64] !== t20 || $[65] !== t21) {
|
|
270
|
+
t22 = /* @__PURE__ */ jsxs("div", {
|
|
257
271
|
className: "k-check-card-content",
|
|
258
272
|
children: [
|
|
259
|
-
t19,
|
|
260
273
|
t20,
|
|
274
|
+
t21,
|
|
261
275
|
children
|
|
262
276
|
]
|
|
263
277
|
});
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
} else
|
|
269
|
-
let
|
|
270
|
-
if ($[
|
|
271
|
-
|
|
278
|
+
$[63] = children;
|
|
279
|
+
$[64] = t20;
|
|
280
|
+
$[65] = t21;
|
|
281
|
+
$[66] = t22;
|
|
282
|
+
} else t22 = $[66];
|
|
283
|
+
let t23;
|
|
284
|
+
if ($[67] !== isChecked || $[68] !== showIndicator) {
|
|
285
|
+
t23 = showIndicator ? /* @__PURE__ */ jsx("span", {
|
|
272
286
|
className: "k-check-card-indicator",
|
|
273
287
|
"aria-hidden": "true",
|
|
274
288
|
children: isChecked ? /* @__PURE__ */ jsx(Icon, { type: Check }) : null
|
|
275
289
|
}) : null;
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
} else
|
|
280
|
-
let
|
|
281
|
-
if ($[
|
|
282
|
-
|
|
290
|
+
$[67] = isChecked;
|
|
291
|
+
$[68] = showIndicator;
|
|
292
|
+
$[69] = t23;
|
|
293
|
+
} else t23 = $[69];
|
|
294
|
+
let t24;
|
|
295
|
+
if ($[70] !== handleKeyDown || $[71] !== isChecked || $[72] !== isDisabled || $[73] !== rest || $[74] !== select || $[75] !== setRefs || $[76] !== t15 || $[77] !== t16 || $[78] !== t17 || $[79] !== t18 || $[80] !== t19 || $[81] !== t22 || $[82] !== t23) {
|
|
296
|
+
t24 = /* @__PURE__ */ jsxs("div", {
|
|
283
297
|
...rest,
|
|
284
298
|
ref: setRefs,
|
|
285
|
-
className:
|
|
286
|
-
role:
|
|
299
|
+
className: t15,
|
|
300
|
+
role: t16,
|
|
287
301
|
"aria-checked": isChecked,
|
|
288
302
|
"aria-disabled": isDisabled,
|
|
289
|
-
"aria-readonly":
|
|
290
|
-
tabIndex:
|
|
303
|
+
"aria-readonly": t17,
|
|
304
|
+
tabIndex: t18,
|
|
291
305
|
onClick: select,
|
|
292
306
|
onKeyDown: handleKeyDown,
|
|
293
307
|
children: [
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
308
|
+
t19,
|
|
309
|
+
t22,
|
|
310
|
+
t23
|
|
297
311
|
]
|
|
298
312
|
});
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
} else
|
|
314
|
-
return
|
|
313
|
+
$[70] = handleKeyDown;
|
|
314
|
+
$[71] = isChecked;
|
|
315
|
+
$[72] = isDisabled;
|
|
316
|
+
$[73] = rest;
|
|
317
|
+
$[74] = select;
|
|
318
|
+
$[75] = setRefs;
|
|
319
|
+
$[76] = t15;
|
|
320
|
+
$[77] = t16;
|
|
321
|
+
$[78] = t17;
|
|
322
|
+
$[79] = t18;
|
|
323
|
+
$[80] = t19;
|
|
324
|
+
$[81] = t22;
|
|
325
|
+
$[82] = t23;
|
|
326
|
+
$[83] = t24;
|
|
327
|
+
} else t24 = $[83];
|
|
328
|
+
return t24;
|
|
315
329
|
});
|
|
316
330
|
CheckCard.displayName = "CheckCard";
|
|
317
331
|
var check_card_default = createFormFieldComponent(CheckCard, {
|
package/es/check-card/context.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 { useValue } from "../utils/use-value.js";
|
|
11
11
|
import { createFormFieldComponent } from "../form/field-context.js";
|
|
12
12
|
import { CheckboxGroupContext } from "./checkbox-group-context.js";
|
|
@@ -60,7 +60,7 @@ var CheckboxGroup = (t0) => {
|
|
|
60
60
|
const readOnly = t2 === void 0 ? false : t2;
|
|
61
61
|
const direction = t3 === void 0 ? "horizontal" : t3;
|
|
62
62
|
const className = t4 === void 0 ? "" : t4;
|
|
63
|
-
const inheritedAppearance =
|
|
63
|
+
const inheritedAppearance = useFormAppearance();
|
|
64
64
|
const theme = themeProp ?? inheritedAppearance.theme ?? "fill";
|
|
65
65
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
66
66
|
const [innerValue, setInnerValue] = useValue(value, _temp);
|