@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.
Files changed (79) hide show
  1. package/dist/components/Accordion.vue.d.ts +1 -1
  2. package/dist/components/AccordionItem.vue.d.ts +2 -2
  3. package/dist/components/Alert.vue.d.ts +2 -2
  4. package/dist/components/Avatar.vue.d.ts +2 -2
  5. package/dist/components/Avatar.vue.d.ts.map +1 -1
  6. package/dist/components/Badge.vue.d.ts +3 -2
  7. package/dist/components/BglVideo.vue.d.ts +1 -1
  8. package/dist/components/Btn.vue.d.ts +4 -3
  9. package/dist/components/Card.vue.d.ts +2 -2
  10. package/dist/components/Carousel.vue.d.ts +3 -3
  11. package/dist/components/DataPreview.vue.d.ts +10 -9
  12. package/dist/components/ListItem.vue.d.ts +2 -2
  13. package/dist/components/ListView.vue.d.ts +1 -1
  14. package/dist/components/ListView.vue.d.ts.map +1 -1
  15. package/dist/components/MaterialIcon.vue.d.ts +4 -3
  16. package/dist/components/Modal.vue.d.ts +5 -5
  17. package/dist/components/ModalConfirm.vue.d.ts +3 -3
  18. package/dist/components/ModalConfirm.vue.d.ts.map +1 -1
  19. package/dist/components/ModalForm.vue.d.ts +27 -26
  20. package/dist/components/NavBar.vue.d.ts +4 -3
  21. package/dist/components/NavBar.vue.d.ts.map +1 -1
  22. package/dist/components/PageTitle.vue.d.ts +2 -2
  23. package/dist/components/RouterWrapper.vue.d.ts +1 -1
  24. package/dist/components/TableSchema.vue.d.ts +383 -6
  25. package/dist/components/TableSchema.vue.d.ts.map +1 -1
  26. package/dist/components/Title.vue.d.ts +2 -2
  27. package/dist/components/TopBar.vue.d.ts +1 -1
  28. package/dist/components/dashboard/Lineart.vue.d.ts +4 -3
  29. package/dist/components/form/BglField.vue.d.ts +5 -4
  30. package/dist/components/form/BglForm.vue.d.ts +6 -5
  31. package/dist/components/form/BglForm.vue.d.ts.map +1 -1
  32. package/dist/components/form/inputs/CheckInput.vue.d.ts +14 -14
  33. package/dist/components/form/inputs/Checkbox.vue.d.ts +4 -4
  34. package/dist/components/form/inputs/ColorPicker.vue.d.ts +3 -3
  35. package/dist/components/form/inputs/DateInput.vue.d.ts +5 -5
  36. package/dist/components/form/inputs/DatePicker.vue.d.ts +10 -3
  37. package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
  38. package/dist/components/form/inputs/FileUpload.vue.d.ts +16 -15
  39. package/dist/components/form/inputs/JSONInput.vue.d.ts +3 -3
  40. package/dist/components/form/inputs/RadioPillsInput.vue.d.ts +24 -4
  41. package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -1
  42. package/dist/components/form/inputs/RichText.vue.d.ts +3 -3
  43. package/dist/components/form/inputs/SelectInput.vue.d.ts +4 -3
  44. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  45. package/dist/components/form/inputs/TableField.vue.d.ts +3 -3
  46. package/dist/components/form/inputs/TextInput.vue.d.ts +5 -4
  47. package/dist/components/form/inputs/ToggleInput.vue.d.ts +12 -12
  48. package/dist/components/layout/BottomMenu.vue.d.ts +4 -3
  49. package/dist/components/layout/Layout.vue.d.ts +2 -2
  50. package/dist/components/layout/SidebarMenu.vue.d.ts +5 -4
  51. package/dist/components/layout/TabbedLayout.vue.d.ts +5 -4
  52. package/dist/components/layout/Tabs.vue.d.ts +4 -3
  53. package/dist/components/layout/TabsBody.vue.d.ts +2 -2
  54. package/dist/components/layout/TabsNav.vue.d.ts +4 -3
  55. package/dist/components/layout/tabsManager.d.ts +1 -1
  56. package/dist/index.cjs +6527 -4442
  57. package/dist/index.d.ts +0 -1
  58. package/dist/index.mjs +6527 -4442
  59. package/dist/plugins/bagel.d.ts +2 -1
  60. package/dist/plugins/modal.d.ts +3 -3
  61. package/dist/style.css +267 -265
  62. package/dist/types/BagelForm.d.ts +1 -0
  63. package/dist/types/BtnOptions.d.ts +2 -1
  64. package/dist/types/NavLink.d.ts +1 -0
  65. package/dist/types/index.d.ts +1 -1
  66. package/dist/utils/BagelFormUtils.d.ts +2 -1
  67. package/dist/utils/clickOutside.d.ts +2 -1
  68. package/dist/utils/index.d.ts +2 -1
  69. package/dist/utils/index.d.ts.map +1 -1
  70. package/package.json +1 -1
  71. package/src/components/Avatar.vue +2 -1
  72. package/src/components/ListView.vue +24 -28
  73. package/src/components/NavBar.vue +235 -226
  74. package/src/components/TableSchema.vue +34 -4
  75. package/src/components/form/BglForm.vue +13 -3
  76. package/src/components/form/inputs/CheckInput.vue +1 -0
  77. package/src/components/form/inputs/DatePicker.vue +13 -2
  78. package/src/components/form/inputs/RadioPillsInput.vue +15 -8
  79. 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" @click="isOpen = !isOpen" @keypress.enter="isOpen = !isOpen" role="button"
6
- aria-label="Toggle Navigation" tabindex="0"
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'" v-for="link in links" class="nav-button" :to="link.to"
16
- :key="link.label" @click="link.onClick?.()"
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'" v-for="link in footerLinks" class="nav-button" :to="link.to"
29
- @click="link.onClick?.()" :key="link.label"
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
- footerLinks?: NavLink[];
51
- links?: NavLink[];
52
- homeIcon?: MaterialIcons;
53
- homeLabel?: string;
54
- homeTo?: string;
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="rtl"] .top-arrow {
68
- transform: rotate(180deg);
76
+ [dir='rtl'] .top-arrow {
77
+ transform: rotate(180deg);
69
78
  }
70
79
 
71
80
  .nav-expend {
72
- text-align: center;
73
- cursor: pointer;
74
- background: var(--bgl-white);
75
- color: var(--bgl-primary);
76
- display: flex;
77
- border-radius: 100%;
78
- font-size: 13px;
79
- box-shadow: 0 0 50px 0 var(--bgl-shadow);
80
- height: 22px;
81
- width: 22px;
82
- align-items: center;
83
- justify-content: center;
84
- position: absolute;
85
- top: 82px;
86
- box-sizing: border-box;
87
- padding-inline-start: 2px;
88
- margin-inline-start: 55px;
89
- transition: all 0.4s cubic-bezier(0.36, 0.02, 0.23, 1);
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
- background: var(--bgl-white);
108
+ background: var(--bgl-white);
100
109
  }
101
110
 
102
111
  .nav-expend:hover {
103
- filter: brightness(95%);
104
- box-shadow: 0 0 20px 0 var(--bgl-primary-tint);
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
- filter: var(--bgl-active-filter);
117
+ filter: var(--bgl-active-filter);
109
118
  }
110
119
 
111
120
  .nav {
112
- color: var(--bgl-white);
113
- background: var(--bgl-primary);
114
- z-index: 100;
115
- width: 70px;
116
- transition: all 0.4s cubic-bezier(0.36, 0.02, 0.23, 1);
117
- display: flex;
118
- flex-direction: column;
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
- user-select: none;
131
+ user-select: none;
123
132
  }
124
133
 
125
134
  .nav-button {
126
- text-decoration: none;
127
- cursor: pointer;
128
- display: flex;
129
- text-align: start;
130
- align-items: center;
131
- position: relative;
132
- color: var(--bgl-white);
133
- transition: all 0.2s ease;
134
- pointer-events: none;
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
- width: fit-content;
139
- pointer-events: all;
147
+ width: fit-content;
148
+ pointer-events: all;
140
149
  }
141
150
 
142
151
  .nav-button .bgl_icon-font {
143
- font-size: 22px;
144
- margin: 0.25rem 10px;
145
- padding: 10px;
146
- width: 50px;
147
- text-align: center;
148
- height: 45px;
149
- flex-grow: 0;
150
- flex-shrink: 0;
151
- border-radius: 10px;
152
- transition: all 0.2s ease;
153
- pointer-events: all;
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
- background: var(--bgl-white);
159
- color: var(--bgl-primary);
167
+ background: var(--bgl-white);
168
+ color: var(--bgl-primary);
160
169
  }
161
170
 
162
171
  .nav-button:hover .tooltip {
163
- opacity: 1;
164
- pointer-events: all;
172
+ opacity: 1;
173
+ pointer-events: all;
165
174
  }
166
175
 
167
176
  .tooltip {
168
- background-color: var(--bgl-white);
169
- color: var(--bgl-primary);
170
- line-height: 1;
171
- padding: 0.5rem;
172
- border-radius: 10px;
173
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
174
- transition: all 0.2s ease;
175
- border: 5px solid transparent;
176
- white-space: nowrap;
177
- pointer-events: none;
178
- opacity: 0;
179
- margin-inline-start: 1rem;
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
- filter: brightness(95%);
192
+ filter: brightness(95%);
184
193
  }
185
194
 
186
195
  .tooltip:active {
187
- filter: brightness(90%);
196
+ filter: brightness(90%);
188
197
  }
189
198
 
190
199
  .bot-buttons-wrapper {
191
- margin-top: auto;
192
- width: 100%;
200
+ margin-top: auto;
201
+ width: 100%;
193
202
  }
194
203
 
195
204
  .nav-links-wrapper {
196
- direction: ltr;
205
+ direction: ltr;
197
206
  }
198
207
 
199
- [dir="rtl"] .nav-links-wrapper {
200
- direction: rtl;
208
+ [dir='rtl'] .nav-links-wrapper {
209
+ direction: rtl;
201
210
  }
202
211
 
203
212
  .nav-scroll {
204
- overflow-y: scroll;
205
- width: 50vw;
206
- direction: rtl;
207
- text-align: end;
208
- margin-inline-end: -7px;
209
- pointer-events: none;
210
- display: flex;
211
- flex-direction: column;
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
- background-color: transparent;
224
+ background-color: transparent;
216
225
  }
217
226
 
218
227
  .nav:hover::-webkit-scrollbar-thumb {
219
- background-color: var(--bgl-gray);
228
+ background-color: var(--bgl-gray);
220
229
  }
221
230
 
222
- [dir="rtl"] .nav-scroll {
223
- direction: ltr;
231
+ [dir='rtl'] .nav-scroll {
232
+ direction: ltr;
224
233
  }
225
234
 
226
235
  .full-nav {
227
- height: 100%;
228
- display: flex;
229
- flex-direction: column;
236
+ height: 100%;
237
+ display: flex;
238
+ flex-direction: column;
230
239
  }
231
240
 
232
241
  @media screen and (min-width: 910px) {
233
- .nav.open .nav-expend {
234
- margin-inline-start: 189px;
235
- transform: rotate(180deg);
236
- }
237
-
238
- .nav.open {
239
- width: 200px;
240
- text-align: start;
241
- }
242
-
243
- .nav.open .tooltip {
244
- background-color: transparent;
245
- color: var(--bgl-white);
246
- padding: 0;
247
- box-shadow: none;
248
- pointer-events: all;
249
- opacity: 1;
250
- margin-inline-start: 0rem;
251
- }
252
-
253
- .nav.open .nav-button .bgl_icon-font {
254
- margin: 0;
255
- background: transparent;
256
- }
257
-
258
- .nav.open .nav-button {
259
- width: 180px;
260
- border-radius: 10px;
261
- margin-inline-start: 10px;
262
- margin-top: 10px;
263
- margin-bottom: 10px;
264
- }
265
-
266
- .nav.open .nav-button:hover,
267
- .nav.open .nav-button.router-link-active {
268
- background: var(--bgl-white);
269
- color: var(--bgl-primary);
270
- }
271
-
272
- .nav.open .nav-button:hover,
273
- .nav.open .nav-button:hover .tooltip,
274
- .nav.open .nav-button.router-link-active .tooltip {
275
- color: var(--bgl-primary);
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
- .full-nav {
281
- height: auto;
282
- display: flex;
283
- flex-direction: row;
284
- width: calc(100vw - 70px);
285
- position: absolute;
286
- inset-inline-end: 0;
287
- overflow-x: auto;
288
- }
289
-
290
- .nav.open {
291
- width: initial;
292
- }
293
-
294
- .nav {
295
- width: auto;
296
- display: flex;
297
- flex-direction: row;
298
- margin: 0;
299
- overflow-x: auto;
300
- justify-content: flex-start;
301
- }
302
-
303
- .tooltip {
304
- opacity: 1;
305
- background: transparent;
306
- color: var(--bgl-white);
307
- box-shadow: none;
308
- font-size: 10px;
309
- padding: 0;
310
- margin: 0;
311
- }
312
-
313
- .nav-button {
314
- flex-direction: column;
315
- margin: 12px 0.25rem;
316
- }
317
-
318
- .nav-button .bgl_icon-font {
319
- padding: 2px 0 0 0;
320
- margin: 0;
321
- height: 30px;
322
- width: 30px;
323
- }
324
-
325
- .nav-links-wrapper {
326
- display: flex;
327
- }
328
-
329
- .bot-buttons-wrapper {
330
- margin-top: 0;
331
- width: auto;
332
- display: flex;
333
- }
334
-
335
- .nav-scroll {
336
- overflow-y: visible;
337
- width: auto;
338
- direction: auto;
339
- text-align: start;
340
- margin-inline-end: 0px;
341
- pointer-events: all;
342
- display: flex;
343
- flex-direction: row;
344
- margin-inline-end: auto;
345
- }
346
-
347
- .nav::-webkit-scrollbar {
348
- display: none;
349
- }
350
-
351
- .nav-expend {
352
- display: none;
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 data"
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 = (data: Record<string, any>) => emit('select', data);
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;
@@ -54,6 +54,7 @@ const checked = defineModel<boolean>('modelValue', { default: false });
54
54
  transition: var(--bgl-transition);
55
55
  cursor: pointer;
56
56
  user-select: none;
57
+ font-size: var(--input-font-size);
57
58
  }
58
59
 
59
60
  .bgl-checkbox:hover {