@fibrae/semi-foundation 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -62
- package/README.md +36 -34
- package/README.zh-CN.md +79 -0
- package/dist/anchor/foundation.d.ts +0 -3
- package/dist/anchor/foundation.js +0 -1
- package/dist/audio-player/foundation.d.ts +0 -3
- package/dist/audio-player/foundation.js +0 -1
- package/dist/auto-complete/foundation.d.ts +0 -2
- package/dist/auto-complete/foundation.js +0 -1
- package/dist/avatar/foundation.d.ts +0 -1
- package/dist/avatar/variables.scss +0 -1
- package/dist/backtop/foundation.d.ts +0 -3
- package/dist/backtop/foundation.js +0 -1
- package/dist/base/auto-close-foundation.d.ts +0 -1
- package/dist/base/foundation.d.ts +0 -1
- package/dist/base/list-store.d.ts +0 -1
- package/dist/calendar/event-util.d.ts +0 -10
- package/dist/calendar/event-util.js +0 -10
- package/dist/calendar/foundation.d.ts +1 -6
- package/dist/calendar/foundation.js +1 -5
- package/dist/calendar/month-foundation.d.ts +0 -1
- package/dist/calendar/month-foundation.js +0 -1
- package/dist/carousel/foundation.d.ts +0 -2
- package/dist/cascader/foundation.d.ts +2 -6
- package/dist/cascader/foundation.js +2 -11
- package/dist/cascader/util.d.ts +1 -8
- package/dist/cascader/util.js +1 -8
- package/dist/checkbox/checkbox-foundation.d.ts +1 -5
- package/dist/checkbox/checkbox-foundation.js +0 -2
- package/dist/checkbox/checkbox-group-foundation.d.ts +0 -1
- package/dist/code-highlight/index.d.ts +0 -1
- package/dist/color-picker/color-picker.scss +0 -2
- package/dist/color-picker/interface.d.ts +0 -1
- package/dist/config-provider/responsive-types.d.ts +0 -16
- package/dist/cropper/foundation.d.ts +0 -1
- package/dist/cropper/foundation.js +0 -1
- package/dist/date-picker/_utils/get-default-picker-date.d.ts +0 -3
- package/dist/date-picker/_utils/get-default-picker-date.js +0 -3
- package/dist/date-picker/_utils/get-inset-input-format-token.d.ts +0 -2
- package/dist/date-picker/_utils/get-inset-input-format-token.js +0 -2
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.d.ts +0 -2
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +0 -2
- package/dist/date-picker/_utils/parser.d.ts +0 -3
- package/dist/date-picker/_utils/parser.js +0 -7
- package/dist/date-picker/_utils/picker-type.d.ts +1 -3
- package/dist/date-picker/_utils/picker-type.js +0 -2
- package/dist/date-picker/_utils/to-callback-args.d.ts +0 -1
- package/dist/date-picker/_utils/to-callback-args.js +0 -1
- package/dist/date-picker/date-picker.scss +0 -3
- package/dist/date-picker/foundation.d.ts +3 -22
- package/dist/date-picker/foundation.js +1 -24
- package/dist/date-picker/input-foundation.d.ts +1 -7
- package/dist/date-picker/input-foundation.js +0 -2
- package/dist/date-picker/month-foundation.d.ts +0 -3
- package/dist/date-picker/month-foundation.js +0 -2
- package/dist/date-picker/months-grid-foundation.d.ts +1 -10
- package/dist/date-picker/months-grid-foundation.js +1 -10
- package/dist/drag-move/foundation.d.ts +0 -1
- package/dist/dropdown/foundation.d.ts +0 -2
- package/dist/dropdown/menu-foundation.d.ts +1 -2
- package/dist/feedback/foundation.d.ts +0 -1
- package/dist/feedback/variables.scss +1 -5
- package/dist/float-button/float-button.css +0 -1
- package/dist/float-button/float-button.scss +0 -2
- package/dist/form/form.scss +0 -12
- package/dist/form/foundation.js +0 -15
- package/dist/form/interface.d.ts +2 -15
- package/dist/form/utils.d.ts +0 -8
- package/dist/form/utils.js +0 -7
- package/dist/form/variables.scss +1 -4
- package/dist/grid/variables.scss +0 -10
- package/dist/highlight/foundation.d.ts +0 -2
- package/dist/highlight/foundation.js +0 -2
- package/dist/hot-keys/foundation.d.ts +0 -1
- package/dist/image/image-foundation.d.ts +0 -2
- package/dist/image/preview-footer-foundation.d.ts +0 -1
- package/dist/image/preview-foundation.d.ts +0 -3
- package/dist/image/preview-image-foundation.d.ts +0 -1
- package/dist/image/preview-inner-foundation.d.ts +0 -1
- package/dist/input/foundation.d.ts +0 -1
- package/dist/input/text-entry-foundation.d.ts +0 -2
- package/dist/input/text-entry-foundation.js +0 -1
- package/dist/input/textarea-foundation.d.ts +0 -1
- package/dist/input-number/caret.d.ts +0 -1
- package/dist/input-number/caret.js +0 -1
- package/dist/input-number/foundation.d.ts +0 -5
- package/dist/input-number/foundation.js +0 -5
- package/dist/json-viewer/foundation.d.ts +0 -2
- package/dist/json-viewer/foundation.js +0 -1
- package/dist/locale/interface.d.ts +0 -3
- package/dist/markdown-render/foundation.d.ts +1 -6
- package/dist/markdown-render/foundation.js +1 -5
- package/dist/navigation/foundation.d.ts +0 -7
- package/dist/navigation/foundation.js +0 -6
- package/dist/navigation/sub-nav-foundation.d.ts +0 -1
- package/dist/notification/notification-list-foundation.d.ts +2 -3
- package/dist/notification/notification-list-foundation.js +0 -1
- package/dist/notification/variables.scss +0 -1
- package/dist/overflow-list/foundation.d.ts +0 -2
- package/dist/overflow-list/foundation.js +0 -1
- package/dist/pagination/foundation.d.ts +0 -2
- package/dist/pincode/foundation.d.ts +1 -4
- package/dist/pincode/foundation.js +1 -4
- package/dist/popconfirm/popconfirm-foundation.d.ts +0 -2
- package/dist/progress/generates.d.ts +1 -4
- package/dist/progress/generates.js +1 -4
- package/dist/progress/utils.d.ts +1 -1
- package/dist/progress/utils.js +1 -1
- package/dist/radio/radio-foundation.d.ts +0 -4
- package/dist/radio/radio-foundation.js +0 -1
- package/dist/radio/radio-group-foundation.d.ts +0 -1
- package/dist/rating/foundation.d.ts +0 -5
- package/dist/rating/foundation.js +0 -3
- package/dist/resizable/group/index.d.ts +0 -4
- package/dist/resizable/group/index.js +0 -4
- package/dist/resizable/resizable.scss +0 -1
- package/dist/resizable/single/index.d.ts +1 -5
- package/dist/resizable/single/index.js +1 -4
- package/dist/scroll-list/item-foundation.d.ts +0 -2
- package/dist/scroll-list/item-foundation.js +0 -1
- package/dist/scroll-list/variables.scss +1 -6
- package/dist/select/foundation.d.ts +0 -1
- package/dist/select/option-foundation.d.ts +2 -3
- package/dist/select/option-foundation.js +0 -1
- package/dist/select/variables.scss +1 -8
- package/dist/side-sheet/side-sheet-foundation.d.ts +1 -6
- package/dist/side-sheet/side-sheet-foundation.js +1 -5
- package/dist/side-sheet/variables.scss +1 -3
- package/dist/slider/foundation.d.ts +1 -12
- package/dist/slider/foundation.js +1 -13
- package/dist/slider/variables.scss +1 -5
- package/dist/spin/foundation.d.ts +0 -2
- package/dist/spin/foundation.js +0 -1
- package/dist/spin/variables.scss +1 -3
- package/dist/switch/foundation.d.ts +0 -1
- package/dist/switch/switch.scss +1 -1
- package/dist/switch/variables.scss +1 -5
- package/dist/table/foundation.d.ts +12 -21
- package/dist/table/foundation.js +51 -15
- package/dist/table/table.scss +0 -1
- package/dist/table/utils.d.ts +0 -8
- package/dist/table/utils.js +0 -13
- package/dist/table/variables.scss +1 -5
- package/dist/tabs/foundation.d.ts +0 -9
- package/dist/tabs/foundation.js +0 -4
- package/dist/tabs/tabs.scss +1 -1
- package/dist/tag/focus.js +0 -1
- package/dist/tag-input/foundation.d.ts +0 -2
- package/dist/tag-input/foundation.js +0 -1
- package/dist/tag-input/tag-input.scss +0 -1
- package/dist/tag-input/utils/tag-focus.d.ts +0 -1
- package/dist/tag-input/utils/tag-focus.js +0 -1
- package/dist/time-picker/combox-foundation.d.ts +3 -11
- package/dist/time-picker/combox-foundation.js +3 -10
- package/dist/time-picker/foundation.d.ts +0 -10
- package/dist/time-picker/foundation.js +0 -9
- package/dist/time-picker/utils/index.d.ts +0 -11
- package/dist/time-picker/utils/index.js +0 -11
- package/dist/tooltip/adjust-position.d.ts +1 -2
- package/dist/tooltip/constants.d.ts +0 -3
- package/dist/tooltip/constants.js +0 -3
- package/dist/tooltip/foundation.d.ts +0 -3
- package/dist/tooltip/foundation.js +0 -2
- package/dist/tooltip/position.scss +0 -1
- package/dist/transfer/foundation.d.ts +0 -4
- package/dist/transfer/foundation.js +0 -1
- package/dist/tree/foundation.d.ts +0 -2
- package/dist/tree/foundation.js +0 -1
- package/dist/tree/shared.d.ts +1 -3
- package/dist/tree/shared.js +0 -2
- package/dist/tree/tree-util.d.ts +0 -5
- package/dist/tree/tree-util.js +0 -5
- package/dist/tree-select/foundation.d.ts +0 -2
- package/dist/tree-select/foundation.js +0 -3
- package/dist/typography/ellipsis.d.ts +1 -3
- package/dist/typography/ellipsis.js +0 -2
- package/dist/typography/typography.scss +0 -1
- package/dist/upload/constants.d.ts +1 -1
- package/dist/upload/foundation.d.ts +0 -6
- package/dist/upload/foundation.js +1 -11
- package/dist/upload/utils.d.ts +0 -5
- package/dist/upload/utils.js +0 -5
- package/dist/user-guide/foundation.d.ts +0 -2
- package/dist/utils/a11y.d.ts +1 -5
- package/dist/utils/a11y.js +1 -4
- package/dist/utils/array.d.ts +0 -6
- package/dist/utils/array.js +0 -6
- package/dist/utils/date-fns-extra.js +1 -5
- package/dist/utils/dom.d.ts +0 -1
- package/dist/utils/dom.js +0 -1
- package/dist/utils/escape-html.js +0 -3
- package/dist/utils/field-sizing.d.ts +0 -2
- package/dist/utils/field-sizing.js +0 -2
- package/dist/utils/focus-handle.d.ts +0 -1
- package/dist/utils/focus-handle.js +0 -1
- package/dist/utils/focus-scope.d.ts +0 -1
- package/dist/utils/focus-scope.js +0 -1
- package/dist/utils/scroll-lock.d.ts +3 -4
- package/dist/utils/scroll-lock.js +3 -4
- package/dist/utils/tween.d.ts +0 -1
- package/dist/utils/tween.js +0 -1
- package/dist/utils/uuid.d.ts +0 -1
- package/dist/utils/uuid.js +0 -1
- package/dist/utils/warning.d.ts +0 -1
- package/dist/utils/warning.js +0 -1
- package/dist/video-player/progress-foundation.d.ts +0 -1
- package/dist/video-player/progress-foundation.js +0 -1
- package/dist/video-player/variables.scss +1 -1
- package/package.json +2 -2
|
@@ -10,7 +10,6 @@ export interface MarkdownRenderAdapter<P extends MarkdownRenderBaseProps = Markd
|
|
|
10
10
|
* which breaks type checking of published declarations. The values are framework components this package cannot name.
|
|
11
11
|
*/
|
|
12
12
|
export type MarkdownComponents = Record<string, any>;
|
|
13
|
-
/** Renders the compiled source with the given element renderers */
|
|
14
13
|
export type MarkdownContent = (props: {
|
|
15
14
|
components?: MarkdownComponents;
|
|
16
15
|
}) => any;
|
|
@@ -28,7 +27,6 @@ export interface MarkdownRenderBaseState {
|
|
|
28
27
|
}
|
|
29
28
|
export default class MarkdownRenderFoundation<P extends MarkdownRenderBaseProps = MarkdownRenderBaseProps, S extends MarkdownRenderBaseState = MarkdownRenderBaseState> extends BaseFoundation<MarkdownRenderAdapter<P, S>, P, S> {
|
|
30
29
|
#private;
|
|
31
|
-
/** Returns a function that renders the source with its `components` prop */
|
|
32
30
|
protected evaluate(raw: string): Promise<MarkdownContent>;
|
|
33
31
|
/**
|
|
34
32
|
* Compiles `md` synchronously for the first render, so server output and hydration start with the content.
|
|
@@ -42,9 +40,6 @@ export default class MarkdownRenderFoundation<P extends MarkdownRenderBaseProps
|
|
|
42
40
|
/** Plugin lists match when each entry, or each item of a `[plugin, options]` entry, is the same reference */
|
|
43
41
|
static isSamePluginList(a?: PluggableList, b?: PluggableList): boolean;
|
|
44
42
|
destroy(): void;
|
|
45
|
-
/**
|
|
46
|
-
* Compiles the current source and stores the result as `renderContent`. A failed compile keeps the last
|
|
47
|
-
* content and goes to `notifyCompileError`.
|
|
48
|
-
*/
|
|
43
|
+
/** A failed compile keeps the last content and goes to `notifyCompileError` */
|
|
49
44
|
updateContent: () => Promise<void>;
|
|
50
45
|
}
|
|
@@ -25,7 +25,6 @@ var MarkdownRenderFoundation = class MarkdownRenderFoundation extends BaseFounda
|
|
|
25
25
|
ignoreInvalidStyle: true
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
/** Returns a function that renders the source with its `components` prop */
|
|
29
28
|
async evaluate(raw) {
|
|
30
29
|
const props = {
|
|
31
30
|
format: this.getProp("format"),
|
|
@@ -84,10 +83,7 @@ var MarkdownRenderFoundation = class MarkdownRenderFoundation extends BaseFounda
|
|
|
84
83
|
destroy() {
|
|
85
84
|
this.#requestId++;
|
|
86
85
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Compiles the current source and stores the result as `renderContent`. A failed compile keeps the last
|
|
89
|
-
* content and goes to `notifyCompileError`.
|
|
90
|
-
*/
|
|
86
|
+
/** A failed compile keeps the last content and goes to `notifyCompileError` */
|
|
91
87
|
updateContent = async () => {
|
|
92
88
|
const requestId = ++this.#requestId;
|
|
93
89
|
try {
|
|
@@ -25,7 +25,6 @@ export interface NavigationAdapter<P extends NavigationBaseProps = NavigationBas
|
|
|
25
25
|
updateSelectedKeys(keys: ItemKey[]): void;
|
|
26
26
|
updateOpenKeys(keys: ItemKey[]): void;
|
|
27
27
|
}
|
|
28
|
-
/** The props the foundation reads */
|
|
29
28
|
export interface NavigationBaseProps {
|
|
30
29
|
items?: (string | NavItemInput)[];
|
|
31
30
|
children?: unknown;
|
|
@@ -42,9 +41,6 @@ export default class NavigationFoundation<P extends NavigationBaseProps = Naviga
|
|
|
42
41
|
static getZeroParentKeys(itemKeysMap?: ItemKey2ParentKeysMap, ...itemKeys: ItemKey[]): any[];
|
|
43
42
|
static buildItemKeysMap(items?: NavItemType[], keysMap?: {}, parentKeys?: (string | number)[], keyPropName?: string): {};
|
|
44
43
|
static formatItems(items?: (string | NavItemInput)[]): NavItemType[];
|
|
45
|
-
/**
|
|
46
|
-
* Formatted items and the itemKey -> parent keys map
|
|
47
|
-
*/
|
|
48
44
|
static getFormattedItems({ items }: NavigationBaseProps, children?: NavItemType[]): {
|
|
49
45
|
itemKeysMap: ItemKey2ParentKeysMap;
|
|
50
46
|
formattedItems: NavItemType[];
|
|
@@ -65,9 +61,6 @@ export default class NavigationFoundation<P extends NavigationBaseProps = Naviga
|
|
|
65
61
|
* openKeys is copied into state
|
|
66
62
|
*/
|
|
67
63
|
handlePropsUpdate: (prevProps: NavigationBaseProps) => void;
|
|
68
|
-
/**
|
|
69
|
-
* Selects keys together with their top level parents
|
|
70
|
-
*/
|
|
71
64
|
updateSelectedKeys: (keys: ItemKey[]) => void;
|
|
72
65
|
addOpenKey: (itemKey: ItemKey) => void;
|
|
73
66
|
removeOpenKey: (itemKey: ItemKey) => void;
|
|
@@ -50,9 +50,6 @@ var NavigationFoundation = class NavigationFoundation extends BaseFoundation {
|
|
|
50
50
|
} : rest;
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Formatted items and the itemKey -> parent keys map
|
|
55
|
-
*/
|
|
56
53
|
static getFormattedItems({ items }, children = []) {
|
|
57
54
|
const formattedItems = NavigationFoundation.formatItems(items);
|
|
58
55
|
const willHandleItems = Array.isArray(items) && items.length ? formattedItems : children;
|
|
@@ -132,9 +129,6 @@ var NavigationFoundation = class NavigationFoundation extends BaseFoundation {
|
|
|
132
129
|
if (props.openKeys && !isEqual(prevProps.openKeys, props.openKeys)) this.adapter.updateOpenKeys(props.openKeys);
|
|
133
130
|
else if (prevProps.openKeys !== void 0 && props.openKeys === void 0) this.adapter.updateOpenKeys(NavigationFoundation.getWillOpenKeys(props, [], this.#getItemKeysMap()));
|
|
134
131
|
};
|
|
135
|
-
/**
|
|
136
|
-
* Selects keys together with their top level parents
|
|
137
|
-
*/
|
|
138
132
|
updateSelectedKeys = (keys) => {
|
|
139
133
|
const parentKeys = NavigationFoundation.getZeroParentKeys(this.#getItemKeysMap(), ...keys);
|
|
140
134
|
this.adapter.updateSelectedKeys(Array.from(new Set(keys.concat(parentKeys))));
|
|
@@ -15,7 +15,6 @@ export interface SubNavAdapter<P extends SubNavBaseProps = SubNavBaseProps, S ex
|
|
|
15
15
|
notifyGlobalOnClick(data: OnClickData): void;
|
|
16
16
|
getIsOpen(): boolean;
|
|
17
17
|
}
|
|
18
|
-
/** The props the foundation reads */
|
|
19
18
|
export interface SubNavBaseProps {
|
|
20
19
|
itemKey?: string | number;
|
|
21
20
|
disabled?: boolean;
|
|
@@ -35,18 +35,17 @@ export default class NotificationListStore {
|
|
|
35
35
|
icon?: any;
|
|
36
36
|
getPopupContainer?: () => HTMLElement;
|
|
37
37
|
theme?: NoticeTheme;
|
|
38
|
-
direction?: "
|
|
38
|
+
direction?: "ltr" | "rtl";
|
|
39
39
|
className?: string;
|
|
40
40
|
style?: any;
|
|
41
41
|
stack?: boolean | number;
|
|
42
|
-
top?: number | string;
|
|
43
42
|
left?: number | string;
|
|
44
43
|
right?: number | string;
|
|
44
|
+
top?: number | string;
|
|
45
45
|
bottom?: number | string;
|
|
46
46
|
};
|
|
47
47
|
subscribe: (listener: () => void) => () => void;
|
|
48
48
|
getSnapshot: () => NotificationListState;
|
|
49
|
-
/** Shows a notice, or updates the shown one with the same id */
|
|
50
49
|
add: (notice: NoticeInstance) => void;
|
|
51
50
|
remove: (id: string) => void;
|
|
52
51
|
finishLeave: (id: string) => void;
|
|
@@ -17,7 +17,6 @@ var NotificationListStore = class {
|
|
|
17
17
|
defaults = { ...builtInDefaults };
|
|
18
18
|
subscribe = (listener) => this.#items.subscribe(listener);
|
|
19
19
|
getSnapshot = () => this.#items.getSnapshot();
|
|
20
|
-
/** Shows a notice, or updates the shown one with the same id */
|
|
21
20
|
add = (notice) => {
|
|
22
21
|
this.#items.add(notice);
|
|
23
22
|
};
|
|
@@ -16,7 +16,6 @@ $color-notification_info_light-bg: var(--semi-color-info-light-default); // 彩
|
|
|
16
16
|
$color-notification_info_light-border: var(--semi-color-info); // 彩色通知信息描边色
|
|
17
17
|
$color-notification_danger_light-bg: var(--semi-color-danger-light-default); // 彩色通知危险背景色
|
|
18
18
|
$color-notification_danger_light-border: var(--semi-color-danger); // 彩色通知危险描边色
|
|
19
|
-
// keep equal to bg-0
|
|
20
19
|
$color-notification_ambient-bg: var(--semi-color-bg-0); // 透明背景色叠加层(与bg0保持一致不建议修改)
|
|
21
20
|
|
|
22
21
|
$width-notification_notice: auto; // 通知宽度
|
|
@@ -32,7 +32,6 @@ export interface VisibleLayout {
|
|
|
32
32
|
step: 1 | -1;
|
|
33
33
|
fromStart: boolean;
|
|
34
34
|
}
|
|
35
|
-
/** The props the foundation reads */
|
|
36
35
|
export interface OverflowListBaseProps {
|
|
37
36
|
collapseFrom?: 'start' | 'end';
|
|
38
37
|
items?: Array<Record<string, any>>;
|
|
@@ -68,7 +67,6 @@ export default class OverflowListFoundation<P extends OverflowListBaseProps = Ov
|
|
|
68
67
|
* object to one position.
|
|
69
68
|
*/
|
|
70
69
|
static getVisibleLayout({ items, visible }: Pick<OverflowListView, 'items' | 'visible'>, fromStart: boolean, reversed: boolean): VisibleLayout;
|
|
71
|
-
/** The view a change of items or style starts from; the measurement then settles it */
|
|
72
70
|
static resetView({ items, style, renderMode, collapseFrom, itemKey }: OverflowListBaseProps, view: OverflowListView, containerWidth: number): OverflowListView;
|
|
73
71
|
/** Returns whether the list must be measured again: an item changed width, or every visible item has reported */
|
|
74
72
|
recordItemSize: (key: ItemKey, width: number, maxCount: number) => boolean;
|
|
@@ -67,7 +67,6 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
|
|
|
67
67
|
fromStart
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
/** The view a change of items or style starts from; the measurement then settles it */
|
|
71
70
|
static resetView({ items, style, renderMode, collapseFrom, itemKey }, view, containerWidth) {
|
|
72
71
|
const keys = OverflowListFoundation.getItemKeys(items, itemKey);
|
|
73
72
|
const next = {
|
|
@@ -19,13 +19,11 @@ export interface AdapterPageList {
|
|
|
19
19
|
restLeftRange: PageRange;
|
|
20
20
|
restRightRange: PageRange;
|
|
21
21
|
}
|
|
22
|
-
/** The props the foundation reads */
|
|
23
22
|
export interface PaginationBaseProps {
|
|
24
23
|
currentPage?: number;
|
|
25
24
|
preventPageChangeOnPageSizeChange?: boolean;
|
|
26
25
|
total?: number;
|
|
27
26
|
}
|
|
28
|
-
/** The state the foundation reads */
|
|
29
27
|
export interface PaginationBaseState {
|
|
30
28
|
currentPage: number;
|
|
31
29
|
pageSize: number;
|
|
@@ -30,10 +30,7 @@ export default class PinCodeFoundation<P extends PinCodeBaseProps = PinCodeBaseP
|
|
|
30
30
|
validateValue(value?: string): boolean;
|
|
31
31
|
updateValueList: (newValueList: PinCodeBaseState["valueList"]) => Promise<void>;
|
|
32
32
|
handlePaste: (e: ClipboardEvent, startInputIndex: number) => Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Removes the character and closes the gap. Also covers a cell emptied without Backspace or Delete (cut, a
|
|
35
|
-
* virtual keyboard's delete).
|
|
36
|
-
*/
|
|
33
|
+
/** Also covers a cell emptied without Backspace or Delete (cut, a virtual keyboard's delete). */
|
|
37
34
|
removeCell(index: number): void;
|
|
38
35
|
handleKeyDownOnSingleInput: (e: KeyboardEvent, index: number) => void;
|
|
39
36
|
}
|
|
@@ -55,10 +55,7 @@ var PinCodeFoundation = class PinCodeFoundation extends BaseFoundation {
|
|
|
55
55
|
else break;
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
/**
|
|
59
|
-
* Removes the character and closes the gap. Also covers a cell emptied without Backspace or Delete (cut, a
|
|
60
|
-
* virtual keyboard's delete).
|
|
61
|
-
*/
|
|
58
|
+
/** Also covers a cell emptied without Backspace or Delete (cut, a virtual keyboard's delete). */
|
|
62
59
|
removeCell(index) {
|
|
63
60
|
const valueList = this.getState("valueList").toSpliced(index, 1);
|
|
64
61
|
this.updateValueList(valueList);
|
|
@@ -14,13 +14,11 @@ interface FooterButtonProps {
|
|
|
14
14
|
autoFocus?: boolean;
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
}
|
|
17
|
-
/** The props the foundation reads */
|
|
18
17
|
export interface PopconfirmBaseProps {
|
|
19
18
|
cancelButtonProps?: FooterButtonProps;
|
|
20
19
|
okButtonProps?: FooterButtonProps;
|
|
21
20
|
visible?: boolean;
|
|
22
21
|
}
|
|
23
|
-
/** The state the foundation reads */
|
|
24
22
|
export interface PopconfirmBaseState {
|
|
25
23
|
visible: boolean;
|
|
26
24
|
cancelLoading: boolean;
|
|
@@ -3,9 +3,6 @@ type StrokeSet = {
|
|
|
3
3
|
color: string;
|
|
4
4
|
};
|
|
5
5
|
export type StrokeArr = Array<StrokeSet>;
|
|
6
|
-
/**
|
|
7
|
-
* Picks the stroke color for `percent` from the color stops in `s`. The result is a CSS color expression
|
|
8
|
-
* (`var(--semi-...)` or `color-mix()`), so theme switches apply without a re-render.
|
|
9
|
-
*/
|
|
6
|
+
/** The result is a CSS color expression (`var(--semi-...)` or `color-mix()`), so theme switches apply without a re-render. */
|
|
10
7
|
export declare function generateColor(s: StrokeArr, percent: number, gradient: boolean): string | undefined;
|
|
11
8
|
export {};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { strings } from "./constants.js";
|
|
2
2
|
// src/progress/generates.ts
|
|
3
3
|
const PALETTE_TOKEN = /^(?:(black|white)|(amber|blue|cyan|green|grey|indigo|light-blue|light-green|lime|orange|pink|purple|red|teal|violet|yellow)(?:-(\d))?)$/;
|
|
4
|
-
/**
|
|
5
|
-
* Picks the stroke color for `percent` from the color stops in `s`. The result is a CSS color expression
|
|
6
|
-
* (`var(--semi-...)` or `color-mix()`), so theme switches apply without a re-render.
|
|
7
|
-
*/
|
|
4
|
+
/** The result is a CSS color expression (`var(--semi-...)` or `color-mix()`), so theme switches apply without a re-render. */
|
|
8
5
|
function generateColor(s, percent, gradient) {
|
|
9
6
|
if (s.length === 0) return void 0;
|
|
10
7
|
const sorted = s.toSorted((a, b) => a.percent - b.percent);
|
package/dist/progress/utils.d.ts
CHANGED
|
@@ -14,5 +14,5 @@ export interface PercentAnimation {
|
|
|
14
14
|
/** Cancels the running tween; call on unmount */
|
|
15
15
|
stop: () => void;
|
|
16
16
|
}
|
|
17
|
-
/**
|
|
17
|
+
/** A new update or `stop` cancels the running tween */
|
|
18
18
|
export declare function createPercentAnimation(setShown: (value: number) => void): PercentAnimation;
|
package/dist/progress/utils.js
CHANGED
|
@@ -16,7 +16,7 @@ function calcCircleGeometry(diameter, strokeWidth, percent, indeterminate) {
|
|
|
16
16
|
strokeDashoffset: indeterminate ? 0 : (1 - percent / 100) * circumference
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
/**
|
|
19
|
+
/** A new update or `stop` cancels the running tween */
|
|
20
20
|
function createPercentAnimation(setShown) {
|
|
21
21
|
let cancel;
|
|
22
22
|
const stop = () => {
|
|
@@ -8,7 +8,6 @@ export interface RadioChangeEvent {
|
|
|
8
8
|
stopPropagation: () => void;
|
|
9
9
|
preventDefault: () => void;
|
|
10
10
|
}
|
|
11
|
-
/** What a radio reads from the enclosing RadioGroup */
|
|
12
11
|
export interface RadioGroupView {
|
|
13
12
|
value?: unknown;
|
|
14
13
|
disabled?: boolean;
|
|
@@ -24,7 +23,6 @@ export interface RadioContextView {
|
|
|
24
23
|
mode?: string;
|
|
25
24
|
radioGroup?: RadioGroupView;
|
|
26
25
|
}
|
|
27
|
-
/** The props the foundation reads with getProps */
|
|
28
26
|
export interface RadioBaseProps {
|
|
29
27
|
checked?: boolean;
|
|
30
28
|
defaultChecked?: boolean;
|
|
@@ -55,7 +53,6 @@ export interface RadioView {
|
|
|
55
53
|
buttonSize?: string;
|
|
56
54
|
prefixCls?: string;
|
|
57
55
|
}
|
|
58
|
-
/** The part of the native event the foundation forwards */
|
|
59
56
|
interface RadioSourceEvent {
|
|
60
57
|
stopPropagation: () => void;
|
|
61
58
|
preventDefault: () => void;
|
|
@@ -63,7 +60,6 @@ interface RadioSourceEvent {
|
|
|
63
60
|
export default class RadioFoundation<P extends RadioBaseProps = RadioBaseProps, S extends RadioBaseState = RadioBaseState> extends BaseFoundation<RadioAdapter<P, S>, P, S> {
|
|
64
61
|
#private;
|
|
65
62
|
static getInitialState(props: Pick<RadioBaseProps, 'checked' | 'defaultChecked'>): RadioBaseState;
|
|
66
|
-
/** How the radio looks and behaves, from its own props or, inside a group, from the group */
|
|
67
63
|
static deriveView(props: RadioBaseProps, state: RadioBaseState, context?: RadioContextView | null): RadioView;
|
|
68
64
|
init(): void;
|
|
69
65
|
destroy(): void;
|
|
@@ -21,7 +21,6 @@ var RadioFoundation = class RadioFoundation extends BaseFoundation {
|
|
|
21
21
|
static getInitialState(props) {
|
|
22
22
|
return { checked: typeof props.checked === "boolean" ? props.checked : Boolean(props.defaultChecked) };
|
|
23
23
|
}
|
|
24
|
-
/** How the radio looks and behaves, from its own props or, inside a group, from the group */
|
|
25
24
|
static deriveView(props, state, context) {
|
|
26
25
|
const group = context?.radioGroup;
|
|
27
26
|
if (group) return {
|
|
@@ -4,7 +4,6 @@ export interface RadioGroupAdapter<P extends RadioGroupBaseProps = RadioGroupBas
|
|
|
4
4
|
notifyChange: (e: RadioChangeEvent) => void;
|
|
5
5
|
setValue: (value: any) => void;
|
|
6
6
|
}
|
|
7
|
-
/** The props the foundation reads with getProp */
|
|
8
7
|
export interface RadioGroupBaseProps {
|
|
9
8
|
mode?: string;
|
|
10
9
|
value?: unknown;
|
|
@@ -42,10 +42,8 @@ export interface RatingState {
|
|
|
42
42
|
value: number;
|
|
43
43
|
hoverValue: number;
|
|
44
44
|
clearedValue: number;
|
|
45
|
-
/** index of the star that holds keyboard focus */
|
|
46
45
|
focusVisibleStar?: number;
|
|
47
46
|
}
|
|
48
|
-
/** The props the foundation reads with getProps */
|
|
49
47
|
export interface RatingBaseProps extends RatingValueProps {
|
|
50
48
|
count?: number;
|
|
51
49
|
allowHalf?: boolean;
|
|
@@ -75,7 +73,6 @@ export default class RatingFoundation<P extends RatingBaseProps = RatingBaseProp
|
|
|
75
73
|
disabled: boolean;
|
|
76
74
|
firstTabStop: boolean;
|
|
77
75
|
}): RatingItemModel;
|
|
78
|
-
/** Whether a focus on `value` belongs to the first (half) radio of the star at `index` */
|
|
79
76
|
static isFirstRadio(value: number, index: number, allowHalf: boolean): boolean;
|
|
80
77
|
/**
|
|
81
78
|
* The value a click selects through the radio it hit, or undefined when it is an ordinary pointer click. Detail 0 is
|
|
@@ -83,7 +80,6 @@ export default class RatingFoundation<P extends RatingBaseProps = RatingBaseProp
|
|
|
83
80
|
* activated radio decides the value
|
|
84
81
|
*/
|
|
85
82
|
static resolveClickRadio(detail: number, radioValue?: number): number | undefined;
|
|
86
|
-
/** What Enter or Space on a radio does: whether to `preventDefault` the key, and the value to select if any */
|
|
87
83
|
static resolveKeyActivation(key: string, radioValue: number | undefined, value: number): {
|
|
88
84
|
preventDefault: boolean;
|
|
89
85
|
selectValue?: number;
|
|
@@ -96,7 +92,6 @@ export default class RatingFoundation<P extends RatingBaseProps = RatingBaseProp
|
|
|
96
92
|
handleHover: (event: Pick<MouseEvent, "pageX">, index: number) => void;
|
|
97
93
|
handleMouseLeave: () => void;
|
|
98
94
|
handleClick: (event: CE & Pick<MouseEvent, "pageX">, index: number) => void;
|
|
99
|
-
/** Commits `newValue` for the star at `index`; selecting the current value clears it when allowClear is on */
|
|
100
95
|
handleSelect: (event: CE, index: number, newValue: number) => void;
|
|
101
96
|
handleFocus: (e: FE) => void;
|
|
102
97
|
/** A radio of the star at `index` got focus; index === count is the empty star */
|
|
@@ -64,7 +64,6 @@ var RatingFoundation = class RatingFoundation extends BaseFoundation {
|
|
|
64
64
|
secondPosInSet: allowHalf ? isEmpty ? 2 * count + 1 : 2 * (index + 1) : index + 1
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
/** Whether a focus on `value` belongs to the first (half) radio of the star at `index` */
|
|
68
67
|
static isFirstRadio(value, index, allowHalf) {
|
|
69
68
|
return allowHalf && value - index === .5;
|
|
70
69
|
}
|
|
@@ -76,7 +75,6 @@ var RatingFoundation = class RatingFoundation extends BaseFoundation {
|
|
|
76
75
|
static resolveClickRadio(detail, radioValue) {
|
|
77
76
|
return detail === 0 ? radioValue : void 0;
|
|
78
77
|
}
|
|
79
|
-
/** What Enter or Space on a radio does: whether to `preventDefault` the key, and the value to select if any */
|
|
80
78
|
static resolveKeyActivation(key, radioValue, value) {
|
|
81
79
|
const isSpace = key === " ";
|
|
82
80
|
if (key !== "Enter" && !isSpace || radioValue === void 0) return { preventDefault: false };
|
|
@@ -110,7 +108,6 @@ var RatingFoundation = class RatingFoundation extends BaseFoundation {
|
|
|
110
108
|
handleClick = (event, index) => {
|
|
111
109
|
this.handleSelect(event, index, this.getStarValue(index, event.pageX));
|
|
112
110
|
};
|
|
113
|
-
/** Commits `newValue` for the star at `index`; selecting the current value clears it when allowClear is on */
|
|
114
111
|
handleSelect = (event, index, newValue) => {
|
|
115
112
|
const { allowClear } = this.getProps();
|
|
116
113
|
const value = RatingFoundation.deriveValue(this.getProps(), this.getStates());
|
|
@@ -19,7 +19,6 @@ export interface ResizeGroupAdapter<P extends ResizeGroupBaseProps = ResizeGroup
|
|
|
19
19
|
getItemEnd: (index: number) => ResizeCallback | undefined;
|
|
20
20
|
getItemDefaultSize: (index: number) => string | number | undefined;
|
|
21
21
|
}
|
|
22
|
-
/** The props the foundation reads with getProp */
|
|
23
22
|
export interface ResizeGroupBaseProps {
|
|
24
23
|
direction?: 'horizontal' | 'vertical';
|
|
25
24
|
}
|
|
@@ -38,9 +37,6 @@ export declare class ResizeGroupFoundation<P extends ResizeGroupBaseProps = Resi
|
|
|
38
37
|
* Re-runs initSpace the first time the group is measurable (#3336); later resizes must not, or the drag is lost.
|
|
39
38
|
*/
|
|
40
39
|
handleGroupResize: () => void;
|
|
41
|
-
/**
|
|
42
|
-
* Moves each item's inline size to the new axis, where the handlers take a different length
|
|
43
|
-
*/
|
|
44
40
|
handleDirectionChange: () => void;
|
|
45
41
|
/**
|
|
46
42
|
* Keyboard resize, reported like a drag: arrows move 1% of the group (Shift: 10%), Home and End go to the
|
|
@@ -185,7 +185,6 @@ var ResizeGroupFoundation = class extends BaseFoundation {
|
|
|
185
185
|
nextItemSize: (this.#direction === "horizontal" ? nextItem.offsetWidth : nextItem.offsetHeight) + this.#itemMinusMap.get(handlerIndex + 1)
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
/** Returns false when either item's onResizeStart returned false */
|
|
189
188
|
#notifyResizeStart(handlerIndex, e) {
|
|
190
189
|
const [lastDir, nextDir] = getItemDirection(this.#direction);
|
|
191
190
|
const lastResult = this.adapter.getItemStart(handlerIndex)?.(e, lastDir);
|
|
@@ -203,9 +202,6 @@ var ResizeGroupFoundation = class extends BaseFoundation {
|
|
|
203
202
|
handleGroupResize = () => {
|
|
204
203
|
if (!this.#sizeInitialized && this.#groupSize > 0) this.#initSpace();
|
|
205
204
|
};
|
|
206
|
-
/**
|
|
207
|
-
* Moves each item's inline size to the new axis, where the handlers take a different length
|
|
208
|
-
*/
|
|
209
205
|
handleDirectionChange = () => {
|
|
210
206
|
const [stale, current] = this.#direction === "horizontal" ? ["height", "width"] : ["width", "height"];
|
|
211
207
|
this.#measureHandlerRoom();
|
|
@@ -111,7 +111,6 @@ $module: #{$prefix}-resizable;
|
|
|
111
111
|
&-handler {
|
|
112
112
|
@include flex-center;
|
|
113
113
|
z-index: $z-resizable_handler;
|
|
114
|
-
// a touch drag would otherwise scroll the page and cancel the pointer
|
|
115
114
|
touch-action: none;
|
|
116
115
|
user-select: none;
|
|
117
116
|
background-color: var(--semi-color-fill-0);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from "../../base/foundation.js";
|
|
2
2
|
import { Direction, ResizeCallback, ResizeStartCallback, Size } from "../types.js";
|
|
3
|
-
/** The props the foundation reads */
|
|
4
3
|
export interface ResizableBaseProps extends SizeProps {
|
|
5
4
|
grid?: [number, number];
|
|
6
5
|
snap?: {
|
|
@@ -73,10 +72,7 @@ export declare class ResizableFoundation<P extends ResizableBaseProps = Resizabl
|
|
|
73
72
|
height: string;
|
|
74
73
|
};
|
|
75
74
|
init(): void;
|
|
76
|
-
/**
|
|
77
|
-
* Reads the size and limits for aria-valuenow, -valuemin and -valuemax. A change of the limits alone goes
|
|
78
|
-
* unnoticed until the next resize.
|
|
79
|
-
*/
|
|
75
|
+
/** A change of the limits alone goes unnoticed until the next resize. */
|
|
80
76
|
updateAriaRange: () => void;
|
|
81
77
|
/**
|
|
82
78
|
* Keyboard resize along the axis of the edge, KEYBOARD_STEP px per press, reported like a drag.
|
|
@@ -367,10 +367,7 @@ var ResizableFoundation = class ResizableFoundation extends BaseFoundation {
|
|
|
367
367
|
init() {
|
|
368
368
|
this.updateAriaRange();
|
|
369
369
|
}
|
|
370
|
-
/**
|
|
371
|
-
* Reads the size and limits for aria-valuenow, -valuemin and -valuemax. A change of the limits alone goes
|
|
372
|
-
* unnoticed until the next resize.
|
|
373
|
-
*/
|
|
370
|
+
/** A change of the limits alone goes unnoticed until the next resize. */
|
|
374
371
|
updateAriaRange = () => {
|
|
375
372
|
if (this.getStates().isResizing) return;
|
|
376
373
|
this.#resizable = this.adapter.getResizable();
|
|
@@ -6,7 +6,6 @@ export interface Item {
|
|
|
6
6
|
text?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
}
|
|
9
|
-
/** The props the foundation reads with getProp */
|
|
10
9
|
export interface ScrollItemBaseProps<I extends Item = Item> {
|
|
11
10
|
cycled?: boolean;
|
|
12
11
|
list?: I[];
|
|
@@ -51,6 +50,5 @@ export default class ItemFoundation<I extends Item = Item, P extends ScrollItemB
|
|
|
51
50
|
syncList: () => void;
|
|
52
51
|
/** The owner changed `selectedIndex` */
|
|
53
52
|
syncSelectedIndex: (selectedIndex: number, previous: number) => void;
|
|
54
|
-
/** Centres the item last selected */
|
|
55
53
|
scrollToSelected: (duration?: number) => void;
|
|
56
54
|
}
|
|
@@ -328,7 +328,6 @@ var ItemFoundation = class extends BaseFoundation {
|
|
|
328
328
|
this.#cacheSelectedNode(this.#willSelectNode);
|
|
329
329
|
this.scrollToSelected();
|
|
330
330
|
};
|
|
331
|
-
/** Centres the item last selected */
|
|
332
331
|
scrollToSelected = (duration = numbers.DEFAULT_SCROLL_DURATION) => {
|
|
333
332
|
this.#scrollToNode(this.#selectedNode, duration);
|
|
334
333
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use 'semi:theme' as *;
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
$color-scrollList-bg: var(--semi-color-bg-3); // 滚动列表背景色
|
|
4
4
|
$color-scrollList-border: var(--semi-color-border); // 滚动列表描边颜色
|
|
5
5
|
$color-scrollList_header-bg: transparent; // 滚动列表 header 背景色
|
|
@@ -14,7 +14,6 @@ $color-scrollList_selected_item-text: var(--semi-color-text-0); // 滚动列表
|
|
|
14
14
|
$color-scrollList_selected_item-icon: var(--semi-color-text-2); // 滚动列表选中选项图标颜色
|
|
15
15
|
$color-scrollList_footer-border: var(--semi-color-border); // 滚动列表底部描边颜色
|
|
16
16
|
|
|
17
|
-
// Width/Height
|
|
18
17
|
$height-scrollList: 300px;
|
|
19
18
|
$height-scrollList_item: 36px;
|
|
20
19
|
$width-scrollList_item-border: $border-thickness-control;
|
|
@@ -23,7 +22,6 @@ $width-scrollList_item_wheel_selector-border: $border-thickness-control;
|
|
|
23
22
|
$height-scrollList_line: 1px;
|
|
24
23
|
$width-scrollList_footer-border: $border-thickness-control;
|
|
25
24
|
|
|
26
|
-
// Spacing
|
|
27
25
|
$spacing-scrollList_header-paddingY: 0;
|
|
28
26
|
$spacing-scrollList_header-paddingX: 16px;
|
|
29
27
|
$spacing-scrollList_header_title-paddingY: $spacing-base;
|
|
@@ -39,12 +37,9 @@ $spacing-scrollList_item_wheel_list_shade_pre-marginTop: -1 * ($height-scrollLis
|
|
|
39
37
|
$spacing-scrollList_item_wheel_list_shade_post-marginTop: $height-scrollList_item * 0.5 + $border-thickness-control;
|
|
40
38
|
$spacing-scrollList_footer-padding: 10px;
|
|
41
39
|
|
|
42
|
-
// Radius
|
|
43
40
|
$radius-scrollList: var(--semi-border-radius-medium);
|
|
44
41
|
|
|
45
|
-
// Font
|
|
46
42
|
$font-scrollList_header_title-fontWeight: $font-weight-bold;
|
|
47
43
|
$font-scrollList_item_wheel_item_selected-fontWeight: $font-weight-bold;
|
|
48
44
|
|
|
49
|
-
// Other
|
|
50
45
|
$shadow-scrollList: var(--semi-shadow-elevated);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation.js";
|
|
2
2
|
import { isComposing } from "../utils/key-code.js";
|
|
3
3
|
import { BasicOptionProps, OptionRecord } from "./option-foundation.js";
|
|
4
|
-
/** The props the foundation reads with getProps */
|
|
5
4
|
export interface SelectBaseProps {
|
|
6
5
|
allowCreate?: boolean;
|
|
7
6
|
autoClearSearchValue?: boolean;
|
|
@@ -9,8 +9,8 @@ export interface BasicOptionProps {
|
|
|
9
9
|
style?: Record<string, any>;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* `data` is what the host read from an optionList item or an option child, and is all that callbacks and the
|
|
13
|
+
* selections receive; the rest is Select's own state, kept off the user's object.
|
|
14
14
|
*/
|
|
15
15
|
export interface OptionRecord<D = BasicOptionProps, G = {
|
|
16
16
|
label?: unknown;
|
|
@@ -37,7 +37,6 @@ export interface OptionRun<R extends {
|
|
|
37
37
|
index: number;
|
|
38
38
|
}[];
|
|
39
39
|
}
|
|
40
|
-
/** Splits the visible options into runs of adjacent options of the same group, keeping each option's visible index */
|
|
41
40
|
export declare function getOptionRuns<R extends {
|
|
42
41
|
group?: {
|
|
43
42
|
key?: unknown;
|
|
@@ -9,7 +9,6 @@ function toOptionRecord(data, index, group, childKey) {
|
|
|
9
9
|
selected: false
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
/** Splits the visible options into runs of adjacent options of the same group, keeping each option's visible index */
|
|
13
12
|
function getOptionRuns(options) {
|
|
14
13
|
const runs = [];
|
|
15
14
|
options.forEach((option, index) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use 'semi:theme' as *;
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
$color-select-bg-default: var(--semi-color-fill-0); // 选择器输入框背景色 - 默认态
|
|
4
4
|
$color-select-bg-hover: var(--semi-color-fill-1); // 选择器输入框背景色 - 悬停态
|
|
5
5
|
$color-select-bg-active: var(--semi-color-fill-2); // 选择器输入框背景色 - 按下态
|
|
@@ -35,7 +35,6 @@ $color-select_main-text-default: var(--semi-color-text-0); // 选择器输入框
|
|
|
35
35
|
$color-select-icon-default: var(--semi-color-text-2); // 选择器输入框图标颜色
|
|
36
36
|
$color-select_clearBtn-text-default: var(--semi-color-text-2); // 选择器输入框清空按钮颜色 - 默认态
|
|
37
37
|
$color-select_clearBtn-text-hover: var(--semi-color-primary); // 选择器输入框清空按钮颜色 - 悬停态
|
|
38
|
-
// $color-select_input-bg-default: transparent; // 选择器输入框清空按钮颜色 - 悬停态
|
|
39
38
|
$color-select_input_disabled-bg: var(--semi-color-disabled-fill); // 禁用选择器输入框背景色
|
|
40
39
|
$color-select_input_disabled-border-focus: transparent; // 禁用选择器输入框描边颜色 - 聚焦态
|
|
41
40
|
$color-select_input_disabled-text: var(--semi-color-disabled-text); // 禁用选择器输入框回填内容文字颜色
|
|
@@ -50,7 +49,6 @@ $color-select_option-icon-default: transparent; // 选择器下拉菜单选项
|
|
|
50
49
|
$color-select_option-bg-hover: var(--semi-color-fill-0); // 选择器下拉菜单选项背景颜色 - 悬停态
|
|
51
50
|
$color-select_option-bg-active: var(--semi-color-fill-1); // 选择器下拉菜单选项背景颜色 - 按下态
|
|
52
51
|
$color-select_option_disabled-text: var(--semi-color-disabled-text); // 禁用选择器下拉菜单选项文字颜色
|
|
53
|
-
// $color-select_option_disabled-bg: transparent; // 禁用选择器下拉菜单选项背景颜色
|
|
54
52
|
$color-select_option-icon-active: var(--semi-color-text-2); // 选择器下拉菜单选项图标颜色 - 选中态
|
|
55
53
|
$color-select_option-border-default: var(--semi-color-border); // 选择器下拉菜单分组标题分割线颜色
|
|
56
54
|
$color-select-option-bg-selected: transparent; // 选择器下拉菜单选项背景颜色 - 选中态
|
|
@@ -59,7 +57,6 @@ $color-select_group-text: var(--semi-color-text-2); // 选择器下拉菜单分
|
|
|
59
57
|
|
|
60
58
|
$color-select_prefix_suffix_text-default: var(--semi-color-text-2); // 选择器输入框前后缀文本颜色
|
|
61
59
|
|
|
62
|
-
// Width/Height
|
|
63
60
|
$height-select_large: $height-control-large; // 选择器输入框高度 - 大尺寸
|
|
64
61
|
$height-select_small: $height-control-small; // 选择器输入框高度 - 小尺寸
|
|
65
62
|
$height-select_default: $height-control-default; // 选择器输入框高度 - 默认尺寸
|
|
@@ -77,7 +74,6 @@ $height-select_multiple_input_large: 24px; // 大尺寸多项选择器输入框I
|
|
|
77
74
|
$width-select-border-hover: $width-select-border; // 选择器输入框描边宽度 - 悬浮
|
|
78
75
|
$width-select-border-focus: $width-select-border-hover; // 选择器输入框描边宽度 - 按下
|
|
79
76
|
$width-select-border-active: $width-select-border-focus; // 选择器输入框描边宽度 - 选中
|
|
80
|
-
// Spacing
|
|
81
77
|
$spacing-select_option_tick-marginRight: $spacing-tight; // 选择器下拉菜单选中对勾右侧外边距
|
|
82
78
|
$spacing-select_prefix_suffix_text-marginX: $spacing-base-tight; // 选择器输入框前后缀文本水平内边距
|
|
83
79
|
$spacing-select_prefix_suffix_text-marginY: 0px; // 选择器输入框前后缀文本垂直内边距
|
|
@@ -115,14 +111,11 @@ $spacing-select_dropdown_input_paddingBottom: 8px; // 下拉搜索框底部内
|
|
|
115
111
|
$spacing-select_dropdown_input_paddingRight: 12px; // 下拉搜索框右侧内边距
|
|
116
112
|
$spacing-select_dropdown_input_paddingLeft: 12px; // 下拉搜索框左侧内边距
|
|
117
113
|
|
|
118
|
-
// Radius
|
|
119
114
|
$radius-select: var(--semi-border-radius-small); // 选择器输入框圆角
|
|
120
115
|
$radius-select_option: 0px; // 选择器待选项圆角
|
|
121
116
|
|
|
122
|
-
// Font
|
|
123
117
|
$font-select-fontWeight: $font-weight-regular; // 选择器文本字重
|
|
124
118
|
$font-select_keyword-fontWeight: 600; // 选择器搜索结果命关键词中文本字重
|
|
125
119
|
$font-select_prefix_suffix-fontWeight: $font-weight-bold; // 选择器输入框前后缀文本字重
|
|
126
120
|
|
|
127
|
-
// Other
|
|
128
121
|
$opacity-select_selection_text_inactive: 0.4;
|
|
@@ -46,17 +46,12 @@ export interface SideSheetAdapter<P extends SideSheetProps = SideSheetProps, S e
|
|
|
46
46
|
/** Traps focus in the sheet; a no-op without mask, which is not modal */
|
|
47
47
|
trapFocus: () => void;
|
|
48
48
|
releaseFocus: () => void;
|
|
49
|
-
/** Focuses the element focused before the sheet opened */
|
|
50
49
|
restoreFocus: () => void;
|
|
51
50
|
toggleDisplayNone: (displayNone: boolean) => void;
|
|
52
51
|
}
|
|
53
52
|
export default class SideSheetFoundation<P extends SideSheetProps = SideSheetProps, S extends SideSheetState = SideSheetState> extends BaseFoundation<SideSheetAdapter<P, S>, P, S> {
|
|
54
53
|
#private;
|
|
55
|
-
/**
|
|
56
|
-
* A top or bottom sheet spans the width unless `canVerticalSetWidth`, and takes `height` (448 by default); a left or
|
|
57
|
-
* right sheet spans the height. Without a mask the width goes on the outer element and the dialog fills it: a
|
|
58
|
-
* percentage repeated on the dialog would compound.
|
|
59
|
-
*/
|
|
54
|
+
/** Without a mask the width goes on the outer element and the dialog fills it: a percentage repeated on the dialog would compound. */
|
|
60
55
|
static getSheetSize({ placement, canVerticalSetWidth, width, height, mask }: Pick<SideSheetProps, 'placement' | 'width' | 'height' | 'mask'> & {
|
|
61
56
|
canVerticalSetWidth?: boolean;
|
|
62
57
|
}): SheetSize;
|