@octane-xplat/picker 0.11.1 → 0.12.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.
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { __s,
|
|
2
|
-
import {
|
|
1
|
+
import { __s, bag13, bag5, child, clone, createScopedElement, delegateEvents, hookSlots, mapSlot, setEventHandler, setSelectValue, setStyle, sibling, template, useState } from "octane";
|
|
2
|
+
import { childTextHoleUpdate, compilerMemoRegion, hookMemoEqual, setAriaAttributeIfChanged, setAttributeIfChanged, setBooleanAttributeIfChanged, setClassNameIfChanged, setPlainAttributeIfChanged } from "octane/internal/client";
|
|
3
3
|
//#region src/Select.web.tsrx
|
|
4
|
-
enableSignalBindings(1, true);
|
|
5
4
|
delegateEvents(["change"]);
|
|
6
5
|
var _t$0 = /* @__PURE__ */ template("<option></option>");
|
|
7
|
-
var _t$1 = /* @__PURE__ */ template("<label><span></span><select
|
|
6
|
+
var _t$1 = /* @__PURE__ */ template("<label><span></span><select><!></select></label>");
|
|
8
7
|
var _hs$ = /* @__PURE__ */ hookSlots(2);
|
|
9
8
|
var _key$1 = (option) => option.value;
|
|
10
9
|
function __item$2(option, __s, __extra) {
|
|
11
10
|
let _b = __s.slots[0];
|
|
12
11
|
if (_b === void 0) {
|
|
13
|
-
let _m1;
|
|
14
12
|
const _root = clone(_t$0);
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
_b = bag5(__s, _root, void 0, _root, void 0, null, __s);
|
|
14
|
+
}
|
|
15
|
+
_b.a = setAttributeIfChanged(option.value, _b.a, _b.b, "value");
|
|
16
|
+
_b.c = setBooleanAttributeIfChanged(option.disabled, _b.c, _b.b, "disabled");
|
|
17
|
+
{
|
|
18
|
+
const _v = option.label;
|
|
19
|
+
_b.d = childTextHoleUpdate(__s, 1, _b.b, _v, _b.d, _b.e);
|
|
20
|
+
_b.e = _v;
|
|
17
21
|
}
|
|
18
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "value", option.value, "b:f8ba3234", setAttribute);
|
|
19
|
-
_b.c = bindSignalAttribute(__s, _b.c, _b.b, "disabled", option.disabled, "b:97cc1a6e", setBooleanAttribute);
|
|
20
|
-
_b.f = bindSignalChild(__s, _b.f, 1, _b.b, option.label, "b:f207a308", null, void 0, void 0, void 0, true);
|
|
21
22
|
}
|
|
22
23
|
var Select = /* @__PURE__ */ __s(function Select(props, __s, __extra) {
|
|
23
24
|
const __memoRegion = compilerMemoRegion(__s, _hs$ + 0);
|
|
@@ -32,30 +33,27 @@ var Select = /* @__PURE__ */ __s(function Select(props, __s, __extra) {
|
|
|
32
33
|
if (__s.block.pending && !__s.block.crossRenderUpdate) return;
|
|
33
34
|
let _b = __s.slots[0];
|
|
34
35
|
if (_b === void 0) {
|
|
35
|
-
let
|
|
36
|
+
let _m10;
|
|
36
37
|
const _root = clone(_t$1);
|
|
37
|
-
_m1 = _root;
|
|
38
38
|
const _el0 = child(_root);
|
|
39
|
-
_m4 = _el0;
|
|
40
39
|
const _el1 = sibling(_el0, 1);
|
|
41
|
-
|
|
42
|
-
_m9 = bindSignalValue(__s, void 0, _el1, value, "i:d2ddab07");
|
|
40
|
+
setSelectValue(_el1, value);
|
|
43
41
|
setEventHandler(_el1, "$$change", (event) => {
|
|
44
42
|
const nextValue = event.target.value;
|
|
45
43
|
if (!controlled) setInternalValue(nextValue);
|
|
46
44
|
props.onChange?.(nextValue);
|
|
47
45
|
});
|
|
48
|
-
|
|
49
|
-
_b =
|
|
46
|
+
_m10 = child(_el1);
|
|
47
|
+
_b = bag13(__s, _root, void 0, _root, void 0, void 0, _el0, void 0, _el1, void 0, void 0, void 0, _m10, null, __s);
|
|
50
48
|
} else {
|
|
51
|
-
|
|
49
|
+
setSelectValue(_b.g, value);
|
|
52
50
|
setEventHandler(_b.g, "$$change", (event) => {
|
|
53
51
|
const nextValue = event.target.value;
|
|
54
52
|
if (!controlled) setInternalValue(nextValue);
|
|
55
53
|
props.onChange?.(nextValue);
|
|
56
54
|
});
|
|
57
55
|
}
|
|
58
|
-
_b.a =
|
|
56
|
+
_b.a = setClassNameIfChanged(props.className, _b.a, _b.b);
|
|
59
57
|
{
|
|
60
58
|
const _v = props.style;
|
|
61
59
|
if (_b.c !== _v) {
|
|
@@ -63,12 +61,16 @@ var Select = /* @__PURE__ */ __s(function Select(props, __s, __extra) {
|
|
|
63
61
|
_b.c = _v;
|
|
64
62
|
}
|
|
65
63
|
}
|
|
66
|
-
_b.d =
|
|
67
|
-
_b.f =
|
|
68
|
-
_b.h =
|
|
69
|
-
_b.i =
|
|
70
|
-
_b.
|
|
71
|
-
|
|
64
|
+
_b.d = setPlainAttributeIfChanged(labelId, _b.d, _b.e, "id");
|
|
65
|
+
_b.f = setPlainAttributeIfChanged(props.id, _b.f, _b.g, "id");
|
|
66
|
+
_b.h = setAriaAttributeIfChanged(props.accessibilityLabel ?? props.label, _b.h, _b.g, "aria-label");
|
|
67
|
+
_b.i = setAriaAttributeIfChanged(labelId, _b.i, _b.g, "aria-labelledby");
|
|
68
|
+
_b.j = setBooleanAttributeIfChanged(props.disabled, _b.j, _b.g, "disabled");
|
|
69
|
+
{
|
|
70
|
+
const _v = props.label;
|
|
71
|
+
_b.l = childTextHoleUpdate(__s, 1, _b.e, _v, _b.l, _b.m);
|
|
72
|
+
_b.m = _v;
|
|
73
|
+
}
|
|
72
74
|
{
|
|
73
75
|
const _v = (__mapItems = props.options, __mapMethod = __mapItems.map, __mapItems);
|
|
74
76
|
const __mapNative = mapSlot(_v, __mapMethod);
|
|
@@ -79,7 +81,7 @@ var Select = /* @__PURE__ */ __s(function Select(props, __s, __extra) {
|
|
|
79
81
|
key: option.value,
|
|
80
82
|
value: option.value,
|
|
81
83
|
disabled: option.disabled
|
|
82
|
-
}, () => option.label), _key$1, __item$2, 27, void 0, _b.
|
|
84
|
+
}, () => option.label), _key$1, __item$2, 27, void 0, _b.k, 1);
|
|
83
85
|
if (__memoCache === __memoCommitted) __memoCache = __memoCache.slice();
|
|
84
86
|
__memoCache[0] = __memoDep;
|
|
85
87
|
__memoCache[1] = __mapNative;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octane-xplat/picker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Select control for Octane xplat — web select + SwiftUI picker (iOS) / Material dropdown (Android)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"android",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@nativescript-community/octane": "0.2.4",
|
|
61
|
-
"@nativescript/core": "9.1.
|
|
61
|
+
"@nativescript/core": "9.1.3",
|
|
62
62
|
"@octanejs/vite-plugin": "0.1.61",
|
|
63
|
-
"octane": "0.
|
|
63
|
+
"octane": "0.10.2",
|
|
64
64
|
"tsrx-typegen": "0.2.2",
|
|
65
65
|
"typescript": "5.9.3",
|
|
66
66
|
"vite": "8.3.0"
|