glib-web 3.3.0 → 3.4.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.
Files changed (117) hide show
  1. package/LICENSE +0 -0
  2. package/actions/auth/creditCard.js +0 -0
  3. package/actions/auth/restart.js +0 -0
  4. package/actions/commands/copy.js +0 -0
  5. package/actions/dialogs/alert.js +1 -0
  6. package/actions/dialogs/close.js +0 -0
  7. package/actions/dialogs/notification.js +0 -0
  8. package/actions/dialogs/oauth.js +0 -0
  9. package/actions/dialogs/open.js +0 -0
  10. package/actions/dialogs/options.js +0 -0
  11. package/actions/dialogs/reload.js +0 -0
  12. package/actions/dialogs/show.js +0 -0
  13. package/actions/http/delete.js +0 -0
  14. package/actions/http/get.js +1 -1
  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/runMultiple.js +0 -0
  19. package/actions/sheets/select.js +0 -0
  20. package/actions/snackbars/alert.js +0 -0
  21. package/actions/snackbars/select.js +0 -0
  22. package/actions/timeouts/set.js +0 -0
  23. package/actions/windows/close.js +0 -0
  24. package/actions/windows/closeAll.js +0 -0
  25. package/actions/windows/open.js +0 -0
  26. package/actions/windows/openWeb.js +0 -0
  27. package/actions/windows/print.js +0 -0
  28. package/actions/windows/reload.js +0 -0
  29. package/components/_message.vue +0 -0
  30. package/components/calendar.vue +0 -0
  31. package/components/component.vue +4 -4
  32. package/components/composable/conditional.js +12 -0
  33. package/components/fab.vue +0 -0
  34. package/components/fields/_otp.vue +2 -1
  35. package/components/fields/country/countries.js +0 -0
  36. package/components/fields/country/regions.js +0 -0
  37. package/components/fields/creditCard.vue +0 -0
  38. package/components/fields/googlePlace.vue +0 -0
  39. package/components/fields/location.vue +20 -52
  40. package/components/fields/phone/countries.js +0 -0
  41. package/components/fields/phone/sprite.css +0 -0
  42. package/components/fields/stripeToken.vue +0 -0
  43. package/components/fields/textarea.vue +3 -4
  44. package/components/h1.vue +0 -0
  45. package/components/h2.vue +0 -0
  46. package/components/h3.vue +0 -0
  47. package/components/h5.vue +0 -0
  48. package/components/h6.vue +0 -0
  49. package/components/hr.vue +0 -0
  50. package/components/html.vue +0 -0
  51. package/components/icon.vue +0 -0
  52. package/components/mixins/chart/annotation.js +0 -0
  53. package/components/mixins/chart/tooltip.js +0 -0
  54. package/components/mixins/dataset.js +0 -0
  55. package/components/mixins/events.js +11 -3
  56. package/components/mixins/extension.js +0 -0
  57. package/components/mixins/longClick.js +0 -0
  58. package/components/mixins/scrolling.js +0 -0
  59. package/components/mixins/styles.js +26 -51
  60. package/components/mixins/table/export.js +0 -0
  61. package/components/mixins/table/import.js +0 -0
  62. package/components/mixins/text.js +0 -0
  63. package/components/multimedia/video.vue +0 -0
  64. package/components/panels/carousel.vue +0 -0
  65. package/components/panels/web.vue +0 -0
  66. package/components/spacer.vue +0 -0
  67. package/index.js +24 -17
  68. package/keys.js +0 -0
  69. package/nav/dialog.vue +18 -18
  70. package/nav/drawer.vue +8 -2
  71. package/nav/snackbar.vue +16 -29
  72. package/package.json +3 -4
  73. package/static/plugins/alignment/alignment.js +0 -0
  74. package/static/plugins/alignment/alignment.min.js +0 -0
  75. package/static/plugins/beyondgrammar/beyondgrammar.js +0 -0
  76. package/static/plugins/beyondgrammar/beyondgrammar.min.js +0 -0
  77. package/static/plugins/blockcode/blockcode.js +0 -0
  78. package/static/plugins/blockcode/blockcode.min.js +0 -0
  79. package/static/plugins/clips/clips.js +0 -0
  80. package/static/plugins/clips/clips.min.js +0 -0
  81. package/static/plugins/counter/counter.js +0 -0
  82. package/static/plugins/counter/counter.min.js +0 -0
  83. package/static/plugins/definedlinks/definedlinks.js +0 -0
  84. package/static/plugins/definedlinks/definedlinks.min.js +0 -0
  85. package/static/plugins/handle/handle.js +0 -0
  86. package/static/plugins/handle/handle.min.js +0 -0
  87. package/static/plugins/icons/icons.js +0 -0
  88. package/static/plugins/icons/icons.min.js +0 -0
  89. package/static/plugins/imageposition/imageposition.js +0 -0
  90. package/static/plugins/imageposition/imageposition.min.js +0 -0
  91. package/static/plugins/inlineformat/inlineformat.js +0 -0
  92. package/static/plugins/inlineformat/inlineformat.min.js +0 -0
  93. package/static/plugins/removeformat/removeformat.js +0 -0
  94. package/static/plugins/removeformat/removeformat.min.js +0 -0
  95. package/static/plugins/selector/selector.js +0 -0
  96. package/static/plugins/selector/selector.min.js +0 -0
  97. package/static/plugins/specialchars/specialchars.js +0 -0
  98. package/static/plugins/specialchars/specialchars.min.js +0 -0
  99. package/static/plugins/textdirection/textdirection.js +0 -0
  100. package/static/plugins/textdirection/textdirection.min.js +0 -0
  101. package/static/plugins/textexpander/textexpander.js +0 -0
  102. package/static/plugins/textexpander/textexpander.min.js +0 -0
  103. package/static/plugins/underline/underline.js +0 -0
  104. package/static/plugins/underline/underline.min.js +0 -0
  105. package/static/redactorx.css +0 -0
  106. package/static/redactorx.min.css +0 -0
  107. package/static/redactorx.min.js +0 -0
  108. package/static/redactorx.usm.min.js +0 -0
  109. package/styles/test.sass +0 -0
  110. package/styles/test.scss +0 -0
  111. package/templates/_menu.vue +0 -0
  112. package/templates/unsupported.vue +0 -0
  113. package/utils/dom.js +0 -0
  114. package/utils/helper.js +0 -0
  115. package/utils/http.js +12 -12
  116. package/utils/launch.js +30 -29
  117. package/utils/type.js +0 -0
package/nav/dialog.vue CHANGED
@@ -4,17 +4,18 @@
4
4
  <v-card :style="hamburgerStyles" class="hamburger">
5
5
 
6
6
  <panels-responsive v-if="header" :spec="header" />
7
- <div class="dialog-title flex flex-wrap justify-between" v-if="title">
8
- <div class="theme--light v-subheader">
7
+ <div class="dialog-title d-flex flex-wrap justify-space-between align-center" style="width: 100%; height: 100%;">
8
+ <h3 v-if="title">
9
9
  {{ title }}
10
- </div>
11
- </div>
10
+ </h3>
12
11
 
13
- <div class="dialogs-body relative">
14
- <v-btn size="small" v-if="!disableCloseButton" text icon @click="close" class="mr-3 mt-2 close-btn"
12
+ <v-btn size="small" v-if="!disableCloseButton" text icon @click="close" class="mr-4 mt-4 close-btn"
15
13
  style="z-index: 999;" variant="flat">
16
14
  <v-icon>close</v-icon>
17
15
  </v-btn>
16
+ </div>
17
+
18
+ <div class="dialogs-body relative">
18
19
  <component :is="containerComponent" :spec="formSpec">
19
20
  <div v-if="message" class="dialog-message">
20
21
  <common-message :spec="{ message: message }" />
@@ -94,14 +95,13 @@ export default {
94
95
  return null;
95
96
  }
96
97
  },
97
- // watch: {
98
- // model: function (val, oldVal) {
99
- // if (!val) {
100
- // // this.$destroy();
101
- // this.$.appContext.app.unmount()
102
- // }
103
- // },
104
- // },
98
+ watch: {
99
+ model: function (val, oldVal) {
100
+ if (!val) {
101
+ this.stack.remove(this);
102
+ }
103
+ },
104
+ },
105
105
  methods: {
106
106
  $mounted() {
107
107
  window.addEventListener(
@@ -122,10 +122,10 @@ export default {
122
122
  });
123
123
  },
124
124
  // TODO: This doesn't get called anymore after Vue3 upgrade.
125
- $tearDown() {
126
- console.debug("Dialog destroyed");
127
- this.stack.remove(this);
128
- },
125
+ // $tearDown() {
126
+ // console.debug("Dialog destroyed");
127
+ // this.stack.remove(this);
128
+ // },
129
129
  close() {
130
130
  if (Utils.http.proceedEvenWhenDirty()) {
131
131
  this.model = false;
package/nav/drawer.vue CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  <div :class="cssClasses" :style="style">
6
6
  <v-navigation-drawer v-model="state" app :dark="cssClasses.includes('dark') || null"
7
- :permanent="cssClasses.includes('permanent')" :expand-on-hover="expandOnHover()" v-model:mini-variant="shrunk"
8
- @input="updateState">
7
+ :permanent="mdAndUp || cssClasses.includes('permanent')" :expand-on-hover="expandOnHover()"
8
+ v-model:mini-variant="shrunk" @input="updateState">
9
9
 
10
10
  <template v-if="spec.header">
11
11
  <panels-responsive :spec="spec.header" />
@@ -39,6 +39,7 @@
39
39
  import NavDrawerButton from "./drawerButton.vue";
40
40
  import NavDrawerLabel from "./drawerLabel.vue";
41
41
  import bus from "../utils/eventBus";
42
+ import { useDisplay } from "vuetify";
42
43
 
43
44
  export default {
44
45
  components: {
@@ -51,6 +52,11 @@ export default {
51
52
  trigger: { type: [Object, Date], default: null },
52
53
  permanent: { type: Boolean, required: true },
53
54
  },
55
+ setup() {
56
+ const { mdAndUp } = useDisplay();
57
+
58
+ return { mdAndUp };
59
+ },
54
60
  data: function () {
55
61
  return {
56
62
  // Using null as the starting value for its v-model will initialize the drawer as closed on mobile and as open on desktop.
package/nav/snackbar.vue CHANGED
@@ -1,22 +1,20 @@
1
1
  <template>
2
- <v-snackbar v-model="show" :location="spec.location" :color="color" :timeout="spec.timeout">
2
+ <v-snackbar :vertical="vertical" v-model="show" :location="spec.location" :color="color" :timeout="spec.timeout"
3
+ :variant="variant">
3
4
  <common-message :spec="spec" />
4
5
 
5
- <v-btn v-for="(button, index) in spec.buttons" variant="text" @click="click(button, $event)">
6
- <span style="color: whitesmoke">{{ button.text }}</span>
7
- </v-btn>
6
+ <template v-slot:actions v-if="spec.buttons">
7
+ <v-btn v-for="(button, index) in spec.buttons" :key="index" :color="color" :variant="variant"
8
+ @click="click(button, $event)">
9
+ <span :class="`text-${color}`">{{ button.text }}</span>
10
+ </v-btn>
11
+ </template>
8
12
 
9
- <!-- <v-btn
10
- flat
11
- @click="close"
12
- >
13
- Close
14
- </v-btn> -->
15
13
  </v-snackbar>
16
14
  </template>
17
15
 
18
16
  <script>
19
- import { colors } from '../utils/constant';
17
+ import { determineColor, determineVariant } from '../utils/constant';
20
18
 
21
19
  export default {
22
20
  props: {
@@ -25,28 +23,17 @@ export default {
25
23
  data: function () {
26
24
  return {
27
25
  show: true,
28
- color: null,
29
- indicator: false
26
+ color: 'primary',
27
+ variant: 'outlined',
28
+ indicator: false,
29
+ vertical: false
30
30
  };
31
31
  },
32
- // watch: {
33
- // model: function (val, oldVal) {
34
- // if (!val) {
35
- // // this.$destroy();
36
- // this.$.appContext.app.unmount()
37
- // }
38
- // },
39
- // },
40
32
  methods: {
41
33
  $ready() {
42
- const vm = this;
43
- this.$type.ifArray(this.spec.styleClasses, val => {
44
- colors.forEach(color => {
45
- if (val.includes(color)) {
46
- vm.color = color;
47
- }
48
- });
49
- });
34
+ this.variant = determineVariant(this.spec.styleClasses, 'outlined');
35
+ this.color = determineColor(this.spec.styleClasses, 'primary');
36
+ this.vertical = [this.spec.styleClasses].flat().includes('vertical');
50
37
  },
51
38
  click: function (spec) {
52
39
  const onClick = spec["onClick"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "3.3.0",
3
+ "version": "3.4.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,6 +10,7 @@
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "@floating-ui/dom": "^1.2.8",
13
+ "@gmap-vue/v3": "^1.0.3",
13
14
  "@rails/actioncable": "^6.0.0",
14
15
  "@rails/activestorage": "^6.0.0-alpha",
15
16
  "@vueup/vue-quill": "^1.2.0",
@@ -30,8 +31,6 @@
30
31
  "vue": "3.2.47",
31
32
  "vue-chartkick": "^1.1.0",
32
33
  "vue-social-sharing": "^4.0.0-alpha4",
33
- "vue2-gmap-custom-marker": "^6.1.1",
34
- "vue2-google-maps": "^0.10.6",
35
34
  "vuedraggable": "^4.1.0",
36
35
  "vuetify": "^3.3.2"
37
36
  },
@@ -42,4 +41,4 @@
42
41
  "prettier": "^1.18.2",
43
42
  "typescript": "^4.9.5"
44
43
  }
45
- }
44
+ }
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/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/helper.js CHANGED
File without changes
package/utils/http.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import Type from "./type";
2
2
  import Action from "../action";
3
- import { nextTick } from 'vue'
3
+ import { nextTick } from 'vue';
4
4
  import { vueApp } from "../store";
5
5
 
6
6
  let loading = false;
@@ -89,7 +89,7 @@ export default class {
89
89
  this.forceComponentUpdate(() => {
90
90
  Utils.history.resetScroll();
91
91
 
92
- vueApp.page = data
92
+ vueApp.page = data;
93
93
 
94
94
  Action.execute(properties["onOpen"], component);
95
95
  });
@@ -143,7 +143,7 @@ export default class {
143
143
 
144
144
  Utils.http.execute(data, "GET", component, (page, response) => {
145
145
  Utils.http.forceComponentUpdate(() => {
146
- vueApp.page = page
146
+ vueApp.page = page;
147
147
  const redirectUrl = Utils.url.htmlUrl(response.url);
148
148
  Utils.history.updatePage(vueApp.page, redirectUrl);
149
149
 
@@ -244,27 +244,27 @@ export default class {
244
244
  setTimeout(() => {
245
245
  if (loading) {
246
246
  loading = false;
247
- vueApp.indicator = true
247
+ vueApp.indicator = true;
248
248
  }
249
249
  }, 200);
250
250
  }
251
251
 
252
252
  static _hideIndicator() {
253
253
  loading = false;
254
- vueApp.indicator = false
254
+ vueApp.indicator = false;
255
255
  }
256
256
 
257
257
  // See generic.js
258
258
  static forceComponentUpdate(handler) {
259
259
  // GLib.component.clearRegistry();
260
- vueApp.isStale = true
261
- vueApp.isFormSubmitted = false
262
- vueApp.isFormDirty = false
260
+ vueApp.isStale = true;
261
+ vueApp.isFormSubmitted = false;
262
+ vueApp.isFormDirty = false;
263
263
  handler();
264
264
 
265
265
  // Queue the execution so the first isStale has time to resets state before handler gets executed
266
266
  nextTick(() => {
267
- vueApp.isStale = false
267
+ vueApp.isStale = false;
268
268
  });
269
269
  }
270
270
 
@@ -275,16 +275,16 @@ export default class {
275
275
  }
276
276
 
277
277
  static clearDirtyState() {
278
- vueApp.isFormDirty = false
278
+ vueApp.isFormDirty = false;
279
279
  }
280
280
 
281
281
  static notifyFormSubmitted() {
282
- vueApp.isFormSubmitted = true
282
+ vueApp.isFormSubmitted = true;
283
283
  }
284
284
 
285
285
  // `context` can be either window or dialog.
286
286
  static proceedEvenWhenDirty() {
287
- const dirtyContext = vueApp
287
+ const dirtyContext = vueApp;
288
288
  // Don't prompt if this is a result of form submission
289
289
  if (
290
290
  dirtyContext.isFormDirty &&
package/utils/launch.js CHANGED
@@ -3,7 +3,7 @@ import Dialog from "../nav/dialog.vue";
3
3
  import Sheet from "../nav/sheet.vue";
4
4
  import Snackbar from "../nav/snackbar.vue";
5
5
  import Popover from "../components/popover.vue";
6
- import { computePosition, flip, offset } from '@floating-ui/dom'
6
+ import { computePosition, flip, offset } from '@floating-ui/dom';
7
7
  import bus from "./eventBus";
8
8
 
9
9
  import { createApp, h } from "vue";
@@ -31,17 +31,17 @@ class LaunchPopover {
31
31
  const instance = createApp(
32
32
  {
33
33
  render: function () {
34
- return h(Popover, { spec: properties })
34
+ return h(Popover, { spec: properties });
35
35
  }
36
36
  }
37
- )
38
- Object.assign(instance._context, Vue._context)
37
+ );
38
+ Object.assign(instance._context, Vue._context);
39
39
 
40
40
  if (component) {
41
- const placeholder = document.createElement('div')
41
+ const placeholder = document.createElement('div');
42
42
 
43
43
  // const pageBody = Utils.launch.dialog.closestBody(component) || Utils.history._pageBody;
44
- const dialogBody = Utils.launch.dialog.closestBody(component)
44
+ const dialogBody = Utils.launch.dialog.closestBody(component);
45
45
  if (dialogBody) {
46
46
  // Put the popover on the dialog so that clicking it doesn't close a non-persistent dialog.
47
47
  dialogBody.appendChild(placeholder);
@@ -53,11 +53,11 @@ class LaunchPopover {
53
53
 
54
54
  instance.mount(placeholder);
55
55
 
56
- const reference = component.$el instanceof HTMLElement ? component.$el : component.$el.nextElementSibling
56
+ const reference = component.$el instanceof HTMLElement ? component.$el : component.$el.nextElementSibling;
57
57
 
58
- const floating = placeholder
59
- const placement = properties.placement || 'right'
60
- const offsetSize = properties.offset || 8
58
+ const floating = placeholder;
59
+ const placement = properties.placement || 'right';
60
+ const offsetSize = properties.offset || 8;
61
61
 
62
62
  // These properties need to be set to get an accurate calculation. See https://floating-ui.com/docs/computeposition
63
63
  Object.assign(placeholder.style, { position: 'absolute', display: 'block', top: 0, left: 0 });
@@ -65,7 +65,7 @@ class LaunchPopover {
65
65
  computePosition(reference, floating, { placement: placement, middleware: [flip(), offset(offsetSize)] })
66
66
  .then(({ x, y }) => {
67
67
  Object.assign(placeholder.style, { top: `${y}px`, left: `${x}px`, zIndex: 1200 });
68
- })
68
+ });
69
69
  } else {
70
70
  console.error("A popover has to be displayed in a component");
71
71
  }
@@ -74,13 +74,13 @@ class LaunchPopover {
74
74
  }
75
75
 
76
76
  static close(properties) {
77
- bus.$emit(`popover/close-${properties.key}`, properties)
77
+ bus.$emit(`popover/close-${properties.key}`, properties);
78
78
  }
79
79
  }
80
80
 
81
81
  class LaunchDialog {
82
82
  static closestBody(component) {
83
- const element = component.$el instanceof HTMLElement ? component.$el : component.$el.nextElementSibling
83
+ const element = component.$el instanceof HTMLElement ? component.$el : component.$el.nextElementSibling;
84
84
  const dialog = element.closest(".v-dialog");
85
85
  if (dialog) {
86
86
  return dialog.querySelector(".dialogs-body");
@@ -110,20 +110,20 @@ class LaunchDialog {
110
110
  const props = {
111
111
  spec: properties,
112
112
  stack: this.stack
113
- }
113
+ };
114
114
 
115
115
  const instance = createApp(
116
116
  {
117
117
  render: function () {
118
- return h(Dialog, props)
118
+ return h(Dialog, props);
119
119
  }
120
120
  }
121
- )
122
- Object.assign(instance._context, Vue._context)
121
+ );
122
+ Object.assign(instance._context, Vue._context);
123
123
 
124
124
  if (component) {
125
- const placeholder = document.createElement('div')
126
- document.body.appendChild(placeholder)
125
+ const placeholder = document.createElement('div');
126
+ document.body.appendChild(placeholder);
127
127
  instance.mount(placeholder);
128
128
  } else {
129
129
  console.error("A dialog has to be displayed in a component");
@@ -160,6 +160,7 @@ class LaunchDialog {
160
160
  message: message
161
161
  };
162
162
  const spec = Object.assign({}, properties, {
163
+ disableCloseButton: true,
163
164
  buttons: [
164
165
  {
165
166
  text: "OK",
@@ -176,15 +177,15 @@ class LaunchSheet {
176
177
  const instance = createApp(
177
178
  {
178
179
  render: function () {
179
- return h(Sheet, { spec: properties })
180
+ return h(Sheet, { spec: properties });
180
181
  }
181
182
  }
182
- )
183
- Object.assign(instance._context, Vue._context)
183
+ );
184
+ Object.assign(instance._context, Vue._context);
184
185
 
185
186
  if (component) {
186
- const placeholder = document.createElement('div')
187
- document.body.appendChild(placeholder)
187
+ const placeholder = document.createElement('div');
188
+ document.body.appendChild(placeholder);
188
189
  instance.mount(placeholder);
189
190
  } else {
190
191
  console.error("A sheet has to be displayed in a component");
@@ -216,15 +217,15 @@ class LaunchSnackbar {
216
217
  const instance = createApp(
217
218
  {
218
219
  render: function () {
219
- return h(Snackbar, { spec: properties })
220
+ return h(Snackbar, { spec: properties });
220
221
  }
221
222
  }
222
- )
223
- Object.assign(instance._context, Vue._context)
223
+ );
224
+ Object.assign(instance._context, Vue._context);
224
225
 
225
226
  if (component) {
226
- const placeholder = document.createElement('div')
227
- document.body.appendChild(placeholder)
227
+ const placeholder = document.createElement('div');
228
+ document.body.appendChild(placeholder);
228
229
  instance.mount(placeholder);
229
230
  instance.show = true;
230
231
  } else {
package/utils/type.js CHANGED
File without changes