@bagelink/vue 0.0.413 → 0.0.419
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/Accordion.vue.d.ts +1 -1
- package/dist/components/AccordionItem.vue.d.ts +2 -2
- package/dist/components/Alert.vue.d.ts +2 -2
- package/dist/components/Avatar.vue.d.ts +2 -2
- package/dist/components/Avatar.vue.d.ts.map +1 -1
- package/dist/components/Badge.vue.d.ts +3 -2
- package/dist/components/BglVideo.vue.d.ts +1 -1
- package/dist/components/Btn.vue.d.ts +4 -3
- package/dist/components/Card.vue.d.ts +2 -2
- package/dist/components/Carousel.vue.d.ts +3 -3
- package/dist/components/DataPreview.vue.d.ts +10 -9
- package/dist/components/ListItem.vue.d.ts +2 -2
- package/dist/components/ListView.vue.d.ts +1 -1
- package/dist/components/ListView.vue.d.ts.map +1 -1
- package/dist/components/MaterialIcon.vue.d.ts +4 -3
- package/dist/components/Modal.vue.d.ts +5 -5
- package/dist/components/ModalConfirm.vue.d.ts +3 -3
- package/dist/components/ModalConfirm.vue.d.ts.map +1 -1
- package/dist/components/ModalForm.vue.d.ts +27 -26
- package/dist/components/NavBar.vue.d.ts +4 -3
- package/dist/components/NavBar.vue.d.ts.map +1 -1
- package/dist/components/PageTitle.vue.d.ts +2 -2
- package/dist/components/RouterWrapper.vue.d.ts +1 -1
- package/dist/components/TableSchema.vue.d.ts +383 -6
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/Title.vue.d.ts +2 -2
- package/dist/components/TopBar.vue.d.ts +1 -1
- package/dist/components/dashboard/Lineart.vue.d.ts +4 -3
- package/dist/components/form/BglField.vue.d.ts +5 -4
- package/dist/components/form/BglForm.vue.d.ts +6 -5
- package/dist/components/form/BglForm.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/CheckInput.vue.d.ts +14 -14
- package/dist/components/form/inputs/Checkbox.vue.d.ts +4 -4
- package/dist/components/form/inputs/ColorPicker.vue.d.ts +3 -3
- package/dist/components/form/inputs/DateInput.vue.d.ts +5 -5
- package/dist/components/form/inputs/DatePicker.vue.d.ts +10 -3
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/FileUpload.vue.d.ts +16 -15
- package/dist/components/form/inputs/JSONInput.vue.d.ts +3 -3
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts +24 -4
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText.vue.d.ts +3 -3
- package/dist/components/form/inputs/SelectInput.vue.d.ts +4 -3
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TableField.vue.d.ts +3 -3
- package/dist/components/form/inputs/TextInput.vue.d.ts +5 -4
- package/dist/components/form/inputs/ToggleInput.vue.d.ts +12 -12
- package/dist/components/layout/BottomMenu.vue.d.ts +4 -3
- package/dist/components/layout/Layout.vue.d.ts +2 -2
- package/dist/components/layout/SidebarMenu.vue.d.ts +5 -4
- package/dist/components/layout/TabbedLayout.vue.d.ts +5 -4
- package/dist/components/layout/Tabs.vue.d.ts +4 -3
- package/dist/components/layout/TabsBody.vue.d.ts +2 -2
- package/dist/components/layout/TabsNav.vue.d.ts +4 -3
- package/dist/components/layout/tabsManager.d.ts +1 -1
- package/dist/index.cjs +6527 -4442
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +6527 -4442
- package/dist/plugins/bagel.d.ts +2 -1
- package/dist/plugins/modal.d.ts +3 -3
- package/dist/style.css +267 -265
- package/dist/types/BagelForm.d.ts +1 -0
- package/dist/types/BtnOptions.d.ts +2 -1
- package/dist/types/NavLink.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/BagelFormUtils.d.ts +2 -1
- package/dist/utils/clickOutside.d.ts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Avatar.vue +2 -1
- package/src/components/ListView.vue +24 -28
- package/src/components/NavBar.vue +235 -226
- package/src/components/TableSchema.vue +34 -4
- package/src/components/form/BglForm.vue +13 -3
- package/src/components/form/inputs/CheckInput.vue +1 -0
- package/src/components/form/inputs/DatePicker.vue +13 -2
- package/src/components/form/inputs/RadioPillsInput.vue +15 -8
- package/src/components/form/inputs/SelectInput.vue +13 -11
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
<div :class="{ open: isOpen, closed: !isOpen }">
|
|
3
3
|
<slot name="top" />
|
|
4
4
|
<div
|
|
5
|
-
class="nav-expend"
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
class="nav-expend"
|
|
6
|
+
@click="isOpen = !isOpen"
|
|
7
|
+
@keypress.enter="isOpen = !isOpen"
|
|
8
|
+
role="button"
|
|
9
|
+
aria-label="Toggle Navigation"
|
|
10
|
+
tabindex="0">
|
|
8
11
|
<MaterialIcon icon="chevron_right" class="top-arrow" />
|
|
9
12
|
</div>
|
|
10
13
|
|
|
@@ -12,9 +15,12 @@
|
|
|
12
15
|
<div class="nav-scroll">
|
|
13
16
|
<div class="nav-links-wrapper">
|
|
14
17
|
<component
|
|
15
|
-
:is="link.to?'router-link':'div'"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
:is="link.to ? 'router-link' : 'div'"
|
|
19
|
+
v-for="link in links"
|
|
20
|
+
class="nav-button"
|
|
21
|
+
:to="link.to"
|
|
22
|
+
:key="link.label"
|
|
23
|
+
@click="link.onClick?.()">
|
|
18
24
|
<MaterialIcon :icon="link.icon" />
|
|
19
25
|
<div class="tooltip">
|
|
20
26
|
{{ link.label }}
|
|
@@ -25,9 +31,12 @@
|
|
|
25
31
|
|
|
26
32
|
<div class="bot-buttons-wrapper">
|
|
27
33
|
<component
|
|
28
|
-
:is="link.to?'router-link':'div'"
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
:is="link.to ? 'router-link' : 'div'"
|
|
35
|
+
v-for="link in footerLinks"
|
|
36
|
+
class="nav-button"
|
|
37
|
+
:to="link.to"
|
|
38
|
+
@click="link.onClick?.()"
|
|
39
|
+
:key="link.label">
|
|
31
40
|
<MaterialIcon :icon="link.icon" />
|
|
32
41
|
<div class="tooltip">
|
|
33
42
|
{{ link.label }}
|
|
@@ -47,46 +56,46 @@ const isOpen = $ref(true);
|
|
|
47
56
|
|
|
48
57
|
withDefaults(
|
|
49
58
|
defineProps<{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
footerLinks?: NavLink[];
|
|
60
|
+
links?: NavLink[];
|
|
61
|
+
homeIcon?: MaterialIcons;
|
|
62
|
+
homeLabel?: string;
|
|
63
|
+
homeTo?: string;
|
|
64
|
+
}>(),
|
|
56
65
|
{
|
|
57
66
|
homeIcon: 'home',
|
|
58
67
|
homeLabel: 'Home',
|
|
59
68
|
homeTo: '/',
|
|
60
69
|
links: () => [],
|
|
61
70
|
footerLinks: () => [],
|
|
62
|
-
}
|
|
71
|
+
}
|
|
63
72
|
);
|
|
64
73
|
</script>
|
|
65
74
|
|
|
66
75
|
<style scoped>
|
|
67
|
-
[dir=
|
|
68
|
-
|
|
76
|
+
[dir='rtl'] .top-arrow {
|
|
77
|
+
transform: rotate(180deg);
|
|
69
78
|
}
|
|
70
79
|
|
|
71
80
|
.nav-expend {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
text-align: center;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
background: var(--bgl-white);
|
|
84
|
+
color: var(--bgl-primary);
|
|
85
|
+
display: flex;
|
|
86
|
+
border-radius: 100%;
|
|
87
|
+
font-size: 13px;
|
|
88
|
+
box-shadow: 0 0 50px 0 var(--bgl-shadow);
|
|
89
|
+
height: 22px;
|
|
90
|
+
width: 22px;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 82px;
|
|
95
|
+
box-sizing: border-box;
|
|
96
|
+
padding-inline-start: 2px;
|
|
97
|
+
margin-inline-start: 55px;
|
|
98
|
+
transition: all 0.4s cubic-bezier(0.36, 0.02, 0.23, 1);
|
|
90
99
|
}
|
|
91
100
|
|
|
92
101
|
/*
|
|
@@ -96,260 +105,260 @@ withDefaults(
|
|
|
96
105
|
*/
|
|
97
106
|
|
|
98
107
|
.nav-expend {
|
|
99
|
-
|
|
108
|
+
background: var(--bgl-white);
|
|
100
109
|
}
|
|
101
110
|
|
|
102
111
|
.nav-expend:hover {
|
|
103
|
-
|
|
104
|
-
|
|
112
|
+
filter: brightness(95%);
|
|
113
|
+
box-shadow: 0 0 20px 0 var(--bgl-primary-tint);
|
|
105
114
|
}
|
|
106
115
|
|
|
107
116
|
.nav-expend:active {
|
|
108
|
-
|
|
117
|
+
filter: var(--bgl-active-filter);
|
|
109
118
|
}
|
|
110
119
|
|
|
111
120
|
.nav {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
color: var(--bgl-white);
|
|
122
|
+
background: var(--bgl-primary);
|
|
123
|
+
z-index: 100;
|
|
124
|
+
width: 70px;
|
|
125
|
+
transition: all 0.4s cubic-bezier(0.36, 0.02, 0.23, 1);
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
119
128
|
}
|
|
120
129
|
|
|
121
130
|
.nav * {
|
|
122
|
-
|
|
131
|
+
user-select: none;
|
|
123
132
|
}
|
|
124
133
|
|
|
125
134
|
.nav-button {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
text-decoration: none;
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
display: flex;
|
|
138
|
+
text-align: start;
|
|
139
|
+
align-items: center;
|
|
140
|
+
position: relative;
|
|
141
|
+
color: var(--bgl-white);
|
|
142
|
+
transition: all 0.2s ease;
|
|
143
|
+
pointer-events: none;
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
.nav-button:hover {
|
|
138
|
-
|
|
139
|
-
|
|
147
|
+
width: fit-content;
|
|
148
|
+
pointer-events: all;
|
|
140
149
|
}
|
|
141
150
|
|
|
142
151
|
.nav-button .bgl_icon-font {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
font-size: 22px;
|
|
153
|
+
margin: 0.25rem 10px;
|
|
154
|
+
padding: 10px;
|
|
155
|
+
width: 50px;
|
|
156
|
+
text-align: center;
|
|
157
|
+
height: 45px;
|
|
158
|
+
flex-grow: 0;
|
|
159
|
+
flex-shrink: 0;
|
|
160
|
+
border-radius: 10px;
|
|
161
|
+
transition: all 0.2s ease;
|
|
162
|
+
pointer-events: all;
|
|
154
163
|
}
|
|
155
164
|
|
|
156
165
|
.nav-button:hover .bgl_icon-font,
|
|
157
166
|
.nav-button.router-link-active .bgl_icon-font {
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
background: var(--bgl-white);
|
|
168
|
+
color: var(--bgl-primary);
|
|
160
169
|
}
|
|
161
170
|
|
|
162
171
|
.nav-button:hover .tooltip {
|
|
163
|
-
|
|
164
|
-
|
|
172
|
+
opacity: 1;
|
|
173
|
+
pointer-events: all;
|
|
165
174
|
}
|
|
166
175
|
|
|
167
176
|
.tooltip {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
background-color: var(--bgl-white);
|
|
178
|
+
color: var(--bgl-primary);
|
|
179
|
+
line-height: 1;
|
|
180
|
+
padding: 0.5rem;
|
|
181
|
+
border-radius: 10px;
|
|
182
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
|
183
|
+
transition: all 0.2s ease;
|
|
184
|
+
border: 5px solid transparent;
|
|
185
|
+
white-space: nowrap;
|
|
186
|
+
pointer-events: none;
|
|
187
|
+
opacity: 0;
|
|
188
|
+
margin-inline-start: 1rem;
|
|
180
189
|
}
|
|
181
190
|
|
|
182
191
|
.tooltip:hover {
|
|
183
|
-
|
|
192
|
+
filter: brightness(95%);
|
|
184
193
|
}
|
|
185
194
|
|
|
186
195
|
.tooltip:active {
|
|
187
|
-
|
|
196
|
+
filter: brightness(90%);
|
|
188
197
|
}
|
|
189
198
|
|
|
190
199
|
.bot-buttons-wrapper {
|
|
191
|
-
|
|
192
|
-
|
|
200
|
+
margin-top: auto;
|
|
201
|
+
width: 100%;
|
|
193
202
|
}
|
|
194
203
|
|
|
195
204
|
.nav-links-wrapper {
|
|
196
|
-
|
|
205
|
+
direction: ltr;
|
|
197
206
|
}
|
|
198
207
|
|
|
199
|
-
[dir=
|
|
200
|
-
|
|
208
|
+
[dir='rtl'] .nav-links-wrapper {
|
|
209
|
+
direction: rtl;
|
|
201
210
|
}
|
|
202
211
|
|
|
203
212
|
.nav-scroll {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
213
|
+
overflow-y: scroll;
|
|
214
|
+
width: 50vw;
|
|
215
|
+
direction: rtl;
|
|
216
|
+
text-align: end;
|
|
217
|
+
margin-inline-end: -7px;
|
|
218
|
+
pointer-events: none;
|
|
219
|
+
display: flex;
|
|
220
|
+
flex-direction: column;
|
|
212
221
|
}
|
|
213
222
|
|
|
214
223
|
.nav::-webkit-scrollbar-thumb {
|
|
215
|
-
|
|
224
|
+
background-color: transparent;
|
|
216
225
|
}
|
|
217
226
|
|
|
218
227
|
.nav:hover::-webkit-scrollbar-thumb {
|
|
219
|
-
|
|
228
|
+
background-color: var(--bgl-gray);
|
|
220
229
|
}
|
|
221
230
|
|
|
222
|
-
[dir=
|
|
223
|
-
|
|
231
|
+
[dir='rtl'] .nav-scroll {
|
|
232
|
+
direction: ltr;
|
|
224
233
|
}
|
|
225
234
|
|
|
226
235
|
.full-nav {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
236
|
+
height: 100%;
|
|
237
|
+
display: flex;
|
|
238
|
+
flex-direction: column;
|
|
230
239
|
}
|
|
231
240
|
|
|
232
241
|
@media screen and (min-width: 910px) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
242
|
+
.nav.open .nav-expend {
|
|
243
|
+
margin-inline-start: 189px;
|
|
244
|
+
transform: rotate(180deg);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.nav.open {
|
|
248
|
+
width: 200px;
|
|
249
|
+
text-align: start;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.nav.open .tooltip {
|
|
253
|
+
background-color: transparent;
|
|
254
|
+
color: var(--bgl-white);
|
|
255
|
+
padding: 0;
|
|
256
|
+
box-shadow: none;
|
|
257
|
+
pointer-events: all;
|
|
258
|
+
opacity: 1;
|
|
259
|
+
margin-inline-start: 0rem;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.nav.open .nav-button .bgl_icon-font {
|
|
263
|
+
margin: 0;
|
|
264
|
+
background: transparent;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.nav.open .nav-button {
|
|
268
|
+
width: 180px;
|
|
269
|
+
border-radius: 10px;
|
|
270
|
+
margin-inline-start: 10px;
|
|
271
|
+
margin-top: 10px;
|
|
272
|
+
margin-bottom: 10px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.nav.open .nav-button:hover,
|
|
276
|
+
.nav.open .nav-button.router-link-active {
|
|
277
|
+
background: var(--bgl-white);
|
|
278
|
+
color: var(--bgl-primary);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.nav.open .nav-button:hover,
|
|
282
|
+
.nav.open .nav-button:hover .tooltip,
|
|
283
|
+
.nav.open .nav-button.router-link-active .tooltip {
|
|
284
|
+
color: var(--bgl-primary);
|
|
285
|
+
}
|
|
277
286
|
}
|
|
278
287
|
|
|
279
288
|
@media screen and (max-width: 910px) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
289
|
+
.full-nav {
|
|
290
|
+
height: auto;
|
|
291
|
+
display: flex;
|
|
292
|
+
flex-direction: row;
|
|
293
|
+
width: calc(100vw - 70px);
|
|
294
|
+
position: absolute;
|
|
295
|
+
inset-inline-end: 0;
|
|
296
|
+
overflow-x: auto;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.nav.open {
|
|
300
|
+
width: initial;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.nav {
|
|
304
|
+
width: auto;
|
|
305
|
+
display: flex;
|
|
306
|
+
flex-direction: row;
|
|
307
|
+
margin: 0;
|
|
308
|
+
overflow-x: auto;
|
|
309
|
+
justify-content: flex-start;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.tooltip {
|
|
313
|
+
opacity: 1;
|
|
314
|
+
background: transparent;
|
|
315
|
+
color: var(--bgl-white);
|
|
316
|
+
box-shadow: none;
|
|
317
|
+
font-size: 10px;
|
|
318
|
+
padding: 0;
|
|
319
|
+
margin: 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.nav-button {
|
|
323
|
+
flex-direction: column;
|
|
324
|
+
margin: 12px 0.25rem;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.nav-button .bgl_icon-font {
|
|
328
|
+
padding: 2px 0 0 0;
|
|
329
|
+
margin: 0;
|
|
330
|
+
height: 30px;
|
|
331
|
+
width: 30px;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.nav-links-wrapper {
|
|
335
|
+
display: flex;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.bot-buttons-wrapper {
|
|
339
|
+
margin-top: 0;
|
|
340
|
+
width: auto;
|
|
341
|
+
display: flex;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.nav-scroll {
|
|
345
|
+
overflow-y: visible;
|
|
346
|
+
width: auto;
|
|
347
|
+
direction: auto;
|
|
348
|
+
text-align: start;
|
|
349
|
+
margin-inline-end: 0px;
|
|
350
|
+
pointer-events: all;
|
|
351
|
+
display: flex;
|
|
352
|
+
flex-direction: row;
|
|
353
|
+
margin-inline-end: auto;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.nav::-webkit-scrollbar {
|
|
357
|
+
display: none;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.nav-expend {
|
|
361
|
+
display: none;
|
|
362
|
+
}
|
|
354
363
|
}
|
|
355
364
|
</style>
|
|
@@ -21,13 +21,16 @@
|
|
|
21
21
|
</thead>
|
|
22
22
|
<tbody ref="infinite" class="rows infinite" :class="{ loading }">
|
|
23
23
|
<tr
|
|
24
|
-
v-for="row in
|
|
24
|
+
v-for="row in computedData"
|
|
25
25
|
:key="row.id"
|
|
26
26
|
@click="selectElement(row)"
|
|
27
27
|
class="row row-item position-relative">
|
|
28
28
|
<td
|
|
29
29
|
class="col"
|
|
30
|
-
v-for="field in computedSchema
|
|
30
|
+
v-for="field in computedSchema.map((c) => ({
|
|
31
|
+
...c,
|
|
32
|
+
transform: undefined,
|
|
33
|
+
}))"
|
|
31
34
|
:key="`${field.id}-${row.id}`">
|
|
32
35
|
<slot
|
|
33
36
|
v-if="field.id && slots[field.id]"
|
|
@@ -74,9 +77,9 @@ const computedSchema = $computed(() => {
|
|
|
74
77
|
|
|
75
78
|
const emit = defineEmits(['select', 'orderBy']);
|
|
76
79
|
|
|
77
|
-
const selectElement = (
|
|
80
|
+
const selectElement = (item: Record<string, any>) => emit('select', item);
|
|
78
81
|
|
|
79
|
-
let sortDirection = $ref('');
|
|
82
|
+
let sortDirection = $ref('ASC');
|
|
80
83
|
let sortField = $ref('');
|
|
81
84
|
|
|
82
85
|
const sort = (fieldname: string) => {
|
|
@@ -89,6 +92,33 @@ const sort = (fieldname: string) => {
|
|
|
89
92
|
}
|
|
90
93
|
emit('orderBy', `${fieldname} ${sortDirection}`.trim());
|
|
91
94
|
};
|
|
95
|
+
|
|
96
|
+
const transform = (rowData: any) => {
|
|
97
|
+
const obj: Record<string, any> = { ...rowData };
|
|
98
|
+
for (const field of computedSchema.filter((f) => f.id)) {
|
|
99
|
+
const fieldData = rowData[field.id as string];
|
|
100
|
+
obj[field.id as string] =
|
|
101
|
+
field.transform?.(fieldData, rowData) || fieldData || '';
|
|
102
|
+
}
|
|
103
|
+
return obj;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const computedData = $computed(() => {
|
|
107
|
+
const dta = [...props.data].map(transform);
|
|
108
|
+
if (sortField) {
|
|
109
|
+
return dta.sort((a, b) => {
|
|
110
|
+
const aValue = a[sortField];
|
|
111
|
+
const bValue = b[sortField];
|
|
112
|
+
if (typeof aValue === 'string') {
|
|
113
|
+
if (sortDirection === 'ASC') return aValue.localeCompare(bValue);
|
|
114
|
+
return bValue.localeCompare(aValue);
|
|
115
|
+
}
|
|
116
|
+
if (sortDirection === 'ASC') return aValue < bValue ? -1 : 1;
|
|
117
|
+
return aValue < bValue ? 1 : -1;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return dta;
|
|
121
|
+
});
|
|
92
122
|
</script>
|
|
93
123
|
|
|
94
124
|
<style scoped>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
25
|
<script lang="ts" setup>
|
|
26
|
-
import { useSlots } from 'vue';
|
|
26
|
+
import { useSlots, watch } from 'vue';
|
|
27
27
|
import { useModal, BglField, Title } from '@bagelink/vue';
|
|
28
28
|
|
|
29
29
|
import { type BglFormSchemaT } from '@bagelink/vue';
|
|
@@ -61,7 +61,7 @@ let data = $computed({
|
|
|
61
61
|
formData = val;
|
|
62
62
|
emit('update:modelValue', val);
|
|
63
63
|
},
|
|
64
|
-
get: () => formData,
|
|
64
|
+
get: () => props.modelValue || formData,
|
|
65
65
|
});
|
|
66
66
|
const form = $ref<HTMLFormElement>();
|
|
67
67
|
|
|
@@ -71,12 +71,22 @@ const clearForm = () => (data = {});
|
|
|
71
71
|
|
|
72
72
|
type FormStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
73
73
|
|
|
74
|
+
watch(
|
|
75
|
+
() => props.status,
|
|
76
|
+
(status) => {
|
|
77
|
+
if (status === 'success') {
|
|
78
|
+
isDirty = false;
|
|
79
|
+
clearForm();
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{ immediate: true }
|
|
83
|
+
);
|
|
84
|
+
|
|
74
85
|
const runSubmit = () => {
|
|
75
86
|
const isValid = validateForm();
|
|
76
87
|
if (!isValid) return;
|
|
77
88
|
// props.onSubmit?.(data);
|
|
78
89
|
emit('submit', data);
|
|
79
|
-
clearForm();
|
|
80
90
|
};
|
|
81
91
|
|
|
82
92
|
const i18nT = (val: string) => val;
|