tyrell-react 1.0.0-TC7
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 +386 -0
- package/dist/components/TyButton.d.ts +50 -0
- package/dist/components/TyButton.d.ts.map +1 -0
- package/dist/components/TyButton.js +63 -0
- package/dist/components/TyButton.js.map +1 -0
- package/dist/components/TyCalendar.d.ts +63 -0
- package/dist/components/TyCalendar.d.ts.map +1 -0
- package/dist/components/TyCalendar.js +122 -0
- package/dist/components/TyCalendar.js.map +1 -0
- package/dist/components/TyCalendarMonth.d.ts +32 -0
- package/dist/components/TyCalendarMonth.d.ts.map +1 -0
- package/dist/components/TyCalendarMonth.js +54 -0
- package/dist/components/TyCalendarMonth.js.map +1 -0
- package/dist/components/TyCalendarNavigation.d.ts +21 -0
- package/dist/components/TyCalendarNavigation.d.ts.map +1 -0
- package/dist/components/TyCalendarNavigation.js +50 -0
- package/dist/components/TyCalendarNavigation.js.map +1 -0
- package/dist/components/TyCheckbox.d.ts +39 -0
- package/dist/components/TyCheckbox.d.ts.map +1 -0
- package/dist/components/TyCheckbox.js +68 -0
- package/dist/components/TyCheckbox.js.map +1 -0
- package/dist/components/TyCopy.d.ts +21 -0
- package/dist/components/TyCopy.d.ts.map +1 -0
- package/dist/components/TyCopy.js +42 -0
- package/dist/components/TyCopy.js.map +1 -0
- package/dist/components/TyDatePicker.d.ts +45 -0
- package/dist/components/TyDatePicker.d.ts.map +1 -0
- package/dist/components/TyDatePicker.js +114 -0
- package/dist/components/TyDatePicker.js.map +1 -0
- package/dist/components/TyDropdown.d.ts +51 -0
- package/dist/components/TyDropdown.d.ts.map +1 -0
- package/dist/components/TyDropdown.js +97 -0
- package/dist/components/TyDropdown.js.map +1 -0
- package/dist/components/TyIcon.d.ts +17 -0
- package/dist/components/TyIcon.d.ts.map +1 -0
- package/dist/components/TyIcon.js +41 -0
- package/dist/components/TyIcon.js.map +1 -0
- package/dist/components/TyInput.d.ts +65 -0
- package/dist/components/TyInput.d.ts.map +1 -0
- package/dist/components/TyInput.js +92 -0
- package/dist/components/TyInput.js.map +1 -0
- package/dist/components/TyModal.d.ts +29 -0
- package/dist/components/TyModal.d.ts.map +1 -0
- package/dist/components/TyModal.js +74 -0
- package/dist/components/TyModal.js.map +1 -0
- package/dist/components/TyMultiselect.d.ts +51 -0
- package/dist/components/TyMultiselect.d.ts.map +1 -0
- package/dist/components/TyMultiselect.js +92 -0
- package/dist/components/TyMultiselect.js.map +1 -0
- package/dist/components/TyOption.d.ts +10 -0
- package/dist/components/TyOption.d.ts.map +1 -0
- package/dist/components/TyOption.js +25 -0
- package/dist/components/TyOption.js.map +1 -0
- package/dist/components/TyPopup.d.ts +24 -0
- package/dist/components/TyPopup.d.ts.map +1 -0
- package/dist/components/TyPopup.js +61 -0
- package/dist/components/TyPopup.js.map +1 -0
- package/dist/components/TyResizeObserver.d.ts +11 -0
- package/dist/components/TyResizeObserver.d.ts.map +1 -0
- package/dist/components/TyResizeObserver.js +28 -0
- package/dist/components/TyResizeObserver.js.map +1 -0
- package/dist/components/TyScrollContainer.d.ts +25 -0
- package/dist/components/TyScrollContainer.d.ts.map +1 -0
- package/dist/components/TyScrollContainer.js +43 -0
- package/dist/components/TyScrollContainer.js.map +1 -0
- package/dist/components/TyStep.d.ts +17 -0
- package/dist/components/TyStep.d.ts.map +1 -0
- package/dist/components/TyStep.js +35 -0
- package/dist/components/TyStep.js.map +1 -0
- package/dist/components/TyTab.d.ts +13 -0
- package/dist/components/TyTab.d.ts.map +1 -0
- package/dist/components/TyTab.js +32 -0
- package/dist/components/TyTab.js.map +1 -0
- package/dist/components/TyTabs.d.ts +23 -0
- package/dist/components/TyTabs.d.ts.map +1 -0
- package/dist/components/TyTabs.js +48 -0
- package/dist/components/TyTabs.js.map +1 -0
- package/dist/components/TyTag.d.ts +22 -0
- package/dist/components/TyTag.d.ts.map +1 -0
- package/dist/components/TyTag.js +45 -0
- package/dist/components/TyTag.js.map +1 -0
- package/dist/components/TyTextarea.d.ts +37 -0
- package/dist/components/TyTextarea.d.ts.map +1 -0
- package/dist/components/TyTextarea.js +83 -0
- package/dist/components/TyTextarea.js.map +1 -0
- package/dist/components/TyTooltip.d.ts +17 -0
- package/dist/components/TyTooltip.d.ts.map +1 -0
- package/dist/components/TyTooltip.js +40 -0
- package/dist/components/TyTooltip.js.map +1 -0
- package/dist/components/TyWizard.d.ts +26 -0
- package/dist/components/TyWizard.d.ts.map +1 -0
- package/dist/components/TyWizard.js +50 -0
- package/dist/components/TyWizard.js.map +1 -0
- package/dist/components/index.d.ts +93 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +106 -0
- package/dist/components/index.js.map +1 -0
- package/package.json +46 -0
- package/src/components/EventConventionTest.tsx +155 -0
- package/src/components/TyButton.tsx +140 -0
- package/src/components/TyCalendar.tsx +244 -0
- package/src/components/TyCalendarMonth.tsx +108 -0
- package/src/components/TyCalendarNavigation.tsx +91 -0
- package/src/components/TyCheckbox.tsx +138 -0
- package/src/components/TyCopy.tsx +78 -0
- package/src/components/TyDatePicker.tsx +216 -0
- package/src/components/TyDropdown.tsx +205 -0
- package/src/components/TyIcon.tsx +72 -0
- package/src/components/TyInput.tsx +194 -0
- package/src/components/TyModal.tsx +142 -0
- package/src/components/TyMultiselect.tsx +189 -0
- package/src/components/TyOption.tsx +42 -0
- package/src/components/TyPopup.tsx +111 -0
- package/src/components/TyResizeObserver.tsx +54 -0
- package/src/components/TyScrollContainer.tsx +87 -0
- package/src/components/TyStep.tsx +71 -0
- package/src/components/TyTab.tsx +63 -0
- package/src/components/TyTabs.tsx +93 -0
- package/src/components/TyTag.tsx +79 -0
- package/src/components/TyTextarea.tsx +144 -0
- package/src/components/TyTooltip.tsx +83 -0
- package/src/components/TyWizard.tsx +99 -0
- package/src/components/index.ts +230 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
// React wrapper for ty-calendar web component
|
|
3
|
+
export const TyCalendar = React.forwardRef(({ year, month, day, showNavigation, stateless, size, locale, width, minWidth, maxWidth, name, value, dayContentFn, dayClassesFn, customCSS, onChange, onNavigate, ...props }, ref) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
// Handle ref forwarding
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (ref && elementRef.current) {
|
|
8
|
+
if (typeof ref === 'function') {
|
|
9
|
+
ref(elementRef.current);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
ref.current = elementRef.current;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}, [ref]);
|
|
16
|
+
// Handle change events (date selection)
|
|
17
|
+
const handleChange = useCallback((event) => {
|
|
18
|
+
const customEvent = event;
|
|
19
|
+
if (onChange) {
|
|
20
|
+
onChange(customEvent);
|
|
21
|
+
}
|
|
22
|
+
}, [onChange]);
|
|
23
|
+
// Handle navigate events (month/year navigation)
|
|
24
|
+
const handleNavigate = useCallback((event) => {
|
|
25
|
+
const customEvent = event;
|
|
26
|
+
if (onNavigate) {
|
|
27
|
+
onNavigate(customEvent);
|
|
28
|
+
}
|
|
29
|
+
}, [onNavigate]);
|
|
30
|
+
// Set up event listeners
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
const element = elementRef.current;
|
|
33
|
+
if (!element)
|
|
34
|
+
return;
|
|
35
|
+
const listeners = [];
|
|
36
|
+
if (onChange) {
|
|
37
|
+
element.addEventListener('change', handleChange);
|
|
38
|
+
listeners.push(['change', handleChange]);
|
|
39
|
+
}
|
|
40
|
+
if (onNavigate) {
|
|
41
|
+
element.addEventListener('navigate', handleNavigate);
|
|
42
|
+
listeners.push(['navigate', handleNavigate]);
|
|
43
|
+
}
|
|
44
|
+
return () => {
|
|
45
|
+
listeners.forEach(([eventName, handler]) => {
|
|
46
|
+
element.removeEventListener(eventName, handler);
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
}, [handleChange, handleNavigate, onChange, onNavigate]);
|
|
50
|
+
// Set function properties directly on the element (preferred over attributes)
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const element = elementRef.current;
|
|
53
|
+
if (!element)
|
|
54
|
+
return;
|
|
55
|
+
// Day content function property (preferred over attribute)
|
|
56
|
+
if (dayContentFn) {
|
|
57
|
+
element.dayContentFn = dayContentFn;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
element.dayContentFn = null;
|
|
61
|
+
}
|
|
62
|
+
// Day classes function property (preferred over attribute)
|
|
63
|
+
if (dayClassesFn) {
|
|
64
|
+
element.dayClassesFn = dayClassesFn;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
element.dayClassesFn = null;
|
|
68
|
+
}
|
|
69
|
+
// Custom CSS property
|
|
70
|
+
if (customCSS) {
|
|
71
|
+
element.customCSS = customCSS;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
element.customCSS = null;
|
|
75
|
+
}
|
|
76
|
+
}, [dayContentFn, dayClassesFn, customCSS]);
|
|
77
|
+
// Convert React props to web component attributes
|
|
78
|
+
const webComponentProps = {
|
|
79
|
+
...props,
|
|
80
|
+
ref: elementRef,
|
|
81
|
+
};
|
|
82
|
+
// Add optional attributes only if they have values
|
|
83
|
+
if (year !== undefined) {
|
|
84
|
+
webComponentProps.year = year.toString();
|
|
85
|
+
}
|
|
86
|
+
if (month !== undefined) {
|
|
87
|
+
webComponentProps.month = month.toString();
|
|
88
|
+
}
|
|
89
|
+
if (day !== undefined) {
|
|
90
|
+
webComponentProps.day = day.toString();
|
|
91
|
+
}
|
|
92
|
+
if (showNavigation) {
|
|
93
|
+
webComponentProps['show-navigation'] = ''; // Boolean attributes as empty string
|
|
94
|
+
}
|
|
95
|
+
if (stateless) {
|
|
96
|
+
webComponentProps.stateless = ''; // Boolean attributes as empty string
|
|
97
|
+
}
|
|
98
|
+
if (size) {
|
|
99
|
+
webComponentProps.size = size;
|
|
100
|
+
}
|
|
101
|
+
if (locale) {
|
|
102
|
+
webComponentProps.locale = locale;
|
|
103
|
+
}
|
|
104
|
+
if (width !== undefined) {
|
|
105
|
+
webComponentProps.width = width.toString();
|
|
106
|
+
}
|
|
107
|
+
if (minWidth !== undefined) {
|
|
108
|
+
webComponentProps['min-width'] = minWidth.toString();
|
|
109
|
+
}
|
|
110
|
+
if (maxWidth !== undefined) {
|
|
111
|
+
webComponentProps['max-width'] = maxWidth.toString();
|
|
112
|
+
}
|
|
113
|
+
if (name) {
|
|
114
|
+
webComponentProps.name = name;
|
|
115
|
+
}
|
|
116
|
+
if (value) {
|
|
117
|
+
webComponentProps.value = value;
|
|
118
|
+
}
|
|
119
|
+
return React.createElement('ty-calendar', webComponentProps);
|
|
120
|
+
});
|
|
121
|
+
TyCalendar.displayName = 'TyCalendar';
|
|
122
|
+
//# sourceMappingURL=TyCalendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TyCalendar.js","sourceRoot":"","sources":["../../src/components/TyCalendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAkF9D,8CAA8C;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACxC,CAAC,EACC,IAAI,EACJ,KAAK,EACL,GAAG,EACH,cAAc,EACd,SAAS,EACT,IAAI,EACJ,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,UAAU,EACV,GAAG,KAAK,EACT,EAAE,GAAG,EAAE,EAAE;IACR,MAAM,UAAU,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAE7C,wBAAwB;IACxB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,GAAG,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,OAAO,GAAG,KA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AAW,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TyCalendarMonthProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** Display year */
|
|
4
|
+
displayYear?: number;
|
|
5
|
+
/** Display month (1-12) */
|
|
6
|
+
displayMonth?: number;
|
|
7
|
+
/** Locale for date formatting */
|
|
8
|
+
locale?: string;
|
|
9
|
+
/** Calendar size */
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
/** Width of calendar */
|
|
12
|
+
width?: string;
|
|
13
|
+
/** Minimum width */
|
|
14
|
+
minWidth?: string;
|
|
15
|
+
/** Maximum width */
|
|
16
|
+
maxWidth?: string;
|
|
17
|
+
/** Day click event handler */
|
|
18
|
+
onDayClick?: (event: CustomEvent<DayClickDetail>) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface DayClickDetail {
|
|
21
|
+
dayContext: any;
|
|
22
|
+
value: number;
|
|
23
|
+
year: number;
|
|
24
|
+
month: number;
|
|
25
|
+
day: number;
|
|
26
|
+
isHoliday?: boolean;
|
|
27
|
+
isToday?: boolean;
|
|
28
|
+
isWeekend: boolean;
|
|
29
|
+
isOtherMonth: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const TyCalendarMonth: React.ForwardRefExoticComponent<TyCalendarMonthProps & React.RefAttributes<HTMLElement>>;
|
|
32
|
+
//# sourceMappingURL=TyCalendarMonth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TyCalendarMonth.d.ts","sourceRoot":"","sources":["../../src/components/TyCalendarMonth.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IAC7E,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,oBAAoB;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE1B,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,8BAA8B;IAC9B,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CAC3D;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,GAAG,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB;AAGD,eAAO,MAAM,eAAe,0FA+D3B,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
// React wrapper for ty-calendar-month web component
|
|
3
|
+
export const TyCalendarMonth = React.forwardRef(({ displayYear, displayMonth, locale, size, width, minWidth, maxWidth, onDayClick, ...props }, ref) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
// Handle day click events
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const element = elementRef.current;
|
|
8
|
+
if (!element)
|
|
9
|
+
return;
|
|
10
|
+
const handleDayClick = (event) => {
|
|
11
|
+
if (onDayClick) {
|
|
12
|
+
onDayClick(event);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
element.addEventListener('day-click', handleDayClick);
|
|
16
|
+
return () => {
|
|
17
|
+
element.removeEventListener('day-click', handleDayClick);
|
|
18
|
+
};
|
|
19
|
+
}, [onDayClick]);
|
|
20
|
+
// Combine refs if needed
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (ref && elementRef.current) {
|
|
23
|
+
if (typeof ref === 'function') {
|
|
24
|
+
ref(elementRef.current);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
ref.current = elementRef.current;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, [ref]);
|
|
31
|
+
// Convert React props to web component attributes
|
|
32
|
+
const webComponentProps = {
|
|
33
|
+
...props,
|
|
34
|
+
ref: elementRef,
|
|
35
|
+
};
|
|
36
|
+
// Add attributes
|
|
37
|
+
if (displayYear !== undefined)
|
|
38
|
+
webComponentProps['display-year'] = displayYear;
|
|
39
|
+
if (displayMonth !== undefined)
|
|
40
|
+
webComponentProps['display-month'] = displayMonth;
|
|
41
|
+
if (locale)
|
|
42
|
+
webComponentProps.locale = locale;
|
|
43
|
+
if (size)
|
|
44
|
+
webComponentProps.size = size;
|
|
45
|
+
if (width)
|
|
46
|
+
webComponentProps.width = width;
|
|
47
|
+
if (minWidth)
|
|
48
|
+
webComponentProps['min-width'] = minWidth;
|
|
49
|
+
if (maxWidth)
|
|
50
|
+
webComponentProps['max-width'] = maxWidth;
|
|
51
|
+
return React.createElement('ty-calendar-month', webComponentProps);
|
|
52
|
+
});
|
|
53
|
+
TyCalendarMonth.displayName = 'TyCalendarMonth';
|
|
54
|
+
//# sourceMappingURL=TyCalendarMonth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TyCalendarMonth.js","sourceRoot":"","sources":["../../src/components/TyCalendarMonth.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAyCjD,oDAAoD;AACpD,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,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C;IAC/E,IAAI,YAAY,KAAK,SAAS;QAAE,iBAAiB,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC;IAClF,IAAI,MAAM;QAAE,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC;IAC9C,IAAI,IAAI;QAAE,iBAAiB,CAAC,IAAI,GAAG,IAAI,CAAC;IACxC,IAAI,KAAK;QAAE,iBAAiB,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3C,IAAI,QAAQ;QAAE,iBAAiB,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC;IACxD,IAAI,QAAQ;QAAE,iBAAiB,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC;IAExD,OAAO,KAAK,CAAC,aAAa,CACxB,mBAAmB,EACnB,iBAAiB,CAClB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TyCalendarNavigationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
3
|
+
/** Display month (1-12) */
|
|
4
|
+
displayMonth?: number;
|
|
5
|
+
/** Display year */
|
|
6
|
+
displayYear?: number;
|
|
7
|
+
/** Locale for month name formatting */
|
|
8
|
+
locale?: string;
|
|
9
|
+
/** Navigation size */
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
/** Width of navigation */
|
|
12
|
+
width?: string;
|
|
13
|
+
/** Navigation change event handler */
|
|
14
|
+
onChange?: (event: CustomEvent<NavigationChangeDetail>) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface NavigationChangeDetail {
|
|
17
|
+
month: number;
|
|
18
|
+
year: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const TyCalendarNavigation: React.ForwardRefExoticComponent<TyCalendarNavigationProps & React.RefAttributes<HTMLElement>>;
|
|
21
|
+
//# sourceMappingURL=TyCalendarNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TyCalendarNavigation.d.ts","sourceRoot":"","sources":["../../src/components/TyCalendarNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IACpG,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,sBAAsB;IACtB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE1B,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAAC;CACjE;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAGD,eAAO,MAAM,oBAAoB,+FA2DhC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
// React wrapper for ty-calendar-navigation web component
|
|
3
|
+
export const TyCalendarNavigation = React.forwardRef(({ displayMonth, displayYear, locale, size, width, onChange, ...props }, ref) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
// Handle change events
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const element = elementRef.current;
|
|
8
|
+
if (!element)
|
|
9
|
+
return;
|
|
10
|
+
const handleChange = (event) => {
|
|
11
|
+
if (onChange) {
|
|
12
|
+
onChange(event);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
element.addEventListener('change', handleChange);
|
|
16
|
+
return () => {
|
|
17
|
+
element.removeEventListener('change', handleChange);
|
|
18
|
+
};
|
|
19
|
+
}, [onChange]);
|
|
20
|
+
// Combine refs if needed
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (ref && elementRef.current) {
|
|
23
|
+
if (typeof ref === 'function') {
|
|
24
|
+
ref(elementRef.current);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
ref.current = elementRef.current;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, [ref]);
|
|
31
|
+
// Convert React props to web component attributes
|
|
32
|
+
const webComponentProps = {
|
|
33
|
+
...props,
|
|
34
|
+
ref: elementRef,
|
|
35
|
+
};
|
|
36
|
+
// Add attributes
|
|
37
|
+
if (displayMonth !== undefined)
|
|
38
|
+
webComponentProps['display-month'] = displayMonth;
|
|
39
|
+
if (displayYear !== undefined)
|
|
40
|
+
webComponentProps['display-year'] = displayYear;
|
|
41
|
+
if (locale)
|
|
42
|
+
webComponentProps.locale = locale;
|
|
43
|
+
if (size)
|
|
44
|
+
webComponentProps.size = size;
|
|
45
|
+
if (width)
|
|
46
|
+
webComponentProps.width = width;
|
|
47
|
+
return React.createElement('ty-calendar-navigation', webComponentProps);
|
|
48
|
+
});
|
|
49
|
+
TyCalendarNavigation.displayName = 'TyCalendarNavigation';
|
|
50
|
+
//# sourceMappingURL=TyCalendarNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TyCalendarNavigation.js","sourceRoot":"","sources":["../../src/components/TyCalendarNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AA4BjD,yDAAyD;AACzD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,UAAU,CAClD,CAAC,EACC,YAAY,EACZ,WAAW,EACX,MAAM,EACN,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,GAAG,EAAE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CAAC;IAC9C,IAAI,IAAI;QAAE,iBAAiB,CAAC,IAAI,GAAG,IAAI,CAAC;IACxC,IAAI,KAAK;QAAE,iBAAiB,CAAC,KAAK,GAAG,KAAK,CAAC;IAE3C,OAAO,KAAK,CAAC,aAAa,CACxB,wBAAwB,EACxB,iBAAiB,CAClB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TyCheckboxProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
|
|
3
|
+
/** Checked state */
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
/** Form field value when checked */
|
|
6
|
+
value?: string;
|
|
7
|
+
/** Form field name */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** Disable the checkbox */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Required field */
|
|
12
|
+
required?: boolean;
|
|
13
|
+
/** Error message */
|
|
14
|
+
error?: string;
|
|
15
|
+
/** Checkbox size */
|
|
16
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
17
|
+
/** Semantic styling variant */
|
|
18
|
+
flavor?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'neutral';
|
|
19
|
+
/**
|
|
20
|
+
* Fires when checkbox state changes (React convention)
|
|
21
|
+
* Maps to native 'input' event from ty-checkbox
|
|
22
|
+
*/
|
|
23
|
+
onChange?: (event: CustomEvent<TyCheckboxEventDetail>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Fires on blur if value changed (native DOM behavior)
|
|
26
|
+
* Maps to native 'change' event from ty-checkbox
|
|
27
|
+
*/
|
|
28
|
+
onChangeCommit?: (event: CustomEvent<TyCheckboxEventDetail>) => void;
|
|
29
|
+
/** Checkbox label content */
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export interface TyCheckboxEventDetail {
|
|
33
|
+
value: boolean;
|
|
34
|
+
checked: boolean;
|
|
35
|
+
formValue: string | null;
|
|
36
|
+
originalEvent: Event;
|
|
37
|
+
}
|
|
38
|
+
export declare const TyCheckbox: React.ForwardRefExoticComponent<TyCheckboxProps & React.RefAttributes<HTMLElement>>;
|
|
39
|
+
//# sourceMappingURL=TyCheckbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TyCheckbox.d.ts","sourceRoot":"","sources":["../../src/components/TyCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACtG,oBAAoB;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,oBAAoB;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAExC,+BAA+B;IAC/B,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAEhF;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAE/D;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAErE,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,KAAK,CAAC;CACtB;AAGD,eAAO,MAAM,UAAU,qFAmFtB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
// React wrapper for ty-checkbox web component
|
|
3
|
+
export const TyCheckbox = React.forwardRef(({ children, checked, value, name, disabled, required, error, size, flavor, onChange, onChangeCommit, ...props }, ref) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
// Handle change events
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const element = elementRef.current;
|
|
8
|
+
if (!element)
|
|
9
|
+
return;
|
|
10
|
+
// Map onChange to input event (React convention)
|
|
11
|
+
const handleInput = (event) => {
|
|
12
|
+
if (onChange) {
|
|
13
|
+
onChange(event);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
// Map onChangeCommit to change event (blur behavior)
|
|
17
|
+
const handleChangeCommit = (event) => {
|
|
18
|
+
if (onChangeCommit) {
|
|
19
|
+
onChangeCommit(event);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
// Map onChange → input event (React convention)
|
|
23
|
+
element.addEventListener('input', handleInput);
|
|
24
|
+
// Map onChangeCommit → change event (blur behavior)
|
|
25
|
+
element.addEventListener('change', handleChangeCommit);
|
|
26
|
+
return () => {
|
|
27
|
+
element.removeEventListener('input', handleInput);
|
|
28
|
+
element.removeEventListener('change', handleChangeCommit);
|
|
29
|
+
};
|
|
30
|
+
}, [onChange, onChangeCommit]);
|
|
31
|
+
// Combine refs if needed
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (ref && elementRef.current) {
|
|
34
|
+
if (typeof ref === 'function') {
|
|
35
|
+
ref(elementRef.current);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
ref.current = elementRef.current;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}, [ref]);
|
|
42
|
+
// Convert React props to web component attributes
|
|
43
|
+
const webComponentProps = {
|
|
44
|
+
...props,
|
|
45
|
+
ref: elementRef,
|
|
46
|
+
};
|
|
47
|
+
// Add boolean attributes
|
|
48
|
+
if (checked)
|
|
49
|
+
webComponentProps.checked = '';
|
|
50
|
+
if (disabled)
|
|
51
|
+
webComponentProps.disabled = '';
|
|
52
|
+
if (required)
|
|
53
|
+
webComponentProps.required = '';
|
|
54
|
+
// Add string attributes
|
|
55
|
+
if (value)
|
|
56
|
+
webComponentProps.value = value;
|
|
57
|
+
if (name)
|
|
58
|
+
webComponentProps.name = name;
|
|
59
|
+
if (error)
|
|
60
|
+
webComponentProps.error = error;
|
|
61
|
+
if (size)
|
|
62
|
+
webComponentProps.size = size;
|
|
63
|
+
if (flavor)
|
|
64
|
+
webComponentProps.flavor = flavor;
|
|
65
|
+
return React.createElement('ty-checkbox', webComponentProps, children);
|
|
66
|
+
});
|
|
67
|
+
TyCheckbox.displayName = 'TyCheckbox';
|
|
68
|
+
//# sourceMappingURL=TyCheckbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TyCheckbox.js","sourceRoot":"","sources":["../../src/components/TyCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAmDjD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACxC,CAAC,EACC,QAAQ,EACR,OAAO,EACP,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,cAAc,EACd,GAAG,KAAK,EACT,EAAE,GAAG,EAAE,EAA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,CAAC,CAAC,CAAC;IAEV,kDAAkD;IAClD,MAAM,iBAAiB,GAAwB;QAC7C,GAAG,KAAK;QACR,GAAG,EAAE,UAAU;KAChB,CAAC;IAEF,yBAAyB;IACzB,IAAI,OAAO;QAAE,iBAAiB,CAAC,OAAO,GAAG,EAAE,CAAC;IAC5C,IAAI,QAAQ;QAAE,iBAAiB,CAAC,QAAQ,GAAG,EAAE,CAAC;IAC9C,IAAI,QAAQ;QAAE,iBAAiB,CAAC,QAAQ,GAAG,EAAE,CAAC;IAE9C,wBAAwB;IACxB,IAAI,KAAK;QAAE,iBAAiB,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3C,IAAI,IAAI;QAAE,iBAAiB,CAAC,IAAI,GAAG,IAAI,CAAC;IACxC,IAAI,KAAK;QAAE,iBAAiB,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3C,IAAI,IAAI;QAAE,iBAAiB,CAAC,IAAI,GAAG,IAAI,CAAC;IACxC,IAAI,MAAM;QAAE,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC;IAE9C,OAAO,KAAK,CAAC,aAAa,CACxB,aAAa,EACb,iBAAiB,EACjB,QAAQ,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TyCopyProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
3
|
+
/** Text to copy */
|
|
4
|
+
value?: string;
|
|
5
|
+
/** Field label */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Component size */
|
|
8
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
/** Semantic styling variant */
|
|
10
|
+
flavor?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'neutral';
|
|
11
|
+
/** Display format */
|
|
12
|
+
format?: 'text' | 'code';
|
|
13
|
+
/** Multi-line display */
|
|
14
|
+
multiline?: boolean;
|
|
15
|
+
/** Disable the field */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Required field */
|
|
18
|
+
required?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const TyCopy: React.ForwardRefExoticComponent<TyCopyProps & React.RefAttributes<HTMLElement>>;
|
|
21
|
+
//# sourceMappingURL=TyCopy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TyCopy.d.ts","sourceRoot":"","sources":["../../src/components/TyCopy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IACtF,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qBAAqB;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAExC,+BAA+B;IAC/B,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAEhF,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB,yBAAyB;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAGD,eAAO,MAAM,MAAM,iFA6ClB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
// React wrapper for ty-copy web component
|
|
3
|
+
export const TyCopy = React.forwardRef(({ value, label, size, flavor, format, multiline, disabled, required, ...props }, ref) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
// Handle ref forwarding
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (ref && elementRef.current) {
|
|
8
|
+
if (typeof ref === 'function') {
|
|
9
|
+
ref(elementRef.current);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
ref.current = elementRef.current;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}, [ref]);
|
|
16
|
+
// Convert React props to web component attributes
|
|
17
|
+
const webComponentProps = {
|
|
18
|
+
...props,
|
|
19
|
+
ref: elementRef,
|
|
20
|
+
};
|
|
21
|
+
// Add string attributes
|
|
22
|
+
if (value)
|
|
23
|
+
webComponentProps.value = value;
|
|
24
|
+
if (label)
|
|
25
|
+
webComponentProps.label = label;
|
|
26
|
+
if (size)
|
|
27
|
+
webComponentProps.size = size;
|
|
28
|
+
if (flavor)
|
|
29
|
+
webComponentProps.flavor = flavor;
|
|
30
|
+
if (format)
|
|
31
|
+
webComponentProps.format = format;
|
|
32
|
+
// Add boolean attributes
|
|
33
|
+
if (multiline)
|
|
34
|
+
webComponentProps.multiline = '';
|
|
35
|
+
if (disabled)
|
|
36
|
+
webComponentProps.disabled = '';
|
|
37
|
+
if (required)
|
|
38
|
+
webComponentProps.required = '';
|
|
39
|
+
return React.createElement('ty-copy', webComponentProps);
|
|
40
|
+
});
|
|
41
|
+
TyCopy.displayName = 'TyCopy';
|
|
42
|
+
//# sourceMappingURL=TyCopy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TyCopy.js","sourceRoot":"","sources":["../../src/components/TyCopy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AA6BjD,0CAA0C;AAC1C,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CACpC,CAAC,EACC,KAAK,EACL,KAAK,EACL,IAAI,EACJ,MAAM,EACN,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AAC,WAAW,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TyDatePickerEventDetail {
|
|
3
|
+
/** The selected date value (ISO string or formatted string based on format) */
|
|
4
|
+
value: string | null;
|
|
5
|
+
/** The selected date as milliseconds since epoch */
|
|
6
|
+
milliseconds: number | null;
|
|
7
|
+
/** Source of the change: "selection" | "time-change" | "clear" | "external" */
|
|
8
|
+
source: 'selection' | 'time-change' | 'clear' | 'external';
|
|
9
|
+
/** Formatted display value */
|
|
10
|
+
formatted: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface TyDatePickerProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
13
|
+
/** The selected date value (ISO string or formatted string) */
|
|
14
|
+
value?: string;
|
|
15
|
+
/** Input size: "sm" | "md" | "lg" */
|
|
16
|
+
size?: 'sm' | 'md' | 'lg';
|
|
17
|
+
/** Visual flavor: "default" | "success" | "danger" | "warning" */
|
|
18
|
+
flavor?: 'default' | 'success' | 'danger' | 'warning';
|
|
19
|
+
/** Label text displayed above the input */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Placeholder text when no date is selected */
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
/** Whether the field is required */
|
|
24
|
+
required?: boolean;
|
|
25
|
+
/** Whether the field is disabled */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Form field name for form submission */
|
|
28
|
+
name?: string;
|
|
29
|
+
/** Whether to show a clear button */
|
|
30
|
+
clearable?: boolean;
|
|
31
|
+
/** Date format: "short" | "medium" | "long" | "full" | custom format string */
|
|
32
|
+
format?: 'short' | 'medium' | 'long' | 'full' | string;
|
|
33
|
+
/** Locale for date formatting (e.g., "en-US", "de-DE") */
|
|
34
|
+
locale?: string;
|
|
35
|
+
/** Whether to include time selection */
|
|
36
|
+
withTime?: boolean;
|
|
37
|
+
/** Callback when the date value changes */
|
|
38
|
+
onChange?: (event: CustomEvent<TyDatePickerEventDetail>) => void;
|
|
39
|
+
/** Callback when the dropdown opens */
|
|
40
|
+
onOpen?: (event: CustomEvent<{}>) => void;
|
|
41
|
+
/** Callback when the dropdown closes */
|
|
42
|
+
onClose?: (event: CustomEvent<{}>) => void;
|
|
43
|
+
}
|
|
44
|
+
export declare const TyDatePicker: React.ForwardRefExoticComponent<TyDatePickerProps & React.RefAttributes<HTMLElement>>;
|
|
45
|
+
//# sourceMappingURL=TyDatePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TyDatePicker.d.ts","sourceRoot":"","sources":["../../src/components/TyDatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,MAAM,WAAW,uBAAuB;IACtC,+EAA+E;IAC/E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oDAAoD;IACpD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,+EAA+E;IAC/E,MAAM,EAAE,WAAW,GAAG,aAAa,GAAG,OAAO,GAAG,UAAU,CAAC;IAC3D,8BAA8B;IAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IAC5F,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qCAAqC;IACrC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE1B,kEAAkE;IAClE,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAEtD,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,oCAAoC;I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