@panneau/modal-form 4.0.40-alpha.3 → 4.0.45
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 +3 -2
- package/dist/index.js +79 -72
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactNode, ForwardedRef } from 'react';
|
|
3
3
|
import { Field } from '@panneau/core';
|
|
4
4
|
|
|
5
5
|
interface ModalFormProps {
|
|
@@ -16,7 +16,8 @@ interface ModalFormProps {
|
|
|
16
16
|
withoutCloseOnComplete?: boolean;
|
|
17
17
|
className?: string | null;
|
|
18
18
|
children?: ReactNode | null;
|
|
19
|
+
formRef?: ForwardedRef<HTMLFormElement> | null;
|
|
19
20
|
}
|
|
20
|
-
declare function ModalForm({ id, title, name, fields, action, type, onComplete, onCancel, onClosed, submitButtonLabel, withoutCloseOnComplete, className, children, ...props }: ModalFormProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function ModalForm({ id, title, name, fields, action, type, onComplete, onCancel, onClosed, submitButtonLabel, withoutCloseOnComplete, className, children, formRef, ...props }: ModalFormProps): react_jsx_runtime.JSX.Element;
|
|
21
22
|
|
|
22
23
|
export { ModalForm as default };
|
package/dist/index.js
CHANGED
|
@@ -6,13 +6,14 @@ import Dialog from '@panneau/modal-dialog';
|
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
function ModalForm(t0) {
|
|
9
|
-
const $ = c(
|
|
9
|
+
const $ = c(42);
|
|
10
10
|
let id;
|
|
11
11
|
let props;
|
|
12
12
|
let t1;
|
|
13
13
|
let t10;
|
|
14
14
|
let t11;
|
|
15
15
|
let t12;
|
|
16
|
+
let t13;
|
|
16
17
|
let t2;
|
|
17
18
|
let t3;
|
|
18
19
|
let t4;
|
|
@@ -36,6 +37,7 @@ function ModalForm(t0) {
|
|
|
36
37
|
withoutCloseOnComplete: t10,
|
|
37
38
|
className: t11,
|
|
38
39
|
children: t12,
|
|
40
|
+
formRef: t13,
|
|
39
41
|
...props
|
|
40
42
|
} = t0);
|
|
41
43
|
$[0] = t0;
|
|
@@ -45,14 +47,15 @@ function ModalForm(t0) {
|
|
|
45
47
|
$[4] = t10;
|
|
46
48
|
$[5] = t11;
|
|
47
49
|
$[6] = t12;
|
|
48
|
-
$[7] =
|
|
49
|
-
$[8] =
|
|
50
|
-
$[9] =
|
|
51
|
-
$[10] =
|
|
52
|
-
$[11] =
|
|
53
|
-
$[12] =
|
|
54
|
-
$[13] =
|
|
55
|
-
$[14] =
|
|
50
|
+
$[7] = t13;
|
|
51
|
+
$[8] = t2;
|
|
52
|
+
$[9] = t3;
|
|
53
|
+
$[10] = t4;
|
|
54
|
+
$[11] = t5;
|
|
55
|
+
$[12] = t6;
|
|
56
|
+
$[13] = t7;
|
|
57
|
+
$[14] = t8;
|
|
58
|
+
$[15] = t9;
|
|
56
59
|
} else {
|
|
57
60
|
id = $[1];
|
|
58
61
|
props = $[2];
|
|
@@ -60,14 +63,15 @@ function ModalForm(t0) {
|
|
|
60
63
|
t10 = $[4];
|
|
61
64
|
t11 = $[5];
|
|
62
65
|
t12 = $[6];
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
t13 = $[7];
|
|
67
|
+
t2 = $[8];
|
|
68
|
+
t3 = $[9];
|
|
69
|
+
t4 = $[10];
|
|
70
|
+
t5 = $[11];
|
|
71
|
+
t6 = $[12];
|
|
72
|
+
t7 = $[13];
|
|
73
|
+
t8 = $[14];
|
|
74
|
+
t9 = $[15];
|
|
71
75
|
}
|
|
72
76
|
const title = t1 === undefined ? null : t1;
|
|
73
77
|
const name = t2 === undefined ? null : t2;
|
|
@@ -81,34 +85,35 @@ function ModalForm(t0) {
|
|
|
81
85
|
const withoutCloseOnComplete = t10 === undefined ? false : t10;
|
|
82
86
|
const className = t11 === undefined ? null : t11;
|
|
83
87
|
const children = t12 === undefined ? null : t12;
|
|
88
|
+
const formRef = t13 === undefined ? null : t13;
|
|
84
89
|
const [opened, setOpened] = useState(true);
|
|
85
|
-
let
|
|
86
|
-
if ($[
|
|
87
|
-
|
|
90
|
+
let t14;
|
|
91
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
92
|
+
t14 = () => {
|
|
88
93
|
setOpened(false);
|
|
89
94
|
};
|
|
90
|
-
$[
|
|
95
|
+
$[16] = t14;
|
|
91
96
|
} else {
|
|
92
|
-
|
|
97
|
+
t14 = $[16];
|
|
93
98
|
}
|
|
94
|
-
const requestClose =
|
|
95
|
-
let
|
|
96
|
-
if ($[
|
|
97
|
-
|
|
99
|
+
const requestClose = t14;
|
|
100
|
+
let t15;
|
|
101
|
+
if ($[17] !== onCancel) {
|
|
102
|
+
t15 = () => {
|
|
98
103
|
setOpened(false);
|
|
99
104
|
if (onCancel !== null) {
|
|
100
105
|
onCancel();
|
|
101
106
|
}
|
|
102
107
|
};
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
108
|
+
$[17] = onCancel;
|
|
109
|
+
$[18] = t15;
|
|
105
110
|
} else {
|
|
106
|
-
|
|
111
|
+
t15 = $[18];
|
|
107
112
|
}
|
|
108
|
-
const onFormCancel =
|
|
109
|
-
let
|
|
110
|
-
if ($[
|
|
111
|
-
|
|
113
|
+
const onFormCancel = t15;
|
|
114
|
+
let t16;
|
|
115
|
+
if ($[19] !== onComplete || $[20] !== withoutCloseOnComplete) {
|
|
116
|
+
t16 = value => {
|
|
112
117
|
if (!withoutCloseOnComplete) {
|
|
113
118
|
setOpened(false);
|
|
114
119
|
}
|
|
@@ -116,16 +121,16 @@ function ModalForm(t0) {
|
|
|
116
121
|
onComplete(value);
|
|
117
122
|
}
|
|
118
123
|
};
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
124
|
+
$[19] = onComplete;
|
|
125
|
+
$[20] = withoutCloseOnComplete;
|
|
126
|
+
$[21] = t16;
|
|
122
127
|
} else {
|
|
123
|
-
|
|
128
|
+
t16 = $[21];
|
|
124
129
|
}
|
|
125
|
-
const onFormComplete =
|
|
126
|
-
let
|
|
127
|
-
if ($[
|
|
128
|
-
|
|
130
|
+
const onFormComplete = t16;
|
|
131
|
+
let t17;
|
|
132
|
+
if ($[22] !== name || $[23] !== title) {
|
|
133
|
+
t17 = title || (name !== null ? /*#__PURE__*/jsx(FormattedMessage, {
|
|
129
134
|
id: "smqUAV",
|
|
130
135
|
values: {
|
|
131
136
|
name
|
|
@@ -133,16 +138,17 @@ function ModalForm(t0) {
|
|
|
133
138
|
}) : /*#__PURE__*/jsx(FormattedMessage, {
|
|
134
139
|
id: "T/NPHK"
|
|
135
140
|
}));
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
141
|
+
$[22] = name;
|
|
142
|
+
$[23] = title;
|
|
143
|
+
$[24] = t17;
|
|
139
144
|
} else {
|
|
140
|
-
|
|
145
|
+
t17 = $[24];
|
|
141
146
|
}
|
|
142
|
-
let
|
|
143
|
-
if ($[
|
|
144
|
-
|
|
147
|
+
let t18;
|
|
148
|
+
if ($[25] !== action || $[26] !== fields || $[27] !== formRef || $[28] !== onFormCancel || $[29] !== onFormComplete || $[30] !== props || $[31] !== submitButtonLabel || $[32] !== type) {
|
|
149
|
+
t18 = /*#__PURE__*/jsx(Form, {
|
|
145
150
|
...props,
|
|
151
|
+
ref: formRef,
|
|
146
152
|
fields: fields,
|
|
147
153
|
action: action,
|
|
148
154
|
type: type,
|
|
@@ -151,41 +157,42 @@ function ModalForm(t0) {
|
|
|
151
157
|
onCancel: onFormCancel,
|
|
152
158
|
submitButtonLabel: submitButtonLabel
|
|
153
159
|
});
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
160
|
+
$[25] = action;
|
|
161
|
+
$[26] = fields;
|
|
162
|
+
$[27] = formRef;
|
|
163
|
+
$[28] = onFormCancel;
|
|
164
|
+
$[29] = onFormComplete;
|
|
165
|
+
$[30] = props;
|
|
166
|
+
$[31] = submitButtonLabel;
|
|
167
|
+
$[32] = type;
|
|
168
|
+
$[33] = t18;
|
|
162
169
|
} else {
|
|
163
|
-
|
|
170
|
+
t18 = $[33];
|
|
164
171
|
}
|
|
165
|
-
let
|
|
166
|
-
if ($[
|
|
167
|
-
|
|
172
|
+
let t19;
|
|
173
|
+
if ($[34] !== children || $[35] !== className || $[36] !== id || $[37] !== onClosed || $[38] !== opened || $[39] !== t17 || $[40] !== t18) {
|
|
174
|
+
t19 = /*#__PURE__*/jsxs(Dialog, {
|
|
168
175
|
id: id,
|
|
169
|
-
title:
|
|
176
|
+
title: t17,
|
|
170
177
|
size: "lg",
|
|
171
178
|
visible: opened,
|
|
172
179
|
requestClose: requestClose,
|
|
173
180
|
onClosed: onClosed,
|
|
174
181
|
className: className,
|
|
175
|
-
children: [children,
|
|
182
|
+
children: [children, t18]
|
|
176
183
|
});
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
184
|
+
$[34] = children;
|
|
185
|
+
$[35] = className;
|
|
186
|
+
$[36] = id;
|
|
187
|
+
$[37] = onClosed;
|
|
188
|
+
$[38] = opened;
|
|
189
|
+
$[39] = t17;
|
|
190
|
+
$[40] = t18;
|
|
191
|
+
$[41] = t19;
|
|
185
192
|
} else {
|
|
186
|
-
|
|
193
|
+
t19 = $[41];
|
|
187
194
|
}
|
|
188
|
-
return
|
|
195
|
+
return t19;
|
|
189
196
|
}
|
|
190
197
|
|
|
191
198
|
export { ModalForm 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.45",
|
|
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.41",
|
|
56
|
+
"@panneau/form": "^4.0.45",
|
|
57
|
+
"@panneau/intl": "^4.0.45",
|
|
58
|
+
"@panneau/modal-dialog": "^4.0.41",
|
|
59
|
+
"@panneau/themes": "^4.0.41",
|
|
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": "33c9c717de67f2a018289e91ea16daa2d5925cd2"
|
|
68
68
|
}
|