srcdev-nuxt-forms 2.4.6 → 2.4.7

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.
@@ -4,7 +4,7 @@
4
4
 
5
5
  <form class="colour-scheme-select-form mbe-20" ref="colourSchemeWrapper">
6
6
  <div class="select-scheme-marker-wrapper">
7
- <div class="select-scheme-marker"></div>
7
+ <div class="select-scheme-marker" :class="[{ show: showMarker }]"></div>
8
8
  </div>
9
9
  <div class="select-scheme-group-wrapper">
10
10
  <div class="select-scheme-group">
@@ -59,6 +59,7 @@ const { currentColourScheme } = useColourScheme();
59
59
 
60
60
  const colourSchemeWrapper = ref<HTMLFormElement | null>(null);
61
61
  const colourSchemeInputElements = ref<HTMLDivElement[]>([]);
62
+ const showMarker = ref(false);
62
63
 
63
64
  // console.log('colourSchemeInputElements');
64
65
  // console.log(colourSchemeInputElements);
@@ -82,8 +83,11 @@ const findIndexOfInputValueFromCurrentColourScheme = () => {
82
83
  const setColourSchemeAttr = () => {
83
84
  const index = findIndexOfInputValueFromCurrentColourScheme() ?? 0;
84
85
  const wrapperLeftPosition = colourSchemeWrapper.value?.getBoundingClientRect().left ?? 0;
86
+ const parentLeftPosition = colourSchemeWrapper.value?.parentElement?.getBoundingClientRect().left ?? 0;
87
+ const relativeLeftPosition = wrapperLeftPosition - parentLeftPosition;
88
+
85
89
  colourSchemeWrapper.value?.style.setProperty('--_select-scheme-marker-position', index !== undefined ? index.toString() : '0');
86
- colourSchemeWrapper.value?.style.setProperty('--_select-scheme-marker-left-offset', colourSchemeInputElements.value?.[index - 1]?.offsetLeft - wrapperLeftPosition + 'px');
90
+ colourSchemeWrapper.value?.style.setProperty('--_select-scheme-marker-left-offset', colourSchemeInputElements.value?.[index - 1]?.offsetLeft - relativeLeftPosition + 'px');
87
91
  colourSchemeWrapper.value?.style.setProperty('--_select-scheme-marker-width', colourSchemeInputElements.value?.[index - 1]?.getBoundingClientRect().width + 'px');
88
92
  };
89
93
 
@@ -92,6 +96,9 @@ onMounted(() => {
92
96
 
93
97
  if (colourSchemeWrapper.value !== null) {
94
98
  setColourSchemeAttr();
99
+ setTimeout(() => {
100
+ showMarker.value = true;
101
+ }, 300);
95
102
  }
96
103
  });
97
104
 
@@ -171,7 +178,14 @@ watch(currentColourScheme, () => {
171
178
  border-radius: 50%;
172
179
 
173
180
  position: absolute;
174
- left: calc(var(--_select-scheme-marker-left-offset) - var(--_form-border-width) - var(--_form-outline-width) - 1px);
181
+ /* left: calc(var(--_select-scheme-marker-left-offset) - var(--_form-border-width) - var(--_form-outline-width) - 1px); */
182
+ left: calc(var(--_select-scheme-marker-left-offset) - calc(var(--_select-scheme-group-border-width) * 1.5) - var(--_scheme-icon-font-size));
183
+
184
+ opacity: 0;
185
+
186
+ &.show {
187
+ opacity: 1;
188
+ }
175
189
  }
176
190
  }
177
191
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-forms",
3
3
  "type": "module",
4
- "version": "2.4.6",
4
+ "version": "2.4.7",
5
5
  "main": "nuxt.config.ts",
6
6
  "scripts": {
7
7
  "clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",