@bagelink/vue 0.0.192 → 0.0.198

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.
@@ -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.192",
4
+ "version": "0.0.198",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -10,7 +10,7 @@
10
10
  btn: !icon || slots['default'] || value,
11
11
  thin,
12
12
  round,
13
- 'btn-txt': flat,
13
+ 'flatBtn': flat,
14
14
  'btn-border': border
15
15
  }"
16
16
  >
@@ -42,18 +42,16 @@
42
42
  import { useSlots } from 'vue';
43
43
 
44
44
  const slots = useSlots();
45
- import type { MaterialIcons } from '@bagelink/vue';
45
+ import type { MaterialIcons, ThemeType } from '@bagelink/vue';
46
46
  import { MaterialIcon } from '@bagelink/vue';
47
47
 
48
- type ThemeTypes = 'light' | 'red' | 'gray' | 'gray-light' | 'black' | 'green';
49
-
50
48
  const props = withDefaults(
51
49
  defineProps<{
52
50
  disabled?: boolean;
53
51
  icon?: MaterialIcons;
54
52
  'icon.end'?: MaterialIcons;
55
- color?: ThemeTypes;
56
- theme?: ThemeTypes;
53
+ color?: ThemeType;
54
+ theme?: ThemeType;
57
55
  flat?: boolean;
58
56
  border?: boolean;
59
57
  thin?: boolean;
@@ -64,7 +62,6 @@ const props = withDefaults(
64
62
  to?: string;
65
63
  round?: boolean;
66
64
  is?: string;
67
- borderColor?: string
68
65
  }>(),
69
66
  {
70
67
  loading: false,
@@ -76,25 +73,32 @@ const props = withDefaults(
76
73
  },
77
74
  );
78
75
 
79
- const computedTheme = $computed(() => (props?.color || props?.theme));
80
-
81
- const defaultColors = { backgroundColor: 'var(--bgl-primary)', color: 'var(--bgl-white)' };
76
+ const computedTheme = $computed(
77
+ () => (props?.color || props?.theme)
78
+ );
82
79
 
83
- const themes: { [key in ThemeTypes]: typeof defaultColors } = {
84
- red: { ...defaultColors, backgroundColor: 'var(--bgl-red)', },
85
- black: { ...defaultColors, backgroundColor: 'var(--bgl-black)' },
86
- green: { ...defaultColors, backgroundColor: 'var(--bgl-green)', color: 'var(--bgl-white)' },
87
- gray: { ...defaultColors, backgroundColor: 'var(--bgl-gray-light)', color: 'var(--bgl-black)' },
88
- light: { ...defaultColors, backgroundColor: 'var(--bgl-primary-light)', color: 'var(--bgl-primary)' },
89
- 'gray-light': { ...defaultColors, backgroundColor: 'var(--bgl-gray-light)', color: 'var(--bgl-gray)' },
80
+ const computedDefaultColors = $computed(
81
+ () => ({
82
+ backgroundColor: 'var(--bgl-primary)',
83
+ color: props.flat ? 'var(--bgl-black)' : 'var(--bgl-white)'
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)' },
90
94
  };
91
95
 
92
96
  const cumputedTextColor = $computed(
93
- () => (themes?.[computedTheme as ThemeTypes]?.color || defaultColors.color),
97
+ () => (themes?.[computedTheme as ThemeType]?.color || computedDefaultColors.color),
94
98
  );
95
99
 
96
100
  const computedBackgroundColor = $computed(
97
- () => (themes?.[computedTheme as ThemeTypes]?.backgroundColor || defaultColors.backgroundColor),
101
+ () => (themes?.[computedTheme as ThemeType]?.backgroundColor || computedDefaultColors.backgroundColor),
98
102
  );
99
103
  </script>
100
104
 
@@ -131,8 +135,6 @@ const computedBackgroundColor = $computed(
131
135
  }
132
136
 
133
137
  .btn {
134
- background: var(--bgl-primary);
135
- color: var(--bgl-white);
136
138
  padding-left: var(--btn-padding);
137
139
  padding-right: var(--btn-padding);
138
140
  transition: var(--bgl-transition);
@@ -155,6 +157,12 @@ const computedBackgroundColor = $computed(
155
157
  font-size: calc(var(--input-font-size) * 1.3);
156
158
  }
157
159
 
160
+ .btn,
161
+ .btn-icon {
162
+ background-color: v-bind(computedBackgroundColor);
163
+ color: v-bind(cumputedTextColor);
164
+ }
165
+
158
166
  .btn:hover,
159
167
  .btn-icon:hover {
160
168
  filter: var(--bgl-hover-filter);
@@ -165,53 +173,45 @@ const computedBackgroundColor = $computed(
165
173
  filter: var(--bgl-active-filter);
166
174
  }
167
175
 
168
- .btn,
169
- .btn-icon {
170
- background-color: v-bind(computedBackgroundColor);
171
- color: v-bind(cumputedTextColor);
172
-
173
- }
174
176
 
175
- .btn.btn-txt {
176
- color: var(--bgl-primary);
177
+ .btn.flatBtn {
177
178
  padding-left: var(--btn-padding);
178
179
  padding-right: var(--btn-padding);
179
180
  background: transparent;
180
181
  }
181
182
 
182
- .btn-icon.btn-txt {
183
- color: var(--bgl-primary);
183
+ .btn-icon.flatBtn {
184
184
  background: transparent;
185
185
  }
186
186
 
187
- .btn.btn-txt:hover,
188
- .btn-icon.btn-txt:hover {
187
+ .btn.flatBtn:hover,
188
+ .btn-icon.flatBtn:hover {
189
189
  filter: var(--bgl-active-filter);
190
190
  }
191
191
 
192
- .btn.btn-txt:active,
193
- .btn-icon.btn-txt:active {
192
+ .btn.flatBtn:active,
193
+ .btn-icon.flatBtn:active {
194
194
  background: var(--bgl-white);
195
195
  filter: var(--bgl-hover-filter);
196
196
  }
197
197
 
198
- .btn.btn-txt.red,
199
- .btn-icon.btn-txt.red {
198
+ .btn.flatBtn.red,
199
+ .btn-icon.flatBtn.red {
200
200
  color: var(--bgl-red);
201
201
  }
202
202
 
203
- .btn.btn-txt.light,
204
- .btn-icon.btn-txt.light {
203
+ .btn.flatBtn.light,
204
+ .btn-icon.flatBtn.light {
205
205
  color: var(--bgl-primary-tint);
206
206
  }
207
207
 
208
- .btn.btn-txt.black,
209
- .btn-icon.btn-txt.black {
208
+ .btn.flatBtn.black,
209
+ .btn-icon.flatBtn.black {
210
210
  color: var(--bgl-black);
211
211
  }
212
212
 
213
- .btn.btn-txt.gray,
214
- .btn-icon.btn-txt.gray {
213
+ .btn.flatBtn.gray,
214
+ .btn-icon.flatBtn.gray {
215
215
  color: var(--bgl-gray);
216
216
  }
217
217
 
@@ -237,11 +237,11 @@ const computedBackgroundColor = $computed(
237
237
  .btn-border {
238
238
  outline: 1px solid v-bind(computedBackgroundColor);
239
239
  color: v-bind(computedBackgroundColor);
240
- background: var(--bgl-white);
240
+ background: transparent;
241
241
  }
242
242
 
243
243
  .btn-border:hover {
244
- color: v-bind(cumputedTextColor);
244
+ color: var(--bgl-white);
245
245
  background: v-bind(computedBackgroundColor);
246
246
  filter: brightness(100%);
247
247
  }
@@ -193,7 +193,7 @@ onMounted(() => {
193
193
  cursor: grab;
194
194
  }
195
195
 
196
- .btn.thin.btn-txt {
196
+ .btn.thin.flatBtn {
197
197
  margin-inline-start: -1rem;
198
198
  margin-top: 1rem;
199
199
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  class="bagel-input"
4
- :class="{ small, shrink, toggleEdit, editMode, textInputIconWrap:icon, txtInputIconStart:iconStart}"
4
+ :class="{ small, shrink, toggleEdit, editMode, textInputIconWrap: icon, txtInputIconStart: iconStart }"
5
5
  :title="title"
6
6
  >
7
7
  <label :for="id">
@@ -138,21 +138,24 @@ watch(
138
138
  .textInputIconWrap {
139
139
  position: relative;
140
140
  }
141
+
141
142
  .textInputIconWrap .icon-font {
142
143
  position: absolute;
143
144
  inset-inline-end: 0.7rem;
144
- top:50%;
145
+ bottom: 50%;
145
146
  line-height: 0;
146
- color: var(--bgl-gray);
147
+ color: var(--bgl-gray);
147
148
  }
148
- .txtInputIconStart .iconStart{
149
+
150
+ .txtInputIconStart .iconStart {
149
151
  position: absolute;
150
152
  inset-inline-start: 0.7rem;
151
- top:50%;
153
+ top: 50%;
152
154
  line-height: 0;
153
- color: var(--bgl-gray);
155
+ color: var(--bgl-gray);
154
156
  }
155
- .txtInputIconStart input{
157
+
158
+ .txtInputIconStart input {
156
159
  padding-inline-start: 2rem;
157
160
  }
158
161
 
@@ -195,7 +195,7 @@ watch(
195
195
  min-width: 0;
196
196
  }
197
197
 
198
- .light.thin.btn-txt.btn {
198
+ .light.thin.flatBtn.btn {
199
199
  padding-left: calc(var(--btn-padding) / 4);
200
200
  padding-right: calc(var(--btn-padding) / 4);
201
201
  }
@@ -246,4 +246,5 @@ watch(
246
246
  .bglform-contact-label {
247
247
  min-width: 0;
248
248
  }
249
- }</style>
249
+ }
250
+ </style>
@@ -219,7 +219,7 @@ watch(
219
219
  min-width: 0;
220
220
  }
221
221
 
222
- .light.thin.btn-txt.btn {
222
+ .light.thin.flatBtn.btn {
223
223
  padding-left: calc(var(--btn-padding) / 4);
224
224
  padding-right: calc(var(--btn-padding) / 4);
225
225
  }
@@ -270,4 +270,5 @@ watch(
270
270
  .bglform-contact-label {
271
271
  min-width: 0;
272
272
  }
273
- }</style>
273
+ }
274
+ </style>
@@ -161,7 +161,7 @@ watch(
161
161
  min-width: 0;
162
162
  }
163
163
 
164
- .light.thin.btn-txt.btn {
164
+ .light.thin.flatBtn.btn {
165
165
  padding-left: calc(var(--btn-padding) / 4);
166
166
  padding-right: calc(var(--btn-padding) / 4);
167
167
  }
@@ -199,4 +199,5 @@ watch(
199
199
  .bglform-contact-label {
200
200
  min-width: 0;
201
201
  }
202
- }</style>
202
+ }
203
+ </style>
@@ -1,74 +1,74 @@
1
1
  <template>
2
- <div class="misc-wrap">
3
- <Btn
4
- class="add-btn"
5
- color="gray"
6
- flat
7
- @click="addToField(field)"
8
- v-for="(field, i) in fields.filter(
2
+ <div class="misc-wrap">
3
+ <Btn
4
+ class="add-btn"
5
+ color="gray"
6
+ flat
7
+ @click="addToField(field)"
8
+ v-for="(field, i) in fields.filter(
9
9
  (field: any) => field.value?.length === 0,
10
10
  )"
11
- :key="i"
12
- thin
13
- >
14
- {{ addBtnLabel }} {{ field.context?.label }}
15
- </Btn>
16
- </div>
11
+ :key="i"
12
+ thin
13
+ >
14
+ {{ addBtnLabel }} {{ field.context?.label }}
15
+ </Btn>
16
+ </div>
17
17
  </template>
18
18
 
19
19
  <script lang="ts" setup>
20
20
  import { Btn } from "@bagelink/vue";
21
21
 
22
22
  const props = defineProps<{
23
- context: Record<string, any>;
24
- addBtnLabel: string;
23
+ context: Record<string, any>;
24
+ addBtnLabel: string;
25
25
  }>();
26
26
 
27
27
  const fields = $computed(() => props.context?.node?.parent?.children || []);
28
28
 
29
29
  const addToField = (field: any) => {
30
- field.input([{}]);
31
- console.log(fields);
30
+ field.input([{}]);
31
+ console.log(fields);
32
32
  };
33
33
  </script>
34
34
 
35
35
  <style scoped>
36
36
  .misc-wrap {
37
- display: flex;
38
- gap: 1rem;
39
- border-top: 1px solid var(--border-color);
40
- padding-top: 0.5rem;
41
- margin-bottom: auto;
37
+ display: flex;
38
+ gap: 1rem;
39
+ border-top: 1px solid var(--border-color);
40
+ padding-top: 0.5rem;
41
+ margin-bottom: auto;
42
42
  }
43
43
 
44
- .gray.thin.btn-txt.btn.add-btn {
45
- display: flex;
46
- gap: 0.5rem;
47
- align-items: center;
48
- padding-left: 0;
49
- padding-right: 0;
50
- transition: var(--bgl-transition);
44
+ .gray.thin.flatBtn.btn.add-btn {
45
+ display: flex;
46
+ gap: 0.5rem;
47
+ align-items: center;
48
+ padding-left: 0;
49
+ padding-right: 0;
50
+ transition: var(--bgl-transition);
51
51
  }
52
52
 
53
53
  .add-btn:active {
54
- background: none !important;
54
+ background: none !important;
55
55
  }
56
56
 
57
57
  .add-btn::before {
58
- content: "+";
59
- font-size: 10px;
60
- background: var(--bgl-gray-light);
61
- border-radius: 100%;
62
- height: 14px;
63
- width: 14px;
64
- display: flex;
65
- align-items: center;
66
- justify-content: center;
67
- color: var(--bgl-gray);
58
+ content: "+";
59
+ font-size: 10px;
60
+ background: var(--bgl-gray-light);
61
+ border-radius: 100%;
62
+ height: 14px;
63
+ width: 14px;
64
+ display: flex;
65
+ align-items: center;
66
+ justify-content: center;
67
+ color: var(--bgl-gray);
68
68
  }
69
69
 
70
70
  .add-btn:hover::before {
71
- background: var(--bgl-primary);
72
- color: var(--bgl-white);
71
+ background: var(--bgl-primary);
72
+ color: var(--bgl-white);
73
73
  }
74
74
  </style>
@@ -1,6 +1,6 @@
1
1
  button,
2
2
  .btn,
3
- .btn-txt,
3
+ .flatBtn,
4
4
  .btn-icon {
5
5
  font-family: inherit;
6
6
  white-space: nowrap;
@@ -291,12 +291,12 @@ label.active {
291
291
  display: none;
292
292
  }
293
293
 
294
- .label-count-0 button.btn.btn-txt {
294
+ .label-count-0 button.btn.flatBtn {
295
295
  /* background: var(--bgl-blue-light); */
296
296
  margin-right: 5px;
297
297
  }
298
298
 
299
- .label-count-0 button.btn.btn-txt:hover {
299
+ .label-count-0 button.btn.flatBtn:hover {
300
300
  background: var(--bgl-hover-filter);
301
301
  }
302
302
 
@@ -48,7 +48,7 @@
48
48
  }
49
49
 
50
50
  .align-items-end {
51
- align-items: end;
51
+ align-items: end !important;
52
52
  }
53
53
 
54
54
  .fit-content {
@@ -1,8 +1,9 @@
1
- import type { MaterialIcons } from './materialIcons';
1
+ import type { ThemeType, MaterialIcons } from '.';
2
2
 
3
3
  export interface BtnOptions {
4
4
  onClick?: () => void;
5
- color?: 'light' | 'red' | 'gray' | 'black' | 'blue';
5
+ color?:ThemeType;
6
+ theme?:ThemeType;
6
7
  disabled?: boolean;
7
8
  icon?: MaterialIcons;
8
9
  flat?: boolean;
@@ -11,4 +12,5 @@ export interface BtnOptions {
11
12
  loading?: boolean;
12
13
  role?: string;
13
14
  value?: string;
15
+
14
16
  }
@@ -4,3 +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
+
8
+ export type ThemeType = 'light' | 'red' | 'gray' | 'gray-light' | 'black' | 'green';