@tsed/react-formio 1.10.6 → 1.10.10
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 +43 -18
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +39 -15
- package/dist/index.modern.js.map +1 -1
- package/package.json +5 -4
- package/src/components/card/card.component.spec.tsx +2 -2
- package/src/components/card/card.component.tsx +2 -4
- package/src/components/form/useForm.hook.ts +11 -0
- package/src/components/form-builder/formBuilder.component.tsx +2 -0
- package/src/components/forms-table/components/formCell.component.tsx +2 -2
- 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/table/components/{cell.component.tsx → defaultCell.component.tsx} +4 -1
- package/src/components/table/components/defaultOperationButton.component.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
|
@@ -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
|
}));
|
|
@@ -1897,11 +1903,10 @@ function Card({
|
|
|
1897
1903
|
}, React.createElement("div", {
|
|
1898
1904
|
className: "card-header "
|
|
1899
1905
|
}, React.createElement("h4", {
|
|
1900
|
-
className: "card-title"
|
|
1901
|
-
role: "card-heading"
|
|
1906
|
+
className: "card-title"
|
|
1902
1907
|
}, label)), React.createElement("div", {
|
|
1903
1908
|
className: "card-body",
|
|
1904
|
-
role: "
|
|
1909
|
+
role: "article"
|
|
1905
1910
|
}, children));
|
|
1906
1911
|
}
|
|
1907
1912
|
|
|
@@ -1994,6 +1999,16 @@ const useForm = props => {
|
|
|
1994
1999
|
createWebForm(src, options);
|
|
1995
2000
|
}
|
|
1996
2001
|
}, [src]);
|
|
2002
|
+
useEffect(() => {
|
|
2003
|
+
if (form) {
|
|
2004
|
+
createWebForm(form, options);
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2007
|
+
return () => {
|
|
2008
|
+
isLoaded.current = false;
|
|
2009
|
+
instance.current && instance.current.destroy(true);
|
|
2010
|
+
};
|
|
2011
|
+
}, []);
|
|
1997
2012
|
useEffect(() => {
|
|
1998
2013
|
props.onSubmit && events.current.set("onSubmit", props.onSubmit);
|
|
1999
2014
|
}, [props.onSubmit, events]);
|
|
@@ -8343,7 +8358,7 @@ function FormsCell(props) {
|
|
|
8343
8358
|
className: 'badge bg-light mr-1'
|
|
8344
8359
|
}, React.createElement("i", {
|
|
8345
8360
|
className: classnames(iconClass(undefined, "history"), "mr-1")
|
|
8346
|
-
}), React.createElement("span", null, "Updated ", moment(form.modified).fromNow())), (form.tags || []).map((tag, index) => React.createElement("
|
|
8361
|
+
}), React.createElement("span", null, "Updated ", moment(form.modified).fromNow())), (form.tags || []).map((tag, index) => React.createElement("button", {
|
|
8347
8362
|
key: index,
|
|
8348
8363
|
className: 'badge badge-hover bg-secondary mr-1',
|
|
8349
8364
|
onClick: stopPropagationWrapper(() => {
|
|
@@ -8446,6 +8461,7 @@ function Modal(_ref) {
|
|
|
8446
8461
|
}
|
|
8447
8462
|
|
|
8448
8463
|
return React.createElement("div", {
|
|
8464
|
+
role: "dialog",
|
|
8449
8465
|
className: `formio-dialog formio-dialog-theme-default ${className}`
|
|
8450
8466
|
}, React.createElement("div", {
|
|
8451
8467
|
className: 'formio-dialog-overlay',
|
|
@@ -8485,7 +8501,7 @@ function RemoveModalFooter({
|
|
|
8485
8501
|
valueToCompare,
|
|
8486
8502
|
onSubmit,
|
|
8487
8503
|
onClose,
|
|
8488
|
-
i18n =
|
|
8504
|
+
i18n = f => f
|
|
8489
8505
|
}) {
|
|
8490
8506
|
return React.createElement("div", {
|
|
8491
8507
|
className: "flex items-center justify-center bg-white p-2"
|
|
@@ -8507,16 +8523,23 @@ function RemoveModalFooter({
|
|
|
8507
8523
|
}), i18n("Remove")));
|
|
8508
8524
|
}
|
|
8509
8525
|
|
|
8510
|
-
function RemoveModal(
|
|
8526
|
+
function RemoveModal(_ref) {
|
|
8511
8527
|
var _props$itemType, _props$itemType2;
|
|
8512
8528
|
|
|
8529
|
+
let {
|
|
8530
|
+
maxWidth = "300px",
|
|
8531
|
+
children
|
|
8532
|
+
} = _ref,
|
|
8533
|
+
props = _objectWithoutPropertiesLoose(_ref, ["maxWidth", "children"]);
|
|
8534
|
+
|
|
8513
8535
|
const {
|
|
8514
8536
|
i18n = noop
|
|
8515
8537
|
} = props;
|
|
8516
8538
|
const [value, setValue] = useState();
|
|
8517
8539
|
return React.createElement(Modal, Object.assign({}, props, {
|
|
8540
|
+
className: classnames(props.className, "formio-dialog-theme-remove"),
|
|
8518
8541
|
style: {
|
|
8519
|
-
maxWidth
|
|
8542
|
+
maxWidth
|
|
8520
8543
|
},
|
|
8521
8544
|
title: `Drop ${(_props$itemType = props.itemType) == null ? void 0 : _props$itemType.toLowerCase()}`,
|
|
8522
8545
|
value: value,
|
|
@@ -8525,7 +8548,7 @@ function RemoveModal(props) {
|
|
|
8525
8548
|
className: "px-4 pt-3 pb-5"
|
|
8526
8549
|
}, React.createElement("div", {
|
|
8527
8550
|
className: "pb-1"
|
|
8528
|
-
}, 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, {
|
|
8551
|
+
}, 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, {
|
|
8529
8552
|
name: 'remove',
|
|
8530
8553
|
value: value,
|
|
8531
8554
|
onChange: (name, value) => setValue(value)
|
|
@@ -21766,6 +21789,7 @@ class ReactComponent extends Components$1.components.field {
|
|
|
21766
21789
|
|
|
21767
21790
|
|
|
21768
21791
|
attachReact(element) {
|
|
21792
|
+
// eslint-disable-next-line react/no-render-return-value
|
|
21769
21793
|
return reactDom.render(this.renderReact(), element);
|
|
21770
21794
|
}
|
|
21771
21795
|
/**
|
|
@@ -21842,7 +21866,7 @@ class ReactComponent extends Components$1.components.field {
|
|
|
21842
21866
|
|
|
21843
21867
|
}
|
|
21844
21868
|
|
|
21845
|
-
function
|
|
21869
|
+
function DefaultCell({
|
|
21846
21870
|
value,
|
|
21847
21871
|
render = f => f
|
|
21848
21872
|
}) {
|
|
@@ -21871,7 +21895,7 @@ function mapFormToColumns(form) {
|
|
|
21871
21895
|
const column = {
|
|
21872
21896
|
Header: component.label || component.title || component.key,
|
|
21873
21897
|
accessor: `data.${component.key}`,
|
|
21874
|
-
Cell: props => React.createElement(
|
|
21898
|
+
Cell: props => React.createElement(DefaultCell, Object.assign({}, props, {
|
|
21875
21899
|
render: value => cmp.asString(value)
|
|
21876
21900
|
}))
|
|
21877
21901
|
};
|
|
@@ -22020,5 +22044,5 @@ Loader.propTypes = {
|
|
|
22020
22044
|
className: PropTypes.string
|
|
22021
22045
|
};
|
|
22022
22046
|
|
|
22023
|
-
export { ACTION, ACTIONS, ACTION_INFO, AUTH, ActionsTable, Alert, ButtonTab, Card,
|
|
22047
|
+
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 };
|
|
22024
22048
|
//# sourceMappingURL=index.modern.js.map
|