argous 1.2.245 → 1.2.247
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/dist/api/WebSocket.d.ts +4 -0
- package/dist/api/WebSocket.js +17 -13
- package/dist/api/index.js +119 -108
- package/dist/api/ws.js +3 -3
- package/dist/components/Alert/Alert.js +6 -2
- package/dist/components/ArgousAction/ArgousAction.js +8 -4
- package/dist/components/ArgousAvatar/ArgousAvatar.js +14 -10
- package/dist/components/ArgousComplexPagination/ArgousComplexPagination.js +15 -9
- package/dist/components/ArgousComplexTable/ArgousComplexTable.js +79 -52
- package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.js +16 -12
- package/dist/components/ArgousComplexTableHead/ArgousComplexTableHead.js +13 -9
- package/dist/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +12 -8
- package/dist/components/ArgousInput/ArgousInput.js +8 -4
- package/dist/components/ArgousPagination/ArgousPagination.js +1 -1
- package/dist/components/ArgousProgressBar/ArgousProgressBar.js +18 -18
- package/dist/components/ArgousSimpleTable/ArgousSimpleTable.js +16 -12
- package/dist/components/AutoComplete/AutoComplete.js +16 -12
- package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.js +34 -30
- package/dist/components/BarChart/BarChart.js +5 -1
- package/dist/components/BarraFerramentas/BarraFerramentas.d.ts +30 -2
- package/dist/components/BarraFerramentas/BarraFerramentas.js +58 -40
- package/dist/components/Button/Button.js +8 -4
- package/dist/components/Cabecalho/Cabecalho.js +29 -25
- package/dist/components/Calendar/Calendar.js +12 -8
- package/dist/components/Cam/Cam.js +15 -11
- package/dist/components/Carousel/Carousel.js +21 -17
- package/dist/components/CartaoUsuario/CartaoUsuario.js +21 -17
- package/dist/components/Collapse/Collapse.js +18 -14
- package/dist/components/Compartilhar/Compartilhar.js +24 -20
- package/dist/components/ConfirmModal/ModalProvider.js +17 -13
- package/dist/components/ConfirmModal/index.js +5 -1
- package/dist/components/ContactValidationInput/ContactValidationInput.js +34 -31
- package/dist/components/Document/Icons.js +14 -10
- package/dist/components/Document/ModalVisualizacaoDocumentos.js +11 -7
- package/dist/components/Document/Visualizacao.js +15 -11
- package/dist/components/Document/index.js +5 -1
- package/dist/components/DropArea/DropArea.js +16 -12
- package/dist/components/DropArea/Html5FileSelector.js +2 -2
- package/dist/components/Editor/Events.d.ts +2 -2
- package/dist/components/Editor/ScriptLoader2.d.ts +1 -1
- package/dist/components/Editor/ScriptLoader2.js +1 -1
- package/dist/components/Editor/Utils.d.ts +1 -1
- package/dist/components/Editor/Utils.js +1 -1
- package/dist/components/Editor/components/Editor.d.ts +1 -1
- package/dist/components/Editor/components/Editor.js +23 -18
- package/dist/components/Editor/components/EditorPropTypes.d.ts +2 -2
- package/dist/components/Editor/components/EditorPropTypes.js +5 -1
- package/dist/components/FilePreparer/FilePreparer.js +34 -26
- package/dist/components/FileUploader/FileUploader.js +22 -18
- package/dist/components/FormVisualizer/FormVisualizer.js +34 -26
- package/dist/components/HalfGauge/HalfGauge.js +30 -26
- package/dist/components/Highlight/Highlight.js +7 -3
- package/dist/components/ImageResize/ImageResize.js +61 -57
- package/dist/components/ImageResizeButton/ImageResizeButton.js +9 -5
- package/dist/components/Input/Input.js +8 -4
- package/dist/components/InputTags/InputTags.js +16 -8
- package/dist/components/ListSelect/ListSelect.js +11 -7
- package/dist/components/MaterialButton/MaterialButton.js +18 -18
- package/dist/components/MenuBar/MenuBar.js +11 -7
- package/dist/components/MonthPicker/MonthPicker.js +33 -25
- package/dist/components/MultipleSelect/MultipleSelect.js +20 -12
- package/dist/components/OtpInput/OtpInput.js +11 -7
- package/dist/components/OutputText/OutputText.js +8 -4
- package/dist/components/Pagination/Pagination.js +5 -1
- package/dist/components/PercentageDisplay/PercentageDisplay.js +11 -7
- package/dist/components/Programa/PageCodeEasterEgg.d.ts +1 -1
- package/dist/components/Programa/PageCodeEasterEgg.js +11 -7
- package/dist/components/Programa/Programa.d.ts +16 -1
- package/dist/components/Programa/Programa.js +41 -13
- package/dist/components/Programa/Tab.d.ts +7 -0
- package/dist/components/Programa/Tab.js +2 -0
- package/dist/components/Programa/TabNavigationRail.d.ts +12 -0
- package/dist/components/Programa/TabNavigationRail.js +118 -0
- package/dist/components/ProgressBar/ProgressBar.js +8 -4
- package/dist/components/Select/Select.js +11 -7
- package/dist/components/SimpleTable/SimpleTable.js +30 -26
- package/dist/components/Stepper/Stepper.js +18 -14
- package/dist/components/TablePicker/TablePicker.js +40 -32
- package/dist/components/Tabs/Tabs.js +8 -4
- package/dist/components/TextArea/TextArea.js +8 -4
- package/dist/components/TextToHtml/Cursor.js +9 -5
- package/dist/components/TextToHtml/TextStyles.js +10 -6
- package/dist/components/TextToHtml/TextToHtml.js +44 -44
- package/dist/components/ThreadLog/ThreadLog.js +15 -11
- package/dist/components/UserCard/UserCard.js +18 -14
- package/dist/components/UtilAutoComplete/UtilAutoComplete.js +22 -18
- package/dist/components/UtilTextField/UtilTextField.js +10 -6
- package/dist/components/Zoom/Zoom.js +11 -7
- package/dist/components/index.js +5 -1
- package/dist/fieldsRedux/createField.js +22 -18
- package/dist/fieldsRedux/fieldsRedux.js +44 -40
- package/dist/fieldsRedux/passFields.js +16 -12
- package/dist/reducers/index.js +1 -1
- package/dist/utils/api.d.ts +2 -2
- package/dist/utils/api.js +18 -18
- package/dist/utils/date.js +4 -4
- package/dist/utils/index.js +44 -112
- package/dist/utils/xmlToJson.js +1 -1
- package/lib/components/BarraFerramentas/BarraFerramentas.d.ts +30 -2
- package/lib/components/BarraFerramentas/BarraFerramentas.js +63 -19
- package/lib/components/Programa/Programa.d.ts +16 -1
- package/lib/components/Programa/Programa.js +40 -3
- package/lib/components/Programa/Tab.ts +6 -0
- package/lib/components/Programa/TabNavigationRail.js +118 -0
- package/lib/utils/index.ts +0 -88
- package/package.json +2 -2
- package/lib/components/Editor/tinymce/README.md +0 -73
- package/lib/components/Editor/tinymce/langs/README.md +0 -3
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { Compartilhar } from '..';
|
|
2
2
|
import ThreadLog from '../../components/ThreadLog';
|
|
3
3
|
import { usePrevious } from '../../utils';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { isArray, isNumber,
|
|
4
|
+
import { TAB_ACTIVE_INDEX, TAB_ALIAS_INDEX, TAB_ICON_INDEX, TAB_LABEL_INDEX } from '../Programa/TabNavigationRail';
|
|
5
|
+
import { Box, CircularProgress, ClickAwayListener, Collapse, Divider, IconButton, ListItemIcon, ListItemText, makeStyles, MenuItem, MenuList, Paper, Popper, Toolbar, Tooltip, Typography, useMediaQuery, useTheme, withStyles } from '@material-ui/core';
|
|
6
|
+
import { isArray, isNumber, isEqual, isFunction } from 'lodash';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import React, { useEffect, useRef, useState } from 'react';
|
|
9
9
|
import { AiOutlineAppstoreAdd } from 'react-icons/ai';
|
|
10
10
|
import { FaStar } from 'react-icons/fa';
|
|
11
|
+
import { IoSettings } from 'react-icons/io5';
|
|
11
12
|
import { MdShare, MdFormatListBulleted, MdArrowBack, MdEdit, MdDelete, MdSave, MdKeyboardArrowRight, MdFirstPage, MdKeyboardArrowLeft, MdLastPage, MdEditNote } from 'react-icons/md';
|
|
12
13
|
|
|
13
14
|
|
|
15
|
+
const TAB_ICON_SIZE = 20;
|
|
16
|
+
|
|
17
|
+
|
|
14
18
|
const useStyles = makeStyles(theme => ({
|
|
15
19
|
root: {
|
|
16
20
|
zIndex: 0,
|
|
@@ -98,14 +102,20 @@ function BarraFerramentas ({
|
|
|
98
102
|
addWidget = () => '',
|
|
99
103
|
snAnotacaoPrograma = false,
|
|
100
104
|
openAnnotations = () => '',
|
|
101
|
-
toolbarLoading = {}
|
|
105
|
+
toolbarLoading = {},
|
|
106
|
+
selectedTab = [],
|
|
107
|
+
setSelectedTab = () => ''
|
|
102
108
|
}) {
|
|
103
109
|
|
|
110
|
+
const theme = useTheme();
|
|
104
111
|
const classes = useStyles({ habNavegador });
|
|
112
|
+
const xs = useMediaQuery(theme.breakpoints.only('xs'));
|
|
113
|
+
|
|
105
114
|
const anchorMenu = useRef(null);
|
|
106
115
|
const anchorCompartilhar = useRef(null);
|
|
116
|
+
const setSelectedTabRef = useRef(setSelectedTab);
|
|
117
|
+
|
|
107
118
|
const [open, setOpen] = useState(false);
|
|
108
|
-
const [abaAtual, setAbaAtual] = useState(undefined);
|
|
109
119
|
const [habEditar, setHabEditar] = useState(true);
|
|
110
120
|
const [habSalvar, setHabSalvar] = useState(false);
|
|
111
121
|
const [habExcluir, setHabExcluir] = useState(false);
|
|
@@ -117,13 +127,18 @@ function BarraFerramentas ({
|
|
|
117
127
|
}, [open]);
|
|
118
128
|
|
|
119
129
|
const previousAbas = usePrevious(abas);
|
|
130
|
+
|
|
120
131
|
useEffect(() => {
|
|
132
|
+
|
|
121
133
|
if (isEqual(abas, previousAbas)) return;
|
|
122
|
-
if (!abas
|
|
123
|
-
|
|
134
|
+
if (!abas?.length) {
|
|
135
|
+
if (typeof setSelectedTabRef.current === 'function') setSelectedTabRef.current([]);
|
|
136
|
+
} else for (let i = 0; i < abas?.length; i++) {
|
|
137
|
+
|
|
124
138
|
const aba = abas[i];
|
|
125
|
-
|
|
126
|
-
|
|
139
|
+
|
|
140
|
+
if (aba[TAB_ACTIVE_INDEX] === 'active') {
|
|
141
|
+
if (typeof setSelectedTabRef.current === 'function') setSelectedTabRef.current(aba);
|
|
127
142
|
break;
|
|
128
143
|
}
|
|
129
144
|
}
|
|
@@ -144,10 +159,16 @@ function BarraFerramentas ({
|
|
|
144
159
|
setOpenCompartilhar(false);
|
|
145
160
|
};
|
|
146
161
|
|
|
147
|
-
const selecionaAba = (index,
|
|
162
|
+
const selecionaAba = (index, tab) => (event) => {
|
|
163
|
+
|
|
164
|
+
const alias = tab?.[TAB_ALIAS_INDEX];
|
|
165
|
+
|
|
148
166
|
if (anchorMenu.current && anchorMenu?.current?.contains(event.target)) return;
|
|
149
|
-
if (
|
|
167
|
+
if (typeof setSelectedTabRef.current === 'function') {
|
|
168
|
+
if (tab?.length) setSelectedTabRef.current(tab);
|
|
169
|
+
}
|
|
150
170
|
if (isNumber(index)) executaFuncao(alias || `T${index}`);
|
|
171
|
+
|
|
151
172
|
setOpen(false);
|
|
152
173
|
};
|
|
153
174
|
|
|
@@ -178,9 +199,10 @@ function BarraFerramentas ({
|
|
|
178
199
|
);
|
|
179
200
|
};
|
|
180
201
|
|
|
202
|
+
|
|
181
203
|
return <>
|
|
182
|
-
<Toolbar className={classes.root}
|
|
183
|
-
{(isArray(abas) && abas
|
|
204
|
+
<Toolbar className={classes.root} variant='dense'>
|
|
205
|
+
{(xs && isArray(abas) && (abas?.length > 0)) && (
|
|
184
206
|
<IconButton id='botaoAbasBarraFerramentas' ref={anchorMenu} onClick={toggleAbas} className={classes.menuButton}>
|
|
185
207
|
<MdFormatListBulleted />
|
|
186
208
|
</IconButton>
|
|
@@ -188,12 +210,34 @@ function BarraFerramentas ({
|
|
|
188
210
|
<Popper open={open} anchorEl={anchorMenu.current} role={undefined} transition keepMounted style={{ zIndex: 2, marginLeft: 10 }}>
|
|
189
211
|
{({ TransitionProps }) => (
|
|
190
212
|
<Collapse in={TransitionProps.in} timeout={100}>
|
|
191
|
-
<Paper style={{ maxHeight: '80vh', overflowY: 'auto' }}>
|
|
213
|
+
<Paper elevation={6} style={{ maxHeight: '80vh', overflowY: 'auto' }}>
|
|
192
214
|
<ClickAwayListener onClickAway={selecionaAba()}>
|
|
193
215
|
<MenuList autoFocusItem={open} onKeyDown={handleListKeyDown}>
|
|
194
|
-
{isArray(abas) && abas.map((item, key) =>
|
|
195
|
-
|
|
196
|
-
|
|
216
|
+
{(isArray(abas)) && abas.map((item, key) => {
|
|
217
|
+
|
|
218
|
+
const Icon = item?.[TAB_ICON_INDEX];
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
return (
|
|
222
|
+
<MenuItem
|
|
223
|
+
key={key}
|
|
224
|
+
onClick={selecionaAba(key, item)}
|
|
225
|
+
selected={isEqual(item, selectedTab)}
|
|
226
|
+
>
|
|
227
|
+
<ListItemIcon>
|
|
228
|
+
{(Icon) && (
|
|
229
|
+
<Icon size={TAB_ICON_SIZE} />
|
|
230
|
+
)}
|
|
231
|
+
{(!Icon) && (
|
|
232
|
+
<IoSettings size={TAB_ICON_SIZE} />
|
|
233
|
+
)}
|
|
234
|
+
</ListItemIcon>
|
|
235
|
+
<ListItemText>
|
|
236
|
+
{item?.[TAB_LABEL_INDEX]}
|
|
237
|
+
</ListItemText>
|
|
238
|
+
</MenuItem>
|
|
239
|
+
);
|
|
240
|
+
})}
|
|
197
241
|
</MenuList>
|
|
198
242
|
</ClickAwayListener>
|
|
199
243
|
</Paper>
|
|
@@ -201,8 +245,8 @@ function BarraFerramentas ({
|
|
|
201
245
|
)}
|
|
202
246
|
</Popper>
|
|
203
247
|
<Typography component='div' variant='h6' className={classes.title}>
|
|
204
|
-
{(
|
|
205
|
-
<Typography variant='subtitle1'>{
|
|
248
|
+
{(selectedTab?.length) ? (
|
|
249
|
+
<Typography variant='subtitle1'>{selectedTab?.[TAB_LABEL_INDEX]} <Typography variant='caption'>( {titulo} )</Typography></Typography>
|
|
206
250
|
) : (
|
|
207
251
|
<Typography variant='subtitle1'>{titulo}</Typography>
|
|
208
252
|
)}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { TabArray } from './Tab';
|
|
1
2
|
import { BoxProps } from '@material-ui/core';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
|
|
5
|
+
|
|
4
6
|
export interface ProgramaProps extends BoxProps {
|
|
5
7
|
code: string,
|
|
6
8
|
children: React.ReactNode,
|
|
@@ -12,7 +14,20 @@ export interface ProgramaProps extends BoxProps {
|
|
|
12
14
|
hideTitle: boolean,
|
|
13
15
|
programDidMount: () => void,
|
|
14
16
|
bfHabNavegador: boolean,
|
|
15
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Abas para a barra de ferramentas
|
|
19
|
+
*
|
|
20
|
+
* Array de arrays
|
|
21
|
+
*
|
|
22
|
+
* Array da aba: [('Label' || undefined), ('active' || undefined), ('alias' || undefined), (Icon || undefined)]
|
|
23
|
+
*
|
|
24
|
+
* - [0] Label: Rótulo da aba.
|
|
25
|
+
* - [1] Active: Quando 'active' inicia o programa com essa aba selecionada.
|
|
26
|
+
* - [2] Alias: O nome que será recebido na função 'bfExecutaFuncao'. Caso não forneça esse nome a função retorna 'T[index]'.
|
|
27
|
+
* - [3] Icon: JSX do ícone da aba.
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
bfAbas?: Array<TabArray>,
|
|
16
31
|
bfFerramentas: Array<any>,
|
|
17
32
|
bfExecutaFuncao: (prm: string) => void,
|
|
18
33
|
bfNmFuncaoVoltar: string,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import BarraFerramentas from './../BarraFerramentas';
|
|
2
2
|
import PageCodeEasterEgg from './PageCodeEasterEgg';
|
|
3
|
+
import TabNavigationRail from './TabNavigationRail';
|
|
3
4
|
import * as argous from '../../actions';
|
|
4
5
|
import { getProgram, toggleFavorite } from '../../api';
|
|
5
|
-
import { Box, CircularProgress, Paper, Typography, useTheme } from '@material-ui/core';
|
|
6
|
+
import { Box, CircularProgress, Paper, Typography, useMediaQuery, useTheme } from '@material-ui/core';
|
|
7
|
+
import { isArray } from 'lodash';
|
|
6
8
|
import PropTypes from 'prop-types';
|
|
7
9
|
import React, { useEffect, useState } from 'react';
|
|
8
10
|
import { FaExclamationTriangle } from 'react-icons/fa';
|
|
@@ -53,11 +55,25 @@ function Programa({
|
|
|
53
55
|
}) {
|
|
54
56
|
|
|
55
57
|
const theme = useTheme();
|
|
58
|
+
const xs = useMediaQuery(theme.breakpoints.only('xs'));
|
|
59
|
+
|
|
56
60
|
const [programa, setPrograma] = useState({});
|
|
61
|
+
const [selectedTab, setSelectedTab] = useState([]);
|
|
57
62
|
const [favoriteAnimationInsert, setFavoriteAnimationInsert] = useState(false);
|
|
58
63
|
const [favoriteAnimationRemove, setFavoriteAnimationRemove] = useState(false);
|
|
59
64
|
const [toolbarLoading/*, setToolbarLoading*/] = useState(initialStateToolbarLoading);
|
|
60
65
|
|
|
66
|
+
const tabNavigationRailRule = (!xs && isArray(bfAbas) && (bfAbas?.length > 1));
|
|
67
|
+
|
|
68
|
+
const styles = {
|
|
69
|
+
bodyContainer: {
|
|
70
|
+
display: 'flex',
|
|
71
|
+
gap: 10
|
|
72
|
+
},
|
|
73
|
+
childrenContainer: {
|
|
74
|
+
width: (tabNavigationRailRule) ? 'calc(100% - 58px)' : '100%'
|
|
75
|
+
}
|
|
76
|
+
};
|
|
61
77
|
|
|
62
78
|
useEffect(() => {
|
|
63
79
|
(async () => {
|
|
@@ -139,7 +155,15 @@ function Programa({
|
|
|
139
155
|
favoriteAnimationRemove={favoriteAnimationRemove}
|
|
140
156
|
threads={threads}
|
|
141
157
|
currentProgram={code}
|
|
142
|
-
{...{
|
|
158
|
+
{...{
|
|
159
|
+
addWidget,
|
|
160
|
+
habWidget,
|
|
161
|
+
snAnotacaoPrograma,
|
|
162
|
+
openAnnotations,
|
|
163
|
+
toolbarLoading,
|
|
164
|
+
selectedTab,
|
|
165
|
+
setSelectedTab
|
|
166
|
+
}}
|
|
143
167
|
/>
|
|
144
168
|
{dsErro ? (
|
|
145
169
|
<Box textAlign='center' >
|
|
@@ -150,7 +174,20 @@ function Programa({
|
|
|
150
174
|
<Box position='relative' top={20} left='50%' z-index={20} height={80} width={0} marginLeft='-20px'>
|
|
151
175
|
<CircularProgress disableShrink/>
|
|
152
176
|
</Box>
|
|
153
|
-
) :
|
|
177
|
+
) : (
|
|
178
|
+
<div style={styles.bodyContainer}>
|
|
179
|
+
{(tabNavigationRailRule) && (
|
|
180
|
+
<TabNavigationRail
|
|
181
|
+
tabs={bfAbas}
|
|
182
|
+
executesFunction={bfExecutaFuncao}
|
|
183
|
+
{...{ selectedTab, setSelectedTab }}
|
|
184
|
+
/>
|
|
185
|
+
)}
|
|
186
|
+
<div style={styles.childrenContainer}>
|
|
187
|
+
{children}
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
)}
|
|
154
191
|
</Paper>
|
|
155
192
|
<PageCodeEasterEgg {...{ code }} />
|
|
156
193
|
</Box>
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { usePrevious } from '../../utils';
|
|
2
|
+
import { alpha, IconButton, Paper, Tooltip, useTheme } from '@material-ui/core';
|
|
3
|
+
import { isArray, isEqual, isNumber } from 'lodash';
|
|
4
|
+
import React, { useEffect, useRef } from 'react';
|
|
5
|
+
import { IoSettings } from 'react-icons/io5';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export const TAB_LABEL_INDEX = 0;
|
|
9
|
+
export const TAB_ACTIVE_INDEX = 1;
|
|
10
|
+
export const TAB_ALIAS_INDEX = 2;
|
|
11
|
+
export const TAB_ICON_INDEX = 3;
|
|
12
|
+
|
|
13
|
+
const BUTTON_SIZE = 36;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const TabNavigationRail = ({
|
|
17
|
+
tabs = [],
|
|
18
|
+
selectedTab = [],
|
|
19
|
+
setSelectedTab = () => '',
|
|
20
|
+
executesFunction = () => ''
|
|
21
|
+
}) => {
|
|
22
|
+
|
|
23
|
+
const selectedTabRef = useRef(selectedTab);
|
|
24
|
+
const setSelectedTabRef = useRef(setSelectedTab);
|
|
25
|
+
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
|
|
28
|
+
const styles = {
|
|
29
|
+
rail: {
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
height: 'fit-content',
|
|
34
|
+
gap: 5,
|
|
35
|
+
padding: 5,
|
|
36
|
+
borderRadius: 10,
|
|
37
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
38
|
+
backgroundColor: theme.palette.background.paper
|
|
39
|
+
},
|
|
40
|
+
button: {
|
|
41
|
+
width: BUTTON_SIZE,
|
|
42
|
+
height: BUTTON_SIZE,
|
|
43
|
+
borderRadius: 5,
|
|
44
|
+
color: theme.palette.text.secondary,
|
|
45
|
+
border: '1px solid transparent',
|
|
46
|
+
transition: 'color 100ms ease-in-out, border-color 100ms ease-in-out, background-color 100ms ease-in-out'
|
|
47
|
+
},
|
|
48
|
+
activeButton: {
|
|
49
|
+
color: theme.palette.primary.main,
|
|
50
|
+
border: `1px solid ${alpha(theme.palette.primary.main, 0.2)}`,
|
|
51
|
+
backgroundColor: alpha(theme.palette.primary.main, 0.1)
|
|
52
|
+
},
|
|
53
|
+
icon: {
|
|
54
|
+
fontSize: 20
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const previousTabs = usePrevious(tabs);
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
|
|
62
|
+
if (isEqual(tabs, previousTabs) || !!selectedTabRef.current?.length) return;
|
|
63
|
+
if (!tabs?.length) {
|
|
64
|
+
if (typeof setSelectedTabRef.current === 'function') setSelectedTabRef.current([]);
|
|
65
|
+
} else for (let index = 0; index < tabs?.length; index++) {
|
|
66
|
+
|
|
67
|
+
const tab = tabs[index];
|
|
68
|
+
|
|
69
|
+
if (tab?.[TAB_ACTIVE_INDEX] === 'active') {
|
|
70
|
+
if (typeof setSelectedTabRef.current === 'function') setSelectedTabRef.current(tab);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, [tabs, previousTabs]);
|
|
75
|
+
|
|
76
|
+
const navigate = (event, index, tab) => {
|
|
77
|
+
|
|
78
|
+
const alias = tab?.[TAB_ALIAS_INDEX];
|
|
79
|
+
|
|
80
|
+
if (typeof setSelectedTabRef.current === 'function') setSelectedTabRef.current(tab);
|
|
81
|
+
if (isNumber(index)) executesFunction(alias || `T${index}`);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<Paper component='nav' elevation={1} style={styles.rail}>
|
|
87
|
+
{(isArray(tabs)) && tabs.map((tab, tabIndex) => {
|
|
88
|
+
|
|
89
|
+
const label = tab?.[TAB_LABEL_INDEX];
|
|
90
|
+
const Icon = tab?.[TAB_ICON_INDEX];
|
|
91
|
+
const active = isEqual(tab, selectedTab);
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<Tooltip key={label} title={label} placement='right'>
|
|
96
|
+
<IconButton
|
|
97
|
+
size='small'
|
|
98
|
+
aria-label={label}
|
|
99
|
+
aria-current={(active) ? 'page' : undefined}
|
|
100
|
+
onClick={(event) => navigate(event, tabIndex, tab)}
|
|
101
|
+
style={{ ...styles.button, ...((active) ? styles.activeButton : {}) }}
|
|
102
|
+
>
|
|
103
|
+
{(Icon) && (
|
|
104
|
+
<Icon style={styles.icon} />
|
|
105
|
+
)}
|
|
106
|
+
{(!Icon) && (
|
|
107
|
+
<IoSettings style={styles.icon} />
|
|
108
|
+
)}
|
|
109
|
+
</IconButton>
|
|
110
|
+
</Tooltip>
|
|
111
|
+
);
|
|
112
|
+
})}
|
|
113
|
+
</Paper>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
export default TabNavigationRail;
|
package/lib/utils/index.ts
CHANGED
|
@@ -477,91 +477,3 @@ export const numbersOnly = (value: string, type: string) => value ? value.replac
|
|
|
477
477
|
export const lettersOnly = (valor: string) => valor ? valor.replace(/\W/g, '') : '';
|
|
478
478
|
|
|
479
479
|
export const numbersLettersOnly = (valor: string) => valor ? valor.replace(/[^a-zA-Z0-9]+/g, '') : '';
|
|
480
|
-
|
|
481
|
-
// REMOVER
|
|
482
|
-
// export const documentType = {
|
|
483
|
-
// cpf: {
|
|
484
|
-
// length: 11,
|
|
485
|
-
// symbols: {
|
|
486
|
-
// length: 3
|
|
487
|
-
// },
|
|
488
|
-
// lengthWithSymbols: 14
|
|
489
|
-
// },
|
|
490
|
-
// cnpj: {
|
|
491
|
-
// length: 14,
|
|
492
|
-
// symbols: {
|
|
493
|
-
// length: 4
|
|
494
|
-
// },
|
|
495
|
-
// lengthWithSymbols: 18
|
|
496
|
-
// },
|
|
497
|
-
// rg: {
|
|
498
|
-
// length: 10,
|
|
499
|
-
// symbols: {
|
|
500
|
-
// length: 0
|
|
501
|
-
// },
|
|
502
|
-
// lengthWithSymbols: 10
|
|
503
|
-
// },
|
|
504
|
-
// cnes: {
|
|
505
|
-
// length: 7
|
|
506
|
-
// },
|
|
507
|
-
// crm: {
|
|
508
|
-
// length: 6
|
|
509
|
-
// },
|
|
510
|
-
// unimedCard: {
|
|
511
|
-
// length: 17
|
|
512
|
-
// },
|
|
513
|
-
// cep: {
|
|
514
|
-
// length: 8,
|
|
515
|
-
// symbols: {
|
|
516
|
-
// length: 1
|
|
517
|
-
// },
|
|
518
|
-
// lengthWithSymbols: 9
|
|
519
|
-
// },
|
|
520
|
-
// telephone: {
|
|
521
|
-
// length: 11,
|
|
522
|
-
// symbols: {
|
|
523
|
-
// length: 2
|
|
524
|
-
// },
|
|
525
|
-
// lengthWithSymbols: 13
|
|
526
|
-
// }
|
|
527
|
-
// };
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
// export const formatCpfCnpj = (value: (string|number)) => {
|
|
531
|
-
// if (!value) return '';
|
|
532
|
-
// if (isNumber(value)) value = value.toString();
|
|
533
|
-
// value = value.replace(/[^\d]/g, '');
|
|
534
|
-
// const valueLen = value.length;
|
|
535
|
-
// if (valueLen > 3 && valueLen < 7) value = `${value.substring(0, 3)}.${value.substring(3)}`;
|
|
536
|
-
// else if (valueLen > 6 && valueLen < 10) value = `${value.substring(0, 3)}.${value.substring(3, 6)}.${value.substring(6)}`;
|
|
537
|
-
// else if (valueLen > 8 && valueLen < 12) value = `${value.substring(0, 3)}.${value.substring(3, 6)}.${value.substring(6, 9)}-${value.substring(9)}`;
|
|
538
|
-
// else if (valueLen > 11 && valueLen < 13) value = `${value.substring(0, 2)}.${value.substring(2, 5)}.${value.substring(5, 8)}/${value.substring(8)}`;
|
|
539
|
-
// else if (valueLen > 12) value = `${value.substring(0, 2)}.${value.substring(2, 5)}.${value.substring(5, 8)}/${value.substring(8, 12)}-${value.substring(12, 14)}`;
|
|
540
|
-
// return value;
|
|
541
|
-
// };
|
|
542
|
-
|
|
543
|
-
// export const formataCpf = (value: string) => value?.replace(/[^\d]/, '').replace(/^(.{3})(.{3})(.{3})(.{2})$/, '$1.$2.$3-$4');
|
|
544
|
-
|
|
545
|
-
// export function cpfTest(cpf: (string|number)) {
|
|
546
|
-
|
|
547
|
-
// if (typeof cpf === 'number') cpf = cpf.toString();
|
|
548
|
-
// if (!cpf || allCharactersSame(cpf)) return false;
|
|
549
|
-
|
|
550
|
-
// let sum = 0;
|
|
551
|
-
// let rest: number;
|
|
552
|
-
|
|
553
|
-
// for (let index = 1; index <= 9; index++) sum += (parseInt(cpf.substring(index - 1, index)) * (11 - index));
|
|
554
|
-
// rest = ((sum * 10) % 11);
|
|
555
|
-
|
|
556
|
-
// if ((rest === 10) || (rest === 11)) rest = 0;
|
|
557
|
-
// if (rest !== parseInt(cpf.substring(9, 10))) return false;
|
|
558
|
-
|
|
559
|
-
// sum = 0;
|
|
560
|
-
// for (let index = 1; index <= 10; index++) sum += (parseInt(cpf.substring(index - 1, index)) * (12 - index));
|
|
561
|
-
// rest = ((sum * 10) % 11);
|
|
562
|
-
|
|
563
|
-
// if ((rest === 10) || (rest === 11)) rest = 0;
|
|
564
|
-
// if (rest !== parseInt(cpf.substring(10, 11))) return false;
|
|
565
|
-
|
|
566
|
-
// return true;
|
|
567
|
-
// }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "argous",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.247",
|
|
4
4
|
"description": "Argous.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Carlos Schneider",
|
|
@@ -105,6 +105,6 @@
|
|
|
105
105
|
"react-paginate": "^7.1.2",
|
|
106
106
|
"react-transition-group": "^4.4.1",
|
|
107
107
|
"smooth-dnd": "^0.12.1",
|
|
108
|
-
"typescript": "4.
|
|
108
|
+
"typescript": "4.9.5"
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# TinyMCE
|
|
2
|
-
|
|
3
|
-
The world's #1 open source rich text editor.
|
|
4
|
-
|
|
5
|
-
**Using an old version of TinyMCE?** We recommend you to upgrade to TinyMCE 6 to continue receiving security updates, or consider [TinyMCE 5 LTS](https://www.tiny.cloud/long-term-support/) if you need more time to upgrade.
|
|
6
|
-
|
|
7
|
-
Used and trusted by millions of developers, TinyMCE is the world’s most customizable, scalable, and flexible rich text editor. We’ve helped launch the likes of Atlassian, Medium, Evernote (and lots more that we can’t tell you), by empowering them to create exceptional content and experiences for their users.
|
|
8
|
-
|
|
9
|
-
With more than 350M+ downloads every year, we’re also one of the most trusted enterprise-grade open source HTML editors on the internet. There’s currently more than 100M+ products worldwide, powered by Tiny. As a high powered WYSIWYG editor, TinyMCE is built to scale, designed to innovate, and thrives on delivering results to difficult edge-cases.
|
|
10
|
-
|
|
11
|
-
You can access a [full featured demo of TinyMCE](https://www.tiny.cloud/docs/tinymce/6/premium-full-featured/) in the docs on the TinyMCE website.
|
|
12
|
-
|
|
13
|
-
<p align="center">
|
|
14
|
-
<img alt="Screenshot of the TinyMCE Editor" src="https://www.tiny.cloud/storage/github-readme-images/tinymce-editor-6x.png"\>
|
|
15
|
-
</p>
|
|
16
|
-
|
|
17
|
-
## Get started with TinyMCE
|
|
18
|
-
|
|
19
|
-
Getting started with the TinyMCE rich text editor is easy, and for simple configurations can be done in less than 5 minutes.
|
|
20
|
-
|
|
21
|
-
[TinyMCE Cloud Deployment Quick Start Guide](https://www.tiny.cloud/docs/tinymce/6/cloud-quick-start/)
|
|
22
|
-
|
|
23
|
-
[TinyMCE Self-hosted Deployment Guide](https://www.tiny.cloud/docs/tinymce/6/npm-projects/)
|
|
24
|
-
|
|
25
|
-
TinyMCE provides a range of configuration options that allow you to integrate it into your application. Start customizing with a [basic setup](https://www.tiny.cloud/docs/tinymce/6/basic-setup/).
|
|
26
|
-
|
|
27
|
-
Configure it for one of three modes of editing:
|
|
28
|
-
|
|
29
|
-
- [TinyMCE classic editing mode](https://www.tiny.cloud/docs/tinymce/6/use-tinymce-classic/).
|
|
30
|
-
- [TinyMCE inline editing mode](https://www.tiny.cloud/docs/tinymce/6/use-tinymce-inline/).
|
|
31
|
-
- [TinyMCE distraction-free editing mode](https://www.tiny.cloud/docs/tinymce/6/use-tinymce-distraction-free/).
|
|
32
|
-
|
|
33
|
-
## Features
|
|
34
|
-
|
|
35
|
-
### Integration
|
|
36
|
-
|
|
37
|
-
TinyMCE is easily integrated into your projects with the help of components such as:
|
|
38
|
-
|
|
39
|
-
- [tinymce-react](https://github.com/tinymce/tinymce-react)
|
|
40
|
-
- [tinymce-vue](https://github.com/tinymce/tinymce-vue)
|
|
41
|
-
- [tinymce-angular](https://github.com/tinymce/tinymce-angular)
|
|
42
|
-
|
|
43
|
-
With over 29 integrations, and 400+ APIs, see the TinyMCE docs for a full list of editor [integrations](https://www.tiny.cloud/docs/tinymce/6/integrations/).
|
|
44
|
-
|
|
45
|
-
### Customization
|
|
46
|
-
|
|
47
|
-
It is easy to [configure the UI](https://www.tiny.cloud/docs/tinymce/6/customize-ui/) of your rich text editor to match the design of your site, product or application. Due to its flexibility, you can [configure the editor](https://www.tiny.cloud/docs/tinymce/6/basic-setup/) with as much or as little functionality as you like, depending on your requirements.
|
|
48
|
-
|
|
49
|
-
With [50+ powerful plugins available](https://www.tiny.cloud/tinymce/features/), and content editable as the basis of TinyMCE, adding additional functionality is as simple as including a single line of code.
|
|
50
|
-
|
|
51
|
-
Realizing the full power of most plugins requires only a few lines more.
|
|
52
|
-
|
|
53
|
-
### Extensibility
|
|
54
|
-
|
|
55
|
-
Sometimes your editor requirements can be quite unique, and you need the freedom and flexibility to innovate. Thanks to TinyMCE being open source, you can view the source code and develop your own extensions for custom functionality to meet your own requirements.
|
|
56
|
-
|
|
57
|
-
The TinyMCE [API](https://www.tiny.cloud/docs/tinymce/6/apis/tinymce.root/) is exposed to make it easier for you to write custom functionality that fits within the existing framework of TinyMCE [UI components](https://www.tiny.cloud/docs/tinymce/6/custom-ui-components/).
|
|
58
|
-
|
|
59
|
-
### Extended Features and Support
|
|
60
|
-
|
|
61
|
-
For the professional software teams that require more in-depth efficiency, compliance or collaborative features built to enterprise-grade standards, please [get in touch with our team](https://www.tiny.cloud/contact/).
|
|
62
|
-
|
|
63
|
-
Tiny also offers dedicated SLAs and support for professional development teams.
|
|
64
|
-
|
|
65
|
-
## Compiling and contributing
|
|
66
|
-
|
|
67
|
-
In 2019 the decision was made to transition our codebase to a monorepo. For information on compiling and contributing, see: [contribution guidelines](https://github.com/tinymce/tinymce/blob/master/CONTRIBUTING.md).
|
|
68
|
-
|
|
69
|
-
As an open source product, we encourage and support the active development of our software.
|
|
70
|
-
|
|
71
|
-
## Want more information?
|
|
72
|
-
|
|
73
|
-
Visit the [TinyMCE website](https://tiny.cloud/) and check out the [TinyMCE documentation](https://www.tiny.cloud/docs/).
|