@htmlbricks/hb-toast 0.62.7 → 0.62.9

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/manifest.json CHANGED
@@ -7,6 +7,25 @@
7
7
  "Events": {
8
8
  "additionalProperties": false,
9
9
  "properties": {
10
+ "toastConfirm": {
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "buttonId": {
14
+ "type": "string"
15
+ },
16
+ "confirm": {
17
+ "type": "boolean"
18
+ },
19
+ "id": {
20
+ "type": "string"
21
+ }
22
+ },
23
+ "required": [
24
+ "id",
25
+ "confirm"
26
+ ],
27
+ "type": "object"
28
+ },
10
29
  "toastShow": {
11
30
  "additionalProperties": false,
12
31
  "properties": {
@@ -28,7 +47,8 @@
28
47
  }
29
48
  },
30
49
  "required": [
31
- "toastShow"
50
+ "toastShow",
51
+ "toastConfirm"
32
52
  ],
33
53
  "type": "object"
34
54
  }
@@ -41,6 +61,12 @@
41
61
  "Component": {
42
62
  "additionalProperties": false,
43
63
  "properties": {
64
+ "buttons": {
65
+ "items": {
66
+ "$ref": "#/definitions/TToastButton"
67
+ },
68
+ "type": "array"
69
+ },
44
70
  "content": {
45
71
  "type": "string"
46
72
  },
@@ -107,6 +133,47 @@
107
133
  "content"
108
134
  ],
109
135
  "type": "object"
136
+ },
137
+ "TToastButton": {
138
+ "additionalProperties": false,
139
+ "properties": {
140
+ "color": {
141
+ "type": "string"
142
+ },
143
+ "icon": {
144
+ "type": "string"
145
+ },
146
+ "id": {
147
+ "type": "string"
148
+ },
149
+ "text": {
150
+ "type": "string"
151
+ },
152
+ "themeColor": {
153
+ "enum": [
154
+ "info",
155
+ "success",
156
+ "warning",
157
+ "danger",
158
+ "primary",
159
+ "secondary",
160
+ "light",
161
+ "dark"
162
+ ],
163
+ "type": "string"
164
+ },
165
+ "type": {
166
+ "enum": [
167
+ "confirm",
168
+ "cancel"
169
+ ],
170
+ "type": "string"
171
+ }
172
+ },
173
+ "required": [
174
+ "type"
175
+ ],
176
+ "type": "object"
110
177
  }
111
178
  }
112
179
  }
@@ -133,6 +200,21 @@
133
200
  "type": "text"
134
201
  }
135
202
  },
203
+ "level": {
204
+ "control": {
205
+ "type": "select"
206
+ },
207
+ "options": [
208
+ "primary",
209
+ "secondary",
210
+ "success",
211
+ "danger",
212
+ "warning",
213
+ "info",
214
+ "light",
215
+ "dark"
216
+ ]
217
+ },
136
218
  "content": {
137
219
  "control": {
138
220
  "type": "text"
@@ -163,6 +245,14 @@
163
245
  "bottom-center",
164
246
  "bottom-right"
165
247
  ]
248
+ },
249
+ "buttons": {
250
+ "control": {
251
+ "type": "object"
252
+ }
253
+ },
254
+ "toastConfirm": {
255
+ "action": "toastConfirm"
166
256
  }
167
257
  },
168
258
  "styleSetup": {
@@ -251,10 +341,10 @@
251
341
  {
252
342
  "name": "timeoutwithtimer",
253
343
  "data": {
254
- "timeout": 120000,
344
+ "timeout": 12000,
255
345
  "title": "Bootstrap",
256
346
  "show": "yes",
257
- "level": "success",
347
+ "level": "warning",
258
348
  "content": "Hello, world! This is a toast message.",
259
349
  "img": "data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22200%22%20height%3D%22200%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20200%20200%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_17e7e03606d%20text%20%7B%20fill%3Argba(255%2C255%2C255%2C.75)%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A10pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_17e7e03606d%22%3E%3Crect%20width%3D%22200%22%20height%3D%22200%22%20fill%3D%22%23777%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%2274.4296875%22%20y%3D%22104.5%22%3E200x200%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E"
260
350
  }
@@ -307,6 +397,29 @@
307
397
  "progress": "100",
308
398
  "img": "data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22200%22%20height%3D%22200%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20200%20200%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_17e7e03606d%20text%20%7B%20fill%3Argba(255%2C255%2C.75)%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A10pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_17e7e03606d%22%3E%3Crect%20width%3D%22200%22%20height%3D%22200%22%20fill%3D%22%23777%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%2274.4296875%22%20y%3D%22104.5%22%3E200x200%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E"
309
399
  }
400
+ },
401
+ {
402
+ "name": "withButtons",
403
+ "description": "Toast with confirmation buttons.",
404
+ "data": {
405
+ "show": "yes",
406
+ "title": "Confirmation",
407
+ "content": "Are you sure you want to proceed?",
408
+ "level": "light",
409
+ "buttons": [
410
+ {
411
+ "type": "cancel",
412
+ "id": "btn-cancel"
413
+ },
414
+ {
415
+ "type": "confirm",
416
+ "id": "btn-confirm",
417
+ "text": "Yes, proceed",
418
+ "icon": "bi-check-circle"
419
+ }
420
+ ],
421
+ "img": "data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22200%22%20height%3D%22200%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20200%20200%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_17e7e03606d%20text%20%7B%20fill%3Argba(255%2C255%2C255%2C.75)%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A10pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_17e7e03606d%22%3E%3Crect%20width%3D%22200%22%20height%3D%22200%22%20fill%3D%22%23777%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%2274.4296875%22%20y%3D%22104.5%22%3E200x200%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E"
422
+ }
310
423
  }
311
424
  ],
312
425
  "screenshots": [],
@@ -327,5 +440,5 @@
327
440
  "size": {},
328
441
  "iifePath": "main.iife.js",
329
442
  "repoName": "@htmlbricks/hb-toast",
330
- "version": "0.62.7"
443
+ "version": "0.62.9"
331
444
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlbricks/hb-toast",
3
- "version": "0.62.7",
3
+ "version": "0.62.9",
4
4
  "contributors": [],
5
5
  "description": "",
6
6
  "licenses": [
@@ -5,6 +5,12 @@
5
5
  "Component": {
6
6
  "additionalProperties": false,
7
7
  "properties": {
8
+ "buttons": {
9
+ "items": {
10
+ "$ref": "#/definitions/TToastButton"
11
+ },
12
+ "type": "array"
13
+ },
8
14
  "content": {
9
15
  "type": "string"
10
16
  },
@@ -71,6 +77,47 @@
71
77
  "content"
72
78
  ],
73
79
  "type": "object"
80
+ },
81
+ "TToastButton": {
82
+ "additionalProperties": false,
83
+ "properties": {
84
+ "color": {
85
+ "type": "string"
86
+ },
87
+ "icon": {
88
+ "type": "string"
89
+ },
90
+ "id": {
91
+ "type": "string"
92
+ },
93
+ "text": {
94
+ "type": "string"
95
+ },
96
+ "themeColor": {
97
+ "enum": [
98
+ "info",
99
+ "success",
100
+ "warning",
101
+ "danger",
102
+ "primary",
103
+ "secondary",
104
+ "light",
105
+ "dark"
106
+ ],
107
+ "type": "string"
108
+ },
109
+ "type": {
110
+ "enum": [
111
+ "confirm",
112
+ "cancel"
113
+ ],
114
+ "type": "string"
115
+ }
116
+ },
117
+ "required": [
118
+ "type"
119
+ ],
120
+ "type": "object"
74
121
  }
75
122
  }
76
123
  }
@@ -1,3 +1,12 @@
1
+ export type TToastButton = {
2
+ type: "confirm" | "cancel"
3
+ color?: string,
4
+ themeColor?: "info" | "success" | "warning" | "danger" | "primary" | "secondary" | "light" | "dark";
5
+ icon?: string;
6
+ id?: string;
7
+ text?: string;
8
+ }
9
+
1
10
  export type Component = {
2
11
  id?: string;
3
12
  style?: string;
@@ -10,9 +19,11 @@ export type Component = {
10
19
  progress?: string;
11
20
  level?: "info" | "success" | "warning" | "danger" | "primary" | "secondary" | "light" | "dark";
12
21
  position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
22
+ buttons?: TToastButton[]
23
+
13
24
  };
14
25
 
15
26
  export type Events = {
16
27
  toastShow: { id: string; show: boolean; disappear?: boolean };
17
- // toastConfirm: { id: string; confirm: boolean };
28
+ toastConfirm: { id: string; confirm: boolean; buttonId?: string };
18
29
  };
@@ -5,6 +5,25 @@
5
5
  "Events": {
6
6
  "additionalProperties": false,
7
7
  "properties": {
8
+ "toastConfirm": {
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "buttonId": {
12
+ "type": "string"
13
+ },
14
+ "confirm": {
15
+ "type": "boolean"
16
+ },
17
+ "id": {
18
+ "type": "string"
19
+ }
20
+ },
21
+ "required": [
22
+ "id",
23
+ "confirm"
24
+ ],
25
+ "type": "object"
26
+ },
8
27
  "toastShow": {
9
28
  "additionalProperties": false,
10
29
  "properties": {
@@ -26,7 +45,8 @@
26
45
  }
27
46
  },
28
47
  "required": [
29
- "toastShow"
48
+ "toastShow",
49
+ "toastConfirm"
30
50
  ],
31
51
  "type": "object"
32
52
  }