@bagelink/vue 0.0.276 → 0.0.282
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 +25 -17
- package/dist/index.mjs +25 -17
- package/dist/plugins/modal.d.ts +1 -1
- package/dist/plugins/modal.d.ts.map +1 -1
- package/dist/style.css +861 -641
- package/package.json +1 -1
- package/src/components/ComboBox.vue +15 -10
- 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 +13 -3
- package/src/styles/inputs.css +100 -109
- package/src/styles/layout.css +449 -191
- package/src/styles/text.css +80 -59
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Dropdown placement="auto-start" class="bagel-input combobox">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<button type="button" class="combobox-btn" @click="toggle">
|
|
4
|
+
{{ valueToLabel(selectedItem) || placeholder || 'Select' }}
|
|
5
|
+
<MaterialIcon v-bind="{ 'icon': open ? 'unfold_less' : 'unfold_more' }" />
|
|
6
|
+
</button>
|
|
7
|
+
<input style="width: 0; height: 0; position: absolute; opacity: 0; z-index: -1;" v-if="required"
|
|
8
|
+
v-model="selectedItem" required>
|
|
9
9
|
<template #popper="{ hide }">
|
|
10
|
-
<Card
|
|
10
|
+
<Card thin class="combobox-options">
|
|
11
11
|
<TextInput v-if="searchable" ref="searchInput" dense :placeholder="'Search'" icon="search" v-model="search" />
|
|
12
12
|
<div class="combobox-option" v-for="(option, i) in filteredOptions" :key="`${option}${i}`" @click="() => {
|
|
13
13
|
select(option)
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
import { Dropdown } from 'floating-vue';
|
|
28
28
|
import 'floating-vue/style.css';
|
|
29
29
|
import {
|
|
30
|
-
TextInput,
|
|
30
|
+
TextInput, Card, Icon, MaterialIcon,
|
|
31
31
|
} from '@bagelink/vue';
|
|
32
32
|
|
|
33
33
|
type Option = string | number | Record<string, any> | { label: string, value: string | number };
|
|
@@ -42,6 +42,7 @@ const props = defineProps<{
|
|
|
42
42
|
disabled?: boolean;
|
|
43
43
|
modelValue?: Option;
|
|
44
44
|
searchable?: boolean;
|
|
45
|
+
required?: boolean;
|
|
45
46
|
}>();
|
|
46
47
|
let search = $ref('');
|
|
47
48
|
|
|
@@ -102,7 +103,7 @@ const select = (option: Option) => {
|
|
|
102
103
|
transition: all 0.2s;
|
|
103
104
|
display: flex;
|
|
104
105
|
justify-content: space-between;
|
|
105
|
-
width:
|
|
106
|
+
width: 100%;
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
.combobox-options {
|
|
@@ -116,8 +117,12 @@ const select = (option: Option) => {
|
|
|
116
117
|
</style>
|
|
117
118
|
|
|
118
119
|
<style>
|
|
119
|
-
.combobox-btn
|
|
120
|
+
.combobox-btn {
|
|
121
|
+
display: flex;
|
|
120
122
|
justify-content: space-between;
|
|
123
|
+
align-items: center;
|
|
124
|
+
height: var(--input-height);
|
|
125
|
+
border-radius: var(--input-border-radius);
|
|
121
126
|
}
|
|
122
127
|
|
|
123
128
|
.v-popper__arrow-container {
|
|
@@ -1,95 +1,97 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
<div class="bagel-input bgl-checkbox" :title="title" :class="{ small: small }">
|
|
3
|
+
<div class="check-square" :class="{ checked: checked }" @click="checked = !checked">
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24">
|
|
5
|
+
<path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z" />
|
|
6
|
+
</svg>
|
|
7
|
+
</div>
|
|
8
|
+
<label>
|
|
9
|
+
<input :required="required" :id="id" type="checkbox" v-model="checked">
|
|
10
|
+
<slot name="label">
|
|
11
|
+
{{ label }}
|
|
12
|
+
</slot>
|
|
13
|
+
</label>
|
|
14
|
+
</div>
|
|
13
15
|
</template>
|
|
14
16
|
|
|
15
17
|
<script setup lang="ts">
|
|
16
18
|
defineProps<{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
label?: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
small?: boolean;
|
|
23
|
+
required?: boolean
|
|
22
24
|
}>();
|
|
23
25
|
|
|
24
26
|
const checked = defineModel<boolean>('modelValue', { default: false });
|
|
25
27
|
</script>
|
|
26
28
|
<style>
|
|
27
29
|
:root {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
--bgl-white: #fff;
|
|
31
|
+
--input-height: 40px;
|
|
32
|
+
--input-border-radius: 7px;
|
|
33
|
+
--bgl-transition: all 200ms ease;
|
|
34
|
+
--bgl-primary: #19b8ea;
|
|
33
35
|
|
|
34
36
|
}
|
|
35
37
|
</style>
|
|
36
38
|
<style scoped>
|
|
37
39
|
.bgl-checkbox {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
position: relative;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
align-items: center;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
.bgl-checkbox input[type=checkbox] {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
position: absolute;
|
|
48
|
+
opacity: 0;
|
|
49
|
+
z-index: -1;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
.bgl-checkbox label {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
padding-inline-start: 0.5rem;
|
|
54
|
+
transition: var(--bgl-transition);
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
user-select: none;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
.bgl-checkbox:hover {
|
|
58
|
-
|
|
60
|
+
filter: brightness(95%);
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
.bgl-checkbox:active {
|
|
62
|
-
|
|
64
|
+
filter: var(--bgl-active-filter);
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
.bgl-checkbox .check-square {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
width: calc(var(--input-height) / 2.5);
|
|
69
|
+
height: calc(var(--input-height) / 2.5);
|
|
70
|
+
background: var(--bgl-white);
|
|
71
|
+
border-radius: calc(var(--input-border-radius) / 2);
|
|
72
|
+
border: var(--bgl-primary) 1px solid;
|
|
73
|
+
position: relative;
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
.check-square.checked {
|
|
78
|
-
|
|
80
|
+
background: var(--bgl-primary);
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
.bgl-checkbox svg {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
width: calc(var(--input-height) / 2.5);
|
|
85
|
+
height: calc(var(--input-height) / 2.5);
|
|
86
|
+
position: absolute;
|
|
87
|
+
z-index: 2;
|
|
88
|
+
fill: var(--bgl-white);
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
transform: scale(0);
|
|
91
|
+
transition: var(--bgl-transition);
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
.check-square.checked svg {
|
|
93
|
-
|
|
95
|
+
transform: scale(1);
|
|
94
96
|
}
|
|
95
97
|
</style>
|