argous 1.2.162 → 1.2.163
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.
|
@@ -46,8 +46,14 @@ export interface StepperTypeMap<P ={}, D extends React.ElementType = 'div'> {
|
|
|
46
46
|
disableActions?: boolean;
|
|
47
47
|
/**
|
|
48
48
|
* Orientação do Stepper
|
|
49
|
+
* default: horizontal
|
|
50
|
+
* opções: horizontal ou vertical
|
|
49
51
|
*/
|
|
50
52
|
orientation?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Mostra o progresso percorrido
|
|
55
|
+
*/
|
|
56
|
+
showProgress?: boolean;
|
|
51
57
|
};
|
|
52
58
|
defaultComponent: D;
|
|
53
59
|
classKey: StepperClassKey;
|
|
@@ -53,9 +53,10 @@ var ColorlibConnector = core_1.withStyles(function (theme) { return ({
|
|
|
53
53
|
alternativeLabel: function (_a) {
|
|
54
54
|
var orientation = _a.orientation;
|
|
55
55
|
return orientation === 'vertical' ? {
|
|
56
|
-
top: -
|
|
56
|
+
top: -38,
|
|
57
57
|
transform: 'rotate(90deg)',
|
|
58
|
-
left: 'calc(-50% +
|
|
58
|
+
left: 'calc(-50% + 40px)',
|
|
59
|
+
right: 'calc(50% + 10px)',
|
|
59
60
|
'&>span': {
|
|
60
61
|
minHeight: 3
|
|
61
62
|
}
|
|
@@ -158,7 +159,12 @@ var stepperStyles = function (theme) {
|
|
|
158
159
|
selectedCaption: {
|
|
159
160
|
color: theme.palette.text.secondary
|
|
160
161
|
},
|
|
161
|
-
stepper: (_a = {
|
|
162
|
+
stepper: (_a = {
|
|
163
|
+
padding: function (_a) {
|
|
164
|
+
var orientation = _a.orientation;
|
|
165
|
+
return orientation === 'vertical' ? '0 0 0 136px' : '';
|
|
166
|
+
}
|
|
167
|
+
},
|
|
162
168
|
_a[theme.breakpoints.down('sm')] = {
|
|
163
169
|
padding: 0
|
|
164
170
|
},
|
|
@@ -184,8 +190,8 @@ var stepperStyles = function (theme) {
|
|
|
184
190
|
alignItems: 'center',
|
|
185
191
|
justifyContent: 'end',
|
|
186
192
|
position: 'absolute',
|
|
187
|
-
top:
|
|
188
|
-
left:
|
|
193
|
+
top: 17,
|
|
194
|
+
left: -148,
|
|
189
195
|
},
|
|
190
196
|
icon: {
|
|
191
197
|
fontSize: theme.typography.fontSize * 2,
|
|
@@ -201,20 +207,26 @@ var stepperStyles = function (theme) {
|
|
|
201
207
|
margin: function (_a) {
|
|
202
208
|
var orientation = _a.orientation;
|
|
203
209
|
return orientation === 'vertical' ? '0 0 0 8px' : '';
|
|
210
|
+
},
|
|
211
|
+
'&>span:nth-child(1)': {
|
|
212
|
+
margin: function (_a) {
|
|
213
|
+
var orientation = _a.orientation;
|
|
214
|
+
return orientation === 'vertical' ? 0 : '';
|
|
215
|
+
}
|
|
204
216
|
}
|
|
205
|
-
}
|
|
217
|
+
},
|
|
206
218
|
}
|
|
207
219
|
});
|
|
208
220
|
};
|
|
209
221
|
var Stepper = function (_a) {
|
|
210
222
|
var children = _a.children, _b = _a.classes, classes = _b === void 0 ? {} : _b, _c = _a.steps, steps = _c === void 0 ? [] : _c, _d = _a.onClick, onClick = _d === void 0 ? function (index) { return function (event) { return void (index, event); }; } : _d, _e = _a.onNext, onNext = _e === void 0 ? function (event) { return void (event); } : _e, _f = _a.onPrevious, onPrevious = _f === void 0 ? function (event) { return void (event); } : _f, _g = _a.onFinish, onFinish = _g === void 0 ? function (event) { return void (event); } : _g, maxStepProps = _a.maxStep, _h = _a.activeStep, activeStep = _h === void 0 ? 0 : _h, _j = _a.errors, errors = _j === void 0 ? [] : _j, _k = _a.component, Component = _k === void 0 ? 'div' : _k, _l = _a.backLabel, backLabel = _l === void 0 ? 'Voltar' : _l, _m = _a.nextLabel, nextLabel = _m === void 0 ? 'Avançar' : _m, _o = _a.finishLabel, finishLabel = _o === void 0 ? 'Finalizar' : _o, _p = _a.disableFinish, disableFinish = _p === void 0 ? false : _p, _q = _a.disableNext, disableNext = _q === void 0 ? false : _q, _r = _a.disablePrevious, disablePrevious = _r === void 0 ? false : _r, _s = _a.showProgress, showProgress = _s === void 0 ? false : _s, _t = _a.disableActions, disableActions = _t === void 0 ? false : _t, _u = _a.orientation, orientation = _u === void 0 ? 'horizontal' : _u, props = __rest(_a, ["children", "classes", "steps", "onClick", "onNext", "onPrevious", "onFinish", "maxStep", "activeStep", "errors", "component", "backLabel", "nextLabel", "finishLabel", "disableFinish", "disableNext", "disablePrevious", "showProgress", "disableActions", "orientation"]);
|
|
223
|
+
var theme = core_1.useTheme();
|
|
211
224
|
var maxSteps = steps.length;
|
|
212
225
|
var maxStep = maxStepProps || steps.length - 1;
|
|
226
|
+
var mobile = core_1.useMediaQuery(theme.breakpoints.down(Math.max(maxSteps * 100, theme.breakpoints.values.sm)));
|
|
227
|
+
var ambienteTeste = JSON.parse(window.localStorage.getItem('ambienteTeste'));
|
|
213
228
|
var _v = react_1.useState(-1), initialStep = _v[0], setInitialStep = _v[1];
|
|
214
229
|
react_1.useEffect(function () { return (activeStep > initialStep && showProgress) && setInitialStep(activeStep); }, [activeStep, initialStep, showProgress]);
|
|
215
|
-
var ambienteTeste = JSON.parse(window.localStorage.getItem('ambienteTeste'));
|
|
216
|
-
var theme = core_1.useTheme();
|
|
217
|
-
var mobile = core_1.useMediaQuery(theme.breakpoints.down(Math.max(maxSteps * 100, theme.breakpoints.values.sm)));
|
|
218
230
|
return react_1.default.createElement(Component, __assign({}, props),
|
|
219
231
|
mobile && orientation !== 'vertical' ? (react_1.default.createElement(core_1.Paper, { square: true, elevation: 0 },
|
|
220
232
|
react_1.default.createElement(core_1.ListItem, { dense: true, className: classes.header },
|
|
@@ -46,8 +46,14 @@ export interface StepperTypeMap<P ={}, D extends React.ElementType = 'div'> {
|
|
|
46
46
|
disableActions?: boolean;
|
|
47
47
|
/**
|
|
48
48
|
* Orientação do Stepper
|
|
49
|
+
* default: horizontal
|
|
50
|
+
* opções: horizontal ou vertical
|
|
49
51
|
*/
|
|
50
52
|
orientation?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Mostra o progresso percorrido
|
|
55
|
+
*/
|
|
56
|
+
showProgress?: boolean;
|
|
51
57
|
};
|
|
52
58
|
defaultComponent: D;
|
|
53
59
|
classKey: StepperClassKey;
|
|
@@ -6,9 +6,10 @@ import { MdCheck, MdChevronLeft, MdChevronRight } from 'react-icons/md';
|
|
|
6
6
|
|
|
7
7
|
const ColorlibConnector = withStyles(theme => ({
|
|
8
8
|
alternativeLabel: ({ orientation }) => orientation === 'vertical' ? {
|
|
9
|
-
top: -
|
|
9
|
+
top: -38,
|
|
10
10
|
transform: 'rotate(90deg)',
|
|
11
|
-
left: 'calc(-50% +
|
|
11
|
+
left: 'calc(-50% + 40px)',
|
|
12
|
+
right: 'calc(50% + 10px)',
|
|
12
13
|
'&>span': {
|
|
13
14
|
minHeight: 3
|
|
14
15
|
}
|
|
@@ -105,6 +106,7 @@ const stepperStyles = theme => ({
|
|
|
105
106
|
color: theme.palette.text.secondary
|
|
106
107
|
},
|
|
107
108
|
stepper: {
|
|
109
|
+
padding: ({ orientation }) => orientation === 'vertical' ? '0 0 0 136px' : '',
|
|
108
110
|
[theme.breakpoints.down('sm')]: {
|
|
109
111
|
padding: 0
|
|
110
112
|
},
|
|
@@ -124,8 +126,8 @@ const stepperStyles = theme => ({
|
|
|
124
126
|
alignItems: 'center',
|
|
125
127
|
justifyContent: 'end',
|
|
126
128
|
position: 'absolute',
|
|
127
|
-
top:
|
|
128
|
-
left:
|
|
129
|
+
top: 17,
|
|
130
|
+
left: -148,
|
|
129
131
|
},
|
|
130
132
|
icon: {
|
|
131
133
|
fontSize: theme.typography.fontSize * 2,
|
|
@@ -138,8 +140,11 @@ const stepperStyles = theme => ({
|
|
|
138
140
|
},
|
|
139
141
|
stepLabel: {
|
|
140
142
|
'&>span:nth-child(2)': {
|
|
141
|
-
margin: ({ orientation }) => orientation === 'vertical' ? '0 0 0 8px' : ''
|
|
142
|
-
|
|
143
|
+
margin: ({ orientation }) => orientation === 'vertical' ? '0 0 0 8px' : '',
|
|
144
|
+
'&>span:nth-child(1)': {
|
|
145
|
+
margin: ({ orientation }) => orientation === 'vertical' ? 0 : ''
|
|
146
|
+
}
|
|
147
|
+
},
|
|
143
148
|
}
|
|
144
149
|
});
|
|
145
150
|
|
|
@@ -166,17 +171,14 @@ const Stepper = ({
|
|
|
166
171
|
orientation = 'horizontal',
|
|
167
172
|
...props
|
|
168
173
|
}) => {
|
|
174
|
+
const theme = useTheme();
|
|
169
175
|
const maxSteps = steps.length;
|
|
170
176
|
const maxStep = maxStepProps || steps.length - 1;
|
|
171
|
-
|
|
177
|
+
const mobile = useMediaQuery(theme.breakpoints.down(Math.max(maxSteps * 100, theme.breakpoints.values.sm)));
|
|
178
|
+
const ambienteTeste = JSON.parse(window.localStorage.getItem('ambienteTeste'));
|
|
172
179
|
const [initialStep, setInitialStep] = useState(-1);
|
|
173
180
|
useEffect(() => (activeStep > initialStep && showProgress) && setInitialStep(activeStep), [activeStep, initialStep, showProgress]);
|
|
174
181
|
|
|
175
|
-
const ambienteTeste = JSON.parse(window.localStorage.getItem('ambienteTeste'));
|
|
176
|
-
|
|
177
|
-
const theme = useTheme();
|
|
178
|
-
const mobile = useMediaQuery(theme.breakpoints.down(Math.max(maxSteps * 100, theme.breakpoints.values.sm)));
|
|
179
|
-
|
|
180
182
|
return <Component {...props}>
|
|
181
183
|
{mobile && orientation !== 'vertical' ? (
|
|
182
184
|
<Paper square elevation={0}>
|