@panneau/modal-form 4.0.50 → 4.0.55
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/index.d.ts +4 -10
- package/dist/index.js +77 -80
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { ForwardedRef } from 'react';
|
|
3
3
|
import { FormProps } from '@panneau/form';
|
|
4
|
-
import {
|
|
4
|
+
import { DialogModalProps } from '@panneau/modal-dialog';
|
|
5
5
|
|
|
6
|
-
interface FormModalProps extends Omit<FormProps, 'id' | 'title'>,
|
|
7
|
-
name?: string | null;
|
|
8
|
-
type?: string;
|
|
9
|
-
onCancel?: (() => void) | null;
|
|
10
|
-
onClosed?: (() => void) | null;
|
|
6
|
+
interface FormModalProps extends Omit<FormProps, 'id' | 'title'>, DialogModalProps {
|
|
11
7
|
withoutCloseOnComplete?: boolean;
|
|
12
|
-
className?: string | null;
|
|
13
|
-
children?: ReactNode | null;
|
|
14
8
|
formRef?: ForwardedRef<HTMLFormElement> | null;
|
|
15
9
|
}
|
|
16
|
-
declare function FormModal({ id, title,
|
|
10
|
+
declare function FormModal({ id, title, fields, size, visible, requestClose: customRequestClose, onComplete, onCancel, onClosed, withoutCloseOnComplete, className, children, formRef: customFormRef, submitButtonLabel, cancelButtonLabel, withCancelButton, withoutSubmitButton, ...props }: FormModalProps): react_jsx_runtime.JSX.Element;
|
|
17
11
|
|
|
18
12
|
export { FormModal as default };
|
|
19
13
|
export type { FormModalProps };
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import Dialog from '@panneau/modal-dialog';
|
|
|
7
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
function FormModal(t0) {
|
|
10
|
-
const $ = c(
|
|
10
|
+
const $ = c(53);
|
|
11
11
|
let id;
|
|
12
12
|
let props;
|
|
13
13
|
let t1;
|
|
@@ -30,10 +30,10 @@ function FormModal(t0) {
|
|
|
30
30
|
({
|
|
31
31
|
id,
|
|
32
32
|
title: t1,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
fields: t2,
|
|
34
|
+
size: t3,
|
|
35
|
+
visible: t4,
|
|
36
|
+
requestClose: t5,
|
|
37
37
|
onComplete: t6,
|
|
38
38
|
onCancel: t7,
|
|
39
39
|
onClosed: t8,
|
|
@@ -87,10 +87,10 @@ function FormModal(t0) {
|
|
|
87
87
|
t9 = $[18];
|
|
88
88
|
}
|
|
89
89
|
const title = t1 === undefined ? null : t1;
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
const
|
|
90
|
+
const fields = t2 === undefined ? null : t2;
|
|
91
|
+
const size = t3 === undefined ? "lg" : t3;
|
|
92
|
+
const visible = t4 === undefined ? null : t4;
|
|
93
|
+
const customRequestClose = t5 === undefined ? null : t5;
|
|
94
94
|
const onComplete = t6 === undefined ? null : t6;
|
|
95
95
|
const onCancel = t7 === undefined ? null : t7;
|
|
96
96
|
const onClosed = t8 === undefined ? null : t8;
|
|
@@ -105,138 +105,135 @@ function FormModal(t0) {
|
|
|
105
105
|
const [opened, setOpened] = useState(true);
|
|
106
106
|
const formRef = useRef(null);
|
|
107
107
|
let t17;
|
|
108
|
-
if ($[19]
|
|
109
|
-
t17 = () => {
|
|
108
|
+
if ($[19] !== customRequestClose) {
|
|
109
|
+
t17 = customRequestClose ?? (() => {
|
|
110
110
|
setOpened(false);
|
|
111
|
-
};
|
|
112
|
-
$[19] =
|
|
111
|
+
});
|
|
112
|
+
$[19] = customRequestClose;
|
|
113
|
+
$[20] = t17;
|
|
113
114
|
} else {
|
|
114
|
-
t17 = $[
|
|
115
|
+
t17 = $[20];
|
|
115
116
|
}
|
|
116
117
|
const requestClose = t17;
|
|
117
118
|
let t18;
|
|
118
|
-
if ($[
|
|
119
|
+
if ($[21] !== onCancel || $[22] !== requestClose) {
|
|
119
120
|
t18 = () => {
|
|
120
|
-
|
|
121
|
+
requestClose();
|
|
121
122
|
if (onCancel !== null) {
|
|
122
123
|
onCancel();
|
|
123
124
|
}
|
|
124
125
|
};
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
126
|
+
$[21] = onCancel;
|
|
127
|
+
$[22] = requestClose;
|
|
128
|
+
$[23] = t18;
|
|
127
129
|
} else {
|
|
128
|
-
t18 = $[
|
|
130
|
+
t18 = $[23];
|
|
129
131
|
}
|
|
130
132
|
const onFormCancel = t18;
|
|
131
133
|
let t19;
|
|
132
|
-
if ($[
|
|
134
|
+
if ($[24] !== onComplete || $[25] !== requestClose || $[26] !== withoutCloseOnComplete) {
|
|
133
135
|
t19 = value => {
|
|
134
136
|
if (!withoutCloseOnComplete) {
|
|
135
|
-
|
|
137
|
+
requestClose();
|
|
136
138
|
}
|
|
137
139
|
if (onComplete !== null) {
|
|
138
140
|
onComplete(value);
|
|
139
141
|
}
|
|
140
142
|
};
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
143
|
+
$[24] = onComplete;
|
|
144
|
+
$[25] = requestClose;
|
|
145
|
+
$[26] = withoutCloseOnComplete;
|
|
146
|
+
$[27] = t19;
|
|
144
147
|
} else {
|
|
145
|
-
t19 = $[
|
|
148
|
+
t19 = $[27];
|
|
146
149
|
}
|
|
147
150
|
const onFormComplete = t19;
|
|
148
151
|
let t20;
|
|
149
|
-
if ($[
|
|
152
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
150
153
|
t20 = () => {
|
|
151
154
|
if (formRef.current !== null) {
|
|
152
|
-
formRef.current.
|
|
155
|
+
formRef.current.requestSubmit();
|
|
153
156
|
}
|
|
154
157
|
};
|
|
155
|
-
$[
|
|
158
|
+
$[28] = t20;
|
|
156
159
|
} else {
|
|
157
|
-
t20 = $[
|
|
160
|
+
t20 = $[28];
|
|
158
161
|
}
|
|
159
162
|
const onClickSubmit = t20;
|
|
160
163
|
let t21;
|
|
161
|
-
if ($[
|
|
162
|
-
t21 = title ||
|
|
163
|
-
id: "smqUAV",
|
|
164
|
-
values: {
|
|
165
|
-
name
|
|
166
|
-
}
|
|
167
|
-
}) : /*#__PURE__*/jsx(FormattedMessage, {
|
|
164
|
+
if ($[29] !== title) {
|
|
165
|
+
t21 = title || /*#__PURE__*/jsx(FormattedMessage, {
|
|
168
166
|
id: "T/NPHK"
|
|
169
|
-
})
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[28] = t21;
|
|
167
|
+
});
|
|
168
|
+
$[29] = title;
|
|
169
|
+
$[30] = t21;
|
|
173
170
|
} else {
|
|
174
|
-
t21 = $[
|
|
171
|
+
t21 = $[30];
|
|
175
172
|
}
|
|
176
|
-
const t22 =
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
$[
|
|
173
|
+
const t22 = visible ?? opened;
|
|
174
|
+
const t23 = !withoutSubmitButton;
|
|
175
|
+
let t24;
|
|
176
|
+
if ($[31] !== customFormRef) {
|
|
177
|
+
t24 = mergeRefs(formRef, customFormRef);
|
|
178
|
+
$[31] = customFormRef;
|
|
179
|
+
$[32] = t24;
|
|
182
180
|
} else {
|
|
183
|
-
|
|
181
|
+
t24 = $[32];
|
|
184
182
|
}
|
|
185
|
-
let
|
|
186
|
-
if ($[
|
|
187
|
-
|
|
183
|
+
let t25;
|
|
184
|
+
if ($[33] !== fields || $[34] !== onFormCancel || $[35] !== onFormComplete || $[36] !== props || $[37] !== t24) {
|
|
185
|
+
t25 = /*#__PURE__*/jsx(Form, {
|
|
188
186
|
withoutActions: true,
|
|
189
187
|
...props,
|
|
190
|
-
ref:
|
|
188
|
+
ref: t24,
|
|
191
189
|
fields: fields,
|
|
192
|
-
type: type,
|
|
193
190
|
onComplete: onFormComplete,
|
|
194
191
|
onCancel: onFormCancel
|
|
195
192
|
});
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[35] = t23;
|
|
201
|
-
$[36] = type;
|
|
193
|
+
$[33] = fields;
|
|
194
|
+
$[34] = onFormCancel;
|
|
195
|
+
$[35] = onFormComplete;
|
|
196
|
+
$[36] = props;
|
|
202
197
|
$[37] = t24;
|
|
198
|
+
$[38] = t25;
|
|
203
199
|
} else {
|
|
204
|
-
|
|
200
|
+
t25 = $[38];
|
|
205
201
|
}
|
|
206
|
-
let
|
|
207
|
-
if ($[
|
|
208
|
-
|
|
202
|
+
let t26;
|
|
203
|
+
if ($[39] !== cancelButtonLabel || $[40] !== children || $[41] !== className || $[42] !== id || $[43] !== onClosed || $[44] !== requestClose || $[45] !== size || $[46] !== submitButtonLabel || $[47] !== t21 || $[48] !== t22 || $[49] !== t23 || $[50] !== t25 || $[51] !== withCancelButton) {
|
|
204
|
+
t26 = /*#__PURE__*/jsxs(Dialog, {
|
|
209
205
|
id: id,
|
|
210
206
|
title: t21,
|
|
211
207
|
size: size,
|
|
212
|
-
visible:
|
|
208
|
+
visible: t22,
|
|
213
209
|
withCancelButton: withCancelButton,
|
|
214
|
-
withSubmitButton:
|
|
210
|
+
withSubmitButton: t23,
|
|
215
211
|
requestClose: requestClose,
|
|
216
212
|
onClosed: onClosed,
|
|
217
213
|
onClickSubmit: onClickSubmit,
|
|
218
214
|
className: className,
|
|
219
215
|
submitButtonLabel: submitButtonLabel,
|
|
220
216
|
cancelButtonLabel: cancelButtonLabel,
|
|
221
|
-
children: [children,
|
|
217
|
+
children: [children, t25]
|
|
222
218
|
});
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[49] = withCancelButton;
|
|
219
|
+
$[39] = cancelButtonLabel;
|
|
220
|
+
$[40] = children;
|
|
221
|
+
$[41] = className;
|
|
222
|
+
$[42] = id;
|
|
223
|
+
$[43] = onClosed;
|
|
224
|
+
$[44] = requestClose;
|
|
225
|
+
$[45] = size;
|
|
226
|
+
$[46] = submitButtonLabel;
|
|
227
|
+
$[47] = t21;
|
|
228
|
+
$[48] = t22;
|
|
229
|
+
$[49] = t23;
|
|
235
230
|
$[50] = t25;
|
|
231
|
+
$[51] = withCancelButton;
|
|
232
|
+
$[52] = t26;
|
|
236
233
|
} else {
|
|
237
|
-
|
|
234
|
+
t26 = $[52];
|
|
238
235
|
}
|
|
239
|
-
return
|
|
236
|
+
return t26;
|
|
240
237
|
}
|
|
241
238
|
|
|
242
239
|
export { FormModal as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/modal-form",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.55",
|
|
4
4
|
"description": "Resource form modal",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@babel/runtime": "^7.28.6",
|
|
55
|
-
"@panneau/core": "^4.0.
|
|
56
|
-
"@panneau/form": "^4.0.
|
|
57
|
-
"@panneau/intl": "^4.0.
|
|
58
|
-
"@panneau/modal-dialog": "^4.0.
|
|
59
|
-
"@panneau/themes": "^4.0.
|
|
55
|
+
"@panneau/core": "^4.0.55",
|
|
56
|
+
"@panneau/form": "^4.0.55",
|
|
57
|
+
"@panneau/intl": "^4.0.55",
|
|
58
|
+
"@panneau/modal-dialog": "^4.0.55",
|
|
59
|
+
"@panneau/themes": "^4.0.55",
|
|
60
60
|
"classnames": "^2.5.1",
|
|
61
61
|
"lodash": "^4.17.21",
|
|
62
62
|
"react-intl": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^10.0.0"
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "1c9183567fc5bf98ba10fa57c63cf2ed2ae4a054"
|
|
68
68
|
}
|