@bagelink/vue 0.0.528 → 0.0.538

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 (32) hide show
  1. package/dist/components/Btn.vue.d.ts +5 -0
  2. package/dist/components/Btn.vue.d.ts.map +1 -1
  3. package/dist/components/MapEmbed.vue.d.ts +50 -16
  4. package/dist/components/MapEmbed.vue.d.ts.map +1 -1
  5. package/dist/components/MaterialIcon.vue.d.ts +2 -2
  6. package/dist/components/MaterialIcon.vue.d.ts.map +1 -1
  7. package/dist/components/Popover.vue.d.ts +10 -0
  8. package/dist/components/Popover.vue.d.ts.map +1 -0
  9. package/dist/components/form/BglField.vue.d.ts.map +1 -1
  10. package/dist/components/form/ItemRef.vue.d.ts +0 -1
  11. package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
  12. package/dist/components/form/inputs/SelectField.vue.d.ts +4 -1
  13. package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
  14. package/dist/index.cjs +227 -90
  15. package/dist/index.mjs +227 -90
  16. package/dist/plugins/modal.d.ts.map +1 -1
  17. package/dist/style.css +114 -60
  18. package/dist/types/materialIcon.d.ts +2 -0
  19. package/dist/types/materialIcon.d.ts.map +1 -0
  20. package/package.json +1 -1
  21. package/src/components/Btn.vue +3 -1
  22. package/src/components/MapEmbed.vue +40 -16
  23. package/src/components/MaterialIcon.vue +1 -1
  24. package/src/components/form/BglField.vue +7 -3
  25. package/src/components/form/inputs/SelectInput.vue +1 -1
  26. package/src/components/form/inputs/ToggleInput.vue +2 -2
  27. package/src/plugins/modal.ts +1 -2
  28. package/src/styles/appearance.css +62 -0
  29. package/dist/components/Drop.vue.d.ts +0 -34
  30. package/dist/components/Drop.vue.d.ts.map +0 -1
  31. package/dist/components/FileUploader.vue.d.ts +0 -60
  32. package/dist/components/FileUploader.vue.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.528",
4
+ "version": "0.0.538",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -13,6 +13,7 @@ const props = withDefaults(
13
13
  'theme'?: ThemeType
14
14
  'flat'?: boolean
15
15
  'border'?: boolean
16
+ 'outline'?: boolean
16
17
  'thin'?: boolean
17
18
  'type'?: 'button' | 'submit' | 'reset'
18
19
  'loading'?: boolean
@@ -33,6 +34,7 @@ const props = withDefaults(
33
34
  role: 'button',
34
35
  is: 'button',
35
36
  border: false,
37
+ outline: false
36
38
  },
37
39
  )
38
40
 
@@ -97,7 +99,7 @@ const computedBackgroundColor = $computed(
97
99
  thin,
98
100
  round,
99
101
  'bgl_flatBtn': flat,
100
- 'bgl_btn-border': border,
102
+ 'bgl_btn-border': border || outline,
101
103
  }"
102
104
  @click.stop="onClick"
103
105
  >
@@ -1,31 +1,52 @@
1
1
  <script setup lang="ts">
2
+ import type { LatLngExpression, Layer, Marker } from 'leaflet'
2
3
  import L from 'leaflet'
3
- import type { LatLngExpression, Marker } from 'leaflet'
4
4
  import 'leaflet/dist/leaflet.css'
5
+ import type { PropType } from 'vue'
5
6
  import { onMounted, watch } from 'vue'
6
7
 
7
- interface MapProps {
8
- center?: LatLngExpression
9
- zoom?: number
10
- height?: number
11
- address?: string
12
- }
13
-
14
- const props = defineProps<MapProps>()
8
+ const props = defineProps({
9
+ center: {
10
+ type: Object as PropType<LatLngExpression>,
11
+ default: [31.7683, 35.2137]
12
+ },
13
+ zoom: {
14
+ type: Number,
15
+ default: () => 13
16
+ },
17
+ height: {
18
+ type: Number,
19
+ default: () => 400
20
+ },
21
+ address: {
22
+ type: String,
23
+ default: () => ''
24
+ },
25
+ zoomControl: {
26
+ type: Boolean,
27
+ default: () => true
28
+ }
29
+ })
15
30
 
16
31
  let map = $ref<L.Map>()
17
32
  const markers = $ref<Marker[]>([])
33
+ const id = $ref(Math.random().toString(36).substring(2, 10))
18
34
 
19
35
  function initializeMap() {
20
- map = L.map('map', {
21
- center: props.center || [31.7683, 35.2137],
22
- zoom: props.zoom || 13,
36
+ if (props.address) {
37
+ geocodeAddress(props.address).catch(console.error)
38
+ }
39
+ console.log(props.zoomControl, props.center)
40
+ map = L.map(id, {
41
+ center: props.center,
42
+ zoom: props.zoom,
43
+ zoomControl: props.zoomControl
23
44
  })
24
45
  L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18 }).addTo(map)
25
46
  }
26
47
 
27
48
  onMounted(initializeMap)
28
- const markerSVG = '<svg width="199" 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>'
49
+ 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>'
29
50
 
30
51
  function addMarker(latlng: LatLngExpression) {
31
52
  const customIcon = L.icon({
@@ -42,7 +63,10 @@ async function geocodeAddress(address: string) {
42
63
  const geocodeUrl = `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(address)}`
43
64
  const res = await fetch(geocodeUrl)
44
65
  const data: any[] = await res.json() || []
45
- data.forEach((element) => { addMarker([element.lat, element.lon]) })
66
+ data.forEach((element) => {
67
+ addMarker([element.lat, element.lon])
68
+ })
69
+ map?.fitBounds(L.featureGroup(markers as unknown as Layer[]).getBounds())
46
70
  }
47
71
 
48
72
  watch(() => props.address, (address) => {
@@ -52,7 +76,7 @@ watch(() => props.address, (address) => {
52
76
 
53
77
  <template>
54
78
  <div class="map-test" />
55
- <div id="map" class="map" :style="{ height: `${height || 400}px` }" />
79
+ <div :id class="map" :style="{ height: `${height || 400}px` }" />
56
80
  </template>
57
81
 
58
82
  <style>
@@ -78,7 +102,7 @@ watch(() => props.address, (address) => {
78
102
  display: none;
79
103
  }
80
104
  .leaflet-pane.leaflet-marker-pane img{
81
- filter: drop-shadow(0px 12px 3px rgba(0, 0, 0, 0.3));
105
+ filter: drop-shadow(0px 8px 3px rgba(0, 0, 0, 0.2));
82
106
  }
83
107
  .leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
84
108
  font-size: var(--input-font-size);
@@ -4,7 +4,7 @@ import type { MaterialIcons } from '@bagelink/vue'
4
4
  defineProps<{
5
5
  icon?: MaterialIcons
6
6
  name?: MaterialIcons
7
- size?: number
7
+ size?: number | string
8
8
  color?: string
9
9
  }>()
10
10
  </script>
@@ -1,6 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import {
3
3
  CheckInput,
4
+ DateInput,
4
5
  type Field,
5
6
  RichText,
6
7
  SelectInput,
@@ -17,7 +18,7 @@ const props = withDefaults(
17
18
  }>(),
18
19
  {
19
20
  modelValue: () => ({}),
20
- },
21
+ }
21
22
  )
22
23
 
23
24
  const emit = defineEmits(['update:modelValue'])
@@ -28,18 +29,21 @@ const is = $computed(() => {
28
29
  if (props.field.$el === 'toggle') return ToggleInput
29
30
  if (props.field.$el === 'check') return CheckInput
30
31
  if (props.field.$el === 'richtext') return RichText
32
+ if (props.field.$el === 'date') return DateInput
31
33
  return props.field.$el || 'div'
32
34
  })
33
35
 
34
36
  const formData = $computed({
35
37
  get: () => props.modelValue,
36
- set: (val: any) => { emit('update:modelValue', val) },
38
+ set: (val: any) => {
39
+ emit('update:modelValue', val)
40
+ },
37
41
  })
38
42
 
39
43
  const fieldData = $computed({
40
44
  set: (val: any) => {
41
45
  if (!props.field.id) return
42
- const data = { ...props.modelValue } || {}
46
+ const data = { ...props.modelValue }
43
47
  data[props.field.id] = val
44
48
  emit('update:modelValue', data)
45
49
  },
@@ -93,7 +93,7 @@ const filteredOptions = $computed(() => props.options.filter((option) => {
93
93
  return (
94
94
  Boolean(option)
95
95
  && (searchTerm.every(s => getLabel(option).match(s))
96
- || searchTerm.length === 0)
96
+ )
97
97
  )
98
98
  }))
99
99
 
@@ -9,10 +9,10 @@ const props = withDefaults(defineProps<{
9
9
  defaultValue?: boolean
10
10
  }>(), { defaultValue: false })
11
11
 
12
- const checked = defineModel<boolean>('modelValue', { default: false })
12
+ const checked = defineModel<boolean>('modelValue')
13
13
 
14
14
  onMounted(() => {
15
- if (props.defaultValue) checked.value = props.defaultValue
15
+ if (checked.value === undefined) checked.value = props.defaultValue
16
16
  })
17
17
  </script>
18
18
 
@@ -1,5 +1,4 @@
1
- import { defineComponent, h, inject,
2
- } from 'vue'
1
+ import { defineComponent, h, inject } from 'vue'
3
2
  import type { InjectionKey, Plugin } from 'vue'
4
3
  import type { BglFormSchemaT, BtnOptions } from '@bagelink/vue'
5
4
  import { Modal, ModalConfirm, ModalForm } from '@bagelink/vue'
@@ -463,6 +463,38 @@
463
463
  border-inline-end: 1px solid var(--border-color)
464
464
  }
465
465
 
466
+ .border-bottom-none {
467
+ border-bottom: none
468
+ }
469
+
470
+ .border-top-none {
471
+ border-top: none
472
+ }
473
+
474
+ .border-start-none {
475
+ border-inline-start: none
476
+ }
477
+
478
+ .border-end-none {
479
+ border-inline-end: none
480
+ }
481
+
482
+ .border-inner-bottom-none>* {
483
+ border-bottom: none
484
+ }
485
+
486
+ .border-inner-top-none>* {
487
+ border-top: none
488
+ }
489
+
490
+ .border-inner-start-none>* {
491
+ border-inline-start: none
492
+ }
493
+
494
+ .border-inner-end-none>* {
495
+ border-inline-end: none
496
+ }
497
+
466
498
 
467
499
 
468
500
  @media screen and (max-width: 910px) {
@@ -927,5 +959,35 @@
927
959
  border-inline-end: 1px solid var(--border-color)
928
960
  }
929
961
 
962
+ .m_border-bottom-none {
963
+ border-bottom: none
964
+ }
965
+
966
+ .m_border-top-none {
967
+ border-top: none
968
+ }
969
+
970
+ .m_border-start-none {
971
+ border-inline-start: none
972
+ }
973
+
974
+ .m_border-end-none {
975
+ border-inline-end: none
976
+ }
930
977
 
978
+ .m_border-inner-bottom-none>* {
979
+ border-bottom: none
980
+ }
981
+
982
+ .m_border-inner-top-none>* {
983
+ border-top: none
984
+ }
985
+
986
+ .m_border-inner-start-none>* {
987
+ border-inline-start: none
988
+ }
989
+
990
+ .m_border-inner-end-none>* {
991
+ border-inline-end: none
992
+ }
931
993
  }
@@ -1,34 +0,0 @@
1
- type Option = {
2
- label: string;
3
- value: string;
4
- } | string | number;
5
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
6
- modelValue: string | number;
7
- options: Option[];
8
- placeholder?: string | undefined;
9
- label?: string | undefined;
10
- id: string;
11
- required: boolean;
12
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
- "update:modelValue": (...args: any[]) => void;
14
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
15
- modelValue: string | number;
16
- options: Option[];
17
- placeholder?: string | undefined;
18
- label?: string | undefined;
19
- id: string;
20
- required: boolean;
21
- }>>> & {
22
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
23
- }, {}, {}>;
24
- export default _default;
25
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
26
- type __VLS_TypePropsToRuntimeProps<T> = {
27
- [K in keyof T]-?: {} extends Pick<T, K> ? {
28
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
29
- } : {
30
- type: import('vue').PropType<T[K]>;
31
- required: true;
32
- };
33
- };
34
- //# sourceMappingURL=Drop.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Drop.vue.d.ts","sourceRoot":"","sources":["../../src/components/Drop.vue"],"names":[],"mappings":"AAcA;AAMA,KAAK,MAAM,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,GAAG,MAAM,CAAC;;gBA8KN,MAAM,GAAG,MAAM;aAClB,MAAM,EAAE;;;QAGb,MAAM;cACA,OAAO;;;;gBALL,MAAM,GAAG,MAAM;aAClB,MAAM,EAAE;;;QAGb,MAAM;cACA,OAAO;;;;AAXnB,wBAcG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
@@ -1,60 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
- id?: string | undefined;
3
- private?: 0 | 1 | undefined;
4
- singleFile?: boolean | undefined;
5
- beforeUpload?: (() => Promise<any>) | undefined;
6
- dragDropLabel?: string | undefined;
7
- browseLabel?: string | undefined;
8
- }>, {
9
- private: number;
10
- entity: string;
11
- id: string;
12
- beforeUpload: () => Promise<void>;
13
- dragDropLabel: string;
14
- browseLabel: string;
15
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
- done: (...args: any[]) => void;
17
- complete: (...args: any[]) => void;
18
- }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
19
- id?: string | undefined;
20
- private?: 0 | 1 | undefined;
21
- singleFile?: boolean | undefined;
22
- beforeUpload?: (() => Promise<any>) | undefined;
23
- dragDropLabel?: string | undefined;
24
- browseLabel?: string | undefined;
25
- }>, {
26
- private: number;
27
- entity: string;
28
- id: string;
29
- beforeUpload: () => Promise<void>;
30
- dragDropLabel: string;
31
- browseLabel: string;
32
- }>>> & {
33
- onDone?: ((...args: any[]) => any) | undefined;
34
- onComplete?: ((...args: any[]) => any) | undefined;
35
- }, {
36
- id: string;
37
- private: 1 | 0;
38
- beforeUpload: () => Promise<any>;
39
- dragDropLabel: string;
40
- browseLabel: string;
41
- }, {}>;
42
- export default _default;
43
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
44
- type __VLS_TypePropsToRuntimeProps<T> = {
45
- [K in keyof T]-?: {} extends Pick<T, K> ? {
46
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
47
- } : {
48
- type: import('vue').PropType<T[K]>;
49
- required: true;
50
- };
51
- };
52
- type __VLS_WithDefaults<P, D> = {
53
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
54
- default: D[K];
55
- }> : P[K];
56
- };
57
- type __VLS_Prettify<T> = {
58
- [K in keyof T]: T[K];
59
- } & {};
60
- //# sourceMappingURL=FileUploader.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileUploader.vue.d.ts","sourceRoot":"","sources":["../../src/components/FileUploader.vue"],"names":[],"mappings":"AAiDA;;;;;0BA6YuB,QAAQ,GAAG,CAAC;;;;;;;;;;;;;;;;;0BAAZ,QAAQ,GAAG,CAAC;;;;;;;;;;;;;;QAJ5B,MAAM;aAED,CAAC,GAAG,CAAC;kBAEA,MAAM,QAAQ,GAAG,CAAC;mBACjB,MAAM;iBACR,MAAM;;AARtB,wBAeG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}