sccoreui 5.9.87 → 5.9.89

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.
@@ -10,7 +10,7 @@ const inputswitch_1 = require("primereact/inputswitch");
10
10
  const inputtext_1 = require("primereact/inputtext");
11
11
  const context_provider_1 = require("../context-provider");
12
12
  function HideColumn() {
13
- const { gridData, gridApi, updateColumnsForGrid } = (0, react_1.useContext)(context_provider_1.FeatureContext);
13
+ const { gridData, gridApi, updateColumnsForGrid, sidePanelText } = (0, react_1.useContext)(context_provider_1.FeatureContext);
14
14
  const [visibleRight, setVisibleRight] = (0, react_1.useState)(false);
15
15
  const [checked, setChecked] = (0, react_1.useState)(false);
16
16
  // const [inpValue, setInpValue] = useState<string>("");
@@ -138,13 +138,13 @@ function HideColumn() {
138
138
  setStoreNodes(fixNodes);
139
139
  }
140
140
  }, [visibleRight]);
141
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setVisibleRight(true), text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "columns-02", size: 20 }) }), (0, jsx_runtime_1.jsxs)(sidebar_1.Sidebar, Object.assign({ className: "md:w-6 lg:w-3", visible: visibleRight, position: "right", onHide: () => setVisibleRight(false) }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between px-4 py-2 border-bottom-1 border-gray-200" }, { children: [(0, jsx_runtime_1.jsx)("h3", { children: "Configure Columns" }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { text: true, label: "Discard", onClick: () => setVisibleRight(false) }), (0, jsx_runtime_1.jsx)(button_1.Button, { label: "Update", onClick: () => updateColumns() })] }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-4" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "px-3 py-2" }, { children: [(0, jsx_runtime_1.jsxs)("h3", Object.assign({ className: "flex align-items-center justify-content-between my-0" }, { children: ["Apply to all views", (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: checked, onChange: (e) => setChecked(e.value) })] })), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "my-0 text-sm" }, { children: "Apply the chosen column selection to all available views" }))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "py-2" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-left p-input-icon-right w-full" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md" }) })), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { id: "email",
141
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setVisibleRight(true), text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "columns-02", size: 20 }) }), (0, jsx_runtime_1.jsxs)(sidebar_1.Sidebar, Object.assign({ className: "md:w-6 lg:w-3", visible: visibleRight, position: "right", onHide: () => setVisibleRight(false) }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between px-4 py-2 border-bottom-1 border-gray-200" }, { children: [(0, jsx_runtime_1.jsx)("h3", { children: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.header) || "Configure Columns" }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { text: true, label: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.disacrd_button) || "Discard", onClick: () => setVisibleRight(false) }), (0, jsx_runtime_1.jsx)(button_1.Button, { label: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.update_button) || "Update", onClick: () => updateColumns() })] }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-4" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "px-3 py-2" }, { children: [(0, jsx_runtime_1.jsxs)("h3", Object.assign({ className: "flex align-items-center justify-content-between my-0" }, { children: [(sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.apply_to_all_views) || "Apply to all views", (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: checked, onChange: (e) => setChecked(e.value) })] })), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "my-0 text-sm" }, { children: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.apply_subHeading) || "Apply the chosen column selection to all available views" }))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "py-2" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-left p-input-icon-right w-full" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md" }) })), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { id: "email",
142
142
  // value={inpValue}
143
143
  onChange: (e) => {
144
144
  searchHandler(e.target.value);
145
- }, disabled: false, placeholder: "Search by column name", className: "text-lg font-normal text-gray-500 hover:text-gray-900 w-full" })] })) })), (0, jsx_runtime_1.jsxs)("p", Object.assign({ className: "py-2 my-0 text-gray-900 text-lg font-medium border-bottom-1 border-gray-200" }, { children: ["Selected Attributes", " ", (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-gray-500 text-sm" }, { children: [nodes === null || nodes === void 0 ? void 0 : nodes.filter((node) => node.selected).length, "/", nodes === null || nodes === void 0 ? void 0 : nodes.filter((node) => node.unSelected || node.selected).length] }))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "w-full" }, { children: (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "list-none p-0 px-3" }, { children: (nodes === null || nodes === void 0 ? void 0 : nodes.length) > 0 &&
145
+ }, disabled: false, placeholder: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.search_placeHolder) || "Search by column name", className: "text-lg font-normal text-gray-500 hover:text-gray-900 w-full" })] })) })), (0, jsx_runtime_1.jsxs)("p", Object.assign({ className: "py-2 my-0 text-gray-900 text-lg font-medium border-bottom-1 border-gray-200" }, { children: [(sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.selected_attributes) || "Selected Attributes", " ", (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-gray-500 text-sm" }, { children: [nodes === null || nodes === void 0 ? void 0 : nodes.filter((node) => node.selected).length, "/", nodes === null || nodes === void 0 ? void 0 : nodes.filter((node) => node.unSelected || node.selected).length] }))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "w-full" }, { children: (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "list-none p-0 px-3" }, { children: (nodes === null || nodes === void 0 ? void 0 : nodes.length) > 0 &&
146
146
  (nodes === null || nodes === void 0 ? void 0 : nodes.map((listItem, idx) => (listItem === null || listItem === void 0 ? void 0 : listItem.visibleInPanel) &&
147
- (listItem === null || listItem === void 0 ? void 0 : listItem.selected) && ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: "flex align-items-center justify-content-between py-3", draggable: true, onDragStart: handleDragStart(idx), onDrop: handleDrop(idx), onDragOver: handleDragOver }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ role: "img", "aria-label": "drag icon", className: "cursor-pointer" }, { children: "\uD83D\uDCE6" })), (0, jsx_runtime_1.jsx)("span", { children: listItem.headerName }), (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: listItem === null || listItem === void 0 ? void 0 : listItem.checked, onChange: (e) => handleSwitchChange(listItem, e.value) })] }), idx)))) })) })), (0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "mt-6 mb-0 pb-2 border-bottom-1 border-gray-200" }, { children: "Unselected Attributes" })), (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "list-none p-0 px-3" }, { children: (nodes === null || nodes === void 0 ? void 0 : nodes.length) > 0 &&
147
+ (listItem === null || listItem === void 0 ? void 0 : listItem.selected) && ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: "flex align-items-center justify-content-between py-3", draggable: true, onDragStart: handleDragStart(idx), onDrop: handleDrop(idx), onDragOver: handleDragOver }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ role: "img", "aria-label": "drag icon", className: "cursor-pointer" }, { children: "\uD83D\uDCE6" })), (0, jsx_runtime_1.jsx)("span", { children: listItem.headerName }), (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: listItem === null || listItem === void 0 ? void 0 : listItem.checked, onChange: (e) => handleSwitchChange(listItem, e.value) })] }), idx)))) })) })), (0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "mt-6 mb-0 pb-2 border-bottom-1 border-gray-200" }, { children: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.unselected_attributes) || "Unselected Attributes" })), (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "list-none p-0 px-3" }, { children: (nodes === null || nodes === void 0 ? void 0 : nodes.length) > 0 &&
148
148
  (nodes === null || nodes === void 0 ? void 0 : nodes.map((listItem) => (listItem === null || listItem === void 0 ? void 0 : listItem.visibleInPanel) &&
149
149
  (listItem === null || listItem === void 0 ? void 0 : listItem.unSelected) && ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: "flex align-items-center justify-content-between py-3" }, { children: [(0, jsx_runtime_1.jsx)("span", { children: listItem.headerName }), (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: listItem.checked, onChange: (e) => handleSwitchChange(listItem, e.value) })] }), listItem.id)))) }))] }))] }))] }));
150
150
  }
@@ -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, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid } = value;
9
+ const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid } = 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)({});
@@ -85,6 +85,7 @@ function MyProvider({ children, value }) {
85
85
  filterModelText,
86
86
  sortModelText,
87
87
  recordDetailModelText,
88
+ sidePanelText,
88
89
  sortOptions,
89
90
  setGridData,
90
91
  gridData,
@@ -12,7 +12,7 @@ const constants_1 = require("./constants");
12
12
  const loading_component_1 = tslib_1.__importDefault(require("./loading-component"));
13
13
  const helper_1 = require("./helper");
14
14
  function ParentForGrid(props) {
15
- var _a, _b, _c, _d;
15
+ var _a, _b, _c, _d, _e;
16
16
  const [gridData, setGridData] = (0, react_1.useState)({
17
17
  rowData: [],
18
18
  columnData: (0, helper_1.sortColumns)(props === null || props === void 0 ? void 0 : props.columnData)
@@ -173,11 +173,11 @@ function ParentForGrid(props) {
173
173
  else if (props.rowModelType === constants_1.ROWMODELTYPE.INFINITE) {
174
174
  const dataSource = {
175
175
  getRows: (params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
176
- var _e;
176
+ var _f;
177
177
  const startRow = params.startRow;
178
178
  const endRow = params.endRow;
179
179
  const result = yield getData(startRow, endRow, currentFeatures);
180
- if (((_e = result === null || result === void 0 ? void 0 : result.rowData) === null || _e === void 0 ? void 0 : _e.length) > 0) {
180
+ if (((_f = result === null || result === void 0 ? void 0 : result.rowData) === null || _f === void 0 ? void 0 : _f.length) > 0) {
181
181
  gridRef.current.api.hideOverlay();
182
182
  params.successCallback(result === null || result === void 0 ? void 0 : result.rowData, result === null || result === void 0 ? void 0 : result.actualEndRow);
183
183
  }
@@ -188,7 +188,6 @@ function ParentForGrid(props) {
188
188
  }
189
189
  }),
190
190
  };
191
- setGridData(Object.assign(Object.assign({}, gridData), { columnData: props === null || props === void 0 ? void 0 : props.columnData }));
192
191
  params.api.setGridOption("datasource", dataSource);
193
192
  }
194
193
  });
@@ -266,7 +265,9 @@ function ParentForGrid(props) {
266
265
  return colDef;
267
266
  });
268
267
  const reOrderedColumns = updatedColumnDefs.sort((a, b) => a.seq - b.seq);
268
+ setGridData(Object.assign(Object.assign({}, gridData), { columnData: columnFromProps }));
269
269
  gridRef.current.api.setGridOption("columnDefs", reOrderedColumns);
270
+ return;
270
271
  }, [props === null || props === void 0 ? void 0 : props.columnData]);
271
272
  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: style.height, width: style.width }, className: "ag-grid-container border-1 border-gray-200 border-round" }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: {
272
273
  featureDetails,
@@ -281,6 +282,7 @@ function ParentForGrid(props) {
281
282
  filterModelText: (_b = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _b === void 0 ? void 0 : _b.filterModelText,
282
283
  sortModelText: (_c = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _c === void 0 ? void 0 : _c.sortModelText,
283
284
  recordDetailModelText: (_d = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _d === void 0 ? void 0 : _d.recordDetailModelText,
285
+ sidePanelText: (_e = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _e === void 0 ? void 0 : _e.sidePanelText,
284
286
  sortOptions: (props === null || props === void 0 ? void 0 : props.sortOptions) ? props.sortOptions : constants_1.COLUMN_SORT_OPTIONS,
285
287
  filterConditions: props === null || props === void 0 ? void 0 : props.filterConditions,
286
288
  clearFilters: props === null || props === void 0 ? void 0 : props.clearFilters,
@@ -134,6 +134,17 @@ interface DynamicText {
134
134
  filterModelText: FilterModelText;
135
135
  sortModelText: SortModelText;
136
136
  recordDetailModelText: RecordDetailModelText;
137
+ sidePanelText: SidePanelText;
138
+ }
139
+ export interface SidePanelText {
140
+ header: string;
141
+ disacrd_button: string;
142
+ update_button: string;
143
+ apply_to_all_views: string;
144
+ apply_subHeading: string;
145
+ search_placeHolder: string;
146
+ selected_attributes: string;
147
+ unselected_attributes: string;
137
148
  }
138
149
  export interface FilterModelText {
139
150
  header: string;
@@ -1,4 +1,4 @@
1
- import { ColumnDef, Features, FilterCondition, FilterModelText, GridData, RecordDetailModelText, SortModelText } from "./Types";
1
+ import { ColumnDef, Features, FilterCondition, FilterModelText, GridData, RecordDetailModelText, SidePanelText, SortModelText } from "./Types";
2
2
  export declare const FeatureContext: import("react").Context<any>;
3
3
  interface MyProviderProps {
4
4
  children: React.ReactNode;
@@ -15,6 +15,7 @@ interface MyProviderProps {
15
15
  filterModelText: FilterModelText;
16
16
  sortModelText: SortModelText;
17
17
  recordDetailModelText: RecordDetailModelText;
18
+ sidePanelText: SidePanelText;
18
19
  sortOptions: any[];
19
20
  filterConditions: FilterCondition[];
20
21
  clearFilters: Boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "5.9.87",
3
+ "version": "5.9.89",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",