sprintify-ui 0.10.58 → 0.10.59

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.
@@ -0,0 +1 @@
1
+ export declare function randomId(length: number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.10.58",
3
+ "version": "0.10.59",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "rimraf dist && vue-tsc && vite build",
@@ -14,7 +14,7 @@
14
14
  </template>
15
15
 
16
16
  <script lang="ts" setup>
17
- import { uniqueId } from 'lodash';
17
+ import { randomId } from '@/utils/uuid';
18
18
  import Sortable from 'sortablejs';
19
19
 
20
20
  const props = withDefaults(defineProps<{
@@ -35,7 +35,7 @@ const emit = defineEmits(['update:modelValue']);
35
35
  const elementsRef = ref<HTMLElement | null>(null);
36
36
 
37
37
  function getKey(element: any) {
38
- return element[props.itemKey] ?? uniqueId();
38
+ return element[props.itemKey] ?? randomId(32);
39
39
  }
40
40
 
41
41
  let sortable = null as Sortable | null;
@@ -0,0 +1,8 @@
1
+ export function randomId(length: number): string {
2
+ const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
3
+ let result = '';
4
+ for (let i = 0; i < length; i++) {
5
+ result += characters.charAt(Math.floor(Math.random() * characters.length));
6
+ }
7
+ return result;
8
+ }