@tamagui/form 1.110.4 → 1.111.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/cjs/Form.native.js +12 -110
- package/dist/cjs/Form.native.js.map +2 -2
- package/dist/esm/Form.native.js +11 -108
- package/dist/esm/Form.native.js.map +1 -1
- package/dist/esm/Form.native.mjs +52 -0
- package/dist/esm/Form.native.mjs.map +1 -0
- package/dist/esm/index.native.mjs +2 -0
- package/dist/esm/index.native.mjs.map +1 -0
- package/dist/jsx/Form.native.js +11 -108
- package/dist/jsx/Form.native.js.map +1 -1
- package/package.json +10 -10
package/dist/cjs/Form.native.js
CHANGED
|
@@ -22,129 +22,31 @@ __export(Form_exports, {
|
|
|
22
22
|
useFormContext: () => useFormContext
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(Form_exports);
|
|
25
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_core = require("@tamagui/core"), import_create_context = require("@tamagui/create-context"), import_helpers = require("@tamagui/helpers")
|
|
26
|
-
function _array_like_to_array(arr, len) {
|
|
27
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
28
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
29
|
-
return arr2;
|
|
30
|
-
}
|
|
31
|
-
function _array_with_holes(arr) {
|
|
32
|
-
if (Array.isArray(arr)) return arr;
|
|
33
|
-
}
|
|
34
|
-
function _define_property(obj, key, value) {
|
|
35
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
36
|
-
value,
|
|
37
|
-
enumerable: !0,
|
|
38
|
-
configurable: !0,
|
|
39
|
-
writable: !0
|
|
40
|
-
}) : obj[key] = value, obj;
|
|
41
|
-
}
|
|
42
|
-
function _iterable_to_array_limit(arr, i) {
|
|
43
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
44
|
-
if (_i != null) {
|
|
45
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
46
|
-
try {
|
|
47
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
48
|
-
;
|
|
49
|
-
} catch (err) {
|
|
50
|
-
_d = !0, _e = err;
|
|
51
|
-
} finally {
|
|
52
|
-
try {
|
|
53
|
-
!_n && _i.return != null && _i.return();
|
|
54
|
-
} finally {
|
|
55
|
-
if (_d) throw _e;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return _arr;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function _non_iterable_rest() {
|
|
62
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
63
|
-
}
|
|
64
|
-
function _object_spread(target) {
|
|
65
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
66
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
67
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
68
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
69
|
-
}))), ownKeys2.forEach(function(key) {
|
|
70
|
-
_define_property(target, key, source[key]);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
return target;
|
|
74
|
-
}
|
|
75
|
-
function ownKeys(object, enumerableOnly) {
|
|
76
|
-
var keys = Object.keys(object);
|
|
77
|
-
if (Object.getOwnPropertySymbols) {
|
|
78
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
79
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
80
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
81
|
-
})), keys.push.apply(keys, symbols);
|
|
82
|
-
}
|
|
83
|
-
return keys;
|
|
84
|
-
}
|
|
85
|
-
function _object_spread_props(target, source) {
|
|
86
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
87
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
88
|
-
}), target;
|
|
89
|
-
}
|
|
90
|
-
function _object_without_properties(source, excluded) {
|
|
91
|
-
if (source == null) return {};
|
|
92
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
93
|
-
if (Object.getOwnPropertySymbols) {
|
|
94
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
95
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
96
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
97
|
-
}
|
|
98
|
-
return target;
|
|
99
|
-
}
|
|
100
|
-
function _object_without_properties_loose(source, excluded) {
|
|
101
|
-
if (source == null) return {};
|
|
102
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
103
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
104
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
105
|
-
return target;
|
|
106
|
-
}
|
|
107
|
-
function _sliced_to_array(arr, i) {
|
|
108
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
109
|
-
}
|
|
110
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
111
|
-
if (o) {
|
|
112
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
113
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
114
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
115
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
var FORM_NAME = "Form", FormFrame = (0, import_core.styled)(import_core.Stack, {
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_core = require("@tamagui/core"), import_create_context = require("@tamagui/create-context"), import_helpers = require("@tamagui/helpers"), FORM_NAME = "Form", FormFrame = (0, import_core.styled)(import_core.Stack, {
|
|
119
26
|
name: FORM_NAME,
|
|
120
27
|
tag: "form"
|
|
121
|
-
}),
|
|
28
|
+
}), [createFormContext] = (0, import_create_context.createContextScope)(FORM_NAME), [FormProvider, useFormContext] = createFormContext(FORM_NAME), TRIGGER_NAME = "FormTrigger", FormTriggerFrame = (0, import_core.styled)(import_core.View, {
|
|
122
29
|
name: TRIGGER_NAME
|
|
123
30
|
}), FormTrigger = FormTriggerFrame.styleable(function(props, forwardedRef) {
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
]), context = useFormContext(TRIGGER_NAME, __scopeForm);
|
|
129
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormTriggerFrame, _object_spread_props(_object_spread({
|
|
130
|
-
tag: "button"
|
|
131
|
-
}, triggerProps), {
|
|
31
|
+
var { __scopeForm, children, onPress, ...triggerProps } = props, context = useFormContext(TRIGGER_NAME, __scopeForm);
|
|
32
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormTriggerFrame, {
|
|
33
|
+
tag: "button",
|
|
34
|
+
...triggerProps,
|
|
132
35
|
ref: forwardedRef,
|
|
133
36
|
onPress: (0, import_helpers.composeEventHandlers)(onPress, context.onSubmit),
|
|
134
37
|
children
|
|
135
|
-
})
|
|
136
|
-
}), FormComponent = FormFrame.extractable(function(
|
|
137
|
-
var
|
|
138
|
-
"onSubmit"
|
|
139
|
-
]);
|
|
38
|
+
});
|
|
39
|
+
}), FormComponent = FormFrame.extractable(function(param) {
|
|
40
|
+
var { onSubmit, ...props } = param;
|
|
140
41
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormProvider, {
|
|
141
42
|
scope: props.__scopeForm,
|
|
142
43
|
onSubmit,
|
|
143
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormFrame,
|
|
44
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormFrame, {
|
|
45
|
+
...props,
|
|
144
46
|
onSubmit: function(e) {
|
|
145
47
|
return e.preventDefault();
|
|
146
48
|
}
|
|
147
|
-
})
|
|
49
|
+
})
|
|
148
50
|
});
|
|
149
51
|
}), Form2 = (0, import_helpers.withStaticProperties)(FormComponent, {
|
|
150
52
|
Trigger: FormTrigger
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/form/src/Form.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;uDACA,cAAoC,0BAEpC,wBAAmC,oCACnC,iBAA2D
|
|
5
|
-
"names": ["FORM_NAME", "FormFrame", "styled", "Stack", "name", "tag", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;uDACA,cAAoC,0BAEpC,wBAAmC,oCACnC,iBAA2D,6BAErDA,YAAY,QAELC,gBAAYC,oBAAOC,mBAAO;EACrCC,MAAMJ;EACNK,KAAK;AACP,CAAA,GAOM,CAACC,iBAAAA,QAAqBC,0CAAmBP,SAAAA,GAMlC,CAACQ,cAAcC,cAAAA,IAC1BH,kBAAoCN,SAAAA,GAUhCU,eAAe,eAEfC,uBAAmBT,oBAAOU,kBAAM;EACpCR,MAAMM;AACR,CAAA,GAIaG,cAAcF,iBAAiBG,UAC1C,SAACC,OAAsCC,cAAAA;AACrC,MAAM,EAAEC,aAAaC,UAAUC,SAAS,GAAGC,aAAAA,IAAiBL,OACtDM,UAAUZ,eAAeC,cAAcO,WAAAA;AAE7C,SACE,uCAAAK,KAACX,kBAAAA;IACCN,KAAI;IACH,GAAIe;IACLG,KAAKP;IACLG,aAASK,qCAAqBL,SAAgBE,QAAQI,QAAQ;;;AAKpE,CAAA,GAOIC,gBAAgBzB,UAAU0B,YAAY,SAAc,OAGjC;MAHiC,EACxDF,UACA,GAAGV,MAAAA,IAFqD;AAIxD,SACE,uCAAAO,KAACd,cAAAA;IAAaoB,OAAOb,MAAME;IAAaQ;cACtC,uCAAAH,KAACrB,WAAAA;MAAW,GAAIc;MAAeU,UAAU,SAACI,GAAAA;eAAWA,EAAEC,eAAc;;;;AAG3E,CAAA,GAEaC,YAAOC,qCAAqBN,eAAe;EACtDO,SAASpB;AACX,CAAA;",
|
|
5
|
+
"names": ["FORM_NAME", "FormFrame", "styled", "Stack", "name", "tag", "createFormContext", "createContextScope", "FormProvider", "useFormContext", "TRIGGER_NAME", "FormTriggerFrame", "View", "FormTrigger", "styleable", "props", "forwardedRef", "__scopeForm", "children", "onPress", "triggerProps", "context", "_jsx", "ref", "composeEventHandlers", "onSubmit", "FormComponent", "extractable", "scope", "e", "preventDefault", "Form", "withStaticProperties", "Trigger"]
|
|
6
6
|
}
|
package/dist/esm/Form.native.js
CHANGED
|
@@ -2,128 +2,31 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Stack, View, styled } from "@tamagui/core";
|
|
3
3
|
import { createContextScope } from "@tamagui/create-context";
|
|
4
4
|
import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
|
|
5
|
-
function _array_like_to_array(arr, len) {
|
|
6
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
7
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
8
|
-
return arr2;
|
|
9
|
-
}
|
|
10
|
-
function _array_with_holes(arr) {
|
|
11
|
-
if (Array.isArray(arr)) return arr;
|
|
12
|
-
}
|
|
13
|
-
function _define_property(obj, key, value) {
|
|
14
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
15
|
-
value,
|
|
16
|
-
enumerable: !0,
|
|
17
|
-
configurable: !0,
|
|
18
|
-
writable: !0
|
|
19
|
-
}) : obj[key] = value, obj;
|
|
20
|
-
}
|
|
21
|
-
function _iterable_to_array_limit(arr, i) {
|
|
22
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
23
|
-
if (_i != null) {
|
|
24
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
25
|
-
try {
|
|
26
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
27
|
-
;
|
|
28
|
-
} catch (err) {
|
|
29
|
-
_d = !0, _e = err;
|
|
30
|
-
} finally {
|
|
31
|
-
try {
|
|
32
|
-
!_n && _i.return != null && _i.return();
|
|
33
|
-
} finally {
|
|
34
|
-
if (_d) throw _e;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return _arr;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function _non_iterable_rest() {
|
|
41
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
42
|
-
}
|
|
43
|
-
function _object_spread(target) {
|
|
44
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
45
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
46
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
47
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
48
|
-
}))), ownKeys2.forEach(function(key) {
|
|
49
|
-
_define_property(target, key, source[key]);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return target;
|
|
53
|
-
}
|
|
54
|
-
function ownKeys(object, enumerableOnly) {
|
|
55
|
-
var keys = Object.keys(object);
|
|
56
|
-
if (Object.getOwnPropertySymbols) {
|
|
57
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
58
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
59
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
60
|
-
})), keys.push.apply(keys, symbols);
|
|
61
|
-
}
|
|
62
|
-
return keys;
|
|
63
|
-
}
|
|
64
|
-
function _object_spread_props(target, source) {
|
|
65
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
66
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
67
|
-
}), target;
|
|
68
|
-
}
|
|
69
|
-
function _object_without_properties(source, excluded) {
|
|
70
|
-
if (source == null) return {};
|
|
71
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
72
|
-
if (Object.getOwnPropertySymbols) {
|
|
73
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
74
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
75
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
76
|
-
}
|
|
77
|
-
return target;
|
|
78
|
-
}
|
|
79
|
-
function _object_without_properties_loose(source, excluded) {
|
|
80
|
-
if (source == null) return {};
|
|
81
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
82
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
83
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
84
|
-
return target;
|
|
85
|
-
}
|
|
86
|
-
function _sliced_to_array(arr, i) {
|
|
87
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
88
|
-
}
|
|
89
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
90
|
-
if (o) {
|
|
91
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
92
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
93
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
94
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
5
|
var FORM_NAME = "Form", FormFrame = styled(Stack, {
|
|
98
6
|
name: FORM_NAME,
|
|
99
7
|
tag: "form"
|
|
100
|
-
}),
|
|
8
|
+
}), [createFormContext] = createContextScope(FORM_NAME), [FormProvider, useFormContext] = createFormContext(FORM_NAME), TRIGGER_NAME = "FormTrigger", FormTriggerFrame = styled(View, {
|
|
101
9
|
name: TRIGGER_NAME
|
|
102
10
|
}), FormTrigger = FormTriggerFrame.styleable(function(props, forwardedRef) {
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
]), context = useFormContext(TRIGGER_NAME, __scopeForm);
|
|
108
|
-
return /* @__PURE__ */ _jsx(FormTriggerFrame, _object_spread_props(_object_spread({
|
|
109
|
-
tag: "button"
|
|
110
|
-
}, triggerProps), {
|
|
11
|
+
var { __scopeForm, children, onPress, ...triggerProps } = props, context = useFormContext(TRIGGER_NAME, __scopeForm);
|
|
12
|
+
return /* @__PURE__ */ _jsx(FormTriggerFrame, {
|
|
13
|
+
tag: "button",
|
|
14
|
+
...triggerProps,
|
|
111
15
|
ref: forwardedRef,
|
|
112
16
|
onPress: composeEventHandlers(onPress, context.onSubmit),
|
|
113
17
|
children
|
|
114
|
-
})
|
|
115
|
-
}), FormComponent = FormFrame.extractable(function(
|
|
116
|
-
var
|
|
117
|
-
"onSubmit"
|
|
118
|
-
]);
|
|
18
|
+
});
|
|
19
|
+
}), FormComponent = FormFrame.extractable(function(param) {
|
|
20
|
+
var { onSubmit, ...props } = param;
|
|
119
21
|
return /* @__PURE__ */ _jsx(FormProvider, {
|
|
120
22
|
scope: props.__scopeForm,
|
|
121
23
|
onSubmit,
|
|
122
|
-
children: /* @__PURE__ */ _jsx(FormFrame,
|
|
24
|
+
children: /* @__PURE__ */ _jsx(FormFrame, {
|
|
25
|
+
...props,
|
|
123
26
|
onSubmit: function(e) {
|
|
124
27
|
return e.preventDefault();
|
|
125
28
|
}
|
|
126
|
-
})
|
|
29
|
+
})
|
|
127
30
|
});
|
|
128
31
|
}), Form2 = withStaticProperties(FormComponent, {
|
|
129
32
|
Trigger: FormTrigger
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/form/src/Form.tsx"],
|
|
4
|
-
"mappings": ";AACA,SAASA,OAAOC,MAAMC,cAAc;AAEpC,SAASC,0BAA0B;AACnC,SAASC,sBAAsBC,4BAA4B
|
|
4
|
+
"mappings": ";AACA,SAASA,OAAOC,MAAMC,cAAc;AAEpC,SAASC,0BAA0B;AACnC,SAASC,sBAAsBC,4BAA4B;AAE3D,IAAMC,YAAY,QAELC,YAAYL,OAAOF,OAAO;EACrCQ,MAAMF;EACNG,KAAK;AACP,CAAA,GAOM,CAACC,iBAAAA,IAAqBP,mBAAmBG,SAAAA,GAMlC,CAACK,cAAcC,cAAAA,IAC1BF,kBAAoCJ,SAAAA,GAUhCO,eAAe,eAEfC,mBAAmBZ,OAAOD,MAAM;EACpCO,MAAMK;AACR,CAAA,GAIaE,cAAcD,iBAAiBE,UAC1C,SAACC,OAAsCC,cAAAA;AACrC,MAAM,EAAEC,aAAaC,UAAUC,SAAS,GAAGC,aAAAA,IAAiBL,OACtDM,UAAUX,eAAeC,cAAcM,WAAAA;AAE7C,SACE,qBAACL,kBAAAA;IACCL,KAAI;IACH,GAAIa;IACLE,KAAKN;IACLG,SAASjB,qBAAqBiB,SAAgBE,QAAQE,QAAQ;;;AAKpE,CAAA,GAOIC,gBAAgBnB,UAAUoB,YAAY,SAAc,OAGjC;MAHiC,EACxDF,UACA,GAAGR,MAAAA,IAFqD;AAIxD,SACE,qBAACN,cAAAA;IAAaiB,OAAOX,MAAME;IAAaM;cACtC,qBAAClB,WAAAA;MAAW,GAAIU;MAAeQ,UAAU,SAACI,GAAAA;eAAWA,EAAEC,eAAc;;;;AAG3E,CAAA,GAEaC,QAAO1B,qBAAqBqB,eAAe;EACtDM,SAASjB;AACX,CAAA;",
|
|
5
5
|
"names": ["Stack", "View", "styled", "createContextScope", "composeEventHandlers", "withStaticProperties", "FORM_NAME", "FormFrame", "name", "tag", "createFormContext", "FormProvider", "useFormContext", "TRIGGER_NAME", "FormTriggerFrame", "FormTrigger", "styleable", "props", "forwardedRef", "__scopeForm", "children", "onPress", "triggerProps", "context", "ref", "onSubmit", "FormComponent", "extractable", "scope", "e", "preventDefault", "Form", "Trigger"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, View, styled } from "@tamagui/core";
|
|
3
|
+
import { createContextScope } from "@tamagui/create-context";
|
|
4
|
+
import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
|
|
5
|
+
var FORM_NAME = "Form",
|
|
6
|
+
FormFrame = styled(Stack, {
|
|
7
|
+
name: FORM_NAME,
|
|
8
|
+
tag: "form"
|
|
9
|
+
}),
|
|
10
|
+
[createFormContext] = createContextScope(FORM_NAME),
|
|
11
|
+
[FormProvider, useFormContext] = createFormContext(FORM_NAME),
|
|
12
|
+
TRIGGER_NAME = "FormTrigger",
|
|
13
|
+
FormTriggerFrame = styled(View, {
|
|
14
|
+
name: TRIGGER_NAME
|
|
15
|
+
}),
|
|
16
|
+
FormTrigger = FormTriggerFrame.styleable(function (props, forwardedRef) {
|
|
17
|
+
var {
|
|
18
|
+
__scopeForm,
|
|
19
|
+
children,
|
|
20
|
+
onPress,
|
|
21
|
+
...triggerProps
|
|
22
|
+
} = props,
|
|
23
|
+
context = useFormContext(TRIGGER_NAME, __scopeForm);
|
|
24
|
+
return /* @__PURE__ */_jsx(FormTriggerFrame, {
|
|
25
|
+
tag: "button",
|
|
26
|
+
...triggerProps,
|
|
27
|
+
ref: forwardedRef,
|
|
28
|
+
onPress: composeEventHandlers(onPress, context.onSubmit),
|
|
29
|
+
children
|
|
30
|
+
});
|
|
31
|
+
}),
|
|
32
|
+
FormComponent = FormFrame.extractable(function (param) {
|
|
33
|
+
var {
|
|
34
|
+
onSubmit,
|
|
35
|
+
...props
|
|
36
|
+
} = param;
|
|
37
|
+
return /* @__PURE__ */_jsx(FormProvider, {
|
|
38
|
+
scope: props.__scopeForm,
|
|
39
|
+
onSubmit,
|
|
40
|
+
children: /* @__PURE__ */_jsx(FormFrame, {
|
|
41
|
+
...props,
|
|
42
|
+
onSubmit: function (e) {
|
|
43
|
+
return e.preventDefault();
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}),
|
|
48
|
+
Form2 = withStaticProperties(FormComponent, {
|
|
49
|
+
Trigger: FormTrigger
|
|
50
|
+
});
|
|
51
|
+
export { Form2 as Form, FormFrame, FormProvider, FormTrigger, useFormContext };
|
|
52
|
+
//# sourceMappingURL=Form.native.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["jsx","_jsx","Stack","View","styled","createContextScope","composeEventHandlers","withStaticProperties","FORM_NAME","FormFrame","name","tag","createFormContext","FormProvider","useFormContext","TRIGGER_NAME","FormTriggerFrame","FormTrigger","styleable","props","forwardedRef","__scopeForm","children","onPress","triggerProps","context","ref","onSubmit","FormComponent","extractable","param","scope","e","preventDefault","Form2"],"sources":["../../src/Form.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,GAAA,IAAOC,IAAA,QAAM,mBAAc;AAEpC,SAASC,KAAA,EAAAC,IAAA,EAAAC,MAAA,QAA0B;AACnC,SAASC,kBAAA,QAAsB,yBAA4B;AA6CrD,SAAAC,oBAAA,EAAAC,oBAAA;AA3CN,IAAAC,SAAM,SAAY;EAAAC,SAEL,GAAAL,MAAY,CAAAF,KAAO;IAC9BQ,IAAA,EAAMF,SAAA;IACNG,GAAA,EAAK;EACP,CAAC;EAOK,CAACC,iBAAiB,IAAIP,kBAAA,CAAmBG,SAAS;EAM3C,CAACK,YAAA,EAAcC,cAAc,IACxCF,iBAAA,CAAoCJ,SAAS;EAUzCO,YAAA,GAAe;EAEfC,gBAAA,GAAmBZ,MAAA,CAAOD,IAAA,EAAM;IACpCO,IAAA,EAAMK;EACR,CAAC;EAIYE,WAAA,GAAcD,gBAAA,CAAiBE,SAAA,WAAAC,KAAA,EAAAC,YAAA;IAC1C,IAAC;QAAAC,WAAsC;QAAAC,QAAiB;QAAAC,OAAA;QAAA,GAAAC;MAAA,IAAAL,KAAA;MAAAM,OAAA,GAAAX,cAAA,CAAAC,YAAA,EAAAM,WAAA;IACtD,sBAAqBpB,IAAA,CAAAe,gBAAmB,EAAG;MAG3CL,GAAA,UACE;MAAA,GAACa,YAAA;MAAAE,GAAA,EAAAN,YAAA;MAAAG,OACC,EAAIjB,oBAAA,CAAAiB,OAAA,EAAAE,OAAA,CAAAE,QAAA;MAAAL;IACC;EACA;EAAAM,aACI,GAAAnB,SAAA,CAAAoB,WAAqB,WAAgBC,KAAQ;IAAQ;MAE7DH,QAAA;MAAA,GAAAR;IAAA,IAAAW,KAAA;IAAA,sBAAA7B,IAAA,CAAAY,YAAA;MACHkB,KAAA,EAAAZ,KAAA,CAAAE,WAAA;MAEJM,QAAA;MAOIL,QAAA,iBAA0BrB,IAAA,CAAAQ,SAAY;QAC1C,GAAAU,KAAA;QACGQ,QAAA,WAAAA,CAAAK,CAAA;UACsB,OAAAA,CAAA,CAAAC,cAAA;QACzB;MAOW;IACX;EACF,CAAC;EAAAC,KAAA,GAAA3B,oBAAA,CAAAqB,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
package/dist/jsx/Form.native.js
CHANGED
|
@@ -2,128 +2,31 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Stack, View, styled } from "@tamagui/core";
|
|
3
3
|
import { createContextScope } from "@tamagui/create-context";
|
|
4
4
|
import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
|
|
5
|
-
function _array_like_to_array(arr, len) {
|
|
6
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
7
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
8
|
-
return arr2;
|
|
9
|
-
}
|
|
10
|
-
function _array_with_holes(arr) {
|
|
11
|
-
if (Array.isArray(arr)) return arr;
|
|
12
|
-
}
|
|
13
|
-
function _define_property(obj, key, value) {
|
|
14
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
15
|
-
value,
|
|
16
|
-
enumerable: !0,
|
|
17
|
-
configurable: !0,
|
|
18
|
-
writable: !0
|
|
19
|
-
}) : obj[key] = value, obj;
|
|
20
|
-
}
|
|
21
|
-
function _iterable_to_array_limit(arr, i) {
|
|
22
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
23
|
-
if (_i != null) {
|
|
24
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
25
|
-
try {
|
|
26
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
27
|
-
;
|
|
28
|
-
} catch (err) {
|
|
29
|
-
_d = !0, _e = err;
|
|
30
|
-
} finally {
|
|
31
|
-
try {
|
|
32
|
-
!_n && _i.return != null && _i.return();
|
|
33
|
-
} finally {
|
|
34
|
-
if (_d) throw _e;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return _arr;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function _non_iterable_rest() {
|
|
41
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
42
|
-
}
|
|
43
|
-
function _object_spread(target) {
|
|
44
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
45
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
46
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
47
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
48
|
-
}))), ownKeys2.forEach(function(key) {
|
|
49
|
-
_define_property(target, key, source[key]);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return target;
|
|
53
|
-
}
|
|
54
|
-
function ownKeys(object, enumerableOnly) {
|
|
55
|
-
var keys = Object.keys(object);
|
|
56
|
-
if (Object.getOwnPropertySymbols) {
|
|
57
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
58
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
59
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
60
|
-
})), keys.push.apply(keys, symbols);
|
|
61
|
-
}
|
|
62
|
-
return keys;
|
|
63
|
-
}
|
|
64
|
-
function _object_spread_props(target, source) {
|
|
65
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
66
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
67
|
-
}), target;
|
|
68
|
-
}
|
|
69
|
-
function _object_without_properties(source, excluded) {
|
|
70
|
-
if (source == null) return {};
|
|
71
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
72
|
-
if (Object.getOwnPropertySymbols) {
|
|
73
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
74
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
75
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
76
|
-
}
|
|
77
|
-
return target;
|
|
78
|
-
}
|
|
79
|
-
function _object_without_properties_loose(source, excluded) {
|
|
80
|
-
if (source == null) return {};
|
|
81
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
82
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
83
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
84
|
-
return target;
|
|
85
|
-
}
|
|
86
|
-
function _sliced_to_array(arr, i) {
|
|
87
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
88
|
-
}
|
|
89
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
90
|
-
if (o) {
|
|
91
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
92
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
93
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
94
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
5
|
var FORM_NAME = "Form", FormFrame = styled(Stack, {
|
|
98
6
|
name: FORM_NAME,
|
|
99
7
|
tag: "form"
|
|
100
|
-
}),
|
|
8
|
+
}), [createFormContext] = createContextScope(FORM_NAME), [FormProvider, useFormContext] = createFormContext(FORM_NAME), TRIGGER_NAME = "FormTrigger", FormTriggerFrame = styled(View, {
|
|
101
9
|
name: TRIGGER_NAME
|
|
102
10
|
}), FormTrigger = FormTriggerFrame.styleable(function(props, forwardedRef) {
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
]), context = useFormContext(TRIGGER_NAME, __scopeForm);
|
|
108
|
-
return /* @__PURE__ */ _jsx(FormTriggerFrame, _object_spread_props(_object_spread({
|
|
109
|
-
tag: "button"
|
|
110
|
-
}, triggerProps), {
|
|
11
|
+
var { __scopeForm, children, onPress, ...triggerProps } = props, context = useFormContext(TRIGGER_NAME, __scopeForm);
|
|
12
|
+
return /* @__PURE__ */ _jsx(FormTriggerFrame, {
|
|
13
|
+
tag: "button",
|
|
14
|
+
...triggerProps,
|
|
111
15
|
ref: forwardedRef,
|
|
112
16
|
onPress: composeEventHandlers(onPress, context.onSubmit),
|
|
113
17
|
children
|
|
114
|
-
})
|
|
115
|
-
}), FormComponent = FormFrame.extractable(function(
|
|
116
|
-
var
|
|
117
|
-
"onSubmit"
|
|
118
|
-
]);
|
|
18
|
+
});
|
|
19
|
+
}), FormComponent = FormFrame.extractable(function(param) {
|
|
20
|
+
var { onSubmit, ...props } = param;
|
|
119
21
|
return /* @__PURE__ */ _jsx(FormProvider, {
|
|
120
22
|
scope: props.__scopeForm,
|
|
121
23
|
onSubmit,
|
|
122
|
-
children: /* @__PURE__ */ _jsx(FormFrame,
|
|
24
|
+
children: /* @__PURE__ */ _jsx(FormFrame, {
|
|
25
|
+
...props,
|
|
123
26
|
onSubmit: function(e) {
|
|
124
27
|
return e.preventDefault();
|
|
125
28
|
}
|
|
126
|
-
})
|
|
29
|
+
})
|
|
127
30
|
});
|
|
128
31
|
}), Form2 = withStaticProperties(FormComponent, {
|
|
129
32
|
Trigger: FormTrigger
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/form/src/Form.tsx"],
|
|
4
|
-
"mappings": ";AACA,SAASA,OAAOC,MAAMC,cAAc;AAEpC,SAASC,0BAA0B;AACnC,SAASC,sBAAsBC,4BAA4B
|
|
4
|
+
"mappings": ";AACA,SAASA,OAAOC,MAAMC,cAAc;AAEpC,SAASC,0BAA0B;AACnC,SAASC,sBAAsBC,4BAA4B;AAE3D,IAAMC,YAAY,QAELC,YAAYL,OAAOF,OAAO;EACrCQ,MAAMF;EACNG,KAAK;AACP,CAAA,GAOM,CAACC,iBAAAA,IAAqBP,mBAAmBG,SAAAA,GAMlC,CAACK,cAAcC,cAAAA,IAC1BF,kBAAoCJ,SAAAA,GAUhCO,eAAe,eAEfC,mBAAmBZ,OAAOD,MAAM;EACpCO,MAAMK;AACR,CAAA,GAIaE,cAAcD,iBAAiBE,UAC1C,SAACC,OAAsCC,cAAAA;AACrC,MAAM,EAAEC,aAAaC,UAAUC,SAAS,GAAGC,aAAAA,IAAiBL,OACtDM,UAAUX,eAAeC,cAAcM,WAAAA;AAE7C,SACE,qBAACL,kBAAAA;IACCL,KAAI;IACH,GAAIa;IACLE,KAAKN;IACLG,SAASjB,qBAAqBiB,SAAgBE,QAAQE,QAAQ;;;AAKpE,CAAA,GAOIC,gBAAgBnB,UAAUoB,YAAY,SAAc,OAGjC;MAHiC,EACxDF,UACA,GAAGR,MAAAA,IAFqD;AAIxD,SACE,qBAACN,cAAAA;IAAaiB,OAAOX,MAAME;IAAaM;cACtC,qBAAClB,WAAAA;MAAW,GAAIU;MAAeQ,UAAU,SAACI,GAAAA;eAAWA,EAAEC,eAAc;;;;AAG3E,CAAA,GAEaC,QAAO1B,qBAAqBqB,eAAe;EACtDM,SAASjB;AACX,CAAA;",
|
|
5
5
|
"names": ["Stack", "View", "styled", "createContextScope", "composeEventHandlers", "withStaticProperties", "FORM_NAME", "FormFrame", "name", "tag", "createFormContext", "FormProvider", "useFormContext", "TRIGGER_NAME", "FormTriggerFrame", "FormTrigger", "styleable", "props", "forwardedRef", "__scopeForm", "children", "onPress", "triggerProps", "context", "ref", "onSubmit", "FormComponent", "extractable", "scope", "e", "preventDefault", "Form", "Trigger"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/form",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.111.0",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tamagui/compose-refs": "1.
|
|
37
|
-
"@tamagui/core": "1.
|
|
38
|
-
"@tamagui/create-context": "1.
|
|
39
|
-
"@tamagui/focusable": "1.
|
|
40
|
-
"@tamagui/get-button-sized": "1.
|
|
41
|
-
"@tamagui/get-font-sized": "1.
|
|
42
|
-
"@tamagui/helpers": "1.
|
|
43
|
-
"@tamagui/text": "1.
|
|
36
|
+
"@tamagui/compose-refs": "1.111.0",
|
|
37
|
+
"@tamagui/core": "1.111.0",
|
|
38
|
+
"@tamagui/create-context": "1.111.0",
|
|
39
|
+
"@tamagui/focusable": "1.111.0",
|
|
40
|
+
"@tamagui/get-button-sized": "1.111.0",
|
|
41
|
+
"@tamagui/get-font-sized": "1.111.0",
|
|
42
|
+
"@tamagui/helpers": "1.111.0",
|
|
43
|
+
"@tamagui/text": "1.111.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@tamagui/build": "1.
|
|
46
|
+
"@tamagui/build": "1.111.0",
|
|
47
47
|
"react": "^18.2.0 || ^19.0.0"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|