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

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 +819 -0
  6. package/fesm2022/liquid-js-lyr-extras-color-picker.mjs.map +1 -0
  7. package/fesm2022/liquid-js-lyr-extras-markdown-editor.mjs +921 -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 +238 -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 +862 -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,819 @@
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
+ this.value.set(value || null);
228
+ this.setParseError(false);
229
+ this.show(value || "");
230
+ }
231
+ registerOnChange(fn) {
232
+ this.onChange = fn;
233
+ }
234
+ registerOnTouched(fn) {
235
+ this.onTouched = fn;
236
+ }
237
+ registerOnValidatorChange(fn) {
238
+ this.onValidatorChange = fn;
239
+ }
240
+ setDisabledState(disabled) {
241
+ this.isDisabled.set(disabled);
242
+ }
243
+ validate() {
244
+ if (!this.parseError()) return null;
245
+ const error = {
246
+ kind: NB_COLOR_PICKER_ERROR,
247
+ message: this.texts().invalid
248
+ };
249
+ const message = this.message({
250
+ kind: NB_COLOR_PICKER_ERROR,
251
+ params: error
252
+ });
253
+ return { [NB_COLOR_PICKER_ERROR]: {
254
+ ...error,
255
+ message
256
+ } };
257
+ }
258
+ clear(event) {
259
+ this.setParseError(false);
260
+ this.update(null);
261
+ this.show("");
262
+ this.onTouched();
263
+ if (event?.currentTarget?.matches(":focus-visible")) this.field()?.nativeElement.focus();
264
+ }
265
+ onColorChange(color) {
266
+ if (!this.cmyk()) this.changed(color);
267
+ }
268
+ onCmykChange(color) {
269
+ if (this.cmyk()) this.changed(color);
270
+ }
271
+ onInput(event) {
272
+ const text = event.target.value.trim();
273
+ if (!text && this.clearable()) {
274
+ this.setParseError(false);
275
+ this.update(null);
276
+ } else {
277
+ const color = this.typedColor(text);
278
+ this.setParseError(!color);
279
+ if (color) this.update(color);
280
+ }
281
+ this.onValidatorChange();
282
+ }
283
+ onFieldKeydown(event) {
284
+ if (event.ctrlKey || event.metaKey || event.altKey || event.shiftKey) return;
285
+ if (event.key === "ArrowDown" && !this.isDisabled() && !this.readonly()) {
286
+ event.preventDefault();
287
+ this.focusDialog();
288
+ } else if (event.key === "Escape" && this.open()) {
289
+ event.preventDefault();
290
+ event.stopPropagation();
291
+ this.overlay?.hide();
292
+ }
293
+ }
294
+ onDialogKeydown(event) {
295
+ if (event.key === "Escape") {
296
+ event.preventDefault();
297
+ event.stopPropagation();
298
+ this.closeDialog();
299
+ } else if (event.key === "Enter") this.enterInDialog = true;
300
+ }
301
+ onDialogKeyup(event) {
302
+ if (event.key === "Enter" && this.enterInDialog) {
303
+ this.enterInDialog = false;
304
+ event.preventDefault();
305
+ this.closeDialog();
306
+ }
307
+ }
308
+ onBlur() {
309
+ if (!this.open()) this.leave();
310
+ }
311
+ onClose() {
312
+ this.open.set(false);
313
+ this.enterInDialog = false;
314
+ if (!this.focused()) this.leave();
315
+ }
316
+ focusDialog() {
317
+ if (!this.open()) this.overlay?.show();
318
+ afterNextRender(() => this.overlay?.containerElement?.querySelector(DIALOG_FOCUSABLE)?.focus(), { injector: this.injector });
319
+ }
320
+ closeDialog() {
321
+ this.field()?.nativeElement.focus();
322
+ this.overlay?.hide();
323
+ }
324
+ typedColor(text) {
325
+ const hsva = stringToHsva(text, true);
326
+ const cmyk = stringToCmyk(text, true);
327
+ const format = this.outputFormat();
328
+ const alpha = this.alphaChannel();
329
+ const alphaChannel = format === "hex" && alpha !== "always" && alpha !== "forced" ? "disabled" : alpha;
330
+ if (alphaChannel === "disabled") {
331
+ if (hsva) hsva.a = 1;
332
+ if (cmyk) cmyk.a = 1;
333
+ }
334
+ if (this.cmyk()) {
335
+ const value = cmyk ?? (hsva && rgbaToCmyk(hsvaToRgba(hsva)));
336
+ return value ? formatCmyk(value, alphaChannel) : void 0;
337
+ }
338
+ const color = hsva ?? (cmyk && rgbaToHsva(cmykToRgb(cmyk)));
339
+ return color ? formatOutput(color, format, alphaChannel) : void 0;
340
+ }
341
+ leave() {
342
+ if (!this.parseError()) this.show(this.value() ?? "");
343
+ this.onTouched();
344
+ }
345
+ changed(color) {
346
+ this.setParseError(false);
347
+ this.update(color);
348
+ this.show(color);
349
+ }
350
+ update(color) {
351
+ const value = color || null;
352
+ if (value !== this.value()) {
353
+ this.value.set(value);
354
+ this.onChange(value);
355
+ }
356
+ }
357
+ focused() {
358
+ const field = this.field()?.nativeElement;
359
+ return !!field && field.ownerDocument.activeElement === field;
360
+ }
361
+ show(text) {
362
+ this.text.set(text);
363
+ const field = this.field()?.nativeElement;
364
+ if (field && field.value !== text) field.value = text;
365
+ }
366
+ setParseError(parseError) {
367
+ if (parseError !== this.parseError()) {
368
+ this.parseError.set(parseError);
369
+ this.onValidatorChange();
370
+ }
371
+ }
372
+ static {
373
+ this.ɵfac = i0.ɵɵngDeclareFactory({
374
+ minVersion: "12.0.0",
375
+ version: "22.3.0",
376
+ ngImport: i0,
377
+ type: NbColorPickerComponent,
378
+ deps: [],
379
+ target: i0.ɵɵFactoryTarget.Component
380
+ });
381
+ }
382
+ static {
383
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
384
+ minVersion: "17.0.0",
385
+ version: "22.3.0",
386
+ type: NbColorPickerComponent,
387
+ isStandalone: true,
388
+ selector: "nb-color-picker",
389
+ inputs: {
390
+ sizeInput: {
391
+ classPropertyName: "sizeInput",
392
+ publicName: "size",
393
+ isSignal: true,
394
+ isRequired: false,
395
+ transformFunction: null
396
+ },
397
+ status: {
398
+ classPropertyName: "status",
399
+ publicName: "status",
400
+ isSignal: true,
401
+ isRequired: false,
402
+ transformFunction: null
403
+ },
404
+ shapeInput: {
405
+ classPropertyName: "shapeInput",
406
+ publicName: "shape",
407
+ isSignal: true,
408
+ isRequired: false,
409
+ transformFunction: null
410
+ },
411
+ fullWidth: {
412
+ classPropertyName: "fullWidth",
413
+ publicName: "fullWidth",
414
+ isSignal: true,
415
+ isRequired: false,
416
+ transformFunction: null
417
+ },
418
+ ghost: {
419
+ classPropertyName: "ghost",
420
+ publicName: "ghost",
421
+ isSignal: true,
422
+ isRequired: false,
423
+ transformFunction: null
424
+ },
425
+ placeholder: {
426
+ classPropertyName: "placeholder",
427
+ publicName: "placeholder",
428
+ isSignal: true,
429
+ isRequired: false,
430
+ transformFunction: null
431
+ },
432
+ readonly: {
433
+ classPropertyName: "readonly",
434
+ publicName: "readonly",
435
+ isSignal: true,
436
+ isRequired: false,
437
+ transformFunction: null
438
+ },
439
+ ariaLabel: {
440
+ classPropertyName: "ariaLabel",
441
+ publicName: "aria-label",
442
+ isSignal: true,
443
+ isRequired: false,
444
+ transformFunction: null
445
+ },
446
+ ariaLabelledBy: {
447
+ classPropertyName: "ariaLabelledBy",
448
+ publicName: "aria-labelledby",
449
+ isSignal: true,
450
+ isRequired: false,
451
+ transformFunction: null
452
+ },
453
+ outputFormat: {
454
+ classPropertyName: "outputFormat",
455
+ publicName: "outputFormat",
456
+ isSignal: true,
457
+ isRequired: false,
458
+ transformFunction: null
459
+ },
460
+ alphaChannel: {
461
+ classPropertyName: "alphaChannel",
462
+ publicName: "alphaChannel",
463
+ isSignal: true,
464
+ isRequired: false,
465
+ transformFunction: null
466
+ },
467
+ cmyk: {
468
+ classPropertyName: "cmyk",
469
+ publicName: "cmyk",
470
+ isSignal: true,
471
+ isRequired: false,
472
+ transformFunction: null
473
+ },
474
+ presets: {
475
+ classPropertyName: "presets",
476
+ publicName: "presets",
477
+ isSignal: true,
478
+ isRequired: false,
479
+ transformFunction: null
480
+ },
481
+ overlayOffset: {
482
+ classPropertyName: "overlayOffset",
483
+ publicName: "overlayOffset",
484
+ isSignal: true,
485
+ isRequired: false,
486
+ transformFunction: null
487
+ },
488
+ clearable: {
489
+ classPropertyName: "clearable",
490
+ publicName: "clearable",
491
+ isSignal: true,
492
+ isRequired: false,
493
+ transformFunction: null
494
+ },
495
+ disabled: {
496
+ classPropertyName: "disabled",
497
+ publicName: "disabled",
498
+ isSignal: true,
499
+ isRequired: false,
500
+ transformFunction: null
501
+ }
502
+ },
503
+ host: { properties: { "class.full-width": "fullWidth()" } },
504
+ providers: [
505
+ {
506
+ provide: NG_VALUE_ACCESSOR,
507
+ useExisting: forwardRef(() => NbColorPickerComponent),
508
+ multi: true
509
+ },
510
+ {
511
+ provide: NG_VALIDATORS,
512
+ useExisting: forwardRef(() => NbColorPickerComponent),
513
+ multi: true
514
+ },
515
+ {
516
+ provide: NXT_COLOR_PICKER_TEXTS,
517
+ useFactory: injectNbColorPickerTexts
518
+ }
519
+ ],
520
+ viewQueries: [{
521
+ propertyName: "field",
522
+ first: true,
523
+ predicate: ["field"],
524
+ descendants: true,
525
+ isSignal: true
526
+ }, {
527
+ propertyName: "dialog",
528
+ first: true,
529
+ predicate: ["dialog"],
530
+ descendants: true,
531
+ isSignal: true
532
+ }],
533
+ ngImport: i0,
534
+ 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",
535
+ 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"],
536
+ dependencies: [
537
+ {
538
+ kind: "directive",
539
+ type: ColorPickerDirective,
540
+ selector: "[nxtColor]",
541
+ inputs: [
542
+ "nxtColor",
543
+ "width",
544
+ "height",
545
+ "toggle",
546
+ "disabled",
547
+ "mode",
548
+ "cmykEnabled",
549
+ "outputFormat",
550
+ "alphaChannel",
551
+ "fallbackColor",
552
+ "position",
553
+ "positionOffset",
554
+ "presetLabel",
555
+ "presetColors",
556
+ "disableInput",
557
+ "dialogDisplay",
558
+ "dialogClass",
559
+ "ignoredElements",
560
+ "saveClickOutside",
561
+ "closeClickOutside",
562
+ "okButton",
563
+ "cancelButton",
564
+ "clearable",
565
+ "presetColorsEditable",
566
+ "maxPresetColors",
567
+ "useRootViewContainer"
568
+ ],
569
+ outputs: [
570
+ "open",
571
+ "close",
572
+ "inputChange",
573
+ "toggleChange",
574
+ "sliderDragStart",
575
+ "sliderChange",
576
+ "sliderDragEnd",
577
+ "colorSelect",
578
+ "colorSelectCancel",
579
+ "nxtColorChange",
580
+ "cmykColorChange",
581
+ "presetColorsChange"
582
+ ],
583
+ exportAs: ["nxtColorPicker"]
584
+ },
585
+ {
586
+ kind: "component",
587
+ type: NbButtonComponent,
588
+ selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]",
589
+ inputs: ["hero", "loading"]
590
+ },
591
+ {
592
+ kind: "ngmodule",
593
+ type: NbFormFieldModule
594
+ },
595
+ {
596
+ kind: "component",
597
+ type: i1.NbFormFieldComponent,
598
+ selector: "nb-form-field"
599
+ },
600
+ {
601
+ kind: "directive",
602
+ type: i1.NbPrefixDirective,
603
+ selector: "[nbPrefix]"
604
+ },
605
+ {
606
+ kind: "directive",
607
+ type: i1.NbSuffixDirective,
608
+ selector: "[nbSuffix]"
609
+ },
610
+ {
611
+ kind: "component",
612
+ type: NbIconComponent,
613
+ selector: "nb-icon",
614
+ inputs: [
615
+ "icon",
616
+ "pack",
617
+ "options",
618
+ "status",
619
+ "config"
620
+ ]
621
+ },
622
+ {
623
+ kind: "directive",
624
+ type: NbInputDirective,
625
+ selector: "input[nbInput],textarea[nbInput]",
626
+ inputs: [
627
+ "fieldSize",
628
+ "status",
629
+ "shape",
630
+ "fullWidth",
631
+ "ghost"
632
+ ]
633
+ }
634
+ ],
635
+ encapsulation: i0.ViewEncapsulation.None
636
+ });
637
+ }
638
+ };
639
+ i0.ɵɵngDeclareClassMetadata({
640
+ minVersion: "12.0.0",
641
+ version: "22.3.0",
642
+ ngImport: i0,
643
+ type: NbColorPickerComponent,
644
+ decorators: [{
645
+ type: Component,
646
+ args: [{
647
+ selector: "nb-color-picker",
648
+ encapsulation: ViewEncapsulation.None,
649
+ imports: [
650
+ ColorPickerDirective,
651
+ NbButtonComponent,
652
+ NbFormFieldModule,
653
+ NbIconComponent,
654
+ NbInputDirective
655
+ ],
656
+ providers: [
657
+ {
658
+ provide: NG_VALUE_ACCESSOR,
659
+ useExisting: forwardRef(() => NbColorPickerComponent),
660
+ multi: true
661
+ },
662
+ {
663
+ provide: NG_VALIDATORS,
664
+ useExisting: forwardRef(() => NbColorPickerComponent),
665
+ multi: true
666
+ },
667
+ {
668
+ provide: NXT_COLOR_PICKER_TEXTS,
669
+ useFactory: injectNbColorPickerTexts
670
+ }
671
+ ],
672
+ host: { "[class.full-width]": "fullWidth()" },
673
+ 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",
674
+ 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"]
675
+ }]
676
+ }],
677
+ ctorParameters: () => [],
678
+ propDecorators: {
679
+ sizeInput: [{
680
+ type: i0.Input,
681
+ args: [{
682
+ isSignal: true,
683
+ alias: "size",
684
+ required: false
685
+ }]
686
+ }],
687
+ status: [{
688
+ type: i0.Input,
689
+ args: [{
690
+ isSignal: true,
691
+ alias: "status",
692
+ required: false
693
+ }]
694
+ }],
695
+ shapeInput: [{
696
+ type: i0.Input,
697
+ args: [{
698
+ isSignal: true,
699
+ alias: "shape",
700
+ required: false
701
+ }]
702
+ }],
703
+ fullWidth: [{
704
+ type: i0.Input,
705
+ args: [{
706
+ isSignal: true,
707
+ alias: "fullWidth",
708
+ required: false
709
+ }]
710
+ }],
711
+ ghost: [{
712
+ type: i0.Input,
713
+ args: [{
714
+ isSignal: true,
715
+ alias: "ghost",
716
+ required: false
717
+ }]
718
+ }],
719
+ placeholder: [{
720
+ type: i0.Input,
721
+ args: [{
722
+ isSignal: true,
723
+ alias: "placeholder",
724
+ required: false
725
+ }]
726
+ }],
727
+ readonly: [{
728
+ type: i0.Input,
729
+ args: [{
730
+ isSignal: true,
731
+ alias: "readonly",
732
+ required: false
733
+ }]
734
+ }],
735
+ ariaLabel: [{
736
+ type: i0.Input,
737
+ args: [{
738
+ isSignal: true,
739
+ alias: "aria-label",
740
+ required: false
741
+ }]
742
+ }],
743
+ ariaLabelledBy: [{
744
+ type: i0.Input,
745
+ args: [{
746
+ isSignal: true,
747
+ alias: "aria-labelledby",
748
+ required: false
749
+ }]
750
+ }],
751
+ outputFormat: [{
752
+ type: i0.Input,
753
+ args: [{
754
+ isSignal: true,
755
+ alias: "outputFormat",
756
+ required: false
757
+ }]
758
+ }],
759
+ alphaChannel: [{
760
+ type: i0.Input,
761
+ args: [{
762
+ isSignal: true,
763
+ alias: "alphaChannel",
764
+ required: false
765
+ }]
766
+ }],
767
+ cmyk: [{
768
+ type: i0.Input,
769
+ args: [{
770
+ isSignal: true,
771
+ alias: "cmyk",
772
+ required: false
773
+ }]
774
+ }],
775
+ presets: [{
776
+ type: i0.Input,
777
+ args: [{
778
+ isSignal: true,
779
+ alias: "presets",
780
+ required: false
781
+ }]
782
+ }],
783
+ overlayOffset: [{
784
+ type: i0.Input,
785
+ args: [{
786
+ isSignal: true,
787
+ alias: "overlayOffset",
788
+ required: false
789
+ }]
790
+ }],
791
+ clearable: [{
792
+ type: i0.Input,
793
+ args: [{
794
+ isSignal: true,
795
+ alias: "clearable",
796
+ required: false
797
+ }]
798
+ }],
799
+ disabled: [{
800
+ type: i0.Input,
801
+ args: [{
802
+ isSignal: true,
803
+ alias: "disabled",
804
+ required: false
805
+ }]
806
+ }],
807
+ field: [{
808
+ type: i0.ViewChild,
809
+ args: ["field", { isSignal: true }]
810
+ }],
811
+ dialog: [{
812
+ type: i0.ViewChild,
813
+ args: ["dialog", { isSignal: true }]
814
+ }]
815
+ }
816
+ });
817
+ export { NB_COLOR_PICKER_ERROR, NbColorPickerComponent };
818
+
819
+ //# sourceMappingURL=liquid-js-lyr-extras-color-picker.mjs.map