@cakemail-org/ui-components-v2 2.0.57 → 2.0.59
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/factories/emailAPI/index.d.ts +3 -3
- package/dist/cjs/factories/emailAPI/types.d.ts +4 -0
- package/dist/cjs/index.js +3 -2
- package/dist/esm/components/filterBar/index.d.ts +1 -1
- package/dist/esm/components/filterBar/types.d.ts +6 -0
- package/dist/esm/factories/emailAPI/index.d.ts +3 -3
- package/dist/esm/factories/emailAPI/types.d.ts +4 -0
- package/dist/esm/index.js +3 -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;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Email } from "../../models/emailAPI";
|
|
2
2
|
import { TGetEmailActivitySummary, TGetEmailReport, TListEmailLogs } from "../../services/emailAPI";
|
|
3
|
-
import {
|
|
4
|
-
import { TEmailActivitySummary, TEmailLog, TEmailReport } from "./types";
|
|
3
|
+
import { TGenericListReturn } from "../../types";
|
|
4
|
+
import { TEmailActivitySummary, TEmailLog, TEmailReport, TListEmailTagsParams } from "./types";
|
|
5
5
|
export declare class EmailAPIFactory {
|
|
6
|
-
static listTags({ ...options }:
|
|
6
|
+
static listTags({ ...options }: TListEmailTagsParams): Promise<TGenericListReturn<string>>;
|
|
7
7
|
static listLogs({ ...options }: TListEmailLogs): Promise<TGenericListReturn<TEmailLog>>;
|
|
8
8
|
static getReport({ ...options }: TGetEmailReport): Promise<TEmailReport[]>;
|
|
9
9
|
static getEmail({ id }: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EEmailProviders } from "../../services";
|
|
2
|
+
import { TGenericListParams } from "../../types";
|
|
2
3
|
export type TEmailLog = {
|
|
3
4
|
id: string;
|
|
4
5
|
type: EEmailLogType;
|
|
@@ -77,3 +78,6 @@ export type TEmailActivitySummary = {
|
|
|
77
78
|
open: number;
|
|
78
79
|
click: number;
|
|
79
80
|
};
|
|
81
|
+
export type TListEmailTagsParams = Omit<TGenericListParams, "filter" | "sort"> & {
|
|
82
|
+
name?: string;
|
|
83
|
+
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -8749,7 +8749,7 @@ styleInject(css_248z$9);
|
|
|
8749
8749
|
|
|
8750
8750
|
function FilterBar(_a) {
|
|
8751
8751
|
var _b, _c, _d, _e, _f;
|
|
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, 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;
|
|
8753
8753
|
var _g = React.useState(false), showSearch = _g[0], setShowSearch = _g[1];
|
|
8754
8754
|
var _h = React.useState(""), search = _h[0], setSearch = _h[1];
|
|
8755
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];
|
|
@@ -8773,6 +8773,7 @@ function FilterBar(_a) {
|
|
|
8773
8773
|
if (search === "") {
|
|
8774
8774
|
handleShowSearch();
|
|
8775
8775
|
}
|
|
8776
|
+
onSearchUpdate && onSearchUpdate({ value: search || "", tab: selectedTab || "" });
|
|
8776
8777
|
}
|
|
8777
8778
|
function handleRemoveTerm(termValue) {
|
|
8778
8779
|
var updatedTerms = cFilterTerms.filter(function (t) { return t.value !== termValue; });
|
|
@@ -8867,7 +8868,7 @@ function FilterBar(_a) {
|
|
|
8867
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) });
|
|
8868
8869
|
});
|
|
8869
8870
|
}
|
|
8870
|
-
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" },
|
|
8871
8872
|
React.createElement(material.Stack, { direction: "row", className: "DDItem", alignItems: "center", justifyContent: "center" },
|
|
8872
8873
|
React.createElement(Dropdown, { menuPlacement: "bottom-left", value: cOperatorValue, prefixIcon: "Filter14", variant: "standard", options: operatorOptions, color: "body1", onChange: handleOperatorDD })),
|
|
8873
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;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Email } from "../../models/emailAPI";
|
|
2
2
|
import { TGetEmailActivitySummary, TGetEmailReport, TListEmailLogs } from "../../services/emailAPI";
|
|
3
|
-
import {
|
|
4
|
-
import { TEmailActivitySummary, TEmailLog, TEmailReport } from "./types";
|
|
3
|
+
import { TGenericListReturn } from "../../types";
|
|
4
|
+
import { TEmailActivitySummary, TEmailLog, TEmailReport, TListEmailTagsParams } from "./types";
|
|
5
5
|
export declare class EmailAPIFactory {
|
|
6
|
-
static listTags({ ...options }:
|
|
6
|
+
static listTags({ ...options }: TListEmailTagsParams): Promise<TGenericListReturn<string>>;
|
|
7
7
|
static listLogs({ ...options }: TListEmailLogs): Promise<TGenericListReturn<TEmailLog>>;
|
|
8
8
|
static getReport({ ...options }: TGetEmailReport): Promise<TEmailReport[]>;
|
|
9
9
|
static getEmail({ id }: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EEmailProviders } from "../../services";
|
|
2
|
+
import { TGenericListParams } from "../../types";
|
|
2
3
|
export type TEmailLog = {
|
|
3
4
|
id: string;
|
|
4
5
|
type: EEmailLogType;
|
|
@@ -77,3 +78,6 @@ export type TEmailActivitySummary = {
|
|
|
77
78
|
open: number;
|
|
78
79
|
click: number;
|
|
79
80
|
};
|
|
81
|
+
export type TListEmailTagsParams = Omit<TGenericListParams, "filter" | "sort"> & {
|
|
82
|
+
name?: string;
|
|
83
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -8729,7 +8729,7 @@ styleInject(css_248z$9);
|
|
|
8729
8729
|
|
|
8730
8730
|
function FilterBar(_a) {
|
|
8731
8731
|
var _b, _c, _d, _e, _f;
|
|
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, 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;
|
|
8733
8733
|
var _g = useState(false), showSearch = _g[0], setShowSearch = _g[1];
|
|
8734
8734
|
var _h = useState(""), search = _h[0], setSearch = _h[1];
|
|
8735
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];
|
|
@@ -8753,6 +8753,7 @@ function FilterBar(_a) {
|
|
|
8753
8753
|
if (search === "") {
|
|
8754
8754
|
handleShowSearch();
|
|
8755
8755
|
}
|
|
8756
|
+
onSearchUpdate && onSearchUpdate({ value: search || "", tab: selectedTab || "" });
|
|
8756
8757
|
}
|
|
8757
8758
|
function handleRemoveTerm(termValue) {
|
|
8758
8759
|
var updatedTerms = cFilterTerms.filter(function (t) { return t.value !== termValue; });
|
|
@@ -8847,7 +8848,7 @@ function FilterBar(_a) {
|
|
|
8847
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) });
|
|
8848
8849
|
});
|
|
8849
8850
|
}
|
|
8850
|
-
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" },
|
|
8851
8852
|
React__default.createElement(Stack$1, { direction: "row", className: "DDItem", alignItems: "center", justifyContent: "center" },
|
|
8852
8853
|
React__default.createElement(Dropdown, { menuPlacement: "bottom-left", value: cOperatorValue, prefixIcon: "Filter14", variant: "standard", options: operatorOptions, color: "body1", onChange: handleOperatorDD })),
|
|
8853
8854
|
React__default.createElement(Stack$1, { className: "addFilterBox", alignItems: "center", justifyContent: "center" },
|