glib-web 0.5.77 → 0.5.78
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.
- package/README.md +0 -0
- package/action.js +167 -167
- package/actions/analytics/logEvent.js +0 -0
- package/actions/cables/push.js +0 -0
- package/actions/dialogs/notification.js +0 -0
- package/actions/http/patch.js +0 -0
- package/actions/panels/scrollTo.js +18 -18
- package/actions/panels/scrollToBottom.js +0 -0
- package/actions/timeouts/set.js +20 -20
- package/actions/windows/close.js +0 -0
- package/actions/windows/closeAll.js +0 -0
- package/actions/windows/closeWithReload.js +0 -0
- package/actions/windows/refreshState.js +5 -5
- package/actions/windows/reload.js +0 -0
- package/actions/ws/push.js +0 -0
- package/app.vue +180 -180
- package/components/_button.vue +101 -101
- package/components/_dropdownMenu.vue +76 -76
- package/components/_icon.vue +50 -50
- package/components/avatar.vue +16 -16
- package/components/banners/alert.vue +0 -0
- package/components/banners/select.vue +82 -82
- package/components/component.vue +222 -222
- package/components/fields/_patternText.vue +61 -61
- package/components/fields/_select.vue +86 -86
- package/components/fields/autocomplete.vue +73 -73
- package/components/fields/check.vue +104 -104
- package/components/fields/creditCard.vue +0 -0
- package/components/fields/dynamicGroup.vue +0 -0
- package/components/fields/hidden.vue +0 -0
- package/components/fields/location.vue +0 -0
- package/components/fields/newRichText.vue +0 -0
- package/components/fields/phone/countries.js +315 -315
- package/components/fields/phone/field.vue +348 -348
- package/components/fields/phone/sprite.css +1071 -1071
- package/components/fields/radio.vue +64 -64
- package/components/fields/radioGroup.vue +0 -0
- package/components/fields/rating.vue +0 -0
- package/components/fields/richText.vue +0 -0
- package/components/fields/select.vue +17 -17
- package/components/fields/stripe/stripeFields.vue +93 -93
- package/components/fields/stripe/stripeIndividualFields.vue +207 -207
- package/components/fields/stripeExternalAccount.vue +135 -135
- package/components/fields/text.vue +0 -0
- package/components/fields/textarea.vue +0 -0
- package/components/fields/timeZone.vue +22 -22
- package/components/fields/timer.vue +83 -83
- package/components/h1.vue +28 -28
- package/components/h2.vue +20 -20
- package/components/h3.vue +22 -22
- package/components/h4.vue +20 -20
- package/components/h5.vue +20 -20
- package/components/h6.vue +20 -20
- package/components/icon.vue +25 -25
- package/components/label.vue +62 -62
- package/components/map.vue +0 -0
- package/components/mixins/events.js +178 -178
- package/components/mixins/generic.js +0 -0
- package/components/mixins/list/autoload.js +0 -0
- package/components/mixins/styles.js +221 -221
- package/components/mixins/table/autoload.js +0 -0
- package/components/mixins/text.js +20 -20
- package/components/mixins/ws/actionCable.js +48 -48
- package/components/mixins/ws/phoenixSocket.js +0 -0
- package/components/panels/carousel.vue +55 -55
- package/components/panels/flow.vue +81 -81
- package/components/panels/form.vue +126 -126
- package/components/panels/list.vue +0 -0
- package/components/panels/scroll.vue +0 -0
- package/components/panels/table.vue +0 -0
- package/components/panels/ul.vue +34 -34
- package/components/panels/vertical.vue +0 -0
- package/components/panels/web.vue +11 -11
- package/components/spacer.vue +0 -0
- package/components/switch.vue +42 -42
- package/extensions/string.js +21 -21
- package/index.js +195 -195
- package/nav/content.vue +0 -0
- package/nav/dialog.vue +127 -127
- package/nav/snackbar.vue +0 -0
- package/package.json +42 -42
- package/static/plugins/alignment/alignment.js +0 -0
- package/static/plugins/alignment/alignment.min.js +0 -0
- package/static/plugins/beyondgrammar/beyondgrammar.js +0 -0
- package/static/plugins/beyondgrammar/beyondgrammar.min.js +0 -0
- package/static/plugins/blockcode/blockcode.js +0 -0
- package/static/plugins/blockcode/blockcode.min.js +0 -0
- package/static/plugins/clips/clips.js +0 -0
- package/static/plugins/clips/clips.min.js +0 -0
- package/static/plugins/counter/counter.js +0 -0
- package/static/plugins/counter/counter.min.js +0 -0
- package/static/plugins/definedlinks/definedlinks.js +0 -0
- package/static/plugins/definedlinks/definedlinks.min.js +0 -0
- package/static/plugins/handle/handle.js +0 -0
- package/static/plugins/handle/handle.min.js +0 -0
- package/static/plugins/icons/icons.js +0 -0
- package/static/plugins/icons/icons.min.js +0 -0
- package/static/plugins/imageposition/imageposition.js +0 -0
- package/static/plugins/imageposition/imageposition.min.js +0 -0
- package/static/plugins/inlineformat/inlineformat.js +0 -0
- package/static/plugins/inlineformat/inlineformat.min.js +0 -0
- package/static/plugins/removeformat/removeformat.js +0 -0
- package/static/plugins/removeformat/removeformat.min.js +0 -0
- package/static/plugins/selector/selector.js +0 -0
- package/static/plugins/selector/selector.min.js +0 -0
- package/static/plugins/specialchars/specialchars.js +0 -0
- package/static/plugins/specialchars/specialchars.min.js +0 -0
- package/static/plugins/textdirection/textdirection.js +0 -0
- package/static/plugins/textdirection/textdirection.min.js +0 -0
- package/static/plugins/textexpander/textexpander.js +0 -0
- package/static/plugins/textexpander/textexpander.min.js +0 -0
- package/static/plugins/underline/underline.js +0 -0
- package/static/plugins/underline/underline.min.js +0 -0
- package/static/redactorx.css +0 -0
- package/static/redactorx.js +0 -0
- package/static/redactorx.min.css +0 -0
- package/static/redactorx.min.js +0 -0
- package/static/redactorx.usm.min.js +0 -0
- package/templates/_menu.vue +38 -38
- package/templates/comment.vue +202 -202
- package/templates/featured.vue +32 -32
- package/templates/thumbnail.vue +138 -138
- package/templates/unsupported.vue +12 -12
- package/utils/app.js +0 -0
- package/utils/hash.js +0 -0
- package/utils/helper.js +0 -0
- package/utils/history.js +70 -70
- package/utils/http.js +209 -209
- package/utils/launch.js +135 -135
- package/utils/private/ws.js +0 -0
package/components/switch.vue
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="$classes()">
|
|
3
|
-
<v-switch
|
|
4
|
-
v-model="enabled"
|
|
5
|
-
:label="spec.text"
|
|
6
|
-
hide-details
|
|
7
|
-
@change="changed"
|
|
8
|
-
>
|
|
9
|
-
</v-switch>
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
export default {
|
|
15
|
-
props: {
|
|
16
|
-
spec: { type: Object, required: true }
|
|
17
|
-
},
|
|
18
|
-
data() {
|
|
19
|
-
return {
|
|
20
|
-
enabled: false
|
|
21
|
-
};
|
|
22
|
-
},
|
|
23
|
-
methods: {
|
|
24
|
-
$ready() {
|
|
25
|
-
this.enabled = this.spec.enabled;
|
|
26
|
-
},
|
|
27
|
-
changed() {
|
|
28
|
-
if (this.enabled) {
|
|
29
|
-
GLib.action.execute(this.spec.onEnabled, {}, this);
|
|
30
|
-
} else {
|
|
31
|
-
GLib.action.execute(this.spec.onDisabled, {}, this);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<style scoped>
|
|
39
|
-
.v-input--selection-controls {
|
|
40
|
-
margin-top: 0;
|
|
41
|
-
}
|
|
42
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$classes()">
|
|
3
|
+
<v-switch
|
|
4
|
+
v-model="enabled"
|
|
5
|
+
:label="spec.text"
|
|
6
|
+
hide-details
|
|
7
|
+
@change="changed"
|
|
8
|
+
>
|
|
9
|
+
</v-switch>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
export default {
|
|
15
|
+
props: {
|
|
16
|
+
spec: { type: Object, required: true }
|
|
17
|
+
},
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
enabled: false
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
methods: {
|
|
24
|
+
$ready() {
|
|
25
|
+
this.enabled = this.spec.enabled;
|
|
26
|
+
},
|
|
27
|
+
changed() {
|
|
28
|
+
if (this.enabled) {
|
|
29
|
+
GLib.action.execute(this.spec.onEnabled, {}, this);
|
|
30
|
+
} else {
|
|
31
|
+
GLib.action.execute(this.spec.onDisabled, {}, this);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style scoped>
|
|
39
|
+
.v-input--selection-controls {
|
|
40
|
+
margin-top: 0;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
package/extensions/string.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
// https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript
|
|
2
|
-
String.prototype.hashCode = function() {
|
|
3
|
-
var hash = 0,
|
|
4
|
-
i,
|
|
5
|
-
chr;
|
|
6
|
-
if (this.length === 0) return hash;
|
|
7
|
-
for (i = 0; i < this.length; i++) {
|
|
8
|
-
chr = this.charCodeAt(i);
|
|
9
|
-
hash = (hash << 5) - hash + chr;
|
|
10
|
-
hash |= 0; // Convert to 32bit integer
|
|
11
|
-
}
|
|
12
|
-
return hash;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
String.prototype.contains = function(substr) {
|
|
16
|
-
return this.indexOf(substr) > -1;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
String.prototype.presence = function() {
|
|
20
|
-
return this.length > 0 ? this.toString() : null;
|
|
21
|
-
};
|
|
1
|
+
// https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript
|
|
2
|
+
String.prototype.hashCode = function() {
|
|
3
|
+
var hash = 0,
|
|
4
|
+
i,
|
|
5
|
+
chr;
|
|
6
|
+
if (this.length === 0) return hash;
|
|
7
|
+
for (i = 0; i < this.length; i++) {
|
|
8
|
+
chr = this.charCodeAt(i);
|
|
9
|
+
hash = (hash << 5) - hash + chr;
|
|
10
|
+
hash |= 0; // Convert to 32bit integer
|
|
11
|
+
}
|
|
12
|
+
return hash;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
String.prototype.contains = function(substr) {
|
|
16
|
+
return this.indexOf(substr) > -1;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
String.prototype.presence = function() {
|
|
20
|
+
return this.length > 0 ? this.toString() : null;
|
|
21
|
+
};
|
package/index.js
CHANGED
|
@@ -1,195 +1,195 @@
|
|
|
1
|
-
import Vue from "vue";
|
|
2
|
-
export { Vue };
|
|
3
|
-
|
|
4
|
-
import App from "./app.vue";
|
|
5
|
-
|
|
6
|
-
import * as VueGoogleMaps from "vue2-google-maps";
|
|
7
|
-
Vue.use(VueGoogleMaps, {
|
|
8
|
-
load: {
|
|
9
|
-
key: process.env.GMAPS_API_KEY,
|
|
10
|
-
libraries: "places"
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
import "./styles/test.scss";
|
|
15
|
-
import "./styles/test.sass";
|
|
16
|
-
|
|
17
|
-
import Vuetify from "vuetify";
|
|
18
|
-
import "vuetify/dist/vuetify.min.css";
|
|
19
|
-
// import "material-design-icons-iconfont/dist/material-design-icons.css";
|
|
20
|
-
// import "@mdi/font/css/materialdesignicons.css";
|
|
21
|
-
Vue.use(Vuetify);
|
|
22
|
-
|
|
23
|
-
import Chartkick from "vue-chartkick";
|
|
24
|
-
import Chart from "chart.js";
|
|
25
|
-
Vue.use(Chartkick.use(Chart));
|
|
26
|
-
|
|
27
|
-
// TODO: make this opt-in
|
|
28
|
-
import VueYoutube from "vue-youtube";
|
|
29
|
-
Vue.use(VueYoutube);
|
|
30
|
-
|
|
31
|
-
// import VueAnalytics from 'vue-analytics'
|
|
32
|
-
// // TODO: Avoid hardcoding
|
|
33
|
-
// Vue.use(VueAnalytics, {
|
|
34
|
-
// id: 'UA-146876849-1'
|
|
35
|
-
// })
|
|
36
|
-
|
|
37
|
-
import "./extensions/string.js";
|
|
38
|
-
import "./extensions/array.js";
|
|
39
|
-
|
|
40
|
-
// Recursive components must be global
|
|
41
|
-
import VerticalPanel from "./components/panels/vertical";
|
|
42
|
-
import ResponsivePanel from "./components/panels/responsive";
|
|
43
|
-
import Component from "./components/component";
|
|
44
|
-
import CommonIcon from "./components/_icon";
|
|
45
|
-
import CommonButton from "./components/_button";
|
|
46
|
-
import CommonMessage from "./components/_message";
|
|
47
|
-
import CommonDropdownMenu from "./components/_dropdownMenu";
|
|
48
|
-
import CommonTemplateMenu from "./templates/_menu";
|
|
49
|
-
Vue.component("panels-vertical", VerticalPanel);
|
|
50
|
-
Vue.component("panels-responsive", ResponsivePanel);
|
|
51
|
-
Vue.component("common-button", CommonButton);
|
|
52
|
-
Vue.component("common-icon", CommonIcon);
|
|
53
|
-
Vue.component("common-message", CommonMessage);
|
|
54
|
-
Vue.component("common-dropdownMenu", CommonDropdownMenu);
|
|
55
|
-
Vue.component("templates-menu", CommonTemplateMenu);
|
|
56
|
-
|
|
57
|
-
// TODO: Deprecate
|
|
58
|
-
Vue.component("ui-component", Component);
|
|
59
|
-
|
|
60
|
-
Vue.component("glib-component", Component);
|
|
61
|
-
Vue.component("glib-icon", CommonIcon);
|
|
62
|
-
Vue.component("glib-panels-responsive", ResponsivePanel);
|
|
63
|
-
// Vue.component("glib-templates-menu", CommonTemplateMenu);
|
|
64
|
-
|
|
65
|
-
import genericMixin from "./components/mixins/generic.js";
|
|
66
|
-
Vue.mixin(genericMixin);
|
|
67
|
-
|
|
68
|
-
import eventsMixin from "./components/mixins/events.js";
|
|
69
|
-
Vue.mixin(eventsMixin);
|
|
70
|
-
|
|
71
|
-
import stylesMixin from "./components/mixins/styles.js";
|
|
72
|
-
Vue.mixin(stylesMixin);
|
|
73
|
-
|
|
74
|
-
import scrollingMixin from "./components/mixins/scrolling.js";
|
|
75
|
-
Vue.mixin(scrollingMixin);
|
|
76
|
-
|
|
77
|
-
import longClickDirective from "./components/mixins/longClick.js";
|
|
78
|
-
window.longClickInstance = longClickDirective({ delay: 500, interval: 0 });
|
|
79
|
-
Vue.directive("longclick", window.longClickInstance);
|
|
80
|
-
|
|
81
|
-
// TODO: Deprecate
|
|
82
|
-
import TypeUtils from "./utils/type";
|
|
83
|
-
Vue.use({
|
|
84
|
-
install: function(Vue, options) {
|
|
85
|
-
Vue.prototype.$type = {
|
|
86
|
-
isObject: TypeUtils.isObject,
|
|
87
|
-
isString: TypeUtils.isString,
|
|
88
|
-
isNumber: TypeUtils.isNumber,
|
|
89
|
-
isArray: TypeUtils.isArray,
|
|
90
|
-
|
|
91
|
-
ifObject: TypeUtils.ifObject,
|
|
92
|
-
ifString: TypeUtils.ifString,
|
|
93
|
-
ifNumber: TypeUtils.ifNumber,
|
|
94
|
-
ifArray: TypeUtils.ifArray
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
import Utils from "./utils/helper";
|
|
100
|
-
window.Utils = Utils;
|
|
101
|
-
|
|
102
|
-
import Framework from "./utils/public";
|
|
103
|
-
window.GLib = Framework;
|
|
104
|
-
|
|
105
|
-
import { settings } from "./utils/settings";
|
|
106
|
-
export { settings };
|
|
107
|
-
|
|
108
|
-
// TODO: https://vuejs.org/v2/guide/components-dynamic-async.html#Async-Components
|
|
109
|
-
// Vue.component('async-webpack-example', function (resolve) {
|
|
110
|
-
// // This special require syntax will instruct Webpack to
|
|
111
|
-
// // automatically split your built code into bundles which
|
|
112
|
-
// // are loaded over Ajax requests.
|
|
113
|
-
// require(['./my-async-component'], resolve)
|
|
114
|
-
// })
|
|
115
|
-
|
|
116
|
-
import VueGtag from "vue-gtag";
|
|
117
|
-
|
|
118
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
119
|
-
const gtagId = settings.gtagId;
|
|
120
|
-
if (gtagId) {
|
|
121
|
-
Vue.use(VueGtag, {
|
|
122
|
-
config: {
|
|
123
|
-
id: settings.gtagId,
|
|
124
|
-
params: {
|
|
125
|
-
send_page_view: false
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
window.vueApp = {
|
|
132
|
-
vuetify: new Vuetify({
|
|
133
|
-
icons: {
|
|
134
|
-
iconfont: "md"
|
|
135
|
-
},
|
|
136
|
-
theme: {
|
|
137
|
-
themes: Utils.settings.themes
|
|
138
|
-
},
|
|
139
|
-
breakpoint: {
|
|
140
|
-
smAndDown: true
|
|
141
|
-
}
|
|
142
|
-
}),
|
|
143
|
-
page: window.__page,
|
|
144
|
-
indicator: false,
|
|
145
|
-
// Rename to isPageStale
|
|
146
|
-
isStale: false,
|
|
147
|
-
stateUpdatedAt: null,
|
|
148
|
-
webSocket: { channels: {}, header: {} },
|
|
149
|
-
actionCable: { channels: {} },
|
|
150
|
-
temp: {}
|
|
151
|
-
};
|
|
152
|
-
new Vue({
|
|
153
|
-
el: "#app",
|
|
154
|
-
vuetify: window.vueApp.vuetify,
|
|
155
|
-
data: {
|
|
156
|
-
vueApp: window.vueApp
|
|
157
|
-
},
|
|
158
|
-
// data: {
|
|
159
|
-
// vuetify: vuetify,
|
|
160
|
-
// page: window.__page,
|
|
161
|
-
// indicator: false,
|
|
162
|
-
// isStale: false,
|
|
163
|
-
// webSocket: { channels: {}, header: {}, listWindow: null }
|
|
164
|
-
// },
|
|
165
|
-
render: function(createElement) {
|
|
166
|
-
return createElement(App, { props: { page: this.$data.vueApp.page } });
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
// The above code uses Vue without the compiler, which means you cannot
|
|
172
|
-
// use Vue to target elements in your existing html templates. You would
|
|
173
|
-
// need to always use single file components.
|
|
174
|
-
// To be able to target elements in your existing html/erb templates,
|
|
175
|
-
// comment out the above code and uncomment the below
|
|
176
|
-
// Add <%= javascript_pack_tag 'hello_vue' %> to your layout
|
|
177
|
-
// Then add this markup to your html template:
|
|
178
|
-
//
|
|
179
|
-
// <div id='hello'>
|
|
180
|
-
// {{message}}
|
|
181
|
-
// <app></app>
|
|
182
|
-
// </div>
|
|
183
|
-
|
|
184
|
-
// import Vue from 'vue/dist/vue.esm'
|
|
185
|
-
// import App from '../app.vue'
|
|
186
|
-
//
|
|
187
|
-
// document.addEventListener('DOMContentLoaded', () => {
|
|
188
|
-
// const app = new Vue({
|
|
189
|
-
// el: '#hello',
|
|
190
|
-
// data: {
|
|
191
|
-
// message: "Can you say hello?"
|
|
192
|
-
// },
|
|
193
|
-
// components: { App }
|
|
194
|
-
// })
|
|
195
|
-
// })
|
|
1
|
+
import Vue from "vue";
|
|
2
|
+
export { Vue };
|
|
3
|
+
|
|
4
|
+
import App from "./app.vue";
|
|
5
|
+
|
|
6
|
+
import * as VueGoogleMaps from "vue2-google-maps";
|
|
7
|
+
Vue.use(VueGoogleMaps, {
|
|
8
|
+
load: {
|
|
9
|
+
key: process.env.GMAPS_API_KEY,
|
|
10
|
+
libraries: "places"
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
import "./styles/test.scss";
|
|
15
|
+
import "./styles/test.sass";
|
|
16
|
+
|
|
17
|
+
import Vuetify from "vuetify";
|
|
18
|
+
import "vuetify/dist/vuetify.min.css";
|
|
19
|
+
// import "material-design-icons-iconfont/dist/material-design-icons.css";
|
|
20
|
+
// import "@mdi/font/css/materialdesignicons.css";
|
|
21
|
+
Vue.use(Vuetify);
|
|
22
|
+
|
|
23
|
+
import Chartkick from "vue-chartkick";
|
|
24
|
+
import Chart from "chart.js";
|
|
25
|
+
Vue.use(Chartkick.use(Chart));
|
|
26
|
+
|
|
27
|
+
// TODO: make this opt-in
|
|
28
|
+
import VueYoutube from "vue-youtube";
|
|
29
|
+
Vue.use(VueYoutube);
|
|
30
|
+
|
|
31
|
+
// import VueAnalytics from 'vue-analytics'
|
|
32
|
+
// // TODO: Avoid hardcoding
|
|
33
|
+
// Vue.use(VueAnalytics, {
|
|
34
|
+
// id: 'UA-146876849-1'
|
|
35
|
+
// })
|
|
36
|
+
|
|
37
|
+
import "./extensions/string.js";
|
|
38
|
+
import "./extensions/array.js";
|
|
39
|
+
|
|
40
|
+
// Recursive components must be global
|
|
41
|
+
import VerticalPanel from "./components/panels/vertical";
|
|
42
|
+
import ResponsivePanel from "./components/panels/responsive";
|
|
43
|
+
import Component from "./components/component";
|
|
44
|
+
import CommonIcon from "./components/_icon";
|
|
45
|
+
import CommonButton from "./components/_button";
|
|
46
|
+
import CommonMessage from "./components/_message";
|
|
47
|
+
import CommonDropdownMenu from "./components/_dropdownMenu";
|
|
48
|
+
import CommonTemplateMenu from "./templates/_menu";
|
|
49
|
+
Vue.component("panels-vertical", VerticalPanel);
|
|
50
|
+
Vue.component("panels-responsive", ResponsivePanel);
|
|
51
|
+
Vue.component("common-button", CommonButton);
|
|
52
|
+
Vue.component("common-icon", CommonIcon);
|
|
53
|
+
Vue.component("common-message", CommonMessage);
|
|
54
|
+
Vue.component("common-dropdownMenu", CommonDropdownMenu);
|
|
55
|
+
Vue.component("templates-menu", CommonTemplateMenu);
|
|
56
|
+
|
|
57
|
+
// TODO: Deprecate
|
|
58
|
+
Vue.component("ui-component", Component);
|
|
59
|
+
|
|
60
|
+
Vue.component("glib-component", Component);
|
|
61
|
+
Vue.component("glib-icon", CommonIcon);
|
|
62
|
+
Vue.component("glib-panels-responsive", ResponsivePanel);
|
|
63
|
+
// Vue.component("glib-templates-menu", CommonTemplateMenu);
|
|
64
|
+
|
|
65
|
+
import genericMixin from "./components/mixins/generic.js";
|
|
66
|
+
Vue.mixin(genericMixin);
|
|
67
|
+
|
|
68
|
+
import eventsMixin from "./components/mixins/events.js";
|
|
69
|
+
Vue.mixin(eventsMixin);
|
|
70
|
+
|
|
71
|
+
import stylesMixin from "./components/mixins/styles.js";
|
|
72
|
+
Vue.mixin(stylesMixin);
|
|
73
|
+
|
|
74
|
+
import scrollingMixin from "./components/mixins/scrolling.js";
|
|
75
|
+
Vue.mixin(scrollingMixin);
|
|
76
|
+
|
|
77
|
+
import longClickDirective from "./components/mixins/longClick.js";
|
|
78
|
+
window.longClickInstance = longClickDirective({ delay: 500, interval: 0 });
|
|
79
|
+
Vue.directive("longclick", window.longClickInstance);
|
|
80
|
+
|
|
81
|
+
// TODO: Deprecate
|
|
82
|
+
import TypeUtils from "./utils/type";
|
|
83
|
+
Vue.use({
|
|
84
|
+
install: function(Vue, options) {
|
|
85
|
+
Vue.prototype.$type = {
|
|
86
|
+
isObject: TypeUtils.isObject,
|
|
87
|
+
isString: TypeUtils.isString,
|
|
88
|
+
isNumber: TypeUtils.isNumber,
|
|
89
|
+
isArray: TypeUtils.isArray,
|
|
90
|
+
|
|
91
|
+
ifObject: TypeUtils.ifObject,
|
|
92
|
+
ifString: TypeUtils.ifString,
|
|
93
|
+
ifNumber: TypeUtils.ifNumber,
|
|
94
|
+
ifArray: TypeUtils.ifArray
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
import Utils from "./utils/helper";
|
|
100
|
+
window.Utils = Utils;
|
|
101
|
+
|
|
102
|
+
import Framework from "./utils/public";
|
|
103
|
+
window.GLib = Framework;
|
|
104
|
+
|
|
105
|
+
import { settings } from "./utils/settings";
|
|
106
|
+
export { settings };
|
|
107
|
+
|
|
108
|
+
// TODO: https://vuejs.org/v2/guide/components-dynamic-async.html#Async-Components
|
|
109
|
+
// Vue.component('async-webpack-example', function (resolve) {
|
|
110
|
+
// // This special require syntax will instruct Webpack to
|
|
111
|
+
// // automatically split your built code into bundles which
|
|
112
|
+
// // are loaded over Ajax requests.
|
|
113
|
+
// require(['./my-async-component'], resolve)
|
|
114
|
+
// })
|
|
115
|
+
|
|
116
|
+
import VueGtag from "vue-gtag";
|
|
117
|
+
|
|
118
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
119
|
+
const gtagId = settings.gtagId;
|
|
120
|
+
if (gtagId) {
|
|
121
|
+
Vue.use(VueGtag, {
|
|
122
|
+
config: {
|
|
123
|
+
id: settings.gtagId,
|
|
124
|
+
params: {
|
|
125
|
+
send_page_view: false
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
window.vueApp = {
|
|
132
|
+
vuetify: new Vuetify({
|
|
133
|
+
icons: {
|
|
134
|
+
iconfont: "md"
|
|
135
|
+
},
|
|
136
|
+
theme: {
|
|
137
|
+
themes: Utils.settings.themes
|
|
138
|
+
},
|
|
139
|
+
breakpoint: {
|
|
140
|
+
smAndDown: true
|
|
141
|
+
}
|
|
142
|
+
}),
|
|
143
|
+
page: window.__page,
|
|
144
|
+
indicator: false,
|
|
145
|
+
// Rename to isPageStale
|
|
146
|
+
isStale: false,
|
|
147
|
+
stateUpdatedAt: null,
|
|
148
|
+
webSocket: { channels: {}, header: {} },
|
|
149
|
+
actionCable: { channels: {} },
|
|
150
|
+
temp: {}
|
|
151
|
+
};
|
|
152
|
+
new Vue({
|
|
153
|
+
el: "#app",
|
|
154
|
+
vuetify: window.vueApp.vuetify,
|
|
155
|
+
data: {
|
|
156
|
+
vueApp: window.vueApp
|
|
157
|
+
},
|
|
158
|
+
// data: {
|
|
159
|
+
// vuetify: vuetify,
|
|
160
|
+
// page: window.__page,
|
|
161
|
+
// indicator: false,
|
|
162
|
+
// isStale: false,
|
|
163
|
+
// webSocket: { channels: {}, header: {}, listWindow: null }
|
|
164
|
+
// },
|
|
165
|
+
render: function(createElement) {
|
|
166
|
+
return createElement(App, { props: { page: this.$data.vueApp.page } });
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// The above code uses Vue without the compiler, which means you cannot
|
|
172
|
+
// use Vue to target elements in your existing html templates. You would
|
|
173
|
+
// need to always use single file components.
|
|
174
|
+
// To be able to target elements in your existing html/erb templates,
|
|
175
|
+
// comment out the above code and uncomment the below
|
|
176
|
+
// Add <%= javascript_pack_tag 'hello_vue' %> to your layout
|
|
177
|
+
// Then add this markup to your html template:
|
|
178
|
+
//
|
|
179
|
+
// <div id='hello'>
|
|
180
|
+
// {{message}}
|
|
181
|
+
// <app></app>
|
|
182
|
+
// </div>
|
|
183
|
+
|
|
184
|
+
// import Vue from 'vue/dist/vue.esm'
|
|
185
|
+
// import App from '../app.vue'
|
|
186
|
+
//
|
|
187
|
+
// document.addEventListener('DOMContentLoaded', () => {
|
|
188
|
+
// const app = new Vue({
|
|
189
|
+
// el: '#hello',
|
|
190
|
+
// data: {
|
|
191
|
+
// message: "Can you say hello?"
|
|
192
|
+
// },
|
|
193
|
+
// components: { App }
|
|
194
|
+
// })
|
|
195
|
+
// })
|
package/nav/content.vue
CHANGED
|
File without changes
|