@tachui/core 0.8.23 → 0.8.25
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/dist/assets/index.js +41 -40
- package/dist/{binding-DCV5PKkK.js → binding-DCr-JHsC.js} +9 -9
- package/dist/build-tools/typegen-runner.d.ts +4 -0
- package/dist/build-tools/typegen-runner.d.ts.map +1 -1
- package/dist/cleanup-BR8UpYPX.js +61 -0
- package/dist/common.js +272 -277
- package/dist/{component-D-O9yq0P.js → component-BzvSm8rM.js} +19 -19
- package/dist/{component-base-C41K3NTe.js → component-base-Do2EdQkr.js} +32 -33
- package/dist/{component-context-B9HI2nZH.js → component-context-C7Y6Xu6h.js} +1 -1
- package/dist/components/index.js +1 -1
- package/dist/computed-CA4Cgtoe.js +407 -0
- package/dist/{concatenated-component-2Gzy5e2c.js → concatenated-component-CA54ng_j.js} +43 -44
- package/dist/css-classes/index.js +2 -2
- package/dist/{effect-BsW3fy1q.js → effect-DgNm6jk9.js} +3 -3
- package/dist/{enhanced-renderer-t9Ni2EEG.js → enhanced-renderer-D05CCloF.js} +26 -28
- package/dist/essential.js +276 -281
- package/dist/factories-Bz6LZlk6.js +653 -0
- package/dist/{factory-gqfMcmOy.js → factory-B1YXfgU1.js} +23 -29
- package/dist/full.d.ts +12 -0
- package/dist/full.d.ts.map +1 -0
- package/dist/full.js +436 -0
- package/dist/gradients/index.js +53 -53
- package/dist/hooks-w_FYPLjI.js +158 -0
- package/dist/{index-DL9Cys3t.js → index-CmQmIgPK.js} +220 -233
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +295 -300
- package/dist/minimal-prod.js +106 -108
- package/dist/minimal.js +97 -98
- package/dist/modifiers/base.d.ts.map +1 -1
- package/dist/modifiers/base.js +188 -181
- package/dist/modifiers/builder.js +1 -1
- package/dist/modifiers/factories.d.ts.map +1 -1
- package/dist/modifiers/index.js +22 -23
- package/dist/modifiers/registry.js +1 -1
- package/dist/{observed-object-p1CLdrFm.js → observed-object-DCoyucmV.js} +3 -3
- package/dist/optimization-D9t53vNJ.js +308 -0
- package/dist/{proxy-Cp0QUXME.js → proxy-B7ZIqGd0.js} +3 -3
- package/dist/reactive/index.js +87 -85
- package/dist/runtime/dom-bridge.js +15 -17
- package/dist/runtime/index.js +71 -71
- package/dist/runtime/renderer.js +10 -11
- package/dist/signal-BRoiFOO7.js +262 -0
- package/dist/{signal-list-07gNXGiW.js → signal-list-_Eid-N7_.js} +285 -176
- package/dist/state/index.js +43 -44
- package/dist/theme-D5-09a8N.js +26 -0
- package/dist/validation/index.js +24 -26
- package/dist/version.js +1 -1
- package/package.json +16 -3
- package/dist/factories-B3-rmvkB.js +0 -268
- package/dist/hooks-WGmpzYgD.js +0 -446
- package/dist/optimization-CbKNA9w4.js +0 -21
- package/dist/presets-B9x94uRn.js +0 -381
- package/dist/scheduler-DppMK9mR.js +0 -169
- package/dist/theme-CRLPHryV.js +0 -687
- package/dist/{index-JQ1sW1SK.js → index-7vhCZc7g.js} +1 -1
package/dist/modifiers/base.js
CHANGED
|
@@ -1,131 +1,138 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import { ModifierPriority as
|
|
6
|
-
import { shouldExpandForInfinity as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { i as m, r as D } from "../computed-CA4Cgtoe.js";
|
|
2
|
+
import { c as b } from "../effect-DgNm6jk9.js";
|
|
3
|
+
import { g as B, i as S } from "../signal-BRoiFOO7.js";
|
|
4
|
+
import { a as _ } from "../theme-D5-09a8N.js";
|
|
5
|
+
import { ModifierPriority as C } from "@tachui/types/modifiers";
|
|
6
|
+
import { shouldExpandForInfinity as z, dimensionToCSS as g, isInfinity as p } from "../constants/layout.js";
|
|
7
|
+
import { o as F } from "../cleanup-BR8UpYPX.js";
|
|
8
|
+
const L = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
let y = null;
|
|
10
|
+
function ne(o) {
|
|
11
|
+
if (o === null)
|
|
12
|
+
return y = null, () => {
|
|
12
13
|
};
|
|
13
|
-
const i =
|
|
14
|
-
return
|
|
15
|
-
i?.(t, e),
|
|
14
|
+
const i = y;
|
|
15
|
+
return y = (t, e) => {
|
|
16
|
+
i?.(t, e), o(t, e);
|
|
16
17
|
}, () => {
|
|
17
|
-
|
|
18
|
+
y = i;
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function I(o, i, t) {
|
|
21
22
|
try {
|
|
22
|
-
|
|
23
|
+
o(i);
|
|
23
24
|
} catch (e) {
|
|
24
|
-
if (
|
|
25
|
-
|
|
25
|
+
if (y) {
|
|
26
|
+
y(e, { updaterId: t, value: i });
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
29
|
console.error(`Reactive style updater failed (${t}):`, e);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
const
|
|
32
|
-
let
|
|
33
|
-
function
|
|
34
|
-
|
|
32
|
+
const P = 200, c = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new Set();
|
|
33
|
+
let $ = !1, k = !1;
|
|
34
|
+
function W(o) {
|
|
35
|
+
c.get(o)?.forEach((t) => t()), c.delete(o), M.delete(o);
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
const
|
|
38
|
-
for (const i of Array.from(
|
|
37
|
+
function R() {
|
|
38
|
+
const o = Date.now();
|
|
39
|
+
for (const i of Array.from(v)) {
|
|
39
40
|
const t = i.deref();
|
|
40
41
|
if (!t) {
|
|
41
|
-
|
|
42
|
+
v.delete(i);
|
|
42
43
|
continue;
|
|
43
44
|
}
|
|
44
|
-
const e =
|
|
45
|
+
const e = M.get(t), n = c.get(t);
|
|
45
46
|
if (!e || !n || n.size === 0) {
|
|
46
|
-
|
|
47
|
+
v.delete(i);
|
|
47
48
|
continue;
|
|
48
49
|
}
|
|
49
50
|
if (t.isConnected) {
|
|
50
51
|
e.wasConnected = !0;
|
|
51
52
|
continue;
|
|
52
53
|
}
|
|
53
|
-
(e.wasConnected ||
|
|
54
|
+
(e.wasConnected || o - e.trackedAt >= P) && (W(t), v.delete(i));
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
|
|
57
|
+
function U() {
|
|
58
|
+
if (k || typeof setTimeout != "function") return;
|
|
59
|
+
k = !0;
|
|
60
|
+
const o = () => {
|
|
61
|
+
if (R(), v.size === 0) {
|
|
62
|
+
k = !1;
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
|
-
setTimeout(
|
|
65
|
+
setTimeout(o, P);
|
|
65
66
|
};
|
|
66
|
-
setTimeout(
|
|
67
|
+
setTimeout(o, P);
|
|
67
68
|
}
|
|
68
|
-
function
|
|
69
|
-
if (
|
|
69
|
+
function j() {
|
|
70
|
+
if ($ || typeof document > "u" || !document.documentElement || typeof MutationObserver > "u")
|
|
70
71
|
return;
|
|
71
72
|
new MutationObserver(() => {
|
|
72
|
-
|
|
73
|
-
}).observe(document.documentElement, { childList: !0, subtree: !0 }),
|
|
73
|
+
R();
|
|
74
|
+
}).observe(document.documentElement, { childList: !0, subtree: !0 }), $ = !0;
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
const t =
|
|
78
|
-
return t.add(i),
|
|
76
|
+
function N(o, i) {
|
|
77
|
+
j(), U();
|
|
78
|
+
const t = c.get(o) ?? /* @__PURE__ */ new Set(), e = t.size > 0;
|
|
79
|
+
return t.add(i), c.set(o, t), e || (M.set(o, {
|
|
79
80
|
trackedAt: Date.now(),
|
|
80
|
-
wasConnected:
|
|
81
|
-
}),
|
|
82
|
-
const n =
|
|
83
|
-
n && (n.delete(i), n.size === 0 && (
|
|
81
|
+
wasConnected: o.isConnected
|
|
82
|
+
}), v.add(new WeakRef(o))), () => {
|
|
83
|
+
const n = c.get(o);
|
|
84
|
+
n && (n.delete(i), n.size === 0 && (c.delete(o), M.delete(o)));
|
|
84
85
|
};
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
-
element:
|
|
87
|
+
function K({
|
|
88
|
+
element: o,
|
|
88
89
|
accessor: i,
|
|
89
90
|
updater: t,
|
|
90
91
|
updaterId: e
|
|
91
92
|
}) {
|
|
92
|
-
const n =
|
|
93
|
-
|
|
93
|
+
const n = L.get(o) ?? /* @__PURE__ */ new Map();
|
|
94
|
+
L.has(o) || L.set(o, n);
|
|
94
95
|
let r = n.get(i);
|
|
95
96
|
if (!r) {
|
|
96
97
|
const a = /* @__PURE__ */ new Map();
|
|
97
98
|
r = { effect: b(() => {
|
|
98
|
-
const
|
|
99
|
+
const u = i();
|
|
99
100
|
a.forEach(
|
|
100
|
-
(
|
|
101
|
+
(w, h) => I(w, u, h)
|
|
101
102
|
);
|
|
102
103
|
}), updaters: a }, n.set(i, r);
|
|
103
104
|
}
|
|
104
|
-
r.updaters.set(e, t),
|
|
105
|
-
let
|
|
105
|
+
r.updaters.set(e, t), I(t, i(), e);
|
|
106
|
+
let s = null;
|
|
106
107
|
const l = () => {
|
|
107
|
-
|
|
108
|
-
const a =
|
|
109
|
-
d && (d.updaters.delete(e), d.updaters.size === 0 && (d.effect.dispose(), a?.delete(i), m(i) && D(i)), a && a.size === 0 &&
|
|
108
|
+
s && (s(), s = null);
|
|
109
|
+
const a = L.get(o), d = a?.get(i);
|
|
110
|
+
d && (d.updaters.delete(e), d.updaters.size === 0 && (d.effect.dispose(), a?.delete(i), m(i) && D(i)), a && a.size === 0 && L.delete(o));
|
|
110
111
|
};
|
|
111
|
-
|
|
112
|
+
B() ? F(l) : s = N(o, l);
|
|
112
113
|
}
|
|
113
|
-
var
|
|
114
|
-
const
|
|
115
|
-
let
|
|
116
|
-
function
|
|
117
|
-
|
|
114
|
+
var x = Object.defineProperty, Y = (o, i, t) => i in o ? x(o, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[i] = t, f = (o, i, t) => Y(o, typeof i != "symbol" ? i + "" : i, t);
|
|
115
|
+
const H = Symbol.for("tachui.modifier.instanceId"), G = "core";
|
|
116
|
+
let V = 0;
|
|
117
|
+
function T(o) {
|
|
118
|
+
return typeof HTMLElement < "u" && o instanceof HTMLElement;
|
|
119
|
+
}
|
|
120
|
+
function A(o) {
|
|
121
|
+
return typeof o == "object" && o !== null && "style" in o && !!o.style;
|
|
122
|
+
}
|
|
123
|
+
function X(o) {
|
|
124
|
+
const i = o[H];
|
|
118
125
|
if (typeof i == "number") return i;
|
|
119
|
-
|
|
120
|
-
const t =
|
|
121
|
-
return Object.defineProperty(
|
|
126
|
+
V += 1;
|
|
127
|
+
const t = V;
|
|
128
|
+
return Object.defineProperty(o, H, {
|
|
122
129
|
value: t,
|
|
123
130
|
enumerable: !1,
|
|
124
131
|
configurable: !1,
|
|
125
132
|
writable: !1
|
|
126
133
|
}), t;
|
|
127
134
|
}
|
|
128
|
-
class
|
|
135
|
+
class E {
|
|
129
136
|
constructor(i) {
|
|
130
137
|
this.properties = i;
|
|
131
138
|
}
|
|
@@ -135,33 +142,32 @@ class C {
|
|
|
135
142
|
resolveReactiveProps(i, t) {
|
|
136
143
|
const e = {};
|
|
137
144
|
for (const [n, r] of Object.entries(i))
|
|
138
|
-
|
|
145
|
+
S(r) || m(r), e[n] = r;
|
|
139
146
|
return e;
|
|
140
147
|
}
|
|
141
148
|
/**
|
|
142
149
|
* Apply a single style change to an element with reactive support
|
|
143
150
|
*/
|
|
144
151
|
applyStyleChange(i, t, e) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
} else
|
|
154
|
-
i.style.setProperty(n, o);
|
|
155
|
-
});
|
|
156
|
-
else {
|
|
157
|
-
const r = String(e);
|
|
158
|
-
if (r.includes("!important")) {
|
|
159
|
-
const o = r.replace(/\s*!important\s*$/, "").trim();
|
|
160
|
-
i.style.setProperty(n, o, "important");
|
|
161
|
-
} else
|
|
162
|
-
i.style.setProperty(n, r);
|
|
152
|
+
const n = typeof HTMLElement < "u" && i instanceof HTMLElement;
|
|
153
|
+
if (!n && !i.style)
|
|
154
|
+
return;
|
|
155
|
+
const r = this.toCSSProperty(t), s = i.style, l = (a) => {
|
|
156
|
+
if (a.includes("!important")) {
|
|
157
|
+
const d = a.replace(/\s*!important\s*$/, "").trim();
|
|
158
|
+
s.setProperty(r, d, "important");
|
|
159
|
+
return;
|
|
163
160
|
}
|
|
161
|
+
s.setProperty(r, a);
|
|
162
|
+
};
|
|
163
|
+
if (S(e) || m(e)) {
|
|
164
|
+
b(() => {
|
|
165
|
+
const a = e();
|
|
166
|
+
l(String(a));
|
|
167
|
+
});
|
|
168
|
+
return;
|
|
164
169
|
}
|
|
170
|
+
l(String(e));
|
|
165
171
|
}
|
|
166
172
|
/**
|
|
167
173
|
* Convert camelCase property to CSS kebab-case
|
|
@@ -207,34 +213,35 @@ class C {
|
|
|
207
213
|
* Apply multiple CSS properties to an element with reactive support
|
|
208
214
|
*/
|
|
209
215
|
applyStyles(i, t) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
+
const e = typeof HTMLElement < "u" && i instanceof HTMLElement;
|
|
217
|
+
if (e || i.style) {
|
|
218
|
+
const n = i.style, r = (s, l) => {
|
|
219
|
+
if (n.setProperty)
|
|
220
|
+
if (typeof l == "string" && l.includes("!important")) {
|
|
221
|
+
const a = l.replace(/\s*!important\s*$/, "").trim();
|
|
222
|
+
n.setProperty(s, a, "important");
|
|
216
223
|
} else
|
|
217
|
-
|
|
224
|
+
n.setProperty(s, l);
|
|
218
225
|
else
|
|
219
|
-
|
|
226
|
+
n[s] = l;
|
|
220
227
|
};
|
|
221
|
-
for (const [
|
|
222
|
-
if (
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
const
|
|
226
|
-
|
|
228
|
+
for (const [s, l] of Object.entries(t))
|
|
229
|
+
if (l !== void 0) {
|
|
230
|
+
const a = this.toCSSProperty(s);
|
|
231
|
+
if (S(l) || m(l)) {
|
|
232
|
+
const d = l, u = X(this);
|
|
233
|
+
K({
|
|
227
234
|
element: i,
|
|
228
|
-
accessor:
|
|
229
|
-
updaterId: `${
|
|
230
|
-
updater: (
|
|
231
|
-
const
|
|
232
|
-
|
|
235
|
+
accessor: d,
|
|
236
|
+
updaterId: `${G}:${u}:${a}`,
|
|
237
|
+
updater: (w) => {
|
|
238
|
+
const h = this.toCSSValueForProperty(a, w);
|
|
239
|
+
r(a, h);
|
|
233
240
|
}
|
|
234
241
|
});
|
|
235
242
|
} else {
|
|
236
|
-
const
|
|
237
|
-
|
|
243
|
+
const d = this.toCSSValueForProperty(a, l);
|
|
244
|
+
r(a, d);
|
|
238
245
|
}
|
|
239
246
|
}
|
|
240
247
|
}
|
|
@@ -243,13 +250,13 @@ class C {
|
|
|
243
250
|
* Add CSS classes to an element
|
|
244
251
|
*/
|
|
245
252
|
addClasses(i, t) {
|
|
246
|
-
i
|
|
253
|
+
T(i) && i.classList.add(...t);
|
|
247
254
|
}
|
|
248
255
|
/**
|
|
249
256
|
* Remove CSS classes from an element
|
|
250
257
|
*/
|
|
251
258
|
removeClasses(i, t) {
|
|
252
|
-
i
|
|
259
|
+
T(i) && i.classList.remove(...t);
|
|
253
260
|
}
|
|
254
261
|
/**
|
|
255
262
|
* Create a style computation context
|
|
@@ -264,9 +271,9 @@ class C {
|
|
|
264
271
|
};
|
|
265
272
|
}
|
|
266
273
|
}
|
|
267
|
-
class
|
|
274
|
+
class re extends E {
|
|
268
275
|
constructor() {
|
|
269
|
-
super(...arguments), f(this, "type", "layout"), f(this, "priority",
|
|
276
|
+
super(...arguments), f(this, "type", "layout"), f(this, "priority", C.LAYOUT);
|
|
270
277
|
}
|
|
271
278
|
apply(i, t) {
|
|
272
279
|
if (!i.element || !t.element) return;
|
|
@@ -280,41 +287,41 @@ class te extends C {
|
|
|
280
287
|
);
|
|
281
288
|
this.applyStyles(t.element, n);
|
|
282
289
|
const r = this.properties;
|
|
283
|
-
r.position && t.element
|
|
290
|
+
r.position && T(t.element) && this.applyAbsolutePosition(t.element, r.position);
|
|
284
291
|
}
|
|
285
292
|
// Layout modifier implementations have been migrated to @tachui/modifiers/layout
|
|
286
293
|
applyAbsolutePosition(i, t) {
|
|
287
|
-
const { x: e, y: n } = t, r = e ?? "auto",
|
|
288
|
-
i.style.left = this.toCSSValue(r), i.style.top = this.toCSSValue(
|
|
294
|
+
const { x: e, y: n } = t, r = e ?? "auto", s = n ?? "auto";
|
|
295
|
+
i.style.left = this.toCSSValue(r), i.style.top = this.toCSSValue(s);
|
|
289
296
|
}
|
|
290
297
|
computeLayoutStyles(i, t) {
|
|
291
298
|
const e = {};
|
|
292
299
|
if (i.frame) {
|
|
293
|
-
const n = i.frame, r =
|
|
300
|
+
const n = i.frame, r = z(n);
|
|
294
301
|
if (Object.assign(e, r.cssProps), n.width !== void 0) {
|
|
295
|
-
const
|
|
296
|
-
|
|
302
|
+
const s = g(n.width);
|
|
303
|
+
s !== void 0 && !p(n.width) && !r.expandWidth && (e.width = s);
|
|
297
304
|
}
|
|
298
305
|
if (n.height !== void 0) {
|
|
299
|
-
const
|
|
300
|
-
|
|
306
|
+
const s = g(n.height);
|
|
307
|
+
s !== void 0 && !p(n.height) && !r.expandHeight && (e.height = s);
|
|
301
308
|
}
|
|
302
309
|
if (n.minWidth !== void 0) {
|
|
303
|
-
const
|
|
304
|
-
|
|
310
|
+
const s = g(n.minWidth);
|
|
311
|
+
s !== void 0 && (e.minWidth = s);
|
|
305
312
|
}
|
|
306
|
-
if (n.maxWidth !== void 0 && !
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
} else
|
|
313
|
+
if (n.maxWidth !== void 0 && !p(n.maxWidth)) {
|
|
314
|
+
const s = g(n.maxWidth);
|
|
315
|
+
s !== void 0 && (e.maxWidth = s);
|
|
316
|
+
} else p(n.maxWidth) && (e.maxWidth = "none", e.flexGrow = "1 !important", e.flexShrink = "1 !important", e.flexBasis = "0% !important", e.alignSelf = "stretch !important");
|
|
310
317
|
if (n.minHeight !== void 0) {
|
|
311
|
-
const
|
|
312
|
-
|
|
318
|
+
const s = g(n.minHeight);
|
|
319
|
+
s !== void 0 && (e.minHeight = s);
|
|
313
320
|
}
|
|
314
|
-
if (n.maxHeight !== void 0 && !
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
} else
|
|
321
|
+
if (n.maxHeight !== void 0 && !p(n.maxHeight)) {
|
|
322
|
+
const s = g(n.maxHeight);
|
|
323
|
+
s !== void 0 && (e.maxHeight = s);
|
|
324
|
+
} else p(n.maxHeight) && (e.maxHeight = "none", e.flexGrow = "1 !important", e.flexShrink = "1 !important", e.flexBasis = "0% !important", e.alignSelf = "stretch !important");
|
|
318
325
|
}
|
|
319
326
|
if (i.padding !== void 0)
|
|
320
327
|
if (typeof i.padding == "number")
|
|
@@ -363,9 +370,9 @@ class te extends C {
|
|
|
363
370
|
return e;
|
|
364
371
|
}
|
|
365
372
|
}
|
|
366
|
-
class
|
|
373
|
+
class oe extends E {
|
|
367
374
|
constructor() {
|
|
368
|
-
super(...arguments), f(this, "type", "appearance"), f(this, "priority",
|
|
375
|
+
super(...arguments), f(this, "type", "appearance"), f(this, "priority", C.APPEARANCE);
|
|
369
376
|
}
|
|
370
377
|
apply(i, t) {
|
|
371
378
|
if (!i.element || !t.element)
|
|
@@ -386,7 +393,7 @@ class ie extends C {
|
|
|
386
393
|
* Apply Asset-based styles with theme reactivity
|
|
387
394
|
*/
|
|
388
395
|
applyAssetBasedStyles(i, t) {
|
|
389
|
-
const e =
|
|
396
|
+
const e = _();
|
|
390
397
|
t.foregroundColor && this.isAsset(t.foregroundColor) && b(() => {
|
|
391
398
|
e();
|
|
392
399
|
const n = t.foregroundColor.resolve();
|
|
@@ -417,7 +424,7 @@ class ie extends C {
|
|
|
417
424
|
t.fontFamily = r;
|
|
418
425
|
} else
|
|
419
426
|
t.fontFamily = n.family;
|
|
420
|
-
n.size !== void 0 && (t.fontSize =
|
|
427
|
+
n.size !== void 0 && (t.fontSize = S(n.size) || m(n.size) ? n.size : this.toCSSValue(n.size)), n.weight !== void 0 && (t.fontWeight = S(n.weight) || m(n.weight) ? n.weight : String(n.weight)), n.style && (t.fontStyle = n.style);
|
|
421
428
|
}
|
|
422
429
|
if (i.cornerRadius !== void 0 && (t.borderRadius = this.toCSSValue(i.cornerRadius)), i.border) {
|
|
423
430
|
const n = i.border;
|
|
@@ -450,9 +457,9 @@ class ie extends C {
|
|
|
450
457
|
return i._tachui_component || null;
|
|
451
458
|
}
|
|
452
459
|
}
|
|
453
|
-
class
|
|
460
|
+
class se extends E {
|
|
454
461
|
constructor() {
|
|
455
|
-
super(...arguments), f(this, "type", "interaction"), f(this, "priority",
|
|
462
|
+
super(...arguments), f(this, "type", "interaction"), f(this, "priority", C.INTERACTION);
|
|
456
463
|
}
|
|
457
464
|
apply(i, t) {
|
|
458
465
|
if (!t.element) return;
|
|
@@ -469,16 +476,16 @@ class ne extends C {
|
|
|
469
476
|
let n = 0, r = 0;
|
|
470
477
|
t.element.addEventListener(
|
|
471
478
|
"touchstart",
|
|
472
|
-
(
|
|
473
|
-
const a =
|
|
479
|
+
(s) => {
|
|
480
|
+
const a = s.touches[0];
|
|
474
481
|
n = a.clientX, r = a.clientY;
|
|
475
482
|
},
|
|
476
483
|
{ passive: !0 }
|
|
477
484
|
), t.element.addEventListener(
|
|
478
485
|
"touchend",
|
|
479
|
-
(
|
|
480
|
-
const a =
|
|
481
|
-
Math.abs(d) > Math.abs(
|
|
486
|
+
(s) => {
|
|
487
|
+
const a = s.changedTouches[0], d = a.clientX - n, u = a.clientY - r;
|
|
488
|
+
Math.abs(d) > Math.abs(u) && Math.abs(d) > 50 && (d < 0 && e.onSwipeLeft ? e.onSwipeLeft() : d > 0 && e.onSwipeRight && e.onSwipeRight());
|
|
482
489
|
},
|
|
483
490
|
{ passive: !0 }
|
|
484
491
|
);
|
|
@@ -488,39 +495,39 @@ class ne extends C {
|
|
|
488
495
|
}), e.onWheel && t.element.addEventListener("wheel", e.onWheel, {
|
|
489
496
|
passive: !1
|
|
490
497
|
}), e.onInput && t.element.addEventListener("input", e.onInput), e.onChange && t.element.addEventListener("change", (n) => {
|
|
491
|
-
const r = n.target,
|
|
492
|
-
e.onChange(
|
|
493
|
-
}), e.onCopy && t.element.addEventListener("copy", e.onCopy), e.onCut && t.element.addEventListener("cut", e.onCut), e.onPaste && t.element.addEventListener("paste", e.onPaste), e.onSelect && t.element.addEventListener("select", e.onSelect), e.disabled !== void 0 && t.element
|
|
498
|
+
const r = n.target, s = r.value || r.textContent || "";
|
|
499
|
+
e.onChange(s, n);
|
|
500
|
+
}), e.onCopy && t.element.addEventListener("copy", e.onCopy), e.onCut && t.element.addEventListener("cut", e.onCut), e.onPaste && t.element.addEventListener("paste", e.onPaste), e.onSelect && t.element.addEventListener("select", e.onSelect), e.disabled !== void 0 && T(t.element) && (e.disabled ? (t.element.setAttribute("disabled", "true"), t.element.style.pointerEvents = "none", t.element.style.opacity = "0.6") : (t.element.removeAttribute("disabled"), t.element.style.pointerEvents = "", t.element.style.opacity = "")), e.draggable !== void 0 && T(t.element) && (t.element.draggable = e.draggable), e.accessibilityLabel && t.element.setAttribute("aria-label", e.accessibilityLabel), e.accessibilityHint && t.element.setAttribute("aria-describedby", e.accessibilityHint);
|
|
494
501
|
}
|
|
495
502
|
}
|
|
496
|
-
class
|
|
503
|
+
class ae extends E {
|
|
497
504
|
constructor() {
|
|
498
|
-
super(...arguments), f(this, "type", "animation"), f(this, "priority",
|
|
505
|
+
super(...arguments), f(this, "type", "animation"), f(this, "priority", C.ANIMATION);
|
|
499
506
|
}
|
|
500
507
|
apply(i, t) {
|
|
501
508
|
if (!t.element) return;
|
|
502
509
|
const e = this.properties;
|
|
503
510
|
if (e.transition) {
|
|
504
|
-
const n = e.transition, r = n.property || "all",
|
|
505
|
-
t.element
|
|
511
|
+
const n = e.transition, r = n.property || "all", s = n.duration || 300, l = n.easing || "ease", a = n.delay || 0;
|
|
512
|
+
A(t.element) && (t.element.style.transition = `${r} ${s}ms ${l} ${a}ms`);
|
|
506
513
|
}
|
|
507
|
-
if (e.animation && t.element
|
|
514
|
+
if (e.animation && A(t.element)) {
|
|
508
515
|
const n = e.animation;
|
|
509
|
-
if (n.keyframes) {
|
|
510
|
-
const r = `tachui-animation-${t.componentId}-${Date.now()}`,
|
|
516
|
+
if (n.keyframes && typeof document < "u") {
|
|
517
|
+
const r = `tachui-animation-${t.componentId}-${Date.now()}`, s = this.createKeyframeRule(
|
|
511
518
|
r,
|
|
512
519
|
n.keyframes
|
|
513
520
|
);
|
|
514
|
-
this.addKeyframesToStylesheet(
|
|
515
|
-
const l = n.duration || 1e3, a = n.easing || "ease", d = n.iterations || 1,
|
|
516
|
-
t.element.style.animation = `${r} ${l}ms ${a} ${d} ${
|
|
521
|
+
this.addKeyframesToStylesheet(s);
|
|
522
|
+
const l = n.duration || 1e3, a = n.easing || "ease", d = n.iterations || 1, u = n.direction || "normal";
|
|
523
|
+
t.element.style.animation = `${r} ${l}ms ${a} ${d} ${u}`;
|
|
517
524
|
}
|
|
518
525
|
}
|
|
519
|
-
if (e.transform && t.element
|
|
526
|
+
if (e.transform && A(t.element) && (S(e.transform) || m(e.transform) ? b(() => {
|
|
520
527
|
const n = e.transform();
|
|
521
|
-
t.element
|
|
522
|
-
}) : t.element.style.transform = e.transform), e.scaleEffect && t.element
|
|
523
|
-
const { x: n, y: r, anchor:
|
|
528
|
+
A(t.element) && (t.element.style.transform = n);
|
|
529
|
+
}) : t.element.style.transform = e.transform), e.scaleEffect && A(t.element)) {
|
|
530
|
+
const { x: n, y: r, anchor: s } = e.scaleEffect, l = r ?? n, d = {
|
|
524
531
|
center: "50% 50%",
|
|
525
532
|
top: "50% 0%",
|
|
526
533
|
topLeading: "0% 0%",
|
|
@@ -530,10 +537,10 @@ class re extends C {
|
|
|
530
537
|
bottomTrailing: "100% 100%",
|
|
531
538
|
leading: "0% 50%",
|
|
532
539
|
trailing: "100% 50%"
|
|
533
|
-
}[
|
|
540
|
+
}[s || "center"] || "50% 50%";
|
|
534
541
|
t.element.style.transformOrigin = d;
|
|
535
|
-
const
|
|
536
|
-
t.element.style.transform =
|
|
542
|
+
const u = `scale(${n}, ${l})`, h = (t.element.style.transform || "").replace(/\s*scale[XYZ3d]*\([^)]*\)\s*/g, " ").replace(/\s+/g, " ").trim(), O = h ? `${h} ${u}`.trim() : u;
|
|
543
|
+
t.element.style.transform = O;
|
|
537
544
|
}
|
|
538
545
|
}
|
|
539
546
|
createKeyframeRule(i, t) {
|
|
@@ -542,8 +549,8 @@ class re extends C {
|
|
|
542
549
|
for (const [n, r] of Object.entries(t)) {
|
|
543
550
|
e += ` ${n} {
|
|
544
551
|
`;
|
|
545
|
-
for (const [
|
|
546
|
-
const a = this.toCSSProperty(
|
|
552
|
+
for (const [s, l] of Object.entries(r)) {
|
|
553
|
+
const a = this.toCSSProperty(s);
|
|
547
554
|
e += ` ${a}: ${l};
|
|
548
555
|
`;
|
|
549
556
|
}
|
|
@@ -559,9 +566,9 @@ class re extends C {
|
|
|
559
566
|
t || (t = document.createElement("style"), t.id = "tachui-animations", document.head.appendChild(t)), t.appendChild(document.createTextNode(i));
|
|
560
567
|
}
|
|
561
568
|
}
|
|
562
|
-
class
|
|
569
|
+
class le extends E {
|
|
563
570
|
constructor() {
|
|
564
|
-
super(...arguments), f(this, "type", "lifecycle"), f(this, "priority",
|
|
571
|
+
super(...arguments), f(this, "type", "lifecycle"), f(this, "priority", C.CUSTOM), f(this, "activeAbortController");
|
|
565
572
|
}
|
|
566
573
|
apply(i, t) {
|
|
567
574
|
if (!t.element) return;
|
|
@@ -600,22 +607,22 @@ class oe extends C {
|
|
|
600
607
|
this.properties._cleanupFunctions || (this.properties._cleanupFunctions = []), this.properties._cleanupFunctions.push(i);
|
|
601
608
|
}
|
|
602
609
|
}
|
|
603
|
-
class
|
|
610
|
+
class de extends E {
|
|
604
611
|
constructor() {
|
|
605
|
-
super(...arguments), f(this, "type", "resizable"), f(this, "priority",
|
|
612
|
+
super(...arguments), f(this, "type", "resizable"), f(this, "priority", C.APPEARANCE);
|
|
606
613
|
}
|
|
607
614
|
apply(i, t) {
|
|
608
615
|
t.element && t.element instanceof HTMLImageElement && (t.element.style.objectFit = "fill");
|
|
609
616
|
}
|
|
610
617
|
}
|
|
611
618
|
export {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
619
|
+
ae as AnimationModifier,
|
|
620
|
+
oe as AppearanceModifier,
|
|
621
|
+
E as BaseModifier,
|
|
622
|
+
se as InteractionModifier,
|
|
623
|
+
re as LayoutModifier,
|
|
624
|
+
le as LifecycleModifier,
|
|
625
|
+
de as ResizableModifier,
|
|
626
|
+
K as bindReactiveStyle,
|
|
627
|
+
ne as setReactiveStyleUpdaterErrorHandler
|
|
621
628
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "@tachui/registry";
|
|
2
|
-
import { M as s, a, c as o, m as d, s as t } from "../concatenated-component-
|
|
2
|
+
import { M as s, a, c as o, m as d, s as t } from "../concatenated-component-CA54ng_j.js";
|
|
3
3
|
export {
|
|
4
4
|
s as ModifierBuilderImpl,
|
|
5
5
|
a as applyModifiers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../src/modifiers/factories.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAElE,OAAO,KAAK,EACV,QAAQ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