@bagelink/vue 1.4.48 → 1.4.50
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.
- package/dist/components/NavBar.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/NumberInput.vue.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/NavBar.vue +7 -18
- package/src/components/form/inputs/NumberInput.vue +35 -39
package/package.json
CHANGED
|
@@ -41,11 +41,7 @@ onMounted(calcIsOpen)
|
|
|
41
41
|
<div :class="{ open: isOpen, closed: !isOpen }">
|
|
42
42
|
<slot name="top" :isOpen="isOpen" />
|
|
43
43
|
<div
|
|
44
|
-
class="nav-expend"
|
|
45
|
-
role="button"
|
|
46
|
-
aria-label="Toggle Navigation"
|
|
47
|
-
tabindex="0"
|
|
48
|
-
@click="toggleMenu"
|
|
44
|
+
class="nav-expend" role="button" aria-label="Toggle Navigation" tabindex="0" @click="toggleMenu"
|
|
49
45
|
@keypress.enter="toggleMenu"
|
|
50
46
|
>
|
|
51
47
|
<Icon icon="chevron_right" class="top-arrow" />
|
|
@@ -55,12 +51,8 @@ onMounted(calcIsOpen)
|
|
|
55
51
|
<div class="nav-scroll">
|
|
56
52
|
<div class="nav-links-wrapper">
|
|
57
53
|
<component
|
|
58
|
-
:is="link.to ? 'router-link' : 'div'"
|
|
59
|
-
|
|
60
|
-
:key="link.label"
|
|
61
|
-
class="nav-button"
|
|
62
|
-
:to="link.to"
|
|
63
|
-
@click="link.onClick?.()"
|
|
54
|
+
:is="link.to ? 'router-link' : 'div'" v-for="link in links" :key="link.label"
|
|
55
|
+
class="nav-button" :to="link.to" @click="link.onClick?.()"
|
|
64
56
|
>
|
|
65
57
|
<Icon :icon="link.icon" />
|
|
66
58
|
<div class="tooltip">
|
|
@@ -72,12 +64,8 @@ onMounted(calcIsOpen)
|
|
|
72
64
|
|
|
73
65
|
<div class="bot-buttons-wrapper">
|
|
74
66
|
<component
|
|
75
|
-
:is="link.to ? 'router-link' : 'div'"
|
|
76
|
-
|
|
77
|
-
:key="link.label"
|
|
78
|
-
class="nav-button"
|
|
79
|
-
:to="link.to"
|
|
80
|
-
@click="link.onClick?.()"
|
|
67
|
+
:is="link.to ? 'router-link' : 'div'" v-for="link in footerLinks" :key="link.label"
|
|
68
|
+
class="nav-button" :to="link.to" @click="link.onClick?.()"
|
|
81
69
|
>
|
|
82
70
|
<Icon :icon="link.icon" />
|
|
83
71
|
<div class="tooltip">
|
|
@@ -138,7 +126,7 @@ onMounted(calcIsOpen)
|
|
|
138
126
|
.nav {
|
|
139
127
|
color: var(--bgl-light-text);
|
|
140
128
|
background: var(--bgl-primary);
|
|
141
|
-
z-index:
|
|
129
|
+
z-index: 98;
|
|
142
130
|
width: 70px;
|
|
143
131
|
transition: all 0.4s cubic-bezier(0.36, 0.02, 0.23, 1);
|
|
144
132
|
display: flex;
|
|
@@ -379,6 +367,7 @@ onMounted(calcIsOpen)
|
|
|
379
367
|
display: none;
|
|
380
368
|
}
|
|
381
369
|
}
|
|
370
|
+
|
|
382
371
|
@media screen and (max-height: 550px) {
|
|
383
372
|
.nav.open .nav-button {
|
|
384
373
|
margin-top: 4px;
|
|
@@ -126,12 +126,14 @@ function inputHandler() {
|
|
|
126
126
|
|
|
127
127
|
watch(() => numberValue, () => {
|
|
128
128
|
nextTick(() => {
|
|
129
|
+
// Don't reformat if user is currently typing a decimal
|
|
130
|
+
if (formattedValue.endsWith('.')) return
|
|
129
131
|
formattedValue = numberValue !== undefined ? formatNumber(numberValue) : ''
|
|
130
132
|
})
|
|
131
133
|
})
|
|
132
134
|
|
|
133
135
|
watch(() => modelValue, (newVal) => {
|
|
134
|
-
if (newVal !== numberValue)
|
|
136
|
+
if (newVal !== numberValue) {
|
|
135
137
|
if (typeof newVal === 'string' && (newVal === '-' || newVal.endsWith('.'))) {
|
|
136
138
|
formattedValue = newVal
|
|
137
139
|
return
|
|
@@ -143,8 +145,7 @@ watch(() => modelValue, (newVal) => {
|
|
|
143
145
|
|
|
144
146
|
<template>
|
|
145
147
|
<div
|
|
146
|
-
class="bagel-input num-input"
|
|
147
|
-
:class="{
|
|
148
|
+
class="bagel-input num-input" :class="{
|
|
148
149
|
textInputSpinnerWrap: icon || spinner,
|
|
149
150
|
txtInputIconStart: iconStart,
|
|
150
151
|
}"
|
|
@@ -154,47 +155,39 @@ watch(() => modelValue, (newVal) => {
|
|
|
154
155
|
{{ label }}
|
|
155
156
|
</label>
|
|
156
157
|
<div class="gap-025" :class="{ 'column flex': layout === 'vertical', 'flex': layout === 'horizontal' }">
|
|
157
|
-
<Btn
|
|
158
|
+
<Btn
|
|
159
|
+
v-if="layout && btnLayouts.includes(layout)" flat icon="add" class="radius"
|
|
160
|
+
:class="[{ 'bgl-big-ctrl-num-btn': layout === 'vertical' }]" tabindex="-1" @click="increment"
|
|
161
|
+
/>
|
|
158
162
|
<input
|
|
159
|
-
:id
|
|
160
|
-
v-model.trim="formattedValue"
|
|
161
|
-
v-pattern.number
|
|
162
|
-
type="text"
|
|
163
|
-
:class="{
|
|
163
|
+
:id v-model.trim="formattedValue" v-pattern.number type="text" :class="{
|
|
164
164
|
'txt-center': center,
|
|
165
165
|
'min0': layout,
|
|
166
166
|
'bgl-number-input': layout !== 'vertical' && layout !== 'horizontal',
|
|
167
|
-
}"
|
|
168
|
-
:
|
|
169
|
-
|
|
170
|
-
:required
|
|
171
|
-
:readonly="disabled"
|
|
172
|
-
inputmode="decimal"
|
|
173
|
-
autocomplete="off"
|
|
174
|
-
:pattern="useGrouping ? '^-?\\d{1,3}(,\\d{3})*(\.\\d+)?$' : '^-?\\d*\.?\d*$'"
|
|
175
|
-
autocorrect="off"
|
|
176
|
-
spellcheck="false"
|
|
177
|
-
@input="inputHandler"
|
|
178
|
-
@keydown.up.prevent="increment"
|
|
167
|
+
}" :placeholder="placeholder || label" :disabled :required :readonly="disabled" inputmode="decimal"
|
|
168
|
+
autocomplete="off" :pattern="useGrouping ? '^-?\\d{1,3}(,\\d{3})*(\.\\d+)?$' : '^-?\\d*\.?\d*$'"
|
|
169
|
+
autocorrect="off" spellcheck="false" @input="inputHandler" @keydown.up.prevent="increment"
|
|
179
170
|
@keydown.down.prevent="decrement"
|
|
180
171
|
>
|
|
181
172
|
<p v-if="helptext" class="opacity-7 light">
|
|
182
173
|
{{ helptext }}
|
|
183
174
|
</p>
|
|
184
|
-
<Icon
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
<Icon
|
|
190
|
-
v-if="icon"
|
|
191
|
-
:icon
|
|
175
|
+
<Icon v-if="iconStart" class="iconStart" :icon="iconStart" />
|
|
176
|
+
<Icon v-if="icon" :icon />
|
|
177
|
+
<Btn
|
|
178
|
+
v-if="layout && btnLayouts.includes(layout)" flat icon="remove" class="radius"
|
|
179
|
+
:class="[{ 'bgl-big-ctrl-num-btn': layout === 'vertical' }]" tabindex="-1" @click="decrement"
|
|
192
180
|
/>
|
|
193
|
-
<Btn v-if="layout && btnLayouts.includes(layout)" flat icon="remove" class="radius" :class="[{ 'bgl-big-ctrl-num-btn': layout === 'vertical' }]" tabindex="-1" @click="decrement" />
|
|
194
181
|
|
|
195
182
|
<div v-if="spinner && (!layout || !btnLayouts.includes(layout))" class="flex column spinner">
|
|
196
|
-
<Btn
|
|
197
|
-
|
|
183
|
+
<Btn
|
|
184
|
+
icon="add" flat thin class="bgl-ctrl-num-btn ctrl-add top-bgl-ctrl-num-btn" :disabled="!canAdd"
|
|
185
|
+
tabindex="-1" @click="increment"
|
|
186
|
+
/>
|
|
187
|
+
<Btn
|
|
188
|
+
icon="remove" flat thin class="bgl-ctrl-num-btn ctrl-remove" :disabled="!canDecrement"
|
|
189
|
+
tabindex="-1" @click="decrement"
|
|
190
|
+
/>
|
|
198
191
|
</div>
|
|
199
192
|
</div>
|
|
200
193
|
</div>
|
|
@@ -202,14 +195,15 @@ watch(() => modelValue, (newVal) => {
|
|
|
202
195
|
</template>
|
|
203
196
|
|
|
204
197
|
<style scoped>
|
|
205
|
-
.txtInputIconStart input{
|
|
198
|
+
.txtInputIconStart input {
|
|
206
199
|
padding-inline-start: calc(var(--input-height) / 1.5);
|
|
207
200
|
}
|
|
201
|
+
|
|
208
202
|
.txtInputIconStart .iconStart {
|
|
209
203
|
color: var(--input-color);
|
|
210
204
|
position: absolute;
|
|
211
|
-
|
|
212
|
-
margin-top: calc(var(--input-height) / 2
|
|
205
|
+
inset-inline-start: calc(var(--input-height) / 3 - 0.25rem);
|
|
206
|
+
margin-top: calc(var(--input-height) / 2);
|
|
213
207
|
line-height: 0;
|
|
214
208
|
}
|
|
215
209
|
|
|
@@ -226,19 +220,21 @@ watch(() => modelValue, (newVal) => {
|
|
|
226
220
|
gap: 0;
|
|
227
221
|
}
|
|
228
222
|
|
|
229
|
-
.top-bgl-ctrl-num-btn{
|
|
223
|
+
.top-bgl-ctrl-num-btn {
|
|
230
224
|
margin-top: calc(var(--input-height) / 10) !important;
|
|
231
225
|
}
|
|
232
|
-
|
|
226
|
+
|
|
227
|
+
.bgl-ctrl-num-btn {
|
|
233
228
|
height: calc(var(--input-height) / 2.5) !important;
|
|
234
229
|
isolation: isolate;
|
|
235
230
|
}
|
|
236
231
|
|
|
237
|
-
.bgl-big-ctrl-num-btn{
|
|
232
|
+
.bgl-big-ctrl-num-btn {
|
|
238
233
|
width: 100% !important;
|
|
239
234
|
isolation: isolate;
|
|
240
235
|
}
|
|
241
|
-
|
|
236
|
+
|
|
237
|
+
.bgl-number-input {
|
|
242
238
|
padding-inline-end: 1.75rem !important;
|
|
243
239
|
}
|
|
244
240
|
</style>
|