oolib 2.199.9 → 2.200.0
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/stories/v2/components/Tags/TagLink.stories.d.ts +9 -1
- package/dist/stories/v2/components/Tags/TagLink.stories.js +6 -2
- package/dist/v2/components/List/comps/ListGroup.d.ts +2 -1
- package/dist/v2/components/List/comps/ListGroup.js +6 -3
- package/dist/v2/components/List/index.d.ts +2 -1
- package/dist/v2/components/List/index.js +2 -2
- package/dist/v2/components/Tags/Comps/TagLink/index.d.ts +2 -1
- package/dist/v2/components/Tags/Comps/TagLink/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
2
|
let title: string;
|
|
3
|
-
|
|
3
|
+
namespace argTypes {
|
|
4
|
+
namespace target {
|
|
5
|
+
let name: string;
|
|
6
|
+
let options: string[];
|
|
7
|
+
namespace control {
|
|
8
|
+
let type: string;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
4
12
|
let args: {
|
|
5
13
|
display: any;
|
|
6
14
|
};
|
|
@@ -21,11 +21,15 @@ var GenTag_1 = require("./utils/GenTag");
|
|
|
21
21
|
var tagArgTypes_1 = require("./utils/tagArgTypes");
|
|
22
22
|
exports.default = {
|
|
23
23
|
title: "Oolib V 2.0/Components/Tags/Tag Link",
|
|
24
|
-
argTypes: __assign({}, (0, tagArgTypes_1.commonArgTypes)({ exclude: { icon: true, badgeColor: true, } })),
|
|
24
|
+
argTypes: __assign(__assign({}, (0, tagArgTypes_1.commonArgTypes)({ exclude: { icon: true, badgeColor: true, } })), { target: {
|
|
25
|
+
name: "Target",
|
|
26
|
+
options: ["_self", "_blank", "_top", "_parent"],
|
|
27
|
+
control: { type: "select" },
|
|
28
|
+
} }),
|
|
25
29
|
args: __assign({}, (0, tagArgTypes_1.commonTagArgTypes)("Tag Link")),
|
|
26
30
|
};
|
|
27
31
|
var Tag_Link = function (args) {
|
|
28
32
|
return (react_1.default.createElement("div", { style: { margin: "2rem 10rem" } },
|
|
29
|
-
react_1.default.createElement(GenTag_1.GenTag, { args: args, Comp: Tags_1.TagLink })));
|
|
33
|
+
react_1.default.createElement(GenTag_1.GenTag, { args: __assign(__assign({}, args), { to: "https://www.reddit.com/", target: args.target }), Comp: Tags_1.TagLink })));
|
|
30
34
|
};
|
|
31
35
|
exports.Tag_Link = Tag_Link;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const GroupHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
export const GroupDivider: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export function ListGroup({ id, group, index, value, focussedOp, scrollFocussedOpIntoView, onChange: parentOnChange, optionsClassName, invert, S, observerRef, isMulti, isTagsStyle, setFocusSelectTagsInput, setSearchString, setSearchBarFocus, }: {
|
|
3
|
+
export function ListGroup({ id, group, index, value, focussedOp, scrollFocussedOpIntoView, onChange: parentOnChange, optionsClassName, invert, S, observerRef, isMulti, isTagsStyle, setFocusSelectTagsInput, setSearchString, setSearchBarFocus, groupHeaderStickyTop }: {
|
|
4
4
|
id: any;
|
|
5
5
|
group: any;
|
|
6
6
|
index: any;
|
|
@@ -17,5 +17,6 @@ export function ListGroup({ id, group, index, value, focussedOp, scrollFocussedO
|
|
|
17
17
|
setFocusSelectTagsInput: any;
|
|
18
18
|
setSearchString: any;
|
|
19
19
|
setSearchBarFocus: any;
|
|
20
|
+
groupHeaderStickyTop?: number;
|
|
20
21
|
}): React.JSX.Element;
|
|
21
22
|
import React from 'react';
|
|
@@ -14,14 +14,17 @@ var Divider_1 = require("../../Divider");
|
|
|
14
14
|
var themes_1 = require("../../../themes");
|
|
15
15
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
16
16
|
var ListItem_1 = require("./ListItem");
|
|
17
|
-
exports.GroupHeader = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0.4rem 0.8rem;\n color: ", ";\n position: sticky;\n top:
|
|
17
|
+
exports.GroupHeader = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0.4rem 0.8rem;\n color: ", ";\n position: sticky;\n top: ", ";\n width: 100%;\n background: white;\n z-index: 1000;\n"], ["\n padding: 0.4rem 0.8rem;\n color: ", ";\n position: sticky;\n top: ", ";\n width: 100%;\n background: white;\n z-index: 1000;\n"])), themes_1.colors.grey50, function (_a) {
|
|
18
|
+
var groupHeaderStickyTop = _a.groupHeaderStickyTop;
|
|
19
|
+
return groupHeaderStickyTop;
|
|
20
|
+
});
|
|
18
21
|
exports.GroupDivider = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0.4rem 0 0.8rem 0;\n"], ["\n margin: 0.4rem 0 0.8rem 0;\n"])));
|
|
19
22
|
var ListGroup = function (_a) {
|
|
20
|
-
var id = _a.id, group = _a.group, index = _a.index, value = _a.value, focussedOp = _a.focussedOp, scrollFocussedOpIntoView = _a.scrollFocussedOpIntoView, parentOnChange = _a.onChange, optionsClassName = _a.optionsClassName, invert = _a.invert, S = _a.S, observerRef = _a.observerRef, isMulti = _a.isMulti, isTagsStyle = _a.isTagsStyle, setFocusSelectTagsInput = _a.setFocusSelectTagsInput, setSearchString = _a.setSearchString, setSearchBarFocus = _a.setSearchBarFocus;
|
|
23
|
+
var id = _a.id, group = _a.group, index = _a.index, value = _a.value, focussedOp = _a.focussedOp, scrollFocussedOpIntoView = _a.scrollFocussedOpIntoView, parentOnChange = _a.onChange, optionsClassName = _a.optionsClassName, invert = _a.invert, S = _a.S, observerRef = _a.observerRef, isMulti = _a.isMulti, isTagsStyle = _a.isTagsStyle, setFocusSelectTagsInput = _a.setFocusSelectTagsInput, setSearchString = _a.setSearchString, setSearchBarFocus = _a.setSearchBarFocus, _b = _a.groupHeaderStickyTop, groupHeaderStickyTop = _b === void 0 ? 0 : _b;
|
|
21
24
|
return (react_1.default.createElement("div", null,
|
|
22
25
|
index > 0 && (react_1.default.createElement(exports.GroupDivider, null,
|
|
23
26
|
react_1.default.createElement(Divider_1.Divider, null))),
|
|
24
|
-
react_1.default.createElement(exports.GroupHeader,
|
|
27
|
+
react_1.default.createElement(exports.GroupHeader, { groupHeaderStickyTop: groupHeaderStickyTop },
|
|
25
28
|
react_1.default.createElement(Typo2_1.UI_TAG, null, group.display)),
|
|
26
29
|
group.options.map(function (option, idx) { return (react_1.default.createElement(ListItem_1.ListItem, { key: option.value, option: option, isSelected: (!option.loading && (value === null || value === void 0 ? void 0 : value.value) === option.value), isFocussed: focussedOp === idx, index: idx, scrollFocussedOpIntoView: scrollFocussedOpIntoView, onChange: function () {
|
|
27
30
|
if (!option.loading) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const StyledListWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
export function isGroupedData(options: any): boolean;
|
|
3
|
-
export function List({ id, options, value, focussedOp, scrollFocussedOpIntoView, onChange: parentOnChange, optionsClassName, invert, S, observerRef, isMulti, isTagsStyle, setFocusSelectTagsInput, disableShadow, isSearchable, searchbarPlaceholder, searchBarFocus, searchString, setSearchString, setSearchBarFocus, children, enableBorder, style }: {
|
|
3
|
+
export function List({ id, options, value, focussedOp, scrollFocussedOpIntoView, onChange: parentOnChange, optionsClassName, invert, S, observerRef, isMulti, isTagsStyle, setFocusSelectTagsInput, disableShadow, isSearchable, searchbarPlaceholder, searchBarFocus, searchString, setSearchString, setSearchBarFocus, children, enableBorder, style, groupHeaderStickyTop }: {
|
|
4
4
|
id: any;
|
|
5
5
|
options?: any[];
|
|
6
6
|
value: any;
|
|
@@ -24,5 +24,6 @@ export function List({ id, options, value, focussedOp, scrollFocussedOpIntoView,
|
|
|
24
24
|
children: any;
|
|
25
25
|
enableBorder: any;
|
|
26
26
|
style: any;
|
|
27
|
+
groupHeaderStickyTop: any;
|
|
27
28
|
}): React.JSX.Element;
|
|
28
29
|
import React from 'react';
|
|
@@ -67,13 +67,13 @@ var isGroupedData = function (options) {
|
|
|
67
67
|
exports.isGroupedData = isGroupedData;
|
|
68
68
|
var List = function (_a) {
|
|
69
69
|
// const theme = useTheme();
|
|
70
|
-
var id = _a.id, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, focussedOp = _a.focussedOp, scrollFocussedOpIntoView = _a.scrollFocussedOpIntoView, parentOnChange = _a.onChange, optionsClassName = _a.optionsClassName, invert = _a.invert, S = _a.S, observerRef = _a.observerRef, _c = _a.isMulti, isMulti = _c === void 0 ? false : _c, isTagsStyle = _a.isTagsStyle, setFocusSelectTagsInput = _a.setFocusSelectTagsInput, disableShadow = _a.disableShadow, isSearchable = _a.isSearchable, searchbarPlaceholder = _a.searchbarPlaceholder, searchBarFocus = _a.searchBarFocus, searchString = _a.searchString, setSearchString = _a.setSearchString, setSearchBarFocus = _a.setSearchBarFocus, children = _a.children, enableBorder = _a.enableBorder, style = _a.style;
|
|
70
|
+
var id = _a.id, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, focussedOp = _a.focussedOp, scrollFocussedOpIntoView = _a.scrollFocussedOpIntoView, parentOnChange = _a.onChange, optionsClassName = _a.optionsClassName, invert = _a.invert, S = _a.S, observerRef = _a.observerRef, _c = _a.isMulti, isMulti = _c === void 0 ? false : _c, isTagsStyle = _a.isTagsStyle, setFocusSelectTagsInput = _a.setFocusSelectTagsInput, disableShadow = _a.disableShadow, isSearchable = _a.isSearchable, searchbarPlaceholder = _a.searchbarPlaceholder, searchBarFocus = _a.searchBarFocus, searchString = _a.searchString, setSearchString = _a.setSearchString, setSearchBarFocus = _a.setSearchBarFocus, children = _a.children, enableBorder = _a.enableBorder, style = _a.style, groupHeaderStickyTop = _a.groupHeaderStickyTop;
|
|
71
71
|
var renderListItems = function () {
|
|
72
72
|
if (options.length === 0) {
|
|
73
73
|
return react_1.default.createElement(NoOptionResultsComp_1.NoOptionResultsComp, { S: S });
|
|
74
74
|
}
|
|
75
75
|
if ((0, exports.isGroupedData)(options)) {
|
|
76
|
-
return (react_1.default.createElement(react_1.Fragment, null, options.map(function (group, index) { return (react_1.default.createElement(ListGroup_1.ListGroup, { id: id, key: "group-".concat(index), group: group, index: index, value: value, focussedOp: focussedOp, scrollFocussedOpIntoView: scrollFocussedOpIntoView, onChange: parentOnChange, optionsClassName: optionsClassName, invert: invert, S: S, observerRef: observerRef, isMulti: isMulti, isTagsStyle: isTagsStyle, setFocusSelectTagsInput: setFocusSelectTagsInput, setSearchString: setSearchString, setSearchBarFocus: setSearchBarFocus, disableShadow: disableShadow })); })));
|
|
76
|
+
return (react_1.default.createElement(react_1.Fragment, null, options.map(function (group, index) { return (react_1.default.createElement(ListGroup_1.ListGroup, { id: id, key: "group-".concat(index), group: group, index: index, value: value, focussedOp: focussedOp, scrollFocussedOpIntoView: scrollFocussedOpIntoView, onChange: parentOnChange, optionsClassName: optionsClassName, invert: invert, S: S, observerRef: observerRef, isMulti: isMulti, isTagsStyle: isTagsStyle, setFocusSelectTagsInput: setFocusSelectTagsInput, setSearchString: setSearchString, setSearchBarFocus: setSearchBarFocus, disableShadow: disableShadow, groupHeaderStickyTop: groupHeaderStickyTop })); })));
|
|
77
77
|
}
|
|
78
78
|
return options.map(function (option, index) { return (react_1.default.createElement(ListItem_1.ListItem, { key: option.value, option: option, isSelected: (!option.loading && (value === null || value === void 0 ? void 0 : value.value) === option.value), isFocussed: focussedOp === index, index: index, scrollFocussedOpIntoView: scrollFocussedOpIntoView, onChange: function () {
|
|
79
79
|
if (!option.loading) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { FunctionComponent } from "react";
|
|
1
|
+
import React, { FunctionComponent, HTMLAttributeAnchorTarget } from "react";
|
|
2
2
|
export declare const StyledLink: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("react-router-dom").NavLinkProps & React.RefAttributes<HTMLAnchorElement>>, any, {}, never>;
|
|
3
3
|
export interface TagLinkProps {
|
|
4
4
|
display: string;
|
|
@@ -7,5 +7,6 @@ export interface TagLinkProps {
|
|
|
7
7
|
fill: "solid" | "outline";
|
|
8
8
|
size?: "S" | "XS";
|
|
9
9
|
weight?: "bold" | "light" | "default";
|
|
10
|
+
target?: HTMLAttributeAnchorTarget;
|
|
10
11
|
}
|
|
11
12
|
export declare const TagLink: FunctionComponent<TagLinkProps>;
|
|
@@ -14,8 +14,8 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
14
14
|
var react_router_dom_1 = require("react-router-dom");
|
|
15
15
|
exports.StyledLink = (0, styled_components_1.default)(react_router_dom_1.NavLink)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-decoration: none;\n"], ["\n text-decoration: none;\n"])));
|
|
16
16
|
var TagLink = function (_a) {
|
|
17
|
-
var display = _a.display, to = _a.to, id = _a.id, fill = _a.fill, size = _a.size, weight = _a.weight;
|
|
18
|
-
return (react_1.default.createElement(exports.StyledLink, { to: to },
|
|
17
|
+
var display = _a.display, to = _a.to, id = _a.id, fill = _a.fill, size = _a.size, weight = _a.weight, _b = _a.target, target = _b === void 0 ? "_self" : _b;
|
|
18
|
+
return (react_1.default.createElement(exports.StyledLink, { to: to, target: target },
|
|
19
19
|
react_1.default.createElement(Tag_1.Tag, { id: id, display: display, icon: "ArrowLineUpRight", size: size || "S", variant: "link", fill: fill, weight: weight })));
|
|
20
20
|
};
|
|
21
21
|
exports.TagLink = TagLink;
|