@antcde/component-library 0.1.4 → 0.1.12

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.
@@ -4,24 +4,16 @@ type __VLS_Props = {
4
4
  header?: boolean;
5
5
  footer?: boolean;
6
6
  };
7
- declare function __VLS_template(): {
8
- attrs: Partial<{}>;
9
- slots: {
10
- title?(_: {}): any;
11
- content?(_: {}): any;
12
- actions?(_: {}): any;
13
- };
14
- refs: {};
15
- rootEl: HTMLDivElement;
16
- };
17
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
19
8
  width: number;
20
9
  transparent: boolean;
21
10
  header: boolean;
22
11
  footer: boolean;
23
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
24
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, {
13
+ title?(_: {}): any;
14
+ content?(_: {}): any;
15
+ actions?(_: {}): any;
16
+ }>;
25
17
  export default _default;
26
18
  type __VLS_WithTemplateSlots<T, S> = T & {
27
19
  new (): {
@@ -74,17 +74,7 @@ interface Props {
74
74
  type __VLS_PublicProps = {
75
75
  modelValue?: any;
76
76
  } & __VLS_Props;
77
- declare function __VLS_template(): {
78
- attrs: Partial<{}>;
79
- slots: {
80
- 'label-append'?(_: {}): any;
81
- input?(_: {}): any;
82
- };
83
- refs: {};
84
- rootEl: HTMLDivElement;
85
- };
86
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
87
- declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
77
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
88
78
  "update:modelValue": (value: any) => any;
89
79
  } & {
90
80
  "click:append-inner": (value: any) => any;
@@ -108,8 +98,10 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
108
98
  disabled: boolean;
109
99
  density: "default" | "comfortable" | "compact";
110
100
  clearable: boolean;
111
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
112
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
101
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, {
102
+ 'label-append'?(_: {}): any;
103
+ input?(_: {}): any;
104
+ }>;
113
105
  export default _default;
114
106
  type __VLS_WithTemplateSlots<T, S> = T & {
115
107
  new (): {
@@ -10,7 +10,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
10
10
  size: string;
11
11
  icon: string;
12
12
  tooltipText: string;
13
- tooltipLocation: "top" | "bottom" | "start" | "end";
13
+ tooltipLocation: "end" | "bottom" | "top" | "start";
14
14
  loading: boolean;
15
15
  active: boolean;
16
16
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -5,16 +5,7 @@ type __VLS_Props = {
5
5
  icon: string;
6
6
  confirmTitle: string | null;
7
7
  };
8
- declare function __VLS_template(): {
9
- attrs: Partial<{}>;
10
- slots: {
11
- content?(_: {}): any;
12
- };
13
- refs: {};
14
- rootEl: any;
15
- };
16
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
9
  close: (...args: any[]) => void;
19
10
  action: (...args: any[]) => void;
20
11
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
@@ -23,8 +14,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
23
14
  }>, {
24
15
  icon: string;
25
16
  isLoading: boolean;
26
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
27
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
17
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
18
+ content?(_: {}): any;
19
+ }>;
28
20
  export default _default;
29
21
  type __VLS_WithTemplateSlots<T, S> = T & {
30
22
  new (): {
@@ -10,29 +10,21 @@ type __VLS_Props = {
10
10
  type __VLS_PublicProps = {
11
11
  modelValue: boolean;
12
12
  } & __VLS_Props;
13
- declare function __VLS_template(): {
14
- attrs: Partial<{}>;
15
- slots: {
16
- activator?(_: {
17
- props: any;
18
- }): any;
19
- title?(_: {}): any;
20
- content?(_: {}): any;
21
- };
22
- refs: {};
23
- rootEl: any;
24
- };
25
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
26
- declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
27
14
  close: (...args: any[]) => void;
28
15
  delete: (...args: any[]) => void;
29
16
  "update:modelValue": (value: boolean) => void;
30
17
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
31
- "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
32
18
  onClose?: ((...args: any[]) => any) | undefined;
19
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
33
20
  onDelete?: ((...args: any[]) => any) | undefined;
34
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
35
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
21
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
22
+ activator?(_: {
23
+ props: any;
24
+ }): any;
25
+ title?(_: {}): any;
26
+ content?(_: {}): any;
27
+ }>;
36
28
  export default _default;
37
29
  type __VLS_WithTemplateSlots<T, S> = T & {
38
30
  new (): {
@@ -9,21 +9,13 @@ interface Props {
9
9
  cancelText?: string;
10
10
  confirmText?: string;
11
11
  }
12
- declare function __VLS_template(): {
13
- attrs: Partial<{}>;
14
- slots: {
15
- content?(_: {}): any;
16
- };
17
- refs: {};
18
- rootEl: any;
19
- };
20
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
21
- declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
13
  close: (...args: any[]) => void;
23
14
  }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
24
15
  onClose?: ((...args: any[]) => any) | undefined;
25
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
26
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
16
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
17
+ content?(_: {}): any;
18
+ }>;
27
19
  export default _default;
28
20
  type __VLS_WithTemplateSlots<T, S> = T & {
29
21
  new (): {
@@ -1,25 +1,25 @@
1
1
  declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
2
- minWidth?: number;
3
- maxWidth?: number | null;
2
+ minWidth?: number | undefined;
3
+ maxWidth?: number | null | undefined;
4
4
  defaultWidth: number;
5
- minHeight?: number;
6
- maxHeight?: number | null;
7
- defaultHeight?: number;
5
+ minHeight?: number | undefined;
6
+ maxHeight?: number | null | undefined;
7
+ defaultHeight?: number | undefined;
8
8
  side: string;
9
- collapsible?: boolean;
9
+ collapsible?: boolean | undefined;
10
10
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
11
  resize: (...args: any[]) => void;
12
12
  "resize-end": (...args: any[]) => void;
13
13
  collapse: (...args: any[]) => void;
14
14
  }, string, import('vue').PublicProps, Readonly<{
15
- minWidth?: number;
16
- maxWidth?: number | null;
15
+ minWidth?: number | undefined;
16
+ maxWidth?: number | null | undefined;
17
17
  defaultWidth: number;
18
- minHeight?: number;
19
- maxHeight?: number | null;
20
- defaultHeight?: number;
18
+ minHeight?: number | undefined;
19
+ maxHeight?: number | null | undefined;
20
+ defaultHeight?: number | undefined;
21
21
  side: string;
22
- collapsible?: boolean;
22
+ collapsible?: boolean | undefined;
23
23
  }> & Readonly<{
24
24
  onResize?: ((...args: any[]) => any) | undefined;
25
25
  "onResize-end"?: ((...args: any[]) => any) | undefined;
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ name: string;
3
+ color?: string | null;
4
+ icon?: string | null;
5
+ selected?: boolean;
6
+ showCheck?: boolean;
7
+ size?: 'x-small' | 'small' | 'default' | 'large' | 'x-large';
8
+ disableOpacity?: boolean;
9
+ };
10
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
+ export default _default;
@@ -1,14 +1,6 @@
1
- declare function __VLS_template(): {
2
- attrs: Partial<{}>;
3
- slots: {
4
- default?(_: {}): any;
5
- };
6
- refs: {};
7
- rootEl: HTMLDivElement;
8
- };
9
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
- declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
11
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
1
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>, {
2
+ default?(_: {}): any;
3
+ }>;
12
4
  export default _default;
13
5
  type __VLS_WithTemplateSlots<T, S> = T & {
14
6
  new (): {
@@ -24,7 +24,7 @@ export declare function useTaskFlow(antConnect: AntConnect, notepad: Notepad): {
24
24
  position_y: number;
25
25
  }) => Promise<void>;
26
26
  deleteNode: (nodeId: string) => Promise<void>;
27
- createEdge: (source: string, target: string, type: "BLOCKED_BY" | "NON_BLOCKING") => Promise<void>;
27
+ createEdge: (source: string, target: string, type: 'BLOCKED_BY' | 'NON_BLOCKING') => Promise<void>;
28
28
  deleteEdge: (edgeId: string) => Promise<void>;
29
29
  createTriggerNode: (triggerId: string, position?: {
30
30
  x: number;
@@ -32,7 +32,7 @@ export declare function useTaskFlow(antConnect: AntConnect, notepad: Notepad): {
32
32
  }) => Promise<string | null>;
33
33
  addRelationQuery: (edgeId: string, queryId: string) => Promise<void>;
34
34
  deleteRelationQuery: (edgeId: string, queryId: string) => Promise<void>;
35
- setEdgeRelationType: (edgeId: string, newType: "BLOCKED_BY" | "NON_BLOCKING") => Promise<void>;
35
+ setEdgeRelationType: (edgeId: string, newType: 'BLOCKED_BY' | 'NON_BLOCKING') => Promise<void>;
36
36
  addTaskRelationQueryApi: import('@antcde/vue-utils').UseApiReturn<import('@antcde/connect-ts').TableQuery | null, [taskId: string, relationId: string, queryId: string], true>;
37
37
  deleteTaskRelationQueryApi: import('@antcde/vue-utils').UseApiReturn<{
38
38
  id: string;
@@ -24,14 +24,14 @@ export declare function useTaskFlowDragDrop(api?: TaskFlowDragDropApi): {
24
24
  onDrop: (event: DragEvent, createNodeFn: (position?: {
25
25
  x: number;
26
26
  y: number;
27
- }) => Promise<string | null>, createTriggerNodeFn?: (id: string, position?: {
27
+ }) => Promise<string | null>, createTriggerNodeFn?: ((id: string, position?: {
28
28
  x: number;
29
29
  y: number;
30
- }) => Promise<string | null>, persistPositionFn?: (data: {
30
+ }) => Promise<string | null>) | undefined, persistPositionFn?: ((data: {
31
31
  id: string;
32
32
  position_x: number;
33
33
  position_y: number;
34
- }) => Promise<void>) => Promise<void>;
34
+ }) => Promise<void>) | undefined) => Promise<void>;
35
35
  onDragEnd: () => void;
36
36
  };
37
37
  export {};
@@ -12,11 +12,12 @@ import { default as BaseConfirmDialog } from './components/BaseConfirmDialog.vue
12
12
  import { default as BaseDeleteDialog } from './components/BaseDeleteDialog.vue';
13
13
  import { default as BaseDialog } from './components/BaseDialog.vue';
14
14
  import { default as BaseResizePanel } from './components/BaseResizePanel.vue';
15
+ import { default as GlobalLabelBadge } from './components/GlobalLabelBadge.vue';
15
16
  import { default as PermissionCard } from './components/RBAC/Permissions/PermissionCard.vue';
16
17
  import { default as TaskFlow } from './components/TasksFlow/index.vue';
17
18
  export type { AppLike } from './components/BaseAppCard.vue';
18
19
  export * from '@antcde/vue-utils';
19
- export { BaseAntButton, BaseAntCard, BaseAntCreateCard, BaseAntDatePicker, BaseAntInput, BaseAntLoading, BaseAppCard, BaseAppCardSkeleton, BaseClickableIcon, BaseConfirmDialog, BaseDeleteDialog, BaseDialog, BaseResizePanel, PermissionCard, TaskFlow, };
20
+ export { BaseAntButton, BaseAntCard, BaseAntCreateCard, BaseAntDatePicker, BaseAntInput, BaseAntLoading, BaseAppCard, BaseAppCardSkeleton, BaseClickableIcon, BaseConfirmDialog, BaseDeleteDialog, BaseDialog, BaseResizePanel, GlobalLabelBadge, PermissionCard, TaskFlow, };
20
21
  declare const _default: {
21
22
  install: (app: App) => void;
22
23
  };
@@ -41,7 +41,7 @@ function onDragLeave({ currentTarget }: DragEvent): void {
41
41
  <template>
42
42
  <label v-if="!disabled" class="justify-center align-center cursor-pointer document-drop" @dragenter.self="onDragEnter" @dragleave.self="onDragLeave" @drop.prevent="handleDrop">
43
43
  <input type="file" multiple @input="handleInput">
44
- <div class="text-align-center">
44
+ <div class="text-center">
45
45
  <v-icon icon="mdi-cloud-upload" size="x-large" />
46
46
  <div>{{ t('dms.dragUploadFiles') }}</div>
47
47
  </div>
@@ -25,11 +25,10 @@ const {
25
25
  isFetching,
26
26
  isCreating,
27
27
  isUploading,
28
- getPreviewUrl,
28
+ getFileUrl,
29
29
  createFolder,
30
30
  fetchData,
31
31
  uploadFileS3,
32
- getDownloadUrl,
33
32
  deleteFile,
34
33
  } = useDms(client)
35
34
 
@@ -251,25 +250,18 @@ function formatDate(date: string) {
251
250
  return dayjs(date).format('YYYY-MM-DD HH:mm:ss')
252
251
  }
253
252
 
254
- async function download(item: DmsFile) {
255
- if (!item.is_folder && item.token) {
256
- const url = await getDownloadUrl(item.token)
257
-
258
- if (url) {
259
- await client.signal({ download: { url } })
260
- }
261
- }
262
- }
263
-
264
- async function getPreviewUrlHandler(item: DmsFile) {
253
+ async function getFileUrlHandler(item: DmsFile) {
265
254
  if (!item) {
266
255
  return
267
256
  }
268
257
  const { is_folder, token } = item
269
258
  if (!is_folder && token) {
270
259
  try {
271
- const url = await getPreviewUrl(token)
272
- window.open(url, '_blank', 'noreferrer')
260
+ const url = await getFileUrl(token)
261
+ const link = document.createElement('a')
262
+ link.href = url
263
+ link.download = item.title || 'download'
264
+ link.click()
273
265
  }
274
266
  catch (error) {
275
267
  console.error('Download error:', error)
@@ -406,17 +398,6 @@ async function getPreviewUrlHandler(item: DmsFile) {
406
398
  class="align-center justify-end"
407
399
  style="min-width: 280px"
408
400
  >
409
- <v-btn
410
- v-if="!item.is_folder"
411
- icon
412
- variant="text"
413
- color="primary"
414
- class="mr-1"
415
- :title="t('dms.preview')"
416
- @click="getPreviewUrlHandler(item)"
417
- >
418
- <v-icon>mdi-open-in-new</v-icon>
419
- </v-btn>
420
401
  <v-btn
421
402
  v-if="!item.is_folder"
422
403
  icon
@@ -424,7 +405,7 @@ async function getPreviewUrlHandler(item: DmsFile) {
424
405
  color="primary"
425
406
  class="mr-1"
426
407
  :title="t('dms.download')"
427
- @click="download(item)"
408
+ @click="getFileUrlHandler(item)"
428
409
  >
429
410
  <v-icon>mdi-tray-arrow-down</v-icon>
430
411
  </v-btn>
@@ -11,20 +11,13 @@ export function useDms(client: UseCommsClient) {
11
11
  const isDeleting = ref(false)
12
12
 
13
13
  const connect = client?.connect
14
- // const project = client?.context?.value?.project?.id
15
14
  const project = computed(() => client?.context?.value?.project?.id)
16
15
 
17
- function getDownloadUrl(token: string) {
18
- return project.value && connect
19
- ? connect.dms.getDownloadUrl(token, project.value)
20
- : undefined
21
- }
22
-
23
- async function getPreviewUrl(token: string) {
16
+ async function getFileUrl(token: string) {
24
17
  if (!project.value || !connect) {
25
18
  return
26
19
  }
27
- return await connect.dms.getPreviewUrl(token, project.value)
20
+ return await connect.dms.getFileUrl(token, project.value)
28
21
  }
29
22
 
30
23
  async function fetchData(token?: string) {
@@ -171,8 +164,7 @@ export function useDms(client: UseCommsClient) {
171
164
  // API
172
165
  createFolder,
173
166
  deleteFile,
174
- getDownloadUrl,
175
- getPreviewUrl,
167
+ getFileUrl,
176
168
  fetchData,
177
169
  uploadFile,
178
170
  uploadFileS3,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antcde/component-library",
3
3
  "type": "module",
4
- "version": "0.1.4",
4
+ "version": "0.1.12",
5
5
  "description": "Helper to use ant components in Vue 3",
6
6
  "author": "CollaborAll",
7
7
  "repository": {
@@ -68,14 +68,16 @@
68
68
  "vue-i18n": "^10.0.1",
69
69
  "vue-router": "^4.4.4",
70
70
  "vuetify": "^3.7.4",
71
- "@antcde/connect-ts": "0.4.2",
72
- "@antcde/vue-utils": "0.2.0"
71
+ "@antcde/vue-utils": "0.2.11",
72
+ "@antcde/connect-ts": "0.4.14"
73
73
  },
74
74
  "bundleDependencies": [
75
75
  "vue",
76
76
  "vuetify"
77
77
  ],
78
78
  "devDependencies": {
79
+ "@iconify-json/mdi": "^1.2.2",
80
+ "@iconify/vue": "^5.0.0",
79
81
  "@arcgis/core": "^4.30.9",
80
82
  "@intlify/unplugin-vue-i18n": "^6.0.1",
81
83
  "@mdi/font": "^7.2.96",
@@ -98,7 +100,8 @@
98
100
  "vite-plugin-dts": "^4.3.0",
99
101
  "vite-plugin-vuetify": "^2.0.4",
100
102
  "vue-cli-plugin-vuetify": "~2.5.8",
101
- "vue-tsc": "^2.2.0"
103
+ "vue-tsc": "^2.2.0",
104
+ "unplugin-icons": "^22.0.0"
102
105
  },
103
106
  "scripts": {
104
107
  "dev": "vite",