@formixru/b2b-ui 1.2.1 → 1.3.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v1.3.0
2
+
3
+ - Добавленена поддержка `data-tooltip-image` для вывода изображений во всплывающих подсказках
4
+
1
5
  ## v1.2.1
2
6
 
3
7
  - Исправлены стили в .pagination-group
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formixru/b2b-ui",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -5,8 +5,12 @@ import { errorHandler } from '../../helpers/error-handler.js';
5
5
 
6
6
  export const init = async ($b) => {
7
7
  const { createTooltip } = await import('@advdominion/tooltip');
8
+
8
9
  const title = $b.dataset.tooltipTitle;
9
- const content = title ? `<div class="tooltip__title">${title}</div>${$b.dataset.tooltip}` : $b.dataset.tooltip;
10
+ let content = title ? `<div class="tooltip__title">${title}</div>${$b.dataset.tooltip}` : $b.dataset.tooltip;
11
+ if ($b.dataset.tooltipImage) {
12
+ content = `<img class="tooltip__image" src=${$b.dataset.tooltipImage} alt="">`;
13
+ }
10
14
 
11
15
  return new Promise((resolve) => {
12
16
  if ($b._tooltip) {
@@ -109,4 +109,10 @@ $b: '.tooltip';
109
109
 
110
110
  @include font($tooltip-title-font);
111
111
  }
112
+
113
+ &__image {
114
+ max-height: $tooltip-image-max-height;
115
+ object-fit: contain;
116
+ width: 100%;
117
+ }
112
118
  }
@@ -995,6 +995,8 @@ $tooltip-dark-color: $font-color-inverted !default;
995
995
 
996
996
  $tooltip-title-font: ('font-size': $font-size) !default;
997
997
 
998
+ $tooltip-image-max-height: 300px !default;
999
+
998
1000
  // .action-list
999
1001
 
1000
1002
  $action-list-link-color: $color-grey-70 !default;