@seniorsistemas/angular-components 14.14.0 → 14.14.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 +61 -7
- 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/dynamic-form/components/lookup/lookup.component.d.ts +2 -0
- package/components/locale/options/index.d.ts +9 -0
- package/esm2015/components/dynamic-form/components/lookup/lookup.component.js +49 -3
- package/esm2015/components/dynamic-form/configurations/fields/bignumber-field.js +3 -3
- package/esm2015/components/dynamic-form/configurations/fields/calendar-field.js +3 -3
- package/esm2015/components/dynamic-form/configurations/fields/currency-field.js +3 -3
- package/esm2015/components/dynamic-form/configurations/fields/decimal-field.js +3 -3
- package/esm2015/components/dynamic-form/configurations/fields/number-field.js +3 -3
- package/esm2015/components/locale/options/index.js +10 -1
- package/esm5/components/dynamic-form/components/lookup/lookup.component.js +49 -3
- package/esm5/components/dynamic-form/configurations/fields/bignumber-field.js +3 -3
- package/esm5/components/dynamic-form/configurations/fields/calendar-field.js +3 -3
- package/esm5/components/dynamic-form/configurations/fields/currency-field.js +3 -3
- package/esm5/components/dynamic-form/configurations/fields/decimal-field.js +3 -3
- package/esm5/components/dynamic-form/configurations/fields/number-field.js +3 -3
- package/esm5/components/locale/options/index.js +10 -1
- package/fesm2015/seniorsistemas-angular-components.js +61 -7
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +61 -7
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -1068,8 +1068,17 @@ class LocaleOptions {
|
|
|
1068
1068
|
Object.keys(config).forEach(key => (this[key] = config[key] || this[key]));
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
|
+
/**
|
|
1072
|
+
* @deprecated
|
|
1073
|
+
*/
|
|
1071
1074
|
const DEFAULT_CALENDAR_LOCALE_OPTIONS = new CalendarLocaleOptions();
|
|
1075
|
+
/**
|
|
1076
|
+
* @deprecated
|
|
1077
|
+
*/
|
|
1072
1078
|
const DEFAULT_NUMBER_LOCALE_OPTIONS = new NumberLocaleOptions();
|
|
1079
|
+
/**
|
|
1080
|
+
* @deprecated
|
|
1081
|
+
*/
|
|
1073
1082
|
const DEFAULT_LOCALE_OPTIONS = new LocaleOptions();
|
|
1074
1083
|
|
|
1075
1084
|
const moment = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
@@ -1362,7 +1371,7 @@ class BignumberField extends Field {
|
|
|
1362
1371
|
constructor(config) {
|
|
1363
1372
|
var _a;
|
|
1364
1373
|
super(config);
|
|
1365
|
-
this.numberLocaleOptions = config.numberLocaleOptions ||
|
|
1374
|
+
this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
|
|
1366
1375
|
this.browserAutocomplete = config.browserAutocomplete;
|
|
1367
1376
|
this.precision = config.precision;
|
|
1368
1377
|
this.scale = (_a = config.scale) !== null && _a !== void 0 ? _a : 2;
|
|
@@ -1420,7 +1429,7 @@ class CalendarField extends Field {
|
|
|
1420
1429
|
this.maxDate = config.maxDate;
|
|
1421
1430
|
this.appendTo = config.appendTo;
|
|
1422
1431
|
this.showOnFocus = typeof config.showOnFocus === "boolean" ? config.showOnFocus : true;
|
|
1423
|
-
this.calendarLocaleOptions = config.calendarLocaleOptions ||
|
|
1432
|
+
this.calendarLocaleOptions = config.calendarLocaleOptions || new CalendarLocaleOptions();
|
|
1424
1433
|
this.onBlur = config.onBlur;
|
|
1425
1434
|
this.onFocus = config.onFocus;
|
|
1426
1435
|
this.onSelect = config.onSelect;
|
|
@@ -1586,7 +1595,7 @@ NumberInputModule = __decorate([
|
|
|
1586
1595
|
class NumberField extends Field {
|
|
1587
1596
|
constructor(config) {
|
|
1588
1597
|
super(config);
|
|
1589
|
-
this.numberLocaleOptions = config.numberLocaleOptions ||
|
|
1598
|
+
this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
|
|
1590
1599
|
this.browserAutocomplete = config.browserAutocomplete;
|
|
1591
1600
|
this.precision = config.precision;
|
|
1592
1601
|
this.alignTo = config.alignTo || NumberAlignmentOption.LEFT;
|
|
@@ -1606,7 +1615,7 @@ class NumberField extends Field {
|
|
|
1606
1615
|
class DecimalField extends NumberField {
|
|
1607
1616
|
constructor(config) {
|
|
1608
1617
|
super(config);
|
|
1609
|
-
this.numberLocaleOptions = config.numberLocaleOptions ||
|
|
1618
|
+
this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
|
|
1610
1619
|
this.alignTo = config.alignTo || NumberAlignmentOption.RIGHT;
|
|
1611
1620
|
this.scale = config.scale || config.scale === 0 ? config.scale : 2;
|
|
1612
1621
|
}
|
|
@@ -1618,7 +1627,7 @@ class DecimalField extends NumberField {
|
|
|
1618
1627
|
class CurrencyField extends DecimalField {
|
|
1619
1628
|
constructor(config) {
|
|
1620
1629
|
super(config);
|
|
1621
|
-
this.numberLocaleOptions = config.numberLocaleOptions ||
|
|
1630
|
+
this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
|
|
1622
1631
|
}
|
|
1623
1632
|
}
|
|
1624
1633
|
|
|
@@ -1804,9 +1813,24 @@ let LookupComponent = LookupComponent_1 = class LookupComponent {
|
|
|
1804
1813
|
this.originalFormValues = {};
|
|
1805
1814
|
}
|
|
1806
1815
|
ngOnInit() {
|
|
1816
|
+
if (!this.searchGridFields) {
|
|
1817
|
+
this.searchGridFields = this.searchFields.map(item => new FormField(Object.assign({}, item)));
|
|
1818
|
+
}
|
|
1807
1819
|
this.searchFields = this.searchFields.map((value) => new FormField(Object.assign(Object.assign({}, value), { size: { sm: 12, md: 12, lg: 12, xl: 12 } })));
|
|
1808
|
-
this.searchGridFields =
|
|
1820
|
+
this.searchGridFields = this.searchGridFields.map((gridField) => {
|
|
1809
1821
|
gridField["width"] = this.getColWidth(gridField.label);
|
|
1822
|
+
const calendarOptions = gridField.calendarLocaleOptions;
|
|
1823
|
+
if (calendarOptions === null || calendarOptions === void 0 ? void 0 : calendarOptions.dateFormat) {
|
|
1824
|
+
switch (gridField.type) {
|
|
1825
|
+
case FieldType.Date:
|
|
1826
|
+
calendarOptions.dateFormat = this._convertToMomentDateFormat(calendarOptions.dateFormat);
|
|
1827
|
+
break;
|
|
1828
|
+
case FieldType.Time:
|
|
1829
|
+
calendarOptions.dateFormat = this._convertToMomentHourFormat(calendarOptions.hourFormat, calendarOptions.dateFormat);
|
|
1830
|
+
break;
|
|
1831
|
+
}
|
|
1832
|
+
calendarOptions.dateFormat = calendarOptions.dateFormat;
|
|
1833
|
+
}
|
|
1810
1834
|
return gridField;
|
|
1811
1835
|
});
|
|
1812
1836
|
const formGroup = this.searchFields.reduce((result, field) => {
|
|
@@ -1832,6 +1856,36 @@ let LookupComponent = LookupComponent_1 = class LookupComponent {
|
|
|
1832
1856
|
this.onChange(newValue);
|
|
1833
1857
|
});
|
|
1834
1858
|
}
|
|
1859
|
+
_convertToMomentHourFormat(hourFormat, format) {
|
|
1860
|
+
if (format === "dd/mm/yy") { // valor padrão para o format.
|
|
1861
|
+
return "LTS";
|
|
1862
|
+
}
|
|
1863
|
+
if (hourFormat === "12") {
|
|
1864
|
+
return format
|
|
1865
|
+
.replace(/\bH\b/, "h") // hour (12 hour time) (no leading zero)
|
|
1866
|
+
.replace(/\bHH\b/, "hh"); // hour (12 hour time)
|
|
1867
|
+
}
|
|
1868
|
+
if (hourFormat === "24") {
|
|
1869
|
+
return format
|
|
1870
|
+
.replace(/\bh\b/, "H") // hour (24 hour time) (no leading zero)
|
|
1871
|
+
.replace(/\bhh\b/, "HH"); // hour (24 hour time)
|
|
1872
|
+
}
|
|
1873
|
+
return format;
|
|
1874
|
+
}
|
|
1875
|
+
_convertToMomentDateFormat(format) {
|
|
1876
|
+
// A ordem dos replaces é importante.
|
|
1877
|
+
return format
|
|
1878
|
+
.replace(/\bd\b/, "D") // day of month (no leading zero)
|
|
1879
|
+
.replace(/\bdd\b/, "DD") // day of month
|
|
1880
|
+
.replace(/\bo\b/, "DDD") // day of the year (no leading zero)
|
|
1881
|
+
.replace(/\boo\b/, "DDDD") // day of the year
|
|
1882
|
+
.replace(/\bM\b/, "MMM") // month name short
|
|
1883
|
+
.replace(/\bMM\b/, "MMMM") // month name long
|
|
1884
|
+
.replace(/\bm\b/, "M") // month of year (no leading)
|
|
1885
|
+
.replace(/\bmm\b/, "MM") // month of year
|
|
1886
|
+
.replace(/\by\b/, "YY") // year (two digits)
|
|
1887
|
+
.replace(/\byy\b/, "YYYY"); // year (four digits)
|
|
1888
|
+
}
|
|
1835
1889
|
ngAfterViewInit() {
|
|
1836
1890
|
this.autocomplete.onOverlayAnimationDone = (event) => { };
|
|
1837
1891
|
}
|
|
@@ -2148,7 +2202,7 @@ __decorate([
|
|
|
2148
2202
|
LookupComponent = LookupComponent_1 = __decorate([
|
|
2149
2203
|
Component({
|
|
2150
2204
|
selector: "s-lookup",
|
|
2151
|
-
template: "<div [ngClass]=\"{ inputgroup: showSearch }\">\n <p-autoComplete\n #autocomplete\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [dataKey]=\"dataKey\"\n [multiple]=\"multiple\"\n [inputId]=\"id + '-autocomplete'\"\n [forceSelection]=\"true\"\n [suggestions]=\"getLookupSuggestions()\"\n (completeMethod)=\"lazyLoadLookup($event)\"\n (onSelect)=\"onSelect.next($event)\"\n (onBlur)=\"onBlur.next($event)\"\n (onFocus)=\"onFocus.next($event)\"\n (onUnselect)=\"onUnselect.next($event)\"\n (onClear)=\"onClear.next($event)\"\n (onKeyUp)=\"onKeyUp.next($event)\"\n [field]=\"lookupDisplayField\"\n [emptyMessage]=\"lookupEmptyMessage\"\n [dropdown]=\"!showSearch\"\n [appendTo]=\"lookupAppendTo\"\n [placeholder]=\"placeholder || ' '\"\n [autoHighlight]=\"true\"\n inputStyleClass=\"mousetrap\"\n >\n <ng-template let-item pTemplate=\"selectedItem\">\n <span class=\"ui-autocomplete-token-label ng-tns-c65-43 ng-star-inserted\" \n [pTooltip]=\"lookupDisplayFieldTooltip ? item[lookupDisplayField] : null\" \n tooltipPosition=\"top\">\n {{item[lookupDisplayField]}}\n </span>\n </ng-template>\n </p-autoComplete>\n\n <button\n *ngIf=\"showSearch\"\n pButton\n type=\"button\"\n icon=\"fa fa-search\"\n class=\"button-addon\"\n [disabled]=\"disabled\"\n (click)=\"showDialog()\"\n ></button>\n</div>\n\n<p-dialog\n appendTo=\"body\"\n styleClass=\"s-lookup-modal\"\n [header]=\"searchTitle\"\n [(visible)]=\"dialogVisible\"\n [modal]=\"true\"\n (onHide)=\"hideDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n #dialog\n>\n <div *ngIf=\"dialogVisible\" class=\"s-lookup-modal-container\">\n <div *ngIf=\"searchFields && searchFields.length\" class=\"filter\"\n [@collapseContent]=\"collapsed ? {value: 'hidden', params: {transitionParams: transitionOptions }} : {value: 'visible', params: {transitionParams: transitionOptions}}\"\n (@collapseContent.done)=\"onToggleDone()\">\n <form [formGroup]=\"formGroupDialog\" novalidate autocomplete=\"off\">\n <div *ngIf=\"!collapsed\"\n [@childCollapseContent]=\"collapsed ? {value: ':leave', params: {transitionParams: transitionOptions }} : {value: ':enter', params: {transitionParams: transitionOptions}}\"\n class=\"form-content\">\n <div class=\"filter-title sds-section-title\">{{ filterTitle }}</div>\n <div class=\"form-fields\">\n <s-dynamic-form [fields]=\"searchFields\" [form]=\"formGroupDialog\"></s-dynamic-form>\n </div>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n [id]=\"id + '-filter-button'\"\n type=\"submit\"\n [label]=\"filterLabel\"\n (onClick)=\"search()\"\n pTooltip=\"(ALT + SHIFT + F)\"\n showDelay=\"500\"\n ></s-button>\n <s-button\n [id]=\"id + '-clear-button'\"\n type=\"button\"\n [label]=\"clearLabel\"\n (onClick)=\"clear()\"\n priority=\"link\"\n pTooltip=\"(ALT + SHIFT + L)\"\n showDelay=\"500\"\n ></s-button>\n </div>\n </div>\n </div>\n </form> \n </div>\n <div *ngIf=\"searchFields && searchFields.length\" class=\"filter-toggle\">\n <div class=\"filter-toggle--start-border-mask\"></div>\n <button [id]=\"id + '-filter-toggle-button'\" type=\"button\" (click)=\"filterToggle()\">\n <span class=\"fa\" [ngClass]=\"{'fa-chevron-left': !collapsed, 'fa-chevron-right': collapsed}\"\n aria-hidden=\"true\"></span>\n </button>\n <div class=\"filter-toggle--end-border-mask\"></div>\n </div>\n <div class=\"content\" [ngClass]=\"{'empty-content': !searchTotalRecords && !loading}\">\n <s-empty-state\n [id]=\"id + '-empty-state'\"\n *ngIf=\"!searchTotalRecords && !loading\"\n [title]=\"searchEmptyTitle\"\n [description]=\"searchEmptyDescription\"\n iconClass=\"fa fa-search\"\n ></s-empty-state>\n\n <p-table\n [dataKey]=\"dataKey\"\n [value]=\"getGridData()\"\n [columns]=\"searchGridFields\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n sortMode=\"multiple\"\n [totalRecords]=\"searchTotalRecords\"\n [rows]=\"10\"\n [selection]=\"selected\"\n (onLazyLoad)=\"lazyLoadGrid($event)\"\n *sLoadingState=\"loading\"\n [multiSortMeta]=\"multiSortMeta\"\n [attr.data-hidden]=\"!searchTotalRecords && !loading\"\n [selectionMode]=\"multiple ? 'multiple' : 'single'\"\n (selectionChange)=\"onSelectionChange($event)\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngIf=\"multiple\" style=\"width: 50px\" />\n <col *ngFor=\"let col of columns\" [style.width]=\"col.width\" />\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngIf=\"multiple\" style=\"width: 50px\">\n <s-table-header-checkbox [useAllObject]=\"lookupRowProps ? false : true\" [rowProps]=\"lookupRowProps\"></s-table-header-checkbox>\n </th>\n <th\n [style.width]=\"col.width\"\n *ngFor=\"let col of columns\"\n [pSortableColumn]=\"col.name\"\n [pSortableColumnDisabled]=\"sortableColumnsDisabled?.includes(col.name)\"\n >\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label }}</span>\n <p-sortIcon [field]=\"col.name\" *ngIf=\"!sortableColumnsDisabled?.includes(col.name)\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-columns let-rowIndex=\"rowIndex\">\n <tr\n sNavigation\n [pSelectableRow]=\"rowData\"\n [pSelectableRowIndex]=\"rowIndex\"\n sDoubleClick (onDoubleClick)=\"onTableRowDoubleClick(rowData)\"\n >\n <td *ngIf=\"multiple\" style=\"width: 50px\" tabindex=\"0\">\n <p-tableCheckbox [value]=\"rowData\" [pSelectableRow]=\"rowData\"></p-tableCheckbox>\n </td>\n <td\n [style.width]=\"col['width']\"\n *ngFor=\"let col of searchGridFields\"\n [ngSwitch]=\"col.type\"\n tabindex=\"0\"\n >\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <ng-container *ngIf=\"isBooleanValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getBooleanLabel(rowData, col.name, col.optionsLabel) }}</span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Date'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate: col.calendarLocaleOptions?.dateFormat || \"L\" | async }}</span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Time'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedTime: col.calendarLocaleOptions?.dateFormat || \"LTS\" | async }}</span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Double'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedNumber: getScale(col.scale) | async }} </span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Money'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedCurrency | async }} </span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Number'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getNumberMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Enum'\">\n <ng-container\n *ngIf=\"getLabelForValue(getFieldValue(rowData, col.name), col.options); else emptyTemplate\"\n >\n <span> {{ getLabelForValue(getFieldValue(rowData, col.name), col.options) }} </span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"col.mask && col.mask()\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name))\">\n <span>{{ getFieldValue(rowData, col.name) | sMaskFormatter: col.mask() }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!(col.mask && col.mask())\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name)); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) }}</span>\n </ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [attr.data-hidden]=\"loading\">\n {{\n searchTotalRecordsLabel ||\n searchTotalRecords?.toString() + (searchTotalRecords === 1 ? recordLabel : recordsLabel)\n }}\n </span>\n </ng-template>\n </p-table>\n </div>\n </div>\n\n <p-footer>\n <s-button\n [id]=\"id + '-select-button'\"\n type=\"button\"\n [label]=\"selectLabel\"\n (onClick)=\"select()\"\n pTooltip=\"(ALT + SHIFT + S)\"\n showDelay=\"500\"\n [disabled]=\"!selected?.length\"\n ></s-button>\n <s-button\n [id]=\"id + '-cancel-button'\"\n type=\"button\"\n priority=\"link\"\n [label]=\"cancelLabel\"\n (onClick)=\"hideDialog()\"\n pTooltip=\"(ALT + SHIFT + C)\"\n showDelay=\"500\"\n ></s-button>\n </p-footer>\n</p-dialog>\n\n<ng-template #emptyTemplate>\n <span [ngClass]=\"'sds-empty-value'\">{{ emptyFieldLabel }}</span>\n</ng-template>\n",
|
|
2205
|
+
template: "<div [ngClass]=\"{ inputgroup: showSearch }\">\n <p-autoComplete\n #autocomplete\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [dataKey]=\"dataKey\"\n [multiple]=\"multiple\"\n [inputId]=\"id + '-autocomplete'\"\n [forceSelection]=\"true\"\n [suggestions]=\"getLookupSuggestions()\"\n (completeMethod)=\"lazyLoadLookup($event)\"\n (onSelect)=\"onSelect.next($event)\"\n (onBlur)=\"onBlur.next($event)\"\n (onFocus)=\"onFocus.next($event)\"\n (onUnselect)=\"onUnselect.next($event)\"\n (onClear)=\"onClear.next($event)\"\n (onKeyUp)=\"onKeyUp.next($event)\"\n [field]=\"lookupDisplayField\"\n [emptyMessage]=\"lookupEmptyMessage\"\n [dropdown]=\"!showSearch\"\n [appendTo]=\"lookupAppendTo\"\n [placeholder]=\"placeholder || ' '\"\n [autoHighlight]=\"true\"\n inputStyleClass=\"mousetrap\"\n >\n <ng-template let-item pTemplate=\"selectedItem\">\n <span class=\"ui-autocomplete-token-label ng-tns-c65-43 ng-star-inserted\" \n [pTooltip]=\"lookupDisplayFieldTooltip ? item[lookupDisplayField] : null\" \n tooltipPosition=\"top\">\n {{item[lookupDisplayField]}}\n </span>\n </ng-template>\n </p-autoComplete>\n\n <button\n *ngIf=\"showSearch\"\n pButton\n type=\"button\"\n icon=\"fa fa-search\"\n class=\"button-addon\"\n [disabled]=\"disabled\"\n (click)=\"showDialog()\"\n ></button>\n</div>\n\n<p-dialog\n appendTo=\"body\"\n styleClass=\"s-lookup-modal\"\n [header]=\"searchTitle\"\n [(visible)]=\"dialogVisible\"\n [modal]=\"true\"\n (onHide)=\"hideDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n #dialog\n>\n <div *ngIf=\"dialogVisible\" class=\"s-lookup-modal-container\">\n <div *ngIf=\"searchFields && searchFields.length\" class=\"filter\"\n [@collapseContent]=\"collapsed \n ? { value: 'hidden', params: { transitionParams: transitionOptions } }\n : { value: 'visible', params: { transitionParams: transitionOptions } }\"\n (@collapseContent.done)=\"onToggleDone()\">\n <form [formGroup]=\"formGroupDialog\" novalidate autocomplete=\"off\">\n <div *ngIf=\"!collapsed\"\n [@childCollapseContent]=\"collapsed\n ? { value: ':leave', params: { transitionParams: transitionOptions } }\n : { value: ':enter', params: { transitionParams: transitionOptions } }\"\n class=\"form-content\">\n <div class=\"filter-title sds-section-title\">{{ filterTitle }}</div>\n <div class=\"form-fields\">\n <s-dynamic-form [fields]=\"searchFields\" [form]=\"formGroupDialog\"></s-dynamic-form>\n </div>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n [id]=\"id + '-filter-button'\"\n type=\"submit\"\n [label]=\"filterLabel\"\n (onClick)=\"search()\"\n pTooltip=\"(ALT + SHIFT + F)\"\n showDelay=\"500\"\n ></s-button>\n <s-button\n [id]=\"id + '-clear-button'\"\n type=\"button\"\n [label]=\"clearLabel\"\n (onClick)=\"clear()\"\n priority=\"link\"\n pTooltip=\"(ALT + SHIFT + L)\"\n showDelay=\"500\"\n ></s-button>\n </div>\n </div>\n </div>\n </form> \n </div>\n <div *ngIf=\"searchFields && searchFields.length\" class=\"filter-toggle\">\n <div class=\"filter-toggle--start-border-mask\"></div>\n <button [id]=\"id + '-filter-toggle-button'\" type=\"button\" (click)=\"filterToggle()\">\n <span class=\"fa\" [ngClass]=\"{'fa-chevron-left': !collapsed, 'fa-chevron-right': collapsed}\"\n aria-hidden=\"true\"></span>\n </button>\n <div class=\"filter-toggle--end-border-mask\"></div>\n </div>\n <div class=\"content\" [ngClass]=\"{'empty-content': !searchTotalRecords && !loading}\">\n <s-empty-state\n [id]=\"id + '-empty-state'\"\n *ngIf=\"!searchTotalRecords && !loading\"\n [title]=\"searchEmptyTitle\"\n [description]=\"searchEmptyDescription\"\n iconClass=\"fa fa-search\"\n ></s-empty-state>\n\n <p-table\n [dataKey]=\"dataKey\"\n [value]=\"getGridData()\"\n [columns]=\"searchGridFields\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n sortMode=\"multiple\"\n [totalRecords]=\"searchTotalRecords\"\n [rows]=\"10\"\n [selection]=\"selected\"\n (onLazyLoad)=\"lazyLoadGrid($event)\"\n *sLoadingState=\"loading\"\n [multiSortMeta]=\"multiSortMeta\"\n [attr.data-hidden]=\"!searchTotalRecords && !loading\"\n [selectionMode]=\"multiple ? 'multiple' : 'single'\"\n (selectionChange)=\"onSelectionChange($event)\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngIf=\"multiple\" style=\"width: 50px\" />\n <col *ngFor=\"let col of columns\" [style.width]=\"col.width\" />\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngIf=\"multiple\" style=\"width: 50px\">\n <s-table-header-checkbox [useAllObject]=\"lookupRowProps ? false : true\" [rowProps]=\"lookupRowProps\"></s-table-header-checkbox>\n </th>\n <th\n [style.width]=\"col.width\"\n *ngFor=\"let col of columns\"\n [pSortableColumn]=\"col.name\"\n [pSortableColumnDisabled]=\"sortableColumnsDisabled?.includes(col.name)\"\n >\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label }}</span>\n <p-sortIcon [field]=\"col.name\" *ngIf=\"!sortableColumnsDisabled?.includes(col.name)\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-columns let-rowIndex=\"rowIndex\">\n <tr\n sNavigation\n [pSelectableRow]=\"rowData\"\n [pSelectableRowIndex]=\"rowIndex\"\n sDoubleClick (onDoubleClick)=\"onTableRowDoubleClick(rowData)\"\n >\n <td *ngIf=\"multiple\" style=\"width: 50px\" tabindex=\"0\">\n <p-tableCheckbox [value]=\"rowData\" [pSelectableRow]=\"rowData\"></p-tableCheckbox>\n </td>\n <td\n [style.width]=\"col['width']\"\n *ngFor=\"let col of searchGridFields\"\n [ngSwitch]=\"col.type\"\n tabindex=\"0\"\n >\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <ng-container *ngIf=\"isBooleanValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getBooleanLabel(rowData, col.name, col.optionsLabel) }}</span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Date'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate: col.calendarLocaleOptions?.dateFormat || \"L\" | async }}</span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Time'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedTime: col.calendarLocaleOptions?.dateFormat || \"LTS\" | async }}</span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Double'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedNumber: getScale(col.scale) | async }} </span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Money'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedCurrency | async }} </span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Number'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getNumberMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Enum'\">\n <ng-container\n *ngIf=\"getLabelForValue(getFieldValue(rowData, col.name), col.options); else emptyTemplate\"\n >\n <span> {{ getLabelForValue(getFieldValue(rowData, col.name), col.options) }} </span>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"col.mask && col.mask()\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name))\">\n <span>{{ getFieldValue(rowData, col.name) | sMaskFormatter: col.mask() }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!(col.mask && col.mask())\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name)); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) }}</span>\n </ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [attr.data-hidden]=\"loading\">\n {{\n searchTotalRecordsLabel ||\n searchTotalRecords?.toString() + (searchTotalRecords === 1 ? recordLabel : recordsLabel)\n }}\n </span>\n </ng-template>\n </p-table>\n </div>\n </div>\n\n <p-footer>\n <s-button\n [id]=\"id + '-select-button'\"\n type=\"button\"\n [label]=\"selectLabel\"\n (onClick)=\"select()\"\n pTooltip=\"(ALT + SHIFT + S)\"\n showDelay=\"500\"\n [disabled]=\"!selected?.length\"\n ></s-button>\n <s-button\n [id]=\"id + '-cancel-button'\"\n type=\"button\"\n priority=\"link\"\n [label]=\"cancelLabel\"\n (onClick)=\"hideDialog()\"\n pTooltip=\"(ALT + SHIFT + C)\"\n showDelay=\"500\"\n ></s-button>\n </p-footer>\n</p-dialog>\n\n<ng-template #emptyTemplate>\n <span [ngClass]=\"'sds-empty-value'\">{{ emptyFieldLabel }}</span>\n</ng-template>\n",
|
|
2152
2206
|
providers: [
|
|
2153
2207
|
{
|
|
2154
2208
|
provide: NG_VALUE_ACCESSOR,
|