@marianmeres/stuic 2.1.16 → 2.1.18

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.
@@ -39,6 +39,9 @@ export class AlertConfirmPromptStack {
39
39
  o.labelCancel ??= this.defaults.labelCancel;
40
40
  o.iconFn ??= this.defaults.iconFn;
41
41
  o.title ??= ucf(`${o.type || ""}`);
42
+ o.CmpButtonOk ??= this.defaults.CmpButtonOk;
43
+ o.CmpButtonCancel ??= this.defaults.CmpButtonCancel;
44
+ o.CmpButtonCustom ??= this.defaults.CmpButtonCustom;
42
45
  // variant defaults to info
43
46
  if (!["info", "success", "warn", "error"].includes(o?.variant)) {
44
47
  o.variant = "info";
@@ -133,7 +133,7 @@
133
133
 
134
134
  let _iconFns = $derived({ ...notificationsDefaultIcons, ...iconFns });
135
135
 
136
- const maybeIcon = (n: Notification) => n.iconFn ?? _iconFns?.[n.type];
136
+ const maybeIcon = (n: Notification) => (n.iconFn ?? _iconFns?.[n.type])?.();
137
137
 
138
138
  const _classWrapX = `
139
139
  fixed z-50 flex flex-row inset-0
@@ -222,7 +222,7 @@
222
222
  <div class={twMerge("wrap-y", _classWrapY, YMAP_M[yMobile], YMAP[y], classWrapY)}>
223
223
  {#each notifications.stack as n (n.id)}
224
224
  {@const { Cmp, props } = maybeComponent(n)}
225
- {@const iconFn = maybeIcon(n)}
225
+ {@const iconHtml = maybeIcon(n)}
226
226
  {@const showXButton = !noXButton || n.ttl > 1000}
227
227
  {#if Cmp}
228
228
  <Cmp {...props || {}} notification={n} {notifications} />
@@ -247,9 +247,9 @@
247
247
  {n.count}
248
248
  </div>
249
249
  {/if}
250
- {#if !noIcons && typeof iconFn === "function"}
250
+ {#if !noIcons && iconHtml}
251
251
  <div class={twMerge("icon", _classNotifIcon, classNotifIcon)}>
252
- {@html iconFn()}
252
+ {@html iconHtml}
253
253
  </div>
254
254
  {/if}
255
255
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/stuic",
3
- "version": "2.1.16",
3
+ "version": "2.1.18",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",