@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.
- package/commonjs/AnimatedNavItem/index.js.map +2 -1
- package/commonjs/BarChart/BarChart.js +112 -90
- package/commonjs/BarChart/BarChart.js.map +1 -1
- package/commonjs/Button/Button.js +96 -78
- package/commonjs/Button/Button.js.map +1 -2
- package/commonjs/Button/ButtonGroup.js +156 -136
- package/commonjs/Button/ButtonGroup.js.map +1 -2
- package/commonjs/Calendar/Calendar.base.js +162 -190
- package/commonjs/Calendar/Calendar.base.js.map +1 -2
- package/commonjs/Calendar/Calendar.js +86 -102
- package/commonjs/Calendar/Calendar.js.map +2 -1
- package/commonjs/Calendar/CustomRange.js +271 -324
- package/commonjs/Calendar/DaySelector.js +115 -113
- package/commonjs/Calendar/DaySelector.js.map +2 -1
- package/commonjs/Calendar/MonthSelector.js +118 -115
- package/commonjs/Calendar/local.js +2 -2
- package/commonjs/Calendar/local.js.map +2 -1
- package/commonjs/Calendar/types.js +11 -11
- package/commonjs/CheckBox/CheckBox.js +96 -63
- package/commonjs/CheckBox/CheckBox.js.map +1 -2
- package/commonjs/CheckBox/CheckBoxItem.js +78 -57
- package/commonjs/CheckBox/CheckBoxItem.js.map +1 -2
- package/commonjs/CircularProgress/CircularProgress.js +25 -23
- package/commonjs/CircularProgress/CircularProgress.js.map +1 -2
- package/commonjs/Collapsible/Collapsible.js +60 -74
- package/commonjs/Collapsible/Collapsible.js.map +2 -1
- package/commonjs/DashboardCard/DashboardCard.js +74 -94
- package/commonjs/DashboardCard/DashboardCard.js.map +1 -1
- package/commonjs/DataCell/DataCell.js +108 -0
- package/commonjs/DataCell/DataCell.js.map +1 -0
- package/commonjs/DataCell/index.js +15 -9
- package/commonjs/DataTable/DataTable.js +0 -69
- package/commonjs/DataTable/index.js.map +2 -1
- package/commonjs/DeviceSelectionModal/DeviceSelectionModal.js +242 -244
- package/commonjs/DeviceSelectionModal/DeviceSelectionModal.js.map +1 -2
- package/commonjs/DraggableFlatList/DraggableFlatList.js +1 -1
- package/commonjs/Dropdown/InputDropdown.js.map +2 -1
- package/commonjs/Gantt/Accessories.js +135 -168
- package/commonjs/Gantt/Accessories.js.map +1 -2
- package/commonjs/Gantt/Gantt.js +149 -149
- package/commonjs/Gantt/Gantt.js.map +2 -1
- package/commonjs/Gantt/GanttInnerElementType.js +93 -102
- package/commonjs/Gantt/GanttInnerElementType.js.map +2 -1
- package/commonjs/Gantt/helper.js +119 -145
- package/commonjs/Gantt/types.js +4 -4
- package/commonjs/Grid/VariableSizeGrid.js +120 -113
- package/commonjs/Grid/VariableSizeGrid.js.map +2 -1
- package/commonjs/Grid/helper.js.map +2 -1
- package/commonjs/Grid/timer.js +9 -5
- package/commonjs/Grid/timer.js.map +1 -2
- package/commonjs/HelloWave/HelloWave.js +46 -53
- package/commonjs/HelloWave/HelloWave.js.map +1 -2
- package/commonjs/Hoverable/Hoverable.js +35 -33
- package/commonjs/Hoverable/Hoverable.js.map +2 -2
- package/commonjs/IconText/IconText.js +88 -65
- package/commonjs/IconText/IconText.js.map +2 -1
- package/commonjs/Icons/TapasIcon.js +99 -100
- package/commonjs/Icons/TapasIcon.js.map +1 -2
- package/commonjs/Icons/TapasIconExpo.js +101 -94
- package/commonjs/Icons/smartFontLoader.js +266 -222
- package/commonjs/Image/PreviewImg.js +85 -63
- package/commonjs/Image/PreviewImg.js.map +1 -2
- package/commonjs/Layout/DrawerContext.js +49 -35
- package/commonjs/Layout/DrawerContext.js.map +1 -2
- package/commonjs/Layout/ToastContext.js +34 -46
- package/commonjs/LineChart/LineChart.js +126 -144
- package/commonjs/LineChart/LineChart.js.map +1 -2
- package/commonjs/LineChart/index.js +4 -3
- package/commonjs/LineChart/index.js.map +1 -2
- package/commonjs/ListItem/ListItem.js +80 -108
- package/commonjs/ListItem/ListItem.js.map +2 -1
- package/commonjs/Loading/Loading.js +66 -54
- package/commonjs/Loading/Loading.js.map +1 -1
- package/commonjs/MessageBox/MessageBox.js +127 -126
- package/commonjs/MessageBox/MessageBox.js.map +2 -1
- package/commonjs/MultiSelector/MultiSelector.js +250 -225
- package/commonjs/MultiSelector/index.js +6 -8
- package/commonjs/MultiSelector/index.js.map +2 -1
- package/commonjs/Navigation/Navigation.js +65 -0
- package/commonjs/Navigation/Navigation.js.map +1 -0
- package/commonjs/Notification/Notification.js +110 -89
- package/commonjs/Notification/index.js +6 -8
- package/commonjs/Notification/index.js.map +2 -1
- package/commonjs/NumericInput/NumericInput.js +23 -0
- package/commonjs/NumericInput/NumericInput.js.map +1 -0
- package/commonjs/Overlay/Overlay.js +24 -45
- package/commonjs/Overlay/Overlay.js.map +1 -1
- package/commonjs/Pagination/Pagination.js +93 -151
- package/commonjs/Pagination/Pagination.js.map +1 -1
- package/commonjs/PieChart/PieChart.js.map +2 -1
- package/commonjs/PieChart/index.js +3 -4
- package/commonjs/PieChart/index.js.map +2 -1
- package/commonjs/Popover/Popover.js +112 -137
- package/commonjs/Popover/Popover.js.map +1 -2
- package/commonjs/Progress/Progress.js +54 -48
- package/commonjs/Progress/Progress.js.map +1 -2
- package/commonjs/Quantity/Quantity.js +52 -127
- package/commonjs/Quantity/Quantity.js.map +0 -1
- package/commonjs/Quantity/index.js +8 -6
- package/commonjs/Quantity/index.js.map +1 -2
- package/commonjs/ReasonModal/ReasonModal.js +125 -122
- package/commonjs/ReasonModal/ReasonModal.js.map +2 -1
- package/commonjs/ReasonModal/index.js +9 -15
- package/commonjs/ReasonModal/index.js.map +1 -2
- package/commonjs/SearchInput/SearchInput.js +92 -108
- package/commonjs/SheetTitle/SheetTitle.js +0 -6
- package/commonjs/SheetTitle/SheetTitle.js.map +0 -1
- package/commonjs/Shell/Shell.js +84 -92
- package/commonjs/Shell/Shell.js.map +2 -1
- package/commonjs/Shell/styles.js.map +1 -2
- package/commonjs/Shell/types.js +2 -2
- package/commonjs/Shell/types.js.map +1 -2
- package/commonjs/StatisticCard/StatisticCard.js +41 -47
- package/commonjs/Steps/Steps.js +41 -40
- package/commonjs/Steps/Steps.js.map +1 -1
- package/commonjs/TabTitle/index.js +0 -1
- package/commonjs/TabTitle/index.js.map +0 -1
- package/commonjs/TableColumnHeader/TableColumnHeader.js +134 -140
- package/commonjs/Tag/Tag.js +0 -41
- package/commonjs/Tag/Tag.js.map +0 -1
- package/commonjs/Task/Task.js +201 -112
- package/commonjs/Task/Task.js.map +2 -1
- package/commonjs/Text/Text.js.map +0 -1
- package/commonjs/Theme/ThemeProvider.js +18 -16
- package/commonjs/Theme/defaultTheme.js +21 -16
- package/commonjs/Theme/defaultTheme.js.map +2 -1
- package/commonjs/Toast/Toast.js +32 -0
- package/commonjs/Toast/Toast.js.map +1 -0
- package/commonjs/UserSwitcher/UserSwitcher.js +147 -144
- package/commonjs/UserSwitcher/UserSwitcher.js.map +2 -1
- package/module/Alert/Alert.js +71 -51
- package/module/Alert/Alert.js.map +2 -1
- package/module/AnimatedNavItem/AnimatedNavItem.js.map +1 -2
- package/module/AnimatedNavItem/index.js +7 -3
- package/module/AnimatedNavItem/index.js.map +1 -2
- package/module/BarChart/BarChart.js +140 -109
- package/module/BarChart/BarChart.js.map +2 -1
- package/module/BarChart/index.js +4 -2
- package/module/Button/ButtonGroup.js +120 -129
- package/module/Button/ButtonGroup.js.map +1 -2
- package/module/Calendar/ConcreteTimeSelector.js +299 -211
- package/module/Calendar/ConcreteTimeSelector.js.map +2 -1
- package/module/Calendar/DaySelector.js +118 -95
- package/module/Calendar/DaySelector.js.map +2 -1
- package/module/Calendar/TimeSelector.js +307 -215
- package/module/Calendar/TimeSelector.js.map +1 -2
- package/module/Calendar/local.js +7 -7
- package/module/Calendar/local.js.map +2 -1
- package/module/Calendar/types.js.map +1 -2
- package/module/Card/Card.js +236 -154
- package/module/Card/Card.js.map +1 -1
- package/module/CheckBox/CheckBox.js +89 -93
- package/module/CheckBox/CheckBox.js.map +2 -1
- package/module/CheckBox/CheckBoxItem.js +84 -69
- package/module/CheckBox/CheckBoxItem.js.map +1 -1
- package/module/CheckBox/GroupCheckBox.js +76 -66
- package/module/CheckBox/GroupCheckBox.js.map +2 -1
- package/module/CircularProgress/CircularProgress.js +0 -22
- package/module/CircularProgress/CircularProgress.js.map +0 -1
- package/module/DashboardCard/DashboardCard.js +88 -80
- package/module/DashboardCard/DashboardCard.js.map +1 -2
- package/module/DataCell/DataCell.js +224 -311
- package/module/DataCell/DataCell.js.map +1 -2
- package/module/DataTable/DataTable.js +100 -0
- package/module/DataTable/index.js.map +1 -2
- package/module/DeviceSelectionModal/DeviceSelectionModal.js +124 -0
- package/module/DeviceSelectionModal/DeviceSelectionModal.js.map +1 -0
- package/module/DraggableFlatList/DraggableFlatList.js +9 -0
- package/module/DraggableFlatList/DraggableFlatList.js.map +1 -0
- package/module/Dropdown/CustomDropdown.js +160 -212
- package/module/Dropdown/CustomDropdown.js.map +1 -1
- package/module/Dropdown/Dropdown.js +408 -484
- package/module/Dropdown/Dropdown.js.map +1 -2
- package/module/Dropdown/InputDropdown.js +134 -116
- package/module/Dropdown/InputDropdown.js.map +2 -1
- package/module/ExternalLink/ExternalLink.js +0 -150
- package/module/ExternalLink/ExternalLink.js.map +0 -1
- package/module/Gantt/Accessories.js.map +2 -1
- package/module/Gantt/Gantt.js +152 -139
- package/module/Gantt/Gantt.js.map +2 -1
- package/module/Gantt/GanttInnerElementType.js.map +1 -2
- package/module/Gantt/helper.js +163 -129
- package/module/Gantt/types.js +8 -4
- package/module/Gantt/types.js.map +1 -2
- package/module/Grid/VariableSizeGrid.js +118 -121
- package/module/Grid/VariableSizeGrid.js.map +1 -2
- package/module/Grid/helper.js.map +2 -1
- package/module/Grid/timer.js +16 -14
- package/module/Grid/timer.js.map +1 -2
- package/module/HelloWave/HelloWave.js +53 -43
- package/module/HelloWave/HelloWave.js.map +2 -1
- package/module/Hoverable/Hoverable.js +66 -69
- package/module/Hoverable/Hoverable.js.map +1 -2
- package/module/Icons/TapasIcon.js +96 -120
- package/module/Icons/TapasIcon.js.map +1 -2
- package/module/Icons/TapasIconExpo.js +98 -78
- package/module/Icons/TapasIconExpo.js.map +2 -1
- package/module/Icons/fontLoader.js.map +2 -1
- package/module/Icons/index.js +10 -9
- package/module/Icons/smartFontLoader.js.map +2 -1
- package/module/Input/Input.js +74 -0
- package/module/Input/Input.js.map +1 -0
- package/module/Layout/DrawerContext.js +29 -18
- package/module/Layout/DrawerContext.js.map +2 -1
- package/module/Layout/Layout.js +100 -100
- package/module/Layout/index.js +15 -14
- package/module/LineChart/LineChart.js +157 -121
- package/module/Loading/Loading.js +65 -67
- package/module/Loading/Loading.js.map +2 -1
- package/module/MultiSelector/MultiSelector.js.map +2 -1
- package/module/MultiSelector/index.js +2 -3
- package/module/MultiSelector/index.js.map +2 -1
- package/module/Notification/Notification.js +105 -101
- package/module/Notification/Notification.js.map +2 -1
- package/module/Notification/index.js +18 -1
- package/module/Notification/index.js.map +1 -1
- package/module/NumericInput/NumericInput.js.map +1 -0
- package/module/Overlay/Overlay.js +29 -0
- package/module/Overlay/Overlay.js.map +1 -0
- package/module/Pagination/Pagination.js +0 -72
- package/module/Pagination/Pagination.js.map +0 -1
- package/module/PieChart/PieChart.js +101 -76
- package/module/PieChart/PieChart.js.map +1 -2
- package/module/Quantity/Quantity.js +129 -112
- package/module/ReasonModal/ReasonModal.js +114 -145
- package/module/ReasonModal/ReasonModal.js.map +1 -2
- package/module/ReasonModal/index.js +27 -0
- package/module/ScanButton/ScanButton.js +56 -35
- package/module/ScanButton/ScanButton.js.map +1 -1
- package/module/Shell/types.js +2 -4
- package/module/TabTitle/TabTitle.js +57 -48
- package/module/TableColumnHeader/TableColumnHeader.js +153 -126
- package/module/Task/Task.js +113 -207
- package/module/Task/Task.js.map +1 -2
- package/module/Task/type.js +4 -8
- package/module/Task/type.js.map +1 -2
- package/module/Text/Text.js +80 -70
- package/module/Text/Text.js.map +1 -2
- package/module/TextArea/TextArea.js +119 -0
- package/module/TextArea/TextArea.js.map +1 -0
- package/module/Theme/defaultTheme.js +20 -0
- package/module/Theme/defaultTheme.js.map +1 -0
- package/module/Timeline/Timeline.js +54 -0
- package/module/Timeline/Timeline.js.map +1 -0
- package/module/UserSwitcher/UserSwitcher.js.map +2 -1
- package/module/index.js.map +1 -2
- package/package.json +1 -1
- package/typescript/Hoverable/Hoverable.d.ts.map +1 -1
|
@@ -1,53 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
43
|
+
const handleSortPress = useCallback(() => {
|
|
120
44
|
if (!sortable || disabled || !fieldName) return;
|
|
121
|
-
|
|
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
|
|
61
|
+
onSort?.(fieldName, newDirection, columnIndex);
|
|
137
62
|
}, [sortable, disabled, fieldName, sortDirection, onSort, columnIndex]);
|
|
63
|
+
|
|
138
64
|
// 处理普通点击
|
|
139
|
-
|
|
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
|
-
|
|
75
|
+
const handleLongPress = useCallback(() => {
|
|
149
76
|
if (disabled || !fieldName) return;
|
|
150
|
-
onLongPress
|
|
77
|
+
onLongPress?.(fieldName, columnIndex);
|
|
151
78
|
}, [disabled, fieldName, onLongPress, columnIndex]);
|
|
79
|
+
|
|
152
80
|
// 渲染排序指示器
|
|
153
|
-
|
|
81
|
+
const renderSortIndicator = () => {
|
|
154
82
|
if (!sortable || !showSortIndicator) return null;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return
|
|
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, {
|