@bagelink/vue 1.2.124 → 1.2.128
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/DragOver.vue.d.ts +1 -0
- package/dist/components/DragOver.vue.d.ts.map +1 -1
- package/dist/components/ImportData.vue.d.ts.map +1 -1
- package/dist/components/Loading.vue.d.ts +1 -0
- package/dist/components/Loading.vue.d.ts.map +1 -1
- package/dist/components/Modal.vue.d.ts +10 -5
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/dataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/dataTable/useTableData.d.ts +10 -10
- package/dist/components/dataTable/useTableData.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts +2 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/index.cjs +324 -262
- package/dist/index.mjs +324 -262
- package/dist/style.css +136 -137
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/types/TableSchema.d.ts +1 -1
- package/dist/types/TableSchema.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts +2 -2
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/DragOver.vue +21 -0
- package/src/components/ImportData.vue +34 -33
- package/src/components/Loading.vue +58 -50
- package/src/components/Modal.vue +10 -4
- package/src/components/dataTable/DataTable.vue +5 -11
- package/src/components/dataTable/useTableData.ts +11 -10
- package/src/components/form/inputs/DatePicker.vue +9 -6
- package/src/components/form/inputs/SelectInput.vue +1 -1
- package/src/types/BagelForm.ts +2 -0
- package/src/types/TableSchema.ts +1 -1
- package/src/utils/BagelFormUtils.ts +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import type { MaybeRefOrGetter } from 'vue'
|
|
2
3
|
import type { ModeType } from '../../../utils/calendar/typings'
|
|
3
4
|
import { Btn, NumberInput } from '@bagelink/vue'
|
|
4
|
-
import { computed, ref } from 'vue'
|
|
5
|
+
import { computed, ref, toValue } from 'vue'
|
|
5
6
|
import Time, { WEEK_START_DAY } from '../../../utils/calendar/time'
|
|
6
7
|
|
|
7
8
|
const props = withDefaults(
|
|
@@ -13,7 +14,7 @@ const props = withDefaults(
|
|
|
13
14
|
firstDayOfWeek?: WEEK_START_DAY
|
|
14
15
|
locale?: string
|
|
15
16
|
enableTime?: boolean
|
|
16
|
-
highlightedDates?: (string | Date)[]
|
|
17
|
+
highlightedDates?: MaybeRefOrGetter<(string | Date)[]>
|
|
17
18
|
}>(),
|
|
18
19
|
{
|
|
19
20
|
mode: () => ({ mode: 'day' }),
|
|
@@ -25,6 +26,8 @@ const props = withDefaults(
|
|
|
25
26
|
|
|
26
27
|
const emit = defineEmits(['update:modelValue'])
|
|
27
28
|
|
|
29
|
+
const computedHighlightedDates = $computed(() => toValue(props.highlightedDates))
|
|
30
|
+
|
|
28
31
|
// State
|
|
29
32
|
const currentMonth = ref(new Date())
|
|
30
33
|
const currentView = ref('days')
|
|
@@ -161,12 +164,12 @@ function useCalendarView() {
|
|
|
161
164
|
* @param date The date to check
|
|
162
165
|
* @returns True if the date should be highlighted
|
|
163
166
|
*/
|
|
164
|
-
const isHighlighted = (date?: Date): boolean => {
|
|
165
|
-
if (!date || !Array.isArray(
|
|
167
|
+
const isHighlighted = computed(() => (date?: Date): boolean => {
|
|
168
|
+
if (!date || !Array.isArray(computedHighlightedDates) || !computedHighlightedDates.length) {
|
|
166
169
|
return false
|
|
167
170
|
}
|
|
168
171
|
|
|
169
|
-
return
|
|
172
|
+
return computedHighlightedDates.some((highlightedDate) => {
|
|
170
173
|
const parsedDate = parseDate(highlightedDate)
|
|
171
174
|
if (!parsedDate) return false
|
|
172
175
|
|
|
@@ -175,7 +178,7 @@ function useCalendarView() {
|
|
|
175
178
|
&& date.getMonth() === parsedDate.getMonth()
|
|
176
179
|
&& date.getDate() === parsedDate.getDate()
|
|
177
180
|
})
|
|
178
|
-
}
|
|
181
|
+
})
|
|
179
182
|
|
|
180
183
|
return {
|
|
181
184
|
currentMonthDays,
|
package/src/types/BagelForm.ts
CHANGED
|
@@ -31,6 +31,7 @@ export type BagelFieldOptions<T> = (
|
|
|
31
31
|
)[]
|
|
32
32
|
| ((val: any, rowData?: T) => void)
|
|
33
33
|
)
|
|
34
|
+
// TODO: ^^ replace any with a more specific type (perhaps FieldVal<T, P>)
|
|
34
35
|
|
|
35
36
|
export type VIfType<T, P extends Path<T>> = (
|
|
36
37
|
string |
|
|
@@ -53,6 +54,7 @@ export type _Path<T> = (
|
|
|
53
54
|
>
|
|
54
55
|
>
|
|
55
56
|
)
|
|
57
|
+
|
|
56
58
|
export type Path<T> = (
|
|
57
59
|
FieldVal<T, _Path<T>> extends Array<any> ?
|
|
58
60
|
LiteralStringUnion<_Path<T>> :
|
package/src/types/TableSchema.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface TableSchemaProps<T extends { [key: string]: any } = { [key: str
|
|
|
8
8
|
data: T[]
|
|
9
9
|
schema?: MaybeRefOrGetter<BglFormSchemaT<T>>
|
|
10
10
|
columns?: MaybeRefOrGetter<string[]>
|
|
11
|
-
useServerSort?:
|
|
11
|
+
useServerSort?: boolean
|
|
12
12
|
selectable?: boolean
|
|
13
13
|
onLastItemVisible?: () => void
|
|
14
14
|
}
|
|
@@ -74,7 +74,7 @@ export function txtField<T, P extends Path<T>>(
|
|
|
74
74
|
id: P,
|
|
75
75
|
label?: string,
|
|
76
76
|
options?: TextInputOptions<T, P>,
|
|
77
|
-
):
|
|
77
|
+
): InputBagelField<T, P> {
|
|
78
78
|
return {
|
|
79
79
|
$el: 'text',
|
|
80
80
|
id,
|
|
@@ -106,7 +106,7 @@ export function selectField<T, P extends Path<T>>(
|
|
|
106
106
|
label?: string,
|
|
107
107
|
options?: Option[] | (() => Option[]),
|
|
108
108
|
config?: SlctInputOptions<T, P>,
|
|
109
|
-
):
|
|
109
|
+
): SelectBagelField<T, P> {
|
|
110
110
|
return {
|
|
111
111
|
$el: 'select',
|
|
112
112
|
id,
|