@formio/js 5.0.0-rc.12 → 5.0.0-rc.13

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.
@@ -5,7 +5,7 @@
5
5
  MIT License: http://getify.mit-license.org
6
6
  */
7
7
 
8
- /*! formiojs v5.0.0-rc.12 | https://unpkg.com/formiojs@5.0.0-rc.12/LICENSE.txt */
8
+ /*! formiojs v5.0.0-rc.13 | https://unpkg.com/formiojs@5.0.0-rc.13/LICENSE.txt */
9
9
 
10
10
  /**
11
11
  * @license
@@ -17,7 +17,7 @@
17
17
  MIT License: http://getify.mit-license.org
18
18
  */
19
19
 
20
- /*! formiojs v5.0.0-rc.12 | https://unpkg.com/formiojs@5.0.0-rc.12/LICENSE.txt */
20
+ /*! formiojs v5.0.0-rc.13 | https://unpkg.com/formiojs@5.0.0-rc.13/LICENSE.txt */
21
21
 
22
22
  /**
23
23
  * @license
@@ -8,11 +8,7 @@ const Webform_1 = __importDefault(require("./Webform"));
8
8
  const builder_1 = __importDefault(require("./utils/builder"));
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
10
  const utils_1 = require("./utils/utils");
11
- let dragula;
12
- if (typeof window !== 'undefined') {
13
- // Import from "dist" because it would require and "global" would not be defined in Angular apps.
14
- dragula = require('dragula/dist/dragula');
15
- }
11
+ const dragula_1 = __importDefault(require("dragula"));
16
12
  class WizardBuilder extends WebformBuilder_1.default {
17
13
  constructor() {
18
14
  let element, options;
@@ -152,8 +148,8 @@ class WizardBuilder extends WebformBuilder_1.default {
152
148
  this.refs.gotoPage.forEach((page, index) => {
153
149
  page.parentNode.dragInfo = { index };
154
150
  });
155
- if (dragula) {
156
- dragula([this.element.querySelector('.wizard-pages')])
151
+ if (dragula_1.default) {
152
+ (0, dragula_1.default)([this.element.querySelector('.wizard-pages')])
157
153
  .on('drop', this.onReorder.bind(this));
158
154
  }
159
155
  this.refs.addPage.forEach(link => {
@@ -6,11 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lodash_1 = __importDefault(require("lodash"));
7
7
  const NestedArrayComponent_1 = __importDefault(require("../_classes/nestedarray/NestedArrayComponent"));
8
8
  const utils_1 = require("../../utils/utils");
9
- let dragula;
10
- if (typeof window !== 'undefined') {
11
- // Import from "dist" because it would require and "global" would not be defined in Angular apps.
12
- dragula = require('dragula/dist/dragula');
13
- }
9
+ const dragula_1 = __importDefault(require("dragula"));
14
10
  class DataGridComponent extends NestedArrayComponent_1.default {
15
11
  static schema(...extend) {
16
12
  return NestedArrayComponent_1.default.schema({
@@ -274,8 +270,8 @@ class DataGridComponent extends NestedArrayComponent_1.default {
274
270
  this.refs[`${this.datagridKey}-row`].forEach((row, index) => {
275
271
  row.dragInfo = { index };
276
272
  });
277
- if (dragula) {
278
- this.dragula = dragula([this.refs[`${this.datagridKey}-tbody`]], {
273
+ if (dragula_1.default) {
274
+ this.dragula = (0, dragula_1.default)([this.refs[`${this.datagridKey}-tbody`]], {
279
275
  moves: (_draggedElement, _oldParent, clickedElement) => {
280
276
  const clickedElementKey = clickedElement.getAttribute('data-key');
281
277
  const oldParentKey = _oldParent.getAttribute('data-key');
@@ -80,7 +80,7 @@ export default class SelectComponent extends ListComponent {
80
80
  wrapElement(element: any): any;
81
81
  choicesOptions(): any;
82
82
  focusableElement: any;
83
- choices: any;
83
+ choices: Choices | null | undefined;
84
84
  scrollList: any;
85
85
  get isLoadingAvailable(): any;
86
86
  onScroll(): void;
@@ -120,3 +120,4 @@ export default class SelectComponent extends ListComponent {
120
120
  focus(): void;
121
121
  }
122
122
  import ListComponent from '../_classes/list/ListComponent';
123
+ import Choices from '../../utils/ChoicesWrapper';
@@ -9,10 +9,7 @@ const ListComponent_1 = __importDefault(require("../_classes/list/ListComponent"
9
9
  const Form_1 = __importDefault(require("../../Form"));
10
10
  const native_promise_only_1 = __importDefault(require("native-promise-only"));
11
11
  const utils_1 = require("../../utils/utils");
12
- let Choices;
13
- if (typeof window !== 'undefined') {
14
- Choices = require('../../utils/ChoicesWrapper').default;
15
- }
12
+ const ChoicesWrapper_1 = __importDefault(require("../../utils/ChoicesWrapper"));
16
13
  class SelectComponent extends ListComponent_1.default {
17
14
  static schema(...extend) {
18
15
  return ListComponent_1.default.schema({
@@ -799,8 +796,8 @@ class SelectComponent extends ListComponent_1.default {
799
796
  this.choices.destroy();
800
797
  }
801
798
  const choicesOptions = this.choicesOptions();
802
- if (Choices) {
803
- this.choices = new Choices(input, choicesOptions);
799
+ if (ChoicesWrapper_1.default) {
800
+ this.choices = new ChoicesWrapper_1.default(input, choicesOptions);
804
801
  if (this.selectOptions && this.selectOptions.length) {
805
802
  this.choices.setChoices(this.selectOptions, 'value', 'label', true);
806
803
  }
@@ -10,10 +10,11 @@ export default class TagsComponent extends Input {
10
10
  get emptyValue(): "" | never[];
11
11
  get delimiter(): any;
12
12
  attachElement(element: any, index: any): void;
13
- choices: any;
13
+ choices: Choices | null | undefined;
14
14
  normalizeValue(value: any): any;
15
15
  setValue(value: any, flags?: {}): boolean;
16
16
  focus(): void;
17
17
  getValueAsString(value: any): any;
18
18
  }
19
19
  import Input from '../_classes/input/Input';
20
+ import Choices from '@formio/choices.js';
@@ -4,10 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const Input_1 = __importDefault(require("../_classes/input/Input"));
7
- let Choices;
8
- if (typeof window !== 'undefined') {
9
- Choices = require('@formio/choices.js');
10
- }
7
+ const choices_js_1 = __importDefault(require("@formio/choices.js"));
11
8
  class TagsComponent extends Input_1.default {
12
9
  static schema(...extend) {
13
10
  return Input_1.default.schema({
@@ -59,11 +56,11 @@ class TagsComponent extends Input_1.default {
59
56
  if (this.choices) {
60
57
  this.choices.destroy();
61
58
  }
62
- if (!Choices) {
59
+ if (!choices_js_1.default) {
63
60
  return;
64
61
  }
65
62
  const hasPlaceholder = !!this.component.placeholder;
66
- this.choices = new Choices(element, {
63
+ this.choices = new choices_js_1.default(element, {
67
64
  delimiter: this.delimiter,
68
65
  editItems: true,
69
66
  allowHTML: true,
@@ -3,11 +3,7 @@ import Webform from './Webform';
3
3
  import BuilderUtils from './utils/builder';
4
4
  import _ from 'lodash';
5
5
  import { fastCloneDeep } from './utils/utils';
6
- let dragula;
7
- if (typeof window !== 'undefined') {
8
- // Import from "dist" because it would require and "global" would not be defined in Angular apps.
9
- dragula = require('dragula/dist/dragula');
10
- }
6
+ import dragula from 'dragula';
11
7
  export default class WizardBuilder extends WebformBuilder {
12
8
  constructor() {
13
9
  let element, options;
@@ -1,11 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import NestedArrayComponent from '../_classes/nestedarray/NestedArrayComponent';
3
3
  import { fastCloneDeep, getFocusableElements } from '../../utils/utils';
4
- let dragula;
5
- if (typeof window !== 'undefined') {
6
- // Import from "dist" because it would require and "global" would not be defined in Angular apps.
7
- dragula = require('dragula/dist/dragula');
8
- }
4
+ import dragula from 'dragula';
9
5
  export default class DataGridComponent extends NestedArrayComponent {
10
6
  static schema(...extend) {
11
7
  return NestedArrayComponent.schema({
@@ -80,7 +80,7 @@ export default class SelectComponent extends ListComponent {
80
80
  wrapElement(element: any): any;
81
81
  choicesOptions(): any;
82
82
  focusableElement: any;
83
- choices: any;
83
+ choices: Choices | null | undefined;
84
84
  scrollList: any;
85
85
  get isLoadingAvailable(): any;
86
86
  onScroll(): void;
@@ -120,3 +120,4 @@ export default class SelectComponent extends ListComponent {
120
120
  focus(): void;
121
121
  }
122
122
  import ListComponent from '../_classes/list/ListComponent';
123
+ import Choices from '../../utils/ChoicesWrapper';
@@ -4,10 +4,7 @@ import ListComponent from '../_classes/list/ListComponent';
4
4
  import Form from '../../Form';
5
5
  import NativePromise from 'native-promise-only';
6
6
  import { getRandomComponentId, boolValue, isPromise } from '../../utils/utils';
7
- let Choices;
8
- if (typeof window !== 'undefined') {
9
- Choices = require('../../utils/ChoicesWrapper').default;
10
- }
7
+ import Choices from '../../utils/ChoicesWrapper';
11
8
  export default class SelectComponent extends ListComponent {
12
9
  static schema(...extend) {
13
10
  return ListComponent.schema({
@@ -10,10 +10,11 @@ export default class TagsComponent extends Input {
10
10
  get emptyValue(): "" | never[];
11
11
  get delimiter(): any;
12
12
  attachElement(element: any, index: any): void;
13
- choices: any;
13
+ choices: Choices | null | undefined;
14
14
  normalizeValue(value: any): any;
15
15
  setValue(value: any, flags?: {}): boolean;
16
16
  focus(): void;
17
17
  getValueAsString(value: any): any;
18
18
  }
19
19
  import Input from '../_classes/input/Input';
20
+ import Choices from '@formio/choices.js';
@@ -1,8 +1,5 @@
1
1
  import Input from '../_classes/input/Input';
2
- let Choices;
3
- if (typeof window !== 'undefined') {
4
- Choices = require('@formio/choices.js');
5
- }
2
+ import Choices from '@formio/choices.js';
6
3
  export default class TagsComponent extends Input {
7
4
  static schema(...extend) {
8
5
  return Input.schema({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-rc.12",
3
+ "version": "5.0.0-rc.13",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",