glib-web 3.0.13 → 3.1.1

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 CHANGED
@@ -1,37 +1,34 @@
1
1
  module.exports = {
2
- root: true,
3
- env: {
4
- // this section will be used to determine which APIs are available to us
5
- // (i.e are we running in a browser environment or a node.js env)
6
- node: true,
7
- browser: true
8
- },
9
- plugins: [
10
- 'vuetify'
11
- ],
12
- parserOptions: {
13
- parser: "babel-eslint",
14
- // specifying a module sourcetype prevent eslint from marking import statements as errors
15
- sourceType: "module"
16
- },
17
- extends: [
18
- // use the recommended rule set for both plain javascript and vue
19
- "eslint:recommended",
20
- "plugin:vue/recommended",
21
- "prettier/vue",
22
- "plugin:prettier/recommended"
23
- ],
24
- rules: {
25
- // we should always disable console logs and debugging in production
26
- // "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
27
- // "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
28
- "vue/component-name-in-template-casing": ["error", "PascalCase"],
29
- 'vuetify/no-deprecated-classes': 'error',
30
- 'vuetify/grid-unknown-attributes': 'error',
31
- 'vuetify/no-legacy-grid': 'error',
32
- },
33
- globals: {
34
- "Utils": "readonly",
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
- * Install the following VSCode extensions
4
- * `ESLint`
5
- * `Vetur`
6
- * Edit settings.json
7
- * `CTRL+SHIFT+P` -> `Open Settings (JSON)` -- This will open an editor for `settings.json`.
8
- * Copy content of `settings.json.example` into the editor.
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
- * To prevent circular dependencies between components:
12
- * 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.
13
- * For downward communication, don’t use any sort of event/pub-sub mechanism. Always use Vuejs data binding instead.
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`
File without changes
File without changes
File without changes
@@ -1,6 +1,3 @@
1
- import { nextTick } from "vue";
2
- import bus from "../../utils/eventBus";
3
-
4
1
  export default class {
5
2
  execute(properties, component) {
6
3
  Utils.launch.popover.open(properties, component);
File without changes
@@ -56,7 +56,7 @@ export default {
56
56
  return item.view == "panels/column-v1";
57
57
  },
58
58
  viewKey(item, index) {
59
- return index
59
+ return index;
60
60
 
61
61
  // return `view${index}_${item.view}`;
62
62
 
File without changes
File without changes
File without changes
File without changes
package/components/hr.vue CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <!-- Placement options:
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
- <common-responsive :style="floatingStyles" v-if="toggle" :spec="spec" />
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="showClose" text icon @click="close" class="mr-3 mt-2 close-btn" variant="flat">
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
- showClose: true,
67
+ disableCloseButton: false,
68
68
  isFormDirty: false,
69
69
  isFormSubmitted: false,
70
70
  isMobile: false,
@@ -138,7 +138,7 @@ export default {
138
138
  },
139
139
  reload(newSpec) {
140
140
  if (Utils.http.proceedEvenWhenDirty()) {
141
- this.spec.url = newSpec.url
141
+ this.spec.url = newSpec.url;
142
142
  this.urlLoaded = false;
143
143
  this.show(true);
144
144
  }
@@ -149,7 +149,7 @@ export default {
149
149
  show(reload) {
150
150
  const spec = this.spec;
151
151
  this.url = spec.url;
152
- this.showClose = this.spec.showClose || Utils.type.isString(this.url);
152
+ this.disableCloseButton = this.spec.disableCloseButton || Utils.type.isString(this.url);
153
153
 
154
154
  if (Utils.type.isString(this.url)) {
155
155
  if (!this.urlLoaded) {
@@ -158,7 +158,6 @@ export default {
158
158
  }
159
159
  const url = Utils.url.appendParams(this.url, { _dialog: "v1" });
160
160
  Http.execute({ url: url }, "GET", this, (response) => {
161
- console.log(url)
162
161
  Utils.http.forceComponentUpdate(() => {
163
162
  this.urlLoaded = true;
164
163
  this.title = response.title;
@@ -167,7 +166,7 @@ export default {
167
166
  this.header = response.header;
168
167
  this.body = response.body;
169
168
  this.footer = response.footer;
170
- this.showClose = this.spec.showClose || true;
169
+ this.disableCloseButton = this.spec.disableCloseButton || false;
171
170
 
172
171
  Action.execute(response.onLoad, this);
173
172
  });
@@ -177,7 +176,7 @@ export default {
177
176
  this.title = this.spec.title;
178
177
  this.message = this.spec.message;
179
178
  this.body = this.spec.body;
180
- this.showClose = this.spec.showClose || true;
179
+ this.disableCloseButton = this.spec.disableCloseButton || false;
181
180
  Action.execute(spec.onLoad, this);
182
181
  }
183
182
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "3.0.13",
3
+ "version": "3.1.1",
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-config-prettier": "^6.3.0",
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
  }
@@ -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
- "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
- }
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.validate": [
14
- "vue",
15
- "html",
16
- "javascript"
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
@@ -1,5 +1,7 @@
1
1
  // eventBus.js
2
- import emitter from 'tiny-emitter/instance'
2
+ import Emitter from 'tiny-emitter'
3
+
4
+ const emitter = new Emitter()
3
5
 
4
6
  export default {
5
7
  $on: (...args) => emitter.on(...args),
package/utils/history.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { nextTick } from "vue";
2
- import eventBus from "./eventBus";
3
2
  import { vueApp } from "../store";
4
3
 
5
4
  export default class {
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, shift, offset } from '@floating-ui/dom'
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: [shift(), offset(offsetSize)] })
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