@instructure/ui-time-select 8.14.1-snapshot.21 → 8.14.1-snapshot.31
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/es/TimeSelect/TimeSelectLocator.js +3 -1
- package/es/TimeSelect/index.js +20 -23
- package/es/TimeSelect/props.js +0 -155
- package/lib/TimeSelect/TimeSelectLocator.js +2 -0
- package/lib/TimeSelect/index.js +20 -23
- package/lib/TimeSelect/props.js +0 -155
- package/package.json +14 -14
- package/src/TimeSelect/index.tsx +42 -69
- package/src/TimeSelect/props.ts +87 -76
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/TimeSelect/index.d.ts +49 -78
- package/types/TimeSelect/index.d.ts.map +1 -1
- package/types/TimeSelect/props.d.ts +151 -16
- package/types/TimeSelect/props.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TimeSelect/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TimeSelect/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAWxC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAIhB,aAAK,SAAS,GAAG,CAAC,CAAC,SAAS,MAAM,iBAAiB,EACjD,KAAK,EAAE,CAAC,EACR,KAAK,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC5B,OAAO,CAAC,EAAE,iBAAiB,EAAE,KAC1B,iBAAiB,GAAG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kBAAkB,EAAE,WAAW,CAAC,uBAAuB,CAAC,CAoCvD;IAED,aAAa;IAuBb,iBAAiB;IAYjB,MAAM;CA8DP;AAED,OAAO,EAAE,UAAU,EAAE,CAAA;AACrB,eAAe,UAAU,CAAA"}
|
|
@@ -2,42 +2,177 @@ import React, { InputHTMLAttributes } from 'react';
|
|
|
2
2
|
import type { FormMessage } from '@instructure/ui-form-field';
|
|
3
3
|
import type { OtherHTMLAttributes, PropValidators } from '@instructure/shared-types';
|
|
4
4
|
import type { PlacementPropValues, PositionConstraint } from '@instructure/ui-position';
|
|
5
|
+
declare type PropKeys = keyof TimeSelectOwnProps;
|
|
6
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
7
|
+
declare type TimeSelectProps = TimeSelectOwnProps & OtherHTMLAttributes<TimeSelectOwnProps, InputHTMLAttributes<TimeSelectOwnProps>>;
|
|
5
8
|
declare type TimeSelectOwnProps = {
|
|
6
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The form field label.
|
|
11
|
+
*/
|
|
12
|
+
renderLabel: React.ReactNode | (() => React.ReactNode);
|
|
13
|
+
/**
|
|
14
|
+
* Whether to default to the first option when `defaultValue` hasn't been specified.
|
|
15
|
+
*/
|
|
7
16
|
defaultToFirstOption?: boolean;
|
|
8
|
-
|
|
17
|
+
/**
|
|
18
|
+
* An ISO 8601 formatted date string representing the current selected value. If defined,
|
|
19
|
+
* the component will act controlled and will not manage its own state.
|
|
20
|
+
*/
|
|
21
|
+
value?: string;
|
|
22
|
+
/**
|
|
23
|
+
* An ISO 8601 formatted date string to use if `value` isn't provided.
|
|
24
|
+
*/
|
|
9
25
|
defaultValue?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The id of the text input. One is generated if not supplied.
|
|
28
|
+
*/
|
|
10
29
|
id?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The format to use when displaying the possible and currently selected options.
|
|
32
|
+
*
|
|
33
|
+
* See [moment](https://momentjs.com/docs/#/displaying/format/) for the list
|
|
34
|
+
* of available formats.
|
|
35
|
+
*/
|
|
11
36
|
format?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The number of minutes to increment by when generating the allowable options.
|
|
39
|
+
*/
|
|
12
40
|
step?: 5 | 10 | 15 | 20 | 30 | 60;
|
|
41
|
+
/**
|
|
42
|
+
* Specifies if interaction with the input is enabled, disabled, or readonly.
|
|
43
|
+
* When "disabled", the input changes visibly to indicate that it cannot
|
|
44
|
+
* receive user interactions. When "readonly" the input still cannot receive
|
|
45
|
+
* user interactions, but it keeps the same styles as if it were enabled.
|
|
46
|
+
*/
|
|
13
47
|
interaction?: 'enabled' | 'disabled' | 'readonly';
|
|
48
|
+
/**
|
|
49
|
+
* Html placeholder text to display when the input has no value. This should
|
|
50
|
+
* be hint text, not a label replacement.
|
|
51
|
+
*/
|
|
14
52
|
placeholder?: string;
|
|
15
53
|
isRequired?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the input is rendered inline with other elements or if it
|
|
56
|
+
* is rendered as a block level element.
|
|
57
|
+
*/
|
|
16
58
|
isInline?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The width of the text input.
|
|
61
|
+
*/
|
|
17
62
|
width?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The max width the options list can be before option text wraps. If not
|
|
65
|
+
* set, the list will only display as wide as the text input.
|
|
66
|
+
*/
|
|
18
67
|
optionsMaxWidth?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The number of options that should be visible before having to scroll.
|
|
70
|
+
*/
|
|
19
71
|
visibleOptionsCount?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Displays messages and validation for the input. It should be an array of
|
|
74
|
+
* objects with the following shape:
|
|
75
|
+
* `{
|
|
76
|
+
* text: ReactNode,
|
|
77
|
+
* type: One of: ['error', 'hint', 'success', 'screenreader-only']
|
|
78
|
+
* }`
|
|
79
|
+
*/
|
|
20
80
|
messages?: FormMessage[];
|
|
81
|
+
/**
|
|
82
|
+
* The placement of the options list.
|
|
83
|
+
*/
|
|
21
84
|
placement?: PlacementPropValues;
|
|
85
|
+
/**
|
|
86
|
+
* The parent in which to constrain the placement.
|
|
87
|
+
*/
|
|
22
88
|
constrain?: PositionConstraint;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Callback fired when a new option is selected.
|
|
91
|
+
* @param event - the event object
|
|
92
|
+
* @param data - additional data
|
|
93
|
+
*/
|
|
94
|
+
onChange?: (event: React.SyntheticEvent, data: {
|
|
95
|
+
value?: string;
|
|
96
|
+
inputText: string;
|
|
97
|
+
}) => void;
|
|
98
|
+
/**
|
|
99
|
+
* Callback fired when text input receives focus.
|
|
100
|
+
*/
|
|
101
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
102
|
+
/**
|
|
103
|
+
* Callback fired when text input loses focus.
|
|
104
|
+
*/
|
|
105
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Callback fired when the options list is shown.
|
|
108
|
+
*/
|
|
109
|
+
onShowOptions?: (event: React.SyntheticEvent) => void;
|
|
110
|
+
/**
|
|
111
|
+
* Callback fired when the options list is hidden.
|
|
112
|
+
*/
|
|
113
|
+
onHideOptions?: (event: React.SyntheticEvent) => void;
|
|
114
|
+
/**
|
|
115
|
+
* A ref to the html `input` element.
|
|
116
|
+
*/
|
|
117
|
+
inputRef?: (inputElement: HTMLInputElement | null) => void;
|
|
118
|
+
/**
|
|
119
|
+
* A ref to the html `ul` element.
|
|
120
|
+
*/
|
|
121
|
+
listRef?: (listElement: HTMLUListElement | null) => void;
|
|
122
|
+
/**
|
|
123
|
+
* Content to display in the list when no options are available.
|
|
124
|
+
*/
|
|
125
|
+
renderEmptyOption?: React.ReactNode | (() => React.ReactNode);
|
|
126
|
+
/**
|
|
127
|
+
* Content to display before the text input. This will commonly be an icon.
|
|
128
|
+
*/
|
|
129
|
+
renderBeforeInput?: React.ReactNode | (() => React.ReactNode);
|
|
130
|
+
/**
|
|
131
|
+
* Content to display after the text input. This content will replace the
|
|
132
|
+
* default arrow icons.
|
|
133
|
+
*/
|
|
134
|
+
renderAfterInput?: React.ReactNode | (() => React.ReactNode);
|
|
135
|
+
/**
|
|
136
|
+
* A standard language identifier.
|
|
137
|
+
*
|
|
138
|
+
* See [moment.js i18n](https://momentjs.com/docs/#/i18n/) for more details.
|
|
139
|
+
*
|
|
140
|
+
* This property can also be set via a context property and if both are set then the component property takes
|
|
141
|
+
* precedence over the context property.
|
|
142
|
+
*
|
|
143
|
+
* The web browser's locale will be used if no value is set via a component property or a context
|
|
144
|
+
* property.
|
|
145
|
+
*/
|
|
33
146
|
locale?: string;
|
|
147
|
+
/**
|
|
148
|
+
* A timezone identifier in the format: Area/Location
|
|
149
|
+
*
|
|
150
|
+
* See [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for the list
|
|
151
|
+
* of possible options.
|
|
152
|
+
*
|
|
153
|
+
* This property can also be set via a context property and if both are set then the component property takes
|
|
154
|
+
* precedence over the context property.
|
|
155
|
+
*
|
|
156
|
+
* The web browser's timezone will be used if no value is set via a component property or a context
|
|
157
|
+
* property.
|
|
158
|
+
*/
|
|
34
159
|
timezone?: string;
|
|
35
160
|
};
|
|
36
|
-
declare type PropKeys = keyof TimeSelectOwnProps;
|
|
37
|
-
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
38
|
-
declare type TimeSelectProps = TimeSelectOwnProps & OtherHTMLAttributes<TimeSelectOwnProps, InputHTMLAttributes<TimeSelectOwnProps>>;
|
|
39
161
|
declare const propTypes: PropValidators<PropKeys>;
|
|
40
162
|
declare const allowedProps: AllowedPropKeys;
|
|
41
|
-
|
|
163
|
+
declare type TimeSelectOptions = {
|
|
164
|
+
id?: string;
|
|
165
|
+
value?: string;
|
|
166
|
+
label: string;
|
|
167
|
+
};
|
|
168
|
+
declare type TimeSelectState = {
|
|
169
|
+
inputValue: string;
|
|
170
|
+
options: TimeSelectOptions[];
|
|
171
|
+
filteredOptions: TimeSelectOptions[];
|
|
172
|
+
isShowingOptions: boolean;
|
|
173
|
+
highlightedOptionId?: string;
|
|
174
|
+
selectedOptionId?: string;
|
|
175
|
+
};
|
|
176
|
+
export type { TimeSelectProps, TimeSelectState, TimeSelectOptions };
|
|
42
177
|
export { propTypes, allowedProps };
|
|
43
178
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/TimeSelect/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAQlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,0BAA0B,CAAA;AAEjC,aAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/TimeSelect/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAQlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,0BAA0B,CAAA;AAEjC,aAAK,QAAQ,GAAG,MAAM,kBAAkB,CAAA;AAExC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,eAAe,GAAG,kB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