cja-phoenix 0.7.0 → 0.7.2

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.
@@ -8,7 +8,12 @@
8
8
  <div
9
9
  class="fixed-wrapper"
10
10
  :class="{ 'position-fixed': positionFixed }"
11
- :style="{ ...size, ...position, maxWidth: fixedWrapperWidth }"
11
+ :style="{
12
+ ...size,
13
+ ...position,
14
+ transform: limitOffset,
15
+ maxWidth: fixedWrapperWidth,
16
+ }"
12
17
  ref="fixedWrapper"
13
18
  >
14
19
  <slot></slot>
@@ -25,6 +30,7 @@ const props = withDefaults(
25
30
  defineProps<{
26
31
  active?: boolean;
27
32
  scrollThreshold?: number;
33
+ scrollLimitEl?: HTMLElement;
28
34
  fixWidth?: boolean;
29
35
  size?: {
30
36
  height?: string;
@@ -49,15 +55,35 @@ const fixedContainer = ref();
49
55
  const fixedContainerHeight = ref("");
50
56
  const fixedWrapper = ref();
51
57
  const fixedWrapperWidth = ref("");
58
+ const limitOffset = ref();
59
+
60
+ const setScrollLimit = () => {
61
+ if (props.scrollLimitEl) {
62
+ const scrollLimitValue =
63
+ props.scrollLimitEl.offsetTop +
64
+ props.scrollLimitEl.clientHeight -
65
+ fixedWrapper.value.clientHeight +
66
+ props.scrollThreshold;
67
+
68
+ if (window.scrollY >= scrollLimitValue) {
69
+ limitOffset.value = `translateY(${scrollLimitValue - window.scrollY}px)`;
70
+ } else {
71
+ limitOffset.value = null;
72
+ }
73
+ }
74
+ };
52
75
 
53
76
  const fixPosition = () => {
54
77
  if (fixedContainer.value && props.active) {
55
78
  positionFixed.value =
56
79
  window.scrollY > fixedContainer.value.offsetTop + props.scrollThreshold;
80
+ const fixedWrapperHeight = fixedWrapper.value.clientHeight;
57
81
 
58
82
  fixedContainerHeight.value = positionFixed.value
59
- ? `${fixedWrapper.value.clientHeight}px`
83
+ ? `${fixedWrapperHeight}px`
60
84
  : "";
85
+
86
+ setScrollLimit();
61
87
  } else {
62
88
  positionFixed.value = false;
63
89
  fixedContainerHeight.value = "";
@@ -4,6 +4,7 @@
4
4
  [`grid-item-sm-${sizeSm}`]: sizeSm,
5
5
  [`grid-item-md-${sizeMd}`]: sizeMd,
6
6
  [`grid-item-lg-${sizeLg}`]: sizeLg,
7
+ [`grid-item-xl-${sizeXl}`]: sizeXl,
7
8
  }"
8
9
  >
9
10
  <slot></slot>
@@ -15,6 +16,7 @@ defineProps<{
15
16
  sizeSm?: 1 | 2 | 3 | 4;
16
17
  sizeMd?: 1 | 2 | 3 | 4;
17
18
  sizeLg?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
19
+ sizeXl?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
18
20
  }>();
19
21
  </script>
20
22
 
@@ -39,7 +41,15 @@ defineProps<{
39
41
 
40
42
  @for $i from 0 to 12 {
41
43
  .grid-item-lg-#{$i + 1} {
42
- @media screen and (min-width: 1024px) {
44
+ @media screen and (min-width: $break-lg-min) {
45
+ grid-column: span #{$i + 1};
46
+ }
47
+ }
48
+ }
49
+
50
+ @for $i from 0 to 12 {
51
+ .grid-item-xl-#{$i + 1} {
52
+ @media screen and (min-width: $break-xl-min) {
43
53
  grid-column: span #{$i + 1};
44
54
  }
45
55
  }