vueless 0.0.289 → 0.0.291

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.289",
3
+ "version": "0.0.291",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -6,40 +6,34 @@
6
6
  @returns {Object}
7
7
  */
8
8
  export function cloneDeep(entity, cache = new WeakMap()) {
9
- const referenceTypes = ["Array", "Object", "Map", "Set", "Date"];
10
- const entityType = Object.prototype.toString.call(entity);
11
-
12
- if (
13
- !new RegExp(referenceTypes.join("|")).test(entityType) ||
14
- entity instanceof WeakMap ||
15
- entity instanceof WeakSet
16
- ) {
9
+ // primitives
10
+ if (Object(entity) !== entity) {
17
11
  return entity;
18
12
  }
19
13
 
14
+ // cyclic reference
20
15
  if (cache.has(entity)) {
21
16
  return cache.get(entity);
22
17
  }
23
18
 
24
- const c = new entity.constructor();
25
-
26
- if (entity instanceof Map) {
27
- entity.forEach((value, key) => c.set(cloneDeep(key), cloneDeep(value)));
28
- }
29
-
30
- if (entity instanceof Set) {
31
- entity.forEach((value) => c.add(cloneDeep(value)));
32
- }
33
-
34
- if (entity instanceof Date) {
35
- return new Date(entity);
36
- }
37
-
38
- cache.set(entity, c);
19
+ const result =
20
+ entity instanceof Set
21
+ ? new Set(entity)
22
+ : entity instanceof Map
23
+ ? new Map(Array.from(entity, ([key, val]) => [key, cloneDeep(val, cache)]))
24
+ : entity instanceof Date
25
+ ? new Date(entity)
26
+ : entity instanceof RegExp
27
+ ? new RegExp(entity.source, entity.flags)
28
+ : entity.constructor
29
+ ? new entity.constructor()
30
+ : Object.create(null);
31
+
32
+ cache.set(entity, result);
39
33
 
40
34
  return Object.assign(
41
- c,
42
- ...Object.keys(entity).map((prop) => ({ [prop]: cloneDeep(entity[prop], cache) })),
35
+ result,
36
+ ...Object.keys(entity).map((key) => ({ [key]: cloneDeep(entity[key], cache) })),
43
37
  );
44
38
  }
45
39
 
@@ -3,7 +3,9 @@ export default /*tw*/ {
3
3
  dropzoneWrapper: {
4
4
  base: `
5
5
  p-3 size-auto w-full bg-white transition
6
- rounded-dynamic border border-solid border-gray-300 hover:border-gray-400
6
+ rounded-dynamic border border-solid border-gray-300
7
+ hover:border-gray-400 hover:focus-within:border-brand-500 focus-within:border-brand-500
8
+ focus-within:ring-brand-700/15 focus-within:ring-dynamic focus-within:ring-offset-dynamic
7
9
  `,
8
10
  variants: {
9
11
  error: {
@@ -60,6 +60,7 @@
60
60
  :id="id"
61
61
  ref="fileInputRef"
62
62
  type="file"
63
+ :disabled="disabled"
63
64
  :accept="accept"
64
65
  :multiple="multiple"
65
66
  v-bind="inputAttrs"
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.289",
4
+ "version": "0.0.291",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",