@tsed/react-formio 1.10.7 → 1.10.11
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/.eslintrc +7 -2
- package/dist/components/modal/removeModal.component.d.ts +3 -2
- package/dist/components/table/components/defaultCell.component.d.ts +2 -0
- package/dist/components/table/index.d.ts +1 -1
- package/dist/index.js +40 -23
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +36 -20
- package/dist/index.modern.js.map +1 -1
- package/package.json +5 -4
- package/src/components/actions-table/actionsTable.component.spec.tsx +15 -17
- package/src/components/actions-table/actionsTable.component.tsx +1 -0
- package/src/components/card/card.component.spec.tsx +2 -2
- package/src/components/card/card.component.tsx +2 -4
- package/src/components/form-builder/formBuilder.component.tsx +2 -0
- package/src/components/form-settings/formSettings.component.tsx +1 -0
- package/src/components/forms-table/components/formCell.component.tsx +2 -2
- package/src/components/input-text/inputText.component.tsx +1 -1
- package/src/components/loader/loader.component.spec.tsx +2 -2
- package/src/components/loader/loader.component.tsx +1 -1
- package/src/components/modal/modal.component.spec.tsx +3 -3
- package/src/components/modal/modal.component.tsx +6 -1
- package/src/components/modal/modal.stories.tsx +5 -21
- package/src/components/modal/removeModal.component.tsx +11 -4
- package/src/components/react-component/reactComponent.component.tsx +1 -0
- package/src/components/select/select.component.tsx +1 -1
- package/src/components/table/components/{cell.component.tsx → defaultCell.component.tsx} +4 -1
- package/src/components/table/components/defaultOperationButton.component.tsx +2 -2
- package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +2 -2
- package/src/components/table/index.ts +1 -1
- package/src/components/table/table.component.tsx +16 -5
- package/src/components/table/utils/mapFormToColumns.tsx +6 -3
- package/src/components/tabs/tabs.component.stories.tsx +1 -1
- package/dist/components/table/components/cell.component.d.ts +0 -2
package/dist/index.modern.js
CHANGED
|
@@ -1268,7 +1268,7 @@ function Select(_ref) {
|
|
|
1268
1268
|
}, React.createElement("select", Object.assign({
|
|
1269
1269
|
ref: ref
|
|
1270
1270
|
}, props, {
|
|
1271
|
-
"data-testid":
|
|
1271
|
+
"data-testid": `select_${name}`,
|
|
1272
1272
|
className: classnames("form-control", size && `form-control-${size}`),
|
|
1273
1273
|
name: name,
|
|
1274
1274
|
id: name,
|
|
@@ -1510,7 +1510,7 @@ function InputText(_ref) {
|
|
|
1510
1510
|
}, React.createElement("input", Object.assign({
|
|
1511
1511
|
type: type || "text"
|
|
1512
1512
|
}, props, {
|
|
1513
|
-
"data-testid":
|
|
1513
|
+
"data-testid": `input_${name}`,
|
|
1514
1514
|
className: classnames("form-control", size && `form-control-${size}`),
|
|
1515
1515
|
id: name,
|
|
1516
1516
|
required: required,
|
|
@@ -1579,7 +1579,7 @@ function DefaultOperationButton(props) {
|
|
|
1579
1579
|
title = "",
|
|
1580
1580
|
i18n = f => f
|
|
1581
1581
|
} = props;
|
|
1582
|
-
return React.createElement("
|
|
1582
|
+
return React.createElement("button", {
|
|
1583
1583
|
className: classnames(className, ["btn", buttonOutline && "outline", buttonType].filter(Boolean).join("-"), `btn-${buttonSize}`),
|
|
1584
1584
|
onClick: stopPropagationWrapper(() => onClick(action))
|
|
1585
1585
|
}, icon ? React.createElement(React.Fragment, null, React.createElement("i", {
|
|
@@ -1755,13 +1755,18 @@ function Table(props) {
|
|
|
1755
1755
|
className: classnames("table-group table-responsive", className)
|
|
1756
1756
|
}, React.createElement("table", Object.assign({
|
|
1757
1757
|
className: "table table-striped table-hover"
|
|
1758
|
-
}, tableInstance.getTableProps()), React.createElement("thead", null, tableInstance.headerGroups.map(headerGroup
|
|
1758
|
+
}, tableInstance.getTableProps()), React.createElement("thead", null, tableInstance.headerGroups.map((headerGroup, i) => React.createElement("tr", Object.assign({
|
|
1759
|
+
key: `tableInstance.headerGroups${i}`
|
|
1760
|
+
}, headerGroup.getHeaderGroupProps()), headerGroup.headers.map(column => React.createElement("th", Object.assign({
|
|
1761
|
+
key: `tableInstance.headers.column.${column.id}`
|
|
1762
|
+
}, column.getHeaderProps()), React.createElement(CellHeader, {
|
|
1759
1763
|
column: column
|
|
1760
|
-
})))))), !isLoading ? React.createElement("tbody", Object.assign({}, tableInstance.getTableBodyProps()), tableInstance.page.map(
|
|
1764
|
+
})))))), !isLoading ? React.createElement("tbody", Object.assign({}, tableInstance.getTableBodyProps()), tableInstance.page.map(row => {
|
|
1761
1765
|
tableInstance.prepareRow(row);
|
|
1762
1766
|
return React.createElement("tr", Object.assign({
|
|
1767
|
+
key: `tableInstance.page.${row.id}`,
|
|
1763
1768
|
onClick: () => _onClick(row.original, "row")
|
|
1764
|
-
}, row.getRowProps()), row.cells.map(cell => {
|
|
1769
|
+
}, row.getRowProps()), row.cells.map((cell, i) => {
|
|
1765
1770
|
const {
|
|
1766
1771
|
hidden,
|
|
1767
1772
|
colspan
|
|
@@ -1772,6 +1777,7 @@ function Table(props) {
|
|
|
1772
1777
|
}
|
|
1773
1778
|
|
|
1774
1779
|
return React.createElement("td", Object.assign({
|
|
1780
|
+
key: `tableInstance.page.cells.${cell.value || "value"}.${i}`,
|
|
1775
1781
|
colSpan: colspan
|
|
1776
1782
|
}, cell.getCellProps()), cell.render("Cell"));
|
|
1777
1783
|
}));
|
|
@@ -1827,7 +1833,8 @@ function ActionsTable(_ref) {
|
|
|
1827
1833
|
"data-testid": "submit",
|
|
1828
1834
|
disabled: currentAction === "",
|
|
1829
1835
|
className: "btn btn-success",
|
|
1830
|
-
onClick: () => currentAction && onAddAction(currentAction)
|
|
1836
|
+
onClick: () => currentAction && onAddAction(currentAction),
|
|
1837
|
+
type: "submit"
|
|
1831
1838
|
}, React.createElement("i", {
|
|
1832
1839
|
className: classnames(iconClass(undefined, "plus"), "mr-1")
|
|
1833
1840
|
}), " ", i18n("Add action")))));
|
|
@@ -1897,11 +1904,10 @@ function Card({
|
|
|
1897
1904
|
}, React.createElement("div", {
|
|
1898
1905
|
className: "card-header "
|
|
1899
1906
|
}, React.createElement("h4", {
|
|
1900
|
-
className: "card-title"
|
|
1901
|
-
role: "card-heading"
|
|
1907
|
+
className: "card-title"
|
|
1902
1908
|
}, label)), React.createElement("div", {
|
|
1903
1909
|
className: "card-body",
|
|
1904
|
-
role: "
|
|
1910
|
+
role: "article"
|
|
1905
1911
|
}, children));
|
|
1906
1912
|
}
|
|
1907
1913
|
|
|
@@ -3199,7 +3205,8 @@ function FormSettings(props) {
|
|
|
3199
3205
|
"data-testid": 'submit',
|
|
3200
3206
|
disabled: !isValid,
|
|
3201
3207
|
className: "mt-5 btn btn-primary",
|
|
3202
|
-
onClick: onSubmit
|
|
3208
|
+
onClick: onSubmit,
|
|
3209
|
+
type: "submit"
|
|
3203
3210
|
}, i18n("Save settings")));
|
|
3204
3211
|
}
|
|
3205
3212
|
|
|
@@ -8353,7 +8360,7 @@ function FormsCell(props) {
|
|
|
8353
8360
|
className: 'badge bg-light mr-1'
|
|
8354
8361
|
}, React.createElement("i", {
|
|
8355
8362
|
className: classnames(iconClass(undefined, "history"), "mr-1")
|
|
8356
|
-
}), React.createElement("span", null, "Updated ", moment(form.modified).fromNow())), (form.tags || []).map((tag, index) => React.createElement("
|
|
8363
|
+
}), React.createElement("span", null, "Updated ", moment(form.modified).fromNow())), (form.tags || []).map((tag, index) => React.createElement("button", {
|
|
8357
8364
|
key: index,
|
|
8358
8365
|
className: 'badge badge-hover bg-secondary mr-1',
|
|
8359
8366
|
onClick: stopPropagationWrapper(() => {
|
|
@@ -8456,6 +8463,7 @@ function Modal(_ref) {
|
|
|
8456
8463
|
}
|
|
8457
8464
|
|
|
8458
8465
|
return React.createElement("div", {
|
|
8466
|
+
role: "dialog",
|
|
8459
8467
|
className: `formio-dialog formio-dialog-theme-default ${className}`
|
|
8460
8468
|
}, React.createElement("div", {
|
|
8461
8469
|
className: 'formio-dialog-overlay',
|
|
@@ -8495,7 +8503,7 @@ function RemoveModalFooter({
|
|
|
8495
8503
|
valueToCompare,
|
|
8496
8504
|
onSubmit,
|
|
8497
8505
|
onClose,
|
|
8498
|
-
i18n =
|
|
8506
|
+
i18n = f => f
|
|
8499
8507
|
}) {
|
|
8500
8508
|
return React.createElement("div", {
|
|
8501
8509
|
className: "flex items-center justify-center bg-white p-2"
|
|
@@ -8517,16 +8525,23 @@ function RemoveModalFooter({
|
|
|
8517
8525
|
}), i18n("Remove")));
|
|
8518
8526
|
}
|
|
8519
8527
|
|
|
8520
|
-
function RemoveModal(
|
|
8528
|
+
function RemoveModal(_ref) {
|
|
8521
8529
|
var _props$itemType, _props$itemType2;
|
|
8522
8530
|
|
|
8531
|
+
let {
|
|
8532
|
+
maxWidth = "300px",
|
|
8533
|
+
children
|
|
8534
|
+
} = _ref,
|
|
8535
|
+
props = _objectWithoutPropertiesLoose(_ref, ["maxWidth", "children"]);
|
|
8536
|
+
|
|
8523
8537
|
const {
|
|
8524
8538
|
i18n = noop
|
|
8525
8539
|
} = props;
|
|
8526
8540
|
const [value, setValue] = useState();
|
|
8527
8541
|
return React.createElement(Modal, Object.assign({}, props, {
|
|
8542
|
+
className: classnames(props.className, "formio-dialog-theme-remove"),
|
|
8528
8543
|
style: {
|
|
8529
|
-
maxWidth
|
|
8544
|
+
maxWidth
|
|
8530
8545
|
},
|
|
8531
8546
|
title: `Drop ${(_props$itemType = props.itemType) == null ? void 0 : _props$itemType.toLowerCase()}`,
|
|
8532
8547
|
value: value,
|
|
@@ -8535,7 +8550,7 @@ function RemoveModal(props) {
|
|
|
8535
8550
|
className: "px-4 pt-3 pb-5"
|
|
8536
8551
|
}, React.createElement("div", {
|
|
8537
8552
|
className: "pb-1"
|
|
8538
|
-
}, i18n("To drop"), " ", React.createElement("strong", null, props.valueToCompare), ",\u00A0", i18n("type the"), "\u00A0", React.createElement("strong", null, "\"", (_props$itemType2 = props.itemType) == null ? void 0 : _props$itemType2.toLowerCase(), "\""), "\u00A0", i18n("name"), " ", React.createElement("strong", null, "\"", props.valueToCompare, "\""), "."), React.createElement(InputText, {
|
|
8553
|
+
}, children, i18n("To drop"), " ", React.createElement("strong", null, props.valueToCompare), ",\u00A0", i18n("type the"), "\u00A0", React.createElement("strong", null, "\"", (_props$itemType2 = props.itemType) == null ? void 0 : _props$itemType2.toLowerCase(), "\""), "\u00A0", i18n("name"), " ", React.createElement("strong", null, "\"", props.valueToCompare, "\""), "."), React.createElement(InputText, {
|
|
8539
8554
|
name: 'remove',
|
|
8540
8555
|
value: value,
|
|
8541
8556
|
onChange: (name, value) => setValue(value)
|
|
@@ -21776,6 +21791,7 @@ class ReactComponent extends Components$1.components.field {
|
|
|
21776
21791
|
|
|
21777
21792
|
|
|
21778
21793
|
attachReact(element) {
|
|
21794
|
+
// eslint-disable-next-line react/no-render-return-value
|
|
21779
21795
|
return reactDom.render(this.renderReact(), element);
|
|
21780
21796
|
}
|
|
21781
21797
|
/**
|
|
@@ -21852,7 +21868,7 @@ class ReactComponent extends Components$1.components.field {
|
|
|
21852
21868
|
|
|
21853
21869
|
}
|
|
21854
21870
|
|
|
21855
|
-
function
|
|
21871
|
+
function DefaultCell({
|
|
21856
21872
|
value,
|
|
21857
21873
|
render = f => f
|
|
21858
21874
|
}) {
|
|
@@ -21881,7 +21897,7 @@ function mapFormToColumns(form) {
|
|
|
21881
21897
|
const column = {
|
|
21882
21898
|
Header: component.label || component.title || component.key,
|
|
21883
21899
|
accessor: `data.${component.key}`,
|
|
21884
|
-
Cell: props => React.createElement(
|
|
21900
|
+
Cell: props => React.createElement(DefaultCell, Object.assign({}, props, {
|
|
21885
21901
|
render: value => cmp.asString(value)
|
|
21886
21902
|
}))
|
|
21887
21903
|
};
|
|
@@ -22015,7 +22031,7 @@ function Loader({
|
|
|
22015
22031
|
return React.createElement("div", {
|
|
22016
22032
|
className: classnames("opacity-85 z-20 flex items-center justify-center p-5 absolute top-0 right-0 left-0 bottom-0 bg-white", className)
|
|
22017
22033
|
}, React.createElement("span", {
|
|
22018
|
-
"data-testid":
|
|
22034
|
+
"data-testid": `icon_${icon}`,
|
|
22019
22035
|
color: color,
|
|
22020
22036
|
className: `text-11xl ${iconClass(undefined, icon, true)}`
|
|
22021
22037
|
}));
|
|
@@ -22030,5 +22046,5 @@ Loader.propTypes = {
|
|
|
22030
22046
|
className: PropTypes.string
|
|
22031
22047
|
};
|
|
22032
22048
|
|
|
22033
|
-
export { ACTION, ACTIONS, ACTION_INFO, AUTH, ActionsTable, Alert, ButtonTab, Card,
|
|
22049
|
+
export { ACTION, ACTIONS, ACTION_INFO, AUTH, ActionsTable, Alert, ButtonTab, Card, DefaultArrowSort, DefaultCell, DefaultCellHeader, DefaultCellOperations, DefaultColumnFilter, DefaultOperationButton, Form, FormAccess, FormAction, FormBuilder, FormControl, FormEdit, FormEditCTAs, FormParameters, FormSettings, FormsTable, InputTags, InputText, Loader, Modal, Pagination, ReactComponent, RemoveModal, Select, SelectColumnFilter, SliderColumnFilter, SubmissionsTable, Table, Tabs, actionInfoReducer, actionReducer, actionsReducer, authReducer, checkRoleFormAccess, clearActionError, clearFormError, clearSubmissionError, createInitialState$7 as createInitialState, defaultDisplayChoices, defaultFormioReducer, deleteAction, deleteForm, deleteSubmission, failAction, failActionInfo, failActions, failForm, failForms, failSubmission, failSubmissions, failUser, formAccessUser, formReducer, formsReducer, getAccess, getAction, getActionInfo, getActionUrl, getActions, getForm, getFormUrl, getForms, getProjectAccess, getSubmission, getSubmissionUrl, getSubmissions, hasRole, hasRoles, iconClass, initAuth, isAuthorized, logout, logoutUser, oneOfIsActive, projectAccessUser, receiveAction, receiveActionInfo, receiveActions, receiveForm, receiveForms, receiveSubmission, receiveSubmissions, receiveUser, refreshForms, refreshSubmissions, requestAction, requestActionInfo, requestActions, requestForm, requestForms, requestSubmission, requestSubmissions, requestUser, resetAction, resetActionInfo, resetActions, resetForm, resetForms, resetSubmission, resetSubmissions, saveAction, saveForm, saveSubmission, selectAction, selectActionInfo, selectActions, selectAuth, selectAvailableActions, selectError, selectForm, selectForms, selectFormsParameters, selectIsActive, selectIsAuthenticated, selectRoles, selectRoot, selectSubmission, selectSubmissions, selectSubmissionsParameters, selectUser, sendAction, sendForm, sendSubmission, setUser, submissionAccessUser, submissionReducer, submissionsReducer, useModal, useOperations, useTooltip, userForms, userRoles };
|
|
22034
22050
|
//# sourceMappingURL=index.modern.js.map
|