@dt-frames/ui 2.0.18 → 2.0.20

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.
@@ -11,7 +11,7 @@ declare const _sfc_main: {
11
11
  setup(props: {
12
12
  column: BasicColumn;
13
13
  record: Recordable;
14
- index: Number;
14
+ index: number;
15
15
  }, {}: {}): () => JSX.Element;
16
16
  };
17
17
  export default _sfc_main;
@@ -1,10 +1,10 @@
1
- import { PaginationProps } from "ant-design-vue";
2
- import { ComputedRef, Ref } from "vue";
3
- import { BasicColumn, BasicTableProps } from "../types/table.type";
4
- import { SetColumnsParams } from "../types/header.type";
5
- export declare function useColumns(propsRef: ComputedRef<BasicTableProps>, getPaginationRef: ComputedRef<boolean | PaginationProps>, tableElRef: Ref<HTMLDivElement & {
1
+ import { PaginationProps } from 'ant-design-vue';
2
+ import { ComputedRef, Ref } from 'vue';
3
+ import { BasicColumn, BasicTableProps } from '../types/table.type';
4
+ import { SetColumnsParams } from '../types/header.type';
5
+ export declare function useColumns(propsRef: ComputedRef<BasicTableProps>, getPaginationRef: ComputedRef<boolean | PaginationProps>, tableElRef: Ref<(HTMLDivElement & {
6
6
  $el: any;
7
- } | null>): {
7
+ }) | null>): {
8
8
  getViewColumns: ComputedRef<BasicColumn[]>;
9
9
  getColumnsRef: ComputedRef<BasicColumn[]>;
10
10
  getColumns: (opt?: SetColumnsParams) => BasicColumn[];
@@ -1,7 +1,7 @@
1
- import { Recordable } from "@dt-frames/core";
2
- import { Key } from "ant-design-vue/lib/table/interface";
3
- import { ComputedRef } from "vue";
4
- import { BasicTableProps } from "../types/table.type";
1
+ import { Recordable } from '@dt-frames/core';
2
+ import { Key } from 'ant-design-vue/lib/table/interface';
3
+ import { ComputedRef } from 'vue';
4
+ import { BasicTableProps } from '../types/table.type';
5
5
  interface Options {
6
6
  setSelectedRowKeys: (keys: Key[]) => void;
7
7
  getSelectedRowKeys: () => Key[];
@@ -1,12 +1,12 @@
1
- import { ComputedRef } from "vue";
2
- import { BasicTableProps, SorterResult, PaginationProps } from "../types/table.type";
3
- import { Recordable } from "@dt-frames/core";
1
+ import { ComputedRef } from 'vue';
2
+ import { BasicTableProps, SorterResult, PaginationProps } from '../types/table.type';
3
+ import { Recordable } from '@dt-frames/core';
4
4
  declare type ActionsType = {
5
5
  getPaginationInfo: ComputedRef<boolean | PaginationProps>;
6
6
  setPagination: (info: Partial<PaginationProps>) => void;
7
7
  clearSelectedRowKeys: () => void;
8
8
  };
9
- export declare function useDataSource(propsRef: ComputedRef<BasicTableProps>, { getPaginationInfo, setPagination, clearSelectedRowKeys, }: ActionsType): {
9
+ export declare function useDataSource(propsRef: ComputedRef<BasicTableProps>, { getPaginationInfo, setPagination, clearSelectedRowKeys }: ActionsType): {
10
10
  getDataSourceRef: ComputedRef<Recordable<any>[]>;
11
11
  handleTableChange: (pagination: PaginationProps, filters: Partial<Recordable<string[]>>, sorter: SorterResult) => any;
12
12
  updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | undefined;
@@ -1,7 +1,7 @@
1
- import { Recordable } from "@dt-frames/core";
2
- import { Key, TableRowSelection } from "ant-design-vue/es/table/interface";
3
- import { ComputedRef } from "vue";
4
- import { BasicTableProps } from "../types/table.type";
1
+ import { Recordable } from '@dt-frames/core';
2
+ import { Key, TableRowSelection } from 'ant-design-vue/es/table/interface';
3
+ import { ComputedRef } from 'vue';
4
+ import { BasicTableProps } from '../types/table.type';
5
5
  export declare function useRowSelection(propsRef: ComputedRef<BasicTableProps>, emit: any): {
6
6
  getRowSelectionRef: ComputedRef<TableRowSelection<any>>;
7
7
  clearSelectedRowKeys: () => void;
@@ -1,9 +1,9 @@
1
- import { TableRowSelection } from "ant-design-vue/es/table/interface";
2
- import { ComputedRef, Ref } from "vue";
3
- import { BasicColumn, BasicTableProps } from "../types/table.type";
4
- export declare function useTableScroll(propsRef: ComputedRef<BasicTableProps>, tableElRef: Ref<HTMLDivElement & {
1
+ import { TableRowSelection } from 'ant-design-vue/es/table/interface';
2
+ import { ComputedRef, Ref } from 'vue';
3
+ import { BasicColumn, BasicTableProps } from '../types/table.type';
4
+ export declare function useTableScroll(propsRef: ComputedRef<BasicTableProps>, tableElRef: Ref<(HTMLDivElement & {
5
5
  $el: any;
6
- } | null>, columnsRef: ComputedRef<BasicColumn[]>, rowSelectionRef: ComputedRef<TableRowSelection | null>): {
6
+ }) | null>, columnsRef: ComputedRef<BasicColumn[]>, rowSelectionRef: ComputedRef<TableRowSelection | null>): {
7
7
  getScrollRef: ComputedRef<{
8
8
  x: string | number | true;
9
9
  y: string | number;
@@ -1,4 +1,4 @@
1
- import { TableProps as ATableProps } from "ant-design-vue/es/table";
1
+ import { TableProps as ATableProps } from 'ant-design-vue/es/table';
2
2
  import type { TableActionType } from './types/actions.type';
3
3
  import type { BasicTableProps } from './types/table.type';
4
4
  declare const _sfc_main: import("vue").DefineComponent<{
@@ -162,7 +162,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
162
162
  default: (params: import("@dt-frames/core").Recordable<any>) => {};
163
163
  };
164
164
  onOpenUpdateDialog: {
165
- type: import("vue").PropType<(row: import("@dt-frames/core").Recordable<any>, index: number) => void>;
165
+ type: import("vue").PropType<(row: import("@dt-frames/core").Recordable<any>, index: number, rowKey: any) => void>;
166
166
  default: (row: import("@dt-frames/core").Recordable<any>, index: number) => {};
167
167
  };
168
168
  onDelete: {
@@ -316,7 +316,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
316
316
  checkStrictly: boolean;
317
317
  onSearch: (params: import("@dt-frames/core").Recordable<any>) => void;
318
318
  onOPenAddDialog: (params: import("@dt-frames/core").Recordable<any>) => void;
319
- onOpenUpdateDialog: (row: import("@dt-frames/core").Recordable<any>, index: number) => void;
319
+ onOpenUpdateDialog: (row: import("@dt-frames/core").Recordable<any>, index: number, rowKey: any) => void;
320
320
  onDelete: (row: import("@dt-frames/core").Recordable<any>, index: number) => void;
321
321
  onDeletes: (params: import("@dt-frames/core").Recordable<any>) => void;
322
322
  authPrefix: string;
@@ -396,7 +396,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
396
396
  setup(props: {
397
397
  column: import("./types/table.type").BasicColumn;
398
398
  record: import("@dt-frames/core").Recordable<any>;
399
- index: Number;
399
+ index: number;
400
400
  }, {}: {}): () => JSX.Element;
401
401
  };
402
402
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("register" | "selection-change" | "columns-change" | "row-click" | "row-dbClick" | "row-contextmenu" | "row-mouseenter" | "row-mouseleave" | "edit-change")[], "register" | "selection-change" | "columns-change" | "row-click" | "row-dbClick" | "row-contextmenu" | "row-mouseenter" | "row-mouseleave" | "edit-change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -560,7 +560,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
560
560
  default: (params: import("@dt-frames/core").Recordable<any>) => {};
561
561
  };
562
562
  onOpenUpdateDialog: {
563
- type: import("vue").PropType<(row: import("@dt-frames/core").Recordable<any>, index: number) => void>;
563
+ type: import("vue").PropType<(row: import("@dt-frames/core").Recordable<any>, index: number, rowKey: any) => void>;
564
564
  default: (row: import("@dt-frames/core").Recordable<any>, index: number) => {};
565
565
  };
566
566
  onDelete: {
@@ -618,7 +618,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
618
618
  checkStrictly: boolean;
619
619
  onSearch: (params: import("@dt-frames/core").Recordable<any>) => void;
620
620
  onOPenAddDialog: (params: import("@dt-frames/core").Recordable<any>) => void;
621
- onOpenUpdateDialog: (row: import("@dt-frames/core").Recordable<any>, index: number) => void;
621
+ onOpenUpdateDialog: (row: import("@dt-frames/core").Recordable<any>, index: number, rowKey: any) => void;
622
622
  onDelete: (row: import("@dt-frames/core").Recordable<any>, index: number) => void;
623
623
  onDeletes: (params: import("@dt-frames/core").Recordable<any>) => void;
624
624
  }>;
@@ -166,7 +166,7 @@ export declare const TableProps: {
166
166
  default: (params: Recordable) => {};
167
167
  };
168
168
  onOpenUpdateDialog: {
169
- type: PropType<(row: Recordable, index: number) => void>;
169
+ type: PropType<(row: Recordable, index: number, rowKey: any) => void>;
170
170
  default: (row: Recordable, index: number) => {};
171
171
  };
172
172
  onDelete: {
@@ -55,6 +55,7 @@ export interface BasicColumn extends ColumnProps<Recordable> {
55
55
  export declare type ButtonType = {
56
56
  t?: string;
57
57
  label?: string | ((row: Recordable) => string);
58
+ enLabel?: string | ((row: Recordable) => string);
58
59
  icon?: string | ((row: Recordable) => string);
59
60
  auth?: string;
60
61
  color?: string;
@@ -315,6 +315,7 @@ function useTree(treeDataRef, getFieldNames, emit) {
315
315
  for (let index = 0; index < data.length; index++) {
316
316
  const item = data[index];
317
317
  const { key: keyField, children: childrenField } = unref(getFieldNames);
318
+ console.log(keyField, childrenField);
318
319
  const key = keyField ? item[keyField] : "";
319
320
  const children = childrenField ? item[childrenField] : [];
320
321
  res.push(key);
@@ -1135,6 +1136,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1135
1136
  emit("update:value", v);
1136
1137
  emit("change", v);
1137
1138
  });
1139
+ watchEffect(() => {
1140
+ activeKey.value = props.activeKey;
1141
+ });
1138
1142
  watchEffect(() => {
1139
1143
  treeDataRef.value = props.treeData;
1140
1144
  });
@@ -1182,8 +1186,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1182
1186
  showIcon: false,
1183
1187
  treeData: unref(treeData),
1184
1188
  onDrop: unref(onDrop)
1185
- }), null, 16, ["treeData", "onDrop"])], 512), [[vShow, !unref(getNotFound)]]), withDirectives(createVNode(_component_AEmpty, null, null, 512), [[vShow, unref(getNotFound)]])]),
1186
- _: 1
1189
+ }), createSlots({
1190
+ _: 2
1191
+ }, [_ctx.$slots.switcherIcon ? {
1192
+ name: "switcherIcon",
1193
+ fn: withCtx((data) => [renderSlot(_ctx.$slots, "switcherIcon", normalizeProps(guardReactiveProps(data || {})))]),
1194
+ key: "0"
1195
+ } : void 0]), 1040, ["treeData", "onDrop"])], 512), [[vShow, !unref(getNotFound)]]), withDirectives(createVNode(_component_AEmpty, null, null, 512), [[vShow, unref(getNotFound)]])]),
1196
+ _: 3
1187
1197
  }, 8, ["spinning", "tip"])], 2);
1188
1198
  };
1189
1199
  }
@@ -22,6 +22,12 @@
22
22
  overflow-y: auto;
23
23
  padding: 10px 0;
24
24
 
25
+ .ant-tree-switcher{
26
+ display: flex;
27
+ align-items: center;
28
+ justify-content: center;
29
+ }
30
+
25
31
  .ant-tree-treenode{
26
32
  padding: 0;
27
33
  align-items: center;
package/index.d.ts CHANGED
@@ -10,4 +10,4 @@ export * from './es/components/table/index.d'
10
10
  export * from './es/components/drawer/index.d'
11
11
  export * from './es/components/tree/index.d'
12
12
  export * from './es/components/upload/index.d'
13
- export * from './es/components/upload/index.d'
13
+ export * from './es/components/iframe/index.d'
package/package.json CHANGED
@@ -1,65 +1,65 @@
1
- {
2
- "name": "@dt-frames/ui",
3
- "version": "2.0.18",
4
- "type": "module",
5
- "license": "MIT",
6
- "main": "./src/index.ts",
7
- "types": "./index.d.ts",
8
- "exports": {
9
- "import": "./index.js",
10
- "require": "./index.js"
11
- },
12
- "keywords": [
13
- "ui",
14
- "dt-ui"
15
- ],
16
- "publishConfig": {
17
- "access": "public",
18
- "registry": "https://registry.npmjs.org/"
19
- },
20
- "scripts": {
21
- "inspect": "vite",
22
- "dev": "pnpm temp --mode dev -w",
23
- "clean": "rimraf ./es",
24
- "temp": "vue-tsc --noEmit && vite build",
25
- "dev:all": "vite",
26
- "dev:theme": "pnpm dev -f theme",
27
- "build:theme": "pnpm temp -f theme",
28
- "dev:upload": "pnpm dev -f upload",
29
- "build:upload": "pnpm temp -f upload",
30
- "dev:form": "pnpm dev -f form",
31
- "build:form": "pnpm temp -f form",
32
- "build:table": "pnpm temp -f table",
33
- "dev:table": "pnpm dev -f table",
34
- "build:modal": "pnpm temp -f modal",
35
- "dev:modal": "pnpm dev -f modal",
36
- "build:source": "pnpm temp -f source",
37
- "dev:source": "pnpm dev -f source",
38
- "build:curd": "pnpm temp -f curd",
39
- "dev:curd": "pnpm dev -f curd",
40
- "build:drawer": "pnpm temp -f drawer",
41
- "dev:drawer": "pnpm dev -f drawer",
42
- "dev:icons": "pnpm dev -f icons",
43
- "build:icons": "pnpm temp -f icons",
44
- "build:container": "pnpm temp -f container",
45
- "dev:tree": "pnpm dev -f tree",
46
- "build:tree": "pnpm temp -f tree",
47
- "dev:iframe": "pnpm dev -f iframe",
48
- "build:iframe": "pnpm temp -f iframe",
49
- "dev:directives": "pnpm dev -f directives",
50
- "build:directives": "pnpm temp -f directives",
51
- "build:all": "npm-run-all clean -s temp build:icons build:upload build:directives build:container build:theme build:modal build:form build:table build:source build:curd build:drawer build:tree build:iframe",
52
- "preview": "vite preview"
53
- },
54
- "dependencies": {
55
- "docx-preview": "^0.1.15",
56
- "lodash-es": "^4.17.21",
57
- "sortablejs": "^1.15.0",
58
- "xlsx": "^0.18.5"
59
- },
60
- "devDependencies": {
61
- "npm-run-all": "^4.1.5",
62
- "rimraf": "^3.0.2",
63
- "vite-plugin-on-success": "^0.0.3"
64
- }
65
- }
1
+ {
2
+ "name": "@dt-frames/ui",
3
+ "version": "2.0.20",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "main": "./src/index.ts",
7
+ "types": "./index.d.ts",
8
+ "exports": {
9
+ "import": "./index.js",
10
+ "require": "./index.js"
11
+ },
12
+ "keywords": [
13
+ "ui",
14
+ "dt-ui"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public",
18
+ "registry": "https://registry.npmjs.org/"
19
+ },
20
+ "scripts": {
21
+ "inspect": "vite",
22
+ "dev": "pnpm temp --mode dev -w",
23
+ "clean": "rimraf ./es",
24
+ "temp": "vue-tsc --noEmit && vite build",
25
+ "dev:all": "vite",
26
+ "dev:theme": "pnpm dev -f theme",
27
+ "build:theme": "pnpm temp -f theme",
28
+ "dev:upload": "pnpm dev -f upload",
29
+ "build:upload": "pnpm temp -f upload",
30
+ "dev:form": "pnpm dev -f form",
31
+ "build:form": "pnpm temp -f form",
32
+ "build:table": "pnpm temp -f table",
33
+ "dev:table": "pnpm dev -f table",
34
+ "build:modal": "pnpm temp -f modal",
35
+ "dev:modal": "pnpm dev -f modal",
36
+ "build:source": "pnpm temp -f source",
37
+ "dev:source": "pnpm dev -f source",
38
+ "build:curd": "pnpm temp -f curd",
39
+ "dev:curd": "pnpm dev -f curd",
40
+ "build:drawer": "pnpm temp -f drawer",
41
+ "dev:drawer": "pnpm dev -f drawer",
42
+ "dev:icons": "pnpm dev -f icons",
43
+ "build:icons": "pnpm temp -f icons",
44
+ "build:container": "pnpm temp -f container",
45
+ "dev:tree": "pnpm dev -f tree",
46
+ "build:tree": "pnpm temp -f tree",
47
+ "dev:iframe": "pnpm dev -f iframe",
48
+ "build:iframe": "pnpm temp -f iframe",
49
+ "dev:directives": "pnpm dev -f directives",
50
+ "build:directives": "pnpm temp -f directives",
51
+ "build:all": "npm-run-all clean -s temp build:icons build:upload build:directives build:container build:theme build:modal build:form build:table build:source build:curd build:drawer build:tree build:iframe",
52
+ "preview": "vite preview"
53
+ },
54
+ "dependencies": {
55
+ "docx-preview": "^0.1.15",
56
+ "lodash-es": "^4.17.21",
57
+ "sortablejs": "^1.15.0",
58
+ "xlsx": "^0.18.5"
59
+ },
60
+ "devDependencies": {
61
+ "npm-run-all": "^4.1.5",
62
+ "rimraf": "^3.0.2",
63
+ "vite-plugin-on-success": "^0.0.3"
64
+ }
65
+ }