@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.755",
4
+ "version": "0.0.761",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -246,7 +246,7 @@ a {
246
246
  }
247
247
 
248
248
  .bgl_btn.round {
249
- border-radius: calc(var(--btn-border-radius) * 2);
249
+ border-radius: 1000px;
250
250
  }
251
251
 
252
252
  .bgl_btn-icon.thin {
@@ -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
- const isSmallScreen = $computed(() => window.innerWidth < 1100)
23
- const isOpen = $ref(!isSmallScreen)
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="isOpen = !isOpen"
35
- @keypress.enter="isOpen = !isOpen"
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
- @media screen and (max-height: 550px) {
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 type TextInputT = InstanceType<typeof TextInput>
5
-
6
- export type TextInputProps = Omit<
7
- TextInputT['$props'],
8
- (`${string}modelValue` | `ref${string}` | `onVnode${string}` | 'key' | 'type')
9
- >
10
- // const props =
11
- defineProps<{ txtInputProps: TextInputProps }>()
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< string>('modelValue')
29
+ const password = defineModel<string>('modelValue')
14
30
  const showPwd = defineModel<boolean>('showPwd', { default: false })
15
31
 
16
- const toggleShowPwdIcon = $computed(() => showPwd.value ? 'visibility_off' : 'visibility')
17
- const inputType = $computed(() => showPwd.value ? 'text' : 'password')
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 v-model="password" class="mb-0" :type="inputType" v-bind="txtInputProps" />
23
- <Btn flat thin class="mx-05 m-password position-bottom-end" :icon="toggleShowPwdIcon" @click="showPwd = !showPwd" />
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 round p-1 flex bg-gray-light mb-05 gap-075 active-list-item hover"
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 rounded m_w40"
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"
@@ -67,7 +67,7 @@ function handleSelectChange(selectedOption: string) {
67
67
  thin
68
68
  flat
69
69
  :class="action.class"
70
- class="rounded"
70
+ class="radius-05"
71
71
  :aria-label="action.name"
72
72
  :icon="action.icon"
73
73
  @click="emit('action', action.name)"
@@ -134,10 +134,10 @@ function handleKeyDown(event: KeyboardEvent) {
134
134
  </script>
135
135
 
136
136
  <template>
137
- <div class="rich-text-editor round pt-05 px-1 pb-1">
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 rounded p-1 shadow-light w-100 grid">
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 rounded p-1">{{ contentHtml }}</code>
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>
@@ -310,7 +310,8 @@ onMounted(() => {
310
310
  opacity: 0.3;
311
311
  }
312
312
  .selected{
313
- background: var(--bgl-primary-tint);
313
+ /* background: var(--bgl-primary-tint); */
314
+ background: var(--bgl-gray-light);
314
315
  }
315
316
  </style>
316
317
 
@@ -26,7 +26,7 @@ onMounted(() => {
26
26
  :class="{ small }"
27
27
  >
28
28
  <div class="switch" :class="{ checked }">
29
- <span class="slider round" />
29
+ <span class="slider rounded" />
30
30
  </div>
31
31
 
32
32
  <input
@@ -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 round" />
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 round relative bg-primary font-light overflow-y "
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: (value) => { emit('update:modelValue', value) },
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 round flex bg-popup justify-content-center align-items-center flex-shrink-0"
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 round flex bg-popup justify-content-center align-items-center flex-shrink-0"
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)"
@@ -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
- .rounded {
25
+ .radius-05 {
19
26
  border-radius: calc(var(--btn-border-radius) / 2) !important;
20
27
  }
21
28
 
22
- .round-extra {
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
- .m_rounded {
47
+ .m_radius-05 {
42
48
  border-radius: calc(var(--btn-border-radius) / 2) !important;
43
49
  }
44
50
 
45
- .m_round-extra {
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
  }
@@ -160,7 +160,7 @@ export function numField(
160
160
  export function frmRow(...children: Field[]) {
161
161
  return {
162
162
  $el: 'div',
163
- class: 'flex gap-1 m_block',
163
+ class: 'flex gap-1 m_block align-items-end',
164
164
  children,
165
165
  }
166
166
  }