@cakemail-org/ui-components-v2 2.0.56 → 2.0.58
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/components/filterBar/index.d.ts +1 -1
- package/dist/cjs/components/filterBar/types.d.ts +6 -0
- package/dist/cjs/components/icon/types.d.ts +1 -0
- package/dist/cjs/components/icons/18/Kb.d.ts +4 -0
- package/dist/cjs/index.js +15 -2
- package/dist/esm/components/filterBar/index.d.ts +1 -1
- package/dist/esm/components/filterBar/types.d.ts +6 -0
- package/dist/esm/components/icon/types.d.ts +1 -0
- package/dist/esm/components/icons/18/Kb.d.ts +4 -0
- package/dist/esm/index.js +15 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./styles.scss";
|
|
3
3
|
import { TFilterBar } from "./types";
|
|
4
|
-
export declare function FilterBar({ operatorOptions, initOperatorValue, operatorValue, onSave, saveTxt, onClear, clearTxt, onUpdate, addFilterTxt, filterTerms, initFilterTerms, dropMenuOptions, dropMenuProps, replacePartial }: TFilterBar): React.JSX.Element;
|
|
4
|
+
export declare function FilterBar({ operatorOptions, initOperatorValue, operatorValue, onSave, saveTxt, onClear, clearTxt, onUpdate, onSearchUpdate, loading, addFilterTxt, filterTerms, initFilterTerms, dropMenuOptions, dropMenuProps, replacePartial }: TFilterBar): React.JSX.Element;
|
|
5
5
|
export default FilterBar;
|
|
6
6
|
export * from "./types";
|
|
@@ -30,12 +30,18 @@ export type TFilterBar = {
|
|
|
30
30
|
disabledTabs?: string[];
|
|
31
31
|
};
|
|
32
32
|
replacePartial?: boolean;
|
|
33
|
+
onSearchUpdate?: ({ value, tab }: TFilterBarSearchUpdate) => void;
|
|
34
|
+
loading?: boolean;
|
|
33
35
|
};
|
|
34
36
|
export type TFilterBarUpdate = ({ filterTerms, operator }: TFilterBarupdateReturn) => void;
|
|
35
37
|
export type TFilterBarupdateReturn = {
|
|
36
38
|
filterTerms: TFilterBarFilterTerm[];
|
|
37
39
|
operator: EOperatorTypes;
|
|
38
40
|
};
|
|
41
|
+
export type TFilterBarSearchUpdate = {
|
|
42
|
+
value: string;
|
|
43
|
+
tab: string;
|
|
44
|
+
};
|
|
39
45
|
export type TFilterBarFilterTerm = {
|
|
40
46
|
value: string;
|
|
41
47
|
text?: string;
|
package/dist/cjs/index.js
CHANGED
|
@@ -894,6 +894,17 @@ function Integrations18(props) {
|
|
|
894
894
|
React.createElement("path", { d: "M4 10.0005C6.20914 10.0005 8 11.7913 8 14.0005C8 16.2096 6.20914 18.0005 4 18.0005C1.79086 18.0005 0 16.2096 0 14.0005C0 11.7913 1.79086 10.0005 4 10.0005ZM14 10.0005C16.2091 10.0005 18 11.7913 18 14.0005C18 16.2096 16.2091 18.0005 14 18.0005C11.7909 18.0005 10 16.2096 10 14.0005C10 11.7913 11.7909 10.0005 14 10.0005ZM4 12.0005C2.89543 12.0005 2 12.8959 2 14.0005C2 15.1051 2.89543 16.0005 4 16.0005C5.10457 16.0005 6 15.1051 6 14.0005C6 12.8959 5.10457 12.0005 4 12.0005ZM14 12.0005C12.8954 12.0005 12 12.8959 12 14.0005C12 15.1051 12.8954 16.0005 14 16.0005C15.1046 16.0005 16 15.1051 16 14.0005C16 12.8959 15.1046 12.0005 14 12.0005ZM9 0.000488281C11.2091 0.000488281 13 1.79135 13 4.00049C13 6.20963 11.2091 8.00049 9 8.00049C6.79086 8.00049 5 6.20963 5 4.00049C5 1.79135 6.79086 0.000488281 9 0.000488281ZM9 2.00049C7.89543 2.00049 7 2.89592 7 4.00049C7 5.10506 7.89543 6.00049 9 6.00049C10.1046 6.00049 11 5.10506 11 4.00049C11 2.89592 10.1046 2.00049 9 2.00049Z" }));
|
|
895
895
|
}
|
|
896
896
|
|
|
897
|
+
function Kb18(props) {
|
|
898
|
+
return React.createElement(SvgIcon, __assign({}, props, { width: "18", height: "18", viewBox: "0 0 18 18" }),
|
|
899
|
+
React.createElement("path", { d: "M14 10.0001C14.5523 10.0001 15 10.4478 15 11.0001C14.9999 11.5524 14.5522 12.0001 14 12.0001H12C11.4478 12.0001 11.0001 11.5524 11 11.0001C11 10.4478 11.4477 10.0001 12 10.0001H14Z" }),
|
|
900
|
+
React.createElement("path", { d: "M14 7.00012C14.5523 7.00012 15 7.44784 15 8.00012C14.9999 8.55235 14.5522 9.00012 14 9.00012H12C11.4478 9.00012 11.0001 8.55235 11 8.00012C11 7.44784 11.4477 7.00012 12 7.00012H14Z" }),
|
|
901
|
+
React.createElement("path", { d: "M14 4.00012C14.5523 4.00012 15 4.44784 15 5.00012C14.9999 5.55235 14.5522 6.00012 14 6.00012H12C11.4478 6.00012 11.0001 5.55235 11 5.00012C11 4.44784 11.4477 4.00012 12 4.00012H14Z" }),
|
|
902
|
+
React.createElement("path", { d: "M6 10.0001C6.55228 10.0001 7 10.4478 7 11.0001C6.99993 11.5524 6.55224 12.0001 6 12.0001H4C3.44776 12.0001 3.00007 11.5524 3 11.0001C3 10.4478 3.44772 10.0001 4 10.0001H6Z" }),
|
|
903
|
+
React.createElement("path", { d: "M6 7.00012C6.55228 7.00012 7 7.44784 7 8.00012C6.99993 8.55235 6.55224 9.00012 6 9.00012H4C3.44776 9.00012 3.00007 8.55235 3 8.00012C3 7.44784 3.44772 7.00012 4 7.00012H6Z" }),
|
|
904
|
+
React.createElement("path", { d: "M6 4.00012C6.55228 4.00012 7 4.44784 7 5.00012C6.99993 5.55235 6.55224 6.00012 6 6.00012H4C3.44776 6.00012 3.00007 5.55235 3 5.00012C3 4.44784 3.44772 4.00012 4 4.00012H6Z" }),
|
|
905
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13 0.00012207C15.7614 0.00012207 18 2.2387 18 5.00012V11.0001C18 13.7615 15.7614 16.0001 13 16.0001H11L9.70703 17.2931C9.31654 17.6834 8.68346 17.6834 8.29297 17.2931L7 16.0001H5C2.23858 16.0001 0 13.7615 0 11.0001V5.00012C0 2.2387 2.23858 0.00012207 5 0.00012207H13ZM10 14.0001H13C14.6569 14.0001 16 12.657 16 11.0001V5.00012C16 3.34327 14.6569 2.00012 13 2.00012H10V14.0001ZM5 2.00012C3.34315 2.00012 2 3.34327 2 5.00012V11.0001C2 12.657 3.34315 14.0001 5 14.0001H8V2.00012H5Z" }));
|
|
906
|
+
}
|
|
907
|
+
|
|
897
908
|
function LineChart18(props) {
|
|
898
909
|
return React.createElement(SvgIcon, __assign({}, props, { width: "18", height: "18", viewBox: "0 0 18 18" }),
|
|
899
910
|
React.createElement("path", { id: "Union", d: "M18 16H0V18H18V16Z" }),
|
|
@@ -1400,6 +1411,7 @@ function Icon(_a) {
|
|
|
1400
1411
|
Field18: Field18,
|
|
1401
1412
|
Globe18: Globe18,
|
|
1402
1413
|
Heart18: Heart18,
|
|
1414
|
+
Kb18: Kb18,
|
|
1403
1415
|
Home18: Home18,
|
|
1404
1416
|
Image18: Image18,
|
|
1405
1417
|
Info18: Info18,
|
|
@@ -8737,7 +8749,7 @@ styleInject(css_248z$9);
|
|
|
8737
8749
|
|
|
8738
8750
|
function FilterBar(_a) {
|
|
8739
8751
|
var _b, _c, _d, _e, _f;
|
|
8740
|
-
var operatorOptions = _a.operatorOptions, initOperatorValue = _a.initOperatorValue, operatorValue = _a.operatorValue, onSave = _a.onSave, saveTxt = _a.saveTxt, onClear = _a.onClear, clearTxt = _a.clearTxt, onUpdate = _a.onUpdate, addFilterTxt = _a.addFilterTxt, filterTerms = _a.filterTerms, initFilterTerms = _a.initFilterTerms, dropMenuOptions = _a.dropMenuOptions, dropMenuProps = _a.dropMenuProps, replacePartial = _a.replacePartial;
|
|
8752
|
+
var operatorOptions = _a.operatorOptions, initOperatorValue = _a.initOperatorValue, operatorValue = _a.operatorValue, onSave = _a.onSave, saveTxt = _a.saveTxt, onClear = _a.onClear, clearTxt = _a.clearTxt, onUpdate = _a.onUpdate, onSearchUpdate = _a.onSearchUpdate, loading = _a.loading, addFilterTxt = _a.addFilterTxt, filterTerms = _a.filterTerms, initFilterTerms = _a.initFilterTerms, dropMenuOptions = _a.dropMenuOptions, dropMenuProps = _a.dropMenuProps, replacePartial = _a.replacePartial;
|
|
8741
8753
|
var _g = React.useState(false), showSearch = _g[0], setShowSearch = _g[1];
|
|
8742
8754
|
var _h = React.useState(""), search = _h[0], setSearch = _h[1];
|
|
8743
8755
|
var _j = React.useState((_c = (_b = dropMenuProps === null || dropMenuProps === void 0 ? void 0 : dropMenuProps.tabs) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.name), selectedTab = _j[0], setSelectedTab = _j[1];
|
|
@@ -8761,6 +8773,7 @@ function FilterBar(_a) {
|
|
|
8761
8773
|
if (search === "") {
|
|
8762
8774
|
handleShowSearch();
|
|
8763
8775
|
}
|
|
8776
|
+
onSearchUpdate && onSearchUpdate({ value: search || "", tab: selectedTab || "" });
|
|
8764
8777
|
}
|
|
8765
8778
|
function handleRemoveTerm(termValue) {
|
|
8766
8779
|
var updatedTerms = cFilterTerms.filter(function (t) { return t.value !== termValue; });
|
|
@@ -8855,7 +8868,7 @@ function FilterBar(_a) {
|
|
|
8855
8868
|
return __assign(__assign({}, t), { disabled: (_a = dropMenuProps === null || dropMenuProps === void 0 ? void 0 : dropMenuProps.disabledTabs) === null || _a === void 0 ? void 0 : _a.includes(t.name) });
|
|
8856
8869
|
});
|
|
8857
8870
|
}
|
|
8858
|
-
return React.createElement(material.Stack, { className: "filter-bar-component-v2", direction: "row" },
|
|
8871
|
+
return React.createElement(material.Stack, { className: "filter-bar-component-v2 ".concat(loading ? "loading" : ""), direction: "row" },
|
|
8859
8872
|
React.createElement(material.Stack, { direction: "row", className: "DDItem", alignItems: "center", justifyContent: "center" },
|
|
8860
8873
|
React.createElement(Dropdown, { menuPlacement: "bottom-left", value: cOperatorValue, prefixIcon: "Filter14", variant: "standard", options: operatorOptions, color: "body1", onChange: handleOperatorDD })),
|
|
8861
8874
|
React.createElement(material.Stack, { className: "addFilterBox", alignItems: "center", justifyContent: "center" },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./styles.scss";
|
|
3
3
|
import { TFilterBar } from "./types";
|
|
4
|
-
export declare function FilterBar({ operatorOptions, initOperatorValue, operatorValue, onSave, saveTxt, onClear, clearTxt, onUpdate, addFilterTxt, filterTerms, initFilterTerms, dropMenuOptions, dropMenuProps, replacePartial }: TFilterBar): React.JSX.Element;
|
|
4
|
+
export declare function FilterBar({ operatorOptions, initOperatorValue, operatorValue, onSave, saveTxt, onClear, clearTxt, onUpdate, onSearchUpdate, loading, addFilterTxt, filterTerms, initFilterTerms, dropMenuOptions, dropMenuProps, replacePartial }: TFilterBar): React.JSX.Element;
|
|
5
5
|
export default FilterBar;
|
|
6
6
|
export * from "./types";
|
|
@@ -30,12 +30,18 @@ export type TFilterBar = {
|
|
|
30
30
|
disabledTabs?: string[];
|
|
31
31
|
};
|
|
32
32
|
replacePartial?: boolean;
|
|
33
|
+
onSearchUpdate?: ({ value, tab }: TFilterBarSearchUpdate) => void;
|
|
34
|
+
loading?: boolean;
|
|
33
35
|
};
|
|
34
36
|
export type TFilterBarUpdate = ({ filterTerms, operator }: TFilterBarupdateReturn) => void;
|
|
35
37
|
export type TFilterBarupdateReturn = {
|
|
36
38
|
filterTerms: TFilterBarFilterTerm[];
|
|
37
39
|
operator: EOperatorTypes;
|
|
38
40
|
};
|
|
41
|
+
export type TFilterBarSearchUpdate = {
|
|
42
|
+
value: string;
|
|
43
|
+
tab: string;
|
|
44
|
+
};
|
|
39
45
|
export type TFilterBarFilterTerm = {
|
|
40
46
|
value: string;
|
|
41
47
|
text?: string;
|
package/dist/esm/index.js
CHANGED
|
@@ -874,6 +874,17 @@ function Integrations18(props) {
|
|
|
874
874
|
React__default.createElement("path", { d: "M4 10.0005C6.20914 10.0005 8 11.7913 8 14.0005C8 16.2096 6.20914 18.0005 4 18.0005C1.79086 18.0005 0 16.2096 0 14.0005C0 11.7913 1.79086 10.0005 4 10.0005ZM14 10.0005C16.2091 10.0005 18 11.7913 18 14.0005C18 16.2096 16.2091 18.0005 14 18.0005C11.7909 18.0005 10 16.2096 10 14.0005C10 11.7913 11.7909 10.0005 14 10.0005ZM4 12.0005C2.89543 12.0005 2 12.8959 2 14.0005C2 15.1051 2.89543 16.0005 4 16.0005C5.10457 16.0005 6 15.1051 6 14.0005C6 12.8959 5.10457 12.0005 4 12.0005ZM14 12.0005C12.8954 12.0005 12 12.8959 12 14.0005C12 15.1051 12.8954 16.0005 14 16.0005C15.1046 16.0005 16 15.1051 16 14.0005C16 12.8959 15.1046 12.0005 14 12.0005ZM9 0.000488281C11.2091 0.000488281 13 1.79135 13 4.00049C13 6.20963 11.2091 8.00049 9 8.00049C6.79086 8.00049 5 6.20963 5 4.00049C5 1.79135 6.79086 0.000488281 9 0.000488281ZM9 2.00049C7.89543 2.00049 7 2.89592 7 4.00049C7 5.10506 7.89543 6.00049 9 6.00049C10.1046 6.00049 11 5.10506 11 4.00049C11 2.89592 10.1046 2.00049 9 2.00049Z" }));
|
|
875
875
|
}
|
|
876
876
|
|
|
877
|
+
function Kb18(props) {
|
|
878
|
+
return React__default.createElement(SvgIcon, __assign({}, props, { width: "18", height: "18", viewBox: "0 0 18 18" }),
|
|
879
|
+
React__default.createElement("path", { d: "M14 10.0001C14.5523 10.0001 15 10.4478 15 11.0001C14.9999 11.5524 14.5522 12.0001 14 12.0001H12C11.4478 12.0001 11.0001 11.5524 11 11.0001C11 10.4478 11.4477 10.0001 12 10.0001H14Z" }),
|
|
880
|
+
React__default.createElement("path", { d: "M14 7.00012C14.5523 7.00012 15 7.44784 15 8.00012C14.9999 8.55235 14.5522 9.00012 14 9.00012H12C11.4478 9.00012 11.0001 8.55235 11 8.00012C11 7.44784 11.4477 7.00012 12 7.00012H14Z" }),
|
|
881
|
+
React__default.createElement("path", { d: "M14 4.00012C14.5523 4.00012 15 4.44784 15 5.00012C14.9999 5.55235 14.5522 6.00012 14 6.00012H12C11.4478 6.00012 11.0001 5.55235 11 5.00012C11 4.44784 11.4477 4.00012 12 4.00012H14Z" }),
|
|
882
|
+
React__default.createElement("path", { d: "M6 10.0001C6.55228 10.0001 7 10.4478 7 11.0001C6.99993 11.5524 6.55224 12.0001 6 12.0001H4C3.44776 12.0001 3.00007 11.5524 3 11.0001C3 10.4478 3.44772 10.0001 4 10.0001H6Z" }),
|
|
883
|
+
React__default.createElement("path", { d: "M6 7.00012C6.55228 7.00012 7 7.44784 7 8.00012C6.99993 8.55235 6.55224 9.00012 6 9.00012H4C3.44776 9.00012 3.00007 8.55235 3 8.00012C3 7.44784 3.44772 7.00012 4 7.00012H6Z" }),
|
|
884
|
+
React__default.createElement("path", { d: "M6 4.00012C6.55228 4.00012 7 4.44784 7 5.00012C6.99993 5.55235 6.55224 6.00012 6 6.00012H4C3.44776 6.00012 3.00007 5.55235 3 5.00012C3 4.44784 3.44772 4.00012 4 4.00012H6Z" }),
|
|
885
|
+
React__default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13 0.00012207C15.7614 0.00012207 18 2.2387 18 5.00012V11.0001C18 13.7615 15.7614 16.0001 13 16.0001H11L9.70703 17.2931C9.31654 17.6834 8.68346 17.6834 8.29297 17.2931L7 16.0001H5C2.23858 16.0001 0 13.7615 0 11.0001V5.00012C0 2.2387 2.23858 0.00012207 5 0.00012207H13ZM10 14.0001H13C14.6569 14.0001 16 12.657 16 11.0001V5.00012C16 3.34327 14.6569 2.00012 13 2.00012H10V14.0001ZM5 2.00012C3.34315 2.00012 2 3.34327 2 5.00012V11.0001C2 12.657 3.34315 14.0001 5 14.0001H8V2.00012H5Z" }));
|
|
886
|
+
}
|
|
887
|
+
|
|
877
888
|
function LineChart18(props) {
|
|
878
889
|
return React__default.createElement(SvgIcon, __assign({}, props, { width: "18", height: "18", viewBox: "0 0 18 18" }),
|
|
879
890
|
React__default.createElement("path", { id: "Union", d: "M18 16H0V18H18V16Z" }),
|
|
@@ -1380,6 +1391,7 @@ function Icon(_a) {
|
|
|
1380
1391
|
Field18: Field18,
|
|
1381
1392
|
Globe18: Globe18,
|
|
1382
1393
|
Heart18: Heart18,
|
|
1394
|
+
Kb18: Kb18,
|
|
1383
1395
|
Home18: Home18,
|
|
1384
1396
|
Image18: Image18,
|
|
1385
1397
|
Info18: Info18,
|
|
@@ -8717,7 +8729,7 @@ styleInject(css_248z$9);
|
|
|
8717
8729
|
|
|
8718
8730
|
function FilterBar(_a) {
|
|
8719
8731
|
var _b, _c, _d, _e, _f;
|
|
8720
|
-
var operatorOptions = _a.operatorOptions, initOperatorValue = _a.initOperatorValue, operatorValue = _a.operatorValue, onSave = _a.onSave, saveTxt = _a.saveTxt, onClear = _a.onClear, clearTxt = _a.clearTxt, onUpdate = _a.onUpdate, addFilterTxt = _a.addFilterTxt, filterTerms = _a.filterTerms, initFilterTerms = _a.initFilterTerms, dropMenuOptions = _a.dropMenuOptions, dropMenuProps = _a.dropMenuProps, replacePartial = _a.replacePartial;
|
|
8732
|
+
var operatorOptions = _a.operatorOptions, initOperatorValue = _a.initOperatorValue, operatorValue = _a.operatorValue, onSave = _a.onSave, saveTxt = _a.saveTxt, onClear = _a.onClear, clearTxt = _a.clearTxt, onUpdate = _a.onUpdate, onSearchUpdate = _a.onSearchUpdate, loading = _a.loading, addFilterTxt = _a.addFilterTxt, filterTerms = _a.filterTerms, initFilterTerms = _a.initFilterTerms, dropMenuOptions = _a.dropMenuOptions, dropMenuProps = _a.dropMenuProps, replacePartial = _a.replacePartial;
|
|
8721
8733
|
var _g = useState(false), showSearch = _g[0], setShowSearch = _g[1];
|
|
8722
8734
|
var _h = useState(""), search = _h[0], setSearch = _h[1];
|
|
8723
8735
|
var _j = useState((_c = (_b = dropMenuProps === null || dropMenuProps === void 0 ? void 0 : dropMenuProps.tabs) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.name), selectedTab = _j[0], setSelectedTab = _j[1];
|
|
@@ -8741,6 +8753,7 @@ function FilterBar(_a) {
|
|
|
8741
8753
|
if (search === "") {
|
|
8742
8754
|
handleShowSearch();
|
|
8743
8755
|
}
|
|
8756
|
+
onSearchUpdate && onSearchUpdate({ value: search || "", tab: selectedTab || "" });
|
|
8744
8757
|
}
|
|
8745
8758
|
function handleRemoveTerm(termValue) {
|
|
8746
8759
|
var updatedTerms = cFilterTerms.filter(function (t) { return t.value !== termValue; });
|
|
@@ -8835,7 +8848,7 @@ function FilterBar(_a) {
|
|
|
8835
8848
|
return __assign(__assign({}, t), { disabled: (_a = dropMenuProps === null || dropMenuProps === void 0 ? void 0 : dropMenuProps.disabledTabs) === null || _a === void 0 ? void 0 : _a.includes(t.name) });
|
|
8836
8849
|
});
|
|
8837
8850
|
}
|
|
8838
|
-
return React__default.createElement(Stack$1, { className: "filter-bar-component-v2", direction: "row" },
|
|
8851
|
+
return React__default.createElement(Stack$1, { className: "filter-bar-component-v2 ".concat(loading ? "loading" : ""), direction: "row" },
|
|
8839
8852
|
React__default.createElement(Stack$1, { direction: "row", className: "DDItem", alignItems: "center", justifyContent: "center" },
|
|
8840
8853
|
React__default.createElement(Dropdown, { menuPlacement: "bottom-left", value: cOperatorValue, prefixIcon: "Filter14", variant: "standard", options: operatorOptions, color: "body1", onChange: handleOperatorDD })),
|
|
8841
8854
|
React__default.createElement(Stack$1, { className: "addFilterBox", alignItems: "center", justifyContent: "center" },
|