@gct-paas/v-ben 0.1.4-dev.10 → 0.1.4-dev.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.
Files changed (59) hide show
  1. package/dist/index.esm.min.js +685 -0
  2. package/dist/index.min.css +2 -0
  3. package/es/_virtual/_plugin-vue_export-helper.mjs +8 -0
  4. package/es/components/index.d.ts +3 -0
  5. package/es/components/index.mjs +7 -0
  6. package/es/components/v-ben-button/index.d.ts +133 -0
  7. package/es/components/v-ben-button/index.mjs +8 -0
  8. package/es/components/v-ben-button/src/BasicButton.vue.d.ts +75 -0
  9. package/es/components/v-ben-button/src/BasicButton.vue.mjs +5 -0
  10. package/es/components/v-ben-button/src/BasicButton.vue_vue_type_script_setup_true_lang.mjs +37 -0
  11. package/es/components/v-ben-button/src/PopConfirmButton.vue.d.ts +24 -0
  12. package/es/components/v-ben-button/src/PopConfirmButton.vue.mjs +5 -0
  13. package/es/components/v-ben-button/src/PopConfirmButton.vue_vue_type_script_lang.mjs +36 -0
  14. package/es/components/v-ben-button/src/custom-button.vue.d.ts +27 -0
  15. package/es/components/v-ben-button/src/custom-button.vue.mjs +7 -0
  16. package/es/components/v-ben-button/src/custom-button.vue_vue_type_script_setup_true_name_custom-button_lang.mjs +22 -0
  17. package/es/components/v-ben-button/src/custom-button.vue_vue_type_style_index_0_scoped_305f4090_lang.css +64 -0
  18. package/es/components/v-ben-button/src/props.d.ts +38 -0
  19. package/es/components/v-ben-button/src/props.mjs +29 -0
  20. package/es/components/v-ben-dropdown/index.d.ts +85 -0
  21. package/es/components/v-ben-dropdown/index.mjs +5 -0
  22. package/es/components/v-ben-dropdown/src/Dropdown.vue.d.ts +66 -0
  23. package/es/components/v-ben-dropdown/src/Dropdown.vue.mjs +5 -0
  24. package/es/components/v-ben-dropdown/src/Dropdown.vue_vue_type_script_setup_true_lang.mjs +87 -0
  25. package/es/components/v-ben-dropdown/src/typing.d.ts +10 -0
  26. package/es/components/v-ben-table/index.d.ts +3 -0
  27. package/es/components/v-ben-table/index.mjs +3 -0
  28. package/es/components/v-ben-table/src/BasicTable.vue.d.ts +410 -0
  29. package/es/components/v-ben-table/src/BasicTable.vue.mjs +37 -0
  30. package/es/components/v-ben-table/src/BasicTable.vue_vue_type_script_lang.mjs +41 -0
  31. package/es/components/v-ben-table/src/components/HeaderCell.vue.d.ts +20 -0
  32. package/es/components/v-ben-table/src/components/HeaderCell.vue.mjs +10 -0
  33. package/es/components/v-ben-table/src/components/HeaderCell.vue_vue_type_script_lang.mjs +15 -0
  34. package/es/components/v-ben-table/src/components/TableAction.vue.d.ts +61 -0
  35. package/es/components/v-ben-table/src/components/TableAction.vue.mjs +6 -0
  36. package/es/components/v-ben-table/src/components/TableAction.vue_vue_type_script_setup_true_lang.mjs +145 -0
  37. package/es/components/v-ben-table/src/components/TableAction.vue_vue_type_style_index_0_lang.css +37 -0
  38. package/es/components/v-ben-table/src/components/TableActionAuto.vue.d.ts +61 -0
  39. package/es/components/v-ben-table/src/components/TableActionAuto.vue.mjs +6 -0
  40. package/es/components/v-ben-table/src/components/TableActionAuto.vue_vue_type_script_setup_true_lang.mjs +159 -0
  41. package/es/components/v-ben-table/src/components/TableActionAuto.vue_vue_type_style_index_0_lang.css +37 -0
  42. package/es/components/v-ben-table/src/props.d.ts +186 -0
  43. package/es/components/v-ben-table/src/props.mjs +157 -0
  44. package/es/components/v-ben-table/src/types/column.d.ts +164 -0
  45. package/es/components/v-ben-table/src/types/componentType.d.ts +1 -0
  46. package/es/components/v-ben-table/src/types/pagination.d.ts +93 -0
  47. package/es/components/v-ben-table/src/types/table.d.ts +356 -0
  48. package/es/components/v-ben-table/src/types/tableAction.d.ts +24 -0
  49. package/es/hooks/useDesign.d.ts +5 -0
  50. package/es/hooks/useDesign.mjs +10 -0
  51. package/es/index.d.ts +2 -0
  52. package/es/index.mjs +12 -4
  53. package/es/types/index.d.ts +18 -0
  54. package/es/utils/is.d.ts +23 -0
  55. package/es/utils/is.mjs +72 -0
  56. package/package.json +9 -6
  57. package/dist/index.esm.min.mjs +0 -5
  58. package/dist/index.min.cjs +0 -1
  59. package/dist/index.system.min.js +0 -1
@@ -0,0 +1,186 @@
1
+ import { PropType } from 'vue';
2
+ import { PaginationProps } from './types/pagination';
3
+ import { BasicColumn, TableSetting, TableCustomRecord, TableRowSelection } from './types/table';
4
+ export declare const basicProps: {
5
+ clickToRowSelect: {
6
+ type: BooleanConstructor;
7
+ default: boolean;
8
+ };
9
+ isTreeTable: BooleanConstructor;
10
+ tableSetting: {
11
+ type: PropType<TableSetting>;
12
+ default: {};
13
+ };
14
+ inset: BooleanConstructor;
15
+ showTableSetting: BooleanConstructor;
16
+ autoCreateKey: {
17
+ type: BooleanConstructor;
18
+ default: boolean;
19
+ };
20
+ striped: {
21
+ type: BooleanConstructor;
22
+ default: boolean;
23
+ };
24
+ showSummary: BooleanConstructor;
25
+ summaryFunc: {
26
+ type: PropType<(...arg: unknown[]) => unknown[]>;
27
+ default: null;
28
+ };
29
+ summaryData: {
30
+ type: PropType<Recordable[]>;
31
+ default: null;
32
+ };
33
+ indentSize: {
34
+ type: NumberConstructor;
35
+ default: number;
36
+ };
37
+ canColDrag: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ api: {
42
+ type: PropType<(...arg: unknown[]) => Promise<unknown>>;
43
+ default: null;
44
+ };
45
+ beforeFetch: {
46
+ type: PropType<Fn>;
47
+ default: null;
48
+ };
49
+ afterFetch: {
50
+ type: PropType<Fn>;
51
+ default: null;
52
+ };
53
+ handleSearchInfoFn: {
54
+ type: PropType<Fn>;
55
+ default: null;
56
+ };
57
+ immediate: {
58
+ type: BooleanConstructor;
59
+ default: boolean;
60
+ };
61
+ emptyDataIsShowTable: {
62
+ type: BooleanConstructor;
63
+ default: boolean;
64
+ };
65
+ searchInfo: {
66
+ type: PropType<Recordable>;
67
+ default: null;
68
+ };
69
+ defSort: {
70
+ type: PropType<Recordable>;
71
+ default: null;
72
+ };
73
+ useSearchForm: BooleanConstructor;
74
+ columns: {
75
+ type: PropType<BasicColumn[]>;
76
+ default: () => never[];
77
+ };
78
+ showIndexColumn: {
79
+ type: BooleanConstructor;
80
+ default: boolean;
81
+ };
82
+ indexColumnProps: {
83
+ type: PropType<BasicColumn>;
84
+ default: null;
85
+ };
86
+ actionColumn: {
87
+ type: PropType<BasicColumn>;
88
+ default: null;
89
+ };
90
+ ellipsis: {
91
+ type: BooleanConstructor;
92
+ default: boolean;
93
+ };
94
+ isCanResizeParent: {
95
+ type: BooleanConstructor;
96
+ default: boolean;
97
+ };
98
+ canResize: {
99
+ type: BooleanConstructor;
100
+ default: boolean;
101
+ };
102
+ clearSelectOnPageChange: BooleanConstructor;
103
+ resizeHeightOffset: {
104
+ type: NumberConstructor;
105
+ default: number;
106
+ };
107
+ rowSelection: {
108
+ type: PropType<TableRowSelection | null>;
109
+ default: null;
110
+ };
111
+ title: {
112
+ type: PropType<string | ((data: Recordable) => string)>;
113
+ default: null;
114
+ };
115
+ titleHelpMessage: {
116
+ type: PropType<string | string[]>;
117
+ };
118
+ maxHeight: NumberConstructor;
119
+ dataSource: {
120
+ type: PropType<Recordable[]>;
121
+ default: null;
122
+ };
123
+ rowKey: {
124
+ type: PropType<string | ((record: Recordable) => string)>;
125
+ default: string;
126
+ };
127
+ bordered: BooleanConstructor;
128
+ pagination: {
129
+ type: PropType<PaginationProps | boolean>;
130
+ default: null;
131
+ };
132
+ loading: BooleanConstructor;
133
+ rowClassName: {
134
+ type: PropType<(record: TableCustomRecord<unknown>, index: number) => string>;
135
+ };
136
+ scroll: {
137
+ type: PropType<{
138
+ x?: number | string | true;
139
+ y?: number | string;
140
+ }>;
141
+ default: null;
142
+ };
143
+ beforeEditSubmit: {
144
+ type: PropType<(data: {
145
+ record: Recordable;
146
+ index: number;
147
+ key: string | number;
148
+ value: unknown;
149
+ }) => Promise<unknown>>;
150
+ };
151
+ /**
152
+ * 行拖拽
153
+ */
154
+ rowDraggable: {
155
+ type: BooleanConstructor;
156
+ default: boolean;
157
+ };
158
+ /**
159
+ * 仅支持同层级拖拽
160
+ */
161
+ supportSameLevel: {
162
+ type: BooleanConstructor;
163
+ default: boolean;
164
+ };
165
+ /**
166
+ * 拖拽完成自动请求的api
167
+ */
168
+ rowDragApi: {
169
+ type: FunctionConstructor;
170
+ default: null;
171
+ };
172
+ /**
173
+ * tree表格展开行
174
+ */
175
+ expandedRowKeys: {
176
+ type: PropType<string[]>;
177
+ default: () => never[];
178
+ };
179
+ /**
180
+ * 空数据时全屏显示
181
+ */
182
+ emptyFull: {
183
+ type: BooleanConstructor;
184
+ default: boolean;
185
+ };
186
+ };
@@ -0,0 +1,157 @@
1
+ //#region src/components/v-ben-table/src/props.ts
2
+ var basicProps = {
3
+ clickToRowSelect: {
4
+ type: Boolean,
5
+ default: true
6
+ },
7
+ isTreeTable: Boolean,
8
+ tableSetting: {
9
+ type: Object,
10
+ default: {}
11
+ },
12
+ inset: Boolean,
13
+ showTableSetting: Boolean,
14
+ autoCreateKey: {
15
+ type: Boolean,
16
+ default: true
17
+ },
18
+ striped: {
19
+ type: Boolean,
20
+ default: true
21
+ },
22
+ showSummary: Boolean,
23
+ summaryFunc: {
24
+ type: [Function, Array],
25
+ default: null
26
+ },
27
+ summaryData: {
28
+ type: Array,
29
+ default: null
30
+ },
31
+ indentSize: {
32
+ type: Number,
33
+ default: 24
34
+ },
35
+ canColDrag: {
36
+ type: Boolean,
37
+ default: true
38
+ },
39
+ api: {
40
+ type: Function,
41
+ default: null
42
+ },
43
+ beforeFetch: {
44
+ type: Function,
45
+ default: null
46
+ },
47
+ afterFetch: {
48
+ type: Function,
49
+ default: null
50
+ },
51
+ handleSearchInfoFn: {
52
+ type: Function,
53
+ default: null
54
+ },
55
+ immediate: {
56
+ type: Boolean,
57
+ default: true
58
+ },
59
+ emptyDataIsShowTable: {
60
+ type: Boolean,
61
+ default: true
62
+ },
63
+ searchInfo: {
64
+ type: Object,
65
+ default: null
66
+ },
67
+ defSort: {
68
+ type: Object,
69
+ default: null
70
+ },
71
+ useSearchForm: Boolean,
72
+ columns: {
73
+ type: Array,
74
+ default: () => []
75
+ },
76
+ showIndexColumn: {
77
+ type: Boolean,
78
+ default: true
79
+ },
80
+ indexColumnProps: {
81
+ type: Object,
82
+ default: null
83
+ },
84
+ actionColumn: {
85
+ type: Object,
86
+ default: null
87
+ },
88
+ ellipsis: {
89
+ type: Boolean,
90
+ default: true
91
+ },
92
+ isCanResizeParent: {
93
+ type: Boolean,
94
+ default: false
95
+ },
96
+ canResize: {
97
+ type: Boolean,
98
+ default: true
99
+ },
100
+ clearSelectOnPageChange: Boolean,
101
+ resizeHeightOffset: {
102
+ type: Number,
103
+ default: 0
104
+ },
105
+ rowSelection: {
106
+ type: Object,
107
+ default: null
108
+ },
109
+ title: {
110
+ type: [String, Function],
111
+ default: null
112
+ },
113
+ titleHelpMessage: { type: [String, Array] },
114
+ maxHeight: Number,
115
+ dataSource: {
116
+ type: Array,
117
+ default: null
118
+ },
119
+ rowKey: {
120
+ type: [String, Function],
121
+ default: ""
122
+ },
123
+ bordered: Boolean,
124
+ pagination: {
125
+ type: [Object, Boolean],
126
+ default: null
127
+ },
128
+ loading: Boolean,
129
+ rowClassName: { type: Function },
130
+ scroll: {
131
+ type: Object,
132
+ default: null
133
+ },
134
+ beforeEditSubmit: { type: Function },
135
+ rowDraggable: {
136
+ type: Boolean,
137
+ default: false
138
+ },
139
+ supportSameLevel: {
140
+ type: Boolean,
141
+ default: false
142
+ },
143
+ rowDragApi: {
144
+ type: Function,
145
+ default: null
146
+ },
147
+ expandedRowKeys: {
148
+ type: Array,
149
+ default: () => []
150
+ },
151
+ emptyFull: {
152
+ type: Boolean,
153
+ default: false
154
+ }
155
+ };
156
+ //#endregion
157
+ export { basicProps };
@@ -0,0 +1,164 @@
1
+ import { VNodeChild } from 'vue';
2
+ export interface ColumnFilterItem {
3
+ text?: string;
4
+ value?: string;
5
+ children?: IObject[];
6
+ }
7
+ export declare type SortOrder = 'ascend' | 'descend';
8
+ export interface RecordProps<T> {
9
+ text: string;
10
+ record: T;
11
+ index: number;
12
+ }
13
+ export interface FilterDropdownProps {
14
+ prefixCls?: string;
15
+ setSelectedKeys?: (selectedKeys: string[]) => void;
16
+ selectedKeys?: string[];
17
+ confirm?: () => void;
18
+ clearFilters?: () => void;
19
+ filters?: ColumnFilterItem[];
20
+ getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
21
+ visible?: boolean;
22
+ }
23
+ export declare type CustomRenderFunction<T> = (record: RecordProps<T>) => VNodeChild | JSX.Element;
24
+ export interface ColumnProps<T> {
25
+ /**
26
+ * specify how content is aligned
27
+ * @default 'left'
28
+ * @type string
29
+ */
30
+ align?: 'left' | 'right' | 'center';
31
+ /**
32
+ * ellipsize cell content, not working with sorter and filters for now.
33
+ * tableLayout would be fixed when ellipsis is true.
34
+ * @default false
35
+ * @type boolean
36
+ */
37
+ ellipsis?: boolean;
38
+ /**
39
+ * Span of this column's title
40
+ * @type number
41
+ */
42
+ colSpan?: number;
43
+ /**
44
+ * Display field of the data record, could be set like a.b.c
45
+ * @type string
46
+ */
47
+ dataIndex?: string;
48
+ /**
49
+ * Default filtered values
50
+ * @type string[]
51
+ */
52
+ defaultFilteredValue?: string[];
53
+ /**
54
+ * Default order of sorted values: 'ascend' 'descend' null
55
+ * @type string
56
+ */
57
+ defaultSortOrder?: SortOrder;
58
+ /**
59
+ * Customized filter overlay
60
+ * @type any (slot)
61
+ */
62
+ filterDropdown?: VNodeChild | JSX.Element | ((props: FilterDropdownProps) => VNodeChild | JSX.Element);
63
+ /**
64
+ * Whether filterDropdown is visible
65
+ * @type boolean
66
+ */
67
+ filterDropdownVisible?: boolean;
68
+ /**
69
+ * Whether the dataSource is filtered
70
+ * @default false
71
+ * @type boolean
72
+ */
73
+ filtered?: boolean;
74
+ /**
75
+ * Controlled filtered value, filter icon will highlight
76
+ * @type string[]
77
+ */
78
+ filteredValue?: string[];
79
+ /**
80
+ * Customized filter icon
81
+ * @default false
82
+ * @type any
83
+ */
84
+ filterIcon?: boolean | VNodeChild | JSX.Element;
85
+ /**
86
+ * Whether multiple filters can be selected
87
+ * @default true
88
+ * @type boolean
89
+ */
90
+ filterMultiple?: boolean;
91
+ /**
92
+ * Filter menu config
93
+ * @type object[]
94
+ */
95
+ filters?: ColumnFilterItem[];
96
+ /**
97
+ * Set column to be fixed: true(same as left) 'left' 'right'
98
+ * @default false
99
+ * @type boolean | string
100
+ */
101
+ fixed?: boolean | 'left' | 'right';
102
+ /**
103
+ * Unique key of this column, you can ignore this prop if you've set a unique dataIndex
104
+ * @type string
105
+ */
106
+ key?: string;
107
+ /**
108
+ * Renderer of the table cell. The return value should be a VNode, or an object for colSpan/rowSpan config
109
+ * @type Function | ScopedSlot
110
+ */
111
+ customRender?: CustomRenderFunction<T> | VNodeChild | JSX.Element;
112
+ /**
113
+ * Sort function for local sort, see Array.sort's compareFunction. If you need sort buttons only, set to true
114
+ * @type boolean | Function
115
+ */
116
+ sorter?: boolean | Fn;
117
+ /**
118
+ * Order of sorted values: 'ascend' 'descend' false
119
+ * @type boolean | string
120
+ */
121
+ sortOrder?: boolean | SortOrder;
122
+ /**
123
+ * supported sort way, could be 'ascend', 'descend'
124
+ * @default ['ascend', 'descend']
125
+ * @type string[]
126
+ */
127
+ sortDirections?: SortOrder[];
128
+ /**
129
+ * Title of this column
130
+ * @type any (string | slot)
131
+ */
132
+ title?: VNodeChild | JSX.Element;
133
+ /**
134
+ * Width of this column
135
+ * @type string | number
136
+ */
137
+ width?: string | number;
138
+ /**
139
+ * Set props on per cell
140
+ * @type Function
141
+ */
142
+ customCell?: (record: T, rowIndex: number) => object;
143
+ /**
144
+ * Set props on per header cell
145
+ * @type object
146
+ */
147
+ customHeaderCell?: (column: ColumnProps<T>) => object;
148
+ /**
149
+ * Callback executed when the confirm filter button is clicked, Use as a filter event when using template or jsx
150
+ * @type Function
151
+ */
152
+ onFilter?: (value: unknown, record: T) => boolean;
153
+ /**
154
+ * Callback executed when filterDropdownVisible is changed, Use as a filterDropdownVisible event when using template or jsx
155
+ * @type Function
156
+ */
157
+ onFilterDropdownVisibleChange?: (visible: boolean) => void;
158
+ /**
159
+ * When using columns, you can setting this property to configure the properties that support the slot,
160
+ * such as slots: { filterIcon: 'XXX'}
161
+ * @type object
162
+ */
163
+ slots?: IObject;
164
+ }
@@ -0,0 +1 @@
1
+ export type ComponentType = 'Input' | 'InputNumber' | 'Select' | 'ApiSelect' | 'AutoComplete' | 'ApiTreeSelect' | 'Checkbox' | 'Switch' | 'DatePicker' | 'TimePicker' | 'RadioGroup' | 'RadioButtonGroup' | 'ApiRadioGroup';
@@ -0,0 +1,93 @@
1
+ import { default as Pagination } from 'ant-design-vue/lib/pagination';
2
+ import { VNodeChild, VNode } from 'vue';
3
+ export interface PaginationRenderProps {
4
+ page: number;
5
+ type: 'page' | 'prev' | 'next';
6
+ originalElement: VNode;
7
+ }
8
+ type PaginationPositon = 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
9
+ export declare class PaginationConfig extends Pagination {
10
+ position?: PaginationPositon[];
11
+ }
12
+ export interface PaginationProps {
13
+ /**
14
+ * total number of data items
15
+ * @default 0
16
+ * @type number
17
+ */
18
+ total?: number;
19
+ /**
20
+ * default initial page number
21
+ * @default 1
22
+ * @type number
23
+ */
24
+ defaultCurrent?: number;
25
+ /**
26
+ * current page number
27
+ * @type number
28
+ */
29
+ current?: number;
30
+ /**
31
+ * default number of data items per page
32
+ * @default 10
33
+ * @type number
34
+ */
35
+ defaultPageSize?: number;
36
+ /**
37
+ * number of data items per page
38
+ * @type number
39
+ */
40
+ pageSize?: number;
41
+ /**
42
+ * Whether to hide pager on single page
43
+ * @default false
44
+ * @type boolean
45
+ */
46
+ hideOnSinglePage?: boolean;
47
+ /**
48
+ * determine whether pageSize can be changed
49
+ * @default false
50
+ * @type boolean
51
+ */
52
+ showSizeChanger?: boolean;
53
+ /**
54
+ * specify the sizeChanger options
55
+ * @default ['10', '20', '30', '40']
56
+ * @type string[]
57
+ */
58
+ pageSizeOptions?: string[];
59
+ /**
60
+ * determine whether you can jump to pages directly
61
+ * @default false
62
+ * @type boolean
63
+ */
64
+ showQuickJumper?: boolean | object;
65
+ /**
66
+ * to display the total number and range
67
+ * @type Function
68
+ */
69
+ showTotal?: (total: number, range: [number, number]) => IObject;
70
+ /**
71
+ * specify the size of Pagination, can be set to small
72
+ * @default ''
73
+ * @type string
74
+ */
75
+ size?: string;
76
+ /**
77
+ * whether to setting simple mode
78
+ * @type boolean
79
+ */
80
+ simple?: boolean;
81
+ /**
82
+ * to customize item innerHTML
83
+ * @type Function
84
+ */
85
+ itemRender?: (props: PaginationRenderProps) => VNodeChild | JSX.Element;
86
+ /**
87
+ * specify the position of Pagination
88
+ * @default ['bottomRight']
89
+ * @type string[]
90
+ */
91
+ position?: PaginationPositon[];
92
+ }
93
+ export {};