@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.
- package/README.md +41 -0
- package/esm/components/accordion-item.d.ts +32 -0
- package/esm/components/accordion-item.js +89 -0
- package/esm/components/accordion.d.ts +38 -0
- package/esm/components/accordion.js +107 -0
- package/esm/components/action-bar.d.ts +32 -0
- package/esm/components/action-bar.js +83 -0
- package/esm/components/action-button.d.ts +59 -0
- package/esm/components/action-button.js +205 -0
- package/esm/components/action-group.d.ts +42 -0
- package/esm/components/action-group.js +155 -0
- package/esm/components/action-menu.d.ts +75 -0
- package/esm/components/action-menu.js +337 -0
- package/esm/components/avatar.d.ts +35 -0
- package/esm/components/avatar.js +94 -0
- package/esm/components/badge.d.ts +31 -0
- package/esm/components/badge.js +86 -0
- package/esm/components/button-group.d.ts +28 -0
- package/esm/components/button-group.js +71 -0
- package/esm/components/button.d.ts +40 -0
- package/esm/components/button.js +140 -0
- package/esm/components/calendar.d.ts +64 -0
- package/esm/components/calendar.js +218 -0
- package/esm/components/chat-message-group.d.ts +29 -0
- package/esm/components/chat-message-group.js +76 -0
- package/esm/components/chat-message.d.ts +50 -0
- package/esm/components/chat-message.js +156 -0
- package/esm/components/checkbox.d.ts +55 -0
- package/esm/components/checkbox.js +196 -0
- package/esm/components/clear-button.d.ts +32 -0
- package/esm/components/clear-button.js +88 -0
- package/esm/components/close-button.d.ts +33 -0
- package/esm/components/close-button.js +95 -0
- package/esm/components/color-area.d.ts +45 -0
- package/esm/components/color-area.js +167 -0
- package/esm/components/color-field.d.ts +91 -0
- package/esm/components/color-field.js +321 -0
- package/esm/components/color-handle.d.ts +31 -0
- package/esm/components/color-handle.js +90 -0
- package/esm/components/color-loupe.d.ts +29 -0
- package/esm/components/color-loupe.js +76 -0
- package/esm/components/color-menu.d.ts +36 -0
- package/esm/components/color-menu.js +97 -0
- package/esm/components/color-palette-group.d.ts +40 -0
- package/esm/components/color-palette-group.js +117 -0
- package/esm/components/color-palette.d.ts +43 -0
- package/esm/components/color-palette.js +126 -0
- package/esm/components/color-picker.d.ts +49 -0
- package/esm/components/color-picker.js +143 -0
- package/esm/components/color-slider.d.ts +53 -0
- package/esm/components/color-slider.js +215 -0
- package/esm/components/date-range-picker.d.ts +69 -0
- package/esm/components/date-range-picker.js +228 -0
- package/esm/components/date-time-picker.d.ts +71 -0
- package/esm/components/date-time-picker.js +249 -0
- package/esm/components/divider.d.ts +31 -0
- package/esm/components/divider.js +78 -0
- package/esm/components/field-group.d.ts +32 -0
- package/esm/components/field-group.js +101 -0
- package/esm/components/field-label.d.ts +37 -0
- package/esm/components/field-label.js +104 -0
- package/esm/components/help-text.d.ts +30 -0
- package/esm/components/help-text.js +77 -0
- package/esm/components/icon.d.ts +33 -0
- package/esm/components/icon.js +104 -0
- package/esm/components/infield-button.d.ts +35 -0
- package/esm/components/infield-button.js +103 -0
- package/esm/components/label.d.ts +29 -0
- package/esm/components/label.js +76 -0
- package/esm/components/menu.d.ts +53 -0
- package/esm/components/menu.js +218 -0
- package/esm/components/multi-language-field.d.ts +58 -0
- package/esm/components/multi-language-field.js +263 -0
- package/esm/components/number-field.d.ts +103 -0
- package/esm/components/number-field.js +372 -0
- package/esm/components/options.d.ts +58 -0
- package/esm/components/options.js +207 -0
- package/esm/components/overlay.d.ts +67 -0
- package/esm/components/overlay.js +212 -0
- package/esm/components/picker-button.d.ts +32 -0
- package/esm/components/picker-button.js +94 -0
- package/esm/components/picker.d.ts +79 -0
- package/esm/components/picker.js +340 -0
- package/esm/components/popover.d.ts +33 -0
- package/esm/components/popover.js +93 -0
- package/esm/components/progress-bar.d.ts +35 -0
- package/esm/components/progress-bar.js +121 -0
- package/esm/components/progress-circle.d.ts +35 -0
- package/esm/components/progress-circle.js +94 -0
- package/esm/components/progress-steps.d.ts +46 -0
- package/esm/components/progress-steps.js +127 -0
- package/esm/components/prompt-box.d.ts +88 -0
- package/esm/components/prompt-box.js +280 -0
- package/esm/components/radio-group.d.ts +39 -0
- package/esm/components/radio-group.js +136 -0
- package/esm/components/radio.d.ts +46 -0
- package/esm/components/radio.js +172 -0
- package/esm/components/search.d.ts +95 -0
- package/esm/components/search.js +351 -0
- package/esm/components/select.d.ts +82 -0
- package/esm/components/select.js +351 -0
- package/esm/components/slider.d.ts +47 -0
- package/esm/components/slider.js +185 -0
- package/esm/components/status-light.d.ts +30 -0
- package/esm/components/status-light.js +78 -0
- package/esm/components/swatch-group.d.ts +37 -0
- package/esm/components/swatch-group.js +126 -0
- package/esm/components/swatch.d.ts +49 -0
- package/esm/components/swatch.js +197 -0
- package/esm/components/switch.d.ts +48 -0
- package/esm/components/switch.js +160 -0
- package/esm/components/tab-panel.d.ts +29 -0
- package/esm/components/tab-panel.js +78 -0
- package/esm/components/tab.d.ts +32 -0
- package/esm/components/tab.js +100 -0
- package/esm/components/tabs-overflow.d.ts +33 -0
- package/esm/components/tabs-overflow.js +97 -0
- package/esm/components/tabs.d.ts +43 -0
- package/esm/components/tabs.js +150 -0
- package/esm/components/tag.d.ts +31 -0
- package/esm/components/tag.js +90 -0
- package/esm/components/tags.d.ts +30 -0
- package/esm/components/tags.js +81 -0
- package/esm/components/text-field.d.ts +87 -0
- package/esm/components/text-field.js +308 -0
- package/esm/components/toast.d.ts +30 -0
- package/esm/components/toast.js +68 -0
- package/esm/components/tooltip.d.ts +44 -0
- package/esm/components/tooltip.js +154 -0
- package/esm/components/top-nav-item.d.ts +35 -0
- package/esm/components/top-nav-item.js +120 -0
- package/esm/components/top-nav.d.ts +35 -0
- package/esm/components/top-nav.js +110 -0
- package/esm/index.d.ts +135 -0
- package/esm/index.js +269 -0
- package/package.json +40 -0
|
@@ -0,0 +1,351 @@
|
|
|
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/select';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
const _c0 = ["*"];
|
|
6
|
+
/**
|
|
7
|
+
* Angular wrapper component for <luzmo-select>
|
|
8
|
+
*
|
|
9
|
+
* @slot label - The placeholder content for the Select
|
|
10
|
+
* @slot description - The description content for the Select
|
|
11
|
+
* @slot tooltip - Tooltip to to be applied to the the Select Button
|
|
12
|
+
*/
|
|
13
|
+
export class LuzmoSelect {
|
|
14
|
+
elementRef = inject(ElementRef);
|
|
15
|
+
renderer = inject(Renderer2);
|
|
16
|
+
destroyRef = inject(DestroyRef);
|
|
17
|
+
host = this.elementRef.nativeElement;
|
|
18
|
+
listenerCleanup = [];
|
|
19
|
+
/** The underlying custom element instance. Use to call imperative methods. */
|
|
20
|
+
get nativeElement() {
|
|
21
|
+
return this.host;
|
|
22
|
+
}
|
|
23
|
+
disabled;
|
|
24
|
+
focused;
|
|
25
|
+
icons;
|
|
26
|
+
variant;
|
|
27
|
+
emphasized;
|
|
28
|
+
invalid;
|
|
29
|
+
search;
|
|
30
|
+
noWrap;
|
|
31
|
+
retrieving;
|
|
32
|
+
pending;
|
|
33
|
+
clearable;
|
|
34
|
+
hideDropdownIcon;
|
|
35
|
+
/** Defines a string value that labels the Picker while it is in pending state. */
|
|
36
|
+
pendingLabel;
|
|
37
|
+
/** Defines a string value that labels the search input field. */
|
|
38
|
+
searchLabel;
|
|
39
|
+
/** Defines a string value that is displayed when no results are found. */
|
|
40
|
+
noResultsLabel;
|
|
41
|
+
noDataLabel;
|
|
42
|
+
multipleLabelTemplate;
|
|
43
|
+
label;
|
|
44
|
+
open;
|
|
45
|
+
readonly;
|
|
46
|
+
labelAlignment;
|
|
47
|
+
placement;
|
|
48
|
+
quiet;
|
|
49
|
+
/** The value of the select. */
|
|
50
|
+
value;
|
|
51
|
+
/** The options of the select. */
|
|
52
|
+
options;
|
|
53
|
+
/** Optional icon renderer callback forwarded to luzmo-options. Return null to use the default icon/imgSrc rendering. */
|
|
54
|
+
optionIconRenderer;
|
|
55
|
+
selects;
|
|
56
|
+
/** Announces that the `value` of the element has changed */
|
|
57
|
+
changeEvent = output({ alias: 'change' });
|
|
58
|
+
/** Announces that the user has scrolled within the options menu. Only fires when the options menu is virtualized. */
|
|
59
|
+
luzmoScrolledEvent = output({ alias: 'luzmo-scrolled' });
|
|
60
|
+
/** Announces that the search has been updated */
|
|
61
|
+
luzmoSearchEvent = output({ alias: 'luzmo-search' });
|
|
62
|
+
/** Announces that the overlay has been opened */
|
|
63
|
+
luzmoOpenedEvent = output({ alias: 'luzmo-opened' });
|
|
64
|
+
/** Announces that the overlay has been closed */
|
|
65
|
+
luzmoClosedEvent = output({ alias: 'luzmo-closed' });
|
|
66
|
+
constructor() {
|
|
67
|
+
this.bindEvents();
|
|
68
|
+
this.destroyRef.onDestroy(() => {
|
|
69
|
+
for (const cleanup of this.listenerCleanup) {
|
|
70
|
+
cleanup();
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
ngOnChanges(changes) {
|
|
75
|
+
for (const key of Object.keys(changes)) {
|
|
76
|
+
switch (key) {
|
|
77
|
+
case 'disabled':
|
|
78
|
+
this.setHostProperty('disabled', changes['disabled'].currentValue);
|
|
79
|
+
break;
|
|
80
|
+
case 'focused':
|
|
81
|
+
this.setHostProperty('focused', changes['focused'].currentValue);
|
|
82
|
+
break;
|
|
83
|
+
case 'icons':
|
|
84
|
+
this.setHostProperty('icons', changes['icons'].currentValue);
|
|
85
|
+
break;
|
|
86
|
+
case 'variant':
|
|
87
|
+
this.setHostProperty('variant', changes['variant'].currentValue);
|
|
88
|
+
break;
|
|
89
|
+
case 'emphasized':
|
|
90
|
+
this.setHostProperty('emphasized', changes['emphasized'].currentValue);
|
|
91
|
+
break;
|
|
92
|
+
case 'invalid':
|
|
93
|
+
this.setHostProperty('invalid', changes['invalid'].currentValue);
|
|
94
|
+
break;
|
|
95
|
+
case 'search':
|
|
96
|
+
this.setHostProperty('search', changes['search'].currentValue);
|
|
97
|
+
break;
|
|
98
|
+
case 'noWrap':
|
|
99
|
+
this.setHostProperty('noWrap', changes['noWrap'].currentValue);
|
|
100
|
+
break;
|
|
101
|
+
case 'retrieving':
|
|
102
|
+
this.setHostProperty('retrieving', changes['retrieving'].currentValue);
|
|
103
|
+
break;
|
|
104
|
+
case 'pending':
|
|
105
|
+
this.setHostProperty('pending', changes['pending'].currentValue);
|
|
106
|
+
break;
|
|
107
|
+
case 'clearable':
|
|
108
|
+
this.setHostProperty('clearable', changes['clearable'].currentValue);
|
|
109
|
+
break;
|
|
110
|
+
case 'hideDropdownIcon':
|
|
111
|
+
this.setHostProperty('hideDropdownIcon', changes['hideDropdownIcon'].currentValue);
|
|
112
|
+
break;
|
|
113
|
+
case 'pendingLabel':
|
|
114
|
+
this.setHostProperty('pendingLabel', changes['pendingLabel'].currentValue);
|
|
115
|
+
break;
|
|
116
|
+
case 'searchLabel':
|
|
117
|
+
this.setHostProperty('searchLabel', changes['searchLabel'].currentValue);
|
|
118
|
+
break;
|
|
119
|
+
case 'noResultsLabel':
|
|
120
|
+
this.setHostProperty('noResultsLabel', changes['noResultsLabel'].currentValue);
|
|
121
|
+
break;
|
|
122
|
+
case 'noDataLabel':
|
|
123
|
+
this.setHostProperty('noDataLabel', changes['noDataLabel'].currentValue);
|
|
124
|
+
break;
|
|
125
|
+
case 'multipleLabelTemplate':
|
|
126
|
+
this.setHostProperty('multipleLabelTemplate', changes['multipleLabelTemplate'].currentValue);
|
|
127
|
+
break;
|
|
128
|
+
case 'label':
|
|
129
|
+
this.setHostProperty('label', changes['label'].currentValue);
|
|
130
|
+
break;
|
|
131
|
+
case 'open':
|
|
132
|
+
this.setHostProperty('open', changes['open'].currentValue);
|
|
133
|
+
break;
|
|
134
|
+
case 'readonly':
|
|
135
|
+
this.setHostProperty('readonly', changes['readonly'].currentValue);
|
|
136
|
+
break;
|
|
137
|
+
case 'labelAlignment':
|
|
138
|
+
this.setHostProperty('labelAlignment', changes['labelAlignment'].currentValue);
|
|
139
|
+
break;
|
|
140
|
+
case 'placement':
|
|
141
|
+
this.setHostProperty('placement', changes['placement'].currentValue);
|
|
142
|
+
break;
|
|
143
|
+
case 'quiet':
|
|
144
|
+
this.setHostProperty('quiet', changes['quiet'].currentValue);
|
|
145
|
+
break;
|
|
146
|
+
case 'value':
|
|
147
|
+
this.setHostProperty('value', changes['value'].currentValue);
|
|
148
|
+
break;
|
|
149
|
+
case 'options':
|
|
150
|
+
this.setHostProperty('options', changes['options'].currentValue);
|
|
151
|
+
break;
|
|
152
|
+
case 'optionIconRenderer':
|
|
153
|
+
this.setHostProperty('optionIconRenderer', changes['optionIconRenderer'].currentValue);
|
|
154
|
+
break;
|
|
155
|
+
case 'selects':
|
|
156
|
+
this.setHostProperty('selects', changes['selects'].currentValue);
|
|
157
|
+
break;
|
|
158
|
+
default:
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
165
|
+
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
166
|
+
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
167
|
+
* undefined / null by clearing their bindings.
|
|
168
|
+
*/
|
|
169
|
+
setHostProperty(key, value) {
|
|
170
|
+
this.renderer.setProperty(this.host, key, value);
|
|
171
|
+
}
|
|
172
|
+
bindEvents() {
|
|
173
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'change', (event) => {
|
|
174
|
+
this.changeEvent.emit(event);
|
|
175
|
+
if (!this.isWritingValue) {
|
|
176
|
+
const eventWithDetail = event;
|
|
177
|
+
const eventTarget = event.target;
|
|
178
|
+
const detail = 'detail' in eventWithDetail ? eventWithDetail.detail : undefined;
|
|
179
|
+
const hostRecord = this.host;
|
|
180
|
+
const nextValue = (detail
|
|
181
|
+
?? eventTarget?.['value']
|
|
182
|
+
?? hostRecord['value']);
|
|
183
|
+
if (Object.is(this.lastCvaValue, nextValue)) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
this.lastCvaValue = nextValue;
|
|
187
|
+
this.setHostProperty('value', nextValue);
|
|
188
|
+
this.onChange(nextValue);
|
|
189
|
+
}
|
|
190
|
+
}));
|
|
191
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-scrolled', (event) => {
|
|
192
|
+
this.luzmoScrolledEvent.emit(event);
|
|
193
|
+
}));
|
|
194
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-search', (event) => {
|
|
195
|
+
this.luzmoSearchEvent.emit(event);
|
|
196
|
+
}));
|
|
197
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-opened', (event) => {
|
|
198
|
+
this.luzmoOpenedEvent.emit(event);
|
|
199
|
+
}));
|
|
200
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'luzmo-closed', (event) => {
|
|
201
|
+
this.luzmoClosedEvent.emit(event);
|
|
202
|
+
}));
|
|
203
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'blur', () => {
|
|
204
|
+
this.onTouched();
|
|
205
|
+
}));
|
|
206
|
+
}
|
|
207
|
+
onChange = () => { };
|
|
208
|
+
onTouched = () => { };
|
|
209
|
+
isWritingValue = false;
|
|
210
|
+
lastCvaValue;
|
|
211
|
+
writeValue(value) {
|
|
212
|
+
this.isWritingValue = true;
|
|
213
|
+
this.lastCvaValue = value;
|
|
214
|
+
this.setHostProperty('value', value);
|
|
215
|
+
this.isWritingValue = false;
|
|
216
|
+
}
|
|
217
|
+
registerOnChange(fn) {
|
|
218
|
+
this.onChange = fn;
|
|
219
|
+
}
|
|
220
|
+
registerOnTouched(fn) {
|
|
221
|
+
this.onTouched = fn;
|
|
222
|
+
}
|
|
223
|
+
setDisabledState(isDisabled) {
|
|
224
|
+
this.setHostProperty('disabled', isDisabled);
|
|
225
|
+
if (isDisabled) {
|
|
226
|
+
this.renderer.setAttribute(this.host, 'disabled', '');
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
this.renderer.removeAttribute(this.host, 'disabled');
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
focus(options) {
|
|
233
|
+
return this.host.focus(options);
|
|
234
|
+
}
|
|
235
|
+
toggle(target) {
|
|
236
|
+
return this.host.toggle(target);
|
|
237
|
+
}
|
|
238
|
+
close() {
|
|
239
|
+
return this.host.close();
|
|
240
|
+
}
|
|
241
|
+
static ɵfac = function LuzmoSelect_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoSelect)(); };
|
|
242
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoSelect, selectors: [["luzmo-select"]], inputs: { disabled: "disabled", focused: "focused", icons: "icons", variant: "variant", emphasized: "emphasized", invalid: "invalid", search: "search", noWrap: [0, "no-wrap", "noWrap"], retrieving: "retrieving", pending: "pending", clearable: "clearable", hideDropdownIcon: [0, "hide-dropdown-icon", "hideDropdownIcon"], pendingLabel: [0, "pending-label", "pendingLabel"], searchLabel: [0, "search-label", "searchLabel"], noResultsLabel: [0, "no-results-label", "noResultsLabel"], noDataLabel: [0, "no-data-label", "noDataLabel"], multipleLabelTemplate: [0, "multiple-label-template", "multipleLabelTemplate"], label: "label", open: "open", readonly: "readonly", labelAlignment: [0, "label-alignment", "labelAlignment"], placement: "placement", quiet: "quiet", value: "value", options: "options", optionIconRenderer: [0, "option-icon-renderer", "optionIconRenderer"], selects: "selects" }, outputs: { changeEvent: "change", luzmoScrolledEvent: "luzmo-scrolled", luzmoSearchEvent: "luzmo-search", luzmoOpenedEvent: "luzmo-opened", luzmoClosedEvent: "luzmo-closed" }, exportAs: ["luzmoSelect"], features: [i0.ɵɵProvidersFeature([
|
|
243
|
+
{
|
|
244
|
+
provide: NG_VALUE_ACCESSOR,
|
|
245
|
+
useExisting: forwardRef(() => LuzmoSelect),
|
|
246
|
+
multi: true
|
|
247
|
+
}
|
|
248
|
+
]), i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoSelect_Template(rf, ctx) { if (rf & 1) {
|
|
249
|
+
i0.ɵɵprojectionDef();
|
|
250
|
+
i0.ɵɵprojection(0);
|
|
251
|
+
} }, encapsulation: 2, changeDetection: 0 });
|
|
252
|
+
}
|
|
253
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoSelect, [{
|
|
254
|
+
type: Component,
|
|
255
|
+
args: [{
|
|
256
|
+
selector: 'luzmo-select',
|
|
257
|
+
exportAs: 'luzmoSelect',
|
|
258
|
+
standalone: true,
|
|
259
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
260
|
+
template: '<ng-content />',
|
|
261
|
+
providers: [
|
|
262
|
+
{
|
|
263
|
+
provide: NG_VALUE_ACCESSOR,
|
|
264
|
+
useExisting: forwardRef(() => LuzmoSelect),
|
|
265
|
+
multi: true
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
}]
|
|
269
|
+
}], () => [], { disabled: [{
|
|
270
|
+
type: Input,
|
|
271
|
+
args: [{ alias: 'disabled' }]
|
|
272
|
+
}], focused: [{
|
|
273
|
+
type: Input,
|
|
274
|
+
args: [{ alias: 'focused' }]
|
|
275
|
+
}], icons: [{
|
|
276
|
+
type: Input,
|
|
277
|
+
args: [{ alias: 'icons' }]
|
|
278
|
+
}], variant: [{
|
|
279
|
+
type: Input,
|
|
280
|
+
args: [{ alias: 'variant' }]
|
|
281
|
+
}], emphasized: [{
|
|
282
|
+
type: Input,
|
|
283
|
+
args: [{ alias: 'emphasized' }]
|
|
284
|
+
}], invalid: [{
|
|
285
|
+
type: Input,
|
|
286
|
+
args: [{ alias: 'invalid' }]
|
|
287
|
+
}], search: [{
|
|
288
|
+
type: Input,
|
|
289
|
+
args: [{ alias: 'search' }]
|
|
290
|
+
}], noWrap: [{
|
|
291
|
+
type: Input,
|
|
292
|
+
args: [{ alias: 'no-wrap' }]
|
|
293
|
+
}], retrieving: [{
|
|
294
|
+
type: Input,
|
|
295
|
+
args: [{ alias: 'retrieving' }]
|
|
296
|
+
}], pending: [{
|
|
297
|
+
type: Input,
|
|
298
|
+
args: [{ alias: 'pending' }]
|
|
299
|
+
}], clearable: [{
|
|
300
|
+
type: Input,
|
|
301
|
+
args: [{ alias: 'clearable' }]
|
|
302
|
+
}], hideDropdownIcon: [{
|
|
303
|
+
type: Input,
|
|
304
|
+
args: [{ alias: 'hide-dropdown-icon' }]
|
|
305
|
+
}], pendingLabel: [{
|
|
306
|
+
type: Input,
|
|
307
|
+
args: [{ alias: 'pending-label' }]
|
|
308
|
+
}], searchLabel: [{
|
|
309
|
+
type: Input,
|
|
310
|
+
args: [{ alias: 'search-label' }]
|
|
311
|
+
}], noResultsLabel: [{
|
|
312
|
+
type: Input,
|
|
313
|
+
args: [{ alias: 'no-results-label' }]
|
|
314
|
+
}], noDataLabel: [{
|
|
315
|
+
type: Input,
|
|
316
|
+
args: [{ alias: 'no-data-label' }]
|
|
317
|
+
}], multipleLabelTemplate: [{
|
|
318
|
+
type: Input,
|
|
319
|
+
args: [{ alias: 'multiple-label-template' }]
|
|
320
|
+
}], label: [{
|
|
321
|
+
type: Input,
|
|
322
|
+
args: [{ alias: 'label' }]
|
|
323
|
+
}], open: [{
|
|
324
|
+
type: Input,
|
|
325
|
+
args: [{ alias: 'open' }]
|
|
326
|
+
}], readonly: [{
|
|
327
|
+
type: Input,
|
|
328
|
+
args: [{ alias: 'readonly' }]
|
|
329
|
+
}], labelAlignment: [{
|
|
330
|
+
type: Input,
|
|
331
|
+
args: [{ alias: 'label-alignment' }]
|
|
332
|
+
}], placement: [{
|
|
333
|
+
type: Input,
|
|
334
|
+
args: [{ alias: 'placement' }]
|
|
335
|
+
}], quiet: [{
|
|
336
|
+
type: Input,
|
|
337
|
+
args: [{ alias: 'quiet' }]
|
|
338
|
+
}], value: [{
|
|
339
|
+
type: Input,
|
|
340
|
+
args: [{ alias: 'value' }]
|
|
341
|
+
}], options: [{
|
|
342
|
+
type: Input,
|
|
343
|
+
args: [{ alias: 'options' }]
|
|
344
|
+
}], optionIconRenderer: [{
|
|
345
|
+
type: Input,
|
|
346
|
+
args: [{ alias: 'option-icon-renderer' }]
|
|
347
|
+
}], selects: [{
|
|
348
|
+
type: Input,
|
|
349
|
+
args: [{ alias: 'selects' }]
|
|
350
|
+
}], changeEvent: [{ type: i0.Output, args: ["change"] }], luzmoScrolledEvent: [{ type: i0.Output, args: ["luzmo-scrolled"] }], luzmoSearchEvent: [{ type: i0.Output, args: ["luzmo-search"] }], luzmoOpenedEvent: [{ type: i0.Output, args: ["luzmo-opened"] }], luzmoClosedEvent: [{ type: i0.Output, args: ["luzmo-closed"] }] }); })();
|
|
351
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoSelect, { className: "LuzmoSelect", filePath: "components/select.ts", lineNumber: 27 }); })();
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import '@luzmo/lucero/slider';
|
|
4
|
+
import type { LuzmoSlider as LuzmoSliderHostElement } from '@luzmo/lucero/slider';
|
|
5
|
+
import type { API as __extt_NoUiSlider } from 'nouislider';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class LuzmoSlider 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(): LuzmoSliderHostElement;
|
|
15
|
+
label?: string;
|
|
16
|
+
value?: number;
|
|
17
|
+
min?: number;
|
|
18
|
+
max?: number;
|
|
19
|
+
step?: number;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
debounce?: number;
|
|
22
|
+
noUiSlider?: __extt_NoUiSlider;
|
|
23
|
+
debounceTimeout?: any;
|
|
24
|
+
readonly changeEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
|
|
25
|
+
constructor();
|
|
26
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
27
|
+
/**
|
|
28
|
+
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
29
|
+
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
30
|
+
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
31
|
+
* undefined / null by clearing their bindings.
|
|
32
|
+
*/
|
|
33
|
+
private setHostProperty;
|
|
34
|
+
private bindEvents;
|
|
35
|
+
private onChange;
|
|
36
|
+
private onTouched;
|
|
37
|
+
private isWritingValue;
|
|
38
|
+
private lastCvaValue;
|
|
39
|
+
writeValue(value: number): void;
|
|
40
|
+
registerOnChange(fn: (value: number) => void): void;
|
|
41
|
+
registerOnTouched(fn: () => void): void;
|
|
42
|
+
setDisabledState(isDisabled: boolean): void;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoSlider, never>;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoSlider, "luzmo-slider", ["luzmoSlider"], { "label": { "alias": "label"; "required": false; }; "value": { "alias": "value"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "step": { "alias": "step"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "debounce": { "alias": "debounce"; "required": false; }; "noUiSlider": { "alias": "no-ui-slider"; "required": false; }; "debounceTimeout": { "alias": "debounce-timeout"; "required": false; }; }, { "changeEvent": "change"; }, never, ["*"], true, never>;
|
|
45
|
+
}
|
|
46
|
+
/** The underlying custom element type for LuzmoSlider */
|
|
47
|
+
export type LuzmoSliderElement = LuzmoSliderHostElement;
|
|
@@ -0,0 +1,185 @@
|
|
|
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/slider';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
const _c0 = ["*"];
|
|
6
|
+
/**
|
|
7
|
+
* Angular wrapper component for <luzmo-slider>
|
|
8
|
+
*/
|
|
9
|
+
export class LuzmoSlider {
|
|
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
|
+
label;
|
|
20
|
+
value;
|
|
21
|
+
min;
|
|
22
|
+
max;
|
|
23
|
+
step;
|
|
24
|
+
disabled;
|
|
25
|
+
debounce;
|
|
26
|
+
noUiSlider;
|
|
27
|
+
debounceTimeout;
|
|
28
|
+
changeEvent = output({ alias: 'change' });
|
|
29
|
+
constructor() {
|
|
30
|
+
this.bindEvents();
|
|
31
|
+
this.destroyRef.onDestroy(() => {
|
|
32
|
+
for (const cleanup of this.listenerCleanup) {
|
|
33
|
+
cleanup();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
ngOnChanges(changes) {
|
|
38
|
+
for (const key of Object.keys(changes)) {
|
|
39
|
+
switch (key) {
|
|
40
|
+
case 'label':
|
|
41
|
+
this.setHostProperty('label', changes['label'].currentValue);
|
|
42
|
+
break;
|
|
43
|
+
case 'value':
|
|
44
|
+
this.setHostProperty('value', changes['value'].currentValue);
|
|
45
|
+
break;
|
|
46
|
+
case 'min':
|
|
47
|
+
this.setHostProperty('min', changes['min'].currentValue);
|
|
48
|
+
break;
|
|
49
|
+
case 'max':
|
|
50
|
+
this.setHostProperty('max', changes['max'].currentValue);
|
|
51
|
+
break;
|
|
52
|
+
case 'step':
|
|
53
|
+
this.setHostProperty('step', changes['step'].currentValue);
|
|
54
|
+
break;
|
|
55
|
+
case 'disabled':
|
|
56
|
+
this.setHostProperty('disabled', changes['disabled'].currentValue);
|
|
57
|
+
break;
|
|
58
|
+
case 'debounce':
|
|
59
|
+
this.setHostProperty('debounce', changes['debounce'].currentValue);
|
|
60
|
+
break;
|
|
61
|
+
case 'noUiSlider':
|
|
62
|
+
this.setHostProperty('noUiSlider', changes['noUiSlider'].currentValue);
|
|
63
|
+
break;
|
|
64
|
+
case 'debounceTimeout':
|
|
65
|
+
this.setHostProperty('debounceTimeout', changes['debounceTimeout'].currentValue);
|
|
66
|
+
break;
|
|
67
|
+
default:
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
74
|
+
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
75
|
+
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
76
|
+
* undefined / null by clearing their bindings.
|
|
77
|
+
*/
|
|
78
|
+
setHostProperty(key, value) {
|
|
79
|
+
this.renderer.setProperty(this.host, key, value);
|
|
80
|
+
}
|
|
81
|
+
bindEvents() {
|
|
82
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'change', (event) => {
|
|
83
|
+
this.changeEvent.emit(event);
|
|
84
|
+
if (!this.isWritingValue) {
|
|
85
|
+
const eventWithDetail = event;
|
|
86
|
+
const eventTarget = event.target;
|
|
87
|
+
const detail = 'detail' in eventWithDetail ? eventWithDetail.detail : undefined;
|
|
88
|
+
const hostRecord = this.host;
|
|
89
|
+
const nextValue = (detail
|
|
90
|
+
?? eventTarget?.['value']
|
|
91
|
+
?? hostRecord['value']);
|
|
92
|
+
if (Object.is(this.lastCvaValue, nextValue)) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this.lastCvaValue = nextValue;
|
|
96
|
+
this.setHostProperty('value', nextValue);
|
|
97
|
+
this.onChange(nextValue);
|
|
98
|
+
}
|
|
99
|
+
}));
|
|
100
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'blur', () => {
|
|
101
|
+
this.onTouched();
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
onChange = () => { };
|
|
105
|
+
onTouched = () => { };
|
|
106
|
+
isWritingValue = false;
|
|
107
|
+
lastCvaValue;
|
|
108
|
+
writeValue(value) {
|
|
109
|
+
this.isWritingValue = true;
|
|
110
|
+
this.lastCvaValue = value;
|
|
111
|
+
this.setHostProperty('value', value);
|
|
112
|
+
this.isWritingValue = false;
|
|
113
|
+
}
|
|
114
|
+
registerOnChange(fn) {
|
|
115
|
+
this.onChange = fn;
|
|
116
|
+
}
|
|
117
|
+
registerOnTouched(fn) {
|
|
118
|
+
this.onTouched = fn;
|
|
119
|
+
}
|
|
120
|
+
setDisabledState(isDisabled) {
|
|
121
|
+
this.setHostProperty('disabled', isDisabled);
|
|
122
|
+
if (isDisabled) {
|
|
123
|
+
this.renderer.setAttribute(this.host, 'disabled', '');
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this.renderer.removeAttribute(this.host, 'disabled');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
static ɵfac = function LuzmoSlider_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoSlider)(); };
|
|
130
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoSlider, selectors: [["luzmo-slider"]], inputs: { label: "label", value: "value", min: "min", max: "max", step: "step", disabled: "disabled", debounce: "debounce", noUiSlider: [0, "no-ui-slider", "noUiSlider"], debounceTimeout: [0, "debounce-timeout", "debounceTimeout"] }, outputs: { changeEvent: "change" }, exportAs: ["luzmoSlider"], features: [i0.ɵɵProvidersFeature([
|
|
131
|
+
{
|
|
132
|
+
provide: NG_VALUE_ACCESSOR,
|
|
133
|
+
useExisting: forwardRef(() => LuzmoSlider),
|
|
134
|
+
multi: true
|
|
135
|
+
}
|
|
136
|
+
]), i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoSlider_Template(rf, ctx) { if (rf & 1) {
|
|
137
|
+
i0.ɵɵprojectionDef();
|
|
138
|
+
i0.ɵɵprojection(0);
|
|
139
|
+
} }, encapsulation: 2, changeDetection: 0 });
|
|
140
|
+
}
|
|
141
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoSlider, [{
|
|
142
|
+
type: Component,
|
|
143
|
+
args: [{
|
|
144
|
+
selector: 'luzmo-slider',
|
|
145
|
+
exportAs: 'luzmoSlider',
|
|
146
|
+
standalone: true,
|
|
147
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
148
|
+
template: '<ng-content />',
|
|
149
|
+
providers: [
|
|
150
|
+
{
|
|
151
|
+
provide: NG_VALUE_ACCESSOR,
|
|
152
|
+
useExisting: forwardRef(() => LuzmoSlider),
|
|
153
|
+
multi: true
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}]
|
|
157
|
+
}], () => [], { label: [{
|
|
158
|
+
type: Input,
|
|
159
|
+
args: [{ alias: 'label' }]
|
|
160
|
+
}], value: [{
|
|
161
|
+
type: Input,
|
|
162
|
+
args: [{ alias: 'value' }]
|
|
163
|
+
}], min: [{
|
|
164
|
+
type: Input,
|
|
165
|
+
args: [{ alias: 'min' }]
|
|
166
|
+
}], max: [{
|
|
167
|
+
type: Input,
|
|
168
|
+
args: [{ alias: 'max' }]
|
|
169
|
+
}], step: [{
|
|
170
|
+
type: Input,
|
|
171
|
+
args: [{ alias: 'step' }]
|
|
172
|
+
}], disabled: [{
|
|
173
|
+
type: Input,
|
|
174
|
+
args: [{ alias: 'disabled' }]
|
|
175
|
+
}], debounce: [{
|
|
176
|
+
type: Input,
|
|
177
|
+
args: [{ alias: 'debounce' }]
|
|
178
|
+
}], noUiSlider: [{
|
|
179
|
+
type: Input,
|
|
180
|
+
args: [{ alias: 'no-ui-slider' }]
|
|
181
|
+
}], debounceTimeout: [{
|
|
182
|
+
type: Input,
|
|
183
|
+
args: [{ alias: 'debounce-timeout' }]
|
|
184
|
+
}], changeEvent: [{ type: i0.Output, args: ["change"] }] }); })();
|
|
185
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoSlider, { className: "LuzmoSlider", filePath: "components/slider.ts", lineNumber: 24 }); })();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import '@luzmo/lucero/status-light';
|
|
3
|
+
import type { LuzmoStatusLight as LuzmoStatusLightHostElement, StatusLightVariants } from '@luzmo/lucero/status-light';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export type { StatusLightNonSemanticVariants, StatusLightSemanticVariants, StatusLightVariants } from '@luzmo/lucero/status-light';
|
|
6
|
+
export declare class LuzmoStatusLight 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(): LuzmoStatusLightHostElement;
|
|
14
|
+
variant?: StatusLightVariants;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
constructor();
|
|
17
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
18
|
+
/**
|
|
19
|
+
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
20
|
+
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
21
|
+
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
22
|
+
* undefined / null by clearing their bindings.
|
|
23
|
+
*/
|
|
24
|
+
private setHostProperty;
|
|
25
|
+
private bindEvents;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoStatusLight, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoStatusLight, "luzmo-status-light", ["luzmoStatusLight"], { "variant": { "alias": "variant"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
28
|
+
}
|
|
29
|
+
/** The underlying custom element type for LuzmoStatusLight */
|
|
30
|
+
export type LuzmoStatusLightElement = LuzmoStatusLightHostElement;
|