ps-toolkit-ui 1.5.4 → 1.5.7
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 +17 -9
- 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/enum.class.js +2 -1
- package/esm2015/lib/components/form/plaque/form.plaque.component.js +9 -9
- package/esm2015/lib/components/table/row/table.row.component.js +9 -2
- package/fesm2015/ps-toolkit-ui.js +17 -9
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/enum.class.d.ts +2 -1
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -804,6 +804,7 @@
|
|
|
804
804
|
TableCollType[TableCollType["Bool"] = 13] = "Bool";
|
|
805
805
|
TableCollType[TableCollType["Options"] = 14] = "Options";
|
|
806
806
|
TableCollType[TableCollType["Color"] = 15] = "Color";
|
|
807
|
+
TableCollType[TableCollType["Number"] = 16] = "Number";
|
|
807
808
|
})(exports.TableCollType || (exports.TableCollType = {}));
|
|
808
809
|
(function (UserType) {
|
|
809
810
|
UserType[UserType["All"] = 0] = "All";
|
|
@@ -2828,7 +2829,11 @@
|
|
|
2828
2829
|
TableRowComponent.prototype.getCell = function (col) {
|
|
2829
2830
|
console.log('getCell');
|
|
2830
2831
|
var cv = _.get(this.row.Data, col.name);
|
|
2831
|
-
|
|
2832
|
+
console.log(cv, 'cv');
|
|
2833
|
+
if (cv === null) {
|
|
2834
|
+
return '';
|
|
2835
|
+
}
|
|
2836
|
+
else if (col.fun != null) {
|
|
2832
2837
|
return col.fun(this.row.Data);
|
|
2833
2838
|
}
|
|
2834
2839
|
else if (col.enum !== null) {
|
|
@@ -2861,6 +2866,9 @@
|
|
|
2861
2866
|
else if (col.type === exports.TableCollType.Price) {
|
|
2862
2867
|
return cv.toLocaleString() + ' ' + this.table.l('Rial');
|
|
2863
2868
|
}
|
|
2869
|
+
else if (col.type === exports.TableCollType.Number) {
|
|
2870
|
+
return cv.toLocaleString();
|
|
2871
|
+
}
|
|
2864
2872
|
else if (col.type === exports.TableCollType.Plaque) {
|
|
2865
2873
|
var parts = cv.split('_');
|
|
2866
2874
|
if (parts.length === 4) {
|
|
@@ -4841,10 +4849,14 @@
|
|
|
4841
4849
|
}
|
|
4842
4850
|
};
|
|
4843
4851
|
this.inp.isValid = function () {
|
|
4844
|
-
|
|
4845
|
-
|
|
4852
|
+
_this.inp.value = _this.getValue();
|
|
4853
|
+
if (_this.inp.required && !_this.inp.value) {
|
|
4854
|
+
_this.inp.error = exports.InputError.Required;
|
|
4846
4855
|
return false;
|
|
4847
4856
|
}
|
|
4857
|
+
if (!_this.inp.required && !_this.inp.value) {
|
|
4858
|
+
return true;
|
|
4859
|
+
}
|
|
4848
4860
|
return true;
|
|
4849
4861
|
};
|
|
4850
4862
|
this.inp.clear = function () {
|
|
@@ -4861,11 +4873,11 @@
|
|
|
4861
4873
|
};
|
|
4862
4874
|
};
|
|
4863
4875
|
FormPlaqueComponent.prototype.isValid = function () {
|
|
4864
|
-
if (this.inp.
|
|
4876
|
+
if (this.inp.type === exports.InputType.Plaque &&
|
|
4865
4877
|
(!this.part1.isValid() || !this.part2.isValid() || !this.part3.isValid() || !this.part4.isValid())) {
|
|
4866
4878
|
return false;
|
|
4867
4879
|
}
|
|
4868
|
-
return !(
|
|
4880
|
+
return !((this.inp.type === exports.InputType.PlaqueM || this.inp.type === exports.InputType.PlaqueF) && (!this.part1.isValid() || !this.part3.isValid()));
|
|
4869
4881
|
};
|
|
4870
4882
|
FormPlaqueComponent.prototype.changeFocus = function (p, a) {
|
|
4871
4883
|
if (this.inp.type === exports.InputType.Plaque) {
|
|
@@ -4946,10 +4958,6 @@
|
|
|
4946
4958
|
}
|
|
4947
4959
|
};
|
|
4948
4960
|
FormPlaqueComponent.prototype.getValue = function () {
|
|
4949
|
-
console.log(this.isValid());
|
|
4950
|
-
console.log(this.inp.type === exports.InputType.Plaque ?
|
|
4951
|
-
(this.part1.value ? this.part1.value : '') + "_" + (this.part2.value ? this.part2.value : '') + "_" + (this.part3.value ? this.part3.value : '') + "_" + (this.part4.value ? this.part4.value : '') :
|
|
4952
|
-
(this.part1.value ? this.part1.value : '') + "_" + (this.part3.value ? this.part3.value : ''));
|
|
4953
4961
|
return this.isValid() ? (this.inp.type === exports.InputType.Plaque ?
|
|
4954
4962
|
(this.part1.value ? this.part1.value : '') + "_" + (this.part2.value ? this.part2.value : '') + "_" + (this.part3.value ? this.part3.value : '') + "_" + (this.part4.value ? this.part4.value : '') :
|
|
4955
4963
|
(this.part1.value ? this.part1.value : '') + "_" + (this.part3.value ? this.part3.value : '')) : null;
|