@bagelink/vue 1.0.22 → 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.
- package/dist/components/Accordion.d.ts +12 -0
- package/dist/components/Accordion.d.ts.map +1 -0
- package/dist/components/AccordionItem.d.ts +34 -0
- package/dist/components/AccordionItem.d.ts.map +1 -0
- package/dist/components/Alert.d.ts +34 -0
- package/dist/components/Alert.d.ts.map +1 -0
- package/dist/components/Avatar.d.ts +36 -0
- package/dist/components/Avatar.d.ts.map +1 -0
- package/dist/components/Badge.d.ts +22 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/BglVideo.d.ts +20 -0
- package/dist/components/BglVideo.d.ts.map +1 -0
- package/dist/components/Btn.d.ts +99 -0
- package/dist/components/Btn.d.ts.map +1 -0
- package/dist/components/Card.d.ts +39 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Carousel.d.ts +74 -0
- package/dist/components/Carousel.d.ts.map +1 -0
- package/dist/components/ComboBox.vue.d.ts +3 -3
- package/dist/components/Comments.vue.d.ts +2 -2
- package/dist/components/ContactSubmissions.vue.d.ts +2 -2
- package/dist/components/DataPreview.d.ts +42 -0
- package/dist/components/DataPreview.d.ts.map +1 -0
- package/dist/components/Drop.vue.d.ts +34 -0
- package/dist/components/Drop.vue.d.ts.map +1 -0
- package/dist/components/FileUploader.vue.d.ts +60 -0
- package/dist/components/FileUploader.vue.d.ts.map +1 -0
- package/dist/components/Flag.d.ts +20 -0
- package/dist/components/Flag.d.ts.map +1 -0
- package/dist/components/FormSchema.vue.d.ts +5 -4
- package/dist/components/Icon/Icon.vue.d.ts.map +1 -1
- package/dist/components/LangText.vue.d.ts +2 -2
- package/dist/components/ListItem.d.ts +34 -0
- package/dist/components/ListItem.d.ts.map +1 -0
- package/dist/components/ListView.d.ts +13 -0
- package/dist/components/ListView.d.ts.map +1 -0
- package/dist/components/MapEmbed.d.ts +3 -0
- package/dist/components/MapEmbed.d.ts.map +1 -0
- package/dist/components/MaterialIcon.d.ts +26 -0
- package/dist/components/MaterialIcon.d.ts.map +1 -0
- package/dist/components/Modal.d.ts +46 -0
- package/dist/components/Modal.d.ts.map +1 -0
- package/dist/components/ModalBglForm.vue.d.ts +21 -20
- package/dist/components/ModalConfirm.d.ts +24 -0
- package/dist/components/ModalConfirm.d.ts.map +1 -0
- package/dist/components/ModalForm.d.ts +78 -0
- package/dist/components/ModalForm.d.ts.map +1 -0
- package/dist/components/NavBar.d.ts +64 -0
- package/dist/components/NavBar.d.ts.map +1 -0
- package/dist/components/PageTitle.d.ts +24 -0
- package/dist/components/PageTitle.d.ts.map +1 -0
- package/dist/components/PersonPreview.vue.d.ts +5 -4
- package/dist/components/PersonPreviewFormkit.vue.d.ts +4 -3
- package/dist/components/RTXEditor.vue.d.ts +3 -3
- package/dist/components/RouterWrapper.d.ts +3 -0
- package/dist/components/RouterWrapper.d.ts.map +1 -0
- package/dist/components/Spreadsheet/Index.vue.d.ts.map +1 -1
- package/dist/components/TabbedLayout.vue.d.ts +5 -4
- package/dist/components/TableSchema.d.ts +35 -0
- package/dist/components/TableSchema.d.ts.map +1 -0
- package/dist/components/TableSchema.vue.d.ts +2 -2
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/Title.d.ts +42 -0
- package/dist/components/Title.d.ts.map +1 -0
- package/dist/components/TopBar.d.ts +12 -0
- package/dist/components/TopBar.d.ts.map +1 -0
- package/dist/components/charts/BarChart.vue.d.ts +2 -2
- package/dist/components/dashboard/Lineart.d.ts +20 -0
- package/dist/components/dashboard/Lineart.d.ts.map +1 -0
- package/dist/components/dialog/index.d.ts.map +1 -1
- package/dist/components/form/BglField.d.ts +25 -0
- package/dist/components/form/BglField.d.ts.map +1 -0
- package/dist/components/form/BglForm.d.ts +75 -0
- package/dist/components/form/BglForm.d.ts.map +1 -0
- package/dist/components/form/ItemRef.vue.d.ts +5 -3
- package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
- package/dist/components/form/MaterialIcon.vue.d.ts +4 -3
- package/dist/components/form/PlainInputField.vue.d.ts +3 -3
- package/dist/components/form/inputs/CheckInput.d.ts +56 -0
- package/dist/components/form/inputs/CheckInput.d.ts.map +1 -0
- package/dist/components/form/inputs/CheckInput.vue.d.ts +22 -30
- package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Checkbox.d.ts +16 -0
- package/dist/components/form/inputs/Checkbox.d.ts.map +1 -0
- package/dist/components/form/inputs/ColorInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ColorPicker.d.ts +48 -0
- package/dist/components/form/inputs/ColorPicker.d.ts.map +1 -0
- package/dist/components/form/inputs/CurrencyInput.vue.d.ts +3 -3
- package/dist/components/form/inputs/DateInput.d.ts +64 -0
- package/dist/components/form/inputs/DateInput.d.ts.map +1 -0
- package/dist/components/form/inputs/DateInput.vue.d.ts +1 -0
- package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePick.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.d.ts +33 -0
- package/dist/components/form/inputs/DatePicker.d.ts.map +1 -0
- package/dist/components/form/inputs/DatetimeInput.vue.d.ts +3 -3
- package/dist/components/form/inputs/DurationInput.vue.d.ts +3 -3
- package/dist/components/form/inputs/DynamicLinkField.vue.d.ts +3 -3
- package/dist/components/form/inputs/EmailInput.vue.d.ts +3 -3
- package/dist/components/form/inputs/FileUpload.d.ts +108 -0
- package/dist/components/form/inputs/FileUpload.d.ts.map +1 -0
- package/dist/components/form/inputs/FloatInput.vue.d.ts +3 -3
- package/dist/components/form/inputs/IntInput.vue.d.ts +3 -3
- package/dist/components/form/inputs/JSONInput.d.ts +53 -0
- package/dist/components/form/inputs/JSONInput.d.ts.map +1 -0
- package/dist/components/form/inputs/LinkField.vue.d.ts +3 -3
- package/dist/components/form/inputs/NumberInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/NumberInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Password.vue.d.ts +3 -3
- package/dist/components/form/inputs/PasswordInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/PlainText.vue.d.ts +3 -3
- package/dist/components/form/inputs/RadioGroup.d.ts +42 -0
- package/dist/components/form/inputs/RadioGroup.d.ts.map +1 -0
- package/dist/components/form/inputs/RadioPillsInput.d.ts +48 -0
- package/dist/components/form/inputs/RadioPillsInput.d.ts.map +1 -0
- package/dist/components/form/inputs/RangeInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ReadOnlyInput.vue.d.ts +2 -2
- package/dist/components/form/inputs/RichText.d.ts +20 -0
- package/dist/components/form/inputs/RichText.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText2/Toolbar.d.ts +22 -0
- package/dist/components/form/inputs/RichText2/Toolbar.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText2/Toolbar.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText2/index.d.ts +24 -0
- package/dist/components/form/inputs/RichText2/index.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText2/index.vue.d.ts +1 -0
- package/dist/components/form/inputs/RichText2/index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichTextEditor.vue.d.ts +3 -3
- package/dist/components/form/inputs/SelectField.vue.d.ts +6 -8
- package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.d.ts +55 -0
- package/dist/components/form/inputs/SelectInput.d.ts.map +1 -0
- package/dist/components/form/inputs/SignaturePad.d.ts +72 -0
- package/dist/components/form/inputs/SignaturePad.d.ts.map +1 -0
- package/dist/components/form/inputs/TableField.d.ts +45 -0
- package/dist/components/form/inputs/TableField.d.ts.map +1 -0
- package/dist/components/form/inputs/TelInput.d.ts +241 -0
- package/dist/components/form/inputs/TelInput.d.ts.map +1 -0
- package/dist/components/form/inputs/TelInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TextArea.vue.d.ts +3 -3
- package/dist/components/form/inputs/TextInput.d.ts +90 -0
- package/dist/components/form/inputs/TextInput.d.ts.map +1 -0
- package/dist/components/form/inputs/ToggleInput.d.ts +58 -0
- package/dist/components/form/inputs/ToggleInput.d.ts.map +1 -0
- package/dist/components/formkit/AddressArray.vue.d.ts +2 -2
- package/dist/components/formkit/BankDetailsArray.vue.d.ts +2 -2
- package/dist/components/formkit/ContactArrayFormKit.vue.d.ts +2 -2
- package/dist/components/formkit/FileUploader.vue.d.ts +2 -2
- package/dist/components/formkit/MiscFields.vue.d.ts +2 -2
- package/dist/components/formkit/Toggle.vue.d.ts +2 -2
- package/dist/components/layout/BottomMenu.d.ts +27 -0
- package/dist/components/layout/BottomMenu.d.ts.map +1 -0
- package/dist/components/layout/Layout.d.ts +58 -0
- package/dist/components/layout/Layout.d.ts.map +1 -0
- package/dist/components/layout/SidebarMenu.d.ts +38 -0
- package/dist/components/layout/SidebarMenu.d.ts.map +1 -0
- package/dist/components/layout/TabbedLayout.d.ts +42 -0
- package/dist/components/layout/TabbedLayout.d.ts.map +1 -0
- package/dist/components/layout/Tabs.d.ts +31 -0
- package/dist/components/layout/Tabs.d.ts.map +1 -0
- package/dist/components/layout/TabsBody.d.ts +23 -0
- package/dist/components/layout/TabsBody.d.ts.map +1 -0
- package/dist/components/layout/TabsNav.d.ts +35 -0
- package/dist/components/layout/TabsNav.d.ts.map +1 -0
- package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
- package/dist/components/whatsapp/form/MsgTemplate.vue.d.ts +4 -3
- package/dist/components/whatsapp/form/TextVariableExamples.vue.d.ts +2 -2
- package/dist/index.cjs +364 -333
- package/dist/index.mjs +365 -334
- package/dist/style.css +184 -94
- package/dist/styles.css +14073 -0
- package/dist/utils/objects.d.ts +1 -0
- package/dist/utils/timeAgo.d.ts +1 -1
- package/dist/utils/timeAgo.d.ts.map +1 -1
- package/dist/vue.css +14073 -0
- package/package.json +1 -1
- package/src/components/Icon/Icon.vue +1 -1
- package/src/components/Modal.vue +1 -1
- package/src/components/Spreadsheet/Index.vue +1 -0
- package/src/components/form/inputs/CheckInput.vue +7 -7
- package/src/components/form/inputs/ColorInput.vue +33 -5
- package/src/components/form/inputs/DateInput.vue +14 -33
- package/src/components/form/inputs/DatePick.vue +10 -27
- package/src/components/form/inputs/NumberInput.vue +1 -1
- package/src/components/form/inputs/PasswordInput.vue +1 -2
- package/src/components/form/inputs/RangeInput.vue +2 -6
- package/src/components/form/inputs/TelInput.vue +1 -2
- package/src/components/layout/TabsNav.vue +15 -6
- package/src/styles/inputs.css +1 -0
- package/src/styles/layout.css +45 -0
- package/src/styles/mobilLayout.css +45 -0
- package/src/styles/theme.css +13 -0
- package/src/utils/timeAgo.ts +83 -9
- package/dist/common-C_IH8b5S.cjs +0 -12580
- package/dist/common-DoeNgx31.js +0 -12579
- package/dist/components/AddressSaerch.vue.d.ts +0 -7
- package/dist/components/AddressSaerch.vue.d.ts.map +0 -1
- package/dist/components/Calendar/index.d.ts +0 -4
- package/dist/components/Calendar/index.d.ts.map +0 -1
- package/dist/components/Popover.vue.d.ts +0 -10
- package/dist/components/Popover.vue.d.ts.map +0 -1
- package/dist/components/form/inputs/RichText/Toolbar.vue.d.ts +0 -14
- package/dist/components/form/inputs/RichText/Toolbar.vue.d.ts.map +0 -1
- package/dist/components/form/inputs/RichText/formatting.d.ts +0 -11
- package/dist/components/form/inputs/RichText/formatting.d.ts.map +0 -1
- package/dist/components/form/inputs/RichText/richtext-types.d.ts +0 -3
- package/dist/components/form/inputs/RichText/richtext-types.d.ts.map +0 -1
- package/dist/components/form/inputs/Upload/UploadFile.vue.d.ts +0 -86
- package/dist/components/form/inputs/Upload/UploadFile.vue.d.ts.map +0 -1
- package/dist/components/sortable/Animation.d.ts +0 -43
- package/dist/components/sortable/Animation.d.ts.map +0 -1
- package/dist/components/sortable/BrowserInfo.d.ts +0 -7
- package/dist/components/sortable/BrowserInfo.d.ts.map +0 -1
- package/dist/components/sortable/EventDispatcher.d.ts +0 -13
- package/dist/components/sortable/EventDispatcher.d.ts.map +0 -1
- package/dist/components/sortable/PluginManager.d.ts +0 -27
- package/dist/components/sortable/PluginManager.d.ts.map +0 -1
- package/dist/components/sortable/Sortable.d.ts +0 -81
- package/dist/components/sortable/Sortable.d.ts.map +0 -1
- package/dist/components/sortable/index.d.ts +0 -5
- package/dist/components/sortable/index.d.ts.map +0 -1
- package/dist/components/sortable/utils.d.ts +0 -49
- package/dist/components/sortable/utils.d.ts.map +0 -1
- package/dist/composables/drag-n-drop/useDraggable.d.ts +0 -2
- package/dist/composables/drag-n-drop/useDraggable.d.ts.map +0 -1
- package/dist/editor-CUDRLdmS.js +0 -4
- package/dist/editor-Cu374vEW.cjs +0 -4
- package/dist/editor-a8DSbb6P.js +0 -4
- package/dist/editor-xBt_vIha.cjs +0 -4
- package/dist/heic2any-8wMqMfB_.js +0 -933
- package/dist/heic2any-BrqcNzfV.js +0 -935
- package/dist/heic2any-C8KwH72N.cjs +0 -934
- package/dist/heic2any-k9wDCKka.cjs +0 -932
- package/dist/index-DiG-xM9T.cjs +0 -35016
- package/dist/index-nGuSAiY2.js +0 -35017
- package/dist/plugins/drag-n-drop/draggable.d.ts +0 -4
- package/dist/plugins/drag-n-drop/draggable.d.ts.map +0 -1
- package/dist/plugins/drag-n-drop/droppable.d.ts +0 -4
- package/dist/plugins/drag-n-drop/droppable.d.ts.map +0 -1
- package/dist/plugins/drag-n-drop/index.d.ts +0 -5
- package/dist/plugins/drag-n-drop/index.d.ts.map +0 -1
- package/dist/plugins/drag-n-drop/useDraggable.d.ts +0 -8
- package/dist/plugins/drag-n-drop/useDraggable.d.ts.map +0 -1
- package/dist/plugins/drag-n-drop/useDroppable.d.ts +0 -7
- package/dist/plugins/drag-n-drop/useDroppable.d.ts.map +0 -1
- package/dist/types/materialIcon.d.ts +0 -2
- package/dist/types/materialIcon.d.ts.map +0 -1
- /package/src/components/{Dialog → dialog}/index.ts +0 -0
package/package.json
CHANGED
package/src/components/Modal.vue
CHANGED
|
@@ -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
|
|
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"
|
|
@@ -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
|
|
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?:
|
|
10
|
+
defaultValue?: T
|
|
11
11
|
value?: any
|
|
12
|
-
}>()
|
|
12
|
+
}>()
|
|
13
13
|
|
|
14
|
-
const inputId = $computed(() =>
|
|
14
|
+
const inputId = $computed(() => id || Math.random().toString(36).slice(7))
|
|
15
15
|
|
|
16
|
-
const checked = defineModel<
|
|
16
|
+
const checked = defineModel<T>('modelValue', { default: undefined })
|
|
17
17
|
|
|
18
18
|
onMounted(() => {
|
|
19
|
-
if (checked.value === undefined) checked.value =
|
|
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
|
-
|
|
34
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
141
|
-
|
|
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
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
|
@@ -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
|
|
|
@@ -22,10 +22,6 @@ const {
|
|
|
22
22
|
min = 0,
|
|
23
23
|
max = 100,
|
|
24
24
|
step = 1,
|
|
25
|
-
label,
|
|
26
|
-
disabled,
|
|
27
|
-
id,
|
|
28
|
-
rtl,
|
|
29
25
|
multiRange = false,
|
|
30
26
|
formatValue = (value: number) => value.toString()
|
|
31
27
|
} = props
|
|
@@ -65,7 +61,7 @@ const rangeStyle = $computed(() => {
|
|
|
65
61
|
width: `${toPercentage - fromPercentage}%`
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
|
-
return rtl
|
|
64
|
+
return props.rtl
|
|
69
65
|
? { left: `${100 - fromPercentage}%`, width: `${fromPercentage}%` }
|
|
70
66
|
: { left: '0', width: `${fromPercentage}%` }
|
|
71
67
|
})
|
|
@@ -76,7 +72,7 @@ const displayTo = $computed(() => formatValue(validTo))
|
|
|
76
72
|
|
|
77
73
|
<template>
|
|
78
74
|
<div :dir="rtl ? 'rtl' : 'ltr'">
|
|
79
|
-
<label v-if="label" class="label">{{ label }}</label>
|
|
75
|
+
<label v-if="props.label" class="label">{{ props.label }}</label>
|
|
80
76
|
<div class="range-slider relative w-100">
|
|
81
77
|
<input
|
|
82
78
|
:id="id"
|
|
@@ -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
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
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
|
})
|
package/src/styles/inputs.css
CHANGED
package/src/styles/layout.css
CHANGED
|
@@ -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
|
}
|
package/src/styles/theme.css
CHANGED
|
@@ -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;
|
package/src/utils/timeAgo.ts
CHANGED
|
@@ -134,22 +134,96 @@ const formatMap = {
|
|
|
134
134
|
ampm: { type: 'dayPeriod', format: 'short' }
|
|
135
135
|
} as const
|
|
136
136
|
|
|
137
|
-
|
|
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
|
-
|
|
141
|
-
const
|
|
148
|
+
// Validate the date
|
|
149
|
+
const d = typeof date === 'string' ? new Date(date) : date
|
|
142
150
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
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
|
|
224
|
+
return formattedDate
|
|
152
225
|
} catch (error) {
|
|
226
|
+
console.warn('Error formatting date', error)
|
|
153
227
|
return ''
|
|
154
228
|
}
|
|
155
229
|
}
|