glib-web 2.4.1 → 3.0.0-beta1

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 (100) hide show
  1. package/LICENSE +0 -0
  2. package/action.js +6 -1
  3. package/actions/auth/restart.js +0 -0
  4. package/actions/commands/enqueue.js +17 -0
  5. package/actions/components/update.js +13 -14
  6. package/actions/dialogs/oauth.js +0 -0
  7. package/actions/dialogs/options.js +0 -0
  8. package/app.vue +25 -26
  9. package/components/_button.vue +21 -28
  10. package/components/_chip.vue +14 -19
  11. package/components/_dropdownMenu.vue +10 -23
  12. package/components/_icon.vue +5 -5
  13. package/components/_message.vue +0 -0
  14. package/components/_responsive.vue +7 -21
  15. package/components/avatar.vue +11 -15
  16. package/components/banners/alert.vue +2 -7
  17. package/components/banners/select.vue +18 -30
  18. package/components/button.vue +5 -5
  19. package/components/component.vue +97 -100
  20. package/components/datetime.vue +0 -0
  21. package/components/fab.vue +0 -0
  22. package/components/fields/_patternText.vue +5 -19
  23. package/components/fields/_select.vue +7 -28
  24. package/components/fields/autocomplete.vue +5 -21
  25. package/components/fields/check.vue +19 -11
  26. package/components/fields/country/countries.js +0 -0
  27. package/components/fields/country/field.vue +9 -27
  28. package/components/fields/country/regions.js +0 -0
  29. package/components/fields/date.vue +5 -5
  30. package/components/fields/datetime.vue +5 -5
  31. package/components/fields/dynamicSelect.vue +8 -29
  32. package/components/fields/newRichText.vue +66 -53
  33. package/components/fields/otpField.vue +90 -0
  34. package/components/fields/phone/field.vue +60 -78
  35. package/components/fields/radio.vue +16 -23
  36. package/components/fields/rating.vue +9 -16
  37. package/components/fields/richText.vue +8 -28
  38. package/components/fields/select.vue +10 -7
  39. package/components/fields/stripeExternalAccount.vue +10 -24
  40. package/components/fields/text.vue +24 -40
  41. package/components/fields/textarea.vue +13 -27
  42. package/components/fields/timeZone.vue +9 -6
  43. package/components/fields/timer.vue +3 -10
  44. package/components/hr.vue +0 -0
  45. package/components/html.vue +0 -0
  46. package/components/image.vue +13 -20
  47. package/components/map.vue +115 -29
  48. package/components/markdown.vue +15 -8
  49. package/components/mixins/events.js +17 -6
  50. package/components/mixins/longClick.js +0 -0
  51. package/components/mixins/scrolling.js +0 -0
  52. package/components/mixins/styles.js +18 -15
  53. package/components/mixins/table/export.js +0 -0
  54. package/components/mixins/table/import.js +0 -0
  55. package/components/p.vue +0 -0
  56. package/components/panels/column.vue +5 -5
  57. package/components/panels/custom.vue +15 -15
  58. package/components/panels/flow.vue +19 -13
  59. package/components/panels/form.vue +17 -28
  60. package/components/panels/grid.vue +15 -9
  61. package/components/panels/horizontal.vue +149 -18
  62. package/components/panels/list.vue +63 -70
  63. package/components/panels/responsive.vue +13 -33
  64. package/components/panels/split.vue +2 -2
  65. package/components/panels/table.vue +27 -61
  66. package/components/panels/timeline.vue +20 -30
  67. package/components/panels/vertical.vue +9 -14
  68. package/components/tabBar.vue +27 -19
  69. package/index.js +68 -72
  70. package/keys.js +0 -0
  71. package/nav/appbar.vue +4 -4
  72. package/nav/dialog.vue +24 -34
  73. package/nav/drawer.vue +39 -51
  74. package/nav/drawerButton.vue +5 -7
  75. package/nav/drawerLabel.vue +2 -3
  76. package/nav/sheet.vue +18 -24
  77. package/nav/snackbar.vue +16 -26
  78. package/package.json +10 -11
  79. package/plugins/driverCustomBehavior.js +1 -1
  80. package/plugins/updatableComponent.js +1 -7
  81. package/plugins/vuetify.js +27 -0
  82. package/settings.json.example +0 -0
  83. package/styles/test.sass +0 -0
  84. package/styles/test.scss +0 -0
  85. package/templates/comment.vue +42 -19
  86. package/templates/featured.vue +8 -9
  87. package/templates/thumbnail-old.vue +188 -0
  88. package/templates/thumbnail.vue +5 -188
  89. package/templates/unsupported.vue +0 -0
  90. package/tsconfig.json +1 -1
  91. package/utils/dom.js +0 -0
  92. package/utils/eventBus.js +9 -2
  93. package/utils/history.js +7 -4
  94. package/utils/http.js +7 -2
  95. package/utils/launch.js +43 -51
  96. package/utils/public.js +6 -0
  97. package/utils/queue.js +110 -0
  98. package/utils/settings.js +3 -1
  99. package/utils/storage.js +0 -0
  100. package/utils/url.js +0 -0
package/nav/snackbar.vue CHANGED
@@ -1,21 +1,10 @@
1
1
  <template>
2
- <v-snackbar
3
- v-model="show"
4
- :top="spec.verticalPosition == 'top'"
5
- :bottom="spec.verticalPosition == 'bottom'"
6
- :left="spec.horizontalPosition == 'left'"
7
- :right="spec.horizontalPosition == 'right'"
8
- :color="color"
9
- :timeout="spec.timeout"
10
- >
2
+ <v-snackbar v-model="show" :top="spec.verticalPosition == 'top'" :bottom="spec.verticalPosition == 'bottom'"
3
+ :left="spec.horizontalPosition == 'left'" :right="spec.horizontalPosition == 'right'" :color="color"
4
+ :timeout="spec.timeout">
11
5
  <common-message :spec="spec" />
12
6
 
13
- <v-btn
14
- v-for="(button, index) in spec.buttons"
15
- :key="index"
16
- text
17
- @click="click(button, $event)"
18
- >
7
+ <v-btn v-for="(button, index) in spec.buttons" :key="index" text @click="click(button, $event)">
19
8
  {{ button.text }}
20
9
  </v-btn>
21
10
 
@@ -34,32 +23,33 @@ export default {
34
23
  spec: { type: Object, required: true },
35
24
  vueApp: { type: Object, required: true }
36
25
  },
37
- data: function() {
26
+ data: function () {
38
27
  return {
39
- show: false,
28
+ show: true,
40
29
  color: null,
41
30
  indicator: false
42
31
  };
43
32
  },
44
- watch: {
45
- "vueApp.indicator": function(val, oldVal) {
46
- if (this.indicator) {
47
- this.show = val;
48
- }
49
- }
50
- },
33
+ // watch: {
34
+ // model: function (val, oldVal) {
35
+ // if (!val) {
36
+ // // this.$destroy();
37
+ // this.$.appContext.app.unmount()
38
+ // }
39
+ // },
40
+ // },
51
41
  methods: {
52
42
  $ready() {
53
43
  const vm = this;
54
44
  this.$type.ifArray(this.spec.styleClasses, val => {
55
45
  ["success", "info", "error", "warning"].forEach(color => {
56
46
  if (val.includes(color)) {
57
- vm.color = vm.$vuetify.theme.currentTheme[color];
47
+ vm.color = vm.$vuetify.theme.themes[color];
58
48
  }
59
49
  });
60
50
  });
61
51
  },
62
- click: function(spec) {
52
+ click: function (spec) {
63
53
  const onClick = spec["onClick"];
64
54
  this.show = false;
65
55
  GLib.action.execute(onClick, this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "2.4.1",
3
+ "version": "3.0.0-beta1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,8 +9,6 @@
9
9
  "author": "",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
- "@fortawesome/fontawesome-free": "^5.0.0",
13
- "@mdi/font": "^4.5.95",
14
12
  "@rails/actioncable": "^6.0.0",
15
13
  "@rails/activestorage": "^6.0.0-alpha",
16
14
  "awesome-phonenumber": "2.15.0",
@@ -22,29 +20,30 @@
22
20
  "phoenix": "^1.5.3",
23
21
  "push.js": "^1.0.12",
24
22
  "quill-image-drop-and-paste": "^1.2.14",
23
+ "tiny-emitter": "^2.1.0",
25
24
  "turndown": "^7.1.1",
26
25
  "turndown-plugin-gfm": "^1.0.2",
27
- "vue": "2.6.14",
26
+ "vue": "3.2.47",
28
27
  "vue-chartkick": "^0.6.1",
29
- "vue-gtag": "^1.1.2",
28
+ "vue-gtag": "^2.0.1",
30
29
  "vue-social-sharing": "^3.0.9",
31
30
  "vue-youtube": "^1.4.0",
32
31
  "vue2-editor": "^2.9.1",
33
32
  "vue2-gmap-custom-marker": "^6.1.1",
34
33
  "vue2-google-maps": "^0.10.6",
35
34
  "vuedraggable": "^2.24.1",
36
- "vuetify": "2.3.9"
35
+ "vuetify": "3.1.10"
37
36
  },
38
37
  "devDependencies": {
39
38
  "@types/chart.js": "^2.9.34",
40
- "babel-eslint": "^10.0.3",
41
- "eslint": "^6.4.0",
39
+ "eslint": "^8.36.0",
42
40
  "eslint-config-prettier": "^6.3.0",
43
41
  "eslint-loader": "^3.0.0",
44
42
  "eslint-plugin-prettier": "^3.1.1",
45
- "eslint-plugin-vue": "^5.2.3",
46
- "eslint-plugin-vuetify": "^1.0.0-beta.3",
43
+ "eslint-plugin-vue": "^9.9.0",
44
+ "eslint-plugin-vuetify": "^2.0.0-beta.2",
45
+ "material-design-icons-iconfont": "^6.7.0",
47
46
  "prettier": "^1.18.2",
48
47
  "typescript": "^4.9.5"
49
48
  }
50
- }
49
+ }
@@ -8,6 +8,6 @@ export default {
8
8
  element.addEventListener("focus", () => driver.moveNext());
9
9
  };
10
10
 
11
- Vue.prototype.driverCustomBehavior = driverCustomBehavior;
11
+ Vue.config.globalProperties.driverCustomBehavior = driverCustomBehavior;
12
12
  }
13
13
  };
@@ -1,16 +1,10 @@
1
1
  export default {
2
2
  install: (Vue, options) => {
3
- // Vue.prototype.updatables = {};
4
-
5
3
  Vue.mixin({
6
- created: function() {
4
+ created: function () {
7
5
  let spec = this.spec;
8
6
  if (spec && spec.id && this.$registryEnabled()) {
9
7
  GLib.component.register(spec.id, this);
10
- // Object.assign(this.updatables, {
11
- // [spec.id]: this
12
- // });
13
- // console.log("U", this.updatables);
14
8
  }
15
9
  },
16
10
  methods: {
@@ -0,0 +1,27 @@
1
+ import { createVuetify } from "vuetify";
2
+ import 'material-design-icons-iconfont/dist/material-design-icons.css'
3
+ import { aliases, md } from 'vuetify/iconsets/md'
4
+ import 'vuetify/styles'
5
+ import Utils from '../utils/helper'
6
+ import * as components from 'vuetify/components'
7
+ import * as directives from 'vuetify/directives'
8
+
9
+ const opts = {
10
+ components,
11
+ directives,
12
+ icons: {
13
+ defaultSet: 'md',
14
+ aliases,
15
+ sets: {
16
+ md,
17
+ },
18
+ },
19
+ theme: {
20
+ themes: Utils.settings.themes
21
+ },
22
+ display: {
23
+ smAndDown: true
24
+ }
25
+ }
26
+
27
+ export default new createVuetify(opts)
File without changes
package/styles/test.sass CHANGED
File without changes
package/styles/test.scss CHANGED
File without changes
@@ -1,25 +1,39 @@
1
1
  <template>
2
- <div v-longclick="$onLongPress" class="outer-container">
2
+ <div
3
+ v-longclick="$onLongPress"
4
+ class="outer-container"
5
+ >
3
6
  <div :class="[spec.editButtons ? 'container-edit' : 'container']">
4
- <v-card flat :class="mode" class="py-1">
5
- <v-card-title v-if="mode === 'system'" class="caption">{{
7
+ <v-card
8
+ flat
9
+ :class="mode"
10
+ class="py-1"
11
+ >
12
+ <v-card-title
13
+ v-if="mode === 'system'"
14
+ class="caption"
15
+ >{{
6
16
  spec.subtitle
7
17
  }}</v-card-title>
8
- <v-avatar v-if="spec.imageUrl" size="30px">
9
- <img :src="spec.imageUrl" alt="avatar" />
18
+ <v-avatar
19
+ v-if="spec.imageUrl"
20
+ size="30px"
21
+ >
22
+ <img
23
+ :src="spec.imageUrl"
24
+ alt="avatar"
25
+ />
10
26
  </v-avatar>
11
27
  <v-card-title
12
28
  v-if="spec.title"
13
29
  class="font-weight-bold body-2 subtitle"
14
- >{{ spec.title }}</v-card-title
15
- >
30
+ >{{ spec.title }}</v-card-title>
16
31
  <!-- eslint-disable vue/no-v-html -->
17
32
  <div
18
33
  v-if="mode !== 'system'"
19
34
  class="comment-bubble pa-2"
20
35
  v-html="compiledText"
21
36
  >
22
- {{ spec.subtitle }}
23
37
  </div>
24
38
  <!--eslint-enable-->
25
39
  <img
@@ -29,13 +43,22 @@
29
43
  :href="taHref(spec)"
30
44
  @click="taClick($event, spec)"
31
45
  />
32
- <v-card-title v-if="spec.subsubtitle" class="subsubtitle caption">{{
46
+ <v-card-title
47
+ v-if="spec.subsubtitle"
48
+ class="subsubtitle caption"
49
+ >{{
33
50
  spec.subsubtitle
34
51
  }}</v-card-title>
35
52
 
36
53
  <div class="mt-1 chips">
37
- <template v-for="(spec, index) in chips">
38
- <v-chip :key="index" class="ma-1" :color="spec.color">
54
+ <template
55
+ v-for="(spec, index) in chips"
56
+ :key="index"
57
+ >
58
+ <v-chip
59
+ class="ma-1"
60
+ :color="spec.color"
61
+ >
39
62
  {{ spec.text }}
40
63
  </v-chip>
41
64
  </template>
@@ -48,28 +71,28 @@
48
71
  <script>
49
72
  export default {
50
73
  props: {
51
- spec: { type: Object, required: true }
74
+ spec: { type: Object, required: true },
52
75
  },
53
- data: function() {
76
+ data: function () {
54
77
  return {
55
78
  position: null,
56
79
  mode: null,
57
- chips: []
80
+ chips: [],
58
81
  };
59
82
  },
60
83
  computed: {
61
84
  compiledText() {
62
85
  return Utils.format.markdown(this.spec.subtitle);
63
- }
86
+ },
64
87
  },
65
88
  methods: {
66
89
  $ready() {
67
90
  const template = this.spec.template;
68
91
  this.mode = this.determineMode(template);
69
92
 
70
- this.chips = (this.spec.chips || []).map(spec => {
93
+ this.chips = (this.spec.chips || []).map((spec) => {
71
94
  var color = null;
72
- this.$type.ifArray(spec.styleClasses, classes => {
95
+ this.$type.ifArray(spec.styleClasses, (classes) => {
73
96
  for (const val of ["success", "info", "warning", "error"]) {
74
97
  if (classes.includes(val)) {
75
98
  color = val;
@@ -92,8 +115,8 @@ export default {
92
115
  case "systemComment":
93
116
  return "system";
94
117
  }
95
- }
96
- }
118
+ },
119
+ },
97
120
  };
98
121
  </script>
99
122
 
@@ -3,15 +3,14 @@
3
3
  <v-img :src="spec.imageUrl" height="200" :style="genericStyles()" />
4
4
 
5
5
  <v-list-item v-if="spec.template != 'spacer'">
6
- <v-list-item-content>
7
- <v-list-item-title>{{ spec.title }}</v-list-item-title>
8
- <v-list-item-subtitle v-if="spec.subtitle">{{
9
- spec.subtitle
10
- }}</v-list-item-subtitle>
11
- <v-list-item-subtitle v-if="spec.subsubtitle">{{
12
- spec.subsubtitle
13
- }}</v-list-item-subtitle>
14
- </v-list-item-content>
6
+
7
+ <v-list-item-title>{{ spec.title }}</v-list-item-title>
8
+ <v-list-item-subtitle v-if="spec.subtitle">{{
9
+ spec.subtitle
10
+ }}</v-list-item-subtitle>
11
+ <v-list-item-subtitle v-if="spec.subsubtitle">{{
12
+ spec.subsubtitle
13
+ }}</v-list-item-subtitle>
15
14
 
16
15
  <templates-menu :edit-buttons="editButtons" />
17
16
  </v-list-item>
@@ -0,0 +1,188 @@
1
+ <template>
2
+ <div style="display:flex;" class="thumbnail" :class="cssClasses">
3
+ <div v-if="spec.leftOuterButtons" class="left-universal" style="display:flex; margin-top:10px;">
4
+ <template v-for="(item, index) in spec.leftOuterButtons" :key="index">
5
+ <common-button :spec="buttonSpec(item)" :disabled="$isBusy" />
6
+ </template>
7
+ </div>
8
+
9
+ <v-list-item v-longclick="$onLongPress" :href="$href()" class="item-content" :style="columnStyles()"
10
+ @[clickCondition]="$onClick()">
11
+ <!-- <v-icon v-if="spec.onReorder" class="handle">drag_indicator</v-icon> -->
12
+
13
+ <!-- Specify a key to prevent reuse which causes an issue where the checkbox would use the previous name. -->
14
+ <fields-check v-if="checkSpec" :key="checkSpec.name" :spec="checkSpec" />
15
+
16
+ <div v-if="spec.leftButtons" class="left-universal">
17
+ <template v-for="(item, index) in spec.leftButtons" :key="index">
18
+ <rich-button :spec="buttonSpec(item)" :disabled="$isBusy" />
19
+ </template>
20
+ </div>
21
+
22
+ <!-- <v-list-item-avatar v-if="$type.isString(spec.imageUrl)" :tile="!spec.avatar || null" style="display:flex;"
23
+ class="left-thumbnail" :size="spec.imageSize">
24
+ <img :src="spec.imageUrl" />
25
+ </v-list-item-avatar> -->
26
+ <!-- <v-list-item-avatar v-else-if="$type.isObject(spec.icon)">
27
+ <common-icon :spec="spec.icon" />
28
+ </v-list-item-avatar> -->
29
+ <div v-else class="left-icon" v-if="$type.isObject(spec.icon)">
30
+ <common-icon :spec="spec.icon" />
31
+ </div>
32
+
33
+ <div style="display:flex;width: 100%">
34
+ <v-text-field v-if="spec.fieldTitleName" :name="spec.fieldTitleName" :value="spec.title" />
35
+ <v-list-item-title v-else>{{ spec.title }}</v-list-item-title>
36
+
37
+ <v-list-item-subtitle v-if="spec.subtitle">{{
38
+ spec.subtitle
39
+ }}</v-list-item-subtitle>
40
+ <v-list-item-subtitle v-if="spec.subsubtitle">{{
41
+ spec.subsubtitle
42
+ }}</v-list-item-subtitle>
43
+
44
+ <div class="chips">
45
+ <template v-for="(item, index) in chips" :key="index">
46
+ <common-chip :spec="item" />
47
+ </template>
48
+ </div>
49
+
50
+ <!-- NOTE: Experimental -->
51
+ <panels-responsive :spec="spec.accessory" />
52
+ </div>
53
+
54
+ <template v-for="(item, index) in spec.rightButtons" :key="index">
55
+ <rich-button :spec="buttonSpec(item)" :disabled="$isBusy" />
56
+ </template>
57
+
58
+ <templates-menu :edit-buttons="editButtons" />
59
+ </v-list-item>
60
+ </div>
61
+ </template>
62
+
63
+ <script>
64
+ import CheckField from "../components/fields/check.vue";
65
+
66
+ export default {
67
+ components: {
68
+ "fields-check": CheckField,
69
+ },
70
+ props: {
71
+ spec: { type: Object, required: true },
72
+ responsiveCols: { type: Number, default: () => 0 },
73
+ },
74
+ data() {
75
+ return {
76
+ // accessory: {},
77
+ editButtons: []
78
+ // checkSpec: null
79
+ };
80
+ },
81
+ computed: {
82
+ cssClasses() {
83
+ return this.$classes(this.spec, "templates/thumbnail");
84
+ },
85
+ clickCondition() {
86
+ if (this.spec.onClick || this.spec.onLongPress) {
87
+ // This will show the clickable indication
88
+ return "click";
89
+ }
90
+ return null;
91
+ },
92
+ // Implemented as computed so that it gets reflected when reordering
93
+ chips() {
94
+ return (this.spec.chips || []).map((item) => {
95
+ var color = null;
96
+ this.$type.ifArray(item.styleClasses, (classes) => {
97
+ for (const val of ["success", "info", "warning", "error"]) {
98
+ if (classes.includes(val)) {
99
+ color = val;
100
+ }
101
+ }
102
+ });
103
+ return Object.assign({}, item, { color: color, view: "chip" });
104
+ });
105
+ },
106
+ // Implemented as computed so that it gets reflected when navigating to another list containing check fields.
107
+ checkSpec() {
108
+ if (this.spec.fieldCheckName) {
109
+ return {
110
+ view: "fields/checkGroup",
111
+ name: this.spec.fieldCheckName,
112
+ checkValue: true,
113
+ valueIf: this.spec.fieldCheckValueIf,
114
+ padding: { left: 16 },
115
+ };
116
+ }
117
+ return null;
118
+ }
119
+ // cssStyles() {
120
+ // const styles = this.$styles();
121
+ // // switch(this.spec.align) {
122
+ // // case 'middle':
123
+ // // styles['align-items'] = 'center'
124
+ // // break
125
+ // // case 'bottom':
126
+ // // styles['align-items'] = 'flex-end'
127
+ // // break
128
+ // // default:
129
+ // // styles['align-items'] = 'flex-start'
130
+ // // }
131
+ // return styles;
132
+ // },
133
+ },
134
+ methods: {
135
+ $ready() {
136
+ // this.accessory = { childViews: this.spec.accessoryViews };
137
+ this.editButtons = this.spec.editButtons || [];
138
+ },
139
+ buttonSpec(item) {
140
+ return Object.assign({}, item, {
141
+ view: "button-v1",
142
+ styleClasses: item.text ? ["text"] : ["icon"],
143
+ });
144
+ },
145
+ columnStyles() {
146
+ if (this.responsiveCols) {
147
+ return `width: ${100 / this.responsiveCols}%; float: left;`;
148
+ }
149
+ },
150
+ },
151
+ };
152
+ </script>
153
+
154
+ <style lang="scss">
155
+ .chips>* {
156
+ margin-right: 10px;
157
+ }
158
+ </style>
159
+
160
+ <style lang="scss" scoped>
161
+ .item-content {
162
+ padding-left: 0;
163
+ padding-right: 0;
164
+ display: flex;
165
+ }
166
+
167
+ @media (min-width: 600px) {
168
+ .left-thumbnail.v-avatar.v-list-item__avatar {
169
+ margin: 6px 6px 6px 6px;
170
+ width: 60px;
171
+ height: 60px;
172
+ }
173
+
174
+ .left-icon {
175
+ // margin-left: 16px;
176
+ margin-left: 4px;
177
+ }
178
+
179
+ .left-universal {
180
+ padding-left: 16px;
181
+ }
182
+
183
+ // .handle {
184
+ // // margin-left: 10px;
185
+ // cursor: move;
186
+ // }
187
+ }
188
+ </style>