@jetbrains/ring-ui-built 8.0.0-beta.4 → 8.0.0-beta.5
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/_helpers/alert.js +3 -0
- package/components/_helpers/caption.js +1 -1
- package/components/_helpers/header.js +1 -1
- package/components/_helpers/table.js +1 -1
- package/components/alert/alert-actions.d.ts +4 -0
- package/components/alert/alert-actions.js +51 -0
- package/components/alert/alert-heading.d.ts +4 -0
- package/components/alert/alert-heading.js +62 -0
- package/components/alert/alert.d.ts +14 -1
- package/components/alert/alert.js +43 -25
- package/components/alert-service/alert-service.d.ts +2 -1
- package/components/alert-service/alert-service.js +15 -5
- package/components/auth/auth-core.d.ts +5 -9
- package/components/auth/auth-core.js +71 -17
- package/components/auth/auth.js +7 -1
- package/components/auth/down-notification.js +7 -1
- package/components/auth/storage.js +7 -1
- package/components/clipboard/clipboard.js +7 -1
- package/components/date-picker/consts.d.ts +1 -0
- package/components/date-picker/date-input.js +3 -2
- package/components/header/header.js +7 -1
- package/components/header/smart-profile.js +7 -1
- package/components/http/http.d.ts +2 -2
- package/components/http/http.js +2 -2
- package/components/i18n/i18n.d.ts +1 -0
- package/components/i18n/i18n.js +2 -0
- package/components/internal/reorder-animation-context.js +159 -0
- package/components/internal/reorder-handle.js +750 -0
- package/components/internal/reorder-layout-context.js +141 -0
- package/components/internal/table-header.js +221 -645
- package/components/internal/{virtual-items.js → virtualization.js} +29 -14
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/storage/storage-local.js +7 -1
- package/components/storage/storage.js +7 -1
- package/components/style.css +1 -1
- package/components/table/default-item-renderer.d.ts +7 -1
- package/components/table/default-item-renderer.js +119 -67
- package/components/table/internal/reorder-animation-context.d.ts +21 -0
- package/components/table/internal/reorder-handle.d.ts +9 -0
- package/components/table/internal/reorder-layout-context.d.ts +16 -0
- package/components/table/internal/table-header.d.ts +1 -4
- package/components/table/internal/{virtual-items.d.ts → virtualization.d.ts} +10 -3
- package/components/table/item-virtualization.d.ts +5 -3
- package/components/table/item-virtualization.js +13 -11
- package/components/table/reorder-animation.d.ts +37 -0
- package/components/table/reorder-animation.js +18 -0
- package/components/table/reorder-item-layout.d.ts +32 -0
- package/components/table/reorder-item-layout.js +57 -0
- package/components/table/table-const.d.ts +0 -32
- package/components/table/table-const.js +1 -8
- package/components/table/table-primitives.d.ts +43 -0
- package/components/table/table-primitives.js +62 -5
- package/components/table/table-props.d.ts +29 -5
- package/components/table/table.d.ts +31 -5
- package/components/table/table.js +177 -170
- package/components/user-agreement/service.js +7 -1
- package/components/user-card/card.js +7 -1
- package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
- package/components/user-card/smart-user-card-tooltip.js +7 -1
- package/components/user-card/tooltip.js +7 -1
- package/components/user-card/user-card.js +7 -1
- package/components/util-stories.d.ts +2 -2
- package/package.json +2 -2
- package/components/internal/column-animation.js +0 -133
- package/components/table/internal/column-animation.d.ts +0 -16
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { c } from 'react/compiler-runtime';
|
|
2
|
-
import { useState, useRef, useEffect } from 'react';
|
|
3
|
-
import { parseCssDuration } from '../global/parse-css-duration.js';
|
|
4
|
-
import { requestAnimationFrameWithCleanup, setTimeoutWithCleanup } from '../global/schedule-with-cleanup.js';
|
|
5
|
-
import { s as styles } from '../_helpers/table.js';
|
|
6
|
-
|
|
7
|
-
const reorderExpectationTimeout = 1000;
|
|
8
|
-
function useColumnAnimation(t0) {
|
|
9
|
-
const $ = c(17);
|
|
10
|
-
if ($[0] !== "3136e2b54bc66931abc9531e502b09d39738e25670fb1469ab6b7e91fc803e97") {
|
|
11
|
-
for (let $i = 0; $i < 17; $i += 1) {
|
|
12
|
-
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
13
|
-
}
|
|
14
|
-
$[0] = "3136e2b54bc66931abc9531e502b09d39738e25670fb1469ab6b7e91fc803e97";
|
|
15
|
-
}
|
|
16
|
-
const {
|
|
17
|
-
disabled,
|
|
18
|
-
tableRef,
|
|
19
|
-
columns
|
|
20
|
-
} = t0;
|
|
21
|
-
const [columnAnimation, setColumnAnimation] = useState(null);
|
|
22
|
-
const pendingColumnReorder = useRef(null);
|
|
23
|
-
let t1;
|
|
24
|
-
if ($[1] !== columns || $[2] !== disabled) {
|
|
25
|
-
t1 = reorderSpec => {
|
|
26
|
-
if (disabled) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const timerId = window.setTimeout(() => {
|
|
30
|
-
pendingColumnReorder.current = null;
|
|
31
|
-
}, reorderExpectationTimeout);
|
|
32
|
-
pendingColumnReorder.current = {
|
|
33
|
-
...reorderSpec,
|
|
34
|
-
timerId,
|
|
35
|
-
columns
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
$[1] = columns;
|
|
39
|
-
$[2] = disabled;
|
|
40
|
-
$[3] = t1;
|
|
41
|
-
} else {
|
|
42
|
-
t1 = $[3];
|
|
43
|
-
}
|
|
44
|
-
const expectColumnReorder = t1;
|
|
45
|
-
let t2;
|
|
46
|
-
let t3;
|
|
47
|
-
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
48
|
-
t2 = () => () => {
|
|
49
|
-
if (pendingColumnReorder.current) {
|
|
50
|
-
window.clearTimeout(pendingColumnReorder.current.timerId);
|
|
51
|
-
pendingColumnReorder.current = null;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
t3 = [];
|
|
55
|
-
$[4] = t2;
|
|
56
|
-
$[5] = t3;
|
|
57
|
-
} else {
|
|
58
|
-
t2 = $[4];
|
|
59
|
-
t3 = $[5];
|
|
60
|
-
}
|
|
61
|
-
useEffect(t2, t3);
|
|
62
|
-
let t4;
|
|
63
|
-
let t5;
|
|
64
|
-
if ($[6] !== columns || $[7] !== tableRef) {
|
|
65
|
-
t4 = () => {
|
|
66
|
-
const table = tableRef.current;
|
|
67
|
-
if (!table || !pendingColumnReorder.current || columns === pendingColumnReorder.current.columns) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
const {
|
|
71
|
-
fromIndex,
|
|
72
|
-
insertionIndex
|
|
73
|
-
} = pendingColumnReorder.current;
|
|
74
|
-
pendingColumnReorder.current = null;
|
|
75
|
-
const columnIndex = fromIndex < insertionIndex ? insertionIndex - 1 : insertionIndex;
|
|
76
|
-
return requestAnimationFrameWithCleanup(() => setColumnAnimation(prev => prev == null ? {
|
|
77
|
-
columnIndex,
|
|
78
|
-
phase: "initial",
|
|
79
|
-
cellClassName: styles.animatedColumnInitial
|
|
80
|
-
} : prev));
|
|
81
|
-
};
|
|
82
|
-
t5 = [columns, tableRef];
|
|
83
|
-
$[6] = columns;
|
|
84
|
-
$[7] = tableRef;
|
|
85
|
-
$[8] = t4;
|
|
86
|
-
$[9] = t5;
|
|
87
|
-
} else {
|
|
88
|
-
t4 = $[8];
|
|
89
|
-
t5 = $[9];
|
|
90
|
-
}
|
|
91
|
-
useEffect(t4, t5);
|
|
92
|
-
let t6;
|
|
93
|
-
let t7;
|
|
94
|
-
if ($[10] !== columnAnimation || $[11] !== tableRef) {
|
|
95
|
-
t6 = () => {
|
|
96
|
-
if (columnAnimation?.phase === "initial") {
|
|
97
|
-
return requestAnimationFrameWithCleanup(() => setColumnAnimation(prev_0 => prev_0 === columnAnimation ? {
|
|
98
|
-
...prev_0,
|
|
99
|
-
phase: "fade-out",
|
|
100
|
-
cellClassName: styles.animatedColumnFadeOut
|
|
101
|
-
} : prev_0));
|
|
102
|
-
}
|
|
103
|
-
if (columnAnimation?.phase === "fade-out") {
|
|
104
|
-
const fadeOutMs = parseCssDuration(window.getComputedStyle(tableRef.current).getPropertyValue("--animated-column-fade-out-duration"));
|
|
105
|
-
return setTimeoutWithCleanup(() => setColumnAnimation(prev_1 => prev_1 === columnAnimation ? null : prev_1), fadeOutMs);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
t7 = [columnAnimation, tableRef];
|
|
109
|
-
$[10] = columnAnimation;
|
|
110
|
-
$[11] = tableRef;
|
|
111
|
-
$[12] = t6;
|
|
112
|
-
$[13] = t7;
|
|
113
|
-
} else {
|
|
114
|
-
t6 = $[12];
|
|
115
|
-
t7 = $[13];
|
|
116
|
-
}
|
|
117
|
-
useEffect(t6, t7);
|
|
118
|
-
let t8;
|
|
119
|
-
if ($[14] !== columnAnimation || $[15] !== expectColumnReorder) {
|
|
120
|
-
t8 = {
|
|
121
|
-
columnAnimation,
|
|
122
|
-
expectColumnReorder
|
|
123
|
-
};
|
|
124
|
-
$[14] = columnAnimation;
|
|
125
|
-
$[15] = expectColumnReorder;
|
|
126
|
-
$[16] = t8;
|
|
127
|
-
} else {
|
|
128
|
-
t8 = $[16];
|
|
129
|
-
}
|
|
130
|
-
return t8;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export { useColumnAnimation };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type RefObject } from 'react';
|
|
2
|
-
import type { Column } from '../table-props';
|
|
3
|
-
import type { ColumnAnimation } from '../table-const';
|
|
4
|
-
export interface ReorderSpec {
|
|
5
|
-
fromIndex: number;
|
|
6
|
-
insertionIndex: number;
|
|
7
|
-
}
|
|
8
|
-
export type ExpectColumnReorder = (reorderSpec: ReorderSpec) => void;
|
|
9
|
-
export declare function useColumnAnimation<T>({ disabled, tableRef, columns, }: {
|
|
10
|
-
disabled: boolean | undefined;
|
|
11
|
-
tableRef: RefObject<HTMLTableElement | null>;
|
|
12
|
-
columns: readonly Column<T>[];
|
|
13
|
-
}): {
|
|
14
|
-
columnAnimation: ColumnAnimation | null;
|
|
15
|
-
expectColumnReorder: ExpectColumnReorder;
|
|
16
|
-
};
|