react-kui 3.1.1 → 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 +33 -36
- 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/input/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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 input_group_default from "./input-group.js";
|
|
10
10
|
import input_default$1 from "./input.js";
|
|
11
11
|
import textarea_default from "./textarea.js";
|
|
12
12
|
//#region components/input/index.ts
|
|
13
13
|
var input_default = input_default$1;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { input_default$1 as Input, InputGroup, textarea_default as TextArea, input_default as default };
|
|
15
|
+
export { input_default$1 as Input, input_group_default as InputGroup, textarea_default as TextArea, input_default as default };
|
package/es/input/input-base.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
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 { resolveTheme, useFormAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import { CircleX, Eye, EyeOff, Search } 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";
|
|
13
13
|
import { SizeContext } from "../config/size-context.js";
|
|
14
14
|
import { isEmpty } from "../utils/number.js";
|
|
15
15
|
import InputBox from "./input-box.js";
|
|
16
|
-
import
|
|
16
|
+
import input_group_default from "./input-group.js";
|
|
17
17
|
import clsx from "clsx";
|
|
18
18
|
import React, { useContext, useImperativeHandle, useRef, useState } from "react";
|
|
19
19
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
20
|
//#region components/input/input-base.tsx
|
|
21
21
|
/** Shared implementation. Deliberately absent from the public component barrel. */
|
|
22
22
|
var InputBase = React.forwardRef(({ clearable = true, visiblePasswordIcon = true, size: sizeProp, value, disabled = false, readOnly = false, type = "text", icon, suffix, prefix, addonBefore, addonAfter, theme: themeProp, shape: shapeProp, onSearch, onIconClick, onClear, onChange, className = "", style, onFocus, onBlur, onInput, controls, stylePrefix: inputType = "input", ...rest }, ref) => {
|
|
23
|
-
const inheritedAppearance =
|
|
23
|
+
const inheritedAppearance = useFormAppearance();
|
|
24
24
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
25
|
-
const theme = themeProp ?? inheritedAppearance.theme
|
|
25
|
+
const theme = resolveTheme(themeProp ?? inheritedAppearance.theme, "fill");
|
|
26
26
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
27
27
|
const parentSize = useContext(SizeContext);
|
|
28
28
|
const currentSize = sizeProp ?? parentSize ?? size;
|
|
@@ -128,7 +128,7 @@ var InputBase = React.forwardRef(({ clearable = true, visiblePasswordIcon = true
|
|
|
128
128
|
[`k-${inputType}-has-clear`]: clearableShow,
|
|
129
129
|
[`k-${inputType}-sm`]: currentSize === "small",
|
|
130
130
|
[`k-${inputType}-lg`]: currentSize === "large",
|
|
131
|
-
[`k-${inputType}-${theme}`]:
|
|
131
|
+
[`k-${inputType}-${theme}`]: true,
|
|
132
132
|
[`k-${inputType}-circle`]: shape === "circle",
|
|
133
133
|
[`k-${inputType}-square`]: shape === "square"
|
|
134
134
|
}, !useGroup && className);
|
|
@@ -169,7 +169,7 @@ var InputBase = React.forwardRef(({ clearable = true, visiblePasswordIcon = true
|
|
|
169
169
|
const suffixNode = getSuffix();
|
|
170
170
|
if (suffixNode) innerChildren.push(/* @__PURE__ */ jsx(React.Fragment, { children: suffixNode }, "input-suffix-node"));
|
|
171
171
|
if (controls) innerChildren.push(/* @__PURE__ */ jsx(React.Fragment, { children: controls }, "input-controls"));
|
|
172
|
-
if (useGroup) return /* @__PURE__ */ jsxs(
|
|
172
|
+
if (useGroup) return /* @__PURE__ */ jsxs(input_group_default, {
|
|
173
173
|
size: currentSize,
|
|
174
174
|
theme,
|
|
175
175
|
className,
|
package/es/input/input-box.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
|
|
@@ -19,7 +19,7 @@ var InputBox = ({ multiple, disabled, size, type, theme, shape, inputType, value
|
|
|
19
19
|
[`k-${inputType}-disabled`]: disabled,
|
|
20
20
|
[`k-${inputType}-sm`]: size === "small" && !multiple,
|
|
21
21
|
[`k-${inputType}-lg`]: size === "large" && !multiple,
|
|
22
|
-
[`k-${inputType}-${theme}`]:
|
|
22
|
+
[`k-${inputType}-${theme}`]: !multiple,
|
|
23
23
|
[`k-${inputType}-circle`]: shape === "circle" && !multiple,
|
|
24
24
|
[`k-${inputType}-square`]: shape === "square" && !multiple
|
|
25
25
|
}, className);
|
package/es/input/input-group.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,144 +7,60 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { getChildren } from "../utils/react-node.js";
|
|
10
|
-
import {
|
|
10
|
+
import { resolveTheme, useFormAppearance } from "../config/use-config-appearance.js";
|
|
11
11
|
import { SizeContext } from "../config/size-context.js";
|
|
12
|
-
import {
|
|
12
|
+
import { markFormFieldWrapper } from "../form/field-context.js";
|
|
13
13
|
import clsx from "clsx";
|
|
14
14
|
import React, { useContext } from "react";
|
|
15
15
|
import { jsx } from "react/jsx-runtime";
|
|
16
16
|
//#region components/input/input-group.tsx
|
|
17
|
-
var InputGroup = (
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
let rest;
|
|
21
|
-
let sizeProp;
|
|
22
|
-
let style;
|
|
23
|
-
let t1;
|
|
24
|
-
let t2;
|
|
25
|
-
let t3;
|
|
26
|
-
let themeProp;
|
|
27
|
-
if ($[0] !== t0) {
|
|
28
|
-
({block: t1, compact: t2, theme: themeProp, size: sizeProp, children, className: t3, style, ...rest} = t0);
|
|
29
|
-
$[0] = t0;
|
|
30
|
-
$[1] = children;
|
|
31
|
-
$[2] = rest;
|
|
32
|
-
$[3] = sizeProp;
|
|
33
|
-
$[4] = style;
|
|
34
|
-
$[5] = t1;
|
|
35
|
-
$[6] = t2;
|
|
36
|
-
$[7] = t3;
|
|
37
|
-
$[8] = themeProp;
|
|
38
|
-
} else {
|
|
39
|
-
children = $[1];
|
|
40
|
-
rest = $[2];
|
|
41
|
-
sizeProp = $[3];
|
|
42
|
-
style = $[4];
|
|
43
|
-
t1 = $[5];
|
|
44
|
-
t2 = $[6];
|
|
45
|
-
t3 = $[7];
|
|
46
|
-
themeProp = $[8];
|
|
47
|
-
}
|
|
48
|
-
const block = t1 === void 0 ? false : t1;
|
|
49
|
-
const compact = t2 === void 0 ? true : t2;
|
|
50
|
-
const className = t3 === void 0 ? "" : t3;
|
|
51
|
-
const inheritedAppearance = useConfigAppearance();
|
|
52
|
-
const theme = themeProp ?? inheritedAppearance.theme ?? "fill";
|
|
17
|
+
var InputGroup = ({ block = false, compact = true, theme: themeProp, size: sizeProp, children, className = "", style, ...rest }) => {
|
|
18
|
+
const inheritedAppearance = useFormAppearance();
|
|
19
|
+
const theme = resolveTheme(themeProp ?? inheritedAppearance.theme, "fill");
|
|
53
20
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
54
21
|
const parentSize = useContext(SizeContext);
|
|
55
22
|
const currentSize = sizeProp ?? parentSize ?? size;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"k-input-group-compact": compact,
|
|
67
|
-
"k-input-group-block": block,
|
|
68
|
-
"k-input-group-fill": t4,
|
|
69
|
-
"k-input-group-lg": t5,
|
|
70
|
-
"k-input-group-sm": t6
|
|
71
|
-
}, className);
|
|
72
|
-
$[17] = block;
|
|
73
|
-
$[18] = className;
|
|
74
|
-
$[19] = compact;
|
|
75
|
-
$[20] = t4;
|
|
76
|
-
$[21] = t5;
|
|
77
|
-
$[22] = t6;
|
|
78
|
-
$[23] = t7;
|
|
79
|
-
} else t7 = $[23];
|
|
80
|
-
classes = t7;
|
|
81
|
-
if (!compact && currentSize !== void 0) {
|
|
82
|
-
if (typeof currentSize === "number") rootStyle.gap = `${currentSize}px`;
|
|
83
|
-
}
|
|
84
|
-
$[9] = block;
|
|
85
|
-
$[10] = className;
|
|
86
|
-
$[11] = compact;
|
|
87
|
-
$[12] = currentSize;
|
|
88
|
-
$[13] = style;
|
|
89
|
-
$[14] = theme;
|
|
90
|
-
$[15] = classes;
|
|
91
|
-
$[16] = rootStyle;
|
|
92
|
-
} else {
|
|
93
|
-
classes = $[15];
|
|
94
|
-
rootStyle = $[16];
|
|
23
|
+
const rootStyle = { ...style };
|
|
24
|
+
const classes = clsx("k-input-group", {
|
|
25
|
+
"k-input-group-compact": compact,
|
|
26
|
+
"k-input-group-block": block,
|
|
27
|
+
[`k-input-group-${theme}`]: true,
|
|
28
|
+
"k-input-group-lg": currentSize === "large",
|
|
29
|
+
"k-input-group-sm": currentSize === "small"
|
|
30
|
+
}, className);
|
|
31
|
+
if (!compact && currentSize !== void 0) {
|
|
32
|
+
if (typeof currentSize === "number") rootStyle.gap = `${currentSize}px`;
|
|
95
33
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
$[25] = compact;
|
|
120
|
-
$[26] = processedChildren;
|
|
121
|
-
} else processedChildren = $[26];
|
|
122
|
-
const t4 = typeof currentSize === "string" ? currentSize : void 0;
|
|
123
|
-
let t5;
|
|
124
|
-
if ($[27] !== classes || $[28] !== processedChildren || $[29] !== rest || $[30] !== rootStyle) {
|
|
125
|
-
t5 = /* @__PURE__ */ jsx("div", {
|
|
34
|
+
const childList = getChildren(children);
|
|
35
|
+
let processedChildren = childList;
|
|
36
|
+
if (compact && childList.length > 0) processedChildren = childList.map((child, i) => {
|
|
37
|
+
if (React.isValidElement(child)) {
|
|
38
|
+
const itemClass = clsx(child.props.className || "", {
|
|
39
|
+
"k-input-group-first-item": i === 0,
|
|
40
|
+
"k-input-group-item": i > 0 && i < childList.length - 1,
|
|
41
|
+
"k-input-group-last-item": i === childList.length - 1
|
|
42
|
+
});
|
|
43
|
+
const childProps = child.props;
|
|
44
|
+
const nestedChildren = getChildren(childProps.children);
|
|
45
|
+
const nextChildren = nestedChildren.length === 1 && React.isValidElement(nestedChildren[0]) ? React.cloneElement(nestedChildren[0], { className: clsx(nestedChildren[0].props.className, itemClass) }) : childProps.children;
|
|
46
|
+
return React.cloneElement(child, {
|
|
47
|
+
className: itemClass,
|
|
48
|
+
children: nextChildren,
|
|
49
|
+
key: child.key || `item-${i}`
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return child;
|
|
53
|
+
});
|
|
54
|
+
return /* @__PURE__ */ jsx(SizeContext.Provider, {
|
|
55
|
+
value: typeof currentSize === "string" ? currentSize : void 0,
|
|
56
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
126
57
|
className: classes,
|
|
127
58
|
style: rootStyle,
|
|
128
59
|
...rest,
|
|
129
60
|
children: processedChildren
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
$[28] = processedChildren;
|
|
133
|
-
$[29] = rest;
|
|
134
|
-
$[30] = rootStyle;
|
|
135
|
-
$[31] = t5;
|
|
136
|
-
} else t5 = $[31];
|
|
137
|
-
let t6;
|
|
138
|
-
if ($[32] !== t4 || $[33] !== t5) {
|
|
139
|
-
t6 = /* @__PURE__ */ jsx(SizeContext.Provider, {
|
|
140
|
-
value: t4,
|
|
141
|
-
children: t5
|
|
142
|
-
});
|
|
143
|
-
$[32] = t4;
|
|
144
|
-
$[33] = t5;
|
|
145
|
-
$[34] = t6;
|
|
146
|
-
} else t6 = $[34];
|
|
147
|
-
return t6;
|
|
61
|
+
})
|
|
62
|
+
});
|
|
148
63
|
};
|
|
64
|
+
var input_group_default = markFormFieldWrapper(InputGroup);
|
|
149
65
|
//#endregion
|
|
150
|
-
export {
|
|
66
|
+
export { input_group_default as default };
|
package/es/input/input.js
CHANGED
package/es/input/textarea.js
CHANGED
|
@@ -1,135 +1,49 @@
|
|
|
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 { resolveTheme, 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
|
-
import { c } from "react/compiler-runtime";
|
|
13
12
|
import clsx from "clsx";
|
|
14
13
|
import React from "react";
|
|
15
14
|
import { jsx } from "react/jsx-runtime";
|
|
16
15
|
//#region components/input/textarea.tsx
|
|
17
|
-
var TextArea = React.forwardRef((
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
let placeholder;
|
|
21
|
-
let rest;
|
|
22
|
-
let shapeProp;
|
|
23
|
-
let sizeProp;
|
|
24
|
-
let t1;
|
|
25
|
-
let t2;
|
|
26
|
-
let t3;
|
|
27
|
-
let themeProp;
|
|
28
|
-
let value;
|
|
29
|
-
if ($[0] !== t0) {
|
|
30
|
-
({value, theme: themeProp, shape: shapeProp, size: sizeProp, placeholder, rows: t1, disabled: t2, onChange, className: t3, ...rest} = t0);
|
|
31
|
-
$[0] = t0;
|
|
32
|
-
$[1] = onChange;
|
|
33
|
-
$[2] = placeholder;
|
|
34
|
-
$[3] = rest;
|
|
35
|
-
$[4] = shapeProp;
|
|
36
|
-
$[5] = sizeProp;
|
|
37
|
-
$[6] = t1;
|
|
38
|
-
$[7] = t2;
|
|
39
|
-
$[8] = t3;
|
|
40
|
-
$[9] = themeProp;
|
|
41
|
-
$[10] = value;
|
|
42
|
-
} else {
|
|
43
|
-
onChange = $[1];
|
|
44
|
-
placeholder = $[2];
|
|
45
|
-
rest = $[3];
|
|
46
|
-
shapeProp = $[4];
|
|
47
|
-
sizeProp = $[5];
|
|
48
|
-
t1 = $[6];
|
|
49
|
-
t2 = $[7];
|
|
50
|
-
t3 = $[8];
|
|
51
|
-
themeProp = $[9];
|
|
52
|
-
value = $[10];
|
|
53
|
-
}
|
|
54
|
-
const rows = t1 === void 0 ? 2 : t1;
|
|
55
|
-
const disabled = t2 === void 0 ? false : t2;
|
|
56
|
-
const className = t3 === void 0 ? "" : t3;
|
|
57
|
-
const inheritedAppearance = useConfigAppearance();
|
|
58
|
-
const theme = themeProp ?? inheritedAppearance.theme ?? "fill";
|
|
16
|
+
var TextArea = React.forwardRef(({ value, theme: themeProp, shape: shapeProp, size: sizeProp, placeholder, rows = 2, disabled = false, onChange, className = "", ...rest }, ref) => {
|
|
17
|
+
const inheritedAppearance = useFormAppearance();
|
|
18
|
+
const theme = resolveTheme(themeProp ?? inheritedAppearance.theme, "fill");
|
|
59
19
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
60
20
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
61
|
-
const [innerValue, setInnerValue] = useValue(value,
|
|
21
|
+
const [innerValue, setInnerValue] = useValue(value, (next) => next ?? "");
|
|
62
22
|
const currentValue = innerValue;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"k-textarea-fill": t5,
|
|
86
|
-
"k-textarea-outline": t6,
|
|
87
|
-
"k-textarea-plain": t7,
|
|
88
|
-
"k-textarea-sm": t8,
|
|
89
|
-
"k-textarea-square": t9,
|
|
90
|
-
"k-textarea-circle": t10,
|
|
91
|
-
"k-textarea-lg": t11
|
|
92
|
-
}, className);
|
|
93
|
-
$[14] = className;
|
|
94
|
-
$[15] = t10;
|
|
95
|
-
$[16] = t11;
|
|
96
|
-
$[17] = t5;
|
|
97
|
-
$[18] = t6;
|
|
98
|
-
$[19] = t7;
|
|
99
|
-
$[20] = t8;
|
|
100
|
-
$[21] = t9;
|
|
101
|
-
$[22] = t12;
|
|
102
|
-
} else t12 = $[22];
|
|
103
|
-
const classes = t12;
|
|
104
|
-
const t13 = currentValue ?? "";
|
|
105
|
-
let t14;
|
|
106
|
-
if ($[23] !== classes || $[24] !== disabled || $[25] !== handleChange || $[26] !== placeholder || $[27] !== ref || $[28] !== rest || $[29] !== rows || $[30] !== t13) {
|
|
107
|
-
t14 = /* @__PURE__ */ jsx("textarea", {
|
|
108
|
-
ref,
|
|
109
|
-
placeholder,
|
|
110
|
-
rows,
|
|
111
|
-
className: classes,
|
|
112
|
-
disabled,
|
|
113
|
-
value: t13,
|
|
114
|
-
onChange: handleChange,
|
|
115
|
-
...rest
|
|
116
|
-
});
|
|
117
|
-
$[23] = classes;
|
|
118
|
-
$[24] = disabled;
|
|
119
|
-
$[25] = handleChange;
|
|
120
|
-
$[26] = placeholder;
|
|
121
|
-
$[27] = ref;
|
|
122
|
-
$[28] = rest;
|
|
123
|
-
$[29] = rows;
|
|
124
|
-
$[30] = t13;
|
|
125
|
-
$[31] = t14;
|
|
126
|
-
} else t14 = $[31];
|
|
127
|
-
return t14;
|
|
23
|
+
const handleChange = (e) => {
|
|
24
|
+
const v = e.target.value;
|
|
25
|
+
setInnerValue(v);
|
|
26
|
+
onChange?.(v);
|
|
27
|
+
};
|
|
28
|
+
const classes = clsx("k-textarea", {
|
|
29
|
+
[`k-textarea-${theme}`]: true,
|
|
30
|
+
"k-textarea-sm": size === "small",
|
|
31
|
+
"k-textarea-square": shape === "square",
|
|
32
|
+
"k-textarea-circle": shape === "circle",
|
|
33
|
+
"k-textarea-lg": size === "large"
|
|
34
|
+
}, className);
|
|
35
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
36
|
+
ref,
|
|
37
|
+
placeholder,
|
|
38
|
+
rows,
|
|
39
|
+
className: classes,
|
|
40
|
+
disabled,
|
|
41
|
+
value: currentValue ?? "",
|
|
42
|
+
onChange: handleChange,
|
|
43
|
+
...rest
|
|
44
|
+
});
|
|
128
45
|
});
|
|
129
46
|
TextArea.displayName = "TextArea";
|
|
130
47
|
var textarea_default = createFormFieldComponent(TextArea);
|
|
131
|
-
function _temp(next) {
|
|
132
|
-
return next ?? "";
|
|
133
|
-
}
|
|
134
48
|
//#endregion
|
|
135
49
|
export { textarea_default as default };
|
package/es/input-number/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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 { resolveTheme, useFormAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import { ChevronDown, ChevronUp } 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";
|
|
@@ -18,9 +18,9 @@ import { useContext, useState } from "react";
|
|
|
18
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
import Big from "big.js";
|
|
20
20
|
//#region components/input-number/index.tsx
|
|
21
|
-
var InputNumber = ({ value, min = -Infinity, max = Infinity, step = 1, precision, formatter, parser, disabled = false, readOnly = false, controls = true, keyboard = true, suffix, prefix, theme: themeProp, shape: shapeProp, icon, size: sizeProp, placeholder, onChange, onBlur, onKeyDown, ...rest }) => {
|
|
22
|
-
const inheritedAppearance =
|
|
23
|
-
const theme = themeProp ?? inheritedAppearance.theme
|
|
21
|
+
var InputNumber = ({ value, min = -Infinity, max = Infinity, step = 1, precision, formatter, parser, disabled = false, readOnly = false, controls = true, keyboard = true, suffix, prefix, addonBefore, addonAfter, theme: themeProp, shape: shapeProp, icon, size: sizeProp, placeholder, onChange, onBlur, onKeyDown, ...rest }) => {
|
|
22
|
+
const inheritedAppearance = useFormAppearance();
|
|
23
|
+
const theme = resolveTheme(themeProp ?? inheritedAppearance.theme, "fill");
|
|
24
24
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
25
25
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
26
26
|
const parentSize = useContext(SizeContext);
|
|
@@ -132,6 +132,8 @@ var InputNumber = ({ value, min = -Infinity, max = Infinity, step = 1, precision
|
|
|
132
132
|
placeholder,
|
|
133
133
|
suffix,
|
|
134
134
|
prefix,
|
|
135
|
+
addonBefore,
|
|
136
|
+
addonAfter,
|
|
135
137
|
size: sizeProp ?? parentSize ?? size,
|
|
136
138
|
icon,
|
|
137
139
|
shape,
|
package/es/input-otp/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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 { resolveTheme, 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 clsx from "clsx";
|
|
@@ -14,9 +14,9 @@ import { Fragment, forwardRef, useCallback, useImperativeHandle, useRef } from "
|
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
//#region components/input-otp/index.tsx
|
|
16
16
|
var InputOTP = forwardRef(function InputOTP({ value, length = 6, type = "number", size: sizeProp, disabled = false, readOnly = false, mask = false, autoFocus = false, separator, validator, theme: themeProp, shape: shapeProp, onChange, onComplete, onFocus, onBlur, className, ...rest }, ref) {
|
|
17
|
-
const inheritedAppearance =
|
|
17
|
+
const inheritedAppearance = useFormAppearance();
|
|
18
18
|
const size = sizeProp ?? inheritedAppearance.size;
|
|
19
|
-
const theme = themeProp ?? inheritedAppearance.theme
|
|
19
|
+
const theme = resolveTheme(themeProp ?? inheritedAppearance.theme, "fill");
|
|
20
20
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
21
21
|
const normalize = useCallback((source) => Array.from(String(source ?? "")).filter((character) => type === "number" ? /\d/.test(character) : true).filter((character_0) => validator ? validator(character_0) : true).join("").slice(0, Math.max(0, Math.trunc(length))), [
|
|
22
22
|
length,
|
|
@@ -93,7 +93,7 @@ var InputOTP = forwardRef(function InputOTP({ value, length = 6, type = "number"
|
|
|
93
93
|
"k-input-otp-lg": size === "large",
|
|
94
94
|
"k-input-otp-disabled": disabled,
|
|
95
95
|
"k-input-otp-readonly": readOnly,
|
|
96
|
-
[`k-input-otp-${theme}`]:
|
|
96
|
+
[`k-input-otp-${theme}`]: true,
|
|
97
97
|
[`k-input-otp-${shape}`]: shape
|
|
98
98
|
}, className),
|
|
99
99
|
role: "group",
|
package/es/input-tag/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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 { resolveTheme, useFormAppearance } from "../config/use-config-appearance.js";
|
|
10
10
|
import { CircleX } 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,10 +17,10 @@ import { useRef, useState } from "react";
|
|
|
17
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
18
|
//#region components/input-tag/index.tsx
|
|
19
19
|
var InputTag = ({ value, placeholder, disabled = false, readOnly = false, clearable = true, block = false, allowDuplicates = false, max, maxTagCount, separators = [","], size: sizeProp, shape: shapeProp, theme: themeProp, onChange, onAdd, onRemove, onClear, className, onClick, ...rest }) => {
|
|
20
|
-
const inheritedAppearance =
|
|
20
|
+
const inheritedAppearance = useFormAppearance();
|
|
21
21
|
const size = sizeProp ?? inheritedAppearance.size ?? "medium";
|
|
22
22
|
const shape = shapeProp ?? inheritedAppearance.shape;
|
|
23
|
-
const theme = themeProp ?? inheritedAppearance.theme
|
|
23
|
+
const theme = resolveTheme(themeProp ?? inheritedAppearance.theme, "fill");
|
|
24
24
|
const [inner, setInner] = useValue(value, (next) => next ?? []);
|
|
25
25
|
const [draft, setDraft] = useState("");
|
|
26
26
|
const inputRef = useRef(null);
|
|
@@ -83,7 +83,7 @@ var InputTag = ({ value, placeholder, disabled = false, readOnly = false, cleara
|
|
|
83
83
|
"k-input-tag-block": block,
|
|
84
84
|
"k-input-tag-lg": size === "large",
|
|
85
85
|
[`k-input-tag-${shape}`]: shape,
|
|
86
|
-
[`k-input-tag-${theme}`]:
|
|
86
|
+
[`k-input-tag-${theme}`]: true
|
|
87
87
|
}, className),
|
|
88
88
|
onClick: (event_1) => {
|
|
89
89
|
if (disabled) return;
|