@bagelink/vue 0.0.190 → 0.0.196

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 (36) hide show
  1. package/dist/components/Btn.vue.d.ts +11 -8
  2. package/dist/components/Btn.vue.d.ts.map +1 -1
  3. package/dist/components/ListView.vue.d.ts.map +1 -1
  4. package/dist/components/form/inputs/DatePicker.vue.d.ts +4 -4
  5. package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
  6. package/dist/components/form/inputs/RadioPillsInput.vue.d.ts +31 -0
  7. package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -0
  8. package/dist/components/form/inputs/TextInput.vue.d.ts +5 -0
  9. package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
  10. package/dist/components/form/inputs/index.d.ts +1 -0
  11. package/dist/components/form/inputs/index.d.ts.map +1 -1
  12. package/dist/components/formkit/AddressArray.vue.d.ts.map +1 -1
  13. package/dist/components/formkit/BankDetailsArray.vue.d.ts.map +1 -1
  14. package/dist/components/formkit/ContactArrayFormKit.vue.d.ts.map +1 -1
  15. package/dist/index.cjs +13036 -3561
  16. package/dist/index.mjs +13037 -3562
  17. package/dist/style.css +479 -350
  18. package/dist/types/BtnOptions.d.ts +3 -2
  19. package/dist/types/BtnOptions.d.ts.map +1 -1
  20. package/dist/types/index.d.ts +1 -0
  21. package/dist/types/index.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/src/components/Btn.vue +169 -146
  24. package/src/components/ListView.vue +0 -1
  25. package/src/components/PersonPreview.vue +1 -1
  26. package/src/components/form/inputs/DatePicker.vue +96 -80
  27. package/src/components/form/inputs/RadioPillsInput.vue +89 -0
  28. package/src/components/form/inputs/TextInput.vue +56 -11
  29. package/src/components/form/inputs/index.ts +1 -0
  30. package/src/components/formkit/AddressArray.vue +173 -150
  31. package/src/components/formkit/BankDetailsArray.vue +197 -174
  32. package/src/components/formkit/ContactArrayFormKit.vue +140 -123
  33. package/src/styles/layout.css +83 -0
  34. package/src/styles/theme.css +45 -16
  35. package/src/types/BtnOptions.ts +4 -2
  36. package/src/types/index.ts +2 -0
@@ -1,7 +1,8 @@
1
- import type { MaterialIcons } from './materialIcons';
1
+ import type { ThemeType, MaterialIcons } from '.';
2
2
  export interface BtnOptions {
3
3
  onClick?: () => void;
4
- color?: 'light' | 'red' | 'gray' | 'black' | 'blue';
4
+ color?: ThemeType;
5
+ theme?: ThemeType;
5
6
  disabled?: boolean;
6
7
  icon?: MaterialIcons;
7
8
  flat?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"BtnOptions.d.ts","sourceRoot":"","sources":["../../src/types/BtnOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,UAAU;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"BtnOptions.d.ts","sourceRoot":"","sources":["../../src/types/BtnOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAElD,MAAM,WAAW,UAAU;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAC,SAAS,CAAC;IACjB,KAAK,CAAC,EAAC,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAEf"}
@@ -4,4 +4,5 @@ export type { Tables, TableToTypeMapping } from '@bagelink/sdk';
4
4
  export type { StorageFile } from './file';
5
5
  export * from './BagelField';
6
6
  export * from './BtnOptions';
7
+ export type ThemeType = 'light' | 'red' | 'gray' | 'gray-light' | 'black' | 'green';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACxE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACxE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAE7B,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,GAAG,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.190",
4
+ "version": "0.0.196",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -1,233 +1,256 @@
1
1
  <template>
2
- <component
3
- :is="to ? 'router-link' : is"
4
- :to="to"
5
- :type="type"
6
- :role="role"
7
- :disabled="disabled"
8
- :class="{
9
- [props.color]: true,
10
- 'btn-icon': icon && !slots['default'] && !value,
11
- btn: !icon || slots['default'] || value,
12
- thin: thin,
13
- round: round,
14
- 'btn-txt': flat,
15
- }"
16
- >
17
- <div class="loading" v-if="loading" />
18
- <div v-else class="btn-flex">
19
- <MaterialIcon v-if="icon" :icon="icon" />
20
- <slot />
21
- <template v-if="!slots['default'] && value">
22
- {{ value }}
23
- </template>
24
- <MaterialIcon v-if="props['icon.end']" :icon="props['icon.end']" />
25
- </div>
26
- </component>
2
+ <component
3
+ :is="to ? 'router-link' : is"
4
+ :to="to"
5
+ :type="type"
6
+ :role="role"
7
+ :disabled="disabled"
8
+ :class="{
9
+ 'btn-icon': icon && !slots['default'] && !value,
10
+ btn: !icon || slots['default'] || value,
11
+ thin,
12
+ round,
13
+ 'btn-txt': flat,
14
+ 'btn-border': border
15
+ }"
16
+ >
17
+ <div
18
+ class="loading"
19
+ v-if="loading"
20
+ />
21
+ <div
22
+ v-else
23
+ class="btn-flex"
24
+ >
25
+ <MaterialIcon
26
+ v-if="icon"
27
+ :icon="icon"
28
+ />
29
+ <slot />
30
+ <template v-if="!slots['default'] && value">
31
+ {{ value }}
32
+ </template>
33
+ <MaterialIcon
34
+ v-if="props['icon.end']"
35
+ :icon="props['icon.end']"
36
+ />
37
+ </div>
38
+ </component>
27
39
  </template>
28
40
 
29
41
  <script setup lang="ts">
30
- import { useSlots } from "vue";
42
+ import { useSlots } from 'vue';
31
43
 
32
44
  const slots = useSlots();
33
- import type { MaterialIcons } from "@bagelink/vue";
34
- import { MaterialIcon } from "@bagelink/vue";
45
+ import type { MaterialIcons, ThemeType } from '@bagelink/vue';
46
+ import { MaterialIcon } from '@bagelink/vue';
35
47
 
36
48
  const props = withDefaults(
37
- defineProps<{
38
- disabled?: boolean;
39
- icon?: MaterialIcons;
40
- "icon.end"?: MaterialIcons;
41
- color?:
42
- | "light"
43
- | "red"
44
- | "gray"
45
- | "gray-light"
46
- | "black"
47
- | "blue"
48
- | "green";
49
- flat?: boolean;
50
- thin?: boolean;
51
- type?: "button" | "submit" | "reset";
52
- loading?: boolean;
53
- role?: string;
54
- value?: string;
55
- to?: string;
56
- round?: boolean;
57
- is?: string;
58
- }>(),
59
- {
60
- loading: false,
61
- round: false,
62
- color: "gray",
63
- disabled: false,
64
- type: "button",
65
- role: "button",
66
- is: "button",
67
- }
49
+ defineProps<{
50
+ disabled?: boolean;
51
+ icon?: MaterialIcons;
52
+ 'icon.end'?: MaterialIcons;
53
+ color?: ThemeType;
54
+ theme?: ThemeType;
55
+ flat?: boolean;
56
+ border?: boolean;
57
+ thin?: boolean;
58
+ type?: 'button' | 'submit' | 'reset';
59
+ loading?: boolean;
60
+ role?: string;
61
+ value?: string;
62
+ to?: string;
63
+ round?: boolean;
64
+ is?: string;
65
+ borderColor?: string
66
+ }>(),
67
+ {
68
+ loading: false,
69
+ round: false,
70
+ disabled: false,
71
+ type: 'button',
72
+ role: 'button',
73
+ is: 'button',
74
+ },
75
+ );
76
+
77
+ const computedTheme = $computed(() => (props?.color || props?.theme));
78
+
79
+ const computedDefaultColors = $computed(
80
+ () => ({
81
+ backgroundColor: 'var(--bgl-primary)',
82
+ color: props.flat ? 'var(--bgl-black)' : 'var(--bgl-white)'
83
+ }
84
+ )
85
+ )
86
+
87
+ const themes: { [key in ThemeType]: typeof computedDefaultColors } = {
88
+ red: { ...computedDefaultColors, backgroundColor: 'var(--bgl-red)', },
89
+ black: { ...computedDefaultColors, backgroundColor: 'var(--bgl-black)' },
90
+ green: { ...computedDefaultColors, backgroundColor: 'var(--bgl-green)', color: 'var(--bgl-white)' },
91
+ gray: { ...computedDefaultColors, backgroundColor: 'var(--bgl-gray-light)', color: 'var(--bgl-black)' },
92
+ light: { ...computedDefaultColors, backgroundColor: 'var(--bgl-primary-light)', color: 'var(--bgl-primary)' },
93
+ 'gray-light': { ...computedDefaultColors, backgroundColor: 'var(--bgl-gray-light)', color: 'var(--bgl-gray)' },
94
+ };
95
+
96
+ const cumputedTextColor = $computed(
97
+ () => (themes?.[computedTheme as ThemeType]?.color || computedDefaultColors.color),
98
+ );
99
+
100
+ const computedBackgroundColor = $computed(
101
+ () => (themes?.[computedTheme as ThemeType]?.backgroundColor || computedDefaultColors.backgroundColor),
68
102
  );
69
103
  </script>
70
104
 
71
105
  <style scoped>
72
106
  .loading {
73
- border: 1px solid var(--bgl-white);
74
- border-bottom: 2px solid var(--bgl-white);
75
- animation: spin 1s linear infinite;
76
- border-radius: 100px;
77
- width: 1rem;
78
- height: 1rem;
79
- margin: auto;
107
+ border: 1px solid var(--bgl-white);
108
+ border-bottom: 2px solid var(--bgl-white);
109
+ animation: spin 1s linear infinite;
110
+ border-radius: 100px;
111
+ width: 1rem;
112
+ height: 1rem;
113
+ margin: auto;
80
114
  }
81
115
 
82
116
  @keyframes spin {
83
- 0% {
84
- transform: rotate(0deg);
85
- }
117
+ 0% {
118
+ transform: rotate(0deg);
119
+ }
86
120
 
87
- 100% {
88
- transform: rotate(360deg);
89
- }
121
+ 100% {
122
+ transform: rotate(360deg);
123
+ }
90
124
  }
91
125
 
92
126
  .btn-icon {
93
- height: var(--btn-height);
94
- width: var(--btn-height);
95
- border-radius: 100%;
96
- font-size: 1rem;
97
- background: var(--bgl-primary);
98
- color: var(--bgl-white);
99
- flex-shrink: 0;
100
- transition: var(--bgl-transition);
127
+ height: var(--btn-height);
128
+ width: var(--btn-height);
129
+ border-radius: 100%;
130
+ font-size: 1rem;
131
+ background: var(--bgl-primary);
132
+ color: var(--bgl-white);
133
+ flex-shrink: 0;
134
+ transition: var(--bgl-transition);
101
135
  }
102
136
 
103
137
  .btn {
104
- background: var(--bgl-primary);
105
- color: var(--bgl-white);
106
- padding-left: var(--btn-padding);
107
- padding-right: var(--btn-padding);
108
- transition: var(--bgl-transition);
109
- text-decoration: none;
138
+ background: var(--bgl-primary);
139
+ color: var(--bgl-white);
140
+ padding-left: var(--btn-padding);
141
+ padding-right: var(--btn-padding);
142
+ transition: var(--bgl-transition);
143
+ text-decoration: none;
110
144
  }
111
145
 
112
146
  .btn[disabled="true"] {
113
- opacity: 0.5;
114
- cursor: not-allowed;
147
+ opacity: 0.5;
148
+ cursor: not-allowed;
115
149
  }
116
150
 
117
151
  .btn-flex {
118
- display: flex;
119
- align-items: center;
120
- gap: 0.5rem;
121
- justify-content: center;
152
+ display: flex;
153
+ align-items: center;
154
+ gap: 0.5rem;
155
+ justify-content: center;
122
156
  }
123
157
 
124
158
  .btn .icon-font {
125
- font-size: calc(var(--input-font-size) * 1.3);
159
+ font-size: calc(var(--input-font-size) * 1.3);
126
160
  }
127
161
 
128
162
  .btn:hover,
129
163
  .btn-icon:hover {
130
- filter: var(--bgl-hover-filter);
164
+ filter: var(--bgl-hover-filter);
131
165
  }
132
166
 
133
167
  .btn:active,
134
168
  .btn-icon:active {
135
- filter: var(--bgl-active-filter);
136
- }
137
-
138
- .btn.red,
139
- .btn-icon.red {
140
- background: var(--bgl-red);
169
+ filter: var(--bgl-active-filter);
141
170
  }
142
171
 
143
- .btn.light,
144
- .btn-icon.light {
145
- background: var(--bgl-blue-light);
146
- color: var(--bgl-primary);
147
- }
148
-
149
- .btn.gray,
150
- .btn-icon.gray {
151
- background: var(--bgl-gray-light);
152
- color: var(--bgl-black);
153
- }
154
-
155
- .btn.green,
156
- .btn-icon.green {
157
- background: var(--bgl-green);
158
- color: var(--bgl-white);
159
- }
160
-
161
- .btn.gray-light,
162
- .btn-icon.gray-light {
163
- background: var(--bgl-gray-light);
164
- color: var(--bgl-gray);
165
- }
172
+ .btn,
173
+ .btn-icon {
174
+ background-color: v-bind(computedBackgroundColor);
175
+ color: v-bind(cumputedTextColor);
166
176
 
167
- .btn.black,
168
- .btn-icon.black {
169
- background: var(--bgl-black);
170
177
  }
171
178
 
172
179
  .btn.btn-txt {
173
- color: var(--bgl-primary);
174
- padding-left: var(--btn-padding);
175
- padding-right: var(--btn-padding);
176
- background: transparent;
180
+ color: var(--bgl-primary);
181
+ padding-left: var(--btn-padding);
182
+ padding-right: var(--btn-padding);
183
+ background: transparent;
177
184
  }
178
185
 
179
186
  .btn-icon.btn-txt {
180
- color: var(--bgl-primary);
181
- background: transparent;
187
+ color: var(--bgl-primary);
188
+ background: transparent;
182
189
  }
183
190
 
184
191
  .btn.btn-txt:hover,
185
192
  .btn-icon.btn-txt:hover {
186
- filter: var(--bgl-active-filter);
193
+ filter: var(--bgl-active-filter);
187
194
  }
188
195
 
189
196
  .btn.btn-txt:active,
190
197
  .btn-icon.btn-txt:active {
191
- background: var(--bgl-white);
192
- filter: var(--bgl-hover-filter);
198
+ background: var(--bgl-white);
199
+ filter: var(--bgl-hover-filter);
193
200
  }
194
201
 
195
202
  .btn.btn-txt.red,
196
203
  .btn-icon.btn-txt.red {
197
- color: var(--bgl-red);
204
+ color: var(--bgl-red);
198
205
  }
199
206
 
200
207
  .btn.btn-txt.light,
201
208
  .btn-icon.btn-txt.light {
202
- color: var(--bgl-primary-tint);
209
+ color: var(--bgl-primary-tint);
203
210
  }
204
211
 
205
212
  .btn.btn-txt.black,
206
213
  .btn-icon.btn-txt.black {
207
- color: var(--bgl-black);
214
+ color: var(--bgl-black);
208
215
  }
209
216
 
210
217
  .btn.btn-txt.gray,
211
218
  .btn-icon.btn-txt.gray {
212
- color: var(--bgl-gray);
219
+ color: var(--bgl-gray);
213
220
  }
214
221
 
215
222
  .btn.thin {
216
- padding-left: calc(var(--btn-padding) / 2);
217
- padding-right: calc(var(--btn-padding) / 2);
223
+ padding-left: calc(var(--btn-padding) / 2);
224
+ padding-right: calc(var(--btn-padding) / 2);
218
225
  }
219
226
 
220
227
  .btn.round {
221
- border-radius: calc(var(--btn-border-radius) * 2);
228
+ border-radius: calc(var(--btn-border-radius) * 2);
222
229
  }
223
230
 
224
231
  .btn-icon.thin {
225
- height: calc(var(--btn-height) / 1.5);
226
- width: calc(var(--btn-height) / 1.5);
227
- line-height: 1;
232
+ height: calc(var(--btn-height) / 1.5);
233
+ width: calc(var(--btn-height) / 1.5);
234
+ line-height: 1;
228
235
  }
229
236
 
230
237
  [dir="rtl"] .icon-font {
231
- transform: rotateY(180deg);
238
+ transform: rotateY(180deg);
239
+ }
240
+
241
+ .btn-border {
242
+ outline: 1px solid v-bind(computedBackgroundColor);
243
+ color: v-bind(computedBackgroundColor);
244
+ background: var(--bgl-white);
245
+ }
246
+
247
+ .btn-border:hover {
248
+ color: v-bind(cumputedTextColor);
249
+ background: v-bind(computedBackgroundColor);
250
+ filter: brightness(100%);
251
+ }
252
+
253
+ .btn-border:active {
254
+ filter: brightness(80%);
232
255
  }
233
256
  </style>
@@ -16,7 +16,6 @@
16
16
  />
17
17
  </div>
18
18
  <Btn
19
- color="blue"
20
19
  v-if="enableAdd"
21
20
  icon="add"
22
21
  @click="emit('add')"
@@ -91,7 +91,7 @@ const props = defineProps<{
91
91
  personSchema: () => FormKitSchemaDefinition;
92
92
  }>();
93
93
 
94
- const showEditForm = async () => {
94
+ const showEditForm = () => {
95
95
  const { first_name, last_name } = props.person;
96
96
  modalForm({
97
97
  side: true,