@htmlbricks/hb-toast 0.62.8 → 0.62.10

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,7 +7,22 @@
7
7
  "Events": {
8
8
  "additionalProperties": false,
9
9
  "properties": {
10
- "toastShow": {
10
+ "action": {
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "action": {
14
+ "type": "string"
15
+ },
16
+ "id": {
17
+ "type": "string"
18
+ }
19
+ },
20
+ "required": [
21
+ "id"
22
+ ],
23
+ "type": "object"
24
+ },
25
+ "changeVisibility": {
11
26
  "additionalProperties": false,
12
27
  "properties": {
13
28
  "disappear": {
@@ -28,7 +43,8 @@
28
43
  }
29
44
  },
30
45
  "required": [
31
- "toastShow"
46
+ "changeVisibility",
47
+ "action"
32
48
  ],
33
49
  "type": "object"
34
50
  }
@@ -41,6 +57,12 @@
41
57
  "Component": {
42
58
  "additionalProperties": false,
43
59
  "properties": {
60
+ "buttons": {
61
+ "items": {
62
+ "$ref": "#/definitions/TToastButton"
63
+ },
64
+ "type": "array"
65
+ },
44
66
  "content": {
45
67
  "type": "string"
46
68
  },
@@ -107,6 +129,47 @@
107
129
  "content"
108
130
  ],
109
131
  "type": "object"
132
+ },
133
+ "TToastButton": {
134
+ "additionalProperties": false,
135
+ "properties": {
136
+ "action": {
137
+ "type": "string"
138
+ },
139
+ "color": {
140
+ "type": "string"
141
+ },
142
+ "icon": {
143
+ "type": "string"
144
+ },
145
+ "text": {
146
+ "type": "string"
147
+ },
148
+ "themeColor": {
149
+ "enum": [
150
+ "info",
151
+ "success",
152
+ "warning",
153
+ "danger",
154
+ "primary",
155
+ "secondary",
156
+ "light",
157
+ "dark"
158
+ ],
159
+ "type": "string"
160
+ },
161
+ "type": {
162
+ "enum": [
163
+ "confirm",
164
+ "cancel"
165
+ ],
166
+ "type": "string"
167
+ }
168
+ },
169
+ "required": [
170
+ "type"
171
+ ],
172
+ "type": "object"
110
173
  }
111
174
  }
112
175
  }
@@ -133,13 +196,28 @@
133
196
  "type": "text"
134
197
  }
135
198
  },
199
+ "level": {
200
+ "control": {
201
+ "type": "select"
202
+ },
203
+ "options": [
204
+ "primary",
205
+ "secondary",
206
+ "success",
207
+ "danger",
208
+ "warning",
209
+ "info",
210
+ "light",
211
+ "dark"
212
+ ]
213
+ },
136
214
  "content": {
137
215
  "control": {
138
216
  "type": "text"
139
217
  }
140
218
  },
141
- "toastShow": {
142
- "action": "toastShow"
219
+ "changeVisibility": {
220
+ "action": "changeVisibility"
143
221
  },
144
222
  "timeout": {
145
223
  "control": {
@@ -163,6 +241,14 @@
163
241
  "bottom-center",
164
242
  "bottom-right"
165
243
  ]
244
+ },
245
+ "buttons": {
246
+ "control": {
247
+ "type": "object"
248
+ }
249
+ },
250
+ "action": {
251
+ "action": "action"
166
252
  }
167
253
  },
168
254
  "styleSetup": {
@@ -254,7 +340,7 @@
254
340
  "timeout": 12000,
255
341
  "title": "Bootstrap",
256
342
  "show": "yes",
257
- "level": "success",
343
+ "level": "warning",
258
344
  "content": "Hello, world! This is a toast message.",
259
345
  "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
346
  }
@@ -307,6 +393,29 @@
307
393
  "progress": "100",
308
394
  "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
395
  }
396
+ },
397
+ {
398
+ "name": "withButtons",
399
+ "description": "Toast with confirmation buttons.",
400
+ "data": {
401
+ "show": "yes",
402
+ "title": "Confirmation",
403
+ "content": "Are you sure you want to proceed?",
404
+ "level": "light",
405
+ "buttons": [
406
+ {
407
+ "type": "cancel",
408
+ "action": "btn-cancel"
409
+ },
410
+ {
411
+ "type": "confirm",
412
+ "action": "btn-confirm",
413
+ "text": "Yes, proceed",
414
+ "icon": "bi-check-circle"
415
+ }
416
+ ],
417
+ "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"
418
+ }
310
419
  }
311
420
  ],
312
421
  "screenshots": [],
@@ -327,5 +436,5 @@
327
436
  "size": {},
328
437
  "iifePath": "main.iife.js",
329
438
  "repoName": "@htmlbricks/hb-toast",
330
- "version": "0.62.8"
439
+ "version": "0.62.10"
331
440
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlbricks/hb-toast",
3
- "version": "0.62.8",
3
+ "version": "0.62.10",
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
+ "action": {
85
+ "type": "string"
86
+ },
87
+ "color": {
88
+ "type": "string"
89
+ },
90
+ "icon": {
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
+ action?: 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
- toastShow: { id: string; show: boolean; disappear?: boolean };
17
- // toastConfirm: { id: string; confirm: boolean };
27
+ changeVisibility: { id: string; show: boolean; disappear?: boolean };
28
+ action: { id: string; action?: string };
18
29
  };
@@ -5,7 +5,22 @@
5
5
  "Events": {
6
6
  "additionalProperties": false,
7
7
  "properties": {
8
- "toastShow": {
8
+ "action": {
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "action": {
12
+ "type": "string"
13
+ },
14
+ "id": {
15
+ "type": "string"
16
+ }
17
+ },
18
+ "required": [
19
+ "id"
20
+ ],
21
+ "type": "object"
22
+ },
23
+ "changeVisibility": {
9
24
  "additionalProperties": false,
10
25
  "properties": {
11
26
  "disappear": {
@@ -26,7 +41,8 @@
26
41
  }
27
42
  },
28
43
  "required": [
29
- "toastShow"
44
+ "changeVisibility",
45
+ "action"
30
46
  ],
31
47
  "type": "object"
32
48
  }