@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
|
@@ -95,13 +95,7 @@ export interface MonthsGridAdapter extends DefaultAdapter<MonthsGridFoundationPr
|
|
|
95
95
|
}
|
|
96
96
|
export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapter, MonthsGridFoundationProps, MonthsGridFoundationState> {
|
|
97
97
|
#private;
|
|
98
|
-
/**
|
|
99
|
-
* Shifts the other panel when the panel being changed lands on the other panel's month.
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* - panelType=right, target=new Date('2022-09-01') and left panel is in '2022-09' => call it, left panel minus one month to '2022-08'
|
|
103
|
-
* - panelType=left, target=new Date('2021-12-01') and right panel is in '2021-12' => call it, right panel add one month to '2021-01'
|
|
104
|
-
*/
|
|
98
|
+
/** Shifts the other panel when the panel being changed lands on the other panel's month. */
|
|
105
99
|
protected handleSyncChangeMonths({ panelType, target }: {
|
|
106
100
|
panelType: PanelType;
|
|
107
101
|
target: Date;
|
|
@@ -115,7 +109,6 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
115
109
|
/** The time part of `format`, in the tokens the time panel uses */
|
|
116
110
|
static getValidTimeFormat(format?: string): string;
|
|
117
111
|
static getValidDateFormat(props: Pick<MonthsGridFoundationProps, 'format' | 'type'>): string;
|
|
118
|
-
/** The disabled hours, minutes and seconds `disabledTime` gives the time panel of `panelType` */
|
|
119
112
|
static calcDisabledTime({ disabledTime, type }: Pick<MonthsGridFoundationProps, 'disabledTime' | 'type'>, { rangeStart, rangeEnd, monthLeft }: Pick<MonthsGridFoundationState, 'rangeStart' | 'rangeEnd' | 'monthLeft'>, panelType: PanelType): {
|
|
120
113
|
disabledHours?: () => number[];
|
|
121
114
|
disabledMinutes?: (hour: number) => number[];
|
|
@@ -126,11 +119,9 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
126
119
|
* number of weeks makes the scroll list unstable
|
|
127
120
|
*/
|
|
128
121
|
static getYAMOpenType(state: Pick<MonthsGridFoundationState, 'monthLeft' | 'monthRight'>): "left" | "right" | "none" | "both";
|
|
129
|
-
/** The panel shows a scroll list, its year and month picker or its time picker, instead of the month */
|
|
130
122
|
static isYearOrTime(panel: PanelState): boolean;
|
|
131
123
|
/** The `x-open-type` of a panel: what it shows in place of, or beside, its month */
|
|
132
124
|
static getOpenType(panel: PanelState): "time" | "date" | "year";
|
|
133
|
-
/** The title of a month in the navigation, from the locale's `monthText` pattern */
|
|
134
125
|
static formatMonthText(locale: Pick<Locale['DatePicker'], 'monthText' | 'months'>, month?: Date): string;
|
|
135
126
|
/** The texts of a panel's date and time switch; the date is the picked range endpoint, else the shown date */
|
|
136
127
|
static getSwitchTexts({ rangeEndpoint, showDate, dateFormat, format: formatProp, locale, dateFnsLocale }: {
|
|
@@ -295,13 +295,7 @@ var MonthsGridFoundation = class MonthsGridFoundation extends BaseFoundation {
|
|
|
295
295
|
});
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
/**
|
|
299
|
-
* Shifts the other panel when the panel being changed lands on the other panel's month.
|
|
300
|
-
*
|
|
301
|
-
* @example
|
|
302
|
-
* - panelType=right, target=new Date('2022-09-01') and left panel is in '2022-09' => call it, left panel minus one month to '2022-08'
|
|
303
|
-
* - panelType=left, target=new Date('2021-12-01') and right panel is in '2021-12' => call it, right panel add one month to '2021-01'
|
|
304
|
-
*/
|
|
298
|
+
/** Shifts the other panel when the panel being changed lands on the other panel's month. */
|
|
305
299
|
handleSyncChangeMonths({ panelType, target }) {
|
|
306
300
|
const { type } = this.adapter.getProps();
|
|
307
301
|
const { monthLeft, monthRight } = this.adapter.getStates();
|
|
@@ -372,7 +366,6 @@ var MonthsGridFoundation = class MonthsGridFoundation extends BaseFoundation {
|
|
|
372
366
|
static getValidDateFormat(props) {
|
|
373
367
|
return props.format || getDefaultFormatToken(props.type);
|
|
374
368
|
}
|
|
375
|
-
/** The disabled hours, minutes and seconds `disabledTime` gives the time panel of `panelType` */
|
|
376
369
|
static calcDisabledTime({ disabledTime, type }, { rangeStart, rangeEnd, monthLeft }, panelType) {
|
|
377
370
|
if (typeof disabledTime === "function" && panelType && isDateTimeType(type)) {
|
|
378
371
|
const selected = [];
|
|
@@ -396,7 +389,6 @@ var MonthsGridFoundation = class MonthsGridFoundation extends BaseFoundation {
|
|
|
396
389
|
else if (rightYearPickerOpen) return "right";
|
|
397
390
|
return "none";
|
|
398
391
|
}
|
|
399
|
-
/** The panel shows a scroll list, its year and month picker or its time picker, instead of the month */
|
|
400
392
|
static isYearOrTime(panel) {
|
|
401
393
|
return Boolean(panel && (panel.isTimePickerOpen || panel.isYearPickerOpen));
|
|
402
394
|
}
|
|
@@ -404,7 +396,6 @@ var MonthsGridFoundation = class MonthsGridFoundation extends BaseFoundation {
|
|
|
404
396
|
static getOpenType(panel) {
|
|
405
397
|
return panel.isYearPickerOpen ? "year" : panel.isTimePickerOpen ? "time" : "date";
|
|
406
398
|
}
|
|
407
|
-
/** The title of a month in the navigation, from the locale's `monthText` pattern */
|
|
408
399
|
static formatMonthText(locale, month) {
|
|
409
400
|
if (!month) return "";
|
|
410
401
|
const monthName = locale.months[month.getMonth() + 1];
|
|
@@ -8,7 +8,6 @@ export interface DragMoveAdapter<P extends DragMoveBaseProps = DragMoveBaseProps
|
|
|
8
8
|
notifyTouchEnd: (e: PointerEvent) => void;
|
|
9
9
|
notifyTouchCancel: (e: PointerEvent) => void;
|
|
10
10
|
}
|
|
11
|
-
/** The props the foundation reads with getProp */
|
|
12
11
|
export interface DragMoveBaseProps {
|
|
13
12
|
handler?: () => HTMLElement | null;
|
|
14
13
|
constrainer?: 'parent' | (() => HTMLElement | null);
|
|
@@ -11,12 +11,10 @@ export interface DropdownAdapter<P extends DropdownBaseProps = DropdownBaseProps
|
|
|
11
11
|
}
|
|
12
12
|
/** The members of a keyboard event the foundation reads; DOM events and React synthetic events both satisfy it */
|
|
13
13
|
type DropdownKeyEvent = Pick<KeyboardEvent, 'defaultPrevented' | 'key' | 'preventDefault' | 'stopPropagation' | 'target'>;
|
|
14
|
-
/** The props the foundation reads */
|
|
15
14
|
export interface DropdownBaseProps {
|
|
16
15
|
trigger?: string;
|
|
17
16
|
visible?: boolean;
|
|
18
17
|
}
|
|
19
|
-
/** The state the foundation reads */
|
|
20
18
|
export interface DropdownBaseState {
|
|
21
19
|
popVisible: boolean;
|
|
22
20
|
}
|
|
@@ -4,7 +4,7 @@ export type DropdownSelectionMode = 'single' | 'multiple';
|
|
|
4
4
|
* Role and checked state of a menu item, from the menu's selectionMode (as React Aria Menu) and showTick. Without a
|
|
5
5
|
* selectionMode a tick shows a checked state, so showTick alone makes the items checkboxes.
|
|
6
6
|
*/
|
|
7
|
-
export declare function getItemRole(selectionMode?: DropdownSelectionMode, showTick?: boolean): "
|
|
7
|
+
export declare function getItemRole(selectionMode?: DropdownSelectionMode, showTick?: boolean): "menuitemradio" | "menuitemcheckbox" | "menuitem";
|
|
8
8
|
/**
|
|
9
9
|
* What a Dropdown provides to everything inside its popup, read by the menus there and by a Dropdown whose trigger is
|
|
10
10
|
* one of their items. A framework adapter passes it as the foundation context, with the reading direction added.
|
|
@@ -23,7 +23,6 @@ export interface DropdownMenuContext extends DirectionContext {
|
|
|
23
23
|
/** Id of the popup that renders the menu; its trigger carries it as data-popupid */
|
|
24
24
|
getPopupId?: () => string;
|
|
25
25
|
}
|
|
26
|
-
/** The adapter of a foundation that reads DropdownMenuContext */
|
|
27
26
|
export interface DropdownContextAdapter<P = object, S = object> extends DefaultAdapter<P, S, DropdownMenuContext> {}
|
|
28
27
|
/**
|
|
29
28
|
* Keyboard of a menu (WAI-ARIA APG menu pattern): arrows, Home and End move focus between the enabled items of this
|
|
@@ -9,7 +9,6 @@ export type FeedbackValue = CheckboxValue | CheckboxValue[] | EmojiResult;
|
|
|
9
9
|
/** Nothing chosen: null, undefined, an empty string or an empty array. 0 and false are real radio values. */
|
|
10
10
|
export declare function isFeedbackValueEmpty(value?: FeedbackValue | null): boolean;
|
|
11
11
|
type PromiseStatus = 'pending' | 'fulfilled' | 'rejected';
|
|
12
|
-
/** The state the foundation reads with getState */
|
|
13
12
|
export interface FeedbackBaseState {
|
|
14
13
|
value: FeedbackValue | null;
|
|
15
14
|
onOKReturnPromiseStatus?: PromiseStatus;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
@use 'semi:theme' as *;
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
$color-feedback_thank_text: var(--semi-color-text-2); // 感谢文字的文本颜色
|
|
4
4
|
|
|
5
|
-
// width
|
|
6
5
|
$width-feedback: 400px; // 除去文本类型外其他类型的宽度
|
|
7
6
|
$width-feedback_text: 600px; // 文本类型的宽度
|
|
8
7
|
|
|
9
|
-
// spacing
|
|
10
8
|
$spacing-feedback_emoji_container-columnGap: 24px; // emoji容器中emoji的间距
|
|
11
9
|
$spacing-feedback_emoji_container-marginY: 24px; // emoji容器的上下间距
|
|
12
10
|
$spacing-feedback_thank_text-marginTop: 24px; // 感谢文字的文本的顶部间距
|
|
@@ -16,11 +14,9 @@ $spacing-feedback_footer-columnGap: 12px; // 底部按钮的间距
|
|
|
16
14
|
$spacing-feedback_sidesheet_bottom-right: 20px; // 底部弹窗的右间距
|
|
17
15
|
$spacing-feedback_sidesheet_bottom_inner_wrap-bottom: 50px; // 底部弹窗的底部间距
|
|
18
16
|
|
|
19
|
-
// font
|
|
20
17
|
$font-feedback_emoji-fontSize: 36px; // emoji的大小
|
|
21
18
|
$font-feedback_thank_text-fontSize: $font-size-regular; // 感谢文字的文本大小
|
|
22
19
|
$font-feedback_thank_text-lineHeight: 20px; // 感谢文字的文本行高
|
|
23
20
|
$font-feedback_thank_text-fontWeight: $font-weight-regular; // 感谢文字的文本字体粗细
|
|
24
21
|
|
|
25
|
-
// radius
|
|
26
22
|
$radius-feedback_sidesheet_inner: 12px; // 底部弹窗的圆角
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
.semi-floatButton-default.semi-floatButton-round .semi-badge-dot,
|
|
65
65
|
.semi-floatButton-default.semi-floatButton-round .semi-badge-count {
|
|
66
66
|
inset-inline-end: 4.64px;
|
|
67
|
-
/* Badge center sits on the circle's diagonal: 0.29 * R, R = 0.5 * width */
|
|
68
67
|
top: 4.64px;
|
|
69
68
|
}
|
|
70
69
|
.semi-floatButton-small {
|
|
@@ -87,8 +87,6 @@ $moduleGroup: #{$prefix}-floatButtonGroup;
|
|
|
87
87
|
.#{$prefix}-badge-dot,
|
|
88
88
|
.#{$prefix}-badge-count {
|
|
89
89
|
inset-inline-end: calc(0.29 * 0.5 * $width-floatButton);
|
|
90
|
-
|
|
91
|
-
/* Badge center sits on the circle's diagonal: 0.29 * R, R = 0.5 * width */
|
|
92
90
|
top: calc(0.29 * 0.5 * $width-floatButton);
|
|
93
91
|
}
|
|
94
92
|
}
|
package/dist/form/form.scss
CHANGED
|
@@ -50,12 +50,6 @@ $rating: #{$prefix}-rating;
|
|
|
50
50
|
margin: 0;
|
|
51
51
|
overflow: hidden;
|
|
52
52
|
|
|
53
|
-
&[x-label-pos='top'] {
|
|
54
|
-
// .#{$col}-right,
|
|
55
|
-
// .#{$col}-left {
|
|
56
|
-
// width: 100%;
|
|
57
|
-
// }
|
|
58
|
-
}
|
|
59
53
|
.#{$col} {
|
|
60
54
|
&-right {
|
|
61
55
|
display: flex;
|
|
@@ -82,12 +76,6 @@ $rating: #{$prefix}-rating;
|
|
|
82
76
|
}
|
|
83
77
|
}
|
|
84
78
|
}
|
|
85
|
-
|
|
86
|
-
.#{$field}-pure {
|
|
87
|
-
// padding-top: 0;
|
|
88
|
-
// padding-bottom: 0;
|
|
89
|
-
// overflow: inherit;
|
|
90
|
-
}
|
|
91
79
|
}
|
|
92
80
|
|
|
93
81
|
&-field-label {
|
package/dist/form/foundation.js
CHANGED
|
@@ -192,19 +192,6 @@ var FormFoundation = class extends BaseFoundation {
|
|
|
192
192
|
});
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
/**
|
|
196
|
-
* Case A:
|
|
197
|
-
* All fields: a[0]、a[1]、b.type、b.name[2]、b.name[0]
|
|
198
|
-
* input => output:
|
|
199
|
-
* a => a[0]、a[1]
|
|
200
|
-
* b => b.type、b.name[0]、b.name[2]
|
|
201
|
-
*
|
|
202
|
-
* Case B:
|
|
203
|
-
* All fields: activity.a[0]、activity.a[1]、activity.c、activity.d、other
|
|
204
|
-
* input => output:
|
|
205
|
-
* activity.a => activity.a[0]、activity.a[1]
|
|
206
|
-
*
|
|
207
|
-
*/
|
|
208
195
|
#getNestedField(path) {
|
|
209
196
|
const allRegisterField = this.#fields;
|
|
210
197
|
const allFieldPath = [...allRegisterField].map((item) => item[0]);
|
|
@@ -329,7 +316,6 @@ var FormFoundation = class extends BaseFoundation {
|
|
|
329
316
|
if (!silent) this.#validations.set(field, validation);
|
|
330
317
|
return validation;
|
|
331
318
|
}
|
|
332
|
-
/** Resolves with the field's error value, undefined when valid */
|
|
333
319
|
#validateCustom(registration, value, opts) {
|
|
334
320
|
const { validate } = registration.getValidateOptions();
|
|
335
321
|
const epoch = this.#epoch;
|
|
@@ -508,7 +494,6 @@ var FormFoundation = class extends BaseFoundation {
|
|
|
508
494
|
this.#forceUpdate();
|
|
509
495
|
return updateKey;
|
|
510
496
|
};
|
|
511
|
-
/** Inserts a row holding `rowValue` before `index`, or appends it without one */
|
|
512
497
|
#addArrayFieldRowWithValue = (arrayFieldPath, rowValue, index) => {
|
|
513
498
|
const values = this.#getValue(arrayFieldPath);
|
|
514
499
|
const rows = values ? values.slice() : [];
|
package/dist/form/interface.d.ts
CHANGED
|
@@ -52,35 +52,24 @@ export interface ValidateOptions<K extends keyof any = keyof any> {
|
|
|
52
52
|
silent?: boolean;
|
|
53
53
|
}
|
|
54
54
|
export interface BaseFormApi<T extends object = any> {
|
|
55
|
-
/** get value of field */
|
|
56
55
|
getValue: <P extends FieldPath<T>>(field?: P) => FieldPathValue<T, P>;
|
|
57
|
-
/** set value of field */
|
|
58
56
|
setValue: <K extends FieldPath<T>>(field: K, newFieldValue: any) => void;
|
|
59
|
-
/** get error of field */
|
|
60
57
|
getError: <K extends FieldPath<T>>(field: K) => any;
|
|
61
|
-
/** set error of field */
|
|
62
58
|
setError: <K extends FieldPath<T>>(field: K, fieldError: any) => void;
|
|
63
|
-
/** get touched of field */
|
|
64
59
|
getTouched: <K extends FieldPath<T>>(field: K) => boolean;
|
|
65
|
-
/**
|
|
60
|
+
/** A parent path takes the nested touched object of its fields */
|
|
66
61
|
setTouched: <K extends FieldPath<T>>(field: K, fieldTouch: boolean | Record<string, any>) => void;
|
|
67
|
-
/** judge field exist */
|
|
68
62
|
getFieldExist: <K extends FieldPath<T>>(field: K) => boolean;
|
|
69
|
-
/** get formState of form */
|
|
70
63
|
getFormState: () => FormState<T extends object ? T : object>;
|
|
71
|
-
/** get formProps of form */
|
|
72
64
|
getFormProps: (keys?: Array<string>) => ComponentProps;
|
|
73
|
-
/** submit form manual */
|
|
74
65
|
submitForm: () => void;
|
|
75
|
-
/** reset form manual */
|
|
76
66
|
reset: (fields?: Array<string>) => void;
|
|
77
|
-
/**
|
|
67
|
+
/** Resolves with the form values */
|
|
78
68
|
validate: <K extends FieldPath<T>>(fields?: Array<K> | ValidateOptions<K>) => Promise<T>;
|
|
79
69
|
/** Without a field, returns all the initial values */
|
|
80
70
|
getInitValue: <K extends FieldPath<T>>(field?: K) => any;
|
|
81
71
|
getInitValues: () => any;
|
|
82
72
|
getValues: () => T;
|
|
83
|
-
/** set value of multiple fields */
|
|
84
73
|
setValues: (fieldsValue: Partial<T>, config?: setValuesConfig) => void;
|
|
85
74
|
scrollToField: <K extends FieldPath<T>>(field: K, scrollConfig?: Options) => void;
|
|
86
75
|
scrollToError: <K extends FieldPath<T>>(config?: ScrollToErrorOptions<K>) => void;
|
|
@@ -112,7 +101,6 @@ export interface FieldValidateOptions {
|
|
|
112
101
|
transform?: (value: any) => any;
|
|
113
102
|
stopValidateWithError?: boolean;
|
|
114
103
|
}
|
|
115
|
-
/** A registered field: what the Form keeps per field to validate, reset and restore it */
|
|
116
104
|
export interface FieldRegistration {
|
|
117
105
|
/** Identifies the field component instance, which a remounted field of the same name does not share */
|
|
118
106
|
id: string;
|
|
@@ -143,7 +131,6 @@ export interface ArrayFieldRegistration {
|
|
|
143
131
|
updateKey?: number;
|
|
144
132
|
initValue?: any;
|
|
145
133
|
}
|
|
146
|
-
/** What fields and ArrayFields use to read and write the Form's state and to register themselves */
|
|
147
134
|
export interface FieldBridge {
|
|
148
135
|
register: (field: string, registration: FieldRegistration) => void;
|
|
149
136
|
unRegister: (field: string) => void;
|
package/dist/form/utils.d.ts
CHANGED
|
@@ -5,13 +5,6 @@ export declare function isRequired(rules?: any[] | Record<string, any>): boolean
|
|
|
5
5
|
export declare function isValid(errors: any): boolean;
|
|
6
6
|
/** One stable key per ArrayField row: rows that already have a key keep it, new rows get a fresh one */
|
|
7
7
|
export declare function generateKeys(value: unknown, oldKeys?: string[]): string[];
|
|
8
|
-
/**
|
|
9
|
-
* trigger transform rule
|
|
10
|
-
1. If the user has set fieldProps, follow the user's fieldProps
|
|
11
|
-
2. If the user does not set fieldProps, follow formProps
|
|
12
|
-
3. If there is no formProps, follow the change
|
|
13
|
-
4. If it is an array, follow the array, if it is not an array (pure string), convert it to a string array
|
|
14
|
-
*/
|
|
15
8
|
export declare function transformTrigger(fieldTrigger: FieldValidateTriggerType, formTrigger: FieldValidateTriggerType): Array<BasicTriggerType>;
|
|
16
9
|
export declare function transformDefaultBooleanAPI(fieldProp: boolean, formProp: boolean, defaultVal?: boolean): boolean;
|
|
17
10
|
export declare function nextUpdateKey(): number;
|
|
@@ -20,7 +13,6 @@ export declare function nextUpdateKey(): number;
|
|
|
20
13
|
* after setValues a row field keeps the form value and falls back to initValue only when the form has none.
|
|
21
14
|
*/
|
|
22
15
|
export declare function resolveFieldInitValue(initValue: unknown, valueInForm: unknown, shouldUseInitValue: boolean): unknown;
|
|
23
|
-
/** The props a field falls back to its Form for when it does not set them itself */
|
|
24
16
|
export interface FieldConfig {
|
|
25
17
|
labelPosition?: string;
|
|
26
18
|
labelWidth?: number | string;
|
package/dist/form/utils.js
CHANGED
|
@@ -32,13 +32,6 @@ function generateKeys(value, oldKeys = []) {
|
|
|
32
32
|
}
|
|
33
33
|
return value.map((_, i) => oldKeys[i] ?? createId());
|
|
34
34
|
}
|
|
35
|
-
/**
|
|
36
|
-
* trigger transform rule
|
|
37
|
-
1. If the user has set fieldProps, follow the user's fieldProps
|
|
38
|
-
2. If the user does not set fieldProps, follow formProps
|
|
39
|
-
3. If there is no formProps, follow the change
|
|
40
|
-
4. If it is an array, follow the array, if it is not an array (pure string), convert it to a string array
|
|
41
|
-
*/
|
|
42
35
|
function transformTrigger(fieldTrigger, formTrigger) {
|
|
43
36
|
let result = [];
|
|
44
37
|
let finalResult = [];
|
package/dist/form/variables.scss
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use 'semi:theme' as *;
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
$spacing-form_field_horizontal-paddingRight: $spacing-base; // 水平布局表单项右侧内边距
|
|
4
4
|
$spacing-form_field_group_horizontal-paddingRight: $spacing-base; // 水平布局表单组标题右侧内边距
|
|
5
5
|
$spacing-form_field_vertical-paddingTop: $spacing-base-tight; // 表单项顶部内边距(垂直布局)
|
|
@@ -7,7 +7,6 @@ $spacing-form_field_vertical-paddingBottom: $spacing-base-tight; // 表单项底
|
|
|
7
7
|
$spacing-form_field_group_vertical-paddingTop: $spacing-base-tight; // 垂直布局表单组顶部内边距
|
|
8
8
|
$spacing-form_field_group_vertical-paddingBottom: $spacing-base-tight; // 垂直布局表单组底部内边距
|
|
9
9
|
|
|
10
|
-
// form label
|
|
11
10
|
$spacing-form_label-paddingRight: $spacing-base; // 表单项标签右侧边距(水平布局)
|
|
12
11
|
$spacing-form_label-paddingTop: ($height-control-default - 20px) * 0.5; // 表单项标签顶部内边距(水平布局)
|
|
13
12
|
$spacing-form_label-marginBottom: $spacing-extra-tight; // 表单项标签底部外边距
|
|
@@ -36,13 +35,11 @@ $color-form_label_extra-text-default: var(--semi-color-tertiary); // 表单项
|
|
|
36
35
|
$color-form_requiredMark-text-default: var(--semi-color-danger); // 必填标记颜色
|
|
37
36
|
$font-form_requiredMark-fontWeight: $font-weight-bold; // 表单必填标识字重
|
|
38
37
|
|
|
39
|
-
// form errormessage
|
|
40
38
|
$color-form_message_error-text-default: var(--semi-color-danger); // 错误提示颜色
|
|
41
39
|
$color-form_alertIcon-icon-default: var(--semi-color-warning); // 警告图标颜色
|
|
42
40
|
$spacing-form_statusIcon-marginRight: $spacing-extra-tight; // 表单校验状态图标右侧外边距
|
|
43
41
|
$spacing-form_message-marginTop: $spacing-extra-tight; // 表单错误信息、辅助文字顶部外边距
|
|
44
42
|
|
|
45
|
-
// form section
|
|
46
43
|
$color-form_section-text-default: var(--semi-color-text-0); // 表单分组标题文字颜色
|
|
47
44
|
$color-form_section-border-default: var(--semi-color-border); // 表单分组标题底部描边颜色
|
|
48
45
|
$width-form_section-border: $border-thickness-control; // 表单分组标题底部描边宽度
|
package/dist/grid/variables.scss
CHANGED
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
@use 'semi:theme' as *;
|
|
2
|
-
// Media queries breakpoints
|
|
3
|
-
// Extra small screen / phone
|
|
4
2
|
|
|
5
|
-
// Small screen / tablet
|
|
6
3
|
$width-grid_screen-sm: 576px; // 小尺寸设备 - 平板
|
|
7
4
|
$width-grid_screen-sm-min: $width-grid_screen-sm;
|
|
8
5
|
|
|
9
|
-
// Medium screen / desktop
|
|
10
6
|
$width-grid_screen-md: 768px; // 中尺寸设备 - 水平平板
|
|
11
7
|
$width-grid_screen-md-min: $width-grid_screen-md;
|
|
12
8
|
|
|
13
|
-
// Large screen / wide desktop
|
|
14
9
|
$width-grid_screen-lg: 992px; // 大尺寸设备 - 小尺寸桌面端
|
|
15
10
|
$width-grid_screen-lg-min: $width-grid_screen-lg;
|
|
16
11
|
|
|
17
|
-
// Extra large screen / full hd
|
|
18
12
|
$width-grid_screen-xl: 1200px; // 超大尺寸设备 - 桌面端
|
|
19
13
|
$width-grid_screen-xl-min: $width-grid_screen-xl;
|
|
20
14
|
|
|
21
|
-
// Extra extra large screen / large desktop
|
|
22
15
|
$width-grid_screen-xxl: 1600px; // 超大尺寸设备 - 桌面端 HD
|
|
23
16
|
$width-grid_screen-xxl-min: $width-grid_screen-xxl;
|
|
24
17
|
|
|
25
|
-
// provide a maximum
|
|
26
|
-
|
|
27
|
-
// Grid system
|
|
28
18
|
$width-grid_columns: 24; // 栅格宽度
|
|
29
19
|
$width-grid_gutter: 0; // 槽宽度
|
|
@@ -50,8 +50,6 @@ export type SearchWords = SearchWord[];
|
|
|
50
50
|
{ start: 7, end: 13, highlight: true },
|
|
51
51
|
{ start: 13, end: 17, highlight: false },
|
|
52
52
|
]
|
|
53
|
-
|
|
54
|
-
* @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean })
|
|
55
53
|
*/
|
|
56
54
|
export declare function findAll({ autoEscape, caseSensitive, searchWords, sourceString }: Omit<ChunkQuery, 'searchWords'> & {
|
|
57
55
|
searchWords: string | SearchWords;
|
|
@@ -93,8 +93,6 @@ findAll ['do', 'dollar'], 'aaa do dollar aaa'
|
|
|
93
93
|
{ start: 7, end: 13, highlight: true },
|
|
94
94
|
{ start: 13, end: 17, highlight: false },
|
|
95
95
|
]
|
|
96
|
-
|
|
97
|
-
* @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean })
|
|
98
96
|
*/
|
|
99
97
|
function findAll({ autoEscape = true, caseSensitive = false, searchWords, sourceString }) {
|
|
100
98
|
return fillInChunks({
|
|
@@ -2,7 +2,6 @@ import BaseFoundation, { DefaultAdapter } from "../base/foundation.js";
|
|
|
2
2
|
export interface HotKeysAdapter<P extends HotKeysBaseProps = HotKeysBaseProps, S extends object = object> extends DefaultAdapter<P, S> {
|
|
3
3
|
notifyHotKey: (e: KeyboardEvent) => void;
|
|
4
4
|
}
|
|
5
|
-
/** The props the foundation reads with getProps */
|
|
6
5
|
export interface HotKeysBaseProps {
|
|
7
6
|
hotKeys: KeyboardEvent['key'][];
|
|
8
7
|
preventDefault?: boolean;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation.js";
|
|
2
2
|
export type ImageLoadStatus = 'loading' | 'success' | 'error';
|
|
3
|
-
/** The props the foundation reads */
|
|
4
3
|
export interface ImageBaseProps {
|
|
5
4
|
preview?: boolean | {
|
|
6
5
|
visible?: boolean;
|
|
@@ -9,7 +8,6 @@ export interface ImageBaseProps {
|
|
|
9
8
|
export interface ImageBaseState {}
|
|
10
9
|
export interface ImageAdapter<P extends ImageBaseProps = ImageBaseProps, S extends ImageBaseState = ImageBaseState> extends DefaultAdapter<P, S> {
|
|
11
10
|
getIsInGroup: () => boolean;
|
|
12
|
-
/** Opens the group preview at this image */
|
|
13
11
|
openGroupPreview: () => void;
|
|
14
12
|
setLoadStatus: (status: ImageLoadStatus) => void;
|
|
15
13
|
setPreviewVisible: (visible: boolean) => void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation.js";
|
|
2
2
|
import { RatioType, RotateDirection } from "./preview-inner-foundation.js";
|
|
3
3
|
import { ThrottledFunction } from "es-toolkit";
|
|
4
|
-
/** The props the foundation reads */
|
|
5
4
|
export interface PreviewFooterBaseProps {
|
|
6
5
|
zoom?: number;
|
|
7
6
|
step?: number;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation.js";
|
|
2
|
-
/** An Image registered with its group */
|
|
3
2
|
export interface PreviewGroupImage {
|
|
4
3
|
/** The thumbnail element: the group lists its images in document order */
|
|
5
4
|
node: Element;
|
|
6
|
-
/** The thumbnail src */
|
|
7
5
|
src: string;
|
|
8
6
|
/** The srcs the image adds to the group preview; undefined when the image does not open the group preview */
|
|
9
7
|
previewSrc?: string | string[];
|
|
10
8
|
title?: unknown;
|
|
11
9
|
alt?: string;
|
|
12
10
|
}
|
|
13
|
-
/** The props the foundation reads */
|
|
14
11
|
export interface PreviewBaseProps {
|
|
15
12
|
src?: string | string[];
|
|
16
13
|
visible?: boolean;
|
|
@@ -32,7 +32,6 @@ export interface PreviewInnerAdapter<P extends PreviewInnerBaseProps = PreviewIn
|
|
|
32
32
|
isEventInPreview: (e: KeyboardEvent) => boolean;
|
|
33
33
|
setRatio: (ratio: RatioType) => void;
|
|
34
34
|
}
|
|
35
|
-
/** The props the foundation reads with getProp */
|
|
36
35
|
export interface PreviewInnerBaseProps {
|
|
37
36
|
closeOnEsc?: boolean;
|
|
38
37
|
src?: string | string[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isComposing } from "../utils/key-code.js";
|
|
2
2
|
import TextEntryFoundation, { TextEntryAdapter, TextEntryBaseProps, TextEntryBaseState } from "./text-entry-foundation.js";
|
|
3
|
-
/** The props the foundation reads with getProps */
|
|
4
3
|
export interface InputBaseProps extends TextEntryBaseProps {
|
|
5
4
|
disabled?: boolean;
|
|
6
5
|
autoFocus?: boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation.js";
|
|
2
|
-
/** The props the shared text entry logic reads with getProps */
|
|
3
2
|
export interface TextEntryBaseProps {
|
|
4
3
|
value?: string | number;
|
|
5
4
|
composition?: boolean;
|
|
@@ -30,7 +29,6 @@ export interface TextEntryAdapter<P extends TextEntryBaseProps, S extends TextEn
|
|
|
30
29
|
*/
|
|
31
30
|
export default class TextEntryFoundation<A extends TextEntryAdapter<P, S, CE>, P extends TextEntryBaseProps, S extends TextEntryBaseState, CE = unknown> extends BaseFoundation<A, P, S> {
|
|
32
31
|
#private;
|
|
33
|
-
/** Whether an IME composition started since the element last took the focus */
|
|
34
32
|
protected get composedSinceFocus(): boolean;
|
|
35
33
|
protected getNextValue(value: string): string;
|
|
36
34
|
protected changeValue(value: string, e: unknown): void;
|
|
@@ -8,7 +8,6 @@ import truncateValue from "./util/truncate-value.js";
|
|
|
8
8
|
var TextEntryFoundation = class TextEntryFoundation extends BaseFoundation {
|
|
9
9
|
#compositionEnter = false;
|
|
10
10
|
#composedSinceFocus = false;
|
|
11
|
-
/** Whether an IME composition started since the element last took the focus */
|
|
12
11
|
get composedSinceFocus() {
|
|
13
12
|
return this.#composedSinceFocus;
|
|
14
13
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isComposing } from "../utils/key-code.js";
|
|
2
2
|
import TextEntryFoundation, { TextEntryAdapter, TextEntryBaseProps, TextEntryBaseState } from "./text-entry-foundation.js";
|
|
3
|
-
/** The props the foundation reads with getProps */
|
|
4
3
|
export interface TextAreaBaseProps extends TextEntryBaseProps {
|
|
5
4
|
value?: string;
|
|
6
5
|
disabled?: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** Records the text after the caret, so the caret can follow it when a change reformats the value */
|
|
2
1
|
export declare function recordCaretTail(input: HTMLInputElement | null): string | undefined;
|
|
3
2
|
/** Puts the caret in front of the longest suffix of the recorded tail that still ends the value */
|
|
4
3
|
export declare function restoreCaretTail(input: HTMLInputElement | null, tail?: string): void;
|
|
@@ -4,7 +4,6 @@ export interface ScientificNotationConfig {
|
|
|
4
4
|
/** Number of digits threshold to trigger scientific notation display */
|
|
5
5
|
threshold?: number;
|
|
6
6
|
}
|
|
7
|
-
/** The props the foundation reads with getProps */
|
|
8
7
|
export interface InputNumberBaseProps {
|
|
9
8
|
value?: number | string;
|
|
10
9
|
defaultValue?: number | string;
|
|
@@ -50,7 +49,6 @@ export interface InputNumberAdapter<P extends InputNumberBaseProps = InputNumber
|
|
|
50
49
|
notifyUpClick: (value: string, e: any) => void;
|
|
51
50
|
notifyDownClick: (value: string, e: any) => void;
|
|
52
51
|
notifyKeyDown: (e: KE) => void;
|
|
53
|
-
/** The native input */
|
|
54
52
|
getInput: () => HTMLInputElement | null;
|
|
55
53
|
}
|
|
56
54
|
export interface BaseInputNumberState {
|
|
@@ -74,9 +72,6 @@ export default class InputNumberFoundation<P extends InputNumberBaseProps = Inpu
|
|
|
74
72
|
protected doParse(value: string | number, needCheckPrec?: boolean, needAdjustPrec?: boolean, needAdjustMaxMin?: boolean): number;
|
|
75
73
|
protected afterParser(value: string | number): string;
|
|
76
74
|
protected toNumber(value: number | string, needAdjustPrec?: boolean): number;
|
|
77
|
-
/**
|
|
78
|
-
* True for a number within [min, max] whose decimal length is at most `precision` (when `needCheckPrec`).
|
|
79
|
-
*/
|
|
80
75
|
protected isValidNumber(num: number, needCheckPrec?: boolean): boolean;
|
|
81
76
|
/** ARIA takes a plain decimal, so 1.2e-7 is written out in full; an empty or infinite number has none */
|
|
82
77
|
static getAriaValueNow(number?: number | null): string | undefined;
|
|
@@ -22,7 +22,6 @@ var InputNumberFoundation = class InputNumberFoundation extends BaseFoundation {
|
|
|
22
22
|
#recordCaret() {
|
|
23
23
|
this.#caretTail = recordCaretTail(this.adapter.getInput());
|
|
24
24
|
}
|
|
25
|
-
/** Puts the caret back in front of the text that followed it before the last change */
|
|
26
25
|
#restoreCaret() {
|
|
27
26
|
restoreCaretTail(this.adapter.getInput(), this.#caretTail);
|
|
28
27
|
}
|
|
@@ -34,7 +33,6 @@ var InputNumberFoundation = class InputNumberFoundation extends BaseFoundation {
|
|
|
34
33
|
const { currency } = this.getProps();
|
|
35
34
|
return typeof currency === "string" ? currency : this.getProp("defaultCurrency");
|
|
36
35
|
}
|
|
37
|
-
/** Commits the formatted text a step produced */
|
|
38
36
|
#commitStep(v = "", event = null, updateCb = null) {
|
|
39
37
|
const parsed = this.doParse(v, false);
|
|
40
38
|
const isValidNumber = !isNaN(parsed);
|
|
@@ -335,9 +333,6 @@ var InputNumberFoundation = class InputNumberFoundation extends BaseFoundation {
|
|
|
335
333
|
}
|
|
336
334
|
return Number(value);
|
|
337
335
|
}
|
|
338
|
-
/**
|
|
339
|
-
* True for a number within [min, max] whose decimal length is at most `precision` (when `needCheckPrec`).
|
|
340
|
-
*/
|
|
341
336
|
isValidNumber(num, needCheckPrec = true) {
|
|
342
337
|
if (typeof num === "number" && !isNaN(num)) {
|
|
343
338
|
const { min, max, precision } = this.getProps();
|
|
@@ -6,7 +6,6 @@ export interface SearchOptions {
|
|
|
6
6
|
wholeWord: boolean;
|
|
7
7
|
regex: boolean;
|
|
8
8
|
}
|
|
9
|
-
/** The props the foundation reads with getProps */
|
|
10
9
|
export interface JsonViewerBaseProps {
|
|
11
10
|
value: string;
|
|
12
11
|
options?: JsonViewerOptions;
|
|
@@ -33,7 +32,6 @@ export default class JsonViewerFoundation<P extends JsonViewerBaseProps = JsonVi
|
|
|
33
32
|
nextSearch: (step?: number) => void;
|
|
34
33
|
replace: (replaceText: string) => void;
|
|
35
34
|
replaceAll: (replaceText: string) => void;
|
|
36
|
-
/** Toggles one search option, then searches again with the input text and the new options */
|
|
37
35
|
toggleSearchOption: (key: keyof SearchOptions) => void;
|
|
38
36
|
toggleSearchBar: () => void;
|
|
39
37
|
/** `null` when nothing was searched (or the bar was closed), `undefined` while there is no editor */
|
|
@@ -106,7 +106,6 @@ var JsonViewerFoundation = class extends BaseFoundation {
|
|
|
106
106
|
if (this.getProps().options?.readOnly) return;
|
|
107
107
|
this.jsonViewer?.getSearchWidget().replaceAll(replaceText);
|
|
108
108
|
};
|
|
109
|
-
/** Toggles one search option, then searches again with the input text and the new options */
|
|
110
109
|
toggleSearchOption = (key) => {
|
|
111
110
|
this.adapter.toggleSearchOption(key);
|
|
112
111
|
this.search(this.#lastSearch?.text ?? "");
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { Locale as Locale$1 } from "date-fns";
|
|
2
|
-
/** Keys of `Locale` that hold a component's strings */
|
|
3
2
|
export type LocaleComponentName = Exclude<keyof Locale, 'code' | 'dateFnsLocale' | 'currency'>;
|
|
4
3
|
export interface LocaleResult<T> {
|
|
5
|
-
/** `locale[componentName]`: the component's own strings */
|
|
6
4
|
locale: T;
|
|
7
5
|
localeCode: string;
|
|
8
|
-
/** For formatting dates in the locale's language, e.g. `format(date, 'EEEE', { locale: dateFnsLocale })` */
|
|
9
6
|
dateFnsLocale: Locale$1;
|
|
10
7
|
currency: string;
|
|
11
8
|
}
|