@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/native/ui51.js
CHANGED
|
@@ -1,13 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { defineUniversalComponent, hookSlots, registerElement, universalIf, universalPlan, universalValue, useEffect, useRef } from "@nativescript-community/octane";
|
|
3
|
+
import { Application } from "@nativescript/core";
|
|
4
|
+
import { Drawer, install } from "@nativescript-community/ui-drawer";
|
|
5
|
+
//#region src/Drawer.native.tsrx
|
|
6
|
+
var _hs$ = /* @__PURE__ */ hookSlots(2);
|
|
7
|
+
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
8
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
9
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
10
|
+
"kind": "host",
|
|
11
|
+
"type": "gridlayout",
|
|
12
|
+
"props": { "hostSlot": "leftDrawer" },
|
|
13
|
+
"children": [{
|
|
14
|
+
"kind": "slot",
|
|
15
|
+
"slot": 0
|
|
16
|
+
}]
|
|
17
|
+
});
|
|
18
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
19
|
+
"kind": "host",
|
|
20
|
+
"type": "drawer",
|
|
21
|
+
"bindings": [
|
|
22
|
+
["id", 0],
|
|
23
|
+
["ref", 1],
|
|
24
|
+
["className", 2],
|
|
25
|
+
["style", 3]
|
|
26
|
+
],
|
|
27
|
+
"children": [{
|
|
28
|
+
"kind": "host",
|
|
29
|
+
"type": "gridlayout",
|
|
30
|
+
"props": { "hostSlot": "mainContent" },
|
|
31
|
+
"children": [{
|
|
32
|
+
"kind": "slot",
|
|
33
|
+
"slot": 4
|
|
34
|
+
}]
|
|
35
|
+
}, {
|
|
36
|
+
"kind": "slot",
|
|
37
|
+
"slot": 5
|
|
38
|
+
}]
|
|
39
|
+
});
|
|
40
|
+
install();
|
|
41
|
+
registerElement("drawer", Drawer);
|
|
42
|
+
var Drawer$1 = defineUniversalComponent("nativescript", function Drawer(props) {
|
|
43
|
+
const host = useRef(null, _h$0);
|
|
44
|
+
const platformProps = Application.ios != null ? props.ios : props.android;
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
const d = host.current;
|
|
47
|
+
if (!d) return;
|
|
48
|
+
if (props.open && !d.isOpened("left")) d.open("left").catch(() => {});
|
|
49
|
+
else if (!props.open && d.isOpened("left")) d.close("left").catch(() => {});
|
|
50
|
+
}, [props.open], _h$1);
|
|
51
|
+
return universalValue(__octaneUniversalPlan1, [
|
|
52
|
+
props.id,
|
|
53
|
+
(d) => {
|
|
54
|
+
host.current = d;
|
|
55
|
+
if (d && platformProps) Object.assign(d, platformProps);
|
|
56
|
+
},
|
|
57
|
+
cx("vx-drawer", props.className),
|
|
58
|
+
props.style,
|
|
59
|
+
props.main,
|
|
60
|
+
universalIf(props.drawer != null, () => {
|
|
61
|
+
return universalValue(__octaneUniversalPlan0, [props.drawer]);
|
|
62
|
+
})
|
|
63
|
+
]);
|
|
64
|
+
}, { "module": "@nativescript-community/octane" });
|
|
12
65
|
//#endregion
|
|
13
|
-
export {
|
|
66
|
+
export { Drawer$1 as Drawer };
|
package/dist/native/ui52.js
CHANGED
|
@@ -1,92 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { AccessibilityRole } from "@nativescript/core";
|
|
5
|
-
import { CanvasView, Cap, Paint, Style } from "@nativescript-community/ui-canvas";
|
|
6
|
-
//#region src/Meter.native.tsrx
|
|
7
|
-
var _hs$ = /* @__PURE__ */ hookSlots(2);
|
|
1
|
+
import { hookSlots, useCallback, useEffect, useState } from "@nativescript-community/octane";
|
|
2
|
+
//#region src/useMeasure.native.tsrx
|
|
3
|
+
var _hs$ = /* @__PURE__ */ hookSlots(4);
|
|
8
4
|
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
9
5
|
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
"children": [{
|
|
32
|
-
"kind": "slot",
|
|
33
|
-
"slot": 8
|
|
34
|
-
}]
|
|
35
|
-
}]
|
|
36
|
-
});
|
|
37
|
-
registerElement("canvasview", CanvasView);
|
|
38
|
-
var Meter = defineUniversalComponent("nativescript", function Meter(props) {
|
|
39
|
-
const max = props.max ?? 100;
|
|
40
|
-
const { max: rangeMax, value, ratio } = meterRange(props.value, max);
|
|
41
|
-
const size = props.size ?? 24;
|
|
42
|
-
const strokeWidth = Math.max(0, Math.min(props.strokeWidth ?? 3, size));
|
|
43
|
-
const color = props.color ?? "#3376cc";
|
|
44
|
-
const trackColor = props.trackColor ?? "#e1ecf7";
|
|
45
|
-
const canvasRef = useRef(null, _h$0);
|
|
6
|
+
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
7
|
+
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
8
|
+
function readBounds(view) {
|
|
9
|
+
const point = view?.getLocationOnScreen?.();
|
|
10
|
+
const size = view?.getActualSize?.();
|
|
11
|
+
if (!point || !size) return null;
|
|
12
|
+
return {
|
|
13
|
+
x: point.x,
|
|
14
|
+
y: point.y,
|
|
15
|
+
width: size.width,
|
|
16
|
+
height: size.height
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function useMeasure(options = {}) {
|
|
20
|
+
const [view, setView] = useState(null, _h$0);
|
|
21
|
+
const [bounds, setBounds] = useState(null, _h$1);
|
|
22
|
+
const observe = options.observe ?? true;
|
|
23
|
+
const bind = useCallback((next) => {
|
|
24
|
+
setView((current) => current === next ? current : next);
|
|
25
|
+
}, [], _h$2);
|
|
46
26
|
useEffect(() => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
paint.style = Style.STROKE;
|
|
66
|
-
paint.strokeCap = Cap.ROUND;
|
|
67
|
-
paint.strokeWidth = strokeWidth;
|
|
68
|
-
paint.setColor(trackColor);
|
|
69
|
-
canvas.drawArc(left, top, right, bottom, -90, 360, false, paint);
|
|
70
|
-
if (ratio > 0) {
|
|
71
|
-
paint.setColor(color);
|
|
72
|
-
canvas.drawArc(left, top, right, bottom, -90, ratio * 360, false, paint);
|
|
27
|
+
if (!view) {
|
|
28
|
+
setBounds(null);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const update = () => {
|
|
32
|
+
const next = readBounds(view);
|
|
33
|
+
if (next) setBounds(next);
|
|
34
|
+
};
|
|
35
|
+
const onLoaded = update;
|
|
36
|
+
view.on?.("loaded", onLoaded);
|
|
37
|
+
update();
|
|
38
|
+
if (observe) {
|
|
39
|
+
view.on?.("layoutChanged", update);
|
|
40
|
+
let parent = view.parent;
|
|
41
|
+
while (parent) {
|
|
42
|
+
parent.on?.("scroll", update);
|
|
43
|
+
parent = parent.parent;
|
|
44
|
+
}
|
|
73
45
|
}
|
|
46
|
+
return () => {
|
|
47
|
+
view.off?.("loaded", onLoaded);
|
|
48
|
+
if (observe) {
|
|
49
|
+
view.off?.("layoutChanged", update);
|
|
50
|
+
let parent = view.parent;
|
|
51
|
+
while (parent) {
|
|
52
|
+
parent.off?.("scroll", update);
|
|
53
|
+
parent = parent.parent;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}, [view, observe], _h$3);
|
|
58
|
+
return {
|
|
59
|
+
bind,
|
|
60
|
+
bounds
|
|
74
61
|
};
|
|
75
|
-
|
|
76
|
-
props.id,
|
|
77
|
-
canvasRef,
|
|
78
|
-
cx("vx-meter", props.className),
|
|
79
|
-
{
|
|
80
|
-
width: size,
|
|
81
|
-
height: size,
|
|
82
|
-
...props.style
|
|
83
|
-
},
|
|
84
|
-
draw,
|
|
85
|
-
AccessibilityRole.ProgressBar,
|
|
86
|
-
props.accessibilityLabel,
|
|
87
|
-
`${value} of ${rangeMax}`,
|
|
88
|
-
props.children
|
|
89
|
-
]);
|
|
90
|
-
}, { "module": "@nativescript-community/octane" });
|
|
62
|
+
}
|
|
91
63
|
//#endregion
|
|
92
|
-
export {
|
|
64
|
+
export { useMeasure };
|
package/dist/native/ui53.js
CHANGED
|
@@ -1,34 +1,27 @@
|
|
|
1
1
|
import { cx } from "./ui2.js";
|
|
2
2
|
import { applyNativeProps } from "./ui36.js";
|
|
3
3
|
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
|
-
//#region src/
|
|
4
|
+
//#region src/ActivityIndicator.native.tsrx
|
|
5
5
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
6
|
"kind": "host",
|
|
7
|
-
"type": "
|
|
7
|
+
"type": "activityindicator",
|
|
8
8
|
"bindings": [
|
|
9
9
|
["id", 0],
|
|
10
10
|
["className", 1],
|
|
11
11
|
["style", 2],
|
|
12
|
-
["
|
|
13
|
-
["
|
|
14
|
-
["maxValue", 5],
|
|
15
|
-
["isEnabled", 6],
|
|
16
|
-
["onValueChange", 7],
|
|
17
|
-
["ref", 8]
|
|
12
|
+
["busy", 3],
|
|
13
|
+
["ref", 4]
|
|
18
14
|
]
|
|
19
15
|
});
|
|
20
|
-
var
|
|
16
|
+
var ActivityIndicator = defineUniversalComponent("nativescript", function ActivityIndicator(props) {
|
|
17
|
+
if (props.busy === false) return null;
|
|
21
18
|
return universalValue(__octaneUniversalPlan0, [
|
|
22
19
|
props.id,
|
|
23
20
|
cx(props.className),
|
|
24
21
|
props.style,
|
|
25
|
-
props.
|
|
26
|
-
props.minValue ?? 0,
|
|
27
|
-
props.maxValue ?? 100,
|
|
28
|
-
props.disabled ? false : true,
|
|
29
|
-
(e) => props.onValueChange?.(e.value),
|
|
22
|
+
props.busy ?? true,
|
|
30
23
|
(el) => applyNativeProps(el, props)
|
|
31
24
|
]);
|
|
32
25
|
}, { "module": "@nativescript-community/octane" });
|
|
33
26
|
//#endregion
|
|
34
|
-
export {
|
|
27
|
+
export { ActivityIndicator };
|
package/dist/native/ui54.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
//#region src/
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
for (const [name, glyph] of Object.entries(record)) icons.set(name, glyph);
|
|
12
|
-
}
|
|
13
|
-
function getIcon(name) {
|
|
14
|
-
return icons.get(name);
|
|
1
|
+
//#region src/meter-math.ts
|
|
2
|
+
/** Clamp a progress value to its declared range for drawing and accessibility. */
|
|
3
|
+
function meterRange(value, max) {
|
|
4
|
+
const safeMax = Number.isFinite(max) && max > 0 ? max : 100;
|
|
5
|
+
const safeValue = Number.isFinite(value) ? Math.min(safeMax, Math.max(0, value)) : 0;
|
|
6
|
+
return {
|
|
7
|
+
max: safeMax,
|
|
8
|
+
value: safeValue,
|
|
9
|
+
ratio: safeValue / safeMax
|
|
10
|
+
};
|
|
15
11
|
}
|
|
16
12
|
//#endregion
|
|
17
|
-
export {
|
|
13
|
+
export { meterRange };
|
package/dist/native/ui55.js
CHANGED
|
@@ -1,156 +1,92 @@
|
|
|
1
1
|
import { cx } from "./ui2.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
//#region src/
|
|
2
|
+
import { meterRange } from "./ui54.js";
|
|
3
|
+
import { defineUniversalComponent, hookSlots, registerElement, universalPlan, universalValue, useEffect, useRef } from "@nativescript-community/octane";
|
|
4
|
+
import { AccessibilityRole } from "@nativescript/core";
|
|
5
|
+
import { CanvasView, Cap, Paint, Style } from "@nativescript-community/ui-canvas";
|
|
6
|
+
//#region src/Meter.native.tsrx
|
|
7
|
+
var _hs$ = /* @__PURE__ */ hookSlots(2);
|
|
8
|
+
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
9
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
7
10
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
8
11
|
"kind": "host",
|
|
9
|
-
"type": "
|
|
10
|
-
"props": { "
|
|
12
|
+
"type": "canvasview",
|
|
13
|
+
"props": { "accessible": true },
|
|
11
14
|
"bindings": [
|
|
12
15
|
["id", 0],
|
|
13
|
-
["
|
|
14
|
-
["
|
|
16
|
+
["ref", 1],
|
|
17
|
+
["className", 2],
|
|
15
18
|
["style", 3],
|
|
16
|
-
["
|
|
17
|
-
|
|
19
|
+
["onDraw", 4],
|
|
20
|
+
["accessibilityRole", 5],
|
|
21
|
+
["accessibilityLabel", 6],
|
|
22
|
+
["accessibilityValue", 7]
|
|
23
|
+
],
|
|
24
|
+
"children": [{
|
|
25
|
+
"kind": "host",
|
|
26
|
+
"type": "gridlayout",
|
|
27
|
+
"props": {
|
|
28
|
+
"horizontalAlignment": "center",
|
|
29
|
+
"verticalAlignment": "middle"
|
|
30
|
+
},
|
|
31
|
+
"children": [{
|
|
32
|
+
"kind": "slot",
|
|
33
|
+
"slot": 8
|
|
34
|
+
}]
|
|
35
|
+
}]
|
|
18
36
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
["id", 0],
|
|
24
|
-
["className", 1],
|
|
25
|
-
["text", 2],
|
|
26
|
-
["style", 3],
|
|
27
|
-
["ref", 4]
|
|
28
|
-
]
|
|
29
|
-
});
|
|
30
|
-
var __octaneUniversalPlan2 = universalPlan("nativescript", {
|
|
31
|
-
"kind": "host",
|
|
32
|
-
"type": "svgview",
|
|
33
|
-
"props": { "stretch": "aspectFit" },
|
|
34
|
-
"bindings": [
|
|
35
|
-
["id", 0],
|
|
36
|
-
["className", 1],
|
|
37
|
-
["src", 2],
|
|
38
|
-
["style", 3],
|
|
39
|
-
["ref", 4]
|
|
40
|
-
]
|
|
41
|
-
});
|
|
42
|
-
var __octaneUniversalPlan3 = universalPlan("nativescript", {
|
|
43
|
-
"kind": "host",
|
|
44
|
-
"type": "image",
|
|
45
|
-
"bindings": [
|
|
46
|
-
["id", 0],
|
|
47
|
-
["className", 1],
|
|
48
|
-
["src", 2],
|
|
49
|
-
["style", 3],
|
|
50
|
-
["ref", 4]
|
|
51
|
-
]
|
|
52
|
-
});
|
|
53
|
-
var __octaneUniversalPlan4 = universalPlan("nativescript", {
|
|
54
|
-
"kind": "slot",
|
|
55
|
-
"slot": 0
|
|
56
|
-
});
|
|
57
|
-
var __octaneUniversalPlan5 = universalPlan("nativescript", {
|
|
58
|
-
"kind": "host",
|
|
59
|
-
"type": "label",
|
|
60
|
-
"bindings": [
|
|
61
|
-
["id", 0],
|
|
62
|
-
["className", 1],
|
|
63
|
-
["text", 2],
|
|
64
|
-
["style", 3],
|
|
65
|
-
["ref", 4]
|
|
66
|
-
]
|
|
67
|
-
});
|
|
68
|
-
var __octaneUniversalPlan6 = universalPlan("nativescript", {
|
|
69
|
-
"kind": "slot",
|
|
70
|
-
"slot": 0
|
|
71
|
-
});
|
|
72
|
-
var __octaneUniversalPlan7 = universalPlan("nativescript", {
|
|
73
|
-
"kind": "slot",
|
|
74
|
-
"slot": 0
|
|
75
|
-
});
|
|
76
|
-
var __octaneUniversalPlan8 = universalPlan("nativescript", {
|
|
77
|
-
"kind": "slot",
|
|
78
|
-
"slot": 0
|
|
79
|
-
});
|
|
80
|
-
var __octaneUniversalPlan9 = universalPlan("nativescript", {
|
|
81
|
-
"kind": "slot",
|
|
82
|
-
"slot": 0
|
|
83
|
-
});
|
|
84
|
-
var Icon = defineUniversalComponent("nativescript", function Icon(props) {
|
|
85
|
-
const glyph = getIcon(props.name);
|
|
86
|
-
if (!glyph) return null;
|
|
37
|
+
registerElement("canvasview", CanvasView);
|
|
38
|
+
var Meter = defineUniversalComponent("nativescript", function Meter(props) {
|
|
39
|
+
const max = props.max ?? 100;
|
|
40
|
+
const { max: rangeMax, value, ratio } = meterRange(props.value, max);
|
|
87
41
|
const size = props.size ?? 24;
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
]);
|
|
137
|
-
})]);
|
|
138
|
-
}, () => {
|
|
139
|
-
return universalValue(__octaneUniversalPlan6, [universalIf(glyph.text, () => {
|
|
140
|
-
return universalValue(__octaneUniversalPlan5, [
|
|
141
|
-
props.id,
|
|
142
|
-
cx(props.className),
|
|
143
|
-
glyph.text,
|
|
144
|
-
{
|
|
145
|
-
fontSize: size,
|
|
146
|
-
color: props.color
|
|
147
|
-
},
|
|
148
|
-
(el) => applyNativeProps(el, props)
|
|
149
|
-
]);
|
|
150
|
-
})]);
|
|
151
|
-
})]);
|
|
152
|
-
})]);
|
|
153
|
-
})]);
|
|
42
|
+
const strokeWidth = Math.max(0, Math.min(props.strokeWidth ?? 3, size));
|
|
43
|
+
const color = props.color ?? "#3376cc";
|
|
44
|
+
const trackColor = props.trackColor ?? "#e1ecf7";
|
|
45
|
+
const canvasRef = useRef(null, _h$0);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
canvasRef.current?.invalidate();
|
|
48
|
+
}, [
|
|
49
|
+
value,
|
|
50
|
+
rangeMax,
|
|
51
|
+
strokeWidth,
|
|
52
|
+
color,
|
|
53
|
+
trackColor
|
|
54
|
+
], _h$1);
|
|
55
|
+
const draw = (event) => {
|
|
56
|
+
const canvas = event.canvas;
|
|
57
|
+
const width = canvas.getWidth();
|
|
58
|
+
const height = canvas.getHeight();
|
|
59
|
+
const diameter = Math.max(0, Math.min(width, height) - strokeWidth);
|
|
60
|
+
const left = (width - diameter) / 2;
|
|
61
|
+
const top = (height - diameter) / 2;
|
|
62
|
+
const right = left + diameter;
|
|
63
|
+
const bottom = top + diameter;
|
|
64
|
+
const paint = new Paint();
|
|
65
|
+
paint.style = Style.STROKE;
|
|
66
|
+
paint.strokeCap = Cap.ROUND;
|
|
67
|
+
paint.strokeWidth = strokeWidth;
|
|
68
|
+
paint.setColor(trackColor);
|
|
69
|
+
canvas.drawArc(left, top, right, bottom, -90, 360, false, paint);
|
|
70
|
+
if (ratio > 0) {
|
|
71
|
+
paint.setColor(color);
|
|
72
|
+
canvas.drawArc(left, top, right, bottom, -90, ratio * 360, false, paint);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return universalValue(__octaneUniversalPlan0, [
|
|
76
|
+
props.id,
|
|
77
|
+
canvasRef,
|
|
78
|
+
cx("vx-meter", props.className),
|
|
79
|
+
{
|
|
80
|
+
width: size,
|
|
81
|
+
height: size,
|
|
82
|
+
...props.style
|
|
83
|
+
},
|
|
84
|
+
draw,
|
|
85
|
+
AccessibilityRole.ProgressBar,
|
|
86
|
+
props.accessibilityLabel,
|
|
87
|
+
`${value} of ${rangeMax}`,
|
|
88
|
+
props.children
|
|
89
|
+
]);
|
|
154
90
|
}, { "module": "@nativescript-community/octane" });
|
|
155
91
|
//#endregion
|
|
156
|
-
export {
|
|
92
|
+
export { Meter };
|
package/dist/native/ui56.js
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { cx } from "./ui2.js";
|
|
2
2
|
import { applyNativeProps } from "./ui36.js";
|
|
3
3
|
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
|
-
|
|
5
|
-
//#region src/Heading.native.tsrx
|
|
4
|
+
//#region src/Slider.native.tsrx
|
|
6
5
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
7
6
|
"kind": "host",
|
|
8
|
-
"type": "
|
|
7
|
+
"type": "slider",
|
|
9
8
|
"bindings": [
|
|
10
9
|
["id", 0],
|
|
11
10
|
["className", 1],
|
|
12
11
|
["style", 2],
|
|
13
|
-
["
|
|
14
|
-
["
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
12
|
+
["value", 3],
|
|
13
|
+
["minValue", 4],
|
|
14
|
+
["maxValue", 5],
|
|
15
|
+
["isEnabled", 6],
|
|
16
|
+
["onValueChange", 7],
|
|
17
|
+
["ref", 8]
|
|
18
|
+
]
|
|
20
19
|
});
|
|
21
|
-
var
|
|
22
|
-
const level = props.level ?? 2;
|
|
20
|
+
var Slider = defineUniversalComponent("nativescript", function Slider(props) {
|
|
23
21
|
return universalValue(__octaneUniversalPlan0, [
|
|
24
22
|
props.id,
|
|
25
|
-
cx(
|
|
23
|
+
cx(props.className),
|
|
26
24
|
props.style,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
props.
|
|
25
|
+
props.value,
|
|
26
|
+
props.minValue ?? 0,
|
|
27
|
+
props.maxValue ?? 100,
|
|
28
|
+
props.disabled ? false : true,
|
|
29
|
+
(e) => props.onValueChange?.(e.value),
|
|
30
|
+
(el) => applyNativeProps(el, props)
|
|
30
31
|
]);
|
|
31
32
|
}, { "module": "@nativescript-community/octane" });
|
|
32
33
|
//#endregion
|
|
33
|
-
export {
|
|
34
|
+
export { Slider };
|
package/dist/native/ui57.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
//#region src/icons.ts
|
|
2
|
+
/**
|
|
3
|
+
* App-owned icon registry. `svg` is SVG path `d` data (not a full SVG
|
|
4
|
+
* markup string). `src` can carry an image or an SVG source; the leaves only
|
|
5
|
+
* infer SVG from inline markup, SVG data URIs, and `.svg` paths/URLs. Native
|
|
6
|
+
* `font` glyphs render only when the app ships and registers that font.
|
|
7
|
+
*/
|
|
8
|
+
var icons = /* @__PURE__ */ new Map();
|
|
9
|
+
function registerIcon(name, glyph) {
|
|
10
|
+
icons.set(name, glyph);
|
|
11
|
+
}
|
|
12
|
+
function registerIcons(record) {
|
|
13
|
+
for (const [name, glyph] of Object.entries(record)) icons.set(name, glyph);
|
|
14
|
+
}
|
|
15
|
+
function getIcon(name) {
|
|
16
|
+
return icons.get(name);
|
|
17
|
+
}
|
|
13
18
|
//#endregion
|
|
14
|
-
export {
|
|
19
|
+
export { getIcon, registerIcon, registerIcons };
|