react-dialogger 1.1.38 → 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.
- package/components/DialogBase.d.ts +2 -2
- package/components/DialogBase.js +28 -23
- package/package.json +1 -1
- package/types/DialogTypes.d.ts +1 -0
- package/types/types.d.ts +1 -1
|
@@ -79,8 +79,8 @@ declare class DialogBase<Values extends Record<string, any>> extends Component<B
|
|
|
79
79
|
get formikProps(): FormikProps<any>;
|
|
80
80
|
set formikProps(value: FormikProps<any>);
|
|
81
81
|
get formikValidate(): Promise<FormikProps<any>>;
|
|
82
|
-
get values():
|
|
83
|
-
setValues(values:
|
|
82
|
+
get values(): DialogValues;
|
|
83
|
+
setValues(values: DialogValues, callbackFn?: () => void): void;
|
|
84
84
|
setValue(key: string, value: any): void;
|
|
85
85
|
private dialogAutoPos;
|
|
86
86
|
componentDidMount(): void;
|
package/components/DialogBase.js
CHANGED
|
@@ -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,
|
|
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
|
|
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);
|
|
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
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
//
|
|
767
|
-
//
|
|
768
|
-
|
|
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.
|
|
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",
|
package/types/DialogTypes.d.ts
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export type TUserProps = {
|
|
|
35
35
|
[K: string]: any;
|
|
36
36
|
};
|
|
37
37
|
export type TValues = Record<string, any>;
|
|
38
|
-
export type DialogValues =
|
|
38
|
+
export type DialogValues = Partial<TValues>;
|
|
39
39
|
export interface BaseDialogDOMRect {
|
|
40
40
|
height?: number;
|
|
41
41
|
width?: number;
|