@tsed/react-formio 1.10.5 → 1.10.9
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/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 +32 -14
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +30 -13
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -4
- package/src/components/form/useForm.hook.ts +20 -8
- package/src/components/modal/removeModal.component.tsx +11 -4
- package/src/components/table/components/{cell.component.tsx → defaultCell.component.tsx} +4 -1
- package/src/components/table/index.ts +1 -1
- package/src/components/table/utils/mapFormToColumns.tsx +6 -3
- package/dist/components/table/components/cell.component.d.ts +0 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
2
|
import { ModalProps } from "./modal.component";
|
|
3
3
|
export interface RemoveModalProps extends ModalProps {
|
|
4
4
|
valueToCompare: string;
|
|
5
5
|
itemType?: string;
|
|
6
6
|
i18n?: (f: string) => string;
|
|
7
|
+
maxWidth?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare function RemoveModal(props: RemoveModalProps): JSX.Element;
|
|
9
|
+
export declare function RemoveModal({ maxWidth, children, ...props }: PropsWithChildren<RemoveModalProps>): JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./utils/useOperations.hook";
|
|
2
|
-
export * from "./components/cell.component";
|
|
3
2
|
export * from "./components/defaultArrowSort.component";
|
|
3
|
+
export * from "./components/defaultCell.component";
|
|
4
4
|
export * from "./components/defaultCellHeader.component";
|
|
5
5
|
export * from "./components/defaultCellHeader.component";
|
|
6
6
|
export * from "./components/defaultCellOperations.component";
|
package/dist/index.js
CHANGED
|
@@ -2530,12 +2530,6 @@ var useForm = function useForm(props) {
|
|
|
2530
2530
|
});
|
|
2531
2531
|
}
|
|
2532
2532
|
|
|
2533
|
-
React.useEffect(function () {
|
|
2534
|
-
props.onSubmit && events.current.set("onSubmit", props.onSubmit);
|
|
2535
|
-
}, [props.onSubmit, events]);
|
|
2536
|
-
React.useEffect(function () {
|
|
2537
|
-
props.onSubmitDone && events.current.set("onSubmitDone", props.onSubmit);
|
|
2538
|
-
}, [props.onSubmitDone, events]);
|
|
2539
2533
|
return instance.current;
|
|
2540
2534
|
};
|
|
2541
2535
|
|
|
@@ -2567,6 +2561,22 @@ var useForm = function useForm(props) {
|
|
|
2567
2561
|
createWebForm(src, options);
|
|
2568
2562
|
}
|
|
2569
2563
|
}, [src]);
|
|
2564
|
+
React.useEffect(function () {
|
|
2565
|
+
if (form) {
|
|
2566
|
+
createWebForm(form, options);
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
return function () {
|
|
2570
|
+
isLoaded.current = false;
|
|
2571
|
+
instance.current && instance.current.destroy(true);
|
|
2572
|
+
};
|
|
2573
|
+
}, []);
|
|
2574
|
+
React.useEffect(function () {
|
|
2575
|
+
props.onSubmit && events.current.set("onSubmit", props.onSubmit);
|
|
2576
|
+
}, [props.onSubmit, events]);
|
|
2577
|
+
React.useEffect(function () {
|
|
2578
|
+
props.onSubmitDone && events.current.set("onSubmitDone", props.onSubmitDone);
|
|
2579
|
+
}, [props.onSubmitDone, events]);
|
|
2570
2580
|
return {
|
|
2571
2581
|
element: element
|
|
2572
2582
|
};
|
|
@@ -9172,7 +9182,9 @@ function RemoveModalFooter(_ref) {
|
|
|
9172
9182
|
onSubmit = _ref.onSubmit,
|
|
9173
9183
|
onClose = _ref.onClose,
|
|
9174
9184
|
_ref$i18n = _ref.i18n,
|
|
9175
|
-
i18n = _ref$i18n === void 0 ?
|
|
9185
|
+
i18n = _ref$i18n === void 0 ? function (f) {
|
|
9186
|
+
return f;
|
|
9187
|
+
} : _ref$i18n;
|
|
9176
9188
|
return React__default['default'].createElement("div", {
|
|
9177
9189
|
className: "flex items-center justify-center bg-white p-2"
|
|
9178
9190
|
}, React__default['default'].createElement("button", {
|
|
@@ -9193,9 +9205,14 @@ function RemoveModalFooter(_ref) {
|
|
|
9193
9205
|
}), i18n("Remove")));
|
|
9194
9206
|
}
|
|
9195
9207
|
|
|
9196
|
-
function RemoveModal(
|
|
9208
|
+
function RemoveModal(_ref2) {
|
|
9197
9209
|
var _props$itemType, _props$itemType2;
|
|
9198
9210
|
|
|
9211
|
+
var _ref2$maxWidth = _ref2.maxWidth,
|
|
9212
|
+
maxWidth = _ref2$maxWidth === void 0 ? "300px" : _ref2$maxWidth,
|
|
9213
|
+
children = _ref2.children,
|
|
9214
|
+
props = _objectWithoutPropertiesLoose(_ref2, ["maxWidth", "children"]);
|
|
9215
|
+
|
|
9199
9216
|
var _props$i18n = props.i18n,
|
|
9200
9217
|
i18n = _props$i18n === void 0 ? noop__default['default'] : _props$i18n;
|
|
9201
9218
|
|
|
@@ -9204,8 +9221,9 @@ function RemoveModal(props) {
|
|
|
9204
9221
|
setValue = _useState[1];
|
|
9205
9222
|
|
|
9206
9223
|
return React__default['default'].createElement(Modal, Object.assign({}, props, {
|
|
9224
|
+
className: classnames(props.className, "formio-dialog-theme-remove"),
|
|
9207
9225
|
style: {
|
|
9208
|
-
maxWidth:
|
|
9226
|
+
maxWidth: maxWidth
|
|
9209
9227
|
},
|
|
9210
9228
|
title: "Drop " + ((_props$itemType = props.itemType) == null ? void 0 : _props$itemType.toLowerCase()),
|
|
9211
9229
|
value: value,
|
|
@@ -9214,7 +9232,7 @@ function RemoveModal(props) {
|
|
|
9214
9232
|
className: "px-4 pt-3 pb-5"
|
|
9215
9233
|
}, React__default['default'].createElement("div", {
|
|
9216
9234
|
className: "pb-1"
|
|
9217
|
-
}, i18n("To drop"), " ", React__default['default'].createElement("strong", null, props.valueToCompare), ",\xA0", i18n("type the"), "\xA0", React__default['default'].createElement("strong", null, "\"", (_props$itemType2 = props.itemType) == null ? void 0 : _props$itemType2.toLowerCase(), "\""), "\xA0", i18n("name"), " ", React__default['default'].createElement("strong", null, "\"", props.valueToCompare, "\""), "."), React__default['default'].createElement(InputText, {
|
|
9235
|
+
}, children, i18n("To drop"), " ", React__default['default'].createElement("strong", null, props.valueToCompare), ",\xA0", i18n("type the"), "\xA0", React__default['default'].createElement("strong", null, "\"", (_props$itemType2 = props.itemType) == null ? void 0 : _props$itemType2.toLowerCase(), "\""), "\xA0", i18n("name"), " ", React__default['default'].createElement("strong", null, "\"", props.valueToCompare, "\""), "."), React__default['default'].createElement(InputText, {
|
|
9218
9236
|
name: 'remove',
|
|
9219
9237
|
value: value,
|
|
9220
9238
|
onChange: function onChange(name, value) {
|
|
@@ -22723,7 +22741,7 @@ var ReactComponent = /*#__PURE__*/function (_Components$component) {
|
|
|
22723
22741
|
return ReactComponent;
|
|
22724
22742
|
}(formiojs.Components.components.field);
|
|
22725
22743
|
|
|
22726
|
-
function
|
|
22744
|
+
function DefaultCell(_ref) {
|
|
22727
22745
|
var value = _ref.value,
|
|
22728
22746
|
_ref$render = _ref.render,
|
|
22729
22747
|
render = _ref$render === void 0 ? function (f) {
|
|
@@ -22755,8 +22773,8 @@ function mapFormToColumns(form) {
|
|
|
22755
22773
|
var column = {
|
|
22756
22774
|
Header: component.label || component.title || component.key,
|
|
22757
22775
|
accessor: "data." + component.key,
|
|
22758
|
-
Cell: function Cell
|
|
22759
|
-
return React__default['default'].createElement(
|
|
22776
|
+
Cell: function Cell(props) {
|
|
22777
|
+
return React__default['default'].createElement(DefaultCell, Object.assign({}, props, {
|
|
22760
22778
|
render: function render(value) {
|
|
22761
22779
|
return cmp.asString(value);
|
|
22762
22780
|
}
|
|
@@ -22975,8 +22993,8 @@ exports.ActionsTable = ActionsTable;
|
|
|
22975
22993
|
exports.Alert = Alert;
|
|
22976
22994
|
exports.ButtonTab = ButtonTab;
|
|
22977
22995
|
exports.Card = Card;
|
|
22978
|
-
exports.Cell = Cell;
|
|
22979
22996
|
exports.DefaultArrowSort = DefaultArrowSort;
|
|
22997
|
+
exports.DefaultCell = DefaultCell;
|
|
22980
22998
|
exports.DefaultCellHeader = DefaultCellHeader;
|
|
22981
22999
|
exports.DefaultCellOperations = DefaultCellOperations;
|
|
22982
23000
|
exports.DefaultColumnFilter = DefaultColumnFilter;
|