cosey 0.10.22 → 0.10.23
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/components/form-list/form-list.vue.js +2 -2
- package/components/remote-select/remote-select.js +2 -2
- package/components/table/table-column-editor/list.vue.js +2 -2
- package/components/table/table.vue.js +3 -3
- package/components/upload/upload.js +3 -3
- package/hooks/useUpsert.js +2 -2
- package/package.json +1 -1
- package/router/utils.js +2 -2
- package/utils/index.js +1 -1
- package/utils/string.d.ts +1 -8
- package/utils/string.js +4 -6
|
@@ -14,7 +14,7 @@ import { arrayMove } from '../../utils/array.js';
|
|
|
14
14
|
import { getFormItemWidth } from '../form/useFormItemWidth.js';
|
|
15
15
|
import { useLocale } from '../../hooks/useLocale.js';
|
|
16
16
|
import { useComponentConfig } from '../config-provider/config-provider.api.js';
|
|
17
|
-
import {
|
|
17
|
+
import { auid } from '../../utils/string.js';
|
|
18
18
|
import { createMergedExpose, defineTemplate } from '../../utils/vue.js';
|
|
19
19
|
import { isString, isNumber } from '../../utils/is.js';
|
|
20
20
|
|
|
@@ -187,7 +187,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
187
187
|
props.modelValue.forEach(row => {
|
|
188
188
|
let key = mapRowKey.get(row);
|
|
189
189
|
if (!key) {
|
|
190
|
-
key =
|
|
190
|
+
key = auid();
|
|
191
191
|
}
|
|
192
192
|
newMapRowKey.set(row, key);
|
|
193
193
|
});
|
|
@@ -9,10 +9,10 @@ import stdin_default$2 from '../table/table-query/table-query.js';
|
|
|
9
9
|
import { useComponentConfig, useConfig } from '../config-provider/config-provider.api.js';
|
|
10
10
|
import { useFetch } from '../../hooks/useFetch.js';
|
|
11
11
|
import { createLoading, filterEmptyFormValue } from '../../utils/components.js';
|
|
12
|
-
import { uniqid } from '../../utils/string.js';
|
|
13
12
|
import { bulkBindEvents } from '../../utils/vue.js';
|
|
14
13
|
import { isObject, isFunction } from '../../utils/is.js';
|
|
15
14
|
import { useProps } from '../../hooks/useProps.js';
|
|
15
|
+
import { auid } from '../../utils/string.js';
|
|
16
16
|
|
|
17
17
|
var stdin_default = defineComponent({
|
|
18
18
|
name: "CoRemoteSelect",
|
|
@@ -128,7 +128,7 @@ var stdin_default = defineComponent({
|
|
|
128
128
|
getValue,
|
|
129
129
|
getKey
|
|
130
130
|
} = useProps(props);
|
|
131
|
-
const popperId =
|
|
131
|
+
const popperId = auid();
|
|
132
132
|
const events = bulkBindEvents(remoteSelectEmits, emit);
|
|
133
133
|
const selectProps = computed(() => {
|
|
134
134
|
return omit(props, ["optionProps", "api", "pagination", "formProps", "transformParams", "keys", "immediate"]);
|
|
@@ -4,7 +4,7 @@ import { TransitionGroup as _TransitionGroup } from '../../transition-group/inde
|
|
|
4
4
|
import stdin_default$1 from './item.vue.js';
|
|
5
5
|
import { useDndSort } from '../../dnd-sort/useDndSort.js';
|
|
6
6
|
import { useComponentConfig } from '../../config-provider/config-provider.api.js';
|
|
7
|
-
import {
|
|
7
|
+
import { auid } from '../../../utils/string.js';
|
|
8
8
|
import { arrayMove } from '../../../utils/array.js';
|
|
9
9
|
|
|
10
10
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
@@ -33,7 +33,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
33
33
|
props.nodeList.forEach(node => {
|
|
34
34
|
let key = mapTargetKey.get(node);
|
|
35
35
|
if (!key) {
|
|
36
|
-
key =
|
|
36
|
+
key = auid();
|
|
37
37
|
}
|
|
38
38
|
newMapTargetKey.set(node, key);
|
|
39
39
|
});
|
|
@@ -16,7 +16,7 @@ import stdin_default$3 from './table-stats/table-stats.js';
|
|
|
16
16
|
import { flatColumns } from '../../utils/excel/index.js';
|
|
17
17
|
import { useFullPage } from '../../hooks/useFullPage.js';
|
|
18
18
|
import { useLocale } from '../../hooks/useLocale.js';
|
|
19
|
-
import {
|
|
19
|
+
import { auid } from '../../utils/string.js';
|
|
20
20
|
import { useComponentConfig, useConfig } from '../config-provider/config-provider.api.js';
|
|
21
21
|
import { addPxUnit } from '../../utils/css.js';
|
|
22
22
|
import { isNullish, isObject, isFunction } from '../../utils/is.js';
|
|
@@ -61,7 +61,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
61
61
|
const {
|
|
62
62
|
t
|
|
63
63
|
} = useLocale();
|
|
64
|
-
const tableId =
|
|
64
|
+
const tableId = auid();
|
|
65
65
|
const {
|
|
66
66
|
prefixCls
|
|
67
67
|
} = useComponentConfig("table");
|
|
@@ -550,7 +550,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
550
550
|
"show-summary": false,
|
|
551
551
|
"summary-method": void 0,
|
|
552
552
|
style: {
|
|
553
|
-
|
|
553
|
+
width: "100%"
|
|
554
554
|
},
|
|
555
555
|
height: "100%",
|
|
556
556
|
"max-height": "none"
|
|
@@ -10,7 +10,7 @@ import { getFileType, chooseFiles } from '../../utils/file.js';
|
|
|
10
10
|
import { useLocale } from '../../hooks/useLocale.js';
|
|
11
11
|
import { useComponentConfig } from '../config-provider/config-provider.api.js';
|
|
12
12
|
import { debugWarn } from 'element-plus/es/utils/error.mjs';
|
|
13
|
-
import {
|
|
13
|
+
import { auid } from '../../utils/string.js';
|
|
14
14
|
import { getBasename } from '../../utils/path.js';
|
|
15
15
|
import { isString } from '../../utils/is.js';
|
|
16
16
|
import { isShallowEqual } from '../../utils/array.js';
|
|
@@ -65,7 +65,7 @@ var stdin_default = defineComponent({
|
|
|
65
65
|
size: 0,
|
|
66
66
|
url: item,
|
|
67
67
|
previewUrl: item instanceof File ? URL.createObjectURL(item) : item,
|
|
68
|
-
key:
|
|
68
|
+
key: auid(),
|
|
69
69
|
percent: 0,
|
|
70
70
|
status: "unready",
|
|
71
71
|
controller: null
|
|
@@ -101,7 +101,7 @@ var stdin_default = defineComponent({
|
|
|
101
101
|
size: rawFile.size,
|
|
102
102
|
url: "",
|
|
103
103
|
previewUrl: URL.createObjectURL(rawFile),
|
|
104
|
-
key:
|
|
104
|
+
key: auid(),
|
|
105
105
|
status: "ready",
|
|
106
106
|
percent: 0,
|
|
107
107
|
controller: null
|
package/hooks/useUpsert.js
CHANGED
|
@@ -3,7 +3,7 @@ import { cloneDeep, pick } from 'lodash-es';
|
|
|
3
3
|
import { ref, computed, unref, reactive, shallowRef, useTemplateRef, readonly, nextTick } from 'vue';
|
|
4
4
|
import { toRefs } from '@vueuse/core';
|
|
5
5
|
import { useLocale } from './useLocale.js';
|
|
6
|
-
import {
|
|
6
|
+
import { auid } from '../utils/string.js';
|
|
7
7
|
import { deepAssign } from '../utils/object.js';
|
|
8
8
|
|
|
9
9
|
const mapTypeTitle = {
|
|
@@ -50,7 +50,7 @@ function useUpsert(options) {
|
|
|
50
50
|
const row = shallowRef();
|
|
51
51
|
let addParams = [];
|
|
52
52
|
let editParams = [];
|
|
53
|
-
const formRefKey =
|
|
53
|
+
const formRefKey = auid();
|
|
54
54
|
const formRef = useTemplateRef(formRefKey);
|
|
55
55
|
const onSubmit = async () => {
|
|
56
56
|
let res;
|
package/package.json
CHANGED
package/router/utils.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { auid } from '../utils/string.js';
|
|
2
2
|
|
|
3
3
|
function defineRoute(route) {
|
|
4
4
|
function recur(route2, index = 0, parent) {
|
|
5
5
|
const meta = route2.meta || {};
|
|
6
6
|
const newRoute = {
|
|
7
7
|
...route2,
|
|
8
|
-
name: route2.name ||
|
|
8
|
+
name: route2.name || auid(),
|
|
9
9
|
meta: {
|
|
10
10
|
...meta,
|
|
11
11
|
closable: meta.closable ?? true,
|
package/utils/index.js
CHANGED
|
@@ -10,7 +10,7 @@ export { isBoolean, isEmpty, isFunction, isNullish, isNumber, isObject, isPlainO
|
|
|
10
10
|
export { minmax } from './number.js';
|
|
11
11
|
export { deepAssign, initObject, omitObject, omitUndefined, uniformAssign } from './object.js';
|
|
12
12
|
export { getBasename, getExtname } from './path.js';
|
|
13
|
-
export {
|
|
13
|
+
export { auid } from './string.js';
|
|
14
14
|
export { Scope, addNullablePlaceholder, bulkBindEvents, createMergedExpose, defineTemplate, getVNodeText } from './vue.js';
|
|
15
15
|
export { note, noteOnce, resetWarned, warning, warningOnce } from './warning.js';
|
|
16
16
|
export { findCSSNode, insertCSS, removeCSS, updateCSS, updateCSSByStyle } from './dynamicCSS.js';
|
package/utils/string.d.ts
CHANGED
package/utils/string.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function uniqid(prefix = "co-") {
|
|
5
|
-
return prefix + uuid();
|
|
1
|
+
let counter = 0;
|
|
2
|
+
function auid(prefix = "__co_") {
|
|
3
|
+
return prefix + (~~(Math.random() * 1e9)).toString(36) + "-" + (++counter).toString(36);
|
|
6
4
|
}
|
|
7
5
|
|
|
8
|
-
export {
|
|
6
|
+
export { auid };
|