@bagelink/vue 1.8.9 → 1.8.14
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/AddToCalendar.vue.d.ts +9 -12
- package/dist/components/AddToCalendar.vue.d.ts.map +1 -1
- package/dist/components/Filter.vue.d.ts +5 -4
- package/dist/components/Filter.vue.d.ts.map +1 -1
- package/dist/components/calendar/Index.vue.d.ts +1 -1
- package/dist/components/calendar/views/WeekView.vue.d.ts +1 -1
- package/dist/components/calendar/views/WeekView.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts.map +1 -1
- package/dist/index.cjs +24 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +4696 -4535
- package/dist/style.css +1 -1
- package/dist/types/BagelForm.d.ts +0 -1
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/calendar/types.d.ts +8 -0
- package/dist/utils/calendar/types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/queryFilter.d.ts +12 -8
- package/dist/utils/queryFilter.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/AddToCalendar.vue +230 -45
- package/src/components/Filter.vue +124 -112
- package/src/components/form/inputs/Upload/UploadInput.vue +10 -20
- package/src/index.ts +2 -1
- package/src/types/BagelForm.ts +61 -61
- package/src/types/index.ts +36 -35
- package/src/utils/calendar/types.ts +9 -0
- package/src/utils/index.ts +1 -1
- package/src/utils/queryFilter.ts +30 -22
package/src/types/index.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { IconType, MaterialIcons } from '../components/Icon/types'
|
|
2
|
+
|
|
1
3
|
export type {
|
|
2
4
|
ModalComponentProps,
|
|
3
5
|
ModalComponentProps as ModalFormComponentProps,
|
|
4
6
|
ModalOptions,
|
|
5
7
|
} from '../plugins/modalTypes'
|
|
6
8
|
|
|
7
|
-
import type { IconType, MaterialIcons } from '../components/Icon/types'
|
|
8
|
-
|
|
9
9
|
export type { IconType, MaterialIcons }
|
|
10
10
|
|
|
11
|
+
export type { AddToCalendarEvent } from '../utils/calendar/types'
|
|
11
12
|
export * from './BagelForm'
|
|
12
13
|
export * from './BtnOptions'
|
|
13
14
|
export type { StorageFile } from './file'
|
|
@@ -21,58 +22,58 @@ export type Tab = {
|
|
|
21
22
|
icon?: IconType
|
|
22
23
|
} | string
|
|
23
24
|
|
|
24
|
-
export type ThemeType
|
|
25
|
-
| 'blue' | 'green' | 'red' | 'yellow' | 'purple' | 'brown' | 'orange' | 'turquoise' | 'gray' | 'black' | 'pink'
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
export type ThemeType
|
|
26
|
+
= | 'blue' | 'green' | 'red' | 'yellow' | 'purple' | 'brown' | 'orange' | 'turquoise' | 'gray' | 'black' | 'pink'
|
|
27
|
+
| 'primary' | 'white'
|
|
28
|
+
| 'blue-light' | 'green-light' | 'red-light' | 'yellow-light' | 'purple-light' | 'brown-light'
|
|
29
|
+
| 'orange-light' | 'turquoise-light' | 'pink-light' | 'gray-light' | 'primary-light'
|
|
30
|
+
| 'blue-tint' | 'red-tint' | 'primary-tint' | 'black-tint' | 'blue-dark'
|
|
31
|
+
| 'light'
|
|
31
32
|
|
|
32
33
|
// Extended theme type with all percentage variations
|
|
33
|
-
export type ExtendedThemeType
|
|
34
|
+
export type ExtendedThemeType
|
|
34
35
|
// Base colors
|
|
35
|
-
| 'blue' | 'green' | 'red' | 'yellow' | 'purple' | 'brown' | 'orange' | 'turquoise' | 'gray' | 'black' | 'pink'
|
|
36
|
-
|
|
36
|
+
= | 'blue' | 'green' | 'red' | 'yellow' | 'purple' | 'brown' | 'orange' | 'turquoise' | 'gray' | 'black' | 'pink'
|
|
37
|
+
| 'primary' | 'white'
|
|
37
38
|
// Legacy light variants
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
| 'blue-light' | 'green-light' | 'red-light' | 'yellow-light' | 'purple-light' | 'brown-light'
|
|
40
|
+
| 'orange-light' | 'turquoise-light' | 'pink-light' | 'gray-light' | 'primary-light'
|
|
40
41
|
// Legacy tint variants
|
|
41
|
-
|
|
42
|
+
| 'blue-tint' | 'red-tint' | 'primary-tint' | 'black-tint' | 'blue-dark' | 'light'
|
|
42
43
|
// 10% variants (lightest)
|
|
43
|
-
|
|
44
|
+
| 'blue-10' | 'green-10' | 'red-10' | 'yellow-10' | 'purple-10' | 'brown-10' | 'orange-10' | 'turquoise-10' | 'gray-10' | 'black-10' | 'pink-10'
|
|
44
45
|
// 20% variants
|
|
45
|
-
|
|
46
|
+
| 'blue-20' | 'green-20' | 'red-20' | 'yellow-20' | 'purple-20' | 'brown-20' | 'orange-20' | 'turquoise-20' | 'gray-20' | 'black-20' | 'pink-20'
|
|
46
47
|
// 30% variants
|
|
47
|
-
|
|
48
|
+
| 'blue-30' | 'green-30' | 'red-30' | 'yellow-30' | 'purple-30' | 'brown-30' | 'orange-30' | 'turquoise-30' | 'gray-30' | 'black-30' | 'pink-30'
|
|
48
49
|
// 40% variants
|
|
49
|
-
|
|
50
|
+
| 'blue-40' | 'green-40' | 'red-40' | 'yellow-40' | 'purple-40' | 'brown-40' | 'orange-40' | 'turquoise-40' | 'gray-40' | 'black-40' | 'pink-40'
|
|
50
51
|
// 50% variants
|
|
51
|
-
|
|
52
|
+
| 'blue-50' | 'green-50' | 'red-50' | 'yellow-50' | 'purple-50' | 'brown-50' | 'orange-50' | 'turquoise-50' | 'gray-50' | 'black-50' | 'pink-50'
|
|
52
53
|
// 60% variants
|
|
53
|
-
|
|
54
|
+
| 'blue-60' | 'green-60' | 'red-60' | 'yellow-60' | 'purple-60' | 'brown-60' | 'orange-60' | 'turquoise-60' | 'gray-60' | 'black-60' | 'pink-60'
|
|
54
55
|
// 70% variants
|
|
55
|
-
|
|
56
|
+
| 'blue-70' | 'green-70' | 'red-70' | 'yellow-70' | 'purple-70' | 'brown-70' | 'orange-70' | 'turquoise-70' | 'gray-70' | 'black-70' | 'pink-70'
|
|
56
57
|
// 80% variants
|
|
57
|
-
|
|
58
|
+
| 'blue-80' | 'green-80' | 'red-80' | 'yellow-80' | 'purple-80' | 'brown-80' | 'orange-80' | 'turquoise-80' | 'gray-80' | 'black-80' | 'pink-80'
|
|
58
59
|
// 90% variants
|
|
59
|
-
|
|
60
|
+
| 'blue-90' | 'green-90' | 'red-90' | 'yellow-90' | 'purple-90' | 'brown-90' | 'orange-90' | 'turquoise-90' | 'gray-90' | 'black-90' | 'pink-90'
|
|
60
61
|
// 100% variants (same as base)
|
|
61
|
-
|
|
62
|
+
| 'blue-100' | 'green-100' | 'red-100' | 'yellow-100' | 'purple-100' | 'brown-100' | 'orange-100' | 'turquoise-100' | 'gray-100' | 'black-100' | 'pink-100'
|
|
62
63
|
// 110% variants (darker)
|
|
63
|
-
|
|
64
|
+
| 'blue-110' | 'green-110' | 'red-110' | 'yellow-110' | 'purple-110' | 'brown-110' | 'orange-110' | 'turquoise-110' | 'gray-110' | 'black-110' | 'pink-110'
|
|
64
65
|
// 120% variants
|
|
65
|
-
|
|
66
|
+
| 'blue-120' | 'green-120' | 'red-120' | 'yellow-120' | 'purple-120' | 'brown-120' | 'orange-120' | 'turquoise-120' | 'gray-120' | 'black-120' | 'pink-120'
|
|
66
67
|
// 130% variants (darkest)
|
|
67
|
-
|
|
68
|
+
| 'blue-130' | 'green-130' | 'red-130' | 'yellow-130' | 'purple-130' | 'brown-130' | 'orange-130' | 'turquoise-130' | 'gray-130' | 'black-130' | 'pink-130'
|
|
68
69
|
// Status colors
|
|
69
|
-
|
|
70
|
+
| 'Error' | 'Paid' | 'Active'
|
|
70
71
|
|
|
71
|
-
export type Option
|
|
72
|
-
| string
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
export type Option
|
|
73
|
+
= | string
|
|
74
|
+
| number
|
|
75
|
+
| boolean
|
|
76
|
+
| { [key: string]: any }
|
|
77
|
+
| { label: string, value: string | number }
|
|
77
78
|
|
|
78
79
|
export type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N
|
|
@@ -25,3 +25,12 @@ export interface EventInterface {
|
|
|
25
25
|
}
|
|
26
26
|
originalEvent?: Omit<EventInterface, 'originalEvent'>
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
export interface AddToCalendarEvent {
|
|
30
|
+
title: string
|
|
31
|
+
description?: string
|
|
32
|
+
location?: string
|
|
33
|
+
startTime: Date | string
|
|
34
|
+
endTime: Date | string
|
|
35
|
+
url?: string
|
|
36
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -204,7 +204,7 @@ export { useForm } from './BagelFormUtils'
|
|
|
204
204
|
export { useLang } from './lang'
|
|
205
205
|
|
|
206
206
|
export type { ComparisonOperator, FilterCondition, LogicalOperator, QueryConditions, QueryFilter } from './queryFilter'
|
|
207
|
-
export { anyOf, parseQuery,
|
|
207
|
+
export { anyOf, parseQuery, queryFilter, range, search } from './queryFilter'
|
|
208
208
|
export { formatString } from './strings'
|
|
209
209
|
|
|
210
210
|
const URL_REGEX = /^https?:\/\/|^\/\//
|
package/src/utils/queryFilter.ts
CHANGED
|
@@ -32,17 +32,17 @@ type DeepKeyOf<T> = T extends Primitive
|
|
|
32
32
|
/**
|
|
33
33
|
* SCIM 2.0 comparison operators
|
|
34
34
|
*/
|
|
35
|
-
export type ComparisonOperator
|
|
36
|
-
| 'eq' // equal
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
export type ComparisonOperator
|
|
36
|
+
= | 'eq' // equal
|
|
37
|
+
| 'ne' // not equal
|
|
38
|
+
| 'gt' // greater than
|
|
39
|
+
| 'ge' // greater than or equal
|
|
40
|
+
| 'lt' // less than
|
|
41
|
+
| 'le' // less than or equal
|
|
42
|
+
| 'co' // contains
|
|
43
|
+
| 'sw' // starts with
|
|
44
|
+
| 'ew' // ends with
|
|
45
|
+
| 'pr' // present (has value)
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* SCIM 2.0 logical operators
|
|
@@ -90,7 +90,7 @@ function formatValue(value: Primitive): string {
|
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
92
|
export function buildQuery<T extends Record<string, any>>(
|
|
93
|
-
conditions
|
|
93
|
+
conditions?: QueryConditions<T>
|
|
94
94
|
): string {
|
|
95
95
|
if (!conditions || conditions.length === 0) return ''
|
|
96
96
|
|
|
@@ -298,25 +298,33 @@ export class QueryFilter<T extends Record<string, any>> {
|
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
/**
|
|
301
|
-
* Build a query string from conditions
|
|
301
|
+
* Build a query string from conditions or create a chainable query builder
|
|
302
302
|
*
|
|
303
303
|
* @example
|
|
304
304
|
* ```typescript
|
|
305
305
|
* // From conditions array
|
|
306
|
-
*
|
|
306
|
+
* queryFilter<Person>([
|
|
307
307
|
* { field: 'first_name', op: 'eq', value: 'John' },
|
|
308
308
|
* { field: 'age', op: 'gt', value: 18, connector: 'and' },
|
|
309
|
-
* ])
|
|
309
|
+
* ]).build()
|
|
310
|
+
* // → 'first_name eq "John" and age gt 18'
|
|
311
|
+
*
|
|
312
|
+
* // Chainable builder
|
|
313
|
+
* queryFilter<Person>().eq('first_name', 'John').and().gt('age', 18).build()
|
|
310
314
|
* // → 'first_name eq "John" and age gt 18'
|
|
311
315
|
*
|
|
312
|
-
* // Empty returns empty
|
|
313
|
-
*
|
|
316
|
+
* // Empty returns empty builder
|
|
317
|
+
* queryFilter() // → QueryFilter instance
|
|
314
318
|
* ```
|
|
315
319
|
*/
|
|
316
|
-
export function
|
|
317
|
-
conditions
|
|
318
|
-
):
|
|
319
|
-
|
|
320
|
+
export function queryFilter<T extends Record<string, any>>(
|
|
321
|
+
conditions?: QueryConditions<T>
|
|
322
|
+
): QueryFilter<T> {
|
|
323
|
+
const builder = new QueryFilter<T>()
|
|
324
|
+
if (conditions && conditions.length > 0) {
|
|
325
|
+
builder.raw(buildQuery(conditions))
|
|
326
|
+
}
|
|
327
|
+
return builder
|
|
320
328
|
}
|
|
321
329
|
|
|
322
330
|
/**
|
|
@@ -401,7 +409,7 @@ function parseValue(valueStr: string): Primitive {
|
|
|
401
409
|
* ```
|
|
402
410
|
*/
|
|
403
411
|
export function parseQuery<T extends Record<string, any> = Record<string, any>>(
|
|
404
|
-
queryString
|
|
412
|
+
queryString?: string
|
|
405
413
|
): QueryConditions<T> {
|
|
406
414
|
if (!queryString || !queryString.trim()) return []
|
|
407
415
|
|