ng-inail-common 2.0.21 → 2.0.25
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/ng-inail-common.umd.js +244 -15
- package/bundles/ng-inail-common.umd.js.map +1 -1
- package/bundles/ng-inail-common.umd.min.js +2 -2
- package/bundles/ng-inail-common.umd.min.js.map +1 -1
- package/esm2015/lib/components/core/form/form-element.component.js +2 -1
- package/esm2015/lib/components/core/form/input-file/input-file.component.js +3 -1
- package/esm2015/lib/components/core/form/multi-select/multi-select.component.js +121 -0
- package/esm2015/lib/components/core/table/table/table.component.js +54 -8
- package/esm2015/lib/components/core/ux/feedback/feedback.component.js +5 -3
- package/esm2015/lib/components/core/ux/progress-bar/progress-bar.component.js +50 -0
- package/esm2015/lib/ng-inail-common.module.js +9 -3
- package/esm2015/public-api.js +3 -1
- package/fesm2015/ng-inail-common.js +231 -12
- package/fesm2015/ng-inail-common.js.map +1 -1
- package/lib/components/core/form/multi-select/multi-select.component.d.ts +40 -0
- package/lib/components/core/table/table/table.component.d.ts +13 -3
- package/lib/components/core/ux/feedback/feedback.component.d.ts +1 -0
- package/lib/components/core/ux/progress-bar/progress-bar.component.d.ts +12 -0
- package/ng-inail-common.metadata.json +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -2975,6 +2975,7 @@
|
|
|
2975
2975
|
_this.error = undefined;
|
|
2976
2976
|
_this.errorChange.emit(undefined);
|
|
2977
2977
|
}
|
|
2978
|
+
_this.formElementCdr.detectChanges();
|
|
2978
2979
|
});
|
|
2979
2980
|
};
|
|
2980
2981
|
FormElementComponent.prototype.registerOnChange = function (fn) {
|
|
@@ -3503,6 +3504,7 @@
|
|
|
3503
3504
|
_this.showIcon = true;
|
|
3504
3505
|
_this.autoCatchFocus = false;
|
|
3505
3506
|
_this.scrollToFocus = true;
|
|
3507
|
+
_this.labelFeedback = false;
|
|
3506
3508
|
// hasContent = () => this.feedbackContent?.nativeElement?.childElementCount > 0;
|
|
3507
3509
|
_this.hasContent = function () { var _a, _b; return isNotBlankOrNull((_b = (_a = _this.feedbackContent) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.textContent); };
|
|
3508
3510
|
_this.logPrefix = '[inail-feedback]';
|
|
@@ -3549,10 +3551,10 @@
|
|
|
3549
3551
|
FeedbackComponent.decorators = [
|
|
3550
3552
|
{ type: core.Component, args: [{
|
|
3551
3553
|
selector: 'inail-feedback',
|
|
3552
|
-
template: "<div [id]='id'\n class=\"row feedback-box inail-feedback {{class}}\"\n [ngClass]=\"{'feedback-box-error': type==errorType, 'global-feedback': globalFeedback === true}\">\n <div>\n <div class=\"feedback-header\"\n [ngClass]=\"{'feedback-header-error': type==errorType}\">\n <span>\n <span class=\"fa white-check\"\n [ngClass]=\"{'fa-times': showIcon && type==errorType,\n 'fa-check':showIcon && (type==successType || !type)}\"></span>\n <span tabindex=\"0\" [id]=\"id+'-message'\" class=\"feedback-focusable\" [innerHTML]=\"message\" #mainMessage></span>\n </span>\n </div>\n <div [hidden]=\"!hasContent()\"\n class=\"feedback-content\"\n [ngClass]=\"contentClass\"\n #feedbackContent>\n <p *ngIf=\"contentTitle\">\n <strong>{{contentTitle}}</strong>\n </p>\n <ng-container *ngIf=\"detailsAsList || detailsAsOrderedList\">\n <ol *ngIf=\"detailsAsOrderedList\">\n <li *ngFor=\"let dettaglio of details\" [innerHTML]=\"dettaglio\"></li>\n </ol>\n <ul *ngIf=\"detailsAsList && !detailsAsOrderedList\">\n <li *ngFor=\"let dettaglio of details\" [innerHTML]=\"dettaglio\"></li>\n </ul>\n </ng-container>\n <ng-container *ngIf=\"!(detailsAsList || detailsAsOrderedList)\">\n <p *ngFor=\"let dettaglio of details\" [innerHTML]=\"dettaglio\"></p>\n </ng-container>\n <p><ng-content></ng-content></p>\n </div>\n </div>\n</div>\n",
|
|
3554
|
+
template: "<div *ngIf=\"!labelFeedback\"\n [id]='id'\n class=\"row feedback-box inail-feedback {{class}}\"\n [ngClass]=\"{'feedback-box-error': type==errorType, 'global-feedback': globalFeedback === true}\">\n <div>\n <div class=\"feedback-header\"\n [ngClass]=\"{'feedback-header-error': type==errorType}\">\n <span>\n <span class=\"fa white-check\"\n [ngClass]=\"{'fa-times': showIcon && type==errorType,\n 'fa-check':showIcon && (type==successType || !type)}\"></span>\n <span tabindex=\"0\" [id]=\"id+'-message'\" class=\"feedback-focusable\" [innerHTML]=\"message\" #mainMessage></span>\n </span>\n </div>\n <div [hidden]=\"!hasContent()\"\n class=\"feedback-content\"\n [ngClass]=\"contentClass\"\n #feedbackContent>\n <p *ngIf=\"contentTitle\">\n <strong>{{contentTitle}}</strong>\n </p>\n <ng-container *ngIf=\"detailsAsList || detailsAsOrderedList\">\n <ol *ngIf=\"detailsAsOrderedList\">\n <li *ngFor=\"let dettaglio of details\" [innerHTML]=\"dettaglio\"></li>\n </ol>\n <ul *ngIf=\"detailsAsList && !detailsAsOrderedList\">\n <li *ngFor=\"let dettaglio of details\" [innerHTML]=\"dettaglio\"></li>\n </ul>\n </ng-container>\n <ng-container *ngIf=\"!(detailsAsList || detailsAsOrderedList)\">\n <p *ngFor=\"let dettaglio of details\" [innerHTML]=\"dettaglio\"></p>\n </ng-container>\n <p><ng-content></ng-content></p>\n </div>\n </div>\n</div>\n<span *ngIf=\"labelFeedback\"\n [id]='id'\n class=\"inail-feedback col-xs-12 form-group {{class}}\"\n [ngClass]=\"{'feedback-box-error': type==errorType, 'global-feedback': globalFeedback === true}\">\n <span *ngIf=\"showIcon\"\n class=\"green-check fa fa-check-circle\"\n [ngClass]=\"{'green-check fa-check-circle': type==successType || !type, 'red-check fa-times-circle': type==errorType}\"></span>\n <strong tabindex=\"0\"\n [id]=\"id+'-message'\"\n class=\"labelFeedback feedback-focusable\"\n [innerHTML]=\"message\" #mainMessage>\n </strong>\n</span>\n",
|
|
3553
3555
|
changeDetection: CHANGE_DETECTION_STRATEGY,
|
|
3554
3556
|
encapsulation: core.ViewEncapsulation.None,
|
|
3555
|
-
styles: [".inail-feedback.feedback-box{margin-bottom:15px!important}.inail-feedback .feedback-content{padding-top:30px!important}.inail-feedback .feedback-content p{padding-top:0!important}.inail-feedback .feedback-header .feedback-focusable:focus{outline:1px dotted #fff!important}"]
|
|
3557
|
+
styles: [".inail-feedback.feedback-box{margin-bottom:15px!important}.inail-feedback .feedback-content{padding-top:30px!important}.inail-feedback .feedback-content p{padding-top:0!important}.inail-feedback .feedback-header .feedback-focusable:focus{outline:1px dotted #fff!important}.inail-feedback .fa.fa-times-circle{color:#c9291b;margin-right:5px}"]
|
|
3556
3558
|
},] }
|
|
3557
3559
|
];
|
|
3558
3560
|
FeedbackComponent.ctorParameters = function () { return [
|
|
@@ -3572,6 +3574,7 @@
|
|
|
3572
3574
|
focus: [{ type: core.Input }],
|
|
3573
3575
|
autoCatchFocus: [{ type: core.Input }],
|
|
3574
3576
|
scrollToFocus: [{ type: core.Input }],
|
|
3577
|
+
labelFeedback: [{ type: core.Input }],
|
|
3575
3578
|
feedbackContent: [{ type: core.ViewChild, args: ['feedbackContent',] }]
|
|
3576
3579
|
};
|
|
3577
3580
|
var Feedback = /** @class */ (function () {
|
|
@@ -5230,11 +5233,6 @@
|
|
|
5230
5233
|
var DEFAULT_TABLE_LENGTH$1 = 10;
|
|
5231
5234
|
var ASC = 'asc';
|
|
5232
5235
|
var DESC = 'desc';
|
|
5233
|
-
var PaginationState = /** @class */ (function () {
|
|
5234
|
-
function PaginationState() {
|
|
5235
|
-
}
|
|
5236
|
-
return PaginationState;
|
|
5237
|
-
}());
|
|
5238
5236
|
var TableComponent = /** @class */ (function (_super) {
|
|
5239
5237
|
__extends(TableComponent, _super);
|
|
5240
5238
|
function TableComponent(cdr, renderer) {
|
|
@@ -5280,7 +5278,7 @@
|
|
|
5280
5278
|
}
|
|
5281
5279
|
TableComponent.prototype.ngOnChanges = function (changes) {
|
|
5282
5280
|
var _this = this;
|
|
5283
|
-
var _a, _b, _c, _d, _e, _f;
|
|
5281
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
5284
5282
|
_super.prototype.ngOnChanges.call(this, changes);
|
|
5285
5283
|
// Controllo se la paginazione richiesta e' interna o esterna
|
|
5286
5284
|
if (!this.externalPaginationSorting
|
|
@@ -5288,6 +5286,16 @@
|
|
|
5288
5286
|
&& ((_b = changes.paginationState) === null || _b === void 0 ? void 0 : _b.currentValue) != undefined) {
|
|
5289
5287
|
this.externalPaginationSorting = true;
|
|
5290
5288
|
}
|
|
5289
|
+
// Se per la paginazione esterna viene specificata una proprieta di sorting
|
|
5290
|
+
// attivo il componente thLabel associato
|
|
5291
|
+
if ((_d = (_c = changes.paginationState) === null || _c === void 0 ? void 0 : _c.currentValue) === null || _d === void 0 ? void 0 : _d.sortProperty) {
|
|
5292
|
+
this.attivaThLabelOrdinamentoSpecificato();
|
|
5293
|
+
}
|
|
5294
|
+
// Se per la paginazione interna viene specificato un ordinamento iniziale
|
|
5295
|
+
// attivo il componente thLabel associato
|
|
5296
|
+
if ((_f = (_e = changes.initialSort) === null || _e === void 0 ? void 0 : _e.currentValue) === null || _f === void 0 ? void 0 : _f.sortProperty) {
|
|
5297
|
+
this.attivaThLabelOrdinamentoSpecificato();
|
|
5298
|
+
}
|
|
5291
5299
|
// Verifico se e' cambiata la lista degli elementi in input.
|
|
5292
5300
|
// Nel caso in cui si stia effettuando una paginazione interna
|
|
5293
5301
|
// emetto il sottoinsieme inerente la prima pagina
|
|
@@ -5301,7 +5309,7 @@
|
|
|
5301
5309
|
}
|
|
5302
5310
|
// Richiesta di paginazione
|
|
5303
5311
|
if (!this.externalPaginationSorting
|
|
5304
|
-
&& ((
|
|
5312
|
+
&& ((_g = changes.doPagination) === null || _g === void 0 ? void 0 : _g.currentValue)) {
|
|
5305
5313
|
this.push(changes.doPagination.currentValue.subscribe(function (info) {
|
|
5306
5314
|
_this.lengthOnChange(info.pageSize);
|
|
5307
5315
|
setTimeout(function () { return _this.doSorting(info.sortProperty, info.sortDirection); }, 100);
|
|
@@ -5315,12 +5323,12 @@
|
|
|
5315
5323
|
this.lengthOnChange(this.elementsPerPage);
|
|
5316
5324
|
}
|
|
5317
5325
|
// Calcolo il numero di colonne visibili
|
|
5318
|
-
if (((
|
|
5326
|
+
if (((_h = changes.noDataFound) === null || _h === void 0 ? void 0 : _h.currentValue) === true) {
|
|
5319
5327
|
// setTimeout(() => this.numeroColonne = document.querySelectorAll(`#${this.id} th`).length);
|
|
5320
5328
|
this.numeroColonne = document.querySelectorAll("#" + this.id + " th").length;
|
|
5321
5329
|
}
|
|
5322
|
-
if ((
|
|
5323
|
-
this.righeSelezionabili = __spread((
|
|
5330
|
+
if ((_j = changes.selectableRowValues) === null || _j === void 0 ? void 0 : _j.currentValue) {
|
|
5331
|
+
this.righeSelezionabili = __spread((_k = changes.selectableRowValues) === null || _k === void 0 ? void 0 : _k.currentValue);
|
|
5324
5332
|
}
|
|
5325
5333
|
this.cdr.detectChanges();
|
|
5326
5334
|
};
|
|
@@ -5339,6 +5347,7 @@
|
|
|
5339
5347
|
var _this = this;
|
|
5340
5348
|
this.inizializzaTabella(this.thLabelComponents);
|
|
5341
5349
|
this.lookAtThLabel(this.thLabelComponents);
|
|
5350
|
+
this.attivaThLabelOrdinamentoSpecificato();
|
|
5342
5351
|
setTimeout(function () { var _a; return _this.visualizzaBaseFooter = ((_a = _this.baseFooter) === null || _a === void 0 ? void 0 : _a.nativeElement.childElementCount) > 0; });
|
|
5343
5352
|
this.cdr.detectChanges();
|
|
5344
5353
|
};
|
|
@@ -5654,6 +5663,43 @@
|
|
|
5654
5663
|
return !this.disablePagination
|
|
5655
5664
|
&& (this.dataSource != undefined || (this.externalPaginationSorting != undefined && this.paginationState != undefined));
|
|
5656
5665
|
};
|
|
5666
|
+
/**
|
|
5667
|
+
* Attiva il th label inerente l'ordinamento specificato
|
|
5668
|
+
*/
|
|
5669
|
+
TableComponent.prototype.attivaThLabelOrdinamentoSpecificato = function () {
|
|
5670
|
+
var _this = this;
|
|
5671
|
+
if (this.thLabelComponents) {
|
|
5672
|
+
// Paginazione esterna
|
|
5673
|
+
if (this.externalPaginationSorting && this.paginationState) {
|
|
5674
|
+
var thLabel = this.thLabelComponents.find(function (item) { return item.property == _this.paginationState.sortProperty; });
|
|
5675
|
+
this.setSortDirection(thLabel, this.paginationState.sortDirection);
|
|
5676
|
+
}
|
|
5677
|
+
// Ordinamento iniziale paginazione interna
|
|
5678
|
+
else if (this.initialSort) {
|
|
5679
|
+
this.thLabelComponents.forEach(function (thLabel) {
|
|
5680
|
+
thLabel.property == _this.initialSort.sortProperty
|
|
5681
|
+
? _this.setSortDirection(thLabel, _this.initialSort.sortDirection)
|
|
5682
|
+
: _this.setSortDirection(thLabel, undefined);
|
|
5683
|
+
});
|
|
5684
|
+
}
|
|
5685
|
+
}
|
|
5686
|
+
};
|
|
5687
|
+
TableComponent.prototype.setSortDirection = function (thLabel, direction) {
|
|
5688
|
+
if (thLabel) {
|
|
5689
|
+
switch (direction) {
|
|
5690
|
+
case "asc":
|
|
5691
|
+
thLabel.direction = ThLabelComponent.ASC;
|
|
5692
|
+
break;
|
|
5693
|
+
case "desc":
|
|
5694
|
+
thLabel.direction = ThLabelComponent.DESC;
|
|
5695
|
+
break;
|
|
5696
|
+
default:
|
|
5697
|
+
thLabel.direction = ThLabelComponent.UNSORTED;
|
|
5698
|
+
break;
|
|
5699
|
+
}
|
|
5700
|
+
this.modificaTh(thLabel);
|
|
5701
|
+
}
|
|
5702
|
+
};
|
|
5657
5703
|
return TableComponent;
|
|
5658
5704
|
}(ResponsiveElementComponent));
|
|
5659
5705
|
TableComponent.decorators = [
|
|
@@ -5675,6 +5721,7 @@
|
|
|
5675
5721
|
displayedDataChange: [{ type: core.Output }],
|
|
5676
5722
|
doPagination: [{ type: core.Input }],
|
|
5677
5723
|
elementsPerPage: [{ type: core.Input }],
|
|
5724
|
+
initialSort: [{ type: core.Input }],
|
|
5678
5725
|
paginationState: [{ type: core.Input }],
|
|
5679
5726
|
elementsPerPageOptions: [{ type: core.Input }],
|
|
5680
5727
|
noDataFound: [{ type: core.Input }],
|
|
@@ -5744,11 +5791,13 @@
|
|
|
5744
5791
|
if (!this.addButton) {
|
|
5745
5792
|
this.fileChange.emit(this.fileModel);
|
|
5746
5793
|
}
|
|
5794
|
+
this.cleanError();
|
|
5747
5795
|
this.cdr.detectChanges();
|
|
5748
5796
|
};
|
|
5749
5797
|
InputFileComponent.prototype.reset = function () {
|
|
5750
5798
|
this.fileModel = undefined;
|
|
5751
5799
|
this.fileChange.emit(undefined);
|
|
5800
|
+
this.cleanError();
|
|
5752
5801
|
this.cdr.detectChanges();
|
|
5753
5802
|
};
|
|
5754
5803
|
return InputFileComponent;
|
|
@@ -6253,6 +6302,181 @@
|
|
|
6253
6302
|
selectorComponent: [{ type: core.ViewChild, args: [SelectorComponent,] }]
|
|
6254
6303
|
};
|
|
6255
6304
|
|
|
6305
|
+
var ProgressBarComponent = /** @class */ (function (_super) {
|
|
6306
|
+
__extends(ProgressBarComponent, _super);
|
|
6307
|
+
function ProgressBarComponent(cdr) {
|
|
6308
|
+
var _this = _super.call(this, cdr) || this;
|
|
6309
|
+
_this.cdr = cdr;
|
|
6310
|
+
_this.valuenow = 0;
|
|
6311
|
+
_this.logPrefix = "[inail-progress-bar]";
|
|
6312
|
+
_this.detach();
|
|
6313
|
+
return _this;
|
|
6314
|
+
}
|
|
6315
|
+
ProgressBarComponent.prototype.ngOnChanges = function (changes) {
|
|
6316
|
+
var _a;
|
|
6317
|
+
_super.prototype.ngOnChanges.call(this, changes);
|
|
6318
|
+
if ((_a = changes === null || changes === void 0 ? void 0 : changes.valuenow) === null || _a === void 0 ? void 0 : _a.currentValue) {
|
|
6319
|
+
if (this.valuenow < 0) {
|
|
6320
|
+
this.valuenow = 0;
|
|
6321
|
+
}
|
|
6322
|
+
else if (this.valuenow > 100) {
|
|
6323
|
+
this.valuenow = 100;
|
|
6324
|
+
}
|
|
6325
|
+
}
|
|
6326
|
+
this.cdr.detectChanges();
|
|
6327
|
+
};
|
|
6328
|
+
ProgressBarComponent.prototype.ngOnInit = function () {
|
|
6329
|
+
_super.prototype.ngOnInit.call(this);
|
|
6330
|
+
};
|
|
6331
|
+
ProgressBarComponent.prototype.ngAfterViewInit = function () {
|
|
6332
|
+
};
|
|
6333
|
+
ProgressBarComponent.prototype.ngOnDestroy = function () {
|
|
6334
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
6335
|
+
};
|
|
6336
|
+
return ProgressBarComponent;
|
|
6337
|
+
}(ResponsiveElementComponent));
|
|
6338
|
+
ProgressBarComponent.decorators = [
|
|
6339
|
+
{ type: core.Component, args: [{
|
|
6340
|
+
selector: 'inail-progress-bar',
|
|
6341
|
+
template: "<div [id]=\"id\"\n class=\"inail-progress-bar {{getResponsiveClass()}} noPaddingLeft noPaddingRight {{class}}\">\n <span *ngIf=\"label\" [innerHTML]=\"label\"></span>\n <span class=\"progress\">\n <span role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n title=\"Stato avanzamento: {{valuenow}}%\"\n class=\"progress-bar\"\n [ngClass]=\"{'progress-bar-25': valuenow <= 25, 'progress-bar-50': valuenow > 25 && valuenow <= 50, 'progress-bar-75': valuenow > 50 && valuenow <= 75, 'progress-bar-100': valuenow == 100}\"\n [attr.aria-valuenow]=\"valuenow\"\n [style.width.%]=\"valuenow\">\n </span>\n </span>\n</div>\n",
|
|
6342
|
+
changeDetection: CHANGE_DETECTION_STRATEGY,
|
|
6343
|
+
encapsulation: core.ViewEncapsulation.None,
|
|
6344
|
+
styles: [""]
|
|
6345
|
+
},] }
|
|
6346
|
+
];
|
|
6347
|
+
ProgressBarComponent.ctorParameters = function () { return [
|
|
6348
|
+
{ type: core.ChangeDetectorRef }
|
|
6349
|
+
]; };
|
|
6350
|
+
ProgressBarComponent.propDecorators = {
|
|
6351
|
+
label: [{ type: core.Input }],
|
|
6352
|
+
valuenow: [{ type: core.Input }]
|
|
6353
|
+
};
|
|
6354
|
+
|
|
6355
|
+
var MultiSelectComponent = /** @class */ (function (_super) {
|
|
6356
|
+
__extends(MultiSelectComponent, _super);
|
|
6357
|
+
function MultiSelectComponent(cdr) {
|
|
6358
|
+
var _this = _super.call(this, cdr) || this;
|
|
6359
|
+
_this.cdr = cdr;
|
|
6360
|
+
_this.options = [];
|
|
6361
|
+
_this.values = [];
|
|
6362
|
+
_this.valuesChange = new core.EventEmitter();
|
|
6363
|
+
_this.placeholder = '- seleziona opzioni -';
|
|
6364
|
+
_this.toggle = function () { return window['$'](_this.formControlElement.nativeElement).dropdown('toggle'); };
|
|
6365
|
+
_this.isExpanded = function () { return _this.formControlElement.nativeElement.getAttribute('aria-expanded') === 'true'; };
|
|
6366
|
+
_this.hasFormControlFocus = function () { return _this.formControlElement.nativeElement.matches(':focus'); };
|
|
6367
|
+
_this.hasDropdownMenuFocus = function () { return _this.dropdownMenu.nativeElement.matches(':focus-within'); };
|
|
6368
|
+
_this.isChecked = function (value) { return _this.values.some(function (v) { return v === value; }); };
|
|
6369
|
+
_this.getInputTextValue = function () { return _this.options.filter(function (opt) { return _this.isChecked(opt.value); }).map(function (opt) { return opt.label; }).join(', '); };
|
|
6370
|
+
_this.pushValue = function (value) { return _this.values = _this.options.filter(function (opt) { return opt.value === value || _this.isChecked(opt.value); }).map(function (opt) { return opt.value; }); };
|
|
6371
|
+
_this.isFocusOut = function () { return window['$'](_this.multiSelect.nativeElement).find(document.activeElement).length == 0; };
|
|
6372
|
+
_this.logPrefix = "[inail-multi-select]";
|
|
6373
|
+
_this.detach();
|
|
6374
|
+
return _this;
|
|
6375
|
+
}
|
|
6376
|
+
MultiSelectComponent.prototype.ngOnChanges = function (changes) {
|
|
6377
|
+
var _a, _b, _c;
|
|
6378
|
+
_super.prototype.ngOnChanges.call(this, changes);
|
|
6379
|
+
if ((((_a = changes === null || changes === void 0 ? void 0 : changes.options) === null || _a === void 0 ? void 0 : _a.currentValue) || ((_b = changes === null || changes === void 0 ? void 0 : changes.sort) === null || _b === void 0 ? void 0 : _b.currentValue)) && this.sort) {
|
|
6380
|
+
var direction_1 = "ASC" == this.sort.toUpperCase() ? 1 : "DESC" == this.sort.toUpperCase() ? -1 : 0;
|
|
6381
|
+
if (direction_1 != 0 && this.options != undefined) {
|
|
6382
|
+
this.options.sort(function (a, b) { return a.label < b.label ? -direction_1 : a.label > b.label ? direction_1 : 0; });
|
|
6383
|
+
}
|
|
6384
|
+
}
|
|
6385
|
+
if ((_c = changes === null || changes === void 0 ? void 0 : changes.options) === null || _c === void 0 ? void 0 : _c.currentValue) {
|
|
6386
|
+
this.inputTextValue = this.getInputTextValue();
|
|
6387
|
+
}
|
|
6388
|
+
this.cdr.detectChanges();
|
|
6389
|
+
};
|
|
6390
|
+
MultiSelectComponent.prototype.ngOnInit = function () {
|
|
6391
|
+
var _this = this;
|
|
6392
|
+
_super.prototype.ngOnInit.call(this);
|
|
6393
|
+
this.emitDebug("@ViewChild('formControl')");
|
|
6394
|
+
this.emitDebug(this.formControlElement);
|
|
6395
|
+
if (this.focus) {
|
|
6396
|
+
this.push(this.focus.subscribe(function (scroll) {
|
|
6397
|
+
_this.emitDebug("Catch focus!");
|
|
6398
|
+
setFocus(_this.formControlElement.nativeElement, scroll);
|
|
6399
|
+
}));
|
|
6400
|
+
}
|
|
6401
|
+
};
|
|
6402
|
+
MultiSelectComponent.prototype.ngAfterViewInit = function () {
|
|
6403
|
+
};
|
|
6404
|
+
MultiSelectComponent.prototype.ngOnDestroy = function () {
|
|
6405
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
6406
|
+
};
|
|
6407
|
+
MultiSelectComponent.prototype.onKeypress = function ($event) {
|
|
6408
|
+
$event.preventDefault();
|
|
6409
|
+
};
|
|
6410
|
+
MultiSelectComponent.prototype.onFocusIn = function () {
|
|
6411
|
+
var _this = this;
|
|
6412
|
+
setTimeout(function () {
|
|
6413
|
+
_this.showDropdownMenu();
|
|
6414
|
+
}, 250);
|
|
6415
|
+
};
|
|
6416
|
+
MultiSelectComponent.prototype.onFocusOut = function () {
|
|
6417
|
+
var _this = this;
|
|
6418
|
+
setTimeout(function () {
|
|
6419
|
+
if (_this.isFocusOut()) {
|
|
6420
|
+
_this.closeDropdownMenu();
|
|
6421
|
+
}
|
|
6422
|
+
}, 150);
|
|
6423
|
+
};
|
|
6424
|
+
MultiSelectComponent.prototype.showDropdownMenu = function () {
|
|
6425
|
+
var _this = this;
|
|
6426
|
+
setTimeout(function () {
|
|
6427
|
+
if (!_this.isExpanded()) {
|
|
6428
|
+
_this.toggle();
|
|
6429
|
+
}
|
|
6430
|
+
});
|
|
6431
|
+
};
|
|
6432
|
+
MultiSelectComponent.prototype.closeDropdownMenu = function () {
|
|
6433
|
+
var _this = this;
|
|
6434
|
+
setTimeout(function () {
|
|
6435
|
+
if (_this.isExpanded()) {
|
|
6436
|
+
_this.toggle();
|
|
6437
|
+
}
|
|
6438
|
+
});
|
|
6439
|
+
};
|
|
6440
|
+
MultiSelectComponent.prototype.onCheck = function (cb) {
|
|
6441
|
+
if (!cb.firstChange) {
|
|
6442
|
+
if (cb.checked && !this.isChecked(cb.value)) {
|
|
6443
|
+
this.pushValue(cb.value);
|
|
6444
|
+
this.cleanError();
|
|
6445
|
+
}
|
|
6446
|
+
else if (!cb.checked && this.isChecked(cb.value)) {
|
|
6447
|
+
this.values = this.values.filter(function (value) { return value != cb.value; });
|
|
6448
|
+
this.cleanError();
|
|
6449
|
+
}
|
|
6450
|
+
this.valuesChange.emit(this.values);
|
|
6451
|
+
this.inputTextValue = this.getInputTextValue();
|
|
6452
|
+
this.cdr.detectChanges();
|
|
6453
|
+
}
|
|
6454
|
+
};
|
|
6455
|
+
return MultiSelectComponent;
|
|
6456
|
+
}(FormElementComponent));
|
|
6457
|
+
MultiSelectComponent.decorators = [
|
|
6458
|
+
{ type: core.Component, args: [{
|
|
6459
|
+
selector: 'inail-multi-select',
|
|
6460
|
+
template: "<div #multiSelect\n class=\"form-group {{getResponsiveClass()}} noPaddingLeft {{class}} inail-multi-select\"\n [ngClass]=\"{'has-error': isThereError()}\">\n <label *ngIf=\"label\"\n class=\"control-label {{labelClass}}\"\n [ngClass]=\"{'sr-only': hiddenLabel}\"\n [attr.title]=\"labelTitle\"\n [for]=\"id\"\n [innerHTML]=\"getLabel()\"></label>\n <span *ngIf=\"showPopover()\"\n [style.padding-left.px]=\"5\">\n <inail-popover [iconClass]=\"popoverButtonIcon\"\n [buttonTitle]=\"popoverButtonTitle\"\n [header]=\"popoverHeader\"\n [content]=\"popoverContent\">\n </inail-popover>\n </span>\n <div class=\"form-control-wrapper\"\n [ngClass]=\"{'no-label' : hiddenLabel || !label}\">\n <input #formControl\n type=\"text\"\n [id]=\"id\"\n class=\"form-control dropdown-toggle {{inputClass}}\"\n data-toggle=\"dropdown\"\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n [ngClass]=\"{'disabled': disabled}\"\n [attr.name]=\"name\"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [readonly]=\"true\"\n [attr.placeholder]=\"placeholder\"\n [attr.aria-required]=\"required === true ? true : undefined\"\n [attr.aria-invalid]=\"isThereError() === true ? true : undefined\"\n [attr.aria-describedBy]=\"getAriaDescribedBy()\"\n (blur)=\"onBlur()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n (keypress)=\"onKeypress($event)\"\n (keyup.enter)=\"enterUp.emit()\"\n [ngModel]=\"inputTextValue\">\n <div #dropdownMenu\n class=\"dropdown-menu\"\n (focusout)=\"onFocusOut()\"\n [attr.aria-labelledby]=\"id\">\n <ng-container *ngFor=\"let opt of options\">\n <div *ngIf=\"opt.beforeDivider\" class=\"divider\"></div>\n <div class=\"row\" [attr.tabIndex]=\"opt.disabled ? 0 : undefined\">\n <inail-checkbox [label]=\"opt.label\"\n [value]=\"opt.value\"\n [title]=\"opt.title\"\n [checked]=\"isChecked(opt.value)\"\n [disabled]=\"opt.disabled\"\n (stateChange)=\"onCheck($event)\">\n </inail-checkbox>\n </div>\n <div *ngIf=\"opt.afterDivider\" class=\"divider\"></div>\n </ng-container>\n </div>\n </div>\n <div *ngIf=\"showError()\" [id]=\"id+'-description'\">\n <div class=\"msg msg-errore\">\n <strong [innerHTML]=\"'ERRORE: '+this.error\"></strong>\n </div>\n <div *ngIf=\"description\" [innerHTML]=\"this.description\"></div>\n </div>\n <div *ngIf=\"description && !showError()\"\n [id]=\"id+'-description'\"\n [innerHTML]=\"this.description\">\n </div>\n</div>\n",
|
|
6461
|
+
changeDetection: CHANGE_DETECTION_STRATEGY,
|
|
6462
|
+
encapsulation: core.ViewEncapsulation.None,
|
|
6463
|
+
styles: [".inail-multi-select .form-control-wrapper:after{font-family:FontAwesome;content:\"\\f078\";right:31px;position:absolute;top:35px;font-size:10px;color:#0083f5}.inail-multi-select .form-control-wrapper.no-label:after{top:11px}.inail-multi-select .form-control[readonly]:not([disabled]){background-color:#fff}.inail-multi-select .form-control:not([disabled]){cursor:pointer}.inail-multi-select .dropdown-menu .form-group{margin:0!important;padding-left:20px!important}.inail-multi-select .dropdown-menu .form-group:hover{background-color:#eaedf2}.inail-multi-select .dropdown-menu .form-group .checkbox{margin:0!important}.inail-multi-select .dropdown-menu .form-group .checkbox label{margin-top:5px!important;margin-bottom:5px!important;display:block!important}"]
|
|
6464
|
+
},] }
|
|
6465
|
+
];
|
|
6466
|
+
MultiSelectComponent.ctorParameters = function () { return [
|
|
6467
|
+
{ type: core.ChangeDetectorRef }
|
|
6468
|
+
]; };
|
|
6469
|
+
MultiSelectComponent.propDecorators = {
|
|
6470
|
+
multiSelect: [{ type: core.ViewChild, args: ['multiSelect', { static: true },] }],
|
|
6471
|
+
formControlElement: [{ type: core.ViewChild, args: ['formControl', { static: true },] }],
|
|
6472
|
+
dropdownMenu: [{ type: core.ViewChild, args: ['dropdownMenu', { static: true },] }],
|
|
6473
|
+
options: [{ type: core.Input }],
|
|
6474
|
+
values: [{ type: core.Input }],
|
|
6475
|
+
valuesChange: [{ type: core.Output }],
|
|
6476
|
+
placeholder: [{ type: core.Input }],
|
|
6477
|
+
sort: [{ type: core.Input }]
|
|
6478
|
+
};
|
|
6479
|
+
|
|
6256
6480
|
var NgInailCommonModule = /** @class */ (function () {
|
|
6257
6481
|
function NgInailCommonModule() {
|
|
6258
6482
|
}
|
|
@@ -6306,7 +6530,9 @@
|
|
|
6306
6530
|
SelectorComponent,
|
|
6307
6531
|
WizardComponent,
|
|
6308
6532
|
ContainerComponent,
|
|
6309
|
-
TrCheckboxComponent
|
|
6533
|
+
TrCheckboxComponent,
|
|
6534
|
+
ProgressBarComponent,
|
|
6535
|
+
MultiSelectComponent
|
|
6310
6536
|
],
|
|
6311
6537
|
imports: [
|
|
6312
6538
|
common.CommonModule,
|
|
@@ -6354,7 +6580,9 @@
|
|
|
6354
6580
|
SelectorComponent,
|
|
6355
6581
|
WizardComponent,
|
|
6356
6582
|
ContainerComponent,
|
|
6357
|
-
TrCheckboxComponent
|
|
6583
|
+
TrCheckboxComponent,
|
|
6584
|
+
ProgressBarComponent,
|
|
6585
|
+
MultiSelectComponent
|
|
6358
6586
|
],
|
|
6359
6587
|
providers: [common.DatePipe]
|
|
6360
6588
|
},] }
|
|
@@ -6396,6 +6624,7 @@
|
|
|
6396
6624
|
exports.MenuIntranetComponent = MenuIntranetComponent;
|
|
6397
6625
|
exports.MenuItem = MenuItem;
|
|
6398
6626
|
exports.ModalComponent = ModalComponent;
|
|
6627
|
+
exports.MultiSelectComponent = MultiSelectComponent;
|
|
6399
6628
|
exports.NavigazioneInternaComponent = NavigazioneInternaComponent;
|
|
6400
6629
|
exports.NavigazionePrincipaleComponent = NavigazionePrincipaleComponent;
|
|
6401
6630
|
exports.NavigazioneSecondariaComponent = NavigazioneSecondariaComponent;
|
|
@@ -6403,8 +6632,8 @@
|
|
|
6403
6632
|
exports.NavigazioneUtenteConfigurations = NavigazioneUtenteConfigurations;
|
|
6404
6633
|
exports.NgInailCommonModule = NgInailCommonModule;
|
|
6405
6634
|
exports.PageTitleComponent = PageTitleComponent;
|
|
6406
|
-
exports.PaginationState = PaginationState;
|
|
6407
6635
|
exports.PopoverComponent = PopoverComponent;
|
|
6636
|
+
exports.ProgressBarComponent = ProgressBarComponent;
|
|
6408
6637
|
exports.RadioSelectComponent = RadioSelectComponent;
|
|
6409
6638
|
exports.ResponsiveElementComponent = ResponsiveElementComponent;
|
|
6410
6639
|
exports.SelectComponent = SelectComponent;
|