@bagelink/vue 0.0.318 → 0.0.331
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/Badge.vue.d.ts +2 -2
- package/dist/components/Badge.vue.d.ts.map +1 -1
- package/dist/components/Card.vue.d.ts +2 -2
- package/dist/components/ComboBox.vue.d.ts +13 -2
- package/dist/components/ComboBox.vue.d.ts.map +1 -1
- package/dist/components/ListView.vue.d.ts.map +1 -1
- package/dist/components/Modal.vue.d.ts +0 -1
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/ModalBglForm.vue.d.ts.map +1 -1
- package/dist/components/Popover.vue.d.ts +10 -0
- package/dist/components/Popover.vue.d.ts.map +1 -0
- package/dist/components/form/BglField.vue.d.ts.map +1 -1
- package/dist/components/form/BglForm.vue.d.ts +1 -5
- package/dist/components/form/BglForm.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts +0 -1
- package/dist/components/form/inputs/TextArea.vue.d.ts +3 -1
- package/dist/components/form/inputs/TextArea.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TextInput.vue.d.ts +2 -0
- package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
- package/dist/components/formkit/index.d.ts +1 -14
- package/dist/components/formkit/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/layout/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/components/whatsapp/index.d.ts +0 -2
- package/dist/components/whatsapp/index.d.ts.map +1 -1
- package/dist/index.cjs +419 -569
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +419 -569
- package/dist/style.css +1815 -331
- package/dist/types/BagelForm.d.ts +1 -1
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/types/materialIcon.d.ts +2 -0
- package/dist/types/materialIcon.d.ts.map +1 -0
- package/dist/types/materialIcons.d.ts +1 -1
- package/dist/types/materialIcons.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts +23 -0
- package/dist/utils/BagelFormUtils.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Badge.vue +2 -2
- package/src/components/Carousel.vue +137 -137
- package/src/components/ComboBox.vue +79 -50
- package/src/components/ListView.vue +28 -27
- package/src/components/Modal.vue +25 -23
- package/src/components/form/BglField.vue +33 -48
- package/src/components/form/BglForm.vue +65 -49
- package/src/components/form/inputs/TextInput.vue +20 -4
- package/src/components/index.ts +1 -1
- package/src/components/layout/SidebarMenu.vue +4 -5
- package/src/components/whatsapp/index.ts +2 -2
- package/src/styles/appearance.css +39 -0
- package/src/styles/bagel.css +2 -0
- package/src/styles/layout.css +112 -6
- package/src/styles/mobilLayout.css +1416 -0
- package/src/styles/text.css +4 -0
- package/src/types/BagelForm.ts +7 -7
- package/src/types/materialIcons.ts +1183 -3006
- package/src/utils/BagelFormUtils.ts +58 -0
- package/src/utils/index.ts +3 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Field } from '@bagelink/vue';
|
|
2
|
+
|
|
3
|
+
export type Option = string | number | Record<string, any> | { label: string, value: string | number };
|
|
4
|
+
|
|
5
|
+
type TextInputOptions = {
|
|
6
|
+
required?: boolean;
|
|
7
|
+
type?: 'text' | 'tel' | 'email';
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
class?: string
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function txtField(id: string, label?: string, options?: TextInputOptions): Field {
|
|
15
|
+
return {
|
|
16
|
+
$el: 'text',
|
|
17
|
+
class: options?.class,
|
|
18
|
+
required: options?.required,
|
|
19
|
+
id,
|
|
20
|
+
label,
|
|
21
|
+
placeholder: options?.placeholder,
|
|
22
|
+
attrs: { type: options?.type },
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function slctField(id: string, label?: string, options?: Option[] | (() => Option[]), config?: TextInputOptions): Field {
|
|
27
|
+
return {
|
|
28
|
+
$el: 'select',
|
|
29
|
+
id,
|
|
30
|
+
options,
|
|
31
|
+
class: config?.class,
|
|
32
|
+
placeholder: config?.placeholder,
|
|
33
|
+
required: config?.required,
|
|
34
|
+
label,
|
|
35
|
+
defaultValue: config?.defaultValue,
|
|
36
|
+
attrs: { disabled: config?.disabled },
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function numField(id: string, label?: string, options?: TextInputOptions): Field {
|
|
41
|
+
return {
|
|
42
|
+
$el: 'text',
|
|
43
|
+
class: options?.class,
|
|
44
|
+
required: options?.required,
|
|
45
|
+
id,
|
|
46
|
+
label,
|
|
47
|
+
placeholder: options?.placeholder,
|
|
48
|
+
attrs: { type: 'number' },
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function frmRow(...children: Field[]) {
|
|
53
|
+
return {
|
|
54
|
+
$el: 'div',
|
|
55
|
+
class: 'flex gap-1 m_block',
|
|
56
|
+
children,
|
|
57
|
+
};
|
|
58
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -44,6 +44,7 @@ export function bindAttrs<T = Record<string, any>>(attrs?: Attributes, fieldVal?
|
|
|
44
44
|
key,
|
|
45
45
|
typeof value === 'function' ? value(fieldVal, row) : value,
|
|
46
46
|
]);
|
|
47
|
+
if (attrs.options) console.log('arr', arr);
|
|
47
48
|
const resolvedAttrs = Object.fromEntries(arr);
|
|
48
49
|
return resolvedAttrs;
|
|
49
50
|
}
|
|
@@ -59,3 +60,5 @@ export const iffer = (field: any, itemData: any) => {
|
|
|
59
60
|
export const denullify = (itemData?: Record<string, any>, fieldID?: string) => (fieldID && itemData ? itemData[fieldID] : null);
|
|
60
61
|
|
|
61
62
|
export { formatString } from './strings';
|
|
63
|
+
|
|
64
|
+
export * as bagelFormUtils from './BagelFormUtils';
|