@washingtonpost/subs-de-inputs 0.0.1
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/README.md +1 -0
- package/dist/components/DataEnrichmentForm/index.d.ts +2 -0
- package/dist/components/Dropdown/index.d.ts +11 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +8 -0
- package/dist/interfaces/index.d.ts +64 -0
- package/dist/services/dataEnrichment.d.ts +4 -0
- package/dist/services/sendToGA.d.ts +12 -0
- package/dist/subs-de-inputs.cjs.development.js +798 -0
- package/dist/subs-de-inputs.cjs.development.js.map +1 -0
- package/dist/subs-de-inputs.cjs.production.min.js +2 -0
- package/dist/subs-de-inputs.cjs.production.min.js.map +1 -0
- package/dist/subs-de-inputs.esm.js +792 -0
- package/dist/subs-de-inputs.esm.js.map +1 -0
- package/dist/utils/getDefaultSubmitData.d.ts +2 -0
- package/dist/utils/hasRequiredCookies.d.ts +4 -0
- package/dist/utils/hasRequiredPrivacyCookies.d.ts +1 -0
- package/package.json +59 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# DE Inputs
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface IDropdownProps {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
values: Array<string>;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const Dropdown: ({ id, label, values, required, defaultValue, onChange, disabled, }: IDropdownProps) => JSX.Element;
|
|
11
|
+
export {};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { FormEventHandler } from 'react';
|
|
2
|
+
export declare enum I1pDataInputTypes {
|
|
3
|
+
DROPDOWN = "dropdown"
|
|
4
|
+
}
|
|
5
|
+
export declare enum I1pIngestDataTypes {
|
|
6
|
+
JOB_LEVEL = "profile_job_level",
|
|
7
|
+
JOB_INDUSTRY = "profile_job_industry",
|
|
8
|
+
NY_PERSONAL_GOALS = "new_year_personal_goals",
|
|
9
|
+
NY_HOBBIES = "new_year_hobbies",
|
|
10
|
+
NY_PROFESSIONAL_GOALS = "new_year_professional_goals",
|
|
11
|
+
NY_INDUSTRY = "new_year_industry",
|
|
12
|
+
NY_NEWS_LOCATION = "new_year_news_location"
|
|
13
|
+
}
|
|
14
|
+
export interface I1pDataInputValue {
|
|
15
|
+
archived: boolean;
|
|
16
|
+
name: string;
|
|
17
|
+
order: number;
|
|
18
|
+
date_created?: string;
|
|
19
|
+
last_modified_date?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface I1pDataInputProps {
|
|
22
|
+
id: I1pIngestDataTypes;
|
|
23
|
+
input_label: string;
|
|
24
|
+
input_prompt?: string;
|
|
25
|
+
input_type: I1pDataInputTypes;
|
|
26
|
+
required: boolean;
|
|
27
|
+
default_value?: string;
|
|
28
|
+
values?: Array<I1pDataInputValue>;
|
|
29
|
+
}
|
|
30
|
+
export interface I1pDataFormSubmitData {
|
|
31
|
+
[key: string]: string[];
|
|
32
|
+
}
|
|
33
|
+
export declare enum I1pDataIngestTypes {
|
|
34
|
+
EXPLICIT = "explicit",
|
|
35
|
+
IMPLICIT = "implicit"
|
|
36
|
+
}
|
|
37
|
+
export interface I1pDataFormProps {
|
|
38
|
+
source: string;
|
|
39
|
+
submit?: boolean;
|
|
40
|
+
ingestType: I1pDataIngestTypes;
|
|
41
|
+
onChange?: (submitData: I1pDataFormSubmitData, requiredFieldsReady: boolean) => void;
|
|
42
|
+
onFinished?: (isFinished: boolean, isError: boolean) => void;
|
|
43
|
+
formOptions?: Array<I1pDataInputProps>;
|
|
44
|
+
handleSubmit?: FormEventHandler<HTMLFormElement>;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare type I1pIngestPropsData = {
|
|
48
|
+
[key in I1pIngestDataTypes]?: string[];
|
|
49
|
+
};
|
|
50
|
+
export interface I1pIngestProps {
|
|
51
|
+
type: 'implicit' | 'explicit';
|
|
52
|
+
data: I1pIngestPropsData;
|
|
53
|
+
metadata?: Record<string, string | null | undefined>;
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}
|
|
56
|
+
export declare enum IngestResponseState {
|
|
57
|
+
SUCCESS = "100",
|
|
58
|
+
SYSTEM_ERROR = "101",
|
|
59
|
+
INVALID_TYPE = "102",
|
|
60
|
+
INVALID_IDENTIFIER = "103",
|
|
61
|
+
INVALID_DATA = "104",
|
|
62
|
+
INVALID_ATTRIBUTE_DEFINITION = "105",
|
|
63
|
+
INVALID_META_DEFINITION = "106"
|
|
64
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { I1pIngestDataTypes, I1pIngestPropsData } from '../interfaces';
|
|
2
|
+
export interface ISendGAEvent {
|
|
3
|
+
event: string;
|
|
4
|
+
category: string;
|
|
5
|
+
action: string;
|
|
6
|
+
label: string;
|
|
7
|
+
'de-label': I1pIngestDataTypes;
|
|
8
|
+
[key: string]: undefined | string | string[];
|
|
9
|
+
}
|
|
10
|
+
export declare const sendToGA: (submitData: I1pIngestPropsData, metadata: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
}) => Promise<boolean>;
|