@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
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { applyThemeClasses } from "./ui31.js";
|
|
2
|
+
import { topRootLayout } from "./ui34.js";
|
|
3
|
+
import { createNativeScriptRoot } from "@nativescript-community/octane";
|
|
4
|
+
import { GridLayout } from "@nativescript/core";
|
|
5
|
+
//#region src/sheet-service.native.ts
|
|
6
|
+
var active = /* @__PURE__ */ new Set();
|
|
7
|
+
/** The most recently opened sheet's host view — for harness asserts (view
|
|
8
|
+
* identity beats tree search; the owning rootlayout may unload/reload). */
|
|
9
|
+
function sheetHost() {
|
|
10
|
+
return [...active].pop()?.host ?? null;
|
|
11
|
+
}
|
|
12
|
+
/** Close the most recently opened sheet (resolve with `result`). */
|
|
13
|
+
function closeSheet(result) {
|
|
14
|
+
[...active].pop()?.finish(result);
|
|
15
|
+
}
|
|
16
|
+
/** Imperative in-window sheet: a dedicated Octane root on a bottom-docked
|
|
17
|
+
* GridLayout host opened on the CURRENT rootlayout (topRootLayout — the
|
|
18
|
+
* service has no declaring view). Resolves when the sheet closes. */
|
|
19
|
+
var openSheet = (Component, params, options = {}) => new Promise((resolve) => {
|
|
20
|
+
const rl = topRootLayout();
|
|
21
|
+
if (!rl) {
|
|
22
|
+
console.warn("[openSheet] no RootLayout mounted — sheet skipped");
|
|
23
|
+
resolve(void 0);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const host = new GridLayout();
|
|
27
|
+
const unbindTheme = applyThemeClasses(host, "vx-sheet-host");
|
|
28
|
+
host.horizontalAlignment = "stretch";
|
|
29
|
+
host.verticalAlignment = "bottom";
|
|
30
|
+
const root = createNativeScriptRoot(host);
|
|
31
|
+
let finished = false;
|
|
32
|
+
const finish = (result) => {
|
|
33
|
+
if (finished) return;
|
|
34
|
+
finished = true;
|
|
35
|
+
active.delete(entry);
|
|
36
|
+
unbindTheme();
|
|
37
|
+
root.unmount?.();
|
|
38
|
+
const owner = host.parent;
|
|
39
|
+
if (owner?.hasChild?.(host)) owner.close(host).catch((error) => {
|
|
40
|
+
console.error("[openSheet] close failed", error);
|
|
41
|
+
});
|
|
42
|
+
resolve(result);
|
|
43
|
+
};
|
|
44
|
+
const entry = {
|
|
45
|
+
host,
|
|
46
|
+
root,
|
|
47
|
+
finish
|
|
48
|
+
};
|
|
49
|
+
host.on("closed", () => finish());
|
|
50
|
+
root.render(Component, {
|
|
51
|
+
params,
|
|
52
|
+
close: finish
|
|
53
|
+
});
|
|
54
|
+
active.add(entry);
|
|
55
|
+
rl.open(host, {
|
|
56
|
+
...options.shadeCover ?? true ? { shadeCover: {
|
|
57
|
+
opacity: .4,
|
|
58
|
+
tapToClose: true
|
|
59
|
+
} } : {},
|
|
60
|
+
animation: {
|
|
61
|
+
enterFrom: {
|
|
62
|
+
translateY: 400,
|
|
63
|
+
duration: 250
|
|
64
|
+
},
|
|
65
|
+
exitTo: {
|
|
66
|
+
translateY: 400,
|
|
67
|
+
duration: 200
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}).catch((error) => {
|
|
71
|
+
console.error("[openSheet] open failed", error);
|
|
72
|
+
finish();
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
//#endregion
|
|
76
|
+
export { closeSheet, openSheet, sheetHost };
|
package/dist/web/ui.js
CHANGED
|
@@ -25,27 +25,29 @@ import { applyThemeClasses, getThemePreference, getThemeScheme, onThemeSchemeCha
|
|
|
25
25
|
import { openModal } from "./ui30.js";
|
|
26
26
|
import { Overlay } from "./ui31.js";
|
|
27
27
|
import { Popover } from "./ui33.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
|
|
28
|
+
import { Hoverable } from "./ui34.js";
|
|
29
|
+
import { showToast } from "./ui35.js";
|
|
30
|
+
import { useAnimation } from "./ui36.js";
|
|
31
|
+
import { styled } from "./ui37.js";
|
|
32
|
+
import { openWindow } from "./ui38.js";
|
|
33
|
+
import { Screen } from "./ui39.js";
|
|
34
|
+
import { Tabs } from "./ui40.js";
|
|
35
|
+
import { Switch } from "./ui41.js";
|
|
36
|
+
import { useSafeAreaInsets } from "./ui42.js";
|
|
37
|
+
import { SafeArea } from "./ui43.js";
|
|
38
|
+
import { KeyboardAvoiding } from "./ui44.js";
|
|
39
|
+
import { Drawer } from "./ui45.js";
|
|
40
|
+
import { useMeasure } from "./ui46.js";
|
|
41
|
+
import { ActivityIndicator } from "./ui48.js";
|
|
42
|
+
import { Meter } from "./ui50.js";
|
|
43
|
+
import { Slider } from "./ui51.js";
|
|
44
|
+
import { registerIcon, registerIcons } from "./ui52.js";
|
|
45
|
+
import { Icon } from "./ui53.js";
|
|
46
|
+
import { Heading } from "./ui54.js";
|
|
47
|
+
import { PlatformBadge } from "./ui55.js";
|
|
48
|
+
import { getStack, registerStack, stackEntries } from "./ui56.js";
|
|
49
|
+
import { createStore } from "./ui57.js";
|
|
50
|
+
import { useStore } from "./ui58.js";
|
|
51
|
+
import { Sheet } from "./ui59.js";
|
|
52
|
+
import { closeSheet, openSheet } from "./ui60.js";
|
|
53
|
+
export { Absolute, ActivityIndicator, View as Column, Drawer, Grid, Heading, Hoverable, Icon, Image, KeyboardAvoiding, Link, LiquidGlass, LiquidGlassContainer, List, Meter, Modal, NavLink, Overlay, PlatformBadge, Popover, Pressable, RichText, RichTextSpan, Row, SafeArea, Screen, ScrollBox, ScrollView, Sheet, Slider, Spacer, Stack, Switch, Tabs, Text, TextArea, TextInput, View, applyThemeClasses, canGoBack, closeSheet, createStore, currentModalRoute, currentRoute, deriveRouteManifest, getColorScheme, getStack, getThemePreference, getThemeScheme, hrefFor, onThemeSchemeChange, openModal, openSheet, openWindow, popRoute, pushDeepLink, pushRoute, redirect, registerIcon, registerIcons, registerRoutes, registerScreens, registerStack, routeFor, routeStacks, screenFor, setThemePreference, showToast, stackEntries, styled, themeSchemeClasses, useAnimation, useCanGoBack, useColorScheme, useMeasure, useModalRoute, useRoute, useSafeAreaInsets, useStore, useThemeScheme };
|
package/dist/web/ui13.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { applyEscapeProps } from "./ui2.js";
|
|
2
2
|
import { layoutChildProps } from "./ui4.js";
|
|
3
|
-
import { __s,
|
|
3
|
+
import { __s, bagOf, clone, snapshotSpread, template } from "octane";
|
|
4
4
|
import { bindSignalChild, bindSignalHostPropSources, enableSignalBindings } from "octane/internal/client";
|
|
5
5
|
//#region src/Text.web.tsrx
|
|
6
6
|
enableSignalBindings(1, true);
|
|
7
7
|
var _t$0 = /* @__PURE__ */ template("<span></span>");
|
|
8
8
|
var _rm$1 = [
|
|
9
9
|
"s",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"q",
|
|
11
|
+
"p"
|
|
12
12
|
];
|
|
13
13
|
var Text = /* @__PURE__ */ __s(function Text(props, __s, __extra) {
|
|
14
14
|
const textStyle = {
|
|
@@ -28,22 +28,25 @@ var Text = /* @__PURE__ */ __s(function Text(props, __s, __extra) {
|
|
|
28
28
|
};
|
|
29
29
|
let _b = __s.slots[0];
|
|
30
30
|
if (_b === void 0) {
|
|
31
|
-
let _m0, _m1, _m2, _m3, _m4, _m5, _m6, _m7, _m8, _m9, _m10, _m11, _m12, _m13;
|
|
31
|
+
let _m0, _m1, _m2, _m3, _m4, _m5, _m6, _m7, _m8, _m9, _m10, _m11, _m12, _m13, _m14, _m15, _m16;
|
|
32
32
|
const _root = clone(_t$0);
|
|
33
33
|
_m0 = props.id;
|
|
34
34
|
_m1 = (el) => applyEscapeProps(el, props);
|
|
35
35
|
_m2 = props.className;
|
|
36
36
|
_m3 = snapshotSpread(layoutChildProps(props, textStyle));
|
|
37
|
-
_m4 = props.
|
|
38
|
-
_m5 = props.
|
|
39
|
-
_m6 = props.
|
|
40
|
-
_m7 = props.
|
|
41
|
-
_m8 = props.
|
|
42
|
-
_m9 = props.accessibilityState?.
|
|
43
|
-
_m10 = props.accessibilityState?.
|
|
44
|
-
_m11 = props.
|
|
45
|
-
_m12 =
|
|
46
|
-
_m13 =
|
|
37
|
+
_m4 = props.accessibilityRole;
|
|
38
|
+
_m5 = props.accessibilityLabel;
|
|
39
|
+
_m6 = props.accessible === false ? true : void 0;
|
|
40
|
+
_m7 = props.accessibilityHint;
|
|
41
|
+
_m8 = props.accessibilityValue;
|
|
42
|
+
_m9 = props.accessibilityState?.disabled;
|
|
43
|
+
_m10 = props.accessibilityState?.selected;
|
|
44
|
+
_m11 = props.accessibilityState?.checked;
|
|
45
|
+
_m12 = props.accessibilityState?.busy;
|
|
46
|
+
_m13 = props.accessibilityState?.expanded;
|
|
47
|
+
_m14 = props.accessibilityLiveRegion === "none" ? "off" : props.accessibilityLiveRegion;
|
|
48
|
+
_m15 = _root;
|
|
49
|
+
_m16 = bindSignalHostPropSources(__s, void 0, _root, [
|
|
47
50
|
[
|
|
48
51
|
false,
|
|
49
52
|
"id",
|
|
@@ -62,46 +65,81 @@ var Text = /* @__PURE__ */ __s(function Text(props, __s, __extra) {
|
|
|
62
65
|
[true, _m3],
|
|
63
66
|
[
|
|
64
67
|
false,
|
|
65
|
-
"
|
|
68
|
+
"role",
|
|
66
69
|
_m4
|
|
67
70
|
],
|
|
68
71
|
[
|
|
69
72
|
false,
|
|
70
|
-
"aria-
|
|
73
|
+
"aria-label",
|
|
71
74
|
_m5
|
|
72
75
|
],
|
|
73
76
|
[
|
|
74
77
|
false,
|
|
75
|
-
"aria-
|
|
78
|
+
"aria-hidden",
|
|
76
79
|
_m6
|
|
77
80
|
],
|
|
78
81
|
[
|
|
79
82
|
false,
|
|
80
|
-
"aria-
|
|
83
|
+
"aria-description",
|
|
81
84
|
_m7
|
|
82
85
|
],
|
|
83
86
|
[
|
|
84
87
|
false,
|
|
85
|
-
"aria-
|
|
88
|
+
"aria-valuetext",
|
|
86
89
|
_m8
|
|
87
90
|
],
|
|
88
91
|
[
|
|
89
92
|
false,
|
|
90
|
-
"aria-
|
|
93
|
+
"aria-disabled",
|
|
91
94
|
_m9
|
|
92
95
|
],
|
|
93
96
|
[
|
|
94
97
|
false,
|
|
95
|
-
"aria-
|
|
98
|
+
"aria-selected",
|
|
96
99
|
_m10
|
|
97
100
|
],
|
|
98
101
|
[
|
|
99
102
|
false,
|
|
100
|
-
"aria-
|
|
103
|
+
"aria-checked",
|
|
101
104
|
_m11
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
false,
|
|
108
|
+
"aria-busy",
|
|
109
|
+
_m12
|
|
110
|
+
],
|
|
111
|
+
[
|
|
112
|
+
false,
|
|
113
|
+
"aria-expanded",
|
|
114
|
+
_m13
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
false,
|
|
118
|
+
"aria-live",
|
|
119
|
+
_m14
|
|
102
120
|
]
|
|
103
121
|
], "b:3b621770", true);
|
|
104
|
-
_b =
|
|
122
|
+
_b = bagOf(__s, _root, {
|
|
123
|
+
a: _m0,
|
|
124
|
+
b: _m1,
|
|
125
|
+
c: _m2,
|
|
126
|
+
d: _m3,
|
|
127
|
+
e: _m4,
|
|
128
|
+
f: _m5,
|
|
129
|
+
g: _m6,
|
|
130
|
+
h: _m7,
|
|
131
|
+
i: _m8,
|
|
132
|
+
j: _m9,
|
|
133
|
+
k: _m10,
|
|
134
|
+
l: _m11,
|
|
135
|
+
m: _m12,
|
|
136
|
+
n: _m13,
|
|
137
|
+
o: _m14,
|
|
138
|
+
p: _m15,
|
|
139
|
+
q: _m16,
|
|
140
|
+
r: null,
|
|
141
|
+
s: void 0
|
|
142
|
+
});
|
|
105
143
|
__s.refFields = _rm$1;
|
|
106
144
|
} else {
|
|
107
145
|
{
|
|
@@ -118,38 +156,50 @@ var Text = /* @__PURE__ */ __s(function Text(props, __s, __extra) {
|
|
|
118
156
|
}
|
|
119
157
|
_b.d = snapshotSpread(layoutChildProps(props, textStyle));
|
|
120
158
|
{
|
|
121
|
-
const _v = props.
|
|
159
|
+
const _v = props.accessibilityRole;
|
|
122
160
|
if (_b.e !== _v) _b.e = _v;
|
|
123
161
|
}
|
|
124
162
|
{
|
|
125
|
-
const _v = props.
|
|
163
|
+
const _v = props.accessibilityLabel;
|
|
126
164
|
if (_b.f !== _v) _b.f = _v;
|
|
127
165
|
}
|
|
128
166
|
{
|
|
129
|
-
const _v = props.
|
|
167
|
+
const _v = props.accessible === false ? true : void 0;
|
|
130
168
|
if (_b.g !== _v) _b.g = _v;
|
|
131
169
|
}
|
|
132
170
|
{
|
|
133
|
-
const _v = props.
|
|
171
|
+
const _v = props.accessibilityHint;
|
|
134
172
|
if (_b.h !== _v) _b.h = _v;
|
|
135
173
|
}
|
|
136
174
|
{
|
|
137
|
-
const _v = props.
|
|
175
|
+
const _v = props.accessibilityValue;
|
|
138
176
|
if (_b.i !== _v) _b.i = _v;
|
|
139
177
|
}
|
|
140
178
|
{
|
|
141
|
-
const _v = props.accessibilityState?.
|
|
179
|
+
const _v = props.accessibilityState?.disabled;
|
|
142
180
|
if (_b.j !== _v) _b.j = _v;
|
|
143
181
|
}
|
|
144
182
|
{
|
|
145
|
-
const _v = props.accessibilityState?.
|
|
183
|
+
const _v = props.accessibilityState?.selected;
|
|
146
184
|
if (_b.k !== _v) _b.k = _v;
|
|
147
185
|
}
|
|
148
186
|
{
|
|
149
|
-
const _v = props.
|
|
187
|
+
const _v = props.accessibilityState?.checked;
|
|
150
188
|
if (_b.l !== _v) _b.l = _v;
|
|
151
189
|
}
|
|
152
|
-
|
|
190
|
+
{
|
|
191
|
+
const _v = props.accessibilityState?.busy;
|
|
192
|
+
if (_b.m !== _v) _b.m = _v;
|
|
193
|
+
}
|
|
194
|
+
{
|
|
195
|
+
const _v = props.accessibilityState?.expanded;
|
|
196
|
+
if (_b.n !== _v) _b.n = _v;
|
|
197
|
+
}
|
|
198
|
+
{
|
|
199
|
+
const _v = props.accessibilityLiveRegion === "none" ? "off" : props.accessibilityLiveRegion;
|
|
200
|
+
if (_b.o !== _v) _b.o = _v;
|
|
201
|
+
}
|
|
202
|
+
_b.q = bindSignalHostPropSources(__s, _b.q, _b.p, [
|
|
153
203
|
[
|
|
154
204
|
false,
|
|
155
205
|
"id",
|
|
@@ -168,47 +218,62 @@ var Text = /* @__PURE__ */ __s(function Text(props, __s, __extra) {
|
|
|
168
218
|
[true, _b.d],
|
|
169
219
|
[
|
|
170
220
|
false,
|
|
171
|
-
"
|
|
221
|
+
"role",
|
|
172
222
|
_b.e
|
|
173
223
|
],
|
|
174
224
|
[
|
|
175
225
|
false,
|
|
176
|
-
"aria-
|
|
226
|
+
"aria-label",
|
|
177
227
|
_b.f
|
|
178
228
|
],
|
|
179
229
|
[
|
|
180
230
|
false,
|
|
181
|
-
"aria-
|
|
231
|
+
"aria-hidden",
|
|
182
232
|
_b.g
|
|
183
233
|
],
|
|
184
234
|
[
|
|
185
235
|
false,
|
|
186
|
-
"aria-
|
|
236
|
+
"aria-description",
|
|
187
237
|
_b.h
|
|
188
238
|
],
|
|
189
239
|
[
|
|
190
240
|
false,
|
|
191
|
-
"aria-
|
|
241
|
+
"aria-valuetext",
|
|
192
242
|
_b.i
|
|
193
243
|
],
|
|
194
244
|
[
|
|
195
245
|
false,
|
|
196
|
-
"aria-
|
|
246
|
+
"aria-disabled",
|
|
197
247
|
_b.j
|
|
198
248
|
],
|
|
199
249
|
[
|
|
200
250
|
false,
|
|
201
|
-
"aria-
|
|
251
|
+
"aria-selected",
|
|
202
252
|
_b.k
|
|
203
253
|
],
|
|
204
254
|
[
|
|
205
255
|
false,
|
|
206
|
-
"aria-
|
|
256
|
+
"aria-checked",
|
|
207
257
|
_b.l
|
|
258
|
+
],
|
|
259
|
+
[
|
|
260
|
+
false,
|
|
261
|
+
"aria-busy",
|
|
262
|
+
_b.m
|
|
263
|
+
],
|
|
264
|
+
[
|
|
265
|
+
false,
|
|
266
|
+
"aria-expanded",
|
|
267
|
+
_b.n
|
|
268
|
+
],
|
|
269
|
+
[
|
|
270
|
+
false,
|
|
271
|
+
"aria-live",
|
|
272
|
+
_b.o
|
|
208
273
|
]
|
|
209
274
|
], "b:3b621770", true);
|
|
210
275
|
}
|
|
211
|
-
_b.
|
|
276
|
+
_b.t = bindSignalChild(__s, _b.t, 1, _b.p, props.children, "b:152a7b75", null, void 0, void 0, void 0, true);
|
|
212
277
|
});
|
|
213
278
|
//#endregion
|
|
214
279
|
export { Text };
|
package/dist/web/ui34.js
CHANGED
|
@@ -1,70 +1,150 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
//#region src/
|
|
6
|
-
var _t$0 = /* @__PURE__ */ template("
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
_m0 = _root;
|
|
14
|
-
_b = bag3(__s, _root, _m0, null, void 0);
|
|
15
|
-
}
|
|
16
|
-
{
|
|
17
|
-
const _v = props.content;
|
|
18
|
-
_b.b = childTextHoleUpdate(__s, 1, _b.a, _v, _b.b, _b.c);
|
|
19
|
-
_b.c = _v;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function __else$2(__props, __s, __extra) {
|
|
23
|
-
const Component = __extra[0].content;
|
|
24
|
-
let _b = __s.slots[0];
|
|
25
|
-
if (_b === void 0) {
|
|
26
|
-
let _m0;
|
|
27
|
-
const _root = clone(_t$0);
|
|
28
|
-
_m0 = _root;
|
|
29
|
-
_b = bag1(__s, _root, _m0);
|
|
30
|
-
}
|
|
31
|
-
componentSlot(__s, 1, _b.a, Component, {}, void 0, void 0, void 0, void 0, void 0, "c:1641d101");
|
|
32
|
-
}
|
|
33
|
-
var queue = [];
|
|
34
|
-
var active = false;
|
|
35
|
-
var ToastBody = /* @__PURE__ */ __s(function ToastBody(props, __s, __extra) {
|
|
1
|
+
import { View } from "./ui5.js";
|
|
2
|
+
import { Popover } from "./ui33.js";
|
|
3
|
+
import { bag4, bag5, child, clone, componentSlotVoid, drainFrag, hookSlots, markChildrenBlock, sibling, template, useEffect, useRef, useState } from "octane";
|
|
4
|
+
import { compilerMemoRegion, hookMemoCreate, hookMemoPublishInvariant, textHoleUpdate } from "octane/internal/client";
|
|
5
|
+
//#region src/Hoverable.web.tsrx
|
|
6
|
+
var _t$0 = /* @__PURE__ */ template("<!>", 0, 1);
|
|
7
|
+
var _t$1 = /* @__PURE__ */ template("<!><!>", 3, 1);
|
|
8
|
+
var _hs$ = /* @__PURE__ */ hookSlots(7);
|
|
9
|
+
var __childrenBody = {};
|
|
10
|
+
var __childrenBody$ = {};
|
|
11
|
+
var __childrenBody$2 = {};
|
|
12
|
+
var Hoverable = function Hoverable(props, __s, __extra) {
|
|
36
13
|
const __block = __s.block;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const unbindTheme = applyThemeClasses(host, cx("vx-toast-host", entry.options.position === "top" ? "vx-toast-top" : "vx-toast-bottom"));
|
|
50
|
-
applyWebProps(host, entry.options.web);
|
|
51
|
-
document.body.appendChild(host);
|
|
52
|
-
const root = createRoot(host);
|
|
53
|
-
root.render(ToastBody, { content: entry.content });
|
|
54
|
-
setTimeout(() => {
|
|
55
|
-
unbindTheme();
|
|
56
|
-
root.unmount();
|
|
57
|
-
host.remove();
|
|
58
|
-
active = false;
|
|
59
|
-
showNext();
|
|
60
|
-
}, Math.max(0, entry.options.duration ?? 3e3));
|
|
61
|
-
}
|
|
62
|
-
function showToast(content, options = {}) {
|
|
63
|
-
queue.push({
|
|
64
|
-
content,
|
|
65
|
-
options
|
|
14
|
+
const __memoRegion = compilerMemoRegion(__s, _hs$ + 0);
|
|
15
|
+
let __hk = __memoRegion.hooks;
|
|
16
|
+
if (__hk === void 0) __memoRegion.hooks = __hk = hookMemoCreate(3);
|
|
17
|
+
const [open, setOpen] = useState(false, _hs$ + 0);
|
|
18
|
+
const anchor = useRef(null, _hs$ + 1);
|
|
19
|
+
const anchorBinding = useRef(null, _hs$ + 2);
|
|
20
|
+
const cardBinding = useRef(null, _hs$ + 3);
|
|
21
|
+
const openTimer = useRef(null, _hs$ + 4);
|
|
22
|
+
const closeTimer = useRef(null, _hs$ + 5);
|
|
23
|
+
const clearOpen = __hk[0] ?? hookMemoPublishInvariant(__hk, 0, () => {
|
|
24
|
+
if (openTimer.current !== null) clearTimeout(openTimer.current);
|
|
25
|
+
openTimer.current = null;
|
|
66
26
|
});
|
|
67
|
-
|
|
68
|
-
|
|
27
|
+
const clearClose = __hk[1] ?? hookMemoPublishInvariant(__hk, 1, () => {
|
|
28
|
+
if (closeTimer.current !== null) clearTimeout(closeTimer.current);
|
|
29
|
+
closeTimer.current = null;
|
|
30
|
+
});
|
|
31
|
+
const scheduleClose = () => {
|
|
32
|
+
clearClose();
|
|
33
|
+
closeTimer.current = setTimeout(() => {
|
|
34
|
+
closeTimer.current = null;
|
|
35
|
+
setOpen(false);
|
|
36
|
+
}, Math.max(0, props.closeDelay ?? 120));
|
|
37
|
+
};
|
|
38
|
+
const startOpen = () => {
|
|
39
|
+
clearClose();
|
|
40
|
+
clearOpen();
|
|
41
|
+
openTimer.current = setTimeout(() => {
|
|
42
|
+
openTimer.current = null;
|
|
43
|
+
setOpen(true);
|
|
44
|
+
}, Math.max(0, props.openDelay ?? 500));
|
|
45
|
+
};
|
|
46
|
+
const unbind = __hk[2] ?? hookMemoPublishInvariant(__hk, 2, (binding) => {
|
|
47
|
+
if (!binding) return;
|
|
48
|
+
binding.node.removeEventListener("mouseenter", binding.enter);
|
|
49
|
+
binding.node.removeEventListener("mouseleave", binding.leave);
|
|
50
|
+
});
|
|
51
|
+
const bindAnchor = (node) => {
|
|
52
|
+
anchor.current = node;
|
|
53
|
+
if (anchorBinding.current?.node === node) return;
|
|
54
|
+
unbind(anchorBinding.current);
|
|
55
|
+
anchorBinding.current = null;
|
|
56
|
+
if (!node) return;
|
|
57
|
+
const binding = {
|
|
58
|
+
node,
|
|
59
|
+
enter: startOpen,
|
|
60
|
+
leave: () => {
|
|
61
|
+
clearOpen();
|
|
62
|
+
scheduleClose();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
node.addEventListener("mouseenter", binding.enter);
|
|
66
|
+
node.addEventListener("mouseleave", binding.leave);
|
|
67
|
+
anchorBinding.current = binding;
|
|
68
|
+
};
|
|
69
|
+
const bindCard = (node) => {
|
|
70
|
+
if (cardBinding.current?.node === node) return;
|
|
71
|
+
unbind(cardBinding.current);
|
|
72
|
+
cardBinding.current = null;
|
|
73
|
+
if (!node) return;
|
|
74
|
+
const binding = {
|
|
75
|
+
node,
|
|
76
|
+
enter: clearClose,
|
|
77
|
+
leave: scheduleClose
|
|
78
|
+
};
|
|
79
|
+
node.addEventListener("mouseenter", binding.enter);
|
|
80
|
+
node.addEventListener("mouseleave", binding.leave);
|
|
81
|
+
cardBinding.current = binding;
|
|
82
|
+
};
|
|
83
|
+
useEffect(() => () => {
|
|
84
|
+
clearOpen();
|
|
85
|
+
clearClose();
|
|
86
|
+
unbind(anchorBinding.current);
|
|
87
|
+
unbind(cardBinding.current);
|
|
88
|
+
}, [], _hs$ + 6);
|
|
89
|
+
function __children$1(__props, __s, __extra) {
|
|
90
|
+
const __block = __s.block;
|
|
91
|
+
function __children$4(__props, __s, __extra) {
|
|
92
|
+
const __block = __s.block;
|
|
93
|
+
function __children$6(__props, __s, __extra) {
|
|
94
|
+
const __block = __s.block;
|
|
95
|
+
let _b = __s.slots[0];
|
|
96
|
+
if (_b === void 0) {
|
|
97
|
+
let _m0, _m1;
|
|
98
|
+
const _root = clone(_t$0);
|
|
99
|
+
_m0 = __block.parentNode;
|
|
100
|
+
_m1 = child(_root);
|
|
101
|
+
drainFrag(_root, __block.parentNode, __block.endMarker);
|
|
102
|
+
_b = bag4(__s, null, _m0, _m1, null, void 0);
|
|
103
|
+
}
|
|
104
|
+
{
|
|
105
|
+
const _v = props.card;
|
|
106
|
+
_b.c = textHoleUpdate(__s, 1, _b.a, _v, _b.c, _b.d, _b.b, true, true);
|
|
107
|
+
_b.d = _v;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
componentSlotVoid(__s, 0, __block.parentNode, View, {
|
|
111
|
+
"bind": bindCard,
|
|
112
|
+
"className": props.cardClassName,
|
|
113
|
+
"style": props.cardStyle,
|
|
114
|
+
"children": markChildrenBlock(__children$6, __childrenBody)
|
|
115
|
+
}, __block.endMarker, void 0, void 0, void 0, void 0, "c:efc5cf17");
|
|
116
|
+
}
|
|
117
|
+
let _b = __s.slots[0];
|
|
118
|
+
if (_b === void 0) {
|
|
119
|
+
let _m0, _m1, _m4;
|
|
120
|
+
const _root = clone(_t$1);
|
|
121
|
+
_m0 = __block.parentNode;
|
|
122
|
+
const _el0 = child(_root);
|
|
123
|
+
_m1 = _el0;
|
|
124
|
+
_m4 = sibling(_el0, 1);
|
|
125
|
+
drainFrag(_root, __block.parentNode, __block.endMarker);
|
|
126
|
+
_b = bag5(__s, null, _m0, _m1, null, void 0, _m4);
|
|
127
|
+
}
|
|
128
|
+
{
|
|
129
|
+
const _v = props.children;
|
|
130
|
+
_b.c = textHoleUpdate(__s, 1, _b.a, _v, _b.c, _b.d, _b.b, true);
|
|
131
|
+
_b.d = _v;
|
|
132
|
+
}
|
|
133
|
+
componentSlotVoid(__s, 2, _b.a, Popover, {
|
|
134
|
+
"open": open,
|
|
135
|
+
"anchor": anchor,
|
|
136
|
+
"placement": props.placement ?? "bottom",
|
|
137
|
+
"dismissOnOutsideTap": false,
|
|
138
|
+
"children": markChildrenBlock(__children$4, __childrenBody$)
|
|
139
|
+
}, _b.e, void 0, void 0, void 0, void 0, "c:258d2497");
|
|
140
|
+
}
|
|
141
|
+
componentSlotVoid(__s, 0, __block.parentNode, View, {
|
|
142
|
+
"className": props.className,
|
|
143
|
+
"style": props.style,
|
|
144
|
+
"bind": bindAnchor,
|
|
145
|
+
"web": props.web,
|
|
146
|
+
"children": markChildrenBlock(__children$1, __childrenBody$2)
|
|
147
|
+
}, __block.endMarker, void 0, void 0, true, void 0, "c:df012d7f");
|
|
148
|
+
};
|
|
69
149
|
//#endregion
|
|
70
|
-
export {
|
|
150
|
+
export { Hoverable };
|