@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.
@@ -1,6 +1,10 @@
1
1
  import type { Field } from '@bagelink/vue';
2
2
 
3
- export type Option = string | number | Record<string, any> | { label: string, value: string | number };
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(id: string, label?: string, options?: RichTextOptions) {
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(id: string, label?: string, options?: TextInputOptions): Field {
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: { type: options?.type, pattern: options?.pattern, multiline: options?.multiline },
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(id: string, label?: string, options?: Option[] | (() => Option[]), config?: SlctInputOptions): Field {
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: { disabled: config?.disabled, searchable: config?.searchable, multiselect: config?.multiselect },
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(id: string, label?: string, options?: NumFieldOptions): Field {
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(id: string, label?: string, options?: NumFieldOptions): Field {
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 mt-1',
129
+ class: 'flex gap-1 m_block',
96
130
  children,
97
131
  };
98
132
  }