@bikdotai/bik-component-library 0.0.242-beta.1 → 0.0.243-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/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTheLast.d.ts +2 -2
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTheLastAgo.d.ts +4 -0
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTheLastAgo.js +1 -0
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTwoLast.d.ts +4 -0
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -0
- package/dist/cjs/components/QueryBuilder/components/Connectors/Connector.js +1 -1
- package/dist/cjs/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.d.ts +2 -0
- package/dist/cjs/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.js +1 -0
- package/dist/cjs/components/QueryBuilder/constants/connector.d.ts +25 -9
- package/dist/cjs/components/QueryBuilder/constants/connector.js +1 -1
- package/dist/cjs/components/QueryBuilder/helpers/Connector.helper.d.ts +2 -0
- package/dist/cjs/components/QueryBuilder/helpers/Connector.helper.js +1 -1
- package/dist/cjs/components/QueryBuilder/helpers/MetaCustomProcessor.d.ts +79 -0
- package/dist/cjs/components/QueryBuilder/helpers/OperatorHelperV2.d.ts +7 -0
- package/dist/cjs/components/QueryBuilder/helpers/PropertyCustomProcessor.d.ts +28 -0
- package/dist/cjs/components/QueryBuilder/helpers/SegmentHelperV2.d.ts +140 -0
- package/dist/cjs/components/QueryBuilder/helpers/SegmentValidator.d.ts +75 -0
- package/dist/cjs/components/QueryBuilder/types/QueryBuilder.type.d.ts +1 -0
- package/dist/cjs/components/QueryBuilder/types/QueryBuilder.type.js +1 -1
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderOperator.type.d.ts +23 -6
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderOperator.type.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.d.ts +0 -6
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
- package/dist/cjs/components/keywords-input/KeywordsInput.d.ts +11 -0
- package/dist/cjs/components/keywords-input/KeywordsInput.js +1 -0
- package/dist/cjs/components/keywords-input/KeywordsInput.styled.d.ts +5 -0
- package/dist/cjs/components/keywords-input/index.d.ts +1 -0
- package/dist/cjs/components/stepper/WorkingStepper.d.ts +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTheLast.d.ts +2 -2
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTheLastAgo.d.ts +4 -0
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTheLastAgo.js +1 -0
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTwoLast.d.ts +4 -0
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -0
- package/dist/esm/components/QueryBuilder/components/Connectors/Connector.js +1 -1
- package/dist/esm/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.d.ts +2 -0
- package/dist/esm/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.js +1 -0
- package/dist/esm/components/QueryBuilder/constants/connector.d.ts +25 -9
- package/dist/esm/components/QueryBuilder/constants/connector.js +1 -1
- package/dist/esm/components/QueryBuilder/helpers/Connector.helper.d.ts +2 -0
- package/dist/esm/components/QueryBuilder/helpers/Connector.helper.js +1 -1
- package/dist/esm/components/QueryBuilder/helpers/MetaCustomProcessor.d.ts +79 -0
- package/dist/esm/components/QueryBuilder/helpers/OperatorHelperV2.d.ts +7 -0
- package/dist/esm/components/QueryBuilder/helpers/PropertyCustomProcessor.d.ts +28 -0
- package/dist/esm/components/QueryBuilder/helpers/SegmentHelperV2.d.ts +140 -0
- package/dist/esm/components/QueryBuilder/helpers/SegmentValidator.d.ts +75 -0
- package/dist/esm/components/QueryBuilder/types/QueryBuilder.type.d.ts +1 -0
- package/dist/esm/components/QueryBuilder/types/QueryBuilder.type.js +1 -1
- package/dist/esm/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/types/QueryBuilderOperator.type.d.ts +23 -6
- package/dist/esm/components/QueryBuilder/types/QueryBuilderOperator.type.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.d.ts +0 -6
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
- package/dist/esm/components/keywords-input/KeywordsInput.d.ts +11 -0
- package/dist/esm/components/keywords-input/KeywordsInput.js +1 -0
- package/dist/esm/components/keywords-input/KeywordsInput.styled.d.ts +5 -0
- package/dist/esm/components/keywords-input/index.d.ts +1 -0
- package/dist/esm/components/stepper/WorkingStepper.d.ts +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { DropdownOption } from "../../dropdown/type";
|
|
1
2
|
import { QueryBuilderConnectorType } from '../types/QueryBuilder.type';
|
|
2
3
|
import { CONNECTOR_OPERATORS } from '../types/QueryBuilderOperator.type';
|
|
3
4
|
export declare class ConnectorHelper {
|
|
4
5
|
static getConnectorType(datatype: QueryBuilderConnectorType): string[];
|
|
5
6
|
static getConnectorComponent(dataType: QueryBuilderConnectorType, connectorType: CONNECTOR_OPERATORS): "FreeText" | "NoInput" | "IntegerSingleValue" | "StringSingleValue" | "TwoNumberInputsSeperatedByAnd" | "MultiselectDropdownFreeText" | "SingleselectDropdownFreeText" | "SingleDate" | "TwoDate" | "IntegerPositiveSingle" | "NumberTime" | null;
|
|
7
|
+
static getDropdownOptionFromDataType(datatype: QueryBuilderConnectorType, defaultConnector: CONNECTOR_OPERATORS | undefined): DropdownOption[];
|
|
6
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONNECTOR_TYPE_TO_OPERATORS as
|
|
1
|
+
import{unCamelCaseWithFirstUppercase as t}from"../../../utils/unCamelCase.js";import{CONNECTOR_TYPE_TO_OPERATORS as e,CONNECTOR_TYPE_TO_COMPONENT_MAP as s}from"../constants/connector.js";import{DATE_OPERATORS_OPTIONS as o}from"../constants/DATE_OPERATORS_OPTIONS.js";import{QueryBuilderConnectorType as n}from"../types/QueryBuilder.type.js";class r{static getConnectorType(t){const s=e[t];return s?Object.keys(s):[]}static getConnectorComponent(t,o){if(e[t]){return s[t][o]}return null}static getDropdownOptionFromDataType(e,s){const r=this.getConnectorType(e);return e===n.date?o.map((t=>Object.assign(Object.assign({},t),{options:t.options.map((t=>Object.assign(Object.assign({},t),{selected:t.value===s})))}))):r.map((e=>({selected:e===s,value:e,label:t(e)})))}}export{r as ConnectorHelper};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { DATE_OPERATORS } from '../types';
|
|
2
|
+
import { QueryBuilderMeta } from '../types/QueryBuilder.type';
|
|
3
|
+
export declare const lastDaysRegexPattern: RegExp;
|
|
4
|
+
export declare const notLastDaysRegexPattern: RegExp;
|
|
5
|
+
export declare const inBetweenLast: RegExp;
|
|
6
|
+
export declare const notInBetweenLast: RegExp;
|
|
7
|
+
export declare const exactly: RegExp;
|
|
8
|
+
export declare const notExactly: RegExp;
|
|
9
|
+
export declare class MetaCustomProcessor {
|
|
10
|
+
prepareDateMeta(meta: QueryBuilderMeta): QueryBuilderMeta | {
|
|
11
|
+
value: {
|
|
12
|
+
operator: string;
|
|
13
|
+
value: any[];
|
|
14
|
+
dataType: import("../types").QueryBuilderConnectorType;
|
|
15
|
+
};
|
|
16
|
+
key: string;
|
|
17
|
+
refresh?: boolean | undefined;
|
|
18
|
+
error: {
|
|
19
|
+
key?: string | undefined;
|
|
20
|
+
value?: string | import("../types").ConnectorError | undefined;
|
|
21
|
+
};
|
|
22
|
+
} | {
|
|
23
|
+
value: {
|
|
24
|
+
operator: string;
|
|
25
|
+
value: any[];
|
|
26
|
+
offset: any[];
|
|
27
|
+
dataType: import("../types").QueryBuilderConnectorType;
|
|
28
|
+
};
|
|
29
|
+
key: string;
|
|
30
|
+
refresh?: boolean | undefined;
|
|
31
|
+
error: {
|
|
32
|
+
key?: string | undefined;
|
|
33
|
+
value?: string | import("../types").ConnectorError | undefined;
|
|
34
|
+
};
|
|
35
|
+
} | {
|
|
36
|
+
value: {
|
|
37
|
+
operator: string;
|
|
38
|
+
dataType: import("../types").QueryBuilderConnectorType;
|
|
39
|
+
value?: string | number | string[] | number[] | Date | Date[] | undefined;
|
|
40
|
+
};
|
|
41
|
+
key: string;
|
|
42
|
+
refresh?: boolean | undefined;
|
|
43
|
+
error: {
|
|
44
|
+
key?: string | undefined;
|
|
45
|
+
value?: string | import("../types").ConnectorError | undefined;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** @edit */
|
|
49
|
+
normalizeDateMeta(meta: QueryBuilderMeta): QueryBuilderMeta | {
|
|
50
|
+
value: {
|
|
51
|
+
operator: DATE_OPERATORS;
|
|
52
|
+
value: {
|
|
53
|
+
type: string | undefined;
|
|
54
|
+
start: any;
|
|
55
|
+
/** @ts-ignore offset-start is BE only type, happens in type-less way */
|
|
56
|
+
offset: any;
|
|
57
|
+
};
|
|
58
|
+
dataType: import("../types").QueryBuilderConnectorType;
|
|
59
|
+
};
|
|
60
|
+
key: string;
|
|
61
|
+
refresh?: boolean | undefined;
|
|
62
|
+
error: {
|
|
63
|
+
key?: string | undefined;
|
|
64
|
+
value?: string | import("../types").ConnectorError | undefined;
|
|
65
|
+
};
|
|
66
|
+
} | {
|
|
67
|
+
value: {
|
|
68
|
+
value: any[];
|
|
69
|
+
operator: DATE_OPERATORS;
|
|
70
|
+
dataType: import("../types").QueryBuilderConnectorType;
|
|
71
|
+
};
|
|
72
|
+
key: string;
|
|
73
|
+
refresh?: boolean | undefined;
|
|
74
|
+
error: {
|
|
75
|
+
key?: string | undefined;
|
|
76
|
+
value?: string | import("../types").ConnectorError | undefined;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseQueryBuilderNode, QueryBuilderProperty } from '../types/QueryBuilder.type';
|
|
2
|
+
export declare class OperatorHelperV2 {
|
|
3
|
+
convertBetweenOperator(property: QueryBuilderProperty): QueryBuilderProperty | QueryBuilderProperty[];
|
|
4
|
+
convertNotBetweenOperator(property: QueryBuilderProperty): QueryBuilderProperty | QueryBuilderProperty[];
|
|
5
|
+
/** @unused */
|
|
6
|
+
breakUserPropertyNodeBasedOperator(userPropertyNode: BaseQueryBuilderNode): BaseQueryBuilderNode | BaseQueryBuilderNode[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { QueryBuilderProperty } from '../types/QueryBuilder.type';
|
|
2
|
+
export declare class PropertyCustomProcessor {
|
|
3
|
+
/** @unused */
|
|
4
|
+
prepareBetween(property: QueryBuilderProperty): QueryBuilderProperty | QueryBuilderProperty[];
|
|
5
|
+
prepareBoolean(property: QueryBuilderProperty): QueryBuilderProperty;
|
|
6
|
+
prepareDate(property: QueryBuilderProperty): QueryBuilderProperty;
|
|
7
|
+
prepareInteger(property: QueryBuilderProperty): {
|
|
8
|
+
_id: string;
|
|
9
|
+
name?: string | number | undefined;
|
|
10
|
+
dataType?: import("../types/QueryBuilder.type").QueryBuilderConnectorType | undefined;
|
|
11
|
+
operator?: import("..").CONNECTOR_OPERATORS | undefined;
|
|
12
|
+
value?: import("..").CONNECTOR_VALUE_TYPE;
|
|
13
|
+
_refresh?: boolean | undefined;
|
|
14
|
+
error: {
|
|
15
|
+
name?: string | undefined;
|
|
16
|
+
dataType?: string | undefined;
|
|
17
|
+
operator?: string | undefined;
|
|
18
|
+
value?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
prepareIsAndIsNot(property: QueryBuilderProperty): QueryBuilderProperty;
|
|
22
|
+
/** @edit */
|
|
23
|
+
normalizeIsAndIsNotOperator(property: QueryBuilderProperty): QueryBuilderProperty;
|
|
24
|
+
/** @edit */
|
|
25
|
+
normalizeBoolean(property: QueryBuilderProperty): QueryBuilderProperty;
|
|
26
|
+
/** @edit */
|
|
27
|
+
normalizeInteger(property: QueryBuilderProperty): QueryBuilderProperty;
|
|
28
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { QueryBuilderMeta, QueryBuilderRoot } from '../types';
|
|
2
|
+
import { QueryBuilderType } from '../types/QueryBuilder.type';
|
|
3
|
+
type SegmentBuilder = {
|
|
4
|
+
exclude?: QueryBuilderRoot;
|
|
5
|
+
include: QueryBuilderRoot;
|
|
6
|
+
name?: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* @frontend
|
|
10
|
+
*/
|
|
11
|
+
export declare class SegmentHelperV2 {
|
|
12
|
+
private prepareNode;
|
|
13
|
+
prepare(v2: SegmentBuilder): SegmentBuilder;
|
|
14
|
+
private editNode;
|
|
15
|
+
edit(v2: SegmentBuilder): {
|
|
16
|
+
name: string | undefined;
|
|
17
|
+
include: {
|
|
18
|
+
nodes: {
|
|
19
|
+
metas: (QueryBuilderMeta | {
|
|
20
|
+
value: {
|
|
21
|
+
operator: import("../types").DATE_OPERATORS;
|
|
22
|
+
value: {
|
|
23
|
+
type: string | undefined;
|
|
24
|
+
start: any;
|
|
25
|
+
offset: any;
|
|
26
|
+
};
|
|
27
|
+
dataType: import("../types").QueryBuilderConnectorType;
|
|
28
|
+
};
|
|
29
|
+
key: string;
|
|
30
|
+
refresh?: boolean | undefined;
|
|
31
|
+
error: {
|
|
32
|
+
key?: string | undefined;
|
|
33
|
+
value?: string | import("../types").ConnectorError | undefined;
|
|
34
|
+
};
|
|
35
|
+
} | {
|
|
36
|
+
value: {
|
|
37
|
+
value: any[];
|
|
38
|
+
operator: import("../types").DATE_OPERATORS;
|
|
39
|
+
dataType: import("../types").QueryBuilderConnectorType;
|
|
40
|
+
};
|
|
41
|
+
key: string;
|
|
42
|
+
refresh?: boolean | undefined;
|
|
43
|
+
error: {
|
|
44
|
+
key?: string | undefined;
|
|
45
|
+
value?: string | import("../types").ConnectorError | undefined;
|
|
46
|
+
};
|
|
47
|
+
})[];
|
|
48
|
+
properties: import("../types").QueryBuilderPropertyType[];
|
|
49
|
+
_id: string;
|
|
50
|
+
type: QueryBuilderType;
|
|
51
|
+
isExclude?: boolean | undefined;
|
|
52
|
+
PropertyOperator?: import("../types").QueryBuilderJoinOperators | undefined;
|
|
53
|
+
}[];
|
|
54
|
+
operator: import("../types").QueryBuilderJoinOperators | undefined;
|
|
55
|
+
};
|
|
56
|
+
exclude: {
|
|
57
|
+
nodes: {
|
|
58
|
+
metas: (QueryBuilderMeta | {
|
|
59
|
+
value: {
|
|
60
|
+
operator: import("../types").DATE_OPERATORS;
|
|
61
|
+
value: {
|
|
62
|
+
type: string | undefined;
|
|
63
|
+
start: any;
|
|
64
|
+
offset: any;
|
|
65
|
+
};
|
|
66
|
+
dataType: import("../types").QueryBuilderConnectorType;
|
|
67
|
+
};
|
|
68
|
+
key: string;
|
|
69
|
+
refresh?: boolean | undefined;
|
|
70
|
+
error: {
|
|
71
|
+
key?: string | undefined;
|
|
72
|
+
value?: string | import("../types").ConnectorError | undefined;
|
|
73
|
+
};
|
|
74
|
+
} | {
|
|
75
|
+
value: {
|
|
76
|
+
value: any[];
|
|
77
|
+
operator: import("../types").DATE_OPERATORS;
|
|
78
|
+
dataType: import("../types").QueryBuilderConnectorType;
|
|
79
|
+
};
|
|
80
|
+
key: string;
|
|
81
|
+
refresh?: boolean | undefined;
|
|
82
|
+
error: {
|
|
83
|
+
key?: string | undefined;
|
|
84
|
+
value?: string | import("../types").ConnectorError | undefined;
|
|
85
|
+
};
|
|
86
|
+
})[];
|
|
87
|
+
properties: import("../types").QueryBuilderPropertyType[];
|
|
88
|
+
_id: string;
|
|
89
|
+
type: QueryBuilderType;
|
|
90
|
+
isExclude?: boolean | undefined;
|
|
91
|
+
PropertyOperator?: import("../types").QueryBuilderJoinOperators | undefined;
|
|
92
|
+
}[];
|
|
93
|
+
operator: import("../types").QueryBuilderJoinOperators | undefined;
|
|
94
|
+
};
|
|
95
|
+
} | {
|
|
96
|
+
name: string | undefined;
|
|
97
|
+
include: {
|
|
98
|
+
nodes: {
|
|
99
|
+
metas: (QueryBuilderMeta | {
|
|
100
|
+
value: {
|
|
101
|
+
operator: import("../types").DATE_OPERATORS;
|
|
102
|
+
value: {
|
|
103
|
+
type: string | undefined;
|
|
104
|
+
start: any;
|
|
105
|
+
offset: any;
|
|
106
|
+
};
|
|
107
|
+
dataType: import("../types").QueryBuilderConnectorType;
|
|
108
|
+
};
|
|
109
|
+
key: string;
|
|
110
|
+
refresh?: boolean | undefined;
|
|
111
|
+
error: {
|
|
112
|
+
key?: string | undefined;
|
|
113
|
+
value?: string | import("../types").ConnectorError | undefined;
|
|
114
|
+
};
|
|
115
|
+
} | {
|
|
116
|
+
value: {
|
|
117
|
+
value: any[];
|
|
118
|
+
operator: import("../types").DATE_OPERATORS;
|
|
119
|
+
dataType: import("../types").QueryBuilderConnectorType;
|
|
120
|
+
};
|
|
121
|
+
key: string;
|
|
122
|
+
refresh?: boolean | undefined;
|
|
123
|
+
error: {
|
|
124
|
+
key?: string | undefined;
|
|
125
|
+
value?: string | import("../types").ConnectorError | undefined;
|
|
126
|
+
};
|
|
127
|
+
})[];
|
|
128
|
+
properties: import("../types").QueryBuilderPropertyType[];
|
|
129
|
+
_id: string;
|
|
130
|
+
type: QueryBuilderType;
|
|
131
|
+
isExclude?: boolean | undefined;
|
|
132
|
+
PropertyOperator?: import("../types").QueryBuilderJoinOperators | undefined;
|
|
133
|
+
}[];
|
|
134
|
+
operator: import("../types").QueryBuilderJoinOperators | undefined;
|
|
135
|
+
};
|
|
136
|
+
exclude?: undefined;
|
|
137
|
+
};
|
|
138
|
+
containsError(v2: SegmentBuilder): string | undefined;
|
|
139
|
+
}
|
|
140
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { QueryBuilderRoot } from '../types';
|
|
2
|
+
import { QueryBuilderConnector, QueryBuilderMeta, QueryBuilderProperty } from '../types/QueryBuilder.type';
|
|
3
|
+
type SegmentBuilder = {
|
|
4
|
+
exclude?: QueryBuilderRoot;
|
|
5
|
+
include: QueryBuilderRoot;
|
|
6
|
+
name?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const POSITIVE_VAL_ERROR = "Please enter a positive integer";
|
|
9
|
+
export declare const NON_ZERO_VAL = "Enter a positive value";
|
|
10
|
+
export declare const INTEGER_ERROR = "Please enter an integer";
|
|
11
|
+
export declare const REQUIRED_VALUE = "Required field";
|
|
12
|
+
export declare const NON_DECIMAL_NUMBER = "Please enter a non-decimal number";
|
|
13
|
+
export declare const COMMA_SEPERATED_VALUES = "Please enter values seperated by commas";
|
|
14
|
+
export declare const LESS_THAN_180_DAYS = "Please enter values less than 180 days";
|
|
15
|
+
export declare class SegmentValidator {
|
|
16
|
+
validate(stateArg: SegmentBuilder): (boolean | {
|
|
17
|
+
include: QueryBuilderRoot;
|
|
18
|
+
exclude?: QueryBuilderRoot | undefined;
|
|
19
|
+
name?: string | undefined;
|
|
20
|
+
})[];
|
|
21
|
+
validateMeta(meta: QueryBuilderMeta, onErr?: () => void): {
|
|
22
|
+
error: {
|
|
23
|
+
value: {
|
|
24
|
+
value: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
key: string;
|
|
28
|
+
value: string | QueryBuilderConnector;
|
|
29
|
+
refresh?: boolean | undefined;
|
|
30
|
+
} | {
|
|
31
|
+
error: {
|
|
32
|
+
value: string;
|
|
33
|
+
};
|
|
34
|
+
key: string;
|
|
35
|
+
value: string | QueryBuilderConnector;
|
|
36
|
+
refresh?: boolean | undefined;
|
|
37
|
+
} | {
|
|
38
|
+
error: undefined;
|
|
39
|
+
key: string;
|
|
40
|
+
value: string | QueryBuilderConnector;
|
|
41
|
+
refresh?: boolean | undefined;
|
|
42
|
+
};
|
|
43
|
+
validateProperty(property: QueryBuilderProperty, onErr?: () => void): {
|
|
44
|
+
error: {
|
|
45
|
+
name: string;
|
|
46
|
+
value?: undefined;
|
|
47
|
+
};
|
|
48
|
+
_id: string;
|
|
49
|
+
name?: string | number | undefined;
|
|
50
|
+
dataType?: import("../types").QueryBuilderConnectorType | undefined;
|
|
51
|
+
operator?: import("../types").CONNECTOR_OPERATORS | undefined;
|
|
52
|
+
value?: import("../types").CONNECTOR_VALUE_TYPE;
|
|
53
|
+
_refresh?: boolean | undefined;
|
|
54
|
+
} | {
|
|
55
|
+
error: {
|
|
56
|
+
value: string;
|
|
57
|
+
name?: undefined;
|
|
58
|
+
};
|
|
59
|
+
_id: string;
|
|
60
|
+
name?: string | number | undefined;
|
|
61
|
+
dataType?: import("../types").QueryBuilderConnectorType | undefined;
|
|
62
|
+
operator?: import("../types").CONNECTOR_OPERATORS | undefined;
|
|
63
|
+
value?: import("../types").CONNECTOR_VALUE_TYPE;
|
|
64
|
+
_refresh?: boolean | undefined;
|
|
65
|
+
} | {
|
|
66
|
+
error: undefined;
|
|
67
|
+
_id: string;
|
|
68
|
+
name?: string | number | undefined;
|
|
69
|
+
dataType?: import("../types").QueryBuilderConnectorType | undefined;
|
|
70
|
+
operator?: import("../types").CONNECTOR_OPERATORS | undefined;
|
|
71
|
+
value?: import("../types").CONNECTOR_VALUE_TYPE;
|
|
72
|
+
_refresh?: boolean | undefined;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e,i,E;!function(e){e.SEGMENT_FILTER="SEGMENT_FILTER",e.EVENT_FILTER="EVENT_FILTER",e.NO_EVENT_FILTER="NO_EVENT_FILTER",e.USER_PROPERTY_FILTER="USER_PROPERTY_FILTER",e.IG_TRIGGER="IG_TRIGGER",e.CTWA_TRIGGER="CTWA_TRIGGER",e.EVENTS_TRIGGER="EVENTS_TRIGGER"}(e||(e={})),function(e){e.AND="AND",e.OR="OR"}(i||(i={})),function(e){e.string="string",e.string_restricted="string_restricted",e.integer="integer",e.boolean="boolean",e.date="date",e.frequency="frequency",e.anyIg="anyIg",e.anyAd="anyAd",e.specificPost="specificPost",e.specificReel="specificReel",e.specificStory="specificStory",e.reaction="reaction",e.activityString="activityString",e.specificAd="specificAd",e.iceBreaker="iceBreaker"}(E||(E={}));export{E as QueryBuilderConnectorType,i as QueryBuilderJoinOperators,e as QueryBuilderType};
|
|
@@ -41,7 +41,7 @@ export type ConnectorProps = {
|
|
|
41
41
|
disabled?: boolean;
|
|
42
42
|
onSearch?: (searchKey: string) => Promise<DropdownOption[]>;
|
|
43
43
|
};
|
|
44
|
-
export type CONNECTOR_VALUE_TYPE = string[] | number | Date[] | Date | number[] | number | undefined | /** for multiselect */ QueryBuilderAPIData[] | IG_VALUE[];
|
|
44
|
+
export type CONNECTOR_VALUE_TYPE = object | string[] | string | number | Date[] | Date | number[] | number | undefined | /** for multiselect */ QueryBuilderAPIData[] | IG_VALUE[];
|
|
45
45
|
type IG_VALUE = {
|
|
46
46
|
imageUrl: string;
|
|
47
47
|
redirectionUrl: string;
|
|
@@ -22,6 +22,14 @@ export declare enum STRING_OPERATORS {
|
|
|
22
22
|
exists = "exists",
|
|
23
23
|
doesntExist = "doesntExist"
|
|
24
24
|
}
|
|
25
|
+
export declare enum STRING_RESTRICTED_OPERATORS {
|
|
26
|
+
contains = "contains",
|
|
27
|
+
doesntContain = "doesntContain",
|
|
28
|
+
startsWith = "startsWith",
|
|
29
|
+
endsWith = "endsWith",
|
|
30
|
+
exists = "exists",
|
|
31
|
+
doesntExist = "doesntExist"
|
|
32
|
+
}
|
|
25
33
|
export declare enum IG_STRING_OPERATORS {
|
|
26
34
|
any = "any",
|
|
27
35
|
is = "is",
|
|
@@ -48,18 +56,27 @@ export declare enum REACTION_OPERATORS {
|
|
|
48
56
|
contains = "contains"
|
|
49
57
|
}
|
|
50
58
|
export declare enum DATE_OPERATORS {
|
|
59
|
+
today = "today",
|
|
60
|
+
yesterday = "yesterday",
|
|
61
|
+
'last 7 days' = "last 7 days",
|
|
62
|
+
'last 30 days' = "last 30 days",
|
|
63
|
+
'this week' = "this week",
|
|
64
|
+
'last week' = "last week",
|
|
65
|
+
'this month' = "this month",
|
|
66
|
+
'last month' = "last month",
|
|
67
|
+
'exactly' = "exactly",
|
|
68
|
+
'not exactly' = "not exactly",
|
|
69
|
+
'in the last' = "in the last",
|
|
70
|
+
'not in the last' = "not in the last",
|
|
71
|
+
'in between last' = "in between last",
|
|
72
|
+
'not in between last' = "not in between last",
|
|
51
73
|
on = "on",
|
|
52
74
|
notOn = "notOn",
|
|
53
75
|
inBetween = "inBetween",
|
|
54
76
|
notInBetween = "notInBetween",
|
|
55
77
|
before = "before",
|
|
56
78
|
after = "after",
|
|
57
|
-
|
|
58
|
-
yesterday = "yesterday",
|
|
59
|
-
'last week' = "last week",
|
|
60
|
-
'last month' = "last month",
|
|
61
|
-
'last quarter' = "last quarter",
|
|
62
|
-
'in the last' = "in the last"
|
|
79
|
+
'last quarter' = "last quarter"
|
|
63
80
|
}
|
|
64
81
|
export declare enum BOOLEAN_OPERATORS {
|
|
65
82
|
isTrue = "isTrue",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,
|
|
1
|
+
var t,e,n,s,i,a,o,l,r,u,d,c,h,x;!function(t){t.is="is",t.isNot="isNot",t.exists="exists",t.doesntExist="doesntExist",t.lessThan="lessThan",t.lessThanOrEqualTo="lessThanOrEqualTo",t.greaterThan="greaterThan",t.greaterThanOrEqualTo="greaterThanOrEqualTo"}(t||(t={})),function(t){t.is="is",t.isNot="isNot",t.contains="contains",t.doesntContain="doesntContain",t.startsWith="startsWith",t.endsWith="endsWith",t.exists="exists",t.doesntExist="doesntExist"}(e||(e={})),function(t){t.contains="contains",t.doesntContain="doesntContain",t.startsWith="startsWith",t.endsWith="endsWith",t.exists="exists",t.doesntExist="doesntExist"}(n||(n={})),function(t){t.any="any",t.is="is",t.contains="contains",t.startsWith="startsWith",t.endsWith="endsWith"}(s||(s={})),function(t){t.is="is"}(i||(i={})),function(t){t.in="in"}(a||(a={})),function(t){t.is="is"}(o||(o={})),function(t){t.in="in"}(l||(l={})),function(t){t.in="in"}(r||(r={})),function(t){t.contains="contains"}(u||(u={})),function(t){t.today="today",t.yesterday="yesterday",t["last 7 days"]="last 7 days",t["last 30 days"]="last 30 days",t["this week"]="this week",t["last week"]="last week",t["this month"]="this month",t["last month"]="last month",t.exactly="exactly",t["not exactly"]="not exactly",t["in the last"]="in the last",t["not in the last"]="not in the last",t["in between last"]="in between last",t["not in between last"]="not in between last",t.on="on",t.notOn="notOn",t.inBetween="inBetween",t.notInBetween="notInBetween",t.before="before",t.after="after",t["last quarter"]="last quarter"}(d||(d={})),function(t){t.isTrue="isTrue",t.isFalse="isFalse",t.exists="exists",t.doesntExist="doesntExist"}(c||(c={})),function(t){t.exactly="exactly",t.atleast="atleast",t.atMost="atMost"}(h||(h={})),function(t){t.FreeText="FreeText",t.NoInput="NoInput",t.IntegerSingleValue="IntegerSingleValue",t.StringSingleValue="StringSingleValue",t.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",t.MultiselectDropdownFreeText="MultiselectDropdownFreeText",t.SingleselectDropdownFreeText="SingleselectDropdownFreeText",t.SingleDate="SingleDate",t.TwoDate="TwoDate",t.IntegerPositiveSingle="IntegerPositiveSingle",t.NumberTime="NumberTime"}(x||(x={}));export{i as AD_STRING_OPERATORS,r as ANY_AD_OPERATORS,l as ANY_IG_OPERATORS,c as BOOLEAN_OPERATORS,d as DATE_OPERATORS,x as EVENT_VALUES,h as FREQUENCY_OPERATORS,o as ICE_BREAKER_OPERATORS,s as IG_STRING_OPERATORS,t as INTEGER_OPERATORS,u as REACTION_OPERATORS,a as SPECIFIC_IG_OPERATORS,e as STRING_OPERATORS,n as STRING_RESTRICTED_OPERATORS};
|
|
@@ -22,12 +22,7 @@ export interface AnalyticsDropdownInterface {
|
|
|
22
22
|
onOptionSelected: (chosen: DropdownOptions & {
|
|
23
23
|
selectedRange?: [Date, Date];
|
|
24
24
|
}) => void;
|
|
25
|
-
maxHeight?: string;
|
|
26
25
|
backgroundColor?: string;
|
|
27
|
-
calendarPopperConfig?: {
|
|
28
|
-
offsetSkid?: number;
|
|
29
|
-
offsetDistance?: number;
|
|
30
|
-
};
|
|
31
26
|
}
|
|
32
27
|
export declare const AnalyticsDropdown: React.FC<AnalyticsDropdownInterface>;
|
|
33
28
|
export declare const EachItem: React.FC<{
|
|
@@ -35,6 +30,5 @@ export declare const EachItem: React.FC<{
|
|
|
35
30
|
selectedOption: DropdownOptions | undefined;
|
|
36
31
|
selectedDate: Date[] | undefined;
|
|
37
32
|
onClickingEachItem: (optionSelected: DropdownOptions) => void;
|
|
38
|
-
rangeSelection?: boolean;
|
|
39
33
|
}>;
|
|
40
34
|
export declare const formatDate: (dateVal: Date) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as o,jsxs as n}from"react/jsx-runtime";import{useState as t,useEffect as i}from"react";import{Dropdown as l}from"react-bootstrap";import{BASE_COLORS as s}from"../../constants/Theme.js";import{DatePicker as a}from"../datePicker/DatePicker.js";import{BodySecondary as d,BodyCaption as c}from"../TypographyStyle.js";import{MainDropdown as r,ItemMenuContainer as g}from"./CommonStyles.js";const
|
|
1
|
+
import{jsx as e,Fragment as o,jsxs as n}from"react/jsx-runtime";import{useState as t,useEffect as i}from"react";import{Dropdown as l}from"react-bootstrap";import{BASE_COLORS as s}from"../../constants/Theme.js";import{DatePicker as a}from"../datePicker/DatePicker.js";import{BodySecondary as d,BodyCaption as c}from"../TypographyStyle.js";import{MainDropdown as r,ItemMenuContainer as g}from"./CommonStyles.js";const m=s=>{let{options:c,placeholder:g="Select an option",selected:m,onOptionSelected:v,resetDropdown:O,backgroundColor:h}=s;var b,y,D;const[k,j]=t(!1),[S,w]=t(m),[C,R]=t(),[f,T]=t(!1),$=()=>{!k&&T(!f)},[x,N]=t(m);return i((()=>{O&&w(void 0)}),[O]),i((()=>{var e;(null==m?void 0:m.isCustom)&&(null===(e=m.dateRangeSelectionOptions)||void 0===e?void 0:e.selectedDates)?R(m.dateRangeSelectionOptions.selectedDates):m&&w(m)}),[m]),e(o,{children:n(r,Object.assign({drop:"down",show:f,onToggle:$,backgroundColor:h},{children:[e(l.Toggle,Object.assign({id:"dropdown-autoclose-outside",className:"main--dropdown"},{children:e(d,{children:(null==S?void 0:S.isCustom)?C?p(C[0])===p(C[1])?`${p(C[0])}`:`${p(C[0])} to ${p(C[1])}`:null==x?void 0:x.label:S?null==S?void 0:S.label:g})})),e(l.Menu,Object.assign({className:"main--dropdown"},{children:n(r,Object.assign({drop:"end",id:"sub--dropdown",show:k,onToggle:e=>{!e&&T(!1),j(!k)}},{children:[c.map((o=>e("div",{children:(null==o?void 0:o.isCustom)?e(l.Toggle,Object.assign({className:"sub--dropdown"},{children:e(u,{eachOption:o,selectedOption:S,selectedDate:C,onClickingEachItem:e=>{w(e),j(!0)}})})):e(u,{eachOption:o,selectedOption:S,selectedDate:C,onClickingEachItem:e=>{if(w(e),N(e),$(),!e.noOfDays)return void v(e);const o=new Date,n=new Date;n.setDate(o.getDate()-e.noOfDays),v(Object.assign(Object.assign({},e),{selectedRange:[n,o]}))}})},null==o?void 0:o.key))),e(l.Menu,Object.assign({className:"sub--dropdown"},{children:e(a,{selectRange:(null===(b=null==S?void 0:S.dateRangeSelectionOptions)||void 0===b?void 0:b.selectRange)||!1,maxDate:null===(y=null==S?void 0:S.dateRangeSelectionOptions)||void 0===y?void 0:y.maxDate,minDate:null===(D=null==S?void 0:S.dateRangeSelectionOptions)||void 0===D?void 0:D.minDate,selectedDates:C,onSelectRange:(e,o)=>{const n=[e,o];(null==S?void 0:S.dateRangeSelectionOptions)&&(S.dateRangeSelectionOptions.selectedDates=n,v(Object.assign(Object.assign({},S),{selectedRange:[e,o]}))),N(S),j(!1),R(n),T(!f)}})}))]}))}))]}))})},u=o=>{let{eachOption:t,selectedOption:i,selectedDate:l,onClickingEachItem:a}=o;return n(g,Object.assign({onClick:()=>a(t),isSelected:t.isCustom?t.key==(null==i?void 0:i.key)&&!!l:t.key==(null==i?void 0:i.key)},{children:[e(d,Object.assign({color:t.key==(null==i?void 0:i.key)?s.positive[900]:s.grayscale[900]},{children:t.label})),l&&(null==i?void 0:i.isCustom)&&t.key==(null==i?void 0:i.key)&&e(c,{children:`${p(l[0])} to ${p(l[1])}`})]}),t.key)},p=e=>e.toLocaleString("default",{day:"numeric",month:"short",year:"numeric"});export{m as AnalyticsDropdown,u as EachItem,p as formatDate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@emotion/styled/base";import{jsx as o,Fragment as e,jsxs as g}from"react/jsx-runtime";import I from"../../../../utils/StringUtils.js";import{COLORS as i}from"../../../../constants/Theme.js";import{useState as r,useEffect as C}from"react";import"../../../checkBox/CheckBox.styled.js";import{TitleMedium as s}from"../../../TypographyStyle.js";import"../../../list-item/ListItem.js";import"../../../pagination/Pagination.js";import"../../../radioButton/RadioButton.styled.js";import"react-toastify";import"../../../toaster/Toaster.styled.js";import"@tippyjs/react";import"../../../tooltips/TooltipInternal.js";import"../../../spinner/Spinner.js";import"../../../stepper/Stepper.styled.js";import"../../../tag/Tag.js";import"../../../icon-button/IconButton.js";import"../../../template-preview/TemplatePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../../template-preview/models/TemplateMeta.js";import"../../../modals/styledModal.js";import"../../../template-preview/models/Channels.js";import"../../../template-context-mapper/context/templateModalContext.js";import"../../../template-context-mapper/modalElements/Footer.js";import"../../../template-context-mapper/modalElements/Body.js";import"../../../template-context-mapper/modalElements/Header.js";import"../../../zeroState/ZeroState.js";import"../../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../../button/Button.js";import"../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../../../input/Input.js";import"react-bootstrap";import"../../../floating-action-button/FloatingActionButton.styles.js";import"../../../image-compress/ImageCompress.js";import"../../../progress-bar/ProgressBarComponent.js";import"../../../QueryBuilder/QueryBuilder.js";import"../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";import"../../../QueryBuilder/constants/connectorPosition.js";import"../../../QueryBuilder/constants/connector.js";import"../../../QueryBuilder/types/QueryBuilder.type.js";import"../../../dropdown/Dropdown.js";import"../../../QueryBuilder/components/InputLoader.js";import"../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js";import"react-chips";import"../../../input/ChipInput.styled.js";import"../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js";import"../../../QueryBuilder/components/Connectors/Components/IgPicker.js";import"../../../QueryBuilder/components/Connectors/Components/InTheLast.js";import"react-calendar";import"../../../../utils/DateUtils.js";import"../../../datePicker/DatePickerWrapper.styled.js";import"../../../QueryBuilder/components/Connectors/Connector.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js";import"../../../QueryBuilder/redux/queryBuilder.reducer.js";import"../../../QueryBuilder/redux/queryBuilderCache.reducer.js";import"../../../QueryBuilder/types/QueryBuilderOperator.type.js";import"../../../dropdown/DropdownPopover/index.js";import"../../../dropdown/MenuItem/MenuItem.js";import"../../../shimmer/ShimmerComponent/ShimmerStyled.js";import"../../../analytics-card/AnalyticsCard.styled.js";import"../../CommonStyles.js";import"../../../datePicker/DatePicker.styled.js";import"../../AnalyticsMetric.js";import"../LineChart/LineChart.js";import"../linearChipGroupedChart/LinearChipGroupedChart.styled.js";import{PieChart as c}from"./PieChart.js";import"../HorizontalBarGraph/HorizontalGraph.js";import"../StackedBarChart/StackedBarChart.js";import"../VerticalBarGraph/VerticalGraph.js";import"../heatmap/HeatMap.js";import"../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";import"../../../avatar/Avatar.js";import"../../../avatar/AvatarHelper.js";import"../../../alerts/Alert.styled.js";import"../../../alerts/AlertHelper.js";import"../../../thumbnail/Thumbnail.js";import"../../../curtain/Curtain.styled.js";import"../../../curtain/CurtainHelper.js";import"../../../switch/Switch.js";import"../../../plans/SubscriptionPlanStyled.js";import"../../../plans/SubscriptionPlanSelector.js";import"../../../tabs/Tabs.js";import"../../../TablePagination/TablePagination.styled.js";import"../../../TablePagination/TablePaginationCard.js";import"../../../states/StateComponent.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditor.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js";import"../../../card-selection-modal/CardSelectionModal.styled.js";import"react-image-crop";import"../../../buttonGroup/ButtonGroupStyle.js";import"../../../accordion/Accordion.style.js";import"../../../accordion/AccordionArrow.js";import"../../../file-uploader/FileUploaderStyle.js";import"../../../colourInput/ColourInput.styled.js";import"../../../bik-layout/CommonStyles.js";import"../../../bik-layout/SidebarStyles.js";import"date-fns";import"react-popper";import"../../../dropdown/Common.styled.js";import"../../../custom-date-time/CustomDateTime.styled.js";import"../../../../node_modules/lodash.debounce/index.js";import"../../../product-picker/ProductPicker.styled.js";import"../../../discount-modal/type.js";import"../../../discount-modal/DiscountModal.styled.js";import"../../../discount-modal/DynamicCoupon/DynamicCoupon.js";import"../../../discount-modal/CouponExpiration/CouponExpiration.js";import"../../../country-code-picker/CountryCodePicker.styled.js";import"../../../product-picker-v2/emptyState.js";import"../../../product-picker-v2/style.js";import"lodash";import"../../../carousel/carousel.js";import"../../../carousel-secondary/CarouselSecondary.style.js";import"../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js";import"../../../radioList/RadioList.styled.js";import"../../../checkList/CheckList.styled.js";import"../../../postPicker/postPicker.js";import"../../../dropdown-button/DropdownButton.style.js";import"react-dom";import"../../../side-modal/SideModal.style.js";import{Chart as p,ArcElement as A,Legend as l}from"chart.js";import{Doughnut as a}from"react-chartjs-2";p.register(A,l);const d={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:t=>{if(!t.label)return" 0%";const o=t.dataset.data.reduce(((t,o)=>t+o),0),e=parseFloat((t.raw/o*100).toFixed(1));return` ${t.label}: ${e}%`}}}}},m=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],n=t("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(t=>i.surface.standard),";border:1px solid ",(t=>i.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQzhCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfan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gICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgfSwgW3NsaWNlc10pO1xyX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aXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */")),b=t=>o(n,Object.assign({style:{padding:24}},{children:t.children})),u=t=>{let{title:i,slices:p,size:A}=t;const[l,n]=r([]),[b,u]=r();return C((()=>{const t=p.reduce(((t,o)=>t+o.count),0);let o=[];if(o=Object.keys(p).map(((t,o)=>Object.assign({color:m[o%m.length]},p[t]))),n([...o]),0===t){u({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const t={labels:p.map((t=>I.capitalize(t.name))),datasets:[{data:p.map((t=>t.count)),backgroundColor:p.map(((t,o)=>{var e;return null!==(e=t.color)&&void 0!==e?e:m[o%m.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};u(t)}}),[p]),b?g(e,{children:[i&&o(s,Object.assign({style:{marginBottom:16}},{children:i})),g("div",Object.assign({className:"row"},{children:[o("div",Object.assign({className:"col-6"},{children:o("div",Object.assign({style:{width:A,height:A}},{children:o(a,{data:b,options:Object.assign(Object.assign({},d),{maintainAspectRatio:!A})})}))})),o("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:o(c,{slices:l})}))]}))]}):o(e,{})};export{b as Card,u as PieChartAnalytics};
|
|
1
|
+
import t from"@emotion/styled/base";import{jsx as o,Fragment as e,jsxs as g}from"react/jsx-runtime";import I from"../../../../utils/StringUtils.js";import{COLORS as i}from"../../../../constants/Theme.js";import{useState as r,useEffect as C}from"react";import"../../../checkBox/CheckBox.styled.js";import{TitleMedium as s}from"../../../TypographyStyle.js";import"../../../list-item/ListItem.js";import"../../../pagination/Pagination.js";import"../../../radioButton/RadioButton.styled.js";import"react-toastify";import"../../../toaster/Toaster.styled.js";import"@tippyjs/react";import"../../../tooltips/TooltipInternal.js";import"../../../spinner/Spinner.js";import"../../../stepper/Stepper.styled.js";import"../../../tag/Tag.js";import"../../../icon-button/IconButton.js";import"../../../template-preview/TemplatePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import"../../../template-preview/models/TemplateMeta.js";import"../../../modals/styledModal.js";import"../../../template-preview/models/Channels.js";import"../../../template-context-mapper/context/templateModalContext.js";import"../../../template-context-mapper/modalElements/Footer.js";import"../../../template-context-mapper/modalElements/Body.js";import"../../../template-context-mapper/modalElements/Header.js";import"../../../zeroState/ZeroState.js";import"../../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../../button/Button.js";import"../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../../../input/Input.js";import"react-bootstrap";import"../../../floating-action-button/FloatingActionButton.styles.js";import"../../../image-compress/ImageCompress.js";import"../../../progress-bar/ProgressBarComponent.js";import"../../../QueryBuilder/QueryBuilder.js";import"../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js";import"../../../QueryBuilder/constants/connectorPosition.js";import"../../../QueryBuilder/constants/connector.js";import"../../../QueryBuilder/types/QueryBuilder.type.js";import"../../../dropdown/Dropdown.js";import"../../../QueryBuilder/components/InputLoader.js";import"../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js";import"react-chips";import"../../../input/ChipInput.styled.js";import"../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js";import"../../../QueryBuilder/components/Connectors/Components/IgPicker.js";import"../../../QueryBuilder/components/Connectors/Components/InTheLast.js";import"../../../QueryBuilder/components/Connectors/Components/InTwoLast.js";import"react-calendar";import"../../../../utils/DateUtils.js";import"../../../datePicker/DatePickerWrapper.styled.js";import"../../../QueryBuilder/components/Connectors/Connector.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js";import"../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js";import"../../../QueryBuilder/redux/queryBuilder.reducer.js";import"../../../QueryBuilder/redux/queryBuilderCache.reducer.js";import"../../../QueryBuilder/types/QueryBuilderOperator.type.js";import"../../../dropdown/DropdownPopover/index.js";import"../../../dropdown/MenuItem/MenuItem.js";import"../../../shimmer/ShimmerComponent/ShimmerStyled.js";import"../../../analytics-card/AnalyticsCard.styled.js";import"../../CommonStyles.js";import"../../../datePicker/DatePicker.styled.js";import"../../AnalyticsMetric.js";import"../LineChart/LineChart.js";import"../linearChipGroupedChart/LinearChipGroupedChart.styled.js";import{PieChart as c}from"./PieChart.js";import"../HorizontalBarGraph/HorizontalGraph.js";import"../StackedBarChart/StackedBarChart.js";import"../VerticalBarGraph/VerticalGraph.js";import"../heatmap/HeatMap.js";import"../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js";import"../../../avatar/Avatar.js";import"../../../avatar/AvatarHelper.js";import"../../../alerts/Alert.styled.js";import"../../../alerts/AlertHelper.js";import"../../../thumbnail/Thumbnail.js";import"../../../curtain/Curtain.styled.js";import"../../../curtain/CurtainHelper.js";import"../../../switch/Switch.js";import"../../../plans/SubscriptionPlanStyled.js";import"../../../plans/SubscriptionPlanSelector.js";import"../../../tabs/Tabs.js";import"../../../TablePagination/TablePagination.styled.js";import"../../../TablePagination/TablePaginationCard.js";import"../../../states/StateComponent.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditor.js";import"../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js";import"../../../card-selection-modal/CardSelectionModal.styled.js";import"react-image-crop";import"../../../buttonGroup/ButtonGroupStyle.js";import"../../../accordion/Accordion.style.js";import"../../../accordion/AccordionArrow.js";import"../../../file-uploader/FileUploaderStyle.js";import"../../../colourInput/ColourInput.styled.js";import"../../../bik-layout/CommonStyles.js";import"../../../bik-layout/SidebarStyles.js";import"date-fns";import"react-popper";import"../../../dropdown/Common.styled.js";import"../../../custom-date-time/CustomDateTime.styled.js";import"../../../../node_modules/lodash.debounce/index.js";import"../../../product-picker/ProductPicker.styled.js";import"../../../discount-modal/type.js";import"../../../discount-modal/DiscountModal.styled.js";import"../../../discount-modal/DynamicCoupon/DynamicCoupon.js";import"../../../discount-modal/CouponExpiration/CouponExpiration.js";import"../../../country-code-picker/CountryCodePicker.styled.js";import"../../../product-picker-v2/emptyState.js";import"../../../product-picker-v2/style.js";import"lodash";import"../../../carousel/carousel.js";import"../../../carousel-secondary/CarouselSecondary.style.js";import"../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js";import"../../../radioList/RadioList.styled.js";import"../../../checkList/CheckList.styled.js";import"../../../postPicker/postPicker.js";import"../../../dropdown-button/DropdownButton.style.js";import"react-dom";import"../../../side-modal/SideModal.style.js";import{Chart as p,ArcElement as A,Legend as l}from"chart.js";import{Doughnut as a}from"react-chartjs-2";p.register(A,l);const d={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:t=>{if(!t.label)return" 0%";const o=t.dataset.data.reduce(((t,o)=>t+o),0),e=parseFloat((t.raw/o*100).toFixed(1));return` ${t.label}: ${e}%`}}}}},n=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],m=t("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(t=>i.surface.standard),";border:1px solid ",(t=>i.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQzhCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ21lbnQsIGpzeHMgYXMgX2pzeHMgfSBmcm9tIFwicmVhY3QvanN4LXJ1bnRpbWVcIjtcclxuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBTdHJpbmdVdGlscyB9IGZyb20gXCIuLi8uLi8uLi8uLi9pbmRleFwiO1xyXG5pbXBvcnQgeyBBcmNFbGVtZW50LCBDaGFydCBhcyBDaGFydEpTLCBMZWdlbmQgfSBmcm9tICdjaGFydC5qcyc7XHJcbmltcG9ydCB7IHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IERvdWdobnV0IH0gZnJvbSAncmVhY3QtY2hhcnRqcy0yJztcclxuaW1wb3J0IHsgVGl0bGVNZWRpdW0gfSBmcm9tIFwiLi4vLi4vLi4vVHlwb2dyYXBoeVN0eWxlXCI7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi8uLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuaW1wb3J0IHsgUGllQ2hhcnQgfSBmcm9tICcuL1BpZUNoYXJ0JztcclxuQ2hhcnRKUy5yZWdpc3RlcihBcmNFbGVtZW50LCBMZWdlbmQpO1xyXG5jb25zdCBvcHRpb25zID0ge1xyXG4gICAgcGx1Z2luczoge1xyXG4gICAgICAgIGxlZ2VuZDoge1xyXG4gICAgICAgICAgICBkaXNwbGF5OiBmYWxzZSxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHRvb2x0aXA6IHtcclxuICAgICAgICAgICAgZW5hYmxlZDogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgICR7dG9vbHRpcEl0ZW0ubGFiZWx9OiAke3BlcmNlbnRhZ2V9JWA7XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG59O1xyXG5jb25zdCBHUkFQSF9DT0xPUlMgPSBbXHJcbiAgICAnIzVFMDdCQicsXHJcbiAgICAnIzlFNzdFRCcsXHJcbiAgICAnI0QyQUVGRicsXHJcbiAgICAnI0NERTFGRicsXHJcbiAgICAnIzkyQUZGQScsXHJcbiAgICAnIzM5MzVFMScsXHJcbl07XHJcbmNvbnN0IENhcnRTdHlsZWQgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHsocHJvcHMpID0+IENPTE9SU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gKHRvdGFsU3VtID09PSAwKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBkYXRhc2V0czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgfSwgW3NsaWNlc10pO1xyXG4gICAgaWYgKCFkYXRhKSB7XHJcbiAgICAgICAgcmV0dXJuIF9qc3goX0ZyYWdtZW50LCB7fSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKF9qc3hzKF9GcmFnbWVudCwgeyBjaGlsZHJlbjogW3RpdGxlICYmIChfanN4KFRpdGxlTWVkaXVtLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICBtYXJnaW5Cb3R0b206IDE2LFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiB0aXRsZSB9KSkpLCBfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAncm93JyB9LCB7IGNoaWxkcmVuOiBbX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnIH0sIHsgY2hpbGRyZW46IF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBzaXplLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KERvdWdobnV0LCB7IGRhdGE6IGRhdGEsIG9wdGlvbnM6IE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucyksIHsgbWFpbnRhaW5Bc3BlY3RSYXRpbzogc2l6ZSA/IGZhbHNlIDogdHJ1ZSB9KSB9KSB9KSkgfSkpLCBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */")),b=t=>o(m,Object.assign({style:{padding:24}},{children:t.children})),u=t=>{let{title:i,slices:p,size:A}=t;const[l,m]=r([]),[b,u]=r();return C((()=>{const t=p.reduce(((t,o)=>t+o.count),0);let o=[];if(o=Object.keys(p).map(((t,o)=>Object.assign({color:n[o%n.length]},p[t]))),m([...o]),0===t){u({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const t={labels:p.map((t=>I.capitalize(t.name))),datasets:[{data:p.map((t=>t.count)),backgroundColor:p.map(((t,o)=>{var e;return null!==(e=t.color)&&void 0!==e?e:n[o%n.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};u(t)}}),[p]),b?g(e,{children:[i&&o(s,Object.assign({style:{marginBottom:16}},{children:i})),g("div",Object.assign({className:"row"},{children:[o("div",Object.assign({className:"col-6"},{children:o("div",Object.assign({style:{width:A,height:A}},{children:o(a,{data:b,options:Object.assign(Object.assign({},d),{maintainAspectRatio:!A})})}))})),o("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:o(c,{slices:l})}))]}))]}):o(e,{})};export{b as Card,u as PieChartAnalytics};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,Fragment as e,jsxs as
|
|
1
|
+
import{jsx as t,Fragment as e,jsxs as o}from"react/jsx-runtime";import{MenuItem as i}from"./MenuItem.js";import{StyledGroupedLabel as n}from"./MenuList.styled.js";const s=s=>{let{options:r,isMultiSelect:l,showDescription:c,onSelect:p,version:m}=s;return t(e,{children:r.map(((e,s)=>{const a=s===r.length-1;if(e.options){const r=e;return o("div",Object.assign({style:{marginTop:"2.0"===m?2:0}},{children:[t(n,Object.assign({version:m},{children:r.label})),r.options.map(((e,o)=>t(i,{version:m,last:o===r.options.length-1,onSelect:p,showDescription:c,isMultiSelect:l,option:e},`${s}-${o}`)))]}),s)}return t(i,{version:m,last:a,onSelect:p,showDescription:c,isMultiSelect:l,option:e},s)}))})};export{s as MenuList};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const KeywordsInput: (props: {
|
|
3
|
+
keywords: string[];
|
|
4
|
+
onDeleteKeyword: (name: string) => void;
|
|
5
|
+
onSelectKeyword?: ((kwd: string) => void) | undefined;
|
|
6
|
+
placeHolder?: string | undefined;
|
|
7
|
+
error?: boolean | undefined;
|
|
8
|
+
errorMessage?: string | undefined;
|
|
9
|
+
hint?: string | undefined;
|
|
10
|
+
width?: string | undefined;
|
|
11
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import o from"../../assets/icons/cross.svg.js";import{useState as t}from"react";import{Input as i}from"../input/Input.js";import{Tag as n}from"../tag/Tag.js";const a=a=>{var s;const[l,d]=t(""),{keywords:c,onDeleteKeyword:p,errorMessage:m,onSelectKeyword:g,error:h,hint:w,width:x}=a;return e("div",Object.assign({style:{marginTop:12}},{children:[r(i,{width:x,onChangeText:function(e,r){!r||"keydown"!==(null==r?void 0:r.type)||13!==r.which&&13!==r.keyCode?d(e):e.trim()&&(d(""),g&&g(e.trim()))},value:l,hintText:w,placeholder:null!==(s=a.placeHolder)&&void 0!==s?s:"Ex. Hello",errorMessage:h?m||"Please ENTER to add keyword":""}),r("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"8px",marginTop:12,flexWrap:"wrap",width:x}},{children:c.map(((e,t)=>r(n,{tagText:e,TrailingIcon:o,onTrailingIconClicked:()=>p(e)},e+t)))}))]}))};export{a as KeywordsInput};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ChipStyle: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './KeywordsInput';
|
package/dist/esm/index.d.ts
CHANGED