@seniorsistemas/angular-components 17.15.4 → 17.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/seniorsistemas-angular-components.umd.js +378 -6
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/index.d.ts +1 -0
- package/components/picklist/index.d.ts +4 -0
- package/components/picklist/picklist/models/picklist-models.d.ts +8 -0
- package/components/picklist/picklist/picklist.component.d.ts +71 -0
- package/components/picklist/picklist.module.d.ts +2 -0
- package/components/table/table-column/table-columns.component.d.ts +8 -5
- package/esm2015/components/index.js +2 -1
- package/esm2015/components/picklist/index.js +5 -0
- package/esm2015/components/picklist/picklist/models/picklist-models.js +6 -0
- package/esm2015/components/picklist/picklist/picklist.component.js +305 -0
- package/esm2015/components/picklist/picklist.module.js +25 -0
- package/esm2015/components/table/table-column/table-columns.component.js +7 -6
- package/esm2015/locale/fallback.js +7 -2
- package/esm2015/seniorsistemas-angular-components.js +2 -1
- package/esm5/components/index.js +2 -1
- package/esm5/components/picklist/index.js +5 -0
- package/esm5/components/picklist/picklist/models/picklist-models.js +6 -0
- package/esm5/components/picklist/picklist/picklist.component.js +339 -0
- package/esm5/components/picklist/picklist.module.js +28 -0
- package/esm5/components/table/table-column/table-columns.component.js +7 -6
- package/esm5/locale/fallback.js +7 -2
- package/esm5/seniorsistemas-angular-components.js +2 -1
- package/fesm2015/seniorsistemas-angular-components.js +334 -8
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +371 -8
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.d.ts +1 -0
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -9781,6 +9781,7 @@
|
|
|
9781
9781
|
calendar: __assign(__assign({}, this.localeService.getLocaleOptions().calendar), { dateFormat: convertToMomentDateFormat(this.localeService.getLocaleOptions().calendar.dateFormat) }),
|
|
9782
9782
|
number: __assign(__assign({}, this.localeService.getLocaleOptions().number), { scale: 0 }),
|
|
9783
9783
|
};
|
|
9784
|
+
this.cellsData = [];
|
|
9784
9785
|
this.formattedColumns = [];
|
|
9785
9786
|
}
|
|
9786
9787
|
TableColumnsComponent.prototype.ngOnChanges = function (changes) {
|
|
@@ -9793,7 +9794,7 @@
|
|
|
9793
9794
|
TableColumnsComponent.prototype.isArray = function (value) {
|
|
9794
9795
|
return Array.isArray(value);
|
|
9795
9796
|
};
|
|
9796
|
-
TableColumnsComponent.prototype.
|
|
9797
|
+
TableColumnsComponent.prototype.getCellData = function (column) {
|
|
9797
9798
|
var columnValue = column.columnValue, separator = column.separator, uninformed = column.uninformed;
|
|
9798
9799
|
if (typeof columnValue === "string") {
|
|
9799
9800
|
var splittedString_1 = columnValue.split(separator);
|
|
@@ -9802,7 +9803,7 @@
|
|
|
9802
9803
|
return {
|
|
9803
9804
|
value: string,
|
|
9804
9805
|
isUninformed: string === uninformed,
|
|
9805
|
-
separator: !isLastIndex ? separator :
|
|
9806
|
+
separator: !isLastIndex ? separator : null,
|
|
9806
9807
|
};
|
|
9807
9808
|
});
|
|
9808
9809
|
}
|
|
@@ -9824,8 +9825,8 @@
|
|
|
9824
9825
|
var columns = ((_a = changes.columns) === null || _a === void 0 ? void 0 : _a.currentValue) || this.columns;
|
|
9825
9826
|
var rowValue = ((_b = changes.rowValue) === null || _b === void 0 ? void 0 : _b.currentValue) || this.rowValue;
|
|
9826
9827
|
var locale = ((_c = changes.locale) === null || _c === void 0 ? void 0 : _c.currentValue) || this.locale;
|
|
9827
|
-
this.formattedColumns =
|
|
9828
|
-
|
|
9828
|
+
this.formattedColumns = columns.map(function (column) { return _this.getColumnValue(column, rowValue, locale); });
|
|
9829
|
+
this.cellsData = this.formattedColumns.map(function (column) { return _this.getCellData(column); });
|
|
9829
9830
|
this.viewContainerRef.createEmbeddedView(this.columnsTemplate);
|
|
9830
9831
|
};
|
|
9831
9832
|
TableColumnsComponent.prototype.getColumnSeparator = function (column) {
|
|
@@ -10015,7 +10016,7 @@
|
|
|
10015
10016
|
], TableColumnsComponent.prototype, "locale", void 0);
|
|
10016
10017
|
TableColumnsComponent = __decorate([
|
|
10017
10018
|
core.Component({
|
|
10018
|
-
template: "<ng-template #columnsTemplate>\n <td\n *ngFor=\"let column of formattedColumns\"\n [ngStyle]=\"column.style\"\n (click)=\"column.onColumnClick ? column.onColumnClick(rowValue) : null\"\n >\n <div *ngIf=\"column.type !== 'TOKENS' || !isArray(column.columnValue); else tokensTemplate\">\n <span *ngIf=\"column.type !== 'LINK'\" [sTooltip]=\"column.tooltip\" [escape]=\"false\">\n <ng-container *ngTemplateOutlet=\"columnValueTemplate\"></ng-container>\n </span>\n\n <
|
|
10019
|
+
template: "<ng-template #columnsTemplate>\n <td\n *ngFor=\"let column of formattedColumns; let i = index\"\n [ngStyle]=\"column.style\"\n (click)=\"column.onColumnClick ? column.onColumnClick(rowValue) : null\"\n >\n <div *ngIf=\"column.type !== 'TOKENS' || !isArray(column.columnValue); else tokensTemplate\">\n <span *ngIf=\"column.type !== 'LINK'\" [sTooltip]=\"column.tooltip\" [escape]=\"false\">\n <ng-container *ngTemplateOutlet=\"columnValueTemplate\"></ng-container>\n </span>\n\n <ng-container *ngIf=\"column.type === 'LINK'\">\n <span *ngIf=\"cellsData[i][0].isUninformed; else anchorTemplate\" class=\"sds-empty-value\">{{ cellsData[i][0].value }}</span>\n\n <ng-template #anchorTemplate>\n <a [sTooltip]=\"column.tooltip\" [escape]=\"false\" (click)=\"column.onLinkClick ? column.onLinkClick(rowValue) : null\">\n <ng-container *ngTemplateOutlet=\"columnValueTemplate\"></ng-container>\n </a>\n </ng-template>\n </ng-container>\n\n <ng-template #columnValueTemplate>\n <ng-container *ngFor=\"let cellData of cellsData[i]\">\n <span *ngIf=\"cellData.isUninformed; else isInformedTemplate\" class=\"sds-empty-value\">{{ cellData.value }}</span>\n\n <ng-template #isInformedTemplate>\n <s-badge\n *ngIf=\"column.badgeConfigs; else withoutBadgeTemplate\"\n [sTooltip]=\"column.tooltip\"\n [color]=\"column.badgeConfigs.color\"\n [text]=\"cellData.value\"\n ></s-badge>\n\n <ng-template #withoutBadgeTemplate>\n <span>{{ cellData.value }}</span>\n </ng-template>\n </ng-template>\n\n <span *ngIf=\"cellData.separator\">{{ cellData.separator }}</span>\n </ng-container>\n\n <ng-container *ngIf=\"!!column.infoSign\">\n <span *sInfoSign=\"column.infoSign\"></span>\n </ng-container>\n </ng-template>\n </div>\n\n <ng-template #tokensTemplate>\n <s-token-list [tokens]=\"column.columnValue\" [hidePointerEvents]=\"true\"></s-token-list>\n\n <ng-container *ngIf=\"!!column.infoSign\">\n <span *sInfoSign=\"column.infoSign\"></span>\n </ng-container>\n </ng-template>\n </td>\n</ng-template>\n",
|
|
10019
10020
|
selector: "s-table-columns",
|
|
10020
10021
|
styles: [":host{display:none}"]
|
|
10021
10022
|
}),
|
|
@@ -20255,6 +20256,363 @@
|
|
|
20255
20256
|
return LabelValueModule;
|
|
20256
20257
|
}());
|
|
20257
20258
|
|
|
20259
|
+
|
|
20260
|
+
(function (PicklistTemplateTypes) {
|
|
20261
|
+
PicklistTemplateTypes["ItemToSelect"] = "item-to-select";
|
|
20262
|
+
PicklistTemplateTypes["SelectedItem"] = "selected-item";
|
|
20263
|
+
})(exports.PicklistTemplateTypes || (exports.PicklistTemplateTypes = {}));
|
|
20264
|
+
|
|
20265
|
+
var PicklistComponent = /** @class */ (function () {
|
|
20266
|
+
function PicklistComponent(cdr) {
|
|
20267
|
+
this.cdr = cdr;
|
|
20268
|
+
this.itensToSelect = [];
|
|
20269
|
+
this.selectedItens = [];
|
|
20270
|
+
this.showCheckbox = false;
|
|
20271
|
+
this.filterBy = '';
|
|
20272
|
+
this.selectedItensChange = new core.EventEmitter();
|
|
20273
|
+
this.itensToSelectChange = new core.EventEmitter();
|
|
20274
|
+
this.availableItensFilter = '';
|
|
20275
|
+
this.selectedItensFilter = '';
|
|
20276
|
+
this.itensToSelectFilterUtil = {
|
|
20277
|
+
rawItensToSelect: [],
|
|
20278
|
+
filteredItensToSelect: [],
|
|
20279
|
+
};
|
|
20280
|
+
this.selectedItensFilterUtil = {
|
|
20281
|
+
rawSelectedItens: [],
|
|
20282
|
+
filteredSelectedItens: [],
|
|
20283
|
+
};
|
|
20284
|
+
this.selectedItensMap = new Set();
|
|
20285
|
+
this.itensToSelectId = randomHash('itensToSelect');
|
|
20286
|
+
this.selectedItensId = randomHash('selectedItens');
|
|
20287
|
+
}
|
|
20288
|
+
PicklistComponent.prototype.ngAfterViewInit = function () {
|
|
20289
|
+
var _a, _b;
|
|
20290
|
+
this.itemToSelectTemplate = (_a = this.templates.find(function (x) { return x.type === exports.PicklistTemplateTypes.ItemToSelect; })) === null || _a === void 0 ? void 0 : _a.template;
|
|
20291
|
+
this.itemSelectedTemplate = (_b = this.templates.find(function (x) { return x.type === exports.PicklistTemplateTypes.SelectedItem; })) === null || _b === void 0 ? void 0 : _b.template;
|
|
20292
|
+
if (!this.itemToSelectTemplate) {
|
|
20293
|
+
console.error("Missing template for " + exports.PicklistTemplateTypes.ItemToSelect + " add this template using sTemplate directive.");
|
|
20294
|
+
}
|
|
20295
|
+
if (!this.itemSelectedTemplate) {
|
|
20296
|
+
console.error("Missing template for " + exports.PicklistTemplateTypes.SelectedItem + " add this template using sTemplate directive.");
|
|
20297
|
+
}
|
|
20298
|
+
this.cdr.detectChanges();
|
|
20299
|
+
};
|
|
20300
|
+
PicklistComponent.prototype.ngOnChanges = function (changes) {
|
|
20301
|
+
if (changes.itensToSelect && changes.itensToSelect.firstChange) {
|
|
20302
|
+
this.itensToSelectFilterUtil = {
|
|
20303
|
+
rawItensToSelect: this.itensToSelect,
|
|
20304
|
+
filteredItensToSelect: this.itensToSelect,
|
|
20305
|
+
};
|
|
20306
|
+
}
|
|
20307
|
+
if (changes.selectedItens && changes.selectedItens.firstChange) {
|
|
20308
|
+
this.selectedItensFilterUtil = {
|
|
20309
|
+
filteredSelectedItens: this.selectedItens,
|
|
20310
|
+
rawSelectedItens: this.selectedItens
|
|
20311
|
+
};
|
|
20312
|
+
}
|
|
20313
|
+
};
|
|
20314
|
+
PicklistComponent.prototype.toggleSelected = function (internalPicklistItem, containerListId) {
|
|
20315
|
+
if (internalPicklistItem.disabled) {
|
|
20316
|
+
return;
|
|
20317
|
+
}
|
|
20318
|
+
this.unselectedItensByListId(this.getOppositiveId(containerListId));
|
|
20319
|
+
internalPicklistItem.selected = !internalPicklistItem.selected;
|
|
20320
|
+
if (internalPicklistItem.selected) {
|
|
20321
|
+
this.selectedItensMap.add(internalPicklistItem);
|
|
20322
|
+
}
|
|
20323
|
+
else {
|
|
20324
|
+
this.selectedItensMap.delete(internalPicklistItem);
|
|
20325
|
+
}
|
|
20326
|
+
this.cdr.detectChanges();
|
|
20327
|
+
};
|
|
20328
|
+
PicklistComponent.prototype.remove = function (all) {
|
|
20329
|
+
var _this = this;
|
|
20330
|
+
if (all === void 0) { all = false; }
|
|
20331
|
+
var itens = filterEnabled((all ? this.selectedItensFilterUtil.rawSelectedItens : this.selectedItensMap));
|
|
20332
|
+
if (!itens.length) {
|
|
20333
|
+
return;
|
|
20334
|
+
}
|
|
20335
|
+
itens.forEach(function (itemRemove) {
|
|
20336
|
+
_this.itensToSelect.push(itemRemove);
|
|
20337
|
+
itemRemove.selected = false;
|
|
20338
|
+
_this.selectedItensMap.delete(itemRemove);
|
|
20339
|
+
});
|
|
20340
|
+
this.selectedItens = this.selectedItens.filter(function (x) { return !itens.includes(x); });
|
|
20341
|
+
this.selectedItensFilterUtil.rawSelectedItens = this.selectedItens;
|
|
20342
|
+
this.filterSelectedItens();
|
|
20343
|
+
this.filterItensToSelect();
|
|
20344
|
+
this.emitData();
|
|
20345
|
+
this.cdr.detectChanges();
|
|
20346
|
+
};
|
|
20347
|
+
PicklistComponent.prototype.add = function (all) {
|
|
20348
|
+
var _this = this;
|
|
20349
|
+
if (all === void 0) { all = false; }
|
|
20350
|
+
var itens = filterEnabled((all ? this.itensToSelectFilterUtil.rawItensToSelect : this.selectedItensMap));
|
|
20351
|
+
if (!itens.length) {
|
|
20352
|
+
return;
|
|
20353
|
+
}
|
|
20354
|
+
itens.forEach(function (itemRemove) {
|
|
20355
|
+
_this.selectedItens.push(itemRemove);
|
|
20356
|
+
itemRemove.selected = false;
|
|
20357
|
+
_this.selectedItensMap.delete(itemRemove);
|
|
20358
|
+
});
|
|
20359
|
+
this.itensToSelect = this.itensToSelect.filter(function (x) { return !itens.includes(x); });
|
|
20360
|
+
this.itensToSelectFilterUtil.rawItensToSelect = this.itensToSelect;
|
|
20361
|
+
this.filterSelectedItens();
|
|
20362
|
+
this.filterItensToSelect();
|
|
20363
|
+
this.emitData();
|
|
20364
|
+
this.cdr.detectChanges();
|
|
20365
|
+
};
|
|
20366
|
+
PicklistComponent.prototype.filterItensToSelect = function () {
|
|
20367
|
+
var _this = this;
|
|
20368
|
+
var searchTerm = this.availableItensFilter;
|
|
20369
|
+
searchTerm = searchTerm.trim();
|
|
20370
|
+
if (searchTerm) {
|
|
20371
|
+
this.itensToSelectFilterUtil.filteredItensToSelect = this.itensToSelectFilterUtil.rawItensToSelect
|
|
20372
|
+
.filter(function (item) { return compareStrings(item.data[_this.filterBy], searchTerm); });
|
|
20373
|
+
}
|
|
20374
|
+
else {
|
|
20375
|
+
this.itensToSelectFilterUtil.filteredItensToSelect = this.itensToSelectFilterUtil.rawItensToSelect;
|
|
20376
|
+
}
|
|
20377
|
+
this.cdr.detectChanges();
|
|
20378
|
+
};
|
|
20379
|
+
PicklistComponent.prototype.filterSelectedItens = function () {
|
|
20380
|
+
var _this = this;
|
|
20381
|
+
var searchTerm = this.selectedItensFilter;
|
|
20382
|
+
searchTerm = searchTerm.trim();
|
|
20383
|
+
if (searchTerm) {
|
|
20384
|
+
this.selectedItensFilterUtil.filteredSelectedItens = this.selectedItensFilterUtil.rawSelectedItens
|
|
20385
|
+
.filter(function (item) { return compareStrings(item.data[_this.filterBy], searchTerm); });
|
|
20386
|
+
}
|
|
20387
|
+
else {
|
|
20388
|
+
this.selectedItensFilterUtil.filteredSelectedItens = this.selectedItensFilterUtil.rawSelectedItens;
|
|
20389
|
+
}
|
|
20390
|
+
};
|
|
20391
|
+
PicklistComponent.prototype.drop = function (event) {
|
|
20392
|
+
var isDifferentContainer = event.container !== event.previousContainer;
|
|
20393
|
+
if (!isDifferentContainer) {
|
|
20394
|
+
return;
|
|
20395
|
+
}
|
|
20396
|
+
var isRemovedItens = event.previousContainer.id === this.selectedItensId;
|
|
20397
|
+
if (isRemovedItens) {
|
|
20398
|
+
this.remove();
|
|
20399
|
+
}
|
|
20400
|
+
else {
|
|
20401
|
+
this.add();
|
|
20402
|
+
}
|
|
20403
|
+
this.cdr.detectChanges();
|
|
20404
|
+
};
|
|
20405
|
+
PicklistComponent.prototype.onDragStart = function (event, dragListId) {
|
|
20406
|
+
this.unselectedItensByListId(this.getOppositiveId(dragListId));
|
|
20407
|
+
event.source.data.selected = true;
|
|
20408
|
+
this.selectedItensMap.add(event.source.data);
|
|
20409
|
+
this.selectedItensMap.forEach(function (x) { return x.invisible = true; });
|
|
20410
|
+
this.cdr.detectChanges();
|
|
20411
|
+
};
|
|
20412
|
+
PicklistComponent.prototype.onDragRelease = function () {
|
|
20413
|
+
this.selectedItensMap.forEach(function (item) { return item.invisible = false; });
|
|
20414
|
+
};
|
|
20415
|
+
PicklistComponent.prototype.checkAllAvailableItensChange = function (checked) {
|
|
20416
|
+
this._checkAllSelectedItensChange(checked, this.itensToSelectFilterUtil.filteredItensToSelect, this.itensToSelectId);
|
|
20417
|
+
};
|
|
20418
|
+
PicklistComponent.prototype.checkAllSelectedItensChange = function (checked) {
|
|
20419
|
+
this._checkAllSelectedItensChange(checked, this.selectedItensFilterUtil.filteredSelectedItens, this.selectedItensId);
|
|
20420
|
+
};
|
|
20421
|
+
Object.defineProperty(PicklistComponent.prototype, "disableSelectedItensCheckbox", {
|
|
20422
|
+
get: function () {
|
|
20423
|
+
return filterEnabled(this.selectedItensFilterUtil.filteredSelectedItens).length === 0;
|
|
20424
|
+
},
|
|
20425
|
+
enumerable: true,
|
|
20426
|
+
configurable: true
|
|
20427
|
+
});
|
|
20428
|
+
Object.defineProperty(PicklistComponent.prototype, "disableItensToSelectCheckbox", {
|
|
20429
|
+
get: function () {
|
|
20430
|
+
return filterEnabled(this.itensToSelectFilterUtil.filteredItensToSelect).length === 0;
|
|
20431
|
+
},
|
|
20432
|
+
enumerable: true,
|
|
20433
|
+
configurable: true
|
|
20434
|
+
});
|
|
20435
|
+
Object.defineProperty(PicklistComponent.prototype, "itensToSelectAllSelected", {
|
|
20436
|
+
get: function () {
|
|
20437
|
+
return this._checkAllSelectedByList(this.itensToSelectFilterUtil.filteredItensToSelect);
|
|
20438
|
+
},
|
|
20439
|
+
enumerable: true,
|
|
20440
|
+
configurable: true
|
|
20441
|
+
});
|
|
20442
|
+
Object.defineProperty(PicklistComponent.prototype, "selectedItensAllSelected", {
|
|
20443
|
+
get: function () {
|
|
20444
|
+
return this._checkAllSelectedByList(this.selectedItensFilterUtil.filteredSelectedItens);
|
|
20445
|
+
},
|
|
20446
|
+
enumerable: true,
|
|
20447
|
+
configurable: true
|
|
20448
|
+
});
|
|
20449
|
+
Object.defineProperty(PicklistComponent.prototype, "canAddItens", {
|
|
20450
|
+
get: function () {
|
|
20451
|
+
return this.itensToSelect.filter(function (x) { return x === null || x === void 0 ? void 0 : x.selected; }).length > 0;
|
|
20452
|
+
},
|
|
20453
|
+
enumerable: true,
|
|
20454
|
+
configurable: true
|
|
20455
|
+
});
|
|
20456
|
+
Object.defineProperty(PicklistComponent.prototype, "canRemoveItens", {
|
|
20457
|
+
get: function () {
|
|
20458
|
+
return this.selectedItens.filter(function (x) { return x === null || x === void 0 ? void 0 : x.selected; }).length > 0;
|
|
20459
|
+
},
|
|
20460
|
+
enumerable: true,
|
|
20461
|
+
configurable: true
|
|
20462
|
+
});
|
|
20463
|
+
PicklistComponent.prototype._checkAllSelectedByList = function (list) {
|
|
20464
|
+
var _listItens = filterEnabled(list);
|
|
20465
|
+
if (!_listItens.length) {
|
|
20466
|
+
return false;
|
|
20467
|
+
}
|
|
20468
|
+
else {
|
|
20469
|
+
return _listItens.every(function (x) { return x.selected; });
|
|
20470
|
+
}
|
|
20471
|
+
};
|
|
20472
|
+
PicklistComponent.prototype._checkAllSelectedItensChange = function (checked, list, listId) {
|
|
20473
|
+
var _this = this;
|
|
20474
|
+
this.unselectedItensByListId(listId === this.selectedItensId ? this.itensToSelectId : this.selectedItensId);
|
|
20475
|
+
filterEnabled(list).forEach(function (item) {
|
|
20476
|
+
item.selected = checked;
|
|
20477
|
+
_this.selectedItensMap.add(item);
|
|
20478
|
+
});
|
|
20479
|
+
this.cdr.detectChanges();
|
|
20480
|
+
};
|
|
20481
|
+
PicklistComponent.prototype.unselectedItensByListId = function (listId) {
|
|
20482
|
+
var _this = this;
|
|
20483
|
+
var clearList = this.getAllElementsByListId(listId);
|
|
20484
|
+
clearList.forEach(function (x) {
|
|
20485
|
+
x.selected = false;
|
|
20486
|
+
_this.selectedItensMap.delete(x);
|
|
20487
|
+
});
|
|
20488
|
+
this.cdr.detectChanges();
|
|
20489
|
+
};
|
|
20490
|
+
PicklistComponent.prototype.getAllElementsByListId = function (listId) {
|
|
20491
|
+
return listId === this.selectedItensId ? this.selectedItensFilterUtil.rawSelectedItens : this.itensToSelectFilterUtil.rawItensToSelect;
|
|
20492
|
+
};
|
|
20493
|
+
PicklistComponent.prototype.getOppositiveId = function (listId) {
|
|
20494
|
+
return listId === this.selectedItensId ? this.itensToSelectId : this.selectedItensId;
|
|
20495
|
+
};
|
|
20496
|
+
PicklistComponent.prototype.emitData = function () {
|
|
20497
|
+
this.itensToSelectChange.emit(parseValueEmit(this.itensToSelect));
|
|
20498
|
+
this.selectedItensChange.emit(parseValueEmit(this.selectedItens));
|
|
20499
|
+
};
|
|
20500
|
+
PicklistComponent.ctorParameters = function () { return [
|
|
20501
|
+
{ type: core.ChangeDetectorRef }
|
|
20502
|
+
]; };
|
|
20503
|
+
__decorate([
|
|
20504
|
+
core.Input()
|
|
20505
|
+
], PicklistComponent.prototype, "itensToSelect", void 0);
|
|
20506
|
+
__decorate([
|
|
20507
|
+
core.Input()
|
|
20508
|
+
], PicklistComponent.prototype, "selectedItens", void 0);
|
|
20509
|
+
__decorate([
|
|
20510
|
+
core.Input()
|
|
20511
|
+
], PicklistComponent.prototype, "availableItensLabel", void 0);
|
|
20512
|
+
__decorate([
|
|
20513
|
+
core.Input()
|
|
20514
|
+
], PicklistComponent.prototype, "availableItensPlaceholder", void 0);
|
|
20515
|
+
__decorate([
|
|
20516
|
+
core.Input()
|
|
20517
|
+
], PicklistComponent.prototype, "addSelectedItensLabel", void 0);
|
|
20518
|
+
__decorate([
|
|
20519
|
+
core.Input()
|
|
20520
|
+
], PicklistComponent.prototype, "addAllItensLabel", void 0);
|
|
20521
|
+
__decorate([
|
|
20522
|
+
core.Input()
|
|
20523
|
+
], PicklistComponent.prototype, "selectedItensLabel", void 0);
|
|
20524
|
+
__decorate([
|
|
20525
|
+
core.Input()
|
|
20526
|
+
], PicklistComponent.prototype, "selectedItensPlaceholder", void 0);
|
|
20527
|
+
__decorate([
|
|
20528
|
+
core.Input()
|
|
20529
|
+
], PicklistComponent.prototype, "removeSelectedItemsLabel", void 0);
|
|
20530
|
+
__decorate([
|
|
20531
|
+
core.Input()
|
|
20532
|
+
], PicklistComponent.prototype, "removeAllItemsLabel", void 0);
|
|
20533
|
+
__decorate([
|
|
20534
|
+
core.Input()
|
|
20535
|
+
], PicklistComponent.prototype, "showCheckbox", void 0);
|
|
20536
|
+
__decorate([
|
|
20537
|
+
core.Input()
|
|
20538
|
+
], PicklistComponent.prototype, "filterBy", void 0);
|
|
20539
|
+
__decorate([
|
|
20540
|
+
core.Output()
|
|
20541
|
+
], PicklistComponent.prototype, "selectedItensChange", void 0);
|
|
20542
|
+
__decorate([
|
|
20543
|
+
core.Output()
|
|
20544
|
+
], PicklistComponent.prototype, "itensToSelectChange", void 0);
|
|
20545
|
+
__decorate([
|
|
20546
|
+
core.ContentChildren(TemplateDirective)
|
|
20547
|
+
], PicklistComponent.prototype, "templates", void 0);
|
|
20548
|
+
PicklistComponent = __decorate([
|
|
20549
|
+
core.Component({
|
|
20550
|
+
selector: 's-picklist',
|
|
20551
|
+
template: "<ng-template #previewRender let-itens=\"itens\" let-template=\"template\">\n <section class=\"picklist-items\">\n <ng-container *ngFor=\"let item of itens\">\n <ng-container *ngTemplateOutlet=\"template; context: { item: item.data }\"></ng-container>\n </ng-container>\n </section>\n</ng-template>\n\n<ng-template #picklistItensRender let-id=\"id\" let-itens=\"itens\" let-template=\"template\" let-listConnectedTo=\"listConnectedTo\">\n <div\n class=\"picklist-items\"\n cdkDropList\n [id]=\"id\"\n [cdkDropListSortingDisabled]=\"true\"\n [cdkDropListData]=\"itens\"\n [cdkDropListConnectedTo]=\"listConnectedTo\"\n (cdkDropListDropped)=\"drop($event)\">\n <div\n *ngFor=\"let item of itens\"\n cdkDrag\n [cdkDragDisabled]=\"item.disabled\"\n [cdkDragData]=\"item\"\n (click)=\"toggleSelected(item, id)\"\n (cdkDragStarted)=\"onDragStart($event, id)\"\n (cdkDragReleased)=\"onDragRelease()\"\n class=\"picklist-item\"\n [class.picklist-disabled]=\"item.disabled\"\n [class.picklist-item-invisible]=\"item.invisible\"\n [class.picklist-item-active]=\"item.selected\">\n <input\n type=\"checkbox\"\n class=\"input-checkbox\"\n [(ngModel)]=\"item.selected\"\n [disabled]=\"item.disabled\"\n *ngIf=\"showCheckbox\">\n <div class=\"picklist-content\">\n <ng-container *ngTemplateOutlet=\"template; context: { item: item.data, selected: item.selected, disabled: item.disabled }\"></ng-container>\n </div>\n <ng-container *cdkDragPreview>\n <ng-container *ngTemplateOutlet=\"previewRender; context: { itens: selectedItensMap, template: template }\"></ng-container>\n </ng-container>\n </div>\n</div>\n</ng-template>\n\n<ng-template #checkboxTitleRender let-disabled=\"disabled\" let-checked=\"checked\" let-changeFn=\"changeFn\">\n <input\n *ngIf=\"showCheckbox\"\n class=\"input-checkbox\"\n type=\"checkbox\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n (change)=\"changeFn($event.target.checked)\">\n</ng-template>\n\n<div class=\"picklist-container\">\n <div class=\"picklist-item-container\">\n <div class=\"picklist-box\">\n <div class=\"picklist-title-container\">\n <ng-container *ngIf=\"!filterBy\">\n <ng-container *ngTemplateOutlet=\"checkboxTitleRender; context: { disabled: disableItensToSelectCheckbox, checked: itensToSelectAllSelected, changeFn: checkAllAvailableItensChange.bind(this) }\"></ng-container>\n </ng-container>\n <span class=\"picklist-title\">\n {{ availableItensLabel || 'platform.angular_components.available-items' | translate }}\n </span>\n </div>\n <div class=\"picklist-filter\" *ngIf=\"filterBy && showCheckbox\">\n <ng-container *ngTemplateOutlet=\"checkboxTitleRender; context: { disabled: disableItensToSelectCheckbox, checked: itensToSelectAllSelected, changeFn: checkAllAvailableItensChange.bind(this) }\"></ng-container>\n <input\n *ngIf=\"filterBy\"\n type=\"text\"\n class=\"input-search\"\n [(ngModel)]=\"availableItensFilter\"\n (ngModelChange)=\"filterItensToSelect()\"\n [placeholder]=\"availableItensPlaceholder || 'plataform.angular_components.picklist-placeholder' | translate\">\n </div>\n <ng-container *ngTemplateOutlet=\"picklistItensRender;\n context: {\n id: itensToSelectId,\n itens: itensToSelectFilterUtil.filteredItensToSelect,\n template: itemToSelectTemplate,\n listConnectedTo: selectedItensId\n }\">\n </ng-container>\n </div>\n <div class=\"buttons-container\">\n <s-button\n [label]=\"addSelectedItensLabel || 'platform.angular_components.add' | translate\"\n priority=\"primary\"\n rightIconClass=\"fa fa-fw fa-arrow-right\"\n [disabled]=\"!canAddItens\"\n (onClick)=\"add()\"\n [auxiliary]=\"false\"\n [caret]=\"false\">\n </s-button>\n <s-button\n [label]=\"addAllItensLabel || 'platform.angular_components.add_all' | translate\"\n priority=\"link\"\n (onClick)=\"add(true)\"\n [auxiliary]=\"false\">\n </s-button>\n </div>\n </div>\n <div class=\"picklist-item-container\">\n <div class=\"picklist-box\">\n <div class=\"picklist-title-container\">\n <ng-container *ngIf=\"!filterBy\">\n <ng-container *ngTemplateOutlet=\"checkboxTitleRender; context: { disabled: disableSelectedItensCheckbox, checked: selectedItensAllSelected, changeFn: checkAllSelectedItensChange.bind(this) }\"></ng-container>\n </ng-container>\n <span class=\"picklist-title\">\n {{ selectedItensLabel || 'platform.angular_components.selected-items' | translate }}\n </span>\n </div>\n <div class=\"picklist-filter\" *ngIf=\"filterBy && showCheckbox\">\n <ng-container *ngTemplateOutlet=\"checkboxTitleRender; context: { disabled: disableSelectedItensCheckbox, checked: selectedItensAllSelected, changeFn: checkAllSelectedItensChange.bind(this) }\"></ng-container>\n <input\n *ngIf=\"filterBy\"\n type=\"text\"\n class=\"input-search\"\n [(ngModel)]=\"selectedItensFilter\"\n (ngModelChange)=\"filterSelectedItens()\"\n [placeholder]=\"selectedItensPlaceholder || 'plataform.angular_components.picklist-placeholder' | translate\">\n </div>\n <ng-container *ngTemplateOutlet=\"picklistItensRender;\n context: {\n id: selectedItensId,\n itens: selectedItensFilterUtil.filteredSelectedItens,\n template: itemSelectedTemplate,\n listConnectedTo: itensToSelectId\n }\">\n\n </ng-container>\n </div>\n <div class=\"buttons-container\">\n <s-button\n [label]=\"removeSelectedItemsLabel || 'platform.angular_components.remove' | translate\"\n priority=\"primary\"\n iconClass=\"fa fa-fw fa-arrow-left\"\n [disabled]=\"!canRemoveItens\"\n [auxiliary]=\"false\"\n (onClick)=\"remove()\"\n [caret]=\"false\">\n </s-button>\n <s-button\n [label]=\"removeAllItemsLabel || 'platform.angular_components.remove_all' | translate\"\n priority=\"link\"\n (onClick)=\"remove(true)\"\n [auxiliary]=\"false\">\n </s-button>\n </div>\n </div>\n</div>\n",
|
|
20552
|
+
styles: [".picklist-container{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;border-radius:4px solid #dedce5;width:100%;background-color:#fff;gap:20px;padding:8px}.picklist-container .picklist-item-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.picklist-container .picklist-item-container .picklist-box{border:1px solid #dedce5;padding:8px;height:100%;min-width:200px}.picklist-container .picklist-item-container .picklist-box .picklist-filter{display:-ms-flexbox;display:flex;width:100%}.picklist-container .picklist-item-container .picklist-box .picklist-filter .input-search{border:1px solid #dedce5;min-height:35px;width:100%;border-radius:3px;margin-bottom:10px;margin-top:10px;padding:0 8px;-ms-flex:1;flex:1}.picklist-container .picklist-item-container .picklist-box .picklist-title-container{width:100%;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.picklist-container .picklist-item-container .picklist-box .picklist-title-container .picklist-title{font-family:Open Sans;font-size:14px;font-weight:700;line-height:21px;text-underline-position:from-font;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}.picklist-container .picklist-item-container .picklist-box .picklist-items{max-height:23em;overflow:auto;height:100%;min-height:55px}.picklist-container .picklist-item-container .picklist-box .picklist-items .picklist-content{width:100%;height:100%;padding-right:8px;border-radius:3px;margin-bottom:8px}.picklist-container .picklist-item-container .picklist-box .picklist-items .picklist-item{height:55px;border:3px;display:-ms-flexbox;display:flex}.picklist-container .picklist-item-container .picklist-box .picklist-items .picklist-item:not(.picklist-disabled){cursor:pointer}.picklist-container .picklist-item-container .picklist-box .picklist-items .picklist-item:hover:not(.picklist-disabled,.picklist-item-active,.picklist-item-invisible){background-color:#f1f7f8}.picklist-container .picklist-item-container .picklist-box .picklist-items .picklist-item-active:not(.picklist-item-invisible){background-color:#d5e8ec}.picklist-container .picklist-item-container .picklist-box .picklist-items .picklist-disabled{opacity:.5;background-color:#fbfafc}.picklist-container .picklist-item-container .picklist-box .picklist-items .picklist-item-invisible{display:none!important}.picklist-container .picklist-item-container .buttons-container{padding-top:10px;display:-ms-flexbox;display:flex}.picklist-container .picklist-item-container .input-checkbox{margin:12px}"]
|
|
20553
|
+
})
|
|
20554
|
+
], PicklistComponent);
|
|
20555
|
+
return PicklistComponent;
|
|
20556
|
+
}());
|
|
20557
|
+
var normalizeString = function (str) {
|
|
20558
|
+
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
20559
|
+
};
|
|
20560
|
+
var ɵ0$3 = normalizeString;
|
|
20561
|
+
/**
|
|
20562
|
+
* Compares two strings by normalizing them to a case-insensitive and accent-free form,
|
|
20563
|
+
* and checks if the main string contains the substring.
|
|
20564
|
+
*
|
|
20565
|
+
* @param mainString - The string to be searched.
|
|
20566
|
+
* @param substring - The string to search for within the main string.
|
|
20567
|
+
* @returns A boolean indicating whether the normalized main string contains the normalized substring.
|
|
20568
|
+
*/
|
|
20569
|
+
var compareStrings = function (mainString, substring) {
|
|
20570
|
+
return normalizeString(mainString).includes(normalizeString(substring));
|
|
20571
|
+
};
|
|
20572
|
+
var ɵ1$2 = compareStrings;
|
|
20573
|
+
var randomHash = function (prefix) {
|
|
20574
|
+
if (prefix === void 0) { prefix = 'id'; }
|
|
20575
|
+
return prefix + "-" + Math.random().toString(36).substring(2, 9) + "-" + Date.now().toString(36);
|
|
20576
|
+
};
|
|
20577
|
+
var ɵ2$1 = randomHash;
|
|
20578
|
+
var filterEnabled = function (list) {
|
|
20579
|
+
var _list = list instanceof Set ? Array.from(list) : list;
|
|
20580
|
+
return _list.filter(function (x) { return !x.disabled; });
|
|
20581
|
+
};
|
|
20582
|
+
var ɵ3 = filterEnabled;
|
|
20583
|
+
var mapData = function (list) {
|
|
20584
|
+
return list.map(function (x) { return x.data; });
|
|
20585
|
+
};
|
|
20586
|
+
var ɵ4 = mapData;
|
|
20587
|
+
var parseValueEmit = rxjs.pipe(filterEnabled, mapData);
|
|
20588
|
+
var parseItensPickList = function (array, disabledFn) {
|
|
20589
|
+
return array.map(function (x) {
|
|
20590
|
+
return {
|
|
20591
|
+
data: x,
|
|
20592
|
+
disabled: disabledFn ? disabledFn(x) : false
|
|
20593
|
+
};
|
|
20594
|
+
});
|
|
20595
|
+
};
|
|
20596
|
+
|
|
20597
|
+
var PicklistModule = /** @class */ (function () {
|
|
20598
|
+
function PicklistModule() {
|
|
20599
|
+
}
|
|
20600
|
+
PicklistModule = __decorate([
|
|
20601
|
+
core.NgModule({
|
|
20602
|
+
declarations: [PicklistComponent],
|
|
20603
|
+
imports: [
|
|
20604
|
+
common.CommonModule,
|
|
20605
|
+
core$1.TranslateModule,
|
|
20606
|
+
dragDrop.DragDropModule,
|
|
20607
|
+
forms.FormsModule,
|
|
20608
|
+
ButtonModule,
|
|
20609
|
+
],
|
|
20610
|
+
exports: [PicklistComponent]
|
|
20611
|
+
})
|
|
20612
|
+
], PicklistModule);
|
|
20613
|
+
return PicklistModule;
|
|
20614
|
+
}());
|
|
20615
|
+
|
|
20258
20616
|
var fallback = {
|
|
20259
20617
|
"platform.angular_components.drag_your_photo_or": "Arraste sua foto ou",
|
|
20260
20618
|
"platform.angular_components.select_a_file": "selecione um arquivo",
|
|
@@ -20569,7 +20927,12 @@
|
|
|
20569
20927
|
"platform.angular_components.country_name_tm": "Turquemenistão",
|
|
20570
20928
|
"platform.angular_components.country_name_uz": "Uzbequistão",
|
|
20571
20929
|
"platform.angular_components.country_name_ve": "Venezuela",
|
|
20572
|
-
"platform.angular_components.date_modified_custom_blob": "Enviado às {{hour}}:{{minutes}} de {{day}}/{{month}}/{{fullYear}}"
|
|
20930
|
+
"platform.angular_components.date_modified_custom_blob": "Enviado às {{hour}}:{{minutes}} de {{day}}/{{month}}/{{fullYear}}",
|
|
20931
|
+
"platform.angular_components.available-items": "Itens disponíveis",
|
|
20932
|
+
"platform.angular_components.selected-items": "Itens selecionados",
|
|
20933
|
+
"plataform.angular_components.picklist-placeholder": "Busque pelo nome ou termo",
|
|
20934
|
+
"platform.angular_components.add_all": "Adicionar todos",
|
|
20935
|
+
"platform.angular_components.remove_all": "Remover todos"
|
|
20573
20936
|
};
|
|
20574
20937
|
|
|
20575
20938
|
exports.AccordionComponent = AccordionComponent;
|
|
@@ -20697,6 +21060,8 @@
|
|
|
20697
21060
|
exports.PasswordStrengthComponent = PasswordStrengthComponent;
|
|
20698
21061
|
exports.PasswordStrengthDirective = PasswordStrengthDirective;
|
|
20699
21062
|
exports.PasswordStrengthModule = PasswordStrengthModule;
|
|
21063
|
+
exports.PicklistComponent = PicklistComponent;
|
|
21064
|
+
exports.PicklistModule = PicklistModule;
|
|
20700
21065
|
exports.ProductHeaderComponent = ProductHeaderComponent;
|
|
20701
21066
|
exports.ProductHeaderModule = ProductHeaderModule;
|
|
20702
21067
|
exports.ProfilePicturePickerComponent = ProfilePicturePickerComponent;
|
|
@@ -20758,6 +21123,12 @@
|
|
|
20758
21123
|
exports.convertToMomentDateFormat = convertToMomentDateFormat;
|
|
20759
21124
|
exports.countries = countries;
|
|
20760
21125
|
exports.fallback = fallback;
|
|
21126
|
+
exports.parseItensPickList = parseItensPickList;
|
|
21127
|
+
exports.ɵ0 = ɵ0$3;
|
|
21128
|
+
exports.ɵ1 = ɵ1$2;
|
|
21129
|
+
exports.ɵ2 = ɵ2$1;
|
|
21130
|
+
exports.ɵ3 = ɵ3;
|
|
21131
|
+
exports.ɵ4 = ɵ4;
|
|
20761
21132
|
exports.ɵa = TooltipComponent;
|
|
20762
21133
|
exports.ɵb = TooltipDirective;
|
|
20763
21134
|
exports.ɵba = TablePagingComponent;
|
|
@@ -20845,6 +21216,7 @@
|
|
|
20845
21216
|
exports.ɵec = CollapseOptionComponent;
|
|
20846
21217
|
exports.ɵed = CollapsedItemsComponent;
|
|
20847
21218
|
exports.ɵee = VerticalItemsComponent;
|
|
21219
|
+
exports.ɵef = ButtonModule;
|
|
20848
21220
|
exports.ɵf = TieredMenuComponent;
|
|
20849
21221
|
exports.ɵg = TieredMenuNestedComponent;
|
|
20850
21222
|
exports.ɵh = TieredMenuItemComponent;
|