@beppla/tapas-ui 1.0.68 → 1.0.70

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.
Files changed (248) hide show
  1. package/commonjs/AnimatedNavItem/index.js.map +2 -1
  2. package/commonjs/BarChart/BarChart.js +112 -90
  3. package/commonjs/BarChart/BarChart.js.map +1 -1
  4. package/commonjs/Button/Button.js +96 -78
  5. package/commonjs/Button/Button.js.map +1 -2
  6. package/commonjs/Button/ButtonGroup.js +156 -136
  7. package/commonjs/Button/ButtonGroup.js.map +1 -2
  8. package/commonjs/Calendar/Calendar.base.js +162 -190
  9. package/commonjs/Calendar/Calendar.base.js.map +1 -2
  10. package/commonjs/Calendar/Calendar.js +86 -102
  11. package/commonjs/Calendar/Calendar.js.map +2 -1
  12. package/commonjs/Calendar/CustomRange.js +271 -324
  13. package/commonjs/Calendar/DaySelector.js +115 -113
  14. package/commonjs/Calendar/DaySelector.js.map +2 -1
  15. package/commonjs/Calendar/MonthSelector.js +118 -115
  16. package/commonjs/Calendar/local.js +2 -2
  17. package/commonjs/Calendar/local.js.map +2 -1
  18. package/commonjs/Calendar/types.js +11 -11
  19. package/commonjs/CheckBox/CheckBox.js +96 -63
  20. package/commonjs/CheckBox/CheckBox.js.map +1 -2
  21. package/commonjs/CheckBox/CheckBoxItem.js +78 -57
  22. package/commonjs/CheckBox/CheckBoxItem.js.map +1 -2
  23. package/commonjs/CircularProgress/CircularProgress.js +25 -23
  24. package/commonjs/CircularProgress/CircularProgress.js.map +1 -2
  25. package/commonjs/Collapsible/Collapsible.js +60 -74
  26. package/commonjs/Collapsible/Collapsible.js.map +2 -1
  27. package/commonjs/DashboardCard/DashboardCard.js +74 -94
  28. package/commonjs/DashboardCard/DashboardCard.js.map +1 -1
  29. package/commonjs/DataCell/DataCell.js +108 -0
  30. package/commonjs/DataCell/DataCell.js.map +1 -0
  31. package/commonjs/DataCell/index.js +15 -9
  32. package/commonjs/DataTable/DataTable.js +0 -69
  33. package/commonjs/DataTable/index.js.map +2 -1
  34. package/commonjs/DeviceSelectionModal/DeviceSelectionModal.js +242 -244
  35. package/commonjs/DeviceSelectionModal/DeviceSelectionModal.js.map +1 -2
  36. package/commonjs/DraggableFlatList/DraggableFlatList.js +1 -1
  37. package/commonjs/Dropdown/InputDropdown.js.map +2 -1
  38. package/commonjs/Gantt/Accessories.js +135 -168
  39. package/commonjs/Gantt/Accessories.js.map +1 -2
  40. package/commonjs/Gantt/Gantt.js +149 -149
  41. package/commonjs/Gantt/Gantt.js.map +2 -1
  42. package/commonjs/Gantt/GanttInnerElementType.js +93 -102
  43. package/commonjs/Gantt/GanttInnerElementType.js.map +2 -1
  44. package/commonjs/Gantt/helper.js +119 -145
  45. package/commonjs/Gantt/types.js +4 -4
  46. package/commonjs/Grid/VariableSizeGrid.js +120 -113
  47. package/commonjs/Grid/VariableSizeGrid.js.map +2 -1
  48. package/commonjs/Grid/helper.js.map +2 -1
  49. package/commonjs/Grid/timer.js +9 -5
  50. package/commonjs/Grid/timer.js.map +1 -2
  51. package/commonjs/HelloWave/HelloWave.js +46 -53
  52. package/commonjs/HelloWave/HelloWave.js.map +1 -2
  53. package/commonjs/Hoverable/Hoverable.js +35 -33
  54. package/commonjs/Hoverable/Hoverable.js.map +2 -2
  55. package/commonjs/IconText/IconText.js +88 -65
  56. package/commonjs/IconText/IconText.js.map +2 -1
  57. package/commonjs/Icons/TapasIcon.js +99 -100
  58. package/commonjs/Icons/TapasIcon.js.map +1 -2
  59. package/commonjs/Icons/TapasIconExpo.js +101 -94
  60. package/commonjs/Icons/smartFontLoader.js +266 -222
  61. package/commonjs/Image/PreviewImg.js +85 -63
  62. package/commonjs/Image/PreviewImg.js.map +1 -2
  63. package/commonjs/Layout/DrawerContext.js +49 -35
  64. package/commonjs/Layout/DrawerContext.js.map +1 -2
  65. package/commonjs/Layout/ToastContext.js +34 -46
  66. package/commonjs/LineChart/LineChart.js +126 -144
  67. package/commonjs/LineChart/LineChart.js.map +1 -2
  68. package/commonjs/LineChart/index.js +4 -3
  69. package/commonjs/LineChart/index.js.map +1 -2
  70. package/commonjs/ListItem/ListItem.js +80 -108
  71. package/commonjs/ListItem/ListItem.js.map +2 -1
  72. package/commonjs/Loading/Loading.js +66 -54
  73. package/commonjs/Loading/Loading.js.map +1 -1
  74. package/commonjs/MessageBox/MessageBox.js +127 -126
  75. package/commonjs/MessageBox/MessageBox.js.map +2 -1
  76. package/commonjs/MultiSelector/MultiSelector.js +250 -225
  77. package/commonjs/MultiSelector/index.js +6 -8
  78. package/commonjs/MultiSelector/index.js.map +2 -1
  79. package/commonjs/Navigation/Navigation.js +65 -0
  80. package/commonjs/Navigation/Navigation.js.map +1 -0
  81. package/commonjs/Notification/Notification.js +110 -89
  82. package/commonjs/Notification/index.js +6 -8
  83. package/commonjs/Notification/index.js.map +2 -1
  84. package/commonjs/NumericInput/NumericInput.js +23 -0
  85. package/commonjs/NumericInput/NumericInput.js.map +1 -0
  86. package/commonjs/Overlay/Overlay.js +24 -45
  87. package/commonjs/Overlay/Overlay.js.map +1 -1
  88. package/commonjs/Pagination/Pagination.js +93 -151
  89. package/commonjs/Pagination/Pagination.js.map +1 -1
  90. package/commonjs/PieChart/PieChart.js.map +2 -1
  91. package/commonjs/PieChart/index.js +3 -4
  92. package/commonjs/PieChart/index.js.map +2 -1
  93. package/commonjs/Popover/Popover.js +112 -137
  94. package/commonjs/Popover/Popover.js.map +1 -2
  95. package/commonjs/Progress/Progress.js +54 -48
  96. package/commonjs/Progress/Progress.js.map +1 -2
  97. package/commonjs/Quantity/Quantity.js +52 -127
  98. package/commonjs/Quantity/Quantity.js.map +0 -1
  99. package/commonjs/Quantity/index.js +8 -6
  100. package/commonjs/Quantity/index.js.map +1 -2
  101. package/commonjs/ReasonModal/ReasonModal.js +125 -122
  102. package/commonjs/ReasonModal/ReasonModal.js.map +2 -1
  103. package/commonjs/ReasonModal/index.js +9 -15
  104. package/commonjs/ReasonModal/index.js.map +1 -2
  105. package/commonjs/SearchInput/SearchInput.js +92 -108
  106. package/commonjs/SheetTitle/SheetTitle.js +0 -6
  107. package/commonjs/SheetTitle/SheetTitle.js.map +0 -1
  108. package/commonjs/Shell/Shell.js +84 -92
  109. package/commonjs/Shell/Shell.js.map +2 -1
  110. package/commonjs/Shell/styles.js.map +1 -2
  111. package/commonjs/Shell/types.js +2 -2
  112. package/commonjs/Shell/types.js.map +1 -2
  113. package/commonjs/StatisticCard/StatisticCard.js +41 -47
  114. package/commonjs/Steps/Steps.js +41 -40
  115. package/commonjs/Steps/Steps.js.map +1 -1
  116. package/commonjs/TabTitle/index.js +0 -1
  117. package/commonjs/TabTitle/index.js.map +0 -1
  118. package/commonjs/TableColumnHeader/TableColumnHeader.js +134 -140
  119. package/commonjs/Tag/Tag.js +0 -41
  120. package/commonjs/Tag/Tag.js.map +0 -1
  121. package/commonjs/Task/Task.js +201 -112
  122. package/commonjs/Task/Task.js.map +2 -1
  123. package/commonjs/Text/Text.js.map +0 -1
  124. package/commonjs/Theme/ThemeProvider.js +18 -16
  125. package/commonjs/Theme/defaultTheme.js +21 -16
  126. package/commonjs/Theme/defaultTheme.js.map +2 -1
  127. package/commonjs/Toast/Toast.js +32 -0
  128. package/commonjs/Toast/Toast.js.map +1 -0
  129. package/commonjs/UserSwitcher/UserSwitcher.js +147 -144
  130. package/commonjs/UserSwitcher/UserSwitcher.js.map +2 -1
  131. package/module/Alert/Alert.js +71 -51
  132. package/module/Alert/Alert.js.map +2 -1
  133. package/module/AnimatedNavItem/AnimatedNavItem.js.map +1 -2
  134. package/module/AnimatedNavItem/index.js +7 -3
  135. package/module/AnimatedNavItem/index.js.map +1 -2
  136. package/module/BarChart/BarChart.js +140 -109
  137. package/module/BarChart/BarChart.js.map +2 -1
  138. package/module/BarChart/index.js +4 -2
  139. package/module/Button/ButtonGroup.js +120 -129
  140. package/module/Button/ButtonGroup.js.map +1 -2
  141. package/module/Calendar/ConcreteTimeSelector.js +299 -211
  142. package/module/Calendar/ConcreteTimeSelector.js.map +2 -1
  143. package/module/Calendar/DaySelector.js +118 -95
  144. package/module/Calendar/DaySelector.js.map +2 -1
  145. package/module/Calendar/TimeSelector.js +307 -215
  146. package/module/Calendar/TimeSelector.js.map +1 -2
  147. package/module/Calendar/local.js +7 -7
  148. package/module/Calendar/local.js.map +2 -1
  149. package/module/Calendar/types.js.map +1 -2
  150. package/module/Card/Card.js +236 -154
  151. package/module/Card/Card.js.map +1 -1
  152. package/module/CheckBox/CheckBox.js +89 -93
  153. package/module/CheckBox/CheckBox.js.map +2 -1
  154. package/module/CheckBox/CheckBoxItem.js +84 -69
  155. package/module/CheckBox/CheckBoxItem.js.map +1 -1
  156. package/module/CheckBox/GroupCheckBox.js +76 -66
  157. package/module/CheckBox/GroupCheckBox.js.map +2 -1
  158. package/module/CircularProgress/CircularProgress.js +0 -22
  159. package/module/CircularProgress/CircularProgress.js.map +0 -1
  160. package/module/DashboardCard/DashboardCard.js +88 -80
  161. package/module/DashboardCard/DashboardCard.js.map +1 -2
  162. package/module/DataCell/DataCell.js +224 -311
  163. package/module/DataCell/DataCell.js.map +1 -2
  164. package/module/DataTable/DataTable.js +100 -0
  165. package/module/DataTable/index.js.map +1 -2
  166. package/module/DeviceSelectionModal/DeviceSelectionModal.js +124 -0
  167. package/module/DeviceSelectionModal/DeviceSelectionModal.js.map +1 -0
  168. package/module/DraggableFlatList/DraggableFlatList.js +9 -0
  169. package/module/DraggableFlatList/DraggableFlatList.js.map +1 -0
  170. package/module/Dropdown/CustomDropdown.js +160 -212
  171. package/module/Dropdown/CustomDropdown.js.map +1 -1
  172. package/module/Dropdown/Dropdown.js +408 -484
  173. package/module/Dropdown/Dropdown.js.map +1 -2
  174. package/module/Dropdown/InputDropdown.js +134 -116
  175. package/module/Dropdown/InputDropdown.js.map +2 -1
  176. package/module/ExternalLink/ExternalLink.js +0 -150
  177. package/module/ExternalLink/ExternalLink.js.map +0 -1
  178. package/module/Gantt/Accessories.js.map +2 -1
  179. package/module/Gantt/Gantt.js +152 -139
  180. package/module/Gantt/Gantt.js.map +2 -1
  181. package/module/Gantt/GanttInnerElementType.js.map +1 -2
  182. package/module/Gantt/helper.js +163 -129
  183. package/module/Gantt/types.js +8 -4
  184. package/module/Gantt/types.js.map +1 -2
  185. package/module/Grid/VariableSizeGrid.js +118 -121
  186. package/module/Grid/VariableSizeGrid.js.map +1 -2
  187. package/module/Grid/helper.js.map +2 -1
  188. package/module/Grid/timer.js +16 -14
  189. package/module/Grid/timer.js.map +1 -2
  190. package/module/HelloWave/HelloWave.js +53 -43
  191. package/module/HelloWave/HelloWave.js.map +2 -1
  192. package/module/Hoverable/Hoverable.js +66 -69
  193. package/module/Hoverable/Hoverable.js.map +1 -2
  194. package/module/Icons/TapasIcon.js +96 -120
  195. package/module/Icons/TapasIcon.js.map +1 -2
  196. package/module/Icons/TapasIconExpo.js +98 -78
  197. package/module/Icons/TapasIconExpo.js.map +2 -1
  198. package/module/Icons/fontLoader.js.map +2 -1
  199. package/module/Icons/index.js +10 -9
  200. package/module/Icons/smartFontLoader.js.map +2 -1
  201. package/module/Input/Input.js +74 -0
  202. package/module/Input/Input.js.map +1 -0
  203. package/module/Layout/DrawerContext.js +29 -18
  204. package/module/Layout/DrawerContext.js.map +2 -1
  205. package/module/Layout/Layout.js +100 -100
  206. package/module/Layout/index.js +15 -14
  207. package/module/LineChart/LineChart.js +157 -121
  208. package/module/Loading/Loading.js +65 -67
  209. package/module/Loading/Loading.js.map +2 -1
  210. package/module/MultiSelector/MultiSelector.js.map +2 -1
  211. package/module/MultiSelector/index.js +2 -3
  212. package/module/MultiSelector/index.js.map +2 -1
  213. package/module/Notification/Notification.js +105 -101
  214. package/module/Notification/Notification.js.map +2 -1
  215. package/module/Notification/index.js +18 -1
  216. package/module/Notification/index.js.map +1 -1
  217. package/module/NumericInput/NumericInput.js.map +1 -0
  218. package/module/Overlay/Overlay.js +29 -0
  219. package/module/Overlay/Overlay.js.map +1 -0
  220. package/module/Pagination/Pagination.js +0 -72
  221. package/module/Pagination/Pagination.js.map +0 -1
  222. package/module/PieChart/PieChart.js +101 -76
  223. package/module/PieChart/PieChart.js.map +1 -2
  224. package/module/Quantity/Quantity.js +129 -112
  225. package/module/ReasonModal/ReasonModal.js +114 -145
  226. package/module/ReasonModal/ReasonModal.js.map +1 -2
  227. package/module/ReasonModal/index.js +27 -0
  228. package/module/ScanButton/ScanButton.js +56 -35
  229. package/module/ScanButton/ScanButton.js.map +1 -1
  230. package/module/Shell/types.js +2 -4
  231. package/module/TabTitle/TabTitle.js +57 -48
  232. package/module/TableColumnHeader/TableColumnHeader.js +153 -126
  233. package/module/Task/Task.js +113 -207
  234. package/module/Task/Task.js.map +1 -2
  235. package/module/Task/type.js +4 -8
  236. package/module/Task/type.js.map +1 -2
  237. package/module/Text/Text.js +80 -70
  238. package/module/Text/Text.js.map +1 -2
  239. package/module/TextArea/TextArea.js +119 -0
  240. package/module/TextArea/TextArea.js.map +1 -0
  241. package/module/Theme/defaultTheme.js +20 -0
  242. package/module/Theme/defaultTheme.js.map +1 -0
  243. package/module/Timeline/Timeline.js +54 -0
  244. package/module/Timeline/Timeline.js.map +1 -0
  245. package/module/UserSwitcher/UserSwitcher.js.map +2 -1
  246. package/module/index.js.map +1 -2
  247. package/package.json +1 -1
  248. package/typescript/Hoverable/Hoverable.d.ts.map +1 -1
@@ -1,53 +1,62 @@
1
- "use strict";
2
-
3
- var __assign = this && this.__assign || function () {
4
- __assign = Object.assign || function (t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import React from "react";
3
+ import { Text, View } from "react-native";
4
+ import { withTheme, makeStyles } from "@rneui/themed";
5
+ const TapasTabTitle = ({
6
+ text,
7
+ showIndicator = false,
8
+ indicatorColor = "#FF4444",
9
+ indicatorSize = 5,
10
+ textStyle,
11
+ textProps,
12
+ indicatorOffset = {
13
+ top: 0,
14
+ right: -8
15
+ },
16
+ style,
17
+ ...otherProps
18
+ }) => {
19
+ const styles = useStyles();
20
+ return /*#__PURE__*/React.createElement(View, _extends({
21
+ style: [styles.container, style]
22
+ }, otherProps), /*#__PURE__*/React.createElement(Text, _extends({
23
+ numberOfLines: 1,
24
+ ellipsizeMode: "tail",
25
+ style: [styles.text, textStyle]
26
+ }, textProps), text, showIndicator && /*#__PURE__*/React.createElement(View, {
27
+ style: [styles.indicator, {
28
+ width: indicatorSize,
29
+ height: indicatorSize,
30
+ borderRadius: indicatorSize / 2,
31
+ backgroundColor: indicatorColor,
32
+ top: indicatorOffset.top,
33
+ right: indicatorOffset.right
34
+ }]
35
+ })));
12
36
  };
13
- var __rest = this && this.__rest || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
37
+ const useStyles = makeStyles(theme => ({
38
+ container: {
39
+ alignItems: "flex-start",
40
+ justifyContent: "center"
41
+ },
42
+ text: {
43
+ fontSize: theme?.fonts?.sizeM || 16,
44
+ fontWeight: "600",
45
+ color: theme?.colors?.colorTextPrimary || theme?.colors?.primary || "#000",
46
+ position: "relative",
47
+ overflow: "visible"
48
+ },
49
+ indicator: {
50
+ position: "absolute",
51
+ zIndex: 1
18
52
  }
19
- return t;
20
- };
21
- var __importDefault = this && this.__importDefault || function (mod) {
22
- return mod && mod.__esModule ? mod : {
23
- "default": mod
24
- };
25
- };
26
- Object.defineProperty(exports, "__esModule", {
27
- value: true
28
- });
29
- exports.TapasTabTitle = exports.TabTitle = void 0;
30
- var react_1 = __importDefault(require("react"));
31
- var react_native_1 = require("react-native");
32
- var themed_1 = require("@rneui/themed");
33
- var TapasTabTitle = function (_a) {
34
- var text = _a.text,
35
- _b = _a.showIndicator,
36
- showIndicator = _b === void 0 ? false : _b,
37
- _c = _a.indicatorColor,
38
- indicatorColor = _c === void 0 ? "#FF4444" : _c,
39
- _d = _a.indicatorSize,
40
- indicatorSize = _d === void 0 ? 5 : _d,
41
- textStyle = _a.textStyle,
42
- textProps = _a.textProps,
43
- _e = _a.indicatorOffset,
44
- indicatorOffset = _e === void 0 ? {
45
- top: 0,
46
- right: -8
47
- } : _e,
48
- style = _a.style,
49
- otherProps = __rest(_a, ["text", "showIndicator", "indicatorColor", "indicatorSize", "textStyle", "textProps", "indicatorOffset", "style"]);
50
- var styles = useStyles();
53
+ }));
54
+ export default withTheme(TapasTabTitle);
55
+
56
+ // Export aliases for compatibility
57
+ export const TabTitle = withTheme(TapasTabTitle);
58
+ export { TapasTabTitle };
59
+ //# sourceMappingURL=TabTitle.js.mapStyles();
51
60
  return react_1.default.createElement(react_native_1.View, __assign({
52
61
  style: [styles.container, style]
53
62
  }, otherProps), react_1.default.createElement(react_native_1.Text, __assign({
@@ -1,124 +1,49 @@
1
- "use strict";
2
-
3
- var __assign = this && this.__assign || function () {
4
- __assign = Object.assign || function (t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = {
18
- enumerable: true,
19
- get: function () {
20
- return m[k];
21
- }
22
- };
23
- }
24
- Object.defineProperty(o, k2, desc);
25
- } : function (o, m, k, k2) {
26
- if (k2 === undefined) k2 = k;
27
- o[k2] = m[k];
28
- });
29
- var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
30
- Object.defineProperty(o, "default", {
31
- enumerable: true,
32
- value: v
33
- });
34
- } : function (o, v) {
35
- o["default"] = v;
36
- });
37
- var __importStar = this && this.__importStar || function () {
38
- var ownKeys = function (o) {
39
- ownKeys = Object.getOwnPropertyNames || function (o) {
40
- var ar = [];
41
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
42
- return ar;
43
- };
44
- return ownKeys(o);
45
- };
46
- return function (mod) {
47
- if (mod && mod.__esModule) return mod;
48
- var result = {};
49
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
50
- __setModuleDefault(result, mod);
51
- return result;
52
- };
53
- }();
54
- var __rest = this && this.__rest || function (s, e) {
55
- var t = {};
56
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
57
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
58
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
59
- }
60
- return t;
61
- };
62
- var __importDefault = this && this.__importDefault || function (mod) {
63
- return mod && mod.__esModule ? mod : {
64
- "default": mod
65
- };
66
- };
67
- Object.defineProperty(exports, "__esModule", {
68
- value: true
69
- });
70
- exports.TapasTableColumnHeader = exports.TableColumnHeader = void 0;
71
- var react_1 = __importStar(require("react"));
72
- var react_native_1 = require("react-native");
73
- var themed_1 = require("@rneui/themed");
74
- var TapasIcon_1 = __importDefault(require("../Icons/TapasIcon"));
75
- var TapasTableColumnHeader = function (_a) {
76
- var title = _a.title,
77
- columnIndex = _a.columnIndex,
78
- fieldName = _a.fieldName,
79
- _b = _a.sortable,
80
- sortable = _b === void 0 ? false : _b,
81
- _c = _a.sortDirection,
82
- sortDirection = _c === void 0 ? null : _c,
83
- _d = _a.textAlign,
84
- textAlign = _d === void 0 ? "left" : _d,
85
- titleStyle = _a.titleStyle,
86
- sortButtonStyle = _a.sortButtonStyle,
87
- _e = _a.padding,
88
- padding = _e === void 0 ? {
89
- horizontal: 16,
90
- vertical: 8
91
- } : _e,
92
- onSort = _a.onSort,
93
- onPress = _a.onPress,
94
- onLongPress = _a.onLongPress,
95
- _f = _a.disabled,
96
- disabled = _f === void 0 ? false : _f,
97
- _g = _a.sortIconSize,
98
- sortIconSize = _g === void 0 ? 18 : _g,
99
- activeSortIconColor = _a.activeSortIconColor,
100
- inactiveSortIconColor = _a.inactiveSortIconColor,
101
- _h = _a.sortIcons,
102
- sortIcons = _h === void 0 ? {
103
- ascending: "arrow_drop_up",
104
- descending: "arrow_drop_down"
105
- } : _h,
106
- _j = _a.showSortIndicator,
107
- showSortIndicator = _j === void 0 ? true : _j,
108
- _k = _a.minHeight,
109
- minHeight = _k === void 0 ? 40 : _k,
110
- style = _a.style,
111
- otherProps = __rest(_a, ["title", "columnIndex", "fieldName", "sortable", "sortDirection", "textAlign", "titleStyle", "sortButtonStyle", "padding", "onSort", "onPress", "onLongPress", "disabled", "sortIconSize", "activeSortIconColor", "inactiveSortIconColor", "sortIcons", "showSortIndicator", "minHeight", "style"]);
112
- var styles = useStyles({
113
- textAlign: textAlign,
114
- padding: padding,
115
- minHeight: minHeight,
116
- disabled: disabled
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import React, { useCallback } from "react";
3
+ import { View, Text, Pressable } from "react-native";
4
+ import { withTheme, makeStyles } from "@rneui/themed";
5
+ import TapasIcon from "../Icons/TapasIcon";
6
+ const TapasTableColumnHeader = ({
7
+ title,
8
+ columnIndex,
9
+ fieldName,
10
+ sortable = false,
11
+ sortDirection = null,
12
+ textAlign = "left",
13
+ titleStyle,
14
+ sortButtonStyle,
15
+ padding = {
16
+ horizontal: 16,
17
+ vertical: 8
18
+ },
19
+ onSort,
20
+ onPress,
21
+ onLongPress,
22
+ disabled = false,
23
+ sortIconSize = 18,
24
+ activeSortIconColor,
25
+ inactiveSortIconColor,
26
+ sortIcons = {
27
+ ascending: "arrow_drop_up",
28
+ descending: "arrow_drop_down"
29
+ },
30
+ showSortIndicator = true,
31
+ minHeight = 40,
32
+ style,
33
+ ...otherProps
34
+ }) => {
35
+ const styles = useStyles({
36
+ textAlign,
37
+ padding,
38
+ minHeight,
39
+ disabled
117
40
  });
41
+
118
42
  // 处理排序点击
119
- var handleSortPress = (0, react_1.useCallback)(function () {
43
+ const handleSortPress = useCallback(() => {
120
44
  if (!sortable || disabled || !fieldName) return;
121
- var newDirection;
45
+ let newDirection;
46
+
122
47
  // 排序逻辑:null -> ASC -> DESC -> null
123
48
  switch (sortDirection) {
124
49
  case null:
@@ -133,10 +58,11 @@ var TapasTableColumnHeader = function (_a) {
133
58
  default:
134
59
  newDirection = "ASC";
135
60
  }
136
- onSort === null || onSort === void 0 ? void 0 : onSort(fieldName, newDirection, columnIndex);
61
+ onSort?.(fieldName, newDirection, columnIndex);
137
62
  }, [sortable, disabled, fieldName, sortDirection, onSort, columnIndex]);
63
+
138
64
  // 处理普通点击
139
- var handlePress = (0, react_1.useCallback)(function () {
65
+ const handlePress = useCallback(() => {
140
66
  if (disabled) return;
141
67
  if (sortable) {
142
68
  handleSortPress();
@@ -144,18 +70,119 @@ var TapasTableColumnHeader = function (_a) {
144
70
  onPress(fieldName, columnIndex);
145
71
  }
146
72
  }, [disabled, sortable, handleSortPress, onPress, fieldName, columnIndex]);
73
+
147
74
  // 处理长按
148
- var handleLongPress = (0, react_1.useCallback)(function () {
75
+ const handleLongPress = useCallback(() => {
149
76
  if (disabled || !fieldName) return;
150
- onLongPress === null || onLongPress === void 0 ? void 0 : onLongPress(fieldName, columnIndex);
77
+ onLongPress?.(fieldName, columnIndex);
151
78
  }, [disabled, fieldName, onLongPress, columnIndex]);
79
+
152
80
  // 渲染排序指示器
153
- var renderSortIndicator = function () {
81
+ const renderSortIndicator = () => {
154
82
  if (!sortable || !showSortIndicator) return null;
155
- var isAscending = sortDirection === "ASC";
156
- var isDescending = sortDirection === "DESC";
157
- return react_1.default.createElement(react_native_1.View, {
83
+ const isAscending = sortDirection === "ASC";
84
+ const isDescending = sortDirection === "DESC";
85
+ return /*#__PURE__*/React.createElement(View, {
158
86
  style: [styles.sortContainer, sortButtonStyle]
87
+ }, /*#__PURE__*/React.createElement(View, {
88
+ style: styles.sortArrows
89
+ }, /*#__PURE__*/React.createElement(TapasIcon, {
90
+ name: sortIcons.ascending || "arrow_drop_up",
91
+ size: sortIconSize,
92
+ color: isDescending ? activeSortIconColor || styles.activeSortIcon.color : inactiveSortIconColor || styles.inactiveSortIcon.color,
93
+ style: styles.arrowUp
94
+ }), /*#__PURE__*/React.createElement(TapasIcon, {
95
+ name: sortIcons.descending || "arrow_drop_down",
96
+ size: sortIconSize,
97
+ color: isAscending ? activeSortIconColor || styles.activeSortIcon.color : inactiveSortIconColor || styles.inactiveSortIcon.color,
98
+ style: styles.arrowDown
99
+ })));
100
+ };
101
+ const renderContent = () => /*#__PURE__*/React.createElement(View, {
102
+ style: styles.content
103
+ }, /*#__PURE__*/React.createElement(Text, {
104
+ style: [styles.title, titleStyle],
105
+ numberOfLines: 2,
106
+ ellipsizeMode: "tail"
107
+ }, title), renderSortIndicator());
108
+
109
+ // 如果可排序或有点击事件,使用 Pressable
110
+ if (sortable || onPress || onLongPress) {
111
+ return /*#__PURE__*/React.createElement(Pressable, _extends({}, otherProps, {
112
+ style: [styles.container, style],
113
+ onPress: handlePress,
114
+ onLongPress: handleLongPress,
115
+ disabled: disabled
116
+ }), renderContent());
117
+ }
118
+
119
+ // 否则使用普通 View
120
+ return /*#__PURE__*/React.createElement(View, _extends({}, otherProps, {
121
+ style: [styles.container, style]
122
+ }), renderContent());
123
+ };
124
+ const useStyles = makeStyles((theme, props) => {
125
+ const textAlign = props?.textAlign || "left";
126
+ const paddingHorizontal = props?.padding?.horizontal || 16;
127
+ const paddingVertical = props?.padding?.vertical || 8;
128
+ const minHeight = props?.minHeight || 40;
129
+ const disabled = props?.disabled || false;
130
+ return {
131
+ container: {
132
+ minHeight,
133
+ paddingHorizontal,
134
+ paddingVertical,
135
+ backgroundColor: theme?.colors?.grey5 || "#f8f9fa",
136
+ borderBottomWidth: 1,
137
+ borderBottomColor: theme?.colors?.grey3 || "#e0e0e0",
138
+ opacity: disabled ? 0.5 : 1
139
+ },
140
+ content: {
141
+ flex: 1,
142
+ flexDirection: "row",
143
+ alignItems: "center",
144
+ justifyContent: textAlign === "left" ? "flex-start" : textAlign === "right" ? "flex-end" : "center",
145
+ gap: 8
146
+ },
147
+ title: {
148
+ fontSize: theme?.fonts?.sizeS || 14,
149
+ fontWeight: "600",
150
+ color: theme?.colors?.colorTextSecondary || theme?.colors?.grey1 || "#333",
151
+ flexShrink: 1
152
+ },
153
+ sortContainer: {
154
+ flexShrink: 0
155
+ },
156
+ sortArrows: {
157
+ flexDirection: "column",
158
+ alignItems: "center",
159
+ justifyContent: "center",
160
+ height: 20,
161
+ width: 16,
162
+ position: "relative"
163
+ },
164
+ arrowUp: {
165
+ position: "absolute",
166
+ top: -2
167
+ },
168
+ arrowDown: {
169
+ position: "absolute",
170
+ bottom: -2
171
+ },
172
+ activeSortIcon: {
173
+ color: theme?.colors?.primary || "#007AFF"
174
+ },
175
+ inactiveSortIcon: {
176
+ color: theme?.colors?.grey2 || "#999"
177
+ }
178
+ };
179
+ });
180
+ export default withTheme(TapasTableColumnHeader);
181
+
182
+ // Export aliases for compatibility
183
+ export const TableColumnHeader = withTheme(TapasTableColumnHeader);
184
+ export { TapasTableColumnHeader };
185
+ //# sourceMappingURL=TableColumnHeader.js.mapyles.sortContainer, sortButtonStyle]
159
186
  }, react_1.default.createElement(react_native_1.View, {
160
187
  style: styles.sortArrows
161
188
  }, react_1.default.createElement(TapasIcon_1.default, {