@arquimedes.co/eureka-forms 2.0.73-test → 2.0.74

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.
@@ -53,8 +53,14 @@ export interface GTimePicker extends GBaseStep {
53
53
  required: boolean;
54
54
  size: 1 | 2 | 3 | 4;
55
55
  pickDays: boolean;
56
+ minDays?: number;
57
+ maxDays?: number;
56
58
  pickHours: boolean;
59
+ minHours?: number;
60
+ maxHours?: number;
57
61
  pickMinutes: boolean;
62
+ minMinutes?: number;
63
+ maxMinutes?: number;
58
64
  /** Undefined if user can choose */
59
65
  working?: boolean;
60
66
  }
@@ -35,6 +35,6 @@ function TimePickerStep(_a) {
35
35
  },
36
36
  },
37
37
  }), ref = _d.ref, value = _d.value, onChange = _d.onChange, error = _d.error, field = _d.field;
38
- return (_jsx(MaterialInputContainer, __assign({ step: step, editable: editable }, { children: _jsx(RoundedTimePicker, __assign({}, field, { value: value, onChange: onChange, inputRef: ref, cantEdit: !editable || postview, errorColor: formStyle.errorColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, helperTextColor: formStyle.descriptionTextColor, backgroundColor: formStyle.stepBackgroundColor, fontWeight: 400, height: '31px', label: step.label, helperText: (_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : step.description, error: !!error, required: step.required, pickDays: step.pickDays, pickHours: step.pickHours, pickMinutes: step.pickMinutes, working: step.working })) })));
38
+ return (_jsx(MaterialInputContainer, __assign({ step: step, editable: editable }, { children: _jsx(RoundedTimePicker, __assign({}, field, { value: value, onChange: onChange, inputRef: ref, cantEdit: !editable || postview, errorColor: formStyle.errorColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, helperTextColor: formStyle.descriptionTextColor, backgroundColor: formStyle.stepBackgroundColor, fontWeight: 400, height: '31px', label: step.label, helperText: (_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : step.description, error: !!error, required: step.required, pickDays: step.pickDays, minDays: step.minDays, maxDays: step.maxDays, pickHours: step.pickHours, minHours: step.minHours, maxHours: step.maxHours, pickMinutes: step.pickMinutes, minMinutes: step.minMinutes, maxMinutes: step.maxMinutes, working: step.working })) })));
39
39
  }
40
40
  export default TimePickerStep;
@@ -22,8 +22,14 @@ interface RoundedTimePickerProps extends Omit<SelectProps, 'color' | 'onChange'>
22
22
  /** The icon to display */
23
23
  iconComponent?: any;
24
24
  pickDays?: boolean;
25
+ minDays?: number;
26
+ maxDays?: number;
25
27
  pickHours?: boolean;
28
+ minHours?: number;
29
+ maxHours?: number;
26
30
  pickMinutes?: boolean;
31
+ minMinutes?: number;
32
+ maxMinutes?: number;
27
33
  working?: boolean;
28
34
  }
29
35
  /**
@@ -173,7 +173,7 @@ var useMenuStyles = function () {
173
173
  };
174
174
  function CustomSelect(_a) {
175
175
  var _b, _c, _d;
176
- var value = _a.value, onChange = _a.onChange, label = _a.label, minWidth = _a.minWidth, helperText = _a.helperText, _e = _a.color, color = _e === void 0 ? '#293241' : _e, _f = _a.errorColor, errorColor = _f === void 0 ? '#cc2936' : _f, _g = _a.focusColor, focusColor = _g === void 0 ? '#3d5a7f' : _g, _h = _a.outlineColor, outlineColor = _h === void 0 ? '#0000003b' : _h, _j = _a.helperTextColor, helperTextColor = _j === void 0 ? '#989898' : _j, _k = _a.backgroundColor, backgroundColor = _k === void 0 ? '#ffffff' : _k, _l = _a.readOnly, readOnly = _l === void 0 ? false : _l, _m = _a.borderRadius, borderRadius = _m === void 0 ? 10 : _m, _o = _a.paddingLeft, paddingLeft = _o === void 0 ? 14 : _o, _p = _a.paddingRight, paddingRight = _p === void 0 ? 32 : _p, _q = _a.cantEdit, cantEdit = _q === void 0 ? false : _q, _r = _a.containerMargin, containerMargin = _r === void 0 ? '8px' : _r, _s = _a.height, height = _s === void 0 ? '40px' : _s, _t = _a.fontSize, fontSize = _t === void 0 ? '1rem' : _t, required = _a.required, error = _a.error, pickDays = _a.pickDays, pickMinutes = _a.pickMinutes, pickHours = _a.pickHours, working = _a.working, others = __rest(_a, ["value", "onChange", "label", "minWidth", "helperText", "color", "errorColor", "focusColor", "outlineColor", "helperTextColor", "backgroundColor", "readOnly", "borderRadius", "paddingLeft", "paddingRight", "cantEdit", "containerMargin", "height", "fontSize", "required", "error", "pickDays", "pickMinutes", "pickHours", "working"]);
176
+ var value = _a.value, onChange = _a.onChange, label = _a.label, minWidth = _a.minWidth, helperText = _a.helperText, _e = _a.color, color = _e === void 0 ? '#293241' : _e, _f = _a.errorColor, errorColor = _f === void 0 ? '#cc2936' : _f, _g = _a.focusColor, focusColor = _g === void 0 ? '#3d5a7f' : _g, _h = _a.outlineColor, outlineColor = _h === void 0 ? '#0000003b' : _h, _j = _a.helperTextColor, helperTextColor = _j === void 0 ? '#989898' : _j, _k = _a.backgroundColor, backgroundColor = _k === void 0 ? '#ffffff' : _k, _l = _a.readOnly, readOnly = _l === void 0 ? false : _l, _m = _a.borderRadius, borderRadius = _m === void 0 ? 10 : _m, _o = _a.paddingLeft, paddingLeft = _o === void 0 ? 14 : _o, _p = _a.paddingRight, paddingRight = _p === void 0 ? 32 : _p, _q = _a.cantEdit, cantEdit = _q === void 0 ? false : _q, _r = _a.containerMargin, containerMargin = _r === void 0 ? '8px' : _r, _s = _a.height, height = _s === void 0 ? '40px' : _s, _t = _a.fontSize, fontSize = _t === void 0 ? '1rem' : _t, required = _a.required, error = _a.error, pickDays = _a.pickDays, _u = _a.minDays, minDays = _u === void 0 ? 0 : _u, maxDays = _a.maxDays, pickHours = _a.pickHours, _v = _a.minHours, minHours = _v === void 0 ? 0 : _v, maxHours = _a.maxHours, pickMinutes = _a.pickMinutes, _w = _a.minMinutes, minMinutes = _w === void 0 ? 0 : _w, maxMinutes = _a.maxMinutes, working = _a.working, others = __rest(_a, ["value", "onChange", "label", "minWidth", "helperText", "color", "errorColor", "focusColor", "outlineColor", "helperTextColor", "backgroundColor", "readOnly", "borderRadius", "paddingLeft", "paddingRight", "cantEdit", "containerMargin", "height", "fontSize", "required", "error", "pickDays", "minDays", "maxDays", "pickHours", "minHours", "maxHours", "pickMinutes", "minMinutes", "maxMinutes", "working"]);
177
177
  var StyleProps = {
178
178
  color: color,
179
179
  height: height,
@@ -195,7 +195,7 @@ function CustomSelect(_a) {
195
195
  var labelClasses = useLabelInputStyles(StyleProps)();
196
196
  var helperTextClasses = useHelperTextStyles(StyleProps)();
197
197
  var menuClasses = useMenuStyles()();
198
- var _u = useState(false), open = _u[0], setOpen = _u[1];
198
+ var _x = useState(false), open = _x[0], setOpen = _x[1];
199
199
  var ref = React.useRef(null);
200
200
  var handleChange = useCallback(function (value) {
201
201
  if (value.days === 0) {
@@ -231,11 +231,20 @@ function CustomSelect(_a) {
231
231
  paddingTop: error && helperText ? '0px' : '30px',
232
232
  } }, { children: [error && helperText && (_jsx("div", __assign({ className: styles.errorMessage, style: {
233
233
  color: errorColor,
234
- } }, { children: helperText }))), pickDays && (_jsx("div", __assign({ className: styles.numberPickerContainer }, { children: _jsx(RoundedTextField, { label: "D\u00EDas", type: "number", inputProps: { min: 0 }, value: ((_b = value === null || value === void 0 ? void 0 : value.days) !== null && _b !== void 0 ? _b : '0') + '', onChange: function (e) {
234
+ } }, { children: helperText }))), pickDays && (_jsx("div", __assign({ className: styles.numberPickerContainer }, { children: _jsx(RoundedTextField, { label: "D\u00EDas", type: "number", inputProps: {
235
+ min: minDays,
236
+ max: maxDays,
237
+ }, value: ((_b = value === null || value === void 0 ? void 0 : value.days) !== null && _b !== void 0 ? _b : minDays) + '', onChange: function (e) {
235
238
  handleChange(__assign(__assign({}, value), { days: parseInt(e.target.value) }));
236
- } }) }))), pickHours && (_jsx("div", __assign({ className: styles.numberPickerContainer }, { children: _jsx(RoundedTextField, { label: "Horas", type: "number", inputProps: { min: 0 }, value: ((_c = value === null || value === void 0 ? void 0 : value.hours) !== null && _c !== void 0 ? _c : '0') + '', onChange: function (e) {
239
+ } }) }))), pickHours && (_jsx("div", __assign({ className: styles.numberPickerContainer }, { children: _jsx(RoundedTextField, { label: "Horas", type: "number", inputProps: {
240
+ min: minHours,
241
+ max: maxHours,
242
+ }, value: ((_c = value === null || value === void 0 ? void 0 : value.hours) !== null && _c !== void 0 ? _c : minHours) + '', onChange: function (e) {
237
243
  handleChange(__assign(__assign({}, value), { hours: parseInt(e.target.value) }));
238
- } }) }))), pickMinutes && (_jsx("div", __assign({ className: styles.numberPickerContainer }, { children: _jsx(RoundedTextField, { label: "Minutos", type: "number", inputProps: { min: 0 }, value: ((_d = value === null || value === void 0 ? void 0 : value.minutes) !== null && _d !== void 0 ? _d : '0') + '', onChange: function (e) {
244
+ } }) }))), pickMinutes && (_jsx("div", __assign({ className: styles.numberPickerContainer }, { children: _jsx(RoundedTextField, { label: "Minutos", type: "number", inputProps: {
245
+ min: minMinutes,
246
+ max: maxMinutes,
247
+ }, value: ((_d = value === null || value === void 0 ? void 0 : value.minutes) !== null && _d !== void 0 ? _d : minMinutes) + '', onChange: function (e) {
239
248
  handleChange(__assign(__assign({}, value), { minutes: parseInt(e.target.value) }));
240
249
  } }) }))), working === undefined && (_jsxs("div", __assign({ className: styles.workingContainer }, { children: ["H\u00E1biles:", _jsx(Toggle, { checked: !!(value === null || value === void 0 ? void 0 : value.working), disabled: working !== undefined, onChange: function (working) {
241
250
  handleChange(__assign(__assign({}, value), { working: working }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version":"2.0.73-test",
4
+ "version": "2.0.74",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",