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
|
@@ -22,32 +22,32 @@ const baseSplitterMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
22
22
|
description: `This optional booelan property indicates whether the \`${COMP}\` sections are layed out as ` +
|
|
23
23
|
`primary and secondary (\`false\`) or secondary and primary (\`true\`) from left to right.`,
|
|
24
24
|
valueType: "boolean",
|
|
25
|
-
defaultValue:
|
|
25
|
+
defaultValue: SplitterNative_1.defaultProps.swapped,
|
|
26
26
|
},
|
|
27
27
|
splitterTemplate: (0, metadata_helpers_1.dComponent)(`The divider can be customized using XMLUI components via this property.`),
|
|
28
28
|
initialPrimarySize: {
|
|
29
29
|
description: `This optional number property sets the initial size of the primary section. The unit of ` +
|
|
30
30
|
`the size value is in pixels or percentages.`,
|
|
31
31
|
valueType: "string",
|
|
32
|
-
defaultValue:
|
|
32
|
+
defaultValue: SplitterNative_1.defaultProps.initialPrimarySize,
|
|
33
33
|
},
|
|
34
34
|
minPrimarySize: {
|
|
35
35
|
description: `This property sets the minimum size the primary section can have. The unit of the size ` +
|
|
36
36
|
`value is in pixels or percentages.`,
|
|
37
37
|
valueType: "string",
|
|
38
|
-
defaultValue:
|
|
38
|
+
defaultValue: SplitterNative_1.defaultProps.minPrimarySize,
|
|
39
39
|
},
|
|
40
40
|
maxPrimarySize: {
|
|
41
41
|
description: `This property sets the maximum size the primary section can have. The unit of the size ` +
|
|
42
42
|
`value is in pixels or percentages.`,
|
|
43
43
|
valueType: "string",
|
|
44
|
-
defaultValue:
|
|
44
|
+
defaultValue: SplitterNative_1.defaultProps.maxPrimarySize,
|
|
45
45
|
},
|
|
46
46
|
floating: {
|
|
47
47
|
description: `Toggles whether the resizer is visible (\`false\`) or not (\`true\`) when not hovered ` +
|
|
48
48
|
`or dragged. The default value is \`false\`, meaning the resizer is visible all the time.`,
|
|
49
49
|
valueType: "boolean",
|
|
50
|
-
defaultValue:
|
|
50
|
+
defaultValue: SplitterNative_1.defaultProps.floating,
|
|
51
51
|
},
|
|
52
52
|
orientation: {
|
|
53
53
|
description: `Sets whether the \`Splitter\` divides the container horizontally and lays out the ` +
|
|
@@ -55,7 +55,7 @@ const baseSplitterMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
55
55
|
`next to each other (\`horizontal\`).`,
|
|
56
56
|
valueType: "string",
|
|
57
57
|
availableValues: ["horizontal", "vertical"],
|
|
58
|
-
defaultValue:
|
|
58
|
+
defaultValue: SplitterNative_1.defaultProps.orientation,
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
events: {
|
|
@@ -36,14 +36,22 @@ 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.Splitter = void 0;
|
|
39
|
+
exports.Splitter = exports.defaultProps = void 0;
|
|
40
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
41
|
const react_1 = __importStar(require("react"));
|
|
42
42
|
const classnames_1 = __importDefault(require("classnames"));
|
|
43
43
|
const Splitter_module_scss_1 = __importDefault(require("./Splitter.module.scss"));
|
|
44
44
|
const constants_1 = require("../../components-core/constants");
|
|
45
45
|
const utils_1 = require("../Splitter/utils");
|
|
46
|
-
|
|
46
|
+
exports.defaultProps = {
|
|
47
|
+
initialPrimarySize: "50%",
|
|
48
|
+
minPrimarySize: "0%",
|
|
49
|
+
maxPrimarySize: "100%",
|
|
50
|
+
orientation: "vertical",
|
|
51
|
+
swapped: false,
|
|
52
|
+
floating: false,
|
|
53
|
+
};
|
|
54
|
+
const Splitter = ({ initialPrimarySize = exports.defaultProps.initialPrimarySize, minPrimarySize = exports.defaultProps.minPrimarySize, maxPrimarySize = exports.defaultProps.maxPrimarySize, orientation = exports.defaultProps.orientation, children, style, swapped = exports.defaultProps.swapped, floating = exports.defaultProps.floating, splitterTemplate, resize = constants_1.noop, }) => {
|
|
47
55
|
var _a;
|
|
48
56
|
const [size, setSize] = (0, react_1.useState)(0);
|
|
49
57
|
const [splitter, setSplitter] = (0, react_1.useState)(null);
|
|
@@ -38,7 +38,7 @@ const stackMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
38
38
|
reverse: {
|
|
39
39
|
description: "Optional boolean property to reverse the order of child elements.",
|
|
40
40
|
valueType: "boolean",
|
|
41
|
-
defaultValue:
|
|
41
|
+
defaultValue: StackNative_1.defaultProps.reverse,
|
|
42
42
|
},
|
|
43
43
|
wrapContent: {
|
|
44
44
|
description: "Optional boolean which wraps the content if set to true and the available " +
|
|
@@ -51,12 +51,12 @@ const stackMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
51
51
|
"the Stack lays out its children in a row or a column).",
|
|
52
52
|
availableValues: ["horizontal", "vertical"],
|
|
53
53
|
valueType: "string",
|
|
54
|
-
defaultValue: StackNative_1.
|
|
54
|
+
defaultValue: StackNative_1.defaultProps.orientation,
|
|
55
55
|
},
|
|
56
56
|
horizontalAlignment: HORIZONTAL_ALIGNMENT,
|
|
57
57
|
verticalAlignment: VERTICAL_ALIGNMENT,
|
|
58
|
-
hoverContainer: (0, metadata_helpers_1.dInternal)("Reserved for future use"),
|
|
59
|
-
visibleOnHover: (0, metadata_helpers_1.dInternal)("Reserved for future use"),
|
|
58
|
+
hoverContainer: Object.assign(Object.assign({}, (0, metadata_helpers_1.dInternal)("Reserved for future use")), { defaultValue: StackNative_1.defaultProps.hoverContainer }),
|
|
59
|
+
visibleOnHover: Object.assign(Object.assign({}, (0, metadata_helpers_1.dInternal)("Reserved for future use")), { defaultValue: StackNative_1.defaultProps.visibleOnHover }),
|
|
60
60
|
},
|
|
61
61
|
events: {
|
|
62
62
|
click: (0, metadata_helpers_1.dClick)(COMP),
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Stack = exports.DEFAULT_ORIENTATION = void 0;
|
|
17
|
+
exports.Stack = exports.defaultProps = exports.DEFAULT_ORIENTATION = void 0;
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const react_1 = require("react");
|
|
20
20
|
const classnames_1 = __importDefault(require("classnames"));
|
|
@@ -22,10 +22,16 @@ const Stack_module_scss_1 = __importDefault(require("./Stack.module.scss"));
|
|
|
22
22
|
const component_hooks_1 = require("../../components-core/component-hooks");
|
|
23
23
|
const hooks_1 = require("../../components-core/utils/hooks");
|
|
24
24
|
exports.DEFAULT_ORIENTATION = "vertical";
|
|
25
|
+
exports.defaultProps = {
|
|
26
|
+
orientation: exports.DEFAULT_ORIENTATION,
|
|
27
|
+
reverse: false,
|
|
28
|
+
hoverContainer: false,
|
|
29
|
+
visibleOnHover: false,
|
|
30
|
+
};
|
|
25
31
|
// =====================================================================================================================
|
|
26
32
|
// Stack React component
|
|
27
33
|
exports.Stack = (0, react_1.forwardRef)(function Stack(_a, ref) {
|
|
28
|
-
var { uid, children, orientation = exports.
|
|
34
|
+
var { uid, children, orientation = exports.defaultProps.orientation, horizontalAlignment, verticalAlignment, style, reverse = exports.defaultProps.reverse, hoverContainer = exports.defaultProps.hoverContainer, visibleOnHover = exports.defaultProps.visibleOnHover, onClick, onMount } = _a, rest = __rest(_a, ["uid", "children", "orientation", "horizontalAlignment", "verticalAlignment", "style", "reverse", "hoverContainer", "visibleOnHover", "onClick", "onMount"]);
|
|
29
35
|
(0, hooks_1.useOnMount)(onMount);
|
|
30
36
|
const { horizontal, vertical } = (0, component_hooks_1.useContentAlignment)(orientation, horizontalAlignment, verticalAlignment);
|
|
31
37
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, rest, { onClick: onClick, ref: ref, style: style, className: (0, classnames_1.default)(Stack_module_scss_1.default.base, {
|
|
@@ -21,7 +21,7 @@ exports.StickyBoxMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
21
21
|
"the \`top\` or \`bottom\`.",
|
|
22
22
|
availableValues: ["top", "bottom"],
|
|
23
23
|
valueType: "string",
|
|
24
|
-
defaultValue:
|
|
24
|
+
defaultValue: StickyBoxNative_1.defaultProps.to,
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
themeVars: (0, themeVars_1.parseScssVar)(StickyBox_module_scss_1.default.themeVars),
|
|
@@ -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.StickyBox = StickyBox;
|
|
7
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
9
|
const react_1 = require("react");
|
|
@@ -10,7 +11,12 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
10
11
|
const react_sticky_el_1 = require("react-sticky-el");
|
|
11
12
|
const StickyBox_module_scss_1 = __importDefault(require("./StickyBox.module.scss"));
|
|
12
13
|
const hooks_1 = require("../../components-core/utils/hooks");
|
|
13
|
-
|
|
14
|
+
// =====================================================================================================================
|
|
15
|
+
// React StickyBox component implementation
|
|
16
|
+
exports.defaultProps = {
|
|
17
|
+
to: "top",
|
|
18
|
+
};
|
|
19
|
+
function StickyBox({ children, uid, layout, to = exports.defaultProps.to }) {
|
|
14
20
|
const sentinelRef = (0, react_1.useRef)(null);
|
|
15
21
|
const [wrapper, setWrapper] = (0, react_1.useState)(null);
|
|
16
22
|
const [stuck, setStuck] = (0, react_1.useState)(false);
|
|
@@ -31,7 +31,7 @@ exports.TableMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
31
31
|
isPaginated: {
|
|
32
32
|
description: `This property adds pagination controls to the \`${COMP}\`.`,
|
|
33
33
|
valueType: "boolean",
|
|
34
|
-
defaultValue:
|
|
34
|
+
defaultValue: TableNative_1.defaultProps.isPaginated,
|
|
35
35
|
},
|
|
36
36
|
loading: (0, ComponentDefs_1.d)(`This boolean property indicates if the component is fetching (or processing) data. This ` +
|
|
37
37
|
`property is useful when data is loaded conditionally or receiving it takes some time.`),
|
|
@@ -45,22 +45,24 @@ exports.TableMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
45
45
|
`row should be disabled. The function retrieves the item to display and should return ` +
|
|
46
46
|
`a Boolean-like value.`),
|
|
47
47
|
noDataTemplate: (0, metadata_helpers_1.dComponent)(`A property to customize what to display if the table does not contain any data.`),
|
|
48
|
-
sortBy: (0, ComponentDefs_1.d)(
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
sortBy: (0, ComponentDefs_1.d)("This property is used to determine which data property to sort by. If not defined, " +
|
|
49
|
+
"the data is not sorted"),
|
|
50
|
+
sortDirection: (0, ComponentDefs_1.d)("This property determines the sort order to be \`ascending\` or \`descending\`. This " +
|
|
51
|
+
"property only works if the [\`sortBy\`](#sortby) property is also set. By default " +
|
|
52
|
+
"ascending order is used."),
|
|
51
53
|
autoFocus: (0, metadata_helpers_1.dAutoFocus)(),
|
|
52
54
|
hideHeader: {
|
|
53
55
|
description: "Set the header visibility using this property. Set it to \`true\` to hide the header.",
|
|
54
56
|
valueType: "boolean",
|
|
55
|
-
defaultValue:
|
|
57
|
+
defaultValue: TableNative_1.defaultProps.hideHeader,
|
|
56
58
|
},
|
|
57
|
-
iconNoSort: (0, ComponentDefs_1.d)(`Allows setting
|
|
59
|
+
iconNoSort: (0, ComponentDefs_1.d)(`Allows setting an alternate icon displayed in the ${COMP} column header when sorting is ` +
|
|
58
60
|
`enabled, but the column remains unsorted. You can change the default icon for all ${COMP} ` +
|
|
59
61
|
`instances with the "icon.nosort:Table" declaration in the app configuration file.`),
|
|
60
|
-
iconSortAsc: (0, ComponentDefs_1.d)(`Allows setting
|
|
62
|
+
iconSortAsc: (0, ComponentDefs_1.d)(`Allows setting an alernate icon displayed in the ${COMP} column header when sorting is enabled, ` +
|
|
61
63
|
`and the column is sorted in ascending order. You can change the default icon for all ${COMP} ` +
|
|
62
64
|
`instances with the "icon.sortasc:Table" declaration in the app configuration file.`),
|
|
63
|
-
iconSortDesc: (0, ComponentDefs_1.d)(`Allows setting
|
|
65
|
+
iconSortDesc: (0, ComponentDefs_1.d)(`Allows setting an alternate icon displayed in the ${COMP} column header when sorting is enabled, ` +
|
|
64
66
|
`and the column is sorted in descending order. You can change the default icon for all ${COMP} ` +
|
|
65
67
|
`instances with the "icon.sortdesc:Table" declaration in the app configuration file.`),
|
|
66
68
|
enableMultiRowSelection: {
|
|
@@ -68,7 +70,7 @@ exports.TableMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
68
70
|
`This property only has an effect when the rowsSelectable property is set. Setting it ` +
|
|
69
71
|
`to \`false\` limits selection to a single row.`,
|
|
70
72
|
valueType: "boolean",
|
|
71
|
-
defaultValue:
|
|
73
|
+
defaultValue: TableNative_1.defaultProps.enableMultiRowSelection,
|
|
72
74
|
},
|
|
73
75
|
alwaysShowSelectionHeader: {
|
|
74
76
|
description: "This property indicates when the row selection header is displayed. When the value is " +
|
|
@@ -82,7 +84,7 @@ exports.TableMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
82
84
|
`\`true\`, the table does not have a bottom border. Otherwise, it has a bottom border.`,
|
|
83
85
|
valueType: "boolean",
|
|
84
86
|
defaultValue: false,
|
|
85
|
-
}
|
|
87
|
+
},
|
|
86
88
|
},
|
|
87
89
|
events: {
|
|
88
90
|
sortingDidChange: (0, ComponentDefs_1.d)(`This event is fired when the table data sorting has changed. It has two arguments: ` +
|
|
@@ -106,11 +108,10 @@ exports.TableMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
106
108
|
},
|
|
107
109
|
themeVars: (0, themeVars_1.parseScssVar)(Table_module_scss_1.default.themeVars),
|
|
108
110
|
defaultThemeVars: {
|
|
109
|
-
[`padding-heading-${COMP}`]: `$space-2`,
|
|
110
|
-
[`
|
|
111
|
+
[`padding-heading-${COMP}`]: `$space-2 $space-0 $space-2 $space-2`,
|
|
112
|
+
[`padding-cell-${COMP}`]: "$space-2 $space-0 $space-2 $space-2",
|
|
111
113
|
[`paddingHorizontal-cell-first-${COMP}`]: "$space-5",
|
|
112
|
-
[`paddingHorizontal-cell-last-${COMP}`]: "$space-
|
|
113
|
-
[`paddingVertical-cell-${COMP}`]: "$space-2",
|
|
114
|
+
[`paddingHorizontal-cell-last-${COMP}`]: "$space-0",
|
|
114
115
|
[`border-cell-${COMP}`]: "1px solid $borderColor",
|
|
115
116
|
[`outlineWidth-heading-${COMP}--focus`]: "$outlineWidth--focus",
|
|
116
117
|
[`outlineStyle-heading-${COMP}--focus`]: "$outlineStyle--focus",
|
|
@@ -23,7 +23,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Table = void 0;
|
|
26
|
+
exports.defaultProps = exports.Table = void 0;
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
28
|
const react_1 = require("react");
|
|
29
29
|
const react_dom_1 = require("react-dom");
|
|
@@ -73,7 +73,7 @@ const getCommonPinningStyles = (column) => {
|
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
// eslint-disable-next-line react/display-name
|
|
76
|
-
exports.Table = (0, react_1.forwardRef)(({ data =
|
|
76
|
+
exports.Table = (0, react_1.forwardRef)(({ data = exports.defaultProps.data, columns = exports.defaultProps.columns, isPaginated = exports.defaultProps.isPaginated, loading = exports.defaultProps.loading, headerHeight, rowsSelectable = exports.defaultProps.rowsSelectable, enableMultiRowSelection = exports.defaultProps.enableMultiRowSelection, pageSizes = exports.defaultProps.pageSizes, rowDisabledPredicate = defaultIsRowDisabled, sortBy, sortingDirection = exports.defaultProps.sortingDirection, iconSortAsc, iconSortDesc, iconNoSort, sortingDidChange, willSort, style, noDataRenderer, autoFocus = exports.defaultProps.autoFocus, hideHeader = exports.defaultProps.hideHeader, hideNoDataView = exports.defaultProps.hideNoDataView, alwaysShowSelectionHeader = exports.defaultProps.alwaysShowSelectionHeader, registerComponentApi, onSelectionDidChange, noBottomBorder = exports.defaultProps.noBottomBorder,
|
|
77
77
|
// cols
|
|
78
78
|
}, forwardedRef) => {
|
|
79
79
|
var _a, _b, _c, _d;
|
|
@@ -162,7 +162,7 @@ exports.Table = (0, react_1.forwardRef)(({ data = constants_1.EMPTY_ARRAY, colum
|
|
|
162
162
|
const { width, starSizedWidth } = getColumnWidth(col.width, true, "width");
|
|
163
163
|
const { width: minWidth } = getColumnWidth(col.minWidth, false, "minWidth");
|
|
164
164
|
const { width: maxWidth } = getColumnWidth(col.maxWidth, false, "maxWidth");
|
|
165
|
-
const customColumn = Object.assign(Object.assign({}, col), { header: (_b = (_a = col.header) !== null && _a !== void 0 ? _a : col.accessorKey) !== null && _b !== void 0 ? _b : " ", id: "col_" + idx, size: width, minSize: minWidth, maxSize: maxWidth, enableResizing: col.canResize, enableSorting: col.canSort, enablePinning: col.pinTo !== undefined, meta: {
|
|
165
|
+
const customColumn = Object.assign(Object.assign({}, col), { header: (_b = (_a = col.header) !== null && _a !== void 0 ? _a : col.accessorKey) !== null && _b !== void 0 ? _b : " ", id: "col_" + idx, size: width, minSize: minWidth, maxSize: maxWidth, enableResizing: col.canResize, enableSorting: col.canSort && !!col.accessorKey, enablePinning: col.pinTo !== undefined, meta: {
|
|
166
166
|
starSizedWidth,
|
|
167
167
|
pinTo: col.pinTo,
|
|
168
168
|
style: col.style,
|
|
@@ -384,10 +384,11 @@ exports.Table = (0, react_1.forwardRef)(({ data = constants_1.EMPTY_ARRAY, colum
|
|
|
384
384
|
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(Table_module_scss_1.default.wrapper, { [Table_module_scss_1.default.noScroll]: hasOutsideScroll }), tabIndex: -1, onKeyDown: onKeyDown, ref: ref, style: style, children: [(0, jsx_runtime_1.jsxs)("table", { className: Table_module_scss_1.default.table, ref: tableRef, style: { borderRight: "1px solid transparent" }, children: [!hideHeader && ((0, jsx_runtime_1.jsx)("thead", { style: { height: headerHeight }, className: Table_module_scss_1.default.headerWrapper, children: table.getHeaderGroups().map((headerGroup, headerGroupIndex) => ((0, jsx_runtime_1.jsx)("tr", { className: (0, classnames_1.default)(Table_module_scss_1.default.headerRow, {
|
|
385
385
|
[Table_module_scss_1.default.allSelected]: table.getIsAllRowsSelected(),
|
|
386
386
|
}), children: headerGroup.headers.map((header, headerIndex) => {
|
|
387
|
-
var _a, _b;
|
|
388
|
-
const
|
|
387
|
+
var _a, _b, _c;
|
|
388
|
+
const _d = ((_a = header.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.style) || {}, { width } = _d, style = __rest(_d, ["width"]);
|
|
389
389
|
const size = header.getSize();
|
|
390
|
-
return ((0, jsx_runtime_1.jsxs)("th", { className: Table_module_scss_1.default.columnCell, colSpan: header.colSpan, style: Object.assign({ position: "relative", width: size }, getCommonPinningStyles(header.column)), children: [(0, jsx_runtime_1.jsx)(ClickableHeader, { hasSorting: header.column.columnDef.enableSorting
|
|
390
|
+
return ((0, jsx_runtime_1.jsxs)("th", { className: Table_module_scss_1.default.columnCell, colSpan: header.colSpan, style: Object.assign({ position: "relative", width: size }, getCommonPinningStyles(header.column)), children: [(0, jsx_runtime_1.jsx)(ClickableHeader, { hasSorting: header.column.columnDef.enableSorting &&
|
|
391
|
+
!!((_b = header.column.columnDef.meta) === null || _b === void 0 ? void 0 : _b.accessorKey), updateSorting: () => { var _a; return _updateSorting((_a = header.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.accessorKey); }, children: (0, jsx_runtime_1.jsxs)("div", { className: Table_module_scss_1.default.headerContent, style: style, children: [(0, react_table_1.flexRender)(header.column.columnDef.header, header.getContext()), header.column.columnDef.enableSorting && ((0, jsx_runtime_1.jsx)("span", { style: { display: "inline-flex", maxWidth: 16 }, children: (0, jsx_runtime_1.jsx)(ColumnOrderingIndicator, { iconSortAsc: iconSortAsc, iconSortDesc: iconSortDesc, iconNoSort: iconNoSort, direction: ((_c = header.column.columnDef.meta) === null || _c === void 0 ? void 0 : _c.accessorKey) === _sortBy
|
|
391
392
|
? _sortingDirection
|
|
392
393
|
: undefined }) }))] }) }), header.column.getCanResize() && ((0, jsx_runtime_1.jsx)("div", { onDoubleClick: () => {
|
|
393
394
|
touchedSizesRef.current[header.column.id] = false;
|
|
@@ -437,9 +438,9 @@ exports.Table = (0, react_1.forwardRef)(({ data = constants_1.EMPTY_ARRAY, colum
|
|
|
437
438
|
const size = cell.column.getSize();
|
|
438
439
|
return ((0, jsx_runtime_1.jsx)("td", { className: Table_module_scss_1.default.cell, style: Object.assign({
|
|
439
440
|
// width: size,
|
|
440
|
-
width: size }, getCommonPinningStyles(cell.column)), children: cellRenderer
|
|
441
|
-
|
|
442
|
-
|
|
441
|
+
width: size }, getCommonPinningStyles(cell.column)), children: (0, jsx_runtime_1.jsx)("div", { className: Table_module_scss_1.default.cellContent, children: cellRenderer
|
|
442
|
+
? cellRenderer(cell.row.original, rowIndex, i, cell === null || cell === void 0 ? void 0 : cell.getValue())
|
|
443
|
+
: (0, react_table_1.flexRender)(cell.column.columnDef.cell, cell.getContext()) }) }, `${cell.id}-${i}`));
|
|
443
444
|
}) }, `${row.id}-${rowIndex}`));
|
|
444
445
|
}), paddingBottom > 0 && ((0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("td", { style: { height: `${paddingBottom}px` } }) }))] }))] }), loading && !hasData && ((0, jsx_runtime_1.jsx)("div", { className: Table_module_scss_1.default.loadingWrapper, children: (0, jsx_runtime_1.jsx)(SpinnerNative_1.Spinner, {}) })), !hideNoDataView &&
|
|
445
446
|
!loading &&
|
|
@@ -462,3 +463,18 @@ function ColumnOrderingIndicator({ direction, iconSortAsc = "sortasc:Table", ico
|
|
|
462
463
|
}
|
|
463
464
|
return iconNoSort !== "-" ? ((0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: iconNoSort, fallback: "nosort", size: "12" })) : ((0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: iconNoSort, size: "12" })); //nosort
|
|
464
465
|
}
|
|
466
|
+
exports.defaultProps = {
|
|
467
|
+
data: constants_1.EMPTY_ARRAY,
|
|
468
|
+
columns: constants_1.EMPTY_ARRAY,
|
|
469
|
+
isPaginated: false,
|
|
470
|
+
loading: false,
|
|
471
|
+
rowsSelectable: false,
|
|
472
|
+
enableMultiRowSelection: true,
|
|
473
|
+
pageSizes: [10],
|
|
474
|
+
sortingDirection: "ascending",
|
|
475
|
+
autoFocus: false,
|
|
476
|
+
hideHeader: false,
|
|
477
|
+
hideNoDataView: false,
|
|
478
|
+
alwaysShowSelectionHeader: false,
|
|
479
|
+
noBottomBorder: false,
|
|
480
|
+
};
|
|
@@ -23,14 +23,14 @@ exports.TableOfContentsMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
23
23
|
description: `This property indicates that smooth scrolling is used while scrolling the selected table ` +
|
|
24
24
|
`of contents items into view.`,
|
|
25
25
|
valueType: "boolean",
|
|
26
|
-
defaultValue:
|
|
26
|
+
defaultValue: TableOfContentsNative_1.defaultProps.smoothScrolling,
|
|
27
27
|
},
|
|
28
28
|
maxHeadingLevel: {
|
|
29
29
|
description: "Defines the maximum heading level (1 to 6) to include in the table of contents. " +
|
|
30
30
|
"For example, if it is 2, then `H1` and `H2` are displayed, but lower levels " +
|
|
31
31
|
"(`H3` to `H6`) are not.",
|
|
32
32
|
valueType: "number",
|
|
33
|
-
defaultValue:
|
|
33
|
+
defaultValue: TableOfContentsNative_1.defaultProps.maxHeadingLevel,
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
themeVars: (0, themeVars_1.parseScssVar)(TableOfContents_module_scss_1.default.themeVars),
|
|
@@ -41,8 +41,17 @@ exports.TableOfContentsMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
41
41
|
[`fontSize-${COMP_CHILD}`]: "$fontSize-small",
|
|
42
42
|
[`wordWrap-${COMP_CHILD}`]: "break-word",
|
|
43
43
|
[`paddingVertical-${COMP_CHILD}`]: "$space-1",
|
|
44
|
-
[`
|
|
44
|
+
[`paddingLeft-${COMP_CHILD}`]: "$space-1",
|
|
45
|
+
[`paddingLeft-${COMP_CHILD}-level-2`]: "$space-3",
|
|
46
|
+
[`paddingLeft-${COMP_CHILD}-level-3`]: "$space-5",
|
|
47
|
+
[`paddingLeft-${COMP_CHILD}-level-4`]: "$space-6",
|
|
48
|
+
[`paddingLeft-${COMP_CHILD}-level-5`]: "$space-6",
|
|
49
|
+
[`paddingLeft-${COMP_CHILD}-level-6`]: "$space-6",
|
|
45
50
|
[`fontWeight-${COMP_CHILD}`]: "$fontWeight-bold",
|
|
51
|
+
[`fontWeight-${COMP_CHILD}-level-3`]: "normal",
|
|
52
|
+
[`fontWeight-${COMP_CHILD}-level-4`]: "normal",
|
|
53
|
+
[`fontWeight-${COMP_CHILD}-level-5`]: "normal",
|
|
54
|
+
[`fontWeight-${COMP_CHILD}-level-6`]: "normal",
|
|
46
55
|
[`fontStyle-${COMP_CHILD}-level-6`]: "italic",
|
|
47
56
|
[`color-${COMP_CHILD}--active`]: "$color-primary-500",
|
|
48
57
|
},
|
|
@@ -3,7 +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.TableOfContents = void 0;
|
|
6
|
+
exports.TableOfContents = exports.defaultProps = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const react_2 = require("@remix-run/react");
|
|
@@ -13,7 +13,11 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
13
13
|
const TableOfContents_module_scss_1 = __importDefault(require("./TableOfContents.module.scss"));
|
|
14
14
|
const TableOfContentsContext_1 = require("../../components-core/TableOfContentsContext");
|
|
15
15
|
const hooks_1 = require("../../components-core/utils/hooks");
|
|
16
|
-
exports.
|
|
16
|
+
exports.defaultProps = {
|
|
17
|
+
smoothScrolling: false,
|
|
18
|
+
maxHeadingLevel: 6,
|
|
19
|
+
};
|
|
20
|
+
exports.TableOfContents = (0, react_1.forwardRef)(function TableOfContents({ style, smoothScrolling = exports.defaultProps.smoothScrolling, maxHeadingLevel = exports.defaultProps.maxHeadingLevel }, forwardedRef) {
|
|
17
21
|
const tocRef = (0, react_1.useRef)(null);
|
|
18
22
|
const { headings, scrollToAnchor, subscribeToActiveAnchorChange, activeAnchorId: initialActiveAnchorId } = (0, TableOfContentsContext_1.useTableOfContents)();
|
|
19
23
|
const [activeAnchorId, setActiveId] = (0, react_1.useState)(initialActiveAnchorId);
|
|
@@ -18,13 +18,13 @@ exports.TabsMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
18
18
|
description: `The \`${COMP}\` component provides a tabbed layout where each tab has a clickable label and content.`,
|
|
19
19
|
props: {
|
|
20
20
|
activeTab: (0, ComponentDefs_1.d)(`This property indicates the index of the active tab. The indexing starts from 0, ` +
|
|
21
|
-
`representing the starting (leftmost) tab.`),
|
|
21
|
+
`representing the starting (leftmost) tab. If not set, the first tab is selected by default.`),
|
|
22
22
|
orientation: {
|
|
23
23
|
description: `This property indicates the orientation of the component. In horizontal orientation, ` +
|
|
24
24
|
`the tab sections are laid out on the left side of the content panel, while in vertical ` +
|
|
25
25
|
`orientation, the buttons are at the top.`,
|
|
26
26
|
availableValues: ["horizontal", "vertical"],
|
|
27
|
-
defaultValue:
|
|
27
|
+
defaultValue: TabsNative_1.defaultProps.orientation,
|
|
28
28
|
valueType: "string",
|
|
29
29
|
},
|
|
30
30
|
tabTemplate: (0, metadata_helpers_1.dComponent)(`This property declares the template for the clickable tab area.`),
|
|
@@ -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.Tabs = void 0;
|
|
39
|
+
exports.Tabs = exports.defaultProps = void 0;
|
|
40
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
41
|
const react_1 = require("react");
|
|
42
42
|
const RTabs = __importStar(require("@radix-ui/react-tabs"));
|
|
@@ -44,7 +44,12 @@ const Tabs_module_scss_1 = __importDefault(require("./Tabs.module.scss"));
|
|
|
44
44
|
const misc_1 = require("../../components-core/utils/misc");
|
|
45
45
|
const TabContext_1 = require("../Tabs/TabContext");
|
|
46
46
|
const classnames_1 = __importDefault(require("classnames"));
|
|
47
|
-
exports.
|
|
47
|
+
exports.defaultProps = {
|
|
48
|
+
activeTab: 0,
|
|
49
|
+
orientation: "horizontal",
|
|
50
|
+
distributeEvenly: false,
|
|
51
|
+
};
|
|
52
|
+
exports.Tabs = (0, react_1.forwardRef)(function Tabs({ activeTab = exports.defaultProps.activeTab, orientation = exports.defaultProps.orientation, tabRenderer, style, children, registerComponentApi, className, distributeEvenly = exports.defaultProps.distributeEvenly, }, forwardedRef) {
|
|
48
53
|
const { tabItems, tabContextValue } = (0, TabContext_1.useTabContextValue)();
|
|
49
54
|
const [activeIndex, setActiveIndex] = (0, react_1.useState)(activeTab);
|
|
50
55
|
const currentTab = (0, react_1.useMemo)(() => {
|
|
@@ -37,17 +37,18 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
37
37
|
},
|
|
38
38
|
maxLines: (0, ComponentDefs_1.d)("This property determines the maximum number of lines the component can wrap to. " +
|
|
39
39
|
"If there is no space to display all the contents, the component displays up to as " +
|
|
40
|
-
"many lines as specified in this property. When the value is not defined, there is
|
|
40
|
+
"many lines as specified in this property. When the value is not defined, there is " +
|
|
41
|
+
"no limit on the displayed lines."),
|
|
41
42
|
preserveLinebreaks: {
|
|
42
43
|
description: `This property indicates if linebreaks should be preserved when displaying text.`,
|
|
43
44
|
valueType: "boolean",
|
|
44
|
-
defaultValue:
|
|
45
|
+
defaultValue: TextNative_1.defaultProps.preserveLinebreaks,
|
|
45
46
|
},
|
|
46
47
|
ellipses: {
|
|
47
48
|
description: "This property indicates whether ellipses should be displayed when the text is " +
|
|
48
49
|
"cropped (\`true\`) or not (\`false\`).",
|
|
49
50
|
valueType: "boolean",
|
|
50
|
-
defaultValue:
|
|
51
|
+
defaultValue: TextNative_1.defaultProps.ellipses,
|
|
51
52
|
},
|
|
52
53
|
},
|
|
53
54
|
themeVars: (0, themeVars_1.parseScssVar)(Text_module_scss_1.default.themeVars),
|
|
@@ -56,7 +57,7 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
56
57
|
[`borderStyle-${COMP}`]: "solid",
|
|
57
58
|
[`fontSize-${COMP}`]: "$fontSize-small",
|
|
58
59
|
[`borderWidth-${COMP}`]: "$space-0",
|
|
59
|
-
[`lineHeight-${COMP}-codefence`]: "1.
|
|
60
|
+
[`lineHeight-${COMP}-codefence`]: "1.5",
|
|
60
61
|
[`fontWeight-${COMP}-abbr`]: "$fontWeight-bold",
|
|
61
62
|
[`textTransform-${COMP}-abbr`]: "uppercase",
|
|
62
63
|
[`fontSize-${COMP}-secondary`]: "$fontSize-small",
|
|
@@ -64,13 +65,13 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
64
65
|
[`textColor-${COMP}`]: "$textColor-primary",
|
|
65
66
|
[`fontFamily-${COMP}`]: "$fontFamily",
|
|
66
67
|
[`fontWeight-${COMP}`]: "$fontWeight-normal",
|
|
67
|
-
[`fontSize-${COMP}-codefence`]: "$fontSize-
|
|
68
|
+
[`fontSize-${COMP}-codefence`]: "$fontSize-code",
|
|
68
69
|
[`fontFamily-${COMP}-code`]: "$fontFamily-monospace",
|
|
69
70
|
[`fontSize-${COMP}-code`]: "$fontSize-small",
|
|
70
71
|
[`borderWidth-${COMP}-code`]: "1px",
|
|
71
72
|
[`borderStyle-${COMP}-code`]: "solid",
|
|
72
73
|
[`borderRadius-${COMP}-code`]: "4px",
|
|
73
|
-
[`paddingHorizontal-${COMP}-code`]: "$space-
|
|
74
|
+
[`paddingHorizontal-${COMP}-code`]: "$space-0_5",
|
|
74
75
|
[`paddingBottom-${COMP}-code`]: "2px",
|
|
75
76
|
[`textDecorationLine-${COMP}-deleted`]: "line-through",
|
|
76
77
|
[`textDecorationLine-${COMP}-inserted`]: "underline",
|
|
@@ -93,7 +94,7 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
93
94
|
[`fontSize-${COMP}-small`]: "$fontSize-small",
|
|
94
95
|
[`lineHeight-${COMP}-small`]: "$lineHeight-tight",
|
|
95
96
|
[`letterSpacing-${COMP}-caption`]: "0.05rem",
|
|
96
|
-
[`fontSize-${COMP}-placeholder`]: "$fontSize-
|
|
97
|
+
[`fontSize-${COMP}-placeholder`]: "$fontSize-smaller",
|
|
97
98
|
[`fontFamily-${COMP}-codefence`]: "$fontFamily-monospace",
|
|
98
99
|
[`paddingHorizontal-${COMP}-codefence`]: "$space-3",
|
|
99
100
|
[`paddingVertical-${COMP}-codefence`]: "$space-2",
|
|
@@ -109,18 +110,18 @@ exports.TextMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
109
110
|
[`fontWeight-${COMP}-tableheading`]: "$fontWeight-bold",
|
|
110
111
|
[`marginTop-${COMP}-markdown`]: "$space-3",
|
|
111
112
|
[`marginBottom-${COMP}-markdown`]: "$space-6",
|
|
112
|
-
[`backgroundColor-${COMP}-code`]: "
|
|
113
|
+
[`backgroundColor-${COMP}-code`]: "rgb(from $color-surface-100 r g b / 0.4)",
|
|
113
114
|
[`borderColor-${COMP}-code`]: "$color-surface-100",
|
|
114
|
-
[`backgroundColor-${COMP}-keyboard`]: "
|
|
115
|
+
[`backgroundColor-${COMP}-keyboard`]: "rgb(from $color-surface-100 r g b / 0.4)",
|
|
115
116
|
[`borderColor-${COMP}-keyboard`]: "$color-surface-300",
|
|
116
|
-
[`backgroundColor-${COMP}-marked`]: "
|
|
117
|
+
[`backgroundColor-${COMP}-marked`]: "rgb(from $color-primary-200 r g b / 0.4)",
|
|
117
118
|
[`color-${COMP}-placeholder`]: "$color-surface-500",
|
|
118
119
|
[`color-${COMP}-codefence`]: "$color-surface-900",
|
|
119
120
|
[`color-${COMP}-subheading`]: "$textColor-secondary",
|
|
120
121
|
[`color-${COMP}-secondary`]: "$textColor-secondary",
|
|
121
122
|
dark: {
|
|
122
|
-
[`backgroundColor-${COMP}-marked`]: "
|
|
123
|
-
}
|
|
123
|
+
[`backgroundColor-${COMP}-marked`]: "rgb(from $color-primary-400 r g b / 0.4)",
|
|
124
|
+
},
|
|
124
125
|
},
|
|
125
126
|
});
|
|
126
127
|
exports.textComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.TextMd, ({ node, extractValue, layoutCss, renderChild }) => {
|
|
@@ -128,5 +129,5 @@ exports.textComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, e
|
|
|
128
129
|
const variantSpecificProps = Object.fromEntries(Object.entries(variantSpecific)
|
|
129
130
|
.filter(([key, _]) => abstractions_1.VariantPropsKeys.includes(key))
|
|
130
131
|
.map(([key, value]) => [key, extractValue(value)]));
|
|
131
|
-
return ((0, jsx_runtime_1.jsx)(TextNative_1.Text, Object.assign({ variant: extractValue(variant), maxLines: extractValue.asOptionalNumber(maxLines), style: layoutCss, preserveLinebreaks: extractValue.asOptionalBoolean(preserveLinebreaks,
|
|
132
|
+
return ((0, jsx_runtime_1.jsx)(TextNative_1.Text, Object.assign({ variant: extractValue(variant), maxLines: extractValue.asOptionalNumber(maxLines), style: layoutCss, preserveLinebreaks: extractValue.asOptionalBoolean(preserveLinebreaks, TextNative_1.defaultProps.preserveLinebreaks), ellipses: extractValue.asOptionalBoolean(ellipses, TextNative_1.defaultProps.ellipses) }, variantSpecificProps, { children: extractValue.asDisplayText(value) || renderChild(node.children) })));
|
|
132
133
|
});
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Text = void 0;
|
|
17
|
+
exports.Text = exports.defaultProps = void 0;
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const react_1 = require("react");
|
|
20
20
|
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
@@ -22,8 +22,13 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
22
22
|
const Text_module_scss_1 = __importDefault(require("./Text.module.scss"));
|
|
23
23
|
const css_utils_1 = require("../../components-core/utils/css-utils");
|
|
24
24
|
const abstractions_1 = require("../abstractions");
|
|
25
|
+
exports.defaultProps = {
|
|
26
|
+
maxLines: 0,
|
|
27
|
+
preserveLinebreaks: false,
|
|
28
|
+
ellipses: true,
|
|
29
|
+
};
|
|
25
30
|
exports.Text = (0, react_1.forwardRef)(function Text(_a, forwardedRef) {
|
|
26
|
-
var { uid, variant, maxLines =
|
|
31
|
+
var { uid, variant, maxLines = exports.defaultProps.maxLines, style, children, preserveLinebreaks = exports.defaultProps.preserveLinebreaks, ellipses = exports.defaultProps.ellipses } = _a, variantSpecificProps = __rest(_a, ["uid", "variant", "maxLines", "style", "children", "preserveLinebreaks", "ellipses"]);
|
|
27
32
|
const innerRef = (0, react_1.useRef)(null);
|
|
28
33
|
const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(innerRef, forwardedRef) : innerRef;
|
|
29
34
|
// NOTE: This is to accept syntax highlight classes coming from shiki
|
|
@@ -26,7 +26,7 @@ exports.TextAreaMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
26
26
|
description: "This optional boolean property indicates whether pressing the \`Enter\` key on the " +
|
|
27
27
|
"keyboard prompts the parent \`Form\` component to submit.",
|
|
28
28
|
valueType: "boolean",
|
|
29
|
-
defaultValue:
|
|
29
|
+
defaultValue: TextAreaNative_1.defaultProps.enterSubmits,
|
|
30
30
|
},
|
|
31
31
|
escResets: {
|
|
32
32
|
description: `This boolean property indicates whether the ${COMP} contents should be reset when pressing ` +
|
|
@@ -34,12 +34,14 @@ exports.TextAreaMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
34
34
|
valueType: "boolean",
|
|
35
35
|
defaultValue: false,
|
|
36
36
|
},
|
|
37
|
-
maxRows: (0, ComponentDefs_1.d)(`This optional property sets the maximum number of text rows the \`${COMP}\`
|
|
38
|
-
|
|
37
|
+
maxRows: (0, ComponentDefs_1.d)(`This optional property sets the maximum number of text rows the \`${COMP}\` ` +
|
|
38
|
+
"can grow. If not set, the number of rows is unlimited."),
|
|
39
|
+
minRows: (0, ComponentDefs_1.d)(`This optional property sets the minimum number of text rows the \`${COMP}\` can shrink. ` +
|
|
40
|
+
`If not set, the minimum number of rows is 1.`),
|
|
39
41
|
rows: {
|
|
40
42
|
description: `Specifies the number of rows the component initially has.`,
|
|
41
43
|
valueType: "number",
|
|
42
|
-
defaultValue:
|
|
44
|
+
defaultValue: TextAreaNative_1.defaultProps.rows,
|
|
43
45
|
},
|
|
44
46
|
autoSize: {
|
|
45
47
|
description: `If set to \`true\`, this boolean property enables the \`${COMP}\` to resize ` +
|
|
@@ -59,7 +61,8 @@ exports.TextAreaMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
59
61
|
readOnly: (0, metadata_helpers_1.dReadonly)(),
|
|
60
62
|
enabled: (0, metadata_helpers_1.dEnabled)(),
|
|
61
63
|
validationStatus: (0, metadata_helpers_1.dValidationStatus)(),
|
|
62
|
-
resize: {
|
|
64
|
+
resize: {
|
|
65
|
+
description: `This optional property specifies in which dimensions can the \`TextArea\` ` +
|
|
63
66
|
`be resized by the user.`,
|
|
64
67
|
availableValues: exports.resizeOptionsMd,
|
|
65
68
|
},
|
|
@@ -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.TextArea = exports.resizeOptionKeys = void 0;
|
|
39
|
+
exports.TextArea = exports.defaultProps = exports.resizeOptionKeys = void 0;
|
|
40
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
41
|
const react_1 = __importStar(require("react"));
|
|
42
42
|
const classnames_1 = __importDefault(require("classnames"));
|
|
@@ -53,7 +53,24 @@ const resizeMap = {
|
|
|
53
53
|
vertical: TextArea_module_scss_1.default.resizeVertical,
|
|
54
54
|
both: TextArea_module_scss_1.default.resizeBoth,
|
|
55
55
|
};
|
|
56
|
-
exports.
|
|
56
|
+
exports.defaultProps = {
|
|
57
|
+
value: "",
|
|
58
|
+
placeholder: "",
|
|
59
|
+
required: false,
|
|
60
|
+
readOnly: false,
|
|
61
|
+
allowCopy: true,
|
|
62
|
+
updateState: constants_1.noop,
|
|
63
|
+
autoFocus: false,
|
|
64
|
+
initialValue: "",
|
|
65
|
+
onDidChange: constants_1.noop,
|
|
66
|
+
onFocus: constants_1.noop,
|
|
67
|
+
onBlur: constants_1.noop,
|
|
68
|
+
controlled: true,
|
|
69
|
+
enterSubmits: true,
|
|
70
|
+
rows: 2,
|
|
71
|
+
enabled: true
|
|
72
|
+
};
|
|
73
|
+
exports.TextArea = (0, react_1.forwardRef)(function TextArea({ id, value = exports.defaultProps.value, placeholder = exports.defaultProps.placeholder, required = exports.defaultProps.required, readOnly = exports.defaultProps.readOnly, allowCopy = exports.defaultProps.allowCopy, updateState = exports.defaultProps.updateState, validationStatus, autoFocus = exports.defaultProps.autoFocus, initialValue = exports.defaultProps.initialValue, resize, onDidChange = exports.defaultProps.onDidChange, onFocus = exports.defaultProps.onFocus, onBlur = exports.defaultProps.onBlur, controlled = exports.defaultProps.controlled, enterSubmits = exports.defaultProps.enterSubmits, escResets, style, registerComponentApi, autoSize, maxRows, minRows, maxLength, rows = exports.defaultProps.rows, enabled = exports.defaultProps.enabled, label, labelPosition, labelWidth, labelBreak, }, forwardedRef) {
|
|
57
74
|
// --- The component is initially unfocused
|
|
58
75
|
const inputRef = (0, react_1.useRef)(null);
|
|
59
76
|
const [cursorPosition, setCursorPosition] = (0, react_1.useState)(null);
|