@unipin/angular-applet 21.1.0 → 21.1.3
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 +334 -37
- package/fesm2022/unipin-angular-applet-accordion.mjs +23 -23
- package/fesm2022/unipin-angular-applet-accordion.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-alert-dialog.mjs +93 -79
- package/fesm2022/unipin-angular-applet-alert-dialog.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-alert.mjs +13 -13
- package/fesm2022/unipin-angular-applet-alert.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-approval.mjs +129 -0
- package/fesm2022/unipin-angular-applet-approval.mjs.map +1 -0
- package/fesm2022/unipin-angular-applet-auth.mjs +44 -25
- package/fesm2022/unipin-angular-applet-auth.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-avatar.mjs +4 -4
- package/fesm2022/unipin-angular-applet-avatar.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-badge.mjs +5 -5
- package/fesm2022/unipin-angular-applet-badge.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-buttons.mjs +10 -10
- package/fesm2022/unipin-angular-applet-buttons.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-calendar.mjs +25 -25
- package/fesm2022/unipin-angular-applet-calendar.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-collapsible.mjs +14 -14
- package/fesm2022/unipin-angular-applet-collapsible.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-common.mjs +60 -23
- package/fesm2022/unipin-angular-applet-common.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-containers.mjs +20 -20
- package/fesm2022/unipin-angular-applet-containers.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-dialog.mjs +74 -56
- package/fesm2022/unipin-angular-applet-dialog.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-forms.mjs +571 -256
- package/fesm2022/unipin-angular-applet-forms.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-froala.mjs +8 -8
- package/fesm2022/unipin-angular-applet-froala.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-infinite-scroll.mjs +5 -5
- package/fesm2022/unipin-angular-applet-infinite-scroll.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-json-viewer.mjs +7 -7
- package/fesm2022/unipin-angular-applet-json-viewer.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-kbd.mjs +4 -4
- package/fesm2022/unipin-angular-applet-kbd.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-loading-dialog.mjs +8 -8
- package/fesm2022/unipin-angular-applet-loading-dialog.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-markdown.mjs +17 -17
- package/fesm2022/unipin-angular-applet-markdown.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-popover.mjs +18 -18
- package/fesm2022/unipin-angular-applet-popover.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-progress-bar.mjs +7 -7
- package/fesm2022/unipin-angular-applet-progress-bar.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-skeleton.mjs +4 -4
- package/fesm2022/unipin-angular-applet-skeleton.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-spinner.mjs +5 -5
- package/fesm2022/unipin-angular-applet-spinner.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-stepper.mjs +288 -0
- package/fesm2022/unipin-angular-applet-stepper.mjs.map +1 -0
- package/fesm2022/unipin-angular-applet-swipeable.mjs +24 -24
- package/fesm2022/unipin-angular-applet-swipeable.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-tabs.mjs +19 -19
- package/fesm2022/unipin-angular-applet-tabs.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-tooltip.mjs +5 -5
- package/fesm2022/unipin-angular-applet-tooltip.mjs.map +1 -1
- package/package.json +9 -1
- package/types/unipin-angular-applet-alert-dialog.d.ts +12 -1
- package/types/unipin-angular-applet-approval.d.ts +55 -0
- package/types/unipin-angular-applet-common.d.ts +12 -2
- package/types/unipin-angular-applet-dialog.d.ts +6 -4
- package/types/unipin-angular-applet-forms.d.ts +118 -39
- package/types/unipin-angular-applet-stepper.d.ts +43 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, inject, Injector, Injectable, input, computed, forwardRef, Directive, HostListener,
|
|
2
|
+
import { signal, inject, Injector, Injectable, input, computed, forwardRef, Directive, HostListener, booleanAttribute, model, ChangeDetectionStrategy, Component, contentChildren, output, contentChild, ViewEncapsulation, viewChild, effect } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@unipin/angular-applet/common';
|
|
4
|
-
import { up } from '@unipin/angular-applet/common';
|
|
4
|
+
import { up, compressImage, UpFileDragNDropDirective } from '@unipin/angular-applet/common';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { NgControl, NgForm, FormGroupDirective, FormsModule } from '@angular/forms';
|
|
7
7
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
@@ -13,6 +13,7 @@ import { format } from 'date-fns';
|
|
|
13
13
|
import { UpButtonDirective } from '@unipin/angular-applet/buttons';
|
|
14
14
|
import { UpCalendarComponent } from '@unipin/angular-applet/calendar';
|
|
15
15
|
import { UpPopoverComponent, UpPopoverTriggerDirective, UpPopoverContentRefDirective } from '@unipin/angular-applet/popover';
|
|
16
|
+
import { matDelete, matUpload } from '@ng-icons/material-icons/baseline';
|
|
16
17
|
|
|
17
18
|
const errMessage = {
|
|
18
19
|
email: (label) => `${label} is not a valid email`,
|
|
@@ -32,7 +33,7 @@ class UpFieldControl {
|
|
|
32
33
|
}
|
|
33
34
|
class UpFieldControlComponent {
|
|
34
35
|
constructor() {
|
|
35
|
-
this.error = signal('',
|
|
36
|
+
this.error = signal('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
36
37
|
this.injector = inject(Injector);
|
|
37
38
|
this.ngControl = this.injector.get(NgControl, null);
|
|
38
39
|
this._parentForm = inject(NgForm, { optional: true });
|
|
@@ -62,10 +63,10 @@ class UpFieldControlComponent {
|
|
|
62
63
|
this.error.set(newState);
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
66
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.
|
|
66
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpFieldControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
67
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpFieldControlComponent }); }
|
|
67
68
|
}
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpFieldControlComponent, decorators: [{
|
|
69
70
|
type: Injectable
|
|
70
71
|
}] });
|
|
71
72
|
|
|
@@ -75,17 +76,17 @@ class UpInputDirective extends UpFieldControlComponent {
|
|
|
75
76
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
76
77
|
this._computedClass = computed(() => {
|
|
77
78
|
return up('peer file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium file:h-7 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none', this.error() ? 'ring-destructive/20 dark:ring-destructive/40 border-destructive focus-visible:ring-destructive/50' : '', this.inlineClass());
|
|
78
|
-
},
|
|
79
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
79
80
|
}
|
|
80
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
81
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.
|
|
81
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpInputDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
82
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: UpInputDirective, isStandalone: true, selector: "[upInput]", inputs: { inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [
|
|
82
83
|
{
|
|
83
84
|
provide: UpFieldControl,
|
|
84
85
|
useExisting: forwardRef(() => UpInputDirective)
|
|
85
86
|
}
|
|
86
87
|
], exportAs: ["upInput"], usesInheritance: true, ngImport: i0 }); }
|
|
87
88
|
}
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpInputDirective, decorators: [{
|
|
89
90
|
type: Directive,
|
|
90
91
|
args: [{
|
|
91
92
|
standalone: true,
|
|
@@ -108,7 +109,7 @@ class UpNumberDirective extends UpInputDirective {
|
|
|
108
109
|
super();
|
|
109
110
|
this.renderer = renderer;
|
|
110
111
|
this.el = el;
|
|
111
|
-
this.magnifyValue = input(1,
|
|
112
|
+
this.magnifyValue = input(1, ...(ngDevMode ? [{ debugName: "magnifyValue" }] : []));
|
|
112
113
|
this.maxDecimalDigits = computed(() => {
|
|
113
114
|
if (!this.magnifyValue() ||
|
|
114
115
|
this.magnifyValue() === 1) {
|
|
@@ -116,7 +117,7 @@ class UpNumberDirective extends UpInputDirective {
|
|
|
116
117
|
}
|
|
117
118
|
const floatPoint = Math.log10(this.magnifyValue());
|
|
118
119
|
return floatPoint % 1 !== 0 ? 0 : floatPoint;
|
|
119
|
-
},
|
|
120
|
+
}, ...(ngDevMode ? [{ debugName: "maxDecimalDigits" }] : []));
|
|
120
121
|
this.lastCaretPos = 0;
|
|
121
122
|
this.lastRawValue = '';
|
|
122
123
|
this.lastKey = null;
|
|
@@ -270,15 +271,15 @@ class UpNumberDirective extends UpInputDirective {
|
|
|
270
271
|
decimal: decimalPart?.slice(0, this.maxDecimalDigits()),
|
|
271
272
|
};
|
|
272
273
|
}
|
|
273
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
274
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.
|
|
274
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpNumberDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
275
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: UpNumberDirective, isStandalone: true, selector: "[upNumber]", inputs: { magnifyValue: { classPropertyName: "magnifyValue", publicName: "magnifyValue", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "blur": "onBlur()", "input": "onInput($event)", "keydown": "onKeyDown($event)" }, properties: { "class": "_computedClass()" } }, providers: [
|
|
275
276
|
{
|
|
276
277
|
provide: UpFieldControl,
|
|
277
278
|
useExisting: forwardRef(() => UpNumberDirective),
|
|
278
279
|
},
|
|
279
280
|
], exportAs: ["upNumber"], usesInheritance: true, ngImport: i0 }); }
|
|
280
281
|
}
|
|
281
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpNumberDirective, decorators: [{
|
|
282
283
|
type: Directive,
|
|
283
284
|
args: [{
|
|
284
285
|
standalone: true,
|
|
@@ -305,161 +306,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImpor
|
|
|
305
306
|
args: ['keydown', ['$event']]
|
|
306
307
|
}] } });
|
|
307
308
|
|
|
308
|
-
class UpCheckboxDirective extends UpFieldControlComponent {
|
|
309
|
-
constructor() {
|
|
310
|
-
super(...arguments);
|
|
311
|
-
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
312
|
-
this._computedClass = computed(() => {
|
|
313
|
-
return up('peer dark:bg-input/30 border-input size-5 min-w-0 rounded-md border bg-transparent shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-border/40 relative cursor-pointer', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none', 'appearance-none checked:border-primary checked:bg-primary', 'checked:after:content-[\'\'] checked:after:absolute checked:after:border-white checked:after:border-b-2 checked:after:border-r-2 checked:after:w-1.5 checked:after:h-2.5 checked:after:rounded-br-xs checked:after:rotate-45 checked:after:left-1.5 checked:after:top-0.75', this.error() ? 'ring-destructive/20 dark:ring-destructive/40 border-destructive focus-visible:ring-destructive/50' : '', this.inlineClass());
|
|
314
|
-
}, { ...(ngDevMode ? { debugName: "_computedClass" } : {}) });
|
|
315
|
-
}
|
|
316
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: UpCheckboxDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
317
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.1", type: UpCheckboxDirective, isStandalone: true, selector: "[upCheckbox]", inputs: { inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "checkbox" }, properties: { "class": "_computedClass()" } }, providers: [
|
|
318
|
-
{
|
|
319
|
-
provide: UpFieldControl,
|
|
320
|
-
useExisting: forwardRef(() => UpCheckboxDirective)
|
|
321
|
-
}
|
|
322
|
-
], exportAs: ["upCheckbox"], usesInheritance: true, ngImport: i0 }); }
|
|
323
|
-
}
|
|
324
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: UpCheckboxDirective, decorators: [{
|
|
325
|
-
type: Directive,
|
|
326
|
-
args: [{
|
|
327
|
-
standalone: true,
|
|
328
|
-
exportAs: 'upCheckbox',
|
|
329
|
-
selector: '[upCheckbox]',
|
|
330
|
-
host: {
|
|
331
|
-
type: 'checkbox',
|
|
332
|
-
'[class]': '_computedClass()',
|
|
333
|
-
},
|
|
334
|
-
providers: [
|
|
335
|
-
{
|
|
336
|
-
provide: UpFieldControl,
|
|
337
|
-
useExisting: forwardRef(() => UpCheckboxDirective)
|
|
338
|
-
}
|
|
339
|
-
]
|
|
340
|
-
}]
|
|
341
|
-
}], propDecorators: { inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
342
|
-
|
|
343
|
-
class UpSwitchComponent extends UpFieldControlComponent {
|
|
344
|
-
constructor() {
|
|
345
|
-
super();
|
|
346
|
-
this.checked = model(false, { ...(ngDevMode ? { debugName: "checked" } : {}) });
|
|
347
|
-
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
348
|
-
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
349
|
-
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
350
|
-
this.isTouched = false;
|
|
351
|
-
this._computedClass = computed(() => {
|
|
352
|
-
return up(`
|
|
353
|
-
relative w-9 h-5 flex items-center justify-start flex-shrink-0 outline outline-input bg-input rounded-full
|
|
354
|
-
transition-colors duration-300 ease-in-out
|
|
355
|
-
peer-checked:bg-primary after:absolute
|
|
356
|
-
after:top-1/2 after:left-[2px] after:-translate-y-1/2
|
|
357
|
-
after:w-4 after:h-4 after:bg-white after:rounded-full after:shadow-md
|
|
358
|
-
after:transition-transform after:duration-300 after:ease-in-out
|
|
359
|
-
peer-checked:after:translate-x-[15px]
|
|
360
|
-
peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-2
|
|
361
|
-
`, this.inlineClass());
|
|
362
|
-
}, { ...(ngDevMode ? { debugName: "_computedClass" } : {}) });
|
|
363
|
-
this._onChange = (_val) => { };
|
|
364
|
-
this._onTouched = () => { };
|
|
365
|
-
if (this.ngControl !== null) {
|
|
366
|
-
this.ngControl.valueAccessor = this;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
writeValue(value) {
|
|
370
|
-
this.checked.set(value);
|
|
371
|
-
}
|
|
372
|
-
registerOnChange(fn) {
|
|
373
|
-
this._onChange = fn;
|
|
374
|
-
}
|
|
375
|
-
registerOnTouched(fn) {
|
|
376
|
-
this._onTouched = fn;
|
|
377
|
-
}
|
|
378
|
-
touch() {
|
|
379
|
-
if (!this.isTouched) {
|
|
380
|
-
this._onTouched();
|
|
381
|
-
this.isTouched = true;
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
toggle() {
|
|
385
|
-
if (this.disabled()) {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
this.checked.set(!this.checked());
|
|
389
|
-
this._onChange(this.checked());
|
|
390
|
-
this._onTouched();
|
|
391
|
-
}
|
|
392
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: UpSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
393
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.1", type: UpSwitchComponent, isStandalone: true, selector: "up-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { classAttribute: "inline-flex items-center cursor-pointer" }, providers: [
|
|
394
|
-
{
|
|
395
|
-
provide: UpFieldControl,
|
|
396
|
-
useExisting: forwardRef(() => UpSwitchComponent),
|
|
397
|
-
}
|
|
398
|
-
], usesInheritance: true, ngImport: i0, template: `
|
|
399
|
-
<input
|
|
400
|
-
type="checkbox"
|
|
401
|
-
class="sr-only peer"
|
|
402
|
-
[checked]="checked()"
|
|
403
|
-
[required]="required()"
|
|
404
|
-
[disabled]="disabled()"
|
|
405
|
-
(blur)="touch()"
|
|
406
|
-
/>
|
|
407
|
-
|
|
408
|
-
<span
|
|
409
|
-
(click)="toggle()"
|
|
410
|
-
[class]="_computedClass()"
|
|
411
|
-
>
|
|
412
|
-
</span>
|
|
413
|
-
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
414
|
-
}
|
|
415
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImport: i0, type: UpSwitchComponent, decorators: [{
|
|
416
|
-
type: Component,
|
|
417
|
-
args: [{
|
|
418
|
-
standalone: true,
|
|
419
|
-
selector: 'up-switch',
|
|
420
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
421
|
-
host: {
|
|
422
|
-
class: 'inline-flex items-center cursor-pointer'
|
|
423
|
-
},
|
|
424
|
-
providers: [
|
|
425
|
-
{
|
|
426
|
-
provide: UpFieldControl,
|
|
427
|
-
useExisting: forwardRef(() => UpSwitchComponent),
|
|
428
|
-
}
|
|
429
|
-
],
|
|
430
|
-
template: `
|
|
431
|
-
<input
|
|
432
|
-
type="checkbox"
|
|
433
|
-
class="sr-only peer"
|
|
434
|
-
[checked]="checked()"
|
|
435
|
-
[required]="required()"
|
|
436
|
-
[disabled]="disabled()"
|
|
437
|
-
(blur)="touch()"
|
|
438
|
-
/>
|
|
439
|
-
|
|
440
|
-
<span
|
|
441
|
-
(click)="toggle()"
|
|
442
|
-
[class]="_computedClass()"
|
|
443
|
-
>
|
|
444
|
-
</span>
|
|
445
|
-
`
|
|
446
|
-
}]
|
|
447
|
-
}], ctorParameters: () => [], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
448
|
-
|
|
449
309
|
class UpPasswordComponent extends UpFieldControlComponent {
|
|
450
310
|
constructor() {
|
|
451
311
|
super();
|
|
452
|
-
this.placeholder = input(
|
|
312
|
+
this.placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : []));
|
|
453
313
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
454
|
-
this.autocomplete = input('off',
|
|
314
|
+
this.autocomplete = input('off', ...(ngDevMode ? [{ debugName: "autocomplete" }] : []));
|
|
455
315
|
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
456
|
-
this.disabled = model(false,
|
|
457
|
-
this.value = signal('',
|
|
458
|
-
this.type = signal('password',
|
|
316
|
+
this.disabled = model(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
317
|
+
this.value = signal('', ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
318
|
+
this.type = signal('password', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
459
319
|
this.isTouched = false;
|
|
460
320
|
this._computedClass = computed(() => {
|
|
461
321
|
return up('pr-10 peer', this.inlineClass());
|
|
462
|
-
},
|
|
322
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
463
323
|
/**
|
|
464
324
|
* Callback function to handle value changes in the password input.
|
|
465
325
|
* @type {(_val: any) => void}
|
|
@@ -536,8 +396,8 @@ class UpPasswordComponent extends UpFieldControlComponent {
|
|
|
536
396
|
this.value.set(value);
|
|
537
397
|
this._onChange(this.value());
|
|
538
398
|
}
|
|
539
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
540
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.
|
|
399
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpPasswordComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
400
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: UpPasswordComponent, isStandalone: true, selector: "up-password", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange" }, host: { classAttribute: "block relative" }, providers: [
|
|
541
401
|
{
|
|
542
402
|
provide: UpFieldControl,
|
|
543
403
|
useExisting: forwardRef(() => UpPasswordComponent)
|
|
@@ -568,7 +428,7 @@ class UpPasswordComponent extends UpFieldControlComponent {
|
|
|
568
428
|
/>
|
|
569
429
|
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: UpInputDirective, selector: "[upInput]", inputs: ["class"], exportAs: ["upInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
570
430
|
}
|
|
571
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpPasswordComponent, decorators: [{
|
|
572
432
|
type: Component,
|
|
573
433
|
args: [{
|
|
574
434
|
standalone: true,
|
|
@@ -615,30 +475,242 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImpor
|
|
|
615
475
|
}]
|
|
616
476
|
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }] } });
|
|
617
477
|
|
|
478
|
+
class UpRadioDirective extends UpFieldControlComponent {
|
|
479
|
+
constructor() {
|
|
480
|
+
super(...arguments);
|
|
481
|
+
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
482
|
+
this._computedClass = computed(() => {
|
|
483
|
+
return up('peer dark:bg-input/30 border-input size-4 min-w-0 rounded-full border bg-transparent shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-border/40 relative cursor-pointer', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none', 'appearance-none checked:border-primary', 'checked:after:content-[\'\'] checked:after:absolute checked:after:bg-primary checked:after:rounded-full checked:after:size-2 checked:after:left-1/2 checked:after:top-1/2 checked:after:-translate-x-1/2 checked:after:-translate-y-1/2', this.error() ? 'ring-destructive/20 dark:ring-destructive/40 border-destructive focus-visible:ring-destructive/50' : '', this.inlineClass());
|
|
484
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
485
|
+
}
|
|
486
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpRadioDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
487
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: UpRadioDirective, isStandalone: true, selector: "[upRadio]", inputs: { inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "radio" }, properties: { "class": "_computedClass()" } }, providers: [
|
|
488
|
+
{
|
|
489
|
+
provide: UpFieldControl,
|
|
490
|
+
useExisting: forwardRef(() => UpRadioDirective)
|
|
491
|
+
}
|
|
492
|
+
], exportAs: ["upRadio"], usesInheritance: true, ngImport: i0 }); }
|
|
493
|
+
}
|
|
494
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpRadioDirective, decorators: [{
|
|
495
|
+
type: Directive,
|
|
496
|
+
args: [{
|
|
497
|
+
exportAs: 'upRadio',
|
|
498
|
+
selector: '[upRadio]',
|
|
499
|
+
host: {
|
|
500
|
+
type: 'radio',
|
|
501
|
+
'[class]': '_computedClass()',
|
|
502
|
+
},
|
|
503
|
+
providers: [
|
|
504
|
+
{
|
|
505
|
+
provide: UpFieldControl,
|
|
506
|
+
useExisting: forwardRef(() => UpRadioDirective)
|
|
507
|
+
}
|
|
508
|
+
]
|
|
509
|
+
}]
|
|
510
|
+
}], propDecorators: { inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
511
|
+
|
|
512
|
+
class UpSwitchComponent extends UpFieldControlComponent {
|
|
513
|
+
constructor() {
|
|
514
|
+
super();
|
|
515
|
+
this.checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
516
|
+
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
517
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
518
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
519
|
+
this.isTouched = false;
|
|
520
|
+
this._computedClass = computed(() => {
|
|
521
|
+
return up(`
|
|
522
|
+
relative w-9 h-5 flex items-center justify-start flex-shrink-0 outline outline-input bg-input rounded-full
|
|
523
|
+
transition-colors duration-300 ease-in-out
|
|
524
|
+
peer-checked:bg-primary after:absolute
|
|
525
|
+
after:top-1/2 after:left-[2px] after:-translate-y-1/2
|
|
526
|
+
after:w-4 after:h-4 after:bg-white after:rounded-full after:shadow-md
|
|
527
|
+
after:transition-transform after:duration-300 after:ease-in-out
|
|
528
|
+
peer-checked:after:translate-x-[15px]
|
|
529
|
+
peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-2
|
|
530
|
+
`, this.inlineClass());
|
|
531
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
532
|
+
this._onChange = (_val) => { };
|
|
533
|
+
this._onTouched = () => { };
|
|
534
|
+
if (this.ngControl !== null) {
|
|
535
|
+
this.ngControl.valueAccessor = this;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
writeValue(value) {
|
|
539
|
+
this.checked.set(value);
|
|
540
|
+
}
|
|
541
|
+
registerOnChange(fn) {
|
|
542
|
+
this._onChange = fn;
|
|
543
|
+
}
|
|
544
|
+
registerOnTouched(fn) {
|
|
545
|
+
this._onTouched = fn;
|
|
546
|
+
}
|
|
547
|
+
touch() {
|
|
548
|
+
if (!this.isTouched) {
|
|
549
|
+
this._onTouched();
|
|
550
|
+
this.isTouched = true;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
toggle() {
|
|
554
|
+
if (this.disabled()) {
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
this.checked.set(!this.checked());
|
|
558
|
+
this._onChange(this.checked());
|
|
559
|
+
this._onTouched();
|
|
560
|
+
}
|
|
561
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
562
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: UpSwitchComponent, isStandalone: true, selector: "up-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { classAttribute: "inline-flex items-center cursor-pointer" }, providers: [
|
|
563
|
+
{
|
|
564
|
+
provide: UpFieldControl,
|
|
565
|
+
useExisting: forwardRef(() => UpSwitchComponent),
|
|
566
|
+
}
|
|
567
|
+
], usesInheritance: true, ngImport: i0, template: `
|
|
568
|
+
<input
|
|
569
|
+
type="checkbox"
|
|
570
|
+
class="sr-only peer"
|
|
571
|
+
[checked]="checked()"
|
|
572
|
+
[required]="required()"
|
|
573
|
+
[disabled]="disabled()"
|
|
574
|
+
(blur)="touch()"
|
|
575
|
+
/>
|
|
576
|
+
|
|
577
|
+
<span
|
|
578
|
+
(click)="toggle()"
|
|
579
|
+
[class]="_computedClass()"
|
|
580
|
+
>
|
|
581
|
+
</span>
|
|
582
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
583
|
+
}
|
|
584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpSwitchComponent, decorators: [{
|
|
585
|
+
type: Component,
|
|
586
|
+
args: [{
|
|
587
|
+
standalone: true,
|
|
588
|
+
selector: 'up-switch',
|
|
589
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
590
|
+
host: {
|
|
591
|
+
class: 'inline-flex items-center cursor-pointer'
|
|
592
|
+
},
|
|
593
|
+
providers: [
|
|
594
|
+
{
|
|
595
|
+
provide: UpFieldControl,
|
|
596
|
+
useExisting: forwardRef(() => UpSwitchComponent),
|
|
597
|
+
}
|
|
598
|
+
],
|
|
599
|
+
template: `
|
|
600
|
+
<input
|
|
601
|
+
type="checkbox"
|
|
602
|
+
class="sr-only peer"
|
|
603
|
+
[checked]="checked()"
|
|
604
|
+
[required]="required()"
|
|
605
|
+
[disabled]="disabled()"
|
|
606
|
+
(blur)="touch()"
|
|
607
|
+
/>
|
|
608
|
+
|
|
609
|
+
<span
|
|
610
|
+
(click)="toggle()"
|
|
611
|
+
[class]="_computedClass()"
|
|
612
|
+
>
|
|
613
|
+
</span>
|
|
614
|
+
`
|
|
615
|
+
}]
|
|
616
|
+
}], ctorParameters: () => [], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
617
|
+
|
|
618
|
+
class UpCheckboxDirective extends UpFieldControlComponent {
|
|
619
|
+
constructor() {
|
|
620
|
+
super(...arguments);
|
|
621
|
+
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
622
|
+
this._computedClass = computed(() => {
|
|
623
|
+
return up('peer dark:bg-input/30 border-input size-5 min-w-0 rounded-md border bg-transparent shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-border/40 relative cursor-pointer', 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none', 'appearance-none checked:border-primary checked:bg-primary', 'checked:after:content-[\'\'] checked:after:absolute checked:after:border-white checked:after:border-b-2 checked:after:border-r-2 checked:after:w-1.5 checked:after:h-2.5 checked:after:rounded-br-xs checked:after:rotate-45 checked:after:left-1.5 checked:after:top-0.75', this.error() ? 'ring-destructive/20 dark:ring-destructive/40 border-destructive focus-visible:ring-destructive/50' : '', this.inlineClass());
|
|
624
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
625
|
+
}
|
|
626
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpCheckboxDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
627
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: UpCheckboxDirective, isStandalone: true, selector: "[upCheckbox]", inputs: { inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "checkbox" }, properties: { "class": "_computedClass()" } }, providers: [
|
|
628
|
+
{
|
|
629
|
+
provide: UpFieldControl,
|
|
630
|
+
useExisting: forwardRef(() => UpCheckboxDirective)
|
|
631
|
+
}
|
|
632
|
+
], exportAs: ["upCheckbox"], usesInheritance: true, ngImport: i0 }); }
|
|
633
|
+
}
|
|
634
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpCheckboxDirective, decorators: [{
|
|
635
|
+
type: Directive,
|
|
636
|
+
args: [{
|
|
637
|
+
standalone: true,
|
|
638
|
+
exportAs: 'upCheckbox',
|
|
639
|
+
selector: '[upCheckbox]',
|
|
640
|
+
host: {
|
|
641
|
+
type: 'checkbox',
|
|
642
|
+
'[class]': '_computedClass()',
|
|
643
|
+
},
|
|
644
|
+
providers: [
|
|
645
|
+
{
|
|
646
|
+
provide: UpFieldControl,
|
|
647
|
+
useExisting: forwardRef(() => UpCheckboxDirective)
|
|
648
|
+
}
|
|
649
|
+
]
|
|
650
|
+
}]
|
|
651
|
+
}], propDecorators: { inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
652
|
+
|
|
653
|
+
class UpOptionComponent {
|
|
654
|
+
constructor(elementRef) {
|
|
655
|
+
this.elementRef = elementRef;
|
|
656
|
+
this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
657
|
+
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
658
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
659
|
+
}
|
|
660
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpOptionComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
661
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: UpOptionComponent, isStandalone: true, selector: "up-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
662
|
+
<ng-content />
|
|
663
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
664
|
+
}
|
|
665
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpOptionComponent, decorators: [{
|
|
666
|
+
type: Component,
|
|
667
|
+
args: [{
|
|
668
|
+
standalone: true,
|
|
669
|
+
selector: 'up-option',
|
|
670
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
671
|
+
template: `
|
|
672
|
+
<ng-content />
|
|
673
|
+
`,
|
|
674
|
+
}]
|
|
675
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
676
|
+
|
|
618
677
|
class UpSelectComponent extends UpFieldControlComponent {
|
|
619
678
|
constructor() {
|
|
620
679
|
super();
|
|
621
|
-
this.
|
|
622
|
-
this.label = input('',
|
|
623
|
-
this.
|
|
624
|
-
this.
|
|
625
|
-
this.
|
|
626
|
-
this.
|
|
627
|
-
this.value = model(null, { ...(ngDevMode ? { debugName: "value" } : {}) });
|
|
680
|
+
this.options = contentChildren(UpOptionComponent, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
681
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
682
|
+
this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
683
|
+
this.bindLabel = input('label', ...(ngDevMode ? [{ debugName: "bindLabel" }] : []));
|
|
684
|
+
this.bindValue = input('value', ...(ngDevMode ? [{ debugName: "bindValue" }] : []));
|
|
685
|
+
this.appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
628
686
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
629
|
-
this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}) });
|
|
630
|
-
this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}) });
|
|
631
|
-
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}) });
|
|
632
|
-
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}) });
|
|
633
|
-
this.clearable = input(true, { ...(ngDevMode ? { debugName: "clearable" } : {}) });
|
|
687
|
+
this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: booleanAttribute });
|
|
688
|
+
this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
689
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
690
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
691
|
+
this.clearable = input(true, { ...(ngDevMode ? { debugName: "clearable" } : {}), transform: booleanAttribute });
|
|
634
692
|
this.addTag = input(false, { ...(ngDevMode ? { debugName: "addTag" } : {}), transform: booleanAttribute });
|
|
635
693
|
this.searchable = input(false, { ...(ngDevMode ? { debugName: "searchable" } : {}), transform: booleanAttribute });
|
|
636
694
|
this.virtualScroll = input(false, { ...(ngDevMode ? { debugName: "virtualScroll" } : {}), transform: booleanAttribute });
|
|
695
|
+
this.items = input(...(ngDevMode ? [undefined, { debugName: "items" }] : []));
|
|
696
|
+
this._items = computed(() => {
|
|
697
|
+
if (this.items()?.length) {
|
|
698
|
+
return this.items() ?? [];
|
|
699
|
+
}
|
|
700
|
+
return this.options().map((option) => {
|
|
701
|
+
return {
|
|
702
|
+
disabled: option.disabled(),
|
|
703
|
+
[this.bindValue()]: option.value(),
|
|
704
|
+
[this.bindLabel()]: option.label() || option.elementRef.nativeElement.textContent.trim(),
|
|
705
|
+
};
|
|
706
|
+
});
|
|
707
|
+
}, ...(ngDevMode ? [{ debugName: "_items" }] : []));
|
|
708
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
637
709
|
this.changed = output();
|
|
638
|
-
this.control = contentChild(UpFieldControl,
|
|
710
|
+
this.control = contentChild(UpFieldControl, ...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
639
711
|
this._computedClass = computed(() => {
|
|
640
712
|
return up('w-full min-w-0 h-9', 'data-[disabled=true]:[&>.ng-select-container]:cursor-not-allowed! data-[disabled=true]:[&>.ng-select-container]:opacity-50! data-[disabled=true]:[&>.ng-select-container]:bg-transparent!', '[&>.ng-select-container]:border! [&>.ng-select-container]:border-input! [&>.ng-select-container]:rounded-md! [&>.ng-select-container]:cursor-pointer! [&>.ng-select-container]:shadow-xs! [&>.ng-select-container]:items-center!', '[&>.ng-select-container>.ng-value-container>.ng-placeholder]:text-base! md:[&>.ng-select-container>.ng-value-container>.ng-placeholder]:text-sm!', '[&>.ng-select-container>.ng-value-container>.ng-value]:text-base! md:[&>.ng-select-container>.ng-value-container>.ng-value]:text-sm! [&>.ng-select-container>.ng-value-container>.ng-value]:text-black!', '[&.ng-select-focused>.ng-select-container]:border-ring! [&.ng-select-focused>.ng-select-container]:ring-ring/50! [&.ng-select-focused>.ng-select-container]:ring-[3px]!', this.inlineClass());
|
|
641
|
-
},
|
|
713
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
642
714
|
this.isTouched = false;
|
|
643
715
|
this._onTouched = () => { };
|
|
644
716
|
this._onChange = (_val) => { };
|
|
@@ -701,15 +773,15 @@ class UpSelectComponent extends UpFieldControlComponent {
|
|
|
701
773
|
this.changed.emit(this.value());
|
|
702
774
|
}
|
|
703
775
|
}
|
|
704
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
705
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.
|
|
776
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
777
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: UpSelectComponent, isStandalone: true, selector: "up-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, addTag: { classPropertyName: "addTag", publicName: "addTag", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", changed: "changed" }, host: { classAttribute: "block relative" }, providers: [
|
|
706
778
|
{
|
|
707
779
|
provide: UpFieldControl,
|
|
708
780
|
useExisting: forwardRef(() => UpSelectComponent)
|
|
709
781
|
}
|
|
710
|
-
], queries: [{ propertyName: "control", first: true, predicate: UpFieldControl, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
782
|
+
], queries: [{ propertyName: "options", predicate: UpOptionComponent, isSignal: true }, { propertyName: "control", first: true, predicate: UpFieldControl, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
711
783
|
<ng-select
|
|
712
|
-
[items]="
|
|
784
|
+
[items]="_items()"
|
|
713
785
|
[ngModel]="value()"
|
|
714
786
|
[addTag]="addTag()"
|
|
715
787
|
[loading]="loading()"
|
|
@@ -724,12 +796,13 @@ class UpSelectComponent extends UpFieldControlComponent {
|
|
|
724
796
|
[placeholder]="placeholder()"
|
|
725
797
|
[virtualScroll]="virtualScroll()"
|
|
726
798
|
[attr.data-disabled]="disabled()"
|
|
799
|
+
[ngModelOptions]="{ standalone: true }"
|
|
727
800
|
(blur)="touch()"
|
|
728
801
|
(ngModelChange)="change($event)"
|
|
729
802
|
/>
|
|
730
803
|
`, isInline: true, styles: [".ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{background-color:var(--accent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right-color:color-mix(in oklab,var(--primary) 50%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left:hover{background-color:color-mix(in oklab,var(--primary) 40%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{top:50%!important;padding-bottom:0!important;transform:translateY(-50%)!important}.ng-select .ng-select-container{transition:all .2s ease}.ng-select .ng-select-container .ng-value-container{align-items:center;padding-left:.75rem}.ng-select .ng-select-container .ng-value-container .ng-placeholder{color:var(--muted-foreground)}.ng-select .ng-select-container .ng-arrow-wrapper{padding-right:.75rem}.ng-select .ng-select-container .ng-clear-wrapper{margin-right:.25rem;transition:color .2s ease}.ng-select .ng-select-container .ng-clear-wrapper:hover .ng-clear{color:var(--destructive)}.ng-dropdown-panel{overflow:hidden;margin-top:.25rem!important;border-color:var(--border)!important;border-radius:calc(var(--radius) - 2px)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.ng-dropdown-panel .ng-option-label{color:#000;font-size:1rem}@media screen and (min-width:48rem){.ng-dropdown-panel .ng-option-label{font-size:.875rem}}.ng-dropdown-panel .ng-option:hover,.ng-dropdown-panel .ng-option-marked{background-color:var(--accent)!important}.ng-dropdown-panel .ng-option-selected{color:#000!important;background-color:color-mix(in oklab,var(--primary) 15%,transparent)!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "dropdownPosition", "appendTo", "outsideClickEvent", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "tabFocusOnClearButton", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "deselectOnClick", "clearSearchOnAdd", "compareWith", "keyDownFn", "bindLabel", "bindValue", "appearance", "isOpen", "items"], outputs: ["bindLabelChange", "bindValueChange", "appearanceChange", "isOpenChange", "itemsChange", "blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"], exportAs: ["ngSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
731
804
|
}
|
|
732
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpSelectComponent, decorators: [{
|
|
733
806
|
type: Component,
|
|
734
807
|
args: [{ standalone: true, selector: 'up-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
735
808
|
class: 'block relative',
|
|
@@ -743,7 +816,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImpor
|
|
|
743
816
|
}
|
|
744
817
|
], template: `
|
|
745
818
|
<ng-select
|
|
746
|
-
[items]="
|
|
819
|
+
[items]="_items()"
|
|
747
820
|
[ngModel]="value()"
|
|
748
821
|
[addTag]="addTag()"
|
|
749
822
|
[loading]="loading()"
|
|
@@ -758,26 +831,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImpor
|
|
|
758
831
|
[placeholder]="placeholder()"
|
|
759
832
|
[virtualScroll]="virtualScroll()"
|
|
760
833
|
[attr.data-disabled]="disabled()"
|
|
834
|
+
[ngModelOptions]="{ standalone: true }"
|
|
761
835
|
(blur)="touch()"
|
|
762
836
|
(ngModelChange)="change($event)"
|
|
763
837
|
/>
|
|
764
838
|
`, styles: [".ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{background-color:var(--accent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right-color:color-mix(in oklab,var(--primary) 50%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left:hover{background-color:color-mix(in oklab,var(--primary) 40%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{top:50%!important;padding-bottom:0!important;transform:translateY(-50%)!important}.ng-select .ng-select-container{transition:all .2s ease}.ng-select .ng-select-container .ng-value-container{align-items:center;padding-left:.75rem}.ng-select .ng-select-container .ng-value-container .ng-placeholder{color:var(--muted-foreground)}.ng-select .ng-select-container .ng-arrow-wrapper{padding-right:.75rem}.ng-select .ng-select-container .ng-clear-wrapper{margin-right:.25rem;transition:color .2s ease}.ng-select .ng-select-container .ng-clear-wrapper:hover .ng-clear{color:var(--destructive)}.ng-dropdown-panel{overflow:hidden;margin-top:.25rem!important;border-color:var(--border)!important;border-radius:calc(var(--radius) - 2px)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.ng-dropdown-panel .ng-option-label{color:#000;font-size:1rem}@media screen and (min-width:48rem){.ng-dropdown-panel .ng-option-label{font-size:.875rem}}.ng-dropdown-panel .ng-option:hover,.ng-dropdown-panel .ng-option-marked{background-color:var(--accent)!important}.ng-dropdown-panel .ng-option-selected{color:#000!important;background-color:color-mix(in oklab,var(--primary) 15%,transparent)!important}\n"] }]
|
|
765
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
839
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => UpOptionComponent), { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], bindLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindLabel", required: false }] }], bindValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindValue", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], addTag: [{ type: i0.Input, args: [{ isSignal: true, alias: "addTag", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], changed: [{ type: i0.Output, args: ["changed"] }], control: [{ type: i0.ContentChild, args: [i0.forwardRef(() => UpFieldControl), { isSignal: true }] }] } });
|
|
766
840
|
|
|
767
841
|
class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
768
842
|
constructor(service) {
|
|
769
843
|
super();
|
|
770
844
|
this.service = service;
|
|
771
|
-
this.multiple = input(false,
|
|
772
|
-
this.clearable = input(true,
|
|
773
|
-
this.placeholder = input('Select country',
|
|
845
|
+
this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
846
|
+
this.clearable = input(true, ...(ngDevMode ? [{ debugName: "clearable" }] : []));
|
|
847
|
+
this.placeholder = input('Select country', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
774
848
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
775
849
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
776
|
-
this.value = model(null,
|
|
850
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
777
851
|
this.changed = output();
|
|
778
|
-
this.countries = signal([],
|
|
779
|
-
this.isLoading = signal(true,
|
|
780
|
-
this._disabled = signal(false,
|
|
852
|
+
this.countries = signal([], ...(ngDevMode ? [{ debugName: "countries" }] : []));
|
|
853
|
+
this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
854
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
781
855
|
this.isTouched = false;
|
|
782
856
|
this._onTouched = () => { };
|
|
783
857
|
this._onChange = (_val) => { };
|
|
@@ -829,8 +903,8 @@ class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
|
829
903
|
this.changed.emit(this.countries().find(c => c.code === value));
|
|
830
904
|
}
|
|
831
905
|
}
|
|
832
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
833
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.
|
|
906
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpCountrySelectComponent, deps: [{ token: i1$1.CountryService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
907
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: UpCountrySelectComponent, isStandalone: true, selector: "up-country-select", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", changed: "changed" }, host: { classAttribute: "block" }, providers: [
|
|
834
908
|
{
|
|
835
909
|
provide: UpFieldControl,
|
|
836
910
|
useExisting: forwardRef(() => UpCountrySelectComponent),
|
|
@@ -853,9 +927,9 @@ class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
|
853
927
|
(blur)="onTouched()"
|
|
854
928
|
(changed)="change($event)"
|
|
855
929
|
/>
|
|
856
|
-
`, isInline: true, dependencies: [{ kind: "component", type: UpSelectComponent, selector: "up-select", inputs: ["
|
|
930
|
+
`, isInline: true, dependencies: [{ kind: "component", type: UpSelectComponent, selector: "up-select", inputs: ["label", "placeholder", "bindLabel", "bindValue", "appendTo", "class", "loading", "multiple", "required", "disabled", "clearable", "addTag", "searchable", "virtualScroll", "items", "value"], outputs: ["valueChange", "changed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
857
931
|
}
|
|
858
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
932
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpCountrySelectComponent, decorators: [{
|
|
859
933
|
type: Component,
|
|
860
934
|
args: [{
|
|
861
935
|
standalone: true,
|
|
@@ -899,16 +973,16 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
899
973
|
constructor(service) {
|
|
900
974
|
super();
|
|
901
975
|
this.service = service;
|
|
902
|
-
this.multiple = input(false,
|
|
903
|
-
this.clearable = input(true,
|
|
904
|
-
this.placeholder = input('Select currency',
|
|
976
|
+
this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
977
|
+
this.clearable = input(true, ...(ngDevMode ? [{ debugName: "clearable" }] : []));
|
|
978
|
+
this.placeholder = input('Select currency', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
905
979
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
906
980
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
907
|
-
this.value = model(null,
|
|
981
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
908
982
|
this.changed = output();
|
|
909
|
-
this.isLoading = signal(true,
|
|
910
|
-
this._disabled = signal(false,
|
|
911
|
-
this.currencies = signal([],
|
|
983
|
+
this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
984
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
985
|
+
this.currencies = signal([], ...(ngDevMode ? [{ debugName: "currencies" }] : []));
|
|
912
986
|
this.isTouched = false;
|
|
913
987
|
this._onTouched = () => { };
|
|
914
988
|
this._onChange = (_val) => { };
|
|
@@ -967,8 +1041,8 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
967
1041
|
this.changed.emit(this.currencies().find(c => c.code === value));
|
|
968
1042
|
}
|
|
969
1043
|
}
|
|
970
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
971
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.
|
|
1044
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpCurrencySelectComponent, deps: [{ token: i1$1.CurrencyService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1045
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: UpCurrencySelectComponent, isStandalone: true, selector: "up-currency-select", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", changed: "changed" }, host: { classAttribute: "block" }, providers: [
|
|
972
1046
|
{
|
|
973
1047
|
provide: UpFieldControl,
|
|
974
1048
|
useExisting: forwardRef(() => UpCurrencySelectComponent)
|
|
@@ -991,9 +1065,9 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
991
1065
|
(blur)="onTouched()"
|
|
992
1066
|
(changed)="change($event)"
|
|
993
1067
|
/>
|
|
994
|
-
`, isInline: true, dependencies: [{ kind: "component", type: UpSelectComponent, selector: "up-select", inputs: ["
|
|
1068
|
+
`, isInline: true, dependencies: [{ kind: "component", type: UpSelectComponent, selector: "up-select", inputs: ["label", "placeholder", "bindLabel", "bindValue", "appendTo", "class", "loading", "multiple", "required", "disabled", "clearable", "addTag", "searchable", "virtualScroll", "items", "value"], outputs: ["valueChange", "changed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
995
1069
|
}
|
|
996
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1070
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpCurrencySelectComponent, decorators: [{
|
|
997
1071
|
type: Component,
|
|
998
1072
|
args: [{
|
|
999
1073
|
standalone: true,
|
|
@@ -1036,13 +1110,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImpor
|
|
|
1036
1110
|
class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
1037
1111
|
constructor() {
|
|
1038
1112
|
super();
|
|
1039
|
-
this.query = input.required(
|
|
1040
|
-
this.label = input('',
|
|
1041
|
-
this.
|
|
1042
|
-
this.
|
|
1043
|
-
this.
|
|
1044
|
-
this.
|
|
1045
|
-
this.
|
|
1113
|
+
this.query = input.required(...(ngDevMode ? [{ debugName: "query" }] : []));
|
|
1114
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1115
|
+
this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1116
|
+
this.initialItems = input([], ...(ngDevMode ? [{ debugName: "initialItems" }] : []));
|
|
1117
|
+
this.bindLabel = input('label', ...(ngDevMode ? [{ debugName: "bindLabel" }] : []));
|
|
1118
|
+
this.bindValue = input('value', ...(ngDevMode ? [{ debugName: "bindValue" }] : []));
|
|
1119
|
+
this.appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
1046
1120
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
1047
1121
|
this.addTag = input(false, { ...(ngDevMode ? { debugName: "addTag" } : {}), transform: booleanAttribute });
|
|
1048
1122
|
this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
@@ -1050,17 +1124,17 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1050
1124
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
1051
1125
|
this.clearable = input(true, { ...(ngDevMode ? { debugName: "clearable" } : {}), transform: booleanAttribute });
|
|
1052
1126
|
this.virtualScroll = input(false, { ...(ngDevMode ? { debugName: "virtualScroll" } : {}), transform: booleanAttribute });
|
|
1053
|
-
this.loading = model(false,
|
|
1054
|
-
this.value = model(null,
|
|
1127
|
+
this.loading = model(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
1128
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1055
1129
|
this.changed = output();
|
|
1056
|
-
this.control = contentChild(UpFieldControl,
|
|
1130
|
+
this.control = contentChild(UpFieldControl, ...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
1057
1131
|
this._computedClass = computed(() => {
|
|
1058
1132
|
return up('w-full min-w-0 h-9', 'data-[disabled=true]:[&>.ng-select-container]:cursor-not-allowed! data-[disabled=true]:[&>.ng-select-container]:opacity-50! data-[disabled=true]:[&>.ng-select-container]:bg-transparent!', '[&>.ng-select-container]:border! [&>.ng-select-container]:border-input! [&>.ng-select-container]:rounded-md! [&>.ng-select-container]:cursor-pointer! [&>.ng-select-container]:shadow-xs! [&>.ng-select-container]:items-center!', '[&>.ng-select-container>.ng-value-container>.ng-placeholder]:text-base! md:[&>.ng-select-container>.ng-value-container>.ng-placeholder]:text-sm!', '[&>.ng-select-container>.ng-value-container>.ng-value]:text-base! md:[&>.ng-select-container>.ng-value-container>.ng-value]:text-sm! [&>.ng-select-container>.ng-value-container>.ng-value]:text-black!', '[&.ng-select-focused>.ng-select-container]:border-ring! [&.ng-select-focused>.ng-select-container]:ring-ring/50! [&.ng-select-focused>.ng-select-container]:ring-[3px]!', this.inlineClass());
|
|
1059
|
-
},
|
|
1133
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
1060
1134
|
this.items = computed(() => {
|
|
1061
1135
|
const results = this._queryResults();
|
|
1062
1136
|
return results.length > 0 ? results : this.initialItems();
|
|
1063
|
-
},
|
|
1137
|
+
}, ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
1064
1138
|
this.typeahead = new Subject();
|
|
1065
1139
|
this.query$ = this.typeahead.pipe(distinctUntilChanged(), debounceTime(300), tap(() => this.loading.set(true)), switchMap((k) => {
|
|
1066
1140
|
return this.query()(k).pipe(map((result) => !result.length ? this.initialItems() : result), catchError(() => of(this.initialItems())));
|
|
@@ -1107,8 +1181,8 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1107
1181
|
this.changed.emit(this.value());
|
|
1108
1182
|
}
|
|
1109
1183
|
}
|
|
1110
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1111
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.
|
|
1184
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpSearchableSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1185
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: UpSearchableSelectComponent, isStandalone: true, selector: "up-searchable-select", inputs: { query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, initialItems: { classPropertyName: "initialItems", publicName: "initialItems", isSignal: true, isRequired: false, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, addTag: { classPropertyName: "addTag", publicName: "addTag", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loading: "loadingChange", value: "valueChange", changed: "changed" }, host: { classAttribute: "block relative" }, providers: [
|
|
1112
1186
|
{
|
|
1113
1187
|
provide: UpFieldControl,
|
|
1114
1188
|
useExisting: forwardRef(() => UpSearchableSelectComponent)
|
|
@@ -1119,6 +1193,7 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1119
1193
|
[minTermLength]="3"
|
|
1120
1194
|
[virtualScroll]="true"
|
|
1121
1195
|
[editableSearchTerm]="true"
|
|
1196
|
+
[ngModelOptions]="{ standalone: true }"
|
|
1122
1197
|
|
|
1123
1198
|
[typeahead]="typeahead"
|
|
1124
1199
|
|
|
@@ -1142,7 +1217,7 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1142
1217
|
/>
|
|
1143
1218
|
`, isInline: true, styles: [".ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{background-color:var(--accent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right-color:color-mix(in oklab,var(--primary) 50%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left:hover{background-color:color-mix(in oklab,var(--primary) 40%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{top:50%!important;padding-bottom:0!important;transform:translateY(-50%)!important}.ng-select .ng-select-container{transition:all .2s ease}.ng-select .ng-select-container .ng-value-container{align-items:center;padding-left:.75rem}.ng-select .ng-select-container .ng-value-container .ng-placeholder{color:var(--muted-foreground)}.ng-select .ng-select-container .ng-arrow-wrapper{padding-right:.75rem}.ng-select .ng-select-container .ng-clear-wrapper{margin-right:.25rem;transition:color .2s ease}.ng-select .ng-select-container .ng-clear-wrapper:hover .ng-clear{color:var(--destructive)}.ng-dropdown-panel{overflow:hidden;margin-top:.25rem!important;border-color:var(--border)!important;border-radius:calc(var(--radius) - 2px)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.ng-dropdown-panel .ng-option-label{color:#000;font-size:1rem}@media screen and (min-width:48rem){.ng-dropdown-panel .ng-option-label{font-size:.875rem}}.ng-dropdown-panel .ng-option:hover,.ng-dropdown-panel .ng-option-marked{background-color:var(--accent)!important}.ng-dropdown-panel .ng-option-selected{color:#000!important;background-color:color-mix(in oklab,var(--primary) 15%,transparent)!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "dropdownPosition", "appendTo", "outsideClickEvent", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "tabFocusOnClearButton", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "deselectOnClick", "clearSearchOnAdd", "compareWith", "keyDownFn", "bindLabel", "bindValue", "appearance", "isOpen", "items"], outputs: ["bindLabelChange", "bindValueChange", "appearanceChange", "isOpenChange", "itemsChange", "blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"], exportAs: ["ngSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1144
1219
|
}
|
|
1145
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpSearchableSelectComponent, decorators: [{
|
|
1146
1221
|
type: Component,
|
|
1147
1222
|
args: [{ standalone: true, selector: 'up-searchable-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1148
1223
|
class: 'block relative',
|
|
@@ -1160,6 +1235,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImpor
|
|
|
1160
1235
|
[minTermLength]="3"
|
|
1161
1236
|
[virtualScroll]="true"
|
|
1162
1237
|
[editableSearchTerm]="true"
|
|
1238
|
+
[ngModelOptions]="{ standalone: true }"
|
|
1163
1239
|
|
|
1164
1240
|
[typeahead]="typeahead"
|
|
1165
1241
|
|
|
@@ -1182,26 +1258,167 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImpor
|
|
|
1182
1258
|
(change)="change($event)"
|
|
1183
1259
|
/>
|
|
1184
1260
|
`, styles: [".ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{background-color:var(--accent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left{border-right-color:color-mix(in oklab,var(--primary) 50%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon.left:hover{background-color:color-mix(in oklab,var(--primary) 40%,transparent)!important}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{top:50%!important;padding-bottom:0!important;transform:translateY(-50%)!important}.ng-select .ng-select-container{transition:all .2s ease}.ng-select .ng-select-container .ng-value-container{align-items:center;padding-left:.75rem}.ng-select .ng-select-container .ng-value-container .ng-placeholder{color:var(--muted-foreground)}.ng-select .ng-select-container .ng-arrow-wrapper{padding-right:.75rem}.ng-select .ng-select-container .ng-clear-wrapper{margin-right:.25rem;transition:color .2s ease}.ng-select .ng-select-container .ng-clear-wrapper:hover .ng-clear{color:var(--destructive)}.ng-dropdown-panel{overflow:hidden;margin-top:.25rem!important;border-color:var(--border)!important;border-radius:calc(var(--radius) - 2px)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.ng-dropdown-panel .ng-option-label{color:#000;font-size:1rem}@media screen and (min-width:48rem){.ng-dropdown-panel .ng-option-label{font-size:.875rem}}.ng-dropdown-panel .ng-option:hover,.ng-dropdown-panel .ng-option-marked{background-color:var(--accent)!important}.ng-dropdown-panel .ng-option-selected{color:#000!important;background-color:color-mix(in oklab,var(--primary) 15%,transparent)!important}\n"] }]
|
|
1185
|
-
}], ctorParameters: () => [], propDecorators: { query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }],
|
|
1261
|
+
}], ctorParameters: () => [], propDecorators: { query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], initialItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialItems", required: false }] }], bindLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindLabel", required: false }] }], bindValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindValue", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], addTag: [{ type: i0.Input, args: [{ isSignal: true, alias: "addTag", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }, { type: i0.Output, args: ["loadingChange"] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], changed: [{ type: i0.Output, args: ["changed"] }], control: [{ type: i0.ContentChild, args: [i0.forwardRef(() => UpFieldControl), { isSignal: true }] }] } });
|
|
1262
|
+
|
|
1263
|
+
class UpRateGroupCodeSelectComponent extends UpFieldControlComponent {
|
|
1264
|
+
constructor(service) {
|
|
1265
|
+
super();
|
|
1266
|
+
this.service = service;
|
|
1267
|
+
this.placeholder = input('Select rate group code', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1268
|
+
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
1269
|
+
this.appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
1270
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
1271
|
+
this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
1272
|
+
this.clearable = input(true, { ...(ngDevMode ? { debugName: "clearable" } : {}), transform: booleanAttribute });
|
|
1273
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1274
|
+
this.changed = output();
|
|
1275
|
+
this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
1276
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1277
|
+
this.rateGroupCodes = signal([], ...(ngDevMode ? [{ debugName: "rateGroupCodes" }] : []));
|
|
1278
|
+
this.queryFn = (keyword) => {
|
|
1279
|
+
if (!keyword ||
|
|
1280
|
+
keyword.length < 3) {
|
|
1281
|
+
return of(this.rateGroupCodes().filter(({ code }) => code.toLowerCase().includes(keyword.toLowerCase())));
|
|
1282
|
+
}
|
|
1283
|
+
return this.service.query({ key: keyword }).pipe(map(({ data: { productMsSearchRateGroupCodes: { data } } }) => {
|
|
1284
|
+
return data.map((code) => ({ code, name: code }));
|
|
1285
|
+
}), catchError(() => of([])));
|
|
1286
|
+
};
|
|
1287
|
+
this.isTouched = false;
|
|
1288
|
+
this._onTouched = () => { };
|
|
1289
|
+
this._onChange = (_val) => { };
|
|
1290
|
+
if (this.ngControl) {
|
|
1291
|
+
this.ngControl.valueAccessor = this;
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
ngOnInit() {
|
|
1295
|
+
this.sub = this.service.query().subscribe({
|
|
1296
|
+
error: () => {
|
|
1297
|
+
this.rateGroupCodes.set([]);
|
|
1298
|
+
this.isLoading.set(false);
|
|
1299
|
+
},
|
|
1300
|
+
next: ({ data: { productMsSearchRateGroupCodes: { data } } }) => {
|
|
1301
|
+
this.rateGroupCodes.set(data.map((code) => ({ code, name: code })));
|
|
1302
|
+
this.isLoading.set(false);
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
ngOnDestroy() {
|
|
1307
|
+
this.sub?.unsubscribe();
|
|
1308
|
+
}
|
|
1309
|
+
registerOnChange(fn) {
|
|
1310
|
+
this._onChange = fn;
|
|
1311
|
+
}
|
|
1312
|
+
registerOnTouched(fn) {
|
|
1313
|
+
this._onTouched = fn;
|
|
1314
|
+
}
|
|
1315
|
+
setDisabledState(isDisabled) {
|
|
1316
|
+
this._disabled.set(isDisabled);
|
|
1317
|
+
}
|
|
1318
|
+
writeValue(value) {
|
|
1319
|
+
this.value.set(value);
|
|
1320
|
+
}
|
|
1321
|
+
onTouched() {
|
|
1322
|
+
if (!this.isTouched) {
|
|
1323
|
+
this._onTouched();
|
|
1324
|
+
this.isTouched = true;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
change(value) {
|
|
1328
|
+
if (!this.isTouched) {
|
|
1329
|
+
this._onTouched();
|
|
1330
|
+
this.isTouched = true;
|
|
1331
|
+
}
|
|
1332
|
+
if (!this.disabled()) {
|
|
1333
|
+
this.value.set(value);
|
|
1334
|
+
this._onChange(value);
|
|
1335
|
+
this.changed.emit(value);
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpRateGroupCodeSelectComponent, deps: [{ token: i1$1.RateGroupCodeService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1339
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: UpRateGroupCodeSelectComponent, isStandalone: true, selector: "up-rate-group-code-select", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", changed: "changed" }, host: { classAttribute: "block" }, providers: [
|
|
1340
|
+
{
|
|
1341
|
+
provide: UpFieldControl,
|
|
1342
|
+
useExisting: forwardRef(() => UpRateGroupCodeSelectComponent),
|
|
1343
|
+
}
|
|
1344
|
+
], usesInheritance: true, ngImport: i0, template: `
|
|
1345
|
+
<up-searchable-select
|
|
1346
|
+
virtualScroll
|
|
1347
|
+
bindValue="code"
|
|
1348
|
+
bindLabel="name"
|
|
1349
|
+
[query]="queryFn"
|
|
1350
|
+
[value]="value()"
|
|
1351
|
+
[loading]="isLoading()"
|
|
1352
|
+
[multiple]="multiple()"
|
|
1353
|
+
[class]="inlineClass()"
|
|
1354
|
+
[appendTo]="appendTo()"
|
|
1355
|
+
[clearable]="clearable()"
|
|
1356
|
+
[placeholder]="placeholder()"
|
|
1357
|
+
[initialItems]="rateGroupCodes()"
|
|
1358
|
+
[disabled]="disabled() || _disabled()"
|
|
1359
|
+
(blur)="onTouched()"
|
|
1360
|
+
(changed)="change($event)"
|
|
1361
|
+
/>
|
|
1362
|
+
`, isInline: true, dependencies: [{ kind: "component", type: UpSearchableSelectComponent, selector: "up-searchable-select", inputs: ["query", "label", "placeholder", "initialItems", "bindLabel", "bindValue", "appendTo", "class", "addTag", "multiple", "required", "disabled", "clearable", "virtualScroll", "loading", "value"], outputs: ["loadingChange", "valueChange", "changed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1363
|
+
}
|
|
1364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpRateGroupCodeSelectComponent, decorators: [{
|
|
1365
|
+
type: Component,
|
|
1366
|
+
args: [{
|
|
1367
|
+
standalone: true,
|
|
1368
|
+
selector: 'up-rate-group-code-select',
|
|
1369
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1370
|
+
host: {
|
|
1371
|
+
class: 'block'
|
|
1372
|
+
},
|
|
1373
|
+
imports: [
|
|
1374
|
+
UpSearchableSelectComponent
|
|
1375
|
+
],
|
|
1376
|
+
providers: [
|
|
1377
|
+
{
|
|
1378
|
+
provide: UpFieldControl,
|
|
1379
|
+
useExisting: forwardRef(() => UpRateGroupCodeSelectComponent),
|
|
1380
|
+
}
|
|
1381
|
+
],
|
|
1382
|
+
template: `
|
|
1383
|
+
<up-searchable-select
|
|
1384
|
+
virtualScroll
|
|
1385
|
+
bindValue="code"
|
|
1386
|
+
bindLabel="name"
|
|
1387
|
+
[query]="queryFn"
|
|
1388
|
+
[value]="value()"
|
|
1389
|
+
[loading]="isLoading()"
|
|
1390
|
+
[multiple]="multiple()"
|
|
1391
|
+
[class]="inlineClass()"
|
|
1392
|
+
[appendTo]="appendTo()"
|
|
1393
|
+
[clearable]="clearable()"
|
|
1394
|
+
[placeholder]="placeholder()"
|
|
1395
|
+
[initialItems]="rateGroupCodes()"
|
|
1396
|
+
[disabled]="disabled() || _disabled()"
|
|
1397
|
+
(blur)="onTouched()"
|
|
1398
|
+
(changed)="change($event)"
|
|
1399
|
+
/>
|
|
1400
|
+
`,
|
|
1401
|
+
}]
|
|
1402
|
+
}], ctorParameters: () => [{ type: i1$1.RateGroupCodeService }], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], appendTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "appendTo", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
1186
1403
|
|
|
1187
1404
|
class UpDatepickerComponent extends UpFieldControlComponent {
|
|
1188
1405
|
constructor() {
|
|
1189
1406
|
super();
|
|
1190
|
-
this.placeholder = input('',
|
|
1191
|
-
this.minDate = input(null,
|
|
1192
|
-
this.maxDate = input(null,
|
|
1407
|
+
this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1408
|
+
this.minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : []));
|
|
1409
|
+
this.maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : []));
|
|
1193
1410
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
1194
1411
|
this.dateFormat = input('dd LLL yyyy', { ...(ngDevMode ? { debugName: "dateFormat" } : {}), alias: 'format' });
|
|
1195
1412
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
1196
|
-
this.btnTrigger = viewChild('btnTrigger',
|
|
1197
|
-
this.value = signal(null,
|
|
1198
|
-
this._disabled = signal(false,
|
|
1413
|
+
this.btnTrigger = viewChild('btnTrigger', ...(ngDevMode ? [{ debugName: "btnTrigger" }] : []));
|
|
1414
|
+
this.value = signal(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1415
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1199
1416
|
this.formattedDate = computed(() => {
|
|
1200
1417
|
return this.value() ? format(this.value(), this.dateFormat()) : '';
|
|
1201
|
-
},
|
|
1418
|
+
}, ...(ngDevMode ? [{ debugName: "formattedDate" }] : []));
|
|
1202
1419
|
this._computedClass = computed(() => {
|
|
1203
1420
|
return up('flex justify-between px-3 border border-border min-w-48 w-full font-normal hover:not-disabled:text-primary! data-[has-value=false]:text-muted-foreground', this.inlineClass());
|
|
1204
|
-
},
|
|
1421
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
1205
1422
|
this._isTouched = false;
|
|
1206
1423
|
this._onTouched = () => { };
|
|
1207
1424
|
this._onChange = () => { };
|
|
@@ -1236,8 +1453,8 @@ class UpDatepickerComponent extends UpFieldControlComponent {
|
|
|
1236
1453
|
this._onTouched();
|
|
1237
1454
|
this._isTouched = true;
|
|
1238
1455
|
}
|
|
1239
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1240
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.
|
|
1456
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpDatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1457
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: UpDatepickerComponent, isStandalone: true, selector: "up-datepicker", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1241
1458
|
{
|
|
1242
1459
|
provide: UpFieldControl,
|
|
1243
1460
|
useExisting: forwardRef(() => UpDatepickerComponent),
|
|
@@ -1281,7 +1498,7 @@ class UpDatepickerComponent extends UpFieldControlComponent {
|
|
|
1281
1498
|
</up-popover>
|
|
1282
1499
|
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: UpButtonDirective, selector: "[upButton]", inputs: ["size", "variant", "class"], exportAs: ["upButton"] }, { kind: "component", type: UpPopoverComponent, selector: "up-popover", inputs: ["placement", "alignment", "placementOffset", "alignmentOffset"] }, { kind: "component", type: UpCalendarComponent, selector: "up-calendar", inputs: ["minDate", "maxDate", "variant", "activeDay", "activeRangeDay"], outputs: ["selected", "rangeSelected", "activeDayChange", "activeRangeDayChange"] }, { kind: "directive", type: UpPopoverTriggerDirective, selector: "[upPopoverTrigger]", exportAs: ["upPopoverTrigger"] }, { kind: "directive", type: UpPopoverContentRefDirective, selector: "[upPopoverContentRef]", exportAs: ["upPopoverContentRef"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1283
1500
|
}
|
|
1284
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpDatepickerComponent, decorators: [{
|
|
1285
1502
|
type: Component,
|
|
1286
1503
|
args: [{
|
|
1287
1504
|
standalone: true,
|
|
@@ -1345,20 +1562,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImpor
|
|
|
1345
1562
|
class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
1346
1563
|
constructor() {
|
|
1347
1564
|
super();
|
|
1348
|
-
this.placeholder = input('',
|
|
1349
|
-
this.minDate = input(null,
|
|
1350
|
-
this.maxDate = input(null,
|
|
1565
|
+
this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1566
|
+
this.minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : []));
|
|
1567
|
+
this.maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : []));
|
|
1351
1568
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
1352
1569
|
this.dateFormat = input('dd LLL yyyy', { ...(ngDevMode ? { debugName: "dateFormat" } : {}), alias: 'format' });
|
|
1353
1570
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
1354
|
-
this._disabled = signal(false,
|
|
1355
|
-
this.value = signal({ from: null, to: null },
|
|
1571
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1572
|
+
this.value = signal({ from: null, to: null }, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1356
1573
|
this.formattedDate = computed(() => {
|
|
1357
1574
|
return this.value().from && this.value().to ? `${format(this.value().from, this.dateFormat())} - ${format(this.value().to, this.dateFormat())}` : '';
|
|
1358
|
-
},
|
|
1575
|
+
}, ...(ngDevMode ? [{ debugName: "formattedDate" }] : []));
|
|
1359
1576
|
this._computedClass = computed(() => {
|
|
1360
1577
|
return up('flex justify-between px-3 border border-border min-w-60 w-full font-normal hover:not-disabled:text-primary! data-[has-value=false]:text-muted-foreground', this.inlineClass());
|
|
1361
|
-
},
|
|
1578
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
1362
1579
|
this._isTouched = false;
|
|
1363
1580
|
this._onTouched = () => { };
|
|
1364
1581
|
this._onChange = () => { };
|
|
@@ -1392,8 +1609,8 @@ class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
|
1392
1609
|
this._onTouched();
|
|
1393
1610
|
this._isTouched = true;
|
|
1394
1611
|
}
|
|
1395
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1396
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.
|
|
1612
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpDateRangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1613
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: UpDateRangePickerComponent, isStandalone: true, selector: "up-date-range-picker", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1397
1614
|
{
|
|
1398
1615
|
provide: UpFieldControl,
|
|
1399
1616
|
useExisting: forwardRef(() => UpDateRangePickerComponent)
|
|
@@ -1438,7 +1655,7 @@ class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
|
1438
1655
|
</up-popover>
|
|
1439
1656
|
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: UpButtonDirective, selector: "[upButton]", inputs: ["size", "variant", "class"], exportAs: ["upButton"] }, { kind: "component", type: UpPopoverComponent, selector: "up-popover", inputs: ["placement", "alignment", "placementOffset", "alignmentOffset"] }, { kind: "component", type: UpCalendarComponent, selector: "up-calendar", inputs: ["minDate", "maxDate", "variant", "activeDay", "activeRangeDay"], outputs: ["selected", "rangeSelected", "activeDayChange", "activeRangeDayChange"] }, { kind: "directive", type: UpPopoverTriggerDirective, selector: "[upPopoverTrigger]", exportAs: ["upPopoverTrigger"] }, { kind: "directive", type: UpPopoverContentRefDirective, selector: "[upPopoverContentRef]", exportAs: ["upPopoverContentRef"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1440
1657
|
}
|
|
1441
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1658
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpDateRangePickerComponent, decorators: [{
|
|
1442
1659
|
type: Component,
|
|
1443
1660
|
args: [{
|
|
1444
1661
|
standalone: true,
|
|
@@ -1502,14 +1719,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImpor
|
|
|
1502
1719
|
|
|
1503
1720
|
class UpFormFieldComponent {
|
|
1504
1721
|
constructor() {
|
|
1505
|
-
this.name = input('',
|
|
1506
|
-
this.hint = input('',
|
|
1507
|
-
this.label = input('',
|
|
1722
|
+
this.name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
1723
|
+
this.hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
1724
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1508
1725
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
1509
|
-
this.control = contentChild(UpFieldControl,
|
|
1726
|
+
this.control = contentChild(UpFieldControl, ...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
1510
1727
|
this._computedClass = computed(() => {
|
|
1511
1728
|
return up('block space-y-2', this.inlineClass());
|
|
1512
|
-
},
|
|
1729
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
1513
1730
|
effect(() => {
|
|
1514
1731
|
if (!this.control()) {
|
|
1515
1732
|
throw new Error('Form field must contain a field control, eg: input, checkbox, textarea, etc.');
|
|
@@ -1517,17 +1734,21 @@ class UpFormFieldComponent {
|
|
|
1517
1734
|
this.control().setControlName(this.label());
|
|
1518
1735
|
});
|
|
1519
1736
|
}
|
|
1520
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.
|
|
1521
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.
|
|
1737
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1738
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: UpFormFieldComponent, isStandalone: true, selector: "up-form-field", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, queries: [{ propertyName: "control", first: true, predicate: UpFieldControl, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1522
1739
|
<div
|
|
1523
1740
|
class="
|
|
1524
1741
|
group flex flex-col gap-2
|
|
1742
|
+
has-[input[type='radio']]:flex-row has-[input[type='radio']]:items-center
|
|
1525
1743
|
has-[input[type='checkbox']]:flex-row has-[input[type='checkbox']]:items-center
|
|
1526
1744
|
"
|
|
1527
1745
|
>
|
|
1528
1746
|
@if (label()) {
|
|
1529
1747
|
<label
|
|
1530
|
-
class="
|
|
1748
|
+
class="
|
|
1749
|
+
text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 select-none
|
|
1750
|
+
group-has-[input[type='checkbox']]:order-2 group-has-[input[type='radio']]:order-2
|
|
1751
|
+
"
|
|
1531
1752
|
[for]="name()"
|
|
1532
1753
|
[class.text-destructive]="control()?.error()"
|
|
1533
1754
|
>
|
|
@@ -1550,7 +1771,7 @@ class UpFormFieldComponent {
|
|
|
1550
1771
|
}
|
|
1551
1772
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1552
1773
|
}
|
|
1553
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.
|
|
1774
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpFormFieldComponent, decorators: [{
|
|
1554
1775
|
type: Component,
|
|
1555
1776
|
args: [{
|
|
1556
1777
|
standalone: true,
|
|
@@ -1563,12 +1784,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImpor
|
|
|
1563
1784
|
<div
|
|
1564
1785
|
class="
|
|
1565
1786
|
group flex flex-col gap-2
|
|
1787
|
+
has-[input[type='radio']]:flex-row has-[input[type='radio']]:items-center
|
|
1566
1788
|
has-[input[type='checkbox']]:flex-row has-[input[type='checkbox']]:items-center
|
|
1567
1789
|
"
|
|
1568
1790
|
>
|
|
1569
1791
|
@if (label()) {
|
|
1570
1792
|
<label
|
|
1571
|
-
class="
|
|
1793
|
+
class="
|
|
1794
|
+
text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 select-none
|
|
1795
|
+
group-has-[input[type='checkbox']]:order-2 group-has-[input[type='radio']]:order-2
|
|
1796
|
+
"
|
|
1572
1797
|
[for]="name()"
|
|
1573
1798
|
[class.text-destructive]="control()?.error()"
|
|
1574
1799
|
>
|
|
@@ -1593,6 +1818,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.1", ngImpor
|
|
|
1593
1818
|
}]
|
|
1594
1819
|
}], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], control: [{ type: i0.ContentChild, args: [i0.forwardRef(() => UpFieldControl), { isSignal: true }] }] } });
|
|
1595
1820
|
|
|
1821
|
+
class UpImagePickerComponent extends UpFieldControlComponent {
|
|
1822
|
+
constructor() {
|
|
1823
|
+
super();
|
|
1824
|
+
this.ratio = input('1/1', ...(ngDevMode ? [{ debugName: "ratio" }] : []));
|
|
1825
|
+
this.imgSrc = model('', { ...(ngDevMode ? { debugName: "imgSrc" } : {}), alias: 'src' });
|
|
1826
|
+
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
1827
|
+
this.changed = output();
|
|
1828
|
+
this.file = viewChild('file', ...(ngDevMode ? [{ debugName: "file" }] : []));
|
|
1829
|
+
this.fileName = '';
|
|
1830
|
+
this.isTouched = signal(false, ...(ngDevMode ? [{ debugName: "isTouched" }] : []));
|
|
1831
|
+
this._computedClass = computed(() => {
|
|
1832
|
+
return up('peer overflow-hidden flex flex-col size-full rounded-lg border bg-transparent shadow-xs outline-none md:text-sm relative hover:border-dashed border-2 border-foreground/20 group [&_span]:font-semibold [&_span]:text-xs [&_span]:text-center', this.error() ? 'ring-destructive/20 dark:ring-destructive/40 border-destructive' : '', this.inlineClass());
|
|
1833
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
1834
|
+
this._onTouched = () => { };
|
|
1835
|
+
this._onChange = (_val) => { };
|
|
1836
|
+
if (this.ngControl !== null) {
|
|
1837
|
+
this.ngControl.valueAccessor = this;
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
ngOnDestroy() {
|
|
1841
|
+
if (this.imgSrc()) {
|
|
1842
|
+
URL.revokeObjectURL(this.imgSrc());
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
registerOnChange(fn) {
|
|
1846
|
+
this._onChange = fn;
|
|
1847
|
+
}
|
|
1848
|
+
registerOnTouched(fn) {
|
|
1849
|
+
this._onTouched = fn;
|
|
1850
|
+
}
|
|
1851
|
+
writeValue(val) {
|
|
1852
|
+
this.imgSrc.set(val);
|
|
1853
|
+
}
|
|
1854
|
+
clear(ev) {
|
|
1855
|
+
this.writeValue('');
|
|
1856
|
+
ev?.stopPropagation();
|
|
1857
|
+
}
|
|
1858
|
+
touch() {
|
|
1859
|
+
if (!this.isTouched()) {
|
|
1860
|
+
this._onTouched();
|
|
1861
|
+
this.isTouched.set(true);
|
|
1862
|
+
}
|
|
1863
|
+
this.imgSrc.set(this.imgSrc());
|
|
1864
|
+
}
|
|
1865
|
+
async selectPhoto(files) {
|
|
1866
|
+
if (files?.target?.files)
|
|
1867
|
+
files = files.target.files;
|
|
1868
|
+
if (files && files[0]) {
|
|
1869
|
+
const compressedFile = await compressImage({
|
|
1870
|
+
quality: 0.8,
|
|
1871
|
+
file: files[0],
|
|
1872
|
+
});
|
|
1873
|
+
if (this.file()) {
|
|
1874
|
+
this.file().nativeElement.value = '';
|
|
1875
|
+
}
|
|
1876
|
+
this.imgSrc.set(URL.createObjectURL(compressedFile));
|
|
1877
|
+
this.fileName = compressedFile.name;
|
|
1878
|
+
this.changed.emit(compressedFile);
|
|
1879
|
+
this._onChange(compressedFile);
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpImagePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1883
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: UpImagePickerComponent, isStandalone: true, selector: "up-image-picker", inputs: { ratio: { classPropertyName: "ratio", publicName: "ratio", isSignal: true, isRequired: false, transformFunction: null }, imgSrc: { classPropertyName: "imgSrc", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { imgSrc: "srcChange", changed: "changed" }, providers: [
|
|
1884
|
+
{
|
|
1885
|
+
provide: UpFieldControl,
|
|
1886
|
+
useExisting: forwardRef(() => UpImagePickerComponent)
|
|
1887
|
+
},
|
|
1888
|
+
provideIcons({
|
|
1889
|
+
matUpload,
|
|
1890
|
+
matDelete
|
|
1891
|
+
})
|
|
1892
|
+
], viewQueries: [{ propertyName: "file", first: true, predicate: ["file"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div \n upFileDragNDrop \n draggedClass=\"border-dashed border-2 border-foreground/20\"\n [class]=\"_computedClass()\"\n [style.aspect-ratio]=\"ratio()\"\n (fileDropped)=\"selectPhoto($event)\"\n>\n @if (imgSrc()) {\n <img \n class=\"overflow-hidden object-cover size-full\"\n [alt]=\"fileName\" \n [src]=\"imgSrc()\" \n [style.aspect-ratio]=\"ratio()\"\n />\n }\n \n <div \n class=\"absolute inset-0 p-2 flex flex-col items-center justify-center text-muted-foreground cursor-pointer opacity-80 group-hover:opacity-100 transition\"\n [style.aspect-ratio]=\"ratio()\"\n >\n @if (imgSrc() === '') {\n <div \n class=\"flex flex-col items-center\"\n (click)=\"file.click()\"\n >\n <ng-icon\n size=\"24px\"\n name=\"matUpload\"\n />\n <span>Choose Image or Drag here.</span>\n </div>\n }\n @else {\n <div \n class=\"absolute flex items-center ustify-center opacity-0 group-hover:opacity-100 transition text-destructive\"\n (click)=\"clear($event)\"\n >\n <ng-icon\n size=\"24px\"\n name=\"matDelete\"\n />\n </div>\n }\n </div>\n\n <input \n type=\"file\" \n hidden \n accept=\"image/png, image/jpeg, image/jpg\" \n (change)=\"selectPhoto($event)\" \n #file\n />\n</div>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: UpFileDragNDropDirective, selector: "[upFileDragNDrop]", inputs: ["draggedClass"], outputs: ["fileDropped"], exportAs: ["upFileDragNDrop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1893
|
+
}
|
|
1894
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UpImagePickerComponent, decorators: [{
|
|
1895
|
+
type: Component,
|
|
1896
|
+
args: [{ standalone: true, selector: 'up-image-picker', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1897
|
+
{
|
|
1898
|
+
provide: UpFieldControl,
|
|
1899
|
+
useExisting: forwardRef(() => UpImagePickerComponent)
|
|
1900
|
+
},
|
|
1901
|
+
provideIcons({
|
|
1902
|
+
matUpload,
|
|
1903
|
+
matDelete
|
|
1904
|
+
})
|
|
1905
|
+
], imports: [
|
|
1906
|
+
NgIcon,
|
|
1907
|
+
UpFileDragNDropDirective
|
|
1908
|
+
], template: "<div \n upFileDragNDrop \n draggedClass=\"border-dashed border-2 border-foreground/20\"\n [class]=\"_computedClass()\"\n [style.aspect-ratio]=\"ratio()\"\n (fileDropped)=\"selectPhoto($event)\"\n>\n @if (imgSrc()) {\n <img \n class=\"overflow-hidden object-cover size-full\"\n [alt]=\"fileName\" \n [src]=\"imgSrc()\" \n [style.aspect-ratio]=\"ratio()\"\n />\n }\n \n <div \n class=\"absolute inset-0 p-2 flex flex-col items-center justify-center text-muted-foreground cursor-pointer opacity-80 group-hover:opacity-100 transition\"\n [style.aspect-ratio]=\"ratio()\"\n >\n @if (imgSrc() === '') {\n <div \n class=\"flex flex-col items-center\"\n (click)=\"file.click()\"\n >\n <ng-icon\n size=\"24px\"\n name=\"matUpload\"\n />\n <span>Choose Image or Drag here.</span>\n </div>\n }\n @else {\n <div \n class=\"absolute flex items-center ustify-center opacity-0 group-hover:opacity-100 transition text-destructive\"\n (click)=\"clear($event)\"\n >\n <ng-icon\n size=\"24px\"\n name=\"matDelete\"\n />\n </div>\n }\n </div>\n\n <input \n type=\"file\" \n hidden \n accept=\"image/png, image/jpeg, image/jpg\" \n (change)=\"selectPhoto($event)\" \n #file\n />\n</div>\n" }]
|
|
1909
|
+
}], ctorParameters: () => [], propDecorators: { ratio: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratio", required: false }] }], imgSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }, { type: i0.Output, args: ["srcChange"] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }], file: [{ type: i0.ViewChild, args: ['file', { isSignal: true }] }] } });
|
|
1910
|
+
|
|
1596
1911
|
function setValidator(form, keys, validators) {
|
|
1597
1912
|
if (!keys.length ||
|
|
1598
1913
|
keys.length === 1) {
|
|
@@ -1792,5 +2107,5 @@ function isNotEqualValidator(controlNames, message) {
|
|
|
1792
2107
|
* Generated bundle index. Do not edit.
|
|
1793
2108
|
*/
|
|
1794
2109
|
|
|
1795
|
-
export { UpCheckboxDirective, UpCountrySelectComponent, UpCurrencySelectComponent, UpDateRangePickerComponent, UpDatepickerComponent, UpFieldControl, UpFieldControlComponent, UpFormFieldComponent, UpInputDirective, UpNumberDirective, UpPasswordComponent, UpSearchableSelectComponent, UpSelectComponent, UpSwitchComponent, isEqualValidator, isNotEqualValidator, setValidator, toggleFormControls, validRangeValidator };
|
|
2110
|
+
export { UpCheckboxDirective, UpCountrySelectComponent, UpCurrencySelectComponent, UpDateRangePickerComponent, UpDatepickerComponent, UpFieldControl, UpFieldControlComponent, UpFormFieldComponent, UpImagePickerComponent, UpInputDirective, UpNumberDirective, UpOptionComponent, UpPasswordComponent, UpRadioDirective, UpRateGroupCodeSelectComponent, UpSearchableSelectComponent, UpSelectComponent, UpSwitchComponent, isEqualValidator, isNotEqualValidator, setValidator, toggleFormControls, validRangeValidator };
|
|
1796
2111
|
//# sourceMappingURL=unipin-angular-applet-forms.mjs.map
|