@pinuts/bsr-uikit-relaunch 0.0.19 → 0.0.21

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.
@@ -1,7 +1,7 @@
1
1
  export function filterInitialValuesForForm(components: any, values: any): {};
2
2
  export function buildInitialValues(filterInitialValues: any, initialValues: any, components: any): any;
3
3
  export default FormBuilder;
4
- declare function FormBuilder({ formId, children, filterInitialValues, formClassName, formConfig, initialErrors, initialValues, innerFieldWrapperComponent, beforeFieldWrapperComponent, afterFieldWrapperComponent, onReset, onSubmit, onValidate, validateValues, createFormRules, preChildren, preventEnterSubmit, readOnly, disabled, showNoValidationMessage, flagsToInherit, formikProps, }: {
4
+ declare function FormBuilder({ formId, children, filterInitialValues, formClassName, formConfig, initialErrors, initialValues, innerFieldWrapperComponent, beforeFieldWrapperComponent, afterFieldWrapperComponent, onReset, onSubmit, onKeyDown, onValidate, validateValues, createFormRules, preChildren, preventEnterSubmit, readOnly, disabled, showNoValidationMessage, flagsToInherit, formikProps, }: {
5
5
  formId: any;
6
6
  children: any;
7
7
  filterInitialValues: any;
@@ -14,6 +14,7 @@ declare function FormBuilder({ formId, children, filterInitialValues, formClassN
14
14
  afterFieldWrapperComponent: any;
15
15
  onReset: any;
16
16
  onSubmit: any;
17
+ onKeyDown?: any;
17
18
  onValidate: any;
18
19
  validateValues?: typeof validateValuesDefault;
19
20
  createFormRules?: typeof createFormRulesDefault;
@@ -49,6 +50,7 @@ declare namespace FormBuilder {
49
50
  const afterFieldWrapperComponent: any;
50
51
  const flagsToInherit: any;
51
52
  const formikProps: any;
53
+ const onKeyDown: any;
52
54
  }
53
55
  }
54
56
  import { validateValues as validateValuesDefault } from '../shared/formRules/createFormRules.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"FormBuilder.d.ts","sourceRoot":"","sources":["../../src/formbuilder/FormBuilder.js"],"names":[],"mappings":"AAgCO,6EAgCN;AAsBM,uGASN;;AAED;;;;;;;;;;;;;;;;;;;;;;;QA+KC;;;;;;;;;;;;;;;;;;;;;;;;;;;wDAzQM,yCAAyC;0DAAzC,yCAAyC"}
1
+ {"version":3,"file":"FormBuilder.d.ts","sourceRoot":"","sources":["../../src/formbuilder/FormBuilder.js"],"names":[],"mappings":"AAgCO,6EAgCN;AAsBM,uGASN;;AAED;;;;;;;;;;;;;;;;;;;;;;;;QAgLC;;;;;;;;;;;;;;;;;;;;;;;;;;;;wDA1QM,yCAAyC;0DAAzC,yCAAyC"}
@@ -34,7 +34,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
34
34
  * Stop enter submitting the form.
35
35
  * @param keyEvent Event triggered when the user presses a key.
36
36
  */
37
- function onKeyDown(keyEvent) {
37
+ function preventSubmitOnEnter(keyEvent) {
38
38
  var target = keyEvent.target;
39
39
  if ((keyEvent.charCode || keyEvent.keyCode) === 13 && !(target.tagName === 'TEXTAREA' || target.type === 'submit')) {
40
40
  keyEvent.preventDefault();
@@ -111,6 +111,8 @@ var FormBuilder = function FormBuilder(_ref3) {
111
111
  afterFieldWrapperComponent = _ref3.afterFieldWrapperComponent,
112
112
  onReset = _ref3.onReset,
113
113
  onSubmit = _ref3.onSubmit,
114
+ _ref3$onKeyDown = _ref3.onKeyDown,
115
+ onKeyDown = _ref3$onKeyDown === void 0 ? null : _ref3$onKeyDown,
114
116
  onValidate = _ref3.onValidate,
115
117
  _ref3$validateValues = _ref3.validateValues,
116
118
  validateValues = _ref3$validateValues === void 0 ? _createFormRules.validateValues : _ref3$validateValues,
@@ -214,7 +216,7 @@ var FormBuilder = function FormBuilder(_ref3) {
214
216
  //}}
215
217
  ,
216
218
  className: "".concat(formClassName || '', " formAlign "),
217
- onKeyDown: preventEnterSubmit && onKeyDown
219
+ onKeyDown: preventEnterSubmit && (onKeyDown || preventSubmitOnEnter)
218
220
  }, preChildren, process.env.NODE_ENV === 'development' && console && console.info('form values:', formikContextProps.values), /*#__PURE__*/_react.default.createElement(InnerFieldWrapperComponent, {
219
221
  className: "pt-0"
220
222
  }, /*#__PURE__*/_react.default.createElement(_ComponentPopulator.default, {
@@ -250,7 +252,8 @@ FormBuilder.propTypes = {
250
252
  beforeFieldWrapperComponent: _propTypes.default.func,
251
253
  afterFieldWrapperComponent: _propTypes.default.func,
252
254
  flagsToInherit: _propTypes.default.arrayOf(_propTypes.default.string),
253
- formikProps: _propTypes.default.instanceOf(Object)
255
+ formikProps: _propTypes.default.instanceOf(Object),
256
+ onKeyDown: _propTypes.default.func
254
257
  };
255
258
  var _default = FormBuilder;
256
259
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"populateComponents.d.ts","sourceRoot":"","sources":["../../src/formbuilder/populateComponents.js"],"names":[],"mappings":"AAOO,yEAYN;AAOM,uEAYN;AAwCM,wEAGN;AA4CM,6FAuEN;AAIM,uFA2FN"}
1
+ {"version":3,"file":"populateComponents.d.ts","sourceRoot":"","sources":["../../src/formbuilder/populateComponents.js"],"names":[],"mappings":"AAOO,yEAYN;AAOM,uEAYN;AAwCM,wEAGN;AA4CM,6FAuEN;AAIM,uFA4FN"}
@@ -201,7 +201,7 @@ var usePopulatedComponentsWithValues = function usePopulatedComponentsWithValues
201
201
  var usedTemplates = JSON.parse(JSON.stringify(templates)); //need a deep clone :(
202
202
 
203
203
  usedTemplates.forEach(function (child, index) {
204
- var _child$config2, _child$config3;
204
+ var _child$config2, _child$config3, _child$config4;
205
205
  if (child.config && !componentIsHidden(child.config, values)) {
206
206
  var _child$config$default2;
207
207
  child.config.inputProps = child.config.inputProps || {};
@@ -228,7 +228,7 @@ var usePopulatedComponentsWithValues = function usePopulatedComponentsWithValues
228
228
 
229
229
  // initiale Werte wieder rein schreiben, wenn die Komponente ausgeblendet war und nun eingeblendet wird
230
230
  // ACHTUNG: Unterbrechen mit setFieldTouched(true) während onChange (sonst wird es nur onBlur gesetzt)
231
- if ((_child$config2 = child.config) !== null && _child$config2 !== void 0 && _child$config2.key && ['', undefined].includes(values[child.config.key]) && !touched[child.config.key] && initialValues[child.config.key] !== undefined) {
231
+ if ((_child$config2 = child.config) !== null && _child$config2 !== void 0 && _child$config2.key && !((_child$config3 = child.config) !== null && _child$config3 !== void 0 && _child$config3.noInitialValuesOnReRender) && ['', undefined].includes(values[child.config.key]) && !touched[child.config.key] && initialValues[child.config.key] !== undefined) {
232
232
  values[child.config.key] = initialValues[child.config.key];
233
233
  }
234
234
  if (child.config && componentIsReadOnly(child.config, values)) {
@@ -247,7 +247,7 @@ var usePopulatedComponentsWithValues = function usePopulatedComponentsWithValues
247
247
  renderedComponents.push( /*#__PURE__*/_react.default.createElement(ComponentWrapper, {
248
248
  ItemComponent: ItemComponent,
249
249
  WrapperComponent: WrapperComponent,
250
- key: ((_child$config3 = child.config) === null || _child$config3 === void 0 ? void 0 : _child$config3.key) || index,
250
+ key: ((_child$config4 = child.config) === null || _child$config4 === void 0 ? void 0 : _child$config4.key) || index,
251
251
  components: child.components || null,
252
252
  config: child.config,
253
253
  formId: formId
@@ -4,7 +4,6 @@ import { usePopulatedComponentsWithValues } from './formbuilder/populateComponen
4
4
  import { getComponentRegistry } from './formbuilder/ComponentRegistry';
5
5
  import { registerComponent } from './formbuilder/ComponentRegistry';
6
6
  import { getComponentFromRegistry } from './formbuilder/ComponentRegistry';
7
- import FormPresentation from './presentation/FormPresentation';
8
7
  import ComponentPopulator from './formbuilder/ComponentPopulator';
9
8
  import * as hooks from './hooks';
10
9
  import * as utils from './utils';
@@ -14,5 +13,5 @@ import { jsonLogic } from './shared/formRules/createFormRules.mjs';
14
13
  import { validateValues } from './shared/formRules/createFormRules.mjs';
15
14
  import { createFormRules } from './shared/formRules/createFormRules.mjs';
16
15
  import { validateComponents } from './shared/formRules/createFormRules.mjs';
17
- export { FormBuilder, populateComponents, usePopulatedComponentsWithValues, getComponentRegistry, registerComponent, getComponentFromRegistry, FormPresentation, ComponentPopulator, hooks, utils, formik, formHooks, jsonLogic, validateValues, createFormRules, validateComponents };
16
+ export { FormBuilder, populateComponents, usePopulatedComponentsWithValues, getComponentRegistry, registerComponent, getComponentFromRegistry, ComponentPopulator, hooks, utils, formik, formHooks, jsonLogic, validateValues, createFormRules, validateComponents };
18
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"wBACwB,2BAA2B;mCACkB,kCAAkC;iDAAlC,kCAAkC;qCAOhG,iCAAiC;kCAAjC,iCAAiC;yCAAjC,iCAAiC;6BALX,iCAAiC;+BAD/B,kCAAkC;uBAQ1C,SAAS;uBACT,SAAS;wBAZR,QAAQ;2BAaL,aAAa;0BACuC,wCAAwC;+BAAxC,wCAAwC;gCAAxC,wCAAwC;mCAAxC,wCAAwC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"wBACwB,2BAA2B;mCACkB,kCAAkC;iDAAlC,kCAAkC;qCAOhG,iCAAiC;kCAAjC,iCAAiC;yCAAjC,iCAAiC;+BANT,kCAAkC;uBAQ1C,SAAS;uBACT,SAAS;wBAZR,QAAQ;2BAaL,aAAa;0BACuC,wCAAwC;+BAAxC,wCAAwC;gCAAxC,wCAAwC;mCAAxC,wCAAwC"}