capacitor-extended-dialog 0.0.12 → 0.0.13
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/README.md +2 -0
- package/android/src/main/java/com/albermonte/extendeddialog/DialogStyleOptions.java +3 -1
- package/android/src/main/java/com/albermonte/extendeddialog/ExtendedDialog.java +4 -0
- package/android/src/main/java/com/albermonte/extendeddialog/ExtendedDialogPlugin.java +4 -0
- package/android/src/main/java/com/albermonte/extendeddialog/SheetBottomDialogFragment.java +69 -46
- package/dist/docs.json +14 -0
- package/dist/esm/definitions.d.ts +4 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.js +27 -12
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +27 -12
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +27 -12
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/ExtendedDialogPlugin/ExtendedDialog.swift +9 -4
- package/ios/Sources/ExtendedDialogPlugin/ExtendedDialogPlugin.swift +4 -0
- package/ios/Sources/ExtendedDialogPlugin/FullScreenDialogViewController.swift +43 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -248,6 +248,7 @@ Show a message sheet dialog with an optional header logo, title, and message.
|
|
|
248
248
|
| ------------------------ | ------------------------------------------------- | -------------------------------------------------------- |
|
|
249
249
|
| **`headerLogo`** | <code>string</code> | Header logo - supports base64 data URL or HTTP/HTTPS URL |
|
|
250
250
|
| **`title`** | <code>string</code> | Sheet title |
|
|
251
|
+
| **`subtitle`** | <code>string</code> | Optional subtitle displayed between title and rows |
|
|
251
252
|
| **`rows`** | <code>{}</code> | Description rows |
|
|
252
253
|
| **`confirmButtonTitle`** | <code>string</code> | Confirm button title |
|
|
253
254
|
| **`cancelButtonTitle`** | <code>string</code> | Cancel button title |
|
|
@@ -276,6 +277,7 @@ Show a message sheet dialog with an optional header logo, title, and message.
|
|
|
276
277
|
| ------------------------ | ------------------------------------------------- | -------------------------------------------------------- |
|
|
277
278
|
| **`headerLogo`** | <code>string</code> | Header logo - supports base64 data URL or HTTP/HTTPS URL |
|
|
278
279
|
| **`title`** | <code>string</code> | Sheet title |
|
|
280
|
+
| **`subtitle`** | <code>string</code> | Optional subtitle displayed between title and message |
|
|
279
281
|
| **`message`** | <code>string</code> | Message body displayed in the sheet |
|
|
280
282
|
| **`confirmButtonTitle`** | <code>string</code> | Confirm button title |
|
|
281
283
|
| **`cancelButtonTitle`** | <code>string</code> | Cancel button title |
|
|
@@ -171,7 +171,9 @@ public class DialogStyleOptions {
|
|
|
171
171
|
options.messageFontSize = bundle.containsKey(KEY_MESSAGE_FONT_SIZE) ? bundle.getFloat(KEY_MESSAGE_FONT_SIZE) : null;
|
|
172
172
|
options.buttonFontSize = bundle.containsKey(KEY_BUTTON_FONT_SIZE) ? bundle.getFloat(KEY_BUTTON_FONT_SIZE) : null;
|
|
173
173
|
options.contentButtonSpacing = bundle.containsKey(KEY_CONTENT_BUTTON_SPACING) ? bundle.getFloat(KEY_CONTENT_BUTTON_SPACING) : null;
|
|
174
|
-
options.headerLogoCornerRadius = bundle.containsKey(KEY_HEADER_LOGO_CORNER_RADIUS)
|
|
174
|
+
options.headerLogoCornerRadius = bundle.containsKey(KEY_HEADER_LOGO_CORNER_RADIUS)
|
|
175
|
+
? bundle.getFloat(KEY_HEADER_LOGO_CORNER_RADIUS)
|
|
176
|
+
: null;
|
|
175
177
|
return options;
|
|
176
178
|
}
|
|
177
179
|
}
|
|
@@ -744,6 +744,7 @@ public class ExtendedDialog {
|
|
|
744
744
|
public void showSheet(
|
|
745
745
|
Activity activity,
|
|
746
746
|
String title,
|
|
747
|
+
String subtitle,
|
|
747
748
|
String headerLogo,
|
|
748
749
|
JSONArray rows,
|
|
749
750
|
String confirmButtonTitle,
|
|
@@ -760,6 +761,7 @@ public class ExtendedDialog {
|
|
|
760
761
|
fragmentActivity.runOnUiThread(() -> {
|
|
761
762
|
SheetBottomDialogFragment fragment = SheetBottomDialogFragment.newInstance(
|
|
762
763
|
title,
|
|
764
|
+
subtitle,
|
|
763
765
|
headerLogo,
|
|
764
766
|
rows.toString(),
|
|
765
767
|
confirmButtonTitle != null ? confirmButtonTitle : "Confirm",
|
|
@@ -775,6 +777,7 @@ public class ExtendedDialog {
|
|
|
775
777
|
public void showMessageSheet(
|
|
776
778
|
Activity activity,
|
|
777
779
|
String title,
|
|
780
|
+
String subtitle,
|
|
778
781
|
String message,
|
|
779
782
|
String headerLogo,
|
|
780
783
|
String confirmButtonTitle,
|
|
@@ -791,6 +794,7 @@ public class ExtendedDialog {
|
|
|
791
794
|
fragmentActivity.runOnUiThread(() -> {
|
|
792
795
|
SheetBottomDialogFragment fragment = SheetBottomDialogFragment.newMessageInstance(
|
|
793
796
|
title,
|
|
797
|
+
subtitle,
|
|
794
798
|
headerLogo,
|
|
795
799
|
message,
|
|
796
800
|
confirmButtonTitle != null ? confirmButtonTitle : "Confirm",
|
|
@@ -211,6 +211,7 @@ public class ExtendedDialogPlugin extends Plugin {
|
|
|
211
211
|
@PluginMethod
|
|
212
212
|
public void sheet(PluginCall call) {
|
|
213
213
|
String title = call.getString("title");
|
|
214
|
+
String subtitle = call.getString("subtitle");
|
|
214
215
|
String headerLogo = call.getString("headerLogo");
|
|
215
216
|
JSArray rowsArray = call.getArray("rows");
|
|
216
217
|
String confirmButtonTitle = call.getString("confirmButtonTitle");
|
|
@@ -235,6 +236,7 @@ public class ExtendedDialogPlugin extends Plugin {
|
|
|
235
236
|
implementation.showSheet(
|
|
236
237
|
getActivity(),
|
|
237
238
|
title,
|
|
239
|
+
subtitle,
|
|
238
240
|
headerLogo,
|
|
239
241
|
rows,
|
|
240
242
|
confirmButtonTitle,
|
|
@@ -255,6 +257,7 @@ public class ExtendedDialogPlugin extends Plugin {
|
|
|
255
257
|
@PluginMethod
|
|
256
258
|
public void messageSheet(PluginCall call) {
|
|
257
259
|
String title = call.getString("title");
|
|
260
|
+
String subtitle = call.getString("subtitle");
|
|
258
261
|
String message = call.getString("message");
|
|
259
262
|
String headerLogo = call.getString("headerLogo");
|
|
260
263
|
String confirmButtonTitle = call.getString("confirmButtonTitle");
|
|
@@ -276,6 +279,7 @@ public class ExtendedDialogPlugin extends Plugin {
|
|
|
276
279
|
implementation.showMessageSheet(
|
|
277
280
|
getActivity(),
|
|
278
281
|
title,
|
|
282
|
+
subtitle,
|
|
279
283
|
message,
|
|
280
284
|
headerLogo,
|
|
281
285
|
confirmButtonTitle,
|
|
@@ -49,6 +49,7 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
49
49
|
private static final String ARG_CONFIRM_BUTTON = "confirmButton";
|
|
50
50
|
private static final String ARG_CANCEL_BUTTON = "cancelButton";
|
|
51
51
|
private static final String ARG_FULLSCREEN = "fullscreen";
|
|
52
|
+
private static final String ARG_SUBTITLE = "subtitle";
|
|
52
53
|
private static final String ARG_IS_MESSAGE_SHEET = "isMessageSheet";
|
|
53
54
|
|
|
54
55
|
private ExtendedDialog.SheetCallback sheetCallback;
|
|
@@ -68,6 +69,7 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
68
69
|
|
|
69
70
|
public static SheetBottomDialogFragment newInstance(
|
|
70
71
|
String title,
|
|
72
|
+
String subtitle,
|
|
71
73
|
String headerLogo,
|
|
72
74
|
String rowsJson,
|
|
73
75
|
String confirmButton,
|
|
@@ -78,6 +80,7 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
78
80
|
SheetBottomDialogFragment fragment = new SheetBottomDialogFragment();
|
|
79
81
|
Bundle args = new Bundle();
|
|
80
82
|
args.putString(ARG_TITLE, title);
|
|
83
|
+
args.putString(ARG_SUBTITLE, subtitle);
|
|
81
84
|
args.putString(ARG_HEADER_LOGO, headerLogo);
|
|
82
85
|
args.putString(ARG_ROWS, rowsJson);
|
|
83
86
|
args.putString(ARG_CONFIRM_BUTTON, confirmButton);
|
|
@@ -93,6 +96,7 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
93
96
|
|
|
94
97
|
public static SheetBottomDialogFragment newMessageInstance(
|
|
95
98
|
String title,
|
|
99
|
+
String subtitle,
|
|
96
100
|
String headerLogo,
|
|
97
101
|
String message,
|
|
98
102
|
String confirmButton,
|
|
@@ -103,6 +107,7 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
103
107
|
SheetBottomDialogFragment fragment = new SheetBottomDialogFragment();
|
|
104
108
|
Bundle args = new Bundle();
|
|
105
109
|
args.putString(ARG_TITLE, title);
|
|
110
|
+
args.putString(ARG_SUBTITLE, subtitle);
|
|
106
111
|
args.putString(ARG_HEADER_LOGO, headerLogo);
|
|
107
112
|
args.putString(ARG_MESSAGE, message);
|
|
108
113
|
args.putString(ARG_CONFIRM_BUTTON, confirmButton);
|
|
@@ -144,6 +149,7 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
144
149
|
}
|
|
145
150
|
|
|
146
151
|
String title = args.getString(ARG_TITLE, "");
|
|
152
|
+
String subtitle = args.getString(ARG_SUBTITLE);
|
|
147
153
|
String headerLogo = args.getString(ARG_HEADER_LOGO);
|
|
148
154
|
String rowsJson = args.getString(ARG_ROWS);
|
|
149
155
|
String message = args.getString(ARG_MESSAGE, "");
|
|
@@ -225,12 +231,14 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
225
231
|
}
|
|
226
232
|
if (radiusPx > 0) {
|
|
227
233
|
logoView.setClipToOutline(true);
|
|
228
|
-
logoView.setOutlineProvider(
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
234
|
+
logoView.setOutlineProvider(
|
|
235
|
+
new android.view.ViewOutlineProvider() {
|
|
236
|
+
@Override
|
|
237
|
+
public void getOutline(android.view.View view, android.graphics.Outline outline) {
|
|
238
|
+
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), radiusPx);
|
|
239
|
+
}
|
|
232
240
|
}
|
|
233
|
-
|
|
241
|
+
);
|
|
234
242
|
}
|
|
235
243
|
|
|
236
244
|
headerLayout.addView(logoView);
|
|
@@ -256,17 +264,40 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
256
264
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
|
257
265
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
|
258
266
|
);
|
|
259
|
-
titleParams.bottomMargin = (int) (20 * density);
|
|
267
|
+
titleParams.bottomMargin = (subtitle != null && !subtitle.isEmpty()) ? (int) (4 * density) : (int) (20 * density);
|
|
260
268
|
titleView.setLayoutParams(titleParams);
|
|
261
269
|
headerLayout.addView(titleView);
|
|
262
270
|
}
|
|
271
|
+
|
|
272
|
+
// Subtitle
|
|
273
|
+
if (subtitle != null && !subtitle.isEmpty()) {
|
|
274
|
+
TextView subtitleView = new TextView(ctx);
|
|
275
|
+
subtitleView.setText(subtitle);
|
|
276
|
+
TextViewCompat.setTextAppearance(subtitleView, com.google.android.material.R.style.TextAppearance_Material3_BodyMedium);
|
|
277
|
+
if (styleOptions.getMessageColor() != null) {
|
|
278
|
+
subtitleView.setTextColor(styleOptions.getMessageColor());
|
|
279
|
+
} else {
|
|
280
|
+
int secondaryColor = MaterialColors.getColor(ctx, android.R.attr.textColorSecondary, 0xFF49454F);
|
|
281
|
+
subtitleView.setTextColor(secondaryColor);
|
|
282
|
+
}
|
|
283
|
+
if (styleOptions.getMessageFontSize() != null) {
|
|
284
|
+
subtitleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, styleOptions.getMessageFontSize());
|
|
285
|
+
}
|
|
286
|
+
subtitleView.setGravity(Gravity.CENTER);
|
|
287
|
+
LinearLayout.LayoutParams subtitleParams = new LinearLayout.LayoutParams(
|
|
288
|
+
LinearLayout.LayoutParams.MATCH_PARENT,
|
|
289
|
+
LinearLayout.LayoutParams.WRAP_CONTENT
|
|
290
|
+
);
|
|
291
|
+
subtitleParams.bottomMargin = (int) (20 * density);
|
|
292
|
+
subtitleView.setLayoutParams(subtitleParams);
|
|
293
|
+
headerLayout.addView(subtitleView);
|
|
294
|
+
}
|
|
263
295
|
rootLayout.addView(headerLayout);
|
|
264
296
|
|
|
265
297
|
// ScrollView for body content (rows/message only)
|
|
266
298
|
scrollView = new ScrollView(ctx);
|
|
267
299
|
scrollView.setFillViewport(true);
|
|
268
|
-
scrollView.setLayoutParams(new LinearLayout.LayoutParams(
|
|
269
|
-
ViewGroup.LayoutParams.MATCH_PARENT, 0, 1f));
|
|
300
|
+
scrollView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0, 1f));
|
|
270
301
|
|
|
271
302
|
bodyLayout = new LinearLayout(ctx);
|
|
272
303
|
bodyLayout.setOrientation(LinearLayout.VERTICAL);
|
|
@@ -279,9 +310,7 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
279
310
|
int messagePadding = (int) (16 * density);
|
|
280
311
|
messageContainer.setPadding(messagePadding, messagePadding, messagePadding, messagePadding);
|
|
281
312
|
|
|
282
|
-
ShapeAppearanceModel messageShape = ShapeAppearanceModel.builder()
|
|
283
|
-
.setAllCornerSizes(12 * density)
|
|
284
|
-
.build();
|
|
313
|
+
ShapeAppearanceModel messageShape = ShapeAppearanceModel.builder().setAllCornerSizes(12 * density).build();
|
|
285
314
|
MaterialShapeDrawable messageBackground = new MaterialShapeDrawable(messageShape);
|
|
286
315
|
int surfaceVariant = MaterialColors.getColor(ctx, com.google.android.material.R.attr.colorSurfaceVariant, 0xFFE7E0EC);
|
|
287
316
|
messageBackground.setFillColor(ColorStateList.valueOf(surfaceVariant));
|
|
@@ -449,21 +478,23 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
449
478
|
// Prevent dragging down in fullscreen mode
|
|
450
479
|
behavior.setDraggable(false);
|
|
451
480
|
setExpandedButtonOffset(true);
|
|
452
|
-
behavior.addBottomSheetCallback(
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
481
|
+
behavior.addBottomSheetCallback(
|
|
482
|
+
new BottomSheetBehavior.BottomSheetCallback() {
|
|
483
|
+
@Override
|
|
484
|
+
public void onStateChanged(@NonNull View sheet, int newState) {
|
|
485
|
+
if (newState == BottomSheetBehavior.STATE_EXPANDED) {
|
|
486
|
+
setExpandedButtonOffset(true);
|
|
487
|
+
setRootHeight(getVisibleSheetHeight(sheet));
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
@Override
|
|
492
|
+
public void onSlide(@NonNull View sheet, float slideOffset) {
|
|
456
493
|
setExpandedButtonOffset(true);
|
|
457
494
|
setRootHeight(getVisibleSheetHeight(sheet));
|
|
458
495
|
}
|
|
459
496
|
}
|
|
460
|
-
|
|
461
|
-
@Override
|
|
462
|
-
public void onSlide(@NonNull View sheet, float slideOffset) {
|
|
463
|
-
setExpandedButtonOffset(true);
|
|
464
|
-
setRootHeight(getVisibleSheetHeight(sheet));
|
|
465
|
-
}
|
|
466
|
-
});
|
|
497
|
+
);
|
|
467
498
|
bottomSheet.post(() -> setRootHeight(getVisibleSheetHeight(bottomSheet)));
|
|
468
499
|
} else {
|
|
469
500
|
// Multi-stop bottom sheet: drag up to fullscreen, drag down to dismiss
|
|
@@ -476,30 +507,27 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
476
507
|
behavior.setHideable(true);
|
|
477
508
|
behavior.setDraggable(true);
|
|
478
509
|
|
|
479
|
-
behavior.addBottomSheetCallback(
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
newState == BottomSheetBehavior.STATE_HALF_EXPANDED ||
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
setRootHeight(getVisibleSheetHeight(sheet));
|
|
510
|
+
behavior.addBottomSheetCallback(
|
|
511
|
+
new BottomSheetBehavior.BottomSheetCallback() {
|
|
512
|
+
@Override
|
|
513
|
+
public void onStateChanged(@NonNull View sheet, int newState) {
|
|
514
|
+
if (newState == BottomSheetBehavior.STATE_HALF_EXPANDED || newState == BottomSheetBehavior.STATE_EXPANDED) {
|
|
515
|
+
setExpandedButtonOffset(newState == BottomSheetBehavior.STATE_EXPANDED);
|
|
516
|
+
setRootHeight(getVisibleSheetHeight(sheet));
|
|
517
|
+
}
|
|
488
518
|
}
|
|
489
|
-
}
|
|
490
519
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
520
|
+
@Override
|
|
521
|
+
public void onSlide(@NonNull View sheet, float slideOffset) {
|
|
522
|
+
setExpandedButtonOffset(slideOffset >= 0.9f);
|
|
523
|
+
setRootHeight(getVisibleSheetHeight(sheet));
|
|
524
|
+
}
|
|
495
525
|
}
|
|
496
|
-
|
|
526
|
+
);
|
|
497
527
|
|
|
498
528
|
bottomSheet.post(() -> {
|
|
499
529
|
int screenHeight = getResources().getDisplayMetrics().heightPixels;
|
|
500
|
-
int width = bottomSheet.getWidth() > 0
|
|
501
|
-
? bottomSheet.getWidth()
|
|
502
|
-
: getResources().getDisplayMetrics().widthPixels;
|
|
530
|
+
int width = bottomSheet.getWidth() > 0 ? bottomSheet.getWidth() : getResources().getDisplayMetrics().widthPixels;
|
|
503
531
|
|
|
504
532
|
int widthSpec = View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY);
|
|
505
533
|
int heightSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
|
|
@@ -592,12 +620,7 @@ public class SheetBottomDialogFragment extends BottomSheetDialogFragment {
|
|
|
592
620
|
}
|
|
593
621
|
int expandedExtraBottomPadding = applyExpandedButtonOffset ? buttonExpandedExtraPaddingPx : 0;
|
|
594
622
|
int resolvedBottomPadding = buttonBottomBasePaddingPx + buttonBottomInsetsPx + expandedExtraBottomPadding;
|
|
595
|
-
buttonContainer.setPadding(
|
|
596
|
-
buttonHorizontalPaddingPx,
|
|
597
|
-
buttonTopPaddingPx,
|
|
598
|
-
buttonHorizontalPaddingPx,
|
|
599
|
-
resolvedBottomPadding
|
|
600
|
-
);
|
|
623
|
+
buttonContainer.setPadding(buttonHorizontalPaddingPx, buttonTopPaddingPx, buttonHorizontalPaddingPx, resolvedBottomPadding);
|
|
601
624
|
}
|
|
602
625
|
|
|
603
626
|
private LinearLayout createSheetRow(
|
package/dist/docs.json
CHANGED
|
@@ -540,6 +540,13 @@
|
|
|
540
540
|
"complexTypes": [],
|
|
541
541
|
"type": "string"
|
|
542
542
|
},
|
|
543
|
+
{
|
|
544
|
+
"name": "subtitle",
|
|
545
|
+
"tags": [],
|
|
546
|
+
"docs": "Optional subtitle displayed between title and rows",
|
|
547
|
+
"complexTypes": [],
|
|
548
|
+
"type": "string | undefined"
|
|
549
|
+
},
|
|
543
550
|
{
|
|
544
551
|
"name": "rows",
|
|
545
552
|
"tags": [],
|
|
@@ -641,6 +648,13 @@
|
|
|
641
648
|
"complexTypes": [],
|
|
642
649
|
"type": "string"
|
|
643
650
|
},
|
|
651
|
+
{
|
|
652
|
+
"name": "subtitle",
|
|
653
|
+
"tags": [],
|
|
654
|
+
"docs": "Optional subtitle displayed between title and message",
|
|
655
|
+
"complexTypes": [],
|
|
656
|
+
"type": "string | undefined"
|
|
657
|
+
},
|
|
644
658
|
{
|
|
645
659
|
"name": "message",
|
|
646
660
|
"tags": [],
|
|
@@ -270,6 +270,8 @@ export interface SheetOptions extends DialogStyleOptions {
|
|
|
270
270
|
headerLogo?: string;
|
|
271
271
|
/** Sheet title */
|
|
272
272
|
title: string;
|
|
273
|
+
/** Optional subtitle displayed between title and rows */
|
|
274
|
+
subtitle?: string;
|
|
273
275
|
/** Description rows */
|
|
274
276
|
rows: SheetRow[];
|
|
275
277
|
/** Confirm button title */
|
|
@@ -284,6 +286,8 @@ export interface MessageSheetOptions extends DialogStyleOptions {
|
|
|
284
286
|
headerLogo?: string;
|
|
285
287
|
/** Sheet title */
|
|
286
288
|
title: string;
|
|
289
|
+
/** Optional subtitle displayed between title and message */
|
|
290
|
+
subtitle?: string;
|
|
287
291
|
/** Message body displayed in the sheet */
|
|
288
292
|
message: string;
|
|
289
293
|
/** Confirm button title */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Dialog presentation mode.\n *\n * - `'basic'` — Standard modal dialog (default)\n * - `'fullscreen'` — Full-screen dialog presentation\n */\nexport type DialogMode = 'basic' | 'fullscreen';\n\nexport interface DialogStyleOptions {\n /**\n * Color for the OK/primary button (hex format, e.g., \"#FF5722\")\n */\n buttonColor?: string;\n /**\n * Color for the cancel button (hex format, e.g., \"#757575\")\n */\n cancelButtonColor?: string;\n /**\n * Color for the title text (hex format, e.g., \"#000000\")\n */\n titleColor?: string;\n /**\n * Color for the message text (hex format, e.g., \"#666666\")\n */\n messageColor?: string;\n /**\n * Background color of the dialog (hex format, e.g., \"#FFFFFF\")\n */\n backgroundColor?: string;\n /**\n * Font size for the title text in sp/pt (e.g., 20)\n */\n titleFontSize?: number;\n /**\n * Font size for the message text in sp/pt (e.g., 16)\n */\n messageFontSize?: number;\n /**\n * Font size for the button text in sp/pt (e.g., 14)\n */\n buttonFontSize?: number;\n /**\n * Vertical spacing between dialog content and the confirm/cancel buttons in dp/pt/px (e.g., 16).\n * Only applies to fullscreen and sheet modes.\n *\n * @example\n * // Fullscreen confirm with extra spacing between content and buttons\n * await ExtendedDialog.confirm({\n * title: 'Delete Account',\n * message: 'This action cannot be undone.',\n * mode: 'fullscreen',\n * contentButtonSpacing: 32,\n * });\n *\n * @example\n * // Sheet with tight spacing\n * await ExtendedDialog.sheet({\n * title: 'Order Summary',\n * rows: [{ title: 'Total', value: '$9.99' }],\n * contentButtonSpacing: 8,\n * });\n */\n contentButtonSpacing?: number;\n /**\n * Corner radius for the header logo in sheet dialogs (in dp/pt/px).\n * - Positive number: specific radius (e.g., 12)\n * - 0: square corners (no rounding)\n * - -1: full circle (radius = half of logo size)\n *\n * @default 8\n *\n * @example\n * // Custom rounded corners (12px)\n * await ExtendedDialog.sheet({\n * title: 'Settings',\n * headerLogo: 'https://example.com/logo.png',\n * headerLogoCornerRadius: 12,\n * rows: [],\n * });\n *\n * @example\n * // Full circle logo\n * await ExtendedDialog.sheet({\n * title: 'Profile',\n * headerLogo: 'https://example.com/avatar.png',\n * headerLogoCornerRadius: -1,\n * rows: [],\n * });\n *\n * @example\n * // Square logo (no rounding)\n * await ExtendedDialog.sheet({\n * title: 'Document',\n * headerLogo: 'https://example.com/icon.png',\n * headerLogoCornerRadius: 0,\n * rows: [],\n * });\n */\n headerLogoCornerRadius?: number;\n}\n\nexport interface BaseDialogOptions extends DialogStyleOptions {\n /**\n * Title displayed at the top of the dialog.\n */\n title?: string;\n /**\n * Message body displayed in the dialog.\n */\n message: string;\n /**\n * Presentation mode for the dialog.\n *\n * @default 'basic'\n */\n mode?: DialogMode;\n}\n\nexport interface AlertOptions extends BaseDialogOptions {\n /**\n * Title for the dismiss button.\n *\n * @default \"OK\"\n */\n buttonTitle?: string;\n}\n\nexport interface ConfirmOptions extends BaseDialogOptions {\n /**\n * Title for the confirmation button.\n *\n * @default \"OK\"\n */\n okButtonTitle?: string;\n /**\n * Title for the cancel button.\n *\n * @default \"Cancel\"\n */\n cancelButtonTitle?: string;\n}\n\nexport interface PromptOptions extends BaseDialogOptions {\n /**\n * Title for the confirmation button.\n *\n * @default \"OK\"\n */\n okButtonTitle?: string;\n /**\n * Title for the cancel button.\n *\n * @default \"Cancel\"\n */\n cancelButtonTitle?: string;\n /**\n * Placeholder text shown in the input field when empty.\n */\n inputPlaceholder?: string;\n /**\n * Pre-filled value for the input field.\n */\n inputText?: string;\n /**\n * Whether to automatically focus the input field and open the keyboard when the dialog appears.\n *\n * Note: On iOS, basic (non-fullscreen) dialogs always auto-focus the input field due to\n * UIAlertController's built-in behavior. This option only takes effect on iOS when using\n * fullscreen mode (`mode: 'fullscreen'`). On Android and web, this works for all modes.\n *\n * @default false\n */\n focusInput?: boolean;\n}\n\nexport interface SelectOption {\n /**\n * Display text for the option.\n */\n label: string;\n /**\n * Value returned when the option is selected.\n */\n value: string;\n}\n\nexport interface SingleSelectOptions extends BaseDialogOptions {\n /**\n * List of options to display for selection.\n */\n options: SelectOption[];\n /**\n * Value of the initially selected option.\n */\n selectedValue?: string;\n /**\n * Title for the confirmation button.\n *\n * @default \"OK\"\n */\n okButtonTitle?: string;\n /**\n * Title for the cancel button.\n *\n * @default \"Cancel\"\n */\n cancelButtonTitle?: string;\n}\n\nexport interface MultiSelectOptions extends BaseDialogOptions {\n /**\n * List of options to display for selection.\n */\n options: SelectOption[];\n /**\n * Values of the initially selected options.\n */\n selectedValues?: string[];\n /**\n * Title for the confirmation button.\n *\n * @default \"OK\"\n */\n okButtonTitle?: string;\n /**\n * Title for the cancel button.\n *\n * @default \"Cancel\"\n */\n cancelButtonTitle?: string;\n}\n\nexport interface ConfirmResult {\n /**\n * Whether the user confirmed (`true`) or cancelled (`false`).\n */\n value: boolean;\n}\n\nexport interface PromptResult {\n /**\n * The text entered by the user. Empty string if cancelled.\n */\n value: string;\n /**\n * Whether the user cancelled the dialog.\n */\n cancelled: boolean;\n}\n\nexport interface SingleSelectResult {\n /**\n * The value of the selected option, or `null` if cancelled.\n */\n value: string | null;\n /**\n * Whether the user cancelled the dialog.\n */\n cancelled: boolean;\n}\n\nexport interface MultiSelectResult {\n /**\n * The values of the selected options. Empty array if cancelled.\n */\n values: string[];\n /**\n * Whether the user cancelled the dialog.\n */\n cancelled: boolean;\n}\n\nexport interface SheetRow {\n /** Row title (required) */\n title: string;\n /** Optional logo/icon - supports base64 data URL or HTTP/HTTPS URL */\n logo?: string;\n /** Optional value displayed on the right */\n value?: string;\n}\n\nexport interface SheetOptions extends DialogStyleOptions {\n /** Header logo - supports base64 data URL or HTTP/HTTPS URL */\n headerLogo?: string;\n /** Sheet title */\n title: string;\n /** Description rows */\n rows: SheetRow[];\n /** Confirm button title */\n confirmButtonTitle?: string; // default: \"Confirm\"\n /** Cancel button title */\n cancelButtonTitle?: string; // default: \"Cancel\"\n /** Dialog mode */\n mode?: DialogMode;\n}\n\nexport interface MessageSheetOptions extends DialogStyleOptions {\n /** Header logo - supports base64 data URL or HTTP/HTTPS URL */\n headerLogo?: string;\n /** Sheet title */\n title: string;\n /** Message body displayed in the sheet */\n message: string;\n /** Confirm button title */\n confirmButtonTitle?: string; // default: \"Confirm\"\n /** Cancel button title */\n cancelButtonTitle?: string; // default: \"Cancel\"\n /** Dialog mode */\n mode?: DialogMode;\n}\n\nexport interface SheetResult {\n /** True if confirmed, false if cancelled */\n confirmed: boolean;\n}\n\nexport interface MessageSheetResult {\n /** True if confirmed, false if cancelled */\n confirmed: boolean;\n}\n\nexport interface ExtendedDialogPlugin {\n /**\n * Show an alert dialog with a single dismiss button.\n *\n * @param options - Alert configuration options.\n */\n alert(options: AlertOptions): Promise<void>;\n /**\n * Show a confirmation dialog with OK and Cancel buttons.\n *\n * @param options - Confirm configuration options.\n * @returns The user's confirmation choice.\n */\n confirm(options: ConfirmOptions): Promise<ConfirmResult>;\n /**\n * Show a prompt dialog with a text input field.\n *\n * @param options - Prompt configuration options.\n * @returns The entered text and whether the dialog was cancelled.\n */\n prompt(options: PromptOptions): Promise<PromptResult>;\n /**\n * Show a single-select dialog where the user picks one option.\n *\n * @param options - Single select configuration options.\n * @returns The selected value and whether the dialog was cancelled.\n */\n singleSelect(options: SingleSelectOptions): Promise<SingleSelectResult>;\n /**\n * Show a multi-select dialog where the user picks one or more options.\n *\n * @param options - Multi select configuration options.\n * @returns The selected values and whether the dialog was cancelled.\n */\n multiSelect(options: MultiSelectOptions): Promise<MultiSelectResult>;\n /**\n * Show a sheet dialog with a header, title, and structured data rows.\n *\n * @param options - Sheet configuration options.\n * @returns Whether the user confirmed or cancelled the sheet.\n */\n sheet(options: SheetOptions): Promise<SheetResult>;\n\n /**\n * Show a message sheet dialog with an optional header logo, title, and message.\n *\n * @param options - Message sheet configuration options.\n * @returns Whether the user confirmed or cancelled the sheet.\n */\n messageSheet(options: MessageSheetOptions): Promise<MessageSheetResult>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Dialog presentation mode.\n *\n * - `'basic'` — Standard modal dialog (default)\n * - `'fullscreen'` — Full-screen dialog presentation\n */\nexport type DialogMode = 'basic' | 'fullscreen';\n\nexport interface DialogStyleOptions {\n /**\n * Color for the OK/primary button (hex format, e.g., \"#FF5722\")\n */\n buttonColor?: string;\n /**\n * Color for the cancel button (hex format, e.g., \"#757575\")\n */\n cancelButtonColor?: string;\n /**\n * Color for the title text (hex format, e.g., \"#000000\")\n */\n titleColor?: string;\n /**\n * Color for the message text (hex format, e.g., \"#666666\")\n */\n messageColor?: string;\n /**\n * Background color of the dialog (hex format, e.g., \"#FFFFFF\")\n */\n backgroundColor?: string;\n /**\n * Font size for the title text in sp/pt (e.g., 20)\n */\n titleFontSize?: number;\n /**\n * Font size for the message text in sp/pt (e.g., 16)\n */\n messageFontSize?: number;\n /**\n * Font size for the button text in sp/pt (e.g., 14)\n */\n buttonFontSize?: number;\n /**\n * Vertical spacing between dialog content and the confirm/cancel buttons in dp/pt/px (e.g., 16).\n * Only applies to fullscreen and sheet modes.\n *\n * @example\n * // Fullscreen confirm with extra spacing between content and buttons\n * await ExtendedDialog.confirm({\n * title: 'Delete Account',\n * message: 'This action cannot be undone.',\n * mode: 'fullscreen',\n * contentButtonSpacing: 32,\n * });\n *\n * @example\n * // Sheet with tight spacing\n * await ExtendedDialog.sheet({\n * title: 'Order Summary',\n * rows: [{ title: 'Total', value: '$9.99' }],\n * contentButtonSpacing: 8,\n * });\n */\n contentButtonSpacing?: number;\n /**\n * Corner radius for the header logo in sheet dialogs (in dp/pt/px).\n * - Positive number: specific radius (e.g., 12)\n * - 0: square corners (no rounding)\n * - -1: full circle (radius = half of logo size)\n *\n * @default 8\n *\n * @example\n * // Custom rounded corners (12px)\n * await ExtendedDialog.sheet({\n * title: 'Settings',\n * headerLogo: 'https://example.com/logo.png',\n * headerLogoCornerRadius: 12,\n * rows: [],\n * });\n *\n * @example\n * // Full circle logo\n * await ExtendedDialog.sheet({\n * title: 'Profile',\n * headerLogo: 'https://example.com/avatar.png',\n * headerLogoCornerRadius: -1,\n * rows: [],\n * });\n *\n * @example\n * // Square logo (no rounding)\n * await ExtendedDialog.sheet({\n * title: 'Document',\n * headerLogo: 'https://example.com/icon.png',\n * headerLogoCornerRadius: 0,\n * rows: [],\n * });\n */\n headerLogoCornerRadius?: number;\n}\n\nexport interface BaseDialogOptions extends DialogStyleOptions {\n /**\n * Title displayed at the top of the dialog.\n */\n title?: string;\n /**\n * Message body displayed in the dialog.\n */\n message: string;\n /**\n * Presentation mode for the dialog.\n *\n * @default 'basic'\n */\n mode?: DialogMode;\n}\n\nexport interface AlertOptions extends BaseDialogOptions {\n /**\n * Title for the dismiss button.\n *\n * @default \"OK\"\n */\n buttonTitle?: string;\n}\n\nexport interface ConfirmOptions extends BaseDialogOptions {\n /**\n * Title for the confirmation button.\n *\n * @default \"OK\"\n */\n okButtonTitle?: string;\n /**\n * Title for the cancel button.\n *\n * @default \"Cancel\"\n */\n cancelButtonTitle?: string;\n}\n\nexport interface PromptOptions extends BaseDialogOptions {\n /**\n * Title for the confirmation button.\n *\n * @default \"OK\"\n */\n okButtonTitle?: string;\n /**\n * Title for the cancel button.\n *\n * @default \"Cancel\"\n */\n cancelButtonTitle?: string;\n /**\n * Placeholder text shown in the input field when empty.\n */\n inputPlaceholder?: string;\n /**\n * Pre-filled value for the input field.\n */\n inputText?: string;\n /**\n * Whether to automatically focus the input field and open the keyboard when the dialog appears.\n *\n * Note: On iOS, basic (non-fullscreen) dialogs always auto-focus the input field due to\n * UIAlertController's built-in behavior. This option only takes effect on iOS when using\n * fullscreen mode (`mode: 'fullscreen'`). On Android and web, this works for all modes.\n *\n * @default false\n */\n focusInput?: boolean;\n}\n\nexport interface SelectOption {\n /**\n * Display text for the option.\n */\n label: string;\n /**\n * Value returned when the option is selected.\n */\n value: string;\n}\n\nexport interface SingleSelectOptions extends BaseDialogOptions {\n /**\n * List of options to display for selection.\n */\n options: SelectOption[];\n /**\n * Value of the initially selected option.\n */\n selectedValue?: string;\n /**\n * Title for the confirmation button.\n *\n * @default \"OK\"\n */\n okButtonTitle?: string;\n /**\n * Title for the cancel button.\n *\n * @default \"Cancel\"\n */\n cancelButtonTitle?: string;\n}\n\nexport interface MultiSelectOptions extends BaseDialogOptions {\n /**\n * List of options to display for selection.\n */\n options: SelectOption[];\n /**\n * Values of the initially selected options.\n */\n selectedValues?: string[];\n /**\n * Title for the confirmation button.\n *\n * @default \"OK\"\n */\n okButtonTitle?: string;\n /**\n * Title for the cancel button.\n *\n * @default \"Cancel\"\n */\n cancelButtonTitle?: string;\n}\n\nexport interface ConfirmResult {\n /**\n * Whether the user confirmed (`true`) or cancelled (`false`).\n */\n value: boolean;\n}\n\nexport interface PromptResult {\n /**\n * The text entered by the user. Empty string if cancelled.\n */\n value: string;\n /**\n * Whether the user cancelled the dialog.\n */\n cancelled: boolean;\n}\n\nexport interface SingleSelectResult {\n /**\n * The value of the selected option, or `null` if cancelled.\n */\n value: string | null;\n /**\n * Whether the user cancelled the dialog.\n */\n cancelled: boolean;\n}\n\nexport interface MultiSelectResult {\n /**\n * The values of the selected options. Empty array if cancelled.\n */\n values: string[];\n /**\n * Whether the user cancelled the dialog.\n */\n cancelled: boolean;\n}\n\nexport interface SheetRow {\n /** Row title (required) */\n title: string;\n /** Optional logo/icon - supports base64 data URL or HTTP/HTTPS URL */\n logo?: string;\n /** Optional value displayed on the right */\n value?: string;\n}\n\nexport interface SheetOptions extends DialogStyleOptions {\n /** Header logo - supports base64 data URL or HTTP/HTTPS URL */\n headerLogo?: string;\n /** Sheet title */\n title: string;\n /** Optional subtitle displayed between title and rows */\n subtitle?: string;\n /** Description rows */\n rows: SheetRow[];\n /** Confirm button title */\n confirmButtonTitle?: string; // default: \"Confirm\"\n /** Cancel button title */\n cancelButtonTitle?: string; // default: \"Cancel\"\n /** Dialog mode */\n mode?: DialogMode;\n}\n\nexport interface MessageSheetOptions extends DialogStyleOptions {\n /** Header logo - supports base64 data URL or HTTP/HTTPS URL */\n headerLogo?: string;\n /** Sheet title */\n title: string;\n /** Optional subtitle displayed between title and message */\n subtitle?: string;\n /** Message body displayed in the sheet */\n message: string;\n /** Confirm button title */\n confirmButtonTitle?: string; // default: \"Confirm\"\n /** Cancel button title */\n cancelButtonTitle?: string; // default: \"Cancel\"\n /** Dialog mode */\n mode?: DialogMode;\n}\n\nexport interface SheetResult {\n /** True if confirmed, false if cancelled */\n confirmed: boolean;\n}\n\nexport interface MessageSheetResult {\n /** True if confirmed, false if cancelled */\n confirmed: boolean;\n}\n\nexport interface ExtendedDialogPlugin {\n /**\n * Show an alert dialog with a single dismiss button.\n *\n * @param options - Alert configuration options.\n */\n alert(options: AlertOptions): Promise<void>;\n /**\n * Show a confirmation dialog with OK and Cancel buttons.\n *\n * @param options - Confirm configuration options.\n * @returns The user's confirmation choice.\n */\n confirm(options: ConfirmOptions): Promise<ConfirmResult>;\n /**\n * Show a prompt dialog with a text input field.\n *\n * @param options - Prompt configuration options.\n * @returns The entered text and whether the dialog was cancelled.\n */\n prompt(options: PromptOptions): Promise<PromptResult>;\n /**\n * Show a single-select dialog where the user picks one option.\n *\n * @param options - Single select configuration options.\n * @returns The selected value and whether the dialog was cancelled.\n */\n singleSelect(options: SingleSelectOptions): Promise<SingleSelectResult>;\n /**\n * Show a multi-select dialog where the user picks one or more options.\n *\n * @param options - Multi select configuration options.\n * @returns The selected values and whether the dialog was cancelled.\n */\n multiSelect(options: MultiSelectOptions): Promise<MultiSelectResult>;\n /**\n * Show a sheet dialog with a header, title, and structured data rows.\n *\n * @param options - Sheet configuration options.\n * @returns Whether the user confirmed or cancelled the sheet.\n */\n sheet(options: SheetOptions): Promise<SheetResult>;\n\n /**\n * Show a message sheet dialog with an optional header logo, title, and message.\n *\n * @param options - Message sheet configuration options.\n * @returns Whether the user confirmed or cancelled the sheet.\n */\n messageSheet(options: MessageSheetOptions): Promise<MessageSheetResult>;\n}\n"]}
|
package/dist/esm/web.js
CHANGED
|
@@ -192,7 +192,7 @@ export class ExtendedDialogWeb extends WebPlugin {
|
|
|
192
192
|
}
|
|
193
193
|
async sheet(options) {
|
|
194
194
|
return new Promise((resolve) => {
|
|
195
|
-
var _a, _b, _c, _d;
|
|
195
|
+
var _a, _b, _c, _d, _e, _f;
|
|
196
196
|
const overlay = this.createOverlay();
|
|
197
197
|
const dialog = this.createSheetDialogContainer(options);
|
|
198
198
|
// Header section with logo and title
|
|
@@ -223,6 +223,14 @@ export class ExtendedDialogWeb extends WebPlugin {
|
|
|
223
223
|
const titleColor = (_b = options.titleColor) !== null && _b !== void 0 ? _b : 'inherit';
|
|
224
224
|
titleEl.style.cssText = `margin: 0; font-size: ${titleFontSize}px; font-weight: 600; color: ${titleColor}; text-align: center;`;
|
|
225
225
|
headerSection.appendChild(titleEl);
|
|
226
|
+
if (options.subtitle) {
|
|
227
|
+
const subtitleEl = document.createElement('p');
|
|
228
|
+
subtitleEl.textContent = options.subtitle;
|
|
229
|
+
const subtitleFontSize = (_c = options.messageFontSize) !== null && _c !== void 0 ? _c : 14;
|
|
230
|
+
const subtitleColor = (_d = options.messageColor) !== null && _d !== void 0 ? _d : '#666';
|
|
231
|
+
subtitleEl.style.cssText = `margin: 4px 0 0 0; font-size: ${subtitleFontSize}px; font-weight: 400; color: ${subtitleColor}; text-align: center;`;
|
|
232
|
+
headerSection.appendChild(subtitleEl);
|
|
233
|
+
}
|
|
226
234
|
dialog.appendChild(headerSection);
|
|
227
235
|
// Rows container
|
|
228
236
|
const rowsContainer = document.createElement('div');
|
|
@@ -273,11 +281,11 @@ export class ExtendedDialogWeb extends WebPlugin {
|
|
|
273
281
|
}
|
|
274
282
|
// Button container
|
|
275
283
|
const buttonContainer = this.createButtonContainer(sheetSpacing);
|
|
276
|
-
const cancelButton = this.createButton((
|
|
284
|
+
const cancelButton = this.createButton((_e = options.cancelButtonTitle) !== null && _e !== void 0 ? _e : 'Cancel', false, () => {
|
|
277
285
|
this.removeOverlay(overlay);
|
|
278
286
|
resolve({ confirmed: false });
|
|
279
287
|
}, options);
|
|
280
|
-
const confirmButton = this.createButton((
|
|
288
|
+
const confirmButton = this.createButton((_f = options.confirmButtonTitle) !== null && _f !== void 0 ? _f : 'Confirm', true, () => {
|
|
281
289
|
this.removeOverlay(overlay);
|
|
282
290
|
resolve({ confirmed: true });
|
|
283
291
|
}, options);
|
|
@@ -290,7 +298,7 @@ export class ExtendedDialogWeb extends WebPlugin {
|
|
|
290
298
|
}
|
|
291
299
|
async messageSheet(options) {
|
|
292
300
|
return new Promise((resolve) => {
|
|
293
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
301
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
294
302
|
const overlay = this.createOverlay();
|
|
295
303
|
const dialog = this.createMessageSheetDialogContainer(options);
|
|
296
304
|
const content = document.createElement('div');
|
|
@@ -319,27 +327,34 @@ export class ExtendedDialogWeb extends WebPlugin {
|
|
|
319
327
|
titleEl.textContent = options.title;
|
|
320
328
|
const titleFontSize = (_a = options.titleFontSize) !== null && _a !== void 0 ? _a : 20;
|
|
321
329
|
const titleColor = (_b = options.titleColor) !== null && _b !== void 0 ? _b : 'inherit';
|
|
322
|
-
titleEl.style.cssText = `margin: 0 0 16px 0; font-size: ${titleFontSize}px; font-weight: 600; color: ${titleColor}; text-align: center;`;
|
|
330
|
+
titleEl.style.cssText = `margin: 0 0 ${options.subtitle ? '4px' : '16px'} 0; font-size: ${titleFontSize}px; font-weight: 600; color: ${titleColor}; text-align: center;`;
|
|
323
331
|
content.appendChild(titleEl);
|
|
332
|
+
if (options.subtitle) {
|
|
333
|
+
const subtitleEl = document.createElement('p');
|
|
334
|
+
subtitleEl.textContent = options.subtitle;
|
|
335
|
+
const subtitleFontSize = (_c = options.messageFontSize) !== null && _c !== void 0 ? _c : 14;
|
|
336
|
+
const subtitleColor = (_d = options.messageColor) !== null && _d !== void 0 ? _d : '#666';
|
|
337
|
+
subtitleEl.style.cssText = `margin: 0 0 16px 0; font-size: ${subtitleFontSize}px; font-weight: 400; color: ${subtitleColor}; text-align: center;`;
|
|
338
|
+
content.appendChild(subtitleEl);
|
|
339
|
+
}
|
|
324
340
|
const messageEl = document.createElement('p');
|
|
325
341
|
messageEl.textContent = options.message;
|
|
326
|
-
const messageFontSize = (
|
|
327
|
-
const messageColor = (
|
|
342
|
+
const messageFontSize = (_e = options.messageFontSize) !== null && _e !== void 0 ? _e : 16;
|
|
343
|
+
const messageColor = (_f = options.messageColor) !== null && _f !== void 0 ? _f : '#666';
|
|
328
344
|
messageEl.style.cssText = `margin: 0; font-size: ${messageFontSize}px; color: ${messageColor}; white-space: pre-wrap; word-break: break-word;`;
|
|
329
345
|
const messageContainer = document.createElement('div');
|
|
330
|
-
messageContainer.style.cssText =
|
|
331
|
-
'background: #E5E5EA; border-radius: 12px; padding: 16px; margin: 0;';
|
|
346
|
+
messageContainer.style.cssText = 'background: #E5E5EA; border-radius: 12px; padding: 16px; margin: 0;';
|
|
332
347
|
messageContainer.appendChild(messageEl);
|
|
333
348
|
content.appendChild(messageContainer);
|
|
334
349
|
dialog.appendChild(content);
|
|
335
|
-
const spacing = (
|
|
350
|
+
const spacing = (_g = options.contentButtonSpacing) !== null && _g !== void 0 ? _g : 24;
|
|
336
351
|
const buttonContainer = document.createElement('div');
|
|
337
352
|
buttonContainer.style.cssText = `display: flex; flex-direction: column; gap: 12px; margin-top: ${spacing}px;`;
|
|
338
|
-
const confirmButton = this.createButton((
|
|
353
|
+
const confirmButton = this.createButton((_h = options.confirmButtonTitle) !== null && _h !== void 0 ? _h : 'Confirm', true, () => {
|
|
339
354
|
this.removeOverlay(overlay);
|
|
340
355
|
resolve({ confirmed: true });
|
|
341
356
|
}, options);
|
|
342
|
-
const cancelButton = this.createButton((
|
|
357
|
+
const cancelButton = this.createButton((_j = options.cancelButtonTitle) !== null && _j !== void 0 ? _j : 'Cancel', false, () => {
|
|
343
358
|
this.removeOverlay(overlay);
|
|
344
359
|
resolve({ confirmed: false });
|
|
345
360
|
}, options);
|