@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.
- package/dist/components/Btn.vue.d.ts +11 -8
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/ListView.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts +4 -4
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts +31 -0
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/TextInput.vue.d.ts +5 -0
- package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/index.d.ts +1 -0
- package/dist/components/form/inputs/index.d.ts.map +1 -1
- package/dist/components/formkit/AddressArray.vue.d.ts.map +1 -1
- package/dist/components/formkit/BankDetailsArray.vue.d.ts.map +1 -1
- package/dist/components/formkit/ContactArrayFormKit.vue.d.ts.map +1 -1
- package/dist/index.cjs +13036 -3561
- package/dist/index.mjs +13037 -3562
- package/dist/style.css +479 -350
- package/dist/types/BtnOptions.d.ts +3 -2
- package/dist/types/BtnOptions.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Btn.vue +169 -146
- package/src/components/ListView.vue +0 -1
- package/src/components/PersonPreview.vue +1 -1
- package/src/components/form/inputs/DatePicker.vue +96 -80
- package/src/components/form/inputs/RadioPillsInput.vue +89 -0
- package/src/components/form/inputs/TextInput.vue +56 -11
- package/src/components/form/inputs/index.ts +1 -0
- package/src/components/formkit/AddressArray.vue +173 -150
- package/src/components/formkit/BankDetailsArray.vue +197 -174
- package/src/components/formkit/ContactArrayFormKit.vue +140 -123
- package/src/styles/layout.css +83 -0
- package/src/styles/theme.css +45 -16
- package/src/types/BtnOptions.ts +4 -2
- package/src/types/index.ts +2 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { MaterialIcons } from '
|
|
1
|
+
import type { ThemeType, MaterialIcons } from '.';
|
|
2
2
|
export interface BtnOptions {
|
|
3
3
|
onClick?: () => void;
|
|
4
|
-
color?:
|
|
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,
|
|
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"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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
package/src/components/Btn.vue
CHANGED
|
@@ -1,233 +1,256 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
|
42
|
+
import { useSlots } from 'vue';
|
|
31
43
|
|
|
32
44
|
const slots = useSlots();
|
|
33
|
-
import type { MaterialIcons } from
|
|
34
|
-
import { MaterialIcon } from
|
|
45
|
+
import type { MaterialIcons, ThemeType } from '@bagelink/vue';
|
|
46
|
+
import { MaterialIcon } from '@bagelink/vue';
|
|
35
47
|
|
|
36
48
|
const props = withDefaults(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
117
|
+
0% {
|
|
118
|
+
transform: rotate(0deg);
|
|
119
|
+
}
|
|
86
120
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
121
|
+
100% {
|
|
122
|
+
transform: rotate(360deg);
|
|
123
|
+
}
|
|
90
124
|
}
|
|
91
125
|
|
|
92
126
|
.btn-icon {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
114
|
-
|
|
147
|
+
opacity: 0.5;
|
|
148
|
+
cursor: not-allowed;
|
|
115
149
|
}
|
|
116
150
|
|
|
117
151
|
.btn-flex {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
159
|
+
font-size: calc(var(--input-font-size) * 1.3);
|
|
126
160
|
}
|
|
127
161
|
|
|
128
162
|
.btn:hover,
|
|
129
163
|
.btn-icon:hover {
|
|
130
|
-
|
|
164
|
+
filter: var(--bgl-hover-filter);
|
|
131
165
|
}
|
|
132
166
|
|
|
133
167
|
.btn:active,
|
|
134
168
|
.btn-icon:active {
|
|
135
|
-
|
|
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
|
|
144
|
-
.btn-icon
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
181
|
-
|
|
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
|
-
|
|
193
|
+
filter: var(--bgl-active-filter);
|
|
187
194
|
}
|
|
188
195
|
|
|
189
196
|
.btn.btn-txt:active,
|
|
190
197
|
.btn-icon.btn-txt:active {
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
204
|
+
color: var(--bgl-red);
|
|
198
205
|
}
|
|
199
206
|
|
|
200
207
|
.btn.btn-txt.light,
|
|
201
208
|
.btn-icon.btn-txt.light {
|
|
202
|
-
|
|
209
|
+
color: var(--bgl-primary-tint);
|
|
203
210
|
}
|
|
204
211
|
|
|
205
212
|
.btn.btn-txt.black,
|
|
206
213
|
.btn-icon.btn-txt.black {
|
|
207
|
-
|
|
214
|
+
color: var(--bgl-black);
|
|
208
215
|
}
|
|
209
216
|
|
|
210
217
|
.btn.btn-txt.gray,
|
|
211
218
|
.btn-icon.btn-txt.gray {
|
|
212
|
-
|
|
219
|
+
color: var(--bgl-gray);
|
|
213
220
|
}
|
|
214
221
|
|
|
215
222
|
.btn.thin {
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
228
|
+
border-radius: calc(var(--btn-border-radius) * 2);
|
|
222
229
|
}
|
|
223
230
|
|
|
224
231
|
.btn-icon.thin {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
|
|
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>
|