glib-web 3.0.13 → 3.1.0
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/.eslintrc.js +33 -36
- package/LICENSE +0 -0
- package/README.md +14 -10
- package/actions/auth/restart.js +0 -0
- package/actions/dialogs/oauth.js +0 -0
- package/actions/dialogs/options.js +0 -0
- package/actions/popovers/open.js +0 -3
- package/components/_message.vue +0 -0
- package/components/_responsive.vue +1 -1
- package/components/datetime.vue +0 -0
- package/components/fab.vue +0 -0
- package/components/fields/country/countries.js +0 -0
- package/components/fields/country/regions.js +0 -0
- package/components/hr.vue +0 -0
- package/components/html.vue +0 -0
- package/components/mixins/longClick.js +0 -0
- package/components/mixins/scrolling.js +0 -0
- package/components/mixins/table/export.js +0 -0
- package/components/mixins/table/import.js +0 -0
- package/components/popover.vue +3 -2
- package/keys.js +0 -0
- package/nav/dialog.vue +6 -8
- package/package.json +3 -6
- package/settings.json.example +13 -17
- package/styles/test.sass +0 -0
- package/styles/test.scss +0 -0
- package/templates/unsupported.vue +0 -0
- package/utils/dom.js +0 -0
- package/utils/eventBus.js +3 -1
- package/utils/history.js +0 -1
- package/utils/launch.js +2 -2
- package/utils/storage.js +0 -0
- package/utils/url.js +0 -0
package/.eslintrc.js
CHANGED
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"GLib": "readonly",
|
|
36
|
-
}
|
|
37
|
-
};
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es2021": true
|
|
5
|
+
},
|
|
6
|
+
"extends": "plugin:vue/vue3-essential",
|
|
7
|
+
"overrides": [
|
|
8
|
+
{
|
|
9
|
+
"env": {
|
|
10
|
+
"node": true
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
".eslintrc.{js,cjs}"
|
|
14
|
+
],
|
|
15
|
+
"parserOptions": {
|
|
16
|
+
"sourceType": "script"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"parserOptions": {
|
|
21
|
+
"ecmaVersion": "latest",
|
|
22
|
+
"sourceType": "module"
|
|
23
|
+
},
|
|
24
|
+
"plugins": [
|
|
25
|
+
"vue"
|
|
26
|
+
],
|
|
27
|
+
"rules": {
|
|
28
|
+
"vue/multi-word-component-names": ["off"]
|
|
29
|
+
},
|
|
30
|
+
"globals": {
|
|
31
|
+
"GLib": "readonly",
|
|
32
|
+
"Utils": "readonly"
|
|
33
|
+
}
|
|
34
|
+
};
|
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
1
|
## Set up ESLint
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
|
|
3
|
+
- Install the following VSCode extensions
|
|
4
|
+
- `ESLint`
|
|
5
|
+
- `Volar`
|
|
6
|
+
- Edit settings.json
|
|
7
|
+
- `CTRL+SHIFT+P` -> `Preferences: Open User Settings (JSON)` -- This will open an editor for `settings.json`.
|
|
8
|
+
- Copy content of `settings.json.example` into the editor.
|
|
9
9
|
|
|
10
10
|
## Best practices
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
|
|
12
|
+
- To prevent circular dependencies between components:
|
|
13
|
+
- It’s okay to use dispatchEvent for upward communication (i.e. child component to ancestors). This fits with how the JS event model works as it already supports event propagation out of the box.
|
|
14
|
+
- For downward communication, don’t use any sort of event/pub-sub mechanism. Always use Vuejs data binding instead.
|
|
14
15
|
|
|
15
16
|
## Link to local npm during development
|
|
17
|
+
|
|
16
18
|
- `cd glib-web-npm`
|
|
17
19
|
- `yarn install`
|
|
18
20
|
- `yarn link`
|
|
@@ -21,10 +23,12 @@
|
|
|
21
23
|
- `bin/webpack-dev-server`
|
|
22
24
|
|
|
23
25
|
## Prepare for publishing
|
|
26
|
+
|
|
24
27
|
- Create a PR to the `master` branch
|
|
25
28
|
- After approval, merge the PR.
|
|
26
29
|
|
|
27
30
|
## Publish package to npm
|
|
31
|
+
|
|
28
32
|
- One-off login
|
|
29
33
|
- npm login --registry=https://registry.npmjs.org/glib-web
|
|
30
34
|
- Bump `version` in `package.json`
|
package/actions/auth/restart.js
CHANGED
|
File without changes
|
package/actions/dialogs/oauth.js
CHANGED
|
File without changes
|
|
File without changes
|
package/actions/popovers/open.js
CHANGED
package/components/_message.vue
CHANGED
|
File without changes
|
package/components/datetime.vue
CHANGED
|
File without changes
|
package/components/fab.vue
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/components/hr.vue
CHANGED
|
File without changes
|
package/components/html.vue
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/components/popover.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<!-- Placement options:
|
|
3
3
|
| 'top'
|
|
4
4
|
| 'top-start'
|
|
5
5
|
| 'top-end'
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
| 'left-start'
|
|
14
14
|
| 'left-end'
|
|
15
15
|
-->
|
|
16
|
-
|
|
16
|
+
<common-responsive :style="floatingStyles" v-if="toggle" :spec="spec" />
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script>
|
|
@@ -37,6 +37,7 @@ export default {
|
|
|
37
37
|
this.toggle = false;
|
|
38
38
|
})
|
|
39
39
|
document.addEventListener('click', this.handleClose)
|
|
40
|
+
window.addEventListener('resize', () => this.toggle = false)
|
|
40
41
|
},
|
|
41
42
|
handleClose(event) {
|
|
42
43
|
const isClickInside = this.$el.contains(event.target)
|
package/keys.js
CHANGED
|
File without changes
|
package/nav/dialog.vue
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
<v-dialog :model-value="model" :width="spec.width || 600" :dark="false" :fullscreen="fullscreen" :sm-and-down="false"
|
|
3
3
|
:persistent="!spec.closeOnBlur">
|
|
4
4
|
<v-card :style="hamburgerStyles" class="hamburger">
|
|
5
|
-
<!-- <v-card-title v-if="title || showClose" class="text-h5" primary-title> -->
|
|
6
5
|
|
|
7
6
|
<panels-responsive v-if="header" :spec="header" />
|
|
8
7
|
<div class="dialog-title flex flex-wrap justify-between" v-if="title">
|
|
@@ -12,7 +11,8 @@
|
|
|
12
11
|
</div>
|
|
13
12
|
|
|
14
13
|
<div class="dialogs-body relative">
|
|
15
|
-
<v-btn size="small" v-if="
|
|
14
|
+
<v-btn size="small" v-if="!disableCloseButton" text icon @click="close" class="mr-3 mt-2 close-btn"
|
|
15
|
+
style="z-index: 999;" variant="flat">
|
|
16
16
|
<v-icon>close</v-icon>
|
|
17
17
|
</v-btn>
|
|
18
18
|
<component :is="containerComponent" :spec="formSpec">
|
|
@@ -64,7 +64,7 @@ export default {
|
|
|
64
64
|
model: null,
|
|
65
65
|
url: null,
|
|
66
66
|
urlLoaded: false,
|
|
67
|
-
|
|
67
|
+
disableCloseButton: false,
|
|
68
68
|
isFormDirty: false,
|
|
69
69
|
isFormSubmitted: false,
|
|
70
70
|
isMobile: false,
|
|
@@ -138,7 +138,6 @@ export default {
|
|
|
138
138
|
},
|
|
139
139
|
reload(newSpec) {
|
|
140
140
|
if (Utils.http.proceedEvenWhenDirty()) {
|
|
141
|
-
this.spec.url = newSpec.url
|
|
142
141
|
this.urlLoaded = false;
|
|
143
142
|
this.show(true);
|
|
144
143
|
}
|
|
@@ -149,7 +148,7 @@ export default {
|
|
|
149
148
|
show(reload) {
|
|
150
149
|
const spec = this.spec;
|
|
151
150
|
this.url = spec.url;
|
|
152
|
-
this.
|
|
151
|
+
this.disableCloseButton = this.spec.disableCloseButton || Utils.type.isString(this.url);
|
|
153
152
|
|
|
154
153
|
if (Utils.type.isString(this.url)) {
|
|
155
154
|
if (!this.urlLoaded) {
|
|
@@ -158,7 +157,6 @@ export default {
|
|
|
158
157
|
}
|
|
159
158
|
const url = Utils.url.appendParams(this.url, { _dialog: "v1" });
|
|
160
159
|
Http.execute({ url: url }, "GET", this, (response) => {
|
|
161
|
-
console.log(url)
|
|
162
160
|
Utils.http.forceComponentUpdate(() => {
|
|
163
161
|
this.urlLoaded = true;
|
|
164
162
|
this.title = response.title;
|
|
@@ -167,7 +165,7 @@ export default {
|
|
|
167
165
|
this.header = response.header;
|
|
168
166
|
this.body = response.body;
|
|
169
167
|
this.footer = response.footer;
|
|
170
|
-
this.
|
|
168
|
+
this.disableCloseButton = this.spec.disableCloseButton || false;
|
|
171
169
|
|
|
172
170
|
Action.execute(response.onLoad, this);
|
|
173
171
|
});
|
|
@@ -177,7 +175,7 @@ export default {
|
|
|
177
175
|
this.title = this.spec.title;
|
|
178
176
|
this.message = this.spec.message;
|
|
179
177
|
this.body = this.spec.body;
|
|
180
|
-
this.
|
|
178
|
+
this.disableCloseButton = this.spec.disableCloseButton || false;
|
|
181
179
|
Action.execute(spec.onLoad, this);
|
|
182
180
|
}
|
|
183
181
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glib-web",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"json-logic-js": "^2.0.0",
|
|
20
20
|
"lodash.merge": "^4.6.2",
|
|
21
21
|
"marked": "^4.0.0",
|
|
22
|
+
"material-design-icons-iconfont": "^6.7.0",
|
|
22
23
|
"moment": "^2.29.4",
|
|
23
24
|
"phoenix": "^1.5.3",
|
|
24
25
|
"push.js": "^1.0.12",
|
|
@@ -37,11 +38,7 @@
|
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@types/chart.js": "^2.9.34",
|
|
39
40
|
"eslint": "^8.36.0",
|
|
40
|
-
"eslint-
|
|
41
|
-
"eslint-plugin-prettier": "^3.1.1",
|
|
42
|
-
"eslint-plugin-vue": "^9.9.0",
|
|
43
|
-
"eslint-plugin-vuetify": "^2.0.0-beta.2",
|
|
44
|
-
"material-design-icons-iconfont": "^6.7.0",
|
|
41
|
+
"eslint-plugin-vue": "^9.17.0",
|
|
45
42
|
"prettier": "^1.18.2",
|
|
46
43
|
"typescript": "^4.9.5"
|
|
47
44
|
}
|
package/settings.json.example
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
+
"editor.tabSize": 2,
|
|
2
3
|
"editor.scrollBeyondLastLine": false,
|
|
4
|
+
"editor.formatOnSave": true,
|
|
3
5
|
"editor.minimap.enabled": false,
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
6
|
+
"ruby.format": "rubocop",
|
|
7
|
+
"window.zoomLevel": 1,
|
|
8
|
+
"[html]": {
|
|
9
|
+
"editor.defaultFormatter": "vscode.html-language-features"
|
|
10
|
+
},
|
|
11
|
+
"[vue]": {
|
|
12
|
+
"editor.defaultFormatter": "Vue.volar"
|
|
12
13
|
},
|
|
13
|
-
"eslint.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
],
|
|
18
|
-
"editor.codeActionsOnSave": {
|
|
19
|
-
"source.fixAll.eslint": true
|
|
20
|
-
}
|
|
21
|
-
}
|
|
14
|
+
"eslint.run": "onSave",
|
|
15
|
+
"javascript.format.semicolons": "insert",
|
|
16
|
+
"javascript.preferences.quoteStyle": "double"
|
|
17
|
+
}
|
package/styles/test.sass
CHANGED
|
File without changes
|
package/styles/test.scss
CHANGED
|
File without changes
|
|
File without changes
|
package/utils/dom.js
CHANGED
|
File without changes
|
package/utils/eventBus.js
CHANGED
package/utils/history.js
CHANGED
package/utils/launch.js
CHANGED
|
@@ -3,7 +3,7 @@ import Dialog from "../nav/dialog.vue";
|
|
|
3
3
|
import Sheet from "../nav/sheet.vue";
|
|
4
4
|
import Snackbar from "../nav/snackbar.vue";
|
|
5
5
|
import Popover from "../components/popover.vue";
|
|
6
|
-
import { computePosition,
|
|
6
|
+
import { computePosition, flip, offset } from '@floating-ui/dom'
|
|
7
7
|
import bus from "./eventBus";
|
|
8
8
|
|
|
9
9
|
import { createApp, h } from "vue";
|
|
@@ -62,7 +62,7 @@ class LaunchPopover {
|
|
|
62
62
|
// These properties need to be set to get an accurate calculation. See https://floating-ui.com/docs/computeposition
|
|
63
63
|
Object.assign(placeholder.style, { position: 'absolute', display: 'block', top: 0, left: 0 });
|
|
64
64
|
|
|
65
|
-
computePosition(reference, floating, { placement: placement, middleware: [
|
|
65
|
+
computePosition(reference, floating, { placement: placement, middleware: [flip(), offset(offsetSize)] })
|
|
66
66
|
.then(({ x, y }) => {
|
|
67
67
|
Object.assign(placeholder.style, { top: `${y}px`, left: `${x}px`, zIndex: 1200 });
|
|
68
68
|
})
|
package/utils/storage.js
CHANGED
|
File without changes
|
package/utils/url.js
CHANGED
|
File without changes
|