@luzmo/ngx-lucero 1.0.1-alpha.78

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.
Files changed (136) hide show
  1. package/README.md +41 -0
  2. package/esm/components/accordion-item.d.ts +32 -0
  3. package/esm/components/accordion-item.js +89 -0
  4. package/esm/components/accordion.d.ts +38 -0
  5. package/esm/components/accordion.js +107 -0
  6. package/esm/components/action-bar.d.ts +32 -0
  7. package/esm/components/action-bar.js +83 -0
  8. package/esm/components/action-button.d.ts +59 -0
  9. package/esm/components/action-button.js +205 -0
  10. package/esm/components/action-group.d.ts +42 -0
  11. package/esm/components/action-group.js +155 -0
  12. package/esm/components/action-menu.d.ts +75 -0
  13. package/esm/components/action-menu.js +337 -0
  14. package/esm/components/avatar.d.ts +35 -0
  15. package/esm/components/avatar.js +94 -0
  16. package/esm/components/badge.d.ts +31 -0
  17. package/esm/components/badge.js +86 -0
  18. package/esm/components/button-group.d.ts +28 -0
  19. package/esm/components/button-group.js +71 -0
  20. package/esm/components/button.d.ts +40 -0
  21. package/esm/components/button.js +140 -0
  22. package/esm/components/calendar.d.ts +64 -0
  23. package/esm/components/calendar.js +218 -0
  24. package/esm/components/chat-message-group.d.ts +29 -0
  25. package/esm/components/chat-message-group.js +76 -0
  26. package/esm/components/chat-message.d.ts +50 -0
  27. package/esm/components/chat-message.js +156 -0
  28. package/esm/components/checkbox.d.ts +55 -0
  29. package/esm/components/checkbox.js +196 -0
  30. package/esm/components/clear-button.d.ts +32 -0
  31. package/esm/components/clear-button.js +88 -0
  32. package/esm/components/close-button.d.ts +33 -0
  33. package/esm/components/close-button.js +95 -0
  34. package/esm/components/color-area.d.ts +45 -0
  35. package/esm/components/color-area.js +167 -0
  36. package/esm/components/color-field.d.ts +91 -0
  37. package/esm/components/color-field.js +321 -0
  38. package/esm/components/color-handle.d.ts +31 -0
  39. package/esm/components/color-handle.js +90 -0
  40. package/esm/components/color-loupe.d.ts +29 -0
  41. package/esm/components/color-loupe.js +76 -0
  42. package/esm/components/color-menu.d.ts +36 -0
  43. package/esm/components/color-menu.js +97 -0
  44. package/esm/components/color-palette-group.d.ts +40 -0
  45. package/esm/components/color-palette-group.js +117 -0
  46. package/esm/components/color-palette.d.ts +43 -0
  47. package/esm/components/color-palette.js +126 -0
  48. package/esm/components/color-picker.d.ts +49 -0
  49. package/esm/components/color-picker.js +143 -0
  50. package/esm/components/color-slider.d.ts +53 -0
  51. package/esm/components/color-slider.js +215 -0
  52. package/esm/components/date-range-picker.d.ts +69 -0
  53. package/esm/components/date-range-picker.js +228 -0
  54. package/esm/components/date-time-picker.d.ts +71 -0
  55. package/esm/components/date-time-picker.js +249 -0
  56. package/esm/components/divider.d.ts +31 -0
  57. package/esm/components/divider.js +78 -0
  58. package/esm/components/field-group.d.ts +32 -0
  59. package/esm/components/field-group.js +101 -0
  60. package/esm/components/field-label.d.ts +37 -0
  61. package/esm/components/field-label.js +104 -0
  62. package/esm/components/help-text.d.ts +30 -0
  63. package/esm/components/help-text.js +77 -0
  64. package/esm/components/icon.d.ts +33 -0
  65. package/esm/components/icon.js +104 -0
  66. package/esm/components/infield-button.d.ts +35 -0
  67. package/esm/components/infield-button.js +103 -0
  68. package/esm/components/label.d.ts +29 -0
  69. package/esm/components/label.js +76 -0
  70. package/esm/components/menu.d.ts +53 -0
  71. package/esm/components/menu.js +218 -0
  72. package/esm/components/multi-language-field.d.ts +58 -0
  73. package/esm/components/multi-language-field.js +263 -0
  74. package/esm/components/number-field.d.ts +103 -0
  75. package/esm/components/number-field.js +372 -0
  76. package/esm/components/options.d.ts +58 -0
  77. package/esm/components/options.js +207 -0
  78. package/esm/components/overlay.d.ts +67 -0
  79. package/esm/components/overlay.js +212 -0
  80. package/esm/components/picker-button.d.ts +32 -0
  81. package/esm/components/picker-button.js +94 -0
  82. package/esm/components/picker.d.ts +79 -0
  83. package/esm/components/picker.js +340 -0
  84. package/esm/components/popover.d.ts +33 -0
  85. package/esm/components/popover.js +93 -0
  86. package/esm/components/progress-bar.d.ts +35 -0
  87. package/esm/components/progress-bar.js +121 -0
  88. package/esm/components/progress-circle.d.ts +35 -0
  89. package/esm/components/progress-circle.js +94 -0
  90. package/esm/components/progress-steps.d.ts +46 -0
  91. package/esm/components/progress-steps.js +127 -0
  92. package/esm/components/prompt-box.d.ts +88 -0
  93. package/esm/components/prompt-box.js +280 -0
  94. package/esm/components/radio-group.d.ts +39 -0
  95. package/esm/components/radio-group.js +136 -0
  96. package/esm/components/radio.d.ts +46 -0
  97. package/esm/components/radio.js +172 -0
  98. package/esm/components/search.d.ts +95 -0
  99. package/esm/components/search.js +351 -0
  100. package/esm/components/select.d.ts +82 -0
  101. package/esm/components/select.js +351 -0
  102. package/esm/components/slider.d.ts +47 -0
  103. package/esm/components/slider.js +185 -0
  104. package/esm/components/status-light.d.ts +30 -0
  105. package/esm/components/status-light.js +78 -0
  106. package/esm/components/swatch-group.d.ts +37 -0
  107. package/esm/components/swatch-group.js +126 -0
  108. package/esm/components/swatch.d.ts +49 -0
  109. package/esm/components/swatch.js +197 -0
  110. package/esm/components/switch.d.ts +48 -0
  111. package/esm/components/switch.js +160 -0
  112. package/esm/components/tab-panel.d.ts +29 -0
  113. package/esm/components/tab-panel.js +78 -0
  114. package/esm/components/tab.d.ts +32 -0
  115. package/esm/components/tab.js +100 -0
  116. package/esm/components/tabs-overflow.d.ts +33 -0
  117. package/esm/components/tabs-overflow.js +97 -0
  118. package/esm/components/tabs.d.ts +43 -0
  119. package/esm/components/tabs.js +150 -0
  120. package/esm/components/tag.d.ts +31 -0
  121. package/esm/components/tag.js +90 -0
  122. package/esm/components/tags.d.ts +30 -0
  123. package/esm/components/tags.js +81 -0
  124. package/esm/components/text-field.d.ts +87 -0
  125. package/esm/components/text-field.js +308 -0
  126. package/esm/components/toast.d.ts +30 -0
  127. package/esm/components/toast.js +68 -0
  128. package/esm/components/tooltip.d.ts +44 -0
  129. package/esm/components/tooltip.js +154 -0
  130. package/esm/components/top-nav-item.d.ts +35 -0
  131. package/esm/components/top-nav-item.js +120 -0
  132. package/esm/components/top-nav.d.ts +35 -0
  133. package/esm/components/top-nav.js +110 -0
  134. package/esm/index.d.ts +135 -0
  135. package/esm/index.js +269 -0
  136. package/package.json +40 -0
@@ -0,0 +1,53 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import '@luzmo/lucero/color-slider';
4
+ import type { LuzmoColorSlider as LuzmoColorSliderHostElement } from '@luzmo/lucero/color-slider';
5
+ import * as i0 from "@angular/core";
6
+ export declare class LuzmoColorSlider implements OnChanges, ControlValueAccessor {
7
+ private readonly elementRef;
8
+ private readonly renderer;
9
+ private readonly destroyRef;
10
+ private readonly host;
11
+ private readonly listenerCleanup;
12
+ /** The underlying custom element instance. Use to call imperative methods. */
13
+ get nativeElement(): LuzmoColorSliderHostElement;
14
+ dir?: 'ltr' | 'rtl';
15
+ mode?: 'hue' | 'opacity';
16
+ disabled?: boolean;
17
+ focused?: boolean;
18
+ label?: string;
19
+ vertical?: boolean;
20
+ value?: number;
21
+ sliderHandlePosition?: number;
22
+ color?: unknown;
23
+ step?: number;
24
+ isLTR?: boolean;
25
+ input?: unknown;
26
+ /** The value of the Color Slider has changed. */
27
+ readonly inputEvent: import("@angular/core").OutputEmitterRef<Event>;
28
+ /** An alteration to the value of the Color Slider has been committed by the user. */
29
+ readonly changeEvent: import("@angular/core").OutputEmitterRef<Event>;
30
+ constructor();
31
+ ngOnChanges(changes: SimpleChanges): void;
32
+ /**
33
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
34
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
35
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
36
+ * undefined / null by clearing their bindings.
37
+ */
38
+ private setHostProperty;
39
+ private bindEvents;
40
+ private onChange;
41
+ private onTouched;
42
+ private isWritingValue;
43
+ private lastCvaValue;
44
+ writeValue(value: number): void;
45
+ registerOnChange(fn: (value: number) => void): void;
46
+ registerOnTouched(fn: () => void): void;
47
+ setDisabledState(isDisabled: boolean): void;
48
+ focus(focusOptions: FocusOptions): void;
49
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoColorSlider, never>;
50
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoColorSlider, "luzmo-color-slider", ["luzmoColorSlider"], { "dir": { "alias": "dir"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "focused": { "alias": "focused"; "required": false; }; "label": { "alias": "label"; "required": false; }; "vertical": { "alias": "vertical"; "required": false; }; "value": { "alias": "value"; "required": false; }; "sliderHandlePosition": { "alias": "slider-handle-position"; "required": false; }; "color": { "alias": "color"; "required": false; }; "step": { "alias": "step"; "required": false; }; "isLTR": { "alias": "is-ltr"; "required": false; }; "input": { "alias": "input"; "required": false; }; }, { "inputEvent": "input"; "changeEvent": "change"; }, never, ["*"], true, never>;
51
+ }
52
+ /** The underlying custom element type for LuzmoColorSlider */
53
+ export type LuzmoColorSliderElement = LuzmoColorSliderHostElement;
@@ -0,0 +1,215 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, forwardRef, inject, Input, output, Renderer2 } from '@angular/core';
2
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
+ import '@luzmo/lucero/color-slider';
4
+ import * as i0 from "@angular/core";
5
+ const _c0 = ["*"];
6
+ /**
7
+ * Angular wrapper component for <luzmo-color-slider>
8
+ */
9
+ export class LuzmoColorSlider {
10
+ elementRef = inject(ElementRef);
11
+ renderer = inject(Renderer2);
12
+ destroyRef = inject(DestroyRef);
13
+ host = this.elementRef.nativeElement;
14
+ listenerCleanup = [];
15
+ /** The underlying custom element instance. Use to call imperative methods. */
16
+ get nativeElement() {
17
+ return this.host;
18
+ }
19
+ dir;
20
+ mode;
21
+ disabled;
22
+ focused;
23
+ label;
24
+ vertical;
25
+ value;
26
+ sliderHandlePosition;
27
+ color;
28
+ step;
29
+ isLTR;
30
+ input;
31
+ /** The value of the Color Slider has changed. */
32
+ inputEvent = output({ alias: 'input' });
33
+ /** An alteration to the value of the Color Slider has been committed by the user. */
34
+ changeEvent = output({ alias: 'change' });
35
+ constructor() {
36
+ this.bindEvents();
37
+ this.destroyRef.onDestroy(() => {
38
+ for (const cleanup of this.listenerCleanup) {
39
+ cleanup();
40
+ }
41
+ });
42
+ }
43
+ ngOnChanges(changes) {
44
+ for (const key of Object.keys(changes)) {
45
+ switch (key) {
46
+ case 'dir':
47
+ this.setHostProperty('dir', changes['dir'].currentValue);
48
+ break;
49
+ case 'mode':
50
+ this.setHostProperty('mode', changes['mode'].currentValue);
51
+ break;
52
+ case 'disabled':
53
+ this.setHostProperty('disabled', changes['disabled'].currentValue);
54
+ break;
55
+ case 'focused':
56
+ this.setHostProperty('focused', changes['focused'].currentValue);
57
+ break;
58
+ case 'label':
59
+ this.setHostProperty('label', changes['label'].currentValue);
60
+ break;
61
+ case 'vertical':
62
+ this.setHostProperty('vertical', changes['vertical'].currentValue);
63
+ break;
64
+ case 'value':
65
+ this.setHostProperty('value', changes['value'].currentValue);
66
+ break;
67
+ case 'sliderHandlePosition':
68
+ this.setHostProperty('sliderHandlePosition', changes['sliderHandlePosition'].currentValue);
69
+ break;
70
+ case 'color':
71
+ this.setHostProperty('color', changes['color'].currentValue);
72
+ break;
73
+ case 'step':
74
+ this.setHostProperty('step', changes['step'].currentValue);
75
+ break;
76
+ case 'isLTR':
77
+ this.setHostProperty('isLTR', changes['isLTR'].currentValue);
78
+ break;
79
+ case 'input':
80
+ this.setHostProperty('input', changes['input'].currentValue);
81
+ break;
82
+ default:
83
+ break;
84
+ }
85
+ }
86
+ }
87
+ /**
88
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
89
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
90
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
91
+ * undefined / null by clearing their bindings.
92
+ */
93
+ setHostProperty(key, value) {
94
+ this.renderer.setProperty(this.host, key, value);
95
+ }
96
+ bindEvents() {
97
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'input', (event) => {
98
+ this.inputEvent.emit(event);
99
+ if (!this.isWritingValue) {
100
+ const eventWithDetail = event;
101
+ const eventTarget = event.target;
102
+ const detail = 'detail' in eventWithDetail ? eventWithDetail.detail : undefined;
103
+ const hostRecord = this.host;
104
+ const nextValue = (detail
105
+ ?? eventTarget?.['value']
106
+ ?? hostRecord['value']);
107
+ if (Object.is(this.lastCvaValue, nextValue)) {
108
+ return;
109
+ }
110
+ this.lastCvaValue = nextValue;
111
+ this.setHostProperty('value', nextValue);
112
+ this.onChange(nextValue);
113
+ }
114
+ }));
115
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'change', (event) => {
116
+ this.changeEvent.emit(event);
117
+ }));
118
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'blur', () => {
119
+ this.onTouched();
120
+ }));
121
+ }
122
+ onChange = () => { };
123
+ onTouched = () => { };
124
+ isWritingValue = false;
125
+ lastCvaValue;
126
+ writeValue(value) {
127
+ this.isWritingValue = true;
128
+ this.lastCvaValue = value;
129
+ this.setHostProperty('value', value);
130
+ this.isWritingValue = false;
131
+ }
132
+ registerOnChange(fn) {
133
+ this.onChange = fn;
134
+ }
135
+ registerOnTouched(fn) {
136
+ this.onTouched = fn;
137
+ }
138
+ setDisabledState(isDisabled) {
139
+ this.setHostProperty('disabled', isDisabled);
140
+ if (isDisabled) {
141
+ this.renderer.setAttribute(this.host, 'disabled', '');
142
+ }
143
+ else {
144
+ this.renderer.removeAttribute(this.host, 'disabled');
145
+ }
146
+ }
147
+ focus(focusOptions) {
148
+ return this.host.focus(focusOptions);
149
+ }
150
+ static ɵfac = function LuzmoColorSlider_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoColorSlider)(); };
151
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoColorSlider, selectors: [["luzmo-color-slider"]], inputs: { dir: "dir", mode: "mode", disabled: "disabled", focused: "focused", label: "label", vertical: "vertical", value: "value", sliderHandlePosition: [0, "slider-handle-position", "sliderHandlePosition"], color: "color", step: "step", isLTR: [0, "is-ltr", "isLTR"], input: "input" }, outputs: { inputEvent: "input", changeEvent: "change" }, exportAs: ["luzmoColorSlider"], features: [i0.ɵɵProvidersFeature([
152
+ {
153
+ provide: NG_VALUE_ACCESSOR,
154
+ useExisting: forwardRef(() => LuzmoColorSlider),
155
+ multi: true
156
+ }
157
+ ]), i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoColorSlider_Template(rf, ctx) { if (rf & 1) {
158
+ i0.ɵɵprojectionDef();
159
+ i0.ɵɵprojection(0);
160
+ } }, encapsulation: 2, changeDetection: 0 });
161
+ }
162
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoColorSlider, [{
163
+ type: Component,
164
+ args: [{
165
+ selector: 'luzmo-color-slider',
166
+ exportAs: 'luzmoColorSlider',
167
+ standalone: true,
168
+ changeDetection: ChangeDetectionStrategy.OnPush,
169
+ template: '<ng-content />',
170
+ providers: [
171
+ {
172
+ provide: NG_VALUE_ACCESSOR,
173
+ useExisting: forwardRef(() => LuzmoColorSlider),
174
+ multi: true
175
+ }
176
+ ]
177
+ }]
178
+ }], () => [], { dir: [{
179
+ type: Input,
180
+ args: [{ alias: 'dir' }]
181
+ }], mode: [{
182
+ type: Input,
183
+ args: [{ alias: 'mode' }]
184
+ }], disabled: [{
185
+ type: Input,
186
+ args: [{ alias: 'disabled' }]
187
+ }], focused: [{
188
+ type: Input,
189
+ args: [{ alias: 'focused' }]
190
+ }], label: [{
191
+ type: Input,
192
+ args: [{ alias: 'label' }]
193
+ }], vertical: [{
194
+ type: Input,
195
+ args: [{ alias: 'vertical' }]
196
+ }], value: [{
197
+ type: Input,
198
+ args: [{ alias: 'value' }]
199
+ }], sliderHandlePosition: [{
200
+ type: Input,
201
+ args: [{ alias: 'slider-handle-position' }]
202
+ }], color: [{
203
+ type: Input,
204
+ args: [{ alias: 'color' }]
205
+ }], step: [{
206
+ type: Input,
207
+ args: [{ alias: 'step' }]
208
+ }], isLTR: [{
209
+ type: Input,
210
+ args: [{ alias: 'is-ltr' }]
211
+ }], input: [{
212
+ type: Input,
213
+ args: [{ alias: 'input' }]
214
+ }], inputEvent: [{ type: i0.Output, args: ["input"] }], changeEvent: [{ type: i0.Output, args: ["change"] }] }); })();
215
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoColorSlider, { className: "LuzmoColorSlider", filePath: "components/color-slider.ts", lineNumber: 23 }); })();
@@ -0,0 +1,69 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/date-range-picker';
3
+ import type { LuzmoDateRangePicker as LuzmoDateRangePickerHostElement, DateRangePickerLabels, DefinedRange } from '@luzmo/lucero/date-range-picker';
4
+ import * as i0 from "@angular/core";
5
+ export type { DateRangePickerLabels, DateRangeValue, DefinedRange } from '@luzmo/lucero/date-range-picker';
6
+ export declare class LuzmoDateRangePicker implements OnChanges {
7
+ private readonly elementRef;
8
+ private readonly renderer;
9
+ private readonly destroyRef;
10
+ private readonly host;
11
+ private readonly listenerCleanup;
12
+ /** The underlying custom element instance. Use to call imperative methods. */
13
+ get nativeElement(): LuzmoDateRangePickerHostElement;
14
+ /** The start date of the range (ISO date string, e.g. '2024-01-15') */
15
+ startDate?: string;
16
+ /** The end date of the range (ISO date string, e.g. '2024-01-20') */
17
+ endDate?: string;
18
+ /** The minimum valid date a user can select */
19
+ min?: string;
20
+ /** The maximum valid date a user can select */
21
+ max?: string;
22
+ /** The date format to use for display. Can be 'mmdd', 'ddmm', or undefined (uses locale default). */
23
+ dateFormat?: 'mmdd' | 'ddmm';
24
+ /** The separator to use between date segments (month, day, and year). */
25
+ dateSeparator?: string;
26
+ /** The granularity used to display the segments. 'day' shows only date, while 'hour', 'minute', 'second', or 'millisecond' add time segments. */
27
+ precision?: unknown;
28
+ /** Number of side-by-side calendars in the popover (1 or 2) */
29
+ calendars?: 1 | 2;
30
+ /** Whether to show the predefined date ranges panel in the popover. */
31
+ showDefinedRanges?: boolean;
32
+ /** Predefined date ranges displayed as quick-select options. Defaults use English labels. For other locales, provide your own `DefinedRange[]` with translated labels. */
33
+ definedRanges?: DefinedRange[];
34
+ /** Whether the `value` held by the form control is invalid. */
35
+ invalid?: boolean;
36
+ /** Whether a user can interact with the value of the form control */
37
+ readonly?: boolean;
38
+ /** Whether to display the form control with no visible background */
39
+ quiet?: boolean;
40
+ /** Popover placement */
41
+ placement?: unknown;
42
+ /** The IANA time zone identifier to use for interpreting dates (e.g. 'America/New_York'). If not specified, the user's local time zone is used. */
43
+ timeZone?: string;
44
+ /** BCP 47 locale string */
45
+ language?: string;
46
+ /** Labels read by screen readers. */
47
+ labels?: DateRangePickerLabels;
48
+ focused?: boolean;
49
+ helpTextManager?: unknown;
50
+ /** Announces when a new date range is committed by the user */
51
+ readonly changeEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
52
+ /** Announces when the user's input changes the component's segments */
53
+ readonly inputEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
54
+ constructor();
55
+ ngOnChanges(changes: SimpleChanges): void;
56
+ /**
57
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
58
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
59
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
60
+ * undefined / null by clearing their bindings.
61
+ */
62
+ private setHostProperty;
63
+ private bindEvents;
64
+ clear(): void;
65
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoDateRangePicker, never>;
66
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoDateRangePicker, "luzmo-date-range-picker", ["luzmoDateRangePicker"], { "startDate": { "alias": "start-date"; "required": false; }; "endDate": { "alias": "end-date"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "dateFormat": { "alias": "date-format"; "required": false; }; "dateSeparator": { "alias": "date-separator"; "required": false; }; "precision": { "alias": "precision"; "required": false; }; "calendars": { "alias": "calendars"; "required": false; }; "showDefinedRanges": { "alias": "show-defined-ranges"; "required": false; }; "definedRanges": { "alias": "defined-ranges"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "quiet": { "alias": "quiet"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "timeZone": { "alias": "time-zone"; "required": false; }; "language": { "alias": "language"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "focused": { "alias": "focused"; "required": false; }; "helpTextManager": { "alias": "help-text-manager"; "required": false; }; }, { "changeEvent": "change"; "inputEvent": "input"; }, never, ["*"], true, never>;
67
+ }
68
+ /** The underlying custom element type for LuzmoDateRangePicker */
69
+ export type LuzmoDateRangePickerElement = LuzmoDateRangePickerHostElement;
@@ -0,0 +1,228 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, output, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/date-range-picker';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * Angular wrapper component for <luzmo-date-range-picker>
7
+ *
8
+ * @slot calendar-icon - The icon used in the calendar button
9
+ * @slot help-text - Default or non-negative help text to associate to your form element
10
+ * @slot negative-help-text - Negative help text to associate to your form element when `invalid`
11
+ */
12
+ export class LuzmoDateRangePicker {
13
+ elementRef = inject(ElementRef);
14
+ renderer = inject(Renderer2);
15
+ destroyRef = inject(DestroyRef);
16
+ host = this.elementRef.nativeElement;
17
+ listenerCleanup = [];
18
+ /** The underlying custom element instance. Use to call imperative methods. */
19
+ get nativeElement() {
20
+ return this.host;
21
+ }
22
+ /** The start date of the range (ISO date string, e.g. '2024-01-15') */
23
+ startDate;
24
+ /** The end date of the range (ISO date string, e.g. '2024-01-20') */
25
+ endDate;
26
+ /** The minimum valid date a user can select */
27
+ min;
28
+ /** The maximum valid date a user can select */
29
+ max;
30
+ /** The date format to use for display. Can be 'mmdd', 'ddmm', or undefined (uses locale default). */
31
+ dateFormat;
32
+ /** The separator to use between date segments (month, day, and year). */
33
+ dateSeparator;
34
+ /** The granularity used to display the segments. 'day' shows only date, while 'hour', 'minute', 'second', or 'millisecond' add time segments. */
35
+ precision;
36
+ /** Number of side-by-side calendars in the popover (1 or 2) */
37
+ calendars;
38
+ /** Whether to show the predefined date ranges panel in the popover. */
39
+ showDefinedRanges;
40
+ /** Predefined date ranges displayed as quick-select options. Defaults use English labels. For other locales, provide your own `DefinedRange[]` with translated labels. */
41
+ definedRanges;
42
+ /** Whether the `value` held by the form control is invalid. */
43
+ invalid;
44
+ /** Whether a user can interact with the value of the form control */
45
+ readonly;
46
+ /** Whether to display the form control with no visible background */
47
+ quiet;
48
+ /** Popover placement */
49
+ placement;
50
+ /** The IANA time zone identifier to use for interpreting dates (e.g. 'America/New_York'). If not specified, the user's local time zone is used. */
51
+ timeZone;
52
+ /** BCP 47 locale string */
53
+ language;
54
+ /** Labels read by screen readers. */
55
+ labels;
56
+ focused;
57
+ helpTextManager;
58
+ /** Announces when a new date range is committed by the user */
59
+ changeEvent = output({ alias: 'change' });
60
+ /** Announces when the user's input changes the component's segments */
61
+ inputEvent = output({ alias: 'input' });
62
+ constructor() {
63
+ this.bindEvents();
64
+ this.destroyRef.onDestroy(() => {
65
+ for (const cleanup of this.listenerCleanup) {
66
+ cleanup();
67
+ }
68
+ });
69
+ }
70
+ ngOnChanges(changes) {
71
+ for (const key of Object.keys(changes)) {
72
+ switch (key) {
73
+ case 'startDate':
74
+ this.setHostProperty('startDate', changes['startDate'].currentValue);
75
+ break;
76
+ case 'endDate':
77
+ this.setHostProperty('endDate', changes['endDate'].currentValue);
78
+ break;
79
+ case 'min':
80
+ this.setHostProperty('min', changes['min'].currentValue);
81
+ break;
82
+ case 'max':
83
+ this.setHostProperty('max', changes['max'].currentValue);
84
+ break;
85
+ case 'dateFormat':
86
+ this.setHostProperty('dateFormat', changes['dateFormat'].currentValue);
87
+ break;
88
+ case 'dateSeparator':
89
+ this.setHostProperty('dateSeparator', changes['dateSeparator'].currentValue);
90
+ break;
91
+ case 'precision':
92
+ this.setHostProperty('precision', changes['precision'].currentValue);
93
+ break;
94
+ case 'calendars':
95
+ this.setHostProperty('calendars', changes['calendars'].currentValue);
96
+ break;
97
+ case 'showDefinedRanges':
98
+ this.setHostProperty('showDefinedRanges', changes['showDefinedRanges'].currentValue);
99
+ break;
100
+ case 'definedRanges':
101
+ this.setHostProperty('definedRanges', changes['definedRanges'].currentValue);
102
+ break;
103
+ case 'invalid':
104
+ this.setHostProperty('invalid', changes['invalid'].currentValue);
105
+ break;
106
+ case 'readonly':
107
+ this.setHostProperty('readonly', changes['readonly'].currentValue);
108
+ break;
109
+ case 'quiet':
110
+ this.setHostProperty('quiet', changes['quiet'].currentValue);
111
+ break;
112
+ case 'placement':
113
+ this.setHostProperty('placement', changes['placement'].currentValue);
114
+ break;
115
+ case 'timeZone':
116
+ this.setHostProperty('timeZone', changes['timeZone'].currentValue);
117
+ break;
118
+ case 'language':
119
+ this.setHostProperty('language', changes['language'].currentValue);
120
+ break;
121
+ case 'labels':
122
+ this.setHostProperty('labels', changes['labels'].currentValue);
123
+ break;
124
+ case 'focused':
125
+ this.setHostProperty('focused', changes['focused'].currentValue);
126
+ break;
127
+ case 'helpTextManager':
128
+ this.setHostProperty('helpTextManager', changes['helpTextManager'].currentValue);
129
+ break;
130
+ default:
131
+ break;
132
+ }
133
+ }
134
+ }
135
+ /**
136
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
137
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
138
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
139
+ * undefined / null by clearing their bindings.
140
+ */
141
+ setHostProperty(key, value) {
142
+ this.renderer.setProperty(this.host, key, value);
143
+ }
144
+ bindEvents() {
145
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'change', (event) => {
146
+ this.changeEvent.emit(event);
147
+ }));
148
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'input', (event) => {
149
+ this.inputEvent.emit(event);
150
+ }));
151
+ }
152
+ clear() {
153
+ return this.host.clear();
154
+ }
155
+ static ɵfac = function LuzmoDateRangePicker_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoDateRangePicker)(); };
156
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoDateRangePicker, selectors: [["luzmo-date-range-picker"]], inputs: { startDate: [0, "start-date", "startDate"], endDate: [0, "end-date", "endDate"], min: "min", max: "max", dateFormat: [0, "date-format", "dateFormat"], dateSeparator: [0, "date-separator", "dateSeparator"], precision: "precision", calendars: "calendars", showDefinedRanges: [0, "show-defined-ranges", "showDefinedRanges"], definedRanges: [0, "defined-ranges", "definedRanges"], invalid: "invalid", readonly: "readonly", quiet: "quiet", placement: "placement", timeZone: [0, "time-zone", "timeZone"], language: "language", labels: "labels", focused: "focused", helpTextManager: [0, "help-text-manager", "helpTextManager"] }, outputs: { changeEvent: "change", inputEvent: "input" }, exportAs: ["luzmoDateRangePicker"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoDateRangePicker_Template(rf, ctx) { if (rf & 1) {
157
+ i0.ɵɵprojectionDef();
158
+ i0.ɵɵprojection(0);
159
+ } }, encapsulation: 2, changeDetection: 0 });
160
+ }
161
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoDateRangePicker, [{
162
+ type: Component,
163
+ args: [{
164
+ selector: 'luzmo-date-range-picker',
165
+ exportAs: 'luzmoDateRangePicker',
166
+ standalone: true,
167
+ changeDetection: ChangeDetectionStrategy.OnPush,
168
+ template: '<ng-content />'
169
+ }]
170
+ }], () => [], { startDate: [{
171
+ type: Input,
172
+ args: [{ alias: 'start-date' }]
173
+ }], endDate: [{
174
+ type: Input,
175
+ args: [{ alias: 'end-date' }]
176
+ }], min: [{
177
+ type: Input,
178
+ args: [{ alias: 'min' }]
179
+ }], max: [{
180
+ type: Input,
181
+ args: [{ alias: 'max' }]
182
+ }], dateFormat: [{
183
+ type: Input,
184
+ args: [{ alias: 'date-format' }]
185
+ }], dateSeparator: [{
186
+ type: Input,
187
+ args: [{ alias: 'date-separator' }]
188
+ }], precision: [{
189
+ type: Input,
190
+ args: [{ alias: 'precision' }]
191
+ }], calendars: [{
192
+ type: Input,
193
+ args: [{ alias: 'calendars' }]
194
+ }], showDefinedRanges: [{
195
+ type: Input,
196
+ args: [{ alias: 'show-defined-ranges' }]
197
+ }], definedRanges: [{
198
+ type: Input,
199
+ args: [{ alias: 'defined-ranges' }]
200
+ }], invalid: [{
201
+ type: Input,
202
+ args: [{ alias: 'invalid' }]
203
+ }], readonly: [{
204
+ type: Input,
205
+ args: [{ alias: 'readonly' }]
206
+ }], quiet: [{
207
+ type: Input,
208
+ args: [{ alias: 'quiet' }]
209
+ }], placement: [{
210
+ type: Input,
211
+ args: [{ alias: 'placement' }]
212
+ }], timeZone: [{
213
+ type: Input,
214
+ args: [{ alias: 'time-zone' }]
215
+ }], language: [{
216
+ type: Input,
217
+ args: [{ alias: 'language' }]
218
+ }], labels: [{
219
+ type: Input,
220
+ args: [{ alias: 'labels' }]
221
+ }], focused: [{
222
+ type: Input,
223
+ args: [{ alias: 'focused' }]
224
+ }], helpTextManager: [{
225
+ type: Input,
226
+ args: [{ alias: 'help-text-manager' }]
227
+ }], changeEvent: [{ type: i0.Output, args: ["change"] }], inputEvent: [{ type: i0.Output, args: ["input"] }] }); })();
228
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoDateRangePicker, { className: "LuzmoDateRangePicker", filePath: "components/date-range-picker.ts", lineNumber: 20 }); })();
@@ -0,0 +1,71 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import '@luzmo/lucero/date-time-picker';
4
+ import type { LuzmoDateTimePicker as LuzmoDateTimePickerHostElement, DateTimePickerLabels, Precision } from '@luzmo/lucero/date-time-picker';
5
+ import * as i0 from "@angular/core";
6
+ export type { DateTimePickerLabels, Precision } from '@luzmo/lucero/date-time-picker';
7
+ export declare class LuzmoDateTimePicker implements OnChanges, ControlValueAccessor {
8
+ private readonly elementRef;
9
+ private readonly renderer;
10
+ private readonly destroyRef;
11
+ private readonly host;
12
+ private readonly listenerCleanup;
13
+ /** The underlying custom element instance. Use to call imperative methods. */
14
+ get nativeElement(): LuzmoDateTimePickerHostElement;
15
+ /** The selected date of the component. If defined, this also indicates where the calendar opens. If not, the calendar opens at the current month, and placeholder values are shown. */
16
+ value?: string;
17
+ /** The minimum valid date a user can select */
18
+ min?: string;
19
+ /** The maximum valid date a user can select */
20
+ max?: string;
21
+ /** The date format to use for display. Can be 'mmdd', 'ddmm', or undefined (uses locale default). */
22
+ dateFormat?: 'mmdd' | 'ddmm';
23
+ /** The separator to use between date segments (month, day, and year). If not specified, the default separator from the locale will be used. */
24
+ dateSeparator?: string;
25
+ /** The granularity used to display the segments of the component's value */
26
+ precision?: Precision;
27
+ /** Whether the `value` held by the form control is invalid. */
28
+ invalid?: boolean;
29
+ /** Whether a user can interact with the value of the form control */
30
+ readonly?: boolean;
31
+ /** Whether to display the form control with no visible background */
32
+ quiet?: boolean;
33
+ /** Whether to display the form control with no visible background */
34
+ placement?: unknown;
35
+ /** The IANA time zone identifier (eg. America/Los_Angeles) to use for parsing the date & setting it */
36
+ timeZone?: string;
37
+ /** Whether to display the form control with no visible background */
38
+ language?: string;
39
+ /** Labels read by screen readers. The default values are in English and can be overridden to localize the content. */
40
+ labels?: DateTimePickerLabels;
41
+ focused?: boolean;
42
+ helpTextManager?: unknown;
43
+ /** Announces when a new date/time is committed by the user */
44
+ readonly changeEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
45
+ /** Announces when the user's input changes the component's segments */
46
+ readonly inputEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
47
+ constructor();
48
+ ngOnChanges(changes: SimpleChanges): void;
49
+ /**
50
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
51
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
52
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
53
+ * undefined / null by clearing their bindings.
54
+ */
55
+ private setHostProperty;
56
+ private bindEvents;
57
+ private onChange;
58
+ private onTouched;
59
+ private isWritingValue;
60
+ private lastCvaValue;
61
+ writeValue(value: string): void;
62
+ registerOnChange(fn: (value: string) => void): void;
63
+ registerOnTouched(fn: () => void): void;
64
+ setDisabledState(isDisabled: boolean): void;
65
+ /** Resets the component's value and segments */
66
+ clear(): void;
67
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoDateTimePicker, never>;
68
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoDateTimePicker, "luzmo-date-time-picker", ["luzmoDateTimePicker"], { "value": { "alias": "value"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "dateFormat": { "alias": "date-format"; "required": false; }; "dateSeparator": { "alias": "date-separator"; "required": false; }; "precision": { "alias": "precision"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "quiet": { "alias": "quiet"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "timeZone": { "alias": "time-zone"; "required": false; }; "language": { "alias": "language"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "focused": { "alias": "focused"; "required": false; }; "helpTextManager": { "alias": "help-text-manager"; "required": false; }; }, { "changeEvent": "change"; "inputEvent": "input"; }, never, ["*"], true, never>;
69
+ }
70
+ /** The underlying custom element type for LuzmoDateTimePicker */
71
+ export type LuzmoDateTimePickerElement = LuzmoDateTimePickerHostElement;