@balikjs/mobile 0.1.16 → 0.1.17

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.
@@ -1,8 +1,8 @@
1
- import { createComponent as f, render as p, memo as h } from "solid-js/web";
2
- import { splitProps as b, mergeProps as L, createRoot as w, createSignal as E, Show as v } from "solid-js";
3
- import { Dialog as g } from "../Dialog/Dialog.js";
4
- import s from "./Confirm.module.css.js";
5
- const y = {
1
+ import { createComponent as u, render as p, memo as h } from "solid-js/web";
2
+ import { splitProps as b, mergeProps as L, createRoot as w, createSignal as E, Show as y } from "solid-js";
3
+ import { Dialog as C } from "../Dialog/Dialog.js";
4
+ import g from "./Confirm.module.css.js";
5
+ const S = {
6
6
  mode: "sheet",
7
7
  title: "Confirm",
8
8
  confirmLabel: "Confirm",
@@ -11,8 +11,8 @@ const y = {
11
11
  loading: !1
12
12
  };
13
13
  function d(o) {
14
- const [e] = b(L(y, o), ["mode", "open", "onOpenChange", "title", "confirmLabel", "cancelLabel", "danger", "loading", "onConfirm", "onCancel", "class", "children"]), r = !!e.onCancel;
15
- return f(g, {
14
+ const [e] = b(L(S, o), ["mode", "open", "onOpenChange", "title", "confirmLabel", "cancelLabel", "danger", "loading", "onConfirm", "onCancel", "class", "children"]), r = !!e.onCancel;
15
+ return u(C, {
16
16
  get mode() {
17
17
  return e.mode;
18
18
  },
@@ -47,7 +47,7 @@ function d(o) {
47
47
  return e.onCancel;
48
48
  },
49
49
  get footerClass() {
50
- return r ? void 0 : s.footerCenter;
50
+ return r ? void 0 : g.footerCenter;
51
51
  },
52
52
  get class() {
53
53
  return e.class;
@@ -57,33 +57,31 @@ function d(o) {
57
57
  }
58
58
  });
59
59
  }
60
- let i = null, t = null, m = null;
61
- function S() {
62
- if (m) return;
60
+ let i = null, t = null, f = null;
61
+ function O() {
62
+ if (f) return;
63
63
  const o = document.createElement("div");
64
64
  document.body.appendChild(o), w(() => {
65
65
  const [e, r] = E(null);
66
- m = r;
66
+ f = r;
67
67
  const c = (n) => {
68
- const u = e();
69
- if (n.prev) return;
70
- const l = i, a = t;
68
+ const m = e(), l = i, a = t;
71
69
  if (i = null, t = null, n.type === "confirm")
72
70
  l == null || l();
73
71
  else {
74
- const C = new Error("Cancel");
75
- C.code = "CANCEL", a == null || a(C);
72
+ const s = new Error("Cancel");
73
+ s.code = "CANCEL", a == null || a(s);
76
74
  }
77
75
  r({
78
- ...u,
76
+ ...m,
79
77
  open: !1
80
78
  });
81
79
  };
82
- p(() => f(v, {
80
+ p(() => u(y, {
83
81
  get when() {
84
82
  return e();
85
83
  },
86
- children: (n) => f(g, {
84
+ children: (n) => u(C, {
87
85
  get mode() {
88
86
  return n().mode || "sheet";
89
87
  },
@@ -108,18 +106,16 @@ function S() {
108
106
  return n().danger;
109
107
  },
110
108
  get footerClass() {
111
- return h(() => !!n().noCancel)() ? s.footerCenter : void 0;
109
+ return h(() => !!n().noCancel)() ? g.footerCenter : void 0;
112
110
  },
113
111
  onConfirm: () => c({
114
- type: "confirm",
115
- prev: n()
112
+ type: "confirm"
116
113
  }),
117
114
  onCancel: () => c({
118
- type: "cancel",
119
- prev: n()
115
+ type: "cancel"
120
116
  }),
121
- onOpenChange: (u) => {
122
- if (!u.open) {
117
+ onOpenChange: (m) => {
118
+ if (!m.open) {
123
119
  if (t) {
124
120
  const l = new Error("Cancel");
125
121
  l.code = "CANCEL";
@@ -136,12 +132,12 @@ function S() {
136
132
  }), o);
137
133
  });
138
134
  }
139
- d.confirm = (o = {}) => (S(), new Promise((e, r) => {
135
+ d.confirm = (o = {}) => (O(), new Promise((e, r) => {
140
136
  if (t) {
141
137
  const c = new Error("Superseded by a newer confirm()");
142
138
  c.code = "CANCEL", t(c);
143
139
  }
144
- i = e, t = r, m({
140
+ i = e, t = r, f({
145
141
  ...o,
146
142
  open: !0
147
143
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balikjs/mobile",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "A mobile-first UI component library built on top of Ark UI for Solid.js",
5
5
  "type": "module",
6
6
  "license": "MIT",