@faasjs/react 8.0.0-beta.13 → 8.0.0-beta.14
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/index.cjs +2 -30
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +2 -33
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let react = require("react");
|
|
3
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
-
|
|
5
4
|
//#region src/generateId.ts
|
|
6
5
|
/**
|
|
7
6
|
* Generate random id with prefix
|
|
@@ -18,7 +17,6 @@ function generateId(prefix = "", length = 18) {
|
|
|
18
17
|
if (length < 8 || length > 18) throw new Error("Length must be 8 ~ 18");
|
|
19
18
|
return `${prefix}${Date.now().toString(36).padStart(8, "0")}${Math.random().toString(36).substring(2, length - 6).padEnd(length - 8, "0")}`;
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
//#endregion
|
|
23
21
|
//#region src/browser.ts
|
|
24
22
|
/**
|
|
@@ -661,7 +659,6 @@ var FaasBrowserClient = class {
|
|
|
661
659
|
});
|
|
662
660
|
}
|
|
663
661
|
};
|
|
664
|
-
|
|
665
662
|
//#endregion
|
|
666
663
|
//#region src/faas.ts
|
|
667
664
|
/**
|
|
@@ -687,7 +684,6 @@ async function faas(action, params, options) {
|
|
|
687
684
|
});
|
|
688
685
|
return client.browserClient.action(action, params, options);
|
|
689
686
|
}
|
|
690
|
-
|
|
691
687
|
//#endregion
|
|
692
688
|
//#region src/equal.ts
|
|
693
689
|
const AsyncFunction = (async () => {}).constructor;
|
|
@@ -775,7 +771,6 @@ function useEqualMemo(callback, dependencies) {
|
|
|
775
771
|
function useEqualCallback(callback, dependencies) {
|
|
776
772
|
return (0, react.useCallback)((...args) => callback(...args), useEqualMemoize(dependencies));
|
|
777
773
|
}
|
|
778
|
-
|
|
779
774
|
//#endregion
|
|
780
775
|
//#region src/FaasDataWrapper.tsx
|
|
781
776
|
const fixedForwardRef = react.forwardRef;
|
|
@@ -823,7 +818,6 @@ function withFaasData(Component, faasProps) {
|
|
|
823
818
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, { ...props })
|
|
824
819
|
});
|
|
825
820
|
}
|
|
826
|
-
|
|
827
821
|
//#endregion
|
|
828
822
|
//#region src/useFaas.tsx
|
|
829
823
|
/**
|
|
@@ -951,7 +945,6 @@ function useFaas(action, defaultParams, options = {}) {
|
|
|
951
945
|
setError
|
|
952
946
|
};
|
|
953
947
|
}
|
|
954
|
-
|
|
955
948
|
//#endregion
|
|
956
949
|
//#region src/client.tsx
|
|
957
950
|
const clients = {};
|
|
@@ -1012,7 +1005,6 @@ function getClient(host) {
|
|
|
1012
1005
|
}
|
|
1013
1006
|
return client;
|
|
1014
1007
|
}
|
|
1015
|
-
|
|
1016
1008
|
//#endregion
|
|
1017
1009
|
//#region src/constant.ts
|
|
1018
1010
|
/**
|
|
@@ -1023,7 +1015,6 @@ function useConstant(fn) {
|
|
|
1023
1015
|
if (!ref.current) ref.current = { v: fn() };
|
|
1024
1016
|
return ref.current.v;
|
|
1025
1017
|
}
|
|
1026
|
-
|
|
1027
1018
|
//#endregion
|
|
1028
1019
|
//#region src/ErrorBoundary.tsx
|
|
1029
1020
|
var ErrorBoundary = class extends react.Component {
|
|
@@ -1058,7 +1049,6 @@ var ErrorBoundary = class extends react.Component {
|
|
|
1058
1049
|
return this.props.children ?? null;
|
|
1059
1050
|
}
|
|
1060
1051
|
};
|
|
1061
|
-
|
|
1062
1052
|
//#endregion
|
|
1063
1053
|
//#region src/useStateRef.ts
|
|
1064
1054
|
/**
|
|
@@ -1095,7 +1085,6 @@ function useStateRef(initialValue) {
|
|
|
1095
1085
|
ref
|
|
1096
1086
|
];
|
|
1097
1087
|
}
|
|
1098
|
-
|
|
1099
1088
|
//#endregion
|
|
1100
1089
|
//#region src/splittingState.tsx
|
|
1101
1090
|
/**
|
|
@@ -1124,7 +1113,6 @@ function useSplittingState(initialStates) {
|
|
|
1124
1113
|
}
|
|
1125
1114
|
return states;
|
|
1126
1115
|
}
|
|
1127
|
-
|
|
1128
1116
|
//#endregion
|
|
1129
1117
|
//#region src/splittingContext.tsx
|
|
1130
1118
|
/**
|
|
@@ -1207,7 +1195,6 @@ function createSplittingContext(defaultValue) {
|
|
|
1207
1195
|
use
|
|
1208
1196
|
};
|
|
1209
1197
|
}
|
|
1210
|
-
|
|
1211
1198
|
//#endregion
|
|
1212
1199
|
//#region src/Form/context.tsx
|
|
1213
1200
|
const FormContext = createSplittingContext([
|
|
@@ -1226,7 +1213,6 @@ const FormContext = createSplittingContext([
|
|
|
1226
1213
|
]);
|
|
1227
1214
|
const FormContextProvider = FormContext.Provider;
|
|
1228
1215
|
const useFormContext = FormContext.use;
|
|
1229
|
-
|
|
1230
1216
|
//#endregion
|
|
1231
1217
|
//#region src/Form/Input.tsx
|
|
1232
1218
|
function processValue(input, rules) {
|
|
@@ -1259,7 +1245,6 @@ function FormInput({ name, rules, ...rest }) {
|
|
|
1259
1245
|
});
|
|
1260
1246
|
}
|
|
1261
1247
|
FormInput.displayName = "FormInput";
|
|
1262
|
-
|
|
1263
1248
|
//#endregion
|
|
1264
1249
|
//#region src/Form/Item.tsx
|
|
1265
1250
|
function FormItem(props) {
|
|
@@ -1276,7 +1261,6 @@ function FormItem(props) {
|
|
|
1276
1261
|
});
|
|
1277
1262
|
}
|
|
1278
1263
|
FormItem.displayName = "FormItem";
|
|
1279
|
-
|
|
1280
1264
|
//#endregion
|
|
1281
1265
|
//#region src/Form/Body.tsx
|
|
1282
1266
|
function FormBody() {
|
|
@@ -1284,7 +1268,6 @@ function FormBody() {
|
|
|
1284
1268
|
return items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormItem, { ...item }, item.name));
|
|
1285
1269
|
}
|
|
1286
1270
|
FormBody.displayName = "FormBody";
|
|
1287
|
-
|
|
1288
1271
|
//#endregion
|
|
1289
1272
|
//#region src/Form/elements/Button.tsx
|
|
1290
1273
|
const FormButtonElement = (0, react.forwardRef)(({ children, submit, submitting, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -1296,7 +1279,6 @@ const FormButtonElement = (0, react.forwardRef)(({ children, submit, submitting,
|
|
|
1296
1279
|
children
|
|
1297
1280
|
}));
|
|
1298
1281
|
FormButtonElement.displayName = "FormButtonElement";
|
|
1299
|
-
|
|
1300
1282
|
//#endregion
|
|
1301
1283
|
//#region src/Form/elements/Input.tsx
|
|
1302
1284
|
const FormInputElement = (0, react.forwardRef)(({ onChange, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
@@ -1305,7 +1287,6 @@ const FormInputElement = (0, react.forwardRef)(({ onChange, ...props }, ref) =>
|
|
|
1305
1287
|
ref
|
|
1306
1288
|
}));
|
|
1307
1289
|
FormInputElement.displayName = "FormInputElement";
|
|
1308
|
-
|
|
1309
1290
|
//#endregion
|
|
1310
1291
|
//#region src/Form/elements/Label.tsx
|
|
1311
1292
|
const FormLabelElement = ({ name, title, description, error, children }) => {
|
|
@@ -1320,7 +1301,6 @@ const FormLabelElement = ({ name, title, description, error, children }) => {
|
|
|
1320
1301
|
] });
|
|
1321
1302
|
};
|
|
1322
1303
|
FormLabelElement.displayName = "FormLabelElement";
|
|
1323
|
-
|
|
1324
1304
|
//#endregion
|
|
1325
1305
|
//#region src/Form/elements/index.ts
|
|
1326
1306
|
const FormDefaultElements = {
|
|
@@ -1328,7 +1308,6 @@ const FormDefaultElements = {
|
|
|
1328
1308
|
Input: FormInputElement,
|
|
1329
1309
|
Button: FormButtonElement
|
|
1330
1310
|
};
|
|
1331
|
-
|
|
1332
1311
|
//#endregion
|
|
1333
1312
|
//#region src/Form/rules.ts
|
|
1334
1313
|
/**
|
|
@@ -1366,7 +1345,6 @@ async function validValues(rules, items, values, lang) {
|
|
|
1366
1345
|
}
|
|
1367
1346
|
return errors;
|
|
1368
1347
|
}
|
|
1369
|
-
|
|
1370
1348
|
//#endregion
|
|
1371
1349
|
//#region src/Form/Footer.tsx
|
|
1372
1350
|
function FormFooter() {
|
|
@@ -1401,7 +1379,6 @@ function FormFooter() {
|
|
|
1401
1379
|
]);
|
|
1402
1380
|
}
|
|
1403
1381
|
FormFooter.displayName = "FormFooter";
|
|
1404
|
-
|
|
1405
1382
|
//#endregion
|
|
1406
1383
|
//#region src/Form/lang.ts
|
|
1407
1384
|
const FormDefaultLang = {
|
|
@@ -1410,7 +1387,6 @@ const FormDefaultLang = {
|
|
|
1410
1387
|
string: "This field must be a string",
|
|
1411
1388
|
number: "This field must be a number"
|
|
1412
1389
|
};
|
|
1413
|
-
|
|
1414
1390
|
//#endregion
|
|
1415
1391
|
//#region src/Form/Container.tsx
|
|
1416
1392
|
function mergeValues(items, defaultValues = {}) {
|
|
@@ -1470,7 +1446,6 @@ function FormContainer({ defaultValues, Elements, rules, lang, items, ...props }
|
|
|
1470
1446
|
});
|
|
1471
1447
|
}
|
|
1472
1448
|
FormContainer.displayName = "FormContainer";
|
|
1473
|
-
|
|
1474
1449
|
//#endregion
|
|
1475
1450
|
//#region src/OptionalWrapper.tsx
|
|
1476
1451
|
/**
|
|
@@ -1499,7 +1474,6 @@ function OptionalWrapper({ condition, Wrapper, wrapperProps, children }) {
|
|
|
1499
1474
|
return children;
|
|
1500
1475
|
}
|
|
1501
1476
|
OptionalWrapper.displayName = "OptionalWrapper";
|
|
1502
|
-
|
|
1503
1477
|
//#endregion
|
|
1504
1478
|
//#region src/useFaasStream.tsx
|
|
1505
1479
|
/**
|
|
@@ -1645,7 +1619,6 @@ function useFaasStream(action, defaultParams, options = {}) {
|
|
|
1645
1619
|
setError
|
|
1646
1620
|
};
|
|
1647
1621
|
}
|
|
1648
|
-
|
|
1649
1622
|
//#endregion
|
|
1650
1623
|
//#region src/usePrevious.ts
|
|
1651
1624
|
/**
|
|
@@ -1662,7 +1635,6 @@ function usePrevious(value) {
|
|
|
1662
1635
|
});
|
|
1663
1636
|
return ref.current;
|
|
1664
1637
|
}
|
|
1665
|
-
|
|
1666
1638
|
//#endregion
|
|
1667
1639
|
exports.ErrorBoundary = ErrorBoundary;
|
|
1668
1640
|
exports.FaasBrowserClient = FaasBrowserClient;
|
|
@@ -1696,4 +1668,4 @@ exports.usePrevious = usePrevious;
|
|
|
1696
1668
|
exports.useSplittingState = useSplittingState;
|
|
1697
1669
|
exports.useStateRef = useStateRef;
|
|
1698
1670
|
exports.validValues = validValues;
|
|
1699
|
-
exports.withFaasData = withFaasData;
|
|
1671
|
+
exports.withFaasData = withFaasData;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FaasAction, FaasAction as FaasAction$1, FaasActionUnionType, FaasActionUnionType as FaasActionUnionType$1, FaasData, FaasData as FaasData$1, FaasParams, FaasParams as FaasParams$1 } from "@faasjs/types";
|
|
2
1
|
import * as react from "react";
|
|
3
2
|
import { Component, ComponentProps, ComponentType, Dispatch, ErrorInfo, JSX, JSXElementConstructor, ReactElement, ReactNode, RefObject, SetStateAction } from "react";
|
|
4
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { FaasAction, FaasAction as FaasAction$1, FaasActionUnionType, FaasActionUnionType as FaasActionUnionType$1, FaasData, FaasData as FaasData$1, FaasParams, FaasParams as FaasParams$1 } from "@faasjs/types";
|
|
5
5
|
|
|
6
6
|
//#region src/generateId.d.ts
|
|
7
7
|
/**
|
|
@@ -971,7 +971,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, {
|
|
|
971
971
|
static displayName: string;
|
|
972
972
|
constructor(props: ErrorBoundaryProps);
|
|
973
973
|
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
974
|
-
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> |
|
|
974
|
+
render(): string | number | bigint | boolean | react_jsx_runtime0.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null;
|
|
975
975
|
}
|
|
976
976
|
//#endregion
|
|
977
977
|
//#region src/equal.d.ts
|
|
@@ -1268,7 +1268,7 @@ declare function OptionalWrapper({
|
|
|
1268
1268
|
Wrapper,
|
|
1269
1269
|
wrapperProps,
|
|
1270
1270
|
children
|
|
1271
|
-
}: OptionalWrapperProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> |
|
|
1271
|
+
}: OptionalWrapperProps): string | number | bigint | boolean | react_jsx_runtime0.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
1272
1272
|
declare namespace OptionalWrapper {
|
|
1273
1273
|
var displayName: string;
|
|
1274
1274
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Component, cloneElement, createContext, forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
3
|
//#region src/generateId.ts
|
|
5
4
|
/**
|
|
6
5
|
* Generate random id with prefix
|
|
@@ -17,7 +16,6 @@ function generateId(prefix = "", length = 18) {
|
|
|
17
16
|
if (length < 8 || length > 18) throw new Error("Length must be 8 ~ 18");
|
|
18
17
|
return `${prefix}${Date.now().toString(36).padStart(8, "0")}${Math.random().toString(36).substring(2, length - 6).padEnd(length - 8, "0")}`;
|
|
19
18
|
}
|
|
20
|
-
|
|
21
19
|
//#endregion
|
|
22
20
|
//#region src/browser.ts
|
|
23
21
|
/**
|
|
@@ -660,7 +658,6 @@ var FaasBrowserClient = class {
|
|
|
660
658
|
});
|
|
661
659
|
}
|
|
662
660
|
};
|
|
663
|
-
|
|
664
661
|
//#endregion
|
|
665
662
|
//#region src/faas.ts
|
|
666
663
|
/**
|
|
@@ -686,7 +683,6 @@ async function faas(action, params, options) {
|
|
|
686
683
|
});
|
|
687
684
|
return client.browserClient.action(action, params, options);
|
|
688
685
|
}
|
|
689
|
-
|
|
690
686
|
//#endregion
|
|
691
687
|
//#region src/equal.ts
|
|
692
688
|
const AsyncFunction = (async () => {}).constructor;
|
|
@@ -774,11 +770,7 @@ function useEqualMemo(callback, dependencies) {
|
|
|
774
770
|
function useEqualCallback(callback, dependencies) {
|
|
775
771
|
return useCallback((...args) => callback(...args), useEqualMemoize(dependencies));
|
|
776
772
|
}
|
|
777
|
-
|
|
778
|
-
//#endregion
|
|
779
|
-
//#region src/FaasDataWrapper.tsx
|
|
780
|
-
const fixedForwardRef = forwardRef;
|
|
781
|
-
const FaasDataWrapper = fixedForwardRef((props, ref) => {
|
|
773
|
+
const FaasDataWrapper = forwardRef((props, ref) => {
|
|
782
774
|
const requestOptions = {
|
|
783
775
|
...props.data !== void 0 ? { data: props.data } : {},
|
|
784
776
|
...props.setData ? { setData: props.setData } : {}
|
|
@@ -822,7 +814,6 @@ function withFaasData(Component, faasProps) {
|
|
|
822
814
|
children: /* @__PURE__ */ jsx(Component, { ...props })
|
|
823
815
|
});
|
|
824
816
|
}
|
|
825
|
-
|
|
826
817
|
//#endregion
|
|
827
818
|
//#region src/useFaas.tsx
|
|
828
819
|
/**
|
|
@@ -950,7 +941,6 @@ function useFaas(action, defaultParams, options = {}) {
|
|
|
950
941
|
setError
|
|
951
942
|
};
|
|
952
943
|
}
|
|
953
|
-
|
|
954
944
|
//#endregion
|
|
955
945
|
//#region src/client.tsx
|
|
956
946
|
const clients = {};
|
|
@@ -1011,7 +1001,6 @@ function getClient(host) {
|
|
|
1011
1001
|
}
|
|
1012
1002
|
return client;
|
|
1013
1003
|
}
|
|
1014
|
-
|
|
1015
1004
|
//#endregion
|
|
1016
1005
|
//#region src/constant.ts
|
|
1017
1006
|
/**
|
|
@@ -1022,7 +1011,6 @@ function useConstant(fn) {
|
|
|
1022
1011
|
if (!ref.current) ref.current = { v: fn() };
|
|
1023
1012
|
return ref.current.v;
|
|
1024
1013
|
}
|
|
1025
|
-
|
|
1026
1014
|
//#endregion
|
|
1027
1015
|
//#region src/ErrorBoundary.tsx
|
|
1028
1016
|
var ErrorBoundary = class extends Component {
|
|
@@ -1057,7 +1045,6 @@ var ErrorBoundary = class extends Component {
|
|
|
1057
1045
|
return this.props.children ?? null;
|
|
1058
1046
|
}
|
|
1059
1047
|
};
|
|
1060
|
-
|
|
1061
1048
|
//#endregion
|
|
1062
1049
|
//#region src/useStateRef.ts
|
|
1063
1050
|
/**
|
|
@@ -1094,7 +1081,6 @@ function useStateRef(initialValue) {
|
|
|
1094
1081
|
ref
|
|
1095
1082
|
];
|
|
1096
1083
|
}
|
|
1097
|
-
|
|
1098
1084
|
//#endregion
|
|
1099
1085
|
//#region src/splittingState.tsx
|
|
1100
1086
|
/**
|
|
@@ -1123,7 +1109,6 @@ function useSplittingState(initialStates) {
|
|
|
1123
1109
|
}
|
|
1124
1110
|
return states;
|
|
1125
1111
|
}
|
|
1126
|
-
|
|
1127
1112
|
//#endregion
|
|
1128
1113
|
//#region src/splittingContext.tsx
|
|
1129
1114
|
/**
|
|
@@ -1206,7 +1191,6 @@ function createSplittingContext(defaultValue) {
|
|
|
1206
1191
|
use
|
|
1207
1192
|
};
|
|
1208
1193
|
}
|
|
1209
|
-
|
|
1210
1194
|
//#endregion
|
|
1211
1195
|
//#region src/Form/context.tsx
|
|
1212
1196
|
const FormContext = createSplittingContext([
|
|
@@ -1225,7 +1209,6 @@ const FormContext = createSplittingContext([
|
|
|
1225
1209
|
]);
|
|
1226
1210
|
const FormContextProvider = FormContext.Provider;
|
|
1227
1211
|
const useFormContext = FormContext.use;
|
|
1228
|
-
|
|
1229
1212
|
//#endregion
|
|
1230
1213
|
//#region src/Form/Input.tsx
|
|
1231
1214
|
function processValue(input, rules) {
|
|
@@ -1258,7 +1241,6 @@ function FormInput({ name, rules, ...rest }) {
|
|
|
1258
1241
|
});
|
|
1259
1242
|
}
|
|
1260
1243
|
FormInput.displayName = "FormInput";
|
|
1261
|
-
|
|
1262
1244
|
//#endregion
|
|
1263
1245
|
//#region src/Form/Item.tsx
|
|
1264
1246
|
function FormItem(props) {
|
|
@@ -1275,7 +1257,6 @@ function FormItem(props) {
|
|
|
1275
1257
|
});
|
|
1276
1258
|
}
|
|
1277
1259
|
FormItem.displayName = "FormItem";
|
|
1278
|
-
|
|
1279
1260
|
//#endregion
|
|
1280
1261
|
//#region src/Form/Body.tsx
|
|
1281
1262
|
function FormBody() {
|
|
@@ -1283,7 +1264,6 @@ function FormBody() {
|
|
|
1283
1264
|
return items.map((item) => /* @__PURE__ */ jsx(FormItem, { ...item }, item.name));
|
|
1284
1265
|
}
|
|
1285
1266
|
FormBody.displayName = "FormBody";
|
|
1286
|
-
|
|
1287
1267
|
//#endregion
|
|
1288
1268
|
//#region src/Form/elements/Button.tsx
|
|
1289
1269
|
const FormButtonElement = forwardRef(({ children, submit, submitting, ...props }, ref) => /* @__PURE__ */ jsx("button", {
|
|
@@ -1295,7 +1275,6 @@ const FormButtonElement = forwardRef(({ children, submit, submitting, ...props }
|
|
|
1295
1275
|
children
|
|
1296
1276
|
}));
|
|
1297
1277
|
FormButtonElement.displayName = "FormButtonElement";
|
|
1298
|
-
|
|
1299
1278
|
//#endregion
|
|
1300
1279
|
//#region src/Form/elements/Input.tsx
|
|
1301
1280
|
const FormInputElement = forwardRef(({ onChange, ...props }, ref) => /* @__PURE__ */ jsx("input", {
|
|
@@ -1304,7 +1283,6 @@ const FormInputElement = forwardRef(({ onChange, ...props }, ref) => /* @__PURE_
|
|
|
1304
1283
|
ref
|
|
1305
1284
|
}));
|
|
1306
1285
|
FormInputElement.displayName = "FormInputElement";
|
|
1307
|
-
|
|
1308
1286
|
//#endregion
|
|
1309
1287
|
//#region src/Form/elements/Label.tsx
|
|
1310
1288
|
const FormLabelElement = ({ name, title, description, error, children }) => {
|
|
@@ -1319,7 +1297,6 @@ const FormLabelElement = ({ name, title, description, error, children }) => {
|
|
|
1319
1297
|
] });
|
|
1320
1298
|
};
|
|
1321
1299
|
FormLabelElement.displayName = "FormLabelElement";
|
|
1322
|
-
|
|
1323
1300
|
//#endregion
|
|
1324
1301
|
//#region src/Form/elements/index.ts
|
|
1325
1302
|
const FormDefaultElements = {
|
|
@@ -1327,7 +1304,6 @@ const FormDefaultElements = {
|
|
|
1327
1304
|
Input: FormInputElement,
|
|
1328
1305
|
Button: FormButtonElement
|
|
1329
1306
|
};
|
|
1330
|
-
|
|
1331
1307
|
//#endregion
|
|
1332
1308
|
//#region src/Form/rules.ts
|
|
1333
1309
|
/**
|
|
@@ -1365,7 +1341,6 @@ async function validValues(rules, items, values, lang) {
|
|
|
1365
1341
|
}
|
|
1366
1342
|
return errors;
|
|
1367
1343
|
}
|
|
1368
|
-
|
|
1369
1344
|
//#endregion
|
|
1370
1345
|
//#region src/Form/Footer.tsx
|
|
1371
1346
|
function FormFooter() {
|
|
@@ -1400,7 +1375,6 @@ function FormFooter() {
|
|
|
1400
1375
|
]);
|
|
1401
1376
|
}
|
|
1402
1377
|
FormFooter.displayName = "FormFooter";
|
|
1403
|
-
|
|
1404
1378
|
//#endregion
|
|
1405
1379
|
//#region src/Form/lang.ts
|
|
1406
1380
|
const FormDefaultLang = {
|
|
@@ -1409,7 +1383,6 @@ const FormDefaultLang = {
|
|
|
1409
1383
|
string: "This field must be a string",
|
|
1410
1384
|
number: "This field must be a number"
|
|
1411
1385
|
};
|
|
1412
|
-
|
|
1413
1386
|
//#endregion
|
|
1414
1387
|
//#region src/Form/Container.tsx
|
|
1415
1388
|
function mergeValues(items, defaultValues = {}) {
|
|
@@ -1469,7 +1442,6 @@ function FormContainer({ defaultValues, Elements, rules, lang, items, ...props }
|
|
|
1469
1442
|
});
|
|
1470
1443
|
}
|
|
1471
1444
|
FormContainer.displayName = "FormContainer";
|
|
1472
|
-
|
|
1473
1445
|
//#endregion
|
|
1474
1446
|
//#region src/OptionalWrapper.tsx
|
|
1475
1447
|
/**
|
|
@@ -1498,7 +1470,6 @@ function OptionalWrapper({ condition, Wrapper, wrapperProps, children }) {
|
|
|
1498
1470
|
return children;
|
|
1499
1471
|
}
|
|
1500
1472
|
OptionalWrapper.displayName = "OptionalWrapper";
|
|
1501
|
-
|
|
1502
1473
|
//#endregion
|
|
1503
1474
|
//#region src/useFaasStream.tsx
|
|
1504
1475
|
/**
|
|
@@ -1644,7 +1615,6 @@ function useFaasStream(action, defaultParams, options = {}) {
|
|
|
1644
1615
|
setError
|
|
1645
1616
|
};
|
|
1646
1617
|
}
|
|
1647
|
-
|
|
1648
1618
|
//#endregion
|
|
1649
1619
|
//#region src/usePrevious.ts
|
|
1650
1620
|
/**
|
|
@@ -1661,6 +1631,5 @@ function usePrevious(value) {
|
|
|
1661
1631
|
});
|
|
1662
1632
|
return ref.current;
|
|
1663
1633
|
}
|
|
1664
|
-
|
|
1665
1634
|
//#endregion
|
|
1666
|
-
export { ErrorBoundary, FaasBrowserClient, FaasDataWrapper, FaasReactClient, FormContainer as Form, FormContextProvider, FormDefaultElements, FormDefaultLang, FormDefaultRules, FormInput, FormItem, OptionalWrapper, Response, ResponseError, createSplittingContext, equal, faas, generateId, getClient, setMock, useConstant, useEqualCallback, useEqualEffect, useEqualMemo, useEqualMemoize, useFaas, useFaasStream, useFormContext, usePrevious, useSplittingState, useStateRef, validValues, withFaasData };
|
|
1635
|
+
export { ErrorBoundary, FaasBrowserClient, FaasDataWrapper, FaasReactClient, FormContainer as Form, FormContextProvider, FormDefaultElements, FormDefaultLang, FormDefaultRules, FormInput, FormItem, OptionalWrapper, Response, ResponseError, createSplittingContext, equal, faas, generateId, getClient, setMock, useConstant, useEqualCallback, useEqualEffect, useEqualMemo, useEqualMemoize, useFaas, useFaasStream, useFormContext, usePrevious, useSplittingState, useStateRef, validValues, withFaasData };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/react",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.14",
|
|
4
4
|
"homepage": "https://faasjs.com/doc/react/",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/faasjs/faasjs/issues"
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"build": "tsdown src/index.ts --config ../../tsdown.config.ts --external react --dts.eager --no-sourcemap --no-dts.sourcemap"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@faasjs/types": ">=8.0.0-beta.
|
|
33
|
+
"@faasjs/types": ">=8.0.0-beta.14",
|
|
34
34
|
"@types/react": "^19.0.0",
|
|
35
35
|
"react": "^19.0.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@faasjs/types": ">=8.0.0-beta.
|
|
38
|
+
"@faasjs/types": ">=8.0.0-beta.14"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=24.0.0",
|