react-dialogger 1.1.39 → 1.1.41
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/components/DialogBase.js +30 -23
- package/package.json +1 -1
- package/types/DialogTypes.d.ts +1 -0
package/components/DialogBase.js
CHANGED
|
@@ -532,11 +532,13 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
532
532
|
style: action.options.style, baseStyle: _this._dialogOptions.base.actions.baseStyle, fontFamily: _this._fontFamily, stateListener: action._stateListener }, index.toString());
|
|
533
533
|
}) });
|
|
534
534
|
};
|
|
535
|
+
// TODO Content
|
|
535
536
|
_this.Content = function (_a) {
|
|
536
537
|
var _b;
|
|
537
538
|
var _c, _d;
|
|
538
539
|
var body = _a.body, header = _a.header, actions = _a.actions;
|
|
539
540
|
_this._formikProps = (0, formik_1.useFormik)({
|
|
541
|
+
enableReinitialize: true,
|
|
540
542
|
initialValues: _this._initialValues,
|
|
541
543
|
onSubmit: function (values, formikHelpers) {
|
|
542
544
|
// No Necessary
|
|
@@ -611,7 +613,9 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
611
613
|
_this.render = function () {
|
|
612
614
|
return _this.withBackdrop(_this._body, _this._header, _this._actions);
|
|
613
615
|
};
|
|
614
|
-
_this.state = __assign(__assign({}, _this._initialState), { fullscreenMode: false, isResizing: false,
|
|
616
|
+
_this.state = __assign(__assign({}, _this._initialState), { fullscreenMode: false, isResizing: false,
|
|
617
|
+
/**@deprecated use FormikProps Values*/
|
|
618
|
+
values: props.initialValues, inProcess: { inProcess: false } });
|
|
615
619
|
var defaultOptions = {
|
|
616
620
|
base: {
|
|
617
621
|
initialAnchor: {
|
|
@@ -742,30 +746,33 @@ var DialogBase = /** @class */ (function (_super) {
|
|
|
742
746
|
configurable: true
|
|
743
747
|
});
|
|
744
748
|
DialogBase.prototype.setValues = function (values, callbackFn) {
|
|
745
|
-
var
|
|
746
|
-
//
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
//
|
|
753
|
-
// }), () => {
|
|
754
|
-
// if( typeof callbackFn === 'function' ){
|
|
755
|
-
// callbackFn();
|
|
756
|
-
// }
|
|
757
|
-
// });
|
|
758
|
-
(_a = this._formikProps) === null || _a === void 0 ? void 0 : _a.setValues(values);
|
|
749
|
+
var prevValues = __assign({}, this.state.values);
|
|
750
|
+
// this.setState( prevState => ({...prevState, values: {...prevValues, ...values}}) );
|
|
751
|
+
this.setState(function (prevState) { return (__assign(__assign({}, prevState), { values: __assign(__assign({}, prevValues), values) })); }, function () {
|
|
752
|
+
if (typeof callbackFn === 'function') {
|
|
753
|
+
callbackFn();
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
// this._formikProps?.setValues(values);
|
|
759
757
|
};
|
|
760
758
|
DialogBase.prototype.setValue = function (key, value) {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
//
|
|
767
|
-
//
|
|
768
|
-
|
|
759
|
+
this.setState(function (prevState) {
|
|
760
|
+
var clonedVal = __assign({}, prevState.values);
|
|
761
|
+
clonedVal[key] = value;
|
|
762
|
+
return __assign(__assign({}, prevState), { values: clonedVal });
|
|
763
|
+
});
|
|
764
|
+
// Cok mantikli Ama butun yapida zorluk cikrariyor
|
|
765
|
+
// Eger direct kullanilmak istenirse olusacak sorun
|
|
766
|
+
// Eget bir state icinde birden fazla domain kullaniliyor sadece bir domain sadece formikProps baglantisi varsa
|
|
767
|
+
// O zaman setValues dedigim de ilgili domain i guncellemek yerine buton props lar etki altina girer
|
|
768
|
+
// Ornek
|
|
769
|
+
// initialValues/values icinde iki domain var {order: ... project...}
|
|
770
|
+
// inputs formikProps ile direct baglanti kurabildigi icin order i ilgilendiren bir field artik order icindeki propla ulasamaz
|
|
771
|
+
// cunju values icinde order, project tanimlanmistir formikProps.values={order, project}
|
|
772
|
+
// Dogru bisekilde calismasi icin formikProps.values direct oreder field leri olmali {...} <- Order fields
|
|
773
|
+
// O sebepten values dialog state ile baglantili eget dialog icinde form kullanmak isterse m
|
|
774
|
+
// Bu Durumu sinirlandiriyor
|
|
775
|
+
// this._formikProps?.setFieldValue(key, value);
|
|
769
776
|
};
|
|
770
777
|
DialogBase.prototype.componentDidMount = function () {
|
|
771
778
|
var _this = this;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-dialogger",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.41",
|
|
4
4
|
"description": "This package is a continuation of the react-araci package. Due to an error, react-araci was removed, and it has been decided to continue under the new package name react-dialogger",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Sueleyman Topaloglu",
|