@octane-xplat/ui 0.5.0 → 0.6.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 +3 -0
- package/dist/native/Absolute.native.tsrx.js +43 -0
- package/dist/native/Accordion.native.tsrx.js +75 -0
- package/dist/native/ActivityIndicator.native.tsrx.js +35 -0
- package/dist/native/Alert.native.tsrx.js +74 -0
- package/dist/native/Avatar.native.tsrx.js +76 -0
- package/dist/native/AvatarGroup.native.tsrx.js +84 -0
- package/dist/native/Badge.native.tsrx.js +29 -0
- package/dist/native/Banner.native.tsrx.js +80 -0
- package/dist/native/Breadcrumb.native.tsrx.js +66 -0
- package/dist/native/Button.native.tsrx.js +62 -0
- package/dist/native/CameraView.native.tsrx.js +165 -0
- package/dist/native/Card.native.tsrx.js +64 -0
- package/dist/native/Checkbox.native.tsrx.js +58 -0
- package/dist/native/CheckboxGroup.native.tsrx.js +70 -0
- package/dist/native/Chip.native.tsrx.js +83 -0
- package/dist/native/Collapsible.native.tsrx.js +74 -0
- package/dist/native/CommandPalette.native.tsrx.js +143 -0
- package/dist/native/ContextMenu.native.tsrx.js +140 -0
- package/dist/native/Drawer.native.tsrx.js +60 -0
- package/dist/native/DropdownMenu.native.tsrx.js +155 -0
- package/dist/native/Empty.native.tsrx.js +82 -0
- package/dist/native/FieldGroup.native.tsrx.js +39 -0
- package/dist/native/FormField.native.tsrx.js +53 -0
- package/dist/native/{ui8.js → Grid.native.tsrx.js} +19 -8
- package/dist/native/{ui59.js → Heading.native.tsrx.js} +2 -2
- package/dist/native/{ui58.js → Icon.native.tsrx.js} +4 -4
- package/dist/native/{ui29.js → Image.native.tsrx.js} +4 -4
- package/dist/native/InputNumber.native.tsrx.js +146 -0
- package/dist/native/InputRating.native.tsrx.js +74 -0
- package/dist/native/InputTags.native.tsrx.js +131 -0
- package/dist/native/Kbd.native.tsrx.js +29 -0
- package/dist/native/{ui50.js → KeyboardAvoiding.native.tsrx.js} +1 -1
- package/dist/native/{ui17.js → Link.native.tsrx.js} +1 -1
- package/dist/native/{ui55.js → Meter.native.tsrx.js} +2 -2
- package/dist/native/{ui22.js → NavLink.native.tsrx.js} +3 -3
- package/dist/native/NavigationMenu.native.tsrx.js +67 -0
- package/dist/native/{ui35.js → Overlay.native.tsrx.js} +3 -3
- package/dist/native/Pager.native.tsrx.js +282 -0
- package/dist/native/Pagination.native.tsrx.js +107 -0
- package/dist/native/PinInput.native.tsrx.js +94 -0
- package/dist/native/{ui38.js → Popover.native.tsrx.js} +5 -5
- package/dist/native/{ui16.js → Pressable.native.tsrx.js} +20 -14
- package/dist/native/ProgressGroup.native.tsrx.js +66 -0
- package/dist/native/RadioGroup.native.tsrx.js +85 -0
- package/dist/native/{ui15.js → RichText.native.tsrx.js} +15 -22
- package/dist/native/Row.native.tsrx.js +98 -0
- package/dist/native/{ui49.js → SafeArea.native.tsrx.js} +2 -2
- package/dist/native/{ui45.js → Screen.native.tsrx.js} +3 -3
- package/dist/native/{ui26.js → ScrollBox.native.tsrx.js} +1 -1
- package/dist/native/ScrollView.native.tsrx.js +233 -0
- package/dist/native/SearchInput.native.tsrx.js +151 -0
- package/dist/native/SegmentedControl.native.tsrx.js +75 -0
- package/dist/native/Select.native.tsrx.js +202 -0
- package/dist/native/Separator.native.tsrx.js +25 -0
- package/dist/native/{ui63.js → Sheet.native.tsrx.js} +15 -7
- package/dist/native/Skeleton.native.tsrx.js +28 -0
- package/dist/native/Slider.native.tsrx.js +98 -0
- package/dist/native/{ui13.js → Spacer.native.tsrx.js} +2 -2
- package/dist/native/{ui9.js → Stack.native.tsrx.js} +20 -9
- package/dist/native/Stepper.native.tsrx.js +75 -0
- package/dist/native/Switch.native.tsrx.js +33 -0
- package/dist/native/Table.native.tsrx.js +103 -0
- package/dist/native/Tabs.native.tsrx.js +163 -0
- package/dist/native/{ui14.js → Text.native.tsrx.js} +4 -3
- package/dist/native/{ui24.js → TextArea.native.tsrx.js} +17 -16
- package/dist/native/{ui23.js → TextInput.native.tsrx.js} +21 -16
- package/dist/native/Timeline.native.tsrx.js +112 -0
- package/dist/native/Tree.native.tsrx.js +140 -0
- package/dist/native/User.native.tsrx.js +95 -0
- package/dist/native/Video.native.tsrx.js +248 -0
- package/dist/native/View.native.tsrx.js +98 -0
- package/dist/native/WebView.native.tsrx.js +110 -0
- package/dist/native/aliases.native.tsrx.js +38 -0
- package/dist/native/android/BottomNavigationView.android.tsrx.js +171 -0
- package/dist/native/android/CircularProgressIndicator.android.tsrx.js +27 -0
- package/dist/native/{ui51.js → android/DrawerLayout.android.tsrx.js} +5 -7
- package/dist/native/android/MaterialDialog.android.tsrx.js +62 -0
- package/dist/native/android/MaterialSwitch.android.tsrx.js +28 -0
- package/dist/native/android/RecyclerView.android.tsrx.js +248 -0
- package/dist/native/android/SeekBar.android.tsrx.js +34 -0
- package/dist/native/android/index.js +9 -0
- package/dist/native/android/openModal.android.js +39 -0
- package/dist/native/camera-permission.native.js +47 -0
- package/dist/native/child-array.js +15 -0
- package/dist/native/icons.js +25 -0
- package/dist/native/{ui11.js → ios/LiquidGlass.ios.tsrx.js} +4 -4
- package/dist/native/{ui12.js → ios/LiquidGlassContainer.ios.tsrx.js} +4 -4
- package/dist/native/ios/SideDrawer.ios.tsrx.js +64 -0
- package/dist/native/{ui53.js → ios/UIActivityIndicatorView.ios.tsrx.js} +5 -5
- package/dist/native/{ui32.js → ios/UIModal.ios.tsrx.js} +10 -6
- package/dist/native/{ui56.js → ios/UISlider.ios.tsrx.js} +5 -5
- package/dist/native/{ui47.js → ios/UISwitch.ios.tsrx.js} +5 -5
- package/dist/native/ios/UITabBar.ios.tsrx.js +166 -0
- package/dist/native/ios/UITableView.ios.tsrx.js +270 -0
- package/dist/native/ios/index.js +11 -0
- package/dist/native/{ui33.js → ios/openModal.ios.js} +5 -4
- package/dist/native/modal-presenter.native.js +19 -0
- package/dist/native/native/index.js +4 -0
- package/dist/native/octane-client-build.json +1 -1
- package/dist/native/{ui6.js → pan.native.tsrx.js} +9 -69
- package/dist/native/platform.native.js +10 -0
- package/dist/native/refresh-metrics.js +9 -0
- package/dist/native/refresh.native.js +177 -0
- package/dist/native/{ui34.js → root-layout.native.js} +6 -1
- package/dist/native/{ui21.js → route.native.js} +96 -12
- package/dist/native/sheet-detents.native.js +102 -0
- package/dist/native/{ui64.js → sheet-service.native.js} +19 -9
- package/dist/native/sheet-snap.js +35 -0
- package/dist/native/text-write.native.js +27 -0
- package/dist/native/{ui42.js → theme/status-bar-scheme.native.js} +2 -2
- package/dist/{web/ui29.js → native/theme/theme-scheme.js} +2 -2
- package/dist/native/{ui40.js → toast-anchor.native.tsrx.js} +3 -3
- package/dist/native/translate.native.js +11 -0
- package/dist/native/ui.js +93 -55
- package/dist/native/use-back.native.tsrx.js +9 -0
- package/dist/native/{ui52.js → useMeasure.native.tsrx.js} +1 -1
- package/dist/native/video-chrome.native.tsrx.js +365 -0
- package/dist/web/Absolute.web.tsrx.js +47 -0
- package/dist/web/Accordion.web.tsrx.js +85 -0
- package/dist/web/{ui48.js → ActivityIndicator.web.tsrx.js} +1 -1
- package/dist/web/Alert.web.tsrx.js +79 -0
- package/dist/web/Avatar.web.tsrx.js +106 -0
- package/dist/web/AvatarGroup.web.tsrx.js +108 -0
- package/dist/web/Badge.web.tsrx.js +37 -0
- package/dist/web/Banner.web.tsrx.js +79 -0
- package/dist/web/Breadcrumb.web.tsrx.js +135 -0
- package/dist/web/Button.web.tsrx.js +45 -0
- package/dist/web/CameraView.web.tsrx.js +310 -0
- package/dist/web/Card.web.tsrx.js +73 -0
- package/dist/web/Checkbox.web.tsrx.js +89 -0
- package/dist/web/CheckboxGroup.web.tsrx.js +79 -0
- package/dist/web/Chip.web.tsrx.js +64 -0
- package/dist/web/Collapsible.web.tsrx.js +94 -0
- package/dist/web/CommandPalette.web.tsrx.js +125 -0
- package/dist/web/ContextMenu.web.tsrx.js +154 -0
- package/dist/web/{ui45.js → Drawer.web.tsrx.js} +13 -9
- package/dist/web/DropdownMenu.web.tsrx.js +162 -0
- package/dist/web/Empty.web.tsrx.js +89 -0
- package/dist/web/FieldGroup.web.tsrx.js +57 -0
- package/dist/web/FormField.web.tsrx.js +92 -0
- package/dist/web/Grid.web.tsrx.js +65 -0
- package/dist/web/{ui54.js → Heading.web.tsrx.js} +2 -2
- package/dist/web/{ui53.js → Icon.web.tsrx.js} +2 -2
- package/dist/web/{ui25.js → Image.web.tsrx.js} +2 -2
- package/dist/web/InputNumber.web.tsrx.js +99 -0
- package/dist/web/InputRating.web.tsrx.js +72 -0
- package/dist/web/InputTags.web.tsrx.js +122 -0
- package/dist/web/Kbd.web.tsrx.js +37 -0
- package/dist/web/{ui50.js → Meter.web.tsrx.js} +1 -1
- package/dist/web/{ui19.js → NavLink.web.tsrx.js} +1 -1
- package/dist/web/NavigationMenu.web.tsrx.js +118 -0
- package/dist/web/{ui31.js → Overlay.web.tsrx.js} +2 -2
- package/dist/web/Pager.web.tsrx.js +337 -0
- package/dist/web/Pagination.web.tsrx.js +80 -0
- package/dist/web/PinInput.web.tsrx.js +72 -0
- package/dist/web/{ui33.js → Popover.web.tsrx.js} +3 -3
- package/dist/web/{ui15.js → Pressable.web.tsrx.js} +68 -95
- package/dist/web/ProgressGroup.web.tsrx.js +109 -0
- package/dist/web/RadioGroup.web.tsrx.js +69 -0
- package/dist/web/{ui14.js → RichText.web.tsrx.js} +2 -2
- package/dist/web/Row.web.tsrx.js +250 -0
- package/dist/web/{ui43.js → SafeArea.web.tsrx.js} +1 -1
- package/dist/web/{ui39.js → Screen.web.tsrx.js} +1 -1
- package/dist/web/{ui24.js → ScrollBox.web.tsrx.js} +1 -1
- package/dist/web/ScrollView.web.tsrx.js +388 -0
- package/dist/web/SearchInput.web.tsrx.js +137 -0
- package/dist/web/SegmentedControl.web.tsrx.js +75 -0
- package/dist/web/Select.web.tsrx.js +149 -0
- package/dist/web/Separator.web.tsrx.js +42 -0
- package/dist/web/Sheet.web.tsrx.js +81 -0
- package/dist/web/Skeleton.web.tsrx.js +56 -0
- package/dist/web/Slider.web.tsrx.js +97 -0
- package/dist/web/{ui12.js → Spacer.web.tsrx.js} +1 -1
- package/dist/web/Stack.web.tsrx.js +47 -0
- package/dist/web/Stepper.web.tsrx.js +65 -0
- package/dist/web/Switch.web.tsrx.js +59 -0
- package/dist/web/Table.web.tsrx.js +161 -0
- package/dist/web/{ui40.js → Tabs.web.tsrx.js} +33 -16
- package/dist/web/{ui13.js → Text.web.tsrx.js} +18 -50
- package/dist/web/{ui21.js → TextArea.web.tsrx.js} +4 -4
- package/dist/web/{ui20.js → TextInput.web.tsrx.js} +8 -8
- package/dist/web/Timeline.web.tsrx.js +172 -0
- package/dist/web/Tree.web.tsrx.js +146 -0
- package/dist/web/User.web.tsrx.js +116 -0
- package/dist/web/Video.web.tsrx.js +400 -0
- package/dist/web/View.web.tsrx.js +250 -0
- package/dist/web/WebView.web.tsrx.js +235 -0
- package/dist/web/aliases.web.tsrx.js +24 -0
- package/dist/web/{ui36.js → anim.web.tsrx.js} +3 -35
- package/dist/web/child-array.js +15 -0
- package/dist/web/icons.js +25 -0
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/pan.web.tsrx.js +66 -0
- package/dist/web/platform.web.js +9 -0
- package/dist/web/refresh-metrics.js +9 -0
- package/dist/web/refresh.web.js +133 -0
- package/dist/web/{ui18.js → route.web.js} +14 -2
- package/dist/web/sheet-detents.web.js +103 -0
- package/dist/web/{ui60.js → sheet-service.web.js} +5 -1
- package/dist/web/sheet-snap.js +35 -0
- package/dist/{native/ui31.js → web/theme/theme-scheme.js} +2 -2
- package/dist/web/{ui35.js → toast-anchor.web.tsrx.js} +3 -3
- package/dist/web/transform.web.js +43 -0
- package/dist/web/translate.web.js +13 -0
- package/dist/web/ui.js +91 -53
- package/dist/web/use-back.web.tsrx.js +9 -0
- package/dist/web/video-chrome.web.tsrx.js +207 -0
- package/dist/web/{ui34.js → web/Hoverable.web.tsrx.js} +6 -6
- package/dist/web/web/Tooltip.web.tsrx.js +183 -0
- package/dist/web/web/index.js +3 -0
- package/package.json +30 -3
- package/src/theme/tokens.css +1380 -200
- package/types/android.d.ts +53 -0
- package/types/index.d.ts +32 -17
- package/types/index.native.d.ts +273 -0
- package/types/index.web.d.ts +272 -0
- package/types/ios.d.ts +59 -0
- package/types/native.d.ts +5 -0
- package/types/props.d.ts +930 -40
- package/types/web.d.ts +17 -0
- package/dist/native/ui10.js +0 -32
- package/dist/native/ui25.js +0 -141
- package/dist/native/ui27.js +0 -61
- package/dist/native/ui39.js +0 -103
- package/dist/native/ui4.js +0 -24
- package/dist/native/ui46.js +0 -267
- package/dist/native/ui57.js +0 -19
- package/dist/native/ui60.js +0 -14
- package/dist/native/ui7.js +0 -52
- package/dist/web/ui10.js +0 -46
- package/dist/web/ui11.js +0 -42
- package/dist/web/ui22.js +0 -108
- package/dist/web/ui23.js +0 -96
- package/dist/web/ui26.js +0 -45
- package/dist/web/ui3.js +0 -31
- package/dist/web/ui30.js +0 -34
- package/dist/web/ui41.js +0 -43
- package/dist/web/ui44.js +0 -42
- package/dist/web/ui5.js +0 -168
- package/dist/web/ui51.js +0 -47
- package/dist/web/ui52.js +0 -19
- package/dist/web/ui55.js +0 -17
- package/dist/web/ui59.js +0 -44
- package/dist/web/ui6.js +0 -94
- package/dist/web/ui7.js +0 -62
- package/dist/web/ui8.js +0 -46
- package/dist/web/ui9.js +0 -46
- /package/dist/native/{ui20.js → RouteHost.native.tsrx.js} +0 -0
- /package/dist/native/{ui41.js → anim.native.tsrx.js} +0 -0
- /package/dist/native/{ui2.js → cx.js} +0 -0
- /package/dist/native/{ui3.js → escape-props.native.js} +0 -0
- /package/dist/native/{ui5.js → layout-child.native.js} +0 -0
- /package/dist/native/{ui54.js → meter-math.js} +0 -0
- /package/dist/native/{ui36.js → platformProps.native.js} +0 -0
- /package/dist/native/{ui37.js → popover-position.js} +0 -0
- /package/dist/native/{ui19.js → route-table.js} +0 -0
- /package/dist/native/{ui48.js → safeAreaInsets.native.tsrx.js} +0 -0
- /package/dist/native/{ui18.js → stacks.native.js} +0 -0
- /package/dist/native/{ui61.js → store.js} +0 -0
- /package/dist/native/{ui43.js → styled.native.tsrx.js} +0 -0
- /package/dist/native/{ui28.js → svg.native.js} +0 -0
- /package/dist/native/{ui30.js → theme/colorScheme.native.js} +0 -0
- /package/dist/native/{ui62.js → use-store.native.tsrx.js} +0 -0
- /package/dist/native/{ui44.js → windows.native.js} +0 -0
- /package/dist/web/{ui16.js → Link.web.tsrx.js} +0 -0
- /package/dist/web/{ui28.js → cx.js} +0 -0
- /package/dist/web/{ui2.js → escape-props.web.js} +0 -0
- /package/dist/web/{ui4.js → layout-child.web.js} +0 -0
- /package/dist/web/{ui49.js → meter-math.js} +0 -0
- /package/dist/web/{ui47.js → platformProps.web.js} +0 -0
- /package/dist/web/{ui32.js → popover-position.js} +0 -0
- /package/dist/web/{ui17.js → route-table.js} +0 -0
- /package/dist/web/{ui42.js → safeAreaInsets.web.tsrx.js} +0 -0
- /package/dist/web/{ui56.js → stacks.web.js} +0 -0
- /package/dist/web/{ui57.js → store.js} +0 -0
- /package/dist/web/{ui37.js → styled.web.tsrx.js} +0 -0
- /package/dist/web/{ui27.js → theme/colorScheme.web.js} +0 -0
- /package/dist/web/{ui58.js → use-store.web.tsrx.js} +0 -0
- /package/dist/web/{ui46.js → useMeasure.web.tsrx.js} +0 -0
- /package/dist/web/{ui38.js → windows.web.js} +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { cx } from "./cx.js";
|
|
2
|
+
import { applyEscapeProps, nativeAccessibilityState } from "./escape-props.native.js";
|
|
3
|
+
import { defineUniversalComponent, hookSlots, universalPlan, universalProps, universalValue, useState } from "@nativescript-community/octane";
|
|
4
|
+
//#region src/SegmentedControl.native.tsrx
|
|
5
|
+
var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
|
|
6
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
7
|
+
"kind": "host",
|
|
8
|
+
"type": "flexboxlayout",
|
|
9
|
+
"propsSlot": 0,
|
|
10
|
+
"children": [{
|
|
11
|
+
"kind": "host",
|
|
12
|
+
"type": "label",
|
|
13
|
+
"props": { "className": "vx-segment-label" },
|
|
14
|
+
"bindings": [["text", 1]]
|
|
15
|
+
}]
|
|
16
|
+
});
|
|
17
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
18
|
+
"kind": "host",
|
|
19
|
+
"type": "flexboxlayout",
|
|
20
|
+
"props": { "flexDirection": "row" },
|
|
21
|
+
"bindings": [
|
|
22
|
+
["ref", 0],
|
|
23
|
+
["id", 1],
|
|
24
|
+
["className", 2],
|
|
25
|
+
["style", 3],
|
|
26
|
+
["accessibilityLabel", 4]
|
|
27
|
+
],
|
|
28
|
+
"children": [{
|
|
29
|
+
"kind": "slot",
|
|
30
|
+
"slot": 5
|
|
31
|
+
}]
|
|
32
|
+
});
|
|
33
|
+
var SegmentedControl = defineUniversalComponent("nativescript", function SegmentedControl(props) {
|
|
34
|
+
const [internal, setInternal] = useState(props.defaultValue, _h$0);
|
|
35
|
+
const current = props.value ?? internal;
|
|
36
|
+
const select = (value) => {
|
|
37
|
+
if (props.value === void 0) setInternal(value);
|
|
38
|
+
props.onValueChange?.(value);
|
|
39
|
+
};
|
|
40
|
+
return universalValue(__octaneUniversalPlan1, [
|
|
41
|
+
(v) => applyEscapeProps(v, props),
|
|
42
|
+
props.id,
|
|
43
|
+
cx("vx-segmented", props.disabled && "vx-segmented--disabled", props.className),
|
|
44
|
+
props.style,
|
|
45
|
+
props.accessibilityLabel,
|
|
46
|
+
props.options.map((opt) => {
|
|
47
|
+
const selected = current === opt.value;
|
|
48
|
+
const disabled = props.disabled || opt.disabled;
|
|
49
|
+
return universalValue(__octaneUniversalPlan0, [universalProps([
|
|
50
|
+
[
|
|
51
|
+
"set",
|
|
52
|
+
"key",
|
|
53
|
+
opt.value
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
"set",
|
|
57
|
+
"className",
|
|
58
|
+
cx("vx-segment", selected && "vx-segment--on", disabled && "vx-segment--disabled")
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
"set",
|
|
62
|
+
"accessibilityState",
|
|
63
|
+
nativeAccessibilityState({ selected })
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"set",
|
|
67
|
+
"onTap",
|
|
68
|
+
disabled ? void 0 : () => select(opt.value)
|
|
69
|
+
]
|
|
70
|
+
]), opt.label ?? opt.value]);
|
|
71
|
+
})
|
|
72
|
+
]);
|
|
73
|
+
}, { "module": "@nativescript-community/octane" });
|
|
74
|
+
//#endregion
|
|
75
|
+
export { SegmentedControl };
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { cx } from "./cx.js";
|
|
2
|
+
import { Pressable } from "./Pressable.native.tsrx.js";
|
|
3
|
+
import { Popover } from "./Popover.native.tsrx.js";
|
|
4
|
+
import { TextInput } from "./TextInput.native.tsrx.js";
|
|
5
|
+
import { defineUniversalComponent, hookSlots, universalChildren, universalComponent, universalFor, universalPlan, universalProps, universalValue, useRef, useState } from "@nativescript-community/octane";
|
|
6
|
+
//#region src/Select.native.tsrx
|
|
7
|
+
var _hs$ = /* @__PURE__ */ hookSlots(4);
|
|
8
|
+
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
9
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
10
|
+
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
11
|
+
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
12
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
13
|
+
"kind": "range",
|
|
14
|
+
"children": [{
|
|
15
|
+
"kind": "host",
|
|
16
|
+
"type": "label",
|
|
17
|
+
"bindings": [["className", 0], ["text", 1]]
|
|
18
|
+
}, {
|
|
19
|
+
"kind": "host",
|
|
20
|
+
"type": "label",
|
|
21
|
+
"props": {
|
|
22
|
+
"className": "vx-select-caret",
|
|
23
|
+
"text": "▾"
|
|
24
|
+
}
|
|
25
|
+
}]
|
|
26
|
+
});
|
|
27
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
28
|
+
"kind": "slot",
|
|
29
|
+
"slot": 0
|
|
30
|
+
});
|
|
31
|
+
var __octaneUniversalPlan2 = universalPlan("nativescript", {
|
|
32
|
+
"kind": "host",
|
|
33
|
+
"type": "flexboxlayout",
|
|
34
|
+
"bindings": [["className", 0], ["onTap", 1]],
|
|
35
|
+
"children": [{
|
|
36
|
+
"kind": "host",
|
|
37
|
+
"type": "label",
|
|
38
|
+
"props": { "className": "vx-select-check" },
|
|
39
|
+
"bindings": [["text", 2]]
|
|
40
|
+
}, {
|
|
41
|
+
"kind": "host",
|
|
42
|
+
"type": "label",
|
|
43
|
+
"props": { "className": "vx-menu-item-label" },
|
|
44
|
+
"bindings": [["text", 3]]
|
|
45
|
+
}]
|
|
46
|
+
});
|
|
47
|
+
var __octaneUniversalPlan3 = universalPlan("nativescript", {
|
|
48
|
+
"kind": "range",
|
|
49
|
+
"children": [{
|
|
50
|
+
"kind": "slot",
|
|
51
|
+
"slot": 0
|
|
52
|
+
}, {
|
|
53
|
+
"kind": "host",
|
|
54
|
+
"type": "flexboxlayout",
|
|
55
|
+
"props": { "className": "vx-menu-list vx-select-list" },
|
|
56
|
+
"children": [{
|
|
57
|
+
"kind": "slot",
|
|
58
|
+
"slot": 1
|
|
59
|
+
}]
|
|
60
|
+
}]
|
|
61
|
+
});
|
|
62
|
+
var __octaneUniversalPlan4 = universalPlan("nativescript", {
|
|
63
|
+
"kind": "range",
|
|
64
|
+
"children": [{
|
|
65
|
+
"kind": "slot",
|
|
66
|
+
"slot": 0
|
|
67
|
+
}, {
|
|
68
|
+
"kind": "slot",
|
|
69
|
+
"slot": 1
|
|
70
|
+
}]
|
|
71
|
+
});
|
|
72
|
+
var Select = defineUniversalComponent("nativescript", function Select(props) {
|
|
73
|
+
const anchor = useRef(null, _h$0);
|
|
74
|
+
const [internalOpen, setInternalOpen] = useState(props.defaultOpen ?? false, _h$1);
|
|
75
|
+
const openControlled = props.open !== void 0;
|
|
76
|
+
const open = openControlled ? props.open : internalOpen;
|
|
77
|
+
const norm = (v) => v === void 0 ? [] : Array.isArray(v) ? v : [v];
|
|
78
|
+
const [internalValue, setInternalValue] = useState(norm(props.defaultValue), _h$2);
|
|
79
|
+
const valueControlled = props.value !== void 0;
|
|
80
|
+
const selected = valueControlled ? norm(props.value) : internalValue;
|
|
81
|
+
const [query, setQuery] = useState("", _h$3);
|
|
82
|
+
const setOpen = (next) => {
|
|
83
|
+
if (props.disabled && next) return;
|
|
84
|
+
if (!openControlled) setInternalOpen(next);
|
|
85
|
+
if (!next) setQuery("");
|
|
86
|
+
props.onOpenChange?.(next);
|
|
87
|
+
};
|
|
88
|
+
const report = (keys) => {
|
|
89
|
+
if (!valueControlled) setInternalValue(keys);
|
|
90
|
+
props.onValueChange?.(props.multiple ? keys : keys[0]);
|
|
91
|
+
};
|
|
92
|
+
const pick = (opt) => {
|
|
93
|
+
if (opt.disabled) return;
|
|
94
|
+
if (props.multiple) report(selected.includes(opt.value) ? selected.filter((v) => v !== opt.value) : [...selected, opt.value]);
|
|
95
|
+
else {
|
|
96
|
+
report([opt.value]);
|
|
97
|
+
setOpen(false);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const labelFor = (v) => props.options.find((o) => o.value === v)?.label ?? v;
|
|
101
|
+
const triggerText = selected.length ? selected.map(labelFor).join(", ") : props.placeholder ?? "";
|
|
102
|
+
const shown = props.searchable && query ? props.options.filter((o) => (o.label ?? o.value).toLowerCase().includes(query.toLowerCase())) : props.options;
|
|
103
|
+
return universalValue(__octaneUniversalPlan4, [universalComponent("nativescript", Pressable, universalProps([
|
|
104
|
+
[
|
|
105
|
+
"set",
|
|
106
|
+
"bind",
|
|
107
|
+
(v) => {
|
|
108
|
+
anchor.current = v;
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
[
|
|
112
|
+
"set",
|
|
113
|
+
"id",
|
|
114
|
+
props.id
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
"set",
|
|
118
|
+
"className",
|
|
119
|
+
cx("vx-select-trigger", props.disabled && "vx-select--disabled", props.className)
|
|
120
|
+
],
|
|
121
|
+
[
|
|
122
|
+
"set",
|
|
123
|
+
"style",
|
|
124
|
+
props.style
|
|
125
|
+
],
|
|
126
|
+
[
|
|
127
|
+
"set",
|
|
128
|
+
"disabled",
|
|
129
|
+
props.disabled
|
|
130
|
+
],
|
|
131
|
+
[
|
|
132
|
+
"set",
|
|
133
|
+
"onPress",
|
|
134
|
+
() => setOpen(!open)
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
"set",
|
|
138
|
+
"accessibilityLabel",
|
|
139
|
+
props.accessibilityLabel
|
|
140
|
+
]
|
|
141
|
+
], universalChildren("nativescript", () => {
|
|
142
|
+
return universalValue(__octaneUniversalPlan0, [cx("vx-select-value", !selected.length && "vx-select-placeholder"), triggerText]);
|
|
143
|
+
}))), universalComponent("nativescript", Popover, universalProps([
|
|
144
|
+
[
|
|
145
|
+
"set",
|
|
146
|
+
"anchor",
|
|
147
|
+
anchor
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
"set",
|
|
151
|
+
"open",
|
|
152
|
+
open
|
|
153
|
+
],
|
|
154
|
+
[
|
|
155
|
+
"set",
|
|
156
|
+
"placement",
|
|
157
|
+
props.placement ?? "bottom"
|
|
158
|
+
],
|
|
159
|
+
[
|
|
160
|
+
"set",
|
|
161
|
+
"onDismiss",
|
|
162
|
+
() => setOpen(false)
|
|
163
|
+
],
|
|
164
|
+
[
|
|
165
|
+
"set",
|
|
166
|
+
"className",
|
|
167
|
+
"vx-menu"
|
|
168
|
+
]
|
|
169
|
+
], universalChildren("nativescript", () => {
|
|
170
|
+
return universalValue(__octaneUniversalPlan3, [props.searchable ? universalValue(__octaneUniversalPlan1, [universalComponent("nativescript", TextInput, universalProps([
|
|
171
|
+
[
|
|
172
|
+
"set",
|
|
173
|
+
"className",
|
|
174
|
+
"vx-select-search"
|
|
175
|
+
],
|
|
176
|
+
[
|
|
177
|
+
"set",
|
|
178
|
+
"placeholder",
|
|
179
|
+
"Search…"
|
|
180
|
+
],
|
|
181
|
+
[
|
|
182
|
+
"set",
|
|
183
|
+
"value",
|
|
184
|
+
query
|
|
185
|
+
],
|
|
186
|
+
[
|
|
187
|
+
"set",
|
|
188
|
+
"onChange",
|
|
189
|
+
setQuery
|
|
190
|
+
]
|
|
191
|
+
]))]) : null, universalFor(shown, (opt, __octaneUniversalIndex) => opt.value, (opt, __octaneUniversalIndex) => {
|
|
192
|
+
return universalValue(__octaneUniversalPlan2, [
|
|
193
|
+
cx("vx-menu-item", "vx-select-option", selected.includes(opt.value) && "vx-select-option--on", opt.disabled && "vx-menu-item--disabled"),
|
|
194
|
+
opt.disabled ? void 0 : () => pick(opt),
|
|
195
|
+
selected.includes(opt.value) ? "✓" : "",
|
|
196
|
+
opt.label ?? opt.value
|
|
197
|
+
]);
|
|
198
|
+
})]);
|
|
199
|
+
})))]);
|
|
200
|
+
}, { "module": "@nativescript-community/octane" });
|
|
201
|
+
//#endregion
|
|
202
|
+
export { Select };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cx } from "./cx.js";
|
|
2
|
+
import { applyEscapeProps } from "./escape-props.native.js";
|
|
3
|
+
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
|
+
//#region src/Separator.native.tsrx
|
|
5
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
|
+
"kind": "host",
|
|
7
|
+
"type": "flexboxlayout",
|
|
8
|
+
"bindings": [
|
|
9
|
+
["ref", 0],
|
|
10
|
+
["id", 1],
|
|
11
|
+
["className", 2],
|
|
12
|
+
["style", 3]
|
|
13
|
+
]
|
|
14
|
+
});
|
|
15
|
+
var Separator = defineUniversalComponent("nativescript", function Separator(props) {
|
|
16
|
+
const vertical = props.orientation === "vertical";
|
|
17
|
+
return universalValue(__octaneUniversalPlan0, [
|
|
18
|
+
(v) => applyEscapeProps(v, props),
|
|
19
|
+
props.id,
|
|
20
|
+
cx("vx-separator", vertical ? "vx-separator--v" : "vx-separator--h", props.className),
|
|
21
|
+
props.style
|
|
22
|
+
]);
|
|
23
|
+
}, { "module": "@nativescript-community/octane" });
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Separator };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { cx } from "./
|
|
2
|
-
import { applyThemeClasses } from "./
|
|
3
|
-
import { rootLayoutFor } from "./
|
|
1
|
+
import { cx } from "./cx.js";
|
|
2
|
+
import { applyThemeClasses } from "./theme/theme-scheme.js";
|
|
3
|
+
import { rootLayoutFor } from "./root-layout.native.js";
|
|
4
|
+
import { attachSheetDetents } from "./sheet-detents.native.js";
|
|
4
5
|
import { createNativeScriptRoot, defineUniversalComponent, hookSlots, universalPlan, universalValue, useEffect, useRef } from "@nativescript-community/octane";
|
|
5
6
|
import { GridLayout, isAndroid, isIOS } from "@nativescript/core";
|
|
6
7
|
//#region src/Sheet.native.tsrx
|
|
@@ -53,16 +54,23 @@ var Sheet = defineUniversalComponent("nativescript", function Sheet(props) {
|
|
|
53
54
|
if (props.style) Object.assign(host.style, props.style);
|
|
54
55
|
Object.assign(host, isIOS ? props.ios : isAndroid ? props.android : void 0);
|
|
55
56
|
const root = createNativeScriptRoot(host);
|
|
57
|
+
const detents = props.detents?.length ? attachSheetDetents(host, props.detents, () => {
|
|
58
|
+
host.parent?.close?.(host)?.catch?.((error) => {
|
|
59
|
+
console.error("[Sheet] close failed", error);
|
|
60
|
+
});
|
|
61
|
+
}) : null;
|
|
56
62
|
const opened = {
|
|
57
63
|
host,
|
|
58
64
|
root,
|
|
59
65
|
unbindTheme,
|
|
60
|
-
programmatic: false
|
|
66
|
+
programmatic: false,
|
|
67
|
+
detach: detents?.detach
|
|
61
68
|
};
|
|
62
69
|
shown.current = opened;
|
|
63
70
|
root.render(SheetBody, { children: props.children });
|
|
64
71
|
host.on("closed", () => {
|
|
65
72
|
if (shown.current === opened) shown.current = null;
|
|
73
|
+
opened.detach?.();
|
|
66
74
|
opened.unbindTheme?.();
|
|
67
75
|
opened.root.unmount?.();
|
|
68
76
|
if (!opened.programmatic) props.onDismiss?.();
|
|
@@ -72,7 +80,7 @@ var Sheet = defineUniversalComponent("nativescript", function Sheet(props) {
|
|
|
72
80
|
opacity: .4,
|
|
73
81
|
tapToClose: true
|
|
74
82
|
} } : {},
|
|
75
|
-
animation: {
|
|
83
|
+
...detents ? {} : { animation: {
|
|
76
84
|
enterFrom: {
|
|
77
85
|
translateY: 400,
|
|
78
86
|
duration: 250
|
|
@@ -81,8 +89,8 @@ var Sheet = defineUniversalComponent("nativescript", function Sheet(props) {
|
|
|
81
89
|
translateY: 400,
|
|
82
90
|
duration: 200
|
|
83
91
|
}
|
|
84
|
-
}
|
|
85
|
-
}).catch((error) => {
|
|
92
|
+
} }
|
|
93
|
+
}).then(() => detents?.enter()).catch((error) => {
|
|
86
94
|
if (shown.current === opened) shown.current = null;
|
|
87
95
|
opened.unbindTheme?.();
|
|
88
96
|
opened.root.unmount?.();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cx } from "./cx.js";
|
|
2
|
+
import { applyEscapeProps } from "./escape-props.native.js";
|
|
3
|
+
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
|
+
//#region src/Skeleton.native.tsrx
|
|
5
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
|
+
"kind": "host",
|
|
7
|
+
"type": "flexboxlayout",
|
|
8
|
+
"bindings": [
|
|
9
|
+
["ref", 0],
|
|
10
|
+
["id", 1],
|
|
11
|
+
["className", 2],
|
|
12
|
+
["style", 3]
|
|
13
|
+
]
|
|
14
|
+
});
|
|
15
|
+
var Skeleton = defineUniversalComponent("nativescript", function Skeleton(props) {
|
|
16
|
+
return universalValue(__octaneUniversalPlan0, [
|
|
17
|
+
(v) => applyEscapeProps(v, props),
|
|
18
|
+
props.id,
|
|
19
|
+
cx("vx-skeleton", props.className),
|
|
20
|
+
{
|
|
21
|
+
...props.style,
|
|
22
|
+
width: props.width,
|
|
23
|
+
height: props.height
|
|
24
|
+
}
|
|
25
|
+
]);
|
|
26
|
+
}, { "module": "@nativescript-community/octane" });
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Skeleton };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { cx } from "./cx.js";
|
|
2
|
+
import { nativeAccessibilityRole } from "./escape-props.native.js";
|
|
3
|
+
import { usePan } from "./pan.native.tsrx.js";
|
|
4
|
+
import { applyNativeProps } from "./platformProps.native.js";
|
|
5
|
+
import { useMeasure } from "./useMeasure.native.tsrx.js";
|
|
6
|
+
import { defineUniversalComponent, hookSlots, universalPlan, universalValue, useCallback, useEffect, useRef, useState, withSlot } from "@nativescript-community/octane";
|
|
7
|
+
//#region src/Slider.native.tsrx
|
|
8
|
+
var _hs$ = /* @__PURE__ */ hookSlots(7);
|
|
9
|
+
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
10
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
11
|
+
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
12
|
+
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
13
|
+
var _h$4 = /* @__PURE__ */ Symbol(_hs$ + 4);
|
|
14
|
+
var _h$5 = /* @__PURE__ */ Symbol(_hs$ + 5);
|
|
15
|
+
var _h$6 = /* @__PURE__ */ Symbol(_hs$ + 6);
|
|
16
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
17
|
+
"kind": "host",
|
|
18
|
+
"type": "gridlayout",
|
|
19
|
+
"bindings": [
|
|
20
|
+
["id", 0],
|
|
21
|
+
["className", 1],
|
|
22
|
+
["style", 2],
|
|
23
|
+
["accessibilityRole", 3],
|
|
24
|
+
["onPan", 4],
|
|
25
|
+
["ref", 5]
|
|
26
|
+
],
|
|
27
|
+
"children": [
|
|
28
|
+
{
|
|
29
|
+
"kind": "host",
|
|
30
|
+
"type": "flexboxlayout",
|
|
31
|
+
"props": { "className": "vx-slider-track" }
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"kind": "host",
|
|
35
|
+
"type": "flexboxlayout",
|
|
36
|
+
"props": {
|
|
37
|
+
"className": "vx-slider-fill",
|
|
38
|
+
"horizontalAlignment": "left"
|
|
39
|
+
},
|
|
40
|
+
"bindings": [["style", 6]]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"kind": "host",
|
|
44
|
+
"type": "flexboxlayout",
|
|
45
|
+
"props": {
|
|
46
|
+
"className": "vx-slider-thumb",
|
|
47
|
+
"horizontalAlignment": "left"
|
|
48
|
+
},
|
|
49
|
+
"bindings": [["style", 7]]
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
var Slider = defineUniversalComponent("nativescript", function Slider(props) {
|
|
54
|
+
const measure = withSlot(_h$0, useMeasure);
|
|
55
|
+
const drag = useRef(null, _h$1);
|
|
56
|
+
const [dragValue, setDragValue] = useState(null, _h$2);
|
|
57
|
+
const min = props.minValue ?? 0;
|
|
58
|
+
const max = props.maxValue ?? 100;
|
|
59
|
+
const value = dragValue ?? props.value ?? min;
|
|
60
|
+
const ratio = Math.min(1, Math.max(0, (value - min) / (max - min)));
|
|
61
|
+
const width = measure.bounds?.width ?? 0;
|
|
62
|
+
const host = useRef(null, _h$3);
|
|
63
|
+
const bindHost = useCallback((el) => {
|
|
64
|
+
host.current = el;
|
|
65
|
+
measure.bind(el);
|
|
66
|
+
}, [], _h$4);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
applyNativeProps(host.current, props);
|
|
69
|
+
}, [props], _h$5);
|
|
70
|
+
const onPan = withSlot(_h$6, usePan, (e) => {
|
|
71
|
+
if (props.disabled) return;
|
|
72
|
+
if (e.state === "began") {
|
|
73
|
+
drag.current = { value0: value };
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (!drag.current || !width) return;
|
|
77
|
+
if (e.state === "moved") {
|
|
78
|
+
const next = Math.min(max, Math.max(min, drag.current.value0 + e.dx / width * (max - min)));
|
|
79
|
+
setDragValue(next);
|
|
80
|
+
props.onValueChange?.(next);
|
|
81
|
+
} else {
|
|
82
|
+
drag.current = null;
|
|
83
|
+
setDragValue(null);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
return universalValue(__octaneUniversalPlan0, [
|
|
87
|
+
props.id,
|
|
88
|
+
cx("vx-slider", props.className),
|
|
89
|
+
props.style,
|
|
90
|
+
nativeAccessibilityRole("adjustable"),
|
|
91
|
+
onPan,
|
|
92
|
+
bindHost,
|
|
93
|
+
{ width: ratio * width },
|
|
94
|
+
{ marginLeft: Math.min(Math.max(ratio * width - 10, 0), Math.max(width - 20, 0)) }
|
|
95
|
+
]);
|
|
96
|
+
}, { "module": "@nativescript-community/octane" });
|
|
97
|
+
//#endregion
|
|
98
|
+
export { Slider };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cx } from "./
|
|
2
|
-
import { applyEscapeProps } from "./
|
|
1
|
+
import { cx } from "./cx.js";
|
|
2
|
+
import { applyEscapeProps } from "./escape-props.native.js";
|
|
3
3
|
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
4
|
//#region src/Spacer.native.tsrx
|
|
5
5
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { cx } from "./
|
|
2
|
-
import { applyEscapeProps } from "./
|
|
3
|
-
import { glassClassOf, glassConfigOf } from "./ui4.js";
|
|
1
|
+
import { cx } from "./cx.js";
|
|
2
|
+
import { applyEscapeProps, nativeAccessibilityRole, nativeAccessibilityState } from "./escape-props.native.js";
|
|
4
3
|
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
5
4
|
//#region src/Stack.native.tsrx
|
|
6
5
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
@@ -13,22 +12,34 @@ var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
|
13
12
|
"bindings": [
|
|
14
13
|
["id", 0],
|
|
15
14
|
["ref", 1],
|
|
16
|
-
["
|
|
17
|
-
["
|
|
18
|
-
["
|
|
15
|
+
["className", 2],
|
|
16
|
+
["style", 3],
|
|
17
|
+
["accessible", 4],
|
|
18
|
+
["accessibilityLabel", 5],
|
|
19
|
+
["accessibilityRole", 6],
|
|
20
|
+
["accessibilityHint", 7],
|
|
21
|
+
["accessibilityValue", 8],
|
|
22
|
+
["accessibilityState", 9],
|
|
23
|
+
["accessibilityLiveRegion", 10]
|
|
19
24
|
],
|
|
20
25
|
"children": [{
|
|
21
26
|
"kind": "slot",
|
|
22
|
-
"slot":
|
|
27
|
+
"slot": 11
|
|
23
28
|
}]
|
|
24
29
|
});
|
|
25
30
|
var Stack = defineUniversalComponent("nativescript", function Stack(props) {
|
|
26
31
|
return universalValue(__octaneUniversalPlan0, [
|
|
27
32
|
props.id,
|
|
28
33
|
(view) => applyEscapeProps(view, props),
|
|
29
|
-
|
|
30
|
-
cx("vx-stack", glassClassOf(props.glass), props.className),
|
|
34
|
+
cx("vx-stack", props.className),
|
|
31
35
|
props.style,
|
|
36
|
+
props.accessible,
|
|
37
|
+
props.accessibilityLabel,
|
|
38
|
+
nativeAccessibilityRole(props.accessibilityRole),
|
|
39
|
+
props.accessibilityHint,
|
|
40
|
+
props.accessibilityValue,
|
|
41
|
+
nativeAccessibilityState(props.accessibilityState),
|
|
42
|
+
props.accessibilityLiveRegion,
|
|
32
43
|
props.children
|
|
33
44
|
]);
|
|
34
45
|
}, { "module": "@nativescript-community/octane" });
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { cx } from "./cx.js";
|
|
2
|
+
import { applyEscapeProps } from "./escape-props.native.js";
|
|
3
|
+
import { defineUniversalComponent, universalFor, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
|
+
//#region src/Stepper.native.tsrx
|
|
5
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
|
+
"kind": "host",
|
|
7
|
+
"type": "flexboxlayout",
|
|
8
|
+
"bindings": [["className", 0]]
|
|
9
|
+
});
|
|
10
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
11
|
+
"kind": "host",
|
|
12
|
+
"type": "label",
|
|
13
|
+
"props": { "className": "vx-step-label" },
|
|
14
|
+
"bindings": [["text", 0]]
|
|
15
|
+
});
|
|
16
|
+
var __octaneUniversalPlan2 = universalPlan("nativescript", {
|
|
17
|
+
"kind": "host",
|
|
18
|
+
"type": "flexboxlayout",
|
|
19
|
+
"props": { "className": "vx-stepper-cell" },
|
|
20
|
+
"children": [{
|
|
21
|
+
"kind": "slot",
|
|
22
|
+
"slot": 0
|
|
23
|
+
}, {
|
|
24
|
+
"kind": "host",
|
|
25
|
+
"type": "flexboxlayout",
|
|
26
|
+
"bindings": [["className", 1], ["onTap", 2]],
|
|
27
|
+
"children": [{
|
|
28
|
+
"kind": "host",
|
|
29
|
+
"type": "label",
|
|
30
|
+
"props": { "className": "vx-step-dot" },
|
|
31
|
+
"bindings": [["text", 3]]
|
|
32
|
+
}, {
|
|
33
|
+
"kind": "slot",
|
|
34
|
+
"slot": 4
|
|
35
|
+
}]
|
|
36
|
+
}]
|
|
37
|
+
});
|
|
38
|
+
var __octaneUniversalPlan3 = universalPlan("nativescript", {
|
|
39
|
+
"kind": "host",
|
|
40
|
+
"type": "flexboxlayout",
|
|
41
|
+
"props": { "flexDirection": "row" },
|
|
42
|
+
"bindings": [
|
|
43
|
+
["ref", 0],
|
|
44
|
+
["id", 1],
|
|
45
|
+
["className", 2],
|
|
46
|
+
["style", 3]
|
|
47
|
+
],
|
|
48
|
+
"children": [{
|
|
49
|
+
"kind": "slot",
|
|
50
|
+
"slot": 4
|
|
51
|
+
}]
|
|
52
|
+
});
|
|
53
|
+
var Stepper = defineUniversalComponent("nativescript", function Stepper(props) {
|
|
54
|
+
const current = props.current ?? 0;
|
|
55
|
+
return universalValue(__octaneUniversalPlan3, [
|
|
56
|
+
(v) => applyEscapeProps(v, props),
|
|
57
|
+
props.id,
|
|
58
|
+
cx("vx-stepper", props.className),
|
|
59
|
+
props.style,
|
|
60
|
+
universalFor(props.steps.map((step, i) => ({
|
|
61
|
+
step,
|
|
62
|
+
i
|
|
63
|
+
})), (e, __octaneUniversalIndex) => e.step.key, (e, __octaneUniversalIndex) => {
|
|
64
|
+
return universalValue(__octaneUniversalPlan2, [
|
|
65
|
+
e.i > 0 ? universalValue(__octaneUniversalPlan0, [cx("vx-stepper-line", e.i <= current && "vx-stepper-line--done")]) : null,
|
|
66
|
+
cx("vx-step", e.i < current && "vx-step--done", e.i === current && "vx-step--on", e.step.disabled && "vx-step--disabled"),
|
|
67
|
+
e.step.disabled ? void 0 : () => props.onStepChange?.(e.i),
|
|
68
|
+
e.i < current ? "✓" : String(e.i + 1),
|
|
69
|
+
e.step.label != null ? universalValue(__octaneUniversalPlan1, [e.step.label]) : null
|
|
70
|
+
]);
|
|
71
|
+
})
|
|
72
|
+
]);
|
|
73
|
+
}, { "module": "@nativescript-community/octane" });
|
|
74
|
+
//#endregion
|
|
75
|
+
export { Stepper };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cx } from "./cx.js";
|
|
2
|
+
import { applyEscapeProps, nativeAccessibilityRole } from "./escape-props.native.js";
|
|
3
|
+
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
|
+
//#region src/Switch.native.tsrx
|
|
5
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
|
+
"kind": "host",
|
|
7
|
+
"type": "flexboxlayout",
|
|
8
|
+
"bindings": [
|
|
9
|
+
["ref", 0],
|
|
10
|
+
["id", 1],
|
|
11
|
+
["className", 2],
|
|
12
|
+
["style", 3],
|
|
13
|
+
["accessibilityRole", 4],
|
|
14
|
+
["onTap", 5]
|
|
15
|
+
],
|
|
16
|
+
"children": [{
|
|
17
|
+
"kind": "host",
|
|
18
|
+
"type": "flexboxlayout",
|
|
19
|
+
"props": { "className": "vx-switch-thumb" }
|
|
20
|
+
}]
|
|
21
|
+
});
|
|
22
|
+
var Switch = defineUniversalComponent("nativescript", function Switch(props) {
|
|
23
|
+
return universalValue(__octaneUniversalPlan0, [
|
|
24
|
+
(v) => applyEscapeProps(v, props),
|
|
25
|
+
props.id,
|
|
26
|
+
cx("vx-switch", props.checked ? "vx-switch--on" : void 0, props.className),
|
|
27
|
+
props.style,
|
|
28
|
+
nativeAccessibilityRole("switch"),
|
|
29
|
+
() => props.onCheckedChange?.(!(props.checked ?? false))
|
|
30
|
+
]);
|
|
31
|
+
}, { "module": "@nativescript-community/octane" });
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Switch };
|