@bagelink/vue 0.0.322 → 0.0.335

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 (72) hide show
  1. package/dist/components/ComboBox.vue.d.ts.map +1 -1
  2. package/dist/components/MaterialIcon.vue.d.ts +4 -2
  3. package/dist/components/MaterialIcon.vue.d.ts.map +1 -1
  4. package/dist/components/Modal.vue.d.ts +0 -1
  5. package/dist/components/ModalBglForm.vue.d.ts.map +1 -1
  6. package/dist/components/Popover.vue.d.ts +10 -0
  7. package/dist/components/Popover.vue.d.ts.map +1 -0
  8. package/dist/components/form/BglForm.vue.d.ts +1 -9
  9. package/dist/components/form/BglForm.vue.d.ts.map +1 -1
  10. package/dist/components/form/inputs/DateInput.vue.d.ts +0 -1
  11. package/dist/components/form/inputs/SelectInput.vue.d.ts +22 -16
  12. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  13. package/dist/components/form/inputs/TextArea.vue.d.ts +3 -1
  14. package/dist/components/form/inputs/TextArea.vue.d.ts.map +1 -1
  15. package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
  16. package/dist/components/formkit/index.d.ts +1 -14
  17. package/dist/components/formkit/index.d.ts.map +1 -1
  18. package/dist/components/index.d.ts +0 -2
  19. package/dist/components/index.d.ts.map +1 -1
  20. package/dist/components/layout/Layout.vue.d.ts +8 -0
  21. package/dist/components/layout/Layout.vue.d.ts.map +1 -1
  22. package/dist/components/layout/SidebarMenu.vue.d.ts.map +1 -1
  23. package/dist/components/layout/TabbedLayout.vue.d.ts +38 -0
  24. package/dist/components/layout/TabbedLayout.vue.d.ts.map +1 -0
  25. package/dist/components/layout/Tabs.vue.d.ts +24 -0
  26. package/dist/components/layout/Tabs.vue.d.ts.map +1 -0
  27. package/dist/components/layout/TabsBody.vue.d.ts +21 -0
  28. package/dist/components/layout/TabsBody.vue.d.ts.map +1 -0
  29. package/dist/components/layout/TabsNav.vue.d.ts +25 -0
  30. package/dist/components/layout/TabsNav.vue.d.ts.map +1 -0
  31. package/dist/components/layout/index.d.ts +4 -0
  32. package/dist/components/layout/index.d.ts.map +1 -1
  33. package/dist/components/layout/tabsManager.d.ts +4 -0
  34. package/dist/components/layout/tabsManager.d.ts.map +1 -0
  35. package/dist/index.cjs +783 -2035
  36. package/dist/index.d.ts +0 -1
  37. package/dist/index.mjs +785 -2037
  38. package/dist/style.css +2129 -695
  39. package/dist/types/index.d.ts +7 -1
  40. package/dist/types/index.d.ts.map +1 -1
  41. package/dist/types/materialIcon.d.ts +2 -0
  42. package/dist/types/materialIcon.d.ts.map +1 -0
  43. package/dist/types/materialIcons.d.ts +1 -1
  44. package/dist/types/materialIcons.d.ts.map +1 -1
  45. package/dist/utils/index.d.ts.map +1 -1
  46. package/package.json +1 -1
  47. package/src/components/MaterialIcon.vue +3 -2
  48. package/src/components/PageTitle.vue +10 -20
  49. package/src/components/form/BglField.vue +2 -2
  50. package/src/components/form/BglForm.vue +49 -53
  51. package/src/components/form/inputs/SelectInput.vue +128 -484
  52. package/src/components/form/inputs/TextInput.vue +158 -112
  53. package/src/components/index.ts +0 -2
  54. package/src/components/layout/Layout.vue +34 -13
  55. package/src/components/layout/SidebarMenu.vue +22 -22
  56. package/src/components/layout/TabbedLayout.vue +79 -0
  57. package/src/components/layout/Tabs.vue +19 -0
  58. package/src/components/layout/TabsBody.vue +15 -0
  59. package/src/components/layout/TabsNav.vue +48 -0
  60. package/src/components/layout/index.ts +4 -0
  61. package/src/components/layout/tabsManager.ts +18 -0
  62. package/src/styles/appearance.css +81 -0
  63. package/src/styles/bagel.css +2 -0
  64. package/src/styles/layout.css +162 -17
  65. package/src/styles/mobilLayout.css +1476 -0
  66. package/src/styles/text.css +153 -1
  67. package/src/types/index.ts +9 -1
  68. package/src/types/materialIcons.ts +1180 -1178
  69. package/src/utils/BagelFormUtils.ts +1 -1
  70. package/src/utils/index.ts +0 -1
  71. package/src/components/ComboBox.vue +0 -165
  72. package/src/components/TabbedLayout.vue +0 -87
@@ -52,7 +52,7 @@ export function numField(id: string, label?: string, options?: TextInputOptions)
52
52
  export function frmRow(...children: Field[]) {
53
53
  return {
54
54
  $el: 'div',
55
- class: 'flex gap-1',
55
+ class: 'flex gap-1 m_block',
56
56
  children,
57
57
  };
58
58
  }
@@ -44,7 +44,6 @@ export function bindAttrs<T = Record<string, any>>(attrs?: Attributes, fieldVal?
44
44
  key,
45
45
  typeof value === 'function' ? value(fieldVal, row) : value,
46
46
  ]);
47
- if (attrs.options) console.log('arr', arr);
48
47
  const resolvedAttrs = Object.fromEntries(arr);
49
48
  return resolvedAttrs;
50
49
  }
@@ -1,165 +0,0 @@
1
- <template>
2
- <Dropdown placement="bottom-start" class="bagel-input combobox">
3
- <label>
4
- {{ label }}
5
- <button type="button" class="combobox-btn" @click="toggle">
6
- {{ valueToLabel(selectedItem) || placeholder || 'Select' }}
7
- <MaterialIcon v-bind="{ 'icon': open ? 'unfold_less' : 'unfold_more' }" />
8
- </button>
9
- <input
10
- style="width: 0; height: 0; position: absolute; opacity: 0; z-index: -1;" v-if="required"
11
- v-model="selectedItem" required
12
- >
13
- </label>
14
- <template #popper="{ hide }">
15
- <Card thin class="combobox-options" :style="{width: fullWidth?'100%':'auto'}">
16
- <TextInput v-if="searchable" ref="searchInput" dense :placeholder="'Search'" icon="search" v-model="search" />
17
- <div
18
- class="combobox-option" v-for="(option, i) in filteredOptions" :key="`${option}${i}`" @click="() => {
19
- select(option); hide();
20
- }" :class="{ selected: option === selectedItem }"
21
- >
22
- <span>
23
- {{ getLabel(option) }}
24
- </span>
25
- <Icon v-if="isSelected(option)" icon="check" />
26
- </div>
27
- <slot name="last" />
28
- </Card>
29
- </template>
30
- </Dropdown>
31
- </template>
32
-
33
- <script lang="ts" setup>
34
- import { watch } from 'vue';
35
- import { Dropdown } from 'floating-vue';
36
- import 'floating-vue/style.css';
37
- import {
38
- TextInput, Card, Icon, MaterialIcon,
39
- } from '@bagelink/vue';
40
-
41
- type Option = string | number | Record<string, any> | { label: string, value: string | number };
42
- let open = $ref(false);
43
-
44
- const searchInput = $ref<HTMLInputElement | null>(null);
45
-
46
- const props = defineProps<{
47
- options: Option[];
48
- placeholder?: string;
49
- disabled?: boolean;
50
- modelValue?: Option;
51
- searchable?: boolean;
52
- required?: boolean;
53
- label?: string;
54
- fullWidth?: boolean;
55
- }>();
56
- let selectedItem = $ref<Option>();
57
- let search = $ref('');
58
-
59
- const toggle = () => {
60
- open = !open;
61
- if (!open) search = '';
62
- if (open) setTimeout(() => (searchInput as any)?.$el?.querySelector('input')?.focus(), 100);
63
- };
64
-
65
- const valueToLabel = (value?: Option) => {
66
- if (!value) return '';
67
- const option = props.options.find((option) => {
68
- if (typeof option === 'string' || typeof option === 'number') return option === value;
69
- return option.value === value;
70
- });
71
- if (!option) return value;
72
- return getLabel(option);
73
- };
74
-
75
- const emit = defineEmits(['update:modelValue']);
76
-
77
- const getLabel = (option: Option) => {
78
- if (typeof option === 'string') return option;
79
- if (typeof option === 'number') return `${option}`;
80
- return option.label;
81
- };
82
-
83
- const isSelected = (option: Option) => {
84
- if (typeof option === 'string' || typeof option === 'number') return option === selectedItem;
85
- return option.value === selectedItem;
86
- };
87
-
88
- const filteredOptions = $computed(() => props.options.filter((option) => {
89
- const searchTerm = new RegExp(search, 'gi');
90
- if (typeof option === 'string') return option.match(searchTerm);
91
- if (typeof option === 'number') return `${option}`.match(searchTerm);
92
- return option.label.match(searchTerm);
93
- }));
94
-
95
- const select = (option: Option) => {
96
- if (typeof option === 'string') selectedItem = option;
97
- else if (typeof option === 'number') selectedItem = option;
98
- else selectedItem = option.value;
99
- emit('update:modelValue', selectedItem);
100
- open = false;
101
- };
102
-
103
- watch(() => props.modelValue, (value) => {
104
- if (value !== selectedItem) selectedItem = value;
105
- }, { immediate: true });
106
- </script>
107
-
108
- <style scoped>
109
- .combobox {
110
- width: 100%;
111
- }
112
-
113
- .combobox-option {
114
- padding: 6px 12px;
115
- cursor: pointer;
116
- border-radius: 5px;
117
- transition: all 0.2s;
118
- display: flex;
119
- justify-content: space-between;
120
- width: 100%;
121
- }
122
-
123
- .combobox-options {
124
- max-height: 300px;
125
- overflow-y: auto;
126
- }
127
-
128
- .combobox-option:hover {
129
- background: var(--bgl-gray-20);
130
- }
131
- </style>
132
-
133
- <style>
134
- .bagel-input label {
135
- font-size: var(--label-font-size);
136
- }
137
- .combobox-btn {
138
- display: flex;
139
- justify-content: space-between;
140
- align-items: center;
141
- height: var(--input-height);
142
- border-radius: var(--input-border-radius);
143
- border: none;
144
- background: var(--input-bg);
145
- padding: 0.7rem;
146
- color: var(--input-color);
147
- width: 100%;
148
- font-family: inherit;
149
- }
150
-
151
- .combobox-btn:focus {
152
- outline: none;
153
- box-shadow: inset 0 0 10px #00000012;
154
- }
155
-
156
- .v-popper__arrow-container {
157
- display: none;
158
- }
159
-
160
- .v-popper--theme-dropdown .v-popper__inner {
161
- border: none;
162
- background: transparent;
163
- border-radius: var(--card-border-radius);
164
- }
165
- </style>
@@ -1,87 +0,0 @@
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
7
- v-for="tab in tabs"
8
- :class="{
9
- active:
10
- tab === activeTab ||
11
- tab === router?.currentRoute.value.path.split('/').slice(-1)[0],
12
- }"
13
- class="tab"
14
- :key="tab"
15
- @click="changeTab(tab)"
16
- >
17
- {{ tab }}
18
- </div>
19
- </div>
20
- </div>
21
- <div
22
- class="list-content"
23
- v-for="tab in tabs.filter((item) => item === activeTab)"
24
- :key="tab"
25
- >
26
- <slot :name="tab" :key="tab" />
27
- </div>
28
- </div>
29
- </template>
30
-
31
- <script setup lang="ts">
32
- import { onMounted } from 'vue';
33
- import type { Router } from 'vue-router';
34
-
35
- const emit = defineEmits(['update:modelValue']);
36
-
37
- let activeTab = $ref<string>();
38
- const props = defineProps<{
39
- title?: string;
40
- tabs: string[];
41
- modelValue?: string;
42
- router?: Router;
43
- sideTabs?: boolean;
44
- }>();
45
-
46
- function changeTab(tab: string) {
47
- activeTab = tab;
48
- emit('update:modelValue', activeTab);
49
- if (!props.router) return;
50
- void props.router?.push({
51
- path: props.router.currentRoute.value.path,
52
- query: { ...props.router.currentRoute.value.query, t: tab },
53
- hash: props.router.currentRoute.value.hash,
54
- });
55
- }
56
-
57
- onMounted(() => {
58
- const firstTab =
59
- props.modelValue ||
60
- props.router?.currentRoute.value.query.t ||
61
- props.tabs[0];
62
- activeTab = firstTab as string;
63
- });
64
- </script>
65
-
66
- <style scoped>
67
- .tab {
68
- text-transform: capitalize;
69
- }
70
-
71
- .side-tabs{
72
- display: flex;
73
- }
74
- .side-tabs .tabs-top{
75
- margin-inline-end: 1rem;
76
- }
77
- .side-tabs .tabs{
78
- display: block;
79
- padding: 0;
80
- margin: 0;
81
- border: none;
82
- }
83
-
84
- .side-tabs .tab{
85
- border: none;
86
- }
87
- </style>