@lifesg/web-frontend-engine 1.0.0-alpha.2 → 1.0.0-alpha.4
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 +21 -27
- package/cjs/index.js +88 -84
- package/cjs/index.js.map +1 -1
- package/components/custom/filter/filter/filter.d.ts +2 -0
- package/components/custom/filter/filter/types.d.ts +14 -0
- package/components/custom/filter/filter-checkbox/filter-checkbox.d.ts +3 -0
- package/components/custom/filter/filter-checkbox/types.d.ts +12 -0
- package/components/custom/filter/filter-item/filter-item.d.ts +3 -0
- package/components/custom/filter/filter-item/types.d.ts +8 -0
- package/components/custom/filter/index.d.ts +3 -0
- package/components/custom/index.d.ts +1 -0
- package/components/elements/alert/alert.d.ts +1 -2
- package/components/elements/section/index.d.ts +2 -0
- package/components/elements/section/section.d.ts +2 -0
- package/components/elements/section/types.d.ts +10 -0
- package/components/elements/sections/index.d.ts +2 -0
- package/components/elements/sections/sections.d.ts +14 -0
- package/components/elements/sections/types.d.ts +5 -0
- package/components/elements/text/data.d.ts +12 -12
- package/components/elements/text/text.d.ts +1 -2
- package/components/elements/wrapper/conditional-renderer.d.ts +5 -1
- package/components/elements/wrapper/types.d.ts +11 -2
- package/components/elements/wrapper/wrapper.d.ts +2 -11
- package/components/fields/checkbox-group/checkbox-group.d.ts +1 -2
- package/components/fields/checkbox-group/checkbox-group.styles.d.ts +2 -1
- package/components/fields/checkbox-group/types.d.ts +13 -1
- package/components/fields/chips/chips.d.ts +1 -2
- package/components/fields/chips/types.d.ts +1 -0
- package/components/fields/contact-field/contact-field.d.ts +3 -0
- package/components/fields/contact-field/data.d.ts +5 -0
- package/components/fields/contact-field/index.d.ts +2 -0
- package/components/fields/contact-field/types.d.ts +30 -0
- package/components/fields/date-field/date-field.d.ts +3 -0
- package/components/fields/date-field/index.d.ts +2 -0
- package/components/fields/{date-input → date-field}/types.d.ts +2 -2
- package/components/fields/index.d.ts +6 -4
- package/components/fields/multi-select/multi-select.d.ts +1 -2
- package/components/fields/radio-button/radio-button.d.ts +1 -2
- package/components/fields/radio-button/radio-button.styles.d.ts +1 -0
- package/components/fields/radio-button/types.d.ts +9 -0
- package/components/fields/reset-button/index.d.ts +2 -0
- package/components/fields/reset-button/reset-button.d.ts +3 -0
- package/components/fields/reset-button/types.d.ts +5 -0
- package/components/fields/select/select.d.ts +1 -2
- package/components/fields/submit-button/submit-button.d.ts +1 -2
- package/components/fields/text-field/index.d.ts +2 -0
- package/components/fields/text-field/text-field.d.ts +3 -0
- package/components/fields/text-field/types.d.ts +8 -0
- package/components/fields/textarea/textarea.d.ts +1 -2
- package/components/fields/time-field/index.d.ts +2 -0
- package/components/fields/time-field/time-field.d.ts +3 -0
- package/components/fields/{time-picker → time-field}/types.d.ts +1 -1
- package/components/fields/unit-number-field/index.d.ts +2 -0
- package/components/fields/unit-number-field/types.d.ts +7 -0
- package/components/fields/unit-number-field/unit-number-field.d.ts +3 -0
- package/components/frontend-engine/frontend-engine.d.ts +2 -8
- package/components/frontend-engine/types.d.ts +76 -20
- package/components/frontend-engine/yup/context-provider.d.ts +1 -1
- package/components/shared/chip/chip.d.ts +1 -1
- package/components/shared/error-messages.d.ts +3 -0
- package/components/shared/sanitize/sanitize.d.ts +1 -1
- package/index.js +95 -91
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/components/fields/contact-number/contact-number.d.ts +0 -4
- package/components/fields/contact-number/data.d.ts +0 -215
- package/components/fields/contact-number/index.d.ts +0 -2
- package/components/fields/contact-number/types.d.ts +0 -29
- package/components/fields/date-input/date-input.d.ts +0 -4
- package/components/fields/date-input/index.d.ts +0 -2
- package/components/fields/textfield/index.d.ts +0 -2
- package/components/fields/textfield/textfield.d.ts +0 -4
- package/components/fields/textfield/types.d.ts +0 -8
- package/components/fields/time-picker/index.d.ts +0 -2
- package/components/fields/time-picker/time-picker.d.ts +0 -4
- /package/components/fields/{contact-number → contact-field}/utils.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifesg/web-frontend-engine",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"description": "A frontend engine for LifeSG React apps",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"yup": "^0.32.11"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@lifesg/react-design-system": "^1.0.
|
|
35
|
+
"@lifesg/react-design-system": "^1.0.2",
|
|
36
36
|
"react": "^17.0.2 || ^18.0.0",
|
|
37
37
|
"react-dom": "^17.0.2 || ^18.0.0",
|
|
38
38
|
"styled-components": "^5.3.5"
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
export declare const InternationalCallingCodeMap: {
|
|
2
|
-
Singapore: string;
|
|
3
|
-
Afghanistan: string;
|
|
4
|
-
Albania: string;
|
|
5
|
-
Algeria: string;
|
|
6
|
-
Andorra: string;
|
|
7
|
-
Angola: string;
|
|
8
|
-
"Antigua and Barbuda": string;
|
|
9
|
-
Argentina: string;
|
|
10
|
-
Armenia: string;
|
|
11
|
-
Aruba: string;
|
|
12
|
-
Australia: string;
|
|
13
|
-
Austria: string;
|
|
14
|
-
Azerbaijan: string;
|
|
15
|
-
Bahamas: string;
|
|
16
|
-
Bahrain: string;
|
|
17
|
-
Bangladesh: string;
|
|
18
|
-
Barbados: string;
|
|
19
|
-
Belarus: string;
|
|
20
|
-
Belgium: string;
|
|
21
|
-
Belize: string;
|
|
22
|
-
Benin: string;
|
|
23
|
-
Bhutan: string;
|
|
24
|
-
Bolivia: string;
|
|
25
|
-
"Bosnia and Herzegovina": string;
|
|
26
|
-
Botswana: string;
|
|
27
|
-
Brazil: string;
|
|
28
|
-
"British Indian Ocean Territory": string;
|
|
29
|
-
Brunei: string;
|
|
30
|
-
Bulgaria: string;
|
|
31
|
-
"Burkina Faso": string;
|
|
32
|
-
Burundi: string;
|
|
33
|
-
Cambodia: string;
|
|
34
|
-
Cameroon: string;
|
|
35
|
-
Canada: string;
|
|
36
|
-
"Cape Verde": string;
|
|
37
|
-
"Caribbean Netherlands": string;
|
|
38
|
-
"Central African Republic": string;
|
|
39
|
-
Chad: string;
|
|
40
|
-
Chile: string;
|
|
41
|
-
China: string;
|
|
42
|
-
Colombia: string;
|
|
43
|
-
Comoros: string;
|
|
44
|
-
Congo: string;
|
|
45
|
-
"Costa Rica": string;
|
|
46
|
-
"C\u00F4te d\u2019Ivoire": string;
|
|
47
|
-
Croatia: string;
|
|
48
|
-
Cuba: string;
|
|
49
|
-
Curaçao: string;
|
|
50
|
-
Cyprus: string;
|
|
51
|
-
"Czech Republic": string;
|
|
52
|
-
Denmark: string;
|
|
53
|
-
Djibouti: string;
|
|
54
|
-
Dominica: string;
|
|
55
|
-
"Dominican Republic": string;
|
|
56
|
-
Ecuador: string;
|
|
57
|
-
Egypt: string;
|
|
58
|
-
"El Salvador": string;
|
|
59
|
-
"Equatorial Guinea": string;
|
|
60
|
-
Eritrea: string;
|
|
61
|
-
Estonia: string;
|
|
62
|
-
Ethiopia: string;
|
|
63
|
-
Fiji: string;
|
|
64
|
-
Finland: string;
|
|
65
|
-
France: string;
|
|
66
|
-
"French Guiana": string;
|
|
67
|
-
"French Polynesia": string;
|
|
68
|
-
Gabon: string;
|
|
69
|
-
Gambia: string;
|
|
70
|
-
Georgia: string;
|
|
71
|
-
Germany: string;
|
|
72
|
-
Ghana: string;
|
|
73
|
-
Greece: string;
|
|
74
|
-
Grenada: string;
|
|
75
|
-
Guadeloupe: string;
|
|
76
|
-
Guam: string;
|
|
77
|
-
Guatemala: string;
|
|
78
|
-
Guinea: string;
|
|
79
|
-
"Guinea-Bissau": string;
|
|
80
|
-
Guyana: string;
|
|
81
|
-
Haiti: string;
|
|
82
|
-
Honduras: string;
|
|
83
|
-
"Hong Kong": string;
|
|
84
|
-
Hungary: string;
|
|
85
|
-
Iceland: string;
|
|
86
|
-
India: string;
|
|
87
|
-
Indonesia: string;
|
|
88
|
-
Iran: string;
|
|
89
|
-
Iraq: string;
|
|
90
|
-
Ireland: string;
|
|
91
|
-
Israel: string;
|
|
92
|
-
Italy: string;
|
|
93
|
-
Jamaica: string;
|
|
94
|
-
Japan: string;
|
|
95
|
-
Jordan: string;
|
|
96
|
-
Kazakhstan: string;
|
|
97
|
-
Kenya: string;
|
|
98
|
-
Kiribati: string;
|
|
99
|
-
Kosovo: string;
|
|
100
|
-
Kuwait: string;
|
|
101
|
-
Kyrgyzstan: string;
|
|
102
|
-
Laos: string;
|
|
103
|
-
Latvia: string;
|
|
104
|
-
Lebanon: string;
|
|
105
|
-
Lesotho: string;
|
|
106
|
-
Liberia: string;
|
|
107
|
-
Libya: string;
|
|
108
|
-
Liechtenstein: string;
|
|
109
|
-
Lithuania: string;
|
|
110
|
-
Luxembourg: string;
|
|
111
|
-
Macau: string;
|
|
112
|
-
Macedonia: string;
|
|
113
|
-
Madagascar: string;
|
|
114
|
-
Malawi: string;
|
|
115
|
-
Malaysia: string;
|
|
116
|
-
Maldives: string;
|
|
117
|
-
Mali: string;
|
|
118
|
-
Malta: string;
|
|
119
|
-
"Marshall Islands": string;
|
|
120
|
-
Martinique: string;
|
|
121
|
-
Mauritania: string;
|
|
122
|
-
Mauritius: string;
|
|
123
|
-
Mexico: string;
|
|
124
|
-
Micronesia: string;
|
|
125
|
-
Moldova: string;
|
|
126
|
-
Monaco: string;
|
|
127
|
-
Mongolia: string;
|
|
128
|
-
Montenegro: string;
|
|
129
|
-
Morocco: string;
|
|
130
|
-
Mozambique: string;
|
|
131
|
-
Myanmar: string;
|
|
132
|
-
Namibia: string;
|
|
133
|
-
Nauru: string;
|
|
134
|
-
Nepal: string;
|
|
135
|
-
Netherlands: string;
|
|
136
|
-
"New Caledonia": string;
|
|
137
|
-
"New Zealand": string;
|
|
138
|
-
Nicaragua: string;
|
|
139
|
-
Niger: string;
|
|
140
|
-
Nigeria: string;
|
|
141
|
-
"North Korea": string;
|
|
142
|
-
Norway: string;
|
|
143
|
-
Oman: string;
|
|
144
|
-
Pakistan: string;
|
|
145
|
-
Palau: string;
|
|
146
|
-
Palestine: string;
|
|
147
|
-
Panama: string;
|
|
148
|
-
"Papua New Guinea": string;
|
|
149
|
-
Paraguay: string;
|
|
150
|
-
Peru: string;
|
|
151
|
-
Philippines: string;
|
|
152
|
-
Poland: string;
|
|
153
|
-
Portugal: string;
|
|
154
|
-
"Puerto Rico": string;
|
|
155
|
-
Qatar: string;
|
|
156
|
-
Réunion: string;
|
|
157
|
-
Romania: string;
|
|
158
|
-
Russia: string;
|
|
159
|
-
Rwanda: string;
|
|
160
|
-
"Saint Kitts and Nevis": string;
|
|
161
|
-
"Saint Lucia": string;
|
|
162
|
-
"Saint Vincent and the Grenadines": string;
|
|
163
|
-
Samoa: string;
|
|
164
|
-
"San Marino": string;
|
|
165
|
-
"S\u00E3o Tom\u00E9 and Pr\u00EDncipe": string;
|
|
166
|
-
"Saudi Arabia": string;
|
|
167
|
-
Senegal: string;
|
|
168
|
-
Serbia: string;
|
|
169
|
-
Seychelles: string;
|
|
170
|
-
"Sierra Leone": string;
|
|
171
|
-
Slovakia: string;
|
|
172
|
-
Slovenia: string;
|
|
173
|
-
"Solomon Islands": string;
|
|
174
|
-
Somalia: string;
|
|
175
|
-
"South Africa": string;
|
|
176
|
-
"South Korea": string;
|
|
177
|
-
"South Sudan": string;
|
|
178
|
-
Spain: string;
|
|
179
|
-
"Sri Lanka": string;
|
|
180
|
-
Sudan: string;
|
|
181
|
-
Suriname: string;
|
|
182
|
-
Swaziland: string;
|
|
183
|
-
Sweden: string;
|
|
184
|
-
Switzerland: string;
|
|
185
|
-
Syria: string;
|
|
186
|
-
Taiwan: string;
|
|
187
|
-
Tajikistan: string;
|
|
188
|
-
Tanzania: string;
|
|
189
|
-
Thailand: string;
|
|
190
|
-
"Timor-Leste": string;
|
|
191
|
-
Togo: string;
|
|
192
|
-
Tonga: string;
|
|
193
|
-
"Trinidad and Tobago": string;
|
|
194
|
-
Tunisia: string;
|
|
195
|
-
Turkey: string;
|
|
196
|
-
Turkmenistan: string;
|
|
197
|
-
Tuvalu: string;
|
|
198
|
-
Uganda: string;
|
|
199
|
-
Ukraine: string;
|
|
200
|
-
"United Arab Emirates": string;
|
|
201
|
-
"United Kingdom": string;
|
|
202
|
-
"United States": string;
|
|
203
|
-
Uruguay: string;
|
|
204
|
-
Uzbekistan: string;
|
|
205
|
-
Vanuatu: string;
|
|
206
|
-
"Vatican City": string;
|
|
207
|
-
Venezuela: string;
|
|
208
|
-
Vietnam: string;
|
|
209
|
-
Yemen: string;
|
|
210
|
-
Zambia: string;
|
|
211
|
-
Zimbabwe: string;
|
|
212
|
-
};
|
|
213
|
-
export declare const getCountries: () => string[];
|
|
214
|
-
export declare const getPrefix: (country: string) => string;
|
|
215
|
-
export declare const getCountryFromPrefix: (prefix: string) => string | undefined;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { FormInputProps } from "@lifesg/react-design-system/form/types";
|
|
2
|
-
import { IFrontendEngineBaseFieldJsonSchema, TComponentOmitProps } from "../../frontend-engine/types";
|
|
3
|
-
import { InternationalCallingCodeMap } from "./data";
|
|
4
|
-
export type TCountry = keyof typeof InternationalCallingCodeMap;
|
|
5
|
-
interface IContactNumberProps extends FormInputProps {
|
|
6
|
-
country?: TCountry;
|
|
7
|
-
enableSearch?: boolean | undefined;
|
|
8
|
-
}
|
|
9
|
-
export type TSingaporeNumberRule = "default" | "house" | "mobile";
|
|
10
|
-
export interface IContactNumberValidationRule {
|
|
11
|
-
contactNumber?: {
|
|
12
|
-
internationalNumber: true;
|
|
13
|
-
singaporeNumber?: never;
|
|
14
|
-
} | {
|
|
15
|
-
internationalNumber?: never;
|
|
16
|
-
singaporeNumber: TSingaporeNumberRule;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface ISelectedCountry {
|
|
20
|
-
prefix: string;
|
|
21
|
-
name: TCountry;
|
|
22
|
-
}
|
|
23
|
-
export interface IParsedPhoneNumber {
|
|
24
|
-
prefix: string;
|
|
25
|
-
number: string;
|
|
26
|
-
}
|
|
27
|
-
export interface IContactNumberSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"contact", V, IContactNumberValidationRule>, TComponentOmitProps<IContactNumberProps> {
|
|
28
|
-
}
|
|
29
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IGenericFieldProps } from "../../frontend-engine";
|
|
3
|
-
import { IEmailSchema, INumberSchema, ITextfieldSchema } from "./types";
|
|
4
|
-
export declare const TextField: (props: IGenericFieldProps<ITextfieldSchema | IEmailSchema | INumberSchema>) => JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FormInputProps } from "@lifesg/react-design-system/form/types";
|
|
2
|
-
import { IFrontendEngineBaseFieldJsonSchema, TComponentOmitProps } from "../../frontend-engine";
|
|
3
|
-
export interface ITextfieldSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"text", V>, TComponentOmitProps<FormInputProps, "type" | "maxLength"> {
|
|
4
|
-
}
|
|
5
|
-
export interface IEmailSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"email", V>, TComponentOmitProps<FormInputProps, "type" | "maxLength"> {
|
|
6
|
-
}
|
|
7
|
-
export interface INumberSchema<V = undefined> extends IFrontendEngineBaseFieldJsonSchema<"numeric", V>, TComponentOmitProps<FormInputProps, "type" | "max" | "min"> {
|
|
8
|
-
}
|
|
File without changes
|