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
@@ -1,30 +1,5 @@
1
1
  <template>
2
- <div style="display: contents;">
3
- <!-- <common-responsive v-if="!hoverViewsSpec" :spec="spec" /> -->
4
- <v-menu
5
- v-if="hoverViewsSpec"
6
- :close-on-content-click="false"
7
- open-on-hover
8
- offset-x
9
- transition="scale-transition"
10
- content-class="hover"
11
- >
12
- <template v-slot:activator="{ on, attrs }">
13
- <div v-bind="attrs" v-on="on">
14
- <common-responsive :spec="spec" />
15
- </div>
16
- </template>
17
- <v-card>
18
- <common-responsive :spec="hoverViewsSpec" />
19
- </v-card>
20
- </v-menu>
21
- <common-tooltip v-else :spec="spec">
22
- <template v-slot:activator="{ on }">
23
- <common-responsive :spec="spec" :event-handlers="on" />
24
- <!-- <common-button :spec="spec" :disabled="$isBusy" :event-handlers="on" /> -->
25
- </template>
26
- </common-tooltip>
27
- </div>
2
+ <common-responsive :spec="spec" />
28
3
  </template>
29
4
 
30
5
  <script>
@@ -33,20 +8,25 @@ export default {
33
8
  spec: {
34
9
  type: Object,
35
10
  required: true,
36
- default: function() {
11
+ default: function () {
37
12
  return {};
38
13
  }
39
14
  }
40
15
  },
41
16
  data() {
42
17
  return {
43
- hoverViewsSpec: this.spec.hoverViews
44
- ? {
45
- childViews: this.spec.hoverViews,
46
- align: this.spec.align
47
- }
48
- : false
18
+ hoverViewsSpec: null
49
19
  };
20
+ },
21
+ methods: {
22
+ $ready() {
23
+ this.hoverViewsSpec = this.spec.hoverViews
24
+ ? {
25
+ childViews: this.spec.hoverViews,
26
+ align: this.spec.align
27
+ }
28
+ : null;
29
+ }
50
30
  }
51
31
  };
52
32
  </script>
@@ -1,7 +1,7 @@
1
1
  <template v-if="content">
2
2
  <div :class="classes()" :style="genericStyles()">
3
3
  <div v-if="spec.left" class="layouts-split__side">
4
- <panels-responsive :spec="spec.left" />
4
+ <panels-responsive :spec="spec.left" v-if="spec.left" class="layouts-split__side" />
5
5
  </div>
6
6
 
7
7
  <div class="layouts-split__expand">
@@ -23,7 +23,7 @@ export default {
23
23
  spec: { type: Object, required: true }
24
24
  },
25
25
  methods: {
26
- classes: function() {
26
+ classes: function () {
27
27
  return this.$classes().concat("layouts-split");
28
28
  }
29
29
  }
@@ -3,45 +3,25 @@
3
3
  <div ref="topAnchor"></div>
4
4
 
5
5
  <table :style="$styles()" :class="$classes()">
6
- <template v-for="(section, sectionIndex) in sections">
7
- <thead :key="`head_${sectionIndex}`">
6
+ <template v-for="(section, sectionIndex) in sections" :key="`head_${sectionIndex}`">
7
+ <thead>
8
8
  <tr v-if="importable || exportable">
9
9
  <td colspan="10">
10
10
  <div class="pa-3">
11
11
  <template v-if="importable">
12
- <span
13
- >{{
14
- rows(section).length + section.dataRows.length
15
- }}
16
- rows</span
17
- >
18
- <input
19
- ref="fileInput"
20
- style="display: none;"
21
- type="file"
22
- accept=".csv"
23
- @change="loadFile($event, section)"
24
- />
12
+ <span>{{
13
+ rows(section).length + section.dataRows.length
14
+ }}
15
+ rows</span>
16
+ <input ref="fileInput" style="display: none;" type="file" accept=".csv"
17
+ @change="loadFile($event, section)" />
25
18
  <v-btn @click="triggerImport(sectionIndex)">Import</v-btn>
26
- <v-btn
27
- :disabled="totalRows(section) <= 0"
28
- @click="submitRows($event, section)"
29
- >Save</v-btn
30
- >
31
- <v-btn
32
- :disabled="totalRows(section) <= 0"
33
- @click="clear(section)"
34
- >Clear</v-btn
35
- >
19
+ <v-btn :disabled="totalRows(section) <= 0" @click="submitRows($event, section)">Save</v-btn>
20
+ <v-btn :disabled="totalRows(section) <= 0" @click="clear(section)">Clear</v-btn>
36
21
  </template>
37
22
 
38
23
  <div class="float-right">
39
- <v-btn
40
- v-if="exportable"
41
- :download="exportFile"
42
- :href="exportCsv(section)"
43
- >{{ exportLabel }}</v-btn
44
- >
24
+ <v-btn v-if="exportable" :download="exportFile" :href="exportCsv(section)">{{ exportLabel }}</v-btn>
45
25
  </div>
46
26
  </div>
47
27
 
@@ -53,36 +33,22 @@
53
33
 
54
34
  <tr v-if="section.header" :style="genericStyles(section.header)">
55
35
  <template v-if="section.header.dataCells">
56
- <th
57
- v-for="(cell, index) in section.header.dataCells"
58
- :key="index"
59
- >
36
+ <th v-for="(cell, index) in section.header.dataCells" :key="index">
60
37
  {{ cell }}
61
38
  </th>
62
39
  </template>
63
- <th
64
- v-for="(cell, index) in section.header.cellViews"
65
- v-else
66
- :key="index"
67
- >
40
+ <th v-for="(cell, index) in section.header.cellViews" v-else :key="index">
68
41
  <glib-component :spec="cell" />
69
42
  </th>
70
43
  </tr>
71
44
  </thead>
72
45
 
73
- <tbody :key="`body_${sectionIndex}`">
46
+ <tbody>
74
47
  <!-- <tr v-for="(row, index) in section.rows" :key="`row_${index}`"> -->
75
- <template v-for="(row, rowIndex) in section.rows">
76
- <tr
77
- :key="`row_${rowIndex}`"
78
- :class="row.onClick ? 'clickable' : ''"
79
- >
80
- <td
81
- v-for="(cell, cellIndex) in row.cellViews"
82
- :key="`cell_${cellIndex}`"
83
- :colSpan="colSpan(row, cellIndex)"
84
- :style="colStyles(row, cellIndex)"
85
- >
48
+ <template v-for="(row, rowIndex) in section.rows" :key="`row_${rowIndex}`">
49
+ <tr :class="row.onClick ? 'clickable' : ''">
50
+ <td v-for="(cell, cellIndex) in row.cellViews" :key="`cell_${cellIndex}`" :colSpan="colSpan(row, cellIndex)"
51
+ :style="colStyles(row, cellIndex)">
86
52
  <!-- Prevent double links -->
87
53
  <glib-component v-if="$href(cell)" :spec="cell" />
88
54
  <a v-else :href="$href(row)" @click="$onClick($event, row)">
@@ -92,14 +58,8 @@
92
58
  </tr>
93
59
  </template>
94
60
 
95
- <tr
96
- v-for="(row, rowIndex) in section.dataRows"
97
- :key="`data_row_${rowIndex}`"
98
- >
99
- <td
100
- v-for="(cell, cellIndex) in row"
101
- :key="`data_cell_${cellIndex}`"
102
- >
61
+ <tr v-for="(row, rowIndex) in section.dataRows" :key="`data_row_${rowIndex}`">
62
+ <td v-for="(cell, cellIndex) in row" :key="`data_cell_${cellIndex}`">
103
63
  <a class="data-cell">{{ cell }}</a>
104
64
  </td>
105
65
  </tr>
@@ -195,6 +155,7 @@ export default {
195
155
  table {
196
156
  border-spacing: 0;
197
157
  }
158
+
198
159
  thead {
199
160
  th {
200
161
  padding: 10px 4px;
@@ -202,11 +163,13 @@ thead {
202
163
  // border-left: 1px solid rgba(0, 0, 0, 0.12);
203
164
  }
204
165
  }
166
+
205
167
  tbody {
206
168
  tr.clickable {
207
- td > a {
169
+ td>a {
208
170
  cursor: pointer;
209
171
  }
172
+
210
173
  &:hover {
211
174
  background: #eee;
212
175
  }
@@ -224,13 +187,16 @@ tbody {
224
187
  }
225
188
  }
226
189
  }
190
+
227
191
  .scrollable {
228
192
  width: 100%;
229
193
  overflow: auto;
230
194
  }
195
+
231
196
  .data-cell {
232
197
  white-space: pre-line;
233
198
  }
199
+
234
200
  table.table--grid {
235
201
  tbody {
236
202
  td {
@@ -1,43 +1,26 @@
1
1
  <template>
2
2
  <!-- Paddings cannot be applied to v-timeline directly -->
3
3
  <div :style="$styles()" :class="$classes()">
4
- <v-timeline v-if="events" dense align-top>
5
- <v-timeline-item
6
- v-for="(item, index) in events"
7
- :key="index"
8
- :color="item.backgroundColor || 'white'"
9
- :small="itemClasses(item).includes('small')"
10
- :large="itemClasses(item).includes('large')"
11
- :hide-dot="item.hide_dot"
12
- fill-dot
13
- >
4
+ <v-timeline v-if="events" :dense="true" align-top>
5
+ <v-timeline-item v-for="(item, index) in events" :key="index" :color="item.backgroundColor || 'white'"
6
+ :small="itemClasses(item).includes('small') || null" :large="itemClasses(item).includes('large')"
7
+ :hide-dot="item.hide_dot" fill-dot>
14
8
  <template v-slot:icon>
15
- <div
16
- :class="
17
- itemClasses(item).includes('outlined') ? 'outlined-dots' : ''
18
- "
19
- >
20
- <div
21
- v-if="item.text"
22
- class="number-circle"
23
- :style="{ color: item.color }"
24
- >
9
+ <div :class="
10
+ itemClasses(item).includes('outlined') ? 'outlined-dots' : ''
11
+ ">
12
+ <div v-if="item.text" class="number-circle" :style="{ color: item.color }">
25
13
  {{ item.text }}
26
14
  </div>
27
15
  <div v-else class="icon">
28
- <common-icon
29
- :spec="{
30
- material: { name: item.icon, size: iconSize(item) },
31
- color: item.color
32
- }"
33
- />
16
+ <common-icon :spec="{
17
+ material: { name: item.icon, size: iconSize(item) },
18
+ color: item.color
19
+ }" />
34
20
  </div>
35
21
  </div>
36
22
  </template>
37
- <panels-responsive
38
- v-if="childViews"
39
- :spec="{ childViews: [childViews[index]] }"
40
- />
23
+ <panels-responsive v-if="childViews" :spec="{ childViews: [childViews[index]] }" />
41
24
  </v-timeline-item>
42
25
  </v-timeline>
43
26
  </div>
@@ -78,6 +61,7 @@ export default {
78
61
  height: 36px;
79
62
  width: 36px;
80
63
  }
64
+
81
65
  .v-timeline-item__dot--small {
82
66
  height: 20px;
83
67
  width: 20px;
@@ -88,13 +72,16 @@ export default {
88
72
  .v-timeline {
89
73
  padding-top: 0px;
90
74
  }
75
+
91
76
  .v-timeline-item {
92
77
  // Minimum line distance
93
78
  padding-bottom: 10px;
94
79
  }
80
+
95
81
  .container {
96
82
  padding-top: 0px;
97
83
  }
84
+
98
85
  .outlined-dots {
99
86
  border-radius: 50%;
100
87
  width: 100%;
@@ -106,11 +93,13 @@ export default {
106
93
  padding: 4px 0;
107
94
  // font-size: 22px;
108
95
  }
96
+
109
97
  .outlined .v-timeline-item {
110
98
  ::v-deep .v-timeline-item__dot {
111
99
  box-shadow: none;
112
100
  }
113
101
  }
102
+
114
103
  .icon {
115
104
  display: inline-flex;
116
105
  vertical-align: middle;
@@ -120,6 +109,7 @@ export default {
120
109
  .number-circle {
121
110
  font-size: 16px;
122
111
  }
112
+
123
113
  .small {
124
114
  .number-circle {
125
115
  font-size: 14px;
@@ -1,14 +1,8 @@
1
1
  <template>
2
- <component
3
- :is="componentName"
4
- :class="cssClasses"
5
- :style="cssStyles"
6
- :href="$href()"
7
- @click="$onClick()"
8
- >
9
- <template v-for="(item, index) in spec.childViews">
2
+ <component :is="componentName" :class="cssClasses" :style="cssStyles" :href="$href()" @click="$onClick()">
3
+ <template v-for="(item, index) in spec.childViews" :key="`${index}_${item.view}`">
10
4
  <!-- Use view name for key to avoid component reuse issue -->
11
- <glib-component :key="`${index}_${item.view}`" :spec="item" />
5
+ <glib-component :spec="item" />
12
6
  </template>
13
7
  </component>
14
8
  </template>
@@ -19,7 +13,7 @@ export default {
19
13
  spec: { type: Object, required: true }
20
14
  },
21
15
  computed: {
22
- cssClasses: function() {
16
+ cssClasses: function () {
23
17
  // TODO: Remove this after migrating to `panels/responsive`
24
18
  // Vertical panels are nameless when used in predefined layout (e.g. page.body, list.header, etc.)
25
19
  this.spec.view = this.spec.view || "panels/vertical";
@@ -35,7 +29,7 @@ export default {
35
29
  }
36
30
  return classes;
37
31
  },
38
- cssStyles: function() {
32
+ cssStyles: function () {
39
33
  const styles = this.genericStyles();
40
34
  switch (this.spec.align) {
41
35
  case "center":
@@ -50,7 +44,7 @@ export default {
50
44
  return styles;
51
45
  },
52
46
  componentName() {
53
- return this.$href() ? "a" : "div";
47
+ return this.spec.onClick ? "a" : "div";
54
48
  }
55
49
  }
56
50
  };
@@ -92,11 +86,12 @@ a.panels-vertical {
92
86
  </style>
93
87
 
94
88
  <style>
95
- .layouts-vertical--fill-equally > * {
89
+ .layouts-vertical--fill-equally>* {
96
90
  flex: initial;
97
91
  height: 100% !important;
98
92
  }
99
- .layouts-vertical--space-equally > * {
93
+
94
+ .layouts-vertical--space-equally>* {
100
95
  flex: initial;
101
96
  }
102
97
  </style>
@@ -1,24 +1,12 @@
1
1
  <template>
2
2
  <div :style="'width: 100%'" :class="$classes()">
3
- <v-tabs
4
- v-model="tab"
5
- :background-color="spec.backgroundColor"
6
- :slider-color="spec.color"
7
- show-arrows
8
- :height="spec.height || 60"
9
- :grow="$classes().includes('no-grow') ? false : true"
10
- >
11
- <v-tab
12
- v-for="(item, index) in spec.buttons"
13
- :key="index"
14
- height="100%"
15
- :href="$href(item)"
16
- @click="$onClick($event, item)"
17
- >
18
- <common-badge :spec="item">
19
- <common-icon v-if="item.icon" :spec="item.icon" />
20
- <span :style="{ color: spec.color }">{{ item.text }}</span>
21
- </common-badge>
3
+ <v-tabs v-model="tab" :background-color="spec.backgroundColor" :slider-color="spec.color" show-arrows
4
+ :height="spec.height || 60" :grow="$classes().includes('no-grow') ? false : true"
5
+ :model-value="this.spec.activeIndex || null">
6
+ <v-tab v-for="(item, index) in spec.buttons" :key="index" height="100%" :value="index">
7
+
8
+ <span :style="{ color: spec.color }">{{ item.text }}</span>
9
+
22
10
  </v-tab>
23
11
  </v-tabs>
24
12
  <v-divider />
@@ -26,6 +14,8 @@
26
14
  </template>
27
15
 
28
16
  <script>
17
+ import Action from '../action';
18
+
29
19
  export default {
30
20
  props: {
31
21
  spec: { type: Object, required: true }
@@ -36,6 +26,20 @@ export default {
36
26
  buttons: null
37
27
  };
38
28
  },
29
+ watch: {
30
+ tab: function (val, oldVal) {
31
+ if (val == oldVal && oldVal == null) return null;
32
+
33
+ this.$nextTick(function () {
34
+ const activeTab = this.buttons[val]
35
+ const onClick = activeTab?.onClick
36
+
37
+ if (onClick) {
38
+ Action.execute(onClick, this)
39
+ }
40
+ })
41
+ }
42
+ },
39
43
  methods: {
40
44
  $ready() {
41
45
  this.buttons = this.spec.tabButtons || this.spec.buttons;
@@ -54,15 +58,19 @@ export default {
54
58
  left: 0;
55
59
  width: 100%;
56
60
  }
61
+
57
62
  .no-divider .v-divider {
58
63
  display: none;
59
64
  }
65
+
60
66
  .v-tab .v-badge span {
61
67
  // Make sure tab label is middle aligned.
62
68
  margin: auto 0;
63
69
  }
70
+
64
71
  /* .v-badge {
65
72
  top: 50%;
66
73
  transform: translate(0, -50%);
67
74
  } */
68
75
  </style>
76
+