@elliemae/ds-data-table 3.12.0-next.0 → 3.12.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DataTable.js.map +1 -1
- package/dist/cjs/DataTableContext.js.map +1 -1
- package/dist/cjs/DataTableSchema.js.map +1 -1
- package/dist/cjs/addons/Columns/ColumnAction/ColumnAction.js.map +1 -1
- package/dist/cjs/addons/Columns/ColumnDragHandle/ColumnDragHandle.js.map +1 -1
- package/dist/cjs/addons/Columns/ColumnExpand/ColumnExpand.js.map +1 -1
- package/dist/cjs/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +1 -1
- package/dist/cjs/addons/Columns/ColumnSelectSingle/ColumnSelectSingle.js.map +1 -1
- package/dist/cjs/addons/Editables/DateEditableCell/DateEditableCell.js +2 -2
- package/dist/cjs/addons/Editables/DateEditableCell/DateEditableCell.js.map +2 -2
- package/dist/cjs/addons/Editables/index.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/CurrencyRangeFilter/index.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/DateRangeFilter/index.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/DateSwitcherFilter/index.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/NumberRangeFilter/index.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/SelectFilter/BaseSelectFilter.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/SelectFilter/MultiCreatableFilter.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/SelectFilter/MultiSelectFilter.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/SelectFilter/SingleCreatableFilter.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/SelectFilter/SingleSelectFilter.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/SingleDateFilter/index.js.map +1 -1
- package/dist/cjs/configs/useDatatableConfig.js.map +1 -1
- package/dist/cjs/configs/useInternalStateConfig.js.map +1 -1
- package/dist/cjs/configs/usePaginationConfig.js.map +1 -1
- package/dist/cjs/configs/useRowFlattenization.js.map +1 -1
- package/dist/cjs/configs/useTableColsWithAddons.js.map +1 -1
- package/dist/cjs/exported-related/FilterPopover/index.js.map +1 -1
- package/dist/cjs/exported-related/FilterPopover/types.js.map +1 -1
- package/dist/cjs/exported-related/FilterPopover/useGetFilterHandlers.js.map +2 -2
- package/dist/cjs/exported-related/FilterPopover/useGetFilterVisibility.js.map +1 -1
- package/dist/cjs/exported-related/Filters/applyOutOfTheBoxFilters.js.map +1 -1
- package/dist/cjs/exported-related/Filters/currencyRangeFilterFn.js.map +1 -1
- package/dist/cjs/exported-related/Filters/dateRangeFilterFn.js.map +1 -1
- package/dist/cjs/exported-related/Filters/dateSwitcherFilterFn.js.map +1 -1
- package/dist/cjs/exported-related/Filters/multiSelectFilterFn.js.map +1 -1
- package/dist/cjs/exported-related/Filters/numberRangeFilterFn.js.map +1 -1
- package/dist/cjs/exported-related/Filters/singleDateFilterFn.js.map +1 -1
- package/dist/cjs/exported-related/Filters/singleSelectFilterFn.js.map +1 -1
- package/dist/cjs/exported-related/Filters/types.js.map +1 -1
- package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
- package/dist/cjs/exported-related/RowRenderer/index.js.map +1 -1
- package/dist/cjs/exported-related/RowRenderer/useRowRendererHandlers.js.map +2 -2
- package/dist/cjs/exported-related/RowRenderer/useRowRendererProperties.js.map +1 -1
- package/dist/cjs/exported-related/RowRenderer/useRowStyle.js.map +1 -1
- package/dist/cjs/helpers/addCellData.js.map +1 -1
- package/dist/cjs/helpers/columnsToGrid.js.map +1 -1
- package/dist/cjs/helpers/getIdFromUniqueRowAccessor.js.map +1 -1
- package/dist/cjs/parts/Cells/Cell.js.map +1 -1
- package/dist/cjs/parts/Cells/index.js.map +1 -1
- package/dist/cjs/parts/Cells/useCellStyle.js.map +1 -1
- package/dist/cjs/parts/EmptyContent.js +6 -7
- package/dist/cjs/parts/EmptyContent.js.map +3 -3
- package/dist/cjs/parts/FilterBar/FiltersBar.js.map +1 -1
- package/dist/cjs/parts/FilterBar/components/DateRangePill.js.map +1 -1
- package/dist/cjs/parts/FilterBar/components/DateSwitcherPill.js.map +1 -1
- package/dist/cjs/parts/FilterBar/components/MultiSelectPill.js.map +1 -1
- package/dist/cjs/parts/FilterBar/components/NumberRangePill.js.map +1 -1
- package/dist/cjs/parts/FilterBar/components/SelectPill.js.map +1 -1
- package/dist/cjs/parts/FilterBar/components/SingleDatePill.js.map +1 -1
- package/dist/cjs/parts/FilterBar/types.js.map +1 -1
- package/dist/cjs/parts/Filters/index.js.map +1 -1
- package/dist/cjs/parts/Headers/HeaderCell.js.map +1 -1
- package/dist/cjs/parts/Headers/HeaderCellGroup.js.map +1 -1
- package/dist/cjs/parts/Headers/HeaderCellTitle.js.map +1 -1
- package/dist/cjs/parts/Headers/HeaderResizer.js.map +1 -1
- package/dist/cjs/parts/Headers/index.js.map +1 -1
- package/dist/cjs/parts/Headers/useHeaderCellConfig.js.map +1 -1
- package/dist/cjs/parts/Headers/useHeaderCellHandlers.js.map +1 -1
- package/dist/cjs/parts/HoC/DnDTreeContext.js.map +1 -1
- package/dist/cjs/parts/HoC/SortableItemContext.js.map +1 -1
- package/dist/cjs/parts/HoC/withConditionalDnDColumnContext.js +1 -1
- package/dist/cjs/parts/HoC/withConditionalDnDColumnContext.js.map +2 -2
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +1 -1
- package/dist/cjs/parts/HoC/withConditionalDnDSortableContext.js.map +1 -1
- package/dist/cjs/parts/HoC/withDnDSortableColumnContext.js +1 -1
- package/dist/cjs/parts/HoC/withDnDSortableColumnContext.js.map +2 -2
- package/dist/cjs/parts/HoC/withDnDSortableRowContext.js +1 -1
- package/dist/cjs/parts/HoC/withDnDSortableRowContext.js.map +2 -2
- package/dist/cjs/parts/RowVariants/RowVariantHeader.js.map +1 -1
- package/dist/cjs/parts/RowVariants/RowVariantPrimary.js.map +1 -1
- package/dist/cjs/parts/RowVariants/RowVariantSecondary.js.map +1 -1
- package/dist/cjs/parts/RowVariants/RowVariantSkeleton.js.map +1 -1
- package/dist/cjs/parts/RowVariants/index.js.map +1 -1
- package/dist/cjs/parts/RowVariants/types.js.map +1 -1
- package/dist/cjs/parts/SortableHeaderCell.js.map +1 -1
- package/dist/cjs/parts/internal.js.map +1 -1
- package/dist/cjs/types/FunctionalHoC.js.map +1 -1
- package/dist/cjs/types/props.js.map +2 -2
- package/dist/esm/DataTable.js.map +1 -1
- package/dist/esm/DataTableContext.js.map +1 -1
- package/dist/esm/DataTableSchema.js.map +1 -1
- package/dist/esm/addons/Columns/ColumnAction/ColumnAction.js.map +1 -1
- package/dist/esm/addons/Columns/ColumnDragHandle/ColumnDragHandle.js.map +1 -1
- package/dist/esm/addons/Columns/ColumnExpand/ColumnExpand.js.map +1 -1
- package/dist/esm/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +1 -1
- package/dist/esm/addons/Columns/ColumnSelectSingle/ColumnSelectSingle.js.map +1 -1
- package/dist/esm/addons/Editables/DateEditableCell/DateEditableCell.js +2 -2
- package/dist/esm/addons/Editables/DateEditableCell/DateEditableCell.js.map +2 -2
- package/dist/esm/addons/Editables/index.js.map +1 -1
- package/dist/esm/addons/Filters/Components/CurrencyRangeFilter/index.js.map +1 -1
- package/dist/esm/addons/Filters/Components/DateRangeFilter/index.js.map +1 -1
- package/dist/esm/addons/Filters/Components/DateSwitcherFilter/index.js.map +1 -1
- package/dist/esm/addons/Filters/Components/NumberRangeFilter/index.js.map +1 -1
- package/dist/esm/addons/Filters/Components/SelectFilter/BaseSelectFilter.js.map +1 -1
- package/dist/esm/addons/Filters/Components/SelectFilter/MultiCreatableFilter.js.map +1 -1
- package/dist/esm/addons/Filters/Components/SelectFilter/MultiSelectFilter.js.map +1 -1
- package/dist/esm/addons/Filters/Components/SelectFilter/SingleCreatableFilter.js.map +1 -1
- package/dist/esm/addons/Filters/Components/SelectFilter/SingleSelectFilter.js.map +1 -1
- package/dist/esm/addons/Filters/Components/SingleDateFilter/index.js.map +1 -1
- package/dist/esm/configs/useDatatableConfig.js.map +1 -1
- package/dist/esm/configs/useInternalStateConfig.js.map +1 -1
- package/dist/esm/configs/usePaginationConfig.js.map +1 -1
- package/dist/esm/configs/useRowFlattenization.js.map +1 -1
- package/dist/esm/configs/useTableColsWithAddons.js.map +1 -1
- package/dist/esm/exported-related/FilterPopover/index.js.map +1 -1
- package/dist/esm/exported-related/FilterPopover/useGetFilterHandlers.js.map +2 -2
- package/dist/esm/exported-related/FilterPopover/useGetFilterVisibility.js.map +1 -1
- package/dist/esm/exported-related/Filters/applyOutOfTheBoxFilters.js.map +1 -1
- package/dist/esm/exported-related/Filters/currencyRangeFilterFn.js.map +1 -1
- package/dist/esm/exported-related/Filters/dateRangeFilterFn.js.map +1 -1
- package/dist/esm/exported-related/Filters/dateSwitcherFilterFn.js.map +1 -1
- package/dist/esm/exported-related/Filters/multiSelectFilterFn.js.map +1 -1
- package/dist/esm/exported-related/Filters/numberRangeFilterFn.js.map +1 -1
- package/dist/esm/exported-related/Filters/singleDateFilterFn.js.map +1 -1
- package/dist/esm/exported-related/Filters/singleSelectFilterFn.js.map +1 -1
- package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
- package/dist/esm/exported-related/RowRenderer/index.js.map +1 -1
- package/dist/esm/exported-related/RowRenderer/useRowRendererHandlers.js.map +2 -2
- package/dist/esm/exported-related/RowRenderer/useRowRendererProperties.js.map +1 -1
- package/dist/esm/exported-related/RowRenderer/useRowStyle.js.map +1 -1
- package/dist/esm/helpers/addCellData.js.map +1 -1
- package/dist/esm/helpers/columnsToGrid.js.map +1 -1
- package/dist/esm/helpers/getIdFromUniqueRowAccessor.js.map +1 -1
- package/dist/esm/parts/Cells/Cell.js.map +1 -1
- package/dist/esm/parts/Cells/index.js.map +1 -1
- package/dist/esm/parts/Cells/useCellStyle.js.map +1 -1
- package/dist/esm/parts/EmptyContent.js +1 -2
- package/dist/esm/parts/EmptyContent.js.map +2 -2
- package/dist/esm/parts/FilterBar/FiltersBar.js.map +1 -1
- package/dist/esm/parts/FilterBar/components/DateRangePill.js.map +1 -1
- package/dist/esm/parts/FilterBar/components/DateSwitcherPill.js.map +1 -1
- package/dist/esm/parts/FilterBar/components/MultiSelectPill.js.map +1 -1
- package/dist/esm/parts/FilterBar/components/NumberRangePill.js.map +1 -1
- package/dist/esm/parts/FilterBar/components/SelectPill.js.map +1 -1
- package/dist/esm/parts/FilterBar/components/SingleDatePill.js.map +1 -1
- package/dist/esm/parts/Filters/index.js.map +1 -1
- package/dist/esm/parts/Headers/HeaderCell.js.map +1 -1
- package/dist/esm/parts/Headers/HeaderCellGroup.js.map +1 -1
- package/dist/esm/parts/Headers/HeaderCellTitle.js.map +1 -1
- package/dist/esm/parts/Headers/HeaderResizer.js.map +1 -1
- package/dist/esm/parts/Headers/index.js.map +1 -1
- package/dist/esm/parts/Headers/useHeaderCellConfig.js.map +1 -1
- package/dist/esm/parts/Headers/useHeaderCellHandlers.js.map +1 -1
- package/dist/esm/parts/HoC/DnDTreeContext.js.map +1 -1
- package/dist/esm/parts/HoC/SortableItemContext.js.map +1 -1
- package/dist/esm/parts/HoC/withConditionalDnDColumnContext.js +1 -1
- package/dist/esm/parts/HoC/withConditionalDnDColumnContext.js.map +2 -2
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +1 -1
- package/dist/esm/parts/HoC/withConditionalDnDSortableContext.js.map +1 -1
- package/dist/esm/parts/HoC/withDnDSortableColumnContext.js +1 -1
- package/dist/esm/parts/HoC/withDnDSortableColumnContext.js.map +2 -2
- package/dist/esm/parts/HoC/withDnDSortableRowContext.js +1 -1
- package/dist/esm/parts/HoC/withDnDSortableRowContext.js.map +2 -2
- package/dist/esm/parts/RowVariants/RowVariantHeader.js.map +1 -1
- package/dist/esm/parts/RowVariants/RowVariantPrimary.js.map +1 -1
- package/dist/esm/parts/RowVariants/RowVariantSecondary.js.map +1 -1
- package/dist/esm/parts/RowVariants/RowVariantSkeleton.js.map +1 -1
- package/dist/esm/parts/RowVariants/index.js.map +1 -1
- package/dist/esm/parts/SortableHeaderCell.js.map +1 -1
- package/dist/esm/parts/internal.js.map +1 -1
- package/dist/esm/types/props.js.map +2 -2
- package/package.json +18 -18
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Filters/applyOutOfTheBoxFilters.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { singleSelectFilterFn } from './singleSelectFilterFn';\nimport { multiSelectFilterFn } from './multiSelectFilterFn';\nimport { singleDateFilterFn } from './singleDateFilterFn';\nimport { dateRangeFilterFn } from './dateRangeFilterFn';\nimport { dateSwitcherFilterFn } from './dateSwitcherFilterFn';\nimport { numberRangeFilterFn } from './numberRangeFilterFn';\nimport { currencyRangeFilterFn } from './currencyRangeFilterFn';\nimport { FilterFn } from './types';\nimport { FILTER_TYPES } from '../FilterTypes';\nimport { TypescriptAppliedFilter, TypescriptRow } from '../../types/props';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst filterMapper: Record<string, FilterFn<any>> = {\n [FILTER_TYPES.SELECT]: singleSelectFilterFn,\n [FILTER_TYPES.MULTI_SELECT]: multiSelectFilterFn,\n [FILTER_TYPES.SINGLE_DATE]: singleDateFilterFn,\n [FILTER_TYPES.DATE_RANGE]: dateRangeFilterFn,\n [FILTER_TYPES.DATE_SWITCHER]: dateSwitcherFilterFn,\n [FILTER_TYPES.NUMBER_RANGE]: numberRangeFilterFn,\n [FILTER_TYPES.CURRENCY_RANGE]: currencyRangeFilterFn,\n};\n\nexport const applyOutOfTheBoxFilters = (data: TypescriptRow[], filters: TypescriptAppliedFilter[]): TypescriptRow[] => {\n let filteredData = data;\n\n filters.forEach((filter) => {\n if (filter.type in filterMapper) {\n filteredData = filterMapper[filter.type](filteredData, filter.id, filter.value);\n }\n });\n\n return filteredData;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { singleSelectFilterFn } from './singleSelectFilterFn';\nimport { multiSelectFilterFn } from './multiSelectFilterFn';\nimport { singleDateFilterFn } from './singleDateFilterFn';\nimport { dateRangeFilterFn } from './dateRangeFilterFn';\nimport { dateSwitcherFilterFn } from './dateSwitcherFilterFn';\nimport { numberRangeFilterFn } from './numberRangeFilterFn';\nimport { currencyRangeFilterFn } from './currencyRangeFilterFn';\nimport type { FilterFn } from './types';\nimport { FILTER_TYPES } from '../FilterTypes';\nimport type { TypescriptAppliedFilter, TypescriptRow } from '../../types/props';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst filterMapper: Record<string, FilterFn<any>> = {\n [FILTER_TYPES.SELECT]: singleSelectFilterFn,\n [FILTER_TYPES.MULTI_SELECT]: multiSelectFilterFn,\n [FILTER_TYPES.SINGLE_DATE]: singleDateFilterFn,\n [FILTER_TYPES.DATE_RANGE]: dateRangeFilterFn,\n [FILTER_TYPES.DATE_SWITCHER]: dateSwitcherFilterFn,\n [FILTER_TYPES.NUMBER_RANGE]: numberRangeFilterFn,\n [FILTER_TYPES.CURRENCY_RANGE]: currencyRangeFilterFn,\n};\n\nexport const applyOutOfTheBoxFilters = (data: TypescriptRow[], filters: TypescriptAppliedFilter[]): TypescriptRow[] => {\n let filteredData = data;\n\n filters.forEach((filter) => {\n if (filter.type in filterMapper) {\n filteredData = filterMapper[filter.type](filteredData, filter.id, filter.value);\n }\n });\n\n return filteredData;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AAEtC,SAAS,oBAAoB;AAI7B,MAAM,eAA8C;AAAA,EAClD,CAAC,aAAa,SAAS;AAAA,EACvB,CAAC,aAAa,eAAe;AAAA,EAC7B,CAAC,aAAa,cAAc;AAAA,EAC5B,CAAC,aAAa,aAAa;AAAA,EAC3B,CAAC,aAAa,gBAAgB;AAAA,EAC9B,CAAC,aAAa,eAAe;AAAA,EAC7B,CAAC,aAAa,iBAAiB;AACjC;AAEO,MAAM,0BAA0B,CAAC,MAAuB,YAAwD;AACrH,MAAI,eAAe;AAEnB,UAAQ,QAAQ,CAAC,WAAW;AAC1B,QAAI,OAAO,QAAQ,cAAc;AAC/B,qBAAe,aAAa,OAAO,MAAM,cAAc,OAAO,IAAI,OAAO,KAAK;AAAA,IAChF;AAAA,EACF,CAAC;AAED,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Filters/currencyRangeFilterFn.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { FilterFn } from './types';\n\nconst getNumber = (str) => {\n if (str === null) return null;\n if (typeof str === 'number') return str;\n if (typeof str !== 'string') return null;\n return Number.parseFloat(\n str\n .split('')\n .filter((x) => ![',', '$'].includes(x))\n .join(''),\n );\n};\n\nconst isEmpty = (number) => Number.isNaN(number) || number === null || number === undefined;\n\nexport const currencyRangeFilterFn: FilterFn<{ from: string; to: string }> = (\n unfilteredData,\n filterKey,\n filterValue,\n) => {\n const fromNumber = getNumber(filterValue.from);\n const toNumber = getNumber(filterValue.to);\n\n return unfilteredData.filter(\n (datum) =>\n isEmpty(fromNumber) ||\n isEmpty(toNumber) ||\n (getNumber(datum[filterKey]) >= fromNumber && getNumber(datum[filterKey]) <= toNumber),\n );\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { FilterFn } from './types';\n\nconst getNumber = (str) => {\n if (str === null) return null;\n if (typeof str === 'number') return str;\n if (typeof str !== 'string') return null;\n return Number.parseFloat(\n str\n .split('')\n .filter((x) => ![',', '$'].includes(x))\n .join(''),\n );\n};\n\nconst isEmpty = (number) => Number.isNaN(number) || number === null || number === undefined;\n\nexport const currencyRangeFilterFn: FilterFn<{ from: string; to: string }> = (\n unfilteredData,\n filterKey,\n filterValue,\n) => {\n const fromNumber = getNumber(filterValue.from);\n const toNumber = getNumber(filterValue.to);\n\n return unfilteredData.filter(\n (datum) =>\n isEmpty(fromNumber) ||\n isEmpty(toNumber) ||\n (getNumber(datum[filterKey]) >= fromNumber && getNumber(datum[filterKey]) <= toNumber),\n );\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEvB,MAAM,YAAY,CAAC,QAAQ;AACzB,MAAI,QAAQ;AAAM,WAAO;AACzB,MAAI,OAAO,QAAQ;AAAU,WAAO;AACpC,MAAI,OAAO,QAAQ;AAAU,WAAO;AACpC,SAAO,OAAO;AAAA,IACZ,IACG,MAAM,EAAE,EACR,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,GAAG,EAAE,SAAS,CAAC,CAAC,EACrC,KAAK,EAAE;AAAA,EACZ;AACF;AAEA,MAAM,UAAU,CAAC,WAAW,OAAO,MAAM,MAAM,KAAK,WAAW,QAAQ,WAAW;AAE3E,MAAM,wBAAgE,CAC3E,gBACA,WACA,gBACG;AACH,QAAM,aAAa,UAAU,YAAY,IAAI;AAC7C,QAAM,WAAW,UAAU,YAAY,EAAE;AAEzC,SAAO,eAAe;AAAA,IACpB,CAAC,UACC,QAAQ,UAAU,KAClB,QAAQ,QAAQ,KACf,UAAU,MAAM,UAAU,KAAK,cAAc,UAAU,MAAM,UAAU,KAAK;AAAA,EACjF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Filters/dateRangeFilterFn.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { FilterFn } from './types';\nimport { isSameOrAfter, isSameOrBefore } from './utilities';\n\nexport const dateRangeFilterFn: FilterFn<{\n startDate: string;\n endDate: string;\n}> = (unfilteredData, filterKey, filterValue) =>\n unfilteredData.filter(\n (datum) =>\n !(filterValue?.startDate && filterValue?.endDate) ||\n (isSameOrBefore(filterValue?.startDate, datum[filterKey] as string) &&\n isSameOrAfter(filterValue?.endDate, datum[filterKey] as string)),\n );\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { FilterFn } from './types';\nimport { isSameOrAfter, isSameOrBefore } from './utilities';\n\nexport const dateRangeFilterFn: FilterFn<{\n startDate: string;\n endDate: string;\n}> = (unfilteredData, filterKey, filterValue) =>\n unfilteredData.filter(\n (datum) =>\n !(filterValue?.startDate && filterValue?.endDate) ||\n (isSameOrBefore(filterValue?.startDate, datum[filterKey] as string) &&\n isSameOrAfter(filterValue?.endDate, datum[filterKey] as string)),\n );\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,eAAe,sBAAsB;AAEvC,MAAM,oBAGR,CAAC,gBAAgB,WAAW,gBAC/B,eAAe;AAAA,EACb,CAAC,UACC,EAAE,aAAa,aAAa,aAAa,YACxC,eAAe,aAAa,WAAW,MAAM,UAAoB,KAChE,cAAc,aAAa,SAAS,MAAM,UAAoB;AACpE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Filters/dateSwitcherFilterFn.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { dateRangeFilterFn } from './dateRangeFilterFn';\nimport { singleDateFilterFn } from './singleDateFilterFn';\n// configs imports this file, we can't import from /configs/index.js directly\n// use file instead of index to avoid circular imports!\nimport { FilterFn } from './types';\n\nexport const dateSwitcherFilterFn: FilterFn<{\n startDate: string;\n endDate: string;\n isDateRange: boolean;\n}> = (unfilteredData, filterKey, filterValue) =>\n filterValue.isDateRange\n ? dateRangeFilterFn(unfilteredData, filterKey, filterValue)\n : singleDateFilterFn(unfilteredData, filterKey, filterValue.startDate);\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { dateRangeFilterFn } from './dateRangeFilterFn';\nimport { singleDateFilterFn } from './singleDateFilterFn';\n// configs imports this file, we can't import from /configs/index.js directly\n// use file instead of index to avoid circular imports!\nimport type { FilterFn } from './types';\n\nexport const dateSwitcherFilterFn: FilterFn<{\n startDate: string;\n endDate: string;\n isDateRange: boolean;\n}> = (unfilteredData, filterKey, filterValue) =>\n filterValue.isDateRange\n ? dateRangeFilterFn(unfilteredData, filterKey, filterValue)\n : singleDateFilterFn(unfilteredData, filterKey, filterValue.startDate);\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AAK5B,MAAM,uBAIR,CAAC,gBAAgB,WAAW,gBAC/B,YAAY,cACR,kBAAkB,gBAAgB,WAAW,WAAW,IACxD,mBAAmB,gBAAgB,WAAW,YAAY,SAAS;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Filters/multiSelectFilterFn.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { FilterFn } from './types';\n\nexport const multiSelectFilterFn: FilterFn<{ label: string }[]> = (unfilteredData, filterKey, filterValue) => {\n if (filterValue.length > 0) {\n return unfilteredData.filter((datum) => filterValue.some((item) => item.label === datum[filterKey].toString()));\n }\n return unfilteredData;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { FilterFn } from './types';\n\nexport const multiSelectFilterFn: FilterFn<{ label: string }[]> = (unfilteredData, filterKey, filterValue) => {\n if (filterValue.length > 0) {\n return unfilteredData.filter((datum) => filterValue.some((item) => item.label === datum[filterKey].toString()));\n }\n return unfilteredData;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,sBAAqD,CAAC,gBAAgB,WAAW,gBAAgB;AAC5G,MAAI,YAAY,SAAS,GAAG;AAC1B,WAAO,eAAe,OAAO,CAAC,UAAU,YAAY,KAAK,CAAC,SAAS,KAAK,UAAU,MAAM,WAAW,SAAS,CAAC,CAAC;AAAA,EAChH;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Filters/numberRangeFilterFn.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { FilterFn } from './types';\n\nconst isEmpty = (number) => number === null || number === undefined;\n\nexport const numberRangeFilterFn: FilterFn<{ from: number; to: number }> = (unfilteredData, filterKey, filterValue) =>\n unfilteredData.filter(\n (datum) =>\n isEmpty(filterValue?.from) ||\n isEmpty(filterValue?.to) ||\n (datum[filterKey] >= filterValue.from && datum[filterKey] <= filterValue.to),\n );\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { FilterFn } from './types';\n\nconst isEmpty = (number) => number === null || number === undefined;\n\nexport const numberRangeFilterFn: FilterFn<{ from: number; to: number }> = (unfilteredData, filterKey, filterValue) =>\n unfilteredData.filter(\n (datum) =>\n isEmpty(filterValue?.from) ||\n isEmpty(filterValue?.to) ||\n (datum[filterKey] >= filterValue.from && datum[filterKey] <= filterValue.to),\n );\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEvB,MAAM,UAAU,CAAC,WAAW,WAAW,QAAQ,WAAW;AAEnD,MAAM,sBAA8D,CAAC,gBAAgB,WAAW,gBACrG,eAAe;AAAA,EACb,CAAC,UACC,QAAQ,aAAa,IAAI,KACzB,QAAQ,aAAa,EAAE,KACtB,MAAM,cAAc,YAAY,QAAQ,MAAM,cAAc,YAAY;AAC7E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Filters/singleDateFilterFn.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { FilterFn } from './types';\nimport { isSame } from './utilities';\n\nexport const singleDateFilterFn: FilterFn<string> = (unfilteredData, filterKey, filterValue) =>\n unfilteredData.filter((datum) => isSame(filterValue, datum[filterKey] as string));\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { FilterFn } from './types';\nimport { isSame } from './utilities';\n\nexport const singleDateFilterFn: FilterFn<string> = (unfilteredData, filterKey, filterValue) =>\n unfilteredData.filter((datum) => isSame(filterValue, datum[filterKey] as string));\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,cAAc;AAEhB,MAAM,qBAAuC,CAAC,gBAAgB,WAAW,gBAC9E,eAAe,OAAO,CAAC,UAAU,OAAO,aAAa,MAAM,UAAoB,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Filters/singleSelectFilterFn.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { FilterFn } from './types';\n\nexport const singleSelectFilterFn: FilterFn<{ label: string }> = (unfilteredData, filterKey, filterValue) => {\n if (filterValue) {\n return unfilteredData.filter((datum) => datum[filterKey].toString() === filterValue.label);\n }\n return unfilteredData;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { FilterFn } from './types';\n\nexport const singleSelectFilterFn: FilterFn<{ label: string }> = (unfilteredData, filterKey, filterValue) => {\n if (filterValue) {\n return unfilteredData.filter((datum) => datum[filterKey].toString() === filterValue.label);\n }\n return unfilteredData;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,uBAAoD,CAAC,gBAAgB,WAAW,gBAAgB;AAC3G,MAAI,aAAa;AACf,WAAO,eAAe,OAAO,CAAC,UAAU,MAAM,WAAW,SAAS,MAAM,YAAY,KAAK;AAAA,EAC3F;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/DefaultRowContentRenderer.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useMemo, useCallback, useLayoutEffect, useRef } from 'react';\nimport { INTERNAL_COLUMNS } from '../../addons/Columns';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { Cells } from '../../parts/Cells';\nimport { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledCellContainer } from '../../styled';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useMemo, useCallback, useLayoutEffect, useRef } from 'react';\nimport { INTERNAL_COLUMNS } from '../../addons/Columns';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { Cells } from '../../parts/Cells';\nimport type { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledCellContainer } from '../../styled';\nimport type { TypescriptRow } from '../../types/props';\nimport { DropIndicatorPosition } from '../../types/props';\n\nconst DetailsWrapper = (props) => (\n // This can be further customized\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-role=\"detail-view\"\n style={{\n borderTop: '1px solid #EBEDF0',\n borderBottom: '1px solid #EBEDF0',\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {props.children}\n </div>\n);\n\nconst ariaLabelMessage = (row: TypescriptRow, selected: boolean) =>\n `Row number ${row.realIndex + 1}${row.parentIndex !== null ? `, child of row number ${row.parentIndex + 1}` : ''}. ${\n selected ? 'Selected. ' : ''\n }To interact with the cells press enter`;\n\nexport const DefaultRowContentRenderer: React.ComponentType<RowVariantProps> = (props) => {\n const {\n row,\n ctx: {\n tableProps: { isExpandable, colsLayoutStyle, selection, noSelectionColumn, expandedRows, disabledRows },\n layoutHelpers: { gridLayout },\n visibleColumns,\n },\n draggableProps,\n isDragOverlay,\n backgroundColor = 'white',\n dropIndicatorPosition,\n isDropValid,\n focusedRowId,\n drilldownRowId,\n compact,\n } = props;\n\n const rowRef = useRef<HTMLDivElement>(null);\n const isDndActive = draggableProps && draggableProps.active;\n const isDragging = draggableProps && draggableProps.isDragging;\n\n useLayoutEffect(() => {\n if (row.uid === focusedRowId) {\n rowRef.current?.focus();\n }\n }, [focusedRowId, row.uid]);\n\n const gridTemplateColProps = useMemo(\n () => ({\n cols: isDragOverlay ? ['24px', 'auto'] : gridLayout,\n isExpandable,\n colLayoutStyle: colsLayoutStyle,\n }),\n [isDragOverlay, gridLayout, colsLayoutStyle, isExpandable],\n );\n\n const detailsIndent = useMemo(() => {\n let padding = 0;\n for (let i = 0; i < visibleColumns.length; i += 1) {\n if (INTERNAL_COLUMNS.includes(visibleColumns[i].id)) {\n padding += visibleColumns[i].width;\n } else {\n padding += row.depth * 32 + 15;\n break;\n }\n }\n return padding;\n }, [row.depth, visibleColumns]);\n\n const handleSelectDisableRow = useCallback(\n (e) => {\n if (disabledRows[row.uid]) {\n e.preventDefault();\n }\n },\n [disabledRows, row.uid],\n );\n const DetailsView = row.original.tableRowDetails;\n\n return (\n <>\n <StyledCellContainer\n ref={rowRef}\n key={row.uid}\n tabIndex={disabledRows[row.uid] ? -1 : 0}\n role=\"row\"\n aria-rowindex={row.realIndex + 1}\n aria-label={ariaLabelMessage(row, selection?.[row.uid] === true)}\n aria-selected={selection?.[row.uid] === true}\n aria-expanded={isExpandable ? expandedRows[row.uid] === true : undefined}\n aria-disabled={disabledRows[row.uid]}\n {...gridTemplateColProps}\n backgroundColor={backgroundColor}\n height={compact ? '24px' : 'auto'}\n minHeight={compact ? '24px' : '36px'}\n isDropIndicatorPositionInside={dropIndicatorPosition === DropIndicatorPosition.Inside}\n isDropValid={isDropValid}\n shouldDisplayHover={!isDndActive && !isDragging && !isDragOverlay}\n isDragOverlay={isDragOverlay}\n isDragging={isDragging}\n selected={noSelectionColumn && selection?.[row.uid] === true}\n isDisabled={disabledRows[row.uid]}\n data-testid={DATA_TESTID.DATA_TABLE_ROW_CONTENT}\n onMouseDown={handleSelectDisableRow}\n >\n <Cells row={row} isRowSelected={drilldownRowId === row.uid} isDragOverlay={isDragOverlay} key={row.uid} />\n </StyledCellContainer>\n {!isDragOverlay && isExpandable && row.isExpanded && DetailsView && (\n <DetailsWrapper>\n <DetailsView row={row} detailsIndent={detailsIndent} />\n </DetailsWrapper>\n )}\n </>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACcrB,SA+EE,UA/EF,KA+EE,YA/EF;AAZF,SAAgB,SAAS,aAAa,iBAAiB,cAAc;AACrE,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AAEtB,SAAS,2BAA2B;AAEpC,SAAS,6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;AAAA,QACC,8BAAC;AAAA,UAAY;AAAA,UAAU;AAAA,SAA8B;AAAA,OACvD;AAAA;AAAA,GAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { DataTableContext } from '../../DataTableContext';\nimport { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledFullsizeGrid } from '../../styled';\nimport { InternalTypescriptRow } from '../../types/props';\nimport { DefaultRowContentRenderer } from './DefaultRowContentRenderer';\nimport { useRowRendererHandlers } from './useRowRendererHandlers';\nimport { useRowRendererProperties } from './useRowRendererProperties';\nimport { DropIndicator } from '../../parts/DropIndicator';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext';\nimport { DATA_TESTID } from '../../configs/constants';\n\ninterface RowRendererProps {\n row: InternalTypescriptRow;\n compact?: boolean;\n itemIndex: number;\n isDragOverlay: boolean;\n minHeight: string;\n height: string;\n rowsLayout?: (string | number)[];\n colsLayout?: (string | number)[];\n CustomRowContentRenderer?: React.ComponentType<RowVariantProps>;\n focusedRowId: string | null;\n drilldownRowId: string | null;\n backgroundColor?: string;\n}\n\n// CSS don't let us modify the spacing between the dots, so one solution is to use SVG\nconst magicDottedBorder = (\n <svg width=\"100%\" height=\"1px\">\n <line\n x1=\"0\"\n y1=\"0\"\n x2=\"100%\"\n y2=\"0\"\n stroke=\"#B0B9C8FF\"\n strokeWidth=\"1.5\"\n strokeDasharray=\"0, 5\"\n strokeDashoffset=\"0\"\n strokeLinecap=\"round\"\n />\n </svg>\n);\n\nconst RowRenderer: React.ComponentType<RowRendererProps> = (props) => {\n const {\n row,\n itemIndex,\n minHeight = '36px',\n height = 'auto',\n rowsLayout = [1],\n CustomRowContentRenderer,\n focusedRowId,\n drilldownRowId,\n isDragOverlay,\n } = props;\n\n const ctx = useContext(DataTableContext);\n const { draggableProps } = useContext(SortableItemContext);\n const { flattenedData } = ctx;\n\n // ===========================================================================\n // Properties for the row\n // ===========================================================================\n\n const {\n userDataProperties,\n colsLayoutStyle,\n totalColumnsWidth,\n rowStyle,\n shouldAppendDottedBorder,\n dropIndicatorPosition,\n isDropValid,\n } = useRowRendererProperties({\n row,\n });\n\n // ===========================================================================\n // Handlers\n // ===========================================================================\n\n const { handleItemClick, handleKeyDown, handleOnBlur, handleOnFocus } = useRowRendererHandlers({\n row,\n itemIndex,\n items: flattenedData,\n draggableProps,\n isDragOverlay,\n drilldownRowId,\n });\n\n const rowContentProps: RowVariantProps = {\n ...props,\n ctx,\n focusedRowId,\n drilldownRowId,\n draggableProps,\n dropIndicatorPosition,\n isDropValid,\n };\n\n return (\n <StyledFullsizeGrid\n data-testid={DATA_TESTID.DATA_TABLE_ROW}\n key={row.uid}\n colsLayoutStyle={colsLayoutStyle}\n {...userDataProperties}\n totalColumnsWidth={totalColumnsWidth}\n style={rowStyle}\n onClick={handleItemClick}\n onKeyDown={handleKeyDown}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n data-expandable={Boolean(row.original.tableRowDetails)}\n data-is-row-expanded={row.isExpanded}\n rows={rowsLayout}\n minHeight={minHeight}\n height={height}\n >\n {CustomRowContentRenderer ? (\n <CustomRowContentRenderer {...rowContentProps} />\n ) : (\n <DefaultRowContentRenderer {...rowContentProps} key={row.uid} />\n )}\n {shouldAppendDottedBorder && !isDragOverlay && magicDottedBorder}\n <DropIndicator\n vertical={false}\n dropIndicatorPosition={dropIndicatorPosition}\n isDropValid={isDropValid}\n isLast={row.index === flattenedData.length - 1 && draggableProps && draggableProps.isDragging}\n />\n </StyledFullsizeGrid>\n );\n};\n\nexport { RowRenderer };\nexport default RowRenderer;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { DataTableContext } from '../../DataTableContext';\nimport type { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledFullsizeGrid } from '../../styled';\nimport type { InternalTypescriptRow } from '../../types/props';\nimport { DefaultRowContentRenderer } from './DefaultRowContentRenderer';\nimport { useRowRendererHandlers } from './useRowRendererHandlers';\nimport { useRowRendererProperties } from './useRowRendererProperties';\nimport { DropIndicator } from '../../parts/DropIndicator';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext';\nimport { DATA_TESTID } from '../../configs/constants';\n\ninterface RowRendererProps {\n row: InternalTypescriptRow;\n compact?: boolean;\n itemIndex: number;\n isDragOverlay: boolean;\n minHeight: string;\n height: string;\n rowsLayout?: (string | number)[];\n colsLayout?: (string | number)[];\n CustomRowContentRenderer?: React.ComponentType<RowVariantProps>;\n focusedRowId: string | null;\n drilldownRowId: string | null;\n backgroundColor?: string;\n}\n\n// CSS don't let us modify the spacing between the dots, so one solution is to use SVG\nconst magicDottedBorder = (\n <svg width=\"100%\" height=\"1px\">\n <line\n x1=\"0\"\n y1=\"0\"\n x2=\"100%\"\n y2=\"0\"\n stroke=\"#B0B9C8FF\"\n strokeWidth=\"1.5\"\n strokeDasharray=\"0, 5\"\n strokeDashoffset=\"0\"\n strokeLinecap=\"round\"\n />\n </svg>\n);\n\nconst RowRenderer: React.ComponentType<RowRendererProps> = (props) => {\n const {\n row,\n itemIndex,\n minHeight = '36px',\n height = 'auto',\n rowsLayout = [1],\n CustomRowContentRenderer,\n focusedRowId,\n drilldownRowId,\n isDragOverlay,\n } = props;\n\n const ctx = useContext(DataTableContext);\n const { draggableProps } = useContext(SortableItemContext);\n const { flattenedData } = ctx;\n\n // ===========================================================================\n // Properties for the row\n // ===========================================================================\n\n const {\n userDataProperties,\n colsLayoutStyle,\n totalColumnsWidth,\n rowStyle,\n shouldAppendDottedBorder,\n dropIndicatorPosition,\n isDropValid,\n } = useRowRendererProperties({\n row,\n });\n\n // ===========================================================================\n // Handlers\n // ===========================================================================\n\n const { handleItemClick, handleKeyDown, handleOnBlur, handleOnFocus } = useRowRendererHandlers({\n row,\n itemIndex,\n items: flattenedData,\n draggableProps,\n isDragOverlay,\n drilldownRowId,\n });\n\n const rowContentProps: RowVariantProps = {\n ...props,\n ctx,\n focusedRowId,\n drilldownRowId,\n draggableProps,\n dropIndicatorPosition,\n isDropValid,\n };\n\n return (\n <StyledFullsizeGrid\n data-testid={DATA_TESTID.DATA_TABLE_ROW}\n key={row.uid}\n colsLayoutStyle={colsLayoutStyle}\n {...userDataProperties}\n totalColumnsWidth={totalColumnsWidth}\n style={rowStyle}\n onClick={handleItemClick}\n onKeyDown={handleKeyDown}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n data-expandable={Boolean(row.original.tableRowDetails)}\n data-is-row-expanded={row.isExpanded}\n rows={rowsLayout}\n minHeight={minHeight}\n height={height}\n >\n {CustomRowContentRenderer ? (\n <CustomRowContentRenderer {...rowContentProps} />\n ) : (\n <DefaultRowContentRenderer {...rowContentProps} key={row.uid} />\n )}\n {shouldAppendDottedBorder && !isDragOverlay && magicDottedBorder}\n <DropIndicator\n vertical={false}\n dropIndicatorPosition={dropIndicatorPosition}\n isDropValid={isDropValid}\n isLast={row.index === flattenedData.length - 1 && draggableProps && draggableProps.isDragging}\n />\n </StyledFullsizeGrid>\n );\n};\n\nexport { RowRenderer };\nexport default RowRenderer;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;AC+BnB,cAuEA,YAvEA;AA2FI;AAzHR,SAAgB,kBAAkB;AAClC,SAAS,wBAAwB;AAEjC,SAAS,0BAA0B;AAEnC,SAAS,iCAAiC;AAC1C,SAAS,8BAA8B;AACvC,SAAS,gCAAgC;AACzC,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAkB5B,MAAM,oBACJ,oBAAC;AAAA,EAAI,OAAM;AAAA,EAAO,Q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AA0B,GAAG;AAAA,OAAiB,IAE/C,8BAAC;AAAA,QAA2B,GAAG;AAAA,QAAiB,KAAK,IAAI;AAAA,OAAK;AAAA,MAE/D,4BAA4B,CAAC,iBAAiB;AAAA,MAC/C,oBAAC;AAAA,QACC,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA,QAAQ,IAAI,UAAU,cAAc,SAAS,KAAK,kBAAkB,eAAe;AAAA,OACrF;AAAA;AAAA,KA1BK,IAAI,GA2BX;AAEJ;AAGA,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/useRowRendererHandlers.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-depth */\n/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport React
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-depth */\n/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport type React from 'react';\nimport { useCallback, useContext } from 'react';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { DataTableContext } from '../../DataTableContext';\nimport type { SortableItemContextType } from '../../parts/HoC/SortableItemContext';\nimport type { InternalTypescriptRow } from '../../types/props';\n\nexport const useRowRendererHandlers = ({\n row,\n itemIndex,\n items,\n draggableProps,\n isDragOverlay,\n drilldownRowId,\n}: {\n row: InternalTypescriptRow;\n itemIndex: number;\n items: InternalTypescriptRow[];\n draggableProps: SortableItemContextType['draggableProps'];\n isDragOverlay: boolean;\n drilldownRowId: string | null;\n}): {\n handleItemClick: React.MouseEventHandler;\n handleKeyDown: React.KeyboardEventHandler;\n handleOnBlur: React.FocusEventHandler;\n handleOnFocus: React.FocusEventHandler;\n} => {\n const {\n tableProps: { onRowClick, onSelectionChange, selectSingle, selection, onRowFocus, disabledRows },\n virtualListHelpers: { scrollToIndex },\n setDrilldownRowId,\n setFocusedRowId,\n lastSelected,\n flattenedData,\n } = useContext(DataTableContext);\n\n const isOptionFocuseable = (opt): boolean => !disabledRows[opt.uid];\n\n const findInCircularList = (\n list,\n from: number,\n criteria: (item) => boolean,\n step = 1,\n // eslint-disable-next-line max-params\n ): number => {\n for (\n let i = (from + step + list.length) % list.length;\n i !== from && from > -1;\n i = (i + step + list.length) % list.length\n ) {\n if (criteria(list[i])) return i;\n }\n return from; // return same item\n };\n\n const handleItemClick = useCallback(\n (e: React.MouseEvent, { original, uid } = row) => {\n if (disabledRows[uid]) return;\n onRowClick(original, e, uid);\n if (selection && onSelectionChange) {\n if (selectSingle) {\n onSelectionChange({ [uid]: true });\n } else {\n const newSelection = { ...selection, [uid]: !selection[uid] }; // we only want true and mixed values\n if (!newSelection[uid]) delete newSelection[uid]; // if newState is false, remove from the new selection\n const now = Number.parseInt(uid, 10);\n if (e.shiftKey && lastSelected.current > -1) {\n for (let i = Math.min(lastSelected.current, now); i <= Math.max(lastSelected.current, now); i += 1) {\n const correctDataIndex = flattenedData[i].id;\n if (!Object.keys(disabledRows).includes(correctDataIndex))\n newSelection[correctDataIndex] = newSelection[lastSelected.current];\n if (!newSelection[correctDataIndex]) delete newSelection[correctDataIndex];\n }\n }\n lastSelected.current = now;\n\n onSelectionChange(newSelection, uid, e);\n }\n }\n onRowFocus(\n {\n itemIndex,\n scrollToItem: (\n opts: { align: 'auto' | 'start' | 'center' | 'end' } = {\n align: 'start',\n },\n ) => scrollToIndex(itemIndex, opts),\n original,\n },\n e,\n );\n },\n [\n row,\n disabledRows,\n onRowClick,\n selection,\n onSelectionChange,\n onRowFocus,\n itemIndex,\n selectSingle,\n lastSelected,\n flattenedData,\n scrollToIndex,\n ],\n );\n\n const isActive = draggableProps && draggableProps.active;\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (isDragOverlay || isActive) {\n e.preventDefault();\n return;\n }\n const { target } = e;\n const isChildEvent = (target as HTMLElement).getAttribute('role') !== 'row'; // if the event comes from a row\n\n if (e.code === 'Enter') {\n if (!isChildEvent) {\n e.preventDefault();\n if (drilldownRowId !== row.uid) {\n setDrilldownRowId(row.uid);\n setTimeout(() => {\n const focuseableCell = row.cells.find((cell) => cell.ref.current !== null);\n if (focuseableCell) focuseableCell.ref.current.focus();\n });\n }\n }\n }\n if (e.code === 'Space') {\n if (!isChildEvent) {\n e.preventDefault();\n }\n handleItemClick(e, row);\n }\n if (e.code === 'ArrowDown') {\n e.preventDefault();\n e.stopPropagation();\n const next = findInCircularList(items, itemIndex, isOptionFocuseable);\n setFocusedRowId(items[next].uid);\n }\n if (e.code === 'ArrowUp') {\n e.preventDefault();\n const prev = findInCircularList(items, itemIndex, isOptionFocuseable, -1);\n setFocusedRowId(items[prev].uid);\n }\n },\n [\n isDragOverlay,\n isActive,\n drilldownRowId,\n row,\n setDrilldownRowId,\n handleItemClick,\n items,\n itemIndex,\n isOptionFocuseable,\n setFocusedRowId,\n ],\n );\n\n const handleOnBlur = useCallback(\n (e) => {\n if (e.relatedTarget?.getAttribute('data-testid') === 'data-table-row-content') {\n setDrilldownRowId(null);\n }\n },\n [setDrilldownRowId],\n );\n\n const handleOnFocus: React.FocusEventHandler = useCallback(\n (e) => {\n if (\n !disabledRows[row.uid] &&\n e.target &&\n e.target.getAttribute('data-testid') === DATA_TESTID.DATA_TABLE_ROW_CONTENT\n ) {\n setFocusedRowId(row.uid);\n }\n },\n [row.uid, setFocusedRowId, disabledRows],\n );\n\n return { handleItemClick, handleKeyDown, handleOnBlur, handleOnFocus };\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,aAAa,kBAAkB;AACxC,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AAI1B,MAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA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AAA,MACjC;AACA,UAAI,EAAE,SAAS,WAAW;AACxB,UAAE,eAAe;AACjB,cAAM,OAAO,mBAAmB,OAAO,WAAW,oBAAoB,EAAE;AACxE,wBAAgB,MAAM,MAAM,GAAG;AAAA,MACjC;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAAe;AAAA,IACnB,CAAC,MAAM;AACL,UAAI,EAAE,eAAe,aAAa,aAAa,MAAM,0BAA0B;AAC7E,0BAAkB,IAAI;AAAA,MACxB;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB;AAAA,EACpB;AAEA,QAAM,gBAAyC;AAAA,IAC7C,CAAC,MAAM;AACL,UACE,CAAC,aAAa,IAAI,QAClB,EAAE,UACF,EAAE,OAAO,aAAa,aAAa,MAAM,YAAY,wBACrD;AACA,wBAAgB,IAAI,GAAG;AAAA,MACzB;AAAA,IACF;AAAA,IACA,CAAC,IAAI,KAAK,iBAAiB,YAAY;AAAA,EACzC;AAEA,SAAO,EAAE,iBAAiB,eAAe,cAAc,cAAc;AACvE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/useRowRendererProperties.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport { ColsLayoutStyle } from '../../configs/constants';\nimport { DataTableContext } from '../../DataTableContext';\nimport { InternalTypescriptRow } from '../../types/props';\nimport { useRowStyle } from './useRowStyle';\n\nexport const useRowRendererProperties = ({\n row,\n}: {\n row: InternalTypescriptRow;\n}): {\n userDataProperties: Record<string, unknown>;\n colsLayoutStyle: ColsLayoutStyle;\n totalColumnsWidth: string | number | undefined;\n} & ReturnType<typeof useRowStyle> => {\n const {\n tableProps: { colsLayoutStyle },\n layoutHelpers: { totalColumnsWidth },\n } = useContext(DataTableContext);\n\n const userDataProperties = useMemo(\n () =>\n Object.keys(row.original).reduce((acc, cur) => {\n if (cur.startsWith('data-')) acc[cur] = row.original[cur];\n return acc;\n }, {}),\n [row],\n );\n\n const styleRelatedProps = useRowStyle(row);\n\n return {\n userDataProperties,\n colsLayoutStyle,\n totalColumnsWidth,\n ...styleRelatedProps,\n };\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport type { ColsLayoutStyle } from '../../configs/constants';\nimport { DataTableContext } from '../../DataTableContext';\nimport type { InternalTypescriptRow } from '../../types/props';\nimport { useRowStyle } from './useRowStyle';\n\nexport const useRowRendererProperties = ({\n row,\n}: {\n row: InternalTypescriptRow;\n}): {\n userDataProperties: Record<string, unknown>;\n colsLayoutStyle: ColsLayoutStyle;\n totalColumnsWidth: string | number | undefined;\n} & ReturnType<typeof useRowStyle> => {\n const {\n tableProps: { colsLayoutStyle },\n layoutHelpers: { totalColumnsWidth },\n } = useContext(DataTableContext);\n\n const userDataProperties = useMemo(\n () =>\n Object.keys(row.original).reduce((acc, cur) => {\n if (cur.startsWith('data-')) acc[cur] = row.original[cur];\n return acc;\n }, {}),\n [row],\n );\n\n const styleRelatedProps = useRowStyle(row);\n\n return {\n userDataProperties,\n colsLayoutStyle,\n totalColumnsWidth,\n ...styleRelatedProps,\n };\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,eAAe;AAEpC,SAAS,wBAAwB;AAEjC,SAAS,mBAAmB;AAErB,MAAM,2BAA2B,CAAC;AAAA,EACvC;AACF,MAMsC;AACpC,QAAM;AAAA,IACJ,YAAY,EAAE,gBAAgB;AAAA,IAC9B,eAAe,EAAE,kBAAkB;AAAA,EACrC,IAAI,WAAW,gBAAgB;AAE/B,QAAM,qBAAqB;AAAA,IACzB,MACE,OAAO,KAAK,IAAI,QAAQ,EAAE,OAAO,CAAC,KAAK,QAAQ;AAC7C,UAAI,IAAI,WAAW,OAAO;AAAG,YAAI,OAAO,IAAI,SAAS;AACrD,aAAO;AAAA,IACT,GAAG,CAAC,CAAC;AAAA,IACP,CAAC,GAAG;AAAA,EACN;AAEA,QAAM,oBAAoB,YAAY,GAAG;AAEzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/useRowStyle.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport DataTableContext from '../../DataTableContext';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext';\nimport { InternalTypescriptRow, DropIndicatorPosition } from '../../types/props';\n\nexport const useRowStyle = (\n row: InternalTypescriptRow,\n): {\n rowStyle: Record<string, unknown>;\n shouldAppendDottedBorder: boolean;\n dropIndicatorPosition: false | DropIndicatorPosition;\n isDropValid: boolean;\n} => {\n const { flattenedData } = useContext(DataTableContext);\n\n const { draggableProps } = useContext(SortableItemContext);\n\n // ---------------------------------------------------------------------------\n // Border calculation\n // ---------------------------------------------------------------------------\n const [borderTop, borderBottom, shouldAppendDottedBorder]: [string, string, boolean] = useMemo(() => {\n if (row.original.dimsumHeaderValue) {\n return ['none', 'none', false];\n }\n if (row.isExpanded && row.original.subRows && row.depth === 0) {\n return ['1px solid #EBEDF0', 'none', true];\n }\n\n if (row.depth >= 1) {\n if (row.realIndex < flattenedData.length - 1 && flattenedData[row.realIndex + 1].depth === 0) {\n return ['none', '2px solid #EBEDF0', false];\n }\n return ['none', 'none', true];\n }\n\n return ['none', '1px solid #EBEDF0', false];\n }, [row, flattenedData]);\n\n const rowStyle = useMemo(() => ({ borderTop, borderBottom }), [borderTop, borderBottom]);\n\n const dropIndicatorPosition =\n draggableProps && draggableProps.shouldShowDropIndicatorPosition && draggableProps.dropIndicatorPosition;\n\n const isDropValid = draggableProps && draggableProps.isDropValid;\n\n return {\n rowStyle,\n shouldAppendDottedBorder,\n dropIndicatorPosition,\n isDropValid,\n };\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport DataTableContext from '../../DataTableContext';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext';\nimport type { InternalTypescriptRow, DropIndicatorPosition } from '../../types/props';\n\nexport const useRowStyle = (\n row: InternalTypescriptRow,\n): {\n rowStyle: Record<string, unknown>;\n shouldAppendDottedBorder: boolean;\n dropIndicatorPosition: false | DropIndicatorPosition;\n isDropValid: boolean;\n} => {\n const { flattenedData } = useContext(DataTableContext);\n\n const { draggableProps } = useContext(SortableItemContext);\n\n // ---------------------------------------------------------------------------\n // Border calculation\n // ---------------------------------------------------------------------------\n const [borderTop, borderBottom, shouldAppendDottedBorder]: [string, string, boolean] = useMemo(() => {\n if (row.original.dimsumHeaderValue) {\n return ['none', 'none', false];\n }\n if (row.isExpanded && row.original.subRows && row.depth === 0) {\n return ['1px solid #EBEDF0', 'none', true];\n }\n\n if (row.depth >= 1) {\n if (row.realIndex < flattenedData.length - 1 && flattenedData[row.realIndex + 1].depth === 0) {\n return ['none', '2px solid #EBEDF0', false];\n }\n return ['none', 'none', true];\n }\n\n return ['none', '1px solid #EBEDF0', false];\n }, [row, flattenedData]);\n\n const rowStyle = useMemo(() => ({ borderTop, borderBottom }), [borderTop, borderBottom]);\n\n const dropIndicatorPosition =\n draggableProps && draggableProps.shouldShowDropIndicatorPosition && draggableProps.dropIndicatorPosition;\n\n const isDropValid = draggableProps && draggableProps.isDropValid;\n\n return {\n rowStyle,\n shouldAppendDottedBorder,\n dropIndicatorPosition,\n isDropValid,\n };\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,eAAe;AACpC,OAAO,sBAAsB;AAC7B,SAAS,2BAA2B;AAG7B,MAAM,cAAc,CACzB,QAMG;AACH,QAAM,EAAE,cAAc,IAAI,WAAW,gBAAgB;AAErD,QAAM,EAAE,eAAe,IAAI,WAAW,mBAAmB;AAKzD,QAAM,CAAC,WAAW,cAAc,wBAAwB,IAA+B,QAAQ,MAAM;AACnG,QAAI,IAAI,SAAS,mBAAmB;AAClC,aAAO,CAAC,QAAQ,QAAQ,KAAK;AAAA,IAC/B;AACA,QAAI,IAAI,cAAc,IAAI,SAAS,WAAW,IAAI,UAAU,GAAG;AAC7D,aAAO,CAAC,qBAAqB,QAAQ,IAAI;AAAA,IAC3C;AAEA,QAAI,IAAI,SAAS,GAAG;AAClB,UAAI,IAAI,YAAY,cAAc,SAAS,KAAK,cAAc,IAAI,YAAY,GAAG,UAAU,GAAG;AAC5F,eAAO,CAAC,QAAQ,qBAAqB,KAAK;AAAA,MAC5C;AACA,aAAO,CAAC,QAAQ,QAAQ,IAAI;AAAA,IAC9B;AAEA,WAAO,CAAC,QAAQ,qBAAqB,KAAK;AAAA,EAC5C,GAAG,CAAC,KAAK,aAAa,CAAC;AAEvB,QAAM,WAAW,QAAQ,OAAO,EAAE,WAAW,aAAa,IAAI,CAAC,WAAW,YAAY,CAAC;AAEvF,QAAM,wBACJ,kBAAkB,eAAe,mCAAmC,eAAe;AAErF,QAAM,cAAc,kBAAkB,eAAe;AAErD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/helpers/addCellData.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\nimport React from 'react';\nimport { InternalTypescriptRow, TypescriptCell, TypescriptColumn } from '../types/props';\n\nconst BasicCell: React.ComponentType<{ cell: TypescriptCell }> = ({ cell }) => cell.value;\n\nconst getCellValue = (row: InternalTypescriptRow, accessor: string | undefined): any => {\n if (accessor === undefined) return null;\n return row.original[accessor] ?? null;\n};\n\nconst addColumnData = (datum: InternalTypescriptRow, column: TypescriptColumn) => {\n datum.cells.push({\n column,\n value: getCellValue(datum, column.accessor),\n render: column.Cell ?? BasicCell,\n row: datum,\n ref: React.createRef(),\n id: `${datum.uid}__${column.id}`,\n });\n};\n\nexport const addCellData = (datum: InternalTypescriptRow, columns: TypescriptColumn[]): void => {\n datum.cells = [];\n columns.forEach((column) => {\n if (column.columns) column.columns.forEach((col) => addColumnData(datum, col));\n else addColumnData(datum, column);\n });\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\nimport React from 'react';\nimport type { InternalTypescriptRow, TypescriptCell, TypescriptColumn } from '../types/props';\n\nconst BasicCell: React.ComponentType<{ cell: TypescriptCell }> = ({ cell }) => cell.value;\n\nconst getCellValue = (row: InternalTypescriptRow, accessor: string | undefined): any => {\n if (accessor === undefined) return null;\n return row.original[accessor] ?? null;\n};\n\nconst addColumnData = (datum: InternalTypescriptRow, column: TypescriptColumn) => {\n datum.cells.push({\n column,\n value: getCellValue(datum, column.accessor),\n render: column.Cell ?? BasicCell,\n row: datum,\n ref: React.createRef(),\n id: `${datum.uid}__${column.id}`,\n });\n};\n\nexport const addCellData = (datum: InternalTypescriptRow, columns: TypescriptColumn[]): void => {\n datum.cells = [];\n columns.forEach((column) => {\n if (column.columns) column.columns.forEach((col) => addColumnData(datum, col));\n else addColumnData(datum, column);\n });\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEvB,OAAOA,YAAW;AAGlB,MAAM,YAA2D,CAAC,EAAE,KAAK,MAAM,KAAK;AAEpF,MAAM,eAAe,CAAC,KAA4B,aAAsC;AACtF,MAAI,aAAa;AAAW,WAAO;AACnC,SAAO,IAAI,SAAS,aAAa;AACnC;AAEA,MAAM,gBAAgB,CAAC,OAA8B,WAA6B;AAChF,QAAM,MAAM,KAAK;AAAA,IACf;AAAA,IACA,OAAO,aAAa,OAAO,OAAO,QAAQ;AAAA,IAC1C,QAAQ,OAAO,QAAQ;AAAA,IACvB,KAAK;AAAA,IACL,KAAKA,OAAM,UAAU;AAAA,IACrB,IAAI,GAAG,MAAM,QAAQ,OAAO;AAAA,EAC9B,CAAC;AACH;AAEO,MAAM,cAAc,CAAC,OAA8B,YAAsC;AAC9F,QAAM,QAAQ,CAAC;AACf,UAAQ,QAAQ,CAAC,WAAW;AAC1B,QAAI,OAAO;AAAS,aAAO,QAAQ,QAAQ,CAAC,QAAQ,cAAc,OAAO,GAAG,CAAC;AAAA;AACxE,oBAAc,OAAO,MAAM;AAAA,EAClC,CAAC;AACH;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/helpers/columnsToGrid.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { ColsLayoutStyle } from '../configs/constants';\nimport { TypescriptColumn } from '../types/props';\nimport { sizeToCss } from './sizeToCss';\n\nconst columnsToGridImpl = (c: TypescriptColumn, grid: string[], colsLayoutStyle: ColsLayoutStyle) => {\n if ('columns' in c) c.columns.forEach((col) => columnsToGridImpl(col, grid, colsLayoutStyle));\n else grid.push(sizeToCss(c.width ?? (colsLayoutStyle === ColsLayoutStyle.Auto ? '1fr' : 150)));\n};\n\nexport const columnsToGrid = (columns: TypescriptColumn[], colsLayoutStyle: ColsLayoutStyle): string[] => {\n const grid: string[] = [];\n columns.forEach((col) => columnsToGridImpl(col, grid, colsLayoutStyle));\n return grid;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { ColsLayoutStyle } from '../configs/constants';\nimport type { TypescriptColumn } from '../types/props';\nimport { sizeToCss } from './sizeToCss';\n\nconst columnsToGridImpl = (c: TypescriptColumn, grid: string[], colsLayoutStyle: ColsLayoutStyle) => {\n if ('columns' in c) c.columns.forEach((col) => columnsToGridImpl(col, grid, colsLayoutStyle));\n else grid.push(sizeToCss(c.width ?? (colsLayoutStyle === ColsLayoutStyle.Auto ? '1fr' : 150)));\n};\n\nexport const columnsToGrid = (columns: TypescriptColumn[], colsLayoutStyle: ColsLayoutStyle): string[] => {\n const grid: string[] = [];\n columns.forEach((col) => columnsToGridImpl(col, grid, colsLayoutStyle));\n return grid;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,uBAAuB;AAEhC,SAAS,iBAAiB;AAE1B,MAAM,oBAAoB,CAAC,GAAqB,MAAgB,oBAAqC;AACnG,MAAI,aAAa;AAAG,MAAE,QAAQ,QAAQ,CAAC,QAAQ,kBAAkB,KAAK,MAAM,eAAe,CAAC;AAAA;AACvF,SAAK,KAAK,UAAU,EAAE,UAAU,oBAAoB,gBAAgB,OAAO,QAAQ,IAAI,CAAC;AAC/F;AAEO,MAAM,gBAAgB,CAAC,SAA6B,oBAA+C;AACxG,QAAM,OAAiB,CAAC;AACxB,UAAQ,QAAQ,CAAC,QAAQ,kBAAkB,KAAK,MAAM,eAAe,CAAC;AACtE,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/helpers/getIdFromUniqueRowAccessor.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { InternalTypescriptRow, UniqueRowAccessorType } from '../types/props';\n\nexport const getIdFromUniqueRowAccessor = (\n uniqueRowAccessor: UniqueRowAccessorType,\n row: Pick<InternalTypescriptRow, 'id' | 'original'>,\n): string => {\n if (uniqueRowAccessor === undefined) {\n // user did not defined an unique row accesor, use the one generated by react-table\n return row.id.toString();\n }\n\n if (typeof uniqueRowAccessor === 'string') {\n // user specified a field as an unique row accessor\n return row.original[uniqueRowAccessor].toString();\n }\n\n if (Array.isArray(uniqueRowAccessor)) {\n // user specified combination of fields as unique row accessor\n return uniqueRowAccessor.map((key) => row.original[key].toString()).join('__');\n }\n\n // let the user decide on their end what to do\n return uniqueRowAccessor(row.original);\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport type { InternalTypescriptRow, UniqueRowAccessorType } from '../types/props';\n\nexport const getIdFromUniqueRowAccessor = (\n uniqueRowAccessor: UniqueRowAccessorType,\n row: Pick<InternalTypescriptRow, 'id' | 'original'>,\n): string => {\n if (uniqueRowAccessor === undefined) {\n // user did not defined an unique row accesor, use the one generated by react-table\n return row.id.toString();\n }\n\n if (typeof uniqueRowAccessor === 'string') {\n // user specified a field as an unique row accessor\n return row.original[uniqueRowAccessor].toString();\n }\n\n if (Array.isArray(uniqueRowAccessor)) {\n // user specified combination of fields as unique row accessor\n return uniqueRowAccessor.map((key) => row.original[key].toString()).join('__');\n }\n\n // let the user decide on their end what to do\n return uniqueRowAccessor(row.original);\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACKhB,MAAM,6BAA6B,CACxC,mBACA,QACW;AACX,MAAI,sBAAsB,QAAW;AAEnC,WAAO,IAAI,GAAG,SAAS;AAAA,EACzB;AAEA,MAAI,OAAO,sBAAsB,UAAU;AAEzC,WAAO,IAAI,SAAS,mBAAmB,SAAS;AAAA,EAClD;AAEA,MAAI,MAAM,QAAQ,iBAAiB,GAAG;AAEpC,WAAO,kBAAkB,IAAI,CAAC,QAAQ,IAAI,SAAS,KAAK,SAAS,CAAC,EAAE,KAAK,IAAI;AAAA,EAC/E;AAGA,SAAO,kBAAkB,IAAI,QAAQ;AACvC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Cells/Cell.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext, useMemo, memo } from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledCell, StyledCellContent } from '../../styled';\nimport { outOfTheBoxEditables } from '../../addons/Editables';\nimport { DataTableContext } from '../../DataTableContext';\nimport { TypescriptColumn, TypescriptRow } from '../../types/props';\nimport { SortableItemContext } from '../HoC/SortableItemContext';\nimport { expandRowColumn } from '../../addons/Columns';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { useCellStyle } from './useCellStyle';\n\nconst PureStandardCell = memo<{ cellStyle: unknown; column: TypescriptColumn }>(({ cellStyle, children, column }) => (\n <StyledCell column={column} style={cellStyle} role=\"cell\" data-testid={DATA_TESTID.DATA_TABLE_CELL}>\n {children}\n </StyledCell>\n));\n\ninterface CellProps {\n cell: any;\n column: TypescriptColumn;\n row: TypescriptRow;\n isRowSelected: boolean;\n shouldAddExpandCell: boolean;\n isDragOverlay: boolean;\n}\n\nconst Cell: React.ComponentType<CellProps> = ({\n cell,\n column,\n row,\n isRowSelected,\n shouldAddExpandCell,\n isDragOverlay,\n}) => {\n const ctx = useContext(DataTableContext);\n const {\n tableProps: { cellRendererProps, disabledRows },\n } = ctx;\n const { draggableProps } = useContext(SortableItemContext);\n\n const [appliedTextWrap, cellStyle] = useCellStyle(column, shouldAddExpandCell);\n\n const cellProps = useMemo(\n () => ({\n ...cellRendererProps,\n cell,\n row,\n isRowSelected,\n ctx,\n draggableProps,\n isDragOverlay,\n role: 'cell',\n cellStyle,\n column,\n }),\n [cellRendererProps, cell, row, isRowSelected, ctx, draggableProps, isDragOverlay, cellStyle, column],\n );\n\n const CellComponent = cell.render;\n\n const pureCellContent = useMemo(() => {\n if (shouldAddExpandCell) {\n return (\n <Grid cols={['min-content', 'auto']} alignItems=\"center\" height=\"100%\">\n {shouldAddExpandCell && <expandRowColumn.Cell {...cellProps} />}\n <CellComponent {...cellProps} />\n </Grid>\n );\n }\n return <CellComponent {...cellProps} />;\n }, [CellComponent, cellProps, shouldAddExpandCell]);\n\n const DefaultCellContentJSX = useMemo(\n () => (\n <StyledCellContent>\n {appliedTextWrap === 'truncate' ? <SimpleTruncatedTooltipText value={pureCellContent} /> : pureCellContent}\n </StyledCellContent>\n ),\n [appliedTextWrap, pureCellContent],\n );\n\n const EditableContentJSX = useMemo(() => {\n if (typeof column.editable === 'string') {\n const { EditableComponent } = outOfTheBoxEditables?.[column.editable];\n if (EditableComponent) return <EditableComponent {...cellProps} DefaultCellRender={DefaultCellContentJSX} />;\n }\n if (typeof column.editable === 'function')\n return column.editable({\n DefaultCellRender: DefaultCellContentJSX,\n ...cellProps,\n }) as JSX.Element;\n\n return null;\n }, [DefaultCellContentJSX, cellProps, column]);\n\n return (\n <PureStandardCell {...cellProps}>\n {column.editable && !disabledRows[row.uid] ? EditableContentJSX : DefaultCellContentJSX}\n </PureStandardCell>\n );\n};\n\nexport { Cell };\nexport default Cell;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext, useMemo, memo } from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledCell, StyledCellContent } from '../../styled';\nimport { outOfTheBoxEditables } from '../../addons/Editables';\nimport { DataTableContext } from '../../DataTableContext';\nimport type { TypescriptColumn, TypescriptRow } from '../../types/props';\nimport { SortableItemContext } from '../HoC/SortableItemContext';\nimport { expandRowColumn } from '../../addons/Columns';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { useCellStyle } from './useCellStyle';\n\nconst PureStandardCell = memo<{ cellStyle: unknown; column: TypescriptColumn }>(({ cellStyle, children, column }) => (\n <StyledCell column={column} style={cellStyle} role=\"cell\" data-testid={DATA_TESTID.DATA_TABLE_CELL}>\n {children}\n </StyledCell>\n));\n\ninterface CellProps {\n cell: any;\n column: TypescriptColumn;\n row: TypescriptRow;\n isRowSelected: boolean;\n shouldAddExpandCell: boolean;\n isDragOverlay: boolean;\n}\n\nconst Cell: React.ComponentType<CellProps> = ({\n cell,\n column,\n row,\n isRowSelected,\n shouldAddExpandCell,\n isDragOverlay,\n}) => {\n const ctx = useContext(DataTableContext);\n const {\n tableProps: { cellRendererProps, disabledRows },\n } = ctx;\n const { draggableProps } = useContext(SortableItemContext);\n\n const [appliedTextWrap, cellStyle] = useCellStyle(column, shouldAddExpandCell);\n\n const cellProps = useMemo(\n () => ({\n ...cellRendererProps,\n cell,\n row,\n isRowSelected,\n ctx,\n draggableProps,\n isDragOverlay,\n role: 'cell',\n cellStyle,\n column,\n }),\n [cellRendererProps, cell, row, isRowSelected, ctx, draggableProps, isDragOverlay, cellStyle, column],\n );\n\n const CellComponent = cell.render;\n\n const pureCellContent = useMemo(() => {\n if (shouldAddExpandCell) {\n return (\n <Grid cols={['min-content', 'auto']} alignItems=\"center\" height=\"100%\">\n {shouldAddExpandCell && <expandRowColumn.Cell {...cellProps} />}\n <CellComponent {...cellProps} />\n </Grid>\n );\n }\n return <CellComponent {...cellProps} />;\n }, [CellComponent, cellProps, shouldAddExpandCell]);\n\n const DefaultCellContentJSX = useMemo(\n () => (\n <StyledCellContent>\n {appliedTextWrap === 'truncate' ? <SimpleTruncatedTooltipText value={pureCellContent} /> : pureCellContent}\n </StyledCellContent>\n ),\n [appliedTextWrap, pureCellContent],\n );\n\n const EditableContentJSX = useMemo(() => {\n if (typeof column.editable === 'string') {\n const { EditableComponent } = outOfTheBoxEditables?.[column.editable];\n if (EditableComponent) return <EditableComponent {...cellProps} DefaultCellRender={DefaultCellContentJSX} />;\n }\n if (typeof column.editable === 'function')\n return column.editable({\n DefaultCellRender: DefaultCellContentJSX,\n ...cellProps,\n }) as JSX.Element;\n\n return null;\n }, [DefaultCellContentJSX, cellProps, column]);\n\n return (\n <PureStandardCell {...cellProps}>\n {column.editable && !disabledRows[row.uid] ? EditableContentJSX : DefaultCellContentJSX}\n </PureStandardCell>\n );\n};\n\nexport { Cell };\nexport default Cell;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACcrB,cAmDM,YAnDN;AAbF,SAAgB,YAAY,SAAS,YAAY;AACjD,SAAS,kCAAkC;AAC3C,SAAS,YAAY;AACrB,SAAS,YAAY,yBAAyB;AAC9C,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AAEjC,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAE7B,MAAM,mBAAmB,KAAuD,CAAC,EAAE,WAAW,UAAU,OAAO,MAC7G,oBAAC;AAAA,EAAW;AAAA,EAAgB,OAAO;AAAA,EAAW,MAAK;AAAA,EAAO,eAAa,YAAY;AAAA,EAChF;AAAA,CACH,CACD;AAWD,MAAM,OAAuC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA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C;AAAA,UAAmB,GAAG;AAAA,UAAW,mBAAmB;AAAA,SAAuB;AAAA,IAC5G;AACA,QAAI,OAAO,OAAO,aAAa;AAC7B,aAAO,OAAO,SAAS;AAAA,QACrB,mBAAmB;AAAA,QACnB,GAAG;AAAA,MACL,CAAC;AAEH,WAAO;AAAA,EACT,GAAG,CAAC,uBAAuB,WAAW,MAAM,CAAC;AAE7C,SACE,oBAAC;AAAA,IAAkB,GAAG;AAAA,IACnB,iBAAO,YAAY,CAAC,aAAa,IAAI,OAAO,qBAAqB;AAAA,GACpE;AAEJ;AAGA,IAAO,eAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Cells/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { INTERNAL_COLUMNS } from '../../addons/Columns';\nimport { StyledActionCell } from '../../styled';\nimport { TypescriptRow } from '../../types/props';\nimport { Cell } from './Cell';\nimport { DataTableContext } from '../../DataTableContext';\n\nconst Cells: React.ComponentType<{\n row: TypescriptRow;\n isRowSelected: boolean;\n isDragOverlay: boolean;\n}> = (props) => {\n const { row, isRowSelected, isDragOverlay } = props;\n const ctx = useContext(DataTableContext);\n // we won't print sub-rows more nested than the first level\n if (row.depth <= 1) {\n let shouldAddExpandCell = false;\n let userCellsProcessed = 0;\n return (\n <>\n {row.cells.map((cell: any) => {\n const { column } = cell;\n\n const isUserCell = !INTERNAL_COLUMNS.includes(column.id);\n\n let jsx = null;\n\n if (column.id === 'rowActions') {\n const ActionComponent = cell.render;\n jsx = (\n <StyledActionCell role=\"cell\" key={cell.id}>\n <ActionComponent row={row} cell={cell} column={column} isRowSelected={isRowSelected} ctx={ctx} />\n </StyledActionCell>\n );\n } else if (column.id === 'expander') {\n // Next user's cell will have the expand cell\n shouldAddExpandCell = !isDragOverlay; // Don't add it on drag overlay\n } else {\n jsx = (\n <Cell\n cell={cell}\n column={column}\n row={row}\n isRowSelected={isRowSelected}\n shouldAddExpandCell={isUserCell && shouldAddExpandCell}\n isDragOverlay={isDragOverlay}\n key={cell.id}\n />\n );\n }\n\n // Drag overlay only need to print the DnD handle and the first user's cell\n if (isDragOverlay) {\n if (column.id !== 'dragHandleColumn' && (!isUserCell || userCellsProcessed !== 0)) jsx = null;\n }\n\n // Reset expand cell\n if (isUserCell) {\n shouldAddExpandCell = false;\n userCellsProcessed += 1;\n }\n return jsx;\n })}\n </>\n );\n }\n\n return null;\n};\n\nexport { Cells };\nexport default Cells;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { INTERNAL_COLUMNS } from '../../addons/Columns';\nimport { StyledActionCell } from '../../styled';\nimport type { TypescriptRow } from '../../types/props';\nimport { Cell } from './Cell';\nimport { DataTableContext } from '../../DataTableContext';\n\nconst Cells: React.ComponentType<{\n row: TypescriptRow;\n isRowSelected: boolean;\n isDragOverlay: boolean;\n}> = (props) => {\n const { row, isRowSelected, isDragOverlay } = props;\n const ctx = useContext(DataTableContext);\n // we won't print sub-rows more nested than the first level\n if (row.depth <= 1) {\n let shouldAddExpandCell = false;\n let userCellsProcessed = 0;\n return (\n <>\n {row.cells.map((cell: any) => {\n const { column } = cell;\n\n const isUserCell = !INTERNAL_COLUMNS.includes(column.id);\n\n let jsx = null;\n\n if (column.id === 'rowActions') {\n const ActionComponent = cell.render;\n jsx = (\n <StyledActionCell role=\"cell\" key={cell.id}>\n <ActionComponent row={row} cell={cell} column={column} isRowSelected={isRowSelected} ctx={ctx} />\n </StyledActionCell>\n );\n } else if (column.id === 'expander') {\n // Next user's cell will have the expand cell\n shouldAddExpandCell = !isDragOverlay; // Don't add it on drag overlay\n } else {\n jsx = (\n <Cell\n cell={cell}\n column={column}\n row={row}\n isRowSelected={isRowSelected}\n shouldAddExpandCell={isUserCell && shouldAddExpandCell}\n isDragOverlay={isDragOverlay}\n key={cell.id}\n />\n );\n }\n\n // Drag overlay only need to print the DnD handle and the first user's cell\n if (isDragOverlay) {\n if (column.id !== 'dragHandleColumn' && (!isUserCell || userCellsProcessed !== 0)) jsx = null;\n }\n\n // Reset expand cell\n if (isUserCell) {\n shouldAddExpandCell = false;\n userCellsProcessed += 1;\n }\n return jsx;\n })}\n </>\n );\n }\n\n return null;\n};\n\nexport { Cells };\nexport default Cells;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACmBjB,mBAYU,WAZV;AAnBN,SAAgB,kBAAkB;AAClC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAEjC,SAAS,YAAY;AACrB,SAAS,wBAAwB;AAEjC,MAAM,QAID,CAAC,UAAU;AACd,QAAM,EAAE,KAAK,eAAe,cAAc,IAAI;AAC9C,QAAM,MAAM,WAAW,gBAAgB;AAEvC,MAAI,IAAI,SAAS,GAAG;AAClB,QAAI,sBAAsB;AAC1B,QAAI,qBAAqB;AACzB,WACE;AAAA,MACG,cAAI,MAAM,IAAI,CAAC,SAAc;AAC5B,cAAM,EAAE,OAAO,IAAI;AAEnB,cAAM,aAAa,CAAC,iBAAiB,SAAS,OAAO,EAAE;AAEvD,YAAIA,OAAM;AAEV,YAAI,OAAO,OAAO,cAAc;AAC9B,gBAAM,kBAAkB,KAAK;AAC7B,UAAAA,OACE,oBAAC;AAAA,YAAiB,MAAK;AAAA,YACrB,8BAAC;AAAA,cAAgB;AAAA,cAAU;AAAA,cAAY;AAAA,cAAgB;AAAA,cAA8B;AAAA,aAAU;AAAA,aAD9D,KAAK,EAExC;AAAA,QAEJ,WAAW,OAAO,OAAO,YAAY;AAEnC,gCAAsB,CAAC;AAAA,QACzB,OAAO;AACL,UAAAA,OACE,oBAAC;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,qBAAqB,cAAc;AAAA,YACnC;AAAA,aACK,KAAK,EACZ;AAAA,QAEJ;AAGA,YAAI,eAAe;AACjB,cAAI,OAAO,OAAO,uBAAuB,CAAC,cAAc,uBAAuB;AAAI,YAAAA,OAAM;AAAA,QAC3F;AAGA,YAAI,YAAY;AACd,gCAAsB;AACtB,gCAAsB;AAAA,QACxB;AACA,eAAOA;AAAA,MACT,CAAC;AAAA,KACH;AAAA,EAEJ;AAEA,SAAO;AACT;AAGA,IAAO,gBAAQ;",
|
|
6
6
|
"names": ["jsx"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Cells/useCellStyle.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo, type CSSProperties } from 'react';\nimport { InternalTypescriptColumn } from '../../types/props';\nimport { DataTableContext } from '../../DataTableContext';\n\nexport const useCellStyle = (\n column: InternalTypescriptColumn,\n shouldAddExpandCell: boolean,\n): [string, CSSProperties] => {\n const {\n tableProps: { textWrap },\n } = useContext(DataTableContext);\n\n const appliedTextWrap = column.textWrap || textWrap;\n\n const cellStyle = useMemo(() => {\n const newStyle: CSSProperties = {};\n switch (appliedTextWrap) {\n case 'wrap-all':\n newStyle.wordBreak = 'break-all';\n break;\n case 'truncate':\n newStyle.whiteSpace = 'nowrap';\n break;\n case 'wrap':\n default:\n newStyle.whiteSpace = 'normal';\n break;\n }\n if (shouldAddExpandCell) {\n newStyle.gridColumn = `span 2`;\n newStyle.padding = `0 16px 0 2px`;\n }\n return { ...newStyle, ...(column.cellStyle ?? {}) };\n }, [appliedTextWrap, column.cellStyle, shouldAddExpandCell]);\n\n return [appliedTextWrap, cellStyle];\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo, type CSSProperties } from 'react';\nimport type { InternalTypescriptColumn } from '../../types/props';\nimport { DataTableContext } from '../../DataTableContext';\n\nexport const useCellStyle = (\n column: InternalTypescriptColumn,\n shouldAddExpandCell: boolean,\n): [string, CSSProperties] => {\n const {\n tableProps: { textWrap },\n } = useContext(DataTableContext);\n\n const appliedTextWrap = column.textWrap || textWrap;\n\n const cellStyle = useMemo(() => {\n const newStyle: CSSProperties = {};\n switch (appliedTextWrap) {\n case 'wrap-all':\n newStyle.wordBreak = 'break-all';\n break;\n case 'truncate':\n newStyle.whiteSpace = 'nowrap';\n break;\n case 'wrap':\n default:\n newStyle.whiteSpace = 'normal';\n break;\n }\n if (shouldAddExpandCell) {\n newStyle.gridColumn = `span 2`;\n newStyle.padding = `0 16px 0 2px`;\n }\n return { ...newStyle, ...(column.cellStyle ?? {}) };\n }, [appliedTextWrap, column.cellStyle, shouldAddExpandCell]);\n\n return [appliedTextWrap, cellStyle];\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,eAAmC;AAExD,SAAS,wBAAwB;AAE1B,MAAM,eAAe,CAC1B,QACA,wBAC4B;AAC5B,QAAM;AAAA,IACJ,YAAY,EAAE,SAAS;AAAA,EACzB,IAAI,WAAW,gBAAgB;AAE/B,QAAM,kBAAkB,OAAO,YAAY;AAE3C,QAAM,YAAY,QAAQ,MAAM;AAC9B,UAAM,WAA0B,CAAC;AACjC,YAAQ,iBAAiB;AAAA,MACvB,KAAK;AACH,iBAAS,YAAY;AACrB;AAAA,MACF,KAAK;AACH,iBAAS,aAAa;AACtB;AAAA,MACF,KAAK;AAAA,MACL;AACE,iBAAS,aAAa;AACtB;AAAA,IACJ;AACA,QAAI,qBAAqB;AACvB,eAAS,aAAa;AACtB,eAAS,UAAU;AAAA,IACrB;AACA,WAAO,EAAE,GAAG,UAAU,GAAI,OAAO,aAAa,CAAC,EAAG;AAAA,EACpD,GAAG,CAAC,iBAAiB,OAAO,WAAW,mBAAmB,CAAC;AAE3D,SAAO,CAAC,iBAAiB,SAAS;AACpC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,9 +3,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import React2, { useContext } from "react";
|
|
4
4
|
import { Grid } from "@elliemae/ds-grid";
|
|
5
5
|
import { WarningTriangle } from "@elliemae/ds-icons";
|
|
6
|
-
import { __UNSAFE_SPACE_TO_DIMSUM, toMobile } from "@elliemae/ds-system";
|
|
6
|
+
import { __UNSAFE_SPACE_TO_DIMSUM, toMobile, styled } from "@elliemae/ds-system";
|
|
7
7
|
import { DSButton } from "@elliemae/ds-button";
|
|
8
|
-
import { styled } from "@elliemae/ds-system";
|
|
9
8
|
import { DataTableContext } from "../DataTableContext";
|
|
10
9
|
const EmptyStateWrapper = styled(Grid)`
|
|
11
10
|
position: sticky;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/EmptyContent.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { WarningTriangle } from '@elliemae/ds-icons';\nimport { __UNSAFE_SPACE_TO_DIMSUM, toMobile } from '@elliemae/ds-system';\nimport { DSButton } from '@elliemae/ds-button';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { WarningTriangle } from '@elliemae/ds-icons';\nimport { __UNSAFE_SPACE_TO_DIMSUM, toMobile, styled } from '@elliemae/ds-system';\nimport { DSButton } from '@elliemae/ds-button';\n\nimport { DataTableContext } from '../DataTableContext';\n\nconst EmptyStateWrapper = styled(Grid)`\n position: sticky;\n height: fit-content;\n top: 0;\n left: 0;\n`;\nconst Icon = styled(WarningTriangle)`\n fill: ${(props) => props.theme.colors.neutral[300]};\n color: ${(props) => props.theme.colors.neutral[300]};\n justify-self: center;\n`;\nconst PrimaryMessage = styled.p`\n text-align: center;\n font-weight: bold;\n font-size: ${(props) => toMobile(props.theme.fontSizes.value[400])};\n color: ${(props) => props.theme.colors.neutral[600]};\n margin-top: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.s)};\n margin-bottom: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xs)};\n`;\nconst SecondaryMessage = styled.p`\n text-align: center;\n font-size: ${(props) => toMobile(props.theme.fontSizes.value[400])}; /* 13px */\n color: ${(props) => props.theme.colors.neutral[500]};\n margin: 0;\n`;\nconst Button = styled(DSButton)`\n margin-top: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.m)};\n justify-self: center;\n width: fit-content;\n`;\nconst CenterContentFlexWrapper = styled.div<{ width: number | string }>`\n width: ${({ width }) => width}px;\n height: calc(100% - 48px);\n display: flex;\n align-items: center;\n`;\n\nconst EmptyContent: React.ComponentType<{ width: string | number }> = ({ width }) => {\n const {\n tableProps: {\n noResultsPlaceholder,\n noResultsMessage,\n noResultsSecondaryMessage,\n noResultsButtonLabel,\n onNoResultsButtonClick,\n },\n virtualListRef,\n } = useContext(DataTableContext);\n\n if (React.isValidElement(noResultsPlaceholder))\n return <CenterContentFlexWrapper width={width}>{noResultsPlaceholder}</CenterContentFlexWrapper>;\n\n return (\n <CenterContentFlexWrapper width={width} aria-live=\"assertive\" role=\"status\">\n <EmptyStateWrapper width={virtualListRef.current?.clientWidth} justifyContent=\"center\">\n <Icon size=\"xxl\" />\n <PrimaryMessage>{noResultsMessage}</PrimaryMessage>\n {noResultsSecondaryMessage ? <SecondaryMessage>{noResultsSecondaryMessage}</SecondaryMessage> : null}\n {noResultsButtonLabel && onNoResultsButtonClick ? (\n <Button buttonType=\"secondary\" labelText={noResultsButtonLabel} onClick={onNoResultsButtonClick} />\n ) : null}\n </EmptyStateWrapper>\n </CenterContentFlexWrapper>\n );\n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AI,WAAW,gBAAgB;AAE/B,MAAIA,OAAM,eAAe,oBAAoB;AAC3C,WAAO,oBAAC;AAAA,MAAyB;AAAA,MAAe;AAAA,KAAqB;AAEvE,SACE,oBAAC;AAAA,IAAyB;AAAA,IAAc,aAAU;AAAA,IAAY,MAAK;AAAA,IACjE,+BAAC;AAAA,MAAkB,OAAO,eAAe,SAAS;AAAA,MAAa,gBAAe;AAAA,MAC5E;AAAA,4BAAC;AAAA,UAAK,MAAK;AAAA,SAAM;AAAA,QACjB,oBAAC;AAAA,UAAgB;AAAA,SAAiB;AAAA,QACjC,4BAA4B,oBAAC;AAAA,UAAkB;AAAA,SAA0B,IAAsB;AAAA,QAC/F,wBAAwB,yBACvB,oBAAC;AAAA,UAAO,YAAW;AAAA,UAAY,WAAW;AAAA,UAAsB,SAAS;AAAA,SAAwB,IAC/F;AAAA;AAAA,KACN;AAAA,GACF;AAEJ;AAGA,IAAO,uBAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/FilterBar/FiltersBar.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useContext, useMemo, useRef, useState } from 'react';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport { FILTER_TYPES } from '../../exported-related';\nimport {\n SelectPill,\n MultiSelectPill,\n SingleDatePill,\n DateRangePill,\n NumberRangePill,\n DateSwitcherPill,\n} from './components';\nimport { DataTableContext } from '../../DataTableContext';\nimport { StyledDropdownMenu, StyledWrapper } from './styled';\nimport { FilterPillComponent } from './types';\nimport { DATA_TESTID } from '../../configs/constants';\n\nconst pillRenderMapper: Record<string, FilterPillComponent<any>> = {\n [FILTER_TYPES.SELECT]: SelectPill,\n [FILTER_TYPES.MULTI_SELECT]: MultiSelectPill,\n [FILTER_TYPES.SINGLE_DATE]: SingleDatePill,\n [FILTER_TYPES.DATE_RANGE]: DateRangePill,\n [FILTER_TYPES.DATE_SWITCHER]: DateSwitcherPill,\n [FILTER_TYPES.NUMBER_RANGE]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE]: NumberRangePill,\n};\n\nexport const FiltersBar: React.ComponentType = () => {\n const {\n tableProps: { width, filterBarProps, onFiltersChange, filters },\n visibleColumns,\n } = useContext(DataTableContext);\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(null);\n\n const { filterBarAddonRenderer } = filterBarProps || {};\n\n const removeAllFilters = useCallback(() => {\n onFiltersChange([]);\n filterBarProps?.onClearAllFiltersClick?.();\n setIsOpen(false);\n }, [onFiltersChange, filterBarProps?.onClearAllFiltersClick]);\n\n const onFilterBarClose = useCallback(() => {\n filterBarProps?.onDropdownMenuToggle?.(false, 'onClose');\n dropdownMenuRef.current.focus();\n setIsOpen(false);\n }, [filterBarProps?.onDropdownMenuToggle]);\n\n const onFilterBarOpen = useCallback(() => {\n filterBarProps?.onDropdownMenuToggle?.(true, 'onOpen');\n setIsOpen(true);\n }, [filterBarProps?.onDropdownMenuToggle]);\n\n const onFilterBarOnClickOutside = useCallback(() => {\n filterBarProps?.onDropdownMenuToggle?.(false, 'onClickOutside');\n filterBarProps?.onDropdownMenuClickOutside?.();\n setIsOpen(false);\n }, [filterBarProps?.onDropdownMenuToggle, filterBarProps?.onDropdownMenuClickOutside]);\n\n const onTriggerClick = useCallback(() => {\n filterBarProps?.onDropdownMenuTriggerClick?.();\n onFilterBarOpen();\n }, [filterBarProps?.onDropdownMenuTriggerClick]);\n\n const finalIsOpen = useMemo(() => {\n if (typeof filterBarProps?.isDropdownMenuOpen === 'boolean') return filterBarProps.isDropdownMenuOpen;\n return isOpen;\n }, [filterBarProps?.isDropdownMenuOpen, isOpen]);\n\n return (\n <StyledWrapper width={width} aria-live=\"polite\" aria-relevant=\"additions removals\" gutter=\"xs\">\n {filters.map(({ id: column, type, value }, index) => {\n const columnHeader = visibleColumns.find((col) => col.accessor === column)?.Header;\n let Component: FilterPillComponent<unknown> = () => null;\n\n const filterType = type;\n if (filterType in pillRenderMapper) {\n Component = pillRenderMapper[filterType];\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 value={value}\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 <StyledDropdownMenu\n preventOverflow=\"scrollParent\"\n isOpen={finalIsOpen}\n onClose={onFilterBarClose}\n onClickOutsideMenu={onFilterBarOnClickOutside}\n options={[\n {\n id: '__internal__option__clear__filters',\n label: 'Clear Filters',\n onClick: removeAllFilters,\n onKeyDown: (e: React.KeyboardEvent) => {\n if (['Enter', 'Space'].includes(e.code)) removeAllFilters();\n },\n },\n ...(filterBarProps?.extraOptions || []),\n ]}\n triggerComponent={\n <DSButtonV2\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_BAR_DD_MENU_BUTTON}\n buttonType=\"icon\"\n innerRef={dropdownMenuRef}\n onClick={onTriggerClick}\n >\n <MoreOptionsVert />\n </DSButtonV2>\n }\n />\n )}\n </StyledWrapper>\n );\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useContext, useMemo, useRef, useState } from 'react';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport { FILTER_TYPES } from '../../exported-related';\nimport {\n SelectPill,\n MultiSelectPill,\n SingleDatePill,\n DateRangePill,\n NumberRangePill,\n DateSwitcherPill,\n} from './components';\nimport { DataTableContext } from '../../DataTableContext';\nimport { StyledDropdownMenu, StyledWrapper } from './styled';\nimport type { FilterPillComponent } from './types';\nimport { DATA_TESTID } from '../../configs/constants';\n\nconst pillRenderMapper: Record<string, FilterPillComponent<any>> = {\n [FILTER_TYPES.SELECT]: SelectPill,\n [FILTER_TYPES.MULTI_SELECT]: MultiSelectPill,\n [FILTER_TYPES.SINGLE_DATE]: SingleDatePill,\n [FILTER_TYPES.DATE_RANGE]: DateRangePill,\n [FILTER_TYPES.DATE_SWITCHER]: DateSwitcherPill,\n [FILTER_TYPES.NUMBER_RANGE]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE]: NumberRangePill,\n};\n\nexport const FiltersBar: React.ComponentType = () => {\n const {\n tableProps: { width, filterBarProps, onFiltersChange, filters },\n visibleColumns,\n } = useContext(DataTableContext);\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(null);\n\n const { filterBarAddonRenderer } = filterBarProps || {};\n\n const removeAllFilters = useCallback(() => {\n onFiltersChange([]);\n filterBarProps?.onClearAllFiltersClick?.();\n setIsOpen(false);\n }, [onFiltersChange, filterBarProps?.onClearAllFiltersClick]);\n\n const onFilterBarClose = useCallback(() => {\n filterBarProps?.onDropdownMenuToggle?.(false, 'onClose');\n dropdownMenuRef.current.focus();\n setIsOpen(false);\n }, [filterBarProps?.onDropdownMenuToggle]);\n\n const onFilterBarOpen = useCallback(() => {\n filterBarProps?.onDropdownMenuToggle?.(true, 'onOpen');\n setIsOpen(true);\n }, [filterBarProps?.onDropdownMenuToggle]);\n\n const onFilterBarOnClickOutside = useCallback(() => {\n filterBarProps?.onDropdownMenuToggle?.(false, 'onClickOutside');\n filterBarProps?.onDropdownMenuClickOutside?.();\n setIsOpen(false);\n }, [filterBarProps?.onDropdownMenuToggle, filterBarProps?.onDropdownMenuClickOutside]);\n\n const onTriggerClick = useCallback(() => {\n filterBarProps?.onDropdownMenuTriggerClick?.();\n onFilterBarOpen();\n }, [filterBarProps?.onDropdownMenuTriggerClick]);\n\n const finalIsOpen = useMemo(() => {\n if (typeof filterBarProps?.isDropdownMenuOpen === 'boolean') return filterBarProps.isDropdownMenuOpen;\n return isOpen;\n }, [filterBarProps?.isDropdownMenuOpen, isOpen]);\n\n return (\n <StyledWrapper width={width} aria-live=\"polite\" aria-relevant=\"additions removals\" gutter=\"xs\">\n {filters.map(({ id: column, type, value }, index) => {\n const columnHeader = visibleColumns.find((col) => col.accessor === column)?.Header;\n let Component: FilterPillComponent<unknown> = () => null;\n\n const filterType = type;\n if (filterType in pillRenderMapper) {\n Component = pillRenderMapper[filterType];\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 value={value}\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 <StyledDropdownMenu\n preventOverflow=\"scrollParent\"\n isOpen={finalIsOpen}\n onClose={onFilterBarClose}\n onClickOutsideMenu={onFilterBarOnClickOutside}\n options={[\n {\n id: '__internal__option__clear__filters',\n label: 'Clear Filters',\n onClick: removeAllFilters,\n onKeyDown: (e: React.KeyboardEvent) => {\n if (['Enter', 'Space'].includes(e.code)) removeAllFilters();\n },\n },\n ...(filterBarProps?.extraOptions || []),\n ]}\n triggerComponent={\n <DSButtonV2\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_BAR_DD_MENU_BUTTON}\n buttonType=\"icon\"\n innerRef={dropdownMenuRef}\n onClick={onTriggerClick}\n >\n <MoreOptionsVert />\n </DSButtonV2>\n }\n />\n )}\n </StyledWrapper>\n );\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;AC+EnB,SAYM,KAZN;AA/EJ,OAAOA,UAAS,aAAa,YAAY,SAAS,QAAQ,gBAAgB;AAC1E,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AACjC,SAAS,oBAAoB,qBAAqB;AAElD,SAAS,mBAAmB;AAE5B,MAAM,mBAA6D;AAAA,EACjE,CAAC,aAAa,SAAS;AAAA,EACvB,CAAC,aAAa,eAAe;AAAA,EAC7B,CAAC,aAAa,cAAc;AAAA,EAC5B,CAAC,aAAa,aAAa;AAAA,EAC3B,CAAC,aAAa,gBAAgB;AAAA,EAC9B,CAAC,aAAa,eAAe;AAAA,EAC7B,CAAC,aAAa,iBAAiB;AACjC;AAEO,MAAM,aAAkC,MAAM;AACnD,QAAM;AAAA,IACJ,YAAY,EAAE,OAAO,gBAAgB,iBAAiB,QAAQ;AAAA,IAC9D;AAAA,EACF,IAAI,WAAW,gBAAgB;AAE/B,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAE1C,QAAM,gBAAgB,QAAQ,MAAM;AAClC,UAAM,OAAuC,CAAC;AAC9C,aAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AAAG,WAAK,KAAKA,OAAM,UAAU,CAAC;AACvE,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,MAAM,CAAC;AAEnB,QAAM,kBAAkB,OAAO,IAAI;AAEnC,QAAM,EAAE,uBAAuB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C,sBAAY,iBAAiB;AAAA,QAC/B,WAAW,gBAAgB,oBAAoB;AAC7C,sBAAY,eAAe;AAAA,QAC7B;AACA,eACE,oBAAC;AAAA,UAEC,cAAc,OAAO,iBAAiB,WAAW,eAAe;AAAA,UAChE;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,SAAS,cAAc,QAAQ;AAAA,UAC/B,UAAU,cAAc;AAAA,UACxB,SAAS,cAAc,QAAQ,MAAM;AAAA,WARhC,MASP;AAAA,MAEJ,CAAC;AAAA,MACA,yBACC,uBAAuB,EAAE,UAAU,gBAAgB,CAAC,IAEpD,oBAAC;AAAA,QACC,iBAAgB;AAAA,QAChB,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,oBAAoB;AAAA,QACpB,SAAS;AAAA,UACP;AAAA,YACE,IAAI;AAAA,YACJ,OAAO;AAAA,YACP,SAAS;AAAA,YACT,WAAW,CAAC,MAA2B;AACrC,kBAAI,CAAC,SAAS,OAAO,EAAE,SAAS,EAAE,IAAI;AAAG,iCAAiB;AAAA,YAC5D;AAAA,UACF;AAAA,UACA,GAAI,gBAAgB,gBAAgB,CAAC;AAAA,QACvC;AAAA,QACA,kBACE,oBAAC;AAAA,UACC,eAAa,YAAY;AAAA,UACzB,YAAW;AAAA,UACX,UAAU;AAAA,UACV,SAAS;AAAA,UAET,8BAAC,mBAAgB;AAAA,SACnB;AAAA,OAEJ;AAAA;AAAA,GAEJ;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/FilterBar/components/DateRangePill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport { FilterPillComponent } from '../types';\n\nconst format = (value: string) => value?.replace(/-/g, '/');\n\nexport const DateRangePill: FilterPillComponent<{ startDate: string; endDate: string }> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const handleOnRemove = useCallback(() => {\n if (prevRef?.current) prevRef.current.focus();\n else nextRef.current?.focus();\n onFiltersChange(filters.filter((filter) => filter.id !== column));\n }, [onFiltersChange, filters, prevRef, nextRef, column]);\n\n return value?.startDate && value?.endDate ? (\n <DSPillGroupV2>\n <DSPillV2 type=\"label\" label={columnHeader} />\n <DSPillV2\n type=\"removable\"\n label={`${format(value.startDate)} - ${format(value.endDate)}`}\n onRemove={handleOnRemove}\n innerRef={innerRef}\n />\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport type { FilterPillComponent } from '../types';\n\nconst format = (value: string) => value?.replace(/-/g, '/');\n\nexport const DateRangePill: FilterPillComponent<{ startDate: string; endDate: string }> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const handleOnRemove = useCallback(() => {\n if (prevRef?.current) prevRef.current.focus();\n else nextRef.current?.focus();\n onFiltersChange(filters.filter((filter) => filter.id !== column));\n }, [onFiltersChange, filters, prevRef, nextRef, column]);\n\n return value?.startDate && value?.endDate ? (\n <DSPillGroupV2>\n <DSPillV2 type=\"label\" label={columnHeader} />\n <DSPillV2\n type=\"removable\"\n label={`${format(value.startDate)} - ${format(value.endDate)}`}\n onRemove={handleOnRemove}\n innerRef={innerRef}\n />\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACuBnB,SACE,KADF;AAvBJ,SAAgB,mBAAmB;AACnC,SAAS,eAAe,gBAAgB;AAGxC,MAAM,SAAS,CAAC,UAAkB,OAAO,QAAQ,MAAM,GAAG;AAEnD,MAAM,gBAA6E,CAAC;AAAA,EACzF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,iBAAiB,YAAY,MAAM;AACvC,QAAI,SAAS;AAAS,cAAQ,QAAQ,MAAM;AAAA;AACvC,cAAQ,SAAS,MAAM;AAC5B,oBAAgB,QAAQ,OAAO,CAAC,WAAW,OAAO,OAAO,MAAM,CAAC;AAAA,EAClE,GAAG,CAAC,iBAAiB,SAAS,SAAS,SAAS,MAAM,CAAC;AAEvD,SAAO,OAAO,aAAa,OAAO,UAChC,qBAAC;AAAA,IACC;AAAA,0BAAC;AAAA,QAAS,MAAK;AAAA,QAAQ,OAAO;AAAA,OAAc;AAAA,MAC5C,oBAAC;AAAA,QACC,MAAK;AAAA,QACL,OAAO,GAAG,OAAO,MAAM,SAAS,OAAO,OAAO,MAAM,OAAO;AAAA,QAC3D,UAAU;AAAA,QACV;AAAA,OACF;AAAA;AAAA,GACF,IACE;AACN;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/FilterBar/components/DateSwitcherPill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport { FilterPillComponent } from '../types';\n\nconst format = (value: string) => value?.replace(/-/g, '/');\n\nexport const DateSwitcherPill: FilterPillComponent<{ startDate: string; endDate: string; isDateRange: boolean }> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const handleOnRemove = useCallback(() => {\n if (prevRef?.current) prevRef.current.focus();\n else nextRef.current?.focus();\n onFiltersChange(filters.filter((filter) => filter.id !== column));\n }, [onFiltersChange, filters, prevRef, nextRef, column]);\n\n return value?.startDate && value?.endDate ? (\n <DSPillGroupV2>\n <DSPillV2 type=\"label\" label={columnHeader} />\n <DSPillV2\n type=\"removable\"\n label={value.isDateRange ? `${format(value.startDate)} - ${format(value.endDate)}` : format(value.startDate)}\n onRemove={handleOnRemove}\n innerRef={innerRef}\n />\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport type { FilterPillComponent } from '../types';\n\nconst format = (value: string) => value?.replace(/-/g, '/');\n\nexport const DateSwitcherPill: FilterPillComponent<{ startDate: string; endDate: string; isDateRange: boolean }> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const handleOnRemove = useCallback(() => {\n if (prevRef?.current) prevRef.current.focus();\n else nextRef.current?.focus();\n onFiltersChange(filters.filter((filter) => filter.id !== column));\n }, [onFiltersChange, filters, prevRef, nextRef, column]);\n\n return value?.startDate && value?.endDate ? (\n <DSPillGroupV2>\n <DSPillV2 type=\"label\" label={columnHeader} />\n <DSPillV2\n type=\"removable\"\n label={value.isDateRange ? `${format(value.startDate)} - ${format(value.endDate)}` : format(value.startDate)}\n onRemove={handleOnRemove}\n innerRef={innerRef}\n />\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACuBnB,SACE,KADF;AAvBJ,SAAgB,mBAAmB;AACnC,SAAS,eAAe,gBAAgB;AAGxC,MAAM,SAAS,CAAC,UAAkB,OAAO,QAAQ,MAAM,GAAG;AAEnD,MAAM,mBAAsG,CAAC;AAAA,EAClH;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,iBAAiB,YAAY,MAAM;AACvC,QAAI,SAAS;AAAS,cAAQ,QAAQ,MAAM;AAAA;AACvC,cAAQ,SAAS,MAAM;AAC5B,oBAAgB,QAAQ,OAAO,CAAC,WAAW,OAAO,OAAO,MAAM,CAAC;AAAA,EAClE,GAAG,CAAC,iBAAiB,SAAS,SAAS,SAAS,MAAM,CAAC;AAEvD,SAAO,OAAO,aAAa,OAAO,UAChC,qBAAC;AAAA,IACC;AAAA,0BAAC;AAAA,QAAS,MAAK;AAAA,QAAQ,OAAO;AAAA,OAAc;AAAA,MAC5C,oBAAC;AAAA,QACC,MAAK;AAAA,QACL,OAAO,MAAM,cAAc,GAAG,OAAO,MAAM,SAAS,OAAO,OAAO,MAAM,OAAO,MAAM,OAAO,MAAM,SAAS;AAAA,QAC3G,UAAU;AAAA,QACV;AAAA,OACF;AAAA;AAAA,GACF,IACE;AACN;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/FilterBar/components/MultiSelectPill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport { FilterPillComponent, FilterOptionT } from '../types';\n\nexport const MultiSelectPill: FilterPillComponent<FilterOptionT[]> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const multiSelectedValue = value
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport type { FilterPillComponent, FilterOptionT } from '../types';\n\nexport const MultiSelectPill: FilterPillComponent<FilterOptionT[]> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const multiSelectedValue = value;\n const handleOnRemove = useCallback(\n (valToRemove) => {\n const newFilters = [...filters];\n const filterIndex = newFilters.findIndex((filter) => filter.id === column);\n newFilters[filterIndex].value = multiSelectedValue.filter((val) => val.dsId !== valToRemove.dsId);\n if (newFilters[filterIndex].value.length === 0) {\n if (prevRef?.current) prevRef.current.focus();\n else nextRef.current?.focus();\n newFilters.splice(filterIndex, 1);\n }\n onFiltersChange(newFilters);\n },\n [filters, multiSelectedValue, onFiltersChange, column, prevRef, nextRef],\n );\n return multiSelectedValue?.length ? (\n <DSPillGroupV2>\n <DSPillV2 type=\"label\" label={columnHeader} />\n {multiSelectedValue.map((val, index) => (\n <DSPillV2\n key={val.dsId}\n type=\"removable\"\n label={val.label}\n onRemove={() => handleOnRemove(val)}\n innerRef={index === multiSelectedValue.length - 1 ? innerRef : {}}\n />\n ))}\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;AC8BnB,SACE,KADF;AA9BJ,SAAgB,mBAAmB;AACnC,SAAS,eAAe,gBAAgB;AAGjC,MAAM,kBAAwD,CAAC;AAAA,EACpE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAqB;AAC3B,QAAM,iBAAiB;AAAA,IACrB,CAAC,gBAAgB;AACf,YAAM,aAAa,CAAC,GAAG,OAAO;AAC9B,YAAM,cAAc,WAAW,UAAU,CAAC,WAAW,OAAO,OAAO,MAAM;AACzE,iBAAW,aAAa,QAAQ,mBAAmB,OAAO,CAAC,QAAQ,IAAI,SAAS,YAAY,IAAI;AAChG,UAAI,WAAW,aAAa,MAAM,WAAW,GAAG;AAC9C,YAAI,SAAS;AAAS,kBAAQ,QAAQ,MAAM;AAAA;AACvC,kBAAQ,SAAS,MAAM;AAC5B,mBAAW,OAAO,aAAa,CAAC;AAAA,MAClC;AACA,sBAAgB,UAAU;AAAA,IAC5B;AAAA,IACA,CAAC,SAAS,oBAAoB,iBAAiB,QAAQ,SAAS,OAAO;AAAA,EACzE;AACA,SAAO,oBAAoB,SACzB,qBAAC;AAAA,IACC;AAAA,0BAAC;AAAA,QAAS,MAAK;AAAA,QAAQ,OAAO;AAAA,OAAc;AAAA,MAC3C,mBAAmB,IAAI,CAAC,KAAK,UAC5B,oBAAC;AAAA,QAEC,MAAK;AAAA,QACL,OAAO,IAAI;AAAA,QACX,UAAU,MAAM,eAAe,GAAG;AAAA,QAClC,UAAU,UAAU,mBAAmB,SAAS,IAAI,WAAW,CAAC;AAAA,SAJ3D,IAAI,IAKX,CACD;AAAA;AAAA,GACH,IACE;AACN;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/FilterBar/components/NumberRangePill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport { FilterPillComponent } from '../types';\n\nexport const NumberRangePill: FilterPillComponent<{ from: string; to: string }> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const handleOnRemove = useCallback(() => {\n if (prevRef?.current) prevRef.current.focus();\n else nextRef.current?.focus();\n onFiltersChange(filters.filter((filter) => filter.id !== column));\n }, [onFiltersChange, filters, column, prevRef, nextRef]);\n\n return (value?.from ?? '') !== '' && (value?.to ?? '') !== '' ? (\n <DSPillGroupV2>\n <DSPillV2 type=\"label\" label={columnHeader} />\n <DSPillV2 type=\"removable\" label={`${value.from} - ${value.to}`} onRemove={handleOnRemove} innerRef={innerRef} />\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport type { FilterPillComponent } from '../types';\n\nexport const NumberRangePill: FilterPillComponent<{ from: string; to: string }> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const handleOnRemove = useCallback(() => {\n if (prevRef?.current) prevRef.current.focus();\n else nextRef.current?.focus();\n onFiltersChange(filters.filter((filter) => filter.id !== column));\n }, [onFiltersChange, filters, column, prevRef, nextRef]);\n\n return (value?.from ?? '') !== '' && (value?.to ?? '') !== '' ? (\n <DSPillGroupV2>\n <DSPillV2 type=\"label\" label={columnHeader} />\n <DSPillV2 type=\"removable\" label={`${value.from} - ${value.to}`} onRemove={handleOnRemove} innerRef={innerRef} />\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACqBnB,SACE,KADF;AArBJ,SAAgB,mBAAmB;AACnC,SAAS,eAAe,gBAAgB;AAGjC,MAAM,kBAAqE,CAAC;AAAA,EACjF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,iBAAiB,YAAY,MAAM;AACvC,QAAI,SAAS;AAAS,cAAQ,QAAQ,MAAM;AAAA;AACvC,cAAQ,SAAS,MAAM;AAC5B,oBAAgB,QAAQ,OAAO,CAAC,WAAW,OAAO,OAAO,MAAM,CAAC;AAAA,EAClE,GAAG,CAAC,iBAAiB,SAAS,QAAQ,SAAS,OAAO,CAAC;AAEvD,UAAQ,OAAO,QAAQ,QAAQ,OAAO,OAAO,MAAM,QAAQ,KACzD,qBAAC;AAAA,IACC;AAAA,0BAAC;AAAA,QAAS,MAAK;AAAA,QAAQ,OAAO;AAAA,OAAc;AAAA,MAC5C,oBAAC;AAAA,QAAS,MAAK;AAAA,QAAY,OAAO,GAAG,MAAM,UAAU,MAAM;AAAA,QAAM,UAAU;AAAA,QAAgB;AAAA,OAAoB;AAAA;AAAA,GACjH,IACE;AACN;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/FilterBar/components/SelectPill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport { FilterOptionT, FilterPillComponent } from '../types';\n\nexport const SelectPill: FilterPillComponent<FilterOptionT> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const handleOnRemove = useCallback(() => {\n if (prevRef?.current) prevRef.current.focus();\n else nextRef.current?.focus();\n onFiltersChange(filters.filter((filter) => filter.id !== column));\n }, [onFiltersChange, filters, prevRef, nextRef, column]);\n\n return value ? (\n <DSPillGroupV2>\n <DSPillV2 type=\"label\" label={columnHeader} />\n <DSPillV2 type=\"removable\" label={value.label} onRemove={handleOnRemove} innerRef={innerRef} />\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport type { FilterOptionT, FilterPillComponent } from '../types';\n\nexport const SelectPill: FilterPillComponent<FilterOptionT> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const handleOnRemove = useCallback(() => {\n if (prevRef?.current) prevRef.current.focus();\n else nextRef.current?.focus();\n onFiltersChange(filters.filter((filter) => filter.id !== column));\n }, [onFiltersChange, filters, prevRef, nextRef, column]);\n\n return value ? (\n <DSPillGroupV2>\n <DSPillV2 type=\"label\" label={columnHeader} />\n <DSPillV2 type=\"removable\" label={value.label} onRemove={handleOnRemove} innerRef={innerRef} />\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACqBnB,SACE,KADF;AArBJ,SAAgB,mBAAmB;AACnC,SAAS,eAAe,gBAAgB;AAGjC,MAAM,aAAiD,CAAC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,iBAAiB,YAAY,MAAM;AACvC,QAAI,SAAS;AAAS,cAAQ,QAAQ,MAAM;AAAA;AACvC,cAAQ,SAAS,MAAM;AAC5B,oBAAgB,QAAQ,OAAO,CAAC,WAAW,OAAO,OAAO,MAAM,CAAC;AAAA,EAClE,GAAG,CAAC,iBAAiB,SAAS,SAAS,SAAS,MAAM,CAAC;AAEvD,SAAO,QACL,qBAAC;AAAA,IACC;AAAA,0BAAC;AAAA,QAAS,MAAK;AAAA,QAAQ,OAAO;AAAA,OAAc;AAAA,MAC5C,oBAAC;AAAA,QAAS,MAAK;AAAA,QAAY,OAAO,MAAM;AAAA,QAAO,UAAU;AAAA,QAAgB;AAAA,OAAoB;AAAA;AAAA,GAC/F,IACE;AACN;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/FilterBar/components/SingleDatePill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport { FilterPillComponent } from '../types';\n\nexport const SingleDatePill: FilterPillComponent<string> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const handleOnRemove = useCallback(() => {\n if (prevRef?.current) prevRef.current.focus();\n else nextRef.current?.focus();\n onFiltersChange(filters.filter((filter) => filter.id !== column));\n }, [onFiltersChange, filters, prevRef, nextRef, column]);\n\n return value ? (\n <DSPillGroupV2>\n <DSPillV2 type=\"label\" label={columnHeader} />\n <DSPillV2 type=\"removable\" label={value.replace(/-/g, '/')} onRemove={handleOnRemove} innerRef={innerRef} />\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport type { FilterPillComponent } from '../types';\n\nexport const SingleDatePill: FilterPillComponent<string> = ({\n columnHeader,\n column,\n value,\n filters,\n onFiltersChange,\n prevRef,\n innerRef,\n nextRef,\n}) => {\n const handleOnRemove = useCallback(() => {\n if (prevRef?.current) prevRef.current.focus();\n else nextRef.current?.focus();\n onFiltersChange(filters.filter((filter) => filter.id !== column));\n }, [onFiltersChange, filters, prevRef, nextRef, column]);\n\n return value ? (\n <DSPillGroupV2>\n <DSPillV2 type=\"label\" label={columnHeader} />\n <DSPillV2 type=\"removable\" label={value.replace(/-/g, '/')} onRemove={handleOnRemove} innerRef={innerRef} />\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACqBnB,SACE,KADF;AArBJ,SAAgB,mBAAmB;AACnC,SAAS,eAAe,gBAAgB;AAGjC,MAAM,iBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,iBAAiB,YAAY,MAAM;AACvC,QAAI,SAAS;AAAS,cAAQ,QAAQ,MAAM;AAAA;AACvC,cAAQ,SAAS,MAAM;AAC5B,oBAAgB,QAAQ,OAAO,CAAC,WAAW,OAAO,OAAO,MAAM,CAAC;AAAA,EAClE,GAAG,CAAC,iBAAiB,SAAS,SAAS,SAAS,MAAM,CAAC;AAEvD,SAAO,QACL,qBAAC;AAAA,IACC;AAAA,0BAAC;AAAA,QAAS,MAAK;AAAA,QAAQ,OAAO;AAAA,OAAc;AAAA,MAC5C,oBAAC;AAAA,QAAS,MAAK;AAAA,QAAY,OAAO,MAAM,QAAQ,MAAM,GAAG;AAAA,QAAG,UAAU;AAAA,QAAgB;AAAA,OAAoB;AAAA;AAAA,GAC5G,IACE;AACN;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|