cx 23.9.0 → 23.11.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.
@@ -1,34 +1,34 @@
1
- import * as Cx from "../../core";
2
- import { FieldProps } from "./Field";
3
-
4
- interface UploadButtonProps extends FieldProps {
5
- /** Text description. */
6
- text?: Cx.StringProp;
7
-
8
- url?: Cx.StringProp;
9
-
10
- /** Base CSS class to be applied to the element. Default is 'uploadbutton'. */
11
- baseClass?: string;
12
-
13
- /** Defaults to `false`. Set to `true` to enable multiple selection. */
14
- multiple?: boolean;
15
-
16
- method?: string;
17
- uploadInProgressText?: string;
18
-
19
- /** Defaults to `false`. Set to `true` to abort uploads if the button is destroyed (unmounted). */
20
- abortOnDestroy: boolean;
21
-
22
- /** Defines file types that are accepted for upload. */
23
- accept?: Cx.StringProp;
24
-
25
- /** Name of the icon to be put on the left side of the button. */
26
- icon?: Cx.StringProp;
27
-
28
- onUploadStarting?: ((xhr: XMLHttpRequest, instance: any, file: File, formData: FormData) => boolean) | string;
29
- onUploadComplete?: ((xhr: XMLHttpRequest, instance: any, file: File, formData: FormData) => void) | string;
30
- onUploadProgress?: ((event: ProgressEvent, instance: any, file: File, formData: FormData) => void) | string;
31
- onUploadError?: ((event: ProgressEvent, instance: any, file: File, formData: FormData) => void) | string;
32
- }
33
-
34
- export class UploadButton extends Cx.Widget<UploadButtonProps> {}
1
+ import * as Cx from "../../core";
2
+ import { FieldProps } from "./Field";
3
+
4
+ interface UploadButtonProps extends FieldProps {
5
+ /** Text description. */
6
+ text?: Cx.StringProp;
7
+
8
+ url?: Cx.StringProp;
9
+
10
+ /** Base CSS class to be applied to the element. Default is 'uploadbutton'. */
11
+ baseClass?: string;
12
+
13
+ /** Defaults to `false`. Set to `true` to enable multiple selection. */
14
+ multiple?: boolean;
15
+
16
+ method?: string;
17
+ uploadInProgressText?: string;
18
+
19
+ /** Defaults to `false`. Set to `true` to abort uploads if the button is destroyed (unmounted). */
20
+ abortOnDestroy?: boolean;
21
+
22
+ /** Defines file types that are accepted for upload. */
23
+ accept?: Cx.StringProp;
24
+
25
+ /** Name of the icon to be put on the left side of the button. */
26
+ icon?: Cx.StringProp;
27
+
28
+ onUploadStarting?: ((xhr: XMLHttpRequest, instance: any, file: File, formData: FormData) => boolean) | string;
29
+ onUploadComplete?: ((xhr: XMLHttpRequest, instance: any, file: File, formData: FormData) => void) | string;
30
+ onUploadProgress?: ((event: ProgressEvent, instance: any, file: File, formData: FormData) => void) | string;
31
+ onUploadError?: ((event: ProgressEvent, instance: any, file: File, formData: FormData) => void) | string;
32
+ }
33
+
34
+ export class UploadButton extends Cx.Widget<UploadButtonProps> {}
@@ -155,9 +155,9 @@ interface GridRowConfig {
155
155
  mod?: StringProp | Prop<string[]> | StructuredProp;
156
156
  }
157
157
 
158
- interface GridProps extends StyledContainerProps {
158
+ interface GridProps<T = unknown> extends StyledContainerProps {
159
159
  /** An array of records to be displayed in the grid. */
160
- records?: Prop<Record[]>;
160
+ records?: Prop<T[]>;
161
161
 
162
162
  /** Set to true to add a vertical scroll and a fixed header to the grid. */
163
163
  scrollable?: boolean;
@@ -298,7 +298,7 @@ interface GridProps extends StyledContainerProps {
298
298
  filterParams?: StructuredProp;
299
299
 
300
300
  /** Callback to create a filter function for given filter params. */
301
- onCreateFilter?: (filterParams: any, instance?: Instance) => (record: Record) => boolean;
301
+ onCreateFilter?: (filterParams: any, instance?: Instance) => (record: T) => boolean;
302
302
 
303
303
  /** Enable infinite scrolling */
304
304
  infinite?: boolean;
@@ -337,7 +337,7 @@ interface GridProps extends StyledContainerProps {
337
337
  onBeforeCellEdit?: string | ((change: GridCellBeforeEditInfo, record: DataAdapterRecord) => any);
338
338
 
339
339
  /** A callback function which is executed after a cell has been successfully edited. */
340
- onCellEdited?: string | ((change: GridCellEditInfo, record: DataAdapterRecord) => void);
340
+ onCellEdited?: string | ((change: GridCellEditInfo<T>, record: DataAdapterRecord) => void);
341
341
 
342
342
  /** A callback function which is executed after a column has been resized. */
343
343
  onColumnResize?: (data: { width: number; column: Record }, instance: Instance) => void;
@@ -349,7 +349,7 @@ interface GridProps extends StyledContainerProps {
349
349
  onCreateIsRecordSelectable?: (
350
350
  params: any,
351
351
  instance: Instance
352
- ) => (record: Record, options?: { range?: boolean; toggle?: boolean }) => boolean;
352
+ ) => (record: T, options?: { range?: boolean; toggle?: boolean }) => boolean;
353
353
 
354
354
  /** Parameters whose change will cause scroll to be reset. */
355
355
  scrollResetParams?: StructuredProp;
@@ -380,10 +380,10 @@ interface GridProps extends StyledContainerProps {
380
380
  * Accepts new records as a first argument.
381
381
  * If onCreateFilter callback is defined, filtered records can be retrieved using this callback.
382
382
  */
383
- onTrackMappedRecords?: string | ((records: Record[], instance: Instance) => void);
383
+ onTrackMappedRecords?: string | ((records: T[], instance: Instance) => void);
384
384
 
385
385
  /** Callback to create a function that can be used to check whether a record is draggable. */
386
- onCreateIsRecordDraggable?: (params: any, instance: Instance) => (record: Record) => boolean;
386
+ onCreateIsRecordDraggable?: (params: any, instance: Instance) => (record: T) => boolean;
387
387
  }
388
388
 
389
389
  interface GridCellInfo {
@@ -395,9 +395,9 @@ interface GridCellBeforeEditInfo extends GridCellInfo {
395
395
  data: any;
396
396
  }
397
397
 
398
- interface GridCellEditInfo extends GridCellInfo {
399
- oldData: any;
400
- newData: any;
398
+ interface GridCellEditInfo<T> extends GridCellInfo {
399
+ oldData: T;
400
+ newData: T;
401
401
  }
402
402
 
403
- export class Grid extends Widget<GridProps> {}
403
+ export class Grid<T = unknown> extends Widget<GridProps<T>> {}