ps-toolkit-ui 1.9.63 → 1.9.65
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/ps-toolkit-ui.umd.js +29 -10
- package/bundles/ps-toolkit-ui.umd.js.map +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js.map +1 -1
- package/esm2015/lib/classes/table.class.js +8 -10
- package/esm2015/lib/components/form/table/form.table.component.js +23 -2
- package/fesm2015/ps-toolkit-ui.js +29 -10
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/table.class.d.ts +1 -0
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -5800,8 +5800,29 @@
|
|
|
5800
5800
|
x.class += ' h-30';
|
|
5801
5801
|
});
|
|
5802
5802
|
}
|
|
5803
|
+
var uAccess = new PermissionClass();
|
|
5804
|
+
uAccess.Action = 'Update';
|
|
5805
|
+
uAccess.Type = exports.PermissionTypeEnum.Option;
|
|
5806
|
+
uAccess.InputAction = exports.PermissionInputActionEnum.None;
|
|
5807
|
+
uAccess.InputType = exports.PermissionInputTypeEnum.Icon;
|
|
5808
|
+
uAccess.AccessType = exports.PermissionAccessTypeEnum.Update;
|
|
5809
|
+
uAccess.Icon = 'fad fa-pen';
|
|
5810
|
+
uAccess.Name = 'Update';
|
|
5811
|
+
var dAccess = new PermissionClass();
|
|
5812
|
+
dAccess.Action = 'Delete';
|
|
5813
|
+
dAccess.Type = exports.PermissionTypeEnum.Option;
|
|
5814
|
+
dAccess.InputAction = exports.PermissionInputActionEnum.None;
|
|
5815
|
+
dAccess.InputType = exports.PermissionInputTypeEnum.Icon;
|
|
5816
|
+
dAccess.AccessType = exports.PermissionAccessTypeEnum.Delete;
|
|
5817
|
+
dAccess.Icon = 'fad fa-trash';
|
|
5818
|
+
dAccess.Name = 'Delete';
|
|
5803
5819
|
this.inp.setValue = function (v) {
|
|
5804
|
-
_this.inp.table.rows = v === null ? [] : v
|
|
5820
|
+
_this.inp.table.rows = v === null ? [] : v.map(function (x) {
|
|
5821
|
+
return {
|
|
5822
|
+
Data: x,
|
|
5823
|
+
Options: [uAccess, dAccess]
|
|
5824
|
+
};
|
|
5825
|
+
});
|
|
5805
5826
|
};
|
|
5806
5827
|
this.inp.focus = function () {
|
|
5807
5828
|
if (_this.inp.table.form) {
|
|
@@ -8110,11 +8131,14 @@
|
|
|
8110
8131
|
}
|
|
8111
8132
|
return this.searchForm ? this.searchForm.json(d) : d;
|
|
8112
8133
|
};
|
|
8134
|
+
TableClass.prototype.getUrl = function (url) {
|
|
8135
|
+
return this.permissions.RelatedId ? url.replace('{}', this.permissions.RelatedId) : url.replace('/{}', '');
|
|
8136
|
+
};
|
|
8113
8137
|
TableClass.prototype.showInsertModal = function (cId) {
|
|
8114
8138
|
if (cId === void 0) { cId = null; }
|
|
8115
8139
|
var insertAccess = this.permissions.getAccess(exports.PermissionAccessTypeEnum.Insert);
|
|
8116
8140
|
this.form.isEdit = false;
|
|
8117
|
-
this.form.url = this.form.baseUrl = insertAccess.Url
|
|
8141
|
+
this.form.url = this.form.baseUrl = this.getUrl(insertAccess.Url) + (cId ? '/' + cId : '');
|
|
8118
8142
|
this.form.name = insertAccess.Name;
|
|
8119
8143
|
this.form.method = exports.Method.Post;
|
|
8120
8144
|
this.form.inputs.filter(function (x) { return x.inEditDisabled; }).forEach(function (x) { return x.disabled = false; });
|
|
@@ -8131,12 +8155,7 @@
|
|
|
8131
8155
|
var listAccess = this.permissions.getAccess(exports.PermissionAccessTypeEnum.List);
|
|
8132
8156
|
if (listAccess !== null) {
|
|
8133
8157
|
this.title = listAccess.Name;
|
|
8134
|
-
|
|
8135
|
-
this.url = listAccess.Url.replace('{}', this.permissions.RelatedId);
|
|
8136
|
-
}
|
|
8137
|
-
else {
|
|
8138
|
-
this.url = listAccess.Url.replace('/{}', '');
|
|
8139
|
-
}
|
|
8158
|
+
this.url = this.getUrl(listAccess.Url);
|
|
8140
8159
|
if (this.permissions.Type !== exports.PermissionTypeEnum.Form) {
|
|
8141
8160
|
this.load();
|
|
8142
8161
|
}
|
|
@@ -8160,7 +8179,7 @@
|
|
|
8160
8179
|
if (access.AccessType === exports.PermissionAccessTypeEnum.Insert) {
|
|
8161
8180
|
accessInp.class = accessInp.class.replace('blue', 'green');
|
|
8162
8181
|
if (this_1.form) {
|
|
8163
|
-
this_1.form.url = this_1.form.baseUrl = access.Url
|
|
8182
|
+
this_1.form.url = this_1.form.baseUrl = this_1.getUrl(access.Url);
|
|
8164
8183
|
if (!this_1.form.onTop) {
|
|
8165
8184
|
accessInp.onClick = function () {
|
|
8166
8185
|
_this.form.onSuccessBase = function () {
|
|
@@ -8193,7 +8212,7 @@
|
|
|
8193
8212
|
p.Controller = 'print';
|
|
8194
8213
|
p.Action = _this.permissions.Controller + (_this.permissions.Action ? _this.permissions.Action : '');
|
|
8195
8214
|
var params = $$1.param(_this.searchData(true));
|
|
8196
|
-
window.open('/report' + access.Url
|
|
8215
|
+
window.open('/report' + _this.getUrl(access.Url) + (params ? '?' + params : ''), '_blank');
|
|
8197
8216
|
};
|
|
8198
8217
|
}
|
|
8199
8218
|
else if (access.InputAction === exports.PermissionInputActionEnum.OnClick) {
|