@bagelink/vue 0.0.316 → 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 (58) 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 +1 -0
  8. package/dist/components/Modal.vue.d.ts.map +1 -1
  9. package/dist/components/NavBar.vue.d.ts.map +1 -1
  10. package/dist/components/form/BglField.vue.d.ts.map +1 -1
  11. package/dist/components/form/BglForm.vue.d.ts +50 -27
  12. package/dist/components/form/BglForm.vue.d.ts.map +1 -1
  13. package/dist/components/form/inputs/DateInput.vue.d.ts +1 -0
  14. package/dist/components/form/inputs/TextInput.vue.d.ts +2 -0
  15. package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
  16. package/dist/components/index.d.ts +0 -1
  17. package/dist/components/index.d.ts.map +1 -1
  18. package/dist/components/layout/Layout.vue.d.ts +3 -3
  19. package/dist/components/layout/Layout.vue.d.ts.map +1 -1
  20. package/dist/components/layout/SidebarMenu.vue.d.ts +1 -7
  21. package/dist/components/layout/SidebarMenu.vue.d.ts.map +1 -1
  22. package/dist/components/whatsapp/index.d.ts +0 -2
  23. package/dist/components/whatsapp/index.d.ts.map +1 -1
  24. package/dist/index.cjs +417 -568
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.mjs +417 -568
  27. package/dist/style.css +224 -258
  28. package/dist/types/BagelForm.d.ts +1 -1
  29. package/dist/types/BagelForm.d.ts.map +1 -1
  30. package/dist/types/NavLink.d.ts +2 -1
  31. package/dist/types/NavLink.d.ts.map +1 -1
  32. package/dist/types/materialIcons.d.ts +1 -1
  33. package/dist/types/materialIcons.d.ts.map +1 -1
  34. package/dist/utils/BagelFormUtils.d.ts +23 -0
  35. package/dist/utils/BagelFormUtils.d.ts.map +1 -0
  36. package/dist/utils/index.d.ts +1 -0
  37. package/dist/utils/index.d.ts.map +1 -1
  38. package/package.json +2 -2
  39. package/src/components/Badge.vue +2 -2
  40. package/src/components/Carousel.vue +137 -137
  41. package/src/components/ComboBox.vue +72 -49
  42. package/src/components/ListView.vue +28 -27
  43. package/src/components/Modal.vue +25 -23
  44. package/src/components/NavBar.vue +46 -40
  45. package/src/components/form/BglField.vue +33 -48
  46. package/src/components/form/BglForm.vue +34 -15
  47. package/src/components/form/inputs/TextInput.vue +121 -151
  48. package/src/components/index.ts +1 -1
  49. package/src/components/layout/Layout.vue +3 -2
  50. package/src/components/layout/SidebarMenu.vue +5 -12
  51. package/src/components/whatsapp/index.ts +2 -2
  52. package/src/styles/layout.css +24 -1
  53. package/src/styles/text.css +4 -0
  54. package/src/types/BagelForm.ts +7 -7
  55. package/src/types/NavLink.ts +2 -1
  56. package/src/types/materialIcons.ts +1183 -3006
  57. package/src/utils/BagelFormUtils.ts +58 -0
  58. 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';