@bagelink/vue 1.0.54 → 1.0.57

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 (52) hide show
  1. package/dist/components/MapEmbed/Index.vue.d.ts +30 -0
  2. package/dist/components/MapEmbed/Index.vue.d.ts.map +1 -0
  3. package/dist/components/dashboard/Lineart.vue.d.ts.map +1 -1
  4. package/dist/components/dashboard/index.d.ts.map +1 -1
  5. package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
  6. package/dist/components/index.d.ts +3 -3
  7. package/dist/components/index.d.ts.map +1 -1
  8. package/dist/components/layout/BottomMenu.vue.d.ts.map +1 -1
  9. package/dist/components/layout/Layout.vue.d.ts.map +1 -1
  10. package/dist/components/layout/SidebarMenu.vue.d.ts.map +1 -1
  11. package/dist/components/layout/Skeleton.vue.d.ts.map +1 -1
  12. package/dist/components/layout/TabbedLayout.vue.d.ts.map +1 -1
  13. package/dist/components/layout/Tabs.vue.d.ts.map +1 -1
  14. package/dist/components/layout/TabsBody.vue.d.ts.map +1 -1
  15. package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
  16. package/dist/components/layout/index.d.ts.map +1 -1
  17. package/dist/components/layout/tabsManager.d.ts.map +1 -1
  18. package/dist/components/lightbox/Lightbox.vue.d.ts.map +1 -1
  19. package/dist/components/lightbox/index.d.ts.map +1 -1
  20. package/dist/components/lightbox/lightbox.types.d.ts.map +1 -1
  21. package/dist/index.cjs +63 -34
  22. package/dist/index.mjs +63 -34
  23. package/dist/plugins/bagel.d.ts.map +1 -1
  24. package/dist/style.css +93 -93
  25. package/dist/utils/BagelFormUtils.d.ts +6 -1
  26. package/dist/utils/BagelFormUtils.d.ts.map +1 -1
  27. package/dist/utils/timeAgo.d.ts.map +1 -1
  28. package/package.json +1 -1
  29. package/src/components/{MapEmbed.vue → MapEmbed/Index.vue} +1 -1
  30. package/src/components/form/inputs/DateInput.vue +47 -7
  31. package/src/components/form/inputs/NumberInput.vue +1 -1
  32. package/src/components/index.ts +3 -3
  33. package/src/plugins/bagel.ts +1 -2
  34. package/src/utils/BagelFormUtils.ts +10 -1
  35. package/src/utils/timeAgo.ts +9 -17
  36. package/tsconfig.json +2 -1
  37. /package/src/components/{dashboard → Dashboard}/Lineart.vue +0 -0
  38. /package/src/components/{dashboard → Dashboard}/index.ts +0 -0
  39. /package/src/components/{layout → Layout}/BottomMenu.vue +0 -0
  40. /package/src/components/{layout → Layout}/Layout.vue +0 -0
  41. /package/src/components/{layout → Layout}/SidebarMenu.vue +0 -0
  42. /package/src/components/{layout → Layout}/Skeleton.vue +0 -0
  43. /package/src/components/{layout → Layout}/TabbedLayout.vue +0 -0
  44. /package/src/components/{layout → Layout}/Tabs.vue +0 -0
  45. /package/src/components/{layout → Layout}/TabsBody.vue +0 -0
  46. /package/src/components/{layout → Layout}/TabsNav.vue +0 -0
  47. /package/src/components/{layout → Layout}/index.ts +0 -0
  48. /package/src/components/{layout → Layout}/tabsManager.ts +0 -0
  49. /package/src/components/{lightbox → Lightbox}/Lightbox.vue +0 -0
  50. /package/src/components/{lightbox → Lightbox}/index.ts +0 -0
  51. /package/src/components/{lightbox → Lightbox}/lightbox.types.ts +0 -0
  52. /package/src/components/{leaflet → MapEmbed}/leaflet.css +0 -0
@@ -12,7 +12,12 @@ interface InputOptions {
12
12
  vIf?: boolean | ((item: any, row: any) => boolean)
13
13
  }
14
14
 
15
- type DateOptions = InputOptions
15
+ interface DateOptions extends InputOptions {
16
+ enableTime?: boolean
17
+ mode?: 'day' | 'month' | 'year'
18
+ locale?: string
19
+ timezone?: string
20
+ }
16
21
 
17
22
  interface TextInputOptions extends InputOptions {
18
23
  type?: 'text' | 'tel' | 'email'
@@ -151,6 +156,10 @@ export function dateField<T extends { [key: string]: any }>(
151
156
  attrs: {
152
157
  disabled: options?.disabled,
153
158
  autocomplete: options?.autocomplete,
159
+ enableTime: options?.enableTime,
160
+ mode: options?.mode,
161
+ locale: options?.locale,
162
+ timezone: options?.timezone,
154
163
  },
155
164
  }
156
165
  }
@@ -138,12 +138,6 @@ export function formatDate(date?: string | Date, format: string = 'dd.mm.yy', lo
138
138
  return ''
139
139
  }
140
140
 
141
- // Extract the separator from the format string
142
- const separator = format.match(/[^\w\s]/)?.[0] || '.'
143
-
144
- // Split by any non-alphanumeric character (except spaces)
145
- const formatParts = format.split(/[^\w\s]/)
146
-
147
141
  // Create a map of all date parts
148
142
  const datePartsMap: Record<string, string> = {
149
143
  dd: String(d.getDate()).padStart(2, '0'),
@@ -195,18 +189,16 @@ export function formatDate(date?: string | Date, format: string = 'dd.mm.yy', lo
195
189
  datePartsMap.ampm = partsMap.dayPeriod
196
190
  }
197
191
 
198
- // Build the formatted date string following the exact format pattern
199
- let formattedDate = ''
200
- for (let i = 0; i < formatParts.length; i++) {
201
- const part = formatParts[i]
202
- if (datePartsMap[part]) {
203
- formattedDate += datePartsMap[part]
204
- }
192
+ // Process the format string by replacing each token with its value
193
+ let formattedDate = format
205
194
 
206
- // Add separator between parts (except after the last part)
207
- if (i < formatParts.length - 1) {
208
- formattedDate += separator
209
- }
195
+ // Sort tokens by length (longest first) to avoid partial replacements
196
+ const tokens = Object.keys(datePartsMap).sort((a, b) => b.length - a.length)
197
+
198
+ // Replace each token with its value
199
+ for (const token of tokens) {
200
+ const regex = new RegExp(token, 'g')
201
+ formattedDate = formattedDate.replace(regex, datePartsMap[token])
210
202
  }
211
203
 
212
204
  return formattedDate
package/tsconfig.json CHANGED
@@ -21,6 +21,7 @@
21
21
  "declarationMap": true,
22
22
  "useDefineForClassFields": true,
23
23
  "allowSyntheticDefaultImports": true,
24
+ "forceConsistentCasingInFileNames": true,
24
25
  "lib": [
25
26
  "ESNext",
26
27
  "DOM"
@@ -49,4 +50,4 @@
49
50
  "./vite.config.ts",
50
51
  "src/directives/pattern"
51
52
  ]
52
- }
53
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes