@bagelink/vue 0.0.354 → 0.0.358
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/Card.vue.d.ts +2 -2
- package/dist/components/form/inputs/RichText.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/layout/Tabs.vue.d.ts.map +1 -1
- package/dist/index.cjs +70 -46
- package/dist/index.mjs +71 -47
- package/dist/style.css +31 -27
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts +16 -5
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/form/inputs/RichText.vue +169 -158
- package/src/components/form/inputs/SelectInput.vue +47 -39
- package/src/components/layout/Tabs.vue +23 -4
- package/src/types/index.ts +12 -11
- package/src/utils/BagelFormUtils.ts +25 -11
|
@@ -2,13 +2,27 @@ import type { Field } from '@bagelink/vue';
|
|
|
2
2
|
|
|
3
3
|
export type Option = string | number | Record<string, any> | { label: string, value: string | number };
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
interface InputOptions {
|
|
6
|
+
required?: boolean;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
class?: string;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface TextInputOptions extends InputOptions {
|
|
14
|
+
type?: 'text' | 'tel' | 'email';
|
|
15
|
+
pattern?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface SlctInputOptions extends InputOptions {
|
|
19
|
+
searchable?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface NumFieldOptions extends InputOptions {
|
|
23
|
+
max?: number;
|
|
24
|
+
min?: number;
|
|
25
|
+
step?: number;
|
|
12
26
|
}
|
|
13
27
|
|
|
14
28
|
export function txtField(id: string, label?: string, options?: TextInputOptions): Field {
|
|
@@ -19,11 +33,11 @@ export function txtField(id: string, label?: string, options?: TextInputOptions)
|
|
|
19
33
|
id,
|
|
20
34
|
label,
|
|
21
35
|
placeholder: options?.placeholder,
|
|
22
|
-
attrs: { type: options?.type },
|
|
36
|
+
attrs: { type: options?.type, pattern: options?.pattern },
|
|
23
37
|
};
|
|
24
38
|
}
|
|
25
39
|
|
|
26
|
-
export function slctField(id: string, label?: string, options?: Option[] | (() => Option[]), config?:
|
|
40
|
+
export function slctField(id: string, label?: string, options?: Option[] | (() => Option[]), config?: SlctInputOptions): Field {
|
|
27
41
|
return {
|
|
28
42
|
$el: 'select',
|
|
29
43
|
id,
|
|
@@ -33,11 +47,11 @@ export function slctField(id: string, label?: string, options?: Option[] | (() =
|
|
|
33
47
|
required: config?.required,
|
|
34
48
|
label,
|
|
35
49
|
defaultValue: config?.defaultValue,
|
|
36
|
-
attrs: { disabled: config?.disabled },
|
|
50
|
+
attrs: { disabled: config?.disabled, searchable: config?.searchable },
|
|
37
51
|
};
|
|
38
52
|
}
|
|
39
53
|
|
|
40
|
-
export function numField(id: string, label?: string, options?:
|
|
54
|
+
export function numField(id: string, label?: string, options?: NumFieldOptions): Field {
|
|
41
55
|
return {
|
|
42
56
|
$el: 'text',
|
|
43
57
|
class: options?.class,
|