@unipin/angular-applet 21.6.1 → 21.6.5
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/fesm2022/unipin-angular-applet-accordion.mjs +29 -17
- package/fesm2022/unipin-angular-applet-accordion.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-alert-dialog.mjs +7 -7
- package/fesm2022/unipin-angular-applet-alert-dialog.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-alert.mjs +9 -9
- 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-BYf0y6cO.mjs → unipin-angular-applet-audit-audit-modal.component-Fhzj6tsh.mjs} +4 -4
- package/fesm2022/{unipin-angular-applet-audit-audit-modal.component-BYf0y6cO.mjs.map → unipin-angular-applet-audit-audit-modal.component-Fhzj6tsh.mjs.map} +1 -1
- package/fesm2022/unipin-angular-applet-audit.mjs +11 -12
- package/fesm2022/unipin-angular-applet-audit.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-auth.mjs +51 -39
- package/fesm2022/unipin-angular-applet-auth.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-avatar.mjs +7 -10
- package/fesm2022/unipin-angular-applet-avatar.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-badge.mjs +6 -3
- package/fesm2022/unipin-angular-applet-badge.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-buttons.mjs +6 -6
- package/fesm2022/unipin-angular-applet-calendar.mjs +13 -13
- package/fesm2022/unipin-angular-applet-calendar.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-collapsible.mjs +9 -9
- package/fesm2022/unipin-angular-applet-common.mjs +40 -39
- package/fesm2022/unipin-angular-applet-common.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-containers.mjs +18 -18
- package/fesm2022/unipin-angular-applet-containers.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-dialog.mjs +22 -22
- package/fesm2022/unipin-angular-applet-dialog.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-forms.mjs +469 -374
- package/fesm2022/unipin-angular-applet-forms.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-froala.mjs +14 -15
- package/fesm2022/unipin-angular-applet-froala.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-grids.mjs +19 -19
- package/fesm2022/unipin-angular-applet-grids.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-infinite-scroll.mjs +3 -3
- package/fesm2022/unipin-angular-applet-json-viewer.mjs +3 -3
- package/fesm2022/unipin-angular-applet-kbd.mjs +3 -3
- package/fesm2022/unipin-angular-applet-loading-dialog.mjs +6 -6
- package/fesm2022/unipin-angular-applet-markdown.mjs +20 -22
- package/fesm2022/unipin-angular-applet-markdown.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-micro-frontend.mjs +3 -3
- package/fesm2022/unipin-angular-applet-micro-frontend.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-popover.mjs +19 -15
- package/fesm2022/unipin-angular-applet-popover.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-progress-bar.mjs +14 -4
- package/fesm2022/unipin-angular-applet-progress-bar.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-skeleton.mjs +3 -3
- package/fesm2022/unipin-angular-applet-spinner.mjs +16 -20
- package/fesm2022/unipin-angular-applet-spinner.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-stepper.mjs +17 -9
- package/fesm2022/unipin-angular-applet-stepper.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-swipeable.mjs +14 -13
- package/fesm2022/unipin-angular-applet-swipeable.mjs.map +1 -1
- package/fesm2022/unipin-angular-applet-tabs.mjs +9 -9
- package/fesm2022/unipin-angular-applet-tooltip.mjs +4 -4
- package/fesm2022/unipin-angular-applet-tooltip.mjs.map +1 -1
- package/package.json +1 -1
- package/types/unipin-angular-applet-accordion.d.ts +1 -0
- package/types/unipin-angular-applet-approval.d.ts +2 -2
- package/types/unipin-angular-applet-badge.d.ts +2 -2
- package/types/unipin-angular-applet-common.d.ts +4 -4
- package/types/unipin-angular-applet-forms.d.ts +47 -8
- package/types/unipin-angular-applet-grids.d.ts +1 -1
- package/types/unipin-angular-applet-markdown.d.ts +2 -2
- package/types/unipin-angular-applet-progress-bar.d.ts +2 -0
- package/types/unipin-angular-applet-spinner.d.ts +2 -2
- package/types/unipin-angular-applet-swipeable.d.ts +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, inject, Injector, Injectable, input, computed, forwardRef, Directive,
|
|
2
|
+
import { signal, inject, Injector, Injectable, input, computed, forwardRef, Directive, model, viewChildren, ChangeDetectionStrategy, Component, HostListener, booleanAttribute, contentChildren, output, contentChild, ViewEncapsulation, viewChild, Pipe, afterNextRender, effect } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { NgControl, NgForm, FormGroupDirective, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
3
5
|
import * as i1$1 from '@unipin/angular-applet/common';
|
|
4
6
|
import { up, compressImage, UpFileDragNDropDirective } from '@unipin/angular-applet/common';
|
|
5
|
-
import * as i1 from '@angular/forms';
|
|
6
|
-
import { NgControl, NgForm, FormGroupDirective, FormsModule } from '@angular/forms';
|
|
7
7
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
8
8
|
import { matVisibilityOffRound, matVisibilityRound, matCalendarMonthRound, matWatchLaterRound } from '@ng-icons/material-icons/round';
|
|
9
9
|
import { NgSelectComponent } from '@ng-select/ng-select';
|
|
@@ -41,14 +41,14 @@ function toggleFormControls(form, keys, mode) {
|
|
|
41
41
|
function prettifyLabel(name) {
|
|
42
42
|
return name
|
|
43
43
|
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
44
|
-
.
|
|
44
|
+
.replaceAll('_', ' ')
|
|
45
45
|
.replace(/\b\w/g, char => char.toUpperCase());
|
|
46
46
|
}
|
|
47
47
|
function convertToDate(value) {
|
|
48
48
|
if (value instanceof Date)
|
|
49
49
|
return value;
|
|
50
50
|
if (typeof value === 'string' &&
|
|
51
|
-
!isNaN(Date.parse(value))) {
|
|
51
|
+
!Number.isNaN(Date.parse(value))) {
|
|
52
52
|
return new Date(value);
|
|
53
53
|
}
|
|
54
54
|
return null;
|
|
@@ -90,8 +90,8 @@ function validRangeValidator(fromKey, toKey) {
|
|
|
90
90
|
if (fromDate && toDate) {
|
|
91
91
|
isInvalid = toDate <= fromDate;
|
|
92
92
|
}
|
|
93
|
-
else if (!isNaN(fromValue) &&
|
|
94
|
-
!isNaN(toValue)) {
|
|
93
|
+
else if (!Number.isNaN(fromValue) &&
|
|
94
|
+
!Number.isNaN(toValue)) {
|
|
95
95
|
isInvalid = Number(toValue) <= Number(fromValue);
|
|
96
96
|
}
|
|
97
97
|
return !isInvalid ? null : {
|
|
@@ -143,7 +143,7 @@ function isEqualValidator(controlNames, message) {
|
|
|
143
143
|
const labels = controlNames.map((name) => {
|
|
144
144
|
return name
|
|
145
145
|
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
146
|
-
.
|
|
146
|
+
.replaceAll('_', ' ')
|
|
147
147
|
.replace(/\b\w/g, char => char.toUpperCase());
|
|
148
148
|
});
|
|
149
149
|
return {
|
|
@@ -197,7 +197,7 @@ function isNotEqualValidator(controlNames, message) {
|
|
|
197
197
|
const labels = controlNames.map((name) => {
|
|
198
198
|
return name
|
|
199
199
|
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
200
|
-
.
|
|
200
|
+
.replaceAll('_', ' ')
|
|
201
201
|
.replace(/\b\w/g, char => char.toUpperCase());
|
|
202
202
|
});
|
|
203
203
|
return {
|
|
@@ -267,10 +267,10 @@ class UpFieldControlComponent {
|
|
|
267
267
|
this.error.set(newState);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
271
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
270
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpFieldControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
271
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpFieldControlComponent }); }
|
|
272
272
|
}
|
|
273
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpFieldControlComponent, decorators: [{
|
|
274
274
|
type: Injectable
|
|
275
275
|
}] });
|
|
276
276
|
|
|
@@ -282,15 +282,15 @@ class UpInputDirective extends UpFieldControlComponent {
|
|
|
282
282
|
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());
|
|
283
283
|
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
284
284
|
}
|
|
285
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
286
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
285
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpInputDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
286
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.18", type: UpInputDirective, isStandalone: true, selector: "[upInput]", inputs: { inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [
|
|
287
287
|
{
|
|
288
288
|
provide: UpFieldControl,
|
|
289
289
|
useExisting: forwardRef(() => UpInputDirective)
|
|
290
290
|
}
|
|
291
291
|
], exportAs: ["upInput"], usesInheritance: true, ngImport: i0 }); }
|
|
292
292
|
}
|
|
293
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpInputDirective, decorators: [{
|
|
294
294
|
type: Directive,
|
|
295
295
|
args: [{
|
|
296
296
|
exportAs: 'upInput',
|
|
@@ -307,6 +307,212 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
307
307
|
}]
|
|
308
308
|
}], propDecorators: { inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
309
309
|
|
|
310
|
+
class UpPinComponent {
|
|
311
|
+
constructor() {
|
|
312
|
+
this.length = input(6, ...(ngDevMode ? [{ debugName: "length" }] : /* istanbul ignore next */ []));
|
|
313
|
+
this.obscure = model(true, ...(ngDevMode ? [{ debugName: "obscure" }] : /* istanbul ignore next */ []));
|
|
314
|
+
this.disabled = model(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
315
|
+
this.inlineClass = input('', ...(ngDevMode ? [{ debugName: "inlineClass" }] : /* istanbul ignore next */ []));
|
|
316
|
+
this._pinInputs = viewChildren('pinInput', ...(ngDevMode ? [{ debugName: "_pinInputs" }] : /* istanbul ignore next */ []));
|
|
317
|
+
this._focusedIndex = signal(-1, ...(ngDevMode ? [{ debugName: "_focusedIndex" }] : /* istanbul ignore next */ []));
|
|
318
|
+
this._values = signal([], ...(ngDevMode ? [{ debugName: "_values" }] : /* istanbul ignore next */ []));
|
|
319
|
+
this._slots = computed(() => Array.from({ length: this.length() }, (_, i) => i), ...(ngDevMode ? [{ debugName: "_slots" }] : /* istanbul ignore next */ []));
|
|
320
|
+
this._displayValues = computed(() => Array.from({ length: this.length() }, (_, i) => this._values()[i] ?? ''), ...(ngDevMode ? [{ debugName: "_displayValues" }] : /* istanbul ignore next */ []));
|
|
321
|
+
this._hostClass = computed(() => up('flex gap-2', this.inlineClass()), ...(ngDevMode ? [{ debugName: "_hostClass" }] : /* istanbul ignore next */ []));
|
|
322
|
+
this._inputClass = computed(() => up('size-11 max-w-13 p-0', 'text-center text-base leading-none'), ...(ngDevMode ? [{ debugName: "_inputClass" }] : /* istanbul ignore next */ []));
|
|
323
|
+
this._isTouched = false;
|
|
324
|
+
this._onTouched = () => { };
|
|
325
|
+
this._onChange = () => { };
|
|
326
|
+
}
|
|
327
|
+
registerOnChange(fn) {
|
|
328
|
+
this._onChange = fn;
|
|
329
|
+
}
|
|
330
|
+
registerOnTouched(fn) {
|
|
331
|
+
this._onTouched = fn;
|
|
332
|
+
}
|
|
333
|
+
setDisabledState(isDisabled) {
|
|
334
|
+
this.disabled.set(isDisabled);
|
|
335
|
+
}
|
|
336
|
+
writeValue(val) {
|
|
337
|
+
if (!val) {
|
|
338
|
+
this._values.set(new Array(this.length()).fill(''));
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const chars = val.slice(0, this.length()).split('');
|
|
342
|
+
const values = [
|
|
343
|
+
...chars,
|
|
344
|
+
...new Array(Math.max(0, this.length() - chars.length)).fill(''),
|
|
345
|
+
];
|
|
346
|
+
this._values.set(values);
|
|
347
|
+
}
|
|
348
|
+
_emitChange() {
|
|
349
|
+
this._onChange(this._values().join(''));
|
|
350
|
+
}
|
|
351
|
+
_onBlur() {
|
|
352
|
+
this._focusedIndex.set(-1);
|
|
353
|
+
if (!this._isTouched) {
|
|
354
|
+
this._onTouched();
|
|
355
|
+
this._isTouched = true;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
_moveFocus(index) {
|
|
359
|
+
const inputs = this._pinInputs();
|
|
360
|
+
if (inputs[index]) {
|
|
361
|
+
inputs[index].nativeElement.focus();
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
_onFocus(index) {
|
|
365
|
+
this._focusedIndex.set(index);
|
|
366
|
+
const inputs = this._pinInputs();
|
|
367
|
+
if (inputs[index]) {
|
|
368
|
+
inputs[index].nativeElement.select();
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
_getValues() {
|
|
372
|
+
const len = this.length();
|
|
373
|
+
const vals = [...this._values()];
|
|
374
|
+
while (vals.length < len) {
|
|
375
|
+
vals.push('');
|
|
376
|
+
}
|
|
377
|
+
return vals.slice(0, len);
|
|
378
|
+
}
|
|
379
|
+
_onPaste(event) {
|
|
380
|
+
event.preventDefault();
|
|
381
|
+
const pasted = event.clipboardData?.getData('text') ?? '';
|
|
382
|
+
const startIndex = Math.max(0, this._focusedIndex());
|
|
383
|
+
const chars = pasted.slice(0, this.length() - startIndex).split('');
|
|
384
|
+
const values = this._getValues();
|
|
385
|
+
chars.forEach((char, i) => {
|
|
386
|
+
values[startIndex + i] = char;
|
|
387
|
+
});
|
|
388
|
+
this._values.set(values);
|
|
389
|
+
this._emitChange();
|
|
390
|
+
const focusTarget = Math.min(startIndex + chars.length, this.length() - 1);
|
|
391
|
+
this._moveFocus(focusTarget);
|
|
392
|
+
}
|
|
393
|
+
_onInput(event, index) {
|
|
394
|
+
const inputEl = event.target;
|
|
395
|
+
const val = inputEl.value.slice(-1);
|
|
396
|
+
const values = this._getValues();
|
|
397
|
+
values[index] = val;
|
|
398
|
+
this._values.set(values);
|
|
399
|
+
this._emitChange();
|
|
400
|
+
if (val && index < this.length() - 1) {
|
|
401
|
+
this._moveFocus(index + 1);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
_onKeydown(event, index) {
|
|
405
|
+
const values = this._getValues();
|
|
406
|
+
switch (event.key) {
|
|
407
|
+
case 'Backspace':
|
|
408
|
+
event.preventDefault();
|
|
409
|
+
if (values[index]) {
|
|
410
|
+
values[index] = '';
|
|
411
|
+
this._values.set(values);
|
|
412
|
+
this._emitChange();
|
|
413
|
+
}
|
|
414
|
+
else if (index > 0) {
|
|
415
|
+
values[index - 1] = '';
|
|
416
|
+
this._values.set(values);
|
|
417
|
+
this._emitChange();
|
|
418
|
+
this._moveFocus(index - 1);
|
|
419
|
+
}
|
|
420
|
+
break;
|
|
421
|
+
case 'Delete':
|
|
422
|
+
event.preventDefault();
|
|
423
|
+
values[index] = '';
|
|
424
|
+
this._values.set(values);
|
|
425
|
+
this._emitChange();
|
|
426
|
+
break;
|
|
427
|
+
case 'ArrowLeft':
|
|
428
|
+
if (index > 0) {
|
|
429
|
+
event.preventDefault();
|
|
430
|
+
this._moveFocus(index - 1);
|
|
431
|
+
}
|
|
432
|
+
break;
|
|
433
|
+
case 'ArrowRight':
|
|
434
|
+
if (index < this.length() - 1) {
|
|
435
|
+
event.preventDefault();
|
|
436
|
+
this._moveFocus(index + 1);
|
|
437
|
+
}
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpPinComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
442
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: UpPinComponent, isStandalone: true, selector: "up-pin", inputs: { length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, obscure: { classPropertyName: "obscure", publicName: "obscure", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "inlineClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { obscure: "obscureChange", disabled: "disabledChange" }, host: { properties: { "class": "_hostClass()" } }, providers: [
|
|
443
|
+
{
|
|
444
|
+
multi: true,
|
|
445
|
+
provide: NG_VALUE_ACCESSOR,
|
|
446
|
+
useExisting: forwardRef(() => UpPinComponent),
|
|
447
|
+
},
|
|
448
|
+
], viewQueries: [{ propertyName: "_pinInputs", predicate: ["pinInput"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
449
|
+
@for (slot of _slots(); track slot) {
|
|
450
|
+
<input
|
|
451
|
+
upInput
|
|
452
|
+
maxlength="1"
|
|
453
|
+
autocomplete="off"
|
|
454
|
+
inputmode="numeric"
|
|
455
|
+
|
|
456
|
+
[class]="_inputClass()"
|
|
457
|
+
[disabled]="disabled()"
|
|
458
|
+
[value]="_displayValues()[slot]"
|
|
459
|
+
[type]="obscure()? 'password' : 'text'"
|
|
460
|
+
|
|
461
|
+
(blur)="_onBlur()"
|
|
462
|
+
(focus)="_onFocus(slot)"
|
|
463
|
+
(paste)="_onPaste($event)"
|
|
464
|
+
(input)="_onInput($event, slot)"
|
|
465
|
+
(keydown)="_onKeydown($event, slot)"
|
|
466
|
+
|
|
467
|
+
#pinInput
|
|
468
|
+
/>
|
|
469
|
+
}
|
|
470
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: UpInputDirective, selector: "[upInput]", inputs: ["class"], exportAs: ["upInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
471
|
+
}
|
|
472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpPinComponent, decorators: [{
|
|
473
|
+
type: Component,
|
|
474
|
+
args: [{
|
|
475
|
+
selector: 'up-pin',
|
|
476
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
477
|
+
host: {
|
|
478
|
+
'[class]': '_hostClass()',
|
|
479
|
+
},
|
|
480
|
+
imports: [
|
|
481
|
+
UpInputDirective,
|
|
482
|
+
],
|
|
483
|
+
providers: [
|
|
484
|
+
{
|
|
485
|
+
multi: true,
|
|
486
|
+
provide: NG_VALUE_ACCESSOR,
|
|
487
|
+
useExisting: forwardRef(() => UpPinComponent),
|
|
488
|
+
},
|
|
489
|
+
],
|
|
490
|
+
template: `
|
|
491
|
+
@for (slot of _slots(); track slot) {
|
|
492
|
+
<input
|
|
493
|
+
upInput
|
|
494
|
+
maxlength="1"
|
|
495
|
+
autocomplete="off"
|
|
496
|
+
inputmode="numeric"
|
|
497
|
+
|
|
498
|
+
[class]="_inputClass()"
|
|
499
|
+
[disabled]="disabled()"
|
|
500
|
+
[value]="_displayValues()[slot]"
|
|
501
|
+
[type]="obscure()? 'password' : 'text'"
|
|
502
|
+
|
|
503
|
+
(blur)="_onBlur()"
|
|
504
|
+
(focus)="_onFocus(slot)"
|
|
505
|
+
(paste)="_onPaste($event)"
|
|
506
|
+
(input)="_onInput($event, slot)"
|
|
507
|
+
(keydown)="_onKeydown($event, slot)"
|
|
508
|
+
|
|
509
|
+
#pinInput
|
|
510
|
+
/>
|
|
511
|
+
}
|
|
512
|
+
`,
|
|
513
|
+
}]
|
|
514
|
+
}], propDecorators: { length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], obscure: [{ type: i0.Input, args: [{ isSignal: true, alias: "obscure", required: false }] }, { type: i0.Output, args: ["obscureChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], inlineClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineClass", required: false }] }], _pinInputs: [{ type: i0.ViewChildren, args: ['pinInput', { isSignal: true }] }] } });
|
|
515
|
+
|
|
310
516
|
class UpNumberDirective extends UpInputDirective {
|
|
311
517
|
constructor(renderer, el) {
|
|
312
518
|
super();
|
|
@@ -319,7 +525,7 @@ class UpNumberDirective extends UpInputDirective {
|
|
|
319
525
|
return 0;
|
|
320
526
|
}
|
|
321
527
|
const floatPoint = Math.log10(this.magnifyValue());
|
|
322
|
-
return floatPoint % 1
|
|
528
|
+
return floatPoint % 1 === 0 ? floatPoint : 0;
|
|
323
529
|
}, ...(ngDevMode ? [{ debugName: "maxDecimalDigits" }] : /* istanbul ignore next */ []));
|
|
324
530
|
this.lastCaretPos = 0;
|
|
325
531
|
this.lastRawValue = '';
|
|
@@ -356,11 +562,11 @@ class UpNumberDirective extends UpInputDirective {
|
|
|
356
562
|
/^0+$/.test(cleanedDecimal))) {
|
|
357
563
|
formatted = '0';
|
|
358
564
|
}
|
|
359
|
-
else if (
|
|
360
|
-
formatted = this.formatWithThousandSeparator(cleanedInteger || '0')
|
|
565
|
+
else if (cleanedDecimal) {
|
|
566
|
+
formatted = `${this.formatWithThousandSeparator(cleanedInteger || '0')},${cleanedDecimal}`;
|
|
361
567
|
}
|
|
362
568
|
else {
|
|
363
|
-
formatted =
|
|
569
|
+
formatted = this.formatWithThousandSeparator(cleanedInteger || '0');
|
|
364
570
|
}
|
|
365
571
|
input.value = formatted;
|
|
366
572
|
}
|
|
@@ -370,7 +576,7 @@ class UpNumberDirective extends UpInputDirective {
|
|
|
370
576
|
const postCaret = input.selectionStart ?? postRaw.length;
|
|
371
577
|
const formatted = this.formatNumber(postRaw);
|
|
372
578
|
input.value = formatted;
|
|
373
|
-
const numericValue = Number(formatted.
|
|
579
|
+
const numericValue = Number(formatted.replaceAll('.', '').replace(',', '.'));
|
|
374
580
|
this._onChange(numericValue);
|
|
375
581
|
const digitsBefore = postRaw.slice(0, postCaret).replace(/\D/g, '').length;
|
|
376
582
|
let newCaret = this.lastKey === ',' ? this.findCommaCaret(formatted, digitsBefore) : this.mapDigitsToIndex(formatted, digitsBefore);
|
|
@@ -463,26 +669,48 @@ class UpNumberDirective extends UpInputDirective {
|
|
|
463
669
|
return formattedInt || '0';
|
|
464
670
|
}
|
|
465
671
|
formatWithThousandSeparator(value) {
|
|
466
|
-
|
|
672
|
+
if (!value) {
|
|
673
|
+
return value;
|
|
674
|
+
}
|
|
675
|
+
let firstNonZeroIndex = 0;
|
|
676
|
+
while (firstNonZeroIndex < value.length - 1 &&
|
|
677
|
+
value[firstNonZeroIndex] === '0') {
|
|
678
|
+
firstNonZeroIndex++;
|
|
679
|
+
}
|
|
680
|
+
const cleanedValue = firstNonZeroIndex > 0 ? value.slice(firstNonZeroIndex) : value;
|
|
681
|
+
if (cleanedValue.length <= 3) {
|
|
682
|
+
return cleanedValue;
|
|
683
|
+
}
|
|
684
|
+
const formatted = [];
|
|
685
|
+
const firstGroupLength = cleanedValue.length % 3 || 3;
|
|
686
|
+
for (let i = 0; i < cleanedValue.length; i++) {
|
|
687
|
+
if (i > 0 &&
|
|
688
|
+
(i - firstGroupLength) % 3 === 0) {
|
|
689
|
+
formatted.push('.');
|
|
690
|
+
}
|
|
691
|
+
formatted.push(cleanedValue[i]);
|
|
692
|
+
}
|
|
693
|
+
return formatted.join('');
|
|
467
694
|
}
|
|
468
695
|
sanitizeNumber(value) {
|
|
469
696
|
const onlyDigitsComma = value.replace(/[^0-9,]/g, '');
|
|
470
|
-
const singleComma = onlyDigitsComma.
|
|
697
|
+
const singleComma = onlyDigitsComma.replaceAll(',', (_, i) => onlyDigitsComma.indexOf(',') === i ? ',' : '');
|
|
471
698
|
const [integerPart, decimalPart] = singleComma.split(',');
|
|
699
|
+
const maxDecimals = this.maxDecimalDigits();
|
|
472
700
|
return {
|
|
473
701
|
integer: integerPart || '',
|
|
474
|
-
decimal: decimalPart
|
|
702
|
+
decimal: decimalPart && maxDecimals > 0 ? decimalPart.slice(0, maxDecimals) : decimalPart,
|
|
475
703
|
};
|
|
476
704
|
}
|
|
477
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
478
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
705
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpNumberDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
706
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.18", 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: [
|
|
479
707
|
{
|
|
480
708
|
provide: UpFieldControl,
|
|
481
709
|
useExisting: forwardRef(() => UpNumberDirective),
|
|
482
710
|
},
|
|
483
711
|
], exportAs: ["upNumber"], usesInheritance: true, ngImport: i0 }); }
|
|
484
712
|
}
|
|
485
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
713
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpNumberDirective, decorators: [{
|
|
486
714
|
type: Directive,
|
|
487
715
|
args: [{
|
|
488
716
|
exportAs: 'upNumber',
|
|
@@ -598,8 +826,8 @@ class UpPasswordComponent extends UpFieldControlComponent {
|
|
|
598
826
|
this.value.set(value);
|
|
599
827
|
this._onChange(this.value());
|
|
600
828
|
}
|
|
601
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
602
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
829
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpPasswordComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
830
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.18", 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: [
|
|
603
831
|
{
|
|
604
832
|
provide: UpFieldControl,
|
|
605
833
|
useExisting: forwardRef(() => UpPasswordComponent)
|
|
@@ -630,7 +858,7 @@ class UpPasswordComponent extends UpFieldControlComponent {
|
|
|
630
858
|
/>
|
|
631
859
|
`, 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 }); }
|
|
632
860
|
}
|
|
633
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
861
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpPasswordComponent, decorators: [{
|
|
634
862
|
type: Component,
|
|
635
863
|
args: [{
|
|
636
864
|
selector: 'up-password',
|
|
@@ -710,15 +938,15 @@ class UpRadioGroupComponent extends UpFieldControlComponent {
|
|
|
710
938
|
this._onChange(val);
|
|
711
939
|
}
|
|
712
940
|
}
|
|
713
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
714
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
941
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpRadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
942
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.18", type: UpRadioGroupComponent, isStandalone: true, selector: "up-radio-group", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block" }, providers: [
|
|
715
943
|
{
|
|
716
944
|
provide: UpFieldControl,
|
|
717
945
|
useExisting: forwardRef(() => UpRadioGroupComponent)
|
|
718
946
|
},
|
|
719
947
|
], usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true }); }
|
|
720
948
|
}
|
|
721
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
949
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpRadioGroupComponent, decorators: [{
|
|
722
950
|
type: Component,
|
|
723
951
|
args: [{
|
|
724
952
|
selector: 'up-radio-group',
|
|
@@ -750,10 +978,10 @@ class UpRadioDirective {
|
|
|
750
978
|
ev.stopPropagation();
|
|
751
979
|
this.radioGroup.select(this.value());
|
|
752
980
|
}
|
|
753
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
754
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
981
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpRadioDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
982
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.18", type: UpRadioDirective, isStandalone: true, selector: "input[upRadio]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "radio" }, listeners: { "change": "toggle($event)" }, properties: { "checked": "checked()", "disabled": "disabled()", "class": "_computedClass()" } }, ngImport: i0 }); }
|
|
755
983
|
}
|
|
756
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpRadioDirective, decorators: [{
|
|
757
985
|
type: Directive,
|
|
758
986
|
args: [{
|
|
759
987
|
selector: 'input[upRadio]',
|
|
@@ -817,8 +1045,8 @@ class UpSwitchComponent extends UpFieldControlComponent {
|
|
|
817
1045
|
this._onChange(this.checked());
|
|
818
1046
|
this._onTouched();
|
|
819
1047
|
}
|
|
820
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
821
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
1048
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1049
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.18", 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: [
|
|
822
1050
|
{
|
|
823
1051
|
provide: UpFieldControl,
|
|
824
1052
|
useExisting: forwardRef(() => UpSwitchComponent),
|
|
@@ -840,7 +1068,7 @@ class UpSwitchComponent extends UpFieldControlComponent {
|
|
|
840
1068
|
</span>
|
|
841
1069
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
842
1070
|
}
|
|
843
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1071
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpSwitchComponent, decorators: [{
|
|
844
1072
|
type: Component,
|
|
845
1073
|
args: [{
|
|
846
1074
|
selector: 'up-switch',
|
|
@@ -881,15 +1109,15 @@ class UpCheckboxDirective extends UpFieldControlComponent {
|
|
|
881
1109
|
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());
|
|
882
1110
|
}, ...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
883
1111
|
}
|
|
884
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
885
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
1112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpCheckboxDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1113
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.18", 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: [
|
|
886
1114
|
{
|
|
887
1115
|
provide: UpFieldControl,
|
|
888
1116
|
useExisting: forwardRef(() => UpCheckboxDirective)
|
|
889
1117
|
}
|
|
890
1118
|
], exportAs: ["upCheckbox"], usesInheritance: true, ngImport: i0 }); }
|
|
891
1119
|
}
|
|
892
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpCheckboxDirective, decorators: [{
|
|
893
1121
|
type: Directive,
|
|
894
1122
|
args: [{
|
|
895
1123
|
exportAs: 'upCheckbox',
|
|
@@ -914,12 +1142,12 @@ class UpOptionComponent {
|
|
|
914
1142
|
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
915
1143
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
916
1144
|
}
|
|
917
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
918
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
1145
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpOptionComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1146
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.18", 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: `
|
|
919
1147
|
<ng-content />
|
|
920
1148
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
921
1149
|
}
|
|
922
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpOptionComponent, decorators: [{
|
|
923
1151
|
type: Component,
|
|
924
1152
|
args: [{
|
|
925
1153
|
selector: 'up-option',
|
|
@@ -1029,8 +1257,8 @@ class UpSelectComponent extends UpFieldControlComponent {
|
|
|
1029
1257
|
this.changed.emit(this.value());
|
|
1030
1258
|
}
|
|
1031
1259
|
}
|
|
1032
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1033
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.
|
|
1260
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1261
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.18", 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: [
|
|
1034
1262
|
{
|
|
1035
1263
|
provide: UpFieldControl,
|
|
1036
1264
|
useExisting: forwardRef(() => UpSelectComponent)
|
|
@@ -1058,7 +1286,7 @@ class UpSelectComponent extends UpFieldControlComponent {
|
|
|
1058
1286
|
/>
|
|
1059
1287
|
`, 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", "popover", "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 }); }
|
|
1060
1288
|
}
|
|
1061
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpSelectComponent, decorators: [{
|
|
1062
1290
|
type: Component,
|
|
1063
1291
|
args: [{ selector: 'up-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1064
1292
|
class: 'block relative',
|
|
@@ -1160,8 +1388,8 @@ class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
|
1160
1388
|
this.changed.emit(this.countries().find(c => c.code === value));
|
|
1161
1389
|
}
|
|
1162
1390
|
}
|
|
1163
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1164
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
1391
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpCountrySelectComponent, deps: [{ token: i1$1.CountryService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1392
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.18", 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 }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", 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: [
|
|
1165
1393
|
{
|
|
1166
1394
|
provide: UpFieldControl,
|
|
1167
1395
|
useExisting: forwardRef(() => UpCountrySelectComponent),
|
|
@@ -1186,7 +1414,7 @@ class UpCountrySelectComponent extends UpFieldControlComponent {
|
|
|
1186
1414
|
/>
|
|
1187
1415
|
`, 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 }); }
|
|
1188
1416
|
}
|
|
1189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1417
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpCountrySelectComponent, decorators: [{
|
|
1190
1418
|
type: Component,
|
|
1191
1419
|
args: [{
|
|
1192
1420
|
selector: 'up-country-select',
|
|
@@ -1298,8 +1526,8 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
1298
1526
|
this.changed.emit(this.currencies().find(c => c.code === value));
|
|
1299
1527
|
}
|
|
1300
1528
|
}
|
|
1301
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1302
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
1529
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpCurrencySelectComponent, deps: [{ token: i1$1.CurrencyService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1530
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.18", 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 }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", 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: [
|
|
1303
1531
|
{
|
|
1304
1532
|
provide: UpFieldControl,
|
|
1305
1533
|
useExisting: forwardRef(() => UpCurrencySelectComponent)
|
|
@@ -1324,7 +1552,7 @@ class UpCurrencySelectComponent extends UpFieldControlComponent {
|
|
|
1324
1552
|
/>
|
|
1325
1553
|
`, 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 }); }
|
|
1326
1554
|
}
|
|
1327
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1555
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpCurrencySelectComponent, decorators: [{
|
|
1328
1556
|
type: Component,
|
|
1329
1557
|
args: [{
|
|
1330
1558
|
selector: 'up-currency-select',
|
|
@@ -1393,7 +1621,7 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1393
1621
|
}, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
1394
1622
|
this.typeahead = new Subject();
|
|
1395
1623
|
this.query$ = this.typeahead.pipe(distinctUntilChanged(), debounceTime(300), tap(() => this.loading.set(true)), switchMap((k) => {
|
|
1396
|
-
return this.query()(k).pipe(map((result) =>
|
|
1624
|
+
return this.query()(k).pipe(map((result) => result.length ? result : this.initialItems()), catchError(() => of(this.initialItems())));
|
|
1397
1625
|
}), tap(() => this.loading.set(false)));
|
|
1398
1626
|
this._queryResults = toSignal(this.query$, { initialValue: [] });
|
|
1399
1627
|
this.isTouched = false;
|
|
@@ -1431,14 +1659,14 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1431
1659
|
this.value.set(null);
|
|
1432
1660
|
}
|
|
1433
1661
|
else {
|
|
1434
|
-
this.value.set(
|
|
1662
|
+
this.value.set(this.multiple() ? e.map((o) => o[this.bindValue()]) : e[this.bindValue()]);
|
|
1435
1663
|
}
|
|
1436
1664
|
this._onChange(this.value());
|
|
1437
1665
|
this.changed.emit(this.value());
|
|
1438
1666
|
}
|
|
1439
1667
|
}
|
|
1440
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1441
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.
|
|
1668
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpSearchableSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1669
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.18", 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: [
|
|
1442
1670
|
{
|
|
1443
1671
|
provide: UpFieldControl,
|
|
1444
1672
|
useExisting: forwardRef(() => UpSearchableSelectComponent)
|
|
@@ -1473,7 +1701,7 @@ class UpSearchableSelectComponent extends UpFieldControlComponent {
|
|
|
1473
1701
|
/>
|
|
1474
1702
|
`, 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", "popover", "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 }); }
|
|
1475
1703
|
}
|
|
1476
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpSearchableSelectComponent, decorators: [{
|
|
1477
1705
|
type: Component,
|
|
1478
1706
|
args: [{ selector: 'up-searchable-select', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1479
1707
|
class: 'block relative',
|
|
@@ -1591,8 +1819,8 @@ class UpRateGroupCodeSelectComponent extends UpFieldControlComponent {
|
|
|
1591
1819
|
this.changed.emit(value);
|
|
1592
1820
|
}
|
|
1593
1821
|
}
|
|
1594
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1595
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
1822
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpRateGroupCodeSelectComponent, deps: [{ token: i1$1.RateGroupCodeService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1823
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.18", 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: [
|
|
1596
1824
|
{
|
|
1597
1825
|
provide: UpFieldControl,
|
|
1598
1826
|
useExisting: forwardRef(() => UpRateGroupCodeSelectComponent),
|
|
@@ -1617,7 +1845,7 @@ class UpRateGroupCodeSelectComponent extends UpFieldControlComponent {
|
|
|
1617
1845
|
/>
|
|
1618
1846
|
`, 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 }); }
|
|
1619
1847
|
}
|
|
1620
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1848
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpRateGroupCodeSelectComponent, decorators: [{
|
|
1621
1849
|
type: Component,
|
|
1622
1850
|
args: [{
|
|
1623
1851
|
selector: 'up-rate-group-code-select',
|
|
@@ -1708,8 +1936,8 @@ class UpDatepickerComponent extends UpFieldControlComponent {
|
|
|
1708
1936
|
this._onTouched();
|
|
1709
1937
|
this._isTouched = true;
|
|
1710
1938
|
}
|
|
1711
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1712
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.
|
|
1939
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpDatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1940
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.18", 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: [
|
|
1713
1941
|
{
|
|
1714
1942
|
provide: UpFieldControl,
|
|
1715
1943
|
useExisting: forwardRef(() => UpDatepickerComponent),
|
|
@@ -1753,7 +1981,7 @@ class UpDatepickerComponent extends UpFieldControlComponent {
|
|
|
1753
1981
|
</up-popover>
|
|
1754
1982
|
`, 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 }); }
|
|
1755
1983
|
}
|
|
1756
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpDatepickerComponent, decorators: [{
|
|
1757
1985
|
type: Component,
|
|
1758
1986
|
args: [{
|
|
1759
1987
|
selector: 'up-datepicker',
|
|
@@ -1825,7 +2053,8 @@ class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
|
1825
2053
|
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
1826
2054
|
this.value = signal({ from: null, to: null }, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1827
2055
|
this.formattedDate = computed(() => {
|
|
1828
|
-
|
|
2056
|
+
const value = this.value();
|
|
2057
|
+
return value.from && value.to ? `${format(value.from, this.dateFormat())} - ${format(value.to, this.dateFormat())}` : '';
|
|
1829
2058
|
}, ...(ngDevMode ? [{ debugName: "formattedDate" }] : /* istanbul ignore next */ []));
|
|
1830
2059
|
this._computedClass = computed(() => {
|
|
1831
2060
|
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());
|
|
@@ -1838,7 +2067,7 @@ class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
|
1838
2067
|
}
|
|
1839
2068
|
}
|
|
1840
2069
|
writeValue(value) {
|
|
1841
|
-
this.value.set(value ?? null);
|
|
2070
|
+
this.value.set(value ?? { from: null, to: null });
|
|
1842
2071
|
}
|
|
1843
2072
|
registerOnChange(fn) {
|
|
1844
2073
|
this._onChange = fn;
|
|
@@ -1863,8 +2092,8 @@ class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
|
1863
2092
|
this._onTouched();
|
|
1864
2093
|
this._isTouched = true;
|
|
1865
2094
|
}
|
|
1866
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1867
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
2095
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpDateRangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2096
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.18", 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: [
|
|
1868
2097
|
{
|
|
1869
2098
|
provide: UpFieldControl,
|
|
1870
2099
|
useExisting: forwardRef(() => UpDateRangePickerComponent)
|
|
@@ -1909,7 +2138,7 @@ class UpDateRangePickerComponent extends UpFieldControlComponent {
|
|
|
1909
2138
|
</up-popover>
|
|
1910
2139
|
`, 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 }); }
|
|
1911
2140
|
}
|
|
1912
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
2141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpDateRangePickerComponent, decorators: [{
|
|
1913
2142
|
type: Component,
|
|
1914
2143
|
args: [{
|
|
1915
2144
|
selector: 'up-date-range-picker',
|
|
@@ -1992,6 +2221,17 @@ function scrollImmediate(el, itemHeight, index) {
|
|
|
1992
2221
|
}
|
|
1993
2222
|
el.scrollTop = index * itemHeight;
|
|
1994
2223
|
}
|
|
2224
|
+
function findFirstIndexAtLeast(values, target) {
|
|
2225
|
+
return values.findIndex((value) => value >= target);
|
|
2226
|
+
}
|
|
2227
|
+
function findLastIndexAtMost(values, target) {
|
|
2228
|
+
for (let i = values.length - 1; i >= 0; i--) {
|
|
2229
|
+
if (values[i] <= target) {
|
|
2230
|
+
return i;
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
return -1;
|
|
2234
|
+
}
|
|
1995
2235
|
function findClosestIndex(values, target) {
|
|
1996
2236
|
let closestIdx = 0;
|
|
1997
2237
|
let minDiff = Math.abs(values[0] - target);
|
|
@@ -2019,10 +2259,10 @@ class OpacityPipe {
|
|
|
2019
2259
|
return 'opacity-15';
|
|
2020
2260
|
}
|
|
2021
2261
|
}
|
|
2022
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
2023
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.
|
|
2262
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: OpacityPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2263
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.18", ngImport: i0, type: OpacityPipe, isStandalone: true, name: "opacity" }); }
|
|
2024
2264
|
}
|
|
2025
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
2265
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: OpacityPipe, decorators: [{
|
|
2026
2266
|
type: Pipe,
|
|
2027
2267
|
args: [{
|
|
2028
2268
|
name: 'opacity',
|
|
@@ -2053,8 +2293,8 @@ class UpTimeComponent {
|
|
|
2053
2293
|
}, ...(ngDevMode ? [{ debugName: "minutes" }] : /* istanbul ignore next */ []));
|
|
2054
2294
|
this.hourInvisible = computed(() => {
|
|
2055
2295
|
return this.hours.map((hour) => {
|
|
2056
|
-
return hour < (this.minTime()?.hour ?? 0) ||
|
|
2057
|
-
hour > (this.maxTime()?.hour ?? 23);
|
|
2296
|
+
return (hour < (this.minTime()?.hour ?? 0) ||
|
|
2297
|
+
hour > (this.maxTime()?.hour ?? 23));
|
|
2058
2298
|
});
|
|
2059
2299
|
}, ...(ngDevMode ? [{ debugName: "hourInvisible" }] : /* istanbul ignore next */ []));
|
|
2060
2300
|
this.minuteInvisible = computed(() => {
|
|
@@ -2110,133 +2350,69 @@ class UpTimeComponent {
|
|
|
2110
2350
|
}, 150);
|
|
2111
2351
|
}
|
|
2112
2352
|
clampSelectionToValidRange() {
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
let hourIdx = this.selectedHourIndex();
|
|
2116
|
-
const currentHour = hours[hourIdx] ?? 0;
|
|
2117
|
-
if (currentHour < this.minHour()) {
|
|
2118
|
-
hourIdx = hours.indexOf(this.minHour());
|
|
2119
|
-
if (hourIdx === -1) {
|
|
2120
|
-
for (let i = 0; i < hours.length; i++) {
|
|
2121
|
-
if (hours[i] >= this.minHour()) {
|
|
2122
|
-
hourIdx = i;
|
|
2123
|
-
break;
|
|
2124
|
-
}
|
|
2125
|
-
}
|
|
2126
|
-
}
|
|
2127
|
-
this.selectedHourIndex.set(hourIdx);
|
|
2128
|
-
this.scrollToHourImmediate(hourIdx);
|
|
2129
|
-
}
|
|
2130
|
-
else if (currentHour > this.maxHour()) {
|
|
2131
|
-
hourIdx = hours.indexOf(this.maxHour());
|
|
2132
|
-
if (hourIdx === -1) {
|
|
2133
|
-
for (let i = hours.length - 1; i >= 0; i--) {
|
|
2134
|
-
if (hours[i] <= this.maxHour()) {
|
|
2135
|
-
hourIdx = i;
|
|
2136
|
-
break;
|
|
2137
|
-
}
|
|
2138
|
-
}
|
|
2139
|
-
}
|
|
2140
|
-
this.selectedHourIndex.set(hourIdx);
|
|
2141
|
-
this.scrollToHourImmediate(hourIdx);
|
|
2142
|
-
}
|
|
2143
|
-
const { min: minMinute, max: maxMinute } = this.validMinuteRange();
|
|
2144
|
-
let minuteIdx = this.selectedMinuteIndex();
|
|
2145
|
-
const currentMinute = minutes[minuteIdx] ?? 0;
|
|
2146
|
-
if (currentMinute < minMinute) {
|
|
2147
|
-
let newIdx = -1;
|
|
2148
|
-
for (let i = 0; i < minutes.length; i++) {
|
|
2149
|
-
if (minutes[i] >= minMinute) {
|
|
2150
|
-
newIdx = i;
|
|
2151
|
-
break;
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
if (newIdx !== -1) {
|
|
2155
|
-
this.selectedMinuteIndex.set(newIdx);
|
|
2156
|
-
this.scrollToMinuteImmediate(newIdx);
|
|
2157
|
-
}
|
|
2158
|
-
}
|
|
2159
|
-
else if (currentMinute > maxMinute) {
|
|
2160
|
-
let newIdx = -1;
|
|
2161
|
-
for (let i = minutes.length - 1; i >= 0; i--) {
|
|
2162
|
-
if (minutes[i] <= maxMinute) {
|
|
2163
|
-
newIdx = i;
|
|
2164
|
-
break;
|
|
2165
|
-
}
|
|
2166
|
-
}
|
|
2167
|
-
if (newIdx !== -1) {
|
|
2168
|
-
this.selectedMinuteIndex.set(newIdx);
|
|
2169
|
-
this.scrollToMinuteImmediate(newIdx);
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2353
|
+
this.clampHourSelection();
|
|
2354
|
+
this.clampMinuteSelection();
|
|
2172
2355
|
}
|
|
2173
2356
|
updateHourSelection() {
|
|
2174
|
-
|
|
2357
|
+
const hoursScrollEl = this.hoursScroll();
|
|
2358
|
+
if (!hoursScrollEl) {
|
|
2359
|
+
return;
|
|
2360
|
+
}
|
|
2361
|
+
updateScrollSelection(hoursScrollEl.nativeElement, this.itemHeight, this.hours.length - 1, (v) => this.selectedHourIndex.set(v));
|
|
2175
2362
|
}
|
|
2176
2363
|
updateMinuteSelection() {
|
|
2177
|
-
|
|
2364
|
+
const minutesScrollEl = this.minutesScroll();
|
|
2365
|
+
if (!minutesScrollEl) {
|
|
2366
|
+
return;
|
|
2367
|
+
}
|
|
2368
|
+
updateScrollSelection(minutesScrollEl.nativeElement, this.itemHeight, this.minutes().length - 1, (v) => this.selectedMinuteIndex.set(v));
|
|
2178
2369
|
}
|
|
2179
2370
|
snapHours() {
|
|
2180
|
-
|
|
2371
|
+
const hoursScrollEl = this.hoursScroll();
|
|
2372
|
+
if (!hoursScrollEl) {
|
|
2373
|
+
return;
|
|
2374
|
+
}
|
|
2375
|
+
snapScroll(hoursScrollEl.nativeElement, this.itemHeight, this.selectedHourIndex());
|
|
2181
2376
|
}
|
|
2182
2377
|
snapMinutes() {
|
|
2183
|
-
|
|
2378
|
+
const minutesScrollEl = this.minutesScroll();
|
|
2379
|
+
if (!minutesScrollEl) {
|
|
2380
|
+
return;
|
|
2381
|
+
}
|
|
2382
|
+
snapScroll(minutesScrollEl.nativeElement, this.itemHeight, this.selectedMinuteIndex());
|
|
2184
2383
|
}
|
|
2185
2384
|
scrollToHour(index) {
|
|
2186
2385
|
const clamped = Math.max(0, Math.min(23, index));
|
|
2187
|
-
this.
|
|
2188
|
-
this.scrollToHourImmediate(clamped);
|
|
2386
|
+
this.updateHourIndex(clamped);
|
|
2189
2387
|
this.emitTime();
|
|
2190
2388
|
}
|
|
2191
2389
|
scrollToMinute(index) {
|
|
2192
2390
|
const maxIdx = this.minutes().length - 1;
|
|
2193
2391
|
const clamped = Math.max(0, Math.min(maxIdx, index));
|
|
2194
|
-
this.
|
|
2195
|
-
this.scrollToMinuteImmediate(clamped);
|
|
2392
|
+
this.updateMinuteIndex(clamped);
|
|
2196
2393
|
this.emitTime();
|
|
2197
2394
|
}
|
|
2198
2395
|
scrollToHourImmediate(index) {
|
|
2199
|
-
|
|
2396
|
+
const hoursScrollEl = this.hoursScroll();
|
|
2397
|
+
if (!hoursScrollEl) {
|
|
2398
|
+
return;
|
|
2399
|
+
}
|
|
2400
|
+
scrollImmediate(hoursScrollEl.nativeElement, this.itemHeight, index);
|
|
2200
2401
|
}
|
|
2201
2402
|
scrollToMinuteImmediate(index) {
|
|
2202
|
-
|
|
2403
|
+
const minutesScrollEl = this.minutesScroll();
|
|
2404
|
+
if (!minutesScrollEl) {
|
|
2405
|
+
return;
|
|
2406
|
+
}
|
|
2407
|
+
scrollImmediate(minutesScrollEl.nativeElement, this.itemHeight, index);
|
|
2203
2408
|
}
|
|
2204
2409
|
clampTime(time) {
|
|
2205
|
-
|
|
2206
|
-
const
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
minute = min.minute ?? 0;
|
|
2212
|
-
}
|
|
2213
|
-
else if (hour === (min.hour ?? 0) && min.minute !== undefined) {
|
|
2214
|
-
minute = Math.max(min.minute, minute);
|
|
2215
|
-
}
|
|
2216
|
-
}
|
|
2217
|
-
if (max) {
|
|
2218
|
-
if (hour > (max.hour ?? 23)) {
|
|
2219
|
-
hour = max.hour;
|
|
2220
|
-
minute = max.minute ?? 59;
|
|
2221
|
-
}
|
|
2222
|
-
else if (hour === (max.hour ?? 23) && max.minute !== undefined) {
|
|
2223
|
-
minute = Math.min(max.minute, minute);
|
|
2224
|
-
}
|
|
2225
|
-
}
|
|
2226
|
-
const minuteValues = this.minutes();
|
|
2227
|
-
if (!minuteValues.includes(minute)) {
|
|
2228
|
-
let closest = minuteValues[0];
|
|
2229
|
-
let minDiff = Math.abs(minuteValues[0] - minute);
|
|
2230
|
-
for (let m of minuteValues) {
|
|
2231
|
-
const diff = Math.abs(m - minute);
|
|
2232
|
-
if (diff < minDiff) {
|
|
2233
|
-
closest = m;
|
|
2234
|
-
minDiff = diff;
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2237
|
-
minute = closest;
|
|
2238
|
-
}
|
|
2239
|
-
return { hour, minute };
|
|
2410
|
+
const clampedMin = this.clampToMin(time);
|
|
2411
|
+
const clampedMax = this.clampToMax(clampedMin);
|
|
2412
|
+
return {
|
|
2413
|
+
...clampedMax,
|
|
2414
|
+
minute: this.snapMinuteToInterval(clampedMax.minute),
|
|
2415
|
+
};
|
|
2240
2416
|
}
|
|
2241
2417
|
emitTime() {
|
|
2242
2418
|
let time = {
|
|
@@ -2244,197 +2420,116 @@ class UpTimeComponent {
|
|
|
2244
2420
|
minute: this.minutes()[this.selectedMinuteIndex()],
|
|
2245
2421
|
};
|
|
2246
2422
|
time = this.clampTime(time);
|
|
2247
|
-
if (
|
|
2248
|
-
this.lastEmittedTime
|
|
2249
|
-
this.lastEmittedTime.minute !== time.minute) {
|
|
2423
|
+
if (this.lastEmittedTime?.hour !== time.hour ||
|
|
2424
|
+
this.lastEmittedTime?.minute !== time.minute) {
|
|
2250
2425
|
this.lastEmittedTime = time;
|
|
2251
2426
|
this.timeChanged.emit(time);
|
|
2252
2427
|
}
|
|
2253
2428
|
}
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2429
|
+
updateHourIndex(index) {
|
|
2430
|
+
this.selectedHourIndex.set(index);
|
|
2431
|
+
this.scrollToHourImmediate(index);
|
|
2432
|
+
}
|
|
2433
|
+
updateMinuteIndex(index) {
|
|
2434
|
+
this.selectedMinuteIndex.set(index);
|
|
2435
|
+
this.scrollToMinuteImmediate(index);
|
|
2436
|
+
}
|
|
2437
|
+
findHourIndex(target) {
|
|
2438
|
+
const exact = this.hours.indexOf(target);
|
|
2439
|
+
if (exact !== -1) {
|
|
2440
|
+
return exact;
|
|
2441
|
+
}
|
|
2442
|
+
return findFirstIndexAtLeast(this.hours, target);
|
|
2443
|
+
}
|
|
2444
|
+
snapMinuteToInterval(minute) {
|
|
2445
|
+
const minuteValues = this.minutes();
|
|
2446
|
+
if (minuteValues.includes(minute)) {
|
|
2447
|
+
return minute;
|
|
2448
|
+
}
|
|
2449
|
+
return minuteValues[findClosestIndex(minuteValues, minute)];
|
|
2450
|
+
}
|
|
2451
|
+
clampToMin(time) {
|
|
2452
|
+
const min = this.minTime();
|
|
2453
|
+
if (!min) {
|
|
2454
|
+
return time;
|
|
2455
|
+
}
|
|
2456
|
+
let { hour, minute } = time;
|
|
2457
|
+
if (hour < (min.hour ?? 0)) {
|
|
2458
|
+
return {
|
|
2459
|
+
hour: min.hour,
|
|
2460
|
+
minute: min.minute ?? 0,
|
|
2461
|
+
};
|
|
2462
|
+
}
|
|
2463
|
+
if (hour === (min.hour ?? 0) && min.minute !== undefined) {
|
|
2464
|
+
minute = Math.max(min.minute, minute);
|
|
2465
|
+
}
|
|
2466
|
+
return {
|
|
2467
|
+
hour,
|
|
2468
|
+
minute,
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2471
|
+
clampToMax(time) {
|
|
2472
|
+
const max = this.maxTime();
|
|
2473
|
+
if (!max) {
|
|
2474
|
+
return time;
|
|
2475
|
+
}
|
|
2476
|
+
let { hour, minute } = time;
|
|
2477
|
+
if (hour > (max.hour ?? 23)) {
|
|
2478
|
+
return {
|
|
2479
|
+
hour: max.hour,
|
|
2480
|
+
minute: max.minute ?? 59,
|
|
2481
|
+
};
|
|
2482
|
+
}
|
|
2483
|
+
if (hour === (max.hour ?? 23) && max.minute !== undefined) {
|
|
2484
|
+
minute = Math.min(max.minute, minute);
|
|
2485
|
+
}
|
|
2486
|
+
return {
|
|
2487
|
+
hour,
|
|
2488
|
+
minute,
|
|
2489
|
+
};
|
|
2490
|
+
}
|
|
2491
|
+
clampHourSelection() {
|
|
2492
|
+
const hours = this.hours;
|
|
2493
|
+
let hourIdx = this.selectedHourIndex();
|
|
2494
|
+
const currentHour = hours[hourIdx] ?? 0;
|
|
2495
|
+
if (currentHour < this.minHour()) {
|
|
2496
|
+
hourIdx = this.findHourIndex(this.minHour());
|
|
2497
|
+
this.updateHourIndex(hourIdx);
|
|
2498
|
+
return;
|
|
2499
|
+
}
|
|
2500
|
+
if (currentHour > this.maxHour()) {
|
|
2501
|
+
hourIdx = this.findHourIndex(this.maxHour());
|
|
2502
|
+
this.updateHourIndex(hourIdx);
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
clampMinuteSelection() {
|
|
2506
|
+
const minutes = this.minutes();
|
|
2507
|
+
const { min: minMinute, max: maxMinute } = this.validMinuteRange();
|
|
2508
|
+
const minuteIdx = this.selectedMinuteIndex();
|
|
2509
|
+
const currentMinute = minutes[minuteIdx] ?? 0;
|
|
2510
|
+
if (currentMinute < minMinute) {
|
|
2511
|
+
const newIdx = findFirstIndexAtLeast(minutes, minMinute);
|
|
2512
|
+
if (newIdx !== -1) {
|
|
2513
|
+
this.updateMinuteIndex(newIdx);
|
|
2514
|
+
}
|
|
2515
|
+
return;
|
|
2516
|
+
}
|
|
2517
|
+
if (currentMinute > maxMinute) {
|
|
2518
|
+
const newIdx = findLastIndexAtMost(minutes, maxMinute);
|
|
2519
|
+
if (newIdx !== -1) {
|
|
2520
|
+
this.updateMinuteIndex(newIdx);
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpTimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2525
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", 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: "<div\n class=\"relative w-37 flex gap-2 rounded-xl border border-border bg-white p-3 shadow-lg\"\n [style.height.px]=\"containerHeight\"\n>\n <!-- Hours scroll wheel -->\n <div class=\"flex-1 relative overflow-hidden\">\n <div\n class=\"h-full overflow-y-scroll snap-y snap-mandatory overscroll-contain [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]\"\n (scroll)=\"onHoursScroll()\"\n #hoursScroll\n >\n <div [style.height.px]=\"padding\"></div>\n\n @for (hour of hours; track $index) {\n <div\n [class.invisible]=\"hourInvisible()[$index]\"\n [class]=\"\n 'h-10 flex items-center justify-center cursor-pointer transition-opacity duration-200 snap-center ' +\n ($index | opacity: selectedHourIndex())\n \"\n \n (click)=\"scrollToHour($index)\"\n (keydown.enter)=\"scrollToHour($index)\"\n >\n <span class=\"text-xl font-medium select-none\">\n {{ hour | number: \"2.0-0\" }}\n </span>\n </div>\n }\n\n <div [style.height.px]=\"padding\"></div>\n </div>\n </div>\n\n <!-- Minutes scroll wheel -->\n <div class=\"flex-1 relative overflow-hidden\">\n <div\n #minutesScroll\n class=\"h-full overflow-y-scroll snap-y snap-mandatory overscroll-contain [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]\"\n (scroll)=\"onMinutesScroll()\"\n >\n <div [style.height.px]=\"padding\"></div>\n\n @for (minute of minutes(); track $index) {\n <div\n [class.invisible]=\"minuteInvisible()[$index]\"\n [class]=\"\n 'h-10 flex items-center justify-center cursor-pointer transition-opacity duration-200 snap-center ' +\n ($index | opacity: selectedMinuteIndex())\n \"\n \n (click)=\"scrollToMinute($index)\"\n (keydown.enter)=\"scrollToMinute($index)\"\n >\n <span class=\"text-xl font-medium select-none\">\n {{ minute | number: \"2.0-0\" }}\n </span>\n </div>\n }\n\n <div [style.height.px]=\"padding\"></div>\n </div>\n </div>\n\n <!-- Center highlight -->\n <div\n class=\"absolute inset-x-0 left-3 right-3 pointer-events-none flex items-center justify-center\"\n [style.top.px]=\"highlightTop\"\n [style.height.px]=\"itemHeight\"\n >\n <div class=\"flex items-center justify-center font-medium w-full h-full bg-accent/30 border border-primary rounded-md shadow-inner\">\n :\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "pipe", type: DecimalPipe, name: "number" }, { kind: "pipe", type: OpacityPipe, name: "opacity" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2341
2526
|
}
|
|
2342
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
2527
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpTimeComponent, decorators: [{
|
|
2343
2528
|
type: Component,
|
|
2344
|
-
args: [{
|
|
2345
|
-
selector: 'up-time',
|
|
2346
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2347
|
-
imports: [
|
|
2529
|
+
args: [{ selector: 'up-time', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
2348
2530
|
DecimalPipe,
|
|
2349
2531
|
OpacityPipe,
|
|
2350
|
-
],
|
|
2351
|
-
template: `
|
|
2352
|
-
<div
|
|
2353
|
-
class="relative w-37 flex gap-2 rounded-xl border border-border bg-white p-3 shadow-lg"
|
|
2354
|
-
[style.height.px]="containerHeight"
|
|
2355
|
-
>
|
|
2356
|
-
<!-- Hours scroll wheel -->
|
|
2357
|
-
<div class="flex-1 relative overflow-hidden">
|
|
2358
|
-
<div
|
|
2359
|
-
class="
|
|
2360
|
-
h-full overflow-y-scroll snap-y snap-mandatory overscroll-contain
|
|
2361
|
-
[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]
|
|
2362
|
-
"
|
|
2363
|
-
(scroll)="onHoursScroll()"
|
|
2364
|
-
|
|
2365
|
-
#hoursScroll
|
|
2366
|
-
>
|
|
2367
|
-
<!-- Top padding -->
|
|
2368
|
-
<div [style.height.px]="padding"></div>
|
|
2369
|
-
|
|
2370
|
-
<!-- Hour items -->
|
|
2371
|
-
@for (hour of hours; track $index) {
|
|
2372
|
-
<div
|
|
2373
|
-
[class.invisible]="hourInvisible()[$index]"
|
|
2374
|
-
[class]="
|
|
2375
|
-
'h-10 flex items-center justify-center cursor-pointer transition-opacity duration-200 snap-center ' +
|
|
2376
|
-
($index | opacity: selectedHourIndex())
|
|
2377
|
-
"
|
|
2378
|
-
(click)="scrollToHour($index)"
|
|
2379
|
-
>
|
|
2380
|
-
<span class="text-xl font-medium">
|
|
2381
|
-
{{ hour | number:'2.0-0' }}
|
|
2382
|
-
</span>
|
|
2383
|
-
</div>
|
|
2384
|
-
}
|
|
2385
|
-
|
|
2386
|
-
<!-- Bottom padding -->
|
|
2387
|
-
<div [style.height.px]="padding"></div>
|
|
2388
|
-
</div>
|
|
2389
|
-
</div>
|
|
2390
|
-
|
|
2391
|
-
<!-- Minutes scroll wheel -->
|
|
2392
|
-
<div class="flex-1 relative overflow-hidden">
|
|
2393
|
-
<div
|
|
2394
|
-
#minutesScroll
|
|
2395
|
-
class="
|
|
2396
|
-
h-full overflow-y-scroll snap-y snap-mandatory overscroll-contain
|
|
2397
|
-
[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]
|
|
2398
|
-
"
|
|
2399
|
-
(scroll)="onMinutesScroll()"
|
|
2400
|
-
>
|
|
2401
|
-
<!-- Top padding -->
|
|
2402
|
-
<div [style.height.px]="padding"></div>
|
|
2403
|
-
|
|
2404
|
-
<!-- Minute items -->
|
|
2405
|
-
@for (minute of minutes(); track $index) {
|
|
2406
|
-
<div
|
|
2407
|
-
[class.invisible]="minuteInvisible()[$index]"
|
|
2408
|
-
[class]="
|
|
2409
|
-
'h-10 flex items-center justify-center cursor-pointer transition-opacity duration-200 snap-center ' +
|
|
2410
|
-
($index | opacity: selectedMinuteIndex())
|
|
2411
|
-
"
|
|
2412
|
-
(click)="scrollToMinute($index)"
|
|
2413
|
-
>
|
|
2414
|
-
<span class="text-xl font-medium">
|
|
2415
|
-
{{ minute | number:'2.0-0' }}
|
|
2416
|
-
</span>
|
|
2417
|
-
</div>
|
|
2418
|
-
}
|
|
2419
|
-
|
|
2420
|
-
<!-- Bottom padding -->
|
|
2421
|
-
<div [style.height.px]="padding"></div>
|
|
2422
|
-
</div>
|
|
2423
|
-
</div>
|
|
2424
|
-
|
|
2425
|
-
<!-- Center highlight -->
|
|
2426
|
-
<div
|
|
2427
|
-
class="absolute inset-x-0 left-3 right-3 pointer-events-none flex items-center justify-center"
|
|
2428
|
-
[style.top.px]="highlightTop"
|
|
2429
|
-
[style.height.px]="itemHeight"
|
|
2430
|
-
>
|
|
2431
|
-
<div class="flex items-center justify-center font-medium w-full h-full bg-accent/30 border border-primary rounded-md shadow-inner">
|
|
2432
|
-
:
|
|
2433
|
-
</div>
|
|
2434
|
-
</div>
|
|
2435
|
-
</div>
|
|
2436
|
-
`,
|
|
2437
|
-
}]
|
|
2532
|
+
], template: "<div\n class=\"relative w-37 flex gap-2 rounded-xl border border-border bg-white p-3 shadow-lg\"\n [style.height.px]=\"containerHeight\"\n>\n <!-- Hours scroll wheel -->\n <div class=\"flex-1 relative overflow-hidden\">\n <div\n class=\"h-full overflow-y-scroll snap-y snap-mandatory overscroll-contain [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]\"\n (scroll)=\"onHoursScroll()\"\n #hoursScroll\n >\n <div [style.height.px]=\"padding\"></div>\n\n @for (hour of hours; track $index) {\n <div\n [class.invisible]=\"hourInvisible()[$index]\"\n [class]=\"\n 'h-10 flex items-center justify-center cursor-pointer transition-opacity duration-200 snap-center ' +\n ($index | opacity: selectedHourIndex())\n \"\n \n (click)=\"scrollToHour($index)\"\n (keydown.enter)=\"scrollToHour($index)\"\n >\n <span class=\"text-xl font-medium select-none\">\n {{ hour | number: \"2.0-0\" }}\n </span>\n </div>\n }\n\n <div [style.height.px]=\"padding\"></div>\n </div>\n </div>\n\n <!-- Minutes scroll wheel -->\n <div class=\"flex-1 relative overflow-hidden\">\n <div\n #minutesScroll\n class=\"h-full overflow-y-scroll snap-y snap-mandatory overscroll-contain [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]\"\n (scroll)=\"onMinutesScroll()\"\n >\n <div [style.height.px]=\"padding\"></div>\n\n @for (minute of minutes(); track $index) {\n <div\n [class.invisible]=\"minuteInvisible()[$index]\"\n [class]=\"\n 'h-10 flex items-center justify-center cursor-pointer transition-opacity duration-200 snap-center ' +\n ($index | opacity: selectedMinuteIndex())\n \"\n \n (click)=\"scrollToMinute($index)\"\n (keydown.enter)=\"scrollToMinute($index)\"\n >\n <span class=\"text-xl font-medium select-none\">\n {{ minute | number: \"2.0-0\" }}\n </span>\n </div>\n }\n\n <div [style.height.px]=\"padding\"></div>\n </div>\n </div>\n\n <!-- Center highlight -->\n <div\n class=\"absolute inset-x-0 left-3 right-3 pointer-events-none flex items-center justify-center\"\n [style.top.px]=\"highlightTop\"\n [style.height.px]=\"itemHeight\"\n >\n <div class=\"flex items-center justify-center font-medium w-full h-full bg-accent/30 border border-primary rounded-md shadow-inner\">\n :\n </div>\n </div>\n</div>\n" }]
|
|
2438
2533
|
}], 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"] }] } });
|
|
2439
2534
|
|
|
2440
2535
|
class UpTimepickerComponent extends UpFieldControlComponent {
|
|
@@ -2503,8 +2598,8 @@ class UpTimepickerComponent extends UpFieldControlComponent {
|
|
|
2503
2598
|
this._onTouched();
|
|
2504
2599
|
this._isTouched = true;
|
|
2505
2600
|
}
|
|
2506
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
2507
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
2601
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpTimepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2602
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.18", 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: [
|
|
2508
2603
|
{
|
|
2509
2604
|
provide: UpFieldControl,
|
|
2510
2605
|
useExisting: forwardRef(() => UpTimepickerComponent),
|
|
@@ -2548,7 +2643,7 @@ class UpTimepickerComponent extends UpFieldControlComponent {
|
|
|
2548
2643
|
</up-popover>
|
|
2549
2644
|
`, 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 }); }
|
|
2550
2645
|
}
|
|
2551
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
2646
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpTimepickerComponent, decorators: [{
|
|
2552
2647
|
type: Component,
|
|
2553
2648
|
args: [{
|
|
2554
2649
|
selector: 'up-timepicker',
|
|
@@ -2626,8 +2721,8 @@ class UpFormFieldComponent {
|
|
|
2626
2721
|
this.control().setControlName(this.label());
|
|
2627
2722
|
});
|
|
2628
2723
|
}
|
|
2629
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
2630
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
2724
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2725
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", 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 }, hideAsterisk: { classPropertyName: "hideAsterisk", publicName: "hideAsterisk", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, queries: [{ propertyName: "control", first: true, predicate: UpFieldControl, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2631
2726
|
<div
|
|
2632
2727
|
class="
|
|
2633
2728
|
group flex flex-col gap-2
|
|
@@ -2666,7 +2761,7 @@ class UpFormFieldComponent {
|
|
|
2666
2761
|
</div>
|
|
2667
2762
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2668
2763
|
}
|
|
2669
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
2764
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpFormFieldComponent, decorators: [{
|
|
2670
2765
|
type: Component,
|
|
2671
2766
|
args: [{
|
|
2672
2767
|
selector: 'up-form-field',
|
|
@@ -2762,7 +2857,7 @@ class UpImagePickerComponent extends UpFieldControlComponent {
|
|
|
2762
2857
|
async selectPhoto(files) {
|
|
2763
2858
|
if (files?.target?.files)
|
|
2764
2859
|
files = files.target.files;
|
|
2765
|
-
if (files
|
|
2860
|
+
if (files?.[0]) {
|
|
2766
2861
|
const compressedFile = await compressImage({
|
|
2767
2862
|
quality: 0.8,
|
|
2768
2863
|
file: files[0],
|
|
@@ -2776,8 +2871,8 @@ class UpImagePickerComponent extends UpFieldControlComponent {
|
|
|
2776
2871
|
this._onChange(compressedFile);
|
|
2777
2872
|
}
|
|
2778
2873
|
}
|
|
2779
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
2780
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
2874
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpImagePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2875
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", 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: [
|
|
2781
2876
|
{
|
|
2782
2877
|
provide: UpFieldControl,
|
|
2783
2878
|
useExisting: forwardRef(() => UpImagePickerComponent)
|
|
@@ -2786,9 +2881,9 @@ class UpImagePickerComponent extends UpFieldControlComponent {
|
|
|
2786
2881
|
matUpload,
|
|
2787
2882
|
matDelete
|
|
2788
2883
|
})
|
|
2789
|
-
], 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 }); }
|
|
2884
|
+
], 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 (keydown.enter)=\"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 (keydown.enter)=\"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 }); }
|
|
2790
2885
|
}
|
|
2791
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
2886
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: UpImagePickerComponent, decorators: [{
|
|
2792
2887
|
type: Component,
|
|
2793
2888
|
args: [{ selector: 'up-image-picker', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2794
2889
|
{
|
|
@@ -2802,12 +2897,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
2802
2897
|
], imports: [
|
|
2803
2898
|
NgIcon,
|
|
2804
2899
|
UpFileDragNDropDirective
|
|
2805
|
-
], 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" }]
|
|
2900
|
+
], 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 (keydown.enter)=\"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 (keydown.enter)=\"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" }]
|
|
2806
2901
|
}], 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 }] }] } });
|
|
2807
2902
|
|
|
2808
2903
|
/**
|
|
2809
2904
|
* Generated bundle index. Do not edit.
|
|
2810
2905
|
*/
|
|
2811
2906
|
|
|
2812
|
-
export { UpCheckboxDirective, UpCountrySelectComponent, UpCurrencySelectComponent, UpDateRangePickerComponent, UpDatepickerComponent, UpFieldControl, UpFieldControlComponent, UpFormFieldComponent, UpImagePickerComponent, UpInputDirective, UpNumberDirective, UpOptionComponent, UpPasswordComponent, UpRadioDirective, UpRadioGroupComponent, UpRateGroupCodeSelectComponent, UpSearchableSelectComponent, UpSelectComponent, UpSwitchComponent, UpTimeComponent, UpTimepickerComponent, isEqualValidator, isNotEqualValidator, setValidator, toggleFormControls, validRangeValidator };
|
|
2907
|
+
export { UpCheckboxDirective, UpCountrySelectComponent, UpCurrencySelectComponent, UpDateRangePickerComponent, UpDatepickerComponent, UpFieldControl, UpFieldControlComponent, UpFormFieldComponent, UpImagePickerComponent, UpInputDirective, UpNumberDirective, UpOptionComponent, UpPasswordComponent, UpPinComponent, UpRadioDirective, UpRadioGroupComponent, UpRateGroupCodeSelectComponent, UpSearchableSelectComponent, UpSelectComponent, UpSwitchComponent, UpTimeComponent, UpTimepickerComponent, isEqualValidator, isNotEqualValidator, setValidator, toggleFormControls, validRangeValidator };
|
|
2813
2908
|
//# sourceMappingURL=unipin-angular-applet-forms.mjs.map
|