@bagelink/vue 0.0.158 → 0.0.162

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