@fibrae/semi-ui-svelte 0.9.1 → 0.10.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.md +8 -4
- package/README.zh-CN.md +8 -4
- package/dist/components/anchor/interface.d.ts +14 -0
- package/dist/components/audio-player/interface.d.ts +5 -0
- package/dist/components/auto-complete/interface.d.ts +29 -0
- package/dist/components/avatar/interface.d.ts +24 -0
- package/dist/components/backtop/interface.d.ts +2 -0
- package/dist/components/badge/interface.d.ts +7 -0
- package/dist/components/banner/interface.d.ts +7 -0
- package/dist/components/breadcrumb/interface.d.ts +10 -0
- package/dist/components/button/interface.d.ts +18 -0
- package/dist/components/calendar/interface.d.ts +16 -0
- package/dist/components/card/interface.d.ts +18 -0
- package/dist/components/carousel/interface.d.ts +16 -0
- package/dist/components/cascader/interface.d.ts +57 -0
- package/dist/components/checkbox/interface.d.ts +19 -0
- package/dist/components/code-highlight/interface.d.ts +3 -0
- package/dist/components/collapse/interface.d.ts +16 -0
- package/dist/components/collapsible/interface.d.ts +10 -0
- package/dist/components/color-picker/interface.d.ts +10 -0
- package/dist/components/config-provider/interface.d.ts +7 -0
- package/dist/components/cropper/interface.d.ts +11 -0
- package/dist/components/date-picker/interface.d.ts +47 -0
- package/dist/components/descriptions/interface.d.ts +6 -0
- package/dist/components/divider/interface.d.ts +4 -0
- package/dist/components/dropdown/interface.d.ts +8 -0
- package/dist/components/empty/interface.d.ts +7 -0
- package/dist/components/feedback/interface.d.ts +16 -0
- package/dist/components/float-button/interface.d.ts +14 -0
- package/dist/components/form/interface.d.ts +47 -0
- package/dist/components/grid/interface.d.ts +13 -0
- package/dist/components/highlight/interface.d.ts +7 -0
- package/dist/components/hot-keys/interface.d.ts +3 -0
- package/dist/components/image/interface.d.ts +59 -0
- package/dist/components/input/interface.d.ts +67 -0
- package/dist/components/input-number/interface.d.ts +24 -0
- package/dist/components/json-viewer/interface.d.ts +7 -0
- package/dist/components/layout/interface.d.ts +3 -0
- package/dist/components/list/interface.d.ts +18 -0
- package/dist/components/locale/interface.d.ts +4 -0
- package/dist/components/lottie/interface.d.ts +2 -0
- package/dist/components/markdown-render/interface.d.ts +5 -0
- package/dist/components/modal/interface.d.ts +29 -0
- package/dist/components/navigation/interface.d.ts +47 -0
- package/dist/components/overflow-list/interface.d.ts +11 -0
- package/dist/components/pagination/interface.d.ts +12 -0
- package/dist/components/pincode/interface.d.ts +8 -0
- package/dist/components/popconfirm/interface.d.ts +12 -0
- package/dist/components/popover/interface.d.ts +30 -0
- package/dist/components/progress/interface.d.ts +13 -0
- package/dist/components/radio/interface.d.ts +22 -0
- package/dist/components/rating/interface.d.ts +12 -0
- package/dist/components/resizable/interface.d.ts +30 -0
- package/dist/components/scroll-list/interface.d.ts +6 -0
- package/dist/components/select/interface.d.ts +63 -0
- package/dist/components/side-sheet/interface.d.ts +19 -0
- package/dist/components/skeleton/interface.d.ts +7 -0
- package/dist/components/slider/interface.d.ts +23 -0
- package/dist/components/space/interface.d.ts +4 -0
- package/dist/components/spin/interface.d.ts +7 -0
- package/dist/components/steps/interface.d.ts +9 -0
- package/dist/components/switch/interface.d.ts +7 -0
- package/dist/components/table/interface.d.ts +48 -0
- package/dist/components/tabs/interface.d.ts +29 -0
- package/dist/components/tag/interface.d.ts +22 -0
- package/dist/components/tag-input/interface.d.ts +29 -0
- package/dist/components/time-picker/interface.d.ts +31 -0
- package/dist/components/timeline/interface.d.ts +5 -0
- package/dist/components/tooltip/interface.d.ts +20 -0
- package/dist/components/transfer/interface.d.ts +18 -0
- package/dist/components/tree/interface.d.ts +45 -0
- package/dist/components/tree-select/interface.d.ts +55 -0
- package/dist/components/typography/interface.d.ts +33 -0
- package/dist/components/upload/interface.d.ts +64 -0
- package/dist/components/user-guide/interface.d.ts +15 -0
- package/dist/components/video-player/interface.d.ts +22 -0
- package/docs/advanced/dark-mode.md +288 -0
- package/docs/basic/button.md +605 -0
- package/docs/basic/divider.md +103 -0
- package/docs/basic/float-button.md +246 -0
- package/docs/basic/grid.md +427 -0
- package/docs/basic/layout.md +459 -0
- package/docs/basic/resizable.md +584 -0
- package/docs/basic/space.md +163 -0
- package/docs/basic/tokens.md +425 -0
- package/docs/basic/typography.md +615 -0
- package/docs/changes-from-semi.md +105 -0
- package/docs/ecosystem/tailwind.md +210 -0
- package/docs/experience/accessibility.md +82 -0
- package/docs/experience/content-guidelines.md +819 -0
- package/docs/experience/internationalization.md +7 -0
- package/docs/feedback/banner.md +198 -0
- package/docs/feedback/feedback.md +294 -0
- package/docs/feedback/notification.md +401 -0
- package/docs/feedback/popconfirm.md +243 -0
- package/docs/feedback/progress.md +389 -0
- package/docs/feedback/skeleton.md +388 -0
- package/docs/feedback/spin.md +172 -0
- package/docs/feedback/toast.md +393 -0
- package/docs/input/auto-complete.md +399 -0
- package/docs/input/cascader.md +1558 -0
- package/docs/input/checkbox.md +408 -0
- package/docs/input/color-picker.md +175 -0
- package/docs/input/date-picker.md +942 -0
- package/docs/input/form.md +2550 -0
- package/docs/input/input-number.md +451 -0
- package/docs/input/input.md +640 -0
- package/docs/input/pincode.md +191 -0
- package/docs/input/radio.md +337 -0
- package/docs/input/rating.md +214 -0
- package/docs/input/select.md +1230 -0
- package/docs/input/slider.md +347 -0
- package/docs/input/switch.md +206 -0
- package/docs/input/tag-input.md +465 -0
- package/docs/input/time-picker.md +358 -0
- package/docs/input/transfer.md +1061 -0
- package/docs/input/tree-select.md +1300 -0
- package/docs/input/upload.md +1811 -0
- package/docs/llms.txt +147 -0
- package/docs/navigation/anchor.md +377 -0
- package/docs/navigation/backtop.md +100 -0
- package/docs/navigation/breadcrumb.md +284 -0
- package/docs/navigation/navigation.md +851 -0
- package/docs/navigation/pagination.md +217 -0
- package/docs/navigation/steps.md +315 -0
- package/docs/navigation/tabs.md +754 -0
- package/docs/navigation/tree.md +1956 -0
- package/docs/other/config-provider.md +599 -0
- package/docs/other/locale.md +353 -0
- package/docs/plus/audio-player.md +155 -0
- package/docs/plus/code-highlight.md +150 -0
- package/docs/plus/drag-move.md +214 -0
- package/docs/plus/hot-keys.md +174 -0
- package/docs/plus/json-viewer.md +392 -0
- package/docs/plus/lottie.md +176 -0
- package/docs/plus/markdown-render.md +240 -0
- package/docs/plus/video-player.md +325 -0
- package/docs/show/avatar.md +475 -0
- package/docs/show/badge.md +276 -0
- package/docs/show/calendar.md +352 -0
- package/docs/show/card.md +485 -0
- package/docs/show/carousel.md +592 -0
- package/docs/show/collapse.md +289 -0
- package/docs/show/collapsible.md +216 -0
- package/docs/show/cropper.md +285 -0
- package/docs/show/descriptions.md +325 -0
- package/docs/show/dropdown.md +466 -0
- package/docs/show/empty.md +225 -0
- package/docs/show/highlight.md +144 -0
- package/docs/show/image.md +433 -0
- package/docs/show/list.md +927 -0
- package/docs/show/modal.md +517 -0
- package/docs/show/overflow-list.md +272 -0
- package/docs/show/popover.md +534 -0
- package/docs/show/scroll-list.md +156 -0
- package/docs/show/side-sheet.md +274 -0
- package/docs/show/table.md +5437 -0
- package/docs/show/tag.md +428 -0
- package/docs/show/timeline.md +277 -0
- package/docs/show/tooltip.md +442 -0
- package/docs/show/user-guide.md +419 -0
- package/docs/start/getting-started.md +234 -0
- package/docs/start/introduction.md +57 -0
- package/docs/start/overview.md +21 -0
- package/package.json +5 -4
|
@@ -8,35 +8,59 @@ export type InputNumberChangeEvent = InputChangeEvent | PointerEvent | KeyboardE
|
|
|
8
8
|
type InputOnlyKeys = 'value' | 'type' | 'mode' | 'getValueLength' | 'showClearIgnoreDisabled' | 'onChange' | 'min' | 'max' | 'step' | 'classNames' | 'styles';
|
|
9
9
|
/** InputNumber's own props plus the Input props it passes on to the Input inside */
|
|
10
10
|
export interface InputNumberProps extends Omit<InputProps, InputOnlyKeys> {
|
|
11
|
+
/** Class names of the inner parts, keyed by input (the native input element); values take any class binding and merge with the built-in classes. */
|
|
11
12
|
classNames?: Partial<Record<InputNumberPart, ClassValue>>;
|
|
13
|
+
/** Style strings of the inner parts, keyed like classNames. */
|
|
12
14
|
styles?: Partial<Record<InputNumberPart, string>>;
|
|
13
15
|
/** Bindable; leave it out for an uncontrolled input. `bind:value={get, set}` makes it fully controlled */
|
|
14
16
|
value?: number | string;
|
|
17
|
+
/** Currency, such as CNY, EUR or USD. When true, uses defaultCurrency, or the currency of the locale pack when that is not set; a bare currency attribute equals true. */
|
|
15
18
|
currency?: boolean | string;
|
|
19
|
+
/** How the currency is shown: symbol, code or name. */
|
|
16
20
|
currencyDisplay?: 'code' | 'symbol' | 'name';
|
|
17
21
|
/** The currency for `currency` set to true; defaults to the locale's */
|
|
18
22
|
defaultCurrency?: string;
|
|
19
23
|
/** Defaults to the locale's code */
|
|
20
24
|
localeCode?: string;
|
|
25
|
+
/** Minimum number of fraction digits shown, passed to Intl.NumberFormat. */
|
|
21
26
|
minimumFractionDigits?: number;
|
|
27
|
+
/** Maximum number of fraction digits shown, passed to Intl.NumberFormat. */
|
|
22
28
|
maximumFractionDigits?: number;
|
|
29
|
+
/** Numerical precision, the number of fraction digits kept. */
|
|
23
30
|
precision?: number;
|
|
31
|
+
/** Shows scientific notation when blurred and the full number when focused. Pass `{ threshold }` to configure the threshold, 15 significant digits by default. Not supported in currency mode. */
|
|
24
32
|
scientificNotation?: boolean | ScientificNotationConfig;
|
|
33
|
+
/** Whether to show the currency symbol, code or name; only in currency mode. */
|
|
25
34
|
showCurrencySymbol?: boolean;
|
|
35
|
+
/** Format of the displayed value, usually set together with parser. Priority: own prop, global default. */
|
|
26
36
|
formatter?: (value: number | string) => string;
|
|
37
|
+
/** Converts the text from formatter back to a number string; used together with formatter. Priority: own prop, global default. */
|
|
27
38
|
parser?: (value: string) => string;
|
|
39
|
+
/** Minimum value. */
|
|
28
40
|
min?: number;
|
|
41
|
+
/** Maximum value. */
|
|
29
42
|
max?: number;
|
|
43
|
+
/** Step of each change; may be a decimal. */
|
|
30
44
|
step?: number;
|
|
45
|
+
/** Step of each change while Shift is held; may be a decimal. */
|
|
31
46
|
shiftStep?: number;
|
|
47
|
+
/** Interval in milliseconds between repeats while a step button is held. */
|
|
32
48
|
pressInterval?: number;
|
|
49
|
+
/** Delay in milliseconds before repeating starts while a step button is held. */
|
|
33
50
|
pressTimeout?: number;
|
|
51
|
+
/** Keeps the input focused when a step button is clicked. */
|
|
34
52
|
keepFocus?: boolean;
|
|
53
|
+
/** Puts the step buttons inside the input, shown on hover or focus and temporarily replacing the suffix. */
|
|
35
54
|
innerButtons?: boolean;
|
|
55
|
+
/** Hides the step buttons; with innerButtons also true, no built-in button is shown either. */
|
|
36
56
|
hideButtons?: boolean;
|
|
57
|
+
/** Called when the value changes. The second argument is the event that caused it: typing, a step button pointerdown, an arrow or Home/End keydown, or blur. Mounting and a new value from the parent do not call it; an out-of-range value is shown as given and is corrected and reported only after a user action. */
|
|
37
58
|
onChange?: (value: number | string, event: InputNumberChangeEvent) => void;
|
|
59
|
+
/** Called when the number changes; the event argument is as in onChange. */
|
|
38
60
|
onNumberChange?: (value: number, event: InputNumberChangeEvent) => void;
|
|
61
|
+
/** Called when pressing the increase button steps the value, once per step while it is held; the arguments are the stepped value and the pointerdown event. */
|
|
39
62
|
onUpClick?: (value: string, event: PointerEvent) => void;
|
|
63
|
+
/** Called when pressing the decrease button steps the value, once per step while it is held; the arguments are the stepped value and the pointerdown event. */
|
|
40
64
|
onDownClick?: (value: string, event: PointerEvent) => void;
|
|
41
65
|
}
|
|
42
66
|
export interface InputNumberState extends BaseInputNumberState {
|
|
@@ -31,17 +31,24 @@ export interface JsonViewerSearchButtonArgs {
|
|
|
31
31
|
export interface JsonViewerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onchange'> {
|
|
32
32
|
/** Bindable; the editor's text. A value different from the editor's current text re-creates the editor */
|
|
33
33
|
value?: string;
|
|
34
|
+
/** Width. A number is taken as px; a string is used as is. */
|
|
34
35
|
width?: number | string;
|
|
36
|
+
/** Height. A number is taken as px; a string is used as is. */
|
|
35
37
|
height?: number | string;
|
|
38
|
+
/** Whether to show the search button. */
|
|
36
39
|
showSearch?: boolean;
|
|
40
|
+
/** Editor options; see JsonViewerOptions for the fields. The defaults of ariaLabel, readOnly and autoWrap merge per key, so passing some fields keeps the defaults of the others. A deep change re-creates the editor; mutating a nested object such as formatOptions or customRenderRule in place goes unnoticed, so replace it with a new object. */
|
|
37
41
|
options?: JsonViewerOptions;
|
|
42
|
+
/** Whether to limit the search button drag bounds within the component container. */
|
|
38
43
|
limitSearchButtonBounds?: boolean;
|
|
44
|
+
/** Called when the content changes, with the editor's current text. */
|
|
39
45
|
onChange?: (value: string) => void;
|
|
40
46
|
/**
|
|
41
47
|
* Replaces the content of a token matched by `options.customRenderRule`. A snippet that draws nothing leaves the
|
|
42
48
|
* token's text in place, decided once when the token is laid out.
|
|
43
49
|
*/
|
|
44
50
|
customRender?: Snippet<[JsonViewerCustomRenderArgs]>;
|
|
51
|
+
/** Replaces the default search button as a whole. defaultButton is the default button's snippet, drawn with `{@render defaultButton()}`; the other arguments build a custom search UI. Not rendered when showSearch is false. */
|
|
45
52
|
searchButton?: Snippet<[JsonViewerSearchButtonArgs]>;
|
|
46
53
|
}
|
|
47
54
|
export interface JsonViewerHandle {
|
|
@@ -2,16 +2,19 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
2
2
|
import type { ResponsiveMap } from '@fibrae/semi-foundation/components/grid/constants';
|
|
3
3
|
export type { ResponsiveMap };
|
|
4
4
|
export interface LayoutProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Tag name of the root element. */
|
|
5
6
|
tagName?: keyof HTMLElementTagNameMap;
|
|
6
7
|
/** Forces the has-sider class, for server rendering where a nested Sider has not registered yet */
|
|
7
8
|
hasSider?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export interface LayoutBasicProps extends HTMLAttributes<HTMLElement> {
|
|
11
|
+
/** Tag name of the root element. */
|
|
10
12
|
tagName?: keyof HTMLElementTagNameMap;
|
|
11
13
|
}
|
|
12
14
|
export interface SiderProps extends HTMLAttributes<HTMLElement> {
|
|
13
15
|
/**Breakpoints reported through `onBreakpoint`; read once at mount */
|
|
14
16
|
breakpoint?: Array<keyof ResponsiveMap>;
|
|
17
|
+
/** Called once at mount for each screen listed in breakpoint with the current viewport state, then whenever it starts or stops matching, with the screen name and whether it matches. */
|
|
15
18
|
onBreakpoint?: (screen: keyof ResponsiveMap, match: boolean) => void;
|
|
16
19
|
}
|
|
17
20
|
export interface LayoutContextValue {
|
|
@@ -13,28 +13,46 @@ export interface ListItemSnippetProps<T> {
|
|
|
13
13
|
* left out; their presence turns an item into a button.
|
|
14
14
|
*/
|
|
15
15
|
export interface ListProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, 'onclick' | 'oncontextmenu'> {
|
|
16
|
+
/** Whether to show a border. */
|
|
16
17
|
bordered?: boolean;
|
|
18
|
+
/** Data source of the list; each entry is rendered through the item snippet. */
|
|
17
19
|
dataSource?: T[];
|
|
20
|
+
/** Grid configuration: align, gutter and justify of Row, and span, offset, order, push, pull, the responsive breakpoints, class and style of Col. class and style land on the Col around each item. */
|
|
18
21
|
grid?: Grid;
|
|
22
|
+
/** List layout: vertical or horizontal. */
|
|
19
23
|
layout?: 'vertical' | 'horizontal';
|
|
24
|
+
/** Whether the list is loading; a Spin is shown when true. */
|
|
20
25
|
loading?: boolean;
|
|
26
|
+
/** List size: small, default or large. */
|
|
21
27
|
size?: Size;
|
|
28
|
+
/** Whether to show dividers between items. */
|
|
22
29
|
split?: boolean;
|
|
30
|
+
/** Click handler for the items that have no onClick of their own; an item with a handler renders a native button. It is a function prop rather than the native onclick because its presence decides whether an item renders a button. */
|
|
23
31
|
onClick?: (event: MouseEvent) => void;
|
|
32
|
+
/** Context-menu handler for the items that have no onRightClick of their own; those items also render a native button. */
|
|
24
33
|
onRightClick?: (event: MouseEvent) => void;
|
|
34
|
+
/** Snippet that renders each entry of dataSource, receiving `{ item, index }` and usually returning a ListItem. */
|
|
25
35
|
item?: Snippet<[ListItemSnippetProps<T>]>;
|
|
36
|
+
/** Snippet for the list header. */
|
|
26
37
|
header?: Snippet;
|
|
38
|
+
/** Snippet for the list footer. */
|
|
27
39
|
footer?: Snippet;
|
|
40
|
+
/** Snippet for the content shown when there is no data; the locale's empty text by default. A list with content inside its tag (children) is never empty. */
|
|
28
41
|
emptyContent?: Snippet;
|
|
42
|
+
/** Snippet for the load-more button. */
|
|
29
43
|
loadMore?: Snippet;
|
|
30
44
|
}
|
|
31
45
|
export interface ListItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'onclick' | 'oncontextmenu'> {
|
|
46
|
+
/** Vertical alignment of header and main: flex-start, flex-end, center, baseline or stretch; flex-start when omitted. */
|
|
32
47
|
align?: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
|
|
33
48
|
/** Takes precedence over the List's `onClick` */
|
|
34
49
|
onClick?: (event: MouseEvent) => void;
|
|
35
50
|
/** Takes precedence over the List's `onRightClick` */
|
|
36
51
|
onRightClick?: (event: MouseEvent) => void;
|
|
52
|
+
/** Snippet for the item header content. */
|
|
37
53
|
header?: Snippet;
|
|
54
|
+
/** Snippet for the item main content. */
|
|
38
55
|
main?: Snippet;
|
|
56
|
+
/** Snippet for additional item content, rendered outside the button; interactive elements in it stay focusable and clickable, and clicking them does not trigger the row's click. */
|
|
39
57
|
extra?: Snippet;
|
|
40
58
|
}
|
|
@@ -2,10 +2,14 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { Locale, LocaleComponentName, LocaleInput, LocaleResult } from '@fibrae/semi-foundation/locale';
|
|
3
3
|
export type { LocaleComponentName, LocaleResult };
|
|
4
4
|
export interface LocaleProviderProps {
|
|
5
|
+
/** Locale pack. When omitted, undefined or null, the language of the outer LocaleProvider is inherited; without any outer provider, components fall back to zh_CN. The locale of ConfigProvider takes precedence over it. Takes the built-in zh_CN or en_US, or a custom pack with at least code, whose missing text and currency fall back to en_US. */
|
|
5
6
|
locale?: LocaleInput | null;
|
|
7
|
+
/** Subtree that uses the locale pack. */
|
|
6
8
|
children?: Snippet;
|
|
7
9
|
}
|
|
8
10
|
export interface LocaleConsumerProps<K extends LocaleComponentName> {
|
|
11
|
+
/** Namespace of the locale pack to read, such as TimePicker. Only component names declared in Locale are accepted; extend Locale by declaration merging for custom namespaces. */
|
|
9
12
|
componentName: K;
|
|
13
|
+
/** Snippet receiving `{ locale, localeCode, currency }`, where locale is the text of componentName. */
|
|
10
14
|
children: Snippet<[result: LocaleResult<Locale[K]>]>;
|
|
11
15
|
}
|
|
@@ -10,7 +10,9 @@ export interface LottieModule extends ModuleSource {
|
|
|
10
10
|
export interface LottieProps extends HTMLAttributes<HTMLDivElement> {
|
|
11
11
|
/** It reloads when its content changes. */
|
|
12
12
|
params: LottieParams;
|
|
13
|
+
/** Container width, with a unit such as 300px. */
|
|
13
14
|
width?: string;
|
|
15
|
+
/** Container height, with a unit such as 300px. */
|
|
14
16
|
height?: string;
|
|
15
17
|
/** Once per animation created, including every reload */
|
|
16
18
|
getAnimationInstance?: (animation: LottieAnimation) => void;
|
|
@@ -16,11 +16,16 @@ export interface MarkdownRenderElementProps {
|
|
|
16
16
|
node?: MarkdownNode;
|
|
17
17
|
}
|
|
18
18
|
export interface MarkdownRenderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
19
|
+
/** Markdown or MDX source text. Compiles again on change. */
|
|
19
20
|
raw: string;
|
|
20
21
|
/** Merged over `MarkdownRender.defaultComponents`; a change only renders again, it does not compile again */
|
|
21
22
|
components?: MarkdownRenderComponents;
|
|
23
|
+
/** Format of raw: md is plain Markdown, mdx allows embedded JSX. Compiles again on change. */
|
|
22
24
|
format?: 'md' | 'mdx';
|
|
25
|
+
/** Custom Remark plugins. Compiles again when an entry changes. */
|
|
23
26
|
remarkPlugins?: MarkdownRenderBaseProps['remarkPlugins'];
|
|
27
|
+
/** Custom Rehype plugins. Compiles again when an entry changes. */
|
|
24
28
|
rehypePlugins?: MarkdownRenderBaseProps['rehypePlugins'];
|
|
29
|
+
/** Whether to enable GitHub GFM syntax. Compiles again on change. */
|
|
25
30
|
remarkGfm?: boolean;
|
|
26
31
|
}
|
|
@@ -21,38 +21,63 @@ export interface ModalHandle {
|
|
|
21
21
|
export interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
22
22
|
/** Called once the dialog has closed and its leave animation has ended, or when it unmounts while shown. */
|
|
23
23
|
afterClose?: () => void;
|
|
24
|
+
/** Props of the cancel button. autoFocus focuses it on open; class and style land on the button; onclick runs before the built-in cancel handling, which still runs. */
|
|
24
25
|
cancelButtonProps?: ModalButtonProps;
|
|
25
26
|
/** undefined: loading follows the Promise returned by onCancel */
|
|
26
27
|
cancelLoading?: boolean;
|
|
28
|
+
/** Cancel button text. Defaults to the locale entry Modal.cancel. */
|
|
27
29
|
cancelText?: string;
|
|
30
|
+
/** Whether the dialog is vertically centered. */
|
|
28
31
|
centered?: boolean;
|
|
29
32
|
/** Merged after the built-in class names of the part's element; replaces the global default as a whole */
|
|
30
33
|
classNames?: Partial<Record<ModalPart, ClassValue>>;
|
|
34
|
+
/** Whether the close button in the corner is shown. */
|
|
31
35
|
closable?: boolean;
|
|
36
|
+
/** Whether Esc cancels the dialog. */
|
|
32
37
|
closeOnEsc?: boolean;
|
|
33
38
|
/** undefined: loading follows the Promise returned by onOk */
|
|
34
39
|
confirmLoading?: boolean;
|
|
40
|
+
/** Whether the two buttons of the default footer fill the row. */
|
|
35
41
|
footerFill?: boolean;
|
|
42
|
+
/** Whether the dialog fills the screen. width and height are ignored. */
|
|
36
43
|
fullScreen?: boolean;
|
|
44
|
+
/** Parent element the dialog is rendered into. A custom container needs position: relative; this changes where the dialog sits in the DOM, not where it is shown. */
|
|
37
45
|
getPopupContainer?: () => HTMLElement;
|
|
46
|
+
/** Whether the default footer shows the cancel button. */
|
|
38
47
|
hasCancel?: boolean;
|
|
48
|
+
/** Height of the dialog. A number is in pixels; a string is any valid CSS length. */
|
|
39
49
|
height?: string | number;
|
|
50
|
+
/** Whether the dialog content stays mounted while closed. */
|
|
40
51
|
keepDOM?: boolean;
|
|
52
|
+
/** Used with keepDOM. When true, the dialog is not rendered until it is first shown. */
|
|
41
53
|
lazyRender?: boolean;
|
|
54
|
+
/** Whether the mask is shown. */
|
|
42
55
|
mask?: boolean;
|
|
56
|
+
/** Whether a click on the mask cancels the dialog. */
|
|
43
57
|
maskClosable?: boolean;
|
|
58
|
+
/** Whether a mask confined to a custom container still covers the viewport with fixed positioning and is treated as modal (aria-modal, inert page, Tab lock, body scroll lock). */
|
|
44
59
|
maskFixed?: boolean;
|
|
60
|
+
/** Class name of the dialog content element. */
|
|
45
61
|
modalContentClass?: string;
|
|
62
|
+
/** Whether the enter and leave animations run. */
|
|
46
63
|
motion?: boolean;
|
|
64
|
+
/** Props of the ok button. autoFocus focuses it on open; class and style land on the button; onclick runs before the built-in ok handling, which still runs. */
|
|
47
65
|
okButtonProps?: ModalButtonProps;
|
|
66
|
+
/** Ok button text. Defaults to the locale entry Modal.confirm. */
|
|
48
67
|
okText?: string;
|
|
68
|
+
/** Type of the ok button. */
|
|
49
69
|
okType?: OKType;
|
|
70
|
+
/** Whether the focus calls made by the component avoid scrolling the focused element into view. Focus calls made by the caller are not affected. */
|
|
50
71
|
preventScroll?: boolean;
|
|
72
|
+
/** Width preset of the dialog: small is 448px, medium 684px, large 920px, full-width 100vw - 64px. */
|
|
51
73
|
size?: Size;
|
|
74
|
+
/** Inline styles of the inner parts, keyed like classNames; every value is a style string. */
|
|
52
75
|
styles?: Partial<Record<ModalPart, string>>;
|
|
53
76
|
/** Bindable. Cancel, close button, mask click and Escape write `false` once `onCancel` returns (or its Promise fulfills). */
|
|
54
77
|
visible?: boolean;
|
|
78
|
+
/** Width of the dialog. A number is in pixels; a string is any valid CSS length. When omitted, size decides. */
|
|
55
79
|
width?: string | number;
|
|
80
|
+
/** z-index of the outer layer. */
|
|
56
81
|
zIndex?: number;
|
|
57
82
|
/**
|
|
58
83
|
* Cancel button, close button, mask click and Escape (a native KeyboardEvent). A returned Promise keeps the button
|
|
@@ -61,17 +86,21 @@ export interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'
|
|
|
61
86
|
onCancel?: (event: MouseEvent | KeyboardEvent) => unknown;
|
|
62
87
|
/** A returned Promise keeps the ok button loading until it settles; closing is the caller's job. */
|
|
63
88
|
onOk?: (event: MouseEvent) => unknown;
|
|
89
|
+
/** Title, plain text or a snippet, which also names the dialog. It is a declared prop, so it never lands on an element as the native title attribute. */
|
|
64
90
|
title?: string | Snippet;
|
|
65
91
|
/** A snippet replaces the default header (title, icon, close button); null renders no header. */
|
|
66
92
|
header?: Snippet | null;
|
|
67
93
|
/** A snippet replaces the default buttons; null renders no footer area. */
|
|
68
94
|
footer?: Snippet | null;
|
|
95
|
+
/** Snippet for the icon before the title. */
|
|
69
96
|
icon?: Snippet;
|
|
97
|
+
/** Snippet for the icon inside the close button. */
|
|
70
98
|
closeIcon?: Snippet;
|
|
71
99
|
/** `modal` is the role="dialog" element; place it with `{@render modal()}`. */
|
|
72
100
|
modal?: Snippet<[{
|
|
73
101
|
modal: Snippet;
|
|
74
102
|
}]>;
|
|
103
|
+
/** role of the dialog element: dialog or alertdialog. */
|
|
75
104
|
role?: 'dialog' | 'alertdialog';
|
|
76
105
|
}
|
|
77
106
|
export type ModalNode = string | Snippet;
|
|
@@ -20,22 +20,31 @@ interface EntryAttributes extends DataAttributes, AriaAttributes {
|
|
|
20
20
|
}
|
|
21
21
|
export type NavLinkOptions = HTMLAnchorAttributes;
|
|
22
22
|
export interface NavItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'> {
|
|
23
|
+
/** Whether the item is disabled. */
|
|
23
24
|
disabled?: boolean;
|
|
25
|
+
/** Whether to keep the icon's space when there is no icon. Applies to the first level only. */
|
|
24
26
|
indent?: boolean;
|
|
25
27
|
/** Or'ed with the collapsed state of the Nav */
|
|
26
28
|
isCollapsed?: boolean;
|
|
29
|
+
/** Unique key of the item. */
|
|
27
30
|
itemKey?: ItemKey;
|
|
28
31
|
/** Nesting depth for the indentation of `limitIndent={false}`; the Sub above it provides it, so it only overrides */
|
|
29
32
|
level?: number;
|
|
33
|
+
/** href of the item. When given the item renders as an a element. */
|
|
30
34
|
link?: string;
|
|
35
|
+
/** Attributes passed to the a element. */
|
|
31
36
|
linkOptions?: NavLinkOptions;
|
|
32
37
|
/** The item's text and payload of `onSelect` and `onClick`; `label` replaces what is shown */
|
|
33
38
|
text?: string | number;
|
|
39
|
+
/** Delay in milliseconds before this item's Tooltip hides. Wins over the same prop of the Nav. */
|
|
34
40
|
tooltipHideDelay?: number;
|
|
41
|
+
/** Delay in milliseconds before this item's Tooltip shows. Wins over the same prop of the Nav. */
|
|
35
42
|
tooltipShowDelay?: number;
|
|
36
43
|
/** Replaces the shown text. Named `label`: `text` is the prop, and a prop and a snippet share one namespace */
|
|
37
44
|
label?: Snippet;
|
|
45
|
+
/** Icon of the item. The parameter holds size. */
|
|
38
46
|
icon?: Snippet<[NavIconArgs]>;
|
|
47
|
+
/** Icon at the toggle position, which Nav's toggleIconPosition decides. The parameter holds size. */
|
|
39
48
|
toggleIcon?: Snippet<[NavIconArgs]>;
|
|
40
49
|
/** The item's own click, with the item's data; the native `onclick` still reaches the li */
|
|
41
50
|
onClick?: (data: SelectedData) => void;
|
|
@@ -55,29 +64,43 @@ export interface SelectedData {
|
|
|
55
64
|
}
|
|
56
65
|
export type SubDropdownProps = DropdownProps;
|
|
57
66
|
export interface SubNavProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'> {
|
|
67
|
+
/** Class names of the inner parts, keyed by `dropdown` (the popup content `.semi-dropdown`); merged with the built-in classes. */
|
|
58
68
|
classNames?: Partial<Record<SubNavPart, ClassValue>>;
|
|
69
|
+
/** Whether the sub navigation is disabled. */
|
|
59
70
|
disabled?: boolean;
|
|
71
|
+
/** Props of the popup Dropdown, used in horizontal mode and when collapsed. */
|
|
60
72
|
dropdownProps?: SubDropdownProps;
|
|
73
|
+
/** Whether to keep the icon's space when there is no icon. Applies to the first level only. */
|
|
61
74
|
indent?: boolean;
|
|
75
|
+
/** Unique key of the sub navigation. */
|
|
62
76
|
itemKey?: ItemKey;
|
|
77
|
+
/** Nesting level of the item. Determines the indentation when limitIndent is false. The SubNav above gives it, so this only overrides. */
|
|
63
78
|
level?: number;
|
|
64
79
|
/** `dropdown` wins over the style in dropdownProps */
|
|
65
80
|
styles?: Partial<Record<SubNavPart, string>>;
|
|
66
81
|
/** Applies when dropdownProps is not given */
|
|
67
82
|
subDropdownProps?: SubDropdownProps;
|
|
83
|
+
/** Title text of the sub navigation. The `label` snippet replaces what is shown. */
|
|
68
84
|
text?: string | number;
|
|
85
|
+
/** The `NavItem` and `SubNav` entries of the sub navigation. */
|
|
69
86
|
children?: Snippet;
|
|
70
87
|
/** Replaces the shown text. Named `label`: `text` is the prop, and a prop and a snippet share one namespace */
|
|
71
88
|
label?: Snippet;
|
|
89
|
+
/** Icon of the sub navigation. The parameter holds size. */
|
|
72
90
|
icon?: Snippet<[NavIconArgs]>;
|
|
91
|
+
/** Expand arrow icon. The parameter holds size and the class to put on the icon element. */
|
|
73
92
|
expandIcon?: Snippet<[NavExpandIconArgs]>;
|
|
74
93
|
}
|
|
75
94
|
export interface NavHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
95
|
+
/** href of the header. When given the header content sits inside an a element. */
|
|
76
96
|
link?: string;
|
|
97
|
+
/** Attributes passed to the a element. */
|
|
77
98
|
linkOptions?: NavLinkOptions;
|
|
78
99
|
/** Also names the header link while the Nav is collapsed and the text is hidden; other content goes in children */
|
|
79
100
|
text?: string | number;
|
|
101
|
+
/** Logo. */
|
|
80
102
|
logo?: Snippet;
|
|
103
|
+
/** Other content of the header. */
|
|
81
104
|
children?: Snippet;
|
|
82
105
|
}
|
|
83
106
|
export interface NavFooterProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
@@ -87,6 +110,7 @@ export interface NavFooterProps extends Omit<HTMLAttributes<HTMLDivElement>, 'ch
|
|
|
87
110
|
collapseText?: Snippet<[{
|
|
88
111
|
collapsed: boolean;
|
|
89
112
|
}]>;
|
|
113
|
+
/** Footer content. When present the collapse button does not show. */
|
|
90
114
|
children?: Snippet;
|
|
91
115
|
}
|
|
92
116
|
export interface NavCollapseButtonProps {
|
|
@@ -149,35 +173,58 @@ export interface NavItemRenderProps {
|
|
|
149
173
|
level: number;
|
|
150
174
|
}
|
|
151
175
|
export interface NavProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
176
|
+
/** Class names of the inner parts, keyed by `body` (the navigation item list); merged with the built-in classes. */
|
|
152
177
|
classNames?: Partial<Record<NavPart, ClassValue>>;
|
|
178
|
+
/** Inline style strings of the inner parts, keyed like `classNames`. */
|
|
153
179
|
styles?: Partial<Record<NavPart, string>>;
|
|
154
180
|
/** Applies in vertical mode only; bindable */
|
|
155
181
|
isCollapsed?: boolean;
|
|
182
|
+
/** Navigation item data. Each entry may carry nested items, and a string entry is both the text and the itemKey. Only the props declared by Item and Sub, class, style, onmouseenter, onmouseleave, `data-*` and `aria-*` reach the item; other fields such as path are ignored. Icons, text nodes and arrow icons use the `icon`, `text`, `toggleIcon` and `expandIcon` snippets. */
|
|
156
183
|
items?: NavItems;
|
|
184
|
+
/** Whether to limit indentation. When false, nested items indent by level. Applies only when mode is vertical; horizontal mode always limits indentation. */
|
|
157
185
|
limitIndent?: boolean;
|
|
186
|
+
/** Orientation of the navigation: vertical or horizontal. */
|
|
158
187
|
mode?: Mode;
|
|
159
188
|
/** Bindable; null is a controlled empty value */
|
|
160
189
|
openKeys?: ItemKey[] | null;
|
|
161
190
|
/** Bindable; null is a controlled empty value */
|
|
162
191
|
selectedKeys?: ItemKey[] | null;
|
|
192
|
+
/** Dropdown props for the sub navigations generated from items, used in horizontal mode or when the vertical navigation is collapsed. */
|
|
163
193
|
subDropdownProps?: SubDropdownProps;
|
|
194
|
+
/** Delay in milliseconds before a sub navigation popup closes. Applies when collapsed or horizontal. */
|
|
164
195
|
subNavCloseDelay?: number;
|
|
196
|
+
/** Whether the sub navigation animates when it expands and collapses. */
|
|
165
197
|
subNavMotion?: boolean;
|
|
198
|
+
/** Delay in milliseconds before a sub navigation popup opens. Applies when collapsed or horizontal. */
|
|
166
199
|
subNavOpenDelay?: number;
|
|
200
|
+
/** Position of the arrow of an item with sub navigation: left or right. */
|
|
167
201
|
toggleIconPosition?: 'left' | 'right';
|
|
202
|
+
/** Delay in milliseconds before the Tooltip hides when collapsed. */
|
|
168
203
|
tooltipHideDelay?: number;
|
|
204
|
+
/** Delay in milliseconds before the Tooltip shows when collapsed. */
|
|
169
205
|
tooltipShowDelay?: number;
|
|
206
|
+
/** Header area: a config object (text, link, linkOptions, logo, class, style, and `data-*` and `aria-*` attributes), or a snippet that holds a `NavHeader`. */
|
|
170
207
|
header?: NavHeaderConfig | Snippet;
|
|
208
|
+
/** Footer area: a config object (collapseButton, class, style, and `data-*` and `aria-*` attributes), or a snippet that holds a `NavFooter`. */
|
|
171
209
|
footer?: NavFooterConfig | Snippet;
|
|
210
|
+
/** `NavItem` and `SubNav`, placed after the entries generated from items. */
|
|
172
211
|
children?: Snippet;
|
|
212
|
+
/** Wraps each item. Render the li of the item exactly once with `{@render itemElement()}`. The parameter holds itemElement, isSubNav, isInSubNav and props. */
|
|
173
213
|
wrapper?: Snippet<[NavWrapperArgs]>;
|
|
214
|
+
/** Icon of an entry of items. The parameter holds item, level and size. The icon column always stays; empty content does not remove the icon box. */
|
|
174
215
|
icon?: Snippet<[NavItemRenderProps & NavIconArgs]>;
|
|
175
216
|
/** Without it the entry's text shows */
|
|
176
217
|
text?: Snippet<[NavItemRenderProps]>;
|
|
218
|
+
/** Icon at the toggle position of an entry of items. The parameter holds item, level and size. */
|
|
177
219
|
toggleIcon?: Snippet<[NavItemRenderProps & NavIconArgs]>;
|
|
220
|
+
/** Expand arrow of a sub navigation generated from items. The parameter holds item, level, size and the class to put on the icon element. */
|
|
178
221
|
expandIcon?: Snippet<[NavItemRenderProps & NavExpandIconArgs]>;
|
|
222
|
+
/** Called when any item is clicked. The data carries text for an item, and openKeys and isOpen for a sub navigation title. domEvent is the native event. */
|
|
179
223
|
onClick?: (data: NavClickData) => void;
|
|
224
|
+
/** Called when the collapsed state changes. */
|
|
180
225
|
onCollapseChange?: (isCollapsed: boolean) => void;
|
|
226
|
+
/** Called when a sub navigation opens or closes. domEvent is missing when a popup opens by hover. */
|
|
181
227
|
onOpenChange?: (data: NavOpenChangeData) => void;
|
|
228
|
+
/** Called when a selectable item is selected for the first time. selectedKeys holds only the key of the selected item, and domEvent is the native event. */
|
|
182
229
|
onSelect?: (data: OnSelectedData) => void;
|
|
183
230
|
}
|
|
@@ -16,23 +16,34 @@ export interface OverflowListOverflowSnippetProps<T> {
|
|
|
16
16
|
* `T` stays unconstrained here so the global defaults can be typed for any item; the component itself takes records.
|
|
17
17
|
*/
|
|
18
18
|
export interface OverflowListProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
19
|
+
/** Collapse direction in collapse mode: start or end. */
|
|
19
20
|
collapseFrom?: 'start' | 'end';
|
|
21
|
+
/** The items to render. They are data, not nodes; scroll mode requires a key on each item. */
|
|
20
22
|
items?: T[];
|
|
21
23
|
/** A property path of the item, or a function returning its key; defaults to `key`, then the position */
|
|
22
24
|
itemKey?: OverflowListKey | ((item: T) => OverflowListKey);
|
|
25
|
+
/** Minimum number of visible items in collapse mode. */
|
|
23
26
|
minVisibleItems?: number;
|
|
24
27
|
/** Used by Tabs to put both overflow sides before or after the items; not meant for end users */
|
|
25
28
|
overflowRenderDirection?: 'both' | 'start' | 'end';
|
|
29
|
+
/** Render mode: collapse or scroll. */
|
|
26
30
|
renderMode?: 'collapse' | 'scroll';
|
|
31
|
+
/** Visible ratio at which scroll mode reports an item as overflowing. */
|
|
27
32
|
threshold?: number;
|
|
33
|
+
/** Class names of the inner parts, keyed by `wrapper` (the scroll wrapper in scroll mode); merged with the built-in classes. */
|
|
28
34
|
classNames?: Partial<Record<OverflowListPart, ClassValue>>;
|
|
35
|
+
/** Inline style strings of the inner parts, keyed like `classNames`. */
|
|
29
36
|
styles?: Partial<Record<OverflowListPart, string>>;
|
|
30
37
|
/** Attributes of the scroll-mode wrapper that holds the visible items, such as a role that owns them */
|
|
31
38
|
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
|
32
39
|
/** Scroll mode wraps each item in a `display: contents` element and observes the first element the snippet renders */
|
|
33
40
|
item?: Snippet<[OverflowListItemSnippetProps<T>]>;
|
|
41
|
+
/** Snippet for the overflowing items, with the parameter `{ items, position }`. Collapse mode renders it once, only when there are overflowing items, with the items that do not fit; scroll mode renders it once per side, with position set to start or end and the items scrolled out on that side. */
|
|
34
42
|
overflow?: Snippet<[OverflowListOverflowSnippetProps<T>]>;
|
|
43
|
+
/** Called in collapse mode when the overflowing items change; the argument is an empty array when everything fits. */
|
|
35
44
|
onOverflow?: (overflowItems: T[]) => void;
|
|
45
|
+
/** Called in scroll mode when the intersection state of the items changes. */
|
|
36
46
|
onIntersect?: (res: Record<string, IntersectionObserverEntry>) => void;
|
|
47
|
+
/** Called in scroll mode when the visible or hidden state of the items changes. */
|
|
37
48
|
onVisibleStateChange?: (visibleState: Map<string, boolean>) => void;
|
|
38
49
|
}
|
|
@@ -2,28 +2,40 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
import type { Position } from '../tooltip/index.js';
|
|
4
4
|
export interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
5
|
+
/** Total number of items. */
|
|
5
6
|
total?: number;
|
|
7
|
+
/** Whether to show the total number of pages; not shown when size is small. */
|
|
6
8
|
showTotal?: boolean;
|
|
7
9
|
/** Bindable; the size changer writes the chosen size back. Leave it out for an uncontrolled size */
|
|
8
10
|
pageSize?: number;
|
|
11
|
+
/** Options of the size changer; the current page size is inserted in order when it is not among them. */
|
|
9
12
|
pageSizeOpts?: number[];
|
|
13
|
+
/** Size: default or small. */
|
|
10
14
|
size?: 'small' | 'default';
|
|
11
15
|
/** Bindable; leave it out for an uncontrolled page. `bind:currentPage={get, set}` makes it fully controlled */
|
|
12
16
|
currentPage?: number;
|
|
17
|
+
/** Whether to show the size changer; not rendered when size is small. */
|
|
13
18
|
showSizeChanger?: boolean;
|
|
19
|
+
/** Whether to show the quick jump input; disabled when there are fewer than 2 pages. */
|
|
14
20
|
showQuickJumper?: boolean;
|
|
15
21
|
/** Position of the omitted pages popover and the size changer dropdown; not used by the `small` size */
|
|
16
22
|
popoverPosition?: Position;
|
|
23
|
+
/** Whether to hide the pagination when there are fewer than 2 pages; has no effect while the size changer is shown. */
|
|
17
24
|
hideOnSinglePage?: boolean;
|
|
18
25
|
/** Only for `size="small"`: the page select opens on hover or focus */
|
|
19
26
|
hoverShowPageSelect?: boolean;
|
|
27
|
+
/** Whether disabled. */
|
|
20
28
|
disabled?: boolean;
|
|
21
29
|
/** Keeps the current page when the page size changes; the consumer picks the page from `onPageSizeChange` */
|
|
22
30
|
preventPageChangeOnPageSizeChange?: boolean;
|
|
31
|
+
/** Called when the page changes. */
|
|
23
32
|
onPageChange?: (currentPage: number) => void;
|
|
33
|
+
/** Called when the page size changes. */
|
|
24
34
|
onPageSizeChange?: (pageSize: number) => void;
|
|
35
|
+
/** Called when the page or the page size changes, with the page and the page size. */
|
|
25
36
|
onChange?: (currentPage: number, pageSize: number) => void;
|
|
26
37
|
/** Replaces the previous icon; a string or a lone text snippet names the button, any other content leaves the locale name */
|
|
27
38
|
prevText?: string | Snippet;
|
|
39
|
+
/** String or snippet that replaces the next page icon, named the same way as prevText. */
|
|
28
40
|
nextText?: string | Snippet;
|
|
29
41
|
}
|
|
@@ -5,13 +5,21 @@ export type PinCodeFormat = 'number' | 'mixed' | RegExp | ((value: string) => bo
|
|
|
5
5
|
export interface PinCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onfocus' | 'onblur' | 'onchange'> {
|
|
6
6
|
/** Bindable; leave it out for an uncontrolled code. `bind:value={get, set}` makes it fully controlled */
|
|
7
7
|
value?: string;
|
|
8
|
+
/** Number of digits. */
|
|
8
9
|
count?: number;
|
|
10
|
+
/** Format limit for a single character: number allows digits only, mixed allows digits and letters, and a regular expression or function judges each character. */
|
|
9
11
|
format?: PinCodeFormat;
|
|
12
|
+
/** Whether to focus the first input on mount. Turn it on only when the user has just entered the code step: focus moving at page load makes screen readers skip the content before it. */
|
|
10
13
|
autofocus?: boolean;
|
|
14
|
+
/** Whether the input is disabled. */
|
|
11
15
|
disabled?: boolean;
|
|
16
|
+
/** Input size: large, default or small. */
|
|
12
17
|
size?: InputSize;
|
|
18
|
+
/** Validation status, passed to every input; error shows the error style. */
|
|
13
19
|
validateStatus?: ValidateStatus;
|
|
20
|
+
/** Called when the content changes, with the current content. */
|
|
14
21
|
onChange?: (value: string) => void;
|
|
22
|
+
/** Called once all digits are entered, with the current content. */
|
|
15
23
|
onComplete?: (value: string) => void;
|
|
16
24
|
/** Focus entering the code from outside; moving between the digits does not fire it */
|
|
17
25
|
onFocus?: (event: FocusEvent) => void;
|
|
@@ -10,20 +10,32 @@ export interface PopconfirmButtonProps extends ButtonProps {
|
|
|
10
10
|
autoFocus?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export interface PopconfirmProps extends Omit<PopoverProps, 'content'> {
|
|
13
|
+
/** Props of the cancel button. autoFocus focuses it on open; onclick runs before the built-in cancel handling. */
|
|
13
14
|
cancelButtonProps?: PopconfirmButtonProps;
|
|
15
|
+
/** Cancel button text. Defaults to the locale entry Popconfirm.cancel. */
|
|
14
16
|
cancelText?: string;
|
|
17
|
+
/** Type of the cancel button. */
|
|
15
18
|
cancelType?: ButtonType;
|
|
19
|
+
/** Class names of the inner parts, keyed by `content` (the content container `.semi-popover` inside the popup) and `arrow`; merged with the built-in classes. The class of the confirmation card `.semi-popconfirm` is set with `class`. */
|
|
16
20
|
classNames?: Partial<Record<PopconfirmPart, ClassValue>>;
|
|
21
|
+
/** Whether it is disabled. A disabled Popconfirm renders only the trigger and never opens. */
|
|
17
22
|
disabled?: boolean;
|
|
23
|
+
/** Props of the confirm button. autoFocus focuses it on open; onclick runs before the built-in confirm handling. */
|
|
18
24
|
okButtonProps?: PopconfirmButtonProps;
|
|
25
|
+
/** Confirm button text. Defaults to the locale entry Popconfirm.confirm. */
|
|
19
26
|
okText?: string;
|
|
27
|
+
/** Type of the confirm button. */
|
|
20
28
|
okType?: ButtonType;
|
|
29
|
+
/** Whether the close button in the corner is shown. */
|
|
21
30
|
showCloseIcon?: boolean;
|
|
31
|
+
/** Title, a string or a snippet, which also names the dialog. */
|
|
22
32
|
title?: string | Snippet;
|
|
33
|
+
/** Snippet for the content of the card. Its argument `{ initialFocusRef }` is a callback; write `{@attach initialFocusRef}` to bind it to the element that receives focus on open. Omitted, no content area is rendered. */
|
|
23
34
|
content?: Snippet<[RenderContentProps]>;
|
|
24
35
|
/** Replaces the warning icon; `null` shows no icon */
|
|
25
36
|
icon?: Snippet | null;
|
|
26
37
|
/** Receives the button's native click event; a returned Promise keeps the button loading until it settles */
|
|
27
38
|
onCancel?: (event: MouseEvent) => Promise<unknown> | void;
|
|
39
|
+
/** Called when the confirm button is clicked, with the button's native click event. A returned Promise keeps the button loading and closes the card once it resolves; a rejection keeps it open. */
|
|
28
40
|
onConfirm?: (event: MouseEvent) => Promise<unknown> | void;
|
|
29
41
|
}
|