sccoreui 6.2.44 → 6.2.45

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.
@@ -7,11 +7,20 @@ const svg_component_1 = tslib_1.__importDefault(require("../../../directives/svg
7
7
  const react_1 = require("react");
8
8
  const context_provider_1 = require("../context-provider");
9
9
  const hooks_1 = require("primereact/hooks");
10
+ const constants_1 = require("../constants");
10
11
  function Search({ searchPlaceHolder }) {
11
- const { featureDetails, setFeatureDetails } = (0, react_1.useContext)(context_provider_1.FeatureContext);
12
+ const { featureDetails, setFeatureDetails, rowModelType, gridApi, quickSearch, } = (0, react_1.useContext)(context_provider_1.FeatureContext);
12
13
  const [inputValue, deboucedValue, setInputValue] = (0, hooks_1.useDebounce)("", 500);
13
14
  (0, react_1.useEffect)(() => {
14
- setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { searchedText: deboucedValue }));
15
+ var _a;
16
+ if (rowModelType === constants_1.ROWMODELTYPE.CLIENT_SIDE && quickSearch) {
17
+ if (gridApi === null || gridApi === void 0 ? void 0 : gridApi.current) {
18
+ (_a = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current.api) === null || _a === void 0 ? void 0 : _a.setGridOption("quickFilterText", deboucedValue);
19
+ }
20
+ }
21
+ else {
22
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { searchedText: deboucedValue }));
23
+ }
15
24
  }, [deboucedValue]);
16
25
  return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `p-input-icon-left ${featureDetails.searchedText.length > 0 && "p-input-icon-right"}` }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix zoom_animate" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { color: "#667085", icon: "search-lg", size: 18 }) })), featureDetails.searchedText.length > 0 && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix cursor-pointer zoom_animate", onClick: () => {
17
26
  setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { searchedText: "" })),
@@ -6,7 +6,7 @@ const react_1 = require("react");
6
6
  const helper_1 = require("./helper");
7
7
  exports.FeatureContext = (0, react_1.createContext)(null);
8
8
  function MyProvider({ children, value }) {
9
- const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid, enableManageColumnsCallback, columnToRender, selectedGroup, setSelectedGroup, initialCheckBoxData, intialColumns, setIntialColumns } = value;
9
+ const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid, enableManageColumnsCallback, columnToRender, selectedGroup, setSelectedGroup, initialCheckBoxData, intialColumns, setIntialColumns, rowModelType, quickSearch, } = value;
10
10
  // States for sort
11
11
  const [columnData] = (0, react_1.useState)(gridData === null || gridData === void 0 ? void 0 : gridData.columnData);
12
12
  const [sortValue, setSortValue] = (0, react_1.useState)({});
@@ -20,12 +20,18 @@ function MyProvider({ children, value }) {
20
20
  // Returns based on length of filterQueries present
21
21
  return length === 0 ? [0] : Array.from({ length }, (_, index) => index);
22
22
  });
23
- const conditionTypes = filterConditions ? filterConditions : [{ id: 1, label: "AND" }, { id: 2, label: "OR" }];
24
- const [conditionType, setConditionType] = (0, react_1.useState)((defaultFilters === null || defaultFilters === void 0 ? void 0 : defaultFilters.logicalOperator) ? conditionTypes.find((item) => item.id === (defaultFilters === null || defaultFilters === void 0 ? void 0 : defaultFilters.logicalOperator)) :
25
- conditionTypes[0]);
23
+ const conditionTypes = filterConditions
24
+ ? filterConditions
25
+ : [
26
+ { id: 1, label: "AND" },
27
+ { id: 2, label: "OR" },
28
+ ];
29
+ const [conditionType, setConditionType] = (0, react_1.useState)((defaultFilters === null || defaultFilters === void 0 ? void 0 : defaultFilters.logicalOperator)
30
+ ? conditionTypes.find((item) => item.id === (defaultFilters === null || defaultFilters === void 0 ? void 0 : defaultFilters.logicalOperator))
31
+ : conditionTypes[0]);
26
32
  const [globalFilters, setGlobalFilters] = (0, react_1.useState)([]);
27
33
  const [showAsSave, setShowAsSave] = (0, react_1.useState)(false);
28
- // Function call on click to refresh
34
+ // Function call on click to refresh
29
35
  const removeFeaturesAndRefresh = () => {
30
36
  const emptyFeatures = initialFeature;
31
37
  // Remove stored features
@@ -98,7 +104,9 @@ function MyProvider({ children, value }) {
98
104
  setSelectedGroup,
99
105
  initialCheckBoxData,
100
106
  intialColumns,
101
- setIntialColumns
107
+ setIntialColumns,
108
+ rowModelType,
109
+ quickSearch,
102
110
  } }, { children: children })));
103
111
  }
104
112
  exports.default = MyProvider;
@@ -342,7 +342,7 @@ function ParentForGrid(props) {
342
342
  dataTypeDefinitions: props === null || props === void 0 ? void 0 : props.dataTypeDefinitions,
343
343
  })), ((props === null || props === void 0 ? void 0 : props.treeData) && { treeData: props === null || props === void 0 ? void 0 : props.treeData })), ((props === null || props === void 0 ? void 0 : props.groupDefaultExpanded) && {
344
344
  groupDefaultExpanded: props === null || props === void 0 ? void 0 : props.groupDefaultExpanded, // to enable tree data
345
- })), ((props === null || props === void 0 ? void 0 : props.getDataPath) && { getDataPath: props === null || props === void 0 ? void 0 : props.getDataPath }));
345
+ })), ((props === null || props === void 0 ? void 0 : props.quickSearch) ? { quickSearch: props.quickSearch } : {}));
346
346
  // Fucntion to call the grid
347
347
  const callGrid = (featureDetails) => {
348
348
  onGridReady(gridReadyEvent, featureDetails);
@@ -400,7 +400,7 @@ function ParentForGrid(props) {
400
400
  setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: initialCheckBoxData }));
401
401
  }
402
402
  }, [props === null || props === void 0 ? void 0 : props.emptyCheckboxStatus]);
403
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { height: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.height, width: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.width }, className: "ag-grid-container" }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: Object.assign({ featureDetails,
403
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { height: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.height, width: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.width }, className: "ag-grid-container" }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: Object.assign({ rowModelType: props.rowModelType, quickSearch: props === null || props === void 0 ? void 0 : props.quickSearch, featureDetails,
404
404
  setFeatureDetails,
405
405
  gridData,
406
406
  callGrid,
@@ -29,6 +29,8 @@ interface MyProviderProps {
29
29
  initialCheckBoxData: CheckBoxSelection;
30
30
  intialColumns: ColumnDef[];
31
31
  setIntialColumns: React.Dispatch<React.SetStateAction<any>>;
32
+ rowModelType: string;
33
+ quickSearch?: boolean;
32
34
  };
33
35
  }
34
36
  declare function MyProvider({ children, value }: MyProviderProps): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.2.44",
3
+ "version": "6.2.45",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",