jb-grid 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/package.json +5 -2
  2. package/react/dist/{web-component/jb-grid/react/lib/Components → Components}/Cell.d.ts +10 -10
  3. package/react/dist/{web-component/jb-grid/react/lib/Components → Components}/ExpandRow.d.ts +11 -11
  4. package/react/dist/{web-component/jb-grid/react/lib/Components → Components}/JBLoading.d.ts +6 -6
  5. package/react/dist/{web-component/jb-grid/react/lib/Components → Components}/Row.d.ts +5 -5
  6. package/react/dist/{web-component/jb-grid/react/lib/Components → Components}/content-error/ContentError.d.ts +10 -10
  7. package/react/dist/{web-component/jb-grid/react/lib/Content.d.ts → Content.d.ts} +16 -16
  8. package/react/dist/{web-component/jb-grid/react/lib/Footer.d.ts → Footer.d.ts} +9 -9
  9. package/react/dist/{web-component/jb-grid/react/lib/Header.d.ts → Header.d.ts} +22 -22
  10. package/react/dist/JBGrid.cjs.js +2 -17989
  11. package/react/dist/JBGrid.cjs.js.map +1 -1
  12. package/react/dist/{web-component/jb-grid/react/lib/JBGrid.d.ts → JBGrid.d.ts} +25 -24
  13. package/react/dist/JBGrid.js +2 -17983
  14. package/react/dist/JBGrid.js.map +1 -1
  15. package/react/dist/JBGrid.umd.js +2 -17989
  16. package/react/dist/JBGrid.umd.js.map +1 -1
  17. package/react/dist/{web-component/jb-grid/react/lib/JBGridData.d.ts → JBGridData.d.ts} +16 -16
  18. package/react/dist/{web-component/jb-grid/react/lib/JBGridViewModel.d.ts → JBGridViewModel.d.ts} +70 -71
  19. package/react/dist/{web-component/jb-grid/react/lib/Types.d.ts → Types.d.ts} +124 -124
  20. package/react/dist/{web-component/jb-grid/react/lib/i18n.d.ts → i18n.d.ts} +2 -2
  21. package/react/lib/Content.tsx +1 -1
  22. package/react/lib/JBGrid.tsx +6 -6
  23. package/react/lib/JBGridData.ts +1 -1
  24. package/react/lib/JBGridViewModel.ts +2 -3
  25. package/react/lib/i18n.ts +1 -1
  26. package/react/lib/{Types.ts → types.ts} +1 -1
  27. package/react/package.json +1 -1
  28. package/react/tsconfig.json +3 -4
  29. package/react/dist/common/hooks/use-event.d.ts +0 -3
  30. package/react/dist/common/hooks/useLazyRef.d.ts +0 -4
  31. package/react/dist/common/hooks/useMobx.d.ts +0 -4
  32. package/react/dist/common/scripts/device-detection.d.ts +0 -1
  33. package/react/dist/common/scripts/persian-helper.d.ts +0 -3
  34. package/react/dist/web-component/jb-searchbar/types.d.ts +0 -1
@@ -1,16 +1,16 @@
1
- import { JBGridConfigStates, JBGridDataPage, JBGridTableConfig, JBGridCallbackConfig, JBGridDataConfig, JBGridConfigInterface, AnyObject } from './Types.js';
2
- declare class JBGridData<T extends AnyObject> implements JBGridConfigInterface<T> {
3
- constructor();
4
- table: JBGridTableConfig;
5
- data: JBGridDataConfig<T>;
6
- page: JBGridDataPage;
7
- states: JBGridConfigStates;
8
- callbacks: JBGridCallbackConfig<any>;
9
- /**
10
- * @deprecated provide it as a prop
11
- */
12
- customComponents: {
13
- headerEnd: any[];
14
- };
15
- }
16
- export { JBGridData };
1
+ import { JBGridConfigStates, JBGridDataPage, JBGridTableConfig, JBGridCallbackConfig, JBGridDataConfig, JBGridConfigInterface, AnyObject } from './types.js';
2
+ declare class JBGridData<T extends AnyObject> implements JBGridConfigInterface<T> {
3
+ constructor();
4
+ table: JBGridTableConfig;
5
+ data: JBGridDataConfig<T>;
6
+ page: JBGridDataPage;
7
+ states: JBGridConfigStates;
8
+ callbacks: JBGridCallbackConfig<any>;
9
+ /**
10
+ * @deprecated provide it as a prop
11
+ */
12
+ customComponents: {
13
+ headerEnd: any[];
14
+ };
15
+ }
16
+ export { JBGridData };
@@ -1,71 +1,70 @@
1
- import React from 'react';
2
- import { AnyObject, JBGridBridgeClassInterface, JBGridBridgeInterface, JBGridCallbacks, JBGridColumnDef, JBGridConfig, JBGridConfigInterface, JBGridFilter, JBGridI18nConfig, JBGridResponseData, JBGridRowData, JBGridStyles, SearchbarConfig } from './Types.js';
3
- import { JBSearchbarWebComponent } from 'jb-searchbar';
4
- import { JBSearchbarValue } from 'jb-searchbar/types.js';
5
- declare class JBGridViewModel<T extends AnyObject> {
6
- styles: JBGridStyles;
7
- elements: {
8
- refreshIcon: React.RefObject<SVGElement>;
9
- searchbar: React.RefObject<JBSearchbarWebComponent>;
10
- };
11
- JBGridComponentDom: HTMLDivElement | null;
12
- gridWrapperElement: HTMLElement | null;
13
- isLoading: boolean;
14
- dataBridge: JBGridBridgeInterface;
15
- paginationDebounce: any;
16
- isErrorOccurred: boolean;
17
- filter: JBGridFilter;
18
- callBacks: JBGridCallbacks;
19
- config: JBGridConfig<T>;
20
- i18n: JBGridI18nConfig;
21
- constructor(onFullscreenChange: (isFullScreen: boolean) => void, config: JBGridConfigInterface<T>, bridge: JBGridBridgeClassInterface);
22
- setI18n(newValue: JBGridI18nConfig): void;
23
- InitGrid(): void;
24
- onComponentDidMount(searchbarConfig: SearchbarConfig | null): void;
25
- mergeObject(inputConfig: JBGridConfig<any>, defaultConfig: JBGridConfig<any>): JBGridConfig<any>;
26
- sendFirstRequest(): void;
27
- initFilter(searchbarConfig: SearchbarConfig | null): void;
28
- InitSize(): void;
29
- getScrollbarWidth(): number;
30
- fetchGridData(): Promise<unknown>;
31
- onFetchSuccess(data: JBGridResponseData<T>): void;
32
- standardData(data: AnyObject[]): Promise<JBGridRowData<T>[]>;
33
- CreateRequestBody(): any;
34
- goToNextPage(): void;
35
- goToPrevPage(): void;
36
- goToLastPage(): void;
37
- goToFirstPage(): void;
38
- refreshBtnClick(): void;
39
- playRefreshBtnAnimation(): Animation;
40
- stopRefreshBtnAnimation(anime: Animation): void;
41
- goToPage(destinationPageIndex: number): Promise<unknown>;
42
- debounce(func: (...args: any[]) => any, delay: number): (...inputs: any[]) => Promise<unknown>;
43
- refreshData(): Promise<void>;
44
- onSearch(filterList: JBSearchbarValue): Promise<unknown>;
45
- onPageSizeChange(e: any): void;
46
- onFullScreenBtnClicked(currentValue: boolean): void;
47
- onFullscreenChanged(newValue: boolean): void;
48
- fullScreenGrid(): void;
49
- exitFullScreenGrid(): void;
50
- setSortColumn(column: JBGridColumnDef): void;
51
- changePageNumberToInput(): void;
52
- openSearchHeaderSection(): void;
53
- openMainHeaderSection(): void;
54
- showErrorPanel(): void;
55
- hideErrorPanel(): void;
56
- get paginationDisplayNumbers(): {
57
- currentPage: string | number;
58
- nextPage: string | number;
59
- next2Page: string | number;
60
- prevPage: string | number;
61
- prev2Page: string | number;
62
- totalItemsCount: string | number;
63
- startItemIndex: string | number;
64
- endItemIndex: string | number;
65
- pageSizes: (string | number)[];
66
- };
67
- toPersianNumber(input: string | number): string | number;
68
- }
69
- export default JBGridViewModel;
70
- export declare const JBGridContext: React.Context<JBGridViewModel<AnyObject>>;
71
- export declare const useJBGridVM: () => JBGridViewModel<AnyObject>;
1
+ import React from 'react';
2
+ import { AnyObject, JBGridBridgeClassInterface, JBGridBridgeInterface, JBGridCallbacks, JBGridColumnDef, JBGridConfig, JBGridConfigInterface, JBGridFilter, JBGridI18nConfig, JBGridResponseData, JBGridRowData, JBGridStyles, SearchbarConfig } from './types.js';
3
+ import { JBSearchbarWebComponent, type JBSearchbarValue } from 'jb-searchbar';
4
+ declare class JBGridViewModel<T extends AnyObject> {
5
+ styles: JBGridStyles;
6
+ elements: {
7
+ refreshIcon: React.RefObject<SVGElement>;
8
+ searchbar: React.RefObject<JBSearchbarWebComponent>;
9
+ };
10
+ JBGridComponentDom: HTMLDivElement | null;
11
+ gridWrapperElement: HTMLElement | null;
12
+ isLoading: boolean;
13
+ dataBridge: JBGridBridgeInterface;
14
+ paginationDebounce: any;
15
+ isErrorOccurred: boolean;
16
+ filter: JBGridFilter;
17
+ callBacks: JBGridCallbacks;
18
+ config: JBGridConfig<T>;
19
+ i18n: JBGridI18nConfig;
20
+ constructor(onFullscreenChange: (isFullScreen: boolean) => void, config: JBGridConfigInterface<T>, bridge: JBGridBridgeClassInterface);
21
+ setI18n(newValue: JBGridI18nConfig): void;
22
+ InitGrid(): void;
23
+ onComponentDidMount(searchbarConfig: SearchbarConfig | null): void;
24
+ mergeObject(inputConfig: JBGridConfig<any>, defaultConfig: JBGridConfig<any>): JBGridConfig<any>;
25
+ sendFirstRequest(): void;
26
+ initFilter(searchbarConfig: SearchbarConfig | null): void;
27
+ InitSize(): void;
28
+ getScrollbarWidth(): number;
29
+ fetchGridData(): Promise<unknown>;
30
+ onFetchSuccess(data: JBGridResponseData<T>): void;
31
+ standardData(data: AnyObject[]): Promise<JBGridRowData<T>[]>;
32
+ CreateRequestBody(): any;
33
+ goToNextPage(): void;
34
+ goToPrevPage(): void;
35
+ goToLastPage(): void;
36
+ goToFirstPage(): void;
37
+ refreshBtnClick(): void;
38
+ playRefreshBtnAnimation(): Animation;
39
+ stopRefreshBtnAnimation(anime: Animation): void;
40
+ goToPage(destinationPageIndex: number): Promise<unknown>;
41
+ debounce(func: (...args: any[]) => any, delay: number): (...inputs: any[]) => Promise<unknown>;
42
+ refreshData(): Promise<void>;
43
+ onSearch(filterList: JBSearchbarValue): Promise<unknown>;
44
+ onPageSizeChange(e: any): void;
45
+ onFullScreenBtnClicked(currentValue: boolean): void;
46
+ onFullscreenChanged(newValue: boolean): void;
47
+ fullScreenGrid(): void;
48
+ exitFullScreenGrid(): void;
49
+ setSortColumn(column: JBGridColumnDef): void;
50
+ changePageNumberToInput(): void;
51
+ openSearchHeaderSection(): void;
52
+ openMainHeaderSection(): void;
53
+ showErrorPanel(): void;
54
+ hideErrorPanel(): void;
55
+ get paginationDisplayNumbers(): {
56
+ currentPage: string | number;
57
+ nextPage: string | number;
58
+ next2Page: string | number;
59
+ prevPage: string | number;
60
+ prev2Page: string | number;
61
+ totalItemsCount: string | number;
62
+ startItemIndex: string | number;
63
+ endItemIndex: string | number;
64
+ pageSizes: (string | number)[];
65
+ };
66
+ toPersianNumber(input: string | number): string | number;
67
+ }
68
+ export default JBGridViewModel;
69
+ export declare const JBGridContext: React.Context<JBGridViewModel<AnyObject>>;
70
+ export declare const useJBGridVM: () => JBGridViewModel<AnyObject>;
@@ -1,124 +1,124 @@
1
- import { FilterColumn, JBSearchbarValue } from "jb-searchbar/types.js";
2
- export type JBGridRowDataDetail = {
3
- isDeleting: boolean;
4
- isDeleted: boolean;
5
- isRecovering: boolean;
6
- isExpanded: boolean;
7
- };
8
- export type JBGridRowDetail = {
9
- jbGridDetail: JBGridRowDataDetail;
10
- };
11
- export type AnyObject = {
12
- [key: string]: any;
13
- };
14
- export type JBGridStyles = {
15
- table: {
16
- generalCols: {
17
- gridTemplateColumns: string;
18
- };
19
- fullWidthCol: {
20
- gridColumn: string;
21
- };
22
- scrollIndent: {
23
- width: string;
24
- };
25
- mainRowStyle: {
26
- gridTemplateColumns: string;
27
- };
28
- };
29
- searchBar: any;
30
- contentWrapper: any;
31
- };
32
- export type JBGridRowData<T extends AnyObject> = T & JBGridRowDetail;
33
- export type JBGridResponseData<T extends AnyObject> = {
34
- pageIndex: number;
35
- startItemIndex: number;
36
- endItemIndex: number;
37
- totalItemsCount: number;
38
- totalPages: number;
39
- content: JBGridRowData<T>[];
40
- };
41
- export type JBGridFilter = {
42
- config: SearchbarConfig | null;
43
- value: JBSearchbarValue;
44
- };
45
- export type SearchbarConfig = {
46
- columnList: FilterColumn[];
47
- searchOnChange: boolean;
48
- };
49
- export interface JBGridBridgeInterface {
50
- mapServerResponseDataToGridData: (data: any) => JBGridResponseData<any>;
51
- getData: (data: JBGridConfigRequestParams, requestBody: any) => Promise<any>;
52
- createRequestBody: (page: JBGridDataPage, filter?: JBSearchbarValue, sortColumn?: JBGridColumnDef | null, requestConfig?: JBGridConfigRequestParams) => any;
53
- }
54
- type ClassBuilder<I, Args extends any[] = any[]> = new (...args: Args) => I;
55
- export type JBGridBridgeClassInterface = ClassBuilder<JBGridBridgeInterface, []>;
56
- export type JBGridDataPage = {
57
- index: number;
58
- size: number;
59
- totalPages: number;
60
- };
61
- export type JBGridColumnDef = {
62
- width?: string | number;
63
- sort?: "ASC" | "DESC" | undefined;
64
- sortable?: boolean;
65
- id: number;
66
- title: string;
67
- name: string;
68
- };
69
- export type JBGridConfigRequestParams = {
70
- method?: "POST" | "GET";
71
- url?: string;
72
- [key: string]: any;
73
- };
74
- export type JBGridDataConfig<T extends AnyObject> = {
75
- data: JBGridRowData<T>[];
76
- requestParams: JBGridConfigRequestParams;
77
- metaData: {
78
- startItemIndex: number;
79
- endItemIndex: number;
80
- totalItemsCount: number;
81
- };
82
- };
83
- export type JBGridTableConfig = {
84
- columns: JBGridColumnDef[];
85
- };
86
- export type JBGridConfigStates = {
87
- headerSection: 'MAIN' | "SEARCH";
88
- isFullScreen: boolean;
89
- };
90
- export type JBGridCallbackConfig<T extends AnyObject> = {
91
- onDataStandardizing: ((data: JBGridRowData<AnyObject>[]) => JBGridRowData<T>[]) | (<T extends AnyObject>(data: JBGridRowData<AnyObject>[]) => Promise<JBGridRowData<T>[]>) | null | undefined;
92
- onPageIndexChange: ((newPageIndex: number) => unknown) | null | undefined;
93
- };
94
- export type JBGridI18nMessage = {
95
- serverErrorText?: string;
96
- serverErrorTitle?: string;
97
- serverErrorRefreshButtonTitle?: string;
98
- EnterPageNumberMessage?: string;
99
- currentAvailableItem?: string;
100
- pageItemCount?: string;
101
- from?: string;
102
- };
103
- export type JBGridI18nConfig = {
104
- messages?: JBGridI18nMessage;
105
- showPersianNumber?: boolean;
106
- };
107
- export type ActionDispatchers = Readonly<{
108
- refreshData: () => Promise<void>;
109
- fullScreenGrid: () => void;
110
- exitFullScreenGrid: () => void;
111
- }>;
112
- export interface JBGridConfigInterface<T extends AnyObject> {
113
- table: JBGridTableConfig;
114
- data: JBGridDataConfig<T>;
115
- page: JBGridDataPage;
116
- callbacks: JBGridCallbackConfig<T>;
117
- actionDispatchers?: ActionDispatchers;
118
- states: JBGridConfigStates;
119
- }
120
- export type JBGridConfig<T extends AnyObject> = JBGridConfigInterface<T>;
121
- export type JBGridCallbacks = {
122
- onFullscreenChange: (isFullscreen: boolean) => void;
123
- };
124
- export {};
1
+ import { FilterColumn, JBSearchbarValue } from "jb-searchbar";
2
+ export type JBGridRowDataDetail = {
3
+ isDeleting: boolean;
4
+ isDeleted: boolean;
5
+ isRecovering: boolean;
6
+ isExpanded: boolean;
7
+ };
8
+ export type JBGridRowDetail = {
9
+ jbGridDetail: JBGridRowDataDetail;
10
+ };
11
+ export type AnyObject = {
12
+ [key: string]: any;
13
+ };
14
+ export type JBGridStyles = {
15
+ table: {
16
+ generalCols: {
17
+ gridTemplateColumns: string;
18
+ };
19
+ fullWidthCol: {
20
+ gridColumn: string;
21
+ };
22
+ scrollIndent: {
23
+ width: string;
24
+ };
25
+ mainRowStyle: {
26
+ gridTemplateColumns: string;
27
+ };
28
+ };
29
+ searchBar: any;
30
+ contentWrapper: any;
31
+ };
32
+ export type JBGridRowData<T extends AnyObject> = T & JBGridRowDetail;
33
+ export type JBGridResponseData<T extends AnyObject> = {
34
+ pageIndex: number;
35
+ startItemIndex: number;
36
+ endItemIndex: number;
37
+ totalItemsCount: number;
38
+ totalPages: number;
39
+ content: JBGridRowData<T>[];
40
+ };
41
+ export type JBGridFilter = {
42
+ config: SearchbarConfig | null;
43
+ value: JBSearchbarValue;
44
+ };
45
+ export type SearchbarConfig = {
46
+ columnList: FilterColumn[];
47
+ searchOnChange: boolean;
48
+ };
49
+ export interface JBGridBridgeInterface {
50
+ mapServerResponseDataToGridData: (data: any) => JBGridResponseData<any>;
51
+ getData: (data: JBGridConfigRequestParams, requestBody: any) => Promise<any>;
52
+ createRequestBody: (page: JBGridDataPage, filter?: JBSearchbarValue, sortColumn?: JBGridColumnDef | null, requestConfig?: JBGridConfigRequestParams) => any;
53
+ }
54
+ type ClassBuilder<I, Args extends any[] = any[]> = new (...args: Args) => I;
55
+ export type JBGridBridgeClassInterface = ClassBuilder<JBGridBridgeInterface, []>;
56
+ export type JBGridDataPage = {
57
+ index: number;
58
+ size: number;
59
+ totalPages: number;
60
+ };
61
+ export type JBGridColumnDef = {
62
+ width?: string | number;
63
+ sort?: "ASC" | "DESC" | undefined;
64
+ sortable?: boolean;
65
+ id: number;
66
+ title: string;
67
+ name: string;
68
+ };
69
+ export type JBGridConfigRequestParams = {
70
+ method?: "POST" | "GET";
71
+ url?: string;
72
+ [key: string]: any;
73
+ };
74
+ export type JBGridDataConfig<T extends AnyObject> = {
75
+ data: JBGridRowData<T>[];
76
+ requestParams: JBGridConfigRequestParams;
77
+ metaData: {
78
+ startItemIndex: number;
79
+ endItemIndex: number;
80
+ totalItemsCount: number;
81
+ };
82
+ };
83
+ export type JBGridTableConfig = {
84
+ columns: JBGridColumnDef[];
85
+ };
86
+ export type JBGridConfigStates = {
87
+ headerSection: 'MAIN' | "SEARCH";
88
+ isFullScreen: boolean;
89
+ };
90
+ export type JBGridCallbackConfig<T extends AnyObject> = {
91
+ onDataStandardizing: ((data: JBGridRowData<AnyObject>[]) => JBGridRowData<T>[]) | (<T extends AnyObject>(data: JBGridRowData<AnyObject>[]) => Promise<JBGridRowData<T>[]>) | null | undefined;
92
+ onPageIndexChange: ((newPageIndex: number) => unknown) | null | undefined;
93
+ };
94
+ export type JBGridI18nMessage = {
95
+ serverErrorText?: string;
96
+ serverErrorTitle?: string;
97
+ serverErrorRefreshButtonTitle?: string;
98
+ EnterPageNumberMessage?: string;
99
+ currentAvailableItem?: string;
100
+ pageItemCount?: string;
101
+ from?: string;
102
+ };
103
+ export type JBGridI18nConfig = {
104
+ messages?: JBGridI18nMessage;
105
+ showPersianNumber?: boolean;
106
+ };
107
+ export type ActionDispatchers = Readonly<{
108
+ refreshData: () => Promise<void>;
109
+ fullScreenGrid: () => void;
110
+ exitFullScreenGrid: () => void;
111
+ }>;
112
+ export interface JBGridConfigInterface<T extends AnyObject> {
113
+ table: JBGridTableConfig;
114
+ data: JBGridDataConfig<T>;
115
+ page: JBGridDataPage;
116
+ callbacks: JBGridCallbackConfig<T>;
117
+ actionDispatchers?: ActionDispatchers;
118
+ states: JBGridConfigStates;
119
+ }
120
+ export type JBGridConfig<T extends AnyObject> = JBGridConfigInterface<T>;
121
+ export type JBGridCallbacks = {
122
+ onFullscreenChange: (isFullscreen: boolean) => void;
123
+ };
124
+ export {};
@@ -1,2 +1,2 @@
1
- import { JBGridI18nConfig } from "./Types.js";
2
- export declare const defaultI18n: JBGridI18nConfig;
1
+ import { JBGridI18nConfig } from "./types.js";
2
+ export declare const defaultI18n: JBGridI18nConfig;
@@ -1,7 +1,7 @@
1
1
  import { observer } from 'mobx-react';
2
2
  import React, { ReactNode } from 'react';
3
3
  import JBLoading from './Components/JBLoading.js';
4
- import { JBGridColumnDef, JBGridConfig, JBGridI18nConfig, JBGridStyles } from './Types.js';
4
+ import { JBGridColumnDef, JBGridConfig, JBGridI18nConfig, JBGridStyles } from './types.js';
5
5
  import ContentError from './Components/content-error/ContentError.js';
6
6
  export type ContentProps = {
7
7
  children:React.ReactNode | React.ReactNode[],
@@ -4,16 +4,16 @@ import { observer } from 'mobx-react';
4
4
  import './JBGrid.scss';
5
5
  export { JBGridData } from './JBGridData.js';
6
6
  import 'jb-searchbar';
7
- import { AnyObject, JBGridBridgeClassInterface, JBGridConfig, JBGridI18nConfig, SearchbarConfig } from './Types.js';
7
+ import { AnyObject, JBGridBridgeClassInterface, JBGridConfig, JBGridI18nConfig, SearchbarConfig } from './types.js';
8
8
  import Footer from './Footer.js';
9
9
  import Header from './Header.js';
10
10
  import Content from './Content.js';
11
- import { useMobx } from '../../../../common/hooks/useMobx.js';
11
+ import { useInstance } from 'jb-core/react';
12
12
  export { Row } from './Components/Row.js';
13
13
  export { Cell } from './Components/Cell.js';
14
14
  export { ExpandRow } from './Components/ExpandRow.js';
15
-
16
- export type JBGridProps<T extends AnyObject> = {
15
+ export * from './types.js';
16
+ export type Props<T extends AnyObject> = {
17
17
  searchbarConfig?: SearchbarConfig | null | undefined,
18
18
  config: JBGridConfig<T>,
19
19
  bridge: JBGridBridgeClassInterface,
@@ -28,8 +28,8 @@ export type JBGridProps<T extends AnyObject> = {
28
28
  children?: React.ReactNode | React.ReactNode[]
29
29
 
30
30
  }
31
- function JBGridComponent<T extends AnyObject>(props: JBGridProps<T>) {
32
- const vm = useMobx(JBGridViewModel<AnyObject>, [props, props.config, props.bridge]);
31
+ function JBGridComponent<T extends AnyObject>(props: Props<T>) {
32
+ const vm = useInstance(JBGridViewModel<AnyObject>, [props.onFullscreenChange, props.config, props.bridge]);
33
33
  useEffect(() => {
34
34
  vm.onComponentDidMount(props.searchbarConfig || null);
35
35
  }, []);
@@ -1,5 +1,5 @@
1
1
  import { makeObservable, observable } from 'mobx';
2
- import { JBGridConfigStates, JBGridDataPage, JBGridTableConfig,JBGridCallbackConfig, JBGridI18nConfig, JBGridDataConfig, JBGridConfigInterface, AnyObject } from './Types.js';
2
+ import { JBGridConfigStates, JBGridDataPage, JBGridTableConfig,JBGridCallbackConfig, JBGridI18nConfig, JBGridDataConfig, JBGridConfigInterface, AnyObject } from './types.js';
3
3
 
4
4
  class JBGridData<T extends AnyObject> implements JBGridConfigInterface<T> {
5
5
  constructor(){
@@ -1,9 +1,8 @@
1
1
  import React, { createContext, useContext } from 'react';
2
2
  import { observable, extendObservable, makeObservable, action, computed } from 'mobx';
3
- import { ActionDispatchers, AnyObject, JBGridBridgeClassInterface, JBGridBridgeInterface, JBGridCallbacks, JBGridColumnDef, JBGridConfig, JBGridConfigInterface, JBGridFilter, JBGridI18nConfig, JBGridResponseData, JBGridRowData, JBGridRowDetail, JBGridStyles, SearchbarConfig } from './Types.js';
4
- import { JBSearchbarWebComponent } from 'jb-searchbar';
3
+ import { ActionDispatchers, AnyObject, JBGridBridgeClassInterface, JBGridBridgeInterface, JBGridCallbacks, JBGridColumnDef, JBGridConfig, JBGridConfigInterface, JBGridFilter, JBGridI18nConfig, JBGridResponseData, JBGridRowData, JBGridRowDetail, JBGridStyles, SearchbarConfig } from './types.js';
4
+ import { JBSearchbarWebComponent, type JBSearchbarValue } from 'jb-searchbar';
5
5
  import { defaultI18n } from './i18n.js';
6
- import { JBSearchbarValue } from 'jb-searchbar/types.js';
7
6
  import { assign } from 'lodash';
8
7
  class JBGridViewModel<T extends AnyObject> {
9
8
  //we write computed style of grid here
package/react/lib/i18n.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { JBGridI18nConfig, JBGridI18nMessage } from "./Types.js";
1
+ import { JBGridI18nConfig, JBGridI18nMessage } from "./types.js";
2
2
 
3
3
  const i18nMessages:JBGridI18nMessage = {
4
4
  EnterPageNumberMessage:"شماره صفحه ای که میخواهید وارد آن شوید را وارد کنید",
@@ -1,4 +1,4 @@
1
- import { FilterColumn, JBSearchbarValue } from "jb-searchbar/types.js";
1
+ import { FilterColumn, JBSearchbarValue } from "jb-searchbar";
2
2
 
3
3
 
4
4
  // export type JBGridRowData = {
@@ -27,7 +27,7 @@
27
27
  "index.js"
28
28
  ],
29
29
  "main": "index.js",
30
- "types": "./dist/web-component/jb-grid/react/lib/JBGrid.d.ts",
30
+ "types": "./dist/JBGrid.d.ts",
31
31
  "jsnext:main":"index.js",
32
32
  "module": "index.js",
33
33
  "repository": {
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "baseUrl": ".",
4
+ "rootDir": "./lib",
5
+ "declarationDir": "./dist"
4
6
  },
5
7
  "include": [
6
- "../../../common/scripts/**/*.ts",
7
- "../../../common/hooks/**/*.ts",
8
- "../../../common/hooks/**/*.js",
9
8
  "lib/**/*.ts",
10
9
  "lib/**/*.tsx"
11
10
  ],
@@ -14,5 +13,5 @@
14
13
  "**/*.spec.ts",
15
14
  "dist",
16
15
  ],
17
- "extends":"../../tsconfig-react.json"
16
+ "extends":"jb-core/configs/tsconfig-react.json"
18
17
  }
@@ -1,3 +0,0 @@
1
- /// <reference types="react" resolution-mode="require"/>
2
- export declare function useEvent(dom: HTMLElement, event: any, handler: any, passive?: boolean): void;
3
- export declare function useBindEvent<TRef extends React.MutableRefObject<any | null>, TEvent>(ref: TRef, event: string, handler: (e: TEvent) => void, passive?: boolean): void;
@@ -1,4 +0,0 @@
1
- import { MutableRefObject } from "react";
2
- type InitFunc<T> = () => T;
3
- export declare const useLazyRef: <T>(initValFunc: InitFunc<T>) => MutableRefObject<any>;
4
- export {};
@@ -1,4 +0,0 @@
1
- type Initializers = any[];
2
- type Constructor<T extends object = object> = new (...args: any[]) => T;
3
- export declare const useMobx: <T extends object>(Store: Constructor<T>, initializers: Initializers) => T;
4
- export {};
@@ -1 +0,0 @@
1
- export declare const isMobile: () => boolean;
@@ -1,3 +0,0 @@
1
- declare function faToEnDigits(input: string | number): string;
2
- declare function enToFaDigits(input: string | number): string;
3
- export { enToFaDigits, faToEnDigits };
@@ -1 +0,0 @@
1
- export * from './dist/web-component/jb-searchbar/lib/types.js';