@sd-angular/core 1.1.34 → 1.1.37
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/sd-angular-core-grid-material.umd.js +41 -13
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/esm2015/grid-material/src/lib/pipes/column-values.pipe.js +5 -9
- package/esm2015/grid-material/src/lib/pipes/editor-handler-column.pipe.js +2 -2
- package/esm2015/grid-material/src/lib/pipes/editor-handler-row.pipe.js +25 -3
- package/fesm2015/sd-angular-core-grid-material.js +32 -14
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/grid-material/src/lib/pipes/editor-handler-row.pipe.d.ts +1 -0
- package/package.json +1 -1
- package/{sd-angular-core-1.1.34.tgz → sd-angular-core-1.1.37.tgz} +0 -0
|
@@ -1669,28 +1669,25 @@
|
|
|
1669
1669
|
return [2 /*return*/, value];
|
|
1670
1670
|
}
|
|
1671
1671
|
_f = column.option, items = _f.items, valueField = _f.valueField, displayField = _f.displayField;
|
|
1672
|
-
if (!(typeof (items) === 'function')) return [3 /*break*/, 3];
|
|
1673
1672
|
key = hash__namespace(Object.assign(Object.assign({ prefix: __classPrivateFieldGet(this, _prefix$1) }, column), { value: value }));
|
|
1673
|
+
if (!(typeof (items) === 'function')) return [3 /*break*/, 3];
|
|
1674
1674
|
if (!!__classPrivateFieldGet(this, _cache$1)[key]) return [3 /*break*/, 2];
|
|
1675
1675
|
return [4 /*yield*/, items(value, true)];
|
|
1676
1676
|
case 1:
|
|
1677
1677
|
values = _g.sent();
|
|
1678
1678
|
__classPrivateFieldGet(this, _cache$1)[key] = {
|
|
1679
|
-
|
|
1680
|
-
obj: Array.toObject(values, valueField)
|
|
1679
|
+
result: ((_d = values === null || values === void 0 ? void 0 : values.find(function (e) { return (e === null || e === void 0 ? void 0 : e[valueField]) === value; })) === null || _d === void 0 ? void 0 : _d[displayField]) || valueField
|
|
1681
1680
|
};
|
|
1682
1681
|
_g.label = 2;
|
|
1683
1682
|
case 2: return [3 /*break*/, 4];
|
|
1684
1683
|
case 3:
|
|
1685
|
-
key = hash__namespace(Object.assign({ prefix: __classPrivateFieldGet(this, _prefix$1) }, column));
|
|
1686
1684
|
if (!__classPrivateFieldGet(this, _cache$1)[key]) {
|
|
1687
1685
|
__classPrivateFieldGet(this, _cache$1)[key] = {
|
|
1688
|
-
items: items || []
|
|
1689
|
-
obj: Array.toObject(items, valueField)
|
|
1686
|
+
result: ((_e = items === null || items === void 0 ? void 0 : items.find(function (e) { return (e === null || e === void 0 ? void 0 : e[valueField]) === value; })) === null || _e === void 0 ? void 0 : _e[displayField]) || valueField
|
|
1690
1687
|
};
|
|
1691
1688
|
}
|
|
1692
1689
|
_g.label = 4;
|
|
1693
|
-
case 4: return [2 /*return*/,
|
|
1690
|
+
case 4: return [2 /*return*/, __classPrivateFieldGet(this, _cache$1)[key].result];
|
|
1694
1691
|
}
|
|
1695
1692
|
});
|
|
1696
1693
|
}); };
|
|
@@ -3980,10 +3977,25 @@
|
|
|
3980
3977
|
item: [{ type: core.Input }]
|
|
3981
3978
|
};
|
|
3982
3979
|
|
|
3980
|
+
var _visible;
|
|
3983
3981
|
var SdEditorHandlerRowPipe = /** @class */ (function () {
|
|
3984
3982
|
function SdEditorHandlerRowPipe() {
|
|
3983
|
+
_visible.set(this, function (col, item) {
|
|
3984
|
+
if (col.type === 'children' || col.type === 'children-col') {
|
|
3985
|
+
return false;
|
|
3986
|
+
}
|
|
3987
|
+
// Kiểm tra xem có bị disabled hay không?
|
|
3988
|
+
if (col.editor) {
|
|
3989
|
+
var isDisabled = typeof (col.editor.disabled) === 'function' ? col.editor.disabled(item) : col.editor.disabled;
|
|
3990
|
+
if (isDisabled) {
|
|
3991
|
+
return false;
|
|
3992
|
+
}
|
|
3993
|
+
}
|
|
3994
|
+
return true;
|
|
3995
|
+
});
|
|
3985
3996
|
}
|
|
3986
3997
|
SdEditorHandlerRowPipe.prototype.transform = function (status, item, gridOption) {
|
|
3998
|
+
var e_1, _a;
|
|
3987
3999
|
var editor = gridOption.editor;
|
|
3988
4000
|
if (!editor) {
|
|
3989
4001
|
return null;
|
|
@@ -4012,22 +4024,38 @@
|
|
|
4012
4024
|
item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: false, editable: !status, removable: false, savable: false, cancelable: false });
|
|
4013
4025
|
}
|
|
4014
4026
|
// const { sdId, editorHandlerColumn, ...remain } = item;
|
|
4015
|
-
var sdId = item.sdId, editorHandlerColumn = item.editorHandlerColumn, expandDetail = item.expandDetail, isExpanded = item.isExpanded, isExpanding = item.isExpanding, isSelected = item.isSelected, sdGroup = item.sdGroup, selectable = item.selectable, actions = item.actions,
|
|
4027
|
+
var sdId = item.sdId, editorHandlerColumn = item.editorHandlerColumn, expandDetail = item.expandDetail, isExpanded = item.isExpanded, isExpanding = item.isExpanding, isSelected = item.isSelected, sdGroup = item.sdGroup, selectable = item.selectable, actions = item.actions, groupedActions = item.groupedActions, originItem = item.originItem, editorErrorMessage = item.editorErrorMessage, remain = __rest(item, ["sdId", "editorHandlerColumn", "expandDetail", "isExpanded", "isExpanding", "isSelected", "sdGroup", "selectable", "actions", "groupedActions", "originItem", "editorErrorMessage"]);
|
|
4016
4028
|
item.sdId = hash__default['default'](remain);
|
|
4029
|
+
item.editorHandlerColumn = item.editorHandlerColumn || {};
|
|
4030
|
+
var columns = gridOption.columns;
|
|
4031
|
+
try {
|
|
4032
|
+
for (var columns_1 = __values(columns), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {
|
|
4033
|
+
var col = columns_1_1.value;
|
|
4034
|
+
item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, col, item) });
|
|
4035
|
+
}
|
|
4036
|
+
}
|
|
4037
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4038
|
+
finally {
|
|
4039
|
+
try {
|
|
4040
|
+
if (columns_1_1 && !columns_1_1.done && (_a = columns_1.return)) _a.call(columns_1);
|
|
4041
|
+
}
|
|
4042
|
+
finally { if (e_1) throw e_1.error; }
|
|
4043
|
+
}
|
|
4017
4044
|
return item.editorHandlerRow;
|
|
4018
4045
|
};
|
|
4019
4046
|
return SdEditorHandlerRowPipe;
|
|
4020
4047
|
}());
|
|
4048
|
+
_visible = new WeakMap();
|
|
4021
4049
|
SdEditorHandlerRowPipe.decorators = [
|
|
4022
4050
|
{ type: core.Pipe, args: [{
|
|
4023
4051
|
name: 'sdEditorHandlerRow'
|
|
4024
4052
|
},] }
|
|
4025
4053
|
];
|
|
4026
4054
|
|
|
4027
|
-
var _visible;
|
|
4055
|
+
var _visible$1;
|
|
4028
4056
|
var SdEditorHandlerColumnPipe = /** @class */ (function () {
|
|
4029
4057
|
function SdEditorHandlerColumnPipe() {
|
|
4030
|
-
_visible.set(this, function (col, item) {
|
|
4058
|
+
_visible$1.set(this, function (col, item) {
|
|
4031
4059
|
if (col.type === 'children' || col.type === 'children-col') {
|
|
4032
4060
|
return false;
|
|
4033
4061
|
}
|
|
@@ -4046,7 +4074,7 @@
|
|
|
4046
4074
|
if (column.type === 'children' || column.type === 'children-col') {
|
|
4047
4075
|
return;
|
|
4048
4076
|
}
|
|
4049
|
-
var sdId = item.sdId, editorHandlerColumn = item.editorHandlerColumn, expandDetail = item.expandDetail, isExpanded = item.isExpanded, isExpanding = item.isExpanding, isSelected = item.isSelected, sdGroup = item.sdGroup, selectable = item.selectable, actions = item.actions,
|
|
4077
|
+
var sdId = item.sdId, editorHandlerColumn = item.editorHandlerColumn, expandDetail = item.expandDetail, isExpanded = item.isExpanded, isExpanding = item.isExpanding, isSelected = item.isSelected, sdGroup = item.sdGroup, selectable = item.selectable, actions = item.actions, groupedActions = item.groupedActions, originItem = item.originItem, editorErrorMessage = item.editorErrorMessage, remain = __rest(item, ["sdId", "editorHandlerColumn", "expandDetail", "isExpanded", "isExpanding", "isSelected", "sdGroup", "selectable", "actions", "groupedActions", "originItem", "editorErrorMessage"]);
|
|
4050
4078
|
var key = hash__default['default'](remain);
|
|
4051
4079
|
if (item.sdId === key && item.editorHandlerColumn) {
|
|
4052
4080
|
return;
|
|
@@ -4056,7 +4084,7 @@
|
|
|
4056
4084
|
try {
|
|
4057
4085
|
for (var columns_1 = __values(columns), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {
|
|
4058
4086
|
var col = columns_1_1.value;
|
|
4059
|
-
item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, col, item) });
|
|
4087
|
+
item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: __classPrivateFieldGet(this, _visible$1).call(this, col, item) });
|
|
4060
4088
|
}
|
|
4061
4089
|
}
|
|
4062
4090
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -4087,7 +4115,7 @@
|
|
|
4087
4115
|
};
|
|
4088
4116
|
return SdEditorHandlerColumnPipe;
|
|
4089
4117
|
}());
|
|
4090
|
-
_visible = new WeakMap();
|
|
4118
|
+
_visible$1 = new WeakMap();
|
|
4091
4119
|
SdEditorHandlerColumnPipe.decorators = [
|
|
4092
4120
|
{ type: core.Pipe, args: [{
|
|
4093
4121
|
name: 'sdEditorHandlerColumn'
|