@datarailsshared/datarailsshared 1.4.107 → 1.4.109
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/bundles/datarailsshared-datarailsshared.umd.js +48 -27
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.109.tgz +0 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/lib/dr-dialog/components/dialog-modal-wrapper/dialog-modal-wrapper.component.js +6 -4
- package/esm2015/lib/dr-dialog/components/dialog-wrapper/dialog-wrapper.component.js +3 -3
- package/esm2015/lib/dr-dialog/interfaces/dialog-data.js +3 -1
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.js +21 -3
- package/fesm2015/datarailsshared-datarailsshared.js +47 -27
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-dialog/components/dialog-modal-wrapper/dialog-modal-wrapper.component.d.ts +3 -2
- package/lib/dr-dialog/interfaces/dialog-data.d.ts +8 -2
- package/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.d.ts +2 -0
- package/package.json +1 -1
- package/datarailsshared-datarailsshared-1.4.107.tgz +0 -0
|
@@ -3649,8 +3649,8 @@
|
|
|
3649
3649
|
DialogWrapperComponent.decorators = [
|
|
3650
3650
|
{ type: i0.Component, args: [{
|
|
3651
3651
|
selector: 'dr-dialog-wrapper',
|
|
3652
|
-
template: "<div class=\"dialog-wrapper\"\n [class.dialog-wrapper--confirmation-no-title]=\"dialogData.theme?.isConfirmation && !dialogData.title\">\n <i class=\"dr-icon-exit\" data-test=\"close_btn\" (click)=\"closeDialog()\" *ngIf=\"!dialogData?.hideCloseBtn\"></i>\n\n <div header class=\"dialog-wrapper__header\" *ngIf=\"dialogData.title\">\n <h1 class=\"dialog-wrapper__header__title\" data-test=\"dialogTitle\">{{dialogData.title}}</h1>\n <h1 class=\"dialog-wrapper__header__subtitle\" data-test=\"dialogSubtitle\"\n *ngIf=\"dialogData.subtitle\">{{dialogData.subtitle}}</h1>\n </div>\n <div class=\"dialog-wrapper__content\"\n [class.dialog-wrapper__content--no-padding]=\"dialogData.theme?.contentNoPadding\"\n [ngClass]=\"{'flex-position': dialogData.contentIcon?.class && !childComponent}\">\n <span *ngIf=\"dialogData.contentIcon?.class\" class=\"dialog-wrapper__content__icon\">\n <i [ngClass]=\"dialogData.contentIcon.class\" [style.color]=\"dialogData.contentIcon?.color || 'inherit'\"></i>\n </span>\n <span [innerHTML]=\"dialogData.content\"></span>\n <span #content class=\"dialog-wrapper__content__anchor\"> </span>\n </div>\n <div footer class=\"dialog-wrapper__footer\" *ngIf=\"dialogData.cancelButton || dialogData.acceptButton\">\n <div class=\"dialog-wrapper__footer__buttons\">\n <
|
|
3653
|
-
styles: [":host.small-modal{min-height:188px;max-height:467px;min-width:400px;max-width:400px}:host.medium-modal{min-height:188px;max-height:467px;min-width:632px;max-width:632px}:host.large-modal{min-width:750px;max-width:750px}:host.medium-large-modal{min-width:669px;max-width:669px}:host.xl-modal{min-height:188px;max-height:800px;min-width:1100px;max-width:1100px}:host.xl-custom-modal{min-height:188px;max-height:800px;min-width:1100px;max-width:100%}::ng-deep .dialog-wrapper{display:flex;justify-content:space-between;flex-direction:column;position:relative}::ng-deep .dialog-wrapper>.dr-icon-exit{z-index:1;position:absolute;right:32px;top:20px;color:#51566f;cursor:pointer}::ng-deep .dialog-wrapper__header{display:flex;flex-direction:column;padding:8px 52px 8px 32px;border-bottom:1px solid #e5e6ea}::ng-deep .dialog-wrapper__header__title{color:#151b3f;position:static;font-weight:600;font-size:18px;line-height:24px}::ng-deep .dialog-wrapper__header__subtitle{font-size:14px;line-height:20px;margin:0}::ng-deep .dialog-wrapper--confirmation-no-title{padding-top:16px;height:100%}::ng-deep .dialog-wrapper__content{overflow-y:inherit;font-size:14px;font-weight:400;line-height:22px;padding:24px 32px 32px}::ng-deep .dialog-wrapper__content__anchor{display:none}::ng-deep .dialog-wrapper__content--no-padding{padding:0}::ng-deep .dialog-wrapper__content__icon{margin-right:10px;top:5px;position:relative}::ng-deep .dialog-wrapper__content.flex-position{display:flex}::ng-deep .dialog-wrapper__footer{border-top:1px solid #e5e6ea}::ng-deep .dialog-wrapper__footer__buttons{display:flex;justify-content:flex-end;padding-top:10px;padding-right:32px;padding-bottom:11px}::ng-deep .dialog-
|
|
3652
|
+
template: "<div class=\"dialog-wrapper\"\n [class.dialog-wrapper--confirmation-no-title]=\"dialogData.theme?.isConfirmation && !dialogData.title\">\n <i class=\"dr-icon-exit\" data-test=\"close_btn\" (click)=\"closeDialog()\" *ngIf=\"!dialogData?.hideCloseBtn\"></i>\n\n <div header class=\"dialog-wrapper__header\" *ngIf=\"dialogData.title\">\n <h1 class=\"dialog-wrapper__header__title\" data-test=\"dialogTitle\">{{ dialogData.title }}</h1>\n <h1 class=\"dialog-wrapper__header__subtitle\" data-test=\"dialogSubtitle\"\n *ngIf=\"dialogData.subtitle\">{{ dialogData.subtitle }}</h1>\n </div>\n <div class=\"dialog-wrapper__content\"\n [class.dialog-wrapper__content--no-padding]=\"dialogData.theme?.contentNoPadding\"\n [ngClass]=\"{ 'flex-position': dialogData.contentIcon?.class && !childComponent }\">\n <span *ngIf=\"dialogData.contentIcon?.class\" class=\"dialog-wrapper__content__icon\">\n <i [ngClass]=\"dialogData.contentIcon.class\" [style.color]=\"dialogData.contentIcon?.color || 'inherit'\"></i>\n </span>\n <span [innerHTML]=\"dialogData.content\"></span>\n <span #content class=\"dialog-wrapper__content__anchor\"> </span>\n </div>\n <div footer class=\"dialog-wrapper__footer\" *ngIf=\"dialogData.cancelButton || dialogData.acceptButton\">\n <div class=\"dialog-wrapper__footer__buttons\">\n <span *ngIf=\"dialogData.customButton\"\n class=\"dialog-wrapper__footer__button-wrapper\"\n [drTooltip]=\"dialogData.customButton.isDisabled && dialogData.tooltips?.customDisabled\">\n <dr-button (click)=\"onDecline()\"\n [theme]=\"'secondary'\"\n [isLoading]=\"isLoading\"\n data-test=\"declineBtn\"\n [disabled]=\"dialogData.customButton.isDisabled\"\n [drTooltip]=\"dialogData.tooltips?.custom\">{{ dialogData.customButton.label }}</dr-button>\n </span>\n <span *ngIf=\"dialogData.cancelButton\"\n class=\"dialog-wrapper__footer__button-wrapper\"\n [drTooltip]=\"dialogData.cancelButton.isDisabled && dialogData.tooltips?.cancelDisabled\">\n <dr-button (click)=\"closeDialog()\"\n [theme]=\"'secondary'\"\n data-test=\"closeBtn\"\n [disabled]=\"dialogData.cancelButton.isDisabled\"\n [drTooltip]=\"dialogData.tooltips?.cancel\">{{ dialogData.cancelButton.label }}</dr-button>\n </span>\n <span *ngIf=\"dialogData.acceptButton\"\n class=\"dialog-wrapper__footer__button-wrapper\"\n [drTooltip]=\"dialogData.acceptButton.isDisabled && dialogData.tooltips?.acceptDisabled\">\n <dr-button (click)=\"onAcceptDialog()\"\n [theme]=\"dialogData.acceptButton?.theme || 'primary'\"\n [isLoading]=\"isLoading\"\n data-test=\"acceptBtn\"\n [disabled]=\"dialogData.acceptButton.isDisabled\"\n [drTooltip]=\"dialogData.tooltips?.accept\">{{ dialogData.acceptButton.label }}</dr-button>\n </span>\n </div>\n </div>\n</div>\n",
|
|
3653
|
+
styles: [":host.small-modal{min-height:188px;max-height:467px;min-width:400px;max-width:400px}:host.medium-modal{min-height:188px;max-height:467px;min-width:632px;max-width:632px}:host.large-modal{min-width:750px;max-width:750px}:host.medium-large-modal{min-width:669px;max-width:669px}:host.xl-modal{min-height:188px;max-height:800px;min-width:1100px;max-width:1100px}:host.xl-custom-modal{min-height:188px;max-height:800px;min-width:1100px;max-width:100%}::ng-deep .dialog-wrapper{display:flex;justify-content:space-between;flex-direction:column;position:relative}::ng-deep .dialog-wrapper>.dr-icon-exit{z-index:1;position:absolute;right:32px;top:20px;color:#51566f;cursor:pointer}::ng-deep .dialog-wrapper__header{display:flex;flex-direction:column;padding:8px 52px 8px 32px;border-bottom:1px solid #e5e6ea}::ng-deep .dialog-wrapper__header__title{color:#151b3f;position:static;font-weight:600;font-size:18px;line-height:24px}::ng-deep .dialog-wrapper__header__subtitle{font-size:14px;line-height:20px;margin:0}::ng-deep .dialog-wrapper--confirmation-no-title{padding-top:16px;height:100%}::ng-deep .dialog-wrapper__content{overflow-y:inherit;font-size:14px;font-weight:400;line-height:22px;padding:24px 32px 32px}::ng-deep .dialog-wrapper__content__anchor{display:none}::ng-deep .dialog-wrapper__content--no-padding{padding:0}::ng-deep .dialog-wrapper__content__icon{margin-right:10px;top:5px;position:relative}::ng-deep .dialog-wrapper__content.flex-position{display:flex}::ng-deep .dialog-wrapper__footer{border-top:1px solid #e5e6ea}::ng-deep .dialog-wrapper__footer__buttons{display:flex;justify-content:flex-end;padding-top:10px;padding-right:32px;padding-bottom:11px}::ng-deep .dialog-wrapper__footer__button-wrapper:nth-child(n+2){margin-left:12px}\n"]
|
|
3654
3654
|
},] }
|
|
3655
3655
|
];
|
|
3656
3656
|
DialogWrapperComponent.ctorParameters = function () { return [
|
|
@@ -3665,17 +3665,41 @@
|
|
|
3665
3665
|
class: [{ type: i0.HostBinding, args: ['class',] }]
|
|
3666
3666
|
};
|
|
3667
3667
|
|
|
3668
|
+
exports.DIALOG_SIZE = void 0;
|
|
3669
|
+
(function (DIALOG_SIZE) {
|
|
3670
|
+
DIALOG_SIZE["SMALL"] = "small-modal";
|
|
3671
|
+
DIALOG_SIZE["MEDIUM"] = "medium-modal";
|
|
3672
|
+
DIALOG_SIZE["MEDIUM_LARGE"] = "medium-large-modal";
|
|
3673
|
+
DIALOG_SIZE["LARGE"] = "large-modal";
|
|
3674
|
+
DIALOG_SIZE["X_LARGE"] = "xl-modal";
|
|
3675
|
+
DIALOG_SIZE["X_CUSTOM_LARGE"] = "xl-custom-modal";
|
|
3676
|
+
})(exports.DIALOG_SIZE || (exports.DIALOG_SIZE = {}));
|
|
3677
|
+
exports.DIALOG_BUTTON_LABEL = void 0;
|
|
3678
|
+
(function (DIALOG_BUTTON_LABEL) {
|
|
3679
|
+
DIALOG_BUTTON_LABEL["SAVE"] = "Save";
|
|
3680
|
+
DIALOG_BUTTON_LABEL["CANCEL"] = "Cancel";
|
|
3681
|
+
DIALOG_BUTTON_LABEL["CLOSE"] = "Close";
|
|
3682
|
+
})(exports.DIALOG_BUTTON_LABEL || (exports.DIALOG_BUTTON_LABEL = {}));
|
|
3683
|
+
exports.DIALOG_FIELD_TYPE = void 0;
|
|
3684
|
+
(function (DIALOG_FIELD_TYPE) {
|
|
3685
|
+
DIALOG_FIELD_TYPE["INPUT"] = "input";
|
|
3686
|
+
DIALOG_FIELD_TYPE["SELECT"] = "select";
|
|
3687
|
+
DIALOG_FIELD_TYPE["DATE_PICKER"] = "date_picker";
|
|
3688
|
+
DIALOG_FIELD_TYPE["CHECKBOX"] = "checkbox";
|
|
3689
|
+
})(exports.DIALOG_FIELD_TYPE || (exports.DIALOG_FIELD_TYPE = {}));
|
|
3690
|
+
|
|
3668
3691
|
var DialogModalWrapperComponent = /** @class */ (function () {
|
|
3669
3692
|
function DialogModalWrapperComponent(dialogRef, dialogService, dialogData) {
|
|
3670
3693
|
var _a, _b;
|
|
3671
3694
|
this.dialogRef = dialogRef;
|
|
3672
3695
|
this.dialogService = dialogService;
|
|
3673
3696
|
this.dialogData = dialogData;
|
|
3674
|
-
this.
|
|
3697
|
+
this.dialogFieldType = exports.DIALOG_FIELD_TYPE;
|
|
3675
3698
|
this.saving$ = new rxjs.BehaviorSubject(false);
|
|
3676
3699
|
this.isLoading = false;
|
|
3677
3700
|
this.showServerErrorMessage = false;
|
|
3678
3701
|
this.destroy$ = new rxjs.Subject();
|
|
3702
|
+
this.class = (_b = (_a = this === null || this === void 0 ? void 0 : this.dialogData) === null || _a === void 0 ? void 0 : _a.theme) === null || _b === void 0 ? void 0 : _b.themeSize;
|
|
3679
3703
|
}
|
|
3680
3704
|
DialogModalWrapperComponent.prototype.ngOnInit = function () {
|
|
3681
3705
|
if (this.dialogData.fields) {
|
|
@@ -3716,8 +3740,8 @@
|
|
|
3716
3740
|
DialogModalWrapperComponent.decorators = [
|
|
3717
3741
|
{ type: i0.Component, args: [{
|
|
3718
3742
|
selector: 'dr-dialog-modal-wrapper',
|
|
3719
|
-
template: "<div header class=\"header-dialog\">\n <h1 class=\"title-dialog\" data-test=\"modalTitle\">{{dialogData.title}}</h1>\n <i mat-icon-button *ngIf=\"!dialogData.hideCloseBtn\" (click)=\"closeDialog()\" class=\"dr-icon-exit icon-close\"\n data-test=\"xBtn\"></i>\n</div>\n<div *ngIf=\"dialogData.content\" class=\"content-dialog\">\n <ng-container>{{dialogData.content}}</ng-container>\n <span #content class=\"content-anchor\"></span>\n</div>\n<form *ngIf=\"dialogData.fields\" [formGroup]=\"form\" class=\"dr-smart-from\">\n <div class=\"dr-smart-form_wrapper\">\n <div *ngFor=\"let field of dialogData.fields\" class=\"dr-smart-form_group\"\n [ngStyle]=\"{
|
|
3720
|
-
styles: [":host{display:flex;justify-content:space-between;flex-direction:column}:host.small-modal{min-height:188px;max-height:467px;min-width:400px;max-width:400px}:host.medium-modal{min-height:188px;max-height:467px;min-width:632px;max-width:632px}.header-dialog{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:8px 39px 8px 32px;border-bottom:1px solid #e5e6ea}.title-dialog{color:#151b3f;position:static;font-weight:bold;font-size:18px;line-height:24px}.content-dialog{font-weight:400;font-size:14px;padding:16px 32px 5px}.icon-close{color:#51566f;cursor:pointer}.dr-smart-from{font-size:14px;font-weight:500;line-height:22px;padding:16px 32px 22px}.content-dialog{padding:16px 32px 0;font-weight:400;font-size:14px;line-height:22px}.content-anchor{display:none}.footer-dialog{border-top:1px solid #e5e6ea}.buttons-wrapper{display:flex;justify-content:flex-end;padding-top:10px;padding-right:32px;padding-bottom:11px}.buttons-wrapper dr-button:nth-of-type(2){margin-left:12px}.form-error-alert{position:absolute;margin-top:5px;font-size:12px;color:red}.dr-select-footer__btn{background-color:transparent;display:flex;align-items:center;justify-content:flex-start;cursor:pointer;min-width:15rem;font-style:normal;font-weight:400;font-size:14px;line-height:24px;clear:both;width:100%;white-space:nowrap;padding:0 12px;height:36px;flex-shrink:0}\n"]
|
|
3743
|
+
template: "<div header class=\"header-dialog\">\n <h1 class=\"title-dialog\" data-test=\"modalTitle\">{{ dialogData.title }}</h1>\n <i mat-icon-button *ngIf=\"!dialogData.hideCloseBtn\" (click)=\"closeDialog()\" class=\"dr-icon-exit icon-close\"\n data-test=\"xBtn\"></i>\n</div>\n<div *ngIf=\"dialogData.content\" class=\"content-dialog\">\n <ng-container>{{ dialogData.content }}</ng-container>\n <span #content class=\"content-anchor\"></span>\n</div>\n<form *ngIf=\"dialogData.fields\" [formGroup]=\"form\" class=\"dr-smart-from\">\n <div class=\"dr-smart-form_wrapper\">\n <div *ngFor=\"let field of dialogData.fields\" class=\"dr-smart-form_group\"\n [ngStyle]=\"{ display: field.isLabelFullWidth ? 'block' : 'flex' }\">\n <label *ngIf=\"field.label && field.type !== dialogFieldType.CHECKBOX\"\n [ngClass]=\"field.isLabelFullWidth ? 'col-md-12 mb-2' : 'col-md-2'\"\n class=\"label p-0 d-flex align-items-center\">{{ field.label }}</label>\n <div class=\"input-group p-0\"\n [ngClass]=\"{ 'col-md-10': field.label && !field.isLabelFullWidth, 'col-md-12': !field.label || field.isLabelFullWidth }\">\n <dr-select *ngIf=\"field.type === dialogFieldType.SELECT\"\n [searchable]=\"dialogData.searchable\"\n [clearable]=\"dialogData.clearable\"\n [formControlName]=\"field.name\"\n [bindLabel]=\"field.bindLabel || null\"\n [bindValue]=\"field.bindValue || null\"\n [selectedItem]=\"field.default\"\n [items]=\"field.items || (field.items$ | async)\"\n [required]=\"true\"\n [placeholder]=\"field.placeholder\">\n <ng-template *ngIf=\"dialogData?.footerTemplateData\" #optionFooterTemplate let-item=\"item\" let-close=\"close\">\n <button (click)=\"footerAction(); close();\" class=\"dr-select-footer__btn\">\n <i *ngIf=\"dialogData.footerTemplateData.icon\"\n class=\"{{ dialogData.footerTemplateData.icon }}\"></i>\n {{ dialogData.footerTemplateData.label }}</button>\n </ng-template>\n </dr-select>\n <dr-input *ngIf=\"field.type === dialogFieldType.INPUT\" data-test=\"modalInput\" class=\"form-control\"\n [formControlName]=\"field.name\" [placeholder]=\"field.placeholder\"></dr-input>\n <dr-date-picker *ngIf=\"field.type === dialogFieldType.DATE_PICKER\"\n [formControlName]=\"field.name\"\n [format]=\"field.datePickerFormat\"\n [placeholder]=\"field.placeholder\"></dr-date-picker>\n <dr-checkbox *ngIf=\"field.type === dialogFieldType.CHECKBOX\" [formControlName]=\"field.name\">\n {{ field.label }}\n </dr-checkbox>\n <label class=\"form-error-alert\" *ngIf=\"dialogData.errorMessage && !form.pristine && form.invalid\">\n {{ dialogData.errorMessage }}\n </label>\n <label class=\"form-error-alert\"\n *ngIf=\"form.valid && showServerErrorMessage && dialogData.serverErrorMessage\">\n {{ dialogData.serverErrorMessage }}\n </label>\n </div>\n </div>\n </div>\n</form>\n\n<div footer class=\"footer-dialog\">\n <div class=\"buttons-wrapper\" *ngIf=\"dialogData.cancelButton || dialogData.acceptButton\">\n <dr-button *ngIf=\"dialogData.cancelButton\" data-test=\"modalCloseBtn\" (click)=\"closeDialog()\"\n [theme]=\"'secondary'\">{{ dialogData.cancelButton.label }}</dr-button>\n <dr-button *ngIf=\"dialogData.acceptButton\" data-test=\"modalAddBtn\" (click)=\"onAccept()\" [theme]=\"'primary'\"\n [isLoading]=\"isLoading\" [disabled]=\"form.invalid\">{{ dialogData.acceptButton.label }}</dr-button>\n </div>\n</div>\n",
|
|
3744
|
+
styles: [":host{display:flex;justify-content:space-between;flex-direction:column}:host.small-modal{min-height:188px;max-height:467px;min-width:400px;max-width:400px}:host.medium-modal{min-height:188px;max-height:467px;min-width:632px;max-width:632px}.header-dialog{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:8px 39px 8px 32px;border-bottom:1px solid #e5e6ea}.title-dialog{color:#151b3f;position:static;font-weight:bold;font-size:18px;line-height:24px}.content-dialog{font-weight:400;font-size:14px;padding:16px 32px 5px}.icon-close{color:#51566f;cursor:pointer}.dr-smart-from{font-size:14px;font-weight:500;line-height:22px;padding:16px 32px 22px}.dr-smart-from dr-checkbox{font-weight:400}.content-dialog{padding:16px 32px 0;font-weight:400;font-size:14px;line-height:22px}.content-anchor{display:none}.footer-dialog{border-top:1px solid #e5e6ea}.buttons-wrapper{display:flex;justify-content:flex-end;padding-top:10px;padding-right:32px;padding-bottom:11px}.buttons-wrapper dr-button:nth-of-type(2){margin-left:12px}.form-error-alert{position:absolute;margin-top:5px;font-size:12px;color:red}.dr-select-footer__btn{background-color:transparent;display:flex;align-items:center;justify-content:flex-start;cursor:pointer;min-width:15rem;font-style:normal;font-weight:400;font-size:14px;line-height:24px;clear:both;width:100%;white-space:nowrap;padding:0 12px;height:36px;flex-shrink:0}\n"]
|
|
3721
3745
|
},] }
|
|
3722
3746
|
];
|
|
3723
3747
|
DialogModalWrapperComponent.ctorParameters = function () { return [
|
|
@@ -3815,27 +3839,6 @@
|
|
|
3815
3839
|
TooltipPosition["LEFT_BOTTOM"] = "left-bottom";
|
|
3816
3840
|
})(exports.TooltipPosition || (exports.TooltipPosition = {}));
|
|
3817
3841
|
|
|
3818
|
-
exports.DIALOG_SIZE = void 0;
|
|
3819
|
-
(function (DIALOG_SIZE) {
|
|
3820
|
-
DIALOG_SIZE["SMALL"] = "small-modal";
|
|
3821
|
-
DIALOG_SIZE["MEDIUM"] = "medium-modal";
|
|
3822
|
-
DIALOG_SIZE["MEDIUM_LARGE"] = "medium-large-modal";
|
|
3823
|
-
DIALOG_SIZE["LARGE"] = "large-modal";
|
|
3824
|
-
DIALOG_SIZE["X_LARGE"] = "xl-modal";
|
|
3825
|
-
DIALOG_SIZE["X_CUSTOM_LARGE"] = "xl-custom-modal";
|
|
3826
|
-
})(exports.DIALOG_SIZE || (exports.DIALOG_SIZE = {}));
|
|
3827
|
-
exports.DIALOG_BUTTON_LABEL = void 0;
|
|
3828
|
-
(function (DIALOG_BUTTON_LABEL) {
|
|
3829
|
-
DIALOG_BUTTON_LABEL["SAVE"] = "Save";
|
|
3830
|
-
DIALOG_BUTTON_LABEL["CANCEL"] = "Cancel";
|
|
3831
|
-
DIALOG_BUTTON_LABEL["CLOSE"] = "Close";
|
|
3832
|
-
})(exports.DIALOG_BUTTON_LABEL || (exports.DIALOG_BUTTON_LABEL = {}));
|
|
3833
|
-
exports.DIALOG_FIELD_TYPE = void 0;
|
|
3834
|
-
(function (DIALOG_FIELD_TYPE) {
|
|
3835
|
-
DIALOG_FIELD_TYPE["INPUT"] = "input";
|
|
3836
|
-
DIALOG_FIELD_TYPE["SELECT"] = "select";
|
|
3837
|
-
})(exports.DIALOG_FIELD_TYPE || (exports.DIALOG_FIELD_TYPE = {}));
|
|
3838
|
-
|
|
3839
3842
|
var DrModelDebounceChangeDirective = /** @class */ (function () {
|
|
3840
3843
|
function DrModelDebounceChangeDirective(ngModel) {
|
|
3841
3844
|
this.ngModel = ngModel;
|
|
@@ -4609,6 +4612,7 @@
|
|
|
4609
4612
|
_a[exports.TimeframeOption.DAY] = function (forward) { return _this.pagingDateChange('addCalendarDays', 1, forward); },
|
|
4610
4613
|
_a[exports.TimeframeOption.WEEK] = function (forward) { return _this.pagingDateChange('addCalendarDays', 7, forward); },
|
|
4611
4614
|
_a);
|
|
4615
|
+
_this.onChangeDebounced$ = new rxjs.Subject();
|
|
4612
4616
|
datePickerService.isTimeframeSelectionEnabled = true;
|
|
4613
4617
|
datePickerService.format$.pipe(operators.takeUntil(_this.destroyed$)).subscribe(function (value) {
|
|
4614
4618
|
_this.onChangeFormat.emit(datePickerService.normalizeValue(value));
|
|
@@ -4658,8 +4662,14 @@
|
|
|
4658
4662
|
configurable: true
|
|
4659
4663
|
});
|
|
4660
4664
|
DrDatePickerWithTimeframeComponent.prototype.ngOnInit = function () {
|
|
4665
|
+
var _this = this;
|
|
4661
4666
|
this.datePickerService.isTimeframeSelectionEnabled = this.canSelectTimeframe;
|
|
4662
4667
|
this.cdr.markForCheck();
|
|
4668
|
+
if (this.paginationDebounce) {
|
|
4669
|
+
this.onChangeDebounced$.pipe(operators.takeUntil(this.destroyed$), operators.debounceTime(this.paginationDebounce)).subscribe(function (value) {
|
|
4670
|
+
_this.onChangeCallback(value);
|
|
4671
|
+
});
|
|
4672
|
+
}
|
|
4663
4673
|
};
|
|
4664
4674
|
DrDatePickerWithTimeframeComponent.prototype.pagingClicked = function (forward) {
|
|
4665
4675
|
if (this.pagingSetup[this.datePickerService.timeframe]) {
|
|
@@ -4669,7 +4679,17 @@
|
|
|
4669
4679
|
};
|
|
4670
4680
|
DrDatePickerWithTimeframeComponent.prototype.pagingDateChange = function (actionCall, amount, forward) {
|
|
4671
4681
|
var newValue = this.dateAdapter[actionCall](this.innerValue, forward ? amount : -amount);
|
|
4672
|
-
this.
|
|
4682
|
+
if (this.paginationDebounce) {
|
|
4683
|
+
// this is required for not sending extra requests when user quickly clicking on pagination
|
|
4684
|
+
// here we do the same as in setValueFromMoment(newValue) with difference
|
|
4685
|
+
// that updating of ngModel/formControl is debounced
|
|
4686
|
+
var timestamp = newValue.unix();
|
|
4687
|
+
this.writeValue(timestamp);
|
|
4688
|
+
this.onChangeDebounced$.next(this.innerValue.unix());
|
|
4689
|
+
}
|
|
4690
|
+
else {
|
|
4691
|
+
this.setValueFromMoment(newValue);
|
|
4692
|
+
}
|
|
4673
4693
|
};
|
|
4674
4694
|
return DrDatePickerWithTimeframeComponent;
|
|
4675
4695
|
}(DrDatePickerComponent));
|
|
@@ -4696,6 +4716,7 @@
|
|
|
4696
4716
|
dateFormatConfig: [{ type: i0.Input }],
|
|
4697
4717
|
canSelectTimeframe: [{ type: i0.Input }],
|
|
4698
4718
|
availableTimeframes: [{ type: i0.Input }],
|
|
4719
|
+
paginationDebounce: [{ type: i0.Input }],
|
|
4699
4720
|
onChangeFormat: [{ type: i0.Output }]
|
|
4700
4721
|
};
|
|
4701
4722
|
|