xmlui 0.4.0
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/Pdf-DeGhSMXe.mjs +19537 -0
- package/dist/Pdf.css +1 -0
- package/dist/apiInterceptorWorker-CwuUhYyc.mjs +9229 -0
- package/dist/array-USo-Szhp.mjs +12 -0
- package/dist/index-C24dkfpd.mjs +1434 -0
- package/dist/index-ao27SnVp.mjs +145185 -0
- package/dist/index.css +1 -0
- package/dist/nivo-bar.es-CWh0ZlxB.mjs +1666 -0
- package/dist/nivo-geo.es-BTqNt5Db.mjs +1579 -0
- package/dist/nivo-legends.es-BuIxHGSU.mjs +6916 -0
- package/dist/nivo-pie.es-BvCBFA0L.mjs +700 -0
- package/dist/react-apexcharts.min-DqWuDOyO.mjs +8881 -0
- package/dist/scripts/bin/bootstrap.js +11 -0
- package/dist/scripts/bin/build.js +256 -0
- package/dist/scripts/bin/index.js +88 -0
- package/dist/scripts/bin/preview.js +27 -0
- package/dist/scripts/bin/start.js +41 -0
- package/dist/scripts/bin/vite-ueml-plugin.js +113 -0
- package/dist/scripts/bin/viteConfig.js +112 -0
- package/dist/scripts/src/abstractions/ActionDefs.js +2 -0
- package/dist/scripts/src/abstractions/AppContextDefs.js +2 -0
- package/dist/scripts/src/abstractions/BlockScope.js +4 -0
- package/dist/scripts/src/abstractions/ComponentDefs.js +2 -0
- package/dist/scripts/src/abstractions/ComponentDescriptorDefs.js +2 -0
- package/dist/scripts/src/abstractions/ContainerDefs.js +2 -0
- package/dist/scripts/src/abstractions/FunctionDefs.js +2 -0
- package/dist/scripts/src/abstractions/RendererDefs.js +2 -0
- package/dist/scripts/src/abstractions/scripting/ScriptParserError.js +2 -0
- package/dist/scripts/src/abstractions/scripting/ScriptingSourceTree.js +2 -0
- package/dist/scripts/src/abstractions/scripting/Token.js +110 -0
- package/dist/scripts/src/components/App/App.js +253 -0
- package/dist/scripts/src/components/App/AppLayoutContext.js +9 -0
- package/dist/scripts/src/components/App/AppStateContext.js +9 -0
- package/dist/scripts/src/components/App/Sheet.js +89 -0
- package/dist/scripts/src/components/AppHeader/AppHeader.js +121 -0
- package/dist/scripts/src/components/AppState/AppState.js +29 -0
- package/dist/scripts/src/components/Avatar/Avatar.js +81 -0
- package/dist/scripts/src/components/Badge/Badge.js +56 -0
- package/dist/scripts/src/components/BarChart/BarChart.js +199 -0
- package/dist/scripts/src/components/Bookmark/Bookmark.js +11 -0
- package/dist/scripts/src/components/Button/Button.js +196 -0
- package/dist/scripts/src/components/Card/Card.js +65 -0
- package/dist/scripts/src/components/ChangeListener/ChangeListener.js +43 -0
- package/dist/scripts/src/components/Chart/Chart.js +158 -0
- package/dist/scripts/src/components/Checkbox/Checkbox.js +43 -0
- package/dist/scripts/src/components/Combobox/Combobox.js +145 -0
- package/dist/scripts/src/components/ComponentProvider.js +357 -0
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +40 -0
- package/dist/scripts/src/components/DatePicker/DatePicker.js +196 -0
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +175 -0
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +56 -0
- package/dist/scripts/src/components/FileInput/FileInput.js +127 -0
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +106 -0
- package/dist/scripts/src/components/FlowLayout/FlowLayout.js +139 -0
- package/dist/scripts/src/components/Footer/Footer.js +42 -0
- package/dist/scripts/src/components/Form/Form.js +320 -0
- package/dist/scripts/src/components/Form/FormContext.js +9 -0
- package/dist/scripts/src/components/Form/formActions.js +86 -0
- package/dist/scripts/src/components/FormItem/FormItem.js +204 -0
- package/dist/scripts/src/components/FormItem/HelperText.js +27 -0
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +39 -0
- package/dist/scripts/src/components/FormItem/Validations.js +346 -0
- package/dist/scripts/src/components/FormSection/FormSection.js +45 -0
- package/dist/scripts/src/components/Heading/Heading.js +206 -0
- package/dist/scripts/src/components/HoverCard/HoverCard.js +45 -0
- package/dist/scripts/src/components/Icon/ApiIcon.js +10 -0
- package/dist/scripts/src/components/Icon/Attach.js +10 -0
- package/dist/scripts/src/components/Icon/Binding.js +11 -0
- package/dist/scripts/src/components/Icon/BoardIcon.js +7 -0
- package/dist/scripts/src/components/Icon/BoxIcon.js +10 -0
- package/dist/scripts/src/components/Icon/CheckIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronDownIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronLeft.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronRight.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronUpIcon.js +7 -0
- package/dist/scripts/src/components/Icon/CodeFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/CodeSandbox.js +10 -0
- package/dist/scripts/src/components/Icon/CompactListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ContentCopyIcon.js +7 -0
- package/dist/scripts/src/components/Icon/DatabaseIcon.js +11 -0
- package/dist/scripts/src/components/Icon/DocFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/DocIcon.js +10 -0
- package/dist/scripts/src/components/Icon/DotMenuHorizontalIcon.js +7 -0
- package/dist/scripts/src/components/Icon/DotMenuIcon.js +7 -0
- package/dist/scripts/src/components/Icon/EmailIcon.js +7 -0
- package/dist/scripts/src/components/Icon/EmptyFolderIcon.js +10 -0
- package/dist/scripts/src/components/Icon/ErrorIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ExpressionIcon.js +10 -0
- package/dist/scripts/src/components/Icon/FillPlusCricleIcon.js +7 -0
- package/dist/scripts/src/components/Icon/FilterIcon.js +10 -0
- package/dist/scripts/src/components/Icon/FolderIcon.js +10 -0
- package/dist/scripts/src/components/Icon/GlobeIcon.js +7 -0
- package/dist/scripts/src/components/Icon/HomeIcon.js +7 -0
- package/dist/scripts/src/components/Icon/HyperLinkIcon.js +7 -0
- package/dist/scripts/src/components/Icon/Icon.js +101 -0
- package/dist/scripts/src/components/Icon/ImageFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/LinkIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/LooseListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/MoonIcon.js +10 -0
- package/dist/scripts/src/components/Icon/MoreOptionsIcon.js +7 -0
- package/dist/scripts/src/components/Icon/PDFIcon.js +10 -0
- package/dist/scripts/src/components/Icon/PenIcon.js +7 -0
- package/dist/scripts/src/components/Icon/PhoneIcon.js +7 -0
- package/dist/scripts/src/components/Icon/PhotoIcon.js +10 -0
- package/dist/scripts/src/components/Icon/PlusIcon.js +7 -0
- package/dist/scripts/src/components/Icon/SearchIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ShareIcon.js +10 -0
- package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
- package/dist/scripts/src/components/Icon/TrashIcon.js +7 -0
- package/dist/scripts/src/components/Icon/TxtIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UnknownFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UnlinkIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UserIcon.js +7 -0
- package/dist/scripts/src/components/Icon/WarningIcon.js +7 -0
- package/dist/scripts/src/components/Icon/XlsIcon.js +10 -0
- package/dist/scripts/src/components/IconProvider.js +249 -0
- package/dist/scripts/src/components/IconRegistryContext.js +307 -0
- package/dist/scripts/src/components/Image/Image.js +34 -0
- package/dist/scripts/src/components/Input/InputAdornment.js +14 -0
- package/dist/scripts/src/components/Input/input-abstractions.js +44 -0
- package/dist/scripts/src/components/Items/Items.js +48 -0
- package/dist/scripts/src/components/Link/Link.js +72 -0
- package/dist/scripts/src/components/List/List.js +442 -0
- package/dist/scripts/src/components/Logo/Logo.js +25 -0
- package/dist/scripts/src/components/Map/Map.js +60 -0
- package/dist/scripts/src/components/Map/world_countries.json +45307 -0
- package/dist/scripts/src/components/Markdown/Markdown.js +120 -0
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +106 -0
- package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +145 -0
- package/dist/scripts/src/components/MultiCombobox/MultiCombobox.js +249 -0
- package/dist/scripts/src/components/MultiSelect/MultiSelect.js +192 -0
- package/dist/scripts/src/components/NavGroup/NavGroup.js +113 -0
- package/dist/scripts/src/components/NavLink/NavLink.js +115 -0
- package/dist/scripts/src/components/NavPanel/NavPanel.js +101 -0
- package/dist/scripts/src/components/NoResult/NoResult.js +39 -0
- package/dist/scripts/src/components/NumberBox/NumberBox.js +373 -0
- package/dist/scripts/src/components/Option/Option.js +41 -0
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +22 -0
- package/dist/scripts/src/components/Pages/Pages.js +74 -0
- package/dist/scripts/src/components/Pdf/LazyPdf.js +44 -0
- package/dist/scripts/src/components/Pdf/Pdf.js +19 -0
- package/dist/scripts/src/components/PieChart/PieChart.js +184 -0
- package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +29 -0
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +38 -0
- package/dist/scripts/src/components/Queue/Queue.js +286 -0
- package/dist/scripts/src/components/Queue/queueActions.js +87 -0
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +144 -0
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +147 -0
- package/dist/scripts/src/components/Redirect/Redirect.js +10 -0
- package/dist/scripts/src/components/Select/Select.js +139 -0
- package/dist/scripts/src/components/Select/SelectContext.js +45 -0
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +88 -0
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +22 -0
- package/dist/scripts/src/components/Spinner/Spinner.js +59 -0
- package/dist/scripts/src/components/Splitter/Splitter.js +205 -0
- package/dist/scripts/src/components/Splitter/utils.js +17 -0
- package/dist/scripts/src/components/Stack/Stack.js +117 -0
- package/dist/scripts/src/components/StickyBox/StickyBox.js +33 -0
- package/dist/scripts/src/components/Switch/Switch.js +50 -0
- package/dist/scripts/src/components/Table/Table.js +499 -0
- package/dist/scripts/src/components/Table/useRowSelection.js +169 -0
- package/dist/scripts/src/components/TableColumnDef/TableColumnDef.js +44 -0
- package/dist/scripts/src/components/TableColumnDef/TableContext.js +12 -0
- package/dist/scripts/src/components/Tabs/Tabs.js +85 -0
- package/dist/scripts/src/components/Text/Text.js +175 -0
- package/dist/scripts/src/components/TextArea/TextArea.js +194 -0
- package/dist/scripts/src/components/TextArea/TextAreaResizable.js +63 -0
- package/dist/scripts/src/components/TextArea/useComposedRef.js +50 -0
- package/dist/scripts/src/components/TextBox/TextBox.js +145 -0
- package/dist/scripts/src/components/Theme/NotificationToast.js +39 -0
- package/dist/scripts/src/components/Theme/Theme.js +153 -0
- package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +125 -0
- package/dist/scripts/src/components/Toggle/Toggle.js +88 -0
- package/dist/scripts/src/components/Tree/TreeComponent.js +79 -0
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +59 -0
- package/dist/scripts/src/components/ViewComponentRegistryContext.js +34 -0
- package/dist/scripts/src/components/abstractions.js +2 -0
- package/dist/scripts/src/components/chart-color-schemes.js +43 -0
- package/dist/scripts/src/components/component-utils.js +32 -0
- package/dist/scripts/src/components/container-helpers.js +18 -0
- package/dist/scripts/src/components-core/ApiBoundComponent.js +189 -0
- package/dist/scripts/src/components-core/AppContext.js +17 -0
- package/dist/scripts/src/components-core/ChildrenSlot.js +10 -0
- package/dist/scripts/src/components-core/Component.js +280 -0
- package/dist/scripts/src/components-core/ComponentDecorator.js +63 -0
- package/dist/scripts/src/components-core/CompoundComponent.js +132 -0
- package/dist/scripts/src/components-core/EngineError.js +91 -0
- package/dist/scripts/src/components-core/ErrorBoundary.js +58 -0
- package/dist/scripts/src/components-core/Fragment.js +14 -0
- package/dist/scripts/src/components-core/InvalidComponent.js +15 -0
- package/dist/scripts/src/components-core/LoaderComponent.js +78 -0
- package/dist/scripts/src/components-core/RestApiProxy.js +341 -0
- package/dist/scripts/src/components-core/RootComponent.js +272 -0
- package/dist/scripts/src/components-core/RouteContext.js +45 -0
- package/dist/scripts/src/components-core/ScrollContext.js +9 -0
- package/dist/scripts/src/components-core/UnknownComponent.js +15 -0
- package/dist/scripts/src/components-core/abstractions/ComponentRenderer.js +2 -0
- package/dist/scripts/src/components-core/abstractions/LoaderRenderer.js +2 -0
- package/dist/scripts/src/components-core/abstractions/containers.js +18 -0
- package/dist/scripts/src/components-core/abstractions/treeAbstractions.js +2 -0
- package/dist/scripts/src/components-core/action/ApiAction.js +276 -0
- package/dist/scripts/src/components-core/action/DownloadFileAction.js +80 -0
- package/dist/scripts/src/components-core/action/NavigateAction.js +20 -0
- package/dist/scripts/src/components-core/action/TimedAction.js +21 -0
- package/dist/scripts/src/components-core/action/UploadAction.js +88 -0
- package/dist/scripts/src/components-core/action/actions.js +15 -0
- package/dist/scripts/src/components-core/appContext/date-functions.js +19 -0
- package/dist/scripts/src/components-core/appContext/misc-utils.js +12 -0
- package/dist/scripts/src/components-core/component-hooks.js +25 -0
- package/dist/scripts/src/components-core/constants.js +18 -0
- package/dist/scripts/src/components-core/container/Container.js +1110 -0
- package/dist/scripts/src/components-core/container/ContainerComponentDef.js +16 -0
- package/dist/scripts/src/components-core/container/buildProxy.js +54 -0
- package/dist/scripts/src/components-core/container/collectFnVarDeps.js +26 -0
- package/dist/scripts/src/components-core/container/valueExtractor.js +195 -0
- package/dist/scripts/src/components-core/descriptorHelper.js +75 -0
- package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
- package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
- package/dist/scripts/src/components-core/loader/ApiLoader.js +46 -0
- package/dist/scripts/src/components-core/loader/DataLoader.js +160 -0
- package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +52 -0
- package/dist/scripts/src/components-core/loader/Loader.js +115 -0
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +32 -0
- package/dist/scripts/src/components-core/loader/PageableLoader.js +240 -0
- package/dist/scripts/src/components-core/renderers.js +45 -0
- package/dist/scripts/src/components-core/reportEngineError.js +59 -0
- package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +35 -0
- package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +34 -0
- package/dist/scripts/src/components-core/script-runner/LogicalThread.js +2 -0
- package/dist/scripts/src/components-core/script-runner/LoopScope.js +2 -0
- package/dist/scripts/src/components-core/script-runner/ParameterParser.js +117 -0
- package/dist/scripts/src/components-core/script-runner/TryScope.js +2 -0
- package/dist/scripts/src/components-core/script-runner/asyncProxy.js +96 -0
- package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +34 -0
- package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +40 -0
- package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +40 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +551 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +498 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +434 -0
- package/dist/scripts/src/components-core/script-runner/modules.js +250 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +818 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +193 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +740 -0
- package/dist/scripts/src/components-core/script-runner/statement-queue.js +62 -0
- package/dist/scripts/src/components-core/script-runner/visitors.js +352 -0
- package/dist/scripts/src/components-core/theming/ThemeContext.js +43 -0
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +334 -0
- package/dist/scripts/src/components-core/theming/abstractions.js +11 -0
- package/dist/scripts/src/components-core/theming/extendThemeUtils.js +114 -0
- package/dist/scripts/src/components-core/theming/hvar.js +105 -0
- package/dist/scripts/src/components-core/theming/themeVars.js +62 -0
- package/dist/scripts/src/components-core/theming/themes/base-utils.js +31 -0
- package/dist/scripts/src/components-core/theming/themes/palette.js +53 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +257 -0
- package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
- package/dist/scripts/src/components-core/theming/themes/theme-colors.js +407 -0
- package/dist/scripts/src/components-core/theming/themes/xmlui.js +32 -0
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +286 -0
- package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +34 -0
- package/dist/scripts/src/components-core/utils/LruCache.js +184 -0
- package/dist/scripts/src/components-core/utils/actionUtils.js +32 -0
- package/dist/scripts/src/components-core/utils/classnames.js +58 -0
- package/dist/scripts/src/components-core/utils/css-utils.js +127 -0
- package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
- package/dist/scripts/src/components-core/utils/extractParam.js +148 -0
- package/dist/scripts/src/components-core/utils/hooks.js +221 -0
- package/dist/scripts/src/components-core/utils/mergeProps.js +45 -0
- package/dist/scripts/src/components-core/utils/misc.js +460 -0
- package/dist/scripts/src/components-core/utils/statementUtils.js +205 -0
- package/dist/scripts/src/components-core/utils/treeUtils.js +48 -0
- package/dist/scripts/src/components-core/xmlui-parser.js +52 -0
- package/dist/scripts/src/parsers/scripting/InputStream.js +59 -0
- package/dist/scripts/src/parsers/scripting/Lexer.js +1028 -0
- package/dist/scripts/src/parsers/scripting/Parser.js +2647 -0
- package/dist/scripts/src/parsers/scripting/ParserError.js +46 -0
- package/dist/scripts/src/parsers/scripting/TokenTrait.js +109 -0
- package/dist/scripts/src/parsers/scripting/code-behind-collect.js +118 -0
- package/dist/scripts/src/parsers/scripting/tree-visitor.js +602 -0
- package/dist/scripts/src/parsers/style-parser/StyleInputStream.js +39 -0
- package/dist/scripts/src/parsers/style-parser/StyleLexer.js +621 -0
- package/dist/scripts/src/parsers/style-parser/StyleParser.js +1000 -0
- package/dist/scripts/src/parsers/style-parser/errors.js +37 -0
- package/dist/scripts/src/parsers/style-parser/source-tree.js +2 -0
- package/dist/scripts/src/parsers/style-parser/style-compiler.js +513 -0
- package/dist/scripts/src/parsers/style-parser/tokens.js +42 -0
- package/dist/scripts/src/parsers/ueml/ParserError.js +54 -0
- package/dist/scripts/src/parsers/ueml/UemlHelper.js +579 -0
- package/dist/scripts/src/parsers/ueml/UemlInputStream.js +59 -0
- package/dist/scripts/src/parsers/ueml/UemlLexer.js +868 -0
- package/dist/scripts/src/parsers/ueml/UemlParser.js +1439 -0
- package/dist/scripts/src/parsers/ueml/UemlToken.js +24 -0
- package/dist/scripts/src/parsers/ueml/fileExtensions.js +6 -0
- package/dist/scripts/src/parsers/ueml/source-tree.js +2 -0
- package/dist/scripts/src/parsers/ueml/ueml-tree.js +2 -0
- package/dist/scripts/src/parsers/xmlui-parser/CharacterCodes.js +136 -0
- package/dist/scripts/src/parsers/xmlui-parser/diagnostics.js +100 -0
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +476 -0
- package/dist/scripts/src/parsers/xmlui-parser/scanner.js +415 -0
- package/dist/scripts/src/parsers/xmlui-parser/syntax-kind.js +106 -0
- package/dist/scripts/src/parsers/xmlui-parser/syntax-node.js +2 -0
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +922 -0
- package/dist/scripts/src/parsers/xmlui-parser/utils.js +83 -0
- package/dist/xmlui.es.d.ts +1667 -0
- package/dist/xmlui.es.js +17 -0
- package/dist/xmlui.umd.js +1589 -0
- package/package.json +175 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const UnknownComponent_module_scss_1 = __importDefault(require("./UnknownComponent.module.scss"));
|
|
8
|
+
/**
|
|
9
|
+
* This React component renders an error message telling that a particular component type is not registered.
|
|
10
|
+
* @param message Message to display
|
|
11
|
+
*/
|
|
12
|
+
function UnknownComponent({ message }) {
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: UnknownComponent_module_scss_1.default.errorOverlay, children: (0, jsx_runtime_1.jsxs)("span", { className: UnknownComponent_module_scss_1.default.title, children: ["Unknown component: ", message] }) }));
|
|
14
|
+
}
|
|
15
|
+
exports.default = UnknownComponent;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContainerActionKind = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* This enumeration defines the available actions on a view container. We use these actions in the redux-style state
|
|
6
|
+
* management of the component rendering engine.
|
|
7
|
+
*/
|
|
8
|
+
var ContainerActionKind;
|
|
9
|
+
(function (ContainerActionKind) {
|
|
10
|
+
ContainerActionKind["LOADER_LOADED"] = "ContainerActionKind:LOADER_LOADED";
|
|
11
|
+
ContainerActionKind["LOADER_IN_PROGRESS_CHANGED"] = "ContainerActionKind:LOADER_IN_PROGRESS_CHANGED";
|
|
12
|
+
ContainerActionKind["LOADER_ERROR"] = "ContainerActionKind:LOADER_ERROR";
|
|
13
|
+
ContainerActionKind["EVENT_HANDLER_STARTED"] = "ContainerActionKind:EVENT_HANDLER_STARTED";
|
|
14
|
+
ContainerActionKind["EVENT_HANDLER_COMPLETED"] = "ContainerActionKind:EVENT_HANDLER_COMPLETED";
|
|
15
|
+
ContainerActionKind["EVENT_HANDLER_ERROR"] = "ContainerActionKind:EVENT_HANDLER_ERROR";
|
|
16
|
+
ContainerActionKind["COMPONENT_STATE_CHANGED"] = "ContainerActionKind:COMPONENT_STATE_CHANGED";
|
|
17
|
+
ContainerActionKind["STATE_PART_CHANGED"] = "ContainerActionKind:STATE_PART_CHANGED";
|
|
18
|
+
})(ContainerActionKind || (exports.ContainerActionKind = ContainerActionKind = {}));
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.apiAction = void 0;
|
|
16
|
+
const react_hot_toast_1 = __importDefault(require("react-hot-toast"));
|
|
17
|
+
const RestApiProxy_1 = __importDefault(require("@components-core/RestApiProxy"));
|
|
18
|
+
const actionUtils_1 = require("@components-core/utils/actionUtils");
|
|
19
|
+
const extractParam_1 = require("@components-core/utils/extractParam");
|
|
20
|
+
const immer_1 = require("immer");
|
|
21
|
+
const misc_1 = require("@components-core/utils/misc");
|
|
22
|
+
const actions_1 = require("./actions");
|
|
23
|
+
function findQueryKeysToUpdate(updates, queryClient) {
|
|
24
|
+
const queryKeysToUpdate = [];
|
|
25
|
+
if (updates) {
|
|
26
|
+
let updatesArray;
|
|
27
|
+
if (Array.isArray(updates)) {
|
|
28
|
+
updatesArray = updates;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
updatesArray = [updates];
|
|
32
|
+
}
|
|
33
|
+
updatesArray.forEach((queryUrl) => {
|
|
34
|
+
queryClient
|
|
35
|
+
.getQueryCache()
|
|
36
|
+
.getAll()
|
|
37
|
+
.forEach((query) => {
|
|
38
|
+
if (query.queryKey[0] === queryUrl) {
|
|
39
|
+
queryKeysToUpdate.push(query.queryKey);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return queryKeysToUpdate;
|
|
45
|
+
}
|
|
46
|
+
function prepareOptimisticValue(value, clientTxId) {
|
|
47
|
+
return Object.assign(Object.assign({}, value), { id: value.id || clientTxId, _optimisticValue: true, _initiatorClientTxId: clientTxId });
|
|
48
|
+
}
|
|
49
|
+
function prepareOptimisticValuesForQueries(queryKeys, queryClient, clientTxId, stateContext, resolvedOptimisticValue, optimisticValueGetter) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
const ret = new Map();
|
|
52
|
+
yield Promise.all(queryKeys.map((queryKey) => __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
if (resolvedOptimisticValue) {
|
|
54
|
+
ret.set(queryKey, prepareOptimisticValue(resolvedOptimisticValue, clientTxId));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (!optimisticValueGetter) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const currentData = queryClient.getQueryData(queryKey);
|
|
61
|
+
const flatData = (currentData === null || currentData === void 0 ? void 0 : currentData.pages) ? currentData.pages.flatMap((page) => page.result) : currentData;
|
|
62
|
+
const optimisticValue = yield optimisticValueGetter(flatData, stateContext["$eventArgs"]);
|
|
63
|
+
if (optimisticValue) {
|
|
64
|
+
ret.set(queryKey, prepareOptimisticValue(optimisticValue, clientTxId));
|
|
65
|
+
}
|
|
66
|
+
})));
|
|
67
|
+
return ret;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function doOptimisticUpdate(optimisticValuesByQueryKeys, queryClient) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
if (!optimisticValuesByQueryKeys.size) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
for (const entry of optimisticValuesByQueryKeys.entries()) {
|
|
76
|
+
const [key, optimisticValue] = entry;
|
|
77
|
+
yield queryClient.cancelQueries({ queryKey: key });
|
|
78
|
+
const oldData = queryClient.getQueryData(key);
|
|
79
|
+
const draft = (0, immer_1.createDraft)(oldData);
|
|
80
|
+
if (draft.pages) {
|
|
81
|
+
let updated = false;
|
|
82
|
+
draft.pages.forEach((page) => {
|
|
83
|
+
var _a;
|
|
84
|
+
(_a = page.result) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
|
|
85
|
+
if (item.id === optimisticValue.id) {
|
|
86
|
+
Object.assign(item, optimisticValue);
|
|
87
|
+
updated = true;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
if (!updated) {
|
|
92
|
+
draft.pages[draft.pages.length - 1].result.push(optimisticValue);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
let updated = false;
|
|
97
|
+
draft.forEach((item) => {
|
|
98
|
+
if (item.id === optimisticValue.id) {
|
|
99
|
+
Object.assign(item, optimisticValue);
|
|
100
|
+
updated = true;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
if (!updated) {
|
|
104
|
+
draft.push(optimisticValue);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const newData = (0, immer_1.finishDraft)(draft);
|
|
108
|
+
queryClient.setQueryData(key, newData);
|
|
109
|
+
// console.log("optimistic added", { finalOptimisticValue, newData });
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function updateQueriesWithResult(queryKeysToUpdate, optimisticValuesByQueryKeys, clientTxId, queryClient, result) {
|
|
114
|
+
if (!queryKeysToUpdate.length) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
queryKeysToUpdate.forEach((key) => {
|
|
118
|
+
const oldData = queryClient.getQueryData(key);
|
|
119
|
+
const draft = (0, immer_1.createDraft)(oldData);
|
|
120
|
+
const optimisticValue = optimisticValuesByQueryKeys.get(key);
|
|
121
|
+
if (draft.pages) {
|
|
122
|
+
//pageable loader
|
|
123
|
+
if (optimisticValue) {
|
|
124
|
+
draft.pages[draft.pages.length - 1].result = draft.pages[draft.pages.length - 1].result.map((item) => item.id === optimisticValue.id && item._initiatorClientTxId === clientTxId ? result : item);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
let updated = false;
|
|
128
|
+
draft.pages.forEach((page) => {
|
|
129
|
+
var _a;
|
|
130
|
+
(_a = page.result) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
|
|
131
|
+
if (item.id === result.id) {
|
|
132
|
+
Object.assign(item, result);
|
|
133
|
+
updated = true;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
if (!updated) {
|
|
138
|
+
draft.pages[draft.pages.length - 1].result.push(result);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
if (optimisticValue) {
|
|
144
|
+
draft.forEach((item, index) => {
|
|
145
|
+
if (item.id === optimisticValue.id && item._initiatorClientTxId === clientTxId) {
|
|
146
|
+
draft[index] = result;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
let updated = false;
|
|
152
|
+
draft.forEach((item, index) => {
|
|
153
|
+
if (item.id === result.id) {
|
|
154
|
+
draft[index] = result;
|
|
155
|
+
updated = true;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
if (!updated) {
|
|
159
|
+
draft.push(result);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const newData = (0, immer_1.finishDraft)(draft);
|
|
164
|
+
queryClient.setQueryData(key, newData);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function updateQueriesWithOptimisticValue(_a) {
|
|
168
|
+
return __awaiter(this, arguments, void 0, function* ({ stateContext, updates, appContext, queryClient, clientTxId, optimisticValue, lookupAction, getOptimisticValue, uid, }) {
|
|
169
|
+
const queryKeysToUpdate = findQueryKeysToUpdate((0, extractParam_1.extractParam)(stateContext, updates, appContext), queryClient);
|
|
170
|
+
const optimisticValuesByQueryKeys = yield prepareOptimisticValuesForQueries(queryKeysToUpdate, queryClient, clientTxId, stateContext, (0, extractParam_1.extractParam)(stateContext, optimisticValue, appContext), lookupAction(getOptimisticValue, uid));
|
|
171
|
+
yield doOptimisticUpdate(optimisticValuesByQueryKeys, queryClient);
|
|
172
|
+
return { queryKeysToUpdate, optimisticValuesByQueryKeys };
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function callApi(_a, _b) {
|
|
176
|
+
return __awaiter(this, arguments, void 0, function* ({ state, appContext, lookupAction, uid: containerUid }, { confirmTitle, confirmMessage, confirmButtonLabel, params = {}, beforeRequest, onSuccess, onError, invalidates, updates, optimisticValue, payloadType, when, getOptimisticValue, inProgressNotificationMessage, completedNotificationMessage, errorNotificationMessage, uid: actionUid, onProgress,
|
|
177
|
+
//operation
|
|
178
|
+
headers, url, queryParams, rawBody, method, body, }, { resolveBindingExpressions } = {}) {
|
|
179
|
+
const uid = Symbol(actionUid);
|
|
180
|
+
const stateContext = Object.assign(Object.assign({}, params), state);
|
|
181
|
+
if (!(0, extractParam_1.shouldKeep)(when, stateContext, appContext)) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (confirmTitle || confirmMessage || confirmButtonLabel) {
|
|
185
|
+
const title = (0, extractParam_1.extractParam)(stateContext, confirmTitle, appContext);
|
|
186
|
+
const message = (0, extractParam_1.extractParam)(stateContext, confirmMessage, appContext);
|
|
187
|
+
const buttonLabel = (0, extractParam_1.extractParam)(stateContext, confirmButtonLabel, appContext);
|
|
188
|
+
const dialogCheck = yield appContext.confirm(title !== null && title !== void 0 ? title : "Confirm Operation", message !== null && message !== void 0 ? message : "Are you sure you want to perform this operation?", buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : "Yes");
|
|
189
|
+
if (!dialogCheck)
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const resolvedInvalidates = (0, extractParam_1.extractParam)(stateContext, invalidates, appContext);
|
|
193
|
+
const clientTxId = (0, misc_1.randomUUID)();
|
|
194
|
+
const beforeRequestFn = lookupAction(beforeRequest, uid);
|
|
195
|
+
yield (beforeRequestFn === null || beforeRequestFn === void 0 ? void 0 : beforeRequestFn());
|
|
196
|
+
const { queryKeysToUpdate, optimisticValuesByQueryKeys } = yield updateQueriesWithOptimisticValue({
|
|
197
|
+
stateContext,
|
|
198
|
+
updates,
|
|
199
|
+
appContext,
|
|
200
|
+
queryClient: appContext.queryClient,
|
|
201
|
+
clientTxId,
|
|
202
|
+
optimisticValue,
|
|
203
|
+
lookupAction,
|
|
204
|
+
getOptimisticValue,
|
|
205
|
+
uid,
|
|
206
|
+
});
|
|
207
|
+
const inProgressMessage = (0, extractParam_1.extractParam)(stateContext, inProgressNotificationMessage, appContext);
|
|
208
|
+
let loadingToastId;
|
|
209
|
+
if (inProgressMessage) {
|
|
210
|
+
loadingToastId = react_hot_toast_1.default.loading(inProgressMessage);
|
|
211
|
+
}
|
|
212
|
+
try {
|
|
213
|
+
const operation = {
|
|
214
|
+
headers,
|
|
215
|
+
url,
|
|
216
|
+
queryParams,
|
|
217
|
+
rawBody,
|
|
218
|
+
method,
|
|
219
|
+
body,
|
|
220
|
+
payloadType
|
|
221
|
+
};
|
|
222
|
+
const _onProgress = lookupAction(onProgress, uid, {
|
|
223
|
+
eventName: "progress"
|
|
224
|
+
});
|
|
225
|
+
const result = yield new RestApiProxy_1.default(appContext).execute({
|
|
226
|
+
operation,
|
|
227
|
+
params: stateContext,
|
|
228
|
+
transactionId: clientTxId,
|
|
229
|
+
resolveBindingExpressions,
|
|
230
|
+
onProgress: _onProgress
|
|
231
|
+
});
|
|
232
|
+
const onSuccessFn = lookupAction(onSuccess, uid, {
|
|
233
|
+
eventName: "success",
|
|
234
|
+
});
|
|
235
|
+
yield (onSuccessFn === null || onSuccessFn === void 0 ? void 0 : onSuccessFn(result, stateContext["$eventArgs"]));
|
|
236
|
+
updateQueriesWithResult(queryKeysToUpdate, optimisticValuesByQueryKeys, clientTxId, appContext.queryClient, result);
|
|
237
|
+
if (resolvedInvalidates || !updates) {
|
|
238
|
+
yield (0, actionUtils_1.invalidateQueries)(resolvedInvalidates, appContext, state);
|
|
239
|
+
}
|
|
240
|
+
const completedMessage = (0, extractParam_1.extractParam)(Object.assign(Object.assign({}, stateContext), { $result: result }), completedNotificationMessage, appContext);
|
|
241
|
+
if (completedMessage) {
|
|
242
|
+
react_hot_toast_1.default.success(completedMessage, {
|
|
243
|
+
id: loadingToastId,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
else if (loadingToastId) {
|
|
247
|
+
react_hot_toast_1.default.dismiss(loadingToastId);
|
|
248
|
+
}
|
|
249
|
+
return result;
|
|
250
|
+
}
|
|
251
|
+
catch (e) {
|
|
252
|
+
if (optimisticValuesByQueryKeys.size) {
|
|
253
|
+
yield appContext.queryClient.invalidateQueries();
|
|
254
|
+
}
|
|
255
|
+
const onErrorFn = lookupAction(onError, uid, {
|
|
256
|
+
eventName: "error"
|
|
257
|
+
});
|
|
258
|
+
const result = yield (onErrorFn === null || onErrorFn === void 0 ? void 0 : onErrorFn(e, stateContext["$eventArgs"]));
|
|
259
|
+
const errorMessage = (0, extractParam_1.extractParam)(Object.assign(Object.assign({}, stateContext), { $error: e }), errorNotificationMessage, appContext);
|
|
260
|
+
if (errorMessage) {
|
|
261
|
+
react_hot_toast_1.default.error(errorMessage, {
|
|
262
|
+
id: loadingToastId
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
if (loadingToastId) {
|
|
267
|
+
react_hot_toast_1.default.dismiss(loadingToastId);
|
|
268
|
+
}
|
|
269
|
+
if (result !== false) { //stop the error propagation, if the error handler returns false
|
|
270
|
+
throw e;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
exports.apiAction = (0, actions_1.createAction)("callApi", callApi);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.downloadAction = void 0;
|
|
16
|
+
const actions_1 = require("./actions");
|
|
17
|
+
const RestApiProxy_1 = __importDefault(require("@components-core/RestApiProxy"));
|
|
18
|
+
function download(_a, _b) {
|
|
19
|
+
return __awaiter(this, arguments, void 0, function* ({ state, appContext }, { params, url, queryParams, method, rawBody, body, fileName, headers, }, { resolveBindingExpressions } = {}) {
|
|
20
|
+
var _c;
|
|
21
|
+
const context = Object.assign(Object.assign({}, params), state);
|
|
22
|
+
const operation = {
|
|
23
|
+
url,
|
|
24
|
+
queryParams,
|
|
25
|
+
method,
|
|
26
|
+
rawBody,
|
|
27
|
+
body,
|
|
28
|
+
fileName,
|
|
29
|
+
headers,
|
|
30
|
+
};
|
|
31
|
+
const api = new RestApiProxy_1.default(appContext);
|
|
32
|
+
const _url = api.resolveUrl({ operation, params: context, resolveBindingExpressions });
|
|
33
|
+
if ((operation.method && operation.method.toLowerCase() !== "get") ||
|
|
34
|
+
Object.keys(((_c = appContext.globals) === null || _c === void 0 ? void 0 : _c.headers) || {}).length !== 0 || //if we have any headers for the api, we can't use the iframe trick
|
|
35
|
+
appContext.apiInterceptorContext.isMocked(_url) //if we mock this url, the mock can't work in an iframe, so we must fall back to download it with the restApiProxy
|
|
36
|
+
) {
|
|
37
|
+
const file = yield api.execute({
|
|
38
|
+
operation,
|
|
39
|
+
params: context,
|
|
40
|
+
parseOptions: {
|
|
41
|
+
asFile: true,
|
|
42
|
+
},
|
|
43
|
+
resolveBindingExpressions,
|
|
44
|
+
});
|
|
45
|
+
downloadWithAnchor(file);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
downloadInIframe(_url);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//we use a hidden iframe trick here,
|
|
53
|
+
// we set the iframe source as the download url, this way the browser will ask to download the file, and show a progress bar
|
|
54
|
+
// (we could use an anchor tag with a download attribute, but in this case we can't show progress )
|
|
55
|
+
// we can use it if we don't have to add extra headers to the request in order to download a file (pre-signed urls, or public urls)
|
|
56
|
+
function downloadInIframe(fileUrl) {
|
|
57
|
+
const iframe = document.createElement("iframe");
|
|
58
|
+
iframe.style.display = "none";
|
|
59
|
+
iframe.hidden = true;
|
|
60
|
+
iframe.name = fileUrl;
|
|
61
|
+
iframe.id = `download-iframe_${fileUrl}`;
|
|
62
|
+
iframe.src = fileUrl;
|
|
63
|
+
document.body.appendChild(iframe);
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
iframe.remove();
|
|
66
|
+
}, 20000);
|
|
67
|
+
}
|
|
68
|
+
// we can use it if we do have to add extra headers to the request in order to download a file (urls require authentication)
|
|
69
|
+
function downloadWithAnchor(file) {
|
|
70
|
+
const url = window.URL.createObjectURL(file);
|
|
71
|
+
const a = document.createElement("a");
|
|
72
|
+
a.style.display = "none";
|
|
73
|
+
a.href = url;
|
|
74
|
+
// the filename you want
|
|
75
|
+
a.download = file.name;
|
|
76
|
+
document.body.appendChild(a);
|
|
77
|
+
a.click();
|
|
78
|
+
window.URL.revokeObjectURL(url);
|
|
79
|
+
}
|
|
80
|
+
exports.downloadAction = (0, actions_1.createAction)("download", download);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.navigateAction = void 0;
|
|
4
|
+
const actions_1 = require("./actions");
|
|
5
|
+
const component_utils_1 = require("@components/component-utils");
|
|
6
|
+
function navigate({ appContext, navigate, location }, pathname, queryParams) {
|
|
7
|
+
// https://stackoverflow.com/questions/37385570/how-to-know-if-react-router-can-go-back-to-display-back-button-in-react-app
|
|
8
|
+
if (pathname === -1 && location.key === "default") {
|
|
9
|
+
navigate(".");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const to = queryParams
|
|
13
|
+
? (0, component_utils_1.createUrlWithQueryParams)({
|
|
14
|
+
pathname,
|
|
15
|
+
queryParams,
|
|
16
|
+
})
|
|
17
|
+
: pathname;
|
|
18
|
+
navigate(to);
|
|
19
|
+
}
|
|
20
|
+
exports.navigateAction = (0, actions_1.createAction)("navigate", navigate);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.timedAction = void 0;
|
|
13
|
+
const misc_1 = require("@components-core/utils/misc");
|
|
14
|
+
const actions_1 = require("./actions");
|
|
15
|
+
function delay(executionContext, timeoutInMs, callback) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
yield (0, misc_1.delay)(timeoutInMs);
|
|
18
|
+
yield (callback === null || callback === void 0 ? void 0 : callback());
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
exports.timedAction = (0, actions_1.createAction)("delay", delay);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.uploadAction = void 0;
|
|
16
|
+
const actions_1 = require("./actions");
|
|
17
|
+
const RestApiProxy_1 = __importDefault(require("@components-core/RestApiProxy"));
|
|
18
|
+
const extractParam_1 = require("@components-core/utils/extractParam");
|
|
19
|
+
const actionUtils_1 = require("@components-core/utils/actionUtils");
|
|
20
|
+
function uploadFile(_a, _b) {
|
|
21
|
+
return __awaiter(this, arguments, void 0, function* ({ appContext, state, lookupAction, uid }, { params, invalidates, onError, queryParams, asForm, file, headers, url, method, formParams, rawBody, body, chunkSizeInBytes, onProgress }, { resolveBindingExpressions } = {}) {
|
|
22
|
+
const stateContext = Object.assign(Object.assign({}, params), state);
|
|
23
|
+
const api = new RestApiProxy_1.default(appContext);
|
|
24
|
+
const operation = {
|
|
25
|
+
file,
|
|
26
|
+
body,
|
|
27
|
+
asForm,
|
|
28
|
+
formParams,
|
|
29
|
+
rawBody,
|
|
30
|
+
method,
|
|
31
|
+
url,
|
|
32
|
+
queryParams,
|
|
33
|
+
headers
|
|
34
|
+
};
|
|
35
|
+
let result = null;
|
|
36
|
+
try {
|
|
37
|
+
const _chunkSizeInBytes = (0, extractParam_1.extractParam)(stateContext, chunkSizeInBytes, appContext);
|
|
38
|
+
const _onProgress = (0, extractParam_1.extractParam)(stateContext, onProgress, appContext);
|
|
39
|
+
if (_chunkSizeInBytes !== undefined) {
|
|
40
|
+
const _file = (0, extractParam_1.extractParam)(stateContext, file, appContext);
|
|
41
|
+
const numberOfChunks = Math.ceil(_file.size / _chunkSizeInBytes);
|
|
42
|
+
for (let i = 0; i < numberOfChunks; i++) {
|
|
43
|
+
const start = i * _chunkSizeInBytes;
|
|
44
|
+
const chunkEnd = Math.min(start + _chunkSizeInBytes, _file.size);
|
|
45
|
+
const chunk = _file.slice(start, chunkEnd);
|
|
46
|
+
result = yield api.upload({
|
|
47
|
+
operation,
|
|
48
|
+
chunk: {
|
|
49
|
+
blob: chunk,
|
|
50
|
+
chunkStart: start,
|
|
51
|
+
chunkEnd: chunkEnd,
|
|
52
|
+
},
|
|
53
|
+
params: stateContext,
|
|
54
|
+
onUploadProgress: (progressEvent) => {
|
|
55
|
+
const overallTotal = _file.size;
|
|
56
|
+
const overallLoaded = start + progressEvent.loaded;
|
|
57
|
+
const overallProgressEvent = {
|
|
58
|
+
total: overallTotal,
|
|
59
|
+
loaded: overallLoaded,
|
|
60
|
+
progress: overallLoaded / overallTotal,
|
|
61
|
+
};
|
|
62
|
+
_onProgress === null || _onProgress === void 0 ? void 0 : _onProgress(overallProgressEvent);
|
|
63
|
+
},
|
|
64
|
+
resolveBindingExpressions
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
result = yield api.upload({
|
|
70
|
+
operation,
|
|
71
|
+
params: stateContext,
|
|
72
|
+
onUploadProgress: _onProgress,
|
|
73
|
+
resolveBindingExpressions
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
const onErrorFn = lookupAction(onError, uid);
|
|
79
|
+
const result = yield (onErrorFn === null || onErrorFn === void 0 ? void 0 : onErrorFn(e, stateContext["$eventArgs"]));
|
|
80
|
+
if (result !== false) {
|
|
81
|
+
throw e;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
(0, actionUtils_1.invalidateQueries)(invalidates, appContext, state);
|
|
85
|
+
return result;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
exports.uploadAction = (0, actions_1.createAction)("upload", uploadFile);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAction = createAction;
|
|
4
|
+
/**
|
|
5
|
+
* Creates an action renderer definition object that can be registered in the action registry.
|
|
6
|
+
* @param actionName The name of the action
|
|
7
|
+
* @param actionFn The function that executes the action
|
|
8
|
+
* @returns An action renderer definition object
|
|
9
|
+
*/
|
|
10
|
+
function createAction(actionName, actionFn) {
|
|
11
|
+
return {
|
|
12
|
+
actionName,
|
|
13
|
+
actionFn,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateFunctions = void 0;
|
|
4
|
+
const date_utils_1 = require("../utils/date-utils");
|
|
5
|
+
exports.dateFunctions = {
|
|
6
|
+
isoDateString: date_utils_1.isoDateString,
|
|
7
|
+
formatDate: date_utils_1.formatDate,
|
|
8
|
+
formatDateTime: date_utils_1.formatDateTime,
|
|
9
|
+
formatTime: date_utils_1.formatTime,
|
|
10
|
+
formatTimeWithoutSeconds: date_utils_1.formatTimeWithoutSeconds,
|
|
11
|
+
formatDateWithoutYear: date_utils_1.formatDateWithoutYear,
|
|
12
|
+
getDate: date_utils_1.getDate,
|
|
13
|
+
getDateUntilNow: date_utils_1.getDateUntilNow,
|
|
14
|
+
smartFormatDateTime: date_utils_1.smartFormatDateTime,
|
|
15
|
+
smartFormatDate: date_utils_1.smartFormatDate,
|
|
16
|
+
isToday: date_utils_1.isDateToday,
|
|
17
|
+
isYesterday: date_utils_1.isDateYesterday,
|
|
18
|
+
isTomorrow: date_utils_1.isDateTomorrow
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.miscellaneousUtils = void 0;
|
|
4
|
+
const lodash_es_1 = require("lodash-es");
|
|
5
|
+
const misc_1 = require("@components-core/utils/misc");
|
|
6
|
+
exports.miscellaneousUtils = {
|
|
7
|
+
formatFileSizeInBytes: misc_1.formatFileSizeInBytes,
|
|
8
|
+
getFileExtension: misc_1.getFileExtension,
|
|
9
|
+
capitalize: lodash_es_1.capitalize,
|
|
10
|
+
pluralize: misc_1.pluralize,
|
|
11
|
+
defaultTo: lodash_es_1.defaultTo
|
|
12
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useContentAlignment = useContentAlignment;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const Stack_module_scss_1 = __importDefault(require("@components/Stack/Stack.module.scss"));
|
|
9
|
+
const misc_1 = require("@components-core/utils/misc");
|
|
10
|
+
// This react hooks prepares CSS style values according to the CSS flex semantics to combine orientation,
|
|
11
|
+
// horizontal, and vertical alignments.
|
|
12
|
+
function useContentAlignment(orientation, horizontal, vertical) {
|
|
13
|
+
return (0, react_1.useMemo)(() => {
|
|
14
|
+
// --- Use CSS flex semantics to combine the orientation with alignment to prepare the CSS properties
|
|
15
|
+
return orientation === "horizontal"
|
|
16
|
+
? {
|
|
17
|
+
horizontal: horizontal && Stack_module_scss_1.default[`justifyItems${(0, misc_1.capitalizeFirstLetter)(horizontal)}`],
|
|
18
|
+
vertical: vertical && Stack_module_scss_1.default[`alignItems${(0, misc_1.capitalizeFirstLetter)(vertical)}`],
|
|
19
|
+
}
|
|
20
|
+
: {
|
|
21
|
+
horizontal: horizontal && Stack_module_scss_1.default[`alignItems${(0, misc_1.capitalizeFirstLetter)(horizontal)}`],
|
|
22
|
+
vertical: vertical && Stack_module_scss_1.default[`justifyItems${(0, misc_1.capitalizeFirstLetter)(vertical)}`],
|
|
23
|
+
};
|
|
24
|
+
}, [orientation, horizontal, vertical]);
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.asyncNoop = exports.noop = exports.EMPTY_OBJECT = exports.EMPTY_ARRAY = void 0;
|
|
13
|
+
exports.EMPTY_ARRAY = Object.freeze([]);
|
|
14
|
+
exports.EMPTY_OBJECT = Object.freeze({});
|
|
15
|
+
const noop = (...args) => ({});
|
|
16
|
+
exports.noop = noop;
|
|
17
|
+
const asyncNoop = (...args) => __awaiter(void 0, void 0, void 0, function* () { });
|
|
18
|
+
exports.asyncNoop = asyncNoop;
|