@luizleon/sf.prefeiturasp.vuecomponents 0.0.7 → 0.0.9

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.
@@ -1,4 +1,4 @@
1
- import Keycloak from "keycloak-js";
1
+ import Keycloak from "./../keycloak";
2
2
  interface User {
3
3
  name: string;
4
4
  email: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luizleon/sf.prefeiturasp.vuecomponents",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "Pacote de componentes Vue para projetos em SF.",
5
5
  "main": "dist/lib.umd.js",
6
6
  "module": "dist/lib.es.js",
@@ -11,12 +11,14 @@
11
11
  "dependencies": {
12
12
  "air-datepicker": "3.3.1",
13
13
  "date-fns": "2.29.3",
14
- "keycloak-js": "22.0.5",
15
14
  "sweetalert2": "11.4.8",
16
15
  "vue-currency-input": "3.0.2"
17
16
  },
18
17
  "devDependencies": {
19
18
  "@vitejs/plugin-vue": "4.4.1",
19
+ "base64-js": "1.5.1",
20
+ "js-sha256": "0.10.1",
21
+ "jwt-decode": "4.0.0",
20
22
  "rimraf": "3.0.2",
21
23
  "sass": "1.69.5",
22
24
  "typescript": "5.2.2",
@@ -0,0 +1,22 @@
1
+ export class AppResult<Value = null> {
2
+ constructor(value: Value | null = null) {
3
+ this._value = value;
4
+ }
5
+ errors: string[] = [];
6
+ private _value?: Value | null = null;
7
+ get value() {
8
+ return this._value as Value;
9
+ }
10
+ set value(v: Value) {
11
+ this._value = v;
12
+ }
13
+ get hasSuccess(): boolean {
14
+ return !this.hasError;
15
+ }
16
+ get hasError(): boolean {
17
+ return this.errors.length > 0;
18
+ }
19
+ WithError(error: string) {
20
+ this.errors.push(error);
21
+ }
22
+ }
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ import SfTabNavigation from "./components/tabnavigation/TabNavigation.vue";
7
7
  import { UseNavMenuService } from "./services/navMenuService";
8
8
  import { UseDialogService } from "./services/dialogService";
9
9
  import { AuthService } from "./services/authService";
10
+ import { AppResult } from "./common/appResult";
10
11
 
11
12
  import { Cor, Tamanho } from "./enum";
12
13
 
@@ -22,6 +23,7 @@ export {
22
23
  SfContent,
23
24
  SfTabNavigation,
24
25
  AuthService,
26
+ AppResult,
25
27
  UseNavMenuService,
26
28
  UseDialogService,
27
29
  Cor,