proca 0.8.1 → 1.1.5
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 +1079 -28
- package/package.json +94 -101
- package/proca-cli +8 -0
- package/src/commands/action/count.mjs +61 -0
- package/src/commands/action/list.mjs +204 -0
- package/src/commands/action/replay.mjs +54 -0
- package/src/commands/campaign/add.mjs +101 -0
- package/src/commands/campaign/delete.mjs +61 -0
- package/src/commands/campaign/get.mjs +107 -0
- package/src/commands/campaign/list.mjs +156 -0
- package/src/commands/campaign/queries.graphql +19 -0
- package/src/commands/config/add.mjs +101 -0
- package/src/commands/config/get.mjs +33 -0
- package/src/commands/config/set.mjs +103 -0
- package/src/commands/config/token.mjs +34 -0
- package/src/commands/config/user.mjs +76 -0
- package/src/commands/org/add.mjs +66 -0
- package/src/commands/org/crm.mjs +88 -0
- package/src/commands/org/delete.mjs +48 -0
- package/src/commands/org/get.mjs +97 -0
- package/src/commands/org/join.mjs +77 -0
- package/src/commands/supporter/count.mjs +96 -0
- package/src/commands/user/get.mjs +91 -0
- package/src/commands/user/leave.mjs +52 -0
- package/src/commands/user/list.mjs +71 -0
- package/src/commands/widget/add.mjs +101 -0
- package/src/commands/widget/cache.mjs +29 -0
- package/src/commands/widget/get.mjs +59 -0
- package/src/commands/widget/list.mjs +116 -0
- package/src/config.mjs +36 -0
- package/src/generated/schema.json +10677 -0
- package/src/hooks/help.mjs +14 -0
- package/src/hooks/init.mjs +20 -0
- package/src/index.mjs +1 -0
- package/src/procaCommand.mjs +242 -0
- package/src/queries/campaign.mjs +21 -0
- package/src/queries/widget.mjs +12 -0
- package/src/urql.mjs +60 -0
- package/src/util/twitter.mjs +23 -0
- package/theme.json +29 -0
- package/LICENSE +0 -661
- package/dist/App.css +0 -22
- package/dist/App.js +0 -25
- package/dist/App.test.js +0 -8
- package/dist/Wizard.js +0 -32
- package/dist/components/Alert.js +0 -49
- package/dist/components/Clickify.js +0 -26
- package/dist/components/Consent.js +0 -120
- package/dist/components/Country.js +0 -94
- package/dist/components/Dialog.js +0 -84
- package/dist/components/Disabled.js +0 -3
- package/dist/components/Emoji.js +0 -12
- package/dist/components/FAB.js +0 -70
- package/dist/components/Html.js +0 -56
- package/dist/components/Loader.js +0 -14
- package/dist/components/Openletter.js +0 -443
- package/dist/components/Organisation.js +0 -181
- package/dist/components/Petition.js +0 -16
- package/dist/components/ProcaRoot.js +0 -23
- package/dist/components/ProcaStyle.js +0 -94
- package/dist/components/ProgressCounter.js +0 -64
- package/dist/components/Register.js +0 -345
- package/dist/components/Share.js +0 -177
- package/dist/components/TextField.js +0 -58
- package/dist/components/Twitter.js +0 -127
- package/dist/components/TwitterAction.js +0 -111
- package/dist/components/TwitterList.js +0 -25
- package/dist/components/TwitterText.js +0 -42
- package/dist/components/Widget.js +0 -266
- package/dist/components/bespoke/Download.js +0 -49
- package/dist/components/bespoke/Register-CH.js +0 -505
- package/dist/data/countries.json +0 -114
- package/dist/hooks/useConfig.js +0 -217
- package/dist/hooks/useCount.js +0 -95
- package/dist/hooks/useData.js +0 -59
- package/dist/hooks/useElementWidth.js +0 -46
- package/dist/hooks/useGeoLocation.js +0 -45
- package/dist/hooks/useLayout.js +0 -63
- package/dist/images/Twitter.js +0 -16
- package/dist/images/Twitter.svg +0 -1
- package/dist/index.css +0 -13
- package/dist/index.js +0 -114
- package/dist/lib/domparser.js +0 -12
- package/dist/lib/i18n.js +0 -40
- package/dist/lib/init.js +0 -7
- package/dist/lib/server.js +0 -331
- package/dist/lib/urlparser.js +0 -65
- package/dist/lib/uuid.js +0 -30
- package/dist/locales/README.md +0 -37
- package/dist/locales/common.json +0 -189
- package/dist/locales/de/common.json +0 -46
- package/dist/locales/de/index.js +0 -0
- package/dist/locales/en/common.json +0 -45
- package/dist/locales/fr/common.json +0 -51
- package/dist/locales/index.js +0 -27
- package/dist/locales/it/common.json +0 -46
- package/dist/logo.svg +0 -1
- package/dist/module.js +0 -14
- package/dist/slingshot.xcf +0 -0
- package/dist/tmp.config/0.json +0 -21
- package/dist/tmp.config/2.json +0 -11
- package/dist/tmp.config/20.json +0 -29
- package/dist/tmp.config/28.json +0 -14
- package/dist/tmp.config/32.json +0 -34
- package/dist/tmp.config/35.json +0 -14
- package/dist/tmp.config/null.json +0 -1
|
@@ -1,505 +0,0 @@
|
|
|
1
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
|
-
|
|
3
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4
|
-
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
|
-
|
|
9
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
-
|
|
11
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
|
|
13
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
-
|
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
|
|
17
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
|
-
|
|
19
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
20
|
-
|
|
21
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
-
|
|
23
|
-
import React, { useEffect, useState } from "react";
|
|
24
|
-
import PropTypes from 'prop-types';
|
|
25
|
-
import { Container, Grid } from "@material-ui/core";
|
|
26
|
-
import { makeStyles } from "@material-ui/core/styles";
|
|
27
|
-
import { TextField, Button, Snackbar } from "@material-ui/core";
|
|
28
|
-
import Alert from "@material-ui/lab/Alert";
|
|
29
|
-
import SendIcon from "@material-ui/icons/Send";
|
|
30
|
-
import DoneIcon from "@material-ui/icons/Done";
|
|
31
|
-
import useForm from "react-hook-form";
|
|
32
|
-
import { useTranslation } from "react-i18next";
|
|
33
|
-
import ProgressCounter from "../ProgressCounter";
|
|
34
|
-
import { addActionContact } from "../../lib/server.js";
|
|
35
|
-
import useElementWidth from "../../hooks/useElementWidth";
|
|
36
|
-
import useConfig from "../../hooks/useConfig";
|
|
37
|
-
import uuid from "../../lib/uuid.js";
|
|
38
|
-
import domparser from "../../lib/domparser";
|
|
39
|
-
import useCount from "../../hooks/useCount";
|
|
40
|
-
import Consent from "../Consent";
|
|
41
|
-
import { url as postcardUrl } from "./Download";
|
|
42
|
-
var defaultValues = {
|
|
43
|
-
firstname: "",
|
|
44
|
-
lastname: "",
|
|
45
|
-
email: "",
|
|
46
|
-
postcode: "",
|
|
47
|
-
locality: "",
|
|
48
|
-
address: "",
|
|
49
|
-
country: "CH",
|
|
50
|
-
comment: ""
|
|
51
|
-
};
|
|
52
|
-
var useStyles = makeStyles(function (theme) {
|
|
53
|
-
return {
|
|
54
|
-
container: {
|
|
55
|
-
display: "flex",
|
|
56
|
-
flexWrap: "wrap"
|
|
57
|
-
},
|
|
58
|
-
textField: {
|
|
59
|
-
marginLeft: theme.spacing(0),
|
|
60
|
-
marginRight: theme.spacing(0),
|
|
61
|
-
width: "100%"
|
|
62
|
-
},
|
|
63
|
-
"#petition-form": {
|
|
64
|
-
position: "relative"
|
|
65
|
-
},
|
|
66
|
-
"@global": {
|
|
67
|
-
"select:-moz-focusring": {
|
|
68
|
-
color: "transparent",
|
|
69
|
-
textShadow: "0 0 0 #000"
|
|
70
|
-
},
|
|
71
|
-
"input:valid + fieldset": {
|
|
72
|
-
borderColor: "green",
|
|
73
|
-
borderWidth: 2
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
export default function Register(props) {
|
|
79
|
-
var classes = useStyles();
|
|
80
|
-
|
|
81
|
-
var _useTranslation = useTranslation(),
|
|
82
|
-
t = _useTranslation.t;
|
|
83
|
-
|
|
84
|
-
var _useState = useState("default"),
|
|
85
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
86
|
-
status = _useState2[0],
|
|
87
|
-
setStatus = _useState2[1];
|
|
88
|
-
|
|
89
|
-
var _useConfig = useConfig(),
|
|
90
|
-
config = _useConfig.config,
|
|
91
|
-
setConfig = _useConfig.setConfig;
|
|
92
|
-
|
|
93
|
-
var actionUrl = config.actionUrl + domparser('campaignId', config.selector);
|
|
94
|
-
var c = useCount(null, actionUrl);
|
|
95
|
-
|
|
96
|
-
if (status !== "error" && c && c.errors && c.errors.length >= 0) {
|
|
97
|
-
console.log(c);
|
|
98
|
-
setStatus("error");
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
var buttonRegister = config.buttonRegister || t("Sign");
|
|
102
|
-
useEffect(function () {
|
|
103
|
-
if (!c || c.errors || parseInt(c.actionPage, 10) === config.actionPage) return;
|
|
104
|
-
setConfig('actionPage', parseInt(c.actionPage, 10));
|
|
105
|
-
}, [c, setConfig, config.actionPage]); // console.log(config);
|
|
106
|
-
|
|
107
|
-
defaultValues = _objectSpread({}, defaultValues, {}, config.data);
|
|
108
|
-
var width = useElementWidth('#proca-register');
|
|
109
|
-
|
|
110
|
-
var _useState3 = useState(true),
|
|
111
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
112
|
-
compact = _useState4[0],
|
|
113
|
-
setCompact = _useState4[1];
|
|
114
|
-
|
|
115
|
-
if (compact && width > 450 || !compact && width <= 450) setCompact(width <= 450);
|
|
116
|
-
if (props.values) defaultValues = _objectSpread({}, defaultValues, {}, props.values);
|
|
117
|
-
|
|
118
|
-
var _useForm = useForm({
|
|
119
|
-
// mode: "onBlur",
|
|
120
|
-
// nativeValidation: true,
|
|
121
|
-
defaultValues: defaultValues
|
|
122
|
-
}),
|
|
123
|
-
register = _useForm.register,
|
|
124
|
-
handleSubmit = _useForm.handleSubmit,
|
|
125
|
-
setValue = _useForm.setValue,
|
|
126
|
-
errors = _useForm.errors,
|
|
127
|
-
setError = _useForm.setError,
|
|
128
|
-
clearError = _useForm.clearError,
|
|
129
|
-
watch = _useForm.watch,
|
|
130
|
-
formState = _useForm.formState; // const { register, handleSubmit, setValue, errors } = useForm({ mode: 'onBlur', defaultValues: defaultValues });
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var postcode = watch("postcode");
|
|
134
|
-
var locality = watch("locality");
|
|
135
|
-
|
|
136
|
-
var _useState5 = useState(""),
|
|
137
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
138
|
-
autoLocality = _useState6[0],
|
|
139
|
-
setLocality = _useState6[1];
|
|
140
|
-
|
|
141
|
-
var _useState7 = useState(""),
|
|
142
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
143
|
-
region = _useState8[0],
|
|
144
|
-
setRegion = _useState8[1];
|
|
145
|
-
|
|
146
|
-
useEffect(function () {
|
|
147
|
-
if (postcode.length !== 4) return;
|
|
148
|
-
var api = "https://postcode-ch.proca.foundation/" + postcode;
|
|
149
|
-
|
|
150
|
-
function fetchAPI() {
|
|
151
|
-
return _fetchAPI.apply(this, arguments);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function _fetchAPI() {
|
|
155
|
-
_fetchAPI = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
156
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
157
|
-
while (1) {
|
|
158
|
-
switch (_context.prev = _context.next) {
|
|
159
|
-
case 0:
|
|
160
|
-
_context.next = 2;
|
|
161
|
-
return fetch(api).then(function (res) {
|
|
162
|
-
if (!res.ok) {
|
|
163
|
-
throw Error(res.statusText);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return res.json();
|
|
167
|
-
}).then(function (res) {
|
|
168
|
-
if (res && res.name) {
|
|
169
|
-
setLocality(res.name);
|
|
170
|
-
setRegion(res.code1);
|
|
171
|
-
setValue("locality", res.name);
|
|
172
|
-
}
|
|
173
|
-
}).catch(function (err) {
|
|
174
|
-
return setError(err);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
case 2:
|
|
178
|
-
case "end":
|
|
179
|
-
return _context.stop();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}, _callee);
|
|
183
|
-
}));
|
|
184
|
-
return _fetchAPI.apply(this, arguments);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
fetchAPI();
|
|
188
|
-
}, [postcode, setError, setValue]);
|
|
189
|
-
var options = {
|
|
190
|
-
margin: config.margin || "dense",
|
|
191
|
-
variant: config.variant || "filled"
|
|
192
|
-
}; //variant: standard, filled, outlined
|
|
193
|
-
//margin: normal, dense
|
|
194
|
-
|
|
195
|
-
var onSubmit = /*#__PURE__*/function () {
|
|
196
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(data) {
|
|
197
|
-
var result;
|
|
198
|
-
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
199
|
-
while (1) {
|
|
200
|
-
switch (_context2.prev = _context2.next) {
|
|
201
|
-
case 0:
|
|
202
|
-
data.tracking = config.utm;
|
|
203
|
-
data.region = region;
|
|
204
|
-
data.country = "CH";
|
|
205
|
-
data.LanguageCode = config.lang;
|
|
206
|
-
console.log(config.param);
|
|
207
|
-
console.log("submit", data);
|
|
208
|
-
data.postcardUrl = postcardUrl(data, config.param);
|
|
209
|
-
_context2.next = 9;
|
|
210
|
-
return addActionContact("register", config.actionPage, data);
|
|
211
|
-
|
|
212
|
-
case 9:
|
|
213
|
-
result = _context2.sent;
|
|
214
|
-
|
|
215
|
-
if (!result.errors) {
|
|
216
|
-
_context2.next = 14;
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
result.errors.forEach(function (error) {
|
|
221
|
-
var fields = error.message && error.message.split(":");
|
|
222
|
-
|
|
223
|
-
if (fields.length === 2) {
|
|
224
|
-
//setError(fields[0],{type:"manual",message:fields[1]});
|
|
225
|
-
setError(fields[0], "manual", fields[1]);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
console.log(error);
|
|
229
|
-
});
|
|
230
|
-
setStatus("error");
|
|
231
|
-
return _context2.abrupt("return");
|
|
232
|
-
|
|
233
|
-
case 14:
|
|
234
|
-
setStatus("success");
|
|
235
|
-
delete data.tracking;
|
|
236
|
-
delete data.privacy;
|
|
237
|
-
uuid(result.contactRef); // set the global uuid as signature's fingerprint
|
|
238
|
-
|
|
239
|
-
data.uuid = uuid();
|
|
240
|
-
data.postcardUrl += "&qrcode=" + uuid() + ":" + config.actionPage;
|
|
241
|
-
setConfig('data', data);
|
|
242
|
-
if (props.done instanceof Function) props.done({
|
|
243
|
-
uuid: uuid(),
|
|
244
|
-
firstname: data.firstname,
|
|
245
|
-
country: data.country
|
|
246
|
-
}); // sends the signature's ID as fingerprint
|
|
247
|
-
|
|
248
|
-
case 22:
|
|
249
|
-
case "end":
|
|
250
|
-
return _context2.stop();
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}, _callee2);
|
|
254
|
-
}));
|
|
255
|
-
|
|
256
|
-
return function onSubmit(_x) {
|
|
257
|
-
return _ref.apply(this, arguments);
|
|
258
|
-
};
|
|
259
|
-
}();
|
|
260
|
-
|
|
261
|
-
useEffect(function () {
|
|
262
|
-
register({
|
|
263
|
-
name: "postcode"
|
|
264
|
-
});
|
|
265
|
-
}, [postcode, register]);
|
|
266
|
-
useEffect(function () {
|
|
267
|
-
var inputs = document.querySelectorAll("input, select, textarea"); // todo: workaround until the feature is native react-form ?
|
|
268
|
-
|
|
269
|
-
inputs.forEach(function (input) {
|
|
270
|
-
input.oninvalid = function (e) {
|
|
271
|
-
setError(e.target.attributes.name.nodeValue, e.type, e.target.validationMessage);
|
|
272
|
-
};
|
|
273
|
-
});
|
|
274
|
-
}, [register, setError]);
|
|
275
|
-
|
|
276
|
-
var handleBlur = function handleBlur(e) {
|
|
277
|
-
e.target.checkValidity();
|
|
278
|
-
|
|
279
|
-
if (e.target.validity.valid) {
|
|
280
|
-
clearError(e.target.attributes.name.nodeValue);
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
function minBirthdate() {
|
|
286
|
-
var d = new Date();
|
|
287
|
-
d.setFullYear(d.getFullYear() - 18);
|
|
288
|
-
return d.toISOString().substr(0, 10);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
function Error(props) {
|
|
292
|
-
if (props.display) return /*#__PURE__*/React.createElement(Snackbar, {
|
|
293
|
-
open: true,
|
|
294
|
-
autoHideDuration: 6000
|
|
295
|
-
}, /*#__PURE__*/React.createElement(Alert, {
|
|
296
|
-
severity: "error"
|
|
297
|
-
}, "Sorry, we couldn't save your signature!", /*#__PURE__*/React.createElement("br", null), "The techies have been informed."));
|
|
298
|
-
return null;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
function Success(props) {
|
|
302
|
-
if (props.display) return /*#__PURE__*/React.createElement(Snackbar, {
|
|
303
|
-
open: true,
|
|
304
|
-
autoHideDuration: 6000
|
|
305
|
-
}, /*#__PURE__*/React.createElement(Alert, {
|
|
306
|
-
severity: "success"
|
|
307
|
-
}, "Done, Thank you for your support!"));
|
|
308
|
-
return null;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
if (status === "success") {
|
|
312
|
-
return /*#__PURE__*/React.createElement(Container, {
|
|
313
|
-
component: "main",
|
|
314
|
-
maxWidth: "sm"
|
|
315
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
316
|
-
container: true,
|
|
317
|
-
spacing: 1
|
|
318
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
319
|
-
item: true,
|
|
320
|
-
xs: 12
|
|
321
|
-
}, /*#__PURE__*/React.createElement(DoneIcon, {
|
|
322
|
-
color: "action",
|
|
323
|
-
fontSize: "large",
|
|
324
|
-
my: 4
|
|
325
|
-
}))));
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProgressCounter, {
|
|
329
|
-
count: c && c.total
|
|
330
|
-
}), /*#__PURE__*/React.createElement("form", {
|
|
331
|
-
className: classes.container,
|
|
332
|
-
onSubmit: handleSubmit(onSubmit),
|
|
333
|
-
method: "post",
|
|
334
|
-
id: "proca-register",
|
|
335
|
-
url: "http://localhost"
|
|
336
|
-
}, /*#__PURE__*/React.createElement(Success, {
|
|
337
|
-
display: status === "success"
|
|
338
|
-
}), /*#__PURE__*/React.createElement(Error, {
|
|
339
|
-
display: status === "error"
|
|
340
|
-
}), /*#__PURE__*/React.createElement(Container, {
|
|
341
|
-
component: "main",
|
|
342
|
-
maxWidth: "sm"
|
|
343
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
344
|
-
container: true,
|
|
345
|
-
spacing: 1
|
|
346
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
347
|
-
item: true,
|
|
348
|
-
xs: 12,
|
|
349
|
-
sm: compact ? 12 : 6
|
|
350
|
-
}, /*#__PURE__*/React.createElement(TextField, {
|
|
351
|
-
id: "firstname",
|
|
352
|
-
name: "firstname",
|
|
353
|
-
label: t("First name"),
|
|
354
|
-
className: classes.textField,
|
|
355
|
-
placeholder: "eg. Albert",
|
|
356
|
-
autoComplete: "given-name",
|
|
357
|
-
required: true,
|
|
358
|
-
inputRef: register,
|
|
359
|
-
onBlur: handleBlur,
|
|
360
|
-
error: !!(errors && errors.firstname),
|
|
361
|
-
helperText: errors && errors.firstname && errors.firstname.message,
|
|
362
|
-
variant: options.variant,
|
|
363
|
-
margin: options.margin
|
|
364
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
365
|
-
item: true,
|
|
366
|
-
xs: 12,
|
|
367
|
-
sm: compact ? 12 : 6
|
|
368
|
-
}, /*#__PURE__*/React.createElement(TextField, {
|
|
369
|
-
id: "lastname",
|
|
370
|
-
name: "lastname",
|
|
371
|
-
label: t("Last name"),
|
|
372
|
-
autoComplete: "family-name",
|
|
373
|
-
className: classes.textField,
|
|
374
|
-
variant: options.variant,
|
|
375
|
-
margin: options.margin,
|
|
376
|
-
inputRef: register,
|
|
377
|
-
placeholder: "eg. Einstein"
|
|
378
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
379
|
-
item: true,
|
|
380
|
-
xs: 12,
|
|
381
|
-
sm: compact ? 12 : 6
|
|
382
|
-
}, errors && errors.email && errors.email.message, /*#__PURE__*/React.createElement(TextField, {
|
|
383
|
-
id: "email",
|
|
384
|
-
name: "email",
|
|
385
|
-
type: "email",
|
|
386
|
-
label: t("Email"),
|
|
387
|
-
autoComplete: "email",
|
|
388
|
-
className: classes.textField,
|
|
389
|
-
inputRef: register,
|
|
390
|
-
onBlur: handleBlur,
|
|
391
|
-
error: !!errors.email,
|
|
392
|
-
helperText: errors && errors.email && errors.email.message,
|
|
393
|
-
variant: options.variant,
|
|
394
|
-
margin: options.margin,
|
|
395
|
-
placeholder: "your.email@example.org",
|
|
396
|
-
required: true
|
|
397
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
398
|
-
item: true,
|
|
399
|
-
xs: 12,
|
|
400
|
-
sm: compact ? 12 : 6
|
|
401
|
-
}, /*#__PURE__*/React.createElement(TextField, {
|
|
402
|
-
InputLabelProps: {
|
|
403
|
-
shrink: true
|
|
404
|
-
},
|
|
405
|
-
inputProps: {
|
|
406
|
-
max: minBirthdate(),
|
|
407
|
-
'data-error-message': t("you need to be 18 years old")
|
|
408
|
-
},
|
|
409
|
-
error: !!errors.birthdate,
|
|
410
|
-
helperText: errors && errors.birthdate && t("you need to be 18 years old"),
|
|
411
|
-
id: "birthdate",
|
|
412
|
-
name: "birthdate",
|
|
413
|
-
label: t("Birthdate"),
|
|
414
|
-
className: classes.textField,
|
|
415
|
-
onBlur: handleBlur,
|
|
416
|
-
variant: options.variant,
|
|
417
|
-
margin: options.margin,
|
|
418
|
-
inputRef: register({
|
|
419
|
-
validate: function validate(value) {
|
|
420
|
-
//not useful anymore now that we have the html5 validation?
|
|
421
|
-
if (!value) return;
|
|
422
|
-
console.log(value, minBirthdate());
|
|
423
|
-
|
|
424
|
-
if (value >= minBirthdate()) {
|
|
425
|
-
setError("birthdate", "manual", t("you need to be 18 years old"));
|
|
426
|
-
return false;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
return true;
|
|
430
|
-
}
|
|
431
|
-
}),
|
|
432
|
-
type: "date"
|
|
433
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
434
|
-
item: true,
|
|
435
|
-
xs: 12,
|
|
436
|
-
sm: compact ? 12 : 12
|
|
437
|
-
}, /*#__PURE__*/React.createElement(TextField, {
|
|
438
|
-
name: "address",
|
|
439
|
-
label: t("Address"),
|
|
440
|
-
className: classes.textField,
|
|
441
|
-
variant: options.variant,
|
|
442
|
-
margin: options.margin,
|
|
443
|
-
inputRef: register
|
|
444
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
445
|
-
item: true,
|
|
446
|
-
xs: 12,
|
|
447
|
-
sm: compact ? 12 : 3
|
|
448
|
-
}, /*#__PURE__*/React.createElement(TextField, {
|
|
449
|
-
id: "postcode",
|
|
450
|
-
name: "postcode",
|
|
451
|
-
label: t("Postal Code"),
|
|
452
|
-
onBlur: handleBlur,
|
|
453
|
-
inputProps: {
|
|
454
|
-
pattern: "[0-9]{4}",
|
|
455
|
-
title: "9999"
|
|
456
|
-
},
|
|
457
|
-
autoComplete: "postal-code",
|
|
458
|
-
required: true,
|
|
459
|
-
error: !!errors.postcode,
|
|
460
|
-
helperText: errors && errors.postcode && errors.postcode.message,
|
|
461
|
-
inputRef: register,
|
|
462
|
-
className: classes.textField,
|
|
463
|
-
variant: options.variant,
|
|
464
|
-
margin: options.margin
|
|
465
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
466
|
-
item: true,
|
|
467
|
-
xs: 12,
|
|
468
|
-
sm: compact ? 12 : 9
|
|
469
|
-
}, /*#__PURE__*/React.createElement(TextField, {
|
|
470
|
-
id: "locality",
|
|
471
|
-
name: "locality",
|
|
472
|
-
label: t("Locality"),
|
|
473
|
-
autoComplete: "address-level2",
|
|
474
|
-
InputLabelProps: {
|
|
475
|
-
shrink: autoLocality !== '' || locality !== '' || false
|
|
476
|
-
},
|
|
477
|
-
inputRef: register,
|
|
478
|
-
className: classes.textField,
|
|
479
|
-
variant: options.variant,
|
|
480
|
-
margin: options.margin
|
|
481
|
-
})), /*#__PURE__*/React.createElement(Consent, {
|
|
482
|
-
organisation: props.organisation,
|
|
483
|
-
privacy_url: config.privacyUrl,
|
|
484
|
-
errors: errors,
|
|
485
|
-
options: options,
|
|
486
|
-
register: register
|
|
487
|
-
}), /*#__PURE__*/React.createElement(Grid, {
|
|
488
|
-
item: true,
|
|
489
|
-
xs: 12
|
|
490
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
491
|
-
color: "primary",
|
|
492
|
-
variant: "contained",
|
|
493
|
-
fullWidth: true,
|
|
494
|
-
type: "submit",
|
|
495
|
-
size: "large",
|
|
496
|
-
disabled: formState.isSubmitting,
|
|
497
|
-
endIcon: /*#__PURE__*/React.createElement(SendIcon, null)
|
|
498
|
-
}, " ", buttonRegister))))));
|
|
499
|
-
}
|
|
500
|
-
Register.propTypes = {
|
|
501
|
-
actionPage: PropTypes.number.isRequired
|
|
502
|
-
};
|
|
503
|
-
Register.defaultProps = {
|
|
504
|
-
buttonText: "Register"
|
|
505
|
-
};
|
package/dist/data/countries.json
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"iso": "AT",
|
|
4
|
-
"name": "Austria"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"iso" : "BE",
|
|
8
|
-
"name": "Belgium"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"iso": "BG",
|
|
12
|
-
"name": "Bulgaria"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"iso": "HR",
|
|
16
|
-
"name": "Croatia"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"iso": "CY",
|
|
20
|
-
"name": "Cyprus"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"iso": "CZ",
|
|
24
|
-
"name": "Czech Republic"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"iso": "DK",
|
|
28
|
-
"name": "Denmark"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"iso": "EE",
|
|
32
|
-
"name": "Estonia"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"iso": "FI",
|
|
36
|
-
"name": "Finland"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"iso": "FR",
|
|
40
|
-
"name": "France"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"iso": "DE",
|
|
44
|
-
"name": "Germany"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"iso": "GR",
|
|
48
|
-
"name": "Greece"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"iso": "HU",
|
|
52
|
-
"name": "Hungary"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"iso": "IE",
|
|
56
|
-
"name": "Ireland"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"iso": "IT",
|
|
60
|
-
"name": "Italy"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"iso": "LV",
|
|
64
|
-
"name": "Latvia"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"iso": "LT",
|
|
68
|
-
"name": "Lithuania"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"iso": "LU",
|
|
72
|
-
"name": "Luxembourg"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"iso": "MT",
|
|
76
|
-
"name": "Malta"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"iso": "NL",
|
|
80
|
-
"name": "Netherlands"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"iso": "PL",
|
|
84
|
-
"name": "Poland"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"iso": "PT",
|
|
88
|
-
"name": "Portugal"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"iso": "RO",
|
|
92
|
-
"name": "Romania"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"iso": "SK",
|
|
96
|
-
"name": "Slovakia"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"iso": "SI",
|
|
100
|
-
"name": "Slovenia"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"iso": "ES",
|
|
104
|
-
"name": "Spain"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"iso": "SE",
|
|
108
|
-
"name": "Sweden"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"iso": "ZZ",
|
|
112
|
-
"name": "Other"
|
|
113
|
-
}
|
|
114
|
-
]
|