@bagelink/vue 0.0.738 → 0.0.742

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 (67) hide show
  1. package/dist/components/AddressSaerch.vue.d.ts +7 -0
  2. package/dist/components/AddressSaerch.vue.d.ts.map +1 -0
  3. package/dist/components/AddressSearch.vue.d.ts +7 -0
  4. package/dist/components/AddressSearch.vue.d.ts.map +1 -0
  5. package/dist/components/Btn.vue.d.ts.map +1 -1
  6. package/dist/components/MapEmbed.vue.d.ts +55 -1
  7. package/dist/components/MapEmbed.vue.d.ts.map +1 -1
  8. package/dist/components/Modal.vue.d.ts.map +1 -1
  9. package/dist/components/ModalConfirm.vue.d.ts +4 -4
  10. package/dist/components/ModalConfirm.vue.d.ts.map +1 -1
  11. package/dist/components/form/inputs/PasswordInput.vue.d.ts +6 -6
  12. package/dist/components/form/inputs/PasswordInput.vue.d.ts.map +1 -1
  13. package/dist/components/form/inputs/RichText2/index.vue.d.ts.map +1 -1
  14. package/dist/components/form/inputs/TelInput.vue.d.ts +0 -1
  15. package/dist/components/form/inputs/TelInput.vue.d.ts.map +1 -1
  16. package/dist/components/index.d.ts +1 -0
  17. package/dist/components/index.d.ts.map +1 -1
  18. package/dist/index.cjs +451 -266
  19. package/dist/index.mjs +451 -266
  20. package/dist/plugins/modal.d.ts +9 -13
  21. package/dist/plugins/modal.d.ts.map +1 -1
  22. package/dist/style.css +1238 -427
  23. package/dist/utils/index.d.ts +2 -0
  24. package/dist/utils/index.d.ts.map +1 -1
  25. package/package.json +5 -4
  26. package/src/components/AddressSearch.vue +41 -0
  27. package/src/components/Avatar.vue +1 -1
  28. package/src/components/Badge.vue +1 -1
  29. package/src/components/Btn.vue +9 -7
  30. package/src/components/Card.vue +2 -2
  31. package/src/components/ListItem.vue +1 -1
  32. package/src/components/MapEmbed.vue +143 -104
  33. package/src/components/Modal.vue +5 -2
  34. package/src/components/ModalConfirm.vue +4 -7
  35. package/src/components/NavBar.vue +9 -9
  36. package/src/components/TableSchema.vue +3 -3
  37. package/src/components/form/inputs/Checkbox.vue +1 -1
  38. package/src/components/form/inputs/DatePicker.vue +5 -5
  39. package/src/components/form/inputs/FileUpload.vue +1 -1
  40. package/src/components/form/inputs/PasswordInput.vue +9 -10
  41. package/src/components/form/inputs/RadioGroup.vue +1 -1
  42. package/src/components/form/inputs/RadioPillsInput.vue +2 -2
  43. package/src/components/form/inputs/RichText.vue +3 -3
  44. package/src/components/form/inputs/RichText2/index.vue +8 -2
  45. package/src/components/form/inputs/TableField.vue +3 -3
  46. package/src/components/form/inputs/TelInput.vue +2 -2
  47. package/src/components/form/inputs/TextInput.vue +3 -3
  48. package/src/components/form/inputs/ToggleInput.vue +1 -1
  49. package/src/components/formkit/FileUploader.vue +1 -1
  50. package/src/components/formkit/MiscFields.vue +1 -1
  51. package/src/components/formkit/Toggle.vue +4 -4
  52. package/src/components/index.ts +1 -0
  53. package/src/components/layout/BottomMenu.vue +2 -2
  54. package/src/components/layout/SidebarMenu.vue +1 -1
  55. package/src/components/layout/TabsNav.vue +1 -1
  56. package/src/components/leaflet/leaflet.css +661 -0
  57. package/src/components/lightbox/Lightbox.vue +2 -2
  58. package/src/plugins/modal.ts +44 -61
  59. package/src/styles/appearance.css +30 -0
  60. package/src/styles/bagel.css +2 -1
  61. package/src/styles/inputs.css +10 -3
  62. package/src/styles/loginCard.css +1 -1
  63. package/src/styles/modal.css +2 -2
  64. package/src/styles/scrollbar.css +1 -1
  65. package/src/styles/text.css +82 -0
  66. package/src/styles/theme.css +68 -41
  67. package/src/utils/index.ts +16 -0
@@ -13,4 +13,6 @@ export { formatString } from './strings';
13
13
  export * as bagelFormUtils from './BagelFormUtils';
14
14
  export { useLang } from './lang';
15
15
  export declare function getFallbackSchema<T>(data?: any[], showFields?: string[]): BglFormSchemaT<T>;
16
+ export declare const sleep: (ms?: number) => Promise<unknown>;
17
+ export declare function appendScript(src: string): Promise<void>;
16
18
  //# sourceMappingURL=index.d.ts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M,eAAgB,GAAG,YAA0C,CAAA;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEhC,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC,CAa3F;AAED,eAAO,MAAM,KAAK,QAAQ,MAAM,qBAA0D,CAAA;AAE1F,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYvD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.738",
4
+ "version": "0.0.742",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -51,9 +51,10 @@
51
51
  "./vite.config.ts"
52
52
  ],
53
53
  "devDependencies": {
54
+ "@types/leaflet": "^1.9.12",
54
55
  "@types/signature_pad": "^2.3.6",
55
56
  "@vue-macros/reactivity-transform": "^1.0.3",
56
- "vue": "^3.4.38"
57
+ "vue": "^3.5.1"
57
58
  },
58
59
  "peerDependencies": {
59
60
  "@bagelink/sdk": "*",
@@ -115,11 +116,11 @@
115
116
  "@tiptap/vue-3": "^2.6.6",
116
117
  "@vuepic/vue-datepicker": "^8.8.1",
117
118
  "@vueuse/core": "^11.0.3",
118
- "axios": "^1.7.5",
119
+ "axios": "^1.7.7",
119
120
  "floating-vue": "^5.2.2",
120
121
  "libphonenumber-js": "1.11.7",
121
122
  "signature_pad": "^5.0.3",
122
- "type-fest": "^4.25.0"
123
+ "type-fest": "^4.26.0"
123
124
  },
124
125
  "scripts": {
125
126
  "dev": "tsx watch src/index.ts",
@@ -0,0 +1,41 @@
1
+ <script setup lang="ts">
2
+ import { Dropdown, ListItem, ListView, TextInput } from '@bagelink/vue'
3
+
4
+ const emit = defineEmits(['addressSelected'])
5
+ let addressInput = $ref('')
6
+ let searchResults = $ref<any[]>([])
7
+
8
+ type MapMarker = {
9
+ lat: number
10
+ lon: number
11
+ } | [number, number]
12
+
13
+ const suggestion = $ref<typeof Dropdown>()
14
+ function emitAddress(address: MapMarker) {
15
+ emit('addressSelected', address)
16
+ searchResults = []
17
+ addressInput = ''
18
+ }
19
+
20
+ async function searchAddresses() {
21
+ const addressURL = addressInput.replace(/\s+/g, '+')
22
+ const geocodeUrl = `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURI(addressURL)}`
23
+ const res = await fetch(geocodeUrl)
24
+ searchResults = await res.json() || []
25
+ console.log(suggestion)
26
+ suggestion?.show()
27
+ }
28
+ </script>
29
+
30
+ <template>
31
+ <div class="relative">
32
+ <Dropdown ref="suggestion" :noAutoFocus="true" placement="bottom-start">
33
+ <TextInput v-model="addressInput" placeholder="Enter address" @debounce="searchAddresses" />
34
+ <template #popper>
35
+ <ListView class="-mt-2 hm-300px">
36
+ <ListItem v-for="(result, index) in searchResults" :key="index" icon="location_on" :title="result.display_name" @click="emitAddress(result)" />
37
+ </listview>
38
+ </template>
39
+ </Dropdown>
40
+ </div>
41
+ </template>
@@ -13,7 +13,7 @@ withDefaults(defineProps<{
13
13
  <div class="avatar flex justify-content-center" :style="{ width: `${size}px`, height: `${size}px` }">
14
14
  <img v-if="src" :src="src" :alt="name">
15
15
  <p v-else :style="{ 'line-height': `${size}px`, 'font-size': `calc(1.5rem * ${size} / 50)` }">
16
- {{ fallback || initials(name || '') }}
16
+ {{ (fallback || initials(name || '')).toUpperCase() }}
17
17
  </p>
18
18
  </div>
19
19
  </template>
@@ -45,7 +45,7 @@ const props = defineProps<Props>()
45
45
  }
46
46
 
47
47
  .pill.blue {
48
- background: var(--bgl-primary);
48
+ background: var(bgl-primary);
49
49
  color: var(--bgl-white);
50
50
  }
51
51
 
@@ -56,7 +56,7 @@ const computedTheme = $computed(
56
56
  const computedDefaultColors = $computed(
57
57
  () => ({
58
58
  backgroundColor: 'var(--bgl-primary)',
59
- color: props.flat ? 'var(--bgl-black)' : 'var(--bgl-white)',
59
+ color: props.flat ? 'var(--bgl-text-color)' : 'var(--bgl-light-text)',
60
60
  }),
61
61
  )
62
62
 
@@ -121,8 +121,8 @@ a {
121
121
  }
122
122
 
123
123
  .loading {
124
- border: 1px solid var(--bgl-white);
125
- border-bottom: 2px solid var(--bgl-white);
124
+ border: 1px solid var(--bgl-light-text);
125
+ border-bottom: 2px solid var(--bgl-light-text);
126
126
  animation: spin 1s linear infinite;
127
127
  border-radius: 100px;
128
128
  width: 1rem;
@@ -146,7 +146,7 @@ a {
146
146
  border-radius: 100%;
147
147
  font-size: 1rem;
148
148
  background: var(--bgl-primary);
149
- color: var(--bgl-white);
149
+ color: var(--bgl-light-text);
150
150
  flex-shrink: 0;
151
151
  transition: var(--bgl-transition);
152
152
  }
@@ -205,12 +205,14 @@ a {
205
205
  .bgl_btn-icon.bgl_flatBtn:hover {
206
206
  filter: var(--bgl-hover-filter);
207
207
  background: var(--bgl-gray-20);
208
+ color: var(--bgl-primary);
208
209
  }
209
210
 
210
211
  .bgl_btn.bgl_flatBtn:active,
211
212
  .bgl_btn-icon.bgl_flatBtn:active {
212
213
  background: var(--bgl-gray-40);
213
214
  filter: var(--bgl-active-filter);
215
+ color: var(--bgl-primary);
214
216
  }
215
217
 
216
218
  .bgl_btn.bgl_flatBtn.red,
@@ -219,7 +221,7 @@ a {
219
221
  }
220
222
  .bgl_btn.bgl_flatBtn.white,
221
223
  .bgl_btn-icon.bgl_flatBtn.white {
222
- color: var(--bgl-white);
224
+ color: var(--bgl-light-text);
223
225
  }
224
226
 
225
227
  .bgl_btn.bgl_flatBtn.light,
@@ -229,7 +231,7 @@ a {
229
231
 
230
232
  .bgl_btn.bgl_flatBtn.black,
231
233
  .bgl_btn-icon.bgl_flatBtn.black {
232
- color: var(--bgl-black);
234
+ color: var(--bgl-text-color);
233
235
  }
234
236
 
235
237
  .bgl_btn.bgl_flatBtn.gray,
@@ -267,7 +269,7 @@ a {
267
269
  }
268
270
 
269
271
  .bgl_btn-border:hover {
270
- color: var(--bgl-white);
272
+ color: var(--bgl-light-text);
271
273
  background: v-bind(computedBackgroundColor);
272
274
  filter: brightness(100%);
273
275
  }
@@ -59,7 +59,7 @@ const is = $computed(() => (props.to ? 'router-link' : 'div'))
59
59
  .border .card_label {
60
60
  font-size: 0.7rem;
61
61
  font-weight: 300;
62
- background:var(--bgl-white);
62
+ background:var(--bgl-box-bg);
63
63
  padding: 0 0.75rem;
64
64
  position: absolute;
65
65
  top: -0.5rem;
@@ -72,7 +72,7 @@ const is = $computed(() => (props.to ? 'router-link' : 'div'))
72
72
 
73
73
  .bgl_card {
74
74
  border-radius: var(--card-border-radius);
75
- background: var(--bgl-white);
75
+ background: var(--bgl-box-bg);
76
76
  padding: 2rem 2rem;
77
77
  position: relative;
78
78
  }
@@ -46,7 +46,7 @@ defineProps<{
46
46
  margin: 0rem 0;
47
47
  cursor: pointer;
48
48
  transition: var(--bgl-transition);
49
- color: var(--bgl-black);
49
+ color: var(--bgl-text-color);
50
50
  text-decoration: none;
51
51
  position: relative;
52
52
  }
@@ -1,126 +1,165 @@
1
1
  <script setup lang="ts">
2
- // import 'leaflet/dist/leaflet.css'
3
- // import type { LatLngExpression, Layer, Marker } from 'leaflet'
4
- // import { onMounted, watch } from 'vue'
5
- // import L from 'leaflet'
6
-
7
- // const props = withDefaults(defineProps<{
8
- // center: LatLngExpression
9
- // zoom: number
10
- // height: number
11
- // address: string
12
- // zoomControl: boolean
13
- // }>(), {
14
- // center: () => [31.7683, 35.2137],
15
- // zoom: 13,
16
- // height: 400,
17
- // address: '',
18
- // zoomControl: true
19
- // })
20
-
21
- // let map = $ref<L.Map>()
22
- // const markers = $ref<Marker[]>([])
23
- // const id = $ref(Math.random().toString(36).substring(2, 10))
24
-
25
- // function initializeMap() {
26
- // if (props.address) {
27
- // geocodeAddress(props.address).catch(console.error)
28
- // }
29
- // map = L.map(id, {
30
- // center: props.center,
31
- // zoom: props.zoom,
32
- // zoomControl: props.zoomControl
33
- // })
34
- // L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18 }).addTo(map)
35
- // }
36
-
37
- // onMounted(initializeMap)
38
- // // eslint-disable-next-line max-len
39
- // const markerSVG = '<svg width="284" height="284" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M29.859 29.266A99 99 0 0 1 198.862 99.27c0 74.25-99 183.857-99 183.857s-99-109.607-99-183.858A99 99 0 0 1 29.86 29.266Zm70.004 118.961c25.513 0 46.195-20.683 46.195-46.196 0-25.513-20.682-46.195-46.195-46.195S53.667 76.518 53.667 102.03s20.683 46.196 46.196 46.196Z" fill="#F04033"/></svg>'
40
-
41
- // function addMarker(latlng: LatLngExpression) {
42
- // const customIcon = L.icon({
43
- // iconUrl: `data:image/svg+xml;utf8,${encodeURIComponent(markerSVG)}`,
44
- // iconSize: [32, 32],
45
- // })
46
-
47
- // if (!map) initializeMap()
48
- // const marker = L.marker(latlng, { icon: customIcon }).addTo(map as L.Map)
49
- // markers.push(marker)
50
- // }
51
-
52
- // async function geocodeAddress(address: string) {
53
- // const addressURL = address.replace(/\s+/g, '+')
54
- // const geocodeUrl = `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURI(addressURL)}`
55
- // const res = await fetch(geocodeUrl)
56
- // const data: any[] = await res.json() || []
57
- // data.forEach((element) => {
58
- // addMarker([element.lat, element.lon])
59
- // })
60
- // map?.fitBounds(L.featureGroup(markers as unknown as Layer[]).getBounds())
61
- // }
62
-
63
- // watch(() => props.address, (address) => {
64
- // if (address) geocodeAddress(address).catch(console.error)
65
- // }, { immediate: true })
2
+ import './leaflet/leaflet.css'
3
+ import { onMounted, watch } from 'vue'
4
+ import type { LatLngExpression, Layer, Map, Marker } from 'leaflet'
5
+ import { appendScript, sleep } from '@bagelink/vue'
6
+
7
+ type MapMarker = {
8
+ lat: number
9
+ lon: number
10
+ } | [number, number]
11
+
12
+ const props = withDefaults(
13
+ defineProps<{
14
+ center?: LatLngExpression
15
+ zoom?: number
16
+ height?: number
17
+ zoomControl?: boolean
18
+ markers?: MapMarker[]
19
+ markerIcon?: string
20
+ }>(),
21
+ {
22
+ center: () => [31.7683, 35.2137],
23
+ zoom: 13,
24
+ height: 400,
25
+ zoomControl: true,
26
+ markerIcon: '',
27
+ }
28
+ )
29
+
30
+ let L = $ref<any>()
31
+ let map = $ref<Map>()
32
+ const _markers = $ref<Marker[]>([])
33
+ const id = $ref(Math.random().toString(36).substring(2, 10))
34
+
35
+ const defaultMarkerSVG = '<svg id="eCJDQPwuXje1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 36 36" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" project-id="ac827abc0a8c4922b76bac4df7bd7646" export-id="2cc86932ccbc4825a31fd063b3e75478" cached="false"><style><![CDATA[#eCJDQPwuXje3_ts {animation: eCJDQPwuXje3_ts__ts 3000ms linear infinite normal forwards}@keyframes eCJDQPwuXje3_ts__ts { 0% {transform: translate(18px,18px) scale(1,1)} 3.333333% {transform: translate(18px,18px) scale(1,1);animation-timing-function: cubic-bezier(0.42,0,0.58,1)} 100% {transform: translate(18px,18px) scale(1.8,1.8)}} #eCJDQPwuXje3 {animation: eCJDQPwuXje3_c_o 3000ms linear infinite normal forwards}@keyframes eCJDQPwuXje3_c_o { 0% {opacity: 0} 3.333333% {opacity: 1;animation-timing-function: cubic-bezier(0.42,0,0.58,1)} 100% {opacity: 0}}]]></style><ellipse rx="10.049312" ry="10.049312" transform="translate(18 18)" fill="#2e5bff" stroke-width="0"/><g id="eCJDQPwuXje3_ts" transform="translate(18,18) scale(1,1)"><ellipse id="eCJDQPwuXje3" rx="10.049312" ry="10.049312" transform="translate(0,0)" opacity="0" fill="#2e5bff" stroke-width="0"/></g></svg>'
36
+ const leafletScriptUrl = 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.js'
37
+
38
+ function loadGlobalL() {
39
+ return new Promise(async (resolve) => {
40
+ while (!window.L) await sleep(100)
41
+ resolve(window.L)
42
+ })
43
+ }
44
+
45
+ async function initializeMap() {
46
+ await appendScript(leafletScriptUrl)
47
+ L = await loadGlobalL()
48
+ if (!map) {
49
+ map = L.map(id, {
50
+ center: props.center,
51
+ zoom: props.zoom,
52
+ zoomControl: props.zoomControl,
53
+ })
54
+ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18 }).addTo(map)
55
+ }
56
+ }
57
+
58
+ function addMarker(L: any, latlng: LatLngExpression) {
59
+ const iconSVG = props.markerIcon || defaultMarkerSVG
60
+ const customIcon = L.icon({
61
+ iconUrl: `data:image/svg+xml;utf8,${encodeURIComponent(iconSVG)}`,
62
+ iconSize: [32, 32],
63
+ })
64
+
65
+ const marker = L.marker(latlng, { icon: customIcon }).addTo(map as Map)
66
+ _markers.push(marker)
67
+ }
68
+
69
+ function fitMarkers(L: any) {
70
+ if (_markers.length > 0) {
71
+ map?.fitBounds(L.featureGroup(_markers as unknown as Layer[]).getBounds())
72
+ }
73
+ }
74
+
75
+ watch(
76
+ () => props.markers,
77
+ async (markers) => {
78
+ _markers.forEach(marker => marker.remove())
79
+ if (!markers) return
80
+ for (const marker of markers) {
81
+ const [lat, lon] = Array.isArray(marker) ? marker : [marker.lat, marker.lon]
82
+ if (!map) initializeMap()
83
+ addMarker(L, [lat, lon])
84
+ fitMarkers(L)
85
+ }
86
+ },
87
+ { immediate: true }
88
+ )
89
+
90
+ onMounted(initializeMap)
66
91
  </script>
67
92
 
68
93
  <template>
69
- <div class="map-test" />
70
- <!-- <div :id class="map" :style="{ height: `${height || 400}px` }" /> -->
94
+ <div :id="id" class="leaflet-map" :style="{ height: `${props.height || 400}px` }" />
71
95
  </template>
72
96
 
73
- <style>
74
- #map {
75
- height: 100%;
76
- border-radius: var(--input-border-radius);
77
- position: relative;
97
+ <style>
98
+ .leaflet-map {
99
+ height: 100%;
100
+ border-radius: var(--input-border-radius);
101
+ position: relative;
102
+ background: var(--bgl-bg)
103
+ }
104
+
105
+ .leaflet-map::after {
106
+ content: "";
107
+ position: absolute;
108
+ inset: 0;
109
+ box-shadow: inset 0 0 10px #00000012;
110
+ z-index: 402;
111
+ }
112
+
113
+ .leaflet-map .leaflet-pane .leaflet-tile-pane {
114
+ filter: contrast(0.6) brightness(1.25) hue-rotate(12deg);
115
+ }
78
116
 
117
+ .leaflet-control-attribution {
118
+ display: none;
79
119
  }
80
- #map::after{
81
- content: "";
82
- position: absolute;
83
- inset: 0;
84
- box-shadow: inset 0 0 10px #00000012;
85
- z-index: 402;
86
- }
87
120
 
88
- .map .leaflet-pane .leaflet-tile-pane{
89
- filter: contrast(0.6) brightness(1.25) hue-rotate(12deg);
121
+ .leaflet-pane.leaflet-marker-pane img {
122
+ filter: drop-shadow(0px 8px 3px rgba(0, 0, 0, 0.2));
123
+ }
90
124
 
91
- }
92
- .leaflet-control-attribution{
93
- display: none;
94
- }
95
- .leaflet-pane.leaflet-marker-pane img{
96
- filter: drop-shadow(0px 8px 3px rgba(0, 0, 0, 0.2));
97
- }
98
- .leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
99
- font-size: var(--input-font-size);
125
+ .leaflet-touch .leaflet-control-zoom-in,
126
+ .leaflet-touch .leaflet-control-zoom-out {
127
+ font-size: var(--input-font-size);
100
128
  }
101
- .leaflet-bar{
102
- border-radius:var(--input-border-radius) !important;
129
+
130
+ .leaflet-bar {
131
+ border-radius: var(--input-border-radius) !important;
103
132
  }
104
133
 
105
134
  .leaflet-touch .leaflet-bar a:first-child {
106
- border-top-left-radius: calc(var(--input-border-radius) - 2px) !important;
107
- border-top-right-radius: calc(var(--input-border-radius) - 2px) !important;
108
- }
109
- .leaflet-touch .leaflet-bar a:last-child{
110
- border-bottom-left-radius:calc(var(--input-border-radius) - 2px) !important;
111
- border-bottom-right-radius:calc(var(--input-border-radius) - 2px) !important;
135
+ border-top-left-radius: calc(var(--input-border-radius) - 2px) !important;
136
+ border-top-right-radius: calc(var(--input-border-radius) - 2px) !important;
112
137
  }
113
138
 
114
- .leaflet-bar a{
115
- background: var(--input-bg) !important;
116
- transition: var(--bgl-transition);
139
+ .leaflet-touch .leaflet-bar a:last-child {
140
+ border-bottom-left-radius: calc(var(--input-border-radius) - 2px) !important;
141
+ border-bottom-right-radius: calc(var(--input-border-radius) - 2px) !important;
142
+ }
117
143
 
144
+ .leaflet-bar a {
145
+ background: var(--bgl-box-bg) !important;
146
+ transition: var(--bgl-transition);
147
+ border-bottom: 1px solid var(--border-color) !important;
148
+ display: flex;
149
+ justify-content: center;
150
+ align-items: center;
151
+ line-height: 1 !important;
152
+ padding-bottom: 2px;
118
153
  }
119
- .leaflet-bar a:hover{
120
- filter: var(--bgl-hover-filter);
154
+ .leaflet-bar a:last-child {
155
+ border-bottom: none !important;
121
156
  }
122
- .leaflet-bar a:focus {
123
- filter: var(--bgl-active-filter);
124
157
 
158
+ .leaflet-bar a:hover {
159
+ filter: var(--bgl-hover-filter);
160
+ }
161
+
162
+ .leaflet-bar a:focus {
163
+ filter: var(--bgl-active-filter);
125
164
  }
126
165
  </style>
@@ -85,9 +85,9 @@ onUnmounted(() => {
85
85
  <Title v-if="title" class="modal-title" tag="h3" :label="title" />
86
86
  </header>
87
87
 
88
- <div v-else class="sticky bg-white z-index-999 -mt-1 -ms-1 px-025 h-30px pt-025 modal-no-title">
88
+ <div v-else class="sticky bg-popup z-index-999 -mt-1 -ms-1 px-025 h-30px pt-025 modal-no-title">
89
89
  <Btn
90
- class="color-black position-start"
90
+ class="position-start"
91
91
  icon="close"
92
92
  thin
93
93
  color="white"
@@ -110,6 +110,9 @@ onUnmounted(() => {
110
110
  </template>
111
111
 
112
112
  <style>
113
+ .modal{
114
+ color: var(--bgl-popup-text);
115
+ }
113
116
  .modal-title {
114
117
  text-align: center;
115
118
  font-weight: 600;
@@ -2,8 +2,8 @@
2
2
  import { Btn, Modal } from '@bagelink/vue'
3
3
 
4
4
  const props = defineProps<{
5
- title: string
6
- message: string
5
+ title?: string
6
+ message?: string
7
7
  resolve: (value: boolean) => void
8
8
  }>()
9
9
 
@@ -16,11 +16,8 @@ function select(val: boolean) {
16
16
  </script>
17
17
 
18
18
  <template>
19
- <Modal width="380px" :dismissable="false" class="color-black txt-center">
20
- <h3 class="m-0">
21
- {{ title }}
22
- </h3>
23
- <p class="px-1 py-1 pretty m-0">
19
+ <Modal :title="title" width="380px" :dismissable="false" class="txt-center">
20
+ <p class="pb-05 pretty">
24
21
  {{ message }}
25
22
  </p>
26
23
  <template #footer>
@@ -84,7 +84,7 @@ const isOpen = $ref(!isSmallScreen)
84
84
  .nav-expend {
85
85
  text-align: center;
86
86
  cursor: pointer;
87
- background: var(--bgl-white);
87
+ background: var(--bgl-popup-bg);
88
88
  color: var(--bgl-primary);
89
89
  display: flex;
90
90
  border-radius: 100%;
@@ -109,7 +109,7 @@ const isOpen = $ref(!isSmallScreen)
109
109
  */
110
110
 
111
111
  .nav-expend {
112
- background: var(--bgl-white);
112
+ background: var(--bgl-popup-bg);
113
113
  }
114
114
 
115
115
  .nav-expend:hover {
@@ -122,7 +122,7 @@ const isOpen = $ref(!isSmallScreen)
122
122
  }
123
123
 
124
124
  .nav {
125
- color: var(--bgl-white);
125
+ color: var(--bgl-light-text);
126
126
  background: var(--bgl-primary);
127
127
  z-index: 100;
128
128
  width: 70px;
@@ -142,7 +142,7 @@ const isOpen = $ref(!isSmallScreen)
142
142
  text-align: start;
143
143
  align-items: center;
144
144
  position: relative;
145
- color: var(--bgl-white);
145
+ color: var(--bgl-light-text);
146
146
  transition: all 0.2s ease;
147
147
  pointer-events: none;
148
148
  }
@@ -168,7 +168,7 @@ const isOpen = $ref(!isSmallScreen)
168
168
 
169
169
  .nav-button:hover .bgl_icon-font,
170
170
  .nav-button.router-link-active .bgl_icon-font {
171
- background: var(--bgl-white);
171
+ background: var(--bgl-box-bg);
172
172
  color: var(--bgl-primary);
173
173
  }
174
174
 
@@ -178,7 +178,7 @@ const isOpen = $ref(!isSmallScreen)
178
178
  }
179
179
 
180
180
  .tooltip {
181
- background-color: var(--bgl-white);
181
+ background-color: var(--bgl-popup-bg);
182
182
  color: var(--bgl-primary);
183
183
  line-height: 1;
184
184
  padding: 0.5rem;
@@ -255,7 +255,7 @@ const isOpen = $ref(!isSmallScreen)
255
255
 
256
256
  .nav.open .tooltip {
257
257
  background-color: transparent;
258
- color: var(--bgl-white);
258
+ color: var(--bgl-light-text);
259
259
  padding: 0;
260
260
  box-shadow: none;
261
261
  pointer-events: all;
@@ -278,7 +278,7 @@ const isOpen = $ref(!isSmallScreen)
278
278
 
279
279
  .nav.open .nav-button:hover,
280
280
  .nav.open .nav-button.router-link-active {
281
- background: var(--bgl-white);
281
+ background: var(--bgl-popup-bg);
282
282
  color: var(--bgl-primary);
283
283
  }
284
284
 
@@ -316,7 +316,7 @@ const isOpen = $ref(!isSmallScreen)
316
316
  .tooltip {
317
317
  opacity: 1;
318
318
  background: transparent;
319
- color: var(--bgl-white);
319
+ color: var(--bgl-light-text);
320
320
  box-shadow: none;
321
321
  font-size: 10px;
322
322
  padding: 0;
@@ -333,7 +333,7 @@ th {
333
333
  position: sticky;
334
334
  top: 0;
335
335
  z-index: 2;
336
- background: var(--bgl-white);
336
+ background: var(--bgl-box-bg);
337
337
  height: v-bind(computedItemHiehgt);
338
338
  vertical-align: bottom;
339
339
  font-weight: 400;
@@ -356,7 +356,7 @@ th {
356
356
  position: sticky;
357
357
  top: 0;
358
358
  z-index: 2;
359
- background: var(--bgl-white);
359
+ background: var(--bgl-box-bg);
360
360
  vertical-align: bottom;
361
361
  }
362
362
 
@@ -371,7 +371,7 @@ th {
371
371
 
372
372
  .first-row .col {
373
373
  cursor: pointer;
374
- background: var(--bgl-white);
374
+ background: var(--bgl-box-bg);
375
375
  }
376
376
 
377
377
  .col {
@@ -21,7 +21,7 @@ const val = defineModel<boolean>('modelValue', { default: false })
21
21
  align-items: center;
22
22
  cursor: pointer;
23
23
  border-radius: 100%;
24
- background: var(--bgl-white);
24
+ background: var(--bgl-box-bg);
25
25
  border: 2px solid var(--bgl-gray);
26
26
  }
27
27