ps-toolkit-ui 1.10.98 → 1.11.0
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 +33 -31
- 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/form.class.js +16 -2
- package/esm2015/lib/components/form/select/form.select.component.js +3 -16
- package/fesm2015/ps-toolkit-ui.js +17 -16
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/form.class.d.ts +2 -1
- package/lib/components/form/select/form.select.component.d.ts +0 -1
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -1941,7 +1941,6 @@
|
|
|
1941
1941
|
this.placeholder = null;
|
|
1942
1942
|
this.addNew = false;
|
|
1943
1943
|
this.description = null;
|
|
1944
|
-
this.valueOption = null;
|
|
1945
1944
|
this.value = null;
|
|
1946
1945
|
this.search = null;
|
|
1947
1946
|
this.default = null;
|
|
@@ -2106,6 +2105,34 @@
|
|
|
2106
2105
|
InputClass.prototype.getLabel = function () {
|
|
2107
2106
|
return HelperClass.getLabel(this);
|
|
2108
2107
|
};
|
|
2108
|
+
InputClass.prototype.getSelected = function (opts) {
|
|
2109
|
+
if (opts === void 0) { opts = this.options; }
|
|
2110
|
+
return this.getSelectedOptions(opts).map(function (x) { return x.value; });
|
|
2111
|
+
};
|
|
2112
|
+
InputClass.prototype.getSelectedOptions = function (opts) {
|
|
2113
|
+
var e_4, _a;
|
|
2114
|
+
if (opts === void 0) { opts = this.options; }
|
|
2115
|
+
console.log(opts);
|
|
2116
|
+
var l = [];
|
|
2117
|
+
try {
|
|
2118
|
+
for (var opts_1 = __values(opts), opts_1_1 = opts_1.next(); !opts_1_1.done; opts_1_1 = opts_1.next()) {
|
|
2119
|
+
var f = opts_1_1.value;
|
|
2120
|
+
if (f.selected && (!this.onlyChild || f.options.length === 0)) {
|
|
2121
|
+
l.push(f);
|
|
2122
|
+
}
|
|
2123
|
+
var rs = this.getSelected(f.options);
|
|
2124
|
+
l = l.concat(rs);
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
2128
|
+
finally {
|
|
2129
|
+
try {
|
|
2130
|
+
if (opts_1_1 && !opts_1_1.done && (_a = opts_1.return)) _a.call(opts_1);
|
|
2131
|
+
}
|
|
2132
|
+
finally { if (e_4) throw e_4.error; }
|
|
2133
|
+
}
|
|
2134
|
+
return l;
|
|
2135
|
+
};
|
|
2109
2136
|
return InputClass;
|
|
2110
2137
|
}());
|
|
2111
2138
|
var OptionClass = /** @class */ (function () {
|
|
@@ -2155,7 +2182,7 @@
|
|
|
2155
2182
|
this.rows = rows;
|
|
2156
2183
|
}
|
|
2157
2184
|
AccordionClass.prototype.check = function () {
|
|
2158
|
-
var
|
|
2185
|
+
var e_5, _a;
|
|
2159
2186
|
try {
|
|
2160
2187
|
for (var _b = __values(this.rows), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2161
2188
|
var row = _c.value;
|
|
@@ -2165,12 +2192,12 @@
|
|
|
2165
2192
|
}
|
|
2166
2193
|
}
|
|
2167
2194
|
}
|
|
2168
|
-
catch (
|
|
2195
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
2169
2196
|
finally {
|
|
2170
2197
|
try {
|
|
2171
2198
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2172
2199
|
}
|
|
2173
|
-
finally { if (
|
|
2200
|
+
finally { if (e_5) throw e_5.error; }
|
|
2174
2201
|
}
|
|
2175
2202
|
return true;
|
|
2176
2203
|
};
|
|
@@ -5325,7 +5352,7 @@
|
|
|
5325
5352
|
this.inp.isValid = function () {
|
|
5326
5353
|
_this.inp.error = null;
|
|
5327
5354
|
if (_this.inp.required && ((!_this.inp.multiple && ((_this.inp.addNew && !_this.inp.search) || (!_this.inp.addNew && !_this.inp.value))) ||
|
|
5328
|
-
(_this.inp.multiple && _this.getSelected().length === 0))) {
|
|
5355
|
+
(_this.inp.multiple && _this.inp.getSelected().length === 0))) {
|
|
5329
5356
|
_this.inp.error = exports.InputError.Required;
|
|
5330
5357
|
return false;
|
|
5331
5358
|
}
|
|
@@ -5354,7 +5381,7 @@
|
|
|
5354
5381
|
var d = {};
|
|
5355
5382
|
d[_this.inp.name] = _this.inp.addNew ? _this.inp.search : _this.inp.value;
|
|
5356
5383
|
d[_this.inp.name + 'Name'] = _this.inp.search;
|
|
5357
|
-
return !_this.inp.multiple ? d : _this.getSelected();
|
|
5384
|
+
return !_this.inp.multiple ? d : _this.inp.getSelected();
|
|
5358
5385
|
};
|
|
5359
5386
|
this.inp.focusOut = function () {
|
|
5360
5387
|
$__namespace(_this.inputBase.nativeElement).blur();
|
|
@@ -5517,11 +5544,9 @@
|
|
|
5517
5544
|
var va = this.getValue(v);
|
|
5518
5545
|
if (this.inp.multiple) {
|
|
5519
5546
|
this.toggle(va);
|
|
5520
|
-
this.inp.valueOption = va ? va : null;
|
|
5521
5547
|
this.inp.search = '';
|
|
5522
5548
|
}
|
|
5523
5549
|
else {
|
|
5524
|
-
this.inp.valueOption = va ? va : null;
|
|
5525
5550
|
this.inp.value = v;
|
|
5526
5551
|
this.inp.search = va ? (((this.inp.type !== exports.InputType.SelectSearch && this.inp.type !== exports.InputType.Select) || va.search) ? va.search : va.name) : '';
|
|
5527
5552
|
}
|
|
@@ -5670,29 +5695,6 @@
|
|
|
5670
5695
|
finally { if (e_3) throw e_3.error; }
|
|
5671
5696
|
}
|
|
5672
5697
|
};
|
|
5673
|
-
FormSelectComponent.prototype.getSelected = function (opts) {
|
|
5674
|
-
var e_4, _b;
|
|
5675
|
-
if (opts === void 0) { opts = this.inp.options; }
|
|
5676
|
-
var l = [];
|
|
5677
|
-
try {
|
|
5678
|
-
for (var opts_1 = __values(opts), opts_1_1 = opts_1.next(); !opts_1_1.done; opts_1_1 = opts_1.next()) {
|
|
5679
|
-
var f = opts_1_1.value;
|
|
5680
|
-
if (f.selected && (!this.inp.onlyChild || f.options.length === 0)) {
|
|
5681
|
-
l.push(f.value);
|
|
5682
|
-
}
|
|
5683
|
-
var rs = this.getSelected(f.options);
|
|
5684
|
-
l = l.concat(rs);
|
|
5685
|
-
}
|
|
5686
|
-
}
|
|
5687
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
5688
|
-
finally {
|
|
5689
|
-
try {
|
|
5690
|
-
if (opts_1_1 && !opts_1_1.done && (_b = opts_1.return)) _b.call(opts_1);
|
|
5691
|
-
}
|
|
5692
|
-
finally { if (e_4) throw e_4.error; }
|
|
5693
|
-
}
|
|
5694
|
-
return l;
|
|
5695
|
-
};
|
|
5696
5698
|
FormSelectComponent.prototype.onClickButton = function () {
|
|
5697
5699
|
this.inp.onClickButton(this.inp);
|
|
5698
5700
|
};
|