@panneau/forms 4.0.74 → 4.0.78
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.d.ts +6 -4
- package/dist/index.js +47 -37
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ElementType, ReactNode } from 'react';
|
|
3
|
+
import { FormDefinition } from '@panneau/core';
|
|
3
4
|
|
|
4
5
|
interface FormsProviderProps {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
definitions?: FormDefinition[];
|
|
7
|
+
components?: Record<string, ElementType>;
|
|
8
|
+
children: ReactNode;
|
|
7
9
|
}
|
|
8
|
-
declare function FormsProvider({ components: injectedComponents, children,
|
|
10
|
+
declare function FormsProvider({ definitions: injectedDefinitions, components: injectedComponents, children, }: FormsProviderProps): react.JSX.Element;
|
|
9
11
|
|
|
10
12
|
export { FormsProvider as default };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { c } from 'react/compiler-runtime';
|
|
2
|
-
import { ComponentsProvider, FORMS_NAMESPACE } from '@panneau/core/contexts';
|
|
2
|
+
import { ComponentsProvider, FORMS_NAMESPACE, FormsProvider as FormsProvider$1 } from '@panneau/core/contexts';
|
|
3
3
|
import formHorizontal from '@panneau/form-horizontal';
|
|
4
4
|
import formInline from '@panneau/form-inline';
|
|
5
5
|
import formNormal from '@panneau/form-normal';
|
|
6
6
|
import formTwoPane from '@panneau/form-two-pane';
|
|
7
|
-
import { ChangePassword, ConfirmPassword, ForgotPassword, Login, Register, ResetPassword, TwoFactorChallenge, TwoFactorDisable, TwoFactorEnable } from '@panneau/form-auth';
|
|
7
|
+
import { ChangePassword, ConfirmPassword, ForgotPassword, Login, Register, ResetPassword, TwoFactorChallenge, TwoFactorDisable, TwoFactorEnable, definition } from '@panneau/form-auth';
|
|
8
|
+
import isArray from 'lodash-es/isArray';
|
|
8
9
|
import { jsx } from 'react/jsx-runtime';
|
|
9
10
|
|
|
10
11
|
// Import forms
|
|
@@ -26,55 +27,64 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
26
27
|
TwoPane: formTwoPane
|
|
27
28
|
});
|
|
28
29
|
|
|
30
|
+
var definitions = [definition].reduce((allDefinition, definition) => [...allDefinition, ...(isArray(definition) ? definition : [definition])], []);
|
|
31
|
+
|
|
32
|
+
const DEFAULT_DEFINITIONS = [];
|
|
33
|
+
const DEFAULT_COMPONENTS = {};
|
|
29
34
|
function FormsProvider(t0) {
|
|
30
35
|
const $ = c(10);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
$[
|
|
42
|
-
$[
|
|
43
|
-
$[3] = t2;
|
|
36
|
+
const {
|
|
37
|
+
definitions: t1,
|
|
38
|
+
components: t2,
|
|
39
|
+
children
|
|
40
|
+
} = t0;
|
|
41
|
+
const injectedDefinitions = t1 === undefined ? DEFAULT_DEFINITIONS : t1;
|
|
42
|
+
const injectedComponents = t2 === undefined ? DEFAULT_COMPONENTS : t2;
|
|
43
|
+
let t3;
|
|
44
|
+
if ($[0] !== injectedDefinitions) {
|
|
45
|
+
t3 = [...definitions, ...injectedDefinitions];
|
|
46
|
+
$[0] = injectedDefinitions;
|
|
47
|
+
$[1] = t3;
|
|
44
48
|
} else {
|
|
45
|
-
|
|
46
|
-
t1 = $[2];
|
|
47
|
-
t2 = $[3];
|
|
49
|
+
t3 = $[1];
|
|
48
50
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if ($[4] !== injectedComponents) {
|
|
53
|
-
t3 = {
|
|
51
|
+
let t4;
|
|
52
|
+
if ($[2] !== injectedComponents) {
|
|
53
|
+
t4 = {
|
|
54
54
|
...components,
|
|
55
55
|
...injectedComponents
|
|
56
56
|
};
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
57
|
+
$[2] = injectedComponents;
|
|
58
|
+
$[3] = t4;
|
|
59
59
|
} else {
|
|
60
|
-
|
|
60
|
+
t4 = $[3];
|
|
61
61
|
}
|
|
62
|
-
let
|
|
63
|
-
if ($[
|
|
64
|
-
|
|
62
|
+
let t5;
|
|
63
|
+
if ($[4] !== children || $[5] !== t4) {
|
|
64
|
+
t5 = /*#__PURE__*/jsx(ComponentsProvider, {
|
|
65
65
|
namespace: FORMS_NAMESPACE,
|
|
66
|
-
components:
|
|
67
|
-
...props,
|
|
66
|
+
components: t4,
|
|
68
67
|
children: children
|
|
69
68
|
});
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
|
|
69
|
+
$[4] = children;
|
|
70
|
+
$[5] = t4;
|
|
71
|
+
$[6] = t5;
|
|
72
|
+
} else {
|
|
73
|
+
t5 = $[6];
|
|
74
|
+
}
|
|
75
|
+
let t6;
|
|
76
|
+
if ($[7] !== t3 || $[8] !== t5) {
|
|
77
|
+
t6 = /*#__PURE__*/jsx(FormsProvider$1, {
|
|
78
|
+
forms: t3,
|
|
79
|
+
children: t5
|
|
80
|
+
});
|
|
81
|
+
$[7] = t3;
|
|
82
|
+
$[8] = t5;
|
|
83
|
+
$[9] = t6;
|
|
74
84
|
} else {
|
|
75
|
-
|
|
85
|
+
t6 = $[9];
|
|
76
86
|
}
|
|
77
|
-
return
|
|
87
|
+
return t6;
|
|
78
88
|
}
|
|
79
89
|
|
|
80
90
|
export { FormsProvider as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/forms",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.78",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@babel/runtime": "^7.28.6",
|
|
63
|
-
"@panneau/core": "^4.0.
|
|
64
|
-
"@panneau/form-auth": "^4.0.
|
|
65
|
-
"@panneau/form-horizontal": "^4.0.
|
|
66
|
-
"@panneau/form-inline": "^4.0.
|
|
67
|
-
"@panneau/form-normal": "^4.0.
|
|
68
|
-
"@panneau/form-two-pane": "^4.0.
|
|
63
|
+
"@panneau/core": "^4.0.78",
|
|
64
|
+
"@panneau/form-auth": "^4.0.78",
|
|
65
|
+
"@panneau/form-horizontal": "^4.0.78",
|
|
66
|
+
"@panneau/form-inline": "^4.0.78",
|
|
67
|
+
"@panneau/form-normal": "^4.0.78",
|
|
68
|
+
"@panneau/form-two-pane": "^4.0.78"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"react": "^19.2.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "669f20a39ca9545acbe0f2279c6d1af23e43ae6e"
|
|
82
82
|
}
|