@mixd-id/web-scaffold 0.1.230406329 → 0.1.230406331

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406329",
4
+ "version": "0.1.230406331",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -0,0 +1,191 @@
1
+ <template>
2
+ <div class="flex">
3
+ <div v-if="config.apiKey" ref="map" class="flex-1"></div>
4
+ <div v-else class="flex-1 flex items-center justify-center text-text-400">{{ error }}</div>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+
10
+ import { Loader } from '@googlemaps/js-api-loader';
11
+
12
+ export default{
13
+
14
+ props: {
15
+ value: Array,
16
+
17
+ config: {
18
+ type: Object,
19
+ default: {}
20
+ },
21
+ },
22
+
23
+ data(){
24
+ return {
25
+ error: this.$t('Google maps api required'),
26
+ map: null
27
+ }
28
+ },
29
+
30
+ mounted() {
31
+ this.load()
32
+ },
33
+
34
+ methods: {
35
+
36
+ load(){
37
+ if(!this.config.apiKey) return
38
+ if(!this.value) return this.error = 'No value'
39
+
40
+ const loader = new Loader({
41
+ apiKey: this.config.apiKey // "AIzaSyBmzMlmrR5St-njtN--64y_oLTa9FDLYfQ"
42
+ })
43
+
44
+ loader.load()
45
+ .then(async () => {
46
+
47
+ loader.load().then(() => {
48
+ if(!Array.isArray(this.value) || this.value.length < 1) return
49
+
50
+ const map = new google.maps.Map(this.$refs.map, {
51
+ center: this.value[0], // Example: San Francisco
52
+ zoom: 12,
53
+ mapTypeId: 'roadmap',
54
+ streetViewControl: false,
55
+ keyboardShortcuts: false,
56
+ styles: [
57
+ { elementType: "geometry", stylers: [{ color: "#242f3e" }] },
58
+ { elementType: "labels.text.stroke", stylers: [{ color: "#242f3e" }] },
59
+ { elementType: "labels.text.fill", stylers: [{ color: "#746855" }] },
60
+ {
61
+ featureType: "administrative.locality",
62
+ elementType: "labels.text.fill",
63
+ stylers: [{ color: "#d59563" }],
64
+ },
65
+ {
66
+ featureType: "poi",
67
+ elementType: "labels.text.fill",
68
+ stylers: [{ color: "#d59563" }],
69
+ },
70
+ {
71
+ featureType: "poi.park",
72
+ elementType: "geometry",
73
+ stylers: [{ color: "#263c3f" }],
74
+ },
75
+ {
76
+ featureType: "poi.park",
77
+ elementType: "labels.text.fill",
78
+ stylers: [{ color: "#6b9a76" }],
79
+ },
80
+ {
81
+ featureType: "road",
82
+ elementType: "geometry",
83
+ stylers: [{ color: "#38414e" }],
84
+ },
85
+ {
86
+ featureType: "road",
87
+ elementType: "geometry.stroke",
88
+ stylers: [{ color: "#212a37" }],
89
+ },
90
+ {
91
+ featureType: "road",
92
+ elementType: "labels.text.fill",
93
+ stylers: [{ color: "#9ca5b3" }],
94
+ },
95
+ {
96
+ featureType: "road.highway",
97
+ elementType: "geometry",
98
+ stylers: [{ color: "#746855" }],
99
+ },
100
+ {
101
+ featureType: "road.highway",
102
+ elementType: "geometry.stroke",
103
+ stylers: [{ color: "#1f2835" }],
104
+ },
105
+ {
106
+ featureType: "road.highway",
107
+ elementType: "labels.text.fill",
108
+ stylers: [{ color: "#f3d19c" }],
109
+ },
110
+ {
111
+ featureType: "transit",
112
+ elementType: "geometry",
113
+ stylers: [{ color: "#2f3948" }],
114
+ },
115
+ {
116
+ featureType: "transit.station",
117
+ elementType: "labels.text.fill",
118
+ stylers: [{ color: "#d59563" }],
119
+ },
120
+ {
121
+ featureType: "water",
122
+ elementType: "geometry",
123
+ stylers: [{ color: "#17263c" }],
124
+ },
125
+ {
126
+ featureType: "water",
127
+ elementType: "labels.text.fill",
128
+ stylers: [{ color: "#515c6d" }],
129
+ },
130
+ {
131
+ featureType: "water",
132
+ elementType: "labels.text.stroke",
133
+ stylers: [{ color: "#17263c" }],
134
+ },
135
+ ]
136
+ });
137
+
138
+ const root = document.documentElement;
139
+ const primaryColor600 = getComputedStyle(root).getPropertyValue('--primary-600').trim()
140
+ const primaryColor300 = getComputedStyle(root).getPropertyValue('--primary-300').trim()
141
+
142
+ const line = new google.maps.Polyline({
143
+ path: this.value,
144
+ geodesic: true,
145
+ strokeColor: `rgb(${primaryColor600})`,
146
+ strokeOpacity: .8,
147
+ strokeWeight: 6,
148
+ });
149
+ line.setMap(map);
150
+
151
+ for(let i = this.value.length - 1 ; i >= 0 ; i--){
152
+ const point = this.value[i]
153
+
154
+ new google.maps.Circle({
155
+ strokeColor: `rgb(${primaryColor600})`,
156
+ strokeOpacity: 0.8,
157
+ strokeWeight: 2,
158
+ fillColor: i === 0 ? '#FFF' : `rgb(${primaryColor300})`,
159
+ fillOpacity: .8,
160
+ map,
161
+ center: point,
162
+ radius: 10, // Radius in meters (adjust as needed)
163
+ });
164
+ }
165
+
166
+ }).catch(e => {
167
+ this.error = 'Error loading Google Maps JavaScript API'
168
+ });
169
+ });
170
+ }
171
+
172
+ },
173
+
174
+ watch: {
175
+
176
+ data(){
177
+ this.load()
178
+ }
179
+
180
+ }
181
+ }
182
+
183
+ </script>
184
+
185
+ <style module>
186
+
187
+ .comp{
188
+
189
+ }
190
+
191
+ </style>
@@ -383,6 +383,9 @@ export default{
383
383
  return this.socket.send('user.preset', { key:this.presetKey })
384
384
  .then(config => {
385
385
  Object.assign(this.config, config)
386
+
387
+ if(this.$route.query?.search)
388
+ this.preset.search = this.$route.query.search
386
389
  })
387
390
  }
388
391
  return new Promise(resolve => resolve())
@@ -669,7 +672,7 @@ export default{
669
672
  let [ kk, ...vv ] = column.key.split('-')
670
673
  vv = vv.join('-')
671
674
 
672
- if(![ 'count', 'countDistinct' ].includes(vv)){
675
+ if(![ 'count', 'countDistinct', 'sum' ].includes(vv)){
673
676
 
674
677
  const key = kk.substring(1)
675
678
  const presetColumn = this.preset.columns.find(_ => _.key === key)
@@ -696,6 +699,17 @@ export default{
696
699
  }]
697
700
  })
698
701
  }
702
+ else if([ 'sum' ].includes(vv)){
703
+ const key = kk.substring(1)
704
+
705
+ filters.push({
706
+ key,
707
+ value: [{
708
+ operator: '>',
709
+ value: 0
710
+ }]
711
+ })
712
+ }
699
713
 
700
714
  this.extBar.open = true
701
715
  this.extBar.filters = filters
@@ -2,7 +2,7 @@
2
2
  <div :class="computedClass">
3
3
  <button v-for="(item, index) in filteredItems" :class="tabClass(item)"
4
4
  class="whitespace-nowrap"
5
- @click="onClick(item)" type="button" >
5
+ @click="item.disabled !== true ? onClick(item) : ''" type="button" >
6
6
  <slot name="default" :="{ item, index }">
7
7
  <label class="px-1">
8
8
  {{ item.text }}
package/src/index.js CHANGED
@@ -591,6 +591,7 @@ export default{
591
591
  app.component('Chart', defineAsyncComponent(() => import("./components/Chart.vue")))
592
592
  app.component('DGrid', defineAsyncComponent(() => import("./components/DGrid.vue")))
593
593
  app.component('DGridItem', defineAsyncComponent(() => import("./components/DGridItem.vue")))
594
+ app.component('GmapsDirection', defineAsyncComponent(() => import("./components/GmapsDirection.vue")))
594
595
 
595
596
  app.component('AhrefSetting', defineAsyncComponent(() => import("./widgets/AhrefSetting.vue")))
596
597
  app.component('ArticleSetting', defineAsyncComponent(() => import("./widgets/ArticleSetting.vue")))