ps-toolkit-ui 1.12.2 → 1.12.3
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 +16 -1
- 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/components/form/uploader/form.uploader.component.js +17 -2
- package/fesm2015/ps-toolkit-ui.js +16 -1
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/package.json +1 -1
|
@@ -8039,7 +8039,22 @@
|
|
|
8039
8039
|
FormUploaderComponent.prototype.ngOnInit = function () {
|
|
8040
8040
|
var _this = this;
|
|
8041
8041
|
this.inp.setValue = function (v) {
|
|
8042
|
-
_this.inp.value = v != null && v instanceof Array ? v
|
|
8042
|
+
_this.inp.value = v != null && v instanceof Array && v.every(function (i) { return typeof i === 'string'; }) ? v.map(function (f) {
|
|
8043
|
+
var _a, _b;
|
|
8044
|
+
var typ = (_a = exports.FileIcons[f.split('.').at(-1)]) !== null && _a !== void 0 ? _a : exports.FileIcons.file;
|
|
8045
|
+
var icon = (_b = exports.FileIcons[f.split('.').at(-1)]) !== null && _b !== void 0 ? _b : exports.FileIcons.file;
|
|
8046
|
+
var close = new InputClass(_this.inp.environment, _this.inp.l, null, 'fas fa-times', exports.InputType.Icon, 'red h-15');
|
|
8047
|
+
close.onClick = function () {
|
|
8048
|
+
_this.inp.value = _this.inp.value.filter(function (x) { return x.file !== f; });
|
|
8049
|
+
};
|
|
8050
|
+
return {
|
|
8051
|
+
type: typ,
|
|
8052
|
+
icon: icon,
|
|
8053
|
+
url: _this.inp.environment.url + f,
|
|
8054
|
+
close: close,
|
|
8055
|
+
file: f
|
|
8056
|
+
};
|
|
8057
|
+
}) : [];
|
|
8043
8058
|
};
|
|
8044
8059
|
this.inp.isValid = function () {
|
|
8045
8060
|
_this.inp.error = null;
|