@bagelink/vue 0.0.200 → 0.0.206
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/Btn.vue.d.ts +3 -0
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/TabbedLayout.vue.d.ts +5 -3
- package/dist/components/TabbedLayout.vue.d.ts.map +1 -1
- package/dist/components/form/BglField.vue.d.ts +23 -0
- package/dist/components/form/BglField.vue.d.ts.map +1 -0
- package/dist/components/form/BglForm.vue.d.ts +36 -0
- package/dist/components/form/BglForm.vue.d.ts.map +1 -0
- package/dist/components/form/ItemRef.vue.d.ts +0 -1
- package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/inputs/CheckInput.vue.d.ts +0 -1
- package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ColorPicker.vue.d.ts +0 -1
- package/dist/components/form/inputs/ColorPicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/CurrencyInput.vue.d.ts +0 -1
- package/dist/components/form/inputs/CurrencyInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts +0 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/FileUpload.vue.d.ts +18 -0
- package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/Password.vue.d.ts +0 -1
- package/dist/components/form/inputs/Password.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/PlainText.vue.d.ts +0 -1
- package/dist/components/form/inputs/PlainText.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts +5 -3
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ReadOnlyInput.vue.d.ts +0 -1
- package/dist/components/form/inputs/ReadOnlyInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectField.vue.d.ts +4 -1
- package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TextInput.vue.d.ts +13 -0
- package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/index.d.ts +1 -0
- package/dist/components/form/inputs/index.d.ts.map +1 -1
- package/dist/index.cjs +849 -605
- package/dist/index.mjs +849 -605
- package/dist/style.css +146 -74
- package/dist/types/BagelField.d.ts +1 -8
- package/dist/types/BagelField.d.ts.map +1 -1
- package/dist/types/BagelForm.d.ts +23 -0
- package/dist/types/BagelForm.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/materialIcons.d.ts +1 -1
- package/dist/types/materialIcons.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Btn.vue +8 -7
- package/src/components/TabbedLayout.vue +58 -45
- package/src/components/form/BglField.vue +30 -0
- package/src/components/form/BglForm.vue +75 -0
- package/src/components/form/index.ts +2 -0
- package/src/components/form/inputs/FileUpload.vue +130 -0
- package/src/components/form/inputs/RadioPillsInput.vue +20 -14
- package/src/components/form/inputs/SelectField.vue +2 -0
- package/src/components/form/inputs/TextInput.vue +44 -8
- package/src/components/form/inputs/index.ts +1 -0
- package/src/types/BagelField.ts +1 -6
- package/src/types/BagelForm.ts +24 -0
- package/src/types/index.ts +11 -2
- package/src/types/materialIcons.ts +1 -0
- package/src/utils/index.ts +10 -23
- package/dist/components/FileUploader.vue.d.ts +0 -60
- package/dist/components/FileUploader.vue.d.ts.map +0 -1
package/src/utils/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { inject } from 'vue';
|
|
2
|
-
|
|
3
|
-
import type { BagelField } from '@bagelink/vue';
|
|
2
|
+
import { Attributes } from '../types';
|
|
4
3
|
|
|
5
4
|
let timeout: any;
|
|
6
5
|
export const debounce = (fn: () => void, delay = 500) => {
|
|
@@ -13,27 +12,6 @@ export const keyToLabel = (key: string) => key
|
|
|
13
12
|
.map((k) => k.charAt(0).toUpperCase() + k.slice(1))
|
|
14
13
|
.join(' ');
|
|
15
14
|
|
|
16
|
-
export function computeFields(modelValue: Record<string, any>): BagelField[] {
|
|
17
|
-
const fields = [];
|
|
18
|
-
for (const key of Object.keys(modelValue)) {
|
|
19
|
-
const field: BagelField = {
|
|
20
|
-
label: keyToLabel(key),
|
|
21
|
-
id: key,
|
|
22
|
-
inputType: 'PlainText',
|
|
23
|
-
};
|
|
24
|
-
if (typeof modelValue[key] === 'string') field.inputType = 'PlainText';
|
|
25
|
-
if (typeof modelValue[key] === 'number') field.inputType = 'NumberInput';
|
|
26
|
-
if (modelValue[key] === true || modelValue[key] === false) field.inputType = 'CheckInput';
|
|
27
|
-
if (
|
|
28
|
-
modelValue[key] instanceof Date ||
|
|
29
|
-
!Number.isNaN(Date.parse(modelValue[key]))
|
|
30
|
-
) field.inputType = 'DateInput';
|
|
31
|
-
|
|
32
|
-
fields.push(field);
|
|
33
|
-
}
|
|
34
|
-
return fields;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
15
|
export const copyText = async (
|
|
38
16
|
text: string,
|
|
39
17
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -56,4 +34,13 @@ export function useEscape(event: KeyboardEvent, closeModel: () => void) {
|
|
|
56
34
|
}
|
|
57
35
|
}
|
|
58
36
|
|
|
37
|
+
export function bindAttrs<T = Record<string, any>>(attrs: Attributes, fieldVal: any, row: T) {
|
|
38
|
+
const arr = Object.entries(attrs).map(([key, value]) => [
|
|
39
|
+
key,
|
|
40
|
+
typeof value === 'function' ? value(fieldVal, row) : value,
|
|
41
|
+
]);
|
|
42
|
+
const resolvedAttrs = Object.fromEntries(arr);
|
|
43
|
+
return resolvedAttrs;
|
|
44
|
+
}
|
|
45
|
+
|
|
59
46
|
export { formatString } from './strings';
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
-
id?: string | undefined;
|
|
3
|
-
private?: 0 | 1 | undefined;
|
|
4
|
-
singleFile?: boolean | undefined;
|
|
5
|
-
beforeUpload?: (() => Promise<any>) | undefined;
|
|
6
|
-
dragDropLabel?: string | undefined;
|
|
7
|
-
browseLabel?: string | undefined;
|
|
8
|
-
}>, {
|
|
9
|
-
private: number;
|
|
10
|
-
entity: string;
|
|
11
|
-
id: string;
|
|
12
|
-
beforeUpload: () => Promise<void>;
|
|
13
|
-
dragDropLabel: string;
|
|
14
|
-
browseLabel: string;
|
|
15
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
-
done: (...args: any[]) => void;
|
|
17
|
-
complete: (...args: any[]) => void;
|
|
18
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
19
|
-
id?: string | undefined;
|
|
20
|
-
private?: 0 | 1 | undefined;
|
|
21
|
-
singleFile?: boolean | undefined;
|
|
22
|
-
beforeUpload?: (() => Promise<any>) | undefined;
|
|
23
|
-
dragDropLabel?: string | undefined;
|
|
24
|
-
browseLabel?: string | undefined;
|
|
25
|
-
}>, {
|
|
26
|
-
private: number;
|
|
27
|
-
entity: string;
|
|
28
|
-
id: string;
|
|
29
|
-
beforeUpload: () => Promise<void>;
|
|
30
|
-
dragDropLabel: string;
|
|
31
|
-
browseLabel: string;
|
|
32
|
-
}>>> & {
|
|
33
|
-
onDone?: ((...args: any[]) => any) | undefined;
|
|
34
|
-
onComplete?: ((...args: any[]) => any) | undefined;
|
|
35
|
-
}, {
|
|
36
|
-
id: string;
|
|
37
|
-
private: 1 | 0;
|
|
38
|
-
beforeUpload: () => Promise<any>;
|
|
39
|
-
dragDropLabel: string;
|
|
40
|
-
browseLabel: string;
|
|
41
|
-
}, {}>;
|
|
42
|
-
export default _default;
|
|
43
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
44
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
45
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
46
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
47
|
-
} : {
|
|
48
|
-
type: import('vue').PropType<T[K]>;
|
|
49
|
-
required: true;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
type __VLS_WithDefaults<P, D> = {
|
|
53
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
54
|
-
default: D[K];
|
|
55
|
-
}> : P[K];
|
|
56
|
-
};
|
|
57
|
-
type __VLS_Prettify<T> = {
|
|
58
|
-
[K in keyof T]: T[K];
|
|
59
|
-
} & {};
|
|
60
|
-
//# sourceMappingURL=FileUploader.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploader.vue.d.ts","sourceRoot":"","sources":["../../src/components/FileUploader.vue"],"names":[],"mappings":"AAiDA;;;;;0BA6YuB,QAAQ,GAAG,CAAC;;;;;;;;;;;;;;;;;0BAAZ,QAAQ,GAAG,CAAC;;;;;;;;;;;;;;QAJ5B,MAAM;aAED,CAAC,GAAG,CAAC;kBAEA,MAAM,QAAQ,GAAG,CAAC;mBACjB,MAAM;iBACR,MAAM;;AARtB,wBAeG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|