@cakemail-org/ui-components-v2 2.1.21 → 2.1.23
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/assetManager/index.d.ts +2 -1
- package/dist/cjs/components/assetManager/types.d.ts +7 -4
- package/dist/cjs/index.js +17 -13
- package/dist/esm/components/assetManager/index.d.ts +2 -1
- package/dist/esm/components/assetManager/types.d.ts +7 -4
- package/dist/esm/index.js +18 -14
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./styles.scss";
|
|
3
3
|
import { TAssetManager } from "./types";
|
|
4
|
-
export declare function AssetManager({ className, options, textFieldProps, manageBtn, listMainBtn, listSecondaryBtn, createBtnProps, clearSelection,
|
|
4
|
+
export declare function AssetManager({ className, options, textFieldProps, manageBtn, listMainBtn, listSecondaryBtn, createBtnProps, clearSelection, noAssetTitle, chooseAssetTitle }: TAssetManager): React.JSX.Element;
|
|
5
5
|
export default AssetManager;
|
|
6
|
+
export * from "./types";
|
|
@@ -20,8 +20,8 @@ export type TAssetManager = {
|
|
|
20
20
|
};
|
|
21
21
|
options?: TAssetManagerOption[];
|
|
22
22
|
clearSelection?: () => void;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
noAssetTitle?: string;
|
|
24
|
+
chooseAssetTitle?: string;
|
|
25
25
|
textFieldProps?: TAssetmanagerTextFieldProps;
|
|
26
26
|
};
|
|
27
27
|
export type TAssetManagerListClick = (event: React.MouseEvent<HTMLButtonElement>, btnRef: TButtonRef, option: TAssetManagerOption) => void;
|
|
@@ -31,7 +31,10 @@ export interface TAssetmanagerTextFieldProps extends Pick<TTextField, "value" |
|
|
|
31
31
|
}
|
|
32
32
|
export type TAssetManagerOption = {
|
|
33
33
|
value: string;
|
|
34
|
-
|
|
35
|
-
partialMatch?: boolean;
|
|
34
|
+
matchType?: EAssetManagerMatchType;
|
|
36
35
|
text: string;
|
|
37
36
|
};
|
|
37
|
+
export declare enum EAssetManagerMatchType {
|
|
38
|
+
full = "full",
|
|
39
|
+
partial = "partial"
|
|
40
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1576,8 +1576,14 @@ var TextField = React.forwardRef(function (_a, ref) {
|
|
|
1576
1576
|
var css_248z$u = ".assetmanager-component-v2 {\n box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.15);\n background: var(--background-color-1, var(--white, #FFFFFF));\n min-width: 25rem;\n width: 100%;\n}\n.assetmanager-component-v2 .loadingContainer-component-v2 {\n padding: 3rem;\n}\n.assetmanager-component-v2 .container {\n padding: 0.75rem;\n}\n.assetmanager-component-v2 .container > div.textInputContainer {\n display: flex;\n border: solid 1px var(--wild-sand, #dddddd);\n border-radius: 6px;\n justify-content: flex-start;\n align-items: center;\n}\n.assetmanager-component-v2 .container > div.textInputContainer > div .MuiSvgIcon-root {\n display: block;\n cursor: pointer;\n}\n.assetmanager-component-v2 .container > div.textInputContainer > div:first-child {\n padding: 0 0.75rem 0 0.75rem;\n height: 100%;\n}\n.assetmanager-component-v2 .container > div.textInputContainer > div:last-child:not(.textfield-component-v2) {\n padding: 0 0.875rem;\n height: 100%;\n}\n.assetmanager-component-v2 .container > div.textInputContainer .textfield-component-v2 {\n width: 100%;\n}\n.assetmanager-component-v2 .container > div.textInputContainer .textfield-component-v2 fieldset {\n outline: none !important;\n border: none !important;\n}\n.assetmanager-component-v2 .container > div.textInputContainer .textfield-component-v2 input {\n padding: 0.5rem 0 !important;\n}\n.assetmanager-component-v2 .container .optionsListingContainer {\n padding: 0 1.25rem 0.5rem 1.25rem;\n margin: 1.25rem 0 0.5rem 0;\n max-height: 20rem;\n overflow-y: auto;\n}\n.assetmanager-component-v2 .container .optionsListingContainer button {\n text-transform: capitalize;\n}\n.assetmanager-component-v2 .container .optionsListingContainer::-webkit-scrollbar {\n display: block;\n}\n.assetmanager-component-v2 .container .optionsListingContainer::-webkit-scrollbar-track:horizontal {\n position: absolute;\n bottom: -20px;\n}\n.assetmanager-component-v2 .container .optionsListingContainer::-webkit-scrollbar-track:vertical {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 8px !important;\n border-top-right-radius: 8px !important;\n}\n.assetmanager-component-v2 .container .optionsListingContainer::-webkit-scrollbar-track {\n height: 2.5rem;\n width: 2.5rem;\n padding: 2rem;\n background-clip: content-box;\n border-bottom-left-radius: 8px;\n}\n.assetmanager-component-v2 .container .optionsListingContainer::-webkit-scrollbar-thumb {\n background: var(--body-font-color-2, var(--silver, #9B9B9B));\n border-radius: 24px;\n border-top: 5px solid var(--background-color-1, var(--white, #FFFFFF));\n border-bottom: 5px solid var(--background-color-1, var(--white, #FFFFFF));\n border-right: 5px solid var(--background-color-1, var(--white, #FFFFFF));\n border-left: 5px solid var(--background-color-1, var(--white, #FFFFFF));\n}\n.assetmanager-component-v2 .container .optionsListingContainer > div:first-child:not(.listItem) {\n padding-bottom: 0.75rem;\n text-transform: uppercase;\n font-weight: 700;\n color: var(--body-font-color, var(--dark-matter, #2B2B2B));\n}\n.assetmanager-component-v2 .container .optionsListingContainer > p.h8 {\n margin-bottom: 1rem;\n color: var(--body-font-color, var(--dark-matter, #2B2B2B));\n}\n.assetmanager-component-v2 .container .optionsListingContainer p.h8 {\n flex: 1;\n font-family: proxima-nova, Lucida Grande, Lucida Sans Unicode, Lucida Sans, Geneva, Verdana, sans-serif;\n text-transform: uppercase;\n font-weight: 700;\n line-height: 1rem;\n font-size: 0.75rem;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem {\n display: flex;\n justify-content: space-between;\n align-items: center;\n min-height: 2rem;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem p.h8 {\n color: var(--body-font-color-2, var(--silver, #9B9B9B));\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem > .MuiSvgIcon-root {\n margin-right: 1rem;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem.selected p.h8 {\n color: var(--secondary-brand-color, var(--teal, #0ABDAE));\n padding-right: 1rem;\n max-width: 100%;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem.selected .MuiSvgIcon-root span svg path {\n fill: var(--secondary-brand-color, var(--teal, #0ABDAE));\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem .buttonContainer {\n margin-left: 1rem;\n visibility: hidden;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem .buttonContainer button:nth-child(2) {\n margin-left: 0.5rem;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem:hover .buttonContainer {\n visibility: visible;\n}\n.assetmanager-component-v2 > button:last-child {\n width: 100%;\n text-transform: uppercase;\n font-family: proxima-nova, Lucida Grande, Lucida Sans Unicode, Lucida Sans, Geneva, Verdana, sans-serif;\n height: 3rem;\n border-top: 1px solid var(--wild-sand, #dddddd) !important;\n outline: none;\n border-radius: 0;\n font-weight: 700;\n}";
|
|
1577
1577
|
styleInject(css_248z$u);
|
|
1578
1578
|
|
|
1579
|
+
exports.EAssetManagerMatchType = void 0;
|
|
1580
|
+
(function (EAssetManagerMatchType) {
|
|
1581
|
+
EAssetManagerMatchType["full"] = "full";
|
|
1582
|
+
EAssetManagerMatchType["partial"] = "partial";
|
|
1583
|
+
})(exports.EAssetManagerMatchType || (exports.EAssetManagerMatchType = {}));
|
|
1584
|
+
|
|
1579
1585
|
function AssetManager(_a) {
|
|
1580
|
-
var className = _a.className, options = _a.options, textFieldProps = _a.textFieldProps, manageBtn = _a.manageBtn, listMainBtn = _a.listMainBtn, listSecondaryBtn = _a.listSecondaryBtn, createBtnProps = _a.createBtnProps, clearSelection = _a.clearSelection,
|
|
1586
|
+
var className = _a.className, options = _a.options, textFieldProps = _a.textFieldProps, manageBtn = _a.manageBtn, listMainBtn = _a.listMainBtn, listSecondaryBtn = _a.listSecondaryBtn, createBtnProps = _a.createBtnProps, clearSelection = _a.clearSelection, noAssetTitle = _a.noAssetTitle, chooseAssetTitle = _a.chooseAssetTitle;
|
|
1581
1587
|
React.useEffect(function () {
|
|
1582
1588
|
document.addEventListener("keydown", onKeyDown, false);
|
|
1583
1589
|
return function () {
|
|
@@ -1595,13 +1601,13 @@ function AssetManager(_a) {
|
|
|
1595
1601
|
clearSelection();
|
|
1596
1602
|
}
|
|
1597
1603
|
}
|
|
1598
|
-
|
|
1604
|
+
function renderListItem(option) {
|
|
1599
1605
|
var mainBtn = listMainBtn ? React.createElement(Button, { color: "secondary", size: "small", variant: "outlined", onClick: function (event, btnRef) { listMainBtn.onClick(event, btnRef, option); }, animated: true }, listMainBtn.text) : "";
|
|
1600
1606
|
var secondaryBtn = listSecondaryBtn ? React.createElement(Button, { color: "silver", size: "small", variant: "outlined", onClick: function (event, btnRef) { listSecondaryBtn.onClick(event, btnRef, option); }, animated: true }, listSecondaryBtn.text) : "";
|
|
1601
|
-
var isFullMatch = option.
|
|
1602
|
-
var isPartialMatch = option.
|
|
1607
|
+
var isFullMatch = option.matchType === exports.EAssetManagerMatchType.full;
|
|
1608
|
+
var isPartialMatch = option.matchType === exports.EAssetManagerMatchType.partial;
|
|
1603
1609
|
var isNew = option.new === true;
|
|
1604
|
-
var noMatch = !option.
|
|
1610
|
+
var noMatch = !option.matchType && !option.new;
|
|
1605
1611
|
return (React.createElement("div", { className: " listItem ".concat(isFullMatch || isPartialMatch || isNew ? "selected" : ""), key: option.value },
|
|
1606
1612
|
isFullMatch && React.createElement(Icon, { name: "Checkmark10", color: "secondary" }),
|
|
1607
1613
|
isPartialMatch && React.createElement(Icon, { name: "Dash10", color: "secondary" }),
|
|
@@ -1618,19 +1624,17 @@ function AssetManager(_a) {
|
|
|
1618
1624
|
mainBtn,
|
|
1619
1625
|
secondaryBtn),
|
|
1620
1626
|
noMatch && mainBtn)));
|
|
1621
|
-
}
|
|
1627
|
+
}
|
|
1622
1628
|
function sortArray(a, b) {
|
|
1623
1629
|
return a.text < b.text ? -1 : a.text > b.text ? 1 : 0;
|
|
1624
1630
|
}
|
|
1625
|
-
var fullMatchOptions = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return opt.
|
|
1631
|
+
var fullMatchOptions = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return opt.matchType === exports.EAssetManagerMatchType.full; })) || [];
|
|
1626
1632
|
fullMatchOptions.sort(sortArray);
|
|
1627
|
-
var partialMatchOptions = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return opt.
|
|
1633
|
+
var partialMatchOptions = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return opt.matchType === exports.EAssetManagerMatchType.partial; })) || [];
|
|
1628
1634
|
partialMatchOptions.sort(sortArray);
|
|
1629
|
-
var noMatch = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return !opt.
|
|
1635
|
+
var noMatch = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return !opt.matchType; })) || [];
|
|
1630
1636
|
noMatch.sort(sortArray);
|
|
1631
1637
|
var showCreateOption = !(options === null || options === void 0 ? void 0 : options.find(function (opt) { return opt.value === (textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.value) || ""; }));
|
|
1632
|
-
//const newOpt = options?.filter((opt) => opt.new === true) || []
|
|
1633
|
-
//newOpt.sort(sortArray)
|
|
1634
1638
|
var mainClasses = classNames("assetmanager-component-v2", className, {});
|
|
1635
1639
|
return React.createElement(Box, { className: mainClasses },
|
|
1636
1640
|
React.createElement(Box, { className: "container" },
|
|
@@ -1649,9 +1653,9 @@ function AssetManager(_a) {
|
|
|
1649
1653
|
React.createElement(React.Fragment, null,
|
|
1650
1654
|
React.createElement(material.Stack, { className: "optionsListingContainer" },
|
|
1651
1655
|
showCreateOption && !(textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.value) && options.length === 0 ?
|
|
1652
|
-
React.createElement(React.Fragment, null,
|
|
1656
|
+
React.createElement(React.Fragment, null, noAssetTitle && React.createElement(material.Typography, { variant: "body1", className: "title bold" }, noAssetTitle))
|
|
1653
1657
|
:
|
|
1654
|
-
React.createElement(React.Fragment, null,
|
|
1658
|
+
React.createElement(React.Fragment, null, chooseAssetTitle && React.createElement(material.Typography, { variant: "body1", className: "title bold" }, chooseAssetTitle)),
|
|
1655
1659
|
(textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.value) && showCreateOption && renderListItem({
|
|
1656
1660
|
value: textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.value,
|
|
1657
1661
|
text: textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.value,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./styles.scss";
|
|
3
3
|
import { TAssetManager } from "./types";
|
|
4
|
-
export declare function AssetManager({ className, options, textFieldProps, manageBtn, listMainBtn, listSecondaryBtn, createBtnProps, clearSelection,
|
|
4
|
+
export declare function AssetManager({ className, options, textFieldProps, manageBtn, listMainBtn, listSecondaryBtn, createBtnProps, clearSelection, noAssetTitle, chooseAssetTitle }: TAssetManager): React.JSX.Element;
|
|
5
5
|
export default AssetManager;
|
|
6
|
+
export * from "./types";
|
|
@@ -20,8 +20,8 @@ export type TAssetManager = {
|
|
|
20
20
|
};
|
|
21
21
|
options?: TAssetManagerOption[];
|
|
22
22
|
clearSelection?: () => void;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
noAssetTitle?: string;
|
|
24
|
+
chooseAssetTitle?: string;
|
|
25
25
|
textFieldProps?: TAssetmanagerTextFieldProps;
|
|
26
26
|
};
|
|
27
27
|
export type TAssetManagerListClick = (event: React.MouseEvent<HTMLButtonElement>, btnRef: TButtonRef, option: TAssetManagerOption) => void;
|
|
@@ -31,7 +31,10 @@ export interface TAssetmanagerTextFieldProps extends Pick<TTextField, "value" |
|
|
|
31
31
|
}
|
|
32
32
|
export type TAssetManagerOption = {
|
|
33
33
|
value: string;
|
|
34
|
-
|
|
35
|
-
partialMatch?: boolean;
|
|
34
|
+
matchType?: EAssetManagerMatchType;
|
|
36
35
|
text: string;
|
|
37
36
|
};
|
|
37
|
+
export declare enum EAssetManagerMatchType {
|
|
38
|
+
full = "full",
|
|
39
|
+
partial = "partial"
|
|
40
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1556,8 +1556,14 @@ var TextField = forwardRef(function (_a, ref) {
|
|
|
1556
1556
|
var css_248z$u = ".assetmanager-component-v2 {\n box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.15);\n background: var(--background-color-1, var(--white, #FFFFFF));\n min-width: 25rem;\n width: 100%;\n}\n.assetmanager-component-v2 .loadingContainer-component-v2 {\n padding: 3rem;\n}\n.assetmanager-component-v2 .container {\n padding: 0.75rem;\n}\n.assetmanager-component-v2 .container > div.textInputContainer {\n display: flex;\n border: solid 1px var(--wild-sand, #dddddd);\n border-radius: 6px;\n justify-content: flex-start;\n align-items: center;\n}\n.assetmanager-component-v2 .container > div.textInputContainer > div .MuiSvgIcon-root {\n display: block;\n cursor: pointer;\n}\n.assetmanager-component-v2 .container > div.textInputContainer > div:first-child {\n padding: 0 0.75rem 0 0.75rem;\n height: 100%;\n}\n.assetmanager-component-v2 .container > div.textInputContainer > div:last-child:not(.textfield-component-v2) {\n padding: 0 0.875rem;\n height: 100%;\n}\n.assetmanager-component-v2 .container > div.textInputContainer .textfield-component-v2 {\n width: 100%;\n}\n.assetmanager-component-v2 .container > div.textInputContainer .textfield-component-v2 fieldset {\n outline: none !important;\n border: none !important;\n}\n.assetmanager-component-v2 .container > div.textInputContainer .textfield-component-v2 input {\n padding: 0.5rem 0 !important;\n}\n.assetmanager-component-v2 .container .optionsListingContainer {\n padding: 0 1.25rem 0.5rem 1.25rem;\n margin: 1.25rem 0 0.5rem 0;\n max-height: 20rem;\n overflow-y: auto;\n}\n.assetmanager-component-v2 .container .optionsListingContainer button {\n text-transform: capitalize;\n}\n.assetmanager-component-v2 .container .optionsListingContainer::-webkit-scrollbar {\n display: block;\n}\n.assetmanager-component-v2 .container .optionsListingContainer::-webkit-scrollbar-track:horizontal {\n position: absolute;\n bottom: -20px;\n}\n.assetmanager-component-v2 .container .optionsListingContainer::-webkit-scrollbar-track:vertical {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 8px !important;\n border-top-right-radius: 8px !important;\n}\n.assetmanager-component-v2 .container .optionsListingContainer::-webkit-scrollbar-track {\n height: 2.5rem;\n width: 2.5rem;\n padding: 2rem;\n background-clip: content-box;\n border-bottom-left-radius: 8px;\n}\n.assetmanager-component-v2 .container .optionsListingContainer::-webkit-scrollbar-thumb {\n background: var(--body-font-color-2, var(--silver, #9B9B9B));\n border-radius: 24px;\n border-top: 5px solid var(--background-color-1, var(--white, #FFFFFF));\n border-bottom: 5px solid var(--background-color-1, var(--white, #FFFFFF));\n border-right: 5px solid var(--background-color-1, var(--white, #FFFFFF));\n border-left: 5px solid var(--background-color-1, var(--white, #FFFFFF));\n}\n.assetmanager-component-v2 .container .optionsListingContainer > div:first-child:not(.listItem) {\n padding-bottom: 0.75rem;\n text-transform: uppercase;\n font-weight: 700;\n color: var(--body-font-color, var(--dark-matter, #2B2B2B));\n}\n.assetmanager-component-v2 .container .optionsListingContainer > p.h8 {\n margin-bottom: 1rem;\n color: var(--body-font-color, var(--dark-matter, #2B2B2B));\n}\n.assetmanager-component-v2 .container .optionsListingContainer p.h8 {\n flex: 1;\n font-family: proxima-nova, Lucida Grande, Lucida Sans Unicode, Lucida Sans, Geneva, Verdana, sans-serif;\n text-transform: uppercase;\n font-weight: 700;\n line-height: 1rem;\n font-size: 0.75rem;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem {\n display: flex;\n justify-content: space-between;\n align-items: center;\n min-height: 2rem;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem p.h8 {\n color: var(--body-font-color-2, var(--silver, #9B9B9B));\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem > .MuiSvgIcon-root {\n margin-right: 1rem;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem.selected p.h8 {\n color: var(--secondary-brand-color, var(--teal, #0ABDAE));\n padding-right: 1rem;\n max-width: 100%;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem.selected .MuiSvgIcon-root span svg path {\n fill: var(--secondary-brand-color, var(--teal, #0ABDAE));\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem .buttonContainer {\n margin-left: 1rem;\n visibility: hidden;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem .buttonContainer button:nth-child(2) {\n margin-left: 0.5rem;\n}\n.assetmanager-component-v2 .container .optionsListingContainer .listItem:hover .buttonContainer {\n visibility: visible;\n}\n.assetmanager-component-v2 > button:last-child {\n width: 100%;\n text-transform: uppercase;\n font-family: proxima-nova, Lucida Grande, Lucida Sans Unicode, Lucida Sans, Geneva, Verdana, sans-serif;\n height: 3rem;\n border-top: 1px solid var(--wild-sand, #dddddd) !important;\n outline: none;\n border-radius: 0;\n font-weight: 700;\n}";
|
|
1557
1557
|
styleInject(css_248z$u);
|
|
1558
1558
|
|
|
1559
|
+
var EAssetManagerMatchType;
|
|
1560
|
+
(function (EAssetManagerMatchType) {
|
|
1561
|
+
EAssetManagerMatchType["full"] = "full";
|
|
1562
|
+
EAssetManagerMatchType["partial"] = "partial";
|
|
1563
|
+
})(EAssetManagerMatchType || (EAssetManagerMatchType = {}));
|
|
1564
|
+
|
|
1559
1565
|
function AssetManager(_a) {
|
|
1560
|
-
var className = _a.className, options = _a.options, textFieldProps = _a.textFieldProps, manageBtn = _a.manageBtn, listMainBtn = _a.listMainBtn, listSecondaryBtn = _a.listSecondaryBtn, createBtnProps = _a.createBtnProps, clearSelection = _a.clearSelection,
|
|
1566
|
+
var className = _a.className, options = _a.options, textFieldProps = _a.textFieldProps, manageBtn = _a.manageBtn, listMainBtn = _a.listMainBtn, listSecondaryBtn = _a.listSecondaryBtn, createBtnProps = _a.createBtnProps, clearSelection = _a.clearSelection, noAssetTitle = _a.noAssetTitle, chooseAssetTitle = _a.chooseAssetTitle;
|
|
1561
1567
|
useEffect(function () {
|
|
1562
1568
|
document.addEventListener("keydown", onKeyDown, false);
|
|
1563
1569
|
return function () {
|
|
@@ -1575,13 +1581,13 @@ function AssetManager(_a) {
|
|
|
1575
1581
|
clearSelection();
|
|
1576
1582
|
}
|
|
1577
1583
|
}
|
|
1578
|
-
|
|
1584
|
+
function renderListItem(option) {
|
|
1579
1585
|
var mainBtn = listMainBtn ? React__default.createElement(Button, { color: "secondary", size: "small", variant: "outlined", onClick: function (event, btnRef) { listMainBtn.onClick(event, btnRef, option); }, animated: true }, listMainBtn.text) : "";
|
|
1580
1586
|
var secondaryBtn = listSecondaryBtn ? React__default.createElement(Button, { color: "silver", size: "small", variant: "outlined", onClick: function (event, btnRef) { listSecondaryBtn.onClick(event, btnRef, option); }, animated: true }, listSecondaryBtn.text) : "";
|
|
1581
|
-
var isFullMatch = option.
|
|
1582
|
-
var isPartialMatch = option.
|
|
1587
|
+
var isFullMatch = option.matchType === EAssetManagerMatchType.full;
|
|
1588
|
+
var isPartialMatch = option.matchType === EAssetManagerMatchType.partial;
|
|
1583
1589
|
var isNew = option.new === true;
|
|
1584
|
-
var noMatch = !option.
|
|
1590
|
+
var noMatch = !option.matchType && !option.new;
|
|
1585
1591
|
return (React__default.createElement("div", { className: " listItem ".concat(isFullMatch || isPartialMatch || isNew ? "selected" : ""), key: option.value },
|
|
1586
1592
|
isFullMatch && React__default.createElement(Icon, { name: "Checkmark10", color: "secondary" }),
|
|
1587
1593
|
isPartialMatch && React__default.createElement(Icon, { name: "Dash10", color: "secondary" }),
|
|
@@ -1598,19 +1604,17 @@ function AssetManager(_a) {
|
|
|
1598
1604
|
mainBtn,
|
|
1599
1605
|
secondaryBtn),
|
|
1600
1606
|
noMatch && mainBtn)));
|
|
1601
|
-
}
|
|
1607
|
+
}
|
|
1602
1608
|
function sortArray(a, b) {
|
|
1603
1609
|
return a.text < b.text ? -1 : a.text > b.text ? 1 : 0;
|
|
1604
1610
|
}
|
|
1605
|
-
var fullMatchOptions = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return opt.
|
|
1611
|
+
var fullMatchOptions = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return opt.matchType === EAssetManagerMatchType.full; })) || [];
|
|
1606
1612
|
fullMatchOptions.sort(sortArray);
|
|
1607
|
-
var partialMatchOptions = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return opt.
|
|
1613
|
+
var partialMatchOptions = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return opt.matchType === EAssetManagerMatchType.partial; })) || [];
|
|
1608
1614
|
partialMatchOptions.sort(sortArray);
|
|
1609
|
-
var noMatch = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return !opt.
|
|
1615
|
+
var noMatch = (options === null || options === void 0 ? void 0 : options.filter(function (opt) { return !opt.matchType; })) || [];
|
|
1610
1616
|
noMatch.sort(sortArray);
|
|
1611
1617
|
var showCreateOption = !(options === null || options === void 0 ? void 0 : options.find(function (opt) { return opt.value === (textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.value) || ""; }));
|
|
1612
|
-
//const newOpt = options?.filter((opt) => opt.new === true) || []
|
|
1613
|
-
//newOpt.sort(sortArray)
|
|
1614
1618
|
var mainClasses = classNames("assetmanager-component-v2", className, {});
|
|
1615
1619
|
return React__default.createElement(Box$1, { className: mainClasses },
|
|
1616
1620
|
React__default.createElement(Box$1, { className: "container" },
|
|
@@ -1629,9 +1633,9 @@ function AssetManager(_a) {
|
|
|
1629
1633
|
React__default.createElement(React__default.Fragment, null,
|
|
1630
1634
|
React__default.createElement(Stack$1, { className: "optionsListingContainer" },
|
|
1631
1635
|
showCreateOption && !(textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.value) && options.length === 0 ?
|
|
1632
|
-
React__default.createElement(React__default.Fragment, null,
|
|
1636
|
+
React__default.createElement(React__default.Fragment, null, noAssetTitle && React__default.createElement(Typography$1, { variant: "body1", className: "title bold" }, noAssetTitle))
|
|
1633
1637
|
:
|
|
1634
|
-
React__default.createElement(React__default.Fragment, null,
|
|
1638
|
+
React__default.createElement(React__default.Fragment, null, chooseAssetTitle && React__default.createElement(Typography$1, { variant: "body1", className: "title bold" }, chooseAssetTitle)),
|
|
1635
1639
|
(textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.value) && showCreateOption && renderListItem({
|
|
1636
1640
|
value: textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.value,
|
|
1637
1641
|
text: textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.value,
|
|
@@ -17872,4 +17876,4 @@ var UsersFactory = /** @class */ (function () {
|
|
|
17872
17876
|
return UsersFactory;
|
|
17873
17877
|
}());
|
|
17874
17878
|
|
|
17875
|
-
export { AccountModel, AccountsFactory, ActionBarContainer, ActionBarContainerHandler, AssetManager, AutomationsFactory, Avatar, BillingFactory, BrandWrapper, BrandsFactory, Button, ButtonMenu, CampaignModel, CampaignsFactory, Checkbox, Chip, CircularProgress, CodeInput, ColManager, ColorTextField, CommonFormModel, ContactModel, ContactsFactory, ContentSectionContainer, CopyToClipboard, CountryDropdown, CustomerModel, DataTable, DataTableHead, DataTableRow, DateCalendar, DatePicker, DateTimeCalendar, DateTimePicker, Dialog, DialogActions, DialogHandler, DialogTitle, Divider, Drawer, DrawerHandler, DropMenu, Dropdown, EApiLanguages, ECampaignStatuses, EEMailSummaryStatuses, EEditorType, EEmailAttachementTypes, EEmailLogType, EEmailLogTypeParam, EEmailProviders, EEmailSummaryEngagement, EEvents, EListAttributeType, EMethods, EOperatorTypes, EPartialInfoPool, EStorageType, ElementContains, Email, EmailAPIFactory, EmptyContent, EnhancedFormModel, FileUpload, FilterBar, FormModel, FormsFactory, FullBar, GenericWrapper, GenericWrapperContext, GroupedActions, Header, Icon, IconPill, InformationGroup, InlineTextEdit, LinearProgress, Link, ListCampaignModel, ListModel, ListTemplateModel, ListsFactory, LoadingContainer, LocationTextField, Logo, MD5, MetricCard, Modal, ModalHandler, ModalHeading, OverlayHandler, PhoneTextField, Radio, ResourceEdit, Search, SenderModel, SendersFactory, SideMenu, SideMenuContainer, SideMenuItem, SubNav, SummaryEnhancedFormModel, SupportFactory, SystemEmailsFactory, SystemEmailsModel, TagsFactory, TemplateModel, TemplatesFactory, TextField, TimePicker, TimeSelector, Toggle, TopMenu, Typography, UserModel, UsersFactory, acceptListPolicy, addPartialInformation, addToImpersonificationTree, amIImpersonating, amILoggedInService, archiveCampaign, areAllPropertiesEmpty, buildMUITheme, callApi, camelCase, camelToSnakeCase, cancelCampaign, capitalizeFirstLetter, cleanPostHogId, clearImpersonificationTree, clearStorage, connectToZendeskSupportService, createAccount, createBrand, createCampaign, createCampaignLogsExports, createCampaignsReportsExport, createForm, createTemplate, deepMergeObject, deleteCampaign, deleteCampaignsReportsExport, deleteForm, deletePartialInformation, deleteStorageItem, deleteTemplate, descendingComparator, disableForm, downloadCampaignLogExport, downloadCampaignsReportsExport, emptyAccountAddress, emptyAccountLimits, enableForm, enrichBrand, enrichOrganization, enrichProfile, eventCondition, eventIdentify, eventLogout, fetchRetry, fetchRoute, findNestedProperty, formatNumber, getAccount, getAccountReport, getAdjustedBillingCycle, getBeeTokenService, getBestLocalMatch, getBrand, getBrandService, getBrandUrl, getCalendarFormat, getCampaign, getCampaignLinks, getCampaignLinksReport, getCampaignLogs, getCampaignLogsExports, getCampaignReport, getCampaignRevisions, getCampaignsReportsExport, getComparator, getCustomerProfile, getDate, getDomainFromEmail, getDomainsFromEmails, getDomainsService, getEmail, getEmailActivitySummary, getEmailReport, getEndOfDate, getForm, getHashQueryWithoutHistory, getIconSize, getList, getListLogs, getListReport, getNestedProperty, getPropertyValue, getSender, getStartOfDate, getStorage, getTColor, getTemplate, getUnixTime, getUrlQueryParam, getUser, getUtmCookies, googlePlacesMapper, hasDecimal, impersonateService, initFieldValidation, initPostHog, isColorLight, isDomainValidService, isSimpleType, isValidEmail, isValidString, isValidUrl, lisTEmailTags, listAccounts, listCampaigns, listCampaignsReportsExports, listContacts, listEmailLogs, listForms, listList, listListAttributes, listListInterests, listSenders, listSystemEmails, listTemplates, listUsers, logOutService, loginService, miliToSecond, modelSet, modelToJson, originalBrand, patchForm, popImpersonificationTree, postMessage, publishForm, reScheduleCampaign, removeEmptyProperties, removeQueryParams, removeTrailingChar, renderCampaign, renderForm, renderPublicHtmlForm, renderTemplate, requestSupportService, resumeCampaign, scheduleCampaign, searchCustomerProfiles, sendCampaignTest, setBrandHeadElements, setStorage, shareTemplate, splitArray, splitObject, stableSort, startPromisePool, suspendCampaign, trackEvent, truncateEmail, truncateText, uiKitConfig, unArchiveCampaign, unScheduleCampaign, unshareTemplate, updateAccount, updateAndClearUrlParams, updateCampaign, updateSystemEmails, updateTemplate, updateUser, validateColor, validateEmail, validateGenericInput, validateUrl, wait, whiteLabelBrand, whoAmi };
|
|
17879
|
+
export { AccountModel, AccountsFactory, ActionBarContainer, ActionBarContainerHandler, AssetManager, AutomationsFactory, Avatar, BillingFactory, BrandWrapper, BrandsFactory, Button, ButtonMenu, CampaignModel, CampaignsFactory, Checkbox, Chip, CircularProgress, CodeInput, ColManager, ColorTextField, CommonFormModel, ContactModel, ContactsFactory, ContentSectionContainer, CopyToClipboard, CountryDropdown, CustomerModel, DataTable, DataTableHead, DataTableRow, DateCalendar, DatePicker, DateTimeCalendar, DateTimePicker, Dialog, DialogActions, DialogHandler, DialogTitle, Divider, Drawer, DrawerHandler, DropMenu, Dropdown, EApiLanguages, EAssetManagerMatchType, ECampaignStatuses, EEMailSummaryStatuses, EEditorType, EEmailAttachementTypes, EEmailLogType, EEmailLogTypeParam, EEmailProviders, EEmailSummaryEngagement, EEvents, EListAttributeType, EMethods, EOperatorTypes, EPartialInfoPool, EStorageType, ElementContains, Email, EmailAPIFactory, EmptyContent, EnhancedFormModel, FileUpload, FilterBar, FormModel, FormsFactory, FullBar, GenericWrapper, GenericWrapperContext, GroupedActions, Header, Icon, IconPill, InformationGroup, InlineTextEdit, LinearProgress, Link, ListCampaignModel, ListModel, ListTemplateModel, ListsFactory, LoadingContainer, LocationTextField, Logo, MD5, MetricCard, Modal, ModalHandler, ModalHeading, OverlayHandler, PhoneTextField, Radio, ResourceEdit, Search, SenderModel, SendersFactory, SideMenu, SideMenuContainer, SideMenuItem, SubNav, SummaryEnhancedFormModel, SupportFactory, SystemEmailsFactory, SystemEmailsModel, TagsFactory, TemplateModel, TemplatesFactory, TextField, TimePicker, TimeSelector, Toggle, TopMenu, Typography, UserModel, UsersFactory, acceptListPolicy, addPartialInformation, addToImpersonificationTree, amIImpersonating, amILoggedInService, archiveCampaign, areAllPropertiesEmpty, buildMUITheme, callApi, camelCase, camelToSnakeCase, cancelCampaign, capitalizeFirstLetter, cleanPostHogId, clearImpersonificationTree, clearStorage, connectToZendeskSupportService, createAccount, createBrand, createCampaign, createCampaignLogsExports, createCampaignsReportsExport, createForm, createTemplate, deepMergeObject, deleteCampaign, deleteCampaignsReportsExport, deleteForm, deletePartialInformation, deleteStorageItem, deleteTemplate, descendingComparator, disableForm, downloadCampaignLogExport, downloadCampaignsReportsExport, emptyAccountAddress, emptyAccountLimits, enableForm, enrichBrand, enrichOrganization, enrichProfile, eventCondition, eventIdentify, eventLogout, fetchRetry, fetchRoute, findNestedProperty, formatNumber, getAccount, getAccountReport, getAdjustedBillingCycle, getBeeTokenService, getBestLocalMatch, getBrand, getBrandService, getBrandUrl, getCalendarFormat, getCampaign, getCampaignLinks, getCampaignLinksReport, getCampaignLogs, getCampaignLogsExports, getCampaignReport, getCampaignRevisions, getCampaignsReportsExport, getComparator, getCustomerProfile, getDate, getDomainFromEmail, getDomainsFromEmails, getDomainsService, getEmail, getEmailActivitySummary, getEmailReport, getEndOfDate, getForm, getHashQueryWithoutHistory, getIconSize, getList, getListLogs, getListReport, getNestedProperty, getPropertyValue, getSender, getStartOfDate, getStorage, getTColor, getTemplate, getUnixTime, getUrlQueryParam, getUser, getUtmCookies, googlePlacesMapper, hasDecimal, impersonateService, initFieldValidation, initPostHog, isColorLight, isDomainValidService, isSimpleType, isValidEmail, isValidString, isValidUrl, lisTEmailTags, listAccounts, listCampaigns, listCampaignsReportsExports, listContacts, listEmailLogs, listForms, listList, listListAttributes, listListInterests, listSenders, listSystemEmails, listTemplates, listUsers, logOutService, loginService, miliToSecond, modelSet, modelToJson, originalBrand, patchForm, popImpersonificationTree, postMessage, publishForm, reScheduleCampaign, removeEmptyProperties, removeQueryParams, removeTrailingChar, renderCampaign, renderForm, renderPublicHtmlForm, renderTemplate, requestSupportService, resumeCampaign, scheduleCampaign, searchCustomerProfiles, sendCampaignTest, setBrandHeadElements, setStorage, shareTemplate, splitArray, splitObject, stableSort, startPromisePool, suspendCampaign, trackEvent, truncateEmail, truncateText, uiKitConfig, unArchiveCampaign, unScheduleCampaign, unshareTemplate, updateAccount, updateAndClearUrlParams, updateCampaign, updateSystemEmails, updateTemplate, updateUser, validateColor, validateEmail, validateGenericInput, validateUrl, wait, whiteLabelBrand, whoAmi };
|