datasync-dynamic-form 1.2.4 → 1.3.2
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/DsDynamicForm.js +9 -6
- package/package.json +4 -2
package/dist/DsDynamicForm.js
CHANGED
|
@@ -8,10 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
-
import { Component } from "react";
|
|
11
|
+
import React, { Component } from "react";
|
|
12
12
|
import Multiselect from 'multiselect-react-dropdown';
|
|
13
13
|
import { CTimeStamp, Randomize, SaveDataTierToDatasync, WScrollTo } from "datasync-core";
|
|
14
14
|
import { DsBlob } from "datasync-blob";
|
|
15
|
+
import { DsPdf } from "datasync-pdf";
|
|
15
16
|
// reactstrap components
|
|
16
17
|
import { Button, Label, FormGroup, Input, InputGroupText, InputGroup, Row as ReactstrapRow, Col as ReactstrapCol, } from "reactstrap";
|
|
17
18
|
const debugging = false;
|
|
@@ -389,7 +390,7 @@ export class DsDynamicForm extends Component {
|
|
|
389
390
|
};
|
|
390
391
|
this._colRendering = (col) => {
|
|
391
392
|
try {
|
|
392
|
-
return (_jsx(ReactstrapCol, { id: `${col.Id ? col.Id : ''}`, children: col.Fields.map((field, ii) => {
|
|
393
|
+
return (_jsx(ReactstrapCol, { xs: "12", sm: "12", md: "6", lg: "4", id: `${col.Id ? col.Id : ''}`, children: col.Fields.map((field, ii) => {
|
|
393
394
|
return this._fieldRendering(field, ii);
|
|
394
395
|
}) }));
|
|
395
396
|
}
|
|
@@ -415,6 +416,8 @@ export class DsDynamicForm extends Component {
|
|
|
415
416
|
return (_jsxs("div", { children: [this.getFieldLabelTitle(field), _jsx(Multiselect, { showArrow: true, options: ["Oui", "Non"], isObject: false, displayValue: "key", selectedValues: this.getFieldData(field.name) ? this.getFieldData(field.name).split(";") : [], placeholder: field.placeholder, emptyRecordMsg: "", onSelect: (selectedList, selectedItem) => { this.setFieldData(field.name, selectedList.join(";")); }, onRemove: (selectedList, selectedItem) => { this.setFieldData(field.name, selectedList.join(";")); }, disable: this.props.read_only, singleSelect: true }), this._error_label(field)] }));
|
|
416
417
|
case "blob":
|
|
417
418
|
return (_jsxs(_Fragment, { children: [this.getFieldLabelTitle(field), _jsxs("div", { className: "col-md-10", children: [_jsx(DsBlob, { item_id: field.name, readOnly: this.props.read_only ? this.props.read_only : false, Caption: `${this.getFieldPrompt(field)} ...`, data: this.getFieldData(field.name), uploadPicture: (UploadFile) => { this.setFieldData(field.name, UploadFile.data); this.checkValidation(field); }, pictureStyle: "pic", buttonStyle: "btn btn-secondary", width: field.width ? field.width : undefined, height: field.height ? field.height : undefined, maxWidth: field.maxWidth ? field.maxWidth : undefined, maxHeight: field.maxHeight ? field.maxHeight : undefined, reduceImage: field.reduceImage ? field.reduceImage : undefined }), this._error_label(field)] })] }));
|
|
419
|
+
case "pdf":
|
|
420
|
+
return (_jsxs(_Fragment, { children: [this.getFieldLabelTitle(field), _jsxs("div", { className: "col-md-10", children: [_jsx(DsPdf, { item_id: field.name, readOnly: this.props.read_only ? this.props.read_only : false, Caption: `${this.getFieldPrompt(field)} ...`, data: this.getFieldData(field.name), uploadPdf: (UploadFile) => { this.setFieldData(field.name, UploadFile.data); this.checkValidation(field); }, pictureStyle: "pic", buttonStyle: "btn btn-secondary" }), this._error_label(field)] })] }));
|
|
418
421
|
case "email":
|
|
419
422
|
return this._email_field(field);
|
|
420
423
|
case "text":
|
|
@@ -466,7 +469,7 @@ export class DsDynamicForm extends Component {
|
|
|
466
469
|
if (buttonIsHidden)
|
|
467
470
|
return (_jsx(_Fragment, {}));
|
|
468
471
|
else {
|
|
469
|
-
return (_jsx(ReactstrapCol, {
|
|
472
|
+
return (_jsx(ReactstrapCol, { xs: "12", sm: "12", md: "6", lg: "4", children: _jsx(Button, { id: "dsdf_clear_button", block: true, className: "btn-round", color: "danger", outline: true, type: "reset", onClick: () => { this.clearForm(); }, children: buttonCaption }) }));
|
|
470
473
|
}
|
|
471
474
|
};
|
|
472
475
|
this._submitButton = () => {
|
|
@@ -475,7 +478,7 @@ export class DsDynamicForm extends Component {
|
|
|
475
478
|
if (buttonIsHidden)
|
|
476
479
|
return (_jsx(_Fragment, {}));
|
|
477
480
|
else {
|
|
478
|
-
return (_jsx(ReactstrapCol, {
|
|
481
|
+
return (_jsx(ReactstrapCol, { xs: "12", sm: "12", md: "6", lg: "4", children: _jsx(Button, { id: "dsdf_submit_button", block: true, className: "btn-round", color: "danger", outline: true, type: "submit", onClick: () => { this.onClickSubmitFormHandler(); }, children: buttonCaption }) }));
|
|
479
482
|
}
|
|
480
483
|
};
|
|
481
484
|
this.render = () => {
|
|
@@ -491,11 +494,11 @@ export class DsDynamicForm extends Component {
|
|
|
491
494
|
return (_jsx("div", { children: this._rowRendering(row) }, rowIndex));
|
|
492
495
|
}) }, pageIndex));
|
|
493
496
|
}) }), _jsxs(ReactstrapRow, { id: "dsdf_buttons_container", className: "buttons-row", children: [this._cancelButton(), this._submitButton(), this.props.custom_button_caption &&
|
|
494
|
-
_jsx(ReactstrapCol, {
|
|
497
|
+
_jsx(ReactstrapCol, { xs: "12", sm: "12", md: "6", lg: "4", children: _jsx(Button, { id: "dsdf_custom_button", block: true, className: "btn-round", color: "primary", type: "submit", onClick: (e) => { if (this.props.custom_button_handler)
|
|
495
498
|
this.props.custom_button_handler(this.state.form);
|
|
496
499
|
else
|
|
497
500
|
console.error("custom_button_handler unset !"); }, children: this.props.custom_button_caption }) }), this.props.custom_button_caption2 &&
|
|
498
|
-
_jsx(ReactstrapCol, {
|
|
501
|
+
_jsx(ReactstrapCol, { xs: "12", sm: "12", md: "6", lg: "4", children: _jsx(Button, { id: "dsdf_custom_button2", block: true, className: "btn-round", color: "primary", type: "submit", onClick: (e) => { if (this.props.custom_button_handler2)
|
|
499
502
|
this.props.custom_button_handler2(this.state.form);
|
|
500
503
|
else
|
|
501
504
|
console.error("custom_button_handler2 unset !"); }, children: this.props.custom_button_caption2 }) })] })] }));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datasync-dynamic-form",
|
|
3
3
|
"description": "Datasync Dynamic Form component",
|
|
4
|
-
"version": "1.2
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"main": "dist/DsDynamicForm.js",
|
|
6
6
|
"module": "dist/DsDynamicForm.js",
|
|
7
7
|
"types": "dist/types/DsDynamicForm.d.ts",
|
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
"license": "ISC",
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"axios": "^1.7.2",
|
|
38
|
-
"datasync-blob": "^1.1.
|
|
38
|
+
"datasync-blob": "^1.1.10",
|
|
39
|
+
"datasync-pdf": "^0.0.1",
|
|
40
|
+
"runscripts": "^0.0.1"
|
|
39
41
|
}
|
|
40
42
|
}
|