@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,205 @@
|
|
|
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/action-button';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
const _c0 = ["*"];
|
|
6
|
+
/**
|
|
7
|
+
* Angular wrapper component for <luzmo-action-button>
|
|
8
|
+
*
|
|
9
|
+
* @slot (default) - text label of the Action Button
|
|
10
|
+
* @slot icon - The icon to use for Action Button
|
|
11
|
+
*/
|
|
12
|
+
export class LuzmoActionButton {
|
|
13
|
+
elementRef = inject(ElementRef);
|
|
14
|
+
renderer = inject(Renderer2);
|
|
15
|
+
destroyRef = inject(DestroyRef);
|
|
16
|
+
host = this.elementRef.nativeElement;
|
|
17
|
+
listenerCleanup = [];
|
|
18
|
+
/** The underlying custom element instance. Use to call imperative methods. */
|
|
19
|
+
get nativeElement() {
|
|
20
|
+
return this.host;
|
|
21
|
+
}
|
|
22
|
+
/** Affects the display of a **selected** Action Button */
|
|
23
|
+
emphasized;
|
|
24
|
+
/** Whether the Action Button should display a hold affordance */
|
|
25
|
+
holdAffordance;
|
|
26
|
+
/** Whether the Action Button should show in a quiet state */
|
|
27
|
+
quiet;
|
|
28
|
+
/** The role for the Action Button */
|
|
29
|
+
role;
|
|
30
|
+
/** Whether an Action Button with `role='button'` should also be `aria-pressed='true'` */
|
|
31
|
+
selected;
|
|
32
|
+
/** Whether to automatically manage the `selected` attribute on interaction and whether `aria-pressed="false"` should be used when `selected === false` */
|
|
33
|
+
toggles;
|
|
34
|
+
/** The static color variant to use for the action button. */
|
|
35
|
+
staticColor;
|
|
36
|
+
/** The value of the Action Button */
|
|
37
|
+
value;
|
|
38
|
+
active;
|
|
39
|
+
/** The default behavior of the button. Possible values are: `button` (default), `submit`, and `reset`. */
|
|
40
|
+
type;
|
|
41
|
+
/** Synthesizes a "longpress" interaction that signifies a `pointerdown` event that is >=300ms or a keyboard event where code is `Space` or code is `ArrowDown` while `altKey===true`. */
|
|
42
|
+
longpressEvent = output({ alias: 'longpress' });
|
|
43
|
+
/** Announces a change in the `selected` property of an action button */
|
|
44
|
+
changeEvent = output({ alias: 'change' });
|
|
45
|
+
constructor() {
|
|
46
|
+
this.bindEvents();
|
|
47
|
+
this.destroyRef.onDestroy(() => {
|
|
48
|
+
for (const cleanup of this.listenerCleanup) {
|
|
49
|
+
cleanup();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
ngOnChanges(changes) {
|
|
54
|
+
for (const key of Object.keys(changes)) {
|
|
55
|
+
switch (key) {
|
|
56
|
+
case 'emphasized':
|
|
57
|
+
this.setHostProperty('emphasized', changes['emphasized'].currentValue);
|
|
58
|
+
break;
|
|
59
|
+
case 'holdAffordance':
|
|
60
|
+
this.setHostProperty('holdAffordance', changes['holdAffordance'].currentValue);
|
|
61
|
+
break;
|
|
62
|
+
case 'quiet':
|
|
63
|
+
this.setHostProperty('quiet', changes['quiet'].currentValue);
|
|
64
|
+
break;
|
|
65
|
+
case 'role':
|
|
66
|
+
this.setHostProperty('role', changes['role'].currentValue);
|
|
67
|
+
break;
|
|
68
|
+
case 'selected':
|
|
69
|
+
this.setHostProperty('selected', changes['selected'].currentValue);
|
|
70
|
+
break;
|
|
71
|
+
case 'toggles':
|
|
72
|
+
this.setHostProperty('toggles', changes['toggles'].currentValue);
|
|
73
|
+
break;
|
|
74
|
+
case 'staticColor':
|
|
75
|
+
this.setHostProperty('staticColor', changes['staticColor'].currentValue);
|
|
76
|
+
break;
|
|
77
|
+
case 'value':
|
|
78
|
+
this.setHostProperty('value', changes['value'].currentValue);
|
|
79
|
+
break;
|
|
80
|
+
case 'active':
|
|
81
|
+
this.setHostProperty('active', changes['active'].currentValue);
|
|
82
|
+
break;
|
|
83
|
+
case 'type':
|
|
84
|
+
this.setHostProperty('type', changes['type'].currentValue);
|
|
85
|
+
break;
|
|
86
|
+
default:
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
93
|
+
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
94
|
+
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
95
|
+
* undefined / null by clearing their bindings.
|
|
96
|
+
*/
|
|
97
|
+
setHostProperty(key, value) {
|
|
98
|
+
this.renderer.setProperty(this.host, key, value);
|
|
99
|
+
}
|
|
100
|
+
bindEvents() {
|
|
101
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'longpress', (event) => {
|
|
102
|
+
this.longpressEvent.emit(event);
|
|
103
|
+
}));
|
|
104
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'change', (event) => {
|
|
105
|
+
this.changeEvent.emit(event);
|
|
106
|
+
if (!this.isWritingValue) {
|
|
107
|
+
const eventWithDetail = event;
|
|
108
|
+
const eventTarget = event.target;
|
|
109
|
+
const detail = 'detail' in eventWithDetail ? eventWithDetail.detail : undefined;
|
|
110
|
+
const hostRecord = this.host;
|
|
111
|
+
const nextValue = (detail
|
|
112
|
+
?? eventTarget?.['value']
|
|
113
|
+
?? hostRecord['value']);
|
|
114
|
+
if (Object.is(this.lastCvaValue, nextValue)) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
this.lastCvaValue = nextValue;
|
|
118
|
+
this.setHostProperty('value', nextValue);
|
|
119
|
+
this.onChange(nextValue);
|
|
120
|
+
}
|
|
121
|
+
}));
|
|
122
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'blur', () => {
|
|
123
|
+
this.onTouched();
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
onChange = () => { };
|
|
127
|
+
onTouched = () => { };
|
|
128
|
+
isWritingValue = false;
|
|
129
|
+
lastCvaValue;
|
|
130
|
+
writeValue(value) {
|
|
131
|
+
this.isWritingValue = true;
|
|
132
|
+
this.lastCvaValue = value;
|
|
133
|
+
this.setHostProperty('value', value);
|
|
134
|
+
this.isWritingValue = false;
|
|
135
|
+
}
|
|
136
|
+
registerOnChange(fn) {
|
|
137
|
+
this.onChange = fn;
|
|
138
|
+
}
|
|
139
|
+
registerOnTouched(fn) {
|
|
140
|
+
this.onTouched = fn;
|
|
141
|
+
}
|
|
142
|
+
setDisabledState(isDisabled) {
|
|
143
|
+
// Underlying element does not declare a 'disabled' field; nothing to do.
|
|
144
|
+
void isDisabled;
|
|
145
|
+
}
|
|
146
|
+
static ɵfac = function LuzmoActionButton_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoActionButton)(); };
|
|
147
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoActionButton, selectors: [["luzmo-action-button"]], inputs: { emphasized: "emphasized", holdAffordance: [0, "hold-affordance", "holdAffordance"], quiet: "quiet", role: "role", selected: "selected", toggles: "toggles", staticColor: [0, "static-color", "staticColor"], value: "value", active: "active", type: "type" }, outputs: { longpressEvent: "longpress", changeEvent: "change" }, exportAs: ["luzmoActionButton"], features: [i0.ɵɵProvidersFeature([
|
|
148
|
+
{
|
|
149
|
+
provide: NG_VALUE_ACCESSOR,
|
|
150
|
+
useExisting: forwardRef(() => LuzmoActionButton),
|
|
151
|
+
multi: true
|
|
152
|
+
}
|
|
153
|
+
]), i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoActionButton_Template(rf, ctx) { if (rf & 1) {
|
|
154
|
+
i0.ɵɵprojectionDef();
|
|
155
|
+
i0.ɵɵprojection(0);
|
|
156
|
+
} }, encapsulation: 2, changeDetection: 0 });
|
|
157
|
+
}
|
|
158
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoActionButton, [{
|
|
159
|
+
type: Component,
|
|
160
|
+
args: [{
|
|
161
|
+
selector: 'luzmo-action-button',
|
|
162
|
+
exportAs: 'luzmoActionButton',
|
|
163
|
+
standalone: true,
|
|
164
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
165
|
+
template: '<ng-content />',
|
|
166
|
+
providers: [
|
|
167
|
+
{
|
|
168
|
+
provide: NG_VALUE_ACCESSOR,
|
|
169
|
+
useExisting: forwardRef(() => LuzmoActionButton),
|
|
170
|
+
multi: true
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}]
|
|
174
|
+
}], () => [], { emphasized: [{
|
|
175
|
+
type: Input,
|
|
176
|
+
args: [{ alias: 'emphasized' }]
|
|
177
|
+
}], holdAffordance: [{
|
|
178
|
+
type: Input,
|
|
179
|
+
args: [{ alias: 'hold-affordance' }]
|
|
180
|
+
}], quiet: [{
|
|
181
|
+
type: Input,
|
|
182
|
+
args: [{ alias: 'quiet' }]
|
|
183
|
+
}], role: [{
|
|
184
|
+
type: Input,
|
|
185
|
+
args: [{ alias: 'role' }]
|
|
186
|
+
}], selected: [{
|
|
187
|
+
type: Input,
|
|
188
|
+
args: [{ alias: 'selected' }]
|
|
189
|
+
}], toggles: [{
|
|
190
|
+
type: Input,
|
|
191
|
+
args: [{ alias: 'toggles' }]
|
|
192
|
+
}], staticColor: [{
|
|
193
|
+
type: Input,
|
|
194
|
+
args: [{ alias: 'static-color' }]
|
|
195
|
+
}], value: [{
|
|
196
|
+
type: Input,
|
|
197
|
+
args: [{ alias: 'value' }]
|
|
198
|
+
}], active: [{
|
|
199
|
+
type: Input,
|
|
200
|
+
args: [{ alias: 'active' }]
|
|
201
|
+
}], type: [{
|
|
202
|
+
type: Input,
|
|
203
|
+
args: [{ alias: 'type' }]
|
|
204
|
+
}], longpressEvent: [{ type: i0.Output, args: ["longpress"] }], changeEvent: [{ type: i0.Output, args: ["change"] }] }); })();
|
|
205
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoActionButton, { className: "LuzmoActionButton", filePath: "components/action-button.ts", lineNumber: 26 }); })();
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import '@luzmo/lucero/action-group';
|
|
3
|
+
import type { LuzmoActionGroup as LuzmoActionGroupHostElement } from '@luzmo/lucero/action-group';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class LuzmoActionGroup 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(): LuzmoActionGroupHostElement;
|
|
13
|
+
buttons?: unknown;
|
|
14
|
+
rovingTabindexController?: unknown;
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
emphasized?: boolean;
|
|
17
|
+
justified?: boolean;
|
|
18
|
+
label?: string;
|
|
19
|
+
quiet?: boolean;
|
|
20
|
+
selects?: never | 'single' | 'multiple';
|
|
21
|
+
staticColor?: 'white' | 'black';
|
|
22
|
+
vertical?: boolean;
|
|
23
|
+
selected?: string[];
|
|
24
|
+
slotElement?: unknown;
|
|
25
|
+
/** Announces that selection state has been changed by user */
|
|
26
|
+
readonly changeEvent: import("@angular/core").OutputEmitterRef<Event>;
|
|
27
|
+
constructor();
|
|
28
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
29
|
+
/**
|
|
30
|
+
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
31
|
+
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
32
|
+
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
33
|
+
* undefined / null by clearing their bindings.
|
|
34
|
+
*/
|
|
35
|
+
private setHostProperty;
|
|
36
|
+
private bindEvents;
|
|
37
|
+
focus(options?: FocusOptions): void;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoActionGroup, never>;
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoActionGroup, "luzmo-action-group", ["luzmoActionGroup"], { "buttons": { "alias": "buttons"; "required": false; }; "rovingTabindexController": { "alias": "roving-tabindex-controller"; "required": false; }; "compact": { "alias": "compact"; "required": false; }; "emphasized": { "alias": "emphasized"; "required": false; }; "justified": { "alias": "justified"; "required": false; }; "label": { "alias": "label"; "required": false; }; "quiet": { "alias": "quiet"; "required": false; }; "selects": { "alias": "selects"; "required": false; }; "staticColor": { "alias": "static-color"; "required": false; }; "vertical": { "alias": "vertical"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "slotElement": { "alias": "slot-element"; "required": false; }; }, { "changeEvent": "change"; }, never, ["*"], true, never>;
|
|
40
|
+
}
|
|
41
|
+
/** The underlying custom element type for LuzmoActionGroup */
|
|
42
|
+
export type LuzmoActionGroupElement = LuzmoActionGroupHostElement;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, output, Renderer2 } from '@angular/core';
|
|
2
|
+
import '@luzmo/lucero/action-group';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
const _c0 = ["*"];
|
|
5
|
+
/**
|
|
6
|
+
* Angular wrapper component for <luzmo-action-group>
|
|
7
|
+
*
|
|
8
|
+
* @slot (default) - the luzmo-action-button elements that make up the group
|
|
9
|
+
*/
|
|
10
|
+
export class LuzmoActionGroup {
|
|
11
|
+
elementRef = inject(ElementRef);
|
|
12
|
+
renderer = inject(Renderer2);
|
|
13
|
+
destroyRef = inject(DestroyRef);
|
|
14
|
+
host = this.elementRef.nativeElement;
|
|
15
|
+
listenerCleanup = [];
|
|
16
|
+
/** The underlying custom element instance. Use to call imperative methods. */
|
|
17
|
+
get nativeElement() {
|
|
18
|
+
return this.host;
|
|
19
|
+
}
|
|
20
|
+
buttons;
|
|
21
|
+
rovingTabindexController;
|
|
22
|
+
compact;
|
|
23
|
+
emphasized;
|
|
24
|
+
justified;
|
|
25
|
+
label;
|
|
26
|
+
quiet;
|
|
27
|
+
selects;
|
|
28
|
+
staticColor;
|
|
29
|
+
vertical;
|
|
30
|
+
selected;
|
|
31
|
+
slotElement;
|
|
32
|
+
/** Announces that selection state has been changed by user */
|
|
33
|
+
changeEvent = output({ alias: 'change' });
|
|
34
|
+
constructor() {
|
|
35
|
+
this.bindEvents();
|
|
36
|
+
this.destroyRef.onDestroy(() => {
|
|
37
|
+
for (const cleanup of this.listenerCleanup) {
|
|
38
|
+
cleanup();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
ngOnChanges(changes) {
|
|
43
|
+
for (const key of Object.keys(changes)) {
|
|
44
|
+
switch (key) {
|
|
45
|
+
case 'buttons':
|
|
46
|
+
this.setHostProperty('buttons', changes['buttons'].currentValue);
|
|
47
|
+
break;
|
|
48
|
+
case 'rovingTabindexController':
|
|
49
|
+
this.setHostProperty('rovingTabindexController', changes['rovingTabindexController'].currentValue);
|
|
50
|
+
break;
|
|
51
|
+
case 'compact':
|
|
52
|
+
this.setHostProperty('compact', changes['compact'].currentValue);
|
|
53
|
+
break;
|
|
54
|
+
case 'emphasized':
|
|
55
|
+
this.setHostProperty('emphasized', changes['emphasized'].currentValue);
|
|
56
|
+
break;
|
|
57
|
+
case 'justified':
|
|
58
|
+
this.setHostProperty('justified', changes['justified'].currentValue);
|
|
59
|
+
break;
|
|
60
|
+
case 'label':
|
|
61
|
+
this.setHostProperty('label', changes['label'].currentValue);
|
|
62
|
+
break;
|
|
63
|
+
case 'quiet':
|
|
64
|
+
this.setHostProperty('quiet', changes['quiet'].currentValue);
|
|
65
|
+
break;
|
|
66
|
+
case 'selects':
|
|
67
|
+
this.setHostProperty('selects', changes['selects'].currentValue);
|
|
68
|
+
break;
|
|
69
|
+
case 'staticColor':
|
|
70
|
+
this.setHostProperty('staticColor', changes['staticColor'].currentValue);
|
|
71
|
+
break;
|
|
72
|
+
case 'vertical':
|
|
73
|
+
this.setHostProperty('vertical', changes['vertical'].currentValue);
|
|
74
|
+
break;
|
|
75
|
+
case 'selected':
|
|
76
|
+
this.setHostProperty('selected', changes['selected'].currentValue);
|
|
77
|
+
break;
|
|
78
|
+
case 'slotElement':
|
|
79
|
+
this.setHostProperty('slotElement', changes['slotElement'].currentValue);
|
|
80
|
+
break;
|
|
81
|
+
default:
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
88
|
+
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
89
|
+
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
90
|
+
* undefined / null by clearing their bindings.
|
|
91
|
+
*/
|
|
92
|
+
setHostProperty(key, value) {
|
|
93
|
+
this.renderer.setProperty(this.host, key, value);
|
|
94
|
+
}
|
|
95
|
+
bindEvents() {
|
|
96
|
+
this.listenerCleanup.push(this.renderer.listen(this.host, 'change', (event) => {
|
|
97
|
+
this.changeEvent.emit(event);
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
focus(options) {
|
|
101
|
+
return this.host.focus(options);
|
|
102
|
+
}
|
|
103
|
+
static ɵfac = function LuzmoActionGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LuzmoActionGroup)(); };
|
|
104
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LuzmoActionGroup, selectors: [["luzmo-action-group"]], inputs: { buttons: "buttons", rovingTabindexController: [0, "roving-tabindex-controller", "rovingTabindexController"], compact: "compact", emphasized: "emphasized", justified: "justified", label: "label", quiet: "quiet", selects: "selects", staticColor: [0, "static-color", "staticColor"], vertical: "vertical", selected: "selected", slotElement: [0, "slot-element", "slotElement"] }, outputs: { changeEvent: "change" }, exportAs: ["luzmoActionGroup"], features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function LuzmoActionGroup_Template(rf, ctx) { if (rf & 1) {
|
|
105
|
+
i0.ɵɵprojectionDef();
|
|
106
|
+
i0.ɵɵprojection(0);
|
|
107
|
+
} }, encapsulation: 2, changeDetection: 0 });
|
|
108
|
+
}
|
|
109
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LuzmoActionGroup, [{
|
|
110
|
+
type: Component,
|
|
111
|
+
args: [{
|
|
112
|
+
selector: 'luzmo-action-group',
|
|
113
|
+
exportAs: 'luzmoActionGroup',
|
|
114
|
+
standalone: true,
|
|
115
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
116
|
+
template: '<ng-content />'
|
|
117
|
+
}]
|
|
118
|
+
}], () => [], { buttons: [{
|
|
119
|
+
type: Input,
|
|
120
|
+
args: [{ alias: 'buttons' }]
|
|
121
|
+
}], rovingTabindexController: [{
|
|
122
|
+
type: Input,
|
|
123
|
+
args: [{ alias: 'roving-tabindex-controller' }]
|
|
124
|
+
}], compact: [{
|
|
125
|
+
type: Input,
|
|
126
|
+
args: [{ alias: 'compact' }]
|
|
127
|
+
}], emphasized: [{
|
|
128
|
+
type: Input,
|
|
129
|
+
args: [{ alias: 'emphasized' }]
|
|
130
|
+
}], justified: [{
|
|
131
|
+
type: Input,
|
|
132
|
+
args: [{ alias: 'justified' }]
|
|
133
|
+
}], label: [{
|
|
134
|
+
type: Input,
|
|
135
|
+
args: [{ alias: 'label' }]
|
|
136
|
+
}], quiet: [{
|
|
137
|
+
type: Input,
|
|
138
|
+
args: [{ alias: 'quiet' }]
|
|
139
|
+
}], selects: [{
|
|
140
|
+
type: Input,
|
|
141
|
+
args: [{ alias: 'selects' }]
|
|
142
|
+
}], staticColor: [{
|
|
143
|
+
type: Input,
|
|
144
|
+
args: [{ alias: 'static-color' }]
|
|
145
|
+
}], vertical: [{
|
|
146
|
+
type: Input,
|
|
147
|
+
args: [{ alias: 'vertical' }]
|
|
148
|
+
}], selected: [{
|
|
149
|
+
type: Input,
|
|
150
|
+
args: [{ alias: 'selected' }]
|
|
151
|
+
}], slotElement: [{
|
|
152
|
+
type: Input,
|
|
153
|
+
args: [{ alias: 'slot-element' }]
|
|
154
|
+
}], changeEvent: [{ type: i0.Output, args: ["change"] }] }); })();
|
|
155
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LuzmoActionGroup, { className: "LuzmoActionGroup", filePath: "components/action-group.ts", lineNumber: 17 }); })();
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import '@luzmo/lucero/action-menu';
|
|
4
|
+
import type { LuzmoActionMenu as LuzmoActionMenuHostElement } from '@luzmo/lucero/action-menu';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class LuzmoActionMenu 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(): LuzmoActionMenuHostElement;
|
|
14
|
+
selects?: never | 'single';
|
|
15
|
+
staticColor?: 'white' | 'black';
|
|
16
|
+
handleSlottableRequest?: unknown;
|
|
17
|
+
appliedLabel?: string;
|
|
18
|
+
button?: unknown;
|
|
19
|
+
/** Whether the Picker is disabled. */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
focused?: boolean;
|
|
22
|
+
icons?: 'only' | 'none';
|
|
23
|
+
/** Type of dropdown */
|
|
24
|
+
variant?: 'checkmarks' | 'highlight';
|
|
25
|
+
/** Whether the value is invalid. */
|
|
26
|
+
invalid?: boolean;
|
|
27
|
+
/** Whether the items are currently loading. */
|
|
28
|
+
pending?: boolean;
|
|
29
|
+
/** Defines a string value that labels the Picker while it is in pending state. */
|
|
30
|
+
pendingLabel?: string;
|
|
31
|
+
label?: string;
|
|
32
|
+
open?: boolean;
|
|
33
|
+
/** Readonly value */
|
|
34
|
+
readonly?: boolean;
|
|
35
|
+
labelAlignment?: 'inline';
|
|
36
|
+
optionsMenu?: unknown;
|
|
37
|
+
overlayElement?: unknown;
|
|
38
|
+
placement?: "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end";
|
|
39
|
+
/** Display as a quiet picker */
|
|
40
|
+
quiet?: boolean;
|
|
41
|
+
value?: string;
|
|
42
|
+
selectedItem?: unknown;
|
|
43
|
+
dependencyManager?: unknown;
|
|
44
|
+
isMobile?: unknown;
|
|
45
|
+
strategy?: unknown;
|
|
46
|
+
pendingStateController?: unknown;
|
|
47
|
+
applyFocusElementLabel?: unknown;
|
|
48
|
+
readonly changeEvent: import("@angular/core").OutputEmitterRef<CustomEvent<unknown>>;
|
|
49
|
+
readonly scrollEvent: import("@angular/core").OutputEmitterRef<Event>;
|
|
50
|
+
constructor();
|
|
51
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
52
|
+
/**
|
|
53
|
+
* Forward a wrapper @Input to the underlying host element via Renderer2 so
|
|
54
|
+
* the wrapper stays compatible with non-DOM Angular platforms (SSR, tests).
|
|
55
|
+
* Unlike a "skip undefined" guard, this lets consumers reset values back to
|
|
56
|
+
* undefined / null by clearing their bindings.
|
|
57
|
+
*/
|
|
58
|
+
private setHostProperty;
|
|
59
|
+
private bindEvents;
|
|
60
|
+
private onChange;
|
|
61
|
+
private onTouched;
|
|
62
|
+
private isWritingValue;
|
|
63
|
+
private lastCvaValue;
|
|
64
|
+
writeValue(value: string): void;
|
|
65
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
66
|
+
registerOnTouched(fn: () => void): void;
|
|
67
|
+
setDisabledState(isDisabled: boolean): void;
|
|
68
|
+
focus(options?: FocusOptions): void;
|
|
69
|
+
toggle(target?: boolean): void;
|
|
70
|
+
close(): void;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LuzmoActionMenu, never>;
|
|
72
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LuzmoActionMenu, "luzmo-action-menu", ["luzmoActionMenu"], { "selects": { "alias": "selects"; "required": false; }; "staticColor": { "alias": "static-color"; "required": false; }; "handleSlottableRequest": { "alias": "handle-slottable-request"; "required": false; }; "appliedLabel": { "alias": "applied-label"; "required": false; }; "button": { "alias": "button"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "focused": { "alias": "focused"; "required": false; }; "icons": { "alias": "icons"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "pending": { "alias": "pending"; "required": false; }; "pendingLabel": { "alias": "pending-label"; "required": false; }; "label": { "alias": "label"; "required": false; }; "open": { "alias": "open"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "labelAlignment": { "alias": "label-alignment"; "required": false; }; "optionsMenu": { "alias": "options-menu"; "required": false; }; "overlayElement": { "alias": "overlay-element"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "quiet": { "alias": "quiet"; "required": false; }; "value": { "alias": "value"; "required": false; }; "selectedItem": { "alias": "selected-item"; "required": false; }; "dependencyManager": { "alias": "dependency-manager"; "required": false; }; "isMobile": { "alias": "is-mobile"; "required": false; }; "strategy": { "alias": "strategy"; "required": false; }; "pendingStateController": { "alias": "pending-state-controller"; "required": false; }; "applyFocusElementLabel": { "alias": "apply-focus-element-label"; "required": false; }; }, { "changeEvent": "change"; "scrollEvent": "scroll"; }, never, ["*"], true, never>;
|
|
73
|
+
}
|
|
74
|
+
/** The underlying custom element type for LuzmoActionMenu */
|
|
75
|
+
export type LuzmoActionMenuElement = LuzmoActionMenuHostElement;
|