data-primals-engine 1.5.0 → 1.5.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/README.md +37 -0
- package/client/src/AddWidgetTypeModal.jsx +47 -43
- package/client/src/App.jsx +2 -6
- package/client/src/App.scss +13 -1
- package/client/src/AssistantChat.jsx +363 -323
- package/client/src/AssistantChat.scss +27 -10
- package/client/src/Dashboard.jsx +480 -396
- package/client/src/Dashboard.scss +1 -1
- package/client/src/DashboardHtmlViewItem.jsx +147 -0
- package/client/src/DashboardView.jsx +654 -569
- package/client/src/DataEditor.jsx +10 -3
- package/client/src/DataLayout.jsx +807 -755
- package/client/src/DataLayout.scss +14 -0
- package/client/src/DataTable.jsx +39 -75
- package/client/src/Dialog.scss +1 -1
- package/client/src/Field.jsx +2057 -1825
- package/client/src/FlexViewCard.jsx +44 -0
- package/client/src/HistoryDialog.jsx +69 -14
- package/client/src/HtmlViewBuilderModal.jsx +91 -0
- package/client/src/HtmlViewBuilderModal.scss +18 -0
- package/client/src/HtmlViewCard.jsx +44 -0
- package/client/src/HtmlViewCard.scss +35 -0
- package/client/src/KanbanCard.jsx +1 -2
- package/client/src/ModelCreator.jsx +5 -4
- package/client/src/ModelCreatorField.jsx +51 -4
- package/client/src/ModelList.jsx +280 -236
- package/client/src/Notification.jsx +136 -136
- package/client/src/Notification.scss +0 -18
- package/client/src/Pagination.jsx +5 -3
- package/client/src/RelationField.jsx +354 -258
- package/client/src/RelationSelectorWidget.jsx +173 -0
- package/client/src/contexts/ModelContext.jsx +10 -1
- package/client/src/contexts/UIContext.jsx +72 -63
- package/client/src/filter.js +263 -212
- package/client/src/hooks/useValidation.js +75 -0
- package/client/src/translations.js +24 -24
- package/package.json +7 -6
- package/src/constants.js +1 -1
- package/src/core.js +8 -1
- package/src/defaultModels.js +1596 -1544
- package/src/engine.js +85 -43
- package/src/events.js +137 -113
- package/src/i18n.js +710 -10
- package/src/index.js +3 -0
- package/src/modules/assistant/assistant.js +253 -134
- package/src/modules/assistant/constants.js +2 -1
- package/src/modules/bucket.js +2 -1
- package/src/modules/data/data.core.js +118 -92
- package/src/modules/data/data.history.js +555 -492
- package/src/modules/data/data.js +3 -53
- package/src/modules/data/data.operations.js +3381 -3231
- package/src/modules/data/data.relations.js +686 -686
- package/src/modules/data/data.routes.js +1879 -1821
- package/src/modules/data/data.validation.js +81 -2
- package/src/modules/file.js +247 -238
- package/src/modules/user.js +1 -0
- package/src/modules/workflow.js +2 -2
- package/src/openai.jobs.js +3 -2
- package/src/packs.js +5482 -5478
- package/src/sso.js +2 -2
- package/src/workers/import-export-worker.js +1 -1
- package/test/data.history.integration.test.js +264 -192
- package/test/data.integration.test.js +149 -3
|
@@ -60,6 +60,8 @@ export const DataEditor = forwardRef(function MyDataEditor({
|
|
|
60
60
|
model,
|
|
61
61
|
onSubmit,
|
|
62
62
|
refreshTime,
|
|
63
|
+
onCancel,
|
|
64
|
+
hideNewButton,
|
|
63
65
|
formData,
|
|
64
66
|
setFormData, record, setRecord}, ref){
|
|
65
67
|
|
|
@@ -182,6 +184,8 @@ export const DataEditor = forwardRef(function MyDataEditor({
|
|
|
182
184
|
/>)}</>
|
|
183
185
|
)}</div>
|
|
184
186
|
}
|
|
187
|
+
|
|
188
|
+
{console.log(formData[field.name])}
|
|
185
189
|
return <CodeField key={field.name} language={field.language} name={inputProps.name}
|
|
186
190
|
value={typeof (value) === 'string' ? value : JSON.stringify(value)}
|
|
187
191
|
onChange={handleChange}/>
|
|
@@ -189,7 +193,7 @@ export const DataEditor = forwardRef(function MyDataEditor({
|
|
|
189
193
|
case 'array':
|
|
190
194
|
if (field.itemsType === 'file') {
|
|
191
195
|
return <div key={field.name}><FileField name={field.name} maxSize={field.maxSize}
|
|
192
|
-
mimeTypes={field.mimeTypes} value={value} onChange={(files) => {
|
|
196
|
+
mimeTypes={field.mimeTypes} multiple value={value} onChange={(files) => {
|
|
193
197
|
handleChange({name: field.name, value: files});
|
|
194
198
|
}} /></div>;
|
|
195
199
|
} else {
|
|
@@ -276,6 +280,8 @@ export const DataEditor = forwardRef(function MyDataEditor({
|
|
|
276
280
|
key={field.name}
|
|
277
281
|
type={getInputType(field.type)} {...inputProps}
|
|
278
282
|
value={displayValue}
|
|
283
|
+
mask={field.mask}
|
|
284
|
+
replacement={field.replacement}
|
|
279
285
|
onChange={(e) => handleChange({name: field.name, value: e.target.value})} />
|
|
280
286
|
}
|
|
281
287
|
case 'file':
|
|
@@ -368,8 +374,9 @@ export const DataEditor = forwardRef(function MyDataEditor({
|
|
|
368
374
|
) : null; // Ne rien afficher si la condition n'est pas remplie
|
|
369
375
|
})}
|
|
370
376
|
<div className="flex flex-centered">
|
|
371
|
-
<Button type="
|
|
372
|
-
<Button type="
|
|
377
|
+
<Button type="button" onClick={handleSubmit} disabled={isLoading}><Trans i18nKey="btns.save">Enregistrer</Trans></Button>
|
|
378
|
+
{onCancel && <Button type="button" className="btn-secondary" onClick={onCancel}><Trans i18nKey="btns.cancel">Annuler</Trans></Button>}
|
|
379
|
+
{!hideNewButton && <Button type="button" onClick={handleNew}><Trans i18nKey="btns.new">Nouveau</Trans></Button>}
|
|
373
380
|
</div>
|
|
374
381
|
</form>
|
|
375
382
|
</div>
|