@bagelink/vue 1.0.24 → 1.0.26

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 (245) hide show
  1. package/dist/components/Accordion.d.ts +12 -0
  2. package/dist/components/Accordion.d.ts.map +1 -0
  3. package/dist/components/AccordionItem.d.ts +34 -0
  4. package/dist/components/AccordionItem.d.ts.map +1 -0
  5. package/dist/components/Alert.d.ts +34 -0
  6. package/dist/components/Alert.d.ts.map +1 -0
  7. package/dist/components/Avatar.d.ts +36 -0
  8. package/dist/components/Avatar.d.ts.map +1 -0
  9. package/dist/components/Badge.d.ts +22 -0
  10. package/dist/components/Badge.d.ts.map +1 -0
  11. package/dist/components/BglVideo.d.ts +20 -0
  12. package/dist/components/BglVideo.d.ts.map +1 -0
  13. package/dist/components/Btn.d.ts +99 -0
  14. package/dist/components/Btn.d.ts.map +1 -0
  15. package/dist/components/Card.d.ts +39 -0
  16. package/dist/components/Card.d.ts.map +1 -0
  17. package/dist/components/Carousel.d.ts +74 -0
  18. package/dist/components/Carousel.d.ts.map +1 -0
  19. package/dist/components/ComboBox.vue.d.ts +3 -3
  20. package/dist/components/Comments.vue.d.ts +2 -2
  21. package/dist/components/ContactSubmissions.vue.d.ts +2 -2
  22. package/dist/components/DataPreview.d.ts +42 -0
  23. package/dist/components/DataPreview.d.ts.map +1 -0
  24. package/dist/components/Drop.vue.d.ts +34 -0
  25. package/dist/components/Drop.vue.d.ts.map +1 -0
  26. package/dist/components/FileUploader.vue.d.ts +60 -0
  27. package/dist/components/FileUploader.vue.d.ts.map +1 -0
  28. package/dist/components/Flag.d.ts +20 -0
  29. package/dist/components/Flag.d.ts.map +1 -0
  30. package/dist/components/FormSchema.vue.d.ts +5 -4
  31. package/dist/components/Icon/Icon.vue.d.ts.map +1 -1
  32. package/dist/components/LangText.vue.d.ts +2 -2
  33. package/dist/components/ListItem.d.ts +34 -0
  34. package/dist/components/ListItem.d.ts.map +1 -0
  35. package/dist/components/ListView.d.ts +13 -0
  36. package/dist/components/ListView.d.ts.map +1 -0
  37. package/dist/components/MapEmbed.d.ts +3 -0
  38. package/dist/components/MapEmbed.d.ts.map +1 -0
  39. package/dist/components/MaterialIcon.d.ts +26 -0
  40. package/dist/components/MaterialIcon.d.ts.map +1 -0
  41. package/dist/components/Modal.d.ts +46 -0
  42. package/dist/components/Modal.d.ts.map +1 -0
  43. package/dist/components/ModalBglForm.vue.d.ts +21 -20
  44. package/dist/components/ModalConfirm.d.ts +24 -0
  45. package/dist/components/ModalConfirm.d.ts.map +1 -0
  46. package/dist/components/ModalForm.d.ts +78 -0
  47. package/dist/components/ModalForm.d.ts.map +1 -0
  48. package/dist/components/NavBar.d.ts +64 -0
  49. package/dist/components/NavBar.d.ts.map +1 -0
  50. package/dist/components/PageTitle.d.ts +24 -0
  51. package/dist/components/PageTitle.d.ts.map +1 -0
  52. package/dist/components/PersonPreview.vue.d.ts +5 -4
  53. package/dist/components/PersonPreviewFormkit.vue.d.ts +4 -3
  54. package/dist/components/RTXEditor.vue.d.ts +3 -3
  55. package/dist/components/RouterWrapper.d.ts +3 -0
  56. package/dist/components/RouterWrapper.d.ts.map +1 -0
  57. package/dist/components/Spreadsheet/Index.vue.d.ts.map +1 -1
  58. package/dist/components/TabbedLayout.vue.d.ts +5 -4
  59. package/dist/components/TableSchema.d.ts +35 -0
  60. package/dist/components/TableSchema.d.ts.map +1 -0
  61. package/dist/components/TableSchema.vue.d.ts +2 -2
  62. package/dist/components/TableSchema.vue.d.ts.map +1 -1
  63. package/dist/components/Title.d.ts +42 -0
  64. package/dist/components/Title.d.ts.map +1 -0
  65. package/dist/components/TopBar.d.ts +12 -0
  66. package/dist/components/TopBar.d.ts.map +1 -0
  67. package/dist/components/charts/BarChart.vue.d.ts +2 -2
  68. package/dist/components/dashboard/Lineart.d.ts +20 -0
  69. package/dist/components/dashboard/Lineart.d.ts.map +1 -0
  70. package/dist/components/dialog/index.d.ts.map +1 -1
  71. package/dist/components/form/BglField.d.ts +25 -0
  72. package/dist/components/form/BglField.d.ts.map +1 -0
  73. package/dist/components/form/BglForm.d.ts +75 -0
  74. package/dist/components/form/BglForm.d.ts.map +1 -0
  75. package/dist/components/form/ItemRef.vue.d.ts +5 -3
  76. package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
  77. package/dist/components/form/MaterialIcon.vue.d.ts +4 -3
  78. package/dist/components/form/PlainInputField.vue.d.ts +3 -3
  79. package/dist/components/form/inputs/CheckInput.d.ts +56 -0
  80. package/dist/components/form/inputs/CheckInput.d.ts.map +1 -0
  81. package/dist/components/form/inputs/CheckInput.vue.d.ts +22 -30
  82. package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
  83. package/dist/components/form/inputs/Checkbox.d.ts +16 -0
  84. package/dist/components/form/inputs/Checkbox.d.ts.map +1 -0
  85. package/dist/components/form/inputs/ColorInput.vue.d.ts.map +1 -1
  86. package/dist/components/form/inputs/ColorPicker.d.ts +48 -0
  87. package/dist/components/form/inputs/ColorPicker.d.ts.map +1 -0
  88. package/dist/components/form/inputs/CurrencyInput.vue.d.ts +3 -3
  89. package/dist/components/form/inputs/DateInput.d.ts +64 -0
  90. package/dist/components/form/inputs/DateInput.d.ts.map +1 -0
  91. package/dist/components/form/inputs/DateInput.vue.d.ts +1 -0
  92. package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
  93. package/dist/components/form/inputs/DatePick.vue.d.ts.map +1 -1
  94. package/dist/components/form/inputs/DatePicker.d.ts +33 -0
  95. package/dist/components/form/inputs/DatePicker.d.ts.map +1 -0
  96. package/dist/components/form/inputs/DatetimeInput.vue.d.ts +3 -3
  97. package/dist/components/form/inputs/DurationInput.vue.d.ts +3 -3
  98. package/dist/components/form/inputs/DynamicLinkField.vue.d.ts +3 -3
  99. package/dist/components/form/inputs/EmailInput.vue.d.ts +3 -3
  100. package/dist/components/form/inputs/FileUpload.d.ts +108 -0
  101. package/dist/components/form/inputs/FileUpload.d.ts.map +1 -0
  102. package/dist/components/form/inputs/FloatInput.vue.d.ts +3 -3
  103. package/dist/components/form/inputs/IntInput.vue.d.ts +3 -3
  104. package/dist/components/form/inputs/JSONInput.d.ts +53 -0
  105. package/dist/components/form/inputs/JSONInput.d.ts.map +1 -0
  106. package/dist/components/form/inputs/LinkField.vue.d.ts +3 -3
  107. package/dist/components/form/inputs/NumberInput.vue.d.ts +1 -1
  108. package/dist/components/form/inputs/NumberInput.vue.d.ts.map +1 -1
  109. package/dist/components/form/inputs/Password.vue.d.ts +3 -3
  110. package/dist/components/form/inputs/PasswordInput.vue.d.ts.map +1 -1
  111. package/dist/components/form/inputs/PlainText.vue.d.ts +3 -3
  112. package/dist/components/form/inputs/RadioGroup.d.ts +42 -0
  113. package/dist/components/form/inputs/RadioGroup.d.ts.map +1 -0
  114. package/dist/components/form/inputs/RadioPillsInput.d.ts +48 -0
  115. package/dist/components/form/inputs/RadioPillsInput.d.ts.map +1 -0
  116. package/dist/components/form/inputs/ReadOnlyInput.vue.d.ts +2 -2
  117. package/dist/components/form/inputs/RichText.d.ts +20 -0
  118. package/dist/components/form/inputs/RichText.d.ts.map +1 -0
  119. package/dist/components/form/inputs/RichText2/Toolbar.d.ts +22 -0
  120. package/dist/components/form/inputs/RichText2/Toolbar.d.ts.map +1 -0
  121. package/dist/components/form/inputs/RichText2/Toolbar.vue.d.ts.map +1 -1
  122. package/dist/components/form/inputs/RichText2/index.d.ts +24 -0
  123. package/dist/components/form/inputs/RichText2/index.d.ts.map +1 -0
  124. package/dist/components/form/inputs/RichText2/index.vue.d.ts +1 -0
  125. package/dist/components/form/inputs/RichText2/index.vue.d.ts.map +1 -1
  126. package/dist/components/form/inputs/RichTextEditor.vue.d.ts +3 -3
  127. package/dist/components/form/inputs/SelectField.vue.d.ts +6 -8
  128. package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
  129. package/dist/components/form/inputs/SelectInput.d.ts +55 -0
  130. package/dist/components/form/inputs/SelectInput.d.ts.map +1 -0
  131. package/dist/components/form/inputs/SignaturePad.d.ts +72 -0
  132. package/dist/components/form/inputs/SignaturePad.d.ts.map +1 -0
  133. package/dist/components/form/inputs/TableField.d.ts +45 -0
  134. package/dist/components/form/inputs/TableField.d.ts.map +1 -0
  135. package/dist/components/form/inputs/TelInput.d.ts +241 -0
  136. package/dist/components/form/inputs/TelInput.d.ts.map +1 -0
  137. package/dist/components/form/inputs/TelInput.vue.d.ts.map +1 -1
  138. package/dist/components/form/inputs/TextArea.vue.d.ts +3 -3
  139. package/dist/components/form/inputs/TextInput.d.ts +90 -0
  140. package/dist/components/form/inputs/TextInput.d.ts.map +1 -0
  141. package/dist/components/form/inputs/ToggleInput.d.ts +58 -0
  142. package/dist/components/form/inputs/ToggleInput.d.ts.map +1 -0
  143. package/dist/components/formkit/AddressArray.vue.d.ts +2 -2
  144. package/dist/components/formkit/BankDetailsArray.vue.d.ts +2 -2
  145. package/dist/components/formkit/ContactArrayFormKit.vue.d.ts +2 -2
  146. package/dist/components/formkit/FileUploader.vue.d.ts +2 -2
  147. package/dist/components/formkit/MiscFields.vue.d.ts +2 -2
  148. package/dist/components/formkit/Toggle.vue.d.ts +2 -2
  149. package/dist/components/layout/BottomMenu.d.ts +27 -0
  150. package/dist/components/layout/BottomMenu.d.ts.map +1 -0
  151. package/dist/components/layout/Layout.d.ts +58 -0
  152. package/dist/components/layout/Layout.d.ts.map +1 -0
  153. package/dist/components/layout/SidebarMenu.d.ts +38 -0
  154. package/dist/components/layout/SidebarMenu.d.ts.map +1 -0
  155. package/dist/components/layout/TabbedLayout.d.ts +42 -0
  156. package/dist/components/layout/TabbedLayout.d.ts.map +1 -0
  157. package/dist/components/layout/Tabs.d.ts +31 -0
  158. package/dist/components/layout/Tabs.d.ts.map +1 -0
  159. package/dist/components/layout/TabsBody.d.ts +23 -0
  160. package/dist/components/layout/TabsBody.d.ts.map +1 -0
  161. package/dist/components/layout/TabsNav.d.ts +35 -0
  162. package/dist/components/layout/TabsNav.d.ts.map +1 -0
  163. package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
  164. package/dist/components/whatsapp/form/MsgTemplate.vue.d.ts +4 -3
  165. package/dist/components/whatsapp/form/TextVariableExamples.vue.d.ts +2 -2
  166. package/dist/index.cjs +357 -322
  167. package/dist/index.mjs +358 -323
  168. package/dist/style.css +173 -83
  169. package/dist/styles.css +14073 -0
  170. package/dist/utils/objects.d.ts +1 -0
  171. package/dist/utils/timeAgo.d.ts +1 -1
  172. package/dist/utils/timeAgo.d.ts.map +1 -1
  173. package/dist/vue.css +14073 -0
  174. package/package.json +1 -1
  175. package/src/components/Icon/Icon.vue +1 -1
  176. package/src/components/Modal.vue +1 -1
  177. package/src/components/Spreadsheet/Index.vue +1 -0
  178. package/src/components/form/inputs/CheckInput.vue +7 -7
  179. package/src/components/form/inputs/ColorInput.vue +33 -5
  180. package/src/components/form/inputs/DateInput.vue +14 -33
  181. package/src/components/form/inputs/DatePick.vue +10 -27
  182. package/src/components/form/inputs/NumberInput.vue +1 -1
  183. package/src/components/form/inputs/PasswordInput.vue +1 -2
  184. package/src/components/form/inputs/TelInput.vue +1 -2
  185. package/src/components/layout/TabsNav.vue +15 -6
  186. package/src/styles/inputs.css +1 -0
  187. package/src/styles/layout.css +45 -0
  188. package/src/styles/mobilLayout.css +45 -0
  189. package/src/styles/theme.css +13 -0
  190. package/src/utils/timeAgo.ts +83 -9
  191. package/dist/common-C_IH8b5S.cjs +0 -12580
  192. package/dist/common-DoeNgx31.js +0 -12579
  193. package/dist/components/AddressSaerch.vue.d.ts +0 -7
  194. package/dist/components/AddressSaerch.vue.d.ts.map +0 -1
  195. package/dist/components/Calendar/index.d.ts +0 -4
  196. package/dist/components/Calendar/index.d.ts.map +0 -1
  197. package/dist/components/Popover.vue.d.ts +0 -10
  198. package/dist/components/Popover.vue.d.ts.map +0 -1
  199. package/dist/components/form/inputs/RichText/Toolbar.vue.d.ts +0 -14
  200. package/dist/components/form/inputs/RichText/Toolbar.vue.d.ts.map +0 -1
  201. package/dist/components/form/inputs/RichText/formatting.d.ts +0 -11
  202. package/dist/components/form/inputs/RichText/formatting.d.ts.map +0 -1
  203. package/dist/components/form/inputs/RichText/richtext-types.d.ts +0 -3
  204. package/dist/components/form/inputs/RichText/richtext-types.d.ts.map +0 -1
  205. package/dist/components/form/inputs/Upload/UploadFile.vue.d.ts +0 -86
  206. package/dist/components/form/inputs/Upload/UploadFile.vue.d.ts.map +0 -1
  207. package/dist/components/sortable/Animation.d.ts +0 -43
  208. package/dist/components/sortable/Animation.d.ts.map +0 -1
  209. package/dist/components/sortable/BrowserInfo.d.ts +0 -7
  210. package/dist/components/sortable/BrowserInfo.d.ts.map +0 -1
  211. package/dist/components/sortable/EventDispatcher.d.ts +0 -13
  212. package/dist/components/sortable/EventDispatcher.d.ts.map +0 -1
  213. package/dist/components/sortable/PluginManager.d.ts +0 -27
  214. package/dist/components/sortable/PluginManager.d.ts.map +0 -1
  215. package/dist/components/sortable/Sortable.d.ts +0 -81
  216. package/dist/components/sortable/Sortable.d.ts.map +0 -1
  217. package/dist/components/sortable/index.d.ts +0 -5
  218. package/dist/components/sortable/index.d.ts.map +0 -1
  219. package/dist/components/sortable/utils.d.ts +0 -49
  220. package/dist/components/sortable/utils.d.ts.map +0 -1
  221. package/dist/composables/drag-n-drop/useDraggable.d.ts +0 -2
  222. package/dist/composables/drag-n-drop/useDraggable.d.ts.map +0 -1
  223. package/dist/editor-CUDRLdmS.js +0 -4
  224. package/dist/editor-Cu374vEW.cjs +0 -4
  225. package/dist/editor-a8DSbb6P.js +0 -4
  226. package/dist/editor-xBt_vIha.cjs +0 -4
  227. package/dist/heic2any-8wMqMfB_.js +0 -933
  228. package/dist/heic2any-BrqcNzfV.js +0 -935
  229. package/dist/heic2any-C8KwH72N.cjs +0 -934
  230. package/dist/heic2any-k9wDCKka.cjs +0 -932
  231. package/dist/index-DiG-xM9T.cjs +0 -35016
  232. package/dist/index-nGuSAiY2.js +0 -35017
  233. package/dist/plugins/drag-n-drop/draggable.d.ts +0 -4
  234. package/dist/plugins/drag-n-drop/draggable.d.ts.map +0 -1
  235. package/dist/plugins/drag-n-drop/droppable.d.ts +0 -4
  236. package/dist/plugins/drag-n-drop/droppable.d.ts.map +0 -1
  237. package/dist/plugins/drag-n-drop/index.d.ts +0 -5
  238. package/dist/plugins/drag-n-drop/index.d.ts.map +0 -1
  239. package/dist/plugins/drag-n-drop/useDraggable.d.ts +0 -8
  240. package/dist/plugins/drag-n-drop/useDraggable.d.ts.map +0 -1
  241. package/dist/plugins/drag-n-drop/useDroppable.d.ts +0 -7
  242. package/dist/plugins/drag-n-drop/useDroppable.d.ts.map +0 -1
  243. package/dist/types/materialIcon.d.ts +0 -2
  244. package/dist/types/materialIcon.d.ts.map +0 -1
  245. /package/src/components/{Dialog → dialog}/index.ts +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.0.24",
4
+ "version": "1.0.26",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -46,7 +46,7 @@ const isFaBrand = $computed(() => FONT_AWESOME_BRANDS_ICONS.includes(iconRender)
46
46
  }
47
47
  </style>
48
48
 
49
- <style scoped>
49
+ <style>
50
50
  .bgl_icon-font {
51
51
  font-family: 'Material Symbols Outlined', serif !important;
52
52
  }
@@ -88,7 +88,7 @@ onUnmounted(() => {
88
88
  <Title v-if="title" class="modal-title" tag="h3" :label="title" />
89
89
  </header>
90
90
 
91
- <div v-else class="sticky bg-popup z-index-999 -mt-1 -ms-1 px-025 h-30px pt-025 modal-no-title">
91
+ <div v-else class="sticky z-index-999 -mt-1 -ms-1 px-025 h-30px pt-025 modal-no-title">
92
92
  <Btn
93
93
  class="position-start"
94
94
  icon="close"
@@ -702,6 +702,7 @@ const columnOptions = computed(() => {
702
702
  v-for="col in columnOptions"
703
703
  :key="col.key"
704
704
  v-model="visibleColumns"
705
+ @update:modelValue="val => undefined"
705
706
  :value="col.key"
706
707
  :label="col.label || col.key"
707
708
  />
@@ -1,22 +1,22 @@
1
- <script setup lang="ts">
1
+ <script setup lang="ts" generic="T extends boolean | undefined | any[]">
2
2
  import { onMounted } from 'vue'
3
3
 
4
- const props = withDefaults(defineProps<{
4
+ const { defaultValue = false, id } = defineProps<{
5
5
  label?: string
6
6
  id?: string
7
7
  title?: string
8
8
  small?: boolean
9
9
  required?: boolean
10
- defaultValue?: boolean
10
+ defaultValue?: T
11
11
  value?: any
12
- }>(), { defaultValue: false })
12
+ }>()
13
13
 
14
- const inputId = $computed(() => props.id || Math.random().toString(36).slice(7))
14
+ const inputId = $computed(() => id || Math.random().toString(36).slice(7))
15
15
 
16
- const checked = defineModel<boolean | undefined | any[]>('modelValue', { default: undefined })
16
+ const checked = defineModel<T>('modelValue', { default: undefined })
17
17
 
18
18
  onMounted(() => {
19
- if (checked.value === undefined) checked.value = props.defaultValue
19
+ if (checked.value === undefined) checked.value = defaultValue as T
20
20
  })
21
21
  </script>
22
22
 
@@ -1,4 +1,5 @@
1
1
  <script setup lang="ts">
2
+ import { Btn } from '@bagelink/vue'
2
3
  import { watch } from 'vue'
3
4
 
4
5
  const props = withDefaults(
@@ -26,13 +27,40 @@ watch(
26
27
  </script>
27
28
 
28
29
  <template>
29
- <div class="bagel-input" :class="{ small }" :title="label">
30
+ <div class="bagel-input " :class="{ small }" :title="label">
30
31
  <label>
31
32
  {{ label }}
32
- <input
33
- :id="id" v-model="inputVal" type="color" :placeholder="placeholder || label"
34
- :class="{ 'no-edit': !editMode }" :required="required" v-bind="nativeInputAttrs"
35
- >
33
+ <div class="flex bg-input rounded px-025 colorInputPickWrap">
34
+ <input
35
+ :id="id"
36
+ v-model="inputVal" class="border" type="color" :placeholder="placeholder || label"
37
+ :class="{ 'no-edit': !editMode, 'opacity-1': !inputVal }" :required="required" v-bind="nativeInputAttrs"
38
+ >
39
+ <input
40
+ v-model="inputVal"
41
+ class="flex-grow-4 border colorInputPick"
42
+ style="width: 50px"
43
+ type="text"
44
+ placeholder="Enter color"
45
+ >
46
+ <Btn :class="{ 'not-allowed opacity-3': !inputVal }" round flat thin icon="clear" @click="inputVal = ''" />
47
+ </div>
36
48
  </label>
37
49
  </div>
38
50
  </template>
51
+
52
+ <style>
53
+ .colorInputPick{
54
+ --input-font-size: 12px;
55
+ height: calc(var(--input-height) - 9px) !important;
56
+ background: transparent !important;
57
+ }
58
+ .colorInputPick:focus{
59
+ outline: none;
60
+ box-shadow: none !important;
61
+ }
62
+ .colorInputPickWrap:focus-within {
63
+ box-shadow: inset 0 0 10px #00000021;
64
+ outline-color: var(--input-bg);
65
+ }
66
+ </style>
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import type { modeType } from '../../Calendar/typings/types'
3
- import { Btn, NumberInput, Dropdown, TextInput } from '@bagelink/vue'
3
+ import { Btn, NumberInput, Dropdown, TextInput, formatDate } from '@bagelink/vue'
4
4
  import { computed, ref, onMounted, onBeforeUnmount } from 'vue'
5
5
  import Time, { WEEK_START_DAY } from '../../Calendar/helpers/Time'
6
6
 
@@ -20,6 +20,7 @@ const props = withDefaults(
20
20
  max?: string | Date
21
21
  timezone?: string
22
22
  mode?: modeType
23
+ defaultValue?: string | Date
23
24
  firstDayOfWeek?: WEEK_START_DAY
24
25
  locale?: string
25
26
  center?: boolean
@@ -49,28 +50,7 @@ const time = new Time(props.firstDayOfWeek, props.locale)
49
50
  function useFormatting() {
50
51
  const formatDisplayDate = (date: Date | string | undefined): string => {
51
52
  if (!date) return ''
52
- const dateObj = typeof date === 'string' ? new Date(date) : date
53
-
54
- const options: Intl.DateTimeFormatOptions = {
55
- year: 'numeric',
56
- month: 'short',
57
- day: 'numeric',
58
- ...(props.enableTime && {
59
- hour: '2-digit',
60
- minute: '2-digit',
61
- }),
62
- timeZone: props.timezone
63
- }
64
-
65
- return dateObj.toLocaleString(props.locale || undefined, options)
66
- }
67
-
68
- const formatDate = (date: Date | string | undefined): string => {
69
- if (!date) return ''
70
- const dateObj = typeof date === 'string' ? new Date(date) : date
71
- return props.enableTime
72
- ? dateObj.toISOString().slice(0, 16)
73
- : dateObj.toISOString().split('T')[0]
53
+ return formatDate(date, props.enableTime ? 'dd.mm.yy HH:MM' : 'dd.mm.yy')
74
54
  }
75
55
 
76
56
  const parseUserInput = (input: string): Date | null => {
@@ -97,7 +77,7 @@ function useFormatting() {
97
77
 
98
78
  return {
99
79
  formatDisplayDate,
100
- formatDate,
80
+
101
81
  parseUserInput
102
82
  }
103
83
  }
@@ -131,14 +111,15 @@ function useDateValidation() {
131
111
 
132
112
  // Date state composable
133
113
  function useDateState() {
134
- const { formatDisplayDate, formatDate } = useFormatting()
114
+ const { formatDisplayDate } = useFormatting()
135
115
 
136
116
  const formattedDisplayValue = computed(() => formatDisplayDate(props.modelValue))
137
- const formattedMin = computed(() => formatDate(props.min))
138
- const formattedMax = computed(() => formatDate(props.max))
117
+ const formattedMin = computed(() => formatDate(props.min, props.enableTime ? 'dd.mm.yy HH:MM' : 'dd.mm.yy'))
118
+ const formattedMax = computed(() => formatDate(props.max, props.enableTime ? 'dd.mm.yy HH:MM' : 'dd.mm.yy'))
139
119
  const selectedDate = computed(() => {
140
- if (!props.modelValue) return null
141
- return typeof props.modelValue === 'string' ? new Date(props.modelValue) : props.modelValue
120
+ const value = props.modelValue || props.defaultValue
121
+ if (!value) return null
122
+ return typeof value === 'string' ? new Date(value) : value
142
123
  })
143
124
 
144
125
  return {
@@ -381,11 +362,9 @@ const { hours, minutes, handleHourInput, handleMinuteInput, timezoneDisplay } =
381
362
  function selectDate(date: Date | null) {
382
363
  if (!date || !props.editMode) return
383
364
 
384
- // Create date in the target timezone
385
- const tzOffset = new Date().getTimezoneOffset()
386
- const newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate())
387
-
388
365
  if (props.enableTime) {
366
+ // Create date in the target timezone
367
+ const newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate())
389
368
  const currentHours = selectedDate.value?.getHours() ?? new Date().getHours()
390
369
  const currentMinutes = selectedDate.value?.getMinutes() ?? new Date().getMinutes()
391
370
  newDate.setHours(currentHours)
@@ -393,11 +372,13 @@ function selectDate(date: Date | null) {
393
372
 
394
373
  // Adjust for timezone when time is enabled
395
374
  if (props.timezone === 'UTC') {
375
+ const tzOffset = new Date().getTimezoneOffset()
396
376
  newDate.setMinutes(newDate.getMinutes() + tzOffset)
397
377
  }
398
378
  emit('update:modelValue', newDate.toISOString())
399
379
  } else {
400
380
  // For date-only selection, ensure we're working with UTC midnight
381
+ // This ensures the date displayed matches the date selected regardless of timezone
401
382
  const utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()))
402
383
  emit('update:modelValue', utcDate.toISOString().split('T')[0])
403
384
  isOpen.value = false
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import type { modeType } from '../../Calendar/typings/types'
3
- import { Btn, NumberInput, Dropdown } from '@bagelink/vue'
3
+ import { Btn, NumberInput, Dropdown, formatDate } from '@bagelink/vue'
4
4
  import Time, { WEEK_START_DAY } from '../../Calendar/helpers/Time'
5
5
 
6
6
  const props = withDefaults(
@@ -41,36 +41,19 @@ const time = new Time(props.firstDayOfWeek, props.locale)
41
41
 
42
42
  function formatDisplayDate(date: Date | string | undefined): string {
43
43
  if (!date) return ''
44
- const dateObj = typeof date === 'string' ? new Date(date) : date
45
-
46
- if (props.enableTime) {
47
- return dateObj.toLocaleString(props.locale || undefined, {
48
- year: 'numeric',
49
- month: 'short',
50
- day: 'numeric',
51
- hour: '2-digit',
52
- minute: '2-digit',
53
- timeZone: props.timezone
54
- })
55
- }
56
-
57
- return dateObj.toLocaleString(props.locale || undefined, {
58
- year: 'numeric',
59
- month: 'short',
60
- day: 'numeric',
61
- timeZone: props.timezone
62
- })
44
+ console.log('date', date)
45
+ return formatDate(date, props.enableTime ? 'dd.mm.yy HH:MM' : 'dd.mm.yy', props.locale)
63
46
  }
64
47
 
65
- function formatDate(date: Date | string | undefined): string {
66
- if (!date) return ''
67
- const dateObj = typeof date === 'string' ? new Date(date) : date
68
- return props.enableTime ? dateObj.toISOString().slice(0, 16) : dateObj.toISOString().split('T')[0]
69
- }
48
+ // function formatDate(date: Date | string | undefined): string {
49
+ // if (!date) return ''
50
+ // const dateObj = typeof date === 'string' ? new Date(date) : date
51
+ // return props.enableTime ? dateObj.toISOString().slice(0, 16) : dateObj.toISOString().split('T')[0]
52
+ // }
70
53
 
71
54
  const formattedDisplayValue = $computed(() => formatDisplayDate(props.modelValue))
72
- const formattedMin = $computed(() => formatDate(props.min))
73
- const formattedMax = $computed(() => formatDate(props.max))
55
+ const formattedMin = $computed(() => formatDate(props.min, props.enableTime ? 'dd.mm.yy HH:MM' : 'dd.mm.yy'))
56
+ const formattedMax = $computed(() => formatDate(props.max, props.enableTime ? 'dd.mm.yy HH:MM' : 'dd.mm.yy'))
74
57
 
75
58
  const selectedDate = $computed(() => {
76
59
  if (!props.modelValue) return null
@@ -14,7 +14,7 @@ interface NumberInputProps {
14
14
  iconStart?: IconType
15
15
  icon?: IconType
16
16
  label?: string
17
- defaultValue?: number
17
+ defaultValue?: number | string
18
18
  placeholder?: string
19
19
  disabled?: boolean
20
20
  required?: boolean
@@ -37,8 +37,7 @@ const props = withDefaults(
37
37
  const password = defineModel<string>('modelValue')
38
38
  const showPwd = defineModel<boolean>('showPwd', { default: false })
39
39
 
40
- const toggleShowPwdIcon = $computed(() => showPwd.value ? 'visibility_off' : 'visibility'
41
- )
40
+ const toggleShowPwdIcon = $computed(() => showPwd.value ? 'visibility_off' : 'visibility')
42
41
  const inputType = $computed(() => (showPwd.value ? 'text' : 'password'))
43
42
  </script>
44
43
 
@@ -396,7 +396,7 @@ onMounted(initializeCountry)
396
396
  v-for="(pb, index) in sortedCountries"
397
397
  :key="pb.iso2 + isPreferred(pb)"
398
398
  role="option"
399
- class="flex gap-075"
399
+ class="flex gap-075 pointer hover"
400
400
  tabindex="-1"
401
401
  :aria-selected="activeCountryCode === pb.iso2 && !isPreferred(pb)
402
402
  "
@@ -425,7 +425,6 @@ onMounted(initializeCountry)
425
425
  :disabled="disabled"
426
426
  type="tel"
427
427
  :autocomplete="autocomplete"
428
- class="vti__input"
429
428
  :pattern="computedInputOptions.pattern"
430
429
  :minlength="computedInputOptions.minlength"
431
430
  :maxlength="computedInputOptions.maxlength"
@@ -31,14 +31,15 @@ const tabsWrap = ref<HTMLElement | undefined>(undefined)
31
31
  const tabs = ref<HTMLElement[]>([])
32
32
 
33
33
  function updateIndicator() {
34
- const activeTab = tabs.value.find(tab => tab.classList.contains('active'))
35
- if (activeTab && tabsWrap.value) {
36
- const { offsetLeft, offsetWidth } = activeTab
37
- tabsWrap.value.style.setProperty('--indicator-left', `${offsetLeft}px`)
38
- if (tabsWrap.value) {
34
+ nextTick(() => {
35
+ if (!tabsWrap.value) return
36
+ const activeTab = tabs.value.find(tab => tab.classList.contains('active'))
37
+ if (activeTab) {
38
+ const { offsetLeft, offsetWidth } = activeTab
39
+ tabsWrap.value.style.setProperty('--indicator-left', `${offsetLeft}px`)
39
40
  tabsWrap.value.style.setProperty('--indicator-width', `${offsetWidth}px`)
40
41
  }
41
- }
42
+ })
42
43
  }
43
44
 
44
45
  function selectTab(tab: TabType | string) {
@@ -71,6 +72,14 @@ onMounted(() => {
71
72
  updateIndicator()
72
73
  window.addEventListener('resize', updateIndicator)
73
74
  })
75
+
76
+ watch(
77
+ () => tabs.value,
78
+ () => {
79
+ nextTick(() => { updateIndicator() })
80
+ },
81
+ { deep: true }
82
+ )
74
83
  onBeforeUnmount(() => {
75
84
  window.removeEventListener('resize', updateIndicator)
76
85
  })
@@ -295,6 +295,7 @@ select {
295
295
  padding: 0.025rem 0.05rem;
296
296
  display: block;
297
297
  width: var(--input-height);
298
+ min-width: var(--input-height);
298
299
  height: var(--input-height);
299
300
  border: none;
300
301
  -webkit-appearance: none;
@@ -3083,6 +3083,46 @@
3083
3083
  gap: 10rem;
3084
3084
  }
3085
3085
 
3086
+ .gap-11 {
3087
+ gap: 11rem;
3088
+ }
3089
+
3090
+ .gap-12 {
3091
+ gap: 12rem;
3092
+ }
3093
+
3094
+ .gap-13 {
3095
+ gap: 13rem;
3096
+ }
3097
+
3098
+ .gap-14 {
3099
+ gap: 14rem;
3100
+ }
3101
+
3102
+ .gap-15 {
3103
+ gap: 15rem;
3104
+ }
3105
+
3106
+ .gap-16 {
3107
+ gap: 16rem;
3108
+ }
3109
+
3110
+ .gap-17 {
3111
+ gap: 17rem;
3112
+ }
3113
+
3114
+ .gap-18 {
3115
+ gap: 18rem;
3116
+ }
3117
+
3118
+ .gap-19 {
3119
+ gap: 19rem;
3120
+ }
3121
+
3122
+ .gap-20 {
3123
+ gap: 20rem;
3124
+ }
3125
+
3086
3126
  .gap-1-5 {
3087
3127
  gap: 1.5rem;
3088
3128
  }
@@ -3405,6 +3445,11 @@
3405
3445
  flex-grow: 4;
3406
3446
  }
3407
3447
 
3448
+ .flex-grow-9999 {
3449
+ flex-grow: 9999;
3450
+ }
3451
+
3452
+
3408
3453
  .flex-shrink-4 {
3409
3454
  flex-shrink: 4;
3410
3455
  }
@@ -2368,6 +2368,47 @@
2368
2368
  gap: 10rem;
2369
2369
  }
2370
2370
 
2371
+ .m_gap-11 {
2372
+ gap: 11rem;
2373
+ }
2374
+
2375
+ .m_gap-12 {
2376
+ gap: 12rem;
2377
+ }
2378
+
2379
+ .m_gap-13 {
2380
+ gap: 13rem;
2381
+ }
2382
+
2383
+ .m_gap-14 {
2384
+ gap: 14rem;
2385
+ }
2386
+
2387
+ .m_gap-15 {
2388
+ gap: 15rem;
2389
+ }
2390
+
2391
+ .m_gap-16 {
2392
+ gap: 16rem;
2393
+ }
2394
+
2395
+ .m_gap-17 {
2396
+ gap: 17rem;
2397
+ }
2398
+
2399
+ .m_gap-18 {
2400
+ gap: 18rem;
2401
+ }
2402
+
2403
+ .m_gap-19 {
2404
+ gap: 19rem;
2405
+ }
2406
+
2407
+ .m_gap-20 {
2408
+ gap: 20rem;
2409
+ }
2410
+
2411
+
2371
2412
  .m_gap-1-5 {
2372
2413
  gap: 1.5rem;
2373
2414
  }
@@ -2690,6 +2731,10 @@
2690
2731
  flex-grow: 4;
2691
2732
  }
2692
2733
 
2734
+ .m_flex-grow-9999 {
2735
+ flex-grow: 9999;
2736
+ }
2737
+
2693
2738
  .m_flex-shrink-4 {
2694
2739
  flex-shrink: 4;
2695
2740
  }
@@ -302,6 +302,19 @@
302
302
  overflow: hidden;
303
303
  }
304
304
 
305
+ .extraOptions {
306
+ max-height: 30px;
307
+ overflow: hidden;
308
+ transition: all 0.2s 30s ease;
309
+ }
310
+
311
+
312
+ .extraOptions:hover {
313
+ max-height: 200vh;
314
+ transition: 0.2s all 0.2s ease;
315
+
316
+ }
317
+
305
318
  @media screen and (max-width: 1000px) {
306
319
  .entity-container {
307
320
  grid-template-columns: minmax(22vw, 1fr) 2fr;
@@ -134,22 +134,96 @@ const formatMap = {
134
134
  ampm: { type: 'dayPeriod', format: 'short' }
135
135
  } as const
136
136
 
137
- export function formatDate(date?: string | Date, format: string = 'dd.mm.yy') {
137
+ function getBrowserNavigatorLocale(): string {
138
+ if (typeof navigator !== 'object') return 'en-US'
139
+ return navigator.languages && navigator.languages.length
140
+ ? navigator.languages[0]
141
+ : navigator.language
142
+ }
143
+
144
+ export function formatDate(date?: string | Date, format: string = 'dd.mm.yy', locale?: string) {
138
145
  if (!date) return ''
146
+ locale = locale || getBrowserNavigatorLocale()
139
147
  try {
140
- const formatParts = format.split(/[.\s:]/)
141
- const formatObject: Record<string, string> = {}
148
+ // Validate the date
149
+ const d = typeof date === 'string' ? new Date(date) : date
142
150
 
143
- for (const part of formatParts) {
144
- const formatInfo = formatMap[part as keyof typeof formatMap]
145
- if (!formatInfo) continue
146
- formatObject[formatInfo.type] = formatInfo.format
151
+ // Check if date is valid
152
+ if (Number.isNaN(d.getTime())) {
153
+ console.warn('Invalid date provided to formatDate:', date)
154
+ return ''
147
155
  }
148
156
 
149
- const d = typeof date === 'string' ? new Date(date) : date
157
+ // Extract the separator from the format string
158
+ const separator = format.match(/[^\w\s]/)?.[0] || '.'
159
+
160
+ // Split by any non-alphanumeric character (except spaces)
161
+ const formatParts = format.split(/[^\w\s]/)
162
+
163
+ // Create a map of all date parts
164
+ const datePartsMap: Record<string, string> = {
165
+ dd: String(d.getDate()).padStart(2, '0'),
166
+ mm: String(d.getMonth() + 1).padStart(2, '0'),
167
+ yy: String(d.getFullYear()).slice(-2),
168
+ yyyy: String(d.getFullYear()),
169
+ HH: String(d.getHours()).padStart(2, '0'),
170
+ MM: String(d.getMinutes()).padStart(2, '0'),
171
+ ss: String(d.getSeconds()).padStart(2, '0')
172
+ }
173
+
174
+ // For more complex formats that need localization, use Intl.DateTimeFormat
175
+ const formatter = new Intl.DateTimeFormat(locale, {
176
+ weekday: 'long',
177
+ month: 'long',
178
+ day: 'numeric',
179
+ year: 'numeric',
180
+ hour: '2-digit',
181
+ minute: '2-digit',
182
+ second: '2-digit',
183
+ hour12: true
184
+ })
185
+
186
+ const formattedParts = formatter.formatToParts(d)
187
+ const partsMap: Record<string, string> = {}
188
+
189
+ formattedParts.forEach((part) => {
190
+ if (part.type !== 'literal') {
191
+ partsMap[part.type] = part.value
192
+ }
193
+ })
194
+
195
+ // Add localized formats to our map
196
+ if (partsMap.month) {
197
+ datePartsMap.mmm = partsMap.month.substring(0, 3)
198
+ datePartsMap.mmmm = partsMap.month
199
+ }
200
+
201
+ if (partsMap.weekday) {
202
+ datePartsMap.ddd = partsMap.weekday.substring(0, 3)
203
+ datePartsMap.dddd = partsMap.weekday
204
+ }
205
+
206
+ if (partsMap.dayPeriod) {
207
+ datePartsMap.ampm = partsMap.dayPeriod
208
+ }
209
+
210
+ // Build the formatted date string following the exact format pattern
211
+ let formattedDate = ''
212
+ for (let i = 0; i < formatParts.length; i++) {
213
+ const part = formatParts[i]
214
+ if (datePartsMap[part]) {
215
+ formattedDate += datePartsMap[part]
216
+ }
217
+
218
+ // Add separator between parts (except after the last part)
219
+ if (i < formatParts.length - 1) {
220
+ formattedDate += separator
221
+ }
222
+ }
150
223
 
151
- return d.toLocaleDateString('he-IL', formatObject)
224
+ return formattedDate
152
225
  } catch (error) {
226
+ console.warn('Error formatting date', error)
153
227
  return ''
154
228
  }
155
229
  }