@bagelink/vue 0.0.160 → 0.0.164
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 +2 -2
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/Comments.vue.d.ts.map +1 -1
- package/dist/components/DropDown.vue.d.ts.map +1 -1
- package/dist/components/FileUploader.vue.d.ts.map +1 -1
- package/dist/components/LangText.vue.d.ts.map +1 -1
- package/dist/components/NavBar.vue.d.ts.map +1 -1
- package/dist/components/PersonPreview.vue.d.ts +1 -1
- package/dist/components/PersonPreview.vue.d.ts.map +1 -1
- package/dist/components/PersonPreviewFormkit.vue.d.ts +1 -1
- package/dist/components/PersonPreviewFormkit.vue.d.ts.map +1 -1
- package/dist/components/RTXEditor.vue.d.ts.map +1 -1
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/charts/BarChart.vue.d.ts.map +1 -1
- package/dist/components/dashboard/Lineart.vue.d.ts +1 -1
- package/dist/components/dashboard/Lineart.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/PasswordInput.vue.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/components/formkit/FileUploader.vue.d.ts.map +1 -1
- package/dist/components/formkit/MiscFields.vue.d.ts.map +1 -1
- package/dist/index.cjs +60 -49
- package/dist/index.mjs +60 -49
- package/dist/style.css +1468 -1402
- package/package.json +2 -2
- package/src/components/Btn.vue +127 -132
- package/src/components/Comments.vue +155 -169
- package/src/components/DropDown.vue +73 -77
- package/src/components/FileUploader.vue +133 -141
- package/src/components/FormKitTable.vue +191 -205
- package/src/components/LangText.vue +14 -14
- package/src/components/NavBar.vue +264 -261
- package/src/components/PersonPreview.vue +123 -148
- package/src/components/PersonPreviewFormkit.vue +124 -148
- package/src/components/RTXEditor.vue +91 -91
- package/src/components/TableSchema.vue +150 -156
- package/src/components/charts/BarChart.vue +212 -227
- package/src/components/dashboard/Lineart.vue +117 -130
- package/src/components/form/inputs/CheckInput.vue +90 -90
- package/src/components/form/inputs/Checkbox.vue +38 -41
- package/src/components/form/inputs/PasswordInput.vue +56 -63
- package/src/components/formkit/AddressArray.vue +150 -173
- package/src/components/formkit/BankDetailsArray.vue +175 -198
- package/src/components/formkit/ContactArrayFormKit.vue +124 -142
- package/src/components/formkit/FileUploader.vue +256 -260
- package/src/components/formkit/MiscFields.vue +42 -42
- package/src/components/formkit/Toggle.vue +97 -97
- package/src/styles/bagel.css +1 -0
- package/src/styles/buttons.css +5 -0
- package/src/styles/dark.css +46 -0
- package/src/styles/fonts/Ploni.css +8 -8
- package/src/styles/inputs.css +57 -13
- package/src/styles/layout.css +43 -0
- package/src/styles/text.css +83 -10
- package/src/styles/theme.css +25 -155
- package/src/styles/fonts/Ploni/ploni-black.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-black.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-black.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-bold.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-bold.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-bold.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-demibold.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-demibold.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-demibold.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-light.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-light.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-light.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-medium.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-medium.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-medium.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-regular.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-regular.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-regular.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-ultrabold.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-ultrabold.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-ultrabold.woff2 +0 -0
- package/src/styles/fonts/Ploni/ploni-ultralight.eot +0 -0
- package/src/styles/fonts/Ploni/ploni-ultralight.woff +0 -0
- package/src/styles/fonts/Ploni/ploni-ultralight.woff2 +0 -0
|
@@ -1,113 +1,100 @@
|
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<stop
|
|
45
|
-
offset="0%"
|
|
46
|
-
:stop-color="BRAND_COLOR"
|
|
47
|
-
stop-opacity="1"
|
|
48
|
-
/>
|
|
49
|
-
<stop
|
|
50
|
-
offset="100%"
|
|
51
|
-
stop-color="white"
|
|
52
|
-
stop-opacity="0.4"
|
|
53
|
-
/>
|
|
54
|
-
</linearGradient>
|
|
55
|
-
</defs>
|
|
56
|
-
</template>
|
|
57
|
-
<template #widgets>
|
|
58
|
-
<Tooltip
|
|
59
|
-
color="white"
|
|
60
|
-
:config="tooltipConfiguration"
|
|
61
|
-
/>
|
|
62
|
-
</template>
|
|
63
|
-
</Chart>
|
|
64
|
-
</div>
|
|
2
|
+
<div ref="chartContainer" class="chart-line">
|
|
3
|
+
<Chart
|
|
4
|
+
v-if="chartSize"
|
|
5
|
+
:size="chartSize"
|
|
6
|
+
:data="data"
|
|
7
|
+
:margin="chartMargin"
|
|
8
|
+
:axis="axisConfig"
|
|
9
|
+
>
|
|
10
|
+
<template #layers>
|
|
11
|
+
<Grid :center="true" strokeDasharray="2,2" :hideY="true" />
|
|
12
|
+
<Area
|
|
13
|
+
aria-label="Profit/Loss"
|
|
14
|
+
:dataKeys="['date', 'total_value']"
|
|
15
|
+
type="monotone"
|
|
16
|
+
:areaStyle="{ fill: 'url(#grad)' }"
|
|
17
|
+
/>
|
|
18
|
+
<Line
|
|
19
|
+
:dataKeys="['date', 'total_value']"
|
|
20
|
+
type="monotone"
|
|
21
|
+
:dotStyle="dotStyling"
|
|
22
|
+
:lineStyle="{ stroke: BRAND_COLOR, r: 2 }"
|
|
23
|
+
/>
|
|
24
|
+
<Marker
|
|
25
|
+
v-if="displayMarker"
|
|
26
|
+
:value="meanValue"
|
|
27
|
+
label="ממוצע"
|
|
28
|
+
:color="BRAND_COLOR"
|
|
29
|
+
:strokeWidth="2"
|
|
30
|
+
strokeDasharray="6 6"
|
|
31
|
+
/>
|
|
32
|
+
<defs>
|
|
33
|
+
<linearGradient id="grad" gradientTransform="rotate(90)">
|
|
34
|
+
<stop offset="0%" :stop-color="BRAND_COLOR" stop-opacity="1" />
|
|
35
|
+
<stop offset="100%" stop-color="white" stop-opacity="0.4" />
|
|
36
|
+
</linearGradient>
|
|
37
|
+
</defs>
|
|
38
|
+
</template>
|
|
39
|
+
<template #widgets>
|
|
40
|
+
<Tooltip color="white" :config="tooltipConfiguration" />
|
|
41
|
+
</template>
|
|
42
|
+
</Chart>
|
|
43
|
+
</div>
|
|
65
44
|
</template>
|
|
66
45
|
|
|
67
46
|
<script lang="ts" setup>
|
|
68
|
-
import { onMounted, onUnmounted } from
|
|
69
|
-
import {
|
|
70
|
-
|
|
71
|
-
} from 'vue3-charts';
|
|
72
|
-
import type { ChartAxis, Data } from 'vue3-charts/dist/types';
|
|
47
|
+
import { onMounted, onUnmounted } from "vue";
|
|
48
|
+
import { Chart, Grid, Line, Area, Tooltip, Marker } from "vue3-charts";
|
|
49
|
+
import type { ChartAxis, Data } from "vue3-charts/dist/types";
|
|
73
50
|
|
|
74
|
-
const props = defineProps<{ data: Data[]
|
|
51
|
+
const props = defineProps<{ data: Data[]; locale: string }>();
|
|
75
52
|
|
|
76
|
-
const data = $computed(() =>
|
|
53
|
+
const data = $computed(() =>
|
|
54
|
+
props.locale === "he" ? [...props.data].reverse() : props.data
|
|
55
|
+
);
|
|
77
56
|
|
|
78
57
|
interface Size {
|
|
79
|
-
|
|
80
|
-
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
81
60
|
}
|
|
82
61
|
|
|
83
62
|
// Computed properties
|
|
84
63
|
const meanValue = $computed(() => {
|
|
85
|
-
|
|
86
|
-
|
|
64
|
+
const sum = props.data.reduce((acc, curr) => acc + +curr.total_value, 0);
|
|
65
|
+
return sum / props.data.length;
|
|
87
66
|
});
|
|
88
67
|
|
|
89
68
|
const axisConfig = $computed<ChartAxis>(() => ({
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
69
|
+
primary: {
|
|
70
|
+
type: "band",
|
|
71
|
+
rotate: true,
|
|
72
|
+
ticks: 5,
|
|
73
|
+
domain: ["dataMin", "dataMax"],
|
|
74
|
+
tickValues:
|
|
75
|
+
props.data?.length > 100 ? [""] : props.data.map((d: any) => d.date),
|
|
76
|
+
},
|
|
77
|
+
secondary: {
|
|
78
|
+
domain: ["dataMin", "dataMax * 1.05"],
|
|
79
|
+
type: "linear",
|
|
80
|
+
ticks: 8,
|
|
81
|
+
},
|
|
102
82
|
}));
|
|
103
83
|
|
|
104
84
|
// Constants
|
|
105
|
-
const BRAND_COLOR =
|
|
85
|
+
const BRAND_COLOR = "var(--bgl-primary)";
|
|
106
86
|
|
|
107
87
|
const tooltipConfiguration = {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
88
|
+
date: { label: "תאריך" },
|
|
89
|
+
total_value: {
|
|
90
|
+
color: BRAND_COLOR,
|
|
91
|
+
label: "סכום",
|
|
92
|
+
format: (v: number) => `₪${v.toLocaleString()}`,
|
|
93
|
+
},
|
|
94
|
+
total_count: {
|
|
95
|
+
label: "מספר התרומות",
|
|
96
|
+
format: (v: number) => `${v.toLocaleString()}`,
|
|
97
|
+
},
|
|
111
98
|
};
|
|
112
99
|
|
|
113
100
|
// Refs
|
|
@@ -115,83 +102,83 @@ let chartSize = $ref<Size | null>(null);
|
|
|
115
102
|
const chartContainer = $ref<HTMLElement>();
|
|
116
103
|
const displayMarker = $ref(true);
|
|
117
104
|
const chartMargin = $ref({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
105
|
+
left: 0,
|
|
106
|
+
top: 0,
|
|
107
|
+
right: 0,
|
|
108
|
+
bottom: 0,
|
|
122
109
|
});
|
|
123
110
|
|
|
124
111
|
// Functions
|
|
125
112
|
const adjustChartSize = () => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
113
|
+
chartSize = null;
|
|
114
|
+
const el = chartContainer;
|
|
115
|
+
if (!el) return;
|
|
116
|
+
const { width, height } = el.getBoundingClientRect();
|
|
117
|
+
chartSize = { width: width - 5, height: height - 10 };
|
|
118
|
+
console.log(chartSize);
|
|
132
119
|
};
|
|
133
120
|
|
|
134
121
|
const handleResize = () => {
|
|
135
|
-
|
|
122
|
+
setTimeout(adjustChartSize, 300);
|
|
136
123
|
};
|
|
137
124
|
|
|
138
125
|
// Lifecycle hooks
|
|
139
126
|
onMounted(() => {
|
|
140
|
-
|
|
141
|
-
|
|
127
|
+
adjustChartSize();
|
|
128
|
+
window.addEventListener("resize", handleResize);
|
|
142
129
|
});
|
|
143
130
|
|
|
144
131
|
onUnmounted(() => {
|
|
145
|
-
|
|
132
|
+
window.removeEventListener("resize", handleResize);
|
|
146
133
|
});
|
|
147
134
|
|
|
148
135
|
// Style Configurations
|
|
149
136
|
const dotStyling = (ctx: Record<string, any>) => ({
|
|
150
|
-
|
|
151
|
-
|
|
137
|
+
r: ctx.active ? 5 : 1,
|
|
138
|
+
fill: BRAND_COLOR,
|
|
152
139
|
});
|
|
153
140
|
</script>
|
|
154
141
|
|
|
155
142
|
<style>
|
|
156
143
|
.chart-line {
|
|
157
|
-
|
|
158
|
-
|
|
144
|
+
width: 100%;
|
|
145
|
+
height: 300px;
|
|
159
146
|
}
|
|
160
147
|
|
|
161
|
-
[dir=
|
|
162
|
-
|
|
148
|
+
[dir="rtl"] .chart-line {
|
|
149
|
+
direction: ltr;
|
|
163
150
|
}
|
|
164
151
|
|
|
165
|
-
.chart-line .v-tooltip-content>div {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
152
|
+
.chart-line .v-tooltip-content > div {
|
|
153
|
+
border: none !important;
|
|
154
|
+
border-radius: 6px !important;
|
|
155
|
+
background-color: black !important;
|
|
156
|
+
opacity: 0.7;
|
|
157
|
+
padding: 0.5rem 1rem !important;
|
|
158
|
+
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
|
|
159
|
+
font-weight: 300;
|
|
173
160
|
}
|
|
174
161
|
|
|
175
|
-
.chart-line .v-tooltip-content>div b {
|
|
176
|
-
|
|
162
|
+
.chart-line .v-tooltip-content > div b {
|
|
163
|
+
font-weight: 400;
|
|
177
164
|
}
|
|
178
165
|
|
|
179
166
|
.layer-grid g:last-child {
|
|
180
|
-
|
|
167
|
+
display: none;
|
|
181
168
|
}
|
|
182
169
|
|
|
183
170
|
.layer-axis-x .tick:nth-child(2n + 1) {
|
|
184
|
-
|
|
171
|
+
opacity: 0;
|
|
185
172
|
}
|
|
186
173
|
|
|
187
174
|
@media screen and (max-width: 910px) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
175
|
+
.chart-line {
|
|
176
|
+
height: 140px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.layer-axis-x .tick {
|
|
180
|
+
opacity: 0;
|
|
181
|
+
font-size: 0;
|
|
182
|
+
}
|
|
196
183
|
}
|
|
197
184
|
</style>
|
|
@@ -1,143 +1,143 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="bagel-input checkbox"
|
|
4
|
+
:title="field.description"
|
|
5
|
+
:class="{ small: small, 'no-edit': !editMode }"
|
|
6
|
+
>
|
|
7
|
+
<label :for="field.id">
|
|
8
|
+
{{ field.label }}
|
|
9
|
+
</label>
|
|
10
|
+
<label class="switch">
|
|
11
|
+
<input
|
|
12
|
+
:id="field.id"
|
|
13
|
+
type="checkbox"
|
|
14
|
+
v-model="inputVal"
|
|
15
|
+
:class="{ 'no-edit': !editMode }"
|
|
16
|
+
/>
|
|
17
|
+
<span class="slider round" />
|
|
18
|
+
</label>
|
|
19
|
+
</div>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup lang="ts">
|
|
23
|
-
import { watch, ref, onMounted } from
|
|
24
|
-
import { BagelField } from
|
|
23
|
+
import { watch, ref, onMounted } from "vue";
|
|
24
|
+
import { BagelField } from "@bagelink/vue";
|
|
25
25
|
|
|
26
|
-
const emits = defineEmits([
|
|
26
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
27
27
|
const props = withDefaults(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
defineProps<{
|
|
29
|
+
field: BagelField;
|
|
30
|
+
modelValue: any;
|
|
31
|
+
editMode?: boolean;
|
|
32
|
+
small?: boolean;
|
|
33
|
+
}>(),
|
|
34
|
+
{
|
|
35
|
+
editMode: true,
|
|
36
|
+
}
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
const inputVal = ref(false);
|
|
40
40
|
watch(inputVal, (newVal) => {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
if (newVal === undefined) return;
|
|
42
|
+
emits("update:modelValue", newVal);
|
|
43
43
|
});
|
|
44
44
|
watch(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
() => props.modelValue,
|
|
46
|
+
(newVal) => {
|
|
47
|
+
if (inputVal.value !== newVal) inputVal.value = newVal;
|
|
48
|
+
}
|
|
49
49
|
);
|
|
50
50
|
onMounted(() => (inputVal.value = !!props.modelValue));
|
|
51
51
|
</script>
|
|
52
52
|
|
|
53
53
|
<style scoped>
|
|
54
54
|
.no-edit {
|
|
55
|
-
|
|
55
|
+
pointer-events: none;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.radio-wrap p {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
display: inline-block;
|
|
60
|
+
color: var(--input-bg);
|
|
61
|
+
font-size: var(--input-font-size);
|
|
62
|
+
margin-inline-end: 10px;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.radio-wrap label {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
padding: 3px 5px;
|
|
67
|
+
display: inline-block;
|
|
68
|
+
border-radius: var(--input-border-radius);
|
|
69
|
+
font-size: var(--input-font-size);
|
|
70
|
+
background: var(--input-bg);
|
|
71
|
+
color: var(--bgl-black);
|
|
72
|
+
text-align: center;
|
|
73
|
+
margin: 8px 5px;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
user-select: none;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.bagel-input .radio-wrap label::after {
|
|
79
|
-
|
|
79
|
+
background: transparent;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
.radio-wrap input {
|
|
83
|
-
|
|
83
|
+
display: none;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
.radio-wrap input:checked:checked+label {
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
.radio-wrap input:checked:checked + label {
|
|
87
|
+
background: var(--bgl-primary);
|
|
88
|
+
color: var(--bgl-white);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
.checkbox {
|
|
92
|
-
|
|
92
|
+
position: relative;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
.switch {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
position: relative;
|
|
97
|
+
display: inline-block;
|
|
98
|
+
height: calc(var(--input-height) / 2);
|
|
99
|
+
width: var(--input-height);
|
|
100
|
+
border-radius: var(--input-height);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
.switch input {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
opacity: 0;
|
|
105
|
+
width: 0;
|
|
106
|
+
height: 0;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.slider {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
110
|
+
position: absolute;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
top: 0;
|
|
113
|
+
left: 0;
|
|
114
|
+
right: 0;
|
|
115
|
+
bottom: 0;
|
|
116
|
+
background: var(--input-bg);
|
|
117
|
+
-webkit-transition: 0.4s;
|
|
118
|
+
transition: 0.4s;
|
|
119
|
+
border-radius: calc(var(--input-height) / 2);
|
|
120
|
+
box-shadow: inset 0 0 10px #00000020;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
.slider:before {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
124
|
+
position: absolute;
|
|
125
|
+
content: "";
|
|
126
|
+
height: calc(var(--input-height) / 2 - 4px);
|
|
127
|
+
width: calc(var(--input-height) / 2 - 4px);
|
|
128
|
+
left: 2px;
|
|
129
|
+
bottom: 2px;
|
|
130
|
+
border-radius: 50%;
|
|
131
|
+
background: var(--bgl-white);
|
|
132
|
+
-webkit-transition: 0.4s;
|
|
133
|
+
transition: 0.4s;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
input:checked
|
|
137
|
-
|
|
136
|
+
input:checked + .slider {
|
|
137
|
+
background: var(--bgl-primary);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
input:checked
|
|
141
|
-
|
|
140
|
+
input:checked + .slider:before {
|
|
141
|
+
transform: translateX(calc(var(--input-height) / 2));
|
|
142
142
|
}
|
|
143
143
|
</style>
|
|
@@ -1,77 +1,74 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<MaterialIcon icon="check" />
|
|
9
|
-
</span>
|
|
10
|
-
</label>
|
|
2
|
+
<label class="primary-checkbox">
|
|
3
|
+
<input type="checkbox" v-model="val" />
|
|
4
|
+
<span>
|
|
5
|
+
<MaterialIcon icon="check" />
|
|
6
|
+
</span>
|
|
7
|
+
</label>
|
|
11
8
|
</template>
|
|
12
9
|
|
|
13
10
|
<script setup lang="ts">
|
|
14
|
-
import { watch } from
|
|
15
|
-
import { MaterialIcon } from
|
|
11
|
+
import { watch } from "vue";
|
|
12
|
+
import { MaterialIcon } from "@bagelink/vue";
|
|
16
13
|
|
|
17
14
|
const props = defineProps({
|
|
18
|
-
|
|
15
|
+
modelValue: Boolean,
|
|
19
16
|
});
|
|
20
17
|
|
|
21
|
-
const emits = defineEmits([
|
|
18
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
22
19
|
|
|
23
20
|
let val = $ref<boolean>();
|
|
24
21
|
|
|
25
22
|
watch(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
() => props.modelValue,
|
|
24
|
+
(v: boolean) => {
|
|
25
|
+
if (v === undefined || v === val) return;
|
|
26
|
+
val = v;
|
|
27
|
+
},
|
|
28
|
+
{ immediate: true }
|
|
32
29
|
);
|
|
33
30
|
|
|
34
31
|
watch(
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
() => val,
|
|
33
|
+
(v) => emits("update:modelValue", v)
|
|
37
34
|
);
|
|
38
35
|
</script>
|
|
39
36
|
|
|
40
37
|
<style scoped>
|
|
41
38
|
.primary-checkbox input {
|
|
42
|
-
|
|
39
|
+
display: none;
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
.primary-checkbox {
|
|
46
|
-
|
|
43
|
+
margin-top: 8px;
|
|
47
44
|
}
|
|
48
45
|
|
|
49
46
|
.primary-checkbox span {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
display: flex;
|
|
48
|
+
padding-top: 1px;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
color: var(--bgl-white);
|
|
52
|
+
border-radius: 100%;
|
|
53
|
+
width: 26px;
|
|
54
|
+
height: 26px;
|
|
55
|
+
background: white;
|
|
56
|
+
border: 4px solid var(--bgl-gray-light);
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
transition: var(--bgl-transition);
|
|
59
|
+
user-select: none;
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
.primary-checkbox span:hover {
|
|
66
|
-
|
|
63
|
+
filter: brightness(90%);
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
.primary-checkbox span:active {
|
|
70
|
-
|
|
67
|
+
filter: brightness(80%);
|
|
71
68
|
}
|
|
72
69
|
|
|
73
|
-
.primary-checkbox input:checked+span {
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
.primary-checkbox input:checked + span {
|
|
71
|
+
background: var(--bgl-primary);
|
|
72
|
+
border: none;
|
|
76
73
|
}
|
|
77
74
|
</style>
|