glib-web 0.5.77

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 (204) hide show
  1. package/.eslintrc.js +37 -0
  2. package/LICENSE +201 -0
  3. package/README.md +33 -0
  4. package/action.js +167 -0
  5. package/actions/analytics/logEvent.js +26 -0
  6. package/actions/auth/creditCard.js +29 -0
  7. package/actions/auth/restart.js +5 -0
  8. package/actions/auth/saveCsrfToken.js +12 -0
  9. package/actions/cables/push.js +38 -0
  10. package/actions/dialogs/alert.js +15 -0
  11. package/actions/dialogs/close.js +7 -0
  12. package/actions/dialogs/notification.js +14 -0
  13. package/actions/dialogs/oauth.js +6 -0
  14. package/actions/dialogs/open.js +7 -0
  15. package/actions/dialogs/options.js +5 -0
  16. package/actions/dialogs/show.js +5 -0
  17. package/actions/forms/submit.js +15 -0
  18. package/actions/http/delete.js +7 -0
  19. package/actions/http/patch.js +7 -0
  20. package/actions/http/post.js +7 -0
  21. package/actions/http/put.js +7 -0
  22. package/actions/panels/scrollTo.js +18 -0
  23. package/actions/panels/scrollToBottom.js +11 -0
  24. package/actions/runMultiple.js +11 -0
  25. package/actions/sheets/select.js +5 -0
  26. package/actions/snackbars/alert.js +15 -0
  27. package/actions/snackbars/select.js +5 -0
  28. package/actions/timeouts/set.js +20 -0
  29. package/actions/windows/close.js +13 -0
  30. package/actions/windows/closeAll.js +16 -0
  31. package/actions/windows/closeWithReload.js +18 -0
  32. package/actions/windows/open.js +5 -0
  33. package/actions/windows/openWeb.js +5 -0
  34. package/actions/windows/refreshState.js +5 -0
  35. package/actions/windows/reload.js +24 -0
  36. package/actions/ws/push.js +35 -0
  37. package/app.vue +180 -0
  38. package/components/_button.vue +101 -0
  39. package/components/_dropdownMenu.vue +76 -0
  40. package/components/_icon.vue +50 -0
  41. package/components/_message.vue +25 -0
  42. package/components/avatar.vue +16 -0
  43. package/components/banners/alert.vue +49 -0
  44. package/components/banners/select.vue +82 -0
  45. package/components/button.vue +13 -0
  46. package/components/calendar.vue +105 -0
  47. package/components/charts/column.vue +26 -0
  48. package/components/charts/line.vue +61 -0
  49. package/components/chip.vue +24 -0
  50. package/components/component.vue +222 -0
  51. package/components/datetime.vue +54 -0
  52. package/components/fab.vue +33 -0
  53. package/components/fields/_patternText.vue +61 -0
  54. package/components/fields/_select.vue +86 -0
  55. package/components/fields/autocomplete.vue +73 -0
  56. package/components/fields/check.vue +104 -0
  57. package/components/fields/checkGroup.vue +51 -0
  58. package/components/fields/country/countries.js +251 -0
  59. package/components/fields/country/field.vue +81 -0
  60. package/components/fields/country/regions.js +12 -0
  61. package/components/fields/creditCard.vue +105 -0
  62. package/components/fields/date.vue +24 -0
  63. package/components/fields/datetime.vue +49 -0
  64. package/components/fields/dynamicGroup.vue +106 -0
  65. package/components/fields/dynamicSelect.vue +173 -0
  66. package/components/fields/file.vue +166 -0
  67. package/components/fields/googlePlace.vue +158 -0
  68. package/components/fields/hidden.vue +18 -0
  69. package/components/fields/location.vue +223 -0
  70. package/components/fields/newRichText.vue +191 -0
  71. package/components/fields/phone/countries.js +315 -0
  72. package/components/fields/phone/field.vue +348 -0
  73. package/components/fields/phone/sprite.css +1071 -0
  74. package/components/fields/radio.vue +64 -0
  75. package/components/fields/radioGroup.vue +93 -0
  76. package/components/fields/rating.vue +26 -0
  77. package/components/fields/richText.vue +172 -0
  78. package/components/fields/select.vue +17 -0
  79. package/components/fields/stripe/stripeFields.vue +93 -0
  80. package/components/fields/stripe/stripeIndividualFields.vue +207 -0
  81. package/components/fields/stripeExternalAccount.vue +135 -0
  82. package/components/fields/stripeToken.vue +59 -0
  83. package/components/fields/submit.vue +23 -0
  84. package/components/fields/text.vue +144 -0
  85. package/components/fields/textarea.vue +59 -0
  86. package/components/fields/timeZone.vue +22 -0
  87. package/components/fields/timer.vue +83 -0
  88. package/components/h1.vue +28 -0
  89. package/components/h2.vue +20 -0
  90. package/components/h3.vue +22 -0
  91. package/components/h4.vue +20 -0
  92. package/components/h5.vue +20 -0
  93. package/components/h6.vue +20 -0
  94. package/components/hr.vue +13 -0
  95. package/components/html.vue +13 -0
  96. package/components/icon.vue +25 -0
  97. package/components/image.vue +87 -0
  98. package/components/label.vue +62 -0
  99. package/components/map.vue +206 -0
  100. package/components/markdown.vue +52 -0
  101. package/components/mixins/events.js +178 -0
  102. package/components/mixins/generic.js +58 -0
  103. package/components/mixins/list/autoload.js +144 -0
  104. package/components/mixins/longClick.js +56 -0
  105. package/components/mixins/scrolling.js +35 -0
  106. package/components/mixins/styles.js +221 -0
  107. package/components/mixins/table/autoload.js +131 -0
  108. package/components/mixins/table/export.js +52 -0
  109. package/components/mixins/table/import.js +106 -0
  110. package/components/mixins/text.js +20 -0
  111. package/components/mixins/ws/actionCable.js +48 -0
  112. package/components/mixins/ws/phoenixSocket.js +117 -0
  113. package/components/p.vue +36 -0
  114. package/components/panels/carousel.vue +55 -0
  115. package/components/panels/column.vue +117 -0
  116. package/components/panels/custom.vue +52 -0
  117. package/components/panels/flow.vue +81 -0
  118. package/components/panels/form.vue +126 -0
  119. package/components/panels/horizontal.vue +73 -0
  120. package/components/panels/list.vue +241 -0
  121. package/components/panels/responsive.vue +88 -0
  122. package/components/panels/scroll.vue +68 -0
  123. package/components/panels/split.vue +52 -0
  124. package/components/panels/table.vue +234 -0
  125. package/components/panels/ul.vue +34 -0
  126. package/components/panels/vertical.vue +71 -0
  127. package/components/panels/web.vue +11 -0
  128. package/components/spacer.vue +11 -0
  129. package/components/switch.vue +42 -0
  130. package/components/tabBar.vue +44 -0
  131. package/extensions/array.js +20 -0
  132. package/extensions/string.js +21 -0
  133. package/index.js +195 -0
  134. package/keys.js +12 -0
  135. package/nav/appbar.vue +117 -0
  136. package/nav/content.vue +40 -0
  137. package/nav/dialog.vue +127 -0
  138. package/nav/drawer.vue +88 -0
  139. package/nav/drawerButton.vue +28 -0
  140. package/nav/drawerLabel.vue +21 -0
  141. package/nav/sheet.vue +57 -0
  142. package/nav/snackbar.vue +72 -0
  143. package/package.json +42 -0
  144. package/settings.json.example +21 -0
  145. package/static/plugins/alignment/alignment.js +76 -0
  146. package/static/plugins/alignment/alignment.min.js +1 -0
  147. package/static/plugins/beyondgrammar/beyondgrammar.js +46 -0
  148. package/static/plugins/beyondgrammar/beyondgrammar.min.js +1 -0
  149. package/static/plugins/blockcode/blockcode.js +110 -0
  150. package/static/plugins/blockcode/blockcode.min.js +1 -0
  151. package/static/plugins/clips/clips.js +44 -0
  152. package/static/plugins/clips/clips.min.js +1 -0
  153. package/static/plugins/counter/counter.js +60 -0
  154. package/static/plugins/counter/counter.min.js +1 -0
  155. package/static/plugins/definedlinks/definedlinks.js +64 -0
  156. package/static/plugins/definedlinks/definedlinks.min.js +1 -0
  157. package/static/plugins/handle/handle.js +173 -0
  158. package/static/plugins/handle/handle.min.js +1 -0
  159. package/static/plugins/icons/icons.js +72 -0
  160. package/static/plugins/icons/icons.min.js +1 -0
  161. package/static/plugins/imageposition/imageposition.js +85 -0
  162. package/static/plugins/imageposition/imageposition.min.js +1 -0
  163. package/static/plugins/inlineformat/inlineformat.js +85 -0
  164. package/static/plugins/inlineformat/inlineformat.min.js +1 -0
  165. package/static/plugins/removeformat/removeformat.js +28 -0
  166. package/static/plugins/removeformat/removeformat.min.js +1 -0
  167. package/static/plugins/selector/selector.js +96 -0
  168. package/static/plugins/selector/selector.min.js +1 -0
  169. package/static/plugins/specialchars/specialchars.js +63 -0
  170. package/static/plugins/specialchars/specialchars.min.js +1 -0
  171. package/static/plugins/textdirection/textdirection.js +55 -0
  172. package/static/plugins/textdirection/textdirection.min.js +1 -0
  173. package/static/plugins/textexpander/textexpander.js +46 -0
  174. package/static/plugins/textexpander/textexpander.min.js +1 -0
  175. package/static/plugins/underline/underline.js +27 -0
  176. package/static/plugins/underline/underline.min.js +1 -0
  177. package/static/redactorx.css +1344 -0
  178. package/static/redactorx.js +14254 -0
  179. package/static/redactorx.min.css +1 -0
  180. package/static/redactorx.min.js +1 -0
  181. package/static/redactorx.usm.min.js +2 -0
  182. package/styles/test.sass +3 -0
  183. package/styles/test.scss +5 -0
  184. package/templates/_menu.vue +38 -0
  185. package/templates/comment.vue +202 -0
  186. package/templates/featured.vue +32 -0
  187. package/templates/thumbnail.vue +138 -0
  188. package/templates/unsupported.vue +12 -0
  189. package/utils/app.js +14 -0
  190. package/utils/dom.js +13 -0
  191. package/utils/form.js +34 -0
  192. package/utils/format.js +14 -0
  193. package/utils/hash.js +29 -0
  194. package/utils/helper.js +44 -0
  195. package/utils/history.js +70 -0
  196. package/utils/http.js +209 -0
  197. package/utils/launch.js +135 -0
  198. package/utils/private/ws.js +22 -0
  199. package/utils/public.js +23 -0
  200. package/utils/settings.js +48 -0
  201. package/utils/storage.js +9 -0
  202. package/utils/type.js +69 -0
  203. package/utils/uploader.js +121 -0
  204. package/utils/url.js +132 -0
package/nav/appbar.vue ADDED
@@ -0,0 +1,117 @@
1
+ <template>
2
+ <div>
3
+ <nav-drawer
4
+ v-if="page.leftDrawer"
5
+ :trigger="drawerTrigger"
6
+ :permanent="isPermanent"
7
+ :spec="page.leftDrawer"
8
+ />
9
+
10
+ <v-toolbar :style="style" class="pages-navBar">
11
+ <v-app-bar-nav-icon
12
+ v-if="page.leftDrawer && !isPermanent"
13
+ style="color: inherit;"
14
+ @click="drawerTrigger = new Date()"
15
+ ></v-app-bar-nav-icon>
16
+ <v-progress-circular
17
+ v-if="$root.vueApp.indicator"
18
+ indeterminate
19
+ ></v-progress-circular>
20
+ <v-toolbar-title v-else>{{ page.title }}</v-toolbar-title>
21
+ <v-spacer></v-spacer>
22
+
23
+ <template v-for="(btn, index) in navBar.rightButtons">
24
+ <common-dropdownMenu
25
+ v-if="btn.childButtons"
26
+ :key="index"
27
+ :spec="btn"
28
+ :disabled="$isBusy"
29
+ />
30
+ <common-button
31
+ v-else
32
+ :key="`right_${index}`"
33
+ :spec="buttonSpec(btn)"
34
+ :disabled="$isBusy"
35
+ />
36
+ </template>
37
+
38
+ <v-btn
39
+ v-if="viewSourceEnabled()"
40
+ icon
41
+ style="color: inherit;"
42
+ @click="viewSource"
43
+ >
44
+ <v-icon>zoom_in</v-icon>
45
+ </v-btn>
46
+ </v-toolbar>
47
+ </div>
48
+ </template>
49
+
50
+ <script>
51
+ import NavDrawer from "./drawer";
52
+ import Launch from "../utils/launch";
53
+
54
+ export default {
55
+ components: {
56
+ "nav-drawer": NavDrawer
57
+ },
58
+ props: {
59
+ page: { type: Object, required: true }
60
+ },
61
+ data: function() {
62
+ return {
63
+ drawerTrigger: null,
64
+ navBar: {},
65
+ on: false
66
+ };
67
+ },
68
+ computed: {
69
+ style: function() {
70
+ return Object.assign(this.genericStyles(this.navBar), this.leftPadding);
71
+ },
72
+ // We could've used the `app` attribute on `v-toolbar` if it didn't conflict with our header-footer css.
73
+ leftPadding: function() {
74
+ switch (this.$vuetify.breakpoint.name) {
75
+ case "lg":
76
+ case "xl":
77
+ return { "padding-left": "270px" };
78
+ default:
79
+ return null;
80
+ }
81
+ },
82
+ isPermanent() {
83
+ return this.leftPadding !== null;
84
+ }
85
+ },
86
+ methods: {
87
+ $ready() {
88
+ this.navBar = this.page.navBar || {};
89
+ },
90
+ buttonSpec(item) {
91
+ return Object.assign({}, item, {
92
+ view: "button-v1",
93
+ styleClasses: item.text ? ["text"] : ["icon"]
94
+ });
95
+ },
96
+ viewSourceEnabled: function() {
97
+ // return process.env.NODE_ENV === "development";
98
+ return false;
99
+ },
100
+ viewSource: function() {
101
+ const properties = { message: this.page };
102
+ Launch.dialog(Object.assign({}, properties));
103
+ }
104
+ }
105
+ };
106
+ </script>
107
+
108
+ <style lang="scss" scoped>
109
+ .v-btn.views-button {
110
+ &.icon {
111
+ color: inherit;
112
+ }
113
+ &.text {
114
+ color: inherit;
115
+ }
116
+ }
117
+ </style>
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <v-main :style="outerStyle()">
3
+ <panels-responsive v-if="template == 'fullWidth'" :spec="spec" />
4
+ <v-col v-else cols="12" md="8" offset-md="2" :style="innerStyle()">
5
+ <template v-if="spec">
6
+ <panels-responsive v-if="template == 'flatCentered'" :spec="spec" />
7
+ <v-card v-else :height="$length(spec.height)">
8
+ <panels-responsive :spec="spec" />
9
+ </v-card>
10
+ </template>
11
+ </v-col>
12
+ </v-main>
13
+ </template>
14
+
15
+ <script>
16
+ export default {
17
+ props: {
18
+ spec: { type: Object, required: true },
19
+ template: { type: String, default: null },
20
+ fullHeight: { type: Boolean, required: true }
21
+ },
22
+ methods: {
23
+ outerStyle() {
24
+ if (this.fullHeight) {
25
+ return { height: "100%" };
26
+ }
27
+ return {};
28
+ },
29
+ innerStyle() {
30
+ const style = { padding: "0" };
31
+ if (this.fullHeight) {
32
+ return Object.assign(style, { height: "100%" });
33
+ }
34
+ return style;
35
+ }
36
+ }
37
+ };
38
+ </script>
39
+
40
+ <style scoped></style>
package/nav/dialog.vue ADDED
@@ -0,0 +1,127 @@
1
+ <template>
2
+ <v-dialog
3
+ v-model="model"
4
+ width="600"
5
+ :dark="false"
6
+ :sm-and-down="false"
7
+ :persistent="true"
8
+ >
9
+ <v-card>
10
+ <v-card-title v-if="title || showClose" class="headline" primary-title>
11
+ {{ title }}
12
+ <v-btn v-if="showClose" text icon class="dialog-close" @click="close">
13
+ <v-icon>close</v-icon>
14
+ </v-btn>
15
+ </v-card-title>
16
+
17
+ <div>
18
+ <div v-if="message" class="dialog-message">
19
+ <common-message :spec="spec" />
20
+ </div>
21
+ <panels-responsive v-if="body" :spec="body" />
22
+ </div>
23
+
24
+ <v-divider></v-divider>
25
+
26
+ <v-card-actions v-if="spec.buttons">
27
+ <v-spacer></v-spacer>
28
+
29
+ <v-btn
30
+ v-for="(button, index) in spec.buttons"
31
+ :key="index"
32
+ color="primary"
33
+ text
34
+ @click="click(button, $event)"
35
+ >
36
+ {{ button.text }}
37
+ </v-btn>
38
+
39
+ <panels-responsive v-if="footer" :spec="footer" />
40
+ </v-card-actions>
41
+ </v-card>
42
+ </v-dialog>
43
+ </template>
44
+
45
+ <script>
46
+ import Http from "../utils/http";
47
+ import Action from "../action";
48
+
49
+ export default {
50
+ props: {
51
+ spec: { type: Object, required: true },
52
+ stack: { type: Array, required: true },
53
+ vueApp: { type: Object, required: true }
54
+ },
55
+ data: function() {
56
+ return {
57
+ title: null,
58
+ message: null,
59
+ body: null,
60
+ footer: null,
61
+ model: null,
62
+ url: this.spec.url,
63
+ showClose: Utils.type.isString(this.spec.url)
64
+ };
65
+ },
66
+ watch: {
67
+ model: function(val, oldVal) {
68
+ if (!val) {
69
+ this.$destroy();
70
+ }
71
+ }
72
+ },
73
+ methods: {
74
+ $ready() {
75
+ this.$root.vueApp = this.vueApp;
76
+
77
+ const spec = this.spec;
78
+ if (Utils.type.isString(this.url)) {
79
+ this.message = "Loading...";
80
+ const url = Utils.url.appendParams(this.url, { _dialog: "v1" });
81
+ Http.execute({ url: url }, "GET", this, response => {
82
+ this.title = response.title;
83
+ this.message = "";
84
+ this.body = response.body;
85
+ this.footer = response.footer;
86
+ this.showClose = false;
87
+ });
88
+ } else {
89
+ this.title = this.spec.title;
90
+ this.message = this.spec.message;
91
+ this.body = this.spec.body;
92
+ Action.execute(spec.onLoad, null, this);
93
+ }
94
+
95
+ this.stack.push(this);
96
+ this.model = true;
97
+ },
98
+ $tearDown() {
99
+ console.log("Dialog destroyed");
100
+ this.stack.remove(this);
101
+ },
102
+ close() {
103
+ this.model = false;
104
+ },
105
+ click(spec, event) {
106
+ const onClick = spec["onClick"];
107
+ this.model = false;
108
+ Action.execute(onClick, event.target, this);
109
+ }
110
+ }
111
+ };
112
+ </script>
113
+
114
+ <style scoped>
115
+ .dialog-message {
116
+ padding: 16px 16px 20px 16px;
117
+ /* white-space: pre-wrap; */
118
+ }
119
+ .dialog-close {
120
+ right: 16px;
121
+ top: 12px;
122
+ position: absolute;
123
+ }
124
+ .v-card__text {
125
+ padding: 0 !important;
126
+ }
127
+ </style>
package/nav/drawer.vue ADDED
@@ -0,0 +1,88 @@
1
+ <template>
2
+ <!-- <v-navigation-drawer app fixed v-model="state" @input="updateState"> -->
3
+ <!-- <v-navigation-drawer mini-variant app v-model="state" @input="updateState"> -->
4
+
5
+ <v-navigation-drawer
6
+ v-model="state"
7
+ app
8
+ :class="cssClasses"
9
+ :dark="cssClasses.includes('dark')"
10
+ :expand-on-hover="cssClasses.includes('mini')"
11
+ :permanent="cssClasses.includes('permanent')"
12
+ :style="style"
13
+ @input="updateState"
14
+ >
15
+ <template v-if="spec.header">
16
+ <!-- <v-toolbar flat> -->
17
+ <panels-responsive :spec="spec.header" />
18
+ <!-- </v-toolbar> -->
19
+ <v-divider></v-divider>
20
+ </template>
21
+
22
+ <v-list dense class="pt-0">
23
+ <div v-for="(item, index) in spec.rows" :key="index">
24
+ <v-divider v-if="item.type == 'divider'" />
25
+ <nav-drawerLabel v-else-if="item.type == 'label'" :spec="item" />
26
+ <nav-drawerButton v-else :spec="item" />
27
+ <!-- <nav-drawerButton :spec="item" :state="state" v-else /> -->
28
+ </div>
29
+ </v-list>
30
+ </v-navigation-drawer>
31
+ </template>
32
+
33
+ <script>
34
+ // import UrlUtils from "../utils/url";
35
+ import NavDrawerButton from "./drawerButton";
36
+ import NavDrawerLabel from "./drawerLabel";
37
+
38
+ export default {
39
+ components: {
40
+ "nav-drawerButton": NavDrawerButton,
41
+ "nav-drawerLabel": NavDrawerLabel
42
+ },
43
+ // props: ["spec", "trigger", "permanent"],
44
+ props: {
45
+ spec: { type: Object, required: true },
46
+ trigger: { type: Object, default: null },
47
+ permanent: { type: Boolean, required: true }
48
+ },
49
+ data: function() {
50
+ return {
51
+ // Using null as the starting value for its v-model will initialize the drawer as closed on mobile and as open on desktop.
52
+ // See https://vuetifyjs.com/en/components/navigation-drawers
53
+ state: null
54
+ };
55
+ },
56
+ computed: {
57
+ cssClasses() {
58
+ // To make sure a css class name is assigned to this component
59
+ this.spec.view = this.spec.view || "pages/leftDrawer";
60
+ return this.$classes();
61
+ },
62
+ style() {
63
+ // Increase z-index so that the drawer is above the page header.
64
+ return { zIndex: 11 };
65
+ }
66
+ },
67
+ watch: {
68
+ trigger: function(val, oldVal) {
69
+ this.state = !this.state;
70
+ }
71
+ },
72
+ methods: {
73
+ $ready() {
74
+ // this.$el.addEventListener('drawers/clickButton', () => { this.updateState(false) }, false)
75
+ this.$el.addEventListener("drawers/clickButton", () => {
76
+ if (!this.permanent) {
77
+ this.updateState(false);
78
+ }
79
+ });
80
+ },
81
+ updateState(state) {
82
+ this.state = state;
83
+ }
84
+ }
85
+ };
86
+ </script>
87
+
88
+ <style scoped></style>
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <v-list-item :href="$href(spec)" @click="performAction($event)">
3
+ <v-list-item-action v-if="spec.icon">
4
+ <common-icon :spec="spec.icon" />
5
+ </v-list-item-action>
6
+
7
+ <v-list-item-content>
8
+ <v-list-item-title>{{ spec.text }}</v-list-item-title>
9
+ </v-list-item-content>
10
+ </v-list-item>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ props: {
16
+ spec: { type: Object, required: true }
17
+ },
18
+ methods: {
19
+ performAction(event) {
20
+ // this.$el.dispatchEvent(new Event("drawers/clickButton", { bubbles: true }))
21
+ this.$dispatchEvent("drawers/clickButton", {});
22
+ this.$onClick(event);
23
+ }
24
+ }
25
+ };
26
+ </script>
27
+
28
+ <style scoped></style>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <v-list-item>
3
+ <v-list-item-content>
4
+ <v-list-item-title>{{ spec.text }}</v-list-item-title>
5
+ </v-list-item-content>
6
+ </v-list-item>
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ props: {
12
+ spec: { type: Object, required: true }
13
+ }
14
+ };
15
+ </script>
16
+
17
+ <style scoped>
18
+ .v-list__tile__title {
19
+ opacity: 0.6;
20
+ }
21
+ </style>
package/nav/sheet.vue ADDED
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <v-bottom-sheet v-model="model" inset>
3
+ <v-list>
4
+ <v-subheader v-if="spec.message">{{ spec.message }}</v-subheader>
5
+ <template v-for="(button, index) of spec.buttons">
6
+ <v-list-item
7
+ :key="index"
8
+ color="primary"
9
+ @click="onClick(button, $event)"
10
+ >
11
+ <v-list-item-action v-if="button.icon">
12
+ <common-icon :spec="button.icon" />
13
+ </v-list-item-action>
14
+
15
+ <v-list-item-content>
16
+ <v-list-item-title>{{ button.text }}</v-list-item-title>
17
+ </v-list-item-content>
18
+ <!-- <v-list-item-title>{{ button.text }}</v-list-item-title> -->
19
+ </v-list-item>
20
+ </template>
21
+ </v-list>
22
+
23
+ <v-sheet height="60px"></v-sheet>
24
+ </v-bottom-sheet>
25
+ </template>
26
+
27
+ <script>
28
+ export default {
29
+ props: {
30
+ spec: { type: Object, required: true }
31
+ },
32
+ data: function() {
33
+ return {
34
+ model: null
35
+ };
36
+ },
37
+ watch: {
38
+ model: function(val, oldVal) {
39
+ if (!val) {
40
+ this.$destroy();
41
+ }
42
+ }
43
+ },
44
+ methods: {
45
+ $ready() {
46
+ this.model = true;
47
+ },
48
+ onClick: function(spec, event) {
49
+ this.model = false;
50
+
51
+ Utils.type.ifFunction(spec.onClickFunction, f => f());
52
+ GLib.action.execute(spec.onClick, event.target, this);
53
+ // this.$onClick(spec, event.target, this);
54
+ }
55
+ }
56
+ };
57
+ </script>
@@ -0,0 +1,72 @@
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
+ >
11
+ <common-message :spec="spec" />
12
+
13
+ <v-btn
14
+ v-for="(button, index) in spec.buttons"
15
+ :key="index"
16
+ text
17
+ @click="click(button, $event)"
18
+ >
19
+ {{ button.text }}
20
+ </v-btn>
21
+
22
+ <!-- <v-btn
23
+ flat
24
+ @click="close"
25
+ >
26
+ Close
27
+ </v-btn> -->
28
+ </v-snackbar>
29
+ </template>
30
+
31
+ <script>
32
+ export default {
33
+ props: {
34
+ spec: { type: Object, required: true },
35
+ vueApp: { type: Object, required: true }
36
+ },
37
+ data: function() {
38
+ return {
39
+ show: false,
40
+ color: null,
41
+ indicator: false
42
+ };
43
+ },
44
+ watch: {
45
+ "vueApp.indicator": function(val, oldVal) {
46
+ if (this.indicator) {
47
+ this.show = val;
48
+ }
49
+ }
50
+ },
51
+ methods: {
52
+ $ready() {
53
+ const vm = this;
54
+ this.$type.ifArray(this.spec.styleClasses, val => {
55
+ ["success", "info", "error", "warning"].forEach(color => {
56
+ if (val.includes(color)) {
57
+ vm.color = vm.$vuetify.theme.currentTheme[color];
58
+ }
59
+ });
60
+ });
61
+ },
62
+ click: function(spec) {
63
+ const onClick = spec["onClick"];
64
+ this.show = false;
65
+ // Action.execute(onClick, event.target, this);
66
+ GLib.action.execute(onClick, null, this);
67
+ }
68
+ }
69
+ };
70
+ </script>
71
+
72
+ <style scoped></style>
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "glib-web",
3
+ "version": "0.5.77",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "@mdi/font": "^4.5.95",
13
+ "@rails/actioncable": "^6.0.0",
14
+ "@rails/activestorage": "^6.0.0-alpha",
15
+ "awesome-phonenumber": "2.15.0",
16
+ "chart.js": "^2.8.0",
17
+ "json-logic-js": "^1.2.2",
18
+ "marked": "^0.7.0",
19
+ "phoenix": "^1.5.3",
20
+ "push.js": "^1.0.12",
21
+ "sass": "^1.23.6",
22
+ "sass-loader": "^8.0.0",
23
+ "vue": "2.6.10",
24
+ "vue-chartkick": "^0.5.2",
25
+ "vue-gtag": "^1.1.2",
26
+ "vue-youtube": "^1.4.0",
27
+ "vue2-editor": "^2.9.1",
28
+ "vue2-google-maps": "^0.10.6",
29
+ "vuedraggable": "^2.24.1",
30
+ "vuetify": "2.3.9"
31
+ },
32
+ "devDependencies": {
33
+ "babel-eslint": "^10.0.3",
34
+ "eslint": "^6.4.0",
35
+ "eslint-config-prettier": "^6.3.0",
36
+ "eslint-loader": "^3.0.0",
37
+ "eslint-plugin-prettier": "^3.1.1",
38
+ "eslint-plugin-vue": "^5.2.3",
39
+ "eslint-plugin-vuetify": "^1.0.0-beta.3",
40
+ "prettier": "^1.18.2"
41
+ }
42
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "editor.scrollBeyondLastLine": false,
3
+ "editor.minimap.enabled": false,
4
+ "editor.tabSize": 2,
5
+ "vetur.format.defaultFormatter.js": "vscode-typescript",
6
+ "vetur.format.defaultFormatter.html": "js-beautify-html",
7
+ "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
8
+ "vetur.format.defaultFormatterOptions": {
9
+ "js-beautify-html": {
10
+ "wrap_attributes": "auto"
11
+ }
12
+ },
13
+ "eslint.validate": [
14
+ "vue",
15
+ "html",
16
+ "javascript"
17
+ ],
18
+ "editor.codeActionsOnSave": {
19
+ "source.fixAll.eslint": true
20
+ }
21
+ }
@@ -0,0 +1,76 @@
1
+ RedactorX.add('plugin', 'alignment', {
2
+ translations: {
3
+ en: {
4
+ "alignment": {
5
+ "alignment": "Alignment"
6
+ }
7
+ }
8
+ },
9
+ defaults: {
10
+ align: {
11
+ left: 'align-left',
12
+ center: 'align-center',
13
+ right: 'align-right',
14
+ justify: 'align-justify'
15
+ }
16
+ },
17
+ start: function() {
18
+ var button = {
19
+ title: '## alignment.alignment ##',
20
+ command: 'alignment.popup',
21
+ blocks: {
22
+ all: 'editable'
23
+ }
24
+ };
25
+
26
+ this.app.toolbar.add('alignment', button);
27
+ },
28
+ popup: function(params, button) {
29
+ var segments = {};
30
+ var obj = this.opts.alignment.align;
31
+ for (var key in obj) {
32
+ if (!obj[key]) continue;
33
+ segments[key] = { name: obj[key], prefix: 'align' };
34
+ }
35
+
36
+ // create
37
+ this.app.popup.create('alignment', {
38
+ setter: 'alignment.setAlign',
39
+ getter: 'alignment.getAlign',
40
+ form: {
41
+ "align": {
42
+ type: 'segment',
43
+ label: '## alignment.alignment ##',
44
+ segments: segments
45
+ }
46
+ }
47
+ });
48
+
49
+ // open
50
+ this.app.popup.open({ button: button });
51
+ },
52
+ getAlign: function() {
53
+ var obj = this.opts.alignment.align;
54
+ if (!obj) return false;
55
+
56
+ var instance = this.app.block.get();
57
+ var $block = instance.getBlock();
58
+ var value = 'left';
59
+ for (var key in obj) {
60
+ if ($block.hasClass(obj[key])) {
61
+ value = key;
62
+ }
63
+ }
64
+
65
+ return { 'align': value };
66
+ },
67
+ setAlign: function(popup) {
68
+ this.app.popup.close();
69
+
70
+ // get data
71
+ var data = popup.getData();
72
+ var instance = this.app.block.get();
73
+
74
+ instance.setClassFromObj(this.opts.alignment.align, data.align);
75
+ }
76
+ });
@@ -0,0 +1 @@
1
+ RedactorX.add("plugin","alignment",{translations:{en:{alignment:{alignment:"Alignment"}}},defaults:{align:{left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"}},start:function(){this.app.toolbar.add("alignment",{title:"## alignment.alignment ##",command:"alignment.popup",blocks:{all:"editable"}})},popup:function(t,n){var a={},i=this.opts.alignment.align;for(var e in i)i[e]&&(a[e]={name:i[e],prefix:"align"});this.app.popup.create("alignment",{setter:"alignment.setAlign",getter:"alignment.getAlign",form:{align:{type:"segment",label:"## alignment.alignment ##",segments:a}}}),this.app.popup.open({button:n})},getAlign:function(){var t=this.opts.alignment.align;if(!t)return!1;var n=this.app.block.get().getBlock(),a="left";for(var i in t)n.hasClass(t[i])&&(a=i);return{align:a}},setAlign:function(t){this.app.popup.close();var n=t.getData();this.app.block.get().setClassFromObj(this.opts.alignment.align,n.align)}});