@bagelink/vue 0.0.276 → 0.0.280
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/ComboBox.vue.d.ts +2 -0
- package/dist/components/ComboBox.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/CheckInput.vue.d.ts +9 -4
- package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/index.cjs +44 -40
- package/dist/index.mjs +44 -40
- package/dist/plugins/modal.d.ts +1 -1
- package/dist/plugins/modal.d.ts.map +1 -1
- package/dist/style.css +444 -469
- package/package.json +1 -1
- package/src/components/ComboBox.vue +75 -69
- package/src/components/form/inputs/CheckInput.vue +55 -53
- package/src/components/form/inputs/SelectInput.vue +272 -284
- package/src/components/formkit/Toggle.vue +85 -100
- package/src/plugins/modal.ts +23 -23
- package/src/styles/buttons.css +38 -40
- package/src/styles/inputs.css +100 -109
- package/src/styles/layout.css +0 -1
- package/src/styles/text.css +0 -21
|
@@ -1,164 +1,149 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="bagel-input checkbox"
|
|
4
|
-
:class="{ check: context?.attrs.isCheckbox }"
|
|
5
|
-
:title="context?.help"
|
|
6
|
-
>
|
|
2
|
+
<div class="bagel-input checkbox" :title="label">
|
|
7
3
|
<label class="switch">
|
|
8
|
-
<input
|
|
9
|
-
@change="() => props.context?.node.input(inputVal)"
|
|
10
|
-
type="checkbox"
|
|
11
|
-
v-model="inputVal"
|
|
12
|
-
:id="context?.id"
|
|
13
|
-
>
|
|
4
|
+
<input type="checkbox" v-model="inputVal" :id="id">
|
|
14
5
|
<span class="slider round" />
|
|
15
6
|
</label>
|
|
16
7
|
</div>
|
|
17
8
|
</template>
|
|
18
9
|
|
|
19
10
|
<script setup lang="ts">
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
defineProps<{
|
|
12
|
+
helpText?: string;
|
|
13
|
+
id: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
}>();
|
|
16
|
+
const inputVal = defineModel('modelValue', {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false,
|
|
24
19
|
});
|
|
25
|
-
|
|
26
|
-
let inputVal = $ref(false);
|
|
27
|
-
|
|
28
|
-
watch(
|
|
29
|
-
() => props.context?.value,
|
|
30
|
-
(newVal) => {
|
|
31
|
-
inputVal = newVal;
|
|
32
|
-
},
|
|
33
|
-
{ immediate: true },
|
|
34
|
-
);
|
|
35
20
|
</script>
|
|
36
21
|
|
|
37
22
|
<style>
|
|
38
23
|
.checkbox-label {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: 0.5rem;
|
|
26
|
+
flex-direction: row-reverse;
|
|
27
|
+
justify-content: flex-end;
|
|
28
|
+
align-items: center;
|
|
29
|
+
cursor: pointer;
|
|
45
30
|
}
|
|
46
31
|
</style>
|
|
47
32
|
|
|
48
33
|
<style scoped>
|
|
49
34
|
.no-edit {
|
|
50
|
-
|
|
35
|
+
pointer-events: none;
|
|
51
36
|
}
|
|
52
37
|
|
|
53
38
|
.radio-wrap p {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
display: inline-block;
|
|
40
|
+
color: var(--input-bg);
|
|
41
|
+
font-size: var(--input-font-size);
|
|
42
|
+
margin-inline-end: 10px;
|
|
58
43
|
}
|
|
59
44
|
|
|
60
45
|
.radio-wrap label {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
46
|
+
padding: 3px 5px;
|
|
47
|
+
display: inline-block;
|
|
48
|
+
border-radius: var(--input-border-radius);
|
|
49
|
+
font-size: var(--input-font-size);
|
|
50
|
+
background: var(--input-bg);
|
|
51
|
+
color: var(--bgl-black);
|
|
52
|
+
text-align: center;
|
|
53
|
+
margin: 8px 5px;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
user-select: none;
|
|
71
56
|
}
|
|
72
57
|
|
|
73
58
|
.bagel-input .radio-wrap label::after {
|
|
74
|
-
|
|
59
|
+
background: transparent;
|
|
75
60
|
}
|
|
76
61
|
|
|
77
62
|
.radio-wrap input {
|
|
78
|
-
|
|
63
|
+
display: none;
|
|
79
64
|
}
|
|
80
65
|
|
|
81
|
-
.radio-wrap input:checked:checked
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
.radio-wrap input:checked:checked+label {
|
|
67
|
+
background: var(--bgl-primary);
|
|
68
|
+
color: var(--bgl-white);
|
|
84
69
|
}
|
|
85
70
|
|
|
86
71
|
.checkbox {
|
|
87
|
-
|
|
72
|
+
position: relative;
|
|
88
73
|
}
|
|
89
74
|
|
|
90
75
|
.switch {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
76
|
+
position: relative;
|
|
77
|
+
display: inline-block;
|
|
78
|
+
height: calc(var(--input-height) / 2);
|
|
79
|
+
width: var(--input-height);
|
|
80
|
+
border-radius: var(--input-height);
|
|
96
81
|
}
|
|
97
82
|
|
|
98
83
|
.switch input {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
84
|
+
opacity: 0;
|
|
85
|
+
width: 0;
|
|
86
|
+
height: 0;
|
|
102
87
|
}
|
|
103
88
|
|
|
104
89
|
.bagel-input.checkbox.check {
|
|
105
|
-
|
|
90
|
+
margin: 0;
|
|
106
91
|
}
|
|
107
92
|
|
|
108
93
|
.bagel-input.checkbox.check .switch {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
94
|
+
width: calc(var(--input-height) / 2);
|
|
95
|
+
height: calc(var(--input-height) / 2);
|
|
96
|
+
transition: 0.2s;
|
|
112
97
|
}
|
|
113
98
|
|
|
114
99
|
.bagel-input.checkbox.check .slider:before {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
100
|
+
position: absolute;
|
|
101
|
+
font-family: "Material Symbols Outlined", serif;
|
|
102
|
+
content: "";
|
|
103
|
+
color: var(--bgl-white);
|
|
104
|
+
background: transparent;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
123
108
|
}
|
|
124
109
|
|
|
125
|
-
.bagel-input.checkbox.check input:checked
|
|
126
|
-
|
|
127
|
-
|
|
110
|
+
.bagel-input.checkbox.check input:checked+.slider:before {
|
|
111
|
+
transform: none;
|
|
112
|
+
content: "check";
|
|
128
113
|
}
|
|
129
114
|
|
|
130
115
|
.slider {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
116
|
+
position: absolute;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
top: 0;
|
|
119
|
+
left: 0;
|
|
120
|
+
right: 0;
|
|
121
|
+
bottom: 0;
|
|
122
|
+
background: var(--input-bg);
|
|
123
|
+
-webkit-transition: 0.4s;
|
|
124
|
+
transition: 0.4s;
|
|
125
|
+
border-radius: calc(var(--input-height) / 2);
|
|
126
|
+
box-shadow: inset 0 0 10px #00000020;
|
|
142
127
|
}
|
|
143
128
|
|
|
144
129
|
.slider:before {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
130
|
+
position: absolute;
|
|
131
|
+
content: "";
|
|
132
|
+
height: calc(var(--input-height) / 2 - 4px);
|
|
133
|
+
width: calc(var(--input-height) / 2 - 4px);
|
|
134
|
+
left: 2px;
|
|
135
|
+
bottom: 2px;
|
|
136
|
+
border-radius: 50%;
|
|
137
|
+
background: var(--bgl-white);
|
|
138
|
+
-webkit-transition: 0.4s;
|
|
139
|
+
transition: 0.4s;
|
|
155
140
|
}
|
|
156
141
|
|
|
157
|
-
input:checked
|
|
158
|
-
|
|
142
|
+
input:checked+.slider {
|
|
143
|
+
background: var(--bgl-primary);
|
|
159
144
|
}
|
|
160
145
|
|
|
161
|
-
input:checked
|
|
162
|
-
|
|
146
|
+
input:checked+.slider:before {
|
|
147
|
+
transform: translateX(calc(var(--input-height) / 2));
|
|
163
148
|
}
|
|
164
149
|
</style>
|
package/src/plugins/modal.ts
CHANGED
|
@@ -6,39 +6,39 @@ import type { BglFormSchemaT, BtnOptions } from '@bagelink/vue';
|
|
|
6
6
|
import { Modal, ModalForm } from '@bagelink/vue';
|
|
7
7
|
|
|
8
8
|
export interface ModalOptions {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
title?: string;
|
|
10
|
+
dismissable?: boolean;
|
|
11
|
+
side?: boolean;
|
|
12
|
+
actions?: BtnOptions[];
|
|
13
|
+
class?: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface ModalFormOptions {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
side?: boolean;
|
|
18
|
+
title?: string;
|
|
19
|
+
dismissable?: boolean;
|
|
20
|
+
schema: BglFormSchemaT<any> | (() => BglFormSchemaT) | BglFormSchemaT
|
|
21
|
+
onSubmit?: (formData: any) => Promise<void>;
|
|
22
|
+
onDelete?: (id: string) => Promise<void>;
|
|
23
|
+
onError?: ((err: any) => void);
|
|
24
|
+
modelValue?: Record<string, any>;
|
|
25
|
+
'onUpdate:modelValue'?: (val: any) => void;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export interface ModalComponentProps {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
componentSlots: Record<string, any>,
|
|
30
|
+
modalType: 'modal' | 'modalForm',
|
|
31
|
+
modalOptions: ModalOptions | ModalFormOptions
|
|
32
32
|
}
|
|
33
33
|
export interface ModalFormComponentProps {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
componentSlots: Record<string, any>,
|
|
35
|
+
modalType: 'modalForm',
|
|
36
|
+
modalOptions: ModalFormOptions
|
|
37
37
|
}
|
|
38
38
|
export interface ModalApi {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
showModal: (options: ModalOptions, slots?: Record<string, any>) => void;
|
|
40
|
+
showModalForm: (options: ModalFormOptions, slots?: Record<string, any>) => ModalFormComponentProps | undefined;
|
|
41
|
+
hideModal: (index?: number) => void;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export const ModalSymbol: InjectionKey<ModalApi> = Symbol('modal');
|
package/src/styles/buttons.css
CHANGED
|
@@ -1,61 +1,59 @@
|
|
|
1
|
-
button,
|
|
2
1
|
.bgl_btn,
|
|
3
2
|
.bgl_flatBtn,
|
|
4
3
|
.bgl_btn-icon {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
font-family: inherit;
|
|
5
|
+
white-space: nowrap;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
user-select: none;
|
|
9
|
+
border: none;
|
|
10
|
+
transition: var(--bgl-transition);
|
|
11
|
+
border-radius: var(--btn-border-radius);
|
|
12
|
+
line-height: var(--btn-height);
|
|
13
|
+
font-size: var(--input-font-size);
|
|
14
|
+
display: inline-block;
|
|
15
|
+
height: var(--btn-height);
|
|
16
|
+
padding: 0;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
.btn-close {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
margin-top: -20px;
|
|
21
|
+
margin-inline-end: -20px;
|
|
22
|
+
margin-inline-start: auto;
|
|
23
|
+
margin-bottom: 15px;
|
|
24
|
+
transition: var(--bgl-transition);
|
|
25
|
+
height: 30px;
|
|
26
|
+
width: 30px;
|
|
27
|
+
opacity: 0.6;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
border-radius: 100%;
|
|
30
|
+
outline: 2px solid transparent;
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
.btn-close:hover {
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
background: var(--bgl-gray-light);
|
|
38
|
+
opacity: 1;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
.btn-close:active {
|
|
43
|
-
|
|
42
|
+
background: var(--bgl-gray);
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
.btn-close::before {
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
content: "close";
|
|
47
|
+
font-family: "Material Symbols Outlined", serif;
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
|
|
52
50
|
.bgl_btn.thin {
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
height: calc(var(--btn-height) * 0.7);
|
|
52
|
+
line-height: calc(var(--btn-height) * 0.7);
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
@media screen and (max-width: 910px) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
56
|
+
.bgl_btn {
|
|
57
|
+
padding: 0 20px;
|
|
58
|
+
}
|
|
59
|
+
}
|