@elliemae/ds-data-table 3.70.0-next.43 → 3.70.0-next.44
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/cjs/exported-related/FilterBar/PillsFromDataTableFilters.js +2 -1
- package/dist/cjs/exported-related/FilterBar/PillsFromDataTableFilters.js.map +2 -2
- package/dist/cjs/parts/FilterBar/FiltersBar.js +2 -1
- package/dist/cjs/parts/FilterBar/FiltersBar.js.map +2 -2
- package/dist/cjs/parts/Headers/HeaderCell.js +13 -24
- package/dist/cjs/parts/Headers/HeaderCell.js.map +2 -2
- package/dist/cjs/parts/Headers/HeaderResizer.js +39 -17
- package/dist/cjs/parts/Headers/HeaderResizer.js.map +2 -2
- package/dist/cjs/parts/Headers/buildScreenReaderInstructions.js +63 -0
- package/dist/cjs/parts/Headers/buildScreenReaderInstructions.js.map +7 -0
- package/dist/cjs/parts/Headers/useHeaderCellHandlers.js.map +1 -1
- package/dist/cjs/parts/Headers/useHeaderResizer.js.map +1 -1
- package/dist/cjs/react-desc-prop-types.js +4 -1
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/styled.js +9 -35
- package/dist/cjs/styled.js.map +2 -2
- package/dist/esm/exported-related/FilterBar/PillsFromDataTableFilters.js +2 -1
- package/dist/esm/exported-related/FilterBar/PillsFromDataTableFilters.js.map +2 -2
- package/dist/esm/parts/FilterBar/FiltersBar.js +2 -1
- package/dist/esm/parts/FilterBar/FiltersBar.js.map +2 -2
- package/dist/esm/parts/Headers/HeaderCell.js +13 -24
- package/dist/esm/parts/Headers/HeaderCell.js.map +2 -2
- package/dist/esm/parts/Headers/HeaderResizer.js +40 -18
- package/dist/esm/parts/Headers/HeaderResizer.js.map +2 -2
- package/dist/esm/parts/Headers/buildScreenReaderInstructions.js +33 -0
- package/dist/esm/parts/Headers/buildScreenReaderInstructions.js.map +7 -0
- package/dist/esm/parts/Headers/useHeaderCellHandlers.js.map +1 -1
- package/dist/esm/parts/Headers/useHeaderResizer.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js +4 -1
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/styled.js +9 -35
- package/dist/esm/styled.js.map +2 -2
- package/dist/types/parts/Headers/HeaderResizer.d.ts +1 -1
- package/dist/types/parts/Headers/buildScreenReaderInstructions.d.ts +19 -0
- package/dist/types/parts/Headers/useHeaderCellHandlers.d.ts +1 -1
- package/dist/types/parts/Headers/useHeaderResizer.d.ts +1 -1
- package/dist/types/react-desc-prop-types.d.ts +1 -0
- package/dist/types/styled.d.ts +1 -1
- package/package.json +30 -30
- package/skills/ds-data-table-slots/SKILL.md +6 -3
|
@@ -68,7 +68,8 @@ const PillsFromDataTableFilters = ({
|
|
|
68
68
|
return refs;
|
|
69
69
|
}, [filters.length]);
|
|
70
70
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: filters.map(({ id: column, type, value }, index) => {
|
|
71
|
-
const
|
|
71
|
+
const matchedColumn = columns.find((col) => col.accessor === column);
|
|
72
|
+
const columnHeader = matchedColumn?.pillLabel || matchedColumn?.Header;
|
|
72
73
|
let Component = () => null;
|
|
73
74
|
const filterType = type;
|
|
74
75
|
if (customPillRenderers?.[column]) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/exported-related/FilterBar/PillsFromDataTableFilters.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useMemo } from 'react';\nimport {\n DateRangePill,\n DateSwitcherPill,\n FreeTextSearchPillPill,\n MultiSelectPill,\n NumberRangePill,\n SelectPill,\n SingleDatePill,\n} from '../../parts/FilterBar/components/index.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { FILTER_TYPES } from '../FilterTypes.js';\n\nconst pillRenderMapper = {\n [FILTER_TYPES.SELECT]: SelectPill,\n [FILTER_TYPES.SELECT_V2]: SelectPill,\n [FILTER_TYPES.MULTI_SELECT]: MultiSelectPill,\n [FILTER_TYPES.MULTI_SELECT_V2]: MultiSelectPill,\n [FILTER_TYPES.SINGLE_DATE]: SingleDatePill,\n [FILTER_TYPES.SINGLE_DATE_V2]: SingleDatePill,\n [FILTER_TYPES.DATE_RANGE]: DateRangePill,\n [FILTER_TYPES.DATE_RANGE_V2]: DateRangePill,\n [FILTER_TYPES.DATE_SWITCHER]: DateSwitcherPill,\n [FILTER_TYPES.DATE_SWITCHER_V2]: DateSwitcherPill,\n [FILTER_TYPES.NUMBER_RANGE]: NumberRangePill,\n [FILTER_TYPES.NUMBER_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.FREE_TEXT_SEARCH]: FreeTextSearchPillPill,\n [FILTER_TYPES.FREE_TEXT_SEARCH_V2]: FreeTextSearchPillPill,\n} as const;\n\ninterface PillsFromDataTableFiltersProps {\n filters: DSDataTableT.Filter[];\n columns: DSDataTableT.Column[];\n onFiltersChange: (filters: DSDataTableT.Filter[]) => void;\n onPillRemove?: (remove: () => void) => void;\n customPillRenderers?: Record<string, React.ComponentType<DSDataTableT.FilterPillProps<unknown>>>;\n customPillRenderer?: React.ComponentType<DSDataTableT.FilterPillProps<unknown>>;\n}\n\nexport const PillsFromDataTableFilters: React.FC<PillsFromDataTableFiltersProps> = ({\n filters,\n columns,\n\n onFiltersChange,\n onPillRemove,\n customPillRenderers,\n customPillRenderer,\n}) => {\n const pillRefs = useMemo(() => {\n const refs: React.RefObject<HTMLElement>[] = [];\n for (let i = 0; i < filters.length; i += 1) refs.push(React.createRef());\n return refs;\n }, [filters.length]);\n return (\n <>\n {filters.map(({ id: column, type, value }, index) => {\n const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;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import React, { useMemo } from 'react';\nimport {\n DateRangePill,\n DateSwitcherPill,\n FreeTextSearchPillPill,\n MultiSelectPill,\n NumberRangePill,\n SelectPill,\n SingleDatePill,\n} from '../../parts/FilterBar/components/index.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { FILTER_TYPES } from '../FilterTypes.js';\n\nconst pillRenderMapper = {\n [FILTER_TYPES.SELECT]: SelectPill,\n [FILTER_TYPES.SELECT_V2]: SelectPill,\n [FILTER_TYPES.MULTI_SELECT]: MultiSelectPill,\n [FILTER_TYPES.MULTI_SELECT_V2]: MultiSelectPill,\n [FILTER_TYPES.SINGLE_DATE]: SingleDatePill,\n [FILTER_TYPES.SINGLE_DATE_V2]: SingleDatePill,\n [FILTER_TYPES.DATE_RANGE]: DateRangePill,\n [FILTER_TYPES.DATE_RANGE_V2]: DateRangePill,\n [FILTER_TYPES.DATE_SWITCHER]: DateSwitcherPill,\n [FILTER_TYPES.DATE_SWITCHER_V2]: DateSwitcherPill,\n [FILTER_TYPES.NUMBER_RANGE]: NumberRangePill,\n [FILTER_TYPES.NUMBER_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.FREE_TEXT_SEARCH]: FreeTextSearchPillPill,\n [FILTER_TYPES.FREE_TEXT_SEARCH_V2]: FreeTextSearchPillPill,\n} as const;\n\ninterface PillsFromDataTableFiltersProps {\n filters: DSDataTableT.Filter[];\n columns: DSDataTableT.Column[];\n onFiltersChange: (filters: DSDataTableT.Filter[]) => void;\n onPillRemove?: (remove: () => void) => void;\n customPillRenderers?: Record<string, React.ComponentType<DSDataTableT.FilterPillProps<unknown>>>;\n customPillRenderer?: React.ComponentType<DSDataTableT.FilterPillProps<unknown>>;\n}\n\nexport const PillsFromDataTableFilters: React.FC<PillsFromDataTableFiltersProps> = ({\n filters,\n columns,\n\n onFiltersChange,\n onPillRemove,\n customPillRenderers,\n customPillRenderer,\n}) => {\n const pillRefs = useMemo(() => {\n const refs: React.RefObject<HTMLElement>[] = [];\n for (let i = 0; i < filters.length; i += 1) refs.push(React.createRef());\n return refs;\n }, [filters.length]);\n return (\n <>\n {filters.map(({ id: column, type, value }, index) => {\n const matchedColumn = columns.find((col) => col.accessor === column);\n const columnHeader = matchedColumn?.pillLabel || matchedColumn?.Header;\n let Component:\n | TypescriptHelpersT.ObjectValues<typeof pillRenderMapper>\n | React.ComponentType<DSDataTableT.FilterPillProps<unknown>> = () => null;\n\n const filterType = type;\n if (customPillRenderers?.[column]) {\n Component = customPillRenderers[column];\n } else if (customPillRenderer) {\n Component = customPillRenderer;\n } else if (filterType in pillRenderMapper) {\n Component = pillRenderMapper[filterType as keyof typeof pillRenderMapper];\n }\n\n return (\n <Component\n key={column}\n columnHeader={typeof columnHeader === 'string' ? columnHeader : column}\n column={column}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n value={value as any}\n filters={filters}\n onFiltersChange={onFiltersChange}\n innerRef={pillRefs[index]}\n onPillRemove={onPillRemove}\n />\n );\n })}\n </>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADyDnB;AAxDJ,mBAA+B;AAC/B,wBAQO;AAEP,yBAA6B;AAE7B,MAAM,mBAAmB;AAAA,EACvB,CAAC,gCAAa,MAAM,GAAG;AAAA,EACvB,CAAC,gCAAa,SAAS,GAAG;AAAA,EAC1B,CAAC,gCAAa,YAAY,GAAG;AAAA,EAC7B,CAAC,gCAAa,eAAe,GAAG;AAAA,EAChC,CAAC,gCAAa,WAAW,GAAG;AAAA,EAC5B,CAAC,gCAAa,cAAc,GAAG;AAAA,EAC/B,CAAC,gCAAa,UAAU,GAAG;AAAA,EAC3B,CAAC,gCAAa,aAAa,GAAG;A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CAAC,GACH;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -114,7 +114,8 @@ const FiltersBar = () => {
|
|
|
114
114
|
getOwnerProps,
|
|
115
115
|
children: [
|
|
116
116
|
filters.map(({ id: column, type, value }, index) => {
|
|
117
|
-
const
|
|
117
|
+
const matchedColumn = visibleColumns.find((col) => col.accessor === column);
|
|
118
|
+
const columnHeader = matchedColumn?.pillLabel || matchedColumn?.Header;
|
|
118
119
|
let Component = () => null;
|
|
119
120
|
const filterType = type;
|
|
120
121
|
if (filterType in pillRenderMapper) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/FilterBar/FiltersBar.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { FILTER_TYPES } from '../../exported-related/index.js';\nimport {\n SelectPill,\n MultiSelectPill,\n SingleDatePill,\n DateRangePill,\n NumberRangePill,\n DateSwitcherPill,\n FreeTextSearchPillPill,\n} from './components/index.js';\nimport { StyledWrapper } from './styled.js';\nimport { DeprecatedDropdown } from './DeprecatedDropdown.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\n\nconst pillRenderMapper = {\n [FILTER_TYPES.SELECT]: SelectPill,\n [FILTER_TYPES.SELECT_V2]: SelectPill,\n [FILTER_TYPES.MULTI_SELECT]: MultiSelectPill,\n [FILTER_TYPES.MULTI_SELECT_V2]: MultiSelectPill,\n [FILTER_TYPES.SINGLE_DATE]: SingleDatePill,\n [FILTER_TYPES.SINGLE_DATE_V2]: SingleDatePill,\n [FILTER_TYPES.DATE_RANGE]: DateRangePill,\n [FILTER_TYPES.DATE_RANGE_V2]: DateRangePill,\n [FILTER_TYPES.DATE_SWITCHER]: DateSwitcherPill,\n [FILTER_TYPES.DATE_SWITCHER_V2]: DateSwitcherPill,\n [FILTER_TYPES.NUMBER_RANGE]: NumberRangePill,\n [FILTER_TYPES.NUMBER_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.FREE_TEXT_SEARCH]: FreeTextSearchPillPill,\n [FILTER_TYPES.FREE_TEXT_SEARCH_V2]: FreeTextSearchPillPill,\n} as const;\n\nexport const FiltersBar: React.ComponentType = () => {\n const width = usePropsStore((state) => state.width);\n const filterBarProps = usePropsStore((state) => state.filterBarProps);\n const onFiltersChange = usePropsStore((state) => state.onFiltersChange);\n const filters = usePropsStore((state) => state.filters);\n const visibleColumns = usePropsStore((state) => state.visibleColumns);\n const getOwnerProps = usePropsStore((store) => store.get);\n\n const [isOpen, setIsOpen] = useState(false);\n\n const pillGroupRefs = useMemo(() => {\n const refs: React.RefObject<HTMLElement>[] = [];\n for (let i = 0; i < filters.length; i += 1) refs.push(React.createRef());\n return refs;\n }, [filters.length]);\n\n const dropdownMenuRef = useRef<HTMLButtonElement | null>(null);\n\n const {\n filterBarAddonRenderer: FilterBarAddonRenderer,\n onClearAllFiltersClick,\n onDropdownMenuToggle,\n onDropdownMenuClickOutside,\n onDropdownMenuTriggerClick,\n isDropdownMenuOpen,\n } = filterBarProps || {};\n\n const removeAllFilters = useCallback(() => {\n onFiltersChange([]);\n onClearAllFiltersClick?.();\n setIsOpen(false);\n }, [onFiltersChange, onClearAllFiltersClick]);\n\n const onFilterBarClose = useCallback(() => {\n onDropdownMenuToggle?.(false, 'onClose');\n dropdownMenuRef.current?.focus();\n setIsOpen(false);\n }, [onDropdownMenuToggle]);\n\n const onFilterBarOpen = useCallback(() => {\n onDropdownMenuToggle?.(true, 'onOpen');\n setIsOpen(true);\n }, [onDropdownMenuToggle]);\n\n const onFilterBarOnClickOutside = useCallback(() => {\n onDropdownMenuToggle?.(false, 'onClickOutside');\n onDropdownMenuClickOutside?.();\n setIsOpen(false);\n }, [onDropdownMenuClickOutside, onDropdownMenuToggle]);\n\n const onTriggerClick = useCallback(() => {\n onDropdownMenuTriggerClick?.();\n onFilterBarOpen();\n }, [onDropdownMenuTriggerClick, onFilterBarOpen]);\n\n const finalIsOpen = useMemo(() => {\n if (typeof isDropdownMenuOpen === 'boolean') return isDropdownMenuOpen;\n return isOpen;\n }, [isDropdownMenuOpen, isOpen]);\n\n return (\n <StyledWrapper\n width={width}\n /**\n * PUI-17317 - [DataTable] No announcement is made when a filter is added or removed\n * https://jira.elliemae.io/browse/PUI-17317\n *\n * ## Problem\n * Screen reader users received no feedback when filters were added or removed.\n * The attempted fix \u2014 placing `aria-live=\"polite\"` + `aria-relevant=\"additions removals\"`\n * on this wrapper \u2014 was unreliable across screen readers and, when it did fire,\n * produced meaningless announcements by concatenating the pill label with its\n * remove-button aria-label, e.g.:\n * \"React Dev Remove React Dev from Position\"\n *\n * WCAG recommends contextual messages like \"Filter applied: Currency = USD\".\n * That level of specificity cannot be achieved automatically through aria attributes alone.\n *\n * ## Decision\n * `aria-live` / `aria-relevant` were removed from this component.\n * The responsibility for announcing filter changes is delegated to the consumer,\n * who has access to the full filter state and can compose meaningful messages like:\n *\n * e.g: Multi Select Filter\n *\n * - \"Filter added: Position: React dev\"\n * - \"Filter updated: Position: React dev, Fullstack dev\"\n * - \"Filter removed: Position: React dev, Fullstack dev\"\n */\n /*\n aria-live=\"polite\"\n aria-relevant=\"additions removals\" \n */\n gutter=\"xs\"\n getOwnerProps={getOwnerProps}\n >\n {filters.map(({ id: column, type, value }, index) => {\n const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiGnB;AAjGJ,mBAA8D;AAE9D,8BAA6B;AAC7B,wBAQO;AACP,oBAA8B;AAC9B,gCAAmC;AAEnC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Q,MAAM,CAAC;AAEnB,QAAM,sBAAkB,qBAAiC,IAAI;AAE7D,QAAM;AAAA,IACJ,wBAAwB;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,kBAAkB,CAAC;AAEvB,QAAM,uBAAmB,0BAAY,MAAM;AACzC,oBAAgB,CAAC,CAAC;AAClB,6BAAyB;AACzB,cAAU,KAAK;AAAA,EACjB,GAAG,CAAC,iBAAiB,sBAAsB,CAAC;AAE5C,QAAM,uBAAmB,0BAAY,MAAM;AACzC,2BAAuB,OAAO,SAAS;AACvC,oBAAgB,SAAS,MAAM;AAC/B,cAAU,KAAK;AAAA,EACjB,GAAG,CAAC,oBAAoB,CAAC;AAEzB,QAAM,sBAAkB,0BAAY,MAAM;AACxC,2BAAuB,MAAM,QAAQ;AACrC,cAAU,IAAI;AAAA,EAChB,GAAG,CAAC,oBAAoB,CAAC;AAEzB,QAAM,gCAA4B,0BAAY,MAAM;AAClD,2BAAuB,OAAO,gBAAgB;AAC9C,iCAA6B;AAC7B,cAAU,KAAK;AAAA,EACjB,GAAG,CAAC,4BAA4B,oBAAoB,CAAC;AAErD,QAAM,qBAAiB,0BAAY,MAAM;AACvC,iCAA6B;AAC7B,oBAAgB;AAAA,EAClB,GAAG,CAAC,4BAA4B,eAAe,CAAC;AAEhD,QAAM,kBAAc,sBAAQ,MAAM;AAChC,QAAI,OAAO,uBAAuB,UAAW,QAAO;AACpD,WAAO;AAAA,EACT,GAAG,CAAC,oBAAoB,MAAM,CAAC;AAE/B,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MA+BA,QAAO;AAAA,MACP;AAAA,MAEC;AAAA,gBAAQ,IAAI,CAAC,EAAE,IAAI,QAAQ,MAAM,MAAM,GAAG,UAAU;AACnD,gBAAM,
|
|
4
|
+
"sourcesContent": ["import React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { FILTER_TYPES } from '../../exported-related/index.js';\nimport {\n SelectPill,\n MultiSelectPill,\n SingleDatePill,\n DateRangePill,\n NumberRangePill,\n DateSwitcherPill,\n FreeTextSearchPillPill,\n} from './components/index.js';\nimport { StyledWrapper } from './styled.js';\nimport { DeprecatedDropdown } from './DeprecatedDropdown.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\n\nconst pillRenderMapper = {\n [FILTER_TYPES.SELECT]: SelectPill,\n [FILTER_TYPES.SELECT_V2]: SelectPill,\n [FILTER_TYPES.MULTI_SELECT]: MultiSelectPill,\n [FILTER_TYPES.MULTI_SELECT_V2]: MultiSelectPill,\n [FILTER_TYPES.SINGLE_DATE]: SingleDatePill,\n [FILTER_TYPES.SINGLE_DATE_V2]: SingleDatePill,\n [FILTER_TYPES.DATE_RANGE]: DateRangePill,\n [FILTER_TYPES.DATE_RANGE_V2]: DateRangePill,\n [FILTER_TYPES.DATE_SWITCHER]: DateSwitcherPill,\n [FILTER_TYPES.DATE_SWITCHER_V2]: DateSwitcherPill,\n [FILTER_TYPES.NUMBER_RANGE]: NumberRangePill,\n [FILTER_TYPES.NUMBER_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.FREE_TEXT_SEARCH]: FreeTextSearchPillPill,\n [FILTER_TYPES.FREE_TEXT_SEARCH_V2]: FreeTextSearchPillPill,\n} as const;\n\nexport const FiltersBar: React.ComponentType = () => {\n const width = usePropsStore((state) => state.width);\n const filterBarProps = usePropsStore((state) => state.filterBarProps);\n const onFiltersChange = usePropsStore((state) => state.onFiltersChange);\n const filters = usePropsStore((state) => state.filters);\n const visibleColumns = usePropsStore((state) => state.visibleColumns);\n const getOwnerProps = usePropsStore((store) => store.get);\n\n const [isOpen, setIsOpen] = useState(false);\n\n const pillGroupRefs = useMemo(() => {\n const refs: React.RefObject<HTMLElement>[] = [];\n for (let i = 0; i < filters.length; i += 1) refs.push(React.createRef());\n return refs;\n }, [filters.length]);\n\n const dropdownMenuRef = useRef<HTMLButtonElement | null>(null);\n\n const {\n filterBarAddonRenderer: FilterBarAddonRenderer,\n onClearAllFiltersClick,\n onDropdownMenuToggle,\n onDropdownMenuClickOutside,\n onDropdownMenuTriggerClick,\n isDropdownMenuOpen,\n } = filterBarProps || {};\n\n const removeAllFilters = useCallback(() => {\n onFiltersChange([]);\n onClearAllFiltersClick?.();\n setIsOpen(false);\n }, [onFiltersChange, onClearAllFiltersClick]);\n\n const onFilterBarClose = useCallback(() => {\n onDropdownMenuToggle?.(false, 'onClose');\n dropdownMenuRef.current?.focus();\n setIsOpen(false);\n }, [onDropdownMenuToggle]);\n\n const onFilterBarOpen = useCallback(() => {\n onDropdownMenuToggle?.(true, 'onOpen');\n setIsOpen(true);\n }, [onDropdownMenuToggle]);\n\n const onFilterBarOnClickOutside = useCallback(() => {\n onDropdownMenuToggle?.(false, 'onClickOutside');\n onDropdownMenuClickOutside?.();\n setIsOpen(false);\n }, [onDropdownMenuClickOutside, onDropdownMenuToggle]);\n\n const onTriggerClick = useCallback(() => {\n onDropdownMenuTriggerClick?.();\n onFilterBarOpen();\n }, [onDropdownMenuTriggerClick, onFilterBarOpen]);\n\n const finalIsOpen = useMemo(() => {\n if (typeof isDropdownMenuOpen === 'boolean') return isDropdownMenuOpen;\n return isOpen;\n }, [isDropdownMenuOpen, isOpen]);\n\n return (\n <StyledWrapper\n width={width}\n /**\n * PUI-17317 - [DataTable] No announcement is made when a filter is added or removed\n * https://jira.elliemae.io/browse/PUI-17317\n *\n * ## Problem\n * Screen reader users received no feedback when filters were added or removed.\n * The attempted fix \u2014 placing `aria-live=\"polite\"` + `aria-relevant=\"additions removals\"`\n * on this wrapper \u2014 was unreliable across screen readers and, when it did fire,\n * produced meaningless announcements by concatenating the pill label with its\n * remove-button aria-label, e.g.:\n * \"React Dev Remove React Dev from Position\"\n *\n * WCAG recommends contextual messages like \"Filter applied: Currency = USD\".\n * That level of specificity cannot be achieved automatically through aria attributes alone.\n *\n * ## Decision\n * `aria-live` / `aria-relevant` were removed from this component.\n * The responsibility for announcing filter changes is delegated to the consumer,\n * who has access to the full filter state and can compose meaningful messages like:\n *\n * e.g: Multi Select Filter\n *\n * - \"Filter added: Position: React dev\"\n * - \"Filter updated: Position: React dev, Fullstack dev\"\n * - \"Filter removed: Position: React dev, Fullstack dev\"\n */\n /*\n aria-live=\"polite\"\n aria-relevant=\"additions removals\" \n */\n gutter=\"xs\"\n getOwnerProps={getOwnerProps}\n >\n {filters.map(({ id: column, type, value }, index) => {\n const matchedColumn = visibleColumns.find((col) => col.accessor === column);\n const columnHeader = matchedColumn?.pillLabel || matchedColumn?.Header;\n let Component:\n | TypescriptHelpersT.ObjectValues<typeof pillRenderMapper>\n | React.ComponentType<DSDataTableT.FilterPillProps<unknown>> = () => null;\n\n const filterType = type;\n if (filterType in pillRenderMapper) {\n Component = pillRenderMapper[filterType as keyof typeof pillRenderMapper];\n } else if (filterBarProps?.customPillRenderer) {\n Component = filterBarProps.customPillRenderer;\n }\n return (\n <Component\n key={column}\n columnHeader={typeof columnHeader === 'string' ? columnHeader : column}\n column={column}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n value={value as any}\n filters={filters}\n onFiltersChange={onFiltersChange}\n prevRef={pillGroupRefs[index - 1]}\n innerRef={pillGroupRefs[index]}\n nextRef={pillGroupRefs[index + 1] ?? dropdownMenuRef}\n />\n );\n })}\n {FilterBarAddonRenderer ? (\n <FilterBarAddonRenderer innerRef={dropdownMenuRef} />\n ) : (\n <DeprecatedDropdown\n finalIsOpen={finalIsOpen}\n onFilterBarClose={onFilterBarClose}\n onFilterBarOnClickOutside={onFilterBarOnClickOutside}\n removeAllFilters={removeAllFilters}\n filterBarProps={filterBarProps}\n dropdownMenuRef={dropdownMenuRef}\n onTriggerClick={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,IAAC;AAAA;AAAA,MACC;AAAA,MA+BA,QAAO;AAAA,MACP;AAAA,MAEC;AAAA,gBAAQ,IAAI,CAAC,EAAE,IAAI,QAAQ,MAAM,MAAM,GAAG,UAAU;AACnD,gBAAM,gBAAgB,eAAe,KAAK,CAAC,QAAQ,IAAI,aAAa,MAAM;AAC1E,gBAAM,eAAe,eAAe,aAAa,eAAe;AAChE,cAAI,YAE6D,MAAM;AAEvE,gBAAM,aAAa;AACnB,cAAI,cAAc,kBAAkB;AAClC,wBAAY,iBAAiB,UAA2C;AAAA,UAC1E,WAAW,gBAAgB,oBAAoB;AAC7C,wBAAY,eAAe;AAAA,UAC7B;AACA,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC,cAAc,OAAO,iBAAiB,WAAW,eAAe;AAAA,cAChE;AAAA,cAEA;AAAA,cACA;AAAA,cACA;AAAA,cACA,SAAS,cAAc,QAAQ,CAAC;AAAA,cAChC,UAAU,cAAc,KAAK;AAAA,cAC7B,SAAS,cAAc,QAAQ,CAAC,KAAK;AAAA;AAAA,YAThC;AAAA,UAUP;AAAA,QAEJ,CAAC;AAAA,QACA,yBACC,4CAAC,0BAAuB,UAAU,iBAAiB,IAEnD;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -45,23 +45,9 @@ var import_useHeaderCellHandlers = require("./useHeaderCellHandlers.js");
|
|
|
45
45
|
var import_useHeaderCellConfig = require("./useHeaderCellConfig.js");
|
|
46
46
|
var import_constants = require("../../configs/constants.js");
|
|
47
47
|
var import_HeaderCellTitle = require("./HeaderCellTitle.js");
|
|
48
|
+
var import_buildScreenReaderInstructions = require("./buildScreenReaderInstructions.js");
|
|
48
49
|
var import_createInternalAndPropsContext = require("../../configs/useStore/createInternalAndPropsContext.js");
|
|
49
|
-
const
|
|
50
|
-
colSpan,
|
|
51
|
-
draggable,
|
|
52
|
-
filterable,
|
|
53
|
-
sortable
|
|
54
|
-
}) => {
|
|
55
|
-
const preffix = colSpan === 1 ? "" : "Column Group. ";
|
|
56
|
-
if (!draggable && !filterable && !sortable) return preffix;
|
|
57
|
-
let message = sortable ? "You can sort the data ascendingly/descendingly by this column. Use the up / down arrows keys to do so" : "";
|
|
58
|
-
if (draggable && filterable) {
|
|
59
|
-
message = `This column is draggable and filterable. To enable these interactions press the enter key. ${message}`;
|
|
60
|
-
} else if (draggable || filterable) {
|
|
61
|
-
message = `This column is ${draggable ? "draggable" : "filterable"}. To enable this interaction press the enter key. ${message}`;
|
|
62
|
-
}
|
|
63
|
-
return `${preffix}${message}`;
|
|
64
|
-
};
|
|
50
|
+
const HIDDEN_STYLE = { display: "none" };
|
|
65
51
|
const HeaderCell = (props) => {
|
|
66
52
|
const { column, isDragOverlay, colSpan } = props;
|
|
67
53
|
const disabledRows = (0, import_createInternalAndPropsContext.usePropsStore)((state) => state.disabledRows);
|
|
@@ -146,7 +132,7 @@ const HeaderCell = (props) => {
|
|
|
146
132
|
handleSort
|
|
147
133
|
]);
|
|
148
134
|
const DnDHandleComponent = (0, import_react.useMemo)(
|
|
149
|
-
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, { mr: "2px", alignItems: "flex-start", style: { position: "relative"
|
|
135
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, { mr: "2px", height: "fit-content", py: "2px", mt: "2px", alignItems: "flex-start", style: { position: "relative" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledFocusWithin, { hideFocus: isDragging, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
150
136
|
import_DnDHandle.DragHandle,
|
|
151
137
|
{
|
|
152
138
|
innerRef: dragHandleRef,
|
|
@@ -160,7 +146,14 @@ const HeaderCell = (props) => {
|
|
|
160
146
|
[column.id, disabledRows, domIdAffix, isDragOverlay, isDragging, reduxHeader?.withTabStops]
|
|
161
147
|
);
|
|
162
148
|
const screenReaderInstructionsId = `sr-${column.id}-instructions-${domIdAffix}`.replace(/ /g, "");
|
|
163
|
-
|
|
149
|
+
const instructions = (0, import_buildScreenReaderInstructions.buildScreenReaderInstructions)({
|
|
150
|
+
colSpan,
|
|
151
|
+
draggable: dragAndDropColumns && column.disableDnD !== true,
|
|
152
|
+
filterable: hasFilter,
|
|
153
|
+
sortable: column.canSort ?? false,
|
|
154
|
+
resizable: shouldShowResize
|
|
155
|
+
});
|
|
156
|
+
const headTh = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
164
157
|
import_styled.StyledHeadTh,
|
|
165
158
|
{
|
|
166
159
|
column,
|
|
@@ -184,14 +177,10 @@ const HeaderCell = (props) => {
|
|
|
184
177
|
rightIcons,
|
|
185
178
|
shouldShowResize && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_HeaderResizer.HeaderResizer, { column, innerRef: resizeHandlerRef, isReachable: reduxHeader?.withTabStops ?? false })
|
|
186
179
|
] }),
|
|
187
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { id: screenReaderInstructionsId, style:
|
|
188
|
-
colSpan,
|
|
189
|
-
draggable: dragAndDropColumns && column.disableDnD !== true,
|
|
190
|
-
filterable: hasFilter,
|
|
191
|
-
sortable: column.canSort ?? false
|
|
192
|
-
}) })
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { id: screenReaderInstructionsId, style: HIDDEN_STYLE, children: instructions })
|
|
193
181
|
]
|
|
194
182
|
}
|
|
195
183
|
);
|
|
184
|
+
return headTh;
|
|
196
185
|
};
|
|
197
186
|
//# sourceMappingURL=HeaderCell.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Headers/HeaderCell.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-nested-ternary */\n/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport React, { useCallback, useContext, useMemo, useRef } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledHeadTh, StyledHeaderRightIconsWrapper, StyledFocusWithin } from '../../styled.js';\nimport { SortByCaret } from '../SortByCaret.js';\nimport { DragHandle } from '../DnDHandle.js';\nimport { SortableItemContext } from '../HoC/SortableItemContext.js';\nimport { FilterMapItem } from '../Filters/index.js';\nimport { HeaderResizer } from './HeaderResizer.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { useHeaderCellHandlers } from './useHeaderCellHandlers.js';\nimport { useHeaderCellConfig } from './useHeaderCellConfig.js';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { HeaderCellTitle } from './HeaderCellTitle.js';\nimport { useInternalStore, usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-nested-ternary */\n/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport React, { useCallback, useContext, useMemo, useRef } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledHeadTh, StyledHeaderRightIconsWrapper, StyledFocusWithin } from '../../styled.js';\nimport { SortByCaret } from '../SortByCaret.js';\nimport { DragHandle } from '../DnDHandle.js';\nimport { SortableItemContext } from '../HoC/SortableItemContext.js';\nimport { FilterMapItem } from '../Filters/index.js';\nimport { HeaderResizer } from './HeaderResizer.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { useHeaderCellHandlers } from './useHeaderCellHandlers.js';\nimport { useHeaderCellConfig } from './useHeaderCellConfig.js';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { HeaderCellTitle } from './HeaderCellTitle.js';\nimport { buildScreenReaderInstructions } from './buildScreenReaderInstructions.js';\nimport { useInternalStore, usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\n\ninterface HeaderCellCompProps {\n column: DSDataTableT.InternalColumn;\n isDragOverlay?: boolean;\n colSpan: number;\n}\n\n/** Screen-reader instructions node \u2014 referenced via aria-describedby, never rendered visually. */\nconst HIDDEN_STYLE: React.CSSProperties = { display: 'none' };\n\nexport const HeaderCell: React.ComponentType<HeaderCellCompProps> = (props) => {\n const { column, isDragOverlay, colSpan } = props;\n const disabledRows = usePropsStore((state) => state.disabledRows);\n const dragAndDropColumns = usePropsStore((state) => state.dragAndDropColumns);\n const onFiltersChange = usePropsStore((state) => state.onFiltersChange);\n const filters = usePropsStore((state) => state.filters);\n const textWrap = usePropsStore((state) => state.textWrap);\n const noResultsMessage = usePropsStore((state) => state.noResultsMessage);\n const domIdAffix = usePropsStore((state) => state.domIdAffix);\n const noResultsSecondaryMessage = usePropsStore((state) => state.noResultsSecondaryMessage);\n const isEmptyContent = usePropsStore((state) => state.isEmptyContent);\n const firstFocuseableColumnHeaderId = usePropsStore((state) => state.firstFocuseableColumnHeaderId);\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = useCallback(\n () => ({\n columnId: column.id,\n firstFocuseableColumnHeaderId,\n }),\n [column.id, firstFocuseableColumnHeaderId],\n );\n const reference = useRef<HTMLDivElement | null>(null);\n\n const reduxHeaders = useInternalStore((state) => state.reduxHeaders);\n const reduxHeader = useMemo(() => reduxHeaders[column.id], [reduxHeaders, column]);\n const dragHandleRef = useRef<HTMLDivElement | null>(null);\n const filterIconRef = useRef<HTMLButtonElement | null>(null);\n const resizeHandlerRef = useRef<HTMLButtonElement | null>(null);\n const sortRef = useRef<HTMLButtonElement | null>(null);\n const { draggableProps } = useContext(SortableItemContext);\n\n const { hasFilter, hasDnD, hasSortingCaret, hasRightIcons, shouldShowDnD, hCols, isDragging, shouldShowResize } =\n useHeaderCellConfig(props);\n\n const { handleSort, ...handlers } = useHeaderCellHandlers({\n hasFilter,\n column,\n hasDnD,\n dragHandleRef,\n filterIconRef,\n resizeHandlerRef,\n sortRef,\n hasSortingCaret,\n isDragOverlay,\n draggableProps,\n referenceColumn: reference,\n });\n\n const rightIcons = useMemo(() => {\n if (!hasRightIcons) return null;\n return (\n <StyledHeaderRightIconsWrapper getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <FilterMapItem\n column={column}\n referenceColumn={!isDragOverlay ? reference.current : undefined}\n onFiltersChange={onFiltersChange}\n reduxHeader={reduxHeader}\n filters={filters}\n innerRef={filterIconRef}\n />\n {hasSortingCaret && (\n <SortByCaret\n isSortedDesc={column.isSortedDesc}\n onClick={(e) => {\n e.stopPropagation();\n handleSort(e as React.MouseEvent);\n }}\n isReachable={reduxHeader?.withTabStops ?? false}\n column={column}\n reduxHeader={reduxHeader}\n innerRef={sortRef}\n />\n )}\n </StyledHeaderRightIconsWrapper>\n );\n }, [\n hasRightIcons,\n getOwnerProps,\n getOwnerPropsArguments,\n column,\n isDragOverlay,\n onFiltersChange,\n reduxHeader,\n filters,\n hasSortingCaret,\n handleSort,\n ]);\n\n const DnDHandleComponent = useMemo(\n () => (\n <Grid mr=\"2px\" height=\"fit-content\" py=\"2px\" mt=\"2px\" alignItems=\"flex-start\" style={{ position: 'relative' }}>\n <StyledFocusWithin hideFocus={isDragging}>\n <DragHandle\n key={column.id}\n innerRef={dragHandleRef}\n isReachable={reduxHeader?.withTabStops ?? false}\n id={`header-dnd-handle-${column.id}-${domIdAffix}`}\n isDragOverlay={isDragOverlay}\n isDisabled={disabledRows[column.id]}\n />\n </StyledFocusWithin>\n </Grid>\n ),\n [column.id, disabledRows, domIdAffix, isDragOverlay, isDragging, reduxHeader?.withTabStops],\n );\n\n const screenReaderInstructionsId = `sr-${column.id}-instructions-${domIdAffix}`.replace(/ /g, '');\n const instructions = buildScreenReaderInstructions({\n colSpan,\n draggable: dragAndDropColumns && column.disableDnD !== true,\n filterable: hasFilter,\n sortable: column.canSort ?? false,\n resizable: shouldShowResize,\n });\n\n const headTh = (\n <StyledHeadTh\n column={column}\n onClick={handleSort}\n {...handlers}\n role=\"columnheader\"\n {...(isEmptyContent && column.id === firstFocuseableColumnHeaderId\n ? { 'aria-label': `${noResultsMessage}. ${noResultsSecondaryMessage ? `${noResultsSecondaryMessage}.` : ''}` }\n : {})}\n aria-describedby={screenReaderInstructionsId}\n aria-sort={hasSortingCaret ? (column.isSortedDesc ? 'descending' : 'ascending') : 'none'}\n data-testid={DATA_TESTID.DATA_TABLE_HEADER}\n tabIndex={column.isFocuseable === false ? -1 : 0}\n isDraggingActive={Boolean(draggableProps && draggableProps.active)}\n shouldShowDnD={shouldShowDnD}\n innerRef={reference}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Grid width=\"100%\" cols={hCols}>\n {shouldShowDnD && DnDHandleComponent}\n <HeaderCellTitle column={column} draggableProps={draggableProps} textWrap={textWrap} />\n {rightIcons}\n {shouldShowResize && (\n <HeaderResizer column={column} innerRef={resizeHandlerRef} isReachable={reduxHeader?.withTabStops ?? false} />\n )}\n </Grid>\n {/* Screen-reader instructions referenced by aria-describedby. display:none keeps them out of\n the header's name-from-content (so they are not read twice) while still being announced as\n the description \u2014 the same pattern used for filterable/sortable columns. */}\n <span id={screenReaderInstructionsId} style={HIDDEN_STYLE}>\n {instructions}\n </span>\n </StyledHeadTh>\n );\n\n return headTh;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8EjB;AA3EN,mBAAgE;AAChE,qBAAqB;AACrB,oBAA+E;AAC/E,yBAA4B;AAC5B,uBAA2B;AAC3B,iCAAoC;AACpC,qBAA8B;AAC9B,2BAA8B;AAE9B,mCAAsC;AACtC,iCAAoC;A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
|
7
7
|
}
|
|
@@ -38,12 +38,26 @@ var import_styled = require("../../styled.js");
|
|
|
38
38
|
var import_useHeaderResizer = require("./useHeaderResizer.js");
|
|
39
39
|
var import_createInternalAndPropsContext = require("../../configs/useStore/createInternalAndPropsContext.js");
|
|
40
40
|
const stopPropagation = (e) => e.stopPropagation();
|
|
41
|
+
const HIDDEN_STYLE = { display: "none" };
|
|
42
|
+
const SR_ONLY_STYLE = {
|
|
43
|
+
position: "absolute",
|
|
44
|
+
width: 1,
|
|
45
|
+
height: 1,
|
|
46
|
+
overflow: "hidden",
|
|
47
|
+
clip: "rect(0 0 0 0)",
|
|
48
|
+
clipPath: "inset(50%)",
|
|
49
|
+
whiteSpace: "nowrap"
|
|
50
|
+
};
|
|
51
|
+
const RESIZE_INSTRUCTION = "Use the left and right arrow keys to increase or decrease the column width.";
|
|
41
52
|
const HeaderResizer = ({ column, innerRef, isReachable }) => {
|
|
42
53
|
const { isResizing, onResizeStart, onResizeEnd, onResizeHandler, handleKeyboardResize } = (0, import_useHeaderResizer.useHeaderResizer)({
|
|
43
54
|
columnId: column.id,
|
|
44
55
|
innerRef
|
|
45
56
|
});
|
|
46
57
|
const getOwnerProps = (0, import_createInternalAndPropsContext.usePropsStore)((store) => store.get);
|
|
58
|
+
const resizeLabel = typeof column.Header === "string" ? `Resize ${column.Header} column` : "Resize column";
|
|
59
|
+
const nameId = `resize-name-${column.id}`.replace(/ /g, "");
|
|
60
|
+
const instructionId = `resize-instr-${column.id}`.replace(/ /g, "");
|
|
47
61
|
(0, import_react.useEffect)(() => {
|
|
48
62
|
const addEvents = () => {
|
|
49
63
|
document.addEventListener("mousemove", onResizeHandler);
|
|
@@ -61,22 +75,30 @@ const HeaderResizer = ({ column, innerRef, isReachable }) => {
|
|
|
61
75
|
else removeEvents();
|
|
62
76
|
return removeEvents;
|
|
63
77
|
}, [isResizing, onResizeHandler, onResizeEnd]);
|
|
64
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
|
+
import_styled.StyledResizer,
|
|
81
|
+
{
|
|
82
|
+
buttonType: "raw",
|
|
83
|
+
type: "button",
|
|
84
|
+
role: "application",
|
|
85
|
+
"aria-roledescription": "column resizer",
|
|
86
|
+
"aria-labelledby": nameId,
|
|
87
|
+
"aria-describedby": instructionId,
|
|
88
|
+
"aria-hidden": isReachable ? void 0 : true,
|
|
89
|
+
tabIndex: isReachable ? 0 : -1,
|
|
90
|
+
innerRef,
|
|
91
|
+
onMouseDown: onResizeStart,
|
|
92
|
+
onTouchStart: onResizeStart,
|
|
93
|
+
onMouseUp: onResizeEnd,
|
|
94
|
+
onTouchEnd: onResizeEnd,
|
|
95
|
+
onClick: stopPropagation,
|
|
96
|
+
onKeyDown: handleKeyboardResize,
|
|
97
|
+
getOwnerProps,
|
|
98
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { id: nameId, style: SR_ONLY_STYLE, children: resizeLabel })
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { id: instructionId, style: HIDDEN_STYLE, children: RESIZE_INSTRUCTION })
|
|
102
|
+
] });
|
|
81
103
|
};
|
|
82
104
|
//# sourceMappingURL=HeaderResizer.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Headers/HeaderResizer.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useEffect } from 'react';\nimport { StyledResizer } from '../../styled.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { useHeaderResizer } from './useHeaderResizer.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\n\nconst stopPropagation = (e: React.MouseEvent) => e.stopPropagation();\n\nexport const HeaderResizer: React.ComponentType<{\n column: DSDataTableT.InternalColumn;\n innerRef: React.MutableRefObject<
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useEffect } from 'react';\nimport { StyledResizer } from '../../styled.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { useHeaderResizer } from './useHeaderResizer.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\n\nconst stopPropagation = (e: React.MouseEvent | React.KeyboardEvent) => e.stopPropagation();\n\n/** Operating-instruction node \u2014 announced via aria-describedby when the resizer is focused. */\nconst HIDDEN_STYLE: React.CSSProperties = { display: 'none' };\n/**\n * Screen-reader-only style for the button's name-from-content. A local phrasing-level `<span>` is used\n * (not the package's `ScreenReaderOnly`, which is a `<div>` \u2014 invalid inside a `<button>`).\n */\nconst SR_ONLY_STYLE: React.CSSProperties = {\n position: 'absolute',\n width: 1,\n height: 1,\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\n};\nconst RESIZE_INSTRUCTION = 'Use the left and right arrow keys to increase or decrease the column width.';\n\nexport const HeaderResizer: React.ComponentType<{\n column: DSDataTableT.InternalColumn;\n innerRef: React.MutableRefObject<HTMLButtonElement | null>;\n isReachable: boolean;\n}> = ({ column, innerRef, isReachable }) => {\n const { isResizing, onResizeStart, onResizeEnd, onResizeHandler, handleKeyboardResize } = useHeaderResizer({\n columnId: column.id,\n innerRef,\n });\n const getOwnerProps = usePropsStore((store) => store.get);\n\n const resizeLabel = typeof column.Header === 'string' ? `Resize ${column.Header} column` : 'Resize column';\n const nameId = `resize-name-${column.id}`.replace(/ /g, '');\n const instructionId = `resize-instr-${column.id}`.replace(/ /g, '');\n\n // This setups the event listeners for the resize (only for mouse)\n // It reacts to the isResizing state change\n useEffect(() => {\n const addEvents = () => {\n document.addEventListener('mousemove', onResizeHandler);\n document.addEventListener('touchmove', onResizeHandler);\n document.addEventListener('mouseup', onResizeEnd);\n document.addEventListener('touchend', onResizeEnd);\n };\n const removeEvents = () => {\n document.removeEventListener('mousemove', onResizeHandler);\n document.removeEventListener('touchmove', onResizeHandler);\n document.removeEventListener('mouseup', onResizeEnd);\n document.removeEventListener('touchend', onResizeEnd);\n };\n\n if (isResizing) addEvents();\n else removeEvents();\n\n // just in case the component is unmounted\n return removeEvents;\n }, [isResizing, onResizeHandler, onResizeEnd]);\n\n return (\n <>\n {/*\n PUI-17784 / PUI-15786: the resize handle is a DSButtonV3 (buttonType=\"raw\") \u2014 the native element is a\n <button> with NO value (this resize has no bounded range: resizing a column doesn't move a shared\n boundary, so slider/separator value semantics don't apply).\n\n INTERIM (until UX defines the Enter/Space interaction): the control is exposed as `role=\"application\"`\n with `aria-roledescription=\"column resizer\"`. A plain role=\"button\" that responds only to the arrow\n keys and does nothing on Enter/Space breaks the button-activation contract (SC 4.1.2). role=\"application\"\n removes that expectation and puts AT into pass-through mode so the arrow keys reach the widget (rather\n than moving the screen-reader virtual cursor / competing with horizontal scroll). Because application is\n NOT in the ARIA \"name from content\" set, the name is provided via `aria-labelledby` \u2192 the sr-only span\n (name-from-content would be ignored under this role). BLOCKING follow-up (UX-owned): Enter/Space\n activates a drag-and-drop-style resize mode; once delivered, role/aria-roledescription are removed and\n this reverts to a real button. See design.md D7/D8.\n\n It is a CHILD of the columnheader but `aria-hidden` while the header is not in child-navigation mode, so\n its name is NOT voiced as the header's descendant content on header focus. aria-hidden must never coexist\n with a focusable tab stop (axe aria-hidden-focus), so aria-hidden and tabIndex are driven by the SAME\n `isReachable` flag (hidden \u27FA tabIndex -1) \u2014 a per-focus toggle would make the resizer unreachable by Tab.\n How to operate it is conveyed via aria-describedby.\n */}\n <StyledResizer\n buttonType=\"raw\"\n type=\"button\"\n role=\"application\"\n aria-roledescription=\"column resizer\"\n aria-labelledby={nameId}\n aria-describedby={instructionId}\n aria-hidden={isReachable ? undefined : true}\n tabIndex={isReachable ? 0 : -1}\n innerRef={innerRef}\n onMouseDown={onResizeStart}\n onTouchStart={onResizeStart}\n onMouseUp={onResizeEnd}\n onTouchEnd={onResizeEnd}\n onClick={stopPropagation}\n onKeyDown={handleKeyboardResize}\n getOwnerProps={getOwnerProps}\n >\n <span id={nameId} style={SR_ONLY_STYLE}>\n {resizeLabel}\n </span>\n </StyledResizer>\n <span id={instructionId} style={HIDDEN_STYLE}>\n {RESIZE_INSTRUCTION}\n </span>\n </>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgEnB;AAhEJ,mBAAiC;AACjC,oBAA8B;AAE9B,8BAAiC;AACjC,2CAA8B;AAE9B,MAAM,kBAAkB,CAAC,MAA8C,EAAE,gBAAgB;AAGzF,MAAM,eAAoC,EAAE,SAAS,OAAO;AAK5D,MAAM,gBAAqC;AAAA,EACzC,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AAAA,EACV,YAAY;AACd;AACA,MAAM,qBAAqB;AAEpB,MAAM,gBAIR,CAAC,EAAE,QAAQ,UAAU,YAAY,MAAM;AAC1C,QAAM,EAAE,YAAY,eAAe,aAAa,iBAAiB,qBAAqB,QAAI,0CAAiB;AAAA,IACzG,UAAU,OAAO;AAAA,IACjB;AAAA,EACF,CAAC;AACD,QAAM,oBAAgB,oDAAc,CAAC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"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var buildScreenReaderInstructions_exports = {};
|
|
30
|
+
__export(buildScreenReaderInstructions_exports, {
|
|
31
|
+
buildScreenReaderInstructions: () => buildScreenReaderInstructions
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(buildScreenReaderInstructions_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
const joinAffordances = (items) => {
|
|
36
|
+
if (items.length <= 1) return items[0] ?? "";
|
|
37
|
+
if (items.length === 2) return `${items[0]} and ${items[1]}`;
|
|
38
|
+
return `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
|
|
39
|
+
};
|
|
40
|
+
const SORT_INSTRUCTION = "You can sort the data ascendingly or descendingly by this column. Use the up / down arrow keys to do so.";
|
|
41
|
+
const buildScreenReaderInstructions = ({
|
|
42
|
+
colSpan,
|
|
43
|
+
draggable,
|
|
44
|
+
filterable,
|
|
45
|
+
sortable,
|
|
46
|
+
resizable
|
|
47
|
+
}) => {
|
|
48
|
+
const prefix = colSpan === 1 ? "" : "Column Group. ";
|
|
49
|
+
const sentences = [];
|
|
50
|
+
const enterAffordances = [];
|
|
51
|
+
if (draggable) enterAffordances.push("draggable");
|
|
52
|
+
if (filterable) enterAffordances.push("filterable");
|
|
53
|
+
if (resizable) enterAffordances.push("resizable");
|
|
54
|
+
if (enterAffordances.length > 0) {
|
|
55
|
+
const interaction = enterAffordances.length > 1 ? "these interactions" : "this interaction";
|
|
56
|
+
sentences.push(
|
|
57
|
+
`This column is ${joinAffordances(enterAffordances)}. To enable ${interaction} press the enter key.`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
if (sortable) sentences.push(SORT_INSTRUCTION);
|
|
61
|
+
return `${prefix}${sentences.join(" ")}`;
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=buildScreenReaderInstructions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/Headers/buildScreenReaderInstructions.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Joins affordance words into a natural-language list:\n * ['a'] -> 'a'\n * ['a', 'b'] -> 'a and b'\n * ['a', 'b', 'c'] -> 'a, b and c'\n */\nconst joinAffordances = (items: string[]): string => {\n if (items.length <= 1) return items[0] ?? '';\n if (items.length === 2) return `${items[0]} and ${items[1]}`;\n return `${items.slice(0, -1).join(', ')} and ${items[items.length - 1]}`;\n};\n\nconst SORT_INSTRUCTION =\n 'You can sort the data ascendingly or descendingly by this column. Use the up / down arrow keys to do so.';\n\n/**\n * Builds the screen-reader instructions announced for a column header (via the header's\n * aria-describedby).\n *\n * Draggable, filterable and resizable share the SAME activation \u2014 pressing Enter on the focused\n * header reveals and focuses those controls (see useHeaderCellHandlers onKeyDown) \u2014 so they are\n * announced together as a single grammatical list with ONE \"press the enter key\" instruction, for\n * any combination/permutation, instead of repeating the instruction per affordance.\n *\n * Sorting is a distinct interaction (Up / Down arrow keys directly on the header, no Enter), so it\n * gets its own sentence. Wording pending a11y SME review.\n */\nexport const buildScreenReaderInstructions = ({\n colSpan,\n draggable,\n filterable,\n sortable,\n resizable,\n}: {\n colSpan: number;\n draggable: boolean;\n filterable: boolean;\n sortable: boolean;\n resizable: boolean;\n}): string => {\n const prefix = colSpan === 1 ? '' : 'Column Group. ';\n const sentences: string[] = [];\n\n // Enter-activated affordances \u2014 combined into one sentence regardless of which are present.\n const enterAffordances: string[] = [];\n if (draggable) enterAffordances.push('draggable');\n if (filterable) enterAffordances.push('filterable');\n if (resizable) enterAffordances.push('resizable');\n if (enterAffordances.length > 0) {\n const interaction = enterAffordances.length > 1 ? 'these interactions' : 'this interaction';\n sentences.push(\n `This column is ${joinAffordances(enterAffordances)}. To enable ${interaction} press the enter key.`,\n );\n }\n\n // Sorting uses the up / down arrow keys directly on the focused header.\n if (sortable) sentences.push(SORT_INSTRUCTION);\n\n return `${prefix}${sentences.join(' ')}`;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADMvB,MAAM,kBAAkB,CAAC,UAA4B;AACnD,MAAI,MAAM,UAAU,EAAG,QAAO,MAAM,CAAC,KAAK;AAC1C,MAAI,MAAM,WAAW,EAAG,QAAO,GAAG,MAAM,CAAC,CAAC,QAAQ,MAAM,CAAC,CAAC;AAC1D,SAAO,GAAG,MAAM,MAAM,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,QAAQ,MAAM,MAAM,SAAS,CAAC,CAAC;AACxE;AAEA,MAAM,mBACJ;AAcK,MAAM,gCAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMc;AACZ,QAAM,SAAS,YAAY,IAAI,KAAK;AACpC,QAAM,YAAsB,CAAC;AAG7B,QAAM,mBAA6B,CAAC;AACpC,MAAI,UAAW,kBAAiB,KAAK,WAAW;AAChD,MAAI,WAAY,kBAAiB,KAAK,YAAY;AAClD,MAAI,UAAW,kBAAiB,KAAK,WAAW;AAChD,MAAI,iBAAiB,SAAS,GAAG;AAC/B,UAAM,cAAc,iBAAiB,SAAS,IAAI,uBAAuB;AACzE,cAAU;AAAA,MACR,kBAAkB,gBAAgB,gBAAgB,CAAC,eAAe,WAAW;AAAA,IAC/E;AAAA,EACF;AAGA,MAAI,SAAU,WAAU,KAAK,gBAAgB;AAE7C,SAAO,GAAG,MAAM,GAAG,UAAU,KAAK,GAAG,CAAC;AACxC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Headers/useHeaderCellHandlers.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable max-params */\nimport { useCallback, useMemo } from 'react';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { useInternalStore, usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\ntype UseHeaderCellHandlersType = (args: {\n hasFilter: boolean;\n column: DSDataTableT.InternalColumn;\n hasDnD: boolean;\n dragHandleRef: React.MutableRefObject<HTMLDivElement | null>;\n sortRef: React.MutableRefObject<HTMLButtonElement | null>;\n filterIconRef: React.MutableRefObject<HTMLButtonElement | null>;\n resizeHandlerRef: React.MutableRefObject<
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable max-params */\nimport { useCallback, useMemo } from 'react';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { useInternalStore, usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\ntype UseHeaderCellHandlersType = (args: {\n hasFilter: boolean;\n column: DSDataTableT.InternalColumn;\n hasDnD: boolean;\n dragHandleRef: React.MutableRefObject<HTMLDivElement | null>;\n sortRef: React.MutableRefObject<HTMLButtonElement | null>;\n filterIconRef: React.MutableRefObject<HTMLButtonElement | null>;\n resizeHandlerRef: React.MutableRefObject<HTMLButtonElement | null>;\n hasSortingCaret: boolean;\n isDragOverlay?: boolean;\n draggableProps: DSDataTableT.DraggablePropsT;\n referenceColumn: React.MutableRefObject<HTMLDivElement | null>;\n}) => {\n onMouseEnter: React.MouseEventHandler;\n onMouseLeave: React.MouseEventHandler;\n handleSort: React.MouseEventHandler;\n onKeyDown: React.KeyboardEventHandler;\n onFocus: React.FocusEventHandler;\n onBlur: React.FocusEventHandler;\n};\n\n// TODO: reduxHeader was a mistake from the start.\n// Please remove this and make this logic more simple and\n// easy to follow.\nconst buildNextHeader = (\n reduxHeader: DSDataTableT.ReduxHeader,\n value: boolean,\n hasFilter: boolean,\n hasDnD: boolean,\n hasSortingCaret: boolean,\n withTabStops = false,\n) => ({\n hideFilterMenu: true, // Do this to overwrite it if it exists\n ...reduxHeader,\n hideFilterButton: !(hasFilter && value),\n showDnDHandle: hasDnD && value,\n showSortCaret: hasSortingCaret,\n withTabStops,\n});\n\nconst getNextSortedVisibleColumns = (\n visibleColumns: DSDataTableT.InternalColumn[],\n columnId: string,\n isSortedDesc: boolean,\n) => {\n const doit = (columns: DSDataTableT.InternalColumn[]) =>\n columns.map((col) => {\n const newCol = { ...col };\n delete newCol.isSortedDesc;\n if (col.id === columnId) {\n newCol.isSortedDesc = isSortedDesc;\n }\n if (newCol.columns) {\n newCol.columns = doit(newCol.columns);\n }\n return newCol;\n });\n return doit(visibleColumns);\n};\n\nexport const useHeaderCellHandlers: UseHeaderCellHandlersType = ({\n hasFilter,\n column,\n hasDnD,\n dragHandleRef,\n filterIconRef,\n sortRef,\n resizeHandlerRef,\n hasSortingCaret,\n isDragOverlay,\n draggableProps,\n referenceColumn,\n}) => {\n const onColumnSortChange = usePropsStore((state) => state.onColumnSortChange);\n const onColumnSort = usePropsStore((state) => state.onColumnSort);\n const visibleColumns = usePropsStore((state) => state.visibleColumns);\n const setFocusedRowId = useInternalStore((state) => state.setFocusedRowId);\n const patchHeader = useInternalStore((state) => state.patchHeader);\n const reduxHeaders = useInternalStore((state) => state.reduxHeaders);\n\n const reduxHeader = useMemo(() => reduxHeaders[column.id], [reduxHeaders, column]);\n\n const headerRef = referenceColumn.current;\n\n const onMouseEnter: React.MouseEventHandler = useCallback(() => {\n patchHeader(column.id, buildNextHeader(reduxHeader, true, hasFilter, hasDnD, hasSortingCaret));\n }, [column.id, hasDnD, hasFilter, patchHeader, reduxHeader, hasSortingCaret]);\n\n const onMouseLeave: React.MouseEventHandler = useCallback(() => {\n if (!headerRef?.contains(document.activeElement)) {\n patchHeader(column.id, buildNextHeader(reduxHeader, false, hasFilter, hasDnD, false));\n }\n }, [column.id, hasDnD, hasFilter, headerRef, patchHeader, reduxHeader]);\n\n const handleSort: React.MouseEventHandler = useCallback(() => {\n if (column.canSort) {\n onColumnSortChange?.({\n column: column.id,\n direction: column.isSortedDesc ? 'ASC' : 'DESC',\n });\n onColumnSort(\n getNextSortedVisibleColumns(visibleColumns, column.id, !column.isSortedDesc),\n column.id,\n column.isSortedDesc ? 'ASC' : 'DESC',\n );\n }\n }, [column.canSort, column.id, column.isSortedDesc, onColumnSort, onColumnSortChange, visibleColumns]);\n\n const isActive = draggableProps && draggableProps.active;\n\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n // we do the same as the draggable rows.\n // we stop the event if the overlay is active\n // main reason is the tab key\n if (isDragOverlay || isActive) {\n e.preventDefault();\n }\n\n if (e.currentTarget !== e.target) return;\n if (e.code === 'ArrowDown' && column.canSort) {\n e.preventDefault();\n onColumnSortChange?.({\n column: column.id,\n direction: 'DESC',\n });\n onColumnSort(getNextSortedVisibleColumns(visibleColumns, column.id, true), column.id, 'DESC');\n } else if (e.code === 'ArrowUp' && column.canSort) {\n e.preventDefault();\n onColumnSortChange?.({\n column: column.id,\n direction: 'ASC',\n });\n onColumnSort(getNextSortedVisibleColumns(visibleColumns, column.id, false), column.id, 'ASC');\n } else if (['Enter', 'Space'].includes(e.code)) {\n patchHeader(column.id, buildNextHeader(reduxHeader, true, hasFilter, hasDnD, hasSortingCaret, true));\n // Elements don't not yet exist\n setTimeout(() => {\n if (dragHandleRef.current) dragHandleRef.current.focus();\n else if (filterIconRef.current) filterIconRef.current.focus();\n else if (resizeHandlerRef.current) resizeHandlerRef.current.focus();\n else if (sortRef?.current) sortRef.current.focus();\n });\n }\n },\n [\n isDragOverlay,\n isActive,\n column.canSort,\n column.id,\n onColumnSortChange,\n onColumnSort,\n visibleColumns,\n patchHeader,\n reduxHeader,\n hasFilter,\n hasDnD,\n hasSortingCaret,\n dragHandleRef,\n filterIconRef,\n resizeHandlerRef,\n sortRef,\n ],\n );\n\n const onFocus: React.FocusEventHandler = useCallback(\n (e) => {\n // Don't do anything if focus wasn't placed in the element (bubling issues)\n const possibleTargets: (HTMLElement | null)[] = [\n dragHandleRef.current,\n filterIconRef.current,\n resizeHandlerRef.current,\n ];\n if (e.target === headerRef) {\n patchHeader(column.id, buildNextHeader(reduxHeader, true, hasFilter, hasDnD, hasSortingCaret));\n setFocusedRowId(null);\n }\n\n if (possibleTargets.includes(e.target as HTMLElement | null)) {\n patchHeader(column.id, {\n hideFilterButton: !hasFilter,\n showDnDHandle: hasDnD,\n withTabStops: true,\n });\n setFocusedRowId(null);\n }\n },\n [\n column.id,\n dragHandleRef,\n filterIconRef,\n hasDnD,\n hasFilter,\n headerRef,\n patchHeader,\n reduxHeader,\n resizeHandlerRef,\n setFocusedRowId,\n hasSortingCaret,\n ],\n );\n\n const onBlur: React.FocusEventHandler = useCallback(\n (e) => {\n // Don't do anything if blur was caused by going to a child\n if (e.relatedTarget === dragHandleRef.current) return;\n if (e.relatedTarget === filterIconRef.current) return;\n if (e.relatedTarget === resizeHandlerRef.current) return;\n if (e.relatedTarget === sortRef?.current) return;\n patchHeader(column.id, buildNextHeader(reduxHeader, false, hasFilter, hasDnD, false));\n },\n [dragHandleRef, filterIconRef, resizeHandlerRef, sortRef, patchHeader, column.id, reduxHeader, hasFilter, hasDnD],\n );\n\n return { onMouseEnter, onMouseLeave, handleSort, onKeyDown, onBlur, onFocus };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAqC;AAErC,2CAAgD;AAyBhD,MAAM,kBAAkB,CACtB,aACA,OACA,WACA,QACA,iBACA,eAAe,WACX;AAAA,EACJ,gBAAgB;AAAA;AAAA,EAChB,GAAG;AAAA,EACH,kBAAkB,EAAE,aAAa;AAAA,EACjC,eAAe,UAAU;AAAA,EACzB,eAAe;AAAA,EACf;AACF;AAEA,MAAM,8BAA8B,CAClC,gBACA,UACA,iBACG;AACH,QAAM,OAAO,CAAC,YACZ,QAAQ,IAAI,CAAC,QAAQ;AACnB,UAAM,SAAS,EAAE,GAAG,IAAI;AACxB,WAAO,OAAO;AACd,QAAI,IAAI,OAAO,UAAU;AACvB,aAAO,eAAe;AAAA,IACxB;AACA,QAAI,OAAO,SAAS;AAClB,aAAO,UAAU,KAAK,OAAO,OAAO;AAAA,IACtC;AACA,WAAO;AAAA,EACT,CAAC;AACH,SAAO,KAAK,cAAc;AAC5B;AA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|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Headers/useHeaderResizer.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { cloneDeep } from 'lodash-es';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport {\n changeGridLayout,\n getGridLayout,\n removeGridLayout,\n setSubColumnsGridLayout,\n} from '../../helpers/gridLayoutHelpers.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\n\n// if number > max => max\n// if number < min => min\n// else => number\nconst narrow = (value: number, min: number | undefined, max: number | undefined): number =>\n Math.min(Math.max(value, min ?? 30), max ?? Infinity);\n\n// Returns the delta of the keyboard event\nconst getCorrectDelta = (e: React.KeyboardEvent) => {\n let multiplier = 1;\n\n if (e.shiftKey) multiplier *= 5;\n if (e.altKey) multiplier *= 10;\n\n if (e.code === 'ArrowLeft') {\n return -multiplier;\n }\n if (e.code === 'ArrowRight') {\n return multiplier;\n }\n return 0;\n};\n\nexport const useHeaderResizer = ({\n columnId,\n innerRef,\n}: {\n columnId: string;\n innerRef: React.MutableRefObject<
|
|
4
|
+
"sourcesContent": ["import { cloneDeep } from 'lodash-es';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport {\n changeGridLayout,\n getGridLayout,\n removeGridLayout,\n setSubColumnsGridLayout,\n} from '../../helpers/gridLayoutHelpers.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\n\n// if number > max => max\n// if number < min => min\n// else => number\nconst narrow = (value: number, min: number | undefined, max: number | undefined): number =>\n Math.min(Math.max(value, min ?? 30), max ?? Infinity);\n\n// Returns the delta of the keyboard event\nconst getCorrectDelta = (e: React.KeyboardEvent) => {\n let multiplier = 1;\n\n if (e.shiftKey) multiplier *= 5;\n if (e.altKey) multiplier *= 10;\n\n if (e.code === 'ArrowLeft') {\n return -multiplier;\n }\n if (e.code === 'ArrowRight') {\n return multiplier;\n }\n return 0;\n};\n\nexport const useHeaderResizer = ({\n columnId,\n innerRef,\n}: {\n columnId: string;\n innerRef: React.MutableRefObject<HTMLButtonElement | null>;\n}) => {\n const visibleColumns = usePropsStore((state) => state.visibleColumns);\n const onColumnResize = usePropsStore((state) => state.onColumnResize);\n const onColumnSizeChange = usePropsStore((state) => state.onColumnSizeChange);\n const virtualListRef = usePropsStore((state) => state.virtualListRef);\n\n const [isResizing, setIsResizing] = useState(false);\n\n const visibleColumnsCopy = useMemo(() => cloneDeep(visibleColumns), [visibleColumns]);\n\n const visibleColumnsOnGridLayout = useMemo(\n () =>\n visibleColumnsCopy.reduce((acc, cur) => {\n if (cur.columns) {\n return acc.concat(cur.columns);\n }\n return acc.concat(cur);\n }, [] as DSDataTableT.InternalColumn[]),\n [visibleColumnsCopy],\n );\n\n const realColumnIndex = useMemo(\n () => visibleColumnsOnGridLayout.findIndex((col) => col.id === columnId),\n [columnId, visibleColumnsOnGridLayout],\n );\n\n const realColumnIndexRef = React.useRef(realColumnIndex);\n realColumnIndexRef.current = realColumnIndex;\n\n // Notifies the user of the change in the column size\n const pushColumnSizeChange = useCallback(\n (nextWidth: number) => {\n // PUI-12695: Avoid unnecessary calls to onColumnResize\n // Avoid calling onColumnResize if the width of the column has not changed\n // unnecessary calls to onColumnResize can cause performance issues (next resizes were not working)\n if (nextWidth === visibleColumnsOnGridLayout[realColumnIndexRef.current].width) return;\n onColumnResize?.(columnId, nextWidth);\n // this next line is updating also the visibleColumnsCopy via mutable changes\n // the mutable changes here works because what we mutate is a cloneDeep of the columns\n visibleColumnsOnGridLayout[realColumnIndexRef.current].width = nextWidth;\n onColumnSizeChange(visibleColumnsCopy, columnId, nextWidth);\n },\n [columnId, onColumnResize, onColumnSizeChange, realColumnIndexRef, visibleColumnsCopy, visibleColumnsOnGridLayout],\n );\n\n const onResizeStart = useCallback(() => {\n setIsResizing(true);\n }, []);\n\n const onResizeEnd = useCallback(() => {\n setIsResizing(false);\n pushColumnSizeChange(getGridLayout(virtualListRef.current)[realColumnIndexRef.current]);\n removeGridLayout(virtualListRef.current);\n }, [pushColumnSizeChange, virtualListRef, realColumnIndexRef]);\n\n // Mouse resize\n const onResizeHandler = useCallback(\n (e: MouseEvent | TouchEvent) => {\n if (realColumnIndexRef.current === -1) return;\n\n const delta =\n ('clientX' in e ? e.clientX : e.touches[0].clientX) - (innerRef.current?.getBoundingClientRect().x ?? 0); // delta in pixels\n\n const originalWidth = getGridLayout(virtualListRef.current)[realColumnIndexRef.current];\n\n const widthWithDelta = narrow(\n originalWidth + delta,\n visibleColumnsOnGridLayout[realColumnIndexRef.current].minWidth,\n visibleColumnsOnGridLayout[realColumnIndexRef.current].maxWidth,\n );\n\n changeGridLayout(virtualListRef.current, realColumnIndexRef.current, widthWithDelta);\n setSubColumnsGridLayout(virtualListRef.current, visibleColumnsCopy);\n\n // We will notify the user of the change in the column size only when the user releases the mouse button\n\n // To prevent text selection\n e.preventDefault();\n e.stopPropagation();\n },\n [innerRef, virtualListRef, visibleColumnsCopy, visibleColumnsOnGridLayout],\n );\n\n // Keyboard resize\n const handleKeyboardResize = useCallback(\n (e: React.KeyboardEvent) => {\n if (realColumnIndexRef.current === -1) return;\n\n if (e.key === 'Enter') {\n e.stopPropagation();\n }\n\n if (e.code === 'ArrowLeft' || e.code === 'ArrowRight') {\n e.preventDefault();\n }\n\n const delta = getCorrectDelta(e);\n\n if (delta === 0) return;\n\n const originalWidth = getGridLayout(virtualListRef.current)[realColumnIndexRef.current];\n\n const widthWithDelta = narrow(\n originalWidth + delta,\n visibleColumnsOnGridLayout[realColumnIndexRef.current].minWidth,\n visibleColumnsOnGridLayout[realColumnIndexRef.current].maxWidth,\n );\n\n changeGridLayout(virtualListRef.current, realColumnIndexRef.current, widthWithDelta);\n setSubColumnsGridLayout(virtualListRef.current, visibleColumnsCopy);\n\n pushColumnSizeChange(getGridLayout(virtualListRef.current)[realColumnIndexRef.current] + delta);\n removeGridLayout(virtualListRef.current);\n },\n [pushColumnSizeChange, virtualListRef, visibleColumnsCopy, visibleColumnsOnGridLayout],\n );\n\n return {\n isResizing,\n onResizeStart,\n onResizeEnd,\n onResizeHandler,\n handleKeyboardResize,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA0B;AAC1B,mBAAsD;AACtD,2CAA8B;AAC9B,+BAKO;AAMP,MAAM,SAAS,CAAC,OAAe,KAAyB,QACtD,KAAK,IAAI,KAAK,IAAI,OAAO,OAAO,EAAE,GAAG,OAAO,QAAQ;AAGtD,MAAM,kBAAkB,CAAC,MAA2B;AAClD,MAAI,aAAa;AAEjB,MAAI,EAAE,SAAU,eAAc;AAC9B,MAAI,EAAE,OAAQ,eAAc;AAE5B,MAAI,EAAE,SAAS,aAAa;AAC1B,WAAO,CAAC;AAAA,EACV;AACA,MAAI,EAAE,SAAS,cAAc;AAC3B,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AACF,MAGM;AACJ,QAAM,qBAAiB,oDAAc,CAAC,UAAU,MAAM,cAAc;AACpE,QAAM,qBAAiB,oDAAc,CAAC,UAAU,MAAM,cAAc;AACpE,QAAM,yBAAqB,oDAAc,CAAC,UAAU,MAAM,kBAAkB;AAC5E,QAAM,qBAAiB,oDAAc,CAAC,UAAU,MAAM,cAAc;AAEpE,QAAM,CAAC,YAAY,aAAa,QAAI,uBAAS,KAAK;AAElD,QAAM,yBAAqB,sBAAQ,UAAM,4BAAU,cAAc,GAAG,CAAC,cAAc,CAAC;AAEpF,QAAM,iCAA6B;AAAA,IACjC,MACE,mBAAmB,OAAO,CAAC,KAAK,QAAQ;AACtC,UAAI,IAAI,SAAS;AACf,eAAO,IAAI,OAAO,IA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D,2BAA2B,mBAAmB,OAAO,EAAE;AAAA,MACzD;AAEA,qDAAiB,eAAe,SAAS,mBAAmB,SAAS,cAAc;AACnF,4DAAwB,eAAe,SAAS,kBAAkB;AAKlE,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAAA,IACpB;AAAA,IACA,CAAC,UAAU,gBAAgB,oBAAoB,0BAA0B;AAAA,EAC3E;AAGA,QAAM,2BAAuB;AAAA,IAC3B,CAAC,MAA2B;AAC1B,UAAI,mBAAmB,YAAY,GAAI;AAEvC,UAAI,EAAE,QAAQ,SAAS;AACrB,UAAE,gBAAgB;AAAA,MACpB;AAEA,UAAI,EAAE,SAAS,eAAe,EAAE,SAAS,cAAc;AACrD,UAAE,eAAe;AAAA,MACnB;AAEA,YAAM,QAAQ,gBAAgB,CAAC;AAE/B,UAAI,UAAU,EAAG;AAEjB,YAAM,oBAAgB,wCAAc,eAAe,OAAO,EAAE,mBAAmB,OAAO;AAEtF,YAAM,iBAAiB;AAAA,QACrB,gBAAgB;AAAA,QAChB,2BAA2B,mBAAmB,OAAO,EAAE;AAAA,QACvD,2BAA2B,mBAAmB,OAAO,EAAE;AAAA,MACzD;AAEA,qDAAiB,eAAe,SAAS,mBAAmB,SAAS,cAAc;AACnF,4DAAwB,eAAe,SAAS,kBAAkB;AAElE,+BAAqB,wCAAc,eAAe,OAAO,EAAE,mBAAmB,OAAO,IAAI,KAAK;AAC9F,qDAAiB,eAAe,OAAO;AAAA,IACzC;AAAA,IACA,CAAC,sBAAsB,gBAAgB,oBAAoB,0BAA0B;AAAA,EACvF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -119,7 +119,10 @@ const DSDataTablePropTypes = {
|
|
|
119
119
|
alwaysDisplayEditIcon: import_ds_props_helpers.PropTypes.bool.description(
|
|
120
120
|
"Whereas to always show the edit icon on this column if it is editable"
|
|
121
121
|
),
|
|
122
|
-
textWrap: import_ds_props_helpers.PropTypes.oneOf(["wrap", "wrap-all", "truncate"]).description("How to wrap the text in the column")
|
|
122
|
+
textWrap: import_ds_props_helpers.PropTypes.oneOf(["wrap", "wrap-all", "truncate"]).description("How to wrap the text in the column"),
|
|
123
|
+
pillLabel: import_ds_props_helpers.PropTypes.string.description(
|
|
124
|
+
"Overrides the filter pill label text for this column when non-empty; defaults to the column Header"
|
|
125
|
+
)
|
|
123
126
|
})
|
|
124
127
|
).description("Array of columns").isRequired,
|
|
125
128
|
data: import_ds_props_helpers.PropTypes.arrayOf(
|