@experium/findy-form 1.3.25 → 1.3.27
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.
|
@@ -7,7 +7,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports["default"] = exports.
|
|
10
|
+
exports["default"] = exports.getHtml = void 0;
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
@@ -304,34 +304,6 @@ var HtmlOpdForm = /*#__PURE__*/function (_Component) {
|
|
|
304
304
|
return HtmlOpdForm;
|
|
305
305
|
}(_react.Component);
|
|
306
306
|
|
|
307
|
-
var HtmlOpdFormClear = /*#__PURE__*/function (_Component2) {
|
|
308
|
-
(0, _inherits2["default"])(HtmlOpdFormClear, _Component2);
|
|
309
|
-
|
|
310
|
-
var _super2 = _createSuper(HtmlOpdFormClear);
|
|
311
|
-
|
|
312
|
-
function HtmlOpdFormClear() {
|
|
313
|
-
(0, _classCallCheck2["default"])(this, HtmlOpdFormClear);
|
|
314
|
-
return _super2.apply(this, arguments);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
(0, _createClass2["default"])(HtmlOpdFormClear, [{
|
|
318
|
-
key: "componentDidUpdate",
|
|
319
|
-
value: function componentDidUpdate(prevProps) {
|
|
320
|
-
if (prevProps.value && !prevProps.open && !(0, _ramda.equals)(prevProps.values, this.props.values)) {
|
|
321
|
-
this.props.onSubmitHtml();
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}, {
|
|
325
|
-
key: "render",
|
|
326
|
-
value: function render() {
|
|
327
|
-
return null;
|
|
328
|
-
}
|
|
329
|
-
}]);
|
|
330
|
-
return HtmlOpdFormClear;
|
|
331
|
-
}(_react.Component);
|
|
332
|
-
|
|
333
|
-
exports.HtmlOpdFormClear = HtmlOpdFormClear;
|
|
334
|
-
|
|
335
307
|
var _default = (0, _reactI18next.withTranslation)()(HtmlOpdForm);
|
|
336
308
|
|
|
337
309
|
exports["default"] = _default;
|
|
@@ -37,7 +37,7 @@ var _ramda = require("ramda");
|
|
|
37
37
|
|
|
38
38
|
var _Checkbox = require("./Checkbox");
|
|
39
39
|
|
|
40
|
-
var _HtmlOpdForm =
|
|
40
|
+
var _HtmlOpdForm = _interopRequireDefault(require("./HtmlOpdForm"));
|
|
41
41
|
|
|
42
42
|
var _FormContext = require("../../context/FormContext");
|
|
43
43
|
|
|
@@ -99,7 +99,7 @@ var getConstructorOpd = function getConstructorOpd(opdSettings, pdaLanguage, lan
|
|
|
99
99
|
return "".concat(res, "<div>\n <input type=\"checkbox\" id=\"", "checkbox-".concat(cur.id), "\" ").concat(cur.required ? 'required="required"' : '', " ").concat(cur["default"] ? 'checked' : '', " />\n <label for=\"", "checkbox-".concat(cur.id), "\">").concat((0, _ramda.path)(['translations', pdaLanguage], cur) || (0, _ramda.path)(['translations', language], cur) || cur.label || '', "</label>\n </div>");
|
|
100
100
|
|
|
101
101
|
case 'opdCheckbox':
|
|
102
|
-
return "".concat(res, "<div>\n <input type=\"checkbox\" id=\"").concat(cur.opdType, "\" name=\"").concat(cur.opdType, "\" data-separate-field=\"").concat(cur.opdType, "\" ").concat((0, _ramda.path)([cur.opdType, 'required'], opdSettings) ? 'required="required"' : '', " />\n <label for=\"").concat(cur.opdType, "\">").concat((0, _ramda.pathOr)('', ['translations', pdaLanguage], cur) || (0, _ramda.pathOr)('', ['translations', language], cur) || (0, _ramda.pathOr)('', [cur.opdType, 'translations', language], opdSettings) || (0, _ramda.pathOr)('', [cur.opdType, 'label'], opdSettings), "</label>\n </div>");
|
|
102
|
+
return "".concat(res, "<div>\n <input type=\"checkbox\" id=\"").concat(cur.opdType, "\" name=\"").concat(cur.opdType, "\" data-separate-field=\"").concat(cur.opdType, "\" ").concat((0, _ramda.path)([cur.opdType, 'required'], opdSettings) ? 'required="required"' : '', " ").concat(cur["default"] ? 'checked' : '', " />\n <label for=\"").concat(cur.opdType, "\">").concat((0, _ramda.pathOr)('', ['translations', pdaLanguage], cur) || (0, _ramda.pathOr)('', ['translations', language], cur) || (0, _ramda.pathOr)('', [cur.opdType, 'translations', language], opdSettings) || (0, _ramda.pathOr)('', [cur.opdType, 'label'], opdSettings), "</label>\n </div>");
|
|
103
103
|
|
|
104
104
|
default:
|
|
105
105
|
return res;
|
|
@@ -283,16 +283,7 @@ var PersonalDataAgreementComponent = /*#__PURE__*/function (_Component) {
|
|
|
283
283
|
label: _this2.getLabel()
|
|
284
284
|
}],
|
|
285
285
|
htmlAttrs: (0, _attrs.getAttrs)('opdCheckbox', htmlAttrs)
|
|
286
|
-
})), isHtmlOpd && /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(
|
|
287
|
-
subscription: ['values']
|
|
288
|
-
}, function (formProps) {
|
|
289
|
-
return /*#__PURE__*/_react["default"].createElement(_HtmlOpdForm.HtmlOpdFormClear, {
|
|
290
|
-
open: _this2.state.openedHtml,
|
|
291
|
-
value: _this2.props.input.value,
|
|
292
|
-
values: _this2.getOpdValues(formProps),
|
|
293
|
-
onSubmitHtml: _this2.onSubmitHtml
|
|
294
|
-
});
|
|
295
|
-
}), /*#__PURE__*/_react["default"].createElement(_reactResponsiveModal["default"], {
|
|
286
|
+
})), isHtmlOpd && /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_reactResponsiveModal["default"], {
|
|
296
287
|
open: _this2.state.openedHtml,
|
|
297
288
|
onClose: _this2.closeHtml,
|
|
298
289
|
classNames: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component, Fragment } from 'react';
|
|
2
2
|
import { withTranslation } from 'react-i18next';
|
|
3
|
-
import { all,
|
|
3
|
+
import { all, join, find, forEach, map, includes, is, path, propEq, trim } from 'ramda';
|
|
4
4
|
import cx from 'classnames';
|
|
5
5
|
|
|
6
6
|
import styles from '../../styles/index.module.css';
|
|
@@ -287,16 +287,4 @@ class HtmlOpdForm extends Component {
|
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
export class HtmlOpdFormClear extends Component {
|
|
291
|
-
componentDidUpdate(prevProps) {
|
|
292
|
-
if (prevProps.value && !prevProps.open && !equals(prevProps.values, this.props.values)) {
|
|
293
|
-
this.props.onSubmitHtml();
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
render() {
|
|
298
|
-
return null;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
290
|
export default withTranslation()(HtmlOpdForm);
|
|
@@ -6,7 +6,7 @@ import { filter, find, map, path, pathOr, prop, pick } from 'ramda';
|
|
|
6
6
|
|
|
7
7
|
import { Checkbox } from './Checkbox';
|
|
8
8
|
import styles from '../../styles/index.module.css';
|
|
9
|
-
import HtmlOpdForm
|
|
9
|
+
import HtmlOpdForm from './HtmlOpdForm';
|
|
10
10
|
import { FormContext } from '../../context/FormContext';
|
|
11
11
|
import { getAttrs } from '../../utils/attrs';
|
|
12
12
|
|
|
@@ -26,7 +26,7 @@ const getConstructorOpd = (opdSettings, pdaLanguage, language) => {
|
|
|
26
26
|
</div>`;
|
|
27
27
|
case 'opdCheckbox':
|
|
28
28
|
return `${res}<div>
|
|
29
|
-
<input type="checkbox" id="${cur.opdType}" name="${cur.opdType}" data-separate-field="${cur.opdType}" ${path([cur.opdType, 'required'], opdSettings) ? 'required="required"' : ''} />
|
|
29
|
+
<input type="checkbox" id="${cur.opdType}" name="${cur.opdType}" data-separate-field="${cur.opdType}" ${path([cur.opdType, 'required'], opdSettings) ? 'required="required"' : ''} ${cur.default ? 'checked' : ''} />
|
|
30
30
|
<label for="${cur.opdType}">${pathOr('', ['translations', pdaLanguage], cur) || pathOr('', ['translations', language], cur) || pathOr('', [cur.opdType, 'translations', language], opdSettings) || pathOr('', [cur.opdType, 'label'], opdSettings)}</label>
|
|
31
31
|
</div>`;
|
|
32
32
|
default:
|
|
@@ -203,16 +203,6 @@ class PersonalDataAgreementComponent extends Component {
|
|
|
203
203
|
/>
|
|
204
204
|
{ isHtmlOpd &&
|
|
205
205
|
<Fragment>
|
|
206
|
-
<FormSpy subscription={['values']}>
|
|
207
|
-
{ formProps => (
|
|
208
|
-
<HtmlOpdFormClear
|
|
209
|
-
open={this.state.openedHtml}
|
|
210
|
-
value={this.props.input.value}
|
|
211
|
-
values={this.getOpdValues(formProps)}
|
|
212
|
-
onSubmitHtml={this.onSubmitHtml}
|
|
213
|
-
/>
|
|
214
|
-
)}
|
|
215
|
-
</FormSpy>
|
|
216
206
|
<Modal
|
|
217
207
|
open={this.state.openedHtml}
|
|
218
208
|
onClose={this.closeHtml}
|