@arquimedes.co/eureka-forms 2.0.45 → 2.0.47

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.
@@ -16,6 +16,7 @@ export interface GCheckBox extends GBaseStep {
16
16
  label: string;
17
17
  description: string | null;
18
18
  required: boolean;
19
+ isList?: boolean;
19
20
  size: 1 | 2 | 3 | 4;
20
21
  }
21
22
  export interface GSeparator extends GBaseStep {
package/dist/Form/Form.js CHANGED
@@ -107,7 +107,7 @@ function FormComponent(_a) {
107
107
  switch (_c.label) {
108
108
  case 0:
109
109
  token = null;
110
- if (!(form.hasCaptcha && !internal && !customSubmit)) return [3 /*break*/, 2];
110
+ if (!(form.hasCaptcha && !customSubmit)) return [3 /*break*/, 2];
111
111
  token = recaptchaRef.current.getValue();
112
112
  if (!!token) return [3 /*break*/, 2];
113
113
  return [4 /*yield*/, (recaptchaRef === null || recaptchaRef === void 0 ? void 0 : recaptchaRef.current.executeAsync())];
@@ -115,7 +115,7 @@ function FormComponent(_a) {
115
115
  token = _c.sent();
116
116
  _c.label = 2;
117
117
  case 2:
118
- if (!apiKey && !internal && !customSubmit)
118
+ if (!apiKey && !customSubmit)
119
119
  return [2 /*return*/];
120
120
  _c.label = 3;
121
121
  case 3:
@@ -19,6 +19,7 @@ import { useAppSelector } from '../../../hooks';
19
19
  import { useFormStep } from '../../StepHooks';
20
20
  import StepFillerContainer from '../../Utils/@StepFiller/StepFiller';
21
21
  import MaterialInputContainer from '../../Utils/MaterialInputContainer/MaterialInputContainer';
22
+ import { calcStepWidth } from '../../StepFunctions';
22
23
  function CheckBoxStep(_a) {
23
24
  var _b;
24
25
  var step = _a.step, editable = _a.editable;
@@ -38,7 +39,16 @@ function CheckBoxStep(_a) {
38
39
  return (_jsx(StepComponent, { editable: editable, step: subStep }, idStep));
39
40
  }) }));
40
41
  };
41
- return (_jsxs(StepFillerContainer, __assign({ step: step }, { children: [_jsx(MaterialInputContainer, __assign({ step: step, editable: editable }, { children: _jsxs("div", __assign({ className: styles.container }, { children: [_jsxs("div", __assign({ className: styles.labelCheckBoxContainer }, { children: [step.label && (_jsxs("div", __assign({ className: styles.checkboxLbl }, { children: [step.label, step.required ? ' *' : '', ":"] }))), _jsx(RoundedCheckBox, __assign({}, field, { inputRef: ref, onChange: onChange, "data-testid": step.id, padding: "0px", size: "1.6rem", error: !!error, cantEdit: !editable || postview, checkedColor: formStyle.primaryColor, uncheckedColor: formStyle.outlineColor, checked: value }))] })), (step.description || !!error) && (_jsx("div", __assign({ className: styles.descriptionPar, style: {
42
+ var renderLabel = function (colon) {
43
+ if (colon === void 0) { colon = false; }
44
+ return (_jsxs("div", __assign({ className: step.size === 4 ? styles.checkboxLbl : styles.overflowLbl, style: {
45
+ maxWidth: calcStepWidth(step.size, form.size) - 45,
46
+ } }, { children: [step.label, step.required ? ' *' : '', colon ? ':' : ''] })));
47
+ };
48
+ return (_jsxs(StepFillerContainer, __assign({ step: step }, { children: [_jsx(MaterialInputContainer, __assign({ step: step, editable: editable, maxHeight: step.size < 4 }, { children: _jsxs("div", __assign({ className: styles.container }, { children: [_jsxs("div", __assign({ className: styles.labelCheckBoxContainer, style: {
49
+ height: step.size < 4 ? 31 : undefined,
50
+ alignItems: step.isList ? 'start' : 'center',
51
+ } }, { children: [step.label && !step.isList && renderLabel(true), _jsx(RoundedCheckBox, __assign({}, field, { inputRef: ref, onChange: onChange, "data-testid": step.id, padding: "0px", size: "1.6rem", error: !!error, cantEdit: !editable || postview, checkedColor: formStyle.primaryColor, uncheckedColor: formStyle.outlineColor, checked: value })), step.label && step.isList && renderLabel()] })), (step.description || !!error) && (_jsx("div", __assign({ className: styles.descriptionPar, style: {
42
52
  color: error
43
53
  ? formStyle.errorColor
44
54
  : formStyle.descriptionTextColor,
@@ -2,10 +2,13 @@
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  }
5
- .checkboxLbl {
5
+ .checkboxLbl,
6
+ .overflowLbl {
6
7
  font-size: 18px;
7
8
  margin-right: 10px;
8
9
  margin-left: 10px;
10
+ }
11
+ .overflowLbl {
9
12
  white-space: nowrap;
10
13
  overflow: hidden;
11
14
  text-overflow: ellipsis;
@@ -15,7 +18,6 @@
15
18
  align-items: center;
16
19
  flex-direction: row;
17
20
  align-items: center;
18
- height: 31px;
19
21
  }
20
22
 
21
23
  .descriptionPar {
@@ -6,6 +6,7 @@ interface MaterialInputProps {
6
6
  editable: boolean;
7
7
  onClick?: () => void;
8
8
  children: React.ReactNode;
9
+ maxHeight?: boolean;
9
10
  }
10
- declare function MaterialInputContainer({ step, editable, children, onClick, }: MaterialInputProps): JSX.Element;
11
+ declare function MaterialInputContainer({ step, editable, children, onClick, maxHeight, }: MaterialInputProps): JSX.Element;
11
12
  export default MaterialInputContainer;
@@ -16,7 +16,7 @@ import { useAppSelector, selectBreakPoint } from '../../../hooks';
16
16
  import { calcStepWidth } from '../../StepFunctions';
17
17
  import styles from './MaterialInputContainer.module.css';
18
18
  function MaterialInputContainer(_a) {
19
- var step = _a.step, editable = _a.editable, children = _a.children, onClick = _a.onClick;
19
+ var step = _a.step, editable = _a.editable, children = _a.children, onClick = _a.onClick, _b = _a.maxHeight, maxHeight = _b === void 0 ? true : _b;
20
20
  var form = useContext(FormContext);
21
21
  var currentBreakPoint = useAppSelector(selectBreakPoint);
22
22
  var postview = useAppSelector(function (state) { return state.global.postview; });
@@ -24,9 +24,12 @@ function MaterialInputContainer(_a) {
24
24
  width: currentBreakPoint <= step.size
25
25
  ? '100%'
26
26
  : calcStepWidth(step.size, form.size),
27
- minHeight: step.description || (!postview && editable && step.required)
28
- ? '55px'
29
- : '43px',
27
+ minHeight: maxHeight
28
+ ? step.description ||
29
+ (!postview && editable && step.required)
30
+ ? '55px'
31
+ : '43px'
32
+ : undefined,
30
33
  }, onClick: onClick, "data-testid": step.id }, { children: children })));
31
34
  }
32
35
  export default MaterialInputContainer;
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.45",
4
+ "version": "2.0.47",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",