srcdev-nuxt-forms 2.4.6 → 2.4.8

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,12 @@ 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
+ // const relativeLeftPosition = 0;
89
+
85
90
  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');
91
+ colourSchemeWrapper.value?.style.setProperty('--_select-scheme-marker-left-offset', colourSchemeInputElements.value?.[index - 1]?.offsetLeft - relativeLeftPosition + 'px');
87
92
  colourSchemeWrapper.value?.style.setProperty('--_select-scheme-marker-width', colourSchemeInputElements.value?.[index - 1]?.getBoundingClientRect().width + 'px');
88
93
  };
89
94
 
@@ -92,6 +97,9 @@ onMounted(() => {
92
97
 
93
98
  if (colourSchemeWrapper.value !== null) {
94
99
  setColourSchemeAttr();
100
+ setTimeout(() => {
101
+ showMarker.value = true;
102
+ }, 300);
95
103
  }
96
104
  });
97
105
 
@@ -133,7 +141,7 @@ watch(currentColourScheme, () => {
133
141
  --_scheme-icon-colour: white;
134
142
 
135
143
  .colour-scheme-select-form {
136
- display: grid;
144
+ display: inline-grid;
137
145
  grid-template-areas: 'select-stack';
138
146
  width: fit-content;
139
147
 
@@ -141,6 +149,7 @@ watch(currentColourScheme, () => {
141
149
  border: var(--_form-border-width) solid var(--_form-border-colour);
142
150
  outline: var(--_form-outline-width) solid var(--_form-outline-colour);
143
151
  border-radius: var(--_form-border-radius);
152
+ padding: var(--_form-padding);
144
153
 
145
154
  .select-scheme-marker-wrapper {
146
155
  grid-area: select-stack;
@@ -171,7 +180,16 @@ watch(currentColourScheme, () => {
171
180
  border-radius: 50%;
172
181
 
173
182
  position: absolute;
174
- left: calc(var(--_select-scheme-marker-left-offset) - var(--_form-border-width) - var(--_form-outline-width) - 1px);
183
+ /* left: calc(var(--_select-scheme-marker-left-offset) - var(--_form-border-width) - var(--_form-outline-width) - 1px); */
184
+ /* left: calc(var(--_select-scheme-marker-left-offset) - calc(var(--_select-scheme-group-border-width) * 1.5) - var(--_scheme-icon-font-size)); */
185
+ /* left: calc(var(--_select-scheme-marker-left-offset) - var(--_form-items-gap) - var(--_scheme-icon-font-size) + var(--_select-scheme-group-border-width) - 1px); */
186
+ left: calc(var(--_select-scheme-marker-left-offset) - 29px);
187
+
188
+ opacity: 0;
189
+
190
+ &.show {
191
+ opacity: 1;
192
+ }
175
193
  }
176
194
  }
177
195
 
@@ -181,7 +199,7 @@ watch(currentColourScheme, () => {
181
199
  grid-template-columns: repeat(3, 1fr);
182
200
  align-items: center;
183
201
  width: fit-content;
184
- padding: var(--_form-padding);
202
+ /* padding: var(--_form-padding); */
185
203
  z-index: 2;
186
204
  gap: var(--_form-items-gap);
187
205
 
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.8",
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",