@unipin/angular-applet 21.1.2 → 21.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/common/assets/styles/theme.css +8 -0
- 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 +31 -11
- 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 +10 -10
- package/fesm2022/unipin-angular-applet-approval.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-audit-audit-modal.component-3a2P0bZr.mjs +280 -0
- package/fesm2022/unipin-angular-applet-audit-audit-modal.component-3a2P0bZr.mjs.map +1 -0
- package/fesm2022/unipin-angular-applet-audit.mjs +220 -0
- package/fesm2022/unipin-angular-applet-audit.mjs.map +1 -0
- package/fesm2022/unipin-angular-applet-auth.mjs +23 -23
- package/fesm2022/unipin-angular-applet-auth.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-avatar.mjs +26 -9
- 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 +37 -23
- 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 +25 -25
- 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 +62 -58
- package/fesm2022/unipin-angular-applet-dialog.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-forms.mjs +1113 -294
- package/fesm2022/unipin-angular-applet-forms.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-froala.mjs +9 -9
- package/fesm2022/unipin-angular-applet-froala.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-grids.mjs +17 -1
- package/fesm2022/unipin-angular-applet-grids.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 +18 -18
- package/fesm2022/unipin-angular-applet-markdown.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-popover.mjs +21 -21
- 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-audit.d.ts +49 -0
- package/types/unipin-angular-applet-avatar.d.ts +3 -2
- package/types/unipin-angular-applet-containers.d.ts +1 -1
- package/types/unipin-angular-applet-dialog.d.ts +11 -8
- package/types/unipin-angular-applet-forms.d.ts +168 -45
- package/types/unipin-angular-applet-grids.d.ts +17 -1
- package/types/unipin-angular-applet-popover.d.ts +2 -2
- package/types/unipin-angular-applet-stepper.d.ts +43 -0
|
@@ -1,11 +1,11 @@
|
|
|
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, Pipe, afterNextRender, 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';
|
|
8
|
-
import { matVisibilityOffRound, matVisibilityRound, matCalendarMonthRound } from '@ng-icons/material-icons/round';
|
|
8
|
+
import { matVisibilityOffRound, matVisibilityRound, matCalendarMonthRound, matWatchLaterRound } from '@ng-icons/material-icons/round';
|
|
9
9
|
import { NgSelectComponent } from '@ng-select/ng-select';
|
|
10
10
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
11
11
|
import { Subject, distinctUntilChanged, debounceTime, tap, switchMap, map, catchError, of } from 'rxjs';
|
|
@@ -13,6 +13,8 @@ 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 { DecimalPipe } from '@angular/common';
|
|
17
|
+
import { matDelete, matUpload } from '@ng-icons/material-icons/baseline';
|
|
16
18
|
|
|
17
19
|
const errMessage = {
|
|
18
20
|
email: (label) => `${label} is not a valid email`,
|
|
@@ -20,7 +22,7 @@ const errMessage = {
|
|
|
20
22
|
minlength: (label, length) => `${label} must be at least ${length} characters`,
|
|
21
23
|
maxlength: (label, length) => `${label} must not exceed ${length} characters`,
|
|
22
24
|
max: (label, max) => `${label} value must be lower than ${max}`,
|
|
23
|
-
min: (label, min) => `${label} value must be larger than ${min}
|
|
25
|
+
min: (label, min) => `${label} value must be larger than ${min}`
|
|
24
26
|
};
|
|
25
27
|
const extraParamKey = {
|
|
26
28
|
max: 'max',
|
|
@@ -32,7 +34,7 @@ class UpFieldControl {
|
|
|
32
34
|
}
|
|
33
35
|
class UpFieldControlComponent {
|
|
34
36
|
constructor() {
|
|
35
|
-
this.error = signal('',
|
|
37
|
+
this.error = signal('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
36
38
|
this.injector = inject(Injector);
|
|
37
39
|
this.ngControl = this.injector.get(NgControl, null);
|
|
38
40
|
this._parentForm = inject(NgForm, { optional: true });
|
|
@@ -57,15 +59,23 @@ class UpFieldControlComponent {
|
|
|
57
59
|
return;
|
|
58
60
|
}
|
|
59
61
|
const errKey = Object.keys(control.errors)[0];
|
|
60
|
-
const
|
|
62
|
+
const errorData = control.errors[errKey];
|
|
63
|
+
if (errorData?.message) {
|
|
64
|
+
const newState = errorData.message;
|
|
65
|
+
if (newState !== this.error()) {
|
|
66
|
+
this.error.set(newState);
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const newState = errMessage[errKey](this._controlName ?? 'Field', errorData[extraParamKey[errKey]]);
|
|
61
71
|
if (newState !== this.error()) {
|
|
62
72
|
this.error.set(newState);
|
|
63
73
|
}
|
|
64
74
|
}
|
|
65
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
66
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.
|
|
75
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpFieldControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
76
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpFieldControlComponent }); }
|
|
67
77
|
}
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpFieldControlComponent, decorators: [{
|
|
69
79
|
type: Injectable
|
|
70
80
|
}] });
|
|
71
81
|
|
|
@@ -74,18 +84,18 @@ class UpInputDirective extends UpFieldControlComponent {
|
|
|
74
84
|
super(...arguments);
|
|
75
85
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
76
86
|
this._computedClass = computed(() => {
|
|
77
|
-
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
|
-
},
|
|
87
|
+
return up('peer file:text-foreground placeholder:text-muted-foreground/30 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());
|
|
88
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
79
89
|
}
|
|
80
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
81
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
90
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpInputDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
91
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", type: UpInputDirective, isStandalone: true, selector: "[upInput]", inputs: { inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [
|
|
82
92
|
{
|
|
83
93
|
provide: UpFieldControl,
|
|
84
94
|
useExisting: forwardRef(() => UpInputDirective)
|
|
85
95
|
}
|
|
86
96
|
], exportAs: ["upInput"], usesInheritance: true, ngImport: i0 }); }
|
|
87
97
|
}
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpInputDirective, decorators: [{
|
|
89
99
|
type: Directive,
|
|
90
100
|
args: [{
|
|
91
101
|
standalone: true,
|
|
@@ -108,7 +118,7 @@ class UpNumberDirective extends UpInputDirective {
|
|
|
108
118
|
super();
|
|
109
119
|
this.renderer = renderer;
|
|
110
120
|
this.el = el;
|
|
111
|
-
this.magnifyValue = input(1,
|
|
121
|
+
this.magnifyValue = input(1, ...(ngDevMode ? [{ debugName: "magnifyValue" }] : []));
|
|
112
122
|
this.maxDecimalDigits = computed(() => {
|
|
113
123
|
if (!this.magnifyValue() ||
|
|
114
124
|
this.magnifyValue() === 1) {
|
|
@@ -116,7 +126,7 @@ class UpNumberDirective extends UpInputDirective {
|
|
|
116
126
|
}
|
|
117
127
|
const floatPoint = Math.log10(this.magnifyValue());
|
|
118
128
|
return floatPoint % 1 !== 0 ? 0 : floatPoint;
|
|
119
|
-
},
|
|
129
|
+
}, ...(ngDevMode ? [{ debugName: "maxDecimalDigits" }] : []));
|
|
120
130
|
this.lastCaretPos = 0;
|
|
121
131
|
this.lastRawValue = '';
|
|
122
132
|
this.lastKey = null;
|
|
@@ -270,15 +280,15 @@ class UpNumberDirective extends UpInputDirective {
|
|
|
270
280
|
decimal: decimalPart?.slice(0, this.maxDecimalDigits()),
|
|
271
281
|
};
|
|
272
282
|
}
|
|
273
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
274
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
283
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpNumberDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
284
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", 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
285
|
{
|
|
276
286
|
provide: UpFieldControl,
|
|
277
287
|
useExisting: forwardRef(() => UpNumberDirective),
|
|
278
288
|
},
|
|
279
289
|
], exportAs: ["upNumber"], usesInheritance: true, ngImport: i0 }); }
|
|
280
290
|
}
|
|
281
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpNumberDirective, decorators: [{
|
|
282
292
|
type: Directive,
|
|
283
293
|
args: [{
|
|
284
294
|
standalone: true,
|
|
@@ -305,36 +315,204 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
305
315
|
args: ['keydown', ['$event']]
|
|
306
316
|
}] } });
|
|
307
317
|
|
|
308
|
-
class
|
|
318
|
+
class UpPasswordComponent extends UpFieldControlComponent {
|
|
319
|
+
constructor() {
|
|
320
|
+
super();
|
|
321
|
+
this.placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : []));
|
|
322
|
+
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
323
|
+
this.autocomplete = input('off', ...(ngDevMode ? [{ debugName: "autocomplete" }] : []));
|
|
324
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
325
|
+
this.disabled = model(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
326
|
+
this.value = signal('', ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
327
|
+
this.type = signal('password', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
328
|
+
this.isTouched = false;
|
|
329
|
+
this._computedClass = computed(() => {
|
|
330
|
+
return up('pr-10 peer', this.inlineClass());
|
|
331
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
332
|
+
/**
|
|
333
|
+
* Callback function to handle value changes in the password input.
|
|
334
|
+
* @type {(_val: any) => void}
|
|
335
|
+
*/
|
|
336
|
+
this._onChange = (_val) => { };
|
|
337
|
+
/**
|
|
338
|
+
* Callback function to handle touch events in the password input.
|
|
339
|
+
* @type {() => void}
|
|
340
|
+
*/
|
|
341
|
+
this._onTouched = () => { };
|
|
342
|
+
if (this.ngControl !== null) {
|
|
343
|
+
this.ngControl.valueAccessor = this;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Registers a callback function to be called when the password input value changes.
|
|
348
|
+
* @param {(_val: any) => void} fn - Callback function for value changes.
|
|
349
|
+
*/
|
|
350
|
+
registerOnChange(fn) {
|
|
351
|
+
this._onChange = fn;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Registers a callback function to be called when the password input is touched.
|
|
355
|
+
* @param {() => void} fn - Callback function for touch events.
|
|
356
|
+
*/
|
|
357
|
+
registerOnTouched(fn) {
|
|
358
|
+
this._onTouched = fn;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Writes a new value to the password input.
|
|
362
|
+
* @param {*} val - The new value to be set.
|
|
363
|
+
*/
|
|
364
|
+
writeValue(val) {
|
|
365
|
+
this.value.set(val ?? '');
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Function that is called by the forms API when the control status change to or from 'DISABLED'.
|
|
369
|
+
* Depending on the status, it enables or disables the appropriate DOM element
|
|
370
|
+
* @param {boolean} isDisabled - disable state
|
|
371
|
+
*/
|
|
372
|
+
setDisabledState(isDisabled) {
|
|
373
|
+
this.disabled.set(isDisabled);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Toggles the type of the password input between text and password.
|
|
377
|
+
*/
|
|
378
|
+
changeType() {
|
|
379
|
+
if (!this.disabled()) {
|
|
380
|
+
this.type.set(this.type() === 'text' ? 'password' : 'text');
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Event handler to handle touch status.
|
|
385
|
+
*
|
|
386
|
+
* @returns {void}
|
|
387
|
+
*/
|
|
388
|
+
touch() {
|
|
389
|
+
if (!this.isTouched) {
|
|
390
|
+
this._onTouched();
|
|
391
|
+
this.isTouched = true;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Event handler for changes in the password input.
|
|
396
|
+
* If not touched, marks the input as touched.
|
|
397
|
+
* Updates the value and triggers change detection.
|
|
398
|
+
* @param {any} param - Event detail containing the new password input value.
|
|
399
|
+
*/
|
|
400
|
+
change({ value }) {
|
|
401
|
+
if (!this.isTouched) {
|
|
402
|
+
this._onTouched();
|
|
403
|
+
this.isTouched = true;
|
|
404
|
+
}
|
|
405
|
+
this.value.set(value);
|
|
406
|
+
this._onChange(this.value());
|
|
407
|
+
}
|
|
408
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpPasswordComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
409
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", 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: [
|
|
410
|
+
{
|
|
411
|
+
provide: UpFieldControl,
|
|
412
|
+
useExisting: forwardRef(() => UpPasswordComponent)
|
|
413
|
+
},
|
|
414
|
+
provideIcons({
|
|
415
|
+
matVisibilityRound,
|
|
416
|
+
matVisibilityOffRound
|
|
417
|
+
}),
|
|
418
|
+
], usesInheritance: true, ngImport: i0, template: `
|
|
419
|
+
<input
|
|
420
|
+
upInput
|
|
421
|
+
maxlength="64"
|
|
422
|
+
[type]="type()"
|
|
423
|
+
[value]="value()"
|
|
424
|
+
[required]="required()"
|
|
425
|
+
[disabled]="disabled()"
|
|
426
|
+
[class]="_computedClass()"
|
|
427
|
+
[placeholder]="placeholder()?? ''"
|
|
428
|
+
[attr.autocomplete]="autocomplete()"
|
|
429
|
+
(blur)="touch()"
|
|
430
|
+
(input)="change($event.target)"
|
|
431
|
+
/>
|
|
432
|
+
|
|
433
|
+
<ng-icon
|
|
434
|
+
class="absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer text-gray-500 hover:text-primary peer-disabled:opacity-50 peer-disabled:cursor-not-allowed"
|
|
435
|
+
[name]="type() === 'password'? 'matVisibilityRound' : 'matVisibilityOffRound'"
|
|
436
|
+
(click)="changeType()"
|
|
437
|
+
/>
|
|
438
|
+
`, 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 }); }
|
|
439
|
+
}
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpPasswordComponent, decorators: [{
|
|
441
|
+
type: Component,
|
|
442
|
+
args: [{
|
|
443
|
+
standalone: true,
|
|
444
|
+
selector: 'up-password',
|
|
445
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
446
|
+
host: {
|
|
447
|
+
class: 'block relative',
|
|
448
|
+
},
|
|
449
|
+
imports: [
|
|
450
|
+
NgIcon,
|
|
451
|
+
UpInputDirective
|
|
452
|
+
],
|
|
453
|
+
providers: [
|
|
454
|
+
{
|
|
455
|
+
provide: UpFieldControl,
|
|
456
|
+
useExisting: forwardRef(() => UpPasswordComponent)
|
|
457
|
+
},
|
|
458
|
+
provideIcons({
|
|
459
|
+
matVisibilityRound,
|
|
460
|
+
matVisibilityOffRound
|
|
461
|
+
}),
|
|
462
|
+
],
|
|
463
|
+
template: `
|
|
464
|
+
<input
|
|
465
|
+
upInput
|
|
466
|
+
maxlength="64"
|
|
467
|
+
[type]="type()"
|
|
468
|
+
[value]="value()"
|
|
469
|
+
[required]="required()"
|
|
470
|
+
[disabled]="disabled()"
|
|
471
|
+
[class]="_computedClass()"
|
|
472
|
+
[placeholder]="placeholder()?? ''"
|
|
473
|
+
[attr.autocomplete]="autocomplete()"
|
|
474
|
+
(blur)="touch()"
|
|
475
|
+
(input)="change($event.target)"
|
|
476
|
+
/>
|
|
477
|
+
|
|
478
|
+
<ng-icon
|
|
479
|
+
class="absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer text-gray-500 hover:text-primary peer-disabled:opacity-50 peer-disabled:cursor-not-allowed"
|
|
480
|
+
[name]="type() === 'password'? 'matVisibilityRound' : 'matVisibilityOffRound'"
|
|
481
|
+
(click)="changeType()"
|
|
482
|
+
/>
|
|
483
|
+
`,
|
|
484
|
+
}]
|
|
485
|
+
}], 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"] }] } });
|
|
486
|
+
|
|
487
|
+
class UpRadioDirective extends UpFieldControlComponent {
|
|
309
488
|
constructor() {
|
|
310
489
|
super(...arguments);
|
|
311
490
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
312
491
|
this._computedClass = computed(() => {
|
|
313
|
-
return up('peer dark:bg-input/30 border-input size-
|
|
314
|
-
},
|
|
492
|
+
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());
|
|
493
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
315
494
|
}
|
|
316
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
317
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
495
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpRadioDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
496
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", 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: [
|
|
318
497
|
{
|
|
319
498
|
provide: UpFieldControl,
|
|
320
|
-
useExisting: forwardRef(() =>
|
|
499
|
+
useExisting: forwardRef(() => UpRadioDirective)
|
|
321
500
|
}
|
|
322
|
-
], exportAs: ["
|
|
501
|
+
], exportAs: ["upRadio"], usesInheritance: true, ngImport: i0 }); }
|
|
323
502
|
}
|
|
324
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpRadioDirective, decorators: [{
|
|
325
504
|
type: Directive,
|
|
326
505
|
args: [{
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
selector: '[upCheckbox]',
|
|
506
|
+
exportAs: 'upRadio',
|
|
507
|
+
selector: '[upRadio]',
|
|
330
508
|
host: {
|
|
331
|
-
type: '
|
|
509
|
+
type: 'radio',
|
|
332
510
|
'[class]': '_computedClass()',
|
|
333
511
|
},
|
|
334
512
|
providers: [
|
|
335
513
|
{
|
|
336
514
|
provide: UpFieldControl,
|
|
337
|
-
useExisting: forwardRef(() =>
|
|
515
|
+
useExisting: forwardRef(() => UpRadioDirective)
|
|
338
516
|
}
|
|
339
517
|
]
|
|
340
518
|
}]
|
|
@@ -343,7 +521,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
343
521
|
class UpSwitchComponent extends UpFieldControlComponent {
|
|
344
522
|
constructor() {
|
|
345
523
|
super();
|
|
346
|
-
this.checked = model(false,
|
|
524
|
+
this.checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
347
525
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
348
526
|
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
349
527
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
@@ -359,7 +537,7 @@ class UpSwitchComponent extends UpFieldControlComponent {
|
|
|
359
537
|
peer-checked:after:translate-x-[15px]
|
|
360
538
|
peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-2
|
|
361
539
|
`, this.inlineClass());
|
|
362
|
-
},
|
|
540
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
363
541
|
this._onChange = (_val) => { };
|
|
364
542
|
this._onTouched = () => { };
|
|
365
543
|
if (this.ngControl !== null) {
|
|
@@ -389,8 +567,8 @@ class UpSwitchComponent extends UpFieldControlComponent {
|
|
|
389
567
|
this._onChange(this.checked());
|
|
390
568
|
this._onTouched();
|
|
391
569
|
}
|
|
392
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
393
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
570
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
571
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", 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
572
|
{
|
|
395
573
|
provide: UpFieldControl,
|
|
396
574
|
useExisting: forwardRef(() => UpSwitchComponent),
|
|
@@ -412,7 +590,7 @@ class UpSwitchComponent extends UpFieldControlComponent {
|
|
|
412
590
|
</span>
|
|
413
591
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
414
592
|
}
|
|
415
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
593
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpSwitchComponent, decorators: [{
|
|
416
594
|
type: Component,
|
|
417
595
|
args: [{
|
|
418
596
|
standalone: true,
|
|
@@ -446,199 +624,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
446
624
|
}]
|
|
447
625
|
}], 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
626
|
|
|
449
|
-
class
|
|
627
|
+
class UpCheckboxDirective extends UpFieldControlComponent {
|
|
450
628
|
constructor() {
|
|
451
|
-
super();
|
|
452
|
-
this.placeholder = input(undefined, { ...(ngDevMode ? { debugName: "placeholder" } : {}) });
|
|
629
|
+
super(...arguments);
|
|
453
630
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
454
|
-
this.autocomplete = input('off', { ...(ngDevMode ? { debugName: "autocomplete" } : {}) });
|
|
455
|
-
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
456
|
-
this.disabled = model(false, { ...(ngDevMode ? { debugName: "disabled" } : {}) });
|
|
457
|
-
this.value = signal('', { ...(ngDevMode ? { debugName: "value" } : {}) });
|
|
458
|
-
this.type = signal('password', { ...(ngDevMode ? { debugName: "type" } : {}) });
|
|
459
|
-
this.isTouched = false;
|
|
460
631
|
this._computedClass = computed(() => {
|
|
461
|
-
return up('
|
|
462
|
-
},
|
|
463
|
-
/**
|
|
464
|
-
* Callback function to handle value changes in the password input.
|
|
465
|
-
* @type {(_val: any) => void}
|
|
466
|
-
*/
|
|
467
|
-
this._onChange = (_val) => { };
|
|
468
|
-
/**
|
|
469
|
-
* Callback function to handle touch events in the password input.
|
|
470
|
-
* @type {() => void}
|
|
471
|
-
*/
|
|
472
|
-
this._onTouched = () => { };
|
|
473
|
-
if (this.ngControl !== null) {
|
|
474
|
-
this.ngControl.valueAccessor = this;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* Registers a callback function to be called when the password input value changes.
|
|
479
|
-
* @param {(_val: any) => void} fn - Callback function for value changes.
|
|
480
|
-
*/
|
|
481
|
-
registerOnChange(fn) {
|
|
482
|
-
this._onChange = fn;
|
|
483
|
-
}
|
|
484
|
-
/**
|
|
485
|
-
* Registers a callback function to be called when the password input is touched.
|
|
486
|
-
* @param {() => void} fn - Callback function for touch events.
|
|
487
|
-
*/
|
|
488
|
-
registerOnTouched(fn) {
|
|
489
|
-
this._onTouched = fn;
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* Writes a new value to the password input.
|
|
493
|
-
* @param {*} val - The new value to be set.
|
|
494
|
-
*/
|
|
495
|
-
writeValue(val) {
|
|
496
|
-
this.value.set(val ?? '');
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* Function that is called by the forms API when the control status change to or from 'DISABLED'.
|
|
500
|
-
* Depending on the status, it enables or disables the appropriate DOM element
|
|
501
|
-
* @param {boolean} isDisabled - disable state
|
|
502
|
-
*/
|
|
503
|
-
setDisabledState(isDisabled) {
|
|
504
|
-
this.disabled.set(isDisabled);
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* Toggles the type of the password input between text and password.
|
|
508
|
-
*/
|
|
509
|
-
changeType() {
|
|
510
|
-
if (!this.disabled()) {
|
|
511
|
-
this.type.set(this.type() === 'text' ? 'password' : 'text');
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
/**
|
|
515
|
-
* Event handler to handle touch status.
|
|
516
|
-
*
|
|
517
|
-
* @returns {void}
|
|
518
|
-
*/
|
|
519
|
-
touch() {
|
|
520
|
-
if (!this.isTouched) {
|
|
521
|
-
this._onTouched();
|
|
522
|
-
this.isTouched = true;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
/**
|
|
526
|
-
* Event handler for changes in the password input.
|
|
527
|
-
* If not touched, marks the input as touched.
|
|
528
|
-
* Updates the value and triggers change detection.
|
|
529
|
-
* @param {any} param - Event detail containing the new password input value.
|
|
530
|
-
*/
|
|
531
|
-
change({ value }) {
|
|
532
|
-
if (!this.isTouched) {
|
|
533
|
-
this._onTouched();
|
|
534
|
-
this.isTouched = true;
|
|
535
|
-
}
|
|
536
|
-
this.value.set(value);
|
|
537
|
-
this._onChange(this.value());
|
|
632
|
+
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());
|
|
633
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
538
634
|
}
|
|
539
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
540
|
-
static { this.ɵ
|
|
635
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpCheckboxDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
636
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", 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: [
|
|
541
637
|
{
|
|
542
638
|
provide: UpFieldControl,
|
|
543
|
-
useExisting: forwardRef(() =>
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
matVisibilityRound,
|
|
547
|
-
matVisibilityOffRound
|
|
548
|
-
}),
|
|
549
|
-
], usesInheritance: true, ngImport: i0, template: `
|
|
550
|
-
<input
|
|
551
|
-
upInput
|
|
552
|
-
maxlength="64"
|
|
553
|
-
[type]="type()"
|
|
554
|
-
[value]="value()"
|
|
555
|
-
[required]="required()"
|
|
556
|
-
[disabled]="disabled()"
|
|
557
|
-
[class]="_computedClass()"
|
|
558
|
-
[placeholder]="placeholder()?? ''"
|
|
559
|
-
[attr.autocomplete]="autocomplete()"
|
|
560
|
-
(blur)="touch()"
|
|
561
|
-
(input)="change($event.target)"
|
|
562
|
-
/>
|
|
563
|
-
|
|
564
|
-
<ng-icon
|
|
565
|
-
class="absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer text-gray-500 hover:text-primary peer-disabled:opacity-50 peer-disabled:cursor-not-allowed"
|
|
566
|
-
[name]="type() === 'password'? 'matVisibilityRound' : 'matVisibilityOffRound'"
|
|
567
|
-
(click)="changeType()"
|
|
568
|
-
/>
|
|
569
|
-
`, 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 }); }
|
|
639
|
+
useExisting: forwardRef(() => UpCheckboxDirective)
|
|
640
|
+
}
|
|
641
|
+
], exportAs: ["upCheckbox"], usesInheritance: true, ngImport: i0 }); }
|
|
570
642
|
}
|
|
571
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
572
|
-
type:
|
|
643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpCheckboxDirective, decorators: [{
|
|
644
|
+
type: Directive,
|
|
573
645
|
args: [{
|
|
574
646
|
standalone: true,
|
|
575
|
-
|
|
576
|
-
|
|
647
|
+
exportAs: 'upCheckbox',
|
|
648
|
+
selector: '[upCheckbox]',
|
|
577
649
|
host: {
|
|
578
|
-
|
|
650
|
+
type: 'checkbox',
|
|
651
|
+
'[class]': '_computedClass()',
|
|
579
652
|
},
|
|
580
|
-
imports: [
|
|
581
|
-
NgIcon,
|
|
582
|
-
UpInputDirective
|
|
583
|
-
],
|
|
584
653
|
providers: [
|
|
585
654
|
{
|
|
586
655
|
provide: UpFieldControl,
|
|
587
|
-
useExisting: forwardRef(() =>
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
656
|
+
useExisting: forwardRef(() => UpCheckboxDirective)
|
|
657
|
+
}
|
|
658
|
+
]
|
|
659
|
+
}]
|
|
660
|
+
}], propDecorators: { inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
661
|
+
|
|
662
|
+
class UpOptionComponent {
|
|
663
|
+
constructor(elementRef) {
|
|
664
|
+
this.elementRef = elementRef;
|
|
665
|
+
this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
666
|
+
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
667
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
668
|
+
}
|
|
669
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpOptionComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
670
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", 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: `
|
|
671
|
+
<ng-content />
|
|
672
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
673
|
+
}
|
|
674
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpOptionComponent, decorators: [{
|
|
675
|
+
type: Component,
|
|
676
|
+
args: [{
|
|
677
|
+
standalone: true,
|
|
678
|
+
selector: 'up-option',
|
|
679
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
594
680
|
template: `
|
|
595
|
-
<
|
|
596
|
-
upInput
|
|
597
|
-
maxlength="64"
|
|
598
|
-
[type]="type()"
|
|
599
|
-
[value]="value()"
|
|
600
|
-
[required]="required()"
|
|
601
|
-
[disabled]="disabled()"
|
|
602
|
-
[class]="_computedClass()"
|
|
603
|
-
[placeholder]="placeholder()?? ''"
|
|
604
|
-
[attr.autocomplete]="autocomplete()"
|
|
605
|
-
(blur)="touch()"
|
|
606
|
-
(input)="change($event.target)"
|
|
607
|
-
/>
|
|
608
|
-
|
|
609
|
-
<ng-icon
|
|
610
|
-
class="absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer text-gray-500 hover:text-primary peer-disabled:opacity-50 peer-disabled:cursor-not-allowed"
|
|
611
|
-
[name]="type() === 'password'? 'matVisibilityRound' : 'matVisibilityOffRound'"
|
|
612
|
-
(click)="changeType()"
|
|
613
|
-
/>
|
|
681
|
+
<ng-content />
|
|
614
682
|
`,
|
|
615
683
|
}]
|
|
616
|
-
}], ctorParameters: () => [
|
|
684
|
+
}], 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 }] }] } });
|
|
617
685
|
|
|
618
686
|
class UpSelectComponent extends UpFieldControlComponent {
|
|
619
687
|
constructor() {
|
|
620
688
|
super();
|
|
621
|
-
this.
|
|
622
|
-
this.label = input('',
|
|
623
|
-
this.
|
|
624
|
-
this.
|
|
625
|
-
this.
|
|
626
|
-
this.
|
|
627
|
-
this.value = model(null, { ...(ngDevMode ? { debugName: "value" } : {}) });
|
|
689
|
+
this.options = contentChildren(UpOptionComponent, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
690
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
691
|
+
this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
692
|
+
this.bindLabel = input('label', ...(ngDevMode ? [{ debugName: "bindLabel" }] : []));
|
|
693
|
+
this.bindValue = input('value', ...(ngDevMode ? [{ debugName: "bindValue" }] : []));
|
|
694
|
+
this.appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
628
695
|
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" } : {}) });
|
|
696
|
+
this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: booleanAttribute });
|
|
697
|
+
this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
698
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
699
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
700
|
+
this.clearable = input(true, { ...(ngDevMode ? { debugName: "clearable" } : {}), transform: booleanAttribute });
|
|
634
701
|
this.addTag = input(false, { ...(ngDevMode ? { debugName: "addTag" } : {}), transform: booleanAttribute });
|
|
635
702
|
this.searchable = input(false, { ...(ngDevMode ? { debugName: "searchable" } : {}), transform: booleanAttribute });
|
|
636
703
|
this.virtualScroll = input(false, { ...(ngDevMode ? { debugName: "virtualScroll" } : {}), transform: booleanAttribute });
|
|
704
|
+
this.items = input(...(ngDevMode ? [undefined, { debugName: "items" }] : []));
|
|
705
|
+
this._items = computed(() => {
|
|
706
|
+
if (this.items()?.length) {
|
|
707
|
+
return this.items() ?? [];
|
|
708
|
+
}
|
|
709
|
+
return this.options().map((option) => {
|
|
710
|
+
return {
|
|
711
|
+
disabled: option.disabled(),
|
|
712
|
+
[this.bindValue()]: option.value(),
|
|
713
|
+
[this.bindLabel()]: option.label() || option.elementRef.nativeElement.textContent.trim(),
|
|
714
|
+
};
|
|
715
|
+
});
|
|
716
|
+
}, ...(ngDevMode ? [{ debugName: "_items" }] : []));
|
|
717
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
637
718
|
this.changed = output();
|
|
638
|
-
this.control = contentChild(UpFieldControl,
|
|
719
|
+
this.control = contentChild(UpFieldControl, ...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
639
720
|
this._computedClass = computed(() => {
|
|
640
721
|
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
|
-
},
|
|
722
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
642
723
|
this.isTouched = false;
|
|
643
724
|
this._onTouched = () => { };
|
|
644
725
|
this._onChange = (_val) => { };
|
|
@@ -701,15 +782,15 @@ class UpSelectComponent extends UpFieldControlComponent {
|
|
|
701
782
|
this.changed.emit(this.value());
|
|
702
783
|
}
|
|
703
784
|
}
|
|
704
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
705
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.
|
|
785
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
786
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.5", 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
787
|
{
|
|
707
788
|
provide: UpFieldControl,
|
|
708
789
|
useExisting: forwardRef(() => UpSelectComponent)
|
|
709
790
|
}
|
|
710
|
-
], queries: [{ propertyName: "control", first: true, predicate: UpFieldControl, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
791
|
+
], queries: [{ propertyName: "options", predicate: UpOptionComponent, isSignal: true }, { propertyName: "control", first: true, predicate: UpFieldControl, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
711
792
|
<ng-select
|
|
712
|
-
[items]="
|
|
793
|
+
[items]="_items()"
|
|
713
794
|
[ngModel]="value()"
|
|
714
795
|
[addTag]="addTag()"
|
|
715
796
|
[loading]="loading()"
|
|
@@ -728,9 +809,9 @@ class UpSelectComponent extends UpFieldControlComponent {
|
|
|
728
809
|
(blur)="touch()"
|
|
729
810
|
(ngModelChange)="change($event)"
|
|
730
811
|
/>
|
|
731
|
-
`, 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 }); }
|
|
812
|
+
`, 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{opacity:30%;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", "clearKeepsDisabledOptions", "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 }); }
|
|
732
813
|
}
|
|
733
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
814
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpSelectComponent, decorators: [{
|
|
734
815
|
type: Component,
|
|
735
816
|
args: [{ standalone: true, selector: 'up-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
736
817
|
class: 'block relative',
|
|
@@ -744,7 +825,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
744
825
|
}
|
|
745
826
|
], template: `
|
|
746
827
|
<ng-select
|
|
747
|
-
[items]="
|
|
828
|
+
[items]="_items()"
|
|
748
829
|
[ngModel]="value()"
|
|
749
830
|
[addTag]="addTag()"
|
|
750
831
|
[loading]="loading()"
|
|
@@ -763,23 +844,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
763
844
|
(blur)="touch()"
|
|
764
845
|
(ngModelChange)="change($event)"
|
|
765
846
|
/>
|
|
766
|
-
`, 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"] }]
|
|
767
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
847
|
+
`, 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{opacity:30%;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"] }]
|
|
848
|
+
}], 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 }] }] } });
|
|
768
849
|
|
|
769
850
|
class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
770
851
|
constructor(service) {
|
|
771
852
|
super();
|
|
772
853
|
this.service = service;
|
|
773
|
-
this.multiple = input(false,
|
|
774
|
-
this.clearable = input(true,
|
|
775
|
-
this.placeholder = input('Select country',
|
|
854
|
+
this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
855
|
+
this.clearable = input(true, ...(ngDevMode ? [{ debugName: "clearable" }] : []));
|
|
856
|
+
this.placeholder = input('Select country', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
776
857
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
777
858
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
778
|
-
this.value = model(null,
|
|
859
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
779
860
|
this.changed = output();
|
|
780
|
-
this.countries = signal([],
|
|
781
|
-
this.isLoading = signal(true,
|
|
782
|
-
this._disabled = signal(false,
|
|
861
|
+
this.countries = signal([], ...(ngDevMode ? [{ debugName: "countries" }] : []));
|
|
862
|
+
this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
863
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
783
864
|
this.isTouched = false;
|
|
784
865
|
this._onTouched = () => { };
|
|
785
866
|
this._onChange = (_val) => { };
|
|
@@ -831,8 +912,8 @@ class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
|
831
912
|
this.changed.emit(this.countries().find(c => c.code === value));
|
|
832
913
|
}
|
|
833
914
|
}
|
|
834
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
835
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
915
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpCountrySelectComponent, deps: [{ token: i1$1.CountryService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
916
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", 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: [
|
|
836
917
|
{
|
|
837
918
|
provide: UpFieldControl,
|
|
838
919
|
useExisting: forwardRef(() => UpCountrySelectComponent),
|
|
@@ -855,9 +936,9 @@ class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
|
855
936
|
(blur)="onTouched()"
|
|
856
937
|
(changed)="change($event)"
|
|
857
938
|
/>
|
|
858
|
-
`, isInline: true, dependencies: [{ kind: "component", type: UpSelectComponent, selector: "up-select", inputs: ["
|
|
939
|
+
`, 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 }); }
|
|
859
940
|
}
|
|
860
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
941
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpCountrySelectComponent, decorators: [{
|
|
861
942
|
type: Component,
|
|
862
943
|
args: [{
|
|
863
944
|
standalone: true,
|
|
@@ -901,16 +982,16 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
901
982
|
constructor(service) {
|
|
902
983
|
super();
|
|
903
984
|
this.service = service;
|
|
904
|
-
this.multiple = input(false,
|
|
905
|
-
this.clearable = input(true,
|
|
906
|
-
this.placeholder = input('Select currency',
|
|
985
|
+
this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
986
|
+
this.clearable = input(true, ...(ngDevMode ? [{ debugName: "clearable" }] : []));
|
|
987
|
+
this.placeholder = input('Select currency', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
907
988
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
908
989
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
909
|
-
this.value = model(null,
|
|
990
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
910
991
|
this.changed = output();
|
|
911
|
-
this.isLoading = signal(true,
|
|
912
|
-
this._disabled = signal(false,
|
|
913
|
-
this.currencies = signal([],
|
|
992
|
+
this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
993
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
994
|
+
this.currencies = signal([], ...(ngDevMode ? [{ debugName: "currencies" }] : []));
|
|
914
995
|
this.isTouched = false;
|
|
915
996
|
this._onTouched = () => { };
|
|
916
997
|
this._onChange = (_val) => { };
|
|
@@ -969,8 +1050,8 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
969
1050
|
this.changed.emit(this.currencies().find(c => c.code === value));
|
|
970
1051
|
}
|
|
971
1052
|
}
|
|
972
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
973
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
1053
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpCurrencySelectComponent, deps: [{ token: i1$1.CurrencyService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1054
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", 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: [
|
|
974
1055
|
{
|
|
975
1056
|
provide: UpFieldControl,
|
|
976
1057
|
useExisting: forwardRef(() => UpCurrencySelectComponent)
|
|
@@ -993,9 +1074,9 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
993
1074
|
(blur)="onTouched()"
|
|
994
1075
|
(changed)="change($event)"
|
|
995
1076
|
/>
|
|
996
|
-
`, isInline: true, dependencies: [{ kind: "component", type: UpSelectComponent, selector: "up-select", inputs: ["
|
|
1077
|
+
`, 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 }); }
|
|
997
1078
|
}
|
|
998
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1079
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpCurrencySelectComponent, decorators: [{
|
|
999
1080
|
type: Component,
|
|
1000
1081
|
args: [{
|
|
1001
1082
|
standalone: true,
|
|
@@ -1038,13 +1119,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
1038
1119
|
class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
1039
1120
|
constructor() {
|
|
1040
1121
|
super();
|
|
1041
|
-
this.query = input.required(
|
|
1042
|
-
this.label = input('',
|
|
1043
|
-
this.
|
|
1044
|
-
this.
|
|
1045
|
-
this.
|
|
1046
|
-
this.
|
|
1047
|
-
this.
|
|
1122
|
+
this.query = input.required(...(ngDevMode ? [{ debugName: "query" }] : []));
|
|
1123
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1124
|
+
this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1125
|
+
this.initialItems = input([], ...(ngDevMode ? [{ debugName: "initialItems" }] : []));
|
|
1126
|
+
this.bindLabel = input('label', ...(ngDevMode ? [{ debugName: "bindLabel" }] : []));
|
|
1127
|
+
this.bindValue = input('value', ...(ngDevMode ? [{ debugName: "bindValue" }] : []));
|
|
1128
|
+
this.appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
1048
1129
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
1049
1130
|
this.addTag = input(false, { ...(ngDevMode ? { debugName: "addTag" } : {}), transform: booleanAttribute });
|
|
1050
1131
|
this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
@@ -1052,17 +1133,17 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1052
1133
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
1053
1134
|
this.clearable = input(true, { ...(ngDevMode ? { debugName: "clearable" } : {}), transform: booleanAttribute });
|
|
1054
1135
|
this.virtualScroll = input(false, { ...(ngDevMode ? { debugName: "virtualScroll" } : {}), transform: booleanAttribute });
|
|
1055
|
-
this.loading = model(false,
|
|
1056
|
-
this.value = model(null,
|
|
1136
|
+
this.loading = model(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
1137
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1057
1138
|
this.changed = output();
|
|
1058
|
-
this.control = contentChild(UpFieldControl,
|
|
1139
|
+
this.control = contentChild(UpFieldControl, ...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
1059
1140
|
this._computedClass = computed(() => {
|
|
1060
1141
|
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());
|
|
1061
|
-
},
|
|
1142
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
1062
1143
|
this.items = computed(() => {
|
|
1063
1144
|
const results = this._queryResults();
|
|
1064
1145
|
return results.length > 0 ? results : this.initialItems();
|
|
1065
|
-
},
|
|
1146
|
+
}, ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
1066
1147
|
this.typeahead = new Subject();
|
|
1067
1148
|
this.query$ = this.typeahead.pipe(distinctUntilChanged(), debounceTime(300), tap(() => this.loading.set(true)), switchMap((k) => {
|
|
1068
1149
|
return this.query()(k).pipe(map((result) => !result.length ? this.initialItems() : result), catchError(() => of(this.initialItems())));
|
|
@@ -1109,8 +1190,8 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1109
1190
|
this.changed.emit(this.value());
|
|
1110
1191
|
}
|
|
1111
1192
|
}
|
|
1112
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1113
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.
|
|
1193
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpSearchableSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1194
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.5", 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: [
|
|
1114
1195
|
{
|
|
1115
1196
|
provide: UpFieldControl,
|
|
1116
1197
|
useExisting: forwardRef(() => UpSearchableSelectComponent)
|
|
@@ -1143,9 +1224,9 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1143
1224
|
(blur)="touch()"
|
|
1144
1225
|
(change)="change($event)"
|
|
1145
1226
|
/>
|
|
1146
|
-
`, 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 }); }
|
|
1227
|
+
`, 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{opacity:30%;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", "clearKeepsDisabledOptions", "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 }); }
|
|
1147
1228
|
}
|
|
1148
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1229
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpSearchableSelectComponent, decorators: [{
|
|
1149
1230
|
type: Component,
|
|
1150
1231
|
args: [{ standalone: true, selector: 'up-searchable-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1151
1232
|
class: 'block relative',
|
|
@@ -1185,24 +1266,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
1185
1266
|
(blur)="touch()"
|
|
1186
1267
|
(change)="change($event)"
|
|
1187
1268
|
/>
|
|
1188
|
-
`, 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"] }]
|
|
1189
|
-
}], ctorParameters: () => [], propDecorators: { query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }],
|
|
1269
|
+
`, 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{opacity:30%;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"] }]
|
|
1270
|
+
}], 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 }] }] } });
|
|
1190
1271
|
|
|
1191
1272
|
class UpRateGroupCodeSelectComponent extends UpFieldControlComponent {
|
|
1192
1273
|
constructor(service) {
|
|
1193
1274
|
super();
|
|
1194
1275
|
this.service = service;
|
|
1195
|
-
this.
|
|
1196
|
-
this.placeholder = input('Select rate group code', { ...(ngDevMode ? { debugName: "placeholder" } : {}) });
|
|
1276
|
+
this.placeholder = input('Select rate group code', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1197
1277
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
1278
|
+
this.appendTo = input('body', ...(ngDevMode ? [{ debugName: "appendTo" }] : []));
|
|
1198
1279
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
1199
1280
|
this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
1200
1281
|
this.clearable = input(true, { ...(ngDevMode ? { debugName: "clearable" } : {}), transform: booleanAttribute });
|
|
1201
|
-
this.value = model(null,
|
|
1282
|
+
this.value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1202
1283
|
this.changed = output();
|
|
1203
|
-
this.isLoading = signal(true,
|
|
1204
|
-
this._disabled = signal(false,
|
|
1205
|
-
this.rateGroupCodes = signal([],
|
|
1284
|
+
this.isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
1285
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1286
|
+
this.rateGroupCodes = signal([], ...(ngDevMode ? [{ debugName: "rateGroupCodes" }] : []));
|
|
1206
1287
|
this.queryFn = (keyword) => {
|
|
1207
1288
|
if (!keyword ||
|
|
1208
1289
|
keyword.length < 3) {
|
|
@@ -1263,8 +1344,8 @@ class UpRateGroupCodeSelectComponent extends UpFieldControlComponent {
|
|
|
1263
1344
|
this.changed.emit(value);
|
|
1264
1345
|
}
|
|
1265
1346
|
}
|
|
1266
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1267
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
1347
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpRateGroupCodeSelectComponent, deps: [{ token: i1$1.RateGroupCodeService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1348
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", 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: [
|
|
1268
1349
|
{
|
|
1269
1350
|
provide: UpFieldControl,
|
|
1270
1351
|
useExisting: forwardRef(() => UpRateGroupCodeSelectComponent),
|
|
@@ -1287,9 +1368,9 @@ class UpRateGroupCodeSelectComponent extends UpFieldControlComponent {
|
|
|
1287
1368
|
(blur)="onTouched()"
|
|
1288
1369
|
(changed)="change($event)"
|
|
1289
1370
|
/>
|
|
1290
|
-
`, isInline: true, dependencies: [{ kind: "component", type: UpSearchableSelectComponent, selector: "up-searchable-select", inputs: ["query", "label", "
|
|
1371
|
+
`, 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 }); }
|
|
1291
1372
|
}
|
|
1292
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpRateGroupCodeSelectComponent, decorators: [{
|
|
1293
1374
|
type: Component,
|
|
1294
1375
|
args: [{
|
|
1295
1376
|
standalone: true,
|
|
@@ -1327,26 +1408,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
1327
1408
|
/>
|
|
1328
1409
|
`,
|
|
1329
1410
|
}]
|
|
1330
|
-
}], ctorParameters: () => [{ type: i1$1.RateGroupCodeService }], propDecorators: {
|
|
1411
|
+
}], 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"] }] } });
|
|
1331
1412
|
|
|
1332
1413
|
class UpDatepickerComponent extends UpFieldControlComponent {
|
|
1333
1414
|
constructor() {
|
|
1334
1415
|
super();
|
|
1335
|
-
this.placeholder = input('',
|
|
1336
|
-
this.minDate = input(null,
|
|
1337
|
-
this.maxDate = input(null,
|
|
1416
|
+
this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1417
|
+
this.minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : []));
|
|
1418
|
+
this.maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : []));
|
|
1338
1419
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
1339
1420
|
this.dateFormat = input('dd LLL yyyy', { ...(ngDevMode ? { debugName: "dateFormat" } : {}), alias: 'format' });
|
|
1340
1421
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
1341
|
-
this.btnTrigger = viewChild('btnTrigger',
|
|
1342
|
-
this.value = signal(null,
|
|
1343
|
-
this._disabled = signal(false,
|
|
1422
|
+
this.btnTrigger = viewChild('btnTrigger', ...(ngDevMode ? [{ debugName: "btnTrigger" }] : []));
|
|
1423
|
+
this.value = signal(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1424
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1344
1425
|
this.formattedDate = computed(() => {
|
|
1345
1426
|
return this.value() ? format(this.value(), this.dateFormat()) : '';
|
|
1346
|
-
},
|
|
1427
|
+
}, ...(ngDevMode ? [{ debugName: "formattedDate" }] : []));
|
|
1347
1428
|
this._computedClass = computed(() => {
|
|
1348
1429
|
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());
|
|
1349
|
-
},
|
|
1430
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
1350
1431
|
this._isTouched = false;
|
|
1351
1432
|
this._onTouched = () => { };
|
|
1352
1433
|
this._onChange = () => { };
|
|
@@ -1381,8 +1462,8 @@ class UpDatepickerComponent extends UpFieldControlComponent {
|
|
|
1381
1462
|
this._onTouched();
|
|
1382
1463
|
this._isTouched = true;
|
|
1383
1464
|
}
|
|
1384
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1385
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.
|
|
1465
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpDatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1466
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.5", 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: [
|
|
1386
1467
|
{
|
|
1387
1468
|
provide: UpFieldControl,
|
|
1388
1469
|
useExisting: forwardRef(() => UpDatepickerComponent),
|
|
@@ -1426,7 +1507,7 @@ class UpDatepickerComponent extends UpFieldControlComponent {
|
|
|
1426
1507
|
</up-popover>
|
|
1427
1508
|
`, 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 }); }
|
|
1428
1509
|
}
|
|
1429
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1510
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpDatepickerComponent, decorators: [{
|
|
1430
1511
|
type: Component,
|
|
1431
1512
|
args: [{
|
|
1432
1513
|
standalone: true,
|
|
@@ -1490,20 +1571,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
1490
1571
|
class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
1491
1572
|
constructor() {
|
|
1492
1573
|
super();
|
|
1493
|
-
this.placeholder = input('',
|
|
1494
|
-
this.minDate = input(null,
|
|
1495
|
-
this.maxDate = input(null,
|
|
1574
|
+
this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1575
|
+
this.minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : []));
|
|
1576
|
+
this.maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : []));
|
|
1496
1577
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
1497
1578
|
this.dateFormat = input('dd LLL yyyy', { ...(ngDevMode ? { debugName: "dateFormat" } : {}), alias: 'format' });
|
|
1498
1579
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
1499
|
-
this._disabled = signal(false,
|
|
1500
|
-
this.value = signal({ from: null, to: null },
|
|
1580
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1581
|
+
this.value = signal({ from: null, to: null }, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1501
1582
|
this.formattedDate = computed(() => {
|
|
1502
1583
|
return this.value().from && this.value().to ? `${format(this.value().from, this.dateFormat())} - ${format(this.value().to, this.dateFormat())}` : '';
|
|
1503
|
-
},
|
|
1584
|
+
}, ...(ngDevMode ? [{ debugName: "formattedDate" }] : []));
|
|
1504
1585
|
this._computedClass = computed(() => {
|
|
1505
1586
|
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());
|
|
1506
|
-
},
|
|
1587
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
1507
1588
|
this._isTouched = false;
|
|
1508
1589
|
this._onTouched = () => { };
|
|
1509
1590
|
this._onChange = () => { };
|
|
@@ -1537,8 +1618,8 @@ class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
|
1537
1618
|
this._onTouched();
|
|
1538
1619
|
this._isTouched = true;
|
|
1539
1620
|
}
|
|
1540
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1541
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
1621
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpDateRangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1622
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", 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: [
|
|
1542
1623
|
{
|
|
1543
1624
|
provide: UpFieldControl,
|
|
1544
1625
|
useExisting: forwardRef(() => UpDateRangePickerComponent)
|
|
@@ -1583,7 +1664,7 @@ class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
|
1583
1664
|
</up-popover>
|
|
1584
1665
|
`, 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 }); }
|
|
1585
1666
|
}
|
|
1586
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
1667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpDateRangePickerComponent, decorators: [{
|
|
1587
1668
|
type: Component,
|
|
1588
1669
|
args: [{
|
|
1589
1670
|
standalone: true,
|
|
@@ -1645,16 +1726,654 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
1645
1726
|
}]
|
|
1646
1727
|
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], dateFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
1647
1728
|
|
|
1729
|
+
function updateScrollSelection(el, itemHeight, maxIndex, setIndex) {
|
|
1730
|
+
if (!el) {
|
|
1731
|
+
return;
|
|
1732
|
+
}
|
|
1733
|
+
const index = Math.round(el.scrollTop / itemHeight);
|
|
1734
|
+
setIndex(Math.max(0, Math.min(maxIndex, index)));
|
|
1735
|
+
}
|
|
1736
|
+
function snapScroll(el, itemHeight, index) {
|
|
1737
|
+
if (!el) {
|
|
1738
|
+
return;
|
|
1739
|
+
}
|
|
1740
|
+
el.scrollTo({
|
|
1741
|
+
behavior: 'smooth',
|
|
1742
|
+
top: index * itemHeight,
|
|
1743
|
+
});
|
|
1744
|
+
}
|
|
1745
|
+
function scrollImmediate(el, itemHeight, index) {
|
|
1746
|
+
if (!el) {
|
|
1747
|
+
return;
|
|
1748
|
+
}
|
|
1749
|
+
el.scrollTop = index * itemHeight;
|
|
1750
|
+
}
|
|
1751
|
+
function findClosestIndex(values, target) {
|
|
1752
|
+
let closestIdx = 0;
|
|
1753
|
+
let minDiff = Math.abs(values[0] - target);
|
|
1754
|
+
for (let i = 1; i < values.length; i++) {
|
|
1755
|
+
const diff = Math.abs(values[i] - target);
|
|
1756
|
+
if (diff < minDiff) {
|
|
1757
|
+
minDiff = diff;
|
|
1758
|
+
closestIdx = i;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
return closestIdx;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
class OpacityPipe {
|
|
1765
|
+
transform(itemIndex, selectedIndex) {
|
|
1766
|
+
const distance = Math.abs(itemIndex - selectedIndex);
|
|
1767
|
+
switch (distance) {
|
|
1768
|
+
case 0:
|
|
1769
|
+
return 'opacity-100';
|
|
1770
|
+
case 1:
|
|
1771
|
+
return 'opacity-20';
|
|
1772
|
+
case 2:
|
|
1773
|
+
return 'opacity-10';
|
|
1774
|
+
default:
|
|
1775
|
+
return 'opacity-15';
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: OpacityPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1779
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.5", ngImport: i0, type: OpacityPipe, isStandalone: true, name: "opacity" }); }
|
|
1780
|
+
}
|
|
1781
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: OpacityPipe, decorators: [{
|
|
1782
|
+
type: Pipe,
|
|
1783
|
+
args: [{
|
|
1784
|
+
name: 'opacity',
|
|
1785
|
+
pure: true,
|
|
1786
|
+
}]
|
|
1787
|
+
}] });
|
|
1788
|
+
|
|
1789
|
+
class UpTimeComponent {
|
|
1790
|
+
constructor() {
|
|
1791
|
+
this.hoursScroll = viewChild('hoursScroll', ...(ngDevMode ? [{ debugName: "hoursScroll" }] : []));
|
|
1792
|
+
this.minutesScroll = viewChild('minutesScroll', ...(ngDevMode ? [{ debugName: "minutesScroll" }] : []));
|
|
1793
|
+
this.minuteInterval = input(1, ...(ngDevMode ? [{ debugName: "minuteInterval" }] : []));
|
|
1794
|
+
this.minTime = input(...(ngDevMode ? [undefined, { debugName: "minTime" }] : []));
|
|
1795
|
+
this.maxTime = input(...(ngDevMode ? [undefined, { debugName: "maxTime" }] : []));
|
|
1796
|
+
this.value = input({ hour: 0, minute: 0 }, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1797
|
+
this.timeChanged = output();
|
|
1798
|
+
this.selectedHourIndex = signal(0, ...(ngDevMode ? [{ debugName: "selectedHourIndex" }] : []));
|
|
1799
|
+
this.selectedMinuteIndex = signal(0, ...(ngDevMode ? [{ debugName: "selectedMinuteIndex" }] : []));
|
|
1800
|
+
this.minHour = computed(() => this.minTime()?.hour ?? 0, ...(ngDevMode ? [{ debugName: "minHour" }] : []));
|
|
1801
|
+
this.maxHour = computed(() => this.maxTime()?.hour ?? 23, ...(ngDevMode ? [{ debugName: "maxHour" }] : []));
|
|
1802
|
+
this.minMinute = computed(() => this.minTime()?.minute ?? 0, ...(ngDevMode ? [{ debugName: "minMinute" }] : []));
|
|
1803
|
+
this.maxMinute = computed(() => this.maxTime()?.minute ?? 59, ...(ngDevMode ? [{ debugName: "maxMinute" }] : []));
|
|
1804
|
+
this.hours = Array.from({ length: 24 }, (_, i) => i);
|
|
1805
|
+
this.minutes = computed(() => {
|
|
1806
|
+
const interval = Math.max(1, Math.min(60, this.minuteInterval()));
|
|
1807
|
+
const count = Math.ceil(60 / interval);
|
|
1808
|
+
return Array.from({ length: count }, (_, i) => i * interval).filter((m) => m < 60);
|
|
1809
|
+
}, ...(ngDevMode ? [{ debugName: "minutes" }] : []));
|
|
1810
|
+
this.hourInvisible = computed(() => {
|
|
1811
|
+
return this.hours.map((hour) => {
|
|
1812
|
+
return hour < (this.minTime()?.hour ?? 0) ||
|
|
1813
|
+
hour > (this.maxTime()?.hour ?? 23);
|
|
1814
|
+
});
|
|
1815
|
+
}, ...(ngDevMode ? [{ debugName: "hourInvisible" }] : []));
|
|
1816
|
+
this.minuteInvisible = computed(() => {
|
|
1817
|
+
const selectedHour = this.hours[this.selectedHourIndex()] ?? 0;
|
|
1818
|
+
return this.minutes().map((minute) => (selectedHour === this.minHour() && minute < this.minMinute()) ||
|
|
1819
|
+
(selectedHour === this.maxHour() && minute > this.maxMinute()));
|
|
1820
|
+
}, ...(ngDevMode ? [{ debugName: "minuteInvisible" }] : []));
|
|
1821
|
+
this.validMinuteRange = computed(() => {
|
|
1822
|
+
const selectedHour = this.hours[this.selectedHourIndex()] ?? 0;
|
|
1823
|
+
let min = 0;
|
|
1824
|
+
let max = 59;
|
|
1825
|
+
if (selectedHour === this.minHour()) {
|
|
1826
|
+
min = this.minMinute();
|
|
1827
|
+
}
|
|
1828
|
+
if (selectedHour === this.maxHour()) {
|
|
1829
|
+
max = this.maxMinute();
|
|
1830
|
+
}
|
|
1831
|
+
return { min, max };
|
|
1832
|
+
}, ...(ngDevMode ? [{ debugName: "validMinuteRange" }] : []));
|
|
1833
|
+
this.itemHeight = 40;
|
|
1834
|
+
this.visibleItems = 5;
|
|
1835
|
+
this.containerHeight = this.itemHeight * this.visibleItems;
|
|
1836
|
+
this.padding = (this.itemHeight * this.visibleItems - this.itemHeight) / 2;
|
|
1837
|
+
this.highlightTop = this.padding;
|
|
1838
|
+
this.scrollTimeout = null;
|
|
1839
|
+
this.lastEmittedTime = null;
|
|
1840
|
+
afterNextRender(() => this.initializeScrollPosition());
|
|
1841
|
+
}
|
|
1842
|
+
initializeScrollPosition() {
|
|
1843
|
+
const hourIdx = this.hours.indexOf(this.value().hour);
|
|
1844
|
+
const minuteIdx = findClosestIndex(this.minutes(), this.value().minute);
|
|
1845
|
+
if (hourIdx !== -1) {
|
|
1846
|
+
this.selectedHourIndex.set(hourIdx);
|
|
1847
|
+
}
|
|
1848
|
+
this.selectedMinuteIndex.set(minuteIdx);
|
|
1849
|
+
this.scrollToHourImmediate(hourIdx);
|
|
1850
|
+
this.scrollToMinuteImmediate(minuteIdx);
|
|
1851
|
+
this.emitTime();
|
|
1852
|
+
}
|
|
1853
|
+
onHoursScroll() {
|
|
1854
|
+
this.updateHourSelection();
|
|
1855
|
+
this.debounceEmit();
|
|
1856
|
+
}
|
|
1857
|
+
onMinutesScroll() {
|
|
1858
|
+
this.updateMinuteSelection();
|
|
1859
|
+
this.debounceEmit();
|
|
1860
|
+
}
|
|
1861
|
+
debounceEmit() {
|
|
1862
|
+
clearTimeout(this.scrollTimeout);
|
|
1863
|
+
this.scrollTimeout = setTimeout(() => {
|
|
1864
|
+
this.clampSelectionToValidRange();
|
|
1865
|
+
this.emitTime();
|
|
1866
|
+
}, 150);
|
|
1867
|
+
}
|
|
1868
|
+
clampSelectionToValidRange() {
|
|
1869
|
+
const hours = this.hours;
|
|
1870
|
+
const minutes = this.minutes();
|
|
1871
|
+
let hourIdx = this.selectedHourIndex();
|
|
1872
|
+
const currentHour = hours[hourIdx] ?? 0;
|
|
1873
|
+
if (currentHour < this.minHour()) {
|
|
1874
|
+
hourIdx = hours.indexOf(this.minHour());
|
|
1875
|
+
if (hourIdx === -1) {
|
|
1876
|
+
for (let i = 0; i < hours.length; i++) {
|
|
1877
|
+
if (hours[i] >= this.minHour()) {
|
|
1878
|
+
hourIdx = i;
|
|
1879
|
+
break;
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
this.selectedHourIndex.set(hourIdx);
|
|
1884
|
+
this.scrollToHourImmediate(hourIdx);
|
|
1885
|
+
}
|
|
1886
|
+
else if (currentHour > this.maxHour()) {
|
|
1887
|
+
hourIdx = hours.indexOf(this.maxHour());
|
|
1888
|
+
if (hourIdx === -1) {
|
|
1889
|
+
for (let i = hours.length - 1; i >= 0; i--) {
|
|
1890
|
+
if (hours[i] <= this.maxHour()) {
|
|
1891
|
+
hourIdx = i;
|
|
1892
|
+
break;
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
this.selectedHourIndex.set(hourIdx);
|
|
1897
|
+
this.scrollToHourImmediate(hourIdx);
|
|
1898
|
+
}
|
|
1899
|
+
const { min: minMinute, max: maxMinute } = this.validMinuteRange();
|
|
1900
|
+
let minuteIdx = this.selectedMinuteIndex();
|
|
1901
|
+
const currentMinute = minutes[minuteIdx] ?? 0;
|
|
1902
|
+
if (currentMinute < minMinute) {
|
|
1903
|
+
let newIdx = -1;
|
|
1904
|
+
for (let i = 0; i < minutes.length; i++) {
|
|
1905
|
+
if (minutes[i] >= minMinute) {
|
|
1906
|
+
newIdx = i;
|
|
1907
|
+
break;
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
if (newIdx !== -1) {
|
|
1911
|
+
this.selectedMinuteIndex.set(newIdx);
|
|
1912
|
+
this.scrollToMinuteImmediate(newIdx);
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
else if (currentMinute > maxMinute) {
|
|
1916
|
+
let newIdx = -1;
|
|
1917
|
+
for (let i = minutes.length - 1; i >= 0; i--) {
|
|
1918
|
+
if (minutes[i] <= maxMinute) {
|
|
1919
|
+
newIdx = i;
|
|
1920
|
+
break;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
if (newIdx !== -1) {
|
|
1924
|
+
this.selectedMinuteIndex.set(newIdx);
|
|
1925
|
+
this.scrollToMinuteImmediate(newIdx);
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
updateHourSelection() {
|
|
1930
|
+
updateScrollSelection(this.hoursScroll().nativeElement, this.itemHeight, this.hours.length - 1, (v) => this.selectedHourIndex.set(v));
|
|
1931
|
+
}
|
|
1932
|
+
updateMinuteSelection() {
|
|
1933
|
+
updateScrollSelection(this.minutesScroll().nativeElement, this.itemHeight, this.minutes().length - 1, (v) => this.selectedMinuteIndex.set(v));
|
|
1934
|
+
}
|
|
1935
|
+
snapHours() {
|
|
1936
|
+
snapScroll(this.hoursScroll().nativeElement, this.itemHeight, this.selectedHourIndex());
|
|
1937
|
+
}
|
|
1938
|
+
snapMinutes() {
|
|
1939
|
+
snapScroll(this.minutesScroll().nativeElement, this.itemHeight, this.selectedMinuteIndex());
|
|
1940
|
+
}
|
|
1941
|
+
scrollToHour(index) {
|
|
1942
|
+
const clamped = Math.max(0, Math.min(23, index));
|
|
1943
|
+
this.selectedHourIndex.set(clamped);
|
|
1944
|
+
this.scrollToHourImmediate(clamped);
|
|
1945
|
+
this.emitTime();
|
|
1946
|
+
}
|
|
1947
|
+
scrollToMinute(index) {
|
|
1948
|
+
const maxIdx = this.minutes().length - 1;
|
|
1949
|
+
const clamped = Math.max(0, Math.min(maxIdx, index));
|
|
1950
|
+
this.selectedMinuteIndex.set(clamped);
|
|
1951
|
+
this.scrollToMinuteImmediate(clamped);
|
|
1952
|
+
this.emitTime();
|
|
1953
|
+
}
|
|
1954
|
+
scrollToHourImmediate(index) {
|
|
1955
|
+
scrollImmediate(this.hoursScroll().nativeElement, this.itemHeight, index);
|
|
1956
|
+
}
|
|
1957
|
+
scrollToMinuteImmediate(index) {
|
|
1958
|
+
scrollImmediate(this.minutesScroll().nativeElement, this.itemHeight, index);
|
|
1959
|
+
}
|
|
1960
|
+
clampTime(time) {
|
|
1961
|
+
let { hour, minute } = time;
|
|
1962
|
+
const min = this.minTime();
|
|
1963
|
+
const max = this.maxTime();
|
|
1964
|
+
if (min) {
|
|
1965
|
+
if (hour < (min.hour ?? 0)) {
|
|
1966
|
+
hour = min.hour;
|
|
1967
|
+
minute = min.minute ?? 0;
|
|
1968
|
+
}
|
|
1969
|
+
else if (hour === (min.hour ?? 0) && min.minute !== undefined) {
|
|
1970
|
+
minute = Math.max(min.minute, minute);
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
if (max) {
|
|
1974
|
+
if (hour > (max.hour ?? 23)) {
|
|
1975
|
+
hour = max.hour;
|
|
1976
|
+
minute = max.minute ?? 59;
|
|
1977
|
+
}
|
|
1978
|
+
else if (hour === (max.hour ?? 23) && max.minute !== undefined) {
|
|
1979
|
+
minute = Math.min(max.minute, minute);
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
const minuteValues = this.minutes();
|
|
1983
|
+
if (!minuteValues.includes(minute)) {
|
|
1984
|
+
let closest = minuteValues[0];
|
|
1985
|
+
let minDiff = Math.abs(minuteValues[0] - minute);
|
|
1986
|
+
for (let m of minuteValues) {
|
|
1987
|
+
const diff = Math.abs(m - minute);
|
|
1988
|
+
if (diff < minDiff) {
|
|
1989
|
+
closest = m;
|
|
1990
|
+
minDiff = diff;
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
minute = closest;
|
|
1994
|
+
}
|
|
1995
|
+
return { hour, minute };
|
|
1996
|
+
}
|
|
1997
|
+
emitTime() {
|
|
1998
|
+
let time = {
|
|
1999
|
+
hour: this.hours[this.selectedHourIndex()],
|
|
2000
|
+
minute: this.minutes()[this.selectedMinuteIndex()],
|
|
2001
|
+
};
|
|
2002
|
+
time = this.clampTime(time);
|
|
2003
|
+
if (!this.lastEmittedTime ||
|
|
2004
|
+
this.lastEmittedTime.hour !== time.hour ||
|
|
2005
|
+
this.lastEmittedTime.minute !== time.minute) {
|
|
2006
|
+
this.lastEmittedTime = time;
|
|
2007
|
+
this.timeChanged.emit(time);
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpTimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2011
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: UpTimeComponent, isStandalone: true, selector: "up-time", inputs: { minuteInterval: { classPropertyName: "minuteInterval", publicName: "minuteInterval", isSignal: true, isRequired: false, transformFunction: null }, minTime: { classPropertyName: "minTime", publicName: "minTime", isSignal: true, isRequired: false, transformFunction: null }, maxTime: { classPropertyName: "maxTime", publicName: "maxTime", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { timeChanged: "timeChanged" }, viewQueries: [{ propertyName: "hoursScroll", first: true, predicate: ["hoursScroll"], descendants: true, isSignal: true }, { propertyName: "minutesScroll", first: true, predicate: ["minutesScroll"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2012
|
+
<div
|
|
2013
|
+
class="relative w-37 flex gap-2 rounded-xl border border-border bg-white p-3 shadow-lg"
|
|
2014
|
+
[style.height.px]="containerHeight"
|
|
2015
|
+
>
|
|
2016
|
+
<!-- Hours scroll wheel -->
|
|
2017
|
+
<div class="flex-1 relative overflow-hidden">
|
|
2018
|
+
<div
|
|
2019
|
+
class="
|
|
2020
|
+
h-full overflow-y-scroll snap-y snap-mandatory overscroll-contain
|
|
2021
|
+
[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]
|
|
2022
|
+
"
|
|
2023
|
+
(scroll)="onHoursScroll()"
|
|
2024
|
+
|
|
2025
|
+
#hoursScroll
|
|
2026
|
+
>
|
|
2027
|
+
<!-- Top padding -->
|
|
2028
|
+
<div [style.height.px]="padding"></div>
|
|
2029
|
+
|
|
2030
|
+
<!-- Hour items -->
|
|
2031
|
+
@for (hour of hours; track $index) {
|
|
2032
|
+
<div
|
|
2033
|
+
[class.invisible]="hourInvisible()[$index]"
|
|
2034
|
+
[class]="
|
|
2035
|
+
'h-10 flex items-center justify-center cursor-pointer transition-opacity duration-200 snap-center ' +
|
|
2036
|
+
($index | opacity: selectedHourIndex())
|
|
2037
|
+
"
|
|
2038
|
+
(click)="scrollToHour($index)"
|
|
2039
|
+
>
|
|
2040
|
+
<span class="text-xl font-medium">
|
|
2041
|
+
{{ hour | number:'2.0-0' }}
|
|
2042
|
+
</span>
|
|
2043
|
+
</div>
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
<!-- Bottom padding -->
|
|
2047
|
+
<div [style.height.px]="padding"></div>
|
|
2048
|
+
</div>
|
|
2049
|
+
</div>
|
|
2050
|
+
|
|
2051
|
+
<!-- Minutes scroll wheel -->
|
|
2052
|
+
<div class="flex-1 relative overflow-hidden">
|
|
2053
|
+
<div
|
|
2054
|
+
#minutesScroll
|
|
2055
|
+
class="
|
|
2056
|
+
h-full overflow-y-scroll snap-y snap-mandatory overscroll-contain
|
|
2057
|
+
[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]
|
|
2058
|
+
"
|
|
2059
|
+
(scroll)="onMinutesScroll()"
|
|
2060
|
+
>
|
|
2061
|
+
<!-- Top padding -->
|
|
2062
|
+
<div [style.height.px]="padding"></div>
|
|
2063
|
+
|
|
2064
|
+
<!-- Minute items -->
|
|
2065
|
+
@for (minute of minutes(); track $index) {
|
|
2066
|
+
<div
|
|
2067
|
+
[class.invisible]="minuteInvisible()[$index]"
|
|
2068
|
+
[class]="
|
|
2069
|
+
'h-10 flex items-center justify-center cursor-pointer transition-opacity duration-200 snap-center ' +
|
|
2070
|
+
($index | opacity: selectedMinuteIndex())
|
|
2071
|
+
"
|
|
2072
|
+
(click)="scrollToMinute($index)"
|
|
2073
|
+
>
|
|
2074
|
+
<span class="text-xl font-medium">
|
|
2075
|
+
{{ minute | number:'2.0-0' }}
|
|
2076
|
+
</span>
|
|
2077
|
+
</div>
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
<!-- Bottom padding -->
|
|
2081
|
+
<div [style.height.px]="padding"></div>
|
|
2082
|
+
</div>
|
|
2083
|
+
</div>
|
|
2084
|
+
|
|
2085
|
+
<!-- Center highlight -->
|
|
2086
|
+
<div
|
|
2087
|
+
class="absolute inset-x-0 left-3 right-3 pointer-events-none flex items-center justify-center"
|
|
2088
|
+
[style.top.px]="highlightTop"
|
|
2089
|
+
[style.height.px]="itemHeight"
|
|
2090
|
+
>
|
|
2091
|
+
<div class="flex items-center justify-center font-medium w-full h-full bg-accent/30 border border-primary rounded-md shadow-inner">
|
|
2092
|
+
:
|
|
2093
|
+
</div>
|
|
2094
|
+
</div>
|
|
2095
|
+
</div>
|
|
2096
|
+
`, isInline: true, dependencies: [{ kind: "pipe", type: DecimalPipe, name: "number" }, { kind: "pipe", type: OpacityPipe, name: "opacity" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2097
|
+
}
|
|
2098
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpTimeComponent, decorators: [{
|
|
2099
|
+
type: Component,
|
|
2100
|
+
args: [{
|
|
2101
|
+
selector: 'up-time',
|
|
2102
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2103
|
+
imports: [
|
|
2104
|
+
DecimalPipe,
|
|
2105
|
+
OpacityPipe,
|
|
2106
|
+
],
|
|
2107
|
+
template: `
|
|
2108
|
+
<div
|
|
2109
|
+
class="relative w-37 flex gap-2 rounded-xl border border-border bg-white p-3 shadow-lg"
|
|
2110
|
+
[style.height.px]="containerHeight"
|
|
2111
|
+
>
|
|
2112
|
+
<!-- Hours scroll wheel -->
|
|
2113
|
+
<div class="flex-1 relative overflow-hidden">
|
|
2114
|
+
<div
|
|
2115
|
+
class="
|
|
2116
|
+
h-full overflow-y-scroll snap-y snap-mandatory overscroll-contain
|
|
2117
|
+
[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]
|
|
2118
|
+
"
|
|
2119
|
+
(scroll)="onHoursScroll()"
|
|
2120
|
+
|
|
2121
|
+
#hoursScroll
|
|
2122
|
+
>
|
|
2123
|
+
<!-- Top padding -->
|
|
2124
|
+
<div [style.height.px]="padding"></div>
|
|
2125
|
+
|
|
2126
|
+
<!-- Hour items -->
|
|
2127
|
+
@for (hour of hours; track $index) {
|
|
2128
|
+
<div
|
|
2129
|
+
[class.invisible]="hourInvisible()[$index]"
|
|
2130
|
+
[class]="
|
|
2131
|
+
'h-10 flex items-center justify-center cursor-pointer transition-opacity duration-200 snap-center ' +
|
|
2132
|
+
($index | opacity: selectedHourIndex())
|
|
2133
|
+
"
|
|
2134
|
+
(click)="scrollToHour($index)"
|
|
2135
|
+
>
|
|
2136
|
+
<span class="text-xl font-medium">
|
|
2137
|
+
{{ hour | number:'2.0-0' }}
|
|
2138
|
+
</span>
|
|
2139
|
+
</div>
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
<!-- Bottom padding -->
|
|
2143
|
+
<div [style.height.px]="padding"></div>
|
|
2144
|
+
</div>
|
|
2145
|
+
</div>
|
|
2146
|
+
|
|
2147
|
+
<!-- Minutes scroll wheel -->
|
|
2148
|
+
<div class="flex-1 relative overflow-hidden">
|
|
2149
|
+
<div
|
|
2150
|
+
#minutesScroll
|
|
2151
|
+
class="
|
|
2152
|
+
h-full overflow-y-scroll snap-y snap-mandatory overscroll-contain
|
|
2153
|
+
[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]
|
|
2154
|
+
"
|
|
2155
|
+
(scroll)="onMinutesScroll()"
|
|
2156
|
+
>
|
|
2157
|
+
<!-- Top padding -->
|
|
2158
|
+
<div [style.height.px]="padding"></div>
|
|
2159
|
+
|
|
2160
|
+
<!-- Minute items -->
|
|
2161
|
+
@for (minute of minutes(); track $index) {
|
|
2162
|
+
<div
|
|
2163
|
+
[class.invisible]="minuteInvisible()[$index]"
|
|
2164
|
+
[class]="
|
|
2165
|
+
'h-10 flex items-center justify-center cursor-pointer transition-opacity duration-200 snap-center ' +
|
|
2166
|
+
($index | opacity: selectedMinuteIndex())
|
|
2167
|
+
"
|
|
2168
|
+
(click)="scrollToMinute($index)"
|
|
2169
|
+
>
|
|
2170
|
+
<span class="text-xl font-medium">
|
|
2171
|
+
{{ minute | number:'2.0-0' }}
|
|
2172
|
+
</span>
|
|
2173
|
+
</div>
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2176
|
+
<!-- Bottom padding -->
|
|
2177
|
+
<div [style.height.px]="padding"></div>
|
|
2178
|
+
</div>
|
|
2179
|
+
</div>
|
|
2180
|
+
|
|
2181
|
+
<!-- Center highlight -->
|
|
2182
|
+
<div
|
|
2183
|
+
class="absolute inset-x-0 left-3 right-3 pointer-events-none flex items-center justify-center"
|
|
2184
|
+
[style.top.px]="highlightTop"
|
|
2185
|
+
[style.height.px]="itemHeight"
|
|
2186
|
+
>
|
|
2187
|
+
<div class="flex items-center justify-center font-medium w-full h-full bg-accent/30 border border-primary rounded-md shadow-inner">
|
|
2188
|
+
:
|
|
2189
|
+
</div>
|
|
2190
|
+
</div>
|
|
2191
|
+
</div>
|
|
2192
|
+
`,
|
|
2193
|
+
}]
|
|
2194
|
+
}], ctorParameters: () => [], propDecorators: { hoursScroll: [{ type: i0.ViewChild, args: ['hoursScroll', { isSignal: true }] }], minutesScroll: [{ type: i0.ViewChild, args: ['minutesScroll', { isSignal: true }] }], minuteInterval: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteInterval", required: false }] }], minTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "minTime", required: false }] }], maxTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTime", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], timeChanged: [{ type: i0.Output, args: ["timeChanged"] }] } });
|
|
2195
|
+
|
|
2196
|
+
class UpTimepickerComponent extends UpFieldControlComponent {
|
|
2197
|
+
constructor() {
|
|
2198
|
+
super();
|
|
2199
|
+
this.minTime = input(...(ngDevMode ? [undefined, { debugName: "minTime" }] : []));
|
|
2200
|
+
this.maxTime = input(...(ngDevMode ? [undefined, { debugName: "maxTime" }] : []));
|
|
2201
|
+
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
2202
|
+
this.initialHour = input(0, ...(ngDevMode ? [{ debugName: "initialHour" }] : []));
|
|
2203
|
+
this.initialMinute = input(0, ...(ngDevMode ? [{ debugName: "initialMinute" }] : []));
|
|
2204
|
+
this.minuteInterval = input(1, ...(ngDevMode ? [{ debugName: "minuteInterval" }] : []));
|
|
2205
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
2206
|
+
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
2207
|
+
this.value = signal({ hour: 0, minute: 0 }, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
2208
|
+
this.formattedTime = computed(() => {
|
|
2209
|
+
const time = this.value();
|
|
2210
|
+
if (!time) {
|
|
2211
|
+
return '--:--';
|
|
2212
|
+
}
|
|
2213
|
+
const hour = time.hour ?? 0;
|
|
2214
|
+
const minute = time.minute ?? 0;
|
|
2215
|
+
return `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
|
|
2216
|
+
}, ...(ngDevMode ? [{ debugName: "formattedTime" }] : []));
|
|
2217
|
+
this._computedClass = computed(() => {
|
|
2218
|
+
return up('flex justify-between px-3 border border-border min-w-40 w-full font-normal hover:not-disabled:text-primary! data-[has-value=false]:text-muted-foreground', this.inlineClass());
|
|
2219
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
2220
|
+
this._isTouched = false;
|
|
2221
|
+
this._onTouched = () => { };
|
|
2222
|
+
this._onChange = () => { };
|
|
2223
|
+
if (this.ngControl !== null) {
|
|
2224
|
+
this.ngControl.valueAccessor = this;
|
|
2225
|
+
}
|
|
2226
|
+
effect(() => {
|
|
2227
|
+
if (!this.ngControl) {
|
|
2228
|
+
this.value.set({
|
|
2229
|
+
hour: this.initialHour(),
|
|
2230
|
+
minute: this.initialMinute(),
|
|
2231
|
+
});
|
|
2232
|
+
}
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2235
|
+
registerOnChange(fn) {
|
|
2236
|
+
this._onChange = fn;
|
|
2237
|
+
}
|
|
2238
|
+
registerOnTouched(fn) {
|
|
2239
|
+
this._onTouched = fn;
|
|
2240
|
+
}
|
|
2241
|
+
touch() {
|
|
2242
|
+
this._markTouched();
|
|
2243
|
+
}
|
|
2244
|
+
setDisabledState(isDisabled) {
|
|
2245
|
+
this._disabled.set(isDisabled);
|
|
2246
|
+
}
|
|
2247
|
+
writeValue(value) {
|
|
2248
|
+
this.value.set(value);
|
|
2249
|
+
}
|
|
2250
|
+
selectedTime(time) {
|
|
2251
|
+
this._markTouched();
|
|
2252
|
+
this.value.set(time);
|
|
2253
|
+
this._onChange(time);
|
|
2254
|
+
}
|
|
2255
|
+
_markTouched() {
|
|
2256
|
+
if (this._isTouched) {
|
|
2257
|
+
return;
|
|
2258
|
+
}
|
|
2259
|
+
this._onTouched();
|
|
2260
|
+
this._isTouched = true;
|
|
2261
|
+
}
|
|
2262
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpTimepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2263
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", type: UpTimepickerComponent, isStandalone: true, selector: "up-timepicker", inputs: { minTime: { classPropertyName: "minTime", publicName: "minTime", isSignal: true, isRequired: false, transformFunction: null }, maxTime: { classPropertyName: "maxTime", publicName: "maxTime", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, initialHour: { classPropertyName: "initialHour", publicName: "initialHour", isSignal: true, isRequired: false, transformFunction: null }, initialMinute: { classPropertyName: "initialMinute", publicName: "initialMinute", isSignal: true, isRequired: false, transformFunction: null }, minuteInterval: { classPropertyName: "minuteInterval", publicName: "minuteInterval", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
2264
|
+
{
|
|
2265
|
+
provide: UpFieldControl,
|
|
2266
|
+
useExisting: forwardRef(() => UpTimepickerComponent),
|
|
2267
|
+
},
|
|
2268
|
+
provideIcons({
|
|
2269
|
+
matWatchLaterRound,
|
|
2270
|
+
}),
|
|
2271
|
+
], usesInheritance: true, ngImport: i0, template: `
|
|
2272
|
+
<up-popover placementOffset="4">
|
|
2273
|
+
<button
|
|
2274
|
+
upButton
|
|
2275
|
+
upPopoverTrigger
|
|
2276
|
+
type="button"
|
|
2277
|
+
variant="ghost"
|
|
2278
|
+
|
|
2279
|
+
[class]="_computedClass()"
|
|
2280
|
+
[disabled]="disabled() || _disabled()"
|
|
2281
|
+
[attr.data-has-value]="value() ? true : false"
|
|
2282
|
+
|
|
2283
|
+
(blur)="touch()"
|
|
2284
|
+
>
|
|
2285
|
+
{{ formattedTime() }}
|
|
2286
|
+
|
|
2287
|
+
<ng-icon size="16" class="ml-auto" name="matWatchLaterRound" />
|
|
2288
|
+
</button>
|
|
2289
|
+
|
|
2290
|
+
<ng-container *upPopoverContentRef>
|
|
2291
|
+
<div
|
|
2292
|
+
animate.enter="animate-in fade-in"
|
|
2293
|
+
animate.leave="animate-out fade-out"
|
|
2294
|
+
>
|
|
2295
|
+
<up-time
|
|
2296
|
+
[value]="value()"
|
|
2297
|
+
[minTime]="minTime()"
|
|
2298
|
+
[maxTime]="maxTime()"
|
|
2299
|
+
[minuteInterval]="minuteInterval()"
|
|
2300
|
+
(timeChanged)="selectedTime($event)"
|
|
2301
|
+
/>
|
|
2302
|
+
</div>
|
|
2303
|
+
</ng-container>
|
|
2304
|
+
</up-popover>
|
|
2305
|
+
`, 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: "directive", type: UpPopoverTriggerDirective, selector: "[upPopoverTrigger]", exportAs: ["upPopoverTrigger"] }, { kind: "directive", type: UpPopoverContentRefDirective, selector: "[upPopoverContentRef]", exportAs: ["upPopoverContentRef"] }, { kind: "component", type: UpTimeComponent, selector: "up-time", inputs: ["minuteInterval", "minTime", "maxTime", "value"], outputs: ["timeChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2306
|
+
}
|
|
2307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpTimepickerComponent, decorators: [{
|
|
2308
|
+
type: Component,
|
|
2309
|
+
args: [{
|
|
2310
|
+
selector: 'up-timepicker',
|
|
2311
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2312
|
+
providers: [
|
|
2313
|
+
{
|
|
2314
|
+
provide: UpFieldControl,
|
|
2315
|
+
useExisting: forwardRef(() => UpTimepickerComponent),
|
|
2316
|
+
},
|
|
2317
|
+
provideIcons({
|
|
2318
|
+
matWatchLaterRound,
|
|
2319
|
+
}),
|
|
2320
|
+
],
|
|
2321
|
+
imports: [
|
|
2322
|
+
NgIcon,
|
|
2323
|
+
UpButtonDirective,
|
|
2324
|
+
UpPopoverComponent,
|
|
2325
|
+
UpPopoverTriggerDirective,
|
|
2326
|
+
UpPopoverContentRefDirective,
|
|
2327
|
+
UpTimeComponent,
|
|
2328
|
+
],
|
|
2329
|
+
template: `
|
|
2330
|
+
<up-popover placementOffset="4">
|
|
2331
|
+
<button
|
|
2332
|
+
upButton
|
|
2333
|
+
upPopoverTrigger
|
|
2334
|
+
type="button"
|
|
2335
|
+
variant="ghost"
|
|
2336
|
+
|
|
2337
|
+
[class]="_computedClass()"
|
|
2338
|
+
[disabled]="disabled() || _disabled()"
|
|
2339
|
+
[attr.data-has-value]="value() ? true : false"
|
|
2340
|
+
|
|
2341
|
+
(blur)="touch()"
|
|
2342
|
+
>
|
|
2343
|
+
{{ formattedTime() }}
|
|
2344
|
+
|
|
2345
|
+
<ng-icon size="16" class="ml-auto" name="matWatchLaterRound" />
|
|
2346
|
+
</button>
|
|
2347
|
+
|
|
2348
|
+
<ng-container *upPopoverContentRef>
|
|
2349
|
+
<div
|
|
2350
|
+
animate.enter="animate-in fade-in"
|
|
2351
|
+
animate.leave="animate-out fade-out"
|
|
2352
|
+
>
|
|
2353
|
+
<up-time
|
|
2354
|
+
[value]="value()"
|
|
2355
|
+
[minTime]="minTime()"
|
|
2356
|
+
[maxTime]="maxTime()"
|
|
2357
|
+
[minuteInterval]="minuteInterval()"
|
|
2358
|
+
(timeChanged)="selectedTime($event)"
|
|
2359
|
+
/>
|
|
2360
|
+
</div>
|
|
2361
|
+
</ng-container>
|
|
2362
|
+
</up-popover>
|
|
2363
|
+
`,
|
|
2364
|
+
}]
|
|
2365
|
+
}], ctorParameters: () => [], propDecorators: { minTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "minTime", required: false }] }], maxTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTime", required: false }] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], initialHour: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialHour", required: false }] }], initialMinute: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialMinute", required: false }] }], minuteInterval: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteInterval", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
2366
|
+
|
|
1648
2367
|
class UpFormFieldComponent {
|
|
1649
2368
|
constructor() {
|
|
1650
|
-
this.name = input('',
|
|
1651
|
-
this.hint = input('',
|
|
1652
|
-
this.label = input('',
|
|
2369
|
+
this.name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
2370
|
+
this.hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
2371
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1653
2372
|
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
1654
|
-
this.control = contentChild(UpFieldControl,
|
|
2373
|
+
this.control = contentChild(UpFieldControl, ...(ngDevMode ? [{ debugName: "control" }] : []));
|
|
1655
2374
|
this._computedClass = computed(() => {
|
|
1656
2375
|
return up('block space-y-2', this.inlineClass());
|
|
1657
|
-
},
|
|
2376
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
1658
2377
|
effect(() => {
|
|
1659
2378
|
if (!this.control()) {
|
|
1660
2379
|
throw new Error('Form field must contain a field control, eg: input, checkbox, textarea, etc.');
|
|
@@ -1662,17 +2381,22 @@ class UpFormFieldComponent {
|
|
|
1662
2381
|
this.control().setControlName(this.label());
|
|
1663
2382
|
});
|
|
1664
2383
|
}
|
|
1665
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
1666
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
2384
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2385
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", 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: `
|
|
1667
2386
|
<div
|
|
1668
2387
|
class="
|
|
1669
2388
|
group flex flex-col gap-2
|
|
2389
|
+
has-[input[type='radio']]:flex-row has-[input[type='radio']]:items-center
|
|
1670
2390
|
has-[input[type='checkbox']]:flex-row has-[input[type='checkbox']]:items-center
|
|
1671
2391
|
"
|
|
2392
|
+
[attr.data-state]="control()?.error()? 'error' : 'default'"
|
|
1672
2393
|
>
|
|
1673
2394
|
@if (label()) {
|
|
1674
2395
|
<label
|
|
1675
|
-
class="
|
|
2396
|
+
class="
|
|
2397
|
+
text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 select-none
|
|
2398
|
+
group-has-[input[type='checkbox']]:order-2 group-has-[input[type='radio']]:order-2
|
|
2399
|
+
"
|
|
1676
2400
|
[for]="name()"
|
|
1677
2401
|
[class.text-destructive]="control()?.error()"
|
|
1678
2402
|
>
|
|
@@ -1695,7 +2419,7 @@ class UpFormFieldComponent {
|
|
|
1695
2419
|
}
|
|
1696
2420
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1697
2421
|
}
|
|
1698
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
2422
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpFormFieldComponent, decorators: [{
|
|
1699
2423
|
type: Component,
|
|
1700
2424
|
args: [{
|
|
1701
2425
|
standalone: true,
|
|
@@ -1708,12 +2432,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
1708
2432
|
<div
|
|
1709
2433
|
class="
|
|
1710
2434
|
group flex flex-col gap-2
|
|
2435
|
+
has-[input[type='radio']]:flex-row has-[input[type='radio']]:items-center
|
|
1711
2436
|
has-[input[type='checkbox']]:flex-row has-[input[type='checkbox']]:items-center
|
|
1712
2437
|
"
|
|
2438
|
+
[attr.data-state]="control()?.error()? 'error' : 'default'"
|
|
1713
2439
|
>
|
|
1714
2440
|
@if (label()) {
|
|
1715
2441
|
<label
|
|
1716
|
-
class="
|
|
2442
|
+
class="
|
|
2443
|
+
text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 select-none
|
|
2444
|
+
group-has-[input[type='checkbox']]:order-2 group-has-[input[type='radio']]:order-2
|
|
2445
|
+
"
|
|
1717
2446
|
[for]="name()"
|
|
1718
2447
|
[class.text-destructive]="control()?.error()"
|
|
1719
2448
|
>
|
|
@@ -1738,6 +2467,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
1738
2467
|
}]
|
|
1739
2468
|
}], 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 }] }] } });
|
|
1740
2469
|
|
|
2470
|
+
class UpImagePickerComponent extends UpFieldControlComponent {
|
|
2471
|
+
constructor() {
|
|
2472
|
+
super();
|
|
2473
|
+
this.ratio = input('1/1', ...(ngDevMode ? [{ debugName: "ratio" }] : []));
|
|
2474
|
+
this.imgSrc = model('', { ...(ngDevMode ? { debugName: "imgSrc" } : {}), alias: 'src' });
|
|
2475
|
+
this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
|
|
2476
|
+
this.changed = output();
|
|
2477
|
+
this.file = viewChild('file', ...(ngDevMode ? [{ debugName: "file" }] : []));
|
|
2478
|
+
this.fileName = '';
|
|
2479
|
+
this.isTouched = signal(false, ...(ngDevMode ? [{ debugName: "isTouched" }] : []));
|
|
2480
|
+
this._computedClass = computed(() => {
|
|
2481
|
+
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());
|
|
2482
|
+
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
2483
|
+
this._onTouched = () => { };
|
|
2484
|
+
this._onChange = (_val) => { };
|
|
2485
|
+
if (this.ngControl !== null) {
|
|
2486
|
+
this.ngControl.valueAccessor = this;
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
ngOnDestroy() {
|
|
2490
|
+
if (this.imgSrc()) {
|
|
2491
|
+
URL.revokeObjectURL(this.imgSrc());
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
registerOnChange(fn) {
|
|
2495
|
+
this._onChange = fn;
|
|
2496
|
+
}
|
|
2497
|
+
registerOnTouched(fn) {
|
|
2498
|
+
this._onTouched = fn;
|
|
2499
|
+
}
|
|
2500
|
+
writeValue(val) {
|
|
2501
|
+
this.imgSrc.set(val);
|
|
2502
|
+
}
|
|
2503
|
+
clear(ev) {
|
|
2504
|
+
this.writeValue('');
|
|
2505
|
+
ev?.stopPropagation();
|
|
2506
|
+
}
|
|
2507
|
+
touch() {
|
|
2508
|
+
if (!this.isTouched()) {
|
|
2509
|
+
this._onTouched();
|
|
2510
|
+
this.isTouched.set(true);
|
|
2511
|
+
}
|
|
2512
|
+
this.imgSrc.set(this.imgSrc());
|
|
2513
|
+
}
|
|
2514
|
+
async selectPhoto(files) {
|
|
2515
|
+
if (files?.target?.files)
|
|
2516
|
+
files = files.target.files;
|
|
2517
|
+
if (files && files[0]) {
|
|
2518
|
+
const compressedFile = await compressImage({
|
|
2519
|
+
quality: 0.8,
|
|
2520
|
+
file: files[0],
|
|
2521
|
+
});
|
|
2522
|
+
if (this.file()) {
|
|
2523
|
+
this.file().nativeElement.value = '';
|
|
2524
|
+
}
|
|
2525
|
+
this.imgSrc.set(URL.createObjectURL(compressedFile));
|
|
2526
|
+
this.fileName = compressedFile.name;
|
|
2527
|
+
this.changed.emit(compressedFile);
|
|
2528
|
+
this._onChange(compressedFile);
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpImagePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2532
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", 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: [
|
|
2533
|
+
{
|
|
2534
|
+
provide: UpFieldControl,
|
|
2535
|
+
useExisting: forwardRef(() => UpImagePickerComponent)
|
|
2536
|
+
},
|
|
2537
|
+
provideIcons({
|
|
2538
|
+
matUpload,
|
|
2539
|
+
matDelete
|
|
2540
|
+
})
|
|
2541
|
+
], 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 }); }
|
|
2542
|
+
}
|
|
2543
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: UpImagePickerComponent, decorators: [{
|
|
2544
|
+
type: Component,
|
|
2545
|
+
args: [{ standalone: true, selector: 'up-image-picker', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2546
|
+
{
|
|
2547
|
+
provide: UpFieldControl,
|
|
2548
|
+
useExisting: forwardRef(() => UpImagePickerComponent)
|
|
2549
|
+
},
|
|
2550
|
+
provideIcons({
|
|
2551
|
+
matUpload,
|
|
2552
|
+
matDelete
|
|
2553
|
+
})
|
|
2554
|
+
], imports: [
|
|
2555
|
+
NgIcon,
|
|
2556
|
+
UpFileDragNDropDirective
|
|
2557
|
+
], 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" }]
|
|
2558
|
+
}], 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 }] }] } });
|
|
2559
|
+
|
|
1741
2560
|
function setValidator(form, keys, validators) {
|
|
1742
2561
|
if (!keys.length ||
|
|
1743
2562
|
keys.length === 1) {
|
|
@@ -1937,5 +2756,5 @@ function isNotEqualValidator(controlNames, message) {
|
|
|
1937
2756
|
* Generated bundle index. Do not edit.
|
|
1938
2757
|
*/
|
|
1939
2758
|
|
|
1940
|
-
export { UpCheckboxDirective, UpCountrySelectComponent, UpCurrencySelectComponent, UpDateRangePickerComponent, UpDatepickerComponent, UpFieldControl, UpFieldControlComponent, UpFormFieldComponent, UpInputDirective, UpNumberDirective, UpPasswordComponent, UpRateGroupCodeSelectComponent, UpSearchableSelectComponent, UpSelectComponent, UpSwitchComponent, isEqualValidator, isNotEqualValidator, setValidator, toggleFormControls, validRangeValidator };
|
|
2759
|
+
export { UpCheckboxDirective, UpCountrySelectComponent, UpCurrencySelectComponent, UpDateRangePickerComponent, UpDatepickerComponent, UpFieldControl, UpFieldControlComponent, UpFormFieldComponent, UpImagePickerComponent, UpInputDirective, UpNumberDirective, UpOptionComponent, UpPasswordComponent, UpRadioDirective, UpRateGroupCodeSelectComponent, UpSearchableSelectComponent, UpSelectComponent, UpSwitchComponent, UpTimeComponent, UpTimepickerComponent, isEqualValidator, isNotEqualValidator, setValidator, toggleFormControls, validRangeValidator };
|
|
1941
2760
|
//# sourceMappingURL=unipin-angular-applet-forms.mjs.map
|