glib-web 2.4.0 → 2.5.0

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 (149) hide show
  1. package/.eslintrc.js +0 -0
  2. package/README.md +0 -0
  3. package/actions/analytics/logEvent.js +0 -0
  4. package/actions/auth/creditCard.js +0 -0
  5. package/actions/auth/saveCsrfToken.js +0 -0
  6. package/actions/cables/push.js +0 -0
  7. package/actions/commands/copy.js +0 -0
  8. package/actions/dialogs/alert.js +0 -0
  9. package/actions/dialogs/close.js +0 -0
  10. package/actions/dialogs/notification.js +0 -0
  11. package/actions/dialogs/open.js +0 -0
  12. package/actions/dialogs/reload.js +0 -0
  13. package/actions/dialogs/show.js +0 -0
  14. package/actions/http/delete.js +0 -0
  15. package/actions/http/patch.js +0 -0
  16. package/actions/http/post.js +0 -0
  17. package/actions/http/put.js +0 -0
  18. package/actions/panels/scrollTo.js +0 -0
  19. package/actions/panels/scrollToBottom.js +0 -0
  20. package/actions/runMultiple.js +0 -0
  21. package/actions/sheets/select.js +0 -0
  22. package/actions/snackbars/alert.js +0 -0
  23. package/actions/snackbars/select.js +0 -0
  24. package/actions/timeouts/set.js +0 -0
  25. package/actions/tours/start.js +0 -0
  26. package/actions/windows/close.js +0 -0
  27. package/actions/windows/closeAll.js +0 -0
  28. package/actions/windows/closeWithReload.js +0 -0
  29. package/actions/windows/open.js +0 -0
  30. package/actions/windows/openWeb.js +0 -0
  31. package/actions/windows/print.js +0 -0
  32. package/actions/windows/refreshState.js +0 -0
  33. package/actions/windows/reload.js +0 -0
  34. package/actions/ws/push.js +0 -0
  35. package/components/_button.vue +3 -1
  36. package/components/_dropdownMenu.vue +0 -0
  37. package/components/_icon.vue +0 -0
  38. package/components/banners/alert.vue +0 -0
  39. package/components/banners/select.vue +0 -0
  40. package/components/calendar.vue +0 -0
  41. package/components/component.vue +2 -0
  42. package/components/fields/autocomplete.vue +0 -0
  43. package/components/fields/creditCard.vue +0 -0
  44. package/components/fields/file.vue +0 -0
  45. package/components/fields/googlePlace.vue +0 -0
  46. package/components/fields/hidden.vue +0 -0
  47. package/components/fields/location.vue +0 -0
  48. package/components/fields/newRichText.vue +0 -0
  49. package/components/fields/otpField.vue +98 -0
  50. package/components/fields/phone/countries.js +0 -0
  51. package/components/fields/phone/field.vue +0 -0
  52. package/components/fields/phone/sprite.css +0 -0
  53. package/components/fields/rating.vue +0 -0
  54. package/components/fields/stripe/stripeFields.vue +0 -0
  55. package/components/fields/stripe/stripeIndividualFields.vue +0 -0
  56. package/components/fields/stripeExternalAccount.vue +0 -0
  57. package/components/fields/stripeToken.vue +0 -0
  58. package/components/fields/submit.vue +0 -0
  59. package/components/fields/textarea.vue +0 -0
  60. package/components/fields/timer.vue +0 -0
  61. package/components/h1.vue +0 -0
  62. package/components/h2.vue +0 -0
  63. package/components/h3.vue +0 -0
  64. package/components/h5.vue +0 -0
  65. package/components/h6.vue +0 -0
  66. package/components/icon.vue +0 -0
  67. package/components/label.vue +0 -0
  68. package/components/map.vue +115 -29
  69. package/components/mixins/chart/annotation.js +0 -0
  70. package/components/mixins/chart/tooltip.js +0 -0
  71. package/components/mixins/dataset.js +0 -0
  72. package/components/mixins/extension.js +0 -0
  73. package/components/mixins/list/autoload.js +0 -0
  74. package/components/mixins/table/autoload.js +0 -0
  75. package/components/mixins/text.js +0 -0
  76. package/components/mixins/ws/actionCable.js +0 -0
  77. package/components/mixins/ws/phoenixSocket.js +0 -0
  78. package/components/multimedia/video.vue +0 -0
  79. package/components/panels/carousel.vue +0 -0
  80. package/components/panels/custom.vue +0 -0
  81. package/components/panels/flow.vue +0 -0
  82. package/components/panels/grid.vue +0 -0
  83. package/components/panels/horizontal.vue +1 -17
  84. package/components/panels/list.vue +0 -0
  85. package/components/panels/scroll.vue +0 -0
  86. package/components/panels/split.vue +0 -0
  87. package/components/panels/table.vue +0 -0
  88. package/components/panels/vertical.vue +0 -0
  89. package/components/panels/web.vue +0 -0
  90. package/components/progressbar.vue +0 -0
  91. package/components/spacer.vue +0 -0
  92. package/components/switch.vue +0 -0
  93. package/components/tabBar.vue +0 -0
  94. package/nav/dialog.vue +0 -0
  95. package/nav/drawerLabel.vue +0 -0
  96. package/nav/sheet.vue +0 -0
  97. package/nav/snackbar.vue +0 -0
  98. package/package.json +1 -1
  99. package/plugins/driverCustomBehavior.js +0 -0
  100. package/static/plugins/alignment/alignment.js +0 -0
  101. package/static/plugins/alignment/alignment.min.js +0 -0
  102. package/static/plugins/beyondgrammar/beyondgrammar.js +0 -0
  103. package/static/plugins/beyondgrammar/beyondgrammar.min.js +0 -0
  104. package/static/plugins/blockcode/blockcode.js +0 -0
  105. package/static/plugins/blockcode/blockcode.min.js +0 -0
  106. package/static/plugins/clips/clips.js +0 -0
  107. package/static/plugins/clips/clips.min.js +0 -0
  108. package/static/plugins/counter/counter.js +0 -0
  109. package/static/plugins/counter/counter.min.js +0 -0
  110. package/static/plugins/definedlinks/definedlinks.js +0 -0
  111. package/static/plugins/definedlinks/definedlinks.min.js +0 -0
  112. package/static/plugins/handle/handle.js +0 -0
  113. package/static/plugins/handle/handle.min.js +0 -0
  114. package/static/plugins/icons/icons.js +0 -0
  115. package/static/plugins/icons/icons.min.js +0 -0
  116. package/static/plugins/imageposition/imageposition.js +0 -0
  117. package/static/plugins/imageposition/imageposition.min.js +0 -0
  118. package/static/plugins/inlineformat/inlineformat.js +0 -0
  119. package/static/plugins/inlineformat/inlineformat.min.js +0 -0
  120. package/static/plugins/removeformat/removeformat.js +0 -0
  121. package/static/plugins/removeformat/removeformat.min.js +0 -0
  122. package/static/plugins/selector/selector.js +0 -0
  123. package/static/plugins/selector/selector.min.js +0 -0
  124. package/static/plugins/specialchars/specialchars.js +0 -0
  125. package/static/plugins/specialchars/specialchars.min.js +0 -0
  126. package/static/plugins/textdirection/textdirection.js +0 -0
  127. package/static/plugins/textdirection/textdirection.min.js +0 -0
  128. package/static/plugins/textexpander/textexpander.js +0 -0
  129. package/static/plugins/textexpander/textexpander.min.js +0 -0
  130. package/static/plugins/underline/underline.js +0 -0
  131. package/static/plugins/underline/underline.min.js +0 -0
  132. package/static/redactorx.css +0 -0
  133. package/static/redactorx.js +0 -0
  134. package/static/redactorx.min.css +0 -0
  135. package/static/redactorx.min.js +0 -0
  136. package/static/redactorx.usm.min.js +0 -0
  137. package/templates/_menu.vue +0 -0
  138. package/templates/comment.vue +0 -0
  139. package/templates/featured.vue +0 -0
  140. package/utils/helper.js +0 -0
  141. package/utils/history.js +0 -0
  142. package/utils/http.js +0 -0
  143. package/utils/launch.js +0 -0
  144. package/utils/mime_type.js +0 -0
  145. package/utils/private/ws.js +0 -0
  146. package/utils/storage.js +0 -0
  147. package/utils/type.js +0 -0
  148. package/utils/uploader.js +0 -0
  149. package/utils/url.js +0 -0
package/.eslintrc.js CHANGED
File without changes
package/README.md CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -16,7 +16,9 @@
16
16
  :tile="$classes().includes('tile')"
17
17
  :rounded="$classes().includes('rounded')"
18
18
  :depressed="$classes().includes('depressed')"
19
- @click.prevent="type == 'submit' ? null : $onClick()"
19
+ @click.prevent="
20
+ type == 'submit' ? $dispatchEvent('forms/submit') : $onClick()
21
+ "
20
22
  v-on="eventHandlers"
21
23
  >
22
24
  <span><common-icon :spec="spec.icon || {}"/></span>
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -90,6 +90,7 @@ import CreditCardField from "./fields/creditCard";
90
90
  import RatingField from "./fields/rating";
91
91
  import PhoneField from "./fields/phone/field";
92
92
  import TimerField from "./fields/timer";
93
+ import OtpField from "./fields/otpField";
93
94
 
94
95
  import ScrollPanel from "./panels/scroll";
95
96
  import VerticalPanel from "./panels/vertical";
@@ -179,6 +180,7 @@ export default {
179
180
  "fields-rating": RatingField,
180
181
  "fields-phone": PhoneField,
181
182
  "fields-timer": TimerField,
183
+ "fields-otp": OtpField,
182
184
 
183
185
  "panels-scroll": ScrollPanel,
184
186
  "panels-vertical": VerticalPanel,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <div>
3
+ <input
4
+ v-for="(digit, index) in digits"
5
+ ref="input"
6
+ :key="index"
7
+ v-model="otp[index]"
8
+ maxlength="1"
9
+ class="otp-input"
10
+ @input="handleInput($event, index)"
11
+ @keydown="handleKeydown($event, index)"
12
+ @paste="handlePaste($event, index)"
13
+ @focus="handleFocus($event, index)"
14
+ @blur="handleBlur($event, index)"
15
+ />
16
+ <input type="hidden" :name="spec.name" :value="otpValue" />
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ export default {
22
+ props: {
23
+ spec: { type: Object, required: true }
24
+ },
25
+ data() {
26
+ return {
27
+ digits: 0,
28
+ otp: []
29
+ };
30
+ },
31
+
32
+ computed: {
33
+ otpValue() {
34
+ // concatenate the digits into a single string
35
+ return this.otp.join("");
36
+ }
37
+ },
38
+ methods: {
39
+ $ready() {
40
+ this.digits = this.spec.lengths;
41
+ this.otp = Array(this.spec.lengths).fill("");
42
+ },
43
+ handleInput(event, index) {
44
+ if (event.target.value.length === 1) {
45
+ this.focusNext(index);
46
+ }
47
+ },
48
+ handleKeydown(event, index) {
49
+ if (event.key === "Backspace") {
50
+ event.preventDefault();
51
+ this.focusPrevious(index);
52
+ this.$set(this.otp, index, "");
53
+ }
54
+ },
55
+ handlePaste(event, index) {
56
+ event.preventDefault();
57
+ const pasted = event.clipboardData
58
+ .getData("text")
59
+ .slice(0, this.digits - index);
60
+ for (let i = 0; i < pasted.length; i++) {
61
+ this.$set(this.otp, index + i, pasted[i]);
62
+ }
63
+ this.focusNext(index + pasted.length - 1);
64
+ },
65
+ handleFocus(event, index) {
66
+ if (index > 0 && this.otp[index - 1] === "") {
67
+ this.focusPrevious(index);
68
+ }
69
+ },
70
+ handleBlur(event, index) {
71
+ if (this.otp.filter(digit => digit === "").length === 0) {
72
+ this.$emit("complete", this.otp.join(""));
73
+ }
74
+ },
75
+ focusNext(index) {
76
+ if (index < this.digits - 1) {
77
+ this.$refs.input[index + 1].focus();
78
+ }
79
+ },
80
+ focusPrevious(index) {
81
+ if (index > 0) {
82
+ this.$refs.input[index - 1].focus();
83
+ }
84
+ }
85
+ }
86
+ };
87
+ </script>
88
+ <style scoped>
89
+ .otp-input {
90
+ border: 1px solid #47495f;
91
+ text-align: center;
92
+ width: 50px;
93
+ height: 50px;
94
+ border-radius: 4px;
95
+ font-size: 24px;
96
+ margin: 8px;
97
+ }
98
+ </style>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/components/h1.vue CHANGED
File without changes
package/components/h2.vue CHANGED
File without changes
package/components/h3.vue CHANGED
File without changes
package/components/h5.vue CHANGED
File without changes
package/components/h6.vue CHANGED
File without changes
File without changes
File without changes
@@ -1,5 +1,4 @@
1
1
  <template>
2
- <!-- <div ref="map" :style="genericStyles()"></div> -->
3
2
  <gmap-map
4
3
  ref="map"
5
4
  :center="center"
@@ -43,19 +42,48 @@
43
42
  </gmap-marker>
44
43
  </gmap-cluster>
45
44
  <template v-else>
46
- <gmap-custom-marker
47
- v-for="(marker, index) in markers"
48
- :key="index"
49
- :marker="{ lat: marker.latitude, lng: marker.longitude }"
50
- @click.native="onMarkerClick(marker, index)"
51
- >
52
- <img v-if="marker.imageUrl" :src="marker.imageUrl" class="marker" />
53
- <common-icon
54
- v-else
55
- class="marker"
56
- :spec="{ material: { name: 'place', size: 40 }, color: '#c92b2a' }"
57
- />
58
- </gmap-custom-marker>
45
+ <template v-if="spec.direction">
46
+ <gmap-custom-marker
47
+ v-for="(marker, index) in markers"
48
+ :key="index"
49
+ :marker="{ lat: marker.latitude, lng: marker.longitude }"
50
+ @click.native="onMarkerClick(marker, index)"
51
+ >
52
+ <div class="marker-wrapper">
53
+ <img v-if="marker.imageUrl" :src="marker.imageUrl" class="marker" />
54
+ <common-icon
55
+ v-else
56
+ class="marker"
57
+ :spec="{
58
+ material: { name: 'circle', size: 40 },
59
+ color: marker.markerColor
60
+ }"
61
+ />
62
+ <p class="marker-number">{{ marker.markerNumber }}</p>
63
+ </div>
64
+ </gmap-custom-marker>
65
+ </template>
66
+ <template v-else>
67
+ <gmap-custom-marker
68
+ v-for="(marker, index) in markers"
69
+ :key="index"
70
+ :marker="{ lat: marker.latitude, lng: marker.longitude }"
71
+ @click.native="onMarkerClick(marker, index)"
72
+ >
73
+ <div class="marker-wrapper">
74
+ <img v-if="marker.imageUrl" :src="marker.imageUrl" class="marker" />
75
+ <common-icon
76
+ v-else
77
+ class="marker"
78
+ :spec="{
79
+ material: { name: 'place', size: 40 },
80
+ color: '#c92b2a'
81
+ }"
82
+ />
83
+ <p class="marker-number">{{ marker.markerNumber }}</p>
84
+ </div>
85
+ </gmap-custom-marker>
86
+ </template>
59
87
  </template>
60
88
  </gmap-map>
61
89
  </template>
@@ -85,9 +113,35 @@ export default {
85
113
  selectedMarker: null,
86
114
  center: { lat: 0, lng: 0 },
87
115
  zoom: 11,
88
- markers: []
116
+ markers: [],
117
+ locations: this.spec.locations
89
118
  };
90
119
  },
120
+ // mounted: function() {
121
+ // // switch (this.spec.provider) {
122
+ // // case 'baidu':
123
+ // // this.renderBaiduMap()
124
+ // // break
125
+ // // default:
126
+ // // this.renderGoogleMap()
127
+ // // }
128
+ // const { latitude, longitude, zoom } = this.spec
129
+ // this.updateMapCenter(latitude, longitude)
130
+ // this.zoom = zoom
131
+
132
+ // this.fetchMarkers()
133
+ // }
134
+ mounted: function() {
135
+ // use $nextTick instead setTimeout
136
+ // https://stackoverflow.com/questions/57847474/react-and-vue-google-map-api-remove-rendered-direction-before-setting-a-new-one
137
+ this.$nextTick(function() {
138
+ this.$gmapApiPromiseLazy().then(() => {
139
+ if (this.spec.direction === true) {
140
+ this.drawLineBetweenPoint();
141
+ }
142
+ });
143
+ });
144
+ },
91
145
  methods: {
92
146
  // See https://stackoverflow.com/questions/37597324/markercluster-one-marker-for-a-group for calculator example
93
147
  _calculator(markers, numStyles) {
@@ -195,26 +249,58 @@ export default {
195
249
  const { center } = this.$refs.map.$mapObject;
196
250
  this.updateMapCenter(center.lat(), center.lng());
197
251
  this.fetchMarkers();
252
+ },
253
+ drawLineBetweenPoint() {
254
+ let directionService = new window.google.maps.DirectionsService();
255
+ let directionDisplay = new window.google.maps.DirectionsRenderer();
256
+
257
+ for (let l = 0; l < this.locations.length; l++) {
258
+ for (let i = 0; i < this.locations[l].length; i++) {
259
+ let travel = {
260
+ origin: this.locations[l][i],
261
+ destination: this.locations[l][i + 1],
262
+ travelMode: "DRIVING"
263
+ };
264
+
265
+ directionService.route(travel, (response, status) => {
266
+ if (status === "OK") {
267
+ let map = this.$refs.map;
268
+ directionDisplay = new window.google.maps.DirectionsRenderer({
269
+ suppressMarkers: true,
270
+ polylineOptions: {
271
+ strokeColor: "#2ab3a6",
272
+ stropeOpacity: 0.8,
273
+ strokeWeight: 5
274
+ }
275
+ });
276
+ directionDisplay.setMap(map.$mapObject);
277
+ directionDisplay.setDirections(response);
278
+ }
279
+ });
280
+ }
281
+ }
198
282
  }
199
283
  }
200
- // mounted: function() {
201
- // // switch (this.spec.provider) {
202
- // // case 'baidu':
203
- // // this.renderBaiduMap()
204
- // // break
205
- // // default:
206
- // // this.renderGoogleMap()
207
- // // }
208
- // const { latitude, longitude, zoom } = this.spec
209
- // this.updateMapCenter(latitude, longitude)
210
- // this.zoom = zoom
211
-
212
- // this.fetchMarkers()
213
- // }
214
284
  };
215
285
  </script>
216
286
 
217
287
  <style lang="scss" scoped>
288
+ .marker-wrapper {
289
+ position: relative;
290
+ width: 40px;
291
+ height: 40px;
292
+ }
293
+
294
+ .marker-number {
295
+ font-weight: 800;
296
+ font-size: 16px;
297
+ position: absolute;
298
+ top: 6px;
299
+ width: 40px;
300
+ text-align: center;
301
+ color: white;
302
+ }
303
+
218
304
  .marker {
219
305
  width: 40px;
220
306
  height: 40px;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -6,7 +6,7 @@
6
6
  :href="$href()"
7
7
  @click="$onClick()"
8
8
  >
9
- <template v-for="(item, index) in childViews">
9
+ <template v-for="(item, index) in spec.childViews">
10
10
  <glib-component :key="index" :spec="item" />
11
11
  </template>
12
12
  </component>
@@ -17,11 +17,6 @@ export default {
17
17
  props: {
18
18
  spec: { type: Object, required: true }
19
19
  },
20
- data() {
21
- return {
22
- childViews: null
23
- };
24
- },
25
20
  computed: {
26
21
  cssClasses: function() {
27
22
  const classes = this.$classes().concat("layouts-horizontal");
@@ -63,19 +58,8 @@ export default {
63
58
  }
64
59
  },
65
60
  methods: {
66
- $ready() {
67
- this.childViews = this.spec.childViews;
68
- console.log("C1", this.childViews);
69
- },
70
61
  $displayValue() {
71
62
  return "flex";
72
- },
73
- action_merge(mergedSpec) {
74
- console.log("mergedSpec1", this.spec, this.spec.childViews);
75
- Object.assign(this.spec, mergedSpec);
76
- console.log("mergedSpec2", this.spec, this.spec.childViews);
77
- // this.$refs.delegate.updateData();
78
- this.$ready();
79
63
  }
80
64
  }
81
65
  };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/nav/dialog.vue CHANGED
File without changes
File without changes
package/nav/sheet.vue CHANGED
File without changes
package/nav/snackbar.vue CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/utils/helper.js CHANGED
File without changes
package/utils/history.js CHANGED
File without changes
package/utils/http.js CHANGED
File without changes
package/utils/launch.js CHANGED
File without changes
File without changes
File without changes
package/utils/storage.js CHANGED
File without changes
package/utils/type.js CHANGED
File without changes
package/utils/uploader.js CHANGED
File without changes
package/utils/url.js CHANGED
File without changes