@seniorsistemas/angular-components 16.12.0 → 16.12.2
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 +58 -82
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/dynamic-form/configurations/fields/boolean-switch-field.d.ts +3 -0
- package/components/table/frozen-position/frozen-position.directive.d.ts +2 -6
- package/esm2015/components/dynamic-form/components/fields/boolean/boolean-switch-field.component.js +2 -2
- package/esm2015/components/dynamic-form/configurations/fields/boolean-switch-field.js +5 -1
- package/esm2015/components/table/frozen-position/frozen-position.directive.js +26 -44
- package/esm5/components/dynamic-form/components/fields/boolean/boolean-switch-field.component.js +2 -2
- package/esm5/components/dynamic-form/configurations/fields/boolean-switch-field.js +5 -1
- package/esm5/components/table/frozen-position/frozen-position.directive.js +55 -82
- package/fesm2015/seniorsistemas-angular-components.js +29 -44
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +58 -82
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -2632,6 +2632,9 @@ class BooleanSwitchField extends Field {
|
|
|
2632
2632
|
constructor(config) {
|
|
2633
2633
|
super(config);
|
|
2634
2634
|
this.onChange = config.onChange;
|
|
2635
|
+
if (config.optionsLabel) {
|
|
2636
|
+
this.optionsLabel = new BooleanOptionsLabel(config.optionsLabel);
|
|
2637
|
+
}
|
|
2635
2638
|
this.representedBy = "switch";
|
|
2636
2639
|
}
|
|
2637
2640
|
}
|
|
@@ -5163,20 +5166,7 @@ let TableFrozenPositionDirective = class TableFrozenPositionDirective {
|
|
|
5163
5166
|
this.table.styleClass = (this.table.styleClass || "") + " s-table-frozen-position";
|
|
5164
5167
|
this.setUpTableEvents();
|
|
5165
5168
|
window.addEventListener("resize", this.handleWindowResize.bind(this));
|
|
5166
|
-
const componentId = new Date().getTime();
|
|
5167
5169
|
const htmlHead = document.getElementsByTagName("head")[0];
|
|
5168
|
-
this.resetRowHeightClassName = `resetTableRowsHeight_${componentId}`;
|
|
5169
|
-
const styleReset = document.createElement("style");
|
|
5170
|
-
styleReset.innerHTML = `.${this.resetRowHeightClassName} tbody > tr, .${this.resetRowHeightClassName} thead > tr { height: auto; }`;
|
|
5171
|
-
htmlHead.appendChild(styleReset);
|
|
5172
|
-
this.fixBodyRowClassName = `fixTableBodyRowsHeight_${componentId}`;
|
|
5173
|
-
this.styleFixBodyRowHeight = document.createElement("style");
|
|
5174
|
-
this.styleFixBodyRowHeight.innerHTML = `.${this.fixBodyRowClassName} tbody > tr { height: auto; }`;
|
|
5175
|
-
htmlHead.appendChild(this.styleFixBodyRowHeight);
|
|
5176
|
-
this.fixHeadRowClassName = `fixTableHeadRowsHeight_${componentId}`;
|
|
5177
|
-
this.styleFixHeadRowHeight = document.createElement("style");
|
|
5178
|
-
this.styleFixHeadRowHeight.innerHTML = `.${this.fixHeadRowClassName} thead > tr { height: auto; }`;
|
|
5179
|
-
htmlHead.appendChild(this.styleFixHeadRowHeight);
|
|
5180
5170
|
const expandFrozenStyle = document.createElement("style");
|
|
5181
5171
|
expandFrozenStyle.innerHTML = ".s-table-frozen-position .ui-table-frozen-view .sds-expanded-row > td { visibility: hidden; }";
|
|
5182
5172
|
htmlHead.appendChild(expandFrozenStyle);
|
|
@@ -5298,44 +5288,39 @@ let TableFrozenPositionDirective = class TableFrozenPositionDirective {
|
|
|
5298
5288
|
synchronizeRowHeight() {
|
|
5299
5289
|
const tableBodyWrappers = this.el.nativeElement.getElementsByClassName("ui-table-scrollable-body");
|
|
5300
5290
|
const tableBodies = [...tableBodyWrappers].map(divWrapper => [...divWrapper.childNodes].find(p => p.tagName === "TABLE"));
|
|
5301
|
-
this.
|
|
5302
|
-
this.
|
|
5291
|
+
this._resetRowHeight(tableBodies);
|
|
5292
|
+
this._applyMaxRowHeight(tableBodies);
|
|
5303
5293
|
const tableHeadWrappers = this.el.nativeElement.getElementsByClassName("ui-table-scrollable-header-box");
|
|
5304
5294
|
const tableHeads = [...tableHeadWrappers].map(divWrapper => [...divWrapper.childNodes].find(p => p.tagName === "TABLE"));
|
|
5305
|
-
this.
|
|
5306
|
-
this.
|
|
5295
|
+
this._resetRowHeight(tableHeads);
|
|
5296
|
+
this._applyMaxRowHeight(tableHeads);
|
|
5307
5297
|
}
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
table.classList.remove(this.fixHeadRowClassName);
|
|
5312
|
-
table.classList.add(this.resetRowHeightClassName);
|
|
5298
|
+
_applyMaxRowHeight(tables) {
|
|
5299
|
+
if (!tables || !tables.length) {
|
|
5300
|
+
return;
|
|
5313
5301
|
}
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
const
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
if (tr.classList.contains("sds-expanded-row"))
|
|
5320
|
-
continue;
|
|
5321
|
-
rowSizes.push(tr.getBoundingClientRect().height);
|
|
5322
|
-
}
|
|
5302
|
+
const lengths = tables.map(table => table.rows.length);
|
|
5303
|
+
const maxLength = lengths.reduce((accumulator, currentValue) => Math.max(accumulator, currentValue), lengths[0]);
|
|
5304
|
+
const minLength = lengths.reduce((accumulator, currentValue) => Math.min(accumulator, currentValue), lengths[0]);
|
|
5305
|
+
if (maxLength !== minLength) {
|
|
5306
|
+
throw new Error("The number of rows in both tables must be the same");
|
|
5323
5307
|
}
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
if (isHead) {
|
|
5328
|
-
this.styleFixHeadRowHeight.innerHTML = `.${this.fixHeadRowClassName} thead > tr { height: ${maxHeight}px; }`;
|
|
5308
|
+
const table = tables[0];
|
|
5309
|
+
for (let i = 0; i < table.rows.length; i++) {
|
|
5310
|
+
const trs = [];
|
|
5329
5311
|
for (const table of tables) {
|
|
5330
|
-
|
|
5331
|
-
|
|
5312
|
+
trs.push(table.rows[i]);
|
|
5313
|
+
}
|
|
5314
|
+
const max = trs.reduce((accumulator, currentValue) => Math.max(accumulator, currentValue.getBoundingClientRect().height), trs[0].getBoundingClientRect().height);
|
|
5315
|
+
for (const tr of trs) {
|
|
5316
|
+
tr.style.height = `${max}px`;
|
|
5332
5317
|
}
|
|
5333
5318
|
}
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5319
|
+
}
|
|
5320
|
+
_resetRowHeight(tables) {
|
|
5321
|
+
for (const table of tables) {
|
|
5322
|
+
for (const row of table.rows) {
|
|
5323
|
+
row.style.height = "unset";
|
|
5339
5324
|
}
|
|
5340
5325
|
}
|
|
5341
5326
|
}
|
|
@@ -6448,7 +6433,7 @@ __decorate([
|
|
|
6448
6433
|
], BooleanSwitchFieldComponent.prototype, "formControl", void 0);
|
|
6449
6434
|
BooleanSwitchFieldComponent = __decorate([
|
|
6450
6435
|
Component({
|
|
6451
|
-
template: "<div class=\"ui-
|
|
6436
|
+
template: "<div class=\"ui-grid ui-grid-responsive ui-grid-pad ui-fluid\">\n <div class=\"ui-grid-row\">\n <div class=\"i-grid-col-1\">\n <p-inputSwitch [id]=\"(field.id || field.name)\" [name]=\"field.name\" [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\" tooltipPosition=\"top\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\">\n </p-inputSwitch>\n </div>\n <div class=\"i-grid-col-1\" *ngIf=\"field.optionsLabel\">\n <ng-container *ngIf=\"formControl.value; else caseFalse\">\n <span>{{ field.optionsLabel.true }}</span>\n </ng-container>\n <ng-template #caseFalse>\n <span>{{ field.optionsLabel.false }}</span>\n </ng-template>\n </div>\n </div>\n</div>"
|
|
6452
6437
|
})
|
|
6453
6438
|
], BooleanSwitchFieldComponent);
|
|
6454
6439
|
|