ps-toolkit-ui 1.12.98 → 1.12.99
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 +30 -13
- 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 +20 -4
- package/esm2015/lib/components/table/row/table.row.component.js +8 -11
- package/fesm2015/ps-toolkit-ui.js +26 -13
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/table.class.d.ts +1 -0
- package/lib/components/table/row/table.row.component.d.ts +0 -1
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -2999,9 +2999,6 @@
|
|
|
2999
2999
|
}
|
|
3000
3000
|
}, 500);
|
|
3001
3001
|
};
|
|
3002
|
-
TableRowComponent.prototype.getOptionUrl = function (url, relatedId, rowId) {
|
|
3003
|
-
return (relatedId ? url.replace('{}', relatedId) : (url.match(/{}/g) || []).length > 1 ? url.replace('/{}', '') : url).replace('{}', rowId);
|
|
3004
|
-
};
|
|
3005
3002
|
TableRowComponent.prototype.setOptions = function () {
|
|
3006
3003
|
var e_1, _b, e_2, _c;
|
|
3007
3004
|
var _this = this;
|
|
@@ -3041,7 +3038,7 @@
|
|
|
3041
3038
|
if (option.AccessType === exports.PermissionAccessTypeEnum.Update) {
|
|
3042
3039
|
if (this_2.table.form) {
|
|
3043
3040
|
opt.onClick = function () {
|
|
3044
|
-
_this.table.form.url = _this.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id);
|
|
3041
|
+
_this.table.form.url = _this.table.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id);
|
|
3045
3042
|
if (_this.table.hasChildren && _this.row.Data.ParentId != null) {
|
|
3046
3043
|
_this.table.form.onSuccessBase = function () {
|
|
3047
3044
|
_this.table.modal.hide();
|
|
@@ -3066,7 +3063,7 @@
|
|
|
3066
3063
|
};
|
|
3067
3064
|
}
|
|
3068
3065
|
else {
|
|
3069
|
-
opt.url = this_2.getOptionUrl(option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
|
|
3066
|
+
opt.url = this_2.table.getOptionUrl(option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
|
|
3070
3067
|
}
|
|
3071
3068
|
}
|
|
3072
3069
|
else if (option.AccessType === exports.PermissionAccessTypeEnum.Delete) {
|
|
@@ -3082,7 +3079,7 @@
|
|
|
3082
3079
|
else {
|
|
3083
3080
|
_this.confirmShow.emit({
|
|
3084
3081
|
action: option.Action,
|
|
3085
|
-
url: _this.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id),
|
|
3082
|
+
url: _this.table.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id),
|
|
3086
3083
|
accept: function () {
|
|
3087
3084
|
if (_this.table.hasChildren && _this.table.childrenAutoLoad && _this.row.Data.ParentId != null) {
|
|
3088
3085
|
_this.loadParent.emit(_this.row.Data.ParentId);
|
|
@@ -3096,7 +3093,7 @@
|
|
|
3096
3093
|
};
|
|
3097
3094
|
}
|
|
3098
3095
|
else if (option.AccessType === exports.PermissionAccessTypeEnum.Report) {
|
|
3099
|
-
opt.url = this_2.getOptionUrl('/report' + option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
|
|
3096
|
+
opt.url = this_2.table.getOptionUrl('/report' + option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
|
|
3100
3097
|
opt.urlNewTab = true;
|
|
3101
3098
|
}
|
|
3102
3099
|
else if (option.InputAction === exports.PermissionInputActionEnum.Link || option.InputAction === exports.PermissionInputActionEnum.LinkNewTab) {
|
|
@@ -3170,7 +3167,7 @@
|
|
|
3170
3167
|
p.Area = this_2.table.permissions.Area;
|
|
3171
3168
|
p.Controller = option.Controller;
|
|
3172
3169
|
p.Action = option.Action;
|
|
3173
|
-
opt.url = '/file' + this_2.getOptionUrl(option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
|
|
3170
|
+
opt.url = '/file' + this_2.table.getOptionUrl(option.Url, this_2.table.permissions.RelatedId, this_2.row.Data.Id);
|
|
3174
3171
|
opt.urlNewTab = true;
|
|
3175
3172
|
}
|
|
3176
3173
|
else if (option.InputAction === exports.PermissionInputActionEnum.Confirm) {
|
|
@@ -3180,7 +3177,7 @@
|
|
|
3180
3177
|
p.Area = _this.table.permissions.Area;
|
|
3181
3178
|
p.Controller = option.Controller;
|
|
3182
3179
|
p.Action = option.Action;
|
|
3183
|
-
_this.table.showConfirm(_this.table.l(option.Action + 'Confirm'), _this.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id), null, function () {
|
|
3180
|
+
_this.table.showConfirm(_this.table.l(option.Action + 'Confirm'), _this.table.getOptionUrl(option.Url, _this.table.permissions.RelatedId, _this.row.Data.Id), null, function () {
|
|
3184
3181
|
_this.table.load();
|
|
3185
3182
|
});
|
|
3186
3183
|
};
|
|
@@ -3345,7 +3342,7 @@
|
|
|
3345
3342
|
this.table.form.inputs.forEach(function (x) { return x.required = x.inEditRequired; });
|
|
3346
3343
|
}
|
|
3347
3344
|
else {
|
|
3348
|
-
new RequestClass(this.table.environment, this.table.l).send(this.getOptionUrl(option.Url.replace('update', 'get'), this.table.permissions.RelatedId, this.row.Data.Id), exports.Method.Post, null, opt, function (result) {
|
|
3345
|
+
new RequestClass(this.table.environment, this.table.l).send(this.table.getOptionUrl(option.Url.replace('update', 'get'), this.table.permissions.RelatedId, this.row.Data.Id), exports.Method.Post, null, opt, function (result) {
|
|
3349
3346
|
_this.table.form.name = opt.name;
|
|
3350
3347
|
_this.table.form.setData(result);
|
|
3351
3348
|
_this.table.form.setButtons(_this.table.form.onTop, true, _this.row.Data.Id);
|
|
@@ -8598,6 +8595,9 @@
|
|
|
8598
8595
|
TableClass.prototype.data = function () {
|
|
8599
8596
|
return this.rows.filter(function (x) { return x.selected; }).map(function (x) { return x.Data; });
|
|
8600
8597
|
};
|
|
8598
|
+
TableClass.prototype.getOptionUrl = function (url, relatedId, rowId) {
|
|
8599
|
+
return (relatedId ? url.replace('{}', relatedId) : (url.match(/{}/g) || []).length > 1 ? url.replace('/{}', '') : url).replace('{}', rowId);
|
|
8600
|
+
};
|
|
8601
8601
|
TableClass.prototype.searchData = function (report) {
|
|
8602
8602
|
var e_1, _a, e_2, _b;
|
|
8603
8603
|
if (report === void 0) { report = false; }
|
|
@@ -8759,11 +8759,28 @@
|
|
|
8759
8759
|
}
|
|
8760
8760
|
finally { if (e_3) throw e_3.error; }
|
|
8761
8761
|
}
|
|
8762
|
+
var _loop_2 = function (option) {
|
|
8763
|
+
var opt = new InputClass(this_2.environment, this_2.l, option.Name, option.Icon, exports.InputType.Icon, 'm-r-10-p');
|
|
8764
|
+
opt.onClick = function () {
|
|
8765
|
+
var p = new PermissionClass();
|
|
8766
|
+
p.RelatedId = _this.permissions.RelatedId;
|
|
8767
|
+
p.Area = _this.permissions.Area;
|
|
8768
|
+
p.Controller = option.Controller;
|
|
8769
|
+
p.Action = option.Action;
|
|
8770
|
+
var data = { Ids: _this.data().map(function (x) { return x.Id; }) };
|
|
8771
|
+
console.log(_this.getOptionUrl(option.Url, _this.permissions.RelatedId, ''));
|
|
8772
|
+
console.log(data);
|
|
8773
|
+
_this.showConfirm(_this.l(option.Action + 'ConfirmMulti'), _this.getOptionUrl(option.Url, _this.permissions.RelatedId, ''), data, function () {
|
|
8774
|
+
_this.load();
|
|
8775
|
+
});
|
|
8776
|
+
};
|
|
8777
|
+
this_2.extraButtons.push(opt);
|
|
8778
|
+
};
|
|
8779
|
+
var this_2 = this;
|
|
8762
8780
|
try {
|
|
8763
8781
|
for (var _e = __values(this.permissions.getOptions().filter(function (x) { return x.Multi; })), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
8764
|
-
var
|
|
8765
|
-
|
|
8766
|
-
this.extraButtons.push(option);
|
|
8782
|
+
var option = _f.value;
|
|
8783
|
+
_loop_2(option);
|
|
8767
8784
|
}
|
|
8768
8785
|
}
|
|
8769
8786
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|