react-dialogger 1.1.39 → 1.1.40

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.
@@ -611,7 +611,9 @@ var DialogBase = /** @class */ (function (_super) {
611
611
  _this.render = function () {
612
612
  return _this.withBackdrop(_this._body, _this._header, _this._actions);
613
613
  };
614
- _this.state = __assign(__assign({}, _this._initialState), { fullscreenMode: false, isResizing: false, values: props.initialValues, inProcess: { inProcess: false } });
614
+ _this.state = __assign(__assign({}, _this._initialState), { fullscreenMode: false, isResizing: false,
615
+ /**@deprecated use FormikProps Values*/
616
+ values: props.initialValues, inProcess: { inProcess: false } });
615
617
  var defaultOptions = {
616
618
  base: {
617
619
  initialAnchor: {
@@ -742,30 +744,33 @@ var DialogBase = /** @class */ (function (_super) {
742
744
  configurable: true
743
745
  });
744
746
  DialogBase.prototype.setValues = function (values, callbackFn) {
745
- var _a;
746
- // const prevValues = {...this.state.values};
747
- //
748
- //
749
- // // this.setState( prevState => ({...prevState, values: {...prevValues, ...values}}) );
750
- // this.setState((prevState) => ({
751
- // ...prevState,
752
- // values: {...prevValues, ...values}
753
- // }), () => {
754
- // if( typeof callbackFn === 'function' ){
755
- // callbackFn();
756
- // }
757
- // });
758
- (_a = this._formikProps) === null || _a === void 0 ? void 0 : _a.setValues(values);
747
+ var prevValues = __assign({}, this.state.values);
748
+ // this.setState( prevState => ({...prevState, values: {...prevValues, ...values}}) );
749
+ this.setState(function (prevState) { return (__assign(__assign({}, prevState), { values: __assign(__assign({}, prevValues), values) })); }, function () {
750
+ if (typeof callbackFn === 'function') {
751
+ callbackFn();
752
+ }
753
+ });
754
+ // this._formikProps?.setValues(values);
759
755
  };
760
756
  DialogBase.prototype.setValue = function (key, value) {
761
- var _a;
762
- // this.setState( prevState => {
763
- //
764
- // const clonedVal = {...prevState.values};
765
- // clonedVal[key] = values;
766
- // return {...prevState, values: clonedVal}
767
- // });
768
- (_a = this._formikProps) === null || _a === void 0 ? void 0 : _a.setFieldValue(key, value);
757
+ this.setState(function (prevState) {
758
+ var clonedVal = __assign({}, prevState.values);
759
+ clonedVal[key] = value;
760
+ return __assign(__assign({}, prevState), { values: clonedVal });
761
+ });
762
+ // Cok mantikli Ama butun yapida zorluk cikrariyor
763
+ // Eger direct kullanilmak istenirse olusacak sorun
764
+ // Eget bir state icinde birden fazla domain kullaniliyor sadece bir domain sadece formikProps baglantisi varsa
765
+ // O zaman setValues dedigim de ilgili domain i guncellemek yerine buton props lar etki altina girer
766
+ // Ornek
767
+ // initialValues/values icinde iki domain var {order: ... project...}
768
+ // inputs formikProps ile direct baglanti kurabildigi icin order i ilgilendiren bir field artik order icindeki propla ulasamaz
769
+ // cunju values icinde order, project tanimlanmistir formikProps.values={order, project}
770
+ // Dogru bisekilde calismasi icin formikProps.values direct oreder field leri olmali {...} <- Order fields
771
+ // O sebepten values dialog state ile baglantili eget dialog icinde form kullanmak isterse m
772
+ // Bu Durumu sinirlandiriyor
773
+ // this._formikProps?.setFieldValue(key, value);
769
774
  };
770
775
  DialogBase.prototype.componentDidMount = function () {
771
776
  var _this = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dialogger",
3
- "version": "1.1.39",
3
+ "version": "1.1.40",
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",
@@ -8,6 +8,7 @@ export interface TBaseDialogState {
8
8
  [K: string]: any;
9
9
  }
10
10
  export interface BaseDialogState {
11
+ /**@deprecated use FormikProps Values*/
11
12
  values: DialogValues;
12
13
  inProcess: IInProcess;
13
14
  fullscreenMode?: boolean;