@zeedhi/common 1.57.0 → 1.59.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeedhi/common",
3
- "version": "1.57.0",
3
+ "version": "1.59.0",
4
4
  "description": "Zeedhi Common",
5
5
  "author": "Zeedhi <zeedhi@teknisa.com>",
6
6
  "license": "ISC",
@@ -21,6 +21,7 @@
21
21
  "dependencies": {
22
22
  "@zeedhi/autonumeric": "^4.6.0",
23
23
  "lodash.debounce": "^4.0.8",
24
+ "lodash.get": "^4.4.2",
24
25
  "lodash.isundefined": "^3.0.1",
25
26
  "lodash.merge": "^4.6.2",
26
27
  "lodash.set": "^4.3.2"
@@ -30,6 +31,7 @@
30
31
  },
31
32
  "devDependencies": {
32
33
  "@types/lodash.debounce": "^4.0.6",
34
+ "@types/lodash.get": "^4.4.6",
33
35
  "@types/lodash.isundefined": "^3.0.6",
34
36
  "@types/lodash.merge": "^4.6.6",
35
37
  "@types/lodash.set": "^4.3.6",
@@ -37,5 +39,5 @@
37
39
  "lodash.times": "^4.3.2",
38
40
  "mockdate": "^3.0.2"
39
41
  },
40
- "gitHead": "099b5a1c0726bb00c757de8985868b197d7a57ad"
42
+ "gitHead": "1994ad253bafc3190adf1dd0db028b2825a2f16e"
41
43
  }
@@ -1,14 +1,14 @@
1
- import scss from 'rollup-plugin-scss';
2
-
3
- export default {
4
- input: './src/styles/index.scss',
5
- output: {
6
- format: 'esm',
7
- },
8
- plugins: [
9
- scss({
10
- output: 'dist/style.css',
11
- outputStyle: 'compressed',
12
- }),
13
- ],
14
- };
1
+ import scss from 'rollup-plugin-scss';
2
+
3
+ export default {
4
+ input: './src/styles/index.scss',
5
+ output: {
6
+ format: 'esm',
7
+ },
8
+ plugins: [
9
+ scss({
10
+ output: 'dist/style.css',
11
+ outputStyle: 'compressed',
12
+ }),
13
+ ],
14
+ };
@@ -1,9 +1,9 @@
1
- {
2
- // extend your base config so you don't have to redefine your compilerOptions
3
- "extends": "./tsconfig.json",
4
- "include": [
5
- "./src/**/*.ts",
6
- "./tests/**/*.ts",
7
- ],
8
- "exclude": ["node_modules"]
1
+ {
2
+ // extend your base config so you don't have to redefine your compilerOptions
3
+ "extends": "./tsconfig.json",
4
+ "include": [
5
+ "./src/**/*.ts",
6
+ "./tests/**/*.ts",
7
+ ],
8
+ "exclude": ["node_modules"]
9
9
  }
@@ -81,6 +81,8 @@ export * from './zd-iterable/iterable-page-info';
81
81
  export * from './zd-iterable/iterable-pagination';
82
82
  export * from './zd-iterable/search';
83
83
  export * from './zd-iterable/interfaces';
84
+ export * from './zd-iterable-component-render/iterable-component-render';
85
+ export * from './zd-iterable-component-render/interfaces';
84
86
  export * from './zd-list/list';
85
87
  export * from './zd-list/list-item';
86
88
  export * from './zd-list/list-group';
@@ -55,6 +55,10 @@ export declare class Form extends ComponentRender implements IForm {
55
55
  */
56
56
  get value(): IDictionary;
57
57
  set value(value: IDictionary);
58
+ /**
59
+ * Clear all form inputs
60
+ */
61
+ clearForm(): void;
58
62
  /**
59
63
  * Saves input instance and defines property on form value.
60
64
  * @param component Children component
@@ -70,17 +74,10 @@ export declare class Form extends ComponentRender implements IForm {
70
74
  componentId?: number | undefined;
71
75
  cssClass?: string | undefined;
72
76
  cssStyle?: string | object | undefined;
73
- /**
74
- * Children component structure if the component has children.
75
- */
76
77
  events?: import("..").IComponentEvents<import("@zeedhi/core").IEventParam<any>> | undefined;
77
78
  directives?: import("..").IComponentDirectives | undefined;
78
79
  isVisible?: string | boolean | undefined;
79
80
  dark?: boolean | undefined;
80
- /**
81
- * Applies the align-items css property.
82
- * Available options are start, center, end, space-between, space-around and stretch.
83
- */
84
81
  light?: boolean | undefined;
85
82
  keyMap?: import("@zeedhi/core").IKeyMap<import("@zeedhi/core").IEventParam<any>> | undefined;
86
83
  name: string;
@@ -18,9 +18,6 @@ export declare class GridColumn extends Column implements IGridColumn {
18
18
  [key: string]: any;
19
19
  children?: import("..").IComponentRender[] | undefined;
20
20
  component: string;
21
- /**
22
- * Base class for Grid column
23
- */
24
21
  componentId?: number | undefined;
25
22
  cssClass?: string | undefined;
26
23
  cssStyle?: string | object | undefined;
@@ -29,12 +26,11 @@ export declare class GridColumn extends Column implements IGridColumn {
29
26
  isVisible?: string | boolean | undefined;
30
27
  dark?: boolean | undefined;
31
28
  light?: boolean | undefined;
32
- /**
29
+ keyMap?: import("@zeedhi/core").IKeyMap<import("@zeedhi/core").IEventParam<any>> | undefined;
30
+ name: string; /**
33
31
  * Creates a new Grid Column.
34
32
  * @param props Grid column properties
35
33
  */
36
- keyMap?: import("@zeedhi/core").IKeyMap<import("@zeedhi/core").IEventParam<any>> | undefined;
37
- name: string;
38
34
  parent?: import("..").Component | undefined;
39
35
  }[];
40
36
  /**
@@ -122,7 +122,7 @@ export declare class GridEditable extends Grid implements IGridEditable {
122
122
  * @param column Column
123
123
  * @param row Row
124
124
  */
125
- isValid(column: IGridColumnEditable, row: IDictionary): boolean;
125
+ isValid(column: IGridColumnEditable, row: IDictionary, revalidate?: boolean): boolean;
126
126
  private newRowIdentifier;
127
127
  /**
128
128
  * Cancels all edited rows and enable grid components
@@ -132,15 +132,21 @@ export declare class GridEditable extends Grid implements IGridEditable {
132
132
  private addDataRow;
133
133
  /**
134
134
  * Saves all edited rows if they are valid
135
+ * @param revalidate Defines if the fields should be revalidated
135
136
  * @throws Will throw when it finds an invalid row
136
137
  */
137
- saveEditedRows(): Promise<void[]>;
138
+ saveEditedRows(revalidate?: boolean): Promise<void[]>;
138
139
  /**
139
140
  * Retrieves all edited rows if they are valid
141
+ * @param revalidate Defines if the fields should be revalidated
140
142
  * @throws Will throw when it finds an invalid row
141
143
  */
142
- getEditedRows(): IDictionary<any>[];
143
- isGridValid(): boolean;
144
+ getEditedRows(revalidate?: boolean): IDictionary<any>[];
145
+ /**
146
+ * Checks whether the grid is valid or not
147
+ * @param revalidate Defines if the fields should be revalidated
148
+ */
149
+ isGridValid(revalidate?: boolean): boolean;
144
150
  /**
145
151
  * Adds new row to the datasource data and pushes it to the editedRows
146
152
  * @param row Row
@@ -175,6 +175,6 @@ export declare class Grid extends Iterable implements IGrid {
175
175
  protected navigatePageDown(): void;
176
176
  deleteRows(): Promise<any[]>;
177
177
  getActionComponent(actionComponent: IComponent, column: GridColumn, row: IDictionary, parentPath?: string): IComponent;
178
- protected changeDefaultSlotNames(slot: IComponentRender[]): IComponentRender[];
178
+ protected changeDefaultSlotNames(slot: IComponentRender[]): any;
179
179
  callDisableSelection(row: IDictionary<any>): boolean;
180
180
  }
@@ -30,6 +30,7 @@ export interface IIterable extends IComponentRender {
30
30
  datasource?: IDatasource;
31
31
  pageSizes?: string[];
32
32
  virtualScroll?: boolean;
33
+ searchVisibleOnly?: boolean;
33
34
  }
34
35
  export interface IIterablePageComponent extends IComponentRender {
35
36
  iterableComponentName?: string;
@@ -1,6 +1,6 @@
1
1
  import { Iterable } from './iterable';
2
2
  export declare class IterableController {
3
- private columns;
3
+ private iterable;
4
4
  private searchInValue?;
5
5
  constructor(iterable: Iterable);
6
6
  get searchIn(): string[] | undefined;
@@ -36,6 +36,11 @@ export declare class Iterable extends ComponentRender implements IIterable {
36
36
  * Dictionary of prop pointing to the condition (applied) return value
37
37
  */
38
38
  actionsApplied: IDictionary<IDictionary<IDictionary<any>>>;
39
+ /**
40
+ * Defines if searchIn should consider only visible columns or not
41
+ */
42
+ searchVisibleOnly: boolean;
43
+ defaultSearchVisibleOnly: boolean;
39
44
  /**
40
45
  * Creates a new Iterable.
41
46
  * @param props Iterable properties
@@ -0,0 +1,14 @@
1
+ import { IComponentRender } from '../zd-component/interfaces';
2
+ import { IIterable } from '../zd-iterable/interfaces';
3
+ export interface IIterableComponentRender extends IIterable {
4
+ rowPropName?: string;
5
+ componentMetadata?: IComponentRender;
6
+ footerSlot?: IComponentRender[];
7
+ toolbarSlot?: IComponentRender[];
8
+ errorSlot?: IComponentRender[];
9
+ noDataSlot?: IComponentRender[];
10
+ noResultSlot?: IComponentRender[];
11
+ height?: number | string;
12
+ maxHeight?: number | string;
13
+ minHeight?: number | string;
14
+ }
@@ -0,0 +1,60 @@
1
+ import { IDictionary } from '@zeedhi/core';
2
+ import { IComponentRender } from '../zd-component/interfaces';
3
+ import { IIterableComponentRender } from './interfaces';
4
+ import { Iterable } from '../zd-iterable/iterable';
5
+ /**
6
+ * Base class for IterableComponentRender component.
7
+ * This component uses every row returned by Iterable.datasource to render
8
+ * components defined by componentMetadata property.
9
+ * If the data inside the datasource is changed you should perform
10
+ * a datasource.get() to force updating the rendered components.
11
+ */
12
+ export declare class IterableComponentRender extends Iterable implements IIterableComponentRender {
13
+ /**
14
+ * Components that will be rendered on toolbar slot
15
+ */
16
+ toolbarSlot: IComponentRender[];
17
+ /**
18
+ * Components that will be rendered on footer slot
19
+ */
20
+ footerSlot: IComponentRender[];
21
+ /**
22
+ * Component item definition
23
+ */
24
+ componentMetadata: IComponentRender;
25
+ /**
26
+ * Row property name
27
+ */
28
+ rowPropName: string;
29
+ /**
30
+ * Components that will be rendered in no-data case
31
+ */
32
+ noDataSlot: IComponentRender[];
33
+ /**
34
+ * Components that will be rendered in no-result case
35
+ */
36
+ noResultSlot: IComponentRender[];
37
+ /**
38
+ * Sets the height for the component.
39
+ */
40
+ height: number | string;
41
+ /**
42
+ * Sets the maximum height for the component.
43
+ */
44
+ maxHeight: number | string;
45
+ /**
46
+ * Sets the minimum height for the component.
47
+ */
48
+ minHeight: number | string;
49
+ /**
50
+ * Components that will be rendered in error case
51
+ */
52
+ errorSlot: IComponentRender[];
53
+ constructor(props: IIterableComponentRender);
54
+ private addSlashes;
55
+ /**
56
+ * Returns the iterable component metadata based on row data
57
+ */
58
+ getComponentMetadata(row: IDictionary<any>): any;
59
+ private changeDefaultSlotNames;
60
+ }
@@ -6,7 +6,7 @@ export declare class SelectMultiple extends Select implements ISelectMultiple {
6
6
  /**
7
7
  * Selected items that were added to datasource
8
8
  */
9
- private insertedValues;
9
+ insertedValues: IDictionary<any>[];
10
10
  /**
11
11
  * Inserted values that were unselected
12
12
  */
@@ -5,6 +5,7 @@ export interface ITreeGrid extends IGrid {
5
5
  parentField?: string;
6
6
  openLevelOnLoad?: number | boolean;
7
7
  fetchOnDemand?: boolean;
8
+ flat?: boolean;
8
9
  }
9
10
  export interface ITreeGridEditable extends ITreeGrid {
10
11
  columns?: IGridColumnEditable[];
@@ -31,6 +31,10 @@ export declare class TreeGrid extends Grid implements ITreeGrid {
31
31
  * Tree data structure
32
32
  */
33
33
  treeDataStructure: TreeDataStructure;
34
+ /**
35
+ * Even though all children are selected, the parent node is not
36
+ */
37
+ flat: boolean;
34
38
  viewUpdateScrollData?: () => void;
35
39
  /**
36
40
  * Creates a new Tree Grid.
@@ -80,12 +84,23 @@ export declare class TreeGrid extends Grid implements ITreeGrid {
80
84
  * Navigate downwards
81
85
  */
82
86
  protected navigateDown(): void;
87
+ private removeDuplicates;
83
88
  /**
84
89
  * Select/deselect rows
85
90
  * @param row selected row
86
91
  * @param isSelected row is selected
87
92
  */
88
93
  selectRow(row: IDictionary<any>, isSelected: boolean): void;
94
+ /**
95
+ * Select children rows
96
+ * @param row Row to unselect children
97
+ */
98
+ selectChildren(row: IDictionary<any>): void;
99
+ /**
100
+ * Unselect children rows
101
+ * @param row Row to select children
102
+ */
103
+ unselectChildren(row: IDictionary<any>): void;
89
104
  private selectParents;
90
105
  private unselectParents;
91
106
  }