@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.
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +95 -9
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +5 -15
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/WizardBuilder.js +3 -7
- package/lib/cjs/components/datagrid/DataGrid.js +3 -7
- package/lib/cjs/components/select/Select.d.ts +2 -1
- package/lib/cjs/components/select/Select.js +3 -6
- package/lib/cjs/components/tags/Tags.d.ts +2 -1
- package/lib/cjs/components/tags/Tags.js +3 -6
- package/lib/mjs/WizardBuilder.js +1 -5
- package/lib/mjs/components/datagrid/DataGrid.js +1 -5
- package/lib/mjs/components/select/Select.d.ts +2 -1
- package/lib/mjs/components/select/Select.js +1 -4
- package/lib/mjs/components/tags/Tags.d.ts +2 -1
- package/lib/mjs/components/tags/Tags.js +1 -4
- package/package.json +1 -1
package/lib/cjs/WizardBuilder.js
CHANGED
@@ -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
|
-
|
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 (
|
156
|
-
|
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
|
-
|
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 (
|
278
|
-
this.dragula =
|
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:
|
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
|
-
|
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 (
|
803
|
-
this.choices = new
|
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:
|
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
|
-
|
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 (!
|
59
|
+
if (!choices_js_1.default) {
|
63
60
|
return;
|
64
61
|
}
|
65
62
|
const hasPlaceholder = !!this.component.placeholder;
|
66
|
-
this.choices = new
|
63
|
+
this.choices = new choices_js_1.default(element, {
|
67
64
|
delimiter: this.delimiter,
|
68
65
|
editItems: true,
|
69
66
|
allowHTML: true,
|
package/lib/mjs/WizardBuilder.js
CHANGED
@@ -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
|
-
|
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
|
-
|
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:
|
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
|
-
|
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:
|
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
|
-
|
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({
|