@jetbrains/ring-ui-built 8.0.0-beta.2 → 8.0.0-beta.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/components/_helpers/anchor.js +1 -1
- package/components/_helpers/avatar-info.js +1 -1
- package/components/_helpers/heading.js +2 -2
- package/components/_helpers/icon-svg.js +1 -1
- package/components/_helpers/legacy-table.js +3 -0
- package/components/_helpers/tab-link.js +1 -1
- package/components/_helpers/table.js +1 -1
- package/components/_helpers/theme.js +50 -38
- package/components/alert/alert.js +2 -2
- package/components/alert-service/alert-service.js +1 -1
- package/components/auth/auth-core.js +1 -1
- package/components/auth/auth.js +1 -1
- package/components/auth/down-notification.js +1 -1
- package/components/auth/iframe-flow.js +2 -2
- package/components/auth/storage.js +1 -1
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/auth-dialog-service/auth-dialog-service.js +2 -2
- package/components/avatar/avatar-info.js +1 -1
- package/components/avatar/avatar.js +1 -1
- package/components/avatar/fallback-avatar.js +1 -1
- package/components/avatar-stack/avatar-stack.js +1 -1
- package/components/banner/banner.js +1 -1
- package/components/button/button.js +1 -1
- package/components/button-group/button-group.js +1 -1
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/checkbox/checkbox.js +1 -1
- package/components/clipboard/clipboard.js +1 -1
- package/components/collapse/collapse-content.js +5 -5
- package/components/collapse/collapse-control.js +5 -5
- package/components/collapse/collapse.js +4 -4
- package/components/collapsible-group/collapsible-group.d.ts +20 -0
- package/components/collapsible-group/collapsible-group.js +382 -0
- package/components/components/util-stories.js +63 -1
- package/components/confirm/confirm.js +1 -1
- package/components/confirm-service/confirm-service.js +2 -2
- package/components/contenteditable/contenteditable.js +1 -1
- package/components/control-help/control-help.js +1 -1
- package/components/control-label/control-label.js +1 -1
- package/components/data-list/data-list.d.ts +1 -1
- package/components/data-list/data-list.js +1 -1
- package/components/data-list/data-list.mock.d.ts +1 -1
- package/components/data-list/data-list.mock.js +1 -1
- package/components/data-list/item.d.ts +1 -1
- package/components/data-list/item.js +1 -1
- package/components/data-list/selection.d.ts +1 -1
- package/components/data-list/selection.js +2 -2
- package/components/data-list/title.js +1 -1
- package/components/date-picker/date-input.js +1 -1
- package/components/date-picker/date-picker.js +1 -2
- package/components/date-picker/date-popup.js +4 -5
- package/components/date-picker/month-names.js +1 -1
- package/components/date-picker/month-slider.js +1 -1
- package/components/date-picker/month.js +1 -1
- package/components/date-picker/months.js +4 -5
- package/components/date-picker/use-scroll-behavior.js +45 -44
- package/components/date-picker/weekdays.js +1 -1
- package/components/date-picker/years.js +6 -7
- package/components/dialog/dialog.d.ts +2 -2
- package/components/dialog/dialog.js +3 -3
- package/components/dropdown/anchor.js +1 -1
- package/components/dropdown/dropdown.js +1 -1
- package/components/dropdown-menu/dropdown-menu.d.ts +4 -4
- package/components/dropdown-menu/dropdown-menu.js +68 -63
- package/components/editable-heading/editable-heading.d.ts +1 -2
- package/components/editable-heading/editable-heading.js +127 -113
- package/components/error-bubble/error-bubble.js +1 -1
- package/components/error-message/error-message.js +1 -1
- package/components/expand/collapsible-group.d.ts +8 -16
- package/components/expand/collapsible-group.js +34 -364
- package/components/footer/footer.js +1 -1
- package/components/global/compose-refs.d.ts +2 -1
- package/components/global/compose-refs.js +44 -8
- package/components/global/create-stateful-context.js +11 -11
- package/components/global/focus-sensor-hoc.js +1 -0
- package/components/global/focus-with-temporary-tabindex.d.ts +11 -0
- package/components/global/focus-with-temporary-tabindex.js +23 -0
- package/components/global/intersection-observer-context.d.ts +31 -11
- package/components/global/intersection-observer-context.js +55 -57
- package/components/global/is-within-interactive-element.d.ts +6 -0
- package/components/global/is-within-interactive-element.js +11 -0
- package/components/global/is-within-navigable-element.d.ts +6 -0
- package/components/global/is-within-navigable-element.js +11 -0
- package/components/global/parse-css-duration.d.ts +5 -0
- package/components/global/parse-css-duration.js +14 -0
- package/components/global/rerender-hoc.d.ts +4 -2
- package/components/global/rerender-hoc.js +11 -24
- package/components/global/schedule-with-cleanup.d.ts +12 -0
- package/components/global/schedule-with-cleanup.js +36 -0
- package/components/{legacy-table/selection.d.ts → global/table-selection.d.ts} +14 -14
- package/components/{legacy-table/selection.js → global/table-selection.js} +4 -4
- package/components/global/theme.d.ts +4 -3
- package/components/global/theme.js +2 -2
- package/components/header/header-icon.js +1 -1
- package/components/header/header.js +2 -2
- package/components/header/links.js +1 -1
- package/components/header/logo.js +1 -1
- package/components/header/profile.js +1 -1
- package/components/header/services.js +1 -1
- package/components/header/smart-profile.js +1 -1
- package/components/header/smart-services.js +1 -1
- package/components/heading/heading.js +4 -4
- package/components/i18n/i18n-context.js +4 -4
- package/components/icon/icon-svg.js +1 -1
- package/components/icon/icon.js +1 -1
- package/components/icon/index.js +1 -1
- package/components/input/input.d.ts +1 -1
- package/components/input/input.js +1 -1
- package/components/internal/column-animation.js +133 -0
- package/components/internal/table-header.js +1109 -0
- package/components/internal/virtual-items.js +353 -0
- package/components/island/adaptive-island-hoc.js +3 -3
- package/components/island/content.d.ts +7 -2
- package/components/island/content.js +27 -18
- package/components/island/header.js +1 -1
- package/components/island/island.js +1 -1
- package/components/legacy-table/cell.js +1 -1
- package/components/legacy-table/header-cell.js +4 -4
- package/components/legacy-table/header.js +2 -2
- package/components/legacy-table/multitable.d.ts +1 -1
- package/components/legacy-table/row-with-focus-sensor.js +2 -2
- package/components/legacy-table/row.d.ts +1 -1
- package/components/legacy-table/row.js +4 -4
- package/components/legacy-table/selection-adapter.d.ts +3 -3
- package/components/legacy-table/selection-shortcuts-hoc.d.ts +5 -5
- package/components/legacy-table/simple-table.d.ts +2 -2
- package/components/legacy-table/simple-table.js +4 -4
- package/components/legacy-table/smart-table.d.ts +5 -5
- package/components/legacy-table/smart-table.js +5 -5
- package/components/legacy-table/table.js +2 -2
- package/components/list/list-item.js +1 -1
- package/components/list/list-users-groups-source.js +1 -1
- package/components/list/list.js +1 -1
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/login-dialog/service.js +2 -2
- package/components/markdown/markdown.js +2 -2
- package/components/message/message.js +2 -2
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/pager/pager.js +1 -1
- package/components/popup/popup.d.ts +2 -0
- package/components/popup/popup.js +6 -2
- package/components/popup/popup.target.d.ts +3 -2
- package/components/popup/popup.target.js +32 -28
- package/components/popup-menu/popup-menu.js +1 -1
- package/components/query-assist/query-assist-suggestions.js +1 -1
- package/components/query-assist/query-assist.d.ts +3 -1
- package/components/query-assist/query-assist.js +2 -2
- package/components/radio/radio-item.d.ts +3 -3
- package/components/radio/radio-item.js +32 -18
- package/components/radio/radio.d.ts +2 -2
- package/components/radio/radio.js +2 -2
- package/components/scrollable-section/scrollable-section.js +1 -1
- package/components/select/chevron-button.js +1 -1
- package/components/select/select-filter.js +1 -1
- package/components/select/select-popup.d.ts +1 -1
- package/components/select/select-popup.js +1 -1
- package/components/select/select.d.ts +4 -2
- package/components/select/select.js +1 -1
- package/components/slider/slider.js +100 -96
- package/components/storage/storage-local.js +1 -1
- package/components/storage/storage.js +1 -1
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.d.ts +3 -3
- package/components/tab-trap/tab-trap.js +83 -80
- package/components/table/default-item-renderer.d.ts +35 -11
- package/components/table/default-item-renderer.js +118 -171
- package/components/table/internal/column-animation.d.ts +16 -0
- package/components/table/internal/table-header.d.ts +4 -0
- package/components/table/internal/virtual-items.d.ts +34 -0
- package/components/table/item-virtualization.d.ts +35 -0
- package/components/table/item-virtualization.js +71 -0
- package/components/table/table-const.d.ts +40 -6
- package/components/table/table-const.js +15 -6
- package/components/table/table-primitives.d.ts +21 -0
- package/components/table/table-primitives.js +123 -0
- package/components/table/table-props.d.ts +280 -0
- package/components/table/table-props.js +1 -0
- package/components/table/table.d.ts +205 -224
- package/components/table/table.js +356 -14
- package/components/tabs/collapsible-more.js +1 -1
- package/components/tabs/collapsible-tab.js +1 -1
- package/components/tabs/collapsible-tabs.js +1 -1
- package/components/tabs/dumb-tabs.js +1 -1
- package/components/tabs/smart-tabs.js +1 -1
- package/components/tabs/tab-link.js +1 -1
- package/components/tabs/tabs.js +1 -1
- package/components/tag/tag.js +1 -1
- package/components/tags-input/tags-input.d.ts +3 -1
- package/components/tags-input/tags-input.js +1 -1
- package/components/tags-list/tags-list.js +1 -1
- package/components/toggle/toggle.js +1 -1
- package/components/tooltip/tooltip.js +3 -3
- package/components/upload/upload.d.ts +4 -3
- package/components/upload/upload.js +7 -29
- package/components/user-agreement/service.js +8 -8
- package/components/user-agreement/user-agreement.js +1 -1
- package/components/user-card/card.js +1 -1
- package/components/user-card/smart-user-card-tooltip.js +1 -1
- package/components/user-card/tooltip.js +1 -1
- package/components/user-card/user-card.js +1 -1
- package/components/util-stories.d.ts +26 -0
- package/package.json +7 -7
- package/components/_helpers/table2.js +0 -3
- package/components/date-picker/use-intersection-observer.d.ts +0 -6
- package/components/date-picker/use-intersection-observer.js +0 -93
- package/components/global/composeRefs.d.ts +0 -6
- package/components/global/composeRefs.js +0 -9
- package/components/global/use-event-callback.d.ts +0 -1
- package/components/global/use-event-callback.js +0 -44
- package/components/table/table-base.d.ts +0 -24
- package/components/table/table-base.js +0 -311
- package/components/table/table-component.d.ts +0 -53
- package/components/table/table-component.js +0 -316
- package/components/table/table-virtualize.d.ts +0 -32
- package/components/table/table-virtualize.js +0 -330
|
@@ -1,44 +1,57 @@
|
|
|
1
|
-
import { c } from 'react
|
|
2
|
-
import { useState, useEffect,
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { useState, useEffect, use, createContext } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
const noopIntersectionObserverHandle = {
|
|
8
|
+
observe: () => () => {}
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Multiple components can share a single `IntersectionObserver` instance through this context.
|
|
12
|
+
*
|
|
5
13
|
* Usage:
|
|
6
14
|
*
|
|
7
15
|
* ```tsx
|
|
8
|
-
* <IntersectionObserverContext
|
|
16
|
+
* <IntersectionObserverContext value={useIntersectionObserverHandle()}>
|
|
9
17
|
* <YourComponent />
|
|
10
|
-
* </IntersectionObserverContext
|
|
18
|
+
* </IntersectionObserverContext>
|
|
11
19
|
*
|
|
12
20
|
* function YourComponent() {
|
|
13
21
|
* // Contains the current isIntersecting value
|
|
14
22
|
* const isIntersecting = useIsIntersecting(elementRef);
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
23
|
+
*
|
|
24
|
+
* // Or, to manually work with the IntersectionObserverHandle:
|
|
25
|
+
* const handle = use(IntersectionObserverContext);
|
|
26
|
+
* useEffect(() => {
|
|
27
|
+
* return handle.observe(elementRef.current, isIntersecting => { ... })
|
|
18
28
|
* })
|
|
19
29
|
* }
|
|
20
30
|
* ```
|
|
21
31
|
*/
|
|
22
|
-
const IntersectionObserverContext = /*#__PURE__*/createContext(
|
|
32
|
+
const IntersectionObserverContext = /*#__PURE__*/createContext(noopIntersectionObserverHandle);
|
|
33
|
+
/**
|
|
34
|
+
* Creates an IntersectionObserverHandle suitable for {@link IntersectionObserverContext}.
|
|
35
|
+
*/
|
|
23
36
|
function useIntersectionObserverHandle(rootRef, rootMargin, scrollMargin) {
|
|
24
37
|
const $ = c(6);
|
|
25
|
-
if ($[0] !== "
|
|
38
|
+
if ($[0] !== "22e72f21c77e0579b51b95d0c9cf49c7e0027190e5186ad64aa7f2054bb7eb35") {
|
|
26
39
|
for (let $i = 0; $i < 6; $i += 1) {
|
|
27
40
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
28
41
|
}
|
|
29
|
-
$[0] = "
|
|
42
|
+
$[0] = "22e72f21c77e0579b51b95d0c9cf49c7e0027190e5186ad64aa7f2054bb7eb35";
|
|
30
43
|
}
|
|
31
|
-
const [handle, setHandle] = useState(
|
|
44
|
+
const [handle, setHandle] = useState(noopIntersectionObserverHandle);
|
|
32
45
|
let t0;
|
|
33
46
|
let t1;
|
|
34
47
|
if ($[1] !== rootMargin || $[2] !== rootRef || $[3] !== scrollMargin) {
|
|
35
48
|
t0 = () => {
|
|
36
49
|
const root = rootRef?.current;
|
|
37
|
-
const
|
|
50
|
+
const callbacksByElement = new Map();
|
|
38
51
|
const observer = new IntersectionObserver(entries => {
|
|
39
52
|
for (const entry of entries) {
|
|
40
|
-
const
|
|
41
|
-
|
|
53
|
+
const callbacks = callbacksByElement.get(entry.target);
|
|
54
|
+
callbacks?.forEach(cb => cb(entry.isIntersecting));
|
|
42
55
|
}
|
|
43
56
|
}, {
|
|
44
57
|
root,
|
|
@@ -46,18 +59,31 @@ function useIntersectionObserverHandle(rootRef, rootMargin, scrollMargin) {
|
|
|
46
59
|
scrollMargin: scrollMargin != null ? `${scrollMargin}px` : undefined
|
|
47
60
|
});
|
|
48
61
|
setHandle({
|
|
49
|
-
observe(element,
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
observe(element, onChange) {
|
|
63
|
+
if (!callbacksByElement.has(element)) {
|
|
64
|
+
callbacksByElement.set(element, []);
|
|
65
|
+
observer.observe(element);
|
|
66
|
+
}
|
|
67
|
+
callbacksByElement.get(element).push(onChange);
|
|
52
68
|
return () => {
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
const callbacks_0 = callbacksByElement.get(element);
|
|
70
|
+
if (!callbacks_0) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const index = callbacks_0.indexOf(onChange);
|
|
74
|
+
if (index !== -1) {
|
|
75
|
+
callbacks_0.splice(index, 1);
|
|
76
|
+
}
|
|
77
|
+
if (!callbacks_0.length) {
|
|
78
|
+
callbacksByElement.delete(element);
|
|
79
|
+
observer.unobserve(element);
|
|
80
|
+
}
|
|
55
81
|
};
|
|
56
82
|
}
|
|
57
83
|
});
|
|
58
84
|
return () => {
|
|
59
85
|
observer.disconnect();
|
|
60
|
-
setHandle(
|
|
86
|
+
setHandle(noopIntersectionObserverHandle);
|
|
61
87
|
};
|
|
62
88
|
};
|
|
63
89
|
t1 = [rootRef, rootMargin, scrollMargin];
|
|
@@ -73,27 +99,30 @@ function useIntersectionObserverHandle(rootRef, rootMargin, scrollMargin) {
|
|
|
73
99
|
useEffect(t0, t1);
|
|
74
100
|
return handle;
|
|
75
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Returns whether the referenced element is currently intersecting.
|
|
104
|
+
*/
|
|
76
105
|
function useIsIntersecting(elementRef) {
|
|
77
106
|
const $ = c(5);
|
|
78
|
-
if ($[0] !== "
|
|
107
|
+
if ($[0] !== "22e72f21c77e0579b51b95d0c9cf49c7e0027190e5186ad64aa7f2054bb7eb35") {
|
|
79
108
|
for (let $i = 0; $i < 5; $i += 1) {
|
|
80
109
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
81
110
|
}
|
|
82
|
-
$[0] = "
|
|
111
|
+
$[0] = "22e72f21c77e0579b51b95d0c9cf49c7e0027190e5186ad64aa7f2054bb7eb35";
|
|
83
112
|
}
|
|
84
|
-
const handle =
|
|
113
|
+
const handle = use(IntersectionObserverContext);
|
|
85
114
|
const [isIntersecting, setIsIntersecting] = useState(false);
|
|
86
115
|
let t0;
|
|
87
116
|
let t1;
|
|
88
117
|
if ($[1] !== elementRef || $[2] !== handle) {
|
|
89
118
|
t0 = () => {
|
|
90
119
|
const element = elementRef.current;
|
|
91
|
-
if (!element
|
|
120
|
+
if (!element) {
|
|
92
121
|
return;
|
|
93
122
|
}
|
|
94
123
|
return handle.observe(element, setIsIntersecting);
|
|
95
124
|
};
|
|
96
|
-
t1 = [handle, elementRef
|
|
125
|
+
t1 = [handle, elementRef];
|
|
97
126
|
$[1] = elementRef;
|
|
98
127
|
$[2] = handle;
|
|
99
128
|
$[3] = t0;
|
|
@@ -105,36 +134,5 @@ function useIsIntersecting(elementRef) {
|
|
|
105
134
|
useEffect(t0, t1);
|
|
106
135
|
return isIntersecting;
|
|
107
136
|
}
|
|
108
|
-
function useIsIntersectingListener(elementRef, onChange) {
|
|
109
|
-
const $ = c(6);
|
|
110
|
-
if ($[0] !== "499977ecd94e47a8c69d7083d0cd9908aa1ee1ef3ab3ce80135833f3d85e5429") {
|
|
111
|
-
for (let $i = 0; $i < 6; $i += 1) {
|
|
112
|
-
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
113
|
-
}
|
|
114
|
-
$[0] = "499977ecd94e47a8c69d7083d0cd9908aa1ee1ef3ab3ce80135833f3d85e5429";
|
|
115
|
-
}
|
|
116
|
-
const handle = useContext(IntersectionObserverContext);
|
|
117
|
-
let t0;
|
|
118
|
-
let t1;
|
|
119
|
-
if ($[1] !== elementRef || $[2] !== handle || $[3] !== onChange) {
|
|
120
|
-
t0 = () => {
|
|
121
|
-
const element = elementRef.current;
|
|
122
|
-
if (!element || !handle) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
return handle.observe(element, onChange);
|
|
126
|
-
};
|
|
127
|
-
t1 = [handle, elementRef, onChange];
|
|
128
|
-
$[1] = elementRef;
|
|
129
|
-
$[2] = handle;
|
|
130
|
-
$[3] = onChange;
|
|
131
|
-
$[4] = t0;
|
|
132
|
-
$[5] = t1;
|
|
133
|
-
} else {
|
|
134
|
-
t0 = $[4];
|
|
135
|
-
t1 = $[5];
|
|
136
|
-
}
|
|
137
|
-
useEffect(t0, t1);
|
|
138
|
-
}
|
|
139
137
|
|
|
140
|
-
export { IntersectionObserverContext, useIntersectionObserverHandle, useIsIntersecting
|
|
138
|
+
export { IntersectionObserverContext, useIntersectionObserverHandle, useIsIntersecting };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If this function returns `false`, the event may be interpreted as a click
|
|
3
|
+
* or tap on a "empty space" rather than on an interactive element such as
|
|
4
|
+
* a button or a link.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isWithinInteractiveElement(target: EventTarget | null): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const interactiveSelector = ['a', 'button', 'details', 'input', 'label', 'option', 'select', 'summary', 'textarea', '[contenteditable]', '[role="button"]', '[role="checkbox"]', '[role="link"]', '[role="radio"]', '[role="switch"]', '[role="tab"]'].join();
|
|
2
|
+
/**
|
|
3
|
+
* If this function returns `false`, the event may be interpreted as a click
|
|
4
|
+
* or tap on a "empty space" rather than on an interactive element such as
|
|
5
|
+
* a button or a link.
|
|
6
|
+
*/
|
|
7
|
+
function isWithinInteractiveElement(target) {
|
|
8
|
+
return target instanceof Element && target.closest(interactiveSelector) != null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { isWithinInteractiveElement };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether the event target is within an element that is expected to
|
|
3
|
+
* handle keyboard navigation itself, so container-level keyboard shortcuts
|
|
4
|
+
* should generally be ignored.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isWithinNavigableElement(target: EventTarget | null): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const navigableSelector = ['input:not([type="button"]):not([type="checkbox"]):not([type="color"]):not([type="file"]):not([type="hidden"]):not([type="image"]):not([type="reset"]):not([type="submit"])', 'textarea', 'select', '[contenteditable]', '[role="combobox"]', '[role="grid"]', '[role="listbox"]', '[role="menu"]', '[role="menubar"]', '[role="radiogroup"]', '[role="searchbox"]', '[role="slider"]', '[role="spinbutton"]', '[role="tablist"]', '[role="textbox"]', '[role="tree"]', '[role="treegrid"]'].join();
|
|
2
|
+
/**
|
|
3
|
+
* Returns whether the event target is within an element that is expected to
|
|
4
|
+
* handle keyboard navigation itself, so container-level keyboard shortcuts
|
|
5
|
+
* should generally be ignored.
|
|
6
|
+
*/
|
|
7
|
+
function isWithinNavigableElement(target) {
|
|
8
|
+
return target instanceof Element && target.closest(navigableSelector) != null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { isWithinNavigableElement };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a CSS duration string (e.g., "500ms", "2s") and returns the duration in milliseconds.
|
|
3
|
+
* Returns the `defaultVal` if the input string is not a valid CSS duration.
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseCssDuration(duration: string, defaultVal?: number): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a CSS duration string (e.g., "500ms", "2s") and returns the duration in milliseconds.
|
|
3
|
+
* Returns the `defaultVal` if the input string is not a valid CSS duration.
|
|
4
|
+
*/
|
|
5
|
+
function parseCssDuration(duration, defaultVal = 0) {
|
|
6
|
+
const match = duration.match(/(\d+(\.\d+)?)(s|ms)/);
|
|
7
|
+
if (!match) return defaultVal;
|
|
8
|
+
const value = parseFloat(match[1]);
|
|
9
|
+
const unit = match[3];
|
|
10
|
+
// eslint-disable-next-line no-magic-numbers
|
|
11
|
+
return unit === 's' ? value * 1000 : value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { parseCssDuration };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, type PropsWithoutRef } from 'react';
|
|
1
|
+
import { Component, type Ref, type PropsWithoutRef } from 'react';
|
|
2
2
|
export interface RerenderableComponent<P, S> extends Component<P, S> {
|
|
3
3
|
node?: HTMLElement | null;
|
|
4
4
|
}
|
|
@@ -7,4 +7,6 @@ export interface RerenderableComponentClass<P, S> {
|
|
|
7
7
|
}
|
|
8
8
|
export default function rerenderHOC<P extends {}, C extends Component<P, unknown>>(ComposedComponent: {
|
|
9
9
|
new (props: P): C;
|
|
10
|
-
}):
|
|
10
|
+
}): ({ ref, ...props }: PropsWithoutRef<P> & {
|
|
11
|
+
ref?: Ref<C>;
|
|
12
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef, Component } from 'react';
|
|
1
|
+
import { Component } from 'react';
|
|
3
2
|
import { createComposedRef } from './compose-refs.js';
|
|
4
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import 'react/compiler-runtime';
|
|
5
5
|
import 'memoize-one';
|
|
6
6
|
|
|
7
7
|
function rerenderHOC(ComposedComponent) {
|
|
@@ -19,28 +19,15 @@ function rerenderHOC(ComposedComponent) {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if ($[1] !== props || $[2] !== ref) {
|
|
32
|
-
t0 = /*#__PURE__*/jsx(Rerenderer, {
|
|
33
|
-
props: props,
|
|
34
|
-
forwardedRef: ref
|
|
35
|
-
});
|
|
36
|
-
$[1] = props;
|
|
37
|
-
$[2] = ref;
|
|
38
|
-
$[3] = t0;
|
|
39
|
-
} else {
|
|
40
|
-
t0 = $[3];
|
|
41
|
-
}
|
|
42
|
-
return t0;
|
|
43
|
-
});
|
|
22
|
+
return function RerendererForwardRef({
|
|
23
|
+
ref,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
return /*#__PURE__*/jsx(Rerenderer, {
|
|
27
|
+
props: props,
|
|
28
|
+
forwardedRef: ref !== null && ref !== void 0 ? ref : null
|
|
29
|
+
});
|
|
30
|
+
};
|
|
44
31
|
}
|
|
45
32
|
|
|
46
33
|
export { rerenderHOC as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schedules a timeout and returns a function that cancels it.
|
|
3
|
+
*
|
|
4
|
+
* Useful from React effects.
|
|
5
|
+
*/
|
|
6
|
+
export declare function setTimeoutWithCleanup(callback: () => void, delay?: number): () => void;
|
|
7
|
+
/**
|
|
8
|
+
* Schedules an animation frame and returns a function that cancels it.
|
|
9
|
+
*
|
|
10
|
+
* Useful from React effects.
|
|
11
|
+
*/
|
|
12
|
+
export declare function requestAnimationFrameWithCleanup(callback: () => void): () => void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schedules a timeout and returns a function that cancels it.
|
|
3
|
+
*
|
|
4
|
+
* Useful from React effects.
|
|
5
|
+
*/
|
|
6
|
+
function setTimeoutWithCleanup(callback, delay = 0) {
|
|
7
|
+
let timerId = window.setTimeout(() => {
|
|
8
|
+
callback();
|
|
9
|
+
timerId = null;
|
|
10
|
+
}, delay);
|
|
11
|
+
return () => {
|
|
12
|
+
if (timerId != null) {
|
|
13
|
+
window.clearTimeout(timerId);
|
|
14
|
+
timerId = null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Schedules an animation frame and returns a function that cancels it.
|
|
20
|
+
*
|
|
21
|
+
* Useful from React effects.
|
|
22
|
+
*/
|
|
23
|
+
function requestAnimationFrameWithCleanup(callback) {
|
|
24
|
+
let rafId = requestAnimationFrame(() => {
|
|
25
|
+
callback();
|
|
26
|
+
rafId = null;
|
|
27
|
+
});
|
|
28
|
+
return () => {
|
|
29
|
+
if (rafId != null) {
|
|
30
|
+
cancelAnimationFrame(rafId);
|
|
31
|
+
rafId = null;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { requestAnimationFrameWithCleanup, setTimeoutWithCleanup };
|
|
@@ -17,7 +17,7 @@ export interface CloneWithConfig<T> {
|
|
|
17
17
|
selected?: Set<T> | readonly T[] | null | undefined;
|
|
18
18
|
focused?: T | null | undefined;
|
|
19
19
|
}
|
|
20
|
-
export default class
|
|
20
|
+
export default class TableSelection<T> {
|
|
21
21
|
protected _rawData: readonly T[];
|
|
22
22
|
protected _getChildren: (item: T) => readonly T[];
|
|
23
23
|
protected _data: Set<T>;
|
|
@@ -28,19 +28,19 @@ export default class Selection<T> {
|
|
|
28
28
|
constructor({ data, selected, focused, getKey, getChildren, isItemSelectable, }?: TableSelectionConfig<T>);
|
|
29
29
|
protected _buildData(data: readonly T[] | null | undefined): Set<T>;
|
|
30
30
|
protected _buildSelected(data: Set<T>, selected: Set<T>): Set<T>;
|
|
31
|
-
cloneWith({ data, selected, focused }: CloneWithConfig<T>):
|
|
32
|
-
focus(value: T | null | undefined):
|
|
33
|
-
moveUp():
|
|
34
|
-
moveDown():
|
|
35
|
-
moveStart():
|
|
36
|
-
moveEnd():
|
|
37
|
-
select(value?: T | null):
|
|
38
|
-
deselect(value?: T | null):
|
|
39
|
-
toggleSelection(value?: T | null):
|
|
40
|
-
selectAll():
|
|
41
|
-
resetFocus():
|
|
42
|
-
resetSelection():
|
|
43
|
-
reset():
|
|
31
|
+
cloneWith({ data, selected, focused }: CloneWithConfig<T>): TableSelection<T>;
|
|
32
|
+
focus(value: T | null | undefined): TableSelection<T>;
|
|
33
|
+
moveUp(): TableSelection<T> | undefined;
|
|
34
|
+
moveDown(): TableSelection<T> | undefined;
|
|
35
|
+
moveStart(): TableSelection<T> | undefined;
|
|
36
|
+
moveEnd(): TableSelection<T> | undefined;
|
|
37
|
+
select(value?: T | null): TableSelection<T>;
|
|
38
|
+
deselect(value?: T | null): TableSelection<T>;
|
|
39
|
+
toggleSelection(value?: T | null): TableSelection<T>;
|
|
40
|
+
selectAll(): TableSelection<T>;
|
|
41
|
+
resetFocus(): TableSelection<T>;
|
|
42
|
+
resetSelection(): TableSelection<T>;
|
|
43
|
+
reset(): TableSelection<T>;
|
|
44
44
|
isFocused(value: T | null): boolean;
|
|
45
45
|
isSelected(value: T | null): boolean;
|
|
46
46
|
getFocused(): T | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @deprecated SelectionItem is deprecated. Use your own item type and provide a `getKey` function instead if there is no `id` identifier in your item type.
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
class TableSelection {
|
|
5
5
|
_rawData;
|
|
6
6
|
_getChildren;
|
|
7
7
|
_data;
|
|
@@ -19,7 +19,7 @@ let Selection$1 = class Selection {
|
|
|
19
19
|
return item.id;
|
|
20
20
|
}
|
|
21
21
|
// If there's no id provided on item and no getKey supplied, fail fast with a clear message
|
|
22
|
-
throw new Error('
|
|
22
|
+
throw new Error('TableSelection: getKey is required when items have no "id" property');
|
|
23
23
|
},
|
|
24
24
|
getChildren = () => [],
|
|
25
25
|
isItemSelectable = () => true
|
|
@@ -185,6 +185,6 @@ let Selection$1 = class Selection {
|
|
|
185
185
|
}
|
|
186
186
|
return new Set();
|
|
187
187
|
}
|
|
188
|
-
}
|
|
188
|
+
}
|
|
189
189
|
|
|
190
|
-
export {
|
|
190
|
+
export { TableSelection as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HTMLAttributes, type ReactElement, type FunctionComponent } from 'react';
|
|
1
|
+
import { type HTMLAttributes, type Ref, type ReactElement, type FunctionComponent } from 'react';
|
|
2
2
|
declare enum Theme {
|
|
3
3
|
AUTO = "auto",
|
|
4
4
|
LIGHT = "light",
|
|
@@ -18,11 +18,12 @@ export interface WithThemeClassesProps {
|
|
|
18
18
|
export declare function WithThemeClasses({ theme, children }: WithThemeClassesProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
19
19
|
export declare function applyTheme(theme: Theme.DARK | Theme.LIGHT, container: HTMLElement): void;
|
|
20
20
|
type WrapperType = FunctionComponent<HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
21
|
-
export interface ThemeProviderProps extends HTMLAttributes<
|
|
21
|
+
export interface ThemeProviderProps extends HTMLAttributes<HTMLElement> {
|
|
22
|
+
ref?: Ref<HTMLElement>;
|
|
22
23
|
theme?: Theme;
|
|
23
24
|
passToPopups?: boolean;
|
|
24
25
|
WrapperComponent?: WrapperType;
|
|
25
26
|
target?: HTMLElement;
|
|
26
27
|
}
|
|
27
|
-
export declare
|
|
28
|
+
export declare function ThemeProvider({ ref, ...props }: ThemeProviderProps): import("react").JSX.Element;
|
|
28
29
|
export default Theme;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import 'react
|
|
1
|
+
import 'react/compiler-runtime';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
-
export { G as GLOBAL_DARK_CLASS_NAME,
|
|
4
|
+
export { G as GLOBAL_DARK_CLASS_NAME, b as ThemeContext, a as ThemeProvider, W as WithThemeClasses, c as applyTheme, T as default, u as useTheme, e as useThemeClasses } from '../_helpers/theme.js';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
@@ -9,7 +9,7 @@ import 'util-deprecate';
|
|
|
9
9
|
import '../icon/icon.js';
|
|
10
10
|
import '../icon/icon.constants.js';
|
|
11
11
|
import '../_helpers/icon-svg.js';
|
|
12
|
-
import 'react
|
|
12
|
+
import 'react/compiler-runtime';
|
|
13
13
|
import '../global/memoize.js';
|
|
14
14
|
import '../link/clickable-link.js';
|
|
15
15
|
import '../global/controls-height.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import { T as Theme,
|
|
3
|
+
import { T as Theme, a as ThemeProvider } from '../_helpers/theme.js';
|
|
4
4
|
import { s as styles } from '../_helpers/header.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
export { default as Logo } from './logo.js';
|
|
@@ -10,7 +10,7 @@ export { default as Profile } from './profile.js';
|
|
|
10
10
|
export { default as SmartProfile } from './smart-profile.js';
|
|
11
11
|
export { default as Services } from './services.js';
|
|
12
12
|
export { default as SmartServices } from './smart-services.js';
|
|
13
|
-
import 'react
|
|
13
|
+
import 'react/compiler-runtime';
|
|
14
14
|
import '../icon/icon.js';
|
|
15
15
|
import 'util-deprecate';
|
|
16
16
|
import '../icon/icon.constants.js';
|
|
@@ -6,7 +6,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
6
6
|
import { Size } from '../icon/icon.constants.js';
|
|
7
7
|
import 'util-deprecate';
|
|
8
8
|
import '../_helpers/icon-svg.js';
|
|
9
|
-
import 'react
|
|
9
|
+
import 'react/compiler-runtime';
|
|
10
10
|
import '../global/memoize.js';
|
|
11
11
|
|
|
12
12
|
class Logo extends PureComponent {
|
|
@@ -15,7 +15,7 @@ import '../global/url.js';
|
|
|
15
15
|
import '../global/dom.js';
|
|
16
16
|
import '../global/memoize.js';
|
|
17
17
|
import '../avatar/fallback-avatar.js';
|
|
18
|
-
import 'react
|
|
18
|
+
import 'react/compiler-runtime';
|
|
19
19
|
import '../global/get-uid.js';
|
|
20
20
|
import '../_helpers/avatar-info.js';
|
|
21
21
|
import '@jetbrains/icons/chevron-down';
|
|
@@ -10,7 +10,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
10
10
|
import '../global/data-tests.js';
|
|
11
11
|
import '../global/typescript-utils.js';
|
|
12
12
|
import '../_helpers/anchor.js';
|
|
13
|
-
import 'react
|
|
13
|
+
import 'react/compiler-runtime';
|
|
14
14
|
import '../button/button.js';
|
|
15
15
|
import '@jetbrains/icons/chevron-down';
|
|
16
16
|
import '@jetbrains/icons/chevron-12px-down';
|
|
@@ -16,7 +16,7 @@ import '../icon/icon.js';
|
|
|
16
16
|
import 'util-deprecate';
|
|
17
17
|
import '../icon/icon.constants.js';
|
|
18
18
|
import '../_helpers/icon-svg.js';
|
|
19
|
-
import 'react
|
|
19
|
+
import 'react/compiler-runtime';
|
|
20
20
|
import '../global/memoize.js';
|
|
21
21
|
import '../loader-inline/loader-inline.js';
|
|
22
22
|
import '../global/data-tests.js';
|
|
@@ -9,7 +9,7 @@ import '../dropdown/dropdown.js';
|
|
|
9
9
|
import '../global/data-tests.js';
|
|
10
10
|
import '../global/typescript-utils.js';
|
|
11
11
|
import '../_helpers/anchor.js';
|
|
12
|
-
import 'react
|
|
12
|
+
import 'react/compiler-runtime';
|
|
13
13
|
import '../button/button.js';
|
|
14
14
|
import '@jetbrains/icons/chevron-down';
|
|
15
15
|
import '@jetbrains/icons/chevron-12px-down';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c } from 'react
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import { memo, useEffect } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import deprecate from 'util-deprecate';
|
|
5
|
-
import {
|
|
5
|
+
import { h as headingStyles } from '../_helpers/heading.js';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
var Levels;
|
|
@@ -46,7 +46,7 @@ const HeadingMemo = /*#__PURE__*/memo(function Heading(t0) {
|
|
|
46
46
|
const level = t1 === undefined ? Levels.H1 : t1;
|
|
47
47
|
let t2;
|
|
48
48
|
if ($[6] !== className) {
|
|
49
|
-
t2 = classNames(
|
|
49
|
+
t2 = classNames(headingStyles.heading, className);
|
|
50
50
|
$[6] = className;
|
|
51
51
|
$[7] = t2;
|
|
52
52
|
} else {
|
|
@@ -183,7 +183,7 @@ const H4 = /*#__PURE__*/memo(function H4(t0) {
|
|
|
183
183
|
let t1;
|
|
184
184
|
if ($[5] !== bold || $[6] !== className) {
|
|
185
185
|
t1 = classNames(className, {
|
|
186
|
-
[
|
|
186
|
+
[headingStyles.bold]: bold
|
|
187
187
|
});
|
|
188
188
|
$[5] = bold;
|
|
189
189
|
$[6] = className;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c } from 'react
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
4
|
import { translate, getTranslations, setTranslations } from './i18n.js';
|
|
@@ -10,11 +10,11 @@ const I18nContext = /*#__PURE__*/React.createContext({
|
|
|
10
10
|
});
|
|
11
11
|
const I18nContextHolder = t0 => {
|
|
12
12
|
const $ = c(9);
|
|
13
|
-
if ($[0] !== "
|
|
13
|
+
if ($[0] !== "a2018c2c34e104bb25f29b4f924dc1f30d92611151a999bc264d56ee3cdb5c56") {
|
|
14
14
|
for (let $i = 0; $i < 9; $i += 1) {
|
|
15
15
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
16
16
|
}
|
|
17
|
-
$[0] = "
|
|
17
|
+
$[0] = "a2018c2c34e104bb25f29b4f924dc1f30d92611151a999bc264d56ee3cdb5c56";
|
|
18
18
|
}
|
|
19
19
|
const {
|
|
20
20
|
children,
|
|
@@ -48,7 +48,7 @@ const I18nContextHolder = t0 => {
|
|
|
48
48
|
}
|
|
49
49
|
let t4;
|
|
50
50
|
if ($[6] !== children || $[7] !== t3) {
|
|
51
|
-
t4 = /*#__PURE__*/jsx(I18nContext
|
|
51
|
+
t4 = /*#__PURE__*/jsx(I18nContext, {
|
|
52
52
|
value: t3,
|
|
53
53
|
children: children
|
|
54
54
|
});
|
package/components/icon/icon.js
CHANGED
|
@@ -4,7 +4,7 @@ import deprecate from 'util-deprecate';
|
|
|
4
4
|
import { Color, Size } from './icon.constants.js';
|
|
5
5
|
import { s as styles, I as IconSVG } from '../_helpers/icon-svg.js';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
|
-
import 'react
|
|
7
|
+
import 'react/compiler-runtime';
|
|
8
8
|
import '../global/memoize.js';
|
|
9
9
|
|
|
10
10
|
const warnSize = deprecate(() => {}, `\`size\`, \`width\` and \`height\` props are not recommended to use in Ring UI \`Icon\` component. The intrinsic sizes of SVG icon (\`width\` and \`height\` SVG attributes) are used instead.
|
package/components/icon/index.js
CHANGED
|
@@ -69,7 +69,7 @@ export declare class Input extends PureComponent<InputProps> {
|
|
|
69
69
|
stretch(el: HTMLElement | null | undefined): void;
|
|
70
70
|
adapt(): void;
|
|
71
71
|
inputRef: (el: HTMLInputElement | HTMLTextAreaElement | null) => void;
|
|
72
|
-
composedInputRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement | HTMLTextAreaElement> | undefined)[]) => (value: T | null) => void>;
|
|
72
|
+
composedInputRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement | HTMLTextAreaElement> | undefined)[]) => (value: T | null) => () => void>;
|
|
73
73
|
clear: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
74
74
|
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
75
75
|
handleTextareaChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|