@formio/js 5.0.0-dev.5664.1af299f → 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.
- package/Changelog.md +3 -2
- package/dist/formio.form.js +2 -98
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +2 -2
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/components/datagrid/DataGrid.d.ts +0 -9
- package/lib/cjs/components/datagrid/DataGrid.js +32 -47
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +1 -2
- package/lib/cjs/components/datagrid/fixtures/index.js +1 -3
- package/lib/cjs/components/select/Select.js +1 -2
- package/lib/mjs/components/datagrid/DataGrid.d.ts +0 -9
- package/lib/mjs/components/datagrid/DataGrid.js +32 -47
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +1 -2
- package/lib/mjs/components/datagrid/fixtures/index.js +1 -2
- package/lib/mjs/components/select/Select.js +1 -2
- package/package.json +1 -1
- package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.d.ts +0 -100
- package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.js +0 -139
- package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.d.ts +0 -100
- package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.js +0 -137
|
@@ -61,15 +61,6 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
61
61
|
loadRefs(element: any, refs: any): void;
|
|
62
62
|
dragula: any;
|
|
63
63
|
getComponentsContainer(): any;
|
|
64
|
-
/**
|
|
65
|
-
* Reorder values in array based on the old and new position
|
|
66
|
-
* @param {any} valuesArr - An array of values.
|
|
67
|
-
* @param {number} oldPosition - The index of the value in array before reordering.
|
|
68
|
-
* @param {number} newPosition - The index of the value in array after reordering.
|
|
69
|
-
* @param {boolean|any} movedBelow - Whether or not the value is moved below.
|
|
70
|
-
* @returns {void}
|
|
71
|
-
*/
|
|
72
|
-
reorderValues(valuesArr: any, oldPosition: number, newPosition: number, movedBelow: boolean | any): void;
|
|
73
64
|
onReorder(element: any, _target: any, _source: any, sibling: any): void;
|
|
74
65
|
focusOnNewRowElement(row: any): void;
|
|
75
66
|
addRow(): void;
|
|
@@ -7,7 +7,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
9
|
const Components_1 = require("../Components");
|
|
10
|
-
const dragula_1 = __importDefault(require("dragula"));
|
|
11
10
|
class DataGridComponent extends NestedArrayComponent_1.default {
|
|
12
11
|
static schema(...extend) {
|
|
13
12
|
return NestedArrayComponent_1.default.schema({
|
|
@@ -282,32 +281,34 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
|
282
281
|
this.refs[`${this.datagridKey}-row`].forEach((row, index) => {
|
|
283
282
|
row.dragInfo = { index };
|
|
284
283
|
});
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
}).on('drop', this.onReorder.bind(this));
|
|
295
|
-
this.dragula.on('cloned', (el, original) => {
|
|
296
|
-
if (el && el.children && original && original.children) {
|
|
297
|
-
lodash_1.default.each(original.children, (child, index) => {
|
|
298
|
-
const styles = getComputedStyle(child, null);
|
|
299
|
-
if (styles.cssText !== '') {
|
|
300
|
-
el.children[index].style.cssText = styles.cssText;
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
const cssText = Object.values(styles).reduce((css, propertyName) => {
|
|
304
|
-
return `${css}${propertyName}:${styles.getPropertyValue(propertyName)};`;
|
|
305
|
-
}, '');
|
|
306
|
-
el.children[index].style.cssText = cssText;
|
|
284
|
+
if (this.root.dragulaLib) {
|
|
285
|
+
this.dragula = this.root.dragulaLib([this.refs[`${this.datagridKey}-tbody`]], {
|
|
286
|
+
moves: (_draggedElement, _oldParent, clickedElement) => {
|
|
287
|
+
const clickedElementKey = clickedElement.getAttribute('data-key');
|
|
288
|
+
const oldParentKey = _oldParent.getAttribute('data-key');
|
|
289
|
+
//Check if the clicked button belongs to that container, if false, it belongs to the nested container
|
|
290
|
+
if (oldParentKey === clickedElementKey) {
|
|
291
|
+
return clickedElement.classList.contains('formio-drag-button');
|
|
307
292
|
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
293
|
+
}
|
|
294
|
+
}).on('drop', this.onReorder.bind(this));
|
|
295
|
+
this.dragula.on('cloned', (el, original) => {
|
|
296
|
+
if (el && el.children && original && original.children) {
|
|
297
|
+
lodash_1.default.each(original.children, (child, index) => {
|
|
298
|
+
const styles = getComputedStyle(child, null);
|
|
299
|
+
if (styles.cssText !== '') {
|
|
300
|
+
el.children[index].style.cssText = styles.cssText;
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
const cssText = Object.values(styles).reduce((css, propertyName) => {
|
|
304
|
+
return `${css}${propertyName}:${styles.getPropertyValue(propertyName)};`;
|
|
305
|
+
}, '');
|
|
306
|
+
el.children[index].style.cssText = cssText;
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}
|
|
311
312
|
}
|
|
312
313
|
this.refs[`${this.datagridKey}-addRow`].forEach((addButton) => {
|
|
313
314
|
this.addEventListener(addButton, 'click', this.addRow.bind(this));
|
|
@@ -335,24 +336,6 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
|
335
336
|
getComponentsContainer() {
|
|
336
337
|
return this.component.components;
|
|
337
338
|
}
|
|
338
|
-
/**
|
|
339
|
-
* Reorder values in array based on the old and new position
|
|
340
|
-
* @param {any} valuesArr - An array of values.
|
|
341
|
-
* @param {number} oldPosition - The index of the value in array before reordering.
|
|
342
|
-
* @param {number} newPosition - The index of the value in array after reordering.
|
|
343
|
-
* @param {boolean|any} movedBelow - Whether or not the value is moved below.
|
|
344
|
-
* @returns {void}
|
|
345
|
-
*/
|
|
346
|
-
reorderValues(valuesArr, oldPosition, newPosition, movedBelow) {
|
|
347
|
-
if (!lodash_1.default.isArray(valuesArr) || lodash_1.default.isEmpty(valuesArr)) {
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
const draggedRowData = valuesArr[oldPosition];
|
|
351
|
-
//insert element at new position
|
|
352
|
-
valuesArr.splice(newPosition, 0, draggedRowData);
|
|
353
|
-
//remove element from old position (if was moved above, after insertion it's at +1 index)
|
|
354
|
-
valuesArr.splice(movedBelow ? oldPosition : oldPosition + 1, 1);
|
|
355
|
-
}
|
|
356
339
|
onReorder(element, _target, _source, sibling) {
|
|
357
340
|
if (!element.dragInfo || (sibling && !sibling.dragInfo)) {
|
|
358
341
|
console.warn('There is no Drag Info available for either dragged or sibling element');
|
|
@@ -363,9 +346,11 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
|
363
346
|
const newPosition = sibling ? sibling.dragInfo.index : this.dataValue.length;
|
|
364
347
|
const movedBelow = newPosition > oldPosition;
|
|
365
348
|
const dataValue = (0, utils_1.fastCloneDeep)(this.dataValue);
|
|
366
|
-
|
|
367
|
-
//
|
|
368
|
-
|
|
349
|
+
const draggedRowData = dataValue[oldPosition];
|
|
350
|
+
//insert element at new position
|
|
351
|
+
dataValue.splice(newPosition, 0, draggedRowData);
|
|
352
|
+
//remove element from old position (if was moved above, after insertion it's at +1 index)
|
|
353
|
+
dataValue.splice(movedBelow ? oldPosition : oldPosition + 1, 1);
|
|
369
354
|
//need to re-build rows to re-calculate indexes and other indexed fields for component instance (like rows for ex.)
|
|
370
355
|
this.setValue(dataValue, { isReordered: true });
|
|
371
356
|
this.rebuild();
|
|
@@ -15,5 +15,4 @@ import modalWithRequiredFields from './comp-modal-with-required-fields';
|
|
|
15
15
|
import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
16
16
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
|
17
17
|
import withCheckboxes from './comp-with-checkboxes';
|
|
18
|
-
|
|
19
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
|
18
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
@@ -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.
|
|
6
|
+
exports.withCheckboxes = exports.twoWithAllowCalculatedOverride = exports.withAllowCalculateOverride = exports.modalWithRequiredFields = exports.withRowGroupsAndDefValue = exports.withLogic = exports.withDefValue = exports.withConditionalFieldsAndValidations = exports.withCollapsibleRowGroups = exports.comp8 = 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"));
|
|
@@ -38,5 +38,3 @@ const two_comp_with_allow_calculate_override_1 = __importDefault(require("./two-
|
|
|
38
38
|
exports.twoWithAllowCalculatedOverride = two_comp_with_allow_calculate_override_1.default;
|
|
39
39
|
const comp_with_checkboxes_1 = __importDefault(require("./comp-with-checkboxes"));
|
|
40
40
|
exports.withCheckboxes = comp_with_checkboxes_1.default;
|
|
41
|
-
const comp_with_reorder_1 = __importDefault(require("./comp-with-reorder"));
|
|
42
|
-
exports.withReorder = comp_with_reorder_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
|
-
|
|
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());
|
|
@@ -61,15 +61,6 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
61
61
|
loadRefs(element: any, refs: any): void;
|
|
62
62
|
dragula: any;
|
|
63
63
|
getComponentsContainer(): any;
|
|
64
|
-
/**
|
|
65
|
-
* Reorder values in array based on the old and new position
|
|
66
|
-
* @param {any} valuesArr - An array of values.
|
|
67
|
-
* @param {number} oldPosition - The index of the value in array before reordering.
|
|
68
|
-
* @param {number} newPosition - The index of the value in array after reordering.
|
|
69
|
-
* @param {boolean|any} movedBelow - Whether or not the value is moved below.
|
|
70
|
-
* @returns {void}
|
|
71
|
-
*/
|
|
72
|
-
reorderValues(valuesArr: any, oldPosition: number, newPosition: number, movedBelow: boolean | any): void;
|
|
73
64
|
onReorder(element: any, _target: any, _source: any, sibling: any): void;
|
|
74
65
|
focusOnNewRowElement(row: any): void;
|
|
75
66
|
addRow(): void;
|
|
@@ -2,7 +2,6 @@ import _ from 'lodash';
|
|
|
2
2
|
import NestedArrayComponent from '../_classes/nestedarray/NestedArrayComponent';
|
|
3
3
|
import { fastCloneDeep, getFocusableElements } from '../../utils/utils';
|
|
4
4
|
import { Components } from '../Components';
|
|
5
|
-
import dragula from 'dragula';
|
|
6
5
|
export default class DataGridComponent extends NestedArrayComponent {
|
|
7
6
|
static schema(...extend) {
|
|
8
7
|
return NestedArrayComponent.schema({
|
|
@@ -279,32 +278,34 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
279
278
|
this.refs[`${this.datagridKey}-row`].forEach((row, index) => {
|
|
280
279
|
row.dragInfo = { index };
|
|
281
280
|
});
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
}).on('drop', this.onReorder.bind(this));
|
|
292
|
-
this.dragula.on('cloned', (el, original) => {
|
|
293
|
-
if (el && el.children && original && original.children) {
|
|
294
|
-
_.each(original.children, (child, index) => {
|
|
295
|
-
const styles = getComputedStyle(child, null);
|
|
296
|
-
if (styles.cssText !== '') {
|
|
297
|
-
el.children[index].style.cssText = styles.cssText;
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
const cssText = Object.values(styles).reduce((css, propertyName) => {
|
|
301
|
-
return `${css}${propertyName}:${styles.getPropertyValue(propertyName)};`;
|
|
302
|
-
}, '');
|
|
303
|
-
el.children[index].style.cssText = cssText;
|
|
281
|
+
if (this.root.dragulaLib) {
|
|
282
|
+
this.dragula = this.root.dragulaLib([this.refs[`${this.datagridKey}-tbody`]], {
|
|
283
|
+
moves: (_draggedElement, _oldParent, clickedElement) => {
|
|
284
|
+
const clickedElementKey = clickedElement.getAttribute('data-key');
|
|
285
|
+
const oldParentKey = _oldParent.getAttribute('data-key');
|
|
286
|
+
//Check if the clicked button belongs to that container, if false, it belongs to the nested container
|
|
287
|
+
if (oldParentKey === clickedElementKey) {
|
|
288
|
+
return clickedElement.classList.contains('formio-drag-button');
|
|
304
289
|
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
290
|
+
}
|
|
291
|
+
}).on('drop', this.onReorder.bind(this));
|
|
292
|
+
this.dragula.on('cloned', (el, original) => {
|
|
293
|
+
if (el && el.children && original && original.children) {
|
|
294
|
+
_.each(original.children, (child, index) => {
|
|
295
|
+
const styles = getComputedStyle(child, null);
|
|
296
|
+
if (styles.cssText !== '') {
|
|
297
|
+
el.children[index].style.cssText = styles.cssText;
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
const cssText = Object.values(styles).reduce((css, propertyName) => {
|
|
301
|
+
return `${css}${propertyName}:${styles.getPropertyValue(propertyName)};`;
|
|
302
|
+
}, '');
|
|
303
|
+
el.children[index].style.cssText = cssText;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
308
309
|
}
|
|
309
310
|
this.refs[`${this.datagridKey}-addRow`].forEach((addButton) => {
|
|
310
311
|
this.addEventListener(addButton, 'click', this.addRow.bind(this));
|
|
@@ -332,24 +333,6 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
332
333
|
getComponentsContainer() {
|
|
333
334
|
return this.component.components;
|
|
334
335
|
}
|
|
335
|
-
/**
|
|
336
|
-
* Reorder values in array based on the old and new position
|
|
337
|
-
* @param {any} valuesArr - An array of values.
|
|
338
|
-
* @param {number} oldPosition - The index of the value in array before reordering.
|
|
339
|
-
* @param {number} newPosition - The index of the value in array after reordering.
|
|
340
|
-
* @param {boolean|any} movedBelow - Whether or not the value is moved below.
|
|
341
|
-
* @returns {void}
|
|
342
|
-
*/
|
|
343
|
-
reorderValues(valuesArr, oldPosition, newPosition, movedBelow) {
|
|
344
|
-
if (!_.isArray(valuesArr) || _.isEmpty(valuesArr)) {
|
|
345
|
-
return;
|
|
346
|
-
}
|
|
347
|
-
const draggedRowData = valuesArr[oldPosition];
|
|
348
|
-
//insert element at new position
|
|
349
|
-
valuesArr.splice(newPosition, 0, draggedRowData);
|
|
350
|
-
//remove element from old position (if was moved above, after insertion it's at +1 index)
|
|
351
|
-
valuesArr.splice(movedBelow ? oldPosition : oldPosition + 1, 1);
|
|
352
|
-
}
|
|
353
336
|
onReorder(element, _target, _source, sibling) {
|
|
354
337
|
if (!element.dragInfo || (sibling && !sibling.dragInfo)) {
|
|
355
338
|
console.warn('There is no Drag Info available for either dragged or sibling element');
|
|
@@ -360,9 +343,11 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
|
360
343
|
const newPosition = sibling ? sibling.dragInfo.index : this.dataValue.length;
|
|
361
344
|
const movedBelow = newPosition > oldPosition;
|
|
362
345
|
const dataValue = fastCloneDeep(this.dataValue);
|
|
363
|
-
|
|
364
|
-
//
|
|
365
|
-
|
|
346
|
+
const draggedRowData = dataValue[oldPosition];
|
|
347
|
+
//insert element at new position
|
|
348
|
+
dataValue.splice(newPosition, 0, draggedRowData);
|
|
349
|
+
//remove element from old position (if was moved above, after insertion it's at +1 index)
|
|
350
|
+
dataValue.splice(movedBelow ? oldPosition : oldPosition + 1, 1);
|
|
366
351
|
//need to re-build rows to re-calculate indexes and other indexed fields for component instance (like rows for ex.)
|
|
367
352
|
this.setValue(dataValue, { isReordered: true });
|
|
368
353
|
this.rebuild();
|
|
@@ -15,5 +15,4 @@ import modalWithRequiredFields from './comp-modal-with-required-fields';
|
|
|
15
15
|
import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
16
16
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
|
17
17
|
import withCheckboxes from './comp-with-checkboxes';
|
|
18
|
-
|
|
19
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
|
18
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
@@ -15,5 +15,4 @@ import withCollapsibleRowGroups from './comp-with-collapsible-groups';
|
|
|
15
15
|
import withAllowCalculateOverride from './comp-with-allow-calculate-override';
|
|
16
16
|
import twoWithAllowCalculatedOverride from './two-comp-with-allow-calculate-override';
|
|
17
17
|
import withCheckboxes from './comp-with-checkboxes';
|
|
18
|
-
|
|
19
|
-
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes, withReorder };
|
|
18
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, withCollapsibleRowGroups, withConditionalFieldsAndValidations, withDefValue, withLogic, withRowGroupsAndDefValue, modalWithRequiredFields, withAllowCalculateOverride, twoWithAllowCalculatedOverride, withCheckboxes };
|
|
@@ -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
|
-
|
|
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,100 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
export { form };
|
|
3
|
-
export { submission };
|
|
4
|
-
}
|
|
5
|
-
export default _default;
|
|
6
|
-
declare namespace form {
|
|
7
|
-
let _id: string;
|
|
8
|
-
let title: string;
|
|
9
|
-
let name: string;
|
|
10
|
-
let path: string;
|
|
11
|
-
let type: string;
|
|
12
|
-
let display: string;
|
|
13
|
-
let components: ({
|
|
14
|
-
label: string;
|
|
15
|
-
reorder: boolean;
|
|
16
|
-
addAnotherPosition: string;
|
|
17
|
-
layoutFixed: boolean;
|
|
18
|
-
enableRowGroups: boolean;
|
|
19
|
-
initEmpty: boolean;
|
|
20
|
-
tableView: boolean;
|
|
21
|
-
defaultValue: {
|
|
22
|
-
select: string;
|
|
23
|
-
}[];
|
|
24
|
-
key: string;
|
|
25
|
-
type: string;
|
|
26
|
-
input: boolean;
|
|
27
|
-
components: {
|
|
28
|
-
label: string;
|
|
29
|
-
widget: string;
|
|
30
|
-
tableView: boolean;
|
|
31
|
-
dataSrc: string;
|
|
32
|
-
data: {
|
|
33
|
-
resource: string;
|
|
34
|
-
};
|
|
35
|
-
dataType: string;
|
|
36
|
-
valueProperty: string;
|
|
37
|
-
template: string;
|
|
38
|
-
validate: {
|
|
39
|
-
select: boolean;
|
|
40
|
-
};
|
|
41
|
-
key: string;
|
|
42
|
-
type: string;
|
|
43
|
-
searchField: string;
|
|
44
|
-
limit: number;
|
|
45
|
-
noRefreshOnScroll: boolean;
|
|
46
|
-
addResource: boolean;
|
|
47
|
-
reference: boolean;
|
|
48
|
-
input: boolean;
|
|
49
|
-
}[];
|
|
50
|
-
disableOnInvalid?: undefined;
|
|
51
|
-
} | {
|
|
52
|
-
type: string;
|
|
53
|
-
label: string;
|
|
54
|
-
key: string;
|
|
55
|
-
disableOnInvalid: boolean;
|
|
56
|
-
input: boolean;
|
|
57
|
-
tableView: boolean;
|
|
58
|
-
reorder?: undefined;
|
|
59
|
-
addAnotherPosition?: undefined;
|
|
60
|
-
layoutFixed?: undefined;
|
|
61
|
-
enableRowGroups?: undefined;
|
|
62
|
-
initEmpty?: undefined;
|
|
63
|
-
defaultValue?: undefined;
|
|
64
|
-
components?: undefined;
|
|
65
|
-
})[];
|
|
66
|
-
let created: string;
|
|
67
|
-
let modified: string;
|
|
68
|
-
let machineName: string;
|
|
69
|
-
}
|
|
70
|
-
declare namespace submission {
|
|
71
|
-
let form_1: string;
|
|
72
|
-
export { form_1 as form };
|
|
73
|
-
export namespace metadata {
|
|
74
|
-
namespace selectData {
|
|
75
|
-
let dataGrid: {
|
|
76
|
-
select: {
|
|
77
|
-
data: {
|
|
78
|
-
number: number;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
}[];
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
export namespace data {
|
|
85
|
-
let dataGrid_1: {
|
|
86
|
-
select: string;
|
|
87
|
-
}[];
|
|
88
|
-
export { dataGrid_1 as dataGrid };
|
|
89
|
-
export let dataTable: never[];
|
|
90
|
-
export let submit: boolean;
|
|
91
|
-
}
|
|
92
|
-
let _id_1: string;
|
|
93
|
-
export { _id_1 as _id };
|
|
94
|
-
export let project: string;
|
|
95
|
-
export let state: string;
|
|
96
|
-
let created_1: string;
|
|
97
|
-
export { created_1 as created };
|
|
98
|
-
let modified_1: string;
|
|
99
|
-
export { modified_1 as modified };
|
|
100
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const form = {
|
|
4
|
-
_id: '66742f4146717b98a9fa280f',
|
|
5
|
-
title: 'test reorder',
|
|
6
|
-
name: 'testReorder',
|
|
7
|
-
path: 'testreorder',
|
|
8
|
-
type: 'form',
|
|
9
|
-
display: 'form',
|
|
10
|
-
components: [
|
|
11
|
-
{
|
|
12
|
-
label: 'Data Grid',
|
|
13
|
-
reorder: true,
|
|
14
|
-
addAnotherPosition: 'bottom',
|
|
15
|
-
layoutFixed: false,
|
|
16
|
-
enableRowGroups: false,
|
|
17
|
-
initEmpty: false,
|
|
18
|
-
tableView: false,
|
|
19
|
-
defaultValue: [
|
|
20
|
-
{
|
|
21
|
-
select: '',
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
key: 'dataGrid',
|
|
25
|
-
type: 'datagrid',
|
|
26
|
-
input: true,
|
|
27
|
-
components: [
|
|
28
|
-
{
|
|
29
|
-
label: 'Select',
|
|
30
|
-
widget: 'choicesjs',
|
|
31
|
-
tableView: true,
|
|
32
|
-
dataSrc: 'resource',
|
|
33
|
-
data: {
|
|
34
|
-
resource: '66742ee946717b98a9fa1b0b',
|
|
35
|
-
},
|
|
36
|
-
dataType: 'string',
|
|
37
|
-
valueProperty: 'data.textField',
|
|
38
|
-
template: '<span>{{ item.data.number }}</span>',
|
|
39
|
-
validate: {
|
|
40
|
-
select: false,
|
|
41
|
-
},
|
|
42
|
-
key: 'select',
|
|
43
|
-
type: 'select',
|
|
44
|
-
searchField: 'data.textField__regex',
|
|
45
|
-
limit: 10,
|
|
46
|
-
noRefreshOnScroll: false,
|
|
47
|
-
addResource: false,
|
|
48
|
-
reference: false,
|
|
49
|
-
input: true,
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
type: 'button',
|
|
55
|
-
label: 'Submit',
|
|
56
|
-
key: 'submit',
|
|
57
|
-
disableOnInvalid: true,
|
|
58
|
-
input: true,
|
|
59
|
-
tableView: false,
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
created: '2024-06-20T13:31:45.177Z',
|
|
63
|
-
modified: '2024-06-25T10:32:46.577Z',
|
|
64
|
-
machineName: 'tifwklexhyrgxbr:testReorder',
|
|
65
|
-
};
|
|
66
|
-
const submission = {
|
|
67
|
-
form: '66742f4146717b98a9fa280f',
|
|
68
|
-
metadata: {
|
|
69
|
-
selectData: {
|
|
70
|
-
dataGrid: [
|
|
71
|
-
{
|
|
72
|
-
select: {
|
|
73
|
-
data: {
|
|
74
|
-
number: 1,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
select: {
|
|
80
|
-
data: {
|
|
81
|
-
number: 2,
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
select: {
|
|
87
|
-
data: {
|
|
88
|
-
number: 3,
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
select: {
|
|
94
|
-
data: {
|
|
95
|
-
number: 4,
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
select: {
|
|
101
|
-
data: {
|
|
102
|
-
number: 5,
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
data: {
|
|
110
|
-
dataGrid: [
|
|
111
|
-
{
|
|
112
|
-
select: '11',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
select: '22',
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
select: '33',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
select: '44',
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
select: '55',
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
dataTable: [],
|
|
128
|
-
submit: true,
|
|
129
|
-
},
|
|
130
|
-
_id: '667ab5ee6a69739703d30def',
|
|
131
|
-
project: '65df46bc93bcfaa231f3db1c',
|
|
132
|
-
state: 'submitted',
|
|
133
|
-
created: '2024-06-25T12:19:58.626Z',
|
|
134
|
-
modified: '2024-06-25T12:19:58.627Z',
|
|
135
|
-
};
|
|
136
|
-
exports.default = {
|
|
137
|
-
form,
|
|
138
|
-
submission,
|
|
139
|
-
};
|