@seniorsistemas/angular-components 17.1.8 → 17.2.1
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 +874 -115
- 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/file-upload/file-upload.component.d.ts +7 -2
- package/components/file-upload/models/file-upload-permissions.d.ts +6 -0
- package/components/file-upload/models/index.d.ts +1 -0
- package/components/tiered-menu/components/tiered-menu/tiered-menu.component.d.ts +28 -0
- package/components/tiered-menu/components/tiered-menu-divider/tiered-menu-divider.component.d.ts +2 -0
- package/components/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.d.ts +14 -0
- package/components/tiered-menu/components/tiered-menu-nested/tiered-menu-nested.component.d.ts +21 -0
- package/components/tiered-menu/index.d.ts +3 -0
- package/components/tiered-menu/models/index.d.ts +2 -0
- package/components/tiered-menu/models/tiered-menu-item-data.d.ts +7 -0
- package/components/tiered-menu/models/tiered-menu-item-internal-data.d.ts +10 -0
- package/components/tiered-menu/tiered-menu.directive.d.ts +37 -0
- package/components/tiered-menu/tiered-menu.event.service.d.ts +18 -0
- package/components/tiered-menu/tiered-menu.module.d.ts +2 -0
- package/components/tiered-menu/tiered-menu.service.d.ts +10 -0
- package/esm2015/components/file-upload/file-upload.component.js +13 -5
- package/esm2015/components/file-upload/file-upload.module.js +2 -2
- package/esm2015/components/file-upload/models/file-upload-permissions.js +12 -0
- package/esm2015/components/file-upload/models/index.js +2 -1
- package/esm2015/components/tiered-menu/components/tiered-menu/tiered-menu.component.js +218 -0
- package/esm2015/components/tiered-menu/components/tiered-menu-divider/tiered-menu-divider.component.js +13 -0
- package/esm2015/components/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.js +68 -0
- package/esm2015/components/tiered-menu/components/tiered-menu-nested/tiered-menu-nested.component.js +131 -0
- package/esm2015/components/tiered-menu/index.js +3 -0
- package/esm2015/components/tiered-menu/models/index.js +1 -0
- package/esm2015/components/tiered-menu/models/tiered-menu-item-data.js +1 -0
- package/esm2015/components/tiered-menu/models/tiered-menu-item-internal-data.js +1 -0
- package/esm2015/components/tiered-menu/tiered-menu.directive.js +212 -0
- package/esm2015/components/tiered-menu/tiered-menu.event.service.js +39 -0
- package/esm2015/components/tiered-menu/tiered-menu.module.js +35 -0
- package/esm2015/components/tiered-menu/tiered-menu.service.js +39 -0
- package/esm2015/components/tooltip/tooltip.directive.js +2 -2
- package/esm2015/public-api.js +2 -1
- package/esm2015/seniorsistemas-angular-components.js +7 -1
- package/esm5/components/file-upload/file-upload.component.js +13 -5
- package/esm5/components/file-upload/file-upload.module.js +2 -2
- package/esm5/components/file-upload/models/file-upload-permissions.js +12 -0
- package/esm5/components/file-upload/models/index.js +2 -1
- package/esm5/components/tiered-menu/components/tiered-menu/tiered-menu.component.js +223 -0
- package/esm5/components/tiered-menu/components/tiered-menu-divider/tiered-menu-divider.component.js +16 -0
- package/esm5/components/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.js +70 -0
- package/esm5/components/tiered-menu/components/tiered-menu-nested/tiered-menu-nested.component.js +133 -0
- package/esm5/components/tiered-menu/index.js +3 -0
- package/esm5/components/tiered-menu/models/index.js +1 -0
- package/esm5/components/tiered-menu/models/tiered-menu-item-data.js +1 -0
- package/esm5/components/tiered-menu/models/tiered-menu-item-internal-data.js +1 -0
- package/esm5/components/tiered-menu/tiered-menu.directive.js +216 -0
- package/esm5/components/tiered-menu/tiered-menu.event.service.js +40 -0
- package/esm5/components/tiered-menu/tiered-menu.module.js +38 -0
- package/esm5/components/tiered-menu/tiered-menu.service.js +44 -0
- package/esm5/components/tooltip/tooltip.directive.js +2 -2
- package/esm5/public-api.js +2 -1
- package/esm5/seniorsistemas-angular-components.js +7 -1
- package/fesm2015/seniorsistemas-angular-components.js +839 -113
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +870 -119
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/seniorsistemas-angular-components.d.ts +6 -0
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -687,7 +687,7 @@
|
|
|
687
687
|
};
|
|
688
688
|
TooltipDirective.prototype.showTooltip = function () {
|
|
689
689
|
if (this.componentRef !== null) {
|
|
690
|
-
this.componentRef.instance.visible =
|
|
690
|
+
this.componentRef.instance.visible = this.visible;
|
|
691
691
|
window.addEventListener('mousemove', this.boundOnWindowMouseMoveFunction);
|
|
692
692
|
}
|
|
693
693
|
};
|
|
@@ -4329,119 +4329,6 @@
|
|
|
4329
4329
|
return EmptyStateModule;
|
|
4330
4330
|
}());
|
|
4331
4331
|
|
|
4332
|
-
|
|
4333
|
-
(function (ValidateErrors) {
|
|
4334
|
-
ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
|
|
4335
|
-
ValidateErrors["MAX_FILE_LIMIT"] = "MAX_FILE_LIMIT";
|
|
4336
|
-
ValidateErrors["UNSUPPORTED_EXTENSION"] = "UNSUPPORTED_EXTENSION";
|
|
4337
|
-
})(exports.ValidateErrors || (exports.ValidateErrors = {}));
|
|
4338
|
-
|
|
4339
|
-
var Breakpoints = {
|
|
4340
|
-
SM_MIN: 0,
|
|
4341
|
-
SM_MAX: 767,
|
|
4342
|
-
MD_MIN: 768,
|
|
4343
|
-
MD_MAX: 991,
|
|
4344
|
-
LG_MIN: 992,
|
|
4345
|
-
LG_MAX: 1199,
|
|
4346
|
-
XL_MIN: 1200,
|
|
4347
|
-
XL_MAX: Infinity,
|
|
4348
|
-
};
|
|
4349
|
-
|
|
4350
|
-
var ExportUtils = /** @class */ (function () {
|
|
4351
|
-
function ExportUtils() {
|
|
4352
|
-
throw new Error("Classe não deve ser instanciada.");
|
|
4353
|
-
}
|
|
4354
|
-
ExportUtils.addClass = function (element, className) {
|
|
4355
|
-
element.nativeElement.className = element.nativeElement.className + " " + className;
|
|
4356
|
-
};
|
|
4357
|
-
ExportUtils.removeClass = function (element, className) {
|
|
4358
|
-
if (element.nativeElement.className.includes(className)) {
|
|
4359
|
-
element.nativeElement.className = element.nativeElement.className.replace(className, "");
|
|
4360
|
-
}
|
|
4361
|
-
};
|
|
4362
|
-
ExportUtils.exportCSV = function (columns, data, csvSeparator, documentName) {
|
|
4363
|
-
var _this = this;
|
|
4364
|
-
if (columns === void 0) { columns = []; }
|
|
4365
|
-
if (data === void 0) { data = []; }
|
|
4366
|
-
if (csvSeparator === void 0) { csvSeparator = ";"; }
|
|
4367
|
-
if (documentName === void 0) { documentName = "download"; }
|
|
4368
|
-
var csv = "\ufeff";
|
|
4369
|
-
columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
|
|
4370
|
-
csv += "\"" + (column.header || column.field) + "\"";
|
|
4371
|
-
if (i < columns.length - 1)
|
|
4372
|
-
csv += csvSeparator;
|
|
4373
|
-
});
|
|
4374
|
-
data.forEach(function (record) {
|
|
4375
|
-
csv += "\n";
|
|
4376
|
-
columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
|
|
4377
|
-
var cellData;
|
|
4378
|
-
if (Array.isArray(column.field)) {
|
|
4379
|
-
var fieldValues = column.field.map(function (col) { return _this.resolveFieldData(record, col); });
|
|
4380
|
-
cellData = fieldValues
|
|
4381
|
-
.flat()
|
|
4382
|
-
.filter(function (value) { return value !== null && value !== undefined; })
|
|
4383
|
-
.join(column.separator);
|
|
4384
|
-
}
|
|
4385
|
-
else {
|
|
4386
|
-
cellData = _this.resolveFieldData(record, column.field);
|
|
4387
|
-
}
|
|
4388
|
-
if (cellData != null)
|
|
4389
|
-
cellData = String(cellData).replace(/"/g, "\"\"");
|
|
4390
|
-
else
|
|
4391
|
-
cellData = "";
|
|
4392
|
-
csv += "\"" + cellData + "\"";
|
|
4393
|
-
if (i < columns.length - 1)
|
|
4394
|
-
csv += csvSeparator;
|
|
4395
|
-
});
|
|
4396
|
-
});
|
|
4397
|
-
var blob = new Blob([csv], {
|
|
4398
|
-
type: "text/csv;charset=utf-8;",
|
|
4399
|
-
});
|
|
4400
|
-
if (window.navigator.msSaveOrOpenBlob)
|
|
4401
|
-
navigator.msSaveOrOpenBlob(blob, documentName + ".csv");
|
|
4402
|
-
else {
|
|
4403
|
-
var link = document.createElement("a");
|
|
4404
|
-
link.style.display = "none";
|
|
4405
|
-
document.body.appendChild(link);
|
|
4406
|
-
if (link.download !== undefined) {
|
|
4407
|
-
link.setAttribute("href", URL.createObjectURL(blob));
|
|
4408
|
-
link.setAttribute("download", documentName + ".csv");
|
|
4409
|
-
link.click();
|
|
4410
|
-
}
|
|
4411
|
-
else {
|
|
4412
|
-
csv = "data:text/csv;charset=utf-8," + csv;
|
|
4413
|
-
window.open(encodeURI(csv));
|
|
4414
|
-
}
|
|
4415
|
-
document.body.removeChild(link);
|
|
4416
|
-
}
|
|
4417
|
-
};
|
|
4418
|
-
ExportUtils.resolveFieldData = function (data, field) {
|
|
4419
|
-
if (data && field) {
|
|
4420
|
-
if (this.isFunction(field))
|
|
4421
|
-
return field(data);
|
|
4422
|
-
else if (field.indexOf(".") == -1)
|
|
4423
|
-
return data[field];
|
|
4424
|
-
else {
|
|
4425
|
-
var fields = field.split(".");
|
|
4426
|
-
var value = data;
|
|
4427
|
-
for (var i = 0, len = fields.length; i < len; ++i) {
|
|
4428
|
-
if (value == null) {
|
|
4429
|
-
return null;
|
|
4430
|
-
}
|
|
4431
|
-
value = value[fields[i]];
|
|
4432
|
-
}
|
|
4433
|
-
return value;
|
|
4434
|
-
}
|
|
4435
|
-
}
|
|
4436
|
-
else
|
|
4437
|
-
return null;
|
|
4438
|
-
};
|
|
4439
|
-
ExportUtils.isFunction = function (obj) {
|
|
4440
|
-
return !!(obj && obj.constructor && obj.call && obj.apply);
|
|
4441
|
-
};
|
|
4442
|
-
return ExportUtils;
|
|
4443
|
-
}());
|
|
4444
|
-
|
|
4445
4332
|
/**
|
|
4446
4333
|
* Formats a JSON response to a JS object
|
|
4447
4334
|
* @param response The response to format
|
|
@@ -4703,12 +4590,140 @@
|
|
|
4703
4590
|
return FileUploadService;
|
|
4704
4591
|
}());
|
|
4705
4592
|
|
|
4593
|
+
var Breakpoints = {
|
|
4594
|
+
SM_MIN: 0,
|
|
4595
|
+
SM_MAX: 767,
|
|
4596
|
+
MD_MIN: 768,
|
|
4597
|
+
MD_MAX: 991,
|
|
4598
|
+
LG_MIN: 992,
|
|
4599
|
+
LG_MAX: 1199,
|
|
4600
|
+
XL_MIN: 1200,
|
|
4601
|
+
XL_MAX: Infinity,
|
|
4602
|
+
};
|
|
4603
|
+
|
|
4604
|
+
var ExportUtils = /** @class */ (function () {
|
|
4605
|
+
function ExportUtils() {
|
|
4606
|
+
throw new Error("Classe não deve ser instanciada.");
|
|
4607
|
+
}
|
|
4608
|
+
ExportUtils.addClass = function (element, className) {
|
|
4609
|
+
element.nativeElement.className = element.nativeElement.className + " " + className;
|
|
4610
|
+
};
|
|
4611
|
+
ExportUtils.removeClass = function (element, className) {
|
|
4612
|
+
if (element.nativeElement.className.includes(className)) {
|
|
4613
|
+
element.nativeElement.className = element.nativeElement.className.replace(className, "");
|
|
4614
|
+
}
|
|
4615
|
+
};
|
|
4616
|
+
ExportUtils.exportCSV = function (columns, data, csvSeparator, documentName) {
|
|
4617
|
+
var _this = this;
|
|
4618
|
+
if (columns === void 0) { columns = []; }
|
|
4619
|
+
if (data === void 0) { data = []; }
|
|
4620
|
+
if (csvSeparator === void 0) { csvSeparator = ";"; }
|
|
4621
|
+
if (documentName === void 0) { documentName = "download"; }
|
|
4622
|
+
var csv = "\ufeff";
|
|
4623
|
+
columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
|
|
4624
|
+
csv += "\"" + (column.header || column.field) + "\"";
|
|
4625
|
+
if (i < columns.length - 1)
|
|
4626
|
+
csv += csvSeparator;
|
|
4627
|
+
});
|
|
4628
|
+
data.forEach(function (record) {
|
|
4629
|
+
csv += "\n";
|
|
4630
|
+
columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
|
|
4631
|
+
var cellData;
|
|
4632
|
+
if (Array.isArray(column.field)) {
|
|
4633
|
+
var fieldValues = column.field.map(function (col) { return _this.resolveFieldData(record, col); });
|
|
4634
|
+
cellData = fieldValues
|
|
4635
|
+
.flat()
|
|
4636
|
+
.filter(function (value) { return value !== null && value !== undefined; })
|
|
4637
|
+
.join(column.separator);
|
|
4638
|
+
}
|
|
4639
|
+
else {
|
|
4640
|
+
cellData = _this.resolveFieldData(record, column.field);
|
|
4641
|
+
}
|
|
4642
|
+
if (cellData != null)
|
|
4643
|
+
cellData = String(cellData).replace(/"/g, "\"\"");
|
|
4644
|
+
else
|
|
4645
|
+
cellData = "";
|
|
4646
|
+
csv += "\"" + cellData + "\"";
|
|
4647
|
+
if (i < columns.length - 1)
|
|
4648
|
+
csv += csvSeparator;
|
|
4649
|
+
});
|
|
4650
|
+
});
|
|
4651
|
+
var blob = new Blob([csv], {
|
|
4652
|
+
type: "text/csv;charset=utf-8;",
|
|
4653
|
+
});
|
|
4654
|
+
if (window.navigator.msSaveOrOpenBlob)
|
|
4655
|
+
navigator.msSaveOrOpenBlob(blob, documentName + ".csv");
|
|
4656
|
+
else {
|
|
4657
|
+
var link = document.createElement("a");
|
|
4658
|
+
link.style.display = "none";
|
|
4659
|
+
document.body.appendChild(link);
|
|
4660
|
+
if (link.download !== undefined) {
|
|
4661
|
+
link.setAttribute("href", URL.createObjectURL(blob));
|
|
4662
|
+
link.setAttribute("download", documentName + ".csv");
|
|
4663
|
+
link.click();
|
|
4664
|
+
}
|
|
4665
|
+
else {
|
|
4666
|
+
csv = "data:text/csv;charset=utf-8," + csv;
|
|
4667
|
+
window.open(encodeURI(csv));
|
|
4668
|
+
}
|
|
4669
|
+
document.body.removeChild(link);
|
|
4670
|
+
}
|
|
4671
|
+
};
|
|
4672
|
+
ExportUtils.resolveFieldData = function (data, field) {
|
|
4673
|
+
if (data && field) {
|
|
4674
|
+
if (this.isFunction(field))
|
|
4675
|
+
return field(data);
|
|
4676
|
+
else if (field.indexOf(".") == -1)
|
|
4677
|
+
return data[field];
|
|
4678
|
+
else {
|
|
4679
|
+
var fields = field.split(".");
|
|
4680
|
+
var value = data;
|
|
4681
|
+
for (var i = 0, len = fields.length; i < len; ++i) {
|
|
4682
|
+
if (value == null) {
|
|
4683
|
+
return null;
|
|
4684
|
+
}
|
|
4685
|
+
value = value[fields[i]];
|
|
4686
|
+
}
|
|
4687
|
+
return value;
|
|
4688
|
+
}
|
|
4689
|
+
}
|
|
4690
|
+
else
|
|
4691
|
+
return null;
|
|
4692
|
+
};
|
|
4693
|
+
ExportUtils.isFunction = function (obj) {
|
|
4694
|
+
return !!(obj && obj.constructor && obj.call && obj.apply);
|
|
4695
|
+
};
|
|
4696
|
+
return ExportUtils;
|
|
4697
|
+
}());
|
|
4698
|
+
|
|
4699
|
+
|
|
4700
|
+
(function (ValidateErrors) {
|
|
4701
|
+
ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
|
|
4702
|
+
ValidateErrors["MAX_FILE_LIMIT"] = "MAX_FILE_LIMIT";
|
|
4703
|
+
ValidateErrors["UNSUPPORTED_EXTENSION"] = "UNSUPPORTED_EXTENSION";
|
|
4704
|
+
})(exports.ValidateErrors || (exports.ValidateErrors = {}));
|
|
4705
|
+
|
|
4706
|
+
var FileUploadPermissions;
|
|
4707
|
+
(function (FileUploadPermissions) {
|
|
4708
|
+
FileUploadPermissions["Add"] = "add";
|
|
4709
|
+
FileUploadPermissions["Read"] = "read";
|
|
4710
|
+
FileUploadPermissions["Remove"] = "remove";
|
|
4711
|
+
})(FileUploadPermissions || (FileUploadPermissions = {}));
|
|
4712
|
+
var ALL_PERMISSIONS = [
|
|
4713
|
+
FileUploadPermissions.Add,
|
|
4714
|
+
FileUploadPermissions.Read,
|
|
4715
|
+
FileUploadPermissions.Remove,
|
|
4716
|
+
];
|
|
4717
|
+
|
|
4706
4718
|
var moment$3 = moment_;
|
|
4707
4719
|
var FileUploadComponent = /** @class */ (function () {
|
|
4708
4720
|
function FileUploadComponent(sanitizer, fileUploadService, translate) {
|
|
4709
4721
|
this.sanitizer = sanitizer;
|
|
4710
4722
|
this.fileUploadService = fileUploadService;
|
|
4711
4723
|
this.translate = translate;
|
|
4724
|
+
this.ADD_PERMISSION = FileUploadPermissions.Add;
|
|
4725
|
+
this.READ_PERMISSION = FileUploadPermissions.Read;
|
|
4726
|
+
this.REMOVE_PERMISSION = FileUploadPermissions.Remove;
|
|
4712
4727
|
this.id = "s-file-upload-" + FileUploadComponent_1.nextId++;
|
|
4713
4728
|
this.chooseLabel = "Anexar arquivos";
|
|
4714
4729
|
this.removeLabel = "Remover";
|
|
@@ -4718,6 +4733,7 @@
|
|
|
4718
4733
|
this.ariaLabelProgress = "Carregando arquivo";
|
|
4719
4734
|
this.disabled = false;
|
|
4720
4735
|
this.showFileUploadDate = false;
|
|
4736
|
+
this.permissions = ALL_PERMISSIONS;
|
|
4721
4737
|
this.uploadHandler = new core.EventEmitter();
|
|
4722
4738
|
this.removeFile = new core.EventEmitter();
|
|
4723
4739
|
this.cancelUpload = new core.EventEmitter();
|
|
@@ -4944,6 +4960,9 @@
|
|
|
4944
4960
|
__decorate([
|
|
4945
4961
|
core.Input()
|
|
4946
4962
|
], FileUploadComponent.prototype, "showFileUploadDate", void 0);
|
|
4963
|
+
__decorate([
|
|
4964
|
+
core.Input()
|
|
4965
|
+
], FileUploadComponent.prototype, "permissions", void 0);
|
|
4947
4966
|
__decorate([
|
|
4948
4967
|
core.Input()
|
|
4949
4968
|
], FileUploadComponent.prototype, "files", null);
|
|
@@ -4968,7 +4987,7 @@
|
|
|
4968
4987
|
FileUploadComponent = FileUploadComponent_1 = __decorate([
|
|
4969
4988
|
core.Component({
|
|
4970
4989
|
selector: "s-file-upload",
|
|
4971
|
-
template: "<div\n [id]=\"id\"\n class=\"s-fileupload\">\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id+'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"onFileSelect($event.dataTransfer\n ? $event.dataTransfer.files\n : $event.target.files)\"> \n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel\"\n (onClick)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled\"\n [auxiliary]=\"false\">\n </s-button>\n </div>\n\n <section\n *ngIf=\"files.length\" \n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\">\n <ng-container *ngFor=\"let file of files; let i = index\">\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\">\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"s-fileupload-list-file-name\"\n role=\"gridcell\">\n <ng-container *ngTemplateOutlet=\"file.savedFile || file.progress === 100\n ? descriptionUrl\n : description; context: {\n $implicit: file,\n index: i\n }\">\n </ng-container>\n <span *ngIf=\"modifiedDate\" class=\"s-fileupload-list-file-name-date\">{{ modifiedDate }}</span>\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\">\n <p-progressBar\n *ngIf=\"file.isUploading && !isSmallDevice\"\n [style]=\"{ 'width': '250px', 'background-color': '#d8d8d8', 'border-radius': '0px', 'height': '14px'}\"\n [value]=\"file.progress\"\n [showValue]=\"false\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </p-progressBar>\n <span\n *ngIf=\"file.isUploading && isSmallDevice\" \n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </span>\n <span\n *ngIf=\"!file.isUploading && !file.error && file.progress === 100\"\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelSuccess || successTooltip\"\n [pTooltip]=\"successTooltip\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n <span\n *ngIf=\"file.error?.message\" \n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\">\n <a\n *ngIf=\"file.isUploading\"\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\">\n {{cancelLabel}}\n </a>\n <a\n *ngIf=\"!file.isUploading && !(disabled || !!formGroup?.disabled)\"\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"ariaLabelRemove || removeLabel\">\n {{removeLabel}}\n </a>\n </div>\n </div>\n </ng-container>\n </section>\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i = index>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">{{file.name}}\n </a>\n <a\n style=\"display: none;\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor>\n </a>\n</ng-template>\n\n<ng-template\n #description\n let-file>\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">\n {{file.name}}\n </span>\n</ng-template>\n",
|
|
4990
|
+
template: "<div\n [id]=\"id\"\n class=\"s-fileupload\">\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id+'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"onFileSelect($event.dataTransfer\n ? $event.dataTransfer.files\n : $event.target.files)\"> \n <s-button\n *ngIf=\"permissions.includes(ADD_PERMISSION)\"\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel\"\n (onClick)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled\"\n [auxiliary]=\"false\">\n </s-button>\n </div>\n\n <section\n *ngIf=\"files.length\" \n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\">\n <ng-container *ngFor=\"let file of files; let i = index\">\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\">\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"s-fileupload-list-file-name\"\n role=\"gridcell\">\n <ng-container *ngTemplateOutlet=\"permissions.includes(READ_PERMISSION) && file.savedFile || file.progress === 100\n ? descriptionUrl\n : description; context: {\n $implicit: file,\n index: i\n }\">\n </ng-container>\n <span *ngIf=\"modifiedDate\" class=\"s-fileupload-list-file-name-date\">{{ modifiedDate }}</span>\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\">\n <p-progressBar\n *ngIf=\"file.isUploading && !isSmallDevice\"\n [style]=\"{ 'width': '250px', 'background-color': '#d8d8d8', 'border-radius': '0px', 'height': '14px'}\"\n [value]=\"file.progress\"\n [showValue]=\"false\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </p-progressBar>\n <span\n *ngIf=\"file.isUploading && isSmallDevice\" \n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </span>\n <span\n *ngIf=\"!file.isUploading && !file.error && file.progress === 100\"\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelSuccess || successTooltip\"\n [pTooltip]=\"successTooltip\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n <span\n *ngIf=\"file.error?.message\" \n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\">\n <a\n *ngIf=\"file.isUploading\"\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\">\n {{cancelLabel}}\n </a>\n <a\n *ngIf=\"permissions.includes(REMOVE_PERMISSION) && !file.isUploading && !(disabled || !!formGroup?.disabled)\"\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"ariaLabelRemove || removeLabel\">\n {{removeLabel}}\n </a>\n </div>\n </div>\n </ng-container>\n </section>\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i = index>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">{{file.name}}\n </a>\n <a\n style=\"display: none;\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor>\n </a>\n</ng-template>\n\n<ng-template\n #description\n let-file>\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">\n {{file.name}}\n </span>\n</ng-template>\n",
|
|
4972
4991
|
styles: [".s-fileupload .s-fileupload-choose{position:relative;margin:15px 0;width:-webkit-max-content;width:max-content}.s-fileupload input[type=file]{display:none}.s-fileupload-list{border:1px solid #ccc}.s-fileupload-list-file:not(:first-child){border-top:1px solid #ccc}.s-fileupload-list .s-fileupload-list-file{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:justify;justify-content:space-between;padding:15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-item-align:center;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name .s-fileupload-list-file-name-date{font-size:.75rem;color:#999}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name>a{cursor:pointer;text-decoration:none}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center}.s-fileupload-list .s-fileupload-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-check{color:#0c9348;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-times{color:#c13018;font-size:12px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin-top:15px;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;width:100%}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action{text-decoration:none;color:#428bca}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :focus,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :visited,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action:hover{text-decoration:none}@media (min-width:768px){.s-fileupload-list .s-fileupload-list-file{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{width:auto;-ms-flex-positive:2;flex-grow:2}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{margin:0 15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin:0;width:auto}}"]
|
|
4973
4992
|
})
|
|
4974
4993
|
], FileUploadComponent);
|
|
@@ -14310,6 +14329,738 @@
|
|
|
14310
14329
|
return CodeEditorModule;
|
|
14311
14330
|
}());
|
|
14312
14331
|
|
|
14332
|
+
var TieredMenuEventService = /** @class */ (function () {
|
|
14333
|
+
function TieredMenuEventService() {
|
|
14334
|
+
this.incrementCurrentItemEvent = new core.EventEmitter();
|
|
14335
|
+
this.decrementCurrentItemEvent = new core.EventEmitter();
|
|
14336
|
+
this.closeAllMenusEvent = new core.EventEmitter();
|
|
14337
|
+
this.selectItemEvent = new core.EventEmitter();
|
|
14338
|
+
this.openItemMenuEvent = new core.EventEmitter();
|
|
14339
|
+
this.closeItemMenuEvent = new core.EventEmitter();
|
|
14340
|
+
this.createMenuEvent = new core.EventEmitter();
|
|
14341
|
+
}
|
|
14342
|
+
TieredMenuEventService.prototype.emitIncrementCurrentItemEvent = function () {
|
|
14343
|
+
this.incrementCurrentItemEvent.emit();
|
|
14344
|
+
};
|
|
14345
|
+
TieredMenuEventService.prototype.emitDecrementCurrentItemEvent = function () {
|
|
14346
|
+
this.decrementCurrentItemEvent.emit();
|
|
14347
|
+
};
|
|
14348
|
+
TieredMenuEventService.prototype.emitCloseAllMenusEvent = function () {
|
|
14349
|
+
this.closeAllMenusEvent.emit();
|
|
14350
|
+
};
|
|
14351
|
+
TieredMenuEventService.prototype.emitSelectItemEvent = function (item) {
|
|
14352
|
+
this.selectItemEvent.emit(item);
|
|
14353
|
+
};
|
|
14354
|
+
TieredMenuEventService.prototype.emitOpenItemMenuEvent = function (item) {
|
|
14355
|
+
this.openItemMenuEvent.emit(item);
|
|
14356
|
+
};
|
|
14357
|
+
TieredMenuEventService.prototype.emitCloseItemMenuEvent = function (item) {
|
|
14358
|
+
this.closeItemMenuEvent.emit(item);
|
|
14359
|
+
};
|
|
14360
|
+
TieredMenuEventService.prototype.emitCreateMenuEvent = function (item) {
|
|
14361
|
+
this.createMenuEvent.emit(item);
|
|
14362
|
+
};
|
|
14363
|
+
TieredMenuEventService = __decorate([
|
|
14364
|
+
core.Injectable()
|
|
14365
|
+
], TieredMenuEventService);
|
|
14366
|
+
return TieredMenuEventService;
|
|
14367
|
+
}());
|
|
14368
|
+
|
|
14369
|
+
var TieredMenuService = /** @class */ (function () {
|
|
14370
|
+
function TieredMenuService() {
|
|
14371
|
+
}
|
|
14372
|
+
TieredMenuService.prototype.normalizeData = function (items, parent) {
|
|
14373
|
+
var _this = this;
|
|
14374
|
+
return items.map(function (i) {
|
|
14375
|
+
if (i.submenu) {
|
|
14376
|
+
i.submenu = _this.normalizeData(i.submenu, i);
|
|
14377
|
+
}
|
|
14378
|
+
i.id = "id-" + Math.random().toString(36).substring(2, 9) + "-" + Date.now().toString(36);
|
|
14379
|
+
i.parent = parent;
|
|
14380
|
+
i.isOpen = false;
|
|
14381
|
+
return i;
|
|
14382
|
+
});
|
|
14383
|
+
};
|
|
14384
|
+
TieredMenuService.prototype.markAllItemsAsClosed = function (items) {
|
|
14385
|
+
var _this = this;
|
|
14386
|
+
return items.map(function (item) {
|
|
14387
|
+
if (item.submenu) {
|
|
14388
|
+
item.submenu = _this.markAllItemsAsClosed(item.submenu);
|
|
14389
|
+
}
|
|
14390
|
+
item.isOpen = false;
|
|
14391
|
+
return item;
|
|
14392
|
+
});
|
|
14393
|
+
};
|
|
14394
|
+
TieredMenuService.prototype.searchTheHierarchy = function (item1, item2) {
|
|
14395
|
+
var itemAux = item2;
|
|
14396
|
+
while (itemAux) {
|
|
14397
|
+
if (itemAux === item1) {
|
|
14398
|
+
return true;
|
|
14399
|
+
}
|
|
14400
|
+
itemAux = itemAux.parent;
|
|
14401
|
+
}
|
|
14402
|
+
return false;
|
|
14403
|
+
};
|
|
14404
|
+
TieredMenuService = __decorate([
|
|
14405
|
+
core.Injectable()
|
|
14406
|
+
], TieredMenuService);
|
|
14407
|
+
return TieredMenuService;
|
|
14408
|
+
}());
|
|
14409
|
+
|
|
14410
|
+
var TieredMenuNestedComponent = /** @class */ (function () {
|
|
14411
|
+
function TieredMenuNestedComponent(tieredMenuService, _tieredMenuEventService) {
|
|
14412
|
+
this.tieredMenuService = tieredMenuService;
|
|
14413
|
+
this._tieredMenuEventService = _tieredMenuEventService;
|
|
14414
|
+
this.top = 0;
|
|
14415
|
+
this.maxHeight = 0;
|
|
14416
|
+
this._unsubscribe$ = new rxjs.Subject();
|
|
14417
|
+
}
|
|
14418
|
+
TieredMenuNestedComponent.prototype.ngOnInit = function () {
|
|
14419
|
+
this.tieredMenuService.currentItems = this.items;
|
|
14420
|
+
this._subscribeEvents();
|
|
14421
|
+
};
|
|
14422
|
+
TieredMenuNestedComponent.prototype.ngOnDestroy = function () {
|
|
14423
|
+
this._unsubscribe$.next();
|
|
14424
|
+
this._unsubscribe$.complete();
|
|
14425
|
+
};
|
|
14426
|
+
TieredMenuNestedComponent.prototype._incrementCurItem = function () {
|
|
14427
|
+
if (!this.tieredMenuService.currentItem) {
|
|
14428
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
|
|
14429
|
+
return;
|
|
14430
|
+
}
|
|
14431
|
+
var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
|
|
14432
|
+
if (curIndex < this.tieredMenuService.currentItems.length) {
|
|
14433
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
|
|
14434
|
+
}
|
|
14435
|
+
else {
|
|
14436
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
|
|
14437
|
+
}
|
|
14438
|
+
if (this.tieredMenuService.currentItem.divider) {
|
|
14439
|
+
this._incrementCurItem();
|
|
14440
|
+
}
|
|
14441
|
+
};
|
|
14442
|
+
TieredMenuNestedComponent.prototype._decrementCurItem = function () {
|
|
14443
|
+
if (!this.tieredMenuService.currentItem) {
|
|
14444
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
|
|
14445
|
+
return;
|
|
14446
|
+
}
|
|
14447
|
+
var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
|
|
14448
|
+
if (curIndex >= 0) {
|
|
14449
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
|
|
14450
|
+
}
|
|
14451
|
+
else {
|
|
14452
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
|
|
14453
|
+
}
|
|
14454
|
+
if (this.tieredMenuService.currentItem.divider) {
|
|
14455
|
+
this._decrementCurItem();
|
|
14456
|
+
}
|
|
14457
|
+
};
|
|
14458
|
+
TieredMenuNestedComponent.prototype._closeItem = function (item) {
|
|
14459
|
+
var _a;
|
|
14460
|
+
var itemAux = this._lastOpenItem;
|
|
14461
|
+
while (itemAux && itemAux != item) {
|
|
14462
|
+
itemAux.isOpen = false;
|
|
14463
|
+
itemAux = itemAux.parent;
|
|
14464
|
+
}
|
|
14465
|
+
item.isOpen = false;
|
|
14466
|
+
this.tieredMenuService.currentItem = itemAux !== null && itemAux !== void 0 ? itemAux : this.tieredMenuService.items[0];
|
|
14467
|
+
this.tieredMenuService.currentItems = ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.submenu) || this.tieredMenuService.items;
|
|
14468
|
+
};
|
|
14469
|
+
TieredMenuNestedComponent.prototype._openItem = function (item) {
|
|
14470
|
+
if (item === null || item === void 0 ? void 0 : item.submenu) {
|
|
14471
|
+
item.isOpen = true;
|
|
14472
|
+
this.tieredMenuService.currentItems = item.submenu;
|
|
14473
|
+
// Only has focus if there has already been interaction.
|
|
14474
|
+
if (this.tieredMenuService.currentItem) {
|
|
14475
|
+
this.tieredMenuService.currentItem = item.submenu[0];
|
|
14476
|
+
}
|
|
14477
|
+
this._lastOpenItem = item;
|
|
14478
|
+
}
|
|
14479
|
+
};
|
|
14480
|
+
TieredMenuNestedComponent.prototype._subscribeEvents = function () {
|
|
14481
|
+
var _this = this;
|
|
14482
|
+
this._tieredMenuEventService.incrementCurrentItemEvent
|
|
14483
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14484
|
+
.subscribe(function () {
|
|
14485
|
+
_this._incrementCurItem();
|
|
14486
|
+
});
|
|
14487
|
+
this._tieredMenuEventService.decrementCurrentItemEvent
|
|
14488
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14489
|
+
.subscribe(function () {
|
|
14490
|
+
_this._decrementCurItem();
|
|
14491
|
+
});
|
|
14492
|
+
this._tieredMenuEventService.selectItemEvent
|
|
14493
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14494
|
+
.subscribe(function (item) {
|
|
14495
|
+
if (item.command) {
|
|
14496
|
+
item.command();
|
|
14497
|
+
// Close all menus after the item was selected.
|
|
14498
|
+
_this._tieredMenuEventService.emitCloseAllMenusEvent();
|
|
14499
|
+
}
|
|
14500
|
+
});
|
|
14501
|
+
this._tieredMenuEventService.openItemMenuEvent
|
|
14502
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14503
|
+
.subscribe(function (item) {
|
|
14504
|
+
var _a, _b;
|
|
14505
|
+
if (!_this.tieredMenuService.currentItems.includes(item)) {
|
|
14506
|
+
var itemAux = _this._lastOpenItem;
|
|
14507
|
+
while ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.parent) {
|
|
14508
|
+
itemAux = itemAux.parent;
|
|
14509
|
+
}
|
|
14510
|
+
_this._tieredMenuEventService.emitCloseItemMenuEvent((_b = itemAux.parent) !== null && _b !== void 0 ? _b : itemAux);
|
|
14511
|
+
}
|
|
14512
|
+
_this._lastOpenItem = item;
|
|
14513
|
+
_this._openItem(item);
|
|
14514
|
+
});
|
|
14515
|
+
this._tieredMenuEventService.closeItemMenuEvent
|
|
14516
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14517
|
+
.subscribe(function (item) {
|
|
14518
|
+
if (item) {
|
|
14519
|
+
_this._closeItem(item);
|
|
14520
|
+
}
|
|
14521
|
+
});
|
|
14522
|
+
};
|
|
14523
|
+
TieredMenuNestedComponent.ctorParameters = function () { return [
|
|
14524
|
+
{ type: TieredMenuService },
|
|
14525
|
+
{ type: TieredMenuEventService }
|
|
14526
|
+
]; };
|
|
14527
|
+
TieredMenuNestedComponent = __decorate([
|
|
14528
|
+
core.Component({
|
|
14529
|
+
template: "<div\n class=\"menu menu--nested\"\n [ngStyle]=\"{\n 'top': top + 'px',\n 'max-height': maxHeight + 'px'\n }\">\n <ng-container *ngTemplateOutlet=\"itemsTemplate; context: { $implicit: items }\"></ng-container>\n</div>\n\n<ng-template #itemsTemplate let-items>\n <div *ngFor=\"let item of items\">\n <s-tiered-menu-item\n *ngIf=\"!item.divider\"\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [closeOnClick]=\"true\">\n </s-tiered-menu-item>\n\n <s-tiered-menu-divider *ngIf=\"item.divider\"></s-tiered-menu-divider>\n\n <div *ngIf=\"item.submenu && item.isOpen\">\n <div class=\"submenu\">\n <ng-container *ngTemplateOutlet=\"itemsTemplate; context: { $implicit: item.submenu }\"></ng-container>\n </div>\n </div>\n </div>\n</ng-template>\n",
|
|
14530
|
+
styles: [".menu{background-color:#fff;border:1px solid #ccc;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;min-width:176px;padding:4px 0;position:fixed;z-index:9999;overflow:auto}.menu--nested{width:90vw;margin:0 5vw}.menu .submenu{margin-left:24px}"]
|
|
14531
|
+
})
|
|
14532
|
+
], TieredMenuNestedComponent);
|
|
14533
|
+
return TieredMenuNestedComponent;
|
|
14534
|
+
}());
|
|
14535
|
+
|
|
14536
|
+
var TieredMenuComponent = /** @class */ (function () {
|
|
14537
|
+
function TieredMenuComponent(_appRef, _componentFactoryResolver, _injector, tieredMenuService, _tieredMenuEventService) {
|
|
14538
|
+
this._appRef = _appRef;
|
|
14539
|
+
this._componentFactoryResolver = _componentFactoryResolver;
|
|
14540
|
+
this._injector = _injector;
|
|
14541
|
+
this.tieredMenuService = tieredMenuService;
|
|
14542
|
+
this._tieredMenuEventService = _tieredMenuEventService;
|
|
14543
|
+
this.top = 0;
|
|
14544
|
+
this.left = 0;
|
|
14545
|
+
this.menuTriggerEvent = "hover";
|
|
14546
|
+
this._componentRef = null;
|
|
14547
|
+
this._unsubscribe$ = new rxjs.Subject();
|
|
14548
|
+
this.destroyRequest = new core.EventEmitter();
|
|
14549
|
+
}
|
|
14550
|
+
TieredMenuComponent_1 = TieredMenuComponent;
|
|
14551
|
+
TieredMenuComponent.prototype.ngOnInit = function () {
|
|
14552
|
+
this.tieredMenuService.currentItems = this.items;
|
|
14553
|
+
this._subscribeEvents();
|
|
14554
|
+
};
|
|
14555
|
+
TieredMenuComponent.prototype.ngOnDestroy = function () {
|
|
14556
|
+
this._unsubscribe$.next();
|
|
14557
|
+
this._unsubscribe$.complete();
|
|
14558
|
+
};
|
|
14559
|
+
TieredMenuComponent.prototype._incrementCurItem = function () {
|
|
14560
|
+
if (!this.tieredMenuService.currentItem) {
|
|
14561
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
|
|
14562
|
+
return;
|
|
14563
|
+
}
|
|
14564
|
+
else if (!this.items.includes(this.tieredMenuService.currentItem)) {
|
|
14565
|
+
// Checking if it is the current menu.
|
|
14566
|
+
return;
|
|
14567
|
+
}
|
|
14568
|
+
var currentIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
|
|
14569
|
+
if (currentIndex < this.tieredMenuService.currentItems.length) {
|
|
14570
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[currentIndex];
|
|
14571
|
+
}
|
|
14572
|
+
else {
|
|
14573
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
|
|
14574
|
+
}
|
|
14575
|
+
if (this.tieredMenuService.currentItem.divider) {
|
|
14576
|
+
this._incrementCurItem();
|
|
14577
|
+
}
|
|
14578
|
+
};
|
|
14579
|
+
TieredMenuComponent.prototype._decrementCurItem = function () {
|
|
14580
|
+
if (!this.tieredMenuService.currentItem) {
|
|
14581
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
|
|
14582
|
+
return;
|
|
14583
|
+
// Checking if it is the current menu.
|
|
14584
|
+
}
|
|
14585
|
+
else if (!this.items.includes(this.tieredMenuService.currentItem)) {
|
|
14586
|
+
return;
|
|
14587
|
+
}
|
|
14588
|
+
var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
|
|
14589
|
+
if (curIndex >= 0) {
|
|
14590
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
|
|
14591
|
+
}
|
|
14592
|
+
else {
|
|
14593
|
+
this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
|
|
14594
|
+
}
|
|
14595
|
+
if (this.tieredMenuService.currentItem.divider) {
|
|
14596
|
+
this._decrementCurItem();
|
|
14597
|
+
}
|
|
14598
|
+
};
|
|
14599
|
+
TieredMenuComponent.prototype._createMenu = function (items, position) {
|
|
14600
|
+
var _this = this;
|
|
14601
|
+
if (!this._componentRef && items) {
|
|
14602
|
+
var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent_1);
|
|
14603
|
+
this._componentRef = componentFactory.create(this._injector);
|
|
14604
|
+
this._appRef.attachView(this._componentRef.hostView);
|
|
14605
|
+
var domElem = this._componentRef.hostView.rootNodes[0];
|
|
14606
|
+
document.body.appendChild(domElem);
|
|
14607
|
+
// Setting the menu items.
|
|
14608
|
+
this._componentRef.instance.items = items;
|
|
14609
|
+
// Subscribe menu events.
|
|
14610
|
+
this._componentRef.instance.destroyRequest
|
|
14611
|
+
.subscribe(function (propagate) {
|
|
14612
|
+
_this._destroy(propagate);
|
|
14613
|
+
});
|
|
14614
|
+
this._menuDivElement = domElem.querySelector(".menu");
|
|
14615
|
+
this._setMenuPosition(position);
|
|
14616
|
+
}
|
|
14617
|
+
};
|
|
14618
|
+
TieredMenuComponent.prototype._destroy = function (propagate) {
|
|
14619
|
+
if (propagate === void 0) { propagate = true; }
|
|
14620
|
+
if (this._componentRef !== null) {
|
|
14621
|
+
this._appRef.detachView(this._componentRef.hostView);
|
|
14622
|
+
this._componentRef.destroy();
|
|
14623
|
+
this._componentRef = null;
|
|
14624
|
+
this._menuDivElement = null;
|
|
14625
|
+
}
|
|
14626
|
+
if (propagate) {
|
|
14627
|
+
this.destroyRequest.emit();
|
|
14628
|
+
}
|
|
14629
|
+
};
|
|
14630
|
+
TieredMenuComponent.prototype._setMenuPosition = function (position) {
|
|
14631
|
+
var _a;
|
|
14632
|
+
if (this._componentRef !== null) {
|
|
14633
|
+
var top_1 = position.top, right = position.right, bottom = position.bottom, left = position.left;
|
|
14634
|
+
// I need to calculate the height of the component because the internal elements have not been created yet.
|
|
14635
|
+
var menuHeight = ((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) * 40;
|
|
14636
|
+
var menuWidth = this._menuDivElement.getBoundingClientRect().width;
|
|
14637
|
+
var rightFreeSpace = document.body.clientWidth - right;
|
|
14638
|
+
var bottomFreeSpace = document.body.clientHeight - bottom;
|
|
14639
|
+
if (rightFreeSpace > menuWidth) {
|
|
14640
|
+
this._componentRef.instance.left = right;
|
|
14641
|
+
}
|
|
14642
|
+
else {
|
|
14643
|
+
this._componentRef.instance.left = left - menuWidth;
|
|
14644
|
+
}
|
|
14645
|
+
if (bottomFreeSpace <= menuHeight) {
|
|
14646
|
+
this._componentRef.instance.top = top_1 - menuHeight;
|
|
14647
|
+
}
|
|
14648
|
+
else {
|
|
14649
|
+
this._componentRef.instance.top = top_1;
|
|
14650
|
+
}
|
|
14651
|
+
}
|
|
14652
|
+
};
|
|
14653
|
+
TieredMenuComponent.prototype._subscribeEvents = function () {
|
|
14654
|
+
var _this = this;
|
|
14655
|
+
// Increment current item event.
|
|
14656
|
+
this._tieredMenuEventService.incrementCurrentItemEvent
|
|
14657
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14658
|
+
.subscribe(function () {
|
|
14659
|
+
_this._incrementCurItem();
|
|
14660
|
+
});
|
|
14661
|
+
// Decrement current item event.
|
|
14662
|
+
this._tieredMenuEventService.decrementCurrentItemEvent
|
|
14663
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14664
|
+
.subscribe(function () {
|
|
14665
|
+
_this._decrementCurItem();
|
|
14666
|
+
});
|
|
14667
|
+
// Select item event.
|
|
14668
|
+
this._tieredMenuEventService.selectItemEvent
|
|
14669
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14670
|
+
.subscribe(function (item) {
|
|
14671
|
+
if (item.submenu) {
|
|
14672
|
+
_this._tieredMenuEventService.emitOpenItemMenuEvent(item);
|
|
14673
|
+
}
|
|
14674
|
+
else if (item.command) {
|
|
14675
|
+
_this._tieredMenuEventService.emitCloseAllMenusEvent();
|
|
14676
|
+
item.command();
|
|
14677
|
+
}
|
|
14678
|
+
});
|
|
14679
|
+
// Close all menus event.
|
|
14680
|
+
this._tieredMenuEventService.closeAllMenusEvent
|
|
14681
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14682
|
+
.subscribe(function () {
|
|
14683
|
+
_this._destroy();
|
|
14684
|
+
_this.tieredMenuService.currentItem = null;
|
|
14685
|
+
_this.tieredMenuService.currentItems = _this.tieredMenuService.items;
|
|
14686
|
+
});
|
|
14687
|
+
// Open item menu event.
|
|
14688
|
+
this._tieredMenuEventService.openItemMenuEvent
|
|
14689
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14690
|
+
.subscribe(function (item) {
|
|
14691
|
+
item.isOpen = false;
|
|
14692
|
+
if (_this.tieredMenuService.currentItem) {
|
|
14693
|
+
if (_this.tieredMenuService.currentItem.parent === item) {
|
|
14694
|
+
return;
|
|
14695
|
+
}
|
|
14696
|
+
if (!_this.tieredMenuService.searchTheHierarchy(_this.tieredMenuService.currentItem.parent, item)) {
|
|
14697
|
+
var itemAux = _this.tieredMenuService.currentItem;
|
|
14698
|
+
while (itemAux.parent !== item.parent) {
|
|
14699
|
+
_this._tieredMenuEventService.emitCloseItemMenuEvent(itemAux);
|
|
14700
|
+
itemAux = itemAux.parent;
|
|
14701
|
+
}
|
|
14702
|
+
}
|
|
14703
|
+
}
|
|
14704
|
+
if (item.submenu) {
|
|
14705
|
+
if (!item.isOpen) {
|
|
14706
|
+
var _a = document
|
|
14707
|
+
.querySelector("#" + item.id)
|
|
14708
|
+
.getBoundingClientRect(), top_2 = _a.top, right = _a.right, left = _a.left, bottom = _a.bottom;
|
|
14709
|
+
var position = { top: top_2, right: right, left: left, bottom: bottom };
|
|
14710
|
+
if (_this.items.includes(item)) {
|
|
14711
|
+
_this._createMenu(item.submenu, position);
|
|
14712
|
+
_this.tieredMenuService.currentItems = item.submenu;
|
|
14713
|
+
_this.tieredMenuService.currentItem = item.submenu[0];
|
|
14714
|
+
}
|
|
14715
|
+
}
|
|
14716
|
+
}
|
|
14717
|
+
});
|
|
14718
|
+
// Close item menu event.
|
|
14719
|
+
this._tieredMenuEventService.closeItemMenuEvent
|
|
14720
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14721
|
+
.subscribe(function (item) {
|
|
14722
|
+
var _a, _b;
|
|
14723
|
+
if (_this.items.includes(item)) {
|
|
14724
|
+
item.isOpen = false;
|
|
14725
|
+
_this.tieredMenuService.currentItems = ((_b = (_a = item === null || item === void 0 ? void 0 : item.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.submenu) || _this.tieredMenuService.items;
|
|
14726
|
+
_this.tieredMenuService.currentItem = item.parent;
|
|
14727
|
+
_this.destroyRequest.emit(false);
|
|
14728
|
+
}
|
|
14729
|
+
});
|
|
14730
|
+
};
|
|
14731
|
+
var TieredMenuComponent_1;
|
|
14732
|
+
TieredMenuComponent.ctorParameters = function () { return [
|
|
14733
|
+
{ type: core.ApplicationRef },
|
|
14734
|
+
{ type: core.ComponentFactoryResolver },
|
|
14735
|
+
{ type: core.Injector },
|
|
14736
|
+
{ type: TieredMenuService },
|
|
14737
|
+
{ type: TieredMenuEventService }
|
|
14738
|
+
]; };
|
|
14739
|
+
__decorate([
|
|
14740
|
+
core.Output()
|
|
14741
|
+
], TieredMenuComponent.prototype, "destroyRequest", void 0);
|
|
14742
|
+
TieredMenuComponent = TieredMenuComponent_1 = __decorate([
|
|
14743
|
+
core.Component({
|
|
14744
|
+
selector: "s-tiered-menu",
|
|
14745
|
+
template: "<div class=\"menu\" [ngStyle]=\"{\n 'left': left + 'px',\n 'top': top + 'px'\n }\">\n\n <div *ngFor=\"let item of items\">\n <s-tiered-menu-item\n *ngIf=\"!item.divider\"\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n triggerEvent=\"hover\"\n [closeOnClick]=\"false\">\n </s-tiered-menu-item>\n <s-tiered-menu-divider *ngIf=\"item.divider\"></s-tiered-menu-divider>\n </div>\n</div>",
|
|
14746
|
+
styles: [".menu{background-color:#fff;border:1px solid #ccc;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;min-width:176px;padding:4px 0;position:fixed;z-index:9999}"]
|
|
14747
|
+
})
|
|
14748
|
+
], TieredMenuComponent);
|
|
14749
|
+
return TieredMenuComponent;
|
|
14750
|
+
}());
|
|
14751
|
+
|
|
14752
|
+
var TieredMenuDirective = /** @class */ (function () {
|
|
14753
|
+
function TieredMenuDirective(_elementRef, _appRef, _componentFactoryResolver, _injector, _tieredMenuEventService, _tieredMenuService) {
|
|
14754
|
+
this._elementRef = _elementRef;
|
|
14755
|
+
this._appRef = _appRef;
|
|
14756
|
+
this._componentFactoryResolver = _componentFactoryResolver;
|
|
14757
|
+
this._injector = _injector;
|
|
14758
|
+
this._tieredMenuEventService = _tieredMenuEventService;
|
|
14759
|
+
this._tieredMenuService = _tieredMenuService;
|
|
14760
|
+
this._componentRef = null;
|
|
14761
|
+
this._isNested = false;
|
|
14762
|
+
this._isOpen = false;
|
|
14763
|
+
this._unsubscribe$ = new rxjs.Subject();
|
|
14764
|
+
this.alwaysOpen = false;
|
|
14765
|
+
this.triggerEvent = "click";
|
|
14766
|
+
}
|
|
14767
|
+
TieredMenuDirective.prototype.ngOnInit = function () {
|
|
14768
|
+
this._tieredMenuService.items = this._tieredMenuService.normalizeData(this.items);
|
|
14769
|
+
this._tieredMenuService.currentItems = this._tieredMenuService.items;
|
|
14770
|
+
this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
|
|
14771
|
+
this._subscribeEvents();
|
|
14772
|
+
};
|
|
14773
|
+
TieredMenuDirective.prototype.ngAfterViewInit = function () {
|
|
14774
|
+
var _this = this;
|
|
14775
|
+
// setTimeout to create the menu after creating the elements.
|
|
14776
|
+
if (this.alwaysOpen) {
|
|
14777
|
+
setTimeout(function () {
|
|
14778
|
+
_this._createMenu();
|
|
14779
|
+
}, 0);
|
|
14780
|
+
}
|
|
14781
|
+
};
|
|
14782
|
+
TieredMenuDirective.prototype.ngOnDestroy = function () {
|
|
14783
|
+
this._unsubscribe$.next();
|
|
14784
|
+
this._unsubscribe$.complete();
|
|
14785
|
+
this._destroy();
|
|
14786
|
+
};
|
|
14787
|
+
TieredMenuDirective.prototype.onResize = function () {
|
|
14788
|
+
if (!this.alwaysOpen) {
|
|
14789
|
+
this._tieredMenuEventService.emitCloseAllMenusEvent();
|
|
14790
|
+
}
|
|
14791
|
+
};
|
|
14792
|
+
TieredMenuDirective.prototype.onKeydownHandler = function (event) {
|
|
14793
|
+
if (!this._isOpen)
|
|
14794
|
+
return;
|
|
14795
|
+
switch (event.key) {
|
|
14796
|
+
case "Escape":
|
|
14797
|
+
this._tieredMenuEventService.emitCloseAllMenusEvent();
|
|
14798
|
+
break;
|
|
14799
|
+
case " ":
|
|
14800
|
+
case "Enter":
|
|
14801
|
+
this._tieredMenuEventService.emitSelectItemEvent(this._tieredMenuService.currentItem);
|
|
14802
|
+
break;
|
|
14803
|
+
case "ArrowLeft":
|
|
14804
|
+
// When nested I need a reference to the current item's parent item, otherwise just the current item.
|
|
14805
|
+
this._tieredMenuEventService.emitCloseItemMenuEvent(this._isNested ? this._tieredMenuService.currentItem.parent : this._tieredMenuService.currentItem);
|
|
14806
|
+
break;
|
|
14807
|
+
case "ArrowRight":
|
|
14808
|
+
this._tieredMenuEventService.emitOpenItemMenuEvent(this._tieredMenuService.currentItem);
|
|
14809
|
+
break;
|
|
14810
|
+
case "ArrowUp":
|
|
14811
|
+
this._tieredMenuEventService.emitDecrementCurrentItemEvent();
|
|
14812
|
+
break;
|
|
14813
|
+
case "ArrowDown":
|
|
14814
|
+
this._tieredMenuEventService.emitIncrementCurrentItemEvent();
|
|
14815
|
+
break;
|
|
14816
|
+
}
|
|
14817
|
+
};
|
|
14818
|
+
TieredMenuDirective.prototype.onClick = function (event) {
|
|
14819
|
+
if (this.triggerEvent === "click" && this.items && this.items && !this._isOpen) {
|
|
14820
|
+
this._lastActiveElement = document.activeElement;
|
|
14821
|
+
this._createMenu();
|
|
14822
|
+
event.preventDefault();
|
|
14823
|
+
event.stopPropagation();
|
|
14824
|
+
}
|
|
14825
|
+
};
|
|
14826
|
+
TieredMenuDirective.prototype.onDocumentClick = function (event) {
|
|
14827
|
+
// Closing menu when clicked outside.
|
|
14828
|
+
var target = event.target;
|
|
14829
|
+
var clickedInside = target.closest("s-tiered-menu-item") || target.closest("s-tiered-menu-divider");
|
|
14830
|
+
if (!clickedInside) {
|
|
14831
|
+
this._tieredMenuEventService.emitCloseAllMenusEvent();
|
|
14832
|
+
}
|
|
14833
|
+
};
|
|
14834
|
+
TieredMenuDirective.prototype._createMenu = function () {
|
|
14835
|
+
var _a;
|
|
14836
|
+
if (!this._componentRef && this.items) {
|
|
14837
|
+
(_a = this._lastActiveElement) === null || _a === void 0 ? void 0 : _a.blur();
|
|
14838
|
+
this._isOpen = true;
|
|
14839
|
+
this._isNested = document.body.clientWidth < 600;
|
|
14840
|
+
this._isNested ? this._createNestedMenu() : this._createTieredMenu();
|
|
14841
|
+
}
|
|
14842
|
+
};
|
|
14843
|
+
TieredMenuDirective.prototype._createTieredMenu = function () {
|
|
14844
|
+
var _this = this;
|
|
14845
|
+
if (!this._componentRef && this.items) {
|
|
14846
|
+
var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent);
|
|
14847
|
+
this._componentRef = componentFactory.create(this._injector);
|
|
14848
|
+
this._appRef.attachView(this._componentRef.hostView);
|
|
14849
|
+
var domElem = this._componentRef.hostView.rootNodes[0];
|
|
14850
|
+
document.body.appendChild(domElem);
|
|
14851
|
+
this._setMenuComponentProperties();
|
|
14852
|
+
this._componentRef.instance.destroyRequest
|
|
14853
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14854
|
+
.subscribe(function () {
|
|
14855
|
+
_this._destroy();
|
|
14856
|
+
});
|
|
14857
|
+
this._menuDivElement = domElem.querySelector(".menu");
|
|
14858
|
+
this._setMenuPosition();
|
|
14859
|
+
}
|
|
14860
|
+
};
|
|
14861
|
+
TieredMenuDirective.prototype._createNestedMenu = function () {
|
|
14862
|
+
if (!this._componentRef && this.items) {
|
|
14863
|
+
var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuNestedComponent);
|
|
14864
|
+
this._componentRef = componentFactory.create(this._injector);
|
|
14865
|
+
this._appRef.attachView(this._componentRef.hostView);
|
|
14866
|
+
var domElem = this._componentRef.hostView.rootNodes[0];
|
|
14867
|
+
document.body.appendChild(domElem);
|
|
14868
|
+
this._setMenuComponentProperties();
|
|
14869
|
+
this._menuDivElement = domElem.querySelector(".menu");
|
|
14870
|
+
this._setMenuPosition();
|
|
14871
|
+
}
|
|
14872
|
+
};
|
|
14873
|
+
TieredMenuDirective.prototype._destroy = function () {
|
|
14874
|
+
var _a;
|
|
14875
|
+
if (this._componentRef !== null && !this.alwaysOpen) {
|
|
14876
|
+
this._isOpen = false;
|
|
14877
|
+
window.clearTimeout(this._showTimeout);
|
|
14878
|
+
this._appRef.detachView(this._componentRef.hostView);
|
|
14879
|
+
this._componentRef.destroy();
|
|
14880
|
+
this._componentRef = null;
|
|
14881
|
+
this._menuDivElement = null;
|
|
14882
|
+
(_a = this._lastActiveElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
14883
|
+
this._tieredMenuService.currentItems = this._tieredMenuService.items;
|
|
14884
|
+
this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
|
|
14885
|
+
}
|
|
14886
|
+
};
|
|
14887
|
+
TieredMenuDirective.prototype._setMenuPosition = function () {
|
|
14888
|
+
if (this._componentRef !== null) {
|
|
14889
|
+
var _a = this._elementRef.nativeElement.getBoundingClientRect(), right = _a.right, bottom = _a.bottom, left = _a.left;
|
|
14890
|
+
var menuWidth = this._menuDivElement.getBoundingClientRect().width;
|
|
14891
|
+
var rightFreeSpace = document.body.clientWidth - right;
|
|
14892
|
+
var topPosition = bottom + 2;
|
|
14893
|
+
this._componentRef.instance.top = topPosition;
|
|
14894
|
+
if (!this._isNested) {
|
|
14895
|
+
if (rightFreeSpace > menuWidth) {
|
|
14896
|
+
this._componentRef.instance.left = left;
|
|
14897
|
+
}
|
|
14898
|
+
else {
|
|
14899
|
+
this._componentRef.instance.left = left - menuWidth;
|
|
14900
|
+
}
|
|
14901
|
+
}
|
|
14902
|
+
else {
|
|
14903
|
+
// setting the maximum menu size to ensure its content is always visible. 10px margin.
|
|
14904
|
+
this._componentRef.instance.maxHeight = window.innerHeight - topPosition - 10;
|
|
14905
|
+
}
|
|
14906
|
+
}
|
|
14907
|
+
};
|
|
14908
|
+
TieredMenuDirective.prototype._setMenuComponentProperties = function () {
|
|
14909
|
+
if (this._componentRef != null) {
|
|
14910
|
+
this._componentRef.instance.items = this.items;
|
|
14911
|
+
}
|
|
14912
|
+
};
|
|
14913
|
+
TieredMenuDirective.prototype._subscribeEvents = function () {
|
|
14914
|
+
var _this = this;
|
|
14915
|
+
this._tieredMenuEventService.closeAllMenusEvent
|
|
14916
|
+
.pipe(operators.takeUntil(this._unsubscribe$))
|
|
14917
|
+
.subscribe(function () {
|
|
14918
|
+
_this.items = _this._tieredMenuService.markAllItemsAsClosed(_this.items);
|
|
14919
|
+
_this._destroy();
|
|
14920
|
+
});
|
|
14921
|
+
};
|
|
14922
|
+
TieredMenuDirective.ctorParameters = function () { return [
|
|
14923
|
+
{ type: core.ElementRef },
|
|
14924
|
+
{ type: core.ApplicationRef },
|
|
14925
|
+
{ type: core.ComponentFactoryResolver },
|
|
14926
|
+
{ type: core.Injector },
|
|
14927
|
+
{ type: TieredMenuEventService },
|
|
14928
|
+
{ type: TieredMenuService }
|
|
14929
|
+
]; };
|
|
14930
|
+
__decorate([
|
|
14931
|
+
core.Input()
|
|
14932
|
+
], TieredMenuDirective.prototype, "items", void 0);
|
|
14933
|
+
__decorate([
|
|
14934
|
+
core.Input()
|
|
14935
|
+
], TieredMenuDirective.prototype, "alwaysOpen", void 0);
|
|
14936
|
+
__decorate([
|
|
14937
|
+
core.Input()
|
|
14938
|
+
], TieredMenuDirective.prototype, "triggerEvent", void 0);
|
|
14939
|
+
__decorate([
|
|
14940
|
+
core.HostListener("window:resize")
|
|
14941
|
+
], TieredMenuDirective.prototype, "onResize", null);
|
|
14942
|
+
__decorate([
|
|
14943
|
+
core.HostListener("document:keydown", ["$event"])
|
|
14944
|
+
], TieredMenuDirective.prototype, "onKeydownHandler", null);
|
|
14945
|
+
__decorate([
|
|
14946
|
+
core.HostListener("click", ["$event"])
|
|
14947
|
+
], TieredMenuDirective.prototype, "onClick", null);
|
|
14948
|
+
__decorate([
|
|
14949
|
+
core.HostListener("document:click", ["$event"])
|
|
14950
|
+
], TieredMenuDirective.prototype, "onDocumentClick", null);
|
|
14951
|
+
TieredMenuDirective = __decorate([
|
|
14952
|
+
core.Directive({
|
|
14953
|
+
selector: "[sTieredMenu]",
|
|
14954
|
+
})
|
|
14955
|
+
], TieredMenuDirective);
|
|
14956
|
+
return TieredMenuDirective;
|
|
14957
|
+
}());
|
|
14958
|
+
|
|
14959
|
+
var TieredMenuItemComponent = /** @class */ (function () {
|
|
14960
|
+
function TieredMenuItemComponent(_tieredMenuEventService) {
|
|
14961
|
+
this._tieredMenuEventService = _tieredMenuEventService;
|
|
14962
|
+
this.focused = false;
|
|
14963
|
+
this.triggerEvent = "click";
|
|
14964
|
+
this.closeOnClick = false;
|
|
14965
|
+
}
|
|
14966
|
+
TieredMenuItemComponent.prototype.onClick = function () {
|
|
14967
|
+
if (this.item.submenu) {
|
|
14968
|
+
if (!this.item.isOpen) {
|
|
14969
|
+
this._tieredMenuEventService.emitOpenItemMenuEvent(this.item);
|
|
14970
|
+
}
|
|
14971
|
+
else if (this.closeOnClick) {
|
|
14972
|
+
this._tieredMenuEventService.emitCloseItemMenuEvent(this.item);
|
|
14973
|
+
}
|
|
14974
|
+
}
|
|
14975
|
+
else {
|
|
14976
|
+
this._tieredMenuEventService.emitSelectItemEvent(this.item);
|
|
14977
|
+
}
|
|
14978
|
+
};
|
|
14979
|
+
TieredMenuItemComponent.prototype.onMouseEnter = function () {
|
|
14980
|
+
var _this = this;
|
|
14981
|
+
if (this.triggerEvent === "hover" && !this.item.isOpen) {
|
|
14982
|
+
this._showTimeout = window.setTimeout(function () {
|
|
14983
|
+
_this._tieredMenuEventService.emitOpenItemMenuEvent(_this.item);
|
|
14984
|
+
}, 300);
|
|
14985
|
+
}
|
|
14986
|
+
};
|
|
14987
|
+
TieredMenuItemComponent.prototype.onMouseLeave = function () {
|
|
14988
|
+
window.clearTimeout(this._showTimeout);
|
|
14989
|
+
};
|
|
14990
|
+
TieredMenuItemComponent.ctorParameters = function () { return [
|
|
14991
|
+
{ type: TieredMenuEventService }
|
|
14992
|
+
]; };
|
|
14993
|
+
__decorate([
|
|
14994
|
+
core.Input()
|
|
14995
|
+
], TieredMenuItemComponent.prototype, "item", void 0);
|
|
14996
|
+
__decorate([
|
|
14997
|
+
core.Input()
|
|
14998
|
+
], TieredMenuItemComponent.prototype, "focused", void 0);
|
|
14999
|
+
__decorate([
|
|
15000
|
+
core.Input()
|
|
15001
|
+
], TieredMenuItemComponent.prototype, "triggerEvent", void 0);
|
|
15002
|
+
__decorate([
|
|
15003
|
+
core.Input()
|
|
15004
|
+
], TieredMenuItemComponent.prototype, "closeOnClick", void 0);
|
|
15005
|
+
__decorate([
|
|
15006
|
+
core.HostListener("click"),
|
|
15007
|
+
core.HostListener("touchend")
|
|
15008
|
+
], TieredMenuItemComponent.prototype, "onClick", null);
|
|
15009
|
+
__decorate([
|
|
15010
|
+
core.HostListener("mouseenter")
|
|
15011
|
+
], TieredMenuItemComponent.prototype, "onMouseEnter", null);
|
|
15012
|
+
__decorate([
|
|
15013
|
+
core.HostListener("mouseleave")
|
|
15014
|
+
], TieredMenuItemComponent.prototype, "onMouseLeave", null);
|
|
15015
|
+
TieredMenuItemComponent = __decorate([
|
|
15016
|
+
core.Component({
|
|
15017
|
+
selector: "s-tiered-menu-item",
|
|
15018
|
+
template: "<div\n [id]=\"item.id\"\n class=\"tiered-menu-item\"\n [ngClass]=\"{\n 'tiered-menu-item--open': item.isOpen,\n 'tiered-menu-item--focused': focused\n }\">\n <div class=\"tiered-menu-item-content\">\n <span class=\"icon\" [ngClass]=\"item.iconClass\"></span>\n <span class=\"label\">{{ item.label }}</span>\n </div>\n <span\n *ngIf=\"item.submenu\"\n class=\"submenu-icon\"\n [ngClass]=\"{\n 'fas': true,\n 'fa-chevron-left': item.isOpen,\n 'fa-chevron-right': !item.isOpen\n }\">\n </span>\n</div>",
|
|
15019
|
+
styles: [".tiered-menu-item{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:8px 16px;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.tiered-menu-item .tiered-menu-item-content .label{margin:0 12px}.tiered-menu-item:hover{background-color:#e9e6e6}.tiered-menu-item--focused{background-color:#ccc!important}.tiered-menu-item--open{background-color:#e4e2e2}"]
|
|
15020
|
+
})
|
|
15021
|
+
], TieredMenuItemComponent);
|
|
15022
|
+
return TieredMenuItemComponent;
|
|
15023
|
+
}());
|
|
15024
|
+
|
|
15025
|
+
var TieredMenuDividerComponent = /** @class */ (function () {
|
|
15026
|
+
function TieredMenuDividerComponent() {
|
|
15027
|
+
}
|
|
15028
|
+
TieredMenuDividerComponent = __decorate([
|
|
15029
|
+
core.Component({
|
|
15030
|
+
selector: "s-tiered-menu-divider",
|
|
15031
|
+
template: "<div class=\"divider\"></div>",
|
|
15032
|
+
styles: [".divider{margin:2px 0;height:1px;background-color:#ccc}"]
|
|
15033
|
+
})
|
|
15034
|
+
], TieredMenuDividerComponent);
|
|
15035
|
+
return TieredMenuDividerComponent;
|
|
15036
|
+
}());
|
|
15037
|
+
|
|
15038
|
+
var TieredMenuModule = /** @class */ (function () {
|
|
15039
|
+
function TieredMenuModule() {
|
|
15040
|
+
}
|
|
15041
|
+
TieredMenuModule = __decorate([
|
|
15042
|
+
core.NgModule({
|
|
15043
|
+
imports: [
|
|
15044
|
+
common.CommonModule,
|
|
15045
|
+
platformBrowser.BrowserModule,
|
|
15046
|
+
],
|
|
15047
|
+
declarations: [
|
|
15048
|
+
TieredMenuDirective,
|
|
15049
|
+
TieredMenuComponent,
|
|
15050
|
+
TieredMenuNestedComponent,
|
|
15051
|
+
TieredMenuItemComponent,
|
|
15052
|
+
TieredMenuDividerComponent,
|
|
15053
|
+
],
|
|
15054
|
+
exports: [TieredMenuDirective],
|
|
15055
|
+
providers: [
|
|
15056
|
+
TieredMenuEventService,
|
|
15057
|
+
TieredMenuService,
|
|
15058
|
+
],
|
|
15059
|
+
})
|
|
15060
|
+
], TieredMenuModule);
|
|
15061
|
+
return TieredMenuModule;
|
|
15062
|
+
}());
|
|
15063
|
+
|
|
14313
15064
|
var WorkspaceSwitchComponent = /** @class */ (function () {
|
|
14314
15065
|
function WorkspaceSwitchComponent(eRef) {
|
|
14315
15066
|
this.eRef = eRef;
|
|
@@ -15085,6 +15836,8 @@
|
|
|
15085
15836
|
exports.TextField = TextField;
|
|
15086
15837
|
exports.ThumbnailComponent = ThumbnailComponent;
|
|
15087
15838
|
exports.ThumbnailModule = ThumbnailModule;
|
|
15839
|
+
exports.TieredMenuDirective = TieredMenuDirective;
|
|
15840
|
+
exports.TieredMenuModule = TieredMenuModule;
|
|
15088
15841
|
exports.TileComponent = TileComponent;
|
|
15089
15842
|
exports.TileModule = TileModule;
|
|
15090
15843
|
exports.TimelineComponent = TimelineComponent;
|
|
@@ -15131,6 +15884,12 @@
|
|
|
15131
15884
|
exports.ɵcd = CodeEditorComponent;
|
|
15132
15885
|
exports.ɵce = CoreFacade;
|
|
15133
15886
|
exports.ɵcf = CodeMirror6Core;
|
|
15887
|
+
exports.ɵcg = TieredMenuEventService;
|
|
15888
|
+
exports.ɵch = TieredMenuService;
|
|
15889
|
+
exports.ɵci = TieredMenuComponent;
|
|
15890
|
+
exports.ɵcj = TieredMenuNestedComponent;
|
|
15891
|
+
exports.ɵck = TieredMenuItemComponent;
|
|
15892
|
+
exports.ɵcl = TieredMenuDividerComponent;
|
|
15134
15893
|
exports.ɵd = LocalizedCurrencyImpurePipe;
|
|
15135
15894
|
exports.ɵe = LocalizedBignumberPipe;
|
|
15136
15895
|
exports.ɵf = LocalizedBignumberImpurePipe;
|