stentor-models 1.66.46 → 1.66.50
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/lib/Form/FormField.d.ts +189 -18
- package/package.json +2 -2
package/lib/Form/FormField.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/*! Copyright (c) 2024, XAPP AI */
|
|
2
2
|
import { DayOfWeek } from "../Services";
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for Google Maps Places Autocomplete API
|
|
5
|
+
*
|
|
6
|
+
* @see https://developers.google.com/maps/documentation/places/web-service/autocomplete
|
|
7
|
+
*/
|
|
3
8
|
export interface AddressAutocompleteParameters {
|
|
4
9
|
/**
|
|
5
10
|
* This will look like components=country:us or components=country:us|country:ca
|
|
@@ -17,7 +22,17 @@ export interface AddressAutocompleteParameters {
|
|
|
17
22
|
* For example, location=37.76999,-122.44696
|
|
18
23
|
*/
|
|
19
24
|
location?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Biases results to a specified location and radius.
|
|
27
|
+
*
|
|
28
|
+
* @see https://developers.google.com/maps/documentation/places/web-service/autocomplete#location_biasing
|
|
29
|
+
*/
|
|
20
30
|
locationbias?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Restricts results to a specified location and radius.
|
|
33
|
+
*
|
|
34
|
+
* @see https://developers.google.com/maps/documentation/places/web-service/autocomplete#location_restriction
|
|
35
|
+
*/
|
|
21
36
|
locationrestriction?: string;
|
|
22
37
|
/**
|
|
23
38
|
* When using location with a specific lat & long, this must be provided.
|
|
@@ -30,6 +45,17 @@ export interface AddressAutocompleteParameters {
|
|
|
30
45
|
*/
|
|
31
46
|
key?: string;
|
|
32
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Union type representing all possible form field types.
|
|
50
|
+
*
|
|
51
|
+
* Each form field type provides different input capabilities:
|
|
52
|
+
* - FormCardInput: Display card with text/image
|
|
53
|
+
* - FormTextInput: Text input with optional validation
|
|
54
|
+
* - FormDropdownInput: Selection from dropdown list
|
|
55
|
+
* - FormChipsInput: Multi-select chip interface
|
|
56
|
+
* - FormDateInput: Single date picker
|
|
57
|
+
* - FormDateRangeInput: Date range picker
|
|
58
|
+
*/
|
|
33
59
|
export type FormField = FormCardInput | FormTextInput | FormDropdownInput | FormChipsInput | FormDateInput | FormDateRangeInput;
|
|
34
60
|
/**
|
|
35
61
|
* Form field base class
|
|
@@ -79,76 +105,195 @@ export interface FormInput {
|
|
|
79
105
|
*/
|
|
80
106
|
style?: object;
|
|
81
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Specialized text input for address entry with autocomplete functionality.
|
|
110
|
+
*
|
|
111
|
+
* Extends FormTextInput to provide Google Maps Places Autocomplete
|
|
112
|
+
* integration for address suggestions.
|
|
113
|
+
*/
|
|
82
114
|
export interface FormFieldTextAddressInput extends FormTextInput {
|
|
83
115
|
format: "ADDRESS";
|
|
84
116
|
/**
|
|
85
117
|
* Base URL of an endpoint that adheres to the Google Maps Location Autocomplete API.
|
|
118
|
+
*
|
|
119
|
+
* This can be either the official Google Maps API endpoint or a custom
|
|
120
|
+
* proxy endpoint that implements the same interface.
|
|
86
121
|
*/
|
|
87
122
|
mapsBaseUrl?: string;
|
|
88
123
|
/**
|
|
89
124
|
* Optional query parameters to help limit the results returned by the Google Maps Autocomplete API.
|
|
125
|
+
*
|
|
126
|
+
* Use these parameters to restrict results by country, location, or other criteria.
|
|
90
127
|
*/
|
|
91
128
|
mapsUrlQueryParams?: AddressAutocompleteParameters;
|
|
92
129
|
/**
|
|
93
130
|
* Required when you are using the official Google Maps Autocomplete API.
|
|
131
|
+
*
|
|
132
|
+
* Not needed if using a custom proxy endpoint that handles authentication.
|
|
94
133
|
*/
|
|
95
134
|
googleMapsApiKey?: string;
|
|
96
135
|
}
|
|
97
136
|
/**
|
|
98
|
-
* Text input
|
|
137
|
+
* Text input field with optional validation and formatting.
|
|
138
|
+
*
|
|
139
|
+
* Supports both single-line and multi-line text input with various
|
|
140
|
+
* format validators (phone, email, address, zip code).
|
|
99
141
|
*/
|
|
100
142
|
export interface FormTextInput extends FormInput {
|
|
143
|
+
/**
|
|
144
|
+
* When true, renders as a textarea instead of a single-line input
|
|
145
|
+
*/
|
|
101
146
|
multiline?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Format validation to apply to the input. Default is free text with no validation.
|
|
149
|
+
*/
|
|
102
150
|
format?: "PHONE" | "EMAIL" | "ADDRESS" | "ZIP_CODE";
|
|
151
|
+
/**
|
|
152
|
+
* Placeholder text shown when the input is empty
|
|
153
|
+
*/
|
|
103
154
|
placeholder?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Accessible label for the input field
|
|
157
|
+
*/
|
|
104
158
|
label?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Number of rows for textarea (only applicable when multiline is true)
|
|
161
|
+
*/
|
|
105
162
|
rows?: number;
|
|
163
|
+
/**
|
|
164
|
+
* Maximum number of rows for textarea (only applicable when multiline is true)
|
|
165
|
+
*/
|
|
106
166
|
rowsMax?: number;
|
|
167
|
+
/**
|
|
168
|
+
* Maximum character length allowed for the input
|
|
169
|
+
*/
|
|
170
|
+
maxLength?: number;
|
|
107
171
|
}
|
|
108
172
|
/**
|
|
109
|
-
* Dropdown
|
|
173
|
+
* Dropdown selection field.
|
|
174
|
+
*
|
|
175
|
+
* Displays a list of selectable items in a dropdown menu.
|
|
110
176
|
*/
|
|
111
177
|
export interface FormDropdownInput extends FormInput {
|
|
178
|
+
/**
|
|
179
|
+
* List of items available for selection in the dropdown
|
|
180
|
+
*/
|
|
112
181
|
items: SelectableItem[];
|
|
113
182
|
}
|
|
114
183
|
/**
|
|
115
|
-
* Close/Open style chips selection
|
|
184
|
+
* Close/Open style chips selection field.
|
|
185
|
+
*
|
|
186
|
+
* Displays items as chips that can be selected/deselected.
|
|
187
|
+
* Header plus open symbol reveals the chips.
|
|
116
188
|
*/
|
|
117
189
|
export interface FormChipsInput extends FormInput {
|
|
118
190
|
type: "CHIPS";
|
|
191
|
+
/**
|
|
192
|
+
* When true, allows only single selection (radio button behavior).
|
|
193
|
+
* When false or undefined, allows multiple selections.
|
|
194
|
+
*/
|
|
119
195
|
radio?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Whether the chips are shown by default or collapsed
|
|
198
|
+
*/
|
|
120
199
|
defaultOpen?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Minimum number of items that must be selected
|
|
202
|
+
*/
|
|
121
203
|
minRequired?: number;
|
|
204
|
+
/**
|
|
205
|
+
* Maximum number of items that can be selected
|
|
206
|
+
*/
|
|
122
207
|
maxAllowed?: number;
|
|
208
|
+
/**
|
|
209
|
+
* List of selectable or actionable items to display as chips
|
|
210
|
+
*/
|
|
123
211
|
items: (SelectableItem | ActionableItem)[];
|
|
124
212
|
}
|
|
125
213
|
/**
|
|
126
|
-
*
|
|
214
|
+
* Selection field similar to chips but rendered with checkboxes.
|
|
215
|
+
*
|
|
216
|
+
* Provides a checkbox or radio button interface for item selection.
|
|
127
217
|
*/
|
|
128
218
|
export interface FormSelectInput extends FormInput {
|
|
219
|
+
/**
|
|
220
|
+
* When true, allows only single selection (radio button behavior).
|
|
221
|
+
* When false or undefined, allows multiple selections with checkboxes.
|
|
222
|
+
*/
|
|
129
223
|
radio?: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Whether the selection list is shown by default or collapsed
|
|
226
|
+
*/
|
|
130
227
|
defaultOpen?: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* List of selectable items to display
|
|
230
|
+
*/
|
|
131
231
|
items: SelectableItem[];
|
|
132
232
|
}
|
|
133
233
|
/**
|
|
134
|
-
* Card
|
|
234
|
+
* Card display field for showing text and/or images.
|
|
235
|
+
*
|
|
236
|
+
* Provides a rich card-based display component with optional header,
|
|
237
|
+
* media content, and body text.
|
|
135
238
|
*/
|
|
136
239
|
export interface FormCardInput extends FormInput {
|
|
240
|
+
/**
|
|
241
|
+
* Optional header section with title and subheader
|
|
242
|
+
*/
|
|
137
243
|
header?: {
|
|
244
|
+
/**
|
|
245
|
+
* Main title text for the card header
|
|
246
|
+
*/
|
|
138
247
|
title: string;
|
|
248
|
+
/**
|
|
249
|
+
* Optional subtitle or secondary text
|
|
250
|
+
*/
|
|
139
251
|
subheader?: string;
|
|
140
252
|
};
|
|
253
|
+
/**
|
|
254
|
+
* Optional media section for displaying images
|
|
255
|
+
*/
|
|
141
256
|
media?: {
|
|
257
|
+
/**
|
|
258
|
+
* Height of the media in pixels
|
|
259
|
+
*/
|
|
142
260
|
height?: number;
|
|
261
|
+
/**
|
|
262
|
+
* Width of the media in pixels
|
|
263
|
+
*/
|
|
143
264
|
width?: number;
|
|
265
|
+
/**
|
|
266
|
+
* URL of the image to display
|
|
267
|
+
*/
|
|
144
268
|
imageUrl: string;
|
|
269
|
+
/**
|
|
270
|
+
* Alternative text for accessibility
|
|
271
|
+
*/
|
|
145
272
|
alt?: string;
|
|
146
273
|
};
|
|
274
|
+
/**
|
|
275
|
+
* Body text content for the card
|
|
276
|
+
*/
|
|
147
277
|
text?: string;
|
|
278
|
+
/**
|
|
279
|
+
* Visual variant style for the card
|
|
280
|
+
*/
|
|
148
281
|
variant?: string;
|
|
282
|
+
/**
|
|
283
|
+
* Color scheme for the card
|
|
284
|
+
*/
|
|
149
285
|
color?: string;
|
|
286
|
+
/**
|
|
287
|
+
* Text alignment: "left", "center", "right", or "justify"
|
|
288
|
+
*/
|
|
150
289
|
align?: string;
|
|
151
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* Configuration for marking days as busy/unavailable in date selection.
|
|
293
|
+
*
|
|
294
|
+
* Used to control which days can be selected in date input fields,
|
|
295
|
+
* typically for appointment scheduling or availability management.
|
|
296
|
+
*/
|
|
152
297
|
export interface BusyDayDescription {
|
|
153
298
|
/**
|
|
154
299
|
* The days of the week that are available for appointments.
|
|
@@ -164,26 +309,34 @@ export interface BusyDayDescription {
|
|
|
164
309
|
* Blocks the current day.
|
|
165
310
|
*
|
|
166
311
|
* If it is a weekend and weekends are not blocked, it will be blocked.
|
|
167
|
-
* If it is a weekend and weekends are blocked,
|
|
312
|
+
* If it is a weekend and weekends are blocked, then it will be disregarded.
|
|
168
313
|
*/
|
|
169
314
|
readonly blockCurrentDay?: boolean;
|
|
170
315
|
/**
|
|
171
|
-
* Blocks the current day until the specified time.
|
|
316
|
+
* Blocks the current day until the specified time. This is in the format of HH:MM.
|
|
317
|
+
*
|
|
318
|
+
* For example, "14:00" would make the current day unavailable until 2:00 PM.
|
|
172
319
|
*/
|
|
173
320
|
readonly currentDayAvailableUntil?: string;
|
|
174
321
|
/**
|
|
175
322
|
* Blocks the next number of business days.
|
|
176
323
|
*
|
|
177
|
-
* One business day will
|
|
324
|
+
* One business day will block the next business day.
|
|
178
325
|
*
|
|
179
326
|
* If this is set, it will override the availableDays, blockWeekends, and blockCurrentDay.
|
|
180
327
|
*/
|
|
181
328
|
readonly blockNextBusinessDays?: number;
|
|
182
329
|
}
|
|
183
330
|
/**
|
|
184
|
-
* Single date
|
|
331
|
+
* Single date picker input field.
|
|
332
|
+
*
|
|
333
|
+
* Allows users to select a single date with optional
|
|
334
|
+
* preselection and busy day configuration.
|
|
185
335
|
*/
|
|
186
336
|
export interface FormDateInput extends FormInput {
|
|
337
|
+
/**
|
|
338
|
+
* Date to preselect when the date picker is displayed
|
|
339
|
+
*/
|
|
187
340
|
preselecteDate?: Date;
|
|
188
341
|
/**
|
|
189
342
|
* Default busy days that will show as unavailable.
|
|
@@ -193,45 +346,63 @@ export interface FormDateInput extends FormInput {
|
|
|
193
346
|
defaultBusyDays?: BusyDayDescription;
|
|
194
347
|
}
|
|
195
348
|
/**
|
|
196
|
-
* Date range
|
|
349
|
+
* Date range picker input field.
|
|
350
|
+
*
|
|
351
|
+
* Allows users to select a start and end date range.
|
|
197
352
|
*/
|
|
198
353
|
export interface FormDateRangeInput extends FormInput {
|
|
354
|
+
/**
|
|
355
|
+
* Date range to preselect when the date picker is displayed
|
|
356
|
+
*/
|
|
199
357
|
preselecteDates?: {
|
|
358
|
+
/**
|
|
359
|
+
* Start date of the range
|
|
360
|
+
*/
|
|
200
361
|
from?: Date;
|
|
362
|
+
/**
|
|
363
|
+
* End date of the range
|
|
364
|
+
*/
|
|
201
365
|
to?: Date;
|
|
202
366
|
};
|
|
203
367
|
}
|
|
204
368
|
/**
|
|
205
|
-
*
|
|
369
|
+
* An item that can be clicked to perform an action (e.g., navigate to a URL).
|
|
370
|
+
*
|
|
371
|
+
* Used in form fields like chips to provide actionable items that
|
|
372
|
+
* trigger navigation or other actions when clicked.
|
|
206
373
|
*/
|
|
207
374
|
export interface ActionableItem {
|
|
208
375
|
/**
|
|
209
|
-
*
|
|
376
|
+
* Display label shown to the user
|
|
210
377
|
*/
|
|
211
378
|
label: string;
|
|
212
379
|
/**
|
|
213
|
-
*
|
|
380
|
+
* Unique identifier for the item. This is what is sent to the server
|
|
381
|
+
* and should be a human-readable form of the label.
|
|
214
382
|
*/
|
|
215
383
|
id: string;
|
|
216
384
|
/**
|
|
217
|
-
*
|
|
385
|
+
* URL to navigate to when the item is clicked
|
|
218
386
|
*/
|
|
219
387
|
url: string;
|
|
220
388
|
}
|
|
221
389
|
/**
|
|
222
|
-
*
|
|
390
|
+
* A selectable item used in dropdowns, chips, and other selection fields.
|
|
391
|
+
*
|
|
392
|
+
* Represents a name-value pair with optional preselection state.
|
|
223
393
|
*/
|
|
224
394
|
export interface SelectableItem {
|
|
225
395
|
/**
|
|
226
|
-
* Display label
|
|
396
|
+
* Display label shown to the user
|
|
227
397
|
*/
|
|
228
398
|
label: string;
|
|
229
399
|
/**
|
|
230
|
-
*
|
|
400
|
+
* Unique identifier for the item. This is what is sent to the server
|
|
401
|
+
* and should be a human-readable form of the label.
|
|
231
402
|
*/
|
|
232
403
|
id: string;
|
|
233
404
|
/**
|
|
234
|
-
*
|
|
405
|
+
* When true, the item will be shown as selected by default
|
|
235
406
|
*/
|
|
236
407
|
selected?: boolean;
|
|
237
408
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.66.
|
|
7
|
+
"version": "1.66.50",
|
|
8
8
|
"description": "Models for 📣 stentor",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"typings": "lib/index",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@xapp/patterns": "2.0.2"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "a1e5a5a989e154a4e0bdd615c077f2062ffd2d5a"
|
|
37
37
|
}
|