@tamagui/slider 2.7.7 → 3.0.0-beta.643.1
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/Slider.cjs +455 -512
- package/dist/cjs/Slider.native.cjs +469 -0
- package/dist/cjs/Slider.native.js +424 -498
- package/dist/cjs/Slider.native.js.map +1 -1
- package/dist/cjs/SliderImpl.cjs +111 -128
- package/dist/cjs/SliderImpl.native.cjs +154 -0
- package/dist/cjs/SliderImpl.native.js +127 -143
- package/dist/cjs/SliderImpl.native.js.map +1 -1
- package/dist/cjs/constants.cjs +59 -45
- package/dist/cjs/constants.native.cjs +79 -0
- package/dist/cjs/constants.native.js +59 -44
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/helpers.cjs +59 -60
- package/dist/cjs/helpers.native.cjs +99 -0
- package/dist/cjs/helpers.native.js +66 -68
- package/dist/cjs/helpers.native.js.map +1 -1
- package/dist/cjs/index.cjs +16 -17
- package/dist/cjs/index.native.cjs +33 -0
- package/dist/cjs/index.native.js +16 -16
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/types.cjs +10 -11
- package/dist/cjs/types.native.cjs +19 -0
- package/dist/cjs/types.native.js +10 -10
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/Slider.mjs +427 -474
- package/dist/esm/Slider.mjs.map +1 -1
- package/dist/esm/Slider.native.js +396 -463
- package/dist/esm/Slider.native.js.map +1 -1
- package/dist/esm/SliderImpl.mjs +92 -102
- package/dist/esm/SliderImpl.mjs.map +1 -1
- package/dist/esm/SliderImpl.native.js +109 -119
- package/dist/esm/SliderImpl.native.js.map +1 -1
- package/dist/esm/constants.mjs +38 -21
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/constants.native.js +38 -21
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/helpers.mjs +37 -36
- package/dist/esm/helpers.mjs.map +1 -1
- package/dist/esm/helpers.native.js +44 -45
- package/dist/esm/helpers.native.js.map +1 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.mjs +4 -3
- package/dist/esm/index.native.js +4 -3
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.native.js +0 -2
- package/dist/jsx/Slider.mjs +427 -474
- package/dist/jsx/Slider.mjs.map +1 -1
- package/dist/jsx/Slider.native.cjs +469 -0
- package/dist/jsx/Slider.native.js +424 -498
- package/dist/jsx/Slider.native.js.map +1 -1
- package/dist/jsx/SliderImpl.mjs +92 -102
- package/dist/jsx/SliderImpl.mjs.map +1 -1
- package/dist/jsx/SliderImpl.native.cjs +154 -0
- package/dist/jsx/SliderImpl.native.js +127 -143
- package/dist/jsx/SliderImpl.native.js.map +1 -1
- package/dist/jsx/constants.mjs +38 -21
- package/dist/jsx/constants.mjs.map +1 -1
- package/dist/jsx/constants.native.cjs +79 -0
- package/dist/jsx/constants.native.js +59 -44
- package/dist/jsx/constants.native.js.map +1 -1
- package/dist/jsx/helpers.mjs +37 -36
- package/dist/jsx/helpers.mjs.map +1 -1
- package/dist/jsx/helpers.native.cjs +99 -0
- package/dist/jsx/helpers.native.js +66 -68
- package/dist/jsx/helpers.native.js.map +1 -1
- package/dist/jsx/index.js +4 -3
- package/dist/jsx/index.mjs +4 -3
- package/dist/jsx/index.native.cjs +33 -0
- package/dist/jsx/index.native.js +16 -16
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/types.mjs +0 -2
- package/dist/jsx/types.native.cjs +19 -0
- package/dist/jsx/types.native.js +10 -10
- package/dist/jsx/types.native.js.map +1 -1
- package/package.json +15 -14
- package/src/Slider.tsx +126 -171
- package/src/SliderImpl.tsx +3 -2
- package/src/constants.tsx +16 -6
- package/src/types.ts +6 -4
- package/types/Slider.d.ts +218 -200
- package/types/Slider.d.ts.map +1 -1
- package/types/SliderImpl.d.ts +16 -5
- package/types/SliderImpl.d.ts.map +1 -1
- package/types/constants.d.ts +10 -10
- package/types/constants.d.ts.map +1 -1
- package/types/helpers.d.ts.map +1 -1
- package/types/types.d.ts +6 -4
- package/types/types.d.ts.map +1 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/types.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/types.mjs.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __create = Object.create;
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -7,166 +8,149 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
10
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
14
15
|
};
|
|
15
16
|
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: () => from[key],
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
23
24
|
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: true
|
|
32
28
|
}) : target, mod));
|
|
33
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
}), mod);
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
30
|
var SliderImpl_exports = {};
|
|
37
31
|
__export(SliderImpl_exports, {
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
SliderFrame: () => SliderFrame,
|
|
33
|
+
SliderImpl: () => SliderImpl
|
|
40
34
|
});
|
|
41
35
|
module.exports = __toCommonJS(SliderImpl_exports);
|
|
42
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
-
var import_constants = require("@tamagui/constants");
|
|
44
37
|
var import_core = require("@tamagui/core");
|
|
38
|
+
var import_constants = require("@tamagui/constants");
|
|
39
|
+
var import_core2 = require("@tamagui/core");
|
|
45
40
|
var import_get_token = require("@tamagui/get-token");
|
|
46
41
|
var import_stacks = require("@tamagui/stacks");
|
|
47
42
|
var React = __toESM(require("react"), 1);
|
|
48
43
|
var import_react_native = require("react-native");
|
|
49
44
|
var import_constants2 = require("./constants.native.js");
|
|
50
45
|
function _instanceof(left, right) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
47
|
+
return !!right[Symbol.hasInstance](left);
|
|
48
|
+
} else {
|
|
49
|
+
return left instanceof right;
|
|
50
|
+
}
|
|
56
51
|
}
|
|
57
|
-
var SliderFrame = (0,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
52
|
+
var SliderFrame = (0, import_core2.styled)(import_stacks.YStack, {
|
|
53
|
+
position: "relative",
|
|
54
|
+
variants: {
|
|
55
|
+
orientation: {
|
|
56
|
+
horizontal: {},
|
|
57
|
+
vertical: {}
|
|
58
|
+
},
|
|
59
|
+
size: function(val, extras) {
|
|
60
|
+
if (!val) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
var orientation = extras.props["orientation"];
|
|
64
|
+
var size = Math.round((0, import_core2.getVariableValue)((0, import_get_token.getSize)(val)) / 6);
|
|
65
|
+
if (orientation === "horizontal") {
|
|
66
|
+
return {
|
|
67
|
+
height: size,
|
|
68
|
+
borderRadius: size,
|
|
69
|
+
justifyContent: "center"
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
width: size,
|
|
74
|
+
borderRadius: size,
|
|
75
|
+
alignItems: "center"
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
84
79
|
});
|
|
85
|
-
var SliderImpl =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
onResponderGrant: handleResponderGrant,
|
|
161
|
-
onResponderMove: handleResponderMove,
|
|
162
|
-
onResponderRelease: handleResponderRelease,
|
|
163
|
-
style: {
|
|
164
|
-
inset: 0,
|
|
165
|
-
position: "absolute"
|
|
166
|
-
},
|
|
167
|
-
children
|
|
168
|
-
})
|
|
169
|
-
})
|
|
170
|
-
);
|
|
80
|
+
var SliderImpl = (0, import_core.createRefComponent)(function(props, forwardedRef) {
|
|
81
|
+
var { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, children, ...sliderProps } = props;
|
|
82
|
+
var context = (0, import_constants2.useSliderContext)(__scopeSlider);
|
|
83
|
+
var handleResponderGrant = React.useCallback(function(event) {
|
|
84
|
+
var _props_onResponderGrant;
|
|
85
|
+
(_props_onResponderGrant = props.onResponderGrant) === null || _props_onResponderGrant === void 0 ? void 0 : _props_onResponderGrant.call(props, event);
|
|
86
|
+
var target = event.target;
|
|
87
|
+
var thumbIndex = context.thumbs.get(target);
|
|
88
|
+
var isStartingOnThumb = thumbIndex !== void 0;
|
|
89
|
+
if (import_constants.isWeb && _instanceof(target, HTMLElement)) {
|
|
90
|
+
if (context.thumbs.has(target)) {
|
|
91
|
+
target.focus();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (!import_constants.isWeb && isStartingOnThumb) {
|
|
95
|
+
context.valueIndexToChangeRef.current = thumbIndex;
|
|
96
|
+
}
|
|
97
|
+
onSlideStart(event, isStartingOnThumb ? "thumb" : "track");
|
|
98
|
+
}, [
|
|
99
|
+
context,
|
|
100
|
+
onSlideStart,
|
|
101
|
+
props.onResponderGrant
|
|
102
|
+
]);
|
|
103
|
+
var handleResponderMove = React.useCallback(function(event) {
|
|
104
|
+
var _props_onResponderMove;
|
|
105
|
+
(_props_onResponderMove = props.onResponderMove) === null || _props_onResponderMove === void 0 ? void 0 : _props_onResponderMove.call(props, event);
|
|
106
|
+
event.stopPropagation();
|
|
107
|
+
onSlideMove(event);
|
|
108
|
+
}, [onSlideMove, props.onResponderMove]);
|
|
109
|
+
var handleResponderRelease = React.useCallback(function(event) {
|
|
110
|
+
var _props_onResponderRelease;
|
|
111
|
+
(_props_onResponderRelease = props.onResponderRelease) === null || _props_onResponderRelease === void 0 ? void 0 : _props_onResponderRelease.call(props, event);
|
|
112
|
+
onSlideEnd(event);
|
|
113
|
+
}, [onSlideEnd, props.onResponderRelease]);
|
|
114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderFrame, {
|
|
115
|
+
size: "4",
|
|
116
|
+
ref: forwardedRef,
|
|
117
|
+
...sliderProps,
|
|
118
|
+
"data-orientation": sliderProps.orientation,
|
|
119
|
+
...import_constants.isWeb && { onKeyDown: function(event) {
|
|
120
|
+
if (event.key === "Home") {
|
|
121
|
+
onHomeKeyDown(event);
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
} else if (event.key === "End") {
|
|
124
|
+
onEndKeyDown(event);
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
} else if (import_constants2.PAGE_KEYS.concat(import_constants2.ARROW_KEYS).includes(event.key)) {
|
|
127
|
+
onStepKeyDown(event);
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
}
|
|
130
|
+
} },
|
|
131
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {
|
|
132
|
+
onMoveShouldSetResponderCapture: function() {
|
|
133
|
+
return true;
|
|
134
|
+
},
|
|
135
|
+
onMoveShouldSetResponder: function() {
|
|
136
|
+
return true;
|
|
137
|
+
},
|
|
138
|
+
onStartShouldSetResponder: function() {
|
|
139
|
+
return true;
|
|
140
|
+
},
|
|
141
|
+
onResponderTerminationRequest: function() {
|
|
142
|
+
return false;
|
|
143
|
+
},
|
|
144
|
+
onResponderGrant: handleResponderGrant,
|
|
145
|
+
onResponderMove: handleResponderMove,
|
|
146
|
+
onResponderRelease: handleResponderRelease,
|
|
147
|
+
style: {
|
|
148
|
+
inset: 0,
|
|
149
|
+
position: "absolute"
|
|
150
|
+
},
|
|
151
|
+
children
|
|
152
|
+
})
|
|
153
|
+
});
|
|
171
154
|
});
|
|
155
|
+
|
|
172
156
|
//# sourceMappingURL=SliderImpl.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"SliderImpl.native.js","names":[],"sources":["jsx/SliderImpl.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar SliderImpl_exports = {};\n__export(SliderImpl_exports, {\n SliderFrame: () => SliderFrame,\n SliderImpl: () => SliderImpl\n});\nmodule.exports = __toCommonJS(SliderImpl_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core2 = require(\"@tamagui/core\");\nvar import_get_token = require(\"@tamagui/get-token\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_react_native = require(\"react-native\");\nvar import_constants2 = require(\"./constants\");\nfunction _instanceof(left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n}\nvar SliderFrame = (0, import_core2.styled)(import_stacks.YStack, {\n position: \"relative\",\n variants: {\n orientation: {\n horizontal: {},\n vertical: {}\n },\n size: function(val, extras) {\n if (!val) {\n return;\n }\n var orientation = extras.props[\"orientation\"];\n var size = Math.round((0, import_core2.getVariableValue)((0, import_get_token.getSize)(val)) / 6);\n if (orientation === \"horizontal\") {\n return {\n height: size,\n borderRadius: size,\n justifyContent: \"center\"\n };\n }\n return {\n width: size,\n borderRadius: size,\n alignItems: \"center\"\n };\n }\n }\n});\nvar SliderImpl = (0, import_core.createRefComponent)(function(props, forwardedRef) {\n var { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, children, ...sliderProps } = props;\n var context = (0, import_constants2.useSliderContext)(__scopeSlider);\n var handleResponderGrant = React.useCallback(function(event) {\n var _props_onResponderGrant;\n (_props_onResponderGrant = props.onResponderGrant) === null || _props_onResponderGrant === void 0 ? void 0 : _props_onResponderGrant.call(props, event);\n var target = event.target;\n var thumbIndex = context.thumbs.get(target);\n var isStartingOnThumb = thumbIndex !== void 0;\n if (import_constants.isWeb && _instanceof(target, HTMLElement)) {\n if (context.thumbs.has(target)) {\n target.focus();\n }\n }\n if (!import_constants.isWeb && isStartingOnThumb) {\n context.valueIndexToChangeRef.current = thumbIndex;\n }\n onSlideStart(event, isStartingOnThumb ? \"thumb\" : \"track\");\n }, [\n context,\n onSlideStart,\n props.onResponderGrant\n ]);\n var handleResponderMove = React.useCallback(function(event) {\n var _props_onResponderMove;\n (_props_onResponderMove = props.onResponderMove) === null || _props_onResponderMove === void 0 ? void 0 : _props_onResponderMove.call(props, event);\n event.stopPropagation();\n onSlideMove(event);\n }, [\n onSlideMove,\n props.onResponderMove\n ]);\n var handleResponderRelease = React.useCallback(function(event) {\n var _props_onResponderRelease;\n (_props_onResponderRelease = props.onResponderRelease) === null || _props_onResponderRelease === void 0 ? void 0 : _props_onResponderRelease.call(props, event);\n onSlideEnd(event);\n }, [\n onSlideEnd,\n props.onResponderRelease\n ]);\n return (\n // wrap with plain RN View for responder events - tamagui views no longer handle responder events on web\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderFrame, {\n size: \"4\",\n ref: forwardedRef,\n ...sliderProps,\n \"data-orientation\": sliderProps.orientation,\n ...import_constants.isWeb && {\n onKeyDown: function(event) {\n if (event.key === \"Home\") {\n onHomeKeyDown(event);\n event.preventDefault();\n } else if (event.key === \"End\") {\n onEndKeyDown(event);\n event.preventDefault();\n } else if (import_constants2.PAGE_KEYS.concat(import_constants2.ARROW_KEYS).includes(event.key)) {\n onStepKeyDown(event);\n event.preventDefault();\n }\n }\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, {\n onMoveShouldSetResponderCapture: function() {\n return true;\n },\n onMoveShouldSetResponder: function() {\n return true;\n },\n onStartShouldSetResponder: function() {\n return true;\n },\n onResponderTerminationRequest: function() {\n return false;\n },\n onResponderGrant: handleResponderGrant,\n onResponderMove: handleResponderMove,\n onResponderRelease: handleResponderRelease,\n style: {\n inset: 0,\n position: \"absolute\"\n },\n children\n })\n })\n );\n});\n//# sourceMappingURL=SliderImpl.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,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CAAC;CACD,OAEkB,iBAAC,GAAG,mBAAmB,KAAK,aAAa;EACvD,MAAM;EACN,KAAK;EACL,GAAG;EACH,oBAAoB,YAAY;EAChC,GAAG,iBAAiB,SAAS,EAC3B,WAAW,SAAS,OAAO;GACzB,IAAI,MAAM,QAAQ,QAAQ;IACxB,cAAc,KAAK;IACnB,MAAM,eAAe;GACvB,OAAO,IAAI,MAAM,QAAQ,OAAO;IAC9B,aAAa,KAAK;IAClB,MAAM,eAAe;GACvB,OAAO,IAAI,kBAAkB,UAAU,OAAO,kBAAkB,UAAU,EAAE,SAAS,MAAM,GAAG,GAAG;IAC/F,cAAc,KAAK;IACnB,MAAM,eAAe;GACvB;EACF,EACF;EACA,UAA0B,iBAAC,GAAG,mBAAmB,KAAK,oBAAoB,MAAM;GAC9E,iCAAiC,WAAW;IAC1C,OAAO;GACT;GACA,0BAA0B,WAAW;IACnC,OAAO;GACT;GACA,2BAA2B,WAAW;IACpC,OAAO;GACT;GACA,+BAA+B,WAAW;IACxC,OAAO;GACT;GACA,kBAAkB;GAClB,iBAAiB;GACjB,oBAAoB;GACpB,OAAO;IACL,OAAO;IACP,UAAU;GACZ;GACA;EACF,CAAC;CACH,CAAC;AAEL,CAAC"}
|
package/dist/jsx/constants.mjs
CHANGED
|
@@ -1,30 +1,47 @@
|
|
|
1
1
|
import { createStyledContext } from "@tamagui/core";
|
|
2
|
+
|
|
2
3
|
const SLIDER_NAME = "Slider";
|
|
4
|
+
const sliderContextKeys = [
|
|
5
|
+
"size",
|
|
6
|
+
"min",
|
|
7
|
+
"max",
|
|
8
|
+
"orientation"
|
|
9
|
+
];
|
|
3
10
|
const SliderContext = createStyledContext({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
const {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} = createStyledContext({
|
|
17
|
-
startEdge: "left",
|
|
18
|
-
endEdge: "right",
|
|
19
|
-
sizeProp: "width",
|
|
20
|
-
size: 0,
|
|
21
|
-
direction: 1
|
|
11
|
+
size: true,
|
|
12
|
+
min: 0,
|
|
13
|
+
max: 100,
|
|
14
|
+
orientation: "horizontal"
|
|
15
|
+
}, { keys: sliderContextKeys });
|
|
16
|
+
const { Provider: SliderProvider, useStyledContext: useSliderContext } = SliderContext;
|
|
17
|
+
const { Provider: SliderOrientationProvider, useStyledContext: useSliderOrientationContext } = createStyledContext({
|
|
18
|
+
startEdge: "left",
|
|
19
|
+
endEdge: "right",
|
|
20
|
+
sizeProp: "width",
|
|
21
|
+
size: 0,
|
|
22
|
+
direction: 1
|
|
22
23
|
});
|
|
23
24
|
const PAGE_KEYS = ["PageUp", "PageDown"];
|
|
24
|
-
const ARROW_KEYS = [
|
|
25
|
+
const ARROW_KEYS = [
|
|
26
|
+
"ArrowUp",
|
|
27
|
+
"ArrowDown",
|
|
28
|
+
"ArrowLeft",
|
|
29
|
+
"ArrowRight"
|
|
30
|
+
];
|
|
25
31
|
const BACK_KEYS = {
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
ltr: [
|
|
33
|
+
"ArrowDown",
|
|
34
|
+
"Home",
|
|
35
|
+
"ArrowLeft",
|
|
36
|
+
"PageDown"
|
|
37
|
+
],
|
|
38
|
+
rtl: [
|
|
39
|
+
"ArrowDown",
|
|
40
|
+
"Home",
|
|
41
|
+
"ArrowRight",
|
|
42
|
+
"PageDown"
|
|
43
|
+
]
|
|
28
44
|
};
|
|
45
|
+
|
|
29
46
|
export { ARROW_KEYS, BACK_KEYS, PAGE_KEYS, SLIDER_NAME, SliderContext, SliderOrientationProvider, SliderProvider, useSliderContext, useSliderOrientationContext };
|
|
30
47
|
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["jsx/constants.js"],"sourcesContent":["import { createStyledContext } from \"@tamagui/core\";\nconst SLIDER_NAME = \"Slider\";\nconst sliderContextKeys = [\"size\", \"min\", \"max\", \"orientation\"];\nconst SliderContext = createStyledContext(\n {\n size: true,\n min: 0,\n max: 100,\n orientation: \"horizontal\"\n },\n {\n keys: sliderContextKeys\n }\n);\nconst { Provider: SliderProvider, useStyledContext: useSliderContext } = SliderContext;\nconst {\n Provider: SliderOrientationProvider,\n useStyledContext: useSliderOrientationContext\n} = createStyledContext({\n startEdge: \"left\",\n endEdge: \"right\",\n sizeProp: \"width\",\n size: 0,\n direction: 1\n});\nconst PAGE_KEYS = [\"PageUp\", \"PageDown\"];\nconst ARROW_KEYS = [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"];\nconst BACK_KEYS = {\n ltr: [\"ArrowDown\", \"Home\", \"ArrowLeft\", \"PageDown\"],\n rtl: [\"ArrowDown\", \"Home\", \"ArrowRight\", \"PageDown\"]\n};\nexport {\n ARROW_KEYS,\n BACK_KEYS,\n PAGE_KEYS,\n SLIDER_NAME,\n SliderContext,\n SliderOrientationProvider,\n SliderProvider,\n useSliderContext,\n useSliderOrientationContext\n};\n//# sourceMappingURL=constants.js.map\n"],"mappings":";;;AACA,MAAM,cAAc;AACpB,MAAM,oBAAoB;CAAC;CAAQ;CAAO;CAAO;AAAa;AAC9D,MAAM,gBAAgB,oBACpB;CACE,MAAM;CACN,KAAK;CACL,KAAK;CACL,aAAa;AACf,GACA,EACE,MAAM,kBACR,CACF;AACA,MAAM,EAAE,UAAU,gBAAgB,kBAAkB,qBAAqB;AACzE,MAAM,EACJ,UAAU,2BACV,kBAAkB,gCAChB,oBAAoB;CACtB,WAAW;CACX,SAAS;CACT,UAAU;CACV,MAAM;CACN,WAAW;AACb,CAAC;AACD,MAAM,YAAY,CAAC,UAAU,UAAU;AACvC,MAAM,aAAa;CAAC;CAAW;CAAa;CAAa;AAAY;AACrE,MAAM,YAAY;CAChB,KAAK;EAAC;EAAa;EAAQ;EAAa;CAAU;CAClD,KAAK;EAAC;EAAa;EAAQ;EAAc;CAAU;AACrD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var constants_exports = {};
|
|
25
|
+
__export(constants_exports, {
|
|
26
|
+
ARROW_KEYS: () => ARROW_KEYS,
|
|
27
|
+
BACK_KEYS: () => BACK_KEYS,
|
|
28
|
+
PAGE_KEYS: () => PAGE_KEYS,
|
|
29
|
+
SLIDER_NAME: () => SLIDER_NAME,
|
|
30
|
+
SliderContext: () => SliderContext,
|
|
31
|
+
SliderOrientationProvider: () => SliderOrientationProvider,
|
|
32
|
+
SliderProvider: () => SliderProvider,
|
|
33
|
+
useSliderContext: () => useSliderContext,
|
|
34
|
+
useSliderOrientationContext: () => useSliderOrientationContext
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(constants_exports);
|
|
37
|
+
var import_core = require("@tamagui/core");
|
|
38
|
+
var SLIDER_NAME = "Slider";
|
|
39
|
+
var sliderContextKeys = [
|
|
40
|
+
"size",
|
|
41
|
+
"min",
|
|
42
|
+
"max",
|
|
43
|
+
"orientation"
|
|
44
|
+
];
|
|
45
|
+
var SliderContext = (0, import_core.createStyledContext)({
|
|
46
|
+
size: true,
|
|
47
|
+
min: 0,
|
|
48
|
+
max: 100,
|
|
49
|
+
orientation: "horizontal"
|
|
50
|
+
}, { keys: sliderContextKeys });
|
|
51
|
+
var { Provider: SliderProvider, useStyledContext: useSliderContext } = SliderContext;
|
|
52
|
+
var { Provider: SliderOrientationProvider, useStyledContext: useSliderOrientationContext } = (0, import_core.createStyledContext)({
|
|
53
|
+
startEdge: "left",
|
|
54
|
+
endEdge: "right",
|
|
55
|
+
sizeProp: "width",
|
|
56
|
+
size: 0,
|
|
57
|
+
direction: 1
|
|
58
|
+
});
|
|
59
|
+
var PAGE_KEYS = ["PageUp", "PageDown"];
|
|
60
|
+
var ARROW_KEYS = [
|
|
61
|
+
"ArrowUp",
|
|
62
|
+
"ArrowDown",
|
|
63
|
+
"ArrowLeft",
|
|
64
|
+
"ArrowRight"
|
|
65
|
+
];
|
|
66
|
+
var BACK_KEYS = {
|
|
67
|
+
ltr: [
|
|
68
|
+
"ArrowDown",
|
|
69
|
+
"Home",
|
|
70
|
+
"ArrowLeft",
|
|
71
|
+
"PageDown"
|
|
72
|
+
],
|
|
73
|
+
rtl: [
|
|
74
|
+
"ArrowDown",
|
|
75
|
+
"Home",
|
|
76
|
+
"ArrowRight",
|
|
77
|
+
"PageDown"
|
|
78
|
+
]
|
|
79
|
+
};
|