@bagelink/vue 0.0.331 → 0.0.337

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.
Files changed (53) hide show
  1. package/dist/components/MaterialIcon.vue.d.ts +4 -2
  2. package/dist/components/MaterialIcon.vue.d.ts.map +1 -1
  3. package/dist/components/form/inputs/SelectInput.vue.d.ts +24 -16
  4. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  5. package/dist/components/index.d.ts +0 -2
  6. package/dist/components/index.d.ts.map +1 -1
  7. package/dist/components/layout/Layout.vue.d.ts +8 -0
  8. package/dist/components/layout/Layout.vue.d.ts.map +1 -1
  9. package/dist/components/layout/SidebarMenu.vue.d.ts.map +1 -1
  10. package/dist/components/layout/TabbedLayout.vue.d.ts +38 -0
  11. package/dist/components/layout/TabbedLayout.vue.d.ts.map +1 -0
  12. package/dist/components/layout/Tabs.vue.d.ts +24 -0
  13. package/dist/components/layout/Tabs.vue.d.ts.map +1 -0
  14. package/dist/components/layout/TabsBody.vue.d.ts +21 -0
  15. package/dist/components/layout/TabsBody.vue.d.ts.map +1 -0
  16. package/dist/components/layout/TabsNav.vue.d.ts +25 -0
  17. package/dist/components/layout/TabsNav.vue.d.ts.map +1 -0
  18. package/dist/components/layout/index.d.ts +4 -0
  19. package/dist/components/layout/index.d.ts.map +1 -1
  20. package/dist/components/layout/tabsManager.d.ts +4 -0
  21. package/dist/components/layout/tabsManager.d.ts.map +1 -0
  22. package/dist/index.cjs +806 -2027
  23. package/dist/index.mjs +808 -2029
  24. package/dist/style.css +420 -504
  25. package/dist/types/index.d.ts +7 -1
  26. package/dist/types/index.d.ts.map +1 -1
  27. package/dist/types/materialIcons.d.ts +1 -1
  28. package/dist/types/materialIcons.d.ts.map +1 -1
  29. package/dist/utils/index.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/src/components/MaterialIcon.vue +3 -2
  32. package/src/components/PageTitle.vue +10 -20
  33. package/src/components/form/BglField.vue +2 -2
  34. package/src/components/form/BglForm.vue +0 -1
  35. package/src/components/form/inputs/SelectInput.vue +161 -482
  36. package/src/components/index.ts +0 -2
  37. package/src/components/layout/Layout.vue +34 -13
  38. package/src/components/layout/SidebarMenu.vue +22 -22
  39. package/src/components/layout/TabbedLayout.vue +79 -0
  40. package/src/components/layout/Tabs.vue +19 -0
  41. package/src/components/layout/TabsBody.vue +15 -0
  42. package/src/components/layout/TabsNav.vue +48 -0
  43. package/src/components/layout/index.ts +4 -0
  44. package/src/components/layout/tabsManager.ts +18 -0
  45. package/src/styles/appearance.css +42 -0
  46. package/src/styles/layout.css +74 -12
  47. package/src/styles/mobilLayout.css +77 -17
  48. package/src/styles/text.css +153 -1
  49. package/src/types/index.ts +9 -1
  50. package/src/types/materialIcons.ts +1180 -1178
  51. package/src/utils/index.ts +0 -1
  52. package/src/components/ComboBox.vue +0 -171
  53. package/src/components/TabbedLayout.vue +0 -87
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <div class="layout" :class="{ 'layout-h-100': h100 }" :style="style">
3
- <slot />
4
- </div>
2
+ <div class="layout" :class="{ 'layout-h-100': h100 }">
3
+ <slot />
4
+ </div>
5
5
  </template>
6
6
 
7
7
  <script lang="ts" setup>
@@ -9,27 +9,48 @@ type LayoutProrps = {
9
9
  gap?: number,
10
10
  h100?: boolean,
11
11
  columns?: string[]
12
+ mColumns?: string[],
13
+ mRows?: string[]
12
14
  rows?: string[],
13
15
  }
14
16
 
15
17
  const props = withDefaults(defineProps<LayoutProrps>(), {
16
- gap: 1,
17
- h100: false,
18
- columns: () => [],
19
- rows: () => [],
18
+ gap: 1,
19
+ h100: false,
20
+ columns: () => ([]),
21
+ rows: () => ([]),
22
+ mColumns: () => ([]),
23
+ mRows: () => ([]),
20
24
  });
21
25
 
22
- const style = $computed(() => {
23
- const obj: Record<string, any> = { gap: `${props.gap}rem` };
24
- if (props.columns.length) obj['grid-template-columns'] = props.columns.join(' ');
25
- if (props.rows.length) obj['grid-template-rows'] = props.rows.join(' ');
26
- return obj;
26
+ const gridTemplateRows = $computed(() => (props.rows.length ? props.rows.join(' ') : 'auto'));
27
+ const gapSize = $computed(() => `${props.gap}rem`);
28
+ const mGridTemplateRows = $computed(() => {
29
+ if (props.mRows?.length) return props.mRows.join(' ');
30
+ return gridTemplateRows;
31
+ });
32
+
33
+ const gridTemplateColumns = $computed(() => (props.columns.length ? props.columns.join(' ') : 'auto'));
34
+
35
+ const mGridTemplateColumns = $computed(() => {
36
+ if (props.mColumns?.length) return props.mColumns.join(' ');
37
+ return gridTemplateColumns;
27
38
  });
28
39
  </script>
29
40
 
30
- <style>
41
+ <style scoped>
31
42
  .layout {
32
43
  min-height: 100px;
33
44
  display: grid;
45
+ gap: v-bind(gapSize);
46
+ grid-template-rows: v-bind(gridTemplateRows);
47
+ grid-template-columns: v-bind(gridTemplateColumns);
48
+ }
49
+
50
+ @media screen and (max-width: 910px) {
51
+ .layout {
52
+ grid-template-rows: v-bind(mGridTemplateRows);
53
+ grid-template-columns: v-bind(mGridTemplateColumns);
54
+ }
34
55
  }
35
56
  </style>
@@ -1,28 +1,27 @@
1
1
  <template>
2
- <Card class="flex column gap-05 pt-1 bgl_sidebar" :class="{ 'wideNav': isOpen }">
3
- <div class="w-100 px-075">
4
- <Btn thin color="light" class="toggleNav mb-05" icon="keyboard_arrow_right" @click="toggleMenu" />
5
- </div> <slot v-if="!isOpen || !slots['brand-open']" name="brand" />
6
- <slot v-if="isOpen" name="brand-open" />
7
- <slot v-if="!navLinks" />
8
- <Btn
9
- v-for="(nav, i) in navLinks" :key="i" :to="nav.to" class="nav-button px-075"
10
- v-tooltip.right="{ content: nav.label, disabled: open, class: ['nav-tooltip'] }"
11
- >
12
- <template #default >
13
- <Icon :icon="nav.icon" :size="1.4"/>
14
- <p v-if="open">
15
- {{ nav.label }}
16
- </p>
17
- </template>
18
- </Btn>
19
- <slot name="footer" />
20
- </Card>
2
+ <Card class="flex column gap-05 pt-1 bgl_sidebar" :class="{ 'wideNav': isOpen }">
3
+ <div class="w-100 px-075">
4
+ <Btn thin color="light" class="toggleNav mb-05" icon="keyboard_arrow_right" @click="toggleMenu" />
5
+ </div>
6
+ <slot v-if="!isOpen || !slots['brand-open']" name="brand" />
7
+ <slot v-if="isOpen" name="brand-open" />
8
+ <slot v-if="!navLinks" />
9
+ <Btn v-for="(nav, i) in navLinks" :key="i" :to="nav.to" class="nav-button px-075"
10
+ v-tooltip.right="{ content: nav.label, disabled: open, class: ['nav-tooltip'] }">
11
+ <template #default>
12
+ <Icon :icon="nav.icon" :size="1.4" />
13
+ <p v-if="open">
14
+ {{ nav.label }}
15
+ </p>
16
+ </template>
17
+ </Btn>
18
+ <slot name="footer" />
19
+ </Card>
21
20
  </template>
22
21
 
23
22
  <script lang="ts" setup>
24
23
  import { useSlots } from 'vue';
25
- import { Btn, Icon } from '@bagelink/vue';
24
+ import { Btn, Icon, Card } from '@bagelink/vue';
26
25
  import type { NavLink } from '@bagelink/vue';
27
26
 
28
27
  const slots = useSlots();
@@ -33,8 +32,8 @@ let isOpen = $ref(props.open);
33
32
 
34
33
  const emit = defineEmits(['update:open']);
35
34
  function toggleMenu() {
36
- isOpen = !isOpen;
37
- emit('update:open', isOpen);
35
+ isOpen = !isOpen;
36
+ emit('update:open', isOpen);
38
37
  }
39
38
  </script>
40
39
 
@@ -50,6 +49,7 @@ function toggleMenu() {
50
49
  .wideNav .nav-button .bgl_btn-flex {
51
50
  justify-content: flex-start !important;
52
51
  }
52
+
53
53
  .nav-button.router-link-active {
54
54
  background-color: var(--bgl-primary-tint) !important;
55
55
  }
@@ -0,0 +1,79 @@
1
+ <template>
2
+ <div class="h-100 grid list-view gap-1" :class="{ 'side-tabs': sideTabs }">
3
+ <div class="bgl_card tabs-top">
4
+ <slot name="top-section" />
5
+ <div class="tabs grid auto-flow-columns fit-content">
6
+ <div v-for="tab in tabs" :class="{
7
+ active:
8
+ tab === activeTab ||
9
+ tab === router?.currentRoute.value.path.split('/').slice(-1)[0],
10
+ }" class="tab" :key="tab" @click="changeTab(tab)">
11
+ {{ tab }}
12
+ </div>
13
+ </div>
14
+ </div>
15
+ <div class="list-content" v-for="tab in tabs.filter((item) => item === activeTab)" :key="tab">
16
+ <slot :name="tab" :key="tab" />
17
+ </div>
18
+ </div>
19
+ </template>
20
+
21
+ <script setup lang="ts">
22
+ import { onMounted } from 'vue';
23
+ import type { Router } from 'vue-router';
24
+
25
+ const emit = defineEmits(['update:modelValue']);
26
+
27
+ let activeTab = $ref<string>();
28
+ const props = defineProps<{
29
+ title?: string;
30
+ tabs: string[];
31
+ modelValue?: string;
32
+ router?: Router;
33
+ sideTabs?: boolean;
34
+ }>();
35
+
36
+ function changeTab(tab: string) {
37
+ activeTab = tab;
38
+ emit('update:modelValue', activeTab);
39
+ if (!props.router) return;
40
+ void props.router?.push({
41
+ path: props.router.currentRoute.value.path,
42
+ query: { ...props.router.currentRoute.value.query, t: tab },
43
+ hash: props.router.currentRoute.value.hash,
44
+ });
45
+ }
46
+
47
+ onMounted(() => {
48
+ const firstTab =
49
+ props.modelValue ||
50
+ props.router?.currentRoute.value.query.t ||
51
+ props.tabs[0];
52
+ activeTab = firstTab as string;
53
+ });
54
+ </script>
55
+
56
+ <style scoped>
57
+ .tab {
58
+ text-transform: capitalize;
59
+ }
60
+
61
+ .side-tabs {
62
+ display: flex;
63
+ }
64
+
65
+ .side-tabs .tabs-top {
66
+ margin-inline-end: 1rem;
67
+ }
68
+
69
+ .side-tabs .tabs {
70
+ display: block;
71
+ padding: 0;
72
+ margin: 0;
73
+ border: none;
74
+ }
75
+
76
+ .side-tabs .tab {
77
+ border: none;
78
+ }
79
+ </style>
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <TabsNav :tabs="tabs" :group="group" />
3
+ <div v-if="currentTab">
4
+ <slot :name="currentTab" />
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ import { TabsNav, type Tab } from '@bagelink/vue';
10
+ import { useTabs } from './tabsManager';
11
+
12
+ defineProps<{
13
+ tabs: Tab[];
14
+ modelValue?: string;
15
+ }>();
16
+
17
+ const group = Math.random().toString(36).substring(7);
18
+ const { currentTab } = useTabs(group);
19
+ </script>
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <div v-if="currentTab">
3
+ <slot :name="currentTab"></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { useTabs } from './tabsManager';
9
+
10
+ const props = defineProps<{
11
+ group: string;
12
+ }>();
13
+
14
+ const { currentTab } = useTabs(props.group);
15
+ </script>
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <div class="tabs grid auto-flow-columns fit-content">
3
+ <button :class="{ active: isActive(tab) }" @click="selectTab(tab)" class="tab" v-for="(tab, i) in tabs" :key="i">
4
+ <Icon v-if="typeof tab !== 'string' && tab.icon" :icon="tab.icon" />
5
+ {{ tabLabel(tab) }}
6
+ </button>
7
+ </div>
8
+ </template>
9
+
10
+ <script setup lang="ts">
11
+ import { type Tab, Icon } from '@bagelink/vue';
12
+ import { useTabs } from './tabsManager';
13
+
14
+ const props = defineProps<{
15
+ title?: string;
16
+ tabs: Tab[];
17
+ modelValue?: string;
18
+ sideTabs?: boolean;
19
+ group: string;
20
+ }>();
21
+
22
+ const { currentTab } = useTabs(props.group);
23
+ currentTab.value = props.modelValue || typeof props.tabs[0] === 'string' ? props.tabs[0] : props.tabs[0].id;
24
+ const selectTab = (tab: Tab) => {
25
+ currentTab.value = typeof tab === 'string' ? tab : tab.id;
26
+ };
27
+
28
+ const isActive = (tab: Tab) => {
29
+ if (typeof tab === 'string') return currentTab.value === tab;
30
+ return currentTab.value === tab.id;
31
+ };
32
+ const tabLabel = (tab: Tab) => {
33
+ if (typeof tab === 'string') return tab;
34
+ return tab.label;
35
+ };
36
+ </script>
37
+
38
+ <style scoped>
39
+ .tab {
40
+ border: none;
41
+ border-bottom: 1px solid var(--border-color);
42
+ background: transparent;
43
+ }
44
+
45
+ .tab.currentTab {
46
+ border-bottom: 2px solid var(--primary-color);
47
+ }
48
+ </style>
@@ -1,2 +1,6 @@
1
1
  export { default as Layout } from './Layout.vue';
2
2
  export { default as SidebarMenu } from './SidebarMenu.vue';
3
+ export { default as Tabs } from './Tabs.vue';
4
+ export { default as TabsNav } from './TabsNav.vue';
5
+ export { default as TabsBody } from './TabsBody.vue';
6
+ export { default as TabbedLayout } from './TabbedLayout.vue';
@@ -0,0 +1,18 @@
1
+ import { reactive, computed } from 'vue';
2
+
3
+ const state = reactive(new Map());
4
+
5
+ export function useTabs(group: string) {
6
+ if (!state.has(group)) {
7
+ state.set(group, reactive({ currentTab: null }));
8
+ }
9
+
10
+ const currentTab = computed({
11
+ get: () => state.get(group).currentTab,
12
+ set: (val) => {
13
+ state.get(group).currentTab = val;
14
+ },
15
+ });
16
+
17
+ return { currentTab };
18
+ }
@@ -36,4 +36,46 @@
36
36
 
37
37
  .opacity-10 {
38
38
  opacity: 1;
39
+ }
40
+
41
+ @media screen and (max-width: 910px) {
42
+ .m_opacity-1 {
43
+ opacity: 0.1;
44
+ }
45
+
46
+ .m_opacity-2 {
47
+ opacity: 0.2;
48
+ }
49
+
50
+ .m_opacity-3 {
51
+ opacity: 0.3;
52
+ }
53
+
54
+ .m_opacity-4 {
55
+ opacity: 0.4;
56
+ }
57
+
58
+ .m_opacity-5 {
59
+ opacity: 0.5;
60
+ }
61
+
62
+ .m_opacity-6 {
63
+ opacity: 0.6;
64
+ }
65
+
66
+ .m_opacity-7 {
67
+ opacity: 0.7;
68
+ }
69
+
70
+ .m_opacity-8 {
71
+ opacity: 0.8;
72
+ }
73
+
74
+ .m_opacity-9 {
75
+ opacity: 0.9;
76
+ }
77
+
78
+ .m_opacity-10 {
79
+ opacity: 1;
80
+ }
39
81
  }
@@ -101,12 +101,11 @@
101
101
  inset-inline-end: 0px;
102
102
  }
103
103
 
104
- .position-absolute {
105
- position: absolute;
106
- }
107
-
108
- .position-relative {
109
- position: relative;
104
+ .positioned-full {
105
+ top: 0;
106
+ bottom: 0;
107
+ inset-inline-start: 0;
108
+ inset-inline-end: 0;
110
109
  }
111
110
 
112
111
  .auto-flow-rows {
@@ -129,8 +128,6 @@
129
128
  .w-100,
130
129
  .width-100 {
131
130
  width: 100%;
132
- max-width: 100px;
133
-
134
131
  }
135
132
 
136
133
  .w300,
@@ -168,15 +165,62 @@
168
165
  margin-inline-end: auto;
169
166
  width: 98%;
170
167
  }
168
+ .w10 {
169
+ max-width: 10px;
170
+ }
171
+
172
+ .w20 {
173
+ max-width: 20px;
174
+ }
175
+
176
+ .w20 {
177
+ max-width: 20px;
178
+ }
179
+
180
+ .w30 {
181
+ max-width: 30px;
182
+ }
183
+
184
+ .w40 {
185
+ max-width: 40px;
186
+ }
187
+
188
+ .w50 {
189
+ max-width: 50px;
190
+ }
191
+
192
+ .w60 {
193
+ max-width: 60px;
194
+ }
195
+
196
+ .w70 {
197
+ max-width: 70px;
198
+ }
199
+
200
+ .w80 {
201
+ max-width: 80px;
202
+ }
203
+
204
+ .w90 {
205
+ max-width: 90px;
206
+ }
171
207
 
172
208
  .w100 {
173
209
  max-width: 100px;
174
210
  }
175
211
 
212
+ .w150 {
213
+ max-width: 150px;
214
+ }
215
+
176
216
  .w200 {
177
217
  max-width: 200px;
178
218
  }
179
219
 
220
+ .w250 {
221
+ max-width: 250px;
222
+ }
223
+
180
224
  .w300 {
181
225
  max-width: 300px;
182
226
  }
@@ -1124,14 +1168,31 @@
1124
1168
  padding: 0.25rem !important;
1125
1169
  }
1126
1170
 
1127
- .relative {
1128
- position: relative;
1171
+ .relative,
1172
+ .position-relative {
1173
+ position: relative !important;
1129
1174
  }
1130
1175
 
1131
- .absolute {
1176
+ .absolute,
1177
+ .position-absolute {
1132
1178
  position: absolute !important;
1133
1179
  }
1134
1180
 
1181
+ .fixed,
1182
+ .position-fixed {
1183
+ position: fixed !important;
1184
+ }
1185
+
1186
+ .static,
1187
+ .position-static {
1188
+ position: static !important;
1189
+ }
1190
+
1191
+ .sticky,
1192
+ .position-sticky {
1193
+ position: sticky !important;
1194
+ }
1195
+
1135
1196
  .flex {
1136
1197
  display: flex;
1137
1198
  align-items: center;
@@ -1143,7 +1204,8 @@
1143
1204
  }
1144
1205
 
1145
1206
  .hide,
1146
- .display-hide {
1207
+ .none,
1208
+ .display-none {
1147
1209
  display: none;
1148
1210
  }
1149
1211
 
@@ -19,14 +19,12 @@
19
19
  display: grid !important;
20
20
  }
21
21
 
22
- .m_none {
22
+ .m_hide,
23
+ .m_none,
24
+ .m_display-none {
23
25
  display: none !important;
24
26
  }
25
27
 
26
- .m_w-100 {
27
- width: 100% !important;
28
- }
29
-
30
28
  .m_inline-grid {
31
29
  display: inline-grid;
32
30
  }
@@ -126,12 +124,11 @@
126
124
  inset-inline-end: 0px;
127
125
  }
128
126
 
129
- .m_position-absolute {
130
- position: absolute;
131
- }
132
-
133
- .m_position-relative {
134
- position: relative;
127
+ .m_positioned-full {
128
+ top: 0;
129
+ bottom: 0;
130
+ inset-inline-start: 0;
131
+ inset-inline-end: 0;
135
132
  }
136
133
 
137
134
  .m_auto-flow-rows {
@@ -153,9 +150,7 @@
153
150
 
154
151
  .m_w-100,
155
152
  .m_width-100 {
156
- width: 100%;
157
- max-width: 100px;
158
-
153
+ width: 100% !important;
159
154
  }
160
155
 
161
156
  .m_w300,
@@ -177,14 +172,62 @@
177
172
  width: 98%;
178
173
  }
179
174
 
175
+ .m_w10 {
176
+ max-width: 10px;
177
+ }
178
+
179
+ .m_w20 {
180
+ max-width: 20px;
181
+ }
182
+
183
+ .m_w20 {
184
+ max-width: 20px;
185
+ }
186
+
187
+ .m_w30 {
188
+ max-width: 30px;
189
+ }
190
+
191
+ .m_w40 {
192
+ max-width: 40px;
193
+ }
194
+
195
+ .m_w50 {
196
+ max-width: 50px;
197
+ }
198
+
199
+ .m_w60 {
200
+ max-width: 60px;
201
+ }
202
+
203
+ .m_w70 {
204
+ max-width: 70px;
205
+ }
206
+
207
+ .m_w80 {
208
+ max-width: 80px;
209
+ }
210
+
211
+ .m_w90 {
212
+ max-width: 90px;
213
+ }
214
+
180
215
  .m_w100 {
181
216
  max-width: 100px;
182
217
  }
183
218
 
219
+ .m_w150 {
220
+ max-width: 150px;
221
+ }
222
+
184
223
  .m_w200 {
185
224
  max-width: 200px;
186
225
  }
187
226
 
227
+ .m_w250 {
228
+ max-width: 250px;
229
+ }
230
+
188
231
  .m_w300 {
189
232
  max-width: 300px;
190
233
  }
@@ -1060,14 +1103,31 @@
1060
1103
  padding: 0.25rem !important;
1061
1104
  }
1062
1105
 
1063
- .m_relative {
1064
- position: relative;
1106
+ .m_relative,
1107
+ .m_position-relative {
1108
+ position: relative !important;
1065
1109
  }
1066
1110
 
1067
- .m_absolute {
1111
+ .m_absolute,
1112
+ .m_position-absolute {
1068
1113
  position: absolute !important;
1069
1114
  }
1070
1115
 
1116
+ .m_fixed,
1117
+ .m_position-fixed {
1118
+ position: fixed !important;
1119
+ }
1120
+
1121
+ .m_static,
1122
+ .m_position-static {
1123
+ position: static !important;
1124
+ }
1125
+
1126
+ .m_sticky,
1127
+ .m_position-sticky {
1128
+ position: sticky !important;
1129
+ }
1130
+
1071
1131
  .m_flex-stretch {
1072
1132
  display: flex;
1073
1133
  align-items: stretch;