glints-aries 4.0.304 → 4.0.306
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/es/@next/DataTable/DataTable.d.ts +2 -2
- package/es/@next/DataTable/DataTable.js +3 -3
- package/es/@next/DataTable/{DatatTable.stories.d.ts → DataTable.stories.d.ts} +1 -0
- package/es/@next/DataTable/DataTableStyle.js +4 -3
- package/es/@next/DataTable/TableCell.d.ts +2 -1
- package/es/@next/DataTable/TableCell.js +6 -3
- package/es/@next/DataTable/TableHeader.js +7 -3
- package/es/@next/Select/Select.d.ts +3 -1
- package/es/@next/Select/Select.js +4 -1
- package/es/@next/Select/Select.stories.d.ts +1 -0
- package/es/@next/Select/components/Activator/ActivatorSelect.d.ts +5 -2
- package/es/@next/Select/components/Activator/ActivatorSelect.js +8 -7
- package/es/@next/Select/components/Activator/ActivatorStyle.d.ts +3 -0
- package/es/@next/Select/components/Activator/ActivatorStyle.js +14 -1
- package/es/@next/Select/selectStoryHelper/NonSearchableSingleSelect.js +3 -9
- package/es/@next/Select/selectStoryHelper/SelectStoryStyle.d.ts +0 -1
- package/es/@next/Select/selectStoryHelper/SelectStoryStyle.js +1 -5
- package/es/@next/SideSheet/SideSheet.js +1 -1
- package/lib/@next/DataTable/DataTable.d.ts +2 -2
- package/lib/@next/DataTable/DataTable.js +3 -3
- package/lib/@next/DataTable/{DatatTable.stories.d.ts → DataTable.stories.d.ts} +1 -0
- package/lib/@next/DataTable/DataTableStyle.js +3 -2
- package/lib/@next/DataTable/TableCell.d.ts +2 -1
- package/lib/@next/DataTable/TableCell.js +6 -3
- package/lib/@next/DataTable/TableHeader.js +7 -3
- package/lib/@next/Select/Select.d.ts +3 -1
- package/lib/@next/Select/Select.js +4 -1
- package/lib/@next/Select/Select.stories.d.ts +1 -0
- package/lib/@next/Select/components/Activator/ActivatorSelect.d.ts +5 -2
- package/lib/@next/Select/components/Activator/ActivatorSelect.js +7 -6
- package/lib/@next/Select/components/Activator/ActivatorStyle.d.ts +3 -0
- package/lib/@next/Select/components/Activator/ActivatorStyle.js +19 -3
- package/lib/@next/Select/selectStoryHelper/NonSearchableSingleSelect.js +3 -9
- package/lib/@next/Select/selectStoryHelper/SelectStoryStyle.d.ts +0 -1
- package/lib/@next/Select/selectStoryHelper/SelectStoryStyle.js +2 -7
- package/lib/@next/SideSheet/SideSheet.js +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ export interface DataTableProps extends React.TableHTMLAttributes<HTMLTableEleme
|
|
|
11
11
|
/** If the title in TableHeading is of type ReactNode and you require sorting functionality, please make sure to provide 'id' for the TableHeading */
|
|
12
12
|
headings: TableHeading[];
|
|
13
13
|
children: React.ReactNode;
|
|
14
|
-
emptyState
|
|
14
|
+
emptyState?: React.ReactElement<EmptyStateProps>;
|
|
15
15
|
totals?: Total[];
|
|
16
16
|
loading?: boolean;
|
|
17
17
|
loadingLabel?: string;
|
|
@@ -19,7 +19,7 @@ export interface DataTableProps extends React.TableHTMLAttributes<HTMLTableEleme
|
|
|
19
19
|
}
|
|
20
20
|
export declare const DataTable: React.ForwardRefExoticComponent<DataTableProps & React.RefAttributes<HTMLTableElement>> & {
|
|
21
21
|
Row: ({ children, ...props }: import("./TableRow").TableRowProps) => JSX.Element;
|
|
22
|
-
Cell: ({ align, children, noWrap, }: import("./TableCell").TableCellProps) => JSX.Element;
|
|
22
|
+
Cell: ({ align, children, noWrap, verticalAlign, }: import("./TableCell").TableCellProps) => JSX.Element;
|
|
23
23
|
Footer: ({ children }: {
|
|
24
24
|
children: React.ReactNode;
|
|
25
25
|
}) => JSX.Element;
|
|
@@ -54,7 +54,7 @@ var DataTableComponent = /*#__PURE__*/React.forwardRef(function DataTable(_ref,
|
|
|
54
54
|
align: align
|
|
55
55
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
56
56
|
as: "div",
|
|
57
|
-
variant: "
|
|
57
|
+
variant: "caption"
|
|
58
58
|
}, title));
|
|
59
59
|
}) : null;
|
|
60
60
|
var footer;
|
|
@@ -68,9 +68,9 @@ var DataTableComponent = /*#__PURE__*/React.forwardRef(function DataTable(_ref,
|
|
|
68
68
|
}
|
|
69
69
|
rows.push(reactEl);
|
|
70
70
|
}
|
|
71
|
-
var emptyRow = /*#__PURE__*/React.createElement(StyledTableRow, null, /*#__PURE__*/React.createElement(StyledTableCell, {
|
|
71
|
+
var emptyRow = emptyState ? /*#__PURE__*/React.createElement(StyledTableRow, null, /*#__PURE__*/React.createElement(StyledTableCell, {
|
|
72
72
|
colSpan: headings.length
|
|
73
|
-
}, emptyState));
|
|
73
|
+
}, emptyState)) : null;
|
|
74
74
|
var hasRows = rows.length > 0;
|
|
75
75
|
var rowsMarkup = hasRows ? rows : emptyRow;
|
|
76
76
|
var showFooter = !!footer;
|
|
@@ -2,8 +2,9 @@ import styled from 'styled-components';
|
|
|
2
2
|
import * as DropShadow from '../utilities/dropShadow';
|
|
3
3
|
import { borderRadius8 } from '../utilities/borderRadius';
|
|
4
4
|
import { Blue, Neutral } from '../utilities/colors';
|
|
5
|
-
import { space16 } from '../utilities/spacing';
|
|
5
|
+
import { space16, space8 } from '../utilities/spacing';
|
|
6
6
|
var alignmentStyle = "\n&[data-text-align='right'] {\n > div {\n display: flex;\n justify-content: right;\n }\n}\n\n&[data-text-align='center'] {\n > div {\n display: flex;\n justify-content: center;\n }\n}\n";
|
|
7
|
+
var cellVerticalAlign = "\n&[data-vertical-align='top'] {\n vertical-align: top;\n}\n\n&[data-vertical-align='center'] {\n vertical-align: center;\n}\n";
|
|
7
8
|
export var StyledTable = styled.table.withConfig({
|
|
8
9
|
displayName: "DataTableStyle__StyledTable",
|
|
9
10
|
componentId: "sc-18v2ula-0"
|
|
@@ -15,11 +16,11 @@ export var StyledTableRow = styled.tr.withConfig({
|
|
|
15
16
|
export var StyledTabledHeader = styled.th.withConfig({
|
|
16
17
|
displayName: "DataTableStyle__StyledTabledHeader",
|
|
17
18
|
componentId: "sc-18v2ula-2"
|
|
18
|
-
})(["padding:", ";text-align:left;", " button{padding:0;margin:0;height:auto;border:none;box-shadow:none;background:", ";}button:hover{background:transparent;}button:active{border:none;box-shadow:none;background:transparent;}button:focus{border:none;}button svg{width:
|
|
19
|
+
})(["padding:", ";text-align:left;", " button{padding:0;margin:0;height:auto;border:none;box-shadow:none;background:", ";}button:hover{background:transparent;}button:active{border:none;box-shadow:none;background:transparent;}button:focus{border:none;}button svg{width:16px;height:16px;fill:", ";margin-bottom:2px;}"], space16, alignmentStyle, Neutral.B99, Neutral.B40);
|
|
19
20
|
export var StyledTableCell = styled.td.withConfig({
|
|
20
21
|
displayName: "DataTableStyle__StyledTableCell",
|
|
21
22
|
componentId: "sc-18v2ula-3"
|
|
22
|
-
})(["text-align:left;padding:", ";
|
|
23
|
+
})(["text-align:left;padding:", " ", ";", " ", " &[data-no-wrap='true']{white-space:nowrap;div{width:max-content;}}"], space8, space16, alignmentStyle, cellVerticalAlign);
|
|
23
24
|
export var StyledTableFooterRow = styled.tr.withConfig({
|
|
24
25
|
displayName: "DataTableStyle__StyledTableFooterRow",
|
|
25
26
|
componentId: "sc-18v2ula-4"
|
|
@@ -3,5 +3,6 @@ export interface TableCellProps extends React.TdHTMLAttributes<HTMLTableColEleme
|
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
/** Sets table cell content to not wrap*/
|
|
5
5
|
noWrap?: boolean;
|
|
6
|
+
verticalAlign?: 'top' | 'center';
|
|
6
7
|
}
|
|
7
|
-
export declare const TableCell: ({ align, children, noWrap, }: TableCellProps) => JSX.Element;
|
|
8
|
+
export declare const TableCell: ({ align, children, noWrap, verticalAlign, }: TableCellProps) => JSX.Element;
|
|
@@ -5,12 +5,15 @@ export var TableCell = function TableCell(_ref) {
|
|
|
5
5
|
var align = _ref.align,
|
|
6
6
|
children = _ref.children,
|
|
7
7
|
_ref$noWrap = _ref.noWrap,
|
|
8
|
-
noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap
|
|
8
|
+
noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
|
|
9
|
+
_ref$verticalAlign = _ref.verticalAlign,
|
|
10
|
+
verticalAlign = _ref$verticalAlign === void 0 ? 'top' : _ref$verticalAlign;
|
|
9
11
|
return /*#__PURE__*/React.createElement(StyledTableCell, {
|
|
10
12
|
"data-text-align": align,
|
|
11
|
-
"data-no-wrap": noWrap
|
|
13
|
+
"data-no-wrap": noWrap,
|
|
14
|
+
"data-vertical-align": verticalAlign
|
|
12
15
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
13
16
|
as: "div",
|
|
14
|
-
variant: "
|
|
17
|
+
variant: "subtitle2"
|
|
15
18
|
}, children));
|
|
16
19
|
};
|
|
@@ -16,13 +16,16 @@ export var TableHeader = function TableHeader(_ref) {
|
|
|
16
16
|
useEffect(function () {
|
|
17
17
|
setSortDirection(sortDirectionProp);
|
|
18
18
|
}, [sortDirectionProp]);
|
|
19
|
-
var iconName = sortDirection === 'ASCENDING' ? 'ri-arrow-
|
|
19
|
+
var iconName = sortDirection === 'ASCENDING' ? 'ri-arrow-up-line' : 'ri-arrow-down-line';
|
|
20
20
|
var iconMarkup = sortDirection ? /*#__PURE__*/React.createElement(Icon, {
|
|
21
|
-
|
|
21
|
+
className: "data-table-sort-button-icon",
|
|
22
|
+
name: iconName,
|
|
23
|
+
height: "10px",
|
|
24
|
+
fill: Neutral.B40
|
|
22
25
|
}) : null;
|
|
23
26
|
var titleMarkup = /*#__PURE__*/React.createElement(Typography, {
|
|
24
27
|
as: "span",
|
|
25
|
-
variant: "
|
|
28
|
+
variant: "caption",
|
|
26
29
|
color: Neutral.B18,
|
|
27
30
|
style: {
|
|
28
31
|
whiteSpace: 'nowrap'
|
|
@@ -37,6 +40,7 @@ export var TableHeader = function TableHeader(_ref) {
|
|
|
37
40
|
onSort == null ? void 0 : onSort(direction);
|
|
38
41
|
};
|
|
39
42
|
var sortableCellMarkup = /*#__PURE__*/React.createElement(Button, {
|
|
43
|
+
className: "data-table-sort-button",
|
|
40
44
|
"data-testid": "data-table-sort-button-" + title,
|
|
41
45
|
icon: iconMarkup,
|
|
42
46
|
onClick: function onClick() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Option, Section } from '../Menu';
|
|
3
|
+
import { IconNames } from '../Icon/icons/icons';
|
|
3
4
|
interface SearchableProps {
|
|
4
5
|
/** value of TextInput activator when Select is searchable */
|
|
5
6
|
inputValue?: string;
|
|
@@ -8,6 +9,7 @@ interface SearchableProps {
|
|
|
8
9
|
}
|
|
9
10
|
export interface SelectProps {
|
|
10
11
|
allowMultiple?: boolean;
|
|
12
|
+
customActivatorIcon?: IconNames;
|
|
11
13
|
disabled?: boolean;
|
|
12
14
|
hasError?: boolean;
|
|
13
15
|
helpText?: React.ReactNode;
|
|
@@ -41,5 +43,5 @@ export interface SelectProps {
|
|
|
41
43
|
/** sets z-index override for option list dropdown. z-index default to 400 */
|
|
42
44
|
zIndexOverride?: number;
|
|
43
45
|
}
|
|
44
|
-
export declare const Select: ({ allowMultiple, disabled, hasError, helpText, label, listHeight, loadingOptions, name, onClose, onRemoveTag, onSelect, optionListFitContent, options, placeholder, prefix, searchable, searchableProps, scrollable, sections, selectedValues, width, zIndexOverride, }: SelectProps) => JSX.Element;
|
|
46
|
+
export declare const Select: ({ allowMultiple, customActivatorIcon, disabled, hasError, helpText, label, listHeight, loadingOptions, name, onClose, onRemoveTag, onSelect, optionListFitContent, options, placeholder, prefix, searchable, searchableProps, scrollable, sections, selectedValues, width, zIndexOverride, }: SelectProps) => JSX.Element;
|
|
45
47
|
export {};
|
|
@@ -9,6 +9,7 @@ import { ActivatorWrapper, HelpTextContainer } from './SelectStyle';
|
|
|
9
9
|
export var Select = function Select(_ref) {
|
|
10
10
|
var _ref$allowMultiple = _ref.allowMultiple,
|
|
11
11
|
allowMultiple = _ref$allowMultiple === void 0 ? false : _ref$allowMultiple,
|
|
12
|
+
customActivatorIcon = _ref.customActivatorIcon,
|
|
12
13
|
_ref$disabled = _ref.disabled,
|
|
13
14
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
14
15
|
_ref$hasError = _ref.hasError,
|
|
@@ -127,6 +128,7 @@ export var Select = function Select(_ref) {
|
|
|
127
128
|
}
|
|
128
129
|
return /*#__PURE__*/React.createElement(ActivatorSelect, {
|
|
129
130
|
allowMultiple: allowMultiple,
|
|
131
|
+
customActivatorIcon: customActivatorIcon,
|
|
130
132
|
disabled: disabled,
|
|
131
133
|
hasError: hasError,
|
|
132
134
|
placeholder: placeholder != null ? placeholder : 'Placeholder',
|
|
@@ -135,7 +137,8 @@ export var Select = function Select(_ref) {
|
|
|
135
137
|
width: width,
|
|
136
138
|
selectedValues: selectedValues,
|
|
137
139
|
options: options,
|
|
138
|
-
name: name
|
|
140
|
+
name: name,
|
|
141
|
+
prefix: prefix
|
|
139
142
|
});
|
|
140
143
|
};
|
|
141
144
|
return /*#__PURE__*/React.createElement(Popover, {
|
|
@@ -5,6 +5,7 @@ export declare const NonSearchableSingleSelect: any;
|
|
|
5
5
|
export declare const NonSearchableMultipleSelect: any;
|
|
6
6
|
export declare const WithErrorNonSearchable: any;
|
|
7
7
|
export declare const NonSearchableDisabled: any;
|
|
8
|
+
export declare const NonSearchablePrefixed: any;
|
|
8
9
|
export declare const SearchableMultiSelect: any;
|
|
9
10
|
export declare const SearchableSingleSelect: any;
|
|
10
11
|
export declare const SearchableSingleSelectWithOverflowingInputState: any;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Option } from '../../../Menu';
|
|
3
|
-
|
|
3
|
+
import { IconNames } from '../../../Icon/icons/icons';
|
|
4
|
+
export interface ActivatorSelectProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'prefix'> {
|
|
4
5
|
allowMultiple?: boolean;
|
|
6
|
+
customActivatorIcon?: IconNames;
|
|
5
7
|
hasError?: boolean;
|
|
6
8
|
selectedValues?: string[];
|
|
7
9
|
placeholder?: string;
|
|
10
|
+
prefix?: React.ReactNode;
|
|
8
11
|
onRemoveTag?({ option }: {
|
|
9
12
|
option: string;
|
|
10
13
|
}): void;
|
|
@@ -12,4 +15,4 @@ export interface ActivatorSelectProps extends React.ButtonHTMLAttributes<HTMLBut
|
|
|
12
15
|
options?: Option[];
|
|
13
16
|
width?: string;
|
|
14
17
|
}
|
|
15
|
-
export declare const ActivatorSelect: ({ placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, ...props }: ActivatorSelectProps) => JSX.Element;
|
|
18
|
+
export declare const ActivatorSelect: ({ customActivatorIcon, placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, prefix, ...props }: ActivatorSelectProps) => JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["placeholder", "selectedValues", "onClick", "onRemoveTag", "width", "allowMultiple", "disabled", "onSelectClick", "hasError", "options"];
|
|
3
|
+
var _excluded = ["customActivatorIcon", "placeholder", "selectedValues", "onClick", "onRemoveTag", "width", "allowMultiple", "disabled", "onSelectClick", "hasError", "options", "prefix"];
|
|
4
4
|
import React, { useEffect, useRef, useState } from 'react';
|
|
5
|
-
import { Icon } from '../../../Icon';
|
|
6
5
|
import { Typography } from '../../../Typography';
|
|
7
6
|
import { Blue, Neutral } from '../../../utilities/colors';
|
|
8
|
-
import { StyledSelect, StyledSelectTypography, StyledTag, TagsContainer } from './ActivatorStyle';
|
|
7
|
+
import { StyledIcon, StyledPrefixContainer, StyledSelect, StyledSelectTypography, StyledTag, TagsContainer, WithPrefixContainer } from './ActivatorStyle';
|
|
9
8
|
export var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
10
|
-
var
|
|
9
|
+
var customActivatorIcon = _ref.customActivatorIcon,
|
|
10
|
+
placeholder = _ref.placeholder,
|
|
11
11
|
selectedValues = _ref.selectedValues,
|
|
12
12
|
onClick = _ref.onClick,
|
|
13
13
|
onRemoveTag = _ref.onRemoveTag,
|
|
@@ -20,6 +20,7 @@ export var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
|
20
20
|
_ref$hasError = _ref.hasError,
|
|
21
21
|
hasError = _ref$hasError === void 0 ? false : _ref$hasError,
|
|
22
22
|
options = _ref.options,
|
|
23
|
+
prefix = _ref.prefix,
|
|
23
24
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
24
25
|
var _useState = useState([]),
|
|
25
26
|
filteredValues = _useState[0],
|
|
@@ -76,13 +77,13 @@ export var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
|
76
77
|
onClick: handleClick,
|
|
77
78
|
disabled: disabled,
|
|
78
79
|
width: width
|
|
79
|
-
}), allowMultiple ? tagsMarkup() : /*#__PURE__*/React.createElement(StyledSelectTypography, {
|
|
80
|
+
}), /*#__PURE__*/React.createElement(WithPrefixContainer, null, prefix && /*#__PURE__*/React.createElement(StyledPrefixContainer, null, prefix), allowMultiple ? tagsMarkup() : /*#__PURE__*/React.createElement(StyledSelectTypography, {
|
|
80
81
|
variant: "body1",
|
|
81
82
|
"data-disabled": disabled,
|
|
82
83
|
color: hasSelectedValues ? Neutral.B18 : Neutral.B40
|
|
83
|
-
}, hasSelectedValues ? selectedLabels[0] : placeholderMarkup), /*#__PURE__*/React.createElement(
|
|
84
|
+
}, hasSelectedValues ? selectedLabels[0] : placeholderMarkup)), /*#__PURE__*/React.createElement(StyledIcon, {
|
|
84
85
|
height: 24,
|
|
85
|
-
name:
|
|
86
|
+
name: customActivatorIcon || 'ri-arrow-m-down-line',
|
|
86
87
|
fill: disabled ? Neutral.B85 : Neutral.B40
|
|
87
88
|
}));
|
|
88
89
|
};
|
|
@@ -8,3 +8,6 @@ export declare const StyledTextInput: import("styled-components").StyledComponen
|
|
|
8
8
|
onChange?: (value: string) => void;
|
|
9
9
|
} & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
|
|
10
10
|
export declare const StyledSelectTypography: import("styled-components").StyledComponent<({ as, children, variant, style, ...props }: import("../../../Typography").TypographyProps) => JSX.Element, any, {}, never>;
|
|
11
|
+
export declare const WithPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const StyledPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const StyledIcon: import("styled-components").StyledComponent<({ name, ...props }: import("../../../Icon").IconProps) => JSX.Element, any, {}, never>;
|
|
@@ -7,6 +7,7 @@ import { space8 } from '../../../utilities/spacing';
|
|
|
7
7
|
import { TextInput } from '../../../TextInput';
|
|
8
8
|
import { Tag } from '../../../Tag';
|
|
9
9
|
import { Typography } from '../../../Typography';
|
|
10
|
+
import { Icon } from '../../../Icon';
|
|
10
11
|
export var StyledSelect = styled.button.withConfig({
|
|
11
12
|
displayName: "ActivatorStyle__StyledSelect",
|
|
12
13
|
componentId: "sc-rui73p-0"
|
|
@@ -30,4 +31,16 @@ export var StyledTextInput = styled(TextInput).withConfig({
|
|
|
30
31
|
export var StyledSelectTypography = styled(Typography).withConfig({
|
|
31
32
|
displayName: "ActivatorStyle__StyledSelectTypography",
|
|
32
33
|
componentId: "sc-rui73p-4"
|
|
33
|
-
})(["
|
|
34
|
+
})(["display:flex;margin-left:auto;&[data-disabled='true']{color:", ";}"], Neutral.B85);
|
|
35
|
+
export var WithPrefixContainer = styled.div.withConfig({
|
|
36
|
+
displayName: "ActivatorStyle__WithPrefixContainer",
|
|
37
|
+
componentId: "sc-rui73p-5"
|
|
38
|
+
})(["display:flex;align-items:center;"]);
|
|
39
|
+
export var StyledPrefixContainer = styled.div.withConfig({
|
|
40
|
+
displayName: "ActivatorStyle__StyledPrefixContainer",
|
|
41
|
+
componentId: "sc-rui73p-6"
|
|
42
|
+
})(["display:flex;width:20px;margin-right:8px;"]);
|
|
43
|
+
export var StyledIcon = styled(Icon).withConfig({
|
|
44
|
+
displayName: "ActivatorStyle__StyledIcon",
|
|
45
|
+
componentId: "sc-rui73p-7"
|
|
46
|
+
})(["margin-left:auto;"]);
|
|
@@ -3,7 +3,6 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutP
|
|
|
3
3
|
var _excluded = ["options", "allowMultiple", "disabled"];
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
5
|
import { Select } from '../Select';
|
|
6
|
-
import { SelectWrapper } from './SelectStoryStyle';
|
|
7
6
|
export var SingleSelect = function SingleSelect(_ref) {
|
|
8
7
|
var options = _ref.options,
|
|
9
8
|
allowMultiple = _ref.allowMultiple,
|
|
@@ -16,18 +15,13 @@ export var SingleSelect = function SingleSelect(_ref) {
|
|
|
16
15
|
var value = _ref2.value;
|
|
17
16
|
setSelected(value);
|
|
18
17
|
};
|
|
19
|
-
return /*#__PURE__*/React.createElement(
|
|
20
|
-
style: {
|
|
21
|
-
display: 'flex',
|
|
22
|
-
width: '400px'
|
|
23
|
-
}
|
|
24
|
-
}, /*#__PURE__*/React.createElement(Select, _extends({}, args, {
|
|
18
|
+
return /*#__PURE__*/React.createElement(Select, _extends({}, args, {
|
|
25
19
|
allowMultiple: allowMultiple,
|
|
26
20
|
disabled: disabled,
|
|
27
21
|
options: options,
|
|
28
22
|
onSelect: handleSelect,
|
|
29
23
|
selectedValues: [selected],
|
|
30
|
-
width: "
|
|
24
|
+
width: "400px",
|
|
31
25
|
label: "Label"
|
|
32
|
-
}))
|
|
26
|
+
}));
|
|
33
27
|
};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const StyledTag: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../Tag").TagProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
3
|
-
export declare const SelectWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -4,8 +4,4 @@ import { space8 } from '../../utilities/spacing';
|
|
|
4
4
|
export var StyledTag = styled(Tag).withConfig({
|
|
5
5
|
displayName: "SelectStoryStyle__StyledTag",
|
|
6
6
|
componentId: "sc-1xv9wvg-0"
|
|
7
|
-
})(["margin-right:", ";"], space8);
|
|
8
|
-
export var SelectWrapper = styled.div.withConfig({
|
|
9
|
-
displayName: "SelectStoryStyle__SelectWrapper",
|
|
10
|
-
componentId: "sc-1xv9wvg-1"
|
|
11
|
-
})(["div{width:100%;}"]);
|
|
7
|
+
})(["margin-right:", ";"], space8);
|
|
@@ -88,7 +88,7 @@ var SideSheet = /*#__PURE__*/React.forwardRef(function SideSheet(_ref, ref) {
|
|
|
88
88
|
onClick: handleClose
|
|
89
89
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
90
90
|
name: "ri-close"
|
|
91
|
-
})))), showHorizontalLine && /*#__PURE__*/React.createElement(StyledHorizontalLine, null), children, /*#__PURE__*/React.createElement(StyledSideSheetFooter, null, /*#__PURE__*/React.createElement(StyledHorizontalLine, null), /*#__PURE__*/React.createElement(StyledButtonGroupContainer, null, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
91
|
+
})))), showHorizontalLine && /*#__PURE__*/React.createElement(StyledHorizontalLine, null), children, (basicButtonAction || primaryButtonAction) && /*#__PURE__*/React.createElement(StyledSideSheetFooter, null, /*#__PURE__*/React.createElement(StyledHorizontalLine, null), /*#__PURE__*/React.createElement(StyledButtonGroupContainer, null, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
92
92
|
fullWidth: true
|
|
93
93
|
}, basicButtonAction && /*#__PURE__*/React.createElement(Button, {
|
|
94
94
|
onClick: basicButtonAction.action,
|
|
@@ -11,7 +11,7 @@ export interface DataTableProps extends React.TableHTMLAttributes<HTMLTableEleme
|
|
|
11
11
|
/** If the title in TableHeading is of type ReactNode and you require sorting functionality, please make sure to provide 'id' for the TableHeading */
|
|
12
12
|
headings: TableHeading[];
|
|
13
13
|
children: React.ReactNode;
|
|
14
|
-
emptyState
|
|
14
|
+
emptyState?: React.ReactElement<EmptyStateProps>;
|
|
15
15
|
totals?: Total[];
|
|
16
16
|
loading?: boolean;
|
|
17
17
|
loadingLabel?: string;
|
|
@@ -19,7 +19,7 @@ export interface DataTableProps extends React.TableHTMLAttributes<HTMLTableEleme
|
|
|
19
19
|
}
|
|
20
20
|
export declare const DataTable: React.ForwardRefExoticComponent<DataTableProps & React.RefAttributes<HTMLTableElement>> & {
|
|
21
21
|
Row: ({ children, ...props }: import("./TableRow").TableRowProps) => JSX.Element;
|
|
22
|
-
Cell: ({ align, children, noWrap, }: import("./TableCell").TableCellProps) => JSX.Element;
|
|
22
|
+
Cell: ({ align, children, noWrap, verticalAlign, }: import("./TableCell").TableCellProps) => JSX.Element;
|
|
23
23
|
Footer: ({ children }: {
|
|
24
24
|
children: React.ReactNode;
|
|
25
25
|
}) => JSX.Element;
|
|
@@ -59,7 +59,7 @@ var DataTableComponent = /*#__PURE__*/_react["default"].forwardRef(function Data
|
|
|
59
59
|
align: align
|
|
60
60
|
}, /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
61
61
|
as: "div",
|
|
62
|
-
variant: "
|
|
62
|
+
variant: "caption"
|
|
63
63
|
}, title));
|
|
64
64
|
}) : null;
|
|
65
65
|
var footer;
|
|
@@ -73,9 +73,9 @@ var DataTableComponent = /*#__PURE__*/_react["default"].forwardRef(function Data
|
|
|
73
73
|
}
|
|
74
74
|
rows.push(reactEl);
|
|
75
75
|
}
|
|
76
|
-
var emptyRow = /*#__PURE__*/_react["default"].createElement(_DataTableStyle.StyledTableRow, null, /*#__PURE__*/_react["default"].createElement(_DataTableStyle.StyledTableCell, {
|
|
76
|
+
var emptyRow = emptyState ? /*#__PURE__*/_react["default"].createElement(_DataTableStyle.StyledTableRow, null, /*#__PURE__*/_react["default"].createElement(_DataTableStyle.StyledTableCell, {
|
|
77
77
|
colSpan: headings.length
|
|
78
|
-
}, emptyState));
|
|
78
|
+
}, emptyState)) : null;
|
|
79
79
|
var hasRows = rows.length > 0;
|
|
80
80
|
var rowsMarkup = hasRows ? rows : emptyRow;
|
|
81
81
|
var showFooter = !!footer;
|
|
@@ -11,6 +11,7 @@ var _spacing = require("../utilities/spacing");
|
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
13
|
var alignmentStyle = "\n&[data-text-align='right'] {\n > div {\n display: flex;\n justify-content: right;\n }\n}\n\n&[data-text-align='center'] {\n > div {\n display: flex;\n justify-content: center;\n }\n}\n";
|
|
14
|
+
var cellVerticalAlign = "\n&[data-vertical-align='top'] {\n vertical-align: top;\n}\n\n&[data-vertical-align='center'] {\n vertical-align: center;\n}\n";
|
|
14
15
|
var StyledTable = _styledComponents["default"].table.withConfig({
|
|
15
16
|
displayName: "DataTableStyle__StyledTable",
|
|
16
17
|
componentId: "sc-18v2ula-0"
|
|
@@ -24,12 +25,12 @@ exports.StyledTableRow = StyledTableRow;
|
|
|
24
25
|
var StyledTabledHeader = _styledComponents["default"].th.withConfig({
|
|
25
26
|
displayName: "DataTableStyle__StyledTabledHeader",
|
|
26
27
|
componentId: "sc-18v2ula-2"
|
|
27
|
-
})(["padding:", ";text-align:left;", " button{padding:0;margin:0;height:auto;border:none;box-shadow:none;background:", ";}button:hover{background:transparent;}button:active{border:none;box-shadow:none;background:transparent;}button:focus{border:none;}button svg{width:
|
|
28
|
+
})(["padding:", ";text-align:left;", " button{padding:0;margin:0;height:auto;border:none;box-shadow:none;background:", ";}button:hover{background:transparent;}button:active{border:none;box-shadow:none;background:transparent;}button:focus{border:none;}button svg{width:16px;height:16px;fill:", ";margin-bottom:2px;}"], _spacing.space16, alignmentStyle, _colors.Neutral.B99, _colors.Neutral.B40);
|
|
28
29
|
exports.StyledTabledHeader = StyledTabledHeader;
|
|
29
30
|
var StyledTableCell = _styledComponents["default"].td.withConfig({
|
|
30
31
|
displayName: "DataTableStyle__StyledTableCell",
|
|
31
32
|
componentId: "sc-18v2ula-3"
|
|
32
|
-
})(["text-align:left;padding:", ";
|
|
33
|
+
})(["text-align:left;padding:", " ", ";", " ", " &[data-no-wrap='true']{white-space:nowrap;div{width:max-content;}}"], _spacing.space8, _spacing.space16, alignmentStyle, cellVerticalAlign);
|
|
33
34
|
exports.StyledTableCell = StyledTableCell;
|
|
34
35
|
var StyledTableFooterRow = _styledComponents["default"].tr.withConfig({
|
|
35
36
|
displayName: "DataTableStyle__StyledTableFooterRow",
|
|
@@ -3,5 +3,6 @@ export interface TableCellProps extends React.TdHTMLAttributes<HTMLTableColEleme
|
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
/** Sets table cell content to not wrap*/
|
|
5
5
|
noWrap?: boolean;
|
|
6
|
+
verticalAlign?: 'top' | 'center';
|
|
6
7
|
}
|
|
7
|
-
export declare const TableCell: ({ align, children, noWrap, }: TableCellProps) => JSX.Element;
|
|
8
|
+
export declare const TableCell: ({ align, children, noWrap, verticalAlign, }: TableCellProps) => JSX.Element;
|
|
@@ -10,13 +10,16 @@ var TableCell = function TableCell(_ref) {
|
|
|
10
10
|
var align = _ref.align,
|
|
11
11
|
children = _ref.children,
|
|
12
12
|
_ref$noWrap = _ref.noWrap,
|
|
13
|
-
noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap
|
|
13
|
+
noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
|
|
14
|
+
_ref$verticalAlign = _ref.verticalAlign,
|
|
15
|
+
verticalAlign = _ref$verticalAlign === void 0 ? 'top' : _ref$verticalAlign;
|
|
14
16
|
return /*#__PURE__*/_react["default"].createElement(_DataTableStyle.StyledTableCell, {
|
|
15
17
|
"data-text-align": align,
|
|
16
|
-
"data-no-wrap": noWrap
|
|
18
|
+
"data-no-wrap": noWrap,
|
|
19
|
+
"data-vertical-align": verticalAlign
|
|
17
20
|
}, /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
18
21
|
as: "div",
|
|
19
|
-
variant: "
|
|
22
|
+
variant: "subtitle2"
|
|
20
23
|
}, children));
|
|
21
24
|
};
|
|
22
25
|
exports.TableCell = TableCell;
|
|
@@ -22,13 +22,16 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
22
22
|
(0, _react.useEffect)(function () {
|
|
23
23
|
setSortDirection(sortDirectionProp);
|
|
24
24
|
}, [sortDirectionProp]);
|
|
25
|
-
var iconName = sortDirection === 'ASCENDING' ? 'ri-arrow-
|
|
25
|
+
var iconName = sortDirection === 'ASCENDING' ? 'ri-arrow-up-line' : 'ri-arrow-down-line';
|
|
26
26
|
var iconMarkup = sortDirection ? /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
|
|
27
|
-
|
|
27
|
+
className: "data-table-sort-button-icon",
|
|
28
|
+
name: iconName,
|
|
29
|
+
height: "10px",
|
|
30
|
+
fill: _colors.Neutral.B40
|
|
28
31
|
}) : null;
|
|
29
32
|
var titleMarkup = /*#__PURE__*/_react["default"].createElement(_Typography.Typography, {
|
|
30
33
|
as: "span",
|
|
31
|
-
variant: "
|
|
34
|
+
variant: "caption",
|
|
32
35
|
color: _colors.Neutral.B18,
|
|
33
36
|
style: {
|
|
34
37
|
whiteSpace: 'nowrap'
|
|
@@ -43,6 +46,7 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
43
46
|
onSort == null ? void 0 : onSort(direction);
|
|
44
47
|
};
|
|
45
48
|
var sortableCellMarkup = /*#__PURE__*/_react["default"].createElement(_Button.Button, {
|
|
49
|
+
className: "data-table-sort-button",
|
|
46
50
|
"data-testid": "data-table-sort-button-" + title,
|
|
47
51
|
icon: iconMarkup,
|
|
48
52
|
onClick: function onClick() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Option, Section } from '../Menu';
|
|
3
|
+
import { IconNames } from '../Icon/icons/icons';
|
|
3
4
|
interface SearchableProps {
|
|
4
5
|
/** value of TextInput activator when Select is searchable */
|
|
5
6
|
inputValue?: string;
|
|
@@ -8,6 +9,7 @@ interface SearchableProps {
|
|
|
8
9
|
}
|
|
9
10
|
export interface SelectProps {
|
|
10
11
|
allowMultiple?: boolean;
|
|
12
|
+
customActivatorIcon?: IconNames;
|
|
11
13
|
disabled?: boolean;
|
|
12
14
|
hasError?: boolean;
|
|
13
15
|
helpText?: React.ReactNode;
|
|
@@ -41,5 +43,5 @@ export interface SelectProps {
|
|
|
41
43
|
/** sets z-index override for option list dropdown. z-index default to 400 */
|
|
42
44
|
zIndexOverride?: number;
|
|
43
45
|
}
|
|
44
|
-
export declare const Select: ({ allowMultiple, disabled, hasError, helpText, label, listHeight, loadingOptions, name, onClose, onRemoveTag, onSelect, optionListFitContent, options, placeholder, prefix, searchable, searchableProps, scrollable, sections, selectedValues, width, zIndexOverride, }: SelectProps) => JSX.Element;
|
|
46
|
+
export declare const Select: ({ allowMultiple, customActivatorIcon, disabled, hasError, helpText, label, listHeight, loadingOptions, name, onClose, onRemoveTag, onSelect, optionListFitContent, options, placeholder, prefix, searchable, searchableProps, scrollable, sections, selectedValues, width, zIndexOverride, }: SelectProps) => JSX.Element;
|
|
45
47
|
export {};
|
|
@@ -15,6 +15,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
15
15
|
var Select = function Select(_ref) {
|
|
16
16
|
var _ref$allowMultiple = _ref.allowMultiple,
|
|
17
17
|
allowMultiple = _ref$allowMultiple === void 0 ? false : _ref$allowMultiple,
|
|
18
|
+
customActivatorIcon = _ref.customActivatorIcon,
|
|
18
19
|
_ref$disabled = _ref.disabled,
|
|
19
20
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
20
21
|
_ref$hasError = _ref.hasError,
|
|
@@ -133,6 +134,7 @@ var Select = function Select(_ref) {
|
|
|
133
134
|
}
|
|
134
135
|
return /*#__PURE__*/_react["default"].createElement(_ActivatorSelect.ActivatorSelect, {
|
|
135
136
|
allowMultiple: allowMultiple,
|
|
137
|
+
customActivatorIcon: customActivatorIcon,
|
|
136
138
|
disabled: disabled,
|
|
137
139
|
hasError: hasError,
|
|
138
140
|
placeholder: placeholder != null ? placeholder : 'Placeholder',
|
|
@@ -141,7 +143,8 @@ var Select = function Select(_ref) {
|
|
|
141
143
|
width: width,
|
|
142
144
|
selectedValues: selectedValues,
|
|
143
145
|
options: options,
|
|
144
|
-
name: name
|
|
146
|
+
name: name,
|
|
147
|
+
prefix: prefix
|
|
145
148
|
});
|
|
146
149
|
};
|
|
147
150
|
return /*#__PURE__*/_react["default"].createElement(_Popover.Popover, {
|
|
@@ -5,6 +5,7 @@ export declare const NonSearchableSingleSelect: any;
|
|
|
5
5
|
export declare const NonSearchableMultipleSelect: any;
|
|
6
6
|
export declare const WithErrorNonSearchable: any;
|
|
7
7
|
export declare const NonSearchableDisabled: any;
|
|
8
|
+
export declare const NonSearchablePrefixed: any;
|
|
8
9
|
export declare const SearchableMultiSelect: any;
|
|
9
10
|
export declare const SearchableSingleSelect: any;
|
|
10
11
|
export declare const SearchableSingleSelectWithOverflowingInputState: any;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Option } from '../../../Menu';
|
|
3
|
-
|
|
3
|
+
import { IconNames } from '../../../Icon/icons/icons';
|
|
4
|
+
export interface ActivatorSelectProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'prefix'> {
|
|
4
5
|
allowMultiple?: boolean;
|
|
6
|
+
customActivatorIcon?: IconNames;
|
|
5
7
|
hasError?: boolean;
|
|
6
8
|
selectedValues?: string[];
|
|
7
9
|
placeholder?: string;
|
|
10
|
+
prefix?: React.ReactNode;
|
|
8
11
|
onRemoveTag?({ option }: {
|
|
9
12
|
option: string;
|
|
10
13
|
}): void;
|
|
@@ -12,4 +15,4 @@ export interface ActivatorSelectProps extends React.ButtonHTMLAttributes<HTMLBut
|
|
|
12
15
|
options?: Option[];
|
|
13
16
|
width?: string;
|
|
14
17
|
}
|
|
15
|
-
export declare const ActivatorSelect: ({ placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, ...props }: ActivatorSelectProps) => JSX.Element;
|
|
18
|
+
export declare const ActivatorSelect: ({ customActivatorIcon, placeholder, selectedValues, onClick, onRemoveTag, width, allowMultiple, disabled, onSelectClick, hasError, options, prefix, ...props }: ActivatorSelectProps) => JSX.Element;
|
|
@@ -6,15 +6,15 @@ exports.ActivatorSelect = void 0;
|
|
|
6
6
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
7
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _Icon = require("../../../Icon");
|
|
10
9
|
var _Typography = require("../../../Typography");
|
|
11
10
|
var _colors = require("../../../utilities/colors");
|
|
12
11
|
var _ActivatorStyle = require("./ActivatorStyle");
|
|
13
|
-
var _excluded = ["placeholder", "selectedValues", "onClick", "onRemoveTag", "width", "allowMultiple", "disabled", "onSelectClick", "hasError", "options"];
|
|
12
|
+
var _excluded = ["customActivatorIcon", "placeholder", "selectedValues", "onClick", "onRemoveTag", "width", "allowMultiple", "disabled", "onSelectClick", "hasError", "options", "prefix"];
|
|
14
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
15
|
var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
17
|
-
var
|
|
16
|
+
var customActivatorIcon = _ref.customActivatorIcon,
|
|
17
|
+
placeholder = _ref.placeholder,
|
|
18
18
|
selectedValues = _ref.selectedValues,
|
|
19
19
|
onClick = _ref.onClick,
|
|
20
20
|
onRemoveTag = _ref.onRemoveTag,
|
|
@@ -27,6 +27,7 @@ var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
|
27
27
|
_ref$hasError = _ref.hasError,
|
|
28
28
|
hasError = _ref$hasError === void 0 ? false : _ref$hasError,
|
|
29
29
|
options = _ref.options,
|
|
30
|
+
prefix = _ref.prefix,
|
|
30
31
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
|
|
31
32
|
var _useState = (0, _react.useState)([]),
|
|
32
33
|
filteredValues = _useState[0],
|
|
@@ -83,13 +84,13 @@ var ActivatorSelect = function ActivatorSelect(_ref) {
|
|
|
83
84
|
onClick: handleClick,
|
|
84
85
|
disabled: disabled,
|
|
85
86
|
width: width
|
|
86
|
-
}), allowMultiple ? tagsMarkup() : /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledSelectTypography, {
|
|
87
|
+
}), /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.WithPrefixContainer, null, prefix && /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledPrefixContainer, null, prefix), allowMultiple ? tagsMarkup() : /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledSelectTypography, {
|
|
87
88
|
variant: "body1",
|
|
88
89
|
"data-disabled": disabled,
|
|
89
90
|
color: hasSelectedValues ? _colors.Neutral.B18 : _colors.Neutral.B40
|
|
90
|
-
}, hasSelectedValues ? selectedLabels[0] : placeholderMarkup), /*#__PURE__*/_react["default"].createElement(
|
|
91
|
+
}, hasSelectedValues ? selectedLabels[0] : placeholderMarkup)), /*#__PURE__*/_react["default"].createElement(_ActivatorStyle.StyledIcon, {
|
|
91
92
|
height: 24,
|
|
92
|
-
name:
|
|
93
|
+
name: customActivatorIcon || 'ri-arrow-m-down-line',
|
|
93
94
|
fill: disabled ? _colors.Neutral.B85 : _colors.Neutral.B40
|
|
94
95
|
}));
|
|
95
96
|
};
|
|
@@ -8,3 +8,6 @@ export declare const StyledTextInput: import("styled-components").StyledComponen
|
|
|
8
8
|
onChange?: (value: string) => void;
|
|
9
9
|
} & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
|
|
10
10
|
export declare const StyledSelectTypography: import("styled-components").StyledComponent<({ as, children, variant, style, ...props }: import("../../../Typography").TypographyProps) => JSX.Element, any, {}, never>;
|
|
11
|
+
export declare const WithPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
export declare const StyledPrefixContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const StyledIcon: import("styled-components").StyledComponent<({ name, ...props }: import("../../../Icon").IconProps) => JSX.Element, any, {}, never>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.TagsContainer = exports.StyledTextInput = exports.StyledTag = exports.StyledSelectTypography = exports.StyledSelect = void 0;
|
|
5
|
+
exports.WithPrefixContainer = exports.TagsContainer = exports.StyledTextInput = exports.StyledTag = exports.StyledSelectTypography = exports.StyledSelect = exports.StyledPrefixContainer = exports.StyledIcon = void 0;
|
|
6
6
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
7
7
|
var Breakpoints = _interopRequireWildcard(require("../../../utilities/breakpoints/Breakpoints"));
|
|
8
8
|
var _borderRadius = require("../../../utilities/borderRadius");
|
|
@@ -12,6 +12,7 @@ var _spacing = require("../../../utilities/spacing");
|
|
|
12
12
|
var _TextInput = require("../../../TextInput");
|
|
13
13
|
var _Tag = require("../../../Tag");
|
|
14
14
|
var _Typography = require("../../../Typography");
|
|
15
|
+
var _Icon = require("../../../Icon");
|
|
15
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
18
|
var StyledSelect = _styledComponents["default"].button.withConfig({
|
|
@@ -41,5 +42,20 @@ exports.StyledTextInput = StyledTextInput;
|
|
|
41
42
|
var StyledSelectTypography = (0, _styledComponents["default"])(_Typography.Typography).withConfig({
|
|
42
43
|
displayName: "ActivatorStyle__StyledSelectTypography",
|
|
43
44
|
componentId: "sc-rui73p-4"
|
|
44
|
-
})(["
|
|
45
|
-
exports.StyledSelectTypography = StyledSelectTypography;
|
|
45
|
+
})(["display:flex;margin-left:auto;&[data-disabled='true']{color:", ";}"], _colors.Neutral.B85);
|
|
46
|
+
exports.StyledSelectTypography = StyledSelectTypography;
|
|
47
|
+
var WithPrefixContainer = _styledComponents["default"].div.withConfig({
|
|
48
|
+
displayName: "ActivatorStyle__WithPrefixContainer",
|
|
49
|
+
componentId: "sc-rui73p-5"
|
|
50
|
+
})(["display:flex;align-items:center;"]);
|
|
51
|
+
exports.WithPrefixContainer = WithPrefixContainer;
|
|
52
|
+
var StyledPrefixContainer = _styledComponents["default"].div.withConfig({
|
|
53
|
+
displayName: "ActivatorStyle__StyledPrefixContainer",
|
|
54
|
+
componentId: "sc-rui73p-6"
|
|
55
|
+
})(["display:flex;width:20px;margin-right:8px;"]);
|
|
56
|
+
exports.StyledPrefixContainer = StyledPrefixContainer;
|
|
57
|
+
var StyledIcon = (0, _styledComponents["default"])(_Icon.Icon).withConfig({
|
|
58
|
+
displayName: "ActivatorStyle__StyledIcon",
|
|
59
|
+
componentId: "sc-rui73p-7"
|
|
60
|
+
})(["margin-left:auto;"]);
|
|
61
|
+
exports.StyledIcon = StyledIcon;
|
|
@@ -7,7 +7,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
7
7
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _Select = require("../Select");
|
|
10
|
-
var _SelectStoryStyle = require("./SelectStoryStyle");
|
|
11
10
|
var _excluded = ["options", "allowMultiple", "disabled"];
|
|
12
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -23,19 +22,14 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
23
22
|
var value = _ref2.value;
|
|
24
23
|
setSelected(value);
|
|
25
24
|
};
|
|
26
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
27
|
-
style: {
|
|
28
|
-
display: 'flex',
|
|
29
|
-
width: '400px'
|
|
30
|
-
}
|
|
31
|
-
}, /*#__PURE__*/_react["default"].createElement(_Select.Select, (0, _extends2["default"])({}, args, {
|
|
25
|
+
return /*#__PURE__*/_react["default"].createElement(_Select.Select, (0, _extends2["default"])({}, args, {
|
|
32
26
|
allowMultiple: allowMultiple,
|
|
33
27
|
disabled: disabled,
|
|
34
28
|
options: options,
|
|
35
29
|
onSelect: handleSelect,
|
|
36
30
|
selectedValues: [selected],
|
|
37
|
-
width: "
|
|
31
|
+
width: "400px",
|
|
38
32
|
label: "Label"
|
|
39
|
-
}))
|
|
33
|
+
}));
|
|
40
34
|
};
|
|
41
35
|
exports.SingleSelect = SingleSelect;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const StyledTag: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../Tag").TagProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
3
|
-
export declare const SelectWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.StyledTag =
|
|
5
|
+
exports.StyledTag = void 0;
|
|
6
6
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
7
7
|
var _Tag = require("../../Tag");
|
|
8
8
|
var _spacing = require("../../utilities/spacing");
|
|
@@ -10,9 +10,4 @@ var StyledTag = (0, _styledComponents["default"])(_Tag.Tag).withConfig({
|
|
|
10
10
|
displayName: "SelectStoryStyle__StyledTag",
|
|
11
11
|
componentId: "sc-1xv9wvg-0"
|
|
12
12
|
})(["margin-right:", ";"], _spacing.space8);
|
|
13
|
-
exports.StyledTag = StyledTag;
|
|
14
|
-
var SelectWrapper = _styledComponents["default"].div.withConfig({
|
|
15
|
-
displayName: "SelectStoryStyle__SelectWrapper",
|
|
16
|
-
componentId: "sc-1xv9wvg-1"
|
|
17
|
-
})(["div{width:100%;}"]);
|
|
18
|
-
exports.SelectWrapper = SelectWrapper;
|
|
13
|
+
exports.StyledTag = StyledTag;
|
|
@@ -95,7 +95,7 @@ var SideSheet = /*#__PURE__*/_react["default"].forwardRef(function SideSheet(_re
|
|
|
95
95
|
onClick: handleClose
|
|
96
96
|
}, /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
|
|
97
97
|
name: "ri-close"
|
|
98
|
-
})))), showHorizontalLine && /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledHorizontalLine, null), children, /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledSideSheetFooter, null, /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledHorizontalLine, null), /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledButtonGroupContainer, null, /*#__PURE__*/_react["default"].createElement(_ButtonGroup.ButtonGroup, {
|
|
98
|
+
})))), showHorizontalLine && /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledHorizontalLine, null), children, (basicButtonAction || primaryButtonAction) && /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledSideSheetFooter, null, /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledHorizontalLine, null), /*#__PURE__*/_react["default"].createElement(_SideSheetStyle.StyledButtonGroupContainer, null, /*#__PURE__*/_react["default"].createElement(_ButtonGroup.ButtonGroup, {
|
|
99
99
|
fullWidth: true
|
|
100
100
|
}, basicButtonAction && /*#__PURE__*/_react["default"].createElement(_Button.Button, {
|
|
101
101
|
onClick: basicButtonAction.action,
|