@slickgrid-universal/custom-tooltip-plugin 2.4.1 → 2.6.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slickCustomTooltip.d.ts","sourceRoot":"","sources":["../../src/slickCustomTooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,EAGzB,MAAM,EACN,gBAAgB,EAEhB,mBAAmB,EAEnB,SAAS,EAET,UAAU,EAEV,UAAU,EAEV,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,SAAS,EAET,YAAY,EACb,MAAM,6BAA6B,CAAC;AAKrC,KAAK,QAAQ,GAAG,YAAY,GAAG,qBAAqB,GAAG,wBAAwB,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,kBAAkB;IAC7B,SAAS,CAAC,aAAa,CAAC,EAAE,mBAAmB,CAAC;IAC9C,SAAS,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,CAAC;IAClD,SAAS,CAAC,YAAY,CAAC,EAAE,cAAc,CAAC;IACxC,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAgB;IAC7C,SAAS,CAAC,mBAAmB,CAAC,EAAE,yBAAyB,CAAC;IAC1D,SAAS,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IACtC,SAAS,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,IAAI,CAAQ;IAC3C,SAAS,CAAC,cAAc,CAAC,EAAE,aAAa,GAAG,IAAI,CAAQ;IACvD,SAAS,CAAC,WAAW,CAAC,EAAE,cAAc,CAAC;IACvC,SAAS,CAAC,eAAe,2BAQA;IACzB,SAAS,CAAC,KAAK,EAAG,SAAS,CAAC;IAC5B,SAAS,CAAC,aAAa,EAAE,iBAAiB,CAAC;IAC3C,IAAI,EAAE,eAAe,CAA4B;;IAMjD,IAAI,YAAY,IAAI,mBAAmB,GAAG,SAAS,CA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,oBAAoB,CAAC,eAAe,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;KAAE,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;IAoC9J,SAAS,CAAC,sBAAsB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;KAAE,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI;IAsDpN;;;;;;OAMG;IACH,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;KAAE;IAmDzD;;;OAGG;IACH,SAAS,CAAC,0BAA0B,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM;CAa1F"}
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@slickgrid-universal/custom-tooltip-plugin",
3
- "version": "2.4.1",
3
+ "version": "2.6.0",
4
4
  "description": "A plugin to add Custom Tooltip when hovering a cell, it subscribes to the cell",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "exports": {
8
8
  ".": {
9
- "browser": "./dist/esm/index.js",
10
- "import": "./dist/esm/index.d.ts",
11
- "require": "./dist/commonjs/index.js"
9
+ "import": "./dist/esm/index.js",
10
+ "require": "./dist/commonjs/index.js",
11
+ "default": "./dist/esm/index.js"
12
12
  },
13
13
  "./*": "./*"
14
14
  },
15
15
  "typesVersions": {
16
16
  "*": {
17
17
  "*": [
18
- "./dist/esm/index.d.ts"
18
+ "./dist/types/index.d.ts"
19
19
  ]
20
20
  }
21
21
  },
22
- "types": "dist/esm/index.d.ts",
22
+ "types": "dist/types/index.d.ts",
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
@@ -43,8 +43,8 @@
43
43
  "not dead"
44
44
  ],
45
45
  "dependencies": {
46
- "@slickgrid-universal/common": "~2.4.1",
47
- "dompurify": "^2.4.3"
46
+ "@slickgrid-universal/common": "~2.6.0",
47
+ "dompurify": "^3.0.0"
48
48
  },
49
- "gitHead": "e62c2da0d9d1c8e97462f4125bfdf735d4e4782d"
49
+ "gitHead": "9cddf3ee91a91ca829d0ced99c1f20f6d0e9941f"
50
50
  }
@@ -1 +0,0 @@
1
- export * from './slickCustomTooltip';
@@ -1,109 +0,0 @@
1
- import { CancellablePromiseWrapper, Column, ContainerService, CustomTooltipOption, Formatter, GridOption, RxJsFacade, SharedService, SlickDataView, SlickEventData, SlickEventHandler, SlickGrid, Subscription } from '@slickgrid-universal/common';
2
- /**
3
- * A plugin to add Custom Tooltip when hovering a cell, it subscribes to the cell "onMouseEnter" and "onMouseLeave" events.
4
- * The "customTooltip" is defined in the Column Definition OR Grid Options (the first found will have priority over the second)
5
- * To specify a tooltip when hovering a cell, extend the column definition like so:
6
- *
7
- * Available plugin options (same options are available in both column definition and/or grid options)
8
- * Example 1 - via Column Definition
9
- * this.columnDefinitions = [
10
- * {
11
- * id: "action", name: "Action", field: "action", formatter: fakeButtonFormatter,
12
- * customTooltip: {
13
- * formatter: tooltipTaskFormatter,
14
- * usabilityOverride: (args) => !!(args.dataContext.id % 2) // show it only every second row
15
- * }
16
- * }
17
- * ];
18
- *
19
- * OR Example 2 - via Grid Options (for all columns), NOTE: the column definition tooltip options will win over the options defined in the grid options
20
- * this.gridOptions = {
21
- * enableCellNavigation: true,
22
- * customTooltip: {
23
- * },
24
- * };
25
- */
26
- export declare class SlickCustomTooltip {
27
- protected _addonOptions?: CustomTooltipOption;
28
- protected _cellAddonOptions?: CustomTooltipOption;
29
- protected _cellNodeElm?: HTMLDivElement;
30
- protected _cancellablePromise?: CancellablePromiseWrapper;
31
- protected _observable$?: Subscription;
32
- protected _rxjs?: RxJsFacade | null;
33
- protected _sharedService?: SharedService | null;
34
- protected _tooltipElm?: HTMLDivElement;
35
- protected _defaultOptions: CustomTooltipOption<any>;
36
- protected _grid: SlickGrid;
37
- protected _eventHandler: SlickEventHandler;
38
- name: 'CustomTooltip';
39
- constructor();
40
- get addonOptions(): CustomTooltipOption | undefined;
41
- get cancellablePromise(): CancellablePromiseWrapper<any> | undefined;
42
- get cellAddonOptions(): CustomTooltipOption | undefined;
43
- get className(): string;
44
- get dataView(): SlickDataView;
45
- /** Getter for the Grid Options pulled through the Grid Object */
46
- get gridOptions(): GridOption;
47
- /** Getter for the grid uid */
48
- get gridUid(): string;
49
- get gridUidSelector(): string;
50
- get tooltipElm(): HTMLDivElement | undefined;
51
- addRxJsResource(rxjs: RxJsFacade): void;
52
- init(grid: SlickGrid, containerService: ContainerService): void;
53
- dispose(): void;
54
- /**
55
- * hide (remove) tooltip from the DOM, it will also remove it from the DOM and also cancel any pending requests (as mentioned below).
56
- * When using async process, it will also cancel any opened Promise/Observable that might still be pending.
57
- */
58
- hideTooltip(): void;
59
- getOptions(): CustomTooltipOption | undefined;
60
- setOptions(newOptions: CustomTooltipOption): void;
61
- /**
62
- * Async process callback will hide any prior tooltip & then merge the new result with the item `dataContext` under a `__params` property
63
- * (unless a new prop name is provided) to provice as dataContext object to the asyncPostFormatter.
64
- */
65
- protected asyncProcessCallback(asyncResult: any, cell: {
66
- row: number;
67
- cell: number;
68
- }, value: any, columnDef: Column, dataContext: any): void;
69
- /** depending on the selector type, execute the necessary handler code */
70
- protected handleOnHeaderMouseEnterByType(event: SlickEventData, args: any, selector: string): void;
71
- protected handleOnMouseEnter(event: SlickEventData): Promise<void>;
72
- /**
73
- * Parse the Custom Formatter (when provided) or return directly the text when it is already a string.
74
- * We will also sanitize the text in both cases before returning it so that it can be used safely.
75
- */
76
- protected parseFormatterAndSanitize(formatterOrText: Formatter | string | undefined, cell: {
77
- row: number;
78
- cell: number;
79
- }, value: any, columnDef: Column, item: unknown): string;
80
- /**
81
- * Parse the cell formatter and assume it might be html
82
- * then create a temporary html element to easily retrieve the first [title=""] attribute text content
83
- * also clear the "title" attribute from the grid div text content so that it won't show also as a 2nd browser tooltip
84
- */
85
- protected renderRegularTooltip(formatterOrText: Formatter | string | undefined, cell: {
86
- row: number;
87
- cell: number;
88
- }, value: any, columnDef: Column, item: any): void;
89
- protected renderTooltipFormatter(formatter: Formatter | string | undefined, cell: {
90
- row: number;
91
- cell: number;
92
- }, value: any, columnDef: Column, item: unknown, tooltipText?: string, inputTitleElm?: Element | null): void;
93
- /**
94
- * Reposition the Tooltip to be top-left position over the cell.
95
- * By default we use an "auto" mode which will allow to position the Tooltip to the best logical position in the window, also when we mention position, we are talking about the relative position against the grid cell.
96
- * We can assume that in 80% of the time the default position is top-right, the default is "auto" but we can also override it and use a specific position.
97
- * Most of the time positioning of the tooltip will be to the "top-right" of the cell is ok but if our column is completely on the right side then we'll want to change the position to "left" align.
98
- * Same goes for the top/bottom position, Most of the time positioning the tooltip to the "top" but if we are hovering a cell at the top of the grid and there's no room to display it then we might need to reposition to "bottom" instead.
99
- */
100
- protected reposition(cell: {
101
- row: number;
102
- cell: number;
103
- }): void;
104
- /**
105
- * swap and copy the "title" attribute into a new custom attribute then clear the "title" attribute
106
- * from the grid div text content so that it won't show also as a 2nd browser tooltip
107
- */
108
- protected swapAndClearTitleAttribute(inputTitleElm?: Element | null, tooltipText?: string): void;
109
- }