@paperless/core 0.1.0-alpha.93 → 0.1.0-alpha.96

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 (182) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/build/{p-130cf3bf.entry.js → p-0d70c55f.entry.js} +1 -1
  3. package/dist/build/{p-b0e40788.entry.js → p-1b98288f.entry.js} +1 -1
  4. package/dist/build/{p-4bdad085.entry.js → p-25198b24.entry.js} +1 -1
  5. package/dist/build/{p-b907dfa2.entry.js → p-2a0959e5.entry.js} +1 -1
  6. package/dist/build/p-2dd556e2.entry.js +1 -0
  7. package/dist/build/p-3a2cf6eb.entry.js +1 -0
  8. package/dist/build/{p-525e869e.entry.js → p-407db966.entry.js} +1 -1
  9. package/dist/build/p-4d70ec7d.js +2 -0
  10. package/dist/{paperless/p-d840b591.entry.js → build/p-5a1c29a0.entry.js} +1 -1
  11. package/dist/{paperless/p-e1fb3cc4.entry.js → build/p-5ad4da43.entry.js} +1 -1
  12. package/dist/build/{p-605baf6b.entry.js → p-5cf00406.entry.js} +1 -1
  13. package/dist/build/{p-493f54f5.entry.js → p-647a5ce0.entry.js} +1 -1
  14. package/dist/build/{p-98cbd176.entry.js → p-699ee4c5.entry.js} +1 -1
  15. package/dist/{paperless/p-63707c21.entry.js → build/p-727d7075.entry.js} +1 -1
  16. package/dist/build/{p-e0e4c3a1.entry.js → p-737b61be.entry.js} +1 -1
  17. package/dist/build/p-769abdaf.entry.js +1 -0
  18. package/dist/build/{p-92b7c5bf.entry.js → p-99fbfb12.entry.js} +1 -1
  19. package/dist/build/{p-8c86e126.entry.js → p-9dc4800e.entry.js} +1 -1
  20. package/dist/build/{p-a4605f92.entry.js → p-9ed56df0.entry.js} +1 -1
  21. package/dist/build/p-a8f73335.entry.js +1 -0
  22. package/dist/build/{p-1b07a1d7.entry.js → p-b4afb81b.entry.js} +1 -1
  23. package/dist/build/{p-328a57e3.entry.js → p-b54edf07.entry.js} +1 -1
  24. package/dist/build/{p-88ba16f2.entry.js → p-b626b4bc.entry.js} +1 -1
  25. package/dist/build/{p-bf7c23b9.entry.js → p-baba639b.entry.js} +1 -1
  26. package/dist/build/{p-04fe5795.entry.js → p-c4c7c07b.entry.js} +1 -1
  27. package/dist/build/{p-9336b7d2.entry.js → p-d676fecf.entry.js} +1 -1
  28. package/dist/build/{p-8fc9ce8a.entry.js → p-d7f022ac.entry.js} +1 -1
  29. package/dist/build/{p-d0fa1db4.entry.js → p-db62fa0f.entry.js} +1 -1
  30. package/dist/{paperless/p-847b8ca7.entry.js → build/p-e1937315.entry.js} +1 -1
  31. package/dist/build/{p-f8a80027.entry.js → p-eedc960d.entry.js} +1 -1
  32. package/dist/{paperless/p-144b1a05.entry.js → build/p-f560b80f.entry.js} +1 -1
  33. package/dist/build/{p-7dafe476.entry.js → p-f82c9ab6.entry.js} +1 -1
  34. package/dist/build/{p-9cf9c628.entry.js → p-f9ef9d25.entry.js} +1 -1
  35. package/dist/build/{p-59b10536.entry.js → p-fa6d3cee.entry.js} +1 -1
  36. package/dist/build/{p-ab459d05.entry.js → p-faf607d9.entry.js} +1 -1
  37. package/dist/build/paperless.esm.js +1 -1
  38. package/dist/cjs/{index-0aa7c87d.js → index-5fdb82a1.js} +37 -4
  39. package/dist/cjs/loader.cjs.js +3 -3
  40. package/dist/cjs/p-accordion.cjs.entry.js +1 -1
  41. package/dist/cjs/p-avatar-group.cjs.entry.js +1 -1
  42. package/dist/cjs/p-avatar_2.cjs.entry.js +2 -2
  43. package/dist/cjs/p-button_3.cjs.entry.js +1 -1
  44. package/dist/cjs/p-card-body.cjs.entry.js +1 -1
  45. package/dist/cjs/p-card-container.cjs.entry.js +1 -1
  46. package/dist/cjs/p-card-header.cjs.entry.js +1 -1
  47. package/dist/cjs/p-content-slider.cjs.entry.js +63 -33
  48. package/dist/cjs/p-counter.cjs.entry.js +1 -1
  49. package/dist/cjs/p-divider.cjs.entry.js +1 -1
  50. package/dist/cjs/p-dropdown-menu-container.cjs.entry.js +1 -1
  51. package/dist/cjs/p-dropdown-menu-item.cjs.entry.js +1 -1
  52. package/dist/cjs/p-helper.cjs.entry.js +1 -1
  53. package/dist/cjs/p-illustration.cjs.entry.js +1 -1
  54. package/dist/cjs/p-info-panel.cjs.entry.js +1 -1
  55. package/dist/cjs/p-input-group.cjs.entry.js +1 -1
  56. package/dist/cjs/p-layout.cjs.entry.js +1 -1
  57. package/dist/cjs/p-modal-backdrop_5.cjs.entry.js +1 -1
  58. package/dist/cjs/p-modal.cjs.entry.js +1 -1
  59. package/dist/cjs/p-navbar.cjs.entry.js +1 -1
  60. package/dist/cjs/p-navigation-item.cjs.entry.js +1 -1
  61. package/dist/cjs/p-pagination-item.cjs.entry.js +1 -1
  62. package/dist/cjs/p-pagination.cjs.entry.js +1 -1
  63. package/dist/cjs/p-profile.cjs.entry.js +2 -2
  64. package/dist/cjs/p-segment-container.cjs.entry.js +1 -1
  65. package/dist/cjs/p-segment-item.cjs.entry.js +1 -1
  66. package/dist/cjs/p-slider-indicator.cjs.entry.js +2 -2
  67. package/dist/cjs/p-status.cjs.entry.js +1 -1
  68. package/dist/cjs/p-stepper-item_2.cjs.entry.js +1 -1
  69. package/dist/cjs/p-stepper.cjs.entry.js +1 -1
  70. package/dist/cjs/p-tab-group.cjs.entry.js +1 -1
  71. package/dist/cjs/p-tab-item.cjs.entry.js +1 -1
  72. package/dist/cjs/p-tag.cjs.entry.js +1 -1
  73. package/dist/cjs/p-tooltip.cjs.entry.js +1 -1
  74. package/dist/cjs/paperless.cjs.js +3 -3
  75. package/dist/collection/collection-manifest.json +1 -1
  76. package/dist/collection/components/atoms/avatar/avatar.component.css +1 -1
  77. package/dist/collection/components/atoms/divider/divider.component.css +1 -1
  78. package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.css +1 -1
  79. package/dist/collection/components/atoms/icon/icon.component.css +1 -1
  80. package/dist/collection/components/atoms/modal-backdrop/modal-backdrop.component.css +1 -1
  81. package/dist/collection/components/atoms/modal-body/modal-body.component.css +1 -1
  82. package/dist/collection/components/atoms/modal-container/modal-container.component.css +1 -1
  83. package/dist/collection/components/atoms/modal-footer/modal-footer.component.css +1 -1
  84. package/dist/collection/components/atoms/modal-header/modal-header.component.css +1 -1
  85. package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.css +1 -1
  86. package/dist/collection/components/molecules/content-slider/content-slider.component.css +12 -13
  87. package/dist/collection/components/molecules/content-slider/content-slider.component.js +70 -37
  88. package/dist/collection/components/molecules/dropdown/dropdown.component.css +1 -1
  89. package/dist/collection/components/molecules/profile/profile.component.css +1 -1
  90. package/dist/components/avatar.component.js +1 -1
  91. package/dist/components/index.d.ts +42 -42
  92. package/dist/components/p-content-slider.js +65 -33
  93. package/dist/components/p-profile.js +1 -1
  94. package/dist/components/slider-indicator.component.js +1 -1
  95. package/dist/esm/{index-877dd68e.js → index-ba915982.js} +37 -4
  96. package/dist/esm/loader.js +3 -3
  97. package/dist/esm/p-accordion.entry.js +1 -1
  98. package/dist/esm/p-avatar-group.entry.js +1 -1
  99. package/dist/esm/p-avatar_2.entry.js +2 -2
  100. package/dist/esm/p-button_3.entry.js +1 -1
  101. package/dist/esm/p-card-body.entry.js +1 -1
  102. package/dist/esm/p-card-container.entry.js +1 -1
  103. package/dist/esm/p-card-header.entry.js +1 -1
  104. package/dist/esm/p-content-slider.entry.js +63 -33
  105. package/dist/esm/p-counter.entry.js +1 -1
  106. package/dist/esm/p-divider.entry.js +1 -1
  107. package/dist/esm/p-dropdown-menu-container.entry.js +1 -1
  108. package/dist/esm/p-dropdown-menu-item.entry.js +1 -1
  109. package/dist/esm/p-helper.entry.js +1 -1
  110. package/dist/esm/p-illustration.entry.js +1 -1
  111. package/dist/esm/p-info-panel.entry.js +1 -1
  112. package/dist/esm/p-input-group.entry.js +1 -1
  113. package/dist/esm/p-layout.entry.js +1 -1
  114. package/dist/esm/p-modal-backdrop_5.entry.js +1 -1
  115. package/dist/esm/p-modal.entry.js +1 -1
  116. package/dist/esm/p-navbar.entry.js +1 -1
  117. package/dist/esm/p-navigation-item.entry.js +1 -1
  118. package/dist/esm/p-pagination-item.entry.js +1 -1
  119. package/dist/esm/p-pagination.entry.js +1 -1
  120. package/dist/esm/p-profile.entry.js +2 -2
  121. package/dist/esm/p-segment-container.entry.js +1 -1
  122. package/dist/esm/p-segment-item.entry.js +1 -1
  123. package/dist/esm/p-slider-indicator.entry.js +2 -2
  124. package/dist/esm/p-status.entry.js +1 -1
  125. package/dist/esm/p-stepper-item_2.entry.js +1 -1
  126. package/dist/esm/p-stepper.entry.js +1 -1
  127. package/dist/esm/p-tab-group.entry.js +1 -1
  128. package/dist/esm/p-tab-item.entry.js +1 -1
  129. package/dist/esm/p-tag.entry.js +1 -1
  130. package/dist/esm/p-tooltip.entry.js +1 -1
  131. package/dist/esm/paperless.js +3 -3
  132. package/dist/index.html +1 -1
  133. package/dist/paperless/{p-130cf3bf.entry.js → p-0d70c55f.entry.js} +1 -1
  134. package/dist/paperless/{p-b0e40788.entry.js → p-1b98288f.entry.js} +1 -1
  135. package/dist/paperless/{p-4bdad085.entry.js → p-25198b24.entry.js} +1 -1
  136. package/dist/paperless/{p-b907dfa2.entry.js → p-2a0959e5.entry.js} +1 -1
  137. package/dist/paperless/p-2dd556e2.entry.js +1 -0
  138. package/dist/paperless/p-3a2cf6eb.entry.js +1 -0
  139. package/dist/paperless/{p-525e869e.entry.js → p-407db966.entry.js} +1 -1
  140. package/dist/paperless/p-4d70ec7d.js +2 -0
  141. package/dist/{build/p-d840b591.entry.js → paperless/p-5a1c29a0.entry.js} +1 -1
  142. package/dist/{build/p-e1fb3cc4.entry.js → paperless/p-5ad4da43.entry.js} +1 -1
  143. package/dist/paperless/{p-605baf6b.entry.js → p-5cf00406.entry.js} +1 -1
  144. package/dist/paperless/{p-493f54f5.entry.js → p-647a5ce0.entry.js} +1 -1
  145. package/dist/paperless/{p-98cbd176.entry.js → p-699ee4c5.entry.js} +1 -1
  146. package/dist/{build/p-63707c21.entry.js → paperless/p-727d7075.entry.js} +1 -1
  147. package/dist/paperless/{p-e0e4c3a1.entry.js → p-737b61be.entry.js} +1 -1
  148. package/dist/paperless/p-769abdaf.entry.js +1 -0
  149. package/dist/paperless/{p-92b7c5bf.entry.js → p-99fbfb12.entry.js} +1 -1
  150. package/dist/paperless/{p-8c86e126.entry.js → p-9dc4800e.entry.js} +1 -1
  151. package/dist/paperless/{p-a4605f92.entry.js → p-9ed56df0.entry.js} +1 -1
  152. package/dist/paperless/p-a8f73335.entry.js +1 -0
  153. package/dist/paperless/{p-1b07a1d7.entry.js → p-b4afb81b.entry.js} +1 -1
  154. package/dist/paperless/{p-328a57e3.entry.js → p-b54edf07.entry.js} +1 -1
  155. package/dist/paperless/{p-88ba16f2.entry.js → p-b626b4bc.entry.js} +1 -1
  156. package/dist/paperless/{p-bf7c23b9.entry.js → p-baba639b.entry.js} +1 -1
  157. package/dist/paperless/{p-04fe5795.entry.js → p-c4c7c07b.entry.js} +1 -1
  158. package/dist/paperless/{p-9336b7d2.entry.js → p-d676fecf.entry.js} +1 -1
  159. package/dist/paperless/{p-8fc9ce8a.entry.js → p-d7f022ac.entry.js} +1 -1
  160. package/dist/paperless/{p-d0fa1db4.entry.js → p-db62fa0f.entry.js} +1 -1
  161. package/dist/{build/p-847b8ca7.entry.js → paperless/p-e1937315.entry.js} +1 -1
  162. package/dist/paperless/{p-f8a80027.entry.js → p-eedc960d.entry.js} +1 -1
  163. package/dist/{build/p-144b1a05.entry.js → paperless/p-f560b80f.entry.js} +1 -1
  164. package/dist/paperless/{p-7dafe476.entry.js → p-f82c9ab6.entry.js} +1 -1
  165. package/dist/paperless/{p-9cf9c628.entry.js → p-f9ef9d25.entry.js} +1 -1
  166. package/dist/paperless/{p-59b10536.entry.js → p-fa6d3cee.entry.js} +1 -1
  167. package/dist/paperless/{p-ab459d05.entry.js → p-faf607d9.entry.js} +1 -1
  168. package/dist/paperless/paperless.esm.js +1 -1
  169. package/dist/sw.js +1 -1
  170. package/dist/sw.js.map +1 -1
  171. package/dist/types/components/molecules/content-slider/content-slider.component.d.ts +10 -3
  172. package/package.json +8 -8
  173. package/dist/build/p-10cfb50e.entry.js +0 -1
  174. package/dist/build/p-2cd125cc.js +0 -2
  175. package/dist/build/p-4d87de71.entry.js +0 -1
  176. package/dist/build/p-9aff0409.entry.js +0 -1
  177. package/dist/build/p-f073bd80.entry.js +0 -1
  178. package/dist/paperless/p-10cfb50e.entry.js +0 -1
  179. package/dist/paperless/p-2cd125cc.js +0 -2
  180. package/dist/paperless/p-4d87de71.entry.js +0 -1
  181. package/dist/paperless/p-9aff0409.entry.js +0 -1
  182. package/dist/paperless/p-f073bd80.entry.js +0 -1
@@ -1,27 +1,26 @@
1
1
  :host {
2
- @apply flex flex-col gap-4;
3
- @apply -mx-4;
2
+ @apply flex flex-col gap-4 overflow-hidden;
3
+ @apply p-10 -m-10;
4
4
  }
5
- :host .content {
6
- @apply flex flex-nowrap items-stretch overflow-x-auto gap-2 relative;
7
- @apply tablet:gap-4 desktop-xs:flex-wrap;
8
- @apply p-4 -my-4;
5
+ :host .slider {
6
+ @apply overflow-visible relative box-content;
9
7
  }
10
- :host .content.draggable {
8
+ :host .slider.draggable {
11
9
  @apply cursor-grab desktop-xs:cursor-default;
12
10
  }
13
- :host .content.draggable.dragging {
11
+ :host .slider.draggable.dragging {
14
12
  @apply cursor-grabbing desktop-xs:cursor-default;
15
13
  }
16
- :host .content > ::slotted(*) {
14
+ :host .slider .inner-slider {
15
+ @apply absolute flex flex-nowrap items-stretch w-full gap-2;
16
+ @apply tablet:gap-4 desktop-xs:flex-wrap;
17
+ }
18
+ :host .slider .inner-slider > ::slotted(*) {
17
19
  @apply w-full tablet:w-[45%] desktop-xs:w-full;
18
20
  @apply flex-shrink-0 desktop-xs:flex-1;
19
21
  position: relative;
20
22
  z-index: 10;
21
23
  }
22
- :host .content::-webkit-scrollbar {
23
- display: none;
24
- }
25
24
  :host .indicator {
26
25
  @apply flex justify-center items-center gap-2 desktop-xs:hidden;
27
- } .visible{visibility:visible!important}.static{position:static!important}.hidden{display:none!important}.cursor-pointer{cursor:pointer!important}*{box-sizing:border-box}.static{position:static!important}*{box-sizing:border-box}
26
+ } .visible{visibility:visible!important}.static{position:static!important}.hidden{display:none!important}.cursor-pointer{cursor:pointer!important}.resize{resize:both!important}*{box-sizing:border-box}.static{position:static!important}*{box-sizing:border-box}
@@ -1,4 +1,4 @@
1
- import { Component, Element, h, Host, Listen, Prop, State, } from '@stencil/core';
1
+ import { Component, Element, h, Host, Listen, Prop, State } from '@stencil/core';
2
2
  export class ContentSlider {
3
3
  constructor() {
4
4
  /**
@@ -13,22 +13,32 @@ export class ContentSlider {
13
13
  * Wether to disable clicking the indicator scrolls content
14
14
  */
15
15
  this.disableIndicatorClick = false;
16
+ this._outerHeight = 0;
17
+ this._totalWidth = 0;
16
18
  this._items = [];
17
- // mouse movement stuff
18
- this._pos = { top: 0, left: 0, x: 0, y: 0 };
19
19
  this._dragging = false;
20
20
  }
21
21
  componentWillRender() {
22
22
  const items = this._el.querySelectorAll(':scope > *');
23
23
  this._items = Array.from(items);
24
24
  }
25
+ componentDidRender() {
26
+ const outerHeight = this._items.at(0).getBoundingClientRect().height;
27
+ if (outerHeight != this._outerHeight) {
28
+ this._outerHeight = outerHeight;
29
+ }
30
+ }
25
31
  componentDidLoad() {
32
+ this._calculateWidth();
26
33
  this._calculateIndicator();
27
34
  }
28
35
  render() {
29
36
  return (h(Host, { class: "p-content-slider" },
30
- h("div", { class: `content ${!this.disableDrag && 'draggable'} ${this._dragging && 'dragging'}`, ref: (el) => (this._contentRef = el), onScroll: () => this._handleScroll(), onMouseDown: (e) => this._mouseDownHandler(e) },
31
- h("slot", null)),
37
+ h("div", { class: `slider ${!this.disableDrag && 'draggable'} ${this._dragging && 'dragging'}`, style: {
38
+ height: `${this._outerHeight}px`,
39
+ }, ref: (el) => (this._sliderRef = el), onScroll: () => this._handleScroll(), onMouseDown: (e) => this._mouseDownHandler(e), onMouseMove: (e) => this._mouseMoveHandler(e) },
40
+ h("div", { class: "inner-slider", ref: (ref) => (this._innerSliderRef = ref) },
41
+ h("slot", null))),
32
42
  h("div", { class: `indicator ${this.hideMobileIndicator && 'hidden'}` }, this._items.map((_, i) => (h("p-slider-indicator", { class: !this.disableIndicatorClick && 'cursor-pointer', onClick: () => this._scrollTo(i), active: i === this._visibleIndex }))))));
33
43
  }
34
44
  _handleScroll() {
@@ -41,30 +51,37 @@ export class ContentSlider {
41
51
  if (this.disableDrag || this._dragging) {
42
52
  return;
43
53
  }
44
- this._pos = {
45
- // The current scroll
46
- left: this._contentRef.scrollLeft,
47
- top: this._contentRef.scrollTop,
48
- // Get the current mouse position
49
- x: e.clientX,
50
- y: e.clientY,
51
- };
54
+ this._startX = e.offsetX - this._innerSliderRef.offsetLeft;
52
55
  this._dragging = true;
53
56
  }
54
- mouseMoveHandler(e) {
57
+ _mouseMoveHandler(e) {
55
58
  if (!e || !this._dragging || this.disableDrag) {
56
59
  return;
57
60
  }
58
- // How far the mouse has been moved
59
- const dx = e.clientX - this._pos.x;
60
- const dy = e.clientY - this._pos.y;
61
- // Scroll the element
62
- this._contentRef.scrollTop = this._pos.top - dy;
63
- this._contentRef.scrollLeft = this._pos.left - dx;
61
+ e.preventDefault();
62
+ const x = e.offsetX;
63
+ this._innerSliderRef.style.left = `${x - this._startX}px`;
64
+ this._checkBoundary();
65
+ this._calculateIndicator();
66
+ }
67
+ _checkBoundary() {
68
+ let outer = this._sliderRef.getBoundingClientRect();
69
+ if (parseInt(this._innerSliderRef.style.left) > 0) {
70
+ this._innerSliderRef.style.left = '0px';
71
+ }
72
+ const maxLeft = (this._totalWidth - outer.width) * -1;
73
+ if (parseInt(this._innerSliderRef.style.left) < maxLeft) {
74
+ this._innerSliderRef.style.left = `${maxLeft}px`;
75
+ }
64
76
  }
65
77
  mouseUpHandler() {
66
78
  this._dragging = false;
67
79
  }
80
+ resizeHandler() {
81
+ this._innerSliderRef.style.left = '0px';
82
+ this._calculateWidth();
83
+ this._calculateIndicator();
84
+ }
68
85
  _calculateIndicator() {
69
86
  for (let i = 0; i < this._items.length; i++) {
70
87
  const item = this._items[i];
@@ -78,28 +95,42 @@ export class ContentSlider {
78
95
  }
79
96
  }
80
97
  _isVisible(el) {
81
- if (!this._el || !this._contentRef || !el) {
98
+ if (!this._el || !el) {
82
99
  return false;
83
100
  }
84
101
  const elRect = el.getBoundingClientRect();
85
- const containerRect = this._el.getBoundingClientRect();
86
- return (elRect.left > containerRect.left &&
87
- elRect.right < containerRect.right);
102
+ const sliderRect = this._sliderRef.getBoundingClientRect();
103
+ return (elRect.left >= sliderRect.left && elRect.right <= sliderRect.right);
88
104
  }
89
105
  _scrollTo(i) {
90
106
  if (this.disableIndicatorClick) {
91
107
  return;
92
108
  }
93
109
  const el = this._items[i];
94
- const parent = el.offsetParent;
95
- const parentStyle = getComputedStyle(parent);
96
- const gap = parseInt(parentStyle.gap.replace('px', ''));
97
- const padding = parseInt(parentStyle['paddingLeft'].replace('px', '')) +
98
- parseInt(parentStyle['paddingRight'].replace('px', ''));
99
- this._contentRef.scrollTo({
100
- left: el.offsetLeft - gap - padding - el.clientWidth / 2,
101
- behavior: 'smooth',
102
- });
110
+ if (i === 0) {
111
+ this._innerSliderRef.style.left = '0px';
112
+ this._calculateIndicator();
113
+ return;
114
+ }
115
+ const sliderRect = this._sliderRef.getBoundingClientRect();
116
+ const elRect = el.getBoundingClientRect();
117
+ const centerOffset = el.offsetLeft + elRect.width / 2 - sliderRect.width / 2;
118
+ this._innerSliderRef.style.left = `-${centerOffset}px`;
119
+ this._checkBoundary();
120
+ this._calculateIndicator();
121
+ }
122
+ _calculateWidth() {
123
+ let totalWidth = 0;
124
+ for (let item of this._items) {
125
+ const rect = item.getBoundingClientRect();
126
+ totalWidth += rect.width;
127
+ }
128
+ const sliderStyle = getComputedStyle(this._sliderRef);
129
+ const padding = parseInt(sliderStyle.padding) * 2;
130
+ const innerSliderStyle = getComputedStyle(this._innerSliderRef);
131
+ const gap = parseInt(innerSliderStyle.gap) * (this._items.length - 1);
132
+ totalWidth += padding + gap;
133
+ this._totalWidth = totalWidth;
103
134
  }
104
135
  static get is() { return "p-content-slider"; }
105
136
  static get encapsulation() { return "shadow"; }
@@ -167,18 +198,20 @@ export class ContentSlider {
167
198
  }; }
168
199
  static get states() { return {
169
200
  "_visibleIndex": {},
201
+ "_outerHeight": {},
202
+ "_totalWidth": {},
170
203
  "_dragging": {}
171
204
  }; }
172
205
  static get elementRef() { return "_el"; }
173
206
  static get listeners() { return [{
174
- "name": "mousemove",
175
- "method": "mouseMoveHandler",
207
+ "name": "mouseup",
208
+ "method": "mouseUpHandler",
176
209
  "target": "window",
177
210
  "capture": false,
178
211
  "passive": true
179
212
  }, {
180
- "name": "mouseup",
181
- "method": "mouseUpHandler",
213
+ "name": "resize",
214
+ "method": "resizeHandler",
182
215
  "target": "window",
183
216
  "capture": false,
184
217
  "passive": true
@@ -9,4 +9,4 @@
9
9
  }
10
10
  :host p-dropdown-menu-container[data-show] {
11
11
  @apply flex;
12
- } .static{position:static!important}.absolute{position:absolute!important}.ml-auto{margin-left:auto!important}.flex{display:flex!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}*{box-sizing:border-box}.visible{visibility:visible!important}.fixed{position:fixed!important}*{box-sizing:border-box}.visible{visibility:visible!important}.fixed{position:fixed!important}*{box-sizing:border-box}.static{position:static!important}*{box-sizing:border-box}
12
+ } .static{position:static!important}.absolute{position:absolute!important}.ml-auto{margin-left:auto!important}.flex{display:flex!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}*{box-sizing:border-box}.visible{visibility:visible!important}.static{position:static!important}.fixed{position:fixed!important}*{box-sizing:border-box}.static{position:static!important}*{box-sizing:border-box}
@@ -33,4 +33,4 @@
33
33
 
34
34
  :host(.active) .content p-icon {
35
35
  @apply text-indigo;
36
- } .static{position:static!important}.absolute{position:absolute!important}.ml-auto{margin-left:auto!important}.flex{display:flex!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}*{box-sizing:border-box}.visible{visibility:visible!important}.fixed{position:fixed!important}*{box-sizing:border-box}
36
+ } .static{position:static!important}.absolute{position:absolute!important}.ml-auto{margin-left:auto!important}.flex{display:flex!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}*{box-sizing:border-box}
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
 
3
- const avatarComponentCss = ".visible{visibility:visible!important}.static{position:static!important}.fixed{position:fixed!important}.absolute{position:absolute!important}.ml-auto{margin-left:auto!important}.flex{display:flex!important}.w-8{width:2rem!important}.w-\\[3\\.125rem\\]{width:3.125rem!important}.w-16{width:4rem!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}.rounded{border-radius:.25rem!important}.object-cover{-o-object-fit:cover!important;object-fit:cover!important}*{box-sizing:border-box}p-avatar{display:inline-block}p-avatar>img{-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}p-avatar[size=small]>img{height:2rem;width:2rem}p-avatar[size=medium]>img{height:3.125rem;width:3.125rem}p-avatar[size=large]>img{height:4rem;width:4rem}p-avatar[variant=company]>img{border-radius:.25rem}p-avatar[variant=company][size=large]>img,p-avatar[variant=company][size=medium]>img{border-radius:.375rem}p-avatar[variant=user]>img{border-radius:100%}";
3
+ const avatarComponentCss = ".static{position:static!important}.absolute{position:absolute!important}.ml-auto{margin-left:auto!important}.flex{display:flex!important}.w-8{width:2rem!important}.w-\\[3\\.125rem\\]{width:3.125rem!important}.w-16{width:4rem!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}.rounded{border-radius:.25rem!important}.object-cover{-o-object-fit:cover!important;object-fit:cover!important}*{box-sizing:border-box}p-avatar{display:inline-block}p-avatar>img{-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}p-avatar[size=small]>img{height:2rem;width:2rem}p-avatar[size=medium]>img{height:3.125rem;width:3.125rem}p-avatar[size=large]>img{height:4rem;width:4rem}p-avatar[variant=company]>img{border-radius:.25rem}p-avatar[variant=company][size=large]>img,p-avatar[variant=company][size=medium]>img{border-radius:.375rem}p-avatar[variant=user]>img{border-radius:100%}";
4
4
 
5
5
  const Avatar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
6
  constructor() {
@@ -1,46 +1,46 @@
1
1
  /* paperless custom elements */
2
- export { Accordion as PAccordion } from '../types/components/p-accordion/p-accordion';
3
- export { Avatar as PAvatar } from '../types/components/p-avatar/p-avatar';
4
- export { AvatarGroup as PAvatarGroup } from '../types/components/p-avatar-group/p-avatar-group';
5
- export { Button as PButton } from '../types/components/p-button/p-button';
6
- export { CardBody as PCardBody } from '../types/components/p-card-body/p-card-body';
7
- export { CardContainer as PCardContainer } from '../types/components/p-card-container/p-card-container';
8
- export { CardHeader as PCardHeader } from '../types/components/p-card-header/p-card-header';
9
- export { ContentSlider as PContentSlider } from '../types/components/p-content-slider/p-content-slider';
10
- export { Counter as PCounter } from '../types/components/p-counter/p-counter';
11
- export { Divider as PDivider } from '../types/components/p-divider/p-divider';
12
- export { Dropdown as PDropdown } from '../types/components/p-dropdown/p-dropdown';
13
- export { DropdownMenuContainer as PDropdownMenuContainer } from '../types/components/p-dropdown-menu-container/p-dropdown-menu-container';
14
- export { DropdownMenuItem as PDropdownMenuItem } from '../types/components/p-dropdown-menu-item/p-dropdown-menu-item';
15
- export { Helper as PHelper } from '../types/components/p-helper/p-helper';
16
- export { Icon as PIcon } from '../types/components/p-icon/p-icon';
17
- export { Illustration as PIllustration } from '../types/components/p-illustration/p-illustration';
18
- export { InfoPanel as PInfoPanel } from '../types/components/p-info-panel/p-info-panel';
19
- export { InputGroup as PInputGroup } from '../types/components/p-input-group/p-input-group';
20
- export { Layout as PLayout } from '../types/components/p-layout/p-layout';
21
- export { Loader as PLoader } from '../types/components/p-loader/p-loader';
22
- export { Modal as PModal } from '../types/components/p-modal/p-modal';
23
- export { ModalBackdrop as PModalBackdrop } from '../types/components/p-modal-backdrop/p-modal-backdrop';
24
- export { ModalBody as PModalBody } from '../types/components/p-modal-body/p-modal-body';
25
- export { ModalContainer as PModalContainer } from '../types/components/p-modal-container/p-modal-container';
26
- export { ModalFooter as PModalFooter } from '../types/components/p-modal-footer/p-modal-footer';
27
- export { ModalHeader as PModalHeader } from '../types/components/p-modal-header/p-modal-header';
28
- export { Navbar as PNavbar } from '../types/components/p-navbar/p-navbar';
29
- export { NavigationItem as PNavigationItem } from '../types/components/p-navigation-item/p-navigation-item';
30
- export { Pagination as PPagination } from '../types/components/p-pagination/p-pagination';
31
- export { PaginationItem as PPaginationItem } from '../types/components/p-pagination-item/p-pagination-item';
32
- export { Profile as PProfile } from '../types/components/p-profile/p-profile';
33
- export { SegmentContainer as PSegmentContainer } from '../types/components/p-segment-container/p-segment-container';
34
- export { SegmentItem as PSegmentItem } from '../types/components/p-segment-item/p-segment-item';
35
- export { SliderIndicator as PSliderIndicator } from '../types/components/p-slider-indicator/p-slider-indicator';
36
- export { Status as PStatus } from '../types/components/p-status/p-status';
37
- export { Stepper as PStepper } from '../types/components/p-stepper/p-stepper';
38
- export { StepperItem as PStepperItem } from '../types/components/p-stepper-item/p-stepper-item';
39
- export { StepperLine as PStepperLine } from '../types/components/p-stepper-line/p-stepper-line';
40
- export { TabGroup as PTabGroup } from '../types/components/p-tab-group/p-tab-group';
41
- export { TabItem as PTabItem } from '../types/components/p-tab-item/p-tab-item';
42
- export { Tag as PTag } from '../types/components/p-tag/p-tag';
43
- export { Tooltip as PTooltip } from '../types/components/p-tooltip/p-tooltip';
2
+ export { Accordion as PAccordion } from '../types/components/molecules/accordion/accordion.component';
3
+ export { Avatar as PAvatar } from '../types/components/atoms/avatar/avatar.component';
4
+ export { AvatarGroup as PAvatarGroup } from '../types/components/atoms/avatar-group/avatar-group.component';
5
+ export { Button as PButton } from '../types/components/atoms/button/button.component';
6
+ export { CardBody as PCardBody } from '../types/components/atoms/card-body/card-body.component';
7
+ export { CardContainer as PCardContainer } from '../types/components/atoms/card-container/card-container.component';
8
+ export { CardHeader as PCardHeader } from '../types/components/atoms/card-header/card-header.component';
9
+ export { ContentSlider as PContentSlider } from '../types/components/molecules/content-slider/content-slider.component';
10
+ export { Counter as PCounter } from '../types/components/atoms/counter/counter.component';
11
+ export { Divider as PDivider } from '../types/components/atoms/divider/divider.component';
12
+ export { Dropdown as PDropdown } from '../types/components/molecules/dropdown/dropdown.component';
13
+ export { DropdownMenuContainer as PDropdownMenuContainer } from '../types/components/atoms/dropdown-menu-container/dropdown-menu-container.component';
14
+ export { DropdownMenuItem as PDropdownMenuItem } from '../types/components/atoms/dropdown-menu-item/dropdown-menu-item.component';
15
+ export { Helper as PHelper } from '../types/components/atoms/helper/helper.component';
16
+ export { Icon as PIcon } from '../types/components/atoms/icon/icon.component';
17
+ export { Illustration as PIllustration } from '../types/components/atoms/illustration/illustration.component';
18
+ export { InfoPanel as PInfoPanel } from '../types/components/atoms/info-panel/info-panel.component';
19
+ export { InputGroup as PInputGroup } from '../types/components/molecules/input-group/input-group.component';
20
+ export { Layout as PLayout } from '../types/components/atoms/layout/layout.component';
21
+ export { Loader as PLoader } from '../types/components/atoms/loader/loader.component';
22
+ export { Modal as PModal } from '../types/components/organisms/modal/modal.component';
23
+ export { ModalBackdrop as PModalBackdrop } from '../types/components/atoms/modal-backdrop/modal-backdrop.component';
24
+ export { ModalBody as PModalBody } from '../types/components/atoms/modal-body/modal-body.component';
25
+ export { ModalContainer as PModalContainer } from '../types/components/atoms/modal-container/modal-container.component';
26
+ export { ModalFooter as PModalFooter } from '../types/components/atoms/modal-footer/modal-footer.component';
27
+ export { ModalHeader as PModalHeader } from '../types/components/atoms/modal-header/modal-header.component';
28
+ export { Navbar as PNavbar } from '../types/components/organisms/navbar/navbar.component';
29
+ export { NavigationItem as PNavigationItem } from '../types/components/molecules/navigation-item/navigation-item.component';
30
+ export { Pagination as PPagination } from '../types/components/molecules/pagination/pagination.component';
31
+ export { PaginationItem as PPaginationItem } from '../types/components/atoms/pagination-item/pagination-item.component';
32
+ export { Profile as PProfile } from '../types/components/molecules/profile/profile.component';
33
+ export { SegmentContainer as PSegmentContainer } from '../types/components/atoms/segment-container/segment-container.component';
34
+ export { SegmentItem as PSegmentItem } from '../types/components/atoms/segment-item/segment-item.component';
35
+ export { SliderIndicator as PSliderIndicator } from '../types/components/atoms/slider-indicator/slider-indicator.component';
36
+ export { Status as PStatus } from '../types/components/atoms/status/status.component';
37
+ export { Stepper as PStepper } from '../types/components/molecules/stepper/stepper.component';
38
+ export { StepperItem as PStepperItem } from '../types/components/atoms/stepper-item/stepper-item.component';
39
+ export { StepperLine as PStepperLine } from '../types/components/atoms/stepper-line/stepper-line.component';
40
+ export { TabGroup as PTabGroup } from '../types/components/atoms/tab-group/tab-group.component';
41
+ export { TabItem as PTabItem } from '../types/components/atoms/tab-item/tab-item.component';
42
+ export { Tag as PTag } from '../types/components/atoms/tag/tag.component';
43
+ export { Tooltip as PTooltip } from '../types/components/atoms/tooltip/tooltip.component';
44
44
 
45
45
  /**
46
46
  * Used to manually set the base path where assets can be found.
@@ -1,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { d as defineCustomElement$2 } from './slider-indicator.component.js';
3
3
 
4
- const contentSliderComponentCss = ".visible{visibility:visible!important}.static{position:static!important}.relative{position:relative!important}.flex{display:flex!important}.hidden{display:none!important}.w-full{width:100%!important}.flex-shrink-0{flex-shrink:0!important}.cursor-grab{cursor:-webkit-grab!important;cursor:grab!important}.cursor-grabbing{cursor:-webkit-grabbing!important;cursor:grabbing!important}.cursor-pointer{cursor:pointer!important}.flex-col{flex-direction:column!important}.flex-nowrap{flex-wrap:nowrap!important}.items-center{align-items:center!important}.items-stretch{align-items:stretch!important}.justify-center{justify-content:center!important}.gap-2{gap:.5rem!important}.overflow-x-auto{overflow-x:auto!important}.p-4{padding:1rem!important}*{box-sizing:border-box}:host{display:flex;flex-direction:column;gap:1rem;margin-left:-1rem;margin-right:-1rem}:host .content{align-items:stretch;display:flex;flex-wrap:nowrap;gap:.5rem;margin-bottom:-1rem;margin-top:-1rem;overflow-x:auto;padding:1rem;position:relative}@media (min-width:40rem){:host .content{gap:1rem}}@media (min-width:64rem){:host .content{flex-wrap:wrap}}:host .content.draggable{cursor:-webkit-grab;cursor:grab}@media (min-width:64rem){:host .content.draggable{cursor:default}}:host .content.draggable.dragging{cursor:-webkit-grabbing;cursor:grabbing}@media (min-width:64rem){:host .content.draggable.dragging{cursor:default}}:host .content>::slotted(*){flex-shrink:0;position:relative;width:100%;z-index:10}@media (min-width:40rem){:host .content>::slotted(*){width:45%}}@media (min-width:64rem){:host .content>::slotted(*){flex:1 1 0%;width:100%}}:host .content::-webkit-scrollbar{display:none}:host .indicator{align-items:center;display:flex;gap:.5rem;justify-content:center}@media (min-width:64rem){:host .indicator{display:none}}@media (min-width:40rem){.tablet\\:w-\\[45\\%\\]{width:45%!important}.tablet\\:gap-4{gap:1rem!important}}@media (min-width:64rem){.desktop-xs\\:hidden{display:none!important}}";
4
+ const contentSliderComponentCss = ".visible{visibility:visible!important}.static{position:static!important}.absolute{position:absolute!important}.relative{position:relative!important}.flex{display:flex!important}.hidden{display:none!important}.w-full{width:100%!important}.flex-shrink-0{flex-shrink:0!important}.cursor-grab{cursor:-webkit-grab!important;cursor:grab!important}.cursor-grabbing{cursor:-webkit-grabbing!important;cursor:grabbing!important}.cursor-pointer{cursor:pointer!important}.resize{resize:both!important}.flex-col{flex-direction:column!important}.flex-nowrap{flex-wrap:nowrap!important}.items-center{align-items:center!important}.items-stretch{align-items:stretch!important}.justify-center{justify-content:center!important}.gap-4{gap:1rem!important}.gap-2{gap:.5rem!important}.overflow-visible{overflow:visible!important}.p-10{padding:2.5rem!important}*{box-sizing:border-box}:host{display:flex;flex-direction:column;gap:1rem;margin:-2.5rem;overflow:hidden;padding:2.5rem}:host .slider{box-sizing:content-box;overflow:visible;position:relative}:host .slider.draggable{cursor:-webkit-grab;cursor:grab}@media (min-width:64rem){:host .slider.draggable{cursor:default}}:host .slider.draggable.dragging{cursor:-webkit-grabbing;cursor:grabbing}@media (min-width:64rem){:host .slider.draggable.dragging{cursor:default}}:host .slider .inner-slider{align-items:stretch;display:flex;flex-wrap:nowrap;gap:.5rem;position:absolute;width:100%}@media (min-width:40rem){:host .slider .inner-slider{gap:1rem}}@media (min-width:64rem){:host .slider .inner-slider{flex-wrap:wrap}}:host .slider .inner-slider>::slotted(*){flex-shrink:0;position:relative;width:100%;z-index:10}@media (min-width:40rem){:host .slider .inner-slider>::slotted(*){width:45%}}@media (min-width:64rem){:host .slider .inner-slider>::slotted(*){flex:1 1 0%;width:100%}}:host .indicator{align-items:center;display:flex;gap:.5rem;justify-content:center}@media (min-width:64rem){:host .indicator{display:none}}@media (min-width:40rem){.tablet\\:w-\\[45\\%\\]{width:45%!important}.tablet\\:gap-4{gap:1rem!important}}@media (min-width:64rem){.desktop-xs\\:hidden{display:none!important}}";
5
5
 
6
6
  const ContentSlider = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
7
  constructor() {
@@ -20,20 +20,29 @@ const ContentSlider = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
20
20
  * Wether to disable clicking the indicator scrolls content
21
21
  */
22
22
  this.disableIndicatorClick = false;
23
+ this._outerHeight = 0;
24
+ this._totalWidth = 0;
23
25
  this._items = [];
24
- // mouse movement stuff
25
- this._pos = { top: 0, left: 0, x: 0, y: 0 };
26
26
  this._dragging = false;
27
27
  }
28
28
  componentWillRender() {
29
29
  const items = this._el.querySelectorAll(':scope > *');
30
30
  this._items = Array.from(items);
31
31
  }
32
+ componentDidRender() {
33
+ const outerHeight = this._items.at(0).getBoundingClientRect().height;
34
+ if (outerHeight != this._outerHeight) {
35
+ this._outerHeight = outerHeight;
36
+ }
37
+ }
32
38
  componentDidLoad() {
39
+ this._calculateWidth();
33
40
  this._calculateIndicator();
34
41
  }
35
42
  render() {
36
- return (h(Host, { class: "p-content-slider" }, h("div", { class: `content ${!this.disableDrag && 'draggable'} ${this._dragging && 'dragging'}`, ref: (el) => (this._contentRef = el), onScroll: () => this._handleScroll(), onMouseDown: (e) => this._mouseDownHandler(e) }, h("slot", null)), h("div", { class: `indicator ${this.hideMobileIndicator && 'hidden'}` }, this._items.map((_, i) => (h("p-slider-indicator", { class: !this.disableIndicatorClick && 'cursor-pointer', onClick: () => this._scrollTo(i), active: i === this._visibleIndex }))))));
43
+ return (h(Host, { class: "p-content-slider" }, h("div", { class: `slider ${!this.disableDrag && 'draggable'} ${this._dragging && 'dragging'}`, style: {
44
+ height: `${this._outerHeight}px`,
45
+ }, ref: (el) => (this._sliderRef = el), onScroll: () => this._handleScroll(), onMouseDown: (e) => this._mouseDownHandler(e), onMouseMove: (e) => this._mouseMoveHandler(e) }, h("div", { class: "inner-slider", ref: (ref) => (this._innerSliderRef = ref) }, h("slot", null))), h("div", { class: `indicator ${this.hideMobileIndicator && 'hidden'}` }, this._items.map((_, i) => (h("p-slider-indicator", { class: !this.disableIndicatorClick && 'cursor-pointer', onClick: () => this._scrollTo(i), active: i === this._visibleIndex }))))));
37
46
  }
38
47
  _handleScroll() {
39
48
  if (this._scrollHandlerTimeout) {
@@ -45,30 +54,37 @@ const ContentSlider = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
45
54
  if (this.disableDrag || this._dragging) {
46
55
  return;
47
56
  }
48
- this._pos = {
49
- // The current scroll
50
- left: this._contentRef.scrollLeft,
51
- top: this._contentRef.scrollTop,
52
- // Get the current mouse position
53
- x: e.clientX,
54
- y: e.clientY,
55
- };
57
+ this._startX = e.offsetX - this._innerSliderRef.offsetLeft;
56
58
  this._dragging = true;
57
59
  }
58
- mouseMoveHandler(e) {
60
+ _mouseMoveHandler(e) {
59
61
  if (!e || !this._dragging || this.disableDrag) {
60
62
  return;
61
63
  }
62
- // How far the mouse has been moved
63
- const dx = e.clientX - this._pos.x;
64
- const dy = e.clientY - this._pos.y;
65
- // Scroll the element
66
- this._contentRef.scrollTop = this._pos.top - dy;
67
- this._contentRef.scrollLeft = this._pos.left - dx;
64
+ e.preventDefault();
65
+ const x = e.offsetX;
66
+ this._innerSliderRef.style.left = `${x - this._startX}px`;
67
+ this._checkBoundary();
68
+ this._calculateIndicator();
69
+ }
70
+ _checkBoundary() {
71
+ let outer = this._sliderRef.getBoundingClientRect();
72
+ if (parseInt(this._innerSliderRef.style.left) > 0) {
73
+ this._innerSliderRef.style.left = '0px';
74
+ }
75
+ const maxLeft = (this._totalWidth - outer.width) * -1;
76
+ if (parseInt(this._innerSliderRef.style.left) < maxLeft) {
77
+ this._innerSliderRef.style.left = `${maxLeft}px`;
78
+ }
68
79
  }
69
80
  mouseUpHandler() {
70
81
  this._dragging = false;
71
82
  }
83
+ resizeHandler() {
84
+ this._innerSliderRef.style.left = '0px';
85
+ this._calculateWidth();
86
+ this._calculateIndicator();
87
+ }
72
88
  _calculateIndicator() {
73
89
  for (let i = 0; i < this._items.length; i++) {
74
90
  const item = this._items[i];
@@ -82,28 +98,42 @@ const ContentSlider = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
82
98
  }
83
99
  }
84
100
  _isVisible(el) {
85
- if (!this._el || !this._contentRef || !el) {
101
+ if (!this._el || !el) {
86
102
  return false;
87
103
  }
88
104
  const elRect = el.getBoundingClientRect();
89
- const containerRect = this._el.getBoundingClientRect();
90
- return (elRect.left > containerRect.left &&
91
- elRect.right < containerRect.right);
105
+ const sliderRect = this._sliderRef.getBoundingClientRect();
106
+ return (elRect.left >= sliderRect.left && elRect.right <= sliderRect.right);
92
107
  }
93
108
  _scrollTo(i) {
94
109
  if (this.disableIndicatorClick) {
95
110
  return;
96
111
  }
97
112
  const el = this._items[i];
98
- const parent = el.offsetParent;
99
- const parentStyle = getComputedStyle(parent);
100
- const gap = parseInt(parentStyle.gap.replace('px', ''));
101
- const padding = parseInt(parentStyle['paddingLeft'].replace('px', '')) +
102
- parseInt(parentStyle['paddingRight'].replace('px', ''));
103
- this._contentRef.scrollTo({
104
- left: el.offsetLeft - gap - padding - el.clientWidth / 2,
105
- behavior: 'smooth',
106
- });
113
+ if (i === 0) {
114
+ this._innerSliderRef.style.left = '0px';
115
+ this._calculateIndicator();
116
+ return;
117
+ }
118
+ const sliderRect = this._sliderRef.getBoundingClientRect();
119
+ const elRect = el.getBoundingClientRect();
120
+ const centerOffset = el.offsetLeft + elRect.width / 2 - sliderRect.width / 2;
121
+ this._innerSliderRef.style.left = `-${centerOffset}px`;
122
+ this._checkBoundary();
123
+ this._calculateIndicator();
124
+ }
125
+ _calculateWidth() {
126
+ let totalWidth = 0;
127
+ for (let item of this._items) {
128
+ const rect = item.getBoundingClientRect();
129
+ totalWidth += rect.width;
130
+ }
131
+ const sliderStyle = getComputedStyle(this._sliderRef);
132
+ const padding = parseInt(sliderStyle.padding) * 2;
133
+ const innerSliderStyle = getComputedStyle(this._innerSliderRef);
134
+ const gap = parseInt(innerSliderStyle.gap) * (this._items.length - 1);
135
+ totalWidth += padding + gap;
136
+ this._totalWidth = totalWidth;
107
137
  }
108
138
  get _el() { return this; }
109
139
  static get style() { return contentSliderComponentCss; }
@@ -112,8 +142,10 @@ const ContentSlider = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
112
142
  "disableDrag": [4, "disable-drag"],
113
143
  "disableIndicatorClick": [4, "disable-indicator-click"],
114
144
  "_visibleIndex": [32],
145
+ "_outerHeight": [32],
146
+ "_totalWidth": [32],
115
147
  "_dragging": [32]
116
- }, [[9, "mousemove", "mouseMoveHandler"], [9, "mouseup", "mouseUpHandler"]]]);
148
+ }, [[9, "mouseup", "mouseUpHandler"], [9, "resize", "resizeHandler"]]]);
117
149
  function defineCustomElement$1() {
118
150
  if (typeof customElements === "undefined") {
119
151
  return;
@@ -4,7 +4,7 @@ import { d as defineCustomElement$4 } from './dropdown.component.js';
4
4
  import { d as defineCustomElement$3 } from './dropdown-menu-container.component.js';
5
5
  import { d as defineCustomElement$2 } from './icon.component.js';
6
6
 
7
- const profileComponentCss = ".visible{visibility:visible!important}.static{position:static!important}.fixed{position:fixed!important}.absolute{position:absolute!important}.ml-auto{margin-left:auto!important}.flex{display:flex!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}.flex-col{flex-direction:column!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-3{gap:.75rem!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.rounded{border-radius:.25rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-mystic-dark{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}*{box-sizing:border-box}:host{display:flex}:host .content{align-items:center;display:flex;gap:.75rem;height:3rem;width:100%}:host .content .name{display:flex;flex-direction:column;justify-content:center;overflow:hidden}:host .content .name>:first-child{--tw-text-opacity:1;color:rgb(39 40 56/var(--tw-text-opacity));font-size:.875rem;font-weight:600;line-height:1.25rem}:host .content .name>:nth-child(2){--tw-text-opacity:1;color:rgb(152 154 183/var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}:host .content .name ::slotted(*){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.has-dropdown){cursor:pointer}:host(.has-dropdown) .content{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important;border-radius:.25rem;border-style:solid!important;border-width:1px!important;padding-left:.5rem;padding-right:.5rem}:host(.active) .content,:host(.has-dropdown:hover) .content{--tw-shadow:0px 0.3125rem 1rem rgba(0,24,98,.08),0px 0.0625rem 0.1875rem rgba(0,24,98,.13);--tw-shadow-colored:0px 0.3125rem 1rem var(--tw-shadow-color),0px 0.0625rem 0.1875rem var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:host(.active) .content p-icon{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}";
7
+ const profileComponentCss = ".static{position:static!important}.absolute{position:absolute!important}.ml-auto{margin-left:auto!important}.flex{display:flex!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}.flex-col{flex-direction:column!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-3{gap:.75rem!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.rounded{border-radius:.25rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-mystic-dark{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}*{box-sizing:border-box}:host{display:flex}:host .content{align-items:center;display:flex;gap:.75rem;height:3rem;width:100%}:host .content .name{display:flex;flex-direction:column;justify-content:center;overflow:hidden}:host .content .name>:first-child{--tw-text-opacity:1;color:rgb(39 40 56/var(--tw-text-opacity));font-size:.875rem;font-weight:600;line-height:1.25rem}:host .content .name>:nth-child(2){--tw-text-opacity:1;color:rgb(152 154 183/var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}:host .content .name ::slotted(*){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.has-dropdown){cursor:pointer}:host(.has-dropdown) .content{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important;border-radius:.25rem;border-style:solid!important;border-width:1px!important;padding-left:.5rem;padding-right:.5rem}:host(.active) .content,:host(.has-dropdown:hover) .content{--tw-shadow:0px 0.3125rem 1rem rgba(0,24,98,.08),0px 0.0625rem 0.1875rem rgba(0,24,98,.13);--tw-shadow-colored:0px 0.3125rem 1rem var(--tw-shadow-color),0px 0.0625rem 0.1875rem var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:host(.active) .content p-icon{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}";
8
8
 
9
9
  const Profile = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
10
10
  constructor() {
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
 
3
- const sliderIndicatorComponentCss = ".visible{visibility:visible!important}.static{position:static!important}.block{display:block!important}.hidden{display:none!important}.h-2{height:.5rem!important}.w-2{width:.5rem!important}.cursor-pointer{cursor:pointer!important}.bg-mystic-dark{--tw-bg-opacity:1!important;background-color:rgb(218 230 240/var(--tw-bg-opacity))!important}*{box-sizing:border-box}:host{--tw-bg-opacity:1;background-color:rgb(218 230 240/var(--tw-bg-opacity));border-radius:100%;display:block;height:.5rem;width:.5rem}:host(.active){--tw-bg-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity))}";
3
+ const sliderIndicatorComponentCss = ".visible{visibility:visible!important}.static{position:static!important}.block{display:block!important}.hidden{display:none!important}.h-2{height:.5rem!important}.w-2{width:.5rem!important}.cursor-pointer{cursor:pointer!important}.resize{resize:both!important}.bg-mystic-dark{--tw-bg-opacity:1!important;background-color:rgb(218 230 240/var(--tw-bg-opacity))!important}*{box-sizing:border-box}:host{--tw-bg-opacity:1;background-color:rgb(218 230 240/var(--tw-bg-opacity));border-radius:100%;display:block;height:.5rem;width:.5rem}:host(.active){--tw-bg-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity))}";
4
4
 
5
5
  const SliderIndicator = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
6
  constructor() {
@@ -20,10 +20,10 @@ const plt = {
20
20
  ce: (eventName, opts) => new CustomEvent(eventName, opts),
21
21
  };
22
22
  const promiseResolve = (v) => Promise.resolve(v);
23
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
23
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
24
24
  try {
25
25
  new CSSStyleSheet();
26
- return typeof new CSSStyleSheet().replace === 'function';
26
+ return typeof new CSSStyleSheet().replaceSync === 'function';
27
27
  }
28
28
  catch (e) { }
29
29
  return false;
@@ -83,9 +83,14 @@ const uniqueTime = (key, measureText) => {
83
83
  const rootAppliedStyles = new WeakMap();
84
84
  const registerStyle = (scopeId, cssText, allowCS) => {
85
85
  let style = styles.get(scopeId);
86
- if (supportsConstructibleStylesheets && allowCS) {
86
+ if (supportsConstructableStylesheets && allowCS) {
87
87
  style = (style || new CSSStyleSheet());
88
- style.replace(cssText);
88
+ if (typeof style === 'string') {
89
+ style = cssText;
90
+ }
91
+ else {
92
+ style.replaceSync(cssText);
93
+ }
89
94
  }
90
95
  else {
91
96
  style = cssText;
@@ -296,6 +301,31 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
296
301
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
297
302
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
298
303
  }
304
+ else if (memberName === 'style') {
305
+ // update style attribute, css properties and values
306
+ {
307
+ for (const prop in oldValue) {
308
+ if (!newValue || newValue[prop] == null) {
309
+ if (prop.includes('-')) {
310
+ elm.style.removeProperty(prop);
311
+ }
312
+ else {
313
+ elm.style[prop] = '';
314
+ }
315
+ }
316
+ }
317
+ }
318
+ for (const prop in newValue) {
319
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
320
+ if (prop.includes('-')) {
321
+ elm.style.setProperty(prop, newValue[prop]);
322
+ }
323
+ else {
324
+ elm.style[prop] = newValue[prop];
325
+ }
326
+ }
327
+ }
328
+ }
299
329
  else if (memberName === 'ref') {
300
330
  // minifier will clean this up
301
331
  if (newValue) {
@@ -1056,6 +1086,9 @@ const postUpdateComponent = (hostRef) => {
1056
1086
  const endPostUpdate = createTime('postUpdate', tagName);
1057
1087
  const instance = hostRef.$lazyInstance$ ;
1058
1088
  const ancestorComponent = hostRef.$ancestorComponent$;
1089
+ {
1090
+ safeCall(instance, 'componentDidRender');
1091
+ }
1059
1092
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1060
1093
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1061
1094
  {