ods-component-lib 1.18.92 → 1.18.94
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/components/filter/{filter.d.ts → OdsFilter.d.ts} +2 -2
- package/dist/components/filter/OdsFilterTagView.d.ts +5 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +141 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +143 -6
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/filter/filterTagView.d.ts +0 -5
package/dist/index.modern.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Alert, AutoComplete, Button, Dropdown, Calendar, Card as Card$1, Checkbox, DatePicker, Divider, Collapse, Image, Input, InputNumber, List, Modal, notification, Radio, Rate, Select, Space, Spin, Switch, Tabs, Table, Tag, Timeline, TimePicker, Typography, theme, Badge, Form as Form$1, Row, Col, Tooltip } from 'antd';
|
|
1
|
+
import { Alert, AutoComplete, Button, Dropdown, Calendar, Card as Card$1, Checkbox, DatePicker, Divider, Collapse, Image, Input, InputNumber, List, Modal, notification, Radio, Rate, Select, Space, Spin, Switch, Tabs, Table, Tag, Timeline, TimePicker, Typography, theme, Badge, Menu, Form as Form$1, Row, Col, Tooltip } from 'antd';
|
|
2
2
|
import styled, { ThemeProvider } from 'styled-components';
|
|
3
|
-
import React, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
3
|
+
import React, { useState, useRef, useEffect, Fragment, useMemo, useCallback } from 'react';
|
|
4
4
|
import Marquee from 'react-fast-marquee';
|
|
5
5
|
import Card from 'antd/es/card/Card';
|
|
6
6
|
import { EyeTwoTone, EyeInvisibleOutlined, FrownOutlined, MehOutlined, SmileOutlined, HeartOutlined, InfoCircleOutlined } from '@ant-design/icons';
|
|
@@ -16,7 +16,7 @@ import jsPDF from 'jspdf';
|
|
|
16
16
|
import { Workbook } from 'exceljs';
|
|
17
17
|
import { saveAs } from 'file-saver-es';
|
|
18
18
|
import moment from 'moment';
|
|
19
|
-
import { GridIcon, EditIcon, Trash1Icon, CopyIcon, DiscountIcon, KebabMenuIcon, RefreshIcon, LinkBreakIcon, FloppyDiskIcon
|
|
19
|
+
import { GridIcon, ChevronDownIcon, UpArrow5Icon, DownArrow5Icon, Loop1Icon, EditIcon, Trash1Icon, CopyIcon, DiscountIcon, KebabMenuIcon, RefreshIcon, LinkBreakIcon, FloppyDiskIcon } from 'ods-icon/react/24/outline';
|
|
20
20
|
import { TreeList, Lookup } from 'devextreme-react';
|
|
21
21
|
|
|
22
22
|
function _extends() {
|
|
@@ -1576,6 +1576,143 @@ function OdsModal(props) {
|
|
|
1576
1576
|
}), props.content));
|
|
1577
1577
|
}
|
|
1578
1578
|
|
|
1579
|
+
var OdsFilterTagView = function OdsFilterTagView(_ref) {
|
|
1580
|
+
var preparedFilterTextViewJson = _ref.preparedFilterTextViewJson;
|
|
1581
|
+
var _useState = useState([]),
|
|
1582
|
+
menuItems = _useState[0],
|
|
1583
|
+
setMenuItems = _useState[1];
|
|
1584
|
+
useEffect(function () {
|
|
1585
|
+
var tags = preparedFilterTextViewJson.map(function (item) {
|
|
1586
|
+
var fieldValue = item.value;
|
|
1587
|
+
var transformedValue = fieldValue;
|
|
1588
|
+
var realValue = item.realValue;
|
|
1589
|
+
if (transformedValue !== null && transformedValue !== undefined && transformedValue !== "" && (realValue === null || realValue === void 0 ? void 0 : realValue.length) !== 0) {
|
|
1590
|
+
return {
|
|
1591
|
+
fieldName: item.key,
|
|
1592
|
+
fieldValue: transformedValue,
|
|
1593
|
+
tag: item.Label
|
|
1594
|
+
};
|
|
1595
|
+
}
|
|
1596
|
+
return null;
|
|
1597
|
+
}).filter(function (tag) {
|
|
1598
|
+
return tag !== null;
|
|
1599
|
+
});
|
|
1600
|
+
setMenuItems(tags);
|
|
1601
|
+
}, [preparedFilterTextViewJson]);
|
|
1602
|
+
return React.createElement(React.Fragment, null, React.createElement(Menu, {
|
|
1603
|
+
expandIcon: React.createElement("div", null, React.createElement(ChevronDownIcon, null)),
|
|
1604
|
+
defaultSelectedKeys: ["1"],
|
|
1605
|
+
mode: "horizontal",
|
|
1606
|
+
style: {
|
|
1607
|
+
width: "85%",
|
|
1608
|
+
border: "0"
|
|
1609
|
+
}
|
|
1610
|
+
}, menuItems.map(function (tagObj) {
|
|
1611
|
+
return React.createElement(Menu.Item, {
|
|
1612
|
+
key: tagObj.fieldName
|
|
1613
|
+
}, React.createElement(Tag, null, tagObj.tag + ": " + (tagObj.fieldValue.length > 10 ? tagObj.fieldValue.substring(0, 10) + " ..." : tagObj.fieldValue)));
|
|
1614
|
+
})));
|
|
1615
|
+
};
|
|
1616
|
+
|
|
1617
|
+
var useToken$1 = theme.useToken;
|
|
1618
|
+
var Title = Typography.Title;
|
|
1619
|
+
var OdsFilter = function OdsFilter(props) {
|
|
1620
|
+
var _useToken = useToken$1(),
|
|
1621
|
+
token = _useToken.token;
|
|
1622
|
+
var _useState = useState(true),
|
|
1623
|
+
showFilter = _useState[0],
|
|
1624
|
+
setShowFilter = _useState[1];
|
|
1625
|
+
var _useState2 = useState(false),
|
|
1626
|
+
showAdvanceFilter = _useState2[0],
|
|
1627
|
+
setshowAdvanceFilter = _useState2[1];
|
|
1628
|
+
var hasAdvancedFilters = props.advancedFilterRow !== undefined;
|
|
1629
|
+
var hasTagFilter = props.tabs !== undefined;
|
|
1630
|
+
var hasFilterRow = props.filterRow !== undefined;
|
|
1631
|
+
useEffect(function () {
|
|
1632
|
+
var _props$filterTag;
|
|
1633
|
+
if (props.filterTag && ((_props$filterTag = props.filterTag) === null || _props$filterTag === void 0 ? void 0 : _props$filterTag.length) > 0) handleHideShowFilter();
|
|
1634
|
+
}, [props.filterTag]);
|
|
1635
|
+
var onFinish = function onFinish(values) {
|
|
1636
|
+
if (props.onFinish) {
|
|
1637
|
+
props.onFinish(values);
|
|
1638
|
+
}
|
|
1639
|
+
};
|
|
1640
|
+
var handleHideShowAdvancedFilter = function handleHideShowAdvancedFilter() {
|
|
1641
|
+
setshowAdvanceFilter(!showAdvanceFilter);
|
|
1642
|
+
};
|
|
1643
|
+
var handleHideShowFilter = function handleHideShowFilter() {
|
|
1644
|
+
setShowFilter(!showFilter);
|
|
1645
|
+
};
|
|
1646
|
+
var onClearSearch = function onClearSearch() {
|
|
1647
|
+
if (props.onClickClear) {
|
|
1648
|
+
props.onClickClear();
|
|
1649
|
+
}
|
|
1650
|
+
};
|
|
1651
|
+
return React.createElement(OdsCard, {
|
|
1652
|
+
style: {
|
|
1653
|
+
width: "100%",
|
|
1654
|
+
padding: token.padding,
|
|
1655
|
+
borderRadius: token.borderRadiusLG * 2,
|
|
1656
|
+
marginBottom: token.margin
|
|
1657
|
+
}
|
|
1658
|
+
}, React.createElement(Form$1, {
|
|
1659
|
+
form: props.form,
|
|
1660
|
+
onFinish: onFinish,
|
|
1661
|
+
layout: "vertical"
|
|
1662
|
+
}, React.createElement(Row, {
|
|
1663
|
+
gutter: [12, 12],
|
|
1664
|
+
align: "middle"
|
|
1665
|
+
}, React.createElement(Col, {
|
|
1666
|
+
flex: "1 1 auto",
|
|
1667
|
+
style: {
|
|
1668
|
+
display: "flex",
|
|
1669
|
+
alignItems: "center",
|
|
1670
|
+
overflow: "hidden"
|
|
1671
|
+
}
|
|
1672
|
+
}, React.createElement(Title, {
|
|
1673
|
+
level: 5,
|
|
1674
|
+
style: {
|
|
1675
|
+
margin: 0
|
|
1676
|
+
}
|
|
1677
|
+
}, props.title), props.filterTag && props.filterTag.length > 0 && React.createElement(OdsFilterTagView, {
|
|
1678
|
+
preparedFilterTextViewJson: props.filterTag
|
|
1679
|
+
})), hasAdvancedFilters && React.createElement(Col, null, React.createElement(OdsButton, {
|
|
1680
|
+
style: {
|
|
1681
|
+
border: "none",
|
|
1682
|
+
color: "#1677FF",
|
|
1683
|
+
display: "flex",
|
|
1684
|
+
alignItems: "flex-end"
|
|
1685
|
+
},
|
|
1686
|
+
title: "Advanced Search",
|
|
1687
|
+
className: "filter-arrow-btn",
|
|
1688
|
+
size: "medium",
|
|
1689
|
+
type: "default",
|
|
1690
|
+
icon: showAdvanceFilter ? React.createElement(UpArrow5Icon, null) : React.createElement(DownArrow5Icon, null),
|
|
1691
|
+
onClick: handleHideShowAdvancedFilter
|
|
1692
|
+
}, props.buttonAdvancedSearchName)), props.savedFilter, React.createElement(Col, null, React.createElement(OdsButton, {
|
|
1693
|
+
className: "filter-arrow-btn",
|
|
1694
|
+
size: "large",
|
|
1695
|
+
type: "default",
|
|
1696
|
+
icon: showFilter ? React.createElement(UpArrow5Icon, null) : React.createElement(DownArrow5Icon, null),
|
|
1697
|
+
onClick: handleHideShowFilter
|
|
1698
|
+
}))), showFilter && React.createElement(Fragment, null, hasTagFilter && React.createElement(OdsTab, {
|
|
1699
|
+
items: props.tabs
|
|
1700
|
+
}), hasFilterRow && props.filterRow, showAdvanceFilter && props.advancedFilterRow, React.createElement(Row, {
|
|
1701
|
+
gutter: [12, 12],
|
|
1702
|
+
justify: "end"
|
|
1703
|
+
}, React.createElement(Col, null, React.createElement(OdsButton, {
|
|
1704
|
+
type: "text",
|
|
1705
|
+
onClick: onClearSearch,
|
|
1706
|
+
icon: React.createElement(Loop1Icon, null),
|
|
1707
|
+
style: {
|
|
1708
|
+
display: "flex"
|
|
1709
|
+
}
|
|
1710
|
+
}, props.buttonClearAllName)), React.createElement(Col, null, React.createElement(OdsButton, {
|
|
1711
|
+
type: "primary",
|
|
1712
|
+
htmlType: "submit"
|
|
1713
|
+
}, props.buttonApplyName))))));
|
|
1714
|
+
};
|
|
1715
|
+
|
|
1579
1716
|
// A type of promise-like that resolves synchronously and supports only one observer
|
|
1580
1717
|
|
|
1581
1718
|
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
|
@@ -33393,7 +33530,7 @@ var onCancelEditEvent = new CustomEvent("cancelEdit", {
|
|
|
33393
33530
|
}
|
|
33394
33531
|
});
|
|
33395
33532
|
|
|
33396
|
-
var useToken$
|
|
33533
|
+
var useToken$2 = theme.useToken;
|
|
33397
33534
|
var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
33398
33535
|
var _props$axiosRequest4, _props$axiosRequest5, _props$axiosRequest6, _props$axiosRequest7, _props$axiosRequest8, _props$axiosRequest9, _props$axiosRequest10, _props$axiosRequest11, _props$selectOptions, _props$selectOptions$, _props$selectOptions2, _props$selectOptions$2, _props$selectOptions3;
|
|
33399
33536
|
var keyExpr = props.keyExpr,
|
|
@@ -33409,7 +33546,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
33409
33546
|
onFastUpdateFinish = props.onFastUpdateFinish,
|
|
33410
33547
|
onFastUpdateCancel = props.onFastUpdateCancel,
|
|
33411
33548
|
onFastUpdateFailed = props.onFastUpdateFailed;
|
|
33412
|
-
var _useToken = useToken$
|
|
33549
|
+
var _useToken = useToken$2(),
|
|
33413
33550
|
token = _useToken.token;
|
|
33414
33551
|
var _AntForm$useForm = Form$1.useForm(),
|
|
33415
33552
|
fastUpdateForm = _AntForm$useForm[0];
|
|
@@ -34422,5 +34559,5 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
34422
34559
|
})));
|
|
34423
34560
|
};
|
|
34424
34561
|
|
|
34425
|
-
export { DxTreeList, OdsAlert, OdsAutoComplete, OdsBadge, OdsBadgeRibbon, OdsBannerAlert, OdsBasicTable, OdsButton, OdsCalendar, OdsCard, OdsCheckbox, OdsCheckboxGroup, OdsCollapse, OdsDataGrid, OdsDateRangePicker, OdsDatepicker, OdsDisplayGrid, OdsDivider, OdsDropdown, OdsDropdownButton, OdsImage, OdsInput, OdsInputNumber, OdsLink, OdsList, OdsModal, OdsModalOld, OdsMultiSelect, OdsNotification, OdsParagraph, OdsPassword, OdsPhoneInput, OdsRadio, OdsRadioGroup, OdsRangeTimepicker, OdsRate, OdsRemoteDataGrid, OdsSearch, OdsSelect, OdsSelectableTable, OdsSpin, OdsSwitch, OdsTab, OdsBasicTable as OdsTable, OdsTag, OdsText, OdsTextArea, OdsTimeline, OdsTimepicker, OdsTitle };
|
|
34562
|
+
export { DxTreeList, OdsAlert, OdsAutoComplete, OdsBadge, OdsBadgeRibbon, OdsBannerAlert, OdsBasicTable, OdsButton, OdsCalendar, OdsCard, OdsCheckbox, OdsCheckboxGroup, OdsCollapse, OdsDataGrid, OdsDateRangePicker, OdsDatepicker, OdsDisplayGrid, OdsDivider, OdsDropdown, OdsDropdownButton, OdsFilter, OdsFilterTagView, OdsImage, OdsInput, OdsInputNumber, OdsLink, OdsList, OdsModal, OdsModalOld, OdsMultiSelect, OdsNotification, OdsParagraph, OdsPassword, OdsPhoneInput, OdsRadio, OdsRadioGroup, OdsRangeTimepicker, OdsRate, OdsRemoteDataGrid, OdsSearch, OdsSelect, OdsSelectableTable, OdsSpin, OdsSwitch, OdsTab, OdsBasicTable as OdsTable, OdsTag, OdsText, OdsTextArea, OdsTimeline, OdsTimepicker, OdsTitle };
|
|
34426
34563
|
//# sourceMappingURL=index.modern.js.map
|