@gloww/gloww 20.0.0-beta.26 → 20.0.0-beta.27
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/gloww-gloww.mjs +62 -67
- package/fesm2022/gloww-gloww.mjs.map +1 -1
- package/index.d.ts +18 -22
- package/package.json +1 -1
package/fesm2022/gloww-gloww.mjs
CHANGED
|
@@ -10,7 +10,6 @@ import { MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, Ma
|
|
|
10
10
|
import { CdkScrollable } from '@angular/cdk/scrolling';
|
|
11
11
|
import * as i2 from '@angular/router';
|
|
12
12
|
import { NavigationEnd, RouterLink, RouterModule } from '@angular/router';
|
|
13
|
-
import * as i2$1 from '@angular/material/button';
|
|
14
13
|
import { MatButton, MatButtonModule } from '@angular/material/button';
|
|
15
14
|
import * as i1$1 from '@angular/platform-browser';
|
|
16
15
|
import * as i5 from '@kolkov/angular-editor';
|
|
@@ -22,15 +21,14 @@ import { MatColumnDef, MatTableDataSource, MatTable, MatHeaderCellDef, MatHeader
|
|
|
22
21
|
import { MatProgressSpinner, MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
23
22
|
import { MatCard, MatCardContent, MatCardActions, MatCardHeader, MatCardTitle, MatCardModule } from '@angular/material/card';
|
|
24
23
|
import { MatIcon, MatIconModule } from '@angular/material/icon';
|
|
25
|
-
import { MatError, MatFormField, MatInput, MatLabel, MatInputModule
|
|
24
|
+
import { MatError, MatFormField, MatInput, MatLabel, MatInputModule } from '@angular/material/input';
|
|
26
25
|
import * as i4 from '@ctrl/ngx-codemirror';
|
|
27
26
|
import { CodemirrorModule, CodemirrorComponent } from '@ctrl/ngx-codemirror';
|
|
28
27
|
import * as i1$3 from '@angular/forms';
|
|
29
|
-
import { NG_VALUE_ACCESSOR, FormsModule, UntypedFormControl, ReactiveFormsModule, Validators
|
|
28
|
+
import { NG_VALUE_ACCESSOR, FormsModule, UntypedFormControl, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
30
29
|
import { MatProgressBar, MatProgressBarModule } from '@angular/material/progress-bar';
|
|
31
|
-
import {
|
|
32
|
-
import
|
|
33
|
-
import { NgxMatDatetimePickerModule, NgxMatNativeDateModule, NgxMatTimepickerComponent } from 'ngx-mat-datetime-picker-v2';
|
|
30
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
31
|
+
import { NgxMatDatetimePickerModule, NgxMatTimepickerComponent, NgxMatNativeDateModule } from 'ngx-mat-datetime-picker-v2';
|
|
34
32
|
import * as i1$4 from '@ngx-translate/core';
|
|
35
33
|
import { TranslateDefaultParser } from '@ngx-translate/core';
|
|
36
34
|
import { MatSelect, MatOption, MatSelectModule } from '@angular/material/select';
|
|
@@ -41,7 +39,7 @@ import * as parserTypescript from 'prettier/plugins/typescript';
|
|
|
41
39
|
import * as parserBabel from 'prettier/plugins/babel';
|
|
42
40
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
43
41
|
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
44
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
42
|
+
import { MatFormFieldModule, MatFormField as MatFormField$1, MatLabel as MatLabel$1 } from '@angular/material/form-field';
|
|
45
43
|
import { jwtDecode } from 'jwt-decode';
|
|
46
44
|
import { CdkDrag, CdkDragHandle, DragDropModule } from '@angular/cdk/drag-drop';
|
|
47
45
|
import FileSaver from 'file-saver';
|
|
@@ -3620,32 +3618,29 @@ class DatetimeComponent {
|
|
|
3620
3618
|
this.display = null;
|
|
3621
3619
|
this.placeHolder = null;
|
|
3622
3620
|
this.mode = 'date';
|
|
3623
|
-
this.showSpinners = true;
|
|
3624
3621
|
this.showSeconds = false;
|
|
3625
|
-
this.
|
|
3626
|
-
this.
|
|
3627
|
-
this.dateControl = new FormControl(null);
|
|
3622
|
+
this.inputValue = '';
|
|
3623
|
+
this.isDisabled = false;
|
|
3628
3624
|
this.onChange = () => { };
|
|
3629
3625
|
this.onTouched = () => { };
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
}
|
|
3626
|
+
}
|
|
3627
|
+
get inputType() {
|
|
3628
|
+
return this.mode === 'datetime' ? 'datetime-local' : 'date';
|
|
3629
|
+
}
|
|
3630
|
+
get inputStep() {
|
|
3631
|
+
if (this.mode !== 'datetime') {
|
|
3632
|
+
return null;
|
|
3633
|
+
}
|
|
3634
|
+
return this.showSeconds ? '1' : '60';
|
|
3638
3635
|
}
|
|
3639
3636
|
get value() {
|
|
3640
3637
|
return this._value;
|
|
3641
3638
|
}
|
|
3642
3639
|
set value(val) {
|
|
3643
|
-
this.updateValue(val);
|
|
3640
|
+
this.updateValue(val, true);
|
|
3644
3641
|
}
|
|
3645
3642
|
writeValue(obj) {
|
|
3646
|
-
|
|
3647
|
-
this._value = normalized;
|
|
3648
|
-
this.dateControl.setValue(normalized, { emitEvent: false });
|
|
3643
|
+
this.updateValue(obj, false);
|
|
3649
3644
|
}
|
|
3650
3645
|
registerOnChange(fn) {
|
|
3651
3646
|
this.onChange = fn;
|
|
@@ -3654,37 +3649,40 @@ class DatetimeComponent {
|
|
|
3654
3649
|
this.onTouched = fn;
|
|
3655
3650
|
}
|
|
3656
3651
|
setDisabledState(isDisabled) {
|
|
3657
|
-
|
|
3658
|
-
this.dateControl.disable({ emitEvent: false });
|
|
3659
|
-
}
|
|
3660
|
-
else {
|
|
3661
|
-
this.dateControl.enable({ emitEvent: false });
|
|
3662
|
-
}
|
|
3652
|
+
this.isDisabled = isDisabled;
|
|
3663
3653
|
}
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3654
|
+
onInput(rawValue) {
|
|
3655
|
+
this.inputValue = rawValue;
|
|
3656
|
+
if (!rawValue) {
|
|
3657
|
+
this._value = null;
|
|
3658
|
+
this.onChange(null);
|
|
3659
|
+
return;
|
|
3667
3660
|
}
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
return this.applyLabel;
|
|
3661
|
+
const parsed = this.parseInputValue(rawValue);
|
|
3662
|
+
if (parsed) {
|
|
3663
|
+
this._value = parsed;
|
|
3664
|
+
this.onChange(parsed);
|
|
3673
3665
|
}
|
|
3674
|
-
return 'OK';
|
|
3675
3666
|
}
|
|
3676
|
-
|
|
3677
|
-
this.
|
|
3667
|
+
onBlur() {
|
|
3668
|
+
this.inputValue = this.formatValue(this._value);
|
|
3669
|
+
this.onTouched();
|
|
3678
3670
|
}
|
|
3679
|
-
|
|
3680
|
-
this.
|
|
3671
|
+
updateValue(value, emit) {
|
|
3672
|
+
const normalized = this.normalizeDateValue(value);
|
|
3673
|
+
this._value = normalized;
|
|
3674
|
+
this.inputValue = this.formatValue(normalized);
|
|
3675
|
+
if (emit) {
|
|
3676
|
+
this.onChange(normalized);
|
|
3677
|
+
this.onTouched();
|
|
3678
|
+
}
|
|
3681
3679
|
}
|
|
3682
3680
|
normalizeDateValue(value) {
|
|
3683
3681
|
if (value === undefined || value === null || value === '') {
|
|
3684
3682
|
return null;
|
|
3685
3683
|
}
|
|
3686
3684
|
if (value instanceof Date) {
|
|
3687
|
-
return Number.isNaN(value.getTime()) ? null : value;
|
|
3685
|
+
return Number.isNaN(value.getTime()) ? null : new Date(value.getTime());
|
|
3688
3686
|
}
|
|
3689
3687
|
if (moment.isMoment(value)) {
|
|
3690
3688
|
const date = value.toDate();
|
|
@@ -3704,27 +3702,34 @@ class DatetimeComponent {
|
|
|
3704
3702
|
}
|
|
3705
3703
|
return null;
|
|
3706
3704
|
}
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
this.
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3705
|
+
parseInputValue(rawValue) {
|
|
3706
|
+
if (!rawValue) {
|
|
3707
|
+
return null;
|
|
3708
|
+
}
|
|
3709
|
+
if (this.mode === 'date') {
|
|
3710
|
+
const parsed = moment(rawValue, ['YYYY-MM-DD', 'DD/MM/YYYY', 'MM/DD/YYYY'], true);
|
|
3711
|
+
return parsed.isValid() ? parsed.toDate() : this.normalizeDateValue(rawValue);
|
|
3712
|
+
}
|
|
3713
|
+
const parsed = moment(rawValue, ['YYYY-MM-DDTHH:mm:ss', 'YYYY-MM-DDTHH:mm', ...DatetimeComponent.DATE_FORMATS], true);
|
|
3714
|
+
return parsed.isValid() ? parsed.toDate() : this.normalizeDateValue(rawValue);
|
|
3716
3715
|
}
|
|
3717
|
-
|
|
3718
|
-
|
|
3716
|
+
formatValue(value) {
|
|
3717
|
+
if (!value) {
|
|
3718
|
+
return '';
|
|
3719
|
+
}
|
|
3720
|
+
if (this.mode === 'date') {
|
|
3721
|
+
return moment(value).format('YYYY-MM-DD');
|
|
3722
|
+
}
|
|
3723
|
+
return moment(value).format(this.showSeconds ? 'YYYY-MM-DDTHH:mm:ss' : 'YYYY-MM-DDTHH:mm');
|
|
3719
3724
|
}
|
|
3720
3725
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DatetimeComponent, deps: [{ token: MAT_DATE_LOCALE, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3721
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DatetimeComponent, isStandalone: true, selector: "gloww-datetime", inputs: { _value: ["value", "_value"], display: "display", placeHolder: "placeHolder", mode: "mode",
|
|
3726
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DatetimeComponent, isStandalone: true, selector: "gloww-datetime", inputs: { _value: ["value", "_value"], display: "display", placeHolder: "placeHolder", mode: "mode", showSeconds: "showSeconds" }, providers: [
|
|
3722
3727
|
{
|
|
3723
3728
|
provide: NG_VALUE_ACCESSOR,
|
|
3724
3729
|
multi: true,
|
|
3725
3730
|
useExisting: DatetimeComponent
|
|
3726
3731
|
}
|
|
3727
|
-
], ngImport: i0, template: "<div
|
|
3732
|
+
], ngImport: i0, template: "<div class=\"datetime-wrapper\">\n <mat-form-field>\n @if (display) {\n <mat-label>{{ display }}</mat-label>\n }\n <input\n matInput\n [type]=\"inputType\"\n [step]=\"inputStep\"\n [placeholder]=\"placeHolder\"\n [value]=\"inputValue\"\n [disabled]=\"isDisabled\"\n (input)=\"onInput($any($event.target).value)\"\n (change)=\"onInput($any($event.target).value)\"\n (blur)=\"onBlur()\">\n </mat-form-field>\n</div>\n", styles: [".datetime-wrapper,mat-form-field{width:100%}\n"], dependencies: [{ kind: "component", type: MatFormField$1, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel$1, selector: "mat-label" }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] }); }
|
|
3728
3733
|
}
|
|
3729
3734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DatetimeComponent, decorators: [{
|
|
3730
3735
|
type: Component,
|
|
@@ -3734,7 +3739,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
3734
3739
|
multi: true,
|
|
3735
3740
|
useExisting: DatetimeComponent
|
|
3736
3741
|
}
|
|
3737
|
-
], imports: [MatFormField, MatLabel, MatInput
|
|
3742
|
+
], imports: [MatFormField$1, MatLabel$1, MatInput], template: "<div class=\"datetime-wrapper\">\n <mat-form-field>\n @if (display) {\n <mat-label>{{ display }}</mat-label>\n }\n <input\n matInput\n [type]=\"inputType\"\n [step]=\"inputStep\"\n [placeholder]=\"placeHolder\"\n [value]=\"inputValue\"\n [disabled]=\"isDisabled\"\n (input)=\"onInput($any($event.target).value)\"\n (change)=\"onInput($any($event.target).value)\"\n (blur)=\"onBlur()\">\n </mat-form-field>\n</div>\n", styles: [".datetime-wrapper,mat-form-field{width:100%}\n"] }]
|
|
3738
3743
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
3739
3744
|
type: Optional
|
|
3740
3745
|
}, {
|
|
@@ -3752,18 +3757,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
3752
3757
|
}], mode: [{
|
|
3753
3758
|
type: Input,
|
|
3754
3759
|
args: ['mode']
|
|
3755
|
-
}], showSpinners: [{
|
|
3756
|
-
type: Input
|
|
3757
3760
|
}], showSeconds: [{
|
|
3758
3761
|
type: Input
|
|
3759
|
-
}], disableMinute: [{
|
|
3760
|
-
type: Input
|
|
3761
|
-
}], touchUi: [{
|
|
3762
|
-
type: Input
|
|
3763
|
-
}], cancelLabel: [{
|
|
3764
|
-
type: Input
|
|
3765
|
-
}], applyLabel: [{
|
|
3766
|
-
type: Input
|
|
3767
3762
|
}] } });
|
|
3768
3763
|
|
|
3769
3764
|
class CallbackDirective {
|