shared-ritm 1.2.87 → 1.2.89

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,53 +1,40 @@
1
- import * as faceapi from 'face-api.js'
1
+ import * as faceapi from 'face-api.js';
2
2
  declare class PhotoService {
3
- getVideoStreamConfig(
4
- width: number,
5
- height: number,
6
- ): {
7
- audio: boolean
8
- video: {
9
- width: {
10
- min: number
11
- ideal: number
12
- }
13
- height: {
14
- min: number
15
- ideal: number
16
- }
17
- facingMode: string
18
- }
19
- }
20
- getContourCoordinate(
21
- width: number,
22
- height: number,
23
- ): {
24
- x: number
25
- y: number
26
- width: number
27
- height: number
28
- }
29
- getBoxData(box: any): {
30
- x: any
31
- y: any
32
- width: any
33
- height: any
34
- } | null
35
- setStylesForCanvas(canvasContainer: any): void
36
- checkFaceInclusion(frame: any, face: any): boolean
37
- getFaceDetections(videoRef: any): Promise<
38
- faceapi.WithFaceExpressions<
39
- faceapi.WithFaceLandmarks<
40
- {
41
- detection: faceapi.FaceDetection
42
- },
43
- faceapi.FaceLandmarks68
44
- >
45
- >[]
46
- >
47
- getCanvas(videoRef: any): HTMLCanvasElement
48
- getResizedAndDetection(canvas: any, detections: any, ctx: any, videoWidth: number, videoHeight: number): void
49
- getFaceSnapshot(inputImage: any, box: any): Promise<string | null>
50
- initModels(): Promise<void>
3
+ getVideoStreamConfig(width: number, height: number): {
4
+ audio: boolean;
5
+ video: {
6
+ width: {
7
+ min: number;
8
+ ideal: number;
9
+ };
10
+ height: {
11
+ min: number;
12
+ ideal: number;
13
+ };
14
+ facingMode: string;
15
+ };
16
+ };
17
+ getContourCoordinate(width: number, height: number): {
18
+ x: number;
19
+ y: number;
20
+ width: number;
21
+ height: number;
22
+ };
23
+ getBoxData(box: any): {
24
+ x: any;
25
+ y: any;
26
+ width: any;
27
+ height: any;
28
+ } | null;
29
+ setStylesForCanvas(canvasContainer: any): void;
30
+ checkFaceInclusion(frame: any, face: any): boolean;
31
+ getFaceDetections(videoRef: any): Promise<faceapi.WithFaceExpressions<faceapi.WithFaceLandmarks<{
32
+ detection: faceapi.FaceDetection;
33
+ }, faceapi.FaceLandmarks68>>[]>;
34
+ getCanvas(videoRef: any): HTMLCanvasElement;
35
+ getResizedAndDetection(canvas: any, detections: any, ctx: any, videoWidth: number, videoHeight: number): void;
36
+ getFaceSnapshot(inputImage: any, box: any): Promise<string | null>;
37
+ initModels(): Promise<void>;
51
38
  }
52
- export default function usePhotoService(): PhotoService
53
- export {}
39
+ export default function usePhotoService(): PhotoService;
40
+ export {};
@@ -1,5 +1,5 @@
1
1
  import ApiService from '../settings/ApiService';
2
- import { Api_User, Api_User_Role } from '../types/Api_User';
2
+ import { Api_User, Api_User_Create, Api_User_Position, Api_User_Role, Api_User_Team, Api_User_Team_Search } from '../types/Api_User';
3
3
  import { ResponseApi } from '../types/Api_Service';
4
4
  declare class UserService extends ApiService {
5
5
  editUser({ id, model }: {
@@ -7,7 +7,7 @@ declare class UserService extends ApiService {
7
7
  model: any;
8
8
  }): Promise<Api_User>;
9
9
  getUser(id: string): Promise<Api_User>;
10
- createUser(model: Partial<Api_User>): Promise<Api_User>;
10
+ createUser(model: Api_User_Create): Promise<Api_User>;
11
11
  deleteUser(id: string): Promise<{
12
12
  data: boolean;
13
13
  status: number;
@@ -15,6 +15,27 @@ declare class UserService extends ApiService {
15
15
  getRoles(params?: {
16
16
  per_page?: number;
17
17
  }): Promise<ResponseApi<Api_User_Role[]>>;
18
+ getPositions(params?: {
19
+ per_page?: number;
20
+ }): Promise<ResponseApi<Api_User_Position[]>>;
21
+ createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>>;
22
+ editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>>;
23
+ deletePosition(id: string): Promise<{
24
+ data: boolean;
25
+ status: number;
26
+ }>;
27
+ getTeams(params?: {
28
+ per_page?: number;
29
+ }): Promise<ResponseApi<Api_User_Team_Search[]>>;
30
+ createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>>;
31
+ editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{
32
+ data: boolean;
33
+ status: number;
34
+ }>;
35
+ deleteTeam(id: string): Promise<{
36
+ data: boolean;
37
+ status: number;
38
+ }>;
18
39
  }
19
40
  export default function useUserService(): UserService;
20
41
  export {};
@@ -12,5 +12,6 @@ export default class ApiService {
12
12
  protected get<T>(url: string, options?: AxiosRequestConfig): Promise<T>;
13
13
  protected delete<T>(url: string, options?: AxiosRequestConfig): Promise<AxiosResponse<T, any>>;
14
14
  protected post<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<any>;
15
+ protected patch<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<T2>;
15
16
  protected put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<T2>;
16
17
  }
@@ -5,11 +5,16 @@ export type Api_User_Team = {
5
5
  description: string;
6
6
  created_at: string;
7
7
  updated_at: string;
8
- pivot: {
8
+ pivot?: {
9
9
  team_id: string;
10
10
  user_id: string;
11
11
  };
12
12
  };
13
+ export type Api_User_Team_Search = {
14
+ id: string;
15
+ name: string;
16
+ display_name: string;
17
+ };
13
18
  export type Api_User_Photo = {
14
19
  id: string;
15
20
  name: string;
@@ -40,6 +45,22 @@ export type Api_User = {
40
45
  teams: Api_User_Team[];
41
46
  photos: Api_User_Photo[];
42
47
  };
48
+ export type Api_User_Create = {
49
+ last_name?: string;
50
+ first_name?: string;
51
+ patronymic?: string;
52
+ email?: string;
53
+ phone?: string;
54
+ divisions?: string;
55
+ positions?: [string];
56
+ teams?: {
57
+ team_id: string;
58
+ roles: string[];
59
+ }[];
60
+ current_password?: string;
61
+ password?: string;
62
+ password_confirmation?: string;
63
+ };
43
64
  export type Api_User_Permission = {
44
65
  id: string;
45
66
  name: string;
@@ -51,3 +72,9 @@ export type Api_User_Role = {
51
72
  display_name: string;
52
73
  permissions?: Api_User_Permission[];
53
74
  };
75
+ export type Api_User_Position = {
76
+ id: string;
77
+ name: string;
78
+ display_name: string;
79
+ description?: string;
80
+ };
package/package.json CHANGED
@@ -1,64 +1,64 @@
1
- {
2
- "name": "shared-ritm",
3
- "version": "1.2.87",
4
- "private": false,
5
- "files": [
6
- "dist",
7
- "src"
8
- ],
9
- "main": "dist/shared-ritm.umd.js",
10
- "type": "module",
11
- "module": "./dist/shared-ritm.es.js",
12
- "types": "./dist/types/index.d.ts",
13
- "exports": {
14
- ".": {
15
- "import": "./dist/shared-ritm.es.js",
16
- "require": "./dist/shared-ritm.umd.js",
17
- "default": "./dist/shared-ritm.es.js",
18
- "types": "./dist/types/index.d.ts"
19
- },
20
- "./style": "./dist/index.css"
21
- },
22
- "scripts": {
23
- "dev": "vite",
24
- "build": "vite build && tsc --emitDeclarationOnly",
25
- "typecheck": "vue-tsc --noEmit",
26
- "lint": "eslint --fix",
27
- "format": "prettier -w -u ."
28
- },
29
- "dependencies": {
30
- "@quasar/extras": "^1.16.17",
31
- "@vueuse/core": "^10.1.2",
32
- "face-api.js": "^0.22.2",
33
- "axios": "^1.7.7",
34
- "vue": "^3.5.12",
35
- "vue-router": "^4.0.3"
36
- },
37
- "peerDependencies": {
38
- "quasar": "^2.18.1"
39
- },
40
- "devDependencies": {
41
- "@quasar/vite-plugin": "^1.9.0",
42
- "@rollup/pluginutils": "^5.1.3",
43
- "@types/node": "^22.7.9",
44
- "@typescript-eslint/eslint-plugin": "^4.25.0",
45
- "@typescript-eslint/parser": "^4.25.0",
46
- "@vitejs/plugin-vue": "^5.1.4",
47
- "@vue/compiler-sfc": "^3.0.5",
48
- "@vue/eslint-config-prettier": "^6.0.0",
49
- "@vue/eslint-config-typescript": "^7.0.0",
50
- "eslint": "^7.27.0",
51
- "eslint-plugin-prettier": "^3.4.0",
52
- "eslint-plugin-vue": "^7.10.0",
53
- "install": "^0.13.0",
54
- "npm": "^11.4.0",
55
- "prettier": "^2.3.0",
56
- "quasar": "^2.18.1",
57
- "rollup-plugin-visualizer": "^5.14.0",
58
- "sass": "^1.80.4",
59
- "typescript": "^5.6.3",
60
- "vite": "^5.4.9",
61
- "vite-plugin-css-modules": "^0.0.1",
62
- "vue-tsc": "^2.1.6"
63
- }
64
- }
1
+ {
2
+ "name": "shared-ritm",
3
+ "version": "1.2.89",
4
+ "private": false,
5
+ "files": [
6
+ "dist",
7
+ "src"
8
+ ],
9
+ "main": "dist/shared-ritm.umd.js",
10
+ "type": "module",
11
+ "module": "./dist/shared-ritm.es.js",
12
+ "types": "./dist/types/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/shared-ritm.es.js",
16
+ "require": "./dist/shared-ritm.umd.js",
17
+ "default": "./dist/shared-ritm.es.js",
18
+ "types": "./dist/types/index.d.ts"
19
+ },
20
+ "./style": "./dist/index.css"
21
+ },
22
+ "scripts": {
23
+ "dev": "vite",
24
+ "build": "vite build && tsc --emitDeclarationOnly",
25
+ "typecheck": "vue-tsc --noEmit",
26
+ "lint": "eslint --fix",
27
+ "format": "prettier -w -u ."
28
+ },
29
+ "dependencies": {
30
+ "@quasar/extras": "^1.16.17",
31
+ "@vueuse/core": "^10.1.2",
32
+ "face-api.js": "^0.22.2",
33
+ "axios": "^1.7.7",
34
+ "vue": "^3.5.12",
35
+ "vue-router": "^4.0.3"
36
+ },
37
+ "peerDependencies": {
38
+ "quasar": "^2.18.1"
39
+ },
40
+ "devDependencies": {
41
+ "@quasar/vite-plugin": "^1.9.0",
42
+ "@rollup/pluginutils": "^5.1.3",
43
+ "@types/node": "^22.7.9",
44
+ "@typescript-eslint/eslint-plugin": "^4.25.0",
45
+ "@typescript-eslint/parser": "^4.25.0",
46
+ "@vitejs/plugin-vue": "^5.1.4",
47
+ "@vue/compiler-sfc": "^3.0.5",
48
+ "@vue/eslint-config-prettier": "^6.0.0",
49
+ "@vue/eslint-config-typescript": "^7.0.0",
50
+ "eslint": "^7.27.0",
51
+ "eslint-plugin-prettier": "^3.4.0",
52
+ "eslint-plugin-vue": "^7.10.0",
53
+ "install": "^0.13.0",
54
+ "npm": "^11.4.0",
55
+ "prettier": "^2.3.0",
56
+ "quasar": "^2.18.1",
57
+ "rollup-plugin-visualizer": "^5.14.0",
58
+ "sass": "^1.80.4",
59
+ "typescript": "^5.6.3",
60
+ "vite": "^5.4.9",
61
+ "vite-plugin-css-modules": "^0.0.1",
62
+ "vue-tsc": "^2.1.6"
63
+ }
64
+ }
@@ -1,5 +1,12 @@
1
1
  import ApiService from '../settings/ApiService'
2
- import { Api_User, Api_User_Role } from '../types/Api_User'
2
+ import {
3
+ Api_User,
4
+ Api_User_Create,
5
+ Api_User_Position,
6
+ Api_User_Role,
7
+ Api_User_Team,
8
+ Api_User_Team_Search,
9
+ } from '../types/Api_User'
3
10
  import { ResponseApi } from '../types/Api_Service'
4
11
 
5
12
  class UserService extends ApiService {
@@ -11,16 +18,48 @@ class UserService extends ApiService {
11
18
  return await this.get<Api_User>(`/admin/users/${id}`)
12
19
  }
13
20
 
14
- public async createUser(model: Partial<Api_User>): Promise<Api_User> {
15
- return await this.post<Partial<Api_User>, Api_User>('/admin/users', model)
21
+ public async createUser(model: Api_User_Create): Promise<Api_User> {
22
+ return await this.post<Api_User_Create, Api_User>('/admin/users', model)
16
23
  }
17
24
 
18
25
  public async deleteUser(id: string): Promise<{ data: boolean; status: number }> {
19
26
  return await this.delete(`/admin/users/${id}`)
20
27
  }
21
28
 
22
- public getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
23
- return this.get('/search/roles', { params })
29
+ public async getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
30
+ return await this.get<ResponseApi<Api_User_Role[]>>('/search/roles', { params })
31
+ }
32
+
33
+ public async getPositions(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Position[]>> {
34
+ return await this.get<ResponseApi<Api_User_Position[]>>('/search/positions', { params })
35
+ }
36
+
37
+ public async createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
38
+ return await this.post<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>('/admin/positions', body)
39
+ }
40
+
41
+ public async editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
42
+ return await this.put<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>(`/admin/positions/${id}`, body)
43
+ }
44
+
45
+ public async deletePosition(id: string): Promise<{ data: boolean; status: number }> {
46
+ return await this.delete(`/admin/positions/${id}`)
47
+ }
48
+
49
+ public async getTeams(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Team_Search[]>> {
50
+ return await this.get<ResponseApi<Api_User_Team_Search[]>>('/search/teams', { params })
51
+ }
52
+
53
+ public async createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>> {
54
+ return await this.post<Partial<Api_User_Team_Search>, ResponseApi<Api_User_Team>>('/teams', body)
55
+ }
56
+
57
+ public async editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{ data: boolean; status: number }> {
58
+ return await this.patch<Partial<Api_User_Team_Search>, { data: boolean; status: number }>(`/teams/${id}`, body)
59
+ }
60
+
61
+ public async deleteTeam(id: string): Promise<{ data: boolean; status: number }> {
62
+ return await this.delete(`/teams/${id}`)
24
63
  }
25
64
  }
26
65
 
@@ -99,13 +99,17 @@ export default class ApiService {
99
99
  }
100
100
  }
101
101
 
102
- // protected patch<T1, T2>(url: string, payload: T1, type: ApiServiceType, options?: AxiosRequestConfig): Promise<T2> {
103
- // return axios
104
- // .patch<T1, AxiosResponse<T2>>(apiServiceUrls[type] + url, payload, options)
105
- // .catch((err: AxiosError) => processError401<T2>(err))
106
- // .then(extractData)
107
- // }
108
- //
102
+ protected async patch<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig): Promise<T2> {
103
+ try {
104
+ const response: AxiosResponse<T2> = await this.axiosInstance.patch<T1, AxiosResponse<T2>>(url, payload, options)
105
+ return response.data
106
+ } catch (error) {
107
+ const axiosError = error as AxiosError
108
+ this.handleError(axiosError)
109
+ throw error
110
+ }
111
+ }
112
+
109
113
  protected async put<T1, T2>(url: string, payload: T1, options?: AxiosRequestConfig) {
110
114
  try {
111
115
  const response: AxiosResponse<T2> = await this.axiosInstance.put<T1, AxiosResponse<T2>>(url, payload, options)
@@ -5,12 +5,18 @@ export type Api_User_Team = {
5
5
  description: string
6
6
  created_at: string
7
7
  updated_at: string
8
- pivot: {
8
+ pivot?: {
9
9
  team_id: string
10
10
  user_id: string
11
11
  }
12
12
  }
13
13
 
14
+ export type Api_User_Team_Search = {
15
+ id: string
16
+ name: string
17
+ display_name: string
18
+ }
19
+
14
20
  export type Api_User_Photo = {
15
21
  id: string
16
22
  name: string
@@ -43,6 +49,23 @@ export type Api_User = {
43
49
  photos: Api_User_Photo[]
44
50
  }
45
51
 
52
+ export type Api_User_Create = {
53
+ last_name?: string
54
+ first_name?: string
55
+ patronymic?: string
56
+ email?: string
57
+ phone?: string
58
+ divisions?: string
59
+ positions?: [string]
60
+ teams?: {
61
+ team_id: string
62
+ roles: string[]
63
+ }[]
64
+ current_password?: string
65
+ password?: string
66
+ password_confirmation?: string
67
+ }
68
+
46
69
  export type Api_User_Permission = {
47
70
  id: string
48
71
  name: string
@@ -55,3 +78,10 @@ export type Api_User_Role = {
55
78
  display_name: string
56
79
  permissions?: Api_User_Permission[]
57
80
  }
81
+
82
+ export type Api_User_Position = {
83
+ id: string
84
+ name: string
85
+ display_name: string
86
+ description?: string
87
+ }
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <q-dialog
3
- ref="DialogRef"
4
- :model-value="true"
3
+ :model-value="modelValue"
5
4
  :position="'right'"
6
5
  :class="$style['sheet-dialog']"
7
6
  :persistent="persistent"
@@ -9,7 +8,7 @@
9
8
  no-esc-dismiss
10
9
  full-height
11
10
  full-width
12
- @before-hide="emit('before-hide')"
11
+ @update:model-value="emit('update:modelValue', $event)"
13
12
  >
14
13
  <div v-if="loading" class="custom-wrapper">
15
14
  <div class="loader">
@@ -57,11 +56,11 @@
57
56
  </template>
58
57
 
59
58
  <script setup lang="ts">
60
- import { computed, defineEmits, defineProps, Ref, useSlots, withDefaults } from 'vue'
59
+ import { computed, defineEmits, defineProps, useSlots, withDefaults } from 'vue'
61
60
  import { QDialog } from 'quasar'
62
61
 
63
62
  interface DialogProps {
64
- dialogRef: Ref<QDialog | undefined, QDialog | undefined>
63
+ modelValue: boolean
65
64
  loading?: boolean
66
65
  title?: string
67
66
  tabsTitle?: string
@@ -74,6 +73,7 @@ interface DialogProps {
74
73
  }
75
74
 
76
75
  const props = withDefaults(defineProps<DialogProps>(), {
76
+ modelValue: false,
77
77
  title: '',
78
78
  tabsTitle: '',
79
79
  width: '1200px',
@@ -85,19 +85,10 @@ const props = withDefaults(defineProps<DialogProps>(), {
85
85
  persistent: false,
86
86
  })
87
87
 
88
- const emit = defineEmits(['update:dialogRef', 'update:tabId', 'close', 'before-hide'])
88
+ const emit = defineEmits(['update:modelValue', 'update:tabId', 'close', 'before-hide'])
89
89
 
90
90
  const slots = useSlots()
91
91
 
92
- const DialogRef = computed({
93
- get() {
94
- return props.dialogRef
95
- },
96
- set(value) {
97
- emit('update:dialogRef', value)
98
- },
99
- })
100
-
101
92
  const currTabId = computed({
102
93
  get() {
103
94
  return props.tabs?.find(t => t.id === props.tabId)?.title
@@ -29,7 +29,11 @@
29
29
  </template>
30
30
 
31
31
  <template v-for="col in resCols" :key="col.name" #[`header-cell-${col.name}`]="propsSlot">
32
- <q-th :props="propsSlot" :class="{ 'cursor-pointer': col.filterType, actions: col.name === 'actions' }">
32
+ <q-th
33
+ :props="propsSlot"
34
+ :class="{ 'cursor-pointer': col.filterType, actions: col.name === 'actions' }"
35
+ :style="col.style"
36
+ >
33
37
  <div
34
38
  v-if="col.filterType"
35
39
  class="row items-center no-wrap"