@solidxai/core-ui 0.1.4-beta.0 → 0.1.4-beta.1

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.
Files changed (61) hide show
  1. package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
  2. package/dist/components/core/common/SolidGlobalSearchElement.js +6 -5
  3. package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
  4. package/dist/components/core/common/SolidGlobalSearchElement.tsx +21 -17
  5. package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.d.ts.map +1 -1
  6. package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js +15 -30
  7. package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js.map +1 -1
  8. package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +46 -36
  9. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts +40 -0
  10. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
  11. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +315 -160
  12. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
  13. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +459 -249
  14. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
  15. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +46 -95
  16. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
  17. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +57 -113
  18. package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.d.ts +15 -5
  19. package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.d.ts.map +1 -1
  20. package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.js +203 -67
  21. package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.js.map +1 -1
  22. package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.ts +147 -67
  23. package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
  24. package/dist/components/core/kanban/SolidKanbanView.js +8 -7
  25. package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
  26. package/dist/components/core/kanban/SolidKanbanView.tsx +3 -2
  27. package/dist/components/core/list/SolidListView.d.ts +8 -5
  28. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  29. package/dist/components/core/list/SolidListView.js +70 -59
  30. package/dist/components/core/list/SolidListView.js.map +1 -1
  31. package/dist/components/core/list/SolidListView.tsx +51 -57
  32. package/dist/components/core/list/SolidListViewConfigure.d.ts +7 -0
  33. package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
  34. package/dist/components/core/list/SolidListViewConfigure.js +6 -5
  35. package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
  36. package/dist/components/core/list/SolidListViewConfigure.tsx +21 -12
  37. package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
  38. package/dist/components/core/list/columns/SolidShortTextColumn.js +1 -37
  39. package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
  40. package/dist/components/core/list/columns/SolidShortTextColumn.tsx +0 -41
  41. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
  42. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +9 -5
  43. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
  44. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +14 -3
  45. package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
  46. package/dist/components/core/tree/SolidTreeView.js +23 -14
  47. package/dist/components/core/tree/SolidTreeView.js.map +1 -1
  48. package/dist/components/core/tree/SolidTreeView.tsx +50 -16
  49. package/dist/helpers/registry.js +3 -1
  50. package/dist/helpers/registry.js.map +1 -1
  51. package/dist/helpers/registry.ts +4 -1
  52. package/dist/resources/globals.css +14 -0
  53. package/dist/routes/pages/admin/core/ListPage.js +1 -1
  54. package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
  55. package/dist/routes/pages/admin/core/ListPage.tsx +1 -1
  56. package/dist/routes/pages/admin/core/ModuleHomePage.d.ts.map +1 -1
  57. package/dist/routes/pages/admin/core/ModuleHomePage.js +4 -15
  58. package/dist/routes/pages/admin/core/ModuleHomePage.js.map +1 -1
  59. package/dist/routes/pages/admin/core/ModuleHomePage.tsx +4 -3
  60. package/dist/types/solid-core.d.ts +1 -1
  61. package/package.json +1 -1
@@ -414,24 +414,28 @@ const SavedFilterList = ({ savedfilter, activeSavedFilter, applySavedFilter, ope
414
414
  {/* {savedfilter?.description && <p className="text-xs pl-3">{savedfilter?.description}</p>} */}
415
415
  </div>
416
416
  <div className="flex align-items-center gap-2">
417
- <Button
418
- icon="pi pi-pencil"
419
- style={{ fontSize: 10 }}
420
- severity="secondary"
421
- outlined size="small"
422
- onClick={() => openSavedCustomFilter(savedfilter)}
423
- />
424
- <Button
425
- icon="pi pi-trash"
426
- style={{ fontSize: 10 }}
427
- severity="secondary"
428
- outlined size="small"
429
- onClick={() => {
430
- setSavedFilterTobeDeleted(savedfilter.id),
431
- setIsDeleteSQDialogVisible(true);
417
+ {savedfilter.isSeeded !== true &&
418
+ <>
419
+ <Button
420
+ icon="pi pi-pencil"
421
+ style={{ fontSize: 10 }}
422
+ severity="secondary"
423
+ outlined size="small"
424
+ onClick={() => openSavedCustomFilter(savedfilter)}
425
+ />
426
+ <Button
427
+ icon="pi pi-trash"
428
+ style={{ fontSize: 10 }}
429
+ severity="secondary"
430
+ outlined size="small"
431
+ onClick={() => {
432
+ setSavedFilterTobeDeleted(savedfilter.id),
433
+ setIsDeleteSQDialogVisible(true);
434
+ }}
435
+ />
436
+ </>
437
+ }
432
438
 
433
- }}
434
- />
435
439
  </div>
436
440
  </div>
437
441
  )
@@ -1 +1 @@
1
- {"version":3,"file":"RolePermissionsManyToManyFieldWidget.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAe5E,eAAO,MAAM,oCAAoC,6BAA8B,yBAAyB,4CA+GvG,CAAC"}
1
+ {"version":3,"file":"RolePermissionsManyToManyFieldWidget.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAe5E,eAAO,MAAM,oCAAoC,6BAA8B,yBAAyB,4CA2HvG,CAAC"}
@@ -9,15 +9,6 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
13
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
14
- if (ar || !(i in from)) {
15
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
16
- ar[i] = from[i];
17
- }
18
- }
19
- return to.concat(ar || Array.prototype.slice.call(from));
20
- };
21
12
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
22
13
  import { Panel } from "primereact/panel";
23
14
  import { useEffect, useState } from "react";
@@ -43,27 +34,24 @@ export var RolePermissionsManyToManyFieldWidget = function (_a) {
43
34
  var fieldLayoutInfo = fieldContext.field;
44
35
  var readOnlyPermission = fieldContext.readOnly;
45
36
  var _c = useState(false), visibleCreateDialog = _c[0], setVisibleCreateDialog = _c[1];
46
- var _d = useRelationEntityHandler({ fieldContext: fieldContext, formik: formik }), autoCompleteItems = _d.autoCompleteItems, fetchRelationEntities = _d.fetchRelationEntities, populateFormikWithRelatedEntities = _d.populateFormikWithRelatedEntities, addNewRelation = _d.addNewRelation;
47
- var _e = useState({}), visibleDialogs = _e[0], setVisibleDialogs = _e[1];
37
+ var _d = useState({}), visibleDialogs = _d[0], setVisibleDialogs = _d[1];
38
+ var _e = useRelationEntityHandler({ fieldContext: fieldContext }), allOptions = _e.allOptions, currentValues = _e.currentValues, fetchAllOptions = _e.fetchAllOptions, fetchCurrentValues = _e.fetchCurrentValues, linkItem = _e.linkItem, unlinkItem = _e.unlinkItem, addNewRelation = _e.addNewRelation;
39
+ // On mount: load already-linked permissions into currentValues
48
40
  useEffect(function () {
49
- populateFormikWithRelatedEntities();
50
- }, [(_b = formik.values) === null || _b === void 0 ? void 0 : _b.id]);
41
+ fetchCurrentValues();
42
+ }, [(_b = fieldContext.data) === null || _b === void 0 ? void 0 : _b.id]);
43
+ // On mount: load all available permissions into allOptions
51
44
  useEffect(function () {
52
- var queryData = {
53
- offset: 0,
54
- limit: 1000
55
- };
56
- var autocompleteQs = qs.stringify(queryData, {
57
- encodeValuesOnly: true,
58
- });
59
- fetchRelationEntities(autocompleteQs);
45
+ var queryData = { offset: 0, limit: 1000 };
46
+ fetchAllOptions(qs.stringify(queryData, { encodeValuesOnly: true }));
60
47
  }, []);
61
- var handleCheckboxChange = function (e) {
62
- if (formik.values[fieldLayoutInfo.attrs.name].some(function (item) { return item.value === e.value; })) {
63
- formik.setFieldValue(fieldLayoutInfo.attrs.name, formik.values[fieldLayoutInfo.attrs.name].filter(function (s) { return s.value !== e.value; }));
48
+ var handleCheckboxChange = function (item) {
49
+ var isCurrentlyLinked = currentValues.some(function (s) { return s.value === item.value; });
50
+ if (isCurrentlyLinked) {
51
+ unlinkItem(item);
64
52
  }
65
53
  else {
66
- formik.setFieldValue(fieldLayoutInfo.attrs.name, __spreadArray(__spreadArray([], formik.values[fieldLayoutInfo.attrs.name], true), [e], false));
54
+ linkItem(item);
67
55
  }
68
56
  };
69
57
  var getHeaderTemplate = function (controllerName) { return function (options) {
@@ -75,11 +63,8 @@ export var RolePermissionsManyToManyFieldWidget = function (_a) {
75
63
  });
76
64
  }, className: "custom-add-button" }), _jsx(InlineRelationEntityDialog, { visible: visibleCreateDialog, setVisible: setVisibleCreateDialog, fieldContext: fieldContext, onCreate: addNewRelation })] }))] }), _jsx("div", { children: options.togglerElement })] }));
77
65
  }; };
78
- var groupedEntities = groupByController(autoCompleteItems || []);
79
- return (_jsxs("div", { children: [Object.keys(groupedEntities).map(function (controllerName) { return (_jsx(Panel, { toggleable: true, headerTemplate: getHeaderTemplate(controllerName), className: "mt-3 lg:mt-4", children: _jsx("div", { className: "formgrid grid gap-3 lg:gap-0 ", children: groupedEntities[controllerName].map(function (entity, i) {
80
- var isChecked = formik.values[fieldLayoutInfo.attrs.name].some(function (item) { return item.value === entity.value; });
81
- return (_jsxs("div", { className: "field col-12 lg:col-6 flex gap-2 ".concat(i >= 2 ? 'lg:mt-3' : ''), children: [_jsx(Checkbox, { readOnly: readOnlyPermission, inputId: entity.label, checked: isChecked, onChange: function () { return handleCheckboxChange(entity); } }), _jsxs("label", { htmlFor: entity.label, className: "form-field-label m-0 solid-permisson-form-label", children: [" ", entity.label] })] }, entity.label));
82
- }) }) }, controllerName)); }), Object.keys(groupedEntities).map(function (controllerName) { return (_jsx(InlineRelationEntityDialog, { visible: visibleDialogs[controllerName] || false, setVisible: function (visible) {
66
+ var groupedEntities = groupByController(allOptions || []);
67
+ return (_jsxs("div", { children: [Object.keys(groupedEntities).map(function (controllerName) { return (_jsx(Panel, { toggleable: true, headerTemplate: getHeaderTemplate(controllerName), className: "mt-3 lg:mt-4", children: _jsx("div", { className: "formgrid grid gap-3 lg:gap-0", children: groupedEntities[controllerName].map(function (entity, i) { return (_jsxs("div", { className: "field col-12 lg:col-6 flex gap-2 ".concat(i >= 2 ? 'lg:mt-3' : ''), children: [_jsx(Checkbox, { readOnly: readOnlyPermission, inputId: entity.label, checked: currentValues.some(function (s) { return s.value === entity.value; }), onChange: function () { return handleCheckboxChange(entity); } }), _jsx("label", { htmlFor: entity.label, className: "form-field-label m-0 solid-permisson-form-label", children: entity.label })] }, entity.value)); }) }) }, controllerName)); }), Object.keys(groupedEntities).map(function (controllerName) { return (_jsx(InlineRelationEntityDialog, { visible: visibleDialogs[controllerName] || false, setVisible: function (visible) {
83
68
  return setVisibleDialogs(function (prev) {
84
69
  var _a;
85
70
  return (__assign(__assign({}, prev), (_a = {}, _a[controllerName] = visible, _a)));
@@ -1 +1 @@
1
- {"version":3,"file":"RolePermissionsManyToManyFieldWidget.js","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,+FAA+F,CAAC;AACzI,OAAO,EAAE,0BAA0B,EAAE,MAAM,iGAAiG,CAAC;AAC7I,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,IAAM,iBAAiB,GAAG,UAAC,KAAY;IACnC,IAAM,OAAO,GAA6B,EAAE,CAAC;IAC7C,KAAK,CAAC,OAAO,CAAC,UAAC,IAAI;QACf,IAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;YAC1B,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC;SAChC;QACD,OAAO,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;A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AAc,CAAC,IAAI,KAAK,EAChD,UAAU,EAAE,UAAC,OAAY;oBACrB,OAAA,iBAAiB,CAAC,UAAC,IAAI;;wBAAK,OAAA,uBACrB,IAAI,gBACN,cAAc,IAAG,OAAO,OAC3B;oBAH0B,CAG1B,CAAC;gBAHH,CAGG,EAEP,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,cAAc,IATnB,iBAAU,cAAc,CAAE,CAUjC,CACL,EAbqD,CAarD,CAAC,IACA,CACT,CAAA;AACL,CAAC,CAAC","sourcesContent":["\nimport { capitalize } from \"lodash\";\nimport { Panel } from \"primereact/panel\";\nimport { useEffect, useState } from \"react\";\nimport { Button } from \"primereact/button\";\nimport { InputSwitch } from \"primereact/inputswitch\";\nimport { useRelationEntityHandler } from \"../../../../../components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler\";\nimport { InlineRelationEntityDialog } from \"../../../../../components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog\";\nimport { Checkbox } from \"primereact/checkbox\";\nimport { SolidFormFieldWidgetProps } from \"../../../../../types/solid-core\";\nimport qs from 'qs';\n\nconst groupByController = (items: any[]) => {\n const grouped: { [key: string]: any[] } = {};\n items.forEach((item) => {\n const controllerName = item.label.split(\".\")[0];\n if (!grouped[controllerName]) {\n grouped[controllerName] = [];\n }\n grouped[controllerName].push(item);\n });\n return grouped;\n};\n\nexport const RolePermissionsManyToManyFieldWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {\n const fieldLayoutInfo = fieldContext.field;\n\n const readOnlyPermission = fieldContext.readOnly;\n const [visibleCreateDialog, setVisibleCreateDialog] = useState(false);\n const { autoCompleteItems, fetchRelationEntities, populateFormikWithRelatedEntities, addNewRelation } = useRelationEntityHandler({ fieldContext, formik });\n const [visibleDialogs, setVisibleDialogs] = useState<{ [key: string]: boolean }>({});\n\n\n useEffect(() => {\n populateFormikWithRelatedEntities();\n }, [formik.values?.id]);\n\n useEffect(() => {\n const queryData: any = {\n offset: 0,\n limit: 1000\n };\n const autocompleteQs = qs.stringify(queryData, {\n encodeValuesOnly: true,\n });\n fetchRelationEntities(autocompleteQs);\n }, []);\n\n const handleCheckboxChange = (e: any) => {\n if (formik.values[fieldLayoutInfo.attrs.name].some((item: any) => item.value === e.value)) {\n formik.setFieldValue(fieldLayoutInfo.attrs.name, formik.values[fieldLayoutInfo.attrs.name].filter((s: any) => s.value !== e.value));\n } else {\n formik.setFieldValue(fieldLayoutInfo.attrs.name, [...formik.values[fieldLayoutInfo.attrs.name], e]);\n }\n };\n\n const getHeaderTemplate = (controllerName: string) => (options: any) => {\n const className = `${options.className} justify-content-space-between`;\n\n return (\n <div className={className}>\n <div className=\"flex align-items-center gap-3\">\n <label className=\"form-field-label text-base lg:text-lg font-bold\">\n {controllerName}\n </label>\n {fieldContext.field.attrs.inlineCreate && (\n <>\n <Button\n icon=\"pi pi-plus\"\n rounded\n outlined\n aria-label=\"Add\"\n type=\"button\"\n size=\"small\"\n onClick={() =>\n setVisibleDialogs((prev) => ({\n ...prev,\n [controllerName]: true,\n }))\n }\n className=\"custom-add-button\"\n />\n <InlineRelationEntityDialog\n visible={visibleCreateDialog}\n setVisible={setVisibleCreateDialog}\n fieldContext={fieldContext}\n onCreate={addNewRelation}\n />\n </>\n )}\n </div>\n <div>{options.togglerElement}</div>\n </div>\n );\n };\n\n const groupedEntities = groupByController(autoCompleteItems || []);\n return (\n <div>\n {Object.keys(groupedEntities).map((controllerName) => (\n <Panel toggleable headerTemplate={getHeaderTemplate(controllerName)} key={controllerName} className=\"mt-3 lg:mt-4\">\n <div className=\"formgrid grid gap-3 lg:gap-0 \">\n {groupedEntities[controllerName].map((entity: any, i: number) => {\n const isChecked = formik.values[fieldLayoutInfo.attrs.name].some((item: any) => item.value === entity.value);\n return (\n <div key={entity.label} className={`field col-12 lg:col-6 flex gap-2 ${i >= 2 ? 'lg:mt-3' : ''}`}>\n <Checkbox\n readOnly={readOnlyPermission}\n inputId={entity.label}\n checked={isChecked}\n onChange={() => handleCheckboxChange(entity)}\n />\n <label htmlFor={entity.label} className=\"form-field-label m-0 solid-permisson-form-label\"> {entity.label}</label>\n </div>\n )\n })}\n </div>\n </Panel>\n ))}\n {Object.keys(groupedEntities).map((controllerName) => (\n <InlineRelationEntityDialog\n key={`dialog-${controllerName}`}\n visible={visibleDialogs[controllerName] || false}\n setVisible={(visible: any) =>\n setVisibleDialogs((prev) => ({\n ...prev,\n [controllerName]: visible,\n }))\n }\n fieldContext={fieldContext}\n onCreate={addNewRelation}\n />\n ))}\n </div>\n )\n};"]}
1
+ {"version":3,"file":"RolePermissionsManyToManyFieldWidget.js","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,+FAA+F,CAAC;AACzI,OAAO,EAAE,0BAA0B,EAAE,MAAM,iGAAiG,CAAC;AAC7I,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,IAAM,iBAAiB,GAAG,UAAC,KAAY;IACnC,IAAM,OAAO,GAA6B,EAAE,CAAC;IAC7C,KAAK,CAAC,OAAO,CAAC,UAAC,IAAI;QACf,IAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;YAC1B,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC;SAChC;QACD,OAAO,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC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nimport { Panel } from \"primereact/panel\";\nimport { useEffect, useState } from \"react\";\nimport { Button } from \"primereact/button\";\nimport { useRelationEntityHandler } from \"../../../../../components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler\";\nimport { InlineRelationEntityDialog } from \"../../../../../components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog\";\nimport { Checkbox } from \"primereact/checkbox\";\nimport { SolidFormFieldWidgetProps } from \"../../../../../types/solid-core\";\nimport qs from 'qs';\n\nconst groupByController = (items: any[]) => {\n const grouped: { [key: string]: any[] } = {};\n items.forEach((item) => {\n const controllerName = item.label.split(\".\")[0];\n if (!grouped[controllerName]) {\n grouped[controllerName] = [];\n }\n grouped[controllerName].push(item);\n });\n return grouped;\n};\n\nexport const RolePermissionsManyToManyFieldWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {\n const fieldLayoutInfo = fieldContext.field;\n const readOnlyPermission = fieldContext.readOnly;\n const [visibleCreateDialog, setVisibleCreateDialog] = useState(false);\n\n const [visibleDialogs, setVisibleDialogs] = useState<{ [key: string]: boolean }>({});\n\n const {\n allOptions,\n currentValues,\n fetchAllOptions,\n fetchCurrentValues,\n linkItem,\n unlinkItem,\n addNewRelation,\n } = useRelationEntityHandler({ fieldContext });\n\n // On mount: load already-linked permissions into currentValues\n useEffect(() => {\n fetchCurrentValues();\n }, [fieldContext.data?.id]);\n\n // On mount: load all available permissions into allOptions\n useEffect(() => {\n const queryData = { offset: 0, limit: 1000 };\n fetchAllOptions(qs.stringify(queryData, { encodeValuesOnly: true }));\n }, []);\n\n const handleCheckboxChange = (item: any) => {\n const isCurrentlyLinked = currentValues.some((s) => s.value === item.value);\n if (isCurrentlyLinked) {\n unlinkItem(item);\n } else {\n linkItem(item);\n }\n };\n\n const getHeaderTemplate = (controllerName: string) => (options: any) => {\n const className = `${options.className} justify-content-space-between`;\n\n return (\n <div className={className}>\n <div className=\"flex align-items-center gap-3\">\n <label className=\"form-field-label text-base lg:text-lg font-bold\">\n {controllerName}\n </label>\n {fieldContext.field.attrs.inlineCreate && (\n <>\n <Button\n icon=\"pi pi-plus\"\n rounded\n outlined\n aria-label=\"Add\"\n type=\"button\"\n size=\"small\"\n onClick={() =>\n setVisibleDialogs((prev) => ({\n ...prev,\n [controllerName]: true,\n }))\n }\n className=\"custom-add-button\"\n />\n <InlineRelationEntityDialog\n visible={visibleCreateDialog}\n setVisible={setVisibleCreateDialog}\n fieldContext={fieldContext}\n onCreate={addNewRelation}\n />\n </>\n )}\n </div>\n <div>{options.togglerElement}</div>\n </div>\n );\n };\n\n const groupedEntities = groupByController(allOptions || []);\n return (\n <div>\n {Object.keys(groupedEntities).map((controllerName) => (\n <Panel\n key={controllerName}\n toggleable\n headerTemplate={getHeaderTemplate(controllerName)}\n className=\"mt-3 lg:mt-4\"\n >\n <div className=\"formgrid grid gap-3 lg:gap-0\">\n {groupedEntities[controllerName].map((entity: any, i: number) => (\n <div\n key={entity.value}\n className={`field col-12 lg:col-6 flex gap-2 ${i >= 2 ? 'lg:mt-3' : ''}`}\n >\n <Checkbox\n readOnly={readOnlyPermission}\n inputId={entity.label}\n checked={currentValues.some((s) => s.value === entity.value)}\n onChange={() => handleCheckboxChange(entity)}\n />\n <label htmlFor={entity.label} className=\"form-field-label m-0 solid-permisson-form-label\">\n {entity.label}\n </label>\n </div>\n ))}\n </div>\n </Panel>\n ))}\n {Object.keys(groupedEntities).map((controllerName) => (\n <InlineRelationEntityDialog\n key={`dialog-${controllerName}`}\n visible={visibleDialogs[controllerName] || false}\n setVisible={(visible: any) =>\n setVisibleDialogs((prev) => ({\n ...prev,\n [controllerName]: visible,\n }))\n }\n fieldContext={fieldContext}\n onCreate={addNewRelation}\n />\n ))}\n </div>\n );\n};"]}
@@ -1,9 +1,7 @@
1
-
2
1
  import { capitalize } from "lodash";
3
2
  import { Panel } from "primereact/panel";
4
3
  import { useEffect, useState } from "react";
5
4
  import { Button } from "primereact/button";
6
- import { InputSwitch } from "primereact/inputswitch";
7
5
  import { useRelationEntityHandler } from "../../../../../components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler";
8
6
  import { InlineRelationEntityDialog } from "../../../../../components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog";
9
7
  import { Checkbox } from "primereact/checkbox";
@@ -24,33 +22,38 @@ const groupByController = (items: any[]) => {
24
22
 
25
23
  export const RolePermissionsManyToManyFieldWidget = ({ formik, fieldContext }: SolidFormFieldWidgetProps) => {
26
24
  const fieldLayoutInfo = fieldContext.field;
27
-
28
25
  const readOnlyPermission = fieldContext.readOnly;
29
26
  const [visibleCreateDialog, setVisibleCreateDialog] = useState(false);
30
- const { autoCompleteItems, fetchRelationEntities, populateFormikWithRelatedEntities, addNewRelation } = useRelationEntityHandler({ fieldContext, formik });
27
+
31
28
  const [visibleDialogs, setVisibleDialogs] = useState<{ [key: string]: boolean }>({});
32
29
 
30
+ const {
31
+ allOptions,
32
+ currentValues,
33
+ fetchAllOptions,
34
+ fetchCurrentValues,
35
+ linkItem,
36
+ unlinkItem,
37
+ addNewRelation,
38
+ } = useRelationEntityHandler({ fieldContext });
33
39
 
40
+ // On mount: load already-linked permissions into currentValues
34
41
  useEffect(() => {
35
- populateFormikWithRelatedEntities();
36
- }, [formik.values?.id]);
42
+ fetchCurrentValues();
43
+ }, [fieldContext.data?.id]);
37
44
 
45
+ // On mount: load all available permissions into allOptions
38
46
  useEffect(() => {
39
- const queryData: any = {
40
- offset: 0,
41
- limit: 1000
42
- };
43
- const autocompleteQs = qs.stringify(queryData, {
44
- encodeValuesOnly: true,
45
- });
46
- fetchRelationEntities(autocompleteQs);
47
+ const queryData = { offset: 0, limit: 1000 };
48
+ fetchAllOptions(qs.stringify(queryData, { encodeValuesOnly: true }));
47
49
  }, []);
48
50
 
49
- const handleCheckboxChange = (e: any) => {
50
- if (formik.values[fieldLayoutInfo.attrs.name].some((item: any) => item.value === e.value)) {
51
- formik.setFieldValue(fieldLayoutInfo.attrs.name, formik.values[fieldLayoutInfo.attrs.name].filter((s: any) => s.value !== e.value));
51
+ const handleCheckboxChange = (item: any) => {
52
+ const isCurrentlyLinked = currentValues.some((s) => s.value === item.value);
53
+ if (isCurrentlyLinked) {
54
+ unlinkItem(item);
52
55
  } else {
53
- formik.setFieldValue(fieldLayoutInfo.attrs.name, [...formik.values[fieldLayoutInfo.attrs.name], e]);
56
+ linkItem(item);
54
57
  }
55
58
  };
56
59
 
@@ -94,26 +97,33 @@ export const RolePermissionsManyToManyFieldWidget = ({ formik, fieldContext }: S
94
97
  );
95
98
  };
96
99
 
97
- const groupedEntities = groupByController(autoCompleteItems || []);
100
+ const groupedEntities = groupByController(allOptions || []);
98
101
  return (
99
102
  <div>
100
103
  {Object.keys(groupedEntities).map((controllerName) => (
101
- <Panel toggleable headerTemplate={getHeaderTemplate(controllerName)} key={controllerName} className="mt-3 lg:mt-4">
102
- <div className="formgrid grid gap-3 lg:gap-0 ">
103
- {groupedEntities[controllerName].map((entity: any, i: number) => {
104
- const isChecked = formik.values[fieldLayoutInfo.attrs.name].some((item: any) => item.value === entity.value);
105
- return (
106
- <div key={entity.label} className={`field col-12 lg:col-6 flex gap-2 ${i >= 2 ? 'lg:mt-3' : ''}`}>
107
- <Checkbox
108
- readOnly={readOnlyPermission}
109
- inputId={entity.label}
110
- checked={isChecked}
111
- onChange={() => handleCheckboxChange(entity)}
112
- />
113
- <label htmlFor={entity.label} className="form-field-label m-0 solid-permisson-form-label"> {entity.label}</label>
114
- </div>
115
- )
116
- })}
104
+ <Panel
105
+ key={controllerName}
106
+ toggleable
107
+ headerTemplate={getHeaderTemplate(controllerName)}
108
+ className="mt-3 lg:mt-4"
109
+ >
110
+ <div className="formgrid grid gap-3 lg:gap-0">
111
+ {groupedEntities[controllerName].map((entity: any, i: number) => (
112
+ <div
113
+ key={entity.value}
114
+ className={`field col-12 lg:col-6 flex gap-2 ${i >= 2 ? 'lg:mt-3' : ''}`}
115
+ >
116
+ <Checkbox
117
+ readOnly={readOnlyPermission}
118
+ inputId={entity.label}
119
+ checked={currentValues.some((s) => s.value === entity.value)}
120
+ onChange={() => handleCheckboxChange(entity)}
121
+ />
122
+ <label htmlFor={entity.label} className="form-field-label m-0 solid-permisson-form-label">
123
+ {entity.label}
124
+ </label>
125
+ </div>
126
+ ))}
117
127
  </div>
118
128
  </Panel>
119
129
  ))}
@@ -132,5 +142,5 @@ export const RolePermissionsManyToManyFieldWidget = ({ formik, fieldContext }: S
132
142
  />
133
143
  ))}
134
144
  </div>
135
- )
145
+ );
136
146
  };
@@ -1,6 +1,20 @@
1
1
  import * as Yup from 'yup';
2
2
  import { FormikObject, ISolidField, SolidFieldProps } from "../ISolidField";
3
3
  import { SolidFormFieldWidgetProps } from "../../../../../types/solid-core";
4
+ export type FormViewParams = {
5
+ moduleName: any;
6
+ id: any;
7
+ embeded: any;
8
+ isCustomCreate: any;
9
+ customLayout: any;
10
+ modelName: any;
11
+ parentFieldName?: any;
12
+ parentData: any;
13
+ onEmbeddedFormSave: any;
14
+ inlineCreateAutoSave: any;
15
+ customCreateHandler?: any;
16
+ handlePopupClose?: any;
17
+ };
4
18
  export declare class SolidRelationManyToManyField implements ISolidField {
5
19
  private fieldContext;
6
20
  constructor(fieldContext: SolidFieldProps);
@@ -10,6 +24,32 @@ export declare class SolidRelationManyToManyField implements ISolidField {
10
24
  render(formik: FormikObject): import("react/jsx-runtime").JSX.Element;
11
25
  renderExtensionRenderMode(widget: string, formik: FormikObject): import("react/jsx-runtime").JSX.Element;
12
26
  }
27
+ /**
28
+ * AUTOCOMPLETE WIDGET
29
+ *
30
+ * State:
31
+ * currentValues — chips shown in the input (currently linked items)
32
+ * suggestions — dropdown options populated on each keystroke
33
+ *
34
+ * Flow:
35
+ * mount → fetchCurrentValues()
36
+ * user types → fetchSuggestions() via completeMethod
37
+ * user selects → linkItem() → on success, adds to currentValues
38
+ * user removes chip→ unlinkItem() → on success, removes from currentValues
39
+ */
13
40
  export declare const DefaultRelationManyToManyAutoCompleteFormEditWidget: ({ formik, fieldContext }: SolidFormFieldWidgetProps) => import("react/jsx-runtime").JSX.Element;
41
+ /**
42
+ * CHECKBOX WIDGET
43
+ *
44
+ * State:
45
+ * allOptions — every possible item to render as a checkbox row
46
+ * currentValues — the subset that is currently linked (drives checked state)
47
+ *
48
+ * Flow:
49
+ * mount → fetchCurrentValues() + fetchAllOptions()
50
+ * user checks → linkItem() → on success, adds to currentValues
51
+ * user unchecks → unlinkItem() → on success, removes from currentValues
52
+ */
14
53
  export declare const DefaultRelationManyToManyCheckBoxFormEditWidget: ({ formik, fieldContext }: SolidFormFieldWidgetProps) => import("react/jsx-runtime").JSX.Element;
54
+ export declare const DefaultRelationManyToManyListFormEditWidget: ({ formik, fieldContext }: SolidFormFieldWidgetProps) => import("react/jsx-runtime").JSX.Element;
15
55
  //# sourceMappingURL=SolidRelationManyToManyField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SolidRelationManyToManyField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAI5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAgB5E,qBAAa,4BAA6B,YAAW,WAAW;IAE5D,OAAO,CAAC,YAAY,CAAkB;gBAE1B,YAAY,EAAE,eAAe;IAIzC,YAAY,IAAI,GAAG;IAkBnB,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG;IAgCnD,gBAAgB,IAAI,GAAG,CAAC,MAAM;IAiB9B,MAAM,CAAC,MAAM,EAAE,YAAY;IAoC3B,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;CAYjE;AAID,eAAO,MAAM,mDAAmD,6BAA8B,yBAAyB,4CAwJtH,CAAA;AAID,eAAO,MAAM,+CAA+C,6BAA8B,yBAAyB,4CA2JlH,CAAA"}
1
+ {"version":3,"file":"SolidRelationManyToManyField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAI5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAgB5E,MAAM,MAAM,cAAc,GAAG;IACzB,UAAU,EAAE,GAAG,CAAC;IAChB,EAAE,EAAE,GAAG,CAAC;IACR,OAAO,EAAE,GAAG,CAAC;IACb,cAAc,EAAE,GAAG,CAAC;IACpB,YAAY,EAAE,GAAG,CAAC;IAClB,SAAS,EAAE,GAAG,CAAC;IACf,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,UAAU,EAAE,GAAG,CAAC;IAChB,kBAAkB,EAAE,GAAG,CAAC;IACxB,oBAAoB,EAAE,GAAG,CAAC;IAC1B,mBAAmB,CAAC,EAAE,GAAG,CAAC;IAC1B,gBAAgB,CAAC,EAAE,GAAG,CAAC;CAC1B,CAAC;AAIF,qBAAa,4BAA6B,YAAW,WAAW;IAE5D,OAAO,CAAC,YAAY,CAAkB;gBAE1B,YAAY,EAAE,eAAe;IAIzC,YAAY,IAAI,GAAG;IAInB,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG;IAKnD,gBAAgB,IAAI,GAAG,CAAC,MAAM;IAe9B,MAAM,CAAC,MAAM,EAAE,YAAY;IAkB3B,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;CAKjE;AAID;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mDAAmD,6BAA8B,yBAAyB,4CAwItH,CAAC;AAIF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,+CAA+C,6BA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