@seniorsistemas/angular-components 17.3.12 → 17.3.14
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 +54 -35
- 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/components/lookup/lookup.component.d.ts +3 -2
- package/esm2015/components/dynamic-form/components/lookup/lookup.component.js +46 -30
- package/esm2015/components/table/table-column/table-columns.component.js +9 -7
- package/esm5/components/dynamic-form/components/lookup/lookup.component.js +47 -30
- package/esm5/components/table/table-column/table-columns.component.js +9 -7
- package/fesm2015/seniorsistemas-angular-components.js +53 -35
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +54 -35
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -5158,27 +5158,7 @@ var LookupComponent = /** @class */ (function () {
|
|
|
5158
5158
|
return result;
|
|
5159
5159
|
}, {});
|
|
5160
5160
|
this.formGroupDialog = new FormGroup(formGroup);
|
|
5161
|
-
this.
|
|
5162
|
-
this.onSelect.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function () { return _this.onChange(_this.value); });
|
|
5163
|
-
this.onUnselect.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function () { return _this.onChange(_this.value); });
|
|
5164
|
-
this.onClear.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function () {
|
|
5165
|
-
if (_this.multiple || _this.value) {
|
|
5166
|
-
return;
|
|
5167
|
-
}
|
|
5168
|
-
_this.onChange(null);
|
|
5169
|
-
});
|
|
5170
|
-
this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function () {
|
|
5171
|
-
_this.onTouched();
|
|
5172
|
-
});
|
|
5173
|
-
this.onBlur.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
5174
|
-
var currentValue = _this.value && _this.value[_this.lookupDisplayField];
|
|
5175
|
-
var value = event.target.value;
|
|
5176
|
-
if (_this.multiple || !currentValue || currentValue == value)
|
|
5177
|
-
return;
|
|
5178
|
-
var newValue = "";
|
|
5179
|
-
event.target.value = newValue;
|
|
5180
|
-
_this.onChange(newValue);
|
|
5181
|
-
});
|
|
5161
|
+
this._subscribeEvents();
|
|
5182
5162
|
};
|
|
5183
5163
|
LookupComponent.prototype.printRecordTotalizer = function () {
|
|
5184
5164
|
if (this.searchTotalRecordsLabel) {
|
|
@@ -5330,15 +5310,15 @@ var LookupComponent = /** @class */ (function () {
|
|
|
5330
5310
|
else
|
|
5331
5311
|
this.selected = [selected];
|
|
5332
5312
|
};
|
|
5333
|
-
LookupComponent.prototype.registerOnChange = function (
|
|
5313
|
+
LookupComponent.prototype.registerOnChange = function (onChange) {
|
|
5334
5314
|
var _this = this;
|
|
5335
|
-
this.onChange = function (
|
|
5336
|
-
_this.writeValue(
|
|
5337
|
-
|
|
5315
|
+
this.onChange = function (value) {
|
|
5316
|
+
_this.writeValue(value);
|
|
5317
|
+
onChange(value);
|
|
5338
5318
|
};
|
|
5339
5319
|
};
|
|
5340
|
-
LookupComponent.prototype.registerOnTouched = function (
|
|
5341
|
-
this.onTouched =
|
|
5320
|
+
LookupComponent.prototype.registerOnTouched = function (onTouched) {
|
|
5321
|
+
this.onTouched = onTouched;
|
|
5342
5322
|
};
|
|
5343
5323
|
LookupComponent.prototype.writeValue = function (value) {
|
|
5344
5324
|
this.value = value;
|
|
@@ -5446,7 +5426,7 @@ var LookupComponent = /** @class */ (function () {
|
|
|
5446
5426
|
scale: this.getScale(col.scale),
|
|
5447
5427
|
decimalSeparator: (_a = col.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator,
|
|
5448
5428
|
thousandsSeparator: (_b = col.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator,
|
|
5449
|
-
prefix: (_c = col.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol
|
|
5429
|
+
prefix: (_c = col.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol,
|
|
5450
5430
|
};
|
|
5451
5431
|
};
|
|
5452
5432
|
LookupComponent.prototype.onTableRowDoubleClick = function (rowData) {
|
|
@@ -5456,12 +5436,49 @@ var LookupComponent = /** @class */ (function () {
|
|
|
5456
5436
|
LookupComponent.prototype._setFocusFilter = function () {
|
|
5457
5437
|
var _a, _b, _c;
|
|
5458
5438
|
if (this.dialogVisible && !this.collapsed) {
|
|
5459
|
-
var input = (_c = (_b = (_a = this.dialog) === null || _a === void 0 ? void 0 : _a.contentViewChild) === null || _b === void 0 ? void 0 : _b.nativeElement) === null || _c === void 0 ? void 0 : _c.getElementsByTagName(
|
|
5439
|
+
var input = (_c = (_b = (_a = this.dialog) === null || _a === void 0 ? void 0 : _a.contentViewChild) === null || _b === void 0 ? void 0 : _b.nativeElement) === null || _c === void 0 ? void 0 : _c.getElementsByTagName("input")[0];
|
|
5460
5440
|
if (input) {
|
|
5461
5441
|
input.focus();
|
|
5462
5442
|
}
|
|
5463
5443
|
}
|
|
5464
5444
|
};
|
|
5445
|
+
LookupComponent.prototype._subscribeEvents = function () {
|
|
5446
|
+
var _this = this;
|
|
5447
|
+
this.onSearchRequest
|
|
5448
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
5449
|
+
.subscribe(function () { return (_this.loading = true); });
|
|
5450
|
+
this.onSelect
|
|
5451
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
5452
|
+
.subscribe(function () { return _this.onChange(_this.value); });
|
|
5453
|
+
this.onUnselect
|
|
5454
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
5455
|
+
.subscribe(function () { return _this.onChange(_this.value); });
|
|
5456
|
+
this.onClear
|
|
5457
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
5458
|
+
.subscribe(function () {
|
|
5459
|
+
if (_this.multiple) {
|
|
5460
|
+
return;
|
|
5461
|
+
}
|
|
5462
|
+
_this.onChange(null);
|
|
5463
|
+
});
|
|
5464
|
+
this.onFocus
|
|
5465
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
5466
|
+
.subscribe(function () {
|
|
5467
|
+
_this.onTouched();
|
|
5468
|
+
});
|
|
5469
|
+
this.onBlur
|
|
5470
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
5471
|
+
.subscribe(function (event) {
|
|
5472
|
+
var target = event.target;
|
|
5473
|
+
var currentValue = _this.value && _this.value[_this.lookupDisplayField];
|
|
5474
|
+
var value = target.value;
|
|
5475
|
+
if (_this.multiple || !currentValue || currentValue == value)
|
|
5476
|
+
return;
|
|
5477
|
+
var newValue = "";
|
|
5478
|
+
target.value = newValue;
|
|
5479
|
+
_this.onChange(newValue);
|
|
5480
|
+
});
|
|
5481
|
+
};
|
|
5465
5482
|
var LookupComponent_1;
|
|
5466
5483
|
LookupComponent.nextId = 0;
|
|
5467
5484
|
LookupComponent.ctorParameters = function () { return [
|
|
@@ -7616,22 +7633,24 @@ var TableColumnsComponent = /** @class */ (function () {
|
|
|
7616
7633
|
};
|
|
7617
7634
|
TableColumnsComponent.prototype.validateComponentAttributes = function (changes) {
|
|
7618
7635
|
var _a, _b, _c;
|
|
7619
|
-
if (!((_a = changes.columns) === null || _a === void 0 ? void 0 : _a.currentValue)) {
|
|
7636
|
+
if (!this.columns && !((_a = changes.columns) === null || _a === void 0 ? void 0 : _a.currentValue)) {
|
|
7620
7637
|
throw new Error("The 'columns' attribute must be informed!");
|
|
7621
7638
|
}
|
|
7622
|
-
if (!((_b = changes.rowValue) === null || _b === void 0 ? void 0 : _b.currentValue)) {
|
|
7639
|
+
if (!this.rowValue && !((_b = changes.rowValue) === null || _b === void 0 ? void 0 : _b.currentValue)) {
|
|
7623
7640
|
throw new Error("The 'rowValue' attribute must be informed!");
|
|
7624
7641
|
}
|
|
7625
|
-
if (!((_c = changes.locale) === null || _c === void 0 ? void 0 : _c.currentValue)) {
|
|
7642
|
+
if (!this.locale && !((_c = changes.locale) === null || _c === void 0 ? void 0 : _c.currentValue)) {
|
|
7626
7643
|
throw new Error("The 'locale' attribute must be informed!");
|
|
7627
7644
|
}
|
|
7628
7645
|
};
|
|
7629
7646
|
TableColumnsComponent.prototype.createColumnsTemplate = function (changes) {
|
|
7630
7647
|
var _this = this;
|
|
7648
|
+
var _a, _b, _c;
|
|
7631
7649
|
this.viewContainerRef.clear();
|
|
7632
|
-
var columns = changes.columns.currentValue;
|
|
7633
|
-
var rowValue = changes.rowValue.currentValue;
|
|
7634
|
-
var locale = changes.locale.currentValue;
|
|
7650
|
+
var columns = ((_a = changes.columns) === null || _a === void 0 ? void 0 : _a.currentValue) || this.columns;
|
|
7651
|
+
var rowValue = ((_b = changes.rowValue) === null || _b === void 0 ? void 0 : _b.currentValue) || this.rowValue;
|
|
7652
|
+
var locale = ((_c = changes.locale) === null || _c === void 0 ? void 0 : _c.currentValue) || this.locale;
|
|
7653
|
+
this.formattedColumns = [];
|
|
7635
7654
|
columns.forEach(function (column) { return _this.formattedColumns.push(_this.getColumnValue(column, rowValue, locale)); });
|
|
7636
7655
|
this.viewContainerRef.createEmbeddedView(this.columnsTemplate);
|
|
7637
7656
|
};
|