@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,321 @@
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-field';
4
+ import * as i0 from "@angular/core";
5
+ const _c0 = ["*"];
6
+ /**
7
+ * Angular wrapper component for <luzmo-color-field>
8
+ */
9
+ export class LuzmoColorField {
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
+ /** Whether the color handle with the preview color is shown */
20
+ viewColor;
21
+ /** Whether the alpha channel is not allowed */
22
+ noAlphaChannel;
23
+ /** The value held by the form control */
24
+ value;
25
+ helpTextManager;
26
+ /** A regular expression outlining the keys that will be allowed to update the value of the form control. */
27
+ allowedKeys;
28
+ /** Whether the `value` held by the form control is invalid. */
29
+ invalid;
30
+ /** A string applied via `aria-label` to the form control when a user visible label is not provided. */
31
+ label;
32
+ /** Name of the form control. */
33
+ name;
34
+ /** Text that appears in the form control when it has no value set */
35
+ placeholder;
36
+ type;
37
+ /** Pattern the `value` must match to be valid */
38
+ pattern;
39
+ /** Whether a form control delivered with the `multiline` attribute will change size vertically to accomodate longer input */
40
+ grows;
41
+ /** Defines the maximum string length that the user can enter */
42
+ maxlength;
43
+ /** Defines the minimum string length that the user can enter */
44
+ minlength;
45
+ /** Whether the form control should accept a value longer than one line */
46
+ multiline;
47
+ /** Whether a user can interact with the value of the form control */
48
+ readonly;
49
+ /** The specific number of rows the form control should provide in the user interface */
50
+ rows;
51
+ /** The maximum number of rows the form control should grow to when `grows` is enabled. When content exceeds this limit, the textarea will show a scrollbar. A value of -1 means no maximum (unlimited growth). When set, the value must be >= 1; values < 1 will be disregarded. */
52
+ maxRows;
53
+ /** Whether the `value` held by the form control is valid. */
54
+ valid;
55
+ /** Whether to hide the validation state icons (valid/invalid icons). */
56
+ hideValidationIcons;
57
+ /** Whether to display the form control with no visible background */
58
+ quiet;
59
+ /** Whether the form control will be found to be invalid when it holds no `value` */
60
+ required;
61
+ /** What form of assistance should be provided when attempting to supply a value to the form control */
62
+ autocomplete;
63
+ /** The value of the color-field has changed. */
64
+ inputEvent = output({ alias: 'input' });
65
+ /** An alteration to the value of the color-field has been committed by the user. */
66
+ changeEvent = output({ alias: 'change' });
67
+ /** A key has been pressed. */
68
+ keypressEvent = output({ alias: 'keypress' });
69
+ constructor() {
70
+ this.bindEvents();
71
+ this.destroyRef.onDestroy(() => {
72
+ for (const cleanup of this.listenerCleanup) {
73
+ cleanup();
74
+ }
75
+ });
76
+ }
77
+ ngOnChanges(changes) {
78
+ for (const key of Object.keys(changes)) {
79
+ switch (key) {
80
+ case 'viewColor':
81
+ this.setHostProperty('viewColor', changes['viewColor'].currentValue);
82
+ break;
83
+ case 'noAlphaChannel':
84
+ this.setHostProperty('noAlphaChannel', changes['noAlphaChannel'].currentValue);
85
+ break;
86
+ case 'value':
87
+ this.setHostProperty('value', changes['value'].currentValue);
88
+ break;
89
+ case 'helpTextManager':
90
+ this.setHostProperty('helpTextManager', changes['helpTextManager'].currentValue);
91
+ break;
92
+ case 'allowedKeys':
93
+ this.setHostProperty('allowedKeys', changes['allowedKeys'].currentValue);
94
+ break;
95
+ case 'invalid':
96
+ this.setHostProperty('invalid', changes['invalid'].currentValue);
97
+ break;
98
+ case 'label':
99
+ this.setHostProperty('label', changes['label'].currentValue);
100
+ break;
101
+ case 'name':
102
+ this.setHostProperty('name', changes['name'].currentValue);
103
+ break;
104
+ case 'placeholder':
105
+ this.setHostProperty('placeholder', changes['placeholder'].currentValue);
106
+ break;
107
+ case 'type':
108
+ this.setHostProperty('type', changes['type'].currentValue);
109
+ break;
110
+ case 'pattern':
111
+ this.setHostProperty('pattern', changes['pattern'].currentValue);
112
+ break;
113
+ case 'grows':
114
+ this.setHostProperty('grows', changes['grows'].currentValue);
115
+ break;
116
+ case 'maxlength':
117
+ this.setHostProperty('maxlength', changes['maxlength'].currentValue);
118
+ break;
119
+ case 'minlength':
120
+ this.setHostProperty('minlength', changes['minlength'].currentValue);
121
+ break;
122
+ case 'multiline':
123
+ this.setHostProperty('multiline', changes['multiline'].currentValue);
124
+ break;
125
+ case 'readonly':
126
+ this.setHostProperty('readonly', changes['readonly'].currentValue);
127
+ break;
128
+ case 'rows':
129
+ this.setHostProperty('rows', changes['rows'].currentValue);
130
+ break;
131
+ case 'maxRows':
132
+ this.setHostProperty('maxRows', changes['maxRows'].currentValue);
133
+ break;
134
+ case 'valid':
135
+ this.setHostProperty('valid', changes['valid'].currentValue);
136
+ break;
137
+ case 'hideValidationIcons':
138
+ this.setHostProperty('hideValidationIcons', changes['hideValidationIcons'].currentValue);
139
+ break;
140
+ case 'quiet':
141
+ this.setHostProperty('quiet', changes['quiet'].currentValue);
142
+ break;
143
+ case 'required':
144
+ this.setHostProperty('required', changes['required'].currentValue);
145
+ break;
146
+ case 'autocomplete':
147
+ this.setHostProperty('autocomplete', changes['autocomplete'].currentValue);
148
+ break;
149
+ default:
150
+ break;
151
+ }
152
+ }
153
+ }
154
+ /**
155
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
156
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
157
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
158
+ * undefined / null by clearing their bindings.
159
+ */
160
+ setHostProperty(key, value) {
161
+ this.renderer.setProperty(this.host, key, value);
162
+ }
163
+ bindEvents() {
164
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'input', (event) => {
165
+ this.inputEvent.emit(event);
166
+ if (!this.isWritingValue) {
167
+ const eventWithDetail = event;
168
+ const eventTarget = event.target;
169
+ const detail = 'detail' in eventWithDetail ? eventWithDetail.detail : undefined;
170
+ const hostRecord = this.host;
171
+ const nextValue = (detail
172
+ ?? eventTarget?.['value']
173
+ ?? hostRecord['value']);
174
+ if (Object.is(this.lastCvaValue, nextValue)) {
175
+ return;
176
+ }
177
+ this.lastCvaValue = nextValue;
178
+ this.setHostProperty('value', nextValue);
179
+ this.onChange(nextValue);
180
+ }
181
+ }));
182
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'change', (event) => {
183
+ this.changeEvent.emit(event);
184
+ }));
185
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'keypress', (event) => {
186
+ this.keypressEvent.emit(event);
187
+ }));
188
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'blur', () => {
189
+ this.onTouched();
190
+ }));
191
+ }
192
+ onChange = () => { };
193
+ onTouched = () => { };
194
+ isWritingValue = false;
195
+ lastCvaValue;
196
+ writeValue(value) {
197
+ this.isWritingValue = true;
198
+ this.lastCvaValue = value;
199
+ this.setHostProperty('value', value);
200
+ this.isWritingValue = false;
201
+ }
202
+ registerOnChange(fn) {
203
+ this.onChange = fn;
204
+ }
205
+ registerOnTouched(fn) {
206
+ this.onTouched = fn;
207
+ }
208
+ setDisabledState(isDisabled) {
209
+ // Underlying element does not declare a 'disabled' field; nothing to do.
210
+ void isDisabled;
211
+ }
212
+ checkValidity() {
213
+ return this.host.checkValidity();
214
+ }
215
+ /** Sets the start and end positions of the current selection. */
216
+ setSelectionRange(selectionStart, selectionEnd, selectionDirection) {
217
+ return this.host.setSelectionRange(selectionStart, selectionEnd, selectionDirection);
218
+ }
219
+ /** Selects all the text. */
220
+ select() {
221
+ return this.host.select();
222
+ }
223
+ static ɵfac = function LuzmoColorField_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoColorField)(); };
224
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoColorField, selectors: [["luzmo-color-field"]], inputs: { viewColor: [0, "view-color", "viewColor"], noAlphaChannel: [0, "no-alpha-channel", "noAlphaChannel"], value: "value", helpTextManager: [0, "help-text-manager", "helpTextManager"], allowedKeys: [0, "allowed-keys", "allowedKeys"], invalid: "invalid", label: "label", name: "name", placeholder: "placeholder", type: "type", pattern: "pattern", grows: "grows", maxlength: "maxlength", minlength: "minlength", multiline: "multiline", readonly: "readonly", rows: "rows", maxRows: [0, "max-rows", "maxRows"], valid: "valid", hideValidationIcons: [0, "hide-validation-icons", "hideValidationIcons"], quiet: "quiet", required: "required", autocomplete: "autocomplete" }, outputs: { inputEvent: "input", changeEvent: "change", keypressEvent: "keypress" }, exportAs: ["luzmoColorField"], features: [i0.ɵɵProvidersFeature([
225
+ {
226
+ provide: NG_VALUE_ACCESSOR,
227
+ useExisting: forwardRef(() => LuzmoColorField),
228
+ multi: true
229
+ }
230
+ ]), i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoColorField_Template(rf, ctx) { if (rf & 1) {
231
+ i0.ɵɵprojectionDef();
232
+ i0.ɵɵprojection(0);
233
+ } }, encapsulation: 2, changeDetection: 0 });
234
+ }
235
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoColorField, [{
236
+ type: Component,
237
+ args: [{
238
+ selector: 'luzmo-color-field',
239
+ exportAs: 'luzmoColorField',
240
+ standalone: true,
241
+ changeDetection: ChangeDetectionStrategy.OnPush,
242
+ template: '<ng-content />',
243
+ providers: [
244
+ {
245
+ provide: NG_VALUE_ACCESSOR,
246
+ useExisting: forwardRef(() => LuzmoColorField),
247
+ multi: true
248
+ }
249
+ ]
250
+ }]
251
+ }], () => [], { viewColor: [{
252
+ type: Input,
253
+ args: [{ alias: 'view-color' }]
254
+ }], noAlphaChannel: [{
255
+ type: Input,
256
+ args: [{ alias: 'no-alpha-channel' }]
257
+ }], value: [{
258
+ type: Input,
259
+ args: [{ alias: 'value' }]
260
+ }], helpTextManager: [{
261
+ type: Input,
262
+ args: [{ alias: 'help-text-manager' }]
263
+ }], allowedKeys: [{
264
+ type: Input,
265
+ args: [{ alias: 'allowed-keys' }]
266
+ }], invalid: [{
267
+ type: Input,
268
+ args: [{ alias: 'invalid' }]
269
+ }], label: [{
270
+ type: Input,
271
+ args: [{ alias: 'label' }]
272
+ }], name: [{
273
+ type: Input,
274
+ args: [{ alias: 'name' }]
275
+ }], placeholder: [{
276
+ type: Input,
277
+ args: [{ alias: 'placeholder' }]
278
+ }], type: [{
279
+ type: Input,
280
+ args: [{ alias: 'type' }]
281
+ }], pattern: [{
282
+ type: Input,
283
+ args: [{ alias: 'pattern' }]
284
+ }], grows: [{
285
+ type: Input,
286
+ args: [{ alias: 'grows' }]
287
+ }], maxlength: [{
288
+ type: Input,
289
+ args: [{ alias: 'maxlength' }]
290
+ }], minlength: [{
291
+ type: Input,
292
+ args: [{ alias: 'minlength' }]
293
+ }], multiline: [{
294
+ type: Input,
295
+ args: [{ alias: 'multiline' }]
296
+ }], readonly: [{
297
+ type: Input,
298
+ args: [{ alias: 'readonly' }]
299
+ }], rows: [{
300
+ type: Input,
301
+ args: [{ alias: 'rows' }]
302
+ }], maxRows: [{
303
+ type: Input,
304
+ args: [{ alias: 'max-rows' }]
305
+ }], valid: [{
306
+ type: Input,
307
+ args: [{ alias: 'valid' }]
308
+ }], hideValidationIcons: [{
309
+ type: Input,
310
+ args: [{ alias: 'hide-validation-icons' }]
311
+ }], quiet: [{
312
+ type: Input,
313
+ args: [{ alias: 'quiet' }]
314
+ }], required: [{
315
+ type: Input,
316
+ args: [{ alias: 'required' }]
317
+ }], autocomplete: [{
318
+ type: Input,
319
+ args: [{ alias: 'autocomplete' }]
320
+ }], inputEvent: [{ type: i0.Output, args: ["input"] }], changeEvent: [{ type: i0.Output, args: ["change"] }], keypressEvent: [{ type: i0.Output, args: ["keypress"] }] }); })();
321
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoColorField, { className: "LuzmoColorField", filePath: "components/color-field.ts", lineNumber: 23 }); })();
@@ -0,0 +1,31 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/color-handle';
3
+ import type { LuzmoColorHandle as LuzmoColorHandleHostElement } from '@luzmo/lucero/color-handle';
4
+ import * as i0 from "@angular/core";
5
+ export declare class LuzmoColorHandle implements OnChanges {
6
+ private readonly elementRef;
7
+ private readonly renderer;
8
+ private readonly destroyRef;
9
+ private readonly host;
10
+ private readonly listenerCleanup;
11
+ /** The underlying custom element instance. Use to call imperative methods. */
12
+ get nativeElement(): LuzmoColorHandleHostElement;
13
+ disabled?: boolean;
14
+ focused?: boolean;
15
+ open?: boolean;
16
+ color?: string;
17
+ constructor();
18
+ ngOnChanges(changes: SimpleChanges): void;
19
+ /**
20
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
21
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
22
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
23
+ * undefined / null by clearing their bindings.
24
+ */
25
+ private setHostProperty;
26
+ private bindEvents;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoColorHandle, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoColorHandle, "luzmo-color-handle", ["luzmoColorHandle"], { "disabled": { "alias": "disabled"; "required": false; }; "focused": { "alias": "focused"; "required": false; }; "open": { "alias": "open"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, {}, never, ["*"], true, never>;
29
+ }
30
+ /** The underlying custom element type for LuzmoColorHandle */
31
+ export type LuzmoColorHandleElement = LuzmoColorHandleHostElement;
@@ -0,0 +1,90 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/color-handle';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * Angular wrapper component for <luzmo-color-handle>
7
+ */
8
+ export class LuzmoColorHandle {
9
+ elementRef = inject(ElementRef);
10
+ renderer = inject(Renderer2);
11
+ destroyRef = inject(DestroyRef);
12
+ host = this.elementRef.nativeElement;
13
+ listenerCleanup = [];
14
+ /** The underlying custom element instance. Use to call imperative methods. */
15
+ get nativeElement() {
16
+ return this.host;
17
+ }
18
+ disabled;
19
+ focused;
20
+ open;
21
+ color;
22
+ constructor() {
23
+ this.bindEvents();
24
+ this.destroyRef.onDestroy(() => {
25
+ for (const cleanup of this.listenerCleanup) {
26
+ cleanup();
27
+ }
28
+ });
29
+ }
30
+ ngOnChanges(changes) {
31
+ for (const key of Object.keys(changes)) {
32
+ switch (key) {
33
+ case 'disabled':
34
+ this.setHostProperty('disabled', changes['disabled'].currentValue);
35
+ break;
36
+ case 'focused':
37
+ this.setHostProperty('focused', changes['focused'].currentValue);
38
+ break;
39
+ case 'open':
40
+ this.setHostProperty('open', changes['open'].currentValue);
41
+ break;
42
+ case 'color':
43
+ this.setHostProperty('color', changes['color'].currentValue);
44
+ break;
45
+ default:
46
+ break;
47
+ }
48
+ }
49
+ }
50
+ /**
51
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
52
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
53
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
54
+ * undefined / null by clearing their bindings.
55
+ */
56
+ setHostProperty(key, value) {
57
+ this.renderer.setProperty(this.host, key, value);
58
+ }
59
+ bindEvents() {
60
+ // No custom events for this wrapper.
61
+ }
62
+ static ɵfac = function LuzmoColorHandle_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoColorHandle)(); };
63
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoColorHandle, selectors: [["luzmo-color-handle"]], inputs: { disabled: "disabled", focused: "focused", open: "open", color: "color" }, exportAs: ["luzmoColorHandle"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoColorHandle_Template(rf, ctx) { if (rf & 1) {
64
+ i0.ɵɵprojectionDef();
65
+ i0.ɵɵprojection(0);
66
+ } }, encapsulation: 2, changeDetection: 0 });
67
+ }
68
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoColorHandle, [{
69
+ type: Component,
70
+ args: [{
71
+ selector: 'luzmo-color-handle',
72
+ exportAs: 'luzmoColorHandle',
73
+ standalone: true,
74
+ changeDetection: ChangeDetectionStrategy.OnPush,
75
+ template: '<ng-content />'
76
+ }]
77
+ }], () => [], { disabled: [{
78
+ type: Input,
79
+ args: [{ alias: 'disabled' }]
80
+ }], focused: [{
81
+ type: Input,
82
+ args: [{ alias: 'focused' }]
83
+ }], open: [{
84
+ type: Input,
85
+ args: [{ alias: 'open' }]
86
+ }], color: [{
87
+ type: Input,
88
+ args: [{ alias: 'color' }]
89
+ }] }); })();
90
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoColorHandle, { className: "LuzmoColorHandle", filePath: "components/color-handle.ts", lineNumber: 15 }); })();
@@ -0,0 +1,29 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/color-loupe';
3
+ import type { LuzmoColorLoupe as LuzmoColorLoupeHostElement } from '@luzmo/lucero/color-loupe';
4
+ import * as i0 from "@angular/core";
5
+ export declare class LuzmoColorLoupe implements OnChanges {
6
+ private readonly elementRef;
7
+ private readonly renderer;
8
+ private readonly destroyRef;
9
+ private readonly host;
10
+ private readonly listenerCleanup;
11
+ /** The underlying custom element instance. Use to call imperative methods. */
12
+ get nativeElement(): LuzmoColorLoupeHostElement;
13
+ open?: boolean;
14
+ color?: string;
15
+ constructor();
16
+ ngOnChanges(changes: SimpleChanges): void;
17
+ /**
18
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
19
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
20
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
21
+ * undefined / null by clearing their bindings.
22
+ */
23
+ private setHostProperty;
24
+ private bindEvents;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoColorLoupe, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoColorLoupe, "luzmo-color-loupe", ["luzmoColorLoupe"], { "open": { "alias": "open"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, {}, never, ["*"], true, never>;
27
+ }
28
+ /** The underlying custom element type for LuzmoColorLoupe */
29
+ export type LuzmoColorLoupeElement = LuzmoColorLoupeHostElement;
@@ -0,0 +1,76 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/color-loupe';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * Angular wrapper component for <luzmo-color-loupe>
7
+ */
8
+ export class LuzmoColorLoupe {
9
+ elementRef = inject(ElementRef);
10
+ renderer = inject(Renderer2);
11
+ destroyRef = inject(DestroyRef);
12
+ host = this.elementRef.nativeElement;
13
+ listenerCleanup = [];
14
+ /** The underlying custom element instance. Use to call imperative methods. */
15
+ get nativeElement() {
16
+ return this.host;
17
+ }
18
+ open;
19
+ color;
20
+ constructor() {
21
+ this.bindEvents();
22
+ this.destroyRef.onDestroy(() => {
23
+ for (const cleanup of this.listenerCleanup) {
24
+ cleanup();
25
+ }
26
+ });
27
+ }
28
+ ngOnChanges(changes) {
29
+ for (const key of Object.keys(changes)) {
30
+ switch (key) {
31
+ case 'open':
32
+ this.setHostProperty('open', changes['open'].currentValue);
33
+ break;
34
+ case 'color':
35
+ this.setHostProperty('color', changes['color'].currentValue);
36
+ break;
37
+ default:
38
+ break;
39
+ }
40
+ }
41
+ }
42
+ /**
43
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
44
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
45
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
46
+ * undefined / null by clearing their bindings.
47
+ */
48
+ setHostProperty(key, value) {
49
+ this.renderer.setProperty(this.host, key, value);
50
+ }
51
+ bindEvents() {
52
+ // No custom events for this wrapper.
53
+ }
54
+ static ɵfac = function LuzmoColorLoupe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoColorLoupe)(); };
55
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoColorLoupe, selectors: [["luzmo-color-loupe"]], inputs: { open: "open", color: "color" }, exportAs: ["luzmoColorLoupe"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoColorLoupe_Template(rf, ctx) { if (rf & 1) {
56
+ i0.ɵɵprojectionDef();
57
+ i0.ɵɵprojection(0);
58
+ } }, encapsulation: 2, changeDetection: 0 });
59
+ }
60
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoColorLoupe, [{
61
+ type: Component,
62
+ args: [{
63
+ selector: 'luzmo-color-loupe',
64
+ exportAs: 'luzmoColorLoupe',
65
+ standalone: true,
66
+ changeDetection: ChangeDetectionStrategy.OnPush,
67
+ template: '<ng-content />'
68
+ }]
69
+ }], () => [], { open: [{
70
+ type: Input,
71
+ args: [{ alias: 'open' }]
72
+ }], color: [{
73
+ type: Input,
74
+ args: [{ alias: 'color' }]
75
+ }] }); })();
76
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoColorLoupe, { className: "LuzmoColorLoupe", filePath: "components/color-loupe.ts", lineNumber: 15 }); })();
@@ -0,0 +1,36 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/color-menu';
3
+ import type { LuzmoColorMenu as LuzmoColorMenuHostElement } from '@luzmo/lucero/color-menu';
4
+ import * as i0 from "@angular/core";
5
+ export declare class LuzmoColorMenu implements OnChanges {
6
+ private readonly elementRef;
7
+ private readonly renderer;
8
+ private readonly destroyRef;
9
+ private readonly host;
10
+ private readonly listenerCleanup;
11
+ /** The underlying custom element instance. Use to call imperative methods. */
12
+ get nativeElement(): LuzmoColorMenuHostElement;
13
+ /** The color value of the Color Menu */
14
+ color?: unknown;
15
+ /** Whether the alpha channel is available */
16
+ noAlphaChannel?: boolean;
17
+ /** The swatches available in the color menu */
18
+ swatches?: string[];
19
+ areaElement?: unknown;
20
+ /** An alteration to the value of the Color Menu has been committed by the user. */
21
+ readonly changeEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
22
+ constructor();
23
+ ngOnChanges(changes: SimpleChanges): void;
24
+ /**
25
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
26
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
27
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
28
+ * undefined / null by clearing their bindings.
29
+ */
30
+ private setHostProperty;
31
+ private bindEvents;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoColorMenu, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoColorMenu, "luzmo-color-menu", ["luzmoColorMenu"], { "color": { "alias": "color"; "required": false; }; "noAlphaChannel": { "alias": "no-alpha-channel"; "required": false; }; "swatches": { "alias": "swatches"; "required": false; }; "areaElement": { "alias": "area-element"; "required": false; }; }, { "changeEvent": "change"; }, never, ["*"], true, never>;
34
+ }
35
+ /** The underlying custom element type for LuzmoColorMenu */
36
+ export type LuzmoColorMenuElement = LuzmoColorMenuHostElement;