@sd-angular/core 1.1.78 → 1.1.81
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/autocomplete/sd-angular-core-autocomplete.metadata.json +1 -1
- package/bundles/sd-angular-core-autocomplete.umd.js +1 -1
- package/bundles/sd-angular-core-autocomplete.umd.js.map +1 -1
- package/bundles/sd-angular-core-autocomplete.umd.min.js +1 -1
- package/bundles/sd-angular-core-autocomplete.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.js +119 -112
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +2 -2
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-input-number.umd.js +28 -25
- package/bundles/sd-angular-core-input-number.umd.js.map +1 -1
- package/bundles/sd-angular-core-input-number.umd.min.js +1 -1
- package/bundles/sd-angular-core-input-number.umd.min.js.map +1 -1
- package/esm2015/autocomplete/src/lib/autocomplete.component.js +2 -2
- package/esm2015/grid-material/sd-angular-core-grid-material.js +31 -31
- package/esm2015/grid-material/src/lib/components/desktop-cell/desktop-cell.component.js +2 -2
- package/esm2015/grid-material/src/lib/grid-material.component.js +15 -6
- package/esm2015/grid-material/src/lib/grid-material.module.js +2 -1
- package/esm2015/grid-material/src/lib/models/grid.model.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/editor-handler-column.pipe.js +5 -7
- package/esm2015/input-number/src/lib/input-number.component.js +29 -26
- package/fesm2015/sd-angular-core-autocomplete.js +1 -1
- package/fesm2015/sd-angular-core-autocomplete.js.map +1 -1
- package/fesm2015/sd-angular-core-grid-material.js +68 -61
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/fesm2015/sd-angular-core-input-number.js +28 -25
- package/fesm2015/sd-angular-core-input-number.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.d.ts +30 -30
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/grid-material/src/lib/grid-material.component.d.ts +4 -1
- package/grid-material/src/lib/models/grid.model.d.ts +1 -0
- package/grid-material/src/lib/pipes/editor-handler-column.pipe.d.ts +1 -2
- package/input-number/sd-angular-core-input-number.metadata.json +1 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.1.78.tgz → sd-angular-core-1.1.81.tgz} +0 -0
|
@@ -1147,9 +1147,56 @@ SdColumnValuesPipe.decorators = [
|
|
|
1147
1147
|
},] }
|
|
1148
1148
|
];
|
|
1149
1149
|
|
|
1150
|
+
var _visible;
|
|
1151
|
+
class SdEditorHandlerColumnPipe {
|
|
1152
|
+
constructor() {
|
|
1153
|
+
_visible.set(this, (col, item) => {
|
|
1154
|
+
if (col.type === 'children' || col.type === 'children-col') {
|
|
1155
|
+
return false;
|
|
1156
|
+
}
|
|
1157
|
+
// Kiểm tra xem có bị disabled hay không?
|
|
1158
|
+
if (col.editor) {
|
|
1159
|
+
const isDisabled = typeof (col.editor.disabled) === 'function' ? col.editor.disabled(item) : col.editor.disabled;
|
|
1160
|
+
if (isDisabled) {
|
|
1161
|
+
return false;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
return true;
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
transform(value, item, gridOption) {
|
|
1168
|
+
const { sdId, editorHandlerColumn, expandDetail, isExpanded, isExpanding, isSelected, sdGroup, selectable, actions, groupedActions, originItem, editorErrorMessage, editorHandlerRow } = item, remain = __rest(item, ["sdId", "editorHandlerColumn", "expandDetail", "isExpanded", "isExpanding", "isSelected", "sdGroup", "selectable", "actions", "groupedActions", "originItem", "editorErrorMessage", "editorHandlerRow"]);
|
|
1169
|
+
const key = hash__default(remain);
|
|
1170
|
+
if (sdId === key && editorHandlerColumn) {
|
|
1171
|
+
return true;
|
|
1172
|
+
}
|
|
1173
|
+
item.editorHandlerColumn = item.editorHandlerColumn || {};
|
|
1174
|
+
const { columns } = gridOption;
|
|
1175
|
+
for (const col of columns) {
|
|
1176
|
+
if (col.type === 'children-col') {
|
|
1177
|
+
for (const childCol of col.children) {
|
|
1178
|
+
item.editorHandlerColumn[childCol.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[childCol.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, childCol, item) });
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
else {
|
|
1182
|
+
item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, col, item) });
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
item.sdId = key;
|
|
1186
|
+
return true;
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
_visible = new WeakMap();
|
|
1190
|
+
SdEditorHandlerColumnPipe.decorators = [
|
|
1191
|
+
{ type: Pipe, args: [{
|
|
1192
|
+
name: 'sdEditorHandlerColumn'
|
|
1193
|
+
},] },
|
|
1194
|
+
{ type: Injectable }
|
|
1195
|
+
];
|
|
1196
|
+
|
|
1150
1197
|
var _paginator, _sort, _subscription$1, _optionChanges, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _filterLocal, _getFilter, _load$1, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems;
|
|
1151
1198
|
class SdGridMaterial {
|
|
1152
|
-
constructor(ref, configuration, gridConfigurationService, exportService, notifyService, translateService, columnValuesPipe) {
|
|
1199
|
+
constructor(ref, configuration, gridConfigurationService, exportService, notifyService, translateService, columnValuesPipe, editorHandlerColumnPipe) {
|
|
1153
1200
|
this.ref = ref;
|
|
1154
1201
|
this.configuration = configuration;
|
|
1155
1202
|
this.gridConfigurationService = gridConfigurationService;
|
|
@@ -1157,6 +1204,7 @@ class SdGridMaterial {
|
|
|
1157
1204
|
this.notifyService = notifyService;
|
|
1158
1205
|
this.translateService = translateService;
|
|
1159
1206
|
this.columnValuesPipe = columnValuesPipe;
|
|
1207
|
+
this.editorHandlerColumnPipe = editorHandlerColumnPipe;
|
|
1160
1208
|
this.key = v4();
|
|
1161
1209
|
this.localItems = [];
|
|
1162
1210
|
this.items = [];
|
|
@@ -1728,7 +1776,9 @@ class SdGridMaterial {
|
|
|
1728
1776
|
_updateSelectedItems.set(this, () => {
|
|
1729
1777
|
this.selectedItems = this.items.filter(item => item.isSelected)
|
|
1730
1778
|
.map(item => {
|
|
1731
|
-
const { isSelected, isExpanded, isExpanding, expandDetail, editorErrorMessage, editorHandlerColumn, editorHandlerRow, editorStatus, originItem, sdId } = item,
|
|
1779
|
+
const { isSelected, isExpanded, isExpanding, expandDetail, editorErrorMessage, editorHandlerColumn, editorHandlerRow, editorStatus, originItem, sdId, sdVersion } = item,
|
|
1780
|
+
// Giữ lại các trường thông tin cho selectable (action, groupedAction, sdGroup, selectable)
|
|
1781
|
+
result = __rest(item, ["isSelected", "isExpanded", "isExpanding", "expandDetail", "editorErrorMessage", "editorHandlerColumn", "editorHandlerRow", "editorStatus", "originItem", "sdId", "sdVersion"]);
|
|
1732
1782
|
return result;
|
|
1733
1783
|
});
|
|
1734
1784
|
this.ref.detectChanges();
|
|
@@ -1917,6 +1967,10 @@ class SdGridMaterial {
|
|
|
1917
1967
|
this.items = [...this.items];
|
|
1918
1968
|
}
|
|
1919
1969
|
};
|
|
1970
|
+
this.refreshItem = (idx) => {
|
|
1971
|
+
const item = this.items[idx];
|
|
1972
|
+
this.editorHandlerColumnPipe.transform(item.sdVersion, item, this.gridOption);
|
|
1973
|
+
};
|
|
1920
1974
|
this.detectChanges = () => this.ref.detectChanges();
|
|
1921
1975
|
}
|
|
1922
1976
|
set _gridFilter(gridFilter) {
|
|
@@ -1983,13 +2037,13 @@ class SdGridMaterial {
|
|
|
1983
2037
|
}
|
|
1984
2038
|
return false;
|
|
1985
2039
|
}).map(item => {
|
|
1986
|
-
const { editorStatus, editorHandlerRow, editorHandlerColumn, editorErrorMessage, expandDetail, isExpanded, isExpanding, isSelected, originItem, sdId, selectable, actions, groupedActions, sdGroup } = item, result = __rest(item, ["editorStatus", "editorHandlerRow", "editorHandlerColumn", "editorErrorMessage", "expandDetail", "isExpanded", "isExpanding", "isSelected", "originItem", "sdId", "selectable", "actions", "groupedActions", "sdGroup"]);
|
|
2040
|
+
const { editorStatus, editorHandlerRow, editorHandlerColumn, editorErrorMessage, expandDetail, isExpanded, isExpanding, isSelected, originItem, sdId, sdVersion, selectable, actions, groupedActions, sdGroup } = item, result = __rest(item, ["editorStatus", "editorHandlerRow", "editorHandlerColumn", "editorErrorMessage", "expandDetail", "isExpanded", "isExpanding", "isSelected", "originItem", "sdId", "sdVersion", "selectable", "actions", "groupedActions", "sdGroup"]);
|
|
1987
2041
|
return Object.assign(Object.assign({}, result), { editorErrorMessage });
|
|
1988
2042
|
});
|
|
1989
2043
|
}
|
|
1990
2044
|
get gridItems() {
|
|
1991
2045
|
return this.items.map(item => {
|
|
1992
|
-
const { editorStatus, editorHandlerRow, editorHandlerColumn, expandDetail, isExpanded, isExpanding, isSelected, originItem, sdId, selectable, actions, groupedActions, sdGroup } = item, result = __rest(item, ["editorStatus", "editorHandlerRow", "editorHandlerColumn", "expandDetail", "isExpanded", "isExpanding", "isSelected", "originItem", "sdId", "selectable", "actions", "groupedActions", "sdGroup"]);
|
|
2046
|
+
const { editorStatus, editorHandlerRow, editorHandlerColumn, expandDetail, isExpanded, isExpanding, isSelected, originItem, sdId, sdVersion, selectable, actions, groupedActions, sdGroup } = item, result = __rest(item, ["editorStatus", "editorHandlerRow", "editorHandlerColumn", "expandDetail", "isExpanded", "isExpanding", "isSelected", "originItem", "sdId", "sdVersion", "selectable", "actions", "groupedActions", "sdGroup"]);
|
|
1993
2047
|
return result;
|
|
1994
2048
|
});
|
|
1995
2049
|
}
|
|
@@ -2019,7 +2073,8 @@ SdGridMaterial.ctorParameters = () => [
|
|
|
2019
2073
|
{ type: SdExportService },
|
|
2020
2074
|
{ type: SdNotifyService },
|
|
2021
2075
|
{ type: SdTranslateService },
|
|
2022
|
-
{ type: SdColumnValuesPipe }
|
|
2076
|
+
{ type: SdColumnValuesPipe },
|
|
2077
|
+
{ type: SdEditorHandlerColumnPipe }
|
|
2023
2078
|
];
|
|
2024
2079
|
SdGridMaterial.propDecorators = {
|
|
2025
2080
|
quickAction: [{ type: ViewChild, args: [SdQuickAction,] }],
|
|
@@ -2855,7 +2910,7 @@ class SdDesktopCell {
|
|
|
2855
2910
|
SdDesktopCell.decorators = [
|
|
2856
2911
|
{ type: Component, args: [{
|
|
2857
2912
|
selector: 'sd-desktop-cell',
|
|
2858
|
-
template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"item.editorHandlerRow?.visible;else useView\">\r\n <ng-container *sdLet=\"item[column.field] | sdEditorHandlerColumn:item:
|
|
2913
|
+
template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"item.editorHandlerRow?.visible;else useView\">\r\n <ng-container *sdLet=\"item[column.field] | sdEditorHandlerColumn:item:gridOption\">\r\n <ng-container *ngIf=\"item.editorHandlerColumn && item.editorHandlerColumn[column.field]?.visible;else useView\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: idx, isEdited: true }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-editor *ngIf=\"!cellDef[column.field]\" [sdId]=\"item.sdId\" [column]=\"column\" [item]=\"item\">\r\n </sd-desktop-cell-editor>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #useView>\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: idx }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-view *ngIf=\"!cellDef[column.field]\" [sdId]=\"item.sdId\" [key]=\"key\" [column]=\"column\" [gridOption]=\"gridOption\" [item]=\"item\">\r\n </sd-desktop-cell-view>\r\n </ng-template>\r\n</ng-container>",
|
|
2859
2914
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
2860
2915
|
},] }
|
|
2861
2916
|
];
|
|
@@ -2896,10 +2951,10 @@ SdDesktopCellEditor.propDecorators = {
|
|
|
2896
2951
|
item: [{ type: Input }]
|
|
2897
2952
|
};
|
|
2898
2953
|
|
|
2899
|
-
var _visible;
|
|
2954
|
+
var _visible$1;
|
|
2900
2955
|
class SdEditorHandlerRowPipe {
|
|
2901
2956
|
constructor() {
|
|
2902
|
-
_visible.set(this, (col, item) => {
|
|
2957
|
+
_visible$1.set(this, (col, item) => {
|
|
2903
2958
|
if (col.type === 'children' || col.type === 'children-col') {
|
|
2904
2959
|
return false;
|
|
2905
2960
|
}
|
|
@@ -2946,54 +3001,6 @@ class SdEditorHandlerRowPipe {
|
|
|
2946
3001
|
item.sdId = hash__default(remain);
|
|
2947
3002
|
item.editorHandlerColumn = item.editorHandlerColumn || {};
|
|
2948
3003
|
const { columns } = gridOption;
|
|
2949
|
-
for (const col of columns) {
|
|
2950
|
-
if (col.type === 'children-col') {
|
|
2951
|
-
for (const childCol of col.children) {
|
|
2952
|
-
item.editorHandlerColumn[childCol.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[childCol.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, childCol, item) });
|
|
2953
|
-
}
|
|
2954
|
-
}
|
|
2955
|
-
else {
|
|
2956
|
-
item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, col, item) });
|
|
2957
|
-
}
|
|
2958
|
-
}
|
|
2959
|
-
return item.editorHandlerRow;
|
|
2960
|
-
}
|
|
2961
|
-
}
|
|
2962
|
-
_visible = new WeakMap();
|
|
2963
|
-
SdEditorHandlerRowPipe.decorators = [
|
|
2964
|
-
{ type: Pipe, args: [{
|
|
2965
|
-
name: 'sdEditorHandlerRow'
|
|
2966
|
-
},] }
|
|
2967
|
-
];
|
|
2968
|
-
|
|
2969
|
-
var _visible$1;
|
|
2970
|
-
class SdEditorHandlerColumnPipe {
|
|
2971
|
-
constructor() {
|
|
2972
|
-
_visible$1.set(this, (col, item) => {
|
|
2973
|
-
if (col.type === 'children' || col.type === 'children-col') {
|
|
2974
|
-
return false;
|
|
2975
|
-
}
|
|
2976
|
-
// Kiểm tra xem có bị disabled hay không?
|
|
2977
|
-
if (col.editor) {
|
|
2978
|
-
const isDisabled = typeof (col.editor.disabled) === 'function' ? col.editor.disabled(item) : col.editor.disabled;
|
|
2979
|
-
if (isDisabled) {
|
|
2980
|
-
return false;
|
|
2981
|
-
}
|
|
2982
|
-
}
|
|
2983
|
-
return true;
|
|
2984
|
-
});
|
|
2985
|
-
}
|
|
2986
|
-
transform(value, item, column, gridOption) {
|
|
2987
|
-
if (column.type === 'children' || column.type === 'children-col') {
|
|
2988
|
-
return;
|
|
2989
|
-
}
|
|
2990
|
-
const { sdId, editorHandlerColumn, expandDetail, isExpanded, isExpanding, isSelected, sdGroup, selectable, actions, groupedActions, originItem, editorErrorMessage, editorHandlerRow } = item, remain = __rest(item, ["sdId", "editorHandlerColumn", "expandDetail", "isExpanded", "isExpanding", "isSelected", "sdGroup", "selectable", "actions", "groupedActions", "originItem", "editorErrorMessage", "editorHandlerRow"]);
|
|
2991
|
-
const key = hash__default(remain);
|
|
2992
|
-
if (sdId === key && editorHandlerColumn) {
|
|
2993
|
-
return true;
|
|
2994
|
-
}
|
|
2995
|
-
item.editorHandlerColumn = item.editorHandlerColumn || {};
|
|
2996
|
-
const { columns } = gridOption;
|
|
2997
3004
|
for (const col of columns) {
|
|
2998
3005
|
if (col.type === 'children-col') {
|
|
2999
3006
|
for (const childCol of col.children) {
|
|
@@ -3004,14 +3011,13 @@ class SdEditorHandlerColumnPipe {
|
|
|
3004
3011
|
item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: __classPrivateFieldGet(this, _visible$1).call(this, col, item) });
|
|
3005
3012
|
}
|
|
3006
3013
|
}
|
|
3007
|
-
item.
|
|
3008
|
-
return true;
|
|
3014
|
+
return item.editorHandlerRow;
|
|
3009
3015
|
}
|
|
3010
3016
|
}
|
|
3011
3017
|
_visible$1 = new WeakMap();
|
|
3012
|
-
|
|
3018
|
+
SdEditorHandlerRowPipe.decorators = [
|
|
3013
3019
|
{ type: Pipe, args: [{
|
|
3014
|
-
name: '
|
|
3020
|
+
name: 'sdEditorHandlerRow'
|
|
3015
3021
|
},] }
|
|
3016
3022
|
];
|
|
3017
3023
|
|
|
@@ -3559,6 +3565,7 @@ SdGridMaterialModule.decorators = [
|
|
|
3559
3565
|
SdGridConfigurationService,
|
|
3560
3566
|
SdGeneratedColumnService,
|
|
3561
3567
|
SdColumnValuesPipe,
|
|
3568
|
+
SdEditorHandlerColumnPipe,
|
|
3562
3569
|
{
|
|
3563
3570
|
provide: MatPaginatorIntl, useClass: MatPaginatorIntlCro
|
|
3564
3571
|
}
|
|
@@ -3570,5 +3577,5 @@ SdGridMaterialModule.decorators = [
|
|
|
3570
3577
|
* Generated bundle index. Do not edit.
|
|
3571
3578
|
*/
|
|
3572
3579
|
|
|
3573
|
-
export { SdGridMaterial, SdGridMaterialModule, SdMaterialCellDefDirective, SdMaterialEmptyDataDefDirective, SdMaterialFilterDefDirective, SdMaterialFooterDefDirective, SdMaterialSubInformationDefDirective, MatPaginatorIntlCro as ɵa, SdGridFilter as ɵb,
|
|
3580
|
+
export { SdGridMaterial, SdGridMaterialModule, SdMaterialCellDefDirective, SdMaterialEmptyDataDefDirective, SdMaterialFilterDefDirective, SdMaterialFooterDefDirective, SdMaterialSubInformationDefDirective, MatPaginatorIntlCro as ɵa, SdGridFilter as ɵb, SdCommandIconPipe as ɵba, SdCommandTitlePipe as ɵbb, SdColumnHtmlTemplatePipe as ɵbc, SdColumnTransformPipe as ɵbd, SdColumnTooltipPipe as ɵbe, SdColumnBadgePipe as ɵbf, SdFilterColumnPipe as ɵbg, SdFilterExternalPipe as ɵbh, SdSelectionActionFilterPipe as ɵbi, SdSelectionVisiblePipe as ɵbj, SdSelectionDisablePipe as ɵbk, SdSelectionVisibleSelectAllPipe as ɵbl, SdEditorHandlerRowPipe as ɵbm, SdEditorValidatePipe as ɵbn, SdStyleRowCss as ɵbo, SdCellViewPipe as ɵbp, SdGroupPipe as ɵbq, SdPopupFilter as ɵc, SdGridFilterService as ɵd, SdPopupExport as ɵe, GRID_MATERIAL_CONFIG as ɵg, SdGridConfigurationService as ɵh, SdColumnValuesPipe as ɵi, SdEditorHandlerColumnPipe as ɵj, SdGridQuickAction as ɵk, SdDesktopCell as ɵl, SdDesktopCellEditor as ɵm, SdDesktopEditorValidation as ɵn, SdDesktopCellView as ɵo, SdDesktopCellChildrenView as ɵp, SdDesktopCommand as ɵq, SdColumnInlineFilter as ɵr, SdPopupGridConfiguration as ɵs, SdDynamicColumn as ɵt, SdGeneratedColumnService as ɵu, SdGridConfigurationResultPipe as ɵv, SdColumnChildrenFilterPipe as ɵw, SdColumnTitlePipe as ɵx, SdCommandFilterPipe as ɵy, SdCommandDisablePipe as ɵz };
|
|
3574
3581
|
//# sourceMappingURL=sd-angular-core-grid-material.js.map
|