xmlui 0.7.21 → 0.7.23
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/dist/{apiInterceptorWorker-LRHkKnha.mjs → apiInterceptorWorker-BZ3Gd4mb.mjs} +25 -10
- package/dist/{grammar.tmLanguage-DNepe_jP.mjs → grammar.tmLanguage-JAlHWPqw.mjs} +1 -1
- package/dist/{index-5NLXyjX0.mjs → index-C9zkAour.mjs} +27520 -25814
- package/dist/index.css +1 -1
- package/dist/scripts/bin/build-lib.js +10 -4
- package/dist/scripts/bin/build.js +1 -4
- package/dist/scripts/bin/index.js +7 -7
- package/dist/scripts/bin/preview.js +19 -2
- package/dist/scripts/bin/start.js +2 -4
- package/dist/scripts/bin/viteConfig.js +2 -11
- package/dist/scripts/src/abstractions/ComponentDefs.js +2 -1
- package/dist/scripts/src/components/APICall/APICall.js +3 -3
- package/dist/scripts/src/components/APICall/APICallNative.js +2 -2
- package/dist/scripts/src/components/Accordion/Accordion.js +5 -5
- package/dist/scripts/src/components/Accordion/AccordionContext.js +1 -1
- package/dist/scripts/src/components/Accordion/AccordionItem.js +5 -5
- package/dist/scripts/src/components/Accordion/AccordionItemNative.js +3 -3
- package/dist/scripts/src/components/Accordion/AccordionNative.js +3 -3
- package/dist/scripts/src/components/Alert/Alert.js +4 -4
- package/dist/scripts/src/components/App/App.js +5 -5
- package/dist/scripts/src/components/App/AppNative.js +33 -34
- package/dist/scripts/src/components/App/Sheet.js +4 -4
- package/dist/scripts/src/components/AppHeader/AppHeader.js +6 -6
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +9 -9
- package/dist/scripts/src/components/AppState/AppState.js +2 -2
- package/dist/scripts/src/components/AppState/AppStateNative.js +2 -2
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +7 -7
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +29 -31
- package/dist/scripts/src/components/Avatar/Avatar.js +4 -4
- package/dist/scripts/src/components/Avatar/AvatarNative.js +1 -1
- package/dist/scripts/src/components/Backdrop/Backdrop.js +4 -4
- package/dist/scripts/src/components/Badge/Badge.js +5 -5
- package/dist/scripts/src/components/Badge/BadgeNative.js +5 -5
- package/dist/scripts/src/components/Bookmark/Bookmark.js +7 -3
- package/dist/scripts/src/components/Bookmark/BookmarkNative.js +6 -5
- package/dist/scripts/src/components/Breakout/Breakout.js +2 -2
- package/dist/scripts/src/components/Button/Button.js +6 -6
- package/dist/scripts/src/components/Button/ButtonNative.js +3 -3
- package/dist/scripts/src/components/ButtonGroup/ButtonGroup.js +5 -5
- package/dist/scripts/src/components/Card/Card.js +5 -5
- package/dist/scripts/src/components/Card/CardNative.js +7 -7
- package/dist/scripts/src/components/Carousel/Carousel.js +5 -5
- package/dist/scripts/src/components/Carousel/CarouselItem.js +3 -3
- package/dist/scripts/src/components/Carousel/CarouselItemNative.js +3 -3
- package/dist/scripts/src/components/Carousel/CarouselNative.js +6 -6
- package/dist/scripts/src/components/ChangeListener/ChangeListener.js +3 -3
- package/dist/scripts/src/components/ChangeListener/ChangeListenerNative.js +1 -1
- package/dist/scripts/src/components/Checkbox/Checkbox.js +6 -6
- package/dist/scripts/src/components/ColorPicker/ColorPicker.js +46 -0
- package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +54 -0
- package/dist/scripts/src/components/Column/Column.js +2 -2
- package/dist/scripts/src/components/Column/ColumnNative.js +2 -2
- package/dist/scripts/src/components/ComponentProvider.js +191 -97
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +4 -4
- package/dist/scripts/src/components/ContentSeparator/ContentSeparatorNative.js +1 -1
- package/dist/scripts/src/components/DatePicker/DatePicker.js +4 -4
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +18 -19
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +6 -6
- package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +5 -5
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +4 -4
- package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +1 -1
- package/dist/scripts/src/components/FileInput/FileInput.js +6 -6
- package/dist/scripts/src/components/FileInput/FileInputNative.js +6 -6
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +3 -3
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +6 -7
- package/dist/scripts/src/components/FlowLayout/FlowLayout.js +8 -6
- package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +27 -16
- package/dist/scripts/src/components/Footer/Footer.js +4 -4
- package/dist/scripts/src/components/Footer/FooterNative.js +2 -2
- package/dist/scripts/src/components/Form/Form.js +5 -5
- package/dist/scripts/src/components/Form/FormNative.js +29 -29
- package/dist/scripts/src/components/FormItem/FormItem.js +4 -4
- package/dist/scripts/src/components/FormItem/FormItemNative.js +26 -16
- package/dist/scripts/src/components/FormItem/HelperText.js +3 -3
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +5 -6
- package/dist/scripts/src/components/FormItem/Validations.js +5 -5
- package/dist/scripts/src/components/FormSection/FormSection.js +2 -2
- package/dist/scripts/src/components/Heading/Heading.js +17 -4
- package/dist/scripts/src/components/Heading/HeadingNative.js +25 -14
- package/dist/scripts/src/components/HoverCard/HoverCard.js +3 -3
- package/dist/scripts/src/components/HoverCard/HovercardNative.js +1 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +1208 -19
- package/dist/scripts/src/components/Icon/Icon.js +3 -3
- package/dist/scripts/src/components/Icon/IconNative.js +3 -3
- package/dist/scripts/src/components/IconInfoCard/IconInfoCard.js +5 -4
- package/dist/scripts/src/components/IconProvider.js +49 -49
- package/dist/scripts/src/components/Image/Image.js +4 -4
- package/dist/scripts/src/components/Image/ImageNative.js +2 -2
- package/dist/scripts/src/components/Input/InputAdornment.js +3 -3
- package/dist/scripts/src/components/Items/Items.js +3 -3
- package/dist/scripts/src/components/Link/Link.js +6 -6
- package/dist/scripts/src/components/Link/LinkNative.js +29 -11
- package/dist/scripts/src/components/List/List.js +14 -16
- package/dist/scripts/src/components/List/ListNative.js +193 -223
- package/dist/scripts/src/components/Logo/Logo.js +2 -2
- package/dist/scripts/src/components/Logo/LogoNative.js +2 -2
- package/dist/scripts/src/components/Markdown/Markdown.js +3 -3
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +4 -4
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +5 -5
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +8 -8
- package/dist/scripts/src/components/NavGroup/NavGroup.js +6 -6
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +8 -8
- package/dist/scripts/src/components/NavLink/NavLink.js +5 -5
- package/dist/scripts/src/components/NavLink/NavLinkNative.js +6 -6
- package/dist/scripts/src/components/NavPanel/NavPanel.js +5 -5
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +6 -6
- package/dist/scripts/src/components/NoResult/NoResult.js +4 -4
- package/dist/scripts/src/components/NoResult/NoResultNative.js +2 -2
- package/dist/scripts/src/components/NumberBox/NumberBox.js +4 -4
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +7 -7
- package/dist/scripts/src/components/OffCanvas/OffCanvas.js +5 -5
- package/dist/scripts/src/components/OffCanvas/OffCanvasNative.js +2 -2
- package/dist/scripts/src/components/Option/Option.js +4 -4
- package/dist/scripts/src/components/PageHeader/PageHeader.js +2 -2
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +2 -2
- package/dist/scripts/src/components/Pages/Pages.js +3 -3
- package/dist/scripts/src/components/Pages/PagesNative.js +2 -2
- package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +3 -3
- package/dist/scripts/src/components/PositionedContainer/PositionedContainerNative.js +1 -1
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +3 -3
- package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +1 -1
- package/dist/scripts/src/components/Queue/Queue.js +3 -3
- package/dist/scripts/src/components/Queue/QueueNative.js +5 -5
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +4 -4
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +6 -6
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +2 -2
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +3 -3
- package/dist/scripts/src/components/Redirect/Redirect.js +2 -2
- package/dist/scripts/src/components/Select/Select.js +7 -7
- package/dist/scripts/src/components/Select/SelectNative.js +36 -37
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +2 -2
- package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +2 -2
- package/dist/scripts/src/components/Slider/Slider.js +40 -25
- package/dist/scripts/src/components/Slider/SliderNative.js +98 -3
- package/dist/scripts/src/components/SlotItem.js +2 -2
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +3 -3
- package/dist/scripts/src/components/Spinner/Spinner.js +3 -3
- package/dist/scripts/src/components/Spinner/SpinnerNative.js +3 -4
- package/dist/scripts/src/components/Splitter/Splitter.js +6 -6
- package/dist/scripts/src/components/Splitter/SplitterNative.js +3 -3
- package/dist/scripts/src/components/Stack/Stack.js +6 -6
- package/dist/scripts/src/components/Stack/StackNative.js +3 -3
- package/dist/scripts/src/components/StickyBox/StickyBox.js +3 -3
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +1 -1
- package/dist/scripts/src/components/Switch/Switch.js +6 -6
- package/dist/scripts/src/components/Table/Table.js +9 -9
- package/dist/scripts/src/components/Table/TableNative.js +15 -15
- package/dist/scripts/src/components/Table/useRowSelection.js +4 -4
- package/dist/scripts/src/components/TableHeader/TableHeader.js +2 -2
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +7 -5
- package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +29 -24
- package/dist/scripts/src/components/Tabs/TabContext.js +1 -1
- package/dist/scripts/src/components/Tabs/TabItem.js +3 -3
- package/dist/scripts/src/components/Tabs/TabItemNative.js +2 -2
- package/dist/scripts/src/components/Tabs/Tabs.js +5 -5
- package/dist/scripts/src/components/Tabs/TabsNative.js +2 -2
- package/dist/scripts/src/components/Text/Text.js +5 -4
- package/dist/scripts/src/components/Text/TextNative.js +6 -7
- package/dist/scripts/src/components/TextArea/TextArea.js +4 -4
- package/dist/scripts/src/components/TextArea/TextAreaNative.js +6 -6
- package/dist/scripts/src/components/TextBox/TextBox.js +4 -4
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +5 -5
- package/dist/scripts/src/components/Theme/Theme.js +2 -2
- package/dist/scripts/src/components/Theme/ThemeNative.js +7 -7
- package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +11 -11
- package/dist/scripts/src/components/ThemeChanger/ToneChangerButton.js +5 -5
- package/dist/scripts/src/components/Toggle/Toggle.js +4 -4
- package/dist/scripts/src/components/Toolbar/Toolbar.js +2 -2
- package/dist/scripts/src/components/ToolbarButton/ToolbarButton.js +2 -2
- package/dist/scripts/src/components/Tree/TreeComponent.js +4 -4
- package/dist/scripts/src/components/Tree/TreeNative.js +2 -2
- package/dist/scripts/src/components/TrendLabel/TrendLabel.js +2 -2
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +8 -8
- package/dist/scripts/src/components/abstractions.js +6 -2
- package/dist/scripts/src/components/container-helpers.js +2 -2
- package/dist/scripts/src/components-core/CompoundComponent.js +2 -2
- package/dist/scripts/src/components-core/Fragment.js +2 -2
- package/dist/scripts/src/components-core/InspectorContext.js +5 -5
- package/dist/scripts/src/components-core/LoaderComponent.js +6 -3
- package/dist/scripts/src/components-core/RestApiProxy.js +4 -4
- package/dist/scripts/src/components-core/Slot.js +2 -2
- package/dist/scripts/src/components-core/TableOfContentsContext.js +12 -2
- package/dist/scripts/src/components-core/XmluiCodeHighlighter.js +2 -2
- package/dist/scripts/src/components-core/action/APICall.js +10 -10
- package/dist/scripts/src/components-core/action/FileDownloadAction.js +1 -1
- package/dist/scripts/src/components-core/action/FileUploadAction.js +3 -3
- package/dist/scripts/src/components-core/action/NavigateAction.js +1 -1
- package/dist/scripts/src/components-core/action/TimedAction.js +1 -1
- package/dist/scripts/src/components-core/component-hooks.js +2 -2
- package/dist/scripts/src/components-core/descriptorHelper.js +1 -0
- package/dist/scripts/src/components-core/loader/ApiLoader.js +5 -5
- package/dist/scripts/src/components-core/loader/DataLoader.js +18 -10
- package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +5 -5
- package/dist/scripts/src/components-core/loader/Loader.js +3 -3
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +5 -5
- package/dist/scripts/src/components-core/loader/PageableLoader.js +7 -4
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +21 -15
- package/dist/scripts/src/components-core/rendering/ComponentWrapper.js +2 -2
- package/dist/scripts/src/components-core/rendering/Container.js +16 -16
- package/dist/scripts/src/components-core/rendering/ContainerWrapper.js +1 -1
- package/dist/scripts/src/components-core/rendering/InvalidComponent.js +1 -1
- package/dist/scripts/src/components-core/rendering/StateContainer.js +15 -15
- package/dist/scripts/src/components-core/rendering/reducer.js +1 -1
- package/dist/scripts/src/components-core/rendering/renderChild.js +1 -1
- package/dist/scripts/src/components-core/rendering/valueExtractor.js +4 -4
- package/dist/scripts/src/components-core/script-runner/asyncProxy.js +1 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +1 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +1 -1
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +2 -2
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +1 -1
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +3 -3
- package/dist/scripts/src/components-core/script-runner/syncProxy.js +1 -1
- package/dist/scripts/src/components-core/script-runner/visitors.js +1 -1
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +10 -10
- package/dist/scripts/src/components-core/theming/extendThemeUtils.js +1 -1
- package/dist/scripts/src/components-core/theming/layout-resolver.js +356 -0
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +1 -1
- package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +9 -3
- package/dist/scripts/src/components-core/utils/actionUtils.js +3 -3
- package/dist/scripts/src/components-core/utils/compound-utils.js +1 -1
- package/dist/scripts/src/components-core/utils/css-utils.js +2 -2
- package/dist/scripts/src/components-core/utils/extractParam.js +47 -3
- package/dist/scripts/src/components-core/utils/hooks.js +3 -3
- package/dist/scripts/src/parsers/scripting/modules.js +1 -1
- package/dist/scripts/src/parsers/style-parser/style-compiler.js +6 -2
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +14 -15
- package/dist/scripts/src/syntax/grammar.tmLanguage.json +1 -1
- package/dist/scripts/src/syntax/textMate/xmlui.json +27 -93
- package/dist/style.css +1 -1
- package/dist/xmlui-metadata.mjs +5438 -4508
- package/dist/xmlui-metadata.umd.js +23 -18
- package/dist/xmlui-standalone.umd.js +204 -193
- package/dist/xmlui.d.ts +3 -2
- package/dist/xmlui.mjs +1 -1
- package/package.json +3 -3
- package/dist/scripts/package.json +0 -210
- package/dist/scripts/src/components/Chart/Chart.js +0 -24
- package/dist/scripts/src/components/Chart/ChartNative.js +0 -165
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +0 -116
- package/dist/scripts/src/components/ModalDialog/Dialog.js +0 -20
- package/dist/scripts/src/components/Range/Range.js +0 -56
- package/dist/scripts/src/components/Range/RangeNative.js +0 -8
- package/dist/scripts/src/components/RawHtml/RawHtml.js +0 -39
- package/dist/scripts/src/components/RawHtml/RawHtmlNative.js +0 -13
- package/dist/scripts/src/components-core/StandaloneApp.js +0 -589
- package/dist/scripts/src/components-core/abstractions/standalone.js +0 -2
- package/dist/scripts/src/components-core/appContext/date-functions.js +0 -19
- package/dist/scripts/src/components-core/appContext/math-function.js +0 -27
- package/dist/scripts/src/components-core/appContext/misc-utils.js +0 -13
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +0 -198
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +0 -94
- package/dist/scripts/src/components-core/interception/Backend.js +0 -129
- package/dist/scripts/src/components-core/interception/Errors.js +0 -129
- package/dist/scripts/src/components-core/interception/InMemoryDb.js +0 -41
- package/dist/scripts/src/components-core/interception/IndexedDb.js +0 -205
- package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +0 -145
- package/dist/scripts/src/components-core/interception/abstractions.js +0 -2
- package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +0 -46
- package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +0 -9
- package/dist/scripts/src/components-core/markup-check.js +0 -279
- package/dist/scripts/src/components-core/rendering/AppContent.js +0 -339
- package/dist/scripts/src/components-core/rendering/AppRoot.js +0 -55
- package/dist/scripts/src/components-core/rendering/AppWrapper.js +0 -44
- package/dist/scripts/src/components-core/utils/classnames.js +0 -58
- package/dist/scripts/src/components-core/utils/date-utils.js +0 -78
- package/dist/scripts/src/components-core/utils/request-params.js +0 -70
- package/dist/scripts/src/index.js +0 -66
|
@@ -45,42 +45,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
45
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.
|
|
48
|
+
exports.ListNative = exports.ListContext = void 0;
|
|
49
49
|
exports.useListData = useListData;
|
|
50
50
|
exports.MemoizedSection = MemoizedSection;
|
|
51
51
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
52
|
-
const react_1 =
|
|
53
|
-
const
|
|
54
|
-
const List_module_scss_1 = __importDefault(require("./List.module.scss"));
|
|
52
|
+
const react_1 = require("react");
|
|
53
|
+
const react_2 = __importStar(require("react"));
|
|
55
54
|
const lodash_es_1 = require("lodash-es");
|
|
56
|
-
const constants_1 = require("
|
|
57
|
-
const
|
|
55
|
+
const constants_1 = require("../../components-core/constants");
|
|
56
|
+
const CardNative_1 = require("../Card/CardNative");
|
|
57
|
+
const virtua_1 = require("virtua");
|
|
58
|
+
const ScrollContext_1 = require("../../components-core/ScrollContext");
|
|
58
59
|
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
59
|
-
const
|
|
60
|
-
const TextNative_1 = require("@components/Text/TextNative");
|
|
61
|
-
const SpinnerNative_1 = require("@components/Spinner/SpinnerNative");
|
|
62
|
-
const hooks_1 = require("@components-core/utils/hooks");
|
|
63
|
-
const container_helpers_1 = require("@components/container-helpers");
|
|
64
|
-
const misc_1 = require("@components-core/utils/misc");
|
|
60
|
+
const List_module_scss_1 = __importDefault(require("./List.module.scss"));
|
|
65
61
|
const classnames_1 = __importDefault(require("classnames"));
|
|
66
|
-
|
|
62
|
+
const misc_1 = require("../../components-core/utils/misc");
|
|
63
|
+
const SpinnerNative_1 = require("../Spinner/SpinnerNative");
|
|
64
|
+
const TextNative_1 = require("../Text/TextNative");
|
|
65
|
+
const container_helpers_1 = require("../container-helpers");
|
|
66
|
+
exports.ListContext = react_2.default.createContext({
|
|
67
67
|
isExpanded: (id) => false,
|
|
68
68
|
toggleExpanded: (id, isExpanded) => { },
|
|
69
69
|
});
|
|
70
|
-
const Item = ({ children, onHeightChanged, rowIndex, itemType }) => {
|
|
71
|
-
const ref = (0, react_1.useRef)(null);
|
|
72
|
-
(0, hooks_1.useResizeObserver)(ref, (0, react_1.useCallback)(() => {
|
|
73
|
-
onHeightChanged === null || onHeightChanged === void 0 ? void 0 : onHeightChanged(ref.current);
|
|
74
|
-
}, [onHeightChanged]));
|
|
75
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: (divElement) => {
|
|
76
|
-
onHeightChanged === null || onHeightChanged === void 0 ? void 0 : onHeightChanged(divElement);
|
|
77
|
-
ref.current = divElement;
|
|
78
|
-
}, className: (0, classnames_1.default)({
|
|
79
|
-
[List_module_scss_1.default.row]: itemType === RowType.ITEM,
|
|
80
|
-
[List_module_scss_1.default.section]: itemType === RowType.SECTION,
|
|
81
|
-
[List_module_scss_1.default.sectionFooter]: itemType === RowType.SECTION_FOOTER,
|
|
82
|
-
}), "data-list-item-type": itemType, "data-index": rowIndex, children: children }));
|
|
83
|
-
};
|
|
84
70
|
var RowType;
|
|
85
71
|
(function (RowType) {
|
|
86
72
|
RowType["SECTION"] = "SECTION";
|
|
@@ -88,7 +74,7 @@ var RowType;
|
|
|
88
74
|
RowType["ITEM"] = "ITEM";
|
|
89
75
|
})(RowType || (RowType = {}));
|
|
90
76
|
function useListData({ groupsInitiallyExpanded = true, expanded = constants_1.EMPTY_OBJECT, items, limit, groupBy, orderBy, availableGroups, defaultGroups = constants_1.EMPTY_ARRAY, }) {
|
|
91
|
-
const sortedItems = (0,
|
|
77
|
+
const sortedItems = (0, react_2.useMemo)(() => {
|
|
92
78
|
if (!orderBy) {
|
|
93
79
|
return items;
|
|
94
80
|
}
|
|
@@ -104,19 +90,19 @@ function useListData({ groupsInitiallyExpanded = true, expanded = constants_1.EM
|
|
|
104
90
|
const fieldDirectionsToOrderBy = arrayOrderBy.map((ob) => ob.direction);
|
|
105
91
|
return (0, lodash_es_1.orderBy)(items, fieldSelectorsToOrderBy, fieldDirectionsToOrderBy);
|
|
106
92
|
}, [items, orderBy]);
|
|
107
|
-
const cappedItems = (0,
|
|
93
|
+
const cappedItems = (0, react_2.useMemo)(() => {
|
|
108
94
|
if (!limit) {
|
|
109
95
|
return sortedItems;
|
|
110
96
|
}
|
|
111
97
|
return sortedItems.slice(0, limit - 1);
|
|
112
98
|
}, [sortedItems, limit]);
|
|
113
|
-
const sectionedItems = (0,
|
|
99
|
+
const sectionedItems = (0, react_2.useMemo)(() => {
|
|
114
100
|
if (groupBy === undefined) {
|
|
115
101
|
return constants_1.EMPTY_OBJECT;
|
|
116
102
|
}
|
|
117
103
|
return (0, lodash_es_1.groupBy)(cappedItems, (item) => item[groupBy]);
|
|
118
104
|
}, [cappedItems, groupBy]);
|
|
119
|
-
const sections = (0,
|
|
105
|
+
const sections = (0, react_2.useMemo)(() => {
|
|
120
106
|
if (groupBy === undefined) {
|
|
121
107
|
return constants_1.EMPTY_ARRAY;
|
|
122
108
|
}
|
|
@@ -128,7 +114,7 @@ function useListData({ groupsInitiallyExpanded = true, expanded = constants_1.EM
|
|
|
128
114
|
}
|
|
129
115
|
return foundSectionKeys;
|
|
130
116
|
}, [groupBy, sectionedItems, defaultGroups, availableGroups]);
|
|
131
|
-
const rows = (0,
|
|
117
|
+
const rows = (0, react_2.useMemo)(() => {
|
|
132
118
|
if (groupBy === undefined) {
|
|
133
119
|
return cappedItems;
|
|
134
120
|
}
|
|
@@ -184,20 +170,61 @@ const defaultItemRenderer = (item, id) => {
|
|
|
184
170
|
}
|
|
185
171
|
return (0, jsx_runtime_1.jsx)(CardNative_1.Card, { title: title, subtitle: subtitle });
|
|
186
172
|
};
|
|
187
|
-
//
|
|
188
|
-
|
|
173
|
+
// eslint-disable-next-line react/display-name
|
|
174
|
+
const Item = (0, react_2.forwardRef)(({ children, style, index }, forwardedRef) => {
|
|
175
|
+
const getItemType = (0, react_2.useContext)(ListItemTypeContext);
|
|
176
|
+
const itemType = getItemType(index) || RowType.ITEM;
|
|
177
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: style, ref: forwardedRef, className: (0, classnames_1.default)({
|
|
178
|
+
[List_module_scss_1.default.row]: itemType === RowType.ITEM,
|
|
179
|
+
[List_module_scss_1.default.section]: itemType === RowType.SECTION,
|
|
180
|
+
[List_module_scss_1.default.sectionFooter]: itemType === RowType.SECTION_FOOTER,
|
|
181
|
+
}), "data-list-item-type": itemType, "data-index": index, children: children }));
|
|
182
|
+
});
|
|
183
|
+
const ListItemTypeContext = (0, react_2.createContext)((index) => RowType.ITEM);
|
|
184
|
+
/**
|
|
185
|
+
* Virtua's `shift` prop helps maintain scroll position when prepending items (like message history).
|
|
186
|
+
* Unfortunately it's finicky and must only be `true` when the beginning of the list changes, otherwise
|
|
187
|
+
* rendering gets broken (see: https://github.com/inokawa/virtua/issues/284).
|
|
188
|
+
*
|
|
189
|
+
* Virtua also requires `shift` to be correct on the same render pass when items are updated — so we can't
|
|
190
|
+
* just use `useEffect` and `useState` to monitor items and update `shift` since those will update _after_ the
|
|
191
|
+
* render pass. Instead, we use refs to check if the underlying data has changed on each render pass, and
|
|
192
|
+
* update a `shift` ref in the same pass.
|
|
193
|
+
*
|
|
194
|
+
* That's all encapsulated in this handy hook, to keep the logic out of the component.
|
|
195
|
+
*/
|
|
196
|
+
const useShift = (listData, idKey) => {
|
|
197
|
+
var _a, _b, _c;
|
|
198
|
+
const previousListData = (0, react_2.useRef)();
|
|
199
|
+
const shouldShift = (0, react_2.useRef)();
|
|
200
|
+
if (listData !== previousListData.current) {
|
|
201
|
+
if (((_a = listData === null || listData === void 0 ? void 0 : listData[0]) === null || _a === void 0 ? void 0 : _a[idKey]) !== ((_c = (_b = previousListData.current) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c[idKey])) {
|
|
202
|
+
shouldShift.current = true;
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
shouldShift.current = false;
|
|
206
|
+
}
|
|
207
|
+
previousListData.current = listData;
|
|
208
|
+
}
|
|
209
|
+
return shouldShift.current;
|
|
210
|
+
};
|
|
211
|
+
exports.ListNative = (0, react_2.forwardRef)(function DynamicHeightList({ items = constants_1.EMPTY_ARRAY, itemRenderer = defaultItemRenderer, sectionRenderer, sectionFooterRenderer, loading, limit, groupBy, orderBy, availableGroups, scrollAnchor = "top", requestFetchPrevPage = lodash_es_1.noop, requestFetchNextPage = lodash_es_1.noop, pageInfo, idKey = "id", style, emptyListPlaceholder, groupsInitiallyExpanded = true, defaultGroups = constants_1.EMPTY_ARRAY, registerComponentApi, borderCollapse = true, }, ref) {
|
|
189
212
|
var _a;
|
|
190
|
-
|
|
191
|
-
const scrollRef = (0,
|
|
192
|
-
const parentRef = (0,
|
|
213
|
+
const virtualizerRef = (0, react_2.useRef)(null);
|
|
214
|
+
const scrollRef = (0, react_2.useContext)(ScrollContext_1.ScrollContext);
|
|
215
|
+
const parentRef = (0, react_2.useRef)(null);
|
|
193
216
|
const rootRef = ref ? (0, react_compose_refs_1.composeRefs)(parentRef, ref) : parentRef;
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
217
|
+
const hasOutsideScroll = scrollRef &&
|
|
218
|
+
(style === null || style === void 0 ? void 0 : style.maxHeight) === undefined &&
|
|
219
|
+
(style === null || style === void 0 ? void 0 : style.height) === undefined &&
|
|
220
|
+
(style === null || style === void 0 ? void 0 : style.flex) === undefined;
|
|
221
|
+
const scrollElementRef = hasOutsideScroll ? scrollRef : parentRef;
|
|
222
|
+
const shouldStickToBottom = (0, react_2.useRef)(scrollAnchor === "bottom");
|
|
223
|
+
const [expanded, setExpanded] = (0, react_2.useState)(constants_1.EMPTY_OBJECT);
|
|
224
|
+
const toggleExpanded = (0, react_2.useCallback)((id, isExpanded) => {
|
|
198
225
|
setExpanded((prev) => (Object.assign(Object.assign({}, prev), { [id]: isExpanded })));
|
|
199
226
|
}, []);
|
|
200
|
-
const expandContextValue = (0,
|
|
227
|
+
const expandContextValue = (0, react_2.useMemo)(() => {
|
|
201
228
|
return {
|
|
202
229
|
isExpanded: (id) => expanded[id] || (expanded[id] === undefined && groupsInitiallyExpanded),
|
|
203
230
|
toggleExpanded,
|
|
@@ -213,207 +240,150 @@ exports.DynamicHeightList = (0, react_1.forwardRef)(function DynamicHeightList({
|
|
|
213
240
|
orderBy,
|
|
214
241
|
availableGroups,
|
|
215
242
|
});
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
(style === null || style === void 0 ? void 0 : style.flex) === undefined;
|
|
220
|
-
const scrollElementRef = hasOutsideScroll ? scrollRef : parentRef;
|
|
221
|
-
const overscan = 5;
|
|
222
|
-
const rowVirtualizer = (0, react_virtual_1.useVirtualizer)({
|
|
223
|
-
count: rows.length,
|
|
224
|
-
// paddingStart: scrollPaddingStart,
|
|
225
|
-
// paddingEnd: scrollPaddingEnd,
|
|
226
|
-
scrollMargin: !hasOutsideScroll ? 0 : ((_a = parentRef.current) === null || _a === void 0 ? void 0 : _a.offsetTop) || 0,
|
|
227
|
-
getScrollElement: (0, react_1.useCallback)(() => {
|
|
228
|
-
return scrollElementRef.current;
|
|
229
|
-
}, [scrollElementRef]),
|
|
230
|
-
estimateSize: (0, react_1.useCallback)(() => {
|
|
231
|
-
return 10;
|
|
232
|
-
}, []),
|
|
233
|
-
rangeExtractor: (0, react_1.useCallback)((range) => {
|
|
234
|
-
return (0, react_virtual_1.defaultRangeExtractor)(range);
|
|
235
|
-
}, []),
|
|
236
|
-
getItemKey: (0, react_1.useCallback)((index) => {
|
|
237
|
-
var _a;
|
|
238
|
-
return (_a = rows[index][idKey]) !== null && _a !== void 0 ? _a : index;
|
|
239
|
-
}, [idKey, rows]),
|
|
240
|
-
overscan: overscan,
|
|
241
|
-
});
|
|
242
|
-
const tryToScrollToIndex = (0, react_1.useCallback)((index, onFinished) => {
|
|
243
|
-
// console.log("SCROLLING TO INDEX", index);
|
|
244
|
-
rowVirtualizer.scrollToIndex(index);
|
|
245
|
-
requestAnimationFrame(() => {
|
|
246
|
-
onFinished === null || onFinished === void 0 ? void 0 : onFinished();
|
|
247
|
-
});
|
|
248
|
-
}, [rowVirtualizer]);
|
|
249
|
-
const scrollToBottom = (0, misc_1.useEvent)(() => {
|
|
250
|
-
if (rows.length) {
|
|
251
|
-
tryToScrollToIndex(rows.length - 1);
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
const scrollToTop = (0, misc_1.useEvent)(() => {
|
|
255
|
-
if (rows.length) {
|
|
256
|
-
tryToScrollToIndex(0);
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
(0, react_1.useLayoutEffect)(() => {
|
|
260
|
-
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
261
|
-
scrollToBottom,
|
|
262
|
-
scrollToTop,
|
|
263
|
-
});
|
|
264
|
-
}, [registerComponentApi, scrollToBottom, scrollToTop]);
|
|
265
|
-
const virtualItems = rowVirtualizer.getVirtualItems();
|
|
266
|
-
const totalSize = rowVirtualizer.getTotalSize();
|
|
267
|
-
(0, react_1.useEffect)(() => {
|
|
268
|
-
if (selectedIndex && rowVirtualizer) {
|
|
269
|
-
const index = virtualItems.findIndex((item) => item.key === selectedIndex);
|
|
270
|
-
tryToScrollToIndex(index);
|
|
271
|
-
resetSelectedIndex();
|
|
272
|
-
}
|
|
273
|
-
}, [resetSelectedIndex, rowVirtualizer, selectedIndex, tryToScrollToIndex, virtualItems]);
|
|
274
|
-
const prevTotalSize = (0, hooks_1.usePrevious)(totalSize);
|
|
275
|
-
const firstRenderedItem = virtualItems[0];
|
|
276
|
-
const lastRenderedItem = virtualItems[virtualItems.length - 1];
|
|
277
|
-
const initiallyScrolledToBottom = (0, react_1.useRef)(false);
|
|
278
|
-
(0, react_1.useLayoutEffect)(() => {
|
|
243
|
+
const shift = useShift(rows, idKey);
|
|
244
|
+
const initiallyScrolledToBottom = (0, react_2.useRef)(false);
|
|
245
|
+
(0, react_2.useEffect)(() => {
|
|
279
246
|
if (rows.length && scrollAnchor === "bottom" && !initiallyScrolledToBottom.current) {
|
|
280
247
|
initiallyScrolledToBottom.current = true;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
if (prevTotalSize &&
|
|
287
|
-
prevTotalSize !== totalSize &&
|
|
288
|
-
scrollAnchor === "bottom" //&&
|
|
289
|
-
) {
|
|
290
|
-
const delta2 = totalSize - prevTotalSize;
|
|
291
|
-
setSuspendInfiniteLoad(true);
|
|
292
|
-
queueMicrotask(() => {
|
|
293
|
-
scrollElementRef.current.scrollBy({ left: 0, top: delta2 });
|
|
294
|
-
// console.log("scrolled to", scrollElementRef.current.scrollTop);
|
|
295
|
-
setSuspendInfiniteLoad(false);
|
|
248
|
+
requestAnimationFrame(() => {
|
|
249
|
+
var _a;
|
|
250
|
+
(_a = virtualizerRef.current) === null || _a === void 0 ? void 0 : _a.scrollToIndex(rows.length - 1, {
|
|
251
|
+
align: "end",
|
|
252
|
+
});
|
|
296
253
|
});
|
|
297
254
|
}
|
|
298
|
-
}, [
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
rowVirtualizer,
|
|
302
|
-
scrollAnchor,
|
|
303
|
-
scrollElementRef,
|
|
304
|
-
totalSize,
|
|
305
|
-
]);
|
|
306
|
-
const suspendTimerRef = (0, react_1.useRef)(null);
|
|
307
|
-
(0, react_1.useEffect)(() => {
|
|
308
|
-
// console.log({
|
|
309
|
-
// suspendState: suspendInfiniteLoad,
|
|
310
|
-
// pageInfo,
|
|
311
|
-
// firstRenderedItem,
|
|
312
|
-
// // visibleRange
|
|
313
|
-
// });
|
|
314
|
-
if (suspendInfiniteLoad) {
|
|
255
|
+
}, [rows.length, scrollAnchor]);
|
|
256
|
+
(0, react_2.useEffect)(() => {
|
|
257
|
+
if (!virtualizerRef.current)
|
|
315
258
|
return;
|
|
316
|
-
|
|
317
|
-
if (!pageInfo) {
|
|
259
|
+
if (!shouldStickToBottom.current)
|
|
318
260
|
return;
|
|
261
|
+
requestAnimationFrame(() => {
|
|
262
|
+
var _a;
|
|
263
|
+
(_a = virtualizerRef.current) === null || _a === void 0 ? void 0 : _a.scrollToIndex(rows.length - 1, {
|
|
264
|
+
align: "end",
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
}, [rows]);
|
|
268
|
+
const isFetchingPrevPage = (0, react_2.useRef)(false);
|
|
269
|
+
const tryToFetchPrevPage = (0, react_2.useCallback)(() => {
|
|
270
|
+
if (virtualizerRef.current &&
|
|
271
|
+
virtualizerRef.current.findStartIndex() < 10 &&
|
|
272
|
+
pageInfo &&
|
|
273
|
+
pageInfo.hasPrevPage &&
|
|
274
|
+
!pageInfo.isFetchingPrevPage &&
|
|
275
|
+
!isFetchingPrevPage.current) {
|
|
276
|
+
isFetchingPrevPage.current = true;
|
|
277
|
+
(function doFetch() {
|
|
278
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
279
|
+
try {
|
|
280
|
+
yield requestFetchPrevPage();
|
|
281
|
+
}
|
|
282
|
+
finally {
|
|
283
|
+
isFetchingPrevPage.current = false;
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
})();
|
|
319
287
|
}
|
|
320
|
-
|
|
321
|
-
|
|
288
|
+
}, [pageInfo, requestFetchPrevPage]);
|
|
289
|
+
const isFetchingNextPage = (0, react_2.useRef)(false);
|
|
290
|
+
const tryToFetchNextPage = (0, react_2.useCallback)(() => {
|
|
291
|
+
if (virtualizerRef.current &&
|
|
292
|
+
virtualizerRef.current.findEndIndex() + 10 > rows.length &&
|
|
293
|
+
pageInfo &&
|
|
294
|
+
pageInfo.hasNextPage &&
|
|
295
|
+
!pageInfo.isFetchingNextPage &&
|
|
296
|
+
!isFetchingNextPage.current) {
|
|
297
|
+
isFetchingNextPage.current = true;
|
|
298
|
+
(function doFetch() {
|
|
299
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
300
|
+
try {
|
|
301
|
+
yield requestFetchNextPage();
|
|
302
|
+
}
|
|
303
|
+
finally {
|
|
304
|
+
isFetchingNextPage.current = false;
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
})();
|
|
322
308
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
// console.log("fetching prev page START", pageInfo);
|
|
330
|
-
yield requestFetchPrevPage();
|
|
331
|
-
// console.log("fetching prev page END", pageInfo);
|
|
332
|
-
suspendTimerRef.current = setTimeout(() => {
|
|
333
|
-
setSuspendInfiniteLoad(false);
|
|
334
|
-
}, 500);
|
|
335
|
-
}))();
|
|
309
|
+
}, [rows.length, pageInfo, requestFetchNextPage]);
|
|
310
|
+
const initiallyFetchedExtraPages = (0, react_2.useRef)(false);
|
|
311
|
+
(0, react_2.useEffect)(() => {
|
|
312
|
+
if (rows.length && !initiallyFetchedExtraPages.current) {
|
|
313
|
+
initiallyFetchedExtraPages.current = true;
|
|
314
|
+
tryToFetchPrevPage();
|
|
336
315
|
}
|
|
337
|
-
}, [
|
|
338
|
-
(0,
|
|
339
|
-
|
|
340
|
-
// suspendState: suspendInfiniteLoad,
|
|
341
|
-
// pageInfo,
|
|
342
|
-
// lastRenderedItem,
|
|
343
|
-
// itemsLength: items.length
|
|
344
|
-
// // visibleRange
|
|
345
|
-
// });
|
|
346
|
-
if (suspendInfiniteLoad) {
|
|
316
|
+
}, [rows.length, tryToFetchNextPage, tryToFetchPrevPage]);
|
|
317
|
+
const onScroll = (0, react_2.useCallback)((offset) => {
|
|
318
|
+
if (!virtualizerRef.current)
|
|
347
319
|
return;
|
|
320
|
+
if (scrollAnchor === "bottom") {
|
|
321
|
+
// The sum may not be 0 because of sub-pixel value when browser's window.devicePixelRatio has decimal value
|
|
322
|
+
shouldStickToBottom.current =
|
|
323
|
+
offset - virtualizerRef.current.scrollSize + virtualizerRef.current.viewportSize >= -1.5;
|
|
348
324
|
}
|
|
349
|
-
|
|
350
|
-
|
|
325
|
+
tryToFetchPrevPage();
|
|
326
|
+
tryToFetchNextPage();
|
|
327
|
+
}, [scrollAnchor, tryToFetchNextPage, tryToFetchPrevPage]);
|
|
328
|
+
const scrollToBottom = (0, misc_1.useEvent)(() => {
|
|
329
|
+
var _a;
|
|
330
|
+
if (rows.length) {
|
|
331
|
+
(_a = virtualizerRef.current) === null || _a === void 0 ? void 0 : _a.scrollToIndex(rows.length - 1, {
|
|
332
|
+
align: "end",
|
|
333
|
+
});
|
|
351
334
|
}
|
|
352
|
-
|
|
353
|
-
|
|
335
|
+
});
|
|
336
|
+
const scrollToTop = (0, misc_1.useEvent)(() => {
|
|
337
|
+
var _a;
|
|
338
|
+
if (rows.length) {
|
|
339
|
+
(_a = virtualizerRef.current) === null || _a === void 0 ? void 0 : _a.scrollToIndex(0);
|
|
354
340
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
yield requestFetchNextPage();
|
|
365
|
-
// console.log("fetching prev page END", pageInfo);
|
|
366
|
-
suspendTimerRef.current = setTimeout(() => {
|
|
367
|
-
setSuspendInfiniteLoad(false);
|
|
368
|
-
}, 500);
|
|
369
|
-
}))();
|
|
341
|
+
});
|
|
342
|
+
const scrollToIndex = (0, misc_1.useEvent)((index) => {
|
|
343
|
+
var _a;
|
|
344
|
+
(_a = virtualizerRef.current) === null || _a === void 0 ? void 0 : _a.scrollToIndex(index);
|
|
345
|
+
});
|
|
346
|
+
const scrollToId = (0, misc_1.useEvent)((id) => {
|
|
347
|
+
const index = rows === null || rows === void 0 ? void 0 : rows.findIndex((row) => row[idKey] === id);
|
|
348
|
+
if (index >= 0) {
|
|
349
|
+
scrollToIndex(index);
|
|
370
350
|
}
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
? 0
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
351
|
+
});
|
|
352
|
+
(0, react_2.useLayoutEffect)(() => {
|
|
353
|
+
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
354
|
+
scrollToBottom,
|
|
355
|
+
scrollToTop,
|
|
356
|
+
scrollToIndex,
|
|
357
|
+
scrollToId
|
|
358
|
+
});
|
|
359
|
+
}, [registerComponentApi, scrollToBottom, scrollToId, scrollToIndex, scrollToTop]);
|
|
360
|
+
const rowTypeContextValue = (0, react_2.useCallback)((index) => rows[index]._row_type, [rows]);
|
|
361
|
+
return ((0, jsx_runtime_1.jsx)(ListItemTypeContext.Provider, { value: rowTypeContextValue, children: (0, jsx_runtime_1.jsx)(exports.ListContext.Provider, { value: expandContextValue, children: (0, jsx_runtime_1.jsxs)("div", { ref: rootRef, style: style, className: (0, classnames_1.default)(List_module_scss_1.default.outerWrapper, {
|
|
362
|
+
[List_module_scss_1.default.hasOutsideScroll]: hasOutsideScroll,
|
|
363
|
+
}), children: [loading && rows.length === 0 && ((0, jsx_runtime_1.jsx)("div", { className: List_module_scss_1.default.loadingWrapper, children: (0, jsx_runtime_1.jsx)(SpinnerNative_1.Spinner, {}) })), !loading &&
|
|
364
|
+
rows.length === 0 &&
|
|
365
|
+
(emptyListPlaceholder !== null && emptyListPlaceholder !== void 0 ? emptyListPlaceholder : ((0, jsx_runtime_1.jsx)("div", { className: List_module_scss_1.default.noRows, children: (0, jsx_runtime_1.jsx)(TextNative_1.Text, { children: "No data available" }) }))), rows.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(List_module_scss_1.default.innerWrapper, {
|
|
366
|
+
[List_module_scss_1.default.reverse]: scrollAnchor === "bottom",
|
|
383
367
|
[List_module_scss_1.default.borderCollapse]: borderCollapse,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
case RowType.SECTION:
|
|
397
|
-
itemContent = (_a = sectionRenderer === null || sectionRenderer === void 0 ? void 0 : sectionRenderer(item, item[idKey])) !== null && _a !== void 0 ? _a : null;
|
|
398
|
-
key = `section_${key}`;
|
|
399
|
-
break;
|
|
400
|
-
case RowType.SECTION_FOOTER:
|
|
401
|
-
itemContent = sectionFooterRenderer === null || sectionFooterRenderer === void 0 ? void 0 : sectionFooterRenderer(item, item[idKey]);
|
|
402
|
-
key = `section_footer_${key}`;
|
|
403
|
-
break;
|
|
404
|
-
default:
|
|
405
|
-
itemContent = (_b = itemRenderer(item, item[idKey])) !== null && _b !== void 0 ? _b : null;
|
|
406
|
-
break;
|
|
407
|
-
}
|
|
408
|
-
return ((0, jsx_runtime_1.jsx)(Item, { onHeightChanged: rowVirtualizer.measureElement, rowIndex: virtualItem.index, itemType: item._row_type || RowType.ITEM, children: itemContent }, key));
|
|
409
|
-
}) }) }))] }) }));
|
|
368
|
+
[List_module_scss_1.default.sectioned]: groupBy !== undefined,
|
|
369
|
+
}), "data-list-container": true, children: (0, jsx_runtime_1.jsx)(virtua_1.Virtualizer, { ref: virtualizerRef, scrollRef: scrollElementRef, shift: shift, onScroll: onScroll, startMargin: !hasOutsideScroll ? 0 : ((_a = parentRef.current) === null || _a === void 0 ? void 0 : _a.offsetTop) || 0, item: Item, children: rows.map((row) => {
|
|
370
|
+
const key = row[idKey];
|
|
371
|
+
switch (row._row_type) {
|
|
372
|
+
case RowType.SECTION:
|
|
373
|
+
return (0, jsx_runtime_1.jsx)(react_1.Fragment, { children: (sectionRenderer === null || sectionRenderer === void 0 ? void 0 : sectionRenderer(row, key)) || (0, jsx_runtime_1.jsx)("div", {}) }, key);
|
|
374
|
+
case RowType.SECTION_FOOTER:
|
|
375
|
+
return (0, jsx_runtime_1.jsx)(react_1.Fragment, { children: (sectionFooterRenderer === null || sectionFooterRenderer === void 0 ? void 0 : sectionFooterRenderer(row, key)) || (0, jsx_runtime_1.jsx)("div", {}) }, key);
|
|
376
|
+
default:
|
|
377
|
+
return (0, jsx_runtime_1.jsx)(react_1.Fragment, { children: itemRenderer(row, key) || (0, jsx_runtime_1.jsx)("div", {}) }, key);
|
|
378
|
+
}
|
|
379
|
+
}) }) }))] }) }) }));
|
|
410
380
|
});
|
|
411
381
|
// --- Helper function for List item rendering
|
|
412
382
|
function MemoizedSection({ node, renderChild, item, }) {
|
|
413
|
-
const { isExpanded, toggleExpanded } = (0,
|
|
383
|
+
const { isExpanded, toggleExpanded } = (0, react_2.useContext)(exports.ListContext);
|
|
414
384
|
const id = item.id;
|
|
415
385
|
const expanded = isExpanded(id);
|
|
416
|
-
const sectionContext = (0,
|
|
386
|
+
const sectionContext = (0, react_2.useMemo)(() => {
|
|
417
387
|
return {
|
|
418
388
|
isExpanded: expanded,
|
|
419
389
|
toggle: () => {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.logoComponentRenderer = exports.LogoMd = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
6
|
+
const renderers_1 = require("../../components-core/renderers");
|
|
7
7
|
const LogoNative_1 = require("./LogoNative");
|
|
8
8
|
const COMP = "Logo";
|
|
9
9
|
exports.LogoMd = (0, ComponentDefs_1.createMetadata)({
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Logo = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ImageNative_1 = require("@components/Image/ImageNative");
|
|
6
|
-
const AppHeaderNative_1 = require("@components/AppHeader/AppHeaderNative");
|
|
7
5
|
const react_1 = require("react");
|
|
6
|
+
const ImageNative_1 = require("../Image/ImageNative");
|
|
7
|
+
const AppHeaderNative_1 = require("../AppHeader/AppHeaderNative");
|
|
8
8
|
exports.Logo = (0, react_1.forwardRef)(function Logo({ style, }, forwardedRef) {
|
|
9
9
|
const logoUrl = (0, AppHeaderNative_1.useLogoUrl)();
|
|
10
10
|
if (!logoUrl) {
|
|
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.markdownComponentRenderer = exports.MarkdownMd = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
9
|
-
const renderers_1 = require("@components-core/renderers");
|
|
10
8
|
const Markdown_module_scss_1 = __importDefault(require("./Markdown.module.scss"));
|
|
11
|
-
const
|
|
9
|
+
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
10
|
+
const renderers_1 = require("../../components-core/renderers");
|
|
11
|
+
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
12
12
|
const MarkdownNative_1 = require("./MarkdownNative");
|
|
13
13
|
const COMP = "Markdown";
|
|
14
14
|
exports.MarkdownMd = (0, ComponentDefs_1.createMetadata)({
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Markdown = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
-
const Markdown_module_scss_1 = __importDefault(require("./Markdown.module.scss"));
|
|
10
9
|
const react_markdown_1 = __importDefault(require("react-markdown"));
|
|
11
|
-
const
|
|
10
|
+
const Markdown_module_scss_1 = __importDefault(require("./Markdown.module.scss"));
|
|
11
|
+
const HeadingNative_1 = require("../Heading/HeadingNative");
|
|
12
12
|
const TextNative_1 = require("../Text/TextNative");
|
|
13
|
-
const LinkNative_1 = require("
|
|
14
|
-
const ImageNative_1 = require("
|
|
13
|
+
const LinkNative_1 = require("../Link/LinkNative");
|
|
14
|
+
const ImageNative_1 = require("../Image/ImageNative");
|
|
15
15
|
exports.Markdown = (0, react_1.memo)(function Markdown({ removeIndents = false, children, style }) {
|
|
16
16
|
if (typeof children !== "string") {
|
|
17
17
|
return null;
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.modalViewComponentRenderer = exports.ModalDialogMd = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const ModalDialog_module_scss_1 = __importDefault(require("./ModalDialog.module.scss"));
|
|
9
|
-
const ComponentDefs_1 = require("
|
|
10
|
-
const renderers_1 = require("
|
|
11
|
-
const themeVars_1 = require("
|
|
12
|
-
const base_utils_1 = require("
|
|
13
|
-
const container_helpers_1 = require("
|
|
9
|
+
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
10
|
+
const renderers_1 = require("../../components-core/renderers");
|
|
11
|
+
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
12
|
+
const base_utils_1 = require("../../components-core/theming/themes/base-utils");
|
|
13
|
+
const container_helpers_1 = require("../container-helpers");
|
|
14
14
|
const ModalDialogNative_1 = require("./ModalDialogNative");
|
|
15
15
|
const COMP = "ModalDialog";
|
|
16
16
|
exports.ModalDialogMd = (0, ComponentDefs_1.createMetadata)({
|
|
@@ -48,14 +48,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
48
48
|
exports.ModalDialog = exports.ModalDialogFrame = void 0;
|
|
49
49
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
50
50
|
const react_1 = __importStar(require("react"));
|
|
51
|
-
const ModalDialog_module_scss_1 = __importDefault(require("./ModalDialog.module.scss"));
|
|
52
|
-
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
53
|
-
const IconNative_1 = require("@components/Icon/IconNative");
|
|
54
|
-
const ThemeContext_1 = require("@components-core/theming/ThemeContext");
|
|
55
|
-
const ButtonNative_1 = require("@components/Button/ButtonNative");
|
|
56
|
-
const misc_1 = require("@components-core/utils/misc");
|
|
57
|
-
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
58
51
|
const Dialog = __importStar(require("@radix-ui/react-dialog"));
|
|
52
|
+
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
53
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
54
|
+
const ModalDialog_module_scss_1 = __importDefault(require("./ModalDialog.module.scss"));
|
|
55
|
+
const ThemeContext_1 = require("../../components-core/theming/ThemeContext");
|
|
56
|
+
const misc_1 = require("../../components-core/utils/misc");
|
|
57
|
+
const IconNative_1 = require("../Icon/IconNative");
|
|
58
|
+
const ButtonNative_1 = require("../Button/ButtonNative");
|
|
59
59
|
const ModalVisibilityContext_1 = require("./ModalVisibilityContext");
|
|
60
60
|
exports.ModalDialogFrame = react_1.default.forwardRef(({ isInitiallyOpen, onOpen, onClose, registerComponentApi, renderDialog }, ref) => {
|
|
61
61
|
const modalContextStateValue = useModalLocalOpenState(isInitiallyOpen, onOpen, onClose);
|
|
@@ -68,7 +68,7 @@ exports.ModalDialogFrame = react_1.default.forwardRef(({ isInitiallyOpen, onOpen
|
|
|
68
68
|
}, [doClose, doOpen, registerComponentApi]);
|
|
69
69
|
return isOpen ? ((0, jsx_runtime_1.jsx)(ModalStateContext.Provider, { value: modalContextStateValue, children: renderDialog({
|
|
70
70
|
openParams,
|
|
71
|
-
ref
|
|
71
|
+
ref,
|
|
72
72
|
}) })) : null;
|
|
73
73
|
});
|
|
74
74
|
const ModalStateContext = react_1.default.createContext(null);
|
|
@@ -5,14 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.navGroupComponentRenderer = exports.NavGroupMd = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
9
|
-
const renderers_1 = require("@components-core/renderers");
|
|
10
8
|
const NavGroup_module_scss_1 = __importDefault(require("./NavGroup.module.scss"));
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
9
|
+
const NavLink_module_scss_1 = __importDefault(require("../NavLink/NavLink.module.scss"));
|
|
10
|
+
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
11
|
+
const renderers_1 = require("../../components-core/renderers");
|
|
12
|
+
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
13
|
+
const IconNative_1 = require("../Icon/IconNative");
|
|
14
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
14
15
|
const NavGroupNative_1 = require("./NavGroupNative");
|
|
15
|
-
const metadata_helpers_1 = require("@components/metadata-helpers");
|
|
16
16
|
const COMP = "NavGroup";
|
|
17
17
|
exports.NavGroupMd = (0, ComponentDefs_1.createMetadata)({
|
|
18
18
|
description: `The \`NavGroup\` component is a container for grouping related navigation targets ` +
|