@veeqo/ui 13.6.0 → 13.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alerts/Alert/Alert.cjs +1 -1
- package/dist/components/Alerts/Alert/Alert.cjs.map +1 -1
- package/dist/components/Alerts/Alert/Alert.js +1 -1
- package/dist/components/Alerts/Alert/Alert.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +3 -1
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/DataTable/components/SelectionCell.cjs +11 -2
- package/dist/components/DataTable/components/SelectionCell.cjs.map +1 -1
- package/dist/components/DataTable/components/SelectionCell.d.ts +2 -2
- package/dist/components/DataTable/components/SelectionCell.js +12 -3
- package/dist/components/DataTable/components/SelectionCell.js.map +1 -1
- package/dist/components/DataTable/hooks/useSelection.cjs +40 -17
- package/dist/components/DataTable/hooks/useSelection.cjs.map +1 -1
- package/dist/components/DataTable/hooks/useSelection.js +41 -18
- package/dist/components/DataTable/hooks/useSelection.js.map +1 -1
- package/dist/components/DataTable/types.cjs.map +1 -1
- package/dist/components/DataTable/types.d.ts +4 -1
- package/dist/components/DataTable/types.js.map +1 -1
- package/dist/components/DataTable/utils/getRangeSelection.cjs +18 -0
- package/dist/components/DataTable/utils/getRangeSelection.cjs.map +1 -0
- package/dist/components/DataTable/utils/getRangeSelection.d.ts +10 -0
- package/dist/components/DataTable/utils/getRangeSelection.js +16 -0
- package/dist/components/DataTable/utils/getRangeSelection.js.map +1 -0
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ const Alert = ({ size = 'base', variant = 'default', colours: passedColours, rig
|
|
|
25
25
|
Alert_module[`${size}-size`],
|
|
26
26
|
Alerts_module[`${variant}-alert-variant`],
|
|
27
27
|
className,
|
|
28
|
-
]), flexWrap: "nowrap", ...divProps },
|
|
28
|
+
]), style: assignCssVars.assignCssVars({ backgroundColor: passedColours === null || passedColours === undefined ? undefined : passedColours.background }), flexWrap: "nowrap", ...divProps },
|
|
29
29
|
React__default.default.createElement(FlexRow.FlexRow, { alignItems: isXsSize ? 'center' : 'flex-start', flexWrap: "nowrap", className: Alert_module.iconTextContainer },
|
|
30
30
|
React__default.default.createElement(FlexRow.FlexRow, { style: assignCssVars.assignCssVars({ iconColor: passedColours === null || passedColours === undefined ? undefined : passedColours.primary }), className: Alerts_module.icon, alignItems: "flex-start" }, iconSlot || React__default.default.createElement(DefaultIcon, { role: "presentation" })),
|
|
31
31
|
children || (React__default.default.createElement(FlexCol.FlexCol, { gap: isXsSize ? 'xs' : 'sm' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.cjs","sources":["../../../../src/components/Alerts/Alert/Alert.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Text } from '../../Text';\nimport { Button } from '../../Button';\nimport { CrossIcon } from '../../../icons';\nimport { IconMap } from '../constants';\nimport { AlertProps } from './types';\nimport { FlexRow } from '../../Flex/FlexRow';\nimport { FlexCol } from '../../Flex/FlexCol';\nimport { assignCssVars, buildClassnames } from '../../../utils';\n\nimport alertStyles from '../Alerts.module.scss';\nimport styles from './Alert.module.scss';\n\nexport const Alert = ({\n size = 'base',\n variant = 'default',\n colours: passedColours,\n rightActions,\n rightActionsSlot,\n title,\n titleSlot,\n messageSlot,\n message,\n children,\n iconSlot,\n onClickClose,\n className,\n ...divProps\n}: AlertProps) => {\n const DefaultIcon = IconMap[variant];\n\n const isXsSize = size === 'xs';\n\n return (\n <FlexRow\n justifyContent=\"space-between\"\n className={buildClassnames([\n styles.alertContainer,\n styles[`${size}-size`],\n alertStyles[`${variant}-alert-variant`],\n className,\n ])}\n flexWrap=\"nowrap\"\n {...divProps}\n >\n <FlexRow\n alignItems={isXsSize ? 'center' : 'flex-start'}\n flexWrap=\"nowrap\"\n className={styles.iconTextContainer}\n >\n <FlexRow\n style={assignCssVars({ iconColor: passedColours?.primary })}\n className={alertStyles.icon}\n alignItems=\"flex-start\"\n >\n {iconSlot || <DefaultIcon role=\"presentation\" />}\n </FlexRow>\n\n {children || (\n <FlexCol gap={isXsSize ? 'xs' : 'sm'}>\n {titleSlot || (\n <Text variant=\"bodyBold\" style={size === 'base' ? { lineHeight: '24px' } : {}}>\n {title}\n </Text>\n )}\n {messageSlot || <Text variant=\"body\">{message}</Text>}\n </FlexCol>\n )}\n </FlexRow>\n\n <FlexRow justifyContent=\"flex-end\" flexWrap=\"nowrap\" className={styles.rightActionsContainer}>\n {rightActionsSlot}\n\n {rightActions && (\n <FlexCol justifyContent=\"center\" className={styles.rightActions}>\n {rightActions.map(({ label, ...actionProps }) => (\n <Button key={label} type=\"button\" size=\"sm\" {...actionProps}>\n {label}\n </Button>\n ))}\n </FlexCol>\n )}\n\n {onClickClose && (\n <FlexCol className={styles.closeContainer}>\n <Button\n variant=\"flat\"\n iconSlot={<CrossIcon />}\n onClick={onClickClose}\n aria-label=\"Close\"\n size=\"sm\"\n />\n </FlexCol>\n )}\n </FlexRow>\n </FlexRow>\n );\n};\n"],"names":["IconMap","React","FlexRow","buildClassnames","styles","alertStyles","assignCssVars","FlexCol","Text","Button","CrossIcon"],"mappings":";;;;;;;;;;;;;;;;;;;AAca,MAAA,KAAK,GAAG,CAAC,EACpB,IAAI,GAAG,MAAM,EACb,OAAO,GAAG,SAAS,EACnB,OAAO,EAAE,aAAa,EACtB,YAAY,EACZ,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,WAAW,EACX,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,GAAG,QAAQ,EACA,KAAI;AACf,IAAA,MAAM,WAAW,GAAGA,iBAAO,CAAC,OAAO,CAAC;AAEpC,IAAA,MAAM,QAAQ,GAAG,IAAI,KAAK,IAAI;IAE9B,QACEC,sBAAC,CAAA,aAAA,CAAAC,eAAO,EACN,EAAA,cAAc,EAAC,eAAe,EAC9B,SAAS,EAAEC,+BAAe,CAAC;AACzB,YAAAC,YAAM,CAAC,cAAc;AACrB,YAAAA,YAAM,CAAC,CAAA,EAAG,IAAI,CAAA,KAAA,CAAO,CAAC;AACtB,YAAAC,aAAW,CAAC,CAAA,EAAG,OAAO,CAAA,cAAA,CAAgB,CAAC;YACvC,SAAS;
|
|
1
|
+
{"version":3,"file":"Alert.cjs","sources":["../../../../src/components/Alerts/Alert/Alert.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Text } from '../../Text';\nimport { Button } from '../../Button';\nimport { CrossIcon } from '../../../icons';\nimport { IconMap } from '../constants';\nimport { AlertProps } from './types';\nimport { FlexRow } from '../../Flex/FlexRow';\nimport { FlexCol } from '../../Flex/FlexCol';\nimport { assignCssVars, buildClassnames } from '../../../utils';\n\nimport alertStyles from '../Alerts.module.scss';\nimport styles from './Alert.module.scss';\n\nexport const Alert = ({\n size = 'base',\n variant = 'default',\n colours: passedColours,\n rightActions,\n rightActionsSlot,\n title,\n titleSlot,\n messageSlot,\n message,\n children,\n iconSlot,\n onClickClose,\n className,\n ...divProps\n}: AlertProps) => {\n const DefaultIcon = IconMap[variant];\n\n const isXsSize = size === 'xs';\n\n return (\n <FlexRow\n justifyContent=\"space-between\"\n className={buildClassnames([\n styles.alertContainer,\n styles[`${size}-size`],\n alertStyles[`${variant}-alert-variant`],\n className,\n ])}\n style={assignCssVars({ backgroundColor: passedColours?.background })}\n flexWrap=\"nowrap\"\n {...divProps}\n >\n <FlexRow\n alignItems={isXsSize ? 'center' : 'flex-start'}\n flexWrap=\"nowrap\"\n className={styles.iconTextContainer}\n >\n <FlexRow\n style={assignCssVars({ iconColor: passedColours?.primary })}\n className={alertStyles.icon}\n alignItems=\"flex-start\"\n >\n {iconSlot || <DefaultIcon role=\"presentation\" />}\n </FlexRow>\n\n {children || (\n <FlexCol gap={isXsSize ? 'xs' : 'sm'}>\n {titleSlot || (\n <Text variant=\"bodyBold\" style={size === 'base' ? { lineHeight: '24px' } : {}}>\n {title}\n </Text>\n )}\n {messageSlot || <Text variant=\"body\">{message}</Text>}\n </FlexCol>\n )}\n </FlexRow>\n\n <FlexRow justifyContent=\"flex-end\" flexWrap=\"nowrap\" className={styles.rightActionsContainer}>\n {rightActionsSlot}\n\n {rightActions && (\n <FlexCol justifyContent=\"center\" className={styles.rightActions}>\n {rightActions.map(({ label, ...actionProps }) => (\n <Button key={label} type=\"button\" size=\"sm\" {...actionProps}>\n {label}\n </Button>\n ))}\n </FlexCol>\n )}\n\n {onClickClose && (\n <FlexCol className={styles.closeContainer}>\n <Button\n variant=\"flat\"\n iconSlot={<CrossIcon />}\n onClick={onClickClose}\n aria-label=\"Close\"\n size=\"sm\"\n />\n </FlexCol>\n )}\n </FlexRow>\n </FlexRow>\n );\n};\n"],"names":["IconMap","React","FlexRow","buildClassnames","styles","alertStyles","assignCssVars","FlexCol","Text","Button","CrossIcon"],"mappings":";;;;;;;;;;;;;;;;;;;AAca,MAAA,KAAK,GAAG,CAAC,EACpB,IAAI,GAAG,MAAM,EACb,OAAO,GAAG,SAAS,EACnB,OAAO,EAAE,aAAa,EACtB,YAAY,EACZ,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,WAAW,EACX,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,GAAG,QAAQ,EACA,KAAI;AACf,IAAA,MAAM,WAAW,GAAGA,iBAAO,CAAC,OAAO,CAAC;AAEpC,IAAA,MAAM,QAAQ,GAAG,IAAI,KAAK,IAAI;IAE9B,QACEC,sBAAC,CAAA,aAAA,CAAAC,eAAO,EACN,EAAA,cAAc,EAAC,eAAe,EAC9B,SAAS,EAAEC,+BAAe,CAAC;AACzB,YAAAC,YAAM,CAAC,cAAc;AACrB,YAAAA,YAAM,CAAC,CAAA,EAAG,IAAI,CAAA,KAAA,CAAO,CAAC;AACtB,YAAAC,aAAW,CAAC,CAAA,EAAG,OAAO,CAAA,cAAA,CAAgB,CAAC;YACvC,SAAS;SACV,CAAC,EACF,KAAK,EAAEC,2BAAa,CAAC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hB,YAAY,KACXH,sBAAA,CAAA,aAAA,CAACM,eAAO,EAAA,EAAC,cAAc,EAAC,QAAQ,EAAC,SAAS,EAAEH,YAAM,CAAC,YAAY,EAAA,EAC5D,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,MAC1CH,sBAAA,CAAA,aAAA,CAACQ,aAAM,EAAA,EAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAA,GAAK,WAAW,EAAA,EACxD,KAAK,CACC,CACV,CAAC,CACM,CACX;YAEA,YAAY,KACXR,sBAAC,CAAA,aAAA,CAAAM,eAAO,IAAC,SAAS,EAAEH,YAAM,CAAC,cAAc,EAAA;gBACvCH,sBAAC,CAAA,aAAA,CAAAQ,aAAM,EACL,EAAA,OAAO,EAAC,MAAM,EACd,QAAQ,EAAER,sBAAA,CAAA,aAAA,CAACS,wBAAS,EAAA,IAAA,CAAG,EACvB,OAAO,EAAE,YAAY,EACV,YAAA,EAAA,OAAO,EAClB,IAAI,EAAC,IAAI,EACT,CAAA,CACM,CACX,CACO,CACF;AAEd;;;;"}
|
|
@@ -19,7 +19,7 @@ const Alert = ({ size = 'base', variant = 'default', colours: passedColours, rig
|
|
|
19
19
|
styles[`${size}-size`],
|
|
20
20
|
alertStyles[`${variant}-alert-variant`],
|
|
21
21
|
className,
|
|
22
|
-
]), flexWrap: "nowrap", ...divProps },
|
|
22
|
+
]), style: assignCssVars({ backgroundColor: passedColours === null || passedColours === undefined ? undefined : passedColours.background }), flexWrap: "nowrap", ...divProps },
|
|
23
23
|
React__default.createElement(FlexRow, { alignItems: isXsSize ? 'center' : 'flex-start', flexWrap: "nowrap", className: styles.iconTextContainer },
|
|
24
24
|
React__default.createElement(FlexRow, { style: assignCssVars({ iconColor: passedColours === null || passedColours === undefined ? undefined : passedColours.primary }), className: alertStyles.icon, alignItems: "flex-start" }, iconSlot || React__default.createElement(DefaultIcon, { role: "presentation" })),
|
|
25
25
|
children || (React__default.createElement(FlexCol, { gap: isXsSize ? 'xs' : 'sm' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../../../src/components/Alerts/Alert/Alert.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Text } from '../../Text';\nimport { Button } from '../../Button';\nimport { CrossIcon } from '../../../icons';\nimport { IconMap } from '../constants';\nimport { AlertProps } from './types';\nimport { FlexRow } from '../../Flex/FlexRow';\nimport { FlexCol } from '../../Flex/FlexCol';\nimport { assignCssVars, buildClassnames } from '../../../utils';\n\nimport alertStyles from '../Alerts.module.scss';\nimport styles from './Alert.module.scss';\n\nexport const Alert = ({\n size = 'base',\n variant = 'default',\n colours: passedColours,\n rightActions,\n rightActionsSlot,\n title,\n titleSlot,\n messageSlot,\n message,\n children,\n iconSlot,\n onClickClose,\n className,\n ...divProps\n}: AlertProps) => {\n const DefaultIcon = IconMap[variant];\n\n const isXsSize = size === 'xs';\n\n return (\n <FlexRow\n justifyContent=\"space-between\"\n className={buildClassnames([\n styles.alertContainer,\n styles[`${size}-size`],\n alertStyles[`${variant}-alert-variant`],\n className,\n ])}\n flexWrap=\"nowrap\"\n {...divProps}\n >\n <FlexRow\n alignItems={isXsSize ? 'center' : 'flex-start'}\n flexWrap=\"nowrap\"\n className={styles.iconTextContainer}\n >\n <FlexRow\n style={assignCssVars({ iconColor: passedColours?.primary })}\n className={alertStyles.icon}\n alignItems=\"flex-start\"\n >\n {iconSlot || <DefaultIcon role=\"presentation\" />}\n </FlexRow>\n\n {children || (\n <FlexCol gap={isXsSize ? 'xs' : 'sm'}>\n {titleSlot || (\n <Text variant=\"bodyBold\" style={size === 'base' ? { lineHeight: '24px' } : {}}>\n {title}\n </Text>\n )}\n {messageSlot || <Text variant=\"body\">{message}</Text>}\n </FlexCol>\n )}\n </FlexRow>\n\n <FlexRow justifyContent=\"flex-end\" flexWrap=\"nowrap\" className={styles.rightActionsContainer}>\n {rightActionsSlot}\n\n {rightActions && (\n <FlexCol justifyContent=\"center\" className={styles.rightActions}>\n {rightActions.map(({ label, ...actionProps }) => (\n <Button key={label} type=\"button\" size=\"sm\" {...actionProps}>\n {label}\n </Button>\n ))}\n </FlexCol>\n )}\n\n {onClickClose && (\n <FlexCol className={styles.closeContainer}>\n <Button\n variant=\"flat\"\n iconSlot={<CrossIcon />}\n onClick={onClickClose}\n aria-label=\"Close\"\n size=\"sm\"\n />\n </FlexCol>\n )}\n </FlexRow>\n </FlexRow>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;AAca,MAAA,KAAK,GAAG,CAAC,EACpB,IAAI,GAAG,MAAM,EACb,OAAO,GAAG,SAAS,EACnB,OAAO,EAAE,aAAa,EACtB,YAAY,EACZ,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,WAAW,EACX,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,GAAG,QAAQ,EACA,KAAI;AACf,IAAA,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;AAEpC,IAAA,MAAM,QAAQ,GAAG,IAAI,KAAK,IAAI;IAE9B,QACEA,cAAC,CAAA,aAAA,CAAA,OAAO,EACN,EAAA,cAAc,EAAC,eAAe,EAC9B,SAAS,EAAE,eAAe,CAAC;AACzB,YAAA,MAAM,CAAC,cAAc;AACrB,YAAA,MAAM,CAAC,CAAA,EAAG,IAAI,CAAA,KAAA,CAAO,CAAC;AACtB,YAAA,WAAW,CAAC,CAAA,EAAG,OAAO,CAAA,cAAA,CAAgB,CAAC;YACvC,SAAS;
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../../../src/components/Alerts/Alert/Alert.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Text } from '../../Text';\nimport { Button } from '../../Button';\nimport { CrossIcon } from '../../../icons';\nimport { IconMap } from '../constants';\nimport { AlertProps } from './types';\nimport { FlexRow } from '../../Flex/FlexRow';\nimport { FlexCol } from '../../Flex/FlexCol';\nimport { assignCssVars, buildClassnames } from '../../../utils';\n\nimport alertStyles from '../Alerts.module.scss';\nimport styles from './Alert.module.scss';\n\nexport const Alert = ({\n size = 'base',\n variant = 'default',\n colours: passedColours,\n rightActions,\n rightActionsSlot,\n title,\n titleSlot,\n messageSlot,\n message,\n children,\n iconSlot,\n onClickClose,\n className,\n ...divProps\n}: AlertProps) => {\n const DefaultIcon = IconMap[variant];\n\n const isXsSize = size === 'xs';\n\n return (\n <FlexRow\n justifyContent=\"space-between\"\n className={buildClassnames([\n styles.alertContainer,\n styles[`${size}-size`],\n alertStyles[`${variant}-alert-variant`],\n className,\n ])}\n style={assignCssVars({ backgroundColor: passedColours?.background })}\n flexWrap=\"nowrap\"\n {...divProps}\n >\n <FlexRow\n alignItems={isXsSize ? 'center' : 'flex-start'}\n flexWrap=\"nowrap\"\n className={styles.iconTextContainer}\n >\n <FlexRow\n style={assignCssVars({ iconColor: passedColours?.primary })}\n className={alertStyles.icon}\n alignItems=\"flex-start\"\n >\n {iconSlot || <DefaultIcon role=\"presentation\" />}\n </FlexRow>\n\n {children || (\n <FlexCol gap={isXsSize ? 'xs' : 'sm'}>\n {titleSlot || (\n <Text variant=\"bodyBold\" style={size === 'base' ? { lineHeight: '24px' } : {}}>\n {title}\n </Text>\n )}\n {messageSlot || <Text variant=\"body\">{message}</Text>}\n </FlexCol>\n )}\n </FlexRow>\n\n <FlexRow justifyContent=\"flex-end\" flexWrap=\"nowrap\" className={styles.rightActionsContainer}>\n {rightActionsSlot}\n\n {rightActions && (\n <FlexCol justifyContent=\"center\" className={styles.rightActions}>\n {rightActions.map(({ label, ...actionProps }) => (\n <Button key={label} type=\"button\" size=\"sm\" {...actionProps}>\n {label}\n </Button>\n ))}\n </FlexCol>\n )}\n\n {onClickClose && (\n <FlexCol className={styles.closeContainer}>\n <Button\n variant=\"flat\"\n iconSlot={<CrossIcon />}\n onClick={onClickClose}\n aria-label=\"Close\"\n size=\"sm\"\n />\n </FlexCol>\n )}\n </Fl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MAAM,EACd,QAAQ,EAAEA,cAAA,CAAA,aAAA,CAAC,SAAS,EAAA,IAAA,CAAG,EACvB,OAAO,EAAE,YAAY,EACV,YAAA,EAAA,OAAO,EAClB,IAAI,EAAC,IAAI,EACT,CAAA,CACM,CACX,CACO,CACF;AAEd;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.cjs","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\n\nexport type CheckboxValue = string | number;\n\nexport interface CheckboxProps extends ForwardedChoiceProps {\n id?: string;\n checked: boolean;\n indeterminate?: boolean;\n value?: CheckboxValue;\n name?: string;\n disabled?: boolean;\n ariaLabel?: string;\n onChange: (checked: boolean, value?: CheckboxValue) => void;\n className?: string;\n}\n\nexport const Checkbox = ({\n id,\n checked,\n indeterminate,\n value,\n name,\n hint,\n disabled,\n ariaLabel,\n className,\n onChange,\n ...otherProps\n}: CheckboxProps) => {\n const componentId = useMemo(() => id ?? generateId('checkbox'), [id]);\n const checkboxRef = useRef<HTMLInputElement>(null);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n useEffect(() => {\n if (!checkboxRef.current) return;\n if (indeterminate === true) {\n checkboxRef.current.indeterminate = true;\n return;\n }\n checkboxRef.current.indeterminate = false;\n }, [indeterminate]);\n\n const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;\n\n return (\n <Choice\n htmlFor={componentId}\n disabled={disabled}\n className={className}\n hint={hint}\n {...otherProps}\n >\n <Input\n ref={checkboxRef}\n id={componentId}\n type=\"checkbox\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n onChange={handleChange}\n />\n </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WAAW,EAChB,EAAE,EAAE,WAAW,EACf,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EACN,YAAA,EAAA,SAAS,EACH,kBAAA,EAAA,eAAe,EACjC,QAAQ,EAAE,YAAY,EACtB,CAAA,CACK;AAEb;;;;"}
|
|
1
|
+
{"version":3,"file":"Checkbox.cjs","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\n\nexport type CheckboxValue = string | number;\n\nexport interface CheckboxProps extends ForwardedChoiceProps {\n id?: string;\n checked: boolean;\n indeterminate?: boolean;\n value?: CheckboxValue;\n name?: string;\n disabled?: boolean;\n ariaLabel?: string;\n onChange: (checked: boolean, value?: CheckboxValue, meta?: { shiftKey?: boolean }) => void;\n className?: string;\n}\n\nexport const Checkbox = ({\n id,\n checked,\n indeterminate,\n value,\n name,\n hint,\n disabled,\n ariaLabel,\n className,\n onChange,\n ...otherProps\n}: CheckboxProps) => {\n const componentId = useMemo(() => id ?? generateId('checkbox'), [id]);\n const checkboxRef = useRef<HTMLInputElement>(null);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n useEffect(() => {\n if (!checkboxRef.current) return;\n if (indeterminate === true) {\n checkboxRef.current.indeterminate = true;\n return;\n }\n checkboxRef.current.indeterminate = false;\n }, [indeterminate]);\n\n const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;\n\n return (\n <Choice\n htmlFor={componentId}\n disabled={disabled}\n className={className}\n hint={hint}\n {...otherProps}\n >\n <Input\n ref={checkboxRef}\n id={componentId}\n type=\"checkbox\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n onChange={handleChange}\n />\n </Choice>\n );\n};\n"],"names":["useMemo","generateId","useRef","useCallback","useEffect","React","Choice","Input"],"mappings":";;;;;;;;;;;AAmBO,MAAM,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,OAAO,EACP,aAAa,EACb,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,UAAU,EACC,KAAI;IAClB,MAAM,WAAW,GAAGA,aAAO,CAAC,MAAM,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,SAAA,GAAF,EAAE,GAAIC,qBAAU,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACrE,IAAA,MAAM,WAAW,GAAGC,YAAM,CAAmB,IAAI,CAAC;AAElD,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAC9B,CAAC,CAAsC,KAAI;QACzC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC1C,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;IAEDC,eAAS,CAAC,MAAK;QACb,IAAI,CAAC,WAAW,CAAC,OAAO;YAAE;QAC1B,IAAI,aAAa,KAAK,IAAI,EAAE;AAC1B,YAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,IAAI;YACxC;AACD;AACD,QAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,KAAK;AAC3C,KAAC,EAAE,CAAC,aAAa,CAAC,CAAC;AAEnB,IAAA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAQ,KAAA,EAAA,WAAW,CAAE,CAAA,GAAG,SAAS;IAEhE,QACEC,qCAACC,aAAM,EAAA,EACL,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,KACN,UAAU,EAAA;AAEd,QAAAD,sBAAA,CAAA,aAAA,CAACE,YAAK,EACJ,EAAA,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,WAAW,EACf,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EACN,YAAA,EAAA,SAAS,EACH,kBAAA,EAAA,eAAe,EACjC,QAAQ,EAAE,YAAY,EACtB,CAAA,CACK;AAEb;;;;"}
|
|
@@ -9,7 +9,9 @@ export interface CheckboxProps extends ForwardedChoiceProps {
|
|
|
9
9
|
name?: string;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
ariaLabel?: string;
|
|
12
|
-
onChange: (checked: boolean, value?: CheckboxValue
|
|
12
|
+
onChange: (checked: boolean, value?: CheckboxValue, meta?: {
|
|
13
|
+
shiftKey?: boolean;
|
|
14
|
+
}) => void;
|
|
13
15
|
className?: string;
|
|
14
16
|
}
|
|
15
17
|
export declare const Checkbox: ({ id, checked, indeterminate, value, name, hint, disabled, ariaLabel, className, onChange, ...otherProps }: CheckboxProps) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\n\nexport type CheckboxValue = string | number;\n\nexport interface CheckboxProps extends ForwardedChoiceProps {\n id?: string;\n checked: boolean;\n indeterminate?: boolean;\n value?: CheckboxValue;\n name?: string;\n disabled?: boolean;\n ariaLabel?: string;\n onChange: (checked: boolean, value?: CheckboxValue) => void;\n className?: string;\n}\n\nexport const Checkbox = ({\n id,\n checked,\n indeterminate,\n value,\n name,\n hint,\n disabled,\n ariaLabel,\n className,\n onChange,\n ...otherProps\n}: CheckboxProps) => {\n const componentId = useMemo(() => id ?? generateId('checkbox'), [id]);\n const checkboxRef = useRef<HTMLInputElement>(null);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n useEffect(() => {\n if (!checkboxRef.current) return;\n if (indeterminate === true) {\n checkboxRef.current.indeterminate = true;\n return;\n }\n checkboxRef.current.indeterminate = false;\n }, [indeterminate]);\n\n const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;\n\n return (\n <Choice\n htmlFor={componentId}\n disabled={disabled}\n className={className}\n hint={hint}\n {...otherProps}\n >\n <Input\n ref={checkboxRef}\n id={componentId}\n type=\"checkbox\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n onChange={handleChange}\n />\n </Choice>\n );\n};\n"],"names":["React"],"mappings":";;;;;AAmBO,MAAM,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,OAAO,EACP,aAAa,EACb,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,UAAU,EACC,KAAI;IAClB,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,SAAA,GAAF,EAAE,GAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACrE,IAAA,MAAM,WAAW,GAAG,MAAM,CAAmB,IAAI,CAAC;AAElD,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,CAAsC,KAAI;QACzC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC1C,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;IAED,SAAS,CAAC,MAAK;QACb,IAAI,CAAC,WAAW,CAAC,OAAO;YAAE;QAC1B,IAAI,aAAa,KAAK,IAAI,EAAE;AAC1B,YAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,IAAI;YACxC;AACD;AACD,QAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,KAAK;AAC3C,KAAC,EAAE,CAAC,aAAa,CAAC,CAAC;AAEnB,IAAA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAQ,KAAA,EAAA,WAAW,CAAE,CAAA,GAAG,SAAS;IAEhE,QACEA,6BAAC,MAAM,EAAA,EACL,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,KACN,UAAU,EAAA;AAEd,QAAAA,cAAA,CAAA,aAAA,CAAC,KAAK,EACJ,EAAA,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,WAAW,EACf,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EACN,YAAA,EAAA,SAAS,EACH,kBAAA,EAAA,eAAe,EACjC,QAAQ,EAAE,YAAY,EACtB,CAAA,CACK;AAEb;;;;"}
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { Input } from './styled';\nimport { generateId } from '../../utils/generateId';\n\nexport type CheckboxValue = string | number;\n\nexport interface CheckboxProps extends ForwardedChoiceProps {\n id?: string;\n checked: boolean;\n indeterminate?: boolean;\n value?: CheckboxValue;\n name?: string;\n disabled?: boolean;\n ariaLabel?: string;\n onChange: (checked: boolean, value?: CheckboxValue, meta?: { shiftKey?: boolean }) => void;\n className?: string;\n}\n\nexport const Checkbox = ({\n id,\n checked,\n indeterminate,\n value,\n name,\n hint,\n disabled,\n ariaLabel,\n className,\n onChange,\n ...otherProps\n}: CheckboxProps) => {\n const componentId = useMemo(() => id ?? generateId('checkbox'), [id]);\n const checkboxRef = useRef<HTMLInputElement>(null);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n useEffect(() => {\n if (!checkboxRef.current) return;\n if (indeterminate === true) {\n checkboxRef.current.indeterminate = true;\n return;\n }\n checkboxRef.current.indeterminate = false;\n }, [indeterminate]);\n\n const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;\n\n return (\n <Choice\n htmlFor={componentId}\n disabled={disabled}\n className={className}\n hint={hint}\n {...otherProps}\n >\n <Input\n ref={checkboxRef}\n id={componentId}\n type=\"checkbox\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n onChange={handleChange}\n />\n </Choice>\n );\n};\n"],"names":["React"],"mappings":";;;;;AAmBO,MAAM,QAAQ,GAAG,CAAC,EACvB,EAAE,EACF,OAAO,EACP,aAAa,EACb,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,UAAU,EACC,KAAI;IAClB,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,SAAA,GAAF,EAAE,GAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACrE,IAAA,MAAM,WAAW,GAAG,MAAM,CAAmB,IAAI,CAAC;AAElD,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,CAAsC,KAAI;QACzC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC1C,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;IAED,SAAS,CAAC,MAAK;QACb,IAAI,CAAC,WAAW,CAAC,OAAO;YAAE;QAC1B,IAAI,aAAa,KAAK,IAAI,EAAE;AAC1B,YAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,IAAI;YACxC;AACD;AACD,QAAA,WAAW,CAAC,OAAO,CAAC,aAAa,GAAG,KAAK;AAC3C,KAAC,EAAE,CAAC,aAAa,CAAC,CAAC;AAEnB,IAAA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAQ,KAAA,EAAA,WAAW,CAAE,CAAA,GAAG,SAAS;IAEhE,QACEA,6BAAC,MAAM,EAAA,EACL,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,KACN,UAAU,EAAA;AAEd,QAAAA,cAAA,CAAA,aAAA,CAAC,KAAK,EACJ,EAAA,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,WAAW,EACf,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EACN,YAAA,EAAA,SAAS,EACH,kBAAA,EAAA,eAAe,EACjC,QAAQ,EAAE,YAAY,EACtB,CAAA,CACK;AAEb;;;;"}
|
|
@@ -10,12 +10,21 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
11
11
|
|
|
12
12
|
function SelectionCell({ selected, rowId, onChange, selectionMode, disabled, ...cellProps }) {
|
|
13
|
+
const shiftKeyRef = React.useRef(false);
|
|
14
|
+
// Detect shift on click OR space checks
|
|
15
|
+
const handleInteraction = React.useCallback((e) => {
|
|
16
|
+
shiftKeyRef.current = e.shiftKey;
|
|
17
|
+
}, []);
|
|
18
|
+
const handleChange = React.useCallback((checked) => {
|
|
19
|
+
onChange(checked, rowId, shiftKeyRef.current ? { shiftKey: true } : undefined);
|
|
20
|
+
shiftKeyRef.current = false;
|
|
21
|
+
}, [onChange, rowId]);
|
|
13
22
|
if (selectionMode === 'single') {
|
|
14
23
|
return (React__default.default.createElement(Cell.Cell, { ...cellProps },
|
|
15
24
|
React__default.default.createElement(Radio.Radio, { value: rowId, checked: selected, disabled: disabled, onChange: onChange })));
|
|
16
25
|
}
|
|
17
|
-
return (React__default.default.createElement(Cell.Cell, { ...cellProps },
|
|
18
|
-
React__default.default.createElement(Checkbox.Checkbox, { value: rowId, checked: selected, disabled: disabled, onChange:
|
|
26
|
+
return (React__default.default.createElement(Cell.Cell, { ...cellProps, onMouseDown: handleInteraction, onKeyDown: handleInteraction },
|
|
27
|
+
React__default.default.createElement(Checkbox.Checkbox, { value: rowId, checked: selected, disabled: disabled, onChange: handleChange })));
|
|
19
28
|
}
|
|
20
29
|
|
|
21
30
|
exports.SelectionCell = SelectionCell;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionCell.cjs","sources":["../../../../src/components/DataTable/components/SelectionCell.tsx"],"sourcesContent":["import React from 'react';\nimport { Checkbox } from '../../Checkbox';\nimport { Radio } from '../../Radio';\nimport { Cell, CellProps } from './Cell';\nimport { RowId, SelectionMode } from '../types';\n\nexport interface SelectionCellProps extends CellProps {\n rowId: RowId;\n selected: boolean;\n onChange:
|
|
1
|
+
{"version":3,"file":"SelectionCell.cjs","sources":["../../../../src/components/DataTable/components/SelectionCell.tsx"],"sourcesContent":["import React, { useRef, useCallback } from 'react';\nimport { Checkbox } from '../../Checkbox';\nimport { Radio } from '../../Radio';\nimport { Cell, CellProps } from './Cell';\nimport { RowId, SelectionMode, SetSelectedAction } from '../types';\n\nexport interface SelectionCellProps extends CellProps {\n rowId: RowId;\n selected: boolean;\n onChange: SetSelectedAction;\n selectionMode: SelectionMode;\n disabled: boolean;\n}\n\nexport function SelectionCell({\n selected,\n rowId,\n onChange,\n selectionMode,\n disabled,\n ...cellProps\n}: SelectionCellProps) {\n const shiftKeyRef = useRef(false);\n\n // Detect shift on click OR space checks\n const handleInteraction = useCallback((e: React.MouseEvent | React.KeyboardEvent) => {\n shiftKeyRef.current = e.shiftKey;\n }, []);\n\n const handleChange = useCallback(\n (checked: boolean) => {\n onChange(checked, rowId, shiftKeyRef.current ? { shiftKey: true } : undefined);\n shiftKeyRef.current = false;\n },\n [onChange, rowId],\n );\n\n if (selectionMode === 'single') {\n return (\n <Cell {...cellProps}>\n <Radio value={rowId} checked={selected} disabled={disabled} onChange={onChange} />\n </Cell>\n );\n }\n\n return (\n <Cell {...cellProps} onMouseDown={handleInteraction} onKeyDown={handleInteraction}>\n <Checkbox value={rowId} checked={selected} disabled={disabled} onChange={handleChange} />\n </Cell>\n );\n}\n"],"names":["useRef","useCallback","React","Cell","Radio","Checkbox"],"mappings":";;;;;;;;;;;SAcgB,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,GAAG,SAAS,EACO,EAAA;AACnB,IAAA,MAAM,WAAW,GAAGA,YAAM,CAAC,KAAK,CAAC;;AAGjC,IAAA,MAAM,iBAAiB,GAAGC,iBAAW,CAAC,CAAC,CAAyC,KAAI;AAClF,QAAA,WAAW,CAAC,OAAO,GAAG,CAAC,CAAC,QAAQ;KACjC,EAAE,EAAE,CAAC;AAEN,IAAA,MAAM,YAAY,GAAGA,iBAAW,CAC9B,CAAC,OAAgB,KAAI;QACnB,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,OAAO,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;AAC9E,QAAA,WAAW,CAAC,OAAO,GAAG,KAAK;AAC7B,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;IAED,IAAI,aAAa,KAAK,QAAQ,EAAE;AAC9B,QAAA,QACEC,sBAAA,CAAA,aAAA,CAACC,SAAI,EAAA,EAAA,GAAK,SAAS,EAAA;YACjBD,sBAAC,CAAA,aAAA,CAAAE,WAAK,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAI,CAAA,CAC7E;AAEV;AAED,IAAA,QACEF,sBAAA,CAAA,aAAA,CAACC,SAAI,EAAA,EAAA,GAAK,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,EAAA;QAC/ED,sBAAC,CAAA,aAAA,CAAAG,iBAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAI,CAAA,CACpF;AAEX;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CellProps } from './Cell';
|
|
3
|
-
import { RowId, SelectionMode } from '../types';
|
|
3
|
+
import { RowId, SelectionMode, SetSelectedAction } from '../types';
|
|
4
4
|
export interface SelectionCellProps extends CellProps {
|
|
5
5
|
rowId: RowId;
|
|
6
6
|
selected: boolean;
|
|
7
|
-
onChange:
|
|
7
|
+
onChange: SetSelectedAction;
|
|
8
8
|
selectionMode: SelectionMode;
|
|
9
9
|
disabled: boolean;
|
|
10
10
|
}
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
1
|
+
import React__default, { useRef, useCallback } from 'react';
|
|
2
2
|
import { Checkbox } from '../../Checkbox/Checkbox.js';
|
|
3
3
|
import { Radio } from '../../Radio/Radio.js';
|
|
4
4
|
import { Cell } from './Cell.js';
|
|
5
5
|
|
|
6
6
|
function SelectionCell({ selected, rowId, onChange, selectionMode, disabled, ...cellProps }) {
|
|
7
|
+
const shiftKeyRef = useRef(false);
|
|
8
|
+
// Detect shift on click OR space checks
|
|
9
|
+
const handleInteraction = useCallback((e) => {
|
|
10
|
+
shiftKeyRef.current = e.shiftKey;
|
|
11
|
+
}, []);
|
|
12
|
+
const handleChange = useCallback((checked) => {
|
|
13
|
+
onChange(checked, rowId, shiftKeyRef.current ? { shiftKey: true } : undefined);
|
|
14
|
+
shiftKeyRef.current = false;
|
|
15
|
+
}, [onChange, rowId]);
|
|
7
16
|
if (selectionMode === 'single') {
|
|
8
17
|
return (React__default.createElement(Cell, { ...cellProps },
|
|
9
18
|
React__default.createElement(Radio, { value: rowId, checked: selected, disabled: disabled, onChange: onChange })));
|
|
10
19
|
}
|
|
11
|
-
return (React__default.createElement(Cell, { ...cellProps },
|
|
12
|
-
React__default.createElement(Checkbox, { value: rowId, checked: selected, disabled: disabled, onChange:
|
|
20
|
+
return (React__default.createElement(Cell, { ...cellProps, onMouseDown: handleInteraction, onKeyDown: handleInteraction },
|
|
21
|
+
React__default.createElement(Checkbox, { value: rowId, checked: selected, disabled: disabled, onChange: handleChange })));
|
|
13
22
|
}
|
|
14
23
|
|
|
15
24
|
export { SelectionCell };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionCell.js","sources":["../../../../src/components/DataTable/components/SelectionCell.tsx"],"sourcesContent":["import React from 'react';\nimport { Checkbox } from '../../Checkbox';\nimport { Radio } from '../../Radio';\nimport { Cell, CellProps } from './Cell';\nimport { RowId, SelectionMode } from '../types';\n\nexport interface SelectionCellProps extends CellProps {\n rowId: RowId;\n selected: boolean;\n onChange:
|
|
1
|
+
{"version":3,"file":"SelectionCell.js","sources":["../../../../src/components/DataTable/components/SelectionCell.tsx"],"sourcesContent":["import React, { useRef, useCallback } from 'react';\nimport { Checkbox } from '../../Checkbox';\nimport { Radio } from '../../Radio';\nimport { Cell, CellProps } from './Cell';\nimport { RowId, SelectionMode, SetSelectedAction } from '../types';\n\nexport interface SelectionCellProps extends CellProps {\n rowId: RowId;\n selected: boolean;\n onChange: SetSelectedAction;\n selectionMode: SelectionMode;\n disabled: boolean;\n}\n\nexport function SelectionCell({\n selected,\n rowId,\n onChange,\n selectionMode,\n disabled,\n ...cellProps\n}: SelectionCellProps) {\n const shiftKeyRef = useRef(false);\n\n // Detect shift on click OR space checks\n const handleInteraction = useCallback((e: React.MouseEvent | React.KeyboardEvent) => {\n shiftKeyRef.current = e.shiftKey;\n }, []);\n\n const handleChange = useCallback(\n (checked: boolean) => {\n onChange(checked, rowId, shiftKeyRef.current ? { shiftKey: true } : undefined);\n shiftKeyRef.current = false;\n },\n [onChange, rowId],\n );\n\n if (selectionMode === 'single') {\n return (\n <Cell {...cellProps}>\n <Radio value={rowId} checked={selected} disabled={disabled} onChange={onChange} />\n </Cell>\n );\n }\n\n return (\n <Cell {...cellProps} onMouseDown={handleInteraction} onKeyDown={handleInteraction}>\n <Checkbox value={rowId} checked={selected} disabled={disabled} onChange={handleChange} />\n </Cell>\n );\n}\n"],"names":["React"],"mappings":";;;;;SAcgB,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,GAAG,SAAS,EACO,EAAA;AACnB,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC;;AAGjC,IAAA,MAAM,iBAAiB,GAAG,WAAW,CAAC,CAAC,CAAyC,KAAI;AAClF,QAAA,WAAW,CAAC,OAAO,GAAG,CAAC,CAAC,QAAQ;KACjC,EAAE,EAAE,CAAC;AAEN,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,OAAgB,KAAI;QACnB,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,OAAO,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;AAC9E,QAAA,WAAW,CAAC,OAAO,GAAG,KAAK;AAC7B,KAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB;IAED,IAAI,aAAa,KAAK,QAAQ,EAAE;AAC9B,QAAA,QACEA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAA,GAAK,SAAS,EAAA;YACjBA,cAAC,CAAA,aAAA,CAAA,KAAK,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAI,CAAA,CAC7E;AAEV;AAED,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAA,GAAK,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,EAAA;QAC/EA,cAAC,CAAA,aAAA,CAAA,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAI,CAAA,CACpF;AAEX;;;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var SelectionHeader = require('../components/SelectionHeader.cjs');
|
|
5
5
|
var SelectionCell = require('../components/SelectionCell.cjs');
|
|
6
|
+
var getRangeSelection = require('../utils/getRangeSelection.cjs');
|
|
6
7
|
|
|
7
8
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
9
|
|
|
@@ -13,31 +14,53 @@ const emptySelectionState = [[], () => { }];
|
|
|
13
14
|
function useSelection({ selectionMode = 'multiple', selectionState, enabledRowIds, }) {
|
|
14
15
|
const selectionEnabled = !!selectionState;
|
|
15
16
|
const [selectedRowIds, setSelectedRowIds] = selectionState || emptySelectionState;
|
|
17
|
+
const lastClickedRef = React.useRef(null);
|
|
16
18
|
// TODO: Memoise this
|
|
17
|
-
const setSelected = (selected, rowId) => {
|
|
19
|
+
const setSelected = (selected, rowId, options) => {
|
|
18
20
|
if (rowId === undefined || rowId === null)
|
|
19
21
|
return; // Can't use falsey, must allow number 0
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
let newRowIds;
|
|
23
|
+
let intent;
|
|
24
|
+
const isShiftPressed = options === null || options === undefined ? undefined : options.shiftKey;
|
|
25
|
+
const lastClicked = lastClickedRef.current;
|
|
26
|
+
if (isShiftPressed && lastClicked && selectionMode === 'multiple') {
|
|
27
|
+
intent = 'range';
|
|
24
28
|
}
|
|
25
|
-
if (selected) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
setSelectedRowIds(rowIds);
|
|
29
|
+
else if (selected && selectionMode === 'single') {
|
|
30
|
+
intent = 'single';
|
|
31
|
+
}
|
|
32
|
+
else if (selected) {
|
|
33
|
+
intent = 'add';
|
|
31
34
|
}
|
|
32
35
|
else {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
intent = 'remove';
|
|
37
|
+
}
|
|
38
|
+
switch (intent) {
|
|
39
|
+
case 'range':
|
|
40
|
+
newRowIds = getRangeSelection.getRangeSelection({
|
|
41
|
+
rowId,
|
|
42
|
+
lastClicked: lastClicked,
|
|
43
|
+
selected,
|
|
44
|
+
enabledRowIds,
|
|
45
|
+
selectedRowIds,
|
|
46
|
+
});
|
|
47
|
+
break;
|
|
48
|
+
case 'single':
|
|
49
|
+
newRowIds = [rowId];
|
|
50
|
+
break;
|
|
51
|
+
case 'add':
|
|
52
|
+
if (selectedRowIds.includes(rowId))
|
|
53
|
+
return;
|
|
54
|
+
newRowIds = [...selectedRowIds, rowId];
|
|
55
|
+
break;
|
|
56
|
+
case 'remove':
|
|
57
|
+
newRowIds = selectedRowIds.filter((id) => id !== rowId);
|
|
58
|
+
break;
|
|
59
|
+
default:
|
|
36
60
|
return;
|
|
37
|
-
const rowIds = [...selectedRowIds];
|
|
38
|
-
rowIds.splice(index, 1);
|
|
39
|
-
setSelectedRowIds(rowIds);
|
|
40
61
|
}
|
|
62
|
+
setSelectedRowIds(newRowIds);
|
|
63
|
+
lastClickedRef.current = rowId;
|
|
41
64
|
};
|
|
42
65
|
// TODO: Memoise this
|
|
43
66
|
const toggleAllSelected = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelection.cjs","sources":["../../../../src/components/DataTable/hooks/useSelection.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n\nimport React from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useSelection.cjs","sources":["../../../../src/components/DataTable/hooks/useSelection.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n\nimport React, { useRef } from 'react';\n\nimport {\n ColumnConfig,\n RowId,\n SelectionState,\n SelectionMode,\n SetSelectedAction,\n SelectionIntent,\n} from '../types';\n\nimport { SelectionHeader } from '../components/SelectionHeader';\nimport { SelectionCell } from '../components/SelectionCell';\nimport { getRangeSelection } from '../utils/getRangeSelection';\n\nexport type UseSelectionConfig = {\n selectionMode?: SelectionMode;\n selectionState?: SelectionState;\n enabledRowIds: RowId[];\n};\n\nconst emptySelectionState: SelectionState = [[], () => {}];\n\nexport function useSelection({\n selectionMode = 'multiple',\n selectionState,\n enabledRowIds,\n}: UseSelectionConfig) {\n const selectionEnabled = !!selectionState;\n const [selectedRowIds, setSelectedRowIds] = selectionState || emptySelectionState;\n const lastClickedRef = useRef<RowId | null>(null);\n\n // TODO: Memoise this\n const setSelected: SetSelectedAction = (\n selected: boolean,\n rowId: RowId | undefined,\n options?: { shiftKey?: boolean },\n ) => {\n if (rowId === undefined || rowId === null) return; // Can't use falsey, must allow number 0\n\n let newRowIds;\n let intent: SelectionIntent;\n const isShiftPressed = options?.shiftKey;\n const lastClicked = lastClickedRef.current;\n\n if (isShiftPressed && lastClicked && selectionMode === 'multiple') {\n intent = 'range';\n } else if (selected && selectionMode === 'single') {\n intent = 'single';\n } else if (selected) {\n intent = 'add';\n } else {\n intent = 'remove';\n }\n\n switch (intent) {\n case 'range':\n newRowIds = getRangeSelection({\n rowId,\n lastClicked: lastClicked!,\n selected,\n enabledRowIds,\n selectedRowIds,\n });\n break;\n case 'single':\n newRowIds = [rowId];\n break;\n case 'add':\n if (selectedRowIds.includes(rowId)) return;\n newRowIds = [...selectedRowIds, rowId];\n break;\n case 'remove':\n newRowIds = selectedRowIds.filter((id) => id !== rowId);\n break;\n default:\n return;\n }\n\n setSelectedRowIds(newRowIds);\n lastClickedRef.current = rowId;\n };\n\n // TODO: Memoise this\n const toggleAllSelected = () => {\n if (selectedRowIds.length === enabledRowIds.length) {\n setSelectedRowIds([]);\n return;\n }\n setSelectedRowIds(enabledRowIds);\n };\n\n // TODO: Memoise this\n const selectionColumn: ColumnConfig = {\n id: 'selection',\n title: 'Selection',\n width: '40px',\n align: 'center',\n pinned: 'left',\n renderHeader: (column, headerProps) => (\n <SelectionHeader\n {...headerProps}\n selected={selectedRowIds.length === enabledRowIds.length}\n indeterminate={selectedRowIds.length > 0 && selectedRowIds.length < enabledRowIds.length}\n onChange={toggleAllSelected}\n selectionMode={selectionMode}\n />\n ),\n renderCell: (row, cellProps, actions, rowState) => (\n <SelectionCell\n {...cellProps}\n rowId={row.id}\n selected={rowState.selected}\n onChange={actions.setSelected}\n selectionMode={selectionMode}\n disabled={rowState.disabled}\n />\n ),\n };\n\n return {\n selectionEnabled,\n selectedRowIds,\n selectionColumn,\n setSelected,\n };\n}\n"],"names":["useRef","getRangeSelection","React","SelectionHeader","SelectionCell"],"mappings":";;;;;;;;;;;AAAA;AAuBA,MAAM,mBAAmB,GAAmB,CAAC,EAAE,EAAE,MAAK,GAAG,CAAC;AAEpD,SAAU,YAAY,CAAC,EAC3B,aAAa,GAAG,UAAU,EAC1B,cAAc,EACd,aAAa,GACM,EAAA;AACnB,IAAA,MAAM,gBAAgB,GAAG,CAAC,CAAC,cAAc;IACzC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,cAAc,IAAI,mBAAmB;AACjF,IAAA,MAAM,cAAc,GAAGA,YAAM,CAAe,IAAI,CAAC;;IAGjD,MAAM,WAAW,GAAsB,CACrC,QAAiB,EACjB,KAAwB,EACxB,OAAgC,KAC9B;AACF,QAAA,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;AAAE,YAAA,OAAO;AAElD,QAAA,IAAI,SAAS;AACb,QAAA,IAAI,MAAuB;QAC3B,MAAM,cAAc,GAAG,OAAO,KAAA,IA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C;;AAGD,IAAA,MAAM,eAAe,GAAiB;AACpC,QAAA,EAAE,EAAE,WAAW;AACf,QAAA,KAAK,EAAE,WAAW;AAClB,QAAA,KAAK,EAAE,MAAM;AACb,QAAA,KAAK,EAAE,QAAQ;AACf,QAAA,MAAM,EAAE,MAAM;QACd,YAAY,EAAE,CAAC,MAAM,EAAE,WAAW,MAChCC,sBAAC,CAAA,aAAA,CAAAC,+BAAe,OACV,WAAW,EACf,QAAQ,EAAE,cAAc,CAAC,MAAM,KAAK,aAAa,CAAC,MAAM,EACxD,aAAa,EAAE,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,cAAc,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,EACxF,QAAQ,EAAE,iBAAiB,EAC3B,aAAa,EAAE,aAAa,EAAA,CAC5B,CACH;QACD,UAAU,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,MAC5CD,qCAACE,2BAAa,EAAA,EAAA,GACR,SAAS,EACb,KAAK,EAAE,GAAG,CAAC,EAAE,EACb,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAC3B,QAAQ,EAAE,OAAO,CAAC,WAAW,EAC7B,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAA,CAC3B,CACH;KACF;IAED,OAAO;QACL,gBAAgB;QAChB,cAAc;QACd,eAAe;QACf,WAAW;KACZ;AACH;;;;"}
|
|
@@ -1,37 +1,60 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
1
|
+
import React__default, { useRef } from 'react';
|
|
2
2
|
import { SelectionHeader } from '../components/SelectionHeader.js';
|
|
3
3
|
import { SelectionCell } from '../components/SelectionCell.js';
|
|
4
|
+
import { getRangeSelection } from '../utils/getRangeSelection.js';
|
|
4
5
|
|
|
5
6
|
/* eslint-disable react/destructuring-assignment */
|
|
6
7
|
const emptySelectionState = [[], () => { }];
|
|
7
8
|
function useSelection({ selectionMode = 'multiple', selectionState, enabledRowIds, }) {
|
|
8
9
|
const selectionEnabled = !!selectionState;
|
|
9
10
|
const [selectedRowIds, setSelectedRowIds] = selectionState || emptySelectionState;
|
|
11
|
+
const lastClickedRef = useRef(null);
|
|
10
12
|
// TODO: Memoise this
|
|
11
|
-
const setSelected = (selected, rowId) => {
|
|
13
|
+
const setSelected = (selected, rowId, options) => {
|
|
12
14
|
if (rowId === undefined || rowId === null)
|
|
13
15
|
return; // Can't use falsey, must allow number 0
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
let newRowIds;
|
|
17
|
+
let intent;
|
|
18
|
+
const isShiftPressed = options === null || options === undefined ? undefined : options.shiftKey;
|
|
19
|
+
const lastClicked = lastClickedRef.current;
|
|
20
|
+
if (isShiftPressed && lastClicked && selectionMode === 'multiple') {
|
|
21
|
+
intent = 'range';
|
|
18
22
|
}
|
|
19
|
-
if (selected) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
setSelectedRowIds(rowIds);
|
|
23
|
+
else if (selected && selectionMode === 'single') {
|
|
24
|
+
intent = 'single';
|
|
25
|
+
}
|
|
26
|
+
else if (selected) {
|
|
27
|
+
intent = 'add';
|
|
25
28
|
}
|
|
26
29
|
else {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
intent = 'remove';
|
|
31
|
+
}
|
|
32
|
+
switch (intent) {
|
|
33
|
+
case 'range':
|
|
34
|
+
newRowIds = getRangeSelection({
|
|
35
|
+
rowId,
|
|
36
|
+
lastClicked: lastClicked,
|
|
37
|
+
selected,
|
|
38
|
+
enabledRowIds,
|
|
39
|
+
selectedRowIds,
|
|
40
|
+
});
|
|
41
|
+
break;
|
|
42
|
+
case 'single':
|
|
43
|
+
newRowIds = [rowId];
|
|
44
|
+
break;
|
|
45
|
+
case 'add':
|
|
46
|
+
if (selectedRowIds.includes(rowId))
|
|
47
|
+
return;
|
|
48
|
+
newRowIds = [...selectedRowIds, rowId];
|
|
49
|
+
break;
|
|
50
|
+
case 'remove':
|
|
51
|
+
newRowIds = selectedRowIds.filter((id) => id !== rowId);
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
30
54
|
return;
|
|
31
|
-
const rowIds = [...selectedRowIds];
|
|
32
|
-
rowIds.splice(index, 1);
|
|
33
|
-
setSelectedRowIds(rowIds);
|
|
34
55
|
}
|
|
56
|
+
setSelectedRowIds(newRowIds);
|
|
57
|
+
lastClickedRef.current = rowId;
|
|
35
58
|
};
|
|
36
59
|
// TODO: Memoise this
|
|
37
60
|
const toggleAllSelected = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelection.js","sources":["../../../../src/components/DataTable/hooks/useSelection.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n\nimport React from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useSelection.js","sources":["../../../../src/components/DataTable/hooks/useSelection.tsx"],"sourcesContent":["/* eslint-disable react/destructuring-assignment */\n\nimport React, { useRef } from 'react';\n\nimport {\n ColumnConfig,\n RowId,\n SelectionState,\n SelectionMode,\n SetSelectedAction,\n SelectionIntent,\n} from '../types';\n\nimport { SelectionHeader } from '../components/SelectionHeader';\nimport { SelectionCell } from '../components/SelectionCell';\nimport { getRangeSelection } from '../utils/getRangeSelection';\n\nexport type UseSelectionConfig = {\n selectionMode?: SelectionMode;\n selectionState?: SelectionState;\n enabledRowIds: RowId[];\n};\n\nconst emptySelectionState: SelectionState = [[], () => {}];\n\nexport function useSelection({\n selectionMode = 'multiple',\n selectionState,\n enabledRowIds,\n}: UseSelectionConfig) {\n const selectionEnabled = !!selectionState;\n const [selectedRowIds, setSelectedRowIds] = selectionState || emptySelectionState;\n const lastClickedRef = useRef<RowId | null>(null);\n\n // TODO: Memoise this\n const setSelected: SetSelectedAction = (\n selected: boolean,\n rowId: RowId | undefined,\n options?: { shiftKey?: boolean },\n ) => {\n if (rowId === undefined || rowId === null) return; // Can't use falsey, must allow number 0\n\n let newRowIds;\n let intent: SelectionIntent;\n const isShiftPressed = options?.shiftKey;\n const lastClicked = lastClickedRef.current;\n\n if (isShiftPressed && lastClicked && selectionMode === 'multiple') {\n intent = 'range';\n } else if (selected && selectionMode === 'single') {\n intent = 'single';\n } else if (selected) {\n intent = 'add';\n } else {\n intent = 'remove';\n }\n\n switch (intent) {\n case 'range':\n newRowIds = getRangeSelection({\n rowId,\n lastClicked: lastClicked!,\n selected,\n enabledRowIds,\n selectedRowIds,\n });\n break;\n case 'single':\n newRowIds = [rowId];\n break;\n case 'add':\n if (selectedRowIds.includes(rowId)) return;\n newRowIds = [...selectedRowIds, rowId];\n break;\n case 'remove':\n newRowIds = selectedRowIds.filter((id) => id !== rowId);\n break;\n default:\n return;\n }\n\n setSelectedRowIds(newRowIds);\n lastClickedRef.current = rowId;\n };\n\n // TODO: Memoise this\n const toggleAllSelected = () => {\n if (selectedRowIds.length === enabledRowIds.length) {\n setSelectedRowIds([]);\n return;\n }\n setSelectedRowIds(enabledRowIds);\n };\n\n // TODO: Memoise this\n const selectionColumn: ColumnConfig = {\n id: 'selection',\n title: 'Selection',\n width: '40px',\n align: 'center',\n pinned: 'left',\n renderHeader: (column, headerProps) => (\n <SelectionHeader\n {...headerProps}\n selected={selectedRowIds.length === enabledRowIds.length}\n indeterminate={selectedRowIds.length > 0 && selectedRowIds.length < enabledRowIds.length}\n onChange={toggleAllSelected}\n selectionMode={selectionMode}\n />\n ),\n renderCell: (row, cellProps, actions, rowState) => (\n <SelectionCell\n {...cellProps}\n rowId={row.id}\n selected={rowState.selected}\n onChange={actions.setSelected}\n selectionMode={selectionMode}\n disabled={rowState.disabled}\n />\n ),\n };\n\n return {\n selectionEnabled,\n selectedRowIds,\n selectionColumn,\n setSelected,\n };\n}\n"],"names":["React"],"mappings":";;;;;AAAA;AAuBA,MAAM,mBAAmB,GAAmB,CAAC,EAAE,EAAE,MAAK,GAAG,CAAC;AAEpD,SAAU,YAAY,CAAC,EAC3B,aAAa,G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,CAAC,QAAQ,EAAA,CAC3B,CACH;KACF;IAED,OAAO;QACL,gBAAgB;QAChB,cAAc;QACd,eAAe;QACf,WAAW;KACZ;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../src/components/DataTable/types.ts"],"sourcesContent":["import { ReactElement, ReactNode } from 'react';\nimport { Size } from '../Stack/types';\n\nexport type BorderType = 'all' | 'vertical' | 'none';\n\nexport type ScrollPosition = 'none' | 'start' | 'middle' | 'end';\n\nexport type RowState = {\n selected: boolean;\n expanded: boolean;\n disabled: boolean;\n};\n\n/* Columns */\n\nexport type ColumnId = string | number;\nexport type ColumnAlignment = 'left' | 'center' | 'right';\nexport type ColumnOverflow = 'none' | 'wrap' | 'truncate';\nexport type ColumnPinned = 'left' | 'right' | 'none';\nexport type ColumnSpacing = Size;\nexport type ColumnWidth = number | string;\nexport type ColumnWidthFixed = ColumnWidth;\n\nexport type ColumnWidthBounded = {\n min?: ColumnWidth;\n max?: ColumnWidth;\n};\n\nexport type ColumnConfig = {\n id: ColumnId;\n // Options\n align?: ColumnAlignment;\n hidden?: boolean;\n iconSlot?: ReactElement; // Size[5]\n pinned?: ColumnPinned;\n sortable?: boolean;\n spacing?: ColumnSpacing;\n span?: number;\n title?: string;\n tooltip?: string;\n width?: ColumnWidthFixed | ColumnWidthBounded;\n resizeMinWidth?: number;\n // Renderers\n renderCell: CellRenderer;\n renderFooter?: FooterRenderer;\n renderHeader?: HeaderRenderer;\n renderNestedCell?: NestedCellRenderer;\n};\nexport type ColumnConfigs = Array<ColumnConfig>;\n\n/* Sorting */\n\nexport enum SortDirection {\n ascending = 'ascending',\n descending = 'descending',\n}\n\nexport type SortDirectionType = keyof typeof SortDirection;\n\nexport type SortState = {\n columnId: ColumnId;\n direction: SortDirection;\n};\n\nexport type SortChangeHandler = (sortState: SortState) => void;\n\nexport type ColumnWidthState = {\n columnId: ColumnId;\n width: number | string;\n};\n\nexport type ColumnWidthHandler = (columnWidthState: ColumnWidthState) => ColumnWidthsType | void;\n\n/* Data */\n\nexport type RowId = number | string;\n\nexport interface NestedTableRow {\n id: RowId;\n data: any;\n}\n\nexport type NestedTableRows = Array<NestedTableRow>;\n\nexport interface TableRow {\n id: RowId;\n data: any;\n nestedRows?: NestedTableRows;\n accentColor?: string;\n e2eClassName?: string;\n}\nexport type TableRows = Array<TableRow>;\n\n/* Header Props */\n\nexport interface HeaderProps extends React.HtmlHTMLAttributes<HTMLTableCellElement> {\n id: string;\n align?: ColumnAlignment;\n spacing?: ColumnSpacing;\n span?: number;\n zIndex?: number;\n}\n\nexport interface RendererHeaderProps extends HeaderProps {\n key: string;\n 'data-columnid'?: string;\n}\nexport interface SelectionHeaderProps extends Omit<HeaderProps, 'onChange'> {\n selected: boolean;\n indeterminate: boolean;\n onChange: (selected: boolean, value: RowId | undefined) => void;\n selectionMode: SelectionMode;\n}\n\n/* Renderers */\n\nexport type HeaderRenderer = (column: ColumnConfig, headerProps: RendererHeaderProps) => ReactNode;\nexport type FooterRenderer = (column: ColumnConfig, footerProps: object) => ReactNode;\n\nexport type CellRenderer = (\n row: TableRow,\n cellProps: object,\n actions: TableActions,\n rowState: RowState,\n) => ReactNode;\n\ntype ParentRowState = RowState;\nexport type NestedCellRenderer = (\n nestedRow: NestedTableRow,\n cellProps: object,\n parentRowState: ParentRowState,\n) => ReactNode;\n\n/* Actions */\n\nexport type SetSelectedAction = (selected: boolean
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../src/components/DataTable/types.ts"],"sourcesContent":["import { ReactElement, ReactNode } from 'react';\nimport { Size } from '../Stack/types';\n\nexport type BorderType = 'all' | 'vertical' | 'none';\n\nexport type ScrollPosition = 'none' | 'start' | 'middle' | 'end';\n\nexport type RowState = {\n selected: boolean;\n expanded: boolean;\n disabled: boolean;\n};\n\n/* Columns */\n\nexport type ColumnId = string | number;\nexport type ColumnAlignment = 'left' | 'center' | 'right';\nexport type ColumnOverflow = 'none' | 'wrap' | 'truncate';\nexport type ColumnPinned = 'left' | 'right' | 'none';\nexport type ColumnSpacing = Size;\nexport type ColumnWidth = number | string;\nexport type ColumnWidthFixed = ColumnWidth;\n\nexport type ColumnWidthBounded = {\n min?: ColumnWidth;\n max?: ColumnWidth;\n};\n\nexport type ColumnConfig = {\n id: ColumnId;\n // Options\n align?: ColumnAlignment;\n hidden?: boolean;\n iconSlot?: ReactElement; // Size[5]\n pinned?: ColumnPinned;\n sortable?: boolean;\n spacing?: ColumnSpacing;\n span?: number;\n title?: string;\n tooltip?: string;\n width?: ColumnWidthFixed | ColumnWidthBounded;\n resizeMinWidth?: number;\n // Renderers\n renderCell: CellRenderer;\n renderFooter?: FooterRenderer;\n renderHeader?: HeaderRenderer;\n renderNestedCell?: NestedCellRenderer;\n};\nexport type ColumnConfigs = Array<ColumnConfig>;\n\n/* Sorting */\n\nexport enum SortDirection {\n ascending = 'ascending',\n descending = 'descending',\n}\n\nexport type SortDirectionType = keyof typeof SortDirection;\n\nexport type SortState = {\n columnId: ColumnId;\n direction: SortDirection;\n};\n\nexport type SortChangeHandler = (sortState: SortState) => void;\n\nexport type ColumnWidthState = {\n columnId: ColumnId;\n width: number | string;\n};\n\nexport type ColumnWidthHandler = (columnWidthState: ColumnWidthState) => ColumnWidthsType | void;\n\n/* Data */\n\nexport type RowId = number | string;\n\nexport interface NestedTableRow {\n id: RowId;\n data: any;\n}\n\nexport type NestedTableRows = Array<NestedTableRow>;\n\nexport interface TableRow {\n id: RowId;\n data: any;\n nestedRows?: NestedTableRows;\n accentColor?: string;\n e2eClassName?: string;\n}\nexport type TableRows = Array<TableRow>;\n\n/* Header Props */\n\nexport interface HeaderProps extends React.HtmlHTMLAttributes<HTMLTableCellElement> {\n id: string;\n align?: ColumnAlignment;\n spacing?: ColumnSpacing;\n span?: number;\n zIndex?: number;\n}\n\nexport interface RendererHeaderProps extends HeaderProps {\n key: string;\n 'data-columnid'?: string;\n}\nexport interface SelectionHeaderProps extends Omit<HeaderProps, 'onChange'> {\n selected: boolean;\n indeterminate: boolean;\n onChange: (selected: boolean, value: RowId | undefined) => void;\n selectionMode: SelectionMode;\n}\n\n/* Renderers */\n\nexport type HeaderRenderer = (column: ColumnConfig, headerProps: RendererHeaderProps) => ReactNode;\nexport type FooterRenderer = (column: ColumnConfig, footerProps: object) => ReactNode;\n\nexport type CellRenderer = (\n row: TableRow,\n cellProps: object,\n actions: TableActions,\n rowState: RowState,\n) => ReactNode;\n\ntype ParentRowState = RowState;\nexport type NestedCellRenderer = (\n nestedRow: NestedTableRow,\n cellProps: object,\n parentRowState: ParentRowState,\n) => ReactNode;\n\n/* Actions */\n\nexport type SetSelectedAction = (\n selected: boolean,\n rowId: RowId | undefined,\n options?: { shiftKey?: boolean },\n) => void;\nexport type SetExpandedAction = (expanded: boolean, rowId: RowId | undefined) => void;\n\nexport type TableActions = {\n setSelected: SetSelectedAction;\n setExpanded: SetExpandedAction;\n};\n\n/* Props */\n\nexport type BorderMode = 'full' | 'vertical' | 'none';\n\nexport type CustomState = {\n iconSlot: ReactElement;\n heading: string;\n subheading?: string;\n};\n\nexport type SelectionMode = 'single' | 'multiple';\n\nexport type SelectionIntent = 'range' | 'single' | 'add' | 'remove';\n\nexport type SelectionState = [RowId[], (rowIds: RowId[]) => void];\n\nexport type StripingMode = 'row' | 'nested';\n\nexport interface DataTableProps {\n /** slot for the action bar above the table */\n actionBarSlot?: ReactNode;\n /** Type of border for the table */\n borderMode?: BorderMode;\n /** Columns for the table */\n columns: ColumnConfigs;\n /** Disable specific rows of the table */\n disabledRowIds?: Array<RowId>;\n /** Enable sticky header */\n enableStickyHeader?: boolean;\n /** Render a custom empty state for the table */\n emptyState?: CustomState;\n /** The rows that can be expanded to show more information */\n expandedRowIds?: Array<RowId>;\n /** Renders a loading indicator inside the table */\n loading?: boolean;\n /** Number of rows to display when loading */\n loadingRowCount?: number;\n /** OnChange handler for sorting functionality */\n onChangeSort?: SortChangeHandler;\n /** Rows of data to be displayed in the table */\n rows: TableRows;\n /** Decide how many rows can be selected */\n selectionMode?: SelectionMode;\n /** The current selected rows */\n selectionState?: SelectionState;\n /** Handler to expand specific row */\n setExpanded?: SetExpandedAction;\n /** State of each column's sorting */\n sortState?: SortState;\n /** Renders alternate row a slightly different colour */\n stripingMode?: StripingMode;\n /** Enable column resizing */\n resizeableColumns?: boolean;\n /** Callback for when columns are resized */\n onResizeColumns?: (columnWidths: ResizeColumnData) => void;\n columnWidths?: ColumnWidthsType;\n\n stickyHeaderTop?: number;\n}\n\nexport type ColumnWidthsType = {\n [key: ColumnId]: ColumnWidthType;\n};\n\nexport type ColumnWidthType = ColumnWidthFixed | ColumnWidthBounded | undefined;\n\nexport type ResizeColumnData = ColumnWidthsType;\n"],"names":["SortDirection"],"mappings":";;AAkDA;AAEYA;AAAZ,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,aAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC3B,CAAC,EAHWA,qBAAa,KAAbA,qBAAa,GAGxB,EAAA,CAAA,CAAA;;"}
|
|
@@ -88,7 +88,9 @@ export type FooterRenderer = (column: ColumnConfig, footerProps: object) => Reac
|
|
|
88
88
|
export type CellRenderer = (row: TableRow, cellProps: object, actions: TableActions, rowState: RowState) => ReactNode;
|
|
89
89
|
type ParentRowState = RowState;
|
|
90
90
|
export type NestedCellRenderer = (nestedRow: NestedTableRow, cellProps: object, parentRowState: ParentRowState) => ReactNode;
|
|
91
|
-
export type SetSelectedAction = (selected: boolean, rowId: RowId | undefined
|
|
91
|
+
export type SetSelectedAction = (selected: boolean, rowId: RowId | undefined, options?: {
|
|
92
|
+
shiftKey?: boolean;
|
|
93
|
+
}) => void;
|
|
92
94
|
export type SetExpandedAction = (expanded: boolean, rowId: RowId | undefined) => void;
|
|
93
95
|
export type TableActions = {
|
|
94
96
|
setSelected: SetSelectedAction;
|
|
@@ -101,6 +103,7 @@ export type CustomState = {
|
|
|
101
103
|
subheading?: string;
|
|
102
104
|
};
|
|
103
105
|
export type SelectionMode = 'single' | 'multiple';
|
|
106
|
+
export type SelectionIntent = 'range' | 'single' | 'add' | 'remove';
|
|
104
107
|
export type SelectionState = [RowId[], (rowIds: RowId[]) => void];
|
|
105
108
|
export type StripingMode = 'row' | 'nested';
|
|
106
109
|
export interface DataTableProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/components/DataTable/types.ts"],"sourcesContent":["import { ReactElement, ReactNode } from 'react';\nimport { Size } from '../Stack/types';\n\nexport type BorderType = 'all' | 'vertical' | 'none';\n\nexport type ScrollPosition = 'none' | 'start' | 'middle' | 'end';\n\nexport type RowState = {\n selected: boolean;\n expanded: boolean;\n disabled: boolean;\n};\n\n/* Columns */\n\nexport type ColumnId = string | number;\nexport type ColumnAlignment = 'left' | 'center' | 'right';\nexport type ColumnOverflow = 'none' | 'wrap' | 'truncate';\nexport type ColumnPinned = 'left' | 'right' | 'none';\nexport type ColumnSpacing = Size;\nexport type ColumnWidth = number | string;\nexport type ColumnWidthFixed = ColumnWidth;\n\nexport type ColumnWidthBounded = {\n min?: ColumnWidth;\n max?: ColumnWidth;\n};\n\nexport type ColumnConfig = {\n id: ColumnId;\n // Options\n align?: ColumnAlignment;\n hidden?: boolean;\n iconSlot?: ReactElement; // Size[5]\n pinned?: ColumnPinned;\n sortable?: boolean;\n spacing?: ColumnSpacing;\n span?: number;\n title?: string;\n tooltip?: string;\n width?: ColumnWidthFixed | ColumnWidthBounded;\n resizeMinWidth?: number;\n // Renderers\n renderCell: CellRenderer;\n renderFooter?: FooterRenderer;\n renderHeader?: HeaderRenderer;\n renderNestedCell?: NestedCellRenderer;\n};\nexport type ColumnConfigs = Array<ColumnConfig>;\n\n/* Sorting */\n\nexport enum SortDirection {\n ascending = 'ascending',\n descending = 'descending',\n}\n\nexport type SortDirectionType = keyof typeof SortDirection;\n\nexport type SortState = {\n columnId: ColumnId;\n direction: SortDirection;\n};\n\nexport type SortChangeHandler = (sortState: SortState) => void;\n\nexport type ColumnWidthState = {\n columnId: ColumnId;\n width: number | string;\n};\n\nexport type ColumnWidthHandler = (columnWidthState: ColumnWidthState) => ColumnWidthsType | void;\n\n/* Data */\n\nexport type RowId = number | string;\n\nexport interface NestedTableRow {\n id: RowId;\n data: any;\n}\n\nexport type NestedTableRows = Array<NestedTableRow>;\n\nexport interface TableRow {\n id: RowId;\n data: any;\n nestedRows?: NestedTableRows;\n accentColor?: string;\n e2eClassName?: string;\n}\nexport type TableRows = Array<TableRow>;\n\n/* Header Props */\n\nexport interface HeaderProps extends React.HtmlHTMLAttributes<HTMLTableCellElement> {\n id: string;\n align?: ColumnAlignment;\n spacing?: ColumnSpacing;\n span?: number;\n zIndex?: number;\n}\n\nexport interface RendererHeaderProps extends HeaderProps {\n key: string;\n 'data-columnid'?: string;\n}\nexport interface SelectionHeaderProps extends Omit<HeaderProps, 'onChange'> {\n selected: boolean;\n indeterminate: boolean;\n onChange: (selected: boolean, value: RowId | undefined) => void;\n selectionMode: SelectionMode;\n}\n\n/* Renderers */\n\nexport type HeaderRenderer = (column: ColumnConfig, headerProps: RendererHeaderProps) => ReactNode;\nexport type FooterRenderer = (column: ColumnConfig, footerProps: object) => ReactNode;\n\nexport type CellRenderer = (\n row: TableRow,\n cellProps: object,\n actions: TableActions,\n rowState: RowState,\n) => ReactNode;\n\ntype ParentRowState = RowState;\nexport type NestedCellRenderer = (\n nestedRow: NestedTableRow,\n cellProps: object,\n parentRowState: ParentRowState,\n) => ReactNode;\n\n/* Actions */\n\nexport type SetSelectedAction = (selected: boolean
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/components/DataTable/types.ts"],"sourcesContent":["import { ReactElement, ReactNode } from 'react';\nimport { Size } from '../Stack/types';\n\nexport type BorderType = 'all' | 'vertical' | 'none';\n\nexport type ScrollPosition = 'none' | 'start' | 'middle' | 'end';\n\nexport type RowState = {\n selected: boolean;\n expanded: boolean;\n disabled: boolean;\n};\n\n/* Columns */\n\nexport type ColumnId = string | number;\nexport type ColumnAlignment = 'left' | 'center' | 'right';\nexport type ColumnOverflow = 'none' | 'wrap' | 'truncate';\nexport type ColumnPinned = 'left' | 'right' | 'none';\nexport type ColumnSpacing = Size;\nexport type ColumnWidth = number | string;\nexport type ColumnWidthFixed = ColumnWidth;\n\nexport type ColumnWidthBounded = {\n min?: ColumnWidth;\n max?: ColumnWidth;\n};\n\nexport type ColumnConfig = {\n id: ColumnId;\n // Options\n align?: ColumnAlignment;\n hidden?: boolean;\n iconSlot?: ReactElement; // Size[5]\n pinned?: ColumnPinned;\n sortable?: boolean;\n spacing?: ColumnSpacing;\n span?: number;\n title?: string;\n tooltip?: string;\n width?: ColumnWidthFixed | ColumnWidthBounded;\n resizeMinWidth?: number;\n // Renderers\n renderCell: CellRenderer;\n renderFooter?: FooterRenderer;\n renderHeader?: HeaderRenderer;\n renderNestedCell?: NestedCellRenderer;\n};\nexport type ColumnConfigs = Array<ColumnConfig>;\n\n/* Sorting */\n\nexport enum SortDirection {\n ascending = 'ascending',\n descending = 'descending',\n}\n\nexport type SortDirectionType = keyof typeof SortDirection;\n\nexport type SortState = {\n columnId: ColumnId;\n direction: SortDirection;\n};\n\nexport type SortChangeHandler = (sortState: SortState) => void;\n\nexport type ColumnWidthState = {\n columnId: ColumnId;\n width: number | string;\n};\n\nexport type ColumnWidthHandler = (columnWidthState: ColumnWidthState) => ColumnWidthsType | void;\n\n/* Data */\n\nexport type RowId = number | string;\n\nexport interface NestedTableRow {\n id: RowId;\n data: any;\n}\n\nexport type NestedTableRows = Array<NestedTableRow>;\n\nexport interface TableRow {\n id: RowId;\n data: any;\n nestedRows?: NestedTableRows;\n accentColor?: string;\n e2eClassName?: string;\n}\nexport type TableRows = Array<TableRow>;\n\n/* Header Props */\n\nexport interface HeaderProps extends React.HtmlHTMLAttributes<HTMLTableCellElement> {\n id: string;\n align?: ColumnAlignment;\n spacing?: ColumnSpacing;\n span?: number;\n zIndex?: number;\n}\n\nexport interface RendererHeaderProps extends HeaderProps {\n key: string;\n 'data-columnid'?: string;\n}\nexport interface SelectionHeaderProps extends Omit<HeaderProps, 'onChange'> {\n selected: boolean;\n indeterminate: boolean;\n onChange: (selected: boolean, value: RowId | undefined) => void;\n selectionMode: SelectionMode;\n}\n\n/* Renderers */\n\nexport type HeaderRenderer = (column: ColumnConfig, headerProps: RendererHeaderProps) => ReactNode;\nexport type FooterRenderer = (column: ColumnConfig, footerProps: object) => ReactNode;\n\nexport type CellRenderer = (\n row: TableRow,\n cellProps: object,\n actions: TableActions,\n rowState: RowState,\n) => ReactNode;\n\ntype ParentRowState = RowState;\nexport type NestedCellRenderer = (\n nestedRow: NestedTableRow,\n cellProps: object,\n parentRowState: ParentRowState,\n) => ReactNode;\n\n/* Actions */\n\nexport type SetSelectedAction = (\n selected: boolean,\n rowId: RowId | undefined,\n options?: { shiftKey?: boolean },\n) => void;\nexport type SetExpandedAction = (expanded: boolean, rowId: RowId | undefined) => void;\n\nexport type TableActions = {\n setSelected: SetSelectedAction;\n setExpanded: SetExpandedAction;\n};\n\n/* Props */\n\nexport type BorderMode = 'full' | 'vertical' | 'none';\n\nexport type CustomState = {\n iconSlot: ReactElement;\n heading: string;\n subheading?: string;\n};\n\nexport type SelectionMode = 'single' | 'multiple';\n\nexport type SelectionIntent = 'range' | 'single' | 'add' | 'remove';\n\nexport type SelectionState = [RowId[], (rowIds: RowId[]) => void];\n\nexport type StripingMode = 'row' | 'nested';\n\nexport interface DataTableProps {\n /** slot for the action bar above the table */\n actionBarSlot?: ReactNode;\n /** Type of border for the table */\n borderMode?: BorderMode;\n /** Columns for the table */\n columns: ColumnConfigs;\n /** Disable specific rows of the table */\n disabledRowIds?: Array<RowId>;\n /** Enable sticky header */\n enableStickyHeader?: boolean;\n /** Render a custom empty state for the table */\n emptyState?: CustomState;\n /** The rows that can be expanded to show more information */\n expandedRowIds?: Array<RowId>;\n /** Renders a loading indicator inside the table */\n loading?: boolean;\n /** Number of rows to display when loading */\n loadingRowCount?: number;\n /** OnChange handler for sorting functionality */\n onChangeSort?: SortChangeHandler;\n /** Rows of data to be displayed in the table */\n rows: TableRows;\n /** Decide how many rows can be selected */\n selectionMode?: SelectionMode;\n /** The current selected rows */\n selectionState?: SelectionState;\n /** Handler to expand specific row */\n setExpanded?: SetExpandedAction;\n /** State of each column's sorting */\n sortState?: SortState;\n /** Renders alternate row a slightly different colour */\n stripingMode?: StripingMode;\n /** Enable column resizing */\n resizeableColumns?: boolean;\n /** Callback for when columns are resized */\n onResizeColumns?: (columnWidths: ResizeColumnData) => void;\n columnWidths?: ColumnWidthsType;\n\n stickyHeaderTop?: number;\n}\n\nexport type ColumnWidthsType = {\n [key: ColumnId]: ColumnWidthType;\n};\n\nexport type ColumnWidthType = ColumnWidthFixed | ColumnWidthBounded | undefined;\n\nexport type ResizeColumnData = ColumnWidthsType;\n"],"names":[],"mappings":"AAkDA;IAEY;AAAZ,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,aAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC3B,CAAC,EAHW,aAAa,KAAb,aAAa,GAGxB,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function getRangeSelection({ rowId, lastClicked, selected, enabledRowIds, selectedRowIds, }) {
|
|
4
|
+
const currentIndex = enabledRowIds.indexOf(rowId);
|
|
5
|
+
const lastSelectedIndex = enabledRowIds.indexOf(lastClicked);
|
|
6
|
+
if (currentIndex < 0 || lastSelectedIndex < 0)
|
|
7
|
+
return selectedRowIds;
|
|
8
|
+
const start = Math.min(lastSelectedIndex, currentIndex);
|
|
9
|
+
const end = Math.max(lastSelectedIndex, currentIndex);
|
|
10
|
+
const rangeIds = enabledRowIds.slice(start, end + 1);
|
|
11
|
+
if (selected) {
|
|
12
|
+
return [...new Set([...selectedRowIds, ...rangeIds])];
|
|
13
|
+
}
|
|
14
|
+
return selectedRowIds.filter((id) => !rangeIds.includes(id));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.getRangeSelection = getRangeSelection;
|
|
18
|
+
//# sourceMappingURL=getRangeSelection.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRangeSelection.cjs","sources":["../../../../src/components/DataTable/utils/getRangeSelection.ts"],"sourcesContent":["import { RowId } from '../types';\n\ntype RangeSelectionParameters = {\n rowId: RowId;\n lastClicked: RowId;\n selected: boolean;\n enabledRowIds: RowId[];\n selectedRowIds: RowId[];\n};\n\nexport function getRangeSelection({\n rowId,\n lastClicked,\n selected,\n enabledRowIds,\n selectedRowIds,\n}: RangeSelectionParameters): RowId[] {\n const currentIndex = enabledRowIds.indexOf(rowId);\n const lastSelectedIndex = enabledRowIds.indexOf(lastClicked);\n\n if (currentIndex < 0 || lastSelectedIndex < 0) return selectedRowIds;\n\n const start = Math.min(lastSelectedIndex, currentIndex);\n const end = Math.max(lastSelectedIndex, currentIndex);\n const rangeIds = enabledRowIds.slice(start, end + 1);\n\n if (selected) {\n return [...new Set([...selectedRowIds, ...rangeIds])];\n }\n return selectedRowIds.filter((id) => !rangeIds.includes(id));\n}\n"],"names":[],"mappings":";;AAUgB,SAAA,iBAAiB,CAAC,EAChC,KAAK,EACL,WAAW,EACX,QAAQ,EACR,aAAa,EACb,cAAc,GACW,EAAA;IACzB,MAAM,YAAY,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC;IACjD,MAAM,iBAAiB,GAAG,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC;AAE5D,IAAA,IAAI,YAAY,GAAG,CAAC,IAAI,iBAAiB,GAAG,CAAC;AAAE,QAAA,OAAO,cAAc;IAEpE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,YAAY,CAAC;IACvD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,YAAY,CAAC;AACrD,IAAA,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC;AAEpD,IAAA,IAAI,QAAQ,EAAE;AACZ,QAAA,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,cAAc,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC;AACtD;AACD,IAAA,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC9D;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RowId } from '../types';
|
|
2
|
+
type RangeSelectionParameters = {
|
|
3
|
+
rowId: RowId;
|
|
4
|
+
lastClicked: RowId;
|
|
5
|
+
selected: boolean;
|
|
6
|
+
enabledRowIds: RowId[];
|
|
7
|
+
selectedRowIds: RowId[];
|
|
8
|
+
};
|
|
9
|
+
export declare function getRangeSelection({ rowId, lastClicked, selected, enabledRowIds, selectedRowIds, }: RangeSelectionParameters): RowId[];
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function getRangeSelection({ rowId, lastClicked, selected, enabledRowIds, selectedRowIds, }) {
|
|
2
|
+
const currentIndex = enabledRowIds.indexOf(rowId);
|
|
3
|
+
const lastSelectedIndex = enabledRowIds.indexOf(lastClicked);
|
|
4
|
+
if (currentIndex < 0 || lastSelectedIndex < 0)
|
|
5
|
+
return selectedRowIds;
|
|
6
|
+
const start = Math.min(lastSelectedIndex, currentIndex);
|
|
7
|
+
const end = Math.max(lastSelectedIndex, currentIndex);
|
|
8
|
+
const rangeIds = enabledRowIds.slice(start, end + 1);
|
|
9
|
+
if (selected) {
|
|
10
|
+
return [...new Set([...selectedRowIds, ...rangeIds])];
|
|
11
|
+
}
|
|
12
|
+
return selectedRowIds.filter((id) => !rangeIds.includes(id));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { getRangeSelection };
|
|
16
|
+
//# sourceMappingURL=getRangeSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRangeSelection.js","sources":["../../../../src/components/DataTable/utils/getRangeSelection.ts"],"sourcesContent":["import { RowId } from '../types';\n\ntype RangeSelectionParameters = {\n rowId: RowId;\n lastClicked: RowId;\n selected: boolean;\n enabledRowIds: RowId[];\n selectedRowIds: RowId[];\n};\n\nexport function getRangeSelection({\n rowId,\n lastClicked,\n selected,\n enabledRowIds,\n selectedRowIds,\n}: RangeSelectionParameters): RowId[] {\n const currentIndex = enabledRowIds.indexOf(rowId);\n const lastSelectedIndex = enabledRowIds.indexOf(lastClicked);\n\n if (currentIndex < 0 || lastSelectedIndex < 0) return selectedRowIds;\n\n const start = Math.min(lastSelectedIndex, currentIndex);\n const end = Math.max(lastSelectedIndex, currentIndex);\n const rangeIds = enabledRowIds.slice(start, end + 1);\n\n if (selected) {\n return [...new Set([...selectedRowIds, ...rangeIds])];\n }\n return selectedRowIds.filter((id) => !rangeIds.includes(id));\n}\n"],"names":[],"mappings":"AAUgB,SAAA,iBAAiB,CAAC,EAChC,KAAK,EACL,WAAW,EACX,QAAQ,EACR,aAAa,EACb,cAAc,GACW,EAAA;IACzB,MAAM,YAAY,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC;IACjD,MAAM,iBAAiB,GAAG,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC;AAE5D,IAAA,IAAI,YAAY,GAAG,CAAC,IAAI,iBAAiB,GAAG,CAAC;AAAE,QAAA,OAAO,cAAc;IAEpE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,YAAY,CAAC;IACvD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,YAAY,CAAC;AACrD,IAAA,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC;AAEpD,IAAA,IAAI,QAAQ,EAAE;AACZ,QAAA,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,cAAc,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC;AACtD;AACD,IAAA,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC9D;;;;"}
|