sprintify-ui 0.2.0 → 0.2.3
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/README.md +16 -0
- package/dist/sprintify-ui.es.js +4984 -4707
- package/dist/style.css +1 -1
- package/dist/types/src/components/BaseDatePicker.vue.d.ts +0 -1
- package/dist/types/src/components/BasePWAPrompt.vue.d.ts +46 -0
- package/dist/types/src/components/index.d.ts +4 -1
- package/dist/types/src/index.d.ts +10 -0
- package/package.json +2 -4
- package/src/assets/flatpickr.css +238 -0
- package/src/assets/main.css +4 -3
- package/src/components/BaseActionItem.vue +9 -4
- package/src/components/BaseActionItemButton.vue +1 -1
- package/src/components/BaseAddressForm.vue +6 -5
- package/src/components/BaseAlert.vue +8 -2
- package/src/components/BaseAppNotifications.vue +4 -1
- package/src/components/BaseAutocomplete.vue +18 -9
- package/src/components/BaseAutocompleteDrawer.vue +28 -10
- package/src/components/BaseAutocompleteFetch.vue +14 -3
- package/src/components/BaseAvatar.vue +1 -1
- package/src/components/BaseBadge.vue +1 -2
- package/src/components/BaseBelongsTo.vue +12 -3
- package/src/components/BaseBreadcrumbs.vue +8 -2
- package/src/components/BaseButton.vue +9 -2
- package/src/components/BaseButtonGroup.vue +4 -1
- package/src/components/BaseCharacterCounter.vue +4 -1
- package/src/components/BaseClickOutside.vue +1 -1
- package/src/components/BaseClipboard.vue +5 -2
- package/src/components/BaseColor.vue +4 -1
- package/src/components/BaseCropper.vue +17 -5
- package/src/components/BaseCropperModal.vue +4 -1
- package/src/components/BaseDataIterator.vue +29 -11
- package/src/components/BaseDataIteratorSectionBox.vue +5 -2
- package/src/components/BaseDataIteratorSectionButton.vue +6 -4
- package/src/components/BaseDataIteratorSectionColumns.vue +5 -2
- package/src/components/BaseDataTable.vue +43 -20
- package/src/components/BaseDataTableRowAction.vue +8 -2
- package/src/components/BaseDatePicker.vue +9 -102
- package/src/components/BaseDateSelect.vue +33 -6
- package/src/components/BaseDisplayRelativeTime.vue +4 -1
- package/src/components/BaseDraggable.vue +1 -1
- package/src/components/BaseDropdown.vue +16 -5
- package/src/components/BaseDropdownAutocomplete.vue +8 -4
- package/src/components/BaseField.vue +5 -2
- package/src/components/BaseFieldI18n.vue +10 -2
- package/src/components/BaseFilePicker.vue +6 -2
- package/src/components/BaseFilePickerCrop.vue +4 -1
- package/src/components/BaseForm.vue +9 -2
- package/src/components/BaseHasMany.vue +16 -4
- package/src/components/BaseHeader.vue +4 -1
- package/src/components/BaseIconPicker.vue +14 -4
- package/src/components/BaseInput.vue +10 -7
- package/src/components/BaseInputError.vue +1 -1
- package/src/components/BaseInputLabel.vue +4 -1
- package/src/components/BaseInputPercent.vue +1 -1
- package/src/components/BaseLayoutNotificationDropdown.vue +11 -5
- package/src/components/BaseLayoutNotificationItem.vue +15 -5
- package/src/components/BaseLayoutNotificationItemContent.vue +5 -2
- package/src/components/BaseLayoutSidebar.vue +22 -5
- package/src/components/BaseLayoutSidebarConfigurable.vue +19 -5
- package/src/components/BaseLayoutStackedConfigurable.vue +24 -7
- package/src/components/BaseMediaGallery.vue +4 -1
- package/src/components/BaseMediaGalleryItem.vue +13 -4
- package/src/components/BaseMediaItem.vue +12 -3
- package/src/components/BaseMediaLibrary.vue +10 -5
- package/src/components/BaseMediaList.vue +1 -1
- package/src/components/BaseMediaListItem.vue +15 -6
- package/src/components/BaseMediaPictures.vue +1 -1
- package/src/components/BaseMediaPicturesItem.vue +9 -3
- package/src/components/BaseMediaPreview.vue +2 -2
- package/src/components/BaseMenu.vue +37 -9
- package/src/components/BaseMenuItem.vue +14 -3
- package/src/components/BaseModalCenter.vue +4 -1
- package/src/components/BaseNavbarItemContent.vue +14 -3
- package/src/components/BaseNavbarSideItem.vue +4 -1
- package/src/components/BaseNavbarSideItemContent.vue +9 -2
- package/src/components/BaseNumber.vue +7 -4
- package/src/components/BasePWAPrompt.stories.js +51 -0
- package/src/components/BasePWAPrompt.vue +107 -0
- package/src/components/BasePagination.vue +2 -2
- package/src/components/BasePanel.vue +4 -1
- package/src/components/BasePassword.vue +6 -2
- package/src/components/BaseProgressCircle.vue +4 -1
- package/src/components/BaseRadioGroup.vue +5 -2
- package/src/components/BaseRichText.vue +1 -2
- package/src/components/BaseSelect.vue +6 -2
- package/src/components/BaseShortcut.vue +11 -4
- package/src/components/BaseSideNavigation.vue +4 -1
- package/src/components/BaseSideNavigationItem.vue +5 -2
- package/src/components/BaseSkeleton.vue +2 -2
- package/src/components/BaseStatistic.vue +15 -4
- package/src/components/BaseStepper.vue +4 -1
- package/src/components/BaseSwitch.stories.js +0 -1
- package/src/components/BaseSwitch.vue +8 -2
- package/src/components/BaseSystemAlert.vue +4 -1
- package/src/components/BaseTabItem.vue +5 -2
- package/src/components/BaseTable.vue +19 -9
- package/src/components/BaseTagAutocomplete.vue +13 -4
- package/src/components/BaseTagAutocompleteFetch.vue +18 -4
- package/src/components/BaseTextareaAutoresize.vue +6 -2
- package/src/components/BaseTimeline.vue +8 -2
- package/src/components/index.ts +6 -0
- package/src/lang/en.json +5 -0
- package/src/lang/fr.json +5 -0
- package/src/svg/BaseEmptyState.vue +5 -1
- package/src/svg/BaseSpinnerLarge.vue +15 -3
- package/src/svg/BaseSpinnerSmall.vue +8 -2
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
v-bind="shared"
|
|
13
13
|
/>
|
|
14
14
|
|
|
15
|
-
<div
|
|
15
|
+
<div
|
|
16
|
+
ref="container"
|
|
17
|
+
class="base-cropper-wrapper relative"
|
|
18
|
+
>
|
|
16
19
|
<div
|
|
17
20
|
:style="{
|
|
18
21
|
width: cropperConfiguration?.boundary?.width + 'px',
|
|
@@ -47,7 +50,10 @@
|
|
|
47
50
|
class="border-r border-slate-300 bg-white px-3 py-1.5 hover:bg-slate-100"
|
|
48
51
|
@click="rotateLeft"
|
|
49
52
|
>
|
|
50
|
-
<BaseIcon
|
|
53
|
+
<BaseIcon
|
|
54
|
+
icon="mdi:rotate-left"
|
|
55
|
+
class="h-4 w-4"
|
|
56
|
+
/>
|
|
51
57
|
</button>
|
|
52
58
|
<button
|
|
53
59
|
type="button"
|
|
@@ -55,7 +61,10 @@
|
|
|
55
61
|
class="bg-white px-3 py-1.5 hover:bg-slate-100"
|
|
56
62
|
@click="rotateRight"
|
|
57
63
|
>
|
|
58
|
-
<BaseIcon
|
|
64
|
+
<BaseIcon
|
|
65
|
+
icon="mdi:rotate-right"
|
|
66
|
+
class="h-4 w-4"
|
|
67
|
+
/>
|
|
59
68
|
</button>
|
|
60
69
|
</div>
|
|
61
70
|
</div>
|
|
@@ -67,7 +76,10 @@
|
|
|
67
76
|
<div
|
|
68
77
|
class="flex items-center rounded-lg bg-black bg-opacity-75 px-3 py-1.5 text-center text-white"
|
|
69
78
|
>
|
|
70
|
-
<BaseIcon
|
|
79
|
+
<BaseIcon
|
|
80
|
+
icon="ri:drag-move-2-fill"
|
|
81
|
+
class="mr-1 h-5 w-5"
|
|
82
|
+
/>
|
|
71
83
|
<span>
|
|
72
84
|
{{ t('drag_to_reposition') }}
|
|
73
85
|
</span>
|
|
@@ -78,7 +90,7 @@
|
|
|
78
90
|
:delay="40"
|
|
79
91
|
class="z-[1]"
|
|
80
92
|
:model-value="initializing"
|
|
81
|
-
|
|
93
|
+
/>
|
|
82
94
|
</div>
|
|
83
95
|
|
|
84
96
|
<slot
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
:max-width="cropperSize + 'px'"
|
|
6
6
|
@update:model-value="$emit('update:modelValue', $event)"
|
|
7
7
|
>
|
|
8
|
-
<div
|
|
8
|
+
<div
|
|
9
|
+
v-if="ready"
|
|
10
|
+
class="flex items-center justify-center"
|
|
11
|
+
>
|
|
9
12
|
<BaseCropper
|
|
10
13
|
v-if="cropperInternal.source"
|
|
11
14
|
ref="baseCropperRef"
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
<!-- Header -->
|
|
14
14
|
<div class="mb-4 flex space-x-2 empty:mb-0">
|
|
15
15
|
<!-- Search bar -->
|
|
16
|
-
<div
|
|
16
|
+
<div
|
|
17
|
+
v-if="searchable"
|
|
18
|
+
class="grow"
|
|
19
|
+
>
|
|
17
20
|
<div class="relative h-11">
|
|
18
21
|
<div
|
|
19
22
|
class="pointer-events-none absolute left-0 top-0 flex h-full items-center justify-center pl-2.5"
|
|
@@ -30,7 +33,7 @@
|
|
|
30
33
|
class="h-11 w-full overflow-hidden rounded-md border border-slate-300 bg-white pl-10 pr-9 shadow-sm"
|
|
31
34
|
:placeholder="t('sui.autocomplete_placeholder')"
|
|
32
35
|
@input="onSearch"
|
|
33
|
-
|
|
36
|
+
>
|
|
34
37
|
<div
|
|
35
38
|
v-if="searchQuery"
|
|
36
39
|
class="absolute right-0 top-0 flex h-full items-center justify-center p-1"
|
|
@@ -60,8 +63,7 @@
|
|
|
60
63
|
<BaseDataIteratorSectionButton
|
|
61
64
|
:section="section"
|
|
62
65
|
@open="openSection(i)"
|
|
63
|
-
|
|
64
|
-
</BaseDataIteratorSectionButton>
|
|
66
|
+
/>
|
|
65
67
|
</template>
|
|
66
68
|
</template>
|
|
67
69
|
|
|
@@ -98,7 +100,10 @@
|
|
|
98
100
|
|
|
99
101
|
<!-- Pagination -->
|
|
100
102
|
|
|
101
|
-
<div
|
|
103
|
+
<div
|
|
104
|
+
v-if="paginationMetadata"
|
|
105
|
+
class="mt-4"
|
|
106
|
+
>
|
|
102
107
|
<p
|
|
103
108
|
class="text-center text-sm text-slate-500 sm:text-right [&>b]:font-medium [&>b]:text-slate-600"
|
|
104
109
|
>
|
|
@@ -112,7 +117,10 @@
|
|
|
112
117
|
</p>
|
|
113
118
|
</div>
|
|
114
119
|
|
|
115
|
-
<div
|
|
120
|
+
<div
|
|
121
|
+
v-if="paginationMetadata"
|
|
122
|
+
class="mt-4"
|
|
123
|
+
>
|
|
116
124
|
<BasePagination
|
|
117
125
|
:model-value="page"
|
|
118
126
|
:last-page="lastPage"
|
|
@@ -121,13 +129,20 @@
|
|
|
121
129
|
</div>
|
|
122
130
|
</div>
|
|
123
131
|
|
|
124
|
-
<div
|
|
132
|
+
<div
|
|
133
|
+
v-if="!compactLayout"
|
|
134
|
+
ref="sidebar"
|
|
135
|
+
class="space-y-3"
|
|
136
|
+
>
|
|
125
137
|
<slot
|
|
126
138
|
name="sidebarTop"
|
|
127
139
|
:pagination-metadata="paginationMetadata"
|
|
128
|
-
|
|
140
|
+
/>
|
|
129
141
|
|
|
130
|
-
<template
|
|
142
|
+
<template
|
|
143
|
+
v-for="section in sectionsInternal"
|
|
144
|
+
:key="section.name"
|
|
145
|
+
>
|
|
131
146
|
<BaseDataIteratorSectionBox :section="section">
|
|
132
147
|
<slot
|
|
133
148
|
:name="section.name"
|
|
@@ -141,11 +156,14 @@
|
|
|
141
156
|
<slot
|
|
142
157
|
name="sidebarBottom"
|
|
143
158
|
:pagination-metadata="paginationMetadata"
|
|
144
|
-
|
|
159
|
+
/>
|
|
145
160
|
</div>
|
|
146
161
|
</div>
|
|
147
162
|
|
|
148
|
-
<template
|
|
163
|
+
<template
|
|
164
|
+
v-for="(section, i) in sectionsInternal"
|
|
165
|
+
:key="section.name"
|
|
166
|
+
>
|
|
149
167
|
<BaseDataIteratorSectionModal
|
|
150
168
|
:section="section"
|
|
151
169
|
:model-value="sectionModalActive == i"
|
|
@@ -13,9 +13,12 @@
|
|
|
13
13
|
class="h-5 w-5 text-slate-500 duration-300"
|
|
14
14
|
:class="active ? 'rotate-90 transform' : ''"
|
|
15
15
|
icon="heroicons:chevron-right-20-solid"
|
|
16
|
-
|
|
16
|
+
/>
|
|
17
17
|
</button>
|
|
18
|
-
<div
|
|
18
|
+
<div
|
|
19
|
+
v-show="active"
|
|
20
|
+
class="border-t border-slate-300 py-5 px-4"
|
|
21
|
+
>
|
|
19
22
|
<slot />
|
|
20
23
|
</div>
|
|
21
24
|
</BaseCard>
|
|
@@ -5,17 +5,19 @@
|
|
|
5
5
|
type="button"
|
|
6
6
|
@click="open()"
|
|
7
7
|
>
|
|
8
|
-
<BaseIcon
|
|
8
|
+
<BaseIcon
|
|
9
|
+
class="h-5 w-5 text-slate-500"
|
|
10
|
+
:icon="section.icon"
|
|
11
|
+
/>
|
|
9
12
|
<span
|
|
10
13
|
v-if="section.title && width > 600"
|
|
11
14
|
class="ml-2 whitespace-pre text-sm"
|
|
12
|
-
|
|
13
|
-
>
|
|
15
|
+
>{{ section.title }}</span>
|
|
14
16
|
<BaseBadge
|
|
15
17
|
v-if="section.count"
|
|
16
18
|
class="ml-2"
|
|
17
19
|
:label="section.count"
|
|
18
|
-
|
|
20
|
+
/>
|
|
19
21
|
</button>
|
|
20
22
|
</template>
|
|
21
23
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ul>
|
|
3
|
-
<li
|
|
3
|
+
<li
|
|
4
|
+
v-for="col in toggleableColumns"
|
|
5
|
+
:key="col.newKey"
|
|
6
|
+
>
|
|
4
7
|
<label class="cursor-pointer">
|
|
5
8
|
<input
|
|
6
9
|
:checked="visibleColumns.includes(col.newKey)"
|
|
@@ -8,7 +11,7 @@
|
|
|
8
11
|
class="mr-2 h-3.5 w-3.5 cursor-pointer rounded focus:ring-1 focus:ring-primary-300 focus:ring-offset-1"
|
|
9
12
|
:value="col.newKey"
|
|
10
13
|
@change="onVisibleColumnChange($event, col.newKey)"
|
|
11
|
-
|
|
14
|
+
>
|
|
12
15
|
<span class="text-xs text-slate-700">
|
|
13
16
|
{{ col.label }}
|
|
14
17
|
</span>
|
|
@@ -24,19 +24,20 @@
|
|
|
24
24
|
firstLoad,
|
|
25
25
|
}"
|
|
26
26
|
>
|
|
27
|
-
<BaseCard
|
|
27
|
+
<BaseCard
|
|
28
|
+
clipped
|
|
29
|
+
class="w-full overflow-hidden"
|
|
30
|
+
>
|
|
28
31
|
<div v-if="newCheckedRows.length">
|
|
29
32
|
<div
|
|
30
33
|
class="flex items-center justify-between border-b border-slate-200 bg-slate-50 py-2 pl-3 pr-2 text-sm"
|
|
31
34
|
>
|
|
32
35
|
<div>
|
|
33
|
-
<span class="mr-3 text-slate-500"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}}.</span
|
|
39
|
-
>
|
|
36
|
+
<span class="mr-3 text-slate-500">{{
|
|
37
|
+
t('sui.x_rows_selected', {
|
|
38
|
+
count: newCheckedRows.length,
|
|
39
|
+
})
|
|
40
|
+
}}.</span>
|
|
40
41
|
<button
|
|
41
42
|
type="button"
|
|
42
43
|
class="mr-3 inline text-slate-700 underline"
|
|
@@ -102,7 +103,7 @@
|
|
|
102
103
|
<BaseDataTableRowAction
|
|
103
104
|
:row="row"
|
|
104
105
|
:row-action="rowAction"
|
|
105
|
-
|
|
106
|
+
/>
|
|
106
107
|
</template>
|
|
107
108
|
<BaseMenu
|
|
108
109
|
v-if="showRowActionMenu"
|
|
@@ -120,15 +121,24 @@
|
|
|
120
121
|
</template>
|
|
121
122
|
|
|
122
123
|
<template #detail="propsDetail">
|
|
123
|
-
<slot
|
|
124
|
+
<slot
|
|
125
|
+
name="detail"
|
|
126
|
+
v-bind="propsDetail"
|
|
127
|
+
/>
|
|
124
128
|
</template>
|
|
125
129
|
|
|
126
130
|
<template #checkedHeader="propsCheckHeader">
|
|
127
|
-
<slot
|
|
131
|
+
<slot
|
|
132
|
+
name="checkedHeader"
|
|
133
|
+
v-bind="propsCheckHeader"
|
|
134
|
+
/>
|
|
128
135
|
</template>
|
|
129
136
|
|
|
130
137
|
<template #empty>
|
|
131
|
-
<div
|
|
138
|
+
<div
|
|
139
|
+
v-if="error"
|
|
140
|
+
class="flex items-center justify-center py-16"
|
|
141
|
+
>
|
|
132
142
|
<div class="flex flex-col items-center justify-center">
|
|
133
143
|
<BaseIcon
|
|
134
144
|
icon="heroicons:x-circle"
|
|
@@ -144,7 +154,7 @@
|
|
|
144
154
|
class="flex items-center justify-center py-16"
|
|
145
155
|
>
|
|
146
156
|
<div class="flex flex-col items-center">
|
|
147
|
-
<BaseEmptyState class="w-32"
|
|
157
|
+
<BaseEmptyState class="w-32" />
|
|
148
158
|
|
|
149
159
|
<p class="mt-3 text-center text-sm text-slate-600">
|
|
150
160
|
{{ t('sui.nothing_found') }}
|
|
@@ -169,22 +179,35 @@
|
|
|
169
179
|
</template>
|
|
170
180
|
|
|
171
181
|
<template #sidebarTop="sidebarProps">
|
|
172
|
-
<slot
|
|
182
|
+
<slot
|
|
183
|
+
name="sidebarTop"
|
|
184
|
+
v-bind="sidebarProps"
|
|
185
|
+
/>
|
|
173
186
|
</template>
|
|
174
187
|
|
|
175
188
|
<template #sidebarBottom="sidebarProps">
|
|
176
|
-
<slot
|
|
189
|
+
<slot
|
|
190
|
+
name="sidebarBottom"
|
|
191
|
+
v-bind="sidebarProps"
|
|
192
|
+
/>
|
|
177
193
|
</template>
|
|
178
194
|
|
|
179
|
-
<template
|
|
195
|
+
<template
|
|
196
|
+
v-if="toggleable"
|
|
197
|
+
#columns
|
|
198
|
+
>
|
|
180
199
|
<BaseDataIteratorSectionColumns
|
|
181
200
|
v-model:visibleColumns="visibleColumns"
|
|
182
201
|
:table="table"
|
|
183
202
|
@update:visible-columns="onUpdateVisibleColumn"
|
|
184
|
-
|
|
203
|
+
/>
|
|
185
204
|
</template>
|
|
186
205
|
|
|
187
|
-
<template
|
|
206
|
+
<template
|
|
207
|
+
v-for="section in sections"
|
|
208
|
+
:key="section.name"
|
|
209
|
+
#[section.name]
|
|
210
|
+
>
|
|
188
211
|
<slot :name="section.name" />
|
|
189
212
|
</template>
|
|
190
213
|
</BaseDataIterator>
|
|
@@ -607,8 +630,8 @@ function rowActionMenuItems(row: CollectionItem): MenuItemInterface[] {
|
|
|
607
630
|
disabled: action.disabled && action.disabled(row),
|
|
608
631
|
action: action.action
|
|
609
632
|
? () => {
|
|
610
|
-
|
|
611
|
-
|
|
633
|
+
if (action.action) action.action(row);
|
|
634
|
+
}
|
|
612
635
|
: undefined,
|
|
613
636
|
to: action.to ? action.to(row) : undefined,
|
|
614
637
|
};
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
:disabled="rowAction.disabled && rowAction.disabled(row)"
|
|
7
7
|
@click="rowAction.action ? rowAction.action(row) : null"
|
|
8
8
|
>
|
|
9
|
-
<BaseIcon
|
|
9
|
+
<BaseIcon
|
|
10
|
+
:icon="rowAction.icon"
|
|
11
|
+
class="text-slate-500"
|
|
12
|
+
/>
|
|
10
13
|
</button>
|
|
11
14
|
<RouterLink
|
|
12
15
|
v-else-if="rowAction.to"
|
|
@@ -14,7 +17,10 @@
|
|
|
14
17
|
:disabled="rowAction.disabled && rowAction.disabled(row)"
|
|
15
18
|
class="btn btn-white border border-slate-300 p-2 shadow-sm hover:bg-slate-100"
|
|
16
19
|
>
|
|
17
|
-
<BaseIcon
|
|
20
|
+
<BaseIcon
|
|
21
|
+
:icon="rowAction.icon"
|
|
22
|
+
class="text-slate-500"
|
|
23
|
+
/>
|
|
18
24
|
</RouterLink>
|
|
19
25
|
</template>
|
|
20
26
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="relative">
|
|
3
3
|
<div
|
|
4
4
|
class="pointer-events-none absolute top-0 left-0 flex h-[42px] items-center justify-center pl-2.5"
|
|
5
5
|
>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
class="flatpickr w-full rounded pl-10 pr-16 disabled:cursor-not-allowed disabled:text-slate-300"
|
|
17
17
|
:class="[hasErrorInternal ? 'border-red-500' : 'border-slate-300']"
|
|
18
18
|
:placeholder="t('sui.click_or_select_date')"
|
|
19
|
-
|
|
19
|
+
>
|
|
20
20
|
<div
|
|
21
21
|
v-if="modelValueFormatted && !disabled"
|
|
22
22
|
class="absolute right-0 top-0 flex h-[42px] items-center justify-center p-1"
|
|
@@ -26,7 +26,10 @@
|
|
|
26
26
|
class="flex items-center rounded p-1.5 hover:bg-slate-100"
|
|
27
27
|
@click="clear()"
|
|
28
28
|
>
|
|
29
|
-
<BaseIcon
|
|
29
|
+
<BaseIcon
|
|
30
|
+
class="h-5 w-5 text-slate-600"
|
|
31
|
+
icon="heroicons:x-mark"
|
|
32
|
+
/>
|
|
30
33
|
</button>
|
|
31
34
|
</div>
|
|
32
35
|
</div>
|
|
@@ -39,7 +42,6 @@ import { DateTime } from 'luxon';
|
|
|
39
42
|
import { Icon as BaseIcon } from '@iconify/vue';
|
|
40
43
|
import { useField } from '@/composables/field';
|
|
41
44
|
import flatpickr from 'flatpickr';
|
|
42
|
-
import 'flatpickr/dist/flatpickr.css';
|
|
43
45
|
|
|
44
46
|
import { t } from '@/i18n';
|
|
45
47
|
import { French } from 'flatpickr/dist/l10n/fr';
|
|
@@ -157,6 +159,7 @@ const flatpickrConfig = computed(() => {
|
|
|
157
159
|
dateFormat: formatInternal.value,
|
|
158
160
|
mode: props.mode,
|
|
159
161
|
locale: locale.value,
|
|
162
|
+
monthSelectorType: 'static',
|
|
160
163
|
minDate: props.minDate ?? undefined,
|
|
161
164
|
maxDate: props.maxDate ?? undefined,
|
|
162
165
|
noCalendar: props.noCalendar,
|
|
@@ -164,6 +167,8 @@ const flatpickrConfig = computed(() => {
|
|
|
164
167
|
inline: props.inline,
|
|
165
168
|
animate: false,
|
|
166
169
|
time_24hr: true,
|
|
170
|
+
prevArrow: '<svg class="fill-current" width="7" height="11" viewBox="0 0 7 11"><path d="M5.4 10.8l1.4-1.4-4-4 4-4L5.4 0 0 5.4z" /></svg>',
|
|
171
|
+
nextArrow: '<svg class="fill-current" width="7" height="11" viewBox="0 0 7 11"><path d="M1.4 10.8L0 9.4l4-4-4-4L1.4 0l5.4 5.4z" /></svg>',
|
|
167
172
|
} as any;
|
|
168
173
|
});
|
|
169
174
|
|
|
@@ -274,101 +279,3 @@ function clear() {
|
|
|
274
279
|
emitUpdate(null);
|
|
275
280
|
}
|
|
276
281
|
</script>
|
|
277
|
-
|
|
278
|
-
<style lang="postcss">
|
|
279
|
-
body .flatpickr-calendar {
|
|
280
|
-
width: 280px;
|
|
281
|
-
box-shadow: 1px 0 0 #cbd5e1, -1px 0 0 #cbd5e1, 0 1px 0 #cbd5e1,
|
|
282
|
-
0 -1px 0 #cbd5e1, 0 3px 13px rgb(0 0 0 / 10%);
|
|
283
|
-
|
|
284
|
-
&.inline {
|
|
285
|
-
width: 260px;
|
|
286
|
-
box-shadow: none;
|
|
287
|
-
border: none;
|
|
288
|
-
padding: 0;
|
|
289
|
-
|
|
290
|
-
.flatpickr-months {
|
|
291
|
-
width: 260px;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
.flatpickr-innerContainer {
|
|
295
|
-
padding: 0;
|
|
296
|
-
width: 260px;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.dayContainer {
|
|
301
|
-
width: 260px;
|
|
302
|
-
max-width: 260px;
|
|
303
|
-
min-width: 260px;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.flatpickr-day {
|
|
307
|
-
height: 36px;
|
|
308
|
-
line-height: 36px;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.flatpickr-months {
|
|
312
|
-
width: 280px;
|
|
313
|
-
padding-top: 10px;
|
|
314
|
-
|
|
315
|
-
.flatpickr-prev-month,
|
|
316
|
-
.flatpickr-next-month {
|
|
317
|
-
top: 5px;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.flatpickr-prev-month {
|
|
321
|
-
left: 2px;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.flatpickr-next-month {
|
|
325
|
-
right: 2px;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.flatpickr-prev-month:hover svg,
|
|
329
|
-
.flatpickr-next-month:hover svg {
|
|
330
|
-
fill: #888;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.flatpickr-current-month {
|
|
335
|
-
padding-top: 1px;
|
|
336
|
-
|
|
337
|
-
.flatpickr-monthDropdown-months {
|
|
338
|
-
font-weight: 400;
|
|
339
|
-
height: 25px;
|
|
340
|
-
&:focus {
|
|
341
|
-
box-shadow: none;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
input.cur-year {
|
|
346
|
-
font-weight: 400;
|
|
347
|
-
height: 25px;
|
|
348
|
-
&:focus {
|
|
349
|
-
box-shadow: none;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.flatpickr-innerContainer {
|
|
355
|
-
padding: 10px;
|
|
356
|
-
padding-top: 0;
|
|
357
|
-
width: 280px;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.flatpickr-rContainer {
|
|
361
|
-
width: 260px;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
.numInput {
|
|
365
|
-
&:focus {
|
|
366
|
-
box-shadow: none;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
.flatpickr-calendar span.flatpickr-weekday {
|
|
372
|
-
@apply font-medium text-slate-400;
|
|
373
|
-
}
|
|
374
|
-
</style>
|
|
@@ -17,10 +17,19 @@
|
|
|
17
17
|
:placeholder="t('sui.year')"
|
|
18
18
|
@change="update()"
|
|
19
19
|
>
|
|
20
|
-
<option
|
|
20
|
+
<option
|
|
21
|
+
disabled
|
|
22
|
+
selected
|
|
23
|
+
hidden
|
|
24
|
+
:value="null"
|
|
25
|
+
>
|
|
21
26
|
{{ t('sui.year') }}
|
|
22
27
|
</option>
|
|
23
|
-
<option
|
|
28
|
+
<option
|
|
29
|
+
v-for="year in years"
|
|
30
|
+
:key="year"
|
|
31
|
+
:value="year"
|
|
32
|
+
>
|
|
24
33
|
{{ year }}
|
|
25
34
|
</option>
|
|
26
35
|
</select>
|
|
@@ -42,10 +51,19 @@
|
|
|
42
51
|
:placeholder="t('sui.month')"
|
|
43
52
|
@change="update()"
|
|
44
53
|
>
|
|
45
|
-
<option
|
|
54
|
+
<option
|
|
55
|
+
disabled
|
|
56
|
+
selected
|
|
57
|
+
hidden
|
|
58
|
+
:value="null"
|
|
59
|
+
>
|
|
46
60
|
{{ t('sui.month') }}
|
|
47
61
|
</option>
|
|
48
|
-
<option
|
|
62
|
+
<option
|
|
63
|
+
v-for="(month, i) in months"
|
|
64
|
+
:key="month"
|
|
65
|
+
:value="i + 1"
|
|
66
|
+
>
|
|
49
67
|
{{ month }}
|
|
50
68
|
</option>
|
|
51
69
|
</select>
|
|
@@ -67,10 +85,19 @@
|
|
|
67
85
|
:placeholder="t('sui.day')"
|
|
68
86
|
@change="update()"
|
|
69
87
|
>
|
|
70
|
-
<option
|
|
88
|
+
<option
|
|
89
|
+
disabled
|
|
90
|
+
selected
|
|
91
|
+
hidden
|
|
92
|
+
:value="null"
|
|
93
|
+
>
|
|
71
94
|
{{ t('sui.day') }}
|
|
72
95
|
</option>
|
|
73
|
-
<option
|
|
96
|
+
<option
|
|
97
|
+
v-for="day in days"
|
|
98
|
+
:key="day"
|
|
99
|
+
:value="day"
|
|
100
|
+
>
|
|
74
101
|
{{ day }}
|
|
75
102
|
</option>
|
|
76
103
|
</select>
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
:data-microtip-size="showTooltip ? tooltipSize : undefined"
|
|
7
7
|
:role="showTooltip ? 'tooltip' : undefined"
|
|
8
8
|
>
|
|
9
|
-
<slot
|
|
9
|
+
<slot
|
|
10
|
+
name="default"
|
|
11
|
+
:readable-date="readableDate"
|
|
12
|
+
>
|
|
10
13
|
<span class="text-xs text-slate-600">
|
|
11
14
|
{{ readableDate }}
|
|
12
15
|
</span>
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<button
|
|
4
|
-
|
|
3
|
+
<button
|
|
4
|
+
ref="button"
|
|
5
|
+
type="button"
|
|
6
|
+
@click="toggle()"
|
|
7
|
+
>
|
|
8
|
+
<slot name="button" />
|
|
5
9
|
</button>
|
|
6
10
|
<Teleport to="body">
|
|
7
|
-
<div
|
|
11
|
+
<div
|
|
12
|
+
ref="dropdown"
|
|
13
|
+
class="z-menu"
|
|
14
|
+
:style="dropdownStyles"
|
|
15
|
+
>
|
|
8
16
|
<Transition
|
|
9
17
|
:enter-active-class="
|
|
10
18
|
animated ? 'transition duration-200 ease-out' : ''
|
|
@@ -16,14 +24,17 @@
|
|
|
16
24
|
leave-to-class="transform scale-95 opacity-0"
|
|
17
25
|
>
|
|
18
26
|
<template v-if="showDropdown || keepAlive">
|
|
19
|
-
<div
|
|
27
|
+
<div
|
|
28
|
+
v-show="showDropdown"
|
|
29
|
+
class="inline-block"
|
|
30
|
+
>
|
|
20
31
|
<slot
|
|
21
32
|
name="dropdown"
|
|
22
33
|
:show-dropdown="showDropdown"
|
|
23
34
|
:close="close"
|
|
24
35
|
:open="open"
|
|
25
36
|
:toggle="toggle"
|
|
26
|
-
|
|
37
|
+
/>
|
|
27
38
|
</div>
|
|
28
39
|
</template>
|
|
29
40
|
</Transition>
|