dn-react-router-toolkit 0.6.7 → 0.6.10
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/dist/client/index.js +37 -16
- package/dist/client/index.mjs +38 -17
- package/dist/client/store_text_editor.d.mts +1 -1
- package/dist/client/store_text_editor.d.ts +1 -1
- package/dist/client/store_text_editor.js +37 -16
- package/dist/client/store_text_editor.mjs +38 -17
- package/dist/crud/crud_form.js +37 -16
- package/dist/crud/crud_form.mjs +38 -17
- package/dist/crud/crud_page.js +37 -16
- package/dist/crud/crud_page.mjs +38 -17
- package/dist/crud/index.js +37 -16
- package/dist/crud/index.mjs +38 -17
- package/package.json +3 -3
package/dist/client/index.js
CHANGED
|
@@ -128,28 +128,49 @@ function StoreTextEditor({
|
|
|
128
128
|
getter,
|
|
129
129
|
setter,
|
|
130
130
|
defaultValue,
|
|
131
|
+
ref,
|
|
131
132
|
...props
|
|
132
133
|
}) {
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
134
|
+
const controllerRef = (0, import_react4.useRef)(null);
|
|
135
|
+
(0, import_react4.useImperativeHandle)(
|
|
136
|
+
ref,
|
|
137
|
+
() => controllerRef.current,
|
|
138
|
+
[]
|
|
139
|
+
);
|
|
140
|
+
const { dispatch } = (0, import_react_store_input.useStoreController)(store, {
|
|
141
|
+
onSubscribe: (state) => {
|
|
142
|
+
const controller = controllerRef.current;
|
|
143
|
+
if (!controller) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const getResult = () => {
|
|
147
|
+
if (getter) {
|
|
148
|
+
return getter(state);
|
|
146
149
|
}
|
|
147
150
|
if (name) {
|
|
148
|
-
state[name]
|
|
151
|
+
return state[name];
|
|
149
152
|
}
|
|
153
|
+
return "";
|
|
154
|
+
};
|
|
155
|
+
const result = getResult();
|
|
156
|
+
if (controller.value !== result) {
|
|
157
|
+
controller.value = result;
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
onDispatch: (state) => {
|
|
161
|
+
const controller = controllerRef.current;
|
|
162
|
+
if (!controller) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (setter) {
|
|
166
|
+
setter(state, controller.value);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (name) {
|
|
170
|
+
state[name] = controller.value;
|
|
150
171
|
}
|
|
151
172
|
}
|
|
152
|
-
);
|
|
173
|
+
});
|
|
153
174
|
const getDefaultValue = () => {
|
|
154
175
|
if (getter) {
|
|
155
176
|
return getter(store.state);
|
|
@@ -159,11 +180,11 @@ function StoreTextEditor({
|
|
|
159
180
|
}
|
|
160
181
|
return void 0;
|
|
161
182
|
};
|
|
162
|
-
ref.current = props.controller || null;
|
|
163
183
|
return /* @__PURE__ */ import_react4.default.createElement(
|
|
164
184
|
import_dn_react_text_editor.TextEditor,
|
|
165
185
|
{
|
|
166
186
|
...props,
|
|
187
|
+
ref: controllerRef,
|
|
167
188
|
defaultValue: defaultValue ?? getDefaultValue(),
|
|
168
189
|
onChange: (e) => {
|
|
169
190
|
dispatch();
|
package/dist/client/index.mjs
CHANGED
|
@@ -83,35 +83,56 @@ import {
|
|
|
83
83
|
TextEditor
|
|
84
84
|
} from "dn-react-text-editor";
|
|
85
85
|
import { useStoreController } from "react-store-input";
|
|
86
|
-
import React3 from "react";
|
|
86
|
+
import React3, { useImperativeHandle, useRef } from "react";
|
|
87
87
|
function StoreTextEditor({
|
|
88
88
|
store,
|
|
89
89
|
name,
|
|
90
90
|
getter,
|
|
91
91
|
setter,
|
|
92
92
|
defaultValue,
|
|
93
|
+
ref,
|
|
93
94
|
...props
|
|
94
95
|
}) {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
96
|
+
const controllerRef = useRef(null);
|
|
97
|
+
useImperativeHandle(
|
|
98
|
+
ref,
|
|
99
|
+
() => controllerRef.current,
|
|
100
|
+
[]
|
|
101
|
+
);
|
|
102
|
+
const { dispatch } = useStoreController(store, {
|
|
103
|
+
onSubscribe: (state) => {
|
|
104
|
+
const controller = controllerRef.current;
|
|
105
|
+
if (!controller) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const getResult = () => {
|
|
109
|
+
if (getter) {
|
|
110
|
+
return getter(state);
|
|
108
111
|
}
|
|
109
112
|
if (name) {
|
|
110
|
-
state[name]
|
|
113
|
+
return state[name];
|
|
111
114
|
}
|
|
115
|
+
return "";
|
|
116
|
+
};
|
|
117
|
+
const result = getResult();
|
|
118
|
+
if (controller.value !== result) {
|
|
119
|
+
controller.value = result;
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
onDispatch: (state) => {
|
|
123
|
+
const controller = controllerRef.current;
|
|
124
|
+
if (!controller) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (setter) {
|
|
128
|
+
setter(state, controller.value);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (name) {
|
|
132
|
+
state[name] = controller.value;
|
|
112
133
|
}
|
|
113
134
|
}
|
|
114
|
-
);
|
|
135
|
+
});
|
|
115
136
|
const getDefaultValue = () => {
|
|
116
137
|
if (getter) {
|
|
117
138
|
return getter(store.state);
|
|
@@ -121,11 +142,11 @@ function StoreTextEditor({
|
|
|
121
142
|
}
|
|
122
143
|
return void 0;
|
|
123
144
|
};
|
|
124
|
-
ref.current = props.controller || null;
|
|
125
145
|
return /* @__PURE__ */ React3.createElement(
|
|
126
146
|
TextEditor,
|
|
127
147
|
{
|
|
128
148
|
...props,
|
|
149
|
+
ref: controllerRef,
|
|
129
150
|
defaultValue: defaultValue ?? getDefaultValue(),
|
|
130
151
|
onChange: (e) => {
|
|
131
152
|
dispatch();
|
|
@@ -8,6 +8,6 @@ type Props<TState> = {
|
|
|
8
8
|
getter?: (state: TState) => string;
|
|
9
9
|
setter?: (state: TState, value: string) => void;
|
|
10
10
|
} & TextEditorProps;
|
|
11
|
-
declare function StoreTextEditor<TState>({ store, name, getter, setter, defaultValue, ...props }: Props<TState>): React__default.JSX.Element;
|
|
11
|
+
declare function StoreTextEditor<TState>({ store, name, getter, setter, defaultValue, ref, ...props }: Props<TState>): React__default.JSX.Element;
|
|
12
12
|
|
|
13
13
|
export { StoreTextEditor };
|
|
@@ -8,6 +8,6 @@ type Props<TState> = {
|
|
|
8
8
|
getter?: (state: TState) => string;
|
|
9
9
|
setter?: (state: TState, value: string) => void;
|
|
10
10
|
} & TextEditorProps;
|
|
11
|
-
declare function StoreTextEditor<TState>({ store, name, getter, setter, defaultValue, ...props }: Props<TState>): React__default.JSX.Element;
|
|
11
|
+
declare function StoreTextEditor<TState>({ store, name, getter, setter, defaultValue, ref, ...props }: Props<TState>): React__default.JSX.Element;
|
|
12
12
|
|
|
13
13
|
export { StoreTextEditor };
|
|
@@ -42,28 +42,49 @@ function StoreTextEditor({
|
|
|
42
42
|
getter,
|
|
43
43
|
setter,
|
|
44
44
|
defaultValue,
|
|
45
|
+
ref,
|
|
45
46
|
...props
|
|
46
47
|
}) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
const controllerRef = (0, import_react.useRef)(null);
|
|
49
|
+
(0, import_react.useImperativeHandle)(
|
|
50
|
+
ref,
|
|
51
|
+
() => controllerRef.current,
|
|
52
|
+
[]
|
|
53
|
+
);
|
|
54
|
+
const { dispatch } = (0, import_react_store_input.useStoreController)(store, {
|
|
55
|
+
onSubscribe: (state) => {
|
|
56
|
+
const controller = controllerRef.current;
|
|
57
|
+
if (!controller) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const getResult = () => {
|
|
61
|
+
if (getter) {
|
|
62
|
+
return getter(state);
|
|
60
63
|
}
|
|
61
64
|
if (name) {
|
|
62
|
-
state[name]
|
|
65
|
+
return state[name];
|
|
63
66
|
}
|
|
67
|
+
return "";
|
|
68
|
+
};
|
|
69
|
+
const result = getResult();
|
|
70
|
+
if (controller.value !== result) {
|
|
71
|
+
controller.value = result;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
onDispatch: (state) => {
|
|
75
|
+
const controller = controllerRef.current;
|
|
76
|
+
if (!controller) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (setter) {
|
|
80
|
+
setter(state, controller.value);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (name) {
|
|
84
|
+
state[name] = controller.value;
|
|
64
85
|
}
|
|
65
86
|
}
|
|
66
|
-
);
|
|
87
|
+
});
|
|
67
88
|
const getDefaultValue = () => {
|
|
68
89
|
if (getter) {
|
|
69
90
|
return getter(store.state);
|
|
@@ -73,11 +94,11 @@ function StoreTextEditor({
|
|
|
73
94
|
}
|
|
74
95
|
return void 0;
|
|
75
96
|
};
|
|
76
|
-
ref.current = props.controller || null;
|
|
77
97
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
78
98
|
import_dn_react_text_editor.TextEditor,
|
|
79
99
|
{
|
|
80
100
|
...props,
|
|
101
|
+
ref: controllerRef,
|
|
81
102
|
defaultValue: defaultValue ?? getDefaultValue(),
|
|
82
103
|
onChange: (e) => {
|
|
83
104
|
dispatch();
|
|
@@ -3,35 +3,56 @@ import {
|
|
|
3
3
|
TextEditor
|
|
4
4
|
} from "dn-react-text-editor";
|
|
5
5
|
import { useStoreController } from "react-store-input";
|
|
6
|
-
import React from "react";
|
|
6
|
+
import React, { useImperativeHandle, useRef } from "react";
|
|
7
7
|
function StoreTextEditor({
|
|
8
8
|
store,
|
|
9
9
|
name,
|
|
10
10
|
getter,
|
|
11
11
|
setter,
|
|
12
12
|
defaultValue,
|
|
13
|
+
ref,
|
|
13
14
|
...props
|
|
14
15
|
}) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
const controllerRef = useRef(null);
|
|
17
|
+
useImperativeHandle(
|
|
18
|
+
ref,
|
|
19
|
+
() => controllerRef.current,
|
|
20
|
+
[]
|
|
21
|
+
);
|
|
22
|
+
const { dispatch } = useStoreController(store, {
|
|
23
|
+
onSubscribe: (state) => {
|
|
24
|
+
const controller = controllerRef.current;
|
|
25
|
+
if (!controller) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const getResult = () => {
|
|
29
|
+
if (getter) {
|
|
30
|
+
return getter(state);
|
|
28
31
|
}
|
|
29
32
|
if (name) {
|
|
30
|
-
state[name]
|
|
33
|
+
return state[name];
|
|
31
34
|
}
|
|
35
|
+
return "";
|
|
36
|
+
};
|
|
37
|
+
const result = getResult();
|
|
38
|
+
if (controller.value !== result) {
|
|
39
|
+
controller.value = result;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
onDispatch: (state) => {
|
|
43
|
+
const controller = controllerRef.current;
|
|
44
|
+
if (!controller) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (setter) {
|
|
48
|
+
setter(state, controller.value);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (name) {
|
|
52
|
+
state[name] = controller.value;
|
|
32
53
|
}
|
|
33
54
|
}
|
|
34
|
-
);
|
|
55
|
+
});
|
|
35
56
|
const getDefaultValue = () => {
|
|
36
57
|
if (getter) {
|
|
37
58
|
return getter(store.state);
|
|
@@ -41,11 +62,11 @@ function StoreTextEditor({
|
|
|
41
62
|
}
|
|
42
63
|
return void 0;
|
|
43
64
|
};
|
|
44
|
-
ref.current = props.controller || null;
|
|
45
65
|
return /* @__PURE__ */ React.createElement(
|
|
46
66
|
TextEditor,
|
|
47
67
|
{
|
|
48
68
|
...props,
|
|
69
|
+
ref: controllerRef,
|
|
49
70
|
defaultValue: defaultValue ?? getDefaultValue(),
|
|
50
71
|
onChange: (e) => {
|
|
51
72
|
dispatch();
|
package/dist/crud/crud_form.js
CHANGED
|
@@ -92,28 +92,49 @@ function StoreTextEditor({
|
|
|
92
92
|
getter,
|
|
93
93
|
setter,
|
|
94
94
|
defaultValue,
|
|
95
|
+
ref,
|
|
95
96
|
...props
|
|
96
97
|
}) {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
98
|
+
const controllerRef = (0, import_react7.useRef)(null);
|
|
99
|
+
(0, import_react7.useImperativeHandle)(
|
|
100
|
+
ref,
|
|
101
|
+
() => controllerRef.current,
|
|
102
|
+
[]
|
|
103
|
+
);
|
|
104
|
+
const { dispatch } = (0, import_react_store_input2.useStoreController)(store, {
|
|
105
|
+
onSubscribe: (state) => {
|
|
106
|
+
const controller = controllerRef.current;
|
|
107
|
+
if (!controller) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const getResult = () => {
|
|
111
|
+
if (getter) {
|
|
112
|
+
return getter(state);
|
|
110
113
|
}
|
|
111
114
|
if (name) {
|
|
112
|
-
state[name]
|
|
115
|
+
return state[name];
|
|
113
116
|
}
|
|
117
|
+
return "";
|
|
118
|
+
};
|
|
119
|
+
const result = getResult();
|
|
120
|
+
if (controller.value !== result) {
|
|
121
|
+
controller.value = result;
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
onDispatch: (state) => {
|
|
125
|
+
const controller = controllerRef.current;
|
|
126
|
+
if (!controller) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (setter) {
|
|
130
|
+
setter(state, controller.value);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (name) {
|
|
134
|
+
state[name] = controller.value;
|
|
114
135
|
}
|
|
115
136
|
}
|
|
116
|
-
);
|
|
137
|
+
});
|
|
117
138
|
const getDefaultValue = () => {
|
|
118
139
|
if (getter) {
|
|
119
140
|
return getter(store.state);
|
|
@@ -123,11 +144,11 @@ function StoreTextEditor({
|
|
|
123
144
|
}
|
|
124
145
|
return void 0;
|
|
125
146
|
};
|
|
126
|
-
ref.current = props.controller || null;
|
|
127
147
|
return /* @__PURE__ */ import_react7.default.createElement(
|
|
128
148
|
import_dn_react_text_editor.TextEditor,
|
|
129
149
|
{
|
|
130
150
|
...props,
|
|
151
|
+
ref: controllerRef,
|
|
131
152
|
defaultValue: defaultValue ?? getDefaultValue(),
|
|
132
153
|
onChange: (e) => {
|
|
133
154
|
dispatch();
|
package/dist/crud/crud_form.mjs
CHANGED
|
@@ -51,35 +51,56 @@ import {
|
|
|
51
51
|
TextEditor
|
|
52
52
|
} from "dn-react-text-editor";
|
|
53
53
|
import { useStoreController } from "react-store-input";
|
|
54
|
-
import React5 from "react";
|
|
54
|
+
import React5, { useImperativeHandle, useRef } from "react";
|
|
55
55
|
function StoreTextEditor({
|
|
56
56
|
store,
|
|
57
57
|
name,
|
|
58
58
|
getter,
|
|
59
59
|
setter,
|
|
60
60
|
defaultValue,
|
|
61
|
+
ref,
|
|
61
62
|
...props
|
|
62
63
|
}) {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
const controllerRef = useRef(null);
|
|
65
|
+
useImperativeHandle(
|
|
66
|
+
ref,
|
|
67
|
+
() => controllerRef.current,
|
|
68
|
+
[]
|
|
69
|
+
);
|
|
70
|
+
const { dispatch } = useStoreController(store, {
|
|
71
|
+
onSubscribe: (state) => {
|
|
72
|
+
const controller = controllerRef.current;
|
|
73
|
+
if (!controller) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const getResult = () => {
|
|
77
|
+
if (getter) {
|
|
78
|
+
return getter(state);
|
|
76
79
|
}
|
|
77
80
|
if (name) {
|
|
78
|
-
state[name]
|
|
81
|
+
return state[name];
|
|
79
82
|
}
|
|
83
|
+
return "";
|
|
84
|
+
};
|
|
85
|
+
const result = getResult();
|
|
86
|
+
if (controller.value !== result) {
|
|
87
|
+
controller.value = result;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
onDispatch: (state) => {
|
|
91
|
+
const controller = controllerRef.current;
|
|
92
|
+
if (!controller) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (setter) {
|
|
96
|
+
setter(state, controller.value);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (name) {
|
|
100
|
+
state[name] = controller.value;
|
|
80
101
|
}
|
|
81
102
|
}
|
|
82
|
-
);
|
|
103
|
+
});
|
|
83
104
|
const getDefaultValue = () => {
|
|
84
105
|
if (getter) {
|
|
85
106
|
return getter(store.state);
|
|
@@ -89,11 +110,11 @@ function StoreTextEditor({
|
|
|
89
110
|
}
|
|
90
111
|
return void 0;
|
|
91
112
|
};
|
|
92
|
-
ref.current = props.controller || null;
|
|
93
113
|
return /* @__PURE__ */ React5.createElement(
|
|
94
114
|
TextEditor,
|
|
95
115
|
{
|
|
96
116
|
...props,
|
|
117
|
+
ref: controllerRef,
|
|
97
118
|
defaultValue: defaultValue ?? getDefaultValue(),
|
|
98
119
|
onChange: (e) => {
|
|
99
120
|
dispatch();
|
package/dist/crud/crud_page.js
CHANGED
|
@@ -633,28 +633,49 @@ function StoreTextEditor({
|
|
|
633
633
|
getter,
|
|
634
634
|
setter,
|
|
635
635
|
defaultValue,
|
|
636
|
+
ref,
|
|
636
637
|
...props
|
|
637
638
|
}) {
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
639
|
+
const controllerRef = (0, import_react12.useRef)(null);
|
|
640
|
+
(0, import_react12.useImperativeHandle)(
|
|
641
|
+
ref,
|
|
642
|
+
() => controllerRef.current,
|
|
643
|
+
[]
|
|
644
|
+
);
|
|
645
|
+
const { dispatch } = (0, import_react_store_input2.useStoreController)(store, {
|
|
646
|
+
onSubscribe: (state) => {
|
|
647
|
+
const controller = controllerRef.current;
|
|
648
|
+
if (!controller) {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
const getResult = () => {
|
|
652
|
+
if (getter) {
|
|
653
|
+
return getter(state);
|
|
651
654
|
}
|
|
652
655
|
if (name) {
|
|
653
|
-
state[name]
|
|
656
|
+
return state[name];
|
|
654
657
|
}
|
|
658
|
+
return "";
|
|
659
|
+
};
|
|
660
|
+
const result = getResult();
|
|
661
|
+
if (controller.value !== result) {
|
|
662
|
+
controller.value = result;
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
onDispatch: (state) => {
|
|
666
|
+
const controller = controllerRef.current;
|
|
667
|
+
if (!controller) {
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
if (setter) {
|
|
671
|
+
setter(state, controller.value);
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
if (name) {
|
|
675
|
+
state[name] = controller.value;
|
|
655
676
|
}
|
|
656
677
|
}
|
|
657
|
-
);
|
|
678
|
+
});
|
|
658
679
|
const getDefaultValue = () => {
|
|
659
680
|
if (getter) {
|
|
660
681
|
return getter(store.state);
|
|
@@ -664,11 +685,11 @@ function StoreTextEditor({
|
|
|
664
685
|
}
|
|
665
686
|
return void 0;
|
|
666
687
|
};
|
|
667
|
-
ref.current = props.controller || null;
|
|
668
688
|
return /* @__PURE__ */ import_react12.default.createElement(
|
|
669
689
|
import_dn_react_text_editor.TextEditor,
|
|
670
690
|
{
|
|
671
691
|
...props,
|
|
692
|
+
ref: controllerRef,
|
|
672
693
|
defaultValue: defaultValue ?? getDefaultValue(),
|
|
673
694
|
onChange: (e) => {
|
|
674
695
|
dispatch();
|
package/dist/crud/crud_page.mjs
CHANGED
|
@@ -600,35 +600,56 @@ import {
|
|
|
600
600
|
TextEditor
|
|
601
601
|
} from "dn-react-text-editor";
|
|
602
602
|
import { useStoreController } from "react-store-input";
|
|
603
|
-
import React10 from "react";
|
|
603
|
+
import React10, { useImperativeHandle, useRef } from "react";
|
|
604
604
|
function StoreTextEditor({
|
|
605
605
|
store,
|
|
606
606
|
name,
|
|
607
607
|
getter,
|
|
608
608
|
setter,
|
|
609
609
|
defaultValue,
|
|
610
|
+
ref,
|
|
610
611
|
...props
|
|
611
612
|
}) {
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
613
|
+
const controllerRef = useRef(null);
|
|
614
|
+
useImperativeHandle(
|
|
615
|
+
ref,
|
|
616
|
+
() => controllerRef.current,
|
|
617
|
+
[]
|
|
618
|
+
);
|
|
619
|
+
const { dispatch } = useStoreController(store, {
|
|
620
|
+
onSubscribe: (state) => {
|
|
621
|
+
const controller = controllerRef.current;
|
|
622
|
+
if (!controller) {
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
const getResult = () => {
|
|
626
|
+
if (getter) {
|
|
627
|
+
return getter(state);
|
|
625
628
|
}
|
|
626
629
|
if (name) {
|
|
627
|
-
state[name]
|
|
630
|
+
return state[name];
|
|
628
631
|
}
|
|
632
|
+
return "";
|
|
633
|
+
};
|
|
634
|
+
const result = getResult();
|
|
635
|
+
if (controller.value !== result) {
|
|
636
|
+
controller.value = result;
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
onDispatch: (state) => {
|
|
640
|
+
const controller = controllerRef.current;
|
|
641
|
+
if (!controller) {
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
if (setter) {
|
|
645
|
+
setter(state, controller.value);
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
if (name) {
|
|
649
|
+
state[name] = controller.value;
|
|
629
650
|
}
|
|
630
651
|
}
|
|
631
|
-
);
|
|
652
|
+
});
|
|
632
653
|
const getDefaultValue = () => {
|
|
633
654
|
if (getter) {
|
|
634
655
|
return getter(store.state);
|
|
@@ -638,11 +659,11 @@ function StoreTextEditor({
|
|
|
638
659
|
}
|
|
639
660
|
return void 0;
|
|
640
661
|
};
|
|
641
|
-
ref.current = props.controller || null;
|
|
642
662
|
return /* @__PURE__ */ React10.createElement(
|
|
643
663
|
TextEditor,
|
|
644
664
|
{
|
|
645
665
|
...props,
|
|
666
|
+
ref: controllerRef,
|
|
646
667
|
defaultValue: defaultValue ?? getDefaultValue(),
|
|
647
668
|
onChange: (e) => {
|
|
648
669
|
dispatch();
|
package/dist/crud/index.js
CHANGED
|
@@ -7832,28 +7832,49 @@ function StoreTextEditor({
|
|
|
7832
7832
|
getter,
|
|
7833
7833
|
setter,
|
|
7834
7834
|
defaultValue,
|
|
7835
|
+
ref,
|
|
7835
7836
|
...props
|
|
7836
7837
|
}) {
|
|
7837
|
-
const
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7838
|
+
const controllerRef = (0, import_react7.useRef)(null);
|
|
7839
|
+
(0, import_react7.useImperativeHandle)(
|
|
7840
|
+
ref,
|
|
7841
|
+
() => controllerRef.current,
|
|
7842
|
+
[]
|
|
7843
|
+
);
|
|
7844
|
+
const { dispatch } = (0, import_react_store_input2.useStoreController)(store, {
|
|
7845
|
+
onSubscribe: (state) => {
|
|
7846
|
+
const controller = controllerRef.current;
|
|
7847
|
+
if (!controller) {
|
|
7848
|
+
return;
|
|
7849
|
+
}
|
|
7850
|
+
const getResult = () => {
|
|
7851
|
+
if (getter) {
|
|
7852
|
+
return getter(state);
|
|
7850
7853
|
}
|
|
7851
7854
|
if (name) {
|
|
7852
|
-
state[name]
|
|
7855
|
+
return state[name];
|
|
7853
7856
|
}
|
|
7857
|
+
return "";
|
|
7858
|
+
};
|
|
7859
|
+
const result = getResult();
|
|
7860
|
+
if (controller.value !== result) {
|
|
7861
|
+
controller.value = result;
|
|
7862
|
+
}
|
|
7863
|
+
},
|
|
7864
|
+
onDispatch: (state) => {
|
|
7865
|
+
const controller = controllerRef.current;
|
|
7866
|
+
if (!controller) {
|
|
7867
|
+
return;
|
|
7868
|
+
}
|
|
7869
|
+
if (setter) {
|
|
7870
|
+
setter(state, controller.value);
|
|
7871
|
+
return;
|
|
7872
|
+
}
|
|
7873
|
+
if (name) {
|
|
7874
|
+
state[name] = controller.value;
|
|
7854
7875
|
}
|
|
7855
7876
|
}
|
|
7856
|
-
);
|
|
7877
|
+
});
|
|
7857
7878
|
const getDefaultValue = () => {
|
|
7858
7879
|
if (getter) {
|
|
7859
7880
|
return getter(store.state);
|
|
@@ -7863,11 +7884,11 @@ function StoreTextEditor({
|
|
|
7863
7884
|
}
|
|
7864
7885
|
return void 0;
|
|
7865
7886
|
};
|
|
7866
|
-
ref.current = props.controller || null;
|
|
7867
7887
|
return /* @__PURE__ */ import_react7.default.createElement(
|
|
7868
7888
|
import_dn_react_text_editor.TextEditor,
|
|
7869
7889
|
{
|
|
7870
7890
|
...props,
|
|
7891
|
+
ref: controllerRef,
|
|
7871
7892
|
defaultValue: defaultValue ?? getDefaultValue(),
|
|
7872
7893
|
onChange: (e) => {
|
|
7873
7894
|
dispatch();
|
package/dist/crud/index.mjs
CHANGED
|
@@ -7808,35 +7808,56 @@ import {
|
|
|
7808
7808
|
TextEditor
|
|
7809
7809
|
} from "dn-react-text-editor";
|
|
7810
7810
|
import { useStoreController } from "react-store-input";
|
|
7811
|
-
import React5 from "react";
|
|
7811
|
+
import React5, { useImperativeHandle, useRef } from "react";
|
|
7812
7812
|
function StoreTextEditor({
|
|
7813
7813
|
store,
|
|
7814
7814
|
name,
|
|
7815
7815
|
getter,
|
|
7816
7816
|
setter,
|
|
7817
7817
|
defaultValue,
|
|
7818
|
+
ref,
|
|
7818
7819
|
...props
|
|
7819
7820
|
}) {
|
|
7820
|
-
const
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7821
|
+
const controllerRef = useRef(null);
|
|
7822
|
+
useImperativeHandle(
|
|
7823
|
+
ref,
|
|
7824
|
+
() => controllerRef.current,
|
|
7825
|
+
[]
|
|
7826
|
+
);
|
|
7827
|
+
const { dispatch } = useStoreController(store, {
|
|
7828
|
+
onSubscribe: (state) => {
|
|
7829
|
+
const controller = controllerRef.current;
|
|
7830
|
+
if (!controller) {
|
|
7831
|
+
return;
|
|
7832
|
+
}
|
|
7833
|
+
const getResult = () => {
|
|
7834
|
+
if (getter) {
|
|
7835
|
+
return getter(state);
|
|
7833
7836
|
}
|
|
7834
7837
|
if (name) {
|
|
7835
|
-
state[name]
|
|
7838
|
+
return state[name];
|
|
7836
7839
|
}
|
|
7840
|
+
return "";
|
|
7841
|
+
};
|
|
7842
|
+
const result = getResult();
|
|
7843
|
+
if (controller.value !== result) {
|
|
7844
|
+
controller.value = result;
|
|
7845
|
+
}
|
|
7846
|
+
},
|
|
7847
|
+
onDispatch: (state) => {
|
|
7848
|
+
const controller = controllerRef.current;
|
|
7849
|
+
if (!controller) {
|
|
7850
|
+
return;
|
|
7851
|
+
}
|
|
7852
|
+
if (setter) {
|
|
7853
|
+
setter(state, controller.value);
|
|
7854
|
+
return;
|
|
7855
|
+
}
|
|
7856
|
+
if (name) {
|
|
7857
|
+
state[name] = controller.value;
|
|
7837
7858
|
}
|
|
7838
7859
|
}
|
|
7839
|
-
);
|
|
7860
|
+
});
|
|
7840
7861
|
const getDefaultValue = () => {
|
|
7841
7862
|
if (getter) {
|
|
7842
7863
|
return getter(store.state);
|
|
@@ -7846,11 +7867,11 @@ function StoreTextEditor({
|
|
|
7846
7867
|
}
|
|
7847
7868
|
return void 0;
|
|
7848
7869
|
};
|
|
7849
|
-
ref.current = props.controller || null;
|
|
7850
7870
|
return /* @__PURE__ */ React5.createElement(
|
|
7851
7871
|
TextEditor,
|
|
7852
7872
|
{
|
|
7853
7873
|
...props,
|
|
7874
|
+
ref: controllerRef,
|
|
7854
7875
|
defaultValue: defaultValue ?? getDefaultValue(),
|
|
7855
7876
|
onChange: (e) => {
|
|
7856
7877
|
dispatch();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dn-react-router-toolkit",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
"typescript": "^5.7.3"
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"dn-react-text-editor": "^0.3.
|
|
89
|
+
"dn-react-text-editor": "^0.3.5",
|
|
90
90
|
"dn-react-toolkit": "^0.2.49",
|
|
91
91
|
"pg": "^8.16.3",
|
|
92
|
-
"react-store-input": "^0.1.
|
|
92
|
+
"react-store-input": "^0.1.9",
|
|
93
93
|
"uuid": "^13.0.0"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|