glib-web 2.5.0 → 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 (209) hide show
  1. package/.eslintrc.js +0 -0
  2. package/LICENSE +0 -0
  3. package/README.md +0 -0
  4. package/action.js +6 -1
  5. package/actions/analytics/logEvent.js +0 -0
  6. package/actions/auth/creditCard.js +0 -0
  7. package/actions/auth/restart.js +0 -0
  8. package/actions/auth/saveCsrfToken.js +0 -0
  9. package/actions/cables/push.js +0 -0
  10. package/actions/commands/copy.js +0 -0
  11. package/actions/commands/enqueue.js +17 -0
  12. package/actions/components/update.js +13 -14
  13. package/actions/dialogs/alert.js +0 -0
  14. package/actions/dialogs/close.js +0 -0
  15. package/actions/dialogs/notification.js +0 -0
  16. package/actions/dialogs/oauth.js +0 -0
  17. package/actions/dialogs/open.js +0 -0
  18. package/actions/dialogs/options.js +0 -0
  19. package/actions/dialogs/reload.js +0 -0
  20. package/actions/dialogs/show.js +0 -0
  21. package/actions/http/delete.js +0 -0
  22. package/actions/http/patch.js +0 -0
  23. package/actions/http/post.js +0 -0
  24. package/actions/http/put.js +0 -0
  25. package/actions/panels/scrollTo.js +0 -0
  26. package/actions/panels/scrollToBottom.js +0 -0
  27. package/actions/runMultiple.js +0 -0
  28. package/actions/sheets/select.js +0 -0
  29. package/actions/snackbars/alert.js +0 -0
  30. package/actions/snackbars/select.js +0 -0
  31. package/actions/timeouts/set.js +0 -0
  32. package/actions/tours/start.js +0 -0
  33. package/actions/windows/close.js +0 -0
  34. package/actions/windows/closeAll.js +0 -0
  35. package/actions/windows/closeWithReload.js +0 -0
  36. package/actions/windows/open.js +0 -0
  37. package/actions/windows/openWeb.js +0 -0
  38. package/actions/windows/print.js +0 -0
  39. package/actions/windows/refreshState.js +0 -0
  40. package/actions/windows/reload.js +0 -0
  41. package/actions/ws/push.js +0 -0
  42. package/app.vue +25 -26
  43. package/components/_button.vue +21 -28
  44. package/components/_chip.vue +14 -19
  45. package/components/_dropdownMenu.vue +10 -23
  46. package/components/_icon.vue +5 -5
  47. package/components/_message.vue +0 -0
  48. package/components/_responsive.vue +7 -21
  49. package/components/avatar.vue +11 -15
  50. package/components/banners/alert.vue +2 -7
  51. package/components/banners/select.vue +18 -30
  52. package/components/button.vue +5 -5
  53. package/components/calendar.vue +0 -0
  54. package/components/component.vue +96 -101
  55. package/components/datetime.vue +0 -0
  56. package/components/fab.vue +0 -0
  57. package/components/fields/_patternText.vue +5 -19
  58. package/components/fields/_select.vue +7 -28
  59. package/components/fields/autocomplete.vue +5 -21
  60. package/components/fields/check.vue +19 -11
  61. package/components/fields/country/countries.js +0 -0
  62. package/components/fields/country/field.vue +9 -27
  63. package/components/fields/country/regions.js +0 -0
  64. package/components/fields/creditCard.vue +0 -0
  65. package/components/fields/date.vue +5 -5
  66. package/components/fields/datetime.vue +5 -5
  67. package/components/fields/dynamicSelect.vue +8 -29
  68. package/components/fields/file.vue +0 -0
  69. package/components/fields/googlePlace.vue +0 -0
  70. package/components/fields/hidden.vue +0 -0
  71. package/components/fields/location.vue +0 -0
  72. package/components/fields/newRichText.vue +66 -53
  73. package/components/fields/otpField.vue +6 -14
  74. package/components/fields/phone/countries.js +0 -0
  75. package/components/fields/phone/field.vue +60 -78
  76. package/components/fields/phone/sprite.css +0 -0
  77. package/components/fields/radio.vue +16 -23
  78. package/components/fields/rating.vue +9 -16
  79. package/components/fields/richText.vue +8 -28
  80. package/components/fields/select.vue +10 -7
  81. package/components/fields/stripe/stripeFields.vue +0 -0
  82. package/components/fields/stripe/stripeIndividualFields.vue +0 -0
  83. package/components/fields/stripeExternalAccount.vue +10 -24
  84. package/components/fields/stripeToken.vue +0 -0
  85. package/components/fields/submit.vue +0 -0
  86. package/components/fields/text.vue +24 -40
  87. package/components/fields/textarea.vue +13 -27
  88. package/components/fields/timeZone.vue +9 -6
  89. package/components/fields/timer.vue +3 -10
  90. package/components/h1.vue +0 -0
  91. package/components/h2.vue +0 -0
  92. package/components/h3.vue +0 -0
  93. package/components/h5.vue +0 -0
  94. package/components/h6.vue +0 -0
  95. package/components/hr.vue +0 -0
  96. package/components/html.vue +0 -0
  97. package/components/icon.vue +0 -0
  98. package/components/image.vue +13 -20
  99. package/components/label.vue +0 -0
  100. package/components/markdown.vue +15 -8
  101. package/components/mixins/chart/annotation.js +0 -0
  102. package/components/mixins/chart/tooltip.js +0 -0
  103. package/components/mixins/dataset.js +0 -0
  104. package/components/mixins/events.js +17 -6
  105. package/components/mixins/extension.js +0 -0
  106. package/components/mixins/list/autoload.js +0 -0
  107. package/components/mixins/longClick.js +0 -0
  108. package/components/mixins/scrolling.js +0 -0
  109. package/components/mixins/styles.js +18 -15
  110. package/components/mixins/table/autoload.js +0 -0
  111. package/components/mixins/table/export.js +0 -0
  112. package/components/mixins/table/import.js +0 -0
  113. package/components/mixins/text.js +0 -0
  114. package/components/mixins/ws/actionCable.js +0 -0
  115. package/components/mixins/ws/phoenixSocket.js +0 -0
  116. package/components/multimedia/video.vue +0 -0
  117. package/components/p.vue +0 -0
  118. package/components/panels/carousel.vue +0 -0
  119. package/components/panels/column.vue +5 -5
  120. package/components/panels/custom.vue +15 -15
  121. package/components/panels/flow.vue +19 -13
  122. package/components/panels/form.vue +17 -28
  123. package/components/panels/grid.vue +15 -9
  124. package/components/panels/horizontal.vue +149 -18
  125. package/components/panels/list.vue +63 -70
  126. package/components/panels/responsive.vue +13 -33
  127. package/components/panels/scroll.vue +0 -0
  128. package/components/panels/split.vue +2 -2
  129. package/components/panels/table.vue +27 -61
  130. package/components/panels/timeline.vue +20 -30
  131. package/components/panels/vertical.vue +9 -14
  132. package/components/panels/web.vue +0 -0
  133. package/components/progressbar.vue +0 -0
  134. package/components/spacer.vue +0 -0
  135. package/components/switch.vue +0 -0
  136. package/components/tabBar.vue +27 -19
  137. package/index.js +68 -72
  138. package/keys.js +0 -0
  139. package/nav/appbar.vue +4 -4
  140. package/nav/dialog.vue +24 -34
  141. package/nav/drawer.vue +39 -51
  142. package/nav/drawerButton.vue +5 -7
  143. package/nav/drawerLabel.vue +2 -3
  144. package/nav/sheet.vue +18 -24
  145. package/nav/snackbar.vue +16 -26
  146. package/package.json +10 -11
  147. package/plugins/driverCustomBehavior.js +1 -1
  148. package/plugins/updatableComponent.js +1 -7
  149. package/plugins/vuetify.js +27 -0
  150. package/settings.json.example +0 -0
  151. package/static/plugins/alignment/alignment.js +0 -0
  152. package/static/plugins/alignment/alignment.min.js +0 -0
  153. package/static/plugins/beyondgrammar/beyondgrammar.js +0 -0
  154. package/static/plugins/beyondgrammar/beyondgrammar.min.js +0 -0
  155. package/static/plugins/blockcode/blockcode.js +0 -0
  156. package/static/plugins/blockcode/blockcode.min.js +0 -0
  157. package/static/plugins/clips/clips.js +0 -0
  158. package/static/plugins/clips/clips.min.js +0 -0
  159. package/static/plugins/counter/counter.js +0 -0
  160. package/static/plugins/counter/counter.min.js +0 -0
  161. package/static/plugins/definedlinks/definedlinks.js +0 -0
  162. package/static/plugins/definedlinks/definedlinks.min.js +0 -0
  163. package/static/plugins/handle/handle.js +0 -0
  164. package/static/plugins/handle/handle.min.js +0 -0
  165. package/static/plugins/icons/icons.js +0 -0
  166. package/static/plugins/icons/icons.min.js +0 -0
  167. package/static/plugins/imageposition/imageposition.js +0 -0
  168. package/static/plugins/imageposition/imageposition.min.js +0 -0
  169. package/static/plugins/inlineformat/inlineformat.js +0 -0
  170. package/static/plugins/inlineformat/inlineformat.min.js +0 -0
  171. package/static/plugins/removeformat/removeformat.js +0 -0
  172. package/static/plugins/removeformat/removeformat.min.js +0 -0
  173. package/static/plugins/selector/selector.js +0 -0
  174. package/static/plugins/selector/selector.min.js +0 -0
  175. package/static/plugins/specialchars/specialchars.js +0 -0
  176. package/static/plugins/specialchars/specialchars.min.js +0 -0
  177. package/static/plugins/textdirection/textdirection.js +0 -0
  178. package/static/plugins/textdirection/textdirection.min.js +0 -0
  179. package/static/plugins/textexpander/textexpander.js +0 -0
  180. package/static/plugins/textexpander/textexpander.min.js +0 -0
  181. package/static/plugins/underline/underline.js +0 -0
  182. package/static/plugins/underline/underline.min.js +0 -0
  183. package/static/redactorx.css +0 -0
  184. package/static/redactorx.js +0 -0
  185. package/static/redactorx.min.css +0 -0
  186. package/static/redactorx.min.js +0 -0
  187. package/static/redactorx.usm.min.js +0 -0
  188. package/styles/test.sass +0 -0
  189. package/styles/test.scss +0 -0
  190. package/templates/_menu.vue +0 -0
  191. package/templates/comment.vue +42 -19
  192. package/templates/featured.vue +8 -9
  193. package/templates/thumbnail-old.vue +188 -0
  194. package/templates/thumbnail.vue +5 -188
  195. package/templates/unsupported.vue +0 -0
  196. package/tsconfig.json +1 -1
  197. package/utils/dom.js +0 -0
  198. package/utils/eventBus.js +9 -2
  199. package/utils/helper.js +0 -0
  200. package/utils/history.js +7 -4
  201. package/utils/http.js +7 -2
  202. package/utils/launch.js +43 -51
  203. package/utils/mime_type.js +0 -0
  204. package/utils/private/ws.js +0 -0
  205. package/utils/public.js +6 -0
  206. package/utils/queue.js +110 -0
  207. package/utils/settings.js +3 -1
  208. package/utils/type.js +0 -0
  209. package/utils/uploader.js +0 -0
package/styles/test.scss CHANGED
File without changes
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>
@@ -1,194 +1,11 @@
1
1
  <template>
2
- <div style="display:flex;" class="thumbnail">
3
- <div
4
- v-if="spec.leftOuterButtons"
5
- class="left-universal"
6
- style="display:flex; margin-top: 10px;"
7
- >
8
- <template v-for="(item, index) in spec.leftOuterButtons">
9
- <common-button
10
- :key="index"
11
- :spec="buttonSpec(item)"
12
- :disabled="$isBusy"
13
- />
14
- </template>
15
- </div>
16
-
17
- <v-list-item
18
- v-longclick="$onLongPress"
19
- :href="$href()"
20
- style="padding-left: 0;display:flex;"
21
- :style="columnStyles()"
22
- @[clickCondition]="$onClick()"
23
- >
24
- <v-icon v-if="spec.onReorder" class="handle">drag_indicator</v-icon>
25
-
26
- <!-- Specify a key to prevent reuse which causes an issue where the checkbox would use the previous name. -->
27
- <fields-check v-if="checkSpec" :key="checkSpec.name" :spec="checkSpec" />
28
-
29
- <div v-if="spec.leftButtons" class="left-universal">
30
- <template v-for="(item, index) in spec.leftButtons">
31
- <rich-button
32
- :key="index"
33
- :spec="buttonSpec(item)"
34
- :disabled="$isBusy"
35
- />
36
- </template>
37
- </div>
38
-
39
- <v-list-item-avatar
40
- v-if="$type.isString(spec.imageUrl)"
41
- :tile="!spec.avatar"
42
- style="display:flex;"
43
- class="left-thumbnail"
44
- :size="spec.imageSize"
45
- >
46
- <img :src="spec.imageUrl" />
47
- </v-list-item-avatar>
48
- <!-- <v-list-item-avatar v-else-if="$type.isObject(spec.icon)">
49
- <common-icon :spec="spec.icon" />
50
- </v-list-item-avatar> -->
51
- <div v-else class="left-icon">
52
- <v-list-item-avatar v-if="$type.isObject(spec.icon)">
53
- <common-icon :spec="spec.icon" />
54
- </v-list-item-avatar>
55
- </div>
56
-
57
- <v-list-item-content style="display:flex;">
58
- <v-text-field
59
- v-if="spec.fieldTitleName"
60
- :name="spec.fieldTitleName"
61
- :value="spec.title"
62
- />
63
- <v-list-item-title v-else>{{ spec.title }}</v-list-item-title>
64
-
65
- <v-list-item-subtitle v-if="spec.subtitle">{{
66
- spec.subtitle
67
- }}</v-list-item-subtitle>
68
- <v-list-item-subtitle v-if="spec.subsubtitle">{{
69
- spec.subsubtitle
70
- }}</v-list-item-subtitle>
71
-
72
- <div class="chips">
73
- <template v-for="(item, index) in chips">
74
- <common-chip :key="index" :spec="item" />
75
- </template>
76
- </div>
77
-
78
- <!-- NOTE: Experimental -->
79
- <panels-responsive :spec="accessory" />
80
- </v-list-item-content>
81
-
82
- <template v-for="(item, index) in spec.rightButtons">
83
- <rich-button
84
- :key="index"
85
- :spec="buttonSpec(item)"
86
- :disabled="$isBusy"
87
- />
88
- </template>
89
-
90
- <templates-menu :edit-buttons="editButtons" />
91
- </v-list-item>
92
- </div>
2
+ <v-list-item :key="spec.title" :title="spec.title" :subtitle="spec.subtitle" :prepend-avatar="spec.imageUrl"
3
+ @click="$event => spec.onClick ? $onClick() : null"></v-list-item>
93
4
  </template>
94
-
95
5
  <script>
96
- import CheckField from "../components/fields/check";
97
-
98
6
  export default {
99
- components: {
100
- "fields-check": CheckField
101
- },
102
- props: {
103
- spec: { type: Object, required: true },
104
- responsiveCols: { type: Number, default: () => 0 }
105
- },
106
- data() {
107
- return {
108
- accessory: {},
109
- editButtons: []
110
- // checkSpec: null
111
- };
112
- },
113
- computed: {
114
- clickCondition() {
115
- if (this.spec.onClick || this.spec.onLongPress) {
116
- // This will show the clickable indication
117
- return "click";
118
- }
119
- return null;
120
- },
121
- // Implemented as computed so that it gets reflected when reordering
122
- chips() {
123
- return (this.spec.chips || []).map(item => {
124
- var color = null;
125
- this.$type.ifArray(item.styleClasses, classes => {
126
- for (const val of ["success", "info", "warning", "error"]) {
127
- if (classes.includes(val)) {
128
- color = val;
129
- }
130
- }
131
- });
132
- return Object.assign({}, item, { color: color, view: "chip" });
133
- });
134
- },
135
- // Implemented as computed so that it gets reflected when navigating to another list containing check fields.
136
- checkSpec() {
137
- if (this.spec.fieldCheckName) {
138
- return {
139
- view: "fields/checkGroup",
140
- name: this.spec.fieldCheckName,
141
- checkValue: true,
142
- valueIf: this.spec.fieldCheckValueIf,
143
- padding: { left: 16 }
144
- };
145
- }
146
- return null;
7
+ props: {
8
+ spec: { type: Object, required: true },
147
9
  }
148
- },
149
- methods: {
150
- $ready() {
151
- this.accessory = { childViews: this.spec.accessoryViews };
152
- this.editButtons = this.spec.editButtons || [];
153
- },
154
- buttonSpec(item) {
155
- return Object.assign({}, item, {
156
- view: "button-v1",
157
- styleClasses: item.text ? ["text"] : ["icon"]
158
- });
159
- },
160
- columnStyles() {
161
- if (this.responsiveCols) {
162
- return `width: ${100 / this.responsiveCols}%; float: left;`;
163
- }
164
- }
165
- }
166
- };
167
- </script>
168
-
169
- <style lang="scss">
170
- .chips > * {
171
- margin-right: 10px;
172
- }
173
- </style>
174
-
175
- <style lang="scss" scoped>
176
- @media (min-width: 600px) {
177
- .left-thumbnail.v-avatar.v-list-item__avatar {
178
- margin: 6px 6px 6px 6px;
179
- width: 60px;
180
- height: 60px;
181
- }
182
- .left-icon {
183
- // margin-left: 16px;
184
- margin-left: 4px;
185
- }
186
- .left-universal {
187
- padding-left: 16px;
188
- }
189
- .handle {
190
- margin-left: 10px;
191
- cursor: move;
192
- }
193
10
  }
194
- </style>
11
+ </script>
File without changes
package/tsconfig.json CHANGED
@@ -39,7 +39,7 @@
39
39
  // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
40
40
 
41
41
  /* JavaScript Support */
42
- // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
42
+ "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
43
43
  // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
44
44
  // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
45
45
 
package/utils/dom.js CHANGED
File without changes
package/utils/eventBus.js CHANGED
@@ -1,2 +1,9 @@
1
- import Vue from "vue";
2
- export default new Vue();
1
+ // eventBus.js
2
+ import emitter from 'tiny-emitter/instance'
3
+
4
+ export default {
5
+ $on: (...args) => emitter.on(...args),
6
+ $once: (...args) => emitter.once(...args),
7
+ $off: (...args) => emitter.off(...args),
8
+ $emit: (...args) => emitter.emit(...args)
9
+ }
package/utils/helper.js CHANGED
File without changes
package/utils/history.js CHANGED
@@ -1,4 +1,5 @@
1
- import Vue from "vue";
1
+ import { nextTick } from "vue";
2
+ import eventBus from "./eventBus";
2
3
 
3
4
  export default class {
4
5
  static saveInitialContent(content) {
@@ -20,7 +21,7 @@ export default class {
20
21
  }
21
22
 
22
23
  static _data(content) {
23
- return { content: content, navigationCount: this.navigationCount };
24
+ return { content: JSON.parse(JSON.stringify(content)), navigationCount: this.navigationCount };
24
25
  }
25
26
 
26
27
  static pushPage(content, url) {
@@ -54,10 +55,12 @@ export default class {
54
55
 
55
56
  const data = event.state;
56
57
  data.content.__poppedState = true;
57
- window.vueApp.page = data.content;
58
+ //
59
+
60
+ eventBus.$emit('app/updatePage', data.content)
58
61
  vm.navigationCount = data.navigationCount;
59
62
 
60
- Vue.nextTick(() => {
63
+ nextTick(() => {
61
64
  const scrollTop = this.bodyScrollTops[this.navigationCount];
62
65
  this._pageBody.scrollTop = scrollTop;
63
66
  });
package/utils/http.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import Type from "./type";
2
2
  import Action from "../action";
3
+ import eventBus from "./eventBus";
3
4
 
4
5
  let loading = false;
5
6
  const dirtyPrompt = "Changes you made have not been saved. Are you sure?";
@@ -60,7 +61,10 @@ export default class {
60
61
 
61
62
  this.forceComponentUpdate(() => {
62
63
  Utils.history.resetScroll();
63
- window.vueApp.page = data;
64
+ // window.vueApp.page = data;
65
+
66
+ eventBus.$emit('app/updatePage', data)
67
+
64
68
  Action.execute(properties["onOpen"], component);
65
69
  });
66
70
  });
@@ -113,7 +117,8 @@ export default class {
113
117
 
114
118
  Utils.http.execute(data, "GET", component, (page, response) => {
115
119
  Utils.http.forceComponentUpdate(() => {
116
- window.vueApp.page = page;
120
+ // window.vueApp.page = page;
121
+ eventBus.$emit('app/updatePage', page)
117
122
  const redirectUrl = Utils.url.htmlUrl(response.url);
118
123
  Utils.history.updatePage(redirectUrl);
119
124