@handsontable/angular-wrapper 16.2.0 → 17.0.0-rc10

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 (31) hide show
  1. package/README.md +1 -11
  2. package/esm2022/lib/editor/custom-editor-placeholder.component.mjs +8 -5
  3. package/esm2022/lib/editor/editor-factory-adapter.mjs +140 -0
  4. package/esm2022/lib/editor/hot-cell-editor-advanced.component.mjs +92 -0
  5. package/esm2022/lib/editor/hot-cell-editor.component.mjs +2 -1
  6. package/esm2022/lib/editor/models/factory-editor-properties.mjs +2 -0
  7. package/esm2022/lib/editor/models/keyboard-shortcut-config.mjs +2 -0
  8. package/esm2022/lib/hot-table.component.mjs +15 -5
  9. package/esm2022/lib/hot-table.module.mjs +2 -2
  10. package/esm2022/lib/models/column-settings.mjs +1 -1
  11. package/esm2022/lib/renderer/hot-cell-renderer-advanced.component.mjs +55 -0
  12. package/esm2022/lib/renderer/hot-dynamic-renderer-component.service.mjs +62 -10
  13. package/esm2022/lib/services/hot-global-config.service.mjs +1 -2
  14. package/esm2022/lib/services/hot-settings-resolver.service.mjs +54 -17
  15. package/esm2022/public-api.mjs +4 -1
  16. package/fesm2022/handsontable-angular-wrapper.mjs +504 -128
  17. package/fesm2022/handsontable-angular-wrapper.mjs.map +1 -1
  18. package/lib/editor/custom-editor-placeholder.component.d.ts +4 -2
  19. package/lib/editor/editor-factory-adapter.d.ts +13 -0
  20. package/lib/editor/hot-cell-editor-advanced.component.d.ts +74 -0
  21. package/lib/editor/hot-cell-editor.component.d.ts +1 -0
  22. package/lib/editor/models/factory-editor-properties.d.ts +24 -0
  23. package/lib/editor/models/keyboard-shortcut-config.d.ts +13 -0
  24. package/lib/hot-table.component.d.ts +3 -2
  25. package/lib/models/column-settings.d.ts +7 -2
  26. package/lib/renderer/hot-cell-renderer-advanced.component.d.ts +33 -0
  27. package/lib/renderer/hot-dynamic-renderer-component.service.d.ts +19 -0
  28. package/lib/services/hot-global-config.service.d.ts +5 -0
  29. package/lib/services/hot-settings-resolver.service.d.ts +3 -0
  30. package/package.json +1 -1
  31. package/public-api.d.ts +3 -0
@@ -0,0 +1,33 @@
1
+ import Handsontable from 'handsontable/base';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Abstract base component for creating advanced custom cell renderer components for Handsontable.
5
+ *
6
+ * This class provides a common interface and properties required by any custom cell renderer.
7
+ *
8
+ * @template TValue - The type of the component renderer.
9
+ * @template TProps - The type of additional renderer properties.
10
+ */
11
+ export declare abstract class HotCellRendererAdvancedComponent<TValue extends string | number | boolean | Record<string, any> | Array<any> = string, TProps extends {} = any> {
12
+ static readonly RENDERER_MARKER: unique symbol;
13
+ value: TValue;
14
+ instance: Handsontable;
15
+ td: HTMLTableCellElement;
16
+ row: number;
17
+ col: number;
18
+ prop: string;
19
+ /**
20
+ * The cell properties provided by Handsontable, extended with optional renderer-specific properties.
21
+ */
22
+ cellProperties: Handsontable.CellProperties & {
23
+ rendererProps?: TProps;
24
+ };
25
+ /**
26
+ * Retrieves the renderer-specific properties from the cell properties.
27
+ *
28
+ * @returns The additional properties for the renderer.
29
+ */
30
+ getProps(): TProps;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<HotCellRendererAdvancedComponent<any, any>, never>;
32
+ static ɵcmp: i0.ɵɵComponentDeclaration<HotCellRendererAdvancedComponent<any, any>, "hot-cell-renderer-advanced", never, { "value": { "alias": "value"; "required": false; }; "instance": { "alias": "instance"; "required": false; }; "td": { "alias": "td"; "required": false; }; "row": { "alias": "row"; "required": false; }; "col": { "alias": "col"; "required": false; }; "prop": { "alias": "prop"; "required": false; }; "cellProperties": { "alias": "cellProperties"; "required": false; }; }, {}, never, never, false, never>;
33
+ }
@@ -1,8 +1,10 @@
1
1
  import { ApplicationRef, ComponentRef, EnvironmentInjector, TemplateRef, Type } from '@angular/core';
2
2
  import Handsontable from 'handsontable/base';
3
3
  import { HotCellRendererComponent } from './hot-cell-renderer.component';
4
+ import { HotCellRendererAdvancedComponent } from './hot-cell-renderer-advanced.component';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare const INVALID_RENDERER_WARNING: string;
7
+ export declare const INVALID_ADVANCED_RENDERER_WARNING: string;
6
8
  /**
7
9
  * Type guard that checks if the given object is a TemplateRef.
8
10
  *
@@ -17,6 +19,13 @@ export declare function isTemplateRef<T>(obj: any): obj is TemplateRef<T>;
17
19
  * @returns True if the object is a HotCellRendererComponent, false otherwise.
18
20
  */
19
21
  export declare function isHotCellRendererComponent(obj: any): obj is Type<HotCellRendererComponent>;
22
+ /**
23
+ * Type guard to check if an object is an instance of HotCellRendererAdvancedComponent.
24
+ *
25
+ * @param obj - The object to check.
26
+ * @returns True if the object is a HotCellRendererAdvancedComponent, false otherwise.
27
+ */
28
+ export declare function isAdvancedHotCellRendererComponent(obj: any): obj is Type<HotCellRendererAdvancedComponent>;
20
29
  /**
21
30
  * Service for dynamically creating Angular components or templates as custom renderers for Handsontable.
22
31
  *
@@ -41,6 +50,16 @@ export declare class DynamicComponentService {
41
50
  * @returns A renderer function that can be used in Handsontable's configuration.
42
51
  */
43
52
  createRendererFromComponent(component: Type<HotCellRendererComponent> | TemplateRef<any>, componentProps?: Record<string, any>, register?: boolean): (instance: Handsontable.Core, td: HTMLTableCellElement, row: number, col: number, prop: string | number, value: any, cellProperties: Handsontable.CellProperties) => HTMLTableCellElement;
53
+ /**
54
+ * Creates a custom renderer function using rendererFactory from Handsontable.
55
+ * This is an alternative implementation that uses the factory pattern.
56
+ *
57
+ * @param component - The Angular component type to use as renderer.
58
+ * @param componentProps - An object containing additional properties to use by the renderer.
59
+ * @param register - If true, registers the renderer with Handsontable using the component's name.
60
+ * @returns A renderer function that can be used in Handsontable's configuration.
61
+ */
62
+ createRendererWithFactory(component: Type<HotCellRendererAdvancedComponent>, componentProps?: Record<string, any>, register?: boolean): (instance: Handsontable.Core, td: HTMLTableCellElement, row: number, column: number, prop: string | number, value: any, cellProperties: Handsontable.CellProperties) => void;
44
63
  /**
45
64
  * Attaches an embedded view created from a TemplateRef to a given DOM element.
46
65
  *
@@ -30,6 +30,11 @@ export interface HotGlobalConfig {
30
30
  * The name of the theme to be used.
31
31
  */
32
32
  themeName?: ThemeName;
33
+ /**
34
+ * The theme to be used (ThemeBuilder instance or theme name string).
35
+ * When set, takes precedence over `themeName` for Handsontable 17+.
36
+ */
37
+ theme?: object | string;
33
38
  /**
34
39
  * The language code to be used for localization.
35
40
  * For example, 'en-US', 'pl-PL', etc.
@@ -40,8 +40,11 @@ export declare class HotSettingsResolver {
40
40
  private updateColumnValidatorForGivenCustomValidator;
41
41
  private isCustomValidatorFn;
42
42
  private isEditorComponentRefType;
43
+ private isAdvancedEditorComponentRefType;
43
44
  private isRendererComponentRefType;
45
+ private isAdvancedRendererComponentRefType;
44
46
  private isTemplateRef;
47
+ private isCustomRenderer;
45
48
  static ɵfac: i0.ɵɵFactoryDeclaration<HotSettingsResolver, never>;
46
49
  static ɵprov: i0.ɵɵInjectableDeclaration<HotSettingsResolver>;
47
50
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@handsontable/angular-wrapper","version":"16.2.0","description":"Best Data Grid for Angular with Spreadsheet Look and Feel.","author":"Handsoncode <hello@handsoncode.net> (https://handsoncode.net)","license":"SEE LICENSE IN LICENSE.txt","homepage":"https://handsontable.com","keywords":["handsontable","component","data","table","grid","data table","data grid","spreadsheet","sheet","excel","angular","angular component","angular grid","wrapper","pro","enterprise","sort","formulas","filter","search","conditional formatting","csv"],"repository":{"type":"git","url":"https://github.com/handsontable/handsontable.git"},"bugs":{"url":"https://github.com/handsontable/handsontable/issues"},"peerDependencies":{"@angular/animations":">=16.0.0","@angular/common":">=16.0.0","@angular/compiler":">=16.0.0","@angular/core":">=16.0.0","@angular/forms":">=16.0.0","@angular/platform-browser":">=16.0.0","@angular/platform-browser-dynamic":">=16.0.0","@angular/router":">=16.0.0","handsontable":"^16.0.0"},"publishConfig":{"directory":"dist/hot-table","linkDirectory":true},"module":"fesm2022/handsontable-angular-wrapper.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/handsontable-angular-wrapper.mjs","esm":"./esm2022/handsontable-angular-wrapper.mjs","default":"./fesm2022/handsontable-angular-wrapper.mjs"}},"sideEffects":false,"optionalDependencies":{"tslib":"^2.3.0"}}
1
+ {"name":"@handsontable/angular-wrapper","version":"17.0.0-rc10","description":"Best Data Grid for Angular with Spreadsheet Look and Feel.","author":"Handsoncode <hello@handsoncode.net> (https://handsoncode.net)","license":"SEE LICENSE IN LICENSE.txt","homepage":"https://handsontable.com","keywords":["handsontable","component","data","table","grid","data table","data grid","spreadsheet","sheet","excel","angular","angular component","angular grid","wrapper","pro","enterprise","sort","formulas","filter","search","conditional formatting","csv"],"repository":{"type":"git","url":"https://github.com/handsontable/handsontable.git"},"bugs":{"url":"https://github.com/handsontable/handsontable/issues"},"peerDependencies":{"@angular/animations":">=16.0.0","@angular/common":">=16.0.0","@angular/compiler":">=16.0.0","@angular/core":">=16.0.0","@angular/forms":">=16.0.0","@angular/platform-browser":">=16.0.0","@angular/platform-browser-dynamic":">=16.0.0","@angular/router":">=16.0.0","handsontable":"^17.0.0"},"publishConfig":{"directory":"dist/hot-table","linkDirectory":true},"module":"fesm2022/handsontable-angular-wrapper.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/handsontable-angular-wrapper.mjs","esm":"./esm2022/handsontable-angular-wrapper.mjs","default":"./fesm2022/handsontable-angular-wrapper.mjs"}},"sideEffects":false,"optionalDependencies":{"tslib":"^2.3.0"}}
package/public-api.d.ts CHANGED
@@ -5,5 +5,8 @@ export * from './lib/services/hot-global-config.service';
5
5
  export * from './lib/renderer/hot-dynamic-renderer-component.service';
6
6
  export * from './lib/renderer/hot-cell-renderer.component';
7
7
  export * from './lib/editor/hot-cell-editor.component';
8
+ export * from './lib/renderer/hot-cell-renderer-advanced.component';
9
+ export * from './lib/editor/hot-cell-editor-advanced.component';
10
+ export * from './lib/editor/models/keyboard-shortcut-config';
8
11
  export { GridSettings } from './lib/models/grid-settings';
9
12
  export { ColumnSettings, CustomValidatorFn } from './lib/models/column-settings';