@pega/cosmos-react-cs 4.0.0-dev.9.1 → 4.0.0
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/lib/components/CallControlPanel/AttachInteractionDialog.d.ts.map +1 -1
- package/lib/components/CallControlPanel/AttachInteractionDialog.js +2 -6
- package/lib/components/CallControlPanel/AttachInteractionDialog.js.map +1 -1
- package/lib/components/CallControlPanel/Call.d.ts.map +1 -1
- package/lib/components/CallControlPanel/Call.js +16 -14
- package/lib/components/CallControlPanel/Call.js.map +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.d.ts.map +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.js +25 -22
- package/lib/components/CallControlPanel/CallControlPanel.js.map +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.styles.js +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.styles.js.map +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.types.d.ts +10 -16
- package/lib/components/CallControlPanel/CallControlPanel.types.d.ts.map +1 -1
- package/lib/components/CallControlPanel/CallControlPanel.types.js.map +1 -1
- package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.d.ts +3 -1
- package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.d.ts.map +1 -1
- package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.js +8 -7
- package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.js.map +1 -1
- package/lib/components/CallControlPanel/CallHandover/CallHandoverForm.d.ts +5 -1
- package/lib/components/CallControlPanel/CallHandover/CallHandoverForm.d.ts.map +1 -1
- package/lib/components/CallControlPanel/CallHandover/CallHandoverForm.js +8 -6
- package/lib/components/CallControlPanel/CallHandover/CallHandoverForm.js.map +1 -1
- package/lib/components/CallControlPanel/ContactList/CalleePicker.js +1 -1
- package/lib/components/CallControlPanel/ContactList/CalleePicker.js.map +1 -1
- package/lib/components/CallControlPanel/ContactList/ContactList.js +1 -1
- package/lib/components/CallControlPanel/ContactList/ContactList.js.map +1 -1
- package/lib/components/CallControlPanel/ContactList/ContactList.types.d.ts +1 -1
- package/lib/components/CallControlPanel/ContactList/ContactList.types.d.ts.map +1 -1
- package/lib/components/CallControlPanel/ContactList/ContactList.types.js.map +1 -1
- package/lib/components/CallControlPanel/ExternalCTI.d.ts +1 -3
- package/lib/components/CallControlPanel/ExternalCTI.d.ts.map +1 -1
- package/lib/components/CallControlPanel/ExternalCTI.js +1 -1
- package/lib/components/CallControlPanel/ExternalCTI.js.map +1 -1
- package/lib/components/CallControlPanel/FloatingPanel.d.ts.map +1 -1
- package/lib/components/CallControlPanel/FloatingPanel.js +2 -2
- package/lib/components/CallControlPanel/FloatingPanel.js.map +1 -1
- package/lib/components/CallControlPanel/StopWatch.d.ts +3 -1
- package/lib/components/CallControlPanel/StopWatch.d.ts.map +1 -1
- package/lib/components/CallControlPanel/StopWatch.js.map +1 -1
- package/lib/components/CallControlPanel/index.d.ts +1 -1
- package/lib/components/CallControlPanel/index.d.ts.map +1 -1
- package/lib/components/CallControlPanel/index.js.map +1 -1
- package/lib/components/CallControlPanel/utils.d.ts.map +1 -1
- package/lib/components/CallControlPanel/utils.js +0 -1
- package/lib/components/CallControlPanel/utils.js.map +1 -1
- package/lib/components/DialPad/DialPad.d.ts.map +1 -1
- package/lib/components/DialPad/DialPad.js +1 -1
- package/lib/components/DialPad/DialPad.js.map +1 -1
- package/lib/components/DialPad/DialPad.types.d.ts +3 -3
- package/lib/components/DialPad/DialPad.types.d.ts.map +1 -1
- package/lib/components/DialPad/DialPadDialog.d.ts.map +1 -1
- package/lib/components/DialPad/DialPadDialog.js +1 -0
- package/lib/components/DialPad/DialPadDialog.js.map +1 -1
- package/lib/components/DialPad/DialPadKeyboard.d.ts +1 -1
- package/lib/components/DialPad/DialPadKeyboard.d.ts.map +1 -1
- package/lib/components/DialPad/DialPadKeyboard.js +1 -1
- package/lib/components/DialPad/DialPadKeyboard.js.map +1 -1
- package/lib/components/DialPad/KeyboardNavigation.js.map +1 -1
- package/lib/components/DialPad/index.d.ts +1 -1
- package/lib/components/DialPad/index.d.ts.map +1 -1
- package/lib/components/DialPad/index.js.map +1 -1
- package/lib/components/InteractionNotification/CountdownButton.d.ts +15 -0
- package/lib/components/InteractionNotification/CountdownButton.d.ts.map +1 -0
- package/lib/components/InteractionNotification/{AcceptButton.js → CountdownButton.js} +8 -10
- package/lib/components/InteractionNotification/CountdownButton.js.map +1 -0
- package/lib/components/InteractionNotification/InteractionNotification.d.ts +4 -4
- package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -1
- package/lib/components/InteractionNotification/InteractionNotification.js +52 -20
- package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -1
- package/lib/components/InteractionTimer/InteractionTimer.d.ts +1 -1
- package/lib/components/InteractionTimer/InteractionTimer.d.ts.map +1 -1
- package/lib/components/InteractionTimer/InteractionTimer.js +23 -5
- package/lib/components/InteractionTimer/InteractionTimer.js.map +1 -1
- package/lib/components/InteractionTimer/index.d.ts +2 -1
- package/lib/components/InteractionTimer/index.d.ts.map +1 -1
- package/lib/components/InteractionTimer/index.js.map +1 -1
- package/lib/components/Picker/Picker.d.ts +6 -0
- package/lib/components/Picker/Picker.d.ts.map +1 -0
- package/lib/components/Picker/Picker.js +109 -0
- package/lib/components/Picker/Picker.js.map +1 -0
- package/lib/components/Picker/Picker.styles.d.ts +10 -0
- package/lib/components/Picker/Picker.styles.d.ts.map +1 -0
- package/lib/components/Picker/Picker.styles.js +59 -0
- package/lib/components/Picker/Picker.styles.js.map +1 -0
- package/lib/components/Picker/Picker.types.d.ts +35 -0
- package/lib/components/Picker/Picker.types.d.ts.map +1 -0
- package/lib/components/Picker/Picker.types.js.map +1 -0
- package/lib/components/Picker/index.d.ts +2 -0
- package/lib/components/Picker/index.d.ts.map +1 -0
- package/lib/components/Picker/index.js +2 -0
- package/lib/components/Picker/index.js.map +1 -0
- package/lib/components/TaskManager/ConversationAI.js +1 -1
- package/lib/components/TaskManager/ConversationAI.js.map +1 -1
- package/lib/components/TaskManager/Dialogue.d.ts.map +1 -1
- package/lib/components/TaskManager/Dialogue.js +1 -1
- package/lib/components/TaskManager/Dialogue.js.map +1 -1
- package/lib/components/TaskManager/TaskManager.d.ts.map +1 -1
- package/lib/components/TaskManager/TaskManager.js +42 -33
- package/lib/components/TaskManager/TaskManager.js.map +1 -1
- package/lib/components/TaskManager/TaskManager.styles.d.ts +6 -2
- package/lib/components/TaskManager/TaskManager.styles.d.ts.map +1 -1
- package/lib/components/TaskManager/TaskManager.styles.js +17 -3
- package/lib/components/TaskManager/TaskManager.styles.js.map +1 -1
- package/lib/components/TaskManager/TaskManager.types.d.ts +6 -4
- package/lib/components/TaskManager/TaskManager.types.d.ts.map +1 -1
- package/lib/components/TaskManager/TaskManager.types.js.map +1 -1
- package/lib/components/TaskManager/TaskManagerTabs.d.ts.map +1 -1
- package/lib/components/TaskManager/TaskManagerTabs.js +8 -9
- package/lib/components/TaskManager/TaskManagerTabs.js.map +1 -1
- package/lib/components/TaskManager/TaskPicker.d.ts +19 -0
- package/lib/components/TaskManager/TaskPicker.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskPicker.js +89 -0
- package/lib/components/TaskManager/TaskPicker.js.map +1 -0
- package/lib/components/TaskManager/TaskView.d.ts.map +1 -1
- package/lib/components/TaskManager/TaskView.js +1 -1
- package/lib/components/TaskManager/TaskView.js.map +1 -1
- package/lib/components/TaskManager/index.d.ts +2 -2
- package/lib/components/TaskManager/index.d.ts.map +1 -1
- package/lib/components/TaskManager/index.js +1 -1
- package/lib/components/TaskManager/index.js.map +1 -1
- package/lib/index.d.ts +1 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -4
- package/lib/index.js.map +1 -1
- package/package.json +13 -15
- package/lib/components/Article/Article.d.ts +0 -32
- package/lib/components/Article/Article.d.ts.map +0 -1
- package/lib/components/Article/Article.js +0 -54
- package/lib/components/Article/Article.js.map +0 -1
- package/lib/components/Article/ArticleFooter.d.ts +0 -19
- package/lib/components/Article/ArticleFooter.d.ts.map +0 -1
- package/lib/components/Article/ArticleFooter.js +0 -40
- package/lib/components/Article/ArticleFooter.js.map +0 -1
- package/lib/components/Article/ArticleSkeleton.d.ts +0 -8
- package/lib/components/Article/ArticleSkeleton.d.ts.map +0 -1
- package/lib/components/Article/ArticleSkeleton.js +0 -15
- package/lib/components/Article/ArticleSkeleton.js.map +0 -1
- package/lib/components/Article/index.d.ts +0 -6
- package/lib/components/Article/index.d.ts.map +0 -1
- package/lib/components/Article/index.js +0 -3
- package/lib/components/Article/index.js.map +0 -1
- package/lib/components/ArticleList/ArticleList.d.ts +0 -17
- package/lib/components/ArticleList/ArticleList.d.ts.map +0 -1
- package/lib/components/ArticleList/ArticleList.js +0 -65
- package/lib/components/ArticleList/ArticleList.js.map +0 -1
- package/lib/components/ArticleList/ArticleListHeader.d.ts +0 -21
- package/lib/components/ArticleList/ArticleListHeader.d.ts.map +0 -1
- package/lib/components/ArticleList/ArticleListHeader.js +0 -68
- package/lib/components/ArticleList/ArticleListHeader.js.map +0 -1
- package/lib/components/ArticleList/ArticleSummary.d.ts +0 -14
- package/lib/components/ArticleList/ArticleSummary.d.ts.map +0 -1
- package/lib/components/ArticleList/ArticleSummary.js +0 -30
- package/lib/components/ArticleList/ArticleSummary.js.map +0 -1
- package/lib/components/ArticleList/SummarySkeleton.d.ts +0 -7
- package/lib/components/ArticleList/SummarySkeleton.d.ts.map +0 -1
- package/lib/components/ArticleList/SummarySkeleton.js +0 -9
- package/lib/components/ArticleList/SummarySkeleton.js.map +0 -1
- package/lib/components/ArticleList/index.d.ts +0 -7
- package/lib/components/ArticleList/index.d.ts.map +0 -1
- package/lib/components/ArticleList/index.js +0 -4
- package/lib/components/ArticleList/index.js.map +0 -1
- package/lib/components/InteractionNotification/AcceptButton.d.ts +0 -15
- package/lib/components/InteractionNotification/AcceptButton.d.ts.map +0 -1
- package/lib/components/InteractionNotification/AcceptButton.js.map +0 -1
- package/lib/components/TaskManager/Picker/Picker.d.ts +0 -14
- package/lib/components/TaskManager/Picker/Picker.d.ts.map +0 -1
- package/lib/components/TaskManager/Picker/Picker.js +0 -260
- package/lib/components/TaskManager/Picker/Picker.js.map +0 -1
- package/lib/components/TaskManager/Picker/Picker.types.d.ts +0 -28
- package/lib/components/TaskManager/Picker/Picker.types.d.ts.map +0 -1
- package/lib/components/TaskManager/Picker/Picker.types.js.map +0 -1
- /package/lib/components/{TaskManager/Picker → Picker}/Picker.types.js +0 -0
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Flex, useI18n, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
5
|
-
import { StyledCard } from '@pega/cosmos-react-core/lib/components/Card/Card';
|
|
6
|
-
import SummarySkeleton from './SummarySkeleton';
|
|
7
|
-
const defaultProps = {};
|
|
8
|
-
const StyledSummaryList = styled.ul ``;
|
|
9
|
-
const StyledArticleList = styled.div(props => {
|
|
10
|
-
const { theme } = props;
|
|
11
|
-
return css `
|
|
12
|
-
max-height: inherit;
|
|
13
|
-
overflow: auto;
|
|
14
|
-
padding: 0 calc(2 * ${theme.base.spacing});
|
|
15
|
-
background: ${theme.base.palette['primary-background']};
|
|
16
|
-
border-radius: ${theme.components.card['border-radius']};
|
|
17
|
-
${StyledCard} {
|
|
18
|
-
margin-bottom: calc(2 * ${theme.base.spacing});
|
|
19
|
-
}
|
|
20
|
-
${StyledSummaryList} {
|
|
21
|
-
flex-grow: 1;
|
|
22
|
-
margin: 0 0 ${theme.base.spacing} 0;
|
|
23
|
-
list-style-type: none;
|
|
24
|
-
> li:not(:last-child) {
|
|
25
|
-
border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};
|
|
26
|
-
border-radius: 0;
|
|
27
|
-
padding-bottom: ${theme.base.spacing};
|
|
28
|
-
margin-bottom: ${theme.base.spacing};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
});
|
|
33
|
-
StyledArticleList.defaultProps = defaultThemeProp;
|
|
34
|
-
const StyledArticleListHeader = styled.div(props => {
|
|
35
|
-
const { theme } = props;
|
|
36
|
-
return css `
|
|
37
|
-
flex-shrink: 0;
|
|
38
|
-
position: sticky;
|
|
39
|
-
top: 0;
|
|
40
|
-
background: ${theme.base.palette['primary-background']};
|
|
41
|
-
padding: calc(2 * ${theme.base.spacing}) 0 0 0;
|
|
42
|
-
z-index: 2;
|
|
43
|
-
`;
|
|
44
|
-
});
|
|
45
|
-
StyledArticleListHeader.defaultProps = defaultThemeProp;
|
|
46
|
-
const StyledArticleListFooter = styled.div(props => {
|
|
47
|
-
const { theme } = props;
|
|
48
|
-
return css `
|
|
49
|
-
flex-shrink: 0;
|
|
50
|
-
position: sticky;
|
|
51
|
-
bottom: 0;
|
|
52
|
-
background: ${theme.base.palette['primary-background']};
|
|
53
|
-
padding: ${theme.base.spacing} 0;
|
|
54
|
-
z-index: 2;
|
|
55
|
-
`;
|
|
56
|
-
});
|
|
57
|
-
StyledArticleListFooter.defaultProps = defaultThemeProp;
|
|
58
|
-
const ArticleList = forwardRef((props, ref) => {
|
|
59
|
-
const { header, children, skeletonize, footer, ...restProps } = props;
|
|
60
|
-
const t = useI18n();
|
|
61
|
-
return (_jsxs(Flex, { container: { direction: 'column' }, as: StyledArticleList, "aria-label": t('article_list_label_a11y'), ref: ref, ...restProps, children: [header && (_jsx(Flex, { container: true, as: StyledArticleListHeader, "aria-label": t('article_list_filter_label_a11y'), children: header })), _jsx(Flex, { container: { direction: 'column' }, as: StyledSummaryList, role: 'feed', children: skeletonize ? (_jsxs(_Fragment, { children: [_jsx(SummarySkeleton, {}), _jsx(SummarySkeleton, {}), _jsx(SummarySkeleton, {})] })) : (children) }), footer && (_jsx(Flex, { container: true, as: StyledArticleListFooter, children: footer }))] }));
|
|
62
|
-
});
|
|
63
|
-
ArticleList.defaultProps = defaultProps;
|
|
64
|
-
export default ArticleList;
|
|
65
|
-
//# sourceMappingURL=ArticleList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleList.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleList.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\n FunctionComponent,\n ReactNode,\n ReactElement,\n forwardRef,\n Ref,\n PropsWithoutRef\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex, useI18n, defaultThemeProp, BaseProps, ForwardProps } from '@pega/cosmos-react-core';\nimport { StyledCard } from '@pega/cosmos-react-core/lib/components/Card/Card';\n\nimport ArticleListHeader from './ArticleListHeader';\nimport SummarySkeleton from './SummarySkeleton';\n\nexport interface ArticleListProps extends BaseProps {\n /** Search/filtering criteria for article list */\n header?: ReactElement<typeof ArticleListHeader>;\n /** Content for article list */\n children?: ReactNode;\n /** Prop to check visibility of skeleton */\n skeletonize: boolean;\n /** Footer for article list */\n footer?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst defaultProps: Partial<ArticleListProps> = {};\nconst StyledSummaryList = styled.ul``;\nconst StyledArticleList = styled.div(props => {\n const { theme } = props;\n return css`\n max-height: inherit;\n overflow: auto;\n padding: 0 calc(2 * ${theme.base.spacing});\n background: ${theme.base.palette['primary-background']};\n border-radius: ${theme.components.card['border-radius']};\n ${StyledCard} {\n margin-bottom: calc(2 * ${theme.base.spacing});\n }\n ${StyledSummaryList} {\n flex-grow: 1;\n margin: 0 0 ${theme.base.spacing} 0;\n list-style-type: none;\n > li:not(:last-child) {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: 0;\n padding-bottom: ${theme.base.spacing};\n margin-bottom: ${theme.base.spacing};\n }\n }\n `;\n});\n\nStyledArticleList.defaultProps = defaultThemeProp;\n\nconst StyledArticleListHeader = styled.div(props => {\n const { theme } = props;\n return css`\n flex-shrink: 0;\n position: sticky;\n top: 0;\n background: ${theme.base.palette['primary-background']};\n padding: calc(2 * ${theme.base.spacing}) 0 0 0;\n z-index: 2;\n `;\n});\n\nStyledArticleListHeader.defaultProps = defaultThemeProp;\n\nconst StyledArticleListFooter = styled.div(props => {\n const { theme } = props;\n return css`\n flex-shrink: 0;\n position: sticky;\n bottom: 0;\n background: ${theme.base.palette['primary-background']};\n padding: ${theme.base.spacing} 0;\n z-index: 2;\n `;\n});\n\nStyledArticleListFooter.defaultProps = defaultThemeProp;\n\nconst ArticleList: FunctionComponent<ArticleListProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<ArticleListProps>, ref: Ref<HTMLDivElement>) => {\n const { header, children, skeletonize, footer, ...restProps } = props;\n\n const t = useI18n();\n\n return (\n <Flex\n container={{ direction: 'column' }}\n as={StyledArticleList}\n aria-label={t('article_list_label_a11y')}\n ref={ref}\n {...restProps}\n >\n {header && (\n <Flex\n container\n as={StyledArticleListHeader}\n aria-label={t('article_list_filter_label_a11y')}\n >\n {header}\n </Flex>\n )}\n <Flex container={{ direction: 'column' }} as={StyledSummaryList} role='feed'>\n {skeletonize ? (\n <>\n <SummarySkeleton />\n <SummarySkeleton />\n <SummarySkeleton />\n </>\n ) : (\n children\n )}\n </Flex>\n {footer && (\n <Flex container as={StyledArticleListFooter}>\n {footer}\n </Flex>\n )}\n </Flex>\n );\n }\n);\n\nArticleList.defaultProps = defaultProps;\n\nexport default ArticleList;\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, ReactNode, EventHandler, MouseEvent, ReactElement } from 'react';
|
|
2
|
-
import { SearchInput, BaseProps, AsProp, Action, Icon } from '@pega/cosmos-react-core';
|
|
3
|
-
export interface ArticleListHeaderProps extends BaseProps, AsProp {
|
|
4
|
-
/** Header Icon and Text */
|
|
5
|
-
icon?: ReactElement<typeof Icon>;
|
|
6
|
-
headerText: string;
|
|
7
|
-
count?: number;
|
|
8
|
-
/** Primary data: Drop in elements related to search or filtering of articles */
|
|
9
|
-
primary: {
|
|
10
|
-
search: ReactElement<typeof SearchInput>;
|
|
11
|
-
followedFilter?: ReactElement;
|
|
12
|
-
actions?: Action[];
|
|
13
|
-
};
|
|
14
|
-
/** Any other filter components to be passed */
|
|
15
|
-
secondary?: ReactNode;
|
|
16
|
-
/** Callback that triggers on enter */
|
|
17
|
-
onSubmit?: EventHandler<MouseEvent>;
|
|
18
|
-
}
|
|
19
|
-
declare const ArticleListHeader: FunctionComponent<ArticleListHeaderProps>;
|
|
20
|
-
export default ArticleListHeader;
|
|
21
|
-
//# sourceMappingURL=ArticleListHeader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleListHeader.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleListHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG7F,OAAO,EAKL,WAAW,EAEX,SAAS,EACT,MAAM,EACN,MAAM,EACN,IAAI,EAIL,MAAM,yBAAyB,CAAC;AAGjC,MAAM,WAAW,sBAAuB,SAAQ,SAAS,EAAE,MAAM;IAC/D,2BAA2B;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,OAAO,EAAE;QACP,MAAM,EAAE,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;QACzC,cAAc,CAAC,EAAE,YAAY,CAAC;QAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF,+CAA+C;IAC/C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;CACrC;AA2DD,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,CAuDhE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import styled, { css } from 'styled-components';
|
|
3
|
-
import { Button, Flex, Form, MenuButton, useI18n, Text, defaultThemeProp, Count } from '@pega/cosmos-react-core';
|
|
4
|
-
import { StyledFormContent } from '@pega/cosmos-react-core/lib/components/MultiStepForm/MultiStepForm';
|
|
5
|
-
const StyledArticleHeader = styled.div(({ theme }) => {
|
|
6
|
-
return css `
|
|
7
|
-
width: 100%;
|
|
8
|
-
gap: 0;
|
|
9
|
-
|
|
10
|
-
button[type='submit'] {
|
|
11
|
-
height: 0;
|
|
12
|
-
min-height: 0;
|
|
13
|
-
width: 0.0625rem;
|
|
14
|
-
clip-path: inset(50%);
|
|
15
|
-
clip: rect(0, 0, 0, 0);
|
|
16
|
-
margin: 0;
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
padding: 0;
|
|
19
|
-
border: 0;
|
|
20
|
-
}
|
|
21
|
-
> div:last-child {
|
|
22
|
-
margin: 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
${StyledFormContent} {
|
|
26
|
-
gap: ${theme.base.spacing};
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
});
|
|
30
|
-
StyledArticleHeader.defaultProps = defaultThemeProp;
|
|
31
|
-
const StyledSecondaryContainer = styled(Flex) `
|
|
32
|
-
margin: 0.5rem 0;
|
|
33
|
-
& > * {
|
|
34
|
-
flex-grow: 1;
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
/* This below style will be removed once we have margin auto support from Flex
|
|
38
|
-
component */
|
|
39
|
-
const StyledHeaderActions = styled.div `
|
|
40
|
-
margin-left: auto;
|
|
41
|
-
|
|
42
|
-
.radio-check {
|
|
43
|
-
margin: 0;
|
|
44
|
-
}
|
|
45
|
-
`;
|
|
46
|
-
const StyledArticleListHeaderText = styled(Text) `
|
|
47
|
-
text-overflow: ellipsis;
|
|
48
|
-
white-space: nowrap;
|
|
49
|
-
overflow: hidden;
|
|
50
|
-
flex: 1;
|
|
51
|
-
`;
|
|
52
|
-
const Locale = {
|
|
53
|
-
// FIXME: TR
|
|
54
|
-
moreActions: 'More actions'
|
|
55
|
-
};
|
|
56
|
-
const ArticleListHeader = (props) => {
|
|
57
|
-
const { as = Form, primary, secondary, onSubmit, icon, headerText, count, ...restProps } = props;
|
|
58
|
-
const t = useI18n();
|
|
59
|
-
return (_jsxs(StyledArticleHeader, { as: as, actions: _jsx(Button, { type: 'submit', "aria-hidden": 'true', tabIndex: '-1', children: t('article_list_header_submit_label') }), role: 'search', onSubmit: (ev) => {
|
|
60
|
-
ev.preventDefault();
|
|
61
|
-
if (onSubmit)
|
|
62
|
-
onSubmit(ev);
|
|
63
|
-
}, ...restProps, children: [_jsxs(Flex, { container: { alignItems: 'center', gap: 1, pad: [0, 0, 1] }, children: [icon, _jsx(StyledArticleListHeaderText, { variant: 'h2', children: _jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [headerText, typeof count === 'number' && _jsx(Count, { children: count })] }) }), primary.actions && (_jsx(MenuButton, { variant: 'simple', text: Locale.moreActions, icon: 'more', iconOnly: true, menu: {
|
|
64
|
-
items: primary.actions.map(({ text, ...rest }) => ({ ...rest, primary: text }))
|
|
65
|
-
} }))] }), _jsxs(Flex, { container: { alignItems: 'center', gap: 1, pad: [0.5, 0] }, children: [_jsx(Flex, { item: { grow: 1 }, children: primary.search }), primary.followedFilter && (_jsx(Flex, { container: true, as: StyledHeaderActions, children: primary.followedFilter }))] }), secondary && (_jsx(StyledSecondaryContainer, { container: { gap: 1 }, children: secondary }))] }));
|
|
66
|
-
};
|
|
67
|
-
export default ArticleListHeader;
|
|
68
|
-
//# sourceMappingURL=ArticleListHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleListHeader.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleListHeader.tsx"],"names":[],"mappings":"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","sourcesContent":["import { FunctionComponent, ReactNode, EventHandler, MouseEvent, ReactElement } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Flex,\n Form,\n MenuButton,\n SearchInput,\n useI18n,\n BaseProps,\n AsProp,\n Action,\n Icon,\n Text,\n defaultThemeProp,\n Count\n} from '@pega/cosmos-react-core';\nimport { StyledFormContent } from '@pega/cosmos-react-core/lib/components/MultiStepForm/MultiStepForm';\n\nexport interface ArticleListHeaderProps extends BaseProps, AsProp {\n /** Header Icon and Text */\n icon?: ReactElement<typeof Icon>;\n headerText: string;\n /* Integer representing the total count of articles */\n count?: number;\n /** Primary data: Drop in elements related to search or filtering of articles */\n primary: {\n search: ReactElement<typeof SearchInput>;\n followedFilter?: ReactElement;\n actions?: Action[];\n };\n /** Any other filter components to be passed */\n secondary?: ReactNode;\n /** Callback that triggers on enter */\n onSubmit?: EventHandler<MouseEvent>;\n}\n\nconst StyledArticleHeader = styled.div(({ theme }) => {\n return css`\n width: 100%;\n gap: 0;\n\n button[type='submit'] {\n height: 0;\n min-height: 0;\n width: 0.0625rem;\n clip-path: inset(50%);\n clip: rect(0, 0, 0, 0);\n margin: 0;\n overflow: hidden;\n padding: 0;\n border: 0;\n }\n > div:last-child {\n margin: 0;\n }\n\n ${StyledFormContent} {\n gap: ${theme.base.spacing};\n }\n `;\n});\n\nStyledArticleHeader.defaultProps = defaultThemeProp;\n\nconst StyledSecondaryContainer = styled(Flex)`\n margin: 0.5rem 0;\n & > * {\n flex-grow: 1;\n }\n`;\n\n/* This below style will be removed once we have margin auto support from Flex\ncomponent */\nconst StyledHeaderActions = styled.div`\n margin-left: auto;\n\n .radio-check {\n margin: 0;\n }\n`;\n\nconst StyledArticleListHeaderText = styled(Text)`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n flex: 1;\n`;\n\nconst Locale = {\n // FIXME: TR\n moreActions: 'More actions'\n};\n\nconst ArticleListHeader: FunctionComponent<ArticleListHeaderProps> = (\n props: ArticleListHeaderProps\n) => {\n const { as = Form, primary, secondary, onSubmit, icon, headerText, count, ...restProps } = props;\n const t = useI18n();\n\n return (\n <StyledArticleHeader\n as={as}\n actions={\n <Button type='submit' aria-hidden='true' tabIndex='-1'>\n {t('article_list_header_submit_label')}\n </Button>\n }\n role='search'\n onSubmit={(ev: MouseEvent) => {\n ev.preventDefault();\n if (onSubmit) onSubmit(ev);\n }}\n {...restProps}\n >\n <Flex container={{ alignItems: 'center', gap: 1, pad: [0, 0, 1] }}>\n {icon}\n <StyledArticleListHeaderText variant='h2'>\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n {headerText}\n {typeof count === 'number' && <Count>{count}</Count>}\n </Flex>\n </StyledArticleListHeaderText>\n\n {primary.actions && (\n <MenuButton\n variant='simple'\n text={Locale.moreActions}\n icon='more'\n iconOnly\n menu={{\n items: primary.actions.map(({ text, ...rest }) => ({ ...rest, primary: text }))\n }}\n />\n )}\n </Flex>\n <Flex container={{ alignItems: 'center', gap: 1, pad: [0.5, 0] }}>\n <Flex item={{ grow: 1 }}>{primary.search}</Flex>\n {primary.followedFilter && (\n <Flex container as={StyledHeaderActions}>\n {primary.followedFilter}\n </Flex>\n )}\n </Flex>\n {secondary && (\n <StyledSecondaryContainer container={{ gap: 1 }}>{secondary}</StyledSecondaryContainer>\n )}\n </StyledArticleHeader>\n );\n};\n\nexport default ArticleListHeader;\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { Link, Text, BaseProps, ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
-
export interface ArticleSummaryProps extends BaseProps {
|
|
4
|
-
/** Article summary title */
|
|
5
|
-
header?: ReactElement<typeof Text> | ReactElement<typeof Link>;
|
|
6
|
-
/** Summary of the article */
|
|
7
|
-
content: ReactNode;
|
|
8
|
-
/** Array of meta data rendered through MetaList component */
|
|
9
|
-
meta?: (ReactElement | string)[];
|
|
10
|
-
articleID: string;
|
|
11
|
-
}
|
|
12
|
-
declare const ArticleSummary: FunctionComponent<ArticleSummaryProps & ForwardProps>;
|
|
13
|
-
export default ArticleSummary;
|
|
14
|
-
//# sourceMappingURL=ArticleSummary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleSummary.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGnE,OAAO,EAIL,IAAI,EAEJ,IAAI,EACJ,SAAS,EACT,YAAY,EAEb,MAAM,yBAAyB,CAAC;AAMjC,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;IAC/D,6BAA6B;IAC7B,OAAO,EAAE,SAAS,CAAC;IACnB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,CAAC,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;CACnB;AAoBD,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAezE,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { CardContent, CardFooter, CardHeader, MetaList, StyledText } from '@pega/cosmos-react-core';
|
|
4
|
-
import { StyledCard } from '@pega/cosmos-react-core/lib/components/Card/Card';
|
|
5
|
-
import { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';
|
|
6
|
-
import { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';
|
|
7
|
-
import { StyledCardFooter } from '@pega/cosmos-react-core/lib/components/Card/CardFooter';
|
|
8
|
-
const defaultProps = {};
|
|
9
|
-
const ArticleCard = styled(StyledCard) `
|
|
10
|
-
&&& {
|
|
11
|
-
> ${StyledCardHeader}, > ${StyledCardContent}, > ${StyledCardFooter} {
|
|
12
|
-
padding-left: 0;
|
|
13
|
-
padding-right: 0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
> ${StyledCardContent} > ${StyledText} {
|
|
17
|
-
display: -webkit-box;
|
|
18
|
-
-webkit-line-clamp: 3;
|
|
19
|
-
-webkit-box-orient: vertical;
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
const ArticleSummary = (props) => {
|
|
25
|
-
const { header, content, meta, articleID, ...restProps } = props;
|
|
26
|
-
return (_jsxs(ArticleCard, { as: 'li', role: 'article', ...restProps, children: [header ? _jsx(CardHeader, { children: header }) : null, _jsx(CardContent, { children: content }), meta && (_jsx(CardFooter, { children: _jsx(MetaList, { items: meta }) }))] }, articleID));
|
|
27
|
-
};
|
|
28
|
-
ArticleSummary.defaultProps = defaultProps;
|
|
29
|
-
export default ArticleSummary;
|
|
30
|
-
//# sourceMappingURL=ArticleSummary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleSummary.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummary.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EAEV,QAAQ,EAIR,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAY1F,MAAM,YAAY,GAAiC,EAAE,CAAC;AAEtD,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;QAE9B,gBAAgB,OAAO,iBAAiB,OAAO,gBAAgB;;;;;QAK/D,iBAAiB,MAAM,UAAU;;;;;;;CAOxC,CAAC;AAEF,MAAM,cAAc,GAA0D,CAC5E,KAA0B,EAC1B,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACjE,OAAO,CACL,MAAC,WAAW,IAAC,EAAE,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,KAAqB,SAAS,aAC9D,MAAM,CAAC,CAAC,CAAC,KAAC,UAAU,cAAE,MAAM,GAAc,CAAC,CAAC,CAAC,IAAI,EAClD,KAAC,WAAW,cAAE,OAAO,GAAe,EACnC,IAAI,IAAI,CACP,KAAC,UAAU,cACT,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,GAAI,GACd,CACd,KAPsC,SAAS,CAQpC,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,YAAY,GAAG,YAAY,CAAC;AAE3C,eAAe,cAAc,CAAC","sourcesContent":["import { FunctionComponent, ReactElement, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport {\n CardContent,\n CardFooter,\n CardHeader,\n Link,\n MetaList,\n Text,\n BaseProps,\n ForwardProps,\n StyledText\n} from '@pega/cosmos-react-core';\nimport { StyledCard } from '@pega/cosmos-react-core/lib/components/Card/Card';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\nimport { StyledCardFooter } from '@pega/cosmos-react-core/lib/components/Card/CardFooter';\n\nexport interface ArticleSummaryProps extends BaseProps {\n /** Article summary title */\n header?: ReactElement<typeof Text> | ReactElement<typeof Link>;\n /** Summary of the article */\n content: ReactNode;\n /** Array of meta data rendered through MetaList component */\n meta?: (ReactElement | string)[];\n articleID: string;\n}\n\nconst defaultProps: Partial<ArticleSummaryProps> = {};\n\nconst ArticleCard = styled(StyledCard)`\n &&& {\n > ${StyledCardHeader}, > ${StyledCardContent}, > ${StyledCardFooter} {\n padding-left: 0;\n padding-right: 0;\n }\n\n > ${StyledCardContent} > ${StyledText} {\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n }\n`;\n\nconst ArticleSummary: FunctionComponent<ArticleSummaryProps & ForwardProps> = (\n props: ArticleSummaryProps\n) => {\n const { header, content, meta, articleID, ...restProps } = props;\n return (\n <ArticleCard as='li' role='article' key={articleID} {...restProps}>\n {header ? <CardHeader>{header}</CardHeader> : null}\n <CardContent>{content}</CardContent>\n {meta && (\n <CardFooter>\n <MetaList items={meta} />\n </CardFooter>\n )}\n </ArticleCard>\n );\n};\n\nArticleSummary.defaultProps = defaultProps;\n\nexport default ArticleSummary;\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
-
export interface SummarySkeletonProps extends BaseProps {
|
|
4
|
-
}
|
|
5
|
-
declare const SummarySkeleton: FunctionComponent<SummarySkeletonProps & ForwardProps>;
|
|
6
|
-
export default SummarySkeleton;
|
|
7
|
-
//# sourceMappingURL=SummarySkeleton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SummarySkeleton.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/SummarySkeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAIL,SAAS,EACT,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,oBAAqB,SAAQ,SAAS;CAAG;AAE1D,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CAwB3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Flex, LineSkeleton, ParagraphSkeleton } from '@pega/cosmos-react-core';
|
|
3
|
-
const SummarySkeleton = (props) => {
|
|
4
|
-
return (_jsxs(Flex, { as: 'li', container: {
|
|
5
|
-
direction: 'column'
|
|
6
|
-
}, ...props, "aria-disabled": 'true', children: [_jsx(LineSkeleton, { variant: 'link', width: 'l' }), _jsxs(ParagraphSkeleton, { children: [_jsx(LineSkeleton, {}), _jsx(LineSkeleton, { width: 's' })] }), _jsxs(Flex, { container: { alignItems: 'center' }, children: [_jsx(LineSkeleton, { width: 's' }), _jsx(LineSkeleton, { width: 's' }), _jsx(LineSkeleton, { width: 's' })] })] }));
|
|
7
|
-
};
|
|
8
|
-
export default SummarySkeleton;
|
|
9
|
-
//# sourceMappingURL=SummarySkeleton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SummarySkeleton.js","sourceRoot":"","sources":["../../../src/components/ArticleList/SummarySkeleton.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,iBAAiB,EAGlB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,eAAe,GAA2D,CAC9E,KAA2B,EAC3B,EAAE;IACF,OAAO,CACL,MAAC,IAAI,IACH,EAAE,EAAC,IAAI,EACP,SAAS,EAAE;YACT,SAAS,EAAE,QAAQ;SACpB,KACG,KAAK,mBACK,MAAM,aAEpB,KAAC,YAAY,IAAC,OAAO,EAAC,MAAM,EAAC,KAAK,EAAC,GAAG,GAAG,EACzC,MAAC,iBAAiB,eAChB,KAAC,YAAY,KAAG,EAChB,KAAC,YAAY,IAAC,KAAK,EAAC,GAAG,GAAG,IACR,EACpB,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,aACvC,KAAC,YAAY,IAAC,KAAK,EAAC,GAAG,GAAG,EAC1B,KAAC,YAAY,IAAC,KAAK,EAAC,GAAG,GAAG,EAC1B,KAAC,YAAY,IAAC,KAAK,EAAC,GAAG,GAAG,IACrB,IACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\n\nimport {\n Flex,\n LineSkeleton,\n ParagraphSkeleton,\n BaseProps,\n ForwardProps\n} from '@pega/cosmos-react-core';\n\nexport interface SummarySkeletonProps extends BaseProps {}\n\nconst SummarySkeleton: FunctionComponent<SummarySkeletonProps & ForwardProps> = (\n props: SummarySkeletonProps\n) => {\n return (\n <Flex\n as='li'\n container={{\n direction: 'column'\n }}\n {...props}\n aria-disabled='true'\n >\n <LineSkeleton variant='link' width='l' />\n <ParagraphSkeleton>\n <LineSkeleton />\n <LineSkeleton width='s' />\n </ParagraphSkeleton>\n <Flex container={{ alignItems: 'center' }}>\n <LineSkeleton width='s' />\n <LineSkeleton width='s' />\n <LineSkeleton width='s' />\n </Flex>\n </Flex>\n );\n};\n\nexport default SummarySkeleton;\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default } from './ArticleList';
|
|
2
|
-
export { ArticleListProps } from './ArticleList';
|
|
3
|
-
export { default as ArticleSummary } from './ArticleSummary';
|
|
4
|
-
export { ArticleSummaryProps } from './ArticleSummary';
|
|
5
|
-
export { default as ArticleListHeader } from './ArticleListHeader';
|
|
6
|
-
export { ArticleListHeaderProps } from './ArticleListHeader';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ArticleList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export { default } from './ArticleList';\nexport { ArticleListProps } from './ArticleList';\nexport { default as ArticleSummary } from './ArticleSummary';\nexport { ArticleSummaryProps } from './ArticleSummary';\nexport { default as ArticleListHeader } from './ArticleListHeader';\nexport { ArticleListHeaderProps } from './ArticleListHeader';\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, MouseEventHandler } from 'react';
|
|
2
|
-
import { NoChildrenProp } from '@pega/cosmos-react-core';
|
|
3
|
-
export interface AcceptButtonProps extends NoChildrenProp {
|
|
4
|
-
/** Start time of incoming Interaction. */
|
|
5
|
-
startTime: Date | number;
|
|
6
|
-
/** The time the user has to accept the call in seconds. */
|
|
7
|
-
timeout: number;
|
|
8
|
-
/** Callback invoked when timeout ends. */
|
|
9
|
-
onTimerEnd?: () => void;
|
|
10
|
-
/** Callback invoked when user clicks the button. */
|
|
11
|
-
onClick: MouseEventHandler;
|
|
12
|
-
}
|
|
13
|
-
declare const AcceptButton: FunctionComponent<AcceptButtonProps>;
|
|
14
|
-
export default AcceptButton;
|
|
15
|
-
//# sourceMappingURL=AcceptButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AcceptButton.d.ts","sourceRoot":"","sources":["../../../src/components/InteractionNotification/AcceptButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAQ,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAGxF,OAAO,EAOL,cAAc,EACf,MAAM,yBAAyB,CAAC;AAIjC,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,0CAA0C;IAC1C,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IACzB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,oDAAoD;IACpD,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAUD,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAoDtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AcceptButton.js","sourceRoot":"","sources":["../../../src/components/InteractionNotification/AcceptButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,IAAI,EAAqB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,OAAO,EACP,IAAI,EACJ,kBAAkB,EAClB,MAAM,EACN,MAAM,EACN,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CACvC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;WACT,KAAK,CAAC,IAAI,CAAC,OAAO;GAC1B,CACF,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,YAAY,GAAyC,IAAI,CAC7D,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAqB,EAAE,EAAE;IACjE,MAAM,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC;IACjC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;IAClC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAE3E,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAExD,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC;IAE/B,SAAS,CACP,GAAG,EAAE;QACH,IAAI,SAAiB,CAAC;QAEtB,IAAI,WAAW,GAAG,CAAC,EAAE;YACnB,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;gBACjC,cAAc,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YACvC,CAAC,EAAE,IAAI,CAAC,CAAC;SACV;aAAM;YACL,UAAU,EAAE,EAAE,CAAC;SAChB;QAED,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IACD;;;;OAIG;IACH,CAAC,WAAW,CAAC,CACd,CAAC;IAEF,MAAM,KAAK,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAErE,OAAO,CACL,8BACE,MAAC,kBAAkB,IAAC,OAAO,EAAC,SAAS,sBAAmB,aAAa,EAAE,OAAO,EAAE,OAAO,aACpF,CAAC,CAAC,QAAQ,CAAC,EACZ,KAAC,IAAI,mBAAa,MAAM,YAAE,KAAK,GAAQ,IACpB,EACrB,KAAC,kBAAkB,mBAAa,MAAM,EAAC,EAAE,EAAE,aAAa,YACrD,WAAW,GAAG,CAAC;oBACd,CAAC,CAAC,CAAC,CAAC,4BAA4B,EAAE,CAAC,gBAAgB,CAAC,EAAE;wBAClD,KAAK,EAAE,gBAAgB;qBACxB,CAAC;oBACJ,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,GACd,IACpB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { FunctionComponent, memo, MouseEventHandler, useEffect, useState } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n useI18n,\n Text,\n VisuallyHiddenText,\n useUID,\n Button,\n defaultThemeProp,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\n\nimport { formatDuration } from '../CallControlPanel/utils';\n\nexport interface AcceptButtonProps extends NoChildrenProp {\n /** Start time of incoming Interaction. */\n startTime: Date | number;\n /** The time the user has to accept the call in seconds. */\n timeout: number;\n /** Callback invoked when timeout ends. */\n onTimerEnd?: () => void;\n /** Callback invoked when user clicks the button. */\n onClick: MouseEventHandler;\n}\n\nconst StyledAcceptButton = styled(Button)(\n ({ theme }) => css`\n gap: ${theme.base.spacing};\n `\n);\n\nStyledAcceptButton.defaultProps = defaultThemeProp;\n\nconst AcceptButton: FunctionComponent<AcceptButtonProps> = memo(\n ({ startTime, timeout, onTimerEnd, onClick }: AcceptButtonProps) => {\n const timeoutMs = timeout * 1000;\n const start = Number(startTime);\n const endTime = start + timeoutMs;\n const [msRemaining, setMsRemaining] = useState(() => endTime - Date.now());\n\n const secondsRemaining = Math.round(msRemaining / 1000);\n\n const t = useI18n();\n const descriptionId = useUID();\n\n useEffect(\n () => {\n let timeoutId: number;\n\n if (msRemaining > 0) {\n timeoutId = window.setTimeout(() => {\n setMsRemaining(endTime - Date.now());\n }, 1000);\n } else {\n onTimerEnd?.();\n }\n\n return () => clearTimeout(timeoutId);\n },\n /*\n * Omitting onTimerEnd as an effect trigger on purpose.\n * An unstable function definition in the prop causes the effect to run more than necessary.\n * The proper definition will be captured and used with any changes to msRemaining.\n */\n [msRemaining]\n );\n\n const timer = msRemaining > 0 ? formatDuration(msRemaining) : '0:00';\n\n return (\n <>\n <StyledAcceptButton variant='primary' aria-describedby={descriptionId} onClick={onClick}>\n {t('accept')}\n <Text aria-hidden='true'>{timer}</Text>\n </StyledAcceptButton>\n <VisuallyHiddenText aria-hidden='true' id={descriptionId}>\n {msRemaining > 0\n ? t('interaction_time_remaining', [secondsRemaining], {\n count: secondsRemaining\n })\n : t('interaction_time_expired')}\n </VisuallyHiddenText>\n </>\n );\n }\n);\n\nexport default AcceptButton;\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
-
import { PickerProps } from './Picker.types';
|
|
4
|
-
export declare const StyledPickerHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
-
export declare const StyledAddTasks: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
-
export declare const StyledSelectedTasks: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
-
export declare const StyledSummaryItem: import("styled-components").StyledComponent<FunctionComponent<import("@pega/cosmos-react-core").SummaryItemProps & ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
-
export declare const StyledPickerFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
-
export declare const StyledDDList: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
-
export declare const StyledPicker: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
-
export declare const StyledDragHandle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
-
declare const Picker: FunctionComponent<PickerProps & ForwardProps>;
|
|
13
|
-
export default Picker;
|
|
14
|
-
//# sourceMappingURL=Picker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../src/components/TaskManager/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAKL,YAAY,EAmBb,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EAA8B,WAAW,EAAqB,MAAM,gBAAgB,CAAC;AAG5F,eAAO,MAAM,kBAAkB,yGAK7B,CAAC;AAGH,eAAO,MAAM,cAAc,yGAO1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,yGAU9B,CAAC;AAGH,eAAO,MAAM,iBAAiB,wLAO5B,CAAC;AAGH,eAAO,MAAM,kBAAkB,yGAK7B,CAAC;AAGH,eAAO,MAAM,YAAY,wGAMvB,CAAC;AAIH,eAAO,MAAM,YAAY,yGAExB,CAAC;AAEF,eAAO,MAAM,gBAAgB,yGAK5B,CAAC;AAkEF,QAAA,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,GAAG,YAAY,CAuSzD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Button, Count, defaultThemeProp, Flex, Icon, Menu, menuHelpers, EmptyState, SearchInput, SummaryItem, Text, useI18n, Switch, useArrows, useConsolidatedRef, useElement, registerIcon, getFocusables, FormDialog, CardHeader, useUID, useOuterEvent } from '@pega/cosmos-react-core';
|
|
5
|
-
import { DragDropList, DragDropManager } from '@pega/cosmos-react-dnd';
|
|
6
|
-
import * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';
|
|
7
|
-
import * as dragIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/drag.icon';
|
|
8
|
-
import * as trashIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/trash.icon';
|
|
9
|
-
import Dialog from '@pega/cosmos-react-core/lib/components/Dialog/Dialog';
|
|
10
|
-
registerIcon(timesIcon, dragIcon, trashIcon);
|
|
11
|
-
export const StyledPickerHeader = styled.div(({ theme }) => {
|
|
12
|
-
return css `
|
|
13
|
-
padding-inline-start: calc(2 * ${theme.base.spacing});
|
|
14
|
-
padding-inline-end: calc(1.25 * ${theme.base.spacing});
|
|
15
|
-
`;
|
|
16
|
-
});
|
|
17
|
-
StyledPickerHeader.defaultProps = defaultThemeProp;
|
|
18
|
-
export const StyledAddTasks = styled.div `
|
|
19
|
-
max-height: 24rem;
|
|
20
|
-
flex-grow: 1;
|
|
21
|
-
header {
|
|
22
|
-
padding-top: 0;
|
|
23
|
-
border-bottom: none;
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
export const StyledSelectedTasks = styled.div(({ theme }) => {
|
|
27
|
-
return css `
|
|
28
|
-
width: 17.5rem;
|
|
29
|
-
max-height: 24rem;
|
|
30
|
-
padding: ${theme.base.spacing} 0 0 ${theme.base.spacing};
|
|
31
|
-
border-inline-start: 0.0625rem solid ${theme.base.palette['border-line']};
|
|
32
|
-
> h3 {
|
|
33
|
-
padding: 0 0 ${theme.base.spacing} ${theme.base.spacing};
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
});
|
|
37
|
-
StyledSelectedTasks.defaultProps = defaultThemeProp;
|
|
38
|
-
export const StyledSummaryItem = styled(SummaryItem)(({ theme }) => {
|
|
39
|
-
return css `
|
|
40
|
-
padding: ${theme.base.spacing} 0;
|
|
41
|
-
&:not(:last-child) {
|
|
42
|
-
border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};
|
|
43
|
-
}
|
|
44
|
-
`;
|
|
45
|
-
});
|
|
46
|
-
StyledSummaryItem.defaultProps = defaultThemeProp;
|
|
47
|
-
export const StyledPickerFooter = styled.div(({ theme }) => {
|
|
48
|
-
return css `
|
|
49
|
-
border-top: 0.0625rem solid ${theme.base.palette['border-line']};
|
|
50
|
-
padding: ${theme.base.spacing};
|
|
51
|
-
`;
|
|
52
|
-
});
|
|
53
|
-
StyledPickerFooter.defaultProps = defaultThemeProp;
|
|
54
|
-
export const StyledDDList = styled.ul(({ theme }) => {
|
|
55
|
-
return css `
|
|
56
|
-
padding-inline-end: calc(0.25 * ${theme.base.spacing});
|
|
57
|
-
height: 26rem;
|
|
58
|
-
overflow-y: auto;
|
|
59
|
-
`;
|
|
60
|
-
});
|
|
61
|
-
StyledDDList.defaultProps = defaultThemeProp;
|
|
62
|
-
export const StyledPicker = styled.div `
|
|
63
|
-
height: 100%;
|
|
64
|
-
`;
|
|
65
|
-
export const StyledDragHandle = styled.div `
|
|
66
|
-
cursor: move;
|
|
67
|
-
> svg {
|
|
68
|
-
display: block;
|
|
69
|
-
}
|
|
70
|
-
`;
|
|
71
|
-
const StyledCount = styled(Count)(({ theme }) => {
|
|
72
|
-
return css `
|
|
73
|
-
margin-inline-start: calc(0.5 * ${theme.base.spacing});
|
|
74
|
-
`;
|
|
75
|
-
});
|
|
76
|
-
StyledCount.defaultProps = defaultThemeProp;
|
|
77
|
-
const SelectedItemRenderer = ({ dragRef, previewRef, data }) => {
|
|
78
|
-
const t = useI18n();
|
|
79
|
-
return (_jsx("li", { children: _jsx(StyledSummaryItem, { ref: previewRef, visual: _jsx(StyledDragHandle, { ref: dragRef, children: _jsx(Icon, { name: 'drag' }) }), primary: data.primary, secondary: data.secondary, actions: _jsx(Button, { variant: 'simple', icon: true, "aria-label": t('task_manager_delete_task', [data.primary]), label: t('task_manager_delete_task'), onClick: () => data.onRemoveSelection?.(data.id), children: _jsx(Icon, { name: 'trash' }) }) }) }));
|
|
80
|
-
};
|
|
81
|
-
const DraggableSelectedList = ({ selectedItems, onChange, itemRenderer }) => {
|
|
82
|
-
return (_jsx(DragDropManager, { children: _jsx(DragDropList, { as: StyledDDList, accept: 'string', items: selectedItems.map(item => ({
|
|
83
|
-
id: item.id,
|
|
84
|
-
type: 'string',
|
|
85
|
-
data: item
|
|
86
|
-
})), itemRenderer: itemRenderer, onChange: onChange }) }));
|
|
87
|
-
};
|
|
88
|
-
const Picker = forwardRef(({ id, items, emptyText, title, placeholder, onAdd, onCancel, target, ...restProps }, ref) => {
|
|
89
|
-
const t = useI18n();
|
|
90
|
-
const headingId = useUID();
|
|
91
|
-
const [initialItems, setItems] = useState(items);
|
|
92
|
-
const [searchInput, setSearchInput] = useState('');
|
|
93
|
-
const [selectMultipleToggle, setSelectMultipleToggle] = useState(false);
|
|
94
|
-
const filterRegex = new RegExp(searchInput.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'), 'i');
|
|
95
|
-
const [selections, setSelections] = useState([]);
|
|
96
|
-
const searchEleRef = useRef(null);
|
|
97
|
-
const selectedTasksWrapperRef = useRef(null);
|
|
98
|
-
const [pickerEl, setPickerEl] = useElement();
|
|
99
|
-
const pickerRef = useConsolidatedRef(ref, setPickerEl);
|
|
100
|
-
const toggle = useRef(null);
|
|
101
|
-
const initialRender = useRef(true);
|
|
102
|
-
const initializePicker = () => {
|
|
103
|
-
setItems(items);
|
|
104
|
-
setSelections([]);
|
|
105
|
-
setSelectMultipleToggle(false);
|
|
106
|
-
};
|
|
107
|
-
useOuterEvent('mousedown', [target, pickerRef], () => {
|
|
108
|
-
initializePicker();
|
|
109
|
-
onCancel?.();
|
|
110
|
-
});
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
setItems(items);
|
|
113
|
-
}, [items]);
|
|
114
|
-
useEffect(() => {
|
|
115
|
-
if (initialRender.current) {
|
|
116
|
-
initialRender.current = false;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
toggle.current?.focus();
|
|
120
|
-
}
|
|
121
|
-
}, [selectMultipleToggle]);
|
|
122
|
-
const onKeydown = useCallback((e) => {
|
|
123
|
-
const { key } = e;
|
|
124
|
-
if (key === 'Escape') {
|
|
125
|
-
initializePicker();
|
|
126
|
-
onCancel?.();
|
|
127
|
-
}
|
|
128
|
-
else if (key === 'Tab' && pickerEl) {
|
|
129
|
-
const focusableContent = getFocusables(pickerRef);
|
|
130
|
-
if (!focusableContent || focusableContent.length < 2)
|
|
131
|
-
return;
|
|
132
|
-
const firstFocusableElement = focusableContent[0];
|
|
133
|
-
const lastFocusableElement = focusableContent[focusableContent.length - 1];
|
|
134
|
-
if (e.shiftKey) {
|
|
135
|
-
if (document.activeElement === firstFocusableElement) {
|
|
136
|
-
lastFocusableElement.focus();
|
|
137
|
-
e.preventDefault();
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
else if (document.activeElement === lastFocusableElement) {
|
|
141
|
-
firstFocusableElement.focus();
|
|
142
|
-
e.preventDefault();
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
// when focus is in the list setting the tabindex of first element as -1 and on focusing out the tabindex to be 0
|
|
146
|
-
const focusEl = selectedTasksWrapperRef.current;
|
|
147
|
-
if (!focusEl)
|
|
148
|
-
return;
|
|
149
|
-
const focusable = Array.from(focusEl.querySelectorAll('button'));
|
|
150
|
-
if (focusable.length === 0)
|
|
151
|
-
return;
|
|
152
|
-
if (focusEl.contains(document.activeElement))
|
|
153
|
-
focusable[0].tabIndex = -1;
|
|
154
|
-
else if (focusable[0].tabIndex === -1)
|
|
155
|
-
focusable[0].tabIndex = 0;
|
|
156
|
-
}, [onCancel, pickerEl, selectMultipleToggle]);
|
|
157
|
-
useEffect(() => {
|
|
158
|
-
document.addEventListener('keydown', onKeydown);
|
|
159
|
-
return () => {
|
|
160
|
-
document.removeEventListener('keydown', onKeydown);
|
|
161
|
-
};
|
|
162
|
-
}, [pickerEl, selectMultipleToggle]);
|
|
163
|
-
const renderItems = useMemo(() => {
|
|
164
|
-
return menuHelpers.mapTree(searchInput
|
|
165
|
-
? menuHelpers
|
|
166
|
-
.flatten(initialItems)
|
|
167
|
-
.filter(({ primary, items: childItems }) => {
|
|
168
|
-
return filterRegex.test(primary) && !childItems?.length;
|
|
169
|
-
})
|
|
170
|
-
: initialItems, item => {
|
|
171
|
-
let selectable = false;
|
|
172
|
-
if (!item.items) {
|
|
173
|
-
selectable = true;
|
|
174
|
-
}
|
|
175
|
-
return {
|
|
176
|
-
...item,
|
|
177
|
-
selected: selectable ? !!item.selected : undefined
|
|
178
|
-
};
|
|
179
|
-
});
|
|
180
|
-
}, [searchInput, items, filterRegex]);
|
|
181
|
-
const removeTasks = useCallback((uid) => {
|
|
182
|
-
setItems((cur) => menuHelpers.toggleSelected(cur, uid, 'multi-select'));
|
|
183
|
-
setSelections(cur => {
|
|
184
|
-
const itemToRemove = menuHelpers.getItem(cur, uid);
|
|
185
|
-
return cur.filter(item => item.id !== itemToRemove?.id);
|
|
186
|
-
});
|
|
187
|
-
// 0 second timeout added because DOM needs to be up to date after list is updated before running query
|
|
188
|
-
// setting the focus to the first element in the list on deletion and if empty then to search input
|
|
189
|
-
setTimeout(() => {
|
|
190
|
-
const focusable = getFocusables(selectedTasksWrapperRef);
|
|
191
|
-
if (focusable.length > 0)
|
|
192
|
-
focusable[0].focus();
|
|
193
|
-
else
|
|
194
|
-
searchEleRef.current.focus();
|
|
195
|
-
}, 0);
|
|
196
|
-
}, []);
|
|
197
|
-
const toggleSelectedRegion = () => {
|
|
198
|
-
setSelectMultipleToggle(curr => !curr);
|
|
199
|
-
};
|
|
200
|
-
useArrows(selectedTasksWrapperRef, {
|
|
201
|
-
selector: 'button',
|
|
202
|
-
dir: 'up-down'
|
|
203
|
-
}, [selections.length]);
|
|
204
|
-
const pickerContent = (_jsxs(Flex, { as: StyledPicker, container: { direction: 'column' }, id: id, children: [!selectMultipleToggle && (_jsxs(CardHeader, { forwardedAs: 'div', children: [_jsx(Text, { id: headingId, variant: 'h2', children: t('add_tasks') }), _jsx(Button, { variant: 'simple', onClick: onCancel, "aria-label": t('task_picker_close'), icon: true, children: _jsx(Icon, { name: 'times' }) })] })), _jsxs(Flex, { container: true, children: [_jsx(StyledAddTasks, { children: _jsx(Menu, { items: renderItems, role: 'listbox', onItemClick: (uid) => {
|
|
205
|
-
const clickedItem = menuHelpers.getItem(renderItems, uid);
|
|
206
|
-
const parentItem = clickedItem?.ancestors
|
|
207
|
-
? clickedItem.ancestors[0]
|
|
208
|
-
: menuHelpers.getParentItem(renderItems, uid);
|
|
209
|
-
if (clickedItem) {
|
|
210
|
-
if (selectMultipleToggle) {
|
|
211
|
-
searchEleRef.current?.focus();
|
|
212
|
-
setItems((cur) => menuHelpers.toggleSelected(cur, uid, 'multi-select'));
|
|
213
|
-
if (selections.find(item => item.id === uid)) {
|
|
214
|
-
setSelections(cur => cur.filter(item => item.id !== clickedItem?.id));
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
setSelections(cur => {
|
|
218
|
-
let secondary;
|
|
219
|
-
if (parentItem)
|
|
220
|
-
secondary = menuHelpers.isItem(parentItem)
|
|
221
|
-
? parentItem.primary
|
|
222
|
-
: parentItem.label;
|
|
223
|
-
return [
|
|
224
|
-
...cur,
|
|
225
|
-
{
|
|
226
|
-
...clickedItem,
|
|
227
|
-
secondary,
|
|
228
|
-
onRemoveSelection: removeTasks
|
|
229
|
-
}
|
|
230
|
-
];
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
setSearchInput('');
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
onAdd([clickedItem]);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}, focusControlEl: searchEleRef.current || undefined, emptyText: emptyText || t('no_items'), accent: filterRegex, ...restProps, mode: selectMultipleToggle ? 'multi-select' : 'action', header: _jsxs(Flex, { container: { direction: 'column', gap: 1 }, children: [_jsx(SearchInput, { ref: searchEleRef, value: searchInput, onSearchChange: setSearchInput, placeholder: placeholder || t('search_placeholder_default'), autoFocus: true }), _jsx(Switch, { label: t('select_multiple'), on: selectMultipleToggle, onChange: toggleSelectedRegion, ref: toggle })] }), arrowNavigationUnsupported: true }) }), selectMultipleToggle && (_jsxs(Flex, { as: StyledSelectedTasks, container: { direction: 'column' }, ref: selectedTasksWrapperRef, children: [_jsx(Text, { variant: 'h3', children: t('selected_tasks') }), selections.length > 0 ? (_jsx(DraggableSelectedList, { selectedItems: selections, onChange: newItems => {
|
|
240
|
-
setSelections(newItems.map(({ type, data }) => ({
|
|
241
|
-
...data,
|
|
242
|
-
type
|
|
243
|
-
})));
|
|
244
|
-
}, itemRenderer: SelectedItemRenderer })) : (_jsx(EmptyState, { message: t('no_selected_tasks') }))] }))] })] }));
|
|
245
|
-
if (selectMultipleToggle) {
|
|
246
|
-
return (_jsx(FormDialog, { heading: t('add_tasks'), target: target, ref: pickerRef, onCancel: () => {
|
|
247
|
-
initializePicker();
|
|
248
|
-
onCancel();
|
|
249
|
-
}, onSubmit: {
|
|
250
|
-
text: t('add'),
|
|
251
|
-
disabled: !selections.length,
|
|
252
|
-
handler: () => {
|
|
253
|
-
onAdd(selections);
|
|
254
|
-
}
|
|
255
|
-
}, placement: 'bottom-start', children: pickerContent }));
|
|
256
|
-
}
|
|
257
|
-
return (_jsx(Dialog, { target: target, ref: pickerRef, labelledbyId: headingId, children: pickerContent }));
|
|
258
|
-
});
|
|
259
|
-
export default Picker;
|
|
260
|
-
//# sourceMappingURL=Picker.js.map
|