@qin-ui/element-plus-pro 1.0.1 → 1.0.3
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.
- package/es/component-provider/index.js +1 -1
- package/es/core/{index-VQxpXgLX.js → index-DVXUNE-L.js} +0 -2
- package/es/element-plus-pro.css +8 -8
- package/es/form/{index-BvqMIOZ8.js → index-CWHWUZhj.js} +9 -3
- package/es/form/index.js +2 -2
- package/es/index.d.ts +18 -18
- package/es/index.js +3 -3
- package/es/table/index.js +10 -11
- package/package.json +2 -3
|
@@ -268,8 +268,6 @@ const useTable = (params) => {
|
|
|
268
268
|
} else if (columnItem.dataIndex) {
|
|
269
269
|
const dataIndexKey = Array.isArray(columnItem.dataIndex) ? columnItem.dataIndex.join(".") : columnItem.dataIndex;
|
|
270
270
|
matched = dataIndexKey === key;
|
|
271
|
-
} else {
|
|
272
|
-
matched = key === i;
|
|
273
271
|
}
|
|
274
272
|
if (matched) {
|
|
275
273
|
updater({
|
package/es/element-plus-pro.css
CHANGED
|
@@ -34,33 +34,33 @@
|
|
|
34
34
|
.pro-table_size-control_button[data-v-7af52d04] svg {
|
|
35
35
|
transform: scale(1.3);
|
|
36
36
|
}
|
|
37
|
-
.pro-table_column-control_button[data-v-
|
|
37
|
+
.pro-table_column-control_button[data-v-ce445821] {
|
|
38
38
|
display: flex;
|
|
39
39
|
align-items: center;
|
|
40
40
|
padding-right: 12px;
|
|
41
41
|
padding-left: 12px;
|
|
42
42
|
}
|
|
43
|
-
.pro-table_column-control_button[data-v-
|
|
43
|
+
.pro-table_column-control_button[data-v-ce445821] svg {
|
|
44
44
|
transform: scale(1.2, 1.4);
|
|
45
45
|
}
|
|
46
|
-
.pro-table_header[data-v-
|
|
46
|
+
.pro-table_header[data-v-890fd0f5] {
|
|
47
47
|
display: flex;
|
|
48
48
|
align-items: center;
|
|
49
49
|
justify-content: flex-end;
|
|
50
50
|
}
|
|
51
|
-
.pro-table_header[data-v-
|
|
51
|
+
.pro-table_header[data-v-890fd0f5]:empty {
|
|
52
52
|
display: none;
|
|
53
53
|
}
|
|
54
|
-
.pro-table_header + .pro-table_header_content[data-v-
|
|
54
|
+
.pro-table_header + .pro-table_header_content[data-v-890fd0f5] {
|
|
55
55
|
margin-top: 16px;
|
|
56
56
|
}
|
|
57
|
-
.pro-table_header_button-bar[data-v-
|
|
57
|
+
.pro-table_header_button-bar[data-v-890fd0f5] {
|
|
58
58
|
flex: 1;
|
|
59
59
|
}
|
|
60
|
-
.pro-table_header_toolbar[data-v-
|
|
60
|
+
.pro-table_header_toolbar[data-v-890fd0f5] {
|
|
61
61
|
margin-left: 12px;
|
|
62
62
|
}
|
|
63
|
-
.pro-table_pagination[data-v-
|
|
63
|
+
.pro-table_pagination[data-v-890fd0f5] {
|
|
64
64
|
justify-content: flex-end;
|
|
65
65
|
padding: 16px 0;
|
|
66
66
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { inject, computed, provide, toValue, defineComponent, useAttrs, useSlots, watchEffect, createBlock, openBlock, unref, mergeProps, withModifiers, withCtx, createVNode, renderSlot, normalizeProps, guardReactiveProps, resolveComponent, createElementBlock, Fragment, renderList, createSlots, ref, createCommentVNode, resolveDynamicComponent, isVNode, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import { ElFormItem, ElCol, ElTable, ElPagination, useFormDisabled, ElForm, ElTransfer, ElTreeSelect, ElSlider, ElSwitch, ElRadioGroup, ElCheckboxGroup, ElTimeSelect, ElTimePicker, ElDatePicker, ElCascader, ElSelect, ElAutocomplete, ElInputNumber, ElInput, ElRow } from "element-plus";
|
|
3
3
|
import { INJECT_CONFIG, getInjectConfig, INJECT_COMPONENTS } from "../component-provider/index.js";
|
|
4
|
-
import { I as InjectionFormKey, c as camelizeProperties, a as InjectionPathKey, g as getObject, u as useForm$1, b as useFields$1, d as useFormRef$1 } from "../core/index-
|
|
4
|
+
import { I as InjectionFormKey, c as camelizeProperties, a as InjectionPathKey, g as getObject, u as useForm$1, b as useFields$1, d as useFormRef$1 } from "../core/index-DVXUNE-L.js";
|
|
5
5
|
import { i as isPlainObject, t as toPath, o as omit, c as cloneDeep } from "../vendor/utils/lodash-es-p6jau26B.js";
|
|
6
6
|
const tableProps = () => ElTable.props || {};
|
|
7
7
|
const paginationProps = () => ElPagination.props || {};
|
|
@@ -10,10 +10,16 @@ const formItemProps = () => ElFormItem.props || {};
|
|
|
10
10
|
const DisabledContextKey = Symbol("pro-form-disabled-context");
|
|
11
11
|
const useDisabledContext = () => {
|
|
12
12
|
const formDisabled = useFormDisabled();
|
|
13
|
-
return inject(
|
|
13
|
+
return inject(
|
|
14
|
+
DisabledContextKey,
|
|
15
|
+
computed(() => !!formDisabled.value)
|
|
16
|
+
);
|
|
14
17
|
};
|
|
15
18
|
const useDisabledContextProvider = (disabled) => {
|
|
16
|
-
provide(
|
|
19
|
+
provide(
|
|
20
|
+
DisabledContextKey,
|
|
21
|
+
computed(() => !!toValue(disabled))
|
|
22
|
+
);
|
|
17
23
|
};
|
|
18
24
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
19
25
|
...{ name: "ProForm", inheritAttrs: false },
|
package/es/form/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, a, B, b, F, d, T, e, a as a2, h, f, u, g } from "./index-
|
|
2
|
-
import { I, a as a3, e as e2 } from "../core/index-
|
|
1
|
+
import { c, a, B, b, F, d, T, e, a as a2, h, f, u, g } from "./index-CWHWUZhj.js";
|
|
2
|
+
import { I, a as a3, e as e2 } from "../core/index-DVXUNE-L.js";
|
|
3
3
|
export {
|
|
4
4
|
c as BaseField,
|
|
5
5
|
a as BaseForm,
|
package/es/index.d.ts
CHANGED
|
@@ -106,8 +106,8 @@ declare type AdditionalMethods<FormItemInstance> = {
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
declare type AllowStringKey<T, Prefix extends string = ''> = {
|
|
109
|
-
[K in keyof T
|
|
110
|
-
}[keyof
|
|
109
|
+
[K in keyof T as string extends K ? never : number extends K ? never : K extends string ? K : never]: T[K] extends (infer U)[] ? `${Prefix}${K & string}` | (IsRecord<U> extends true ? AllowStringKey<U, `${Prefix}${K & string}[index].`> : never) : IsRecord<T[K]> extends true ? `${Prefix}${K & string}` | AllowStringKey<T[K], `${Prefix}${K & string}.`> : `${Prefix}${K & string}`;
|
|
110
|
+
} extends infer Obj ? Obj[keyof Obj] : never;
|
|
111
111
|
|
|
112
112
|
/**
|
|
113
113
|
* @type {Object} Base - 基础公共字段类型
|
|
@@ -410,8 +410,8 @@ declare const _default_2: <T extends Table<any> = Table>(__VLS_props: NonNullabl
|
|
|
410
410
|
container?: ContainerComponent | false;
|
|
411
411
|
};
|
|
412
412
|
tableContainer?: ContainerComponent | false;
|
|
413
|
-
columns?: Columns<T extends Table<any, infer R extends
|
|
414
|
-
data?: (T extends Table<any, infer R extends
|
|
413
|
+
columns?: Columns<T extends Table<any, infer R extends Data> ? R : any>;
|
|
414
|
+
data?: (T extends Table<any, infer R extends Data> ? R : any)[];
|
|
415
415
|
pagination?: false | Partial<PaginationProps>;
|
|
416
416
|
} & Omit<TableProps, "data">) & Partial<{}>> & PublicProps;
|
|
417
417
|
expose(exposed: ShallowUnwrapRef< {}>): void;
|
|
@@ -739,7 +739,7 @@ declare type SearchFormProps = {
|
|
|
739
739
|
expandButton?: Component<ExpandButtonProps> | DefineComponent<ExpandButtonProps>;
|
|
740
740
|
} & /* @vue-ignore */ _FormProps & AllowedComponentProps;
|
|
741
741
|
|
|
742
|
-
declare type SetColumn<
|
|
742
|
+
declare type SetColumn<T extends Data = Data, C extends BaseColumn<T> = BaseColumn<T>> = (key: Path<T>, column: C | ((pre: Readonly<C>) => C), options?: {
|
|
743
743
|
updateType?: 'rewrite' | 'merge';
|
|
744
744
|
} & UpdateColumnOptions) => void;
|
|
745
745
|
|
|
@@ -762,24 +762,24 @@ export declare type Slots = {
|
|
|
762
762
|
};
|
|
763
763
|
|
|
764
764
|
/**
|
|
765
|
-
* 重新定义 Table 类型,将 Column 类型绑定为 element-plus-pro 的 Column<
|
|
765
|
+
* 重新定义 Table 类型,将 Column 类型绑定为 element-plus-pro 的 Column<T>
|
|
766
766
|
*/
|
|
767
|
-
export declare type Table<D extends Data = Data, T extends
|
|
767
|
+
export declare type Table<D extends Data = Data, T extends Data = ExtendWithAny<D>> = Omit<Table_2<D, T, Column<T>>, 'dataSource'> & {
|
|
768
768
|
/**
|
|
769
769
|
* element-plus table 数据源
|
|
770
770
|
*/
|
|
771
771
|
data: Ref<T[]>;
|
|
772
772
|
};
|
|
773
773
|
|
|
774
|
-
declare type Table_2<D extends Data = Data, T extends
|
|
775
|
-
columns: Ref<Columns_2<
|
|
774
|
+
declare type Table_2<D extends Data = Data, T extends Data = ExtendWithAny<D>, C extends BaseColumn<T> = BaseColumn<T>> = {
|
|
775
|
+
columns: Ref<Columns_2<T, C>>;
|
|
776
776
|
dataSource: Ref<T[]>;
|
|
777
777
|
pageParam: Reactive<PageParam>;
|
|
778
778
|
searchForm: Form_2<D>;
|
|
779
|
-
setColumn: SetColumn<
|
|
780
|
-
deleteColumn: (path: Path<
|
|
781
|
-
appendColumn: (path: Path<
|
|
782
|
-
prependColumn: (path: Path<
|
|
779
|
+
setColumn: SetColumn<T, C>;
|
|
780
|
+
deleteColumn: (path: Path<T> | ColumnFindBy<T, C>, options?: UpdateColumnOptions) => void;
|
|
781
|
+
appendColumn: (path: Path<T> | ColumnFindBy<T, C> | undefined, column: C | Columns_2<T, C>, options?: UpdateColumnOptions) => void;
|
|
782
|
+
prependColumn: (path: Path<T> | ColumnFindBy<T, C> | undefined, column: C | Columns_2<T, C>, options?: UpdateColumnOptions) => void;
|
|
783
783
|
setPageParam: SetPageParam;
|
|
784
784
|
resetQueryParams: () => void;
|
|
785
785
|
};
|
|
@@ -879,10 +879,10 @@ declare const useFormRef_2: <F = any>() => {
|
|
|
879
879
|
setFormRef: (inst: F) => void;
|
|
880
880
|
};
|
|
881
881
|
|
|
882
|
-
export declare const useTable: <D extends Data = Data, T extends
|
|
882
|
+
export declare const useTable: <D extends Data = Data, T extends Data = ExtendWithAny<D>>(params?: UseTableParams<D, T>) => Table<D, T>;
|
|
883
883
|
|
|
884
|
-
declare type UseTableParams<D extends Data = Data, T extends
|
|
885
|
-
columns?: Columns<
|
|
884
|
+
declare type UseTableParams<D extends Data = Data, T extends Data = ExtendWithAny<D>> = {
|
|
885
|
+
columns?: Columns<T>;
|
|
886
886
|
data?: T[];
|
|
887
887
|
pageParam?: PageParam;
|
|
888
888
|
searchParam?: ExtendWithAny<DeepPartial<D>>;
|
|
@@ -911,8 +911,8 @@ declare type WithCommonBase<T = unknown> = T & Omit<FormItemProps, 'label'> & Co
|
|
|
911
911
|
* @template D - 数据对象类型
|
|
912
912
|
*/
|
|
913
913
|
declare type WithComponent<T extends abstract new (...args: any) => any, D extends Data = Data> = WithCommon<{
|
|
914
|
-
slots?: ComponentSlots<T
|
|
915
|
-
} & Omit<ComponentProps<T>, keyof VNodeProps
|
|
914
|
+
slots?: Partial<ComponentSlots<T>>;
|
|
915
|
+
} & Partial<Omit<ComponentProps<T>, keyof VNodeProps>>, D>;
|
|
916
916
|
|
|
917
917
|
declare type WithFields<D extends Data = Data> = WithRef<WithCommonBase & BaseWithFields<D>>;
|
|
918
918
|
|
package/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./element-plus-pro.css";
|
|
2
|
-
import { a as _sfc_main } from "./form/index-
|
|
3
|
-
import { c, B, b, F, d, T, e, h, f, u, g } from "./form/index-
|
|
4
|
-
import { I, a, e as e2 } from "./core/index-
|
|
2
|
+
import { a as _sfc_main } from "./form/index-CWHWUZhj.js";
|
|
3
|
+
import { c, B, b, F, d, T, e, h, f, u, g } from "./form/index-CWHWUZhj.js";
|
|
4
|
+
import { I, a, e as e2 } from "./core/index-DVXUNE-L.js";
|
|
5
5
|
import BaseTable from "./table/index.js";
|
|
6
6
|
import { useTable } from "./table/index.js";
|
|
7
7
|
import _sfc_main$1 from "./component-provider/index.js";
|
package/es/table/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createElementBlock, openBlock, createElementVNode, defineComponent, ref, computed, watch, watchEffect, createBlock, unref, mergeProps, withKeys, withCtx, createVNode, renderSlot, resolveDynamicComponent, createTextVNode, createCommentVNode, Fragment, toDisplayString, normalizeStyle, useModel, renderList, withModifiers, mergeModels, inject, useAttrs, useSlots, onMounted, resolveDirective, normalizeClass, withDirectives, createSlots, normalizeProps, guardReactiveProps, nextTick } from "vue";
|
|
2
2
|
import { ElSpace, ElButton, ElDropdown, ElDropdownMenu, ElDropdownItem, ElCheckbox, ElTableColumn, ElTable, ElPagination } from "element-plus";
|
|
3
|
-
import { _ as _export_sfc, a as _sfc_main$a, t as tableProps, p as paginationProps, b as _sfc_main$b } from "../form/index-
|
|
3
|
+
import { _ as _export_sfc, a as _sfc_main$a, t as tableProps, p as paginationProps, b as _sfc_main$b } from "../form/index-CWHWUZhj.js";
|
|
4
4
|
import { INJECT_CONFIG } from "../component-provider/index.js";
|
|
5
|
-
import { c as camelizeProperties, g as getObject, f as useTable$1 } from "../core/index-
|
|
5
|
+
import { c as camelizeProperties, g as getObject, f as useTable$1 } from "../core/index-DVXUNE-L.js";
|
|
6
6
|
import { g as get, t as toPath, p as pick } from "../vendor/utils/lodash-es-p6jau26B.js";
|
|
7
7
|
const _sfc_main$9 = {};
|
|
8
8
|
const _hoisted_1$5 = {
|
|
@@ -359,12 +359,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
359
359
|
set(val) {
|
|
360
360
|
checkedColumnsOptions.value.forEach((item) => {
|
|
361
361
|
var _a;
|
|
362
|
-
(_a = __props.table) == null ? void 0 : _a.setColumn(
|
|
363
|
-
item.value
|
|
364
|
-
|
|
365
|
-
hidden: !val.includes(item.value)
|
|
366
|
-
}
|
|
367
|
-
);
|
|
362
|
+
(_a = __props.table) == null ? void 0 : _a.setColumn(item.value, {
|
|
363
|
+
hidden: !val.includes(item.value)
|
|
364
|
+
});
|
|
368
365
|
});
|
|
369
366
|
}
|
|
370
367
|
});
|
|
@@ -376,7 +373,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
376
373
|
};
|
|
377
374
|
const toggleColumnsItem = (val) => {
|
|
378
375
|
if (checkedColumnKeys.value.includes(val)) {
|
|
379
|
-
checkedColumnKeys.value = checkedColumnKeys.value.filter(
|
|
376
|
+
checkedColumnKeys.value = checkedColumnKeys.value.filter(
|
|
377
|
+
(item) => item !== val
|
|
378
|
+
);
|
|
380
379
|
} else {
|
|
381
380
|
checkedColumnKeys.value = [...checkedColumnKeys.value, val];
|
|
382
381
|
}
|
|
@@ -457,7 +456,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
457
456
|
};
|
|
458
457
|
}
|
|
459
458
|
});
|
|
460
|
-
const ColumnControl = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
459
|
+
const ColumnControl = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-ce445821"]]);
|
|
461
460
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
462
461
|
...{ name: "TableColumnRenderer" },
|
|
463
462
|
__name: "TableColumnRenderer",
|
|
@@ -832,7 +831,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
832
831
|
};
|
|
833
832
|
}
|
|
834
833
|
});
|
|
835
|
-
const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
834
|
+
const BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-890fd0f5"]]);
|
|
836
835
|
const useTable = (params = {}) => {
|
|
837
836
|
const { data, ...rest } = params;
|
|
838
837
|
const coreTable = useTable$1({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qin-ui/element-plus-pro",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "基于 element-plus 的二次封装组件",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -39,8 +39,7 @@
|
|
|
39
39
|
"@qin-ui/core": "workspace:^",
|
|
40
40
|
"@types/lodash-es": "^4.17.12",
|
|
41
41
|
"element-plus": "^2.13.6",
|
|
42
|
-
"lodash-es": "^4.17.21"
|
|
43
|
-
"vue": "^3.5.29"
|
|
42
|
+
"lodash-es": "^4.17.21"
|
|
44
43
|
},
|
|
45
44
|
"publishConfig": {
|
|
46
45
|
"access": "public",
|