pict-section-formeditor 1.0.0 → 1.0.2
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/docs/retold-catalog.json +20 -1
- package/docs/retold-keyword-index.json +1 -1
- package/example_applications/form_editor/FormEditor-Example-Application.js +45 -0
- package/example_applications/form_editor/html/form_editor_example.js +19704 -0
- package/package.json +1 -1
- package/source/Pict-Section-FormEditor-DefaultConfiguration.js +246 -0
- package/source/providers/Pict-Provider-FormEditorDocumentation.js +4 -3
- package/source/providers/Pict-Provider-FormEditorRendering.js +50 -0
- package/source/views/PictView-FormEditor-PropertiesPanel.js +180 -28
- package/source/views/PictView-FormEditor.js +317 -2
package/docs/retold-catalog.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"Generated": "2026-02-
|
|
2
|
+
"Generated": "2026-02-23T01:20:17.038Z",
|
|
3
3
|
"GitHubOrg": "stevenvelozo",
|
|
4
4
|
"DefaultBranch": "master",
|
|
5
5
|
"Groups": [
|
|
@@ -20,6 +20,25 @@
|
|
|
20
20
|
}
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
|
+
{
|
|
24
|
+
"Name": "Docs",
|
|
25
|
+
"Key": "docs",
|
|
26
|
+
"Description": "",
|
|
27
|
+
"Modules": [
|
|
28
|
+
{
|
|
29
|
+
"Name": "css",
|
|
30
|
+
"Repo": "css",
|
|
31
|
+
"Group": "docs",
|
|
32
|
+
"Branch": "master",
|
|
33
|
+
"HasDocs": true,
|
|
34
|
+
"HasCover": false,
|
|
35
|
+
"Sidebar": [],
|
|
36
|
+
"DocFiles": [
|
|
37
|
+
"css/docuserve.css"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
23
42
|
{
|
|
24
43
|
"Name": "Example_applications",
|
|
25
44
|
"Key": "example_applications",
|
|
@@ -61,6 +61,13 @@ class FormEditorExampleApplication extends libPictApplication
|
|
|
61
61
|
this._FormEditorView.initialize();
|
|
62
62
|
this._FormEditorView.render();
|
|
63
63
|
|
|
64
|
+
// Wire up the import event to add extra manifests to the selector
|
|
65
|
+
let tmpSelf = this;
|
|
66
|
+
this._FormEditorView.onImport = function(pManifests, pFileName)
|
|
67
|
+
{
|
|
68
|
+
tmpSelf._handleImportedManifests(pManifests, pFileName);
|
|
69
|
+
};
|
|
70
|
+
|
|
64
71
|
// Render the selector bar
|
|
65
72
|
this.renderSelector();
|
|
66
73
|
|
|
@@ -147,6 +154,14 @@ class FormEditorExampleApplication extends libPictApplication
|
|
|
147
154
|
|
|
148
155
|
let tmpEntry = this._ManifestList[pIndex];
|
|
149
156
|
|
|
157
|
+
if (tmpEntry.ManifestData)
|
|
158
|
+
{
|
|
159
|
+
// Directly loaded manifest (e.g. from CSV import)
|
|
160
|
+
this.pict.AppData.FormConfig = tmpEntry.ManifestData;
|
|
161
|
+
this._refreshEditor();
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
|
|
150
165
|
if (!tmpEntry.File)
|
|
151
166
|
{
|
|
152
167
|
// "New Form" — empty manifest
|
|
@@ -188,6 +203,36 @@ class FormEditorExampleApplication extends libPictApplication
|
|
|
188
203
|
tmpXHR.send();
|
|
189
204
|
}
|
|
190
205
|
|
|
206
|
+
_handleImportedManifests(pManifests, pFileName)
|
|
207
|
+
{
|
|
208
|
+
let tmpManifestKeys = Object.keys(pManifests);
|
|
209
|
+
if (tmpManifestKeys.length <= 1)
|
|
210
|
+
{
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Determine the source label from the file extension
|
|
215
|
+
let tmpSourceLabel = pFileName.toLowerCase().endsWith('.json') ? 'JSON' : 'CSV';
|
|
216
|
+
|
|
217
|
+
// Add additional manifests (beyond the first which was auto-loaded) to the selector
|
|
218
|
+
for (let i = 1; i < tmpManifestKeys.length; i++)
|
|
219
|
+
{
|
|
220
|
+
let tmpKey = tmpManifestKeys[i];
|
|
221
|
+
let tmpFormName = pManifests[tmpKey].FormName || tmpKey;
|
|
222
|
+
let tmpEntry = { Name: `${tmpSourceLabel}: ${tmpFormName}`, File: false, ManifestData: pManifests[tmpKey] };
|
|
223
|
+
this._ManifestList.push(tmpEntry);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Re-render the selector to show new entries
|
|
227
|
+
this.renderSelector();
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
loadManifestDirect(pManifestData)
|
|
231
|
+
{
|
|
232
|
+
this.pict.AppData.FormConfig = pManifestData;
|
|
233
|
+
this._refreshEditor();
|
|
234
|
+
}
|
|
235
|
+
|
|
191
236
|
_refreshEditor()
|
|
192
237
|
{
|
|
193
238
|
if (this._FormEditorView)
|