xmlui 0.9.51 → 0.9.52
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/lib/{apiInterceptorWorker-BtGYrMWj.mjs → apiInterceptorWorker-OagsYDXz.mjs} +3 -3
- package/dist/lib/{index-hS5S81ba.mjs → index-BnpxPPve.mjs} +13265 -11886
- package/dist/lib/index.css +1 -1
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{metadata-utils-QekhOD-W.mjs → metadata-utils-4EQ6kQIM.mjs} +7 -7
- package/dist/lib/{server-common-CtY73qos.mjs → server-common-C0cF2UTg.mjs} +4422 -4452
- package/dist/lib/{transform-DXcw0gGl.mjs → transform-CgRMkbb0.mjs} +1472 -1440
- package/dist/lib/xmlui-parser.d.ts +84 -62
- package/dist/lib/xmlui-parser.mjs +41 -49
- package/dist/lib/{xmlui-serializer-CAZCkpXP.mjs → xmlui-serializer-EDw51UFN.mjs} +10 -10
- package/dist/lib/xmlui.d.ts +17 -7
- package/dist/lib/xmlui.mjs +19 -18
- package/dist/metadata/apiInterceptorWorker-BOuioN57.mjs +15414 -0
- package/dist/metadata/collectedComponentMetadata-DbptBvJk.mjs +41019 -0
- package/dist/metadata/core-D3puiNN6.mjs +5771 -0
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/wasm-DQxwEHae.mjs +7 -0
- package/dist/metadata/xmlui-metadata.mjs +3 -18398
- package/dist/metadata/xmlui-metadata.umd.js +547 -10
- package/dist/scripts/package.json +5 -6
- package/dist/scripts/src/components/APICall/APICall.js +13 -12
- package/dist/scripts/src/components/APICall/APICallNative.js +5 -0
- package/dist/scripts/src/components/Accordion/Accordion.js +4 -2
- package/dist/scripts/src/components/Accordion/AccordionItem.js +2 -2
- package/dist/scripts/src/components/Accordion/AccordionItemNative.js +6 -2
- package/dist/scripts/src/components/App/App.js +22 -9
- package/dist/scripts/src/components/App/AppNative.js +9 -1
- package/dist/scripts/src/components/AppHeader/AppHeader.js +2 -2
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +5 -2
- package/dist/scripts/src/components/AppState/AppState.js +2 -2
- package/dist/scripts/src/components/AppState/AppStateNative.js +5 -1
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +8 -8
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +16 -2
- package/dist/scripts/src/components/Avatar/Avatar.js +4 -2
- package/dist/scripts/src/components/Backdrop/Backdrop.js +2 -2
- package/dist/scripts/src/components/Badge/Badge.js +7 -5
- package/dist/scripts/src/components/Bookmark/Bookmark.js +5 -4
- package/dist/scripts/src/components/Card/Card.js +6 -4
- package/dist/scripts/src/components/ChangeListener/ChangeListener.js +2 -1
- package/dist/scripts/src/components/Charts/BarChart/BarChart.js +76 -0
- package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +108 -0
- package/dist/scripts/src/components/Charts/DonutChart/DonutChart.js +59 -0
- package/dist/scripts/src/components/Charts/LabelList/LabelList.js +38 -0
- package/dist/scripts/src/components/Charts/LabelList/LabelListNative.js +24 -0
- package/dist/scripts/src/components/Charts/Legend/Legend.js +30 -0
- package/dist/scripts/src/components/Charts/Legend/LegendNative.js +64 -0
- package/dist/scripts/src/components/Charts/LineChart/LineChart.js +53 -0
- package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +103 -0
- package/dist/scripts/src/components/Charts/PieChart/PieChart.js +58 -0
- package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +127 -0
- package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.js +27 -0
- package/dist/scripts/src/components/Charts/utils/ChartProvider.js +65 -0
- package/dist/scripts/src/components/Charts/utils/abstractions.js +26 -0
- package/dist/scripts/src/components/CodeBlock/CodeBlock.js +4 -4
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +5 -1
- package/dist/scripts/src/components/Column/Column.js +15 -9
- package/dist/scripts/src/components/Column/ColumnNative.js +5 -0
- package/dist/scripts/src/components/ComponentProvider.js +12 -6
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +4 -3
- package/dist/scripts/src/components/DatePicker/DatePicker.js +5 -3
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +1 -1
- package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +7 -2
- package/dist/scripts/src/components/FileInput/FileInput.js +8 -9
- package/dist/scripts/src/components/FileInput/FileInputNative.js +14 -2
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +2 -2
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +9 -2
- package/dist/scripts/src/components/Footer/Footer.js +1 -0
- package/dist/scripts/src/components/Footer/FooterNative.js +4 -1
- package/dist/scripts/src/components/Form/Form.js +9 -5
- package/dist/scripts/src/components/Form/FormNative.js +2 -1
- package/dist/scripts/src/components/FormItem/FormItem.js +25 -15
- package/dist/scripts/src/components/FormItem/FormItemNative.js +1 -0
- package/dist/scripts/src/components/Heading/Heading.js +5 -4
- package/dist/scripts/src/components/Heading/HeadingNative.js +1 -0
- package/dist/scripts/src/components/Icon/Icon.js +7 -5
- package/dist/scripts/src/components/Image/Image.js +19 -9
- package/dist/scripts/src/components/Image/ImageNative.js +7 -2
- package/dist/scripts/src/components/Items/Items.js +2 -0
- package/dist/scripts/src/components/Items/ItemsNative.js +5 -1
- package/dist/scripts/src/components/Link/Link.js +3 -4
- package/dist/scripts/src/components/Link/LinkNative.js +6 -2
- package/dist/scripts/src/components/List/List.js +12 -11
- package/dist/scripts/src/components/List/ListNative.js +10 -2
- package/dist/scripts/src/components/Logo/Logo.js +7 -0
- package/dist/scripts/src/components/Logo/LogoNative.js +6 -2
- package/dist/scripts/src/components/Markdown/Markdown.js +5 -3
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +7 -9
- package/dist/scripts/src/components/Markdown/utils.js +23 -1
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +2 -2
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +7 -2
- package/dist/scripts/src/components/NavGroup/NavGroup.js +2 -1
- package/dist/scripts/src/components/NavLink/NavLink.js +5 -7
- package/dist/scripts/src/components/NavLink/NavLinkNative.js +7 -2
- package/dist/scripts/src/components/NavPanel/NavPanel.js +6 -0
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +6 -2
- package/dist/scripts/src/components/NestedApp/NestedApp.js +16 -4
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +37 -34
- package/dist/scripts/src/components/NestedApp/defaultProps.js +10 -0
- package/dist/scripts/src/components/NoResult/NoResult.js +6 -2
- package/dist/scripts/src/components/NoResult/NoResultNative.js +8 -3
- package/dist/scripts/src/components/NumberBox/NumberBox.js +8 -6
- package/dist/scripts/src/components/NumberBox/NumberBox2.js +6 -6
- package/dist/scripts/src/components/NumberBox/NumberBox2Native.js +15 -2
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +16 -2
- package/dist/scripts/src/components/Option/Option.js +10 -15
- package/dist/scripts/src/components/Option/OptionNative.js +18 -0
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTilteNative.js +6 -2
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +4 -1
- package/dist/scripts/src/components/Pages/Pages.js +7 -3
- package/dist/scripts/src/components/Pages/PagesNative.js +5 -0
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +1 -1
- package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +5 -2
- package/dist/scripts/src/components/Queue/Queue.js +11 -6
- package/dist/scripts/src/components/Queue/QueueNative.js +7 -1
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +5 -5
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +9 -2
- package/dist/scripts/src/components/RadioGroup/RadioItem.js +8 -2
- package/dist/scripts/src/components/RadioGroup/RadioItemNative.js +6 -2
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +4 -1
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +4 -0
- package/dist/scripts/src/components/Redirect/Redirect.js +8 -2
- package/dist/scripts/src/components/Select/Select.js +21 -12
- package/dist/scripts/src/components/Select/SelectNative.js +15 -2
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +6 -3
- package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +6 -2
- package/dist/scripts/src/components/Slider/Slider.js +28 -9
- package/dist/scripts/src/components/Slider/SliderNative.js +14 -3
- package/dist/scripts/src/components/Spinner/Spinner.js +2 -2
- package/dist/scripts/src/components/Spinner/SpinnerNative.js +6 -2
- package/dist/scripts/src/components/Splitter/Splitter.js +6 -6
- package/dist/scripts/src/components/Splitter/SplitterNative.js +10 -2
- package/dist/scripts/src/components/Stack/Stack.js +4 -4
- package/dist/scripts/src/components/Stack/StackNative.js +8 -2
- package/dist/scripts/src/components/StickyBox/StickyBox.js +1 -1
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +7 -1
- package/dist/scripts/src/components/Table/Table.js +15 -14
- package/dist/scripts/src/components/Table/TableNative.js +25 -9
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +12 -3
- package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +6 -2
- package/dist/scripts/src/components/Tabs/Tabs.js +2 -2
- package/dist/scripts/src/components/Tabs/TabsNative.js +7 -2
- package/dist/scripts/src/components/Text/Text.js +14 -13
- package/dist/scripts/src/components/Text/TextNative.js +7 -2
- package/dist/scripts/src/components/TextArea/TextArea.js +8 -5
- package/dist/scripts/src/components/TextArea/TextAreaNative.js +19 -2
- package/dist/scripts/src/components/TextBox/TextBox.js +5 -4
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +14 -2
- package/dist/scripts/src/components/Theme/Theme.js +1 -1
- package/dist/scripts/src/components/Theme/ThemeNative.js +10 -14
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +18 -8
- package/dist/scripts/src/components/TreeDisplay/TreeDisplay.js +1 -1
- package/dist/scripts/src/components/TreeDisplay/TreeDisplayNative.js +2 -1
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +3 -57
- package/dist/scripts/src/components/ValidationSummary/ValidationSummaryNative.js +64 -0
- package/dist/scripts/src/components/metadata-helpers.js +11 -8
- package/dist/scripts/src/components-core/InspectorContext.js +0 -4
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +1 -1
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +6 -2
- package/dist/scripts/src/components-core/loader/DataLoader.js +1 -1
- package/dist/scripts/src/components-core/loader/Loader.js +7 -3
- package/dist/scripts/src/components-core/theming/themes/palette.js +5 -4
- package/dist/scripts/src/components-core/theming/themes/root.js +5 -4
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +1 -17
- package/dist/scripts/src/parsers/xmlui-parser/diagnostics.js +92 -48
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +179 -189
- package/dist/standalone/xmlui-standalone.es.d.ts +0 -2580
- package/dist/standalone/xmlui-standalone.umd.js +275 -305
- package/package.json +5 -6
|
@@ -17,7 +17,7 @@ exports.TextBoxMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
17
17
|
description: `The \`${COMP}\` is an input component that allows users to input and edit textual data.`,
|
|
18
18
|
props: {
|
|
19
19
|
placeholder: (0, metadata_helpers_1.dPlaceholder)(),
|
|
20
|
-
initialValue: (0, metadata_helpers_1.dInitialValue)(),
|
|
20
|
+
initialValue: Object.assign(Object.assign({}, (0, metadata_helpers_1.dInitialValue)()), { defaultValue: TextBoxNative_1.defaultProps.initialValue }),
|
|
21
21
|
label: (0, metadata_helpers_1.dLabel)(),
|
|
22
22
|
labelPosition: (0, metadata_helpers_1.dLabelPosition)("top"),
|
|
23
23
|
labelWidth: (0, metadata_helpers_1.dLabelWidth)(COMP),
|
|
@@ -26,14 +26,15 @@ exports.TextBoxMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
26
26
|
autoFocus: (0, metadata_helpers_1.dAutoFocus)(),
|
|
27
27
|
required: (0, metadata_helpers_1.dRequired)(),
|
|
28
28
|
readOnly: (0, metadata_helpers_1.dReadonly)(),
|
|
29
|
-
enabled: (0, metadata_helpers_1.dEnabled)(),
|
|
30
|
-
validationStatus: (0, metadata_helpers_1.dValidationStatus)(),
|
|
29
|
+
enabled: Object.assign(Object.assign({}, (0, metadata_helpers_1.dEnabled)()), { defaultValue: TextBoxNative_1.defaultProps.enabled }),
|
|
30
|
+
validationStatus: Object.assign(Object.assign({}, (0, metadata_helpers_1.dValidationStatus)()), { defaultValue: TextBoxNative_1.defaultProps.validationStatus }),
|
|
31
31
|
startText: (0, metadata_helpers_1.dStartText)(),
|
|
32
32
|
startIcon: (0, metadata_helpers_1.dStartIcon)(),
|
|
33
33
|
endText: (0, metadata_helpers_1.dEndText)(),
|
|
34
34
|
endIcon: (0, metadata_helpers_1.dEndIcon)(),
|
|
35
35
|
gap: {
|
|
36
|
-
description: "This property defines the gap between the adornments and the input area."
|
|
36
|
+
description: "This property defines the gap between the adornments and the input area. If not " +
|
|
37
|
+
"set, the gap declared by the current theme is used.",
|
|
37
38
|
},
|
|
38
39
|
},
|
|
39
40
|
events: {
|
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.TextBox = void 0;
|
|
39
|
+
exports.TextBox = exports.defaultProps = void 0;
|
|
40
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
41
|
const react_1 = require("react");
|
|
42
42
|
const react_2 = __importStar(require("react"));
|
|
@@ -46,7 +46,19 @@ const constants_1 = require("../../components-core/constants");
|
|
|
46
46
|
const misc_1 = require("../../components-core/utils/misc");
|
|
47
47
|
const InputAdornment_1 = require("../Input/InputAdornment");
|
|
48
48
|
const ItemWithLabel_1 = require("../FormItem/ItemWithLabel");
|
|
49
|
-
exports.
|
|
49
|
+
exports.defaultProps = {
|
|
50
|
+
type: "text",
|
|
51
|
+
value: "",
|
|
52
|
+
initialValue: "",
|
|
53
|
+
enabled: true,
|
|
54
|
+
validationStatus: "none",
|
|
55
|
+
onDidChange: constants_1.noop,
|
|
56
|
+
onFocus: constants_1.noop,
|
|
57
|
+
onBlur: constants_1.noop,
|
|
58
|
+
onKeyDown: constants_1.noop,
|
|
59
|
+
updateState: constants_1.noop,
|
|
60
|
+
};
|
|
61
|
+
exports.TextBox = (0, react_1.forwardRef)(function TextBox({ id, type = exports.defaultProps.type, value = exports.defaultProps.value, updateState = exports.defaultProps.updateState, initialValue = exports.defaultProps.initialValue, style, maxLength, enabled = exports.defaultProps.enabled, placeholder, validationStatus = exports.defaultProps.validationStatus, onDidChange = exports.defaultProps.onDidChange, onFocus = exports.defaultProps.onFocus, onBlur = exports.defaultProps.onBlur, onKeyDown = exports.defaultProps.onKeyDown, registerComponentApi, startText, startIcon, endText, endIcon, gap, autoFocus, readOnly, tabIndex, label, labelPosition, labelWidth, labelBreak, required, }, ref) {
|
|
50
62
|
const _id = (0, react_1.useId)();
|
|
51
63
|
id = id || _id;
|
|
52
64
|
const inputRef = (0, react_2.useRef)(null);
|
|
@@ -31,7 +31,7 @@ exports.ThemeMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
31
31
|
valueType: "string",
|
|
32
32
|
defaultValue: "light",
|
|
33
33
|
},
|
|
34
|
-
root: (0, ComponentDefs_1.d)(`This property indicates whether the component is at the root of the application
|
|
34
|
+
root: (0, ComponentDefs_1.d)(`This property indicates whether the component is at the root of the application.`, undefined, "boolean", ThemeNative_1.defaultProps.root),
|
|
35
35
|
},
|
|
36
36
|
opaque: true,
|
|
37
37
|
});
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.defaultProps = void 0;
|
|
6
7
|
exports.Theme = Theme;
|
|
7
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
9
|
const react_1 = require("react");
|
|
@@ -15,7 +16,6 @@ const ThemeContext_1 = require("../../components-core/theming/ThemeContext");
|
|
|
15
16
|
const constants_1 = require("../../components-core/constants");
|
|
16
17
|
const ErrorBoundary_1 = require("../../components-core/rendering/ErrorBoundary");
|
|
17
18
|
const NotificationToast_1 = require("./NotificationToast");
|
|
18
|
-
const InspectorContext_1 = require("../../components-core/InspectorContext");
|
|
19
19
|
const IndexerContext_1 = require("../App/IndexerContext");
|
|
20
20
|
function getClassName(css) {
|
|
21
21
|
return `theme-${calculateHash(css)}`;
|
|
@@ -31,7 +31,13 @@ function calculateHash(str) {
|
|
|
31
31
|
}
|
|
32
32
|
return hash;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
exports.defaultProps = {
|
|
35
|
+
isRoot: false,
|
|
36
|
+
toastDuration: 5000,
|
|
37
|
+
themeVars: constants_1.EMPTY_OBJECT,
|
|
38
|
+
root: false,
|
|
39
|
+
};
|
|
40
|
+
function Theme({ id, isRoot = exports.defaultProps.isRoot, renderChild, node, tone, toastDuration = exports.defaultProps.toastDuration, themeVars = exports.defaultProps.themeVars, layoutContext, children, }) {
|
|
35
41
|
const generatedId = (0, react_1.useId)();
|
|
36
42
|
const { themes, resources, resourceMap, activeThemeId, setRoot, root } = (0, ThemeContext_1.useThemes)();
|
|
37
43
|
const { activeTheme, activeThemeTone } = (0, ThemeContext_1.useTheme)();
|
|
@@ -112,16 +118,6 @@ function Theme({ id, isRoot = false, renderChild, node, tone, toastDuration = 50
|
|
|
112
118
|
getResourceUrl,
|
|
113
119
|
getThemeVar,
|
|
114
120
|
]);
|
|
115
|
-
const { devToolsSize, devToolsSide, devToolsEnabled } = (0, InspectorContext_1.useDevTools)();
|
|
116
|
-
const inspectStyle = (0, react_1.useMemo)(() => {
|
|
117
|
-
return devToolsEnabled
|
|
118
|
-
? {
|
|
119
|
-
paddingBottom: devToolsSide === "bottom" ? devToolsSize : 0,
|
|
120
|
-
paddingLeft: devToolsSide === "left" ? devToolsSize : 0,
|
|
121
|
-
paddingRight: devToolsSide === "right" ? devToolsSize : 0,
|
|
122
|
-
}
|
|
123
|
-
: {};
|
|
124
|
-
}, [devToolsEnabled, devToolsSide, devToolsSize]);
|
|
125
121
|
const { indexing } = (0, IndexerContext_1.useIndexerContext)();
|
|
126
122
|
if (indexing) {
|
|
127
123
|
return children;
|
|
@@ -130,7 +126,7 @@ function Theme({ id, isRoot = false, renderChild, node, tone, toastDuration = 50
|
|
|
130
126
|
const faviconUrl = getResourceUrl("resource:favicon") || "/resources/favicon.ico";
|
|
131
127
|
return (
|
|
132
128
|
// <ThemeContext.Provider value={currentThemeContextValue}>
|
|
133
|
-
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_helmet_async_1.Helmet, { children: [!!faviconUrl && (0, jsx_runtime_1.jsx)("link", { rel: "icon", type: "image/svg+xml", href: faviconUrl }), fontLinks === null || fontLinks === void 0 ? void 0 : fontLinks.map((fontLink) => (0, jsx_runtime_1.jsx)("link", { href: fontLink, rel: "stylesheet" }, fontLink))] }), (0, jsx_runtime_1.jsx)("style", { type: "text/css", "data-theme-root": true,
|
|
129
|
+
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_helmet_async_1.Helmet, { children: [!!faviconUrl && (0, jsx_runtime_1.jsx)("link", { rel: "icon", type: "image/svg+xml", href: faviconUrl }), fontLinks === null || fontLinks === void 0 ? void 0 : fontLinks.map((fontLink) => (0, jsx_runtime_1.jsx)("link", { href: fontLink, rel: "stylesheet" }, fontLink))] }), (0, jsx_runtime_1.jsx)("style", { type: "text/css", "data-theme-root": true, dangerouslySetInnerHTML: { __html: `.${className} {${css}}` } }), (0, jsx_runtime_1.jsxs)("div", { id: "_ui-engine-theme-root", className: (0, classnames_1.default)(Theme_module_scss_1.default.baseRootComponent, className), ref: (el) => {
|
|
134
130
|
if (el) {
|
|
135
131
|
setRoot(el);
|
|
136
132
|
}
|
|
@@ -138,7 +134,7 @@ function Theme({ id, isRoot = false, renderChild, node, tone, toastDuration = 50
|
|
|
138
134
|
// </ThemeContext.Provider>
|
|
139
135
|
);
|
|
140
136
|
}
|
|
141
|
-
return ((0, jsx_runtime_1.jsxs)(ThemeContext_1.ThemeContext.Provider, { value: currentThemeContextValue, children: [(0, jsx_runtime_1.jsx)("style", {
|
|
137
|
+
return ((0, jsx_runtime_1.jsxs)(ThemeContext_1.ThemeContext.Provider, { value: currentThemeContextValue, children: [(0, jsx_runtime_1.jsx)("style", { type: "text/css", dangerouslySetInnerHTML: { __html: `.${className} {${css}}` } }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Theme_module_scss_1.default.baseRootComponent, Theme_module_scss_1.default.wrapper, className), children: renderChild(node.children, Object.assign(Object.assign({}, layoutContext), { themeClassName: className })) }), root &&
|
|
142
138
|
(0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(className), ref: (el) => {
|
|
143
139
|
if (el) {
|
|
144
140
|
setThemeRoot(el);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toneChangerButtonComponentRenderer = exports.ToneChangerButtonMd = void 0;
|
|
3
|
+
exports.toneChangerButtonComponentRenderer = exports.ToneChangerButtonMd = exports.defaultProps = void 0;
|
|
4
4
|
exports.ToneChangerButton = ToneChangerButton;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
@@ -11,19 +11,29 @@ const IconNative_1 = require("../Icon/IconNative");
|
|
|
11
11
|
const COMP = "ToneChangerButton";
|
|
12
12
|
const LIGHT_TO_DARK_ICON = "lightToDark:ToneChangerButton";
|
|
13
13
|
const DARK_TO_LIGHT_ICON = "darkToLight:ToneChangerButton";
|
|
14
|
+
exports.defaultProps = {
|
|
15
|
+
lightToDarkIcon: LIGHT_TO_DARK_ICON,
|
|
16
|
+
darkToLightIcon: DARK_TO_LIGHT_ICON
|
|
17
|
+
};
|
|
14
18
|
exports.ToneChangerButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
15
19
|
status: "experimental",
|
|
16
20
|
description: `The \`${COMP}\` component is a component that allows the user to change the tone of the app.`,
|
|
17
21
|
props: {
|
|
18
|
-
lightToDarkIcon:
|
|
19
|
-
`the
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
lightToDarkIcon: {
|
|
23
|
+
description: `The icon displayed when the theme is in light mode and will switch to dark. You can change ` +
|
|
24
|
+
`the default icon for all ${COMP} instances with the "icon.lightToDark:ToneChangerButton" ` +
|
|
25
|
+
`declaration in the app configuration file.`,
|
|
26
|
+
defaultValue: exports.defaultProps.lightToDarkIcon,
|
|
27
|
+
},
|
|
28
|
+
darkToLightIcon: {
|
|
29
|
+
description: `The icon displayed when the theme is in dark mode and will switch to light. You can change ` +
|
|
30
|
+
`the default icon for all ${COMP} instances with the "icon.darkToLight:ToneChangerButton" ` +
|
|
31
|
+
`declaration in the app configuration file.`,
|
|
32
|
+
defaultValue: exports.defaultProps.darkToLightIcon,
|
|
33
|
+
},
|
|
24
34
|
},
|
|
25
35
|
});
|
|
26
|
-
function ToneChangerButton({ lightToDarkIcon =
|
|
36
|
+
function ToneChangerButton({ lightToDarkIcon = exports.defaultProps.lightToDarkIcon, darkToLightIcon = exports.defaultProps.darkToLightIcon }) {
|
|
27
37
|
const { activeThemeTone, setActiveThemeTone } = (0, ThemeContext_1.useThemes)();
|
|
28
38
|
// Use the direct icon name as both the main icon and the fallback
|
|
29
39
|
// This ensures we always have a working icon
|
|
@@ -26,7 +26,7 @@ exports.TreeDisplayMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
26
26
|
itemHeight: {
|
|
27
27
|
description: "The height of each tree item in pixels.",
|
|
28
28
|
valueType: "number",
|
|
29
|
-
defaultValue:
|
|
29
|
+
defaultValue: TreeDisplayNative_1.defaultProps.itemHeight,
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
themeVars: (0, themeVars_1.parseScssVar)(TreeDisplay_module_scss_1.default.themeVars),
|
|
@@ -9,6 +9,7 @@ const react_1 = require("react");
|
|
|
9
9
|
const TreeDisplay_module_scss_1 = __importDefault(require("./TreeDisplay.module.scss"));
|
|
10
10
|
exports.defaultProps = {
|
|
11
11
|
content: "",
|
|
12
|
+
itemHeight: 24
|
|
12
13
|
};
|
|
13
14
|
// Parse the indented text into a tree structure
|
|
14
15
|
const parseTreeContent = (content) => {
|
|
@@ -95,7 +96,7 @@ const renderTreeNode = (node, index, itemHeight, level = 0, ancestorLines = [])
|
|
|
95
96
|
return renderTreeNode(child, i, itemHeight, level + 1, newAncestorLines);
|
|
96
97
|
}) }))] }, `${node.label}-${index}`));
|
|
97
98
|
};
|
|
98
|
-
exports.TreeDisplay = (0, react_1.forwardRef)(function TreeDisplay({ style, children, content =
|
|
99
|
+
exports.TreeDisplay = (0, react_1.forwardRef)(function TreeDisplay({ style, children, content = exports.defaultProps.content, itemHeight = exports.defaultProps.itemHeight }, forwardedRef) {
|
|
99
100
|
const contentString = (content || (children === null || children === void 0 ? void 0 : children.toString()) || "").toString();
|
|
100
101
|
const treeNodes = (0, react_1.useMemo)(() => parseTreeContent(contentString), [contentString]);
|
|
101
102
|
return ((0, jsx_runtime_1.jsx)("div", { className: TreeDisplay_module_scss_1.default.treeDisplay, style: style, ref: forwardedRef, children: (0, jsx_runtime_1.jsx)("div", { className: TreeDisplay_module_scss_1.default.content, children: treeNodes.map((node, index) => renderTreeNode(node, index, itemHeight, 0, [])) }) }));
|
|
@@ -1,59 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ValidationSummary =
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const react_2 = require("@formkit/auto-animate/react");
|
|
10
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
11
|
-
const ValidationSummary_module_scss_1 = __importDefault(require("./ValidationSummary.module.scss"));
|
|
12
|
-
const constants_1 = require("../../components-core/constants");
|
|
13
|
-
const StackNative_1 = require("../Stack/StackNative");
|
|
14
|
-
const IconNative_1 = require("../Icon/IconNative");
|
|
15
|
-
const TextNative_1 = require("../Text/TextNative");
|
|
16
|
-
const SpaceFillerNative_1 = require("../SpaceFiller/SpaceFillerNative");
|
|
17
|
-
const ButtonNative_1 = require("../Button/ButtonNative");
|
|
18
|
-
function ValidationSummary({ fieldValidationResults = constants_1.EMPTY_OBJECT, generalValidationResults = constants_1.EMPTY_ARRAY, }) {
|
|
19
|
-
const [animateContainerRef] = (0, react_2.useAutoAnimate)({ duration: 100 });
|
|
20
|
-
const groupedInvalidResults = (0, react_1.useMemo)(() => {
|
|
21
|
-
const ret = {};
|
|
22
|
-
Object.entries(fieldValidationResults).forEach(([field, validationResult]) => {
|
|
23
|
-
validationResult.validations.forEach((singleValidationResult) => {
|
|
24
|
-
if (!singleValidationResult.isValid) {
|
|
25
|
-
ret[singleValidationResult.severity] = ret[singleValidationResult.severity] || [];
|
|
26
|
-
ret[singleValidationResult.severity].push({
|
|
27
|
-
field,
|
|
28
|
-
message: singleValidationResult.invalidMessage || "",
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
generalValidationResults.forEach((singleValidationResult) => {
|
|
34
|
-
ret[singleValidationResult.severity] = ret[singleValidationResult.severity] || [];
|
|
35
|
-
ret[singleValidationResult.severity].push({
|
|
36
|
-
message: singleValidationResult.invalidMessage || "",
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
return ret;
|
|
40
|
-
}, [fieldValidationResults, generalValidationResults]);
|
|
41
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: animateContainerRef, className: ValidationSummary_module_scss_1.default.summaryContainer, "data-validation-summary": true, children: [(0, jsx_runtime_1.jsx)(ValidationDisplay, { issues: groupedInvalidResults.warning, severity: "warning", heading: "Validation warnings" }), (0, jsx_runtime_1.jsx)(ValidationDisplay, { issues: groupedInvalidResults.error, severity: "error", heading: "Validation errors" })] }));
|
|
42
|
-
}
|
|
43
|
-
const ValidationDisplay = ({ heading, issues = constants_1.EMPTY_ARRAY, severity = "error", onClose, }) => {
|
|
44
|
-
const [animateContainerRef] = (0, react_2.useAutoAnimate)({ duration: 100 });
|
|
45
|
-
if (issues.length === 0) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(ValidationSummary_module_scss_1.default.validationContainer, {
|
|
49
|
-
[ValidationSummary_module_scss_1.default.valid]: severity === "valid",
|
|
50
|
-
[ValidationSummary_module_scss_1.default.info]: severity === "info",
|
|
51
|
-
[ValidationSummary_module_scss_1.default.warning]: severity === "warning",
|
|
52
|
-
[ValidationSummary_module_scss_1.default.error]: severity === "error",
|
|
53
|
-
}), style: { paddingTop: !onClose ? "0.5rem" : undefined }, "data-validation-display-severity": severity, children: [(0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", verticalAlignment: "center", style: { gap: "0.5rem" }, children: [(0, jsx_runtime_1.jsx)(IconNative_1.Icon, { className: ValidationSummary_module_scss_1.default.heading, name: severity, size: "md" }), (0, jsx_runtime_1.jsx)("div", { className: ValidationSummary_module_scss_1.default.heading, children: (0, jsx_runtime_1.jsx)(TextNative_1.Text, { children: heading }) }), !!onClose && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SpaceFillerNative_1.SpaceFiller, {}), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: onClose, variant: "ghost", themeColor: "secondary", icon: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "close", size: "sm" }), orientation: "vertical" })] }))] }), (0, jsx_runtime_1.jsx)("ul", { ref: animateContainerRef, children: issues.map((issue, i) => ((0, jsx_runtime_1.jsx)(ValidationEntry, { issue: issue }, i))) })] }));
|
|
54
|
-
};
|
|
55
|
-
// --- ValidationEntry
|
|
56
|
-
const ValidationEntry = ({ issue }) => {
|
|
57
|
-
const { field, message } = issue;
|
|
58
|
-
return ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsxs)("span", { style: { display: "inline-flex", gap: field ? "0.25rem" : undefined }, children: [field && (0, jsx_runtime_1.jsx)(TextNative_1.Text, { variant: "small", fontWeight: "bold", children: `${field}:` }), (0, jsx_runtime_1.jsx)(TextNative_1.Text, { variant: "small", preserveLinebreaks: true, children: message })] }) }));
|
|
59
|
-
};
|
|
3
|
+
exports.ValidationSummary = void 0;
|
|
4
|
+
const ValidationSummaryNative_1 = require("./ValidationSummaryNative");
|
|
5
|
+
exports.ValidationSummary = ValidationSummaryNative_1.ValidationSummary;
|
|
@@ -0,0 +1,64 @@
|
|
|
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.defaultProps = void 0;
|
|
7
|
+
exports.ValidationSummary = ValidationSummary;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const react_2 = require("@formkit/auto-animate/react");
|
|
11
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
12
|
+
const ValidationSummary_module_scss_1 = __importDefault(require("./ValidationSummary.module.scss"));
|
|
13
|
+
const constants_1 = require("../../components-core/constants");
|
|
14
|
+
const StackNative_1 = require("../Stack/StackNative");
|
|
15
|
+
const IconNative_1 = require("../Icon/IconNative");
|
|
16
|
+
const TextNative_1 = require("../Text/TextNative");
|
|
17
|
+
const SpaceFillerNative_1 = require("../SpaceFiller/SpaceFillerNative");
|
|
18
|
+
const ButtonNative_1 = require("../Button/ButtonNative");
|
|
19
|
+
exports.defaultProps = {
|
|
20
|
+
fieldValidationResults: constants_1.EMPTY_OBJECT,
|
|
21
|
+
generalValidationResults: constants_1.EMPTY_ARRAY,
|
|
22
|
+
};
|
|
23
|
+
function ValidationSummary({ fieldValidationResults = exports.defaultProps.fieldValidationResults, generalValidationResults = exports.defaultProps.generalValidationResults, }) {
|
|
24
|
+
const [animateContainerRef] = (0, react_2.useAutoAnimate)({ duration: 100 });
|
|
25
|
+
const groupedInvalidResults = (0, react_1.useMemo)(() => {
|
|
26
|
+
const ret = {};
|
|
27
|
+
Object.entries(fieldValidationResults).forEach(([field, validationResult]) => {
|
|
28
|
+
validationResult.validations.forEach((singleValidationResult) => {
|
|
29
|
+
if (!singleValidationResult.isValid) {
|
|
30
|
+
ret[singleValidationResult.severity] = ret[singleValidationResult.severity] || [];
|
|
31
|
+
ret[singleValidationResult.severity].push({
|
|
32
|
+
field,
|
|
33
|
+
message: singleValidationResult.invalidMessage || "",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
generalValidationResults.forEach((singleValidationResult) => {
|
|
39
|
+
ret[singleValidationResult.severity] = ret[singleValidationResult.severity] || [];
|
|
40
|
+
ret[singleValidationResult.severity].push({
|
|
41
|
+
message: singleValidationResult.invalidMessage || "",
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
return ret;
|
|
45
|
+
}, [fieldValidationResults, generalValidationResults]);
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: animateContainerRef, className: ValidationSummary_module_scss_1.default.summaryContainer, "data-validation-summary": true, children: [(0, jsx_runtime_1.jsx)(ValidationDisplay, { issues: groupedInvalidResults.warning, severity: "warning", heading: "Validation warnings" }), (0, jsx_runtime_1.jsx)(ValidationDisplay, { issues: groupedInvalidResults.error, severity: "error", heading: "Validation errors" })] }));
|
|
47
|
+
}
|
|
48
|
+
const ValidationDisplay = ({ heading, issues = constants_1.EMPTY_ARRAY, severity = "error", onClose, }) => {
|
|
49
|
+
const [animateContainerRef] = (0, react_2.useAutoAnimate)({ duration: 100 });
|
|
50
|
+
if (issues.length === 0) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(ValidationSummary_module_scss_1.default.validationContainer, {
|
|
54
|
+
[ValidationSummary_module_scss_1.default.valid]: severity === "valid",
|
|
55
|
+
[ValidationSummary_module_scss_1.default.info]: severity === "info",
|
|
56
|
+
[ValidationSummary_module_scss_1.default.warning]: severity === "warning",
|
|
57
|
+
[ValidationSummary_module_scss_1.default.error]: severity === "error",
|
|
58
|
+
}), style: { paddingTop: !onClose ? "0.5rem" : undefined }, "data-validation-display-severity": severity, children: [(0, jsx_runtime_1.jsxs)(StackNative_1.Stack, { orientation: "horizontal", verticalAlignment: "center", style: { gap: "0.5rem" }, children: [(0, jsx_runtime_1.jsx)(IconNative_1.Icon, { className: ValidationSummary_module_scss_1.default.heading, name: severity, size: "md" }), (0, jsx_runtime_1.jsx)("div", { className: ValidationSummary_module_scss_1.default.heading, children: (0, jsx_runtime_1.jsx)(TextNative_1.Text, { children: heading }) }), !!onClose && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SpaceFillerNative_1.SpaceFiller, {}), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: onClose, variant: "ghost", themeColor: "secondary", icon: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "close", size: "sm" }), orientation: "vertical" })] }))] }), (0, jsx_runtime_1.jsx)("ul", { ref: animateContainerRef, children: issues.map((issue, i) => ((0, jsx_runtime_1.jsx)(ValidationEntry, { issue: issue }, i))) })] }));
|
|
59
|
+
};
|
|
60
|
+
// --- ValidationEntry
|
|
61
|
+
const ValidationEntry = ({ issue }) => {
|
|
62
|
+
const { field, message } = issue;
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsxs)("span", { style: { display: "inline-flex", gap: field ? "0.25rem" : undefined }, children: [field && (0, jsx_runtime_1.jsx)(TextNative_1.Text, { variant: "small", fontWeight: "bold", children: `${field}:` }), (0, jsx_runtime_1.jsx)(TextNative_1.Text, { variant: "small", preserveLinebreaks: true, children: message })] }) }));
|
|
64
|
+
};
|
|
@@ -71,7 +71,8 @@ function dIndeterminate(defaultValue) {
|
|
|
71
71
|
}
|
|
72
72
|
function dLabel() {
|
|
73
73
|
return {
|
|
74
|
-
description:
|
|
74
|
+
description: "This property sets the label of the component. " +
|
|
75
|
+
"If not set, the component will not display a label.",
|
|
75
76
|
valueType: "string",
|
|
76
77
|
};
|
|
77
78
|
}
|
|
@@ -84,12 +85,13 @@ function dLabelPosition(def) {
|
|
|
84
85
|
}
|
|
85
86
|
function dLabelWidth(comp) {
|
|
86
87
|
return {
|
|
87
|
-
description: `This property sets the width of the \`${comp}
|
|
88
|
+
description: `This property sets the width of the \`${comp}\` component's label. ` +
|
|
89
|
+
"If not defined, the label's width will be determined by its content and the available space.",
|
|
88
90
|
};
|
|
89
91
|
}
|
|
90
92
|
function dLabelBreak(comp) {
|
|
91
93
|
return {
|
|
92
|
-
description: `This boolean value indicates if the \`${comp}\`
|
|
94
|
+
description: `This boolean value indicates if the \`${comp}\` label can be split into multiple ` +
|
|
93
95
|
`lines if it would overflow the available label width.`,
|
|
94
96
|
valueType: "boolean",
|
|
95
97
|
defaultValue: false,
|
|
@@ -156,7 +158,7 @@ function dComponent(description) {
|
|
|
156
158
|
}
|
|
157
159
|
function dPlaceholder() {
|
|
158
160
|
return {
|
|
159
|
-
description: `
|
|
161
|
+
description: `An optional placeholder text that is visible in the input field when its empty.`,
|
|
160
162
|
valueType: "string",
|
|
161
163
|
};
|
|
162
164
|
}
|
|
@@ -171,32 +173,33 @@ function dRequired() {
|
|
|
171
173
|
description: `Set this property to \`true\` to indicate it must have a value ` +
|
|
172
174
|
`before submitting the containing form.`,
|
|
173
175
|
valueType: "boolean",
|
|
176
|
+
defaultValue: false,
|
|
174
177
|
};
|
|
175
178
|
}
|
|
176
179
|
function dStartText() {
|
|
177
180
|
return {
|
|
178
|
-
description: `This property sets
|
|
181
|
+
description: `This property sets an optional text to appear at the start (left side when the ` +
|
|
179
182
|
`left-to-right direction is set) of the input.`,
|
|
180
183
|
valueType: "string",
|
|
181
184
|
};
|
|
182
185
|
}
|
|
183
186
|
function dStartIcon() {
|
|
184
187
|
return {
|
|
185
|
-
description: `This property sets an icon to appear at the start (left side when the ` +
|
|
188
|
+
description: `This property sets an optional icon to appear at the start (left side when the ` +
|
|
186
189
|
`left-to-right direction is set) of the input.`,
|
|
187
190
|
valueType: "string",
|
|
188
191
|
};
|
|
189
192
|
}
|
|
190
193
|
function dEndText() {
|
|
191
194
|
return {
|
|
192
|
-
description: `This property sets
|
|
195
|
+
description: `This property sets an optional text to appear on the end (right side when the ` +
|
|
193
196
|
`left-to-right direction is set) of the input.`,
|
|
194
197
|
valueType: "string",
|
|
195
198
|
};
|
|
196
199
|
}
|
|
197
200
|
function dEndIcon() {
|
|
198
201
|
return {
|
|
199
|
-
description: `This property sets an icon to appear on the end (right side when the ` +
|
|
202
|
+
description: `This property sets an optional icon to appear on the end (right side when the ` +
|
|
200
203
|
`left-to-right direction is set) of the input.`,
|
|
201
204
|
valueType: "string",
|
|
202
205
|
};
|
|
@@ -209,10 +209,6 @@ function useDevTools() {
|
|
|
209
209
|
inspectedNode: context === null || context === void 0 ? void 0 : context.inspectedNode,
|
|
210
210
|
sources: context === null || context === void 0 ? void 0 : context.sources,
|
|
211
211
|
setIsOpen: context === null || context === void 0 ? void 0 : context.setIsOpen,
|
|
212
|
-
devToolsSize: context === null || context === void 0 ? void 0 : context.devToolsSize,
|
|
213
|
-
setDevToolsSize: context === null || context === void 0 ? void 0 : context.setDevToolsSize,
|
|
214
|
-
devToolsSide: context === null || context === void 0 ? void 0 : context.devToolsSide,
|
|
215
|
-
setDevToolsSide: context === null || context === void 0 ? void 0 : context.setDevToolsSide,
|
|
216
212
|
devToolsEnabled: context === null || context === void 0 ? void 0 : context.devToolsEnabled,
|
|
217
213
|
mockApi: context === null || context === void 0 ? void 0 : context.mockApi,
|
|
218
214
|
};
|
|
@@ -50,6 +50,7 @@ const useApiInterceptorContext_1 = require("./useApiInterceptorContext");
|
|
|
50
50
|
// This React component injects the API interceptor into the application's context
|
|
51
51
|
function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBasedRouting, }) {
|
|
52
52
|
const [initialized, setInitialized] = (0, react_1.useState)(!interceptor);
|
|
53
|
+
const [interceptorWorker, setInterceptorWorker] = (0, react_1.useState)(null);
|
|
53
54
|
// --- Whenever the interceptor changes, update the provider accordingly
|
|
54
55
|
(0, react_1.useEffect)(() => {
|
|
55
56
|
if (interceptor) {
|
|
@@ -62,6 +63,7 @@ function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBased
|
|
|
62
63
|
const { createApiInterceptorWorker } = yield Promise.resolve().then(() => __importStar(require("./apiInterceptorWorker")));
|
|
63
64
|
if (interceptor) {
|
|
64
65
|
interceptorWorker = yield createApiInterceptorWorker(interceptor, apiWorker);
|
|
66
|
+
setInterceptorWorker(interceptorWorker);
|
|
65
67
|
// if the apiWorker comes from the outside, we don't handle the lifecycle here
|
|
66
68
|
if (!apiWorker) {
|
|
67
69
|
const workerFileLocation = (0, misc_1.normalizePath)(process.env.VITE_MOCK_WORKER_LOCATION || "mockServiceWorker.js");
|
|
@@ -87,8 +89,10 @@ function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBased
|
|
|
87
89
|
}, [apiWorker, interceptor, useHashBasedRouting]);
|
|
88
90
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
89
91
|
return {
|
|
92
|
+
interceptorWorker,
|
|
93
|
+
initialized: initialized,
|
|
90
94
|
isMocked: (url) => interceptor !== undefined && !!process.env.VITE_MOCK_ENABLED,
|
|
91
95
|
};
|
|
92
|
-
}, [interceptor]);
|
|
93
|
-
return ((0, jsx_runtime_1.jsx)(useApiInterceptorContext_1.ApiInterceptorContext.Provider, { value: contextValue, children:
|
|
96
|
+
}, [interceptorWorker, initialized, interceptor]);
|
|
97
|
+
return ((0, jsx_runtime_1.jsx)(useApiInterceptorContext_1.ApiInterceptorContext.Provider, { value: contextValue, children: children }));
|
|
94
98
|
}
|
|
@@ -275,7 +275,7 @@ function DataLoader({ loader, state, registerComponentApi, onLoaded, onError, lo
|
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
const errorMessage = (0, extractParam_1.extractParam)(Object.assign(Object.assign({}, stateRef.current.state), { $error: error }), loader.props.errorNotificationMessage, stateRef.current.appContext);
|
|
278
|
+
const errorMessage = (0, extractParam_1.extractParam)(Object.assign(Object.assign({}, stateRef.current.state), { $error: error === null || error === void 0 ? void 0 : error.toString() }), loader.props.errorNotificationMessage, stateRef.current.appContext);
|
|
279
279
|
if (errorMessage) {
|
|
280
280
|
react_hot_toast_1.default.error(errorMessage, {
|
|
281
281
|
id: loadingToastIdRef.current,
|
|
@@ -16,18 +16,22 @@ const immer_1 = require("immer");
|
|
|
16
16
|
const extractParam_1 = require("../utils/extractParam");
|
|
17
17
|
const AppContext_1 = require("../AppContext");
|
|
18
18
|
const hooks_1 = require("../utils/hooks");
|
|
19
|
+
const useApiInterceptorContext_1 = require("../interception/useApiInterceptorContext");
|
|
19
20
|
function Loader({ state, loader, loaderFn, queryId, pollIntervalInSeconds, registerComponentApi, onLoaded, loaderLoaded, loaderInProgressChanged, loaderIsRefetchingChanged, loaderError, transformResult, structuralSharing = true }) {
|
|
20
21
|
const { uid } = loader;
|
|
21
22
|
const appContext = (0, AppContext_1.useAppContext)();
|
|
23
|
+
const { initialized } = (0, useApiInterceptorContext_1.useApiInterceptorContext)();
|
|
22
24
|
// --- Rely on react-query to decide when data fetching should use the cache or when is should fetch the data from
|
|
23
25
|
// --- its data source.
|
|
24
26
|
// --- data: The data obtained by the query
|
|
25
27
|
// --- status: Query execution status
|
|
26
28
|
// --- error: Error information about the current query error (in "error" state)
|
|
27
29
|
// --- refetch: The function that can be used to re-fetch the data (because of data/state changes)
|
|
28
|
-
const { data, status, isFetching, error, refetch, isRefetching } = (0, react_query_1.useQuery)({
|
|
30
|
+
const { data, status, isFetching, isLoading, error, refetch, isRefetching } = (0, react_query_1.useQuery)({
|
|
29
31
|
queryKey: (0, react_1.useMemo)(() => (queryId ? queryId : [uid, (0, extractParam_1.extractParam)(state, loader.props, appContext)]), [appContext, loader.props, queryId, state, uid]),
|
|
30
32
|
structuralSharing,
|
|
33
|
+
//we pause the loaders if the apiInterceptor is not initialized (true when the app is not using mockApi)
|
|
34
|
+
enabled: initialized,
|
|
31
35
|
queryFn: (0, react_1.useCallback)((_a) => __awaiter(this, [_a], void 0, function* ({ signal }) {
|
|
32
36
|
// console.log("[Loader queryFn] Starting to fetch data...");
|
|
33
37
|
try {
|
|
@@ -77,8 +81,8 @@ function Loader({ state, loader, loaderFn, queryId, pollIntervalInSeconds, regis
|
|
|
77
81
|
const prevData = (0, hooks_1.usePrevious)(data);
|
|
78
82
|
const prevError = (0, hooks_1.usePrevious)(error);
|
|
79
83
|
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
80
|
-
loaderInProgressChanged(isFetching);
|
|
81
|
-
}, [isFetching, loaderInProgressChanged]);
|
|
84
|
+
loaderInProgressChanged(isFetching || isLoading);
|
|
85
|
+
}, [isLoading, isFetching, loaderInProgressChanged]);
|
|
82
86
|
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
83
87
|
loaderIsRefetchingChanged(isRefetching);
|
|
84
88
|
}, [isRefetching, loaderIsRefetchingChanged]);
|
|
@@ -6,17 +6,18 @@ exports.palette = {
|
|
|
6
6
|
$colorSurface50: "$color-surface-50",
|
|
7
7
|
$colorSurface100: "$color-surface-100",
|
|
8
8
|
$colorSurface200: "$color-surface-200",
|
|
9
|
-
$
|
|
9
|
+
$colorSurface200A70: "rgb(from $color-surface-200 r g b / 0.7)",
|
|
10
|
+
$colorSurface200A80: "rgb(from $color-surface-200 r g b / 0.8)",
|
|
10
11
|
$colorSurface300: "$color-surface-300",
|
|
11
|
-
$colorSurface400A80: "
|
|
12
|
+
$colorSurface400A80: "rgb(from $color-surface-400 r g b / 0.8)",
|
|
12
13
|
$colorSurface400: "$color-surface-400",
|
|
13
14
|
$colorSurface500: "$color-surface-500",
|
|
14
15
|
$colorSurface500A80: "rgba($color-surface-500, .8)",
|
|
15
16
|
$colorSurface500A60: "rgba($color-surface-500, .6)",
|
|
16
17
|
$colorSurface600: "$color-surface-600",
|
|
17
18
|
$colorSurface700: "$color-surface-700",
|
|
18
|
-
$colorSurface700A30: "
|
|
19
|
-
$colorSurface700A90: "
|
|
19
|
+
$colorSurface700A30: "rgb(from $color-surface-700 r g b / 0.3)",
|
|
20
|
+
$colorSurface700A90: "rgb(from $color-surface-700 r g b / 0.9)",
|
|
20
21
|
$colorSurface800: "$color-surface-800",
|
|
21
22
|
$colorSurface900: "$color-surface-900",
|
|
22
23
|
$colorSurface950: "$color-surface-950",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RootThemeDefinition = void 0;
|
|
4
4
|
const palette_1 = require("./palette");
|
|
5
|
-
const { $colorSurface0, $colorSurface50, $colorSurface100, $colorSurface200, $colorSurface300, $colorSurface400, $colorSurface500, $colorSurface500A80, $colorSurface500A60, $colorSurface600, $colorSurface700, $colorSurface800, $colorSurface900, $colorSurface950, $colorPrimary50, $colorPrimary950, $colorWarn700, $colorDanger400, $colorDanger500, $colorDanger600, $colorDanger700, $colorSuccess600, $colorInfo600, $colorInfo800, } = palette_1.palette;
|
|
5
|
+
const { $colorSurface0, $colorSurface50, $colorSurface100, $colorSurface200A80, $colorSurface200A70, $colorSurface200, $colorSurface300, $colorSurface400, $colorSurface500, $colorSurface500A80, $colorSurface500A60, $colorSurface600, $colorSurface700, $colorSurface800, $colorSurface900, $colorSurface950, $colorPrimary50, $colorPrimary950, $colorWarn700, $colorDanger400, $colorDanger500, $colorDanger600, $colorDanger700, $colorSuccess600, $colorInfo600, $colorInfo800, } = palette_1.palette;
|
|
6
6
|
// --- This theme contains the application-bound base theme variables and their default values.
|
|
7
7
|
// --- Individual controls also add their component-specific default theme variable values.
|
|
8
8
|
exports.RootThemeDefinition = {
|
|
@@ -147,7 +147,7 @@ exports.RootThemeDefinition = {
|
|
|
147
147
|
"maxWidth-large-desktop": "1400px",
|
|
148
148
|
// --- The app's default radius value
|
|
149
149
|
borderRadius: "4px",
|
|
150
|
-
"outlineColor--focus": "
|
|
150
|
+
"outlineColor--focus": "rgb(from $color-primary-500 r g b / 0.5)",
|
|
151
151
|
"outlineWidth--focus": "2px",
|
|
152
152
|
"outlineStyle--focus": "solid",
|
|
153
153
|
"outlineOffset--focus": "0",
|
|
@@ -160,6 +160,7 @@ exports.RootThemeDefinition = {
|
|
|
160
160
|
"fontSize-medium": "1.25rem",
|
|
161
161
|
"fontSize-normal": "1rem",
|
|
162
162
|
"fontSize-small": "0.875rem",
|
|
163
|
+
"fontSize-code": "0.75rem",
|
|
163
164
|
"fontSize-smaller": "0.75rem",
|
|
164
165
|
"fontSize-tiny": "0.625rem",
|
|
165
166
|
// --- The default font size
|
|
@@ -201,8 +202,8 @@ exports.RootThemeDefinition = {
|
|
|
201
202
|
"backgroundColor-dropdown-item--active-hover": $colorSurface50,
|
|
202
203
|
"backgroundColor-tree-row--selected--before": $colorPrimary50,
|
|
203
204
|
// --- Border colors
|
|
204
|
-
"borderColor": $
|
|
205
|
-
"borderColor--disabled": $
|
|
205
|
+
"borderColor": "rgb(from $color-surface-900 r g b / 0.1)",
|
|
206
|
+
"borderColor--disabled": $colorSurface100,
|
|
206
207
|
// --- Text colors
|
|
207
208
|
"textColor-secondary": $colorSurface600,
|
|
208
209
|
// --- Input is an abstract component, so we define its default theme variables here
|
|
@@ -35,8 +35,7 @@ function generateBaseTones(theme) {
|
|
|
35
35
|
return {};
|
|
36
36
|
}
|
|
37
37
|
const resolvedTheme = resolveThemeVars(theme);
|
|
38
|
-
|
|
39
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({}, colorTones), generateRbgChannelsForTone("color-surface", Object.assign(Object.assign({}, resolvedTheme), colorTones))), generateRbgChannelsForTone("color-primary", Object.assign(Object.assign({}, resolvedTheme), colorTones))), generateRbgChannelsForTone("color-secondary", Object.assign(Object.assign({}, resolvedTheme), colorTones)));
|
|
38
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, generateBaseTonesForColor("color-primary", resolvedTheme)), generateBaseTonesForColor("color-secondary", resolvedTheme)), generateBaseTonesForColor("color-info", resolvedTheme)), generateBaseTonesForColor("color-success", resolvedTheme)), generateBaseTonesForColor("color-warn", resolvedTheme)), generateBaseTonesForColor("color-danger", resolvedTheme)), generateBaseTonesForColor("color-surface", resolvedTheme, { distributeEven: true }));
|
|
40
39
|
}
|
|
41
40
|
function generateBaseSpacings(theme) {
|
|
42
41
|
if (!theme) {
|
|
@@ -688,21 +687,6 @@ function generateBaseTonesForColor(varName, theme, options = { distributeEven: f
|
|
|
688
687
|
return {};
|
|
689
688
|
}
|
|
690
689
|
}
|
|
691
|
-
function generateRbgChannelsForTone(varName, theme) {
|
|
692
|
-
return {
|
|
693
|
-
[`${varName}-50-rgb`]: getRgbChannelsString(theme[`${varName}-50`]),
|
|
694
|
-
[`${varName}-100-rgb`]: getRgbChannelsString(theme[`${varName}-100`]),
|
|
695
|
-
[`${varName}-200-rgb`]: getRgbChannelsString(theme[`${varName}-200`]),
|
|
696
|
-
[`${varName}-300-rgb`]: getRgbChannelsString(theme[`${varName}-300`]),
|
|
697
|
-
[`${varName}-400-rgb`]: getRgbChannelsString(theme[`${varName}-400`]),
|
|
698
|
-
[`${varName}-500-rgb`]: getRgbChannelsString(theme[`${varName}-500`]),
|
|
699
|
-
[`${varName}-600-rgb`]: getRgbChannelsString(theme[`${varName}-600`]),
|
|
700
|
-
[`${varName}-700-rgb`]: getRgbChannelsString(theme[`${varName}-700`]),
|
|
701
|
-
[`${varName}-800-rgb`]: getRgbChannelsString(theme[`${varName}-800`]),
|
|
702
|
-
[`${varName}-900-rgb`]: getRgbChannelsString(theme[`${varName}-900`]),
|
|
703
|
-
[`${varName}-950-rgb`]: getRgbChannelsString(theme[`${varName}-950`]),
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
690
|
function mapTones(baseColor, mapper) {
|
|
707
691
|
const tones = generateTones(baseColor);
|
|
708
692
|
if (!tones) {
|