@oniti/quasar-app-extension-vlank-input 3.1.21 → 4.0.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/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@oniti/quasar-app-extension-vlank-input",
3
- "version": "3.1.21",
3
+ "version": "4.0.0",
4
4
  "description": "A Quasar App Extension",
5
5
  "author": "François BOUYER <francois@oniti.fr>",
6
6
  "license": "MIT",
7
7
  "main": "src/index.js",
8
8
  "dependencies": {
9
- "@oniti/quasar-ui-vlank-input": "^3.1.17"
9
+ "@oniti/quasar-ui-vlank-input": "^4.0.0"
10
10
  },
11
11
  "private": false,
12
12
  "publishConfig": {
13
13
  "access": "public"
14
14
  },
15
15
  "engines": {
16
- "node": ">= 8.9.0",
17
- "npm": ">= 5.6.0",
18
- "yarn": ">= 1.6.0"
16
+ "node": ">= 18.0.0",
17
+ "npm": ">= 9.0.0",
18
+ "yarn": ">= 1.22.0"
19
19
  }
20
20
  }
@@ -1,39 +1,29 @@
1
- import errors from "../component/store/errors";
2
1
  import { getValue } from "@oniti/oniti-helpers";
3
- import VlankInput from '@oniti/quasar-ui-vlank-input'
2
+ import VlankInput from "@oniti/quasar-ui-vlank-input";
3
+ import { useErrorsStore } from "@oniti/quasar-ui-vlank-input";
4
4
 
5
- export default ({ store, app }) => {
6
- // Enregistrement du store
7
- store.registerModule("errors", errors);
8
- /**
9
- * Enregistrement du composant
10
- */
11
- app.component('vlank-input', VlankInput.Component);
5
+ export default ({ app, store }) => {
6
+ const errorsStore = useErrorsStore(store);
7
+
8
+ app.component("vlank-input", VlankInput.Component);
12
9
 
13
- /**
14
- * Intercepteurs Axios
15
- */
16
10
  if (app.config.globalProperties.$axios) {
17
11
  app.config.globalProperties.$axios.interceptors.request.use(
18
12
  (config) => {
19
- // Reset les erreurs.
20
- if (store.state.errors.errors) {
21
- store.commit("errors/RESET_ERRORS", null);
13
+ if (errorsStore.errors) {
14
+ errorsStore.resetErrors();
22
15
  }
23
16
  return config;
24
17
  },
25
- (error) => {
26
- return Promise.reject(error);
27
- }
18
+ (error) => Promise.reject(error)
28
19
  );
29
20
  app.config.globalProperties.$axios.interceptors.response.use(
30
21
  (response) => response,
31
22
  (err) => {
32
23
  if (err.response) {
33
24
  const errors = getValue(err, "response.data.errors");
34
-
35
25
  if (err.response.status === 422 && errors) {
36
- store.commit("errors/SET_ERRORS", errors);
26
+ errorsStore.setErrors(errors);
37
27
  }
38
28
  }
39
29
  return Promise.reject(err);
package/src/index.js CHANGED
@@ -3,19 +3,16 @@
3
3
  * (runs on each dev/build)
4
4
  *
5
5
  * Docs: https://quasar.dev/app-extensions/development-guide/index-api
6
- * API: https://github.com/quasarframework/quasar/blob/master/app/lib/app-extension/IndexAPI.js
7
6
  */
8
7
 
9
- function extendConf (conf) {
10
- // register our boot file
11
- conf.boot.push('~@oniti/quasar-app-extension-vlank-input/src/boot/register.js')
12
-
13
- // make sure app extension files & ui package gets transpiled
14
- conf.build.transpileDependencies.push(/quasar-app-extension-vlank-input[\\/]src/)
8
+ function extendConf(conf) {
9
+ conf.boot = conf.boot || [];
10
+ conf.boot.push(
11
+ "~@oniti/quasar-app-extension-vlank-input/src/boot/register.js"
12
+ );
15
13
  }
16
14
 
17
15
  module.exports = function (api) {
18
- api.compatibleWith('@quasar/app', '^3.0.0')
19
- // We extend /quasar.conf.js
20
- api.extendQuasarConf(extendConf)
21
- }
16
+ api.compatibleWith("@quasar/app-vite", "^2.0.0");
17
+ api.extendQuasarConf(extendConf);
18
+ };
File without changes
File without changes
@@ -1,12 +0,0 @@
1
- import state from './state'
2
- import * as getters from './getters'
3
- import * as mutations from './mutations'
4
- import * as actions from './actions'
5
-
6
- export default {
7
- namespaced: true,
8
- getters,
9
- mutations,
10
- actions,
11
- state
12
- }
@@ -1,7 +0,0 @@
1
- export function SET_ERRORS (state, errors) {
2
- state.errors = errors
3
- }
4
-
5
- export function RESET_ERRORS (state) {
6
- state.errors = null
7
- }
@@ -1,5 +0,0 @@
1
- export default function () {
2
- return {
3
- errors: null
4
- }
5
- }