@elliemae/ds-data-table 3.55.0-next.8 → 3.55.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/DSDataTableDefinitions.js +1 -2
- package/dist/cjs/DSDataTableDefinitions.js.map +2 -2
- package/dist/cjs/addons/Editables/TextEditableCell/TextEditableCell.js +2 -4
- package/dist/cjs/addons/Editables/TextEditableCell/TextEditableCell.js.map +3 -3
- package/dist/cjs/addons/Filters/Components/CurrencyRangeFilter/index.js +2 -2
- package/dist/cjs/addons/Filters/Components/CurrencyRangeFilter/index.js.map +2 -2
- package/dist/cjs/addons/Filters/Components/index.js +0 -1
- package/dist/cjs/addons/Filters/Components/index.js.map +2 -2
- package/dist/cjs/configs/constants.js +0 -1
- package/dist/cjs/configs/constants.js.map +2 -2
- package/dist/cjs/exported-related/EditableCell.js +1 -3
- package/dist/cjs/exported-related/EditableCell.js.map +3 -3
- package/dist/cjs/exported-related/FilterTypes.js +1 -2
- package/dist/cjs/exported-related/FilterTypes.js.map +2 -2
- package/dist/cjs/exported-related/Filters/applyOutOfTheBoxFilters.js +1 -3
- package/dist/cjs/exported-related/Filters/applyOutOfTheBoxFilters.js.map +2 -2
- package/dist/cjs/parts/Cells/Cell.js +2 -13
- package/dist/cjs/parts/Cells/Cell.js.map +2 -2
- package/dist/cjs/parts/Cells/CellFactory.js +17 -38
- package/dist/cjs/parts/Cells/CellFactory.js.map +2 -2
- package/dist/cjs/parts/FilterBar/FiltersBar.js +1 -2
- package/dist/cjs/parts/FilterBar/FiltersBar.js.map +2 -2
- package/dist/cjs/parts/FilterBar/components/index.js +0 -1
- package/dist/cjs/parts/FilterBar/components/index.js.map +2 -2
- package/dist/cjs/parts/Filters/index.js +1 -2
- package/dist/cjs/parts/Filters/index.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/DSDataTableDefinitions.js +1 -2
- package/dist/esm/DSDataTableDefinitions.js.map +2 -2
- package/dist/esm/addons/Editables/TextEditableCell/TextEditableCell.js +2 -4
- package/dist/esm/addons/Editables/TextEditableCell/TextEditableCell.js.map +3 -3
- package/dist/esm/addons/Filters/Components/CurrencyRangeFilter/index.js +2 -2
- package/dist/esm/addons/Filters/Components/CurrencyRangeFilter/index.js.map +2 -2
- package/dist/esm/addons/Filters/Components/index.js +0 -1
- package/dist/esm/addons/Filters/Components/index.js.map +2 -2
- package/dist/esm/configs/constants.js +0 -1
- package/dist/esm/configs/constants.js.map +2 -2
- package/dist/esm/exported-related/EditableCell.js +1 -3
- package/dist/esm/exported-related/EditableCell.js.map +3 -3
- package/dist/esm/exported-related/FilterTypes.js +1 -2
- package/dist/esm/exported-related/FilterTypes.js.map +2 -2
- package/dist/esm/exported-related/Filters/applyOutOfTheBoxFilters.js +1 -3
- package/dist/esm/exported-related/Filters/applyOutOfTheBoxFilters.js.map +2 -2
- package/dist/esm/parts/Cells/Cell.js +2 -13
- package/dist/esm/parts/Cells/Cell.js.map +2 -2
- package/dist/esm/parts/Cells/CellFactory.js +17 -38
- package/dist/esm/parts/Cells/CellFactory.js.map +2 -2
- package/dist/esm/parts/FilterBar/FiltersBar.js +2 -4
- package/dist/esm/parts/FilterBar/FiltersBar.js.map +2 -2
- package/dist/esm/parts/FilterBar/components/index.js +0 -1
- package/dist/esm/parts/FilterBar/components/index.js.map +2 -2
- package/dist/esm/parts/Filters/index.js +2 -4
- package/dist/esm/parts/Filters/index.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/DSDataTableDefinitions.d.ts +0 -2
- package/dist/types/addons/Filters/Components/index.d.ts +0 -1
- package/dist/types/configs/constants.d.ts +0 -1
- package/dist/types/exported-related/FilterTypes.d.ts +0 -1
- package/dist/types/parts/FilterBar/components/index.d.ts +0 -1
- package/dist/types/react-desc-prop-types.d.ts +0 -3
- package/package.json +29 -29
- package/dist/cjs/addons/Filters/Components/FreeTextSearchFilter/index.js +0 -138
- package/dist/cjs/addons/Filters/Components/FreeTextSearchFilter/index.js.map +0 -7
- package/dist/cjs/exported-related/Filters/freeTextSearchFilterFn.js +0 -52
- package/dist/cjs/exported-related/Filters/freeTextSearchFilterFn.js.map +0 -7
- package/dist/cjs/parts/FilterBar/components/FreeTextSearchPill.js +0 -58
- package/dist/cjs/parts/FilterBar/components/FreeTextSearchPill.js.map +0 -7
- package/dist/esm/addons/Filters/Components/FreeTextSearchFilter/index.js +0 -108
- package/dist/esm/addons/Filters/Components/FreeTextSearchFilter/index.js.map +0 -7
- package/dist/esm/exported-related/Filters/freeTextSearchFilterFn.js +0 -22
- package/dist/esm/exported-related/Filters/freeTextSearchFilterFn.js.map +0 -7
- package/dist/esm/parts/FilterBar/components/FreeTextSearchPill.js +0 -28
- package/dist/esm/parts/FilterBar/components/FreeTextSearchPill.js.map +0 -7
- package/dist/types/addons/Filters/Components/FreeTextSearchFilter/index.d.ts +0 -3
- package/dist/types/exported-related/Filters/freeTextSearchFilterFn.d.ts +0 -2
- package/dist/types/parts/FilterBar/components/FreeTextSearchPill.d.ts +0 -3
- package/dist/types/tests/filters/free-text-search-filter.test.d.ts +0 -1
- /package/dist/types/tests/{filters → callbacks/filters}/combobox-filter.test.d.ts +0 -0
- /package/dist/types/tests/{filters → callbacks/filters}/currency-range-filter-PUI-12735.test.d.ts +0 -0
|
@@ -80,7 +80,6 @@ export declare namespace DSDataTableT {
|
|
|
80
80
|
label: string;
|
|
81
81
|
value: string;
|
|
82
82
|
}>;
|
|
83
|
-
export type FilterFnOutOfTheBoxFreeTextSearch = DSDataTableT.FilterFn<string>;
|
|
84
83
|
export interface FilterItemProps {
|
|
85
84
|
column: InternalColumn;
|
|
86
85
|
filters: Filter[];
|
|
@@ -217,7 +216,6 @@ export declare namespace DSDataTableT {
|
|
|
217
216
|
depth: number;
|
|
218
217
|
ref: React.MutableRefObject<HTMLTableColElement | null>;
|
|
219
218
|
columns?: InternalColumn[];
|
|
220
|
-
persistFilterInputAfterSubmit?: boolean;
|
|
221
219
|
}
|
|
222
220
|
export interface CellRendererProps {
|
|
223
221
|
row: InternalRow;
|
|
@@ -399,7 +397,6 @@ export declare namespace DSDataTableT {
|
|
|
399
397
|
}
|
|
400
398
|
export type Props = PropsT<DefaultProps, RequiredProps, OptionalProps>;
|
|
401
399
|
export type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps>;
|
|
402
|
-
export type GetOwnerPropsT = () => ZustandT.PropsStore<DefaultProps & RequiredProps & OptionalProps & UseAutoCalculatedT>;
|
|
403
400
|
export {};
|
|
404
401
|
}
|
|
405
402
|
export declare const defaultProps: () => DSDataTableT.DefaultProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-data-table",
|
|
3
|
-
"version": "3.55.
|
|
3
|
+
"version": "3.55.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Data Table",
|
|
6
6
|
"files": [
|
|
@@ -39,40 +39,40 @@
|
|
|
39
39
|
"react-virtual": "~2.10.4",
|
|
40
40
|
"uid": "~2.0.1",
|
|
41
41
|
"use-onclickoutside": "0.4.1",
|
|
42
|
-
"@elliemae/ds-button": "3.55.
|
|
43
|
-
"@elliemae/ds-circular-progress-indicator": "3.55.
|
|
44
|
-
"@elliemae/ds-
|
|
45
|
-
"@elliemae/ds-drag-and-drop": "3.55.
|
|
46
|
-
"@elliemae/ds-form-
|
|
47
|
-
"@elliemae/ds-
|
|
48
|
-
"@elliemae/ds-
|
|
49
|
-
"@elliemae/ds-dropdownmenu": "3.55.
|
|
50
|
-
"@elliemae/ds-form-date-time-picker": "3.55.
|
|
51
|
-
"@elliemae/ds-form-
|
|
52
|
-
"@elliemae/ds-form-
|
|
53
|
-
"@elliemae/ds-form-
|
|
54
|
-
"@elliemae/ds-form-
|
|
55
|
-
"@elliemae/ds-form-radio": "3.55.
|
|
56
|
-
"@elliemae/ds-grid": "3.55.
|
|
57
|
-
"@elliemae/ds-pagination": "3.55.
|
|
58
|
-
"@elliemae/ds-pills-v2": "3.55.
|
|
59
|
-
"@elliemae/ds-
|
|
60
|
-
"@elliemae/ds-props-helpers": "3.55.
|
|
61
|
-
"@elliemae/ds-
|
|
62
|
-
"@elliemae/ds-
|
|
63
|
-
"@elliemae/ds-
|
|
64
|
-
"@elliemae/ds-
|
|
65
|
-
"@elliemae/ds-
|
|
66
|
-
"@elliemae/ds-
|
|
42
|
+
"@elliemae/ds-button-v2": "3.55.1",
|
|
43
|
+
"@elliemae/ds-circular-progress-indicator": "3.55.1",
|
|
44
|
+
"@elliemae/ds-button": "3.55.1",
|
|
45
|
+
"@elliemae/ds-drag-and-drop": "3.55.1",
|
|
46
|
+
"@elliemae/ds-form-checkbox": "3.55.1",
|
|
47
|
+
"@elliemae/ds-form-combobox": "3.55.1",
|
|
48
|
+
"@elliemae/ds-dropdownmenu-v2": "3.55.1",
|
|
49
|
+
"@elliemae/ds-dropdownmenu": "3.55.1",
|
|
50
|
+
"@elliemae/ds-form-date-time-picker": "3.55.1",
|
|
51
|
+
"@elliemae/ds-form-date-range-picker": "3.55.1",
|
|
52
|
+
"@elliemae/ds-form-helpers-mask-hooks": "3.55.1",
|
|
53
|
+
"@elliemae/ds-form-input-text": "3.55.1",
|
|
54
|
+
"@elliemae/ds-form-layout-blocks": "3.55.1",
|
|
55
|
+
"@elliemae/ds-form-radio": "3.55.1",
|
|
56
|
+
"@elliemae/ds-grid": "3.55.1",
|
|
57
|
+
"@elliemae/ds-pagination": "3.55.1",
|
|
58
|
+
"@elliemae/ds-pills-v2": "3.55.1",
|
|
59
|
+
"@elliemae/ds-icons": "3.55.1",
|
|
60
|
+
"@elliemae/ds-props-helpers": "3.55.1",
|
|
61
|
+
"@elliemae/ds-skeleton": "3.55.1",
|
|
62
|
+
"@elliemae/ds-system": "3.55.1",
|
|
63
|
+
"@elliemae/ds-truncated-tooltip-text": "3.55.1",
|
|
64
|
+
"@elliemae/ds-zustand-helpers": "3.55.1",
|
|
65
|
+
"@elliemae/ds-typescript-helpers": "3.55.1",
|
|
66
|
+
"@elliemae/ds-popperjs": "3.55.1"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@elliemae/pui-cli": "9.0.0-next.65",
|
|
70
70
|
"jest": "~29.7.0",
|
|
71
71
|
"styled-components": "~5.3.9",
|
|
72
72
|
"styled-system": "^5.1.5",
|
|
73
|
-
"@elliemae/ds-
|
|
74
|
-
"@elliemae/ds-
|
|
75
|
-
"@elliemae/ds-monorepo-devops": "3.55.
|
|
73
|
+
"@elliemae/ds-test-utils": "3.55.1",
|
|
74
|
+
"@elliemae/ds-toolbar-v2": "3.55.1",
|
|
75
|
+
"@elliemae/ds-monorepo-devops": "3.55.1"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"lodash-es": "^4.17.21",
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var FreeTextSearchFilter_exports = {};
|
|
30
|
-
__export(FreeTextSearchFilter_exports, {
|
|
31
|
-
FreeTextSearchFilter: () => FreeTextSearchFilter
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(FreeTextSearchFilter_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_react = require("react");
|
|
37
|
-
var import_ds_icons = require("@elliemae/ds-icons");
|
|
38
|
-
var import_ds_form_input_text = require("@elliemae/ds-form-input-text");
|
|
39
|
-
var import_ds_system = require("@elliemae/ds-system");
|
|
40
|
-
var import_ds_grid = require("@elliemae/ds-grid");
|
|
41
|
-
var import_uid = require("uid");
|
|
42
|
-
var import_exported_related = require("../../../../exported-related/index.js");
|
|
43
|
-
var import_constants = require("../../../../configs/constants.js");
|
|
44
|
-
var import_styled = require("../../../../styled.js");
|
|
45
|
-
var import_DSDataTableDefinitions = require("../../../../DSDataTableDefinitions.js");
|
|
46
|
-
var import_createInternalAndPropsContext = require("../../../../configs/useStore/createInternalAndPropsContext.js");
|
|
47
|
-
const StyledInputFreeTextSearch = (0, import_ds_system.styled)(import_ds_form_input_text.DSInputText, {
|
|
48
|
-
name: import_DSDataTableDefinitions.DSDataTableName,
|
|
49
|
-
slot: import_DSDataTableDefinitions.DSDataTableSlots.FREE_TEXT_SEARCH_FILTER
|
|
50
|
-
})``;
|
|
51
|
-
const FreeTextSearchFilter = (props) => {
|
|
52
|
-
const {
|
|
53
|
-
column,
|
|
54
|
-
column: { id, persistFilterInputAfterSubmit = false },
|
|
55
|
-
onValueChange,
|
|
56
|
-
patchHeaderFilterButtonAndMenu,
|
|
57
|
-
reduxHeader,
|
|
58
|
-
innerRef,
|
|
59
|
-
domIdAffix = (0, import_uid.uid)(4)
|
|
60
|
-
} = props;
|
|
61
|
-
const ref = (0, import_react.useRef)(null);
|
|
62
|
-
const shouldFocus = (0, import_react.useRef)(true);
|
|
63
|
-
const getOwnerProps = (0, import_createInternalAndPropsContext.usePropsStore)((store) => store.get);
|
|
64
|
-
const getOwnerPropsArguments = (0, import_react.useCallback)(
|
|
65
|
-
() => ({
|
|
66
|
-
columnId: id
|
|
67
|
-
}),
|
|
68
|
-
[id]
|
|
69
|
-
);
|
|
70
|
-
const handleRef = (0, import_react.useCallback)((newRef) => {
|
|
71
|
-
ref.current = newRef;
|
|
72
|
-
if (shouldFocus.current) {
|
|
73
|
-
requestAnimationFrame(() => {
|
|
74
|
-
ref.current?.focus();
|
|
75
|
-
shouldFocus.current = false;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}, []);
|
|
79
|
-
(0, import_react.useEffect)(() => {
|
|
80
|
-
if (reduxHeader?.hideFilterMenu) {
|
|
81
|
-
shouldFocus.current = true;
|
|
82
|
-
}
|
|
83
|
-
}, [reduxHeader?.hideFilterMenu]);
|
|
84
|
-
const [value, setValue] = (0, import_react.useState)("");
|
|
85
|
-
const onKeyDown = (0, import_react.useCallback)(
|
|
86
|
-
(event) => {
|
|
87
|
-
if (event.key === "Enter") {
|
|
88
|
-
onValueChange(import_exported_related.FILTER_TYPES.FREE_TEXT_SEARCH, value || void 0);
|
|
89
|
-
if (!persistFilterInputAfterSubmit) {
|
|
90
|
-
setValue("");
|
|
91
|
-
}
|
|
92
|
-
setTimeout(() => {
|
|
93
|
-
patchHeaderFilterButtonAndMenu(id, true);
|
|
94
|
-
innerRef?.current?.focus();
|
|
95
|
-
}, 0);
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
[id, innerRef, onValueChange, patchHeaderFilterButtonAndMenu, persistFilterInputAfterSubmit, value]
|
|
99
|
-
);
|
|
100
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
|
-
import_exported_related.FilterPopover,
|
|
102
|
-
{
|
|
103
|
-
reduxHeader,
|
|
104
|
-
column,
|
|
105
|
-
columnId: id,
|
|
106
|
-
customStyles: {
|
|
107
|
-
backgroundColor: "#fff",
|
|
108
|
-
width: column.ref?.current?.offsetWidth,
|
|
109
|
-
minWidth: "80px"
|
|
110
|
-
},
|
|
111
|
-
menuContent: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, { p: "xxs", gutter: "xxs", style: { background: "white" }, children: [
|
|
112
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.ScreenReaderOnly, { id: "filter-input-instructions", children: "Press Enter to apply the filter and close the dialog. Focus will return to the button that opened this dialog." }),
|
|
113
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
114
|
-
StyledInputFreeTextSearch,
|
|
115
|
-
{
|
|
116
|
-
id: `ds-data-table-free-text-search-${id}-${domIdAffix}`,
|
|
117
|
-
placeholder: "",
|
|
118
|
-
value,
|
|
119
|
-
onValueChange: (newValue) => {
|
|
120
|
-
setValue(newValue);
|
|
121
|
-
},
|
|
122
|
-
innerRef: handleRef,
|
|
123
|
-
onKeyDown,
|
|
124
|
-
"data-testid": import_constants.DATA_TESTID.DATA_TABLE_FILTER_FREE_TEXT_SEARCH,
|
|
125
|
-
"aria-label": "Free Text Search Filter",
|
|
126
|
-
"aria-describedby": "filter-input-instructions",
|
|
127
|
-
getOwnerProps,
|
|
128
|
-
getOwnerPropsArguments
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
] }),
|
|
132
|
-
triggerIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.SearchXsmall, {}),
|
|
133
|
-
innerRef,
|
|
134
|
-
ariaLabel: "Open Free Text Search Filter"
|
|
135
|
-
}
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/addons/Filters/Components/FreeTextSearchFilter/index.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useRef, useCallback, useState, useEffect } from 'react';\nimport { SearchXsmall } from '@elliemae/ds-icons';\nimport { DSInputText } from '@elliemae/ds-form-input-text';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { uid } from 'uid';\nimport { FilterPopover, FILTER_TYPES } from '../../../../exported-related/index.js';\nimport type { DSDataTableT } from '../../../../react-desc-prop-types.js';\nimport { DATA_TESTID } from '../../../../configs/constants.js';\nimport { ScreenReaderOnly } from '../../../../styled.js';\nimport { DSDataTableName, DSDataTableSlots } from '../../../../DSDataTableDefinitions.js';\nimport { usePropsStore } from '../../../../configs/useStore/createInternalAndPropsContext.js';\n\nconst StyledInputFreeTextSearch = styled(DSInputText, {\n name: DSDataTableName,\n slot: DSDataTableSlots.FREE_TEXT_SEARCH_FILTER,\n})``;\n\nexport const FreeTextSearchFilter: React.ComponentType<DSDataTableT.FilterProps<string>> = (props) => {\n const {\n column,\n column: { id, persistFilterInputAfterSubmit = false },\n onValueChange,\n patchHeaderFilterButtonAndMenu,\n reduxHeader,\n innerRef,\n domIdAffix = uid(4),\n } = props;\n\n const ref = useRef<HTMLInputElement | null>(null);\n const shouldFocus = useRef(true);\n\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = useCallback(\n () => ({\n columnId: id,\n }),\n [id],\n );\n\n const handleRef = useCallback((newRef: HTMLInputElement | null) => {\n ref.current = newRef;\n if (shouldFocus.current) {\n requestAnimationFrame(() => {\n ref.current?.focus();\n shouldFocus.current = false;\n });\n }\n }, []);\n useEffect(() => {\n if (reduxHeader?.hideFilterMenu) {\n shouldFocus.current = true;\n }\n }, [reduxHeader?.hideFilterMenu]);\n\n const [value, setValue] = useState<string>('');\n\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n // || undefined to clear the filter when empty\n onValueChange(FILTER_TYPES.FREE_TEXT_SEARCH, value || undefined);\n if (!persistFilterInputAfterSubmit) {\n setValue('');\n }\n setTimeout(() => {\n patchHeaderFilterButtonAndMenu(id, true);\n innerRef?.current?.focus();\n }, 0);\n }\n },\n [id, innerRef, onValueChange, patchHeaderFilterButtonAndMenu, persistFilterInputAfterSubmit, value],\n );\n return (\n <FilterPopover\n reduxHeader={reduxHeader}\n column={column}\n columnId={id}\n customStyles={{\n backgroundColor: '#fff',\n width: column.ref?.current?.offsetWidth,\n minWidth: '80px',\n }}\n menuContent={\n <Grid p=\"xxs\" gutter=\"xxs\" style={{ background: 'white' }}>\n <ScreenReaderOnly id=\"filter-input-instructions\">\n Press Enter to apply the filter and close the dialog. Focus will return to the button that opened this\n dialog.\n </ScreenReaderOnly>\n <StyledInputFreeTextSearch\n id={`ds-data-table-free-text-search-${id}-${domIdAffix}`}\n placeholder=\"\"\n value={value}\n onValueChange={(newValue) => {\n setValue(newValue);\n }}\n innerRef={handleRef}\n onKeyDown={onKeyDown}\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_FREE_TEXT_SEARCH}\n aria-label=\"Free Text Search Filter\"\n aria-describedby=\"filter-input-instructions\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n </Grid>\n }\n triggerIcon={<SearchXsmall />}\n innerRef={innerRef}\n ariaLabel=\"Open Free Text Search Filter\"\n />\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoFf;AApFR,mBAAgE;AAChE,sBAA6B;AAC7B,gCAA4B;AAC5B,uBAAuB;AACvB,qBAAqB;AACrB,iBAAoB;AACpB,8BAA4C;AAE5C,uBAA4B;AAC5B,oBAAiC;AACjC,oCAAkD;AAClD,2CAA8B;AAE9B,MAAM,gCAA4B,yBAAO,uCAAa;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,+CAAiB;AACzB,CAAC;AAEM,MAAM,uBAA8E,CAAC,UAAU;AACpG,QAAM;AAAA,IACJ;AAAA,IACA,QAAQ,EAAE,IAAI,gCAAgC,MAAM;AAAA,IACpD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAa,gBAAI,CAAC;AAAA,EACpB,IAAI;AAEJ,QAAM,UAAM,qBAAgC,IAAI;AAChD,QAAM,kBAAc,qBAAO,IAAI;AAE/B,QAAM,oBAAgB,oDAAc,CAAC,UAAU,MAAM,GAAG;AACxD,QAAM,6BAAyB;AAAA,IAC7B,OAAO;AAAA,MACL,UAAU;AAAA,IACZ;AAAA,IACA,CAAC,EAAE;AAAA,EACL;AAEA,QAAM,gBAAY,0BAAY,CAAC,WAAoC;AACjE,QAAI,UAAU;AACd,QAAI,YAAY,SAAS;AACvB,4BAAsB,MAAM;AAC1B,YAAI,SAAS,MAAM;AACnB,oBAAY,UAAU;AAAA,MACxB,CAAC;AAAA,IACH;AAAA,EACF,GAAG,CAAC,CAAC;AACL,8BAAU,MAAM;AACd,QAAI,aAAa,gBAAgB;AAC/B,kBAAY,UAAU;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,aAAa,cAAc,CAAC;AAEhC,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAiB,EAAE;AAE7C,QAAM,gBAAY;AAAA,IAChB,CAAC,UAAiD;AAChD,UAAI,MAAM,QAAQ,SAAS;AAEzB,sBAAc,qCAAa,kBAAkB,SAAS,MAAS;AAC/D,YAAI,CAAC,+BAA+B;AAClC,mBAAS,EAAE;AAAA,QACb;AACA,mBAAW,MAAM;AACf,yCAA+B,IAAI,IAAI;AACvC,oBAAU,SAAS,MAAM;AAAA,QAC3B,GAAG,CAAC;AAAA,MACN;AAAA,IACF;AAAA,IACA,CAAC,IAAI,UAAU,eAAe,gCAAgC,+BAA+B,KAAK;AAAA,EACpG;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,cAAc;AAAA,QACZ,iBAAiB;AAAA,QACjB,OAAO,OAAO,KAAK,SAAS;AAAA,QAC5B,UAAU;AAAA,MACZ;AAAA,MACA,aACE,6CAAC,uBAAK,GAAE,OAAM,QAAO,OAAM,OAAO,EAAE,YAAY,QAAQ,GACtD;AAAA,oDAAC,kCAAiB,IAAG,6BAA4B,4HAGjD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,IAAI,kCAAkC,EAAE,IAAI,UAAU;AAAA,YACtD,aAAY;AAAA,YACZ;AAAA,YACA,eAAe,CAAC,aAAa;AAC3B,uBAAS,QAAQ;AAAA,YACnB;AAAA,YACA,UAAU;AAAA,YACV;AAAA,YACA,eAAa,6BAAY;AAAA,YACzB,cAAW;AAAA,YACX,oBAAiB;AAAA,YACjB;AAAA,YACA;AAAA;AAAA,QACF;AAAA,SACF;AAAA,MAEF,aAAa,4CAAC,gCAAa;AAAA,MAC3B;AAAA,MACA,WAAU;AAAA;AAAA,EACZ;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var freeTextSearchFilterFn_exports = {};
|
|
30
|
-
__export(freeTextSearchFilterFn_exports, {
|
|
31
|
-
freeTextSearchFilterFn: () => freeTextSearchFilterFn
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(freeTextSearchFilterFn_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_constants = require("../../configs/constants.js");
|
|
36
|
-
const freeTextSearchFilterFn = (unfilteredData, filterKey, filterValue) => {
|
|
37
|
-
if (!filterValue) return unfilteredData;
|
|
38
|
-
if (typeof filterValue !== "string") {
|
|
39
|
-
throw new Error(
|
|
40
|
-
`Invalid filter value for free text search filter, expected string received: ${JSON.stringify(filterValue)}`
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
const lowerCaseFilterValue = filterValue.toLowerCase();
|
|
44
|
-
return unfilteredData.filter((datum) => {
|
|
45
|
-
if (filterValue === import_constants.EMPTY_FILTER) {
|
|
46
|
-
return datum[filterKey] === null || datum[filterKey] === void 0 || datum[filterKey] === "";
|
|
47
|
-
}
|
|
48
|
-
const cellValue = String(datum[filterKey]).toLowerCase();
|
|
49
|
-
return cellValue.includes(lowerCaseFilterValue);
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=freeTextSearchFilterFn.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/exported-related/Filters/freeTextSearchFilterFn.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { EMPTY_FILTER } from '../../configs/constants.js';\n\nexport const freeTextSearchFilterFn: DSDataTableT.FilterFnOutOfTheBoxFreeTextSearch = (\n unfilteredData,\n filterKey,\n filterValue,\n) => {\n if (!filterValue) return unfilteredData;\n if (typeof filterValue !== 'string') {\n throw new Error(\n `Invalid filter value for free text search filter, expected string received: ${JSON.stringify(filterValue)}`,\n );\n }\n const lowerCaseFilterValue = filterValue.toLowerCase();\n return unfilteredData.filter((datum) => {\n if (filterValue === EMPTY_FILTER) {\n return datum[filterKey] === null || datum[filterKey] === undefined || datum[filterKey] === '';\n }\n const cellValue = String(datum[filterKey]).toLowerCase();\n return cellValue.includes(lowerCaseFilterValue);\n });\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAA6B;AAEtB,MAAM,yBAAyE,CACpF,gBACA,WACA,gBACG;AACH,MAAI,CAAC,YAAa,QAAO;AACzB,MAAI,OAAO,gBAAgB,UAAU;AACnC,UAAM,IAAI;AAAA,MACR,+EAA+E,KAAK,UAAU,WAAW,CAAC;AAAA,IAC5G;AAAA,EACF;AACA,QAAM,uBAAuB,YAAY,YAAY;AACrD,SAAO,eAAe,OAAO,CAAC,UAAU;AACtC,QAAI,gBAAgB,+BAAc;AAChC,aAAO,MAAM,SAAS,MAAM,QAAQ,MAAM,SAAS,MAAM,UAAa,MAAM,SAAS,MAAM;AAAA,IAC7F;AACA,UAAM,YAAY,OAAO,MAAM,SAAS,CAAC,EAAE,YAAY;AACvD,WAAO,UAAU,SAAS,oBAAoB;AAAA,EAChD,CAAC;AACH;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var FreeTextSearchPill_exports = {};
|
|
30
|
-
__export(FreeTextSearchPill_exports, {
|
|
31
|
-
FreeTextSearchPillPill: () => FreeTextSearchPillPill
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(FreeTextSearchPill_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_react = require("react");
|
|
37
|
-
var import_ds_pills_v2 = require("@elliemae/ds-pills-v2");
|
|
38
|
-
const FreeTextSearchPillPill = ({
|
|
39
|
-
columnHeader,
|
|
40
|
-
column,
|
|
41
|
-
value,
|
|
42
|
-
filters,
|
|
43
|
-
onFiltersChange,
|
|
44
|
-
prevRef,
|
|
45
|
-
innerRef,
|
|
46
|
-
nextRef
|
|
47
|
-
}) => {
|
|
48
|
-
const handleOnRemove = (0, import_react.useCallback)(() => {
|
|
49
|
-
if (prevRef?.current) prevRef.current.focus();
|
|
50
|
-
else nextRef.current?.focus();
|
|
51
|
-
onFiltersChange(filters.filter((filter) => filter.id !== column));
|
|
52
|
-
}, [onFiltersChange, filters, prevRef, nextRef, column]);
|
|
53
|
-
return value ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_pills_v2.DSPillGroupV2, { children: [
|
|
54
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_pills_v2.DSPillV2, { type: "label", label: columnHeader }),
|
|
55
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_pills_v2.DSPillV2, { type: "removable", label: value, onRemove: handleOnRemove, innerRef })
|
|
56
|
-
] }) : null;
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=FreeTextSearchPill.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/parts/FilterBar/components/FreeTextSearchPill.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills-v2';\nimport type { DSDataTableT } from '../../../react-desc-prop-types.js';\n\nexport const FreeTextSearchPillPill: React.ComponentType<DSDataTableT.FilterPillProps<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} onRemove={handleOnRemove} innerRef={innerRef} />\n </DSPillGroupV2>\n ) : null;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqBnB;AArBJ,mBAAmC;AACnC,yBAAwC;AAGjC,MAAM,yBAAoF,CAAC;AAAA,EAChG;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,qBAAiB,0BAAY,MAAM;AACvC,QAAI,SAAS,QAAS,SAAQ,QAAQ,MAAM;AAAA,QACvC,SAAQ,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,6CAAC,oCACC;AAAA,gDAAC,+BAAS,MAAK,SAAQ,OAAO,cAAc;AAAA,IAC5C,4CAAC,+BAAS,MAAK,aAAY,OAAO,OAAO,UAAU,gBAAgB,UAAoB;AAAA,KACzF,IACE;AACN;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useRef, useCallback, useState, useEffect } from "react";
|
|
4
|
-
import { SearchXsmall } from "@elliemae/ds-icons";
|
|
5
|
-
import { DSInputText } from "@elliemae/ds-form-input-text";
|
|
6
|
-
import { styled } from "@elliemae/ds-system";
|
|
7
|
-
import { Grid } from "@elliemae/ds-grid";
|
|
8
|
-
import { uid } from "uid";
|
|
9
|
-
import { FilterPopover, FILTER_TYPES } from "../../../../exported-related/index.js";
|
|
10
|
-
import { DATA_TESTID } from "../../../../configs/constants.js";
|
|
11
|
-
import { ScreenReaderOnly } from "../../../../styled.js";
|
|
12
|
-
import { DSDataTableName, DSDataTableSlots } from "../../../../DSDataTableDefinitions.js";
|
|
13
|
-
import { usePropsStore } from "../../../../configs/useStore/createInternalAndPropsContext.js";
|
|
14
|
-
const StyledInputFreeTextSearch = styled(DSInputText, {
|
|
15
|
-
name: DSDataTableName,
|
|
16
|
-
slot: DSDataTableSlots.FREE_TEXT_SEARCH_FILTER
|
|
17
|
-
})``;
|
|
18
|
-
const FreeTextSearchFilter = (props) => {
|
|
19
|
-
const {
|
|
20
|
-
column,
|
|
21
|
-
column: { id, persistFilterInputAfterSubmit = false },
|
|
22
|
-
onValueChange,
|
|
23
|
-
patchHeaderFilterButtonAndMenu,
|
|
24
|
-
reduxHeader,
|
|
25
|
-
innerRef,
|
|
26
|
-
domIdAffix = uid(4)
|
|
27
|
-
} = props;
|
|
28
|
-
const ref = useRef(null);
|
|
29
|
-
const shouldFocus = useRef(true);
|
|
30
|
-
const getOwnerProps = usePropsStore((store) => store.get);
|
|
31
|
-
const getOwnerPropsArguments = useCallback(
|
|
32
|
-
() => ({
|
|
33
|
-
columnId: id
|
|
34
|
-
}),
|
|
35
|
-
[id]
|
|
36
|
-
);
|
|
37
|
-
const handleRef = useCallback((newRef) => {
|
|
38
|
-
ref.current = newRef;
|
|
39
|
-
if (shouldFocus.current) {
|
|
40
|
-
requestAnimationFrame(() => {
|
|
41
|
-
ref.current?.focus();
|
|
42
|
-
shouldFocus.current = false;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}, []);
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if (reduxHeader?.hideFilterMenu) {
|
|
48
|
-
shouldFocus.current = true;
|
|
49
|
-
}
|
|
50
|
-
}, [reduxHeader?.hideFilterMenu]);
|
|
51
|
-
const [value, setValue] = useState("");
|
|
52
|
-
const onKeyDown = useCallback(
|
|
53
|
-
(event) => {
|
|
54
|
-
if (event.key === "Enter") {
|
|
55
|
-
onValueChange(FILTER_TYPES.FREE_TEXT_SEARCH, value || void 0);
|
|
56
|
-
if (!persistFilterInputAfterSubmit) {
|
|
57
|
-
setValue("");
|
|
58
|
-
}
|
|
59
|
-
setTimeout(() => {
|
|
60
|
-
patchHeaderFilterButtonAndMenu(id, true);
|
|
61
|
-
innerRef?.current?.focus();
|
|
62
|
-
}, 0);
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
[id, innerRef, onValueChange, patchHeaderFilterButtonAndMenu, persistFilterInputAfterSubmit, value]
|
|
66
|
-
);
|
|
67
|
-
return /* @__PURE__ */ jsx(
|
|
68
|
-
FilterPopover,
|
|
69
|
-
{
|
|
70
|
-
reduxHeader,
|
|
71
|
-
column,
|
|
72
|
-
columnId: id,
|
|
73
|
-
customStyles: {
|
|
74
|
-
backgroundColor: "#fff",
|
|
75
|
-
width: column.ref?.current?.offsetWidth,
|
|
76
|
-
minWidth: "80px"
|
|
77
|
-
},
|
|
78
|
-
menuContent: /* @__PURE__ */ jsxs(Grid, { p: "xxs", gutter: "xxs", style: { background: "white" }, children: [
|
|
79
|
-
/* @__PURE__ */ jsx(ScreenReaderOnly, { id: "filter-input-instructions", children: "Press Enter to apply the filter and close the dialog. Focus will return to the button that opened this dialog." }),
|
|
80
|
-
/* @__PURE__ */ jsx(
|
|
81
|
-
StyledInputFreeTextSearch,
|
|
82
|
-
{
|
|
83
|
-
id: `ds-data-table-free-text-search-${id}-${domIdAffix}`,
|
|
84
|
-
placeholder: "",
|
|
85
|
-
value,
|
|
86
|
-
onValueChange: (newValue) => {
|
|
87
|
-
setValue(newValue);
|
|
88
|
-
},
|
|
89
|
-
innerRef: handleRef,
|
|
90
|
-
onKeyDown,
|
|
91
|
-
"data-testid": DATA_TESTID.DATA_TABLE_FILTER_FREE_TEXT_SEARCH,
|
|
92
|
-
"aria-label": "Free Text Search Filter",
|
|
93
|
-
"aria-describedby": "filter-input-instructions",
|
|
94
|
-
getOwnerProps,
|
|
95
|
-
getOwnerPropsArguments
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
] }),
|
|
99
|
-
triggerIcon: /* @__PURE__ */ jsx(SearchXsmall, {}),
|
|
100
|
-
innerRef,
|
|
101
|
-
ariaLabel: "Open Free Text Search Filter"
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
};
|
|
105
|
-
export {
|
|
106
|
-
FreeTextSearchFilter
|
|
107
|
-
};
|
|
108
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/addons/Filters/Components/FreeTextSearchFilter/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef, useCallback, useState, useEffect } from 'react';\nimport { SearchXsmall } from '@elliemae/ds-icons';\nimport { DSInputText } from '@elliemae/ds-form-input-text';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { uid } from 'uid';\nimport { FilterPopover, FILTER_TYPES } from '../../../../exported-related/index.js';\nimport type { DSDataTableT } from '../../../../react-desc-prop-types.js';\nimport { DATA_TESTID } from '../../../../configs/constants.js';\nimport { ScreenReaderOnly } from '../../../../styled.js';\nimport { DSDataTableName, DSDataTableSlots } from '../../../../DSDataTableDefinitions.js';\nimport { usePropsStore } from '../../../../configs/useStore/createInternalAndPropsContext.js';\n\nconst StyledInputFreeTextSearch = styled(DSInputText, {\n name: DSDataTableName,\n slot: DSDataTableSlots.FREE_TEXT_SEARCH_FILTER,\n})``;\n\nexport const FreeTextSearchFilter: React.ComponentType<DSDataTableT.FilterProps<string>> = (props) => {\n const {\n column,\n column: { id, persistFilterInputAfterSubmit = false },\n onValueChange,\n patchHeaderFilterButtonAndMenu,\n reduxHeader,\n innerRef,\n domIdAffix = uid(4),\n } = props;\n\n const ref = useRef<HTMLInputElement | null>(null);\n const shouldFocus = useRef(true);\n\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = useCallback(\n () => ({\n columnId: id,\n }),\n [id],\n );\n\n const handleRef = useCallback((newRef: HTMLInputElement | null) => {\n ref.current = newRef;\n if (shouldFocus.current) {\n requestAnimationFrame(() => {\n ref.current?.focus();\n shouldFocus.current = false;\n });\n }\n }, []);\n useEffect(() => {\n if (reduxHeader?.hideFilterMenu) {\n shouldFocus.current = true;\n }\n }, [reduxHeader?.hideFilterMenu]);\n\n const [value, setValue] = useState<string>('');\n\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n // || undefined to clear the filter when empty\n onValueChange(FILTER_TYPES.FREE_TEXT_SEARCH, value || undefined);\n if (!persistFilterInputAfterSubmit) {\n setValue('');\n }\n setTimeout(() => {\n patchHeaderFilterButtonAndMenu(id, true);\n innerRef?.current?.focus();\n }, 0);\n }\n },\n [id, innerRef, onValueChange, patchHeaderFilterButtonAndMenu, persistFilterInputAfterSubmit, value],\n );\n return (\n <FilterPopover\n reduxHeader={reduxHeader}\n column={column}\n columnId={id}\n customStyles={{\n backgroundColor: '#fff',\n width: column.ref?.current?.offsetWidth,\n minWidth: '80px',\n }}\n menuContent={\n <Grid p=\"xxs\" gutter=\"xxs\" style={{ background: 'white' }}>\n <ScreenReaderOnly id=\"filter-input-instructions\">\n Press Enter to apply the filter and close the dialog. Focus will return to the button that opened this\n dialog.\n </ScreenReaderOnly>\n <StyledInputFreeTextSearch\n id={`ds-data-table-free-text-search-${id}-${domIdAffix}`}\n placeholder=\"\"\n value={value}\n onValueChange={(newValue) => {\n setValue(newValue);\n }}\n innerRef={handleRef}\n onKeyDown={onKeyDown}\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_FREE_TEXT_SEARCH}\n aria-label=\"Free Text Search Filter\"\n aria-describedby=\"filter-input-instructions\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n </Grid>\n }\n triggerIcon={<SearchXsmall />}\n innerRef={innerRef}\n ariaLabel=\"Open Free Text Search Filter\"\n />\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACoFf,SACE,KADF;AApFR,SAAgB,QAAQ,aAAa,UAAU,iBAAiB;AAChE,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,WAAW;AACpB,SAAS,eAAe,oBAAoB;AAE5C,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,iBAAiB,wBAAwB;AAClD,SAAS,qBAAqB;AAE9B,MAAM,4BAA4B,OAAO,aAAa;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,iBAAiB;AACzB,CAAC;AAEM,MAAM,uBAA8E,CAAC,UAAU;AACpG,QAAM;AAAA,IACJ;AAAA,IACA,QAAQ,EAAE,IAAI,gCAAgC,MAAM;AAAA,IACpD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,IAAI,CAAC;AAAA,EACpB,IAAI;AAEJ,QAAM,MAAM,OAAgC,IAAI;AAChD,QAAM,cAAc,OAAO,IAAI;AAE/B,QAAM,gBAAgB,cAAc,CAAC,UAAU,MAAM,GAAG;AACxD,QAAM,yBAAyB;AAAA,IAC7B,OAAO;AAAA,MACL,UAAU;AAAA,IACZ;AAAA,IACA,CAAC,EAAE;AAAA,EACL;AAEA,QAAM,YAAY,YAAY,CAAC,WAAoC;AACjE,QAAI,UAAU;AACd,QAAI,YAAY,SAAS;AACvB,4BAAsB,MAAM;AAC1B,YAAI,SAAS,MAAM;AACnB,oBAAY,UAAU;AAAA,MACxB,CAAC;AAAA,IACH;AAAA,EACF,GAAG,CAAC,CAAC;AACL,YAAU,MAAM;AACd,QAAI,aAAa,gBAAgB;AAC/B,kBAAY,UAAU;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,aAAa,cAAc,CAAC;AAEhC,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAiB,EAAE;AAE7C,QAAM,YAAY;AAAA,IAChB,CAAC,UAAiD;AAChD,UAAI,MAAM,QAAQ,SAAS;AAEzB,sBAAc,aAAa,kBAAkB,SAAS,MAAS;AAC/D,YAAI,CAAC,+BAA+B;AAClC,mBAAS,EAAE;AAAA,QACb;AACA,mBAAW,MAAM;AACf,yCAA+B,IAAI,IAAI;AACvC,oBAAU,SAAS,MAAM;AAAA,QAC3B,GAAG,CAAC;AAAA,MACN;AAAA,IACF;AAAA,IACA,CAAC,IAAI,UAAU,eAAe,gCAAgC,+BAA+B,KAAK;AAAA,EACpG;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,cAAc;AAAA,QACZ,iBAAiB;AAAA,QACjB,OAAO,OAAO,KAAK,SAAS;AAAA,QAC5B,UAAU;AAAA,MACZ;AAAA,MACA,aACE,qBAAC,QAAK,GAAE,OAAM,QAAO,OAAM,OAAO,EAAE,YAAY,QAAQ,GACtD;AAAA,4BAAC,oBAAiB,IAAG,6BAA4B,4HAGjD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,IAAI,kCAAkC,EAAE,IAAI,UAAU;AAAA,YACtD,aAAY;AAAA,YACZ;AAAA,YACA,eAAe,CAAC,aAAa;AAC3B,uBAAS,QAAQ;AAAA,YACnB;AAAA,YACA,UAAU;AAAA,YACV;AAAA,YACA,eAAa,YAAY;AAAA,YACzB,cAAW;AAAA,YACX,oBAAiB;AAAA,YACjB;AAAA,YACA;AAAA;AAAA,QACF;AAAA,SACF;AAAA,MAEF,aAAa,oBAAC,gBAAa;AAAA,MAC3B;AAAA,MACA,WAAU;AAAA;AAAA,EACZ;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { EMPTY_FILTER } from "../../configs/constants.js";
|
|
3
|
-
const freeTextSearchFilterFn = (unfilteredData, filterKey, filterValue) => {
|
|
4
|
-
if (!filterValue) return unfilteredData;
|
|
5
|
-
if (typeof filterValue !== "string") {
|
|
6
|
-
throw new Error(
|
|
7
|
-
`Invalid filter value for free text search filter, expected string received: ${JSON.stringify(filterValue)}`
|
|
8
|
-
);
|
|
9
|
-
}
|
|
10
|
-
const lowerCaseFilterValue = filterValue.toLowerCase();
|
|
11
|
-
return unfilteredData.filter((datum) => {
|
|
12
|
-
if (filterValue === EMPTY_FILTER) {
|
|
13
|
-
return datum[filterKey] === null || datum[filterKey] === void 0 || datum[filterKey] === "";
|
|
14
|
-
}
|
|
15
|
-
const cellValue = String(datum[filterKey]).toLowerCase();
|
|
16
|
-
return cellValue.includes(lowerCaseFilterValue);
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
freeTextSearchFilterFn
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=freeTextSearchFilterFn.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Filters/freeTextSearchFilterFn.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { EMPTY_FILTER } from '../../configs/constants.js';\n\nexport const freeTextSearchFilterFn: DSDataTableT.FilterFnOutOfTheBoxFreeTextSearch = (\n unfilteredData,\n filterKey,\n filterValue,\n) => {\n if (!filterValue) return unfilteredData;\n if (typeof filterValue !== 'string') {\n throw new Error(\n `Invalid filter value for free text search filter, expected string received: ${JSON.stringify(filterValue)}`,\n );\n }\n const lowerCaseFilterValue = filterValue.toLowerCase();\n return unfilteredData.filter((datum) => {\n if (filterValue === EMPTY_FILTER) {\n return datum[filterKey] === null || datum[filterKey] === undefined || datum[filterKey] === '';\n }\n const cellValue = String(datum[filterKey]).toLowerCase();\n return cellValue.includes(lowerCaseFilterValue);\n });\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,oBAAoB;AAEtB,MAAM,yBAAyE,CACpF,gBACA,WACA,gBACG;AACH,MAAI,CAAC,YAAa,QAAO;AACzB,MAAI,OAAO,gBAAgB,UAAU;AACnC,UAAM,IAAI;AAAA,MACR,+EAA+E,KAAK,UAAU,WAAW,CAAC;AAAA,IAC5G;AAAA,EACF;AACA,QAAM,uBAAuB,YAAY,YAAY;AACrD,SAAO,eAAe,OAAO,CAAC,UAAU;AACtC,QAAI,gBAAgB,cAAc;AAChC,aAAO,MAAM,SAAS,MAAM,QAAQ,MAAM,SAAS,MAAM,UAAa,MAAM,SAAS,MAAM;AAAA,IAC7F;AACA,UAAM,YAAY,OAAO,MAAM,SAAS,CAAC,EAAE,YAAY;AACvD,WAAO,UAAU,SAAS,oBAAoB;AAAA,EAChD,CAAC;AACH;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback } from "react";
|
|
4
|
-
import { DSPillGroupV2, DSPillV2 } from "@elliemae/ds-pills-v2";
|
|
5
|
-
const FreeTextSearchPillPill = ({
|
|
6
|
-
columnHeader,
|
|
7
|
-
column,
|
|
8
|
-
value,
|
|
9
|
-
filters,
|
|
10
|
-
onFiltersChange,
|
|
11
|
-
prevRef,
|
|
12
|
-
innerRef,
|
|
13
|
-
nextRef
|
|
14
|
-
}) => {
|
|
15
|
-
const handleOnRemove = useCallback(() => {
|
|
16
|
-
if (prevRef?.current) prevRef.current.focus();
|
|
17
|
-
else nextRef.current?.focus();
|
|
18
|
-
onFiltersChange(filters.filter((filter) => filter.id !== column));
|
|
19
|
-
}, [onFiltersChange, filters, prevRef, nextRef, column]);
|
|
20
|
-
return value ? /* @__PURE__ */ jsxs(DSPillGroupV2, { children: [
|
|
21
|
-
/* @__PURE__ */ jsx(DSPillV2, { type: "label", label: columnHeader }),
|
|
22
|
-
/* @__PURE__ */ jsx(DSPillV2, { type: "removable", label: value, onRemove: handleOnRemove, innerRef })
|
|
23
|
-
] }) : null;
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
FreeTextSearchPillPill
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=FreeTextSearchPill.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/FilterBar/components/FreeTextSearchPill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills-v2';\nimport type { DSDataTableT } from '../../../react-desc-prop-types.js';\n\nexport const FreeTextSearchPillPill: React.ComponentType<DSDataTableT.FilterPillProps<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} onRemove={handleOnRemove} innerRef={innerRef} />\n </DSPillGroupV2>\n ) : null;\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACqBnB,SACE,KADF;AArBJ,SAAgB,mBAAmB;AACnC,SAAS,eAAe,gBAAgB;AAGjC,MAAM,yBAAoF,CAAC;AAAA,EAChG;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,iBAAiB,YAAY,MAAM;AACvC,QAAI,SAAS,QAAS,SAAQ,QAAQ,MAAM;AAAA,QACvC,SAAQ,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,iBACC;AAAA,wBAAC,YAAS,MAAK,SAAQ,OAAO,cAAc;AAAA,IAC5C,oBAAC,YAAS,MAAK,aAAY,OAAO,OAAO,UAAU,gBAAgB,UAAoB;AAAA,KACzF,IACE;AACN;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
/package/dist/types/tests/{filters → callbacks/filters}/currency-range-filter-PUI-12735.test.d.ts
RENAMED
|
File without changes
|