@zeedhi/common 1.123.0 → 1.125.0

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 (220) hide show
  1. package/dist/zd-common.esm.js +6 -6
  2. package/dist/zd-common.umd.js +6 -6
  3. package/package.json +2 -2
  4. package/types/components/zd-date/date-range.d.ts +1 -1
  5. package/types/components/zd-date/date.d.ts +1 -1
  6. package/types/components/zd-date/interfaces.d.ts +1 -1
  7. package/types/components/zd-time/interfaces.d.ts +1 -0
  8. package/types/components/zd-time/time.d.ts +1 -1
  9. package/types/services/zd-json-cache/json-cache-service.d.ts +12 -0
  10. package/dist/types/components/index.d.ts +0 -151
  11. package/dist/types/components/zd-alert/alert.d.ts +0 -94
  12. package/dist/types/components/zd-alert/interfaces.d.ts +0 -18
  13. package/dist/types/components/zd-badge/badge.d.ts +0 -28
  14. package/dist/types/components/zd-badge/interfaces.d.ts +0 -10
  15. package/dist/types/components/zd-breadcrumbs/breadcrumbs.d.ts +0 -32
  16. package/dist/types/components/zd-breadcrumbs/interfaces.d.ts +0 -24
  17. package/dist/types/components/zd-button/button.d.ts +0 -89
  18. package/dist/types/components/zd-button/interfaces.d.ts +0 -48
  19. package/dist/types/components/zd-button-group/button-group.d.ts +0 -67
  20. package/dist/types/components/zd-button-group/interfaces.d.ts +0 -25
  21. package/dist/types/components/zd-card/card.d.ts +0 -152
  22. package/dist/types/components/zd-card/interfaces.d.ts +0 -40
  23. package/dist/types/components/zd-carousel/carousel.d.ts +0 -163
  24. package/dist/types/components/zd-carousel/interfaces.d.ts +0 -49
  25. package/dist/types/components/zd-checkbox/checkbox.d.ts +0 -12
  26. package/dist/types/components/zd-checkbox/interfaces.d.ts +0 -5
  27. package/dist/types/components/zd-checkbox-multiple/checkbox-multiple.d.ts +0 -39
  28. package/dist/types/components/zd-checkbox-multiple/interfaces.d.ts +0 -13
  29. package/dist/types/components/zd-chip/chip.d.ts +0 -60
  30. package/dist/types/components/zd-chip/interfaces.d.ts +0 -18
  31. package/dist/types/components/zd-code-viewer/code-viewer.d.ts +0 -86
  32. package/dist/types/components/zd-code-viewer/interfaces.d.ts +0 -13
  33. package/dist/types/components/zd-col/col.d.ts +0 -33
  34. package/dist/types/components/zd-col/interfaces.d.ts +0 -15
  35. package/dist/types/components/zd-collapse-card/collapse-card.d.ts +0 -56
  36. package/dist/types/components/zd-collapse-card/interfaces.d.ts +0 -14
  37. package/dist/types/components/zd-component/child-not-found.d.ts +0 -6
  38. package/dist/types/components/zd-component/component-render.d.ts +0 -16
  39. package/dist/types/components/zd-component/component.d.ts +0 -120
  40. package/dist/types/components/zd-component/interfaces.d.ts +0 -74
  41. package/dist/types/components/zd-container/container.d.ts +0 -45
  42. package/dist/types/components/zd-container/interfaces.d.ts +0 -12
  43. package/dist/types/components/zd-currency/currency.d.ts +0 -12
  44. package/dist/types/components/zd-currency/interfaces.d.ts +0 -6
  45. package/dist/types/components/zd-date-input/date-input.d.ts +0 -152
  46. package/dist/types/components/zd-date-input/interfaces.d.ts +0 -27
  47. package/dist/types/components/zd-date-range/date-range.d.ts +0 -158
  48. package/dist/types/components/zd-date-range/interfaces.d.ts +0 -18
  49. package/dist/types/components/zd-dialog/dialog.d.ts +0 -76
  50. package/dist/types/components/zd-dialog/interfaces.d.ts +0 -13
  51. package/dist/types/components/zd-divider/divider.d.ts +0 -20
  52. package/dist/types/components/zd-divider/interfaces.d.ts +0 -8
  53. package/dist/types/components/zd-dropdown/dropdown.d.ts +0 -81
  54. package/dist/types/components/zd-dropdown/interfaces.d.ts +0 -23
  55. package/dist/types/components/zd-footer/footer.d.ts +0 -80
  56. package/dist/types/components/zd-footer/interfaces.d.ts +0 -26
  57. package/dist/types/components/zd-form/form.d.ts +0 -174
  58. package/dist/types/components/zd-form/interfaces.d.ts +0 -36
  59. package/dist/types/components/zd-frame/frame.d.ts +0 -81
  60. package/dist/types/components/zd-frame/interfaces.d.ts +0 -23
  61. package/dist/types/components/zd-frame-page/frame-page.d.ts +0 -14
  62. package/dist/types/components/zd-frame-page/interfaces.d.ts +0 -4
  63. package/dist/types/components/zd-grid/data-navigator.d.ts +0 -12
  64. package/dist/types/components/zd-grid/data-selector.d.ts +0 -25
  65. package/dist/types/components/zd-grid/grid-column.d.ts +0 -47
  66. package/dist/types/components/zd-grid/grid-events.d.ts +0 -26
  67. package/dist/types/components/zd-grid/grid.d.ts +0 -85
  68. package/dist/types/components/zd-grid/index.d.ts +0 -11
  69. package/dist/types/components/zd-grid/interfaces.d.ts +0 -148
  70. package/dist/types/components/zd-grid/iterable-table.d.ts +0 -28
  71. package/dist/types/components/zd-grid/keymap-merger.d.ts +0 -26
  72. package/dist/types/components/zd-grid/keymap-navigation.d.ts +0 -6
  73. package/dist/types/components/zd-grid/table-action-builder.d.ts +0 -19
  74. package/dist/types/components/zd-grid/view-navigator.d.ts +0 -10
  75. package/dist/types/components/zd-grid-editable/data-editor-with-add.d.ts +0 -35
  76. package/dist/types/components/zd-grid-editable/data-editor.d.ts +0 -64
  77. package/dist/types/components/zd-grid-editable/errors/index.d.ts +0 -2
  78. package/dist/types/components/zd-grid-editable/errors/not-editing.d.ts +0 -6
  79. package/dist/types/components/zd-grid-editable/errors/row-not-found.d.ts +0 -6
  80. package/dist/types/components/zd-grid-editable/grid-column-editable.d.ts +0 -9
  81. package/dist/types/components/zd-grid-editable/grid-editable-controller.d.ts +0 -8
  82. package/dist/types/components/zd-grid-editable/grid-editable-events.d.ts +0 -32
  83. package/dist/types/components/zd-grid-editable/grid-editable.d.ts +0 -124
  84. package/dist/types/components/zd-grid-editable/index.d.ts +0 -8
  85. package/dist/types/components/zd-grid-editable/interfaces.d.ts +0 -66
  86. package/dist/types/components/zd-grid-editable/keymap-editing.d.ts +0 -7
  87. package/dist/types/components/zd-header/header.d.ts +0 -94
  88. package/dist/types/components/zd-header/interfaces.d.ts +0 -29
  89. package/dist/types/components/zd-icon/icon.d.ts +0 -55
  90. package/dist/types/components/zd-icon/interfaces.d.ts +0 -13
  91. package/dist/types/components/zd-image/image.d.ts +0 -73
  92. package/dist/types/components/zd-image/interfaces.d.ts +0 -17
  93. package/dist/types/components/zd-increment/increment.d.ts +0 -56
  94. package/dist/types/components/zd-increment/interfaces.d.ts +0 -9
  95. package/dist/types/components/zd-input/input-factory.d.ts +0 -6
  96. package/dist/types/components/zd-input/input.d.ts +0 -223
  97. package/dist/types/components/zd-input/interfaces.d.ts +0 -38
  98. package/dist/types/components/zd-iterable/column-not-found.d.ts +0 -6
  99. package/dist/types/components/zd-iterable/column.d.ts +0 -78
  100. package/dist/types/components/zd-iterable/conditions-manager.d.ts +0 -49
  101. package/dist/types/components/zd-iterable/interfaces.d.ts +0 -103
  102. package/dist/types/components/zd-iterable/iterable-columns-button-controller.d.ts +0 -9
  103. package/dist/types/components/zd-iterable/iterable-columns-button.d.ts +0 -35
  104. package/dist/types/components/zd-iterable/iterable-controller.d.ts +0 -8
  105. package/dist/types/components/zd-iterable/iterable-page-component.d.ts +0 -27
  106. package/dist/types/components/zd-iterable/iterable-page-info.d.ts +0 -7
  107. package/dist/types/components/zd-iterable/iterable-page-size.d.ts +0 -62
  108. package/dist/types/components/zd-iterable/iterable-pagination.d.ts +0 -28
  109. package/dist/types/components/zd-iterable/iterable.d.ts +0 -77
  110. package/dist/types/components/zd-iterable/search.d.ts +0 -31
  111. package/dist/types/components/zd-iterable-component-render/interfaces.d.ts +0 -34
  112. package/dist/types/components/zd-iterable-component-render/iterable-component-render.d.ts +0 -84
  113. package/dist/types/components/zd-layout/interfaces.d.ts +0 -7
  114. package/dist/types/components/zd-layout/layout.d.ts +0 -9
  115. package/dist/types/components/zd-list/interfaces.d.ts +0 -44
  116. package/dist/types/components/zd-list/item-not-found.d.ts +0 -6
  117. package/dist/types/components/zd-list/list-group.d.ts +0 -30
  118. package/dist/types/components/zd-list/list-item.d.ts +0 -46
  119. package/dist/types/components/zd-list/list.d.ts +0 -81
  120. package/dist/types/components/zd-loading/interfaces.d.ts +0 -7
  121. package/dist/types/components/zd-loading/loading.d.ts +0 -21
  122. package/dist/types/components/zd-login/interfaces.d.ts +0 -25
  123. package/dist/types/components/zd-login/login-button.d.ts +0 -50
  124. package/dist/types/components/zd-login/login.d.ts +0 -54
  125. package/dist/types/components/zd-main/interfaces.d.ts +0 -5
  126. package/dist/types/components/zd-main/main.d.ts +0 -7
  127. package/dist/types/components/zd-master-detail/detail-not-found.d.ts +0 -7
  128. package/dist/types/components/zd-master-detail/interfaces.d.ts +0 -10
  129. package/dist/types/components/zd-master-detail/master-detail.d.ts +0 -18
  130. package/dist/types/components/zd-master-detail/master-not-found.d.ts +0 -7
  131. package/dist/types/components/zd-menu/interfaces.d.ts +0 -68
  132. package/dist/types/components/zd-menu/menu-button.d.ts +0 -29
  133. package/dist/types/components/zd-menu/menu-group.d.ts +0 -61
  134. package/dist/types/components/zd-menu/menu-link.d.ts +0 -50
  135. package/dist/types/components/zd-menu/menu-separator.d.ts +0 -7
  136. package/dist/types/components/zd-menu/menu.d.ts +0 -199
  137. package/dist/types/components/zd-modal/interfaces.d.ts +0 -35
  138. package/dist/types/components/zd-modal/modal-close-button.d.ts +0 -28
  139. package/dist/types/components/zd-modal/modal.d.ts +0 -53
  140. package/dist/types/components/zd-month/interfaces.d.ts +0 -6
  141. package/dist/types/components/zd-month/month.d.ts +0 -33
  142. package/dist/types/components/zd-number-input/interfaces.d.ts +0 -8
  143. package/dist/types/components/zd-number-input/number-input.d.ts +0 -43
  144. package/dist/types/components/zd-password/interfaces.d.ts +0 -6
  145. package/dist/types/components/zd-password/password.d.ts +0 -17
  146. package/dist/types/components/zd-progress/interfaces.d.ts +0 -10
  147. package/dist/types/components/zd-progress/progress.d.ts +0 -41
  148. package/dist/types/components/zd-radio/interfaces.d.ts +0 -11
  149. package/dist/types/components/zd-radio/radio.d.ts +0 -35
  150. package/dist/types/components/zd-row/interfaces.d.ts +0 -13
  151. package/dist/types/components/zd-row/row.d.ts +0 -39
  152. package/dist/types/components/zd-select/interfaces.d.ts +0 -24
  153. package/dist/types/components/zd-select/select.d.ts +0 -238
  154. package/dist/types/components/zd-select-multiple/interfaces.d.ts +0 -18
  155. package/dist/types/components/zd-select-multiple/select-multiple.d.ts +0 -113
  156. package/dist/types/components/zd-svg-map/interfaces.d.ts +0 -26
  157. package/dist/types/components/zd-svg-map/svg-map.d.ts +0 -35
  158. package/dist/types/components/zd-switch/interfaces.d.ts +0 -7
  159. package/dist/types/components/zd-switch/switch.d.ts +0 -16
  160. package/dist/types/components/zd-table/interfaces.d.ts +0 -25
  161. package/dist/types/components/zd-table/table.d.ts +0 -42
  162. package/dist/types/components/zd-tabs/interfaces.d.ts +0 -40
  163. package/dist/types/components/zd-tabs/tab-not-found.d.ts +0 -11
  164. package/dist/types/components/zd-tabs/tab.d.ts +0 -57
  165. package/dist/types/components/zd-tabs/tabs.d.ts +0 -86
  166. package/dist/types/components/zd-tag/interfaces.d.ts +0 -7
  167. package/dist/types/components/zd-tag/tag.d.ts +0 -13
  168. package/dist/types/components/zd-text/interfaces.d.ts +0 -9
  169. package/dist/types/components/zd-text/text.d.ts +0 -8
  170. package/dist/types/components/zd-text-input/interfaces.d.ts +0 -23
  171. package/dist/types/components/zd-text-input/text-input.d.ts +0 -91
  172. package/dist/types/components/zd-textarea/interfaces.d.ts +0 -21
  173. package/dist/types/components/zd-textarea/textarea.d.ts +0 -71
  174. package/dist/types/components/zd-time/interfaces.d.ts +0 -22
  175. package/dist/types/components/zd-time/time-format-selector.d.ts +0 -8
  176. package/dist/types/components/zd-time/time.d.ts +0 -149
  177. package/dist/types/components/zd-toggleable/interfaces.d.ts +0 -6
  178. package/dist/types/components/zd-toggleable/toggleable.d.ts +0 -21
  179. package/dist/types/components/zd-tooltip/interfaces.d.ts +0 -18
  180. package/dist/types/components/zd-tooltip/tooltip.d.ts +0 -57
  181. package/dist/types/components/zd-tree/interfaces.d.ts +0 -107
  182. package/dist/types/components/zd-tree/tree.d.ts +0 -161
  183. package/dist/types/components/zd-tree-grid/index.d.ts +0 -6
  184. package/dist/types/components/zd-tree-grid/interfaces.d.ts +0 -35
  185. package/dist/types/components/zd-tree-grid/iterable-tree.d.ts +0 -10
  186. package/dist/types/components/zd-tree-grid/keymap-tree.d.ts +0 -7
  187. package/dist/types/components/zd-tree-grid/tree-data-navigator.d.ts +0 -10
  188. package/dist/types/components/zd-tree-grid/tree-data-selector.d.ts +0 -18
  189. package/dist/types/components/zd-tree-grid/tree-grid.d.ts +0 -119
  190. package/dist/types/error/delete-rows.d.ts +0 -7
  191. package/dist/types/error/index.d.ts +0 -3
  192. package/dist/types/error/non-initialized.d.ts +0 -7
  193. package/dist/types/error/zeedhi-error.d.ts +0 -6
  194. package/dist/types/index.d.ts +0 -6
  195. package/dist/types/services/index.d.ts +0 -4
  196. package/dist/types/services/zd-alert/alert-queue.d.ts +0 -13
  197. package/dist/types/services/zd-alert/alert-replace.d.ts +0 -18
  198. package/dist/types/services/zd-alert/alert-service.d.ts +0 -45
  199. package/dist/types/services/zd-alert/alert-stack.d.ts +0 -9
  200. package/dist/types/services/zd-alert/index.d.ts +0 -5
  201. package/dist/types/services/zd-alert/interfaces.d.ts +0 -6
  202. package/dist/types/services/zd-dialog/dialog-service.d.ts +0 -24
  203. package/dist/types/services/zd-loading/loading-service.d.ts +0 -17
  204. package/dist/types/services/zd-modal/modal-service.d.ts +0 -39
  205. package/dist/types/utils/data-value-out/data-value-out.d.ts +0 -5
  206. package/dist/types/utils/data-value-out/index.d.ts +0 -2
  207. package/dist/types/utils/data-value-out/interfaces.d.ts +0 -8
  208. package/dist/types/utils/datasource-searcher/datasource-searcher.d.ts +0 -6
  209. package/dist/types/utils/datasource-searcher/index.d.ts +0 -2
  210. package/dist/types/utils/datasource-searcher/interfaces.d.ts +0 -5
  211. package/dist/types/utils/icons/icons.d.ts +0 -24
  212. package/dist/types/utils/index.d.ts +0 -7
  213. package/dist/types/utils/omit/omit.d.ts +0 -11
  214. package/dist/types/utils/theme/theme.d.ts +0 -34
  215. package/dist/types/utils/tree-data-structure/index.d.ts +0 -2
  216. package/dist/types/utils/tree-data-structure/interfaces.d.ts +0 -30
  217. package/dist/types/utils/tree-data-structure/tree-data-structure.d.ts +0 -155
  218. package/dist/types/utils/unique-by/unique-by.d.ts +0 -3
  219. package/dist/zd-common.js +0 -13133
  220. package/dist/zd-common.min.js +0 -13133
@@ -1,148 +0,0 @@
1
- import { IDictionary, IEventParam, IKeyMap } from '@zeedhi/core';
2
- import { EventDef, IComponent, IComponentRender } from '../zd-component/interfaces';
3
- import { IColumn, IIterable, IIterableEvents, IIterableProps } from '../zd-iterable/interfaces';
4
- import { Grid } from './grid';
5
- import { GridColumn } from './grid-column';
6
- export interface IGridColumn extends IColumn {
7
- children?: IChildrenActionColumn[];
8
- }
9
- export interface IChildrenActionColumn extends IComponent {
10
- conditions?: IDictionary;
11
- }
12
- export interface ITableActionBuilder {
13
- getActionComponent(actionComponent: IComponent, column: GridColumn, row: IDictionary, parentPath?: string): IComponent;
14
- }
15
- export interface IIterableTable {
16
- changeOrder(sortBy: {
17
- key: string;
18
- order: 'asc' | 'desc';
19
- }[]): Promise<void>;
20
- selectCell(row: IDictionary, column: GridColumn): void;
21
- reapplyRowStyleConditions(row: IDictionary): IDictionary;
22
- getRowStyleConditions(row: IDictionary): IDictionary;
23
- deleteRows(): Promise<any[]>;
24
- }
25
- export interface IDataSelector {
26
- selectAll(isSelected: boolean): void;
27
- toggleRow(row: IDictionary): void;
28
- selectRow(row: IDictionary, select: boolean): void;
29
- callDisableSelection(row: IDictionary): boolean;
30
- selectClick(row: IDictionary<any>, isSelected: boolean, event: Event, element?: HTMLElement): void;
31
- selectAllClick(isSelected: boolean, event: Event, element?: HTMLElement): void;
32
- }
33
- export interface IGridEvents {
34
- rowClick(row: IDictionary<any>, event: Event, element?: HTMLElement): void;
35
- cellClick(row: IDictionary<any>, column: GridColumn, event: Event, element?: HTMLElement): void;
36
- }
37
- export type Direction = 'up' | 'down' | 'left' | 'right';
38
- export type VerticalDirection = 'up' | 'down';
39
- export interface IDataNavigator {
40
- navigateDatasource(direction: VerticalDirection): void;
41
- navigatePageUp(): void;
42
- navigatePageDown(): void;
43
- }
44
- export interface IViewNavigator {
45
- navigateLeft({ event }: IEventParam<any>): void;
46
- navigateRight({ event }: IEventParam<any>): void;
47
- navigateUp(): void;
48
- navigateDown(): void;
49
- setViewNavigate(viewNavigate: (direction: Direction, event?: Event) => void): void;
50
- }
51
- export interface IKeyMapConfig<T> {
52
- getMap(instance: T): IKeyMap;
53
- }
54
- export interface IKeyMapMerger {
55
- bind(element: HTMLElement): void;
56
- unbind(): void;
57
- }
58
- export interface IGridEvent extends IEventParam<Grid> {
59
- row: IDictionary;
60
- column: IColumn;
61
- }
62
- export interface GridEventsProp<T = IGridEvent | IEventParam<any>> extends IIterableEvents<T> {
63
- cellClick?: EventDef<T>;
64
- rowClick?: EventDef<T>;
65
- selected?: EventDef<T>;
66
- selectedAll?: EventDef<T>;
67
- unselected?: EventDef<T>;
68
- unselectedAll?: EventDef<T>;
69
- }
70
- export interface IGridProps extends IIterableProps {
71
- backgroundColor?: string;
72
- cellSelection?: boolean;
73
- dense?: boolean;
74
- disableSelection?: (args: {
75
- row: IDictionary<any>;
76
- component: Grid;
77
- }) => boolean;
78
- dragColumns?: boolean;
79
- errorSlot?: IComponentRender[];
80
- events?: GridEventsProp;
81
- fillHeight?: boolean;
82
- footerSlot?: IComponentRender[];
83
- headerBackground?: string;
84
- headerCellTextColor?: string;
85
- height?: number | string;
86
- loadingText?: string;
87
- maxHeight?: number | string;
88
- maxWidth?: number | string;
89
- minHeight?: number | string;
90
- minWidth?: number | string;
91
- noDataSlot?: IComponentRender[];
92
- noDataText?: string;
93
- noResultSlot?: IComponentRender[];
94
- noResultsText?: string;
95
- resizeColumns?: boolean;
96
- rowStyleConditions?: (row: IDictionary) => IDictionary;
97
- selectable?: boolean;
98
- selectAllPages?: boolean;
99
- showFooter?: boolean;
100
- showHeader?: boolean;
101
- showSelectAll?: boolean;
102
- toolbarSlot?: IComponentRender[];
103
- width?: number | string;
104
- }
105
- export interface IGrid<T = GridColumn> extends IIterable<T>, IIterableTable, IDataSelector, IDataNavigator, IViewNavigator, ITableActionBuilder {
106
- backgroundColor: string;
107
- cellSelection: boolean;
108
- currentColumn: GridColumn | null;
109
- dense: boolean;
110
- disableSelection?: (args: {
111
- row: IDictionary<any>;
112
- component: IGrid;
113
- }) => boolean;
114
- dragColumns: boolean;
115
- errorSlot: IComponentRender[];
116
- events: GridEventsProp;
117
- footerSlot: IComponentRender[];
118
- headerBackground: string;
119
- headerCellTextColor: string;
120
- height: number | string;
121
- loadingText: string;
122
- maxHeight: number | string;
123
- maxWidth: number | string;
124
- minHeight: number | string;
125
- minWidth: number | string;
126
- noDataSlot: IComponentRender[];
127
- noDataText: string;
128
- noResultSlot: IComponentRender[];
129
- noResultsText: string;
130
- resizeColumns: boolean;
131
- rowStyleConditions?: (row: IDictionary) => IDictionary;
132
- selectable: boolean;
133
- selectAllPages: boolean;
134
- selectedRows: IDictionary[];
135
- selectionState: {
136
- allSelected: boolean;
137
- except: IDictionary<any>[];
138
- };
139
- showFooter: boolean;
140
- showHeader: boolean;
141
- showSelectAll: boolean;
142
- toolbarSlot: IComponentRender[];
143
- width: number | string;
144
- getConditionalProps({ row, column }: {
145
- row: IDictionary;
146
- column: T;
147
- }): Partial<IComponentRender>;
148
- }
@@ -1,28 +0,0 @@
1
- import { IDictionary } from '@zeedhi/core';
2
- import { GridColumn } from './grid-column';
3
- import { IGrid, IIterableTable } from './interfaces';
4
- export declare class IterableTable implements IIterableTable {
5
- protected iterable: IGrid;
6
- /**
7
- * Available order types
8
- * @public
9
- */
10
- orderTypes: {
11
- asc: 'asc';
12
- desc: 'desc';
13
- };
14
- constructor(iterable: IGrid);
15
- /**
16
- * Changes column order
17
- * @async
18
- */
19
- changeOrder(sortBy: {
20
- key: string;
21
- order: 'asc' | 'desc';
22
- }[]): Promise<void>;
23
- selectCell(row: IDictionary, column: GridColumn): void;
24
- protected rowStyleConditions: Map<any, any>;
25
- reapplyRowStyleConditions(row: IDictionary<any>): IDictionary<any>;
26
- getRowStyleConditions(row: IDictionary): IDictionary;
27
- deleteRows(): Promise<any[]>;
28
- }
@@ -1,26 +0,0 @@
1
- import { Component } from '../zd-component/component';
2
- import { IKeyMapConfig, IKeyMapMerger } from './interfaces';
3
- type ClassType<T> = {
4
- new (): T;
5
- };
6
- type ConfigClassType = ClassType<IKeyMapConfig<Component>>;
7
- /**
8
- * This class' purpose is to allow merging multiple keyMap configurations
9
- * into the same component instance and element
10
- *
11
- * Also allows users to overwrite the default keyMap by defining their own
12
- * keymaps via component props
13
- */
14
- export declare class KeyMapMerger implements IKeyMapMerger {
15
- private instance;
16
- private configs;
17
- private map;
18
- constructor(instance: Component, configs: ConfigClassType[]);
19
- /**
20
- * Filters keyMap to allow user to overwrite the default keyMapping
21
- */
22
- private filterKeyMapping;
23
- bind(element: HTMLElement): void;
24
- unbind(): void;
25
- }
26
- export {};
@@ -1,6 +0,0 @@
1
- import { IKeyMap } from '@zeedhi/core';
2
- import { Component } from '../zd-component/component';
3
- import { IDataNavigator, IKeyMapConfig, IViewNavigator } from './interfaces';
4
- export declare class KeyMapNavigation implements IKeyMapConfig<IViewNavigator & IDataNavigator> {
5
- getMap(instance: Component & IViewNavigator & IDataNavigator): IKeyMap;
6
- }
@@ -1,19 +0,0 @@
1
- import { IDictionary } from '@zeedhi/core';
2
- import { Component } from '../zd-component/component';
3
- import { IComponent } from '../zd-component/interfaces';
4
- import { Iterable } from '../zd-iterable/iterable';
5
- import { GridColumn } from './grid-column';
6
- import { ITableActionBuilder } from './interfaces';
7
- export declare class TableActionBuilder implements ITableActionBuilder {
8
- protected iterable: Iterable;
9
- constructor(iterable: Iterable);
10
- getActionComponent(actionComponent: IComponent, column: GridColumn, row: IDictionary, parentPath?: string): IComponent;
11
- private setGridRowsInEvents;
12
- private filterObject;
13
- private deleteAccessorProps;
14
- protected updateActionInstance(instanceName: string, newComponent: IComponent): Component<IComponent>;
15
- protected getActionProps(actionComponent: IComponent, column: GridColumn, row: IDictionary, parentPath: string): {
16
- props: IComponent;
17
- instance: Component<IComponent> | null;
18
- };
19
- }
@@ -1,10 +0,0 @@
1
- import { IEventParam } from '@zeedhi/core';
2
- import { Direction, IViewNavigator } from './interfaces';
3
- export declare class ViewNavigator implements IViewNavigator {
4
- protected viewNavigate: ((direction: Direction, event?: Event) => void) | null;
5
- setViewNavigate(viewNavigate: (direction: Direction, event?: Event) => void): void;
6
- navigateLeft({ event }: IEventParam<any>): void;
7
- navigateRight({ event }: IEventParam<any>): void;
8
- navigateUp(): void;
9
- navigateDown(): void;
10
- }
@@ -1,35 +0,0 @@
1
- import { IDictionary } from '@zeedhi/core';
2
- import { Input } from '../zd-input/input';
3
- import { DataEditor } from './data-editor';
4
- import { IDataEditorWithAdd, IGridColumnEditable, IGridEditable } from './interfaces';
5
- export declare class DataEditorWithAdd extends DataEditor implements IDataEditorWithAdd {
6
- private NEW_ROW_IDENTIFIER;
7
- /**
8
- * Rows with newRowIdentifier
9
- * @private
10
- */
11
- private addedRows;
12
- constructor(grid: IGridEditable);
13
- addCancelColumn(): void;
14
- getCancelColumnProps(): IGridColumnEditable;
15
- createGridController(): void;
16
- isAdded(row: IDictionary): boolean;
17
- cancelAddedRow(key: string | number): Promise<any>;
18
- cancelAddedRows(): Promise<void>;
19
- getAddedRows(): IDictionary<any>[];
20
- addNewRow(row: IDictionary, position?: 'end' | 'start'): Promise<void>;
21
- changeEditableComponent(column: IGridColumnEditable, row: IDictionary<any>, value: any, component?: Input): void;
22
- private addDataRow;
23
- /**
24
- * Saves all edited rows if they are valid
25
- * @param revalidate Defines if the fields should be revalidated
26
- * @throws Will throw when it finds an invalid row
27
- */
28
- saveEditedRows(revalidate?: boolean): Promise<void[]>;
29
- /**
30
- * Cancels all edited rows and enable grid components
31
- */
32
- cancelEditedRows(): Promise<void>;
33
- protected omitInternals(editedRow: IDictionary): any;
34
- reapplyCanEditRow(row: IDictionary<any>): void;
35
- }
@@ -1,64 +0,0 @@
1
- import { IDictionary } from '@zeedhi/core';
2
- import { IComponentRender } from '../zd-component/interfaces';
3
- import { Input } from '../zd-input/input';
4
- import { GridColumnEditable } from './grid-column-editable';
5
- import { IDataEditor, IGridColumnEditable, IGridEditable } from './interfaces';
6
- export declare class DataEditor implements IDataEditor {
7
- protected grid: IGridEditable;
8
- protected editedRows: Map<string | number, IDictionary>;
9
- /**
10
- * Invalid inline components
11
- * @private
12
- */
13
- protected invalidComponents: Set<string>;
14
- private viewEnterEdit;
15
- constructor(grid: IGridEditable);
16
- /**
17
- * Gets the editable component name
18
- * @param key Row unique key
19
- * @param columnName Column name
20
- */
21
- private getCompName;
22
- getVisibleValue(row: IDictionary, column: IGridColumnEditable): any;
23
- /**
24
- * Pushes lookup values into the column's datasource
25
- * If the row[column.name] has a selected value, pushes it
26
- */
27
- private checkLookupData;
28
- private pushLookupValue;
29
- private checkCompValidity;
30
- private updateOriginalRow;
31
- getEditableComponent(column: GridColumnEditable, row: IDictionary<any>): IComponentRender;
32
- protected changeEditableComponent(column: IGridColumnEditable, row: IDictionary<any>, value: any, component?: Input): void;
33
- isEdited(column: IGridColumnEditable, row: IDictionary): boolean;
34
- isValid(column: IGridColumnEditable, row: IDictionary, revalidate?: boolean): Promise<boolean>;
35
- checkValid(column: IGridColumnEditable, row: IDictionary): boolean;
36
- /**
37
- * Checks whether the grid is valid while not in editing mode
38
- */
39
- private isViewGridValid;
40
- isGridValid(revalidate?: boolean): boolean;
41
- getComponent<T>(key: string | number, columnName: string): T;
42
- /**
43
- * Changes a cell value in editedRows
44
- * @param rowKey Cell's row key
45
- * @param rowIdx Cell's row index in datasource.data
46
- * @param column Cell's column
47
- * @param value Value to be set in the cell
48
- */
49
- private changeCell;
50
- private getRowIndex;
51
- updateRow(newRow: IDictionary): void;
52
- updateCell(rowKey: string, columnName: string, value: any): void;
53
- changeData(data?: IDictionary<any>[]): void;
54
- setViewEnterEdit(fn: ((rowKey: string, columnName: string) => void) | null): void;
55
- enterEdit(rowKey: string, columnName: string): void;
56
- cancelEditedRows(): Promise<void>;
57
- saveEditedRows(revalidate?: boolean): Promise<void[]>;
58
- protected canEditRowConditions: Map<string | number, boolean | undefined>;
59
- reapplyCanEditRow(row: IDictionary<any>): void;
60
- getCanEditRow(row: IDictionary<any>): boolean | undefined;
61
- protected omitInternals(editedRow: IDictionary): any;
62
- getEditedRows(revalidate?: boolean, silent?: boolean): IDictionary<any>[];
63
- getEditedRow(row: IDictionary): IDictionary | undefined;
64
- }
@@ -1,2 +0,0 @@
1
- export * from './not-editing';
2
- export * from './row-not-found';
@@ -1,6 +0,0 @@
1
- /**
2
- * Grid not editing error
3
- */
4
- export declare class NotEditingError extends Error {
5
- constructor(method: string);
6
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Row not found error
3
- */
4
- export declare class RowNotFoundError extends Error {
5
- constructor(key: string | number, gridName: string);
6
- }
@@ -1,9 +0,0 @@
1
- import { GridColumn } from '../zd-grid';
2
- import { IGridColumnEditable } from './interfaces';
3
- /**
4
- * Base class for Grid column
5
- */
6
- export declare class GridColumnEditable extends GridColumn implements IGridColumnEditable {
7
- editable: boolean;
8
- constructor(props: IGridColumnEditable);
9
- }
@@ -1,8 +0,0 @@
1
- import { IDictionary } from '@zeedhi/core';
2
- import { GridEditable } from './grid-editable';
3
- export declare class GridEditableController {
4
- private grid;
5
- constructor(grid: GridEditable);
6
- get hasAddedRows(): boolean;
7
- isAddedRow({ row }: IDictionary): boolean;
8
- }
@@ -1,32 +0,0 @@
1
- import { IDictionary } from '@zeedhi/core';
2
- import { GridColumnEditable } from './grid-column-editable';
3
- import { IGridEditable, IGridEditableEvents } from './interfaces';
4
- export declare class GridEditableEvents implements IGridEditableEvents {
5
- protected gridEditable: IGridEditable;
6
- /**
7
- * Flag to prevent row click
8
- */
9
- protected preventRowClick: boolean;
10
- protected preventRowDoubleClick: boolean;
11
- constructor(gridEditable: IGridEditable);
12
- /**
13
- * Dispatches row click event
14
- * @param row Grid row
15
- * @param event DOM event
16
- * @param element DOM Element
17
- */
18
- rowClick(row: IDictionary<any>, event: Event, element: HTMLElement): void;
19
- rowDoubleClick(row: IDictionary<any>, event: Event, element: HTMLElement): void;
20
- /**
21
- * Dispatches cell click Event
22
- * @param row Grid row
23
- * @param column Grid column
24
- * @param event DOM event
25
- * @param element DOM Element
26
- */
27
- cellClick(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: HTMLElement): void;
28
- cellDoubleClick(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: HTMLElement): void;
29
- inlineEdit(row: IDictionary, column: GridColumnEditable, event?: Event, element?: HTMLElement): void;
30
- cellClickEvent(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: HTMLElement): void;
31
- cellDoubleClickEvent(row: IDictionary<any>, column: GridColumnEditable, event: Event, element: HTMLElement): void;
32
- }
@@ -1,124 +0,0 @@
1
- import { IDictionary, IEventParam } from '@zeedhi/core';
2
- import { IComponent, IComponentRender } from '../zd-component/interfaces';
3
- import { Direction, GridColumn, IGrid, VerticalDirection } from '../zd-grid';
4
- import { Iterable } from '../zd-iterable/iterable';
5
- import { GridColumnEditable } from './grid-column-editable';
6
- import { IGridColumnEditable, IGridEditable, IGridEditableProps } from './interfaces';
7
- export declare class GridEditable extends Iterable<GridColumnEditable> implements IGridEditable {
8
- private tableActionBuilder;
9
- private iterableTable;
10
- private dataSelector;
11
- private gridEditableEvents;
12
- private dataNavigator;
13
- private viewNavigator;
14
- private keyMapMerger;
15
- private dataEditor;
16
- editing: boolean;
17
- currentColumn: GridColumnEditable | null;
18
- selectedRows: IDictionary<any>[];
19
- selectionState: {
20
- allSelected: boolean;
21
- except: IDictionary<any>[];
22
- };
23
- rowStyleConditions?: (row: IDictionary) => IDictionary;
24
- selectAllPages: boolean;
25
- selectable: boolean;
26
- disableSelection?: (args: {
27
- row: IDictionary<any>;
28
- component: IGrid;
29
- }) => boolean;
30
- cellSelection: boolean;
31
- toolbarSlot: IComponentRender[];
32
- footerSlot: IComponentRender[];
33
- noResultsText: string;
34
- noResultSlot: IComponentRender[];
35
- errorSlot: IComponentRender[];
36
- dense: boolean;
37
- dragColumns: boolean;
38
- headerBackground: string;
39
- headerCellTextColor: string;
40
- height: string | number;
41
- loadingText: string;
42
- maxHeight: string | number;
43
- maxWidth: string | number;
44
- minHeight: string | number;
45
- minWidth: string | number;
46
- noDataText: string;
47
- noDataSlot: IComponentRender[];
48
- resizeColumns: boolean;
49
- showFooter: boolean;
50
- showHeader: boolean;
51
- showSelectAll: boolean;
52
- width: string | number;
53
- backgroundColor: string;
54
- canEditRow?: ((args: {
55
- row: IDictionary<any>;
56
- component: IGridEditable;
57
- }) => boolean) | undefined;
58
- showCancelColumn: boolean;
59
- doubleClickEdit: boolean;
60
- singleEdit: boolean;
61
- editingNewRows: boolean;
62
- constructor(props: IGridEditableProps);
63
- getConditionalProps({ row, column }: {
64
- row: IDictionary;
65
- column: GridColumn;
66
- }): Partial<IComponentRender>;
67
- addCancelColumn(): void;
68
- getCancelColumnProps(): IGridColumnEditable;
69
- isAdded(row: IDictionary): boolean;
70
- cancelAddedRow(key: string | number): Promise<any>;
71
- cancelAddedRows(): Promise<void>;
72
- getAddedRows(): IDictionary<any>[];
73
- addNewRow(row: IDictionary, position?: 'end' | 'start'): Promise<void>;
74
- setViewEnterEdit(fn: ((rowKey: string, columnName: string) => void) | null): void;
75
- getVisibleValue(row: IDictionary, column: IGridColumnEditable): any;
76
- getEditableComponent(column: IGridColumnEditable, row: IDictionary<any>): IComponentRender;
77
- isEdited(column: IGridColumnEditable, row: IDictionary): boolean;
78
- isValid(column: IGridColumnEditable, row: IDictionary, revalidate?: boolean): Promise<boolean>;
79
- checkValid(column: IGridColumnEditable, row: IDictionary): boolean;
80
- isGridValid(revalidate?: boolean): boolean;
81
- getComponent<T>(key: string, columnName: string): T;
82
- updateRow(newRow: IDictionary): void;
83
- updateCell(rowKey: string, columnName: string, value: any): void;
84
- changeData(data?: IDictionary<any>[]): void;
85
- enterEdit(rowKey: string, columnName: string): void;
86
- cancelEditedRows(): Promise<void>;
87
- saveEditedRows(revalidate?: boolean): Promise<void[]>;
88
- reapplyCanEditRow(row: IDictionary<any>): void;
89
- getCanEditRow(row: IDictionary<any>): boolean | undefined;
90
- getEditedRows(revalidate?: boolean, silent?: boolean): IDictionary<any>[];
91
- cellDoubleClick(row: IDictionary<any>, column: GridColumnEditable, event: Event, element?: HTMLElement): void;
92
- inlineEdit(row: IDictionary, column: GridColumnEditable, event?: Event, element?: HTMLElement): void;
93
- onMounted(element: HTMLElement): void;
94
- onBeforeDestroy(): void;
95
- navigatePageUp(): void;
96
- navigatePageDown(): void;
97
- setViewNavigate(viewNavigate: (direction: Direction, event?: Event) => void): void;
98
- navigateLeft(params: IEventParam<any>): void;
99
- navigateRight(params: IEventParam<any>): void;
100
- navigateUp(): void;
101
- navigateDown(): void;
102
- navigateDatasource(direction: VerticalDirection): void;
103
- createColumn(column: IGridColumnEditable): GridColumnEditable;
104
- rowClick(row: IDictionary<any>, event: Event, element?: HTMLElement): void;
105
- rowDoubleClick(row: IDictionary<any>, event: Event, element?: HTMLElement): void;
106
- cellClick(row: IDictionary<any>, column: GridColumnEditable, event: Event, element?: HTMLElement): void;
107
- cellClickEvent(row: IDictionary<any>, column: GridColumnEditable, event: Event, element?: HTMLElement): void;
108
- selectClick(row: IDictionary<any>, isSelected: boolean, event: Event, element?: HTMLElement): void;
109
- selectAllClick(isSelected: boolean, event: Event, element?: HTMLElement): void;
110
- selectAll(isSelected: boolean): void;
111
- toggleRow(row: IDictionary): void;
112
- selectRow(row: IDictionary, select: boolean): void;
113
- callDisableSelection(row: IDictionary): boolean;
114
- changeOrder(sortBy: {
115
- key: string;
116
- order: 'asc' | 'desc';
117
- }[]): Promise<void>;
118
- selectCell(row: IDictionary, column: GridColumnEditable): void;
119
- reapplyRowStyleConditions(row: IDictionary): IDictionary;
120
- getRowStyleConditions(row: IDictionary): IDictionary;
121
- deleteRows(): Promise<any[]>;
122
- getActionComponent(actionComponent: IComponent, column: GridColumnEditable, row: IDictionary, parentPath?: string): IComponent;
123
- getEditedRow(row: IDictionary): IDictionary | undefined;
124
- }
@@ -1,8 +0,0 @@
1
- export * from './data-editor-with-add';
2
- export * from './data-editor';
3
- export * from './grid-column-editable';
4
- export * from './grid-editable-controller';
5
- export * from './grid-editable-events';
6
- export * from './grid-editable';
7
- export * from './interfaces';
8
- export * from './keymap-editing';
@@ -1,66 +0,0 @@
1
- import { IDictionary } from '@zeedhi/core';
2
- import { IComponentRender } from '../zd-component/interfaces';
3
- import { GridColumn, IGrid, IGridColumn, IGridProps } from '../zd-grid';
4
- import { GridColumnEditable } from './grid-column-editable';
5
- import { GridEditable } from './grid-editable';
6
- export interface IGridEditableProps extends IGridProps {
7
- columns?: IGridColumnEditable[];
8
- canEditRow?: (args: {
9
- row: IDictionary<any>;
10
- component: GridEditable;
11
- }) => boolean;
12
- showCancelColumn?: boolean;
13
- doubleClickEdit?: boolean;
14
- singleEdit?: boolean;
15
- }
16
- export interface IGridEditable<T = GridColumnEditable> extends IGrid<T>, IDataEditorWithAdd, IGridEditableEvents {
17
- editing: boolean;
18
- canEditRow?: (args: {
19
- row: IDictionary<any>;
20
- component: IGridEditable;
21
- }) => boolean;
22
- showCancelColumn: boolean;
23
- doubleClickEdit: boolean;
24
- singleEdit: boolean;
25
- editingNewRows: boolean;
26
- }
27
- export interface IGridEditableEvents {
28
- rowClick(row: IDictionary<any>, event: Event, element?: HTMLElement): void;
29
- rowDoubleClick(row: IDictionary<any>, event: Event, element?: HTMLElement): void;
30
- cellDoubleClick(row: IDictionary<any>, column: GridColumnEditable, event: Event, element?: HTMLElement): void;
31
- inlineEdit(row: IDictionary, column: GridColumnEditable, event?: Event, element?: HTMLElement): void;
32
- cellClick(row: IDictionary<any>, column: GridColumn, event: Event, element?: HTMLElement): void;
33
- cellClickEvent(row: IDictionary<any>, column: GridColumnEditable, event: Event, element?: HTMLElement): void;
34
- }
35
- export interface IGridColumnEditable extends IGridColumn {
36
- editable?: boolean;
37
- }
38
- export interface IDataEditor {
39
- getVisibleValue(row: IDictionary, column: IGridColumnEditable): any;
40
- getEditableComponent(column: IGridColumnEditable, row: IDictionary<any>): IComponentRender;
41
- isEdited(column: IGridColumnEditable, row: IDictionary): boolean;
42
- isValid(column: IGridColumnEditable, row: IDictionary, revalidate?: boolean): Promise<boolean>;
43
- checkValid(column: IGridColumnEditable, row: IDictionary): boolean;
44
- isGridValid(revalidate?: boolean): boolean;
45
- getComponent<T>(key: string, columnName: string): T;
46
- updateRow(newRow: IDictionary): void;
47
- updateCell(rowKey: string, columnName: string, value: any): void;
48
- changeData(data?: IDictionary<any>[]): void;
49
- setViewEnterEdit(fn: ((rowKey: string, columnName: string) => void) | null): void;
50
- enterEdit(rowKey: string, columnName: string): void;
51
- cancelEditedRows(): Promise<void>;
52
- saveEditedRows(revalidate?: boolean): Promise<void[]>;
53
- reapplyCanEditRow(row: IDictionary<any>): void;
54
- getCanEditRow(row: IDictionary<any>): boolean | undefined;
55
- getEditedRows(revalidate?: boolean, silent?: boolean): IDictionary<any>[];
56
- getEditedRow(row: IDictionary): IDictionary | undefined;
57
- }
58
- export interface IDataEditorWithAdd extends IDataEditor {
59
- addCancelColumn(): void;
60
- getCancelColumnProps(): IGridColumnEditable;
61
- isAdded(row: IDictionary): boolean;
62
- cancelAddedRow(key: string | number): Promise<any>;
63
- cancelAddedRows(): Promise<void>;
64
- getAddedRows(): IDictionary<any>[];
65
- addNewRow(row: IDictionary, position?: 'end' | 'start'): Promise<void>;
66
- }
@@ -1,7 +0,0 @@
1
- import { IKeyMap } from '@zeedhi/core';
2
- import { Component } from '../zd-component/component';
3
- import { IKeyMapConfig } from '../zd-grid/interfaces';
4
- import { IDataEditor } from './interfaces';
5
- export declare class KeyMapEditing implements IKeyMapConfig<IDataEditor> {
6
- getMap(instance: Component & IDataEditor): IKeyMap;
7
- }