js-cloudimage-360-view 2.7.4 → 2.7.7

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 (51) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +78 -19
  3. package/dist/ci360.service.js +141 -51
  4. package/dist/ci360.utils.js +6 -5
  5. package/dist/constants/image-src-props.js +8 -0
  6. package/dist/index.js +28 -1
  7. package/dist/static/css/hotspots.css +222 -0
  8. package/dist/utils/{common → class-names}/add-class.js +0 -0
  9. package/dist/utils/{common → class-names}/remove-class.js +0 -0
  10. package/dist/utils/container-elements/index.js +9 -1
  11. package/dist/utils/container-elements/remove-child-from-parent.js +16 -0
  12. package/dist/utils/controls/init-controls.js +1 -1
  13. package/dist/utils/{hotspot → hotspots}/attach-popup-events.js +1 -1
  14. package/dist/utils/{hotspot → hotspots}/configs-error-handler.js +7 -10
  15. package/dist/utils/{hotspot → hotspots}/create-popper-instace.js +0 -0
  16. package/dist/utils/{hotspot → hotspots}/elements/create-carousel-dot.js +1 -1
  17. package/dist/utils/{hotspot → hotspots}/elements/create-carousel-image.js +0 -0
  18. package/dist/utils/{hotspot → hotspots}/elements/create-hotspot-icon.js +4 -5
  19. package/dist/utils/{hotspot → hotspots}/elements/create-hotspot-popup-link.js +0 -0
  20. package/dist/utils/{hotspot → hotspots}/elements/create-hotspots.js +0 -0
  21. package/dist/utils/{hotspot → hotspots}/elements/create-images-carousel.js +0 -0
  22. package/dist/utils/{hotspot → hotspots}/elements/create-modal-description.js +0 -0
  23. package/dist/utils/{hotspot → hotspots}/elements/create-modal-title.js +0 -0
  24. package/dist/utils/hotspots/elements/create-model-elements.js +66 -0
  25. package/dist/utils/{hotspot → hotspots}/elements/create-popup-arrow.js +0 -0
  26. package/dist/utils/{hotspot → hotspots}/elements/create-popup.js +10 -7
  27. package/dist/utils/hotspots/elements/create-read-more-btn.js +17 -0
  28. package/dist/utils/{hotspot/fill-previous-coord-with-previous.js → hotspots/fill-empty-coord-with-previous.js} +3 -3
  29. package/dist/utils/hotspots/generate-hotspots-configs.js +58 -0
  30. package/dist/utils/{hotspot → hotspots}/generate-popup-config.js +3 -8
  31. package/dist/utils/{hotspot → hotspots}/get-hotspot-icon.js +0 -0
  32. package/dist/utils/{hotspot → hotspots}/get-hotspot-orientation.js +0 -0
  33. package/dist/utils/{hotspot → hotspots}/get-hotspot-popup-node.js +4 -2
  34. package/dist/utils/{hotspot → hotspots}/get-popup-node.js +1 -1
  35. package/dist/utils/{hotspot → hotspots}/hide-hotspot-icon.js +0 -0
  36. package/dist/utils/{hotspot → hotspots}/hide-hotspots-icons.js +0 -0
  37. package/dist/utils/{hotspot → hotspots}/is-mouse-on-hotspot.js +0 -0
  38. package/dist/utils/{hotspot → hotspots}/prepare-hotspots-positions.js +3 -3
  39. package/dist/utils/{hotspot → hotspots}/set-current-slide.js +0 -0
  40. package/dist/utils/{hotspot → hotspots}/update-hotspot-icon-position.js +0 -0
  41. package/dist/utils/{hotspot → hotspots}/update-hotspots.js +10 -9
  42. package/dist/utils/image-src/is-src-props-changed.js +23 -0
  43. package/dist/utils/index.js +36 -36
  44. package/dist/utils/responsive/get-image-aspect-ratio.js +39 -0
  45. package/dist/utils/spin-y/get-moving-direction.js +1 -1
  46. package/package.json +2 -1
  47. package/dist/utils/hotspot/elements/create-model-elements.js +0 -49
  48. package/dist/utils/hotspot/generate-hotspots-configs.js +0 -41
  49. package/dist/utils/hotspot/get-hotspot-variant.js +0 -20
  50. package/dist/utils/responsive/get-container-responsive-height.js +0 -20
  51. package/dist/utils/responsive/get-container-responsive-width.js +0 -20
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getPopupNode = void 0;
7
7
 
8
8
  var getPopupNode = function getPopupNode(popupId) {
9
- var popupSelector = 'data-CI-360-anchor';
9
+ var popupSelector = 'data-cloudimage-360-hotspots';
10
10
  var popupNode = document.querySelector("[".concat(popupSelector, "=").concat(popupId, "]"));
11
11
  return popupNode;
12
12
  };
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.prepareHotspotsPositions = void 0;
7
7
 
8
- var _fillPreviousCoordWithPrevious = require("./fill-previous-coord-with-previous");
8
+ var _fillEmptyCoordWithPrevious = require("./fill-empty-coord-with-previous");
9
9
 
10
10
  var prepareHotspotsPositions = function prepareHotspotsPositions(hotspots) {
11
11
  return hotspots.reduce(function (accumulate, current, currentIndex) {
@@ -13,11 +13,11 @@ var prepareHotspotsPositions = function prepareHotspotsPositions(hotspots) {
13
13
  var isIncludesYcoord = !!(current !== null && current !== void 0 && current.yCoord);
14
14
 
15
15
  if (!isIncludesXcoord) {
16
- current.xCoord = (0, _fillPreviousCoordWithPrevious.fillPreviousCoordWithPrevious)(hotspots, currentIndex, 'xCoord');
16
+ current.xCoord = (0, _fillEmptyCoordWithPrevious.fillEmptyCoordWithPrevious)(hotspots, currentIndex, 'xCoord');
17
17
  }
18
18
 
19
19
  if (!isIncludesYcoord) {
20
- current.yCoord = (0, _fillPreviousCoordWithPrevious.fillPreviousCoordWithPrevious)(hotspots, currentIndex, 'yCoord');
20
+ current.yCoord = (0, _fillEmptyCoordWithPrevious.fillEmptyCoordWithPrevious)(hotspots, currentIndex, 'yCoord');
21
21
  }
22
22
 
23
23
  accumulate.push(current);
@@ -29,21 +29,22 @@ var updateHotspots = function updateHotspots(container, hotspotsProps) {
29
29
  var popupProps = hotspotProps.popupProps,
30
30
  hotspots = hotspotProps.hotspots,
31
31
  initialDimensions = hotspotProps.initialDimensions,
32
- orientation = hotspotProps.orientation;
32
+ orientation = hotspotProps.orientation,
33
+ variant = hotspotProps.variant;
33
34
  var hotspotOriantaion = (0, _getHotspotOrientation.getHotspotOriantaion)(movingDirection);
34
- var currentImage = orientation === 'x' ? activeImageX : activeImageY;
35
- var anchorId = popupProps.anchorId,
36
- open = popupProps.open;
37
- var popup = (0, _getHotspotPopupNode.getHotspotPopupNode)(anchorId, open);
38
- var hotspotIcon = (0, _getHotspotIcon.getHotspotIcon)(anchorId);
35
+ var currentImageIndex = orientation === 'x' ? activeImageX : activeImageY;
36
+ var open = popupProps.open;
37
+ var anchorId = variant.anchorId;
39
38
  var hotspotsPositions = (0, _prepareHotspotsPositions.prepareHotspotsPositions)(hotspots);
39
+ var currentPosition = hotspotsPositions.find(function (hotspotPosition) {
40
+ return hotspotPosition.imageIndex === currentImageIndex;
41
+ });
42
+ var popup = (0, _getHotspotPopupNode.getHotspotPopupNode)(anchorId, open, currentPosition);
43
+ var hotspotIcon = (0, _getHotspotIcon.getHotspotIcon)(anchorId);
40
44
  var popperInstance = (0, _createPopperInstace.createPopperInstance)(popup, popupProps, container);
41
45
  popperInstance.state.elements.reference = hotspotIcon;
42
46
  popperInstance.update();
43
47
  (0, _attachPopupEvents.attachPopupEvents)(hotspotIcon, popup, popperInstance, open);
44
- var currentPosition = hotspotsPositions.find(function (hotspotPosition) {
45
- return hotspotPosition.imageIndex === currentImage;
46
- });
47
48
 
48
49
  if (currentPosition && hotspotOriantaion === orientation) {
49
50
  var _currentPosition$xCoo = currentPosition.xCoord,
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isSrcPropsChanged = void 0;
7
+
8
+ var _imageSrcProps = require("../../constants/image-src-props");
9
+
10
+ var isSrcPropsChanged = function isSrcPropsChanged(currentProps, changedProps) {
11
+ return Object.keys(changedProps).reduce(function (acc, current) {
12
+ var isPropChanged = currentProps[current] !== changedProps[current];
13
+ var isSrcProp = _imageSrcProps.IMAGE_SRC_PROPS.indexOf(current) !== -1;
14
+
15
+ if (isSrcProp && isPropChanged) {
16
+ acc = true;
17
+ }
18
+
19
+ return acc;
20
+ }, false);
21
+ };
22
+
23
+ exports.isSrcPropsChanged = isSrcPropsChanged;
@@ -4,24 +4,24 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  var _exportNames = {
7
+ isSrcPropsChanged: true,
7
8
  generateImagesPath: true,
8
9
  preloadImages: true,
9
10
  preloadOriginalImages: true,
10
11
  contain: true,
12
+ getImageAspectRatio: true,
11
13
  getCurrentOriginalImage: true,
12
14
  magnify: true,
15
+ generateZoomInSteps: true,
16
+ generateZoomOutSteps: true,
17
+ loop: true,
13
18
  getSpeedFactor: true,
14
19
  isCompletedOneCycle: true,
15
- getContainerResponsiveWidth: true,
16
- getContainerResponsiveHeight: true,
17
- getMovingDirection: true,
18
- initControls: true,
19
20
  addClass: true,
20
21
  removeClass: true,
22
+ getMovingDirection: true,
21
23
  getItemSkipped: true,
22
- loop: true,
23
- generateZoomInSteps: true,
24
- generateZoomOutSteps: true,
24
+ initControls: true,
25
25
  updateHotspots: true,
26
26
  createHotspots: true,
27
27
  generateHotspotsConfigs: true,
@@ -70,22 +70,16 @@ Object.defineProperty(exports, "generateZoomOutSteps", {
70
70
  return _generateZoomOutSteps.generateZoomOutSteps;
71
71
  }
72
72
  });
73
- Object.defineProperty(exports, "getContainerResponsiveHeight", {
74
- enumerable: true,
75
- get: function get() {
76
- return _getContainerResponsiveHeight.getContainerResponsiveHeight;
77
- }
78
- });
79
- Object.defineProperty(exports, "getContainerResponsiveWidth", {
73
+ Object.defineProperty(exports, "getCurrentOriginalImage", {
80
74
  enumerable: true,
81
75
  get: function get() {
82
- return _getContainerResponsiveWidth.getContainerResponsiveWidth;
76
+ return _getCurrentOriginalImage.getCurrentOriginalImage;
83
77
  }
84
78
  });
85
- Object.defineProperty(exports, "getCurrentOriginalImage", {
79
+ Object.defineProperty(exports, "getImageAspectRatio", {
86
80
  enumerable: true,
87
81
  get: function get() {
88
- return _getCurrentOriginalImage.getCurrentOriginalImage;
82
+ return _getImageAspectRatio.getImageAspectRatio;
89
83
  }
90
84
  });
91
85
  Object.defineProperty(exports, "getItemSkipped", {
@@ -130,6 +124,12 @@ Object.defineProperty(exports, "isMouseOnHotspot", {
130
124
  return _isMouseOnHotspot.isMouseOnHotspot;
131
125
  }
132
126
  });
127
+ Object.defineProperty(exports, "isSrcPropsChanged", {
128
+ enumerable: true,
129
+ get: function get() {
130
+ return _isSrcPropsChanged.isSrcPropsChanged;
131
+ }
132
+ });
133
133
  Object.defineProperty(exports, "loop", {
134
134
  enumerable: true,
135
135
  get: function get() {
@@ -167,6 +167,8 @@ Object.defineProperty(exports, "updateHotspots", {
167
167
  }
168
168
  });
169
169
 
170
+ var _isSrcPropsChanged = require("./image-src/is-src-props-changed");
171
+
170
172
  var _generateImagesPath = require("./image-src/generate-images-path");
171
173
 
172
174
  var _preloadImages = require("./load-images/preload-images");
@@ -175,28 +177,32 @@ var _preloadOriginalImages = require("./load-images/preload-original-images");
175
177
 
176
178
  var _contain = require("./responsive/contain");
177
179
 
180
+ var _getImageAspectRatio = require("./responsive/get-image-aspect-ratio");
181
+
178
182
  var _getCurrentOriginalImage = require("./magnify/get-current-original-image");
179
183
 
180
184
  var _magnify = require("./magnify/magnify");
181
185
 
182
- var _getSpeedFactor = require("./auto-play/get-speed-factor");
186
+ var _generateZoomInSteps = require("./zoom/generate-zoom-in-steps");
183
187
 
184
- var _isCompletedOneCycle = require("./auto-play/is-completed-one-cycle");
188
+ var _generateZoomOutSteps = require("./zoom/generate-zoom-out-steps");
185
189
 
186
- var _getContainerResponsiveWidth = require("./responsive/get-container-responsive-width");
190
+ var _loop = require("./auto-play/loop");
187
191
 
188
- var _getContainerResponsiveHeight = require("./responsive/get-container-responsive-height");
192
+ var _getSpeedFactor = require("./auto-play/get-speed-factor");
189
193
 
190
- var _getMovingDirection = require("./spin-y/get-moving-direction");
194
+ var _isCompletedOneCycle = require("./auto-play/is-completed-one-cycle");
191
195
 
192
- var _initControls = require("./controls/init-controls");
196
+ var _addClass = require("./class-names/add-class");
193
197
 
194
- var _addClass = require("./common/add-class");
198
+ var _removeClass = require("./class-names/remove-class");
195
199
 
196
- var _removeClass = require("./common/remove-class");
200
+ var _getMovingDirection = require("./spin-y/get-moving-direction");
197
201
 
198
202
  var _getItemSkipped = require("./controls/get-item-skipped");
199
203
 
204
+ var _initControls = require("./controls/init-controls");
205
+
200
206
  var _containerElements = require("./container-elements");
201
207
 
202
208
  Object.keys(_containerElements).forEach(function (key) {
@@ -211,18 +217,12 @@ Object.keys(_containerElements).forEach(function (key) {
211
217
  });
212
218
  });
213
219
 
214
- var _loop = require("./auto-play/loop");
215
-
216
- var _generateZoomInSteps = require("./zoom/generate-zoom-in-steps");
217
-
218
- var _generateZoomOutSteps = require("./zoom/generate-zoom-out-steps");
219
-
220
- var _updateHotspots = require("./hotspot/update-hotspots");
220
+ var _updateHotspots = require("./hotspots/update-hotspots");
221
221
 
222
- var _createHotspots = require("./hotspot/elements/create-hotspots");
222
+ var _createHotspots = require("./hotspots/elements/create-hotspots");
223
223
 
224
- var _generateHotspotsConfigs = require("./hotspot/generate-hotspots-configs");
224
+ var _generateHotspotsConfigs = require("./hotspots/generate-hotspots-configs");
225
225
 
226
- var _isMouseOnHotspot = require("./hotspot/is-mouse-on-hotspot");
226
+ var _isMouseOnHotspot = require("./hotspots/is-mouse-on-hotspot");
227
227
 
228
- var _hideHotspotsIcons = require("./hotspot/hide-hotspots-icons");
228
+ var _hideHotspotsIcons = require("./hotspots/hide-hotspots-icons");
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.getImageAspectRatio = void 0;
9
+
10
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
+
12
+ var getImageAspectRatio = function getImageAspectRatio(image, providedRatio) {
13
+ try {
14
+ var imageAspectRatio = image.width / image.height;
15
+
16
+ if (typeof providedRatio === 'number') {
17
+ imageAspectRatio = providedRatio;
18
+ }
19
+
20
+ if ((0, _typeof2.default)(providedRatio) === 'object') {
21
+ var mediaQueries = Object.keys(providedRatio).sort(function (a, b) {
22
+ return a - b;
23
+ });
24
+ var activeMedia = mediaQueries.find(function (mediaQuery) {
25
+ return window.innerWidth <= parseInt(mediaQuery, 10);
26
+ });
27
+
28
+ if (activeMedia) {
29
+ imageAspectRatio = providedRatio[activeMedia];
30
+ }
31
+ }
32
+
33
+ return imageAspectRatio;
34
+ } catch (_unused) {
35
+ return 1;
36
+ }
37
+ };
38
+
39
+ exports.getImageAspectRatio = getImageAspectRatio;
@@ -8,7 +8,7 @@ exports.getMovingDirection = void 0;
8
8
  var _orientations = require("../../constants/orientations");
9
9
 
10
10
  var getMovingDirection = function getMovingDirection(isStartSpin, allowSpinY, prevPosition, nextPositions, currentMovingDirection) {
11
- var movingDirection;
11
+ var movingDirection = _orientations.ORIENTATIONS.CENTER;
12
12
  if (isStartSpin) return currentMovingDirection;
13
13
  var differenceInPositionX = Math.abs(prevPosition.x - nextPositions.x);
14
14
  var differenceInPositionY = Math.abs(prevPosition.y - nextPositions.y);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-cloudimage-360-view",
3
- "version": "2.7.4",
3
+ "version": "2.7.7",
4
4
  "main": "dist/index.js",
5
5
  "description": "",
6
6
  "author": "scaleflex",
@@ -33,6 +33,7 @@
33
33
  "publish-demo": "npm run build-demo && npm run deploy-demo"
34
34
  },
35
35
  "dependencies": {
36
+ "@babel/runtime": "^7.17.0",
36
37
  "@popperjs/core": "^2.11.2",
37
38
  "core-js": "^3.0.0"
38
39
  },
@@ -1,49 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createModalElements = void 0;
9
-
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
-
12
- var _createImagesCarousel3 = require("./create-images-carousel");
13
-
14
- var _createModalDescription = require("./create-modal-description");
15
-
16
- var _createModalTitle = require("./create-modal-title");
17
-
18
- var createModalElements = function createModalElements(variant, container, popup) {
19
- var images = variant.images,
20
- title = variant.title,
21
- description = variant.description;
22
- var imagesCarouselWrapper = document.createElement('div');
23
- var modalWrapper = document.createElement('div');
24
-
25
- var _createImagesCarousel = (0, _createImagesCarousel3.createImagesCarousel)(images, popup, container),
26
- _createImagesCarousel2 = (0, _slicedToArray2.default)(_createImagesCarousel, 2),
27
- imagesCarousel = _createImagesCarousel2[0],
28
- carouselDots = _createImagesCarousel2[1];
29
-
30
- modalWrapper.className = 'cloudimage-360-modal-wrapper';
31
- imagesCarouselWrapper.className = 'cloudimage-360-images-carousel-wrapper';
32
- imagesCarouselWrapper.appendChild(imagesCarousel);
33
- imagesCarouselWrapper.appendChild(carouselDots);
34
- modalWrapper.appendChild(imagesCarouselWrapper);
35
-
36
- if (title) {
37
- var modalTitle = (0, _createModalTitle.createModalTitle)(title);
38
- modalWrapper.appendChild(modalTitle);
39
- }
40
-
41
- if (description) {
42
- var modalDescription = (0, _createModalDescription.createModalDescription)(description);
43
- modalWrapper.appendChild(modalDescription);
44
- }
45
-
46
- popup.appendChild(modalWrapper);
47
- };
48
-
49
- exports.createModalElements = createModalElements;
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.generateHotspotsConfigs = void 0;
7
-
8
- var _configsErrorHandler = require("./configs-error-handler");
9
-
10
- var _generatePopupConfig = require("./generate-popup-config");
11
-
12
- var generateHotspotsConfigs = function generateHotspotsConfigs(hotspotsProps) {
13
- var hotspotsConfigs = hotspotsProps.map(function (hotspotProps) {
14
- var _hotspotProps$variant = hotspotProps.variant,
15
- variant = _hotspotProps$variant === void 0 ? {} : _hotspotProps$variant,
16
- _hotspotProps$hotspot = hotspotProps.hotspots,
17
- hotspots = _hotspotProps$hotspot === void 0 ? [] : _hotspotProps$hotspot,
18
- _hotspotProps$indicat = hotspotProps.indicatorClass,
19
- indicatorClass = _hotspotProps$indicat === void 0 ? '' : _hotspotProps$indicat,
20
- _hotspotProps$popupPr = hotspotProps.popupProps,
21
- popupProps = _hotspotProps$popupPr === void 0 ? {} : _hotspotProps$popupPr,
22
- _hotspotProps$orienta = hotspotProps.orientation,
23
- orientation = _hotspotProps$orienta === void 0 ? 'x' : _hotspotProps$orienta,
24
- _hotspotProps$initial = hotspotProps.initialDimensions,
25
- initialDimensions = _hotspotProps$initial === void 0 ? [500, 500] : _hotspotProps$initial;
26
- (0, _configsErrorHandler.configsErrorHandler)(hotspotProps);
27
- var popupConfig = (0, _generatePopupConfig.generatePopupConfig)(popupProps);
28
- var hotspotConfig = {
29
- variant: variant,
30
- popupProps: popupConfig,
31
- hotspots: hotspots,
32
- indicatorClass: indicatorClass,
33
- initialDimensions: initialDimensions,
34
- orientation: orientation.toLowerCase()
35
- };
36
- return hotspotConfig;
37
- });
38
- return hotspotsConfigs;
39
- };
40
-
41
- exports.generateHotspotsConfigs = generateHotspotsConfigs;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getHotspotVariant = void 0;
7
-
8
- var getHotspotVariant = function getHotspotVariant(variant) {
9
- if (variant.toLowerCase() === 'link') {
10
- return 'link';
11
- }
12
-
13
- if (variant.toLowerCase() === 'custom') {
14
- return 'custom';
15
- }
16
-
17
- return 'link';
18
- };
19
-
20
- exports.getHotspotVariant = getHotspotVariant;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getContainerResponsiveHeight = void 0;
7
-
8
- var getContainerResponsiveHeight = function getContainerResponsiveHeight(container, width, containerHeight) {
9
- if (containerHeight) {
10
- if (width < containerHeight) {
11
- return width;
12
- }
13
-
14
- return containerHeight;
15
- }
16
-
17
- return container.offsetWidth;
18
- };
19
-
20
- exports.getContainerResponsiveHeight = getContainerResponsiveHeight;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getContainerResponsiveWidth = void 0;
7
-
8
- var getContainerResponsiveWidth = function getContainerResponsiveWidth(parentEl, containerWidth) {
9
- if (containerWidth) {
10
- if (parentEl.offsetWidth < containerWidth) {
11
- return parentEl.offsetWidth;
12
- }
13
-
14
- return containerWidth;
15
- }
16
-
17
- return parentEl.offsetWidth;
18
- };
19
-
20
- exports.getContainerResponsiveWidth = getContainerResponsiveWidth;