@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,50 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/chat-message';
3
+ import type { LuzmoChatMessage as LuzmoChatMessageHostElement, ChatMessageActions, ChatMessageAvatarPlacement, ChatMessageMeta, ChatMessagePosition, ChatMessageTreatment, ChatMessageVariant } from '@luzmo/lucero/chat-message';
4
+ import * as i0 from "@angular/core";
5
+ export type { ChatMessageActions, ChatMessageAvatarPlacement, ChatMessageMeta, ChatMessagePosition, ChatMessageTreatment, ChatMessageVariant } from '@luzmo/lucero/chat-message';
6
+ export declare class LuzmoChatMessage 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(): LuzmoChatMessageHostElement;
14
+ /** The horizontal position of the message. */
15
+ position?: ChatMessagePosition;
16
+ /** The semantic variant of the message. - `default`: Standard neutral message - `primary`: Primary color theme - `secondary`: Secondary color theme */
17
+ variant?: ChatMessageVariant;
18
+ /** The visual treatment of the message. - `fill`: Full background color (default) - `outline`: Border only with transparent background */
19
+ treatment?: ChatMessageTreatment;
20
+ /** Whether the message should have reduced visual emphasis. When quiet is true, removes border, background, and uses normal font color. */
21
+ quiet?: boolean;
22
+ /** The name of the user who sent the message. */
23
+ name?: string;
24
+ /** The datetime when the message was sent (ISO 8601 string). */
25
+ datetime?: string;
26
+ /** Intl.DateTimeFormatOptions object for formatting the datetime. */
27
+ datetimeFormatOptions?: unknown;
28
+ /** The language to use for formatting the datetime. */
29
+ datetimeLanguage?: string;
30
+ /** Controls whether name and datetime render inside the message header or outside. */
31
+ meta?: ChatMessageMeta;
32
+ /** Controls whether the actions slot renders inside or outside the message. */
33
+ actionsPosition?: ChatMessageActions;
34
+ /** The vertical placement of the avatar relative to the message. */
35
+ avatarPlacement?: ChatMessageAvatarPlacement;
36
+ constructor();
37
+ ngOnChanges(changes: SimpleChanges): void;
38
+ /**
39
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
40
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
41
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
42
+ * undefined / null by clearing their bindings.
43
+ */
44
+ private setHostProperty;
45
+ private bindEvents;
46
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoChatMessage, never>;
47
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoChatMessage, "luzmo-chat-message", ["luzmoChatMessage"], { "position": { "alias": "position"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "treatment": { "alias": "treatment"; "required": false; }; "quiet": { "alias": "quiet"; "required": false; }; "name": { "alias": "name"; "required": false; }; "datetime": { "alias": "datetime"; "required": false; }; "datetimeFormatOptions": { "alias": "datetime-format-options"; "required": false; }; "datetimeLanguage": { "alias": "datetime-language"; "required": false; }; "meta": { "alias": "meta"; "required": false; }; "actionsPosition": { "alias": "actions"; "required": false; }; "avatarPlacement": { "alias": "avatar-placement"; "required": false; }; }, {}, never, ["*"], true, never>;
48
+ }
49
+ /** The underlying custom element type for LuzmoChatMessage */
50
+ export type LuzmoChatMessageElement = LuzmoChatMessageHostElement;
@@ -0,0 +1,156 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/chat-message';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * A chat message component for displaying conversation messages.
7
+ *
8
+ * @slot (default) - Default slot for message content
9
+ * @slot message - Alternative slot for message content (may include custom elements)
10
+ * @slot avatar - Slot for avatar element (use luzmo-avatar)
11
+ * @slot actions - Slot for message actions
12
+ * @slot extra-actions - Slot for extra actions that appear on hover/click/longclick (absolute positioned)
13
+ */
14
+ export class LuzmoChatMessage {
15
+ elementRef = inject(ElementRef);
16
+ renderer = inject(Renderer2);
17
+ destroyRef = inject(DestroyRef);
18
+ host = this.elementRef.nativeElement;
19
+ listenerCleanup = [];
20
+ /** The underlying custom element instance. Use to call imperative methods. */
21
+ get nativeElement() {
22
+ return this.host;
23
+ }
24
+ /** The horizontal position of the message. */
25
+ position;
26
+ /** The semantic variant of the message. - `default`: Standard neutral message - `primary`: Primary color theme - `secondary`: Secondary color theme */
27
+ variant;
28
+ /** The visual treatment of the message. - `fill`: Full background color (default) - `outline`: Border only with transparent background */
29
+ treatment;
30
+ /** Whether the message should have reduced visual emphasis. When quiet is true, removes border, background, and uses normal font color. */
31
+ quiet;
32
+ /** The name of the user who sent the message. */
33
+ name;
34
+ /** The datetime when the message was sent (ISO 8601 string). */
35
+ datetime;
36
+ /** Intl.DateTimeFormatOptions object for formatting the datetime. */
37
+ datetimeFormatOptions;
38
+ /** The language to use for formatting the datetime. */
39
+ datetimeLanguage;
40
+ /** Controls whether name and datetime render inside the message header or outside. */
41
+ meta;
42
+ /** Controls whether the actions slot renders inside or outside the message. */
43
+ actionsPosition;
44
+ /** The vertical placement of the avatar relative to the message. */
45
+ avatarPlacement;
46
+ constructor() {
47
+ this.bindEvents();
48
+ this.destroyRef.onDestroy(() => {
49
+ for (const cleanup of this.listenerCleanup) {
50
+ cleanup();
51
+ }
52
+ });
53
+ }
54
+ ngOnChanges(changes) {
55
+ for (const key of Object.keys(changes)) {
56
+ switch (key) {
57
+ case 'position':
58
+ this.setHostProperty('position', changes['position'].currentValue);
59
+ break;
60
+ case 'variant':
61
+ this.setHostProperty('variant', changes['variant'].currentValue);
62
+ break;
63
+ case 'treatment':
64
+ this.setHostProperty('treatment', changes['treatment'].currentValue);
65
+ break;
66
+ case 'quiet':
67
+ this.setHostProperty('quiet', changes['quiet'].currentValue);
68
+ break;
69
+ case 'name':
70
+ this.setHostProperty('name', changes['name'].currentValue);
71
+ break;
72
+ case 'datetime':
73
+ this.setHostProperty('datetime', changes['datetime'].currentValue);
74
+ break;
75
+ case 'datetimeFormatOptions':
76
+ this.setHostProperty('datetimeFormatOptions', changes['datetimeFormatOptions'].currentValue);
77
+ break;
78
+ case 'datetimeLanguage':
79
+ this.setHostProperty('datetimeLanguage', changes['datetimeLanguage'].currentValue);
80
+ break;
81
+ case 'meta':
82
+ this.setHostProperty('meta', changes['meta'].currentValue);
83
+ break;
84
+ case 'actionsPosition':
85
+ this.setHostProperty('actionsPosition', changes['actionsPosition'].currentValue);
86
+ break;
87
+ case 'avatarPlacement':
88
+ this.setHostProperty('avatarPlacement', changes['avatarPlacement'].currentValue);
89
+ break;
90
+ default:
91
+ break;
92
+ }
93
+ }
94
+ }
95
+ /**
96
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
97
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
98
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
99
+ * undefined / null by clearing their bindings.
100
+ */
101
+ setHostProperty(key, value) {
102
+ this.renderer.setProperty(this.host, key, value);
103
+ }
104
+ bindEvents() {
105
+ // No custom events for this wrapper.
106
+ }
107
+ static ɵfac = function LuzmoChatMessage_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoChatMessage)(); };
108
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoChatMessage, selectors: [["luzmo-chat-message"]], inputs: { position: "position", variant: "variant", treatment: "treatment", quiet: "quiet", name: "name", datetime: "datetime", datetimeFormatOptions: [0, "datetime-format-options", "datetimeFormatOptions"], datetimeLanguage: [0, "datetime-language", "datetimeLanguage"], meta: "meta", actionsPosition: [0, "actions", "actionsPosition"], avatarPlacement: [0, "avatar-placement", "avatarPlacement"] }, exportAs: ["luzmoChatMessage"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoChatMessage_Template(rf, ctx) { if (rf & 1) {
109
+ i0.ɵɵprojectionDef();
110
+ i0.ɵɵprojection(0);
111
+ } }, encapsulation: 2, changeDetection: 0 });
112
+ }
113
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoChatMessage, [{
114
+ type: Component,
115
+ args: [{
116
+ selector: 'luzmo-chat-message',
117
+ exportAs: 'luzmoChatMessage',
118
+ standalone: true,
119
+ changeDetection: ChangeDetectionStrategy.OnPush,
120
+ template: '<ng-content />'
121
+ }]
122
+ }], () => [], { position: [{
123
+ type: Input,
124
+ args: [{ alias: 'position' }]
125
+ }], variant: [{
126
+ type: Input,
127
+ args: [{ alias: 'variant' }]
128
+ }], treatment: [{
129
+ type: Input,
130
+ args: [{ alias: 'treatment' }]
131
+ }], quiet: [{
132
+ type: Input,
133
+ args: [{ alias: 'quiet' }]
134
+ }], name: [{
135
+ type: Input,
136
+ args: [{ alias: 'name' }]
137
+ }], datetime: [{
138
+ type: Input,
139
+ args: [{ alias: 'datetime' }]
140
+ }], datetimeFormatOptions: [{
141
+ type: Input,
142
+ args: [{ alias: 'datetime-format-options' }]
143
+ }], datetimeLanguage: [{
144
+ type: Input,
145
+ args: [{ alias: 'datetime-language' }]
146
+ }], meta: [{
147
+ type: Input,
148
+ args: [{ alias: 'meta' }]
149
+ }], actionsPosition: [{
150
+ type: Input,
151
+ args: [{ alias: 'actions' }]
152
+ }], avatarPlacement: [{
153
+ type: Input,
154
+ args: [{ alias: 'avatar-placement' }]
155
+ }] }); })();
156
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoChatMessage, { className: "LuzmoChatMessage", filePath: "components/chat-message.ts", lineNumber: 22 }); })();
@@ -0,0 +1,55 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import '@luzmo/lucero/checkbox';
4
+ import type { LuzmoCheckbox as LuzmoCheckboxHostElement } from '@luzmo/lucero/checkbox';
5
+ import * as i0 from "@angular/core";
6
+ export declare class LuzmoCheckbox 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(): LuzmoCheckboxHostElement;
14
+ /** Disable this control. It will not receive focus or events */
15
+ disabled?: boolean;
16
+ /** Set the checkbox to an indeterminate state */
17
+ indeterminate?: boolean;
18
+ /** When this control is rendered, focus it automatically */
19
+ autofocus?: boolean;
20
+ /** Set the checkbox to an invalid state */
21
+ invalid?: boolean;
22
+ /** Make the checkbox emphasized */
23
+ emphasized?: boolean;
24
+ tabIndex?: number;
25
+ /** The `checked` attribute reflects the state of the element */
26
+ checked?: boolean;
27
+ /** The name attribute of the element */
28
+ name?: string;
29
+ /** Whether the element is read-only */
30
+ readonly?: boolean;
31
+ /** Announces a change in the `checked` property of a Checkbox */
32
+ readonly changeEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
33
+ constructor();
34
+ ngOnChanges(changes: SimpleChanges): void;
35
+ /**
36
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
37
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
38
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
39
+ * undefined / null by clearing their bindings.
40
+ */
41
+ private setHostProperty;
42
+ private bindEvents;
43
+ private onChange;
44
+ private onTouched;
45
+ private isWritingValue;
46
+ private lastCvaValue;
47
+ writeValue(value: boolean): void;
48
+ registerOnChange(fn: (value: boolean) => void): void;
49
+ registerOnTouched(fn: () => void): void;
50
+ setDisabledState(isDisabled: boolean): void;
51
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoCheckbox, never>;
52
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoCheckbox, "luzmo-checkbox", ["luzmoCheckbox"], { "disabled": { "alias": "disabled"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "autofocus": { "alias": "autofocus"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "emphasized": { "alias": "emphasized"; "required": false; }; "tabIndex": { "alias": "tab-index"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "name": { "alias": "name"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, { "changeEvent": "change"; }, never, ["*"], true, never>;
53
+ }
54
+ /** The underlying custom element type for LuzmoCheckbox */
55
+ export type LuzmoCheckboxElement = LuzmoCheckboxHostElement;
@@ -0,0 +1,196 @@
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/checkbox';
4
+ import * as i0 from "@angular/core";
5
+ const _c0 = ["*"];
6
+ /**
7
+ * Angular wrapper component for <luzmo-checkbox>
8
+ *
9
+ * @slot (default) - content to display as the label for the Checkbox
10
+ */
11
+ export class LuzmoCheckbox {
12
+ elementRef = inject(ElementRef);
13
+ renderer = inject(Renderer2);
14
+ destroyRef = inject(DestroyRef);
15
+ host = this.elementRef.nativeElement;
16
+ listenerCleanup = [];
17
+ /** The underlying custom element instance. Use to call imperative methods. */
18
+ get nativeElement() {
19
+ return this.host;
20
+ }
21
+ /** Disable this control. It will not receive focus or events */
22
+ disabled;
23
+ /** Set the checkbox to an indeterminate state */
24
+ indeterminate;
25
+ /** When this control is rendered, focus it automatically */
26
+ autofocus;
27
+ /** Set the checkbox to an invalid state */
28
+ invalid;
29
+ /** Make the checkbox emphasized */
30
+ emphasized;
31
+ tabIndex;
32
+ /** The `checked` attribute reflects the state of the element */
33
+ checked;
34
+ /** The name attribute of the element */
35
+ name;
36
+ /** Whether the element is read-only */
37
+ readonly;
38
+ /** Announces a change in the `checked` property of a Checkbox */
39
+ changeEvent = output({ alias: 'change' });
40
+ constructor() {
41
+ this.bindEvents();
42
+ this.destroyRef.onDestroy(() => {
43
+ for (const cleanup of this.listenerCleanup) {
44
+ cleanup();
45
+ }
46
+ });
47
+ }
48
+ ngOnChanges(changes) {
49
+ for (const key of Object.keys(changes)) {
50
+ switch (key) {
51
+ case 'disabled':
52
+ this.setHostProperty('disabled', changes['disabled'].currentValue);
53
+ break;
54
+ case 'indeterminate':
55
+ this.setHostProperty('indeterminate', changes['indeterminate'].currentValue);
56
+ break;
57
+ case 'autofocus':
58
+ this.setHostProperty('autofocus', changes['autofocus'].currentValue);
59
+ break;
60
+ case 'invalid':
61
+ this.setHostProperty('invalid', changes['invalid'].currentValue);
62
+ break;
63
+ case 'emphasized':
64
+ this.setHostProperty('emphasized', changes['emphasized'].currentValue);
65
+ break;
66
+ case 'tabIndex':
67
+ this.setHostProperty('tabIndex', changes['tabIndex'].currentValue);
68
+ break;
69
+ case 'checked':
70
+ this.setHostProperty('checked', changes['checked'].currentValue);
71
+ break;
72
+ case 'name':
73
+ this.setHostProperty('name', changes['name'].currentValue);
74
+ break;
75
+ case 'readonly':
76
+ this.setHostProperty('readonly', changes['readonly'].currentValue);
77
+ break;
78
+ default:
79
+ break;
80
+ }
81
+ }
82
+ }
83
+ /**
84
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
85
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
86
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
87
+ * undefined / null by clearing their bindings.
88
+ */
89
+ setHostProperty(key, value) {
90
+ this.renderer.setProperty(this.host, key, value);
91
+ }
92
+ bindEvents() {
93
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'change', (event) => {
94
+ this.changeEvent.emit(event);
95
+ if (!this.isWritingValue) {
96
+ const eventWithDetail = event;
97
+ const eventTarget = event.target;
98
+ const detail = 'detail' in eventWithDetail ? eventWithDetail.detail : undefined;
99
+ const hostRecord = this.host;
100
+ const nextValue = (detail
101
+ ?? eventTarget?.['checked']
102
+ ?? hostRecord['checked']);
103
+ if (Object.is(this.lastCvaValue, nextValue)) {
104
+ return;
105
+ }
106
+ this.lastCvaValue = nextValue;
107
+ this.setHostProperty('checked', nextValue);
108
+ this.onChange(nextValue);
109
+ }
110
+ }));
111
+ this.listenerCleanup.push(this.renderer.listen(this.host, 'blur', () => {
112
+ this.onTouched();
113
+ }));
114
+ }
115
+ onChange = () => { };
116
+ onTouched = () => { };
117
+ isWritingValue = false;
118
+ lastCvaValue;
119
+ writeValue(value) {
120
+ this.isWritingValue = true;
121
+ this.lastCvaValue = value;
122
+ this.setHostProperty('checked', value);
123
+ this.isWritingValue = false;
124
+ }
125
+ registerOnChange(fn) {
126
+ this.onChange = fn;
127
+ }
128
+ registerOnTouched(fn) {
129
+ this.onTouched = fn;
130
+ }
131
+ setDisabledState(isDisabled) {
132
+ this.setHostProperty('disabled', isDisabled);
133
+ if (isDisabled) {
134
+ this.renderer.setAttribute(this.host, 'disabled', '');
135
+ }
136
+ else {
137
+ this.renderer.removeAttribute(this.host, 'disabled');
138
+ }
139
+ }
140
+ static ɵfac = function LuzmoCheckbox_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoCheckbox)(); };
141
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoCheckbox, selectors: [["luzmo-checkbox"]], inputs: { disabled: "disabled", indeterminate: "indeterminate", autofocus: "autofocus", invalid: "invalid", emphasized: "emphasized", tabIndex: [0, "tab-index", "tabIndex"], checked: "checked", name: "name", readonly: "readonly" }, outputs: { changeEvent: "change" }, exportAs: ["luzmoCheckbox"], features: [i0.ɵɵProvidersFeature([
142
+ {
143
+ provide: NG_VALUE_ACCESSOR,
144
+ useExisting: forwardRef(() => LuzmoCheckbox),
145
+ multi: true
146
+ }
147
+ ]), i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoCheckbox_Template(rf, ctx) { if (rf & 1) {
148
+ i0.ɵɵprojectionDef();
149
+ i0.ɵɵprojection(0);
150
+ } }, encapsulation: 2, changeDetection: 0 });
151
+ }
152
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoCheckbox, [{
153
+ type: Component,
154
+ args: [{
155
+ selector: 'luzmo-checkbox',
156
+ exportAs: 'luzmoCheckbox',
157
+ standalone: true,
158
+ changeDetection: ChangeDetectionStrategy.OnPush,
159
+ template: '<ng-content />',
160
+ providers: [
161
+ {
162
+ provide: NG_VALUE_ACCESSOR,
163
+ useExisting: forwardRef(() => LuzmoCheckbox),
164
+ multi: true
165
+ }
166
+ ]
167
+ }]
168
+ }], () => [], { disabled: [{
169
+ type: Input,
170
+ args: [{ alias: 'disabled' }]
171
+ }], indeterminate: [{
172
+ type: Input,
173
+ args: [{ alias: 'indeterminate' }]
174
+ }], autofocus: [{
175
+ type: Input,
176
+ args: [{ alias: 'autofocus' }]
177
+ }], invalid: [{
178
+ type: Input,
179
+ args: [{ alias: 'invalid' }]
180
+ }], emphasized: [{
181
+ type: Input,
182
+ args: [{ alias: 'emphasized' }]
183
+ }], tabIndex: [{
184
+ type: Input,
185
+ args: [{ alias: 'tab-index' }]
186
+ }], checked: [{
187
+ type: Input,
188
+ args: [{ alias: 'checked' }]
189
+ }], name: [{
190
+ type: Input,
191
+ args: [{ alias: 'name' }]
192
+ }], readonly: [{
193
+ type: Input,
194
+ args: [{ alias: 'readonly' }]
195
+ }], changeEvent: [{ type: i0.Output, args: ["change"] }] }); })();
196
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoCheckbox, { className: "LuzmoCheckbox", filePath: "components/checkbox.ts", lineNumber: 25 }); })();
@@ -0,0 +1,32 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/button';
3
+ import type { LuzmoClearButton as LuzmoClearButtonHostElement } from '@luzmo/lucero/button';
4
+ import * as i0 from "@angular/core";
5
+ export declare class LuzmoClearButton 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(): LuzmoClearButtonHostElement;
13
+ /** The visual variant to apply to this button. */
14
+ variant?: 'overBackground' | '';
15
+ active?: boolean;
16
+ /** The default behavior of the button. Possible values are: `button` (default), `submit`, and `reset`. */
17
+ type?: 'button' | 'submit' | 'reset';
18
+ constructor();
19
+ ngOnChanges(changes: SimpleChanges): void;
20
+ /**
21
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
22
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
23
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
24
+ * undefined / null by clearing their bindings.
25
+ */
26
+ private setHostProperty;
27
+ private bindEvents;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoClearButton, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoClearButton, "luzmo-clear-button", ["luzmoClearButton"], { "variant": { "alias": "variant"; "required": false; }; "active": { "alias": "active"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, ["*"], true, never>;
30
+ }
31
+ /** The underlying custom element type for LuzmoClearButton */
32
+ export type LuzmoClearButtonElement = LuzmoClearButtonHostElement;
@@ -0,0 +1,88 @@
1
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, Renderer2 } from '@angular/core';
2
+ import '@luzmo/lucero/button';
3
+ import * as i0 from "@angular/core";
4
+ const _c0 = ["*"];
5
+ /**
6
+ * Angular wrapper component for <luzmo-clear-button>
7
+ *
8
+ * @slot (default) - text label of the Clear Button
9
+ * @slot icon - The icon to use for Clear Button
10
+ */
11
+ export class LuzmoClearButton {
12
+ elementRef = inject(ElementRef);
13
+ renderer = inject(Renderer2);
14
+ destroyRef = inject(DestroyRef);
15
+ host = this.elementRef.nativeElement;
16
+ listenerCleanup = [];
17
+ /** The underlying custom element instance. Use to call imperative methods. */
18
+ get nativeElement() {
19
+ return this.host;
20
+ }
21
+ /** The visual variant to apply to this button. */
22
+ variant;
23
+ active;
24
+ /** The default behavior of the button. Possible values are: `button` (default), `submit`, and `reset`. */
25
+ type;
26
+ constructor() {
27
+ this.bindEvents();
28
+ this.destroyRef.onDestroy(() => {
29
+ for (const cleanup of this.listenerCleanup) {
30
+ cleanup();
31
+ }
32
+ });
33
+ }
34
+ ngOnChanges(changes) {
35
+ for (const key of Object.keys(changes)) {
36
+ switch (key) {
37
+ case 'variant':
38
+ this.setHostProperty('variant', changes['variant'].currentValue);
39
+ break;
40
+ case 'active':
41
+ this.setHostProperty('active', changes['active'].currentValue);
42
+ break;
43
+ case 'type':
44
+ this.setHostProperty('type', changes['type'].currentValue);
45
+ break;
46
+ default:
47
+ break;
48
+ }
49
+ }
50
+ }
51
+ /**
52
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
53
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
54
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
55
+ * undefined / null by clearing their bindings.
56
+ */
57
+ setHostProperty(key, value) {
58
+ this.renderer.setProperty(this.host, key, value);
59
+ }
60
+ bindEvents() {
61
+ // No custom events for this wrapper.
62
+ }
63
+ static ɵfac = function LuzmoClearButton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoClearButton)(); };
64
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoClearButton, selectors: [["luzmo-clear-button"]], inputs: { variant: "variant", active: "active", type: "type" }, exportAs: ["luzmoClearButton"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoClearButton_Template(rf, ctx) { if (rf & 1) {
65
+ i0.ɵɵprojectionDef();
66
+ i0.ɵɵprojection(0);
67
+ } }, encapsulation: 2, changeDetection: 0 });
68
+ }
69
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoClearButton, [{
70
+ type: Component,
71
+ args: [{
72
+ selector: 'luzmo-clear-button',
73
+ exportAs: 'luzmoClearButton',
74
+ standalone: true,
75
+ changeDetection: ChangeDetectionStrategy.OnPush,
76
+ template: '<ng-content />'
77
+ }]
78
+ }], () => [], { variant: [{
79
+ type: Input,
80
+ args: [{ alias: 'variant' }]
81
+ }], active: [{
82
+ type: Input,
83
+ args: [{ alias: 'active' }]
84
+ }], type: [{
85
+ type: Input,
86
+ args: [{ alias: 'type' }]
87
+ }] }); })();
88
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoClearButton, { className: "LuzmoClearButton", filePath: "components/clear-button.ts", lineNumber: 18 }); })();
@@ -0,0 +1,33 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import '@luzmo/lucero/button';
3
+ import type { LuzmoCloseButton as LuzmoCloseButtonHostElement } from '@luzmo/lucero/button';
4
+ import * as i0 from "@angular/core";
5
+ export declare class LuzmoCloseButton 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(): LuzmoCloseButtonHostElement;
13
+ /** The visual variant to apply to this button. */
14
+ variant?: ('white' | 'black') | '';
15
+ staticColor?: 'black' | 'white';
16
+ active?: boolean;
17
+ /** The default behavior of the button. Possible values are: `button` (default), `submit`, and `reset`. */
18
+ type?: 'button' | 'submit' | 'reset';
19
+ constructor();
20
+ ngOnChanges(changes: SimpleChanges): void;
21
+ /**
22
+ * Forward a wrapper @Input to the underlying host element via Renderer2 so
23
+ * the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
24
+ * Unlike a "skip undefined" guard, this lets consumers reset values back to
25
+ * undefined / null by clearing their bindings.
26
+ */
27
+ private setHostProperty;
28
+ private bindEvents;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoCloseButton, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoCloseButton, "luzmo-close-button", ["luzmoCloseButton"], { "variant": { "alias": "variant"; "required": false; }; "staticColor": { "alias": "static-color"; "required": false; }; "active": { "alias": "active"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, ["*"], true, never>;
31
+ }
32
+ /** The underlying custom element type for LuzmoCloseButton */
33
+ export type LuzmoCloseButtonElement = LuzmoCloseButtonHostElement;