ps-toolkit-ui 1.10.97 → 1.10.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 +32 -30
- 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 +15 -2
- package/esm2015/lib/components/form/select/form.select.component.js +3 -15
- package/fesm2015/ps-toolkit-ui.js +16 -15
- 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,33 @@
|
|
|
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
|
+
var l = [];
|
|
2116
|
+
try {
|
|
2117
|
+
for (var opts_1 = __values(opts), opts_1_1 = opts_1.next(); !opts_1_1.done; opts_1_1 = opts_1.next()) {
|
|
2118
|
+
var f = opts_1_1.value;
|
|
2119
|
+
if (f.selected && (!this.onlyChild || f.options.length === 0)) {
|
|
2120
|
+
l.push(f);
|
|
2121
|
+
}
|
|
2122
|
+
var rs = this.getSelected(f.options);
|
|
2123
|
+
l = l.concat(rs);
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
2127
|
+
finally {
|
|
2128
|
+
try {
|
|
2129
|
+
if (opts_1_1 && !opts_1_1.done && (_a = opts_1.return)) _a.call(opts_1);
|
|
2130
|
+
}
|
|
2131
|
+
finally { if (e_4) throw e_4.error; }
|
|
2132
|
+
}
|
|
2133
|
+
return l;
|
|
2134
|
+
};
|
|
2109
2135
|
return InputClass;
|
|
2110
2136
|
}());
|
|
2111
2137
|
var OptionClass = /** @class */ (function () {
|
|
@@ -2155,7 +2181,7 @@
|
|
|
2155
2181
|
this.rows = rows;
|
|
2156
2182
|
}
|
|
2157
2183
|
AccordionClass.prototype.check = function () {
|
|
2158
|
-
var
|
|
2184
|
+
var e_5, _a;
|
|
2159
2185
|
try {
|
|
2160
2186
|
for (var _b = __values(this.rows), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2161
2187
|
var row = _c.value;
|
|
@@ -2165,12 +2191,12 @@
|
|
|
2165
2191
|
}
|
|
2166
2192
|
}
|
|
2167
2193
|
}
|
|
2168
|
-
catch (
|
|
2194
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
2169
2195
|
finally {
|
|
2170
2196
|
try {
|
|
2171
2197
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2172
2198
|
}
|
|
2173
|
-
finally { if (
|
|
2199
|
+
finally { if (e_5) throw e_5.error; }
|
|
2174
2200
|
}
|
|
2175
2201
|
return true;
|
|
2176
2202
|
};
|
|
@@ -5325,7 +5351,7 @@
|
|
|
5325
5351
|
this.inp.isValid = function () {
|
|
5326
5352
|
_this.inp.error = null;
|
|
5327
5353
|
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))) {
|
|
5354
|
+
(_this.inp.multiple && _this.inp.getSelected().length === 0))) {
|
|
5329
5355
|
_this.inp.error = exports.InputError.Required;
|
|
5330
5356
|
return false;
|
|
5331
5357
|
}
|
|
@@ -5354,7 +5380,7 @@
|
|
|
5354
5380
|
var d = {};
|
|
5355
5381
|
d[_this.inp.name] = _this.inp.addNew ? _this.inp.search : _this.inp.value;
|
|
5356
5382
|
d[_this.inp.name + 'Name'] = _this.inp.search;
|
|
5357
|
-
return !_this.inp.multiple ? d : _this.getSelected();
|
|
5383
|
+
return !_this.inp.multiple ? d : _this.inp.getSelected();
|
|
5358
5384
|
};
|
|
5359
5385
|
this.inp.focusOut = function () {
|
|
5360
5386
|
$__namespace(_this.inputBase.nativeElement).blur();
|
|
@@ -5520,7 +5546,6 @@
|
|
|
5520
5546
|
this.inp.search = '';
|
|
5521
5547
|
}
|
|
5522
5548
|
else {
|
|
5523
|
-
this.inp.valueOption = va ? va : null;
|
|
5524
5549
|
this.inp.value = v;
|
|
5525
5550
|
this.inp.search = va ? (((this.inp.type !== exports.InputType.SelectSearch && this.inp.type !== exports.InputType.Select) || va.search) ? va.search : va.name) : '';
|
|
5526
5551
|
}
|
|
@@ -5669,29 +5694,6 @@
|
|
|
5669
5694
|
finally { if (e_3) throw e_3.error; }
|
|
5670
5695
|
}
|
|
5671
5696
|
};
|
|
5672
|
-
FormSelectComponent.prototype.getSelected = function (opts) {
|
|
5673
|
-
var e_4, _b;
|
|
5674
|
-
if (opts === void 0) { opts = this.inp.options; }
|
|
5675
|
-
var l = [];
|
|
5676
|
-
try {
|
|
5677
|
-
for (var opts_1 = __values(opts), opts_1_1 = opts_1.next(); !opts_1_1.done; opts_1_1 = opts_1.next()) {
|
|
5678
|
-
var f = opts_1_1.value;
|
|
5679
|
-
if (f.selected && (!this.inp.onlyChild || f.options.length === 0)) {
|
|
5680
|
-
l.push(f.value);
|
|
5681
|
-
}
|
|
5682
|
-
var rs = this.getSelected(f.options);
|
|
5683
|
-
l = l.concat(rs);
|
|
5684
|
-
}
|
|
5685
|
-
}
|
|
5686
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
5687
|
-
finally {
|
|
5688
|
-
try {
|
|
5689
|
-
if (opts_1_1 && !opts_1_1.done && (_b = opts_1.return)) _b.call(opts_1);
|
|
5690
|
-
}
|
|
5691
|
-
finally { if (e_4) throw e_4.error; }
|
|
5692
|
-
}
|
|
5693
|
-
return l;
|
|
5694
|
-
};
|
|
5695
5697
|
FormSelectComponent.prototype.onClickButton = function () {
|
|
5696
5698
|
this.inp.onClickButton(this.inp);
|
|
5697
5699
|
};
|