xmlui 0.9.11 → 0.9.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{apiInterceptorWorker-BZP06llg.mjs → apiInterceptorWorker-BUaYCWe6.mjs} +1 -1
- package/dist/core-XLM8cuFP.mjs +7491 -0
- package/dist/{index-CFJ5_K_a.mjs → index-DiCe0Ajo.mjs} +1848 -872
- package/dist/index.css +150 -130
- package/dist/language-server-web-worker.mjs +1 -1
- package/dist/language-server.mjs +1 -1
- package/dist/{lint-CiMcsEWf.mjs → lint-Cd70ckJ6.mjs} +84 -94
- package/dist/{parser-mzWvH7dz.mjs → parser-CBXS8ft2.mjs} +19 -17
- package/dist/scripts/bin/build-lib.js +42 -1
- package/dist/scripts/bin/vite-xmlui-plugin.js +2 -22
- package/dist/scripts/bin/viteConfig.js +3 -1
- package/dist/scripts/src/abstractions/ComponentDefs.js +2 -20
- package/dist/scripts/src/components/App/App.js +61 -21
- package/dist/scripts/src/components/Button/Button.js +5 -1
- package/dist/scripts/src/components/Button/ButtonNative.js +9 -2
- package/dist/scripts/src/components/Checkbox/Checkbox.js +2 -2
- package/dist/scripts/src/components/ComponentProvider.js +2 -0
- package/dist/scripts/src/components/Footer/Footer.js +1 -1
- package/dist/scripts/src/components/Form/FormContext.js +2 -0
- package/dist/scripts/src/components/Form/FormNative.js +8 -2
- package/dist/scripts/src/components/Form/formActions.js +5 -4
- package/dist/scripts/src/components/FormItem/FormItemNative.js +25 -12
- package/dist/scripts/src/components/Items/Items.js +2 -1
- package/dist/scripts/src/components/List/List.js +2 -1
- package/dist/scripts/src/components/Markdown/Markdown.js +3 -0
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +13 -10
- package/dist/scripts/src/components/NavPanel/NavPanel.js +2 -2
- package/dist/scripts/src/components/NumberBox/NumberBox2.js +85 -0
- package/dist/scripts/src/components/NumberBox/NumberBox2Native.js +395 -0
- package/dist/scripts/src/components/NumberBox/numberbox-abstractions.js +35 -0
- package/dist/scripts/src/components/Option/Option.js +2 -1
- package/dist/scripts/src/components/Select/Select.js +8 -0
- package/dist/scripts/src/components/Select/SelectNative.js +24 -10
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +1 -1
- package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +10 -7
- package/dist/scripts/src/components/Theme/ThemeNative.js +1 -0
- package/dist/scripts/src/components/VisuallyHidden.js +21 -0
- package/dist/scripts/src/components-core/loader/DataLoader.js +110 -3
- package/dist/scripts/src/components-core/loader/Loader.js +29 -7
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +4 -1
- package/dist/scripts/src/components-core/rendering/ComponentWrapper.js +23 -5
- package/dist/scripts/src/components-core/rendering/Container.js +23 -26
- package/dist/scripts/src/components-core/rendering/StateContainer.js +2 -4
- package/dist/scripts/src/components-core/rendering/reducer.js +6 -5
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +2 -2
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +10 -2
- package/dist/scripts/src/components-core/utils/extractParam.js +24 -7
- package/dist/scripts/src/components-core/xmlui-parser.js +1 -1
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +1 -1
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +0 -10
- package/dist/scripts/src/parsers/xmlui-parser/utils.js +6 -9
- package/dist/{server-common-DxRVCeIE.mjs → server-common-DW5h7Q34.mjs} +122 -64
- package/dist/style.css +150 -130
- package/dist/xmlui-metadata.mjs +901 -316
- package/dist/xmlui-metadata.umd.js +901 -318
- package/dist/xmlui-parser.d.ts +14 -9
- package/dist/xmlui-parser.mjs +34 -34
- package/dist/xmlui-standalone.umd.js +7473 -5421
- package/dist/xmlui.d.ts +15 -1
- package/dist/xmlui.mjs +2 -1
- package/package.json +5 -5
- package/dist/core-C-osEDc2.mjs +0 -2
|
@@ -140,7 +140,6 @@ const formReducer = (0, immer_1.default)((state, action) => {
|
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
142
142
|
case formActions_1.FormActionKind.BACKEND_VALIDATION_ARRIVED: {
|
|
143
|
-
//console.log(state.validationResults[field]) //action.payload.fieldValidationResults
|
|
144
143
|
state.submitInProgress = false;
|
|
145
144
|
state.generalValidationResults = action.payload.generalValidationResults;
|
|
146
145
|
Object.keys(state.validationResults).forEach((key) => {
|
|
@@ -241,7 +240,14 @@ const Form = (0, react_2.forwardRef)(function ({ formState, dispatch, initialVal
|
|
|
241
240
|
const prevFocused = document.activeElement;
|
|
242
241
|
dispatch((0, formActions_1.formSubmitting)());
|
|
243
242
|
try {
|
|
244
|
-
|
|
243
|
+
// --- Remove the properties from formState.subject where the property name ends with UNBOUND_FIELD_SUFFIX
|
|
244
|
+
const filteredSubject = Object.entries(formState.subject).reduce((acc, [key, value]) => {
|
|
245
|
+
if (!key.endsWith(formActions_1.UNBOUND_FIELD_SUFFIX)) {
|
|
246
|
+
acc[key] = value;
|
|
247
|
+
}
|
|
248
|
+
return acc;
|
|
249
|
+
}, {});
|
|
250
|
+
yield (onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(filteredSubject, {
|
|
245
251
|
passAsDefaultBody: true,
|
|
246
252
|
}));
|
|
247
253
|
dispatch((0, formActions_1.formSubmitted)());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormActionKind = void 0;
|
|
3
|
+
exports.FormActionKind = exports.UNBOUND_FIELD_SUFFIX = void 0;
|
|
4
4
|
exports.fieldInitialized = fieldInitialized;
|
|
5
5
|
exports.fieldChanged = fieldChanged;
|
|
6
6
|
exports.fieldFocused = fieldFocused;
|
|
@@ -12,6 +12,7 @@ exports.formSubmitting = formSubmitting;
|
|
|
12
12
|
exports.formSubmitted = formSubmitted;
|
|
13
13
|
exports.formReset = formReset;
|
|
14
14
|
exports.backendValidationArrived = backendValidationArrived;
|
|
15
|
+
exports.UNBOUND_FIELD_SUFFIX = "__UNBOUND_FIELD__";
|
|
15
16
|
var FormActionKind;
|
|
16
17
|
(function (FormActionKind) {
|
|
17
18
|
FormActionKind["FIELD_LOST_FOCUS"] = "FormActionKind:FIELD_LOST_FOCUS";
|
|
@@ -99,16 +100,16 @@ function formReset(originalSubject) {
|
|
|
99
100
|
return {
|
|
100
101
|
type: FormActionKind.RESET,
|
|
101
102
|
payload: {
|
|
102
|
-
originalSubject
|
|
103
|
+
originalSubject,
|
|
103
104
|
},
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
|
-
function backendValidationArrived({ generalValidationResults = [], fieldValidationResults = {} }) {
|
|
107
|
+
function backendValidationArrived({ generalValidationResults = [], fieldValidationResults = {}, }) {
|
|
107
108
|
return {
|
|
108
109
|
type: FormActionKind.BACKEND_VALIDATION_ARRIVED,
|
|
109
110
|
payload: {
|
|
110
111
|
generalValidationResults,
|
|
111
|
-
fieldValidationResults
|
|
112
|
+
fieldValidationResults,
|
|
112
113
|
},
|
|
113
114
|
};
|
|
114
115
|
}
|
|
@@ -35,6 +35,7 @@ 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");
|
|
38
39
|
const DEFAULT_LABEL_POSITIONS = {
|
|
39
40
|
checkbox: "end",
|
|
40
41
|
};
|
|
@@ -46,32 +47,36 @@ exports.defaultProps = {
|
|
|
46
47
|
};
|
|
47
48
|
exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
|
|
48
49
|
var { style, bindTo, type = exports.defaultProps.type, label, enabled = exports.defaultProps.enabled, labelPosition, labelWidth, labelBreak = exports.defaultProps.labelBreak, children, validations, onValidate, customValidationsDebounce = exports.defaultProps.customValidationsDebounce, validationMode, registerComponentApi, maxTextLength, inputRenderer } = _a, rest = __rest(_a, ["style", "bindTo", "type", "label", "enabled", "labelPosition", "labelWidth", "labelBreak", "children", "validations", "onValidate", "customValidationsDebounce", "validationMode", "registerComponentApi", "maxTextLength", "inputRenderer"]);
|
|
50
|
+
const defaultId = (0, react_1.useId)();
|
|
51
|
+
const [formItemId, setFormItemId] = (0, react_1.useState)(bindTo);
|
|
49
52
|
const labelWidthValue = (0, FormContext_1.useFormContextPart)((value) => labelWidth || value.itemLabelWidth);
|
|
50
53
|
const labelBreakValue = (0, FormContext_1.useFormContextPart)((value) => labelBreak !== undefined ? labelBreak : value.itemLabelBreak);
|
|
51
54
|
const labelPositionValue = (0, FormContext_1.useFormContextPart)((value) => labelPosition || value.itemLabelPosition || DEFAULT_LABEL_POSITIONS[type]);
|
|
52
|
-
const initialValueFromSubject = (0, FormContext_1.useFormContextPart)((value) => (0, FormNative_1.getByPath)(value.originalSubject,
|
|
55
|
+
const initialValueFromSubject = (0, FormContext_1.useFormContextPart)((value) => (0, FormNative_1.getByPath)(value.originalSubject, formItemId));
|
|
53
56
|
const initialValue = initialValueFromSubject === undefined ? rest.initialValue : initialValueFromSubject;
|
|
54
|
-
const value = (0, FormContext_1.useFormContextPart)((value) => (0, FormNative_1.getByPath)(value.subject,
|
|
55
|
-
const validationResult = (0, FormContext_1.useFormContextPart)((value) => value.validationResults[
|
|
57
|
+
const value = (0, FormContext_1.useFormContextPart)((value) => (0, FormNative_1.getByPath)(value.subject, formItemId));
|
|
58
|
+
const validationResult = (0, FormContext_1.useFormContextPart)((value) => value.validationResults[formItemId]);
|
|
56
59
|
const dispatch = (0, FormContext_1.useFormContextPart)((value) => value.dispatch);
|
|
57
60
|
const formEnabled = (0, FormContext_1.useFormContextPart)((value) => value.enabled);
|
|
58
61
|
const isEnabled = enabled && formEnabled;
|
|
59
62
|
(0, react_1.useEffect)(() => {
|
|
60
|
-
|
|
63
|
+
const newId = bindTo || `${defaultId}${formActions_1.UNBOUND_FIELD_SUFFIX}`;
|
|
64
|
+
setFormItemId(newId);
|
|
65
|
+
dispatch((0, formActions_1.fieldInitialized)(newId, initialValue));
|
|
61
66
|
}, [bindTo, dispatch, initialValue]);
|
|
62
|
-
(0, Validations_1.useValidation)(validations, onValidate, value, dispatch,
|
|
67
|
+
(0, Validations_1.useValidation)(validations, onValidate, value, dispatch, formItemId, customValidationsDebounce);
|
|
63
68
|
const onStateChange = (0, react_1.useCallback)(({ value }, options) => {
|
|
64
69
|
//we already handled the initial value in the useEffect with fieldInitialized(...);
|
|
65
70
|
if (!(options === null || options === void 0 ? void 0 : options.initial)) {
|
|
66
|
-
dispatch((0, formActions_1.fieldChanged)(
|
|
71
|
+
dispatch((0, formActions_1.fieldChanged)(formItemId, value));
|
|
67
72
|
}
|
|
68
|
-
}, [
|
|
73
|
+
}, [formItemId, dispatch]);
|
|
69
74
|
(0, react_1.useEffect)(() => {
|
|
70
75
|
return () => {
|
|
71
|
-
dispatch((0, formActions_1.fieldRemoved)(
|
|
76
|
+
dispatch((0, formActions_1.fieldRemoved)(formItemId));
|
|
72
77
|
};
|
|
73
|
-
}, [
|
|
74
|
-
const { validationStatus, isHelperTextShown } = (0, Validations_1.useValidationDisplay)(
|
|
78
|
+
}, [formItemId, dispatch]);
|
|
79
|
+
const { validationStatus, isHelperTextShown } = (0, Validations_1.useValidationDisplay)(formItemId, value, validationResult, validationMode);
|
|
75
80
|
let formControl = null;
|
|
76
81
|
switch (type) {
|
|
77
82
|
case "select": {
|
|
@@ -99,6 +104,14 @@ exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
|
|
|
99
104
|
formControl = ((0, jsx_runtime_1.jsx)(NumberBoxNative_1.NumberBox, Object.assign({}, rest, { 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 })));
|
|
100
105
|
break;
|
|
101
106
|
}
|
|
107
|
+
// NOTE: This is a prototype for the new number field
|
|
108
|
+
// works as good as the regular number field but untested
|
|
109
|
+
// in production.
|
|
110
|
+
case "integer2":
|
|
111
|
+
case "number2": {
|
|
112
|
+
formControl = ((0, jsx_runtime_1.jsx)(NumberBox2Native_1.NumberBox2, Object.assign({}, rest, { value: value, updateState: onStateChange, registerComponentApi: registerComponentApi, enabled: isEnabled, min: validations.minValue, max: validations.maxValue, integersOnly: type === "integer2" })));
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
102
115
|
case "switch":
|
|
103
116
|
case "checkbox": {
|
|
104
117
|
formControl = ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, Object.assign({}, rest, { value: value, updateState: onStateChange,
|
|
@@ -141,10 +154,10 @@ exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
|
|
|
141
154
|
}
|
|
142
155
|
}
|
|
143
156
|
const onFocus = (0, misc_1.useEvent)(() => {
|
|
144
|
-
dispatch((0, formActions_1.fieldFocused)(
|
|
157
|
+
dispatch((0, formActions_1.fieldFocused)(formItemId));
|
|
145
158
|
});
|
|
146
159
|
const onBlur = (0, misc_1.useEvent)(() => {
|
|
147
|
-
dispatch((0, formActions_1.fieldLostFocus)(
|
|
160
|
+
dispatch((0, formActions_1.fieldLostFocus)(formItemId));
|
|
148
161
|
});
|
|
149
162
|
const [animateContainerRef] = (0, react_2.useAutoAnimate)({ duration: 100 });
|
|
150
163
|
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { labelPosition: labelPositionValue, label: label, labelWidth: labelWidthValue, labelBreak: labelBreakValue, enabled: isEnabled, required: validations.required, validationInProgress: validationResult === null || validationResult === void 0 ? void 0 : validationResult.partial, onFocus: onFocus, onBlur: onBlur, style: style, validationResult: (0, jsx_runtime_1.jsx)("div", { ref: animateContainerRef, children: isHelperTextShown &&
|
|
@@ -19,6 +19,7 @@ exports.ItemsMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
19
19
|
},
|
|
20
20
|
itemTemplate: (0, metadata_helpers_1.dComponent)("The component template to display a single item"),
|
|
21
21
|
},
|
|
22
|
+
childrenAsTemplate: "itemTemplate",
|
|
22
23
|
contextVars: {
|
|
23
24
|
$item: (0, metadata_helpers_1.dComponent)("This value represents the current iteration item while the component renders its children."),
|
|
24
25
|
$itemIndex: (0, metadata_helpers_1.dComponent)("This integer value represents the current iteration index (zero-based) while rendering children."),
|
|
@@ -30,6 +31,6 @@ exports.ItemsMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
30
31
|
exports.itemsComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.ItemsMd, (rendererContext) => {
|
|
31
32
|
const { node, renderChild, extractValue, layoutContext } = rendererContext;
|
|
32
33
|
return ((0, jsx_runtime_1.jsx)(ItemsNative_1.Items, { items: extractValue(node.props.items) || extractValue(node.props.data), reverse: extractValue(node.props.reverse), renderItem: (contextVars, key) => {
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { contextVars: contextVars, node: node.
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { contextVars: contextVars, node: node.props.itemTemplate, renderChild: renderChild, layoutContext: layoutContext }, key));
|
|
34
35
|
} }));
|
|
35
36
|
});
|
|
@@ -71,6 +71,7 @@ exports.ListMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
71
71
|
defaultValue: true,
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
|
+
childrenAsTemplate: 'itemTemplate',
|
|
74
75
|
apis: {
|
|
75
76
|
scrollToTop: (0, ComponentDefs_1.d)("This method scrolls the list to the top."),
|
|
76
77
|
scrollToBottom: (0, ComponentDefs_1.d)("This method scrolls the list to the bottom."),
|
|
@@ -83,7 +84,7 @@ exports.ListMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
83
84
|
themeVars: (0, themeVars_1.parseScssVar)(List_module_scss_1.default.themeVars),
|
|
84
85
|
});
|
|
85
86
|
exports.dynamicHeightListComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.ListMd, ({ node, extractValue, renderChild, layoutCss, layoutContext, lookupEventHandler, registerComponentApi, }) => {
|
|
86
|
-
const itemTemplate = node.props.itemTemplate
|
|
87
|
+
const itemTemplate = node.props.itemTemplate;
|
|
87
88
|
const hideEmptyGroups = extractValue.asOptionalBoolean(node.props.hideEmptyGroups, true);
|
|
88
89
|
return ((0, jsx_runtime_1.jsx)(ListNative_1.ListNative, { registerComponentApi: registerComponentApi, style: layoutCss, loading: extractValue.asOptionalBoolean(node.props.loading), items: extractValue(node.props.items) || extractValue(node.props.data), limit: extractValue(node.props.limit), groupBy: extractValue(node.props.groupBy), orderBy: extractValue(node.props.orderBy), availableGroups: extractValue(node.props.availableGroups), scrollAnchor: node.props.scrollAnchor, pageInfo: extractValue(node.props.pageInfo), idKey: extractValue(node.props.idKey), requestFetchPrevPage: lookupEventHandler("requestFetchPrevPage"), requestFetchNextPage: lookupEventHandler("requestFetchNextPage"), emptyListPlaceholder: renderChild(node.props.emptyListTemplate), groupsInitiallyExpanded: extractValue.asOptionalBoolean(node.props.groupsInitiallyExpanded), defaultGroups: extractValue(node.props.defaultGroups), borderCollapse: extractValue.asOptionalBoolean(node.props.borderCollapse, true), itemRenderer: itemTemplate &&
|
|
89
90
|
((item, key) => {
|
|
@@ -26,17 +26,20 @@ exports.MarkdownMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
defaultThemeVars: {
|
|
29
|
+
"backgroundColor-Admonition": "$color-warn-300",
|
|
29
30
|
"borderRadius-Admonition": "$space-4",
|
|
30
31
|
"iconSize-Admonition": "1.5rem",
|
|
31
32
|
"padding-Admonition": "1rem",
|
|
32
33
|
"marginBottom-Admonition": "1rem",
|
|
33
34
|
"marginLeft-Admonition-content": ".5rem",
|
|
35
|
+
"backgroundColor-Blockquote": "$color-warn-200",
|
|
34
36
|
"accentWidth-Blockquote": "3px",
|
|
35
37
|
"accentColor-Blockquote": "$color-surface-500",
|
|
36
38
|
"padding-Blockquote": ".5rem",
|
|
37
39
|
"marginBottom-Blockquote": "1rem",
|
|
38
40
|
"marginBottom-Text-codefence": ".5rem",
|
|
39
41
|
"marginBottom-Text-markdown": ".5rem",
|
|
42
|
+
"marginTop-HtmlLi": "-0.5rem",
|
|
40
43
|
light: {
|
|
41
44
|
// --- No light-specific theme vars
|
|
42
45
|
},
|
|
@@ -27,7 +27,6 @@ const HtmlTags_module_scss_1 = __importDefault(require("../HtmlTags/HtmlTags.mod
|
|
|
27
27
|
const HeadingNative_1 = require("../Heading/HeadingNative");
|
|
28
28
|
const TextNative_1 = require("../Text/TextNative");
|
|
29
29
|
const LinkNative_1 = require("../Link/LinkNative");
|
|
30
|
-
const ImageNative_1 = require("../Image/ImageNative");
|
|
31
30
|
const Toggle_1 = require("../Toggle/Toggle");
|
|
32
31
|
const ScriptingSourceTree_1 = require("../../abstractions/scripting/ScriptingSourceTree");
|
|
33
32
|
exports.Markdown = (0, react_1.memo)(function Markdown({ extractValue, removeIndents = true, children, style, }) {
|
|
@@ -44,6 +43,10 @@ exports.Markdown = (0, react_1.memo)(function Markdown({ extractValue, removeInd
|
|
|
44
43
|
var { children, node } = _a, props = __rest(_a, ["children", "node"]);
|
|
45
44
|
return (0, jsx_runtime_1.jsx)("video", Object.assign({ className: HtmlTags_module_scss_1.default.htmlVideo }, props, { children: children }));
|
|
46
45
|
},
|
|
46
|
+
img(_a) {
|
|
47
|
+
var { children, node } = _a, props = __rest(_a, ["children", "node"]);
|
|
48
|
+
return (0, jsx_runtime_1.jsx)("img", Object.assign({ className: HtmlTags_module_scss_1.default.htmlImage }, props, { children: children }));
|
|
49
|
+
},
|
|
47
50
|
h1({ children }) {
|
|
48
51
|
return (0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, { level: "h1", children: children });
|
|
49
52
|
},
|
|
@@ -83,14 +86,17 @@ exports.Markdown = (0, react_1.memo)(function Markdown({ extractValue, removeInd
|
|
|
83
86
|
blockquote({ children }) {
|
|
84
87
|
return (0, jsx_runtime_1.jsx)(Blockquote, { children: children });
|
|
85
88
|
},
|
|
86
|
-
ol(
|
|
87
|
-
|
|
89
|
+
ol(_a) {
|
|
90
|
+
var { children, node } = _a, props = __rest(_a, ["children", "node"]);
|
|
91
|
+
return (0, jsx_runtime_1.jsx)("ol", Object.assign({ className: HtmlTags_module_scss_1.default.htmlOl }, props, { children: children }));
|
|
88
92
|
},
|
|
89
|
-
ul(
|
|
90
|
-
|
|
93
|
+
ul(_a) {
|
|
94
|
+
var { children, node } = _a, props = __rest(_a, ["children", "node"]);
|
|
95
|
+
return (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: HtmlTags_module_scss_1.default.htmlUl }, props, { children: children }));
|
|
91
96
|
},
|
|
92
|
-
li(
|
|
93
|
-
|
|
97
|
+
li(_a) {
|
|
98
|
+
var { children, node } = _a, props = __rest(_a, ["children", "node"]);
|
|
99
|
+
return (0, jsx_runtime_1.jsx)("li", Object.assign({ className: HtmlTags_module_scss_1.default.htmlLi }, props, { children: children }));
|
|
94
100
|
},
|
|
95
101
|
hr() {
|
|
96
102
|
return (0, jsx_runtime_1.jsx)(HorizontalRule, {});
|
|
@@ -100,9 +106,6 @@ exports.Markdown = (0, react_1.memo)(function Markdown({ extractValue, removeInd
|
|
|
100
106
|
const allowedProps = ['style', 'disabled', 'active', 'icon', 'onClick'];
|
|
101
107
|
return ((0, jsx_runtime_1.jsx)(LinkNative_1.LocalLink, Object.assign({ to: href }, allowedProps, { children: children })));
|
|
102
108
|
},
|
|
103
|
-
img({ src, alt }) {
|
|
104
|
-
return (0, jsx_runtime_1.jsx)(ImageNative_1.Image, { src: src, alt: alt });
|
|
105
|
-
},
|
|
106
109
|
// TODO: somehow get the label from the containing li element
|
|
107
110
|
input({ disabled, checked }) {
|
|
108
111
|
return ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, { variant: "checkbox", readOnly: disabled, value: checked }));
|
|
@@ -20,9 +20,9 @@ exports.NavPanelMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
20
20
|
},
|
|
21
21
|
themeVars: (0, themeVars_1.parseScssVar)(NavPanel_module_scss_1.default.themeVars),
|
|
22
22
|
defaultThemeVars: {
|
|
23
|
-
[`backgroundColor-${COMP}`]: "
|
|
23
|
+
[`backgroundColor-${COMP}`]: "$backgroundColor",
|
|
24
24
|
[`border-${COMP}`]: '0px solid $borderColor',
|
|
25
|
-
[`paddingHorizontal-${COMP}`]: "
|
|
25
|
+
[`paddingHorizontal-${COMP}`]: "0",
|
|
26
26
|
[`paddingVertical-logo-${COMP}`]: "$space-4",
|
|
27
27
|
[`paddingHorizontal-logo-${COMP}`]: "$space-4",
|
|
28
28
|
[`marginBottom-logo-${COMP}`]: "$space-4",
|
|
@@ -0,0 +1,85 @@
|
|
|
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.numberBox2ComponentRenderer = exports.NumberBoxMd2 = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const NumberBox_module_scss_1 = __importDefault(require("./NumberBox.module.scss"));
|
|
9
|
+
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
10
|
+
const renderers_1 = require("../../components-core/renderers");
|
|
11
|
+
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
12
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
13
|
+
const NumberBox2Native_1 = require("./NumberBox2Native");
|
|
14
|
+
const COMP = "NumberBox2";
|
|
15
|
+
exports.NumberBoxMd2 = (0, ComponentDefs_1.createMetadata)({
|
|
16
|
+
status: "experimental",
|
|
17
|
+
description: `A \`${COMP}\` component allows users to input numeric values: either integer or floating ` +
|
|
18
|
+
`point numbers. It also accepts empty values, where the stored value will be of type \`null\`.`,
|
|
19
|
+
props: {
|
|
20
|
+
placeholder: (0, metadata_helpers_1.dPlaceholder)(),
|
|
21
|
+
initialValue: (0, metadata_helpers_1.dInitialValue)(),
|
|
22
|
+
label: (0, metadata_helpers_1.dLabel)(),
|
|
23
|
+
labelPosition: (0, metadata_helpers_1.dLabelPosition)("top"),
|
|
24
|
+
labelWidth: (0, metadata_helpers_1.dLabelWidth)(COMP),
|
|
25
|
+
labelBreak: (0, metadata_helpers_1.dLabelBreak)(COMP),
|
|
26
|
+
maxLength: (0, metadata_helpers_1.dMaxLength)(),
|
|
27
|
+
autoFocus: (0, metadata_helpers_1.dAutoFocus)(),
|
|
28
|
+
required: (0, metadata_helpers_1.dRequired)(),
|
|
29
|
+
readOnly: (0, metadata_helpers_1.dReadonly)(),
|
|
30
|
+
enabled: (0, metadata_helpers_1.dEnabled)(),
|
|
31
|
+
validationStatus: (0, metadata_helpers_1.dValidationStatus)(),
|
|
32
|
+
startText: (0, metadata_helpers_1.dStartText)(),
|
|
33
|
+
startIcon: (0, metadata_helpers_1.dStartIcon)(),
|
|
34
|
+
endText: (0, metadata_helpers_1.dEndText)(),
|
|
35
|
+
endIcon: (0, metadata_helpers_1.dEndIcon)(),
|
|
36
|
+
hasSpinBox: {
|
|
37
|
+
description: `This boolean prop shows (\`true\`) or hides (\`false\`) the spinner buttons for the input field.`,
|
|
38
|
+
valueType: "boolean",
|
|
39
|
+
defaultValue: true,
|
|
40
|
+
},
|
|
41
|
+
step: {
|
|
42
|
+
description: `This prop governs how big the step when clicking on the spinner of the field.`,
|
|
43
|
+
valueType: "number",
|
|
44
|
+
defaultValue: 1,
|
|
45
|
+
},
|
|
46
|
+
integersOnly: {
|
|
47
|
+
description: `This boolean property signs whether the input field accepts integers only (\`true\`) ` +
|
|
48
|
+
`or not (\`false\`).`,
|
|
49
|
+
valueType: "boolean",
|
|
50
|
+
defaultValue: false,
|
|
51
|
+
},
|
|
52
|
+
maxFractionDigits: {
|
|
53
|
+
description: `This prop sets the maximum number of decimal places allowed in the input field. ` +
|
|
54
|
+
`If the number of decimal places is greater than this value, the value will be truncated to the maximum allowed decimal places. `,
|
|
55
|
+
valueType: "number",
|
|
56
|
+
defaultValue: 3,
|
|
57
|
+
},
|
|
58
|
+
zeroOrPositive: {
|
|
59
|
+
description: `This boolean property determines whether the input value can only be 0 or positive numbers ` +
|
|
60
|
+
`(\`true\`) or also negative (\`false\`).`,
|
|
61
|
+
valueType: "boolean",
|
|
62
|
+
defaultValue: false,
|
|
63
|
+
},
|
|
64
|
+
minValue: (0, ComponentDefs_1.d)(`The minimum value the input field allows. Can be a float or an integer if ` +
|
|
65
|
+
`[\`integersOnly\`](#integersonly) is set to \`false\`, otherwise it can only be an integer.`),
|
|
66
|
+
maxValue: (0, ComponentDefs_1.d)(`The maximum value the input field allows. Can be a float or an integer if ` +
|
|
67
|
+
`[\`integersOnly\`](#integersonly) is set to \`false\`, otherwise it can only be an integer.`),
|
|
68
|
+
},
|
|
69
|
+
events: {
|
|
70
|
+
gotFocus: (0, metadata_helpers_1.dGotFocus)(COMP),
|
|
71
|
+
lostFocus: (0, metadata_helpers_1.dLostFocus)(COMP),
|
|
72
|
+
didChange: (0, metadata_helpers_1.dDidChange)(COMP),
|
|
73
|
+
},
|
|
74
|
+
apis: {
|
|
75
|
+
focus: (0, metadata_helpers_1.dFocus)(COMP),
|
|
76
|
+
value: (0, metadata_helpers_1.dValue)(),
|
|
77
|
+
setValue: (0, metadata_helpers_1.dSetValueApi)(),
|
|
78
|
+
},
|
|
79
|
+
themeVars: (0, themeVars_1.parseScssVar)(NumberBox_module_scss_1.default.themeVars),
|
|
80
|
+
});
|
|
81
|
+
exports.numberBox2ComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.NumberBoxMd2, ({ node, state, updateState, lookupEventHandler, extractValue, layoutCss, registerComponentApi, }) => {
|
|
82
|
+
return ((0, jsx_runtime_1.jsx)(NumberBox2Native_1.NumberBox2, { style: layoutCss, value: state === null || state === void 0 ? void 0 : state.value, initialValue: extractValue.asOptionalString(node.props.initialValue), enabled: extractValue.asOptionalBoolean(node.props.enabled), placeholder: extractValue.asOptionalString(node.props.placeholder), validationStatus: extractValue(node.props.validationStatus), updateState: updateState, onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), registerComponentApi: registerComponentApi, hasSpinBox: extractValue.asOptionalBoolean(node.props.hasSpinBox), step: extractValue(node.props.step), integersOnly: extractValue.asOptionalBoolean(node.props.integersOnly), zeroOrPositive: extractValue.asOptionalBoolean(node.props.zeroOrPositive), maxFractionDigits: extractValue.asOptionalNumber(node.props.maxFractionDigits), min: extractValue.asOptionalNumber(node.props.minValue), max: extractValue.asOptionalNumber(node.props.maxValue), startText: extractValue.asOptionalString(node.props.startText), startIcon: extractValue.asOptionalString(node.props.startIcon), endText: extractValue.asOptionalString(node.props.endText), endIcon: extractValue.asOptionalString(node.props.endIcon), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), readOnly: extractValue.asOptionalBoolean(node.props.readOnly),
|
|
83
|
+
//maxLength={extractValue(node.props.maxLength)}
|
|
84
|
+
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) }));
|
|
85
|
+
});
|