@antscorp/antsomi-ui 1.3.7-beta.2 → 1.3.7-beta.21
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/es/components/atoms/index.d.ts +0 -2
- package/es/components/atoms/index.js +0 -2
- package/es/components/molecules/TagifyInput/TagifyInput.js +48 -18
- package/es/components/molecules/TagifyInput/types.d.ts +20 -1
- package/es/components/molecules/TagifyInput/utils.d.ts +3 -1
- package/es/components/molecules/TagifyInput/utils.js +9 -0
- package/es/components/organism/ActivityTimeline/ActivityTimeline.js +3 -3
- package/es/components/organism/ActivityTimeline/components/ItemEvent/ItemEvent.js +7 -1
- package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/ItemGroupEvent.js +14 -2
- package/es/components/organism/ActivityTimeline/constants.d.ts +9 -9
- package/es/components/organism/ActivityTimeline/constants.js +3 -3
- package/es/components/organism/ActivityTimeline/index.d.ts +530 -1
- package/es/components/organism/ActivityTimeline/index.js +9 -1
- package/es/components/organism/ActivityTimeline/utils.d.ts +7 -1
- package/es/components/organism/ActivityTimeline/utils.js +10 -7
- package/es/components/organism/TextEditor/TextEditor.d.ts +8 -2
- package/es/components/organism/TextEditor/TextEditor.js +76 -3
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +3 -2
- package/es/components/organism/TextEditor/extensions/Link.js +3 -3
- package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +0 -6
- package/es/components/organism/TextEditor/extensions/SmartTag.js +3 -2
- package/es/components/organism/TextEditor/hooks/useMarkTracking.js +2 -1
- package/es/components/organism/TextEditor/index.d.ts +6 -5
- package/es/components/organism/TextEditor/stories/WithOldDynAndLink/settings.json +95 -0
- package/es/components/organism/TextEditor/types.d.ts +75 -2
- package/es/components/organism/TextEditor/types.js +1 -0
- package/es/components/organism/TextEditor/utils/documentState.d.ts +14 -0
- package/es/components/organism/TextEditor/utils/documentState.js +25 -0
- package/es/components/organism/TextEditor/utils/htmlProcessing.js +60 -0
- package/es/components/organism/TextEditor/utils/link.d.ts +10 -1
- package/es/components/organism/TextEditor/utils/link.js +161 -7
- package/es/components/organism/TextEditor/utils/menu.js +2 -1
- package/es/components/organism/TextEditor/utils/selection.js +3 -2
- package/es/components/organism/TextEditor/utils/smartTag.js +2 -1
- package/es/components/organism/index.d.ts +1 -1
- package/es/hooks/index.d.ts +1 -1
- package/es/hooks/index.js +1 -1
- package/es/services/MediaTemplateDesign/UploadFile/index.js +4 -4
- package/es/types/index.d.ts +1 -1
- package/es/types/index.js +1 -1
- package/es/utils/common.d.ts +1 -1
- package/es/utils/common.js +3 -3
- package/package.json +11 -23
|
@@ -49,8 +49,6 @@ export * from './RateV2';
|
|
|
49
49
|
export * from './Popover';
|
|
50
50
|
export * from './Iframe';
|
|
51
51
|
export * from './Avatar';
|
|
52
|
-
export * from './NotificationStatus';
|
|
53
|
-
export * from './List';
|
|
54
52
|
export * from './SelectAssociatedTag';
|
|
55
53
|
export * from './List';
|
|
56
54
|
export * from './Upload';
|
|
@@ -49,8 +49,6 @@ export * from './RateV2';
|
|
|
49
49
|
export * from './Popover';
|
|
50
50
|
export * from './Iframe';
|
|
51
51
|
export * from './Avatar';
|
|
52
|
-
export * from './NotificationStatus';
|
|
53
|
-
export * from './List';
|
|
54
52
|
export * from './SelectAssociatedTag';
|
|
55
53
|
export * from './List';
|
|
56
54
|
export * from './Upload';
|
|
@@ -17,15 +17,15 @@ import '@yaireo/tagify/dist/tagify.css';
|
|
|
17
17
|
// Styled
|
|
18
18
|
import { TagTextArea, TagifyWrapper, WrapperPlaceHolder } from './styled';
|
|
19
19
|
// Utils
|
|
20
|
-
import { parseTagStringToTagify, convertInputStringToOriginal, emojiManufacturer, getEmojiTag, isPersonalizeTagType, generateTagContent, unescapeString, hasLineBreak, selectRange, isTagClickable, findURLInTextNodes, getAttributesString, isAnchorNodeChildOfElement, isShortLinkTagType, isCustomTagType, sanitizeTagAttributes, getTagAttributes, applyTagAttributes, getTagContentAttributes, isCaretAtEndOfTextNodeWithNextTag, getCurrentSelectionAndCloneRange, handleEnterWithNextTag, handleTextNodeBackspace, } from './utils';
|
|
20
|
+
import { parseTagStringToTagify, convertInputStringToOriginal, emojiManufacturer, getEmojiTag, isPersonalizeTagType, generateTagContent, unescapeString, hasLineBreak, selectRange, isTagClickable, findURLInTextNodes, getAttributesString, isAnchorNodeChildOfElement, isShortLinkTagType, isCustomTagType, sanitizeTagAttributes, getTagAttributes, applyTagAttributes, getTagContentAttributes, isCaretAtEndOfTextNodeWithNextTag, getCurrentSelectionAndCloneRange, handleEnterWithNextTag, handleTextNodeBackspace, extractTagValues, } from './utils';
|
|
21
21
|
import { acceptablePatternChecking, detectURLRegex, getCachedRegex, getCustomTagId, getPersonalizeTagInfo, getShortLinkTagInfo, patternHandlers, } from './patternHandlers';
|
|
22
22
|
// Constants
|
|
23
23
|
import { DETECT_LINK, EMOJI, PERSONALIZE_PTN, SHORT_LINK, SHORT_LINK_PTN, SHORT_LINK_V2, TAG_TYPE, UNSUBSCRIBE_WHATSAPP, defaultCssVariables, tagifyDefaultProps, TAG_CUSTOM_ATTRIBUTES, } from './constants';
|
|
24
24
|
const { CUSTOM_TAG } = TAG_TYPE;
|
|
25
|
-
const { PREPARING_ST, INVALID_TAG, MESSAGE_TAG, FORCE_SHOW_TOOLTIP
|
|
25
|
+
const { PREPARING_ST, INVALID_TAG, MESSAGE_TAG, FORCE_SHOW_TOOLTIP } = TAG_CUSTOM_ATTRIBUTES;
|
|
26
26
|
const TagifyInput = forwardRef((props, ref) => {
|
|
27
27
|
// Props
|
|
28
|
-
const { initialValue, escapeHTML, status, readonly, readonlyTag, readonlyText, realtime, disabled, maxLength, maxHeight, minWidth, placeholder, minWidthPlaceholder, isSingleLineText, acceptableTagPattern, tagProperties, mapAttributes = {}, mapErrorAttributes = {}, maxPersonalizeTags, name, children, cssTagifyVariables, onTagClick, onTagRemove, onChange, onRestoreTagProperty, } = props;
|
|
28
|
+
const { initialValue, escapeHTML, status, readonly, readonlyTag, readonlyText, realtime, disabled, maxLength, maxHeight, minWidth, placeholder, minWidthPlaceholder, isSingleLineText, acceptableTagPattern, tagProperties, mapAttributes = {}, mapErrorAttributes = {}, maxPersonalizeTags, name, children, cssTagifyVariables, disableEditableIfContainsTags, onTagClick, onAddTag, onTagRemove, onChange, onRestoreTagProperty, onBlur, } = props;
|
|
29
29
|
// States
|
|
30
30
|
const [isLineBreak, setIsLineBreak] = useState(hasLineBreak(initialValue));
|
|
31
31
|
const [tooltipRefresher, setTooltipRefresher] = useState(1);
|
|
@@ -456,6 +456,7 @@ const TagifyInput = forwardRef((props, ref) => {
|
|
|
456
456
|
}
|
|
457
457
|
setLabelTagRefreshness(prev => prev + 1);
|
|
458
458
|
},
|
|
459
|
+
getInputValues: () => extractTagValues(tagifyRef.current),
|
|
459
460
|
}), [acceptableTagPattern, escapeHTML, onInjectTagAtCaret, placeCaretAfterNode]);
|
|
460
461
|
const onTagItemClick = useCallback((event) => {
|
|
461
462
|
event.stopPropagation();
|
|
@@ -471,7 +472,7 @@ const TagifyInput = forwardRef((props, ref) => {
|
|
|
471
472
|
}, [onTagClick]);
|
|
472
473
|
const onTagifyRemoveTag = useCallback((event) => {
|
|
473
474
|
if (event.detail && onTagRemove) {
|
|
474
|
-
onTagRemove(event.detail);
|
|
475
|
+
onTagRemove(event.detail, extractTagValues(event.detail.tagify));
|
|
475
476
|
}
|
|
476
477
|
}, [onTagRemove]);
|
|
477
478
|
// Used to trigger replace URL detection and line break
|
|
@@ -638,7 +639,7 @@ const TagifyInput = forwardRef((props, ref) => {
|
|
|
638
639
|
if (!isAccepted)
|
|
639
640
|
return;
|
|
640
641
|
const { url, shortener, label } = tagData;
|
|
641
|
-
const { label: tagLabel,
|
|
642
|
+
const { label: tagLabel, status, statusMsg, } = getShortLinkTagInfo({
|
|
642
643
|
type,
|
|
643
644
|
label,
|
|
644
645
|
shortener,
|
|
@@ -767,17 +768,6 @@ const TagifyInput = forwardRef((props, ref) => {
|
|
|
767
768
|
});
|
|
768
769
|
}
|
|
769
770
|
}, [maxLength, customizeTag]);
|
|
770
|
-
useEffect(() => {
|
|
771
|
-
if (!tagifyRef.current)
|
|
772
|
-
return;
|
|
773
|
-
const inputEl = tagifyRef.current.DOM.input;
|
|
774
|
-
if (readonlyText) {
|
|
775
|
-
inputEl.setAttribute('contenteditable', 'false');
|
|
776
|
-
}
|
|
777
|
-
else {
|
|
778
|
-
inputEl.setAttribute('contenteditable', 'true');
|
|
779
|
-
}
|
|
780
|
-
}, [readonlyText]);
|
|
781
771
|
const onTagifyWrapperClick = useCallback(event => {
|
|
782
772
|
event.preventDefault();
|
|
783
773
|
event.stopPropagation();
|
|
@@ -789,6 +779,22 @@ const TagifyInput = forwardRef((props, ref) => {
|
|
|
789
779
|
return;
|
|
790
780
|
const { classList } = DOM?.scope;
|
|
791
781
|
const { classNames } = settings;
|
|
782
|
+
if (disableEditableIfContainsTags) {
|
|
783
|
+
// Empty input is always editable
|
|
784
|
+
const isEmpty = classList.contains(classNames.empty);
|
|
785
|
+
let shouldBeEditable = isEmpty;
|
|
786
|
+
// If not empty, check if input contains restricted tags
|
|
787
|
+
if (!isEmpty) {
|
|
788
|
+
const { listTags } = extractTagValues(tagifyRef.current);
|
|
789
|
+
const hasRestrictedTag = listTags.some(tag => disableEditableIfContainsTags.includes(tag.type));
|
|
790
|
+
shouldBeEditable = !hasRestrictedTag;
|
|
791
|
+
}
|
|
792
|
+
// Apply contenteditable attribute
|
|
793
|
+
DOM.input.setAttribute('contenteditable', shouldBeEditable ? 'true' : 'false');
|
|
794
|
+
// Exit early if input should not be editable
|
|
795
|
+
if (!shouldBeEditable)
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
792
798
|
if (!classList.contains(classNames.focus) && DOM?.input) {
|
|
793
799
|
try {
|
|
794
800
|
const { lastChild } = DOM?.input;
|
|
@@ -824,6 +830,12 @@ const TagifyInput = forwardRef((props, ref) => {
|
|
|
824
830
|
}
|
|
825
831
|
}
|
|
826
832
|
}
|
|
833
|
+
}, [disableEditableIfContainsTags]);
|
|
834
|
+
const onContentEditable = useCallback((editable) => {
|
|
835
|
+
if (!tagifyRef.current)
|
|
836
|
+
return;
|
|
837
|
+
const inputEl = tagifyRef.current.DOM.input;
|
|
838
|
+
inputEl.setAttribute('contenteditable', editable ? 'true' : 'false');
|
|
827
839
|
}, []);
|
|
828
840
|
// Initialization tagify
|
|
829
841
|
useLayoutEffect(() => {
|
|
@@ -834,6 +846,11 @@ const TagifyInput = forwardRef((props, ref) => {
|
|
|
834
846
|
}
|
|
835
847
|
};
|
|
836
848
|
}, [initializeTagify]);
|
|
849
|
+
useEffect(() => {
|
|
850
|
+
if (typeof readonlyText !== 'boolean')
|
|
851
|
+
return;
|
|
852
|
+
onContentEditable(!readonlyText);
|
|
853
|
+
}, [readonlyText, onContentEditable]);
|
|
837
854
|
useEffect(() => {
|
|
838
855
|
if (tagifyRef.current && tagLength && _.isFunction(onTagRemove)) {
|
|
839
856
|
// Because the remove tag event is not triggered when the tag is removed with Backspace or drag selection tags
|
|
@@ -864,8 +881,11 @@ const TagifyInput = forwardRef((props, ref) => {
|
|
|
864
881
|
try {
|
|
865
882
|
node.dataset.__removed_by_mutation = 'true';
|
|
866
883
|
const tagData = tagifyRef.current?.getSetTagData(node);
|
|
867
|
-
if (
|
|
868
|
-
|
|
884
|
+
if (tagifyRef.current &&
|
|
885
|
+
tagData &&
|
|
886
|
+
tagData.type === CUSTOM_TAG &&
|
|
887
|
+
!tagData?.__removed) {
|
|
888
|
+
onTagRemove({ data: tagData }, extractTagValues(tagifyRef.current));
|
|
869
889
|
}
|
|
870
890
|
}
|
|
871
891
|
catch (error) {
|
|
@@ -977,6 +997,10 @@ const TagifyInput = forwardRef((props, ref) => {
|
|
|
977
997
|
tagifyInstance.on('change', onTagifyChangedDebounce);
|
|
978
998
|
tagifyInstance.on('remove', onTagifyRemoveTag);
|
|
979
999
|
tagifyInstance.on('keydown', onKeyDown);
|
|
1000
|
+
if (onAddTag)
|
|
1001
|
+
tagifyInstance.on('add', onAddTag);
|
|
1002
|
+
if (onBlur)
|
|
1003
|
+
tagifyInstance.on('blur', onBlur);
|
|
980
1004
|
}
|
|
981
1005
|
// Off listen to Tagify events
|
|
982
1006
|
return () => {
|
|
@@ -986,9 +1010,15 @@ const TagifyInput = forwardRef((props, ref) => {
|
|
|
986
1010
|
tagifyInstance.off('change', onTagifyChangedDebounce);
|
|
987
1011
|
tagifyInstance.off('remove', onTagifyRemoveTag);
|
|
988
1012
|
tagifyInstance.off('keydown', onKeyDown);
|
|
1013
|
+
if (onAddTag)
|
|
1014
|
+
tagifyInstance.off('add', onAddTag);
|
|
1015
|
+
if (onBlur)
|
|
1016
|
+
tagifyInstance.off('blur', onBlur);
|
|
989
1017
|
}
|
|
990
1018
|
};
|
|
991
1019
|
}, [
|
|
1020
|
+
onAddTag,
|
|
1021
|
+
onBlur,
|
|
992
1022
|
onTagItemClick,
|
|
993
1023
|
onInputTagifyDebounce,
|
|
994
1024
|
onTagifyChangedDebounce,
|
|
@@ -15,6 +15,10 @@ export type TagStatus = (typeof TAG_STATUS)[keyof typeof TAG_STATUS];
|
|
|
15
15
|
export type MapAttributesProps = Record<string, Record<string, any>>;
|
|
16
16
|
export type StatusType = 'error' | 'success' | 'warning';
|
|
17
17
|
export type BackgroundColorPersonalizeType = Exclude<keyof typeof TAG_COLOR, 'detect_link' | 'emoji' | 'shortlink'>;
|
|
18
|
+
export interface TagValues {
|
|
19
|
+
listTags: TagDataCustomize[];
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
18
22
|
/**
|
|
19
23
|
* Interface defining the properties for the Tagify input component.
|
|
20
24
|
* Provides configuration options and event handlers to manage Tagify's behavior and appearance.
|
|
@@ -134,11 +138,16 @@ export interface TagifyInputProps {
|
|
|
134
138
|
* Receives the tag detail as parameter, allowing custom actions on tag click.
|
|
135
139
|
*/
|
|
136
140
|
onTagClick?: (tagDetail: Tagify.ClickEventData<TagDataCustomize>) => void;
|
|
141
|
+
/**
|
|
142
|
+
* Event handler triggered when a tag is added.
|
|
143
|
+
* Receives the tag detail as parameter, allowing custom actions on tag addition.
|
|
144
|
+
*/
|
|
145
|
+
onAddTag?: (event: CustomEvent<Tagify.AddEventData<TagDataCustomize>>) => void;
|
|
137
146
|
/**
|
|
138
147
|
* Event handler triggered when a tag is removed.
|
|
139
148
|
* Receives the tag detail as parameter, allowing custom actions on tag removal.
|
|
140
149
|
*/
|
|
141
|
-
onTagRemove?: (tagDetail: Tagify.RemoveEventData<TagDataCustomize
|
|
150
|
+
onTagRemove?: (tagDetail: Tagify.RemoveEventData<TagDataCustomize>, values: TagValues) => void;
|
|
142
151
|
/**
|
|
143
152
|
* Event handler triggered when the input value changes.
|
|
144
153
|
* Receives the updated input value as a string, allowing for controlled component updates.
|
|
@@ -146,6 +155,11 @@ export interface TagifyInputProps {
|
|
|
146
155
|
* @default () => {}
|
|
147
156
|
*/
|
|
148
157
|
onChange: (inputValue: string) => void;
|
|
158
|
+
/**
|
|
159
|
+
* Event handler triggered when the input value is blurred.
|
|
160
|
+
* Receives the updated input value as a string, allowing for controlled component updates.
|
|
161
|
+
*/
|
|
162
|
+
onBlur?: (event: CustomEvent<Tagify.BlurEventData<TagDataCustomize>>) => void;
|
|
149
163
|
/**
|
|
150
164
|
* Event handler triggered when found mismatch tag properties.
|
|
151
165
|
* Receives an array of tag properties that were restored (e.g., via undo operation).
|
|
@@ -155,12 +169,17 @@ export interface TagifyInputProps {
|
|
|
155
169
|
* Defines whether the input text is read but not the whole tags.
|
|
156
170
|
*/
|
|
157
171
|
readonlyText?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Tags that, when present in input, make the entire input non-editable
|
|
174
|
+
*/
|
|
175
|
+
disableEditableIfContainsTags?: TagType[];
|
|
158
176
|
}
|
|
159
177
|
export interface TagifyInputRef {
|
|
160
178
|
onAddNewTag: (newTag: TagDataCustomize | string) => void;
|
|
161
179
|
onReplaceTag: (currentTagEle: HTMLElement, newTag: TagDataCustomize) => void;
|
|
162
180
|
onReload: (newValue: string) => void;
|
|
163
181
|
onLabelTagRefreshness: () => void;
|
|
182
|
+
getInputValues: () => TagValues;
|
|
164
183
|
}
|
|
165
184
|
export type EmojiCollection = (typeof EMOJI_COLLECTIONS)[keyof typeof EMOJI_COLLECTIONS];
|
|
166
185
|
export type ShortLinkType = (typeof SHORT_LINK_TYPE)[keyof typeof SHORT_LINK_TYPE];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="yaireo__tagify" />
|
|
2
2
|
import Tagify from '@yaireo/tagify';
|
|
3
|
-
import { AcceptablePattern, TagAttribute, EmojiCollection, EmojiTag, TagDataCustomize, TagProperty, TagType } from './types';
|
|
3
|
+
import { AcceptablePattern, TagAttribute, EmojiCollection, EmojiTag, TagDataCustomize, TagProperty, TagType, TagValues } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Parses the input string and replaces matching patterns with processed tags.
|
|
6
6
|
* This function iterates over predefined regex patterns and replaces each match
|
|
@@ -202,3 +202,5 @@ export declare const getCurrentSelectionAndCloneRange: () => {
|
|
|
202
202
|
};
|
|
203
203
|
export declare const handleTextNodeBackspace: (range: Range) => void;
|
|
204
204
|
export declare const handleEnterWithNextTag: (range: Range) => void;
|
|
205
|
+
export declare const removeInvisibleChars: (str: string) => string;
|
|
206
|
+
export declare const extractTagValues: (tagify: Tagify<TagDataCustomize>) => TagValues;
|
|
@@ -796,3 +796,12 @@ export const handleEnterWithNextTag = (range) => {
|
|
|
796
796
|
return;
|
|
797
797
|
insertZeroWidthSpaceBeforeTag(currentNode);
|
|
798
798
|
};
|
|
799
|
+
export const removeInvisibleChars = (str) => str.replace(/[\r\n\u200B-\u200D\uFEFF]/g, '');
|
|
800
|
+
export const extractTagValues = (tagify) => {
|
|
801
|
+
if (!tagify)
|
|
802
|
+
return { listTags: [], value: '' };
|
|
803
|
+
return {
|
|
804
|
+
listTags: tagify.getCleanValue(),
|
|
805
|
+
value: tagify.getInputValue(),
|
|
806
|
+
};
|
|
807
|
+
};
|
|
@@ -9,7 +9,7 @@ import { translate, translations } from '@antscorp/antsomi-locales';
|
|
|
9
9
|
import { isEmpty } from 'lodash';
|
|
10
10
|
import { differenceInMonths, formatUTCDateTZ, startOfMonth, subMonths, } from '@antscorp/antsomi-ui/es/utils/date';
|
|
11
11
|
import { getPortalTimeZone } from '@antscorp/antsomi-ui/es/utils/portal';
|
|
12
|
-
import { EmptyData } from '../../molecules';
|
|
12
|
+
import { EmptyData } from '../../molecules/EmptyData';
|
|
13
13
|
import clsx from 'clsx';
|
|
14
14
|
export const ActivityTimeline = (props) => {
|
|
15
15
|
const { timelines = [], isLoading = false, title = translate(translations._BLOCK_TIMELINE_CUS), timezone = getPortalTimeZone(), objectName = '_THIS_PERSON_UPPERCASE', onFetchMore, eventTracking: eventTrackingProp = [], header, className, } = props;
|
|
@@ -84,10 +84,10 @@ export const ActivityTimeline = (props) => {
|
|
|
84
84
|
lastRef(el);
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
if (item.data
|
|
87
|
+
if (item.data?.totalActivityCount === 1) {
|
|
88
88
|
result.push(_jsx(ItemEvent, { ref: setRef, keyItem: key, item: item, objectName: customerName, eventTracking: eventTracking }, key));
|
|
89
89
|
}
|
|
90
|
-
else if (item.data
|
|
90
|
+
else if (item.data?.totalActivityCount > 1) {
|
|
91
91
|
result.push(_jsx(ItemGroupEvent, { ref: setRef, keyItem: key, item: item, objectName: customerName, eventTracking: eventTracking }, key));
|
|
92
92
|
}
|
|
93
93
|
});
|
|
@@ -21,7 +21,13 @@ export const ItemEvent = forwardRef((props, ref) => {
|
|
|
21
21
|
const { etype: eType } = item;
|
|
22
22
|
const renderSingleEvent = (dataEvent) => {
|
|
23
23
|
const dataActivity = dataEvent.data.firstActivities;
|
|
24
|
-
const { titleEvent: title, fullContentEvent = '', infoEvent, validateExtra, perShow, limitShowSlide, } = getInfoEvent(
|
|
24
|
+
const { titleEvent: title, fullContentEvent = '', infoEvent, validateExtra, perShow, limitShowSlide, } = getInfoEvent({
|
|
25
|
+
eType,
|
|
26
|
+
itemEvent: dataActivity[0],
|
|
27
|
+
eventTracking,
|
|
28
|
+
customerName: objectName,
|
|
29
|
+
config: appConfig,
|
|
30
|
+
});
|
|
25
31
|
return (_jsxs(TimelineSection, { title: title, bgIcon: infoEvent.backgroundIcon, iconName: infoEvent.iconName, children: [_jsx(List, { type: "timeline", children: _jsxs(ListItem, { children: [_jsx(ListItemTimeLine, { children: _jsx(ListItemTitle, { ellipsis: { tooltip: true }, children: htmlParse(fullContentEvent) }) }), _jsx(ListItemTime, { ellipsis: { tooltip: true }, children: formatDateHeader(dataActivity[0].trackedDateTimeUTC) })] }) }), infoEvent.showRedeem && validateExtra.loyalty_card ? (_jsxs(WrapperContainerRedeem, { children: [_jsx(CardMember, { info: validateExtra.loyalty_card }), checkShowRedeem(validateExtra) && (_jsx(Redeem, { point: safeParse(validateExtra.point, 'N/A'), redeemType: safeParse(validateExtra.point_type, 'N/A') }))] })) : (infoEvent.showRedeem &&
|
|
26
32
|
checkShowRedeem(validateExtra) && (_jsx(Redeem, { point: safeParse(validateExtra.point, 'N/A'), redeemType: safeParse(validateExtra.point_type, 'N/A') }))), dataActivity[0].items.length > 0 && dataActivity[0].items[0].item_type === 'product' && (_jsx(ListItemContent, { children: _jsx(ActionHistory, { revenue: infoEvent.showRevenue
|
|
27
33
|
? `${safeParse(validateExtra.revenue, '--') === '--'
|
|
@@ -45,12 +45,24 @@ export const ItemGroupEvent = forwardRef((props, ref) => {
|
|
|
45
45
|
const { etype: eType } = item;
|
|
46
46
|
const renderGroupEvent = (dataEvent) => {
|
|
47
47
|
const dataActivity = dataEvent.data.firstActivities;
|
|
48
|
-
const { titleEvent: title, infoEvent: infoEventLast } = getInfoEvent(
|
|
48
|
+
const { titleEvent: title, infoEvent: infoEventLast } = getInfoEvent({
|
|
49
|
+
eType,
|
|
50
|
+
itemEvent: dataActivity[0],
|
|
51
|
+
eventTracking,
|
|
52
|
+
customerName: objectName,
|
|
53
|
+
config: appConfig,
|
|
54
|
+
});
|
|
49
55
|
const rearTitle = translate(translations._EVENT_DES_PERFORM_OTHER_EVENT, 'and performed other {{x}} actions', { x: dataActivity.length - 1 });
|
|
50
56
|
if (isEmpty(dataActivity))
|
|
51
57
|
return null;
|
|
52
58
|
return (_jsx(TimelineSection, { title: `${title}, ${rearTitle}`, bgIcon: infoEventLast.backgroundIcon, iconName: infoEventLast.iconName ? infoEventLast.iconName : 'cus web', children: _jsx(List, { type: "timeline", loadMore: true, limit: 5, noPaddingBottom: true, children: dataActivity.map((itemEvent, index) => {
|
|
53
|
-
const { titleEvent, fullContentEvent = '', infoEvent, validateExtra, perShow, limitShowSlide, } = getInfoEvent(
|
|
59
|
+
const { titleEvent, fullContentEvent = '', infoEvent, validateExtra, perShow, limitShowSlide, } = getInfoEvent({
|
|
60
|
+
eType,
|
|
61
|
+
itemEvent,
|
|
62
|
+
eventTracking,
|
|
63
|
+
customerName: objectName,
|
|
64
|
+
config: appConfig,
|
|
65
|
+
});
|
|
54
66
|
return (_jsxs(React.Fragment, { children: [_jsxs(ListItem, { children: [_jsx(ListItemTimeLine, { children: _jsx(ListItemTitle, { ellipsis: { tooltip: true }, children: htmlParse(fullContentEvent) }) }), _jsx(ListItemTime, { ellipsis: { tooltip: true }, children: formatDateHeader(itemEvent.trackedDateTimeUTC, timezone) })] }), infoEvent.showRedeem && validateExtra.loyalty_card ? (_jsxs(WrapperContainerRedeem, { children: [_jsx(CardMember, { info: validateExtra.loyalty_card }), checkShowRedeem(validateExtra) && (_jsx(Redeem, { point: safeParse(validateExtra.point, 'N/A'), redeemType: safeParse(validateExtra.point_type, 'N/A') }))] })) : (infoEvent.showRedeem &&
|
|
55
67
|
checkShowRedeem(validateExtra) && (_jsx(Redeem, { point: safeParse(validateExtra.point, 'N/A'), redeemType: safeParse(validateExtra.point_type, 'N/A') }))), itemEvent.items.length > 0 && itemEvent.items[0].item_type === 'product' && (_jsx(ListItemContent, { children: _jsx(ActionHistory, { revenue: infoEvent.showRevenue
|
|
56
68
|
? `${safeParse(validateExtra.revenue, '--') === '--'
|
|
@@ -210,7 +210,7 @@ export declare const MAP_LIST_INFO_EVENT: {
|
|
|
210
210
|
readonly 'view page': {
|
|
211
211
|
readonly eventType: "view page";
|
|
212
212
|
readonly iconCode: "_EVENT_VIEW_PAGE";
|
|
213
|
-
readonly translateCode: "
|
|
213
|
+
readonly translateCode: "_EVENT_DES_VIEW_PAGE_NEW";
|
|
214
214
|
readonly showSlideImageAndPrice: false;
|
|
215
215
|
readonly showQuantity: false;
|
|
216
216
|
readonly showRevenue: false;
|
|
@@ -353,7 +353,7 @@ export declare const MAP_LIST_INFO_EVENT: {
|
|
|
353
353
|
readonly 'view pageview': {
|
|
354
354
|
readonly eventType: "view pageview";
|
|
355
355
|
readonly iconCode: "_EVENT_VIEW_PAGE";
|
|
356
|
-
readonly translateCode: "
|
|
356
|
+
readonly translateCode: "_EVENT_DES_VIEW_PAGE_NEW";
|
|
357
357
|
readonly showSlideImageAndPrice: false;
|
|
358
358
|
readonly showQuantity: false;
|
|
359
359
|
readonly showRevenue: false;
|
|
@@ -366,7 +366,7 @@ export declare const MAP_LIST_INFO_EVENT: {
|
|
|
366
366
|
readonly 'view screenview': {
|
|
367
367
|
readonly eventType: "view screenview";
|
|
368
368
|
readonly iconCode: "";
|
|
369
|
-
readonly translateCode: "
|
|
369
|
+
readonly translateCode: "_EVENT_VIEW_SCREEN_NEW";
|
|
370
370
|
readonly showSlideImageAndPrice: false;
|
|
371
371
|
readonly showQuantity: false;
|
|
372
372
|
readonly showRevenue: false;
|
|
@@ -690,7 +690,7 @@ export declare const DATA_EVENT: {
|
|
|
690
690
|
} | {
|
|
691
691
|
readonly eventType: "view page";
|
|
692
692
|
readonly iconCode: "_EVENT_VIEW_PAGE";
|
|
693
|
-
readonly translateCode: "
|
|
693
|
+
readonly translateCode: "_EVENT_DES_VIEW_PAGE_NEW";
|
|
694
694
|
readonly showSlideImageAndPrice: false;
|
|
695
695
|
readonly showQuantity: false;
|
|
696
696
|
readonly showRevenue: false;
|
|
@@ -822,7 +822,7 @@ export declare const DATA_EVENT: {
|
|
|
822
822
|
} | {
|
|
823
823
|
readonly eventType: "view pageview";
|
|
824
824
|
readonly iconCode: "_EVENT_VIEW_PAGE";
|
|
825
|
-
readonly translateCode: "
|
|
825
|
+
readonly translateCode: "_EVENT_DES_VIEW_PAGE_NEW";
|
|
826
826
|
readonly showSlideImageAndPrice: false;
|
|
827
827
|
readonly showQuantity: false;
|
|
828
828
|
readonly showRevenue: false;
|
|
@@ -834,7 +834,7 @@ export declare const DATA_EVENT: {
|
|
|
834
834
|
} | {
|
|
835
835
|
readonly eventType: "view screenview";
|
|
836
836
|
readonly iconCode: "";
|
|
837
|
-
readonly translateCode: "
|
|
837
|
+
readonly translateCode: "_EVENT_VIEW_SCREEN_NEW";
|
|
838
838
|
readonly showSlideImageAndPrice: false;
|
|
839
839
|
readonly showQuantity: false;
|
|
840
840
|
readonly showRevenue: false;
|
|
@@ -1164,7 +1164,7 @@ export declare const DATA_EVENT: {
|
|
|
1164
1164
|
readonly 'view page': {
|
|
1165
1165
|
readonly eventType: "view page";
|
|
1166
1166
|
readonly iconCode: "_EVENT_VIEW_PAGE";
|
|
1167
|
-
readonly translateCode: "
|
|
1167
|
+
readonly translateCode: "_EVENT_DES_VIEW_PAGE_NEW";
|
|
1168
1168
|
readonly showSlideImageAndPrice: false;
|
|
1169
1169
|
readonly showQuantity: false;
|
|
1170
1170
|
readonly showRevenue: false;
|
|
@@ -1307,7 +1307,7 @@ export declare const DATA_EVENT: {
|
|
|
1307
1307
|
readonly 'view pageview': {
|
|
1308
1308
|
readonly eventType: "view pageview";
|
|
1309
1309
|
readonly iconCode: "_EVENT_VIEW_PAGE";
|
|
1310
|
-
readonly translateCode: "
|
|
1310
|
+
readonly translateCode: "_EVENT_DES_VIEW_PAGE_NEW";
|
|
1311
1311
|
readonly showSlideImageAndPrice: false;
|
|
1312
1312
|
readonly showQuantity: false;
|
|
1313
1313
|
readonly showRevenue: false;
|
|
@@ -1320,7 +1320,7 @@ export declare const DATA_EVENT: {
|
|
|
1320
1320
|
readonly 'view screenview': {
|
|
1321
1321
|
readonly eventType: "view screenview";
|
|
1322
1322
|
readonly iconCode: "";
|
|
1323
|
-
readonly translateCode: "
|
|
1323
|
+
readonly translateCode: "_EVENT_VIEW_SCREEN_NEW";
|
|
1324
1324
|
readonly showSlideImageAndPrice: false;
|
|
1325
1325
|
readonly showQuantity: false;
|
|
1326
1326
|
readonly showRevenue: false;
|
|
@@ -224,7 +224,7 @@ export const MAP_LIST_INFO_EVENT = {
|
|
|
224
224
|
'view page': {
|
|
225
225
|
eventType: 'view page',
|
|
226
226
|
iconCode: '_EVENT_VIEW_PAGE',
|
|
227
|
-
translateCode: '
|
|
227
|
+
translateCode: '_EVENT_DES_VIEW_PAGE_NEW',
|
|
228
228
|
showSlideImageAndPrice: false,
|
|
229
229
|
showQuantity: false,
|
|
230
230
|
showRevenue: false,
|
|
@@ -367,7 +367,7 @@ export const MAP_LIST_INFO_EVENT = {
|
|
|
367
367
|
'view pageview': {
|
|
368
368
|
eventType: 'view pageview',
|
|
369
369
|
iconCode: '_EVENT_VIEW_PAGE',
|
|
370
|
-
translateCode: '
|
|
370
|
+
translateCode: '_EVENT_DES_VIEW_PAGE_NEW',
|
|
371
371
|
showSlideImageAndPrice: false,
|
|
372
372
|
showQuantity: false,
|
|
373
373
|
showRevenue: false,
|
|
@@ -380,7 +380,7 @@ export const MAP_LIST_INFO_EVENT = {
|
|
|
380
380
|
'view screenview': {
|
|
381
381
|
eventType: 'view screenview',
|
|
382
382
|
iconCode: '',
|
|
383
|
-
translateCode: '
|
|
383
|
+
translateCode: '_EVENT_VIEW_SCREEN_NEW',
|
|
384
384
|
showSlideImageAndPrice: false,
|
|
385
385
|
showQuantity: false,
|
|
386
386
|
showRevenue: false,
|