ps-toolkit-ui 1.7.19 → 1.7.22
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 +57 -7
- 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 +12 -1
- package/esm2015/lib/classes/modal.class.js +2 -8
- package/esm2015/lib/components/form/date/form.date.component.js +2 -1
- package/esm2015/lib/components/form/vehicle/search/form.vehicle.search.component.js +45 -2
- package/fesm2015/ps-toolkit-ui.js +56 -7
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/form.class.d.ts +1 -0
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
- package/src/assets/fonts/VazirBlack.ttf +0 -0
- package/src/assets/fonts/VazirBlack.woff2 +0 -0
- package/src/assets/fonts/VazirBold.ttf +0 -0
- package/src/assets/fonts/VazirBold.woff2 +0 -0
- package/src/assets/fonts/VazirExtraBold.ttf +0 -0
- package/src/assets/fonts/VazirExtraBold.woff2 +0 -0
- package/src/assets/fonts/VazirExtraLight.ttf +0 -0
- package/src/assets/fonts/VazirExtraLight.woff2 +0 -0
- package/src/assets/fonts/VazirLight.ttf +0 -0
- package/src/assets/fonts/VazirLight.woff2 +0 -0
- package/src/assets/fonts/VazirMedium.ttf +0 -0
- package/src/assets/fonts/VazirMedium.woff2 +0 -0
- package/src/assets/fonts/VazirRegular.ttf +0 -0
- package/src/assets/fonts/VazirRegular.woff2 +0 -0
- package/src/assets/fonts/VazirSemiBold.ttf +0 -0
- package/src/assets/fonts/VazirSemiBold.woff2 +0 -0
- package/src/assets/fonts/VazirThin.ttf +0 -0
- package/src/assets/fonts/VazirThin.woff2 +0 -0
- package/src/assets/styles/base.css +3 -5
- package/src/assets/fonts/Vazir.eot +0 -0
- package/src/assets/fonts/Vazir.ttf +0 -0
- package/src/assets/fonts/Vazir.woff +0 -0
- package/src/assets/fonts/Vazir.woff2 +0 -0
- package/src/assets/fonts/VazirBlack.eot +0 -0
- package/src/assets/fonts/VazirBlack.woff +0 -0
- package/src/assets/fonts/VazirBold.eot +0 -0
- package/src/assets/fonts/VazirBold.woff +0 -0
- package/src/assets/fonts/VazirLight.eot +0 -0
- package/src/assets/fonts/VazirLight.woff +0 -0
- package/src/assets/fonts/VazirMedium.eot +0 -0
- package/src/assets/fonts/VazirMedium.woff +0 -0
- package/src/assets/fonts/VazirThin.eot +0 -0
- package/src/assets/fonts/VazirThin.woff +0 -0
|
@@ -1674,6 +1674,14 @@
|
|
|
1674
1674
|
}, 500);
|
|
1675
1675
|
});
|
|
1676
1676
|
};
|
|
1677
|
+
FormClass.prototype.focus = function () {
|
|
1678
|
+
var i = this.inputs.find(function (x) { return !x.disabled && x.type !== exports.InputType.Label && x.type !== exports.InputType.Hidden &&
|
|
1679
|
+
x.type !== exports.InputType.Constant && x.type !== exports.InputType.Submit && x.type !== exports.InputType.Button && x.type !== exports.InputType.Icon &&
|
|
1680
|
+
x.type !== exports.InputType.Check; });
|
|
1681
|
+
if (i) {
|
|
1682
|
+
i.focus();
|
|
1683
|
+
}
|
|
1684
|
+
};
|
|
1677
1685
|
FormClass.prototype.submit = function (onSubmit) {
|
|
1678
1686
|
if (onSubmit === void 0) { onSubmit = null; }
|
|
1679
1687
|
new RequestClass(this.environment, this.l).postForm(this, onSubmit);
|
|
@@ -1695,6 +1703,9 @@
|
|
|
1695
1703
|
this.url = this.baseUrl;
|
|
1696
1704
|
this.setButtons(this.onTop, false);
|
|
1697
1705
|
this.clearInputs();
|
|
1706
|
+
if (this.onTop) {
|
|
1707
|
+
this.focus();
|
|
1708
|
+
}
|
|
1698
1709
|
};
|
|
1699
1710
|
FormClass.prototype.clearInputs = function () {
|
|
1700
1711
|
this.inputs.filter(function (x) { return x.type !== exports.InputType.Constant; }).forEach(function (inp) {
|
|
@@ -3110,12 +3121,7 @@
|
|
|
3110
3121
|
$__namespace('body').addClass('open-modal');
|
|
3111
3122
|
$__namespace('#' + this.id + 'Modal').fadeIn(300, function () {
|
|
3112
3123
|
if (_this.form != null) {
|
|
3113
|
-
|
|
3114
|
-
x.type !== exports.InputType.Constant && x.type !== exports.InputType.Submit && x.type !== exports.InputType.Button && x.type !== exports.InputType.Icon &&
|
|
3115
|
-
x.type !== exports.InputType.Check; });
|
|
3116
|
-
if (i) {
|
|
3117
|
-
i.focus();
|
|
3118
|
-
}
|
|
3124
|
+
_this.form.focus();
|
|
3119
3125
|
}
|
|
3120
3126
|
});
|
|
3121
3127
|
};
|
|
@@ -3747,6 +3753,7 @@
|
|
|
3747
3753
|
return true;
|
|
3748
3754
|
};
|
|
3749
3755
|
this.inp.clear = function () {
|
|
3756
|
+
_this.inp.error = null;
|
|
3750
3757
|
if (_this.inp.default) {
|
|
3751
3758
|
_this.inp.setValue(_this.inp.default, false);
|
|
3752
3759
|
}
|
|
@@ -6826,7 +6833,6 @@
|
|
|
6826
6833
|
return true;
|
|
6827
6834
|
};
|
|
6828
6835
|
this.inp.clear = function () {
|
|
6829
|
-
console.log(_this.inp.clear);
|
|
6830
6836
|
_this.inp.error = null;
|
|
6831
6837
|
_this.inp.setValue(null, false);
|
|
6832
6838
|
_this.changeType(exports.VehicleType.Car);
|
|
@@ -6849,7 +6855,51 @@
|
|
|
6849
6855
|
};
|
|
6850
6856
|
};
|
|
6851
6857
|
FormVehicleSearchComponent.prototype.changeType = function (t) {
|
|
6858
|
+
var _this = this;
|
|
6852
6859
|
this.type = t;
|
|
6860
|
+
if (this.wsAuth != null) {
|
|
6861
|
+
this.wsAuth.close();
|
|
6862
|
+
}
|
|
6863
|
+
if (t === exports.VehicleType.Fingerprint) {
|
|
6864
|
+
this.fingerprint.loading = true;
|
|
6865
|
+
this.fingerprint.placeholder = this.inp.l('LoadingText', 'Waiting');
|
|
6866
|
+
this.fingerprint.value = null;
|
|
6867
|
+
this.fingerprint.search = null;
|
|
6868
|
+
this.wsAuth = new WebSocket('ws://localhost:7890/Auth');
|
|
6869
|
+
this.wsAuth.onopen = function () {
|
|
6870
|
+
};
|
|
6871
|
+
this.wsAuth.onmessage = function (evt) {
|
|
6872
|
+
if (_this.wsAuth != null) {
|
|
6873
|
+
_this.wsAuth.close();
|
|
6874
|
+
}
|
|
6875
|
+
if (evt.data === 'Notfound') {
|
|
6876
|
+
HelperClass.addNotification(_this.inp.l('NotfoundTitle'));
|
|
6877
|
+
_this.fingerprint.placeholder = _this.inp.l('NotfoundTitle');
|
|
6878
|
+
_this.fingerprint.value = null;
|
|
6879
|
+
_this.fingerprint.search = null;
|
|
6880
|
+
_this.fingerprint.loading = false;
|
|
6881
|
+
}
|
|
6882
|
+
else if (evt.data.startsWith('Error')) {
|
|
6883
|
+
HelperClass.addNotification(evt.data);
|
|
6884
|
+
_this.fingerprint.placeholder = _this.inp.l('NotfoundTitle');
|
|
6885
|
+
_this.fingerprint.value = null;
|
|
6886
|
+
_this.fingerprint.search = null;
|
|
6887
|
+
_this.fingerprint.loading = false;
|
|
6888
|
+
}
|
|
6889
|
+
else {
|
|
6890
|
+
var user = JSON.parse(evt.data);
|
|
6891
|
+
_this.fingerprint.value = user.Id;
|
|
6892
|
+
_this.fingerprint.search = user.Name;
|
|
6893
|
+
_this.fingerprint.loading = false;
|
|
6894
|
+
}
|
|
6895
|
+
_this.wsAuth.close();
|
|
6896
|
+
_this.wsAuth = null;
|
|
6897
|
+
};
|
|
6898
|
+
this.wsAuth.onclose = function () {
|
|
6899
|
+
};
|
|
6900
|
+
}
|
|
6901
|
+
this.car.url = this.motor.url = this.carF.url = this.carG.url = this.driver.url = this.inp.url.replace('_{}', '_' + this.type);
|
|
6902
|
+
this.onFocusIn();
|
|
6853
6903
|
};
|
|
6854
6904
|
FormVehicleSearchComponent.prototype.onFocusIn = function () {
|
|
6855
6905
|
var _this = this;
|