@luomus/laji-form 15.1.25 → 15.1.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.
package/dist/styles.css CHANGED
@@ -3789,8 +3789,8 @@ body .laji-form {
3789
3789
  max-height: 400px;
3790
3790
  }
3791
3791
  .laji-form-dropdown-item {
3792
- height: 30px;
3793
- line-height: 30px;
3792
+ height: 26px;
3793
+ line-height: 26px;
3794
3794
  padding: 0px;
3795
3795
  padding-left: 8px;
3796
3796
  border-top: none;
@@ -748,7 +748,7 @@ class Autosuggest extends React.Component {
748
748
  render() {
749
749
  const { props } = this;
750
750
  let { suggestions, inputValue = "" } = this.state;
751
- const inputProps = Object.assign(Object.assign({ id: this.props.id, value: inputValue, readonly: props.readonly, disabled: props.disabled, placeholder: props.placeholder }, (this.props.inputProps || {})), { onChange: this.onInputChange, onBlur: this.onBlur, onFocus: this.onFocus });
751
+ const inputProps = Object.assign(Object.assign({ id: this.props.id, value: inputValue, readonly: props.readonly, disabled: props.disabled, placeholder: props.placeholder }, (this.props.inputProps || {})), { onChange: this.onInputChange, onBlur: this.onBlur, onFocus: this.onFocus, autoComplete: "off" });
752
752
  let cssClasses = {
753
753
  suggestionsContainer: "rw-popup-container rw-popup-transition",
754
754
  suggestionsContainerOpen: "rw-popup",
@@ -27,9 +27,9 @@ export default class CheckboxWidget extends React.Component<any, any, any> {
27
27
  getOptions: (props: any) => any;
28
28
  getToggleMode: (props: any) => boolean;
29
29
  onGroupKeyDown: any;
30
- onTrueKeyDown: any;
31
- onFalseKeyDown: any;
32
- onUndefinedKeyDown: any;
30
+ onTrueKeyDown: (e: any) => void;
31
+ onFalseKeyDown: (e: any) => void;
32
+ onUndefinedKeyDown: (e: any) => void;
33
33
  toggle: (e: any) => void;
34
34
  formatValue(value: any, options: any, props: any): any;
35
35
  }
@@ -46,21 +46,36 @@ class CheckboxWidget extends React.Component {
46
46
  this.onGroupKeyDown = this.props.formContext.utils.keyboardClick((e) => {
47
47
  this.getToggleMode(this.props) && this.toggle(e);
48
48
  }, [" "]);
49
- this.onTrueKeyDown = this.props.formContext.utils.keyboardClick(() => {
50
- if (this.props.disabled || this.props.readonly) {
51
- return;
49
+ // onTrueKeyDown = this.props.formContext.utils.keyboardClick(() => {
50
+ // if (this.props.disabled || this.props.readonly) {
51
+ // return;
52
+ // }
53
+ // this.onChange(true);
54
+ // }, [" "]);
55
+ this.onTrueKeyDown = (e) => {
56
+ const { key } = e;
57
+ if (key === " ") {
58
+ this.onChange(true);
59
+ e.preventDefault();
60
+ e.stopPropagation();
52
61
  }
53
- this.onChange(true);
54
- }, [" "]);
55
- this.onFalseKeyDown = this.props.formContext.utils.keyboardClick(() => {
56
- if (this.props.disabled || this.props.readonly) {
57
- return;
62
+ };
63
+ this.onFalseKeyDown = (e) => {
64
+ const { key } = e;
65
+ if (key === " ") {
66
+ this.onChange(false);
67
+ e.preventDefault();
68
+ e.stopPropagation();
58
69
  }
59
- this.onChange(false);
60
- }, [" "]);
61
- this.onUndefinedKeyDown = this.props.formContext.utils.keyboardClick(() => {
62
- this.onChange(undefined);
63
- });
70
+ };
71
+ this.onUndefinedKeyDown = (e) => {
72
+ const { key } = e;
73
+ if (key === " ") {
74
+ this.onChange(undefined);
75
+ e.preventDefault();
76
+ e.stopPropagation();
77
+ }
78
+ };
64
79
  this.toggle = (e) => {
65
80
  if (this.props.disabled || this.props.readonly) {
66
81
  return;
@@ -108,7 +123,7 @@ class CheckboxWidget extends React.Component {
108
123
  React.createElement(ToggleButton, Object.assign({ id: `${id}-true`, ref: this.trueRef, value: true, onClick: toggleMode ? this.toggle : undefined, className: utils_1.classNames(toggleMode && _value === false && "laji-form-hide-btn-label", _value === true && tabTargetClass), onKeyDown: this.onTrueKeyDown }, commonProps), trueLabel),
109
124
  React.createElement(ToggleButton, Object.assign({ id: `${id}-false`, ref: this.falseRef, value: false, onClick: toggleMode ? this.toggle : undefined, className: utils_1.classNames(toggleMode && _value === true && "laji-form-hide-btn-label", _value === false && tabTargetClass), onKeyDown: this.onFalseKeyDown }, commonProps), falseLabel),
110
125
  (displayUndefined ?
111
- React.createElement(ToggleButton, Object.assign({ id: `${id}-undefined`, ref: this.undefinedRef, value: "undefined", className: utils_1.classNames(_value === undefined && tabTargetClass) }, commonProps, { onKeyDown: this.onUndefinedKeyDown }), unknownLabel) : null))));
126
+ React.createElement(ToggleButton, Object.assign({ id: `${id}-undefined`, ref: this.undefinedRef, value: "undefined", className: utils_1.classNames(value === undefined && tabTargetClass) }, commonProps, { onKeyDown: this.onUndefinedKeyDown }), unknownLabel) : null))));
112
127
  const { Label } = this.props.formContext;
113
128
  return !hasLabel ? checkbox : (React.createElement(Label, { label: label, required: required, uiSchema: options, contextId: this.props.formContext.contextId }, checkbox));
114
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luomus/laji-form",
3
- "version": "15.1.25",
3
+ "version": "15.1.27",
4
4
  "description": "React module capable of building dynamic forms from Laji form json schemas",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "repository": "git+https://github.com/luomus/laji-form.git",
39
39
  "license": "MIT",
40
40
  "dependencies": {
41
- "@luomus/laji-map": "^5.0.2",
41
+ "@luomus/laji-map": "^5.1.2",
42
42
  "@luomus/laji-validate": "^0.0.121",
43
43
  "@rjsf/core": "~5.1.0",
44
44
  "@rjsf/utils": "~5.1.0",