@bagelink/vue 1.9.192 → 1.10.1
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/AddressSearch.vue.d.ts.map +1 -1
- package/dist/components/Pagination.vue.d.ts +1 -1
- package/dist/components/Pagination.vue.d.ts.map +1 -1
- package/dist/components/Swiper.vue.d.ts +3 -9
- package/dist/components/Swiper.vue.d.ts.map +1 -1
- package/dist/components/calendar/CalendarPopover.vue.d.ts.map +1 -1
- package/dist/components/form/FieldArray.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/upload.d.ts +1 -1
- package/dist/form-flow/FormFlow.vue.d.ts.map +1 -1
- package/dist/form-flow/MultiStepForm.vue.d.ts +2 -2
- package/dist/form-flow/form-flow.d.ts.map +1 -1
- package/dist/index.cjs +98 -98
- package/dist/index.mjs +17079 -17812
- package/dist/plugins/bagel.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/calendar/dateUtils.d.ts +3 -72
- package/dist/utils/calendar/dateUtils.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/form-flow/FormFlow.vue +5 -4
- package/src/form-flow/form-flow.ts +3 -5
- package/src/plugins/bagel.ts +13 -0
- package/src/types/index.ts +0 -1
- package/src/utils/calendar/dateUtils.ts +42 -374
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export * from './BagelForm';
|
|
|
6
6
|
export * from './BtnOptions';
|
|
7
7
|
export type { StorageFile } from './file';
|
|
8
8
|
export type { NavLink } from './NavLink';
|
|
9
|
-
export type { Tables, TableToTypeMapping } from '../../../sdk/src/index.ts';
|
|
10
9
|
export type Tab = {
|
|
11
10
|
label: string;
|
|
12
11
|
value: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"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MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAClB;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAA;AAEnD,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA"}
|
|
@@ -1,78 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Day?: number;
|
|
5
|
-
Hour?: number;
|
|
6
|
-
Minute?: number;
|
|
7
|
-
Second?: number;
|
|
8
|
-
Week?: number;
|
|
9
|
-
Month?: number;
|
|
10
|
-
Year?: number;
|
|
11
|
-
days?: number;
|
|
12
|
-
hours?: number;
|
|
13
|
-
minutes?: number;
|
|
14
|
-
seconds?: number;
|
|
15
|
-
weeks?: number;
|
|
16
|
-
months?: number;
|
|
17
|
-
years?: number;
|
|
18
|
-
day?: number;
|
|
19
|
-
hour?: number;
|
|
20
|
-
minute?: number;
|
|
21
|
-
second?: number;
|
|
22
|
-
week?: number;
|
|
23
|
-
month?: number;
|
|
24
|
-
year?: number;
|
|
25
|
-
}
|
|
26
|
-
export declare function timeDelta(date: string | Date, options: TimeDeltaOptions): Date;
|
|
1
|
+
import { timeDelta, formatDate, fmtDate, handleTimezone, getDatePartsMap } from '@bagelink/utils';
|
|
2
|
+
export { fmtDate, formatDate, getDatePartsMap, handleTimezone, timeDelta };
|
|
3
|
+
export type { DateTimeAcceptedFormats, FormatDateOptions } from '@bagelink/utils';
|
|
27
4
|
type TimeAgoLang = 'en' | 'es' | 'fr' | 'he' | 'it' | 'ru';
|
|
28
5
|
export declare function timeAgo(date: string | Date, langOrConfig?: TimeAgoLang | {
|
|
29
6
|
lang?: TimeAgoLang;
|
|
30
7
|
mode?: 'relative' | 'absolute';
|
|
31
8
|
}): string;
|
|
32
|
-
/**
|
|
33
|
-
* Adjust a date for a specific timezone
|
|
34
|
-
* @param date The date to adjust
|
|
35
|
-
* @param timeZone The timezone to use (e.g., 'UTC', 'America/New_York')
|
|
36
|
-
* @returns Date parts with timezone adjustment applied
|
|
37
|
-
*/
|
|
38
|
-
export declare function handleTimezone(date: Date, intFmtOpt: Intl.DateTimeFormatOptions): Date;
|
|
39
|
-
export declare function getDatePartsMap(date: Date, locale: Intl.LocalesArgument, intFmtOpt?: Intl.DateTimeFormatOptions): {
|
|
40
|
-
AmPm: string;
|
|
41
|
-
DD: string;
|
|
42
|
-
DDD: string;
|
|
43
|
-
DDDD: string;
|
|
44
|
-
HH: string;
|
|
45
|
-
mm: string;
|
|
46
|
-
MM: string;
|
|
47
|
-
MMM: string;
|
|
48
|
-
MMMM: string;
|
|
49
|
-
ss: string;
|
|
50
|
-
sss: string;
|
|
51
|
-
YY: string;
|
|
52
|
-
YYYY: string;
|
|
53
|
-
};
|
|
54
|
-
export interface FormatDateOptions extends Partial<Pick<Intl.DateTimeFormatOptions, 'hour12'>> {
|
|
55
|
-
format?: DateTimeAcceptedFormats;
|
|
56
|
-
locale?: Intl.LocalesArgument;
|
|
57
|
-
tz?: string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Formats a date based on the provided format string, locale, and timezone.
|
|
61
|
-
* @param date The date to format (string or Date object).
|
|
62
|
-
* @param format The format string (default is 'DD.MM.YY').
|
|
63
|
-
* @returns Formatted date string.
|
|
64
|
-
*/
|
|
65
|
-
export declare function formatDate(date?: DateLike, format?: DateTimeAcceptedFormats): string;
|
|
66
|
-
/**
|
|
67
|
-
* Formats a date based on the provided options.
|
|
68
|
-
* @param date The date to format (string or Date object).
|
|
69
|
-
* @param opts Options for formatting the date.
|
|
70
|
-
* @param opts.format The format string (default is 'DD.MM.YY').
|
|
71
|
-
* @param opts.locale The locale to use for formatting (default is browser's locale).
|
|
72
|
-
* @param opts.tz The timezone to use for formatting (default is local timezone).
|
|
73
|
-
* @returns Formatted date string.
|
|
74
|
-
*/
|
|
75
|
-
export declare function formatDate(date?: DateLike, opts?: FormatDateOptions): string;
|
|
76
|
-
export declare const fmtDate: typeof formatDate;
|
|
77
|
-
export {};
|
|
78
9
|
//# sourceMappingURL=dateUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/calendar/dateUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dateUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/calendar/dateUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGjG,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,CAAA;AAC1E,YAAY,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEjF,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAkD1D,wBAAgB,OAAO,CACtB,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,YAAY,CAAC,EAAE,WAAW,GAAG;IAAE,IAAI,CAAC,EAAE,WAAW,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAA;CAAE,UA4DnF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bagelink/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.10.1",
|
|
5
5
|
"description": "Bagel core sdk packages",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Bagel Studio",
|
|
@@ -89,7 +89,8 @@
|
|
|
89
89
|
"libphonenumber-js": "1.12.9",
|
|
90
90
|
"signature_pad": "^5.0.9",
|
|
91
91
|
"vue-i18n": "^11.2.8",
|
|
92
|
-
"vue-toastification": "^2.0.0-rc.5"
|
|
92
|
+
"vue-toastification": "^2.0.0-rc.5",
|
|
93
|
+
"@bagelink/utils": "1.10.1"
|
|
93
94
|
},
|
|
94
95
|
"scripts": {
|
|
95
96
|
"dev": "tsx watch src/index.ts",
|
|
@@ -320,11 +320,12 @@ function getFieldProps(field: FieldBuilder, key: string) {
|
|
|
320
320
|
|
|
321
321
|
// Array field special handling
|
|
322
322
|
if (field._type === 'array') {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
// Remove schema from props (handled separately)
|
|
326
|
-
const { schema: _, ...configWithoutSchema } = field._config
|
|
323
|
+
// Remove schema/itemType from props (handled separately in template)
|
|
324
|
+
const { schema: _, itemType: __, ...configWithoutSchema } = field._config
|
|
327
325
|
Object.assign(baseProps, configWithoutSchema)
|
|
326
|
+
// Apply defaults after spread so they aren't overwritten by undefined values
|
|
327
|
+
baseProps.allowAdd = baseProps.allowAdd ?? true
|
|
328
|
+
baseProps.allowDelete = baseProps.allowDelete ?? true
|
|
328
329
|
}
|
|
329
330
|
|
|
330
331
|
return baseProps
|
|
@@ -950,11 +950,9 @@ function createFieldFromProperty(
|
|
|
950
950
|
field = $.multiselect(resolvedProp.enum || [], config)
|
|
951
951
|
break
|
|
952
952
|
case 'array': {
|
|
953
|
-
const arrayConfig: Record<string, any> = {
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
allowDelete: xUi.allowDelete,
|
|
957
|
-
}
|
|
953
|
+
const arrayConfig: Record<string, any> = { ...config }
|
|
954
|
+
if (xUi.allowAdd !== undefined) arrayConfig.allowAdd = xUi.allowAdd
|
|
955
|
+
if (xUi.allowDelete !== undefined) arrayConfig.allowDelete = xUi.allowDelete
|
|
958
956
|
if (resolvedProp.items?.type) {
|
|
959
957
|
arrayConfig.itemType = inferFieldType(resolvedProp.items)
|
|
960
958
|
}
|
package/src/plugins/bagel.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Plugin } from 'vue'
|
|
|
2
2
|
import type { CreateBagelI18nOptions } from '../i18n'
|
|
3
3
|
|
|
4
4
|
import type { BagelToastOptions } from './useToast'
|
|
5
|
+
import { configure } from '@bagelink/utils'
|
|
5
6
|
import FloatingVue from 'floating-vue'
|
|
6
7
|
import lightboxPlugin from '../components/lightbox/index'
|
|
7
8
|
import { ripple, pattern } from '../directives'
|
|
@@ -43,6 +44,18 @@ export const BagelVue: Plugin<BagelOptions> = {
|
|
|
43
44
|
// Setup i18n
|
|
44
45
|
const i18n = createI18n(options.i18n || {})
|
|
45
46
|
app.use(i18n as any)
|
|
47
|
+
|
|
48
|
+
// Bridge locale into @bagelink/utils
|
|
49
|
+
configure({
|
|
50
|
+
locale: () => {
|
|
51
|
+
try {
|
|
52
|
+
const { locale } = getI18n().global
|
|
53
|
+
return typeof locale === 'string' ? locale : locale.value
|
|
54
|
+
} catch {
|
|
55
|
+
return 'en'
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
})
|
|
46
59
|
},
|
|
47
60
|
}
|
|
48
61
|
|
package/src/types/index.ts
CHANGED