@adaptabletools/adaptable-cjs 23.0.5-canary.0 → 23.0.5-canary.1

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.
Files changed (82) hide show
  1. package/index.css +0 -64
  2. package/package.json +1 -1
  3. package/src/AdaptableState/Aggregations/weightedAverage.d.ts +0 -1
  4. package/src/AdaptableState/Aggregations/weightedAverage.js +3 -4
  5. package/src/components/CodeBlock/index.d.ts +0 -1
  6. package/src/components/CodeBlock/index.js +2 -3
  7. package/src/env.js +2 -2
  8. package/tsconfig.cjs.tsbuildinfo +1 -1
  9. package/src/AdaptableState/Common/NamedObject.d.ts +0 -10
  10. package/src/AdaptableState/Common/NamedObject.js +0 -2
  11. package/src/Utilities/ExpressionFunctions/groupingMap.d.ts +0 -35
  12. package/src/Utilities/ExpressionFunctions/groupingMap.js +0 -94
  13. package/src/Utilities/Interface/AdaptableToolPanelContext.d.ts +0 -4
  14. package/src/Utilities/Interface/AdaptableToolPanelContext.js +0 -2
  15. package/src/View/Components/Buttons/EntityListActionButtons.d.ts +0 -38
  16. package/src/View/Components/Buttons/EntityListActionButtons.js +0 -46
  17. package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.d.ts +0 -12
  18. package/src/View/Components/ColumnFilter/components/ColumnFilterMenu.js +0 -71
  19. package/src/View/Components/EntityRowItem.d.ts +0 -7
  20. package/src/View/Components/EntityRowItem.js +0 -12
  21. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +0 -3
  22. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +0 -9
  23. package/src/View/Components/ModuleProfile.d.ts +0 -8
  24. package/src/View/Components/ModuleProfile.js +0 -15
  25. package/src/View/Components/ModuleSummary/ModuleDetail.d.ts +0 -23
  26. package/src/View/Components/ModuleSummary/ModuleDetail.js +0 -20
  27. package/src/View/Components/ModuleSummary/ModuleHeader.d.ts +0 -15
  28. package/src/View/Components/ModuleSummary/ModuleHeader.js +0 -20
  29. package/src/View/Components/ModuleSummary/SummaryRowItem.d.ts +0 -7
  30. package/src/View/Components/ModuleSummary/SummaryRowItem.js +0 -17
  31. package/src/View/Components/SharedProps/ModuleSummaryProps.d.ts +0 -9
  32. package/src/View/Components/SharedProps/ModuleSummaryProps.js +0 -2
  33. package/src/View/Components/SharedProps/ToolPanelModuleViewPopupProps.d.ts +0 -13
  34. package/src/View/Components/SharedProps/ToolPanelModuleViewPopupProps.js +0 -2
  35. package/src/View/Components/SharedProps/ToolbarModuleViewPopupProps.d.ts +0 -14
  36. package/src/View/Components/SharedProps/ToolbarModuleViewPopupProps.js +0 -2
  37. package/src/View/Components/StyleVisualItem.d.ts +0 -9
  38. package/src/View/Components/StyleVisualItem.js +0 -45
  39. package/src/View/Components/WizardSummaryPage.d.ts +0 -7
  40. package/src/View/Components/WizardSummaryPage.js +0 -22
  41. package/src/components/Accordion.d.ts +0 -7
  42. package/src/components/Accordion.js +0 -38
  43. package/src/components/FlexWithFooter.d.ts +0 -9
  44. package/src/components/FlexWithFooter.js +0 -15
  45. package/src/components/NotifyResize/index.d.ts +0 -9
  46. package/src/components/NotifyResize/index.js +0 -38
  47. package/src/components/PopupWithFooter.d.ts +0 -14
  48. package/src/components/PopupWithFooter.js +0 -15
  49. package/src/components/SelectableList/index.d.ts +0 -15
  50. package/src/components/SelectableList/index.js +0 -93
  51. package/src/components/SizedContainer/index.d.ts +0 -17
  52. package/src/components/SizedContainer/index.js +0 -23
  53. package/src/components/Table/index.d.ts +0 -4
  54. package/src/components/Table/index.js +0 -9
  55. package/src/components/WizardPanel/index.d.ts +0 -9
  56. package/src/components/WizardPanel/index.js +0 -10
  57. package/src/components/icons/align-justify.d.ts +0 -3
  58. package/src/components/icons/align-justify.js +0 -6
  59. package/src/components/icons/column-info.d.ts +0 -3
  60. package/src/components/icons/column-info.js +0 -6
  61. package/src/components/icons/gradient-column.d.ts +0 -3
  62. package/src/components/icons/gradient-column.js +0 -6
  63. package/src/components/icons/invalid.d.ts +0 -3
  64. package/src/components/icons/invalid.js +0 -6
  65. package/src/components/icons/logout copy.d.ts +0 -3
  66. package/src/components/icons/logout copy.js +0 -6
  67. package/src/components/icons/smart-edit.d.ts +0 -3
  68. package/src/components/icons/smart-edit.js +0 -6
  69. package/src/components/icons/team-share.d.ts +0 -3
  70. package/src/components/icons/team-share.js +0 -6
  71. package/src/components/icons/unchecked.d.ts +0 -3
  72. package/src/components/icons/unchecked.js +0 -6
  73. package/src/components/icons/user-filter.d.ts +0 -3
  74. package/src/components/icons/user-filter.js +0 -6
  75. package/src/components/utils/useContainerScrollObserver/index.d.ts +0 -6
  76. package/src/components/utils/useContainerScrollObserver/index.js +0 -83
  77. package/src/components/utils/useGlobalEvent.d.ts +0 -1
  78. package/src/components/utils/useGlobalEvent.js +0 -12
  79. package/src/components/utils/useLatest.d.ts +0 -1
  80. package/src/components/utils/useLatest.js +0 -10
  81. package/src/components/utils/usePropState.d.ts +0 -2
  82. package/src/components/utils/usePropState.js +0 -11
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WizardSummaryPage = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const WizardPanel_1 = tslib_1.__importDefault(require("../../components/WizardPanel"));
7
- const InfiniteTable_1 = require("../../components/InfiniteTable");
8
- const columnsMap = {
9
- Key: { field: 'Key', header: 'Property', defaultFlex: 1 },
10
- Value: { field: 'Value', header: 'Value', defaultFlex: 3 },
11
- };
12
- const tableDOMProps = {
13
- className: 'ab-WizardSummary__list',
14
- style: {
15
- height: '100%',
16
- margin: 'calc(var(--ab-base-space) * 2)',
17
- },
18
- };
19
- const WizardSummaryPage = (props) => {
20
- return ((0, jsx_runtime_1.jsx)(WizardPanel_1.default, { bodyProps: { className: 'twa:p-0' }, className: "ab-WizardSummary", "data-name": 'wizard-summary', children: (0, jsx_runtime_1.jsx)(InfiniteTable_1.DataSource, { data: props.KeyValuePairs, primaryKey: "Key", children: (0, jsx_runtime_1.jsx)(InfiniteTable_1.InfiniteTableGrid, { showZebraRows: true, domProps: tableDOMProps, columns: columnsMap }) }) }));
21
- };
22
- exports.WizardSummaryPage = WizardSummaryPage;
@@ -1,7 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- interface AccordionProps {
3
- title: string | ReactElement;
4
- children: ReactElement;
5
- }
6
- export declare const Accordion: React.FC<AccordionProps>;
7
- export default Accordion;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Accordion = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = require("react");
7
- const SimpleButton_1 = tslib_1.__importDefault(require("./SimpleButton"));
8
- const Panel_1 = tslib_1.__importDefault(require("./Panel"));
9
- const Accordion = ({ title, children }) => {
10
- const [isOpen, setIsOpen] = (0, react_1.useState)(false);
11
- const [height, setHeight] = (0, react_1.useState)('0px');
12
- const content = (0, react_1.useRef)(null);
13
- const observer = (0, react_1.useRef)(null);
14
- (0, react_1.useEffect)(() => {
15
- setHeight(isOpen && content.current ? `${content.current.scrollHeight}px` : '0px');
16
- }, [isOpen, content]);
17
- (0, react_1.useEffect)(() => {
18
- if (content.current) {
19
- observer.current = new MutationObserver(() => {
20
- setHeight(`${content.current?.scrollHeight}px`);
21
- });
22
- observer.current.observe(content.current, { childList: true, subtree: true });
23
- }
24
- return () => {
25
- observer.current?.disconnect();
26
- };
27
- }, []);
28
- const toggleAccordion = () => {
29
- setIsOpen(!isOpen);
30
- };
31
- return ((0, jsx_runtime_1.jsxs)(Panel_1.default, { className: "ab-Accordion", children: [(0, jsx_runtime_1.jsx)(SimpleButton_1.default, { iconPosition: "end", icon: isOpen ? 'expand-all' : 'collapse-all', variant: "text", onClick: toggleAccordion, style: { width: '100%', textAlign: 'left' }, children: title }), (0, jsx_runtime_1.jsx)("div", { ref: content, style: {
32
- maxHeight: `${height}`,
33
- overflow: 'hidden',
34
- transition: 'max-height 0.6s ease',
35
- }, children: children })] }));
36
- };
37
- exports.Accordion = Accordion;
38
- exports.default = exports.Accordion;
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { FlexProps } from './Flex';
3
- import { HTMLProps } from 'react';
4
- interface TypeProps extends FlexProps {
5
- footer: React.ReactNode;
6
- footerProps?: FlexProps & HTMLProps<HTMLDivElement>;
7
- }
8
- declare const FlexWithFooter: (props: TypeProps & React.HTMLProps<HTMLDivElement>) => React.JSX.Element;
9
- export default FlexWithFooter;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const Flex_1 = require("./Flex");
5
- const defaultStyle = {
6
- height: '100%',
7
- maxHeight: '90vh',
8
- width: '70vw',
9
- maxWidth: 800,
10
- };
11
- const FlexWithFooter = (props) => {
12
- const { footer, footerProps, children, style, ...domProps } = props;
13
- return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", ...domProps, style: { ...defaultStyle, ...style }, children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:p-0 twa:flex-1", children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:flex-1", children: children }) }), footer ? ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: "twa:p-2 twa:bg-primary", ...footerProps, children: footer })) : null] }));
14
- };
15
- exports.default = FlexWithFooter;
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- export interface NotifyResizeProps {
3
- onResize: (size: {
4
- width: number;
5
- height: number;
6
- }) => void;
7
- }
8
- declare const NotifyResize: (props: NotifyResizeProps) => React.JSX.Element;
9
- export default NotifyResize;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const React = tslib_1.__importStar(require("react"));
6
- const getResizeObserverObject_1 = require("../ResizeObserver/getResizeObserverObject");
7
- const RO = (0, getResizeObserverObject_1.getResizeObserverObject)();
8
- const NotifyResize = (props) => {
9
- const domRef = React.useRef(null);
10
- React.useEffect(() => {
11
- if (!RO) {
12
- return;
13
- }
14
- const ro = new RO((entries) => {
15
- const entry = entries[0];
16
- if (entry) {
17
- const { width, height } = entry.contentRect;
18
- props.onResize({ width, height });
19
- }
20
- });
21
- const domNode = domRef.current;
22
- ro.observe(domNode);
23
- return () => {
24
- if (domNode) {
25
- ro.unobserve(domNode);
26
- }
27
- };
28
- }, []);
29
- return ((0, jsx_runtime_1.jsx)("div", { ref: domRef, style: {
30
- visibility: 'hidden',
31
- position: 'absolute',
32
- width: '100%',
33
- height: '100%',
34
- top: 0,
35
- left: 0,
36
- } }));
37
- };
38
- exports.default = NotifyResize;
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
- import { DialogProps, DialogRefType } from './Dialog';
3
- /**
4
- * This is the main popup that we use - so all function popups will appear here.
5
- */
6
- export interface IPopupWithFooterProps extends DialogProps {
7
- showModal: boolean;
8
- onHide?: () => void;
9
- modal?: boolean;
10
- maxWidth?: number;
11
- footer: React.ReactNode;
12
- children: React.ReactNode;
13
- }
14
- export declare const PopupWithFooter: React.ForwardRefExoticComponent<IPopupWithFooterProps & React.RefAttributes<DialogRefType>>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PopupWithFooter = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const React = tslib_1.__importStar(require("react"));
7
- const Dialog_1 = tslib_1.__importDefault(require("./Dialog"));
8
- const FlexWithFooter_1 = tslib_1.__importDefault(require("./FlexWithFooter"));
9
- const twMerge_1 = require("../twMerge");
10
- exports.PopupWithFooter = React.forwardRef((props, ref) => {
11
- const { showModal, onHide, footer, maxWidth, style, ...dialogProps } = props;
12
- return ((0, jsx_runtime_1.jsx)(Dialog_1.default, { ...dialogProps, ref: ref, isOpen: showModal, onDismiss: onHide, showCloseButton: false, className: (0, twMerge_1.twMerge)('twa:p-0', dialogProps.className), children: (0, jsx_runtime_1.jsx)(FlexWithFooter_1.default, { flexDirection: "column", style: style, footer: footer, footerProps: {
13
- className: 'ab-Popup__footer twa:p-2 twa:bg-primary',
14
- }, children: props.children }) }));
15
- });
@@ -1,15 +0,0 @@
1
- import * as React from 'react';
2
- import { SyntheticEvent, HTMLProps } from 'react';
3
- type SelectableListValues = {
4
- [key: string]: boolean;
5
- };
6
- export declare const useSelectionEvent: () => (event: SyntheticEvent, { index }: {
7
- index: number;
8
- }) => void;
9
- interface SelectableListProps {
10
- onSelectedChange?: (selected: SelectableListValues) => void;
11
- toggleOnSimpleClick?: boolean;
12
- getItemId: (index: number) => string | number;
13
- }
14
- declare const SelectableList: (props: HTMLProps<HTMLDivElement> & SelectableListProps) => React.JSX.Element;
15
- export default SelectableList;
@@ -1,93 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSelectionEvent = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const React = tslib_1.__importStar(require("react"));
7
- const react_1 = require("react");
8
- const useProperty_1 = tslib_1.__importDefault(require("../utils/useProperty"));
9
- const SelectableListContext = React.createContext({
10
- clickInfoRef: null,
11
- selected: {},
12
- getItemId: (index) => index,
13
- toggleOnSimpleClick: false,
14
- setSelected: (x) => { },
15
- });
16
- const useSelectionEvent = () => {
17
- const { selected, setSelected, toggleOnSimpleClick, clickInfoRef, getItemId } = (0, react_1.useContext)(SelectableListContext);
18
- return (event, { index }) => {
19
- if (index === undefined) {
20
- return;
21
- }
22
- const { lastClickIndexWithoutShift, lastShiftSelectionRange } = clickInfoRef.current;
23
- let { shiftKey, metaKey, ctrlKey } = event;
24
- if (ctrlKey) {
25
- metaKey = true;
26
- }
27
- if (metaKey) {
28
- shiftKey = false;
29
- }
30
- let itemId = `${getItemId(index)}`;
31
- let newSelection;
32
- if (!shiftKey) {
33
- clickInfoRef.current.lastClickIndexWithoutShift = index;
34
- if (!metaKey && !toggleOnSimpleClick) {
35
- newSelection = { [itemId]: true };
36
- }
37
- else {
38
- const currentRowSelected = selected[itemId];
39
- newSelection = { ...selected };
40
- if (currentRowSelected) {
41
- delete newSelection[itemId];
42
- clickInfoRef.current.lastClickIndexWithoutShift = lastClickIndexWithoutShift;
43
- }
44
- else {
45
- newSelection[itemId] = true;
46
- }
47
- }
48
- clickInfoRef.current.lastShiftSelectionRange = null;
49
- setSelected(newSelection);
50
- }
51
- else {
52
- let prevClickIndex = lastClickIndexWithoutShift;
53
- let currentClickIndex = index;
54
- newSelection = { ...selected };
55
- if (lastShiftSelectionRange) {
56
- let { start, end } = lastShiftSelectionRange;
57
- for (; start <= end; start++) {
58
- delete newSelection[getItemId(start)];
59
- }
60
- }
61
- let [start, end] = [
62
- Math.min(prevClickIndex, currentClickIndex),
63
- Math.max(prevClickIndex, currentClickIndex),
64
- ];
65
- clickInfoRef.current.lastShiftSelectionRange = { start, end };
66
- for (; start <= end; start++) {
67
- newSelection[getItemId(start)] = true;
68
- }
69
- setSelected(newSelection);
70
- }
71
- };
72
- };
73
- exports.useSelectionEvent = useSelectionEvent;
74
- const SelectableList = (props) => {
75
- const [selected, setSelected] = (0, useProperty_1.default)(props, 'selected', {});
76
- const clickInfoRef = (0, react_1.useRef)({
77
- lastClickIndexWithoutShift: 0,
78
- });
79
- const getItemId = (index) => {
80
- if (props.getItemId) {
81
- return props.getItemId(index);
82
- }
83
- return index;
84
- };
85
- return ((0, jsx_runtime_1.jsx)(SelectableListContext.Provider, { value: {
86
- clickInfoRef,
87
- toggleOnSimpleClick: props.toggleOnSimpleClick || false,
88
- selected,
89
- setSelected,
90
- getItemId,
91
- }, children: props.children }));
92
- };
93
- exports.default = SelectableList;
@@ -1,17 +0,0 @@
1
- import * as React from 'react';
2
- import { ReactNode } from 'react';
3
- import { BoxProps } from '../Flex';
4
- interface SizedContainerProps extends Omit<BoxProps, 'children' | 'onResize'> {
5
- style?: React.CSSProperties;
6
- className?: string;
7
- children: (size: {
8
- width: number;
9
- height: number;
10
- }) => ReactNode;
11
- onResize?: (size: {
12
- width: number;
13
- height: number;
14
- }) => void;
15
- }
16
- declare const SizedContainer: (props: SizedContainerProps) => React.JSX.Element;
17
- export default SizedContainer;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const React = tslib_1.__importStar(require("react"));
6
- const NotifyResize_1 = tslib_1.__importDefault(require("../NotifyResize"));
7
- const Flex_1 = require("../Flex");
8
- const SizedContainer = (props) => {
9
- const { onResize: onResizeFromProps, ...domProps } = props;
10
- const [size, onResize] = React.useState(null);
11
- const sizeFn = props.children;
12
- return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { ...domProps, style: { flex: 1, ...domProps.style, position: 'relative' }, children: (0, jsx_runtime_1.jsxs)(Flex_1.Box, { style: {
13
- position: 'absolute',
14
- left: 0,
15
- top: 0,
16
- width: '100%',
17
- height: '100%',
18
- }, "data-width": size ? size.width : null, "data-height": size ? size.height : null, children: [(0, jsx_runtime_1.jsx)(NotifyResize_1.default, { onResize: (size) => {
19
- onResize(size);
20
- onResizeFromProps?.(size);
21
- } }), size ? sizeFn(size) : null] }) }));
22
- };
23
- exports.default = SizedContainer;
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
- import { HTMLAttributes } from 'react';
3
- declare const Table: (props: HTMLAttributes<HTMLTableElement>) => React.JSX.Element;
4
- export default Table;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const join_1 = tslib_1.__importDefault(require("../utils/join"));
6
- const Table = (props) => {
7
- return (0, jsx_runtime_1.jsx)("table", { ...props, className: (0, join_1.default)(props.className, 'ab-Table') });
8
- };
9
- exports.default = Table;
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { PanelProps } from '../Panel';
3
- declare const WizardPanel: (props: {
4
- bodyProps?: PanelProps["bodyProps"];
5
- className?: string;
6
- "data-name"?: string;
7
- children?: React.ReactNode;
8
- }) => React.JSX.Element;
9
- export default WizardPanel;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const Panel_1 = tslib_1.__importDefault(require("../Panel"));
6
- const twMerge_1 = require("../../twMerge");
7
- const WizardPanel = (props) => {
8
- return ((0, jsx_runtime_1.jsx)(Panel_1.default, { bodyScroll: true, bodyProps: props.bodyProps, "data-name": props['data-name'], className: (0, twMerge_1.twMerge)('ab-WizardPanel', 'twa:border-none twa:rounded-none twa:h-full', props.className), children: props.children }));
9
- };
10
- exports.default = WizardPanel;
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: (props: any) => React.JSX.Element;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
6
- exports.default = (props) => ((0, jsx_runtime_1.jsx)(DefaultIcon_1.default, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zm0-6v2h18V3H3z" }) }));
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: (props: any) => React.JSX.Element;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
6
- exports.default = (props) => ((0, jsx_runtime_1.jsx)(DefaultIcon_1.default, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }));
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: (props: any) => React.JSX.Element;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
6
- exports.default = (props) => ((0, jsx_runtime_1.jsx)(DefaultIcon_1.default, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M11,9H13V11H11V9M9,11H11V13H9V11M13,11H15V13H13V11M15,9H17V11H15V9M7,9H9V11H7V9M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M9,18H7V16H9V18M13,18H11V16H13V18M17,18H15V16H17V18M19,11H17V13H19V15H17V13H15V15H13V13H11V15H9V13H7V15H5V13H7V11H5V5H19V11Z" }) }));
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: (props: any) => React.JSX.Element;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
6
- exports.default = (props) => ((0, jsx_runtime_1.jsx)(DefaultIcon_1.default, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2L1 21z" }) }));
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: (props: any) => React.JSX.Element;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
6
- exports.default = (props) => ((0, jsx_runtime_1.jsxs)(DefaultIcon_1.default, { ...props, children: [(0, jsx_runtime_1.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" }), (0, jsx_runtime_1.jsx)("path", { d: "M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" })] }));
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: (props: any) => React.JSX.Element;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
6
- exports.default = (props) => ((0, jsx_runtime_1.jsx)(DefaultIcon_1.default, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z" }) }));
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: (props: any) => React.JSX.Element;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
6
- exports.default = (props) => ((0, jsx_runtime_1.jsx)(DefaultIcon_1.default, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-5 3c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm4 8h-8v-1c0-1.33 2.67-2 4-2s4 .67 4 2v1z" }) }));
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: (props: any) => React.JSX.Element;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
6
- exports.default = (props) => ((0, jsx_runtime_1.jsx)(DefaultIcon_1.default, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" }) }));
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: (props: any) => React.JSX.Element;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
6
- exports.default = (props) => ((0, jsx_runtime_1.jsx)(DefaultIcon_1.default, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) }));
@@ -1,6 +0,0 @@
1
- type UseContainerScrollObserverCallback = (currentIndex: number) => void;
2
- export declare const useContainerScrollObserver: (callback: UseContainerScrollObserverCallback) => {
3
- ref: (node: HTMLElement) => void;
4
- scrollToIndex: (index: number) => void;
5
- };
6
- export {};
@@ -1,83 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useContainerScrollObserver = void 0;
4
- const react_1 = require("react");
5
- class SectionSelector {
6
- scrollTop = 0;
7
- node;
8
- boxHeight;
9
- childrenHeights = [];
10
- maxScrollTop;
11
- constructor(node) {
12
- this.node = node;
13
- this.refreshFromDOM();
14
- }
15
- refreshFromDOM() {
16
- this.boxHeight = this.node.scrollHeight;
17
- this.childrenHeights = Array.prototype.map.call(this.node.children, (child) => child.offsetHeight);
18
- this.maxScrollTop = this.boxHeight - this.node.offsetHeight;
19
- }
20
- getVisibleRange(scrollTop = this.scrollTop) {
21
- const top = scrollTop;
22
- const height = this.node.offsetHeight;
23
- const bottom = scrollTop + this.node.offsetHeight;
24
- return {
25
- top,
26
- bottom,
27
- height,
28
- };
29
- }
30
- select = (scrollTop) => {
31
- this.refreshFromDOM();
32
- const relativeCurrentHeight = (scrollTop * this.boxHeight) / this.maxScrollTop;
33
- let heightSum = 0;
34
- for (let i = 0, len = this.childrenHeights.length; i < len; i++) {
35
- heightSum += this.childrenHeights[i];
36
- if (heightSum > relativeCurrentHeight) {
37
- return i;
38
- }
39
- }
40
- return this.childrenHeights.length - 1;
41
- };
42
- }
43
- const useContainerScrollObserver = (callback) => {
44
- const containerNodeRef = (0, react_1.useRef)(null);
45
- const sectionSelectorRef = (0, react_1.useRef)(null);
46
- const update = (0, react_1.useCallback)((scrollTop) => {
47
- callback(sectionSelectorRef.current.select(scrollTop));
48
- }, []);
49
- const scrollRafRef = (0, react_1.useRef)(null);
50
- const onScroll = (0, react_1.useCallback)(() => {
51
- if (scrollRafRef.current) {
52
- cancelAnimationFrame(scrollRafRef.current);
53
- scrollRafRef.current = null;
54
- }
55
- requestAnimationFrame(() => {
56
- scrollRafRef.current = null;
57
- update(containerNodeRef.current.scrollTop);
58
- });
59
- }, []);
60
- const setupScroll = (0, react_1.useCallback)((node) => {
61
- if (node) {
62
- containerNodeRef.current = node;
63
- node.addEventListener('scroll', onScroll, { passive: true });
64
- sectionSelectorRef.current = new SectionSelector(node);
65
- }
66
- else {
67
- containerNodeRef.current?.removeEventListener('scroll', onScroll);
68
- sectionSelectorRef.current = null;
69
- }
70
- }, []);
71
- const ref = setupScroll;
72
- return {
73
- ref,
74
- scrollToIndex: (0, react_1.useCallback)((index) => {
75
- const container = containerNodeRef.current;
76
- const node = container.childNodes[index];
77
- node.scrollIntoView({
78
- behavior: 'smooth',
79
- });
80
- }, []),
81
- };
82
- };
83
- exports.useContainerScrollObserver = useContainerScrollObserver;
@@ -1 +0,0 @@
1
- export declare const useGlobalEvent: (eventName: string, callback: (event: KeyboardEvent) => void) => void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useGlobalEvent = void 0;
4
- const tslib_1 = require("tslib");
5
- const React = tslib_1.__importStar(require("react"));
6
- const useGlobalEvent = (eventName, callback) => {
7
- React.useEffect(() => {
8
- window.addEventListener(eventName, callback);
9
- return () => window.removeEventListener(eventName, callback);
10
- }, [eventName, callback]);
11
- };
12
- exports.useGlobalEvent = useGlobalEvent;
@@ -1 +0,0 @@
1
- export declare const useLatest: <T>(value: T) => (() => T);
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLatest = void 0;
4
- const react_1 = require("react");
5
- const useLatest = (value) => {
6
- const ref = (0, react_1.useRef)(value);
7
- ref.current = value;
8
- return (0, react_1.useCallback)(() => ref.current, []);
9
- };
10
- exports.useLatest = useLatest;
@@ -1,2 +0,0 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
- export default function usePropState<S>(state: S | undefined, setState: Dispatch<SetStateAction<S>> | undefined, initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = usePropState;
4
- const react_1 = require("react");
5
- function usePropState(state, setState, initialState) {
6
- const [localState, setLocalState] = (0, react_1.useState)(initialState);
7
- return [
8
- state !== undefined ? state : localState,
9
- setState !== undefined ? setState : setLocalState,
10
- ];
11
- }