@bagelink/vue 1.15.0 → 1.15.5
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 +7 -6
- package/dist/components/Btn.vue.d.ts +1 -1
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/Carousel.vue.d.ts +11 -0
- package/dist/components/Dropdown.vue.d.ts +2 -0
- package/dist/components/FilterQuery.vue.d.ts +3 -8
- package/dist/components/FilterQuery.vue.d.ts.map +1 -1
- package/dist/components/ImportData.vue.d.ts.map +1 -1
- package/dist/components/Modal.vue.d.ts +1 -0
- package/dist/components/Pill.vue.d.ts.map +1 -1
- package/dist/components/Swiper.vue.d.ts +12 -6
- package/dist/components/analytics/PieChart.vue.d.ts +2 -2
- package/dist/components/calendar/CalendarPopover.vue.d.ts +4 -8
- package/dist/components/calendar/CalendarTypes.d.ts +10 -0
- package/dist/components/calendar/Index.vue.d.ts +20 -4
- package/dist/components/calendar/views/WeekView.vue.d.ts +9 -1
- package/dist/components/form/inputs/ArrayInput.vue.d.ts +4 -2
- package/dist/components/form/inputs/CheckInput.vue.d.ts +2 -1
- package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts +54 -0
- package/dist/components/form/inputs/ColorInput.vue.d.ts +3 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts +2 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts +1 -0
- package/dist/components/form/inputs/EmailInput.vue.d.ts +5 -2
- package/dist/components/form/inputs/JSONInput.vue.d.ts +2 -1
- package/dist/components/form/inputs/MarkdownEditor.vue.d.ts +7 -2
- package/dist/components/form/inputs/NumberInput.vue.d.ts +2 -1
- package/dist/components/form/inputs/OTP.vue.d.ts +2 -1
- package/dist/components/form/inputs/PasswordInput.vue.d.ts +16 -10
- package/dist/components/form/inputs/RadioGroup.vue.d.ts +3 -1
- package/dist/components/form/inputs/RadioGroup.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RangeInput.vue.d.ts +6 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts +2 -1
- package/dist/components/form/inputs/SelectBtn.vue.d.ts +2 -2
- package/dist/components/form/inputs/SelectBtn.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts +20 -13
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SignaturePad.vue.d.ts +6 -1
- package/dist/components/form/inputs/TableField.vue.d.ts +2 -1
- package/dist/components/form/inputs/TelInput.vue.d.ts +2 -1
- package/dist/components/form/inputs/TextInput.vue.d.ts +3 -2
- package/dist/components/form/inputs/ToggleInput.vue.d.ts +2 -1
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts +27 -6
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/upload.d.ts +1 -1
- package/dist/components/form/inputs/index.d.ts +1 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/components/layout/AppContent.vue.d.ts +1 -1
- package/dist/components/layout/AppLayout.vue.d.ts +2 -0
- package/dist/components/layout/AppSidebar.vue.d.ts +5 -1
- package/dist/components/layout/TabsNav.vue.d.ts +12 -1
- package/dist/directives/ripple.d.ts.map +1 -1
- package/dist/form-flow/MultiStepForm.vue.d.ts +6 -1
- package/dist/form-flow/MultiStepForm.vue.d.ts.map +1 -1
- package/dist/form-flow/form-flow.d.ts +24 -1
- package/dist/i18n/index.d.ts +838 -0
- package/dist/index.cjs +133 -160
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +33700 -27754
- package/dist/style.css +2 -1
- package/dist/types/BagelForm.d.ts +10 -1
- package/dist/types/NavLink.d.ts +2 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts +1 -0
- package/dist/utils/calendar/dateUtils.d.ts +2 -2
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/options.d.ts.map +1 -1
- package/dist/utils/showdown.d.ts.map +1 -1
- package/dist/utils/useSearch.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Btn.vue +17 -16
- package/src/components/form/inputs/RadioGroup.vue +2 -2
- package/src/components/form/inputs/SelectBtn.vue +5 -3
- package/src/components/form/inputs/SelectInput.vue +1 -1
- package/src/directives/ripple.ts +23 -3
- package/src/form-flow/MultiStepForm.vue +9 -1
- package/src/styles/base-colors.css +176 -176
- package/src/types/index.ts +1 -1
- package/src/utils/index.ts +38 -2
- package/src/utils/options.ts +2 -2
- package/src/utils/showdown.ts +7 -0
- package/vite.config.ts +0 -1
- package/dist/components/Filter.vue.d.ts +0 -30
- package/dist/components/Filter.vue.d.ts.map +0 -1
- package/dist/components/QueryFilter.vue.d.ts +0 -30
- package/dist/components/QueryFilter.vue.d.ts.map +0 -1
package/src/types/index.ts
CHANGED
package/src/utils/index.ts
CHANGED
|
@@ -39,6 +39,39 @@ export function initials(...strArr: string[]) {
|
|
|
39
39
|
return strArr.map(str => str.charAt(0)).join('')
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Strip script-capable content from an HTML string so it is safe for v-html.
|
|
44
|
+
* Removes <script>/<style>/<iframe>/<object>/<embed> elements, on* event
|
|
45
|
+
* handler attributes, and javascript: / data: URLs in href/src.
|
|
46
|
+
* Allowlist-free by design — formatting tags (b, i, a, span…) pass through.
|
|
47
|
+
*/
|
|
48
|
+
export function sanitizeHtml(html: string): string {
|
|
49
|
+
if (!html || typeof document === 'undefined') { return html }
|
|
50
|
+
const template = document.createElement('template')
|
|
51
|
+
template.innerHTML = html
|
|
52
|
+
const walk = (el: Element | DocumentFragment) => {
|
|
53
|
+
for (const child of Array.from(el.children)) {
|
|
54
|
+
const tag = child.tagName.toLowerCase()
|
|
55
|
+
if (['script', 'iframe', 'object', 'embed', 'link', 'meta', 'base', 'form'].includes(tag)) {
|
|
56
|
+
child.remove()
|
|
57
|
+
continue
|
|
58
|
+
}
|
|
59
|
+
for (const attr of Array.from(child.attributes)) {
|
|
60
|
+
const name = attr.name.toLowerCase()
|
|
61
|
+
const value = attr.value.trim().toLowerCase()
|
|
62
|
+
if (name.startsWith('on')
|
|
63
|
+
|| ((name === 'href' || name === 'src' || name === 'xlink:href')
|
|
64
|
+
&& (value.startsWith('javascript:') || value.startsWith('data:')))) {
|
|
65
|
+
child.removeAttribute(attr.name)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
walk(child)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
walk(template.content)
|
|
72
|
+
return template.innerHTML
|
|
73
|
+
}
|
|
74
|
+
|
|
42
75
|
export function useEscape(event: KeyboardEvent, closeModel: () => void) {
|
|
43
76
|
if (event.key === 'Escape') {
|
|
44
77
|
closeModel()
|
|
@@ -226,8 +259,11 @@ export type { ShowdownConverter, ShowdownOptions } from './showdown'
|
|
|
226
259
|
|
|
227
260
|
const URL_REGEX = /^https?:\/\/|^\/\//
|
|
228
261
|
|
|
229
|
-
export function pathKeyToURL(pathKey?: string | null) {
|
|
230
|
-
if (pathKey == null || pathKey === ''
|
|
262
|
+
export function pathKeyToURL(pathKey?: string | null): string | undefined {
|
|
263
|
+
if (pathKey == null || pathKey === '') {
|
|
264
|
+
return undefined
|
|
265
|
+
}
|
|
266
|
+
if (URL_REGEX.test(pathKey)) {
|
|
231
267
|
return pathKey
|
|
232
268
|
}
|
|
233
269
|
|
package/src/utils/options.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type { OptionObject }
|
|
|
4
4
|
|
|
5
5
|
export type NormalizedOption<T extends Record<string, any> = Record<string, never>> = T & {
|
|
6
6
|
label: string
|
|
7
|
-
value: string | number
|
|
7
|
+
value: string | number | boolean
|
|
8
8
|
icon?: IconType
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -18,7 +18,7 @@ export function getOptionLabel(option: Option): string {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/** Extract the primitive value from an option. */
|
|
21
|
-
export function getOptionValue(option?: Option): string | number | undefined {
|
|
21
|
+
export function getOptionValue(option?: Option): string | number | boolean | undefined {
|
|
22
22
|
if (option == null) { return }
|
|
23
23
|
if (typeof option === 'object') { return (option as OptionObject).value }
|
|
24
24
|
return option as string | number
|
package/src/utils/showdown.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⚠️ Security note: `makeHtml()` output is NOT sanitized — raw HTML in the
|
|
3
|
+
* markdown source passes through. If the markdown can contain user-generated
|
|
4
|
+
* content, run the result through `sanitizeHtml()` (from utils) before
|
|
5
|
+
* binding it with v-html.
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
/**
|
|
2
9
|
* Showdown configuration options
|
|
3
10
|
*/
|
package/vite.config.ts
CHANGED
|
@@ -7,7 +7,6 @@ import tsconfigPaths from 'vite-tsconfig-paths'
|
|
|
7
7
|
|
|
8
8
|
const indexDir = resolve(import.meta.dirname, 'src')
|
|
9
9
|
|
|
10
|
-
// @ts-expect-error - rolldown-vite in root workspace causes plugin type mismatch; build is unaffected
|
|
11
10
|
export default defineConfig(() => ({
|
|
12
11
|
plugins: [
|
|
13
12
|
tsconfigPaths({ root: indexDir, }),
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Option } from '..';
|
|
2
|
-
import { QueryConditions } from '../utils/queryFilter';
|
|
3
|
-
declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
5
|
-
readonly onSave?: ((value: QueryConditions<T>) => any) | undefined;
|
|
6
|
-
readonly "onUpdate:modelValue"?: ((value: QueryConditions<T>) => any) | undefined;
|
|
7
|
-
readonly onChange?: ((value: QueryConditions<T>) => any) | undefined;
|
|
8
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue" | "onSave"> & ({
|
|
9
|
-
modelValue?: QueryConditions<T>;
|
|
10
|
-
} & {
|
|
11
|
-
fields: Array<{
|
|
12
|
-
label: string;
|
|
13
|
-
value: string;
|
|
14
|
-
type?: "string" | "number" | "boolean" | "date";
|
|
15
|
-
options?: Option[] | ((query: string) => Promise<Option[]>);
|
|
16
|
-
multiple?: boolean;
|
|
17
|
-
}>;
|
|
18
|
-
}) & Partial<{}>> & import('vue').PublicProps;
|
|
19
|
-
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
20
|
-
attrs: any;
|
|
21
|
-
slots: {};
|
|
22
|
-
emit: (((evt: "save", value: QueryConditions<T>) => void) & ((evt: "change", value: QueryConditions<T>) => void)) & ((evt: "update:modelValue", value: QueryConditions<T>) => void);
|
|
23
|
-
}>) => import('vue').VNode & {
|
|
24
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
25
|
-
};
|
|
26
|
-
export default _default;
|
|
27
|
-
type __VLS_PrettifyLocal<T> = {
|
|
28
|
-
[K in keyof T]: T[K];
|
|
29
|
-
} & {};
|
|
30
|
-
//# sourceMappingURL=Filter.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Filter.vue.d.ts","sourceRoot":"","sources":["../../src/components/Filter.vue"],"names":[],"mappings":"AAAA,OAqeO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAuC,eAAe,EAAE,MAAM,sBAAsB,CAAA;yBAI/E,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAwxBO,mBAAmB,CAAC;;;;;qBAlff,eAAe,CAAC,CAAC,CAAC;;gBA1RtB,KAAK,CAAC;YACb,KAAK,EAAE,MAAM,CAAA;YACb,KAAK,EAAE,MAAM,CAAA;YACb,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;YAC/C,OAAO,CAAC,sBAf+B,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,EAe5C;YACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;SAClB,CAAC;oBAswB2F,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;UAEJ,6KAAoC;EAEvC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAnyBzE,wBAmyB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Option } from '..';
|
|
2
|
-
import { QueryConditions } from '../utils/queryFilter';
|
|
3
|
-
declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
5
|
-
readonly onSave?: ((value: QueryConditions<T>) => any) | undefined;
|
|
6
|
-
readonly "onUpdate:modelValue"?: ((value: QueryConditions<T>) => any) | undefined;
|
|
7
|
-
readonly onChange?: ((value: QueryConditions<T>) => any) | undefined;
|
|
8
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue" | "onSave"> & ({
|
|
9
|
-
modelValue?: QueryConditions<T>;
|
|
10
|
-
} & {
|
|
11
|
-
fields: Array<{
|
|
12
|
-
label: string;
|
|
13
|
-
value: string;
|
|
14
|
-
type?: "string" | "number" | "boolean" | "date";
|
|
15
|
-
options?: Option[] | ((query: string) => Promise<Option[]>);
|
|
16
|
-
multiple?: boolean;
|
|
17
|
-
}>;
|
|
18
|
-
}) & Partial<{}>> & import('vue').PublicProps;
|
|
19
|
-
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
20
|
-
attrs: any;
|
|
21
|
-
slots: {};
|
|
22
|
-
emit: (((evt: "save", value: QueryConditions<T>) => void) & ((evt: "change", value: QueryConditions<T>) => void)) & ((evt: "update:modelValue", value: QueryConditions<T>) => void);
|
|
23
|
-
}>) => import('vue').VNode & {
|
|
24
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
25
|
-
};
|
|
26
|
-
export default _default;
|
|
27
|
-
type __VLS_PrettifyLocal<T> = {
|
|
28
|
-
[K in keyof T]: T[K];
|
|
29
|
-
} & {};
|
|
30
|
-
//# sourceMappingURL=QueryFilter.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueryFilter.vue.d.ts","sourceRoot":"","sources":["../../src/components/QueryFilter.vue"],"names":[],"mappings":"AAAA,OAqeO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAu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