@xaui/native 0.0.26 → 0.0.28
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/LICENSE +21 -0
- package/README.md +105 -228
- package/dist/alert/index.cjs +92 -166
- package/dist/alert/index.js +2 -1
- package/dist/app-bar/index.cjs +24 -98
- package/dist/app-bar/index.js +2 -1
- package/dist/autocomplete/index.cjs +192 -281
- package/dist/autocomplete/index.js +36 -48
- package/dist/avatar/index.cjs +59 -133
- package/dist/avatar/index.js +2 -1
- package/dist/badge/index.cjs +26 -99
- package/dist/badge/index.js +2 -1
- package/dist/bottom-sheet/index.cjs +5 -456
- package/dist/bottom-sheet/index.js +4 -363
- package/dist/bottom-tab-bar/index.cjs +93 -167
- package/dist/bottom-tab-bar/index.js +2 -2
- package/dist/button/index.cjs +73 -525
- package/dist/button/index.js +3 -2
- package/dist/card/index.cjs +76 -169
- package/dist/card/index.js +2 -2
- package/dist/carousel/index.cjs +68 -145
- package/dist/carousel/index.js +1 -1
- package/dist/chart/index.cjs +132 -173
- package/dist/checkbox/index.cjs +70 -143
- package/dist/checkbox/index.js +2 -1
- package/dist/chip/index.cjs +89 -164
- package/dist/chip/index.js +2 -1
- package/dist/chunk-BD72HIPR.cjs +75 -0
- package/dist/chunk-DHSTKO3K.cjs +19 -0
- package/dist/{chunk-CZFDZPAS.js → chunk-DXXNBF5P.js} +5 -0
- package/dist/{chunk-UI5L26KD.js → chunk-F7WH4DMG.js} +1 -1
- package/dist/chunk-GBHQCAKW.js +19 -0
- package/dist/chunk-HC2SSHNU.js +368 -0
- package/dist/chunk-HSPTLUFA.cjs +7 -0
- package/dist/chunk-JEGEPGVU.js +287 -0
- package/dist/chunk-KTLGDLCB.cjs +287 -0
- package/dist/{chunk-GHCVNQET.js → chunk-LTKYHG5V.js} +5 -12
- package/dist/{chunk-ULJSCNPE.js → chunk-LUBWRVI2.js} +1 -1
- package/dist/chunk-OQ2BLOOG.cjs +138 -0
- package/dist/chunk-QMYWIWSX.cjs +384 -0
- package/dist/chunk-XFPPR2VB.cjs +368 -0
- package/dist/core/index.cjs +22 -168
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +5 -3
- package/dist/datepicker/index.cjs +239 -320
- package/dist/datepicker/index.js +2 -1
- package/dist/divider/index.cjs +5 -145
- package/dist/divider/index.js +3 -2
- package/dist/drawer/index.cjs +39 -112
- package/dist/drawer/index.js +2 -1
- package/dist/expansion-panel/index.cjs +91 -230
- package/dist/expansion-panel/index.js +3 -2
- package/dist/fab/index.cjs +6 -722
- package/dist/fab/index.js +4 -3
- package/dist/fab-menu/index.cjs +81 -814
- package/dist/fab-menu/index.js +4 -3
- package/dist/feature-discovery/index.cjs +72 -139
- package/dist/feature-discovery/index.js +2 -2
- package/dist/index.cjs +1 -18
- package/dist/indicator/index.cjs +5 -445
- package/dist/indicator/index.js +3 -2
- package/dist/input/index.cjs +214 -282
- package/dist/input/index.js +2 -2
- package/dist/list/index.cjs +71 -146
- package/dist/list/index.js +2 -1
- package/dist/menu/index.cjs +59 -127
- package/dist/menu/index.js +2 -2
- package/dist/menubox/index.cjs +60 -132
- package/dist/menubox/index.js +2 -1
- package/dist/pager/index.cjs +42 -80
- package/dist/progress/index.cjs +43 -114
- package/dist/progress/index.js +2 -1
- package/dist/radio/index.cjs +82 -154
- package/dist/radio/index.js +2 -1
- package/dist/segment-button/index.cjs +60 -147
- package/dist/segment-button/index.js +2 -2
- package/dist/select/index.cjs +149 -224
- package/dist/select/index.js +10 -22
- package/dist/skeleton/index.cjs +23 -94
- package/dist/skeleton/index.js +2 -2
- package/dist/slider/index.cjs +77 -156
- package/dist/slider/index.js +2 -1
- package/dist/snackbar/index.cjs +420 -0
- package/dist/snackbar/index.d.cts +175 -0
- package/dist/snackbar/index.d.ts +175 -0
- package/dist/snackbar/index.js +420 -0
- package/dist/stepper/index.cjs +121 -195
- package/dist/stepper/index.js +2 -1
- package/dist/switch/index.cjs +48 -121
- package/dist/switch/index.js +2 -1
- package/dist/tabs/index.cjs +67 -151
- package/dist/tabs/index.js +2 -1
- package/dist/timepicker/index.cjs +135 -593
- package/dist/timepicker/index.js +24 -383
- package/dist/toolbar/index.cjs +59 -128
- package/dist/toolbar/index.js +2 -1
- package/dist/typography/index.cjs +37 -92
- package/dist/typography/index.d.cts +1 -1
- package/dist/typography/index.d.ts +1 -1
- package/dist/typography/index.js +20 -1
- package/dist/view/index.cjs +178 -223
- package/package.json +7 -1
- package/dist/chunk-3XSXTM3G.js +0 -661
- package/dist/chunk-4KSZLONZ.js +0 -79
- package/dist/chunk-I4V5Y5GD.js +0 -76
- package/dist/chunk-URBEEDFX.js +0 -79
package/dist/input/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-DXXNBF5P.js";
|
|
2
2
|
import {
|
|
3
3
|
useXUITheme
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-LTKYHG5V.js";
|
|
5
5
|
|
|
6
6
|
// src/components/input/input.tsx
|
|
7
7
|
import React, { forwardRef, useMemo as useMemo2, useState, useRef, useEffect } from "react";
|
package/dist/list/index.cjs
CHANGED
|
@@ -1,52 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('../chunk-HSPTLUFA.cjs');
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
__export(list_exports, {
|
|
33
|
-
List: () => List,
|
|
34
|
-
ListBuilder: () => ListBuilder,
|
|
35
|
-
ListItem: () => ListItem
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(list_exports);
|
|
3
|
+
|
|
4
|
+
var _chunkOQ2BLOOGcjs = require('../chunk-OQ2BLOOG.cjs');
|
|
38
5
|
|
|
39
6
|
// src/components/list/list.tsx
|
|
40
|
-
var
|
|
41
|
-
var
|
|
7
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
8
|
+
var _reactnative = require('react-native');
|
|
42
9
|
|
|
43
10
|
// src/components/list/list-context.ts
|
|
44
|
-
|
|
45
|
-
var ListContext = (0,
|
|
11
|
+
|
|
12
|
+
var ListContext = _react.createContext.call(void 0, null);
|
|
46
13
|
|
|
47
14
|
// src/components/list/list.style.ts
|
|
48
|
-
|
|
49
|
-
var styles =
|
|
15
|
+
|
|
16
|
+
var styles = _reactnative.StyleSheet.create({
|
|
50
17
|
list: {
|
|
51
18
|
flex: 1
|
|
52
19
|
},
|
|
@@ -75,53 +42,12 @@ var styles = import_react_native.StyleSheet.create({
|
|
|
75
42
|
});
|
|
76
43
|
|
|
77
44
|
// src/components/list/list-divider.tsx
|
|
78
|
-
var import_react7 = __toESM(require("react"), 1);
|
|
79
|
-
var import_react_native5 = require("react-native");
|
|
80
|
-
|
|
81
|
-
// src/core/theme-context.tsx
|
|
82
|
-
var import_react5 = __toESM(require("react"), 1);
|
|
83
|
-
var import_react_native3 = require("react-native");
|
|
84
|
-
var import_theme = require("@xaui/core/theme");
|
|
85
|
-
var import_palette = require("@xaui/core/palette");
|
|
86
45
|
|
|
87
|
-
// src/core/portal/portal.tsx
|
|
88
|
-
var import_react3 = require("react");
|
|
89
46
|
|
|
90
|
-
// src/core/portal/portal-context.ts
|
|
91
|
-
var import_react2 = require("react");
|
|
92
|
-
var PortalContext = (0, import_react2.createContext)(null);
|
|
93
|
-
|
|
94
|
-
// src/core/portal/portal-host.tsx
|
|
95
|
-
var import_react4 = __toESM(require("react"), 1);
|
|
96
|
-
var import_react_native2 = require("react-native");
|
|
97
|
-
var hostStyles = import_react_native2.StyleSheet.create({
|
|
98
|
-
container: {
|
|
99
|
-
flex: 1
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
// src/core/theme-context.tsx
|
|
104
|
-
var XUIThemeContext = (0, import_react5.createContext)(null);
|
|
105
|
-
|
|
106
|
-
// src/core/theme-hooks.ts
|
|
107
|
-
var import_react6 = require("react");
|
|
108
|
-
var import_react_native4 = require("react-native");
|
|
109
|
-
function useXUITheme() {
|
|
110
|
-
const theme = (0, import_react6.useContext)(XUIThemeContext);
|
|
111
|
-
if (!theme) {
|
|
112
|
-
throw new Error("useXUITheme must be used within XUIProvider");
|
|
113
|
-
}
|
|
114
|
-
return theme;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// src/core/index.ts
|
|
118
|
-
var import_theme2 = require("@xaui/core/theme");
|
|
119
|
-
|
|
120
|
-
// src/components/list/list-divider.tsx
|
|
121
47
|
var ListDivider = () => {
|
|
122
|
-
const theme = useXUITheme();
|
|
123
|
-
return /* @__PURE__ */
|
|
124
|
-
|
|
48
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
49
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
50
|
+
_reactnative.View,
|
|
125
51
|
{
|
|
126
52
|
style: [styles.divider, { backgroundColor: theme.colors.foreground + "30" }]
|
|
127
53
|
}
|
|
@@ -129,10 +55,10 @@ var ListDivider = () => {
|
|
|
129
55
|
};
|
|
130
56
|
var ListChildren = ({ children, showDivider }) => {
|
|
131
57
|
if (!showDivider) {
|
|
132
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ _react2.default.createElement(_react2.default.Fragment, null, children);
|
|
133
59
|
}
|
|
134
|
-
const childArray =
|
|
135
|
-
return /* @__PURE__ */
|
|
60
|
+
const childArray = _react.Children.toArray(children);
|
|
61
|
+
return /* @__PURE__ */ _react2.default.createElement(_react2.default.Fragment, null, childArray.map((child, index) => /* @__PURE__ */ _react2.default.createElement(_react2.default.Fragment, { key: index }, child, index < childArray.length - 1 && /* @__PURE__ */ _react2.default.createElement(ListDivider, null))));
|
|
136
62
|
};
|
|
137
63
|
|
|
138
64
|
// src/components/list/list.tsx
|
|
@@ -150,15 +76,15 @@ var List = ({
|
|
|
150
76
|
style
|
|
151
77
|
}) => {
|
|
152
78
|
const isControlled = controlledSelectedKeys !== void 0;
|
|
153
|
-
const [internalSelectedKeys, setInternalSelectedKeys] = (0,
|
|
79
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = _react.useState.call(void 0, defaultSelectedKeys);
|
|
154
80
|
const selectedKeys = isControlled ? controlledSelectedKeys : internalSelectedKeys;
|
|
155
|
-
const isSelected = (0,
|
|
81
|
+
const isSelected = _react.useCallback.call(void 0,
|
|
156
82
|
(key) => {
|
|
157
83
|
return selectedKeys.includes(key);
|
|
158
84
|
},
|
|
159
85
|
[selectedKeys]
|
|
160
86
|
);
|
|
161
|
-
const toggleSelection = (0,
|
|
87
|
+
const toggleSelection = _react.useCallback.call(void 0,
|
|
162
88
|
(key) => {
|
|
163
89
|
if (selectionMode === "none" || !isSelectable) {
|
|
164
90
|
return;
|
|
@@ -172,7 +98,7 @@ var List = ({
|
|
|
172
98
|
if (!isControlled) {
|
|
173
99
|
setInternalSelectedKeys(newSelectedKeys);
|
|
174
100
|
}
|
|
175
|
-
onSelectionChange
|
|
101
|
+
_optionalChain([onSelectionChange, 'optionalCall', _ => _(newSelectedKeys)]);
|
|
176
102
|
},
|
|
177
103
|
[
|
|
178
104
|
selectionMode,
|
|
@@ -183,7 +109,7 @@ var List = ({
|
|
|
183
109
|
onSelectionChange
|
|
184
110
|
]
|
|
185
111
|
);
|
|
186
|
-
const contextValue = (0,
|
|
112
|
+
const contextValue = _react.useMemo.call(void 0,
|
|
187
113
|
() => ({
|
|
188
114
|
selectionMode,
|
|
189
115
|
selectedKeys,
|
|
@@ -207,18 +133,18 @@ var List = ({
|
|
|
207
133
|
isSelected
|
|
208
134
|
]
|
|
209
135
|
);
|
|
210
|
-
return /* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ _react2.default.createElement(ListContext.Provider, { value: contextValue }, /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.list, style] }, /* @__PURE__ */ _react2.default.createElement(ListChildren, { showDivider }, children)));
|
|
211
137
|
};
|
|
212
138
|
|
|
213
139
|
// src/components/list/list-item.tsx
|
|
214
|
-
|
|
215
|
-
|
|
140
|
+
|
|
141
|
+
|
|
216
142
|
|
|
217
143
|
// src/components/list/list.hook.ts
|
|
218
|
-
|
|
144
|
+
|
|
219
145
|
var useListItemSizeStyles = (size) => {
|
|
220
|
-
const theme = useXUITheme();
|
|
221
|
-
return (0,
|
|
146
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
147
|
+
return _react.useMemo.call(void 0, () => {
|
|
222
148
|
const sizes = {
|
|
223
149
|
xs: {
|
|
224
150
|
paddingVertical: theme.spacing.sm,
|
|
@@ -250,7 +176,7 @@ var useListItemSizeStyles = (size) => {
|
|
|
250
176
|
};
|
|
251
177
|
|
|
252
178
|
// src/components/list/list-item.tsx
|
|
253
|
-
var
|
|
179
|
+
var _core = require('@xaui/core');
|
|
254
180
|
var ListItem = ({
|
|
255
181
|
itemKey,
|
|
256
182
|
title,
|
|
@@ -262,16 +188,16 @@ var ListItem = ({
|
|
|
262
188
|
customAppearance,
|
|
263
189
|
onPress
|
|
264
190
|
}) => {
|
|
265
|
-
const context = (0,
|
|
266
|
-
const theme = useXUITheme();
|
|
267
|
-
const selectionMode = context
|
|
268
|
-
const isPressable = context
|
|
269
|
-
const isSelectable = context
|
|
270
|
-
const themeColor = context
|
|
271
|
-
const size = context
|
|
272
|
-
const isSelected = propIsSelected
|
|
191
|
+
const context = _react.useContext.call(void 0, ListContext);
|
|
192
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
193
|
+
const selectionMode = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _2 => _2.selectionMode]), () => ( "none"));
|
|
194
|
+
const isPressable = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _3 => _3.isPressable]), () => ( true));
|
|
195
|
+
const isSelectable = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _4 => _4.isSelectable]), () => ( false));
|
|
196
|
+
const themeColor = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _5 => _5.themeColor]), () => ( "primary"));
|
|
197
|
+
const size = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _6 => _6.size]), () => ( "md"));
|
|
198
|
+
const isSelected = _nullishCoalesce(propIsSelected, () => ( (context ? context.isSelected(itemKey) : false)));
|
|
273
199
|
const sizeStyles = useListItemSizeStyles(size);
|
|
274
|
-
const safeThemeColor = (0,
|
|
200
|
+
const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
|
|
275
201
|
const colorScheme = theme.colors[safeThemeColor];
|
|
276
202
|
const backgroundColor = isSelected ? colorScheme.background : "transparent";
|
|
277
203
|
const titleColor = isDisabled ? theme.colors.foreground + "50" : theme.colors.foreground;
|
|
@@ -281,19 +207,19 @@ var ListItem = ({
|
|
|
281
207
|
return;
|
|
282
208
|
}
|
|
283
209
|
if (isSelectable && selectionMode !== "none") {
|
|
284
|
-
context
|
|
210
|
+
_optionalChain([context, 'optionalAccess', _7 => _7.toggleSelection, 'call', _8 => _8(itemKey)]);
|
|
285
211
|
}
|
|
286
|
-
onPress
|
|
212
|
+
_optionalChain([onPress, 'optionalCall', _9 => _9({})]);
|
|
287
213
|
};
|
|
288
214
|
const renderTitle = () => {
|
|
289
215
|
if (typeof title === "string" || typeof title === "number") {
|
|
290
|
-
return /* @__PURE__ */
|
|
291
|
-
|
|
216
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
217
|
+
_reactnative.Text,
|
|
292
218
|
{
|
|
293
219
|
style: [
|
|
294
220
|
styles.title,
|
|
295
221
|
{ fontSize: sizeStyles.titleSize, color: titleColor },
|
|
296
|
-
customAppearance
|
|
222
|
+
_optionalChain([customAppearance, 'optionalAccess', _10 => _10.title])
|
|
297
223
|
],
|
|
298
224
|
numberOfLines: 1
|
|
299
225
|
},
|
|
@@ -305,13 +231,13 @@ var ListItem = ({
|
|
|
305
231
|
const renderDescription = () => {
|
|
306
232
|
if (!description) return null;
|
|
307
233
|
if (typeof description === "string" || typeof description === "number") {
|
|
308
|
-
return /* @__PURE__ */
|
|
309
|
-
|
|
234
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
235
|
+
_reactnative.Text,
|
|
310
236
|
{
|
|
311
237
|
style: [
|
|
312
238
|
styles.description,
|
|
313
239
|
{ fontSize: sizeStyles.descriptionSize, color: descriptionColor },
|
|
314
|
-
customAppearance
|
|
240
|
+
_optionalChain([customAppearance, 'optionalAccess', _11 => _11.description])
|
|
315
241
|
],
|
|
316
242
|
numberOfLines: 2
|
|
317
243
|
},
|
|
@@ -320,8 +246,8 @@ var ListItem = ({
|
|
|
320
246
|
}
|
|
321
247
|
return description;
|
|
322
248
|
};
|
|
323
|
-
const content = /* @__PURE__ */
|
|
324
|
-
|
|
249
|
+
const content = /* @__PURE__ */ _react2.default.createElement(
|
|
250
|
+
_reactnative.View,
|
|
325
251
|
{
|
|
326
252
|
style: [
|
|
327
253
|
styles.item,
|
|
@@ -331,18 +257,18 @@ var ListItem = ({
|
|
|
331
257
|
backgroundColor
|
|
332
258
|
},
|
|
333
259
|
isDisabled && styles.disabled,
|
|
334
|
-
customAppearance
|
|
260
|
+
_optionalChain([customAppearance, 'optionalAccess', _12 => _12.container])
|
|
335
261
|
]
|
|
336
262
|
},
|
|
337
|
-
startContent && /* @__PURE__ */
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
endContent && /* @__PURE__ */
|
|
263
|
+
startContent && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: _optionalChain([customAppearance, 'optionalAccess', _13 => _13.content]) }, startContent),
|
|
264
|
+
/* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.content, _optionalChain([customAppearance, 'optionalAccess', _14 => _14.content])] }, renderTitle(), renderDescription()),
|
|
265
|
+
endContent && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: _optionalChain([customAppearance, 'optionalAccess', _15 => _15.content]) }, endContent)
|
|
340
266
|
);
|
|
341
267
|
if (!isPressable) {
|
|
342
268
|
return content;
|
|
343
269
|
}
|
|
344
|
-
return /* @__PURE__ */
|
|
345
|
-
|
|
270
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
271
|
+
_reactnative.Pressable,
|
|
346
272
|
{
|
|
347
273
|
onPress: handlePress,
|
|
348
274
|
disabled: isDisabled,
|
|
@@ -357,8 +283,8 @@ var ListItem = ({
|
|
|
357
283
|
};
|
|
358
284
|
|
|
359
285
|
// src/components/list/list-builder.tsx
|
|
360
|
-
|
|
361
|
-
|
|
286
|
+
|
|
287
|
+
|
|
362
288
|
function ListBuilder({
|
|
363
289
|
data,
|
|
364
290
|
keyExtractor,
|
|
@@ -375,17 +301,17 @@ function ListBuilder({
|
|
|
375
301
|
style,
|
|
376
302
|
flatListProps
|
|
377
303
|
}) {
|
|
378
|
-
const theme = useXUITheme();
|
|
304
|
+
const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
|
|
379
305
|
const isControlled = controlledSelectedKeys !== void 0;
|
|
380
|
-
const [internalSelectedKeys, setInternalSelectedKeys] = (0,
|
|
306
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = _react.useState.call(void 0, defaultSelectedKeys);
|
|
381
307
|
const selectedKeys = isControlled ? controlledSelectedKeys : internalSelectedKeys;
|
|
382
|
-
const isSelected = (0,
|
|
308
|
+
const isSelected = _react.useCallback.call(void 0,
|
|
383
309
|
(key) => {
|
|
384
310
|
return selectedKeys.includes(key);
|
|
385
311
|
},
|
|
386
312
|
[selectedKeys]
|
|
387
313
|
);
|
|
388
|
-
const toggleSelection = (0,
|
|
314
|
+
const toggleSelection = _react.useCallback.call(void 0,
|
|
389
315
|
(key) => {
|
|
390
316
|
if (selectionMode === "none" || !isSelectable) {
|
|
391
317
|
return;
|
|
@@ -399,7 +325,7 @@ function ListBuilder({
|
|
|
399
325
|
if (!isControlled) {
|
|
400
326
|
setInternalSelectedKeys(newSelectedKeys);
|
|
401
327
|
}
|
|
402
|
-
onSelectionChange
|
|
328
|
+
_optionalChain([onSelectionChange, 'optionalCall', _16 => _16(newSelectedKeys)]);
|
|
403
329
|
},
|
|
404
330
|
[
|
|
405
331
|
selectionMode,
|
|
@@ -410,7 +336,7 @@ function ListBuilder({
|
|
|
410
336
|
onSelectionChange
|
|
411
337
|
]
|
|
412
338
|
);
|
|
413
|
-
const contextValue = (0,
|
|
339
|
+
const contextValue = _react.useMemo.call(void 0,
|
|
414
340
|
() => ({
|
|
415
341
|
selectionMode,
|
|
416
342
|
selectedKeys,
|
|
@@ -434,14 +360,14 @@ function ListBuilder({
|
|
|
434
360
|
isSelected
|
|
435
361
|
]
|
|
436
362
|
);
|
|
437
|
-
const renderListItem = (0,
|
|
363
|
+
const renderListItem = _react.useCallback.call(void 0,
|
|
438
364
|
(item, index) => {
|
|
439
365
|
const element = renderItem(item, index);
|
|
440
366
|
if (!showDivider || index === data.length - 1) {
|
|
441
|
-
return /* @__PURE__ */
|
|
367
|
+
return /* @__PURE__ */ _react2.default.createElement(_react2.default.Fragment, { key: keyExtractor(item, index) }, element);
|
|
442
368
|
}
|
|
443
|
-
return /* @__PURE__ */
|
|
444
|
-
|
|
369
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { key: keyExtractor(item, index) }, element, /* @__PURE__ */ _react2.default.createElement(
|
|
370
|
+
_reactnative.View,
|
|
445
371
|
{
|
|
446
372
|
style: [
|
|
447
373
|
styles.divider,
|
|
@@ -452,8 +378,8 @@ function ListBuilder({
|
|
|
452
378
|
},
|
|
453
379
|
[data.length, keyExtractor, renderItem, showDivider, theme.colors.foreground]
|
|
454
380
|
);
|
|
455
|
-
return /* @__PURE__ */
|
|
456
|
-
|
|
381
|
+
return /* @__PURE__ */ _react2.default.createElement(ListContext.Provider, { value: contextValue }, /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.list, style] }, /* @__PURE__ */ _react2.default.createElement(
|
|
382
|
+
_reactnative.FlatList,
|
|
457
383
|
{
|
|
458
384
|
data,
|
|
459
385
|
keyExtractor,
|
|
@@ -462,9 +388,8 @@ function ListBuilder({
|
|
|
462
388
|
}
|
|
463
389
|
)));
|
|
464
390
|
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
});
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
exports.List = List; exports.ListBuilder = ListBuilder; exports.ListItem = ListItem;
|