@zeedhi/common 1.127.0 → 1.129.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 (215) hide show
  1. package/dist/types/components/index.d.ts +151 -0
  2. package/dist/types/components/zd-alert/alert.d.ts +94 -0
  3. package/dist/types/components/zd-alert/interfaces.d.ts +18 -0
  4. package/dist/types/components/zd-badge/badge.d.ts +28 -0
  5. package/dist/types/components/zd-badge/interfaces.d.ts +10 -0
  6. package/dist/types/components/zd-breadcrumbs/breadcrumbs.d.ts +32 -0
  7. package/dist/types/components/zd-breadcrumbs/interfaces.d.ts +24 -0
  8. package/dist/types/components/zd-button/button.d.ts +89 -0
  9. package/dist/types/components/zd-button/interfaces.d.ts +48 -0
  10. package/dist/types/components/zd-button-group/button-group.d.ts +67 -0
  11. package/dist/types/components/zd-button-group/interfaces.d.ts +25 -0
  12. package/dist/types/components/zd-card/card.d.ts +152 -0
  13. package/dist/types/components/zd-card/interfaces.d.ts +40 -0
  14. package/dist/types/components/zd-carousel/carousel.d.ts +163 -0
  15. package/dist/types/components/zd-carousel/interfaces.d.ts +49 -0
  16. package/dist/types/components/zd-checkbox/checkbox.d.ts +12 -0
  17. package/dist/types/components/zd-checkbox/interfaces.d.ts +5 -0
  18. package/dist/types/components/zd-checkbox-multiple/checkbox-multiple.d.ts +39 -0
  19. package/dist/types/components/zd-checkbox-multiple/interfaces.d.ts +13 -0
  20. package/dist/types/components/zd-chip/chip.d.ts +60 -0
  21. package/dist/types/components/zd-chip/interfaces.d.ts +18 -0
  22. package/dist/types/components/zd-code-viewer/code-viewer.d.ts +86 -0
  23. package/dist/types/components/zd-code-viewer/interfaces.d.ts +13 -0
  24. package/dist/types/components/zd-col/col.d.ts +33 -0
  25. package/dist/types/components/zd-col/interfaces.d.ts +15 -0
  26. package/dist/types/components/zd-collapse-card/collapse-card.d.ts +56 -0
  27. package/dist/types/components/zd-collapse-card/interfaces.d.ts +14 -0
  28. package/dist/types/components/zd-component/child-not-found.d.ts +6 -0
  29. package/dist/types/components/zd-component/component-render.d.ts +16 -0
  30. package/dist/types/components/zd-component/component.d.ts +120 -0
  31. package/dist/types/components/zd-component/interfaces.d.ts +74 -0
  32. package/dist/types/components/zd-container/container.d.ts +45 -0
  33. package/dist/types/components/zd-container/interfaces.d.ts +12 -0
  34. package/dist/types/components/zd-currency/currency.d.ts +12 -0
  35. package/dist/types/components/zd-currency/interfaces.d.ts +6 -0
  36. package/dist/types/components/zd-date-input/date-input.d.ts +152 -0
  37. package/dist/types/components/zd-date-input/interfaces.d.ts +27 -0
  38. package/dist/types/components/zd-date-range/date-range.d.ts +158 -0
  39. package/dist/types/components/zd-date-range/interfaces.d.ts +18 -0
  40. package/dist/types/components/zd-dialog/dialog.d.ts +76 -0
  41. package/dist/types/components/zd-dialog/interfaces.d.ts +13 -0
  42. package/dist/types/components/zd-divider/divider.d.ts +20 -0
  43. package/dist/types/components/zd-divider/interfaces.d.ts +8 -0
  44. package/dist/types/components/zd-dropdown/dropdown.d.ts +81 -0
  45. package/dist/types/components/zd-dropdown/interfaces.d.ts +23 -0
  46. package/dist/types/components/zd-footer/footer.d.ts +80 -0
  47. package/dist/types/components/zd-footer/interfaces.d.ts +26 -0
  48. package/dist/types/components/zd-form/form.d.ts +174 -0
  49. package/dist/types/components/zd-form/interfaces.d.ts +36 -0
  50. package/dist/types/components/zd-frame/frame.d.ts +81 -0
  51. package/dist/types/components/zd-frame/interfaces.d.ts +23 -0
  52. package/dist/types/components/zd-frame-page/frame-page.d.ts +14 -0
  53. package/dist/types/components/zd-frame-page/interfaces.d.ts +4 -0
  54. package/dist/types/components/zd-grid/data-navigator.d.ts +12 -0
  55. package/dist/types/components/zd-grid/data-selector.d.ts +25 -0
  56. package/dist/types/components/zd-grid/grid-column.d.ts +47 -0
  57. package/dist/types/components/zd-grid/grid-events.d.ts +26 -0
  58. package/dist/types/components/zd-grid/grid.d.ts +85 -0
  59. package/dist/types/components/zd-grid/index.d.ts +11 -0
  60. package/dist/types/components/zd-grid/interfaces.d.ts +148 -0
  61. package/dist/types/components/zd-grid/iterable-table.d.ts +28 -0
  62. package/dist/types/components/zd-grid/keymap-merger.d.ts +26 -0
  63. package/dist/types/components/zd-grid/keymap-navigation.d.ts +6 -0
  64. package/dist/types/components/zd-grid/table-action-builder.d.ts +19 -0
  65. package/dist/types/components/zd-grid/view-navigator.d.ts +10 -0
  66. package/dist/types/components/zd-grid-editable/data-editor-with-add.d.ts +35 -0
  67. package/dist/types/components/zd-grid-editable/data-editor.d.ts +64 -0
  68. package/dist/types/components/zd-grid-editable/errors/index.d.ts +2 -0
  69. package/dist/types/components/zd-grid-editable/errors/not-editing.d.ts +6 -0
  70. package/dist/types/components/zd-grid-editable/errors/row-not-found.d.ts +6 -0
  71. package/dist/types/components/zd-grid-editable/grid-column-editable.d.ts +9 -0
  72. package/dist/types/components/zd-grid-editable/grid-editable-controller.d.ts +8 -0
  73. package/dist/types/components/zd-grid-editable/grid-editable-events.d.ts +32 -0
  74. package/dist/types/components/zd-grid-editable/grid-editable.d.ts +124 -0
  75. package/dist/types/components/zd-grid-editable/index.d.ts +8 -0
  76. package/dist/types/components/zd-grid-editable/interfaces.d.ts +66 -0
  77. package/dist/types/components/zd-grid-editable/keymap-editing.d.ts +7 -0
  78. package/dist/types/components/zd-header/header.d.ts +94 -0
  79. package/dist/types/components/zd-header/interfaces.d.ts +29 -0
  80. package/dist/types/components/zd-icon/icon.d.ts +55 -0
  81. package/dist/types/components/zd-icon/interfaces.d.ts +13 -0
  82. package/dist/types/components/zd-image/image.d.ts +73 -0
  83. package/dist/types/components/zd-image/interfaces.d.ts +17 -0
  84. package/dist/types/components/zd-increment/increment.d.ts +56 -0
  85. package/dist/types/components/zd-increment/interfaces.d.ts +9 -0
  86. package/dist/types/components/zd-input/input-factory.d.ts +6 -0
  87. package/dist/types/components/zd-input/input.d.ts +223 -0
  88. package/dist/types/components/zd-input/interfaces.d.ts +38 -0
  89. package/dist/types/components/zd-iterable/column-not-found.d.ts +6 -0
  90. package/dist/types/components/zd-iterable/column.d.ts +78 -0
  91. package/dist/types/components/zd-iterable/conditions-manager.d.ts +49 -0
  92. package/dist/types/components/zd-iterable/interfaces.d.ts +103 -0
  93. package/dist/types/components/zd-iterable/iterable-columns-button-controller.d.ts +9 -0
  94. package/dist/types/components/zd-iterable/iterable-columns-button.d.ts +35 -0
  95. package/dist/types/components/zd-iterable/iterable-controller.d.ts +8 -0
  96. package/dist/types/components/zd-iterable/iterable-page-component.d.ts +27 -0
  97. package/dist/types/components/zd-iterable/iterable-page-info.d.ts +7 -0
  98. package/dist/types/components/zd-iterable/iterable-page-size.d.ts +62 -0
  99. package/dist/types/components/zd-iterable/iterable-pagination.d.ts +28 -0
  100. package/dist/types/components/zd-iterable/iterable.d.ts +77 -0
  101. package/dist/types/components/zd-iterable/search.d.ts +31 -0
  102. package/dist/types/components/zd-iterable-component-render/interfaces.d.ts +34 -0
  103. package/dist/types/components/zd-iterable-component-render/iterable-component-render.d.ts +84 -0
  104. package/dist/types/components/zd-layout/interfaces.d.ts +7 -0
  105. package/dist/types/components/zd-layout/layout.d.ts +9 -0
  106. package/dist/types/components/zd-list/interfaces.d.ts +44 -0
  107. package/dist/types/components/zd-list/item-not-found.d.ts +6 -0
  108. package/dist/types/components/zd-list/list-group.d.ts +30 -0
  109. package/dist/types/components/zd-list/list-item.d.ts +46 -0
  110. package/dist/types/components/zd-list/list.d.ts +81 -0
  111. package/dist/types/components/zd-loading/interfaces.d.ts +7 -0
  112. package/dist/types/components/zd-loading/loading.d.ts +21 -0
  113. package/dist/types/components/zd-login/interfaces.d.ts +25 -0
  114. package/dist/types/components/zd-login/login-button.d.ts +50 -0
  115. package/dist/types/components/zd-login/login.d.ts +54 -0
  116. package/dist/types/components/zd-main/interfaces.d.ts +5 -0
  117. package/dist/types/components/zd-main/main.d.ts +7 -0
  118. package/dist/types/components/zd-master-detail/detail-not-found.d.ts +7 -0
  119. package/dist/types/components/zd-master-detail/interfaces.d.ts +10 -0
  120. package/dist/types/components/zd-master-detail/master-detail.d.ts +18 -0
  121. package/dist/types/components/zd-master-detail/master-not-found.d.ts +7 -0
  122. package/dist/types/components/zd-menu/interfaces.d.ts +68 -0
  123. package/dist/types/components/zd-menu/menu-button.d.ts +29 -0
  124. package/dist/types/components/zd-menu/menu-group.d.ts +61 -0
  125. package/dist/types/components/zd-menu/menu-link.d.ts +50 -0
  126. package/dist/types/components/zd-menu/menu-separator.d.ts +7 -0
  127. package/dist/types/components/zd-menu/menu.d.ts +199 -0
  128. package/dist/types/components/zd-modal/interfaces.d.ts +35 -0
  129. package/dist/types/components/zd-modal/modal-close-button.d.ts +28 -0
  130. package/dist/types/components/zd-modal/modal.d.ts +53 -0
  131. package/dist/types/components/zd-month/interfaces.d.ts +6 -0
  132. package/dist/types/components/zd-month/month.d.ts +33 -0
  133. package/dist/types/components/zd-number-input/interfaces.d.ts +8 -0
  134. package/dist/types/components/zd-number-input/number-input.d.ts +43 -0
  135. package/dist/types/components/zd-password/interfaces.d.ts +6 -0
  136. package/dist/types/components/zd-password/password.d.ts +17 -0
  137. package/dist/types/components/zd-progress/interfaces.d.ts +10 -0
  138. package/dist/types/components/zd-progress/progress.d.ts +41 -0
  139. package/dist/types/components/zd-radio/interfaces.d.ts +11 -0
  140. package/dist/types/components/zd-radio/radio.d.ts +35 -0
  141. package/dist/types/components/zd-row/interfaces.d.ts +13 -0
  142. package/dist/types/components/zd-row/row.d.ts +39 -0
  143. package/dist/types/components/zd-select/interfaces.d.ts +24 -0
  144. package/dist/types/components/zd-select/select.d.ts +238 -0
  145. package/dist/types/components/zd-select-multiple/interfaces.d.ts +18 -0
  146. package/dist/types/components/zd-select-multiple/select-multiple.d.ts +113 -0
  147. package/dist/types/components/zd-svg-map/interfaces.d.ts +26 -0
  148. package/dist/types/components/zd-svg-map/svg-map.d.ts +35 -0
  149. package/dist/types/components/zd-switch/interfaces.d.ts +7 -0
  150. package/dist/types/components/zd-switch/switch.d.ts +16 -0
  151. package/dist/types/components/zd-table/interfaces.d.ts +25 -0
  152. package/dist/types/components/zd-table/table.d.ts +42 -0
  153. package/dist/types/components/zd-tabs/interfaces.d.ts +40 -0
  154. package/dist/types/components/zd-tabs/tab-not-found.d.ts +11 -0
  155. package/dist/types/components/zd-tabs/tab.d.ts +57 -0
  156. package/dist/types/components/zd-tabs/tabs.d.ts +86 -0
  157. package/dist/types/components/zd-tag/interfaces.d.ts +7 -0
  158. package/dist/types/components/zd-tag/tag.d.ts +13 -0
  159. package/dist/types/components/zd-text/interfaces.d.ts +9 -0
  160. package/dist/types/components/zd-text/text.d.ts +8 -0
  161. package/dist/types/components/zd-text-input/interfaces.d.ts +23 -0
  162. package/dist/types/components/zd-text-input/text-input.d.ts +91 -0
  163. package/dist/types/components/zd-textarea/interfaces.d.ts +21 -0
  164. package/dist/types/components/zd-textarea/textarea.d.ts +71 -0
  165. package/dist/types/components/zd-time/interfaces.d.ts +22 -0
  166. package/dist/types/components/zd-time/time-format-selector.d.ts +8 -0
  167. package/dist/types/components/zd-time/time.d.ts +149 -0
  168. package/dist/types/components/zd-toggleable/interfaces.d.ts +6 -0
  169. package/dist/types/components/zd-toggleable/toggleable.d.ts +21 -0
  170. package/dist/types/components/zd-tooltip/interfaces.d.ts +18 -0
  171. package/dist/types/components/zd-tooltip/tooltip.d.ts +57 -0
  172. package/dist/types/components/zd-tree/interfaces.d.ts +107 -0
  173. package/dist/types/components/zd-tree/tree.d.ts +161 -0
  174. package/dist/types/components/zd-tree-grid/index.d.ts +6 -0
  175. package/dist/types/components/zd-tree-grid/interfaces.d.ts +35 -0
  176. package/dist/types/components/zd-tree-grid/iterable-tree.d.ts +10 -0
  177. package/dist/types/components/zd-tree-grid/keymap-tree.d.ts +7 -0
  178. package/dist/types/components/zd-tree-grid/tree-data-navigator.d.ts +10 -0
  179. package/dist/types/components/zd-tree-grid/tree-data-selector.d.ts +18 -0
  180. package/dist/types/components/zd-tree-grid/tree-grid.d.ts +119 -0
  181. package/dist/types/error/delete-rows.d.ts +7 -0
  182. package/dist/types/error/index.d.ts +3 -0
  183. package/dist/types/error/non-initialized.d.ts +7 -0
  184. package/dist/types/error/zeedhi-error.d.ts +6 -0
  185. package/dist/types/index.d.ts +6 -0
  186. package/dist/types/services/index.d.ts +4 -0
  187. package/dist/types/services/zd-alert/alert-queue.d.ts +13 -0
  188. package/dist/types/services/zd-alert/alert-replace.d.ts +18 -0
  189. package/dist/types/services/zd-alert/alert-service.d.ts +45 -0
  190. package/dist/types/services/zd-alert/alert-stack.d.ts +9 -0
  191. package/dist/types/services/zd-alert/index.d.ts +5 -0
  192. package/dist/types/services/zd-alert/interfaces.d.ts +6 -0
  193. package/dist/types/services/zd-dialog/dialog-service.d.ts +24 -0
  194. package/dist/types/services/zd-loading/loading-service.d.ts +17 -0
  195. package/dist/types/services/zd-modal/modal-service.d.ts +39 -0
  196. package/dist/types/utils/data-value-out/data-value-out.d.ts +5 -0
  197. package/dist/types/utils/data-value-out/index.d.ts +2 -0
  198. package/dist/types/utils/data-value-out/interfaces.d.ts +8 -0
  199. package/dist/types/utils/datasource-searcher/datasource-searcher.d.ts +6 -0
  200. package/dist/types/utils/datasource-searcher/index.d.ts +2 -0
  201. package/dist/types/utils/datasource-searcher/interfaces.d.ts +5 -0
  202. package/dist/types/utils/icons/icons.d.ts +24 -0
  203. package/dist/types/utils/index.d.ts +7 -0
  204. package/dist/types/utils/omit/omit.d.ts +11 -0
  205. package/dist/types/utils/theme/theme.d.ts +34 -0
  206. package/dist/types/utils/tree-data-structure/index.d.ts +2 -0
  207. package/dist/types/utils/tree-data-structure/interfaces.d.ts +30 -0
  208. package/dist/types/utils/tree-data-structure/tree-data-structure.d.ts +155 -0
  209. package/dist/types/utils/unique-by/unique-by.d.ts +3 -0
  210. package/dist/zd-common.esm.js +2 -2
  211. package/dist/zd-common.js +13133 -0
  212. package/dist/zd-common.min.js +13133 -0
  213. package/dist/zd-common.umd.js +2 -2
  214. package/package.json +2 -2
  215. package/types/services/zd-json-cache/json-cache-service.d.ts +0 -12
@@ -0,0 +1,56 @@
1
+ import { NumberInput as ZdNumber } from '../zd-number-input/number-input';
2
+ import { IIncrement } from './interfaces';
3
+ /**
4
+ * Base class for Increment component.
5
+ */
6
+ export declare class Increment extends ZdNumber implements IIncrement {
7
+ align: string;
8
+ /**
9
+ * Appends a plus icon inside of the component
10
+ */
11
+ appendIcon: string;
12
+ /**
13
+ * Maximum value of increment
14
+ */
15
+ maxValue?: number;
16
+ /**
17
+ * Minimum value of decrement
18
+ */
19
+ minValue?: number;
20
+ /**
21
+ * Prepends a minus icon inside of the component
22
+ */
23
+ prependIcon: string;
24
+ /**
25
+ * Defines the increment value
26
+ */
27
+ step: number;
28
+ /**
29
+ * Creates a new Increment.
30
+ * @param props Increment properties
31
+ */
32
+ constructor(props: IIncrement & {
33
+ component: string;
34
+ name: string;
35
+ });
36
+ /**
37
+ * Triggered when the prepended icon is clicked.
38
+ * @param event DOM event
39
+ * @param element Increment
40
+ */
41
+ minusClick(event: Event, element: any): void;
42
+ /**
43
+ * Triggered when the appended icon is clicked.
44
+ * @param event DOM event
45
+ * @param element Increment
46
+ */
47
+ plusClick(event: Event, element: any): void;
48
+ /**
49
+ * Method to increment the value
50
+ */
51
+ increment(): void;
52
+ /**
53
+ * Method to decrement the value
54
+ */
55
+ decrement(): void;
56
+ }
@@ -0,0 +1,9 @@
1
+ import { IEventParam } from '@zeedhi/core';
2
+ import { INumberInput } from '../zd-number-input/interfaces';
3
+ import { Increment } from './increment';
4
+ export type IIncrementEvent = IEventParam<Increment>;
5
+ export interface IIncrement extends INumberInput {
6
+ step?: number;
7
+ maxValue?: number;
8
+ minValue?: number;
9
+ }
@@ -0,0 +1,6 @@
1
+ import { IDictionary, INewable } from '@zeedhi/core';
2
+ export declare class InputFactory {
3
+ private static inputClasses;
4
+ static register(className: string, inputClass: INewable<any>): void;
5
+ static factory(props: IDictionary<any>): any;
6
+ }
@@ -0,0 +1,223 @@
1
+ import { IDictionary } from '@zeedhi/core';
2
+ import { ComponentRender } from '../zd-component/component-render';
3
+ import { Form } from '../zd-form/form';
4
+ import { IInput, IInputEvents } from './interfaces';
5
+ import { IFormGrid } from '../zd-form/interfaces';
6
+ /**
7
+ * Base class for Input component.
8
+ */
9
+ export declare class Input extends ComponentRender implements IInput {
10
+ /**
11
+ * Input content alignment.
12
+ */
13
+ align: string;
14
+ /**
15
+ * Always show error messages even if showHelper is false.
16
+ */
17
+ alwaysShowError: boolean;
18
+ /**
19
+ * Input auto complete.
20
+ */
21
+ autofill: boolean;
22
+ /**
23
+ * Add input clear functionality if the input isn't readonly or disabled.
24
+ */
25
+ clearable: boolean;
26
+ /**
27
+ * Applies specified color to the control.
28
+ * It can be the name of material or css color in hex.
29
+ */
30
+ color: string;
31
+ /**
32
+ * Defines smaller input.
33
+ */
34
+ dense: boolean;
35
+ /**
36
+ * Removes the ability to click or target the input.
37
+ */
38
+ disabled: boolean;
39
+ /**
40
+ * Defines input events.
41
+ */
42
+ events: IInputEvents;
43
+ /**
44
+ * Hint text.
45
+ */
46
+ hint: string;
47
+ /**
48
+ * Defines the input label.
49
+ */
50
+ label: string;
51
+ /**
52
+ * Applies a custom character mask to the input.
53
+ */
54
+ mask?: any;
55
+ /**
56
+ * Input max character length.
57
+ */
58
+ maxLength: number;
59
+ /**
60
+ * Forces hint to always be visible.
61
+ */
62
+ persistentHint: boolean;
63
+ /**
64
+ * Sets the input’s placeholder text.
65
+ */
66
+ placeholder: string;
67
+ /**
68
+ * Puts input in readonly state.
69
+ */
70
+ readonly: boolean;
71
+ /**
72
+ * Reverses the input orientation.
73
+ */
74
+ reverse: boolean;
75
+ /**
76
+ * Rules that will validate the input value.
77
+ */
78
+ rules: ((value?: any) => boolean | string)[];
79
+ /**
80
+ * Shows input border.
81
+ */
82
+ showBorder: boolean;
83
+ /**
84
+ * Shows input helper.
85
+ */
86
+ showHelper: boolean;
87
+ /**
88
+ * Shows input label.
89
+ */
90
+ showLabel: boolean;
91
+ /**
92
+ * Show rules details in input.
93
+ */
94
+ autoHintDetails: boolean;
95
+ /**
96
+ * Used to watch a value from store.
97
+ */
98
+ storePath: string;
99
+ /**
100
+ * Input validations.
101
+ */
102
+ validations: IDictionary<IDictionary<string | number>>;
103
+ /**
104
+ * Optional validation method assigned by view layer.
105
+ */
106
+ private viewValidate?;
107
+ /**
108
+ * Reset validation method assigned by view layer.
109
+ */
110
+ private viewResetValidation?;
111
+ /**
112
+ * Parsed field rules.
113
+ */
114
+ protected parsedValidations: IDictionary<(value?: any) => boolean | string>;
115
+ protected formatterFn: (...args: any) => any;
116
+ protected parserFn: (...args: any) => any;
117
+ protected internalDisplayValue: string;
118
+ protected internalValue: any;
119
+ formParent?: Form;
120
+ grid: IFormGrid;
121
+ /**
122
+ * Creates a new Input.
123
+ * @param props Input properties
124
+ */
125
+ constructor(props: IInput);
126
+ onCreated(): void;
127
+ /**
128
+ * Validates input.
129
+ */
130
+ validate(): Promise<string[]>;
131
+ /**
132
+ * Sets view validation method.
133
+ */
134
+ setViewValidate(viewValidate: (silent?: boolean) => Promise<string[]>): void;
135
+ /**
136
+ * Sets view reset validation method.
137
+ */
138
+ setViewResetValidation(viewResetValidation: () => void): void;
139
+ /**
140
+ * Reset all form validation errors.
141
+ * @throws Will throw if viewResetValidation is undefined
142
+ */
143
+ resetValidation(): void;
144
+ /**
145
+ * Adds parsed validations based on field validations.
146
+ * @param validations Field validations
147
+ */
148
+ private parseValidations;
149
+ /**
150
+ * Adds input validation.
151
+ * @param name Validation name
152
+ * @param config Validation config
153
+ */
154
+ addValidation(name: string, config?: IDictionary<any>): void;
155
+ /**
156
+ * Removes input validation.
157
+ * @param name Validation name
158
+ */
159
+ removeValidation(name: string): void;
160
+ /**
161
+ * Removes all input validation.
162
+ */
163
+ clearValidations(): void;
164
+ /**
165
+ * Updates input rules.
166
+ */
167
+ protected updateRules(): void;
168
+ /**
169
+ * Input value.
170
+ */
171
+ get value(): any;
172
+ set value(value: any);
173
+ /**
174
+ * Input displayed value.
175
+ */
176
+ get displayValue(): any;
177
+ set displayValue(value: any);
178
+ /**
179
+ * Retrieves a formatted value.
180
+ * @param value Any value
181
+ * @returns A Formatted value
182
+ */
183
+ formatter(value: any): any;
184
+ /**
185
+ * Retrieves a parsed value.
186
+ * @param value Any value
187
+ * @returns A parsed value
188
+ */
189
+ parser(value: any): any;
190
+ /**
191
+ * Checks the input value are valid to all applied rules.
192
+ * @returns Input is valid
193
+ */
194
+ isValid(value?: any): boolean;
195
+ private lastChangeValue;
196
+ /**
197
+ * Triggered when the input value changes.
198
+ * @param event DOM event
199
+ * @param element Element clicked
200
+ */
201
+ change(event?: Event, element?: any): void;
202
+ protected lastInputValue: any;
203
+ protected callInputEvent: ({ event, element, component }: IDictionary) => void;
204
+ /**
205
+ * Triggered when the data is inputted.
206
+ * @param event DOM event
207
+ * @param element Element focused
208
+ */
209
+ input(event?: Event, element?: any): void;
210
+ /**
211
+ * Triggered when a keyboard key is released.
212
+ * @param event DOM event
213
+ * @param element Element that lost the focus
214
+ */
215
+ keyup(event?: Event, element?: any): void;
216
+ /**
217
+ * Triggered when the user presses a key on the keyboard.
218
+ * @param event DOM event
219
+ * @param element Element that lost the focus
220
+ */
221
+ keydown(event?: Event, element?: any): void;
222
+ private getFormParent;
223
+ }
@@ -0,0 +1,38 @@
1
+ import { IDictionary, IEventParam } from '@zeedhi/core';
2
+ import { EventDef, IComponentEvents, IComponentRender } from '../zd-component/interfaces';
3
+ import { Input } from './input';
4
+ import { IFormGrid } from '../zd-form/interfaces';
5
+ export type IInputEvent = IEventParam<Input>;
6
+ export interface IInputEvents<T = IEventParam<any>> extends IComponentEvents<T> {
7
+ change?: EventDef<T>;
8
+ input?: EventDef<T>;
9
+ keydown?: EventDef<T>;
10
+ keyup?: EventDef<T>;
11
+ }
12
+ export interface IInput extends IComponentRender {
13
+ align?: string;
14
+ alwaysShowError?: boolean;
15
+ autofill?: boolean;
16
+ clearable?: boolean;
17
+ color?: string;
18
+ dense?: boolean;
19
+ disabled?: boolean;
20
+ displayValue?: any;
21
+ events?: IInputEvents;
22
+ hint?: string;
23
+ label?: string;
24
+ mask?: any;
25
+ maxLength?: number;
26
+ persistentHint?: boolean;
27
+ autoHintDetails?: boolean;
28
+ placeholder?: string;
29
+ readonly?: boolean;
30
+ reverse?: boolean;
31
+ showBorder?: boolean;
32
+ showHelper?: boolean;
33
+ showLabel?: boolean;
34
+ storePath?: string;
35
+ validations?: IDictionary<IDictionary<string | number>>;
36
+ value?: any;
37
+ grid?: IFormGrid;
38
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Column not found error
3
+ */
4
+ export declare class ColumnNotFoundError extends Error {
5
+ constructor(name: string, parentName: string);
6
+ }
@@ -0,0 +1,78 @@
1
+ import { Datasource, IDictionary } from '@zeedhi/core';
2
+ import { Component } from '../zd-component/component';
3
+ import { ColumnAlign, ColumnType, IColumn } from './interfaces';
4
+ /**
5
+ * Base class for Column.
6
+ */
7
+ export declare class Column extends Component implements IColumn {
8
+ align: ColumnAlign;
9
+ label: string;
10
+ width?: string;
11
+ maxWidth?: string;
12
+ minWidth?: string;
13
+ mask: string;
14
+ type?: ColumnType;
15
+ actionFixed: boolean;
16
+ fixed: boolean;
17
+ sortable: boolean;
18
+ loading: boolean;
19
+ componentProps: any;
20
+ /** column style property */
21
+ style: IDictionary;
22
+ /** Type of XLS */
23
+ xlsType: string;
24
+ protected lookupDatasource?: Datasource;
25
+ lookupData: any;
26
+ lookupDataCount: number;
27
+ protected dataToLookup?: any[];
28
+ /**
29
+ * Column overflow behaviour when column has max width
30
+ * 'ellipsis' - show ellipsis (...) at end
31
+ * 'hidden' - just crop value
32
+ * 'wrap' - show value using multiple lines
33
+ * <2..5> - show value using multiple lines with <number> max lines (line-clamp)
34
+ */
35
+ overflow: string | number;
36
+ conditions: IDictionary;
37
+ /**
38
+ * Method to get the current column width, assigned by view layer.
39
+ */
40
+ private viewGetWidth?;
41
+ helperText: string;
42
+ protected defaultData: IDictionary[];
43
+ private lookup;
44
+ /**
45
+ * Defines if the column should store the componentProps datasource.data in memory
46
+ */
47
+ storeData: boolean;
48
+ /**
49
+ * Creates a new Column.
50
+ * @param props Column properties
51
+ */
52
+ constructor(props: IColumn);
53
+ /**
54
+ * Sets view getWidth method.
55
+ */
56
+ setViewGetWidth(viewGetWidth: () => number): void;
57
+ /**
58
+ * * Sets a filter to lookupData.
59
+ */
60
+ setLookupDataFilter(filter: IDictionary): void;
61
+ /**
62
+ * Gets the column width.
63
+ */
64
+ getWidth(): number;
65
+ formatterByRow(row: IDictionary<any>, cellProps?: IDictionary): any;
66
+ formatter(value: any, cellProps?: IDictionary): any;
67
+ getLookupData(lookupColumn: string, value: any): any;
68
+ /**
69
+ * Initialize the lookup property, properly setting the debounced function
70
+ */
71
+ initialize(): void;
72
+ protected lookupFn(lookupColumn: string, dataToLookup?: any[]): Promise<void>;
73
+ /**
74
+ * Clear lookupData to force new requests
75
+ */
76
+ clearLookupData(): void;
77
+ onBeforeDestroy(): void;
78
+ }
@@ -0,0 +1,49 @@
1
+ import { IDictionary, IEvents } from '@zeedhi/core';
2
+ import { IComponentRender } from '../zd-component/interfaces';
3
+ import { Column } from './column';
4
+ import { IConditionsManager } from './interfaces';
5
+ export type ConditionFunction = IEvents<{
6
+ row: IDictionary;
7
+ column: Column;
8
+ }>;
9
+ export type AppliedConditions = {
10
+ root: Partial<IComponentRender>;
11
+ children: IDictionary<Partial<IComponentRender>>;
12
+ };
13
+ export declare class ConditionsManager implements IConditionsManager {
14
+ private uniqueKey;
15
+ private columns;
16
+ /**
17
+ * Dictionary of rowKey ponting to Dictionary of colName pointing to Dictionary of prop pointing to the
18
+ * condition (applied) return value
19
+ */
20
+ private cellsApplied;
21
+ private factoredConditions;
22
+ constructor(uniqueKey: string, columns: Column[]);
23
+ /**
24
+ * Return plain conditions object
25
+ * @param conditions Conditions object
26
+ * @param parentPath Path to parent property
27
+ */
28
+ private getPlainConditions;
29
+ private factorConditions;
30
+ private createConditions;
31
+ /**
32
+ * Apply conditions
33
+ * @param row Datasource row
34
+ */
35
+ applyCondition(row: IDictionary<any>, column: Column, factoredConditions?: ConditionFunction): Partial<IComponentRender>;
36
+ /**
37
+ * Apply conditions on action columns
38
+ * @param row Datasource row
39
+ */
40
+ private applyConditions;
41
+ reapplyConditions(row: IDictionary<any>, columns: Column[]): {
42
+ [x: string]: IDictionary<AppliedConditions>;
43
+ };
44
+ getAppliedConditions({ row, column, path, }: {
45
+ row: IDictionary;
46
+ column: Column;
47
+ path?: string;
48
+ }): Partial<IComponentRender>;
49
+ }
@@ -0,0 +1,103 @@
1
+ import { Datasource, IDatasource, IDictionary, IEventParam } from '@zeedhi/core';
2
+ import { IButton } from '..';
3
+ import { EventDef, IComponent, IComponentEvents, IComponentRender, IComponentRenderInstance } from '../zd-component/interfaces';
4
+ import { ISelect } from '../zd-select/interfaces';
5
+ import { ITextInput } from '../zd-text-input/interfaces';
6
+ import { Column } from './column';
7
+ export interface IIterableEvents<T = IEventParam<any>> extends IComponentEvents<T> {
8
+ changeLayout?: EventDef<T>;
9
+ }
10
+ export type ColumnAlign = 'left' | 'center' | 'right';
11
+ export type ColumnType = 'action';
12
+ export interface IColumn extends IComponent {
13
+ align?: ColumnAlign;
14
+ label?: string;
15
+ width?: string;
16
+ maxWidth?: string;
17
+ minWidth?: string;
18
+ overflow?: string | number;
19
+ mask?: string;
20
+ type?: ColumnType;
21
+ actionFixed?: boolean;
22
+ sortable?: boolean;
23
+ loading?: boolean;
24
+ componentProps?: IComponent;
25
+ conditions?: IDictionary;
26
+ style?: IDictionary;
27
+ events?: IIterableEvents;
28
+ xlsType?: string;
29
+ storeData?: boolean;
30
+ }
31
+ export interface IIterableProps extends IComponentRender {
32
+ columns?: IColumn[];
33
+ datasource?: IDatasource;
34
+ pageSizes?: string[];
35
+ virtualScroll?: boolean;
36
+ virtualScrollCache?: number;
37
+ searchVisibleOnly?: boolean;
38
+ }
39
+ export interface IIterable<T = Column> extends IComponentRenderInstance, IConditionsManager {
40
+ columns: T[];
41
+ datasource: Datasource;
42
+ pageSizes: string[];
43
+ virtualScroll: boolean;
44
+ virtualScrollCache: number;
45
+ searchVisibleOnly: boolean;
46
+ changeLayout(event?: Event, element?: any): void;
47
+ setCurrentRow(row: IDictionary): void;
48
+ setOrder(order: string[]): Promise<any>;
49
+ reload(): Promise<any>;
50
+ getRowKey(row: IDictionary): string | number;
51
+ delete(row: IDictionary): Promise<any>;
52
+ getData(): IDictionary[];
53
+ callEvent(event: string, params: any): boolean;
54
+ getCurrentRowIndex(): number;
55
+ getPage(): number;
56
+ setPage(page: number): Promise<any>;
57
+ getLastPage(): number;
58
+ getColumn(name: string): T;
59
+ createColumn(column: IColumn): T;
60
+ updateData(data: IDictionary[]): Promise<any>;
61
+ changeData(data?: IDictionary[]): void;
62
+ findRow(key: string | number): IDictionary | undefined;
63
+ }
64
+ export interface IIterablePageComponent extends IComponentRender {
65
+ iterableComponentName?: string;
66
+ }
67
+ export interface IIterablePagination extends IIterablePageComponent {
68
+ prevIcon?: string;
69
+ nextIcon?: string;
70
+ circle?: boolean;
71
+ maxButtons?: number;
72
+ }
73
+ export interface IIterablePageSize extends ISelect {
74
+ iterableComponentName?: string;
75
+ clearable?: boolean;
76
+ dataText?: string | string[];
77
+ dataValue?: string;
78
+ autocomplete?: boolean;
79
+ showHelper?: boolean;
80
+ showLabel?: boolean;
81
+ validations?: IDictionary;
82
+ }
83
+ export interface IIterablePageInfo extends IIterablePageComponent {
84
+ }
85
+ export interface ISearch extends ITextInput {
86
+ iterableComponentName?: string;
87
+ showLabel?: boolean;
88
+ showHelper?: boolean;
89
+ appendIcon?: string;
90
+ lazyAttach?: boolean;
91
+ }
92
+ export interface IConditionsManager {
93
+ reapplyConditions(row: IDictionary<any>, columns?: Column[]): IDictionary<IDictionary<any>>;
94
+ getAppliedConditions(args: {
95
+ row: IDictionary;
96
+ column: Column;
97
+ path?: string;
98
+ }): Partial<IComponentRender>;
99
+ }
100
+ export interface IIterableColumnsButton extends IButton {
101
+ iterableComponentName?: string;
102
+ ignoreColumns?: string[];
103
+ }
@@ -0,0 +1,9 @@
1
+ import { IEventParam } from '@zeedhi/core';
2
+ import { Checkbox } from '../zd-checkbox/checkbox';
3
+ import { Column } from './column';
4
+ import { Iterable } from './iterable';
5
+ export declare class IterableColumnsButtonController {
6
+ protected iterableComponent: Iterable;
7
+ constructor(iterableComponent: Iterable);
8
+ showHideColumn(column: Column, { component, event, element }: IEventParam<Checkbox>): void;
9
+ }
@@ -0,0 +1,35 @@
1
+ import { Column } from '..';
2
+ import { Button } from '../zd-button/button';
3
+ import { IIterableColumnsButton } from './interfaces';
4
+ import { Iterable } from './iterable';
5
+ /**
6
+ * Base class for Columns Button component
7
+ */
8
+ export declare class IterableColumnsButton<T extends Column = Column> extends Button implements IIterableColumnsButton {
9
+ /**
10
+ * Iterable component name
11
+ */
12
+ iterableComponentName: string;
13
+ /**
14
+ * Iterable component name
15
+ */
16
+ iterableComponent: Iterable<T>;
17
+ /**
18
+ * Columns to be ignored
19
+ */
20
+ ignoreColumns: string[];
21
+ /**
22
+ * Component controller
23
+ */
24
+ controller: any;
25
+ iconName: string;
26
+ icon: boolean;
27
+ /**
28
+ * Creates a new Iterable Page component.
29
+ * @param props Iterable page component properties
30
+ */
31
+ constructor(props: IIterableColumnsButton);
32
+ private setIterableComponent;
33
+ onCreated(): void;
34
+ filteredColumns(): T[];
35
+ }
@@ -0,0 +1,8 @@
1
+ import { Iterable } from './iterable';
2
+ export declare class IterableController {
3
+ private iterable;
4
+ private searchInValue?;
5
+ constructor(iterable: Iterable);
6
+ get searchIn(): string[] | undefined;
7
+ set searchIn(value: string[] | undefined);
8
+ }
@@ -0,0 +1,27 @@
1
+ import { ComponentRender } from '../zd-component/component-render';
2
+ import { IIterablePageComponent } from './interfaces';
3
+ import { Iterable } from './iterable';
4
+ /**
5
+ * Base class for Iterable Page component
6
+ */
7
+ export declare class IterablePageComponent extends ComponentRender implements IIterablePageComponent {
8
+ /**
9
+ * Iterable component name
10
+ */
11
+ iterableComponentName: string;
12
+ /**
13
+ * Iterable component name
14
+ */
15
+ iterableComponent: Iterable;
16
+ /**
17
+ * Creates a new Iterable Page component.
18
+ * @param props Iterable page component properties
19
+ */
20
+ constructor(props: IIterablePageComponent);
21
+ /**
22
+ * Set the Iterable Component
23
+ * @param element Element mounted reference
24
+ */
25
+ onMounted(element: any): void;
26
+ private setIterableComponent;
27
+ }
@@ -0,0 +1,7 @@
1
+ import { IIterablePageInfo } from './interfaces';
2
+ import { IterablePageComponent } from './iterable-page-component';
3
+ /**
4
+ * Base class for Iterable Page Info component
5
+ */
6
+ export declare class IterablePageInfo extends IterablePageComponent implements IIterablePageInfo {
7
+ }