dynamic-mui 2.0.25 → 2.1.0
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/XmlShapeDeserializer-3yQdm0b0.mjs +237 -0
- package/dist/XmlShapeDeserializer-XKJAoqLc.js +1 -0
- package/dist/ai/client.d.ts +2 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/mapping.d.ts +14 -0
- package/dist/ai/react/AIFill.d.ts +25 -0
- package/dist/ai/react/AIForm.d.ts +29 -0
- package/dist/ai/react/AIFormGenerator.d.ts +20 -0
- package/dist/ai/react/AISchemaReview.d.ts +18 -0
- package/dist/ai/react/AITextAssist.d.ts +35 -0
- package/dist/ai/react/AIVisionImport.d.ts +21 -0
- package/dist/ai/react/index.d.ts +6 -0
- package/dist/ai/types.d.ts +107 -0
- package/dist/components/FormGenerator.d.ts +14 -1
- package/dist/components/controls/AddressField/addressfield.d.ts +2 -0
- package/dist/components/controls/Alert/alert.d.ts +3 -0
- package/dist/components/controls/Button/button.d.ts +3 -0
- package/dist/components/controls/CascadeSelect/cascadeselect.d.ts +2 -0
- package/dist/components/controls/ChipSelect/chipselect.d.ts +3 -0
- package/dist/components/controls/ColorPicker/colorpicker.d.ts +3 -0
- package/dist/components/controls/Computed/computed.d.ts +7 -0
- package/dist/components/controls/ConsentField/consentfield.d.ts +3 -0
- package/dist/components/controls/CurrencyField/currencyfield.d.ts +2 -0
- package/dist/components/controls/DateRangePicker/daterangepicker.d.ts +3 -0
- package/dist/components/controls/FileUpload/fileupload.d.ts +3 -0
- package/dist/components/controls/FormWizard/formwizard.d.ts +2 -0
- package/dist/components/controls/GeoField/geofield.d.ts +6 -0
- package/dist/components/controls/KeyValueField/keyvaluefield.d.ts +2 -0
- package/dist/components/controls/MarkdownEditor/markdowneditor.d.ts +3 -0
- package/dist/components/controls/MatrixField/matrixfield.d.ts +3 -0
- package/dist/components/controls/NumberStepper/numberstepper.d.ts +2 -0
- package/dist/components/controls/OtpField/otpfield.d.ts +2 -0
- package/dist/components/controls/PasswordField/passwordfield.d.ts +2 -0
- package/dist/components/controls/PhoneField/phonefield.d.ts +2 -0
- package/dist/components/controls/Rating/rating.d.ts +3 -0
- package/dist/components/controls/Slider/slider.d.ts +3 -0
- package/dist/components/controls/SummaryField/summaryfield.d.ts +7 -0
- package/dist/components/controls/TagsInput/tagsinput.d.ts +3 -0
- package/dist/components/controls/ToggleButtons/togglebuttons.d.ts +3 -0
- package/dist/components/controls/index.d.ts +50 -0
- package/dist/date-utils-CFUUt6NL.js +4 -0
- package/dist/date-utils-pGzaKb0p.mjs +477 -0
- package/dist/dynamic-mui.cjs.js +469 -1
- package/dist/dynamic-mui.es.js +102548 -7
- package/dist/index-BW8_rRff.js +7 -0
- package/dist/index-BXFVK_GX.js +1 -0
- package/dist/index-CVqLvm8B.js +1 -0
- package/dist/index-Cr6Wp_S-.mjs +3141 -0
- package/dist/{index-Cu1h31y8.mjs → index-DA0XouZs.mjs} +16 -16
- package/dist/index-DKS5Sz9e.js +14 -0
- package/dist/index-DcWfyXJp.mjs +92 -0
- package/dist/index-MllWgTJ5.mjs +9372 -0
- package/dist/index.browser-BSu11T_q.mjs +363 -0
- package/dist/index.browser-By7-GABP.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/loadCognitoIdentity-DtYTy-DW.js +1 -0
- package/dist/loadCognitoIdentity-DzdR91GB.mjs +872 -0
- package/dist/loadSts-Cic6UToN.mjs +593 -0
- package/dist/loadSts-csbFP6zX.js +1 -0
- package/dist/noAuth-B8ui2kBg.mjs +71 -0
- package/dist/noAuth-JPA2o4dt.js +1 -0
- package/dist/playground/AIContext.d.ts +18 -0
- package/dist/playground/AIPanel.d.ts +10 -0
- package/dist/types.d.ts +81 -10
- package/dist/util/helper.d.ts +2 -30
- package/dist/util/premiumStyles.d.ts +27 -0
- package/dist/util/rules.d.ts +35 -0
- package/package.json +2 -2
- package/dist/index-Bd7ELVvM.mjs +0 -102295
- package/dist/index-DIaEVD8W.js +0 -465
- package/dist/index-DzzNuBCt.js +0 -1
- package/dist/loadCognitoIdentity-5jZEsafg.js +0 -1
- package/dist/loadCognitoIdentity-C-Upg8iV.mjs +0 -935
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { S as D, N as S, d as $, L as F, b as A, e as O, U as R } from "./index-Cr6Wp_S-.mjs";
|
|
2
|
+
import { a as w, t as x } from "./date-utils-pGzaKb0p.mjs";
|
|
3
|
+
function W(s) {
|
|
4
|
+
return encodeURIComponent(s).replace(/[!'()*]/g, function(r) {
|
|
5
|
+
return "%" + r.charCodeAt(0).toString(16).toUpperCase();
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
const y = "(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?", b = "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)", N = "(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?", M = "(\\d?\\d)", E = "(\\d{4})", U = new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/), k = new RegExp(`^${y}, ${M} ${b} ${E} ${N} GMT$`), z = new RegExp(`^${y}, ${M}-${b}-(\\d\\d) ${N} GMT$`), I = new RegExp(`^${y} ${b} ( [1-9]|\\d\\d) ${N} ${E}$`), _ = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], L = (s) => {
|
|
9
|
+
if (s == null)
|
|
10
|
+
return;
|
|
11
|
+
let r = NaN;
|
|
12
|
+
if (typeof s == "number")
|
|
13
|
+
r = s;
|
|
14
|
+
else if (typeof s == "string") {
|
|
15
|
+
if (!/^-?\d*\.?\d+$/.test(s))
|
|
16
|
+
throw new TypeError("parseEpochTimestamp - numeric string invalid.");
|
|
17
|
+
r = Number.parseFloat(s);
|
|
18
|
+
} else typeof s == "object" && s.tag === 1 && (r = s.value);
|
|
19
|
+
if (isNaN(r) || Math.abs(r) === 1 / 0)
|
|
20
|
+
throw new TypeError("Epoch timestamps must be valid finite numbers.");
|
|
21
|
+
return new Date(Math.round(r * 1e3));
|
|
22
|
+
}, P = (s) => {
|
|
23
|
+
if (s == null)
|
|
24
|
+
return;
|
|
25
|
+
if (typeof s != "string")
|
|
26
|
+
throw new TypeError("RFC3339 timestamps must be strings");
|
|
27
|
+
const r = U.exec(s);
|
|
28
|
+
if (!r)
|
|
29
|
+
throw new TypeError(`Invalid RFC3339 timestamp format ${s}`);
|
|
30
|
+
const [, e, t, o, n, i, c, , m, f] = r;
|
|
31
|
+
h(t, 1, 12), h(o, 1, 31), h(n, 0, 23), h(i, 0, 59), h(c, 0, 60);
|
|
32
|
+
const a = new Date(Date.UTC(Number(e), Number(t) - 1, Number(o), Number(n), Number(i), Number(c), Number(m) ? Math.round(parseFloat(`0.${m}`) * 1e3) : 0));
|
|
33
|
+
if (a.setUTCFullYear(Number(e)), f.toUpperCase() != "Z") {
|
|
34
|
+
const [, d, l, u] = /([+-])(\d\d):(\d\d)/.exec(f) || [void 0, "+", 0, 0], p = d === "-" ? 1 : -1;
|
|
35
|
+
a.setTime(a.getTime() + p * (Number(l) * 60 * 60 * 1e3 + Number(u) * 60 * 1e3));
|
|
36
|
+
}
|
|
37
|
+
return a;
|
|
38
|
+
}, B = (s) => {
|
|
39
|
+
if (s == null)
|
|
40
|
+
return;
|
|
41
|
+
if (typeof s != "string")
|
|
42
|
+
throw new TypeError("RFC7231 timestamps must be strings.");
|
|
43
|
+
let r, e, t, o, n, i, c, m;
|
|
44
|
+
if ((m = k.exec(s)) ? [, r, e, t, o, n, i, c] = m : (m = z.exec(s)) ? ([, r, e, t, o, n, i, c] = m, t = (Number(t) + 1900).toString()) : (m = I.exec(s)) && ([, e, r, o, n, i, c, t] = m), t && i) {
|
|
45
|
+
const f = Date.UTC(Number(t), _.indexOf(e), Number(r), Number(o), Number(n), Number(i), c ? Math.round(parseFloat(`0.${c}`) * 1e3) : 0);
|
|
46
|
+
h(r, 1, 31), h(o, 0, 23), h(n, 0, 59), h(i, 0, 60);
|
|
47
|
+
const a = new Date(f);
|
|
48
|
+
return a.setUTCFullYear(Number(t)), a;
|
|
49
|
+
}
|
|
50
|
+
throw new TypeError(`Invalid RFC7231 date-time value ${s}.`);
|
|
51
|
+
};
|
|
52
|
+
function h(s, r, e) {
|
|
53
|
+
const t = Number(s);
|
|
54
|
+
if (t < r || t > e)
|
|
55
|
+
throw new Error(`Value ${t} out of range [${r}, ${e}]`);
|
|
56
|
+
}
|
|
57
|
+
const J = (s) => {
|
|
58
|
+
const r = s.length, e = [];
|
|
59
|
+
let t = !1, o, n = 0;
|
|
60
|
+
for (let i = 0; i < r; ++i) {
|
|
61
|
+
const c = s[i];
|
|
62
|
+
switch (c) {
|
|
63
|
+
case '"':
|
|
64
|
+
o !== "\\" && (t = !t);
|
|
65
|
+
break;
|
|
66
|
+
case ",":
|
|
67
|
+
t || (e.push(s.slice(n, i)), n = i + 1);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
o = c;
|
|
71
|
+
}
|
|
72
|
+
return e.push(s.slice(n)), e.map((i) => {
|
|
73
|
+
i = i.trim();
|
|
74
|
+
const c = i.length;
|
|
75
|
+
return c < 2 ? i : (i[0] === '"' && i[c - 1] === '"' && (i = i.slice(1, c - 1)), i.replace(/\\"/g, '"'));
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
class V extends D {
|
|
79
|
+
settings;
|
|
80
|
+
constructor(r) {
|
|
81
|
+
super(), this.settings = r;
|
|
82
|
+
}
|
|
83
|
+
read(r, e) {
|
|
84
|
+
const t = S.of(r);
|
|
85
|
+
if (t.isListSchema())
|
|
86
|
+
return J(e).map((o) => this.read(t.getValueSchema(), o));
|
|
87
|
+
if (t.isBlobSchema())
|
|
88
|
+
return (this.serdeContext?.base64Decoder ?? w)(e);
|
|
89
|
+
if (t.isTimestampSchema())
|
|
90
|
+
switch ($(t, this.settings)) {
|
|
91
|
+
case 5:
|
|
92
|
+
return P(e);
|
|
93
|
+
case 6:
|
|
94
|
+
return B(e);
|
|
95
|
+
case 7:
|
|
96
|
+
return L(e);
|
|
97
|
+
default:
|
|
98
|
+
return console.warn("Missing timestamp format, parsing value with Date constructor:", e), new Date(e);
|
|
99
|
+
}
|
|
100
|
+
if (t.isStringSchema()) {
|
|
101
|
+
const o = t.getMergedTraits().mediaType;
|
|
102
|
+
let n = e;
|
|
103
|
+
if (o)
|
|
104
|
+
return t.getMergedTraits().httpHeader && (n = this.base64ToUtf8(n)), (o === "application/json" || o.endsWith("+json")) && (n = F.from(n)), n;
|
|
105
|
+
}
|
|
106
|
+
return t.isNumericSchema() ? Number(e) : t.isBigIntegerSchema() ? BigInt(e) : t.isBigDecimalSchema() ? new A(e, "bigDecimal") : t.isBooleanSchema() ? String(e).toLowerCase() === "true" : e;
|
|
107
|
+
}
|
|
108
|
+
base64ToUtf8(r) {
|
|
109
|
+
return (this.serdeContext?.utf8Encoder ?? x)((this.serdeContext?.base64Decoder ?? w)(r));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const C = (s) => {
|
|
113
|
+
const r = "#text";
|
|
114
|
+
for (const e in s)
|
|
115
|
+
s.hasOwnProperty(e) && s[e][r] !== void 0 ? s[e] = s[e][r] : typeof s[e] == "object" && s[e] !== null && (s[e] = C(s[e]));
|
|
116
|
+
return s;
|
|
117
|
+
};
|
|
118
|
+
let g;
|
|
119
|
+
function X(s) {
|
|
120
|
+
g || (g = new DOMParser());
|
|
121
|
+
const r = g.parseFromString(s, "application/xml");
|
|
122
|
+
if (r.getElementsByTagName("parsererror").length > 0)
|
|
123
|
+
throw new Error("DOMParser XML parsing error.");
|
|
124
|
+
const e = (t) => {
|
|
125
|
+
if (t.nodeType === Node.TEXT_NODE && t.textContent?.trim())
|
|
126
|
+
return t.textContent;
|
|
127
|
+
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
128
|
+
const o = t;
|
|
129
|
+
if (o.attributes.length === 0 && o.childNodes.length === 0)
|
|
130
|
+
return "";
|
|
131
|
+
const n = {}, i = Array.from(o.attributes);
|
|
132
|
+
for (const m of i)
|
|
133
|
+
n[`${m.name}`] = m.value;
|
|
134
|
+
const c = Array.from(o.childNodes);
|
|
135
|
+
for (const m of c) {
|
|
136
|
+
const f = e(m);
|
|
137
|
+
if (f != null) {
|
|
138
|
+
const a = m.nodeName;
|
|
139
|
+
if (c.length === 1 && i.length === 0 && a === "#text")
|
|
140
|
+
return f;
|
|
141
|
+
n[a] ? Array.isArray(n[a]) ? n[a].push(f) : n[a] = [n[a], f] : n[a] = f;
|
|
142
|
+
} else if (c.length === 1 && i.length === 0)
|
|
143
|
+
return o.textContent;
|
|
144
|
+
}
|
|
145
|
+
return n;
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
};
|
|
149
|
+
return {
|
|
150
|
+
[r.documentElement.nodeName]: e(r.documentElement)
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
class K extends O {
|
|
154
|
+
settings;
|
|
155
|
+
stringDeserializer;
|
|
156
|
+
constructor(r) {
|
|
157
|
+
super(), this.settings = r, this.stringDeserializer = new V(r);
|
|
158
|
+
}
|
|
159
|
+
setSerdeContext(r) {
|
|
160
|
+
this.serdeContext = r, this.stringDeserializer.setSerdeContext(r);
|
|
161
|
+
}
|
|
162
|
+
read(r, e, t) {
|
|
163
|
+
const o = S.of(r), n = o.getMemberSchemas();
|
|
164
|
+
if (o.isStructSchema() && o.isMemberSchema() && !!Object.values(n).find((f) => !!f.getMemberTraits().eventPayload)) {
|
|
165
|
+
const f = {}, a = Object.keys(n)[0];
|
|
166
|
+
return n[a].isBlobSchema() ? f[a] = e : f[a] = this.read(n[a], e), f;
|
|
167
|
+
}
|
|
168
|
+
const c = (this.serdeContext?.utf8Encoder ?? x)(e), m = this.parseXml(c);
|
|
169
|
+
return this.readSchema(r, t ? m[t] : m);
|
|
170
|
+
}
|
|
171
|
+
readSchema(r, e) {
|
|
172
|
+
const t = S.of(r);
|
|
173
|
+
if (t.isUnitSchema())
|
|
174
|
+
return;
|
|
175
|
+
const o = t.getMergedTraits();
|
|
176
|
+
if (t.isListSchema() && !Array.isArray(e))
|
|
177
|
+
return this.readSchema(t, [e]);
|
|
178
|
+
if (e == null)
|
|
179
|
+
return e;
|
|
180
|
+
if (typeof e == "object") {
|
|
181
|
+
const n = !!o.sparse, i = !!o.xmlFlattened;
|
|
182
|
+
if (t.isListSchema()) {
|
|
183
|
+
const m = t.getValueSchema(), f = [], a = m.getMergedTraits().xmlName ?? "member", d = i ? e : (e[0] ?? e)[a], l = Array.isArray(d) ? d : [d];
|
|
184
|
+
for (const u of l)
|
|
185
|
+
(u != null || n) && f.push(this.readSchema(m, u));
|
|
186
|
+
return f;
|
|
187
|
+
}
|
|
188
|
+
const c = {};
|
|
189
|
+
if (t.isMapSchema()) {
|
|
190
|
+
const m = t.getKeySchema(), f = t.getValueSchema();
|
|
191
|
+
let a;
|
|
192
|
+
i ? a = Array.isArray(e) ? e : [e] : a = Array.isArray(e.entry) ? e.entry : [e.entry];
|
|
193
|
+
const d = m.getMergedTraits().xmlName ?? "key", l = f.getMergedTraits().xmlName ?? "value";
|
|
194
|
+
for (const u of a) {
|
|
195
|
+
const p = u[d], T = u[l];
|
|
196
|
+
(T != null || n) && (c[p] = this.readSchema(f, T));
|
|
197
|
+
}
|
|
198
|
+
return c;
|
|
199
|
+
}
|
|
200
|
+
if (t.isStructSchema()) {
|
|
201
|
+
const m = t.isUnionSchema();
|
|
202
|
+
let f;
|
|
203
|
+
m && (f = new R(e, c));
|
|
204
|
+
for (const [a, d] of t.structIterator()) {
|
|
205
|
+
const l = d.getMergedTraits(), u = l.httpPayload ? l.xmlName ?? d.getName() : d.getMemberTraits().xmlName ?? a;
|
|
206
|
+
m && f.mark(u), e[u] != null && (c[a] = this.readSchema(d, e[u]));
|
|
207
|
+
}
|
|
208
|
+
return m && f.writeUnknown(), c;
|
|
209
|
+
}
|
|
210
|
+
if (t.isDocumentSchema())
|
|
211
|
+
return e;
|
|
212
|
+
throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${t.getName(!0)}`);
|
|
213
|
+
}
|
|
214
|
+
return t.isListSchema() ? [] : t.isMapSchema() || t.isStructSchema() ? {} : this.stringDeserializer.read(t, e);
|
|
215
|
+
}
|
|
216
|
+
parseXml(r) {
|
|
217
|
+
if (r.length) {
|
|
218
|
+
let e;
|
|
219
|
+
try {
|
|
220
|
+
e = X(r);
|
|
221
|
+
} catch (i) {
|
|
222
|
+
throw i && typeof i == "object" && Object.defineProperty(i, "$responseBodyText", {
|
|
223
|
+
value: r
|
|
224
|
+
}), i;
|
|
225
|
+
}
|
|
226
|
+
const t = "#text", o = Object.keys(e)[0], n = e[o];
|
|
227
|
+
return n[t] && (n[o] = n[t], delete n[t]), C(n);
|
|
228
|
+
}
|
|
229
|
+
return {};
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
export {
|
|
233
|
+
V as F,
|
|
234
|
+
K as X,
|
|
235
|
+
W as e,
|
|
236
|
+
J as s
|
|
237
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const h=require("./index-DKS5Sz9e.js"),g=require("./date-utils-CFUUt6NL.js");function $(s){return encodeURIComponent(s).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})}const N="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",b="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",T="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",w="(\\d?\\d)",E="(\\d{4})",F=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),A=new RegExp(`^${N}, ${w} ${b} ${E} ${T} GMT$`),O=new RegExp(`^${N}, ${w}-${b}-(\\d\\d) ${T} GMT$`),U=new RegExp(`^${N} ${b} ( [1-9]|\\d\\d) ${T} ${E}$`),R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],z=s=>{if(s==null)return;let r=NaN;if(typeof s=="number")r=s;else if(typeof s=="string"){if(!/^-?\d*\.?\d+$/.test(s))throw new TypeError("parseEpochTimestamp - numeric string invalid.");r=Number.parseFloat(s)}else typeof s=="object"&&s.tag===1&&(r=s.value);if(isNaN(r)||Math.abs(r)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(r*1e3))},I=s=>{if(s==null)return;if(typeof s!="string")throw new TypeError("RFC3339 timestamps must be strings");const r=F.exec(s);if(!r)throw new TypeError(`Invalid RFC3339 timestamp format ${s}`);const[,e,t,o,n,i,c,,m,d]=r;l(t,1,12),l(o,1,31),l(n,0,23),l(i,0,59),l(c,0,60);const a=new Date(Date.UTC(Number(e),Number(t)-1,Number(o),Number(n),Number(i),Number(c),Number(m)?Math.round(parseFloat(`0.${m}`)*1e3):0));if(a.setUTCFullYear(Number(e)),d.toUpperCase()!="Z"){const[,f,p,u]=/([+-])(\d\d):(\d\d)/.exec(d)||[void 0,"+",0,0],S=f==="-"?1:-1;a.setTime(a.getTime()+S*(Number(p)*60*60*1e3+Number(u)*60*1e3))}return a},k=s=>{if(s==null)return;if(typeof s!="string")throw new TypeError("RFC7231 timestamps must be strings.");let r,e,t,o,n,i,c,m;if((m=A.exec(s))?[,r,e,t,o,n,i,c]=m:(m=O.exec(s))?([,r,e,t,o,n,i,c]=m,t=(Number(t)+1900).toString()):(m=U.exec(s))&&([,e,r,o,n,i,c,t]=m),t&&i){const d=Date.UTC(Number(t),R.indexOf(e),Number(r),Number(o),Number(n),Number(i),c?Math.round(parseFloat(`0.${c}`)*1e3):0);l(r,1,31),l(o,0,23),l(n,0,59),l(i,0,60);const a=new Date(d);return a.setUTCFullYear(Number(t)),a}throw new TypeError(`Invalid RFC7231 date-time value ${s}.`)};function l(s,r,e){const t=Number(s);if(t<r||t>e)throw new Error(`Value ${t} out of range [${r}, ${e}]`)}const M=s=>{const r=s.length,e=[];let t=!1,o,n=0;for(let i=0;i<r;++i){const c=s[i];switch(c){case'"':o!=="\\"&&(t=!t);break;case",":t||(e.push(s.slice(n,i)),n=i+1);break}o=c}return e.push(s.slice(n)),e.map(i=>{i=i.trim();const c=i.length;return c<2?i:(i[0]==='"'&&i[c-1]==='"'&&(i=i.slice(1,c-1)),i.replace(/\\"/g,'"'))})};class C extends h.SerdeContext{settings;constructor(r){super(),this.settings=r}read(r,e){const t=h.NormalizedSchema.of(r);if(t.isListSchema())return M(e).map(o=>this.read(t.getValueSchema(),o));if(t.isBlobSchema())return(this.serdeContext?.base64Decoder??g.fromBase64)(e);if(t.isTimestampSchema())switch(h.determineTimestampFormat(t,this.settings)){case 5:return I(e);case 6:return k(e);case 7:return z(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}if(t.isStringSchema()){const o=t.getMergedTraits().mediaType;let n=e;if(o)return t.getMergedTraits().httpHeader&&(n=this.base64ToUtf8(n)),(o==="application/json"||o.endsWith("+json"))&&(n=h.LazyJsonString.from(n)),n}return t.isNumericSchema()?Number(e):t.isBigIntegerSchema()?BigInt(e):t.isBigDecimalSchema()?new h.NumericValue(e,"bigDecimal"):t.isBooleanSchema()?String(e).toLowerCase()==="true":e}base64ToUtf8(r){return(this.serdeContext?.utf8Encoder??g.toUtf8)((this.serdeContext?.base64Decoder??g.fromBase64)(r))}}const D=s=>{const r="#text";for(const e in s)s.hasOwnProperty(e)&&s[e][r]!==void 0?s[e]=s[e][r]:typeof s[e]=="object"&&s[e]!==null&&(s[e]=D(s[e]));return s};let y;function _(s){y||(y=new DOMParser);const r=y.parseFromString(s,"application/xml");if(r.getElementsByTagName("parsererror").length>0)throw new Error("DOMParser XML parsing error.");const e=t=>{if(t.nodeType===Node.TEXT_NODE&&t.textContent?.trim())return t.textContent;if(t.nodeType===Node.ELEMENT_NODE){const o=t;if(o.attributes.length===0&&o.childNodes.length===0)return"";const n={},i=Array.from(o.attributes);for(const m of i)n[`${m.name}`]=m.value;const c=Array.from(o.childNodes);for(const m of c){const d=e(m);if(d!=null){const a=m.nodeName;if(c.length===1&&i.length===0&&a==="#text")return d;n[a]?Array.isArray(n[a])?n[a].push(d):n[a]=[n[a],d]:n[a]=d}else if(c.length===1&&i.length===0)return o.textContent}return n}return null};return{[r.documentElement.nodeName]:e(r.documentElement)}}class B extends h.SerdeContextConfig{settings;stringDeserializer;constructor(r){super(),this.settings=r,this.stringDeserializer=new C(r)}setSerdeContext(r){this.serdeContext=r,this.stringDeserializer.setSerdeContext(r)}read(r,e,t){const o=h.NormalizedSchema.of(r),n=o.getMemberSchemas();if(o.isStructSchema()&&o.isMemberSchema()&&!!Object.values(n).find(d=>!!d.getMemberTraits().eventPayload)){const d={},a=Object.keys(n)[0];return n[a].isBlobSchema()?d[a]=e:d[a]=this.read(n[a],e),d}const c=(this.serdeContext?.utf8Encoder??g.toUtf8)(e),m=this.parseXml(c);return this.readSchema(r,t?m[t]:m)}readSchema(r,e){const t=h.NormalizedSchema.of(r);if(t.isUnitSchema())return;const o=t.getMergedTraits();if(t.isListSchema()&&!Array.isArray(e))return this.readSchema(t,[e]);if(e==null)return e;if(typeof e=="object"){const n=!!o.sparse,i=!!o.xmlFlattened;if(t.isListSchema()){const m=t.getValueSchema(),d=[],a=m.getMergedTraits().xmlName??"member",f=i?e:(e[0]??e)[a],p=Array.isArray(f)?f:[f];for(const u of p)(u!=null||n)&&d.push(this.readSchema(m,u));return d}const c={};if(t.isMapSchema()){const m=t.getKeySchema(),d=t.getValueSchema();let a;i?a=Array.isArray(e)?e:[e]:a=Array.isArray(e.entry)?e.entry:[e.entry];const f=m.getMergedTraits().xmlName??"key",p=d.getMergedTraits().xmlName??"value";for(const u of a){const S=u[f],x=u[p];(x!=null||n)&&(c[S]=this.readSchema(d,x))}return c}if(t.isStructSchema()){const m=t.isUnionSchema();let d;m&&(d=new h.UnionSerde(e,c));for(const[a,f]of t.structIterator()){const p=f.getMergedTraits(),u=p.httpPayload?p.xmlName??f.getName():f.getMemberTraits().xmlName??a;m&&d.mark(u),e[u]!=null&&(c[a]=this.readSchema(f,e[u]))}return m&&d.writeUnknown(),c}if(t.isDocumentSchema())return e;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${t.getName(!0)}`)}return t.isListSchema()?[]:t.isMapSchema()||t.isStructSchema()?{}:this.stringDeserializer.read(t,e)}parseXml(r){if(r.length){let e;try{e=_(r)}catch(i){throw i&&typeof i=="object"&&Object.defineProperty(i,"$responseBodyText",{value:r}),i}const t="#text",o=Object.keys(e)[0],n=e[o];return n[t]&&(n[o]=n[t],delete n[t]),D(n)}return{}}}exports.FromStringShapeDeserializer=C;exports.XmlShapeDeserializer=B;exports.extendedEncodeURIComponent=$;exports.splitHeader=M;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormField } from '../types';
|
|
2
|
+
import { SimpleField, ExtractionField } from './types';
|
|
3
|
+
/** Turn a label into a stable snake_case id/value. */
|
|
4
|
+
export declare const slug: (s: string) => string;
|
|
5
|
+
/** Convert LLM-friendly SimpleField[] into renderable FormField[]. */
|
|
6
|
+
export declare function simpleFieldsToFormFields(fields: SimpleField[]): FormField[];
|
|
7
|
+
/**
|
|
8
|
+
* Describe a rendered form's fields for AI extraction — includes each field's
|
|
9
|
+
* valid `options` and `format` so the model returns values the controls accept
|
|
10
|
+
* (e.g. a real Select option value, not just a label guess).
|
|
11
|
+
*/
|
|
12
|
+
export declare function fieldsForExtraction(schema: FormField[]): ExtractionField[];
|
|
13
|
+
/** Best-effort reverse map (FormField[] → SimpleField[]) for edit/review round-trips. */
|
|
14
|
+
export declare function formFieldsToSimple(fields: FormField[]): SimpleField[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AIClient, ExtractionField } from '../types';
|
|
3
|
+
import { FormField } from '../../types';
|
|
4
|
+
/** A field descriptor understood by `AIClient.extractToFields`. */
|
|
5
|
+
export type AIFillField = ExtractionField;
|
|
6
|
+
export interface AIFillProps {
|
|
7
|
+
/** Injected, provider-agnostic AI client. This component never calls the network directly. */
|
|
8
|
+
client: AIClient;
|
|
9
|
+
/** Full form schema; field descriptors are derived from it when `fields` is omitted. */
|
|
10
|
+
schema?: FormField[];
|
|
11
|
+
/** Explicit field descriptors. Takes precedence over `schema`. */
|
|
12
|
+
fields?: AIFillField[];
|
|
13
|
+
/** Called with the extracted values (always called, even with `{}`). */
|
|
14
|
+
onFill: (values: Record<string, any>) => void;
|
|
15
|
+
/** Placeholder for the paste box. */
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
/** Label for the paste box. */
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* "Paste to autofill": the user pastes free text, and the injected `AIClient`
|
|
22
|
+
* extracts values for the form's fields.
|
|
23
|
+
*/
|
|
24
|
+
export declare const AIFill: React.FC<AIFillProps>;
|
|
25
|
+
export default AIFill;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FormField } from '../../types';
|
|
2
|
+
import { AIClient } from '../types';
|
|
3
|
+
import { FormGeneratorProps } from '../../components/FormGenerator';
|
|
4
|
+
export interface AIFormProps {
|
|
5
|
+
/** Injected, provider-agnostic AI client. */
|
|
6
|
+
client: AIClient;
|
|
7
|
+
/** The form schema (JSON). Used as the initial schema; AI edits update it internally. */
|
|
8
|
+
data: FormField[];
|
|
9
|
+
guid: string;
|
|
10
|
+
/** Initial field values. */
|
|
11
|
+
patch?: Record<string, any>;
|
|
12
|
+
onSubmit?: FormGeneratorProps['onSubmit'];
|
|
13
|
+
onChange?: FormGeneratorProps['onChange'];
|
|
14
|
+
/** Called whenever AI (generate / review) changes the schema. */
|
|
15
|
+
onSchemaChange?: (fields: FormField[]) => void;
|
|
16
|
+
/** Toolbar toggles. */
|
|
17
|
+
enableFill?: boolean;
|
|
18
|
+
enableReview?: boolean;
|
|
19
|
+
enableGenerate?: boolean;
|
|
20
|
+
formRef?: FormGeneratorProps['formRef'];
|
|
21
|
+
/** Extra props forwarded to the inner FormGenerator. */
|
|
22
|
+
formProps?: Partial<FormGeneratorProps>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Drop-in form + AI. Renders a `FormGenerator` from `data` and a small AI toolbar
|
|
26
|
+
* that can generate/edit the schema, review it, and paste-to-fill the values —
|
|
27
|
+
* all wired to the internal schema/patch state. One line to add AI to any form.
|
|
28
|
+
*/
|
|
29
|
+
export default function AIForm({ client, data, guid, patch, onSubmit, onChange, onSchemaChange, enableFill, enableReview, enableGenerate, formRef, formProps, }: AIFormProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AIClient } from '../types';
|
|
2
|
+
import { FormField } from '../../types';
|
|
3
|
+
export interface AIFormGeneratorProps {
|
|
4
|
+
/** Provider-agnostic AI client (injected). Never calls the network directly. */
|
|
5
|
+
client: AIClient;
|
|
6
|
+
/** When provided and non-empty, the component edits this form instead of generating a new one. */
|
|
7
|
+
current?: FormField[];
|
|
8
|
+
/** Called with the generated (or edited) form schema. */
|
|
9
|
+
onGenerate: (fields: FormField[]) => void;
|
|
10
|
+
/** Placeholder text for the prompt input. */
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/** Label for the prompt input. */
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A small, self-contained UI that turns a natural-language prompt into a
|
|
17
|
+
* renderable form schema via an injected `AIClient`. When `current` is a
|
|
18
|
+
* non-empty array it applies the prompt as an edit to that form instead.
|
|
19
|
+
*/
|
|
20
|
+
export default function AIFormGenerator({ client, current, onGenerate, placeholder, label, }: AIFormGeneratorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AIClient } from '../types';
|
|
2
|
+
import { FormField } from '../../types';
|
|
3
|
+
export interface AISchemaReviewProps {
|
|
4
|
+
/** Provider-agnostic AI client (injected). Never calls the network directly. */
|
|
5
|
+
client: AIClient;
|
|
6
|
+
/** The form schema to audit. */
|
|
7
|
+
schema: FormField[];
|
|
8
|
+
/** Called with `result.improved` when the user applies the AI's improvements. */
|
|
9
|
+
onApply?: (fields: FormField[]) => void;
|
|
10
|
+
/** Label for the review button. */
|
|
11
|
+
buttonLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Audits a form schema through an injected `AIClient` and presents the returned
|
|
15
|
+
* issues as a tidy list. When the client returns an improved schema and an
|
|
16
|
+
* `onApply` handler is provided, the user can apply it wholesale.
|
|
17
|
+
*/
|
|
18
|
+
export default function AISchemaReview({ client, schema, onApply, buttonLabel, }: AISchemaReviewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AIClient, AssistAction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Return value of {@link useAIAssist}. `run` invokes the injected client's
|
|
4
|
+
* `assistText`, tracking `loading`/`error` and resolving with the result text.
|
|
5
|
+
*/
|
|
6
|
+
export interface UseAIAssist {
|
|
7
|
+
run: (text: string, action: AssistAction, targetLanguage?: string) => Promise<string>;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
error: string | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Headless hook around an injected {@link AIClient}. Never calls the network
|
|
13
|
+
* directly — it delegates to `client.assistText` and surfaces loading/error.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useAIAssist(client: AIClient): UseAIAssist;
|
|
16
|
+
export interface AITextAssistProps {
|
|
17
|
+
/** Provider-agnostic AI client (injected). Never calls the network directly. */
|
|
18
|
+
client: AIClient;
|
|
19
|
+
/** The text the selected action operates on. */
|
|
20
|
+
text: string;
|
|
21
|
+
/** Which assist actions to offer. Defaults to all seven. */
|
|
22
|
+
actions?: AssistAction[];
|
|
23
|
+
/** Called with the transformed text once an action resolves. */
|
|
24
|
+
onResult: (text: string) => void;
|
|
25
|
+
/** Target language, forwarded for the `translate` action. */
|
|
26
|
+
targetLanguage?: string;
|
|
27
|
+
/** Size of the trigger icon button. */
|
|
28
|
+
size?: 'small' | 'medium';
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A compact "AI assist" trigger: an icon button that opens a menu of text
|
|
32
|
+
* transformations (improve, summarize, translate, …). Selecting one runs it
|
|
33
|
+
* through the injected {@link AIClient} and hands the result to `onResult`.
|
|
34
|
+
*/
|
|
35
|
+
export default function AITextAssist({ client, text, actions, onResult, targetLanguage, size, }: AITextAssistProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AIClient } from '../types';
|
|
2
|
+
import { FormField } from '../../types';
|
|
3
|
+
export interface AIVisionImportProps {
|
|
4
|
+
client: AIClient;
|
|
5
|
+
/** 'generate' → digitize a form image into a schema; 'fill' → read a document into fields. */
|
|
6
|
+
mode?: 'generate' | 'fill';
|
|
7
|
+
/** For 'fill' mode: the form to populate (fields are derived from it). */
|
|
8
|
+
schema?: FormField[];
|
|
9
|
+
/** For 'fill' mode: explicit field list (overrides schema). */
|
|
10
|
+
fields?: {
|
|
11
|
+
id: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
type?: string;
|
|
14
|
+
}[];
|
|
15
|
+
onGenerate?: (fields: FormField[]) => void;
|
|
16
|
+
onFill?: (values: Record<string, any>) => void;
|
|
17
|
+
label?: string;
|
|
18
|
+
accept?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Upload a document/photo and let AI (vision) either build a form from it or fill fields. */
|
|
21
|
+
export default function AIVisionImport({ client, mode, schema, fields, onGenerate, onFill, label, accept, }: AIVisionImportProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as AIFormGenerator } from './AIFormGenerator';
|
|
2
|
+
export { default as AIFill } from './AIFill';
|
|
3
|
+
export { default as AITextAssist, useAIAssist } from './AITextAssist';
|
|
4
|
+
export { default as AISchemaReview } from './AISchemaReview';
|
|
5
|
+
export { default as AIVisionImport } from './AIVisionImport';
|
|
6
|
+
export { default as AIForm } from './AIForm';
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { FormField } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* A simplified, LLM-friendly field description. The AI works in terms of these
|
|
4
|
+
* (flat, easy to reason about) and the mapping layer converts them to/from the
|
|
5
|
+
* library's richer `FormField` schema.
|
|
6
|
+
*/
|
|
7
|
+
export interface SimpleField {
|
|
8
|
+
/** Semantic control kind (see mapping for the supported set + aliases). */
|
|
9
|
+
type: string;
|
|
10
|
+
/** Stable field id. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Human label. */
|
|
13
|
+
label: string;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
helperText?: string;
|
|
17
|
+
/** Options for choice fields (select/radio/chipselect/togglebuttons). */
|
|
18
|
+
options?: string[];
|
|
19
|
+
multiple?: boolean;
|
|
20
|
+
/** Layout width hint. */
|
|
21
|
+
width?: 'full' | 'half' | 'third';
|
|
22
|
+
/** Arithmetic formula for computed fields, e.g. "qty * price". */
|
|
23
|
+
formula?: string;
|
|
24
|
+
/** Simple conditional-visibility hint. */
|
|
25
|
+
visibleWhen?: {
|
|
26
|
+
field: string;
|
|
27
|
+
op?: string;
|
|
28
|
+
value?: any;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export type AssistAction = 'improve' | 'summarize' | 'expand' | 'shorten' | 'fix-grammar' | 'professional' | 'translate';
|
|
32
|
+
/** A field descriptor the AI uses when extracting values into a form. */
|
|
33
|
+
export interface ExtractionField {
|
|
34
|
+
id: string;
|
|
35
|
+
label?: string;
|
|
36
|
+
type?: string;
|
|
37
|
+
/** Valid option values (for select/radio/chip/etc.) so the model returns a real one. */
|
|
38
|
+
options?: string[];
|
|
39
|
+
/** Date/number format hint, e.g. "MM/DD/YYYY". */
|
|
40
|
+
format?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ReviewIssue {
|
|
43
|
+
/** Field id the issue relates to (omitted for form-wide issues). */
|
|
44
|
+
field?: string;
|
|
45
|
+
/** Category of suggestion. */
|
|
46
|
+
kind: 'label' | 'validation' | 'logic' | 'type' | 'accessibility' | 'other';
|
|
47
|
+
severity: 'info' | 'suggestion' | 'warning';
|
|
48
|
+
message: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ReviewResult {
|
|
51
|
+
issues: ReviewIssue[];
|
|
52
|
+
/** An improved version of the whole form the user can apply wholesale. */
|
|
53
|
+
improved?: FormField[];
|
|
54
|
+
}
|
|
55
|
+
/** OpenAI content part — text or an image (for vision requests). */
|
|
56
|
+
export type ContentPart = {
|
|
57
|
+
type: 'text';
|
|
58
|
+
text: string;
|
|
59
|
+
} | {
|
|
60
|
+
type: 'image_url';
|
|
61
|
+
image_url: {
|
|
62
|
+
url: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
/** Low-level OpenAI-style chat payload sent to the (user-hosted) proxy. */
|
|
66
|
+
export interface ChatRequest {
|
|
67
|
+
messages: {
|
|
68
|
+
role: 'system' | 'user' | 'assistant';
|
|
69
|
+
content: string | ContentPart[];
|
|
70
|
+
}[];
|
|
71
|
+
/** When true, ask the model for a JSON object and parse the response. */
|
|
72
|
+
json?: boolean;
|
|
73
|
+
temperature?: number;
|
|
74
|
+
model?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface AIClientConfig {
|
|
77
|
+
/** URL of YOUR backend proxy that injects the OpenAI key server-side. */
|
|
78
|
+
endpoint: string;
|
|
79
|
+
/** Extra headers (e.g. auth) sent to your proxy. */
|
|
80
|
+
headers?: Record<string, string>;
|
|
81
|
+
/** Default model (your proxy may override/ignore). Default 'gpt-4o-mini'. */
|
|
82
|
+
model?: string;
|
|
83
|
+
/** Injectable fetch (for tests / non-browser envs). Defaults to global fetch. */
|
|
84
|
+
fetchImpl?: typeof fetch;
|
|
85
|
+
}
|
|
86
|
+
export interface GenerateOptions {
|
|
87
|
+
/** Restrict generation to these control types (defaults to a curated set). */
|
|
88
|
+
allowedTypes?: string[];
|
|
89
|
+
}
|
|
90
|
+
export interface AIClient {
|
|
91
|
+
/** Low-level escape hatch — send a chat request to your proxy. */
|
|
92
|
+
chat(req: ChatRequest): Promise<any>;
|
|
93
|
+
/** Natural-language prompt → a renderable form schema. */
|
|
94
|
+
generateForm(prompt: string, opts?: GenerateOptions): Promise<FormField[]>;
|
|
95
|
+
/** Apply a natural-language edit to an existing form. */
|
|
96
|
+
editForm(current: FormField[], instruction: string): Promise<FormField[]>;
|
|
97
|
+
/** Audit a form and suggest improvements (+ an optional improved version). */
|
|
98
|
+
reviewForm(current: FormField[]): Promise<ReviewResult>;
|
|
99
|
+
/** Extract values from free text/paste into the given fields. */
|
|
100
|
+
extractToFields(text: string, fields: ExtractionField[]): Promise<Record<string, any>>;
|
|
101
|
+
/** Transform a piece of text (rewrite/summarize/translate/…). */
|
|
102
|
+
assistText(text: string, action: AssistAction, targetLanguage?: string): Promise<string>;
|
|
103
|
+
/** Vision: digitize a document/photo of a form into a renderable schema. */
|
|
104
|
+
generateFormFromImage(images: string | string[], prompt?: string, opts?: GenerateOptions): Promise<FormField[]>;
|
|
105
|
+
/** Vision: read a document/photo (receipt, ID, invoice…) into the given fields. */
|
|
106
|
+
extractFromImage(images: string | string[], fields: ExtractionField[]): Promise<Record<string, any>>;
|
|
107
|
+
}
|
|
@@ -33,5 +33,18 @@ export interface FormGeneratorProps {
|
|
|
33
33
|
onFieldDoubleClick?: (field: FormField) => void;
|
|
34
34
|
/** On Field Context Menu (Internal/Builder) */
|
|
35
35
|
onFieldContextMenu?: (event: React.MouseEvent, field: FormField) => void;
|
|
36
|
+
/**
|
|
37
|
+
* By default a form's stored data is removed from the shared store when the
|
|
38
|
+
* component unmounts, preventing the store from growing unbounded across
|
|
39
|
+
* mount/unmount cycles. Set to `true` to keep the data available via
|
|
40
|
+
* `FormData(guid)` after the form has unmounted.
|
|
41
|
+
*/
|
|
42
|
+
persistOnUnmount?: boolean;
|
|
43
|
+
/** Persist form data to browser storage and restore it on mount (draft/auto-save). */
|
|
44
|
+
autoSave?: boolean;
|
|
45
|
+
/** Storage key for auto-save (defaults to `dynamic-mui:<guid>`). */
|
|
46
|
+
autoSaveKey?: string;
|
|
47
|
+
/** Which browser storage to use for auto-save (default 'local'). */
|
|
48
|
+
autoSaveStorage?: 'local' | 'session';
|
|
36
49
|
}
|
|
37
|
-
export declare function FormGenerator({ data, patch, guid, formRef, onSubmit, onChange, onStepChange, MuiGridAttributes, activeStep, onFieldClick, onFieldDoubleClick, onFieldContextMenu, }: FormGeneratorProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare function FormGenerator({ data, patch, guid, formRef, onSubmit, onChange, onStepChange, MuiGridAttributes, activeStep, onFieldClick, onFieldDoubleClick, onFieldContextMenu, persistOnUnmount, autoSave, autoSaveKey, autoSaveStorage, }: FormGeneratorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ControlProps } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Read-only display for a computed / formula field. The value is derived and
|
|
4
|
+
* supplied by FormGenerator's rule engine (via the field's `formula`); this
|
|
5
|
+
* control just presents it, optionally number-formatted, with a prefix/suffix.
|
|
6
|
+
*/
|
|
7
|
+
export default function Computed({ attributes }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ControlProps } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Latitude + longitude coordinate picker with an "Open in Maps" link and an
|
|
4
|
+
* optional OpenStreetMap embed (opt-in via `showMap`).
|
|
5
|
+
*/
|
|
6
|
+
export default function GeoField({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|