glib-web 4.29.1 → 4.30.1

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.
@@ -1,5 +1,7 @@
1
+ import { nextTick } from "vue";
1
2
  import Action from "../../action";
2
3
  import { executeGlibEvent } from "../../store";
4
+ import { showSkeletionViewIfExist } from "./skeletionView";
3
5
 
4
6
  export default class {
5
7
  execute(properties, component) {
@@ -9,6 +11,11 @@ export default class {
9
11
 
10
12
  Utils.history.destroy();
11
13
 
14
+ nextTick(() => {
15
+ showSkeletionViewIfExist(properties);
16
+ });
17
+
18
+
12
19
  // Don't use nextTick so that there is no visible flicker.
13
20
  Utils.http.load(properties, component, true, true);
14
21
 
@@ -1,4 +1,6 @@
1
+ import { nextTick } from "vue";
1
2
  import { executeGlibEvent } from "../../store";
3
+ import { showSkeletionViewIfExist } from "./skeletionView";
2
4
 
3
5
  export default class {
4
6
  execute(properties, component) {
@@ -8,6 +10,11 @@ export default class {
8
10
 
9
11
  Utils.history.backWithoutRender();
10
12
 
13
+ nextTick(() => {
14
+ showSkeletionViewIfExist(properties);
15
+ });
16
+
17
+
11
18
  // Don't use nextTick so that there is no visible flicker.
12
19
  Utils.http.load(properties, component, true, true);
13
20
  }
@@ -1,12 +1,14 @@
1
- import { executeGlibEvent } from "../../store";
1
+ import { executeGlibEvent, vueApp } from "../../store";
2
+ import { showSkeletionViewIfExist } from "./skeletionView";
2
3
 
3
4
  export default class {
4
5
  execute(properties, component) {
5
-
6
6
  if (!executeGlibEvent('onbeforewindowsopen')) {
7
7
  return;
8
8
  }
9
9
 
10
+ showSkeletionViewIfExist(properties);
11
+
10
12
  Utils.http.load(properties, component, true);
11
13
  }
12
14
  }
@@ -0,0 +1,15 @@
1
+ import { vueApp } from "../../store";
2
+
3
+ export function showSkeletionViewIfExist(spec) {
4
+ const { loaderViews } = spec;
5
+
6
+ if (loaderViews) {
7
+ vueApp.loading = true;
8
+ vueApp.loaderViews = loaderViews.slice(0);
9
+ }
10
+ }
11
+
12
+ export function hideSkeletonView() {
13
+ vueApp.loading = false;
14
+ vueApp.loaderViews = [];
15
+ }
package/app.vue CHANGED
@@ -8,7 +8,7 @@
8
8
  </v-progress-linear>
9
9
 
10
10
  <v-main :style="`height: ${mainHeight}px;`">
11
- <v-container :fluid="page.template == 'fullWidth'" :class="containerClasses">
11
+ <v-container v-show="!vueApp.loading" :fluid="page.template == 'fullWidth'" :class="containerClasses">
12
12
  <div class="pages-header" :key="`page-header-${page.key}`">
13
13
  <panels-responsive :spec="header" />
14
14
  </div>
@@ -24,8 +24,14 @@
24
24
  </div>
25
25
  </v-container>
26
26
 
27
+ <v-container v-if="vueApp.loading" :fluid="page.template == 'fullWidth'" :class="containerClasses">
28
+ <glib-component v-for="(loaderView, index) in vueApp.loaderViews" :key="index"
29
+ :spec="loaderView"></glib-component>
30
+ </v-container>>
27
31
  </v-main>
32
+
28
33
  </component>
34
+
29
35
  <div :id="tooltipId">
30
36
  <panels-responsive :spec="vueApp.tooltipSpec"></panels-responsive>
31
37
  </div>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div :style="$styles()" :class="$classes()" v-if="loadIf">
3
- <div id="editor" ref="editor"></div>
3
+ <div ref="editor"></div>
4
4
  <input type="hidden" :name="fieldName" :value="producedValue" />
5
5
  <template v-if="Object.keys(files).length > 0">
6
6
  <input type="hidden" v-for="(file, index) in files" :name="spec.imageUploader.name" :value="file.signedId"
@@ -237,7 +237,7 @@ export default defineComponent({
237
237
  };
238
238
  }
239
239
  onMounted(() => {
240
- quill = new Quill('#editor', {
240
+ quill = new Quill(editor.value, {
241
241
  readOnly: props.spec.readOnly,
242
242
  placeholder: props.spec.placeholder,
243
243
  theme: 'snow',
@@ -6,14 +6,24 @@
6
6
  const props = defineProps(['spec']);
7
7
  import textArea from "./skeletons/textArea.vue";
8
8
  import commentList from "./skeletons/commentList.vue";
9
- import { computed } from "vue";
9
+ import { computed, getCurrentInstance } from "vue";
10
10
 
11
11
  const template = computed(() => {
12
+ let result;
12
13
  const comps = {
13
14
  textArea,
14
15
  commentList
15
16
  };
16
17
 
17
- return comps[props.spec.template];
18
+ result = comps[props.spec.template];
19
+
20
+ if (result) return result;
21
+
22
+ const name = `template-${props.spec.template.replace("/", "-")}`;
23
+ result = getCurrentInstance().appContext.components[name];
24
+
25
+ if (result) return result;
26
+
27
+ return "template-unsupported";
18
28
  });
19
29
  </script>
package/index.js CHANGED
@@ -56,6 +56,7 @@ import CommonMessage from "./components/_message.vue";
56
56
  import CommonDropdownMenu from "./components/_dropdownMenu.vue";
57
57
  import CommonResponsive from "./components/responsive.vue";
58
58
  import CommonTemplateMenu from "./templates/_menu.vue";
59
+ import BigProgressCircle from "./templates/bigProgressCircle.vue";
59
60
  import RichButton from "./components/button.vue";
60
61
  Vue.component("panels-vertical", VerticalPanel);
61
62
  Vue.component("panels-responsive", ResponsivePanel);
@@ -69,6 +70,7 @@ Vue.component("common-message", CommonMessage);
69
70
  Vue.component("common-dropdownMenu", CommonDropdownMenu);
70
71
  Vue.component("common-responsive", CommonResponsive);
71
72
  Vue.component("templates-menu", CommonTemplateMenu);
73
+ Vue.component("template-bigProgressCircle", BigProgressCircle);
72
74
 
73
75
  Vue.component("glib-button", RichButton);
74
76
  Vue.component("glib-component", Component);
package/nav/dialog.vue CHANGED
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <v-dialog :class="spec.styleClass" :model-value="model" :width="spec.width || 600" :dark="false"
3
3
  :fullscreen="fullscreen" :sm-and-down="false" :persistent="true" @click:outside="clickOutside">
4
- <v-card v-if="!loading || !spec.loaderViews" :style="hamburgerStyles" class="dialog-hamburger" :key="dialogKey">
4
+ <v-card v-show="!loading || !spec.loaderViews" :style="hamburgerStyles" class="dialog-hamburger" :key="dialogKey">
5
5
 
6
6
  <panels-responsive v-if="header" :spec="header" />
7
7
  <div :class="`dialog-title ${title ? '' : 'dialog-absolute'}`">
@@ -36,7 +36,6 @@
36
36
  </v-btn>
37
37
  </v-card-actions>
38
38
  </v-card>
39
-
40
39
  <template v-if="loading && spec.loaderViews">
41
40
  <glib-component v-for="(loaderView, index) in spec.loaderViews" :key="index" :spec="loaderView"></glib-component>
42
41
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "4.29.1",
3
+ "version": "4.30.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/store.js CHANGED
@@ -20,7 +20,9 @@ export const vueApp = reactive({
20
20
  sheet: { show: false, placement: 'right', spec: {} },
21
21
  uploader: {},
22
22
  confirmationDialog: {},
23
- mobile: undefined
23
+ mobile: undefined,
24
+ loading: false,
25
+ loaderViews: []
24
26
  });
25
27
 
26
28
  export const jsonView = reactive({ page: window.__page, source: 'server' }); // source can be 'server' or 'history'
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <div class="centered">
3
+ <v-progress-circular indeterminate width="8" size="100" color="primary"></v-progress-circular>
4
+ </div>
5
+ </template>
6
+
7
+ <style lang="scss" scoped>
8
+ .centered {
9
+ display: flex;
10
+ justify-content: center;
11
+ align-items: center;
12
+ width: 100%;
13
+ height: calc(100vh - 48px);
14
+ }
15
+ </style>
package/utils/format.js CHANGED
@@ -5,6 +5,8 @@ import TurndownService from "turndown";
5
5
  export default class {
6
6
  static markdownForEditor(text) {
7
7
 
8
+ if (!text) return '';
9
+
8
10
  const renderer = {
9
11
  listitem(text, task, checked) {
10
12
  return `<li>${text.replace(/\<p\>|\<\/p\>/g, "")}</li>`;
package/utils/http.js CHANGED
@@ -3,6 +3,7 @@ import Action from "../action";
3
3
  import { nextTick } from 'vue';
4
4
  import { ctx, dialogs, jsonView, vueApp } from "../store";
5
5
  import Hash from "./hash";
6
+ import { hideSkeletonView } from "../actions/windows/skeletionView";
6
7
 
7
8
  const strandom = () => (Math.random() + 1).toString(36).substring(7) + Date.now().toString();
8
9
 
@@ -121,6 +122,7 @@ export default class {
121
122
  }
122
123
 
123
124
  this.forceComponentUpdate(() => {
125
+ hideSkeletonView();
124
126
  Utils.history.resetScroll();
125
127
 
126
128
  GLib.action.handleResponse(data, component, windowMode);