@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
|
@@ -29,7 +29,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
29
29
|
|
|
30
30
|
const manyToManyFieldData = this.fieldContext.data[this.fieldContext.field.attrs.name];
|
|
31
31
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
32
|
-
const userKeyField = fieldMetadata
|
|
32
|
+
const userKeyField = fieldMetadata?.relationModel?.userKeyField?.name;
|
|
33
33
|
if (manyToManyFieldData) {
|
|
34
34
|
return manyToManyFieldData.map((e: any) => {
|
|
35
35
|
const manyToManyColVal = e[userKeyField] || '';
|
|
@@ -97,7 +97,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
97
97
|
render(formik: FormikObject) {
|
|
98
98
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
99
99
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
100
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
100
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
101
101
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
102
102
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
103
103
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
@@ -134,7 +134,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
134
134
|
renderCheckBoxMode(formik: FormikObject, visibleCreateRelationEntity: any, setvisibleCreateRelationEntity: any) {
|
|
135
135
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
136
136
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
137
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
137
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
138
138
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
139
139
|
|
|
140
140
|
// auto complete specific code.
|
|
@@ -150,7 +150,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
150
150
|
let filterQuery;
|
|
151
151
|
if (query) {
|
|
152
152
|
filterQuery = {
|
|
153
|
-
[fieldMetadata
|
|
153
|
+
[fieldMetadata?.relationModel?.userKeyField?.name]: {
|
|
154
154
|
'$containsi': query
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -175,7 +175,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
175
175
|
if (autocompleteData) {
|
|
176
176
|
const autoCompleteItems = autocompleteData.records.map((item: any) => {
|
|
177
177
|
return {
|
|
178
|
-
label: item[fieldMetadata
|
|
178
|
+
label: item[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
179
179
|
value: item['id'],
|
|
180
180
|
original: item
|
|
181
181
|
}
|
|
@@ -205,7 +205,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
205
205
|
const updatedRelationData = [
|
|
206
206
|
...currentRelationData,
|
|
207
207
|
{
|
|
208
|
-
label: jsonValues[fieldMetadata
|
|
208
|
+
label: jsonValues[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
209
209
|
value: "new",
|
|
210
210
|
original: jsonValues,
|
|
211
211
|
},
|
|
@@ -309,7 +309,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
309
309
|
offset: 0,
|
|
310
310
|
limit: 10,
|
|
311
311
|
filters: {
|
|
312
|
-
[fieldMetadata
|
|
312
|
+
[fieldMetadata?.relationModel?.userKeyField?.name]: {
|
|
313
313
|
'$containsi': event.query
|
|
314
314
|
}
|
|
315
315
|
}
|
|
@@ -328,7 +328,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
328
328
|
if (autocompleteData) {
|
|
329
329
|
const autoCompleteItems = autocompleteData.records.map((item: any) => {
|
|
330
330
|
return {
|
|
331
|
-
label: item[fieldMetadata
|
|
331
|
+
label: item[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
332
332
|
value: item['id'],
|
|
333
333
|
original: item
|
|
334
334
|
|
|
@@ -344,7 +344,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
344
344
|
const updatedRelationData = [
|
|
345
345
|
...currentRelationData,
|
|
346
346
|
{
|
|
347
|
-
label: jsonValues[fieldMetadata
|
|
347
|
+
label: jsonValues[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
348
348
|
value: "new",
|
|
349
349
|
original: jsonValues,
|
|
350
350
|
},
|
|
@@ -21,7 +21,7 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
21
21
|
|
|
22
22
|
const manyToOneFieldData = this.fieldContext.data[this.fieldContext.field.attrs.name];
|
|
23
23
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
24
|
-
const userKeyField = fieldMetadata
|
|
24
|
+
const userKeyField = fieldMetadata?.relationModel?.userKeyField?.name;
|
|
25
25
|
const manyToOneColVal = manyToOneFieldData ? manyToOneFieldData[userKeyField] : '';
|
|
26
26
|
if (manyToOneColVal) {
|
|
27
27
|
return { label: manyToOneColVal || '', value: manyToOneFieldData?.id || '' };
|
|
@@ -54,7 +54,7 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
54
54
|
render(formik: FormikObject) {
|
|
55
55
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
56
56
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
57
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
57
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
58
58
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
59
59
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
60
60
|
|
|
@@ -77,7 +77,7 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
77
77
|
offset: 0,
|
|
78
78
|
limit: 10,
|
|
79
79
|
filters: {
|
|
80
|
-
[fieldMetadata
|
|
80
|
+
[fieldMetadata?.relationModel?.userKeyField?.name]: {
|
|
81
81
|
'$containsi': event.query
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -96,7 +96,7 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
96
96
|
if (autocompleteData) {
|
|
97
97
|
const autoCompleteItems = autocompleteData.records.map((item: any) => {
|
|
98
98
|
return {
|
|
99
|
-
label: item[fieldMetadata
|
|
99
|
+
label: item[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
100
100
|
value: item['id']
|
|
101
101
|
}
|
|
102
102
|
});
|
|
@@ -109,21 +109,22 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
109
109
|
|
|
110
110
|
return (
|
|
111
111
|
<div className={className}>
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
112
|
+
<div className="flex flex-column gap-2 mt-4">
|
|
113
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
114
|
+
</label>
|
|
115
|
+
<AutoComplete
|
|
116
|
+
readOnly={formReadonly || fieldReadonly}
|
|
117
|
+
disabled={formDisabled || fieldDisabled}
|
|
118
|
+
{...formik.getFieldProps(fieldLayoutInfo.attrs.name)}
|
|
119
|
+
id={fieldLayoutInfo.attrs.name}
|
|
120
|
+
field="label"
|
|
121
|
+
value={formik.values[fieldLayoutInfo.attrs.name] || ''}
|
|
122
|
+
dropdown
|
|
123
|
+
suggestions={autoCompleteItems}
|
|
124
|
+
completeMethod={autoCompleteSearch}
|
|
125
|
+
onChange={formik.handleChange}
|
|
126
|
+
/>
|
|
127
|
+
</div>
|
|
127
128
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
128
129
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
129
130
|
)}
|
|
@@ -54,7 +54,7 @@ export class SolidRelationOneToManyField implements ISolidField {
|
|
|
54
54
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
55
55
|
|
|
56
56
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
57
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-12
|
|
57
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
58
58
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
59
59
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
60
60
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
@@ -151,7 +151,7 @@ export class SolidRelationOneToManyField implements ISolidField {
|
|
|
151
151
|
|
|
152
152
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
153
153
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
154
|
-
const className = fieldLayoutInfo.attrs?.className || 'col-12
|
|
154
|
+
const className = fieldLayoutInfo.attrs?.className || 'col-12';
|
|
155
155
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
156
156
|
|
|
157
157
|
|
|
@@ -31,6 +31,8 @@ import { SolidConfigureLayoutElement } from '../common/SolidConfigureLayoutEleme
|
|
|
31
31
|
import { FilterIcon } from '../../modelsComponents/filterIcon';
|
|
32
32
|
import { OverlayPanel } from "primereact/overlaypanel";
|
|
33
33
|
import { Toast } from "primereact/toast";
|
|
34
|
+
import { Divider } from "primereact/divider";
|
|
35
|
+
|
|
34
36
|
const getRandomInt = (min: number, max: number) => {
|
|
35
37
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
36
38
|
}
|
|
@@ -121,20 +123,23 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
121
123
|
|
|
122
124
|
const initialFilters: any = {};
|
|
123
125
|
const toPopulate: string[] = [];
|
|
124
|
-
for (let i = 0; i < solidView.layout.children
|
|
126
|
+
for (let i = 0; i < solidView.layout.children?.length; i++) {
|
|
125
127
|
const column = solidView.layout.children[i];
|
|
126
128
|
const fieldMetadata = solidFieldsMetadata[column.attrs.name];
|
|
127
|
-
|
|
129
|
+
if (!fieldMetadata?.type) {
|
|
130
|
+
showFieldError(`${column.attrs.label} is not present in metadata`)
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
128
133
|
// Form the initial filters after iterating over the columns and field metadata.
|
|
129
|
-
if (['int', 'bigint', 'float', 'decimal'].includes(fieldMetadata
|
|
134
|
+
if (['int', 'bigint', 'float', 'decimal'].includes(fieldMetadata?.type)) {
|
|
130
135
|
// initialFilters[column.attrs.name] = { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.EQUALS }] }
|
|
131
136
|
initialFilters[column.attrs.name] = { value: null, matchMode: FilterMatchMode.EQUALS }
|
|
132
137
|
}
|
|
133
|
-
else if (['date', 'datetime', 'time', 'boolean'].includes(fieldMetadata
|
|
138
|
+
else if (['date', 'datetime', 'time', 'boolean'].includes(fieldMetadata?.type)) {
|
|
134
139
|
// initialFilters[column.attrs.name] = { operator: FilterOperator.OR, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] }
|
|
135
140
|
initialFilters[column.attrs.name] = { value: null, matchMode: FilterMatchMode.EQUALS }
|
|
136
141
|
}
|
|
137
|
-
else if (['relation', 'selectionStatic', 'selectionDynamic'].includes(fieldMetadata
|
|
142
|
+
else if (['relation', 'selectionStatic', 'selectionDynamic'].includes(fieldMetadata?.type)) {
|
|
138
143
|
initialFilters[column.attrs.name] = { value: null, matchMode: FilterMatchMode.IN }
|
|
139
144
|
}
|
|
140
145
|
else {
|
|
@@ -402,7 +407,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
402
407
|
if (sortField) {
|
|
403
408
|
const sortFieldMetadata = solidFieldsMetadata[sortField];
|
|
404
409
|
if (sortFieldMetadata.type === 'relation' && sortFieldMetadata.relationType === 'many-to-one') {
|
|
405
|
-
sortField = `${sortField}.${sortFieldMetadata
|
|
410
|
+
sortField = `${sortField}.${sortFieldMetadata?.relationModel?.userKeyField?.name}`;
|
|
406
411
|
}
|
|
407
412
|
queryData.sort = [
|
|
408
413
|
`${sortField}:${sortOrder == 0 ? null : sortOrder == 1 ? "asc" : "desc"}`,
|
|
@@ -440,8 +445,12 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
440
445
|
solidGlobalSearchElementRef.current.clearFilter()
|
|
441
446
|
};
|
|
442
447
|
|
|
443
|
-
const [solidsolidViewDataId, setSolidViewDataId] = useState<number | null>()
|
|
448
|
+
const [solidsolidViewDataId, setSolidViewDataId] = useState<number | null>();
|
|
449
|
+
const [solidFieldName, setSolidFieldName] = useState<string>("")
|
|
450
|
+
|
|
444
451
|
const op = useRef(null)
|
|
452
|
+
const [deleteEntity, setDeleteEntity] = useState(false);
|
|
453
|
+
|
|
445
454
|
|
|
446
455
|
// clickable link allowing one to open the detail / form view.
|
|
447
456
|
const detailsBodyTemplate = (solidViewData: any) => {
|
|
@@ -455,7 +464,8 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
455
464
|
// @ts-ignore
|
|
456
465
|
{
|
|
457
466
|
op.current.toggle(e);
|
|
458
|
-
setSolidViewDataId(solidViewData.id)
|
|
467
|
+
setSolidViewDataId(solidViewData.id);
|
|
468
|
+
setSolidFieldName(solidViewData?.singularName)
|
|
459
469
|
}
|
|
460
470
|
}
|
|
461
471
|
|
|
@@ -494,8 +504,30 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
494
504
|
icon={<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
495
505
|
<path d="M4.66666 14C4.29999 14 3.9861 13.8694 3.72499 13.6083C3.46388 13.3472 3.33332 13.0333 3.33332 12.6667V4H2.66666V2.66667H5.99999V2H9.99999V2.66667H13.3333V4H12.6667V12.6667C12.6667 13.0333 12.5361 13.3472 12.275 13.6083C12.0139 13.8694 11.7 14 11.3333 14H4.66666ZM11.3333 4H4.66666V12.6667H11.3333V4ZM5.99999 11.3333H7.33332V5.33333H5.99999V11.3333ZM8.66666 11.3333H9.99999V5.33333H8.66666V11.3333Z" fill="#4B4D52" />
|
|
496
506
|
</svg>}
|
|
497
|
-
onClick={() =>
|
|
507
|
+
onClick={() => setDeleteEntity(true)}
|
|
498
508
|
/>
|
|
509
|
+
{solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons &&
|
|
510
|
+
solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons.map((rowAction: any) => {
|
|
511
|
+
return (
|
|
512
|
+
<Button
|
|
513
|
+
text
|
|
514
|
+
size="small"
|
|
515
|
+
icon={rowAction?.attrs?.className ? rowAction?.attrs?.className : "pi pi-pencil"}
|
|
516
|
+
onClick={() => {
|
|
517
|
+
setListRowActionData({
|
|
518
|
+
modelName: params.modelName,
|
|
519
|
+
moduleName: params.moduleName,
|
|
520
|
+
rowAction: rowAction,
|
|
521
|
+
rowData: rowData,
|
|
522
|
+
closeListViewRowActionPopup: closeListViewRowActionPopup
|
|
523
|
+
|
|
524
|
+
});
|
|
525
|
+
setListViewRowActionPopupState(true)
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
/>
|
|
529
|
+
);
|
|
530
|
+
})}
|
|
499
531
|
</div>
|
|
500
532
|
</OverlayPanel>
|
|
501
533
|
</div>
|
|
@@ -556,6 +588,28 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
556
588
|
}
|
|
557
589
|
};
|
|
558
590
|
|
|
591
|
+
const showFieldError = async (error) => {
|
|
592
|
+
if (error) {
|
|
593
|
+
toast?.current?.show({
|
|
594
|
+
severity: "error",
|
|
595
|
+
summary: "Can you send me the report?",
|
|
596
|
+
// sticky: true,
|
|
597
|
+
life: 3000,
|
|
598
|
+
//@ts-ignore
|
|
599
|
+
content: (props) => (
|
|
600
|
+
<div
|
|
601
|
+
className="flex flex-column align-items-left"
|
|
602
|
+
style={{ flex: "1" }}
|
|
603
|
+
>
|
|
604
|
+
<div className="flex align-items-center gap-2" >
|
|
605
|
+
<span className="font-bold text-900">{String(error)}</span>
|
|
606
|
+
</div>
|
|
607
|
+
</div>
|
|
608
|
+
),
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
|
|
559
613
|
// handle bulk deletion
|
|
560
614
|
const deleteBulk = () => {
|
|
561
615
|
let deleteList: any = [];
|
|
@@ -587,7 +641,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
587
641
|
if (!solidView || !solidFieldsMetadata) {
|
|
588
642
|
return;
|
|
589
643
|
}
|
|
590
|
-
return solidView.layout.children
|
|
644
|
+
return solidView.layout.children?.map((column: any) => {
|
|
591
645
|
const fieldMetadata = solidFieldsMetadata[column.attrs.name];
|
|
592
646
|
if (!fieldMetadata) {
|
|
593
647
|
return;
|
|
@@ -624,7 +678,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
624
678
|
return (
|
|
625
679
|
<>
|
|
626
680
|
<div className="page-header">
|
|
627
|
-
|
|
681
|
+
<Toast ref={toast} />
|
|
628
682
|
<div className="flex gap-3 align-items-center">
|
|
629
683
|
|
|
630
684
|
|
|
@@ -633,10 +687,9 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
633
687
|
label="Delete"
|
|
634
688
|
size="small"
|
|
635
689
|
onClick={() => setDialogVisible(true)}
|
|
636
|
-
className="small-button"
|
|
637
690
|
severity="danger"
|
|
638
691
|
/>}
|
|
639
|
-
{isFilterApplied &&
|
|
692
|
+
{/* {isFilterApplied &&
|
|
640
693
|
<Button
|
|
641
694
|
type="button"
|
|
642
695
|
icon="pi pi-filter-slash"
|
|
@@ -646,10 +699,10 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
646
699
|
onClick={clearFilter}
|
|
647
700
|
className="small-button"
|
|
648
701
|
/>
|
|
649
|
-
}
|
|
702
|
+
} */}
|
|
650
703
|
|
|
651
704
|
{solidListViewMetaData?.data?.solidView?.layout?.attrs?.enableGlobalSearch === true && params.embeded === false &&
|
|
652
|
-
<SolidGlobalSearchElement
|
|
705
|
+
<SolidGlobalSearchElement filters={filters} clearFilter={clearFilter} ref={solidGlobalSearchElementRef} viewData={solidListViewMetaData} handleApplyCustomFilter={handleApplyCustomFilter}></SolidGlobalSearchElement>
|
|
653
706
|
}
|
|
654
707
|
</div>
|
|
655
708
|
<div className="flex align-items-center gap-3">
|
|
@@ -659,12 +712,12 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
659
712
|
}
|
|
660
713
|
{actionsAllowed.includes(`${createPermission(params.modelName)}`) && solidListViewMetaData?.data?.solidView?.layout?.attrs?.create !== false && params.embeded == true && params.inlineCreate == true &&
|
|
661
714
|
// < SolidCreateButton url={createButtonUrl} />
|
|
662
|
-
<Button type="button" icon="pi pi-plus" label="Add" size='small'
|
|
715
|
+
<Button type="button" icon="pi pi-plus" label="Add" size='small'
|
|
663
716
|
onClick={() => params.handlePopUpOpen(true)}
|
|
664
717
|
></Button>
|
|
665
718
|
}
|
|
666
|
-
{showArchived && <Button type="button" icon="pi pi-refresh" label="Recover" size='small' severity="
|
|
667
|
-
|
|
719
|
+
{showArchived && <Button type="button" icon="pi pi-refresh" label="Recover" size='small' severity="secondary"
|
|
720
|
+
onClick={() => setRecoverDialogVisible(true)}
|
|
668
721
|
></Button>}
|
|
669
722
|
<SolidLayoutViews
|
|
670
723
|
sizeOptions={sizeOptions}
|
|
@@ -675,7 +728,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
675
728
|
view={view}
|
|
676
729
|
/>
|
|
677
730
|
{params.embeded === false &&
|
|
678
|
-
<SolidConfigureLayoutElement></SolidConfigureLayoutElement>
|
|
731
|
+
<SolidConfigureLayoutElement setShowArchived={setShowArchived} showArchived={showArchived} viewData={solidListViewMetaData}></SolidConfigureLayoutElement>
|
|
679
732
|
}
|
|
680
733
|
{/* {params.embeded === false &&
|
|
681
734
|
<SolidListViewOptions></SolidListViewOptions>
|
|
@@ -724,39 +777,15 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
724
777
|
|
|
725
778
|
{renderColumnsDynamically(listViewMetaData)}
|
|
726
779
|
{actionsAllowed.includes(`${updatePermission(params.modelName)}`) && solidListViewMetaData?.data?.solidView?.layout?.attrs?.edit !== false &&
|
|
727
|
-
<Column body={(rowData) => (
|
|
780
|
+
<Column frozen alignFrozen="right" body={(rowData) => (
|
|
728
781
|
rowData.deletedAt ? (
|
|
729
782
|
<a onClick={() => recoverById(rowData.id)} className="retrieve-button">
|
|
730
|
-
<i className="pi pi-refresh" style={{ fontSize: "1rem" }}/>
|
|
783
|
+
<i className="pi pi-refresh" style={{ fontSize: "1rem" }} />
|
|
731
784
|
</a>
|
|
732
785
|
) :
|
|
733
786
|
detailsBodyTemplate(rowData)
|
|
734
787
|
)}></Column>
|
|
735
788
|
}
|
|
736
|
-
{solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons &&
|
|
737
|
-
solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons.map((rowAction: any) => {
|
|
738
|
-
return (
|
|
739
|
-
<Column
|
|
740
|
-
key={rowAction}
|
|
741
|
-
body={(rowData) => (
|
|
742
|
-
<a onClick={() => {
|
|
743
|
-
setListRowActionData({
|
|
744
|
-
modelName: params.modelName,
|
|
745
|
-
moduleName: params.moduleName,
|
|
746
|
-
rowAction: rowAction,
|
|
747
|
-
rowData: rowData,
|
|
748
|
-
closeListViewRowActionPopup: closeListViewRowActionPopup
|
|
749
|
-
|
|
750
|
-
});
|
|
751
|
-
setListViewRowActionPopupState(true)
|
|
752
|
-
}
|
|
753
|
-
}>
|
|
754
|
-
<i className={rowAction?.attrs?.className ? rowAction?.attrs?.className : "pi pi-pencil"} /> {/* PrimeIcons pencil icon */}
|
|
755
|
-
</a>
|
|
756
|
-
)}
|
|
757
|
-
/>
|
|
758
|
-
);
|
|
759
|
-
})}
|
|
760
789
|
</DataTable>
|
|
761
790
|
</div>
|
|
762
791
|
<Dialog
|
|
@@ -765,8 +794,8 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
765
794
|
modal
|
|
766
795
|
footer={() => (
|
|
767
796
|
<div className="flex justify-content-center">
|
|
768
|
-
<Button label="Yes" icon="pi pi-check"
|
|
769
|
-
<Button label="No" icon="pi pi-times"
|
|
797
|
+
<Button label="Yes" icon="pi pi-check" severity="danger" autoFocus onClick={deleteBulk} />
|
|
798
|
+
<Button label="No" icon="pi pi-times" onClick={onDeleteClose} />
|
|
770
799
|
</div>
|
|
771
800
|
)}
|
|
772
801
|
onHide={() => setDialogVisible(false)}
|
|
@@ -780,8 +809,8 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
780
809
|
modal
|
|
781
810
|
footer={() => (
|
|
782
811
|
<div className="flex justify-content-center">
|
|
783
|
-
<Button label="Yes" icon="pi pi-check"
|
|
784
|
-
<Button label="No" icon="pi pi-times"
|
|
812
|
+
<Button label="Yes" icon="pi pi-check" severity="danger" autoFocus onClick={recoverAll} />
|
|
813
|
+
<Button label="No" icon="pi pi-times" onClick={() => setRecoverDialogVisible(false)} />
|
|
785
814
|
</div>
|
|
786
815
|
)}
|
|
787
816
|
onHide={() => setRecoverDialogVisible(false)}
|
|
@@ -798,6 +827,19 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
798
827
|
<ListViewRowActionPopup context={listViewRowActionData}></ListViewRowActionPopup>
|
|
799
828
|
</Dialog>
|
|
800
829
|
}
|
|
830
|
+
<Dialog header="Delete Field" headerClassName="py-2" contentClassName="px-0 pb-0" visible={deleteEntity} style={{ width: '20vw' }} onHide={() => { if (!deleteEntity) return; setDeleteEntity(false); }}>
|
|
831
|
+
<Divider className="m-0" />
|
|
832
|
+
<div className="p-4">
|
|
833
|
+
<p className="m-0 solid-primary-title" style={{ fontSize: 16 }}>
|
|
834
|
+
Are you sure you want to delete this Field ?
|
|
835
|
+
</p>
|
|
836
|
+
<p className="" style={{ color: 'var{--solid-grey-500}' }}>{solidFieldName}</p>
|
|
837
|
+
<div className="flex align-items-center gap-2 mt-3">
|
|
838
|
+
<Button label="Delete" size="small" onClick={() => { deleteSolidSingleEntiry(solidsolidViewDataId); setDeleteEntity(false); }} />
|
|
839
|
+
<Button label="Cancel" size="small" onClick={() => setDeleteEntity(false)} outlined />
|
|
840
|
+
</div>
|
|
841
|
+
</div>
|
|
842
|
+
</Dialog>
|
|
801
843
|
</>
|
|
802
844
|
);
|
|
803
845
|
};
|
|
@@ -19,7 +19,7 @@ export const SolidManyToOneFilterElement = ({ value, updateInputs, index, fieldM
|
|
|
19
19
|
offset: 0,
|
|
20
20
|
limit: 10,
|
|
21
21
|
filters: {
|
|
22
|
-
[fieldMetadata
|
|
22
|
+
[fieldMetadata?.relationModel?.userKeyField?.name]: {
|
|
23
23
|
$containsi: event.query
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -38,7 +38,7 @@ export const SolidManyToOneFilterElement = ({ value, updateInputs, index, fieldM
|
|
|
38
38
|
if (autocompleteData) {
|
|
39
39
|
const autoCompleteItems = autocompleteData.records.map((item: any) => {
|
|
40
40
|
return {
|
|
41
|
-
label: item[fieldMetadata
|
|
41
|
+
label: item[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
42
42
|
value: item['id']
|
|
43
43
|
}
|
|
44
44
|
});
|
|
@@ -30,12 +30,12 @@ const SolidBooleanColumn = ({ solidListViewMetaData, fieldMetadata, column }: So
|
|
|
30
30
|
|
|
31
31
|
// Custom body template for Boolean column
|
|
32
32
|
const bodyTemplate = (rowData: any) => {
|
|
33
|
-
|
|
33
|
+
const fieldKey = column.attrs.label ?? fieldMetadata.name;
|
|
34
|
+
return rowData[fieldKey] ? 'Yes' : 'No';
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
const header = column.attrs.label ?? fieldMetadata.displayName;
|
|
37
38
|
|
|
38
|
-
|
|
39
39
|
// TODO: filterTemplate, bodyTemplate & filterMatchModeOptions to be provided.
|
|
40
40
|
|
|
41
41
|
return (
|
|
@@ -34,7 +34,7 @@ const SolidRelationManyToOneColumn = ({ solidListViewMetaData, fieldMetadata, co
|
|
|
34
34
|
// This is the userkey that will be present within the rowData.
|
|
35
35
|
if (manyToOneFieldData) {
|
|
36
36
|
// Since this is a many-to-one field, we fetch the user key field of the associated model.
|
|
37
|
-
const userKeyField = fieldMetadata
|
|
37
|
+
const userKeyField = fieldMetadata?.relationModel?.userKeyField?.name;
|
|
38
38
|
|
|
39
39
|
const manyToOneColVal = manyToOneFieldData[userKeyField];
|
|
40
40
|
|