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,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.appStateComponentRenderer = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const renderers_1 = require("@components-core/renderers");
|
|
6
|
+
const hooks_1 = require("@components-core/utils/hooks");
|
|
7
|
+
const AppStateContext_1 = require("@components/App/AppStateContext");
|
|
8
|
+
function AppState({ bucket = "default", updateState, initialValue, registerComponentApi, }) {
|
|
9
|
+
const registerAppState = (0, AppStateContext_1.useAppStateContextPart)((value) => value.registerAppState);
|
|
10
|
+
const update = (0, AppStateContext_1.useAppStateContextPart)((value) => value.update);
|
|
11
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
12
|
+
if (initialValue !== undefined) {
|
|
13
|
+
registerAppState(bucket, initialValue);
|
|
14
|
+
}
|
|
15
|
+
}, [bucket, initialValue, registerAppState]);
|
|
16
|
+
const value = (0, AppStateContext_1.useAppStateContextPart)((value) => value.appState[bucket]);
|
|
17
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
18
|
+
updateState({ value });
|
|
19
|
+
}, [updateState, value]);
|
|
20
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
21
|
+
registerComponentApi({
|
|
22
|
+
update: (patch) => update(bucket, patch),
|
|
23
|
+
});
|
|
24
|
+
}, [bucket, registerComponentApi, update]);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
exports.appStateComponentRenderer = (0, renderers_1.createComponentRenderer)("AppState", ({ node, extractValue, updateState, registerComponentApi }) => {
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(AppState, { bucket: extractValue(node.props.bucket), initialValue: extractValue(node.props.initialValue), updateState: updateState, registerComponentApi: registerComponentApi }));
|
|
29
|
+
}, {});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.avatarComponentRenderer = exports.Avatar = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
20
|
+
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
21
|
+
const Avatar_module_scss_1 = __importDefault(require("./Avatar.module.scss"));
|
|
22
|
+
const renderers_1 = require("@components-core/renderers");
|
|
23
|
+
const descriptorHelper_1 = require("@components-core/descriptorHelper");
|
|
24
|
+
const themeVars_1 = require("@components-core/theming/themeVars");
|
|
25
|
+
exports.Avatar = (0, react_1.forwardRef)(function Avatar(_a, ref) {
|
|
26
|
+
var { size = "sm", url, name, style, onClick } = _a, rest = __rest(_a, ["size", "url", "name", "style", "onClick"]);
|
|
27
|
+
let abbrev = null;
|
|
28
|
+
if (!url && !!name) {
|
|
29
|
+
abbrev = name
|
|
30
|
+
.trim()
|
|
31
|
+
.split(" ")
|
|
32
|
+
.filter((word) => !!word.trim().length)
|
|
33
|
+
.map((word) => word[0].toUpperCase())
|
|
34
|
+
.slice(0, 3);
|
|
35
|
+
}
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, rest, { ref: ref, className: (0, classnames_1.default)(Avatar_module_scss_1.default.container, {
|
|
37
|
+
[Avatar_module_scss_1.default.xs]: size === "xs",
|
|
38
|
+
[Avatar_module_scss_1.default.sm]: size === "sm",
|
|
39
|
+
[Avatar_module_scss_1.default.md]: size === "md",
|
|
40
|
+
[Avatar_module_scss_1.default.lg]: size === "lg",
|
|
41
|
+
[Avatar_module_scss_1.default.clickable]: !!onClick,
|
|
42
|
+
}), style: Object.assign({ backgroundImage: url ? `url(${url})` : "none" }, style), onClick: onClick, children: abbrev })));
|
|
43
|
+
});
|
|
44
|
+
const AvatarSizeKeys = ["xs", "sm", "md", "lg"];
|
|
45
|
+
const metadata = {
|
|
46
|
+
displayName: "Avatar",
|
|
47
|
+
description: "Display an avatar associated with an entity",
|
|
48
|
+
props: {
|
|
49
|
+
size: (0, descriptorHelper_1.desc)("Size of the avatar (xs, sm, md, or lg)"),
|
|
50
|
+
name: (0, descriptorHelper_1.desc)("Name to extract the first letters of words as avatar text"),
|
|
51
|
+
url: (0, descriptorHelper_1.desc)("Url of the avatar image"),
|
|
52
|
+
},
|
|
53
|
+
events: {
|
|
54
|
+
click: (0, descriptorHelper_1.desc)("Triggers when the avatar is clicked"),
|
|
55
|
+
},
|
|
56
|
+
themeVars: (0, themeVars_1.parseScssVar)(Avatar_module_scss_1.default.themeVars),
|
|
57
|
+
defaultThemeVars: {
|
|
58
|
+
"radius-Avatar": "50%",
|
|
59
|
+
"thickness-border-Avatar": "1px",
|
|
60
|
+
"style-border-Avatar": "solid",
|
|
61
|
+
"border-Avatar": "$thickness-border-Avatar $style-border-Avatar $color-border-Avatar",
|
|
62
|
+
"shadow-Avatar": "$shadow",
|
|
63
|
+
"color-text-Avatar": "$color-text-secondary",
|
|
64
|
+
"font-weight-Avatar": "$font-weight-bold",
|
|
65
|
+
light: {
|
|
66
|
+
"color-bg-Avatar": "$color-surface-100",
|
|
67
|
+
"color-border-Avatar": "$color-surface-400A80",
|
|
68
|
+
},
|
|
69
|
+
dark: {
|
|
70
|
+
"color-bg-Avatar": "$color-surface-800",
|
|
71
|
+
"color-border-Avatar": "$color-surface-700",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* This function defines the renderer for the Avatar component.
|
|
77
|
+
*/
|
|
78
|
+
exports.avatarComponentRenderer = (0, renderers_1.createComponentRenderer)("Avatar", ({ node, extractValue, lookupEventHandler, layoutCss, extractResourceUrl }) => {
|
|
79
|
+
var _a;
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)(exports.Avatar, { size: (_a = node.props) === null || _a === void 0 ? void 0 : _a.size, url: extractResourceUrl(node.props.url), name: extractValue(node.props.name), style: layoutCss }));
|
|
81
|
+
}, metadata);
|
|
@@ -0,0 +1,56 @@
|
|
|
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.badgeComponentRenderer = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
9
|
+
const Badge_module_scss_1 = __importDefault(require("./Badge.module.scss"));
|
|
10
|
+
const renderers_1 = require("@components-core/renderers");
|
|
11
|
+
const descriptorHelper_1 = require("@components-core/descriptorHelper");
|
|
12
|
+
const themeVars_1 = require("@components-core/theming/themeVars");
|
|
13
|
+
const Badge = ({ value, color, variant = "badge" }) => {
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)({ [Badge_module_scss_1.default.badge]: variant === "badge", [Badge_module_scss_1.default.pill]: variant === "pill" }), style: color
|
|
15
|
+
? typeof color === "string"
|
|
16
|
+
? { backgroundColor: color }
|
|
17
|
+
: { backgroundColor: color.background, color: color.label }
|
|
18
|
+
: undefined, children: value }));
|
|
19
|
+
};
|
|
20
|
+
const metadata = {
|
|
21
|
+
displayName: "Badge",
|
|
22
|
+
description: "A label that accepts a color map the defines its background (and optionally, its label) color",
|
|
23
|
+
props: {
|
|
24
|
+
value: (0, descriptorHelper_1.desc)("The label value"),
|
|
25
|
+
variant: (0, descriptorHelper_1.desc)("The style variant of the component"),
|
|
26
|
+
colorMap: (0, descriptorHelper_1.desc)("A key-value collection, where the value is either a color for the background" +
|
|
27
|
+
"or for both the background and the label as well. If provided and accessed, it takes " +
|
|
28
|
+
"precedence of both default values and theme overrides."),
|
|
29
|
+
},
|
|
30
|
+
themeVars: (0, themeVars_1.parseScssVar)(Badge_module_scss_1.default.themeVars),
|
|
31
|
+
defaultThemeVars: {
|
|
32
|
+
"padding-horizontal-Badge": "$space-2",
|
|
33
|
+
"padding-vertical-Badge": "$space-0_5",
|
|
34
|
+
"padding-Badge": "$padding-vertical-Badge $padding-horizontal-Badge",
|
|
35
|
+
"padding-Badge-pill": "$padding-vertical-Badge-pill $padding-horizontal-Badge-pill",
|
|
36
|
+
"radius-Badge": "4px",
|
|
37
|
+
"font-size-Badge": "$font-size-normal",
|
|
38
|
+
"font-size-Badge-pill": "$font-size-normal",
|
|
39
|
+
"font-weight-Badge": "$font-weight-bold",
|
|
40
|
+
"font-weight-Badge-pill": "$font-weight-normal",
|
|
41
|
+
light: {
|
|
42
|
+
"color-bg-Badge": "$color-primary-500",
|
|
43
|
+
"color-text-Badge": "$color-surface-50",
|
|
44
|
+
},
|
|
45
|
+
dark: {
|
|
46
|
+
"color-bg-Badge": "$color-primary-500",
|
|
47
|
+
"color-text-Badge": "$color-surface-50",
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
exports.badgeComponentRenderer = (0, renderers_1.createComponentRenderer)("Badge", ({ node, extractValue }) => {
|
|
52
|
+
var _a;
|
|
53
|
+
const value = extractValue(node.props.value);
|
|
54
|
+
const colorMap = extractValue((_a = node.props) === null || _a === void 0 ? void 0 : _a.colorMap);
|
|
55
|
+
return (0, jsx_runtime_1.jsx)(Badge, { variant: extractValue(node.props.variant), value: value, color: colorMap === null || colorMap === void 0 ? void 0 : colorMap[value] });
|
|
56
|
+
}, metadata);
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.barChartComponentRenderer = void 0;
|
|
30
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
+
const react_1 = __importStar(require("react"));
|
|
32
|
+
const PieChart_module_scss_1 = __importDefault(require("@components/PieChart/PieChart.module.scss"));
|
|
33
|
+
const descriptorHelper_1 = require("@components-core/descriptorHelper");
|
|
34
|
+
const themeVars_1 = require("@components-core/theming/themeVars");
|
|
35
|
+
const renderers_1 = require("@components-core/renderers");
|
|
36
|
+
const ThemeContext_1 = require("@components-core/theming/ThemeContext");
|
|
37
|
+
const chart_color_schemes_1 = __importDefault(require("@components/chart-color-schemes"));
|
|
38
|
+
const hooks_1 = require("@components-core/utils/hooks");
|
|
39
|
+
const ResponsiveBar = react_1.default.lazy(() => Promise.resolve().then(() => __importStar(require("@nivo/bar"))).then((module) => ({ default: module.ResponsiveBar })));
|
|
40
|
+
const BarChart = ({ data, keys = [], groupMode = "grouped", layout = "vertical", indexBy = "id", style, }) => {
|
|
41
|
+
console.log(keys, data);
|
|
42
|
+
const { getThemeVar } = (0, ThemeContext_1.useTheme)();
|
|
43
|
+
const colors = (0, hooks_1.useColors)({
|
|
44
|
+
name: "color-text-BarChart",
|
|
45
|
+
format: "hex",
|
|
46
|
+
}, {
|
|
47
|
+
name: "color-ticks-BarChart",
|
|
48
|
+
format: "hex",
|
|
49
|
+
}, {
|
|
50
|
+
name: "color-bg-tooltip-BarChart",
|
|
51
|
+
format: "hex",
|
|
52
|
+
}, {
|
|
53
|
+
name: "color-text-tooltip-BarChart",
|
|
54
|
+
format: "hex",
|
|
55
|
+
}, {
|
|
56
|
+
name: "color-axis-BarChart",
|
|
57
|
+
format: "hex",
|
|
58
|
+
});
|
|
59
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: style, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(ResponsiveBar, { data: data, keys: keys, layout: layout, groupMode: groupMode, theme: {
|
|
60
|
+
background: "transparent",
|
|
61
|
+
text: {
|
|
62
|
+
fontSize: 11,
|
|
63
|
+
fill: colors["color-text-BarChart"],
|
|
64
|
+
outlineWidth: 0,
|
|
65
|
+
outlineColor: "transparent",
|
|
66
|
+
},
|
|
67
|
+
axis: {
|
|
68
|
+
domain: {
|
|
69
|
+
line: {
|
|
70
|
+
stroke: colors["color-axis-BarChart"],
|
|
71
|
+
strokeWidth: 1,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
legend: {
|
|
75
|
+
text: {
|
|
76
|
+
fontSize: 12,
|
|
77
|
+
fill: colors["border-color-BarChart"],
|
|
78
|
+
outlineWidth: 0,
|
|
79
|
+
outlineColor: "transparent",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
ticks: {
|
|
83
|
+
line: {
|
|
84
|
+
stroke: "#777777",
|
|
85
|
+
strokeWidth: 1,
|
|
86
|
+
},
|
|
87
|
+
text: {
|
|
88
|
+
fontSize: 11,
|
|
89
|
+
fill: colors["color-ticks-BarChart"],
|
|
90
|
+
outlineWidth: 0,
|
|
91
|
+
outlineColor: "transparent",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
grid: {
|
|
96
|
+
line: {
|
|
97
|
+
stroke: "#dddddd",
|
|
98
|
+
strokeWidth: 1,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
legends: {
|
|
102
|
+
title: {
|
|
103
|
+
text: {
|
|
104
|
+
fontSize: 11,
|
|
105
|
+
fill: "#333333",
|
|
106
|
+
outlineWidth: 0,
|
|
107
|
+
outlineColor: "transparent",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
text: {
|
|
111
|
+
fontSize: 11,
|
|
112
|
+
fill: "#333333",
|
|
113
|
+
outlineWidth: 0,
|
|
114
|
+
outlineColor: "transparent",
|
|
115
|
+
},
|
|
116
|
+
ticks: {
|
|
117
|
+
line: {},
|
|
118
|
+
text: {
|
|
119
|
+
fontSize: 10,
|
|
120
|
+
fill: "#333333",
|
|
121
|
+
outlineWidth: 0,
|
|
122
|
+
outlineColor: "transparent",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
annotations: {
|
|
127
|
+
text: {
|
|
128
|
+
fontSize: 13,
|
|
129
|
+
fill: "#333333",
|
|
130
|
+
outlineWidth: 2,
|
|
131
|
+
outlineColor: "#ffffff",
|
|
132
|
+
outlineOpacity: 1,
|
|
133
|
+
},
|
|
134
|
+
link: {
|
|
135
|
+
stroke: "#000000",
|
|
136
|
+
strokeWidth: 1,
|
|
137
|
+
outlineWidth: 2,
|
|
138
|
+
outlineColor: "#ffffff",
|
|
139
|
+
outlineOpacity: 1,
|
|
140
|
+
},
|
|
141
|
+
outline: {
|
|
142
|
+
stroke: "#000000",
|
|
143
|
+
strokeWidth: 2,
|
|
144
|
+
outlineWidth: 2,
|
|
145
|
+
outlineColor: "#ffffff",
|
|
146
|
+
outlineOpacity: 1,
|
|
147
|
+
},
|
|
148
|
+
symbol: {
|
|
149
|
+
fill: "#000000",
|
|
150
|
+
outlineWidth: 2,
|
|
151
|
+
outlineColor: "#ffffff",
|
|
152
|
+
outlineOpacity: 1,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
tooltip: {
|
|
156
|
+
wrapper: {},
|
|
157
|
+
container: {
|
|
158
|
+
background: colors["color-bg-tooltip-BarChart"],
|
|
159
|
+
color: colors["color-text-tooltip-BarChart"],
|
|
160
|
+
fontSize: 12,
|
|
161
|
+
},
|
|
162
|
+
basic: {},
|
|
163
|
+
chip: {},
|
|
164
|
+
table: {},
|
|
165
|
+
tableCell: {},
|
|
166
|
+
tableCellValue: {},
|
|
167
|
+
},
|
|
168
|
+
}, borderWidth: 1, borderColor: { from: "color", modifiers: [["darker", 0.2]] }, indexBy: indexBy, margin: { top: 10, bottom: 40, left: 60 }, padding: 0.3, valueScale: { type: "linear" }, indexScale: { type: "band", round: true }, colors: { scheme: chart_color_schemes_1.default[getThemeVar("scheme-BarChart") || "nivo"] }, axisTop: null, axisRight: null, labelSkipWidth: 12, labelSkipHeight: 12, role: "application" }) }) }));
|
|
169
|
+
};
|
|
170
|
+
const metadata = {
|
|
171
|
+
displayName: "BarChart",
|
|
172
|
+
description: "A bar chart component",
|
|
173
|
+
props: {
|
|
174
|
+
data: (0, descriptorHelper_1.desc)("The data to be displayed in the bar chart"),
|
|
175
|
+
keys: (0, descriptorHelper_1.desc)("The keys to be used in the bar chart"),
|
|
176
|
+
groupMode: (0, descriptorHelper_1.desc)("The group mode of the bar chart"),
|
|
177
|
+
layout: (0, descriptorHelper_1.desc)("The layout of the bar chart"),
|
|
178
|
+
indexBy: (0, descriptorHelper_1.desc)("The index to be used in the bar chart"),
|
|
179
|
+
},
|
|
180
|
+
themeVars: (0, themeVars_1.parseScssVar)(PieChart_module_scss_1.default.themeVars),
|
|
181
|
+
defaultThemeVars: {
|
|
182
|
+
"scheme-BarChart": "pastel1",
|
|
183
|
+
"color-text-BarChart": "$color-text-secondary",
|
|
184
|
+
"color-ticks-BarChart": "$color-text-primary",
|
|
185
|
+
"color-bg-tooltip-BarChart": "$color-bg-primary",
|
|
186
|
+
"color-text-tooltip-BarChart": "$color-text-primary",
|
|
187
|
+
"color-axis-BarChart": "$color-text-primary",
|
|
188
|
+
light: {
|
|
189
|
+
"scheme-BarChart": "set3",
|
|
190
|
+
},
|
|
191
|
+
dark: {
|
|
192
|
+
"scheme-BarChart": "dark2",
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
exports.barChartComponentRenderer = (0, renderers_1.createComponentRenderer)("BarChart", ({ extractValue, node, layoutCss }) => {
|
|
197
|
+
var _a, _b, _c, _d, _e;
|
|
198
|
+
return ((0, jsx_runtime_1.jsx)(BarChart, { style: layoutCss, data: extractValue((_a = node.props) === null || _a === void 0 ? void 0 : _a.data), keys: extractValue((_b = node.props) === null || _b === void 0 ? void 0 : _b.keys), groupMode: extractValue((_c = node.props) === null || _c === void 0 ? void 0 : _c.groupMode), layout: extractValue((_d = node.props) === null || _d === void 0 ? void 0 : _d.layout), indexBy: extractValue((_e = node.props) === null || _e === void 0 ? void 0 : _e.indexBy) }));
|
|
199
|
+
}, metadata);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bookmarkComponentRenderer = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const renderers_1 = require("@components-core/renderers");
|
|
6
|
+
exports.bookmarkComponentRenderer = (0, renderers_1.createComponentRenderer)("Bookmark", (rendererContext) => {
|
|
7
|
+
const { node, renderChild, extractValue, layoutContext } = rendererContext;
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { id: extractValue(node.uid), style: { width: 0, height: 0 } }), renderChild(node.children, layoutContext)] }));
|
|
9
|
+
}, {
|
|
10
|
+
opaque: true,
|
|
11
|
+
});
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.buttonComponentRenderer = exports.buttonStylingProps = exports.Button = void 0;
|
|
41
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
|
+
const Button_module_scss_1 = __importDefault(require("./Button.module.scss"));
|
|
44
|
+
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
45
|
+
const Icon_1 = require("@components/Icon/Icon");
|
|
46
|
+
const renderers_1 = require("@components-core/renderers");
|
|
47
|
+
const themeVars_1 = require("@components-core/theming/themeVars");
|
|
48
|
+
const descriptorHelper_1 = require("@components-core/descriptorHelper");
|
|
49
|
+
exports.Button = react_1.default.forwardRef(function Button(_a, ref) {
|
|
50
|
+
var { id, type = "button", icon, iconPosition = "left", contentPosition = "center", orientation = "horizontal", variant = "solid", themeColor = "primary", size = "sm", disabled, children, formId, onClick, onFocus, onBlur, style, gap, className, autoFocus, title } = _a, rest = __rest(_a, ["id", "type", "icon", "iconPosition", "contentPosition", "orientation", "variant", "themeColor", "size", "disabled", "children", "formId", "onClick", "onFocus", "onBlur", "style", "gap", "className", "autoFocus", "title"]);
|
|
51
|
+
const innerRef = (0, react_1.useRef)(null);
|
|
52
|
+
(0, react_1.useImperativeHandle)(ref, () => innerRef.current);
|
|
53
|
+
(0, react_1.useEffect)(() => {
|
|
54
|
+
if (autoFocus) {
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
var _a;
|
|
57
|
+
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
58
|
+
}, 0);
|
|
59
|
+
}
|
|
60
|
+
}, [autoFocus]);
|
|
61
|
+
const iconToLeft = iconPosition === "left" || iconPosition === "start";
|
|
62
|
+
return ((0, jsx_runtime_1.jsxs)("button", Object.assign({}, rest, { id: id, type: type, title: title, ref: innerRef, className: (0, classnames_1.default)(className, Button_module_scss_1.default.button, {
|
|
63
|
+
[Button_module_scss_1.default.buttonHorizontal]: orientation === "horizontal",
|
|
64
|
+
[Button_module_scss_1.default.buttonVertical]: orientation === "vertical",
|
|
65
|
+
[Button_module_scss_1.default.xs]: size === "xs",
|
|
66
|
+
[Button_module_scss_1.default.sm]: size === "sm",
|
|
67
|
+
[Button_module_scss_1.default.md]: size === "md",
|
|
68
|
+
[Button_module_scss_1.default.lg]: size === "lg",
|
|
69
|
+
[Button_module_scss_1.default.solidPrimary]: variant === "solid" && themeColor === "primary",
|
|
70
|
+
[Button_module_scss_1.default.solidSecondary]: variant === "solid" && themeColor === "secondary",
|
|
71
|
+
[Button_module_scss_1.default.solidAttention]: variant === "solid" && themeColor === "attention",
|
|
72
|
+
[Button_module_scss_1.default.outlinedPrimary]: variant === "outlined" && themeColor === "primary",
|
|
73
|
+
[Button_module_scss_1.default.outlinedSecondary]: variant === "outlined" && themeColor === "secondary",
|
|
74
|
+
[Button_module_scss_1.default.outlinedAttention]: variant === "outlined" && themeColor === "attention",
|
|
75
|
+
[Button_module_scss_1.default.ghostPrimary]: variant === "ghost" && themeColor === "primary",
|
|
76
|
+
[Button_module_scss_1.default.ghostSecondary]: variant === "ghost" && themeColor === "secondary",
|
|
77
|
+
[Button_module_scss_1.default.ghostAttention]: variant === "ghost" && themeColor === "attention",
|
|
78
|
+
[Button_module_scss_1.default.alignStart]: contentPosition === "start",
|
|
79
|
+
[Button_module_scss_1.default.alignEnd]: contentPosition === "end",
|
|
80
|
+
}), autoFocus: autoFocus, disabled: disabled, form: formId, style: style, onClick: onClick, onFocus: onFocus, onBlur: onBlur, children: [iconToLeft && icon, children, !iconToLeft && icon] })));
|
|
81
|
+
});
|
|
82
|
+
exports.buttonStylingProps = {
|
|
83
|
+
variant: (0, descriptorHelper_1.desc)("The button variant (solid, outlined, ghost) to use"),
|
|
84
|
+
themeColor: (0, descriptorHelper_1.desc)("The button color scheme (primary, secondary, attention)"),
|
|
85
|
+
size: (0, descriptorHelper_1.desc)("The size of the button (small, medium, large)"),
|
|
86
|
+
};
|
|
87
|
+
// JSDoc-szerű leírás - szét kell választani a runtime cuccokat a statikus type-ok melletti kommentekből
|
|
88
|
+
// A lényeg, hogy egy eszközzel kiszedjük a releváns metaadatokat
|
|
89
|
+
const metadata = {
|
|
90
|
+
displayName: "Button",
|
|
91
|
+
// ref: description.mdx <- later
|
|
92
|
+
description: "Represent a button component, clicking of which triggers an action",
|
|
93
|
+
props: Object.assign(Object.assign({}, exports.buttonStylingProps), { label: (0, descriptorHelper_1.desc)("Specifies the optional text to display in the button. If omitted, children can be used to set " +
|
|
94
|
+
"the button's content."),
|
|
95
|
+
// ref: filename.mdx
|
|
96
|
+
type: (0, descriptorHelper_1.desc)("The behavior type of the button"),
|
|
97
|
+
// ref: filename.mdx
|
|
98
|
+
enabled: (0, descriptorHelper_1.desc)("Indicates if the button is enabled"), icon: (0, descriptorHelper_1.desc)("Optional icon ID to display the particular icon in the button"), iconPosition: (0, descriptorHelper_1.desc)("Position of the icon displayed in the button"), contentPosition: (0, descriptorHelper_1.desc)("Determines how the label and icon should be placed inside the Button component") }),
|
|
99
|
+
events: {
|
|
100
|
+
click: (0, descriptorHelper_1.desc)("Triggers when the button is clicked"),
|
|
101
|
+
gotFocus: (0, descriptorHelper_1.desc)("Triggers when he button is focused"),
|
|
102
|
+
lostFocus: (0, descriptorHelper_1.desc)("Triggers when the button has lost focus"),
|
|
103
|
+
},
|
|
104
|
+
themeVars: (0, themeVars_1.parseScssVar)(Button_module_scss_1.default.themeVars),
|
|
105
|
+
defaultThemeVars: {
|
|
106
|
+
"width-Button": "fit-content",
|
|
107
|
+
"height-Button": "fit-content",
|
|
108
|
+
"radius-Button": "$radius",
|
|
109
|
+
"font-size-Button": "$font-size-normal",
|
|
110
|
+
"color-bg-Button-primary": "$color-primary-500",
|
|
111
|
+
"color-bg-Button-attention": "$color-bg-attention",
|
|
112
|
+
"color-border-Button-attention": "$color-attention",
|
|
113
|
+
"color-bg-Button--disabled": "$color-bg--disabled",
|
|
114
|
+
"color-border-Button--disabled": "$color-border--disabled",
|
|
115
|
+
"style-border-Button": "solid",
|
|
116
|
+
"color-text-Button--disabled": "$color-text--disabled",
|
|
117
|
+
"color-outline-Button--focus": "$color-outline--focus",
|
|
118
|
+
"thickness-outline-Button--focus": "$thickness-outline--focus",
|
|
119
|
+
"style-outline-Button--focus": "$style-outline--focus",
|
|
120
|
+
"offset-outline-Button--focus": "$offset-outline--focus",
|
|
121
|
+
"padding-horizontal-xs-Button": "$space-1",
|
|
122
|
+
"padding-vertical-xs-Button": "$space-0_5",
|
|
123
|
+
"padding-horizontal-sm-Button": "$space-4",
|
|
124
|
+
"padding-vertical-sm-Button": "$space-2",
|
|
125
|
+
"padding-horizontal-md-Button": "$space-4",
|
|
126
|
+
"padding-vertical-md-Button": "$space-3",
|
|
127
|
+
"padding-horizontal-lg-Button": "$space-5",
|
|
128
|
+
"padding-vertical-lg-Button": "$space-4",
|
|
129
|
+
light: {
|
|
130
|
+
"color-text-Button": "$color-surface-950",
|
|
131
|
+
"color-text-Button-solid": "$color-surface-50",
|
|
132
|
+
"color-border-Button-primary": "$color-primary-500",
|
|
133
|
+
"color-bg-Button-primary--hover": "$color-primary-400",
|
|
134
|
+
"color-bg-Button-primary--active": "$color-primary-500",
|
|
135
|
+
"color-bg-Button-primary-outlined--hover": "$color-primary-50",
|
|
136
|
+
"color-bg-Button-primary-outlined--active": "$color-primary-100",
|
|
137
|
+
"color-border-Button-primary-outlined": "$color-primary-600",
|
|
138
|
+
"color-border-Button-primary-outlined--hover": "$color-primary-500",
|
|
139
|
+
"color-text-Button-primary-outlined": "$color-primary-900",
|
|
140
|
+
"color-text-Button-primary-outlined--hover": "$color-primary-950",
|
|
141
|
+
"color-text-Button-primary-outlined--active": "$color-primary-900",
|
|
142
|
+
"color-bg-Button-primary-ghost--hover": "$color-primary-50",
|
|
143
|
+
"color-bg-Button-primary-ghost--active": "$color-primary-100",
|
|
144
|
+
"color-border-Button-secondary": "$color-secondary-500",
|
|
145
|
+
"color-bg-Button-secondary": "$color-secondary-500",
|
|
146
|
+
"color-bg-Button-secondary--hover": "$color-secondary-400",
|
|
147
|
+
"color-bg-Button-secondary--active": "$color-secondary-500",
|
|
148
|
+
"color-bg-Button-secondary-outlined--hover": "$color-secondary-50",
|
|
149
|
+
"color-bg-Button-secondary-outlined--active": "$color-secondary-100",
|
|
150
|
+
"color-bg-Button-secondary-ghost--hover": "$color-secondary-100",
|
|
151
|
+
"color-bg-Button-secondary-ghost--active": "$color-secondary-100",
|
|
152
|
+
"color-bg-Button-attention--hover": "$color-danger-400",
|
|
153
|
+
"color-bg-Button-attention--active": "$color-danger-500",
|
|
154
|
+
"color-bg-Button-attention-outlined--hover": "$color-danger-50",
|
|
155
|
+
"color-bg-Button-attention-outlined--active": "$color-danger-100",
|
|
156
|
+
"color-bg-Button-attention-ghost--hover": "$color-danger-50",
|
|
157
|
+
"color-bg-Button-attention-ghost--active": "$color-danger-100",
|
|
158
|
+
},
|
|
159
|
+
dark: {
|
|
160
|
+
"color-text-Button": "$color-surface-50",
|
|
161
|
+
"color-text-Button-solid": "$color-surface-50",
|
|
162
|
+
"color-border-Button-primary": "$color-primary-500",
|
|
163
|
+
"color-bg-Button-primary--hover": "$color-primary-600",
|
|
164
|
+
"color-bg-Button-primary--active": "$color-primary-500",
|
|
165
|
+
"color-bg-Button-primary-outlined--hover": "$color-primary-900",
|
|
166
|
+
"color-bg-Button-primary-outlined--active": "$color-primary-950",
|
|
167
|
+
"color-border-Button-primary-outlined": "$color-primary-600",
|
|
168
|
+
"color-border-Button-primary-outlined--hover": "$color-primary-500",
|
|
169
|
+
"color-text-Button-primary-outlined": "$color-primary-100",
|
|
170
|
+
"color-text-Button-primary-outlined--hover": "$color-primary-50",
|
|
171
|
+
"color-text-Button-primary-outlined--active": "$color-primary-100",
|
|
172
|
+
"color-bg-Button-primary-ghost--hover": "$color-primary-900",
|
|
173
|
+
"color-bg-Button-primary-ghost--active": "$color-primary-950",
|
|
174
|
+
"color-border-Button-secondary": "$color-secondary-500",
|
|
175
|
+
"color-bg-Button-secondary": "$color-secondary-500",
|
|
176
|
+
"color-bg-Button-secondary--hover": "$color-secondary-400",
|
|
177
|
+
"color-bg-Button-secondary--active": "$color-secondary-500",
|
|
178
|
+
"color-bg-Button-secondary-outlined--hover": "$color-secondary-600",
|
|
179
|
+
"color-bg-Button-secondary-outlined--active": "$color-secondary-500",
|
|
180
|
+
"color-bg-Button-secondary-ghost--hover": "$color-secondary-900",
|
|
181
|
+
"color-bg-Button-secondary-ghost--active": "$color-secondary-950",
|
|
182
|
+
"color-bg-Button-attention--hover": "$color-danger-400",
|
|
183
|
+
"color-bg-Button-attention--active": "$color-danger-500",
|
|
184
|
+
"color-bg-Button-attention-outlined--hover": "$color-danger-900",
|
|
185
|
+
"color-bg-Button-attention-outlined--active": "$color-danger-950",
|
|
186
|
+
"color-bg-Button-attention-ghost--hover": "$color-danger-900",
|
|
187
|
+
"color-bg-Button-attention-ghost--active": "$color-danger-950",
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
exports.buttonComponentRenderer = (0, renderers_1.createComponentRenderer)("Button", ({ node, extractValue, renderChild, lookupEventHandler, lookupAction, layoutCss }) => {
|
|
192
|
+
var _a, _b, _c;
|
|
193
|
+
const iconName = extractValue.asString(node.props.icon);
|
|
194
|
+
const label = extractValue.asDisplayText(node.props.label);
|
|
195
|
+
return ((0, jsx_runtime_1.jsx)(exports.Button, { type: node.props.type, variant: extractValue(node.props.variant), themeColor: extractValue(node.props.themeColor), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), size: extractValue(node.props.size), icon: iconName && (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: iconName }), iconPosition: extractValue(node.props.iconPosition), contentPosition: extractValue(node.props.contentPosition), disabled: !extractValue.asOptionalBoolean((_a = node.props.enabled) !== null && _a !== void 0 ? _a : true), onFocus: lookupAction((_b = node.events) === null || _b === void 0 ? void 0 : _b.gotFocus), onBlur: lookupAction((_c = node.events) === null || _c === void 0 ? void 0 : _c.lostFocus), title: extractValue(node.props.title), style: layoutCss, children: renderChild(node.children) || label }));
|
|
196
|
+
}, metadata);
|
|
@@ -0,0 +1,65 @@
|
|
|
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.cardComponentRenderer = void 0;
|
|
7
|
+
exports.Card = Card;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const Card_module_scss_1 = __importDefault(require("./Card.module.scss"));
|
|
10
|
+
const classnames_1 = __importDefault(require("@components-core/utils/classnames"));
|
|
11
|
+
const renderers_1 = require("@components-core/renderers");
|
|
12
|
+
const themeVars_1 = require("@components-core/theming/themeVars");
|
|
13
|
+
const descriptorHelper_1 = require("@components-core/descriptorHelper");
|
|
14
|
+
const Avatar_1 = require("@components/Avatar/Avatar");
|
|
15
|
+
const Link_1 = require("@components/Link/Link");
|
|
16
|
+
const Heading_1 = require("@components/Heading/Heading");
|
|
17
|
+
const Stack_1 = require("@components/Stack/Stack");
|
|
18
|
+
const Text_1 = require("@components/Text/Text");
|
|
19
|
+
function Card({ children, style, title, subTitle, linkTo, avatarUrl, showAvatar = !!avatarUrl || false, onClick, }) {
|
|
20
|
+
const titleProps = {
|
|
21
|
+
level: "h2",
|
|
22
|
+
layout: { marginTop: 0, marginBottom: "4px" },
|
|
23
|
+
};
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(Card_module_scss_1.default.wrapper, { [Card_module_scss_1.default.isClickable]: !!onClick }), style: style, onClick: onClick, children: [[title, subTitle, avatarUrl, showAvatar].some(Boolean) && ((0, jsx_runtime_1.jsxs)(Stack_1.Stack, { orientation: "horizontal", verticalAlignment: "center", layout: { gap: "1rem" }, children: [showAvatar && (0, jsx_runtime_1.jsx)(Avatar_1.Avatar, { url: avatarUrl, name: title }), (0, jsx_runtime_1.jsxs)(Stack_1.Stack, { orientation: "vertical", children: [linkTo ? ((0, jsx_runtime_1.jsx)(Link_1.LocalLink, { to: linkTo + "", children: (0, jsx_runtime_1.jsx)(Heading_1.Heading, Object.assign({}, titleProps, { children: title })) })) : ((0, jsx_runtime_1.jsx)(Heading_1.Heading, Object.assign({}, titleProps, { children: title }))), (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "small", children: subTitle })] })] })), children] }));
|
|
25
|
+
}
|
|
26
|
+
const metadata = {
|
|
27
|
+
displayName: "Card",
|
|
28
|
+
description: "A component displaying its children in a card",
|
|
29
|
+
props: {
|
|
30
|
+
avatarUrl: (0, descriptorHelper_1.desc)("The URL of the avatar to display"),
|
|
31
|
+
showAvatar: (0, descriptorHelper_1.desc)("Indicates whether the avatar should be displayed"),
|
|
32
|
+
title: (0, descriptorHelper_1.desc)("A prestyled title"),
|
|
33
|
+
subTitle: (0, descriptorHelper_1.desc)("A prestyled subtitle"),
|
|
34
|
+
linkTo: (0, descriptorHelper_1.desc)("Optional link for the title"),
|
|
35
|
+
},
|
|
36
|
+
events: {
|
|
37
|
+
click: (0, descriptorHelper_1.desc)("The card is clicked"),
|
|
38
|
+
},
|
|
39
|
+
themeVars: (0, themeVars_1.parseScssVar)(Card_module_scss_1.default.themeVars),
|
|
40
|
+
defaultThemeVars: {
|
|
41
|
+
"padding-horizontal-Card": "$space-4",
|
|
42
|
+
"padding-vertical-Card": "$space-4",
|
|
43
|
+
"padding-Card": "$padding-vertical-Card $padding-horizontal-Card",
|
|
44
|
+
"color-border-Card": "$color-border",
|
|
45
|
+
"thickness-border-Card": "1px",
|
|
46
|
+
"style-border-Card": "solid",
|
|
47
|
+
"border-Card": "$thickness-border-Card $style-border-Card $color-border-Card",
|
|
48
|
+
"radius-Cars": "$radius",
|
|
49
|
+
"shadow-Card": "none",
|
|
50
|
+
light: {
|
|
51
|
+
"color-bg-Card": "white",
|
|
52
|
+
},
|
|
53
|
+
dark: {
|
|
54
|
+
"color-bg-Card": "$color-surface-900",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
exports.cardComponentRenderer = (0, renderers_1.createComponentRenderer)("Card", ({ node, extractValue, renderChild, layoutCss, lookupEventHandler }) => {
|
|
59
|
+
return ((0, jsx_runtime_1.jsx)(Card, { style: layoutCss, title: extractValue.asOptionalString(node.props.title), linkTo: extractValue.asOptionalString(node.props.linkTo), subTitle: extractValue.asOptionalString(node.props.subTitle), avatarUrl: extractValue.asOptionalString(node.props.avatarUrl), showAvatar: extractValue.asOptionalBoolean(node.props.showAvatar), children: renderChild(node.children, {
|
|
60
|
+
// Since the card is a flex container, it's children should behave the same as in a stack
|
|
61
|
+
// (e.g. starsizing works in this case)
|
|
62
|
+
type: "Stack",
|
|
63
|
+
orientation: "vertical",
|
|
64
|
+
}) }));
|
|
65
|
+
}, metadata);
|