@liquid-js/lyr-extras 0.0.0-stage → 22.0.0-alpha.1

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 (29) hide show
  1. package/LICENSE.txt +23 -0
  2. package/README.md +61 -2
  3. package/fesm2022/liquid-js-lyr-extras-chart.mjs +871 -0
  4. package/fesm2022/liquid-js-lyr-extras-chart.mjs.map +1 -0
  5. package/fesm2022/liquid-js-lyr-extras-color-picker.mjs +821 -0
  6. package/fesm2022/liquid-js-lyr-extras-color-picker.mjs.map +1 -0
  7. package/fesm2022/liquid-js-lyr-extras-markdown-editor.mjs +923 -0
  8. package/fesm2022/liquid-js-lyr-extras-markdown-editor.mjs.map +1 -0
  9. package/fesm2022/liquid-js-lyr-extras-markdown-viewer.mjs +369 -0
  10. package/fesm2022/liquid-js-lyr-extras-markdown-viewer.mjs.map +1 -0
  11. package/fesm2022/liquid-js-lyr-extras-mask.mjs +240 -0
  12. package/fesm2022/liquid-js-lyr-extras-mask.mjs.map +1 -0
  13. package/fesm2022/liquid-js-lyr-extras-media.mjs +1142 -0
  14. package/fesm2022/liquid-js-lyr-extras-media.mjs.map +1 -0
  15. package/fesm2022/liquid-js-lyr-extras-phone-input.mjs +864 -0
  16. package/fesm2022/liquid-js-lyr-extras-phone-input.mjs.map +1 -0
  17. package/fesm2022/liquid-js-lyr-extras-qr-code.mjs +236 -0
  18. package/fesm2022/liquid-js-lyr-extras-qr-code.mjs.map +1 -0
  19. package/fesm2022/liquid-js-lyr-extras.mjs +0 -0
  20. package/package.json +159 -3
  21. package/types/liquid-js-lyr-extras-chart.d.ts +294 -0
  22. package/types/liquid-js-lyr-extras-color-picker.d.ts +311 -0
  23. package/types/liquid-js-lyr-extras-markdown-editor.d.ts +367 -0
  24. package/types/liquid-js-lyr-extras-markdown-viewer.d.ts +174 -0
  25. package/types/liquid-js-lyr-extras-mask.d.ts +130 -0
  26. package/types/liquid-js-lyr-extras-media.d.ts +517 -0
  27. package/types/liquid-js-lyr-extras-phone-input.d.ts +428 -0
  28. package/types/liquid-js-lyr-extras-qr-code.d.ts +113 -0
  29. package/types/liquid-js-lyr-extras.d.ts +1 -0
@@ -0,0 +1,821 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, Injector, TemplateRef, ViewEncapsulation, afterNextRender, booleanAttribute, computed, effect, forwardRef, inject, input, linkedSignal, signal, untracked, viewChild } from "@angular/core";
3
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
4
+ import { NG_VALIDATORS, NG_VALUE_ACCESSOR } from "@angular/forms";
5
+ import * as i1 from "@liquid-js/lyr-core";
6
+ import { NbAdjustment, NbButtonComponent, NbFormFieldModule, NbIconComponent, NbInputDirective, NbOverlayContainerComponent, NbPosition, NbPositionedContainerComponent, NbTemplatePortal, NbTrigger, NbValidationDirective, injectNbDefaults, injectNbTexts, injectNbValidationMessage, nbCreateDynamicOverlayHandler } from "@liquid-js/lyr-core";
7
+ import { ColorPickerDirective, NXT_COLOR_PICKER_TEXTS, cmykToRgb, formatCmyk, formatOutput, hsvaToRgba, rgbaToCmyk, rgbaToHsva, stringToCmyk, stringToHsva } from "nxt-color-picker";
8
+ import { skip } from "rxjs";
9
+ var NbColorPickerDialogComponent = class NbColorPickerDialogComponent extends NbPositionedContainerComponent {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.overlayContainer = viewChild.required(NbOverlayContainerComponent, ...ngDevMode ? [{ debugName: "overlayContainer" }] : /* istanbul ignore next */ []);
13
+ this.content = input(...ngDevMode ? [void 0, { debugName: "content" }] : /* istanbul ignore next */ []);
14
+ this.context = input(...ngDevMode ? [void 0, { debugName: "context" }] : /* istanbul ignore next */ []);
15
+ }
16
+ renderContent() {
17
+ const container = this.overlayContainer();
18
+ container.detach();
19
+ const content = this.content();
20
+ if (content instanceof TemplateRef) container.attachTemplatePortal(new NbTemplatePortal(content, void 0, this.context()));
21
+ }
22
+ static {
23
+ this.ɵfac = i0.ɵɵngDeclareFactory({
24
+ minVersion: "12.0.0",
25
+ version: "22.3.0",
26
+ ngImport: i0,
27
+ type: NbColorPickerDialogComponent,
28
+ deps: null,
29
+ target: i0.ɵɵFactoryTarget.Component
30
+ });
31
+ }
32
+ static {
33
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
34
+ minVersion: "17.2.0",
35
+ version: "22.3.0",
36
+ type: NbColorPickerDialogComponent,
37
+ isStandalone: true,
38
+ selector: "nb-color-picker-dialog",
39
+ inputs: {
40
+ content: {
41
+ classPropertyName: "content",
42
+ publicName: "content",
43
+ isSignal: true,
44
+ isRequired: false,
45
+ transformFunction: null
46
+ },
47
+ context: {
48
+ classPropertyName: "context",
49
+ publicName: "context",
50
+ isSignal: true,
51
+ isRequired: false,
52
+ transformFunction: null
53
+ }
54
+ },
55
+ viewQueries: [{
56
+ propertyName: "overlayContainer",
57
+ first: true,
58
+ predicate: NbOverlayContainerComponent,
59
+ descendants: true,
60
+ isSignal: true
61
+ }],
62
+ usesInheritance: true,
63
+ ngImport: i0,
64
+ template: "<nb-overlay-container />",
65
+ isInline: true,
66
+ dependencies: [{
67
+ kind: "component",
68
+ type: NbOverlayContainerComponent,
69
+ selector: "nb-overlay-container"
70
+ }],
71
+ changeDetection: i0.ChangeDetectionStrategy.Eager
72
+ });
73
+ }
74
+ };
75
+ i0.ɵɵngDeclareClassMetadata({
76
+ minVersion: "12.0.0",
77
+ version: "22.3.0",
78
+ ngImport: i0,
79
+ type: NbColorPickerDialogComponent,
80
+ decorators: [{
81
+ type: Component,
82
+ args: [{
83
+ selector: "nb-color-picker-dialog",
84
+ template: "<nb-overlay-container />",
85
+ changeDetection: ChangeDetectionStrategy.Eager,
86
+ imports: [NbOverlayContainerComponent]
87
+ }]
88
+ }],
89
+ propDecorators: {
90
+ overlayContainer: [{
91
+ type: i0.ViewChild,
92
+ args: [i0.forwardRef(() => NbOverlayContainerComponent), { isSignal: true }]
93
+ }],
94
+ content: [{
95
+ type: i0.Input,
96
+ args: [{
97
+ isSignal: true,
98
+ alias: "content",
99
+ required: false
100
+ }]
101
+ }],
102
+ context: [{
103
+ type: i0.Input,
104
+ args: [{
105
+ isSignal: true,
106
+ alias: "context",
107
+ required: false
108
+ }]
109
+ }]
110
+ }
111
+ });
112
+ function nbColorPickerTexts() {
113
+ return {
114
+ color: $localize`:@@nb.colorPicker.color:Color`,
115
+ clear: $localize`:@@nb.colorPicker.clear:Clear color`,
116
+ invalid: $localize`:@@nb.colorPicker.invalid:Enter a valid color`
117
+ };
118
+ }
119
+ function injectNbColorPickerTexts() {
120
+ return injectNbTexts("colorPicker", nbColorPickerTexts);
121
+ }
122
+ let nextDialogId = 0;
123
+ const DIALOG_FOCUSABLE = "[tabindex=\"0\"], input, button";
124
+ const NB_COLOR_PICKER_ERROR = "nbColorPicker";
125
+ function cssColor(text) {
126
+ if (!text) return;
127
+ const cmyk = stringToCmyk(text, true);
128
+ const hsva = stringToHsva(text, true) ?? (cmyk ? rgbaToHsva(cmykToRgb(cmyk)) : void 0);
129
+ return hsva ? formatOutput(hsva, "rgba", "enabled") : void 0;
130
+ }
131
+ var NbColorPickerComponent = class NbColorPickerComponent {
132
+ constructor() {
133
+ this.nbDefaults = injectNbDefaults("input");
134
+ this.texts = injectNbColorPickerTexts();
135
+ this.message = injectNbValidationMessage();
136
+ this.validation = inject(NbValidationDirective, {
137
+ self: true,
138
+ optional: true
139
+ });
140
+ this.sizeInput = input(void 0, {
141
+ ...ngDevMode ? { debugName: "sizeInput" } : /* istanbul ignore next */ {},
142
+ alias: "size"
143
+ });
144
+ this.size = linkedSignal(() => this.sizeInput() ?? this.nbDefaults().size ?? "medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
145
+ this.status = input("basic", ...ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []);
146
+ this.shapeInput = input(void 0, {
147
+ ...ngDevMode ? { debugName: "shapeInput" } : /* istanbul ignore next */ {},
148
+ alias: "shape"
149
+ });
150
+ this.shape = linkedSignal(() => this.shapeInput() ?? this.nbDefaults().shape ?? "rectangle", ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
151
+ this.fullWidth = input(false, {
152
+ ...ngDevMode ? { debugName: "fullWidth" } : /* istanbul ignore next */ {},
153
+ transform: booleanAttribute
154
+ });
155
+ this.ghost = input(false, {
156
+ ...ngDevMode ? { debugName: "ghost" } : /* istanbul ignore next */ {},
157
+ transform: booleanAttribute
158
+ });
159
+ this.placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
160
+ this.readonly = input(false, {
161
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
162
+ transform: booleanAttribute
163
+ });
164
+ this.ariaLabel = input(void 0, {
165
+ ...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
166
+ alias: "aria-label"
167
+ });
168
+ this.ariaLabelledBy = input(void 0, {
169
+ ...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
170
+ alias: "aria-labelledby"
171
+ });
172
+ this.fieldLabelledBy = computed(() => [this.ariaLabelledBy(), this.validation?.labelledBy()].filter(Boolean).join(" ") || null, ...ngDevMode ? [{ debugName: "fieldLabelledBy" }] : /* istanbul ignore next */ []);
173
+ this.outputFormat = input("auto", ...ngDevMode ? [{ debugName: "outputFormat" }] : /* istanbul ignore next */ []);
174
+ this.alphaChannel = input("enabled", ...ngDevMode ? [{ debugName: "alphaChannel" }] : /* istanbul ignore next */ []);
175
+ this.cmyk = input(false, {
176
+ ...ngDevMode ? { debugName: "cmyk" } : /* istanbul ignore next */ {},
177
+ transform: booleanAttribute
178
+ });
179
+ this.presets = input(...ngDevMode ? [void 0, { debugName: "presets" }] : /* istanbul ignore next */ []);
180
+ this.overlayOffset = input(8, ...ngDevMode ? [{ debugName: "overlayOffset" }] : /* istanbul ignore next */ []);
181
+ this.clearable = input(false, {
182
+ ...ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {},
183
+ transform: booleanAttribute
184
+ });
185
+ this.disabled = input(false, {
186
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
187
+ transform: booleanAttribute
188
+ });
189
+ this.value = signal(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
190
+ this.text = signal("", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
191
+ this.swatch = computed(() => cssColor(this.value()), ...ngDevMode ? [{ debugName: "swatch" }] : /* istanbul ignore next */ []);
192
+ this.isDisabled = linkedSignal(() => this.disabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
193
+ this.resolvedStatus = computed(() => this.validation?.status() ?? this.status(), ...ngDevMode ? [{ debugName: "resolvedStatus" }] : /* istanbul ignore next */ []);
194
+ this.buttonStatus = computed(() => this.resolvedStatus() === "control" ? "control" : "basic", ...ngDevMode ? [{ debugName: "buttonStatus" }] : /* istanbul ignore next */ []);
195
+ this.parseError = signal(false, ...ngDevMode ? [{ debugName: "parseError" }] : /* istanbul ignore next */ []);
196
+ this.open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
197
+ this.field = viewChild("field", ...ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []);
198
+ this.dialog = viewChild.required("dialog", ...ngDevMode ? [{ debugName: "dialog" }] : /* istanbul ignore next */ []);
199
+ this.overlayHandler = nbCreateDynamicOverlayHandler();
200
+ this.injector = inject(Injector);
201
+ this.destroyRef = inject(DestroyRef);
202
+ this.dialogId = `nb-color-picker-dialog-${nextDialogId++}`;
203
+ this.enterInDialog = false;
204
+ this.onChange = () => {};
205
+ this.onTouched = () => {};
206
+ this.onValidatorChange = () => {};
207
+ this.validation?.delegateAria();
208
+ effect(() => {
209
+ this.overlayHandler.offset(this.overlayOffset()).disabled(this.isDisabled() || this.readonly());
210
+ untracked(() => this.overlayHandler.rebuild());
211
+ });
212
+ }
213
+ ngAfterViewInit() {
214
+ const field = this.field();
215
+ if (!field) return;
216
+ const overlay = this.overlayHandler.host(field).componentType(NbColorPickerDialogComponent).trigger(NbTrigger.FOCUS).position(NbPosition.BOTTOM).adjustment(NbAdjustment.COUNTERCLOCKWISE).offset(this.overlayOffset()).content(this.dialog()).disabled(this.isDisabled() || this.readonly()).build();
217
+ this.overlay = overlay;
218
+ overlay.isShown.pipe(skip(1), takeUntilDestroyed(this.destroyRef)).subscribe((shown) => {
219
+ if (shown) this.open.set(true);
220
+ else this.onClose();
221
+ });
222
+ }
223
+ ngOnDestroy() {
224
+ this.overlayHandler.destroy();
225
+ }
226
+ writeValue(value) {
227
+ untracked(() => {
228
+ this.value.set(value || null);
229
+ this.setParseError(false);
230
+ this.show(value || "");
231
+ });
232
+ }
233
+ registerOnChange(fn) {
234
+ this.onChange = fn;
235
+ }
236
+ registerOnTouched(fn) {
237
+ this.onTouched = fn;
238
+ }
239
+ registerOnValidatorChange(fn) {
240
+ this.onValidatorChange = fn;
241
+ }
242
+ setDisabledState(disabled) {
243
+ this.isDisabled.set(disabled);
244
+ }
245
+ validate() {
246
+ if (!this.parseError()) return null;
247
+ const error = {
248
+ kind: NB_COLOR_PICKER_ERROR,
249
+ message: this.texts().invalid
250
+ };
251
+ const message = this.message({
252
+ kind: NB_COLOR_PICKER_ERROR,
253
+ params: error
254
+ });
255
+ return { [NB_COLOR_PICKER_ERROR]: {
256
+ ...error,
257
+ message
258
+ } };
259
+ }
260
+ clear(event) {
261
+ this.setParseError(false);
262
+ this.update(null);
263
+ this.show("");
264
+ this.onTouched();
265
+ if (event?.currentTarget?.matches(":focus-visible")) this.field()?.nativeElement.focus();
266
+ }
267
+ onColorChange(color) {
268
+ if (!this.cmyk()) this.changed(color);
269
+ }
270
+ onCmykChange(color) {
271
+ if (this.cmyk()) this.changed(color);
272
+ }
273
+ onInput(event) {
274
+ const text = event.target.value.trim();
275
+ if (!text && this.clearable()) {
276
+ this.setParseError(false);
277
+ this.update(null);
278
+ } else {
279
+ const color = this.typedColor(text);
280
+ this.setParseError(!color);
281
+ if (color) this.update(color);
282
+ }
283
+ this.onValidatorChange();
284
+ }
285
+ onFieldKeydown(event) {
286
+ if (event.ctrlKey || event.metaKey || event.altKey || event.shiftKey) return;
287
+ if (event.key === "ArrowDown" && !this.isDisabled() && !this.readonly()) {
288
+ event.preventDefault();
289
+ this.focusDialog();
290
+ } else if (event.key === "Escape" && this.open()) {
291
+ event.preventDefault();
292
+ event.stopPropagation();
293
+ this.overlay?.hide();
294
+ }
295
+ }
296
+ onDialogKeydown(event) {
297
+ if (event.key === "Escape") {
298
+ event.preventDefault();
299
+ event.stopPropagation();
300
+ this.closeDialog();
301
+ } else if (event.key === "Enter") this.enterInDialog = true;
302
+ }
303
+ onDialogKeyup(event) {
304
+ if (event.key === "Enter" && this.enterInDialog) {
305
+ this.enterInDialog = false;
306
+ event.preventDefault();
307
+ this.closeDialog();
308
+ }
309
+ }
310
+ onBlur() {
311
+ if (!this.open()) this.leave();
312
+ }
313
+ onClose() {
314
+ this.open.set(false);
315
+ this.enterInDialog = false;
316
+ if (!this.focused()) this.leave();
317
+ }
318
+ focusDialog() {
319
+ if (!this.open()) this.overlay?.show();
320
+ afterNextRender(() => this.overlay?.containerElement?.querySelector(DIALOG_FOCUSABLE)?.focus(), { injector: this.injector });
321
+ }
322
+ closeDialog() {
323
+ this.field()?.nativeElement.focus();
324
+ this.overlay?.hide();
325
+ }
326
+ typedColor(text) {
327
+ const hsva = stringToHsva(text, true);
328
+ const cmyk = stringToCmyk(text, true);
329
+ const format = this.outputFormat();
330
+ const alpha = this.alphaChannel();
331
+ const alphaChannel = format === "hex" && alpha !== "always" && alpha !== "forced" ? "disabled" : alpha;
332
+ if (alphaChannel === "disabled") {
333
+ if (hsva) hsva.a = 1;
334
+ if (cmyk) cmyk.a = 1;
335
+ }
336
+ if (this.cmyk()) {
337
+ const value = cmyk ?? (hsva && rgbaToCmyk(hsvaToRgba(hsva)));
338
+ return value ? formatCmyk(value, alphaChannel) : void 0;
339
+ }
340
+ const color = hsva ?? (cmyk && rgbaToHsva(cmykToRgb(cmyk)));
341
+ return color ? formatOutput(color, format, alphaChannel) : void 0;
342
+ }
343
+ leave() {
344
+ if (!this.parseError()) this.show(this.value() ?? "");
345
+ this.onTouched();
346
+ }
347
+ changed(color) {
348
+ this.setParseError(false);
349
+ this.update(color);
350
+ this.show(color);
351
+ }
352
+ update(color) {
353
+ const value = color || null;
354
+ if (value !== this.value()) {
355
+ this.value.set(value);
356
+ this.onChange(value);
357
+ }
358
+ }
359
+ focused() {
360
+ const field = this.field()?.nativeElement;
361
+ return !!field && field.ownerDocument.activeElement === field;
362
+ }
363
+ show(text) {
364
+ this.text.set(text);
365
+ const field = this.field()?.nativeElement;
366
+ if (field && field.value !== text) field.value = text;
367
+ }
368
+ setParseError(parseError) {
369
+ if (parseError !== this.parseError()) {
370
+ this.parseError.set(parseError);
371
+ this.onValidatorChange();
372
+ }
373
+ }
374
+ static {
375
+ this.ɵfac = i0.ɵɵngDeclareFactory({
376
+ minVersion: "12.0.0",
377
+ version: "22.3.0",
378
+ ngImport: i0,
379
+ type: NbColorPickerComponent,
380
+ deps: [],
381
+ target: i0.ɵɵFactoryTarget.Component
382
+ });
383
+ }
384
+ static {
385
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
386
+ minVersion: "17.0.0",
387
+ version: "22.3.0",
388
+ type: NbColorPickerComponent,
389
+ isStandalone: true,
390
+ selector: "nb-color-picker",
391
+ inputs: {
392
+ sizeInput: {
393
+ classPropertyName: "sizeInput",
394
+ publicName: "size",
395
+ isSignal: true,
396
+ isRequired: false,
397
+ transformFunction: null
398
+ },
399
+ status: {
400
+ classPropertyName: "status",
401
+ publicName: "status",
402
+ isSignal: true,
403
+ isRequired: false,
404
+ transformFunction: null
405
+ },
406
+ shapeInput: {
407
+ classPropertyName: "shapeInput",
408
+ publicName: "shape",
409
+ isSignal: true,
410
+ isRequired: false,
411
+ transformFunction: null
412
+ },
413
+ fullWidth: {
414
+ classPropertyName: "fullWidth",
415
+ publicName: "fullWidth",
416
+ isSignal: true,
417
+ isRequired: false,
418
+ transformFunction: null
419
+ },
420
+ ghost: {
421
+ classPropertyName: "ghost",
422
+ publicName: "ghost",
423
+ isSignal: true,
424
+ isRequired: false,
425
+ transformFunction: null
426
+ },
427
+ placeholder: {
428
+ classPropertyName: "placeholder",
429
+ publicName: "placeholder",
430
+ isSignal: true,
431
+ isRequired: false,
432
+ transformFunction: null
433
+ },
434
+ readonly: {
435
+ classPropertyName: "readonly",
436
+ publicName: "readonly",
437
+ isSignal: true,
438
+ isRequired: false,
439
+ transformFunction: null
440
+ },
441
+ ariaLabel: {
442
+ classPropertyName: "ariaLabel",
443
+ publicName: "aria-label",
444
+ isSignal: true,
445
+ isRequired: false,
446
+ transformFunction: null
447
+ },
448
+ ariaLabelledBy: {
449
+ classPropertyName: "ariaLabelledBy",
450
+ publicName: "aria-labelledby",
451
+ isSignal: true,
452
+ isRequired: false,
453
+ transformFunction: null
454
+ },
455
+ outputFormat: {
456
+ classPropertyName: "outputFormat",
457
+ publicName: "outputFormat",
458
+ isSignal: true,
459
+ isRequired: false,
460
+ transformFunction: null
461
+ },
462
+ alphaChannel: {
463
+ classPropertyName: "alphaChannel",
464
+ publicName: "alphaChannel",
465
+ isSignal: true,
466
+ isRequired: false,
467
+ transformFunction: null
468
+ },
469
+ cmyk: {
470
+ classPropertyName: "cmyk",
471
+ publicName: "cmyk",
472
+ isSignal: true,
473
+ isRequired: false,
474
+ transformFunction: null
475
+ },
476
+ presets: {
477
+ classPropertyName: "presets",
478
+ publicName: "presets",
479
+ isSignal: true,
480
+ isRequired: false,
481
+ transformFunction: null
482
+ },
483
+ overlayOffset: {
484
+ classPropertyName: "overlayOffset",
485
+ publicName: "overlayOffset",
486
+ isSignal: true,
487
+ isRequired: false,
488
+ transformFunction: null
489
+ },
490
+ clearable: {
491
+ classPropertyName: "clearable",
492
+ publicName: "clearable",
493
+ isSignal: true,
494
+ isRequired: false,
495
+ transformFunction: null
496
+ },
497
+ disabled: {
498
+ classPropertyName: "disabled",
499
+ publicName: "disabled",
500
+ isSignal: true,
501
+ isRequired: false,
502
+ transformFunction: null
503
+ }
504
+ },
505
+ host: { properties: { "class.full-width": "fullWidth()" } },
506
+ providers: [
507
+ {
508
+ provide: NG_VALUE_ACCESSOR,
509
+ useExisting: forwardRef(() => NbColorPickerComponent),
510
+ multi: true
511
+ },
512
+ {
513
+ provide: NG_VALIDATORS,
514
+ useExisting: forwardRef(() => NbColorPickerComponent),
515
+ multi: true
516
+ },
517
+ {
518
+ provide: NXT_COLOR_PICKER_TEXTS,
519
+ useFactory: injectNbColorPickerTexts
520
+ }
521
+ ],
522
+ viewQueries: [{
523
+ propertyName: "field",
524
+ first: true,
525
+ predicate: ["field"],
526
+ descendants: true,
527
+ isSignal: true
528
+ }, {
529
+ propertyName: "dialog",
530
+ first: true,
531
+ predicate: ["dialog"],
532
+ descendants: true,
533
+ isSignal: true
534
+ }],
535
+ ngImport: i0,
536
+ template: "<nb-form-field>\n <span nbPrefix\n class=\"swatch\"\n aria-hidden=\"true\">\n <span [style.--nb-color-picker-swatch]=\"swatch()\"></span>\n </span>\n <input #field\n nbInput\n autocomplete=\"off\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"open() ? dialogId : null\"\n [fieldSize]=\"size()\"\n [status]=\"resolvedStatus()\"\n [shape]=\"shape()\"\n [fullWidth]=\"fullWidth()\"\n [ghost]=\"ghost()\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"fieldLabelledBy() ? null : (ariaLabel() ?? texts().color)\"\n [attr.aria-labelledby]=\"fieldLabelledBy()\"\n [attr.aria-required]=\"validation?.ariaRequired()\"\n [attr.aria-invalid]=\"validation?.ariaInvalid()\"\n [attr.aria-describedby]=\"validation?.describedBy()\"\n [attr.disabled]=\"isDisabled() || null\"\n [readOnly]=\"readonly()\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onFieldKeydown($event)\"\n (blur)=\"onBlur()\" />\n @if (clearable() && value() && !isDisabled() && !readonly()) {\n <button nbSuffix\n nbButton\n ghost\n type=\"button\"\n [size]=\"size()\"\n [status]=\"buttonStatus()\"\n [attr.aria-label]=\"texts().clear\"\n (click)=\"clear($event)\">\n <nb-icon icon=\"close-outline\"\n pack=\"essentials\" />\n </button>\n }\n</nb-form-field>\n\n<!-- The dialog, shown in the overlay while it's open. -->\n<ng-template #dialog>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- Keys bubble up from the controls inside. -->\n <div [id]=\"dialogId\"\n (keydown)=\"onDialogKeydown($event)\"\n (keyup)=\"onDialogKeyup($event)\">\n <ng-container nxtColor\n dialogDisplay=\"inline\"\n [nxtColor]=\"value() ?? ''\"\n [outputFormat]=\"outputFormat()\"\n [alphaChannel]=\"alphaChannel()\"\n [cmykEnabled]=\"cmyk()\"\n [presetColors]=\"presets()\"\n [presetLabel]=\"!!presets()?.length\"\n (nxtColorChange)=\"onColorChange($event)\"\n (cmykColorChange)=\"onCmykChange($event)\" />\n </div>\n</ng-template>\n",
537
+ styles: ["nb-color-picker{display:inline-block;vertical-align:middle}nb-color-picker.full-width{display:block}nb-color-picker .swatch{display:flex;align-items:center;justify-content:center;width:100%;height:100%}nb-color-picker .swatch>span{width:100%;aspect-ratio:1;border-radius:50%}nb-color-picker .swatch>span[style*=--nb-color-picker-swatch]{background-image:linear-gradient(var(--nb-color-picker-swatch),var(--nb-color-picker-swatch)),conic-gradient(#fff 0 25%,#ccc 0 50%,#fff 0 75%,#ccc 0)}nb-color-picker-dialog{display:block;border:var(--color-picker-border-width) var(--color-picker-border-style) var(--color-picker-border-color);border-radius:var(--color-picker-border-radius);background:var(--color-picker-background-color);box-shadow:var(--color-picker-shadow)}nb-color-picker-dialog nxt-color-picker{display:block;--nxt-color-picker-background: transparent;--nxt-color-picker-border: none;--nxt-color-picker-border-radius: max( 0px, calc(var(--color-picker-border-radius) - var(--color-picker-border-width)) );--nxt-color-picker-shadow: none;--nxt-color-picker-text-color: var(--color-picker-text-color);--nxt-color-picker-font-family: var(--color-picker-text-font-family);--nxt-color-picker-font-size: var(--color-picker-text-font-size);--nxt-color-picker-border-color: var(--color-picker-divider-color);--nxt-color-picker-focus-outline: var(--outline-width) solid var(--outline-color);--nxt-color-picker-focus-outline-width: var(--outline-width);--nxt-color-picker-arrow-color: var(--color-picker-format-arrow-color);--nxt-color-picker-input-background: var(--input-basic-background-color);--nxt-color-picker-input-border-color: var(--input-basic-border-color);--nxt-color-picker-input-border-width: var(--input-border-width);--nxt-color-picker-input-text-color: var(--input-basic-text-color);--nxt-color-picker-input-placeholder-color: var(--input-basic-placeholder-text-color);--nxt-color-picker-input-border-radius: var(--input-rectangle-border-radius);--nxt-color-picker-input-hover-background: var(--input-basic-hover-background-color);--nxt-color-picker-input-hover-border-color: var(--input-basic-hover-border-color);--nxt-color-picker-input-focus-background: var(--input-basic-focus-background-color);--nxt-color-picker-input-focus-border-color: var(--input-basic-focus-border-color);--nxt-color-picker-input-disabled-background: var(--input-basic-disabled-background-color);--nxt-color-picker-input-disabled-border-color: var(--input-basic-disabled-border-color);--nxt-color-picker-input-disabled-text-color: var(--input-basic-disabled-text-color);--nxt-color-picker-button-color: var(--button-filled-basic-text-color);--nxt-color-picker-button-background: var(--button-filled-basic-background-color);--nxt-color-picker-button-border: var(--button-filled-border-width) var(--button-filled-border-style) var(--button-filled-basic-border-color);--nxt-color-picker-button-border-radius: var(--button-rectangle-border-radius);--nxt-color-picker-button-font-size: var(--button-small-text-font-size);--nxt-color-picker-button-font-weight: var(--button-text-font-weight)}\n"],
538
+ dependencies: [
539
+ {
540
+ kind: "directive",
541
+ type: ColorPickerDirective,
542
+ selector: "[nxtColor]",
543
+ inputs: [
544
+ "nxtColor",
545
+ "width",
546
+ "height",
547
+ "toggle",
548
+ "disabled",
549
+ "mode",
550
+ "cmykEnabled",
551
+ "outputFormat",
552
+ "alphaChannel",
553
+ "fallbackColor",
554
+ "position",
555
+ "positionOffset",
556
+ "presetLabel",
557
+ "presetColors",
558
+ "disableInput",
559
+ "dialogDisplay",
560
+ "dialogClass",
561
+ "ignoredElements",
562
+ "saveClickOutside",
563
+ "closeClickOutside",
564
+ "okButton",
565
+ "cancelButton",
566
+ "clearable",
567
+ "presetColorsEditable",
568
+ "maxPresetColors",
569
+ "useRootViewContainer"
570
+ ],
571
+ outputs: [
572
+ "open",
573
+ "close",
574
+ "inputChange",
575
+ "toggleChange",
576
+ "sliderDragStart",
577
+ "sliderChange",
578
+ "sliderDragEnd",
579
+ "colorSelect",
580
+ "colorSelectCancel",
581
+ "nxtColorChange",
582
+ "cmykColorChange",
583
+ "presetColorsChange"
584
+ ],
585
+ exportAs: ["nxtColorPicker"]
586
+ },
587
+ {
588
+ kind: "component",
589
+ type: NbButtonComponent,
590
+ selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]",
591
+ inputs: ["hero", "loading"]
592
+ },
593
+ {
594
+ kind: "ngmodule",
595
+ type: NbFormFieldModule
596
+ },
597
+ {
598
+ kind: "component",
599
+ type: i1.NbFormFieldComponent,
600
+ selector: "nb-form-field"
601
+ },
602
+ {
603
+ kind: "directive",
604
+ type: i1.NbPrefixDirective,
605
+ selector: "[nbPrefix]"
606
+ },
607
+ {
608
+ kind: "directive",
609
+ type: i1.NbSuffixDirective,
610
+ selector: "[nbSuffix]"
611
+ },
612
+ {
613
+ kind: "component",
614
+ type: NbIconComponent,
615
+ selector: "nb-icon",
616
+ inputs: [
617
+ "icon",
618
+ "pack",
619
+ "options",
620
+ "status",
621
+ "config"
622
+ ]
623
+ },
624
+ {
625
+ kind: "directive",
626
+ type: NbInputDirective,
627
+ selector: "input[nbInput],textarea[nbInput]",
628
+ inputs: [
629
+ "fieldSize",
630
+ "status",
631
+ "shape",
632
+ "fullWidth",
633
+ "ghost"
634
+ ]
635
+ }
636
+ ],
637
+ encapsulation: i0.ViewEncapsulation.None
638
+ });
639
+ }
640
+ };
641
+ i0.ɵɵngDeclareClassMetadata({
642
+ minVersion: "12.0.0",
643
+ version: "22.3.0",
644
+ ngImport: i0,
645
+ type: NbColorPickerComponent,
646
+ decorators: [{
647
+ type: Component,
648
+ args: [{
649
+ selector: "nb-color-picker",
650
+ encapsulation: ViewEncapsulation.None,
651
+ imports: [
652
+ ColorPickerDirective,
653
+ NbButtonComponent,
654
+ NbFormFieldModule,
655
+ NbIconComponent,
656
+ NbInputDirective
657
+ ],
658
+ providers: [
659
+ {
660
+ provide: NG_VALUE_ACCESSOR,
661
+ useExisting: forwardRef(() => NbColorPickerComponent),
662
+ multi: true
663
+ },
664
+ {
665
+ provide: NG_VALIDATORS,
666
+ useExisting: forwardRef(() => NbColorPickerComponent),
667
+ multi: true
668
+ },
669
+ {
670
+ provide: NXT_COLOR_PICKER_TEXTS,
671
+ useFactory: injectNbColorPickerTexts
672
+ }
673
+ ],
674
+ host: { "[class.full-width]": "fullWidth()" },
675
+ template: "<nb-form-field>\n <span nbPrefix\n class=\"swatch\"\n aria-hidden=\"true\">\n <span [style.--nb-color-picker-swatch]=\"swatch()\"></span>\n </span>\n <input #field\n nbInput\n autocomplete=\"off\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"open() ? dialogId : null\"\n [fieldSize]=\"size()\"\n [status]=\"resolvedStatus()\"\n [shape]=\"shape()\"\n [fullWidth]=\"fullWidth()\"\n [ghost]=\"ghost()\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"fieldLabelledBy() ? null : (ariaLabel() ?? texts().color)\"\n [attr.aria-labelledby]=\"fieldLabelledBy()\"\n [attr.aria-required]=\"validation?.ariaRequired()\"\n [attr.aria-invalid]=\"validation?.ariaInvalid()\"\n [attr.aria-describedby]=\"validation?.describedBy()\"\n [attr.disabled]=\"isDisabled() || null\"\n [readOnly]=\"readonly()\"\n [value]=\"text()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onFieldKeydown($event)\"\n (blur)=\"onBlur()\" />\n @if (clearable() && value() && !isDisabled() && !readonly()) {\n <button nbSuffix\n nbButton\n ghost\n type=\"button\"\n [size]=\"size()\"\n [status]=\"buttonStatus()\"\n [attr.aria-label]=\"texts().clear\"\n (click)=\"clear($event)\">\n <nb-icon icon=\"close-outline\"\n pack=\"essentials\" />\n </button>\n }\n</nb-form-field>\n\n<!-- The dialog, shown in the overlay while it's open. -->\n<ng-template #dialog>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- Keys bubble up from the controls inside. -->\n <div [id]=\"dialogId\"\n (keydown)=\"onDialogKeydown($event)\"\n (keyup)=\"onDialogKeyup($event)\">\n <ng-container nxtColor\n dialogDisplay=\"inline\"\n [nxtColor]=\"value() ?? ''\"\n [outputFormat]=\"outputFormat()\"\n [alphaChannel]=\"alphaChannel()\"\n [cmykEnabled]=\"cmyk()\"\n [presetColors]=\"presets()\"\n [presetLabel]=\"!!presets()?.length\"\n (nxtColorChange)=\"onColorChange($event)\"\n (cmykColorChange)=\"onCmykChange($event)\" />\n </div>\n</ng-template>\n",
676
+ styles: ["nb-color-picker{display:inline-block;vertical-align:middle}nb-color-picker.full-width{display:block}nb-color-picker .swatch{display:flex;align-items:center;justify-content:center;width:100%;height:100%}nb-color-picker .swatch>span{width:100%;aspect-ratio:1;border-radius:50%}nb-color-picker .swatch>span[style*=--nb-color-picker-swatch]{background-image:linear-gradient(var(--nb-color-picker-swatch),var(--nb-color-picker-swatch)),conic-gradient(#fff 0 25%,#ccc 0 50%,#fff 0 75%,#ccc 0)}nb-color-picker-dialog{display:block;border:var(--color-picker-border-width) var(--color-picker-border-style) var(--color-picker-border-color);border-radius:var(--color-picker-border-radius);background:var(--color-picker-background-color);box-shadow:var(--color-picker-shadow)}nb-color-picker-dialog nxt-color-picker{display:block;--nxt-color-picker-background: transparent;--nxt-color-picker-border: none;--nxt-color-picker-border-radius: max( 0px, calc(var(--color-picker-border-radius) - var(--color-picker-border-width)) );--nxt-color-picker-shadow: none;--nxt-color-picker-text-color: var(--color-picker-text-color);--nxt-color-picker-font-family: var(--color-picker-text-font-family);--nxt-color-picker-font-size: var(--color-picker-text-font-size);--nxt-color-picker-border-color: var(--color-picker-divider-color);--nxt-color-picker-focus-outline: var(--outline-width) solid var(--outline-color);--nxt-color-picker-focus-outline-width: var(--outline-width);--nxt-color-picker-arrow-color: var(--color-picker-format-arrow-color);--nxt-color-picker-input-background: var(--input-basic-background-color);--nxt-color-picker-input-border-color: var(--input-basic-border-color);--nxt-color-picker-input-border-width: var(--input-border-width);--nxt-color-picker-input-text-color: var(--input-basic-text-color);--nxt-color-picker-input-placeholder-color: var(--input-basic-placeholder-text-color);--nxt-color-picker-input-border-radius: var(--input-rectangle-border-radius);--nxt-color-picker-input-hover-background: var(--input-basic-hover-background-color);--nxt-color-picker-input-hover-border-color: var(--input-basic-hover-border-color);--nxt-color-picker-input-focus-background: var(--input-basic-focus-background-color);--nxt-color-picker-input-focus-border-color: var(--input-basic-focus-border-color);--nxt-color-picker-input-disabled-background: var(--input-basic-disabled-background-color);--nxt-color-picker-input-disabled-border-color: var(--input-basic-disabled-border-color);--nxt-color-picker-input-disabled-text-color: var(--input-basic-disabled-text-color);--nxt-color-picker-button-color: var(--button-filled-basic-text-color);--nxt-color-picker-button-background: var(--button-filled-basic-background-color);--nxt-color-picker-button-border: var(--button-filled-border-width) var(--button-filled-border-style) var(--button-filled-basic-border-color);--nxt-color-picker-button-border-radius: var(--button-rectangle-border-radius);--nxt-color-picker-button-font-size: var(--button-small-text-font-size);--nxt-color-picker-button-font-weight: var(--button-text-font-weight)}\n"]
677
+ }]
678
+ }],
679
+ ctorParameters: () => [],
680
+ propDecorators: {
681
+ sizeInput: [{
682
+ type: i0.Input,
683
+ args: [{
684
+ isSignal: true,
685
+ alias: "size",
686
+ required: false
687
+ }]
688
+ }],
689
+ status: [{
690
+ type: i0.Input,
691
+ args: [{
692
+ isSignal: true,
693
+ alias: "status",
694
+ required: false
695
+ }]
696
+ }],
697
+ shapeInput: [{
698
+ type: i0.Input,
699
+ args: [{
700
+ isSignal: true,
701
+ alias: "shape",
702
+ required: false
703
+ }]
704
+ }],
705
+ fullWidth: [{
706
+ type: i0.Input,
707
+ args: [{
708
+ isSignal: true,
709
+ alias: "fullWidth",
710
+ required: false
711
+ }]
712
+ }],
713
+ ghost: [{
714
+ type: i0.Input,
715
+ args: [{
716
+ isSignal: true,
717
+ alias: "ghost",
718
+ required: false
719
+ }]
720
+ }],
721
+ placeholder: [{
722
+ type: i0.Input,
723
+ args: [{
724
+ isSignal: true,
725
+ alias: "placeholder",
726
+ required: false
727
+ }]
728
+ }],
729
+ readonly: [{
730
+ type: i0.Input,
731
+ args: [{
732
+ isSignal: true,
733
+ alias: "readonly",
734
+ required: false
735
+ }]
736
+ }],
737
+ ariaLabel: [{
738
+ type: i0.Input,
739
+ args: [{
740
+ isSignal: true,
741
+ alias: "aria-label",
742
+ required: false
743
+ }]
744
+ }],
745
+ ariaLabelledBy: [{
746
+ type: i0.Input,
747
+ args: [{
748
+ isSignal: true,
749
+ alias: "aria-labelledby",
750
+ required: false
751
+ }]
752
+ }],
753
+ outputFormat: [{
754
+ type: i0.Input,
755
+ args: [{
756
+ isSignal: true,
757
+ alias: "outputFormat",
758
+ required: false
759
+ }]
760
+ }],
761
+ alphaChannel: [{
762
+ type: i0.Input,
763
+ args: [{
764
+ isSignal: true,
765
+ alias: "alphaChannel",
766
+ required: false
767
+ }]
768
+ }],
769
+ cmyk: [{
770
+ type: i0.Input,
771
+ args: [{
772
+ isSignal: true,
773
+ alias: "cmyk",
774
+ required: false
775
+ }]
776
+ }],
777
+ presets: [{
778
+ type: i0.Input,
779
+ args: [{
780
+ isSignal: true,
781
+ alias: "presets",
782
+ required: false
783
+ }]
784
+ }],
785
+ overlayOffset: [{
786
+ type: i0.Input,
787
+ args: [{
788
+ isSignal: true,
789
+ alias: "overlayOffset",
790
+ required: false
791
+ }]
792
+ }],
793
+ clearable: [{
794
+ type: i0.Input,
795
+ args: [{
796
+ isSignal: true,
797
+ alias: "clearable",
798
+ required: false
799
+ }]
800
+ }],
801
+ disabled: [{
802
+ type: i0.Input,
803
+ args: [{
804
+ isSignal: true,
805
+ alias: "disabled",
806
+ required: false
807
+ }]
808
+ }],
809
+ field: [{
810
+ type: i0.ViewChild,
811
+ args: ["field", { isSignal: true }]
812
+ }],
813
+ dialog: [{
814
+ type: i0.ViewChild,
815
+ args: ["dialog", { isSignal: true }]
816
+ }]
817
+ }
818
+ });
819
+ export { NB_COLOR_PICKER_ERROR, NbColorPickerComponent };
820
+
821
+ //# sourceMappingURL=liquid-js-lyr-extras-color-picker.mjs.map