@bagelink/vue 0.0.431 → 0.0.435
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/form/BglField.vue.d.ts.map +1 -1
- package/dist/components/form/BglForm.vue.d.ts +4 -1
- package/dist/components/form/BglForm.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/index.cjs +48 -26
- package/dist/index.mjs +48 -26
- package/dist/style.css +45 -45
- package/dist/utils/BagelFormUtils.d.ts +1 -0
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/form/BglField.vue +5 -3
- package/src/components/form/BglForm.vue +13 -9
- package/src/components/form/inputs/RadioPillsInput.vue +4 -5
- package/src/components/form/inputs/SelectInput.vue +214 -217
- package/src/utils/BagelFormUtils.ts +44 -10
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Field } from '@bagelink/vue';
|
|
2
2
|
|
|
3
|
-
export type Option =
|
|
3
|
+
export type Option =
|
|
4
|
+
| string
|
|
5
|
+
| number
|
|
6
|
+
| Record<string, any>
|
|
7
|
+
| { label: string; value: string | number };
|
|
4
8
|
|
|
5
9
|
interface InputOptions {
|
|
6
10
|
required?: boolean;
|
|
@@ -8,6 +12,7 @@ interface InputOptions {
|
|
|
8
12
|
class?: string;
|
|
9
13
|
defaultValue?: string;
|
|
10
14
|
disabled?: boolean;
|
|
15
|
+
helptext?: string;
|
|
11
16
|
}
|
|
12
17
|
|
|
13
18
|
interface TextInputOptions extends InputOptions {
|
|
@@ -27,9 +32,13 @@ interface NumFieldOptions extends InputOptions {
|
|
|
27
32
|
step?: number;
|
|
28
33
|
}
|
|
29
34
|
|
|
30
|
-
type RichTextOptions = InputOptions
|
|
35
|
+
type RichTextOptions = InputOptions;
|
|
31
36
|
|
|
32
|
-
export function richText(
|
|
37
|
+
export function richText(
|
|
38
|
+
id: string,
|
|
39
|
+
label?: string,
|
|
40
|
+
options?: RichTextOptions,
|
|
41
|
+
) {
|
|
33
42
|
return {
|
|
34
43
|
$el: 'richtext',
|
|
35
44
|
class: options?.class,
|
|
@@ -41,7 +50,11 @@ export function richText(id: string, label?: string, options?: RichTextOptions)
|
|
|
41
50
|
};
|
|
42
51
|
}
|
|
43
52
|
|
|
44
|
-
export function txtField(
|
|
53
|
+
export function txtField(
|
|
54
|
+
id: string,
|
|
55
|
+
label?: string,
|
|
56
|
+
options?: TextInputOptions,
|
|
57
|
+
): Field {
|
|
45
58
|
return {
|
|
46
59
|
$el: 'text',
|
|
47
60
|
class: options?.class,
|
|
@@ -49,11 +62,20 @@ export function txtField(id: string, label?: string, options?: TextInputOptions)
|
|
|
49
62
|
id,
|
|
50
63
|
label,
|
|
51
64
|
placeholder: options?.placeholder,
|
|
52
|
-
attrs: {
|
|
65
|
+
attrs: {
|
|
66
|
+
type: options?.type,
|
|
67
|
+
pattern: options?.pattern,
|
|
68
|
+
multiline: options?.multiline,
|
|
69
|
+
},
|
|
53
70
|
};
|
|
54
71
|
}
|
|
55
72
|
|
|
56
|
-
export function slctField(
|
|
73
|
+
export function slctField(
|
|
74
|
+
id: string,
|
|
75
|
+
label?: string,
|
|
76
|
+
options?: Option[] | (() => Option[]),
|
|
77
|
+
config?: SlctInputOptions,
|
|
78
|
+
): Field {
|
|
57
79
|
return {
|
|
58
80
|
$el: 'select',
|
|
59
81
|
id,
|
|
@@ -63,11 +85,19 @@ export function slctField(id: string, label?: string, options?: Option[] | (() =
|
|
|
63
85
|
required: config?.required,
|
|
64
86
|
label,
|
|
65
87
|
defaultValue: config?.defaultValue,
|
|
66
|
-
attrs: {
|
|
88
|
+
attrs: {
|
|
89
|
+
disabled: config?.disabled,
|
|
90
|
+
searchable: config?.searchable,
|
|
91
|
+
multiselect: config?.multiselect,
|
|
92
|
+
},
|
|
67
93
|
};
|
|
68
94
|
}
|
|
69
95
|
|
|
70
|
-
export function checkField(
|
|
96
|
+
export function checkField(
|
|
97
|
+
id: string,
|
|
98
|
+
label?: string,
|
|
99
|
+
options?: NumFieldOptions,
|
|
100
|
+
): Field {
|
|
71
101
|
return {
|
|
72
102
|
$el: 'check',
|
|
73
103
|
class: options?.class,
|
|
@@ -77,7 +107,11 @@ export function checkField(id: string, label?: string, options?: NumFieldOptions
|
|
|
77
107
|
};
|
|
78
108
|
}
|
|
79
109
|
|
|
80
|
-
export function numField(
|
|
110
|
+
export function numField(
|
|
111
|
+
id: string,
|
|
112
|
+
label?: string,
|
|
113
|
+
options?: NumFieldOptions,
|
|
114
|
+
): Field {
|
|
81
115
|
return {
|
|
82
116
|
$el: 'text',
|
|
83
117
|
class: options?.class,
|
|
@@ -92,7 +126,7 @@ export function numField(id: string, label?: string, options?: NumFieldOptions):
|
|
|
92
126
|
export function frmRow(...children: Field[]) {
|
|
93
127
|
return {
|
|
94
128
|
$el: 'div',
|
|
95
|
-
class: 'flex gap-1 m_block
|
|
129
|
+
class: 'flex gap-1 m_block',
|
|
96
130
|
children,
|
|
97
131
|
};
|
|
98
132
|
}
|