@octane-xplat/ui 0.3.0 → 0.4.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/README.md +46 -0
- package/dist/native/octane-client-build.json +1 -1
- package/dist/native/ui.js +52 -40
- package/dist/native/ui10.js +20 -11
- package/dist/native/ui11.js +42 -109
- package/dist/native/ui12.js +17 -84
- package/dist/native/ui13.js +11 -41
- package/dist/native/ui14.js +118 -76
- package/dist/native/ui15.js +43 -92
- package/dist/native/ui16.js +106 -45
- package/dist/native/ui17.js +29 -42
- package/dist/native/ui18.js +34 -53
- package/dist/native/ui19.js +246 -32
- package/dist/native/ui20.js +27 -16
- package/dist/native/ui21.js +376 -86
- package/dist/native/ui22.js +26 -114
- package/dist/native/ui23.js +49 -97
- package/dist/native/ui24.js +78 -53
- package/dist/native/ui25.js +138 -16
- package/dist/native/ui26.js +8 -23
- package/dist/native/ui27.js +60 -34
- package/dist/native/ui28.js +36 -142
- package/dist/native/ui29.js +101 -21
- package/dist/native/ui30.js +14 -31
- package/dist/native/ui31.js +55 -36
- package/dist/native/ui32.js +49 -61
- package/dist/native/ui33.js +36 -28
- package/dist/native/ui34.js +51 -8
- package/dist/native/ui35.js +98 -20
- package/dist/native/ui36.js +9 -33
- package/dist/native/ui37.js +42 -15
- package/dist/native/ui38.js +186 -57
- package/dist/native/ui39.js +96 -24
- package/dist/native/ui4.js +22 -20
- package/dist/native/ui40.js +57 -13
- package/dist/native/ui41.js +15 -100
- package/dist/native/ui42.js +6 -146
- package/dist/native/ui43.js +37 -21
- package/dist/native/ui44.js +265 -6
- package/dist/native/ui45.js +28 -0
- package/dist/native/ui46.js +35 -0
- package/dist/native/ui47.js +41 -0
- package/dist/native/ui48.js +72 -0
- package/dist/native/ui49.js +66 -0
- package/dist/native/ui5.js +37 -77
- package/dist/native/ui50.js +27 -0
- package/dist/native/ui51.js +13 -0
- package/dist/native/ui52.js +92 -0
- package/dist/native/ui53.js +34 -0
- package/dist/native/ui54.js +17 -0
- package/dist/native/ui55.js +156 -0
- package/dist/native/ui56.js +33 -0
- package/dist/native/ui57.js +14 -0
- package/dist/native/ui58.js +22 -0
- package/dist/native/ui59.js +8 -0
- package/dist/native/ui6.js +52 -9
- package/dist/native/ui60.js +108 -0
- package/dist/native/ui61.js +76 -0
- package/dist/native/ui7.js +42 -26
- package/dist/native/ui8.js +22 -12
- package/dist/native/ui9.js +18 -9
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/ui.js +51 -40
- package/dist/web/ui10.js +33 -186
- package/dist/web/ui11.js +28 -409
- package/dist/web/ui12.js +21 -68
- package/dist/web/ui13.js +201 -97
- package/dist/web/ui14.js +85 -95
- package/dist/web/ui15.js +368 -25
- package/dist/web/ui16.js +13 -101
- package/dist/web/ui17.js +246 -42
- package/dist/web/ui18.js +237 -28
- package/dist/web/ui19.js +36 -10
- package/dist/web/ui20.js +73 -102
- package/dist/web/ui21.js +102 -73
- package/dist/web/ui22.js +95 -55
- package/dist/web/ui23.js +94 -55
- package/dist/web/ui24.js +31 -15
- package/dist/web/ui25.js +105 -19
- package/dist/web/ui26.js +29 -23
- package/dist/web/ui27.js +12 -123
- package/dist/web/ui28.js +9 -110
- package/dist/web/ui29.js +52 -102
- package/dist/web/ui3.js +29 -18
- package/dist/web/ui30.js +32 -41
- package/dist/web/ui31.js +120 -39
- package/dist/web/ui32.js +41 -74
- package/dist/web/ui33.js +148 -32
- package/dist/web/ui34.js +54 -51
- package/dist/web/ui35.js +55 -7
- package/dist/web/ui36.js +18 -41
- package/dist/web/ui37.js +6 -46
- package/dist/web/ui38.js +37 -16
- package/dist/web/ui39.js +135 -81
- package/dist/web/ui4.js +46 -152
- package/dist/web/ui40.js +39 -37
- package/dist/web/ui41.js +41 -16
- package/dist/web/ui42.js +74 -7
- package/dist/web/ui43.js +40 -20
- package/dist/web/ui44.js +60 -6
- package/dist/web/ui45.js +9 -0
- package/dist/web/ui46.js +45 -0
- package/dist/web/ui47.js +13 -0
- package/dist/web/ui48.js +63 -0
- package/dist/web/ui49.js +47 -0
- package/dist/web/ui5.js +131 -27
- package/dist/web/ui50.js +17 -0
- package/dist/web/ui51.js +149 -0
- package/dist/web/ui52.js +42 -0
- package/dist/web/ui53.js +17 -0
- package/dist/web/ui54.js +9 -0
- package/dist/web/ui55.js +22 -0
- package/dist/web/ui56.js +8 -0
- package/dist/web/ui57.js +44 -0
- package/dist/web/ui58.js +46 -0
- package/dist/web/ui6.js +81 -45
- package/dist/web/ui7.js +43 -21
- package/dist/web/ui8.js +27 -21
- package/dist/web/ui9.js +29 -18
- package/package.json +13 -4
- package/src/theme/tokens.css +369 -138
- package/types/index.d.ts +102 -58
- package/types/props.d.ts +233 -13
package/dist/web/ui39.js
CHANGED
|
@@ -1,100 +1,154 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
//#region src/Icon.web.tsrx
|
|
1
|
+
import { canGoBack, layoutsFor, popRoute, screenFor, useModalRoute, useRoute } from "./ui18.js";
|
|
2
|
+
import { __s, bag3, bag4, bag9, child, clone, createScopedElement, createScopedValue, delegateEvents, evt0, evt0u, forBlock, hookSlots, ifBlock, setEventHandler, setStyle, sibling, template, useState, withSlot } from "octane";
|
|
3
|
+
import { bindSignalAttribute, bindSignalChild, childTextHoleUpdate, compilerMemoRegion, createElementFromConfig, enableSignalBindings, hookMemoCreate, hookMemoPublishInvariant, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
|
|
4
|
+
//#region src/Tabs.web.tsrx
|
|
6
5
|
enableSignalBindings(1, true);
|
|
7
|
-
|
|
8
|
-
var _t$
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
delegateEvents(["click"]);
|
|
7
|
+
var _t$0 = /* @__PURE__ */ template("<div class=\"vx-route\"></div>");
|
|
8
|
+
var _t$1 = /* @__PURE__ */ template("<button></button>");
|
|
9
|
+
var _t$2 = /* @__PURE__ */ template("<div><div class=\"vx-tabbar\"><!></div><div class=\"vx-tabpane\"></div></div>");
|
|
10
|
+
var _t$3 = /* @__PURE__ */ template("<div class=\"vx-modalroute\"><button class=\"vx-modalroute-shade\" aria-label=\"Dismiss\"></button><div class=\"vx-modalroute-body\"></div></div>");
|
|
11
|
+
var _t$4 = /* @__PURE__ */ template("<div class=\"vx-tabsroot\" style=\"display: contents;\"><!><!></div>");
|
|
12
|
+
var _hs$ = /* @__PURE__ */ hookSlots(5);
|
|
13
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
14
|
+
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
15
|
+
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
14
16
|
function __then$0(__props, __s, __extra) {
|
|
15
|
-
const
|
|
16
|
-
const props = __extra[1];
|
|
17
|
-
const size = __extra[2];
|
|
17
|
+
const routed = __extra[5];
|
|
18
18
|
let _b = __s.slots[0];
|
|
19
19
|
if (_b === void 0) {
|
|
20
|
-
let
|
|
20
|
+
let _m0;
|
|
21
21
|
const _root = clone(_t$0);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const _r = (el) => applyWebProps(el, props.web);
|
|
30
|
-
if (_r !== _b.f) _b.f = replaceRef(__s, _b.f, _r, _b.b);
|
|
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;
|
|
31
29
|
}
|
|
32
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:c2998a08", "attr");
|
|
33
|
-
_b.c = updateFreshClassAttr(["vx-icon", props.className], _b.c, _b.b);
|
|
34
|
-
_b.d = bindSignalAttribute(__s, _b.d, _b.b, "width", size, "b:2cb24e58", "attr");
|
|
35
|
-
_b.e = bindSignalAttribute(__s, _b.e, _b.b, "height", size, "b:030dffd1", "attr");
|
|
36
|
-
_b.g = bindSignalAttribute(__s, _b.g, _b.h, "d", glyph.svg, "b:87ff75cb", "attr");
|
|
37
|
-
_b.i = bindSignalAttribute(__s, _b.i, _b.h, "fill", props.color ?? "currentColor", "b:5bd1a218", "attr");
|
|
38
30
|
}
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"b"
|
|
43
|
-
];
|
|
44
|
-
function __then$3(__props, __s, __extra) {
|
|
45
|
-
const glyph = __extra[0];
|
|
31
|
+
var _key$3 = (t) => t.title;
|
|
32
|
+
function __item$4(t, __s, __extra) {
|
|
33
|
+
const active = __extra[0];
|
|
46
34
|
const props = __extra[1];
|
|
47
|
-
const
|
|
35
|
+
const setInternal = __extra[2];
|
|
48
36
|
let _b = __s.slots[0];
|
|
49
37
|
if (_b === void 0) {
|
|
50
|
-
let _m1
|
|
38
|
+
let _m1;
|
|
51
39
|
const _root = clone(_t$1);
|
|
52
40
|
_m1 = _root;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
_b.
|
|
65
|
-
_b.
|
|
66
|
-
_b.g = bindSignalAttribute(__s, _b.g, _b.b, "alt", props.name, "b:056826c3", "attr");
|
|
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);
|
|
67
54
|
}
|
|
68
55
|
function __else$2(__props, __s, __extra) {
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
__extra[
|
|
72
|
-
__extra[
|
|
73
|
-
|
|
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
|
+
_m1 = _root;
|
|
67
|
+
const _el0 = child(_root);
|
|
68
|
+
_m4 = _el0;
|
|
69
|
+
_m5 = child(_el0);
|
|
70
|
+
_m6 = sibling(_el0, 1);
|
|
71
|
+
_b = bag9(__s, _root, void 0, _m1, void 0, void 0, _m4, _m5, _m6, null, void 0);
|
|
72
|
+
}
|
|
73
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:feaba283", setPlainAttribute);
|
|
74
|
+
_b.c = updateFreshClassName(["vx-tabs", props.className], _b.c, _b.b);
|
|
75
|
+
{
|
|
76
|
+
const _v = props.style;
|
|
77
|
+
if (_b.d !== _v) {
|
|
78
|
+
setStyle(_b.b, _v, _b.d);
|
|
79
|
+
_b.d = _v;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
forBlock(__s, 1, _b.e, props.tabs, _key$3, __item$4, 58, [
|
|
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);
|
|
74
88
|
}
|
|
75
|
-
function
|
|
76
|
-
const
|
|
77
|
-
|
|
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);
|
|
78
101
|
}
|
|
79
|
-
var
|
|
80
|
-
var Icon = function Icon(props, __s, __extra) {
|
|
102
|
+
var Tabs = /* @__PURE__ */ __s(function Tabs(props, __s, __extra) {
|
|
81
103
|
const __memoRegion = compilerMemoRegion(__s, _hs$ + 0);
|
|
82
104
|
let __hk = __memoRegion.hooks;
|
|
83
|
-
if (__hk === void 0) __memoRegion.hooks = __hk = hookMemoCreate(
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
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
|
+
}
|
|
152
|
+
});
|
|
99
153
|
//#endregion
|
|
100
|
-
export {
|
|
154
|
+
export { Tabs };
|
package/dist/web/ui4.js
CHANGED
|
@@ -1,153 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
last = sy;
|
|
47
|
-
node.setPointerCapture?.(e.pointerId);
|
|
48
|
-
emit(e, "began");
|
|
49
|
-
};
|
|
50
|
-
const move = (e) => {
|
|
51
|
-
if (active) emit(e, "moved");
|
|
52
|
-
};
|
|
53
|
-
const up = (e) => {
|
|
54
|
-
if (active) {
|
|
55
|
-
active = false;
|
|
56
|
-
emit(e, "ended");
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const cancel = (e) => {
|
|
60
|
-
if (active) {
|
|
61
|
-
active = false;
|
|
62
|
-
emit(e, "cancelled");
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
node.addEventListener("pointerdown", down);
|
|
66
|
-
node.addEventListener("pointermove", move);
|
|
67
|
-
node.addEventListener("pointerup", up);
|
|
68
|
-
node.addEventListener("pointercancel", cancel);
|
|
69
|
-
return () => {
|
|
70
|
-
node.removeEventListener("pointerdown", down);
|
|
71
|
-
node.removeEventListener("pointermove", move);
|
|
72
|
-
node.removeEventListener("pointerup", up);
|
|
73
|
-
node.removeEventListener("pointercancel", cancel);
|
|
74
|
-
};
|
|
75
|
-
}, [props.onPan], _hs$ + 1);
|
|
76
|
-
let _b = __s.slots[0];
|
|
77
|
-
if (_b === void 0) {
|
|
78
|
-
let _m0, _m1, _m2, _m3, _m4, _m5;
|
|
79
|
-
const _root = clone(_t$0);
|
|
80
|
-
_m0 = props.id;
|
|
81
|
-
_m1 = (e) => {
|
|
82
|
-
el.current = e;
|
|
83
|
-
if (e) {
|
|
84
|
-
applyEscapeProps(e, props);
|
|
85
|
-
props.bind?.(e);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
_m2 = ["vx-view", props.className];
|
|
89
|
-
_m3 = snapshotSpread(layoutChildProps(props));
|
|
90
|
-
_m4 = _root;
|
|
91
|
-
_m5 = bindSignalHostPropSources(__s, void 0, _root, [
|
|
92
|
-
[
|
|
93
|
-
false,
|
|
94
|
-
"id",
|
|
95
|
-
_m0
|
|
96
|
-
],
|
|
97
|
-
[
|
|
98
|
-
false,
|
|
99
|
-
"ref",
|
|
100
|
-
_m1
|
|
101
|
-
],
|
|
102
|
-
[
|
|
103
|
-
false,
|
|
104
|
-
"className",
|
|
105
|
-
_m2
|
|
106
|
-
],
|
|
107
|
-
[true, _m3]
|
|
108
|
-
], "b:3f348e03", true);
|
|
109
|
-
_b = bag8(__s, _root, _m0, _m1, _m2, _m3, _m4, _m5, null, void 0);
|
|
110
|
-
__s.refFields = _rm$1;
|
|
111
|
-
} else {
|
|
112
|
-
{
|
|
113
|
-
const _v = props.id;
|
|
114
|
-
if (_b.a !== _v) _b.a = _v;
|
|
115
|
-
}
|
|
116
|
-
{
|
|
117
|
-
const _v = (e) => {
|
|
118
|
-
el.current = e;
|
|
119
|
-
if (e) {
|
|
120
|
-
applyEscapeProps(e, props);
|
|
121
|
-
props.bind?.(e);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
if (_b.b !== _v) _b.b = _v;
|
|
125
|
-
}
|
|
126
|
-
{
|
|
127
|
-
const _v = ["vx-view", props.className];
|
|
128
|
-
if (_b.c !== _v) _b.c = _v;
|
|
129
|
-
}
|
|
130
|
-
_b.d = snapshotSpread(layoutChildProps(props));
|
|
131
|
-
_b.f = bindSignalHostPropSources(__s, _b.f, _b.e, [
|
|
132
|
-
[
|
|
133
|
-
false,
|
|
134
|
-
"id",
|
|
135
|
-
_b.a
|
|
136
|
-
],
|
|
137
|
-
[
|
|
138
|
-
false,
|
|
139
|
-
"ref",
|
|
140
|
-
_b.b
|
|
141
|
-
],
|
|
142
|
-
[
|
|
143
|
-
false,
|
|
144
|
-
"className",
|
|
145
|
-
_b.c
|
|
146
|
-
],
|
|
147
|
-
[true, _b.d]
|
|
148
|
-
], "b:3f348e03", true);
|
|
149
|
-
}
|
|
150
|
-
_b.i = bindSignalChild(__s, _b.i, 1, _b.e, props.children, "b:35b9af07", null, void 0, void 0, void 0, true);
|
|
151
|
-
});
|
|
1
|
+
//#region src/layout-child.web.ts
|
|
2
|
+
/** The shared contract is "numbers are dips" (RN semantics), but octane's DOM
|
|
3
|
+
* renderer keeps React's unitless list — lineHeight is unitless there, so
|
|
4
|
+
* `style={{lineHeight: 40}}` would render a 40× multiplier instead of 40px.
|
|
5
|
+
* lineHeight is the one unitless-in-React prop that is a length in the
|
|
6
|
+
* shared vocabulary; force the px suffix. */
|
|
7
|
+
function normStyle(style) {
|
|
8
|
+
if (style && typeof style.lineHeight === "number") return {
|
|
9
|
+
...style,
|
|
10
|
+
lineHeight: style.lineHeight + "px"
|
|
11
|
+
};
|
|
12
|
+
return style;
|
|
13
|
+
}
|
|
14
|
+
var FLEX_JUSTIFY = {
|
|
15
|
+
start: "flex-start",
|
|
16
|
+
end: "flex-end"
|
|
17
|
+
};
|
|
18
|
+
var FLEX_ALIGN = {
|
|
19
|
+
start: "flex-start",
|
|
20
|
+
end: "flex-end"
|
|
21
|
+
};
|
|
22
|
+
/** Convert parent-layout metadata to CSS on the web leaf. Native's `dock`
|
|
23
|
+
* attribute has no CSS equivalent and is ignored on web. Grid indices are
|
|
24
|
+
* zero-based in the shared API, matching NativeScript. */
|
|
25
|
+
function layoutChildProps(props, baseStyle = props.style) {
|
|
26
|
+
const style = { ...normStyle(baseStyle) };
|
|
27
|
+
if (props.row !== void 0) style.gridRow = `${props.row + 1} / span ${props.rowSpan ?? 1}`;
|
|
28
|
+
else if (props.rowSpan !== void 0) style.gridRow = `span ${props.rowSpan}`;
|
|
29
|
+
if (props.col !== void 0) style.gridColumn = `${props.col + 1} / span ${props.colSpan ?? 1}`;
|
|
30
|
+
else if (props.colSpan !== void 0) style.gridColumn = `span ${props.colSpan}`;
|
|
31
|
+
if (props.left !== void 0) style.left = props.left;
|
|
32
|
+
if (props.top !== void 0) style.top = props.top;
|
|
33
|
+
if (props.flexGrow !== void 0) style.flexGrow = props.flexGrow;
|
|
34
|
+
if (props.flexShrink !== void 0) style.flexShrink = props.flexShrink;
|
|
35
|
+
if (props.alignSelf !== void 0) style.alignSelf = props.alignSelf;
|
|
36
|
+
if (props.order !== void 0) style.order = props.order;
|
|
37
|
+
if (props.justifyContent !== void 0) style.justifyContent = FLEX_JUSTIFY[props.justifyContent] ?? props.justifyContent;
|
|
38
|
+
if (props.alignItems !== void 0) style.alignItems = FLEX_ALIGN[props.alignItems] ?? props.alignItems;
|
|
39
|
+
if (props.flexWrap !== void 0) style.flexWrap = props.flexWrap === true ? "wrap" : props.flexWrap === false ? "nowrap" : props.flexWrap;
|
|
40
|
+
if (props.gap !== void 0) style.gap = props.gap;
|
|
41
|
+
if (props.rowGap !== void 0) style.rowGap = props.rowGap;
|
|
42
|
+
if (props.columnGap !== void 0) style.columnGap = props.columnGap;
|
|
43
|
+
if (typeof style.lineHeight === "number") style.lineHeight = style.lineHeight + "px";
|
|
44
|
+
return { style };
|
|
45
|
+
}
|
|
152
46
|
//#endregion
|
|
153
|
-
export {
|
|
47
|
+
export { layoutChildProps, normStyle };
|
package/dist/web/ui40.js
CHANGED
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
//#region src/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { applyEscapeProps } from "./ui2.js";
|
|
2
|
+
import { __s, bag6, clone, delegateEvents, queueRefAttach, queueRefDetach, setEventHandler, setStyle, template } from "octane";
|
|
3
|
+
import { bindSignalAttribute, bindSignalChecked, enableSignalBindings, replaceRef, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
|
|
4
|
+
//#region src/Switch.web.tsrx
|
|
5
|
+
enableSignalBindings(1, true);
|
|
6
|
+
delegateEvents(["change"]);
|
|
7
|
+
var _t$0 = /* @__PURE__ */ template("<input type=\"checkbox\" data-octane-input=\"i:0400e5c1\"/>");
|
|
8
|
+
var _rm$0 = [
|
|
9
|
+
"r",
|
|
10
|
+
"b",
|
|
11
|
+
"a"
|
|
12
|
+
];
|
|
13
|
+
var Switch = /* @__PURE__ */ __s(function Switch(props, __s, __extra) {
|
|
14
|
+
let _b = __s.slots[0];
|
|
15
|
+
if (_b === void 0) {
|
|
16
|
+
let _m0, _m1, _m5;
|
|
17
|
+
const _root = clone(_t$0);
|
|
18
|
+
queueRefAttach(__s, _m1 = (e) => applyEscapeProps(e, props), _m0 = _root);
|
|
19
|
+
(__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.b, _b.a));
|
|
20
|
+
_m5 = bindSignalChecked(__s, void 0, _root, props.checked, "i:0400e5c1");
|
|
21
|
+
setEventHandler(_root, "$$change", (e) => props.onCheckedChange?.(e.target.checked));
|
|
22
|
+
_b = bag6(__s, _root, _m0, _m1, void 0, void 0, void 0, _m5);
|
|
23
|
+
__s.refFields = _rm$0;
|
|
24
|
+
} else {
|
|
22
25
|
{
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
const _r = (e) => applyEscapeProps(e, props);
|
|
27
|
+
if (_r !== _b.b) _b.b = replaceRef(__s, _b.b, _r, _b.a);
|
|
28
|
+
}
|
|
29
|
+
_b.f = bindSignalChecked(__s, _b.f, _b.a, props.checked, "i:0400e5c1");
|
|
30
|
+
setEventHandler(_b.a, "$$change", (e) => props.onCheckedChange?.(e.target.checked));
|
|
31
|
+
}
|
|
32
|
+
_b.c = bindSignalAttribute(__s, _b.c, _b.a, "id", props.id, "b:18b5d0ad", setPlainAttribute);
|
|
33
|
+
_b.d = updateFreshClassName(["vx-switch", props.className], _b.d, _b.a);
|
|
34
|
+
{
|
|
35
|
+
const _v = props.style;
|
|
36
|
+
if (_b.e !== _v) {
|
|
37
|
+
setStyle(_b.a, _v, _b.e);
|
|
38
|
+
_b.e = _v;
|
|
26
39
|
}
|
|
27
40
|
}
|
|
28
|
-
|
|
29
|
-
"id": props.id,
|
|
30
|
-
"className": [
|
|
31
|
-
"vx-heading",
|
|
32
|
-
`vx-h${level}`,
|
|
33
|
-
props.className
|
|
34
|
-
],
|
|
35
|
-
"style": props.style,
|
|
36
|
-
"ref": (el) => applyWebProps(el, props.web),
|
|
37
|
-
"children": markChildrenBlock(__children$1, __childrenBody)
|
|
38
|
-
}, __block.endMarker, void 0, void 0, true, void 0, "c:4d3be985");
|
|
39
|
-
};
|
|
41
|
+
});
|
|
40
42
|
//#endregion
|
|
41
|
-
export {
|
|
43
|
+
export { Switch };
|
package/dist/web/ui41.js
CHANGED
|
@@ -1,17 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { hookSlots, useEffect, useState } from "octane";
|
|
2
|
+
//#region src/safeAreaInsets.web.tsrx
|
|
3
|
+
var _hs$ = /* @__PURE__ */ hookSlots(2);
|
|
4
|
+
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
5
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
6
|
+
function measure() {
|
|
7
|
+
if (!document.body) return {
|
|
8
|
+
top: 0,
|
|
9
|
+
right: 0,
|
|
10
|
+
bottom: 0,
|
|
11
|
+
left: 0
|
|
12
|
+
};
|
|
13
|
+
const probe = document.createElement("div");
|
|
14
|
+
probe.style.cssText = "position:fixed;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);padding:constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);";
|
|
15
|
+
document.body.appendChild(probe);
|
|
16
|
+
const style = getComputedStyle(probe);
|
|
17
|
+
const insets = {
|
|
18
|
+
top: parseFloat(style.paddingTop) || 0,
|
|
19
|
+
right: parseFloat(style.paddingRight) || 0,
|
|
20
|
+
bottom: parseFloat(style.paddingBottom) || 0,
|
|
21
|
+
left: parseFloat(style.paddingLeft) || 0
|
|
22
|
+
};
|
|
23
|
+
probe.remove();
|
|
24
|
+
return insets;
|
|
25
|
+
}
|
|
26
|
+
function useSafeAreaInsets() {
|
|
27
|
+
const [insets, setInsets] = useState({
|
|
28
|
+
top: 0,
|
|
29
|
+
right: 0,
|
|
30
|
+
bottom: 0,
|
|
31
|
+
left: 0
|
|
32
|
+
}, _h$0);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const update = () => setInsets(measure());
|
|
35
|
+
update();
|
|
36
|
+
window.addEventListener("resize", update);
|
|
37
|
+
return () => window.removeEventListener("resize", update);
|
|
38
|
+
}, [], _h$1);
|
|
39
|
+
return insets;
|
|
40
|
+
}
|
|
16
41
|
//#endregion
|
|
17
|
-
export {
|
|
42
|
+
export { useSafeAreaInsets };
|