@formio/js 5.0.0-dev.5661.22d0f16 → 5.0.0-dev.5668.b75e179

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.
@@ -35,7 +35,7 @@ export default class DayComponent extends Field {
35
35
  id: string;
36
36
  class: string;
37
37
  type: string;
38
- placeholder: any;
38
+ placeholder: string;
39
39
  step: number;
40
40
  min: any;
41
41
  max: any;
@@ -124,7 +124,7 @@ class DayComponent extends Field_1.default {
124
124
  id: `${this.component.key}-${name}`,
125
125
  class: `form-control ${this.transform('class', `formio-day-component-${name}`)}`,
126
126
  type: this.component.fields[name].type === 'select' ? 'select' : 'number',
127
- placeholder: this.component.fields[name].placeholder,
127
+ placeholder: this.t(this.component.fields[name].placeholder),
128
128
  step: 1,
129
129
  min,
130
130
  max,
@@ -0,0 +1,109 @@
1
+ declare namespace _default {
2
+ let components: ({
3
+ type: string;
4
+ key: string;
5
+ label: string;
6
+ placeholder: string;
7
+ input: boolean;
8
+ applyMaskOn?: undefined;
9
+ tableView?: undefined;
10
+ hideInputLabels?: undefined;
11
+ inputsLabelPosition?: undefined;
12
+ useLocaleSettings?: undefined;
13
+ fields?: undefined;
14
+ defaultValue?: undefined;
15
+ values?: undefined;
16
+ questions?: undefined;
17
+ action?: undefined;
18
+ theme?: undefined;
19
+ } | {
20
+ label: string;
21
+ placeholder: string;
22
+ applyMaskOn: string;
23
+ tableView: boolean;
24
+ key: string;
25
+ type: string;
26
+ input: boolean;
27
+ hideInputLabels?: undefined;
28
+ inputsLabelPosition?: undefined;
29
+ useLocaleSettings?: undefined;
30
+ fields?: undefined;
31
+ defaultValue?: undefined;
32
+ values?: undefined;
33
+ questions?: undefined;
34
+ action?: undefined;
35
+ theme?: undefined;
36
+ } | {
37
+ label: string;
38
+ hideInputLabels: boolean;
39
+ inputsLabelPosition: string;
40
+ useLocaleSettings: boolean;
41
+ tableView: boolean;
42
+ fields: {
43
+ day: {
44
+ placeholder: string;
45
+ hide: boolean;
46
+ };
47
+ month: {
48
+ type: string;
49
+ placeholder: string;
50
+ hide: boolean;
51
+ };
52
+ year: {
53
+ placeholder: string;
54
+ hide: boolean;
55
+ };
56
+ };
57
+ key: string;
58
+ type: string;
59
+ input: boolean;
60
+ defaultValue: string;
61
+ placeholder?: undefined;
62
+ applyMaskOn?: undefined;
63
+ values?: undefined;
64
+ questions?: undefined;
65
+ action?: undefined;
66
+ theme?: undefined;
67
+ } | {
68
+ type: string;
69
+ key: string;
70
+ label: string;
71
+ values: {
72
+ label: string;
73
+ value: string;
74
+ }[];
75
+ questions: {
76
+ label: string;
77
+ value: string;
78
+ }[];
79
+ placeholder?: undefined;
80
+ input?: undefined;
81
+ applyMaskOn?: undefined;
82
+ tableView?: undefined;
83
+ hideInputLabels?: undefined;
84
+ inputsLabelPosition?: undefined;
85
+ useLocaleSettings?: undefined;
86
+ fields?: undefined;
87
+ defaultValue?: undefined;
88
+ action?: undefined;
89
+ theme?: undefined;
90
+ } | {
91
+ type: string;
92
+ action: string;
93
+ label: string;
94
+ theme: string;
95
+ key?: undefined;
96
+ placeholder?: undefined;
97
+ input?: undefined;
98
+ applyMaskOn?: undefined;
99
+ tableView?: undefined;
100
+ hideInputLabels?: undefined;
101
+ inputsLabelPosition?: undefined;
102
+ useLocaleSettings?: undefined;
103
+ fields?: undefined;
104
+ defaultValue?: undefined;
105
+ values?: undefined;
106
+ questions?: undefined;
107
+ })[];
108
+ }
109
+ export default _default;
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ components: [
5
+ {
6
+ type: 'textfield',
7
+ key: 'firstName',
8
+ label: 'First Name',
9
+ placeholder: 'Enter your first name',
10
+ input: true
11
+ }, {
12
+ "label": "Day",
13
+ "placeholder": "Day",
14
+ "applyMaskOn": "change",
15
+ "tableView": true,
16
+ "key": "day2",
17
+ "type": "textfield",
18
+ "input": true
19
+ }, {
20
+ "label": "Month",
21
+ "placeholder": "Month",
22
+ "applyMaskOn": "change",
23
+ "tableView": true,
24
+ "key": "month2",
25
+ "type": "textfield",
26
+ "input": true
27
+ }, {
28
+ "label": "Year",
29
+ "placeholder": "Year",
30
+ "applyMaskOn": "change",
31
+ "tableView": true,
32
+ "key": "year2",
33
+ "type": "textfield",
34
+ "input": true
35
+ },
36
+ {
37
+ "label": "Day",
38
+ "hideInputLabels": false,
39
+ "inputsLabelPosition": "top",
40
+ "useLocaleSettings": false,
41
+ "tableView": false,
42
+ "fields": {
43
+ "day": {
44
+ "placeholder": "Day",
45
+ "hide": false
46
+ },
47
+ "month": {
48
+ "type": "number",
49
+ "placeholder": "Month",
50
+ "hide": false
51
+ },
52
+ "year": {
53
+ "placeholder": "Year",
54
+ "hide": false
55
+ }
56
+ },
57
+ "key": "day",
58
+ "type": "day",
59
+ "input": true,
60
+ "defaultValue": "00/00/0000"
61
+ },
62
+ {
63
+ type: 'textfield',
64
+ key: 'lastName',
65
+ label: 'Last Name',
66
+ placeholder: 'Enter your last name',
67
+ input: true
68
+ },
69
+ {
70
+ type: 'survey',
71
+ key: 'questions',
72
+ label: 'Survey',
73
+ values: [
74
+ {
75
+ label: 'Great',
76
+ value: 'great'
77
+ },
78
+ {
79
+ label: 'Good',
80
+ value: 'good'
81
+ },
82
+ {
83
+ label: 'Poor',
84
+ value: 'poor'
85
+ }
86
+ ],
87
+ questions: [
88
+ {
89
+ label: 'How would you rate the Form.io platform?',
90
+ value: 'howWouldYouRateTheFormIoPlatform'
91
+ },
92
+ {
93
+ label: 'How was Customer Support?',
94
+ value: 'howWasCustomerSupport'
95
+ },
96
+ {
97
+ label: 'Overall Experience?',
98
+ value: 'overallExperience'
99
+ }
100
+ ]
101
+ },
102
+ {
103
+ type: 'button',
104
+ action: 'submit',
105
+ label: 'Submit',
106
+ theme: 'primary'
107
+ }
108
+ ]
109
+ };
@@ -4,4 +4,5 @@ import comp3 from './comp3';
4
4
  import comp4 from './comp4';
5
5
  import comp5 from './comp5';
6
6
  import comp6 from './comp6';
7
- export { comp1, comp2, comp3, comp4, comp5, comp6 };
7
+ import comp7 from './comp7';
8
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7 };
@@ -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.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
6
+ exports.comp7 = 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 comp2_1 = __importDefault(require("./comp2"));
@@ -16,3 +16,5 @@ const comp5_1 = __importDefault(require("./comp5"));
16
16
  exports.comp5 = comp5_1.default;
17
17
  const comp6_1 = __importDefault(require("./comp6"));
18
18
  exports.comp6 = comp6_1.default;
19
+ const comp7_1 = __importDefault(require("./comp7"));
20
+ exports.comp7 = comp7_1.default;
@@ -6,7 +6,6 @@ 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"));
10
9
  const Form_1 = __importDefault(require("../../Form"));
11
10
  const utils_1 = require("../../utils/utils");
12
11
  const ChoicesWrapper_1 = __importDefault(require("../../utils/ChoicesWrapper"));
@@ -834,7 +833,7 @@ class SelectComponent extends ListComponent_1.default {
834
833
  this.choices.containerOuter.element.setAttribute('tabIndex', '-1');
835
834
  this.addEventListener(this.choices.containerOuter.element, 'focus', () => this.focusableElement.focus());
836
835
  }
837
- Input_1.default.prototype.addFocusBlurEvents.call(this, this.focusableElement);
836
+ this.addFocusBlurEvents(this.choices.input.element);
838
837
  if (this.itemsFromUrl && !this.component.noRefreshOnScroll) {
839
838
  this.scrollList = this.choices.choiceList.element;
840
839
  this.addEventListener(this.scrollList, 'scroll', () => this.onScroll());
@@ -35,7 +35,7 @@ export default class DayComponent extends Field {
35
35
  id: string;
36
36
  class: string;
37
37
  type: string;
38
- placeholder: any;
38
+ placeholder: string;
39
39
  step: number;
40
40
  min: any;
41
41
  max: any;
@@ -122,7 +122,7 @@ export default class DayComponent extends Field {
122
122
  id: `${this.component.key}-${name}`,
123
123
  class: `form-control ${this.transform('class', `formio-day-component-${name}`)}`,
124
124
  type: this.component.fields[name].type === 'select' ? 'select' : 'number',
125
- placeholder: this.component.fields[name].placeholder,
125
+ placeholder: this.t(this.component.fields[name].placeholder),
126
126
  step: 1,
127
127
  min,
128
128
  max,
@@ -0,0 +1,109 @@
1
+ declare namespace _default {
2
+ let components: ({
3
+ type: string;
4
+ key: string;
5
+ label: string;
6
+ placeholder: string;
7
+ input: boolean;
8
+ applyMaskOn?: undefined;
9
+ tableView?: undefined;
10
+ hideInputLabels?: undefined;
11
+ inputsLabelPosition?: undefined;
12
+ useLocaleSettings?: undefined;
13
+ fields?: undefined;
14
+ defaultValue?: undefined;
15
+ values?: undefined;
16
+ questions?: undefined;
17
+ action?: undefined;
18
+ theme?: undefined;
19
+ } | {
20
+ label: string;
21
+ placeholder: string;
22
+ applyMaskOn: string;
23
+ tableView: boolean;
24
+ key: string;
25
+ type: string;
26
+ input: boolean;
27
+ hideInputLabels?: undefined;
28
+ inputsLabelPosition?: undefined;
29
+ useLocaleSettings?: undefined;
30
+ fields?: undefined;
31
+ defaultValue?: undefined;
32
+ values?: undefined;
33
+ questions?: undefined;
34
+ action?: undefined;
35
+ theme?: undefined;
36
+ } | {
37
+ label: string;
38
+ hideInputLabels: boolean;
39
+ inputsLabelPosition: string;
40
+ useLocaleSettings: boolean;
41
+ tableView: boolean;
42
+ fields: {
43
+ day: {
44
+ placeholder: string;
45
+ hide: boolean;
46
+ };
47
+ month: {
48
+ type: string;
49
+ placeholder: string;
50
+ hide: boolean;
51
+ };
52
+ year: {
53
+ placeholder: string;
54
+ hide: boolean;
55
+ };
56
+ };
57
+ key: string;
58
+ type: string;
59
+ input: boolean;
60
+ defaultValue: string;
61
+ placeholder?: undefined;
62
+ applyMaskOn?: undefined;
63
+ values?: undefined;
64
+ questions?: undefined;
65
+ action?: undefined;
66
+ theme?: undefined;
67
+ } | {
68
+ type: string;
69
+ key: string;
70
+ label: string;
71
+ values: {
72
+ label: string;
73
+ value: string;
74
+ }[];
75
+ questions: {
76
+ label: string;
77
+ value: string;
78
+ }[];
79
+ placeholder?: undefined;
80
+ input?: undefined;
81
+ applyMaskOn?: undefined;
82
+ tableView?: undefined;
83
+ hideInputLabels?: undefined;
84
+ inputsLabelPosition?: undefined;
85
+ useLocaleSettings?: undefined;
86
+ fields?: undefined;
87
+ defaultValue?: undefined;
88
+ action?: undefined;
89
+ theme?: undefined;
90
+ } | {
91
+ type: string;
92
+ action: string;
93
+ label: string;
94
+ theme: string;
95
+ key?: undefined;
96
+ placeholder?: undefined;
97
+ input?: undefined;
98
+ applyMaskOn?: undefined;
99
+ tableView?: undefined;
100
+ hideInputLabels?: undefined;
101
+ inputsLabelPosition?: undefined;
102
+ useLocaleSettings?: undefined;
103
+ fields?: undefined;
104
+ defaultValue?: undefined;
105
+ values?: undefined;
106
+ questions?: undefined;
107
+ })[];
108
+ }
109
+ export default _default;
@@ -0,0 +1,107 @@
1
+ export default {
2
+ components: [
3
+ {
4
+ type: 'textfield',
5
+ key: 'firstName',
6
+ label: 'First Name',
7
+ placeholder: 'Enter your first name',
8
+ input: true
9
+ }, {
10
+ "label": "Day",
11
+ "placeholder": "Day",
12
+ "applyMaskOn": "change",
13
+ "tableView": true,
14
+ "key": "day2",
15
+ "type": "textfield",
16
+ "input": true
17
+ }, {
18
+ "label": "Month",
19
+ "placeholder": "Month",
20
+ "applyMaskOn": "change",
21
+ "tableView": true,
22
+ "key": "month2",
23
+ "type": "textfield",
24
+ "input": true
25
+ }, {
26
+ "label": "Year",
27
+ "placeholder": "Year",
28
+ "applyMaskOn": "change",
29
+ "tableView": true,
30
+ "key": "year2",
31
+ "type": "textfield",
32
+ "input": true
33
+ },
34
+ {
35
+ "label": "Day",
36
+ "hideInputLabels": false,
37
+ "inputsLabelPosition": "top",
38
+ "useLocaleSettings": false,
39
+ "tableView": false,
40
+ "fields": {
41
+ "day": {
42
+ "placeholder": "Day",
43
+ "hide": false
44
+ },
45
+ "month": {
46
+ "type": "number",
47
+ "placeholder": "Month",
48
+ "hide": false
49
+ },
50
+ "year": {
51
+ "placeholder": "Year",
52
+ "hide": false
53
+ }
54
+ },
55
+ "key": "day",
56
+ "type": "day",
57
+ "input": true,
58
+ "defaultValue": "00/00/0000"
59
+ },
60
+ {
61
+ type: 'textfield',
62
+ key: 'lastName',
63
+ label: 'Last Name',
64
+ placeholder: 'Enter your last name',
65
+ input: true
66
+ },
67
+ {
68
+ type: 'survey',
69
+ key: 'questions',
70
+ label: 'Survey',
71
+ values: [
72
+ {
73
+ label: 'Great',
74
+ value: 'great'
75
+ },
76
+ {
77
+ label: 'Good',
78
+ value: 'good'
79
+ },
80
+ {
81
+ label: 'Poor',
82
+ value: 'poor'
83
+ }
84
+ ],
85
+ questions: [
86
+ {
87
+ label: 'How would you rate the Form.io platform?',
88
+ value: 'howWouldYouRateTheFormIoPlatform'
89
+ },
90
+ {
91
+ label: 'How was Customer Support?',
92
+ value: 'howWasCustomerSupport'
93
+ },
94
+ {
95
+ label: 'Overall Experience?',
96
+ value: 'overallExperience'
97
+ }
98
+ ]
99
+ },
100
+ {
101
+ type: 'button',
102
+ action: 'submit',
103
+ label: 'Submit',
104
+ theme: 'primary'
105
+ }
106
+ ]
107
+ };
@@ -4,4 +4,5 @@ import comp3 from './comp3';
4
4
  import comp4 from './comp4';
5
5
  import comp5 from './comp5';
6
6
  import comp6 from './comp6';
7
- export { comp1, comp2, comp3, comp4, comp5, comp6 };
7
+ import comp7 from './comp7';
8
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7 };
@@ -4,4 +4,5 @@ import comp3 from './comp3';
4
4
  import comp4 from './comp4';
5
5
  import comp5 from './comp5';
6
6
  import comp6 from './comp6';
7
- export { comp1, comp2, comp3, comp4, comp5, comp6 };
7
+ import comp7 from './comp7';
8
+ export { comp1, comp2, comp3, comp4, comp5, comp6, comp7 };
@@ -1,7 +1,6 @@
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';
5
4
  import Form from '../../Form';
6
5
  import { getRandomComponentId, boolValue, isPromise, componentValueTypes, getComponentSavedTypes, isSelectResourceWithObjectValue, removeHTML } from '../../utils/utils';
7
6
  import Choices from '../../utils/ChoicesWrapper';
@@ -863,7 +862,7 @@ export default class SelectComponent extends ListComponent {
863
862
  this.choices.containerOuter.element.setAttribute('tabIndex', '-1');
864
863
  this.addEventListener(this.choices.containerOuter.element, 'focus', () => this.focusableElement.focus());
865
864
  }
866
- Input.prototype.addFocusBlurEvents.call(this, this.focusableElement);
865
+ this.addFocusBlurEvents(this.choices.input.element);
867
866
  if (this.itemsFromUrl && !this.component.noRefreshOnScroll) {
868
867
  this.scrollList = this.choices.choiceList.element;
869
868
  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.5661.22d0f16",
3
+ "version": "5.0.0-dev.5668.b75e179",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {