@veeqo/ui 14.7.1 → 14.9.0-beta-1
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/components/Accordion/Accordion.cjs +19 -16
- package/dist/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.js +19 -16
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Accordion/Accordion.module.scss.cjs +9 -0
- package/dist/components/Accordion/Accordion.module.scss.cjs.map +1 -0
- package/dist/components/Accordion/Accordion.module.scss.js +7 -0
- package/dist/components/Accordion/Accordion.module.scss.js.map +1 -0
- package/dist/components/Action/Action.d.ts +4 -4
- package/dist/components/Card/Card.cjs +36 -9
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.d.ts +10 -5
- package/dist/components/Card/Card.js +29 -2
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.module.scss.cjs +9 -0
- package/dist/components/Card/Card.module.scss.cjs.map +1 -0
- package/dist/components/Card/Card.module.scss.js +7 -0
- package/dist/components/Card/Card.module.scss.js.map +1 -0
- package/dist/components/CardHeader/CardHeader.cjs +3 -3
- package/dist/components/CardHeader/CardHeader.cjs.map +1 -1
- package/dist/components/CardHeader/CardHeader.js +3 -3
- package/dist/components/CardHeader/CardHeader.js.map +1 -1
- package/dist/components/CardHeader/CardHeader.module.scss.cjs +9 -0
- package/dist/components/CardHeader/CardHeader.module.scss.cjs.map +1 -0
- package/dist/components/CardHeader/CardHeader.module.scss.js +7 -0
- package/dist/components/CardHeader/CardHeader.module.scss.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.cjs +2 -2
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +2 -2
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.scss.cjs +9 -0
- package/dist/components/Checkbox/Checkbox.module.scss.cjs.map +1 -0
- package/dist/components/Checkbox/Checkbox.module.scss.js +7 -0
- package/dist/components/Checkbox/Checkbox.module.scss.js.map +1 -0
- package/dist/components/Choice/Choice.cjs +21 -11
- package/dist/components/Choice/Choice.cjs.map +1 -1
- package/dist/components/Choice/Choice.js +21 -11
- package/dist/components/Choice/Choice.js.map +1 -1
- package/dist/components/Choice/Choice.module.scss.cjs +9 -0
- package/dist/components/Choice/Choice.module.scss.cjs.map +1 -0
- package/dist/components/Choice/Choice.module.scss.js +7 -0
- package/dist/components/Choice/Choice.module.scss.js.map +1 -0
- package/dist/components/ChoiceList/ChoiceList.cjs +3 -3
- package/dist/components/ChoiceList/ChoiceList.cjs.map +1 -1
- package/dist/components/ChoiceList/ChoiceList.js +3 -3
- package/dist/components/ChoiceList/ChoiceList.js.map +1 -1
- package/dist/components/ChoiceList/ChoiceList.module.scss.cjs +9 -0
- package/dist/components/ChoiceList/ChoiceList.module.scss.cjs.map +1 -0
- package/dist/components/ChoiceList/ChoiceList.module.scss.js +7 -0
- package/dist/components/ChoiceList/ChoiceList.module.scss.js.map +1 -0
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.cjs +4 -2
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.cjs.map +1 -1
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.js +4 -2
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.js.map +1 -1
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs +4 -2
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs.map +1 -1
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js +4 -2
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js.map +1 -1
- package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs +4 -2
- package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs.map +1 -1
- package/dist/components/DataGrid/components/GridContainer/GridContainer.js +4 -2
- package/dist/components/DataGrid/components/GridContainer/GridContainer.js.map +1 -1
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.cjs +4 -2
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.cjs.map +1 -1
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.js +4 -2
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.js.map +1 -1
- package/dist/components/DimensionsInput/DimensionsInput.cjs +0 -1
- package/dist/components/DimensionsInput/DimensionsInput.cjs.map +1 -1
- package/dist/components/DimensionsInput/DimensionsInput.d.ts +10 -10
- package/dist/components/DimensionsInput/DimensionsInput.js +0 -1
- package/dist/components/DimensionsInput/DimensionsInput.js.map +1 -1
- package/dist/components/Dropdown/styled.cjs +12 -1
- package/dist/components/Dropdown/styled.cjs.map +1 -1
- package/dist/components/Dropdown/styled.js +12 -1
- package/dist/components/Dropdown/styled.js.map +1 -1
- package/dist/components/FilterTag/styled.d.ts +1 -1
- package/dist/components/Flex/FlexCol/FlexCol.d.ts +1 -1
- package/dist/components/Flex/FlexRow/FlexRow.d.ts +1 -1
- package/dist/components/InputAffix/InputAffix.cjs +6 -10
- package/dist/components/InputAffix/InputAffix.cjs.map +1 -1
- package/dist/components/InputAffix/InputAffix.d.ts +4 -6
- package/dist/components/InputAffix/InputAffix.js +6 -9
- package/dist/components/InputAffix/InputAffix.js.map +1 -1
- package/dist/components/InputAffix/InputAffix.module.scss.cjs +9 -0
- package/dist/components/InputAffix/InputAffix.module.scss.cjs.map +1 -0
- package/dist/components/InputAffix/InputAffix.module.scss.js +7 -0
- package/dist/components/InputAffix/InputAffix.module.scss.js.map +1 -0
- package/dist/components/LegacyDataTable/SpecificState/styled.d.ts +2 -2
- package/dist/components/Modal/components/Dialog/styles/baseStyles.cjs +1 -1
- package/dist/components/Modal/components/Dialog/styles/baseStyles.cjs.map +1 -1
- package/dist/components/Modal/components/Dialog/styles/baseStyles.js +1 -1
- package/dist/components/Modal/components/Dialog/styles/baseStyles.js.map +1 -1
- package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.cjs +2 -2
- package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.cjs.map +1 -1
- package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.js +2 -2
- package/dist/components/Modal/components/Dialog/styles/modalTypeStyles.js.map +1 -1
- package/dist/components/Pagination/styled.d.ts +11 -11
- package/dist/components/PhoneInput/index.d.ts +10 -10
- package/dist/components/PriceInput/PriceInput.cjs +1 -1
- package/dist/components/PriceInput/PriceInput.cjs.map +1 -1
- package/dist/components/PriceInput/PriceInput.js +1 -1
- package/dist/components/PriceInput/PriceInput.js.map +1 -1
- package/dist/components/Radio/Radio.cjs +2 -2
- package/dist/components/Radio/Radio.cjs.map +1 -1
- package/dist/components/Radio/Radio.js +2 -2
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Radio/Radio.module.scss.cjs +9 -0
- package/dist/components/Radio/Radio.module.scss.cjs.map +1 -0
- package/dist/components/Radio/Radio.module.scss.js +7 -0
- package/dist/components/Radio/Radio.module.scss.js.map +1 -0
- package/dist/components/Search/Search.d.ts +10 -10
- package/dist/components/Search/styled.d.ts +10 -10
- package/dist/components/SimpleTable/SimpleTable.cjs +20 -7
- package/dist/components/SimpleTable/SimpleTable.cjs.map +1 -1
- package/dist/components/SimpleTable/SimpleTable.d.ts +9 -7
- package/dist/components/SimpleTable/SimpleTable.js +15 -2
- package/dist/components/SimpleTable/SimpleTable.js.map +1 -1
- package/dist/components/SimpleTable/SimpleTable.module.scss.cjs +9 -0
- package/dist/components/SimpleTable/SimpleTable.module.scss.cjs.map +1 -0
- package/dist/components/SimpleTable/SimpleTable.module.scss.js +7 -0
- package/dist/components/SimpleTable/SimpleTable.module.scss.js.map +1 -0
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/TextField/TextField.d.ts +10 -10
- package/dist/components/TextField/index.d.ts +10 -10
- package/dist/components/ToastsLayout/ToastsLayout.cjs +6 -5
- package/dist/components/ToastsLayout/ToastsLayout.cjs.map +1 -1
- package/dist/components/ToastsLayout/ToastsLayout.js +7 -6
- package/dist/components/ToastsLayout/ToastsLayout.js.map +1 -1
- package/dist/components/ToastsLayout/ToastsLayout.module.scss.cjs +9 -0
- package/dist/components/ToastsLayout/ToastsLayout.module.scss.cjs.map +1 -0
- package/dist/components/ToastsLayout/ToastsLayout.module.scss.js +7 -0
- package/dist/components/ToastsLayout/ToastsLayout.module.scss.js.map +1 -0
- package/dist/components/ToastsLayout/components/Toast.cjs +18 -7
- package/dist/components/ToastsLayout/components/Toast.cjs.map +1 -1
- package/dist/components/ToastsLayout/components/Toast.d.ts +7 -2
- package/dist/components/ToastsLayout/components/Toast.js +18 -7
- package/dist/components/ToastsLayout/components/Toast.js.map +1 -1
- package/dist/components/ToastsLayout/components/ToastTransitionItem.cjs +18 -0
- package/dist/components/ToastsLayout/components/ToastTransitionItem.cjs.map +1 -0
- package/dist/components/ToastsLayout/components/ToastTransitionItem.d.ts +12 -0
- package/dist/components/ToastsLayout/components/ToastTransitionItem.js +12 -0
- package/dist/components/ToastsLayout/components/ToastTransitionItem.js.map +1 -0
- package/dist/components/ToggleButton/ToggleButton.cjs +2 -2
- package/dist/components/ToggleButton/ToggleButton.cjs.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.d.ts +2 -8
- package/dist/components/ToggleButton/ToggleButton.js +2 -2
- package/dist/components/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/components/ToggleButton/types.d.ts +8 -0
- package/dist/components/UploadFile/UploadFile.cjs +7 -2
- package/dist/components/UploadFile/UploadFile.cjs.map +1 -1
- package/dist/components/UploadFile/UploadFile.js +7 -2
- package/dist/components/UploadFile/UploadFile.js.map +1 -1
- package/dist/components/UploadFile/UploadFile.module.scss.cjs +9 -0
- package/dist/components/UploadFile/UploadFile.module.scss.cjs.map +1 -0
- package/dist/components/UploadFile/UploadFile.module.scss.js +7 -0
- package/dist/components/UploadFile/UploadFile.module.scss.js.map +1 -0
- package/dist/components/View/View.cjs +37 -9
- package/dist/components/View/View.cjs.map +1 -1
- package/dist/components/View/View.js +35 -7
- package/dist/components/View/View.js.map +1 -1
- package/dist/components/View/View.module.scss.cjs +9 -0
- package/dist/components/View/View.module.scss.cjs.map +1 -0
- package/dist/components/View/View.module.scss.js +7 -0
- package/dist/components/View/View.module.scss.js.map +1 -0
- package/dist/components/ViewTab/ViewTab.d.ts +1 -1
- package/dist/components/WeightInput/WeightInput.cjs +0 -1
- package/dist/components/WeightInput/WeightInput.cjs.map +1 -1
- package/dist/components/WeightInput/WeightInput.js +0 -1
- package/dist/components/WeightInput/WeightInput.js.map +1 -1
- package/dist/utils/forms/inputStyles.cjs +1 -2
- package/dist/utils/forms/inputStyles.cjs.map +1 -1
- package/dist/utils/forms/inputStyles.js +2 -2
- package/dist/utils/forms/inputStyles.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/Accordion/styled.cjs +0 -49
- package/dist/components/Accordion/styled.cjs.map +0 -1
- package/dist/components/Accordion/styled.d.ts +0 -26
- package/dist/components/Accordion/styled.js +0 -34
- package/dist/components/Accordion/styled.js.map +0 -1
- package/dist/components/Card/styled.cjs +0 -50
- package/dist/components/Card/styled.cjs.map +0 -1
- package/dist/components/Card/styled.d.ts +0 -16
- package/dist/components/Card/styled.js +0 -40
- package/dist/components/Card/styled.js.map +0 -1
- package/dist/components/CardHeader/styled.cjs +0 -15
- package/dist/components/CardHeader/styled.cjs.map +0 -1
- package/dist/components/CardHeader/styled.d.ts +0 -2
- package/dist/components/CardHeader/styled.js +0 -8
- package/dist/components/CardHeader/styled.js.map +0 -1
- package/dist/components/Checkbox/styled.cjs +0 -14
- package/dist/components/Checkbox/styled.cjs.map +0 -1
- package/dist/components/Checkbox/styled.d.ts +0 -1
- package/dist/components/Checkbox/styled.js +0 -8
- package/dist/components/Checkbox/styled.js.map +0 -1
- package/dist/components/Choice/components/styled.cjs +0 -30
- package/dist/components/Choice/components/styled.cjs.map +0 -1
- package/dist/components/Choice/components/styled.d.ts +0 -14
- package/dist/components/Choice/components/styled.js +0 -18
- package/dist/components/Choice/components/styled.js.map +0 -1
- package/dist/components/ChoiceList/styled.cjs +0 -15
- package/dist/components/ChoiceList/styled.cjs.map +0 -1
- package/dist/components/ChoiceList/styled.d.ts +0 -2
- package/dist/components/ChoiceList/styled.js +0 -8
- package/dist/components/ChoiceList/styled.js.map +0 -1
- package/dist/components/Dropdown/styled.d.ts +0 -11
- package/dist/components/Radio/styled.cjs +0 -12
- package/dist/components/Radio/styled.cjs.map +0 -1
- package/dist/components/Radio/styled.d.ts +0 -1
- package/dist/components/Radio/styled.js +0 -6
- package/dist/components/Radio/styled.js.map +0 -1
- package/dist/components/SimpleTable/styled.cjs +0 -34
- package/dist/components/SimpleTable/styled.cjs.map +0 -1
- package/dist/components/SimpleTable/styled.d.ts +0 -15
- package/dist/components/SimpleTable/styled.js +0 -23
- package/dist/components/SimpleTable/styled.js.map +0 -1
- package/dist/components/ToastsLayout/components/styled.cjs +0 -58
- package/dist/components/ToastsLayout/components/styled.cjs.map +0 -1
- package/dist/components/ToastsLayout/components/styled.d.ts +0 -36
- package/dist/components/ToastsLayout/components/styled.js +0 -48
- package/dist/components/ToastsLayout/components/styled.js.map +0 -1
- package/dist/components/ToggleButton/styled.cjs +0 -49
- package/dist/components/ToggleButton/styled.cjs.map +0 -1
- package/dist/components/ToggleButton/styled.d.ts +0 -1
- package/dist/components/ToggleButton/styled.js +0 -43
- package/dist/components/ToggleButton/styled.js.map +0 -1
- package/dist/components/UploadFile/styled.cjs +0 -54
- package/dist/components/UploadFile/styled.cjs.map +0 -1
- package/dist/components/UploadFile/styled.d.ts +0 -4
- package/dist/components/UploadFile/styled.js +0 -48
- package/dist/components/UploadFile/styled.js.map +0 -1
- package/dist/components/View/styled.cjs +0 -53
- package/dist/components/View/styled.cjs.map +0 -1
- package/dist/components/View/styled.d.ts +0 -37
- package/dist/components/View/styled.js +0 -41
- package/dist/components/View/styled.js.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._wrapper_jvoun_1 {\n box-sizing: border-box;\n}\n._wrapper_jvoun_1:hover {\n cursor: pointer;\n}\n._wrapper_jvoun_1._disabled_jvoun_7:hover {\n cursor: default;\n}\n\n._bordered_jvoun_11 {\n border: 2px solid var(--colors-neutral-grey-dark);\n border-radius: var(--radius-md);\n padding: var(--sizes-base) var(--sizes-3);\n}\n._bordered_jvoun_11:not(._disabled_jvoun_7):hover {\n border-color: var(--colors-secondary-blue-base);\n}\n\n._root-layout_jvoun_20 {\n display: flex;\n align-items: center;\n}\n._root-layout_jvoun_20 > * + * {\n margin-left: var(--sizes-base);\n}\n\n._input-layout_jvoun_28 {\n align-self: stretch;\n display: flex;\n}\n._input-layout_jvoun_28._align-top_jvoun_32 {\n align-items: flex-start;\n}\n._input-layout_jvoun_28._align-center_jvoun_35 {\n align-items: center;\n}\n\n._accessory-layout_jvoun_39 {\n align-self: center;\n display: flex;\n align-items: center;\n}\n\n._text-layout_jvoun_45 {\n flex: 1;\n}\n._text-layout_jvoun_45 > * + * {\n margin-top: var(--sizes-sm);\n}");
|
|
4
|
+
var styles = {"wrapper":"_wrapper_jvoun_1","disabled":"_disabled_jvoun_7","bordered":"_bordered_jvoun_11","root-layout":"_root-layout_jvoun_20","input-layout":"_input-layout_jvoun_28","align-top":"_align-top_jvoun_32","align-center":"_align-center_jvoun_35","accessory-layout":"_accessory-layout_jvoun_39","text-layout":"_text-layout_jvoun_45"};
|
|
5
|
+
|
|
6
|
+
export { styles as default };
|
|
7
|
+
//# sourceMappingURL=Choice.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Choice.module.scss.js","sources":["../../../src/components/Choice/Choice.module.scss"],"sourcesContent":[".wrapper {\n box-sizing: border-box;\n\n &:hover {\n cursor: pointer;\n }\n\n &.disabled:hover {\n cursor: default;\n }\n}\n\n.bordered {\n border: 2px solid var(--colors-neutral-grey-dark);\n border-radius: var(--radius-md);\n padding: var(--sizes-base) var(--sizes-3);\n\n &:not(.disabled):hover {\n border-color: var(--colors-secondary-blue-base);\n }\n}\n\n.root-layout {\n display: flex;\n align-items: center;\n\n & > * + * {\n margin-left: var(--sizes-base);\n }\n}\n\n.input-layout {\n align-self: stretch;\n display: flex;\n\n &.align-top {\n align-items: flex-start;\n }\n\n &.align-center {\n align-items: center;\n }\n}\n\n.accessory-layout {\n align-self: center;\n display: flex;\n align-items: center;\n}\n\n.text-layout {\n flex: 1;\n\n & > * + * {\n margin-top: var(--sizes-sm);\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,ogCAAA;;;;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var Radio = require('../Radio/Radio.cjs');
|
|
5
5
|
var Checkbox = require('../Checkbox/Checkbox.cjs');
|
|
6
|
-
var
|
|
6
|
+
var ChoiceList_module = require('./ChoiceList.module.scss.cjs');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
9
9
|
|
|
@@ -41,8 +41,8 @@ class ChoiceList extends React.Component {
|
|
|
41
41
|
render() {
|
|
42
42
|
const { allowMultiple, options, selected, title, disabled, bordered, accessorySlot } = this.props;
|
|
43
43
|
const InputComponent = allowMultiple ? Checkbox.Checkbox : Radio.Radio;
|
|
44
|
-
return (React__default.default.createElement(
|
|
45
|
-
title && React__default.default.createElement(
|
|
44
|
+
return (React__default.default.createElement("fieldset", { className: ChoiceList_module.fieldset, disabled: disabled },
|
|
45
|
+
title && React__default.default.createElement("legend", { className: ChoiceList_module.legend }, title),
|
|
46
46
|
accessorySlot,
|
|
47
47
|
options.map((option) => (React__default.default.createElement(InputComponent, { key: option.value, bordered: bordered, checked: selected.includes(option.value), onChange: (checked) => this.handleChange(option.value, checked), ...option })))));
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceList.cjs","sources":["../../../src/components/ChoiceList/ChoiceList.tsx"],"sourcesContent":["import React, { Component, ReactNode } from 'react';\nimport { Radio } from '../Radio';\nimport { Checkbox } from '../Checkbox';\n\nimport
|
|
1
|
+
{"version":3,"file":"ChoiceList.cjs","sources":["../../../src/components/ChoiceList/ChoiceList.tsx"],"sourcesContent":["import React, { Component, ReactNode } from 'react';\nimport { Radio } from '../Radio';\nimport { Checkbox } from '../Checkbox';\n\nimport styles from './ChoiceList.module.scss';\n\n/* TODO: - Implement error prop */\n\ntype ChoiceListOptionValue = string | number;\n\nexport interface ChoiceListOption {\n id?: string;\n value: ChoiceListOptionValue;\n name?: string;\n label: string;\n hint?: string;\n disabled?: boolean;\n Badge?: ReactNode;\n Accessory?: ReactNode;\n Footer?: ReactNode;\n}\n\nexport interface ChoiceListProps {\n options: ChoiceListOption[];\n selected: ChoiceListOptionValue[];\n title?: string;\n accessorySlot?: ReactNode;\n allowMultiple?: boolean;\n disabled?: boolean;\n bordered?: boolean;\n error?: string;\n onChange: (selected: ChoiceListOptionValue[]) => void;\n}\n\nexport class ChoiceList extends Component<ChoiceListProps> {\n handleChange = (value: ChoiceListOptionValue, checked: boolean) => {\n const { allowMultiple } = this.props;\n\n if (allowMultiple) {\n this.handleChangeMultiple(value, checked);\n return;\n }\n\n this.handleChangeSingle(value, checked);\n };\n\n handleChangeSingle = (value: ChoiceListOptionValue, checked: boolean) => {\n const { onChange } = this.props;\n\n if (checked) {\n onChange([value]);\n }\n };\n\n handleChangeMultiple = (value: ChoiceListOptionValue, checked: boolean) => {\n const { selected, onChange } = this.props;\n let newSelected = [];\n\n if (checked) {\n newSelected = [...selected, value];\n } else {\n newSelected = selected.filter((selectedValue) => selectedValue !== value);\n }\n\n onChange(newSelected);\n };\n\n render() {\n const { allowMultiple, options, selected, title, disabled, bordered, accessorySlot } =\n this.props;\n\n const InputComponent = allowMultiple ? Checkbox : Radio;\n\n return (\n <fieldset className={styles.fieldset} disabled={disabled}>\n {title && <legend className={styles.legend}>{title}</legend>}\n {accessorySlot}\n {options.map((option) => (\n <InputComponent\n key={option.value}\n bordered={bordered}\n checked={selected.includes(option.value)}\n onChange={(checked: boolean) => this.handleChange(option.value, checked)}\n {...option}\n />\n ))}\n </fieldset>\n );\n }\n}\n"],"names":["Component","Checkbox","Radio","React","styles"],"mappings":";;;;;;;;;;;AAkCM,MAAO,UAAW,SAAQA,eAA0B,CAAA;AAA1D,IAAA,WAAA,GAAA;;AACE,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,KAA4B,EAAE,OAAgB,KAAI;AAChE,YAAA,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,KAAK;AAEpC,YAAA,IAAI,aAAa,EAAE;AACjB,gBAAA,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC;gBACzC;AACD,YAAA;AAED,YAAA,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC;AACzC,QAAA,CAAC;AAED,QAAA,IAAA,CAAA,kBAAkB,GAAG,CAAC,KAA4B,EAAE,OAAgB,KAAI;AACtE,YAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK;AAE/B,YAAA,IAAI,OAAO,EAAE;AACX,gBAAA,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;AAClB,YAAA;AACH,QAAA,CAAC;AAED,QAAA,IAAA,CAAA,oBAAoB,GAAG,CAAC,KAA4B,EAAE,OAAgB,KAAI;YACxE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK;YACzC,IAAI,WAAW,GAAG,EAAE;AAEpB,YAAA,IAAI,OAAO,EAAE;AACX,gBAAA,WAAW,GAAG,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC;AACnC,YAAA;AAAM,iBAAA;AACL,gBAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,aAAa,KAAK,aAAa,KAAK,KAAK,CAAC;AAC1E,YAAA;YAED,QAAQ,CAAC,WAAW,CAAC;AACvB,QAAA,CAAC;IAwBH;IAtBE,MAAM,GAAA;AACJ,QAAA,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,GAClF,IAAI,CAAC,KAAK;QAEZ,MAAM,cAAc,GAAG,aAAa,GAAGC,iBAAQ,GAAGC,WAAK;QAEvD,QACEC,sBAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAU,SAAS,EAAEC,iBAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAA;YACrD,KAAK,IAAID,iDAAQ,SAAS,EAAEC,iBAAM,CAAC,MAAM,EAAA,EAAG,KAAK,CAAU;YAC3D,aAAa;YACb,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MAClBD,sBAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EACb,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EACxC,QAAQ,EAAE,CAAC,OAAgB,KAAK,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,EAAA,GACpE,MAAM,EAAA,CACV,CACH,CAAC,CACO;IAEf;AACD;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { Component } from 'react';
|
|
2
2
|
import { Radio } from '../Radio/Radio.js';
|
|
3
3
|
import { Checkbox } from '../Checkbox/Checkbox.js';
|
|
4
|
-
import
|
|
4
|
+
import styles from './ChoiceList.module.scss.js';
|
|
5
5
|
|
|
6
6
|
class ChoiceList extends Component {
|
|
7
7
|
constructor() {
|
|
@@ -35,8 +35,8 @@ class ChoiceList extends Component {
|
|
|
35
35
|
render() {
|
|
36
36
|
const { allowMultiple, options, selected, title, disabled, bordered, accessorySlot } = this.props;
|
|
37
37
|
const InputComponent = allowMultiple ? Checkbox : Radio;
|
|
38
|
-
return (React__default.createElement(
|
|
39
|
-
title && React__default.createElement(
|
|
38
|
+
return (React__default.createElement("fieldset", { className: styles.fieldset, disabled: disabled },
|
|
39
|
+
title && React__default.createElement("legend", { className: styles.legend }, title),
|
|
40
40
|
accessorySlot,
|
|
41
41
|
options.map((option) => (React__default.createElement(InputComponent, { key: option.value, bordered: bordered, checked: selected.includes(option.value), onChange: (checked) => this.handleChange(option.value, checked), ...option })))));
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceList.js","sources":["../../../src/components/ChoiceList/ChoiceList.tsx"],"sourcesContent":["import React, { Component, ReactNode } from 'react';\nimport { Radio } from '../Radio';\nimport { Checkbox } from '../Checkbox';\n\nimport
|
|
1
|
+
{"version":3,"file":"ChoiceList.js","sources":["../../../src/components/ChoiceList/ChoiceList.tsx"],"sourcesContent":["import React, { Component, ReactNode } from 'react';\nimport { Radio } from '../Radio';\nimport { Checkbox } from '../Checkbox';\n\nimport styles from './ChoiceList.module.scss';\n\n/* TODO: - Implement error prop */\n\ntype ChoiceListOptionValue = string | number;\n\nexport interface ChoiceListOption {\n id?: string;\n value: ChoiceListOptionValue;\n name?: string;\n label: string;\n hint?: string;\n disabled?: boolean;\n Badge?: ReactNode;\n Accessory?: ReactNode;\n Footer?: ReactNode;\n}\n\nexport interface ChoiceListProps {\n options: ChoiceListOption[];\n selected: ChoiceListOptionValue[];\n title?: string;\n accessorySlot?: ReactNode;\n allowMultiple?: boolean;\n disabled?: boolean;\n bordered?: boolean;\n error?: string;\n onChange: (selected: ChoiceListOptionValue[]) => void;\n}\n\nexport class ChoiceList extends Component<ChoiceListProps> {\n handleChange = (value: ChoiceListOptionValue, checked: boolean) => {\n const { allowMultiple } = this.props;\n\n if (allowMultiple) {\n this.handleChangeMultiple(value, checked);\n return;\n }\n\n this.handleChangeSingle(value, checked);\n };\n\n handleChangeSingle = (value: ChoiceListOptionValue, checked: boolean) => {\n const { onChange } = this.props;\n\n if (checked) {\n onChange([value]);\n }\n };\n\n handleChangeMultiple = (value: ChoiceListOptionValue, checked: boolean) => {\n const { selected, onChange } = this.props;\n let newSelected = [];\n\n if (checked) {\n newSelected = [...selected, value];\n } else {\n newSelected = selected.filter((selectedValue) => selectedValue !== value);\n }\n\n onChange(newSelected);\n };\n\n render() {\n const { allowMultiple, options, selected, title, disabled, bordered, accessorySlot } =\n this.props;\n\n const InputComponent = allowMultiple ? Checkbox : Radio;\n\n return (\n <fieldset className={styles.fieldset} disabled={disabled}>\n {title && <legend className={styles.legend}>{title}</legend>}\n {accessorySlot}\n {options.map((option) => (\n <InputComponent\n key={option.value}\n bordered={bordered}\n checked={selected.includes(option.value)}\n onChange={(checked: boolean) => this.handleChange(option.value, checked)}\n {...option}\n />\n ))}\n </fieldset>\n );\n }\n}\n"],"names":["React"],"mappings":";;;;;AAkCM,MAAO,UAAW,SAAQ,SAA0B,CAAA;AAA1D,IAAA,WAAA,GAAA;;AACE,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,KAA4B,EAAE,OAAgB,KAAI;AAChE,YAAA,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,KAAK;AAEpC,YAAA,IAAI,aAAa,EAAE;AACjB,gBAAA,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC;gBACzC;AACD,YAAA;AAED,YAAA,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC;AACzC,QAAA,CAAC;AAED,QAAA,IAAA,CAAA,kBAAkB,GAAG,CAAC,KAA4B,EAAE,OAAgB,KAAI;AACtE,YAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK;AAE/B,YAAA,IAAI,OAAO,EAAE;AACX,gBAAA,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;AAClB,YAAA;AACH,QAAA,CAAC;AAED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AACD;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
|
+
|
|
5
|
+
___$insertStyle("._heading-xxl_1vf1j_1 {\n font-family: var(--text-heading-xxl-font-family);\n font-style: var(--text-heading-xxl-font-style);\n font-weight: var(--text-heading-xxl-font-weight);\n font-size: var(--text-heading-xxl-font-size);\n line-height: var(--text-heading-xxl-line-height);\n color: var(--text-heading-xxl-color);\n text-decoration: var(--text-heading-xxl-text-decoration);\n letter-spacing: var(--text-heading-xxl-letter-spacing);\n}\n\n._heading-xl_1vf1j_12 {\n font-family: var(--text-heading-xl-font-family);\n font-style: var(--text-heading-xl-font-style);\n font-weight: var(--text-heading-xl-font-weight);\n font-size: var(--text-heading-xl-font-size);\n line-height: var(--text-heading-xl-line-height);\n color: var(--text-heading-xl-color);\n text-decoration: var(--text-heading-xl-text-decoration);\n letter-spacing: var(--text-heading-xl-letter-spacing);\n}\n\n._heading-large_1vf1j_23 {\n font-family: var(--text-heading-large-font-family);\n font-style: var(--text-heading-large-font-style);\n font-weight: var(--text-heading-large-font-weight);\n font-size: var(--text-heading-large-font-size);\n line-height: var(--text-heading-large-line-height);\n color: var(--text-heading-large-color);\n text-decoration: var(--text-heading-large-text-decoration);\n letter-spacing: var(--text-heading-large-letter-spacing);\n}\n\n._heading-medium_1vf1j_34 {\n font-family: var(--text-heading-medium-font-family);\n font-style: var(--text-heading-medium-font-style);\n font-weight: var(--text-heading-medium-font-weight);\n font-size: var(--text-heading-medium-font-size);\n line-height: var(--text-heading-medium-line-height);\n color: var(--text-heading-medium-color);\n text-decoration: var(--text-heading-medium-text-decoration);\n letter-spacing: var(--text-heading-medium-letter-spacing);\n}\n\n._heading-small_1vf1j_45 {\n font-family: var(--text-heading-small-font-family);\n font-style: var(--text-heading-small-font-style);\n font-weight: var(--text-heading-small-font-weight);\n font-size: var(--text-heading-small-font-size);\n line-height: var(--text-heading-small-line-height);\n color: var(--text-heading-small-color);\n text-decoration: var(--text-heading-small-text-decoration);\n letter-spacing: var(--text-heading-small-letter-spacing);\n}\n\n._heading-table_1vf1j_56 {\n font-family: var(--text-heading-table-font-family);\n font-style: var(--text-heading-table-font-style);\n font-weight: var(--text-heading-table-font-weight);\n font-size: var(--text-heading-table-font-size);\n line-height: var(--text-heading-table-line-height);\n color: var(--text-heading-table-color);\n text-decoration: var(--text-heading-table-text-decoration);\n letter-spacing: var(--text-heading-table-letter-spacing);\n}\n\n._subheading-large_1vf1j_67 {\n font-family: var(--text-subheading-large-font-family);\n font-style: var(--text-subheading-large-font-style);\n font-weight: var(--text-subheading-large-font-weight);\n font-size: var(--text-subheading-large-font-size);\n line-height: var(--text-subheading-large-line-height);\n color: var(--text-subheading-large-color);\n text-decoration: var(--text-subheading-large-text-decoration);\n letter-spacing: var(--text-subheading-large-letter-spacing);\n}\n\n._subheading-medium_1vf1j_78 {\n font-family: var(--text-subheading-medium-font-family);\n font-style: var(--text-subheading-medium-font-style);\n font-weight: var(--text-subheading-medium-font-weight);\n font-size: var(--text-subheading-medium-font-size);\n line-height: var(--text-subheading-medium-line-height);\n color: var(--text-subheading-medium-color);\n text-decoration: var(--text-subheading-medium-text-decoration);\n letter-spacing: var(--text-subheading-medium-letter-spacing);\n}\n\n._subheading-small_1vf1j_89 {\n font-family: var(--text-subheading-small-font-family);\n font-style: var(--text-subheading-small-font-style);\n font-weight: var(--text-subheading-small-font-weight);\n font-size: var(--text-subheading-small-font-size);\n line-height: var(--text-subheading-small-line-height);\n color: var(--text-subheading-small-color);\n text-decoration: var(--text-subheading-small-text-decoration);\n letter-spacing: var(--text-subheading-small-letter-spacing);\n}\n\n._subheading-small-bold_1vf1j_100 {\n font-family: var(--text-subheading-small-bold-font-family);\n font-style: var(--text-subheading-small-bold-font-style);\n font-weight: var(--text-subheading-small-bold-font-weight);\n font-size: var(--text-subheading-small-bold-font-size);\n line-height: var(--text-subheading-small-bold-line-height);\n color: var(--text-subheading-small-bold-color);\n text-decoration: var(--text-subheading-small-bold-text-decoration);\n letter-spacing: var(--text-subheading-small-bold-letter-spacing);\n}\n\n._body_1vf1j_111 {\n font-family: var(--text-body-font-family);\n font-style: var(--text-body-font-style);\n font-weight: var(--text-body-font-weight);\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n text-decoration: var(--text-body-text-decoration);\n letter-spacing: var(--text-body-letter-spacing);\n}\n\n._body-small_1vf1j_122 {\n font-family: var(--text-body-small-font-family);\n font-style: var(--text-body-small-font-style);\n font-weight: var(--text-body-small-font-weight);\n font-size: var(--text-body-small-font-size);\n line-height: var(--text-body-small-line-height);\n color: var(--text-body-small-color);\n text-decoration: var(--text-body-small-text-decoration);\n letter-spacing: var(--text-body-small-letter-spacing);\n}\n\n._body-bold_1vf1j_133 {\n font-family: var(--text-body-bold-font-family);\n font-style: var(--text-body-bold-font-style);\n font-weight: var(--text-body-bold-font-weight);\n font-size: var(--text-body-bold-font-size);\n line-height: var(--text-body-bold-line-height);\n color: var(--text-body-bold-color);\n text-decoration: var(--text-body-bold-text-decoration);\n letter-spacing: var(--text-body-bold-letter-spacing);\n}\n\n._body-bold-dark_1vf1j_144 {\n font-family: var(--text-body-bold-dark-font-family);\n font-style: var(--text-body-bold-dark-font-style);\n font-weight: var(--text-body-bold-dark-font-weight);\n font-size: var(--text-body-bold-dark-font-size);\n line-height: var(--text-body-bold-dark-line-height);\n color: var(--text-body-bold-dark-color);\n text-decoration: var(--text-body-bold-dark-text-decoration);\n letter-spacing: var(--text-body-bold-dark-letter-spacing);\n}\n\n._body-small-bold_1vf1j_155 {\n font-family: var(--text-body-small-bold-font-family);\n font-style: var(--text-body-small-bold-font-style);\n font-weight: var(--text-body-small-bold-font-weight);\n font-size: var(--text-body-small-bold-font-size);\n line-height: var(--text-body-small-bold-line-height);\n color: var(--text-body-small-bold-color);\n text-decoration: var(--text-body-small-bold-text-decoration);\n letter-spacing: var(--text-body-small-bold-letter-spacing);\n}\n\n._button_1vf1j_166 {\n font-family: var(--text-button-font-family);\n font-style: var(--text-button-font-style);\n font-weight: var(--text-button-font-weight);\n font-size: var(--text-button-font-size);\n line-height: var(--text-button-line-height);\n color: var(--text-button-color);\n text-decoration: var(--text-button-text-decoration);\n letter-spacing: var(--text-button-letter-spacing);\n}\n\n._button-small_1vf1j_177 {\n font-family: var(--text-button-small-font-family);\n font-style: var(--text-button-small-font-style);\n font-weight: var(--text-button-small-font-weight);\n font-size: var(--text-button-small-font-size);\n line-height: var(--text-button-small-line-height);\n color: var(--text-button-small-color);\n text-decoration: var(--text-button-small-text-decoration);\n letter-spacing: var(--text-button-small-letter-spacing);\n}\n\n._link-large_1vf1j_188 {\n font-family: var(--text-link-large-font-family);\n font-style: var(--text-link-large-font-style);\n font-weight: var(--text-link-large-font-weight);\n font-size: var(--text-link-large-font-size);\n line-height: var(--text-link-large-line-height);\n color: var(--text-link-large-color);\n text-decoration: var(--text-link-large-text-decoration);\n letter-spacing: var(--text-link-large-letter-spacing);\n}\n\n._link-medium_1vf1j_199 {\n font-family: var(--text-link-medium-font-family);\n font-style: var(--text-link-medium-font-style);\n font-weight: var(--text-link-medium-font-weight);\n font-size: var(--text-link-medium-font-size);\n line-height: var(--text-link-medium-line-height);\n color: var(--text-link-medium-color);\n text-decoration: var(--text-link-medium-text-decoration);\n letter-spacing: var(--text-link-medium-letter-spacing);\n}\n\n._link_1vf1j_188 {\n font-family: var(--text-link-font-family);\n font-style: var(--text-link-font-style);\n font-weight: var(--text-link-font-weight);\n font-size: var(--text-link-font-size);\n line-height: var(--text-link-line-height);\n color: var(--text-link-color);\n text-decoration: var(--text-link-text-decoration);\n letter-spacing: var(--text-link-letter-spacing);\n}\n\n._link-small_1vf1j_221 {\n font-family: var(--text-link-small-font-family);\n font-style: var(--text-link-small-font-style);\n font-weight: var(--text-link-small-font-weight);\n font-size: var(--text-link-small-font-size);\n line-height: var(--text-link-small-line-height);\n color: var(--text-link-small-color);\n text-decoration: var(--text-link-small-text-decoration);\n letter-spacing: var(--text-link-small-letter-spacing);\n}\n\n._input-label_1vf1j_232 {\n font-family: var(--text-input-label-font-family);\n font-style: var(--text-input-label-font-style);\n font-weight: var(--text-input-label-font-weight);\n font-size: var(--text-input-label-font-size);\n line-height: var(--text-input-label-line-height);\n color: var(--text-input-label-color);\n text-decoration: var(--text-input-label-text-decoration);\n letter-spacing: var(--text-input-label-letter-spacing);\n}\n\n._input-label-small_1vf1j_243 {\n font-family: var(--text-input-label-small-font-family);\n font-style: var(--text-input-label-small-font-style);\n font-weight: var(--text-input-label-small-font-weight);\n font-size: var(--text-input-label-small-font-size);\n line-height: var(--text-input-label-small-line-height);\n color: var(--text-input-label-small-color);\n text-decoration: var(--text-input-label-small-text-decoration);\n letter-spacing: var(--text-input-label-small-letter-spacing);\n}\n\n._hint-text_1vf1j_254 {\n font-family: var(--text-hint-text-font-family);\n font-style: var(--text-hint-text-font-style);\n font-weight: var(--text-hint-text-font-weight);\n font-size: var(--text-hint-text-font-size);\n line-height: var(--text-hint-text-line-height);\n color: var(--text-hint-text-color);\n text-decoration: var(--text-hint-text-text-decoration);\n letter-spacing: var(--text-hint-text-letter-spacing);\n}\n\n._placeholder_1vf1j_265 {\n font-family: var(--text-placeholder-font-family);\n font-style: var(--text-placeholder-font-style);\n font-weight: var(--text-placeholder-font-weight);\n font-size: var(--text-placeholder-font-size);\n line-height: var(--text-placeholder-line-height);\n color: var(--text-placeholder-color);\n text-decoration: var(--text-placeholder-text-decoration);\n letter-spacing: var(--text-placeholder-letter-spacing);\n}\n\n._placeholder-small_1vf1j_276 {\n font-family: var(--text-placeholder-small-font-family);\n font-style: var(--text-placeholder-small-font-style);\n font-weight: var(--text-placeholder-small-font-weight);\n font-size: var(--text-placeholder-small-font-size);\n line-height: var(--text-placeholder-small-line-height);\n color: var(--text-placeholder-small-color);\n text-decoration: var(--text-placeholder-small-text-decoration);\n letter-spacing: var(--text-placeholder-small-letter-spacing);\n}\n\n._placeholder-code_1vf1j_287 {\n font-family: var(--text-placeholder-code-font-family);\n font-style: var(--text-placeholder-code-font-style);\n font-weight: var(--text-placeholder-code-font-weight);\n font-size: var(--text-placeholder-code-font-size);\n line-height: var(--text-placeholder-code-line-height);\n color: var(--text-placeholder-code-color);\n text-decoration: var(--text-placeholder-code-text-decoration);\n letter-spacing: var(--text-placeholder-code-letter-spacing);\n}\n\n._placeholder-code-small_1vf1j_298 {\n font-family: var(--text-placeholder-code-small-font-family);\n font-style: var(--text-placeholder-code-small-font-style);\n font-weight: var(--text-placeholder-code-small-font-weight);\n font-size: var(--text-placeholder-code-small-font-size);\n line-height: var(--text-placeholder-code-small-line-height);\n color: var(--text-placeholder-code-small-color);\n text-decoration: var(--text-placeholder-code-small-text-decoration);\n letter-spacing: var(--text-placeholder-code-small-letter-spacing);\n}\n\n._error_1vf1j_309 {\n font-family: var(--text-error-font-family);\n font-style: var(--text-error-font-style);\n font-weight: var(--text-error-font-weight);\n font-size: var(--text-error-font-size);\n line-height: var(--text-error-line-height);\n color: var(--text-error-color);\n text-decoration: var(--text-error-text-decoration);\n letter-spacing: var(--text-error-letter-spacing);\n}\n\n._error-small_1vf1j_320 {\n font-family: var(--text-error-small-font-family);\n font-style: var(--text-error-small-font-style);\n font-weight: var(--text-error-small-font-weight);\n font-size: var(--text-error-small-font-size);\n line-height: var(--text-error-small-line-height);\n color: var(--text-error-small-color);\n text-decoration: var(--text-error-small-text-decoration);\n letter-spacing: var(--text-error-small-letter-spacing);\n}\n\n._success-small_1vf1j_331 {\n font-family: var(--text-success-small-font-family);\n font-style: var(--text-success-small-font-style);\n font-weight: var(--text-success-small-font-weight);\n font-size: var(--text-success-small-font-size);\n line-height: var(--text-success-small-line-height);\n color: var(--text-success-small-color);\n text-decoration: var(--text-success-small-text-decoration);\n letter-spacing: var(--text-success-small-letter-spacing);\n}\n\n._fieldset_1vf1j_342 {\n padding: 0;\n display: flex;\n flex-direction: column;\n border: 0;\n}\n._fieldset_1vf1j_342 > * + * {\n margin-top: var(--sizes-base);\n}\n\n._legend_1vf1j_352 {\n font-family: var(--text-input-label-font-family);\n font-style: var(--text-input-label-font-style);\n font-weight: var(--text-input-label-font-weight);\n font-size: var(--text-input-label-font-size);\n line-height: var(--text-input-label-line-height);\n color: var(--text-input-label-color);\n text-decoration: var(--text-input-label-text-decoration);\n letter-spacing: var(--text-input-label-letter-spacing);\n}");
|
|
6
|
+
var styles = {"fieldset":"_fieldset_1vf1j_342","legend":"_legend_1vf1j_352"};
|
|
7
|
+
|
|
8
|
+
module.exports = styles;
|
|
9
|
+
//# sourceMappingURL=ChoiceList.module.scss.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChoiceList.module.scss.cjs","sources":["../../../src/components/ChoiceList/ChoiceList.module.scss"],"sourcesContent":["@use '../../theme/scss/text.module.scss' as text;\n\n.fieldset {\n padding: 0;\n display: flex;\n flex-direction: column;\n border: 0;\n\n & > * + * {\n margin-top: var(--sizes-base);\n }\n}\n\n.legend {\n @include text.input-label;\n}\n"],"names":[],"mappings":";;;;AAGE,eAAA,CAAA,modAAA;AACA,aAAA,CAAA,UAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,mBAAA;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
|
+
|
|
3
|
+
insertStyle("._heading-xxl_1vf1j_1 {\n font-family: var(--text-heading-xxl-font-family);\n font-style: var(--text-heading-xxl-font-style);\n font-weight: var(--text-heading-xxl-font-weight);\n font-size: var(--text-heading-xxl-font-size);\n line-height: var(--text-heading-xxl-line-height);\n color: var(--text-heading-xxl-color);\n text-decoration: var(--text-heading-xxl-text-decoration);\n letter-spacing: var(--text-heading-xxl-letter-spacing);\n}\n\n._heading-xl_1vf1j_12 {\n font-family: var(--text-heading-xl-font-family);\n font-style: var(--text-heading-xl-font-style);\n font-weight: var(--text-heading-xl-font-weight);\n font-size: var(--text-heading-xl-font-size);\n line-height: var(--text-heading-xl-line-height);\n color: var(--text-heading-xl-color);\n text-decoration: var(--text-heading-xl-text-decoration);\n letter-spacing: var(--text-heading-xl-letter-spacing);\n}\n\n._heading-large_1vf1j_23 {\n font-family: var(--text-heading-large-font-family);\n font-style: var(--text-heading-large-font-style);\n font-weight: var(--text-heading-large-font-weight);\n font-size: var(--text-heading-large-font-size);\n line-height: var(--text-heading-large-line-height);\n color: var(--text-heading-large-color);\n text-decoration: var(--text-heading-large-text-decoration);\n letter-spacing: var(--text-heading-large-letter-spacing);\n}\n\n._heading-medium_1vf1j_34 {\n font-family: var(--text-heading-medium-font-family);\n font-style: var(--text-heading-medium-font-style);\n font-weight: var(--text-heading-medium-font-weight);\n font-size: var(--text-heading-medium-font-size);\n line-height: var(--text-heading-medium-line-height);\n color: var(--text-heading-medium-color);\n text-decoration: var(--text-heading-medium-text-decoration);\n letter-spacing: var(--text-heading-medium-letter-spacing);\n}\n\n._heading-small_1vf1j_45 {\n font-family: var(--text-heading-small-font-family);\n font-style: var(--text-heading-small-font-style);\n font-weight: var(--text-heading-small-font-weight);\n font-size: var(--text-heading-small-font-size);\n line-height: var(--text-heading-small-line-height);\n color: var(--text-heading-small-color);\n text-decoration: var(--text-heading-small-text-decoration);\n letter-spacing: var(--text-heading-small-letter-spacing);\n}\n\n._heading-table_1vf1j_56 {\n font-family: var(--text-heading-table-font-family);\n font-style: var(--text-heading-table-font-style);\n font-weight: var(--text-heading-table-font-weight);\n font-size: var(--text-heading-table-font-size);\n line-height: var(--text-heading-table-line-height);\n color: var(--text-heading-table-color);\n text-decoration: var(--text-heading-table-text-decoration);\n letter-spacing: var(--text-heading-table-letter-spacing);\n}\n\n._subheading-large_1vf1j_67 {\n font-family: var(--text-subheading-large-font-family);\n font-style: var(--text-subheading-large-font-style);\n font-weight: var(--text-subheading-large-font-weight);\n font-size: var(--text-subheading-large-font-size);\n line-height: var(--text-subheading-large-line-height);\n color: var(--text-subheading-large-color);\n text-decoration: var(--text-subheading-large-text-decoration);\n letter-spacing: var(--text-subheading-large-letter-spacing);\n}\n\n._subheading-medium_1vf1j_78 {\n font-family: var(--text-subheading-medium-font-family);\n font-style: var(--text-subheading-medium-font-style);\n font-weight: var(--text-subheading-medium-font-weight);\n font-size: var(--text-subheading-medium-font-size);\n line-height: var(--text-subheading-medium-line-height);\n color: var(--text-subheading-medium-color);\n text-decoration: var(--text-subheading-medium-text-decoration);\n letter-spacing: var(--text-subheading-medium-letter-spacing);\n}\n\n._subheading-small_1vf1j_89 {\n font-family: var(--text-subheading-small-font-family);\n font-style: var(--text-subheading-small-font-style);\n font-weight: var(--text-subheading-small-font-weight);\n font-size: var(--text-subheading-small-font-size);\n line-height: var(--text-subheading-small-line-height);\n color: var(--text-subheading-small-color);\n text-decoration: var(--text-subheading-small-text-decoration);\n letter-spacing: var(--text-subheading-small-letter-spacing);\n}\n\n._subheading-small-bold_1vf1j_100 {\n font-family: var(--text-subheading-small-bold-font-family);\n font-style: var(--text-subheading-small-bold-font-style);\n font-weight: var(--text-subheading-small-bold-font-weight);\n font-size: var(--text-subheading-small-bold-font-size);\n line-height: var(--text-subheading-small-bold-line-height);\n color: var(--text-subheading-small-bold-color);\n text-decoration: var(--text-subheading-small-bold-text-decoration);\n letter-spacing: var(--text-subheading-small-bold-letter-spacing);\n}\n\n._body_1vf1j_111 {\n font-family: var(--text-body-font-family);\n font-style: var(--text-body-font-style);\n font-weight: var(--text-body-font-weight);\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n text-decoration: var(--text-body-text-decoration);\n letter-spacing: var(--text-body-letter-spacing);\n}\n\n._body-small_1vf1j_122 {\n font-family: var(--text-body-small-font-family);\n font-style: var(--text-body-small-font-style);\n font-weight: var(--text-body-small-font-weight);\n font-size: var(--text-body-small-font-size);\n line-height: var(--text-body-small-line-height);\n color: var(--text-body-small-color);\n text-decoration: var(--text-body-small-text-decoration);\n letter-spacing: var(--text-body-small-letter-spacing);\n}\n\n._body-bold_1vf1j_133 {\n font-family: var(--text-body-bold-font-family);\n font-style: var(--text-body-bold-font-style);\n font-weight: var(--text-body-bold-font-weight);\n font-size: var(--text-body-bold-font-size);\n line-height: var(--text-body-bold-line-height);\n color: var(--text-body-bold-color);\n text-decoration: var(--text-body-bold-text-decoration);\n letter-spacing: var(--text-body-bold-letter-spacing);\n}\n\n._body-bold-dark_1vf1j_144 {\n font-family: var(--text-body-bold-dark-font-family);\n font-style: var(--text-body-bold-dark-font-style);\n font-weight: var(--text-body-bold-dark-font-weight);\n font-size: var(--text-body-bold-dark-font-size);\n line-height: var(--text-body-bold-dark-line-height);\n color: var(--text-body-bold-dark-color);\n text-decoration: var(--text-body-bold-dark-text-decoration);\n letter-spacing: var(--text-body-bold-dark-letter-spacing);\n}\n\n._body-small-bold_1vf1j_155 {\n font-family: var(--text-body-small-bold-font-family);\n font-style: var(--text-body-small-bold-font-style);\n font-weight: var(--text-body-small-bold-font-weight);\n font-size: var(--text-body-small-bold-font-size);\n line-height: var(--text-body-small-bold-line-height);\n color: var(--text-body-small-bold-color);\n text-decoration: var(--text-body-small-bold-text-decoration);\n letter-spacing: var(--text-body-small-bold-letter-spacing);\n}\n\n._button_1vf1j_166 {\n font-family: var(--text-button-font-family);\n font-style: var(--text-button-font-style);\n font-weight: var(--text-button-font-weight);\n font-size: var(--text-button-font-size);\n line-height: var(--text-button-line-height);\n color: var(--text-button-color);\n text-decoration: var(--text-button-text-decoration);\n letter-spacing: var(--text-button-letter-spacing);\n}\n\n._button-small_1vf1j_177 {\n font-family: var(--text-button-small-font-family);\n font-style: var(--text-button-small-font-style);\n font-weight: var(--text-button-small-font-weight);\n font-size: var(--text-button-small-font-size);\n line-height: var(--text-button-small-line-height);\n color: var(--text-button-small-color);\n text-decoration: var(--text-button-small-text-decoration);\n letter-spacing: var(--text-button-small-letter-spacing);\n}\n\n._link-large_1vf1j_188 {\n font-family: var(--text-link-large-font-family);\n font-style: var(--text-link-large-font-style);\n font-weight: var(--text-link-large-font-weight);\n font-size: var(--text-link-large-font-size);\n line-height: var(--text-link-large-line-height);\n color: var(--text-link-large-color);\n text-decoration: var(--text-link-large-text-decoration);\n letter-spacing: var(--text-link-large-letter-spacing);\n}\n\n._link-medium_1vf1j_199 {\n font-family: var(--text-link-medium-font-family);\n font-style: var(--text-link-medium-font-style);\n font-weight: var(--text-link-medium-font-weight);\n font-size: var(--text-link-medium-font-size);\n line-height: var(--text-link-medium-line-height);\n color: var(--text-link-medium-color);\n text-decoration: var(--text-link-medium-text-decoration);\n letter-spacing: var(--text-link-medium-letter-spacing);\n}\n\n._link_1vf1j_188 {\n font-family: var(--text-link-font-family);\n font-style: var(--text-link-font-style);\n font-weight: var(--text-link-font-weight);\n font-size: var(--text-link-font-size);\n line-height: var(--text-link-line-height);\n color: var(--text-link-color);\n text-decoration: var(--text-link-text-decoration);\n letter-spacing: var(--text-link-letter-spacing);\n}\n\n._link-small_1vf1j_221 {\n font-family: var(--text-link-small-font-family);\n font-style: var(--text-link-small-font-style);\n font-weight: var(--text-link-small-font-weight);\n font-size: var(--text-link-small-font-size);\n line-height: var(--text-link-small-line-height);\n color: var(--text-link-small-color);\n text-decoration: var(--text-link-small-text-decoration);\n letter-spacing: var(--text-link-small-letter-spacing);\n}\n\n._input-label_1vf1j_232 {\n font-family: var(--text-input-label-font-family);\n font-style: var(--text-input-label-font-style);\n font-weight: var(--text-input-label-font-weight);\n font-size: var(--text-input-label-font-size);\n line-height: var(--text-input-label-line-height);\n color: var(--text-input-label-color);\n text-decoration: var(--text-input-label-text-decoration);\n letter-spacing: var(--text-input-label-letter-spacing);\n}\n\n._input-label-small_1vf1j_243 {\n font-family: var(--text-input-label-small-font-family);\n font-style: var(--text-input-label-small-font-style);\n font-weight: var(--text-input-label-small-font-weight);\n font-size: var(--text-input-label-small-font-size);\n line-height: var(--text-input-label-small-line-height);\n color: var(--text-input-label-small-color);\n text-decoration: var(--text-input-label-small-text-decoration);\n letter-spacing: var(--text-input-label-small-letter-spacing);\n}\n\n._hint-text_1vf1j_254 {\n font-family: var(--text-hint-text-font-family);\n font-style: var(--text-hint-text-font-style);\n font-weight: var(--text-hint-text-font-weight);\n font-size: var(--text-hint-text-font-size);\n line-height: var(--text-hint-text-line-height);\n color: var(--text-hint-text-color);\n text-decoration: var(--text-hint-text-text-decoration);\n letter-spacing: var(--text-hint-text-letter-spacing);\n}\n\n._placeholder_1vf1j_265 {\n font-family: var(--text-placeholder-font-family);\n font-style: var(--text-placeholder-font-style);\n font-weight: var(--text-placeholder-font-weight);\n font-size: var(--text-placeholder-font-size);\n line-height: var(--text-placeholder-line-height);\n color: var(--text-placeholder-color);\n text-decoration: var(--text-placeholder-text-decoration);\n letter-spacing: var(--text-placeholder-letter-spacing);\n}\n\n._placeholder-small_1vf1j_276 {\n font-family: var(--text-placeholder-small-font-family);\n font-style: var(--text-placeholder-small-font-style);\n font-weight: var(--text-placeholder-small-font-weight);\n font-size: var(--text-placeholder-small-font-size);\n line-height: var(--text-placeholder-small-line-height);\n color: var(--text-placeholder-small-color);\n text-decoration: var(--text-placeholder-small-text-decoration);\n letter-spacing: var(--text-placeholder-small-letter-spacing);\n}\n\n._placeholder-code_1vf1j_287 {\n font-family: var(--text-placeholder-code-font-family);\n font-style: var(--text-placeholder-code-font-style);\n font-weight: var(--text-placeholder-code-font-weight);\n font-size: var(--text-placeholder-code-font-size);\n line-height: var(--text-placeholder-code-line-height);\n color: var(--text-placeholder-code-color);\n text-decoration: var(--text-placeholder-code-text-decoration);\n letter-spacing: var(--text-placeholder-code-letter-spacing);\n}\n\n._placeholder-code-small_1vf1j_298 {\n font-family: var(--text-placeholder-code-small-font-family);\n font-style: var(--text-placeholder-code-small-font-style);\n font-weight: var(--text-placeholder-code-small-font-weight);\n font-size: var(--text-placeholder-code-small-font-size);\n line-height: var(--text-placeholder-code-small-line-height);\n color: var(--text-placeholder-code-small-color);\n text-decoration: var(--text-placeholder-code-small-text-decoration);\n letter-spacing: var(--text-placeholder-code-small-letter-spacing);\n}\n\n._error_1vf1j_309 {\n font-family: var(--text-error-font-family);\n font-style: var(--text-error-font-style);\n font-weight: var(--text-error-font-weight);\n font-size: var(--text-error-font-size);\n line-height: var(--text-error-line-height);\n color: var(--text-error-color);\n text-decoration: var(--text-error-text-decoration);\n letter-spacing: var(--text-error-letter-spacing);\n}\n\n._error-small_1vf1j_320 {\n font-family: var(--text-error-small-font-family);\n font-style: var(--text-error-small-font-style);\n font-weight: var(--text-error-small-font-weight);\n font-size: var(--text-error-small-font-size);\n line-height: var(--text-error-small-line-height);\n color: var(--text-error-small-color);\n text-decoration: var(--text-error-small-text-decoration);\n letter-spacing: var(--text-error-small-letter-spacing);\n}\n\n._success-small_1vf1j_331 {\n font-family: var(--text-success-small-font-family);\n font-style: var(--text-success-small-font-style);\n font-weight: var(--text-success-small-font-weight);\n font-size: var(--text-success-small-font-size);\n line-height: var(--text-success-small-line-height);\n color: var(--text-success-small-color);\n text-decoration: var(--text-success-small-text-decoration);\n letter-spacing: var(--text-success-small-letter-spacing);\n}\n\n._fieldset_1vf1j_342 {\n padding: 0;\n display: flex;\n flex-direction: column;\n border: 0;\n}\n._fieldset_1vf1j_342 > * + * {\n margin-top: var(--sizes-base);\n}\n\n._legend_1vf1j_352 {\n font-family: var(--text-input-label-font-family);\n font-style: var(--text-input-label-font-style);\n font-weight: var(--text-input-label-font-weight);\n font-size: var(--text-input-label-font-size);\n line-height: var(--text-input-label-line-height);\n color: var(--text-input-label-color);\n text-decoration: var(--text-input-label-text-decoration);\n letter-spacing: var(--text-input-label-letter-spacing);\n}");
|
|
4
|
+
var styles = {"fieldset":"_fieldset_1vf1j_342","legend":"_legend_1vf1j_352"};
|
|
5
|
+
|
|
6
|
+
export { styles as default };
|
|
7
|
+
//# sourceMappingURL=ChoiceList.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChoiceList.module.scss.js","sources":["../../../src/components/ChoiceList/ChoiceList.module.scss"],"sourcesContent":["@use '../../theme/scss/text.module.scss' as text;\n\n.fieldset {\n padding: 0;\n display: flex;\n flex-direction: column;\n border: 0;\n\n & > * + * {\n margin-top: var(--sizes-base);\n }\n}\n\n.legend {\n @include text.input-label;\n}\n"],"names":["___$insertStyle"],"mappings":";;AAGEA,WAAA,CAAA,modAAA;AACA,aAAA,CAAA,UAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,mBAAA;;;;"}
|
|
@@ -12,9 +12,11 @@ require('../../../../../theme/modules/shadows.cjs');
|
|
|
12
12
|
require('../../../../../theme/modules/sizes.cjs');
|
|
13
13
|
require('../../../../../theme/modules/text.cjs');
|
|
14
14
|
require('styled-components');
|
|
15
|
-
require('
|
|
15
|
+
require('framer-motion');
|
|
16
|
+
require('../../../../Tooltip/components/styled.cjs');
|
|
17
|
+
require('../../../../Tooltip/components/TooltipPopover.cjs');
|
|
18
|
+
require('react-dom');
|
|
16
19
|
require('../../../../Text/Text.cjs');
|
|
17
|
-
require('../../../../Checkbox/styled.cjs');
|
|
18
20
|
require('../../../../Radio/Radio.cjs');
|
|
19
21
|
var useExpandableCell = require('./hooks/useExpandableCell.cjs');
|
|
20
22
|
var BodyCell_module = require('./BodyCell.module.scss.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyCell.cjs","sources":["../../../../../../src/components/DataGrid/components/Body/BodyCell/BodyCell.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { Cell, flexRender } from '@tanstack/react-table';\nimport { SELECTION_COLUMN_ID } from '../../../constants';\n\nimport { buildClassnames } from '../../../../../utils';\n\nimport { AriaRoles } from '../../../types';\nimport { CellContent } from '../../CellContent';\nimport { usePinnedColumnStyles } from '../../../hooks';\n\nimport { useExpandableCell } from './hooks';\nimport styles from './BodyCell.module.scss';\n\ntype ColumnCellProps = {\n /**\n * Cell within the TanStack Table instance.\n */\n cell: Cell<any, any>;\n\n /**\n * ARIA roles for the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether row selection is enabled.\n */\n enableRowSelection: boolean;\n\n /**\n * Whether row expanding is enabled for the grid.\n */\n enableExpanding: boolean;\n};\n\n/**\n * Renders a cell element, and its content, for a given column and row, within the grid body.\n */\nexport const BodyCell = ({\n cell,\n ariaRoles,\n enableRowSelection,\n enableExpanding,\n}: ColumnCellProps) => {\n const { justifyContent, textAlign, rowHeader, generateDataTestId } = cell.column.columnDef.meta!;\n const CellElement = rowHeader ? 'th' : 'td';\n\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({ column: cell.column });\n\n const { expandButtonProps, contentMarginLeft } = useExpandableCell({\n cell,\n enableExpanding,\n enableRowSelection,\n });\n\n const bodyCellClassname = buildClassnames([\n styles.bodyCell,\n pinnedCellClassName,\n 'data-grid-cell',\n ]);\n\n const cellContext = cell.getContext();\n const cellTestId = useMemo(\n () => (generateDataTestId ? generateDataTestId(cellContext.row.original) : undefined),\n [generateDataTestId, cellContext.row.original],\n );\n\n const isSelectionCol = enableRowSelection && cell.column.id === SELECTION_COLUMN_ID;\n\n // Capture shift key state for range selection in selection column.\n const captureShiftKeyForSelection = isSelectionCol\n ? (e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => {\n if ('key' in e && e.key !== ' ') return;\n\n const { row, table } = cell.getContext();\n if (!row.getCanSelect()) return;\n\n const { rangeSelectionState } = table.options.meta || {};\n if (rangeSelectionState) rangeSelectionState.isShiftKeyPressed = e.shiftKey;\n }\n : undefined;\n\n return (\n <CellElement\n className={bodyCellClassname}\n aria-colindex={cell.column.getIndex() + 1}\n scope={rowHeader ? 'row' : undefined}\n role={rowHeader ? 'rowheader' : ariaRoles.cell}\n style={pinnedCellStyles}\n data-testid={cellTestId}\n >\n <CellContent\n contentStyle={\n {\n marginLeft: contentMarginLeft,\n justifyContent,\n textAlign,\n } as React.CSSProperties\n }\n expandButtonProps={expandButtonProps}\n onMouseDown={captureShiftKeyForSelection}\n onKeyDown={captureShiftKeyForSelection}\n >\n {flexRender(cell.column.columnDef.cell, cellContext)}\n </CellContent>\n </CellElement>\n );\n};\n"],"names":["usePinnedColumnStyles","useExpandableCell","buildClassnames","styles","useMemo","SELECTION_COLUMN_ID","React","CellContent","flexRender"],"mappings":"
|
|
1
|
+
{"version":3,"file":"BodyCell.cjs","sources":["../../../../../../src/components/DataGrid/components/Body/BodyCell/BodyCell.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { Cell, flexRender } from '@tanstack/react-table';\nimport { SELECTION_COLUMN_ID } from '../../../constants';\n\nimport { buildClassnames } from '../../../../../utils';\n\nimport { AriaRoles } from '../../../types';\nimport { CellContent } from '../../CellContent';\nimport { usePinnedColumnStyles } from '../../../hooks';\n\nimport { useExpandableCell } from './hooks';\nimport styles from './BodyCell.module.scss';\n\ntype ColumnCellProps = {\n /**\n * Cell within the TanStack Table instance.\n */\n cell: Cell<any, any>;\n\n /**\n * ARIA roles for the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether row selection is enabled.\n */\n enableRowSelection: boolean;\n\n /**\n * Whether row expanding is enabled for the grid.\n */\n enableExpanding: boolean;\n};\n\n/**\n * Renders a cell element, and its content, for a given column and row, within the grid body.\n */\nexport const BodyCell = ({\n cell,\n ariaRoles,\n enableRowSelection,\n enableExpanding,\n}: ColumnCellProps) => {\n const { justifyContent, textAlign, rowHeader, generateDataTestId } = cell.column.columnDef.meta!;\n const CellElement = rowHeader ? 'th' : 'td';\n\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({ column: cell.column });\n\n const { expandButtonProps, contentMarginLeft } = useExpandableCell({\n cell,\n enableExpanding,\n enableRowSelection,\n });\n\n const bodyCellClassname = buildClassnames([\n styles.bodyCell,\n pinnedCellClassName,\n 'data-grid-cell',\n ]);\n\n const cellContext = cell.getContext();\n const cellTestId = useMemo(\n () => (generateDataTestId ? generateDataTestId(cellContext.row.original) : undefined),\n [generateDataTestId, cellContext.row.original],\n );\n\n const isSelectionCol = enableRowSelection && cell.column.id === SELECTION_COLUMN_ID;\n\n // Capture shift key state for range selection in selection column.\n const captureShiftKeyForSelection = isSelectionCol\n ? (e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => {\n if ('key' in e && e.key !== ' ') return;\n\n const { row, table } = cell.getContext();\n if (!row.getCanSelect()) return;\n\n const { rangeSelectionState } = table.options.meta || {};\n if (rangeSelectionState) rangeSelectionState.isShiftKeyPressed = e.shiftKey;\n }\n : undefined;\n\n return (\n <CellElement\n className={bodyCellClassname}\n aria-colindex={cell.column.getIndex() + 1}\n scope={rowHeader ? 'row' : undefined}\n role={rowHeader ? 'rowheader' : ariaRoles.cell}\n style={pinnedCellStyles}\n data-testid={cellTestId}\n >\n <CellContent\n contentStyle={\n {\n marginLeft: contentMarginLeft,\n justifyContent,\n textAlign,\n } as React.CSSProperties\n }\n expandButtonProps={expandButtonProps}\n onMouseDown={captureShiftKeyForSelection}\n onKeyDown={captureShiftKeyForSelection}\n >\n {flexRender(cell.column.columnDef.cell, cellContext)}\n </CellContent>\n </CellElement>\n );\n};\n"],"names":["usePinnedColumnStyles","useExpandableCell","buildClassnames","styles","useMemo","SELECTION_COLUMN_ID","React","CellContent","flexRender"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA;;AAEG;AACI,MAAM,QAAQ,GAAG,CAAC,EACvB,IAAI,EACJ,SAAS,EACT,kBAAkB,EAClB,eAAe,GACC,KAAI;AACpB,IAAA,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAK;IAChG,MAAM,WAAW,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI;AAE3C,IAAA,MAAM,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,GAAGA,2CAAqB,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;AAEhG,IAAA,MAAM,EAAE,iBAAiB,EAAE,iBAAi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AAE,gBAAgB,EAAA,aAAA,EACV,UAAU,EAAA;QAEvBA,sBAAA,CAAA,aAAA,CAACC,uBAAW,EAAA,EACV,YAAY,EACV;AACE,gBAAA,UAAU,EAAE,iBAAiB;gBAC7B,cAAc;gBACd,SAAS;aACa,EAE1B,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,2BAA2B,EACxC,SAAS,EAAE,2BAA2B,EAAA,EAErCC,qBAAU,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CACxC,CACF;AAElB;;;;"}
|
|
@@ -10,9 +10,11 @@ import '../../../../../theme/modules/shadows.js';
|
|
|
10
10
|
import '../../../../../theme/modules/sizes.js';
|
|
11
11
|
import '../../../../../theme/modules/text.js';
|
|
12
12
|
import 'styled-components';
|
|
13
|
-
import '
|
|
13
|
+
import 'framer-motion';
|
|
14
|
+
import '../../../../Tooltip/components/styled.js';
|
|
15
|
+
import '../../../../Tooltip/components/TooltipPopover.js';
|
|
16
|
+
import 'react-dom';
|
|
14
17
|
import '../../../../Text/Text.js';
|
|
15
|
-
import '../../../../Checkbox/styled.js';
|
|
16
18
|
import '../../../../Radio/Radio.js';
|
|
17
19
|
import { useExpandableCell } from './hooks/useExpandableCell.js';
|
|
18
20
|
import styles from './BodyCell.module.scss.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyCell.js","sources":["../../../../../../src/components/DataGrid/components/Body/BodyCell/BodyCell.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { Cell, flexRender } from '@tanstack/react-table';\nimport { SELECTION_COLUMN_ID } from '../../../constants';\n\nimport { buildClassnames } from '../../../../../utils';\n\nimport { AriaRoles } from '../../../types';\nimport { CellContent } from '../../CellContent';\nimport { usePinnedColumnStyles } from '../../../hooks';\n\nimport { useExpandableCell } from './hooks';\nimport styles from './BodyCell.module.scss';\n\ntype ColumnCellProps = {\n /**\n * Cell within the TanStack Table instance.\n */\n cell: Cell<any, any>;\n\n /**\n * ARIA roles for the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether row selection is enabled.\n */\n enableRowSelection: boolean;\n\n /**\n * Whether row expanding is enabled for the grid.\n */\n enableExpanding: boolean;\n};\n\n/**\n * Renders a cell element, and its content, for a given column and row, within the grid body.\n */\nexport const BodyCell = ({\n cell,\n ariaRoles,\n enableRowSelection,\n enableExpanding,\n}: ColumnCellProps) => {\n const { justifyContent, textAlign, rowHeader, generateDataTestId } = cell.column.columnDef.meta!;\n const CellElement = rowHeader ? 'th' : 'td';\n\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({ column: cell.column });\n\n const { expandButtonProps, contentMarginLeft } = useExpandableCell({\n cell,\n enableExpanding,\n enableRowSelection,\n });\n\n const bodyCellClassname = buildClassnames([\n styles.bodyCell,\n pinnedCellClassName,\n 'data-grid-cell',\n ]);\n\n const cellContext = cell.getContext();\n const cellTestId = useMemo(\n () => (generateDataTestId ? generateDataTestId(cellContext.row.original) : undefined),\n [generateDataTestId, cellContext.row.original],\n );\n\n const isSelectionCol = enableRowSelection && cell.column.id === SELECTION_COLUMN_ID;\n\n // Capture shift key state for range selection in selection column.\n const captureShiftKeyForSelection = isSelectionCol\n ? (e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => {\n if ('key' in e && e.key !== ' ') return;\n\n const { row, table } = cell.getContext();\n if (!row.getCanSelect()) return;\n\n const { rangeSelectionState } = table.options.meta || {};\n if (rangeSelectionState) rangeSelectionState.isShiftKeyPressed = e.shiftKey;\n }\n : undefined;\n\n return (\n <CellElement\n className={bodyCellClassname}\n aria-colindex={cell.column.getIndex() + 1}\n scope={rowHeader ? 'row' : undefined}\n role={rowHeader ? 'rowheader' : ariaRoles.cell}\n style={pinnedCellStyles}\n data-testid={cellTestId}\n >\n <CellContent\n contentStyle={\n {\n marginLeft: contentMarginLeft,\n justifyContent,\n textAlign,\n } as React.CSSProperties\n }\n expandButtonProps={expandButtonProps}\n onMouseDown={captureShiftKeyForSelection}\n onKeyDown={captureShiftKeyForSelection}\n >\n {flexRender(cell.column.columnDef.cell, cellContext)}\n </CellContent>\n </CellElement>\n );\n};\n"],"names":["React"],"mappings":"
|
|
1
|
+
{"version":3,"file":"BodyCell.js","sources":["../../../../../../src/components/DataGrid/components/Body/BodyCell/BodyCell.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { Cell, flexRender } from '@tanstack/react-table';\nimport { SELECTION_COLUMN_ID } from '../../../constants';\n\nimport { buildClassnames } from '../../../../../utils';\n\nimport { AriaRoles } from '../../../types';\nimport { CellContent } from '../../CellContent';\nimport { usePinnedColumnStyles } from '../../../hooks';\n\nimport { useExpandableCell } from './hooks';\nimport styles from './BodyCell.module.scss';\n\ntype ColumnCellProps = {\n /**\n * Cell within the TanStack Table instance.\n */\n cell: Cell<any, any>;\n\n /**\n * ARIA roles for the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether row selection is enabled.\n */\n enableRowSelection: boolean;\n\n /**\n * Whether row expanding is enabled for the grid.\n */\n enableExpanding: boolean;\n};\n\n/**\n * Renders a cell element, and its content, for a given column and row, within the grid body.\n */\nexport const BodyCell = ({\n cell,\n ariaRoles,\n enableRowSelection,\n enableExpanding,\n}: ColumnCellProps) => {\n const { justifyContent, textAlign, rowHeader, generateDataTestId } = cell.column.columnDef.meta!;\n const CellElement = rowHeader ? 'th' : 'td';\n\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({ column: cell.column });\n\n const { expandButtonProps, contentMarginLeft } = useExpandableCell({\n cell,\n enableExpanding,\n enableRowSelection,\n });\n\n const bodyCellClassname = buildClassnames([\n styles.bodyCell,\n pinnedCellClassName,\n 'data-grid-cell',\n ]);\n\n const cellContext = cell.getContext();\n const cellTestId = useMemo(\n () => (generateDataTestId ? generateDataTestId(cellContext.row.original) : undefined),\n [generateDataTestId, cellContext.row.original],\n );\n\n const isSelectionCol = enableRowSelection && cell.column.id === SELECTION_COLUMN_ID;\n\n // Capture shift key state for range selection in selection column.\n const captureShiftKeyForSelection = isSelectionCol\n ? (e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => {\n if ('key' in e && e.key !== ' ') return;\n\n const { row, table } = cell.getContext();\n if (!row.getCanSelect()) return;\n\n const { rangeSelectionState } = table.options.meta || {};\n if (rangeSelectionState) rangeSelectionState.isShiftKeyPressed = e.shiftKey;\n }\n : undefined;\n\n return (\n <CellElement\n className={bodyCellClassname}\n aria-colindex={cell.column.getIndex() + 1}\n scope={rowHeader ? 'row' : undefined}\n role={rowHeader ? 'rowheader' : ariaRoles.cell}\n style={pinnedCellStyles}\n data-testid={cellTestId}\n >\n <CellContent\n contentStyle={\n {\n marginLeft: contentMarginLeft,\n justifyContent,\n textAlign,\n } as React.CSSProperties\n }\n expandButtonProps={expandButtonProps}\n onMouseDown={captureShiftKeyForSelection}\n onKeyDown={captureShiftKeyForSelection}\n >\n {flexRender(cell.column.columnDef.cell, cellContext)}\n </CellContent>\n </CellElement>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoCA;;AAEG;AACI,MAAM,QAAQ,GAAG,CAAC,EACvB,IAAI,EACJ,SAAS,EACT,kBAAkB,EAClB,eAAe,GACC,KAAI;AACpB,IAAA,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAK;IAChG,MAAM,WAAW,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI;AAE3C,IAAA,MAAM,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,GAAG,qBAAqB,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;AAEhG,IAAA,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,CAAC;QACjE,IAAI;QACJ,eAAe;QACf,kBAAkB;AACnB,KA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AAA,EACV,YAAY,EACV;AACE,gBAAA,UAAU,EAAE,iBAAiB;gBAC7B,cAAc;gBACd,SAAS;aACa,EAE1B,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,2BAA2B,EACxC,SAAS,EAAE,2BAA2B,EAAA,EAErC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CACxC,CACF;AAElB;;;;"}
|
|
@@ -8,9 +8,11 @@ var usePinnedColumnStyles = require('../../../hooks/usePinnedColumnStyles.cjs');
|
|
|
8
8
|
require('@tanstack/react-table');
|
|
9
9
|
require('../../../../Stack/Stack.cjs');
|
|
10
10
|
var index = require('../../../../../theme/index.cjs');
|
|
11
|
-
require('
|
|
11
|
+
require('framer-motion');
|
|
12
|
+
require('../../../../Tooltip/components/styled.cjs');
|
|
13
|
+
require('../../../../Tooltip/components/TooltipPopover.cjs');
|
|
14
|
+
require('react-dom');
|
|
12
15
|
require('../../../../Text/Text.cjs');
|
|
13
|
-
require('../../../../Checkbox/styled.cjs');
|
|
14
16
|
require('../../../../Radio/Radio.cjs');
|
|
15
17
|
var CellContent = require('../../CellContent/CellContent.cjs');
|
|
16
18
|
var BodyCell_module = require('../BodyCell/BodyCell.module.scss.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingBodyCell.cjs","sources":["../../../../../../src/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.tsx"],"sourcesContent":["import React from 'react';\nimport { Column } from '@tanstack/react-table';\n\nimport { Skeleton } from '../../../../Skeleton';\nimport { buildClassnames } from '../../../../../utils';\nimport { usePinnedColumnStyles } from '../../../hooks';\nimport { CellContent } from '../../CellContent';\nimport { theme } from '../../../../../theme';\n\nimport styles from '../BodyCell/BodyCell.module.scss';\n\ntype LoadingBodyCellProps = {\n /**\n * The TanStack Table column instance.\n */\n column: Column<any, any>;\n};\n\n/**\n * A cell component for the DataGrid that displays a skeleton loader.\n */\nexport const LoadingBodyCell = ({ column }: LoadingBodyCellProps) => {\n const { justifyContent, textAlign } = column.columnDef.meta!;\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({\n column,\n });\n\n const loadingCellClassname = buildClassnames([\n styles.bodyCell,\n pinnedCellClassName,\n 'data-grid-cell',\n 'data-grid-cell-loading',\n ]);\n\n return (\n <td\n className={loadingCellClassname}\n style={pinnedCellStyles}\n aria-colindex={column.getIndex() + 1}\n >\n <CellContent\n contentStyle={\n {\n justifyContent,\n textAlign,\n } as React.CSSProperties\n }\n >\n <Skeleton width=\"75%\" height={theme.sizes[3]} />\n </CellContent>\n </td>\n );\n};\n"],"names":["usePinnedColumnStyles","buildClassnames","styles","React","CellContent","Skeleton","theme"],"mappings":"
|
|
1
|
+
{"version":3,"file":"LoadingBodyCell.cjs","sources":["../../../../../../src/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.tsx"],"sourcesContent":["import React from 'react';\nimport { Column } from '@tanstack/react-table';\n\nimport { Skeleton } from '../../../../Skeleton';\nimport { buildClassnames } from '../../../../../utils';\nimport { usePinnedColumnStyles } from '../../../hooks';\nimport { CellContent } from '../../CellContent';\nimport { theme } from '../../../../../theme';\n\nimport styles from '../BodyCell/BodyCell.module.scss';\n\ntype LoadingBodyCellProps = {\n /**\n * The TanStack Table column instance.\n */\n column: Column<any, any>;\n};\n\n/**\n * A cell component for the DataGrid that displays a skeleton loader.\n */\nexport const LoadingBodyCell = ({ column }: LoadingBodyCellProps) => {\n const { justifyContent, textAlign } = column.columnDef.meta!;\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({\n column,\n });\n\n const loadingCellClassname = buildClassnames([\n styles.bodyCell,\n pinnedCellClassName,\n 'data-grid-cell',\n 'data-grid-cell-loading',\n ]);\n\n return (\n <td\n className={loadingCellClassname}\n style={pinnedCellStyles}\n aria-colindex={column.getIndex() + 1}\n >\n <CellContent\n contentStyle={\n {\n justifyContent,\n textAlign,\n } as React.CSSProperties\n }\n >\n <Skeleton width=\"75%\" height={theme.sizes[3]} />\n </CellContent>\n </td>\n );\n};\n"],"names":["usePinnedColumnStyles","buildClassnames","styles","React","CellContent","Skeleton","theme"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkBA;;AAEG;MACU,eAAe,GAAG,CAAC,EAAE,MAAM,EAAwB,KAAI;IAClE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC,IAAK;AAC5D,IAAA,MAAM,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,GAAGA,2CAAqB,CAAC;QACtE,MAAM;AACP,KAAA,CAAC;IAEF,MAAM,oBAAoB,GAAGC,+BAAe,CAAC;AAC3C,QAAAC,eAAM,CAAC,QAAQ;QACf,mBAAmB;QACnB,gBAAgB;QAChB,wBAAwB;AACzB,KAAA,CAAC;AAEF,IAAA,QACEC,sBAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EACE,SAAS,EAAE,oBAAoB,EAC/B,KAAK,EAAE,gBAAgB,mBACR,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAA;QAEpCA,sBAAA,CAAA,aAAA,CAACC,uBAAW,EAAA,EACV,YAAY,EACV;gBACE,cAAc;gBACd,SAAS;AACa,aAAA,EAAA;AAG1B,YAAAD,sBAAA,CAAA,aAAA,CAACE,iBAAQ,EAAA,EAAC,KAAK,EAAC,KAAK,EAAC,MAAM,EAAEC,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAI,CACpC,CACX;AAET;;;;"}
|
|
@@ -6,9 +6,11 @@ import { usePinnedColumnStyles } from '../../../hooks/usePinnedColumnStyles.js';
|
|
|
6
6
|
import '@tanstack/react-table';
|
|
7
7
|
import '../../../../Stack/Stack.js';
|
|
8
8
|
import { theme } from '../../../../../theme/index.js';
|
|
9
|
-
import '
|
|
9
|
+
import 'framer-motion';
|
|
10
|
+
import '../../../../Tooltip/components/styled.js';
|
|
11
|
+
import '../../../../Tooltip/components/TooltipPopover.js';
|
|
12
|
+
import 'react-dom';
|
|
10
13
|
import '../../../../Text/Text.js';
|
|
11
|
-
import '../../../../Checkbox/styled.js';
|
|
12
14
|
import '../../../../Radio/Radio.js';
|
|
13
15
|
import { CellContent } from '../../CellContent/CellContent.js';
|
|
14
16
|
import styles from '../BodyCell/BodyCell.module.scss.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingBodyCell.js","sources":["../../../../../../src/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.tsx"],"sourcesContent":["import React from 'react';\nimport { Column } from '@tanstack/react-table';\n\nimport { Skeleton } from '../../../../Skeleton';\nimport { buildClassnames } from '../../../../../utils';\nimport { usePinnedColumnStyles } from '../../../hooks';\nimport { CellContent } from '../../CellContent';\nimport { theme } from '../../../../../theme';\n\nimport styles from '../BodyCell/BodyCell.module.scss';\n\ntype LoadingBodyCellProps = {\n /**\n * The TanStack Table column instance.\n */\n column: Column<any, any>;\n};\n\n/**\n * A cell component for the DataGrid that displays a skeleton loader.\n */\nexport const LoadingBodyCell = ({ column }: LoadingBodyCellProps) => {\n const { justifyContent, textAlign } = column.columnDef.meta!;\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({\n column,\n });\n\n const loadingCellClassname = buildClassnames([\n styles.bodyCell,\n pinnedCellClassName,\n 'data-grid-cell',\n 'data-grid-cell-loading',\n ]);\n\n return (\n <td\n className={loadingCellClassname}\n style={pinnedCellStyles}\n aria-colindex={column.getIndex() + 1}\n >\n <CellContent\n contentStyle={\n {\n justifyContent,\n textAlign,\n } as React.CSSProperties\n }\n >\n <Skeleton width=\"75%\" height={theme.sizes[3]} />\n </CellContent>\n </td>\n );\n};\n"],"names":["React"],"mappings":"
|
|
1
|
+
{"version":3,"file":"LoadingBodyCell.js","sources":["../../../../../../src/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.tsx"],"sourcesContent":["import React from 'react';\nimport { Column } from '@tanstack/react-table';\n\nimport { Skeleton } from '../../../../Skeleton';\nimport { buildClassnames } from '../../../../../utils';\nimport { usePinnedColumnStyles } from '../../../hooks';\nimport { CellContent } from '../../CellContent';\nimport { theme } from '../../../../../theme';\n\nimport styles from '../BodyCell/BodyCell.module.scss';\n\ntype LoadingBodyCellProps = {\n /**\n * The TanStack Table column instance.\n */\n column: Column<any, any>;\n};\n\n/**\n * A cell component for the DataGrid that displays a skeleton loader.\n */\nexport const LoadingBodyCell = ({ column }: LoadingBodyCellProps) => {\n const { justifyContent, textAlign } = column.columnDef.meta!;\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({\n column,\n });\n\n const loadingCellClassname = buildClassnames([\n styles.bodyCell,\n pinnedCellClassName,\n 'data-grid-cell',\n 'data-grid-cell-loading',\n ]);\n\n return (\n <td\n className={loadingCellClassname}\n style={pinnedCellStyles}\n aria-colindex={column.getIndex() + 1}\n >\n <CellContent\n contentStyle={\n {\n justifyContent,\n textAlign,\n } as React.CSSProperties\n }\n >\n <Skeleton width=\"75%\" height={theme.sizes[3]} />\n </CellContent>\n </td>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;AAkBA;;AAEG;MACU,eAAe,GAAG,CAAC,EAAE,MAAM,EAAwB,KAAI;IAClE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC,IAAK;AAC5D,IAAA,MAAM,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,GAAG,qBAAqB,CAAC;QACtE,MAAM;AACP,KAAA,CAAC;IAEF,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAC3C,QAAA,MAAM,CAAC,QAAQ;QACf,mBAAmB;QACnB,gBAAgB;QAChB,wBAAwB;AACzB,KAAA,CAAC;AAEF,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EACE,SAAS,EAAE,oBAAoB,EAC/B,KAAK,EAAE,gBAAgB,mBACR,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAA;QAEpCA,cAAA,CAAA,aAAA,CAAC,WAAW,EAAA,EACV,YAAY,EACV;gBACE,cAAc;gBACd,SAAS;AACa,aAAA,EAAA;AAG1B,YAAAA,cAAA,CAAA,aAAA,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAC,KAAK,EAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAI,CACpC,CACX;AAET;;;;"}
|
|
@@ -12,9 +12,11 @@ var GridContainer_module = require('./GridContainer.module.scss.cjs');
|
|
|
12
12
|
var usePinnedColumnLayout = require('../../hooks/usePinnedColumnLayout.cjs');
|
|
13
13
|
require('@tanstack/react-table');
|
|
14
14
|
require('../../../Stack/Stack.cjs');
|
|
15
|
-
require('
|
|
15
|
+
require('framer-motion');
|
|
16
|
+
require('../../../Tooltip/components/styled.cjs');
|
|
17
|
+
require('../../../Tooltip/components/TooltipPopover.cjs');
|
|
18
|
+
require('react-dom');
|
|
16
19
|
require('../../../Text/Text.cjs');
|
|
17
|
-
require('../../../Checkbox/styled.cjs');
|
|
18
20
|
require('../../../Radio/Radio.cjs');
|
|
19
21
|
|
|
20
22
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridContainer.cjs","sources":["../../../../../src/components/DataGrid/components/GridContainer/GridContainer.tsx"],"sourcesContent":["import React, { RefObject, CSSProperties, ReactNode, AriaAttributes } from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { theme } from 'Theme';\nimport { SizeScale } from 'Theme/modules/sizes';\n\nimport { useScrollPosition } from '../../../../hooks';\nimport { BorderMode } from '../../types/enums';\nimport { AriaRoles } from '../../types';\nimport { buildClassnames } from '../../../../utils/buildClassnames';\n\nimport { Container } from './Container';\n\nimport styles from './GridContainer.module.scss';\nimport { usePinnedColumnLayout } from '../../hooks';\n\ntype GridContainerProps = Pick<AriaAttributes, 'aria-label'> &\n Pick<React.HTMLAttributes<HTMLTableElement>, 'id' | 'className'> & {\n /**\n * Reference to be used for the outer container element.\n */\n containerRef?: RefObject<HTMLDivElement>;\n\n /**\n * Reference to be used for the table element.\n */\n tableRef?: RefObject<HTMLTableElement>;\n\n /**\n * Border mode.\n */\n borderMode: BorderMode;\n\n /**\n * Additional container styles.\n */\n containerStyles?: CSSProperties;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether resizeable columns are enabled or not.\n */\n enableResizeableColumns: boolean;\n\n /**\n * Density of the grid.\n */\n density: keyof SizeScale;\n\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * Child elements (table contents).\n */\n children: ReactNode;\n };\n\nconst gridContainerClassname = buildClassnames([styles.dataGridStyle, 'data-grid']);\n\n/**\n * The Grid container, which includes a wrapper and the table element itself. Controls table layout, applies\n * styling and sets table-specific CSS variables (such as density).\n */\nexport const GridContainer = ({\n containerRef,\n tableRef,\n borderMode,\n containerStyles,\n ariaRoles,\n enableResizeableColumns,\n density,\n table,\n children,\n id,\n className,\n 'aria-label': ariaLabel,\n}: GridContainerProps) => {\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n const { scrollPosition, onScroll, enableTransition } = useScrollPosition({ containerRef });\n\n // CSS variables to control pinned column shadow visibility\n const hideShadows = !scrollPosition || scrollPosition === 'none';\n const shadowVisibility = {\n '--pinned-left-shadow-opacity': hideShadows || scrollPosition === 'start' ? 0 : 1,\n '--pinned-right-shadow-opacity': hideShadows || scrollPosition === 'end' ? 0 : 1,\n '--pinned-shadow-transition-duration': enableTransition ? '0.3s' : '0s',\n };\n\n return (\n <Container\n ref={containerRef}\n borderMode={borderMode}\n style={containerStyles}\n onScroll={onScroll}\n >\n <table\n id={id}\n ref={tableRef}\n className={buildClassnames([gridContainerClassname, className])}\n role={ariaRoles.table}\n style={\n {\n tableLayout: enableResizeableColumns ? 'fixed' : 'auto',\n '--density': theme.sizes[density],\n ...pinnedColumnLayoutStyles,\n ...shadowVisibility,\n } as CSSProperties\n }\n aria-colcount={table.getFlatHeaders().length}\n aria-rowcount={table.getRowCount()}\n aria-label={ariaLabel}\n >\n {children}\n </table>\n </Container>\n );\n};\n"],"names":["buildClassnames","styles","usePinnedColumnLayout","useScrollPosition","React","Container","theme"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridContainer.cjs","sources":["../../../../../src/components/DataGrid/components/GridContainer/GridContainer.tsx"],"sourcesContent":["import React, { RefObject, CSSProperties, ReactNode, AriaAttributes } from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { theme } from 'Theme';\nimport { SizeScale } from 'Theme/modules/sizes';\n\nimport { useScrollPosition } from '../../../../hooks';\nimport { BorderMode } from '../../types/enums';\nimport { AriaRoles } from '../../types';\nimport { buildClassnames } from '../../../../utils/buildClassnames';\n\nimport { Container } from './Container';\n\nimport styles from './GridContainer.module.scss';\nimport { usePinnedColumnLayout } from '../../hooks';\n\ntype GridContainerProps = Pick<AriaAttributes, 'aria-label'> &\n Pick<React.HTMLAttributes<HTMLTableElement>, 'id' | 'className'> & {\n /**\n * Reference to be used for the outer container element.\n */\n containerRef?: RefObject<HTMLDivElement>;\n\n /**\n * Reference to be used for the table element.\n */\n tableRef?: RefObject<HTMLTableElement>;\n\n /**\n * Border mode.\n */\n borderMode: BorderMode;\n\n /**\n * Additional container styles.\n */\n containerStyles?: CSSProperties;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether resizeable columns are enabled or not.\n */\n enableResizeableColumns: boolean;\n\n /**\n * Density of the grid.\n */\n density: keyof SizeScale;\n\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * Child elements (table contents).\n */\n children: ReactNode;\n };\n\nconst gridContainerClassname = buildClassnames([styles.dataGridStyle, 'data-grid']);\n\n/**\n * The Grid container, which includes a wrapper and the table element itself. Controls table layout, applies\n * styling and sets table-specific CSS variables (such as density).\n */\nexport const GridContainer = ({\n containerRef,\n tableRef,\n borderMode,\n containerStyles,\n ariaRoles,\n enableResizeableColumns,\n density,\n table,\n children,\n id,\n className,\n 'aria-label': ariaLabel,\n}: GridContainerProps) => {\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n const { scrollPosition, onScroll, enableTransition } = useScrollPosition({ containerRef });\n\n // CSS variables to control pinned column shadow visibility\n const hideShadows = !scrollPosition || scrollPosition === 'none';\n const shadowVisibility = {\n '--pinned-left-shadow-opacity': hideShadows || scrollPosition === 'start' ? 0 : 1,\n '--pinned-right-shadow-opacity': hideShadows || scrollPosition === 'end' ? 0 : 1,\n '--pinned-shadow-transition-duration': enableTransition ? '0.3s' : '0s',\n };\n\n return (\n <Container\n ref={containerRef}\n borderMode={borderMode}\n style={containerStyles}\n onScroll={onScroll}\n >\n <table\n id={id}\n ref={tableRef}\n className={buildClassnames([gridContainerClassname, className])}\n role={ariaRoles.table}\n style={\n {\n tableLayout: enableResizeableColumns ? 'fixed' : 'auto',\n '--density': theme.sizes[density],\n ...pinnedColumnLayoutStyles,\n ...shadowVisibility,\n } as CSSProperties\n }\n aria-colcount={table.getFlatHeaders().length}\n aria-rowcount={table.getRowCount()}\n aria-label={ariaLabel}\n >\n {children}\n </table>\n </Container>\n );\n};\n"],"names":["buildClassnames","styles","usePinnedColumnLayout","useScrollPosition","React","Container","theme"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAM,sBAAsB,GAAGA,+BAAe,CAAC,CAACC,oBAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AAEnF;;;AAGG;AACI,MAAM,aAAa,GAAG,CAAC,EAC5B,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,SAAS,EACT,uBAAuB,EACvB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,EAAE,EACF,SAAS,EACT,YAAY,EAAE,SAAS,GACJ,KAAI;IACvB,MAAM,EAAE,wBAAwB,EAAE,GAAGC,2CAAqB,CAAC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usePinnedColumnLayout.js';
|
|
11
11
|
import '@tanstack/react-table';
|
|
12
12
|
import '../../../Stack/Stack.js';
|
|
13
|
-
import '
|
|
13
|
+
import 'framer-motion';
|
|
14
|
+
import '../../../Tooltip/components/styled.js';
|
|
15
|
+
import '../../../Tooltip/components/TooltipPopover.js';
|
|
16
|
+
import 'react-dom';
|
|
14
17
|
import '../../../Text/Text.js';
|
|
15
|
-
import '../../../Checkbox/styled.js';
|
|
16
18
|
import '../../../Radio/Radio.js';
|
|
17
19
|
|
|
18
20
|
const gridContainerClassname = buildClassnames([styles.dataGridStyle, 'data-grid']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridContainer.js","sources":["../../../../../src/components/DataGrid/components/GridContainer/GridContainer.tsx"],"sourcesContent":["import React, { RefObject, CSSProperties, ReactNode, AriaAttributes } from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { theme } from 'Theme';\nimport { SizeScale } from 'Theme/modules/sizes';\n\nimport { useScrollPosition } from '../../../../hooks';\nimport { BorderMode } from '../../types/enums';\nimport { AriaRoles } from '../../types';\nimport { buildClassnames } from '../../../../utils/buildClassnames';\n\nimport { Container } from './Container';\n\nimport styles from './GridContainer.module.scss';\nimport { usePinnedColumnLayout } from '../../hooks';\n\ntype GridContainerProps = Pick<AriaAttributes, 'aria-label'> &\n Pick<React.HTMLAttributes<HTMLTableElement>, 'id' | 'className'> & {\n /**\n * Reference to be used for the outer container element.\n */\n containerRef?: RefObject<HTMLDivElement>;\n\n /**\n * Reference to be used for the table element.\n */\n tableRef?: RefObject<HTMLTableElement>;\n\n /**\n * Border mode.\n */\n borderMode: BorderMode;\n\n /**\n * Additional container styles.\n */\n containerStyles?: CSSProperties;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether resizeable columns are enabled or not.\n */\n enableResizeableColumns: boolean;\n\n /**\n * Density of the grid.\n */\n density: keyof SizeScale;\n\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * Child elements (table contents).\n */\n children: ReactNode;\n };\n\nconst gridContainerClassname = buildClassnames([styles.dataGridStyle, 'data-grid']);\n\n/**\n * The Grid container, which includes a wrapper and the table element itself. Controls table layout, applies\n * styling and sets table-specific CSS variables (such as density).\n */\nexport const GridContainer = ({\n containerRef,\n tableRef,\n borderMode,\n containerStyles,\n ariaRoles,\n enableResizeableColumns,\n density,\n table,\n children,\n id,\n className,\n 'aria-label': ariaLabel,\n}: GridContainerProps) => {\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n const { scrollPosition, onScroll, enableTransition } = useScrollPosition({ containerRef });\n\n // CSS variables to control pinned column shadow visibility\n const hideShadows = !scrollPosition || scrollPosition === 'none';\n const shadowVisibility = {\n '--pinned-left-shadow-opacity': hideShadows || scrollPosition === 'start' ? 0 : 1,\n '--pinned-right-shadow-opacity': hideShadows || scrollPosition === 'end' ? 0 : 1,\n '--pinned-shadow-transition-duration': enableTransition ? '0.3s' : '0s',\n };\n\n return (\n <Container\n ref={containerRef}\n borderMode={borderMode}\n style={containerStyles}\n onScroll={onScroll}\n >\n <table\n id={id}\n ref={tableRef}\n className={buildClassnames([gridContainerClassname, className])}\n role={ariaRoles.table}\n style={\n {\n tableLayout: enableResizeableColumns ? 'fixed' : 'auto',\n '--density': theme.sizes[density],\n ...pinnedColumnLayoutStyles,\n ...shadowVisibility,\n } as CSSProperties\n }\n aria-colcount={table.getFlatHeaders().length}\n aria-rowcount={table.getRowCount()}\n aria-label={ariaLabel}\n >\n {children}\n </table>\n </Container>\n );\n};\n"],"names":["React"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridContainer.js","sources":["../../../../../src/components/DataGrid/components/GridContainer/GridContainer.tsx"],"sourcesContent":["import React, { RefObject, CSSProperties, ReactNode, AriaAttributes } from 'react';\nimport { Table } from '@tanstack/react-table';\n\nimport { theme } from 'Theme';\nimport { SizeScale } from 'Theme/modules/sizes';\n\nimport { useScrollPosition } from '../../../../hooks';\nimport { BorderMode } from '../../types/enums';\nimport { AriaRoles } from '../../types';\nimport { buildClassnames } from '../../../../utils/buildClassnames';\n\nimport { Container } from './Container';\n\nimport styles from './GridContainer.module.scss';\nimport { usePinnedColumnLayout } from '../../hooks';\n\ntype GridContainerProps = Pick<AriaAttributes, 'aria-label'> &\n Pick<React.HTMLAttributes<HTMLTableElement>, 'id' | 'className'> & {\n /**\n * Reference to be used for the outer container element.\n */\n containerRef?: RefObject<HTMLDivElement>;\n\n /**\n * Reference to be used for the table element.\n */\n tableRef?: RefObject<HTMLTableElement>;\n\n /**\n * Border mode.\n */\n borderMode: BorderMode;\n\n /**\n * Additional container styles.\n */\n containerStyles?: CSSProperties;\n\n /**\n * ARIA roles used in the grid.\n */\n ariaRoles: AriaRoles;\n\n /**\n * Whether resizeable columns are enabled or not.\n */\n enableResizeableColumns: boolean;\n\n /**\n * Density of the grid.\n */\n density: keyof SizeScale;\n\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * Child elements (table contents).\n */\n children: ReactNode;\n };\n\nconst gridContainerClassname = buildClassnames([styles.dataGridStyle, 'data-grid']);\n\n/**\n * The Grid container, which includes a wrapper and the table element itself. Controls table layout, applies\n * styling and sets table-specific CSS variables (such as density).\n */\nexport const GridContainer = ({\n containerRef,\n tableRef,\n borderMode,\n containerStyles,\n ariaRoles,\n enableResizeableColumns,\n density,\n table,\n children,\n id,\n className,\n 'aria-label': ariaLabel,\n}: GridContainerProps) => {\n const { pinnedColumnLayoutStyles } = usePinnedColumnLayout({ table });\n const { scrollPosition, onScroll, enableTransition } = useScrollPosition({ containerRef });\n\n // CSS variables to control pinned column shadow visibility\n const hideShadows = !scrollPosition || scrollPosition === 'none';\n const shadowVisibility = {\n '--pinned-left-shadow-opacity': hideShadows || scrollPosition === 'start' ? 0 : 1,\n '--pinned-right-shadow-opacity': hideShadows || scrollPosition === 'end' ? 0 : 1,\n '--pinned-shadow-transition-duration': enableTransition ? '0.3s' : '0s',\n };\n\n return (\n <Container\n ref={containerRef}\n borderMode={borderMode}\n style={containerStyles}\n onScroll={onScroll}\n >\n <table\n id={id}\n ref={tableRef}\n className={buildClassnames([gridContainerClassname, className])}\n role={ariaRoles.table}\n style={\n {\n tableLayout: enableResizeableColumns ? 'fixed' : 'auto',\n '--density': theme.sizes[density],\n ...pinnedColumnLayoutStyles,\n ...shadowVisibility,\n } as CSSProperties\n }\n aria-colcount={table.getFlatHeaders().length}\n aria-rowcount={table.getRowCount()}\n aria-label={ariaLabel}\n >\n {children}\n </table>\n </Container>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;AAgEA,MAAM,sBAAsB,GAAG,eAAe,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AAEnF;;;AAGG;AACI,MAAM,aAAa,GAAG,CAAC,EAC5B,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,SAAS,EACT,uBAAuB,EACvB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,EAAE,EACF,SAAS,EACT,YAAY,EAAE,SAAS,GACJ,KAAI;IACvB,MAAM,EAAE,wBAAwB,EAAE,GAAG,qBAAqB,CAAC,EAAE,KAAK,EAAE,CAAC;AACrE,IAAA,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,iBAAiB,CAAC,EAAE,YAAY,EAAE,CAAC;;IAG1F,MAAM,WAAW,GAAG,CAAC,cAAc,IAAI,cAAc,KAAK,MAAM;AAChE,IAAA,MAAM,gBAAgB,GAAG;AACvB,QAAA,8BAA8B,EAAE,WAAW,IAAI,cAAc,KAAK,OAAO,GAAG,CAAC,GAAG,CAAC;AACjF,QAAA,+BAA+B,EAAE,WAAW,IAAI,cAAc,KAAK,KAAK,GAAG,CAAC,GAAG,CAAC;QAChF,qCAAqC,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI;KACxE;AAED,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,SAAS,IACR,GAAG,EAAE,YAAY,EACjB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,eAAe,EACtB,QAAQ,EAAE,QAAQ,EAAA;QAElBA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EACE,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,QAAQ,EACb,SAAS,EAAE,eAAe,CAAC,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC,EAC/D,IAAI,EAAE,SAAS,CAAC,KAAK,EACrB,KAAK,EACH;gBACE,WAAW,EAAE,uBAAuB,GAAG,OAAO,GAAG,MAAM;AACvD,gBAAA,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;AACjC,gBAAA,GAAG,wBAAwB;AAC3B,gBAAA,GAAG,gBAAgB;AACH,aAAA,EAAA,eAAA,EAEL,KAAK,CAAC,cAAc,EAAE,CAAC,MAAM,mBAC7B,KAAK,CAAC,WAAW,EAAE,gBACtB,SAAS,EAAA,EAEpB,QAAQ,CACH,CACE;AAEhB;;;;"}
|
|
@@ -11,9 +11,11 @@ require('../../../../../theme/modules/shadows.cjs');
|
|
|
11
11
|
require('../../../../../theme/modules/sizes.cjs');
|
|
12
12
|
require('../../../../../theme/modules/text.cjs');
|
|
13
13
|
require('styled-components');
|
|
14
|
-
require('
|
|
14
|
+
require('framer-motion');
|
|
15
|
+
require('../../../../Tooltip/components/styled.cjs');
|
|
16
|
+
require('../../../../Tooltip/components/TooltipPopover.cjs');
|
|
17
|
+
require('react-dom');
|
|
15
18
|
require('../../../../Text/Text.cjs');
|
|
16
|
-
require('../../../../Checkbox/styled.cjs');
|
|
17
19
|
require('../../../../Radio/Radio.cjs');
|
|
18
20
|
var Resizer = require('../Resizer/Resizer.cjs');
|
|
19
21
|
var HeaderCell_module = require('./HeaderCell.module.scss.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderCell.cjs","sources":["../../../../../../src/components/DataGrid/components/Header/HeaderCell/HeaderCell.tsx"],"sourcesContent":["import React, { CSSProperties } from 'react';\n\nimport { flexRender, Header, SortDirection, Table } from '@tanstack/react-table';\n\nimport { buildClassnames } from '../../../../../utils';\n\nimport { usePinnedColumnStyles } from '../../../hooks';\nimport { isLastColumn } from '../../../utils';\n\nimport { Resizer } from '../Resizer';\nimport styles from './HeaderCell.module.scss';\n\nimport { SortIcon } from './SortIcon';\n\ntype HeaderCellProps = {\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * The Header within the TanStack Table instance.\n */\n header: Header<any, any>;\n\n /**\n * The index of this header in the grid.\n */\n index: number;\n};\n\nconst getAriaSort = (sortDirection: false | SortDirection) => {\n if (!sortDirection) {\n return undefined;\n }\n\n return sortDirection === 'asc' ? 'ascending' : 'descending';\n};\n\n/**\n * A header cell within the DataGrid component. Responsible for rendering the column header and resize bar,\n * if resizing is enabled.\n */\nexport const HeaderCell = ({ table, header, index }: HeaderCellProps) => {\n const { justifyContent, textAlign, getAriaLabel } = header.column.columnDef.meta!;\n const headerRenderer = header.column.columnDef.header;\n\n const sortable = table.options.enableSorting && header.column.getCanSort();\n const isSorted = header.column.getIsSorted();\n const ariaSort = getAriaSort(isSorted);\n\n const resizeable =\n table.options.enableColumnResizing &&\n header.column.getCanResize() &&\n !isLastColumn(table, header.column); // Last column can't be resized since it occupies all remaining space.\n\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({\n column: header.column,\n });\n\n const headerCellClassname = buildClassnames([\n styles.headerCell,\n pinnedCellClassName,\n 'data-grid-header-cell',\n ]);\n\n const HeaderContents = flexRender(headerRenderer, header.getContext());\n const HeaderContentComponent = sortable ? 'button' : 'div';\n const headerContentClassname = buildClassnames([\n sortable ? styles.clickableHeaderContent : styles.headerContent,\n 'data-grid-header-content',\n ]);\n const headerContentProps = {\n justifyContent,\n textAlign,\n } as CSSProperties;\n\n return (\n <th\n className={headerCellClassname}\n role=\"columnheader\"\n scope=\"col\"\n aria-colindex={index + 1}\n aria-label={getAriaLabel?.()}\n style={pinnedCellStyles}\n aria-sort={ariaSort}\n >\n {/* Header content */}\n <HeaderContentComponent\n className={headerContentClassname}\n style={headerContentProps}\n onClick={sortable ? header.column.getToggleSortingHandler() : undefined}\n >\n {/* If we've been given just text to render, apply styles for text overflow */}\n {typeof headerRenderer === 'string' ? (\n <span className={styles.headerOverflow}>{HeaderContents}</span>\n ) : (\n HeaderContents\n )}\n\n {sortable && <SortIcon isSorted={isSorted} />}\n </HeaderContentComponent>\n\n {/* Column resizer */}\n {resizeable && (\n <Resizer\n getIsResizing={header.column.getIsResizing}\n getResizeHandler={header.getResizeHandler()}\n resetSize={header.column.resetSize}\n deltaOffset={\n table.options.columnResizeMode === 'onChange'\n ? null\n : table.getState().columnSizingInfo.deltaOffset\n }\n />\n )}\n </th>\n );\n};\n"],"names":["isLastColumn","usePinnedColumnStyles","buildClassnames","styles","flexRender","React","SortIcon","Resizer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"HeaderCell.cjs","sources":["../../../../../../src/components/DataGrid/components/Header/HeaderCell/HeaderCell.tsx"],"sourcesContent":["import React, { CSSProperties } from 'react';\n\nimport { flexRender, Header, SortDirection, Table } from '@tanstack/react-table';\n\nimport { buildClassnames } from '../../../../../utils';\n\nimport { usePinnedColumnStyles } from '../../../hooks';\nimport { isLastColumn } from '../../../utils';\n\nimport { Resizer } from '../Resizer';\nimport styles from './HeaderCell.module.scss';\n\nimport { SortIcon } from './SortIcon';\n\ntype HeaderCellProps = {\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * The Header within the TanStack Table instance.\n */\n header: Header<any, any>;\n\n /**\n * The index of this header in the grid.\n */\n index: number;\n};\n\nconst getAriaSort = (sortDirection: false | SortDirection) => {\n if (!sortDirection) {\n return undefined;\n }\n\n return sortDirection === 'asc' ? 'ascending' : 'descending';\n};\n\n/**\n * A header cell within the DataGrid component. Responsible for rendering the column header and resize bar,\n * if resizing is enabled.\n */\nexport const HeaderCell = ({ table, header, index }: HeaderCellProps) => {\n const { justifyContent, textAlign, getAriaLabel } = header.column.columnDef.meta!;\n const headerRenderer = header.column.columnDef.header;\n\n const sortable = table.options.enableSorting && header.column.getCanSort();\n const isSorted = header.column.getIsSorted();\n const ariaSort = getAriaSort(isSorted);\n\n const resizeable =\n table.options.enableColumnResizing &&\n header.column.getCanResize() &&\n !isLastColumn(table, header.column); // Last column can't be resized since it occupies all remaining space.\n\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({\n column: header.column,\n });\n\n const headerCellClassname = buildClassnames([\n styles.headerCell,\n pinnedCellClassName,\n 'data-grid-header-cell',\n ]);\n\n const HeaderContents = flexRender(headerRenderer, header.getContext());\n const HeaderContentComponent = sortable ? 'button' : 'div';\n const headerContentClassname = buildClassnames([\n sortable ? styles.clickableHeaderContent : styles.headerContent,\n 'data-grid-header-content',\n ]);\n const headerContentProps = {\n justifyContent,\n textAlign,\n } as CSSProperties;\n\n return (\n <th\n className={headerCellClassname}\n role=\"columnheader\"\n scope=\"col\"\n aria-colindex={index + 1}\n aria-label={getAriaLabel?.()}\n style={pinnedCellStyles}\n aria-sort={ariaSort}\n >\n {/* Header content */}\n <HeaderContentComponent\n className={headerContentClassname}\n style={headerContentProps}\n onClick={sortable ? header.column.getToggleSortingHandler() : undefined}\n >\n {/* If we've been given just text to render, apply styles for text overflow */}\n {typeof headerRenderer === 'string' ? (\n <span className={styles.headerOverflow}>{HeaderContents}</span>\n ) : (\n HeaderContents\n )}\n\n {sortable && <SortIcon isSorted={isSorted} />}\n </HeaderContentComponent>\n\n {/* Column resizer */}\n {resizeable && (\n <Resizer\n getIsResizing={header.column.getIsResizing}\n getResizeHandler={header.getResizeHandler()}\n resetSize={header.column.resetSize}\n deltaOffset={\n table.options.columnResizeMode === 'onChange'\n ? null\n : table.getState().columnSizingInfo.deltaOffset\n }\n />\n )}\n </th>\n );\n};\n"],"names":["isLastColumn","usePinnedColumnStyles","buildClassnames","styles","flexRender","React","SortIcon","Resizer"],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BAAgB,KAAK;AACjC,kBAAE;AACF,kBAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAA,CAEnD,CACH,CACE;AAET;;;;"}
|
|
@@ -9,9 +9,11 @@ import '../../../../../theme/modules/shadows.js';
|
|
|
9
9
|
import '../../../../../theme/modules/sizes.js';
|
|
10
10
|
import '../../../../../theme/modules/text.js';
|
|
11
11
|
import 'styled-components';
|
|
12
|
-
import '
|
|
12
|
+
import 'framer-motion';
|
|
13
|
+
import '../../../../Tooltip/components/styled.js';
|
|
14
|
+
import '../../../../Tooltip/components/TooltipPopover.js';
|
|
15
|
+
import 'react-dom';
|
|
13
16
|
import '../../../../Text/Text.js';
|
|
14
|
-
import '../../../../Checkbox/styled.js';
|
|
15
17
|
import '../../../../Radio/Radio.js';
|
|
16
18
|
import { Resizer } from '../Resizer/Resizer.js';
|
|
17
19
|
import styles from './HeaderCell.module.scss.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderCell.js","sources":["../../../../../../src/components/DataGrid/components/Header/HeaderCell/HeaderCell.tsx"],"sourcesContent":["import React, { CSSProperties } from 'react';\n\nimport { flexRender, Header, SortDirection, Table } from '@tanstack/react-table';\n\nimport { buildClassnames } from '../../../../../utils';\n\nimport { usePinnedColumnStyles } from '../../../hooks';\nimport { isLastColumn } from '../../../utils';\n\nimport { Resizer } from '../Resizer';\nimport styles from './HeaderCell.module.scss';\n\nimport { SortIcon } from './SortIcon';\n\ntype HeaderCellProps = {\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * The Header within the TanStack Table instance.\n */\n header: Header<any, any>;\n\n /**\n * The index of this header in the grid.\n */\n index: number;\n};\n\nconst getAriaSort = (sortDirection: false | SortDirection) => {\n if (!sortDirection) {\n return undefined;\n }\n\n return sortDirection === 'asc' ? 'ascending' : 'descending';\n};\n\n/**\n * A header cell within the DataGrid component. Responsible for rendering the column header and resize bar,\n * if resizing is enabled.\n */\nexport const HeaderCell = ({ table, header, index }: HeaderCellProps) => {\n const { justifyContent, textAlign, getAriaLabel } = header.column.columnDef.meta!;\n const headerRenderer = header.column.columnDef.header;\n\n const sortable = table.options.enableSorting && header.column.getCanSort();\n const isSorted = header.column.getIsSorted();\n const ariaSort = getAriaSort(isSorted);\n\n const resizeable =\n table.options.enableColumnResizing &&\n header.column.getCanResize() &&\n !isLastColumn(table, header.column); // Last column can't be resized since it occupies all remaining space.\n\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({\n column: header.column,\n });\n\n const headerCellClassname = buildClassnames([\n styles.headerCell,\n pinnedCellClassName,\n 'data-grid-header-cell',\n ]);\n\n const HeaderContents = flexRender(headerRenderer, header.getContext());\n const HeaderContentComponent = sortable ? 'button' : 'div';\n const headerContentClassname = buildClassnames([\n sortable ? styles.clickableHeaderContent : styles.headerContent,\n 'data-grid-header-content',\n ]);\n const headerContentProps = {\n justifyContent,\n textAlign,\n } as CSSProperties;\n\n return (\n <th\n className={headerCellClassname}\n role=\"columnheader\"\n scope=\"col\"\n aria-colindex={index + 1}\n aria-label={getAriaLabel?.()}\n style={pinnedCellStyles}\n aria-sort={ariaSort}\n >\n {/* Header content */}\n <HeaderContentComponent\n className={headerContentClassname}\n style={headerContentProps}\n onClick={sortable ? header.column.getToggleSortingHandler() : undefined}\n >\n {/* If we've been given just text to render, apply styles for text overflow */}\n {typeof headerRenderer === 'string' ? (\n <span className={styles.headerOverflow}>{HeaderContents}</span>\n ) : (\n HeaderContents\n )}\n\n {sortable && <SortIcon isSorted={isSorted} />}\n </HeaderContentComponent>\n\n {/* Column resizer */}\n {resizeable && (\n <Resizer\n getIsResizing={header.column.getIsResizing}\n getResizeHandler={header.getResizeHandler()}\n resetSize={header.column.resetSize}\n deltaOffset={\n table.options.columnResizeMode === 'onChange'\n ? null\n : table.getState().columnSizingInfo.deltaOffset\n }\n />\n )}\n </th>\n );\n};\n"],"names":["React"],"mappings":"
|
|
1
|
+
{"version":3,"file":"HeaderCell.js","sources":["../../../../../../src/components/DataGrid/components/Header/HeaderCell/HeaderCell.tsx"],"sourcesContent":["import React, { CSSProperties } from 'react';\n\nimport { flexRender, Header, SortDirection, Table } from '@tanstack/react-table';\n\nimport { buildClassnames } from '../../../../../utils';\n\nimport { usePinnedColumnStyles } from '../../../hooks';\nimport { isLastColumn } from '../../../utils';\n\nimport { Resizer } from '../Resizer';\nimport styles from './HeaderCell.module.scss';\n\nimport { SortIcon } from './SortIcon';\n\ntype HeaderCellProps = {\n /**\n * The TanStack Table instance.\n */\n table: Table<any>;\n\n /**\n * The Header within the TanStack Table instance.\n */\n header: Header<any, any>;\n\n /**\n * The index of this header in the grid.\n */\n index: number;\n};\n\nconst getAriaSort = (sortDirection: false | SortDirection) => {\n if (!sortDirection) {\n return undefined;\n }\n\n return sortDirection === 'asc' ? 'ascending' : 'descending';\n};\n\n/**\n * A header cell within the DataGrid component. Responsible for rendering the column header and resize bar,\n * if resizing is enabled.\n */\nexport const HeaderCell = ({ table, header, index }: HeaderCellProps) => {\n const { justifyContent, textAlign, getAriaLabel } = header.column.columnDef.meta!;\n const headerRenderer = header.column.columnDef.header;\n\n const sortable = table.options.enableSorting && header.column.getCanSort();\n const isSorted = header.column.getIsSorted();\n const ariaSort = getAriaSort(isSorted);\n\n const resizeable =\n table.options.enableColumnResizing &&\n header.column.getCanResize() &&\n !isLastColumn(table, header.column); // Last column can't be resized since it occupies all remaining space.\n\n const { pinnedCellClassName, pinnedCellStyles } = usePinnedColumnStyles({\n column: header.column,\n });\n\n const headerCellClassname = buildClassnames([\n styles.headerCell,\n pinnedCellClassName,\n 'data-grid-header-cell',\n ]);\n\n const HeaderContents = flexRender(headerRenderer, header.getContext());\n const HeaderContentComponent = sortable ? 'button' : 'div';\n const headerContentClassname = buildClassnames([\n sortable ? styles.clickableHeaderContent : styles.headerContent,\n 'data-grid-header-content',\n ]);\n const headerContentProps = {\n justifyContent,\n textAlign,\n } as CSSProperties;\n\n return (\n <th\n className={headerCellClassname}\n role=\"columnheader\"\n scope=\"col\"\n aria-colindex={index + 1}\n aria-label={getAriaLabel?.()}\n style={pinnedCellStyles}\n aria-sort={ariaSort}\n >\n {/* Header content */}\n <HeaderContentComponent\n className={headerContentClassname}\n style={headerContentProps}\n onClick={sortable ? header.column.getToggleSortingHandler() : undefined}\n >\n {/* If we've been given just text to render, apply styles for text overflow */}\n {typeof headerRenderer === 'string' ? (\n <span className={styles.headerOverflow}>{HeaderContents}</span>\n ) : (\n HeaderContents\n )}\n\n {sortable && <SortIcon isSorted={isSorted} />}\n </HeaderContentComponent>\n\n {/* Column resizer */}\n {resizeable && (\n <Resizer\n getIsResizing={header.column.getIsResizing}\n getResizeHandler={header.getResizeHandler()}\n resetSize={header.column.resetSize}\n deltaOffset={\n table.options.columnResizeMode === 'onChange'\n ? null\n : table.getState().columnSizingInfo.deltaOffset\n }\n />\n )}\n </th>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,WAAW,GAAG,CAAC,aAAoC,KAAI;IAC3D,IAAI,CAAC,aAAa,EAAE;AAClB,QAAA,OAAO,SAAS;AACjB,IAAA;IAED,OAAO,aAAa,KAAK,KAAK,GAAG,WAAW,GAAG,YAAY;AAC7D,CAAC;AAED;;;AAGG;AACI,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAmB,KAAI;AACtE,IAAA,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,IAAK;IACjF,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM;AAErD,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;IAC1E,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;AAC5C,IAAA,MAAM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,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,GAAG,SAAS,EAAA;YAGtE,OAAO,cAAc,KAAK,QAAQ,IACjCA,cAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,MAAM,CAAC,cAAc,EAAA,EAAG,cAAc,CAAQ,KAE/D,cAAc,CACf;YAEA,QAAQ,IAAIA,6BAAC,QAAQ,EAAA,EAAC,QAAQ,EAAE,QAAQ,GAAI,CACtB;AAGxB,QAAA,UAAU,KACTA,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EACN,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,EAC1C,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EAAE,EAC3C,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,EAClC,WAAW,EACT,KAAK,CAAC,OAAO,CAAC,gBAAgB,KAAK;AACjC,kBAAE;AACF,kBAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAA,CAEnD,CACH,CACE;AAET;;;;"}
|
|
@@ -42,7 +42,6 @@ const DimensionsInput = withLabels.withLabels(({ size = 'base', handleChangeHeig
|
|
|
42
42
|
},
|
|
43
43
|
inputAffix: {
|
|
44
44
|
compact,
|
|
45
|
-
hasError,
|
|
46
45
|
},
|
|
47
46
|
};
|
|
48
47
|
return (React__default.default.createElement(Stack.Stack, { direction: "horizontal", alignY: "center", className: className },
|