@panneau/modal-dialog 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 CHANGED
@@ -6,7 +6,7 @@ import { ModalProps } from '@panneau/element-modal';
6
6
  interface DialogModalProps extends Omit<ModalProps, 'title'> {
7
7
  id: string;
8
8
  title?: Label | null;
9
- size?: 'lg' | 'sm' | null;
9
+ size?: 'xl' | 'lg' | 'sm' | null;
10
10
  header?: ReactNode | null;
11
11
  children?: ReactNode | null;
12
12
  footer?: ReactNode | null;
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { c } from 'react/compiler-runtime';
1
2
  import classNames from 'classnames';
2
3
  import { FormattedMessage } from 'react-intl';
3
4
  import { isMessage } from '@panneau/core/utils';
@@ -7,95 +8,307 @@ import Label from '@panneau/element-label';
7
8
  import Modal from '@panneau/element-modal';
8
9
  import { jsx, jsxs } from 'react/jsx-runtime';
9
10
 
10
- function DialogModal({
11
- id,
12
- title = null,
13
- size = null,
14
- header = null,
15
- children = null,
16
- buttons = null,
17
- buttonsSize = null,
18
- submitButtonLabel = null,
19
- cancelButtonLabel = null,
20
- cancelButton = null,
21
- submitButton = null,
22
- footer = null,
23
- requestClose = null,
24
- withoutClose = false,
25
- withCloseOutside = false,
26
- className = null,
27
- headerClassName = null,
28
- bodyClassName = null,
29
- footerClassName = null,
30
- buttonsClassName = null,
31
- withCancelButton = false,
32
- withSubmitButton = false,
33
- onClickCancel = null,
34
- onClickSubmit = null,
35
- ...props
36
- }) {
37
- const onCloseButtonOutside = header === null && title === null || withCloseOutside;
38
- const finalButtons = buttons || [withCancelButton ? {
39
- label: cancelButtonLabel ?? /*#__PURE__*/jsx(FormattedMessage, {
40
- id: "PyxZY2"
41
- }),
42
- onClick: onClickCancel || requestClose || undefined,
43
- theme: 'secondary',
44
- ...cancelButton
45
- } : null, withSubmitButton ? {
46
- label: submitButtonLabel ?? /*#__PURE__*/jsx(FormattedMessage, {
47
- id: "R1HYj0"
48
- }),
49
- theme: 'primary',
50
- onClick: onClickSubmit || undefined,
51
- ...submitButton
52
- } : null].filter(button => button !== null);
11
+ function DialogModal(t0) {
12
+ const $ = c(75);
13
+ let id;
14
+ let props;
15
+ let t1;
16
+ let t10;
17
+ let t11;
18
+ let t12;
19
+ let t13;
20
+ let t14;
21
+ let t15;
22
+ let t16;
23
+ let t17;
24
+ let t18;
25
+ let t19;
26
+ let t2;
27
+ let t20;
28
+ let t21;
29
+ let t22;
30
+ let t23;
31
+ let t3;
32
+ let t4;
33
+ let t5;
34
+ let t6;
35
+ let t7;
36
+ let t8;
37
+ let t9;
38
+ if ($[0] !== t0) {
39
+ ({
40
+ id,
41
+ title: t1,
42
+ size: t2,
43
+ header: t3,
44
+ children: t4,
45
+ buttons: t5,
46
+ buttonsSize: t6,
47
+ submitButtonLabel: t7,
48
+ cancelButtonLabel: t8,
49
+ cancelButton: t9,
50
+ submitButton: t10,
51
+ footer: t11,
52
+ requestClose: t12,
53
+ withoutClose: t13,
54
+ withCloseOutside: t14,
55
+ className: t15,
56
+ headerClassName: t16,
57
+ bodyClassName: t17,
58
+ footerClassName: t18,
59
+ buttonsClassName: t19,
60
+ withCancelButton: t20,
61
+ withSubmitButton: t21,
62
+ onClickCancel: t22,
63
+ onClickSubmit: t23,
64
+ ...props
65
+ } = t0);
66
+ $[0] = t0;
67
+ $[1] = id;
68
+ $[2] = props;
69
+ $[3] = t1;
70
+ $[4] = t10;
71
+ $[5] = t11;
72
+ $[6] = t12;
73
+ $[7] = t13;
74
+ $[8] = t14;
75
+ $[9] = t15;
76
+ $[10] = t16;
77
+ $[11] = t17;
78
+ $[12] = t18;
79
+ $[13] = t19;
80
+ $[14] = t2;
81
+ $[15] = t20;
82
+ $[16] = t21;
83
+ $[17] = t22;
84
+ $[18] = t23;
85
+ $[19] = t3;
86
+ $[20] = t4;
87
+ $[21] = t5;
88
+ $[22] = t6;
89
+ $[23] = t7;
90
+ $[24] = t8;
91
+ $[25] = t9;
92
+ } else {
93
+ id = $[1];
94
+ props = $[2];
95
+ t1 = $[3];
96
+ t10 = $[4];
97
+ t11 = $[5];
98
+ t12 = $[6];
99
+ t13 = $[7];
100
+ t14 = $[8];
101
+ t15 = $[9];
102
+ t16 = $[10];
103
+ t17 = $[11];
104
+ t18 = $[12];
105
+ t19 = $[13];
106
+ t2 = $[14];
107
+ t20 = $[15];
108
+ t21 = $[16];
109
+ t22 = $[17];
110
+ t23 = $[18];
111
+ t3 = $[19];
112
+ t4 = $[20];
113
+ t5 = $[21];
114
+ t6 = $[22];
115
+ t7 = $[23];
116
+ t8 = $[24];
117
+ t9 = $[25];
118
+ }
119
+ const title = t1 === undefined ? null : t1;
120
+ const size = t2 === undefined ? null : t2;
121
+ const header = t3 === undefined ? null : t3;
122
+ const children = t4 === undefined ? null : t4;
123
+ const buttons = t5 === undefined ? null : t5;
124
+ const buttonsSize = t6 === undefined ? null : t6;
125
+ const submitButtonLabel = t7 === undefined ? null : t7;
126
+ const cancelButtonLabel = t8 === undefined ? null : t8;
127
+ const cancelButton = t9 === undefined ? null : t9;
128
+ const submitButton = t10 === undefined ? null : t10;
129
+ const footer = t11 === undefined ? null : t11;
130
+ const requestClose = t12 === undefined ? null : t12;
131
+ const withoutClose = t13 === undefined ? false : t13;
132
+ const withCloseOutside = t14 === undefined ? false : t14;
133
+ const className = t15 === undefined ? null : t15;
134
+ const headerClassName = t16 === undefined ? null : t16;
135
+ const bodyClassName = t17 === undefined ? null : t17;
136
+ const footerClassName = t18 === undefined ? null : t18;
137
+ const buttonsClassName = t19 === undefined ? null : t19;
138
+ const withCancelButton = t20 === undefined ? false : t20;
139
+ const withSubmitButton = t21 === undefined ? false : t21;
140
+ const onClickCancel = t22 === undefined ? null : t22;
141
+ const onClickSubmit = t23 === undefined ? null : t23;
142
+ let t24;
143
+ if ($[26] !== buttons || $[27] !== cancelButton || $[28] !== cancelButtonLabel || $[29] !== onClickCancel || $[30] !== onClickSubmit || $[31] !== requestClose || $[32] !== submitButton || $[33] !== submitButtonLabel || $[34] !== withCancelButton || $[35] !== withSubmitButton) {
144
+ t24 = buttons || [withCancelButton ? {
145
+ label: cancelButtonLabel ?? /*#__PURE__*/jsx(FormattedMessage, {
146
+ id: "PyxZY2"
147
+ }),
148
+ onClick: onClickCancel || requestClose || undefined,
149
+ theme: "secondary",
150
+ ...cancelButton
151
+ } : null, withSubmitButton ? {
152
+ label: submitButtonLabel ?? /*#__PURE__*/jsx(FormattedMessage, {
153
+ id: "R1HYj0"
154
+ }),
155
+ theme: "primary",
156
+ onClick: onClickSubmit || undefined,
157
+ ...submitButton
158
+ } : null].filter(_temp);
159
+ $[26] = buttons;
160
+ $[27] = cancelButton;
161
+ $[28] = cancelButtonLabel;
162
+ $[29] = onClickCancel;
163
+ $[30] = onClickSubmit;
164
+ $[31] = requestClose;
165
+ $[32] = submitButton;
166
+ $[33] = submitButtonLabel;
167
+ $[34] = withCancelButton;
168
+ $[35] = withSubmitButton;
169
+ $[36] = t24;
170
+ } else {
171
+ t24 = $[36];
172
+ }
173
+ const finalButtons = t24;
53
174
  const hasButtons = finalButtons !== null && finalButtons.length > 0;
54
- return /*#__PURE__*/jsx(Modal, {
55
- id: id,
56
- requestClose: requestClose,
57
- ...props,
58
- children: /*#__PURE__*/jsx("div", {
59
- className: classNames(['modal-dialog', {
60
- [`modal-${size}`]: size !== null
61
- }, className]),
175
+ const t25 = size !== null ? `modal-${size}` : null;
176
+ let t26;
177
+ if ($[37] !== className || $[38] !== t25) {
178
+ t26 = classNames(["modal-dialog", t25, className]);
179
+ $[37] = className;
180
+ $[38] = t25;
181
+ $[39] = t26;
182
+ } else {
183
+ t26 = $[39];
184
+ }
185
+ let t27;
186
+ if ($[40] !== requestClose || $[41] !== withCloseOutside || $[42] !== withoutClose) {
187
+ t27 = withCloseOutside && !withoutClose ? /*#__PURE__*/jsx(Button, {
188
+ type: "button",
189
+ className: classNames(["btn", "btn-close", "bg-light", "position-absolute", "start-100", "ms-1"]),
190
+ "aria-label": "Close",
191
+ onClick: requestClose
192
+ }) : null;
193
+ $[40] = requestClose;
194
+ $[41] = withCloseOutside;
195
+ $[42] = withoutClose;
196
+ $[43] = t27;
197
+ } else {
198
+ t27 = $[43];
199
+ }
200
+ let t28;
201
+ if ($[44] !== header || $[45] !== headerClassName || $[46] !== requestClose || $[47] !== title || $[48] !== withoutClose) {
202
+ t28 = header !== null ? header : /*#__PURE__*/jsxs("div", {
203
+ className: classNames("modal-header py-2", [headerClassName]),
204
+ children: [title !== null ? /*#__PURE__*/jsx("h5", {
205
+ className: "modal-title pe-2",
206
+ children: isMessage(title) ? /*#__PURE__*/jsx(Label, {
207
+ children: title
208
+ }) : title
209
+ }) : null, !withoutClose ? /*#__PURE__*/jsx(Button, {
210
+ type: "button",
211
+ className: "btn-close",
212
+ "aria-label": "Close",
213
+ onClick: requestClose
214
+ }) : null]
215
+ });
216
+ $[44] = header;
217
+ $[45] = headerClassName;
218
+ $[46] = requestClose;
219
+ $[47] = title;
220
+ $[48] = withoutClose;
221
+ $[49] = t28;
222
+ } else {
223
+ t28 = $[49];
224
+ }
225
+ let t29;
226
+ if ($[50] !== bodyClassName) {
227
+ t29 = classNames(["modal-body", bodyClassName]);
228
+ $[50] = bodyClassName;
229
+ $[51] = t29;
230
+ } else {
231
+ t29 = $[51];
232
+ }
233
+ let t30;
234
+ if ($[52] !== children || $[53] !== t29) {
235
+ t30 = /*#__PURE__*/jsx("div", {
236
+ className: t29,
237
+ children: children
238
+ });
239
+ $[52] = children;
240
+ $[53] = t29;
241
+ $[54] = t30;
242
+ } else {
243
+ t30 = $[54];
244
+ }
245
+ let t31;
246
+ if ($[55] !== buttonsClassName || $[56] !== buttonsSize || $[57] !== finalButtons || $[58] !== footer || $[59] !== footerClassName || $[60] !== hasButtons) {
247
+ t31 = footer !== null || hasButtons ? /*#__PURE__*/jsxs("div", {
248
+ className: classNames(["modal-footer py-2", footerClassName]),
249
+ children: [footer !== null ? footer : null, hasButtons ? /*#__PURE__*/jsx(Buttons, {
250
+ items: finalButtons,
251
+ size: buttonsSize,
252
+ className: buttonsClassName
253
+ }) : null]
254
+ }) : null;
255
+ $[55] = buttonsClassName;
256
+ $[56] = buttonsSize;
257
+ $[57] = finalButtons;
258
+ $[58] = footer;
259
+ $[59] = footerClassName;
260
+ $[60] = hasButtons;
261
+ $[61] = t31;
262
+ } else {
263
+ t31 = $[61];
264
+ }
265
+ let t32;
266
+ if ($[62] !== t27 || $[63] !== t28 || $[64] !== t30 || $[65] !== t31) {
267
+ t32 = /*#__PURE__*/jsxs("div", {
268
+ className: "modal-content",
269
+ children: [t27, t28, t30, t31]
270
+ });
271
+ $[62] = t27;
272
+ $[63] = t28;
273
+ $[64] = t30;
274
+ $[65] = t31;
275
+ $[66] = t32;
276
+ } else {
277
+ t32 = $[66];
278
+ }
279
+ let t33;
280
+ if ($[67] !== t26 || $[68] !== t32) {
281
+ t33 = /*#__PURE__*/jsx("div", {
282
+ className: t26,
62
283
  role: "dialog",
63
- children: /*#__PURE__*/jsxs("div", {
64
- className: "modal-content",
65
- children: [onCloseButtonOutside && !withoutClose ? /*#__PURE__*/jsx(Button, {
66
- type: "button",
67
- className: classNames(['btn', 'btn-close', 'bg-light', 'position-absolute', 'start-100', 'ms-1']),
68
- "aria-label": "Close",
69
- onClick: requestClose
70
- }) : null, header !== null ? header : /*#__PURE__*/jsxs("div", {
71
- className: classNames([{
72
- 'modal-header': title !== null
73
- }, headerClassName]),
74
- children: [title !== null ? /*#__PURE__*/jsx("h5", {
75
- className: "modal-title pe-2",
76
- children: isMessage(title) ? /*#__PURE__*/jsx(Label, {
77
- children: title
78
- }) : title
79
- }) : null, title !== null && !withoutClose && !onCloseButtonOutside ? /*#__PURE__*/jsx(Button, {
80
- type: "button",
81
- className: "btn-close",
82
- "aria-label": "Close",
83
- onClick: requestClose
84
- }) : null]
85
- }), /*#__PURE__*/jsx("div", {
86
- className: classNames(['modal-body', bodyClassName]),
87
- children: children
88
- }), footer !== null || hasButtons ? /*#__PURE__*/jsxs("div", {
89
- className: classNames(['modal-footer', footerClassName]),
90
- children: [footer !== null ? footer : null, hasButtons ? /*#__PURE__*/jsx(Buttons, {
91
- items: finalButtons,
92
- size: buttonsSize,
93
- className: buttonsClassName
94
- }) : null]
95
- }) : null]
96
- })
97
- })
98
- });
284
+ children: t32
285
+ });
286
+ $[67] = t26;
287
+ $[68] = t32;
288
+ $[69] = t33;
289
+ } else {
290
+ t33 = $[69];
291
+ }
292
+ let t34;
293
+ if ($[70] !== id || $[71] !== props || $[72] !== requestClose || $[73] !== t33) {
294
+ t34 = /*#__PURE__*/jsx(Modal, {
295
+ id: id,
296
+ requestClose: requestClose,
297
+ ...props,
298
+ children: t33
299
+ });
300
+ $[70] = id;
301
+ $[71] = props;
302
+ $[72] = requestClose;
303
+ $[73] = t33;
304
+ $[74] = t34;
305
+ } else {
306
+ t34 = $[74];
307
+ }
308
+ return t34;
309
+ }
310
+ function _temp(button) {
311
+ return button !== null;
99
312
  }
100
313
 
101
314
  export { DialogModal as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/modal-dialog",
3
- "version": "4.0.50",
3
+ "version": "4.0.55",
4
4
  "description": "Default modal",
5
5
  "keywords": [
6
6
  "javascript"
@@ -60,12 +60,12 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@babel/runtime": "^7.28.6",
63
- "@panneau/core": "^4.0.50",
64
- "@panneau/element-button": "^4.0.50",
65
- "@panneau/element-buttons": "^4.0.50",
66
- "@panneau/element-label": "^4.0.50",
67
- "@panneau/element-modal": "^4.0.50",
68
- "@panneau/themes": "^4.0.50",
63
+ "@panneau/core": "^4.0.55",
64
+ "@panneau/element-button": "^4.0.55",
65
+ "@panneau/element-buttons": "^4.0.55",
66
+ "@panneau/element-label": "^4.0.55",
67
+ "@panneau/element-modal": "^4.0.55",
68
+ "@panneau/themes": "^4.0.55",
69
69
  "classnames": "^2.5.1",
70
70
  "lodash": "^4.17.21",
71
71
  "react-intl": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^10.0.0"
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "c5d4004686dae5529035f8eac83571739e24340d"
76
+ "gitHead": "1c9183567fc5bf98ba10fa57c63cf2ed2ae4a054"
77
77
  }