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/radio/radio.js
CHANGED
|
@@ -1,242 +1,94 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* react-kui v3.
|
|
2
|
+
* react-kui v3.2.0
|
|
3
3
|
* Copyright 2017-present, kui-react.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Homepage: https://react.k-ui.cn
|
|
6
6
|
* Author: Qiu / https://chuchur.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { resolvePaintedTheme, 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 { RadioGroupContext } from "./radio-group-context.js";
|
|
13
|
-
import { c } from "react/compiler-runtime";
|
|
14
13
|
import clsx from "clsx";
|
|
15
14
|
import React, { useContext } from "react";
|
|
16
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
16
|
//#region components/radio/radio.tsx
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let ariaInvalid;
|
|
22
|
-
let ariaLabelledby;
|
|
23
|
-
let ariaRequired;
|
|
24
|
-
let checked;
|
|
25
|
-
let children;
|
|
26
|
-
let id;
|
|
27
|
-
let label;
|
|
28
|
-
let onChange;
|
|
29
|
-
let onClick;
|
|
30
|
-
let rest;
|
|
31
|
-
let sizeProp;
|
|
32
|
-
let t1;
|
|
33
|
-
let t2;
|
|
34
|
-
let t3;
|
|
35
|
-
let themeProp;
|
|
36
|
-
let value;
|
|
37
|
-
if ($[0] !== t0) {
|
|
38
|
-
({checked, value, label, theme: themeProp, size: sizeProp, onChange, children, className: t1, id, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, disabled: t2, readOnly: t3, onClick, ...rest} = t0);
|
|
39
|
-
$[0] = t0;
|
|
40
|
-
$[1] = ariaDescribedby;
|
|
41
|
-
$[2] = ariaInvalid;
|
|
42
|
-
$[3] = ariaLabelledby;
|
|
43
|
-
$[4] = ariaRequired;
|
|
44
|
-
$[5] = checked;
|
|
45
|
-
$[6] = children;
|
|
46
|
-
$[7] = id;
|
|
47
|
-
$[8] = label;
|
|
48
|
-
$[9] = onChange;
|
|
49
|
-
$[10] = onClick;
|
|
50
|
-
$[11] = rest;
|
|
51
|
-
$[12] = sizeProp;
|
|
52
|
-
$[13] = t1;
|
|
53
|
-
$[14] = t2;
|
|
54
|
-
$[15] = t3;
|
|
55
|
-
$[16] = themeProp;
|
|
56
|
-
$[17] = value;
|
|
57
|
-
} else {
|
|
58
|
-
ariaDescribedby = $[1];
|
|
59
|
-
ariaInvalid = $[2];
|
|
60
|
-
ariaLabelledby = $[3];
|
|
61
|
-
ariaRequired = $[4];
|
|
62
|
-
checked = $[5];
|
|
63
|
-
children = $[6];
|
|
64
|
-
id = $[7];
|
|
65
|
-
label = $[8];
|
|
66
|
-
onChange = $[9];
|
|
67
|
-
onClick = $[10];
|
|
68
|
-
rest = $[11];
|
|
69
|
-
sizeProp = $[12];
|
|
70
|
-
t1 = $[13];
|
|
71
|
-
t2 = $[14];
|
|
72
|
-
t3 = $[15];
|
|
73
|
-
themeProp = $[16];
|
|
74
|
-
value = $[17];
|
|
75
|
-
}
|
|
76
|
-
const className = t1 === void 0 ? "" : t1;
|
|
77
|
-
const disabled = t2 === void 0 ? false : t2;
|
|
78
|
-
const readOnly = t3 === void 0 ? false : t3;
|
|
79
|
-
const inheritedAppearance = useConfigAppearance();
|
|
80
|
-
const theme = themeProp ?? inheritedAppearance.theme ?? "fill";
|
|
17
|
+
var PAINTED_THEMES = ["fill", "outline"];
|
|
18
|
+
var Radio = React.forwardRef(({ checked, value, label, theme: themeProp, size: sizeProp, onChange, children, className = "", id, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, disabled = false, readOnly = false, onClick, ...rest }, ref) => {
|
|
19
|
+
const inheritedAppearance = useFormAppearance();
|
|
81
20
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
82
21
|
const group = useContext(RadioGroupContext);
|
|
83
22
|
const isGroup = !!group;
|
|
84
23
|
const groupChecked = isGroup ? group.value === value : false;
|
|
85
|
-
const [localChecked, setLocalChecked] = useValue(checked,
|
|
24
|
+
const [localChecked, setLocalChecked] = useValue(checked, (next) => next ?? false);
|
|
86
25
|
const isChecked = isGroup ? groupChecked : localChecked;
|
|
87
26
|
const currentDisabled = disabled || isGroup && group.disabled;
|
|
88
27
|
const currentReadOnly = readOnly || Boolean(isGroup && group.readOnly);
|
|
89
|
-
const currentTheme = themeProp ?? group?.theme ?? theme;
|
|
28
|
+
const currentTheme = resolvePaintedTheme(themeProp ?? group?.theme ?? inheritedAppearance.theme, PAINTED_THEMES) ?? "fill";
|
|
90
29
|
const currentSize = sizeProp ?? group?.size ?? size;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
value,
|
|
99
|
-
label: typeof labelVal === "string" ? labelVal : ""
|
|
100
|
-
};
|
|
101
|
-
onChange?.(eventObj);
|
|
102
|
-
group?.onChange?.(eventObj);
|
|
30
|
+
const emitValue = (newChecked) => {
|
|
31
|
+
if (!isGroup) setLocalChecked(newChecked);
|
|
32
|
+
const labelVal = label ?? String(value ?? "");
|
|
33
|
+
const eventObj = {
|
|
34
|
+
checked: newChecked,
|
|
35
|
+
value,
|
|
36
|
+
label: typeof labelVal === "string" ? labelVal : ""
|
|
103
37
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
$[25] = currentDisabled;
|
|
120
|
-
$[26] = currentReadOnly;
|
|
121
|
-
$[27] = emitValue;
|
|
122
|
-
$[28] = isChecked;
|
|
123
|
-
$[29] = t5;
|
|
124
|
-
} else t5 = $[29];
|
|
125
|
-
const handleInputChange = t5;
|
|
126
|
-
const t6 = currentTheme === "fill";
|
|
127
|
-
const t7 = currentSize === "large";
|
|
128
|
-
const t8 = currentSize === "small";
|
|
129
|
-
let t9;
|
|
130
|
-
if ($[30] !== className || $[31] !== currentDisabled || $[32] !== currentReadOnly || $[33] !== isChecked || $[34] !== t6 || $[35] !== t7 || $[36] !== t8) {
|
|
131
|
-
t9 = clsx("k-radio", {
|
|
132
|
-
"k-radio-fill": t6,
|
|
133
|
-
"k-radio-disabled": currentDisabled,
|
|
134
|
-
"k-radio-readonly": currentReadOnly,
|
|
135
|
-
"k-radio-checked": isChecked,
|
|
136
|
-
"k-radio-lg": t7,
|
|
137
|
-
"k-radio-sm": t8
|
|
138
|
-
}, className);
|
|
139
|
-
$[30] = className;
|
|
140
|
-
$[31] = currentDisabled;
|
|
141
|
-
$[32] = currentReadOnly;
|
|
142
|
-
$[33] = isChecked;
|
|
143
|
-
$[34] = t6;
|
|
144
|
-
$[35] = t7;
|
|
145
|
-
$[36] = t8;
|
|
146
|
-
$[37] = t9;
|
|
147
|
-
} else t9 = $[37];
|
|
148
|
-
const classes = t9;
|
|
38
|
+
onChange?.(eventObj);
|
|
39
|
+
group?.onChange?.(eventObj);
|
|
40
|
+
};
|
|
41
|
+
const handleInputChange = (e) => {
|
|
42
|
+
if (currentDisabled || currentReadOnly || isChecked) return;
|
|
43
|
+
emitValue(e.target.checked);
|
|
44
|
+
};
|
|
45
|
+
const classes = clsx("k-radio", {
|
|
46
|
+
[`k-radio-${currentTheme}`]: true,
|
|
47
|
+
"k-radio-disabled": currentDisabled,
|
|
48
|
+
"k-radio-readonly": currentReadOnly,
|
|
49
|
+
"k-radio-checked": isChecked,
|
|
50
|
+
"k-radio-lg": currentSize === "large",
|
|
51
|
+
"k-radio-sm": currentSize === "small"
|
|
52
|
+
}, className);
|
|
149
53
|
const labelNode = label ?? children;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
54
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
55
|
+
ref,
|
|
56
|
+
className: classes,
|
|
57
|
+
"aria-readonly": currentReadOnly || void 0,
|
|
58
|
+
...rest,
|
|
59
|
+
onClick: (event) => {
|
|
154
60
|
if (currentDisabled) {
|
|
155
61
|
event.preventDefault();
|
|
156
62
|
event.stopPropagation();
|
|
157
63
|
return;
|
|
158
64
|
}
|
|
159
65
|
onClick?.(event);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
$[39] = onClick;
|
|
163
|
-
$[40] = t11;
|
|
164
|
-
} else t11 = $[40];
|
|
165
|
-
const t12 = group?.name;
|
|
166
|
-
const t13 = currentReadOnly || void 0;
|
|
167
|
-
let t14;
|
|
168
|
-
if ($[41] !== currentReadOnly) {
|
|
169
|
-
t14 = (event_0) => {
|
|
170
|
-
if (currentReadOnly) event_0.preventDefault();
|
|
171
|
-
};
|
|
172
|
-
$[41] = currentReadOnly;
|
|
173
|
-
$[42] = t14;
|
|
174
|
-
} else t14 = $[42];
|
|
175
|
-
const t15 = !!isChecked;
|
|
176
|
-
let t16;
|
|
177
|
-
if ($[43] !== ariaDescribedby || $[44] !== ariaInvalid || $[45] !== ariaLabelledby || $[46] !== ariaRequired || $[47] !== currentDisabled || $[48] !== currentReadOnly || $[49] !== handleInputChange || $[50] !== id || $[51] !== t12 || $[52] !== t13 || $[53] !== t14 || $[54] !== t15) {
|
|
178
|
-
t16 = /* @__PURE__ */ jsx("span", {
|
|
66
|
+
},
|
|
67
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
179
68
|
className: "k-radio-symbol",
|
|
180
69
|
children: /* @__PURE__ */ jsx("input", {
|
|
181
70
|
id,
|
|
182
71
|
type: "radio",
|
|
183
72
|
className: "k-radio-input",
|
|
184
|
-
name:
|
|
73
|
+
name: group?.name,
|
|
185
74
|
disabled: currentDisabled,
|
|
186
75
|
readOnly: currentReadOnly,
|
|
187
|
-
"aria-readonly":
|
|
76
|
+
"aria-readonly": currentReadOnly || void 0,
|
|
188
77
|
"aria-labelledby": ariaLabelledby,
|
|
189
78
|
"aria-describedby": ariaDescribedby,
|
|
190
79
|
"aria-invalid": ariaInvalid,
|
|
191
80
|
"aria-required": ariaRequired,
|
|
192
|
-
onClick:
|
|
81
|
+
onClick: (event_0) => {
|
|
82
|
+
if (currentReadOnly) event_0.preventDefault();
|
|
83
|
+
},
|
|
193
84
|
onChange: handleInputChange,
|
|
194
|
-
checked:
|
|
85
|
+
checked: !!isChecked
|
|
195
86
|
})
|
|
196
|
-
})
|
|
197
|
-
$[43] = ariaDescribedby;
|
|
198
|
-
$[44] = ariaInvalid;
|
|
199
|
-
$[45] = ariaLabelledby;
|
|
200
|
-
$[46] = ariaRequired;
|
|
201
|
-
$[47] = currentDisabled;
|
|
202
|
-
$[48] = currentReadOnly;
|
|
203
|
-
$[49] = handleInputChange;
|
|
204
|
-
$[50] = id;
|
|
205
|
-
$[51] = t12;
|
|
206
|
-
$[52] = t13;
|
|
207
|
-
$[53] = t14;
|
|
208
|
-
$[54] = t15;
|
|
209
|
-
$[55] = t16;
|
|
210
|
-
} else t16 = $[55];
|
|
211
|
-
let t17;
|
|
212
|
-
if ($[56] !== labelNode) {
|
|
213
|
-
t17 = labelNode ? /* @__PURE__ */ jsx("span", {
|
|
87
|
+
}), labelNode ? /* @__PURE__ */ jsx("span", {
|
|
214
88
|
className: "k-radio-label",
|
|
215
89
|
children: labelNode
|
|
216
|
-
}) : null
|
|
217
|
-
|
|
218
|
-
$[57] = t17;
|
|
219
|
-
} else t17 = $[57];
|
|
220
|
-
let t18;
|
|
221
|
-
if ($[58] !== classes || $[59] !== ref || $[60] !== rest || $[61] !== t10 || $[62] !== t11 || $[63] !== t16 || $[64] !== t17) {
|
|
222
|
-
t18 = /* @__PURE__ */ jsxs("label", {
|
|
223
|
-
ref,
|
|
224
|
-
className: classes,
|
|
225
|
-
"aria-readonly": t10,
|
|
226
|
-
...rest,
|
|
227
|
-
onClick: t11,
|
|
228
|
-
children: [t16, t17]
|
|
229
|
-
});
|
|
230
|
-
$[58] = classes;
|
|
231
|
-
$[59] = ref;
|
|
232
|
-
$[60] = rest;
|
|
233
|
-
$[61] = t10;
|
|
234
|
-
$[62] = t11;
|
|
235
|
-
$[63] = t16;
|
|
236
|
-
$[64] = t17;
|
|
237
|
-
$[65] = t18;
|
|
238
|
-
} else t18 = $[65];
|
|
239
|
-
return t18;
|
|
90
|
+
}) : null]
|
|
91
|
+
});
|
|
240
92
|
});
|
|
241
93
|
Radio.displayName = "Radio";
|
|
242
94
|
var radio_default = createFormFieldComponent(Radio, {
|
|
@@ -244,8 +96,5 @@ var radio_default = createFormFieldComponent(Radio, {
|
|
|
244
96
|
getFieldValue: (value) => value === true || value === 1 || value === "1",
|
|
245
97
|
getChangeValue: (event) => event.checked
|
|
246
98
|
});
|
|
247
|
-
function _temp(next) {
|
|
248
|
-
return next ?? false;
|
|
249
|
-
}
|
|
250
99
|
//#endregion
|
|
251
100
|
export { radio_default as default };
|
package/es/rate/index.js
CHANGED
package/es/rate/star.js
CHANGED
package/es/result/index.js
CHANGED
package/es/ripple/index.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,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
"use client";
|
|
10
|
-
import { createRipple, supportsHtmlInCanvas } from "./types.js";
|
|
10
|
+
import { createRipple, htmlInCanvasMarkup, supportsHtmlInCanvas } from "./types.js";
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
12
12
|
import { useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -19,7 +19,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
*/
|
|
20
20
|
var emptySubscribe = () => () => {};
|
|
21
21
|
function Ripple(t0) {
|
|
22
|
-
const $ = c(
|
|
22
|
+
const $ = c(45);
|
|
23
23
|
let children;
|
|
24
24
|
let className;
|
|
25
25
|
let options;
|
|
@@ -48,8 +48,14 @@ function Ripple(t0) {
|
|
|
48
48
|
const supported = useSyncExternalStore(emptySubscribe, supportsHtmlInCanvas, _temp);
|
|
49
49
|
const native = supported && !failed && nativeReady;
|
|
50
50
|
let t1;
|
|
51
|
-
if ($[5]
|
|
52
|
-
t1 = ()
|
|
51
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
52
|
+
t1 = htmlInCanvasMarkup();
|
|
53
|
+
$[5] = t1;
|
|
54
|
+
} else t1 = $[5];
|
|
55
|
+
const markup = t1;
|
|
56
|
+
let t2;
|
|
57
|
+
if ($[6] !== failed || $[7] !== supported) {
|
|
58
|
+
t2 = () => {
|
|
53
59
|
if (!supported || failed) return;
|
|
54
60
|
const content = contentRef.current;
|
|
55
61
|
if (!content) return;
|
|
@@ -67,27 +73,27 @@ function Ripple(t0) {
|
|
|
67
73
|
observer.disconnect();
|
|
68
74
|
};
|
|
69
75
|
};
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
} else
|
|
74
|
-
let
|
|
75
|
-
if ($[
|
|
76
|
-
|
|
76
|
+
$[6] = failed;
|
|
77
|
+
$[7] = supported;
|
|
78
|
+
$[8] = t2;
|
|
79
|
+
} else t2 = $[8];
|
|
80
|
+
let t3;
|
|
81
|
+
if ($[9] !== failed || $[10] !== native || $[11] !== supported) {
|
|
82
|
+
t3 = [
|
|
77
83
|
failed,
|
|
78
84
|
native,
|
|
79
85
|
supported
|
|
80
86
|
];
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
} else
|
|
86
|
-
useLayoutEffect(
|
|
87
|
-
let t3;
|
|
87
|
+
$[9] = failed;
|
|
88
|
+
$[10] = native;
|
|
89
|
+
$[11] = supported;
|
|
90
|
+
$[12] = t3;
|
|
91
|
+
} else t3 = $[12];
|
|
92
|
+
useLayoutEffect(t2, t3);
|
|
88
93
|
let t4;
|
|
89
|
-
|
|
90
|
-
|
|
94
|
+
let t5;
|
|
95
|
+
if ($[13] !== failed || $[14] !== initialOptions || $[15] !== native || $[16] !== nativeReady || $[17] !== supported) {
|
|
96
|
+
t4 = () => {
|
|
91
97
|
if (supported && !nativeReady && !failed) return;
|
|
92
98
|
const source = sourceRef.current;
|
|
93
99
|
const content_0 = contentRef.current;
|
|
@@ -104,67 +110,68 @@ function Ripple(t0) {
|
|
|
104
110
|
instanceRef.current = null;
|
|
105
111
|
};
|
|
106
112
|
};
|
|
107
|
-
|
|
113
|
+
t5 = [
|
|
108
114
|
failed,
|
|
109
115
|
initialOptions,
|
|
110
116
|
native,
|
|
111
117
|
nativeReady,
|
|
112
118
|
supported
|
|
113
119
|
];
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[17] = t3;
|
|
120
|
+
$[13] = failed;
|
|
121
|
+
$[14] = initialOptions;
|
|
122
|
+
$[15] = native;
|
|
123
|
+
$[16] = nativeReady;
|
|
124
|
+
$[17] = supported;
|
|
120
125
|
$[18] = t4;
|
|
126
|
+
$[19] = t5;
|
|
121
127
|
} else {
|
|
122
|
-
t3 = $[17];
|
|
123
128
|
t4 = $[18];
|
|
129
|
+
t5 = $[19];
|
|
124
130
|
}
|
|
125
|
-
useEffect(
|
|
126
|
-
let
|
|
127
|
-
if ($[
|
|
128
|
-
|
|
131
|
+
useEffect(t4, t5);
|
|
132
|
+
let t6;
|
|
133
|
+
if ($[20] !== options) {
|
|
134
|
+
t6 = () => {
|
|
129
135
|
instanceRef.current?.setOptions(options);
|
|
130
136
|
};
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
} else
|
|
134
|
-
useEffect(
|
|
135
|
-
let t6;
|
|
136
|
-
if ($[21] !== contentHeight || $[22] !== native) {
|
|
137
|
-
t6 = native ? { height: contentHeight } : null;
|
|
138
|
-
$[21] = contentHeight;
|
|
139
|
-
$[22] = native;
|
|
140
|
-
$[23] = t6;
|
|
141
|
-
} else t6 = $[23];
|
|
137
|
+
$[20] = options;
|
|
138
|
+
$[21] = t6;
|
|
139
|
+
} else t6 = $[21];
|
|
140
|
+
useEffect(t6);
|
|
142
141
|
let t7;
|
|
143
|
-
if ($[
|
|
144
|
-
t7 = {
|
|
142
|
+
if ($[22] !== contentHeight || $[23] !== native) {
|
|
143
|
+
t7 = native ? { height: contentHeight } : null;
|
|
144
|
+
$[22] = contentHeight;
|
|
145
|
+
$[23] = native;
|
|
146
|
+
$[24] = t7;
|
|
147
|
+
} else t7 = $[24];
|
|
148
|
+
let t8;
|
|
149
|
+
if ($[25] !== style || $[26] !== t7) {
|
|
150
|
+
t8 = {
|
|
145
151
|
position: "relative",
|
|
146
|
-
...
|
|
152
|
+
...t7,
|
|
147
153
|
...style
|
|
148
154
|
};
|
|
149
|
-
$[
|
|
150
|
-
$[25] = t6;
|
|
155
|
+
$[25] = style;
|
|
151
156
|
$[26] = t7;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
$[27] = t8;
|
|
158
|
+
} else t8 = $[27];
|
|
159
|
+
let t9;
|
|
160
|
+
if ($[28] !== native) {
|
|
161
|
+
t9 = native ? {
|
|
156
162
|
position: "absolute",
|
|
157
163
|
inset: 0,
|
|
158
164
|
width: "100%",
|
|
159
165
|
height: "100%"
|
|
160
166
|
} : { display: "none" };
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
} else
|
|
164
|
-
let
|
|
165
|
-
if ($[
|
|
166
|
-
|
|
167
|
+
$[28] = native;
|
|
168
|
+
$[29] = t9;
|
|
169
|
+
} else t9 = $[29];
|
|
170
|
+
let t10;
|
|
171
|
+
if ($[30] !== children || $[31] !== native) {
|
|
172
|
+
t10 = native ? /* @__PURE__ */ jsx("div", {
|
|
167
173
|
ref: contentRef,
|
|
174
|
+
...markup.element,
|
|
168
175
|
style: {
|
|
169
176
|
position: "relative",
|
|
170
177
|
width: "100%",
|
|
@@ -172,26 +179,26 @@ function Ripple(t0) {
|
|
|
172
179
|
},
|
|
173
180
|
children
|
|
174
181
|
}) : null;
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
} else
|
|
179
|
-
let
|
|
180
|
-
if ($[
|
|
181
|
-
|
|
182
|
+
$[30] = children;
|
|
183
|
+
$[31] = native;
|
|
184
|
+
$[32] = t10;
|
|
185
|
+
} else t10 = $[32];
|
|
186
|
+
let t11;
|
|
187
|
+
if ($[33] !== t10 || $[34] !== t9) {
|
|
188
|
+
t11 = /* @__PURE__ */ jsx("canvas", {
|
|
182
189
|
ref: sourceRef,
|
|
183
|
-
|
|
190
|
+
...markup.canvas,
|
|
184
191
|
suppressHydrationWarning: true,
|
|
185
|
-
style:
|
|
186
|
-
children:
|
|
192
|
+
style: t9,
|
|
193
|
+
children: t10
|
|
187
194
|
});
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
} else
|
|
192
|
-
let
|
|
193
|
-
if ($[
|
|
194
|
-
|
|
195
|
+
$[33] = t10;
|
|
196
|
+
$[34] = t9;
|
|
197
|
+
$[35] = t11;
|
|
198
|
+
} else t11 = $[35];
|
|
199
|
+
let t12;
|
|
200
|
+
if ($[36] !== children || $[37] !== native) {
|
|
201
|
+
t12 = !native ? /* @__PURE__ */ jsx("div", {
|
|
195
202
|
ref: contentRef,
|
|
196
203
|
style: {
|
|
197
204
|
position: "relative",
|
|
@@ -200,13 +207,13 @@ function Ripple(t0) {
|
|
|
200
207
|
},
|
|
201
208
|
children
|
|
202
209
|
}) : null;
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
} else
|
|
207
|
-
let
|
|
208
|
-
if ($[
|
|
209
|
-
|
|
210
|
+
$[36] = children;
|
|
211
|
+
$[37] = native;
|
|
212
|
+
$[38] = t12;
|
|
213
|
+
} else t12 = $[38];
|
|
214
|
+
let t13;
|
|
215
|
+
if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
|
|
216
|
+
t13 = /* @__PURE__ */ jsx("canvas", {
|
|
210
217
|
ref: outputRef,
|
|
211
218
|
"aria-hidden": true,
|
|
212
219
|
style: {
|
|
@@ -217,26 +224,26 @@ function Ripple(t0) {
|
|
|
217
224
|
pointerEvents: "none"
|
|
218
225
|
}
|
|
219
226
|
});
|
|
220
|
-
$[
|
|
221
|
-
} else
|
|
222
|
-
let
|
|
223
|
-
if ($[
|
|
224
|
-
|
|
227
|
+
$[39] = t13;
|
|
228
|
+
} else t13 = $[39];
|
|
229
|
+
let t14;
|
|
230
|
+
if ($[40] !== className || $[41] !== t11 || $[42] !== t12 || $[43] !== t8) {
|
|
231
|
+
t14 = /* @__PURE__ */ jsxs("div", {
|
|
225
232
|
className,
|
|
226
|
-
style:
|
|
233
|
+
style: t8,
|
|
227
234
|
children: [
|
|
228
|
-
t10,
|
|
229
235
|
t11,
|
|
230
|
-
t12
|
|
236
|
+
t12,
|
|
237
|
+
t13
|
|
231
238
|
]
|
|
232
239
|
});
|
|
233
|
-
$[
|
|
234
|
-
$[40] = t10;
|
|
240
|
+
$[40] = className;
|
|
235
241
|
$[41] = t11;
|
|
236
|
-
$[42] =
|
|
237
|
-
$[43] =
|
|
238
|
-
|
|
239
|
-
|
|
242
|
+
$[42] = t12;
|
|
243
|
+
$[43] = t8;
|
|
244
|
+
$[44] = t14;
|
|
245
|
+
} else t14 = $[44];
|
|
246
|
+
return t14;
|
|
240
247
|
}
|
|
241
248
|
function _temp() {
|
|
242
249
|
return false;
|