@abgov/web-components 1.37.1-alpha.2 → 1.37.1-alpha.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/web-components",
3
- "version": "1.37.1-alpha.2",
3
+ "version": "1.37.1-alpha.3",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Government of Alberta - UI Web components",
6
6
  "bugs": {
@@ -0,0 +1,150 @@
1
+ export type FormStatus = "not-started" | "cannot-start-yet" | "in-progress" | "submitted" | "update-needed" | "complete";
2
+ export type FormState = {
3
+ uuid: string;
4
+ form: Record<string, Fieldset>;
5
+ history: string[];
6
+ editting: string;
7
+ lastModified?: Date;
8
+ status: FormStatus;
9
+ };
10
+ export type Fieldset = {
11
+ heading?: string;
12
+ data?: FieldsetData;
13
+ };
14
+ export type FieldsetData = {
15
+ type: "details";
16
+ fieldsets: Record<string, FieldsetItemState>;
17
+ } | {
18
+ type: "list";
19
+ items: FormState[];
20
+ };
21
+ export declare const StateChangeEvent = "_stateChange";
22
+ export type StateChangeRelayDetail = {
23
+ type: "details";
24
+ data: FormState;
25
+ } | {
26
+ id: string;
27
+ type: "list";
28
+ data: FormState[];
29
+ };
30
+ export declare const FormResetErrorsMsg = "form::reset:errors";
31
+ export declare const FormResetFormMsg = "form::reset:form";
32
+ export declare const FormBindMsg = "form::bind";
33
+ export type FormBindRelayDetail = {
34
+ id: string;
35
+ el: HTMLElement;
36
+ };
37
+ export declare const FormToggleActiveMsg = "form::toggle:active";
38
+ export type FormToggleActiveRelayDetail = {
39
+ active: boolean;
40
+ };
41
+ export declare const FormSetFieldsetMsg = "form::set:fieldset";
42
+ export type FormSetFieldsetRelayDetail = {
43
+ name: string;
44
+ value: FieldsetData;
45
+ };
46
+ export declare const FormDispatchStateMsg = "form::dispatch:state";
47
+ export type FormDispatchStateRelayDetail = FormState;
48
+ export type FormDispatchStateRelayDetailList = FormState[];
49
+ export declare const FormDispatchEditMsg = "form::edit";
50
+ export type FormDispatchEditRelayDetail = {
51
+ id: string;
52
+ };
53
+ export declare const SubFormBindMsg = "subform::bind";
54
+ export type SubFormBindRelayDetail = {
55
+ el: HTMLElement;
56
+ };
57
+ export declare const SubFormIndexContinueToParentMsg = "subform::indexContinueToParent";
58
+ export declare const SubFormIndexContinueToSubFormMsg = "subform::indexContinueToSubForm";
59
+ export declare const FieldsetResetErrorsMsg = "fieldset::reset:errors";
60
+ export declare const FieldsetResetFieldsMsg = "fieldset::reset:fields";
61
+ export declare const FieldsetCompleteMsg = "fieldset::submit";
62
+ export declare const FormPageContinueMsg = "form-page:continue";
63
+ export type FormPageContinueRelayDetail = {
64
+ cancelled: boolean;
65
+ };
66
+ export declare const FormPageBackMsg = "form-page:back";
67
+ export declare const FormPageBindMsg = "form=page::bind";
68
+ export type FormPageBindRelayDetail = {
69
+ id: string;
70
+ heading: string;
71
+ el: HTMLElement;
72
+ };
73
+ export declare const FieldsetBindMsg = "fieldset::bind";
74
+ export type FieldsetBindRelayDetail = {
75
+ id: string;
76
+ el: HTMLElement;
77
+ cb?: (id: string) => void;
78
+ };
79
+ export declare const FieldsetSetErrorMsg = "fieldset::set:error";
80
+ export type FieldsetErrorRelayDetail = {
81
+ error: string;
82
+ };
83
+ export declare const FieldsetChangeMsg = "fieldset::change";
84
+ export type FieldsetChangeRelayDetail = {
85
+ id: string;
86
+ state: {
87
+ heading?: string;
88
+ data: Record<string, FieldsetItemState>;
89
+ };
90
+ dispatchOn: "change" | "continue";
91
+ };
92
+ export type FieldsetItemState = {
93
+ name: string;
94
+ label: string;
95
+ value: string | number | Date;
96
+ order: number;
97
+ valueLabel?: string;
98
+ };
99
+ export type FieldsetValidationRelayDetail = {
100
+ el: HTMLElement;
101
+ state: Record<string, FieldsetItemState>;
102
+ cancelled: boolean;
103
+ };
104
+ export declare const FieldsetSetValueMsg = "fieldset::set:value";
105
+ export type FieldsetSetValueRelayDetail = {
106
+ name: string;
107
+ value: string | number | Date;
108
+ };
109
+ export declare const FormItemMountMsg = "form-item::bind";
110
+ export type FormItemMountRelayDetail = {
111
+ id: string;
112
+ label: string;
113
+ el: HTMLElement;
114
+ order: number;
115
+ };
116
+ export declare const ExternalAlterDataMsg = "external::alter:state";
117
+ export type ExternalAlterDataRelayDetail = {
118
+ id: string;
119
+ operation: "remove";
120
+ index: number;
121
+ } | {
122
+ id: string;
123
+ operation: "edit";
124
+ index: number;
125
+ };
126
+ export declare const ExternalContinueMsg = "external::continue";
127
+ export type ExternalContinueRelayDetail = {
128
+ next: string;
129
+ };
130
+ export declare const ExternalSetErrorMsg = "external::set:error";
131
+ export type ExternalErrorRelayDetail = {
132
+ name: string;
133
+ msg: string;
134
+ grouped: boolean;
135
+ };
136
+ export declare const ExternalInitStateMsg = "external::init:state";
137
+ export type ExternalInitStateDetail = FormState | string;
138
+ export declare const FormFieldMountMsg = "form-field::bind";
139
+ export type FormFieldMountRelayDetail = {
140
+ name: string;
141
+ el: HTMLElement;
142
+ };
143
+ export declare const FormSummaryBindMsg = "form-summary::bind";
144
+ export type FormSummaryBindRelayDetail = {
145
+ el: HTMLElement;
146
+ };
147
+ export declare const FormSummaryEditPageMsg = "form-summary::edit:page";
148
+ export type FormSummaryEditPageRelayDetail = {
149
+ id: string;
150
+ };