@bagelink/vue 0.0.755 → 0.0.761
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/PasswordInput.vue.d.ts +25 -6
- package/dist/components/form/inputs/PasswordInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/layout/Tabs.vue.d.ts +2 -0
- package/dist/components/layout/Tabs.vue.d.ts.map +1 -1
- package/dist/index.cjs +69 -35
- package/dist/index.mjs +69 -35
- package/dist/style.css +179 -153
- package/package.json +1 -1
- package/src/components/Btn.vue +1 -1
- package/src/components/NavBar.vue +16 -5
- package/src/components/form/inputs/PasswordInput.vue +45 -15
- package/src/components/form/inputs/RadioGroup.vue +2 -2
- package/src/components/form/inputs/RichText2/Toolbar.vue +1 -1
- package/src/components/form/inputs/RichText2/index.vue +3 -3
- package/src/components/form/inputs/SelectInput.vue +2 -1
- package/src/components/form/inputs/ToggleInput.vue +1 -1
- package/src/components/formkit/Toggle.vue +1 -1
- package/src/components/layout/SidebarMenu.vue +1 -1
- package/src/components/layout/Tabs.vue +6 -3
- package/src/components/lightbox/Lightbox.vue +2 -2
- package/src/styles/layout.css +18 -2
- package/src/styles/mobilLayout.css +16 -2
- package/src/utils/BagelFormUtils.ts +1 -1
package/package.json
CHANGED
package/src/components/Btn.vue
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { MaterialIcon } from '@bagelink/vue'
|
|
3
|
+
import { onMounted } from 'vue'
|
|
3
4
|
import type { MaterialIcons, NavLink } from '@bagelink/vue'
|
|
4
5
|
|
|
5
6
|
withDefaults(
|
|
@@ -19,8 +20,18 @@ withDefaults(
|
|
|
19
20
|
}
|
|
20
21
|
)
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
let isOpen = $ref(true)
|
|
24
|
+
function calcIsOpen() {
|
|
25
|
+
isOpen =
|
|
26
|
+
window.innerWidth < 1100 ||
|
|
27
|
+
[null, 'true'].includes(localStorage.getItem('navOpen'))
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function toggleMenu() {
|
|
31
|
+
isOpen = !isOpen
|
|
32
|
+
localStorage.setItem('navOpen', `${isOpen}`)
|
|
33
|
+
}
|
|
34
|
+
onMounted(calcIsOpen)
|
|
24
35
|
</script>
|
|
25
36
|
|
|
26
37
|
<template>
|
|
@@ -31,8 +42,8 @@ const isOpen = $ref(!isSmallScreen)
|
|
|
31
42
|
role="button"
|
|
32
43
|
aria-label="Toggle Navigation"
|
|
33
44
|
tabindex="0"
|
|
34
|
-
@click="
|
|
35
|
-
@keypress.enter="
|
|
45
|
+
@click="toggleMenu"
|
|
46
|
+
@keypress.enter="toggleMenu"
|
|
36
47
|
>
|
|
37
48
|
<MaterialIcon icon="chevron_right" class="top-arrow" />
|
|
38
49
|
</div>
|
|
@@ -365,7 +376,7 @@ const isOpen = $ref(!isSmallScreen)
|
|
|
365
376
|
display: none;
|
|
366
377
|
}
|
|
367
378
|
}
|
|
368
|
-
|
|
379
|
+
@media screen and (max-height: 550px) {
|
|
369
380
|
.nav.open .nav-button {
|
|
370
381
|
margin-top: 4px;
|
|
371
382
|
margin-bottom: 4px;
|
|
@@ -1,31 +1,61 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Btn, TextInput } from '@bagelink/vue'
|
|
2
|
+
import { Btn, type MaterialIcons, TextInput } from '@bagelink/vue'
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
export interface TextInputProps {
|
|
5
|
+
id?: string
|
|
6
|
+
title?: string
|
|
7
|
+
helptext?: string
|
|
8
|
+
placeholder?: string
|
|
9
|
+
label?: string
|
|
10
|
+
small?: boolean
|
|
11
|
+
dense?: boolean
|
|
12
|
+
required?: boolean
|
|
13
|
+
pattern?: string
|
|
14
|
+
shrink?: boolean
|
|
15
|
+
disabled?: boolean
|
|
16
|
+
nativeInputAttrs?: Record<string, any>
|
|
17
|
+
icon?: MaterialIcons
|
|
18
|
+
iconStart?: MaterialIcons
|
|
19
|
+
multiline?: boolean
|
|
20
|
+
autoheight?: boolean
|
|
21
|
+
code?: boolean
|
|
22
|
+
lines?: number
|
|
23
|
+
autofocus?: boolean
|
|
24
|
+
debounceDelay?: number
|
|
25
|
+
onFocusout?: (e: FocusEvent) => void
|
|
26
|
+
}
|
|
27
|
+
const props = defineProps<TextInputProps>()
|
|
12
28
|
|
|
13
|
-
const password = defineModel<
|
|
29
|
+
const password = defineModel<string>('modelValue')
|
|
14
30
|
const showPwd = defineModel<boolean>('showPwd', { default: false })
|
|
15
31
|
|
|
16
|
-
const toggleShowPwdIcon = $computed(() =>
|
|
17
|
-
|
|
32
|
+
const toggleShowPwdIcon = $computed(() =>
|
|
33
|
+
showPwd.value ? 'visibility_off' : 'visibility'
|
|
34
|
+
)
|
|
35
|
+
const inputType = $computed(() => (showPwd.value ? 'text' : 'password'))
|
|
18
36
|
</script>
|
|
19
37
|
|
|
20
38
|
<template>
|
|
21
39
|
<div class="relative">
|
|
22
|
-
<TextInput
|
|
23
|
-
|
|
40
|
+
<TextInput
|
|
41
|
+
v-model="password"
|
|
42
|
+
v-bind="props"
|
|
43
|
+
:type="inputType"
|
|
44
|
+
autocomplete="current-password"
|
|
45
|
+
class="mb-0"
|
|
46
|
+
/>
|
|
47
|
+
<Btn
|
|
48
|
+
flat
|
|
49
|
+
thin
|
|
50
|
+
class="mx-05 m-password position-bottom-end"
|
|
51
|
+
:icon="toggleShowPwdIcon"
|
|
52
|
+
@click="showPwd = !showPwd"
|
|
53
|
+
/>
|
|
24
54
|
</div>
|
|
25
55
|
</template>
|
|
26
56
|
|
|
27
57
|
<style>
|
|
28
|
-
.m-password{
|
|
58
|
+
.m-password {
|
|
29
59
|
margin-block: calc(var(--input-height) / 2 - 15px);
|
|
30
60
|
}
|
|
31
61
|
</style>
|
|
@@ -26,7 +26,7 @@ const selectedOption = defineModel('modelValue')
|
|
|
26
26
|
<label
|
|
27
27
|
v-for="opt in options"
|
|
28
28
|
:key="opt.id"
|
|
29
|
-
class="border
|
|
29
|
+
class="border rounded p-1 flex bg-gray-light mb-05 gap-075 active-list-item hover"
|
|
30
30
|
:for="opt.id"
|
|
31
31
|
>
|
|
32
32
|
<input
|
|
@@ -40,7 +40,7 @@ const selectedOption = defineModel('modelValue')
|
|
|
40
40
|
<div class="flex w-100 gap-1 flex-wrap m_gap-05 m_gap-row-025">
|
|
41
41
|
<img
|
|
42
42
|
v-if="opt.imgSrc"
|
|
43
|
-
class="bg-popup shadow-light py-025
|
|
43
|
+
class="bg-popup shadow-light py-025 radius-05 m_w40"
|
|
44
44
|
width="60"
|
|
45
45
|
:src="opt.imgSrc"
|
|
46
46
|
:alt="opt.imgAlt"
|
|
@@ -134,10 +134,10 @@ function handleKeyDown(event: KeyboardEvent) {
|
|
|
134
134
|
</script>
|
|
135
135
|
|
|
136
136
|
<template>
|
|
137
|
-
<div class="rich-text-editor
|
|
137
|
+
<div class="rich-text-editor rounded pt-05 px-1 pb-1">
|
|
138
138
|
<Toolbar :config @action="handleToolbarAction" />
|
|
139
139
|
<div class="editor-container flex flex-stretch gap-1 m_column">
|
|
140
|
-
<div class="content-area
|
|
140
|
+
<div class="content-area radius-05 p-1 shadow-light w-100 grid">
|
|
141
141
|
<textarea v-if="isCodeView" v-model="contentHtml" @input="updateContent" />
|
|
142
142
|
<div
|
|
143
143
|
v-else
|
|
@@ -151,7 +151,7 @@ function handleKeyDown(event: KeyboardEvent) {
|
|
|
151
151
|
@keydown="handleKeyDown"
|
|
152
152
|
/>
|
|
153
153
|
</div>
|
|
154
|
-
<code v-if="isSplitView" class="preview-area w-100
|
|
154
|
+
<code v-if="isSplitView" class="preview-area w-100 radius-05 p-1">{{ contentHtml }}</code>
|
|
155
155
|
</div>
|
|
156
156
|
</div>
|
|
157
157
|
</template>
|
|
@@ -14,7 +14,7 @@ const inputVal = defineModel('modelValue', {
|
|
|
14
14
|
<div class="bagel-input checkbox" :title="label">
|
|
15
15
|
<label class="switch">
|
|
16
16
|
<input :id="id" v-model="inputVal" type="checkbox">
|
|
17
|
-
<span class="slider
|
|
17
|
+
<span class="slider rounded" />
|
|
18
18
|
</label>
|
|
19
19
|
</div>
|
|
20
20
|
</template>
|
|
@@ -32,7 +32,7 @@ function toggleMenu() {
|
|
|
32
32
|
@click="toggleMenu"
|
|
33
33
|
/>
|
|
34
34
|
<Card
|
|
35
|
-
class="py-1 px-05 h-100 flex column gap-05
|
|
35
|
+
class="py-1 px-05 h-100 flex column gap-05 rounded relative bg-primary font-light overflow-y "
|
|
36
36
|
>
|
|
37
37
|
<slot v-if="!isOpen || !slots['brand-open']" name="brand" />
|
|
38
38
|
<slot v-if="isOpen" name="brand-open" />
|
|
@@ -8,6 +8,7 @@ import { useTabs } from './tabsManager'
|
|
|
8
8
|
const props = defineProps<{
|
|
9
9
|
tabs: Tab[]
|
|
10
10
|
modelValue?: string
|
|
11
|
+
flat?: boolean
|
|
11
12
|
}>()
|
|
12
13
|
|
|
13
14
|
const emit = defineEmits(['update:modelValue'])
|
|
@@ -19,13 +20,15 @@ const tabValue = (tab: Tab) => (typeof tab === 'string' ? tab : tab.id)
|
|
|
19
20
|
|
|
20
21
|
const slctTab = $computed({
|
|
21
22
|
get: () => props.modelValue || tabValue(props.tabs[0]),
|
|
22
|
-
set:
|
|
23
|
+
set: value => {
|
|
24
|
+
emit('update:modelValue', value)
|
|
25
|
+
},
|
|
23
26
|
})
|
|
24
27
|
|
|
25
28
|
const tabComponent = defineComponent({
|
|
26
29
|
render() {
|
|
27
30
|
const currentTabIndex = props.tabs.findIndex(
|
|
28
|
-
tab => tabValue(tab) === currentTab.value
|
|
31
|
+
tab => tabValue(tab) === currentTab.value
|
|
29
32
|
)
|
|
30
33
|
if (currentTabIndex === -1) return null
|
|
31
34
|
const slotChildren = slots.default?.()[1]?.children
|
|
@@ -37,7 +40,7 @@ const tabComponent = defineComponent({
|
|
|
37
40
|
|
|
38
41
|
z
|
|
39
42
|
<template>
|
|
40
|
-
<TabsNav v-model="slctTab" :tabs :group class="mb-05" />
|
|
43
|
+
<TabsNav v-model="slctTab" :flat :tabs :group class="mb-05" />
|
|
41
44
|
<div v-if="currentTab">
|
|
42
45
|
<template v-if="slots[currentTab]">
|
|
43
46
|
<slot :name="currentTab" />
|
|
@@ -155,7 +155,7 @@ defineExpose({ open, close })
|
|
|
155
155
|
<img
|
|
156
156
|
v-if="item.type === 'image'"
|
|
157
157
|
class="thumbnail object-fit-cover hover
|
|
158
|
-
opacity-5
|
|
158
|
+
opacity-5 rounded flex bg-popup justify-content-center align-items-center flex-shrink-0"
|
|
159
159
|
:src="item.src"
|
|
160
160
|
alt=""
|
|
161
161
|
:class="{ active: currentIndex === index }"
|
|
@@ -164,7 +164,7 @@ defineExpose({ open, close })
|
|
|
164
164
|
<Icon
|
|
165
165
|
v-else
|
|
166
166
|
class="thumbnail object-fit-cover hover
|
|
167
|
-
opacity-5
|
|
167
|
+
opacity-5 ed flex bg-popup justify-content-center align-items-center flex-shrink-0"
|
|
168
168
|
icon="description"
|
|
169
169
|
:class="{ active: currentIndex === index }"
|
|
170
170
|
@click="selectItem(index)"
|
package/src/styles/layout.css
CHANGED
|
@@ -11,18 +11,34 @@
|
|
|
11
11
|
height: 100vh;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
|
|
14
15
|
.round {
|
|
16
|
+
border-radius: 1000px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.rounded,
|
|
20
|
+
.radius,
|
|
21
|
+
.radius-1 {
|
|
15
22
|
border-radius: var(--btn-border-radius) !important;
|
|
16
23
|
}
|
|
17
24
|
|
|
18
|
-
.
|
|
25
|
+
.radius-05 {
|
|
19
26
|
border-radius: calc(var(--btn-border-radius) / 2) !important;
|
|
20
27
|
}
|
|
21
28
|
|
|
22
|
-
.
|
|
29
|
+
.radius-2 {
|
|
23
30
|
border-radius: calc(var(--btn-border-radius) * 2) !important;
|
|
24
31
|
}
|
|
25
32
|
|
|
33
|
+
.radius-3 {
|
|
34
|
+
border-radius: calc(var(--btn-border-radius) * 3) !important;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.radius-4 {
|
|
38
|
+
border-radius: calc(var(--btn-border-radius) * 4) !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
26
42
|
.round-none {
|
|
27
43
|
border-radius: 0;
|
|
28
44
|
}
|
|
@@ -35,17 +35,31 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.m_round {
|
|
38
|
+
border-radius: 1000px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.m_rounded,
|
|
42
|
+
.m_radius,
|
|
43
|
+
.m_radius-1 {
|
|
38
44
|
border-radius: var(--btn-border-radius) !important;
|
|
39
45
|
}
|
|
40
46
|
|
|
41
|
-
.
|
|
47
|
+
.m_radius-05 {
|
|
42
48
|
border-radius: calc(var(--btn-border-radius) / 2) !important;
|
|
43
49
|
}
|
|
44
50
|
|
|
45
|
-
.
|
|
51
|
+
.m_radius-2 {
|
|
46
52
|
border-radius: calc(var(--btn-border-radius) * 2) !important;
|
|
47
53
|
}
|
|
48
54
|
|
|
55
|
+
.m_radius-3 {
|
|
56
|
+
border-radius: calc(var(--btn-border-radius) * 3) !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.m_radius-4 {
|
|
60
|
+
border-radius: calc(var(--btn-border-radius) * 4) !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
49
63
|
.m_round-none {
|
|
50
64
|
border-radius: 0 !important;
|
|
51
65
|
}
|