capacitor-extended-dialog 0.0.13 → 0.0.15
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/CapacitorExtendedDialog.podspec +2 -1
- package/Package.swift +4 -2
- package/README.md +75 -77
- package/android/build.gradle +10 -9
- package/android/src/main/java/com/albermonte/extendeddialog/SheetBottomDialogFragment.java +19 -14
- package/android/src/main/java/com/albermonte/extendeddialog/SvgImageLoader.java +90 -0
- package/dist/docs.json +74 -74
- package/dist/esm/definitions.d.ts +16 -4
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/ios/Sources/ExtendedDialogPlugin/FullScreenDialogViewController.swift +22 -17
- package/ios/Sources/ExtendedDialogPlugin/SvgImageLoader.swift +70 -0
- package/package.json +12 -12
package/dist/docs.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"methods": [
|
|
8
8
|
{
|
|
9
9
|
"name": "alert",
|
|
10
|
-
"signature": "(options: AlertOptions) =>
|
|
10
|
+
"signature": "(options: AlertOptions) => Promise<void>",
|
|
11
11
|
"parameters": [
|
|
12
12
|
{
|
|
13
13
|
"name": "options",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"type": "AlertOptions"
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
|
-
"returns": "
|
|
18
|
+
"returns": "Promise<void>",
|
|
19
19
|
"tags": [
|
|
20
20
|
{
|
|
21
21
|
"name": "param",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"name": "confirm",
|
|
33
|
-
"signature": "(options: ConfirmOptions) =>
|
|
33
|
+
"signature": "(options: ConfirmOptions) => Promise<ConfirmResult>",
|
|
34
34
|
"parameters": [
|
|
35
35
|
{
|
|
36
36
|
"name": "options",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"type": "ConfirmOptions"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
|
-
"returns": "
|
|
41
|
+
"returns": "Promise<ConfirmResult>",
|
|
42
42
|
"tags": [
|
|
43
43
|
{
|
|
44
44
|
"name": "param",
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
],
|
|
52
52
|
"docs": "Show a confirmation dialog with OK and Cancel buttons.",
|
|
53
53
|
"complexTypes": [
|
|
54
|
-
"
|
|
55
|
-
"
|
|
54
|
+
"ConfirmResult",
|
|
55
|
+
"ConfirmOptions"
|
|
56
56
|
],
|
|
57
57
|
"slug": "confirm"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"name": "prompt",
|
|
61
|
-
"signature": "(options: PromptOptions) =>
|
|
61
|
+
"signature": "(options: PromptOptions) => Promise<PromptResult>",
|
|
62
62
|
"parameters": [
|
|
63
63
|
{
|
|
64
64
|
"name": "options",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"type": "PromptOptions"
|
|
67
67
|
}
|
|
68
68
|
],
|
|
69
|
-
"returns": "
|
|
69
|
+
"returns": "Promise<PromptResult>",
|
|
70
70
|
"tags": [
|
|
71
71
|
{
|
|
72
72
|
"name": "param",
|
|
@@ -79,14 +79,14 @@
|
|
|
79
79
|
],
|
|
80
80
|
"docs": "Show a prompt dialog with a text input field.",
|
|
81
81
|
"complexTypes": [
|
|
82
|
-
"
|
|
83
|
-
"
|
|
82
|
+
"PromptResult",
|
|
83
|
+
"PromptOptions"
|
|
84
84
|
],
|
|
85
85
|
"slug": "prompt"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"name": "singleSelect",
|
|
89
|
-
"signature": "(options: SingleSelectOptions) =>
|
|
89
|
+
"signature": "(options: SingleSelectOptions) => Promise<SingleSelectResult>",
|
|
90
90
|
"parameters": [
|
|
91
91
|
{
|
|
92
92
|
"name": "options",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"type": "SingleSelectOptions"
|
|
95
95
|
}
|
|
96
96
|
],
|
|
97
|
-
"returns": "
|
|
97
|
+
"returns": "Promise<SingleSelectResult>",
|
|
98
98
|
"tags": [
|
|
99
99
|
{
|
|
100
100
|
"name": "param",
|
|
@@ -107,14 +107,14 @@
|
|
|
107
107
|
],
|
|
108
108
|
"docs": "Show a single-select dialog where the user picks one option.",
|
|
109
109
|
"complexTypes": [
|
|
110
|
-
"
|
|
111
|
-
"
|
|
110
|
+
"SingleSelectResult",
|
|
111
|
+
"SingleSelectOptions"
|
|
112
112
|
],
|
|
113
113
|
"slug": "singleselect"
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
"name": "multiSelect",
|
|
117
|
-
"signature": "(options: MultiSelectOptions) =>
|
|
117
|
+
"signature": "(options: MultiSelectOptions) => Promise<MultiSelectResult>",
|
|
118
118
|
"parameters": [
|
|
119
119
|
{
|
|
120
120
|
"name": "options",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"type": "MultiSelectOptions"
|
|
123
123
|
}
|
|
124
124
|
],
|
|
125
|
-
"returns": "
|
|
125
|
+
"returns": "Promise<MultiSelectResult>",
|
|
126
126
|
"tags": [
|
|
127
127
|
{
|
|
128
128
|
"name": "param",
|
|
@@ -135,14 +135,14 @@
|
|
|
135
135
|
],
|
|
136
136
|
"docs": "Show a multi-select dialog where the user picks one or more options.",
|
|
137
137
|
"complexTypes": [
|
|
138
|
-
"
|
|
139
|
-
"
|
|
138
|
+
"MultiSelectResult",
|
|
139
|
+
"MultiSelectOptions"
|
|
140
140
|
],
|
|
141
141
|
"slug": "multiselect"
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
144
|
"name": "sheet",
|
|
145
|
-
"signature": "(options: SheetOptions) =>
|
|
145
|
+
"signature": "(options: SheetOptions) => Promise<SheetResult>",
|
|
146
146
|
"parameters": [
|
|
147
147
|
{
|
|
148
148
|
"name": "options",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"type": "SheetOptions"
|
|
151
151
|
}
|
|
152
152
|
],
|
|
153
|
-
"returns": "
|
|
153
|
+
"returns": "Promise<SheetResult>",
|
|
154
154
|
"tags": [
|
|
155
155
|
{
|
|
156
156
|
"name": "param",
|
|
@@ -163,14 +163,14 @@
|
|
|
163
163
|
],
|
|
164
164
|
"docs": "Show a sheet dialog with a header, title, and structured data rows.",
|
|
165
165
|
"complexTypes": [
|
|
166
|
-
"
|
|
167
|
-
"
|
|
166
|
+
"SheetResult",
|
|
167
|
+
"SheetOptions"
|
|
168
168
|
],
|
|
169
169
|
"slug": "sheet"
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
"name": "messageSheet",
|
|
173
|
-
"signature": "(options: MessageSheetOptions) =>
|
|
173
|
+
"signature": "(options: MessageSheetOptions) => Promise<MessageSheetResult>",
|
|
174
174
|
"parameters": [
|
|
175
175
|
{
|
|
176
176
|
"name": "options",
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
"type": "MessageSheetOptions"
|
|
179
179
|
}
|
|
180
180
|
],
|
|
181
|
-
"returns": "
|
|
181
|
+
"returns": "Promise<MessageSheetResult>",
|
|
182
182
|
"tags": [
|
|
183
183
|
{
|
|
184
184
|
"name": "param",
|
|
@@ -191,8 +191,8 @@
|
|
|
191
191
|
],
|
|
192
192
|
"docs": "Show a message sheet dialog with an optional header logo, title, and message.",
|
|
193
193
|
"complexTypes": [
|
|
194
|
-
"
|
|
195
|
-
"
|
|
194
|
+
"MessageSheetResult",
|
|
195
|
+
"MessageSheetOptions"
|
|
196
196
|
],
|
|
197
197
|
"slug": "messagesheet"
|
|
198
198
|
}
|
|
@@ -221,6 +221,22 @@
|
|
|
221
221
|
}
|
|
222
222
|
]
|
|
223
223
|
},
|
|
224
|
+
{
|
|
225
|
+
"name": "ConfirmResult",
|
|
226
|
+
"slug": "confirmresult",
|
|
227
|
+
"docs": "",
|
|
228
|
+
"tags": [],
|
|
229
|
+
"methods": [],
|
|
230
|
+
"properties": [
|
|
231
|
+
{
|
|
232
|
+
"name": "value",
|
|
233
|
+
"tags": [],
|
|
234
|
+
"docs": "Whether the user confirmed (`true`) or cancelled (`false`).",
|
|
235
|
+
"complexTypes": [],
|
|
236
|
+
"type": "boolean"
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
224
240
|
{
|
|
225
241
|
"name": "ConfirmOptions",
|
|
226
242
|
"slug": "confirmoptions",
|
|
@@ -255,8 +271,8 @@
|
|
|
255
271
|
]
|
|
256
272
|
},
|
|
257
273
|
{
|
|
258
|
-
"name": "
|
|
259
|
-
"slug": "
|
|
274
|
+
"name": "PromptResult",
|
|
275
|
+
"slug": "promptresult",
|
|
260
276
|
"docs": "",
|
|
261
277
|
"tags": [],
|
|
262
278
|
"methods": [],
|
|
@@ -264,7 +280,14 @@
|
|
|
264
280
|
{
|
|
265
281
|
"name": "value",
|
|
266
282
|
"tags": [],
|
|
267
|
-
"docs": "
|
|
283
|
+
"docs": "The text entered by the user. Empty string if cancelled.",
|
|
284
|
+
"complexTypes": [],
|
|
285
|
+
"type": "string"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "cancelled",
|
|
289
|
+
"tags": [],
|
|
290
|
+
"docs": "Whether the user cancelled the dialog.",
|
|
268
291
|
"complexTypes": [],
|
|
269
292
|
"type": "boolean"
|
|
270
293
|
}
|
|
@@ -330,8 +353,8 @@
|
|
|
330
353
|
]
|
|
331
354
|
},
|
|
332
355
|
{
|
|
333
|
-
"name": "
|
|
334
|
-
"slug": "
|
|
356
|
+
"name": "SingleSelectResult",
|
|
357
|
+
"slug": "singleselectresult",
|
|
335
358
|
"docs": "",
|
|
336
359
|
"tags": [],
|
|
337
360
|
"methods": [],
|
|
@@ -339,9 +362,9 @@
|
|
|
339
362
|
{
|
|
340
363
|
"name": "value",
|
|
341
364
|
"tags": [],
|
|
342
|
-
"docs": "The
|
|
365
|
+
"docs": "The value of the selected option, or `null` if cancelled.",
|
|
343
366
|
"complexTypes": [],
|
|
344
|
-
"type": "string"
|
|
367
|
+
"type": "string | null"
|
|
345
368
|
},
|
|
346
369
|
{
|
|
347
370
|
"name": "cancelled",
|
|
@@ -366,7 +389,7 @@
|
|
|
366
389
|
"complexTypes": [
|
|
367
390
|
"SelectOption"
|
|
368
391
|
],
|
|
369
|
-
"type": "
|
|
392
|
+
"type": "SelectOption[]"
|
|
370
393
|
},
|
|
371
394
|
{
|
|
372
395
|
"name": "selectedValue",
|
|
@@ -425,18 +448,18 @@
|
|
|
425
448
|
]
|
|
426
449
|
},
|
|
427
450
|
{
|
|
428
|
-
"name": "
|
|
429
|
-
"slug": "
|
|
451
|
+
"name": "MultiSelectResult",
|
|
452
|
+
"slug": "multiselectresult",
|
|
430
453
|
"docs": "",
|
|
431
454
|
"tags": [],
|
|
432
455
|
"methods": [],
|
|
433
456
|
"properties": [
|
|
434
457
|
{
|
|
435
|
-
"name": "
|
|
458
|
+
"name": "values",
|
|
436
459
|
"tags": [],
|
|
437
|
-
"docs": "The
|
|
460
|
+
"docs": "The values of the selected options. Empty array if cancelled.",
|
|
438
461
|
"complexTypes": [],
|
|
439
|
-
"type": "string
|
|
462
|
+
"type": "string[]"
|
|
440
463
|
},
|
|
441
464
|
{
|
|
442
465
|
"name": "cancelled",
|
|
@@ -461,14 +484,14 @@
|
|
|
461
484
|
"complexTypes": [
|
|
462
485
|
"SelectOption"
|
|
463
486
|
],
|
|
464
|
-
"type": "
|
|
487
|
+
"type": "SelectOption[]"
|
|
465
488
|
},
|
|
466
489
|
{
|
|
467
490
|
"name": "selectedValues",
|
|
468
491
|
"tags": [],
|
|
469
492
|
"docs": "Values of the initially selected options.",
|
|
470
493
|
"complexTypes": [],
|
|
471
|
-
"type": "
|
|
494
|
+
"type": "string[] | undefined"
|
|
472
495
|
},
|
|
473
496
|
{
|
|
474
497
|
"name": "okButtonTitle",
|
|
@@ -497,23 +520,16 @@
|
|
|
497
520
|
]
|
|
498
521
|
},
|
|
499
522
|
{
|
|
500
|
-
"name": "
|
|
501
|
-
"slug": "
|
|
523
|
+
"name": "SheetResult",
|
|
524
|
+
"slug": "sheetresult",
|
|
502
525
|
"docs": "",
|
|
503
526
|
"tags": [],
|
|
504
527
|
"methods": [],
|
|
505
528
|
"properties": [
|
|
506
529
|
{
|
|
507
|
-
"name": "
|
|
508
|
-
"tags": [],
|
|
509
|
-
"docs": "The values of the selected options. Empty array if cancelled.",
|
|
510
|
-
"complexTypes": [],
|
|
511
|
-
"type": "{}"
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
"name": "cancelled",
|
|
530
|
+
"name": "confirmed",
|
|
515
531
|
"tags": [],
|
|
516
|
-
"docs": "
|
|
532
|
+
"docs": "True if confirmed, false if cancelled",
|
|
517
533
|
"complexTypes": [],
|
|
518
534
|
"type": "boolean"
|
|
519
535
|
}
|
|
@@ -529,7 +545,7 @@
|
|
|
529
545
|
{
|
|
530
546
|
"name": "headerLogo",
|
|
531
547
|
"tags": [],
|
|
532
|
-
"docs": "Header logo -
|
|
548
|
+
"docs": "Header logo. Supports:\n- PNG/JPEG/WebP/GIF as base64 data URL or HTTP/HTTPS URL\n- SVG as `data:image/svg+xml;base64,...`, `data:image/svg+xml,<svg ...>...` (URL-encoded or plain), or any HTTP/HTTPS URL ending in `.svg`",
|
|
533
549
|
"complexTypes": [],
|
|
534
550
|
"type": "string | undefined"
|
|
535
551
|
},
|
|
@@ -554,7 +570,7 @@
|
|
|
554
570
|
"complexTypes": [
|
|
555
571
|
"SheetRow"
|
|
556
572
|
],
|
|
557
|
-
"type": "
|
|
573
|
+
"type": "SheetRow[]"
|
|
558
574
|
},
|
|
559
575
|
{
|
|
560
576
|
"name": "confirmButtonTitle",
|
|
@@ -598,7 +614,7 @@
|
|
|
598
614
|
{
|
|
599
615
|
"name": "logo",
|
|
600
616
|
"tags": [],
|
|
601
|
-
"docs": "Optional logo/icon -
|
|
617
|
+
"docs": "Optional logo/icon. Supports:\n- PNG/JPEG/WebP/GIF as base64 data URL or HTTP/HTTPS URL\n- SVG as `data:image/svg+xml;base64,...`, `data:image/svg+xml,<svg ...>...` (URL-encoded or plain), or any HTTP/HTTPS URL ending in `.svg`",
|
|
602
618
|
"complexTypes": [],
|
|
603
619
|
"type": "string | undefined"
|
|
604
620
|
},
|
|
@@ -612,8 +628,8 @@
|
|
|
612
628
|
]
|
|
613
629
|
},
|
|
614
630
|
{
|
|
615
|
-
"name": "
|
|
616
|
-
"slug": "
|
|
631
|
+
"name": "MessageSheetResult",
|
|
632
|
+
"slug": "messagesheetresult",
|
|
617
633
|
"docs": "",
|
|
618
634
|
"tags": [],
|
|
619
635
|
"methods": [],
|
|
@@ -637,7 +653,7 @@
|
|
|
637
653
|
{
|
|
638
654
|
"name": "headerLogo",
|
|
639
655
|
"tags": [],
|
|
640
|
-
"docs": "Header logo -
|
|
656
|
+
"docs": "Header logo. Supports:\n- PNG/JPEG/WebP/GIF as base64 data URL or HTTP/HTTPS URL\n- SVG as `data:image/svg+xml;base64,...`, `data:image/svg+xml,<svg ...>...` (URL-encoded or plain), or any HTTP/HTTPS URL ending in `.svg`",
|
|
641
657
|
"complexTypes": [],
|
|
642
658
|
"type": "string | undefined"
|
|
643
659
|
},
|
|
@@ -686,22 +702,6 @@
|
|
|
686
702
|
"type": "DialogMode"
|
|
687
703
|
}
|
|
688
704
|
]
|
|
689
|
-
},
|
|
690
|
-
{
|
|
691
|
-
"name": "MessageSheetResult",
|
|
692
|
-
"slug": "messagesheetresult",
|
|
693
|
-
"docs": "",
|
|
694
|
-
"tags": [],
|
|
695
|
-
"methods": [],
|
|
696
|
-
"properties": [
|
|
697
|
-
{
|
|
698
|
-
"name": "confirmed",
|
|
699
|
-
"tags": [],
|
|
700
|
-
"docs": "True if confirmed, false if cancelled",
|
|
701
|
-
"complexTypes": [],
|
|
702
|
-
"type": "boolean"
|
|
703
|
-
}
|
|
704
|
-
]
|
|
705
705
|
}
|
|
706
706
|
],
|
|
707
707
|
"enums": [],
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* - `'basic'` — Standard modal dialog (default)
|
|
5
5
|
* - `'fullscreen'` — Full-screen dialog presentation
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type DialogMode = 'basic' | 'fullscreen';
|
|
8
8
|
export interface DialogStyleOptions {
|
|
9
9
|
/**
|
|
10
10
|
* Color for the OK/primary button (hex format, e.g., "#FF5722")
|
|
@@ -260,13 +260,21 @@ export interface MultiSelectResult {
|
|
|
260
260
|
export interface SheetRow {
|
|
261
261
|
/** Row title (required) */
|
|
262
262
|
title: string;
|
|
263
|
-
/**
|
|
263
|
+
/**
|
|
264
|
+
* Optional logo/icon. Supports:
|
|
265
|
+
* - PNG/JPEG/WebP/GIF as base64 data URL or HTTP/HTTPS URL
|
|
266
|
+
* - SVG as `data:image/svg+xml;base64,...`, `data:image/svg+xml,<svg ...>...` (URL-encoded or plain), or any HTTP/HTTPS URL ending in `.svg`
|
|
267
|
+
*/
|
|
264
268
|
logo?: string;
|
|
265
269
|
/** Optional value displayed on the right */
|
|
266
270
|
value?: string;
|
|
267
271
|
}
|
|
268
272
|
export interface SheetOptions extends DialogStyleOptions {
|
|
269
|
-
/**
|
|
273
|
+
/**
|
|
274
|
+
* Header logo. Supports:
|
|
275
|
+
* - PNG/JPEG/WebP/GIF as base64 data URL or HTTP/HTTPS URL
|
|
276
|
+
* - SVG as `data:image/svg+xml;base64,...`, `data:image/svg+xml,<svg ...>...` (URL-encoded or plain), or any HTTP/HTTPS URL ending in `.svg`
|
|
277
|
+
*/
|
|
270
278
|
headerLogo?: string;
|
|
271
279
|
/** Sheet title */
|
|
272
280
|
title: string;
|
|
@@ -282,7 +290,11 @@ export interface SheetOptions extends DialogStyleOptions {
|
|
|
282
290
|
mode?: DialogMode;
|
|
283
291
|
}
|
|
284
292
|
export interface MessageSheetOptions extends DialogStyleOptions {
|
|
285
|
-
/**
|
|
293
|
+
/**
|
|
294
|
+
* Header logo. Supports:
|
|
295
|
+
* - PNG/JPEG/WebP/GIF as base64 data URL or HTTP/HTTPS URL
|
|
296
|
+
* - SVG as `data:image/svg+xml;base64,...`, `data:image/svg+xml,<svg ...>...` (URL-encoded or plain), or any HTTP/HTTPS URL ending in `.svg`
|
|
297
|
+
*/
|
|
286
298
|
headerLogo?: string;
|
|
287
299
|
/** Sheet title */
|
|
288
300
|
title: string;
|
|
@@ -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 /** 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"]}
|
|
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 /**\n * Optional logo/icon. Supports:\n * - PNG/JPEG/WebP/GIF as base64 data URL or HTTP/HTTPS URL\n * - SVG as `data:image/svg+xml;base64,...`, `data:image/svg+xml,<svg ...>...` (URL-encoded or plain), or any HTTP/HTTPS URL ending in `.svg`\n */\n logo?: string;\n /** Optional value displayed on the right */\n value?: string;\n}\n\nexport interface SheetOptions extends DialogStyleOptions {\n /**\n * Header logo. Supports:\n * - PNG/JPEG/WebP/GIF as base64 data URL or HTTP/HTTPS URL\n * - SVG as `data:image/svg+xml;base64,...`, `data:image/svg+xml,<svg ...>...` (URL-encoded or plain), or any HTTP/HTTPS URL ending in `.svg`\n */\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 /**\n * Header logo. Supports:\n * - PNG/JPEG/WebP/GIF as base64 data URL or HTTP/HTTPS URL\n * - SVG as `data:image/svg+xml;base64,...`, `data:image/svg+xml,<svg ...>...` (URL-encoded or plain), or any HTTP/HTTPS URL ending in `.svg`\n */\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"]}
|