@solidstarters/solid-core-ui 1.1.10 → 1.1.12
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/components/auth/SolidForgotPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidForgotPassword.js +2 -1
- package/dist/components/auth/SolidForgotPassword.js.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.js +2 -1
- package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.js +2 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.js.map +1 -1
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +2 -1
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidOTPVerify.d.ts.map +1 -1
- package/dist/components/auth/SolidOTPVerify.js +2 -1
- package/dist/components/auth/SolidOTPVerify.js.map +1 -1
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +125 -103
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidResetPassword.js +2 -1
- package/dist/components/auth/SolidResetPassword.js.map +1 -1
- package/dist/components/common/DropzonePlaceholder.js +1 -1
- package/dist/components/common/DropzonePlaceholder.js.map +1 -1
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +43 -31
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/core/common/FilterComponent.d.ts +2 -1
- package/dist/components/core/common/FilterComponent.d.ts.map +1 -1
- package/dist/components/core/common/FilterComponent.js +52 -16
- package/dist/components/core/common/FilterComponent.js.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.d.ts +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.js +5 -2
- package/dist/components/core/common/SolidConfigureLayoutElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +131 -23
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/filter/SolidManyToOneFilterElement.d.ts.map +1 -1
- package/dist/components/core/filter/SolidManyToOneFilterElement.js +8 -6
- package/dist/components/core/filter/SolidManyToOneFilterElement.js.map +1 -1
- package/dist/components/core/filter/SolidSelectionDynamicFilterElement.js +1 -1
- package/dist/components/core/filter/SolidSelectionDynamicFilterElement.js.map +1 -1
- package/dist/components/core/filter/SolidSelectionStaticFilterElement.js +1 -1
- package/dist/components/core/filter/SolidSelectionStaticFilterElement.js.map +1 -1
- package/dist/components/core/filter/SolidVarInputsFilterElement.d.ts.map +1 -1
- package/dist/components/core/filter/SolidVarInputsFilterElement.js +11 -10
- package/dist/components/core/filter/SolidVarInputsFilterElement.js.map +1 -1
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +49 -14
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.js +9 -5
- package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.js +12 -8
- package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.js +12 -8
- package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.js +9 -5
- package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.js +9 -5
- package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.js +2 -2
- package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.js +7 -3
- package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +155 -46
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +87 -31
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.js +2 -2
- package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js +4 -4
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.js +18 -9
- package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.js +7 -3
- package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.js +12 -8
- package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +22 -15
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +11 -8
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +2 -2
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +88 -63
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidManyToOneFilterElement.js +7 -5
- package/dist/components/core/list/SolidManyToOneFilterElement.js.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js +3 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +2 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +20 -16
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js +67 -54
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/FieldSelector.js +1 -1
- package/dist/components/core/model/FieldSelector.js.map +1 -1
- package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
- package/dist/components/core/model/ModelMetaData.js +12 -17
- package/dist/components/core/model/ModelMetaData.js.map +1 -1
- package/dist/components/core/module/CreateModule.d.ts.map +1 -1
- package/dist/components/core/module/CreateModule.js +23 -23
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +42 -11
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/components/layout/navbar-two-menu.d.ts.map +1 -1
- package/dist/components/layout/navbar-two-menu.js +6 -2
- package/dist/components/layout/navbar-two-menu.js.map +1 -1
- package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
- package/dist/components/layout/user-profile-menu.js +7 -3
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/helpers/AppTitle.d.ts +4 -0
- package/dist/helpers/AppTitle.d.ts.map +1 -0
- package/dist/helpers/AppTitle.js +8 -0
- package/dist/helpers/AppTitle.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/auth/SolidForgotPassword.tsx +2 -6
- package/src/components/auth/SolidInitialLoginOtp.tsx +2 -6
- package/src/components/auth/SolidInitiateRegisterOtp.tsx +2 -6
- package/src/components/auth/SolidLogin.tsx +2 -5
- package/src/components/auth/SolidOTPVerify.tsx +4 -7
- package/src/components/auth/SolidRegister.tsx +207 -178
- package/src/components/auth/SolidResetPassword.tsx +2 -6
- package/src/components/common/DropzonePlaceholder.tsx +1 -1
- package/src/components/common/GeneralSettings.tsx +310 -193
- package/src/components/core/common/FilterComponent.tsx +148 -202
- package/src/components/core/common/SolidConfigureLayoutElement.tsx +6 -4
- package/src/components/core/common/SolidGlobalSearchElement.tsx +193 -50
- package/src/components/core/filter/SolidManyToOneFilterElement.tsx +5 -3
- package/src/components/core/filter/SolidSelectionDynamicFilterElement.tsx +1 -1
- package/src/components/core/filter/SolidSelectionStaticFilterElement.tsx +1 -1
- package/src/components/core/filter/SolidVarInputsFilterElement.tsx +103 -135
- package/src/components/core/form/SolidFormView.tsx +64 -25
- package/src/components/core/form/fields/SolidBooleanField.tsx +12 -5
- package/src/components/core/form/fields/SolidDateField.tsx +9 -4
- package/src/components/core/form/fields/SolidDateTimeField.tsx +27 -21
- package/src/components/core/form/fields/SolidDecimalField.tsx +9 -2
- package/src/components/core/form/fields/SolidIntegerField.tsx +22 -15
- package/src/components/core/form/fields/SolidJsonField.tsx +14 -12
- package/src/components/core/form/fields/SolidLongTextField.tsx +22 -16
- package/src/components/core/form/fields/SolidMediaMultipleField.tsx +257 -79
- package/src/components/core/form/fields/SolidMediaSingleField.tsx +148 -61
- package/src/components/core/form/fields/SolidRichTextField.tsx +6 -4
- package/src/components/core/form/fields/SolidSelectionDynamicField.tsx +6 -5
- package/src/components/core/form/fields/SolidSelectionStaticField.tsx +34 -23
- package/src/components/core/form/fields/SolidShortTextField.tsx +23 -16
- package/src/components/core/form/fields/SolidTimeField.tsx +27 -20
- package/src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +9 -9
- package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +20 -19
- package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +2 -2
- package/src/components/core/list/SolidListView.tsx +91 -49
- package/src/components/core/list/SolidManyToOneFilterElement.tsx +2 -2
- package/src/components/core/list/columns/SolidBooleanColumn.tsx +2 -2
- package/src/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +1 -1
- package/src/components/core/model/CreateModel.tsx +92 -81
- package/src/components/core/model/FieldMetaDataForm.tsx +166 -87
- package/src/components/core/model/FieldSelector.tsx +1 -1
- package/src/components/core/model/ModelMetaData.tsx +8 -7
- package/src/components/core/module/CreateModule.tsx +181 -183
- package/src/components/layout/AppSidebar.tsx +35 -10
- package/src/components/layout/navbar-two-menu.tsx +6 -1
- package/src/components/layout/user-profile-menu.tsx +20 -8
- package/src/helpers/AppTitle.tsx +14 -0
- package/src/index.ts +2 -1
|
@@ -141,7 +141,7 @@ const SolidField = ({ formik, field, fieldMetadata, initialEntityData, solidForm
|
|
|
141
141
|
solidFormViewMetaData: solidFormViewMetaData,
|
|
142
142
|
modelName: modelName,
|
|
143
143
|
}
|
|
144
|
-
const solidField = fieldFactory(fieldMetadata
|
|
144
|
+
const solidField = fieldFactory(fieldMetadata?.type, fieldContext);
|
|
145
145
|
|
|
146
146
|
return solidField?.render(formik);
|
|
147
147
|
};
|
|
@@ -151,6 +151,10 @@ const SolidGroup = ({ children, attrs }: any) => {
|
|
|
151
151
|
const className = attrs.className;
|
|
152
152
|
|
|
153
153
|
return (
|
|
154
|
+
<div className={className}>
|
|
155
|
+
{attrs.label && <p>{attrs.label}</p>}
|
|
156
|
+
<div className="grid">{children}</div>
|
|
157
|
+
</div>
|
|
154
158
|
// <div className={className}>
|
|
155
159
|
// <div className="s_group">
|
|
156
160
|
// <fieldset>
|
|
@@ -160,9 +164,9 @@ const SolidGroup = ({ children, attrs }: any) => {
|
|
|
160
164
|
// </div>
|
|
161
165
|
|
|
162
166
|
// </div>
|
|
163
|
-
<div className="formgrid grid">
|
|
164
|
-
|
|
165
|
-
</div>
|
|
167
|
+
// <div className="formgrid grid">
|
|
168
|
+
// {children}
|
|
169
|
+
// </div>
|
|
166
170
|
);
|
|
167
171
|
};
|
|
168
172
|
|
|
@@ -181,7 +185,11 @@ const SolidRow = ({ children, attrs }: any) => {
|
|
|
181
185
|
// </div>
|
|
182
186
|
|
|
183
187
|
// </div>
|
|
184
|
-
<div
|
|
188
|
+
<div className={`row ${className}`}>
|
|
189
|
+
{attrs.label && <p >{attrs.label}</p>}
|
|
190
|
+
<div className="grid">{children}</div>
|
|
191
|
+
</div>
|
|
192
|
+
// <div>{children}</div>
|
|
185
193
|
);
|
|
186
194
|
};
|
|
187
195
|
const SolidColumn = ({ children, attrs }: any) => {
|
|
@@ -197,31 +205,36 @@ const SolidColumn = ({ children, attrs }: any) => {
|
|
|
197
205
|
// </div>
|
|
198
206
|
|
|
199
207
|
// </div>
|
|
200
|
-
<div className=
|
|
201
|
-
{
|
|
208
|
+
<div className={`${className}`}>
|
|
209
|
+
{attrs.label && <p>{attrs.label}</p>}
|
|
210
|
+
<div className="grid">{children}</div>
|
|
202
211
|
</div>
|
|
212
|
+
// <div className="formgrid grid">
|
|
213
|
+
// {children}
|
|
214
|
+
// </div>
|
|
203
215
|
);
|
|
204
216
|
};
|
|
205
217
|
|
|
206
218
|
const SolidSheet = ({ children }: any) => (
|
|
207
|
-
|
|
208
|
-
<div>
|
|
219
|
+
<div className="p-fluid p-grid">
|
|
209
220
|
{children}
|
|
210
221
|
</div>
|
|
211
222
|
);
|
|
212
223
|
const SolidNotebook = ({ children }: any) => {
|
|
213
224
|
|
|
214
225
|
return (
|
|
215
|
-
<
|
|
216
|
-
|
|
217
|
-
|
|
226
|
+
<div className="solid-tab-view w-full">
|
|
227
|
+
<TabView>
|
|
228
|
+
{children}
|
|
229
|
+
</TabView>
|
|
230
|
+
</div>
|
|
218
231
|
)
|
|
219
232
|
};
|
|
220
233
|
|
|
221
234
|
|
|
222
235
|
const SolidPage = ({ attrs, children, key }: any) => (
|
|
223
236
|
<TabPanel key={key} header={attrs.label} >
|
|
224
|
-
<div>{children}</div>
|
|
237
|
+
<div className="p-fluid">{children}</div>
|
|
225
238
|
</TabPanel>
|
|
226
239
|
);
|
|
227
240
|
|
|
@@ -281,6 +294,8 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
281
294
|
|
|
282
295
|
const [actionsAllowed, setActionsAllowed] = useState<string[]>([]);
|
|
283
296
|
|
|
297
|
+
const errorFields: string[] = [];
|
|
298
|
+
|
|
284
299
|
const [triggerCheckIfPermissionExists] = useLazyCheckIfPermissionExistsQuery();
|
|
285
300
|
useEffect(() => {
|
|
286
301
|
|
|
@@ -456,7 +471,7 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
456
471
|
modelName: params.modelName,
|
|
457
472
|
}
|
|
458
473
|
|
|
459
|
-
let solidField = fieldFactory(fieldMetadata
|
|
474
|
+
let solidField = fieldFactory(fieldMetadata?.type, fieldContext);
|
|
460
475
|
|
|
461
476
|
// Append each field to the FormData
|
|
462
477
|
if (value !== undefined && value !== null && solidField) {
|
|
@@ -480,6 +495,26 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
480
495
|
}
|
|
481
496
|
}
|
|
482
497
|
|
|
498
|
+
const showFieldError = () => {
|
|
499
|
+
if (errorFields.length === 0) return;
|
|
500
|
+
errorFields.forEach((error) => {
|
|
501
|
+
toast?.current?.show({
|
|
502
|
+
severity: "error",
|
|
503
|
+
summary: "Metadata Error",
|
|
504
|
+
detail: error,
|
|
505
|
+
life: 3000,
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
// errorFields.length = 0;
|
|
511
|
+
};
|
|
512
|
+
useEffect(() => {
|
|
513
|
+
if (errorFields.length > 0) {
|
|
514
|
+
showFieldError();
|
|
515
|
+
}
|
|
516
|
+
}, [errorFields])
|
|
517
|
+
|
|
483
518
|
// - - - - - - - - - - - -- - - - - - - - - - - - DATA here
|
|
484
519
|
// Fetch the actual data here.
|
|
485
520
|
// This is the initial value of this form, will come from an API call in the case of edit.
|
|
@@ -493,10 +528,10 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
493
528
|
for (let i = 0; i < layoutFields.length; i++) {
|
|
494
529
|
const formLayoutField = layoutFields[i];
|
|
495
530
|
const fieldMetadata = solidFieldsMetadata[formLayoutField.attrs.name];
|
|
496
|
-
if (fieldMetadata
|
|
531
|
+
if (fieldMetadata?.type === 'relation') {
|
|
497
532
|
toPopulate.push(fieldMetadata.name);
|
|
498
533
|
}
|
|
499
|
-
if (fieldMetadata
|
|
534
|
+
if (fieldMetadata?.type === 'mediaSingle' || fieldMetadata?.type === 'mediaMultiple') {
|
|
500
535
|
toPopulateMedia.push(fieldMetadata.name);
|
|
501
536
|
}
|
|
502
537
|
}
|
|
@@ -550,7 +585,13 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
550
585
|
solidFormViewMetaData: solidFormViewMetaData,
|
|
551
586
|
modelName: params.modelName,
|
|
552
587
|
}
|
|
553
|
-
let solidField = fieldFactory(fieldMetadata
|
|
588
|
+
let solidField = fieldFactory(fieldMetadata?.type, fieldContext);
|
|
589
|
+
if (!fieldMetadata?.type) {
|
|
590
|
+
const errorMessage = formLayoutField.attrs.label;
|
|
591
|
+
if (!errorFields.includes(errorMessage)) {
|
|
592
|
+
errorFields.push(errorMessage);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
554
595
|
if (solidField) {
|
|
555
596
|
// @ts-ignore
|
|
556
597
|
validationSchema[formLayoutField.attrs.name] = solidField.validationSchema();
|
|
@@ -651,7 +692,7 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
651
692
|
<div className="solid-form-wrapper">
|
|
652
693
|
<Toast ref={toast} />
|
|
653
694
|
|
|
654
|
-
<form onSubmit={formik.handleSubmit}>
|
|
695
|
+
<form style={{ width: '77.5%', borderRight: '1px solid var(--primary-light-color' }} onSubmit={formik.handleSubmit}>
|
|
655
696
|
<div className="solid-form-header">
|
|
656
697
|
{params.id === "new" ? (
|
|
657
698
|
<>
|
|
@@ -807,13 +848,11 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
807
848
|
<SolidFormStepper />
|
|
808
849
|
</div>
|
|
809
850
|
<div className="p-4 solid-form-content">
|
|
810
|
-
|
|
811
|
-
<div className="col-8 mx-auto">
|
|
812
|
-
{renderFormDynamically(formViewMetaData)}
|
|
813
|
-
</div>
|
|
814
|
-
</div>
|
|
851
|
+
{renderFormDynamically(formViewMetaData)}
|
|
815
852
|
</div>
|
|
816
|
-
</form
|
|
853
|
+
</form>
|
|
854
|
+
<div style={{ width: '22.5%' }}>
|
|
855
|
+
</div>
|
|
817
856
|
<Dialog
|
|
818
857
|
visible={isDeleteDialogVisible}
|
|
819
858
|
header="Confirm Delete"
|
|
@@ -828,7 +867,7 @@ const SolidFormView = (params: SolidFormViewProps) => {
|
|
|
828
867
|
>
|
|
829
868
|
<p>Are you sure you want to delete?</p>
|
|
830
869
|
</Dialog>
|
|
831
|
-
</div
|
|
870
|
+
</div>
|
|
832
871
|
);
|
|
833
872
|
|
|
834
873
|
}
|
|
@@ -23,7 +23,12 @@ export class SolidBooleanField implements ISolidField {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
initialValue(): any {
|
|
26
|
-
|
|
26
|
+
const fieldName = this.fieldContext.field.attrs.name;
|
|
27
|
+
const fieldDefaultValue = this.fieldContext?.fieldMetadata?.defaultValue;
|
|
28
|
+
|
|
29
|
+
const existingValue = this.fieldContext.data[fieldName];
|
|
30
|
+
|
|
31
|
+
return existingValue !== undefined && existingValue !== null ? existingValue : fieldDefaultValue || '';
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
validationSchema(): Schema {
|
|
@@ -59,7 +64,7 @@ export class SolidBooleanField implements ISolidField {
|
|
|
59
64
|
|
|
60
65
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
61
66
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
62
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
67
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
63
68
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
64
69
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
65
70
|
const booleanOptions = ["false", "true"];
|
|
@@ -77,6 +82,7 @@ export class SolidBooleanField implements ISolidField {
|
|
|
77
82
|
|
|
78
83
|
return (
|
|
79
84
|
<div className={className}>
|
|
85
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
80
86
|
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
81
87
|
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
82
88
|
</label>
|
|
@@ -100,9 +106,10 @@ export class SolidBooleanField implements ISolidField {
|
|
|
100
106
|
})}
|
|
101
107
|
|
|
102
108
|
/>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
)}
|
|
109
|
+
</div>
|
|
110
|
+
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
111
|
+
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
112
|
+
)}
|
|
106
113
|
</div>
|
|
107
114
|
);
|
|
108
115
|
}
|
|
@@ -22,7 +22,12 @@ export class SolidDateField implements ISolidField {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
initialValue(): any {
|
|
25
|
-
|
|
25
|
+
const fieldName = this.fieldContext.field.attrs.name;
|
|
26
|
+
const fieldDefaultValue = this.fieldContext?.fieldMetadata?.defaultValue;
|
|
27
|
+
|
|
28
|
+
const existingValue = this.fieldContext.data[fieldName];
|
|
29
|
+
|
|
30
|
+
return existingValue !== undefined && existingValue !== null ? existingValue : fieldDefaultValue || '';
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
validationSchema(): Schema {
|
|
@@ -41,7 +46,7 @@ export class SolidDateField implements ISolidField {
|
|
|
41
46
|
render(formik: FormikObject) {
|
|
42
47
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
43
48
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
44
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
49
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
45
50
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
46
51
|
const calendarRef = useRef<any>(null); // Reference for the Calendar component
|
|
47
52
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
@@ -56,8 +61,8 @@ export class SolidDateField implements ISolidField {
|
|
|
56
61
|
|
|
57
62
|
return (
|
|
58
63
|
<div className={className}>
|
|
64
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
59
65
|
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
60
|
-
|
|
61
66
|
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
62
67
|
</label>
|
|
63
68
|
<Calendar
|
|
@@ -74,7 +79,7 @@ export class SolidDateField implements ISolidField {
|
|
|
74
79
|
hideOnDateTimeSelect
|
|
75
80
|
className=""
|
|
76
81
|
/>
|
|
77
|
-
|
|
82
|
+
</div>
|
|
78
83
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
79
84
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
80
85
|
)}
|
|
@@ -22,7 +22,12 @@ export class SolidDateTimeField implements ISolidField {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
initialValue(): any {
|
|
25
|
-
|
|
25
|
+
const fieldName = this.fieldContext.field.attrs.name;
|
|
26
|
+
const fieldDefaultValue = this.fieldContext?.fieldMetadata?.defaultValue;
|
|
27
|
+
|
|
28
|
+
const existingValue = this.fieldContext.data[fieldName];
|
|
29
|
+
|
|
30
|
+
return existingValue !== undefined && existingValue !== null ? existingValue : fieldDefaultValue || '';
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
validationSchema(): Schema {
|
|
@@ -41,7 +46,7 @@ export class SolidDateTimeField implements ISolidField {
|
|
|
41
46
|
render(formik: FormikObject) {
|
|
42
47
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
43
48
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
44
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
49
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
45
50
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
46
51
|
const calendarRef = useRef<any>(null); // Reference for the Calendar component
|
|
47
52
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
@@ -54,26 +59,27 @@ export class SolidDateTimeField implements ISolidField {
|
|
|
54
59
|
|
|
55
60
|
return (
|
|
56
61
|
<div className={className}>
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
63
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
64
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
65
|
+
</label>
|
|
66
|
+
<Calendar
|
|
67
|
+
disabled={formDisabled || fieldDisabled}
|
|
68
|
+
ref={calendarRef} // Attach ref to Calendar
|
|
69
|
+
id={fieldLayoutInfo.attrs.name}
|
|
70
|
+
aria-describedby={`${fieldLayoutInfo.attrs.name}-help`}
|
|
71
|
+
onChange={formik.handleChange}
|
|
72
|
+
//@ts-ignore
|
|
73
|
+
value={formik.values[fieldLayoutInfo.attrs.name] ? new Date(formik.values[fieldLayoutInfo.attrs.name]) : Date()}
|
|
74
|
+
// dateFormat="mm/dd/yy"
|
|
75
|
+
// placeholder="mm/dd/yyyy hh:mm"
|
|
76
|
+
mask="99/99/9999 99:99"
|
|
77
|
+
hideOnDateTimeSelect
|
|
78
|
+
showTime className=""
|
|
79
|
+
hourFormat="24"
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
77
83
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
78
84
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
79
85
|
)}
|
|
@@ -21,7 +21,12 @@ export class SolidDecimalField implements ISolidField {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
initialValue(): any {
|
|
24
|
-
|
|
24
|
+
const fieldName = this.fieldContext.field.attrs.name;
|
|
25
|
+
const fieldDefaultValue = this.fieldContext?.fieldMetadata?.defaultValue;
|
|
26
|
+
|
|
27
|
+
const existingValue = this.fieldContext.data[fieldName];
|
|
28
|
+
|
|
29
|
+
return existingValue !== undefined && existingValue !== null ? existingValue : fieldDefaultValue || '';
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
validationSchema(): Schema {
|
|
@@ -43,7 +48,7 @@ export class SolidDecimalField implements ISolidField {
|
|
|
43
48
|
render(formik: FormikObject) {
|
|
44
49
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
45
50
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
46
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
51
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
47
52
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
48
53
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
49
54
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
@@ -58,6 +63,7 @@ export class SolidDecimalField implements ISolidField {
|
|
|
58
63
|
|
|
59
64
|
return (
|
|
60
65
|
<div className={className}>
|
|
66
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
61
67
|
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
62
68
|
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
63
69
|
</label>
|
|
@@ -75,6 +81,7 @@ export class SolidDecimalField implements ISolidField {
|
|
|
75
81
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
76
82
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
77
83
|
)}
|
|
84
|
+
</div>
|
|
78
85
|
</div>
|
|
79
86
|
);
|
|
80
87
|
}
|
|
@@ -21,7 +21,12 @@ export class SolidIntegerField implements ISolidField {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
initialValue(): any {
|
|
24
|
-
|
|
24
|
+
const fieldName = this.fieldContext.field.attrs.name;
|
|
25
|
+
const fieldDefaultValue = this.fieldContext?.fieldMetadata?.defaultValue;
|
|
26
|
+
|
|
27
|
+
const existingValue = this.fieldContext.data[fieldName];
|
|
28
|
+
|
|
29
|
+
return existingValue !== undefined && existingValue !== null ? existingValue : fieldDefaultValue || '';
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
validationSchema(): Schema {
|
|
@@ -44,7 +49,7 @@ export class SolidIntegerField implements ISolidField {
|
|
|
44
49
|
render(formik: FormikObject) {
|
|
45
50
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
46
51
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
47
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
52
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
48
53
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
49
54
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
50
55
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
@@ -59,19 +64,21 @@ export class SolidIntegerField implements ISolidField {
|
|
|
59
64
|
|
|
60
65
|
return (
|
|
61
66
|
<div className={className}>
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
68
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
69
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
70
|
+
</label>
|
|
71
|
+
<InputNumber
|
|
72
|
+
readOnly={formReadonly || fieldReadonly}
|
|
73
|
+
disabled={formDisabled || fieldDisabled}
|
|
74
|
+
id={fieldLayoutInfo.attrs.name}
|
|
75
|
+
aria-describedby={`${fieldLayoutInfo.attrs.name}-help`}
|
|
76
|
+
onChange={(e: any) => {
|
|
77
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, e.value)
|
|
78
|
+
}}
|
|
79
|
+
value={formik.values[fieldLayoutInfo.attrs.name] || ''}
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
75
82
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
76
83
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
77
84
|
)}
|
|
@@ -43,7 +43,7 @@ export class SolidJsonField implements ISolidField {
|
|
|
43
43
|
render(formik: FormikObject) {
|
|
44
44
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
45
45
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
46
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-12
|
|
46
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
47
47
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
48
48
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
49
49
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
@@ -55,18 +55,20 @@ export class SolidJsonField implements ISolidField {
|
|
|
55
55
|
|
|
56
56
|
return (
|
|
57
57
|
<div className={className}>
|
|
58
|
-
<
|
|
58
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
59
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
62
|
+
</label>
|
|
63
|
+
<CodeEditor
|
|
64
|
+
formik={formik}
|
|
65
|
+
field={fieldLayoutInfo.attrs.name}
|
|
66
|
+
height={fieldLayoutInfo.attrs?.height}
|
|
67
|
+
fontSize={fieldLayoutInfo.attrs?.fontSize}
|
|
68
|
+
readOnly={formReadonly || fieldReadonly}
|
|
69
|
+
>
|
|
70
|
+
</CodeEditor>
|
|
71
|
+
</div>
|
|
70
72
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
71
73
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
72
74
|
)}
|
|
@@ -21,7 +21,12 @@ export class SolidLongTextField implements ISolidField {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
initialValue(): any {
|
|
24
|
-
|
|
24
|
+
const fieldName = this.fieldContext.field.attrs.name;
|
|
25
|
+
const fieldDefaultValue = this.fieldContext?.fieldMetadata?.defaultValue;
|
|
26
|
+
|
|
27
|
+
const existingValue = this.fieldContext.data[fieldName];
|
|
28
|
+
|
|
29
|
+
return existingValue !== undefined && existingValue !== null ? existingValue : fieldDefaultValue || '';
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
validationSchema(): Schema {
|
|
@@ -56,7 +61,7 @@ export class SolidLongTextField implements ISolidField {
|
|
|
56
61
|
render(formik: FormikObject) {
|
|
57
62
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
58
63
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
59
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
64
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
60
65
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
61
66
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
62
67
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
@@ -71,20 +76,21 @@ export class SolidLongTextField implements ISolidField {
|
|
|
71
76
|
|
|
72
77
|
return (
|
|
73
78
|
<div className={className}>
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
80
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
81
|
+
{fieldDescription && <span>({fieldDescription}) </span>}
|
|
82
|
+
</label>
|
|
83
|
+
<InputTextarea
|
|
84
|
+
readOnly={formReadonly || fieldReadonly}
|
|
85
|
+
disabled={formDisabled || fieldDisabled}
|
|
86
|
+
id={fieldLayoutInfo.attrs.name}
|
|
87
|
+
aria-describedby={`${fieldLayoutInfo.attrs.name}-help`}
|
|
88
|
+
onChange={formik.handleChange}
|
|
89
|
+
value={formik.values[fieldLayoutInfo.attrs.name] || ''}
|
|
90
|
+
rows={5}
|
|
91
|
+
cols={30}
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
88
94
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
89
95
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
90
96
|
)}
|