ods-component-lib 1.18.136 → 1.18.137

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.
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { FormProps, ButtonProps } from 'antd';
3
+ export interface IFormItemRuleProps {
4
+ required?: boolean;
5
+ message?: string;
6
+ }
7
+ export interface IFormItemProps {
8
+ label?: string;
9
+ name?: string;
10
+ formItemType: string;
11
+ rules?: IFormItemRuleProps[];
12
+ }
13
+ export interface IFormProps extends FormProps {
14
+ formItems: IFormItemProps[];
15
+ formButtons: ButtonProps[];
16
+ }
17
+ declare function OdsBasicForm(props: IFormProps): React.JSX.Element;
18
+ export default OdsBasicForm;
@@ -0,0 +1,10 @@
1
+ import { IconBaseProps } from "@ant-design/icons/lib/components/Icon";
2
+ import React from "react";
3
+ export interface IconProps extends IconBaseProps {
4
+ type: string;
5
+ twoToneColor?: string;
6
+ iconComponent?: string;
7
+ iconSVCName?: string;
8
+ }
9
+ declare function OdsIcon(props: IconProps): React.JSX.Element;
10
+ export default OdsIcon;
@@ -0,0 +1,7 @@
1
+ import { ModalProps } from "antd";
2
+ import React from "react";
3
+ export interface ICustomModalProps extends ModalProps {
4
+ content: React.ReactNode;
5
+ }
6
+ declare const OdsAdvanceModal: React.FC<ICustomModalProps>;
7
+ export default OdsAdvanceModal;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { SelectProps } from "antd";
3
+ export interface ISelectProps extends SelectProps {
4
+ buttonLabel: string;
5
+ }
6
+ declare function OdsCustomMultiSelect(props: ISelectProps): React.JSX.Element;
7
+ export default OdsCustomMultiSelect;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { SelectProps } from "antd";
3
+ import { IOdsSelectOption } from "./OdsSelect.styled";
4
+ export interface OdsMultiSelectProps extends SelectProps {
5
+ selectAllText?: string | undefined;
6
+ dataSource: IOdsSelectOption[];
7
+ }
8
+ declare const OdsMultiSelect: (props: OdsMultiSelectProps) => React.JSX.Element;
9
+ export default OdsMultiSelect;
@@ -0,0 +1,8 @@
1
+ import { FormProps } from "antd";
2
+ import React from "react";
3
+ export interface IFormProps extends FormProps {
4
+ items: any[];
5
+ loading: boolean;
6
+ }
7
+ declare function OdsLogin(props: IFormProps): React.JSX.Element;
8
+ export default OdsLogin;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const _default: React.MemoExoticComponent<(props: any) => React.JSX.Element>;
3
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare const DynamicIcon: ({ iconName }: {
3
+ iconName: any;
4
+ }) => React.JSX.Element;
5
+ export default DynamicIcon;
@@ -0,0 +1,56 @@
1
+ import React from "react";
2
+ import { IDataGridOptions, IEditingProps, ISelectionProps, IButtonProps } from 'devextreme-react/data-grid';
3
+ import { ButtonType } from "antd/es/button/buttonHelpers";
4
+ interface IButtonGroup extends IButtonProps {
5
+ type?: ButtonType;
6
+ label?: string;
7
+ onclick?: React.MouseEventHandler<HTMLElement>;
8
+ actionPermission?: boolean;
9
+ }
10
+ interface IEditingoptions extends IEditingProps {
11
+ formItems?: any[];
12
+ title?: string;
13
+ }
14
+ interface ISelectOptions extends ISelectionProps {
15
+ selectEnable: boolean;
16
+ }
17
+ interface IOdsDataGridProps extends IDataGridOptions {
18
+ actionButtonGroup?: IButtonGroup[];
19
+ toolbarButtonGroup?: IButtonGroup[];
20
+ exportFileName?: string;
21
+ summaryTotalColumnName?: string;
22
+ storeState?: boolean;
23
+ summaryTotalDataCount?: number;
24
+ summaryTotalDataDisplayLabel?: string;
25
+ summaryTotalPagesize?: number;
26
+ editHintLabel?: string;
27
+ editButtonClick?: any;
28
+ deleteButtonClick?: any;
29
+ pageTitle?: string;
30
+ pageSize?: number;
31
+ pagingEnable?: boolean;
32
+ searchEnable?: boolean;
33
+ filterEnable?: boolean;
34
+ headerFilterEnable?: boolean;
35
+ columnChooserPositionDisabled?: boolean;
36
+ editEnable?: boolean;
37
+ popupTitle?: string;
38
+ scroll?: any;
39
+ exportEnable?: boolean;
40
+ customPopup?: boolean;
41
+ onExportingCustom?: any;
42
+ filterEnabledShow?: boolean;
43
+ scrolUseNative?: boolean;
44
+ formItems?: any[];
45
+ hintForDeleteButton?: string;
46
+ hintForEditButton?: string;
47
+ exportFormats?: string[];
48
+ actionPermission?: boolean;
49
+ columns: any[];
50
+ actionColumnEnable?: boolean;
51
+ edit?: IEditingoptions;
52
+ selectOptions?: ISelectOptions;
53
+ actionColumnCaption?: string;
54
+ }
55
+ declare function OdsDataGridNew(props: IOdsDataGridProps): React.JSX.Element;
56
+ export default OdsDataGridNew;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare function OdsProfDataGrid(props: any): React.JSX.Element;
3
+ export default OdsProfDataGrid;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const DxTreeView: (props: any) => React.JSX.Element;
3
+ export default DxTreeView;
package/dist/index.js CHANGED
@@ -33416,59 +33416,56 @@ var ExportDataGridToExcel = function ExportDataGridToExcel(_ref) {
33416
33416
  baseFileName = _ref.baseFileName,
33417
33417
  selectedText = _ref.selectedText,
33418
33418
  getSummary = _ref.getSummary,
33419
- selectedRowsOnly = _ref.selectedRowsOnly;
33419
+ selectedRowsOnly = _ref.selectedRowsOnly,
33420
+ data = _ref.data;
33420
33421
  var workbook = new exceljs.Workbook();
33421
33422
  var worksheet = workbook.addWorksheet('Main Sheet');
33422
- var lastProcessedRowData = null;
33423
- var rowCount = 0;
33424
- excel_exporter.exportDataGrid({
33425
- component: gridComponent,
33426
- worksheet: worksheet,
33427
- selectedRowsOnly: selectedRowsOnly,
33428
- customizeCell: function customizeCell(options) {
33429
- var gridCell = options.gridCell,
33430
- excelCell = options.excelCell;
33431
- if (gridCell && excelCell) {
33432
- if (gridCell.rowType === 'data' && lastProcessedRowData !== gridCell.data) {
33433
- rowCount++;
33434
- lastProcessedRowData = gridCell.data;
33435
- }
33436
- if (gridCell.column.dataType === "datetime" && gridCell.value) {
33437
- var date = moment(gridCell.value);
33438
- var formattedDate = date.format("DD.MM.YYYY HH:mm [UTC]Z");
33439
- excelCell.value = formattedDate;
33440
- } else {
33441
- excelCell.font = {
33442
- name: 'Arial',
33443
- size: 12
33444
- };
33445
- excelCell.alignment = {
33446
- horizontal: 'left'
33447
- };
33448
- }
33423
+ var dataSource = data;
33424
+ var headers = gridComponent.option('columns').map(function (col) {
33425
+ return col.dataField;
33426
+ });
33427
+ var q = worksheet.addRow(gridComponent.option('columns').map(function (col) {
33428
+ return col.caption;
33429
+ }));
33430
+ q.font = {
33431
+ name: 'Arial',
33432
+ size: 12
33433
+ };
33434
+ q.alignment = {
33435
+ horizontal: 'left'
33436
+ };
33437
+ dataSource.forEach(function (item) {
33438
+ var row = [];
33439
+ headers.forEach(function (header) {
33440
+ var value = item[header];
33441
+ if (value instanceof Date) {
33442
+ var formattedDate = moment(value).format("DD.MM.YYYY HH:mm [UTC]Z");
33443
+ row.push(formattedDate);
33444
+ } else {
33445
+ row.push(value);
33449
33446
  }
33450
- }
33451
- }).then(function () {
33452
- var summaryResult = getSummary();
33453
- var summaryText = selectedRowsOnly ? summaryResult + " - " + rowCount + " " + selectedText : summaryResult;
33454
- var lastRow = worksheet.addRow([summaryText]);
33455
- lastRow.font = {
33456
- name: 'Arial',
33457
- size: 10,
33458
- bold: true
33459
- };
33460
- lastRow.alignment = {
33461
- horizontal: 'left'
33462
- };
33463
- workbook.xlsx.writeBuffer().then(function (buffer) {
33464
- var now = new Date();
33465
- var datePart = ('0' + now.getDate()).slice(-2) + "-" + ('0' + (now.getMonth() + 1)).slice(-2) + "-" + now.getFullYear();
33466
- var timePart = ('0' + now.getHours()).slice(-2) + ":" + ('0' + now.getMinutes()).slice(-2);
33467
- var fullFileName = baseFileName + "-" + datePart + "-" + timePart + ".xlsx";
33468
- FileSaver.saveAs(new Blob([buffer], {
33469
- type: 'application/octet-stream'
33470
- }), fullFileName);
33471
33447
  });
33448
+ worksheet.addRow(row);
33449
+ });
33450
+ var summaryResult = getSummary();
33451
+ var summaryText = selectedRowsOnly ? summaryResult + " - " + dataSource.length + " " + selectedText : summaryResult;
33452
+ var lastRow = worksheet.addRow([summaryText]);
33453
+ lastRow.font = {
33454
+ name: 'Arial',
33455
+ size: 10,
33456
+ bold: true
33457
+ };
33458
+ lastRow.alignment = {
33459
+ horizontal: 'left'
33460
+ };
33461
+ workbook.xlsx.writeBuffer().then(function (buffer) {
33462
+ var now = new Date();
33463
+ var datePart = ('0' + now.getDate()).slice(-2) + "-" + ('0' + (now.getMonth() + 1)).slice(-2) + "-" + now.getFullYear();
33464
+ var timePart = ('0' + now.getHours()).slice(-2) + ":" + ('0' + now.getMinutes()).slice(-2);
33465
+ var fullFileName = baseFileName + "-" + datePart + "-" + timePart + ".xlsx";
33466
+ FileSaver.saveAs(new Blob([buffer], {
33467
+ type: 'application/octet-stream'
33468
+ }), fullFileName);
33472
33469
  });
33473
33470
  };
33474
33471
 
@@ -34189,7 +34186,8 @@ var OdsBasicDataGrid = function OdsBasicDataGrid(props) {
34189
34186
  baseFileName: props.exportProps.fileName,
34190
34187
  selectedText: props.exportProps.selectedText,
34191
34188
  getSummary: renderTotal,
34192
- selectedRowsOnly: e.selectedRowsOnly
34189
+ selectedRowsOnly: e.selectedRowsOnly,
34190
+ data: data
34193
34191
  });
34194
34192
  },
34195
34193
  onRowClick: props.onRowClick,
@@ -35326,7 +35324,8 @@ var OdsServerSideDatagrid = function OdsServerSideDatagrid(props) {
35326
35324
  baseFileName: props.exportProps.fileName,
35327
35325
  selectedText: props.exportProps.selectedText,
35328
35326
  getSummary: renderTotal,
35329
- selectedRowsOnly: e.selectedRowsOnly
35327
+ selectedRowsOnly: e.selectedRowsOnly,
35328
+ data: headerFilterData
35330
35329
  });
35331
35330
  },
35332
35331
  onContentReady: handleContentReady,