tyrell-components 1.0.0-TC57 → 1.0.0-TC59
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/css/tyrell-colors-static.css +14 -0
- package/css/tyrell-theme.css +1 -0
- package/css/tyrell.css +8 -6
- package/dist/tyrell-colors-static.css +1 -1
- package/dist/tyrell-theme.css +1 -1
- package/dist/tyrell.js +1 -1
- package/lib/base/ty-component.d.ts +20 -15
- package/lib/base/ty-component.js +58 -25
- package/lib/components/button.d.ts +14 -0
- package/lib/components/button.js +55 -7
- package/lib/components/calendar-month.d.ts +7 -1
- package/lib/components/calendar-month.js +35 -28
- package/lib/components/calendar-navigation.js +19 -6
- package/lib/components/calendar.d.ts +25 -4
- package/lib/components/calendar.js +98 -67
- package/lib/components/checkbox.d.ts +6 -1
- package/lib/components/checkbox.js +20 -6
- package/lib/components/copy.d.ts +2 -0
- package/lib/components/copy.js +15 -31
- package/lib/components/date-picker.d.ts +52 -19
- package/lib/components/date-picker.js +211 -147
- package/lib/components/file-upload.d.ts +2 -1
- package/lib/components/file-upload.js +8 -3
- package/lib/components/input.d.ts +4 -6
- package/lib/components/input.js +37 -62
- package/lib/components/modal.js +86 -9
- package/lib/components/option.js +2 -5
- package/lib/components/popup.js +99 -11
- package/lib/components/radio.d.ts +8 -1
- package/lib/components/radio.js +14 -29
- package/lib/components/resize-observer.js +2 -0
- package/lib/components/scroll-container.js +2 -0
- package/lib/components/select.d.ts +53 -6
- package/lib/components/select.js +127 -29
- package/lib/components/switch.d.ts +7 -1
- package/lib/components/switch.js +20 -6
- package/lib/components/tabs.js +1 -1
- package/lib/components/textarea.d.ts +45 -4
- package/lib/components/textarea.js +75 -18
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/styles/button.js +21 -19
- package/lib/styles/calendar-month.js +1 -1
- package/lib/styles/calendar.js +3 -0
- package/lib/styles/checkbox.js +11 -5
- package/lib/styles/date-picker.js +15 -3
- package/lib/styles/input.js +5 -9
- package/lib/styles/option.d.ts +1 -1
- package/lib/styles/option.js +4 -0
- package/lib/styles/popup.d.ts +1 -1
- package/lib/styles/popup.js +2 -0
- package/lib/styles/radio.js +10 -4
- package/lib/styles/select-base.js +24 -3
- package/lib/styles/select.d.ts +1 -1
- package/lib/styles/select.js +4 -0
- package/lib/styles/switch.js +10 -5
- package/lib/styles/tag.js +2 -1
- package/lib/styles/textarea.d.ts +1 -1
- package/lib/styles/textarea.js +7 -0
- package/lib/utils/calendar-utils.d.ts +49 -0
- package/lib/utils/calendar-utils.js +63 -6
- package/lib/utils/scroll-lock.d.ts +10 -4
- package/lib/utils/scroll-lock.js +102 -2
- package/lib/utils/upgrade-properties.d.ts +21 -0
- package/lib/utils/upgrade-properties.js +47 -0
- package/lib/utils/validity.d.ts +89 -5
- package/lib/utils/validity.js +198 -25
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -1
- package/lib/base/ty-component.d.ts.map +0 -1
- package/lib/base/ty-component.js.map +0 -1
- package/lib/components/button.d.ts.map +0 -1
- package/lib/components/button.js.map +0 -1
- package/lib/components/calendar-month.d.ts.map +0 -1
- package/lib/components/calendar-month.js.map +0 -1
- package/lib/components/calendar-navigation.d.ts.map +0 -1
- package/lib/components/calendar-navigation.js.map +0 -1
- package/lib/components/calendar.d.ts.map +0 -1
- package/lib/components/calendar.js.map +0 -1
- package/lib/components/checkbox.d.ts.map +0 -1
- package/lib/components/checkbox.js.map +0 -1
- package/lib/components/copy.d.ts.map +0 -1
- package/lib/components/copy.js.map +0 -1
- package/lib/components/date-picker.d.ts.map +0 -1
- package/lib/components/date-picker.js.map +0 -1
- package/lib/components/dropdown.d.ts +0 -403
- package/lib/components/dropdown.d.ts.map +0 -1
- package/lib/components/dropdown.js +0 -1315
- package/lib/components/dropdown.js.map +0 -1
- package/lib/components/icon.d.ts.map +0 -1
- package/lib/components/icon.js.map +0 -1
- package/lib/components/input.d.ts.map +0 -1
- package/lib/components/input.js.map +0 -1
- package/lib/components/modal.d.ts.map +0 -1
- package/lib/components/modal.js.map +0 -1
- package/lib/components/multiselect.d.ts +0 -389
- package/lib/components/multiselect.d.ts.map +0 -1
- package/lib/components/multiselect.js +0 -1301
- package/lib/components/multiselect.js.map +0 -1
- package/lib/components/option.d.ts.map +0 -1
- package/lib/components/option.js.map +0 -1
- package/lib/components/popup.d.ts.map +0 -1
- package/lib/components/popup.js.map +0 -1
- package/lib/components/resize-observer.d.ts.map +0 -1
- package/lib/components/resize-observer.js.map +0 -1
- package/lib/components/scroll-container.d.ts.map +0 -1
- package/lib/components/scroll-container.js.map +0 -1
- package/lib/components/step.d.ts.map +0 -1
- package/lib/components/step.js.map +0 -1
- package/lib/components/tab.d.ts.map +0 -1
- package/lib/components/tab.js.map +0 -1
- package/lib/components/tabs.d.ts.map +0 -1
- package/lib/components/tabs.js.map +0 -1
- package/lib/components/tag.d.ts.map +0 -1
- package/lib/components/tag.js.map +0 -1
- package/lib/components/textarea.d.ts.map +0 -1
- package/lib/components/textarea.js.map +0 -1
- package/lib/components/tooltip.d.ts.map +0 -1
- package/lib/components/tooltip.js.map +0 -1
- package/lib/components/wizard.d.ts.map +0 -1
- package/lib/components/wizard.js.map +0 -1
- package/lib/icons/fontawesome/brands.d.ts.map +0 -1
- package/lib/icons/fontawesome/brands.js.map +0 -1
- package/lib/icons/fontawesome/regular.d.ts.map +0 -1
- package/lib/icons/fontawesome/regular.js.map +0 -1
- package/lib/icons/fontawesome/solid.d.ts.map +0 -1
- package/lib/icons/fontawesome/solid.js.map +0 -1
- package/lib/icons/heroicons/micro.d.ts.map +0 -1
- package/lib/icons/heroicons/micro.js.map +0 -1
- package/lib/icons/heroicons/mini.d.ts.map +0 -1
- package/lib/icons/heroicons/mini.js.map +0 -1
- package/lib/icons/heroicons/outline.d.ts.map +0 -1
- package/lib/icons/heroicons/outline.js.map +0 -1
- package/lib/icons/heroicons/solid.d.ts.map +0 -1
- package/lib/icons/heroicons/solid.js.map +0 -1
- package/lib/icons/lucide.d.ts.map +0 -1
- package/lib/icons/lucide.js.map +0 -1
- package/lib/icons/material/filled.d.ts.map +0 -1
- package/lib/icons/material/filled.js.map +0 -1
- package/lib/icons/material/outlined.d.ts.map +0 -1
- package/lib/icons/material/outlined.js.map +0 -1
- package/lib/icons/material/round.d.ts.map +0 -1
- package/lib/icons/material/round.js.map +0 -1
- package/lib/icons/material/sharp.d.ts.map +0 -1
- package/lib/icons/material/sharp.js.map +0 -1
- package/lib/icons/material/two-tone.d.ts.map +0 -1
- package/lib/icons/material/two-tone.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/styles/button.d.ts.map +0 -1
- package/lib/styles/button.js.map +0 -1
- package/lib/styles/calendar-month.d.ts.map +0 -1
- package/lib/styles/calendar-month.js.map +0 -1
- package/lib/styles/calendar-navigation.d.ts.map +0 -1
- package/lib/styles/calendar-navigation.js.map +0 -1
- package/lib/styles/calendar.d.ts.map +0 -1
- package/lib/styles/calendar.js.map +0 -1
- package/lib/styles/copy.d.ts.map +0 -1
- package/lib/styles/copy.js.map +0 -1
- package/lib/styles/date-picker.d.ts.map +0 -1
- package/lib/styles/date-picker.js.map +0 -1
- package/lib/styles/dropdown.d.ts +0 -12
- package/lib/styles/dropdown.d.ts.map +0 -1
- package/lib/styles/dropdown.js +0 -725
- package/lib/styles/dropdown.js.map +0 -1
- package/lib/styles/icon.d.ts.map +0 -1
- package/lib/styles/icon.js.map +0 -1
- package/lib/styles/input.d.ts.map +0 -1
- package/lib/styles/input.js.map +0 -1
- package/lib/styles/modal.d.ts.map +0 -1
- package/lib/styles/modal.js.map +0 -1
- package/lib/styles/multiselect.d.ts +0 -6
- package/lib/styles/multiselect.d.ts.map +0 -1
- package/lib/styles/multiselect.js +0 -568
- package/lib/styles/multiselect.js.map +0 -1
- package/lib/styles/option.d.ts.map +0 -1
- package/lib/styles/option.js.map +0 -1
- package/lib/styles/popup.d.ts.map +0 -1
- package/lib/styles/popup.js.map +0 -1
- package/lib/styles/resize-observer.d.ts.map +0 -1
- package/lib/styles/resize-observer.js.map +0 -1
- package/lib/styles/scroll-container.d.ts.map +0 -1
- package/lib/styles/scroll-container.js.map +0 -1
- package/lib/styles/step.d.ts.map +0 -1
- package/lib/styles/step.js.map +0 -1
- package/lib/styles/tab.d.ts.map +0 -1
- package/lib/styles/tab.js.map +0 -1
- package/lib/styles/tabs.d.ts.map +0 -1
- package/lib/styles/tabs.js.map +0 -1
- package/lib/styles/tag.d.ts.map +0 -1
- package/lib/styles/tag.js.map +0 -1
- package/lib/styles/textarea.d.ts.map +0 -1
- package/lib/styles/textarea.js.map +0 -1
- package/lib/styles/tooltip.d.ts.map +0 -1
- package/lib/styles/tooltip.js.map +0 -1
- package/lib/styles/wizard.d.ts.map +0 -1
- package/lib/styles/wizard.js.map +0 -1
- package/lib/types/common.d.ts.map +0 -1
- package/lib/types/common.js.map +0 -1
- package/lib/utils/calendar-utils.d.ts.map +0 -1
- package/lib/utils/calendar-utils.js.map +0 -1
- package/lib/utils/icon-registry.d.ts.map +0 -1
- package/lib/utils/icon-registry.js.map +0 -1
- package/lib/utils/locale.d.ts.map +0 -1
- package/lib/utils/locale.js.map +0 -1
- package/lib/utils/number-format.d.ts.map +0 -1
- package/lib/utils/number-format.js.map +0 -1
- package/lib/utils/parse-boolean.d.ts +0 -39
- package/lib/utils/parse-boolean.d.ts.map +0 -1
- package/lib/utils/parse-boolean.js +0 -23
- package/lib/utils/parse-boolean.js.map +0 -1
- package/lib/utils/positioning.d.ts.map +0 -1
- package/lib/utils/positioning.js.map +0 -1
- package/lib/utils/property-capture.d.ts.map +0 -1
- package/lib/utils/property-capture.js.map +0 -1
- package/lib/utils/property-manager.d.ts.map +0 -1
- package/lib/utils/property-manager.js.map +0 -1
- package/lib/utils/resize-observer.d.ts.map +0 -1
- package/lib/utils/resize-observer.js.map +0 -1
- package/lib/utils/scroll-lock.d.ts.map +0 -1
- package/lib/utils/scroll-lock.js.map +0 -1
- package/lib/utils/styles.d.ts.map +0 -1
- package/lib/utils/styles.js.map +0 -1
- package/lib/version.d.ts.map +0 -1
- package/lib/version.js.map +0 -1
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TyDatePicker Web Component — read-only input stub + calendar dropdown
|
|
3
3
|
* (modal <dialog>), optional time input, form participation via
|
|
4
|
-
* ElementInternals. Value is UTC
|
|
4
|
+
* ElementInternals. Value is a UTC instant (wall-clock with `native`);
|
|
5
|
+
* display is local.
|
|
5
6
|
*/
|
|
6
7
|
import { type Placement } from '../utils/positioning.js';
|
|
7
8
|
import { TyComponent } from '../base/ty-component.js';
|
|
8
9
|
import type { Flavor } from '../types/common.js';
|
|
9
10
|
import type { PropertyChange } from '../utils/property-manager.js';
|
|
10
|
-
|
|
11
|
-
* Date components (internal representation in local timezone)
|
|
12
|
-
*/
|
|
13
|
-
interface DateComponents {
|
|
14
|
-
year?: number;
|
|
15
|
-
month?: number;
|
|
16
|
-
day?: number;
|
|
17
|
-
hour?: number;
|
|
18
|
-
minute?: number;
|
|
19
|
-
}
|
|
11
|
+
import { type DateTimeParts } from '../utils/calendar-utils.js';
|
|
20
12
|
/**
|
|
21
13
|
* Internal date picker state
|
|
22
14
|
*/
|
|
23
|
-
interface DatePickerState extends
|
|
15
|
+
interface DatePickerState extends DateTimeParts {
|
|
24
16
|
withTime: boolean;
|
|
25
17
|
open: boolean;
|
|
26
18
|
}
|
|
@@ -99,6 +91,11 @@ export declare class TyDatePicker extends TyComponent<DatePickerState> {
|
|
|
99
91
|
visual: boolean;
|
|
100
92
|
default: boolean;
|
|
101
93
|
};
|
|
94
|
+
error: {
|
|
95
|
+
type: "string";
|
|
96
|
+
visual: boolean;
|
|
97
|
+
default: string;
|
|
98
|
+
};
|
|
102
99
|
format: {
|
|
103
100
|
type: "string";
|
|
104
101
|
visual: boolean;
|
|
@@ -123,12 +120,19 @@ export declare class TyDatePicker extends TyComponent<DatePickerState> {
|
|
|
123
120
|
visual: boolean;
|
|
124
121
|
default: boolean;
|
|
125
122
|
};
|
|
123
|
+
native: {
|
|
124
|
+
type: "boolean";
|
|
125
|
+
visual: boolean;
|
|
126
|
+
default: boolean;
|
|
127
|
+
};
|
|
126
128
|
};
|
|
127
129
|
private _state;
|
|
128
130
|
private _clickListener?;
|
|
129
131
|
private _keydownListener?;
|
|
130
132
|
private _dialogClickListener?;
|
|
131
133
|
private _closeTimestamp;
|
|
134
|
+
private _initialized;
|
|
135
|
+
private _syncing;
|
|
132
136
|
private _timeInput?;
|
|
133
137
|
private _localeObserver?;
|
|
134
138
|
private _customFlavorSheet;
|
|
@@ -142,16 +146,21 @@ export declare class TyDatePicker extends TyComponent<DatePickerState> {
|
|
|
142
146
|
/** Handle state updates BEFORE render. */
|
|
143
147
|
protected onPropertiesChanged(changes: PropertyChange[]): void;
|
|
144
148
|
/**
|
|
145
|
-
* Get form value -
|
|
146
|
-
* TyComponent calls this automatically when
|
|
149
|
+
* Get form value - the submitted string from current state (see
|
|
150
|
+
* componentsToOutputValue). TyComponent calls this automatically when the
|
|
151
|
+
* value property changes.
|
|
147
152
|
*/
|
|
148
153
|
protected getFormValue(): FormDataEntryValue | null;
|
|
154
|
+
private outputValue;
|
|
149
155
|
protected updateFormValue(): void;
|
|
150
|
-
/**
|
|
156
|
+
/** The field's focusable element: the stub, or the native input on touch devices. */
|
|
157
|
+
private focusTarget;
|
|
158
|
+
/** Focus the field: the host itself isn't focusable. Disabled: nothing, like a native input. */
|
|
151
159
|
focus(options?: FocusOptions): void;
|
|
152
160
|
/**
|
|
153
161
|
* `required` used to be cosmetic: nothing reported valueMissing, so an empty
|
|
154
162
|
* required picker never blocked its form. Disabled pickers don't validate.
|
|
163
|
+
* The message is a native date (datetime-local with time) input's.
|
|
155
164
|
*/
|
|
156
165
|
private updateValidity;
|
|
157
166
|
private getComponents;
|
|
@@ -208,17 +217,23 @@ export declare class TyDatePicker extends TyComponent<DatePickerState> {
|
|
|
208
217
|
set max(v: string);
|
|
209
218
|
get withTime(): boolean;
|
|
210
219
|
set withTime(v: boolean);
|
|
220
|
+
get native(): boolean;
|
|
221
|
+
set native(v: boolean);
|
|
222
|
+
get error(): string;
|
|
223
|
+
set error(v: string);
|
|
211
224
|
/**
|
|
212
|
-
* Get current value
|
|
225
|
+
* Get current value — the string the form submits: a UTC ISO instant, or
|
|
226
|
+
* wall-clock ('YYYY-MM-DD' / 'YYYY-MM-DDTHH:mm') with `native`. null when
|
|
227
|
+
* empty (the form then submits name=, like a native date input).
|
|
213
228
|
*/
|
|
214
229
|
get value(): string | null;
|
|
215
230
|
/**
|
|
216
|
-
* Set value (
|
|
231
|
+
* Set value: any format parseDateTime() reads, a Date, epoch milliseconds,
|
|
232
|
+
* or null. It's normalized to the submitted form.
|
|
217
233
|
*
|
|
218
234
|
* When set to null/undefined/empty string, the attribute is removed.
|
|
219
|
-
* When set to a valid date, the attribute is set to ISO UTC string.
|
|
220
235
|
*/
|
|
221
|
-
set value(val: string | Date | null);
|
|
236
|
+
set value(val: string | number | Date | null);
|
|
222
237
|
/**
|
|
223
238
|
* Clear the date value programmatically WITH a change event (source:
|
|
224
239
|
* 'clear'). Works regardless of `no-clear` — lets any
|
|
@@ -232,15 +247,33 @@ export declare class TyDatePicker extends TyComponent<DatePickerState> {
|
|
|
232
247
|
/** Footer: clock + "Time" on the left, HH : MM on the right, summary below. */
|
|
233
248
|
private renderTimeSection;
|
|
234
249
|
private renderCalendarDropdown;
|
|
250
|
+
/**
|
|
251
|
+
* Match the popup calendar to the stub's look: danger while an error
|
|
252
|
+
* shows, as on the stub (styles: errorLook), else the user's flavor.
|
|
253
|
+
* 'default' is the stub's own unstyled state, not a real flavor: the
|
|
254
|
+
* calendar stays on its own default.
|
|
255
|
+
*/
|
|
256
|
+
private calendarFlavor;
|
|
235
257
|
/**
|
|
236
258
|
* Render native date input for mobile touch devices.
|
|
237
259
|
* Uses <input type="date"> or <input type="datetime-local"> when with-time.
|
|
238
260
|
* Reuses .date-picker-stub styling and existing event/state infrastructure.
|
|
239
261
|
*/
|
|
240
262
|
private renderNativeInput;
|
|
263
|
+
/**
|
|
264
|
+
* The touch devices' native input follows the picker: type (date, or
|
|
265
|
+
* datetime-local with time), disabled, required, min/max (datetime-local
|
|
266
|
+
* wants a time suffix) and value — also when they change at runtime.
|
|
267
|
+
*/
|
|
268
|
+
private syncNativeInput;
|
|
241
269
|
private calculateCalendarPosition;
|
|
242
270
|
private renderContainer;
|
|
243
271
|
protected render(): void;
|
|
272
|
+
/**
|
|
273
|
+
* The `error` line under the field — same markup as ty-input's; the field
|
|
274
|
+
* (stub, or the native input on touch devices) is described by it.
|
|
275
|
+
*/
|
|
276
|
+
private syncErrorLine;
|
|
244
277
|
/**
|
|
245
278
|
* Update display without destroying DOM (for open dialog)
|
|
246
279
|
*/
|