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
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { ConfigContextValue } from './config-context.cjs';
|
|
1
2
|
interface Point {
|
|
2
3
|
x: number;
|
|
3
4
|
y: number;
|
|
4
5
|
}
|
|
5
6
|
export declare const recordMousePoint: () => void;
|
|
6
7
|
export declare const getMousePoint: () => Point;
|
|
8
|
+
export declare const pushConfig: (config: ConfigContextValue) => () => void;
|
|
9
|
+
/** 当前该给命令式弹窗用的配置;页面上没有 ConfigProvider 时返回 null。 */
|
|
10
|
+
export declare const currentConfig: () => ConfigContextValue | null;
|
|
11
|
+
/** 配置换了要通知活着的命令式弹窗重渲染,否则它们会停在打开那一刻的语言/尺寸上。 */
|
|
12
|
+
export declare const subscribeConfig: (listener: () => void) => () => void;
|
|
7
13
|
export {};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { ConfigContextValue } from './config-context.js';
|
|
1
2
|
interface Point {
|
|
2
3
|
x: number;
|
|
3
4
|
y: number;
|
|
4
5
|
}
|
|
5
6
|
export declare const recordMousePoint: () => void;
|
|
6
7
|
export declare const getMousePoint: () => Point;
|
|
8
|
+
export declare const pushConfig: (config: ConfigContextValue) => () => void;
|
|
9
|
+
/** 当前该给命令式弹窗用的配置;页面上没有 ConfigProvider 时返回 null。 */
|
|
10
|
+
export declare const currentConfig: () => ConfigContextValue | null;
|
|
11
|
+
/** 配置换了要通知活着的命令式弹窗重渲染,否则它们会停在打开那一刻的语言/尺寸上。 */
|
|
12
|
+
export declare const subscribeConfig: (listener: () => void) => () => void;
|
|
7
13
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type PopupCloser = () => void;
|
|
2
|
+
type PopupRegistrar = (close: PopupCloser) => () => void;
|
|
3
|
+
/**
|
|
4
|
+
* Modal / Drawer 用它给自己圈一个浮层作用域:挂在里面的 Popup(下拉、气泡、子菜单……)
|
|
5
|
+
* 把关闭方法登记进来,宿主窗口关的时候一起关掉——否则窗口都没了,teleported 的下拉还悬在 body 上。
|
|
6
|
+
* Vue 侧是同名 API 的 provide/inject 版(components/config/popup-host.ts)。
|
|
7
|
+
*/
|
|
8
|
+
export declare const PopupHostContext: import('react').Context<PopupRegistrar | null>;
|
|
9
|
+
/** 宿主窗口(Modal / Drawer)用:拿到 register 传给 Provider,关窗时调 closeAll。 */
|
|
10
|
+
export declare function usePopupHostScope(): {
|
|
11
|
+
register: PopupRegistrar;
|
|
12
|
+
closeAll: () => void;
|
|
13
|
+
};
|
|
14
|
+
/** 浮层用:把自己的关闭方法登记给最近的宿主窗口;外面没有宿主时什么都不做。 */
|
|
15
|
+
export declare function usePopupHost(close: PopupCloser): void;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type PopupCloser = () => void;
|
|
2
|
+
type PopupRegistrar = (close: PopupCloser) => () => void;
|
|
3
|
+
/**
|
|
4
|
+
* Modal / Drawer 用它给自己圈一个浮层作用域:挂在里面的 Popup(下拉、气泡、子菜单……)
|
|
5
|
+
* 把关闭方法登记进来,宿主窗口关的时候一起关掉——否则窗口都没了,teleported 的下拉还悬在 body 上。
|
|
6
|
+
* Vue 侧是同名 API 的 provide/inject 版(components/config/popup-host.ts)。
|
|
7
|
+
*/
|
|
8
|
+
export declare const PopupHostContext: import('react').Context<PopupRegistrar | null>;
|
|
9
|
+
/** 宿主窗口(Modal / Drawer)用:拿到 register 传给 Provider,关窗时调 closeAll。 */
|
|
10
|
+
export declare function usePopupHostScope(): {
|
|
11
|
+
register: PopupRegistrar;
|
|
12
|
+
closeAll: () => void;
|
|
13
|
+
};
|
|
14
|
+
/** 浮层用:把自己的关闭方法登记给最近的宿主窗口;外面没有宿主时什么都不做。 */
|
|
15
|
+
export declare function usePopupHost(close: PopupCloser): void;
|
|
16
|
+
export {};
|
|
@@ -1,7 +1,46 @@
|
|
|
1
|
-
import { ShapeType } from '../const/types.cjs';
|
|
1
|
+
import { MarkThemeType, ShapeType, SurfaceThemeType, ThemeType } from '../const/types.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* What a `ConfigProvider` says about everything under it. Form is deliberately absent: `Form`'s `size`,
|
|
4
|
+
* `shape` and `theme` are documented as the appearance of its *child controls*, and a Card, Table or Alert
|
|
5
|
+
* sitting inside a form is not one — inheriting there meant `<Form size="small">` shrank every panel around it.
|
|
6
|
+
* Controls call `useFormAppearance` instead, which keeps the same three keys and layers Form on top.
|
|
7
|
+
*/
|
|
2
8
|
export declare function useConfigAppearance(): {
|
|
3
9
|
size: import('../index.cjs').SizeType | undefined;
|
|
4
10
|
shape: ShapeType | undefined;
|
|
5
|
-
theme:
|
|
11
|
+
theme: ThemeType | undefined;
|
|
12
|
+
};
|
|
13
|
+
/** For the controls a `Form` wraps: what the form says, then what the provider says. */
|
|
14
|
+
export declare function useFormAppearance(): {
|
|
15
|
+
size: import('../index.cjs').SizeType | undefined;
|
|
16
|
+
shape: ShapeType | undefined;
|
|
17
|
+
theme: ThemeType | undefined;
|
|
6
18
|
};
|
|
7
19
|
export declare function normalizeSurfaceShape(shape: ShapeType | undefined): "round" | "default" | "square" | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Every component that paints tier classes resolves its value here instead of copying the comparison.
|
|
22
|
+
* Writing no `theme` at all is how a caller says "listen to the component", and this returns the tier
|
|
23
|
+
* that component was built to look like — the same class it reaches with no `theme`, so the two can
|
|
24
|
+
* never drift. A component's own default differs (input-family is `fill`, `collapse` is `outline`,
|
|
25
|
+
* `image` is `plain`), which is why the fallback is a parameter rather than a constant.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveTheme(theme: ThemeType | undefined, fallback: ThemeType): ThemeType;
|
|
28
|
+
/**
|
|
29
|
+
* The other shape of "listen to the component": some components own no tier class for their default
|
|
30
|
+
* look at all. Button's `k-btn-default` is a *type* class, and a tier the stylesheet never paints —
|
|
31
|
+
* `k-btn-underlined`, since an underline only means something on a control you type into — is a dead
|
|
32
|
+
* class. An unguarded `` [`k-<component>-${theme}`]: theme `` ships both, so a component in this shape
|
|
33
|
+
* resolves through here: a value outside the tiers it actually paints yields `undefined`, emits no tier
|
|
34
|
+
* class, and leaves the component's own look in place.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolvePaintedTheme<T extends ThemeType>(theme: ThemeType | undefined, painted: readonly T[]): T | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The two painted sets as values, for the components that hand a tier *onward* instead of painting it:
|
|
39
|
+
* a group forwarding to its items, a dropdown forwarding to its buttons, a chip list forwarding to
|
|
40
|
+
* `Tag`. Those callers must vouch for what they pass — `theme` is typed by what the receiver paints —
|
|
41
|
+
* so they run the inherited value through the receiver's guard rather than forwarding a tier the
|
|
42
|
+
* receiver would only fall back from. A component that paints its own surface keeps its own
|
|
43
|
+
* `PAINTED_THEMES` list next to its stylesheet, because the style contract reads it from there.
|
|
44
|
+
*/
|
|
45
|
+
export declare const SURFACE_THEMES: readonly SurfaceThemeType[];
|
|
46
|
+
export declare const MARK_THEMES: readonly MarkThemeType[];
|
|
@@ -1,7 +1,46 @@
|
|
|
1
|
-
import { ShapeType } from '../const/types.js';
|
|
1
|
+
import { MarkThemeType, ShapeType, SurfaceThemeType, ThemeType } from '../const/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* What a `ConfigProvider` says about everything under it. Form is deliberately absent: `Form`'s `size`,
|
|
4
|
+
* `shape` and `theme` are documented as the appearance of its *child controls*, and a Card, Table or Alert
|
|
5
|
+
* sitting inside a form is not one — inheriting there meant `<Form size="small">` shrank every panel around it.
|
|
6
|
+
* Controls call `useFormAppearance` instead, which keeps the same three keys and layers Form on top.
|
|
7
|
+
*/
|
|
2
8
|
export declare function useConfigAppearance(): {
|
|
3
9
|
size: import('../index.js').SizeType | undefined;
|
|
4
10
|
shape: ShapeType | undefined;
|
|
5
|
-
theme:
|
|
11
|
+
theme: ThemeType | undefined;
|
|
12
|
+
};
|
|
13
|
+
/** For the controls a `Form` wraps: what the form says, then what the provider says. */
|
|
14
|
+
export declare function useFormAppearance(): {
|
|
15
|
+
size: import('../index.js').SizeType | undefined;
|
|
16
|
+
shape: ShapeType | undefined;
|
|
17
|
+
theme: ThemeType | undefined;
|
|
6
18
|
};
|
|
7
19
|
export declare function normalizeSurfaceShape(shape: ShapeType | undefined): "round" | "default" | "square" | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Every component that paints tier classes resolves its value here instead of copying the comparison.
|
|
22
|
+
* Writing no `theme` at all is how a caller says "listen to the component", and this returns the tier
|
|
23
|
+
* that component was built to look like — the same class it reaches with no `theme`, so the two can
|
|
24
|
+
* never drift. A component's own default differs (input-family is `fill`, `collapse` is `outline`,
|
|
25
|
+
* `image` is `plain`), which is why the fallback is a parameter rather than a constant.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveTheme(theme: ThemeType | undefined, fallback: ThemeType): ThemeType;
|
|
28
|
+
/**
|
|
29
|
+
* The other shape of "listen to the component": some components own no tier class for their default
|
|
30
|
+
* look at all. Button's `k-btn-default` is a *type* class, and a tier the stylesheet never paints —
|
|
31
|
+
* `k-btn-underlined`, since an underline only means something on a control you type into — is a dead
|
|
32
|
+
* class. An unguarded `` [`k-<component>-${theme}`]: theme `` ships both, so a component in this shape
|
|
33
|
+
* resolves through here: a value outside the tiers it actually paints yields `undefined`, emits no tier
|
|
34
|
+
* class, and leaves the component's own look in place.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolvePaintedTheme<T extends ThemeType>(theme: ThemeType | undefined, painted: readonly T[]): T | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The two painted sets as values, for the components that hand a tier *onward* instead of painting it:
|
|
39
|
+
* a group forwarding to its items, a dropdown forwarding to its buttons, a chip list forwarding to
|
|
40
|
+
* `Tag`. Those callers must vouch for what they pass — `theme` is typed by what the receiver paints —
|
|
41
|
+
* so they run the inherited value through the receiver's guard rather than forwarding a tier the
|
|
42
|
+
* receiver would only fall back from. A component that paints its own surface keeps its own
|
|
43
|
+
* `PAINTED_THEMES` list next to its stylesheet, because the style contract reads it from there.
|
|
44
|
+
*/
|
|
45
|
+
export declare const SURFACE_THEMES: readonly SurfaceThemeType[];
|
|
46
|
+
export declare const MARK_THEMES: readonly MarkThemeType[];
|
package/types/const/types.d.cts
CHANGED
|
@@ -5,9 +5,38 @@ export type DropPlacementsType = "top" | "top-left" | "top-right" | "bottom" | "
|
|
|
5
5
|
export type ValueType = "string" | "number" | "boolean";
|
|
6
6
|
export type SizeType = "small" | "medium" | "large";
|
|
7
7
|
export type ShapeType = "circle" | "square" | "round" | "default";
|
|
8
|
+
/**
|
|
9
|
+
* Shapes a surface (card / panel / stat card) can actually draw.
|
|
10
|
+
*
|
|
11
|
+
* `ShapeType` is the global vocabulary and keeps `circle` for controls that mean it
|
|
12
|
+
* (Avatar, Badge). A surface rounds its corners instead: a circle would clip the
|
|
13
|
+
* content, so `circle` — inherited from ConfigProvider or passed by an older caller —
|
|
14
|
+
* is normalised to `round`, and `default` keeps the inherited card radius. Same subset
|
|
15
|
+
* as the Vue build.
|
|
16
|
+
*/
|
|
17
|
+
export type SurfaceShapeType = "square" | "round";
|
|
8
18
|
export type BooleanType = boolean | undefined;
|
|
9
19
|
export type ButtonType = "primary" | "danger" | "warning" | "default" | "text" | "link";
|
|
10
|
-
export type ThemeType = "outline" | "fill" | "plain" | "underlined" | "
|
|
20
|
+
export type ThemeType = "outline" | "fill" | "plain" | "underlined" | "solid" | "dashed";
|
|
21
|
+
/**
|
|
22
|
+
* The five tiers a component that paints a *plate* actually draws: every surface (Card, Collapse,
|
|
23
|
+
* Alert, Page, Kanban, Transfer, ListPanel, CheckCard, Image, QRCode, FeedbackPanel) plus Tag and
|
|
24
|
+
* Button. `underlined` belongs to controls you type into — a card with one edge deleted is not an
|
|
25
|
+
* appearance preset — so a surface never accepts it, and the runtime guard
|
|
26
|
+
* (`resolvePaintedTheme(theme, PAINTED_THEMES)`) lands anything outside these five on the plate the
|
|
27
|
+
* component was built to look like.
|
|
28
|
+
*
|
|
29
|
+
* `ThemeType` stays the wider vocabulary of `ConfigProvider` and `Form`: a provider can still say
|
|
30
|
+
* `underlined`, and the component that cannot paint it decides what that means.
|
|
31
|
+
*/
|
|
32
|
+
export type SurfaceThemeType = "fill" | "outline" | "plain" | "solid" | "dashed";
|
|
33
|
+
/**
|
|
34
|
+
* The two tiers a mark actually draws. A checkbox or radio box paints a shallow filled plate
|
|
35
|
+
* (`fill`) or an outlined one (`outline`); the other four would either delete its border or flood
|
|
36
|
+
* the tick, so the mark family — Checkbox, CheckboxGroup, Radio, RadioButton, RadioGroup — accepts
|
|
37
|
+
* only these two, and the guard lands anything else on `fill`.
|
|
38
|
+
*/
|
|
39
|
+
export type MarkThemeType = "fill" | "outline";
|
|
11
40
|
export type RadioType = "radio" | "button";
|
|
12
41
|
export type DirectionType = "horizontal" | "vertical" | "inline";
|
|
13
42
|
export type AlignType = "start" | "center" | "end";
|
package/types/const/types.d.ts
CHANGED
|
@@ -5,9 +5,38 @@ export type DropPlacementsType = "top" | "top-left" | "top-right" | "bottom" | "
|
|
|
5
5
|
export type ValueType = "string" | "number" | "boolean";
|
|
6
6
|
export type SizeType = "small" | "medium" | "large";
|
|
7
7
|
export type ShapeType = "circle" | "square" | "round" | "default";
|
|
8
|
+
/**
|
|
9
|
+
* Shapes a surface (card / panel / stat card) can actually draw.
|
|
10
|
+
*
|
|
11
|
+
* `ShapeType` is the global vocabulary and keeps `circle` for controls that mean it
|
|
12
|
+
* (Avatar, Badge). A surface rounds its corners instead: a circle would clip the
|
|
13
|
+
* content, so `circle` — inherited from ConfigProvider or passed by an older caller —
|
|
14
|
+
* is normalised to `round`, and `default` keeps the inherited card radius. Same subset
|
|
15
|
+
* as the Vue build.
|
|
16
|
+
*/
|
|
17
|
+
export type SurfaceShapeType = "square" | "round";
|
|
8
18
|
export type BooleanType = boolean | undefined;
|
|
9
19
|
export type ButtonType = "primary" | "danger" | "warning" | "default" | "text" | "link";
|
|
10
|
-
export type ThemeType = "outline" | "fill" | "plain" | "underlined" | "
|
|
20
|
+
export type ThemeType = "outline" | "fill" | "plain" | "underlined" | "solid" | "dashed";
|
|
21
|
+
/**
|
|
22
|
+
* The five tiers a component that paints a *plate* actually draws: every surface (Card, Collapse,
|
|
23
|
+
* Alert, Page, Kanban, Transfer, ListPanel, CheckCard, Image, QRCode, FeedbackPanel) plus Tag and
|
|
24
|
+
* Button. `underlined` belongs to controls you type into — a card with one edge deleted is not an
|
|
25
|
+
* appearance preset — so a surface never accepts it, and the runtime guard
|
|
26
|
+
* (`resolvePaintedTheme(theme, PAINTED_THEMES)`) lands anything outside these five on the plate the
|
|
27
|
+
* component was built to look like.
|
|
28
|
+
*
|
|
29
|
+
* `ThemeType` stays the wider vocabulary of `ConfigProvider` and `Form`: a provider can still say
|
|
30
|
+
* `underlined`, and the component that cannot paint it decides what that means.
|
|
31
|
+
*/
|
|
32
|
+
export type SurfaceThemeType = "fill" | "outline" | "plain" | "solid" | "dashed";
|
|
33
|
+
/**
|
|
34
|
+
* The two tiers a mark actually draws. A checkbox or radio box paints a shallow filled plate
|
|
35
|
+
* (`fill`) or an outlined one (`outline`); the other four would either delete its border or flood
|
|
36
|
+
* the tick, so the mark family — Checkbox, CheckboxGroup, Radio, RadioButton, RadioGroup — accepts
|
|
37
|
+
* only these two, and the guard lands anything else on `fill`.
|
|
38
|
+
*/
|
|
39
|
+
export type MarkThemeType = "fill" | "outline";
|
|
11
40
|
export type RadioType = "radio" | "button";
|
|
12
41
|
export type DirectionType = "horizontal" | "vertical" | "inline";
|
|
13
42
|
export type AlignType = "start" | "center" | "end";
|
package/types/const/var.d.cts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 预设色值名,`Tag` / `Badge` / `Button` / `Tooltip` 的 `color` 共用这一套。
|
|
3
|
+
* 里面只有能上色的名字:不传 `color` 就是组件自己的那张表面,给它再取一个名字只会让人以为
|
|
4
|
+
* 色板里存在一套跟主题无关的档。
|
|
5
|
+
*/
|
|
6
|
+
export declare const colors: readonly ["red", "orange", "yellow", "olive", "green", "teal", "blue", "volcano", "violet", "cyan", "gold", "lime", "magenta", "purple", "pink", "brown", "gray"];
|
package/types/const/var.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 预设色值名,`Tag` / `Badge` / `Button` / `Tooltip` 的 `color` 共用这一套。
|
|
3
|
+
* 里面只有能上色的名字:不传 `color` 就是组件自己的那张表面,给它再取一个名字只会让人以为
|
|
4
|
+
* 色板里存在一套跟主题无关的档。
|
|
5
|
+
*/
|
|
6
|
+
export declare const colors: readonly ["red", "orange", "yellow", "olive", "green", "teal", "blue", "volcano", "violet", "cyan", "gold", "lime", "magenta", "purple", "pink", "brown", "gray"];
|
|
@@ -32,6 +32,8 @@ export interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "o
|
|
|
32
32
|
shape?: ShapeType;
|
|
33
33
|
bordered?: boolean;
|
|
34
34
|
placement?: DropPlacementsType;
|
|
35
|
+
/** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
|
|
36
|
+
destroyOnClose?: boolean;
|
|
35
37
|
header?: ReactNode | ((api: {
|
|
36
38
|
emit: (value: DatePickerInput | DatePickerInput[]) => void;
|
|
37
39
|
}) => ReactNode);
|
|
@@ -46,7 +48,7 @@ export interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "o
|
|
|
46
48
|
/** Render only the picker panel without a trigger or portal. */
|
|
47
49
|
panelOnly?: boolean;
|
|
48
50
|
}
|
|
49
|
-
declare function DatePicker({ value, startDate, endDate, valueType, mode, presets, disabled, readOnly, open, clearable, editable, placeholder, format, disabledDate, disabledTime, size: sizeProp, dateIcon, theme: themeProp, shape: shapeProp, bordered, placement, header, footer, onChange, onStartDateChange, onEndDateChange, onOpenChange, onClear, panelOnly, className, style, ...rest }: DatePickerProps): import("react").JSX.Element;
|
|
51
|
+
declare function DatePicker({ value, startDate, endDate, valueType, mode, presets, disabled, readOnly, open, clearable, editable, placeholder, format, disabledDate, disabledTime, size: sizeProp, dateIcon, theme: themeProp, shape: shapeProp, bordered, placement, destroyOnClose, header, footer, onChange, onStartDateChange, onEndDateChange, onOpenChange, onClear, panelOnly, className, style, ...rest }: DatePickerProps): import("react").JSX.Element;
|
|
50
52
|
export type DatePickerPanelProps = Omit<DatePickerProps, "panelOnly" | "open">;
|
|
51
53
|
export declare function DatePickerPanel(props: DatePickerPanelProps): import("react").JSX.Element;
|
|
52
54
|
declare const _default: typeof DatePicker;
|
|
@@ -32,6 +32,8 @@ export interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "o
|
|
|
32
32
|
shape?: ShapeType;
|
|
33
33
|
bordered?: boolean;
|
|
34
34
|
placement?: DropPlacementsType;
|
|
35
|
+
/** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
|
|
36
|
+
destroyOnClose?: boolean;
|
|
35
37
|
header?: ReactNode | ((api: {
|
|
36
38
|
emit: (value: DatePickerInput | DatePickerInput[]) => void;
|
|
37
39
|
}) => ReactNode);
|
|
@@ -46,7 +48,7 @@ export interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "o
|
|
|
46
48
|
/** Render only the picker panel without a trigger or portal. */
|
|
47
49
|
panelOnly?: boolean;
|
|
48
50
|
}
|
|
49
|
-
declare function DatePicker({ value, startDate, endDate, valueType, mode, presets, disabled, readOnly, open, clearable, editable, placeholder, format, disabledDate, disabledTime, size: sizeProp, dateIcon, theme: themeProp, shape: shapeProp, bordered, placement, header, footer, onChange, onStartDateChange, onEndDateChange, onOpenChange, onClear, panelOnly, className, style, ...rest }: DatePickerProps): import("react").JSX.Element;
|
|
51
|
+
declare function DatePicker({ value, startDate, endDate, valueType, mode, presets, disabled, readOnly, open, clearable, editable, placeholder, format, disabledDate, disabledTime, size: sizeProp, dateIcon, theme: themeProp, shape: shapeProp, bordered, placement, destroyOnClose, header, footer, onChange, onStartDateChange, onEndDateChange, onOpenChange, onClear, panelOnly, className, style, ...rest }: DatePickerProps): import("react").JSX.Element;
|
|
50
52
|
export type DatePickerPanelProps = Omit<DatePickerProps, "panelOnly" | "open">;
|
|
51
53
|
export declare function DatePickerPanel(props: DatePickerPanelProps): import("react").JSX.Element;
|
|
52
54
|
declare const _default: typeof DatePicker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { DirectionType,
|
|
2
|
+
import { DirectionType, SizeType, SurfaceShapeType } from '../const/types.cjs';
|
|
3
3
|
import { ResponsiveValue } from '../grid/useBreakpoint.cjs';
|
|
4
4
|
export interface DescriptionsItemProps {
|
|
5
5
|
label?: React.ReactNode;
|
|
@@ -14,7 +14,7 @@ export interface DescriptionsProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
14
14
|
title?: React.ReactNode;
|
|
15
15
|
extra?: React.ReactNode;
|
|
16
16
|
size?: SizeType;
|
|
17
|
-
shape?:
|
|
17
|
+
shape?: SurfaceShapeType;
|
|
18
18
|
children?: React.ReactNode;
|
|
19
19
|
}
|
|
20
20
|
declare const Descriptions: React.FC<DescriptionsProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { DirectionType,
|
|
2
|
+
import { DirectionType, SizeType, SurfaceShapeType } from '../const/types.js';
|
|
3
3
|
import { ResponsiveValue } from '../grid/useBreakpoint.js';
|
|
4
4
|
export interface DescriptionsItemProps {
|
|
5
5
|
label?: React.ReactNode;
|
|
@@ -14,7 +14,7 @@ export interface DescriptionsProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
14
14
|
title?: React.ReactNode;
|
|
15
15
|
extra?: React.ReactNode;
|
|
16
16
|
size?: SizeType;
|
|
17
|
-
shape?:
|
|
17
|
+
shape?: SurfaceShapeType;
|
|
18
18
|
children?: React.ReactNode;
|
|
19
19
|
}
|
|
20
20
|
declare const Descriptions: React.FC<DescriptionsProps>;
|
package/types/drawer/index.d.cts
CHANGED
package/types/drawer/index.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { DropPlacementsType, ShapeType, SizeType,
|
|
2
|
+
import { DropPlacementsType, ShapeType, SizeType, SurfaceThemeType, TriggerType } from '../const/types.cjs';
|
|
3
3
|
import { IconType } from '../icon/index.cjs';
|
|
4
4
|
export interface DropdownButtonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onClick" | "defaultValue" | "defaultChecked"> {
|
|
5
5
|
size?: SizeType;
|
|
6
6
|
shape?: ShapeType;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
icon?: IconType[];
|
|
9
|
-
theme?:
|
|
9
|
+
theme?: SurfaceThemeType;
|
|
10
10
|
arrow?: boolean;
|
|
11
|
+
trigger?: TriggerType;
|
|
11
12
|
placement?: DropPlacementsType;
|
|
13
|
+
/** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
|
|
14
|
+
destroyOnClose?: boolean;
|
|
12
15
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
16
|
overlay?: React.ReactNode;
|
|
14
17
|
children?: React.ReactNode;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { DropPlacementsType, ShapeType, SizeType,
|
|
2
|
+
import { DropPlacementsType, ShapeType, SizeType, SurfaceThemeType, TriggerType } from '../const/types.js';
|
|
3
3
|
import { IconType } from '../icon/index.js';
|
|
4
4
|
export interface DropdownButtonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onClick" | "defaultValue" | "defaultChecked"> {
|
|
5
5
|
size?: SizeType;
|
|
6
6
|
shape?: ShapeType;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
icon?: IconType[];
|
|
9
|
-
theme?:
|
|
9
|
+
theme?: SurfaceThemeType;
|
|
10
10
|
arrow?: boolean;
|
|
11
|
+
trigger?: TriggerType;
|
|
11
12
|
placement?: DropPlacementsType;
|
|
13
|
+
/** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
|
|
14
|
+
destroyOnClose?: boolean;
|
|
12
15
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
16
|
overlay?: React.ReactNode;
|
|
14
17
|
children?: React.ReactNode;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
1
2
|
export interface DropdownContextProps {
|
|
3
|
+
/** target 模式下的触发按钮(DropdownButton 右块)需要自己反映展开状态 */
|
|
4
|
+
expanded?: boolean;
|
|
2
5
|
onMouseEnter?: () => void;
|
|
3
6
|
onMouseLeave?: () => void;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
onContextMenu?: () => void;
|
|
9
|
+
onTriggerKeydown?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
4
10
|
clearPopTimer?: () => void;
|
|
5
11
|
menuSelected?: (data: {
|
|
6
12
|
key: string;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
1
2
|
export interface DropdownContextProps {
|
|
3
|
+
/** target 模式下的触发按钮(DropdownButton 右块)需要自己反映展开状态 */
|
|
4
|
+
expanded?: boolean;
|
|
2
5
|
onMouseEnter?: () => void;
|
|
3
6
|
onMouseLeave?: () => void;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
onContextMenu?: () => void;
|
|
9
|
+
onTriggerKeydown?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
4
10
|
clearPopTimer?: () => void;
|
|
5
11
|
menuSelected?: (data: {
|
|
6
12
|
key: string;
|
|
@@ -8,6 +8,8 @@ export interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
8
8
|
/** @deprecated Use `open` instead. */
|
|
9
9
|
show?: boolean;
|
|
10
10
|
placement?: DropPlacementsType;
|
|
11
|
+
/** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
|
|
12
|
+
destroyOnClose?: boolean;
|
|
11
13
|
target?: React.RefObject<HTMLElement | null>;
|
|
12
14
|
onOpenChange?: (opened: boolean) => void;
|
|
13
15
|
overlay?: React.ReactNode;
|
|
@@ -8,6 +8,8 @@ export interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
8
8
|
/** @deprecated Use `open` instead. */
|
|
9
9
|
show?: boolean;
|
|
10
10
|
placement?: DropPlacementsType;
|
|
11
|
+
/** 关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内的表单状态,代价是每个打开过的实例留一份隐藏 DOM。 */
|
|
12
|
+
destroyOnClose?: boolean;
|
|
11
13
|
target?: React.RefObject<HTMLElement | null>;
|
|
12
14
|
onOpenChange?: (opened: boolean) => void;
|
|
13
15
|
overlay?: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SurfaceShapeType, SurfaceThemeType } from '../const/types.cjs';
|
|
3
3
|
import { IconType } from '../icon/index.cjs';
|
|
4
4
|
export interface FeatureCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "defaultValue" | "defaultChecked"> {
|
|
5
5
|
icon?: IconType[] | ReactNode;
|
|
@@ -7,8 +7,8 @@ export interface FeatureCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "
|
|
|
7
7
|
desc?: ReactNode;
|
|
8
8
|
extra?: ReactNode;
|
|
9
9
|
bordered?: boolean;
|
|
10
|
-
theme?:
|
|
11
|
-
shape?:
|
|
10
|
+
theme?: SurfaceThemeType;
|
|
11
|
+
shape?: SurfaceShapeType;
|
|
12
12
|
size?: "small" | "medium" | "large";
|
|
13
13
|
direction?: "horizontal" | "vertical";
|
|
14
14
|
clickable?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SurfaceShapeType, SurfaceThemeType } from '../const/types.js';
|
|
3
3
|
import { IconType } from '../icon/index.js';
|
|
4
4
|
export interface FeatureCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "defaultValue" | "defaultChecked"> {
|
|
5
5
|
icon?: IconType[] | ReactNode;
|
|
@@ -7,8 +7,8 @@ export interface FeatureCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "
|
|
|
7
7
|
desc?: ReactNode;
|
|
8
8
|
extra?: ReactNode;
|
|
9
9
|
bordered?: boolean;
|
|
10
|
-
theme?:
|
|
11
|
-
shape?:
|
|
10
|
+
theme?: SurfaceThemeType;
|
|
11
|
+
shape?: SurfaceShapeType;
|
|
12
12
|
size?: "small" | "medium" | "large";
|
|
13
13
|
direction?: "horizontal" | "vertical";
|
|
14
14
|
clickable?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { FeedbackPanelKind,
|
|
2
|
+
import { FeedbackPanelKind, SurfaceShapeType, SurfaceThemeType } from '../const/types.cjs';
|
|
3
3
|
import { IconType } from '../icon/index.cjs';
|
|
4
4
|
export interface FeedbackPanelProps extends Omit<HTMLAttributes<HTMLElement>, "defaultValue" | "defaultChecked"> {
|
|
5
5
|
kind?: FeedbackPanelKind;
|
|
@@ -8,8 +8,8 @@ export interface FeedbackPanelProps extends Omit<HTMLAttributes<HTMLElement>, "d
|
|
|
8
8
|
symbol?: IconType[] | ReactNode;
|
|
9
9
|
compact?: boolean;
|
|
10
10
|
actions?: ReactNode;
|
|
11
|
-
theme?:
|
|
12
|
-
shape?:
|
|
11
|
+
theme?: SurfaceThemeType;
|
|
12
|
+
shape?: SurfaceShapeType;
|
|
13
13
|
}
|
|
14
14
|
export default function FeedbackPanel({ kind, heading, description, symbol, compact, actions, theme: themeProp, shape: shapeProp, children, className, ...rest }: FeedbackPanelProps): import("react").JSX.Element;
|
|
15
15
|
export type { FeedbackPanelKind } from '../const/types.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { FeedbackPanelKind,
|
|
2
|
+
import { FeedbackPanelKind, SurfaceShapeType, SurfaceThemeType } from '../const/types.js';
|
|
3
3
|
import { IconType } from '../icon/index.js';
|
|
4
4
|
export interface FeedbackPanelProps extends Omit<HTMLAttributes<HTMLElement>, "defaultValue" | "defaultChecked"> {
|
|
5
5
|
kind?: FeedbackPanelKind;
|
|
@@ -8,8 +8,8 @@ export interface FeedbackPanelProps extends Omit<HTMLAttributes<HTMLElement>, "d
|
|
|
8
8
|
symbol?: IconType[] | ReactNode;
|
|
9
9
|
compact?: boolean;
|
|
10
10
|
actions?: ReactNode;
|
|
11
|
-
theme?:
|
|
12
|
-
shape?:
|
|
11
|
+
theme?: SurfaceThemeType;
|
|
12
|
+
shape?: SurfaceShapeType;
|
|
13
13
|
}
|
|
14
14
|
export default function FeedbackPanel({ kind, heading, description, symbol, compact, actions, theme: themeProp, shape: shapeProp, children, className, ...rest }: FeedbackPanelProps): import("react").JSX.Element;
|
|
15
15
|
export type { FeedbackPanelKind } from '../const/types.js';
|
|
@@ -62,6 +62,24 @@ export interface FlameWrapInstance {
|
|
|
62
62
|
/** Stop the loop and release all GPU resources. */
|
|
63
63
|
destroy: () => void;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Attributes that turn a canvas into an HTML-in-Canvas host, and the matching
|
|
67
|
+
* opt-in for the element that gets drawn.
|
|
68
|
+
*/
|
|
69
|
+
export interface HtmlInCanvasMarkup {
|
|
70
|
+
canvas: Record<string, string>;
|
|
71
|
+
element: Record<string, string>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Chrome 156 renames the experimental boolean `layoutsubtree` to the
|
|
75
|
+
* standardized `content="drawable"`, and the element handed to
|
|
76
|
+
* `drawElementImage()` now declares itself with its own `drawable` attribute
|
|
77
|
+
* (WICG html-in-canvas issue #169). Browsers advertise the new spelling with a
|
|
78
|
+
* reflected `content` IDL attribute, so the shape is read off the prototype
|
|
79
|
+
* rather than sniffed from a version string: every release only ever sees the
|
|
80
|
+
* attribute it understands.
|
|
81
|
+
*/
|
|
82
|
+
export declare function htmlInCanvasMarkup(): HtmlInCanvasMarkup;
|
|
65
83
|
export declare function supportsHtmlInCanvas(): boolean;
|
|
66
84
|
export declare function createFlameWrap(elements: FlameWrapElements, options?: FlameWrapOptions): FlameWrapInstance | null;
|
|
67
85
|
export interface FlameWrapProps extends FlameWrapOptions {
|
|
@@ -62,6 +62,24 @@ export interface FlameWrapInstance {
|
|
|
62
62
|
/** Stop the loop and release all GPU resources. */
|
|
63
63
|
destroy: () => void;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Attributes that turn a canvas into an HTML-in-Canvas host, and the matching
|
|
67
|
+
* opt-in for the element that gets drawn.
|
|
68
|
+
*/
|
|
69
|
+
export interface HtmlInCanvasMarkup {
|
|
70
|
+
canvas: Record<string, string>;
|
|
71
|
+
element: Record<string, string>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Chrome 156 renames the experimental boolean `layoutsubtree` to the
|
|
75
|
+
* standardized `content="drawable"`, and the element handed to
|
|
76
|
+
* `drawElementImage()` now declares itself with its own `drawable` attribute
|
|
77
|
+
* (WICG html-in-canvas issue #169). Browsers advertise the new spelling with a
|
|
78
|
+
* reflected `content` IDL attribute, so the shape is read off the prototype
|
|
79
|
+
* rather than sniffed from a version string: every release only ever sees the
|
|
80
|
+
* attribute it understands.
|
|
81
|
+
*/
|
|
82
|
+
export declare function htmlInCanvasMarkup(): HtmlInCanvasMarkup;
|
|
65
83
|
export declare function supportsHtmlInCanvas(): boolean;
|
|
66
84
|
export declare function createFlameWrap(elements: FlameWrapElements, options?: FlameWrapOptions): FlameWrapInstance | null;
|
|
67
85
|
export interface FlameWrapProps extends FlameWrapOptions {
|
|
@@ -32,6 +32,8 @@ export declare const resolveFormControlAttrs: (props: Record<string, unknown>, f
|
|
|
32
32
|
"aria-required": {} | undefined;
|
|
33
33
|
};
|
|
34
34
|
export declare const isFormFieldComponent: (component: unknown) => boolean;
|
|
35
|
+
export declare const markFormFieldWrapper: <T extends object>(component: T) => T;
|
|
36
|
+
export declare const isFormFieldWrapper: (component: unknown) => boolean;
|
|
35
37
|
export declare function createFormFieldComponent<T extends ElementType>(Component: T, adapter?: FormFieldAdapter): T;
|
|
36
38
|
export declare function FormFieldProvider({ value, children, }: {
|
|
37
39
|
value: FormFieldContextValue;
|
|
@@ -32,6 +32,8 @@ export declare const resolveFormControlAttrs: (props: Record<string, unknown>, f
|
|
|
32
32
|
"aria-required": {} | undefined;
|
|
33
33
|
};
|
|
34
34
|
export declare const isFormFieldComponent: (component: unknown) => boolean;
|
|
35
|
+
export declare const markFormFieldWrapper: <T extends object>(component: T) => T;
|
|
36
|
+
export declare const isFormFieldWrapper: (component: unknown) => boolean;
|
|
35
37
|
export declare function createFormFieldComponent<T extends ElementType>(Component: T, adapter?: FormFieldAdapter): T;
|
|
36
38
|
export declare function FormFieldProvider({ value, children, }: {
|
|
37
39
|
value: FormFieldContextValue;
|
package/types/image/image.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { ImagePreviewProps, ImageType } from './preview.cjs';
|
|
3
|
-
import { ShapeType,
|
|
3
|
+
import { ShapeType, SurfaceThemeType } from '../const/types.cjs';
|
|
4
4
|
export interface ImageRef {
|
|
5
5
|
show: (props?: ImagePreviewProps) => void;
|
|
6
6
|
destroy: () => void;
|
|
@@ -21,7 +21,7 @@ export interface ImageProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSwit
|
|
|
21
21
|
panel?: ReactNode;
|
|
22
22
|
onClose?: () => void;
|
|
23
23
|
onSwitch?: (index: number) => void;
|
|
24
|
-
theme?:
|
|
24
|
+
theme?: SurfaceThemeType;
|
|
25
25
|
shape?: ShapeType;
|
|
26
26
|
}
|
|
27
27
|
declare const KImage: import('react').ForwardRefExoticComponent<ImageProps & import('react').RefAttributes<ImageRef>>;
|
package/types/image/image.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { ImagePreviewProps, ImageType } from './preview.js';
|
|
3
|
-
import { ShapeType,
|
|
3
|
+
import { ShapeType, SurfaceThemeType } from '../const/types.js';
|
|
4
4
|
export interface ImageRef {
|
|
5
5
|
show: (props?: ImagePreviewProps) => void;
|
|
6
6
|
destroy: () => void;
|
|
@@ -21,7 +21,7 @@ export interface ImageProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSwit
|
|
|
21
21
|
panel?: ReactNode;
|
|
22
22
|
onClose?: () => void;
|
|
23
23
|
onSwitch?: (index: number) => void;
|
|
24
|
-
theme?:
|
|
24
|
+
theme?: SurfaceThemeType;
|
|
25
25
|
shape?: ShapeType;
|
|
26
26
|
}
|
|
27
27
|
declare const KImage: import('react').ForwardRefExoticComponent<ImageProps & import('react').RefAttributes<ImageRef>>;
|