@formio/js 5.0.0-dev.5668.b75e179 → 5.0.0-dev.5670.4e330b8

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.
@@ -43,7 +43,7 @@ export default class CheckBoxComponent extends Field {
43
43
  attach(element: any): Promise<void>;
44
44
  input: any;
45
45
  detach(element: any): void;
46
- get emptyValue(): false | null;
46
+ get emptyValue(): false | "";
47
47
  getValueAt(index: any): any;
48
48
  get checked(): boolean;
49
49
  setCheckedState(value: any): any;
@@ -117,7 +117,7 @@ class CheckBoxComponent extends Field_1.default {
117
117
  super.detach();
118
118
  }
119
119
  get emptyValue() {
120
- return this.component.inputType === 'radio' ? null : false;
120
+ return this.component.inputType === 'radio' ? '' : false;
121
121
  }
122
122
  isEmpty(value = this.dataValue) {
123
123
  return super.isEmpty(value) || value === false;
@@ -0,0 +1,32 @@
1
+ declare namespace _default {
2
+ let name: string;
3
+ let path: string;
4
+ let type: string;
5
+ let display: string;
6
+ let components: ({
7
+ label: string;
8
+ inputType: string;
9
+ tableView: boolean;
10
+ defaultValue: boolean;
11
+ key: string;
12
+ type: string;
13
+ name: string;
14
+ value: string;
15
+ input: boolean;
16
+ 'some name': boolean;
17
+ disableOnInvalid?: undefined;
18
+ } | {
19
+ type: string;
20
+ label: string;
21
+ key: string;
22
+ disableOnInvalid: boolean;
23
+ input: boolean;
24
+ tableView: boolean;
25
+ inputType?: undefined;
26
+ defaultValue?: undefined;
27
+ name?: undefined;
28
+ value?: undefined;
29
+ 'some name'?: undefined;
30
+ })[];
31
+ }
32
+ export default _default;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ name: 'ckeckbox',
5
+ path: 'ckeckbox',
6
+ type: 'form',
7
+ display: 'form',
8
+ components: [
9
+ {
10
+ label: 'Checkbox',
11
+ inputType: 'radio',
12
+ tableView: false,
13
+ defaultValue: false,
14
+ key: 'checkbox',
15
+ type: 'checkbox',
16
+ name: 'some name',
17
+ value: 'ok',
18
+ input: true,
19
+ 'some name': false
20
+ },
21
+ {
22
+ type: 'button',
23
+ label: 'Submit',
24
+ key: 'submit',
25
+ disableOnInvalid: true,
26
+ input: true,
27
+ tableView: false
28
+ }
29
+ ],
30
+ };
@@ -3,5 +3,6 @@ import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
4
  import comp4 from './comp4';
5
5
  import comp5 from './comp5';
6
+ import comp6 from './comp6';
6
7
  import customDefaultComponent from './customDefaultComponent';
7
- export { comp1, comp2, comp3, comp4, comp5, customDefaultComponent };
8
+ export { comp1, comp2, comp3, comp4, comp5, comp6, customDefaultComponent };
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.customDefaultComponent = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
6
+ exports.customDefaultComponent = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
7
7
  const comp1_1 = __importDefault(require("./comp1"));
8
8
  exports.comp1 = comp1_1.default;
9
9
  const customDefaultComponent_1 = __importDefault(require("./customDefaultComponent"));
@@ -16,3 +16,5 @@ const comp4_1 = __importDefault(require("./comp4"));
16
16
  exports.comp4 = comp4_1.default;
17
17
  const comp5_1 = __importDefault(require("./comp5"));
18
18
  exports.comp5 = comp5_1.default;
19
+ const comp6_1 = __importDefault(require("./comp6"));
20
+ exports.comp6 = comp6_1.default;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
7
  const Formio_1 = require("../../Formio");
8
8
  const ListComponent_1 = __importDefault(require("../_classes/list/ListComponent"));
9
+ const Input_1 = __importDefault(require("../_classes/input/Input"));
9
10
  const Form_1 = __importDefault(require("../../Form"));
10
11
  const utils_1 = require("../../utils/utils");
11
12
  const ChoicesWrapper_1 = __importDefault(require("../../utils/ChoicesWrapper"));
@@ -833,7 +834,7 @@ class SelectComponent extends ListComponent_1.default {
833
834
  this.choices.containerOuter.element.setAttribute('tabIndex', '-1');
834
835
  this.addEventListener(this.choices.containerOuter.element, 'focus', () => this.focusableElement.focus());
835
836
  }
836
- this.addFocusBlurEvents(this.choices.input.element);
837
+ Input_1.default.prototype.addFocusBlurEvents.call(this, this.focusableElement);
837
838
  if (this.itemsFromUrl && !this.component.noRefreshOnScroll) {
838
839
  this.scrollList = this.choices.choiceList.element;
839
840
  this.addEventListener(this.scrollList, 'scroll', () => this.onScroll());
@@ -43,7 +43,7 @@ export default class CheckBoxComponent extends Field {
43
43
  attach(element: any): Promise<void>;
44
44
  input: any;
45
45
  detach(element: any): void;
46
- get emptyValue(): false | null;
46
+ get emptyValue(): false | "";
47
47
  getValueAt(index: any): any;
48
48
  get checked(): boolean;
49
49
  setCheckedState(value: any): any;
@@ -116,7 +116,7 @@ export default class CheckBoxComponent extends Field {
116
116
  super.detach();
117
117
  }
118
118
  get emptyValue() {
119
- return this.component.inputType === 'radio' ? null : false;
119
+ return this.component.inputType === 'radio' ? '' : false;
120
120
  }
121
121
  isEmpty(value = this.dataValue) {
122
122
  return super.isEmpty(value) || value === false;
@@ -0,0 +1,32 @@
1
+ declare namespace _default {
2
+ let name: string;
3
+ let path: string;
4
+ let type: string;
5
+ let display: string;
6
+ let components: ({
7
+ label: string;
8
+ inputType: string;
9
+ tableView: boolean;
10
+ defaultValue: boolean;
11
+ key: string;
12
+ type: string;
13
+ name: string;
14
+ value: string;
15
+ input: boolean;
16
+ 'some name': boolean;
17
+ disableOnInvalid?: undefined;
18
+ } | {
19
+ type: string;
20
+ label: string;
21
+ key: string;
22
+ disableOnInvalid: boolean;
23
+ input: boolean;
24
+ tableView: boolean;
25
+ inputType?: undefined;
26
+ defaultValue?: undefined;
27
+ name?: undefined;
28
+ value?: undefined;
29
+ 'some name'?: undefined;
30
+ })[];
31
+ }
32
+ export default _default;
@@ -0,0 +1,28 @@
1
+ export default {
2
+ name: 'ckeckbox',
3
+ path: 'ckeckbox',
4
+ type: 'form',
5
+ display: 'form',
6
+ components: [
7
+ {
8
+ label: 'Checkbox',
9
+ inputType: 'radio',
10
+ tableView: false,
11
+ defaultValue: false,
12
+ key: 'checkbox',
13
+ type: 'checkbox',
14
+ name: 'some name',
15
+ value: 'ok',
16
+ input: true,
17
+ 'some name': false
18
+ },
19
+ {
20
+ type: 'button',
21
+ label: 'Submit',
22
+ key: 'submit',
23
+ disableOnInvalid: true,
24
+ input: true,
25
+ tableView: false
26
+ }
27
+ ],
28
+ };
@@ -3,5 +3,6 @@ import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
4
  import comp4 from './comp4';
5
5
  import comp5 from './comp5';
6
+ import comp6 from './comp6';
6
7
  import customDefaultComponent from './customDefaultComponent';
7
- export { comp1, comp2, comp3, comp4, comp5, customDefaultComponent };
8
+ export { comp1, comp2, comp3, comp4, comp5, comp6, customDefaultComponent };
@@ -4,4 +4,5 @@ import comp2 from './comp2';
4
4
  import comp3 from './comp3';
5
5
  import comp4 from './comp4';
6
6
  import comp5 from './comp5';
7
- export { comp1, comp2, comp3, comp4, comp5, customDefaultComponent };
7
+ import comp6 from './comp6';
8
+ export { comp1, comp2, comp3, comp4, comp5, comp6, customDefaultComponent };
@@ -1,6 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import { Formio } from '../../Formio';
3
3
  import ListComponent from '../_classes/list/ListComponent';
4
+ import Input from '../_classes/input/Input';
4
5
  import Form from '../../Form';
5
6
  import { getRandomComponentId, boolValue, isPromise, componentValueTypes, getComponentSavedTypes, isSelectResourceWithObjectValue, removeHTML } from '../../utils/utils';
6
7
  import Choices from '../../utils/ChoicesWrapper';
@@ -862,7 +863,7 @@ export default class SelectComponent extends ListComponent {
862
863
  this.choices.containerOuter.element.setAttribute('tabIndex', '-1');
863
864
  this.addEventListener(this.choices.containerOuter.element, 'focus', () => this.focusableElement.focus());
864
865
  }
865
- this.addFocusBlurEvents(this.choices.input.element);
866
+ Input.prototype.addFocusBlurEvents.call(this, this.focusableElement);
866
867
  if (this.itemsFromUrl && !this.component.noRefreshOnScroll) {
867
868
  this.scrollList = this.choices.choiceList.element;
868
869
  this.addEventListener(this.scrollList, 'scroll', () => this.onScroll());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5668.b75e179",
3
+ "version": "5.0.0-dev.5670.4e330b8",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {