@asaleh37/ui-base 25.8.26 → 25.8.31

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 (35) hide show
  1. package/dist/index.d.ts +22 -6
  2. package/dist/index.js +6 -6
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +6 -6
  5. package/dist/index.mjs.map +1 -1
  6. package/package.json +1 -1
  7. package/src/components/administration/dev/AttachmentConfigGrid.tsx +1 -0
  8. package/src/components/administration/dev/DataQueryGrid.tsx +26 -16
  9. package/src/components/administration/dev/DatasourceConnectionGrid.tsx +1 -0
  10. package/src/components/administration/dev/EntityParameterGrid.tsx +94 -67
  11. package/src/components/administration/dev/MailSenderConfigGrid.tsx +1 -0
  12. package/src/components/administration/dev/MailTemplateGrid.tsx +1 -0
  13. package/src/components/administration/dev/NotificationGrid.tsx +5 -2
  14. package/src/components/administration/dev/ReportGrid.tsx +102 -111
  15. package/src/components/administration/dev/WidgetGrid.tsx +96 -147
  16. package/src/components/administration/dev/WorkflowDocumentGrid.tsx +2 -23
  17. package/src/components/templates/DataEntryTemplates/DataEntryTypes.ts +41 -16
  18. package/src/components/templates/DataEntryTemplates/DataEntryUtil.ts +20 -10
  19. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormElementField.tsx +80 -60
  20. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/Datefield.tsx +1 -1
  21. package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/DatetimeField.tsx +1 -1
  22. package/src/components/templates/DataEntryTemplates/TemplateDataForm/TemplateForm.tsx +83 -65
  23. package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid.tsx +8 -5
  24. package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGridTopBar.tsx +3 -1
  25. package/src/components/templates/report/ReportViewer.tsx +24 -138
  26. package/src/components/templates/visuals/DashboardViewer.tsx +49 -5
  27. package/src/components/templates/visuals/WidgetViewer.tsx +24 -14
  28. package/src/examples/ExampleGrid.tsx +134 -0
  29. package/src/hooks/useParameterPanel.tsx +168 -0
  30. package/src/layout/MainContent.tsx +51 -49
  31. package/src/locales/arabic/devLocalsAr.json +2 -2
  32. package/src/locales/english/devLocalsEn.json +2 -2
  33. package/src/navigationItems/index.tsx +7 -0
  34. package/src/routes/index.ts +5 -1
  35. package/src/util/AppUtils.ts +2 -0
package/dist/index.d.ts CHANGED
@@ -11,13 +11,14 @@ import * as react from 'react';
11
11
  import react__default from 'react';
12
12
  import { UseFormReturn } from 'react-hook-form';
13
13
  export { useForm } from 'react-hook-form';
14
+ import { z } from 'zod';
15
+ import * as zod from 'zod';
16
+ export { zod as z };
14
17
  import { TFunction } from 'i18next';
15
18
  export * from '@mui/x-tree-view/models';
16
19
  export { useTranslation } from 'react-i18next';
17
20
  export { useNavigate, useParams } from 'react-router-dom';
18
21
  export { zodResolver } from '@hookform/resolvers/zod';
19
- import * as zod from 'zod';
20
- export { zod as z };
21
22
  export { useDispatch, useSelector } from 'react-redux';
22
23
  import { ResponseType } from 'axios';
23
24
  export { default as axios } from 'axios';
@@ -205,6 +206,7 @@ type RecordAction = {
205
206
  label?: string;
206
207
  icon: IconProp;
207
208
  isConfirmationRequired?: boolean;
209
+ isIdRequired?: Boolean;
208
210
  confirmationMessage?: string;
209
211
  authority?: string;
210
212
  getActionIconStyleForRecord?: (record: any) => object;
@@ -296,7 +298,14 @@ type TemplateGridProps = {
296
298
  setRowSelectionModel?: any;
297
299
  setSelectedRecord?: any;
298
300
  setSelectedRecordIds?: any;
299
- formLoadCallBk?: (formActions: FormActionProps, formManager: UseFormReturn, record: any) => void;
301
+ formProps?: {
302
+ formValuesChangeCallBk?: FormValueChangeCallBk;
303
+ };
304
+ validationSchema?: z.ZodObject<any, "strip", z.ZodTypeAny, {
305
+ [x: string]: any;
306
+ }, {
307
+ [x: string]: any;
308
+ }>;
300
309
  editMode: {
301
310
  editMode: "none";
302
311
  } | {
@@ -350,9 +359,9 @@ type RecordFieldProps = {
350
359
  gridProps?: TemplateGridColumnProps;
351
360
  formProps?: {
352
361
  fieldSize?: FormElementSize;
362
+ fieldLabelFn?: (record: any) => string;
353
363
  fieldHeight?: number;
354
364
  style?: SxProps;
355
- onValueChangeCallBack?: (value: any, formManager: UseFormReturn, formActions?: FormActionProps, selectedRecord?: any) => void;
356
365
  };
357
366
  };
358
367
  type FormElementGroupProps = {
@@ -367,6 +376,7 @@ type FormElementGroupProps = {
367
376
  hiddenFields?: string[];
368
377
  disabledFields?: string[];
369
378
  };
379
+ type FormValueChangeCallBk = (formValues: any, formActions: FormActionProps, formManager: UseFormReturn, fieldName?: string, newValue?: any, selectedRecord?: any) => void;
370
380
  type FormElementFieldProps = {
371
381
  fieldInfo: RecordFieldProps;
372
382
  formManager?: UseFormReturn;
@@ -374,6 +384,7 @@ type FormElementFieldProps = {
374
384
  formActions?: any;
375
385
  hiddenFields?: string[];
376
386
  disabledFields?: string[];
387
+ formValuesChangeCallBk?: FormValueChangeCallBk;
377
388
  };
378
389
  type FormElementNodeProps = {
379
390
  formManager?: UseFormReturn;
@@ -413,7 +424,7 @@ type TemplateFormProps = {
413
424
  apiActions: ApiActions;
414
425
  preSaveValidation?: (record: any) => boolean | Promise<boolean>;
415
426
  formSavedSuccessfullyCallBk?: (response: any) => void;
416
- formLoadCallBk?: (formActions: FormActionProps, formManager: UseFormReturn, record: any) => void;
427
+ formValuesChangeCallBk?: FormValueChangeCallBk;
417
428
  formCloseCallBk?: () => void;
418
429
  saveButtonSpecs?: {
419
430
  label?: string;
@@ -429,6 +440,11 @@ type TemplateFormProps = {
429
440
  actionButtonVariant?: "text" | "outlined" | "contained";
430
441
  actionButtonColor?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
431
442
  };
443
+ validationSchema?: z.ZodObject<any, "strip", z.ZodTypeAny, {
444
+ [x: string]: any;
445
+ }, {
446
+ [x: string]: any;
447
+ }>;
432
448
  };
433
449
  type TemplateGridTopBarProps = GridToolbarProps & ToolbarPropsOverrides & {
434
450
  templateProps: TemplateGridProps;
@@ -658,4 +674,4 @@ declare const DARK_THEME_INITIAL_MAIN_COLOR = "#ea690e";
658
674
  declare const DARK_THEME_INITIAL_SECANDARY_COLOR = "#74776B";
659
675
 
660
676
  export { AttachmentCard, AttachmentImageViewer, AttachmentPanel, BaseApp, CheckBox, ComboBox, DARK_THEME_INITIAL_MAIN_COLOR, DARK_THEME_INITIAL_SECANDARY_COLOR, DATE_FORMAT, DATE_TIME_FORMAT, DashboardRouteView, DashboardViewer, Datefield, DatetimeField, ExcelReportViewer, FormElementField as FormElement, LIGHT_THEME_INITIAL_MAIN_COLOR, LIGHT_THEME_INITIAL_SECANDARY_COLOR, ReportViewer, SystemLookupCombobox, TemplateBarChart, TemplateDataCard, TemplateForm, TemplateGauge, TemplateGrid, TemplateLineChart, TemplateLineProgress, TemplatePieChart, TemplateTextField, TransferList, WorkflowDocumentPanel, WorkflowDocumentTimeLine, WorkflowRouteComponent, capitalizeFirstLetter, constructGridColumnsFromFields, constructValidationSchema, getAllFields, getElementFields, getGridSelection, hasDigitsOnly, isNumber, isNumeric, isValidEmail, timeAgo, useApiActions, useAxios, useConfirmationWindow, useIsMobile, useLoadingMask, useSession, useWindow };
661
- export type { CommonStores, CommonStoresInterface, EditDeleteAction, ExtendedTreeItemProps, FormActionProps, FormElementFieldProps, FormElementGroupProps, FormElementNodeProps, FormElementProps, FormElementSize, GridSelection, MakeOptional, ModalFormProps, RecordAction, RecordFieldProps, StoreMetaData, SystemRoute, TemplateFormProps, TemplateGridAttachmentProps, TemplateGridColDef, TemplateGridColumnProps, TemplateGridProps, TemplateGridTopBarProps, TransferListProps };
677
+ export type { CommonStores, CommonStoresInterface, EditDeleteAction, ExtendedTreeItemProps, FormActionProps, FormElementFieldProps, FormElementGroupProps, FormElementNodeProps, FormElementProps, FormElementSize, FormValueChangeCallBk, GridSelection, MakeOptional, ModalFormProps, RecordAction, RecordFieldProps, StoreMetaData, SystemRoute, TemplateFormProps, TemplateGridAttachmentProps, TemplateGridColDef, TemplateGridColumnProps, TemplateGridProps, TemplateGridTopBarProps, TransferListProps };