@panneau/forms 5.0.0-alpha.3 → 5.0.0-alpha.31
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/README.md +12 -10
- package/dist/ConflictDialog.js +200 -63
- package/dist/ConflictDialog.js.map +1 -1
- package/dist/ErrorSummary.js.map +1 -1
- package/dist/FieldErrorBoundary.js.map +1 -1
- package/dist/Form.css +83 -23
- package/dist/Form.d.ts +3 -2
- package/dist/Form.d.ts.map +1 -1
- package/dist/Form.js +122 -21
- package/dist/Form.js.map +1 -1
- package/dist/Form.module.js +26 -10
- package/dist/Form.module.js.map +1 -1
- package/dist/FormBinding.d.ts.map +1 -1
- package/dist/FormBinding.js +78 -67
- package/dist/FormBinding.js.map +1 -1
- package/dist/FormSkeleton.d.ts +23 -0
- package/dist/FormSkeleton.d.ts.map +1 -0
- package/dist/FormSkeleton.js +435 -0
- package/dist/FormSkeleton.js.map +1 -0
- package/dist/FormView.d.ts +48 -4
- package/dist/FormView.d.ts.map +1 -1
- package/dist/FormView.js +335 -120
- package/dist/FormView.js.map +1 -1
- package/dist/context.d.ts +8 -8
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +8 -16
- package/dist/context.js.map +1 -1
- package/dist/cx.js.map +1 -1
- package/dist/describe.js.map +1 -1
- package/dist/formatError.d.ts +2 -2
- package/dist/formatError.d.ts.map +1 -1
- package/dist/formatError.js +31 -5
- package/dist/formatError.js.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/layout/Layout.d.ts +28 -0
- package/dist/layout/Layout.d.ts.map +1 -1
- package/dist/layout/Layout.js +331 -89
- package/dist/layout/Layout.js.map +1 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/panels/SaveControls.d.ts +27 -0
- package/dist/panels/SaveControls.d.ts.map +1 -0
- package/dist/panels/SaveControls.js +87 -0
- package/dist/panels/SaveControls.js.map +1 -0
- package/dist/panels/panels.d.ts +34 -0
- package/dist/panels/panels.d.ts.map +1 -0
- package/dist/panels/panels.js +61 -0
- package/dist/panels/panels.js.map +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +2 -1
- package/dist/paths.js.map +1 -1
- package/dist/publication/Publication.d.ts +57 -0
- package/dist/publication/Publication.d.ts.map +1 -0
- package/dist/publication/Publication.js +427 -0
- package/dist/publication/Publication.js.map +1 -0
- package/dist/publication/index.d.ts +4 -0
- package/dist/publication/index.d.ts.map +1 -0
- package/dist/publication/index.js +1 -0
- package/dist/unsaved.js.map +1 -1
- package/package.json +16 -9
package/dist/Form.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FormView } from "./FormView.js";
|
|
2
2
|
import { useFormatRuleFailure } from "./formatError.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { resolveFields, useForm, usePanneau } from "@panneau/core";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/Form.tsx
|
|
@@ -10,30 +11,130 @@ import { jsx } from "react/jsx-runtime";
|
|
|
10
11
|
* translated with react-intl.
|
|
11
12
|
*
|
|
12
13
|
* Initial values and the version are read once: give the form a new `key` to start from another
|
|
13
|
-
* item, or use `useForm()` and `FormView`.
|
|
14
|
+
* item, or use `useForm()` and `FormView`. While the item loads, `isLoading` draws a skeleton of
|
|
15
|
+
* the form, and a new `key` once it is there starts the form from its values.
|
|
14
16
|
*/
|
|
15
|
-
function Form(
|
|
17
|
+
function Form(t0) {
|
|
18
|
+
const $ = c(39);
|
|
19
|
+
let fields;
|
|
20
|
+
let formatError;
|
|
21
|
+
let locales;
|
|
22
|
+
let mode;
|
|
23
|
+
let onSubmit;
|
|
24
|
+
let props;
|
|
25
|
+
let store;
|
|
26
|
+
let t1;
|
|
27
|
+
let values;
|
|
28
|
+
let version;
|
|
29
|
+
if ($[0] !== t0) {
|
|
30
|
+
({fields, layout: t1, values, version, mode, store, formatError, onSubmit, locales, ...props} = t0);
|
|
31
|
+
$[0] = t0;
|
|
32
|
+
$[1] = fields;
|
|
33
|
+
$[2] = formatError;
|
|
34
|
+
$[3] = locales;
|
|
35
|
+
$[4] = mode;
|
|
36
|
+
$[5] = onSubmit;
|
|
37
|
+
$[6] = props;
|
|
38
|
+
$[7] = store;
|
|
39
|
+
$[8] = t1;
|
|
40
|
+
$[9] = values;
|
|
41
|
+
$[10] = version;
|
|
42
|
+
} else {
|
|
43
|
+
fields = $[1];
|
|
44
|
+
formatError = $[2];
|
|
45
|
+
locales = $[3];
|
|
46
|
+
mode = $[4];
|
|
47
|
+
onSubmit = $[5];
|
|
48
|
+
props = $[6];
|
|
49
|
+
store = $[7];
|
|
50
|
+
t1 = $[8];
|
|
51
|
+
values = $[9];
|
|
52
|
+
version = $[10];
|
|
53
|
+
}
|
|
54
|
+
const layout = t1 === void 0 ? [] : t1;
|
|
16
55
|
const { definition } = usePanneau();
|
|
17
|
-
const
|
|
56
|
+
const formMode = mode ?? (version !== void 0 && version !== null ? "update" : "create");
|
|
57
|
+
const resolved = resolveFields(fields, layout, { mode: formMode });
|
|
18
58
|
const formatRuleFailure = useFormatRuleFailure(resolved.fields);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
59
|
+
let t2;
|
|
60
|
+
if ($[11] !== definition?.locales || $[12] !== locales) {
|
|
61
|
+
t2 = locales ?? definition?.locales ?? [];
|
|
62
|
+
$[11] = definition?.locales;
|
|
63
|
+
$[12] = locales;
|
|
64
|
+
$[13] = t2;
|
|
65
|
+
} else t2 = $[13];
|
|
66
|
+
const formLocales = t2;
|
|
67
|
+
let t3;
|
|
68
|
+
if ($[14] !== formLocales) {
|
|
69
|
+
t3 = [...formLocales];
|
|
70
|
+
$[14] = formLocales;
|
|
71
|
+
$[15] = t3;
|
|
72
|
+
} else t3 = $[15];
|
|
73
|
+
const t4 = formatError ?? formatRuleFailure;
|
|
74
|
+
let t5;
|
|
75
|
+
if ($[16] !== values) {
|
|
76
|
+
t5 = values !== void 0 ? { values } : {};
|
|
77
|
+
$[16] = values;
|
|
78
|
+
$[17] = t5;
|
|
79
|
+
} else t5 = $[17];
|
|
80
|
+
let t6;
|
|
81
|
+
if ($[18] !== version) {
|
|
82
|
+
t6 = version !== void 0 ? { version } : {};
|
|
83
|
+
$[18] = version;
|
|
84
|
+
$[19] = t6;
|
|
85
|
+
} else t6 = $[19];
|
|
86
|
+
let t7;
|
|
87
|
+
if ($[20] !== store) {
|
|
88
|
+
t7 = store !== void 0 ? { store } : {};
|
|
89
|
+
$[20] = store;
|
|
90
|
+
$[21] = t7;
|
|
91
|
+
} else t7 = $[21];
|
|
92
|
+
let t8;
|
|
93
|
+
if ($[22] !== onSubmit) {
|
|
94
|
+
t8 = onSubmit !== void 0 ? { onSubmit } : {};
|
|
95
|
+
$[22] = onSubmit;
|
|
96
|
+
$[23] = t8;
|
|
97
|
+
} else t8 = $[23];
|
|
98
|
+
let t9;
|
|
99
|
+
if ($[24] !== formMode || $[25] !== resolved.fields || $[26] !== t3 || $[27] !== t4 || $[28] !== t5 || $[29] !== t6 || $[30] !== t7 || $[31] !== t8) {
|
|
100
|
+
t9 = {
|
|
101
|
+
fields: resolved.fields,
|
|
102
|
+
locales: t3,
|
|
103
|
+
formatError: t4,
|
|
104
|
+
...t5,
|
|
105
|
+
...t6,
|
|
106
|
+
mode: formMode,
|
|
107
|
+
...t7,
|
|
108
|
+
...t8
|
|
109
|
+
};
|
|
110
|
+
$[24] = formMode;
|
|
111
|
+
$[25] = resolved.fields;
|
|
112
|
+
$[26] = t3;
|
|
113
|
+
$[27] = t4;
|
|
114
|
+
$[28] = t5;
|
|
115
|
+
$[29] = t6;
|
|
116
|
+
$[30] = t7;
|
|
117
|
+
$[31] = t8;
|
|
118
|
+
$[32] = t9;
|
|
119
|
+
} else t9 = $[32];
|
|
120
|
+
const { form } = useForm(t9);
|
|
121
|
+
let t10;
|
|
122
|
+
if ($[33] !== form || $[34] !== formLocales || $[35] !== layout || $[36] !== props || $[37] !== resolved.fields) {
|
|
123
|
+
t10 = /* @__PURE__ */ jsx(FormView, {
|
|
124
|
+
...props,
|
|
125
|
+
form,
|
|
126
|
+
fields: resolved.fields,
|
|
127
|
+
layout,
|
|
128
|
+
locales: formLocales
|
|
129
|
+
});
|
|
130
|
+
$[33] = form;
|
|
131
|
+
$[34] = formLocales;
|
|
132
|
+
$[35] = layout;
|
|
133
|
+
$[36] = props;
|
|
134
|
+
$[37] = resolved.fields;
|
|
135
|
+
$[38] = t10;
|
|
136
|
+
} else t10 = $[38];
|
|
137
|
+
return t10;
|
|
37
138
|
}
|
|
38
139
|
//#endregion
|
|
39
140
|
export { Form };
|
package/dist/Form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","names":[],"sources":["../src/Form.tsx"],"sourcesContent":["import { type FormOptions, resolveFields, useForm, usePanneau } from '@panneau/core';\nimport type { Field, LayoutNode } from '@panneau/protocol';\n\nimport { FormView, type FormViewProps } from './FormView';\nimport { useFormatRuleFailure } from './formatError';\n\nexport interface FormProps\n extends\n Omit<FormViewProps, 'form' | 'fields' | 'layout'>,\n Pick<FormOptions, 'values' | 'version' | 'mode' | 'store' | 'formatError' | 'onSubmit'> {\n /** The fields of the form. Without a layout, they are rendered in order. */\n fields: readonly Field[];\n /** The layout tree. Fields that no node references are added at the end. */\n layout?: readonly LayoutNode[];\n}\n\n/**\n * A form from a list of fields and an `onSubmit`, with or without a definition. It creates its\n * state with `useForm()` of `@panneau/core`: values, validation with the portable rules, server\n * errors (`422`) and version conflicts (`412`) from what `onSubmit` throws. Rule messages are\n * translated with react-intl.\n *\n * Initial values and the version are read once: give the form a new `key` to start from another\n * item, or use `useForm()` and `FormView
|
|
1
|
+
{"version":3,"file":"Form.js","names":["FormOptions","resolveFields","useForm","usePanneau","Field","LayoutNode","FormView","FormViewProps","useFormatRuleFailure","FormProps","Omit","Pick","fields","layout","Form","t0","$","_c","formatError","locales","mode","onSubmit","props","store","t1","values","version","undefined","definition","formMode","resolved","formatRuleFailure","t2","formLocales","t3","t4","t5","t6","t7","t8","t9","form","t10","_c"],"sources":["../src/Form.tsx"],"sourcesContent":["import { type FormOptions, resolveFields, useForm, usePanneau } from '@panneau/core';\nimport type { Field, LayoutNode } from '@panneau/protocol';\n\nimport { FormView, type FormViewProps } from './FormView';\nimport { useFormatRuleFailure } from './formatError';\n\nexport interface FormProps\n extends\n Omit<FormViewProps, 'form' | 'fields' | 'layout'>,\n Pick<FormOptions, 'values' | 'version' | 'mode' | 'store' | 'formatError' | 'onSubmit'> {\n /** The fields of the form. Without a layout, they are rendered in order. */\n fields: readonly Field[];\n /** The layout tree. Fields that no node references are added at the end. */\n layout?: readonly LayoutNode[];\n}\n\n/**\n * A form from a list of fields and an `onSubmit`, with or without a definition. It creates its\n * state with `useForm()` of `@panneau/core`: values, validation with the portable rules, server\n * errors (`422`) and version conflicts (`412`) from what `onSubmit` throws. Rule messages are\n * translated with react-intl.\n *\n * Initial values and the version are read once: give the form a new `key` to start from another\n * item, or use `useForm()` and `FormView`. While the item loads, `isLoading` draws a skeleton of\n * the form, and a new `key` once it is there starts the form from its values.\n */\nexport function Form({\n fields,\n layout = [],\n values,\n version,\n mode,\n store,\n formatError,\n onSubmit,\n locales,\n ...props\n}: FormProps) {\n const { definition } = usePanneau();\n // The mode `useForm()` would infer: rules limited to a mode are resolved in it\n const formMode = mode ?? (version !== undefined && version !== null ? 'update' : 'create');\n const resolved = resolveFields(fields, layout, { mode: formMode });\n const formatRuleFailure = useFormatRuleFailure(resolved.fields);\n const formLocales = locales ?? definition?.locales ?? [];\n const { form } = useForm({\n fields: resolved.fields,\n locales: [...formLocales],\n formatError: formatError ?? formatRuleFailure,\n ...(values !== undefined ? { values } : {}),\n ...(version !== undefined ? { version } : {}),\n mode: formMode,\n ...(store !== undefined ? { store } : {}),\n ...(onSubmit !== undefined ? { onSubmit } : {}),\n });\n return (\n <FormView\n {...props}\n form={form}\n fields={resolved.fields}\n // The layout as given: fields it doesn't place flow in columns at the end\n layout={layout}\n locales={formLocales}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA0BA,SAAOc,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAL;CAAA,IAAAM;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAV,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAAH,QAAAC,QAAAW,IAAAC,QAAAC,SAAAN,MAAAG,OAAAL,aAAAG,UAAAF,SAAA,GAAAG,SAAAP;EAWTC,EAAA,KAAAD;EAAAC,EAAA,KAAAJ;EAAAI,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO;EAAAP,EAAA,KAAAQ;EAAAR,EAAA,KAAAS;EAAAT,EAAA,MAAAU;CAAA,OAAA;EAAAd,SAAAI,EAAA;EAAAE,cAAAF,EAAA;EAAAG,UAAAH,EAAA;EAAAI,OAAAJ,EAAA;EAAAK,WAAAL,EAAA;EAAAM,QAAAN,EAAA;EAAAO,QAAAP,EAAA;EAAAQ,KAAAR,EAAA;EAAAS,SAAAT,EAAA;EAAAU,UAAAV,EAAA;CAAA;CATR,MAAAH,SAAAW,OAAAG,KAAAA,IAAA,CAAA,IAAAH;CAUA,MAAA,EAAAI,eAAuBzB,WAAW;CAElC,MAAA0B,WAAiBT,SAASM,YAAYC,KAAAA,KAAaD,YAAY,OAArC,WAAA;CAC1B,MAAAI,WAAiB7B,cAAcW,QAAQC,QAAQ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AAwB;CAAA,IAAAxB,EAAA,QAAAa,YAAAb,EAAA,QAAAc,SAAAlB,UAAAI,EAAA,QAAAkB,MAAAlB,EAAA,QAAAmB,MAAAnB,EAAA,QAAAoB,MAAApB,EAAA,QAAAqB,MAAArB,EAAA,QAAAsB,MAAAtB,EAAA,QAAAuB,IAAA;EARzBC,KAAA;GAAA5B,QACbkB,SAAQlB;GAAOO,SACde;GAAgBhB,aACZiB;GAAgC,GACzCC;GAAsC,GACtCC;GAAwCjB,MACtCS;GAAQ,GACVS;GAAoC,GACpCC;EACR;EAACvB,EAAA,MAAAa;EAAAb,EAAA,MAAAc,SAAAlB;EAAAI,EAAA,MAAAkB;EAAAlB,EAAA,MAAAmB;EAAAnB,EAAA,MAAAoB;EAAApB,EAAA,MAAAqB;EAAArB,EAAA,MAAAsB;EAAAtB,EAAA,MAAAuB;EAAAvB,EAAA,MAAAwB;CAAA,OAAAA,KAAAxB,EAAA;CATD,MAAA,EAAAyB,SAAiBvC,QAAQsC,EASxB;CAAE,IAAAE;CAAA,IAAA1B,EAAA,QAAAyB,QAAAzB,EAAA,QAAAiB,eAAAjB,EAAA,QAAAH,UAAAG,EAAA,QAAAM,SAAAN,EAAA,QAAAc,SAAAlB,QAAA;EAEC8B,MAAA,oBAAC,UAAD;GAAS,GACDpB;GACEmB;GACE,QAAAX,SAAQlB;GAERC;GACCoB,SAAAA;EAAW,CAAA;EACtBjB,EAAA,MAAAyB;EAAAzB,EAAA,MAAAiB;EAAAjB,EAAA,MAAAH;EAAAG,EAAA,MAAAM;EAAAN,EAAA,MAAAc,SAAAlB;EAAAI,EAAA,MAAA0B;CAAA,OAAAA,MAAA1B,EAAA;CAAA,OAPF0B;AAOE"}
|
package/dist/Form.module.js
CHANGED
|
@@ -1,44 +1,60 @@
|
|
|
1
1
|
import "./Form.css";
|
|
2
2
|
//#region src/Form.module.css
|
|
3
3
|
var form = "panneau-form";
|
|
4
|
-
var layout = "panneau-form-layout";
|
|
5
|
-
var withSidebar = "panneau-form-with-sidebar";
|
|
6
4
|
var stack = "panneau-form-stack";
|
|
7
5
|
var row = "panneau-form-row";
|
|
8
6
|
var cell = "panneau-form-cell";
|
|
7
|
+
var flow = "panneau-form-flow";
|
|
8
|
+
var flowCell = "panneau-form-flow-cell";
|
|
9
|
+
var flowWide = "panneau-form-flow-wide";
|
|
9
10
|
var section = "panneau-form-section";
|
|
10
11
|
var sectionHeader = "panneau-form-section-header";
|
|
11
12
|
var sectionDescription = "panneau-form-section-description";
|
|
12
13
|
var sectionTitle = "panneau-form-section-title";
|
|
13
14
|
var text = "panneau-form-text";
|
|
14
|
-
var sidebar = "panneau-form-sidebar";
|
|
15
15
|
var field = "panneau-form-field";
|
|
16
16
|
var footer = "panneau-form-footer";
|
|
17
|
-
var
|
|
17
|
+
var besideAsideHidden = "panneau-form-beside-aside-hidden";
|
|
18
|
+
var publicationState = "panneau-form-publication-state";
|
|
19
|
+
var savePanel = "panneau-form-save-panel";
|
|
20
|
+
var status = "panneau-form-status";
|
|
21
|
+
var statusError = "panneau-form-status-error";
|
|
18
22
|
var summary = "panneau-form-summary";
|
|
19
23
|
var summaryList = "panneau-form-summary-list";
|
|
20
24
|
var summaryLink = "panneau-form-summary-link";
|
|
25
|
+
var skeletonField = "panneau-form-skeleton-field";
|
|
26
|
+
var skeletonInline = "panneau-form-skeleton-inline";
|
|
27
|
+
var skeletonLabel = "panneau-form-skeleton-label";
|
|
28
|
+
var skeletonTabs = "panneau-form-skeleton-tabs";
|
|
21
29
|
var Form_module_default = {
|
|
22
30
|
form,
|
|
23
|
-
layout,
|
|
24
|
-
withSidebar,
|
|
25
31
|
stack,
|
|
26
32
|
row,
|
|
27
33
|
cell,
|
|
34
|
+
flow,
|
|
35
|
+
flowCell,
|
|
36
|
+
flowWide,
|
|
28
37
|
section,
|
|
29
38
|
sectionHeader,
|
|
30
39
|
sectionDescription,
|
|
31
40
|
sectionTitle,
|
|
32
41
|
text,
|
|
33
|
-
sidebar,
|
|
34
42
|
field,
|
|
35
43
|
footer,
|
|
36
|
-
|
|
44
|
+
besideAsideHidden,
|
|
45
|
+
publicationState,
|
|
46
|
+
savePanel,
|
|
47
|
+
status,
|
|
48
|
+
statusError,
|
|
37
49
|
summary,
|
|
38
50
|
summaryList,
|
|
39
|
-
summaryLink
|
|
51
|
+
summaryLink,
|
|
52
|
+
skeletonField,
|
|
53
|
+
skeletonInline,
|
|
54
|
+
skeletonLabel,
|
|
55
|
+
skeletonTabs
|
|
40
56
|
};
|
|
41
57
|
//#endregion
|
|
42
|
-
export { cell, Form_module_default as default,
|
|
58
|
+
export { besideAsideHidden, cell, Form_module_default as default, field, flow, flowCell, flowWide, footer, form, publicationState, row, savePanel, section, sectionDescription, sectionHeader, sectionTitle, skeletonField, skeletonInline, skeletonLabel, skeletonTabs, stack, status, statusError, summary, summaryLink, summaryList, text };
|
|
43
59
|
|
|
44
60
|
//# sourceMappingURL=Form.module.js.map
|
package/dist/Form.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.module.js","names":[],"sources":["../src/Form.module.css"],"sourcesContent":[".form {\n container: panneau-form / inline-size;\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-6);\n min-width: 0;\n}\n\n.
|
|
1
|
+
{"version":3,"file":"Form.module.js","names":[],"sources":["../src/Form.module.css"],"sourcesContent":[".form {\n container: panneau-form / inline-size;\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-6);\n min-width: 0;\n}\n\n.stack {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-5);\n min-width: 0;\n}\n\n.row {\n display: grid;\n grid-template-columns: repeat(12, minmax(0, 1fr));\n gap: var(--panneau-space-5) var(--panneau-space-4);\n min-width: 0;\n}\n\n.cell {\n grid-column: span var(--panneau-span, 12);\n min-width: 0;\n}\n\n/* Fields that the layout doesn't place: short ones side by side, in columns of at least 16rem. */\n.flow {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));\n gap: var(--panneau-space-5) var(--panneau-space-4);\n min-width: 0;\n}\n\n.flowCell {\n min-width: 0;\n}\n\n/* A field hidden by its condition renders nothing: its cell takes no column. */\n.flowCell:empty {\n display: none;\n}\n\n.flowWide {\n grid-column: 1 / -1;\n}\n\n/* Narrow containers (phones, side panels): every cell takes the full width. */\n@container panneau-form (max-width: 36rem) {\n .cell {\n grid-column: 1 / -1;\n }\n}\n\n.section {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-4);\n min-width: 0;\n padding: var(--panneau-space-4) var(--panneau-space-5);\n background-color: var(--panneau-color-surface);\n border: var(--panneau-border-width) solid var(--panneau-color-border);\n border-radius: var(--panneau-radius-lg);\n}\n\n@container panneau-form (max-width: 36rem) {\n .section {\n padding: var(--panneau-space-3);\n }\n}\n\n.sectionHeader {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n}\n\n.sectionDescription {\n margin: 0;\n}\n\n.sectionTitle {\n display: flex;\n align-items: center;\n gap: var(--panneau-space-2);\n font-size: var(--panneau-font-size-lg);\n font-weight: var(--panneau-font-weight-bold);\n line-height: var(--panneau-line-height-tight);\n margin: 0;\n}\n\n.sectionDescription,\n.text {\n font-size: var(--panneau-font-size-md);\n color: var(--panneau-color-text-muted);\n margin: 0;\n}\n\n.field {\n min-width: 0;\n scroll-margin: var(--panneau-space-10);\n}\n\n/* Sticks to the bottom of the window, above what the frame of the app puts there (a dock). */\n.footer {\n position: sticky;\n bottom: var(--panneau-frame-bottom, 0px);\n z-index: 1;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n gap: var(--panneau-space-2) var(--panneau-space-3);\n padding: var(--panneau-space-3) 0;\n background-color: var(--panneau-color-bg);\n border-top: var(--panneau-border-width) solid var(--panneau-color-border);\n}\n\n/* Beside the form, the `save` and `errors` panels of its sidebar take the place of the footer and\n of the summary at the top (decision 0075). The aside goes beside the form from 56rem. */\n@container panneau-form (min-width: 56rem) {\n /* Twice, over the display of the components it hides */\n .besideAsideHidden.besideAsideHidden {\n display: none;\n }\n}\n\n/* The state of the publication, at the top of its panel. */\n.publicationState {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--panneau-space-2);\n}\n\n/* The state of the form and its Save button, at the top of its sidebar. */\n.savePanel {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n gap: var(--panneau-space-2) var(--panneau-space-3);\n}\n\n/* \"Unsaved changes\", \"Saved\" or the failure of the last save, next to the button. */\n.status {\n display: inline-flex;\n align-items: center;\n gap: var(--panneau-space-1);\n margin-inline-end: auto;\n font-size: var(--panneau-font-size-sm);\n color: var(--panneau-color-text-muted);\n}\n\n.statusError {\n color: var(--panneau-color-danger);\n}\n\n.summary:focus {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 2px;\n}\n\n.summaryList {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n margin: 0;\n padding-inline-start: var(--panneau-space-5);\n}\n\n.summaryLink {\n padding: 0;\n font: inherit;\n color: inherit;\n text-align: start;\n text-decoration: underline;\n cursor: pointer;\n background: none;\n border: 0;\n}\n\n.summaryLink:focus-visible {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 2px;\n}\n\n@container panneau-form (max-width: 36rem) {\n .footer > :not(.status) {\n flex: 1 1 auto;\n }\n}\n\n/* The skeleton of a form whose values load. */\n.skeletonField {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n}\n\n.skeletonInline {\n display: flex;\n align-items: center;\n gap: var(--panneau-space-2);\n}\n\n.skeletonLabel {\n font-size: var(--panneau-font-size-sm);\n}\n\n.skeletonTabs {\n display: flex;\n gap: var(--panneau-space-5);\n padding-block: var(--panneau-space-2);\n border-bottom: var(--panneau-border-width) solid var(--panneau-color-border);\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormBinding.d.ts","sourceRoot":"","sources":["../src/FormBinding.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"FormBinding.d.ts","sourceRoot":"","sources":["../src/FormBinding.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAsBzD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,iBAAiB,sCAwCjF"}
|
package/dist/FormBinding.js
CHANGED
|
@@ -6,10 +6,16 @@ import { c } from "react/compiler-runtime";
|
|
|
6
6
|
import { selectErrors, selectValue, selectVisible } from "@panneau/core";
|
|
7
7
|
import { Alert, Button, usePanneauIntl } from "@panneau/ui";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { getNestedShape } from "@panneau/protocol/runtime";
|
|
9
10
|
//#region src/FormBinding.tsx
|
|
10
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Fields that show the errors of their nested fields themselves: an address and a link show the
|
|
13
|
+
* errors of each part under its input. Groups, repeaters and compound fields (decision 0065) bind
|
|
14
|
+
* their fields to their own paths.
|
|
15
|
+
*/
|
|
16
|
+
var NESTED_TYPES = /* @__PURE__ */ new Set(["address", "link"]);
|
|
11
17
|
function rendersNestedFields(field) {
|
|
12
|
-
return field.localized === true || field.type
|
|
18
|
+
return field.localized === true || NESTED_TYPES.has(field.type) || getNestedShape(field) !== null;
|
|
13
19
|
}
|
|
14
20
|
/**
|
|
15
21
|
* Binds a field to the form by path: value, change, blur and errors. It hides fields whose
|
|
@@ -17,30 +23,32 @@ function rendersNestedFields(field) {
|
|
|
17
23
|
* keeps a field that throws from breaking the form.
|
|
18
24
|
*/
|
|
19
25
|
function FormBinding(t0) {
|
|
20
|
-
const $ = c(
|
|
26
|
+
const $ = c(31);
|
|
21
27
|
const { field, path, parentPath, render } = t0;
|
|
22
28
|
const form = useFormContext();
|
|
23
29
|
const intl = usePanneauIntl();
|
|
24
30
|
const state = useFormState(form);
|
|
25
31
|
if (!selectVisible(state, field, parentPath)) return null;
|
|
26
|
-
let T0;
|
|
27
32
|
let t1;
|
|
33
|
+
if ($[0] !== field) {
|
|
34
|
+
t1 = rendersNestedFields(field);
|
|
35
|
+
$[0] = field;
|
|
36
|
+
$[1] = t1;
|
|
37
|
+
} else t1 = $[1];
|
|
38
|
+
const nested = t1;
|
|
39
|
+
let T0;
|
|
28
40
|
let t2;
|
|
29
41
|
let t3;
|
|
30
42
|
let t4;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} else t5 = $[12];
|
|
38
|
-
const errors = selectErrors(state, path, { nested: !t5 });
|
|
39
|
-
t3 = Form_module_default.field;
|
|
40
|
-
t4 = path;
|
|
43
|
+
let t5;
|
|
44
|
+
if ($[2] !== field.label || $[3] !== field.name || $[4] !== form || $[5] !== intl || $[6] !== nested || $[7] !== path || $[8] !== render || $[9] !== state) {
|
|
45
|
+
const errors = selectErrors(state, path, { nested: !nested });
|
|
46
|
+
const invalidPaths = nested ? Object.keys(state.errors).filter((key) => key.startsWith(`${path}.`)) : [];
|
|
47
|
+
t4 = Form_module_default.field;
|
|
48
|
+
t5 = path;
|
|
41
49
|
T0 = FieldErrorBoundary;
|
|
42
|
-
if ($[
|
|
43
|
-
|
|
50
|
+
if ($[15] !== field.label || $[16] !== field.name || $[17] !== intl) {
|
|
51
|
+
t2 = (retry) => /* @__PURE__ */ jsx(Alert, {
|
|
44
52
|
tone: "danger",
|
|
45
53
|
actions: /* @__PURE__ */ jsx(Button, {
|
|
46
54
|
size: "sm",
|
|
@@ -49,72 +57,75 @@ function FormBinding(t0) {
|
|
|
49
57
|
}),
|
|
50
58
|
children: intl.formatMessage(messages.fieldCrashed, { field: field.label ?? field.name })
|
|
51
59
|
});
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
56
|
-
} else
|
|
60
|
+
$[15] = field.label;
|
|
61
|
+
$[16] = field.name;
|
|
62
|
+
$[17] = intl;
|
|
63
|
+
$[18] = t2;
|
|
64
|
+
} else t2 = $[18];
|
|
57
65
|
let t6;
|
|
58
66
|
let t7;
|
|
59
|
-
if ($[
|
|
67
|
+
if ($[19] !== form || $[20] !== path) {
|
|
60
68
|
t6 = (value) => form.setValue(path, value);
|
|
61
69
|
t7 = () => form.blur(path);
|
|
62
|
-
$[
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
70
|
+
$[19] = form;
|
|
71
|
+
$[20] = path;
|
|
72
|
+
$[21] = t6;
|
|
73
|
+
$[22] = t7;
|
|
66
74
|
} else {
|
|
67
|
-
t6 = $[
|
|
68
|
-
t7 = $[
|
|
75
|
+
t6 = $[21];
|
|
76
|
+
t7 = $[22];
|
|
69
77
|
}
|
|
70
|
-
|
|
78
|
+
t3 = render({
|
|
71
79
|
value: selectValue(state, path),
|
|
72
80
|
onChange: t6,
|
|
73
81
|
onBlur: t7,
|
|
74
|
-
errors
|
|
82
|
+
errors,
|
|
83
|
+
...invalidPaths.length > 0 ? { invalidPaths } : {}
|
|
75
84
|
});
|
|
76
|
-
$[
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
85
|
+
$[2] = field.label;
|
|
86
|
+
$[3] = field.name;
|
|
87
|
+
$[4] = form;
|
|
88
|
+
$[5] = intl;
|
|
89
|
+
$[6] = nested;
|
|
90
|
+
$[7] = path;
|
|
91
|
+
$[8] = render;
|
|
92
|
+
$[9] = state;
|
|
93
|
+
$[10] = T0;
|
|
94
|
+
$[11] = t2;
|
|
95
|
+
$[12] = t3;
|
|
96
|
+
$[13] = t4;
|
|
97
|
+
$[14] = t5;
|
|
87
98
|
} else {
|
|
88
|
-
T0 = $[
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
T0 = $[10];
|
|
100
|
+
t2 = $[11];
|
|
101
|
+
t3 = $[12];
|
|
102
|
+
t4 = $[13];
|
|
103
|
+
t5 = $[14];
|
|
93
104
|
}
|
|
94
|
-
let t5;
|
|
95
|
-
if ($[21] !== T0 || $[22] !== t1 || $[23] !== t2) {
|
|
96
|
-
t5 = /* @__PURE__ */ jsx(T0, {
|
|
97
|
-
fallback: t1,
|
|
98
|
-
children: t2
|
|
99
|
-
});
|
|
100
|
-
$[21] = T0;
|
|
101
|
-
$[22] = t1;
|
|
102
|
-
$[23] = t2;
|
|
103
|
-
$[24] = t5;
|
|
104
|
-
} else t5 = $[24];
|
|
105
105
|
let t6;
|
|
106
|
-
if ($[
|
|
107
|
-
t6 = /* @__PURE__ */ jsx(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
children: t5
|
|
106
|
+
if ($[23] !== T0 || $[24] !== t2 || $[25] !== t3) {
|
|
107
|
+
t6 = /* @__PURE__ */ jsx(T0, {
|
|
108
|
+
fallback: t2,
|
|
109
|
+
children: t3
|
|
111
110
|
});
|
|
111
|
+
$[23] = T0;
|
|
112
|
+
$[24] = t2;
|
|
112
113
|
$[25] = t3;
|
|
113
|
-
$[26] =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
$[26] = t6;
|
|
115
|
+
} else t6 = $[26];
|
|
116
|
+
let t7;
|
|
117
|
+
if ($[27] !== t4 || $[28] !== t5 || $[29] !== t6) {
|
|
118
|
+
t7 = /* @__PURE__ */ jsx("div", {
|
|
119
|
+
className: t4,
|
|
120
|
+
"data-panneau-path": t5,
|
|
121
|
+
children: t6
|
|
122
|
+
});
|
|
123
|
+
$[27] = t4;
|
|
124
|
+
$[28] = t5;
|
|
125
|
+
$[29] = t6;
|
|
126
|
+
$[30] = t7;
|
|
127
|
+
} else t7 = $[30];
|
|
128
|
+
return t7;
|
|
118
129
|
}
|
|
119
130
|
//#endregion
|
|
120
131
|
export { FormBinding };
|
package/dist/FormBinding.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormBinding.js","names":["path","retry","_c","styles"],"sources":["../src/FormBinding.tsx"],"sourcesContent":["import { selectErrors, selectValue, selectVisible } from '@panneau/core';\nimport type { FieldBindingProps } from '@panneau/fields';\nimport { Alert, Button, usePanneauIntl } from '@panneau/ui';\n\nimport { FieldErrorBoundary } from './FieldErrorBoundary';\nimport styles from './Form.module.css';\nimport { useFormContext, useFormState } from './context';\nimport { messages } from './messages';\n\n
|
|
1
|
+
{"version":3,"file":"FormBinding.js","names":["selectErrors","selectValue","selectVisible","FieldBindingProps","getNestedShape","Alert","Button","usePanneauIntl","FieldErrorBoundary","styles","useFormContext","useFormState","messages","NESTED_TYPES","Set","rendersNestedFields","field","localized","has","type","FormBinding","t0","$","_c","path","parentPath","render","form","intl","state","t1","nested","T0","t2","t3","t4","t5","label","name","errors","invalidPaths","Object","keys","filter","key","startsWith","retry","formatMessage","fieldCrashed","t6","t7","value","setValue","blur","onChange","onBlur","length","_c","styles"],"sources":["../src/FormBinding.tsx"],"sourcesContent":["import { selectErrors, selectValue, selectVisible } from '@panneau/core';\nimport type { FieldBindingProps } from '@panneau/fields';\nimport { getNestedShape } from '@panneau/protocol/runtime';\nimport { Alert, Button, usePanneauIntl } from '@panneau/ui';\n\nimport { FieldErrorBoundary } from './FieldErrorBoundary';\nimport styles from './Form.module.css';\nimport { useFormContext, useFormState } from './context';\nimport { messages } from './messages';\n\n/**\n * Fields that show the errors of their nested fields themselves: an address and a link show the\n * errors of each part under its input. Groups, repeaters and compound fields (decision 0065) bind\n * their fields to their own paths.\n */\nconst NESTED_TYPES = new Set(['address', 'link']);\n\nfunction rendersNestedFields(field: FieldBindingProps['field']): boolean {\n return (\n field.localized === true || NESTED_TYPES.has(field.type) || getNestedShape(field) !== null\n );\n}\n\n/**\n * Binds a field to the form by path: value, change, blur and errors. It hides fields whose\n * `visibleWhen` is false, marks the field's element with its path for the error summary, and\n * keeps a field that throws from breaking the form.\n */\nexport function FormBinding({ field, path, parentPath, render }: FieldBindingProps) {\n const form = useFormContext();\n const intl = usePanneauIntl();\n const state = useFormState(form);\n if (!selectVisible(state, field, parentPath)) {\n return null;\n }\n const nested = rendersNestedFields(field);\n const errors = selectErrors(state, path, { nested: !nested });\n const invalidPaths = nested\n ? Object.keys(state.errors).filter((key) => key.startsWith(`${path}.`))\n : [];\n return (\n <div className={styles.field} data-panneau-path={path}>\n <FieldErrorBoundary\n fallback={(retry) => (\n <Alert\n tone=\"danger\"\n actions={\n <Button size=\"sm\" onPress={retry}>\n {intl.formatMessage(messages.retry)}\n </Button>\n }\n >\n {intl.formatMessage(messages.fieldCrashed, {\n field: field.label ?? field.name,\n })}\n </Alert>\n )}\n >\n {render({\n value: selectValue(state, path),\n onChange: (value) => form.setValue(path, value),\n onBlur: () => form.blur(path),\n errors,\n ...(invalidPaths.length > 0 ? { invalidPaths } : {}),\n })}\n </FieldErrorBoundary>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAeA,IAAMa,+BAAe,IAAIC,IAAI,CAAC,WAAW,MAAM,CAAC;AAEhD,SAASC,oBAAoBC,OAA4C;CACrE,OACIA,MAAMC,cAAc,QAAQJ,aAAaK,IAAIF,MAAMG,IAAI,KAAKf,eAAeY,KAAK,MAAM;AAE9F;;;;;;AAOA,SAAOI,YAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAqB,MAAA,EAAAP,OAAAQ,MAAAC,YAAAC,WAAAL;CACxB,MAAAM,OAAajB,eAAe;CAC5B,MAAAkB,OAAarB,eAAe;CAC5B,MAAAsB,QAAclB,aAAagB,IAAI;CAC/B,IAAI,CAACzB,cAAc2B,OAAOb,OAAOS,UAAU,GAAC,OACjC;CACV,IAAAK;CAAA,IAAAR,EA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X,qBAAAA;GAC7CyB,UAAAA;EAwBE,CAAA;EAAA3B,EAAA,MAAAa;EAAAb,EAAA,MAAAc;EAAAd,EAAA,MAAA2B;EAAA3B,EAAA,MAAA4B;CAAA,OAAAA,KAAA5B,EAAA;CAAA,OAzBN4B;AAyBM"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Field, LayoutNode } from '@panneau/protocol';
|
|
2
|
+
export interface FormSkeletonProps {
|
|
3
|
+
/** The main nodes of the layout. */
|
|
4
|
+
main: readonly LayoutNode[];
|
|
5
|
+
/** The fields that the layout doesn't place, which flow in columns after it. */
|
|
6
|
+
flow?: readonly LayoutNode[];
|
|
7
|
+
/** The sidebars of the layout. */
|
|
8
|
+
sidebar: readonly LayoutNode[];
|
|
9
|
+
fields: ReadonlyMap<string, Field>;
|
|
10
|
+
/** Draws the footer, with its button. */
|
|
11
|
+
footer: boolean;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
layoutClassName?: string | undefined;
|
|
14
|
+
sidebarClassName?: string | undefined;
|
|
15
|
+
footerClassName?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A form whose values load (decision 0034): its layout, and for each field its label and a block
|
|
19
|
+
* of the field's height, from its type. The fields of the first tab are drawn, and conditions are
|
|
20
|
+
* not checked, since there are no values yet.
|
|
21
|
+
*/
|
|
22
|
+
export declare function FormSkeleton({ main, flow, sidebar, fields, footer, className, layoutClassName, sidebarClassName, footerClassName, }: FormSkeletonProps): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=FormSkeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormSkeleton.d.ts","sourceRoot":"","sources":["../src/FormSkeleton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAoI3D,MAAM,WAAW,iBAAiB;IAC9B,oCAAoC;IACpC,IAAI,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5B,gFAAgF;IAChF,IAAI,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,kCAAkC;IAClC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/B,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnC,yCAAyC;IACzC,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EACzB,IAAI,EACJ,IAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,eAAe,GAClB,EAAE,iBAAiB,+BAwDnB"}
|