@controleonline/ui-crm 1.0.42
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/.github/actions/workers/manager/action.yml +147 -0
- package/.github/actions/workers/qa/action.yml +44 -0
- package/.github/actions/workers/security/action.yml +44 -0
- package/.github/actions/workers/technical-documenter/action.yml +51 -0
- package/.github/workflows/manager-worker.yml +167 -0
- package/.github/workflows/publish-npm.yml +40 -0
- package/.github/workflows/pull-request-checks.yml +29 -0
- package/.scrutinizer.yml +24 -0
- package/AGENTS.md +56 -0
- package/FUNDING.yml +1 -0
- package/docs/technical/Cliente-Vendedor-Vinculo-e-Permissoes.md +121 -0
- package/docs/technical/Income-Statements-Demonstrativo.md +38 -0
- package/docs/technical/Oportunidades-Ordenacao-por-Data-de-Retorno.md +134 -0
- package/docs/technical/Propostas-Filtro-de-Status.md +147 -0
- package/docs/technical/Royalties-a-pagar-Franqueado.md +51 -0
- package/docs/technical/Visao-Vendedor-Comissoes.md +58 -0
- package/docs/wiki.md +1 -0
- package/package.json +43 -0
- package/scripts/validate-wiki-pointer.cjs +13 -0
- package/src/react/components/AnimatedModal.js +149 -0
- package/src/react/components/AnimatedModal.styles.js +21 -0
- package/src/react/components/CreateContractModal.js +151 -0
- package/src/react/components/CreateContractModal.styles.js +43 -0
- package/src/react/hooks/useToastMessage.js +59 -0
- package/src/react/index.js +4 -0
- package/src/react/pages/ModelTemplatesPage.js +1461 -0
- package/src/react/pages/ModelTemplatesPage.styles.js +441 -0
- package/src/react/pages/comissions/IncomeStatementDetailsModal.js +102 -0
- package/src/react/pages/comissions/IncomeStatementsFilters.js +120 -0
- package/src/react/pages/comissions/SellerCommissionsPage.js +368 -0
- package/src/react/pages/comissions/SellerCommissionsPage.styles.js +219 -0
- package/src/react/pages/comissions/incomeStatementsHelpers.js +233 -0
- package/src/react/pages/comissions/index.js +309 -0
- package/src/react/pages/comissions/index.styles.js +381 -0
- package/src/react/pages/comissions/sellerCommissionsHelpers.js +222 -0
- package/src/react/pages/crm/components/CrmHeader.js +117 -0
- package/src/react/pages/crm/components/MarketingEventsSection.js +142 -0
- package/src/react/pages/crm/components/MarketingEventsSection.styles.js +105 -0
- package/src/react/pages/crm/components/OpportunityCard.js +138 -0
- package/src/react/pages/crm/components/OpportunityFormModal.js +279 -0
- package/src/react/pages/crm/components/OpportunityList.js +113 -0
- package/src/react/pages/crm/components/OpportunitySkeletons.js +53 -0
- package/src/react/pages/crm/components/ProviderSelectModal.js +166 -0
- package/src/react/pages/crm/components/SelectModal.js +178 -0
- package/src/react/pages/crm/conversation.js +342 -0
- package/src/react/pages/crm/conversation.styles.js +206 -0
- package/src/react/pages/crm/hooks/useCrmData.js +494 -0
- package/src/react/pages/crm/hooks/useOpportunityForms.js +306 -0
- package/src/react/pages/crm/index.js +262 -0
- package/src/react/pages/crm/index.styles.js +13 -0
- package/src/react/pages/crm/marketingEventsHelpers.js +41 -0
- package/src/react/pages/crm/styles/card.styles.js +178 -0
- package/src/react/pages/crm/styles/layout.styles.js +184 -0
- package/src/react/pages/crm/styles/modal.styles.js +347 -0
- package/src/react/pages/home/index.js +559 -0
- package/src/react/pages/home/index.styles.js +268 -0
- package/src/react/pages/proposals/CreateProposalsModal.js +466 -0
- package/src/react/pages/proposals/CreateProposalsModal.styles.js +344 -0
- package/src/react/pages/proposals/CreateProposalsPickers.js +187 -0
- package/src/react/pages/proposals/CreateProposalsProductSection.js +117 -0
- package/src/react/pages/proposals/ProposalCard.js +112 -0
- package/src/react/pages/proposals/ProposalDetails.js +263 -0
- package/src/react/pages/proposals/ProposalDetails.styles.js +195 -0
- package/src/react/pages/proposals/index.js +488 -0
- package/src/react/pages/proposals/index.styles.js +248 -0
- package/src/react/pages/proposals/proposalListHelpers.js +216 -0
- package/src/react/pages/proposals/proposalNavigation.js +26 -0
- package/src/react/pages/royalties/ReceivablePage.js +233 -0
- package/src/react/pages/royalties/RoyaltiesPayablePage.js +260 -0
- package/src/react/pages/royalties/index.js +2 -0
- package/src/react/pages/royalties/royaltiesReceivableHelpers.js +68 -0
- package/src/react/pages/settings/GeneralSettings.js +317 -0
- package/src/react/pages/settings/GeneralSettings.shared.js +490 -0
- package/src/react/pages/settings/GeneralSettings.styles.js +746 -0
- package/src/react/pages/settings/GeneralSettingsSection.js +57 -0
- package/src/react/pages/settings/generalSettingsActiveTab.js +85 -0
- package/src/react/pages/settings/sections/CrmSection.js +281 -0
- package/src/react/pages/settings/sections/DeviceRuntimeFooterSection.js +128 -0
- package/src/react/pages/settings/sections/DisplayPreparationSection.js +155 -0
- package/src/react/pages/settings/sections/IntegrationsSection.js +392 -0
- package/src/react/pages/settings/sections/LogSection.js +322 -0
- package/src/react/pages/settings/sections/LoginSection.js +137 -0
- package/src/react/pages/settings/sections/LoyaltyProductPicker.js +230 -0
- package/src/react/pages/settings/sections/LoyaltySection.js +451 -0
- package/src/react/pages/settings/sections/MaintenanceSection.js +205 -0
- package/src/react/pages/settings/sections/MapsSection.js +629 -0
- package/src/react/pages/settings/sections/MenuCatalogSection.js +405 -0
- package/src/react/pages/settings/sections/OperationsSection.js +303 -0
- package/src/react/pages/settings/sections/OrderPaymentSection.js +379 -0
- package/src/react/pages/settings/sections/OrderPrintSection.js +308 -0
- package/src/react/pages/settings/sections/ShopSection.js +490 -0
- package/src/react/pages/settings/sections/shop/FranchiseMapPreview.js +124 -0
- package/src/react/pages/settings/sections/shop/ShopDomainCreateForm.js +57 -0
- package/src/react/pages/settings/sections/shop/ShopDomainPanel.js +184 -0
- package/src/react/pages/settings/sections/shop/ShopDomainShowcasesSection.js +237 -0
- package/src/react/pages/settings/sections/shop/ShopDomainShowcasesSection.styles.js +256 -0
- package/src/react/pages/settings/sections/shop/ShopDomainTabs.js +61 -0
- package/src/react/pages/settings/sections/shop/ShopFranchiseLocatorSection.js +526 -0
- package/src/react/pages/settings/sections/shop/ShopLoyaltySection.js +426 -0
- package/src/react/pages/settings/sections/shop/ShopSettingsSection.js +10 -0
- package/src/react/pages/settings/sections/shop/mapsFranchiseMapHelpers.js +163 -0
- package/src/react/pages/settings/sections/shop/shopDomainShowcasesUtils.js +68 -0
- package/src/react/pages/settings/sections/shop/shopFranchiseVisibility.js +158 -0
- package/src/react/pages/settings/sections/shop/shopSettingsShared.js +427 -0
- package/src/react/router/routes.js +135 -0
- package/src/react/utils/opportunityDate.js +82 -0
- package/src/react/utils/opportunityEditorReferences.js +76 -0
- package/src/react/utils/opportunityEmptyState.js +20 -0
- package/src/react/utils/opportunityPeople.js +111 -0
- package/src/react/utils/opportunityPhone.js +82 -0
- package/src/react/utils/opportunityStage.js +30 -0
- package/src/react/utils/opportunityStatusFilter.js +54 -0
- package/src/react/utils/proposalCreateHelpers.js +61 -0
- package/src/react/utils/proposalProductSelection.js +71 -0
- package/src/react/utils/royaltiesPayableParams.js +37 -0
- package/src/react/utils/translateWithFallback.js +42 -0
- package/src/store/crm/index.js +2 -0
- package/src/store/model/index.js +104 -0
- package/src/tests/browser/crm/create-proposal-product-category-filter.spec.js +149 -0
- package/src/tests/browser/crm/crm-index-status-filter.spec.js +263 -0
- package/src/tests/browser/crm/crm-opportunity-category-editor.spec.js +269 -0
- package/src/tests/browser/crm/royalties-payable.spec.js +122 -0
- package/src/tests/browser/crm/royalties-receivable.spec.js +121 -0
- package/src/tests/browser/crm/seller-commissions.spec.js +214 -0
- package/src/tests/browser/manager/general-settings-maps.spec.js +400 -0
- package/src/tests/react/pages/comissions/incomeStatementsHelpers.test.js +181 -0
- package/src/tests/react/pages/comissions/sellerCommissionsHelpers.test.js +132 -0
- package/src/tests/react/pages/crm/marketingEventsHelpers.test.cjs +53 -0
- package/src/tests/react/pages/crm/opportunitySearchParams.test.cjs +44 -0
- package/src/tests/react/pages/proposals/navigation.test.js +71 -0
- package/src/tests/react/pages/proposals/proposalListHelpers.test.js +42 -0
- package/src/tests/react/pages/royalties/royaltiesReceivableHelpers.test.js +60 -0
- package/src/tests/react/pages/settings/generalSettings.shared.test.js +102 -0
- package/src/tests/react/pages/settings/sections/shop/shopDomainShowcasesUtils.test.js +60 -0
- package/src/tests/react/pages/settings/sections/shop/shopFranchiseVisibility.test.js +80 -0
- package/src/tests/react/utils/opportunityEditorReferences.test.js +70 -0
- package/src/tests/react/utils/opportunityEmptyState.test.js +39 -0
- package/src/tests/react/utils/opportunityStatusFilter.test.cjs +81 -0
- package/src/tests/react/utils/proposalCreateHelpers.test.js +25 -0
- package/src/tests/react/utils/proposalProductSelection.test.js +76 -0
- package/src/tests/react/utils/royaltiesPayableParams.test.js +44 -0
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import { Platform, StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const cardShadow = Platform.select({
|
|
4
|
+
ios: {
|
|
5
|
+
shadowColor: '#0F172A',
|
|
6
|
+
shadowOffset: { width: 0, height: 6 },
|
|
7
|
+
shadowOpacity: 0.06,
|
|
8
|
+
shadowRadius: 16,
|
|
9
|
+
},
|
|
10
|
+
android: { elevation: 3 },
|
|
11
|
+
web: { boxShadow: '0 6px 18px rgba(15,23,42,0.08)' },
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
container: {
|
|
16
|
+
flex: 1,
|
|
17
|
+
},
|
|
18
|
+
desktopShell: {
|
|
19
|
+
flex: 1,
|
|
20
|
+
paddingHorizontal: 16,
|
|
21
|
+
paddingTop: 14,
|
|
22
|
+
paddingBottom: 20,
|
|
23
|
+
},
|
|
24
|
+
mobileShell: {
|
|
25
|
+
paddingHorizontal: 16,
|
|
26
|
+
paddingTop: 14,
|
|
27
|
+
paddingBottom: 28,
|
|
28
|
+
gap: 14,
|
|
29
|
+
},
|
|
30
|
+
desktopColumns: {
|
|
31
|
+
flex: 1,
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
gap: 16,
|
|
34
|
+
minHeight: 0,
|
|
35
|
+
},
|
|
36
|
+
sidebarPanel: {
|
|
37
|
+
width: 380,
|
|
38
|
+
minWidth: 320,
|
|
39
|
+
flexShrink: 0,
|
|
40
|
+
backgroundColor: '#fff',
|
|
41
|
+
borderRadius: 20,
|
|
42
|
+
padding: 18,
|
|
43
|
+
...cardShadow,
|
|
44
|
+
},
|
|
45
|
+
editorPanel: {
|
|
46
|
+
flex: 1,
|
|
47
|
+
minWidth: 0,
|
|
48
|
+
backgroundColor: '#fff',
|
|
49
|
+
borderRadius: 20,
|
|
50
|
+
padding: 18,
|
|
51
|
+
...cardShadow,
|
|
52
|
+
},
|
|
53
|
+
mobileSidebarPanel: {
|
|
54
|
+
backgroundColor: '#fff',
|
|
55
|
+
borderRadius: 20,
|
|
56
|
+
padding: 18,
|
|
57
|
+
...cardShadow,
|
|
58
|
+
},
|
|
59
|
+
mobileEditorPanel: {
|
|
60
|
+
backgroundColor: '#fff',
|
|
61
|
+
borderRadius: 20,
|
|
62
|
+
padding: 18,
|
|
63
|
+
...cardShadow,
|
|
64
|
+
},
|
|
65
|
+
panelContent: {
|
|
66
|
+
paddingBottom: 8,
|
|
67
|
+
},
|
|
68
|
+
panelTitle: {
|
|
69
|
+
fontSize: 18,
|
|
70
|
+
fontWeight: '800',
|
|
71
|
+
color: '#0F172A',
|
|
72
|
+
marginBottom: 6,
|
|
73
|
+
},
|
|
74
|
+
panelSub: {
|
|
75
|
+
fontSize: 13,
|
|
76
|
+
lineHeight: 19,
|
|
77
|
+
color: '#64748B',
|
|
78
|
+
marginBottom: 18,
|
|
79
|
+
flexShrink: 1,
|
|
80
|
+
},
|
|
81
|
+
requiredHint: {
|
|
82
|
+
fontSize: 12,
|
|
83
|
+
fontWeight: '700',
|
|
84
|
+
color: '#B91C1C',
|
|
85
|
+
marginTop: -8,
|
|
86
|
+
marginBottom: 6,
|
|
87
|
+
},
|
|
88
|
+
summaryRow: {
|
|
89
|
+
flexDirection: 'row',
|
|
90
|
+
flexWrap: 'wrap',
|
|
91
|
+
gap: 10,
|
|
92
|
+
marginBottom: 14,
|
|
93
|
+
},
|
|
94
|
+
summaryCard: {
|
|
95
|
+
minWidth: 120,
|
|
96
|
+
flexGrow: 1,
|
|
97
|
+
backgroundColor: '#fff',
|
|
98
|
+
borderRadius: 14,
|
|
99
|
+
paddingHorizontal: 12,
|
|
100
|
+
paddingVertical: 10,
|
|
101
|
+
...cardShadow,
|
|
102
|
+
},
|
|
103
|
+
summaryLabel: {
|
|
104
|
+
fontSize: 11,
|
|
105
|
+
fontWeight: '700',
|
|
106
|
+
textTransform: 'uppercase',
|
|
107
|
+
color: '#94A3B8',
|
|
108
|
+
marginBottom: 4,
|
|
109
|
+
letterSpacing: 0.3,
|
|
110
|
+
},
|
|
111
|
+
summaryValue: {
|
|
112
|
+
fontSize: 22,
|
|
113
|
+
fontWeight: '800',
|
|
114
|
+
color: '#0F172A',
|
|
115
|
+
},
|
|
116
|
+
searchInput: {
|
|
117
|
+
backgroundColor: '#F8FAFC',
|
|
118
|
+
borderRadius: 14,
|
|
119
|
+
borderWidth: 1,
|
|
120
|
+
borderColor: '#E2E8F0',
|
|
121
|
+
paddingHorizontal: 14,
|
|
122
|
+
paddingVertical: 12,
|
|
123
|
+
fontSize: 15,
|
|
124
|
+
color: '#0F172A',
|
|
125
|
+
marginBottom: 14,
|
|
126
|
+
},
|
|
127
|
+
fieldBlock: {
|
|
128
|
+
marginBottom: 14,
|
|
129
|
+
},
|
|
130
|
+
formField: {
|
|
131
|
+
minWidth: 260,
|
|
132
|
+
flexGrow: 1,
|
|
133
|
+
flexBasis: 260,
|
|
134
|
+
},
|
|
135
|
+
fieldLabel: {
|
|
136
|
+
fontSize: 12,
|
|
137
|
+
fontWeight: '700',
|
|
138
|
+
color: '#475569',
|
|
139
|
+
marginBottom: 8,
|
|
140
|
+
textTransform: 'uppercase',
|
|
141
|
+
letterSpacing: 0.3,
|
|
142
|
+
},
|
|
143
|
+
fieldRequiredMark: {
|
|
144
|
+
color: '#DC2626',
|
|
145
|
+
fontWeight: '900',
|
|
146
|
+
},
|
|
147
|
+
fieldLabelRow: {
|
|
148
|
+
flexDirection: 'row',
|
|
149
|
+
alignItems: 'center',
|
|
150
|
+
justifyContent: 'space-between',
|
|
151
|
+
gap: 10,
|
|
152
|
+
},
|
|
153
|
+
inlineAddButton: {
|
|
154
|
+
width: 26,
|
|
155
|
+
height: 26,
|
|
156
|
+
borderRadius: 13,
|
|
157
|
+
alignItems: 'center',
|
|
158
|
+
justifyContent: 'center',
|
|
159
|
+
backgroundColor: '#2563EB',
|
|
160
|
+
},
|
|
161
|
+
pickerWrap: {
|
|
162
|
+
borderWidth: 1,
|
|
163
|
+
borderColor: '#E2E8F0',
|
|
164
|
+
borderRadius: 14,
|
|
165
|
+
overflow: 'hidden',
|
|
166
|
+
backgroundColor: '#F8FAFC',
|
|
167
|
+
},
|
|
168
|
+
quickActionsGrid: {
|
|
169
|
+
flexDirection: 'row',
|
|
170
|
+
flexWrap: 'wrap',
|
|
171
|
+
gap: 10,
|
|
172
|
+
marginBottom: 18,
|
|
173
|
+
},
|
|
174
|
+
quickActionCard: {
|
|
175
|
+
minWidth: 120,
|
|
176
|
+
flexGrow: 1,
|
|
177
|
+
backgroundColor: '#F8FAFC',
|
|
178
|
+
borderRadius: 16,
|
|
179
|
+
padding: 14,
|
|
180
|
+
borderWidth: 1,
|
|
181
|
+
borderColor: '#E2E8F0',
|
|
182
|
+
},
|
|
183
|
+
quickActionIcon: {
|
|
184
|
+
width: 38,
|
|
185
|
+
height: 38,
|
|
186
|
+
borderRadius: 12,
|
|
187
|
+
alignItems: 'center',
|
|
188
|
+
justifyContent: 'center',
|
|
189
|
+
marginBottom: 10,
|
|
190
|
+
},
|
|
191
|
+
quickActionLabel: {
|
|
192
|
+
fontSize: 13,
|
|
193
|
+
fontWeight: '700',
|
|
194
|
+
color: '#0F172A',
|
|
195
|
+
lineHeight: 18,
|
|
196
|
+
},
|
|
197
|
+
listHeader: {
|
|
198
|
+
flexDirection: 'row',
|
|
199
|
+
alignItems: 'center',
|
|
200
|
+
justifyContent: 'space-between',
|
|
201
|
+
marginBottom: 12,
|
|
202
|
+
},
|
|
203
|
+
listTitle: {
|
|
204
|
+
fontSize: 15,
|
|
205
|
+
fontWeight: '800',
|
|
206
|
+
color: '#0F172A',
|
|
207
|
+
},
|
|
208
|
+
emptyBox: {
|
|
209
|
+
backgroundColor: '#F8FAFC',
|
|
210
|
+
borderRadius: 16,
|
|
211
|
+
borderWidth: 1,
|
|
212
|
+
borderColor: '#E2E8F0',
|
|
213
|
+
padding: 20,
|
|
214
|
+
alignItems: 'center',
|
|
215
|
+
},
|
|
216
|
+
emptyTitle: {
|
|
217
|
+
fontSize: 15,
|
|
218
|
+
fontWeight: '700',
|
|
219
|
+
color: '#0F172A',
|
|
220
|
+
marginBottom: 6,
|
|
221
|
+
textAlign: 'center',
|
|
222
|
+
},
|
|
223
|
+
emptySub: {
|
|
224
|
+
fontSize: 13,
|
|
225
|
+
lineHeight: 19,
|
|
226
|
+
color: '#64748B',
|
|
227
|
+
textAlign: 'center',
|
|
228
|
+
},
|
|
229
|
+
modelCard: {
|
|
230
|
+
backgroundColor: '#fff',
|
|
231
|
+
borderRadius: 16,
|
|
232
|
+
borderWidth: 1,
|
|
233
|
+
borderColor: '#E2E8F0',
|
|
234
|
+
padding: 14,
|
|
235
|
+
marginBottom: 10,
|
|
236
|
+
},
|
|
237
|
+
modelCardHeader: {
|
|
238
|
+
gap: 8,
|
|
239
|
+
marginBottom: 8,
|
|
240
|
+
},
|
|
241
|
+
modelCardTitle: {
|
|
242
|
+
fontSize: 15,
|
|
243
|
+
fontWeight: '700',
|
|
244
|
+
color: '#0F172A',
|
|
245
|
+
lineHeight: 21,
|
|
246
|
+
},
|
|
247
|
+
modelMeta: {
|
|
248
|
+
fontSize: 12,
|
|
249
|
+
color: '#64748B',
|
|
250
|
+
fontWeight: '600',
|
|
251
|
+
},
|
|
252
|
+
contextBadge: {
|
|
253
|
+
alignSelf: 'flex-start',
|
|
254
|
+
flexDirection: 'row',
|
|
255
|
+
alignItems: 'center',
|
|
256
|
+
gap: 6,
|
|
257
|
+
borderWidth: 1,
|
|
258
|
+
borderRadius: 999,
|
|
259
|
+
paddingHorizontal: 10,
|
|
260
|
+
paddingVertical: 6,
|
|
261
|
+
},
|
|
262
|
+
contextBadgeText: {
|
|
263
|
+
fontSize: 11,
|
|
264
|
+
fontWeight: '700',
|
|
265
|
+
},
|
|
266
|
+
editorHeader: {
|
|
267
|
+
flexDirection: 'row',
|
|
268
|
+
alignItems: 'flex-start',
|
|
269
|
+
gap: 12,
|
|
270
|
+
marginBottom: 14,
|
|
271
|
+
},
|
|
272
|
+
saveButton: {
|
|
273
|
+
minWidth: 112,
|
|
274
|
+
height: 46,
|
|
275
|
+
borderRadius: 14,
|
|
276
|
+
paddingHorizontal: 18,
|
|
277
|
+
flexDirection: 'row',
|
|
278
|
+
alignItems: 'center',
|
|
279
|
+
justifyContent: 'center',
|
|
280
|
+
gap: 8,
|
|
281
|
+
},
|
|
282
|
+
saveButtonText: {
|
|
283
|
+
fontSize: 14,
|
|
284
|
+
fontWeight: '800',
|
|
285
|
+
color: '#fff',
|
|
286
|
+
},
|
|
287
|
+
statusRow: {
|
|
288
|
+
flexDirection: 'row',
|
|
289
|
+
flexWrap: 'wrap',
|
|
290
|
+
gap: 10,
|
|
291
|
+
marginBottom: 16,
|
|
292
|
+
},
|
|
293
|
+
statusBadge: {
|
|
294
|
+
flexDirection: 'row',
|
|
295
|
+
alignItems: 'center',
|
|
296
|
+
gap: 6,
|
|
297
|
+
backgroundColor: '#F8FAFC',
|
|
298
|
+
borderWidth: 1,
|
|
299
|
+
borderColor: '#E2E8F0',
|
|
300
|
+
borderRadius: 999,
|
|
301
|
+
paddingHorizontal: 10,
|
|
302
|
+
paddingVertical: 7,
|
|
303
|
+
},
|
|
304
|
+
statusBadgeText: {
|
|
305
|
+
fontSize: 12,
|
|
306
|
+
color: '#475569',
|
|
307
|
+
fontWeight: '700',
|
|
308
|
+
},
|
|
309
|
+
formGrid: {
|
|
310
|
+
flexDirection: 'row',
|
|
311
|
+
flexWrap: 'wrap',
|
|
312
|
+
gap: 12,
|
|
313
|
+
marginBottom: 2,
|
|
314
|
+
},
|
|
315
|
+
textInput: {
|
|
316
|
+
backgroundColor: '#F8FAFC',
|
|
317
|
+
borderRadius: 14,
|
|
318
|
+
borderWidth: 1,
|
|
319
|
+
borderColor: '#E2E8F0',
|
|
320
|
+
paddingHorizontal: 14,
|
|
321
|
+
paddingVertical: 12,
|
|
322
|
+
fontSize: 15,
|
|
323
|
+
color: '#0F172A',
|
|
324
|
+
},
|
|
325
|
+
editorFieldBlock: {
|
|
326
|
+
marginTop: 2,
|
|
327
|
+
},
|
|
328
|
+
snippetCard: {
|
|
329
|
+
backgroundColor: '#F8FAFC',
|
|
330
|
+
borderWidth: 1,
|
|
331
|
+
borderColor: '#E2E8F0',
|
|
332
|
+
borderRadius: 16,
|
|
333
|
+
padding: 14,
|
|
334
|
+
marginBottom: 14,
|
|
335
|
+
},
|
|
336
|
+
snippetTitle: {
|
|
337
|
+
fontSize: 14,
|
|
338
|
+
fontWeight: '800',
|
|
339
|
+
color: '#0F172A',
|
|
340
|
+
marginBottom: 4,
|
|
341
|
+
},
|
|
342
|
+
snippetSub: {
|
|
343
|
+
fontSize: 12,
|
|
344
|
+
lineHeight: 18,
|
|
345
|
+
color: '#64748B',
|
|
346
|
+
marginBottom: 12,
|
|
347
|
+
},
|
|
348
|
+
snippetWrap: {
|
|
349
|
+
flexDirection: 'row',
|
|
350
|
+
flexWrap: 'wrap',
|
|
351
|
+
gap: 8,
|
|
352
|
+
},
|
|
353
|
+
snippetButton: {
|
|
354
|
+
backgroundColor: '#fff',
|
|
355
|
+
borderWidth: 1,
|
|
356
|
+
borderColor: '#CBD5E1',
|
|
357
|
+
borderRadius: 999,
|
|
358
|
+
paddingHorizontal: 12,
|
|
359
|
+
paddingVertical: 8,
|
|
360
|
+
},
|
|
361
|
+
snippetButtonText: {
|
|
362
|
+
fontSize: 12,
|
|
363
|
+
fontWeight: '700',
|
|
364
|
+
color: '#334155',
|
|
365
|
+
},
|
|
366
|
+
modeSwitch: {
|
|
367
|
+
flexDirection: 'row',
|
|
368
|
+
gap: 10,
|
|
369
|
+
marginBottom: 14,
|
|
370
|
+
},
|
|
371
|
+
modeButton: {
|
|
372
|
+
flexDirection: 'row',
|
|
373
|
+
alignItems: 'center',
|
|
374
|
+
gap: 8,
|
|
375
|
+
paddingHorizontal: 14,
|
|
376
|
+
paddingVertical: 10,
|
|
377
|
+
borderRadius: 999,
|
|
378
|
+
borderWidth: 1,
|
|
379
|
+
borderColor: '#E2E8F0',
|
|
380
|
+
backgroundColor: '#fff',
|
|
381
|
+
},
|
|
382
|
+
modeButtonActive: {
|
|
383
|
+
backgroundColor: '#F8FAFC',
|
|
384
|
+
borderColor: '#CBD5E1',
|
|
385
|
+
},
|
|
386
|
+
modeButtonText: {
|
|
387
|
+
fontSize: 12,
|
|
388
|
+
fontWeight: '700',
|
|
389
|
+
color: '#64748B',
|
|
390
|
+
},
|
|
391
|
+
modeButtonTextActive: {
|
|
392
|
+
color: '#0F172A',
|
|
393
|
+
},
|
|
394
|
+
editorLoading: {
|
|
395
|
+
flexDirection: 'row',
|
|
396
|
+
alignItems: 'center',
|
|
397
|
+
gap: 10,
|
|
398
|
+
paddingVertical: 14,
|
|
399
|
+
},
|
|
400
|
+
editorLoadingText: {
|
|
401
|
+
fontSize: 13,
|
|
402
|
+
color: '#64748B',
|
|
403
|
+
fontWeight: '600',
|
|
404
|
+
},
|
|
405
|
+
editorInput: {
|
|
406
|
+
minHeight: 520,
|
|
407
|
+
backgroundColor: '#0F172A',
|
|
408
|
+
color: '#E2E8F0',
|
|
409
|
+
borderRadius: 18,
|
|
410
|
+
paddingHorizontal: 16,
|
|
411
|
+
paddingVertical: 16,
|
|
412
|
+
fontSize: 14,
|
|
413
|
+
lineHeight: 21,
|
|
414
|
+
fontFamily: Platform.select({
|
|
415
|
+
ios: 'Menlo',
|
|
416
|
+
android: 'monospace',
|
|
417
|
+
default: 'monospace',
|
|
418
|
+
}),
|
|
419
|
+
},
|
|
420
|
+
previewBox: {
|
|
421
|
+
minHeight: 520,
|
|
422
|
+
borderRadius: 18,
|
|
423
|
+
borderWidth: 1,
|
|
424
|
+
borderColor: '#E2E8F0',
|
|
425
|
+
backgroundColor: '#fff',
|
|
426
|
+
padding: 18,
|
|
427
|
+
},
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
export default styles;
|
|
431
|
+
|
|
432
|
+
export const inlineStyle_1012_59 = {
|
|
433
|
+
marginBottom: 12,
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
export const inlineStyle_1068_14 = {
|
|
437
|
+
flex: 1,
|
|
438
|
+
minWidth: 0,
|
|
439
|
+
flexShrink: 1,
|
|
440
|
+
};
|
|
441
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {ScrollView, Text, TouchableOpacity, View} from 'react-native';
|
|
3
|
+
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
4
|
+
import AnimatedModal from '@controleonline/ui-common/src/react/components/AnimatedModal';
|
|
5
|
+
import styles from './index.styles';
|
|
6
|
+
import {inlineStyle_353_8, inlineStyle_365_47} from './index.styles';
|
|
7
|
+
import {formatCurrency} from './incomeStatementsHelpers';
|
|
8
|
+
|
|
9
|
+
const CategoryBlocks = ({parents, emptyText}) => {
|
|
10
|
+
if (!Array.isArray(parents) || parents.length === 0) {
|
|
11
|
+
return <Text style={styles.modalEmptyText}>{emptyText}</Text>;
|
|
12
|
+
}
|
|
13
|
+
return parents.map(parent => (
|
|
14
|
+
<View key={`parent-${parent.parentId}`} style={styles.modalGroupBlock}>
|
|
15
|
+
<View style={styles.modalGroupHeader}>
|
|
16
|
+
<Text style={styles.modalGroupTitle}>{parent.parentName}</Text>
|
|
17
|
+
<Text style={styles.modalGroupAmount}>
|
|
18
|
+
{formatCurrency(parent.total)}
|
|
19
|
+
</Text>
|
|
20
|
+
</View>
|
|
21
|
+
{(parent.categories || []).map(category => (
|
|
22
|
+
<View key={`cat-${category.id}`} style={styles.modalCategoryRow}>
|
|
23
|
+
<Text style={styles.modalCategoryText}>{category.name}</Text>
|
|
24
|
+
<Text style={styles.modalCategoryAmount}>
|
|
25
|
+
{formatCurrency(category.total)}
|
|
26
|
+
</Text>
|
|
27
|
+
</View>
|
|
28
|
+
))}
|
|
29
|
+
</View>
|
|
30
|
+
));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Detail modal for a single month of the company Income Statements view.
|
|
35
|
+
*/
|
|
36
|
+
const IncomeStatementDetailsModal = ({
|
|
37
|
+
visible,
|
|
38
|
+
statement,
|
|
39
|
+
onClose,
|
|
40
|
+
closeLabel = 'Fechar',
|
|
41
|
+
}) => {
|
|
42
|
+
const balancePositive = (statement?.balance || 0) >= 0;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<AnimatedModal
|
|
46
|
+
visible={visible}
|
|
47
|
+
onRequestClose={onClose}
|
|
48
|
+
style={inlineStyle_353_8}>
|
|
49
|
+
<View style={styles.modalContainer}>
|
|
50
|
+
<View style={styles.modalHeader}>
|
|
51
|
+
<Text style={styles.modalTitle}>Detalhes do Mês</Text>
|
|
52
|
+
<TouchableOpacity onPress={onClose} style={styles.modalCloseButton}>
|
|
53
|
+
<Icon name="close" size={20} color="#64748B" />
|
|
54
|
+
</TouchableOpacity>
|
|
55
|
+
</View>
|
|
56
|
+
|
|
57
|
+
<ScrollView
|
|
58
|
+
style={styles.modalBody}
|
|
59
|
+
contentContainerStyle={inlineStyle_365_47}>
|
|
60
|
+
<View style={styles.modalSummaryCard}>
|
|
61
|
+
<Text style={styles.modalAmount}>
|
|
62
|
+
{formatCurrency(statement?.balance)}
|
|
63
|
+
</Text>
|
|
64
|
+
<View
|
|
65
|
+
style={[
|
|
66
|
+
styles.modalStatusPill,
|
|
67
|
+
{backgroundColor: balancePositive ? '#16A34A' : '#DC2626'},
|
|
68
|
+
]}>
|
|
69
|
+
<Text style={styles.modalStatusText}>
|
|
70
|
+
{balancePositive ? 'SALDO POSITIVO' : 'SALDO NEGATIVO'}
|
|
71
|
+
</Text>
|
|
72
|
+
</View>
|
|
73
|
+
</View>
|
|
74
|
+
|
|
75
|
+
<View style={styles.modalDetailsCard}>
|
|
76
|
+
<Text style={styles.modalSectionTitle}>Receitas por Categoria</Text>
|
|
77
|
+
<CategoryBlocks
|
|
78
|
+
parents={statement?.receiveParents}
|
|
79
|
+
emptyText="Sem receitas no período."
|
|
80
|
+
/>
|
|
81
|
+
</View>
|
|
82
|
+
|
|
83
|
+
<View style={styles.modalDetailsCard}>
|
|
84
|
+
<Text style={styles.modalSectionTitle}>Despesas por Categoria</Text>
|
|
85
|
+
<CategoryBlocks
|
|
86
|
+
parents={statement?.payParents}
|
|
87
|
+
emptyText="Sem despesas no período."
|
|
88
|
+
/>
|
|
89
|
+
</View>
|
|
90
|
+
</ScrollView>
|
|
91
|
+
|
|
92
|
+
<View style={styles.modalFooter}>
|
|
93
|
+
<TouchableOpacity style={styles.modalPrimaryButton} onPress={onClose}>
|
|
94
|
+
<Text style={styles.modalPrimaryButtonText}>{closeLabel}</Text>
|
|
95
|
+
</TouchableOpacity>
|
|
96
|
+
</View>
|
|
97
|
+
</View>
|
|
98
|
+
</AnimatedModal>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export default IncomeStatementDetailsModal;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {ScrollView, Text, TextInput, TouchableOpacity, View} from 'react-native';
|
|
3
|
+
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
4
|
+
import styles from './index.styles';
|
|
5
|
+
|
|
6
|
+
const ChipRow = ({options, selectedId, onSelect}) => (
|
|
7
|
+
<ScrollView
|
|
8
|
+
horizontal
|
|
9
|
+
showsHorizontalScrollIndicator={false}
|
|
10
|
+
style={styles.monthList}
|
|
11
|
+
contentContainerStyle={styles.monthListContent}>
|
|
12
|
+
{options.map(option => {
|
|
13
|
+
const active = selectedId === option.id;
|
|
14
|
+
return (
|
|
15
|
+
<TouchableOpacity
|
|
16
|
+
key={`chip-${option.id}`}
|
|
17
|
+
style={[styles.monthChip, active && styles.monthChipActive]}
|
|
18
|
+
onPress={() => onSelect(option.id)}>
|
|
19
|
+
<Text
|
|
20
|
+
style={[styles.monthChipText, active && styles.monthChipTextActive]}>
|
|
21
|
+
{option.label}
|
|
22
|
+
</Text>
|
|
23
|
+
</TouchableOpacity>
|
|
24
|
+
);
|
|
25
|
+
})}
|
|
26
|
+
</ScrollView>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Filters for company Income Statements: year, month, nature, category query.
|
|
31
|
+
*/
|
|
32
|
+
const IncomeStatementsFilters = ({
|
|
33
|
+
selectedYear,
|
|
34
|
+
onYearChange,
|
|
35
|
+
monthOptions,
|
|
36
|
+
selectedMonth,
|
|
37
|
+
onMonthChange,
|
|
38
|
+
natureOptions,
|
|
39
|
+
natureFilter,
|
|
40
|
+
onNatureChange,
|
|
41
|
+
categoryQuery,
|
|
42
|
+
onCategoryQueryChange,
|
|
43
|
+
yearLabel = 'Ano',
|
|
44
|
+
categoryPlaceholder = 'Categoria (comissão, royalties…)',
|
|
45
|
+
}) => {
|
|
46
|
+
const stepYear = delta => {
|
|
47
|
+
const current = parseInt(selectedYear || '0', 10);
|
|
48
|
+
if (!current) return;
|
|
49
|
+
onYearChange(String(current + delta));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<View style={styles.filtersContainer}>
|
|
54
|
+
<View style={styles.yearRow}>
|
|
55
|
+
<Text style={styles.filterLabel}>{yearLabel}</Text>
|
|
56
|
+
<View style={styles.yearControl}>
|
|
57
|
+
<TouchableOpacity
|
|
58
|
+
style={styles.yearStepButton}
|
|
59
|
+
onPress={() => stepYear(-1)}>
|
|
60
|
+
<Text style={styles.yearStepButtonText}>-</Text>
|
|
61
|
+
</TouchableOpacity>
|
|
62
|
+
<TextInput
|
|
63
|
+
value={selectedYear}
|
|
64
|
+
onChangeText={text => {
|
|
65
|
+
const cleaned = text.replace(/\D/g, '').slice(0, 4);
|
|
66
|
+
onYearChange(cleaned);
|
|
67
|
+
}}
|
|
68
|
+
onBlur={() => {
|
|
69
|
+
if (String(selectedYear).length !== 4) {
|
|
70
|
+
onYearChange(String(new Date().getFullYear()));
|
|
71
|
+
}
|
|
72
|
+
}}
|
|
73
|
+
keyboardType="number-pad"
|
|
74
|
+
style={styles.yearInput}
|
|
75
|
+
/>
|
|
76
|
+
<TouchableOpacity
|
|
77
|
+
style={styles.yearStepButton}
|
|
78
|
+
onPress={() => stepYear(1)}>
|
|
79
|
+
<Text style={styles.yearStepButtonText}>+</Text>
|
|
80
|
+
</TouchableOpacity>
|
|
81
|
+
</View>
|
|
82
|
+
</View>
|
|
83
|
+
|
|
84
|
+
<ChipRow
|
|
85
|
+
options={monthOptions}
|
|
86
|
+
selectedId={selectedMonth}
|
|
87
|
+
onSelect={onMonthChange}
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<ChipRow
|
|
91
|
+
options={natureOptions}
|
|
92
|
+
selectedId={natureFilter}
|
|
93
|
+
onSelect={onNatureChange}
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<View style={styles.categoryFilterRow}>
|
|
97
|
+
<Icon
|
|
98
|
+
name="search"
|
|
99
|
+
size={18}
|
|
100
|
+
color="#64748B"
|
|
101
|
+
style={styles.categoryFilterIcon}
|
|
102
|
+
/>
|
|
103
|
+
<TextInput
|
|
104
|
+
value={categoryQuery}
|
|
105
|
+
onChangeText={onCategoryQueryChange}
|
|
106
|
+
placeholder={categoryPlaceholder}
|
|
107
|
+
placeholderTextColor="#94A3B8"
|
|
108
|
+
style={styles.categoryFilterInput}
|
|
109
|
+
/>
|
|
110
|
+
{categoryQuery ? (
|
|
111
|
+
<TouchableOpacity onPress={() => onCategoryQueryChange('')}>
|
|
112
|
+
<Icon name="close" size={18} color="#64748B" />
|
|
113
|
+
</TouchableOpacity>
|
|
114
|
+
) : null}
|
|
115
|
+
</View>
|
|
116
|
+
</View>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export default IncomeStatementsFilters;
|