tyrell-components 1.0.0-RC10
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/LICENSE +21 -0
- package/README.md +221 -0
- package/css/tyrell-brand.css +767 -0
- package/css/tyrell.css +1679 -0
- package/dist/tyrell-brand.css +767 -0
- package/dist/tyrell.css +1679 -0
- package/dist/tyrell.js +2 -0
- package/lib/base/ty-component.d.ts +133 -0
- package/lib/base/ty-component.d.ts.map +1 -0
- package/lib/base/ty-component.js +297 -0
- package/lib/base/ty-component.js.map +1 -0
- package/lib/components/button.d.ts +135 -0
- package/lib/components/button.d.ts.map +1 -0
- package/lib/components/button.js +277 -0
- package/lib/components/button.js.map +1 -0
- package/lib/components/calendar-month.d.ts +132 -0
- package/lib/components/calendar-month.d.ts.map +1 -0
- package/lib/components/calendar-month.js +440 -0
- package/lib/components/calendar-month.js.map +1 -0
- package/lib/components/calendar-navigation.d.ts +137 -0
- package/lib/components/calendar-navigation.d.ts.map +1 -0
- package/lib/components/calendar-navigation.js +366 -0
- package/lib/components/calendar-navigation.js.map +1 -0
- package/lib/components/calendar.d.ts +166 -0
- package/lib/components/calendar.d.ts.map +1 -0
- package/lib/components/calendar.js +774 -0
- package/lib/components/calendar.js.map +1 -0
- package/lib/components/checkbox.d.ts +189 -0
- package/lib/components/checkbox.d.ts.map +1 -0
- package/lib/components/checkbox.js +400 -0
- package/lib/components/checkbox.js.map +1 -0
- package/lib/components/copy.d.ts +180 -0
- package/lib/components/copy.d.ts.map +1 -0
- package/lib/components/copy.js +393 -0
- package/lib/components/copy.js.map +1 -0
- package/lib/components/date-picker.d.ts +379 -0
- package/lib/components/date-picker.d.ts.map +1 -0
- package/lib/components/date-picker.js +1586 -0
- package/lib/components/date-picker.js.map +1 -0
- package/lib/components/dropdown.d.ts +424 -0
- package/lib/components/dropdown.d.ts.map +1 -0
- package/lib/components/dropdown.js +1640 -0
- package/lib/components/dropdown.js.map +1 -0
- package/lib/components/file-upload.d.ts +121 -0
- package/lib/components/file-upload.d.ts.map +1 -0
- package/lib/components/file-upload.js +441 -0
- package/lib/components/file-upload.js.map +1 -0
- package/lib/components/icon.d.ts +118 -0
- package/lib/components/icon.d.ts.map +1 -0
- package/lib/components/icon.js +245 -0
- package/lib/components/icon.js.map +1 -0
- package/lib/components/input.d.ts +270 -0
- package/lib/components/input.d.ts.map +1 -0
- package/lib/components/input.js +721 -0
- package/lib/components/input.js.map +1 -0
- package/lib/components/modal.d.ts +78 -0
- package/lib/components/modal.d.ts.map +1 -0
- package/lib/components/modal.js +497 -0
- package/lib/components/modal.js.map +1 -0
- package/lib/components/multiselect.d.ts +397 -0
- package/lib/components/multiselect.d.ts.map +1 -0
- package/lib/components/multiselect.js +1595 -0
- package/lib/components/multiselect.js.map +1 -0
- package/lib/components/option.d.ts +66 -0
- package/lib/components/option.d.ts.map +1 -0
- package/lib/components/option.js +314 -0
- package/lib/components/option.js.map +1 -0
- package/lib/components/popup.d.ts +43 -0
- package/lib/components/popup.d.ts.map +1 -0
- package/lib/components/popup.js +380 -0
- package/lib/components/popup.js.map +1 -0
- package/lib/components/radio.d.ts +198 -0
- package/lib/components/radio.d.ts.map +1 -0
- package/lib/components/radio.js +437 -0
- package/lib/components/radio.js.map +1 -0
- package/lib/components/resize-observer.d.ts +48 -0
- package/lib/components/resize-observer.d.ts.map +1 -0
- package/lib/components/resize-observer.js +108 -0
- package/lib/components/resize-observer.js.map +1 -0
- package/lib/components/scroll-container.d.ts +51 -0
- package/lib/components/scroll-container.d.ts.map +1 -0
- package/lib/components/scroll-container.js +239 -0
- package/lib/components/scroll-container.js.map +1 -0
- package/lib/components/step.d.ts +26 -0
- package/lib/components/step.d.ts.map +1 -0
- package/lib/components/step.js +75 -0
- package/lib/components/step.js.map +1 -0
- package/lib/components/switch.d.ts +111 -0
- package/lib/components/switch.d.ts.map +1 -0
- package/lib/components/switch.js +240 -0
- package/lib/components/switch.js.map +1 -0
- package/lib/components/tab.d.ts +23 -0
- package/lib/components/tab.d.ts.map +1 -0
- package/lib/components/tab.js +76 -0
- package/lib/components/tab.js.map +1 -0
- package/lib/components/tabs.d.ts +93 -0
- package/lib/components/tabs.d.ts.map +1 -0
- package/lib/components/tabs.js +653 -0
- package/lib/components/tabs.js.map +1 -0
- package/lib/components/tag.d.ts +144 -0
- package/lib/components/tag.d.ts.map +1 -0
- package/lib/components/tag.js +316 -0
- package/lib/components/tag.js.map +1 -0
- package/lib/components/textarea.d.ts +241 -0
- package/lib/components/textarea.d.ts.map +1 -0
- package/lib/components/textarea.js +585 -0
- package/lib/components/textarea.js.map +1 -0
- package/lib/components/tooltip.d.ts +40 -0
- package/lib/components/tooltip.d.ts.map +1 -0
- package/lib/components/tooltip.js +439 -0
- package/lib/components/tooltip.js.map +1 -0
- package/lib/components/wizard.d.ts +86 -0
- package/lib/components/wizard.d.ts.map +1 -0
- package/lib/components/wizard.js +636 -0
- package/lib/components/wizard.js.map +1 -0
- package/lib/icons/fontawesome/brands.d.ts +557 -0
- package/lib/icons/fontawesome/brands.d.ts.map +1 -0
- package/lib/icons/fontawesome/brands.js +557 -0
- package/lib/icons/fontawesome/brands.js.map +1 -0
- package/lib/icons/fontawesome/regular.d.ts +281 -0
- package/lib/icons/fontawesome/regular.d.ts.map +1 -0
- package/lib/icons/fontawesome/regular.js +281 -0
- package/lib/icons/fontawesome/regular.js.map +1 -0
- package/lib/icons/fontawesome/solid.d.ts +1992 -0
- package/lib/icons/fontawesome/solid.d.ts.map +1 -0
- package/lib/icons/fontawesome/solid.js +1992 -0
- package/lib/icons/fontawesome/solid.js.map +1 -0
- package/lib/icons/heroicons/micro.d.ts +324 -0
- package/lib/icons/heroicons/micro.d.ts.map +1 -0
- package/lib/icons/heroicons/micro.js +1032 -0
- package/lib/icons/heroicons/micro.js.map +1 -0
- package/lib/icons/heroicons/mini.d.ts +332 -0
- package/lib/icons/heroicons/mini.d.ts.map +1 -0
- package/lib/icons/heroicons/mini.js +1038 -0
- package/lib/icons/heroicons/mini.js.map +1 -0
- package/lib/icons/heroicons/outline.d.ts +332 -0
- package/lib/icons/heroicons/outline.d.ts.map +1 -0
- package/lib/icons/heroicons/outline.js +993 -0
- package/lib/icons/heroicons/outline.js.map +1 -0
- package/lib/icons/heroicons/solid.d.ts +332 -0
- package/lib/icons/heroicons/solid.d.ts.map +1 -0
- package/lib/icons/heroicons/solid.js +1063 -0
- package/lib/icons/heroicons/solid.js.map +1 -0
- package/lib/icons/lucide.d.ts +1872 -0
- package/lib/icons/lucide.d.ts.map +1 -0
- package/lib/icons/lucide.js +28212 -0
- package/lib/icons/lucide.js.map +1 -0
- package/lib/icons/material/filled.d.ts +2180 -0
- package/lib/icons/material/filled.d.ts.map +1 -0
- package/lib/icons/material/filled.js +14003 -0
- package/lib/icons/material/filled.js.map +1 -0
- package/lib/icons/material/outlined.d.ts +2142 -0
- package/lib/icons/material/outlined.d.ts.map +1 -0
- package/lib/icons/material/outlined.js +14545 -0
- package/lib/icons/material/outlined.js.map +1 -0
- package/lib/icons/material/round.d.ts +2147 -0
- package/lib/icons/material/round.d.ts.map +1 -0
- package/lib/icons/material/round.js +14779 -0
- package/lib/icons/material/round.js.map +1 -0
- package/lib/icons/material/sharp.d.ts +2147 -0
- package/lib/icons/material/sharp.d.ts.map +1 -0
- package/lib/icons/material/sharp.js +14189 -0
- package/lib/icons/material/sharp.js.map +1 -0
- package/lib/icons/material/two-tone.d.ts +2185 -0
- package/lib/icons/material/two-tone.d.ts.map +1 -0
- package/lib/icons/material/two-tone.js +17152 -0
- package/lib/icons/material/two-tone.js.map +1 -0
- package/lib/index.d.ts +86 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +78 -0
- package/lib/index.js.map +1 -0
- package/lib/styles/button.d.ts +14 -0
- package/lib/styles/button.d.ts.map +1 -0
- package/lib/styles/button.js +498 -0
- package/lib/styles/button.js.map +1 -0
- package/lib/styles/calendar-month.d.ts +6 -0
- package/lib/styles/calendar-month.d.ts.map +1 -0
- package/lib/styles/calendar-month.js +275 -0
- package/lib/styles/calendar-month.js.map +1 -0
- package/lib/styles/calendar-navigation.d.ts +6 -0
- package/lib/styles/calendar-navigation.d.ts.map +1 -0
- package/lib/styles/calendar-navigation.js +143 -0
- package/lib/styles/calendar-navigation.js.map +1 -0
- package/lib/styles/calendar.d.ts +6 -0
- package/lib/styles/calendar.d.ts.map +1 -0
- package/lib/styles/calendar.js +28 -0
- package/lib/styles/calendar.js.map +1 -0
- package/lib/styles/checkbox.d.ts +9 -0
- package/lib/styles/checkbox.d.ts.map +1 -0
- package/lib/styles/checkbox.js +19 -0
- package/lib/styles/checkbox.js.map +1 -0
- package/lib/styles/copy.d.ts +7 -0
- package/lib/styles/copy.d.ts.map +1 -0
- package/lib/styles/copy.js +94 -0
- package/lib/styles/copy.js.map +1 -0
- package/lib/styles/custom-scrollbar.d.ts +6 -0
- package/lib/styles/custom-scrollbar.d.ts.map +1 -0
- package/lib/styles/custom-scrollbar.js +157 -0
- package/lib/styles/custom-scrollbar.js.map +1 -0
- package/lib/styles/date-picker.d.ts +6 -0
- package/lib/styles/date-picker.d.ts.map +1 -0
- package/lib/styles/date-picker.js +438 -0
- package/lib/styles/date-picker.js.map +1 -0
- package/lib/styles/dropdown.d.ts +12 -0
- package/lib/styles/dropdown.d.ts.map +1 -0
- package/lib/styles/dropdown.js +1081 -0
- package/lib/styles/dropdown.js.map +1 -0
- package/lib/styles/file-upload.d.ts +2 -0
- package/lib/styles/file-upload.d.ts.map +1 -0
- package/lib/styles/file-upload.js +241 -0
- package/lib/styles/file-upload.js.map +1 -0
- package/lib/styles/icon.d.ts +6 -0
- package/lib/styles/icon.d.ts.map +1 -0
- package/lib/styles/icon.js +241 -0
- package/lib/styles/icon.js.map +1 -0
- package/lib/styles/input.d.ts +7 -0
- package/lib/styles/input.d.ts.map +1 -0
- package/lib/styles/input.js +685 -0
- package/lib/styles/input.js.map +1 -0
- package/lib/styles/modal.d.ts +8 -0
- package/lib/styles/modal.d.ts.map +1 -0
- package/lib/styles/modal.js +134 -0
- package/lib/styles/modal.js.map +1 -0
- package/lib/styles/multiselect.d.ts +6 -0
- package/lib/styles/multiselect.d.ts.map +1 -0
- package/lib/styles/multiselect.js +825 -0
- package/lib/styles/multiselect.js.map +1 -0
- package/lib/styles/option.d.ts +6 -0
- package/lib/styles/option.d.ts.map +1 -0
- package/lib/styles/option.js +116 -0
- package/lib/styles/option.js.map +1 -0
- package/lib/styles/popup.d.ts +8 -0
- package/lib/styles/popup.d.ts.map +1 -0
- package/lib/styles/popup.js +95 -0
- package/lib/styles/popup.js.map +1 -0
- package/lib/styles/radio.d.ts +8 -0
- package/lib/styles/radio.d.ts.map +1 -0
- package/lib/styles/radio.js +160 -0
- package/lib/styles/radio.js.map +1 -0
- package/lib/styles/resize-observer.d.ts +6 -0
- package/lib/styles/resize-observer.d.ts.map +1 -0
- package/lib/styles/resize-observer.js +18 -0
- package/lib/styles/resize-observer.js.map +1 -0
- package/lib/styles/scroll-container.d.ts +6 -0
- package/lib/styles/scroll-container.d.ts.map +1 -0
- package/lib/styles/scroll-container.js +198 -0
- package/lib/styles/scroll-container.js.map +1 -0
- package/lib/styles/step.d.ts +5 -0
- package/lib/styles/step.d.ts.map +1 -0
- package/lib/styles/step.js +50 -0
- package/lib/styles/step.js.map +1 -0
- package/lib/styles/switch.d.ts +9 -0
- package/lib/styles/switch.d.ts.map +1 -0
- package/lib/styles/switch.js +100 -0
- package/lib/styles/switch.js.map +1 -0
- package/lib/styles/tab.d.ts +5 -0
- package/lib/styles/tab.d.ts.map +1 -0
- package/lib/styles/tab.js +51 -0
- package/lib/styles/tab.js.map +1 -0
- package/lib/styles/tabs.d.ts +13 -0
- package/lib/styles/tabs.d.ts.map +1 -0
- package/lib/styles/tabs.js +184 -0
- package/lib/styles/tabs.js.map +1 -0
- package/lib/styles/tag.d.ts +6 -0
- package/lib/styles/tag.d.ts.map +1 -0
- package/lib/styles/tag.js +409 -0
- package/lib/styles/tag.js.map +1 -0
- package/lib/styles/textarea.d.ts +6 -0
- package/lib/styles/textarea.d.ts.map +1 -0
- package/lib/styles/textarea.js +350 -0
- package/lib/styles/textarea.js.map +1 -0
- package/lib/styles/tooltip.d.ts +9 -0
- package/lib/styles/tooltip.d.ts.map +1 -0
- package/lib/styles/tooltip.js +133 -0
- package/lib/styles/tooltip.js.map +1 -0
- package/lib/styles/wizard.d.ts +25 -0
- package/lib/styles/wizard.d.ts.map +1 -0
- package/lib/styles/wizard.js +348 -0
- package/lib/styles/wizard.js.map +1 -0
- package/lib/types/common.d.ts +143 -0
- package/lib/types/common.d.ts.map +1 -0
- package/lib/types/common.js +5 -0
- package/lib/types/common.js.map +1 -0
- package/lib/utils/calendar-utils.d.ts +176 -0
- package/lib/utils/calendar-utils.d.ts.map +1 -0
- package/lib/utils/calendar-utils.js +370 -0
- package/lib/utils/calendar-utils.js.map +1 -0
- package/lib/utils/custom-scrollbar.d.ts +82 -0
- package/lib/utils/custom-scrollbar.d.ts.map +1 -0
- package/lib/utils/custom-scrollbar.js +320 -0
- package/lib/utils/custom-scrollbar.js.map +1 -0
- package/lib/utils/icon-registry.d.ts +78 -0
- package/lib/utils/icon-registry.d.ts.map +1 -0
- package/lib/utils/icon-registry.js +304 -0
- package/lib/utils/icon-registry.js.map +1 -0
- package/lib/utils/loader-registry.d.ts +35 -0
- package/lib/utils/loader-registry.d.ts.map +1 -0
- package/lib/utils/loader-registry.js +43 -0
- package/lib/utils/loader-registry.js.map +1 -0
- package/lib/utils/locale.d.ts +136 -0
- package/lib/utils/locale.d.ts.map +1 -0
- package/lib/utils/locale.js +213 -0
- package/lib/utils/locale.js.map +1 -0
- package/lib/utils/mobile.d.ts +14 -0
- package/lib/utils/mobile.d.ts.map +1 -0
- package/lib/utils/mobile.js +21 -0
- package/lib/utils/mobile.js.map +1 -0
- package/lib/utils/number-format.d.ts +83 -0
- package/lib/utils/number-format.d.ts.map +1 -0
- package/lib/utils/number-format.js +143 -0
- package/lib/utils/number-format.js.map +1 -0
- package/lib/utils/parse-boolean.d.ts +39 -0
- package/lib/utils/parse-boolean.d.ts.map +1 -0
- package/lib/utils/parse-boolean.js +58 -0
- package/lib/utils/parse-boolean.js.map +1 -0
- package/lib/utils/positioning.d.ts +143 -0
- package/lib/utils/positioning.d.ts.map +1 -0
- package/lib/utils/positioning.js +308 -0
- package/lib/utils/positioning.js.map +1 -0
- package/lib/utils/property-capture.d.ts +132 -0
- package/lib/utils/property-capture.d.ts.map +1 -0
- package/lib/utils/property-capture.js +152 -0
- package/lib/utils/property-capture.js.map +1 -0
- package/lib/utils/property-manager.d.ts +90 -0
- package/lib/utils/property-manager.d.ts.map +1 -0
- package/lib/utils/property-manager.js +197 -0
- package/lib/utils/property-manager.js.map +1 -0
- package/lib/utils/resize-observer.d.ts +42 -0
- package/lib/utils/resize-observer.d.ts.map +1 -0
- package/lib/utils/resize-observer.js +71 -0
- package/lib/utils/resize-observer.js.map +1 -0
- package/lib/utils/scroll-lock.d.ts +79 -0
- package/lib/utils/scroll-lock.d.ts.map +1 -0
- package/lib/utils/scroll-lock.js +197 -0
- package/lib/utils/scroll-lock.js.map +1 -0
- package/lib/utils/styles.d.ts +27 -0
- package/lib/utils/styles.d.ts.map +1 -0
- package/lib/utils/styles.js +53 -0
- package/lib/utils/styles.js.map +1 -0
- package/lib/version.d.ts +8 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/version.js +11 -0
- package/lib/version.js.map +1 -0
- package/package.json +163 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TyDatePicker Web Component
|
|
3
|
+
* PORTED FROM: cljs/ty/components/date_picker.cljs
|
|
4
|
+
*
|
|
5
|
+
* A date picker component with read-only input and calendar dropdown.
|
|
6
|
+
* Supports date-only and date+time modes with smart time input.
|
|
7
|
+
*
|
|
8
|
+
* Architecture:
|
|
9
|
+
* - Read-only input stub (displays formatted date)
|
|
10
|
+
* - Calendar dropdown (modal dialog with ty-calendar)
|
|
11
|
+
* - Optional time input (with smart digit navigation)
|
|
12
|
+
* - Form participation via ElementInternals
|
|
13
|
+
* - UTC output, local display
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - Date selection with calendar dropdown
|
|
17
|
+
* - Optional time input with smart navigation
|
|
18
|
+
* - Form integration (works with FormData)
|
|
19
|
+
* - UTC value output for server communication
|
|
20
|
+
* - Localized display formatting (Intl API)
|
|
21
|
+
* - Clearable with clear button
|
|
22
|
+
* - Keyboard navigation (Escape to close)
|
|
23
|
+
* - Outside click handling
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html
|
|
27
|
+
* <!-- Basic date picker -->
|
|
28
|
+
* <ty-date-picker
|
|
29
|
+
* label="Select Date"
|
|
30
|
+
* placeholder="Choose a date">
|
|
31
|
+
* </ty-date-picker>
|
|
32
|
+
*
|
|
33
|
+
* <!-- With time -->
|
|
34
|
+
* <ty-date-picker
|
|
35
|
+
* with-time="true"
|
|
36
|
+
* label="Select Date & Time">
|
|
37
|
+
* </ty-date-picker>
|
|
38
|
+
*
|
|
39
|
+
* <!-- Form integration -->
|
|
40
|
+
* <form>
|
|
41
|
+
* <ty-date-picker name="booking-date"></ty-date-picker>
|
|
42
|
+
* <button type="submit">Submit</button>
|
|
43
|
+
* </form>
|
|
44
|
+
*
|
|
45
|
+
* <!-- Pre-filled value (UTC) -->
|
|
46
|
+
* <ty-date-picker value="2024-09-21T08:30:00.000Z"></ty-date-picker>
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
import { TyComponent } from '../base/ty-component.js';
|
|
50
|
+
import type { PropertyChange } from '../utils/property-manager.js';
|
|
51
|
+
/**
|
|
52
|
+
* Date components (internal representation in local timezone)
|
|
53
|
+
*/
|
|
54
|
+
interface DateComponents {
|
|
55
|
+
year?: number;
|
|
56
|
+
month?: number;
|
|
57
|
+
day?: number;
|
|
58
|
+
hour?: number;
|
|
59
|
+
minute?: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Internal date picker state
|
|
63
|
+
*/
|
|
64
|
+
interface DatePickerState extends DateComponents {
|
|
65
|
+
withTime: boolean;
|
|
66
|
+
open: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Date picker sizes
|
|
70
|
+
*/
|
|
71
|
+
type DatePickerSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
72
|
+
/**
|
|
73
|
+
* Date picker flavors (visual styles)
|
|
74
|
+
*/
|
|
75
|
+
type DatePickerFlavor = 'default' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning';
|
|
76
|
+
/**
|
|
77
|
+
* Date format types
|
|
78
|
+
*/
|
|
79
|
+
type DateFormatType = 'short' | 'medium' | 'long' | 'full';
|
|
80
|
+
/**
|
|
81
|
+
* Change event detail
|
|
82
|
+
*/
|
|
83
|
+
export interface DatePickerChangeDetail {
|
|
84
|
+
value: string | null;
|
|
85
|
+
localValue: string | null;
|
|
86
|
+
milliseconds: number | null;
|
|
87
|
+
formatted: string | null;
|
|
88
|
+
source: 'selection' | 'time-change' | 'clear' | 'external';
|
|
89
|
+
}
|
|
90
|
+
export declare class TyDatePicker extends TyComponent<DatePickerState> {
|
|
91
|
+
protected static properties: {
|
|
92
|
+
size: {
|
|
93
|
+
type: "string";
|
|
94
|
+
visual: boolean;
|
|
95
|
+
default: string;
|
|
96
|
+
validate: (v: any) => boolean;
|
|
97
|
+
coerce: (v: any) => any;
|
|
98
|
+
};
|
|
99
|
+
flavor: {
|
|
100
|
+
type: "string";
|
|
101
|
+
visual: boolean;
|
|
102
|
+
default: string;
|
|
103
|
+
};
|
|
104
|
+
label: {
|
|
105
|
+
type: "string";
|
|
106
|
+
visual: boolean;
|
|
107
|
+
default: string;
|
|
108
|
+
};
|
|
109
|
+
placeholder: {
|
|
110
|
+
type: "string";
|
|
111
|
+
visual: boolean;
|
|
112
|
+
default: string;
|
|
113
|
+
};
|
|
114
|
+
name: {
|
|
115
|
+
type: "string";
|
|
116
|
+
visual: boolean;
|
|
117
|
+
default: string;
|
|
118
|
+
};
|
|
119
|
+
required: {
|
|
120
|
+
type: "boolean";
|
|
121
|
+
visual: boolean;
|
|
122
|
+
default: boolean;
|
|
123
|
+
};
|
|
124
|
+
disabled: {
|
|
125
|
+
type: "boolean";
|
|
126
|
+
visual: boolean;
|
|
127
|
+
default: boolean;
|
|
128
|
+
};
|
|
129
|
+
clearable: {
|
|
130
|
+
type: "boolean";
|
|
131
|
+
visual: boolean;
|
|
132
|
+
default: boolean;
|
|
133
|
+
aliases: {
|
|
134
|
+
'not-clearable': boolean;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
format: {
|
|
138
|
+
type: "string";
|
|
139
|
+
visual: boolean;
|
|
140
|
+
default: string;
|
|
141
|
+
validate: (v: any) => boolean;
|
|
142
|
+
coerce: (v: any) => any;
|
|
143
|
+
};
|
|
144
|
+
locale: {
|
|
145
|
+
type: "string";
|
|
146
|
+
visual: boolean;
|
|
147
|
+
default: string;
|
|
148
|
+
};
|
|
149
|
+
value: {
|
|
150
|
+
type: "string";
|
|
151
|
+
visual: boolean;
|
|
152
|
+
formValue: boolean;
|
|
153
|
+
emitChange: boolean;
|
|
154
|
+
default: null;
|
|
155
|
+
};
|
|
156
|
+
'with-time': {
|
|
157
|
+
type: "boolean";
|
|
158
|
+
visual: boolean;
|
|
159
|
+
default: boolean;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
private _state;
|
|
163
|
+
private _clickListener?;
|
|
164
|
+
private _keydownListener?;
|
|
165
|
+
private _dialogClickListener?;
|
|
166
|
+
private _closeTimestamp;
|
|
167
|
+
private _timeInput?;
|
|
168
|
+
private _localeObserver?;
|
|
169
|
+
/**
|
|
170
|
+
* Form-associated custom element
|
|
171
|
+
*/
|
|
172
|
+
static formAssociated: boolean;
|
|
173
|
+
constructor();
|
|
174
|
+
/**
|
|
175
|
+
* Called when component connects to DOM
|
|
176
|
+
* TyComponent handles property capture automatically
|
|
177
|
+
*/
|
|
178
|
+
protected onConnect(): void;
|
|
179
|
+
/**
|
|
180
|
+
* Called when component disconnects from DOM
|
|
181
|
+
*/
|
|
182
|
+
protected onDisconnect(): void;
|
|
183
|
+
/**
|
|
184
|
+
* Called when properties change
|
|
185
|
+
* Handle state updates BEFORE render
|
|
186
|
+
*/
|
|
187
|
+
protected onPropertiesChanged(changes: PropertyChange[]): void;
|
|
188
|
+
/**
|
|
189
|
+
* Get form value - returns UTC string from current state
|
|
190
|
+
* TyComponent calls this automatically when value property changes
|
|
191
|
+
*/
|
|
192
|
+
protected getFormValue(): FormDataEntryValue | null;
|
|
193
|
+
/**
|
|
194
|
+
* Extract current date components from internal state
|
|
195
|
+
*/
|
|
196
|
+
private getComponents;
|
|
197
|
+
/**
|
|
198
|
+
* Whether internal state has a complete date
|
|
199
|
+
*/
|
|
200
|
+
private hasDate;
|
|
201
|
+
/**
|
|
202
|
+
* Format current components for display using Intl API
|
|
203
|
+
*/
|
|
204
|
+
private getFormattedValue;
|
|
205
|
+
/**
|
|
206
|
+
* Initialize component state from attributes
|
|
207
|
+
*
|
|
208
|
+
* PORTED FROM: init-component-state! in date_picker.cljs
|
|
209
|
+
*/
|
|
210
|
+
private initializeState;
|
|
211
|
+
/**
|
|
212
|
+
* Update internal state
|
|
213
|
+
*
|
|
214
|
+
* PORTED FROM: update-component-state! in date_picker.cljs
|
|
215
|
+
*/
|
|
216
|
+
private updateState;
|
|
217
|
+
/**
|
|
218
|
+
* Sync form value with current state
|
|
219
|
+
* Compares before setting to prevent circular triggers
|
|
220
|
+
*/
|
|
221
|
+
private syncFormValue;
|
|
222
|
+
/**
|
|
223
|
+
* Handle time input changes from TimeInput class
|
|
224
|
+
*
|
|
225
|
+
* PORTED FROM: handle-time-change! in date_picker.cljs
|
|
226
|
+
*/
|
|
227
|
+
handleTimeInputChange(hour: number, minute: number): void;
|
|
228
|
+
/**
|
|
229
|
+
* Emit change event
|
|
230
|
+
*
|
|
231
|
+
* PORTED FROM: emit-change-event! in date_picker.cljs
|
|
232
|
+
*/
|
|
233
|
+
private emitChangeEvent;
|
|
234
|
+
get size(): DatePickerSize;
|
|
235
|
+
set size(v: DatePickerSize);
|
|
236
|
+
get flavor(): DatePickerFlavor;
|
|
237
|
+
set flavor(v: DatePickerFlavor);
|
|
238
|
+
get label(): string;
|
|
239
|
+
set label(v: string);
|
|
240
|
+
get placeholder(): string;
|
|
241
|
+
set placeholder(v: string);
|
|
242
|
+
get name(): string;
|
|
243
|
+
set name(v: string);
|
|
244
|
+
get format(): DateFormatType;
|
|
245
|
+
set format(v: DateFormatType);
|
|
246
|
+
get locale(): string;
|
|
247
|
+
set locale(v: string);
|
|
248
|
+
get required(): boolean;
|
|
249
|
+
set required(v: boolean);
|
|
250
|
+
get disabled(): boolean;
|
|
251
|
+
set disabled(v: boolean);
|
|
252
|
+
get clearable(): boolean;
|
|
253
|
+
set clearable(v: boolean);
|
|
254
|
+
get withTime(): boolean;
|
|
255
|
+
set withTime(v: boolean);
|
|
256
|
+
/**
|
|
257
|
+
* Get current value (UTC ISO string)
|
|
258
|
+
*/
|
|
259
|
+
get value(): string | null;
|
|
260
|
+
/**
|
|
261
|
+
* Set value (UTC ISO string, Date object, or null)
|
|
262
|
+
*
|
|
263
|
+
* When set to null/undefined/empty string, the attribute is removed.
|
|
264
|
+
* When set to a valid date, the attribute is set to ISO UTC string.
|
|
265
|
+
*/
|
|
266
|
+
set value(val: string | Date | null);
|
|
267
|
+
/**
|
|
268
|
+
* Build CSS classes for the stub element
|
|
269
|
+
*
|
|
270
|
+
* PORTED FROM: build-stub-classes in date_picker.cljs
|
|
271
|
+
*/
|
|
272
|
+
private buildStubClasses;
|
|
273
|
+
/**
|
|
274
|
+
* Render the date picker stub (input display)
|
|
275
|
+
*
|
|
276
|
+
* PORTED FROM: render-date-picker-stub in date_picker.cljs
|
|
277
|
+
*/
|
|
278
|
+
private renderStub;
|
|
279
|
+
/**
|
|
280
|
+
* Create time input element
|
|
281
|
+
*
|
|
282
|
+
* PORTED FROM: create-time-input in date_picker.cljs
|
|
283
|
+
*/
|
|
284
|
+
private createTimeInputElement;
|
|
285
|
+
/**
|
|
286
|
+
* Render time input section
|
|
287
|
+
*/
|
|
288
|
+
private renderTimeSection;
|
|
289
|
+
/**
|
|
290
|
+
* Render calendar dropdown with dialog
|
|
291
|
+
*
|
|
292
|
+
* PORTED FROM: render-calendar-dropdown in date_picker.cljs
|
|
293
|
+
*/
|
|
294
|
+
private renderCalendarDropdown;
|
|
295
|
+
/**
|
|
296
|
+
* Render native date input for mobile touch devices.
|
|
297
|
+
* Uses <input type="date"> or <input type="datetime-local"> when with-time.
|
|
298
|
+
* Reuses .date-picker-stub styling and existing event/state infrastructure.
|
|
299
|
+
*/
|
|
300
|
+
private renderNativeInput;
|
|
301
|
+
/**
|
|
302
|
+
* Calculate calendar position
|
|
303
|
+
*
|
|
304
|
+
* PORTED FROM: calculate-calendar-position! in date_picker.cljs
|
|
305
|
+
*/
|
|
306
|
+
private calculateCalendarPosition;
|
|
307
|
+
/**
|
|
308
|
+
* Render container structure
|
|
309
|
+
*
|
|
310
|
+
* PORTED FROM: render-container-structure in date_picker.cljs
|
|
311
|
+
*/
|
|
312
|
+
private renderContainer;
|
|
313
|
+
/**
|
|
314
|
+
* Main render method
|
|
315
|
+
*
|
|
316
|
+
* PORTED FROM: render! in date_picker.cljs
|
|
317
|
+
*/
|
|
318
|
+
protected render(): void;
|
|
319
|
+
/**
|
|
320
|
+
* Update display without destroying DOM (for open dialog)
|
|
321
|
+
*
|
|
322
|
+
* PORTED FROM: update-display! in date_picker.cljs
|
|
323
|
+
*/
|
|
324
|
+
private updateDisplay;
|
|
325
|
+
/**
|
|
326
|
+
* Setup document-level event listeners
|
|
327
|
+
*/
|
|
328
|
+
private setupEventListeners;
|
|
329
|
+
private handleStubClick;
|
|
330
|
+
/**
|
|
331
|
+
* Clear the date value, sync state, emit event, and re-render.
|
|
332
|
+
*/
|
|
333
|
+
private clearValue;
|
|
334
|
+
private handleClearClick;
|
|
335
|
+
/**
|
|
336
|
+
* Handle calendar date selection
|
|
337
|
+
*
|
|
338
|
+
* PORTED FROM: handle-calendar-change! in date_picker.cljs
|
|
339
|
+
*/
|
|
340
|
+
private handleCalendarChange;
|
|
341
|
+
/**
|
|
342
|
+
* Handle dialog backdrop clicks
|
|
343
|
+
*
|
|
344
|
+
* PORTED FROM: handle-dialog-click! in date_picker.cljs
|
|
345
|
+
*/
|
|
346
|
+
private handleDialogClick;
|
|
347
|
+
/**
|
|
348
|
+
* Handle clicks outside the date picker
|
|
349
|
+
*
|
|
350
|
+
* PORTED FROM: handle-outside-click! in date_picker.cljs
|
|
351
|
+
*/
|
|
352
|
+
private handleOutsideClick;
|
|
353
|
+
/**
|
|
354
|
+
* Handle Escape key press
|
|
355
|
+
*
|
|
356
|
+
* PORTED FROM: handle-escape-key! in date_picker.cljs
|
|
357
|
+
*/
|
|
358
|
+
private handleEscapeKey;
|
|
359
|
+
/**
|
|
360
|
+
* Open calendar dropdown
|
|
361
|
+
*
|
|
362
|
+
* PORTED FROM: open-dropdown! in date_picker.cljs
|
|
363
|
+
*/
|
|
364
|
+
private openDropdown;
|
|
365
|
+
/**
|
|
366
|
+
* Close calendar dropdown
|
|
367
|
+
*
|
|
368
|
+
* PORTED FROM: close-dropdown! in date_picker.cljs
|
|
369
|
+
*/
|
|
370
|
+
private closeDropdown;
|
|
371
|
+
/**
|
|
372
|
+
* Clean up event listeners and state
|
|
373
|
+
*
|
|
374
|
+
* PORTED FROM: cleanup! in date_picker.cljs
|
|
375
|
+
*/
|
|
376
|
+
private cleanup;
|
|
377
|
+
}
|
|
378
|
+
export {};
|
|
379
|
+
//# sourceMappingURL=date-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../src/components/date-picker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAOH,OAAO,EAAE,WAAW,EAAE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