@octane-xplat/ui 0.2.0 → 0.3.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 +40 -19
- package/dist/native/ui10.js +19 -48
- package/dist/native/ui11.js +118 -56
- package/dist/native/ui12.js +114 -16
- package/dist/native/ui13.js +54 -18
- package/dist/native/ui14.js +76 -13
- package/dist/native/ui15.js +128 -18
- package/dist/native/ui16.js +48 -136
- package/dist/native/ui17.js +42 -19
- package/dist/native/ui18.js +50 -9
- package/dist/native/ui19.js +34 -12
- package/dist/native/ui2.js +10 -48
- package/dist/native/ui20.js +17 -0
- package/dist/native/ui21.js +93 -0
- package/dist/native/ui22.js +124 -0
- package/dist/native/ui23.js +103 -0
- package/dist/native/ui24.js +58 -0
- package/dist/native/ui25.js +19 -0
- package/dist/native/ui26.js +27 -0
- package/dist/native/ui27.js +35 -0
- package/dist/native/ui28.js +146 -0
- package/dist/native/ui29.js +28 -0
- package/dist/native/ui3.js +17 -20
- package/dist/native/ui30.js +35 -0
- package/dist/native/ui31.js +39 -0
- package/dist/native/ui32.js +70 -0
- package/dist/native/ui33.js +30 -0
- package/dist/native/ui34.js +10 -0
- package/dist/native/ui35.js +27 -0
- package/dist/native/ui36.js +34 -0
- package/dist/native/ui37.js +17 -0
- package/dist/native/ui38.js +68 -0
- package/dist/native/ui39.js +33 -0
- package/dist/native/ui4.js +21 -48
- package/dist/native/ui40.js +14 -0
- package/dist/native/ui41.js +104 -0
- package/dist/native/ui42.js +148 -0
- package/dist/native/ui43.js +22 -0
- package/dist/native/ui44.js +8 -0
- package/dist/native/ui5.js +70 -27
- package/dist/native/ui6.js +36 -20
- package/dist/native/ui7.js +24 -61
- package/dist/native/ui8.js +16 -18
- package/dist/native/ui9.js +16 -13
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/ui.js +40 -19
- package/dist/web/ui10.js +187 -31
- package/dist/web/ui11.js +419 -53
- package/dist/web/ui12.js +83 -15
- package/dist/web/ui13.js +107 -19
- package/dist/web/ui14.js +98 -18
- package/dist/web/ui15.js +83 -47
- package/dist/web/ui16.js +100 -93
- package/dist/web/ui17.js +36 -22
- package/dist/web/ui18.js +29 -15
- package/dist/web/ui19.js +9 -7
- package/dist/web/ui2.js +15 -103
- package/dist/web/ui20.js +114 -0
- package/dist/web/ui21.js +82 -0
- package/dist/web/ui22.js +68 -0
- package/dist/web/ui23.js +57 -0
- package/dist/web/ui24.js +16 -0
- package/dist/web/ui25.js +22 -0
- package/dist/web/ui26.js +39 -0
- package/dist/web/ui27.js +127 -0
- package/dist/web/ui28.js +112 -0
- package/dist/web/ui29.js +108 -0
- package/dist/web/ui3.js +19 -27
- package/dist/web/ui30.js +43 -0
- package/dist/web/ui31.js +42 -0
- package/dist/web/ui32.js +77 -0
- package/dist/web/ui33.js +43 -0
- package/dist/web/ui34.js +67 -0
- package/dist/web/ui35.js +9 -0
- package/dist/web/ui36.js +45 -0
- package/dist/web/ui37.js +47 -0
- package/dist/web/ui38.js +17 -0
- package/dist/web/ui39.js +100 -0
- package/dist/web/ui4.js +145 -17
- package/dist/web/ui40.js +41 -0
- package/dist/web/ui41.js +17 -0
- package/dist/web/ui42.js +9 -0
- package/dist/web/ui43.js +22 -0
- package/dist/web/ui44.js +8 -0
- package/dist/web/ui5.js +54 -52
- package/dist/web/ui6.js +43 -16
- package/dist/web/ui7.js +29 -36
- package/dist/web/ui8.js +29 -18
- package/dist/web/ui9.js +24 -16
- package/package.json +14 -3
- package/src/theme/tokens.css +166 -0
- package/types/index.d.ts +108 -1
- package/types/props.d.ts +333 -8
package/dist/native/ui.js
CHANGED
|
@@ -1,19 +1,40 @@
|
|
|
1
|
-
import { View } from "./
|
|
2
|
-
import { Row } from "./
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
1
|
+
import { View } from "./ui5.js";
|
|
2
|
+
import { Row } from "./ui6.js";
|
|
3
|
+
import { Grid } from "./ui7.js";
|
|
4
|
+
import { Stack } from "./ui8.js";
|
|
5
|
+
import { Absolute } from "./ui9.js";
|
|
6
|
+
import { Spacer } from "./ui10.js";
|
|
7
|
+
import { Text } from "./ui11.js";
|
|
8
|
+
import { Pressable } from "./ui12.js";
|
|
9
|
+
import { TextInput } from "./ui13.js";
|
|
10
|
+
import { TextArea } from "./ui14.js";
|
|
11
|
+
import { List } from "./ui15.js";
|
|
12
|
+
import { ScrollView } from "./ui16.js";
|
|
13
|
+
import { Image } from "./ui17.js";
|
|
14
|
+
import { Modal } from "./ui18.js";
|
|
15
|
+
import { openModal } from "./ui19.js";
|
|
16
|
+
import { getColorScheme, useColorScheme } from "./ui20.js";
|
|
17
|
+
import { Overlay } from "./ui21.js";
|
|
18
|
+
import { Popover } from "./ui22.js";
|
|
19
|
+
import { showToast } from "./ui23.js";
|
|
20
|
+
import { useAnimation } from "./ui24.js";
|
|
21
|
+
import { styled } from "./ui25.js";
|
|
22
|
+
import { Screen } from "./ui26.js";
|
|
23
|
+
import { getStack, registerStack, stackEntries } from "./ui27.js";
|
|
24
|
+
import { Tabs } from "./ui28.js";
|
|
25
|
+
import { Switch } from "./ui29.js";
|
|
26
|
+
import { useSafeAreaInsets } from "./ui30.js";
|
|
27
|
+
import { SafeArea } from "./ui31.js";
|
|
28
|
+
import { KeyboardAvoiding } from "./ui32.js";
|
|
29
|
+
import { Drawer } from "./ui33.js";
|
|
30
|
+
import { ActivityIndicator } from "./ui35.js";
|
|
31
|
+
import { Slider } from "./ui36.js";
|
|
32
|
+
import { registerIcon, registerIcons } from "./ui37.js";
|
|
33
|
+
import { Icon } from "./ui38.js";
|
|
34
|
+
import { Heading } from "./ui39.js";
|
|
35
|
+
import { PlatformBadge } from "./ui40.js";
|
|
36
|
+
import { deriveRouteManifest } from "./ui41.js";
|
|
37
|
+
import { currentRoute, hrefFor, popRoute, pushRoute, registerRoutes, registerScreens, routeFor, screenFor, useRoute } from "./ui42.js";
|
|
38
|
+
import { createStore } from "./ui43.js";
|
|
39
|
+
import { useStore } from "./ui44.js";
|
|
40
|
+
export { Absolute, ActivityIndicator, View as Column, Drawer, Grid, Heading, Icon, Image, KeyboardAvoiding, List, Modal, Overlay, PlatformBadge, Popover, Pressable, Row, SafeArea, Screen, ScrollView, Slider, Spacer, Stack, Switch, Tabs, Text, TextArea, TextInput, View, createStore, currentRoute, deriveRouteManifest, getColorScheme, getStack, hrefFor, openModal, popRoute, pushRoute, registerIcon, registerIcons, registerRoutes, registerScreens, registerStack, routeFor, screenFor, showToast, stackEntries, styled, useAnimation, useColorScheme, useRoute, useSafeAreaInsets, useStore };
|
package/dist/native/ui10.js
CHANGED
|
@@ -1,52 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
6
|
-
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { applyEscapeProps } from "./ui3.js";
|
|
3
|
+
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
|
+
//#region src/Spacer.native.tsrx
|
|
7
5
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
8
|
-
"kind": "
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
"kind": "host",
|
|
7
|
+
"type": "stacklayout",
|
|
8
|
+
"props": { "flexGrow": 1 },
|
|
9
|
+
"bindings": [
|
|
10
|
+
["ref", 0],
|
|
11
|
+
["className", 1],
|
|
12
|
+
["style", 2]
|
|
13
|
+
]
|
|
13
14
|
});
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, { "module": "@nativescript-community/octane" });
|
|
21
|
-
var Modal = defineUniversalComponent("nativescript", function Modal(props) {
|
|
22
|
-
const shown = useRef(null, _h$0);
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (props.open && !shown.current) {
|
|
25
|
-
const presenter = Frame.topmost()?.currentPage ?? Frame.topmost();
|
|
26
|
-
if (!presenter) return;
|
|
27
|
-
const host = new ContentView();
|
|
28
|
-
const root = createNativeScriptRoot(host);
|
|
29
|
-
shown.current = {
|
|
30
|
-
host,
|
|
31
|
-
root
|
|
32
|
-
};
|
|
33
|
-
root.render(Panel, { children: props.children });
|
|
34
|
-
presenter.showModal(host, {
|
|
35
|
-
context: {},
|
|
36
|
-
closeCallback: () => {
|
|
37
|
-
shown.current = null;
|
|
38
|
-
props.onClose?.();
|
|
39
|
-
},
|
|
40
|
-
fullscreen: props.fullscreen ?? true,
|
|
41
|
-
animated: true
|
|
42
|
-
});
|
|
43
|
-
} else if (!props.open && shown.current) {
|
|
44
|
-
const { host } = shown.current;
|
|
45
|
-
shown.current = null;
|
|
46
|
-
host.closeModal();
|
|
47
|
-
}
|
|
48
|
-
}, [props.open], _h$1);
|
|
49
|
-
return universalValue(__octaneUniversalPlan1, []);
|
|
15
|
+
var Spacer = defineUniversalComponent("nativescript", function Spacer(props) {
|
|
16
|
+
return universalValue(__octaneUniversalPlan0, [
|
|
17
|
+
(view) => applyEscapeProps(view, props),
|
|
18
|
+
cx("vx-spacer", props.className),
|
|
19
|
+
props.style
|
|
20
|
+
]);
|
|
50
21
|
}, { "module": "@nativescript-community/octane" });
|
|
51
22
|
//#endregion
|
|
52
|
-
export {
|
|
23
|
+
export { Spacer };
|
package/dist/native/ui11.js
CHANGED
|
@@ -1,58 +1,120 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { applyEscapeProps, nativeAccessibilityState } from "./ui3.js";
|
|
3
|
+
import { layoutChildProps } from "./ui4.js";
|
|
4
|
+
import { createContext, defineUniversalComponent, universalComponent, universalIf, universalPlan, universalProps, universalValue, useContext } from "@nativescript-community/octane";
|
|
5
|
+
//#region src/Text.native.tsrx
|
|
6
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
7
|
+
"kind": "host",
|
|
8
|
+
"type": "span",
|
|
9
|
+
"propsSlot": 0,
|
|
10
|
+
"children": [{
|
|
11
|
+
"kind": "slot",
|
|
12
|
+
"slot": 1
|
|
13
|
+
}]
|
|
14
|
+
});
|
|
15
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
16
|
+
"kind": "host",
|
|
17
|
+
"type": "label",
|
|
18
|
+
"propsSlot": 0,
|
|
19
|
+
"children": [{
|
|
20
|
+
"kind": "slot",
|
|
21
|
+
"slot": 1
|
|
22
|
+
}]
|
|
23
|
+
});
|
|
24
|
+
var __octaneUniversalPlan2 = universalPlan("nativescript", {
|
|
25
|
+
"kind": "slot",
|
|
26
|
+
"slot": 0
|
|
27
|
+
});
|
|
28
|
+
var InText = createContext(false);
|
|
29
|
+
var TextScope = defineUniversalComponent("nativescript", function TextScope(props) {
|
|
30
|
+
return InText({
|
|
31
|
+
value: true,
|
|
32
|
+
children: props.children
|
|
33
|
+
});
|
|
34
|
+
}, { "module": "@nativescript-community/octane" });
|
|
35
|
+
var Text = defineUniversalComponent("nativescript", function Text(props) {
|
|
36
|
+
const inText = useContext(InText);
|
|
37
|
+
const textStyle = {
|
|
38
|
+
...props.style,
|
|
39
|
+
...props.ellipsize ? {
|
|
40
|
+
whiteSpace: "nowrap",
|
|
41
|
+
textOverflow: "ellipsis"
|
|
42
|
+
} : {}
|
|
12
43
|
};
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
return universalValue(__octaneUniversalPlan2, [universalIf(inText, () => {
|
|
45
|
+
return universalValue(__octaneUniversalPlan0, [universalProps([
|
|
46
|
+
[
|
|
47
|
+
"set",
|
|
48
|
+
"ref",
|
|
49
|
+
(v) => applyEscapeProps(v, props)
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"set",
|
|
53
|
+
"className",
|
|
54
|
+
cx(props.className)
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
"set",
|
|
58
|
+
"style",
|
|
59
|
+
textStyle
|
|
60
|
+
],
|
|
61
|
+
["spread", layoutChildProps(props)]
|
|
62
|
+
]), props.children]);
|
|
63
|
+
}, () => {
|
|
64
|
+
return universalValue(__octaneUniversalPlan1, [universalProps([
|
|
65
|
+
[
|
|
66
|
+
"set",
|
|
67
|
+
"ref",
|
|
68
|
+
(v) => applyEscapeProps(v, props)
|
|
69
|
+
],
|
|
70
|
+
["spread", layoutChildProps(props)],
|
|
71
|
+
[
|
|
72
|
+
"set",
|
|
73
|
+
"className",
|
|
74
|
+
cx(props.className)
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"set",
|
|
78
|
+
"style",
|
|
79
|
+
textStyle
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
"set",
|
|
83
|
+
"maxLines",
|
|
84
|
+
props.numberOfLines
|
|
85
|
+
],
|
|
86
|
+
[
|
|
87
|
+
"set",
|
|
88
|
+
"textOverflow",
|
|
89
|
+
props.ellipsize ? "ellipsis" : void 0
|
|
90
|
+
],
|
|
91
|
+
[
|
|
92
|
+
"set",
|
|
93
|
+
"whiteSpace",
|
|
94
|
+
props.ellipsize ? "nowrap" : void 0
|
|
95
|
+
],
|
|
96
|
+
[
|
|
97
|
+
"set",
|
|
98
|
+
"accessibilityHint",
|
|
99
|
+
props.accessibilityHint
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
"set",
|
|
103
|
+
"accessibilityValue",
|
|
104
|
+
props.accessibilityValue
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
"set",
|
|
108
|
+
"accessibilityState",
|
|
109
|
+
nativeAccessibilityState(props.accessibilityState)
|
|
110
|
+
],
|
|
111
|
+
[
|
|
112
|
+
"set",
|
|
113
|
+
"accessibilityLiveRegion",
|
|
114
|
+
props.accessibilityLiveRegion
|
|
115
|
+
]
|
|
116
|
+
]), universalComponent("nativescript", TextScope, universalProps([], props.children))]);
|
|
117
|
+
})]);
|
|
118
|
+
}, { "module": "@nativescript-community/octane" });
|
|
57
119
|
//#endregion
|
|
58
|
-
export {
|
|
120
|
+
export { Text };
|
package/dist/native/ui12.js
CHANGED
|
@@ -1,17 +1,115 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { applyEscapeProps, nativeAccessibilityState } from "./ui3.js";
|
|
3
|
+
import { layoutChildProps } from "./ui4.js";
|
|
4
|
+
import { defineUniversalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
|
|
5
|
+
//#region src/Pressable.native.tsrx
|
|
6
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
7
|
+
"kind": "host",
|
|
8
|
+
"type": "flexboxlayout",
|
|
9
|
+
"propsSlot": 0,
|
|
10
|
+
"children": [{
|
|
11
|
+
"kind": "slot",
|
|
12
|
+
"slot": 1
|
|
13
|
+
}]
|
|
14
|
+
});
|
|
15
|
+
var Pressable = defineUniversalComponent("nativescript", function Pressable(props) {
|
|
16
|
+
return universalValue(__octaneUniversalPlan0, [universalProps([
|
|
17
|
+
[
|
|
18
|
+
"set",
|
|
19
|
+
"ref",
|
|
20
|
+
(v) => applyEscapeProps(v, props)
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"set",
|
|
24
|
+
"id",
|
|
25
|
+
props.id
|
|
26
|
+
],
|
|
27
|
+
["spread", layoutChildProps(props)],
|
|
28
|
+
[
|
|
29
|
+
"set",
|
|
30
|
+
"flexDirection",
|
|
31
|
+
"column"
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"set",
|
|
35
|
+
"className",
|
|
36
|
+
cx("vx-pressable", props.className)
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"set",
|
|
40
|
+
"style",
|
|
41
|
+
{
|
|
42
|
+
...props.style,
|
|
43
|
+
...props.hitSlop ? {
|
|
44
|
+
margin: -props.hitSlop,
|
|
45
|
+
padding: props.hitSlop
|
|
46
|
+
} : {}
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
"set",
|
|
51
|
+
"accessible",
|
|
52
|
+
props.accessible
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
"set",
|
|
56
|
+
"accessibilityLabel",
|
|
57
|
+
props.accessibilityLabel
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"set",
|
|
61
|
+
"accessibilityRole",
|
|
62
|
+
props.accessibilityRole
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"set",
|
|
66
|
+
"accessibilityHint",
|
|
67
|
+
props.accessibilityHint
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
"set",
|
|
71
|
+
"accessibilityValue",
|
|
72
|
+
props.accessibilityValue
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
"set",
|
|
76
|
+
"accessibilityState",
|
|
77
|
+
nativeAccessibilityState(props.accessibilityState)
|
|
78
|
+
],
|
|
79
|
+
[
|
|
80
|
+
"set",
|
|
81
|
+
"accessibilityLiveRegion",
|
|
82
|
+
props.accessibilityLiveRegion
|
|
83
|
+
],
|
|
84
|
+
[
|
|
85
|
+
"set",
|
|
86
|
+
"ignoreTouchAnimation",
|
|
87
|
+
props.ignoreTouchAnimation
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"set",
|
|
91
|
+
"onTap",
|
|
92
|
+
props.disabled ? void 0 : props.onPress
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
"set",
|
|
96
|
+
"onLongPress",
|
|
97
|
+
props.disabled ? void 0 : props.onLongPress
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
"set",
|
|
101
|
+
"onDoubleTap",
|
|
102
|
+
props.disabled ? void 0 : props.onDoublePress
|
|
103
|
+
],
|
|
104
|
+
[
|
|
105
|
+
"set",
|
|
106
|
+
"onTouch",
|
|
107
|
+
props.disabled ? void 0 : (e) => {
|
|
108
|
+
if (e.action === "down") props.onPressIn?.();
|
|
109
|
+
else if (e.action === "up" || e.action === "cancel") props.onPressOut?.();
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
]), props.children]);
|
|
113
|
+
}, { "module": "@nativescript-community/octane" });
|
|
16
114
|
//#endregion
|
|
17
|
-
export {
|
|
115
|
+
export { Pressable };
|
package/dist/native/ui13.js
CHANGED
|
@@ -1,19 +1,55 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { applyEscapeProps } from "./ui3.js";
|
|
3
|
+
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
|
+
//#region src/TextInput.native.tsrx
|
|
5
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
|
+
"kind": "host",
|
|
7
|
+
"type": "textfield",
|
|
8
|
+
"bindings": [
|
|
9
|
+
["ref", 0],
|
|
10
|
+
["id", 1],
|
|
11
|
+
["className", 2],
|
|
12
|
+
["style", 3],
|
|
13
|
+
["text", 4],
|
|
14
|
+
["hint", 5],
|
|
15
|
+
["secure", 6],
|
|
16
|
+
["keyboardType", 7],
|
|
17
|
+
["returnKeyType", 8],
|
|
18
|
+
["editable", 9],
|
|
19
|
+
["onTextChange", 10],
|
|
20
|
+
["onReturnPress", 11],
|
|
21
|
+
["onFocus", 12],
|
|
22
|
+
["onBlur", 13]
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
var TextInput = defineUniversalComponent("nativescript", function TextInput(props) {
|
|
26
|
+
return universalValue(__octaneUniversalPlan0, [
|
|
27
|
+
(v) => {
|
|
28
|
+
if (!v) return;
|
|
29
|
+
applyEscapeProps(v, props);
|
|
30
|
+
props.bind?.({
|
|
31
|
+
focus: () => v.focus(),
|
|
32
|
+
blur: () => v.dismissSoftInput?.() ?? v.blur(),
|
|
33
|
+
native: v
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
props.id,
|
|
37
|
+
cx(props.className),
|
|
38
|
+
{
|
|
39
|
+
...props.style,
|
|
40
|
+
...props.placeholderTextColor ? { placeholderColor: props.placeholderTextColor } : {}
|
|
41
|
+
},
|
|
42
|
+
props.value,
|
|
43
|
+
props.placeholder ?? props.hint,
|
|
44
|
+
props.secure,
|
|
45
|
+
props.keyboardType === "default" ? void 0 : props.keyboardType,
|
|
46
|
+
props.returnKeyType,
|
|
47
|
+
props.editable,
|
|
48
|
+
(e) => props.onChange?.(e.value),
|
|
49
|
+
props.onSubmit,
|
|
50
|
+
props.onFocus,
|
|
51
|
+
props.onBlur
|
|
52
|
+
]);
|
|
53
|
+
}, { "module": "@nativescript-community/octane" });
|
|
18
54
|
//#endregion
|
|
19
|
-
export {
|
|
55
|
+
export { TextInput };
|
package/dist/native/ui14.js
CHANGED
|
@@ -1,20 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { applyEscapeProps } from "./ui3.js";
|
|
3
|
+
import { defineUniversalComponent, hookSlots, universalPlan, universalValue, useEffect, useRef } from "@nativescript-community/octane";
|
|
4
|
+
import { Utils } from "@nativescript/core";
|
|
5
|
+
//#region src/TextArea.native.tsrx
|
|
6
|
+
var _hs$ = /* @__PURE__ */ hookSlots(2);
|
|
7
|
+
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
8
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
3
9
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
4
10
|
"kind": "host",
|
|
5
|
-
"type": "
|
|
6
|
-
"bindings": [
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
+
"type": "textview",
|
|
12
|
+
"bindings": [
|
|
13
|
+
["id", 0],
|
|
14
|
+
["ref", 1],
|
|
15
|
+
["className", 2],
|
|
16
|
+
["style", 3],
|
|
17
|
+
["text", 4],
|
|
18
|
+
["hint", 5],
|
|
19
|
+
["keyboardType", 6],
|
|
20
|
+
["returnKeyType", 7],
|
|
21
|
+
["editable", 8],
|
|
22
|
+
["onLoaded", 9],
|
|
23
|
+
["onTextChange", 10],
|
|
24
|
+
["onReturnPress", 11],
|
|
25
|
+
["onFocus", 12],
|
|
26
|
+
["onBlur", 13]
|
|
27
|
+
]
|
|
11
28
|
});
|
|
12
|
-
var
|
|
29
|
+
var TextArea = defineUniversalComponent("nativescript", function TextArea(props) {
|
|
30
|
+
const el = useRef(null, _h$0);
|
|
31
|
+
const lineDip = (v) => {
|
|
32
|
+
const ios = v?.ios?.font?.lineHeight;
|
|
33
|
+
if (ios > 0) return ios;
|
|
34
|
+
const px = v?.android?.getLineHeight?.();
|
|
35
|
+
if (px > 0) return Utils.layout.toDeviceIndependentPixels(px);
|
|
36
|
+
return 24;
|
|
37
|
+
};
|
|
38
|
+
const fit = (v) => {
|
|
39
|
+
if (!v) return;
|
|
40
|
+
if (props.style?.height != null) return;
|
|
41
|
+
const line = lineDip(v);
|
|
42
|
+
const rows = props.rows ?? (props.autoGrow ? 1 : 3);
|
|
43
|
+
v.style.minHeight = rows * line;
|
|
44
|
+
if (props.maxRows) v.style.maxHeight = props.maxRows * line;
|
|
45
|
+
else if (!props.autoGrow) v.style.maxHeight = rows * line;
|
|
46
|
+
};
|
|
47
|
+
useEffect(() => fit(el.current), [
|
|
48
|
+
props.rows,
|
|
49
|
+
props.autoGrow,
|
|
50
|
+
props.maxRows,
|
|
51
|
+
props.style
|
|
52
|
+
], _h$1);
|
|
13
53
|
return universalValue(__octaneUniversalPlan0, [
|
|
14
|
-
props.
|
|
15
|
-
|
|
16
|
-
|
|
54
|
+
props.id,
|
|
55
|
+
(v) => {
|
|
56
|
+
el.current = v;
|
|
57
|
+
if (!v) return;
|
|
58
|
+
applyEscapeProps(v, props);
|
|
59
|
+
props.bind?.({
|
|
60
|
+
focus: () => v.focus(),
|
|
61
|
+
blur: () => v.dismissSoftInput?.() ?? v.blur(),
|
|
62
|
+
native: v
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
cx(props.className),
|
|
66
|
+
{
|
|
67
|
+
...props.style,
|
|
68
|
+
...props.placeholderTextColor ? { placeholderColor: props.placeholderTextColor } : {}
|
|
69
|
+
},
|
|
70
|
+
props.value,
|
|
71
|
+
props.placeholder ?? props.hint,
|
|
72
|
+
props.keyboardType === "default" ? void 0 : props.keyboardType,
|
|
73
|
+
props.returnKeyType,
|
|
74
|
+
props.editable,
|
|
75
|
+
(e) => fit(e.object),
|
|
76
|
+
(e) => props.onChange?.(e.value),
|
|
77
|
+
props.onSubmit,
|
|
78
|
+
props.onFocus,
|
|
79
|
+
props.onBlur
|
|
17
80
|
]);
|
|
18
81
|
}, { "module": "@nativescript-community/octane" });
|
|
19
82
|
//#endregion
|
|
20
|
-
export {
|
|
83
|
+
export { TextArea };
|