xmlui 0.7.25 → 0.7.26
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-B0H9MD6w.mjs → apiInterceptorWorker-BlvgbCSf.mjs} +1 -1
- package/dist/{index-Brmiu4kS.mjs → index-CWLnzVw7.mjs} +8765 -8618
- package/dist/index.css +1 -1
- package/dist/scripts/src/abstractions/ComponentDefs.js +2 -2
- package/dist/scripts/src/components/Accordion/Accordion.js +1 -1
- package/dist/scripts/src/components/App/App.js +1 -0
- package/dist/scripts/src/components/App/AppNative.js +9 -3
- package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -12
- package/dist/scripts/src/components/Avatar/Avatar.js +2 -4
- package/dist/scripts/src/components/Badge/Badge.js +6 -1
- package/dist/scripts/src/components/Bookmark/BookmarkNative.js +1 -1
- package/dist/scripts/src/components/Button/Button.js +74 -24
- package/dist/scripts/src/components/Button/ButtonNative.js +11 -3
- package/dist/scripts/src/components/Column/Column.js +24 -1
- package/dist/scripts/src/components/Column/ColumnNative.js +8 -2
- package/dist/scripts/src/components/Footer/Footer.js +13 -10
- package/dist/scripts/src/components/Form/Form.js +7 -1
- package/dist/scripts/src/components/Form/FormNative.js +31 -2
- package/dist/scripts/src/components/Heading/Heading.js +5 -4
- package/dist/scripts/src/components/Heading/HeadingNative.js +4 -4
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +1 -1
- package/dist/scripts/src/components/Link/Link.js +1 -0
- package/dist/scripts/src/components/NavLink/NavLink.js +1 -0
- package/dist/scripts/src/components/NavPanel/NavPanel.js +12 -4
- package/dist/scripts/src/components/NoResult/NoResult.js +1 -0
- package/dist/scripts/src/components/Pages/PagesNative.js +1 -1
- package/dist/scripts/src/components/Select/SelectNative.js +17 -17
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +16 -4
- package/dist/scripts/src/components/Table/Table.js +2 -7
- package/dist/scripts/src/components/Table/TableNative.js +1 -1
- package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +18 -9
- package/dist/scripts/src/components/abstractions.js +1 -2
- package/dist/scripts/src/components/metadata-helpers.js +2 -1
- package/dist/scripts/src/components-core/TableOfContentsContext.js +21 -10
- package/dist/scripts/src/components-core/loader/DataLoader.js +6 -2
- package/dist/scripts/src/components-core/rendering/valueExtractor.js +5 -2
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +4 -1
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +55 -59
- package/dist/scripts/src/components-core/utils/hooks.js +73 -1
- package/dist/style.css +1 -1
- package/dist/xmlui-metadata.mjs +3488 -3381
- package/dist/xmlui-metadata.umd.js +17 -17
- package/dist/xmlui-standalone.umd.js +181 -181
- package/dist/xmlui.d.ts +11 -6
- package/dist/xmlui.mjs +1 -1
- package/package.json +10 -12
|
@@ -50,13 +50,13 @@ const constants_1 = require("../../components-core/constants");
|
|
|
50
50
|
const ThemeContext_1 = require("../../components-core/theming/ThemeContext");
|
|
51
51
|
const misc_1 = require("../../components-core/utils/misc");
|
|
52
52
|
const IconNative_1 = __importDefault(require("../Icon/IconNative"));
|
|
53
|
-
const SelectContext_1 = require("
|
|
53
|
+
const SelectContext_1 = require("./SelectContext");
|
|
54
54
|
const OptionTypeProvider_1 = __importDefault(require("../Option/OptionTypeProvider"));
|
|
55
|
-
const OptionContext_1 = require("
|
|
55
|
+
const OptionContext_1 = require("./OptionContext");
|
|
56
56
|
const ItemWithLabel_1 = require("../FormItem/ItemWithLabel");
|
|
57
57
|
const SimpleSelect = (0, react_1.forwardRef)(function SimpleSelect(props, forwardedRef) {
|
|
58
58
|
const { root } = (0, ThemeContext_1.useTheme)();
|
|
59
|
-
const { enabled, onBlur, autoFocus, onValueChange, validationStatus, children, value, height, style, placeholder, id, triggerRef, onFocus, options
|
|
59
|
+
const { enabled, onBlur, autoFocus, onValueChange, validationStatus, children, value, height, style, placeholder, id, triggerRef, onFocus, options } = props;
|
|
60
60
|
const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(triggerRef, forwardedRef) : triggerRef;
|
|
61
61
|
const stringValue = value + "";
|
|
62
62
|
const onValChange = (0, react_1.useCallback)((val) => {
|
|
@@ -67,10 +67,10 @@ const SimpleSelect = (0, react_1.forwardRef)(function SimpleSelect(props, forwar
|
|
|
67
67
|
return ((0, jsx_runtime_1.jsx)(OptionTypeProvider_1.default, { Component: SelectOption, children: (0, jsx_runtime_1.jsxs)(react_select_1.Root, { value: stringValue, onValueChange: onValChange, children: [(0, jsx_runtime_1.jsxs)(react_select_1.Trigger, { id: id, style: style, onFocus: onFocus, onBlur: onBlur, disabled: !enabled, className: (0, classnames_1.default)(Select_module_scss_1.default.selectTrigger, {
|
|
68
68
|
[Select_module_scss_1.default.error]: validationStatus === "error",
|
|
69
69
|
[Select_module_scss_1.default.warning]: validationStatus === "warning",
|
|
70
|
-
[Select_module_scss_1.default.valid]: validationStatus === "valid"
|
|
70
|
+
[Select_module_scss_1.default.valid]: validationStatus === "valid"
|
|
71
71
|
}), ref: ref, autoFocus: autoFocus, children: [(0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.selectValue, children: (0, jsx_runtime_1.jsx)(react_select_1.Value, { placeholder: placeholder }) }), (0, jsx_runtime_1.jsx)(react_select_1.Icon, { asChild: true, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" }) })] }), (0, jsx_runtime_1.jsx)(react_select_1.Portal, { container: root, children: (0, jsx_runtime_1.jsxs)(react_select_1.Content, { className: Select_module_scss_1.default.selectContent, position: "popper", style: { height: height }, children: [(0, jsx_runtime_1.jsx)(react_select_1.ScrollUpButton, { className: Select_module_scss_1.default.selectScrollUpButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevronup" }) }), (0, jsx_runtime_1.jsx)(react_select_1.Viewport, { className: (0, classnames_1.default)(Select_module_scss_1.default.selectViewport), children: children }), (0, jsx_runtime_1.jsx)(react_select_1.ScrollDownButton, { className: Select_module_scss_1.default.selectScrollDownButton, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" }) })] }) })] }) }));
|
|
72
72
|
});
|
|
73
|
-
exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, value, enabled = true, placeholder, updateState = constants_1.noop, validationStatus = "none", onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, emptyListTemplate, optionLabelRenderer, valueRenderer, style, dropdownHeight, children, autoFocus = false, searchable = false, multiSelect = false, label, labelPosition, labelWidth, labelBreak, required = false
|
|
73
|
+
exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, value, enabled = true, placeholder, updateState = constants_1.noop, validationStatus = "none", onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, emptyListTemplate, optionLabelRenderer, valueRenderer, style, dropdownHeight, children, autoFocus = false, searchable = false, multiSelect = false, label, labelPosition, labelWidth, labelBreak, required = false }, ref) {
|
|
74
74
|
var _a;
|
|
75
75
|
const [referenceElement, setReferenceElement] = (0, react_1.useState)(null);
|
|
76
76
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
@@ -129,7 +129,7 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
|
|
|
129
129
|
(0, react_1.useEffect)(() => {
|
|
130
130
|
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
131
131
|
focus,
|
|
132
|
-
setValue
|
|
132
|
+
setValue
|
|
133
133
|
});
|
|
134
134
|
}, [focus, registerComponentApi, setValue]);
|
|
135
135
|
// Render the "empty list" message
|
|
@@ -146,17 +146,17 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
|
|
|
146
146
|
}, []);
|
|
147
147
|
const optionContextValue = (0, react_1.useMemo)(() => ({
|
|
148
148
|
onOptionAdd,
|
|
149
|
-
onOptionRemove
|
|
149
|
+
onOptionRemove
|
|
150
150
|
}), [onOptionAdd, onOptionRemove]);
|
|
151
151
|
const selectContextValue = (0, react_1.useMemo)(() => ({
|
|
152
152
|
multiSelect,
|
|
153
153
|
value,
|
|
154
154
|
optionLabelRenderer,
|
|
155
|
-
onChange: toggleOption
|
|
155
|
+
onChange: toggleOption
|
|
156
156
|
}), [multiSelect, toggleOption, value, optionLabelRenderer]);
|
|
157
157
|
return ((0, jsx_runtime_1.jsx)(SelectContext_1.SelectContext.Provider, { value: selectContextValue, children: (0, jsx_runtime_1.jsx)(OptionContext_1.OptionContext.Provider, { value: optionContextValue, children: searchable || multiSelect ? ((0, jsx_runtime_1.jsxs)(OptionTypeProvider_1.default, { Component: HiddenOption, children: [children, (0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: ref, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsxs)(react_popover_1.Popover, { open: open, onOpenChange: setOpen, modal: false, children: [(0, jsx_runtime_1.jsx)(react_popover_1.PopoverTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)("button", { id: id, ref: setReferenceElement, onFocus: onFocus, onBlur: onBlur, disabled: !enabled, "aria-expanded": open, onClick: () => setOpen((prev) => !prev), className: (0, classnames_1.default)(Select_module_scss_1.default.selectTrigger, Select_module_scss_1.default[validationStatus], {
|
|
158
158
|
[Select_module_scss_1.default.disabled]: !enabled,
|
|
159
|
-
[Select_module_scss_1.default.multi]: multiSelect
|
|
159
|
+
[Select_module_scss_1.default.multi]: multiSelect
|
|
160
160
|
}), autoFocus: autoFocus, children: [multiSelect ? (Array.isArray(value) && value.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.badgeListContainer, children: (0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.badgeList, children: value.map((v) => {
|
|
161
161
|
var _a;
|
|
162
162
|
return valueRenderer ? (valueRenderer(Array.from(options).find((o) => o.value === v), () => {
|
|
@@ -168,14 +168,14 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
|
|
|
168
168
|
}) }) })) : ((0, jsx_runtime_1.jsx)("span", { className: Select_module_scss_1.default.placeholder, children: placeholder || "" }))) : value !== undefined && value !== null ? ((0, jsx_runtime_1.jsx)("div", { children: (_a = Array.from(options).find((o) => o.value === value)) === null || _a === void 0 ? void 0 : _a.label })) : ((0, jsx_runtime_1.jsx)("span", { className: Select_module_scss_1.default.placeholder, children: placeholder || "" })), (0, jsx_runtime_1.jsxs)("div", { className: Select_module_scss_1.default.actions, children: [multiSelect && Array.isArray(value) && value.length > 0 && ((0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "close", onClick: (event) => {
|
|
169
169
|
event.stopPropagation();
|
|
170
170
|
clearValue();
|
|
171
|
-
} })), (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" })] })] }) }),
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
171
|
+
} })), (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" })] })] }) }), open && ((0, jsx_runtime_1.jsx)(react_popover_1.PopoverContent, { style: { width, height: dropdownHeight }, className: Select_module_scss_1.default.selectContent, children: (0, jsx_runtime_1.jsxs)(cmdk_1.Command, { className: Select_module_scss_1.default.command, shouldFilter: searchable, filter: (value, search, keywords) => {
|
|
172
|
+
const extendedValue = value + " " + keywords.join(" ");
|
|
173
|
+
if (extendedValue.toLowerCase().includes(search.toLowerCase()))
|
|
174
|
+
return 1;
|
|
175
|
+
return 0;
|
|
176
|
+
}, children: [searchable ? ((0, jsx_runtime_1.jsxs)("div", { className: Select_module_scss_1.default.commandInputContainer, children: [(0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "search" }), (0, jsx_runtime_1.jsx)(cmdk_1.CommandInput, { className: (0, classnames_1.default)(Select_module_scss_1.default.commandInput), placeholder: "Search..." })] })) : (
|
|
177
|
+
// https://github.com/pacocoursey/cmdk/issues/322#issuecomment-2444703817
|
|
178
|
+
(0, jsx_runtime_1.jsx)("button", { autoFocus: true, "aria-hidden": "true", className: Select_module_scss_1.default.srOnly })), (0, jsx_runtime_1.jsxs)(cmdk_1.CommandList, { className: Select_module_scss_1.default.commandList, children: [Array.from(options).map(({ value, label, enabled, keywords }) => ((0, jsx_runtime_1.jsx)(exports.ComboboxOption, { value: value, label: label, enabled: enabled, keywords: keywords }, value))), (0, jsx_runtime_1.jsx)(cmdk_1.CommandEmpty, { children: emptyListNode })] })] }) }))] }) })] })) : ((0, jsx_runtime_1.jsx)(SimpleSelect, { ref: ref, value: value, options: options, onValueChange: toggleOption, id: id, style: style, onFocus: onFocus, onBlur: onBlur, enabled: enabled, validationStatus: validationStatus, triggerRef: setReferenceElement, autoFocus: autoFocus, placeholder: placeholder, height: dropdownHeight, children: children || emptyListNode })) }) }));
|
|
179
179
|
});
|
|
180
180
|
exports.ComboboxOption = (0, react_1.forwardRef)(function Combobox(option, forwardedRef) {
|
|
181
181
|
const id = (0, react_1.useId)();
|
|
@@ -5,11 +5,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.StickyBox = StickyBox;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
8
9
|
const classnames_1 = __importDefault(require("classnames"));
|
|
10
|
+
const react_sticky_el_1 = __importDefault(require("react-sticky-el"));
|
|
9
11
|
const StickyBox_module_scss_1 = __importDefault(require("./StickyBox.module.scss"));
|
|
12
|
+
const hooks_1 = require("../../components-core/utils/hooks");
|
|
10
13
|
function StickyBox({ children, uid, layout, to = "top" }) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
const sentinelRef = (0, react_1.useRef)(null);
|
|
15
|
+
const [wrapper, setWrapper] = (0, react_1.useState)(null);
|
|
16
|
+
const [stuck, setStuck] = (0, react_1.useState)(false);
|
|
17
|
+
const scrollParent = (0, hooks_1.useScrollParent)(sentinelRef.current);
|
|
18
|
+
const realBackground = (0, hooks_1.useRealBackground)(scrollParent);
|
|
19
|
+
(0, react_1.useEffect)(() => {
|
|
20
|
+
if (wrapper) {
|
|
21
|
+
console.log(wrapper.innerHeight);
|
|
22
|
+
document.documentElement.style.setProperty("--xmlui-scroll-margin-top", wrapper.clientHeight + "px");
|
|
23
|
+
// scrollParent.setAttribute("data-xmlui-scroll-padding", true);
|
|
24
|
+
}
|
|
25
|
+
}, [scrollParent, wrapper]);
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [scrollParent && ((0, jsx_runtime_1.jsx)(react_sticky_el_1.default, { scrollElement: scrollParent, wrapperClassName: (0, classnames_1.default)(StickyBox_module_scss_1.default.wrapper), mode: to, onFixedToggle: setStuck, stickyStyle: Object.assign({ backgroundColor: realBackground }, layout), children: (0, jsx_runtime_1.jsx)("div", { ref: setWrapper, children: children }) })), (0, jsx_runtime_1.jsx)("div", { style: { display: "none" }, ref: sentinelRef, className: to === "top" ? StickyBox_module_scss_1.default.sentinel : "" })] }));
|
|
15
27
|
}
|
|
@@ -80,16 +80,12 @@ exports.TableMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
80
80
|
},
|
|
81
81
|
themeVars: (0, themeVars_1.parseScssVar)(Table_module_scss_1.default.themeVars),
|
|
82
82
|
defaultThemeVars: {
|
|
83
|
-
[`padding-
|
|
84
|
-
[`padding-vertical-heading-${COMP}`]: "$space-2",
|
|
85
|
-
[`padding-heading-${COMP}`]: `$padding-vertical-heading-${COMP} $padding-horizontal-heading-${COMP}`,
|
|
83
|
+
[`padding-heading-${COMP}`]: `$space-2`,
|
|
86
84
|
[`padding-horizontal-cell-${COMP}`]: "$space-2",
|
|
87
85
|
[`padding-horizontal-cell-first-${COMP}`]: "$space-5",
|
|
88
86
|
[`padding-horizontal-cell-last-${COMP}`]: "$space-5",
|
|
89
87
|
[`padding-vertical-cell-${COMP}`]: "$space-2",
|
|
90
|
-
[`
|
|
91
|
-
[`style-border-cell-${COMP}`]: "solid",
|
|
92
|
-
[`border-cell-${COMP}`]: `$thickness-border-cell-${COMP} $style-border-cell-${COMP} $color-border-cell-${COMP}`,
|
|
88
|
+
[`border-cell-${COMP}`]: "1px solid $color-border",
|
|
93
89
|
[`thickness-outline-heading-${COMP}--focus`]: "$thickness-outline--focus",
|
|
94
90
|
[`style-outline-heading-${COMP}--focus`]: "$style-outline--focus",
|
|
95
91
|
[`offset-outline-heading-${COMP}--focus`]: "$offset-outline--focus",
|
|
@@ -99,7 +95,6 @@ exports.TableMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
99
95
|
[`font-size-row-${COMP}`]: "$font-size-small",
|
|
100
96
|
[`color-bg-${COMP}`]: "$color-bg",
|
|
101
97
|
[`color-bg-row-${COMP}`]: "inherit",
|
|
102
|
-
[`color-border-cell-${COMP}`]: "$color-border",
|
|
103
98
|
[`color-bg-selected-${COMP}--hover`]: `$color-bg-row-${COMP}--hover`,
|
|
104
99
|
[`color-bg-pagination-${COMP}`]: `$color-bg-${COMP}`,
|
|
105
100
|
[`color-outline-heading-${COMP}--focus`]: "$color-outline--focus",
|
|
@@ -444,7 +444,7 @@ exports.Table = (0, react_1.forwardRef)(({ data = constants_1.EMPTY_ARRAY, colum
|
|
|
444
444
|
return ((0, jsx_runtime_1.jsx)("td", { className: Table_module_scss_1.default.cell, style: Object.assign({
|
|
445
445
|
// width: size,
|
|
446
446
|
width: size }, getCommonPinningStyles(cell.column)), children: cellRenderer
|
|
447
|
-
? cellRenderer(cell.row.original)
|
|
447
|
+
? cellRenderer(cell.row.original, rowIndex, i, cell === null || cell === void 0 ? void 0 : cell.getValue())
|
|
448
448
|
: (0, react_table_1.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, `${cell.id}-${i}`));
|
|
449
449
|
}) }, `${row.id}-${rowIndex}`));
|
|
450
450
|
}), 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 &&
|
|
@@ -12,10 +12,12 @@ const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
|
12
12
|
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
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
15
16
|
exports.TableOfContents = (0, react_1.forwardRef)(function TableOfContents({ style, smoothScrolling, maxHeadingLevel = 6 }, forwardedRef) {
|
|
16
17
|
const tocRef = (0, react_1.useRef)(null);
|
|
17
18
|
const { headings, setObserveIntersection, activeAnchorId, setActiveAnchorId } = (0, TableOfContentsContext_1.useTableOfContents)();
|
|
18
19
|
const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(tocRef, forwardedRef) : tocRef;
|
|
20
|
+
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
19
21
|
(0, react_1.useEffect)(() => {
|
|
20
22
|
setObserveIntersection(true);
|
|
21
23
|
}, [setObserveIntersection]);
|
|
@@ -44,16 +46,23 @@ exports.TableOfContents = (0, react_1.forwardRef)(function TableOfContents({ sty
|
|
|
44
46
|
[TableOfContents_module_scss_1.default.head_4]: value.level === 4,
|
|
45
47
|
[TableOfContents_module_scss_1.default.head_5]: value.level === 5,
|
|
46
48
|
[TableOfContents_module_scss_1.default.head_6]: value.level === 6,
|
|
47
|
-
}), to: `#${value.id}`, onClick: () => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
55
|
-
}
|
|
49
|
+
}), to: `#${value.id}`, onClick: (event) => {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
value.anchor.scrollIntoView({
|
|
52
|
+
block: "start",
|
|
53
|
+
inline: "start",
|
|
54
|
+
behavior: smoothScrolling ? "smooth" : "auto",
|
|
55
|
+
});
|
|
56
56
|
setActiveAnchorId(value.id);
|
|
57
|
+
requestAnimationFrame(() => {
|
|
58
|
+
navigate({
|
|
59
|
+
hash: `#${value.id}`,
|
|
60
|
+
}, {
|
|
61
|
+
state: {
|
|
62
|
+
preventHashScroll: true
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
});
|
|
57
66
|
}, id: value.id, children: value.text }) }, value.id));
|
|
58
67
|
}
|
|
59
68
|
return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VariantPropsKeys = exports.variantOptionsMd = exports.TextVariantElement = exports.orderingValues = exports.scrollAnchoringNames = exports.scrollAnchoringValues = exports.validationStatusMd = exports.validationStatusNames = exports.validationStatusValues = exports.triggerPositionNames = exports.labelPositionMd = exports.labelPositionNames = exports.labelPositionValues = exports.placementMd = exports.placementNames = exports.statusColorMd = exports.statusColorNames = exports.iconPositionMd = exports.iconPositionNames = exports.iconPositionValues = exports.orientationOptionMd = exports.orientationOptionNames = exports.alignmentOptionMd = exports.alignmentOptionNames = exports.alignmentOptionValues = exports.buttonAriaNames = exports.buttonVariantMd = exports.buttonVariantNames = exports.
|
|
3
|
+
exports.VariantPropsKeys = exports.variantOptionsMd = exports.TextVariantElement = exports.orderingValues = exports.scrollAnchoringNames = exports.scrollAnchoringValues = exports.validationStatusMd = exports.validationStatusNames = exports.validationStatusValues = exports.triggerPositionNames = exports.labelPositionMd = exports.labelPositionNames = exports.labelPositionValues = exports.placementMd = exports.placementNames = exports.statusColorMd = exports.statusColorNames = exports.iconPositionMd = exports.iconPositionNames = exports.iconPositionValues = exports.orientationOptionMd = exports.orientationOptionNames = exports.alignmentOptionMd = exports.alignmentOptionNames = exports.alignmentOptionValues = exports.buttonAriaNames = exports.buttonVariantMd = exports.buttonVariantNames = exports.buttonTypesMd = exports.buttonTypeNames = exports.buttonTypeValues = exports.buttonThemeMd = exports.buttonThemeNames = exports.sizeNames = exports.sizeMd = exports.viewportSizeNames = exports.viewportSizeMd = exports.LinkTargetMd = exports.LinkTargetNames = void 0;
|
|
4
4
|
exports.LinkTargetNames = ["_self", "_blank", "_parent", "_top", "_unfencedTop"];
|
|
5
5
|
exports.LinkTargetMd = [
|
|
6
6
|
{
|
|
@@ -71,7 +71,6 @@ exports.buttonTypesMd = [
|
|
|
71
71
|
description: "Resets all the controls to their initial values. Using it is ill advised for UX reasons.",
|
|
72
72
|
},
|
|
73
73
|
];
|
|
74
|
-
exports.defaultButtonType = "button";
|
|
75
74
|
// --- Available button variants
|
|
76
75
|
const buttonVariantValues = ["solid", "outlined", "ghost"];
|
|
77
76
|
exports.buttonVariantNames = [...buttonVariantValues];
|
|
@@ -235,11 +235,12 @@ function dTriggerTemplate(comp) {
|
|
|
235
235
|
valueType: "ComponentDef",
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
|
-
function dOrientation(defaultValue) {
|
|
238
|
+
function dOrientation(defaultValue, isRequired = false) {
|
|
239
239
|
return {
|
|
240
240
|
description: `This property sets the main axis along which the nested components are rendered.`,
|
|
241
241
|
availableValues: abstractions_1.orientationOptionMd,
|
|
242
242
|
valueType: "string",
|
|
243
243
|
defaultValue,
|
|
244
|
+
isRequired,
|
|
244
245
|
};
|
|
245
246
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.TableOfContentsContext = void 0;
|
|
7
4
|
exports.TableOfContentsProvider = TableOfContentsProvider;
|
|
8
5
|
exports.useTableOfContents = useTableOfContents;
|
|
9
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
7
|
const react_1 = require("react");
|
|
11
|
-
const
|
|
8
|
+
const hooks_1 = require("./utils/hooks");
|
|
9
|
+
const react_2 = require("@remix-run/react");
|
|
12
10
|
/**
|
|
13
11
|
* Several components work together to represent the hierarchy of a particular
|
|
14
12
|
* app page as a TOC. This React component provides a context for storing this
|
|
@@ -19,17 +17,29 @@ exports.TableOfContentsContext = (0, react_1.createContext)(null);
|
|
|
19
17
|
* This provider component injects the specified children into the TOC context.
|
|
20
18
|
*/
|
|
21
19
|
function TableOfContentsProvider({ children }) {
|
|
20
|
+
var _a, _b;
|
|
22
21
|
const [headings, setHeadings] = (0, react_1.useState)({});
|
|
23
22
|
const [observeIntersection, setObserveIntersection] = (0, react_1.useState)(false);
|
|
24
23
|
const [activeId, setActiveId] = (0, react_1.useState)(null);
|
|
25
24
|
const observer = (0, react_1.useRef)(null);
|
|
26
25
|
const initialHeading = (0, react_1.useRef)(null);
|
|
26
|
+
const thisRef = (0, react_1.useRef)({
|
|
27
|
+
suspendPositionBasedSetActiveId: false,
|
|
28
|
+
});
|
|
29
|
+
const scrollParent = (0, hooks_1.useScrollParent)((_b = (_a = Object.values(headings)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.anchor);
|
|
30
|
+
(0, hooks_1.useScrollEventHandler)(scrollParent, {
|
|
31
|
+
onScrollEnd: (0, react_1.useCallback)(() => {
|
|
32
|
+
thisRef.current.suspendPositionBasedSetActiveId = false;
|
|
33
|
+
}, []),
|
|
34
|
+
});
|
|
27
35
|
(0, react_1.useEffect)(() => {
|
|
28
36
|
if (observeIntersection) {
|
|
29
37
|
const handleObserver = (entries) => {
|
|
30
38
|
entries.forEach((entry) => {
|
|
31
39
|
if (entry === null || entry === void 0 ? void 0 : entry.isIntersecting) {
|
|
32
|
-
|
|
40
|
+
if (!thisRef.current.suspendPositionBasedSetActiveId) {
|
|
41
|
+
setActiveId(entry.target.id);
|
|
42
|
+
}
|
|
33
43
|
}
|
|
34
44
|
});
|
|
35
45
|
};
|
|
@@ -55,6 +65,7 @@ function TableOfContentsProvider({ children }) {
|
|
|
55
65
|
}, []);
|
|
56
66
|
const setActiveAnchorId = (0, react_1.useCallback)((id) => {
|
|
57
67
|
if (headings[id]) {
|
|
68
|
+
thisRef.current.suspendPositionBasedSetActiveId = true;
|
|
58
69
|
setActiveId(id);
|
|
59
70
|
}
|
|
60
71
|
}, [headings]);
|
|
@@ -69,26 +80,26 @@ function TableOfContentsProvider({ children }) {
|
|
|
69
80
|
return -1;
|
|
70
81
|
});
|
|
71
82
|
}, [headings]);
|
|
83
|
+
const location = (0, react_2.useLocation)();
|
|
72
84
|
(0, react_1.useEffect)(() => {
|
|
73
85
|
var _a;
|
|
74
|
-
const hash =
|
|
86
|
+
const hash = location.hash;
|
|
75
87
|
if (hash) {
|
|
76
|
-
if (initialHeading
|
|
88
|
+
if (initialHeading.current) {
|
|
77
89
|
return;
|
|
78
90
|
}
|
|
79
91
|
else {
|
|
80
92
|
initialHeading.current = (_a = sortedHeadings.find((value) => `#${value.id}` === hash)) === null || _a === void 0 ? void 0 : _a.anchor;
|
|
81
93
|
if (initialHeading.current) {
|
|
82
|
-
|
|
94
|
+
initialHeading.current.scrollIntoView({
|
|
83
95
|
block: "start",
|
|
84
96
|
inline: "start",
|
|
85
97
|
behavior: "instant",
|
|
86
|
-
scrollMode: "always",
|
|
87
98
|
});
|
|
88
99
|
}
|
|
89
100
|
}
|
|
90
101
|
}
|
|
91
|
-
}, [sortedHeadings]);
|
|
102
|
+
}, [location.hash, sortedHeadings]);
|
|
92
103
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
93
104
|
return {
|
|
94
105
|
registerHeading,
|
|
@@ -152,6 +152,10 @@ exports.DataLoaderMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
152
152
|
},
|
|
153
153
|
});
|
|
154
154
|
exports.dataLoaderRenderer = (0, renderers_1.createLoaderRenderer)("DataLoader", ({ loader, state, loaderLoaded, loaderInProgressChanged, loaderError, registerComponentApi, lookupAction, lookupSyncCallback, }) => {
|
|
155
|
-
var _a, _b;
|
|
156
|
-
|
|
155
|
+
var _a, _b, _c;
|
|
156
|
+
// --- Check for reuqired properties
|
|
157
|
+
if (!((_a = loader.props) === null || _a === void 0 ? void 0 : _a.url) || !loader.props.url.trim()) {
|
|
158
|
+
throw new Error("You must specify a non-empty (not whitespace-only) 'url' property for DataSource");
|
|
159
|
+
}
|
|
160
|
+
return ((0, jsx_runtime_1.jsx)(DataLoader, { loader: loader, state: state, loaderInProgressChanged: loaderInProgressChanged, loaderLoaded: loaderLoaded, loaderError: loaderError, registerComponentApi: registerComponentApi, transformResult: lookupSyncCallback(loader.props.transformResult), onLoaded: lookupAction((_b = loader.events) === null || _b === void 0 ? void 0 : _b.loaded, { eventName: "loaded" }), onError: lookupAction((_c = loader.events) === null || _c === void 0 ? void 0 : _c.error, { eventName: "error" }) }));
|
|
157
161
|
}, exports.DataLoaderMd);
|
|
@@ -117,9 +117,12 @@ function createValueExtractor(state, appContext, referenceTrackedApi, memoedVars
|
|
|
117
117
|
return (_b = (_a = extractor(expression)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "";
|
|
118
118
|
};
|
|
119
119
|
// --- Extract an optional string value
|
|
120
|
-
extractor.asOptionalString = (expression) => {
|
|
120
|
+
extractor.asOptionalString = (expression, defValue) => {
|
|
121
121
|
var _a;
|
|
122
|
-
|
|
122
|
+
const value = (_a = extractor(expression)) === null || _a === void 0 ? void 0 : _a.toString();
|
|
123
|
+
if (value === undefined || value === null)
|
|
124
|
+
return defValue;
|
|
125
|
+
return value;
|
|
123
126
|
};
|
|
124
127
|
extractor.asDisplayText = (expression) => {
|
|
125
128
|
var _a;
|
|
@@ -115,7 +115,7 @@ function useCompiledTheme(activeTheme, activeTone, themes = constants_1.EMPTY_AR
|
|
|
115
115
|
mergedThemeVars = Object.assign(Object.assign(Object.assign(Object.assign({}, mergedThemeVars), theme.themeVars), (_a = theme.themeVars) === null || _a === void 0 ? void 0 : _a[activeTone]), (_c = (_b = theme.tones) === null || _b === void 0 ? void 0 : _b[activeTone]) === null || _c === void 0 ? void 0 : _c.themeVars);
|
|
116
116
|
});
|
|
117
117
|
//we put the generated theme vars before the last item in the chain
|
|
118
|
-
|
|
118
|
+
const resultedTheme = [
|
|
119
119
|
...themeDefChain
|
|
120
120
|
.map((themeDef) => {
|
|
121
121
|
var _a, _b, _c;
|
|
@@ -125,10 +125,13 @@ function useCompiledTheme(activeTheme, activeTone, themes = constants_1.EMPTY_AR
|
|
|
125
125
|
Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, transformThemeVars_1.generateBaseSpacings)(mergedThemeVars)), (0, transformThemeVars_1.generateBaseFontSizes)(mergedThemeVars)), (0, transformThemeVars_1.generateBaseTones)(mergedThemeVars)), (0, transformThemeVars_1.generatePaddingSegments)(mergedThemeVars)), (0, transformThemeVars_1.generateBorderSegments)(mergedThemeVars)), (0, transformThemeVars_1.generateButtonTones)(mergedThemeVars)),
|
|
126
126
|
Object.assign(Object.assign(Object.assign({}, themeDefChain[themeDefChain.length - 1].themeVars), (_a = themeDefChain[themeDefChain.length - 1].themeVars) === null || _a === void 0 ? void 0 : _a[activeTone]), (_c = (_b = themeDefChain[themeDefChain.length - 1].tones) === null || _b === void 0 ? void 0 : _b[activeTone]) === null || _c === void 0 ? void 0 : _c.themeVars),
|
|
127
127
|
];
|
|
128
|
+
return resultedTheme;
|
|
128
129
|
}, [activeTone, themeDefChain]);
|
|
129
130
|
const allThemeVarsWithResolvedHierarchicalVars = (0, react_1.useMemo)(() => {
|
|
130
131
|
let mergedThemeVars = {};
|
|
131
132
|
themeDefChainVars === null || themeDefChainVars === void 0 ? void 0 : themeDefChainVars.forEach((theme) => {
|
|
133
|
+
theme = (0, transformThemeVars_1.generatePaddingSegments)(theme);
|
|
134
|
+
theme = (0, transformThemeVars_1.generateBorderSegments)(theme);
|
|
132
135
|
mergedThemeVars = Object.assign(Object.assign({}, mergedThemeVars), theme);
|
|
133
136
|
});
|
|
134
137
|
const resolvedThemeVarsFromChains = {};
|
|
@@ -238,16 +238,33 @@ function generateBorderSegments(theme) {
|
|
|
238
238
|
return {};
|
|
239
239
|
}
|
|
240
240
|
const result = Object.assign({}, theme);
|
|
241
|
-
let hasCard = false;
|
|
242
241
|
// --- Iterate through theme variables and split border values
|
|
243
242
|
Object.entries(theme).forEach(([key, value]) => {
|
|
244
|
-
var _a, _b
|
|
245
|
-
var
|
|
243
|
+
var _a, _b;
|
|
244
|
+
var _c, _d;
|
|
245
|
+
// --- Check "border-" theme variables
|
|
246
|
+
let match = borderRegEx.exec(key);
|
|
247
|
+
if (match) {
|
|
248
|
+
const remainder = match[1];
|
|
249
|
+
// --- Flow down the border value
|
|
250
|
+
result[`border-left-${remainder}`] = value;
|
|
251
|
+
result[`border-right-${remainder}`] = value;
|
|
252
|
+
result[`border-top-${remainder}`] = value;
|
|
253
|
+
result[`border-bottom-${remainder}`] = value;
|
|
254
|
+
// --- We have a border value to segment
|
|
255
|
+
const border = getBorderSegments(value);
|
|
256
|
+
result[`thickness-border-${remainder}`] = border.thickness;
|
|
257
|
+
(_a = result[_c = `style-border-${remainder}`]) !== null && _a !== void 0 ? _a : (result[_c] = border.style);
|
|
258
|
+
(_b = result[_d = `color-border-${remainder}`]) !== null && _b !== void 0 ? _b : (result[_d] = border.color);
|
|
259
|
+
}
|
|
246
260
|
// --- Check "border-horizontal" theme variables
|
|
247
|
-
|
|
261
|
+
match = borderHorizontalRegEx.exec(key);
|
|
248
262
|
if (match) {
|
|
249
263
|
// --- We have a border-horizontal value to segment
|
|
250
264
|
const remainder = match[2];
|
|
265
|
+
// --- Flow down the border value
|
|
266
|
+
result[`border-left-${remainder}`] = value;
|
|
267
|
+
result[`border-right-${remainder}`] = value;
|
|
251
268
|
const border = getBorderSegments(value);
|
|
252
269
|
if (border.thickness) {
|
|
253
270
|
result[`thickness-border-left-${remainder}`] = border.thickness;
|
|
@@ -267,6 +284,9 @@ function generateBorderSegments(theme) {
|
|
|
267
284
|
if (match) {
|
|
268
285
|
// --- We have a border-vertical value to segment
|
|
269
286
|
const remainder = match[2];
|
|
287
|
+
// --- Flow down the border value
|
|
288
|
+
result[`border-top-${remainder}`] = value;
|
|
289
|
+
result[`border-bottom-${remainder}`] = value;
|
|
270
290
|
const border = getBorderSegments(value);
|
|
271
291
|
if (border.thickness) {
|
|
272
292
|
result[`thickness-border-top-${remainder}`] = border.thickness;
|
|
@@ -287,13 +307,13 @@ function generateBorderSegments(theme) {
|
|
|
287
307
|
// --- We have a border-left value to segment
|
|
288
308
|
const remainder = match[2];
|
|
289
309
|
const border = getBorderSegments(value);
|
|
290
|
-
if (border.thickness) {
|
|
310
|
+
if (border.thickness && !theme[`thickness-border-left-${remainder}`]) {
|
|
291
311
|
result[`thickness-border-left-${remainder}`] = border.thickness;
|
|
292
312
|
}
|
|
293
|
-
if (border.style) {
|
|
313
|
+
if (border.style && !theme[`style-border-left-${remainder}`]) {
|
|
294
314
|
result[`style-border-left-${remainder}`] = border.style;
|
|
295
315
|
}
|
|
296
|
-
if (border.color) {
|
|
316
|
+
if (border.color && !theme[`color-border-left-${remainder}`]) {
|
|
297
317
|
result[`color-border-left-${remainder}`] = border.color;
|
|
298
318
|
}
|
|
299
319
|
}
|
|
@@ -345,107 +365,83 @@ function generateBorderSegments(theme) {
|
|
|
345
365
|
result[`color-border-bottom-${remainder}`] = border.color;
|
|
346
366
|
}
|
|
347
367
|
}
|
|
348
|
-
// --- Check "border-" theme variables
|
|
349
|
-
match = borderRegEx.exec(key);
|
|
350
|
-
if (match) {
|
|
351
|
-
// --- We have a border value to segment
|
|
352
|
-
const remainder = match[1];
|
|
353
|
-
const border = getBorderSegments(value);
|
|
354
|
-
if (border.thickness) {
|
|
355
|
-
(_a = result[_7 = `thickness-border-${remainder}`]) !== null && _a !== void 0 ? _a : (result[_7] = border.thickness);
|
|
356
|
-
}
|
|
357
|
-
if (border.style) {
|
|
358
|
-
(_b = result[_8 = `style-border-${remainder}`]) !== null && _b !== void 0 ? _b : (result[_8] = border.style);
|
|
359
|
-
}
|
|
360
|
-
if (border.color) {
|
|
361
|
-
(_c = result[_9 = `color-border-${remainder}`]) !== null && _c !== void 0 ? _c : (result[_9] = border.color);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
368
|
// --- Check "thickness-border-" theme variables
|
|
365
369
|
match = thicknessBorderRegEx.exec(key);
|
|
366
370
|
if (match) {
|
|
367
371
|
// --- We have a thickness-border value to flow down
|
|
368
372
|
const remainder = match[1];
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
+
result[`thickness-border-left-${remainder}`] = value;
|
|
374
|
+
result[`thickness-border-right-${remainder}`] = value;
|
|
375
|
+
result[`thickness-border-top-${remainder}`] = value;
|
|
376
|
+
result[`thickness-border-bottom-${remainder}`] = value;
|
|
373
377
|
}
|
|
374
378
|
// --- Check "thickness-border-horizontal" theme variables
|
|
375
379
|
match = thicknessBorderHorizontalRegEx.exec(key);
|
|
376
380
|
if (match) {
|
|
377
381
|
// --- We have a thickness-border-horizontal value to flow down
|
|
378
382
|
const remainder = match[2];
|
|
379
|
-
|
|
380
|
-
|
|
383
|
+
result[`thickness-border-left-${remainder}`] = value;
|
|
384
|
+
result[`thickness-border-right-${remainder}`] = value;
|
|
381
385
|
}
|
|
382
386
|
// --- Check "thickness-border-vertical" theme variables
|
|
383
387
|
match = thicknessBorderVerticalRegEx.exec(key);
|
|
384
388
|
if (match) {
|
|
385
389
|
// --- We have a thickness-border-vertical value to flow down
|
|
386
390
|
const remainder = match[2];
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}
|
|
390
|
-
if (match) {
|
|
391
|
-
// --- We have a thickness-border value to flow down
|
|
392
|
-
const remainder = match[1];
|
|
393
|
-
(_m = result[_18 = `thickness-border-left-${remainder}`]) !== null && _m !== void 0 ? _m : (result[_18] = value);
|
|
394
|
-
(_o = result[_19 = `thickness-border-right-${remainder}`]) !== null && _o !== void 0 ? _o : (result[_19] = value);
|
|
395
|
-
(_p = result[_20 = `thickness-border-top-${remainder}`]) !== null && _p !== void 0 ? _p : (result[_20] = value);
|
|
396
|
-
(_q = result[_21 = `thickness-border-bottom-${remainder}`]) !== null && _q !== void 0 ? _q : (result[_21] = value);
|
|
391
|
+
result[`thickness-border-top-${remainder}`] = value;
|
|
392
|
+
result[`thickness-border-bottom-${remainder}`] = value;
|
|
397
393
|
}
|
|
398
394
|
// --- Check "style-border-" theme variables
|
|
399
395
|
match = styleBorderRegEx.exec(key);
|
|
400
396
|
if (match) {
|
|
401
397
|
// --- We have a style-border value to flow down
|
|
402
398
|
const remainder = match[1];
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
399
|
+
result[`style-border-left-${remainder}`] = value;
|
|
400
|
+
result[`style-border-right-${remainder}`] = value;
|
|
401
|
+
result[`style-border-top-${remainder}`] = value;
|
|
402
|
+
result[`style-border-bottom-${remainder}`] = value;
|
|
407
403
|
}
|
|
408
404
|
// --- Check "style-border-horizontal" theme variables
|
|
409
405
|
match = styleBorderHorizontalRegEx.exec(key);
|
|
410
406
|
if (match) {
|
|
411
407
|
// --- We have a style-border-horizontal value to flow down
|
|
412
|
-
const remainder = match[
|
|
413
|
-
|
|
414
|
-
|
|
408
|
+
const remainder = match[2];
|
|
409
|
+
result[`style-border-left-${remainder}`] = value;
|
|
410
|
+
result[`style-border-right-${remainder}`] = value;
|
|
415
411
|
}
|
|
416
412
|
// --- Check "style-border-vertical" theme variables
|
|
417
413
|
match = styleBorderVerticalRegEx.exec(key);
|
|
418
414
|
if (match) {
|
|
419
415
|
// --- We have a style-border-vertical value to flow down
|
|
420
|
-
const remainder = match[
|
|
421
|
-
|
|
422
|
-
|
|
416
|
+
const remainder = match[2];
|
|
417
|
+
result[`style-border-top-${remainder}`] = value;
|
|
418
|
+
result[`style-border-bottom-${remainder}`] = value;
|
|
423
419
|
}
|
|
424
420
|
// --- Check "color-border-" theme variables
|
|
425
421
|
match = colorBorderRegEx.exec(key);
|
|
426
422
|
if (match) {
|
|
427
423
|
// --- We have a color-border value to flow down
|
|
428
424
|
const remainder = match[1];
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
425
|
+
result[`color-border-left-${remainder}`] = value;
|
|
426
|
+
result[`color-border-right-${remainder}`] = value;
|
|
427
|
+
result[`color-border-top-${remainder}`] = value;
|
|
428
|
+
result[`color-border-bottom-${remainder}`] = value;
|
|
433
429
|
}
|
|
434
430
|
// --- Check "color-border-horizontal" theme variables
|
|
435
431
|
match = colorBorderHorizontalRegEx.exec(key);
|
|
436
432
|
if (match) {
|
|
437
433
|
// --- We have a color-border-horizontal value to flow down
|
|
438
|
-
const remainder = match[
|
|
439
|
-
|
|
440
|
-
|
|
434
|
+
const remainder = match[2];
|
|
435
|
+
result[`color-border-left-${remainder}`] = value;
|
|
436
|
+
result[`color-border-right-${remainder}`] = value;
|
|
441
437
|
}
|
|
442
438
|
// --- Check "color-border-vertical" theme variables
|
|
443
439
|
match = colorBorderVerticalRegEx.exec(key);
|
|
444
440
|
if (match) {
|
|
445
441
|
// --- We have a color-border-vertical value to flow down
|
|
446
|
-
const remainder = match[
|
|
447
|
-
|
|
448
|
-
|
|
442
|
+
const remainder = match[2];
|
|
443
|
+
result[`color-border-top-${remainder}`] = value;
|
|
444
|
+
result[`color-border-bottom-${remainder}`] = value;
|
|
449
445
|
}
|
|
450
446
|
});
|
|
451
447
|
// --- Done
|