@bagelink/vue 0.0.268 → 0.0.276

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 (49) hide show
  1. package/dist/components/Accordion.vue.d.ts +10 -0
  2. package/dist/components/Accordion.vue.d.ts.map +1 -0
  3. package/dist/components/AccordionItem.vue.d.ts +2 -0
  4. package/dist/components/AccordionItem.vue.d.ts.map +1 -1
  5. package/dist/components/Btn.vue.d.ts +3 -3
  6. package/dist/components/ComboBox.vue.d.ts +32 -0
  7. package/dist/components/ComboBox.vue.d.ts.map +1 -0
  8. package/dist/components/ModalForm.vue.d.ts.map +1 -1
  9. package/dist/components/Popover.vue.d.ts +10 -0
  10. package/dist/components/Popover.vue.d.ts.map +1 -0
  11. package/dist/components/Title.vue.d.ts +1 -1
  12. package/dist/components/form/BglField.vue.d.ts.map +1 -1
  13. package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
  14. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  15. package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
  16. package/dist/components/form/inputs/index.d.ts +0 -1
  17. package/dist/components/form/inputs/index.d.ts.map +1 -1
  18. package/dist/components/index.d.ts +3 -0
  19. package/dist/components/index.d.ts.map +1 -1
  20. package/dist/index.cjs +12380 -10473
  21. package/dist/index.mjs +12658 -10751
  22. package/dist/plugins/bagel.d.ts.map +1 -1
  23. package/dist/plugins/modal.d.ts +1 -1
  24. package/dist/plugins/modal.d.ts.map +1 -1
  25. package/dist/style.css +309 -277
  26. package/dist/types/BagelForm.d.ts +1 -1
  27. package/dist/types/BagelForm.d.ts.map +1 -1
  28. package/dist/utils/clickOutside.d.ts +7 -0
  29. package/dist/utils/clickOutside.d.ts.map +1 -0
  30. package/package.json +3 -2
  31. package/src/components/Accordion.vue +15 -0
  32. package/src/components/AccordionItem.vue +48 -24
  33. package/src/components/ComboBox.vue +132 -0
  34. package/src/components/ModalForm.vue +7 -35
  35. package/src/components/form/BglField.vue +22 -7
  36. package/src/components/form/BglFieldSet.vue +13 -0
  37. package/src/components/form/BglForm.vue +5 -22
  38. package/src/components/form/inputs/DateInput.vue +6 -2
  39. package/src/components/form/inputs/SelectInput.vue +2 -9
  40. package/src/components/form/inputs/TextInput.vue +12 -8
  41. package/src/components/form/inputs/index.ts +0 -1
  42. package/src/components/index.ts +3 -0
  43. package/src/plugins/bagel.ts +14 -2
  44. package/src/plugins/modal.ts +1 -1
  45. package/src/styles/layout.css +191 -188
  46. package/src/styles/text.css +40 -43
  47. package/src/types/BagelForm.ts +20 -20
  48. package/src/utils/clickOutside.ts +15 -0
  49. package/src/components/form/inputs/TextArea.vue +0 -81
@@ -1,4 +1,4 @@
1
- h1,
1
+ /* h1,
2
2
  h2,
3
3
  h3,
4
4
  h4,
@@ -17,116 +17,113 @@ h4 {}
17
17
 
18
18
  h5 {}
19
19
 
20
- h6 {}
20
+ h6 {} */
21
21
 
22
22
  .txt-center {
23
- text-align: center;
23
+ text-align: center;
24
24
  }
25
25
 
26
26
  .txt-start {
27
- text-align: start;
27
+ text-align: start;
28
28
  }
29
29
 
30
30
  .txt-end {
31
- text-align: end;
31
+ text-align: end;
32
32
  }
33
33
 
34
-
35
34
  .smalltxt {
36
- font-size: 12px;
35
+ font-size: 12px;
37
36
  }
38
37
 
39
-
40
38
  .txt20 {
41
- font-size: 20px;
39
+ font-size: 20px;
42
40
  }
43
41
 
44
42
  .txt18 {
45
- font-size: 18px;
43
+ font-size: 18px;
46
44
  }
47
45
 
48
46
  .txt16 {
49
- font-size: 16px;
47
+ font-size: 16px;
50
48
  }
51
49
 
52
50
  .txt14 {
53
- font-size: 14px;
51
+ font-size: 14px;
54
52
  }
55
53
 
56
54
  .txt12 {
57
- font-size: 12px;
55
+ font-size: 12px;
58
56
  }
59
57
 
60
58
  .txt10 {
61
- font-size: 10px;
59
+ font-size: 10px;
62
60
  }
63
61
 
64
62
  .txt9 {
65
- font-size: 9px;
63
+ font-size: 9px;
66
64
  }
67
65
 
68
66
  .no-margin {
69
- margin: 0;
67
+ margin: 0;
70
68
  }
71
69
 
72
70
  .txtgray {
73
- color: var(--bgl-gray);
71
+ color: var(--bgl-gray);
74
72
  }
75
73
 
76
74
  .txtblue {
77
- color: var(--bgl-primary);
75
+ color: var(--bgl-primary);
78
76
  }
79
77
 
80
78
  .txtblack {
81
- color: var(--bgl-black);
79
+ color: var(--bgl-black);
82
80
  }
83
81
 
84
82
  .txtred {
85
- color: var(--bgl-red);
83
+ color: var(--bgl-red);
86
84
  }
87
85
 
88
86
  .font-light {
89
- font-weight: 100;
87
+ font-weight: 100;
90
88
  }
91
89
 
92
90
  .bold {
93
- font-weight: 700;
91
+ font-weight: 700;
94
92
  }
95
93
 
96
94
  .line-height-1 {
97
- line-height: 1;
95
+ line-height: 1;
98
96
  }
99
97
 
100
98
  .ellipsis {
101
- overflow: hidden;
102
- display: block;
103
- width: 100%;
104
- text-overflow: ellipsis;
99
+ overflow: hidden;
100
+ display: block;
101
+ width: 100%;
102
+ text-overflow: ellipsis;
105
103
  }
106
104
 
107
105
  .pointer {
108
- cursor: pointer;
106
+ cursor: pointer;
109
107
  }
110
108
 
111
109
  .decoration-none {
112
- text-decoration: none;
110
+ text-decoration: none;
113
111
  }
114
112
 
115
113
  .bgl_icon-font {
116
- font-family: "Material Symbols Outlined", serif;
114
+ font-family: "Material Symbols Outlined", serif;
117
115
  }
118
116
 
119
-
120
117
  @media screen and (max-width: 910px) {
121
- .txt20 {
122
- font-size: 18px;
123
- }
124
-
125
- .txt16 {
126
- font-size: 14px;
127
- }
128
-
129
- .txt14 {
130
- font-size: 12px;
131
- }
132
- }
118
+ .txt20 {
119
+ font-size: 18px;
120
+ }
121
+
122
+ .txt16 {
123
+ font-size: 14px;
124
+ }
125
+
126
+ .txt14 {
127
+ font-size: 12px;
128
+ }
129
+ }
@@ -5,35 +5,35 @@ export type AttributeValue = string | number | boolean | null | undefined | Reco
5
5
  export type AttributeFn<T = Record<string, any>> = (field: any, row: T) => AttributeValue;
6
6
 
7
7
  export interface Attributes<T = any> {
8
- [key: string]: AttributeValue | AttributeFn<T>
8
+ [key: string]: AttributeValue | AttributeFn<T>
9
9
  }
10
10
 
11
11
  export type BaseBagelField<T = Record<string, any>> = {
12
- $el?: any;
13
- id?: string;
14
- label?: string;
15
- placeholder?: string;
16
- children?: Field<T>[];
17
- class?: AttributeValue | AttributeFn<T>,
18
- attrs?: Attributes<T>;
19
- required?: boolean;
20
- helptext?: string;
21
- options?: string | ({ label?: string; value: string | number } | string | number | Record<string, any>)[],
22
- defaultValue?: any;
23
- transform?: (val?: any, rowData?: Record<string, any>) => any;
24
- onUpdate?: (val: any, fieldData?: any, rowData?: Record<string, any>) => void;
25
- 'v-if'?: string | boolean | ((val: any, row: T) => boolean);
12
+ $el?: any;
13
+ id?: string;
14
+ label?: string;
15
+ placeholder?: string;
16
+ children?: Field<T>[];
17
+ class?: AttributeValue | AttributeFn<T>,
18
+ attrs?: Attributes<T>;
19
+ required?: boolean;
20
+ helptext?: string;
21
+ options?: string | ({ label?: string; value: string | number } | string | number | Record<string, any>)[],
22
+ defaultValue?: any;
23
+ transform?: (val?: any, rowData?: Record<string, any>) => any;
24
+ onUpdate?: (val: any, rowData?: Record<string, any>) => void;
25
+ 'v-if'?: string | boolean | ((val: any, row: T) => boolean);
26
26
  }
27
27
 
28
28
  export interface InputBagelField<T> extends BaseBagelField<T> {
29
- $el: 'text' | typeof TextInput;
30
- id: string;
31
- type?: string;
29
+ $el: 'text' | typeof TextInput;
30
+ id: string;
31
+ type?: string;
32
32
  }
33
33
 
34
34
  export interface SelectBagelField<T> extends BaseBagelField<T> {
35
- $el: 'select' | typeof SelectInput;
36
- id: string;
35
+ $el: 'select' | typeof SelectInput;
36
+ id: string;
37
37
  }
38
38
 
39
39
  export type Field<T = Record<string, any>> = BaseBagelField<T> | InputBagelField<T> | SelectBagelField<T>;
@@ -0,0 +1,15 @@
1
+ import type { DirectiveBinding } from 'vue';
2
+
3
+ export default {
4
+ beforeMount(el: any, binding: DirectiveBinding) {
5
+ el.clickOutsideEvent = (event: MouseEvent) => {
6
+ if (!(el === event.target || el.contains(event.target))) {
7
+ binding.value(event);
8
+ }
9
+ };
10
+ document.addEventListener('click', el.clickOutsideEvent);
11
+ },
12
+ unmounted(el: any) {
13
+ document.removeEventListener('click', el.clickOutsideEvent);
14
+ },
15
+ };
@@ -1,81 +0,0 @@
1
- <template>
2
- <div
3
- class="bagel-input"
4
- :title="description"
5
- :class="{ small: small }"
6
- >
7
- <label v-if="label">
8
- <LangText :input="label" />
9
- </label>
10
- <span
11
- class="character-limit"
12
- v-if="showCharacterLimit"
13
- >
14
- {{ modelValue?.length }}
15
- {{ nativeInputAttrs?.maxlength ? `/${nativeInputAttrs.maxlength}` : '' }}
16
- </span>
17
- <textarea
18
- :value="modelValue"
19
- @input="handleInput"
20
- :class="{ 'no-edit': !editMode }"
21
- v-bind="nativeInputAttrs"
22
- :required
23
- />
24
- </div>
25
- </template>
26
-
27
- <script setup lang="ts">
28
- import { LangText } from '@bagelink/vue';
29
-
30
- const emits = defineEmits(['update:modelValue']);
31
-
32
- withDefaults(
33
- defineProps<{
34
- description?: string;
35
- label?: string;
36
- modelValue: any;
37
- placeholder?: string;
38
- editMode?: boolean;
39
- small?: boolean;
40
- nativeInputAttrs?: Record<string, any>;
41
- showCharacterLimit?: boolean;
42
- required?: boolean;
43
- }>(),
44
- {
45
- description: '',
46
- editMode: true,
47
- placeholder: '',
48
- label: '',
49
- },
50
- );
51
- const handleInput = (e: Event) => {
52
- const el = e.target as HTMLInputElement;
53
- emits('update:modelValue', el.value);
54
- };
55
- </script>
56
-
57
- <style scoped>
58
- .bagel-input {
59
- height: 100%;
60
- margin: 0;
61
- }
62
-
63
- .bagel-input label {
64
- margin-bottom: 0;
65
- }
66
-
67
- .bagel-input textarea {
68
- height: 100%;
69
- resize: none;
70
- background: var(--input-bg);
71
- margin-bottom: 0.5rem;
72
- }
73
-
74
- .character-limit {
75
- font-size: 0.6rem;
76
- color: var(--input-color);
77
- position: absolute;
78
- top: 0.25rem;
79
- inset-inline-end: 0;
80
- }
81
- </style>