glib-web 0.7.1 → 0.8.2

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 (51) hide show
  1. package/LICENSE +0 -0
  2. package/actions/auth/restart.js +0 -0
  3. package/actions/dialogs/oauth.js +0 -0
  4. package/actions/dialogs/options.js +0 -0
  5. package/actions/sheets/select.js +0 -0
  6. package/actions/snackbars/alert.js +0 -0
  7. package/actions/snackbars/select.js +0 -0
  8. package/actions/windows/openWeb.js +0 -0
  9. package/components/_message.vue +0 -0
  10. package/components/component.vue +2 -2
  11. package/components/datetime.vue +0 -0
  12. package/components/fab.vue +0 -0
  13. package/components/fields/_select.vue +0 -0
  14. package/components/fields/country/countries.js +0 -0
  15. package/components/fields/country/field.vue +0 -0
  16. package/components/fields/country/regions.js +0 -0
  17. package/components/fields/datetime.vue +0 -0
  18. package/components/fields/dynamicSelect.vue +0 -0
  19. package/components/fields/select.vue +0 -0
  20. package/components/fields/timeZone.vue +0 -0
  21. package/components/hr.vue +0 -0
  22. package/components/html.vue +0 -0
  23. package/components/image.vue +0 -0
  24. package/components/mixins/longClick.js +0 -0
  25. package/components/mixins/scrolling.js +0 -0
  26. package/components/mixins/table/export.js +0 -0
  27. package/components/mixins/table/import.js +0 -0
  28. package/components/p.vue +0 -0
  29. package/components/panels/column.vue +0 -0
  30. package/components/panels/custom.vue +0 -0
  31. package/components/panels/horizontal.vue +0 -0
  32. package/components/panels/split.vue +0 -0
  33. package/components/panels/ul.vue +0 -0
  34. package/components/{socialSharing.vue → shareButton.vue} +20 -1
  35. package/index.js +1 -1
  36. package/keys.js +0 -0
  37. package/nav/dialog.vue +1 -1
  38. package/nav/drawer.vue +83 -2
  39. package/nav/drawerButton.vue +0 -0
  40. package/package.json +1 -1
  41. package/settings.json.example +0 -0
  42. package/styles/test.sass +0 -0
  43. package/styles/test.scss +0 -0
  44. package/templates/featured.vue +0 -0
  45. package/templates/unsupported.vue +0 -0
  46. package/utils/dom.js +0 -0
  47. package/utils/http.js +1 -0
  48. package/utils/public.js +0 -0
  49. package/utils/settings.js +0 -0
  50. package/utils/storage.js +0 -0
  51. package/utils/url.js +0 -0
package/LICENSE 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
@@ -113,7 +113,7 @@ import SelectBanner from "./banners/select";
113
113
  import LineChart from "./charts/line";
114
114
  import ColumnChart from "./charts/column";
115
115
 
116
- import SocialSharing from "./socialSharing";
116
+ import ShareButton from "./shareButton";
117
117
 
118
118
  export default {
119
119
  components: {
@@ -145,7 +145,7 @@ export default {
145
145
  "views-map": Map,
146
146
  "views-tabBar": TabBar,
147
147
  "views-calendar": Calendar,
148
- "views-socialSharing": SocialSharing,
148
+ "views-shareButton": ShareButton,
149
149
 
150
150
  "fields-hidden": HiddenField,
151
151
  "fields-text": TextField,
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/hr.vue CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/components/p.vue CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,7 +5,7 @@
5
5
  :url="spec.url"
6
6
  :title="spec.title"
7
7
  :description="spec.description"
8
- :quote="spec.quote"
8
+ :quote="spec.facebookQuote"
9
9
  :hashtags="spec.hashtags"
10
10
  :twitter-user="spec.twitterUser"
11
11
  >
@@ -16,6 +16,8 @@
16
16
  </template>
17
17
 
18
18
  <script>
19
+ import Action from "../action";
20
+
19
21
  export default {
20
22
  props: {
21
23
  spec: { type: Object, required: true }
@@ -23,6 +25,10 @@ export default {
23
25
  data() {
24
26
  return {
25
27
  config: {
28
+ copy: {
29
+ icon: "far fah fa-lg fa-copy",
30
+ color: "#183153"
31
+ },
26
32
  email: {
27
33
  icon: "far fah fa-lg fa-envelope",
28
34
  color: "#333333"
@@ -85,6 +91,19 @@ export default {
85
91
  }
86
92
  }
87
93
  };
94
+ },
95
+ mounted() {
96
+ if (this.spec.onClick) {
97
+ const parentElement = this.$el.parentElement;
98
+ // remove default event listener
99
+ this.$el.replaceWith(this.$el.cloneNode(true));
100
+ // manually attach event listener because @click not working
101
+ parentElement
102
+ .querySelector(`a.${this.$el.classList[0]}`)
103
+ .addEventListener("click", () => {
104
+ Action.execute(this.spec.onClick, this);
105
+ });
106
+ }
88
107
  }
89
108
  };
90
109
  </script>
package/index.js CHANGED
@@ -39,7 +39,7 @@ Vue.use(VueYoutube);
39
39
  // })
40
40
 
41
41
  import VueSocialSharing from "vue-social-sharing";
42
- Vue.use(VueSocialSharing);
42
+ Vue.use(VueSocialSharing, { networks: { copy: "" } });
43
43
 
44
44
  import "./extensions/string.js";
45
45
  import "./extensions/array.js";
package/keys.js CHANGED
File without changes
package/nav/dialog.vue CHANGED
@@ -83,7 +83,7 @@ export default {
83
83
  this.message = "";
84
84
  this.body = response.body;
85
85
  this.footer = response.footer;
86
- this.showClose = false;
86
+ this.showClose = this.spec.showClose || false;
87
87
  });
88
88
  } else {
89
89
  this.title = this.spec.title;
package/nav/drawer.vue CHANGED
@@ -50,6 +50,75 @@
50
50
  import NavDrawerButton from "./drawerButton";
51
51
  import NavDrawerLabel from "./drawerLabel";
52
52
 
53
+ const activeClass = (element, action) => {
54
+ let indicator = element.querySelector(".indicator");
55
+ if (indicator) {
56
+ indicator.classList[action]("active");
57
+ }
58
+ let icon = element.querySelector(".v-list-item__action");
59
+ if (icon) {
60
+ icon.classList[action]("active");
61
+ }
62
+ };
63
+
64
+ const comparePathname = (hrefPathname, locationPathname) => {
65
+ let value = 0;
66
+ const loc = locationPathname.split("/").filter(v => v);
67
+ const hr = hrefPathname.split("/").filter(v => v);
68
+
69
+ if (loc.length == hr.length) value = value + 1;
70
+
71
+ loc.forEach((route, index) => {
72
+ if (!hr[index]) {
73
+ value = value + 0;
74
+ } else if (hr[index] == route) {
75
+ value = value + 1;
76
+ } else if (hr[index] != route) {
77
+ value = value - 2;
78
+ }
79
+ });
80
+
81
+ return value;
82
+ };
83
+
84
+ const navigationMap = (element, locationPathname) => {
85
+ return Array.from(element.querySelectorAll(".nav-item")).reduce(
86
+ (prev, curr) => {
87
+ let a = curr.querySelector("a");
88
+ if (a) {
89
+ let obj = {};
90
+ obj[new URL(a.href).pathname] = {
91
+ element: curr,
92
+ matchValue: comparePathname(
93
+ new URL(a.href).pathname,
94
+ locationPathname
95
+ )
96
+ };
97
+ return Object.assign(prev, obj);
98
+ } else {
99
+ return prev;
100
+ }
101
+ },
102
+ {}
103
+ );
104
+ };
105
+
106
+ const getActiveNav = navigationMap => {
107
+ let currentRoute = "";
108
+ let maxMatchValue = null;
109
+
110
+ for (let route in navigationMap) {
111
+ if (!maxMatchValue) {
112
+ maxMatchValue = navigationMap[route].matchValue;
113
+ currentRoute = route;
114
+ } else if (maxMatchValue < navigationMap[route].matchValue) {
115
+ maxMatchValue = navigationMap[route].matchValue;
116
+ currentRoute = route;
117
+ }
118
+ }
119
+ return navigationMap[currentRoute];
120
+ };
121
+
53
122
  export default {
54
123
  components: {
55
124
  "nav-drawerButton": NavDrawerButton,
@@ -98,6 +167,8 @@ export default {
98
167
  },
99
168
  methods: {
100
169
  $ready() {
170
+ this.updateNavigationStyle(window.location);
171
+
101
172
  // this.$el.addEventListener('drawers/clickButton', () => { this.updateState(false) }, false)
102
173
  this.$el.addEventListener("drawers/clickButton", () => {
103
174
  if (!this.permanent) {
@@ -113,6 +184,15 @@ export default {
113
184
  this.cssClasses.includes("mini") ||
114
185
  (this.cssClasses.includes("mini-lg-and-above") && this.lgAndAbove)
115
186
  );
187
+ },
188
+ updateNavigationStyle(urlObject) {
189
+ const navMap = navigationMap(this.$el, urlObject.pathname);
190
+ // remove all active class
191
+ for (let route in navMap) {
192
+ activeClass(navMap[route].element, "remove");
193
+ }
194
+ // add active class to nav
195
+ activeClass(getActiveNav(navMap).element, "add");
116
196
  }
117
197
  }
118
198
  };
@@ -122,12 +202,13 @@ export default {
122
202
  .nav-item {
123
203
  position: relative;
124
204
  }
125
- .nav-item:hover .indicator {
205
+ .nav-item:hover .indicator,
206
+ .nav-item .indicator.active {
126
207
  display: flex;
127
208
  position: absolute;
128
209
  width: 3px;
129
210
  height: 65%;
130
- margin: 10px 0;
211
+ margin: 8px 0;
131
212
  justify-content: center;
132
213
  align-items: center;
133
214
  background-color: white;
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "0.7.1",
3
+ "version": "0.8.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
File without changes
package/styles/test.sass CHANGED
File without changes
package/styles/test.scss CHANGED
File without changes
File without changes
File without changes
package/utils/dom.js CHANGED
File without changes
package/utils/http.js CHANGED
@@ -67,6 +67,7 @@ export default class {
67
67
  } else {
68
68
  window.location = Utils.url.htmlUrl(properties["url"]);
69
69
  }
70
+ // bus.$emit("glibWebHttpLoad", new URL(Utils.url.htmlUrl(properties["url"])));
70
71
  }
71
72
 
72
73
  static analyticsHeaders(component) {
package/utils/public.js CHANGED
File without changes
package/utils/settings.js CHANGED
File without changes
package/utils/storage.js CHANGED
File without changes
package/utils/url.js CHANGED
File without changes