glib-web 0.8.3 → 0.8.4

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 (49) 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/datetime.vue +0 -0
  11. package/components/fab.vue +0 -0
  12. package/components/fields/_select.vue +0 -0
  13. package/components/fields/country/countries.js +0 -0
  14. package/components/fields/country/field.vue +0 -0
  15. package/components/fields/country/regions.js +0 -0
  16. package/components/fields/datetime.vue +0 -0
  17. package/components/fields/dynamicSelect.vue +0 -0
  18. package/components/fields/select.vue +0 -0
  19. package/components/fields/timeZone.vue +0 -0
  20. package/components/hr.vue +0 -0
  21. package/components/html.vue +0 -0
  22. package/components/image.vue +0 -0
  23. package/components/mixins/list/autoload.js +51 -31
  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/list.vue +9 -3
  33. package/components/panels/split.vue +0 -0
  34. package/components/panels/ul.vue +0 -0
  35. package/extensions/array.js +4 -0
  36. package/keys.js +0 -0
  37. package/nav/drawer.vue +2 -1
  38. package/nav/drawerButton.vue +0 -0
  39. package/package.json +1 -1
  40. package/settings.json.example +0 -0
  41. package/styles/test.sass +0 -0
  42. package/styles/test.scss +0 -0
  43. package/templates/featured.vue +0 -0
  44. package/templates/unsupported.vue +0 -0
  45. package/utils/dom.js +0 -0
  46. package/utils/public.js +0 -0
  47. package/utils/settings.js +0 -0
  48. package/utils/storage.js +0 -0
  49. 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
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
@@ -9,13 +9,13 @@ export default {
9
9
  infiniteScroll: null
10
10
  };
11
11
  },
12
- computed: {
13
- bottomAnchorStyles() {
14
- return {
15
- display: this.infiniteScroll && this.nextPageUrl ? "block" : "none"
16
- };
17
- }
18
- },
12
+ // computed: {
13
+ // bottomAnchorStyles() {
14
+ // return {
15
+ // display: this.infiniteScroll && this.nextPageUrl ? "block" : "none"
16
+ // };
17
+ // }
18
+ // },
19
19
  methods: {
20
20
  enableInfiniteScrollIfApplicable: function() {
21
21
  this.$removeViewportChangeListeners(this.topScrollHandler);
@@ -24,23 +24,8 @@ export default {
24
24
  const prevPage = this.spec.prevPage || {};
25
25
  const nextPage = this.spec.nextPage || {};
26
26
 
27
- // const infiniteScroll = nextPage.autoload == "asNeeded";
28
- // // const infiniteScroll = nextPage.autoLoad;
29
- // if (infiniteScroll) {
30
- // const nextPageUrl = nextPage.url;
31
- // const onScrollToBottom = this.spec.onScrollToBottom;
32
- // if (nextPageUrl || onScrollToBottom) {
33
- // this._registerBottomScroll(nextPageUrl, onScrollToBottom);
34
- // }
35
-
36
- // const prevPageUrl = prevPage.url;
37
- // const onScrollToTop = this.spec.onScrollToTop;
38
- // if (prevPageUrl || onScrollToTop) {
39
- // this._registerTopScroll(prevPageUrl, onScrollToTop);
40
- // }
41
- // }
42
-
43
- this.infiniteScroll = nextPage.autoload == "asNeeded";
27
+ this.infiniteScroll =
28
+ nextPage.autoload == "asNeeded" || prevPage.autoload == "asNeeded";
44
29
  const onScrollToBottom = this.spec.onScrollToBottom;
45
30
  const onScrollToTop = this.spec.onScrollToTop;
46
31
 
@@ -49,16 +34,18 @@ export default {
49
34
  this.prevPageUrl = prevPage.url;
50
35
  }
51
36
 
52
- if (this.nextPageUrl || onScrollToBottom) {
53
- this._registerBottomScroll(onScrollToBottom);
54
- }
37
+ // Avoid executing the scroll actions on page load.
38
+ setTimeout(() => {
39
+ if (this.nextPageUrl || onScrollToBottom) {
40
+ this._registerBottomScroll(onScrollToBottom);
41
+ }
55
42
 
56
- if (this.prevPageUrl || onScrollToTop) {
57
- this._registerTopScroll(onScrollToTop);
58
- }
43
+ if (this.prevPageUrl || onScrollToTop) {
44
+ this._registerTopScroll(onScrollToTop);
45
+ }
46
+ }, 1000);
59
47
  },
60
48
  _registerTopScroll(onScrollToTop) {
61
- // TODO: Consider adding support for prevPageUrl
62
49
  this.topScrollHandler = this.$onVisibilityChange(
63
50
  this.$refs.topAnchor,
64
51
  (el, visible) => {
@@ -71,6 +58,39 @@ export default {
71
58
  this.$addViewportChangeListeners(this.topScrollHandler);
72
59
  },
73
60
  _handleTopScroll(onScrollToTop) {
61
+ if (this.prevPageUrl) {
62
+ this.request = Utils.http.execute(
63
+ { url: this.prevPageUrl },
64
+ "GET",
65
+ this,
66
+ response => {
67
+ const prevPage = response.prevPage;
68
+ if (this.$type.isObject(prevPage)) {
69
+ this.prevPageUrl = response.prevPage.url;
70
+ } else {
71
+ this.prevPageUrl = null;
72
+ }
73
+
74
+ for (const [
75
+ index,
76
+ prependedSection
77
+ ] of response.sections.entries()) {
78
+ const section = this.sections[index];
79
+
80
+ Utils.type.ifArray(prependedSection.rows, rows => {
81
+ for (const row of rows) {
82
+ section.rows.unshift(row);
83
+ }
84
+ });
85
+
86
+ // TODO: scroll back to where the position was before the prepending.
87
+ // https://stackoverflow.com/questions/54765451/preserve-scroll-position-on-dom-update-in-vue-js
88
+ }
89
+ Utils.history.updatePage();
90
+ }
91
+ );
92
+ }
93
+
74
94
  GLib.action.execute(onScrollToTop, this);
75
95
  },
76
96
  _registerBottomScroll(onScrollToBottom) {
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
@@ -5,7 +5,11 @@
5
5
  class="py-0"
6
6
  :style="genericStyles()"
7
7
  >
8
- <div ref="topAnchor"></div>
8
+ <div ref="topAnchor">
9
+ <div v-if="prevPageUrl" class="py-3 px-4">
10
+ Loading...
11
+ </div>
12
+ </div>
9
13
 
10
14
  <template v-for="(section, sectionIndex) in sections">
11
15
  <div :key="`section${sectionIndex}`">
@@ -46,8 +50,10 @@
46
50
  </div>
47
51
  </template>
48
52
 
49
- <div ref="bottomAnchor" class="py-3 px-4" :style="bottomAnchorStyles">
50
- Loading...
53
+ <div ref="bottomAnchor">
54
+ <div v-if="nextPageUrl" class="py-3 px-4">
55
+ Loading...
56
+ </div>
51
57
  </div>
52
58
  </v-list>
53
59
  </template>
File without changes
File without changes
@@ -7,6 +7,10 @@ Array.prototype.remove = function(element) {
7
7
  return false;
8
8
  };
9
9
 
10
+ Array.prototype.prepend = function(element) {
11
+ this.unshift(element);
12
+ };
13
+
10
14
  Array.prototype.clear = function() {
11
15
  this.length = 0;
12
16
  };
package/keys.js CHANGED
File without changes
package/nav/drawer.vue CHANGED
@@ -13,7 +13,7 @@
13
13
  :mini-variant.sync="mini"
14
14
  @input="updateState"
15
15
  >
16
- <template v-slot:prepend>
16
+ <template v-if="mini" v-slot:prepend>
17
17
  <v-list-item>
18
18
  <v-list-item-icon>
19
19
  <v-icon v-if="!mini">mdi-chevron-left</v-icon>
@@ -167,6 +167,7 @@ export default {
167
167
  },
168
168
  methods: {
169
169
  $ready() {
170
+ this.mini = !this.cssClasses.includes("maxi");
170
171
  this.updateNavigationStyle(window.location);
171
172
 
172
173
  // this.$el.addEventListener('drawers/clickButton', () => { this.updateState(false) }, false)
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
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/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