react-native-exp-fig 0.1.27 → 0.1.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/lib/commonjs/components/activity-timeline/components/activite-row/index.js +130 -0
- package/lib/commonjs/components/activity-timeline/components/activite-row/index.js.map +1 -0
- package/lib/commonjs/components/activity-timeline/index.js +78 -0
- package/lib/commonjs/components/activity-timeline/index.js.map +1 -0
- package/lib/commonjs/components/activity-timeline/interface.js +6 -0
- package/lib/commonjs/components/activity-timeline/interface.js.map +1 -0
- package/lib/commonjs/components/activity-timeline/styles.js +84 -0
- package/lib/commonjs/components/activity-timeline/styles.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stories/activity-timeline/activity-timeline.stories.js +82 -0
- package/lib/commonjs/stories/activity-timeline/activity-timeline.stories.js.map +1 -0
- package/lib/module/components/activity-timeline/components/activite-row/index.js +123 -0
- package/lib/module/components/activity-timeline/components/activite-row/index.js.map +1 -0
- package/lib/module/components/activity-timeline/index.js +70 -0
- package/lib/module/components/activity-timeline/index.js.map +1 -0
- package/lib/module/components/activity-timeline/interface.js +2 -0
- package/lib/module/components/activity-timeline/interface.js.map +1 -0
- package/lib/module/components/activity-timeline/styles.js +78 -0
- package/lib/module/components/activity-timeline/styles.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/stories/activity-timeline/activity-timeline.stories.js +75 -0
- package/lib/module/stories/activity-timeline/activity-timeline.stories.js.map +1 -0
- package/lib/typescript/src/components/activity-timeline/components/activite-row/index.d.ts +10 -0
- package/lib/typescript/src/components/activity-timeline/index.d.ts +16 -0
- package/lib/typescript/src/components/activity-timeline/interface.d.ts +39 -0
- package/lib/typescript/src/components/activity-timeline/styles.d.ts +71 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/stories/activity-timeline/activity-timeline.stories.d.ts +8 -0
- package/package.json +1 -1
- package/src/components/activity-timeline/components/activite-row/index.tsx +133 -0
- package/src/components/activity-timeline/index.tsx +72 -0
- package/src/components/activity-timeline/interface.ts +53 -0
- package/src/components/activity-timeline/styles.ts +69 -0
- package/src/index.ts +1 -0
- package/src/stories/activity-timeline/activity-timeline.stories.tsx +90 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _typography = require("../../../../components/typography");
|
|
10
|
+
var _iconsSvg = require("../../../../common/icons-svg");
|
|
11
|
+
var _asBaseComponent = require("../../../../@types/as-base-component");
|
|
12
|
+
var _theme = require("../../../../styles/theme/theme");
|
|
13
|
+
var _styles = require("../../styles");
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
/**
|
|
17
|
+
* IMPORTS
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// components
|
|
21
|
+
|
|
22
|
+
// commons / svg
|
|
23
|
+
|
|
24
|
+
// typings
|
|
25
|
+
|
|
26
|
+
// styles
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Componente ActivityRows para a interação da ui.
|
|
30
|
+
*/
|
|
31
|
+
const ActivityRows = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
32
|
+
index,
|
|
33
|
+
activities,
|
|
34
|
+
items,
|
|
35
|
+
onAdd,
|
|
36
|
+
onEdit,
|
|
37
|
+
onDelete
|
|
38
|
+
}, ref) => {
|
|
39
|
+
var _activities$date, _activities$time, _activities$title;
|
|
40
|
+
const handleAdd = (0, _react.useCallback)(() => onAdd(activities), [onAdd, activities]);
|
|
41
|
+
const handleEdit = (0, _react.useCallback)(() => onEdit(activities), [onEdit, activities]);
|
|
42
|
+
const handleDelete = (0, _react.useCallback)(() => onDelete(activities), [onDelete, activities]);
|
|
43
|
+
const isInvalid = !!activities.invalid;
|
|
44
|
+
const dateText = activities.date instanceof Date ? `${String(activities.date.getDate()).padStart(2, "0")}/${String(activities.date.getMonth() + 1).padStart(2, "0")}/${activities.date.getFullYear()}` : String((_activities$date = activities.date) !== null && _activities$date !== void 0 ? _activities$date : "");
|
|
45
|
+
const timeText = activities.time instanceof Date ? `${String(activities.time.getHours()).padStart(2, "0")}:${String(activities.time.getMinutes()).padStart(2, "0")}` : String((_activities$time = activities.time) !== null && _activities$time !== void 0 ? _activities$time : "");
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
47
|
+
ref: ref,
|
|
48
|
+
style: _styles.styles.row
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
50
|
+
style: _styles.styles.badge
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_typography.Typography, {
|
|
52
|
+
text: String(index + 1),
|
|
53
|
+
color: _theme.theme.colors.neutral[25],
|
|
54
|
+
size: _theme.theme.fontSizes.sm,
|
|
55
|
+
fontFamily: _theme.theme.fonts.inter_bold_700
|
|
56
|
+
})), Boolean(index !== (items === null || items === void 0 ? void 0 : items.length) - 1) && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
57
|
+
style: {
|
|
58
|
+
width: 2,
|
|
59
|
+
height: 76,
|
|
60
|
+
backgroundColor: _theme.theme.colors.blue[500],
|
|
61
|
+
position: "absolute",
|
|
62
|
+
left: 21,
|
|
63
|
+
top: 60
|
|
64
|
+
}
|
|
65
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
66
|
+
style: _styles.styles.card
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement(_typography.Typography, {
|
|
68
|
+
numberOfLines: 1,
|
|
69
|
+
style: _styles.styles.title,
|
|
70
|
+
text: (_activities$title = activities.title) !== null && _activities$title !== void 0 ? _activities$title : "Não informada",
|
|
71
|
+
color: isInvalid ? _theme.theme.colors.red[900] : _theme.theme.colors.blue[500],
|
|
72
|
+
size: 14,
|
|
73
|
+
fontFamily: _theme.theme.fonts.inter_medium_500,
|
|
74
|
+
lineHeight: 34
|
|
75
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
76
|
+
style: [_styles.styles.pill, isInvalid ? _styles.styles.pillInvalid : _styles.styles.pillOk]
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement(_iconsSvg.Icons, {
|
|
78
|
+
icon: "CALENDAR",
|
|
79
|
+
size: 18,
|
|
80
|
+
color: isInvalid ? _theme.theme.colors.red[900] : _theme.theme.colors.blue[500]
|
|
81
|
+
}), /*#__PURE__*/_react.default.createElement(_typography.Typography, {
|
|
82
|
+
text: dateText,
|
|
83
|
+
color: isInvalid ? _theme.theme.colors.red[800] : _theme.theme.colors.blue[400],
|
|
84
|
+
size: _theme.theme.fontSizes.xs,
|
|
85
|
+
fontFamily: _theme.theme.fonts.inter_medium_500
|
|
86
|
+
}), /*#__PURE__*/_react.default.createElement(_typography.Typography, {
|
|
87
|
+
text: "|",
|
|
88
|
+
color: isInvalid ? _theme.theme.colors.red[800] : _theme.theme.colors.blue[400],
|
|
89
|
+
size: _theme.theme.fontSizes.sm,
|
|
90
|
+
style: _styles.styles.sep
|
|
91
|
+
}), /*#__PURE__*/_react.default.createElement(_typography.Typography, {
|
|
92
|
+
text: timeText,
|
|
93
|
+
color: isInvalid ? _theme.theme.colors.red[800] : _theme.theme.colors.blue[500],
|
|
94
|
+
size: _theme.theme.fontSizes.xs,
|
|
95
|
+
fontFamily: _theme.theme.fonts.inter_medium_500
|
|
96
|
+
}))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
97
|
+
style: _styles.styles.actions
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
99
|
+
style: _styles.styles.iconButton,
|
|
100
|
+
onPress: handleEdit,
|
|
101
|
+
testID: "edit-activity"
|
|
102
|
+
}, /*#__PURE__*/_react.default.createElement(_iconsSvg.Icons, {
|
|
103
|
+
icon: "NOTE_PINCEL",
|
|
104
|
+
size: 18,
|
|
105
|
+
color: _theme.theme.colors.blue[350]
|
|
106
|
+
})), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
107
|
+
style: _styles.styles.iconButton,
|
|
108
|
+
onPress: handleAdd,
|
|
109
|
+
testID: "add-after-activity"
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(_iconsSvg.Icons, {
|
|
111
|
+
icon: "PLUS",
|
|
112
|
+
size: 18,
|
|
113
|
+
color: _theme.theme.colors.green[500]
|
|
114
|
+
})), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
115
|
+
style: _styles.styles.iconButton,
|
|
116
|
+
onPress: handleDelete,
|
|
117
|
+
testID: "delete-activity"
|
|
118
|
+
}, /*#__PURE__*/_react.default.createElement(_iconsSvg.Icons, {
|
|
119
|
+
icon: "X_CIRCLE",
|
|
120
|
+
size: 18,
|
|
121
|
+
color: _theme.theme.colors.red[900]
|
|
122
|
+
}))));
|
|
123
|
+
});
|
|
124
|
+
ActivityRows.displayName = "ActivityRows";
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* EXPORTS
|
|
128
|
+
*/
|
|
129
|
+
var _default = exports.default = (0, _asBaseComponent.asBaseComponent)(ActivityRows);
|
|
130
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_typography","_iconsSvg","_asBaseComponent","_theme","_styles","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ActivityRows","forwardRef","index","activities","items","onAdd","onEdit","onDelete","ref","_activities$date","_activities$time","_activities$title","handleAdd","useCallback","handleEdit","handleDelete","isInvalid","invalid","dateText","date","Date","String","getDate","padStart","getMonth","getFullYear","timeText","time","getHours","getMinutes","createElement","View","style","styles","row","badge","Typography","text","color","theme","colors","neutral","size","fontSizes","sm","fontFamily","fonts","inter_bold_700","Boolean","length","width","height","backgroundColor","blue","position","left","top","card","numberOfLines","title","red","inter_medium_500","lineHeight","pill","pillInvalid","pillOk","Icons","icon","xs","sep","actions","TouchableOpacity","iconButton","onPress","testID","green","displayName","_default","exports","asBaseComponent"],"sources":["index.tsx"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport React, { forwardRef, useCallback } from \"react\";\r\nimport { TouchableOpacity, View } from \"react-native\";\r\n\r\n// components\r\nimport { Typography } from \"../../../../components/typography\";\r\n\r\n// commons / svg\r\nimport { Icons } from \"../../../../common/icons-svg\";\r\n\r\n// typings\r\nimport type { IActivitieRowProps } from \"../../interface\";\r\nimport { asBaseComponent } from \"../../../../@types/as-base-component\";\r\n\r\n// styles\r\nimport { theme } from \"../../../../styles/theme/theme\";\r\nimport { styles } from \"../../styles\";\r\n\r\n/**\r\n * Componente ActivityRows para a interação da ui.\r\n */\r\nconst ActivityRows = forwardRef<any, IActivitieRowProps<any>>(\r\n ({ index, activities, items, onAdd, onEdit, onDelete }, ref): React.ReactElement => {\r\n const handleAdd = useCallback(() => onAdd(activities), [onAdd, activities]);\r\n const handleEdit = useCallback(() => onEdit(activities), [onEdit, activities]);\r\n const handleDelete = useCallback(() => onDelete(activities), [onDelete, activities]);\r\n\r\n const isInvalid = !!activities.invalid;\r\n\r\n const dateText =\r\n activities.date instanceof Date\r\n ? `${String(activities.date.getDate()).padStart(2, \"0\")}/${String(\r\n activities.date.getMonth() + 1\r\n ).padStart(2, \"0\")}/${activities.date.getFullYear()}`\r\n : String(activities.date ?? \"\");\r\n\r\n const timeText =\r\n activities.time instanceof Date\r\n ? `${String(activities.time.getHours()).padStart(2, \"0\")}:${String(\r\n activities.time.getMinutes()\r\n ).padStart(2, \"0\")}`\r\n : String(activities.time ?? \"\");\r\n\r\n return (\r\n <View ref={ref} style={styles.row}>\r\n <View style={styles.badge}>\r\n <Typography\r\n text={String(index + 1)}\r\n color={theme.colors.neutral[25]}\r\n size={theme.fontSizes.sm}\r\n fontFamily={theme.fonts.inter_bold_700}\r\n />\r\n </View>\r\n\r\n {Boolean(index !== items?.length - 1) && (\r\n <View\r\n style={{\r\n width: 2,\r\n height: 76,\r\n backgroundColor: theme.colors.blue[500],\r\n position: \"absolute\",\r\n left: 21,\r\n top: 60,\r\n }}\r\n />\r\n )}\r\n\r\n <View style={styles.card}>\r\n <Typography\r\n numberOfLines={1}\r\n style={styles.title}\r\n text={activities.title ?? \"Não informada\"}\r\n color={isInvalid ? theme.colors.red[900] : theme.colors.blue[500]}\r\n size={14}\r\n fontFamily={theme.fonts.inter_medium_500}\r\n lineHeight={34}\r\n />\r\n\r\n <View style={[styles.pill, isInvalid ? styles.pillInvalid : styles.pillOk]}>\r\n <Icons\r\n icon=\"CALENDAR\"\r\n size={18}\r\n color={isInvalid ? theme.colors.red[900] : theme.colors.blue[500]}\r\n />\r\n <Typography\r\n text={dateText}\r\n color={isInvalid ? theme.colors.red[800] : theme.colors.blue[400]}\r\n size={theme.fontSizes.xs}\r\n fontFamily={theme.fonts.inter_medium_500}\r\n />\r\n <Typography\r\n text=\"|\"\r\n color={isInvalid ? theme.colors.red[800] : theme.colors.blue[400]}\r\n size={theme.fontSizes.sm}\r\n style={styles.sep}\r\n />\r\n <Typography\r\n text={timeText}\r\n color={isInvalid ? theme.colors.red[800] : theme.colors.blue[500]}\r\n size={theme.fontSizes.xs}\r\n fontFamily={theme.fonts.inter_medium_500}\r\n />\r\n </View>\r\n </View>\r\n\r\n <View style={styles.actions}>\r\n <TouchableOpacity style={styles.iconButton} onPress={handleEdit} testID=\"edit-activity\">\r\n <Icons icon=\"NOTE_PINCEL\" size={18} color={theme.colors.blue[350]} />\r\n </TouchableOpacity>\r\n\r\n <TouchableOpacity style={styles.iconButton} onPress={handleAdd} testID=\"add-after-activity\">\r\n {/* Não há PLUS_CONTAINER, usando PLUS como alternativa visual */}\r\n <Icons icon=\"PLUS\" size={18} color={theme.colors.green[500]} />\r\n </TouchableOpacity>\r\n\r\n <TouchableOpacity style={styles.iconButton} onPress={handleDelete} testID=\"delete-activity\">\r\n {/* Não há TRASH, usando X_CIRCLE como alternativa de remover */}\r\n <Icons icon=\"X_CIRCLE\" size={18} color={theme.colors.red[900]} />\r\n </TouchableOpacity>\r\n </View>\r\n </View>\r\n );\r\n }\r\n);\r\n\r\nActivityRows.displayName = \"ActivityRows\";\r\n\r\n/**\r\n * EXPORTS\r\n */\r\nexport default asBaseComponent(ActivityRows);"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,WAAA,GAAAF,OAAA;AAGA,IAAAG,SAAA,GAAAH,OAAA;AAIA,IAAAI,gBAAA,GAAAJ,OAAA;AAGA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAAsC,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GA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M,CAACuC,UAAW;IAACC,OAAO,EAAE7D,SAAU;IAAC8D,MAAM,EAAC;EAAoB,gBAEzFvG,MAAA,CAAAe,OAAA,CAAA4C,aAAA,CAACtD,SAAA,CAAA0F,KAAK;IAACC,IAAI,EAAC,MAAM;IAACzB,IAAI,EAAE,EAAG;IAACJ,KAAK,EAAEC,YAAK,CAACC,MAAM,CAACmC,KAAK,CAAC,GAAG;EAAE,CAAE,CAC9C,CAAC,eAEnBxG,MAAA,CAAAe,OAAA,CAAA4C,aAAA,CAACxD,YAAA,CAAAiG,gBAAgB;IAACvC,KAAK,EAAEC,cAAM,CAACuC,UAAW;IAACC,OAAO,EAAE1D,YAAa;IAAC2D,MAAM,EAAC;EAAiB,gBAEzFvG,MAAA,CAAAe,OAAA,CAAA4C,aAAA,CAACtD,SAAA,CAAA0F,KAAK;IAACC,IAAI,EAAC,UAAU;IAACzB,IAAI,EAAE,EAAG;IAACJ,KAAK,EAAEC,YAAK,CAACC,MAAM,CAACoB,GAAG,CAAC,GAAG;EAAE,CAAE,CAChD,CACd,CACF,CAAC;AAEX,CACF,CAAC;AAED5D,YAAY,CAAC4E,WAAW,GAAG,cAAc;;AAEzC;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAA5F,OAAA,GAGe,IAAA6F,gCAAe,EAAC/E,YAAY,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _activiteRow = _interopRequireDefault(require("./components/activite-row"));
|
|
10
|
+
var _asBaseComponent = require("../../@types/as-base-component");
|
|
11
|
+
var _styles = require("./styles");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
/**
|
|
16
|
+
* IMPORTS
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// components
|
|
20
|
+
|
|
21
|
+
// typings
|
|
22
|
+
|
|
23
|
+
// styles
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Componente ActivityTimeline para a interação da ui.
|
|
27
|
+
*/
|
|
28
|
+
const ActivityTimeline = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
29
|
+
data,
|
|
30
|
+
onAdd,
|
|
31
|
+
onEdit,
|
|
32
|
+
onDelete,
|
|
33
|
+
showIndexBadge = true,
|
|
34
|
+
testID = "activity-timeline"
|
|
35
|
+
}, ref) => {
|
|
36
|
+
const keyExtractor = (0, _react.useCallback)(it => String(it.id), []);
|
|
37
|
+
const renderItem = (0, _react.useCallback)(({
|
|
38
|
+
item,
|
|
39
|
+
index
|
|
40
|
+
}) => /*#__PURE__*/_react.default.createElement(_activiteRow.default, {
|
|
41
|
+
index: index,
|
|
42
|
+
items: data,
|
|
43
|
+
activities: item,
|
|
44
|
+
onAdd: onAdd,
|
|
45
|
+
onEdit: onEdit,
|
|
46
|
+
onDelete: onDelete,
|
|
47
|
+
showIndexBadge: showIndexBadge
|
|
48
|
+
}), [onAdd, onEdit, onDelete, showIndexBadge]);
|
|
49
|
+
const getItemLayout = (0, _react.useCallback)((_, index) => ({
|
|
50
|
+
length: _styles.ROW_HEIGHT,
|
|
51
|
+
offset: _styles.ROW_HEIGHT * index,
|
|
52
|
+
index
|
|
53
|
+
}), []);
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.FlatList, {
|
|
55
|
+
ref: ref,
|
|
56
|
+
testID: testID,
|
|
57
|
+
data: data,
|
|
58
|
+
keyExtractor: keyExtractor,
|
|
59
|
+
renderItem: renderItem,
|
|
60
|
+
contentContainerStyle: _styles.styles.listContainer,
|
|
61
|
+
getItemLayout: getItemLayout,
|
|
62
|
+
initialNumToRender: 10,
|
|
63
|
+
maxToRenderPerBatch: 10,
|
|
64
|
+
removeClippedSubviews: true,
|
|
65
|
+
windowSize: 7,
|
|
66
|
+
ListEmptyComponent: /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
67
|
+
style: {
|
|
68
|
+
height: 8
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* EXPORTS
|
|
76
|
+
*/
|
|
77
|
+
var _default = exports.default = (0, _asBaseComponent.asBaseComponent)(ActivityTimeline);
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_activiteRow","_interopRequireDefault","_asBaseComponent","_styles","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ActivityTimeline","forwardRef","data","onAdd","onEdit","onDelete","showIndexBadge","testID","ref","keyExtractor","useCallback","it","String","id","renderItem","item","index","createElement","items","activities","getItemLayout","_","length","ROW_HEIGHT","offset","FlatList","contentContainerStyle","styles","listContainer","initialNumToRender","maxToRenderPerBatch","removeClippedSubviews","windowSize","ListEmptyComponent","View","style","height","_default","exports","asBaseComponent"],"sources":["index.tsx"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport React, { forwardRef, useCallback } from \"react\";\r\nimport { View, FlatList } from \"react-native\";\r\n\r\n// components\r\nimport ActivityRows from \"./components/activite-row\";\r\n\r\n// typings\r\nimport type { ActivityItemModel, ActivityTimelineProps } from \"./interface\";\r\nimport { asBaseComponent } from \"../../@types/as-base-component\";\r\n\r\n// styles\r\nimport { styles, ROW_HEIGHT } from \"./styles\";\r\n\r\n/**\r\n * Componente ActivityTimeline para a interação da ui.\r\n */\r\nconst ActivityTimeline = forwardRef<any, ActivityTimelineProps<any>>(\r\n (\r\n { data, onAdd, onEdit, onDelete, showIndexBadge = true, testID = \"activity-timeline\" },\r\n ref\r\n ): React.ReactElement => {\r\n const keyExtractor = useCallback((it: ActivityItemModel) => String(it.id), []);\r\n\r\n const renderItem = useCallback(\r\n ({ item, index }: { item: ActivityItemModel; index: number }) => (\r\n <ActivityRows\r\n index={index}\r\n items={data}\r\n activities={item}\r\n onAdd={onAdd}\r\n onEdit={onEdit}\r\n onDelete={onDelete}\r\n showIndexBadge={showIndexBadge}\r\n />\r\n ),\r\n [onAdd, onEdit, onDelete, showIndexBadge]\r\n );\r\n\r\n const getItemLayout = useCallback(\r\n (_: any, index: number) => ({\r\n length: ROW_HEIGHT,\r\n offset: ROW_HEIGHT * index,\r\n index,\r\n }),\r\n []\r\n );\r\n return (\r\n <FlatList\r\n ref={ref}\r\n testID={testID}\r\n data={data}\r\n keyExtractor={keyExtractor}\r\n renderItem={renderItem}\r\n contentContainerStyle={styles.listContainer}\r\n getItemLayout={getItemLayout}\r\n initialNumToRender={10}\r\n maxToRenderPerBatch={10}\r\n removeClippedSubviews\r\n windowSize={7}\r\n ListEmptyComponent={<View style={{ height: 8 }} />}\r\n />\r\n );\r\n }\r\n);\r\n\r\n/**\r\n * EXPORTS\r\n */\r\nexport default asBaseComponent(ActivityTimeline);"],"mappings":";;;;;;AAGA,IAAA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IAAI,EAAEA,IAAK;IACXO,YAAY,EAAEA,YAAa;IAC3BK,UAAU,EAAEA,UAAW;IACvBY,qBAAqB,EAAEC,cAAM,CAACC,aAAc;IAC5CR,aAAa,EAAEA,aAAc;IAC7BS,kBAAkB,EAAE,EAAG;IACvBC,mBAAmB,EAAE,EAAG;IACxBC,qBAAqB;IACrBC,UAAU,EAAE,CAAE;IACdC,kBAAkB,eAAE7D,MAAA,CAAAU,OAAA,CAAAmC,aAAA,CAAC1C,YAAA,CAAA2D,IAAI;MAACC,KAAK,EAAE;QAAEC,MAAM,EAAE;MAAE;IAAE,CAAE;EAAE,CACpD,CAAC;AAEN,CACF,CAAC;;AAED;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAxD,OAAA,GAGe,IAAAyD,gCAAe,EAACvC,gBAAgB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["interface.ts"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport type { TouchableOpacityProps } from \"react-native\";\r\nimport type { SVG_NAME } from \"../../common/icons-svg/constants\";\r\n\r\n/**\r\n * TYPES\r\n */\r\ntype ActivityId = string | number;\r\n\r\ntype ActivityItemModel = {\r\n id: ActivityId;\r\n title: string; // \"Operação com veículo\", \"Refeição\", ...\r\n date: Date | string; // pode vir Date ou string já formatada\r\n time: Date | string; // idem\r\n invalid?: boolean; // destaca em vermelho\r\n};\r\n\r\ntype IconName = keyof typeof SVG_NAME;\r\n\r\ntype OnActivity = (item: ActivityItemModel) => void;\r\n\r\ntype ActivityTimelineProps<T> = TouchableOpacityProps & {\r\n data: T[];\r\n onAdd: OnActivity; // add novo após o item\r\n onEdit: OnActivity;\r\n onDelete: OnActivity;\r\n showIndexBadge?: boolean; // mostra o “3/4/5”\r\n testID?: string;\r\n};\r\n\r\ntype IActivitieRowProps<T> = {\r\n index: number;\r\n activities: ActivityItemModel;\r\n items: T[];\r\n onAdd: OnActivity;\r\n onEdit: OnActivity;\r\n onDelete: OnActivity;\r\n showIndexBadge?: boolean;\r\n};\r\n\r\n/**\r\n * EXPORTS\r\n */\r\nexport type {\r\n ActivityId,\r\n ActivityItemModel,\r\n IconName,\r\n OnActivity,\r\n ActivityTimelineProps,\r\n IActivitieRowProps,\r\n};"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.styles = exports.ROW_HEIGHT = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _theme = require("../../styles/theme/theme");
|
|
9
|
+
/**
|
|
10
|
+
* IMPORTS
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const ROW_HEIGHT = exports.ROW_HEIGHT = 72;
|
|
14
|
+
const styles = exports.styles = _reactNative.StyleSheet.create({
|
|
15
|
+
listContainer: {
|
|
16
|
+
paddingVertical: 8
|
|
17
|
+
},
|
|
18
|
+
row: {
|
|
19
|
+
width: "100%",
|
|
20
|
+
minHeight: ROW_HEIGHT,
|
|
21
|
+
paddingVertical: 8,
|
|
22
|
+
paddingHorizontal: 8,
|
|
23
|
+
flexDirection: "row",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
justifyContent: "center",
|
|
26
|
+
gap: 6
|
|
27
|
+
},
|
|
28
|
+
badge: {
|
|
29
|
+
width: 28,
|
|
30
|
+
height: 28,
|
|
31
|
+
borderRadius: 14,
|
|
32
|
+
backgroundColor: _theme.theme.colors.blue[500],
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
justifyContent: "center"
|
|
35
|
+
},
|
|
36
|
+
card: {
|
|
37
|
+
flex: 1,
|
|
38
|
+
borderRadius: 10
|
|
39
|
+
},
|
|
40
|
+
title: {
|
|
41
|
+
marginBottom: 6
|
|
42
|
+
},
|
|
43
|
+
pill: {
|
|
44
|
+
flexDirection: "row",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
borderWidth: 1,
|
|
47
|
+
borderRadius: 10,
|
|
48
|
+
paddingHorizontal: 10,
|
|
49
|
+
paddingVertical: 8,
|
|
50
|
+
gap: 4
|
|
51
|
+
},
|
|
52
|
+
pillOk: {
|
|
53
|
+
backgroundColor: "#F3F3F5",
|
|
54
|
+
borderColor: "#C4D4E5"
|
|
55
|
+
},
|
|
56
|
+
pillInvalid: {
|
|
57
|
+
backgroundColor: "#FDE7E7",
|
|
58
|
+
borderColor: _theme.theme.colors.red[900]
|
|
59
|
+
},
|
|
60
|
+
sep: {
|
|
61
|
+
marginHorizontal: 8,
|
|
62
|
+
opacity: 0.5
|
|
63
|
+
},
|
|
64
|
+
actions: {
|
|
65
|
+
flexDirection: "row",
|
|
66
|
+
gap: 8
|
|
67
|
+
},
|
|
68
|
+
iconButton: {
|
|
69
|
+
width: 36,
|
|
70
|
+
height: 36,
|
|
71
|
+
borderRadius: 8,
|
|
72
|
+
backgroundColor: _theme.theme.colors.neutral[25],
|
|
73
|
+
borderWidth: 1,
|
|
74
|
+
borderColor: _theme.theme.colors.neutral[200],
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
justifyContent: "center",
|
|
77
|
+
marginTop: 36
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* EXPORTS
|
|
83
|
+
*/
|
|
84
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_theme","ROW_HEIGHT","exports","styles","StyleSheet","create","listContainer","paddingVertical","row","width","minHeight","paddingHorizontal","flexDirection","alignItems","justifyContent","gap","badge","height","borderRadius","backgroundColor","theme","colors","blue","card","flex","title","marginBottom","pill","borderWidth","pillOk","borderColor","pillInvalid","red","sep","marginHorizontal","opacity","actions","iconButton","neutral","marginTop"],"sources":["styles.ts"],"sourcesContent":["/**\r\n * IMPORTS\r\n */\r\nimport { StyleSheet } from \"react-native\";\r\nimport { theme } from \"../../styles/theme/theme\";\r\n\r\nexport const ROW_HEIGHT = 72;\r\n\r\nconst styles = StyleSheet.create({\r\n listContainer: { paddingVertical: 8 },\r\n row: {\r\n width: \"100%\",\r\n minHeight: ROW_HEIGHT,\r\n paddingVertical: 8,\r\n paddingHorizontal: 8,\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n gap: 6,\r\n },\r\n badge: {\r\n width: 28,\r\n height: 28,\r\n borderRadius: 14,\r\n backgroundColor: theme.colors.blue[500],\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n },\r\n card: {\r\n flex: 1,\r\n borderRadius: 10,\r\n },\r\n title: { marginBottom: 6 },\r\n pill: {\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n borderWidth: 1,\r\n borderRadius: 10,\r\n paddingHorizontal: 10,\r\n paddingVertical: 8,\r\n gap: 4,\r\n },\r\n pillOk: {\r\n backgroundColor: \"#F3F3F5\",\r\n borderColor: \"#C4D4E5\",\r\n },\r\n pillInvalid: {\r\n backgroundColor: \"#FDE7E7\",\r\n borderColor: theme.colors.red[900],\r\n },\r\n sep: { marginHorizontal: 8, opacity: 0.5 },\r\n actions: { flexDirection: \"row\", gap: 8 },\r\n iconButton: {\r\n width: 36,\r\n height: 36,\r\n borderRadius: 8,\r\n backgroundColor: theme.colors.neutral[25],\r\n borderWidth: 1,\r\n borderColor: theme.colors.neutral[200],\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n marginTop: 36,\r\n },\r\n});\r\n\r\n/**\r\n * EXPORTS\r\n */\r\nexport { styles };"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIO,MAAME,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,EAAE;AAE5B,MAAME,MAAM,GAAAD,OAAA,CAAAC,MAAA,GAAGC,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AAE,EAAE;IACTQ,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,CAAC;IACfC,eAAe,EAAEC,YAAK,CAACC,MAAM,CAACiB,OAAO,CAAC,EAAE,CAAC;IACzCV,WAAW,EAAE,CAAC;IACdE,WAAW,EAAEV,YAAK,CAACC,MAAM,CAACiB,OAAO,CAAC,GAAG,CAAC;IACtCzB,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxByB,SAAS,EAAE;EACb;AACF,CAAC,CAAC;;AAEF;AACA;AACA","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "ActivitiesProgress", {
|
|
|
15
15
|
return _activitiesProgress.ActivitiesProgress;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "ActivityTimeline", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _activityTimeline.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "AvatarProfile", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function () {
|
|
@@ -292,6 +298,7 @@ var _modalActivityReason = _interopRequireDefault(require("./components/modals/m
|
|
|
292
298
|
var _inputTextCounter = _interopRequireDefault(require("./components/input-text-counter"));
|
|
293
299
|
var _modalCreateActivitie = _interopRequireDefault(require("./components/modal-create-activitie"));
|
|
294
300
|
var _modalJourneyRectification = _interopRequireDefault(require("./components/modal-journey-rectification"));
|
|
301
|
+
var _activityTimeline = _interopRequireDefault(require("./components/activity-timeline"));
|
|
295
302
|
var _mutiply = require("./utils/mutiply");
|
|
296
303
|
var _formatData = require("./utils/format-data");
|
|
297
304
|
var _theme = require("./styles/theme/theme");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_box","_interopRequireDefault","require","_button","_stepIndicator","_typography","_input","_capturePhoto","_cardHours","_selectOption","_headerProfile","_scheduledJourneyIndicators","_cardScheduledJourney","_userProfile","_menuItem","_cardLoading","_cardWorkSession","_loadingProgress","_noData","_filterJourney","_coil","_filterDateSelector","_cardHistory","_notificationLoading","_checkBox","_imageCaptureWithRemove","_loadingDetails","_avatarProfile","_historyDetails","_activitiesDaily","_activitiesProgress","_profileMenuOption","_modalActivities","_historyActivitiesCard","_modalChangeActivity","_modalActivityReason","_inputTextCounter","_modalCreateActivitie","_modalJourneyRectification","_mutiply","_formatData","_theme","e","__esModule","default"],"sources":["index.ts"],"sourcesContent":["/**\r\n * EXPORTS\r\n */\r\n\r\n// Components\r\nexport { default as Box } from \"./components/box\";\r\nexport { Button } from \"./components/button\";\r\nexport { default as StepIndicator } from \"./components/step-indicator\";\r\nexport { Typography } from \"./components/typography\";\r\nexport { Input } from \"./components/input\";\r\nexport { CapturePhoto } from \"./components/capture-photo\";\r\nexport { CardHours } from \"./components/card-hours\";\r\nexport { default as SelectOption } from \"./components/selects/select-option\";\r\nexport { Header } from \"./components/header-profile\";\r\nexport { ScheduledJourneyIndicators } from \"./components/scheduled-journey-indicators\";\r\nexport { CardScheduledJourney } from \"./components/card-scheduled-journey\";\r\nexport { UserProfile } from \"./components/user-profile\";\r\nexport { MenuItem } from \"./components/menu-item\";\r\nexport { CardLoading } from \"./components/card-loading\";\r\nexport { CardWorkSession } from \"./components/card-work-session\";\r\nexport { LoadingProgress } from \"./components/loading-progress\";\r\nexport { NoData } from \"./components/no-data\";\r\nexport { FilterJourney } from \"./components/filter-journey\";\r\nexport { Coil } from \"./components/coil\";\r\nexport { FilterDateSelector } from \"./components/filter-date-selector\";\r\nexport { CardHistory } from \"./components/card-history\";\r\nexport { NotificationLoading } from \"./components/notification-loading\";\r\nexport { CheckBox } from \"./components/check-box\";\r\nexport { ImageCaptureWithRemove } from \"./components/image-capture-with-remove\";\r\nexport { LoadingDetails } from \"./components/loading-details\";\r\nexport { AvatarProfile } from \"./components/avatar-profile\";\r\nexport { HistoryDetails } from \"./components/history-details\";\r\nexport { ActivitiesDaily } from \"./components/activities-daily\";\r\nexport { ActivitiesProgress } from \"./components/activities-progress\";\r\nexport { ProfileMenuOption } from \"./components/profile-menu-option\";\r\nexport { ModalActivities } from \"./components/modals/modal-activities\";\r\nexport { HistoryActivitiesCard } from \"./components/history-activities-card\";\r\nexport { ModalChangeActivity } from \"./components/modals/modal-change-activity\";\r\nexport { default as ModalActivityReason } from \"./components/modals/modal-activity-reason\";\r\nexport { default as InputTextCounter } from \"./components/input-text-counter\";\r\nexport { default as ModalCreteActivitie } from \"./components/modal-create-activitie\";\r\nexport { default as ModalJourneyRectification } from \"./components/modal-journey-rectification\";\r\n\r\n// Utilities\r\nexport { multiply } from \"./utils/mutiply\";\r\nexport { formatDate, getLastSevenDays, formHoursMinute } from \"./utils/format-data\";\r\n\r\n// Styles\r\nexport { theme } from \"./styles/theme/theme\";\r\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_box","_interopRequireDefault","require","_button","_stepIndicator","_typography","_input","_capturePhoto","_cardHours","_selectOption","_headerProfile","_scheduledJourneyIndicators","_cardScheduledJourney","_userProfile","_menuItem","_cardLoading","_cardWorkSession","_loadingProgress","_noData","_filterJourney","_coil","_filterDateSelector","_cardHistory","_notificationLoading","_checkBox","_imageCaptureWithRemove","_loadingDetails","_avatarProfile","_historyDetails","_activitiesDaily","_activitiesProgress","_profileMenuOption","_modalActivities","_historyActivitiesCard","_modalChangeActivity","_modalActivityReason","_inputTextCounter","_modalCreateActivitie","_modalJourneyRectification","_activityTimeline","_mutiply","_formatData","_theme","e","__esModule","default"],"sources":["index.ts"],"sourcesContent":["/**\r\n * EXPORTS\r\n */\r\n\r\n// Components\r\nexport { default as Box } from \"./components/box\";\r\nexport { Button } from \"./components/button\";\r\nexport { default as StepIndicator } from \"./components/step-indicator\";\r\nexport { Typography } from \"./components/typography\";\r\nexport { Input } from \"./components/input\";\r\nexport { CapturePhoto } from \"./components/capture-photo\";\r\nexport { CardHours } from \"./components/card-hours\";\r\nexport { default as SelectOption } from \"./components/selects/select-option\";\r\nexport { Header } from \"./components/header-profile\";\r\nexport { ScheduledJourneyIndicators } from \"./components/scheduled-journey-indicators\";\r\nexport { CardScheduledJourney } from \"./components/card-scheduled-journey\";\r\nexport { UserProfile } from \"./components/user-profile\";\r\nexport { MenuItem } from \"./components/menu-item\";\r\nexport { CardLoading } from \"./components/card-loading\";\r\nexport { CardWorkSession } from \"./components/card-work-session\";\r\nexport { LoadingProgress } from \"./components/loading-progress\";\r\nexport { NoData } from \"./components/no-data\";\r\nexport { FilterJourney } from \"./components/filter-journey\";\r\nexport { Coil } from \"./components/coil\";\r\nexport { FilterDateSelector } from \"./components/filter-date-selector\";\r\nexport { CardHistory } from \"./components/card-history\";\r\nexport { NotificationLoading } from \"./components/notification-loading\";\r\nexport { CheckBox } from \"./components/check-box\";\r\nexport { ImageCaptureWithRemove } from \"./components/image-capture-with-remove\";\r\nexport { LoadingDetails } from \"./components/loading-details\";\r\nexport { AvatarProfile } from \"./components/avatar-profile\";\r\nexport { HistoryDetails } from \"./components/history-details\";\r\nexport { ActivitiesDaily } from \"./components/activities-daily\";\r\nexport { ActivitiesProgress } from \"./components/activities-progress\";\r\nexport { ProfileMenuOption } from \"./components/profile-menu-option\";\r\nexport { ModalActivities } from \"./components/modals/modal-activities\";\r\nexport { HistoryActivitiesCard } from \"./components/history-activities-card\";\r\nexport { ModalChangeActivity } from \"./components/modals/modal-change-activity\";\r\nexport { default as ModalActivityReason } from \"./components/modals/modal-activity-reason\";\r\nexport { default as InputTextCounter } from \"./components/input-text-counter\";\r\nexport { default as ModalCreteActivitie } from \"./components/modal-create-activitie\";\r\nexport { default as ModalJourneyRectification } from \"./components/modal-journey-rectification\";\r\nexport { default as ActivityTimeline } from \"./components/activity-timeline\";\r\n\r\n// Utilities\r\nexport { multiply } from \"./utils/mutiply\";\r\nexport { formatDate, getLastSevenDays, formHoursMinute } from \"./utils/format-data\";\r\n\r\n// Styles\r\nexport { theme } from \"./styles/theme/theme\";\r\n"],"mappings":";;;;;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AA;AACA,IAAA2B,gBAAA,GAAA3B,OAAA;AACA,IAAA4B,mBAAA,GAAA5B,OAAA;AACA,IAAA6B,kBAAA,GAAA7B,OAAA;AACA,IAAA8B,gBAAA,GAAA9B,OAAA;AACA,IAAA+B,sBAAA,GAAA/B,OAAA;AACA,IAAAgC,oBAAA,GAAAhC,OAAA;AACA,IAAAiC,oBAAA,GAAAlC,sBAAA,CAAAC,OAAA;AACA,IAAAkC,iBAAA,GAAAnC,sBAAA,CAAAC,OAAA;AACA,IAAAmC,qBAAA,GAAApC,sBAAA,CAAAC,OAAA;AACA,IAAAoC,0BAAA,GAAArC,sBAAA,CAAAC,OAAA;AACA,IAAAqC,iBAAA,GAAAtC,sBAAA,CAAAC,OAAA;AAGA,IAAAsC,QAAA,GAAAtC,OAAA;AACA,IAAAuC,WAAA,GAAAvC,OAAA;AAGA,IAAAwC,MAAA,GAAAxC,OAAA;AAA6C,SAAAD,uBAAA0C,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.SemBadge = exports.Padrao = exports.ListaVazia = void 0;
|
|
7
|
+
var _activityTimeline = _interopRequireDefault(require("../../components/activity-timeline"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const sampleData = [{
|
|
10
|
+
id: 1,
|
|
11
|
+
title: "Operação com veículo",
|
|
12
|
+
date: "24/03/2025",
|
|
13
|
+
time: "08:00"
|
|
14
|
+
}, {
|
|
15
|
+
id: 2,
|
|
16
|
+
title: "Refeição",
|
|
17
|
+
date: "24/03/2025",
|
|
18
|
+
time: "12:30"
|
|
19
|
+
}, {
|
|
20
|
+
id: 3,
|
|
21
|
+
title: "Aguardando carga",
|
|
22
|
+
date: "24/03/2025",
|
|
23
|
+
time: "14:00",
|
|
24
|
+
invalid: true
|
|
25
|
+
}, {
|
|
26
|
+
id: 4,
|
|
27
|
+
title: "Descanso",
|
|
28
|
+
date: "24/03/2025",
|
|
29
|
+
time: "18:45"
|
|
30
|
+
}];
|
|
31
|
+
const meta = {
|
|
32
|
+
title: "componente/ActivityTimeline",
|
|
33
|
+
component: _activityTimeline.default,
|
|
34
|
+
args: {
|
|
35
|
+
data: sampleData,
|
|
36
|
+
showIndexBadge: true,
|
|
37
|
+
onAdd: item => console.log("onAdd", item),
|
|
38
|
+
onEdit: item => console.log("onEdit", item),
|
|
39
|
+
onDelete: item => console.log("onDelete", item)
|
|
40
|
+
},
|
|
41
|
+
parameters: {
|
|
42
|
+
notes: `
|
|
43
|
+
# ActivityTimeline
|
|
44
|
+
|
|
45
|
+
Lista de atividades com ações de adicionar, editar e excluir.
|
|
46
|
+
|
|
47
|
+
Exemplo de uso:
|
|
48
|
+
|
|
49
|
+
\`\`\`tsx
|
|
50
|
+
<ActivityTimeline
|
|
51
|
+
data={data}
|
|
52
|
+
showIndexBadge
|
|
53
|
+
onAdd={(item) => console.log('onAdd', item)}
|
|
54
|
+
onEdit={(item) => console.log('onEdit', item)}
|
|
55
|
+
onDelete={(item) => console.log('onDelete', item)}
|
|
56
|
+
/>
|
|
57
|
+
\`\`\`
|
|
58
|
+
`
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var _default = exports.default = meta;
|
|
62
|
+
const Padrao = exports.Padrao = {
|
|
63
|
+
name: "activity-timeline-padrao",
|
|
64
|
+
args: {
|
|
65
|
+
data: sampleData,
|
|
66
|
+
showIndexBadge: true
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const SemBadge = exports.SemBadge = {
|
|
70
|
+
name: "activity-timeline-sem-badge",
|
|
71
|
+
args: {
|
|
72
|
+
data: sampleData,
|
|
73
|
+
showIndexBadge: false
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const ListaVazia = exports.ListaVazia = {
|
|
77
|
+
name: "activity-timeline-lista-vazia",
|
|
78
|
+
args: {
|
|
79
|
+
data: []
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=activity-timeline.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_activityTimeline","_interopRequireDefault","require","e","__esModule","default","sampleData","id","title","date","time","invalid","meta","component","ActivityTimeline","args","data","showIndexBadge","onAdd","item","console","log","onEdit","onDelete","parameters","notes","_default","exports","Padrao","name","SemBadge","ListaVazia"],"sources":["activity-timeline.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react\";\r\nimport ActivityTimeline from \"../../components/activity-timeline\";\r\n\r\nimport type { ActivityItemModel } from \"../../components/activity-timeline/interface\";\r\n\r\nconst sampleData: ActivityItemModel[] = [\r\n {\r\n id: 1,\r\n title: \"Operação com veículo\",\r\n date: \"24/03/2025\",\r\n time: \"08:00\",\r\n },\r\n {\r\n id: 2,\r\n title: \"Refeição\",\r\n date: \"24/03/2025\",\r\n time: \"12:30\",\r\n },\r\n {\r\n id: 3,\r\n title: \"Aguardando carga\",\r\n date: \"24/03/2025\",\r\n time: \"14:00\",\r\n invalid: true,\r\n },\r\n {\r\n id: 4,\r\n title: \"Descanso\",\r\n date: \"24/03/2025\",\r\n time: \"18:45\",\r\n },\r\n];\r\n\r\nconst meta: Meta<typeof ActivityTimeline> = {\r\n title: \"componente/ActivityTimeline\",\r\n component: ActivityTimeline,\r\n args: {\r\n data: sampleData,\r\n showIndexBadge: true,\r\n onAdd: (item: ActivityItemModel) => console.log(\"onAdd\", item),\r\n onEdit: (item: ActivityItemModel) => console.log(\"onEdit\", item),\r\n onDelete: (item: ActivityItemModel) => console.log(\"onDelete\", item),\r\n },\r\n parameters: {\r\n notes: `\r\n# ActivityTimeline\r\n\r\nLista de atividades com ações de adicionar, editar e excluir.\r\n\r\nExemplo de uso:\r\n\r\n\\`\\`\\`tsx\r\n<ActivityTimeline\r\n data={data}\r\n showIndexBadge\r\n onAdd={(item) => console.log('onAdd', item)}\r\n onEdit={(item) => console.log('onEdit', item)}\r\n onDelete={(item) => console.log('onDelete', item)}\r\n/>\r\n\\`\\`\\`\r\n `,\r\n },\r\n};\r\n\r\nexport default meta;\r\n\r\ntype Story = StoryObj<typeof meta>;\r\n\r\nexport const Padrao: Story = {\r\n name: \"activity-timeline-padrao\",\r\n args: {\r\n data: sampleData,\r\n showIndexBadge: true,\r\n },\r\n};\r\n\r\nexport const SemBadge: Story = {\r\n name: \"activity-timeline-sem-badge\",\r\n args: {\r\n data: sampleData,\r\n showIndexBadge: false,\r\n },\r\n};\r\n\r\nexport const ListaVazia: Story = {\r\n name: \"activity-timeline-lista-vazia\",\r\n args: {\r\n data: [],\r\n },\r\n};"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAkE,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIlE,MAAMG,UAA+B,GAAG,CACtC;EACEC,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,sBAAsB;EAC7BC,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE;AACR,CAAC,EACD;EACEH,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,UAAU;EACjBC,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE;AACR,CAAC,EACD;EACEH,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,kBAAkB;EACzBC,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE,OAAO;EACbC,OAAO,EAAE;AACX,CAAC,EACD;EACEJ,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,UAAU;EACjBC,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE;AACR,CAAC,CACF;AAED,MAAME,IAAmC,GAAG;EAC1CJ,KAAK,EAAE,6BAA6B;EACpCK,SAAS,EAAEC,yBAAgB;EAC3BC,IAAI,EAAE;IACJC,IAAI,EAAEV,UAAU;IAChBW,cAAc,EAAE,IAAI;IACpBC,KAAK,EAAGC,IAAuB,IAAKC,OAAO,CAACC,GAAG,CAAC,OAAO,EAAEF,IAAI,CAAC;IAC9DG,MAAM,EAAGH,IAAuB,IAAKC,OAAO,CAACC,GAAG,CAAC,QAAQ,EAAEF,IAAI,CAAC;IAChEI,QAAQ,EAAGJ,IAAuB,IAAKC,OAAO,CAACC,GAAG,CAAC,UAAU,EAAEF,IAAI;EACrE,CAAC;EACDK,UAAU,EAAE;IACVC,KAAK,EAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE;AACF,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAtB,OAAA,GAEaO,IAAI;AAIZ,MAAMgB,MAAa,GAAAD,OAAA,CAAAC,MAAA,GAAG;EAC3BC,IAAI,EAAE,0BAA0B;EAChCd,IAAI,EAAE;IACJC,IAAI,EAAEV,UAAU;IAChBW,cAAc,EAAE;EAClB;AACF,CAAC;AAEM,MAAMa,QAAe,GAAAH,OAAA,CAAAG,QAAA,GAAG;EAC7BD,IAAI,EAAE,6BAA6B;EACnCd,IAAI,EAAE;IACJC,IAAI,EAAEV,UAAU;IAChBW,cAAc,EAAE;EAClB;AACF,CAAC;AAEM,MAAMc,UAAiB,GAAAJ,OAAA,CAAAI,UAAA,GAAG;EAC/BF,IAAI,EAAE,+BAA+B;EACrCd,IAAI,EAAE;IACJC,IAAI,EAAE;EACR;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef, useCallback } from "react";
|
|
5
|
+
import { TouchableOpacity, View } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
import { Typography } from "../../../../components/typography";
|
|
9
|
+
|
|
10
|
+
// commons / svg
|
|
11
|
+
import { Icons } from "../../../../common/icons-svg";
|
|
12
|
+
|
|
13
|
+
// typings
|
|
14
|
+
|
|
15
|
+
import { asBaseComponent } from "../../../../@types/as-base-component";
|
|
16
|
+
|
|
17
|
+
// styles
|
|
18
|
+
import { theme } from "../../../../styles/theme/theme";
|
|
19
|
+
import { styles } from "../../styles";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Componente ActivityRows para a interação da ui.
|
|
23
|
+
*/
|
|
24
|
+
const ActivityRows = /*#__PURE__*/forwardRef(({
|
|
25
|
+
index,
|
|
26
|
+
activities,
|
|
27
|
+
items,
|
|
28
|
+
onAdd,
|
|
29
|
+
onEdit,
|
|
30
|
+
onDelete
|
|
31
|
+
}, ref) => {
|
|
32
|
+
var _activities$date, _activities$time, _activities$title;
|
|
33
|
+
const handleAdd = useCallback(() => onAdd(activities), [onAdd, activities]);
|
|
34
|
+
const handleEdit = useCallback(() => onEdit(activities), [onEdit, activities]);
|
|
35
|
+
const handleDelete = useCallback(() => onDelete(activities), [onDelete, activities]);
|
|
36
|
+
const isInvalid = !!activities.invalid;
|
|
37
|
+
const dateText = activities.date instanceof Date ? `${String(activities.date.getDate()).padStart(2, "0")}/${String(activities.date.getMonth() + 1).padStart(2, "0")}/${activities.date.getFullYear()}` : String((_activities$date = activities.date) !== null && _activities$date !== void 0 ? _activities$date : "");
|
|
38
|
+
const timeText = activities.time instanceof Date ? `${String(activities.time.getHours()).padStart(2, "0")}:${String(activities.time.getMinutes()).padStart(2, "0")}` : String((_activities$time = activities.time) !== null && _activities$time !== void 0 ? _activities$time : "");
|
|
39
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
40
|
+
ref: ref,
|
|
41
|
+
style: styles.row
|
|
42
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
43
|
+
style: styles.badge
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
45
|
+
text: String(index + 1),
|
|
46
|
+
color: theme.colors.neutral[25],
|
|
47
|
+
size: theme.fontSizes.sm,
|
|
48
|
+
fontFamily: theme.fonts.inter_bold_700
|
|
49
|
+
})), Boolean(index !== (items === null || items === void 0 ? void 0 : items.length) - 1) && /*#__PURE__*/React.createElement(View, {
|
|
50
|
+
style: {
|
|
51
|
+
width: 2,
|
|
52
|
+
height: 76,
|
|
53
|
+
backgroundColor: theme.colors.blue[500],
|
|
54
|
+
position: "absolute",
|
|
55
|
+
left: 21,
|
|
56
|
+
top: 60
|
|
57
|
+
}
|
|
58
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
59
|
+
style: styles.card
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
61
|
+
numberOfLines: 1,
|
|
62
|
+
style: styles.title,
|
|
63
|
+
text: (_activities$title = activities.title) !== null && _activities$title !== void 0 ? _activities$title : "Não informada",
|
|
64
|
+
color: isInvalid ? theme.colors.red[900] : theme.colors.blue[500],
|
|
65
|
+
size: 14,
|
|
66
|
+
fontFamily: theme.fonts.inter_medium_500,
|
|
67
|
+
lineHeight: 34
|
|
68
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
69
|
+
style: [styles.pill, isInvalid ? styles.pillInvalid : styles.pillOk]
|
|
70
|
+
}, /*#__PURE__*/React.createElement(Icons, {
|
|
71
|
+
icon: "CALENDAR",
|
|
72
|
+
size: 18,
|
|
73
|
+
color: isInvalid ? theme.colors.red[900] : theme.colors.blue[500]
|
|
74
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
75
|
+
text: dateText,
|
|
76
|
+
color: isInvalid ? theme.colors.red[800] : theme.colors.blue[400],
|
|
77
|
+
size: theme.fontSizes.xs,
|
|
78
|
+
fontFamily: theme.fonts.inter_medium_500
|
|
79
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
80
|
+
text: "|",
|
|
81
|
+
color: isInvalid ? theme.colors.red[800] : theme.colors.blue[400],
|
|
82
|
+
size: theme.fontSizes.sm,
|
|
83
|
+
style: styles.sep
|
|
84
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
85
|
+
text: timeText,
|
|
86
|
+
color: isInvalid ? theme.colors.red[800] : theme.colors.blue[500],
|
|
87
|
+
size: theme.fontSizes.xs,
|
|
88
|
+
fontFamily: theme.fonts.inter_medium_500
|
|
89
|
+
}))), /*#__PURE__*/React.createElement(View, {
|
|
90
|
+
style: styles.actions
|
|
91
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
92
|
+
style: styles.iconButton,
|
|
93
|
+
onPress: handleEdit,
|
|
94
|
+
testID: "edit-activity"
|
|
95
|
+
}, /*#__PURE__*/React.createElement(Icons, {
|
|
96
|
+
icon: "NOTE_PINCEL",
|
|
97
|
+
size: 18,
|
|
98
|
+
color: theme.colors.blue[350]
|
|
99
|
+
})), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
100
|
+
style: styles.iconButton,
|
|
101
|
+
onPress: handleAdd,
|
|
102
|
+
testID: "add-after-activity"
|
|
103
|
+
}, /*#__PURE__*/React.createElement(Icons, {
|
|
104
|
+
icon: "PLUS",
|
|
105
|
+
size: 18,
|
|
106
|
+
color: theme.colors.green[500]
|
|
107
|
+
})), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
108
|
+
style: styles.iconButton,
|
|
109
|
+
onPress: handleDelete,
|
|
110
|
+
testID: "delete-activity"
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Icons, {
|
|
112
|
+
icon: "X_CIRCLE",
|
|
113
|
+
size: 18,
|
|
114
|
+
color: theme.colors.red[900]
|
|
115
|
+
}))));
|
|
116
|
+
});
|
|
117
|
+
ActivityRows.displayName = "ActivityRows";
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* EXPORTS
|
|
121
|
+
*/
|
|
122
|
+
export default asBaseComponent(ActivityRows);
|
|
123
|
+
//# sourceMappingURL=index.js.map
|