@itcase/ui 1.0.14 → 1.0.15

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.
@@ -2986,6 +2986,14 @@ function _taggedTemplateLiteral(strings, raw) {
2986
2986
  }));
2987
2987
  }
2988
2988
 
2989
+ const min = Math.min;
2990
+ const max = Math.max;
2991
+ const round = Math.round;
2992
+ const floor = Math.floor;
2993
+ const createCoords = v => ({
2994
+ x: v,
2995
+ y: v
2996
+ });
2989
2997
  function rectToClientRect(rect) {
2990
2998
  return {
2991
2999
  ...rect,
@@ -2996,18 +3004,6 @@ function rectToClientRect(rect) {
2996
3004
  };
2997
3005
  }
2998
3006
 
2999
- function getWindow(node) {
3000
- var _node$ownerDocument;
3001
- return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
3002
- }
3003
-
3004
- function getComputedStyle$1(element) {
3005
- return getWindow(element).getComputedStyle(element);
3006
- }
3007
-
3008
- function isNode(value) {
3009
- return value instanceof getWindow(value).Node;
3010
- }
3011
3007
  function getNodeName(node) {
3012
3008
  if (isNode(node)) {
3013
3009
  return (node.nodeName || '').toLowerCase();
@@ -3017,16 +3013,29 @@ function getNodeName(node) {
3017
3013
  // https://github.com/floating-ui/floating-ui/issues/2317
3018
3014
  return '#document';
3019
3015
  }
3020
-
3016
+ function getWindow(node) {
3017
+ var _node$ownerDocument;
3018
+ return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
3019
+ }
3020
+ function getDocumentElement(node) {
3021
+ var _ref;
3022
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
3023
+ }
3024
+ function isNode(value) {
3025
+ return value instanceof Node || value instanceof getWindow(value).Node;
3026
+ }
3027
+ function isElement(value) {
3028
+ return value instanceof Element || value instanceof getWindow(value).Element;
3029
+ }
3021
3030
  function isHTMLElement(value) {
3022
3031
  return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
3023
3032
  }
3024
- function isShadowRoot(node) {
3033
+ function isShadowRoot(value) {
3025
3034
  // Browsers without `ShadowRoot` support.
3026
3035
  if (typeof ShadowRoot === 'undefined') {
3027
3036
  return false;
3028
3037
  }
3029
- return node instanceof getWindow(node).ShadowRoot || node instanceof ShadowRoot;
3038
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
3030
3039
  }
3031
3040
  function isOverflowElement(element) {
3032
3041
  const {
@@ -3037,22 +3046,54 @@ function isOverflowElement(element) {
3037
3046
  } = getComputedStyle$1(element);
3038
3047
  return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
3039
3048
  }
3040
- function isSafari() {
3049
+ function isWebKit() {
3041
3050
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
3042
3051
  return CSS.supports('-webkit-backdrop-filter', 'none');
3043
3052
  }
3044
3053
  function isLastTraversableNode(node) {
3045
3054
  return ['html', 'body', '#document'].includes(getNodeName(node));
3046
3055
  }
3047
-
3048
- const min = Math.min;
3049
- const max = Math.max;
3050
- const round = Math.round;
3051
- const floor = Math.floor;
3052
- const createCoords = v => ({
3053
- x: v,
3054
- y: v
3055
- });
3056
+ function getComputedStyle$1(element) {
3057
+ return getWindow(element).getComputedStyle(element);
3058
+ }
3059
+ function getParentNode(node) {
3060
+ if (getNodeName(node) === 'html') {
3061
+ return node;
3062
+ }
3063
+ const result =
3064
+ // Step into the shadow DOM of the parent of a slotted node.
3065
+ node.assignedSlot ||
3066
+ // DOM Element detected.
3067
+ node.parentNode ||
3068
+ // ShadowRoot detected.
3069
+ isShadowRoot(node) && node.host ||
3070
+ // Fallback.
3071
+ getDocumentElement(node);
3072
+ return isShadowRoot(result) ? result.host : result;
3073
+ }
3074
+ function getNearestOverflowAncestor(node) {
3075
+ const parentNode = getParentNode(node);
3076
+ if (isLastTraversableNode(parentNode)) {
3077
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
3078
+ }
3079
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
3080
+ return parentNode;
3081
+ }
3082
+ return getNearestOverflowAncestor(parentNode);
3083
+ }
3084
+ function getOverflowAncestors(node, list) {
3085
+ var _node$ownerDocument2;
3086
+ if (list === void 0) {
3087
+ list = [];
3088
+ }
3089
+ const scrollableAncestor = getNearestOverflowAncestor(node);
3090
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
3091
+ const win = getWindow(scrollableAncestor);
3092
+ if (isBody) {
3093
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
3094
+ }
3095
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
3096
+ }
3056
3097
 
3057
3098
  function getCssDimensions(element) {
3058
3099
  const css = getComputedStyle$1(element);
@@ -3075,10 +3116,6 @@ function getCssDimensions(element) {
3075
3116
  };
3076
3117
  }
3077
3118
 
3078
- function isElement(value) {
3079
- return value instanceof Element || value instanceof getWindow(value).Element;
3080
- }
3081
-
3082
3119
  function unwrapElement(element) {
3083
3120
  return !isElement(element) ? element.contextElement : element;
3084
3121
  }
@@ -3114,7 +3151,7 @@ function getScale(element) {
3114
3151
  const noOffsets = /*#__PURE__*/createCoords(0);
3115
3152
  function getVisualOffsets(element) {
3116
3153
  const win = getWindow(element);
3117
- if (!isSafari() || !win.visualViewport) {
3154
+ if (!isWebKit() || !win.visualViewport) {
3118
3155
  return noOffsets;
3119
3156
  }
3120
3157
  return {
@@ -3163,7 +3200,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
3163
3200
  while (currentIFrame && offsetParent && offsetWin !== win) {
3164
3201
  const iframeScale = getScale(currentIFrame);
3165
3202
  const iframeRect = currentIFrame.getBoundingClientRect();
3166
- const css = getComputedStyle(currentIFrame);
3203
+ const css = getComputedStyle$1(currentIFrame);
3167
3204
  const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
3168
3205
  const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
3169
3206
  x *= iframeScale.x;
@@ -3183,52 +3220,6 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
3183
3220
  });
3184
3221
  }
3185
3222
 
3186
- function getDocumentElement(node) {
3187
- var _ref;
3188
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
3189
- }
3190
-
3191
- function getParentNode(node) {
3192
- if (getNodeName(node) === 'html') {
3193
- return node;
3194
- }
3195
- const result =
3196
- // Step into the shadow DOM of the parent of a slotted node.
3197
- node.assignedSlot ||
3198
- // DOM Element detected.
3199
- node.parentNode ||
3200
- // ShadowRoot detected.
3201
- isShadowRoot(node) && node.host ||
3202
- // Fallback.
3203
- getDocumentElement(node);
3204
- return isShadowRoot(result) ? result.host : result;
3205
- }
3206
-
3207
- function getNearestOverflowAncestor(node) {
3208
- const parentNode = getParentNode(node);
3209
- if (isLastTraversableNode(parentNode)) {
3210
- return node.ownerDocument ? node.ownerDocument.body : node.body;
3211
- }
3212
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
3213
- return parentNode;
3214
- }
3215
- return getNearestOverflowAncestor(parentNode);
3216
- }
3217
-
3218
- function getOverflowAncestors(node, list) {
3219
- var _node$ownerDocument;
3220
- if (list === void 0) {
3221
- list = [];
3222
- }
3223
- const scrollableAncestor = getNearestOverflowAncestor(node);
3224
- const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
3225
- const win = getWindow(scrollableAncestor);
3226
- if (isBody) {
3227
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
3228
- }
3229
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
3230
- }
3231
-
3232
3223
  // https://samthor.au/2021/observing-dom/
3233
3224
  function observeMove(element, onMove) {
3234
3225
  let io = null;
@@ -627,13 +627,13 @@ function Observer(_ref) {
627
627
  const init = () => {
628
628
  if (!swiper.params.observer) return;
629
629
  if (swiper.params.observeParents) {
630
- const containerParents = elementParents(swiper.el);
630
+ const containerParents = elementParents(swiper.hostEl);
631
631
  for (let i = 0; i < containerParents.length; i += 1) {
632
632
  attach(containerParents[i]);
633
633
  }
634
634
  }
635
635
  // Observe container
636
- attach(swiper.el, {
636
+ attach(swiper.hostEl, {
637
637
  childList: swiper.params.observeSlideChildren
638
638
  });
639
639
 
@@ -2233,11 +2233,13 @@ function loopFix(_temp) {
2233
2233
  swiper.slideTo(activeIndex + slidesPrepended, 0, false, true);
2234
2234
  if (setTranslate) {
2235
2235
  swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
2236
+ swiper.touchEventsData.currentTranslate = swiper.translate;
2236
2237
  }
2237
2238
  }
2238
2239
  } else {
2239
2240
  if (setTranslate) {
2240
2241
  swiper.slideToLoop(slideRealIndex, 0, false, true);
2242
+ swiper.touchEventsData.currentTranslate = swiper.translate;
2241
2243
  }
2242
2244
  }
2243
2245
  } else if (appendSlidesIndexes.length > 0 && isNext) {
@@ -2251,6 +2253,7 @@ function loopFix(_temp) {
2251
2253
  swiper.slideTo(activeIndex - slidesAppended, 0, false, true);
2252
2254
  if (setTranslate) {
2253
2255
  swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff;
2256
+ swiper.touchEventsData.currentTranslate = swiper.translate;
2254
2257
  }
2255
2258
  }
2256
2259
  } else {
@@ -3815,7 +3818,7 @@ let Swiper$2 = class Swiper {
3815
3818
  return false;
3816
3819
  }
3817
3820
  el.swiper = swiper;
3818
- if (el.parentNode && el.parentNode.host) {
3821
+ if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === 'SWIPER-CONTAINER') {
3819
3822
  swiper.isElement = true;
3820
3823
  }
3821
3824
  const getWrapperSelector = () => {
@@ -3841,7 +3844,7 @@ let Swiper$2 = class Swiper {
3841
3844
  Object.assign(swiper, {
3842
3845
  el,
3843
3846
  wrapperEl,
3844
- slidesEl: swiper.isElement ? el.parentNode.host : wrapperEl,
3847
+ slidesEl: swiper.isElement && !el.parentNode.host.slideSlots ? el.parentNode.host : wrapperEl,
3845
3848
  hostEl: swiper.isElement ? el.parentNode.host : el,
3846
3849
  mounted: true,
3847
3850
  // RTL
@@ -4236,8 +4239,7 @@ function getParams(obj, splitEvents) {
4236
4239
  };
4237
4240
  const events = {};
4238
4241
  const passedParams = {};
4239
- extend(params, Swiper$2.defaults);
4240
- extend(params, Swiper$2.extendedDefaults);
4242
+ extend(params, defaults);
4241
4243
  params._emitClasses = true;
4242
4244
  params.init = false;
4243
4245
  const rest = {};
@@ -4352,7 +4354,7 @@ const updateOnVirtualData = swiper => {
4352
4354
  };
4353
4355
 
4354
4356
  /**
4355
- * Swiper React 10.0.4
4357
+ * Swiper React 10.1.0
4356
4358
  * Most modern mobile touch slider and framework with hardware accelerated transitions
4357
4359
  * https://swiperjs.com
4358
4360
  *
@@ -4360,7 +4362,7 @@ const updateOnVirtualData = swiper => {
4360
4362
  *
4361
4363
  * Released under the MIT License
4362
4364
  *
4363
- * Released on: July 8, 2023
4365
+ * Released on: August 1, 2023
4364
4366
  */
4365
4367
 
4366
4368
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Swiper 10.0.4
2
+ * Swiper 10.1.0
3
3
  * Most modern mobile touch slider and framework with hardware accelerated transitions
4
4
  * https://swiperjs.com
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Released under the MIT License
9
9
  *
10
- * Released on: July 8, 2023
10
+ * Released on: August 1, 2023
11
11
  */
12
12
 
13
13
  /* FONT_START */
@@ -686,6 +686,8 @@ button.swiper-pagination-bullet {
686
686
  display: none;
687
687
  }
688
688
 
689
+ /* Zoom container styles start */
690
+
689
691
  .swiper-zoom-container {
690
692
  width: 100%;
691
693
  height: 100%;
@@ -703,6 +705,8 @@ button.swiper-pagination-bullet {
703
705
  object-fit: contain;
704
706
  }
705
707
 
708
+ /* Zoom container styles end */
709
+
706
710
  .swiper-slide-zoomed {
707
711
  cursor: move;
708
712
  touch-action: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/ui",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "UI components (Modal, Loader, Popup, etc)",
5
5
  "keywords": [
6
6
  "Modal",
@@ -40,7 +40,7 @@
40
40
  "registry": "https://registry.npmjs.org/"
41
41
  },
42
42
  "dependencies": {
43
- "@itcase/common": "^1.1.2",
43
+ "@itcase/common": "^1.1.3",
44
44
  "clsx": "^2.0.0",
45
45
  "html5-boilerplate": "^8.0.0",
46
46
  "js-cookie": "^3.0.5",
@@ -56,7 +56,7 @@
56
56
  "react-responsive": "^9.0.2",
57
57
  "react-scrollbars-custom": "^4.1.1",
58
58
  "react-select": "^5.7.4",
59
- "swiper": "^10.0.4",
59
+ "swiper": "^10.1.0",
60
60
  "uuid": "^9.0.0"
61
61
  },
62
62
  "devDependencies": {
@@ -77,7 +77,7 @@
77
77
  "babel-loader": "^9.1.3",
78
78
  "babel-plugin-inline-react-svg": "^2.0.2",
79
79
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
80
- "eslint": "8.45.0",
80
+ "eslint": "8.46.0",
81
81
  "eslint-config-prettier": "^8.9.0",
82
82
  "eslint-config-standard": "^17.1.0",
83
83
  "eslint-plugin-babel": "^5.3.1",
@@ -86,7 +86,7 @@
86
86
  "eslint-plugin-node": "^11.1.0",
87
87
  "eslint-plugin-prettier": "^5.0.0",
88
88
  "eslint-plugin-promise": "^6.1.1",
89
- "eslint-plugin-react": "^7.33.0",
89
+ "eslint-plugin-react": "^7.33.1",
90
90
  "eslint-plugin-react-hooks": "^4.6.0",
91
91
  "eslint-plugin-standard": "^5.0.0",
92
92
  "husky": "^8.0.3",
@@ -116,7 +116,7 @@
116
116
  "postcss-sort-media-queries": "^5.2.0",
117
117
  "prettier": "^3.0.0",
118
118
  "react-datepicker": "^4.16.0",
119
- "rollup": "^3.26.3",
119
+ "rollup": "^3.27.0",
120
120
  "rollup-plugin-peer-deps-external": "^2.2.4",
121
121
  "semantic-release": "^21.0.7",
122
122
  "stylelint": "^15.10.2",