@wfrog/vc-ui 1.11.5 → 1.11.7
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/dist/es/components/explorer/docs/data.d.ts +20 -2
- package/dist/es/components/explorer-table/explorer-table.d.ts +1 -0
- package/dist/es/components/explorer-table/explorer-table.mjs +7 -15
- package/dist/es/components/explorer-table/explorer-table.vue.d.ts +2 -1
- package/dist/es/index.mjs +1 -1
- package/dist/es/use/usePersistentModel/index.mjs +16 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CascaderOption } from 'element-plus/es/components/cascader-panel';
|
|
2
2
|
import { IColumnConfig } from '../../explorer-column-table/explorer-column-table';
|
|
3
3
|
export declare const treeData: CascaderOption[];
|
|
4
|
-
export declare const tableData: {
|
|
4
|
+
export declare const tableData: globalThis.Ref<{
|
|
5
5
|
date: string;
|
|
6
6
|
status: boolean;
|
|
7
7
|
name: string;
|
|
@@ -10,6 +10,24 @@ export declare const tableData: {
|
|
|
10
10
|
address: string;
|
|
11
11
|
zip: string;
|
|
12
12
|
tag: string;
|
|
13
|
-
}[]
|
|
13
|
+
}[], {
|
|
14
|
+
date: string;
|
|
15
|
+
status: boolean;
|
|
16
|
+
name: string;
|
|
17
|
+
state: string;
|
|
18
|
+
city: string;
|
|
19
|
+
address: string;
|
|
20
|
+
zip: string;
|
|
21
|
+
tag: string;
|
|
22
|
+
}[] | {
|
|
23
|
+
date: string;
|
|
24
|
+
status: boolean;
|
|
25
|
+
name: string;
|
|
26
|
+
state: string;
|
|
27
|
+
city: string;
|
|
28
|
+
address: string;
|
|
29
|
+
zip: string;
|
|
30
|
+
tag: string;
|
|
31
|
+
}[]>;
|
|
14
32
|
export declare const columns: IColumnConfig[];
|
|
15
33
|
export declare function columnRender(column: IColumnConfig, row: Record<string, any>, emits: any): any;
|
|
@@ -22,4 +22,5 @@ export interface IExplorerTableEmits {
|
|
|
22
22
|
(e: 'singleSelectionChange', row: Record<string, any>): void;
|
|
23
23
|
(e: 'multipleSelectionChange', row: Record<string, any>, values: Array<string | number>): void;
|
|
24
24
|
(e: 'selectionChange', rows: Record<string, any>[]): void;
|
|
25
|
+
(e: 'selectAll', values: Array<string | number>): void;
|
|
25
26
|
}
|
|
@@ -7,6 +7,7 @@ import '../../chunk/NsldgdCh.mjs';
|
|
|
7
7
|
import '../../chunk/CoGexPPD.mjs';
|
|
8
8
|
import '../../chunk/CjLR27-a.mjs';
|
|
9
9
|
import { defineComponent, h, useCssModule, useTemplateRef, computed, ref, watch, withDirectives, createElementBlock, openBlock, normalizeClass, unref, createVNode, mergeProps, createSlots, withCtx, createBlock, createCommentVNode, renderSlot, withModifiers, isRef, Fragment, renderList, createTextVNode, toDisplayString, resolveDynamicComponent } from 'vue';
|
|
10
|
+
import { promiseTimeout } from '@vueuse/core';
|
|
10
11
|
import { ElTableColumn, ElRadio, ElCheckbox } from 'element-plus';
|
|
11
12
|
import { i as injectExplorerPanelState } from '../explorer-panel/explorer-panel2.mjs';
|
|
12
13
|
import { _ as _export_sfc } from '../../chunk/pcqpp-6-.mjs';
|
|
@@ -32,7 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
32
33
|
startIndex: { default: 0 },
|
|
33
34
|
rowKey: { type: [String, Function], default: "id" }
|
|
34
35
|
},
|
|
35
|
-
emits: ["columnEvent", "singleSelectionChange", "multipleSelectionChange", "selectionChange"],
|
|
36
|
+
emits: ["columnEvent", "singleSelectionChange", "multipleSelectionChange", "selectionChange", "selectAll"],
|
|
36
37
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
37
38
|
const props = __props;
|
|
38
39
|
const emits = __emit;
|
|
@@ -41,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
42
|
const tableRef = useTemplateRef("tableRef");
|
|
42
43
|
const columns = computed(() => state.columnConfig.value.filter((item) => item.visible !== false));
|
|
43
44
|
const selectedValue = ref();
|
|
44
|
-
const selectedValues =
|
|
45
|
+
const selectedValues = computed(() => new Set(props.data.filter((item) => item[props.multipleCheckedKey]).map(getRowValue)));
|
|
45
46
|
const isSingleSelection = computed(() => props.customSelection === "radio");
|
|
46
47
|
const isMultipleSelection = computed(() => props.customSelection === "checkbox");
|
|
47
48
|
const isSelectedAll = computed({
|
|
@@ -55,14 +56,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
55
56
|
if (!isMultipleSelection.value) {
|
|
56
57
|
return;
|
|
57
58
|
}
|
|
58
|
-
if (val) {
|
|
59
|
-
selectedValues.value = new Set(props.data.map(getRowValue));
|
|
60
|
-
} else {
|
|
61
|
-
selectedValues.value.clear();
|
|
62
|
-
}
|
|
63
59
|
props.data.forEach((row) => {
|
|
64
|
-
row.
|
|
60
|
+
row[props.multipleCheckedKey] = val;
|
|
65
61
|
});
|
|
62
|
+
emits("selectAll", Array.from(selectedValues.value));
|
|
66
63
|
}
|
|
67
64
|
});
|
|
68
65
|
const indeterminate = computed(() => {
|
|
@@ -89,10 +86,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
89
86
|
emits("singleSelectionChange", row);
|
|
90
87
|
}
|
|
91
88
|
}
|
|
92
|
-
function handleCheckboxClick(row) {
|
|
93
|
-
|
|
94
|
-
const checked = !row[props.multipleCheckedKey];
|
|
95
|
-
checked ? selectedValues.value.add(value) : selectedValues.value.delete(value);
|
|
89
|
+
async function handleCheckboxClick(row) {
|
|
90
|
+
await promiseTimeout(0);
|
|
96
91
|
emits("multipleSelectionChange", row, Array.from(selectedValues.value));
|
|
97
92
|
}
|
|
98
93
|
function columnType(item) {
|
|
@@ -131,9 +126,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
131
126
|
setSelectedValue: (value) => {
|
|
132
127
|
selectedValue.value = value;
|
|
133
128
|
},
|
|
134
|
-
setSelectedValues: (values) => {
|
|
135
|
-
selectedValues.value = new Set(values);
|
|
136
|
-
},
|
|
137
129
|
selectAll: () => {
|
|
138
130
|
isSelectedAll.value = true;
|
|
139
131
|
},
|
|
@@ -1491,7 +1491,6 @@ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
|
1491
1491
|
declare const __VLS_component: import('vue').DefineComponent<IExplorerTableProps, {
|
|
1492
1492
|
setColumns: (columns: IColumnConfig[]) => void;
|
|
1493
1493
|
setSelectedValue: (value: any) => void;
|
|
1494
|
-
setSelectedValues: (values: any[]) => void;
|
|
1495
1494
|
selectAll: () => void;
|
|
1496
1495
|
clearSelection: () => void;
|
|
1497
1496
|
tableRef: Readonly<globalThis.ShallowRef<import('vue').CreateComponentPublicInstanceWithMixins<Readonly<globalThis.ExtractPropTypes<{
|
|
@@ -2969,11 +2968,13 @@ declare const __VLS_component: import('vue').DefineComponent<IExplorerTableProps
|
|
|
2969
2968
|
singleSelectionChange: (row: Record<string, any>) => any;
|
|
2970
2969
|
multipleSelectionChange: (row: Record<string, any>, values: (string | number)[]) => any;
|
|
2971
2970
|
selectionChange: (rows: Record<string, any>[]) => any;
|
|
2971
|
+
selectAll: (values: (string | number)[]) => any;
|
|
2972
2972
|
}, string, import('vue').PublicProps, Readonly<IExplorerTableProps> & Readonly<{
|
|
2973
2973
|
onColumnEvent?: ((column: IColumnConfig, row: Record<string, any>, value: Record<string, any>) => any) | undefined;
|
|
2974
2974
|
onSingleSelectionChange?: ((row: Record<string, any>) => any) | undefined;
|
|
2975
2975
|
onMultipleSelectionChange?: ((row: Record<string, any>, values: (string | number)[]) => any) | undefined;
|
|
2976
2976
|
onSelectionChange?: ((rows: Record<string, any>[]) => any) | undefined;
|
|
2977
|
+
onSelectAll?: ((values: (string | number)[]) => any) | undefined;
|
|
2977
2978
|
}>, {
|
|
2978
2979
|
loading: boolean;
|
|
2979
2980
|
loadingText: string;
|
package/dist/es/index.mjs
CHANGED
|
@@ -160,7 +160,7 @@ const __vite_glob_0_49 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePr
|
|
|
160
160
|
default: _sfc_main$8
|
|
161
161
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
162
162
|
|
|
163
|
-
const version = "1.11.
|
|
163
|
+
const version = "1.11.7";
|
|
164
164
|
|
|
165
165
|
const modules = /* #__PURE__ */ Object.assign({"./components/awesome-icon/awesome-icon.vue": __vite_glob_0_0,"./components/backbottom/backbottom.vue": __vite_glob_0_1,"./components/button/button.vue": __vite_glob_0_2,"./components/chat-container/chat-container.vue": __vite_glob_0_3,"./components/choice-boolean/choice-boolean.vue": __vite_glob_0_4,"./components/choice/choice.vue": __vite_glob_0_5,"./components/color-switch/color-switch.vue": __vite_glob_0_6,"./components/config-provider/config-provider.vue": __vite_glob_0_7,"./components/cropper/cropper.vue": __vite_glob_0_8,"./components/currency/currency.vue": __vite_glob_0_9,"./components/dark-switch/dark-switch.vue": __vite_glob_0_10,"./components/daterange-picker/daterange-picker.vue": __vite_glob_0_11,"./components/dialog-camera-upload/dialog-camera-upload.vue": __vite_glob_0_12,"./components/dialog-map-point/dialog-map-point.vue": __vite_glob_0_13,"./components/dialog-upload-images/dialog-upload-images.vue": __vite_glob_0_14,"./components/dialog/dialog.vue": __vite_glob_0_15,"./components/drag-verify/drag-verify.vue": __vite_glob_0_16,"./components/drawer/drawer.vue": __vite_glob_0_17,"./components/easy-pagination/easy-pagination.vue": __vite_glob_0_18,"./components/el-icon/el-icon.vue": __vite_glob_0_19,"./components/explorer-column-table/explorer-column-table.vue": __vite_glob_0_20,"./components/explorer-container/explorer-container.vue": __vite_glob_0_21,"./components/explorer-filter/explorer-filter.vue": __vite_glob_0_22,"./components/explorer-footer/explorer-footer.vue": __vite_glob_0_23,"./components/explorer-form/explorer-form.vue": __vite_glob_0_24,"./components/explorer-list/explorer-list.vue": __vite_glob_0_25,"./components/explorer-modal-form/explorer-modal-form.vue": __vite_glob_0_26,"./components/explorer-panel/explorer-panel.vue": __vite_glob_0_27,"./components/explorer-query/explorer-query.vue": __vite_glob_0_28,"./components/explorer-table/explorer-table.vue": __vite_glob_0_29,"./components/explorer-tools/explorer-tools.vue": __vite_glob_0_30,"./components/explorer-tree/explorer-tree.vue": __vite_glob_0_31,"./components/explorer/explorer.vue": __vite_glob_0_32,"./components/flag/flag.vue": __vite_glob_0_33,"./components/form-item/form-item.vue": __vite_glob_0_34,"./components/icon-picker/icon-picker.vue": __vite_glob_0_35,"./components/icon/icon.vue": __vite_glob_0_36,"./components/iconify-icon/iconify-icon.vue": __vite_glob_0_37,"./components/image/image.vue": __vite_glob_0_38,"./components/info-tooltip/info-tooltip.vue": __vite_glob_0_39,"./components/input-number/input-number.vue": __vite_glob_0_40,"./components/input/input.vue": __vite_glob_0_41,"./components/pca-picker/pca-picker.vue": __vite_glob_0_42,"./components/qr-code/qr-code.vue": __vite_glob_0_43,"./components/screenfull/screenfull.vue": __vite_glob_0_44,"./components/scrollbar/scrollbar.vue": __vite_glob_0_45,"./components/select/select.vue": __vite_glob_0_46,"./components/single-player/single-player.vue": __vite_glob_0_47,"./components/splitter-panel/splitter-panel.vue": __vite_glob_0_48,"./components/splitter/splitter.vue": __vite_glob_0_49,"./components/svg-icon/svg-icon.vue": __vite_glob_0_50,"./components/switch/switch.vue": __vite_glob_0_51,"./components/sync-scroll-container/sync-scroll-container.vue": __vite_glob_0_52,"./components/tags/tags.vue": __vite_glob_0_53,"./components/text-ellipsis/text-ellipsis.vue": __vite_glob_0_54,"./components/thousand-input/thousand-input.vue": __vite_glob_0_55,"./components/tinymce/tinymce.vue": __vite_glob_0_56,"./components/transfer-panel/transfer-panel.vue": __vite_glob_0_57,"./components/transfer/transfer.vue": __vite_glob_0_58,"./components/tree-picker/tree-picker.vue": __vite_glob_0_59,"./components/upload-file/upload-file.vue": __vite_glob_0_60});
|
|
166
166
|
const upper = (_, letter) => letter.toUpperCase();
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
import { useStorage } from '@vueuse/core';
|
|
2
2
|
import { getCurrentInstance, computed } from 'vue';
|
|
3
3
|
|
|
4
|
+
function getSafeStorage() {
|
|
5
|
+
if (typeof window === "undefined" || !window.localStorage)
|
|
6
|
+
return void 0;
|
|
7
|
+
try {
|
|
8
|
+
new StorageEvent("storage", { storageArea: window.localStorage });
|
|
9
|
+
return void 0;
|
|
10
|
+
} catch {
|
|
11
|
+
console.warn("当前操作不支持 StorageEvent,将使用 localStorage 的同步 API");
|
|
12
|
+
return {
|
|
13
|
+
getItem: (key) => window.localStorage.getItem(key),
|
|
14
|
+
setItem: (key, value) => window.localStorage.setItem(key, value),
|
|
15
|
+
removeItem: (key) => window.localStorage.removeItem(key)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
4
19
|
function usePersistentModel(key, storageKey, defaultValue, options) {
|
|
5
|
-
const storage = useStorage(storageKey, defaultValue,
|
|
20
|
+
const storage = useStorage(storageKey, defaultValue, getSafeStorage(), options);
|
|
6
21
|
const instance = getCurrentInstance();
|
|
7
22
|
instance?.emit(`update:${key}`, storage.value);
|
|
8
23
|
return computed({
|