@octane-xplat/ui 0.4.0 → 0.5.0
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/native/octane-client-build.json +1 -1
- package/dist/native/ui.js +26 -23
- package/dist/native/ui14.js +16 -1
- package/dist/native/ui16.js +2 -2
- package/dist/native/ui24.js +2 -1
- package/dist/native/ui3.js +22 -1
- package/dist/native/ui39.js +89 -91
- package/dist/native/ui40.js +180 -53
- package/dist/native/ui41.js +55 -16
- package/dist/native/ui42.js +15 -6
- package/dist/native/ui43.js +18 -37
- package/dist/native/ui44.js +6 -265
- package/dist/native/ui45.js +24 -14
- package/dist/native/ui46.js +261 -29
- package/dist/native/ui47.js +17 -30
- package/dist/native/ui48.js +28 -65
- package/dist/native/ui49.js +21 -46
- package/dist/native/ui50.js +58 -13
- package/dist/native/ui51.js +65 -12
- package/dist/native/ui52.js +58 -86
- package/dist/native/ui53.js +8 -15
- package/dist/native/ui54.js +11 -15
- package/dist/native/ui55.js +82 -146
- package/dist/native/ui56.js +18 -17
- package/dist/native/ui57.js +18 -13
- package/dist/native/ui58.js +155 -21
- package/dist/native/ui59.js +32 -7
- package/dist/native/ui6.js +54 -12
- package/dist/native/ui60.js +8 -102
- package/dist/native/ui61.js +20 -74
- package/dist/native/ui62.js +8 -0
- package/dist/native/ui63.js +108 -0
- package/dist/native/ui64.js +76 -0
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/ui.js +26 -24
- package/dist/web/ui13.js +106 -41
- package/dist/web/ui34.js +147 -67
- package/dist/web/ui35.js +136 -51
- package/dist/web/ui36.js +86 -18
- package/dist/web/ui37.js +20 -5
- package/dist/web/ui38.js +6 -37
- package/dist/web/ui39.js +26 -142
- package/dist/web/ui40.js +143 -32
- package/dist/web/ui41.js +42 -41
- package/dist/web/ui42.js +40 -74
- package/dist/web/ui43.js +47 -13
- package/dist/web/ui44.js +13 -33
- package/dist/web/ui45.js +60 -7
- package/dist/web/ui46.js +47 -42
- package/dist/web/ui47.js +7 -11
- package/dist/web/ui48.js +30 -48
- package/dist/web/ui49.js +12 -46
- package/dist/web/ui50.js +62 -16
- package/dist/web/ui51.js +33 -135
- package/dist/web/ui52.js +18 -41
- package/dist/web/ui53.js +266 -10
- package/dist/web/ui54.js +41 -8
- package/dist/web/ui55.js +16 -21
- package/dist/web/ui56.js +7 -6
- package/dist/web/ui57.js +20 -42
- package/dist/web/ui58.js +6 -44
- package/dist/web/ui59.js +44 -0
- package/dist/web/ui60.js +46 -0
- package/package.json +5 -1
- package/src/theme/tokens.css +255 -30
- package/types/index.d.ts +10 -0
- package/types/props.d.ts +59 -4
package/dist/web/ui35.js
CHANGED
|
@@ -1,57 +1,142 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { cx } from "./ui28.js";
|
|
2
|
+
import { applyThemeClasses } from "./ui29.js";
|
|
3
|
+
import { Popover } from "./ui33.js";
|
|
4
|
+
import { bag1, bag3, clone, componentSlot, componentSlotVoid, createRoot, ifBlock, markChildrenBlock, template } from "octane";
|
|
5
|
+
import { childTextHoleUpdate } from "octane/internal/client";
|
|
6
|
+
//#region src/toast-anchor.web.tsrx
|
|
7
|
+
var _t$0 = /* @__PURE__ */ template("<div class=\"vx-toast\"></div>");
|
|
8
|
+
function __then$3(__props, __s, __extra) {
|
|
9
|
+
const props = __extra[0];
|
|
10
|
+
let _b = __s.slots[0];
|
|
11
|
+
if (_b === void 0) {
|
|
12
|
+
let _m0;
|
|
13
|
+
const _root = clone(_t$0);
|
|
14
|
+
_m0 = _root;
|
|
15
|
+
_b = bag3(__s, _root, _m0, null, void 0);
|
|
16
|
+
}
|
|
17
|
+
{
|
|
18
|
+
const _v = props.content;
|
|
19
|
+
_b.b = childTextHoleUpdate(__s, 1, _b.a, _v, _b.b, _b.c);
|
|
20
|
+
_b.c = _v;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function __else$5(__props, __s, __extra) {
|
|
24
|
+
const Component = __extra[0].content;
|
|
25
|
+
let _b = __s.slots[0];
|
|
26
|
+
if (_b === void 0) {
|
|
27
|
+
let _m0;
|
|
28
|
+
const _root = clone(_t$0);
|
|
29
|
+
_m0 = _root;
|
|
30
|
+
_b = bag1(__s, _root, _m0);
|
|
31
|
+
}
|
|
32
|
+
componentSlot(__s, 1, _b.a, Component, {}, void 0, void 0, void 0, void 0, void 0, "c:46bd91a2");
|
|
33
|
+
}
|
|
34
|
+
var __childrenBody = {};
|
|
35
|
+
function __then$0(__props, __s, __extra) {
|
|
36
|
+
const __block = __s.block;
|
|
37
|
+
const props = __extra[0];
|
|
38
|
+
function __children$2(__props, __s, __extra) {
|
|
39
|
+
const __block = __s.block;
|
|
40
|
+
ifBlock(__s, 0, __block.parentNode, typeof props.content === "string", __then$3, __else$5, __block.endMarker, [props]);
|
|
41
|
+
}
|
|
42
|
+
componentSlotVoid(__s, 0, __block.parentNode, Popover, {
|
|
43
|
+
"open": props.open,
|
|
44
|
+
"anchor": props.options.anchor,
|
|
45
|
+
"placement": props.options.placement ?? placementFor(props.options.position),
|
|
46
|
+
"dismissOnOutsideTap": false,
|
|
47
|
+
"children": markChildrenBlock(__children$2, __childrenBody)
|
|
48
|
+
}, __block.endMarker, void 0, void 0, void 0, void 0, "c:fb0a2e5d");
|
|
49
|
+
}
|
|
50
|
+
function __then$9(__props, __s, __extra) {
|
|
51
|
+
const props = __extra[0];
|
|
52
|
+
let _b = __s.slots[0];
|
|
53
|
+
if (_b === void 0) {
|
|
54
|
+
let _m0;
|
|
55
|
+
const _root = clone(_t$0);
|
|
56
|
+
_m0 = _root;
|
|
57
|
+
_b = bag3(__s, _root, _m0, null, void 0);
|
|
58
|
+
}
|
|
59
|
+
{
|
|
60
|
+
const _v = props.content;
|
|
61
|
+
_b.b = childTextHoleUpdate(__s, 1, _b.a, _v, _b.b, _b.c);
|
|
62
|
+
_b.c = _v;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function __else$11(__props, __s, __extra) {
|
|
66
|
+
const Component = __extra[0].content;
|
|
67
|
+
let _b = __s.slots[0];
|
|
68
|
+
if (_b === void 0) {
|
|
69
|
+
let _m0;
|
|
70
|
+
const _root = clone(_t$0);
|
|
71
|
+
_m0 = _root;
|
|
72
|
+
_b = bag1(__s, _root, _m0);
|
|
73
|
+
}
|
|
74
|
+
componentSlot(__s, 1, _b.a, Component, {}, void 0, void 0, void 0, void 0, void 0, "c:75cbf224");
|
|
75
|
+
}
|
|
76
|
+
function __else$8(__props, __s, __extra) {
|
|
77
|
+
const __block = __s.block;
|
|
78
|
+
const props = __extra[0];
|
|
79
|
+
ifBlock(__s, 0, __block.parentNode, typeof props.content === "string", __then$9, __else$11, __block.endMarker, __extra);
|
|
80
|
+
}
|
|
81
|
+
var queue = [];
|
|
82
|
+
var active = false;
|
|
83
|
+
var ToastBody = function ToastBody(props, __s, __extra) {
|
|
84
|
+
const __block = __s.block;
|
|
85
|
+
ifBlock(__s, 0, __block.parentNode, props.options.anchor, __then$0, __else$8, __block.endMarker, [props]);
|
|
86
|
+
};
|
|
87
|
+
function placementFor(position = "bottom") {
|
|
88
|
+
return position.startsWith("top") ? "top" : "bottom";
|
|
89
|
+
}
|
|
90
|
+
function applyWebProps(host, props) {
|
|
91
|
+
for (const [key, value] of Object.entries(props ?? {})) if (key.includes("-")) host.setAttribute(key, String(value));
|
|
92
|
+
else host[key] = value;
|
|
93
|
+
}
|
|
94
|
+
function alignmentFor(position = "bottom") {
|
|
95
|
+
if (position.endsWith("-start")) return "flex-start";
|
|
96
|
+
if (position.endsWith("-end")) return "flex-end";
|
|
97
|
+
return "center";
|
|
98
|
+
}
|
|
99
|
+
function showNext() {
|
|
100
|
+
if (active || queue.length === 0) return;
|
|
101
|
+
active = true;
|
|
102
|
+
const entry = queue.shift();
|
|
103
|
+
const anchored = Boolean(entry.options.anchor);
|
|
104
|
+
const host = document.createElement("div");
|
|
105
|
+
const position = entry.options.position ?? "bottom";
|
|
106
|
+
const unbindTheme = applyThemeClasses(host, cx("vx-toast-host", placementFor(position) === "top" ? "vx-toast-top" : "vx-toast-bottom"));
|
|
107
|
+
applyWebProps(host, entry.options.web);
|
|
108
|
+
if (anchored) host.style.display = "none";
|
|
109
|
+
else host.style.justifyContent = alignmentFor(position);
|
|
110
|
+
document.body.appendChild(host);
|
|
111
|
+
const root = createRoot(host);
|
|
112
|
+
root.render(ToastBody, {
|
|
113
|
+
...entry,
|
|
114
|
+
open: true
|
|
115
|
+
});
|
|
116
|
+
const finish = () => {
|
|
117
|
+
const cleanup = () => {
|
|
118
|
+
unbindTheme();
|
|
119
|
+
root.unmount();
|
|
120
|
+
host.remove();
|
|
121
|
+
active = false;
|
|
122
|
+
showNext();
|
|
20
123
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return current;
|
|
26
|
-
},
|
|
27
|
-
bind(e) {
|
|
28
|
-
el = e;
|
|
29
|
-
if (el) el.style.transform = `translateX(${current}px)`;
|
|
30
|
-
},
|
|
31
|
-
to(target, opts) {
|
|
32
|
-
const dur = opts?.duration ?? 300;
|
|
33
|
-
const from = current;
|
|
34
|
-
run((t) => t >= dur ? (apply(target), null) : from + (target - from) * (t / dur));
|
|
35
|
-
},
|
|
36
|
-
spring(target, opts) {
|
|
37
|
-
const damping = opts?.damping ?? 14, stiffness = opts?.stiffness ?? 120;
|
|
38
|
-
let v = 0, x = current;
|
|
39
|
-
run(() => {
|
|
40
|
-
const dt = 1 / 60;
|
|
41
|
-
v += (-stiffness * (x - target) - damping * v) * dt;
|
|
42
|
-
x += v * dt;
|
|
43
|
-
return Math.abs(v) < .5 && Math.abs(x - target) < .5 ? (apply(target), null) : x;
|
|
124
|
+
if (anchored) {
|
|
125
|
+
root.render(ToastBody, {
|
|
126
|
+
...entry,
|
|
127
|
+
open: false
|
|
44
128
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
cancelAnimationFrame(raf);
|
|
48
|
-
}
|
|
129
|
+
setTimeout(cleanup, 0);
|
|
130
|
+
} else cleanup();
|
|
49
131
|
};
|
|
132
|
+
setTimeout(finish, Math.max(0, entry.options.duration ?? 3e3));
|
|
50
133
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
134
|
+
function showToast(content, options = {}) {
|
|
135
|
+
queue.push({
|
|
136
|
+
content,
|
|
137
|
+
options
|
|
138
|
+
});
|
|
139
|
+
showNext();
|
|
55
140
|
}
|
|
56
141
|
//#endregion
|
|
57
|
-
export {
|
|
142
|
+
export { showToast };
|
package/dist/web/ui36.js
CHANGED
|
@@ -1,22 +1,90 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { hookSlots, useRef } from "octane";
|
|
2
|
+
//#region src/anim.web.tsrx
|
|
3
|
+
var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
|
|
4
|
+
var transformProps = {
|
|
5
|
+
translateX: (v) => `translateX(${v}px)`,
|
|
6
|
+
translateY: (v) => `translateY(${v}px)`,
|
|
7
|
+
translateZ: (v) => `translateZ(${v}px)`,
|
|
8
|
+
scale: (v) => `scale(${v})`,
|
|
9
|
+
scaleX: (v) => `scaleX(${v})`,
|
|
10
|
+
scaleY: (v) => `scaleY(${v})`,
|
|
11
|
+
rotate: (v) => `rotate(${v}deg)`,
|
|
12
|
+
rotateX: (v) => `rotateX(${v}deg)`,
|
|
13
|
+
rotateY: (v) => `rotateY(${v}deg)`,
|
|
14
|
+
skewX: (v) => `skewX(${v}deg)`,
|
|
15
|
+
skewY: (v) => `skewY(${v}deg)`
|
|
16
|
+
};
|
|
17
|
+
var transformStates = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
function writeAnimatedValue(el, prop, value) {
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(transformProps, prop)) {
|
|
20
|
+
const transformProp = prop;
|
|
21
|
+
let state = transformStates.get(el);
|
|
22
|
+
if (!state) {
|
|
23
|
+
const computed = getComputedStyle(el).transform;
|
|
24
|
+
state = {
|
|
25
|
+
base: computed === "none" ? "" : computed,
|
|
26
|
+
values: /* @__PURE__ */ new Map()
|
|
27
|
+
};
|
|
28
|
+
transformStates.set(el, state);
|
|
11
29
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"className": cls
|
|
17
|
-
}, __block.endMarker, void 0, void 0, true, void 0, "c:2dad67ff");
|
|
30
|
+
state.values.set(transformProp, value);
|
|
31
|
+
const transforms = Object.entries(transformProps).filter(([name]) => state.values.has(name)).map(([name, toTransform]) => toTransform(state.values.get(name)));
|
|
32
|
+
el.style.transform = [state.base, ...transforms].filter(Boolean).join(" ");
|
|
33
|
+
return;
|
|
18
34
|
}
|
|
19
|
-
|
|
35
|
+
el.style[prop] = value;
|
|
36
|
+
}
|
|
37
|
+
function createAnimated(initial, prop) {
|
|
38
|
+
let el = null;
|
|
39
|
+
let current = initial;
|
|
40
|
+
let raf = 0;
|
|
41
|
+
const apply = (v) => {
|
|
42
|
+
current = v;
|
|
43
|
+
if (el) writeAnimatedValue(el, prop, v);
|
|
44
|
+
};
|
|
45
|
+
const run = (step) => {
|
|
46
|
+
cancelAnimationFrame(raf);
|
|
47
|
+
const start = Date.now();
|
|
48
|
+
const tick = () => {
|
|
49
|
+
const v = step(Date.now() - start);
|
|
50
|
+
if (v === null) return;
|
|
51
|
+
apply(v);
|
|
52
|
+
raf = requestAnimationFrame(tick);
|
|
53
|
+
};
|
|
54
|
+
raf = requestAnimationFrame(tick);
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
get value() {
|
|
58
|
+
return current;
|
|
59
|
+
},
|
|
60
|
+
bind(e) {
|
|
61
|
+
el = e;
|
|
62
|
+
if (el) writeAnimatedValue(el, prop, current);
|
|
63
|
+
},
|
|
64
|
+
to(target, opts) {
|
|
65
|
+
const dur = opts?.duration ?? 300;
|
|
66
|
+
const from = current;
|
|
67
|
+
run((t) => t >= dur ? (apply(target), null) : from + (target - from) * (t / dur));
|
|
68
|
+
},
|
|
69
|
+
spring(target, opts) {
|
|
70
|
+
const damping = opts?.damping ?? 14, stiffness = opts?.stiffness ?? 120;
|
|
71
|
+
let v = 0, x = current;
|
|
72
|
+
run(() => {
|
|
73
|
+
const dt = 1 / 60;
|
|
74
|
+
v += (-stiffness * (x - target) - damping * v) * dt;
|
|
75
|
+
x += v * dt;
|
|
76
|
+
return Math.abs(v) < .5 && Math.abs(x - target) < .5 ? (apply(target), null) : x;
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
stop() {
|
|
80
|
+
cancelAnimationFrame(raf);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function useAnimation(initial = 0, prop = "translateX") {
|
|
85
|
+
const c = useRef(null, _h$0);
|
|
86
|
+
if (!c.current) c.current = createAnimated(initial, prop);
|
|
87
|
+
return c.current;
|
|
20
88
|
}
|
|
21
89
|
//#endregion
|
|
22
|
-
export {
|
|
90
|
+
export { useAnimation };
|
package/dist/web/ui37.js
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
1
|
+
import { componentSlot } from "octane";
|
|
2
|
+
//#region src/styled.web.tsrx
|
|
3
|
+
function styled(Base, def) {
|
|
4
|
+
function Styled(props, __s, __extra) {
|
|
5
|
+
const __block = __s.block;
|
|
6
|
+
const cls = [def.base];
|
|
7
|
+
const rest = { ...props };
|
|
8
|
+
for (const k of Object.keys(def.variants ?? {})) {
|
|
9
|
+
if (props[k]) cls.push(def.variants[k]);
|
|
10
|
+
delete rest[k];
|
|
11
|
+
}
|
|
12
|
+
if (props.className) cls.push(props.className);
|
|
13
|
+
if (__s.block.pending && !__s.block.crossRenderUpdate) return;
|
|
14
|
+
componentSlot(__s, 0, __block.parentNode, Base, {
|
|
15
|
+
...rest,
|
|
16
|
+
"className": cls
|
|
17
|
+
}, __block.endMarker, void 0, void 0, true, void 0, "c:2dad67ff");
|
|
18
|
+
}
|
|
19
|
+
return Styled;
|
|
5
20
|
}
|
|
6
21
|
//#endregion
|
|
7
|
-
export {
|
|
22
|
+
export { styled };
|
package/dist/web/ui38.js
CHANGED
|
@@ -1,38 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _t$0 = /* @__PURE__ */ template("<div></div>");
|
|
7
|
-
var _rm$1 = [
|
|
8
|
-
"r",
|
|
9
|
-
"c",
|
|
10
|
-
"b"
|
|
11
|
-
];
|
|
12
|
-
var Screen = /* @__PURE__ */ __s(function Screen(props, __s, __extra) {
|
|
13
|
-
let _b = __s.slots[0];
|
|
14
|
-
if (_b === void 0) {
|
|
15
|
-
let _m1, _m2;
|
|
16
|
-
const _root = clone(_t$0);
|
|
17
|
-
_m1 = _root;
|
|
18
|
-
queueRefAttach(__s, _m2 = (e) => applyEscapeProps(e, props), _m1);
|
|
19
|
-
(__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.c, _b.b));
|
|
20
|
-
_b = bag7(__s, _root, void 0, _m1, _m2, void 0, void 0, null, void 0);
|
|
21
|
-
__s.refFields = _rm$1;
|
|
22
|
-
} else {
|
|
23
|
-
const _r = (e) => applyEscapeProps(e, props);
|
|
24
|
-
if (_r !== _b.c) _b.c = replaceRef(__s, _b.c, _r, _b.b);
|
|
25
|
-
}
|
|
26
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:4057121c", setPlainAttribute);
|
|
27
|
-
_b.d = updateFreshClassName(["vx-screen", props.className], _b.d, _b.b);
|
|
28
|
-
{
|
|
29
|
-
const _v = props.style;
|
|
30
|
-
if (_b.e !== _v) {
|
|
31
|
-
setStyle(_b.b, _v, _b.e);
|
|
32
|
-
_b.e = _v;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
_b.h = bindSignalChild(__s, _b.h, 1, _b.b, props.children, "b:80ad049e", null, void 0, void 0, void 0, true);
|
|
36
|
-
});
|
|
1
|
+
//#region src/windows.web.ts
|
|
2
|
+
/** Open a browser window using the current route unless a URL is supplied. */
|
|
3
|
+
function openWindow(options = {}) {
|
|
4
|
+
return window.open(options.url ?? window.location.href, "_blank");
|
|
5
|
+
}
|
|
37
6
|
//#endregion
|
|
38
|
-
export {
|
|
7
|
+
export { openWindow };
|
package/dist/web/ui39.js
CHANGED
|
@@ -1,154 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { __s,
|
|
3
|
-
import { bindSignalAttribute, bindSignalChild,
|
|
4
|
-
//#region src/
|
|
1
|
+
import { applyEscapeProps } from "./ui2.js";
|
|
2
|
+
import { __s, bag7, clone, queueRefAttach, queueRefDetach, setStyle, template } from "octane";
|
|
3
|
+
import { bindSignalAttribute, bindSignalChild, enableSignalBindings, replaceRef, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
|
|
4
|
+
//#region src/Screen.web.tsrx
|
|
5
5
|
enableSignalBindings(1, true);
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
14
|
-
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
15
|
-
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
16
|
-
function __then$0(__props, __s, __extra) {
|
|
17
|
-
const routed = __extra[5];
|
|
6
|
+
var _t$0 = /* @__PURE__ */ template("<div></div>");
|
|
7
|
+
var _rm$1 = [
|
|
8
|
+
"r",
|
|
9
|
+
"c",
|
|
10
|
+
"b"
|
|
11
|
+
];
|
|
12
|
+
var Screen = /* @__PURE__ */ __s(function Screen(props, __s, __extra) {
|
|
18
13
|
let _b = __s.slots[0];
|
|
19
14
|
if (_b === void 0) {
|
|
20
|
-
let
|
|
15
|
+
let _m1, _m2;
|
|
21
16
|
const _root = clone(_t$0);
|
|
22
|
-
_m0 = _root;
|
|
23
|
-
_b = bag3(__s, _root, _m0, null, void 0);
|
|
24
|
-
}
|
|
25
|
-
{
|
|
26
|
-
const _v = routed;
|
|
27
|
-
_b.b = childTextHoleUpdate(__s, 1, _b.a, _v, _b.b, _b.c);
|
|
28
|
-
_b.c = _v;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
var _key$3 = (t) => t.title;
|
|
32
|
-
function __item$4(t, __s, __extra) {
|
|
33
|
-
const active = __extra[0];
|
|
34
|
-
const props = __extra[1];
|
|
35
|
-
const setInternal = __extra[2];
|
|
36
|
-
let _b = __s.slots[0];
|
|
37
|
-
if (_b === void 0) {
|
|
38
|
-
let _m1;
|
|
39
|
-
const _root = clone(_t$1);
|
|
40
|
-
_m1 = _root;
|
|
41
|
-
setEventHandler(_root, "$$click", () => {
|
|
42
|
-
const i = props.tabs.indexOf(t);
|
|
43
|
-
setInternal(i);
|
|
44
|
-
props.onSelectedIndexChanged?.(i);
|
|
45
|
-
});
|
|
46
|
-
_b = bag4(__s, _root, void 0, _m1, null, void 0);
|
|
47
|
-
} else setEventHandler(_b.b, "$$click", () => {
|
|
48
|
-
const i = props.tabs.indexOf(t);
|
|
49
|
-
setInternal(i);
|
|
50
|
-
props.onSelectedIndexChanged?.(i);
|
|
51
|
-
});
|
|
52
|
-
_b.a = updateFreshClassName(["vx-tab", active === props.tabs.indexOf(t) ? "active" : ""], _b.a, _b.b);
|
|
53
|
-
_b.e = bindSignalChild(__s, _b.e, 1, _b.b, t.title, "b:c6e07647", null, void 0, void 0, void 0, true);
|
|
54
|
-
}
|
|
55
|
-
function __else$2(__props, __s, __extra) {
|
|
56
|
-
const active = __extra[0];
|
|
57
|
-
const paneRoute = __extra[1];
|
|
58
|
-
const props = __extra[2];
|
|
59
|
-
const resolve = __extra[3];
|
|
60
|
-
const routeProps = __extra[4];
|
|
61
|
-
const setInternal = __extra[6];
|
|
62
|
-
let _b = __s.slots[0];
|
|
63
|
-
if (_b === void 0) {
|
|
64
|
-
let _m1, _m4, _m5, _m6;
|
|
65
|
-
const _root = clone(_t$2);
|
|
66
17
|
_m1 = _root;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
18
|
+
queueRefAttach(__s, _m2 = (e) => applyEscapeProps(e, props), _m1);
|
|
19
|
+
(__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.c, _b.b));
|
|
20
|
+
_b = bag7(__s, _root, void 0, _m1, _m2, void 0, void 0, null, void 0);
|
|
21
|
+
__s.refFields = _rm$1;
|
|
22
|
+
} else {
|
|
23
|
+
const _r = (e) => applyEscapeProps(e, props);
|
|
24
|
+
if (_r !== _b.c) _b.c = replaceRef(__s, _b.c, _r, _b.b);
|
|
72
25
|
}
|
|
73
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:
|
|
74
|
-
_b.
|
|
26
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:4057121c", setPlainAttribute);
|
|
27
|
+
_b.d = updateFreshClassName(["vx-screen", props.className], _b.d, _b.b);
|
|
75
28
|
{
|
|
76
29
|
const _v = props.style;
|
|
77
|
-
if (_b.
|
|
78
|
-
setStyle(_b.b, _v, _b.
|
|
79
|
-
_b.
|
|
30
|
+
if (_b.e !== _v) {
|
|
31
|
+
setStyle(_b.b, _v, _b.e);
|
|
32
|
+
_b.e = _v;
|
|
80
33
|
}
|
|
81
34
|
}
|
|
82
|
-
|
|
83
|
-
active,
|
|
84
|
-
props,
|
|
85
|
-
setInternal
|
|
86
|
-
], null, _b.f, true, "f3hhxv5");
|
|
87
|
-
_b.j = bindSignalChild(__s, _b.j, 2, _b.g, (paneRoute ? resolve(paneRoute.name, routeProps(paneRoute)) : null) ?? props.tabs[active]?.render(), "b:c35ce047", null, void 0, void 0, void 0, true);
|
|
88
|
-
}
|
|
89
|
-
function __then$9(__props, __s, __extra) {
|
|
90
|
-
const modalContent = __extra[0];
|
|
91
|
-
let _b = __s.slots[0];
|
|
92
|
-
if (_b === void 0) {
|
|
93
|
-
let _m0, _m1;
|
|
94
|
-
const _root = clone(_t$3);
|
|
95
|
-
const _el0 = child(_root);
|
|
96
|
-
_m0 = evt0(_el0, "$$click", popRoute);
|
|
97
|
-
_m1 = sibling(_el0, 1);
|
|
98
|
-
_b = bag4(__s, _root, _m0, _m1, null, void 0);
|
|
99
|
-
} else evt0u(_b.a, popRoute);
|
|
100
|
-
_b.e = bindSignalChild(__s, _b.e, 1, _b.b, modalContent, "b:38e2e707", null, void 0, void 0, void 0, true);
|
|
101
|
-
}
|
|
102
|
-
var Tabs = /* @__PURE__ */ __s(function Tabs(props, __s, __extra) {
|
|
103
|
-
const __memoRegion = compilerMemoRegion(__s, _hs$ + 0);
|
|
104
|
-
let __hk = __memoRegion.hooks;
|
|
105
|
-
if (__hk === void 0) __memoRegion.hooks = __hk = hookMemoCreate(1);
|
|
106
|
-
const [internal, setInternal] = useState(0, _hs$ + 0);
|
|
107
|
-
const active = props.selectedIndex ?? internal;
|
|
108
|
-
const rootRoute = withSlot(_h$1, useRoute, "root");
|
|
109
|
-
const paneRoute = withSlot(_h$2, useRoute, props.tabs[active]?.stack ?? "");
|
|
110
|
-
const modal = withSlot(_h$3, useModalRoute);
|
|
111
|
-
const resolve = (name, params) => {
|
|
112
|
-
const C = screenFor(name);
|
|
113
|
-
const el = props.resolveScreen ? props.resolveScreen(name, params) : C ? createScopedValue(() => createElementFromConfig("c:3fc4e2ff", C, { ...params })) : null;
|
|
114
|
-
return layoutsFor(name).reduceRight((child, L) => createScopedElement(L, {}, () => child, "c:65a1fb32"), el);
|
|
115
|
-
};
|
|
116
|
-
const routeProps = __hk[0] ?? hookMemoPublishInvariant(__hk, 0, (route) => ({
|
|
117
|
-
...route.params,
|
|
118
|
-
...route.context ?? {},
|
|
119
|
-
_pushed: canGoBack(route.stack),
|
|
120
|
-
...Object.prototype.hasOwnProperty.call(route, "loaderData") ? { data: route.loaderData } : {},
|
|
121
|
-
...Object.prototype.hasOwnProperty.call(route, "loaderError") ? { error: route.loaderError } : {}
|
|
122
|
-
}));
|
|
123
|
-
const routed = rootRoute ? resolve(rootRoute.name, routeProps(rootRoute)) : null;
|
|
124
|
-
const modalContent = modal ? resolve(modal.name, {
|
|
125
|
-
...routeProps(modal),
|
|
126
|
-
close: () => popRoute()
|
|
127
|
-
}) : null;
|
|
128
|
-
if (__s.block.pending && !__s.block.crossRenderUpdate) return;
|
|
129
|
-
let _b = __s.slots[0];
|
|
130
|
-
if (_b === void 0) {
|
|
131
|
-
let _m0, _m1, _m2;
|
|
132
|
-
const _root = clone(_t$4);
|
|
133
|
-
_m0 = _root;
|
|
134
|
-
const _el0 = child(_root);
|
|
135
|
-
_m1 = _el0;
|
|
136
|
-
_m2 = sibling(_el0, 1);
|
|
137
|
-
_b = bag3(__s, _root, _m0, _m1, _m2);
|
|
138
|
-
}
|
|
139
|
-
ifBlock(__s, 1, _b.a, routed, __then$0, __else$2, _b.b, [
|
|
140
|
-
active,
|
|
141
|
-
paneRoute,
|
|
142
|
-
props,
|
|
143
|
-
resolve,
|
|
144
|
-
routeProps,
|
|
145
|
-
routed,
|
|
146
|
-
setInternal
|
|
147
|
-
]);
|
|
148
|
-
{
|
|
149
|
-
const __ifCondition = modalContent;
|
|
150
|
-
ifBlock(__s, 2, _b.a, __ifCondition, __then$9, null, _b.c, __ifCondition ? [modalContent] : void 0);
|
|
151
|
-
}
|
|
35
|
+
_b.h = bindSignalChild(__s, _b.h, 1, _b.b, props.children, "b:80ad049e", null, void 0, void 0, void 0, true);
|
|
152
36
|
});
|
|
153
37
|
//#endregion
|
|
154
|
-
export {
|
|
38
|
+
export { Screen };
|