@mindfusion/dataviews 2.1.0 → 2.1.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.
package/README.md CHANGED
@@ -27,17 +27,33 @@ npm i @mindfusion/dataviews
27
27
  - Styling through themes
28
28
  - Row virtualization for faster rendering
29
29
 
30
- ## React support
30
+ ## What's new in JS DataViews 2.1.2
31
31
 
32
- The GridView React component allows integrating the MindFusion.DataViews API into React applications. It is a wrapper component for the Grid control, handles the rendering and keeps its DOM in sync with React’s virtual DOM. Grid properties can be set from JSX, and grid events can be handled through JSX syntax as well.
32
+ The library registers the [Grid](https://www.mindfusion.eu/onlinehelp/javascript.pack/T_MindFusion_DataViews_Grid.htm) class as a web component. You can use the <mindfusion-grid> tag to create the control.
33
33
 
34
- [The GridView component for React on npm.](https://www.npmjs.com/package/grid-library-react)
34
+ When instantiated as a web component, the control creates required HTML elements as internal shadow DOM. You can get the JavaScript object corresponding to a web component by calling the [find](https://www.mindfusion.eu/onlinehelp/javascript.pack/M_MindFusion_Common_Control_find_1_String.htm) method with id argument.
35
+
36
+ ```
37
+ <mindfusion-grid id="grid">
38
+ </mindfusion-grid>
39
+ ```
40
+
41
+ ```
42
+ var dv = MindFusion.DataViews;
43
+ var grid = dv.Grid.find("grid");
44
+ grid.model = new dv.ArrayModel(participants, columns, "index");
45
+ ```
35
46
 
36
47
 
37
48
  ## What's new in JS DataViews 2.1
38
49
 
39
50
  The [DataViews](https://www.mindfusion.eu/onlinehelp/javascript.pack/index.htm?N_MindFusion_DataViews.htm) module now includes a [Property Grid](https://www.mindfusion.eu/onlinehelp/javascript.pack/index.htm?PropertyGrid.htm) providing user interface for browsing and editing the properties of an object. The [PropertyGrid](https://www.mindfusion.eu/onlinehelp/javascript.pack/index.htm?T_MindFusion_DataViews_PropertyGrid.htm) control can be bound to any object or an array of objects as specified by its [selectedObject](https://www.mindfusion.eu/onlinehelp/javascript.pack/index.htm?P_MindFusion_DataViews_PropertyGrid_selectedObject_0.htm) property. If [showAllProperties](https://www.mindfusion.eu/onlinehelp/javascript.pack/index.htm?P_MindFusion_DataViews_PropertyGrid_showAllProperties_0.htm) is set to **true**, the control enumerates all properties and fields of the object and its prototype chain, resolves their data types and displays their name and value in a grid layout. If showAllProperties is set to **false**, only properties and fields included in the [metaData](https://www.mindfusion.eu/onlinehelp/javascript.pack/index.htm?P_MindFusion_DataViews_PropertyGrid_metaData_0.htm) dictionary are displayed.
40
51
 
52
+ ## React support
53
+
54
+ The GridView React component allows integrating the MindFusion.DataViews API into React applications. It is a wrapper component for the Grid control, handles the rendering and keeps its DOM in sync with React’s virtual DOM. Grid properties can be set from JSX, and grid events can be handled through JSX syntax as well.
55
+
56
+ [The GridView component for React on npm.](https://www.npmjs.com/package/grid-library-react)
41
57
 
42
58
  ## Documentation
43
59
 
package/dataviews.d.ts CHANGED
@@ -7,7 +7,7 @@ declare module "DataViews/jsdv/src/DataType" {
7
7
  * @namespace MindFusion.DataViews
8
8
  */
9
9
  /**
10
- * Copyright (c) 2020, MindFusion LLC - Bulgaria.
10
+ * Copyright (c) 2022, MindFusion LLC - Bulgaria.
11
11
  *
12
12
  * This source code is provided to you as part of the MindFusion software components
13
13
  * package you have purchased. You may use the source code to trace and/or fix
@@ -18,10 +18,36 @@ declare module "DataViews/jsdv/src/DataType" {
18
18
  * @class A base class for data types.
19
19
  */
20
20
  class DataType {
21
- static sortFunction(value1: any, value2: any): void;
22
- static createEditor(element: any, displayValue: any, value: any, view: any): void;
23
- static parse(text: any): void;
24
- static equals(value1: any, value2: any): void;
21
+ /**
22
+ * Return the sort order of specified values.
23
+ * @param {Object} value1 The first value to compare.
24
+ * @param {Object} value2 The second value to compare.
25
+ * @returns {Number} A negative number if value1 < value2, 0 if values are equal,
26
+ * or a positive number if value1 > value2.
27
+ */
28
+ static sortFunction(value1: any, value2: any): number;
29
+ /**
30
+ * Creates an editor for specified value.
31
+ * @param {DOMElement} element The parent DOM element where editor should be added.
32
+ * @param {String} displayValue The label to display for value.
33
+ * @param {Object} value The value to edit.
34
+ * @param {Object} view The parent control.
35
+ * @returns {DOMElement} The DOM element used to edit the value.
36
+ */
37
+ static createEditor(element: any, displayValue: string, value: any, view: any): any;
38
+ /**
39
+ * Parses value from specified string.
40
+ * @param {String} text Textual representation of the value.
41
+ * @returns {Object} The parsed value.
42
+ */
43
+ static parse(text: string): any;
44
+ /**
45
+ * Determines if values are equal.
46
+ * @param {Object} value1 The first value to compare.
47
+ * @param {Object} value2 The second value to compare.
48
+ * @returns {Boolean} true if values are equal, or false otherwise.
49
+ */
50
+ static equals(value1: any, value2: any): boolean;
25
51
  }
26
52
  }
27
53
  declare module "DataViews/jsdv/src/Enum" {
@@ -43,7 +69,8 @@ declare module "DataViews/jsdv/src/Enum" {
43
69
  }
44
70
  declare module "DataViews/jsdv/src/StringType" {
45
71
  /**
46
- * @class Provides functionality for grid columns, that display string data.
72
+ * @class Provides functionality for grid columns that display string data.
73
+ * @augments DataType
47
74
  */
48
75
  export class StringType extends DataType {
49
76
  static sortFunction(value1: any, value2: any): any;
@@ -59,7 +86,8 @@ declare module "DataViews/jsdv/src/StringType" {
59
86
  }
60
87
  declare module "DataViews/jsdv/src/DateType" {
61
88
  /**
62
- * @class Provides functionality for grid columns, that display dates.
89
+ * @class Provides functionality for grid columns that display dates.
90
+ * @augments DataType
63
91
  */
64
92
  export class DateType extends DataType {
65
93
  static sortFunction(value1: any, value2: any): number;
@@ -76,15 +104,21 @@ declare module "DataViews/jsdv/src/DateType" {
76
104
  }
77
105
  declare module "DataViews/jsdv/src/DateTimeType" {
78
106
  /**
79
- * @class Provides functionality for grid columns, that display date-time values.
107
+ * @class Provides functionality for grid columns that display date-time values.
108
+ * @augments DataType
80
109
  */
81
- export class DateTimeType extends DateType {
110
+ export class DateTimeType {
111
+ static get customEditor(): DateTimePicker;
112
+ static createEditor(element: any, displayValue: any, value: any, view: any): HTMLInputElement | DateTimePicker;
113
+ static createDefaultEditor(element: any, displayValue: any, value: any, view: any): HTMLInputElement;
114
+ static format(value: any, meta: any): any;
82
115
  }
83
- import { DateType } from "DataViews/jsdv/src/DateType";
116
+ import { DateTimePicker } from "@mindfusion/common-ui";
84
117
  }
85
118
  declare module "DataViews/jsdv/src/BooleanType" {
86
119
  /**
87
- * @class Provides functionality for grid columns, that display boolean data.
120
+ * @class Provides functionality for grid columns that display boolean data.
121
+ * @augments StringType
88
122
  */
89
123
  export class BooleanType extends StringType {
90
124
  static sortFunction(value1: any, value2: any): number;
@@ -95,7 +129,8 @@ declare module "DataViews/jsdv/src/BooleanType" {
95
129
  }
96
130
  declare module "DataViews/jsdv/src/ObjectType" {
97
131
  /**
98
- * @class Provides functionality for grid cells, that display expandable objects.
132
+ * @class Provides functionality for grid cells that display expandable objects.
133
+ * @augments DataType
99
134
  */
100
135
  export class ObjectType extends DataType {
101
136
  static sortFunction(value1: any, value2: any): number;
@@ -108,7 +143,8 @@ declare module "DataViews/jsdv/src/ObjectType" {
108
143
  }
109
144
  declare module "DataViews/jsdv/src/IntegerType" {
110
145
  /**
111
- * @class Provides functionality for grid columns, that display integer data.
146
+ * @class Provides functionality for grid columns that display integer data.
147
+ * @augments DataType
112
148
  */
113
149
  export class IntegerType extends DataType {
114
150
  static sortFunction(value1: any, value2: any): number;
@@ -122,7 +158,8 @@ declare module "DataViews/jsdv/src/IntegerType" {
122
158
  }
123
159
  declare module "DataViews/jsdv/src/LookupType" {
124
160
  /**
125
- * @class Provides functionality for grid columns, that display lookup or value lists.
161
+ * @class Provides functionality for grid columns that display lookup or value lists.
162
+ * @augments DataType
126
163
  */
127
164
  export class LookupType extends DataType {
128
165
  static sortFunction(value1: any, value2: any): any;
@@ -138,7 +175,8 @@ declare module "DataViews/jsdv/src/LookupType" {
138
175
  }
139
176
  declare module "DataViews/jsdv/src/RealNumberType" {
140
177
  /**
141
- * @class Provides functionality for grid columns, that display real number data.
178
+ * @class Provides functionality for grid columns that display real number data.
179
+ * @augments IntegerType
142
180
  */
143
181
  export class RealNumberType extends IntegerType {
144
182
  }
@@ -146,7 +184,8 @@ declare module "DataViews/jsdv/src/RealNumberType" {
146
184
  }
147
185
  declare module "DataViews/jsdv/src/DynamicType" {
148
186
  /**
149
- * @class Provides functionality for grid columns, that display data of different types.
187
+ * @class Provides functionality for grid columns that display data of different types.
188
+ * @augments DataType
150
189
  */
151
190
  export class DynamicType extends DataType {
152
191
  static sortFunction(valueObj1: any, valueObj2: any): any;
@@ -309,7 +348,7 @@ declare module "DataViews/jsdv/src/Command" {
309
348
  * @namespace MindFusion.DataViews
310
349
  */
311
350
  /**
312
- * Copyright (c) 2020, MindFusion LLC - Bulgaria.
351
+ * Copyright (c) 2022, MindFusion LLC - Bulgaria.
313
352
  *
314
353
  * This source code is provided to you as part of the MindFusion software components
315
354
  * package you have purchased. You may use the source code to trace and/or fix
@@ -587,7 +626,7 @@ declare module "DataViews/jsdv/src/EventArgs" {
587
626
  _content: Node;
588
627
  }
589
628
  /**
590
- * @class Provides data for events, raised by dynamic columns.
629
+ * @class Provides data for events raised by dynamic columns.
591
630
  * @augments EventArgs
592
631
  */
593
632
  export class CellResolveEventArgs extends EventArgs {
@@ -709,7 +748,8 @@ declare module "DataViews/jsdv/src/CommandType" {
709
748
  }
710
749
  declare module "DataViews/jsdv/src/CurrencyType" {
711
750
  /**
712
- * @class Provides functionality for grid columns, that display currency data.
751
+ * @class Provides functionality for grid columns that display currency data.
752
+ * @augments RealNumberType
713
753
  */
714
754
  export class CurrencyType extends RealNumberType {
715
755
  }
@@ -729,7 +769,7 @@ declare module "DataViews/jsdv/src/DomRenderer" {
729
769
  * @namespace MindFusion.DataViews
730
770
  */
731
771
  /**
732
- * Copyright (c) 2020, MindFusion LLC - Bulgaria.
772
+ * Copyright (c) 2022, MindFusion LLC - Bulgaria.
733
773
  *
734
774
  * This source code is provided to you as part of the MindFusion software components
735
775
  * package you have purchased. You may use the source code to trace and/or fix
@@ -808,7 +848,6 @@ declare module "DataViews/jsdv/src/UIControl" {
808
848
  */
809
849
  export class UIControl extends Control {
810
850
  static get tm(): number[];
811
- static get tm2(): number[];
812
851
  static get ns(): string;
813
852
  _messenger: {
814
853
  message(control: any): void;
@@ -816,7 +855,6 @@ declare module "DataViews/jsdv/src/UIControl" {
816
855
  };
817
856
  get targetElement(): Element;
818
857
  setLicenseKey(value: any): void;
819
- get tm2(): number[];
820
858
  }
821
859
  import { Control } from "@mindfusion/common";
822
860
  }
@@ -865,7 +903,8 @@ declare module "DataViews/jsdv/src/ProxyModel" {
865
903
  }
866
904
  declare module "DataViews/jsdv/src/ImageType" {
867
905
  /**
868
- * @class Provides functionality for grid columns, that display image data.
906
+ * @class Provides functionality for grid columns that display image data.
907
+ * @augments DataType
869
908
  */
870
909
  export class ImageType extends DataType {
871
910
  static sortFunction(value1: any, value2: any): any;
@@ -910,7 +949,7 @@ declare module "DataViews/jsdv/src/Selection" {
910
949
  * @namespace MindFusion.DataViews
911
950
  */
912
951
  /**
913
- * Copyright (c) 2020, MindFusion LLC - Bulgaria.
952
+ * Copyright (c) 2022, MindFusion LLC - Bulgaria.
914
953
  *
915
954
  * This source code is provided to you as part of the MindFusion software components
916
955
  * package you have purchased. You may use the source code to trace and/or fix
@@ -952,7 +991,7 @@ declare module "DataViews/jsdv/src/GridModel" {
952
991
  * @namespace MindFusion.DataViews
953
992
  */
954
993
  /**
955
- * Copyright (c) 2020, MindFusion LLC - Bulgaria.
994
+ * Copyright (c) 2022, MindFusion LLC - Bulgaria.
956
995
  *
957
996
  * This source code is provided to you as part of the MindFusion software components
958
997
  * package you have purchased. You may use the source code to trace and/or fix
@@ -1068,7 +1107,7 @@ declare module "DataViews/jsdv/src/GridCell" {
1068
1107
  * @namespace MindFusion.DataViews
1069
1108
  */
1070
1109
  /**
1071
- * Copyright (c) 2020, MindFusion LLC - Bulgaria.
1110
+ * Copyright (c) 2022, MindFusion LLC - Bulgaria.
1072
1111
  *
1073
1112
  * This source code is provided to you as part of the MindFusion software components
1074
1113
  * package you have purchased. You may use the source code to trace and/or fix
@@ -1761,12 +1800,12 @@ declare module "DataViews/jsdv/src/Grid" {
1761
1800
  */
1762
1801
  get getCellValue(): EventDispatcher<any>;
1763
1802
  /**
1764
- * Raised when the data type of a cell in a DynamicType column has to be resolved.
1765
- * @event resolveCellDataType
1766
- * @type {EventDispatcher}
1767
- * @property {Grid} sender
1768
- * @property {CellResolveEventArgs} args
1769
- */
1803
+ * Raised when the data type of a cell in a DynamicType column has to be resolved.
1804
+ * @event resolveCellDataType
1805
+ * @type {EventDispatcher}
1806
+ * @property {Grid} sender
1807
+ * @property {CellResolveEventArgs} args
1808
+ */
1770
1809
  get resolveCellMetaData(): EventDispatcher<any>;
1771
1810
  /**
1772
1811
  * Raised when the value of a cell in a DynamicType column has to be formatted.
@@ -1781,6 +1820,7 @@ declare module "DataViews/jsdv/src/Grid" {
1781
1820
  * @private
1782
1821
  */
1783
1822
  private get objectButtonClick();
1823
+ connectedCallback(): void;
1784
1824
  }
1785
1825
  import { UIControl } from "DataViews/jsdv/src/UIControl";
1786
1826
  import { Unit } from "@mindfusion/common";
@@ -1879,7 +1919,8 @@ declare module "DataViews/jsdv/src/PropertyGridModel" {
1879
1919
  }
1880
1920
  declare module "DataViews/jsdv/src/CollectionType" {
1881
1921
  /**
1882
- * @class Provides functionality for grid cells, that display collection objects.
1922
+ * @class Provides functionality for grid cells that display collection objects.
1923
+ * @augments ObjectType
1883
1924
  */
1884
1925
  export class CollectionType extends ObjectType {
1885
1926
  static format(value: any, meta: any): string;