@slickgrid-universal/custom-tooltip-plugin 3.7.1 → 4.0.0-alpha.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.
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SlickCustomTooltip = void 0;
4
4
  const common_1 = require("@slickgrid-universal/common");
5
+ const utils_1 = require("@slickgrid-universal/utils");
5
6
  /**
6
7
  * A plugin to add Custom Tooltip when hovering a cell, it subscribes to the cell "onMouseEnter" and "onMouseLeave" events.
7
8
  * The "customTooltip" is defined in the Column Definition OR Grid Options (the first found will have priority over the second)
@@ -28,6 +29,7 @@ const common_1 = require("@slickgrid-universal/common");
28
29
  */
29
30
  class SlickCustomTooltip {
30
31
  constructor() {
32
+ this.name = 'CustomTooltip';
31
33
  this._cellType = 'slick-cell';
32
34
  this._rxjs = null;
33
35
  this._sharedService = null;
@@ -40,8 +42,7 @@ class SlickCustomTooltip {
40
42
  regularTooltipWhiteSpace: 'pre-line',
41
43
  whiteSpace: 'normal',
42
44
  };
43
- this.name = 'CustomTooltip';
44
- this._eventHandler = new Slick.EventHandler();
45
+ this._eventHandler = new common_1.SlickEventHandler();
45
46
  }
46
47
  get addonOptions() {
47
48
  return this._addonOptions;
@@ -53,20 +54,18 @@ class SlickCustomTooltip {
53
54
  return this._cellAddonOptions;
54
55
  }
55
56
  get className() {
56
- var _a, _b;
57
- return (_b = (_a = this._cellAddonOptions) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : 'slick-custom-tooltip';
57
+ return this._cellAddonOptions?.className ?? 'slick-custom-tooltip';
58
58
  }
59
59
  get dataView() {
60
60
  return this._grid.getData() || {};
61
61
  }
62
62
  /** Getter for the Grid Options pulled through the Grid Object */
63
63
  get gridOptions() {
64
- return this._grid.getOptions() || {};
64
+ return this._grid?.getOptions() || {};
65
65
  }
66
66
  /** Getter for the grid uid */
67
67
  get gridUid() {
68
- var _a;
69
- return ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.getUID()) || '';
68
+ return this._grid?.getUID() || '';
70
69
  }
71
70
  get gridUidSelector() {
72
71
  return this.gridUid ? `.${this.gridUid}` : '';
@@ -78,11 +77,10 @@ class SlickCustomTooltip {
78
77
  this._rxjs = rxjs;
79
78
  }
80
79
  init(grid, containerService) {
81
- var _a, _b;
82
80
  this._grid = grid;
83
81
  this._rxjs = containerService.get('RxJsFacade');
84
82
  this._sharedService = containerService.get('SharedService');
85
- this._addonOptions = { ...this._defaultOptions, ...((_b = (_a = this._sharedService) === null || _a === void 0 ? void 0 : _a.gridOptions) === null || _b === void 0 ? void 0 : _b.customTooltip) };
83
+ this._addonOptions = { ...this._defaultOptions, ...(this._sharedService?.gridOptions?.customTooltip) };
86
84
  this._eventHandler
87
85
  .subscribe(grid.onMouseEnter, this.handleOnMouseEnter.bind(this))
88
86
  .subscribe(grid.onHeaderMouseEnter, (e, args) => this.handleOnHeaderMouseEnterByType(e, args, 'slick-header-column'))
@@ -102,11 +100,10 @@ class SlickCustomTooltip {
102
100
  * When using async process, it will also cancel any opened Promise/Observable that might still be pending.
103
101
  */
104
102
  hideTooltip() {
105
- var _a, _b;
106
- (_a = this._cancellablePromise) === null || _a === void 0 ? void 0 : _a.cancel();
107
- (_b = this._observable$) === null || _b === void 0 ? void 0 : _b.unsubscribe();
103
+ this._cancellablePromise?.cancel();
104
+ this._observable$?.unsubscribe();
108
105
  const prevTooltip = document.body.querySelector(`.${this.className}${this.gridUidSelector}`);
109
- prevTooltip === null || prevTooltip === void 0 ? void 0 : prevTooltip.remove();
106
+ prevTooltip?.remove();
110
107
  }
111
108
  getOptions() {
112
109
  return this._addonOptions;
@@ -122,10 +119,9 @@ class SlickCustomTooltip {
122
119
  * (unless a new prop name is provided) to provice as dataContext object to the asyncPostFormatter.
123
120
  */
124
121
  asyncProcessCallback(asyncResult, cell, value, columnDef, dataContext) {
125
- var _a, _b, _c;
126
122
  this.hideTooltip();
127
- const itemWithAsyncData = { ...dataContext, [(_b = (_a = this.addonOptions) === null || _a === void 0 ? void 0 : _a.asyncParamsPropName) !== null && _b !== void 0 ? _b : '__params']: asyncResult };
128
- if ((_c = this._cellAddonOptions) === null || _c === void 0 ? void 0 : _c.useRegularTooltip) {
123
+ const itemWithAsyncData = { ...dataContext, [this.addonOptions?.asyncParamsPropName ?? '__params']: asyncResult };
124
+ if (this._cellAddonOptions?.useRegularTooltip) {
129
125
  this.renderRegularTooltip(this._cellAddonOptions.asyncPostFormatter, cell, value, columnDef, itemWithAsyncData);
130
126
  }
131
127
  else {
@@ -134,14 +130,13 @@ class SlickCustomTooltip {
134
130
  }
135
131
  /** depending on the selector type, execute the necessary handler code */
136
132
  handleOnHeaderMouseEnterByType(event, args, selector) {
137
- var _a, _b, _c;
138
133
  this._cellType = selector;
139
134
  // before doing anything, let's remove any previous tooltip before
140
135
  // and cancel any opened Promise/Observable when using async
141
136
  this.hideTooltip();
142
137
  const cell = {
143
138
  row: -1, // negative row to avoid pulling any dataContext while rendering
144
- cell: this._grid.getColumns().findIndex((col) => { var _a, _b; return ((_b = (_a = args === null || args === void 0 ? void 0 : args.column) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '') === col.id; })
139
+ cell: this._grid.getColumns().findIndex((col) => (args?.column?.id ?? '') === col.id)
145
140
  };
146
141
  const columnDef = args.column;
147
142
  const item = {};
@@ -154,15 +149,15 @@ class SlickCustomTooltip {
154
149
  args.dataContext = item;
155
150
  args.grid = this._grid;
156
151
  args.type = isHeaderRowType ? 'header-row' : 'header';
157
- this._cellAddonOptions = { ...this._addonOptions, ...(columnDef === null || columnDef === void 0 ? void 0 : columnDef.customTooltip) };
158
- if ((columnDef === null || columnDef === void 0 ? void 0 : columnDef.disableTooltip) || (typeof ((_a = this._cellAddonOptions) === null || _a === void 0 ? void 0 : _a.usabilityOverride) === 'function' && !this._cellAddonOptions.usabilityOverride(args))) {
152
+ this._cellAddonOptions = { ...this._addonOptions, ...(columnDef?.customTooltip) };
153
+ if (columnDef?.disableTooltip || (typeof this._cellAddonOptions?.usabilityOverride === 'function' && !this._cellAddonOptions.usabilityOverride(args))) {
159
154
  return;
160
155
  }
161
156
  if (columnDef && event.target) {
162
157
  this._cellNodeElm = event.target.closest(`.${selector}`);
163
158
  const formatter = isHeaderRowType ? this._cellAddonOptions.headerRowFormatter : this._cellAddonOptions.headerFormatter;
164
- if (((_b = this._cellAddonOptions) === null || _b === void 0 ? void 0 : _b.useRegularTooltip) || !formatter) {
165
- const formatterOrText = !isHeaderRowType ? columnDef.name : ((_c = this._cellAddonOptions) === null || _c === void 0 ? void 0 : _c.useRegularTooltip) ? null : formatter;
159
+ if (this._cellAddonOptions?.useRegularTooltip || !formatter) {
160
+ const formatterOrText = !isHeaderRowType ? columnDef.name : this._cellAddonOptions?.useRegularTooltip ? null : formatter;
166
161
  this.renderRegularTooltip(formatterOrText, cell, null, columnDef, item);
167
162
  }
168
163
  else if (this._cellNodeElm && typeof formatter === 'function') {
@@ -171,38 +166,37 @@ class SlickCustomTooltip {
171
166
  }
172
167
  }
173
168
  async handleOnMouseEnter(event) {
174
- var _a, _b, _c, _d, _e, _f, _g, _h;
175
169
  this._cellType = 'slick-cell';
176
170
  // before doing anything, let's remove any previous tooltip before
177
171
  // and cancel any opened Promise/Observable when using async
178
172
  this.hideTooltip();
179
173
  if (event && this._grid) {
180
174
  // get cell only when it's possible (ie, Composite Editor will not be able to get cell and so it will never show any tooltip)
181
- const targetClassName = (_b = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.closest('.slick-cell')) === null || _b === void 0 ? void 0 : _b.className;
175
+ const targetClassName = event?.target?.closest('.slick-cell')?.className;
182
176
  const cell = (targetClassName && /l\d+/.exec(targetClassName || '')) ? this._grid.getCellFromEvent(event) : null;
183
177
  if (cell) {
184
178
  const item = this.dataView ? this.dataView.getItem(cell.row) : this._grid.getDataItem(cell.row);
185
179
  const columnDef = this._grid.getColumns()[cell.cell];
186
180
  this._cellNodeElm = this._grid.getCellNode(cell.row, cell.cell);
187
181
  if (item && columnDef) {
188
- this._cellAddonOptions = { ...this._addonOptions, ...(columnDef === null || columnDef === void 0 ? void 0 : columnDef.customTooltip) };
189
- if ((columnDef === null || columnDef === void 0 ? void 0 : columnDef.disableTooltip) || (typeof ((_c = this._cellAddonOptions) === null || _c === void 0 ? void 0 : _c.usabilityOverride) === 'function' && !this._cellAddonOptions.usabilityOverride({ cell: cell.cell, row: cell.row, dataContext: item, column: columnDef, grid: this._grid, type: 'cell' }))) {
182
+ this._cellAddonOptions = { ...this._addonOptions, ...(columnDef?.customTooltip) };
183
+ if (columnDef?.disableTooltip || (typeof this._cellAddonOptions?.usabilityOverride === 'function' && !this._cellAddonOptions.usabilityOverride({ cell: cell.cell, row: cell.row, dataContext: item, column: columnDef, grid: this._grid, type: 'cell' }))) {
190
184
  return;
191
185
  }
192
186
  const value = item.hasOwnProperty(columnDef.field) ? item[columnDef.field] : null;
193
187
  // when cell is currently lock for editing, we'll force a tooltip title search
194
188
  const cellValue = this._grid.getEditorLock().isActive() ? null : value;
195
189
  // when there aren't any formatter OR when user specifically want to use a regular tooltip (via "title" attribute)
196
- if ((this._cellAddonOptions.useRegularTooltip && !((_d = this._cellAddonOptions) === null || _d === void 0 ? void 0 : _d.asyncProcess)) || !((_e = this._cellAddonOptions) === null || _e === void 0 ? void 0 : _e.formatter)) {
190
+ if ((this._cellAddonOptions.useRegularTooltip && !this._cellAddonOptions?.asyncProcess) || !this._cellAddonOptions?.formatter) {
197
191
  this.renderRegularTooltip(columnDef.formatter, cell, cellValue, columnDef, item);
198
192
  }
199
193
  else {
200
194
  // when we aren't using regular tooltip and we do have a tooltip formatter, let's render it
201
- if (typeof ((_f = this._cellAddonOptions) === null || _f === void 0 ? void 0 : _f.formatter) === 'function') {
195
+ if (typeof this._cellAddonOptions?.formatter === 'function') {
202
196
  this.renderTooltipFormatter(this._cellAddonOptions.formatter, cell, cellValue, columnDef, item);
203
197
  }
204
198
  // when tooltip is an Async (delayed, e.g. with a backend API call)
205
- if (typeof ((_g = this._cellAddonOptions) === null || _g === void 0 ? void 0 : _g.asyncProcess) === 'function') {
199
+ if (typeof this._cellAddonOptions?.asyncProcess === 'function') {
206
200
  const asyncProcess = this._cellAddonOptions.asyncProcess(cell.row, cell.cell, value, columnDef, item, this._grid);
207
201
  if (!this._cellAddonOptions.asyncPostFormatter) {
208
202
  console.error(`[Slickgrid-Universal] when using "asyncProcess" with Custom Tooltip, you must also provide an "asyncPostFormatter" formatter.`);
@@ -219,7 +213,7 @@ class SlickCustomTooltip {
219
213
  }
220
214
  });
221
215
  }
222
- else if ((_h = this._rxjs) === null || _h === void 0 ? void 0 : _h.isObservable(asyncProcess)) {
216
+ else if (this._rxjs?.isObservable(asyncProcess)) {
223
217
  const rxjs = this._rxjs;
224
218
  this._observable$ = asyncProcess
225
219
  .pipe(
@@ -238,9 +232,9 @@ class SlickCustomTooltip {
238
232
  */
239
233
  parseFormatterAndSanitize(formatterOrText, cell, value, columnDef, item) {
240
234
  if (typeof formatterOrText === 'function') {
241
- const tooltipText = formatterOrText(cell.row, cell.cell, value, columnDef, item, this._grid);
242
- const formatterText = (typeof tooltipText === 'object' && (tooltipText === null || tooltipText === void 0 ? void 0 : tooltipText.text)) ? tooltipText.text : (typeof tooltipText === 'string' ? tooltipText : '');
243
- return (0, common_1.sanitizeTextByAvailableSanitizer)(this.gridOptions, formatterText);
235
+ const tooltipResult = formatterOrText(cell.row, cell.cell, value, columnDef, item, this._grid);
236
+ const formatterText = (0, utils_1.isPrimitiveOrHTML)(tooltipResult) ? tooltipResult : tooltipResult.html || tooltipResult.text;
237
+ return (0, common_1.sanitizeTextByAvailableSanitizer)(this.gridOptions, (formatterText instanceof HTMLElement ? formatterText.textContent : formatterText) || '');
244
238
  }
245
239
  else if (typeof formatterOrText === 'string') {
246
240
  return (0, common_1.sanitizeTextByAvailableSanitizer)(this.gridOptions, formatterOrText);
@@ -253,31 +247,30 @@ class SlickCustomTooltip {
253
247
  * also clear the "title" attribute from the grid div text content so that it won't show also as a 2nd browser tooltip
254
248
  */
255
249
  renderRegularTooltip(formatterOrText, cell, value, columnDef, item) {
256
- var _a, _b, _c, _d, _e, _f, _g, _h;
257
250
  const tmpDiv = document.createElement('div');
258
- tmpDiv.innerHTML = this.parseFormatterAndSanitize(formatterOrText, cell, value, columnDef, item);
259
- let tooltipText = (_a = columnDef === null || columnDef === void 0 ? void 0 : columnDef.toolTip) !== null && _a !== void 0 ? _a : '';
251
+ this._grid.applyHtmlCode(tmpDiv, this.parseFormatterAndSanitize(formatterOrText, cell, value, columnDef, item));
252
+ let tooltipText = columnDef?.toolTip ?? '';
260
253
  let tmpTitleElm;
261
254
  if (!tooltipText) {
262
- if (this._cellType === 'slick-cell' && this._cellNodeElm && (this._cellNodeElm.clientWidth < this._cellNodeElm.scrollWidth) && !((_b = this._cellAddonOptions) === null || _b === void 0 ? void 0 : _b.useRegularTooltipFromFormatterOnly)) {
263
- tooltipText = (_d = (_c = this._cellNodeElm.textContent) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '';
264
- if (((_e = this._cellAddonOptions) === null || _e === void 0 ? void 0 : _e.tooltipTextMaxLength) && tooltipText.length > ((_f = this._cellAddonOptions) === null || _f === void 0 ? void 0 : _f.tooltipTextMaxLength)) {
255
+ if (this._cellType === 'slick-cell' && this._cellNodeElm && (this._cellNodeElm.clientWidth < this._cellNodeElm.scrollWidth) && !this._cellAddonOptions?.useRegularTooltipFromFormatterOnly) {
256
+ tooltipText = this._cellNodeElm.textContent?.trim() ?? '';
257
+ if (this._cellAddonOptions?.tooltipTextMaxLength && tooltipText.length > this._cellAddonOptions?.tooltipTextMaxLength) {
265
258
  tooltipText = tooltipText.substring(0, this._cellAddonOptions.tooltipTextMaxLength - 3) + '...';
266
259
  }
267
260
  tmpTitleElm = this._cellNodeElm;
268
261
  }
269
262
  else {
270
- if ((_g = this._cellAddonOptions) === null || _g === void 0 ? void 0 : _g.useRegularTooltipFromFormatterOnly) {
263
+ if (this._cellAddonOptions?.useRegularTooltipFromFormatterOnly) {
271
264
  tmpTitleElm = tmpDiv.querySelector('[title], [data-slick-tooltip]');
272
265
  }
273
266
  else {
274
- tmpTitleElm = (0, common_1.findFirstElementAttribute)(this._cellNodeElm, ['title', 'data-slick-tooltip']) ? this._cellNodeElm : tmpDiv.querySelector('[title], [data-slick-tooltip]');
275
- if ((!tmpTitleElm || !(0, common_1.findFirstElementAttribute)(tmpTitleElm, ['title', 'data-slick-tooltip'])) && this._cellNodeElm) {
267
+ tmpTitleElm = (0, common_1.findFirstAttribute)(this._cellNodeElm, ['title', 'data-slick-tooltip']) ? this._cellNodeElm : tmpDiv.querySelector('[title], [data-slick-tooltip]');
268
+ if ((!tmpTitleElm || !(0, common_1.findFirstAttribute)(tmpTitleElm, ['title', 'data-slick-tooltip'])) && this._cellNodeElm) {
276
269
  tmpTitleElm = this._cellNodeElm.querySelector('[title], [data-slick-tooltip]');
277
270
  }
278
271
  }
279
- if (!tooltipText || (typeof formatterOrText === 'function' && ((_h = this._cellAddonOptions) === null || _h === void 0 ? void 0 : _h.useRegularTooltipFromFormatterOnly))) {
280
- tooltipText = (0, common_1.findFirstElementAttribute)(tmpTitleElm, ['title', 'data-slick-tooltip']) || '';
272
+ if (!tooltipText || (typeof formatterOrText === 'function' && this._cellAddonOptions?.useRegularTooltipFromFormatterOnly)) {
273
+ tooltipText = (0, common_1.findFirstAttribute)(tmpTitleElm, ['title', 'data-slick-tooltip']) || '';
281
274
  }
282
275
  }
283
276
  }
@@ -288,7 +281,6 @@ class SlickCustomTooltip {
288
281
  this.swapAndClearTitleAttribute(tmpTitleElm, tooltipText);
289
282
  }
290
283
  renderTooltipFormatter(formatter, cell, value, columnDef, item, tooltipText, inputTitleElm) {
291
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
292
284
  // create the tooltip DOM element with the text returned by the Formatter
293
285
  this._tooltipElm = (0, common_1.createDomElement)('div', { className: this.className });
294
286
  this._tooltipElm.classList.add(this.gridUid);
@@ -298,27 +290,27 @@ class SlickCustomTooltip {
298
290
  // that can happen when user has a formatter but is currently editing and in that case we want the new value
299
291
  // ie: when user is currently editing and uses the Slider, when dragging its value is changing, so we wish to use the editing value instead of the previous cell value.
300
292
  if (value === null || value === undefined) {
301
- const tmpTitleElm = (_a = this._cellNodeElm) === null || _a === void 0 ? void 0 : _a.querySelector('[title], [data-slick-tooltip]');
302
- value = (0, common_1.findFirstElementAttribute)(tmpTitleElm, ['title', 'data-slick-tooltip']) || value;
293
+ const tmpTitleElm = this._cellNodeElm?.querySelector('[title], [data-slick-tooltip]');
294
+ value = (0, common_1.findFirstAttribute)(tmpTitleElm, ['title', 'data-slick-tooltip']) || value;
303
295
  }
304
296
  let outputText = tooltipText || this.parseFormatterAndSanitize(formatter, cell, value, columnDef, item) || '';
305
- outputText = (((_b = this._cellAddonOptions) === null || _b === void 0 ? void 0 : _b.tooltipTextMaxLength) && outputText.length > this._cellAddonOptions.tooltipTextMaxLength) ? outputText.substring(0, this._cellAddonOptions.tooltipTextMaxLength - 3) + '...' : outputText;
297
+ outputText = (this._cellAddonOptions?.tooltipTextMaxLength && outputText.length > this._cellAddonOptions.tooltipTextMaxLength) ? outputText.substring(0, this._cellAddonOptions.tooltipTextMaxLength - 3) + '...' : outputText;
306
298
  let finalOutputText = '';
307
- if (!tooltipText || ((_c = this._cellAddonOptions) === null || _c === void 0 ? void 0 : _c.renderRegularTooltipAsHtml)) {
299
+ if (!tooltipText || this._cellAddonOptions?.renderRegularTooltipAsHtml) {
308
300
  finalOutputText = (0, common_1.sanitizeTextByAvailableSanitizer)(this.gridOptions, outputText);
309
- this._tooltipElm.innerHTML = finalOutputText;
310
- this._tooltipElm.style.whiteSpace = (_e = (_d = this._cellAddonOptions) === null || _d === void 0 ? void 0 : _d.whiteSpace) !== null && _e !== void 0 ? _e : this._defaultOptions.whiteSpace;
301
+ this._grid.applyHtmlCode(this._tooltipElm, finalOutputText);
302
+ this._tooltipElm.style.whiteSpace = this._cellAddonOptions?.whiteSpace ?? this._defaultOptions.whiteSpace;
311
303
  }
312
304
  else {
313
305
  finalOutputText = outputText || '';
314
306
  this._tooltipElm.textContent = finalOutputText;
315
- this._tooltipElm.style.whiteSpace = (_g = (_f = this._cellAddonOptions) === null || _f === void 0 ? void 0 : _f.regularTooltipWhiteSpace) !== null && _g !== void 0 ? _g : this._defaultOptions.regularTooltipWhiteSpace; // use `pre` so that sequences of white space are collapsed. Lines are broken at newline characters
307
+ this._tooltipElm.style.whiteSpace = this._cellAddonOptions?.regularTooltipWhiteSpace ?? this._defaultOptions.regularTooltipWhiteSpace; // use `pre` so that sequences of white space are collapsed. Lines are broken at newline characters
316
308
  }
317
309
  // optional max height/width of the tooltip container
318
- if ((_h = this._cellAddonOptions) === null || _h === void 0 ? void 0 : _h.maxHeight) {
310
+ if (this._cellAddonOptions?.maxHeight) {
319
311
  this._tooltipElm.style.maxHeight = `${this._cellAddonOptions.maxHeight}px`;
320
312
  }
321
- if ((_j = this._cellAddonOptions) === null || _j === void 0 ? void 0 : _j.maxWidth) {
313
+ if (this._cellAddonOptions?.maxWidth) {
322
314
  this._tooltipElm.style.maxWidth = `${this._cellAddonOptions.maxWidth}px`;
323
315
  }
324
316
  // when do have text to show, then append the new tooltip to the html body & reposition the tooltip
@@ -327,7 +319,7 @@ class SlickCustomTooltip {
327
319
  // reposition the tooltip on top of the cell that triggered the mouse over event
328
320
  this.reposition(cell);
329
321
  // user could optionally hide the tooltip arrow (we can simply update the CSS variables, that's the only way we have to update CSS pseudo)
330
- if (!((_k = this._cellAddonOptions) === null || _k === void 0 ? void 0 : _k.hideArrow)) {
322
+ if (!this._cellAddonOptions?.hideArrow) {
331
323
  this._tooltipElm.classList.add('tooltip-arrow');
332
324
  }
333
325
  // also clear any "title" attribute to avoid showing a 2nd browser tooltip
@@ -342,29 +334,28 @@ class SlickCustomTooltip {
342
334
  * 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.
343
335
  */
344
336
  reposition(cell) {
345
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
346
337
  if (this._tooltipElm) {
347
338
  this._cellNodeElm = this._cellNodeElm || this._grid.getCellNode(cell.row, cell.cell);
348
- const cellPosition = (0, common_1.getHtmlElementOffset)(this._cellNodeElm) || { top: 0, left: 0 };
339
+ const cellPosition = (0, common_1.getOffset)(this._cellNodeElm) || { top: 0, left: 0 };
349
340
  const cellContainerWidth = this._cellNodeElm.offsetWidth;
350
341
  const calculatedTooltipHeight = this._tooltipElm.getBoundingClientRect().height;
351
342
  const calculatedTooltipWidth = this._tooltipElm.getBoundingClientRect().width;
352
343
  const calculatedBodyWidth = document.body.offsetWidth || window.innerWidth;
353
344
  // first calculate the default (top/left) position
354
- let newPositionTop = (cellPosition.top || 0) - this._tooltipElm.offsetHeight - ((_b = (_a = this._cellAddonOptions) === null || _a === void 0 ? void 0 : _a.offsetTopBottom) !== null && _b !== void 0 ? _b : 0);
355
- let newPositionLeft = (cellPosition.left || 0) - ((_d = (_c = this._cellAddonOptions) === null || _c === void 0 ? void 0 : _c.offsetRight) !== null && _d !== void 0 ? _d : 0);
345
+ let newPositionTop = (cellPosition.top || 0) - this._tooltipElm.offsetHeight - (this._cellAddonOptions?.offsetTopBottom ?? 0);
346
+ let newPositionLeft = (cellPosition.left || 0) - (this._cellAddonOptions?.offsetRight ?? 0);
356
347
  // user could explicitely use a "left-align" arrow position, (when user knows his column is completely on the right in the grid)
357
348
  // or when using "auto" and we detect not enough available space then we'll position to the "left" of the cell
358
349
  // NOTE the class name is for the arrow and is inverse compare to the tooltip itself, so if user ask for "left-align", then the arrow will in fact be "arrow-right-align"
359
- const position = (_f = (_e = this._cellAddonOptions) === null || _e === void 0 ? void 0 : _e.position) !== null && _f !== void 0 ? _f : 'auto';
350
+ const position = this._cellAddonOptions?.position ?? 'auto';
360
351
  if (position === 'center') {
361
- newPositionLeft += (cellContainerWidth / 2) - (calculatedTooltipWidth / 2) + ((_h = (_g = this._cellAddonOptions) === null || _g === void 0 ? void 0 : _g.offsetRight) !== null && _h !== void 0 ? _h : 0);
352
+ newPositionLeft += (cellContainerWidth / 2) - (calculatedTooltipWidth / 2) + (this._cellAddonOptions?.offsetRight ?? 0);
362
353
  this._tooltipElm.classList.remove('arrow-left-align');
363
354
  this._tooltipElm.classList.remove('arrow-right-align');
364
355
  this._tooltipElm.classList.add('arrow-center-align');
365
356
  }
366
357
  else if (position === 'right-align' || ((position === 'auto' || position !== 'left-align') && (newPositionLeft + calculatedTooltipWidth) > calculatedBodyWidth)) {
367
- newPositionLeft -= (calculatedTooltipWidth - cellContainerWidth - ((_k = (_j = this._cellAddonOptions) === null || _j === void 0 ? void 0 : _j.offsetLeft) !== null && _k !== void 0 ? _k : 0));
358
+ newPositionLeft -= (calculatedTooltipWidth - cellContainerWidth - (this._cellAddonOptions?.offsetLeft ?? 0));
368
359
  this._tooltipElm.classList.remove('arrow-center-align');
369
360
  this._tooltipElm.classList.remove('arrow-left-align');
370
361
  this._tooltipElm.classList.add('arrow-right-align');
@@ -377,7 +368,7 @@ class SlickCustomTooltip {
377
368
  // do the same calculation/reposition with top/bottom (default is top of the cell or in other word starting from the cell going down)
378
369
  // NOTE the class name is for the arrow and is inverse compare to the tooltip itself, so if user ask for "bottom", then the arrow will in fact be "arrow-top"
379
370
  if (position === 'bottom' || ((position === 'auto' || position !== 'top') && calculatedTooltipHeight > (0, common_1.calculateAvailableSpace)(this._cellNodeElm).top)) {
380
- newPositionTop = (cellPosition.top || 0) + ((_l = this.gridOptions.rowHeight) !== null && _l !== void 0 ? _l : 0) + ((_o = (_m = this._cellAddonOptions) === null || _m === void 0 ? void 0 : _m.offsetTopBottom) !== null && _o !== void 0 ? _o : 0);
371
+ newPositionTop = (cellPosition.top || 0) + (this.gridOptions.rowHeight ?? 0) + (this._cellAddonOptions?.offsetTopBottom ?? 0);
381
372
  this._tooltipElm.classList.remove('arrow-down');
382
373
  this._tooltipElm.classList.add('arrow-up');
383
374
  }
@@ -395,10 +386,9 @@ class SlickCustomTooltip {
395
386
  * from the grid div text content so that it won't show also as a 2nd browser tooltip
396
387
  */
397
388
  swapAndClearTitleAttribute(inputTitleElm, tooltipText) {
398
- var _a;
399
389
  // the title attribute might be directly on the slick-cell container element (when formatter returns a result object)
400
390
  // OR in a child element (most commonly as a custom formatter)
401
- const titleElm = inputTitleElm || (this._cellNodeElm && ((this._cellNodeElm.hasAttribute('title') && this._cellNodeElm.getAttribute('title')) ? this._cellNodeElm : (_a = this._cellNodeElm) === null || _a === void 0 ? void 0 : _a.querySelector('[title]')));
391
+ const titleElm = inputTitleElm || (this._cellNodeElm && ((this._cellNodeElm.hasAttribute('title') && this._cellNodeElm.getAttribute('title')) ? this._cellNodeElm : this._cellNodeElm?.querySelector('[title]')));
402
392
  // flip tooltip text from `title` to `data-slick-tooltip`
403
393
  if (titleElm) {
404
394
  titleElm.setAttribute('data-slick-tooltip', tooltipText || '');
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slickCustomTooltip.js","sourceRoot":"","sources":["../../src/slickCustomTooltip.ts"],"names":[],"mappings":";;;AAiBA,wDASqC;AACrC,sDAA+D;AAI/D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,kBAAkB;IAwB7B;QAvBA,SAAI,GAAoB,eAAwB,CAAC;QAKvC,cAAS,GAAa,YAAY,CAAC;QAGnC,UAAK,GAAuB,IAAI,CAAC;QACjC,mBAAc,GAA0B,IAAI,CAAC;QAE7C,oBAAe,GAAG;YAC1B,SAAS,EAAE,sBAAsB;YACjC,UAAU,EAAE,CAAC;YACb,WAAW,EAAE,CAAC;YACd,eAAe,EAAE,CAAC;YAClB,SAAS,EAAE,KAAK;YAChB,wBAAwB,EAAE,UAAU;YACpC,UAAU,EAAE,QAAQ;SACE,CAAC;QAKvB,IAAI,CAAC,aAAa,GAAG,IAAI,0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