@bagelink/vue 0.0.266 → 0.0.270
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/Drop.vue.d.ts +34 -0
- package/dist/components/Drop.vue.d.ts.map +1 -0
- package/dist/components/FileUploader.vue.d.ts +60 -0
- package/dist/components/FileUploader.vue.d.ts.map +1 -0
- package/dist/components/ModalForm.vue.d.ts.map +1 -1
- package/dist/components/form/BglField.vue.d.ts.map +1 -1
- package/dist/components/form/BglForm.vue.d.ts.map +1 -1
- package/dist/components/form/ItemRef.vue.d.ts +1 -0
- package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectField.vue.d.ts +1 -4
- package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/index.d.ts +0 -1
- package/dist/components/form/inputs/index.d.ts.map +1 -1
- package/dist/index.cjs +8673 -9487
- package/dist/index.mjs +8672 -9486
- package/dist/plugins/modal.d.ts +1 -1
- package/dist/plugins/modal.d.ts.map +1 -1
- package/dist/style.css +30 -49
- package/dist/types/BagelForm.d.ts +1 -1
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/ModalForm.vue +7 -35
- package/src/components/form/BglField.vue +22 -7
- package/src/components/form/BglFieldSet.vue +13 -0
- package/src/components/form/BglForm.vue +5 -22
- package/src/components/form/inputs/CheckInput.vue +3 -1
- package/src/components/form/inputs/DateInput.vue +6 -2
- package/src/components/form/inputs/SelectInput.vue +2 -9
- package/src/components/form/inputs/TextInput.vue +12 -8
- package/src/components/form/inputs/index.ts +0 -1
- package/src/plugins/modal.ts +1 -1
- package/src/types/BagelForm.ts +20 -20
- package/src/components/form/inputs/TextArea.vue +0 -81
package/src/types/BagelForm.ts
CHANGED
|
@@ -5,35 +5,35 @@ export type AttributeValue = string | number | boolean | null | undefined | Reco
|
|
|
5
5
|
export type AttributeFn<T = Record<string, any>> = (field: any, row: T) => AttributeValue;
|
|
6
6
|
|
|
7
7
|
export interface Attributes<T = any> {
|
|
8
|
-
|
|
8
|
+
[key: string]: AttributeValue | AttributeFn<T>
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export type BaseBagelField<T = Record<string, any>> = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
$el?: any;
|
|
13
|
+
id?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
children?: Field<T>[];
|
|
17
|
+
class?: AttributeValue | AttributeFn<T>,
|
|
18
|
+
attrs?: Attributes<T>;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
helptext?: string;
|
|
21
|
+
options?: string | ({ label?: string; value: string | number } | string | number | Record<string, any>)[],
|
|
22
|
+
defaultValue?: any;
|
|
23
|
+
transform?: (val?: any, rowData?: Record<string, any>) => any;
|
|
24
|
+
onUpdate?: (val: any, rowData?: Record<string, any>) => void;
|
|
25
|
+
'v-if'?: string | boolean | ((val: any, row: T) => boolean);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export interface InputBagelField<T> extends BaseBagelField<T> {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
$el: 'text' | typeof TextInput;
|
|
30
|
+
id: string;
|
|
31
|
+
type?: string;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export interface SelectBagelField<T> extends BaseBagelField<T> {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
$el: 'select' | typeof SelectInput;
|
|
36
|
+
id: string;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export type Field<T = Record<string, any>> = BaseBagelField<T> | InputBagelField<T> | SelectBagelField<T>;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="bagel-input"
|
|
4
|
-
:title="description"
|
|
5
|
-
:class="{ small: small }"
|
|
6
|
-
>
|
|
7
|
-
<label v-if="label">
|
|
8
|
-
<LangText :input="label" />
|
|
9
|
-
</label>
|
|
10
|
-
<span
|
|
11
|
-
class="character-limit"
|
|
12
|
-
v-if="showCharacterLimit"
|
|
13
|
-
>
|
|
14
|
-
{{ modelValue?.length }}
|
|
15
|
-
{{ nativeInputAttrs?.maxlength ? `/${nativeInputAttrs.maxlength}` : '' }}
|
|
16
|
-
</span>
|
|
17
|
-
<textarea
|
|
18
|
-
:value="modelValue"
|
|
19
|
-
@input="handleInput"
|
|
20
|
-
:class="{ 'no-edit': !editMode }"
|
|
21
|
-
v-bind="nativeInputAttrs"
|
|
22
|
-
:required
|
|
23
|
-
/>
|
|
24
|
-
</div>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script setup lang="ts">
|
|
28
|
-
import { LangText } from '@bagelink/vue';
|
|
29
|
-
|
|
30
|
-
const emits = defineEmits(['update:modelValue']);
|
|
31
|
-
|
|
32
|
-
withDefaults(
|
|
33
|
-
defineProps<{
|
|
34
|
-
description?: string;
|
|
35
|
-
label?: string;
|
|
36
|
-
modelValue: any;
|
|
37
|
-
placeholder?: string;
|
|
38
|
-
editMode?: boolean;
|
|
39
|
-
small?: boolean;
|
|
40
|
-
nativeInputAttrs?: Record<string, any>;
|
|
41
|
-
showCharacterLimit?: boolean;
|
|
42
|
-
required?: boolean;
|
|
43
|
-
}>(),
|
|
44
|
-
{
|
|
45
|
-
description: '',
|
|
46
|
-
editMode: true,
|
|
47
|
-
placeholder: '',
|
|
48
|
-
label: '',
|
|
49
|
-
},
|
|
50
|
-
);
|
|
51
|
-
const handleInput = (e: Event) => {
|
|
52
|
-
const el = e.target as HTMLInputElement;
|
|
53
|
-
emits('update:modelValue', el.value);
|
|
54
|
-
};
|
|
55
|
-
</script>
|
|
56
|
-
|
|
57
|
-
<style scoped>
|
|
58
|
-
.bagel-input {
|
|
59
|
-
height: 100%;
|
|
60
|
-
margin: 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.bagel-input label {
|
|
64
|
-
margin-bottom: 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.bagel-input textarea {
|
|
68
|
-
height: 100%;
|
|
69
|
-
resize: none;
|
|
70
|
-
background: var(--input-bg);
|
|
71
|
-
margin-bottom: 0.5rem;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.character-limit {
|
|
75
|
-
font-size: 0.6rem;
|
|
76
|
-
color: var(--input-color);
|
|
77
|
-
position: absolute;
|
|
78
|
-
top: 0.25rem;
|
|
79
|
-
inset-inline-end: 0;
|
|
80
|
-
}
|
|
81
|
-
</style>
|