@dinofront/design_system 1.20.1 → 1.20.2
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.
|
@@ -20,7 +20,7 @@ export interface SelectV2Option {
|
|
|
20
20
|
}
|
|
21
21
|
/** react-select props SelectV2 already computes/owns internally and can't be
|
|
22
22
|
* overridden through passthrough without breaking its own logic. */
|
|
23
|
-
type OwnedReactSelectProps = 'aria-invalid' | 'aria-required' | 'className' | 'classNames' | 'components' | 'formatOptionLabel' | 'getOptionLabel' | 'getOptionValue' | 'id' | 'inputId' | '
|
|
23
|
+
type OwnedReactSelectProps = 'aria-invalid' | 'aria-required' | 'className' | 'classNames' | 'components' | 'formatOptionLabel' | 'getOptionLabel' | 'getOptionValue' | 'id' | 'inputId' | 'isClearable' | 'isDisabled' | 'isLoading' | 'isMulti' | 'isOptionDisabled' | 'isSearchable' | 'loadingMessage' | 'noOptionsMessage' | 'onChange' | 'options' | 'placeholder' | 'required' | 'unstyled' | 'value';
|
|
24
24
|
export type SelectV2ReactSelectProps = Omit<ReactSelectProps<SelectV2Option, boolean, GroupBase<SelectV2Option>>, OwnedReactSelectProps>;
|
|
25
25
|
export interface SelectV2BaseProps extends BaseProps, Partial<SelectV2ReactSelectProps> {
|
|
26
26
|
/** Static option list, matching `Select`'s required `options` prop. Pass
|
|
@@ -67,6 +67,11 @@ export interface SelectV2BaseProps extends BaseProps, Partial<SelectV2ReactSelec
|
|
|
67
67
|
loading?: boolean;
|
|
68
68
|
/** Shows a clear ("x") indicator once a value is selected. Default `false`. */
|
|
69
69
|
clearable?: boolean;
|
|
70
|
+
/** Controls the search text, react-select style — e.g. seeding the box with
|
|
71
|
+
* the current value so the user can amend it instead of retyping. Pair with
|
|
72
|
+
* `onInputChange`, which also fires for react-select's automatic clears on
|
|
73
|
+
* select, menu close and blur. */
|
|
74
|
+
inputValue?: string;
|
|
70
75
|
/** Type-to-filter the option list. Defaults to `true`, except for a
|
|
71
76
|
* static (non-async, non-creatable) select with fewer than 10 options,
|
|
72
77
|
* where the search box is hidden automatically since it adds little
|
|
@@ -10,8 +10,9 @@ type SelectV2SharedProps = Pick<SelectV2BaseProps, 'label' | 'helperText' | 'err
|
|
|
10
10
|
/**
|
|
11
11
|
* Props for TimePicker. The shared field props come from SelectV2, but a few
|
|
12
12
|
* defaults differ: `required` defaults to `false` (SelectV2: `true`),
|
|
13
|
-
* `searchable` to `true` (typing a time — `"930"`, `"0930"`, `"09:30"`),
|
|
14
|
-
* `
|
|
13
|
+
* `searchable` to `true` (typing a time — `"930"`, `"0930"`, `"09:30"`),
|
|
14
|
+
* `clearable` to `true` (SelectV2: `false`), and `placeholder` to
|
|
15
|
+
* `'Select time'`. On mobile, `menuPlacement` has no effect.
|
|
15
16
|
*/
|
|
16
17
|
export interface TimePickerProps extends BaseProps, SelectV2SharedProps {
|
|
17
18
|
/** Selected time as a 24-hour `"HH:mm"` string. `null` = controlled with no
|
|
@@ -27,6 +27,16 @@ export declare function createTimeDisabler({ minTime, maxTime, excludeTimes, fil
|
|
|
27
27
|
* 3 digits read as H:MM), `"9:30"` / `"09:30"`, and `"9.30"`.
|
|
28
28
|
*/
|
|
29
29
|
export declare function parseTypedTime(input: string): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Whether a keystroke may type a character into the time field: digits and
|
|
32
|
+
* `:` only. Editing keys and shortcuts aren't plain characters, so they pass.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isTimeInputKey(event: {
|
|
35
|
+
key: string;
|
|
36
|
+
ctrlKey: boolean;
|
|
37
|
+
metaKey: boolean;
|
|
38
|
+
altKey: boolean;
|
|
39
|
+
}): boolean;
|
|
30
40
|
/**
|
|
31
41
|
* The prefix of `"HH:mm"` options that match partially typed text:
|
|
32
42
|
* `"9"` → `"09"`, `"1"` → `"1"` (01, 10–19), `"14"` → `"14:"`, `"93"` → `"09:3"`,
|
|
@@ -34,12 +44,15 @@ export declare function parseTypedTime(input: string): string | null;
|
|
|
34
44
|
*/
|
|
35
45
|
export declare function typedTimePrefix(input: string): string | null;
|
|
36
46
|
/**
|
|
37
|
-
* Whether a suggested option should stay visible for the typed text.
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
47
|
+
* Whether a suggested option should stay visible for the typed text. Partial
|
|
48
|
+
* text keeps every suggestion it's a prefix of ("9" → the 09 hour). A
|
|
49
|
+
* complete time narrows the list to that time alone: just the suggestion if
|
|
50
|
+
* there is one, otherwise nothing here (the typed-time row is added
|
|
51
|
+
* separately). Keeping other rows visible would let react-select's highlight
|
|
52
|
+
* stay on them — e.g. on the selected 01:15 while editing it to 01:18 — so
|
|
53
|
+
* Enter would pick that row instead of the typed time.
|
|
41
54
|
*/
|
|
42
|
-
export declare function matchesTypedTime(option: string, input: string
|
|
55
|
+
export declare function matchesTypedTime(option: string, input: string): boolean;
|
|
43
56
|
/**
|
|
44
57
|
* Applies an `"HH:mm"` time to a date: a new `Date` on `base`'s calendar day
|
|
45
58
|
* (default: today) at that local time, seconds zeroed. Throws on an invalid time.
|