bootstrap-italia 2.13.4 → 2.14.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 (84) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +6 -0
  2. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  3. package/dist/bootstrap-italia.esm.js +1 -2
  4. package/dist/bootstrap-italia.esm.js.map +1 -1
  5. package/dist/css/bootstrap-italia.min.css +1 -1
  6. package/dist/css/bootstrap-italia.min.css.map +1 -1
  7. package/dist/js/bootstrap-italia.bundle.min.js +14 -8
  8. package/dist/js/bootstrap-italia.min.js +4 -4
  9. package/dist/plugins/back-to-top.js +0 -6
  10. package/dist/plugins/back-to-top.js.map +1 -1
  11. package/dist/plugins/button.js +3 -3
  12. package/dist/plugins/button.js.map +1 -1
  13. package/dist/plugins/carousel.js +183 -402
  14. package/dist/plugins/carousel.js.map +1 -1
  15. package/dist/plugins/forward.js.map +1 -1
  16. package/dist/plugins/header-sticky.js +1 -7
  17. package/dist/plugins/header-sticky.js.map +1 -1
  18. package/dist/plugins/input-label.js +5 -1
  19. package/dist/plugins/input-label.js.map +1 -1
  20. package/dist/plugins/input-number.js +5 -7
  21. package/dist/plugins/input-number.js.map +1 -1
  22. package/dist/plugins/masonry.js +8 -1
  23. package/dist/plugins/masonry.js.map +1 -1
  24. package/dist/plugins/select-autocomplete.js +66 -17
  25. package/dist/plugins/select-autocomplete.js.map +1 -1
  26. package/dist/plugins/tooltip.js +10 -0
  27. package/dist/plugins/tooltip.js.map +1 -1
  28. package/dist/plugins/track-focus.js +0 -6
  29. package/dist/plugins/track-focus.js.map +1 -1
  30. package/dist/plugins/util/pageScroll.js +1 -1
  31. package/dist/plugins/util/pageScroll.js.map +1 -1
  32. package/dist/plugins/vendor/accessible-autocomplete.js +9 -0
  33. package/dist/plugins/vendor/accessible-autocomplete.js.map +1 -0
  34. package/dist/svg/sprites.svg +1 -1
  35. package/dist/version.js +1 -1
  36. package/dist/version.js.map +1 -1
  37. package/package.json +2 -3
  38. package/src/js/bootstrap-italia.entry.js +0 -2
  39. package/src/js/bootstrap-italia.esm.js +1 -2
  40. package/src/js/icons.js +9 -0
  41. package/src/js/plugins/back-to-top.js +0 -6
  42. package/src/js/plugins/button.js +3 -3
  43. package/src/js/plugins/carousel.js +184 -402
  44. package/src/js/plugins/forward.js +0 -1
  45. package/src/js/plugins/header-sticky.js +1 -7
  46. package/src/js/plugins/input-label.js +5 -1
  47. package/src/js/plugins/input-number.js +5 -7
  48. package/src/js/plugins/masonry.js +8 -1
  49. package/src/js/plugins/select-autocomplete.js +67 -17
  50. package/src/js/plugins/tooltip.js +10 -0
  51. package/src/js/plugins/track-focus.js +0 -6
  52. package/src/js/plugins/util/pageScroll.js +1 -1
  53. package/src/js/plugins/vendor/accessible-autocomplete.js +1 -0
  54. package/src/js/version.js +1 -1
  55. package/src/scss/base/_variables.scss +1 -1
  56. package/src/scss/base/_version.scss +1 -1
  57. package/src/scss/components/_buttons.scss +1 -1
  58. package/src/scss/components/_carousel.scss +7 -235
  59. package/src/scss/components/_navigation.scss +1 -1
  60. package/src/scss/components/_tab.scss +4 -4
  61. package/src/scss/forms/_accessible-autocomplete.scss +0 -19
  62. package/src/scss/forms/_form-input-number.scss +1 -1
  63. package/src/scss/forms/_form-input-upload.scss +1 -1
  64. package/src/scss/forms/_form-toggles.scss +1 -1
  65. package/src/scss/forms/_forms.scss +2 -1
  66. package/src/scss/forms/_just-validate.scss +4 -4
  67. package/src/scss/utilities/focus.scss +26 -16
  68. package/src/svg/it-bluesky.svg +4 -0
  69. package/src/svg/it-car.svg +4 -0
  70. package/src/svg/it-cart.svg +5 -0
  71. package/src/svg/it-file-docx.svg +12 -0
  72. package/src/svg/it-file-image.svg +5 -0
  73. package/src/svg/it-file-signed.svg +16 -0
  74. package/src/svg/it-file-xlsx.svg +11 -0
  75. package/src/svg/it-sign.svg +8 -0
  76. package/src/svg/it-spotify.svg +4 -0
  77. package/types/index.d.ts +0 -2
  78. package/types/plugins/carousel.d.ts +42 -2
  79. package/dist/plugins/carousel-bi.js +0 -226
  80. package/dist/plugins/carousel-bi.js.map +0 -1
  81. package/dist/plugins/util/swipe.js +0 -150
  82. package/dist/plugins/util/swipe.js.map +0 -1
  83. package/src/js/plugins/carousel-bi.js +0 -225
  84. package/types/plugins/carousel-bi.d.ts +0 -57
@@ -1,226 +0,0 @@
1
- import Splide from '@splidejs/splide';
2
- import BaseComponent from './base-component.js';
3
- import SelectorEngine from './dom/selector-engine.js';
4
- import EventHandler from './dom/event-handler.js';
5
-
6
- /**
7
- * --------------------------------------------------------------------------
8
- * Bootstrap Italia (https://italia.github.io/bootstrap-italia/)
9
- * Authors: https://github.com/italia/bootstrap-italia/blob/main/AUTHORS
10
- * Licensed under BSD-3-Clause license (https://github.com/italia/bootstrap-italia/blob/main/LICENSE)
11
- * --------------------------------------------------------------------------
12
- */
13
-
14
-
15
- const NAME = 'carousel';
16
- const DATA_KEY = 'bs.carousel';
17
- const EVENT_KEY = `.${DATA_KEY}`;
18
- const DATA_API_KEY = '.data-api';
19
-
20
- //const EVENT_SCROLL = `scroll${EVENT_KEY}`
21
-
22
- const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`;
23
-
24
- const SELECTOR_CAROUSEL = '[data-bs-carousel-splide]';
25
-
26
- const CONFIG_DEFAULT = {
27
- slideFocus: true,
28
- i18n: {
29
- prev: 'Slide precedente',
30
- next: 'Slide successiva',
31
- first: 'Vai alla prima slide',
32
- last: 'Vai all’ultima slide',
33
- slideX: 'Vai alla slide %s',
34
- pageX: 'Vai a pagina %s',
35
- play: 'Attiva autoplay',
36
- pause: 'Pausa autoplay',
37
- },
38
- };
39
- const CONFIGS = {
40
- 'it-carousel-landscape-abstract-three-cols': {
41
- type: 'slide',
42
- perPage: 3,
43
- gap: 24,
44
- padding: { left: 0, right: 0 },
45
- arrows: false,
46
- breakpoints: {
47
- 768: {
48
- perPage: 1,
49
- gap: 24,
50
- padding: { left: 0, right: 0 },
51
- arrows: false,
52
- },
53
- 992: {
54
- perPage: 2,
55
- gap: 24,
56
- padding: { left: 40, right: 40 },
57
- arrows: false,
58
- },
59
- },
60
- },
61
- 'it-carousel-landscape-abstract-three-cols-arrow-visible': {
62
- type: 'slide',
63
- perPage: 3,
64
- gap: 24,
65
- padding: { left: 0, right: 0 },
66
- arrows: true,
67
- breakpoints: {
68
- 768: {
69
- perPage: 1,
70
- gap: 24,
71
- padding: { left: 40, right: 40 },
72
- arrows: true,
73
- },
74
- 992: {
75
- perPage: 2,
76
- gap: 24,
77
- padding: { left: 40, right: 40 },
78
- arrows: true,
79
- },
80
- },
81
- },
82
- 'it-big-img': {
83
- type: 'loop',
84
- perPage: 1,
85
- gap: 48,
86
- padding: { left: 320, right: 320 },
87
- arrows: false,
88
- breakpoints: {
89
- 768: {
90
- perPage: 1,
91
- gap: 0,
92
- padding: { left: 0, right: 0 },
93
- arrows: false,
94
- },
95
- 992: {
96
- perPage: 1,
97
- gap: 24,
98
- padding: { left: 160, right: 160 },
99
- arrows: false,
100
- },
101
- },
102
- },
103
- 'it-standard-image': {
104
- type: 'loop',
105
- perPage: 3,
106
- gap: 24,
107
- padding: { left: 48, right: 48 },
108
- arrows: false,
109
- breakpoints: {
110
- 768: {
111
- perPage: 1,
112
- gap: 24,
113
- padding: { left: 40, right: 40 },
114
- arrows: false,
115
- },
116
- 992: {
117
- perPage: 2,
118
- gap: 24,
119
- padding: { left: 48, right: 48 },
120
- arrows: false,
121
- },
122
- },
123
- },
124
- 'it-carousel-landscape-abstract': {
125
- type: 'slide',
126
- perPage: 1,
127
- gap: 24,
128
- padding: { left: 0, right: 0 },
129
- arrows: false,
130
- breakpoints: {
131
- 768: {
132
- perPage: 1,
133
- gap: 24,
134
- padding: { left: 0, right: 0 },
135
- arrows: false,
136
- },
137
- 992: {
138
- perPage: 1,
139
- gap: 24,
140
- padding: { left: 24, right: 24 },
141
- arrows: false,
142
- },
143
- },
144
- },
145
- 'it-calendar-wrapper': {
146
- type: 'slide',
147
- perPage: 4,
148
- gap: 0,
149
- padding: { left: 0, right: 0 },
150
- arrows: false,
151
- breakpoints: {
152
- 560: {
153
- perPage: 1,
154
- gap: 0,
155
- padding: { left: 24, right: 24 },
156
- arrows: false,
157
- },
158
- 768: {
159
- perPage: 2,
160
- gap: 0,
161
- padding: { left: 0, right: 0 },
162
- arrows: false,
163
- },
164
- 992: {
165
- perPage: 3,
166
- gap: 0,
167
- padding: { left: 0, right: 0 },
168
- arrows: false,
169
- },
170
- },
171
- },
172
- };
173
-
174
- class CarouselBI extends BaseComponent {
175
- constructor(element) {
176
- super(element);
177
- this._config = this._getConfig();
178
- this._splide = new Splide(this._element, this._config);
179
-
180
- this._init();
181
- }
182
-
183
- dispose() {
184
- this._splide.destroy();
185
- super.dispose();
186
- }
187
- // Getters
188
-
189
- static get NAME() {
190
- return NAME
191
- }
192
-
193
- // Public
194
-
195
- // Private
196
- _init() {
197
- this._splide.mount();
198
- }
199
-
200
- _getConfig() {
201
- let conf = Object.assign({}, CONFIG_DEFAULT);
202
- Object.keys(CONFIGS).forEach((classKey) => {
203
- if (this._element.classList.contains(classKey)) {
204
- conf = Object.assign({}, conf, CONFIGS[classKey]);
205
- }
206
- });
207
- return conf
208
- }
209
- }
210
-
211
- /**
212
- * ------------------------------------------------------------------------
213
- * Data Api implementation
214
- * ------------------------------------------------------------------------
215
- */
216
- if (typeof window !== 'undefined' && typeof document !== 'undefined') {
217
- EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
218
- const carousels = SelectorEngine.find(SELECTOR_CAROUSEL);
219
- carousels.forEach((carousel) => {
220
- CarouselBI.getOrCreateInstance(carousel);
221
- });
222
- });
223
- }
224
-
225
- export { CarouselBI as default };
226
- //# sourceMappingURL=carousel-bi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"carousel-bi.js","sources":["../../src/js/plugins/carousel-bi.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap Italia (https://italia.github.io/bootstrap-italia/)\n * Authors: https://github.com/italia/bootstrap-italia/blob/main/AUTHORS\n * Licensed under BSD-3-Clause license (https://github.com/italia/bootstrap-italia/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Splide from '@splidejs/splide'\n\nimport BaseComponent from './base-component.js'\nimport SelectorEngine from './dom/selector-engine'\nimport EventHandler from './dom/event-handler'\n\nconst NAME = 'carousel'\nconst DATA_KEY = 'bs.carousel'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\n//const EVENT_SCROLL = `scroll${EVENT_KEY}`\n\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\n\nconst SELECTOR_CAROUSEL = '[data-bs-carousel-splide]'\n\nconst CONFIG_DEFAULT = {\n slideFocus: true,\n i18n: {\n prev: 'Slide precedente',\n next: 'Slide successiva',\n first: 'Vai alla prima slide',\n last: 'Vai all’ultima slide',\n slideX: 'Vai alla slide %s',\n pageX: 'Vai a pagina %s',\n play: 'Attiva autoplay',\n pause: 'Pausa autoplay',\n },\n}\nconst CONFIGS = {\n 'it-carousel-landscape-abstract-three-cols': {\n type: 'slide',\n perPage: 3,\n gap: 24,\n padding: { left: 0, right: 0 },\n arrows: false,\n breakpoints: {\n 768: {\n perPage: 1,\n gap: 24,\n padding: { left: 0, right: 0 },\n arrows: false,\n },\n 992: {\n perPage: 2,\n gap: 24,\n padding: { left: 40, right: 40 },\n arrows: false,\n },\n },\n },\n 'it-carousel-landscape-abstract-three-cols-arrow-visible': {\n type: 'slide',\n perPage: 3,\n gap: 24,\n padding: { left: 0, right: 0 },\n arrows: true,\n breakpoints: {\n 768: {\n perPage: 1,\n gap: 24,\n padding: { left: 40, right: 40 },\n arrows: true,\n },\n 992: {\n perPage: 2,\n gap: 24,\n padding: { left: 40, right: 40 },\n arrows: true,\n },\n },\n },\n 'it-big-img': {\n type: 'loop',\n perPage: 1,\n gap: 48,\n padding: { left: 320, right: 320 },\n arrows: false,\n breakpoints: {\n 768: {\n perPage: 1,\n gap: 0,\n padding: { left: 0, right: 0 },\n arrows: false,\n },\n 992: {\n perPage: 1,\n gap: 24,\n padding: { left: 160, right: 160 },\n arrows: false,\n },\n },\n },\n 'it-standard-image': {\n type: 'loop',\n perPage: 3,\n gap: 24,\n padding: { left: 48, right: 48 },\n arrows: false,\n breakpoints: {\n 768: {\n perPage: 1,\n gap: 24,\n padding: { left: 40, right: 40 },\n arrows: false,\n },\n 992: {\n perPage: 2,\n gap: 24,\n padding: { left: 48, right: 48 },\n arrows: false,\n },\n },\n },\n 'it-carousel-landscape-abstract': {\n type: 'slide',\n perPage: 1,\n gap: 24,\n padding: { left: 0, right: 0 },\n arrows: false,\n breakpoints: {\n 768: {\n perPage: 1,\n gap: 24,\n padding: { left: 0, right: 0 },\n arrows: false,\n },\n 992: {\n perPage: 1,\n gap: 24,\n padding: { left: 24, right: 24 },\n arrows: false,\n },\n },\n },\n 'it-calendar-wrapper': {\n type: 'slide',\n perPage: 4,\n gap: 0,\n padding: { left: 0, right: 0 },\n arrows: false,\n breakpoints: {\n 560: {\n perPage: 1,\n gap: 0,\n padding: { left: 24, right: 24 },\n arrows: false,\n },\n 768: {\n perPage: 2,\n gap: 0,\n padding: { left: 0, right: 0 },\n arrows: false,\n },\n 992: {\n perPage: 3,\n gap: 0,\n padding: { left: 0, right: 0 },\n arrows: false,\n },\n },\n },\n}\n\nclass CarouselBI extends BaseComponent {\n constructor(element) {\n super(element)\n this._config = this._getConfig()\n this._splide = new Splide(this._element, this._config)\n\n this._init()\n }\n\n dispose() {\n this._splide.destroy()\n super.dispose()\n }\n // Getters\n\n static get NAME() {\n return NAME\n }\n\n // Public\n\n // Private\n _init() {\n this._splide.mount()\n }\n\n _getConfig() {\n let conf = Object.assign({}, CONFIG_DEFAULT)\n Object.keys(CONFIGS).forEach((classKey) => {\n if (this._element.classList.contains(classKey)) {\n conf = Object.assign({}, conf, CONFIGS[classKey])\n }\n })\n return conf\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\nif (typeof window !== 'undefined' && typeof document !== 'undefined') {\n EventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n const carousels = SelectorEngine.find(SELECTOR_CAROUSEL)\n carousels.forEach((carousel) => {\n CarouselBI.getOrCreateInstance(carousel)\n })\n })\n}\n\nexport default CarouselBI\n"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAQA,MAAM,IAAI,GAAG;AACb,MAAM,QAAQ,GAAG;AACjB,MAAM,SAAS,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC;AAC/B,MAAM,YAAY,GAAG;;AAErB;;AAEA,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,YAAY,CAAC;;AAE5D,MAAM,iBAAiB,GAAG;;AAE1B,MAAM,cAAc,GAAG;AACvB,EAAE,UAAU,EAAE,IAAI;AAClB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,kBAAkB;AAC5B,IAAI,IAAI,EAAE,kBAAkB;AAC5B,IAAI,KAAK,EAAE,sBAAsB;AACjC,IAAI,IAAI,EAAE,sBAAsB;AAChC,IAAI,MAAM,EAAE,mBAAmB;AAC/B,IAAI,KAAK,EAAE,iBAAiB;AAC5B,IAAI,IAAI,EAAE,iBAAiB;AAC3B,IAAI,KAAK,EAAE,gBAAgB;AAC3B,GAAG;AACH;AACA,MAAM,OAAO,GAAG;AAChB,EAAE,2CAA2C,EAAE;AAC/C,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,GAAG,EAAE,EAAE;AACX,IAAI,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;AAClC,IAAI,MAAM,EAAE,KAAK;AACjB,IAAI,WAAW,EAAE;AACjB,MAAM,GAAG,EAAE;AACX,QAAQ,OAAO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;AACL,IAAI,OAAO;AACX;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;AACtE,EAAE,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM;AACrD,IAAI,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,iBAAiB;AAC3D,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK;AACpC,MAAM,UAAU,CAAC,mBAAmB,CAAC,QAAQ;AAC7C,KAAK;AACL,GAAG;AACH;;;;"}
@@ -1,150 +0,0 @@
1
- import Config from './config.js';
2
- import EventHandler from '../dom/event-handler.js';
3
- import { execute } from './index.js';
4
-
5
- /**
6
- * --------------------------------------------------------------------------
7
- * Bootstrap Italia (https://italia.github.io/bootstrap-italia/)
8
- * Authors: https://github.com/italia/bootstrap-italia/blob/main/AUTHORS
9
- * Licensed under BSD-3-Clause license (https://github.com/italia/bootstrap-italia/blob/main/LICENSE)
10
- * This a fork of Bootstrap: Initial license and original file name below
11
- * Bootstrap (v5.2.3): util/swipe.js
12
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
13
- * --------------------------------------------------------------------------
14
- */
15
-
16
-
17
- /**
18
- * Constants
19
- */
20
-
21
- const NAME = 'swipe';
22
- const EVENT_KEY = '.bs.swipe';
23
- const EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`;
24
- const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`;
25
- const EVENT_TOUCHEND = `touchend${EVENT_KEY}`;
26
- const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`;
27
- const EVENT_POINTERUP = `pointerup${EVENT_KEY}`;
28
- const POINTER_TYPE_TOUCH = 'touch';
29
- const POINTER_TYPE_PEN = 'pen';
30
- const CLASS_NAME_POINTER_EVENT = 'pointer-event';
31
- const SWIPE_THRESHOLD = 40;
32
-
33
- const Default = {
34
- endCallback: null,
35
- leftCallback: null,
36
- rightCallback: null,
37
- };
38
-
39
- const DefaultType = {
40
- endCallback: '(function|null)',
41
- leftCallback: '(function|null)',
42
- rightCallback: '(function|null)',
43
- };
44
-
45
- /**
46
- * Class definition
47
- */
48
-
49
- class Swipe extends Config {
50
- constructor(element, config) {
51
- super();
52
- this._element = element;
53
-
54
- if (!element || !Swipe.isSupported()) {
55
- return
56
- }
57
-
58
- this._config = this._getConfig(config);
59
- this._deltaX = 0;
60
- this._supportPointerEvents = Boolean(window.PointerEvent);
61
- this._initEvents();
62
- }
63
-
64
- // Getters
65
- static get Default() {
66
- return Default
67
- }
68
-
69
- static get DefaultType() {
70
- return DefaultType
71
- }
72
-
73
- static get NAME() {
74
- return NAME
75
- }
76
-
77
- // Public
78
- dispose() {
79
- EventHandler.off(this._element, EVENT_KEY);
80
- }
81
-
82
- // Private
83
- _start(event) {
84
- if (!this._supportPointerEvents) {
85
- this._deltaX = event.touches[0].clientX;
86
-
87
- return
88
- }
89
-
90
- if (this._eventIsPointerPenTouch(event)) {
91
- this._deltaX = event.clientX;
92
- }
93
- }
94
-
95
- _end(event) {
96
- if (this._eventIsPointerPenTouch(event)) {
97
- this._deltaX = event.clientX - this._deltaX;
98
- }
99
-
100
- this._handleSwipe();
101
- execute(this._config.endCallback);
102
- }
103
-
104
- _move(event) {
105
- this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX;
106
- }
107
-
108
- _handleSwipe() {
109
- const absDeltaX = Math.abs(this._deltaX);
110
-
111
- if (absDeltaX <= SWIPE_THRESHOLD) {
112
- return
113
- }
114
-
115
- const direction = absDeltaX / this._deltaX;
116
-
117
- this._deltaX = 0;
118
-
119
- if (!direction) {
120
- return
121
- }
122
-
123
- execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback);
124
- }
125
-
126
- _initEvents() {
127
- if (this._supportPointerEvents) {
128
- EventHandler.on(this._element, EVENT_POINTERDOWN, (event) => this._start(event));
129
- EventHandler.on(this._element, EVENT_POINTERUP, (event) => this._end(event));
130
-
131
- this._element.classList.add(CLASS_NAME_POINTER_EVENT);
132
- } else {
133
- EventHandler.on(this._element, EVENT_TOUCHSTART, (event) => this._start(event));
134
- EventHandler.on(this._element, EVENT_TOUCHMOVE, (event) => this._move(event));
135
- EventHandler.on(this._element, EVENT_TOUCHEND, (event) => this._end(event));
136
- }
137
- }
138
-
139
- _eventIsPointerPenTouch(event) {
140
- return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)
141
- }
142
-
143
- // Static
144
- static isSupported() {
145
- return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0
146
- }
147
- }
148
-
149
- export { Swipe as default };
150
- //# sourceMappingURL=swipe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"swipe.js","sources":["../../../src/js/plugins/util/swipe.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap Italia (https://italia.github.io/bootstrap-italia/)\n * Authors: https://github.com/italia/bootstrap-italia/blob/main/AUTHORS\n * Licensed under BSD-3-Clause license (https://github.com/italia/bootstrap-italia/blob/main/LICENSE)\n * This a fork of Bootstrap: Initial license and original file name below\n * Bootstrap (v5.2.3): util/swipe.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Config from './config'\nimport EventHandler from '../dom/event-handler'\nimport { execute } from './index'\n\n/**\n * Constants\n */\n\nconst NAME = 'swipe'\nconst EVENT_KEY = '.bs.swipe'\nconst EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`\nconst EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`\nconst EVENT_TOUCHEND = `touchend${EVENT_KEY}`\nconst EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`\nconst EVENT_POINTERUP = `pointerup${EVENT_KEY}`\nconst POINTER_TYPE_TOUCH = 'touch'\nconst POINTER_TYPE_PEN = 'pen'\nconst CLASS_NAME_POINTER_EVENT = 'pointer-event'\nconst SWIPE_THRESHOLD = 40\n\nconst Default = {\n endCallback: null,\n leftCallback: null,\n rightCallback: null,\n}\n\nconst DefaultType = {\n endCallback: '(function|null)',\n leftCallback: '(function|null)',\n rightCallback: '(function|null)',\n}\n\n/**\n * Class definition\n */\n\nclass Swipe extends Config {\n constructor(element, config) {\n super()\n this._element = element\n\n if (!element || !Swipe.isSupported()) {\n return\n }\n\n this._config = this._getConfig(config)\n this._deltaX = 0\n this._supportPointerEvents = Boolean(window.PointerEvent)\n this._initEvents()\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n dispose() {\n EventHandler.off(this._element, EVENT_KEY)\n }\n\n // Private\n _start(event) {\n if (!this._supportPointerEvents) {\n this._deltaX = event.touches[0].clientX\n\n return\n }\n\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX\n }\n }\n\n _end(event) {\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX - this._deltaX\n }\n\n this._handleSwipe()\n execute(this._config.endCallback)\n }\n\n _move(event) {\n this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX\n }\n\n _handleSwipe() {\n const absDeltaX = Math.abs(this._deltaX)\n\n if (absDeltaX <= SWIPE_THRESHOLD) {\n return\n }\n\n const direction = absDeltaX / this._deltaX\n\n this._deltaX = 0\n\n if (!direction) {\n return\n }\n\n execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback)\n }\n\n _initEvents() {\n if (this._supportPointerEvents) {\n EventHandler.on(this._element, EVENT_POINTERDOWN, (event) => this._start(event))\n EventHandler.on(this._element, EVENT_POINTERUP, (event) => this._end(event))\n\n this._element.classList.add(CLASS_NAME_POINTER_EVENT)\n } else {\n EventHandler.on(this._element, EVENT_TOUCHSTART, (event) => this._start(event))\n EventHandler.on(this._element, EVENT_TOUCHMOVE, (event) => this._move(event))\n EventHandler.on(this._element, EVENT_TOUCHEND, (event) => this._end(event))\n }\n }\n\n _eventIsPointerPenTouch(event) {\n return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)\n }\n\n // Static\n static isSupported() {\n return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0\n }\n}\n\nexport default Swipe\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAMA;AACA;AACA;;AAEA,MAAM,IAAI,GAAG;AACb,MAAM,SAAS,GAAG;AAClB,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC;AAChD,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC;AAC9C,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC;AAC5C,MAAM,iBAAiB,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC;AAClD,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC;AAC9C,MAAM,kBAAkB,GAAG;AAC3B,MAAM,gBAAgB,GAAG;AACzB,MAAM,wBAAwB,GAAG;AACjC,MAAM,eAAe,GAAG;;AAExB,MAAM,OAAO,GAAG;AAChB,EAAE,WAAW,EAAE,IAAI;AACnB,EAAE,YAAY,EAAE,IAAI;AACpB,EAAE,aAAa,EAAE,IAAI;AACrB;;AAEA,MAAM,WAAW,GAAG;AACpB,EAAE,WAAW,EAAE,iBAAiB;AAChC,EAAE,YAAY,EAAE,iBAAiB;AACjC,EAAE,aAAa,EAAE,iBAAiB;AAClC;;AAEA;AACA;AACA;;AAEA,MAAM,KAAK,SAAS,MAAM,CAAC;AAC3B,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE;AAC/B,IAAI,KAAK;AACT,IAAI,IAAI,CAAC,QAAQ,GAAG;;AAEpB,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,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AC,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AAChF;AACA;;AAEA,EAAE,uBAAuB,CAAC,KAAK,EAAE;AACjC,IAAI,OAAO,IAAI,CAAC,qBAAqB,KAAK,KAAK,CAAC,WAAW,KAAK,gBAAgB,IAAI,KAAK,CAAC,WAAW,KAAK,kBAAkB;AAC5H;;AAEA;AACA,EAAE,OAAO,WAAW,GAAG;AACvB,IAAI,OAAO,cAAc,IAAI,QAAQ,CAAC,eAAe,IAAI,SAAS,CAAC,cAAc,GAAG;AACpF;AACA;;;;"}
@@ -1,225 +0,0 @@
1
- /**
2
- * --------------------------------------------------------------------------
3
- * Bootstrap Italia (https://italia.github.io/bootstrap-italia/)
4
- * Authors: https://github.com/italia/bootstrap-italia/blob/main/AUTHORS
5
- * Licensed under BSD-3-Clause license (https://github.com/italia/bootstrap-italia/blob/main/LICENSE)
6
- * --------------------------------------------------------------------------
7
- */
8
-
9
- import Splide from '@splidejs/splide'
10
-
11
- import BaseComponent from './base-component.js'
12
- import SelectorEngine from './dom/selector-engine'
13
- import EventHandler from './dom/event-handler'
14
-
15
- const NAME = 'carousel'
16
- const DATA_KEY = 'bs.carousel'
17
- const EVENT_KEY = `.${DATA_KEY}`
18
- const DATA_API_KEY = '.data-api'
19
-
20
- //const EVENT_SCROLL = `scroll${EVENT_KEY}`
21
-
22
- const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
23
-
24
- const SELECTOR_CAROUSEL = '[data-bs-carousel-splide]'
25
-
26
- const CONFIG_DEFAULT = {
27
- slideFocus: true,
28
- i18n: {
29
- prev: 'Slide precedente',
30
- next: 'Slide successiva',
31
- first: 'Vai alla prima slide',
32
- last: 'Vai all’ultima slide',
33
- slideX: 'Vai alla slide %s',
34
- pageX: 'Vai a pagina %s',
35
- play: 'Attiva autoplay',
36
- pause: 'Pausa autoplay',
37
- },
38
- }
39
- const CONFIGS = {
40
- 'it-carousel-landscape-abstract-three-cols': {
41
- type: 'slide',
42
- perPage: 3,
43
- gap: 24,
44
- padding: { left: 0, right: 0 },
45
- arrows: false,
46
- breakpoints: {
47
- 768: {
48
- perPage: 1,
49
- gap: 24,
50
- padding: { left: 0, right: 0 },
51
- arrows: false,
52
- },
53
- 992: {
54
- perPage: 2,
55
- gap: 24,
56
- padding: { left: 40, right: 40 },
57
- arrows: false,
58
- },
59
- },
60
- },
61
- 'it-carousel-landscape-abstract-three-cols-arrow-visible': {
62
- type: 'slide',
63
- perPage: 3,
64
- gap: 24,
65
- padding: { left: 0, right: 0 },
66
- arrows: true,
67
- breakpoints: {
68
- 768: {
69
- perPage: 1,
70
- gap: 24,
71
- padding: { left: 40, right: 40 },
72
- arrows: true,
73
- },
74
- 992: {
75
- perPage: 2,
76
- gap: 24,
77
- padding: { left: 40, right: 40 },
78
- arrows: true,
79
- },
80
- },
81
- },
82
- 'it-big-img': {
83
- type: 'loop',
84
- perPage: 1,
85
- gap: 48,
86
- padding: { left: 320, right: 320 },
87
- arrows: false,
88
- breakpoints: {
89
- 768: {
90
- perPage: 1,
91
- gap: 0,
92
- padding: { left: 0, right: 0 },
93
- arrows: false,
94
- },
95
- 992: {
96
- perPage: 1,
97
- gap: 24,
98
- padding: { left: 160, right: 160 },
99
- arrows: false,
100
- },
101
- },
102
- },
103
- 'it-standard-image': {
104
- type: 'loop',
105
- perPage: 3,
106
- gap: 24,
107
- padding: { left: 48, right: 48 },
108
- arrows: false,
109
- breakpoints: {
110
- 768: {
111
- perPage: 1,
112
- gap: 24,
113
- padding: { left: 40, right: 40 },
114
- arrows: false,
115
- },
116
- 992: {
117
- perPage: 2,
118
- gap: 24,
119
- padding: { left: 48, right: 48 },
120
- arrows: false,
121
- },
122
- },
123
- },
124
- 'it-carousel-landscape-abstract': {
125
- type: 'slide',
126
- perPage: 1,
127
- gap: 24,
128
- padding: { left: 0, right: 0 },
129
- arrows: false,
130
- breakpoints: {
131
- 768: {
132
- perPage: 1,
133
- gap: 24,
134
- padding: { left: 0, right: 0 },
135
- arrows: false,
136
- },
137
- 992: {
138
- perPage: 1,
139
- gap: 24,
140
- padding: { left: 24, right: 24 },
141
- arrows: false,
142
- },
143
- },
144
- },
145
- 'it-calendar-wrapper': {
146
- type: 'slide',
147
- perPage: 4,
148
- gap: 0,
149
- padding: { left: 0, right: 0 },
150
- arrows: false,
151
- breakpoints: {
152
- 560: {
153
- perPage: 1,
154
- gap: 0,
155
- padding: { left: 24, right: 24 },
156
- arrows: false,
157
- },
158
- 768: {
159
- perPage: 2,
160
- gap: 0,
161
- padding: { left: 0, right: 0 },
162
- arrows: false,
163
- },
164
- 992: {
165
- perPage: 3,
166
- gap: 0,
167
- padding: { left: 0, right: 0 },
168
- arrows: false,
169
- },
170
- },
171
- },
172
- }
173
-
174
- class CarouselBI extends BaseComponent {
175
- constructor(element) {
176
- super(element)
177
- this._config = this._getConfig()
178
- this._splide = new Splide(this._element, this._config)
179
-
180
- this._init()
181
- }
182
-
183
- dispose() {
184
- this._splide.destroy()
185
- super.dispose()
186
- }
187
- // Getters
188
-
189
- static get NAME() {
190
- return NAME
191
- }
192
-
193
- // Public
194
-
195
- // Private
196
- _init() {
197
- this._splide.mount()
198
- }
199
-
200
- _getConfig() {
201
- let conf = Object.assign({}, CONFIG_DEFAULT)
202
- Object.keys(CONFIGS).forEach((classKey) => {
203
- if (this._element.classList.contains(classKey)) {
204
- conf = Object.assign({}, conf, CONFIGS[classKey])
205
- }
206
- })
207
- return conf
208
- }
209
- }
210
-
211
- /**
212
- * ------------------------------------------------------------------------
213
- * Data Api implementation
214
- * ------------------------------------------------------------------------
215
- */
216
- if (typeof window !== 'undefined' && typeof document !== 'undefined') {
217
- EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
218
- const carousels = SelectorEngine.find(SELECTOR_CAROUSEL)
219
- carousels.forEach((carousel) => {
220
- CarouselBI.getOrCreateInstance(carousel)
221
- })
222
- })
223
- }
224
-
225
- export default CarouselBI
@@ -1,57 +0,0 @@
1
- import { default as BaseComponent } from 'bootstrap/js/dist/base-component'
2
- import { type GetInstanceFactory, type GetOrCreateInstanceFactory } from 'bootstrap/js/dist/base-component';
3
-
4
- import Splide from '@splidejs/splide'
5
-
6
- declare class CarouselBI extends BaseComponent {
7
-
8
- /**
9
- * Static method which allows you to get the instance associated
10
- * with a DOM element.
11
- */
12
- static getInstance: GetInstanceFactory<CarouselBI>;
13
- /**
14
- * Static method which allows you to get the modal instance associated with
15
- * a DOM element, or create a new one in case it wasn’t initialised
16
- */
17
- static getOrCreateInstance: GetOrCreateInstanceFactory<CarouselBI>;
18
-
19
- static get NAME(): string
20
-
21
- constructor(element: HTMLElement)
22
-
23
- _config: {
24
- slideFocus: boolean
25
- i18n: {
26
- prev: string
27
- next: string
28
- first: string
29
- last: string
30
- slideX: string
31
- pageX: string
32
- play: string
33
- pause: string
34
- }
35
- }
36
- _splide: Splide
37
-
38
- dispose(): void
39
-
40
- _init(): void
41
-
42
- _getConfig(): {
43
- slideFocus: boolean
44
- i18n: {
45
- prev: string
46
- next: string
47
- first: string
48
- last: string
49
- slideX: string
50
- pageX: string
51
- play: string
52
- pause: string
53
- }
54
- }
55
- }
56
-
57
- export { CarouselBI }