infinity-forge 3.2.7 → 3.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.
Files changed (128) hide show
  1. package/LICENSE +20 -20
  2. package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.d.ts +6 -0
  3. package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.js +42 -0
  4. package/dist/sites/public/fonts/fonts.css +760 -760
  5. package/dist/system/presentation/components/data/menu/components/menu-item/index.js +80 -0
  6. package/dist/system/presentation/components/data/menu/modes/collapsed-menu/index.js +44 -0
  7. package/dist/system/presentation/components/data/menu/modes/collapsed-menu/styles.js +15 -0
  8. package/dist/system/presentation/components/data/menu/modes/opened/index.js +51 -0
  9. package/dist/system/presentation/components/data/menu/modes/opened/styles.js +15 -0
  10. package/dist/system/presentation/components/layout/header/components/menu-right/component.d.ts +6 -0
  11. package/dist/system/presentation/components/layout/header/components/menu-right/component.js +35 -0
  12. package/dist/system/presentation/components/layout/header/components/menu-right/index.d.ts +3 -0
  13. package/dist/system/presentation/components/layout/header/components/menu-right/index.js +3 -3
  14. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.d.ts +1 -1
  15. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.js +3 -3
  16. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/index.js +3 -3
  17. package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/interfaces.d.ts +1 -1
  18. package/dist/system/presentation/components/layout/header/components/menu-right/messages/index.js +4 -4
  19. package/dist/system/presentation/components/layout/header/components/menu-right/profile/content/index.js +3 -3
  20. package/dist/system/presentation/components/layout/header/components/menu-right/profile/index.js +4 -4
  21. package/dist/system/presentation/components/layout/header/components/search-modal/index.js +4 -4
  22. package/dist/system/presentation/components/layout/header/components/search-modal/search-list/index.js +3 -3
  23. package/dist/system/presentation/components/layout/header/components/search-modal/trigger/index.js +2 -2
  24. package/dist/system/presentation/components/pages/menus/table/icon/index.js +1 -1
  25. package/dist/system/presentation/context/auth/components/login/form-login/index.js +2 -2
  26. package/dist/system/presentation/hooks/ui/use-table/components/table/actions/delete/index.d.ts +1 -1
  27. package/dist/system/presentation/hooks/ui/use-table/components/table/actions/delete/index.js +2 -2
  28. package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.d.ts +1 -1
  29. package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.js +4 -4
  30. package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.d.ts +1 -1
  31. package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.js +2 -2
  32. package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.d.ts +1 -1
  33. package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.js +3 -3
  34. package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.d.ts +1 -1
  35. package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.js +2 -2
  36. package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.d.ts +1 -1
  37. package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.js +3 -3
  38. package/dist/system/presentation/hooks/ui/use-table/components/table/index.d.ts +1 -1
  39. package/dist/system/presentation/hooks/ui/use-table/components/table/index.js +10 -10
  40. package/dist/system/presentation/hooks/ui/use-table/components/table/interfaces.d.ts +2 -2
  41. package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.d.ts +1 -1
  42. package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.js +3 -3
  43. package/dist/system/presentation/hooks/ui/use-table/components/table/skeleton-table/index.js +2 -2
  44. package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.d.ts +1 -1
  45. package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.js +2 -2
  46. package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/interfaces.d.ts +1 -1
  47. package/dist/ui/components/carousel/carousel-lib/core/modules/observer/observer.js +2 -2
  48. package/dist/ui/components/carousel/carousel-lib/core/modules/resize/resize.js +1 -1
  49. package/dist/ui/components/carousel/carousel-lib/core/translate/translateTo.js +81 -0
  50. package/dist/ui/components/carousel/carousel-lib/core/update/index.d.ts +21 -0
  51. package/dist/ui/components/carousel/carousel-lib/core/update/index.js +26 -0
  52. package/dist/ui/components/carousel/carousel-lib/core/update/updateActiveIndex.js +125 -0
  53. package/dist/ui/components/carousel/carousel-lib/core/update/updateSize.js +45 -0
  54. package/dist/ui/components/carousel/carousel-lib/core/update/updateSlides.js +306 -0
  55. package/dist/ui/components/carousel/carousel-lib/core/update/updateSlidesClasses.js +69 -0
  56. package/dist/ui/components/form/handler/i18n/capture-i18n-errors/index.d.ts +6 -0
  57. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.d.ts +1 -1
  58. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.js +1 -1
  59. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.d.ts +3 -3
  60. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.js +3 -3
  61. package/dist/ui/components/form/input-cep/use-cep/providers/index.d.ts +1 -0
  62. package/dist/ui/components/form/input-cep/use-cep/providers/index.js +18 -0
  63. package/dist/ui/components/form/input-currency/components/utils/cleanValue.d.ts +8 -0
  64. package/dist/ui/components/form/input-currency/components/utils/cleanValue.js +62 -0
  65. package/dist/ui/components/form/input-currency/components/utils/formatValue.d.ts +49 -0
  66. package/dist/ui/components/form/input-currency/components/utils/formatValue.js +132 -0
  67. package/dist/ui/components/form/input-currency/components/utils/getLocaleConfig.d.ts +13 -0
  68. package/dist/ui/components/form/input-currency/components/utils/getSuffix.js +12 -0
  69. package/dist/ui/components/form/input-currency/components/utils/index.d.ts +8 -0
  70. package/dist/ui/components/form/input-currency/components/utils/index.js +25 -0
  71. package/dist/ui/components/form/input-currency/components/utils/parseAbbrValue.js +40 -0
  72. package/dist/ui/components/form/input-currency/components/utils/removeInvalidChars.js +14 -0
  73. package/dist/ui/components/form/input-currency/components/utils/removeSeparators.js +14 -0
  74. package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.d.ts +2 -0
  75. package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.js +62 -0
  76. package/dist/ui/components/form/input-date-picker/calendar/days/index.d.ts +2 -0
  77. package/dist/ui/components/form/input-date-picker/calendar/days/index.js +87 -0
  78. package/dist/ui/components/form/input-date-picker/calendar/months/index.d.ts +2 -0
  79. package/dist/ui/components/form/input-date-picker/calendar/months/index.js +66 -0
  80. package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.d.ts +1 -1
  81. package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.js +1 -1
  82. package/dist/ui/components/form/input-file/render-files/file-item/index.d.ts +3 -0
  83. package/dist/ui/components/form/input-file/render-files/file-item/index.js +49 -0
  84. package/dist/ui/components/form/input-mask/lib/core/errors/SyntheticChangeError.d.ts +1 -1
  85. package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.d.ts +1 -1
  86. package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.js +2 -2
  87. package/dist/ui/components/form/input-mask/lib/core/index.d.ts +5 -0
  88. package/dist/ui/components/form/input-mask/lib/core/index.js +15 -0
  89. package/dist/ui/components/form/input-mask/lib/core/utils/setInputAttributes.d.ts +1 -1
  90. package/dist/ui/components/form/input-mask/lib/mask/InputMask.d.ts +6 -0
  91. package/dist/ui/components/form/input-mask/lib/mask/InputMask.js +44 -0
  92. package/dist/ui/components/form/input-mask/lib/mask/index.d.ts +5 -0
  93. package/dist/ui/components/form/input-mask/lib/mask/index.js +26 -0
  94. package/dist/ui/components/form/input-mask/lib/mask/types.d.ts +61 -0
  95. package/dist/ui/components/form/input-mask/lib/mask/useMask.d.ts +3 -0
  96. package/dist/ui/components/form/input-mask/lib/mask/useMask.js +150 -0
  97. package/dist/ui/components/form/input-mask/lib/mask/utils/filter.d.ts +1 -1
  98. package/dist/ui/components/form/input-mask/lib/mask/utils/format.d.ts +1 -1
  99. package/dist/ui/components/form/input-mask/lib/mask/utils/formatToParts.d.ts +1 -1
  100. package/dist/ui/components/form/input-mask/lib/mask/utils/formatToReplacementObject.d.ts +1 -1
  101. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.d.ts +1 -1
  102. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.js +3 -3
  103. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveSelection.d.ts +2 -2
  104. package/dist/ui/components/form/input-mask/lib/mask/utils/unformat.d.ts +1 -1
  105. package/dist/ui/components/form/input-mask/lib/mask/utils/validate.d.ts +1 -1
  106. package/dist/ui/components/form/input-mask/lib/mask/utils.d.ts +63 -0
  107. package/dist/ui/components/form/input-mask/lib/mask/utils.js +114 -0
  108. package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.d.ts +6 -0
  109. package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.js +58 -0
  110. package/dist/ui/components/form/input-mask/lib/number-format/index.d.ts +4 -0
  111. package/dist/ui/components/form/input-mask/lib/number-format/index.js +11 -0
  112. package/dist/ui/components/form/input-mask/lib/number-format/types.d.ts +26 -0
  113. package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.d.ts +3 -0
  114. package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.js +208 -0
  115. package/dist/ui/components/form/input-mask/lib/number-format/utils/localizeValues.d.ts +1 -1
  116. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.d.ts +2 -2
  117. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.js +1 -1
  118. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveMinimumFractionDigits.d.ts +1 -1
  119. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveOptions.d.ts +1 -1
  120. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveSelection.d.ts +2 -2
  121. package/dist/ui/components/form/input-youtube/index.js +1 -1
  122. package/dist/ui/components/form/input-youtube/index.js.map +1 -1
  123. package/dist/ui/contexts/toast/styles.js +1 -1
  124. package/dist/ui/contexts/toast/styles.js.map +1 -1
  125. package/dist/ui/icons/render/mobile.js +1 -1
  126. package/dist/ui/icons/render/mobile.js.map +1 -1
  127. package/dist/ui/styles/reset.css +356 -356
  128. package/package.json +1 -1
@@ -26,9 +26,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.PaginationTable = void 0;
27
27
  var jsx_runtime_1 = require("react/jsx-runtime");
28
28
  var router_1 = require("next/router");
29
- var ui_1 = require("../../../../../../../../ui");
30
- var service_1 = require("./service");
31
- var S = __importStar(require("./styles"));
29
+ var ui_1 = require("../../../../../../../../ui/index.js");
30
+ var service_1 = require("./service.js");
31
+ var S = __importStar(require("./styles.js"));
32
32
  function PaginationTable(_a) {
33
33
  var page = _a.page, endPage = _a.endPage, pages = _a.pages, pageSize = _a.pageSize, totalItems = _a.totalItems, hasNextPage = _a.hasNextPage, hasPreviousPage = _a.hasPreviousPage;
34
34
  var router = (0, router_1.useRouter)();
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.SkeletonTable = void 0;
27
27
  var jsx_runtime_1 = require("react/jsx-runtime");
28
- var ui_1 = require("../../../../../../../../ui");
29
- var S = __importStar(require("./styles"));
28
+ var ui_1 = require("../../../../../../../../ui/index.js");
29
+ var S = __importStar(require("./styles.js"));
30
30
  function SkeletonTable() {
31
31
  return ((0, jsx_runtime_1.jsx)(ui_1.Error, { name: 'skeleton', children: (0, jsx_runtime_1.jsxs)(S.SkeletonCustom, { "data-testid": 'skeleton', children: [(0, jsx_runtime_1.jsx)(ui_1.Skeleton, { type: 'line', size: { height: '60px', width: '100%', margin: "0" } }), (0, jsx_runtime_1.jsx)(ui_1.Skeleton, { type: 'line', size: { height: '60px', width: '100%', margin: "0" } }), (0, jsx_runtime_1.jsx)(ui_1.Skeleton, { type: 'line', size: { height: '60px', width: '100%', margin: "0" } }), (0, jsx_runtime_1.jsx)(ui_1.Skeleton, { type: 'line', size: { height: '60px', width: '100%', margin: "0" } }), (0, jsx_runtime_1.jsx)(ui_1.Skeleton, { type: 'line', size: { height: '60px', width: '100%', margin: "0" } }), (0, jsx_runtime_1.jsx)(ui_1.Skeleton, { type: 'line', size: { height: '60px', width: '100%', margin: "0" } }), (0, jsx_runtime_1.jsx)(ui_1.Skeleton, { type: 'line', size: { height: '60px', width: '100%', margin: "0" } }), (0, jsx_runtime_1.jsx)(ui_1.Skeleton, { type: 'line', size: { height: '60px', width: '100%', margin: "0" } }), (0, jsx_runtime_1.jsx)(ui_1.Skeleton, { type: 'line', size: { height: '60px', width: '100%', margin: "0" } })] }) }));
32
32
  }
@@ -1,2 +1,2 @@
1
- import { ITHeadItemProps } from './interfaces';
1
+ import { ITHeadItemProps } from './interfaces.js';
2
2
  export declare function THeadItem({ colunm, disableOrdenationTable }: ITHeadItemProps): import("react/jsx-runtime").JSX.Element;
@@ -26,8 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.THeadItem = void 0;
27
27
  var jsx_runtime_1 = require("react/jsx-runtime");
28
28
  var router_1 = require("next/router");
29
- var ui_1 = require("../../../../../../../../ui");
30
- var S = __importStar(require("./styles"));
29
+ var ui_1 = require("../../../../../../../../ui/index.js");
30
+ var S = __importStar(require("./styles.js"));
31
31
  function THeadItem(_a) {
32
32
  var colunm = _a.colunm, disableOrdenationTable = _a.disableOrdenationTable;
33
33
  var router = (0, router_1.useRouter)();
@@ -1,4 +1,4 @@
1
- import { Column } from "../../../interfaces";
1
+ import { Column } from "../../../interfaces.js";
2
2
  export interface ITHeadItemProps {
3
3
  index: number;
4
4
  colunm: Column;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //@ts-nocheck
4
- var utils_1 = require("../../../shared/utils");
5
- var window_1 = require("../../../ssr-window/window");
4
+ var utils_1 = require("../../../shared/utils.js");
5
+ var window_1 = require("../../../ssr-window/window.js");
6
6
  function Observer(_a) {
7
7
  var swiper = _a.swiper, extendParams = _a.extendParams, on = _a.on, emit = _a.emit;
8
8
  var observers = [];
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  //@ts-nocheck
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- var window_1 = require("../../../ssr-window/window");
4
+ var window_1 = require("../../../ssr-window/window.js");
5
5
  function Resize(_a) {
6
6
  var swiper = _a.swiper, on = _a.on, emit = _a.emit;
7
7
  var window = (0, window_1.getWindow)();
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var utils_1 = require("../../shared/utils.js");
4
+ function translateTo(translate, speed, runCallbacks, translateBounds, internal) {
5
+ var _a;
6
+ if (translate === void 0) { translate = 0; }
7
+ if (speed === void 0) { speed = this.params.speed; }
8
+ if (runCallbacks === void 0) { runCallbacks = true; }
9
+ if (translateBounds === void 0) { translateBounds = true; }
10
+ var swiper = this;
11
+ var params = swiper.params, wrapperEl = swiper.wrapperEl;
12
+ if (swiper.animating && params.preventInteractionOnTransition) {
13
+ return false;
14
+ }
15
+ var minTranslate = swiper.minTranslate();
16
+ var maxTranslate = swiper.maxTranslate();
17
+ var newTranslate;
18
+ if (translateBounds && translate > minTranslate)
19
+ newTranslate = minTranslate;
20
+ else if (translateBounds && translate < maxTranslate)
21
+ newTranslate = maxTranslate;
22
+ else
23
+ newTranslate = translate;
24
+ // Update progress
25
+ swiper.updateProgress(newTranslate);
26
+ if (params.cssMode) {
27
+ var isH = swiper.isHorizontal();
28
+ if (speed === 0) {
29
+ wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
30
+ }
31
+ else {
32
+ if (!swiper.support.smoothScroll) {
33
+ (0, utils_1.animateCSSModeScroll)({ swiper: swiper, targetPosition: -newTranslate, side: isH ? 'left' : 'top' });
34
+ return true;
35
+ }
36
+ wrapperEl.scrollTo((_a = {},
37
+ _a[isH ? 'left' : 'top'] = -newTranslate,
38
+ _a.behavior = 'smooth',
39
+ _a));
40
+ }
41
+ return true;
42
+ }
43
+ if (speed === 0) {
44
+ swiper.setTransition(0);
45
+ swiper.setTranslate(newTranslate);
46
+ if (runCallbacks) {
47
+ swiper.emit('beforeTransitionStart', speed, internal);
48
+ swiper.emit('transitionEnd');
49
+ }
50
+ }
51
+ else {
52
+ swiper.setTransition(speed);
53
+ swiper.setTranslate(newTranslate);
54
+ if (runCallbacks) {
55
+ swiper.emit('beforeTransitionStart', speed, internal);
56
+ swiper.emit('transitionStart');
57
+ }
58
+ if (!swiper.animating) {
59
+ swiper.animating = true;
60
+ if (!swiper.onTranslateToWrapperTransitionEnd) {
61
+ swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {
62
+ if (!swiper || swiper.destroyed)
63
+ return;
64
+ if (e.target !== this)
65
+ return;
66
+ swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
67
+ swiper.onTranslateToWrapperTransitionEnd = null;
68
+ delete swiper.onTranslateToWrapperTransitionEnd;
69
+ swiper.animating = false;
70
+ if (runCallbacks) {
71
+ swiper.emit('transitionEnd');
72
+ }
73
+ };
74
+ }
75
+ swiper.wrapperEl.addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
76
+ }
77
+ }
78
+ return true;
79
+ }
80
+ exports.default = translateTo;
81
+ //# sourceMappingURL=translateTo.js.map
@@ -0,0 +1,21 @@
1
+ import updateSize from './updateSize.js';
2
+ import updateSlides from './updateSlides.js';
3
+ import updateAutoHeight from './updateAutoHeight.js';
4
+ import updateSlidesOffset from './updateSlidesOffset.js';
5
+ import updateSlidesProgress from './updateSlidesProgress.js';
6
+ import updateProgress from './updateProgress.js';
7
+ import updateSlidesClasses from './updateSlidesClasses.js';
8
+ import updateActiveIndex from './updateActiveIndex.js';
9
+ import updateClickedSlide from './updateClickedSlide.js';
10
+ declare const _default: {
11
+ updateSize: typeof updateSize;
12
+ updateSlides: typeof updateSlides;
13
+ updateAutoHeight: typeof updateAutoHeight;
14
+ updateSlidesOffset: typeof updateSlidesOffset;
15
+ updateSlidesProgress: typeof updateSlidesProgress;
16
+ updateProgress: typeof updateProgress;
17
+ updateSlidesClasses: typeof updateSlidesClasses;
18
+ updateActiveIndex: typeof updateActiveIndex;
19
+ updateClickedSlide: typeof updateClickedSlide;
20
+ };
21
+ export default _default;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var updateSize_1 = __importDefault(require("./updateSize.js"));
7
+ var updateSlides_1 = __importDefault(require("./updateSlides.js"));
8
+ var updateAutoHeight_1 = __importDefault(require("./updateAutoHeight.js"));
9
+ var updateSlidesOffset_1 = __importDefault(require("./updateSlidesOffset.js"));
10
+ var updateSlidesProgress_1 = __importDefault(require("./updateSlidesProgress.js"));
11
+ var updateProgress_1 = __importDefault(require("./updateProgress.js"));
12
+ var updateSlidesClasses_1 = __importDefault(require("./updateSlidesClasses.js"));
13
+ var updateActiveIndex_1 = __importDefault(require("./updateActiveIndex.js"));
14
+ var updateClickedSlide_1 = __importDefault(require("./updateClickedSlide.js"));
15
+ exports.default = {
16
+ updateSize: updateSize_1.default,
17
+ updateSlides: updateSlides_1.default,
18
+ updateAutoHeight: updateAutoHeight_1.default,
19
+ updateSlidesOffset: updateSlidesOffset_1.default,
20
+ updateSlidesProgress: updateSlidesProgress_1.default,
21
+ updateProgress: updateProgress_1.default,
22
+ updateSlidesClasses: updateSlidesClasses_1.default,
23
+ updateActiveIndex: updateActiveIndex_1.default,
24
+ updateClickedSlide: updateClickedSlide_1.default,
25
+ };
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getActiveIndexByTranslate = void 0;
4
+ var process_lazy_preloader_1 = require("../../shared/process-lazy-preloader.js");
5
+ function getActiveIndexByTranslate(swiper) {
6
+ var slidesGrid = swiper.slidesGrid, params = swiper.params;
7
+ var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
8
+ var activeIndex;
9
+ for (var i = 0; i < slidesGrid.length; i += 1) {
10
+ if (typeof slidesGrid[i + 1] !== 'undefined') {
11
+ if (translate >= slidesGrid[i] &&
12
+ translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {
13
+ activeIndex = i;
14
+ }
15
+ else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {
16
+ activeIndex = i + 1;
17
+ }
18
+ }
19
+ else if (translate >= slidesGrid[i]) {
20
+ activeIndex = i;
21
+ }
22
+ }
23
+ // Normalize slideIndex
24
+ if (params.normalizeSlideIndex) {
25
+ if (activeIndex < 0 || typeof activeIndex === 'undefined')
26
+ activeIndex = 0;
27
+ }
28
+ return activeIndex;
29
+ }
30
+ exports.getActiveIndexByTranslate = getActiveIndexByTranslate;
31
+ function updateActiveIndex(newActiveIndex) {
32
+ var swiper = this;
33
+ var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
34
+ var snapGrid = swiper.snapGrid, params = swiper.params, previousIndex = swiper.activeIndex, previousRealIndex = swiper.realIndex, previousSnapIndex = swiper.snapIndex;
35
+ var activeIndex = newActiveIndex;
36
+ var snapIndex;
37
+ var getVirtualRealIndex = function (aIndex) {
38
+ var realIndex = aIndex - swiper.virtual.slidesBefore;
39
+ if (realIndex < 0) {
40
+ realIndex = swiper.virtual.slides.length + realIndex;
41
+ }
42
+ if (realIndex >= swiper.virtual.slides.length) {
43
+ realIndex -= swiper.virtual.slides.length;
44
+ }
45
+ return realIndex;
46
+ };
47
+ if (typeof activeIndex === 'undefined') {
48
+ activeIndex = getActiveIndexByTranslate(swiper);
49
+ }
50
+ if (snapGrid.indexOf(translate) >= 0) {
51
+ snapIndex = snapGrid.indexOf(translate);
52
+ }
53
+ else {
54
+ var skip = Math.min(params.slidesPerGroupSkip, activeIndex);
55
+ snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
56
+ }
57
+ if (snapIndex >= snapGrid.length)
58
+ snapIndex = snapGrid.length - 1;
59
+ if (activeIndex === previousIndex && !swiper.params.loop) {
60
+ if (snapIndex !== previousSnapIndex) {
61
+ swiper.snapIndex = snapIndex;
62
+ swiper.emit('snapIndexChange');
63
+ }
64
+ return;
65
+ }
66
+ if (activeIndex === previousIndex &&
67
+ swiper.params.loop &&
68
+ swiper.virtual &&
69
+ swiper.params.virtual.enabled) {
70
+ swiper.realIndex = getVirtualRealIndex(activeIndex);
71
+ return;
72
+ }
73
+ var gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
74
+ var normalizeSlideIndexToColumn = function (index) {
75
+ if (!gridEnabled)
76
+ return index;
77
+ return Math.floor(index / params.grid.rows);
78
+ };
79
+ // Get real index
80
+ var realIndex;
81
+ if (swiper.virtual && params.virtual.enabled && params.loop) {
82
+ realIndex = getVirtualRealIndex(activeIndex);
83
+ }
84
+ else if (gridEnabled) {
85
+ var firstSlideInColumn = swiper.slides.filter(function (slideEl) { return slideEl.column === activeIndex; })[0];
86
+ var activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10);
87
+ if (Number.isNaN(activeSlideIndex)) {
88
+ activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);
89
+ }
90
+ realIndex = Math.floor(activeSlideIndex / params.grid.rows);
91
+ }
92
+ else if (swiper.slides[activeIndex]) {
93
+ var slideIndex = swiper.slides[activeIndex].getAttribute('data-swiper-slide-index');
94
+ if (slideIndex) {
95
+ realIndex = parseInt(slideIndex, 10);
96
+ }
97
+ else {
98
+ realIndex = activeIndex;
99
+ }
100
+ }
101
+ else {
102
+ realIndex = activeIndex;
103
+ }
104
+ Object.assign(swiper, {
105
+ previousSnapIndex: previousSnapIndex,
106
+ snapIndex: snapIndex,
107
+ previousRealIndex: previousRealIndex,
108
+ realIndex: realIndex,
109
+ previousIndex: previousIndex,
110
+ activeIndex: activeIndex,
111
+ });
112
+ if (swiper.initialized) {
113
+ (0, process_lazy_preloader_1.preload)(swiper);
114
+ }
115
+ swiper.emit('activeIndexChange');
116
+ swiper.emit('snapIndexChange');
117
+ if (swiper.initialized || swiper.params.runCallbacksOnInit) {
118
+ if (previousRealIndex !== realIndex) {
119
+ swiper.emit('realIndexChange');
120
+ }
121
+ swiper.emit('slideChange');
122
+ }
123
+ }
124
+ exports.default = updateActiveIndex;
125
+ //# sourceMappingURL=updateActiveIndex.js.map
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //@ts-nocheck
4
+ var utils_1 = require("../../shared/utils.js");
5
+ function updateSize() {
6
+ var swiper = this;
7
+ var width;
8
+ var height;
9
+ var el = swiper.el;
10
+ if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {
11
+ width = swiper.params.width;
12
+ }
13
+ else {
14
+ width = el.clientWidth;
15
+ }
16
+ if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) {
17
+ height = swiper.params.height;
18
+ }
19
+ else {
20
+ height = el.clientHeight;
21
+ }
22
+ if ((width === 0 && swiper.isHorizontal()) || (height === 0 && swiper.isVertical())) {
23
+ return;
24
+ }
25
+ // Subtract paddings
26
+ width =
27
+ width -
28
+ parseInt((0, utils_1.elementStyle)(el, 'padding-left') || 0, 10) -
29
+ parseInt((0, utils_1.elementStyle)(el, 'padding-right') || 0, 10);
30
+ height =
31
+ height -
32
+ parseInt((0, utils_1.elementStyle)(el, 'padding-top') || 0, 10) -
33
+ parseInt((0, utils_1.elementStyle)(el, 'padding-bottom') || 0, 10);
34
+ if (Number.isNaN(width))
35
+ width = 0;
36
+ if (Number.isNaN(height))
37
+ height = 0;
38
+ Object.assign(swiper, {
39
+ width: width,
40
+ height: height,
41
+ size: swiper.isHorizontal() ? width : height,
42
+ });
43
+ }
44
+ exports.default = updateSize;
45
+ //# sourceMappingURL=updateSize.js.map