@formio/js 5.0.0-dev.5654.e25521b → 5.0.0-dev.5655.a31d680

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.
@@ -151,13 +151,15 @@ class Input extends Multivalue_1.default {
151
151
  else {
152
152
  this.addClass(element, 'text-danger');
153
153
  }
154
- this.setContent(element, this.t(`{{ remaining }} ${type} remaining.`, {
155
- remaining: remaining
154
+ this.setContent(element, this.t(`typeRemaining`, {
155
+ remaining: remaining,
156
+ type: type
156
157
  }));
157
158
  }
158
159
  else {
159
- this.setContent(element, this.t(`{{ count }} ${type}`, {
160
- count: count
160
+ this.setContent(element, this.t(`typeCount`, {
161
+ count: count,
162
+ type: type
161
163
  }));
162
164
  }
163
165
  }
@@ -55,7 +55,7 @@ class GoogleAddressProvider extends AddressProvider_1.AddressProvider {
55
55
  var _a;
56
56
  super(options);
57
57
  this.setAutocompleteOptions();
58
- let src = 'https://maps.googleapis.com/maps/api/js?v=quarterly&libraries=places&callback=googleMapsCallback';
58
+ let src = 'https://maps.googleapis.com/maps/api/js?v=quarterly&libraries=places&loading=async&callback=googleMapsCallback';
59
59
  if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.key) {
60
60
  src += `&key=${options.params.key}`;
61
61
  }
@@ -72,5 +72,7 @@ declare namespace _default {
72
72
  let reCaptchaTokenValidationError: string;
73
73
  let reCaptchaTokenNotSpecifiedError: string;
74
74
  let apiKey: string;
75
+ let typeRemaining: string;
76
+ let typeCount: string;
75
77
  }
76
78
  export default _default;
@@ -73,5 +73,7 @@ exports.default = {
73
73
  submitButtonAriaLabel: 'Submit Form button. Click to submit the form',
74
74
  reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
75
75
  reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
76
- apiKey: 'API Key is not unique: {{key}}'
76
+ apiKey: 'API Key is not unique: {{key}}',
77
+ typeRemaining: '{{ remaining }} {{ type }} remaining.',
78
+ typeCount: '{{ count }} {{ type }}'
77
79
  };
@@ -24,7 +24,7 @@ declare class ChoicesWrapper extends Choices {
24
24
  _onEnterKey(args: any): void;
25
25
  _onDirectionKey(...args: any[]): void;
26
26
  timeout: NodeJS.Timeout | undefined;
27
- _selectHighlightedChoice(): void;
27
+ _selectHighlightedChoice(activeItems: any): void;
28
28
  _onKeyDown(event: any): void;
29
29
  onSelectValue({ event, activeItems, hasActiveDropdown }: {
30
30
  event: any;
@@ -105,21 +105,10 @@ class ChoicesWrapper extends choices_js_1.default {
105
105
  this._selectHighlightedChoice(activeItems);
106
106
  }
107
107
  }
108
- _selectHighlightedChoice() {
108
+ _selectHighlightedChoice(activeItems) {
109
109
  const highlightedChoice = this.dropdown.getChild(`.${this.config.classNames.highlightedState}`);
110
110
  if (highlightedChoice) {
111
- const id = highlightedChoice.dataset.id;
112
- const choice = id && this._store.getChoiceById(id);
113
- this._addItem({
114
- value: choice.value,
115
- label: choice.label,
116
- choiceId: choice.id,
117
- groupId: choice.groupId,
118
- customProperties: choice.customProperties,
119
- placeholder: choice.placeholder,
120
- keyCode: choice.keyCode
121
- });
122
- this._triggerChange(choice.value);
111
+ this._handleChoiceAction(activeItems, highlightedChoice);
123
112
  }
124
113
  event.preventDefault();
125
114
  }
@@ -146,13 +146,15 @@ export default class Input extends Multivalue {
146
146
  else {
147
147
  this.addClass(element, 'text-danger');
148
148
  }
149
- this.setContent(element, this.t(`{{ remaining }} ${type} remaining.`, {
150
- remaining: remaining
149
+ this.setContent(element, this.t(`typeRemaining`, {
150
+ remaining: remaining,
151
+ type: type
151
152
  }));
152
153
  }
153
154
  else {
154
- this.setContent(element, this.t(`{{ count }} ${type}`, {
155
- count: count
155
+ this.setContent(element, this.t(`typeCount`, {
156
+ count: count,
157
+ type: type
156
158
  }));
157
159
  }
158
160
  }
@@ -48,7 +48,7 @@ export class GoogleAddressProvider extends AddressProvider {
48
48
  constructor(options = {}) {
49
49
  super(options);
50
50
  this.setAutocompleteOptions();
51
- let src = 'https://maps.googleapis.com/maps/api/js?v=quarterly&libraries=places&callback=googleMapsCallback';
51
+ let src = 'https://maps.googleapis.com/maps/api/js?v=quarterly&libraries=places&loading=async&callback=googleMapsCallback';
52
52
  if (options.params?.key) {
53
53
  src += `&key=${options.params.key}`;
54
54
  }
@@ -72,5 +72,7 @@ declare namespace _default {
72
72
  let reCaptchaTokenValidationError: string;
73
73
  let reCaptchaTokenNotSpecifiedError: string;
74
74
  let apiKey: string;
75
+ let typeRemaining: string;
76
+ let typeCount: string;
75
77
  }
76
78
  export default _default;
@@ -71,5 +71,7 @@ export default {
71
71
  submitButtonAriaLabel: 'Submit Form button. Click to submit the form',
72
72
  reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
73
73
  reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
74
- apiKey: 'API Key is not unique: {{key}}'
74
+ apiKey: 'API Key is not unique: {{key}}',
75
+ typeRemaining: '{{ remaining }} {{ type }} remaining.',
76
+ typeCount: '{{ count }} {{ type }}'
75
77
  };
@@ -24,7 +24,7 @@ declare class ChoicesWrapper extends Choices {
24
24
  _onEnterKey(args: any): void;
25
25
  _onDirectionKey(...args: any[]): void;
26
26
  timeout: NodeJS.Timeout | undefined;
27
- _selectHighlightedChoice(): void;
27
+ _selectHighlightedChoice(activeItems: any): void;
28
28
  _onKeyDown(event: any): void;
29
29
  onSelectValue({ event, activeItems, hasActiveDropdown }: {
30
30
  event: any;
@@ -99,21 +99,10 @@ class ChoicesWrapper extends Choices {
99
99
  this._selectHighlightedChoice(activeItems);
100
100
  }
101
101
  }
102
- _selectHighlightedChoice() {
102
+ _selectHighlightedChoice(activeItems) {
103
103
  const highlightedChoice = this.dropdown.getChild(`.${this.config.classNames.highlightedState}`);
104
104
  if (highlightedChoice) {
105
- const id = highlightedChoice.dataset.id;
106
- const choice = id && this._store.getChoiceById(id);
107
- this._addItem({
108
- value: choice.value,
109
- label: choice.label,
110
- choiceId: choice.id,
111
- groupId: choice.groupId,
112
- customProperties: choice.customProperties,
113
- placeholder: choice.placeholder,
114
- keyCode: choice.keyCode
115
- });
116
- this._triggerChange(choice.value);
105
+ this._handleChoiceAction(activeItems, highlightedChoice);
117
106
  }
118
107
  event.preventDefault();
119
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5654.e25521b",
3
+ "version": "5.0.0-dev.5655.a31d680",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {