@rainbow-oh/yee-c 0.6.3 → 0.6.4

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": "@rainbow-oh/yee-c",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "yee basic components",
5
5
  "keywords": [
6
6
  "react",
@@ -63,7 +63,7 @@
63
63
  border-color: var(--yee-checkbox-border-color);
64
64
  }
65
65
 
66
- &&-checked {
66
+ &@{pls}-checked {
67
67
  @{pls}-inner {
68
68
  --ye-checkbox-checked-border-color: var(
69
69
  --yee-checkbox-disabled-checked-border-color
@@ -38,7 +38,7 @@
38
38
  position: relative;
39
39
  background-color: var(--yee-table-thead-bg-color);
40
40
 
41
- &:not(:last-child):not(@{pls}-expand-col) {
41
+ &:not(:empty):not(:last-child):not(@{pls}-expand-col) {
42
42
  &::before {
43
43
  position: absolute;
44
44
  content: '';
@@ -1,4 +1,8 @@
1
- export default function isEqual(a: unknown, b: unknown) {
1
+ export default function isEqual(
2
+ a: unknown,
3
+ b: unknown,
4
+ seen?: Map<object, Set<object>>,
5
+ ): boolean {
2
6
  // Compare reference types
3
7
  if (a === b) return true;
4
8
 
@@ -18,17 +22,40 @@ export default function isEqual(a: unknown, b: unknown) {
18
22
  return a.source === b.source && a.flags === b.flags;
19
23
  }
20
24
 
21
- // Compare arrays
22
- if (Array.isArray(a) && Array.isArray(b)) {
23
- if (a.length !== b.length) return false;
24
- for (let i = 0; i < a.length; i++) {
25
- if (!isEqual(a[i], b[i])) return false;
26
- }
27
- return true;
25
+ // Compare functions
26
+ if (typeof a === 'function' && typeof b === 'function') {
27
+ return a.toString() === b.toString();
28
28
  }
29
29
 
30
- // Compare objects
30
+ // For objects and arrays, detect circular references
31
31
  if (typeof a === 'object' && typeof b === 'object') {
32
+ if (!seen) {
33
+ seen = new Map();
34
+ }
35
+
36
+ // If we've already started comparing this pair, assume equal to break the cycle
37
+ const seenForA = seen.get(a as object);
38
+ if (seenForA && seenForA.has(b as object)) {
39
+ return true;
40
+ }
41
+
42
+ // Mark this pair as being compared
43
+ if (!seenForA) {
44
+ seen.set(a as object, new Set([b as object]));
45
+ } else {
46
+ seenForA.add(b as object);
47
+ }
48
+
49
+ // Compare arrays
50
+ if (Array.isArray(a) && Array.isArray(b)) {
51
+ if (a.length !== b.length) return false;
52
+ for (let i = 0; i < a.length; i++) {
53
+ if (!isEqual(a[i], b[i], seen)) return false;
54
+ }
55
+ return true;
56
+ }
57
+
58
+ // Compare objects
32
59
  const keysA = Object.keys(a);
33
60
  const keysB = Object.keys(b);
34
61
  if (keysA.length !== keysB.length) return false;
@@ -38,6 +65,7 @@ export default function isEqual(a: unknown, b: unknown) {
38
65
  !isEqual(
39
66
  (a as Record<string, unknown>)[key],
40
67
  (b as Record<string, unknown>)[key],
68
+ seen,
41
69
  )
42
70
  )
43
71
  return false;
@@ -45,11 +73,6 @@ export default function isEqual(a: unknown, b: unknown) {
45
73
  return true;
46
74
  }
47
75
 
48
- // Compare functions
49
- if (typeof a === 'function' && typeof b === 'function') {
50
- return a.toString() === b.toString();
51
- }
52
-
53
76
  // Other cases
54
77
  return false;
55
78
  }
package/src/version.ts CHANGED
@@ -4,7 +4,7 @@ declare global {
4
4
  }
5
5
  }
6
6
 
7
- export const version = "0.6.3";
7
+ export const version = "0.6.4";
8
8
 
9
9
  if (typeof window !== 'undefined') {
10
10
  window.__yee_c_version__ = version;