xmlui 0.10.10 → 0.10.12
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/{metadata/apiInterceptorWorker-Bb5-fQup.mjs → lib/apiInterceptorWorker-DPgtUtdA.mjs} +5870 -3195
- package/dist/lib/index-CDOoBf2R.mjs +49626 -0
- package/dist/lib/index.css +1 -1
- package/dist/lib/initMock-BAV9RKui.mjs +843 -0
- package/dist/lib/language-server-web-worker.mjs +8 -7
- package/dist/lib/language-server.mjs +6 -6
- package/dist/lib/{metadata-utils-gIOZMGG7.mjs → metadata-utils-D90qqMGc.mjs} +159 -114
- package/dist/lib/scss/components-core/theming/_themes.scss +6 -7
- package/dist/lib/{server-common-BfCSNpXG.mjs → server-common-lmBDLpUh.mjs} +14848 -10785
- package/dist/lib/syntax-monaco.mjs +14 -11
- package/dist/lib/syntax-textmate.d.ts +2 -2
- package/dist/lib/syntax-textmate.mjs +128 -109
- package/dist/lib/transform-bHBjkKSL.mjs +7376 -0
- package/dist/lib/xmlui-parser.d.ts +17 -8
- package/dist/lib/xmlui-parser.mjs +49 -49
- package/dist/lib/xmlui-serializer-DB6BLiXK.mjs +667 -0
- package/dist/lib/xmlui.d.ts +5 -2
- package/dist/lib/xmlui.mjs +43 -43
- package/dist/{lib/apiInterceptorWorker-DH8wqOVq.mjs → metadata/apiInterceptorWorker-BmKP8bnq.mjs} +5432 -3502
- package/dist/metadata/collectedComponentMetadata-Dp8BqWQO.mjs +55444 -0
- package/dist/metadata/initMock-BvEO8W8r.mjs +843 -0
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +3 -3
- package/dist/metadata/xmlui-metadata.umd.js +207 -419
- package/dist/scripts/package.json +3 -1
- package/dist/scripts/src/components/APICall/APICall.js +4 -4
- package/dist/scripts/src/components/Accordion/Accordion.js +1 -1
- package/dist/scripts/src/components/Animation/AnimationNative.js +259 -0
- package/dist/scripts/src/components/App/App.js +10 -0
- package/dist/scripts/src/components/App/AppNative.js +23 -2
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +1 -1
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +6 -2
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +11 -7
- package/dist/scripts/src/components/Avatar/Avatar.js +1 -1
- package/dist/scripts/src/components/Button/Button.js +1 -1
- package/dist/scripts/src/components/Charts/AreaChart/AreaChart.js +92 -0
- package/dist/scripts/src/components/Charts/AreaChart/AreaChartNative.js +127 -0
- package/dist/scripts/src/components/Charts/BarChart/BarChart.js +6 -6
- package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +110 -96
- package/dist/scripts/src/components/Charts/LineChart/LineChart.js +5 -5
- package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +14 -4
- package/dist/scripts/src/components/Charts/RadarChart/RadarChart.js +92 -0
- package/dist/scripts/src/components/Charts/RadarChart/RadarChartNative.js +125 -0
- package/dist/scripts/src/components/Checkbox/Checkbox.js +2 -1
- package/dist/scripts/src/components/ComponentProvider.js +4 -2
- package/dist/scripts/src/components/DataSource/DataSource.js +124 -0
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/scripts/src/components/Footer/Footer.js +1 -1
- package/dist/scripts/src/components/Footer/FooterNative.js +1 -1
- package/dist/scripts/src/components/Form/FormNative.js +5 -3
- package/dist/scripts/src/components/FormItem/FormItem.js +1 -1
- package/dist/scripts/src/components/FormItem/FormItemNative.js +0 -9
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +3 -3
- package/dist/scripts/src/components/Heading/Heading.js +83 -28
- package/dist/scripts/src/components/Heading/HeadingNative.js +10 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +1 -1
- package/dist/scripts/src/components/Icon/IconNative.js +24 -6
- package/dist/scripts/src/components/Image/ImageNative.js +13 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +8 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +5 -3
- package/dist/scripts/src/components/NavLink/NavLink.js +1 -1
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +208 -78
- package/dist/scripts/src/components/Option/Option.js +2 -2
- package/dist/scripts/src/components/Option/OptionNative.js +12 -1
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +7 -3
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +20 -5
- package/dist/scripts/src/components/RadioGroup/RadioItemNative.js +2 -1
- package/dist/scripts/src/components/Select/Select.js +1 -1
- package/dist/scripts/src/components/Select/SelectNative.js +1 -1
- package/dist/scripts/src/components/Spinner/SpinnerNative.js +3 -2
- package/dist/scripts/src/components/Switch/Switch.js +2 -1
- package/dist/scripts/src/components/Table/Table.js +1 -1
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +1 -1
- package/dist/scripts/src/components/Text/Text.js +32 -14
- package/dist/scripts/src/components/Text/TextNative.js +17 -5
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +1 -1
- package/dist/scripts/src/components/Toggle/Toggle.js +2 -2
- package/dist/scripts/src/components/abstractions.js +2 -1
- package/dist/scripts/src/components/collectedComponentMetadata.js +316 -0
- package/dist/scripts/src/components-core/RestApiProxy.js +3 -1
- package/dist/scripts/src/components-core/StandaloneApp.js +823 -0
- package/dist/scripts/src/components-core/markup-check.js +279 -0
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +36 -16
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +4 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +4 -1
- package/dist/scripts/src/components-core/theming/themes/root.js +30 -17
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +14 -7
- package/dist/scripts/src/components-core/xmlui-parser.js +60 -43
- package/dist/scripts/src/index.js +120 -0
- package/dist/scripts/src/parsers/xmlui-parser/syntax-kind.js +9 -0
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +17 -5
- package/dist/standalone/xmlui-standalone.es.d.ts +6 -2
- package/dist/standalone/xmlui-standalone.umd.js +319 -823
- package/package.json +3 -1
- package/src/syntax/textMate/xmlui.tmLanguage.json +2 -2
- package/dist/lib/index-C71PAj7E.mjs +0 -38677
- package/dist/lib/initMock-Bvbl2Pa3.mjs +0 -571
- package/dist/lib/transform-SMWeyMoq.mjs +0 -5391
- package/dist/lib/xmlui-serializer-a0O0jFY-.mjs +0 -497
- package/dist/metadata/collectedComponentMetadata-Dn91__HO.mjs +0 -43087
- package/dist/metadata/initMock-ghNfStAu.mjs +0 -571
- package/dist/scripts/src/components/NumberBox/NumberBox2.js +0 -99
- package/dist/scripts/src/components/NumberBox/NumberBox2Native.js +0 -420
|
@@ -0,0 +1,125 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.defaultProps = void 0;
|
|
37
|
+
exports.RadarChart = RadarChart;
|
|
38
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
const recharts_1 = require("recharts");
|
|
40
|
+
const react_1 = require("react");
|
|
41
|
+
const react_2 = require("react");
|
|
42
|
+
const ChartProvider_1 = __importStar(require("../utils/ChartProvider"));
|
|
43
|
+
const TooltipContent_1 = require("../Tooltip/TooltipContent");
|
|
44
|
+
const ThemeContext_1 = require("../../../components-core/theming/ThemeContext");
|
|
45
|
+
exports.defaultProps = {
|
|
46
|
+
hideGrid: false,
|
|
47
|
+
hideAngleAxis: false,
|
|
48
|
+
hideRadiusAxis: false,
|
|
49
|
+
hideTooltip: false,
|
|
50
|
+
showLegend: false,
|
|
51
|
+
filled: true,
|
|
52
|
+
strokeWidth: 2,
|
|
53
|
+
fillOpacity: 0.3,
|
|
54
|
+
};
|
|
55
|
+
function RadarChart({ data = [], nameKey, dataKeys = [], hideGrid = exports.defaultProps.hideGrid, hideAngleAxis = exports.defaultProps.hideAngleAxis, hideRadiusAxis = exports.defaultProps.hideRadiusAxis, hideTooltip = exports.defaultProps.hideTooltip, className, children, showLegend = exports.defaultProps.showLegend, filled = exports.defaultProps.filled, strokeWidth = exports.defaultProps.strokeWidth, fillOpacity = exports.defaultProps.fillOpacity, tooltipRenderer, }) {
|
|
56
|
+
// Validate and normalize data
|
|
57
|
+
const validData = Array.isArray(data) ? data : [];
|
|
58
|
+
const { getThemeVar } = (0, ThemeContext_1.useTheme)();
|
|
59
|
+
const colorValues = (0, react_2.useMemo)(() => {
|
|
60
|
+
return [
|
|
61
|
+
getThemeVar("color-primary-500"),
|
|
62
|
+
getThemeVar("color-primary-300"),
|
|
63
|
+
getThemeVar("color-success-500"),
|
|
64
|
+
getThemeVar("color-success-300"),
|
|
65
|
+
getThemeVar("color-warn-500"),
|
|
66
|
+
getThemeVar("color-warn-300"),
|
|
67
|
+
getThemeVar("color-danger-500"),
|
|
68
|
+
getThemeVar("color-danger-300"),
|
|
69
|
+
getThemeVar("color-info-500"),
|
|
70
|
+
getThemeVar("color-info-300"),
|
|
71
|
+
getThemeVar("color-secondary-500"),
|
|
72
|
+
getThemeVar("color-secondary-300"),
|
|
73
|
+
];
|
|
74
|
+
}, [getThemeVar]);
|
|
75
|
+
const config = (0, react_2.useMemo)(() => {
|
|
76
|
+
return Object.assign({}, ...dataKeys.map((key, index) => {
|
|
77
|
+
return {
|
|
78
|
+
[key]: {
|
|
79
|
+
label: key,
|
|
80
|
+
color: colorValues[index % colorValues.length],
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}));
|
|
84
|
+
}, [colorValues, dataKeys]);
|
|
85
|
+
const chartContextValue = (0, ChartProvider_1.useChartContextValue)({ dataKeys, nameKey });
|
|
86
|
+
// Process data and create radar elements based on dataKeys
|
|
87
|
+
const radarElements = (0, react_2.useMemo)(() => {
|
|
88
|
+
return dataKeys.map((key, index) => {
|
|
89
|
+
const color = colorValues[index % colorValues.length];
|
|
90
|
+
return ((0, jsx_runtime_1.jsx)(recharts_1.Radar, { name: key, dataKey: key, stroke: color, fill: filled ? color : "none", fillOpacity: filled ? fillOpacity : 0, strokeWidth: strokeWidth }, key));
|
|
91
|
+
});
|
|
92
|
+
}, [dataKeys, colorValues, filled, fillOpacity, strokeWidth]);
|
|
93
|
+
// Handle responsive behavior
|
|
94
|
+
const [containerSize, setContainerSize] = (0, react_1.useState)({ width: 0, height: 0 });
|
|
95
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
96
|
+
(0, react_1.useEffect)(() => {
|
|
97
|
+
const updateSize = () => {
|
|
98
|
+
if (containerRef.current) {
|
|
99
|
+
const { width, height } = containerRef.current.getBoundingClientRect();
|
|
100
|
+
setContainerSize({ width, height });
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
updateSize();
|
|
104
|
+
window.addEventListener('resize', updateSize);
|
|
105
|
+
return () => window.removeEventListener('resize', updateSize);
|
|
106
|
+
}, []);
|
|
107
|
+
// Determine if we're in mini mode (very small container)
|
|
108
|
+
const isMiniMode = containerSize.height < 150;
|
|
109
|
+
const safeTooltipRenderer = (0, react_1.useCallback)((props) => {
|
|
110
|
+
if (!tooltipRenderer)
|
|
111
|
+
return (0, jsx_runtime_1.jsx)(TooltipContent_1.TooltipContent, Object.assign({}, props));
|
|
112
|
+
const payloadObject = {};
|
|
113
|
+
if (props.payload && props.payload.length > 0 && props.payload[0].payload) {
|
|
114
|
+
Object.assign(payloadObject, props.payload[0].payload);
|
|
115
|
+
}
|
|
116
|
+
// Extract tooltip data from Recharts props
|
|
117
|
+
const tooltipData = {
|
|
118
|
+
label: props.label,
|
|
119
|
+
payload: payloadObject,
|
|
120
|
+
active: props.active,
|
|
121
|
+
};
|
|
122
|
+
return tooltipRenderer(tooltipData);
|
|
123
|
+
}, [tooltipRenderer]);
|
|
124
|
+
return ((0, jsx_runtime_1.jsx)(ChartProvider_1.default, { value: chartContextValue, children: (0, jsx_runtime_1.jsx)("div", { ref: containerRef, className: className, children: (0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: "100%", children: (0, jsx_runtime_1.jsxs)(recharts_1.RadarChart, { data: validData, children: [!hideGrid && (0, jsx_runtime_1.jsx)(recharts_1.PolarGrid, {}), !hideAngleAxis && ((0, jsx_runtime_1.jsx)(recharts_1.PolarAngleAxis, { dataKey: nameKey, hide: isMiniMode })), !hideRadiusAxis && ((0, jsx_runtime_1.jsx)(recharts_1.PolarRadiusAxis, { hide: isMiniMode })), !isMiniMode && !hideTooltip && ((0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { content: safeTooltipRenderer })), showLegend && !isMiniMode && (0, jsx_runtime_1.jsx)(recharts_1.Legend, {}), radarElements, children] }) }) }) }));
|
|
125
|
+
}
|
|
@@ -44,6 +44,7 @@ exports.CheckboxMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
44
44
|
},
|
|
45
45
|
childrenAsTemplate: "inputTemplate",
|
|
46
46
|
events: {
|
|
47
|
+
click: (0, metadata_helpers_1.dClick)(COMP),
|
|
47
48
|
gotFocus: (0, metadata_helpers_1.dGotFocus)(COMP),
|
|
48
49
|
lostFocus: (0, metadata_helpers_1.dLostFocus)(COMP),
|
|
49
50
|
didChange: (0, metadata_helpers_1.dDidChange)(COMP),
|
|
@@ -80,5 +81,5 @@ exports.checkboxComponentRenderer = (0, renderers_1.createComponentRenderer)(COM
|
|
|
80
81
|
const inputTemplate = node.props.inputTemplate;
|
|
81
82
|
return ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, { inputRenderer: inputTemplate
|
|
82
83
|
? (contextVars) => ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { contextVars: contextVars, node: inputTemplate, renderChild: renderChild, layoutContext: layoutContext }))
|
|
83
|
-
: undefined, enabled: extractValue.asOptionalBoolean(node.props.enabled), className: className, initialValue: extractValue.asOptionalBoolean(node.props.initialValue, exports.defaultProps.initialValue), value: state === null || state === void 0 ? void 0 : state.value, readOnly: extractValue.asOptionalBoolean(node.props.readOnly), validationStatus: extractValue(node.props.validationStatus), updateState: updateState, onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required), indeterminate: extractValue.asOptionalBoolean(node.props.indeterminate), registerComponentApi: registerComponentApi, autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus) }));
|
|
84
|
+
: undefined, enabled: extractValue.asOptionalBoolean(node.props.enabled), className: className, initialValue: extractValue.asOptionalBoolean(node.props.initialValue, exports.defaultProps.initialValue), value: state === null || state === void 0 ? void 0 : state.value, readOnly: extractValue.asOptionalBoolean(node.props.readOnly), validationStatus: extractValue(node.props.validationStatus), updateState: updateState, onClick: lookupEventHandler("click"), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required), indeterminate: extractValue.asOptionalBoolean(node.props.indeterminate), registerComponentApi: registerComponentApi, autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus) }));
|
|
84
85
|
});
|
|
@@ -45,7 +45,6 @@ const RealTimeAdapter_1 = require("./RealTimeAdapter/RealTimeAdapter");
|
|
|
45
45
|
const Form_1 = require("./Form/Form");
|
|
46
46
|
const EmojiSelector_1 = require("./EmojiSelector/EmojiSelector");
|
|
47
47
|
const NumberBox_1 = require("./NumberBox/NumberBox");
|
|
48
|
-
const NumberBox2_1 = require("./NumberBox/NumberBox2");
|
|
49
48
|
const HoverCard_1 = require("./HoverCard/HoverCard");
|
|
50
49
|
const App_1 = require("./App/App");
|
|
51
50
|
const NavPanel_1 = require("./NavPanel/NavPanel");
|
|
@@ -108,12 +107,14 @@ const InspectButton_1 = require("./InspectButton/InspectButton");
|
|
|
108
107
|
const NestedApp_1 = require("./NestedApp/NestedApp");
|
|
109
108
|
const AppWithCodeView_1 = require("./NestedApp/AppWithCodeView");
|
|
110
109
|
const CodeBlock_1 = require("./CodeBlock/CodeBlock");
|
|
110
|
+
const AreaChart_1 = require("./Charts/AreaChart/AreaChart");
|
|
111
111
|
const BarChart_1 = require("./Charts/BarChart/BarChart");
|
|
112
112
|
const DonutChart_1 = require("./Charts/DonutChart/DonutChart");
|
|
113
113
|
const LabelList_1 = require("./Charts/LabelList/LabelList");
|
|
114
114
|
const Legend_1 = require("./Charts/Legend/Legend");
|
|
115
115
|
const LineChart_1 = require("./Charts/LineChart/LineChart");
|
|
116
116
|
const PieChart_1 = require("./Charts/PieChart/PieChart");
|
|
117
|
+
const RadarChart_1 = require("./Charts/RadarChart/RadarChart");
|
|
117
118
|
const Pagination_1 = require("./Pagination/Pagination");
|
|
118
119
|
const Tooltip_1 = require("./Tooltip/Tooltip");
|
|
119
120
|
/**
|
|
@@ -377,12 +378,14 @@ class ComponentRegistry {
|
|
|
377
378
|
this.registerCoreComponent(Pagination_1.paginationComponentRenderer);
|
|
378
379
|
}
|
|
379
380
|
if (process.env.VITE_USED_COMPONENTS_Charts !== "false") {
|
|
381
|
+
this.registerCoreComponent(AreaChart_1.areaChartComponentRenderer);
|
|
380
382
|
this.registerCoreComponent(BarChart_1.barChartComponentRenderer);
|
|
381
383
|
this.registerCoreComponent(DonutChart_1.donutChartComponentRenderer);
|
|
382
384
|
this.registerCoreComponent(LabelList_1.labelListComponentRenderer);
|
|
383
385
|
this.registerCoreComponent(Legend_1.legendComponentRenderer);
|
|
384
386
|
this.registerCoreComponent(LineChart_1.lineChartComponentRenderer);
|
|
385
387
|
this.registerCoreComponent(PieChart_1.pieChartComponentRenderer);
|
|
388
|
+
this.registerCoreComponent(RadarChart_1.radarChartComponentRenderer);
|
|
386
389
|
}
|
|
387
390
|
if (process.env.VITE_USED_COMPONENTS_EmojiSelector !== "false") {
|
|
388
391
|
this.registerCoreComponent(EmojiSelector_1.emojiSelectorRenderer);
|
|
@@ -407,7 +410,6 @@ class ComponentRegistry {
|
|
|
407
410
|
this.registerCoreComponent(TextBox_1.textBoxComponentRenderer);
|
|
408
411
|
this.registerCoreComponent(TextBox_1.passwordInputComponentRenderer);
|
|
409
412
|
this.registerCoreComponent(NumberBox_1.numberBoxComponentRenderer);
|
|
410
|
-
this.registerCoreComponent(NumberBox2_1.numberBox2ComponentRenderer);
|
|
411
413
|
this.registerCoreComponent(HoverCard_1.hoverCardComponentRenderer);
|
|
412
414
|
this.registerCoreComponent(RadioGroup_1.radioGroupRenderer);
|
|
413
415
|
this.registerCoreComponent(FileInput_1.fileInputRenderer);
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataSourceMd = void 0;
|
|
4
|
+
const abstractions_1 = require("../abstractions");
|
|
5
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
6
|
+
// NOTE: Original component this is based on is the `Loader` component
|
|
7
|
+
const COMP = "DataSource";
|
|
8
|
+
exports.DataSourceMd = (0, metadata_helpers_1.createMetadata)({
|
|
9
|
+
status: "stable",
|
|
10
|
+
description: "`DataSource` fetches and caches data from API endpoints, versus " +
|
|
11
|
+
"[`APICall`](/components/APICall) which creates, updates or deletes data.",
|
|
12
|
+
props: {
|
|
13
|
+
method: {
|
|
14
|
+
description: `Set the HTTP method.`,
|
|
15
|
+
defaultValue: "get",
|
|
16
|
+
availableValues: abstractions_1.httpMethodNames,
|
|
17
|
+
},
|
|
18
|
+
id: {
|
|
19
|
+
description: `Set the ID used by other components to access the retrieved data in the \`value\`` +
|
|
20
|
+
"property of a \`DataSource\`, or status info in the \`loaded\` and \`error\` properties." +
|
|
21
|
+
"When no `id` is set, the component cannot be used programmatically.",
|
|
22
|
+
isRequired: true,
|
|
23
|
+
valueType: "string",
|
|
24
|
+
},
|
|
25
|
+
url: {
|
|
26
|
+
description: `Set the URL.`,
|
|
27
|
+
isRequired: true,
|
|
28
|
+
valueType: "string",
|
|
29
|
+
},
|
|
30
|
+
body: {
|
|
31
|
+
description: `Set the optional request body. The object you pass is serialized as a JSON string.`,
|
|
32
|
+
valueType: "any",
|
|
33
|
+
},
|
|
34
|
+
rawBody: {
|
|
35
|
+
description: `Set the request body with no serialization. Use it to send a payload ` +
|
|
36
|
+
`that has already been serialized to a JSON string.`,
|
|
37
|
+
valueType: "string",
|
|
38
|
+
},
|
|
39
|
+
queryParams: {
|
|
40
|
+
description: `Append optional key-value pairs to the URL.`,
|
|
41
|
+
valueType: "any",
|
|
42
|
+
},
|
|
43
|
+
headers: {
|
|
44
|
+
description: `Set request headers. Pass an object whose keys are header names and values are header values.`,
|
|
45
|
+
valueType: "any",
|
|
46
|
+
},
|
|
47
|
+
pollIntervalInSeconds: {
|
|
48
|
+
description: "Set the interval for periodic data fetching. If the data changes on refresh, " +
|
|
49
|
+
"XMLUI will re-render components that refer directly or indirectly to the \`DataSource\`. " +
|
|
50
|
+
"If not set or set to zero, the component does not poll for data.",
|
|
51
|
+
valueType: "number",
|
|
52
|
+
},
|
|
53
|
+
inProgressNotificationMessage: {
|
|
54
|
+
description: "Set the message to display when the data fetch is in progress. " +
|
|
55
|
+
"If the property value is not set, no progress message is displayed.",
|
|
56
|
+
valueType: "string",
|
|
57
|
+
},
|
|
58
|
+
completedNotificationMessage: {
|
|
59
|
+
description: "Set the message to display when the data fetch completes." +
|
|
60
|
+
"If the property value is not set, no completion message is displayed.",
|
|
61
|
+
valueType: "string",
|
|
62
|
+
},
|
|
63
|
+
errorNotificationMessage: {
|
|
64
|
+
description: "Set the message to display when the there is an error. " +
|
|
65
|
+
"You can use the `$error` context value in an expression to " +
|
|
66
|
+
"refer to the original error message.",
|
|
67
|
+
valueType: "string",
|
|
68
|
+
},
|
|
69
|
+
resultSelector: {
|
|
70
|
+
description: "Set an optional object key to extract a subset of the response data. If this " +
|
|
71
|
+
"value is not set, the entire response body is considered the result.",
|
|
72
|
+
valueType: "string",
|
|
73
|
+
},
|
|
74
|
+
transformResult: {
|
|
75
|
+
description: "Set an optional function to perform a final transformation of the " +
|
|
76
|
+
"response data. If this value is not set, the result is not transformed.",
|
|
77
|
+
},
|
|
78
|
+
prevPageSelector: {
|
|
79
|
+
description: `When using \`${COMP}\` with paging, the response may contain information about the ` +
|
|
80
|
+
`previous and next page. This property defines the selector that extracts the ` +
|
|
81
|
+
`previous page information from the response deserialized to an object.`,
|
|
82
|
+
},
|
|
83
|
+
nextPageSelector: {
|
|
84
|
+
description: `When using \`${COMP}\` with paging, the response may contain information about ` +
|
|
85
|
+
`the previous and next page. This property defines the selector that extracts ` +
|
|
86
|
+
`the next page information from the response deserialized to an object.`,
|
|
87
|
+
},
|
|
88
|
+
structuralSharing: {
|
|
89
|
+
description: "This property allows structural sharing. When turned on, `DataSource` will keep " +
|
|
90
|
+
"the original reference if nothing has changed in the data. If a subset has " +
|
|
91
|
+
"changed, `DataSource` will keep the unchanged parts and only replace the changed " +
|
|
92
|
+
"parts. If you do not need this behavior, set this property to `false`.",
|
|
93
|
+
defaultValue: "true",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
events: {
|
|
97
|
+
loaded: (0, metadata_helpers_1.d)("The component triggers this event when the fetch operation has been completed " +
|
|
98
|
+
"and the data is loaded. The event has two arguments. The first is the data " +
|
|
99
|
+
"loaded; the second indicates if the event is a result of a refetch."),
|
|
100
|
+
error: (0, metadata_helpers_1.d)(`This event fires when a request results in an error.`),
|
|
101
|
+
},
|
|
102
|
+
apis: {
|
|
103
|
+
value: {
|
|
104
|
+
description: `This property retrieves the data queried from the source after optional transformations.`,
|
|
105
|
+
signature: "get value(): any",
|
|
106
|
+
},
|
|
107
|
+
inProgress: {
|
|
108
|
+
description: "This property indicates if the data is being fetched.",
|
|
109
|
+
signature: "get inProgress(): boolean",
|
|
110
|
+
},
|
|
111
|
+
isRefetching: {
|
|
112
|
+
description: "This property indicates if the data is being re-fetched.",
|
|
113
|
+
signature: "get isRefetching(): boolean",
|
|
114
|
+
},
|
|
115
|
+
loaded: {
|
|
116
|
+
description: "This property indicates if the data has been loaded.",
|
|
117
|
+
signature: "get loaded(): boolean",
|
|
118
|
+
},
|
|
119
|
+
refetch: {
|
|
120
|
+
description: "This method requests the re-fetch of the data.",
|
|
121
|
+
signature: "refetch(): void",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
});
|
|
@@ -130,7 +130,7 @@ exports.MenuItemMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
130
130
|
[`color-${MICOMP}`]: "$textColor-primary",
|
|
131
131
|
[`color-${MICOMP}--disabled`]: "$textColor--disabled",
|
|
132
132
|
[`fontFamily-${MICOMP}`]: "$fontFamily",
|
|
133
|
-
[`fontSize-${MICOMP}`]: "$fontSize-
|
|
133
|
+
[`fontSize-${MICOMP}`]: "$fontSize-sm",
|
|
134
134
|
[`paddingVertical-${MICOMP}`]: "$space-2",
|
|
135
135
|
[`paddingHorizontal-${MICOMP}`]: "$space-3",
|
|
136
136
|
[`backgroundColor-${MICOMP}--hover`]: "$backgroundColor-dropdown-item--hover",
|
|
@@ -22,7 +22,7 @@ exports.FooterMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
22
22
|
defaultThemeVars: {
|
|
23
23
|
[`backgroundColor-${COMP}`]: "$backgroundColor-AppHeader",
|
|
24
24
|
[`verticalAlignment-${COMP}`]: "center",
|
|
25
|
-
[`fontSize-${COMP}`]: "$fontSize-
|
|
25
|
+
[`fontSize-${COMP}`]: "$fontSize-sm",
|
|
26
26
|
[`textColor-${COMP}`]: "$textColor-secondary",
|
|
27
27
|
[`maxWidth-content-${COMP}`]: "$maxWidth-content",
|
|
28
28
|
[`borderTop-${COMP}`]: `1px solid $borderColor`,
|
|
@@ -29,7 +29,7 @@ exports.Footer = (0, react_1.forwardRef)(function Footer(_a, forwardedRef) {
|
|
|
29
29
|
var { children, style, className } = _a, rest = __rest(_a, ["children", "style", "className"]);
|
|
30
30
|
const { layout } = (0, AppLayoutContext_1.useAppLayoutContext)() || {};
|
|
31
31
|
const canRestrictContentWidth = layout !== "vertical-full-header";
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, rest, { className: Footer_module_scss_1.default.outerWrapper, ref: forwardedRef, style: style, children: (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Footer_module_scss_1.default.wrapper, className, {
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, rest, { className: Footer_module_scss_1.default.outerWrapper, ref: forwardedRef, style: style, role: "contentinfo", children: (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Footer_module_scss_1.default.wrapper, className, {
|
|
33
33
|
[Footer_module_scss_1.default.full]: !canRestrictContentWidth,
|
|
34
34
|
}), children: children }) })));
|
|
35
35
|
});
|
|
@@ -45,6 +45,8 @@ const formActions_2 = require("../Form/formActions");
|
|
|
45
45
|
const FormContext_1 = require("./FormContext");
|
|
46
46
|
const lodash_es_1 = require("lodash-es");
|
|
47
47
|
const classnames_1 = __importDefault(require("classnames"));
|
|
48
|
+
const PART_CANCEL_BUTTON = "cancelButton";
|
|
49
|
+
const PART_SUBMIT_BUTTON = "submitButton";
|
|
48
50
|
const getByPath = (obj, path) => {
|
|
49
51
|
return (0, lodash_es_1.get)(obj, path);
|
|
50
52
|
};
|
|
@@ -248,7 +250,7 @@ const Form = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
248
250
|
try {
|
|
249
251
|
const filteredSubject = cleanUpSubject(formState.subject);
|
|
250
252
|
const result = yield (onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(filteredSubject, {
|
|
251
|
-
passAsDefaultBody: true
|
|
253
|
+
passAsDefaultBody: true,
|
|
252
254
|
}));
|
|
253
255
|
dispatch((0, formActions_1.formSubmitted)());
|
|
254
256
|
yield (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(result));
|
|
@@ -321,8 +323,8 @@ const Form = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
321
323
|
});
|
|
322
324
|
});
|
|
323
325
|
});
|
|
324
|
-
const cancelButton = cancelLabel === "" ? null : ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { type: "button", themeColor: "secondary", variant: "ghost", onClick: doCancel, children: cancelLabel }, "cancel"));
|
|
325
|
-
const submitButton = (0, react_2.useMemo)(() => ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { type: "submit", disabled: !isEnabled, children: formState.submitInProgress ? saveInProgressLabel : saveLabel }, "submit")), [isEnabled, formState.submitInProgress, saveInProgressLabel, saveLabel]);
|
|
326
|
+
const cancelButton = cancelLabel === "" ? null : ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { "data-part-id": PART_CANCEL_BUTTON, type: "button", themeColor: "secondary", variant: "ghost", onClick: doCancel, children: cancelLabel }, "cancel"));
|
|
327
|
+
const submitButton = (0, react_2.useMemo)(() => ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { "data-part-id": PART_SUBMIT_BUTTON, type: "submit", disabled: !isEnabled, children: formState.submitInProgress ? saveInProgressLabel : saveLabel }, "submit")), [isEnabled, formState.submitInProgress, saveInProgressLabel, saveLabel]);
|
|
326
328
|
(0, react_2.useEffect)(() => {
|
|
327
329
|
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
328
330
|
reset: doReset,
|
|
@@ -193,7 +193,7 @@ exports.FormItemMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
193
193
|
themeVars: (0, themeVars_1.parseScssVar)(FormItem_module_scss_1.default.themeVars),
|
|
194
194
|
defaultThemeVars: {
|
|
195
195
|
"textColor-FormItemLabel": "$textColor-primary",
|
|
196
|
-
"fontSize-FormItemLabel": "$fontSize-
|
|
196
|
+
"fontSize-FormItemLabel": "$fontSize-sm",
|
|
197
197
|
"fontWeight-FormItemLabel": "$fontWeight-medium",
|
|
198
198
|
"fontStyle-FormItemLabel": "normal",
|
|
199
199
|
"textTransform-FormItemLabel": "none",
|
|
@@ -35,7 +35,6 @@ const Validations_1 = require("./Validations");
|
|
|
35
35
|
const SliderNative_1 = require("../Slider/SliderNative");
|
|
36
36
|
const ColorPickerNative_1 = require("../ColorPicker/ColorPickerNative");
|
|
37
37
|
const HelperText_1 = require("./HelperText");
|
|
38
|
-
const NumberBox2Native_1 = require("../NumberBox/NumberBox2Native");
|
|
39
38
|
const ItemsNative_1 = require("../Items/ItemsNative");
|
|
40
39
|
const constants_1 = require("../../components-core/constants");
|
|
41
40
|
const hooks_1 = require("../../components-core/utils/hooks");
|
|
@@ -168,14 +167,6 @@ exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
|
|
|
168
167
|
formControl = ((0, jsx_runtime_1.jsx)(NumberBoxNative_1.NumberBox, Object.assign({}, rest, { initialValue: initialValue, value: value, updateState: onStateChange, registerComponentApi: registerComponentApi, enabled: isEnabled, integersOnly: type === "integer", validationStatus: validationStatus, min: validations.minValue, max: validations.maxValue, maxLength: maxTextLength !== null && maxTextLength !== void 0 ? maxTextLength : validations === null || validations === void 0 ? void 0 : validations.maxLength, gap: gap })));
|
|
169
168
|
break;
|
|
170
169
|
}
|
|
171
|
-
// NOTE: This is a prototype for the new number field
|
|
172
|
-
// works as good as the regular number field but untested
|
|
173
|
-
// in production.
|
|
174
|
-
case "integer2":
|
|
175
|
-
case "number2": {
|
|
176
|
-
formControl = ((0, jsx_runtime_1.jsx)(NumberBox2Native_1.NumberBox2, Object.assign({}, rest, { initialValue: initialValue, value: value, updateState: onStateChange, registerComponentApi: registerComponentApi, enabled: isEnabled, min: validations.minValue, max: validations.maxValue, integersOnly: type === "integer2" })));
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
170
|
case "switch":
|
|
180
171
|
case "checkbox": {
|
|
181
172
|
formControl = ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, Object.assign({}, rest, { value: value, updateState: onStateChange,
|
|
@@ -28,9 +28,9 @@ exports.defaultProps = {
|
|
|
28
28
|
const numberRegex = /^[0-9]+$/;
|
|
29
29
|
exports.ItemWithLabel = (0, react_1.forwardRef)(function ItemWithLabel(_a, ref) {
|
|
30
30
|
var { id, labelPosition = "top", style = {}, className, label, labelBreak = exports.defaultProps.labelBreak, labelWidth, enabled = true, required = false, children, validationInProgress = false, shrinkToLabel = false, onFocus, onBlur, labelStyle, validationResult, isInputTemplateUsed = false } = _a, rest = __rest(_a, ["id", "labelPosition", "style", "className", "label", "labelBreak", "labelWidth", "enabled", "required", "children", "validationInProgress", "shrinkToLabel", "onFocus", "onBlur", "labelStyle", "validationResult", "isInputTemplateUsed"]);
|
|
31
|
-
// --- HACK: the "rest" may contain a "layoutContext" property
|
|
32
|
-
// --- would issue a warning in React.
|
|
33
|
-
if (rest.layoutContext
|
|
31
|
+
// --- HACK: the "rest" may contain a "layoutContext" property that React doesn't recognize
|
|
32
|
+
// --- as a valid DOM attribute, which would issue a warning in React.
|
|
33
|
+
if (rest.layoutContext !== undefined) {
|
|
34
34
|
delete rest.layoutContext;
|
|
35
35
|
}
|
|
36
36
|
// --- END HACK
|