@bagelink/vue 0.0.318 → 0.0.322

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.
Files changed (46) hide show
  1. package/dist/components/Badge.vue.d.ts +2 -2
  2. package/dist/components/Badge.vue.d.ts.map +1 -1
  3. package/dist/components/Card.vue.d.ts +2 -2
  4. package/dist/components/ComboBox.vue.d.ts +13 -2
  5. package/dist/components/ComboBox.vue.d.ts.map +1 -1
  6. package/dist/components/ListView.vue.d.ts.map +1 -1
  7. package/dist/components/Modal.vue.d.ts.map +1 -1
  8. package/dist/components/form/BglField.vue.d.ts.map +1 -1
  9. package/dist/components/form/BglForm.vue.d.ts +4 -0
  10. package/dist/components/form/BglForm.vue.d.ts.map +1 -1
  11. package/dist/components/form/inputs/TextInput.vue.d.ts +2 -0
  12. package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
  13. package/dist/components/index.d.ts +0 -1
  14. package/dist/components/index.d.ts.map +1 -1
  15. package/dist/components/layout/SidebarMenu.vue.d.ts.map +1 -1
  16. package/dist/components/whatsapp/index.d.ts +0 -2
  17. package/dist/components/whatsapp/index.d.ts.map +1 -1
  18. package/dist/index.cjs +415 -566
  19. package/dist/index.mjs +415 -566
  20. package/dist/style.css +179 -213
  21. package/dist/types/BagelForm.d.ts +1 -1
  22. package/dist/types/BagelForm.d.ts.map +1 -1
  23. package/dist/types/materialIcons.d.ts +1 -1
  24. package/dist/types/materialIcons.d.ts.map +1 -1
  25. package/dist/utils/BagelFormUtils.d.ts +23 -0
  26. package/dist/utils/BagelFormUtils.d.ts.map +1 -0
  27. package/dist/utils/index.d.ts +1 -0
  28. package/dist/utils/index.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/src/components/Badge.vue +2 -2
  31. package/src/components/Carousel.vue +137 -137
  32. package/src/components/ComboBox.vue +72 -49
  33. package/src/components/ListView.vue +28 -27
  34. package/src/components/Modal.vue +25 -23
  35. package/src/components/form/BglField.vue +33 -48
  36. package/src/components/form/BglForm.vue +34 -15
  37. package/src/components/form/inputs/TextInput.vue +121 -151
  38. package/src/components/index.ts +1 -1
  39. package/src/components/layout/SidebarMenu.vue +4 -5
  40. package/src/components/whatsapp/index.ts +2 -2
  41. package/src/styles/layout.css +24 -1
  42. package/src/styles/text.css +4 -0
  43. package/src/types/BagelForm.ts +7 -7
  44. package/src/types/materialIcons.ts +1183 -3006
  45. package/src/utils/BagelFormUtils.ts +58 -0
  46. 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',
56
+ children,
57
+ };
58
+ }
@@ -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';