@ballistix.digital/react-components 4.10.1 → 5.1.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/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +108 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +107 -22
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -18
package/dist/index.js
CHANGED
|
@@ -25,8 +25,8 @@ var $iA2ta$lodashset = require("lodash/set");
|
|
|
25
25
|
var $iA2ta$reacttailwindcssdatepicker = require("react-tailwindcss-datepicker");
|
|
26
26
|
var $iA2ta$formik = require("formik");
|
|
27
27
|
var $iA2ta$reactdropzone = require("react-dropzone");
|
|
28
|
-
var $iA2ta$
|
|
29
|
-
var $iA2ta$
|
|
28
|
+
var $iA2ta$luxon = require("luxon");
|
|
29
|
+
var $iA2ta$ubilabsreactgeosuggest = require("@ubilabs/react-geosuggest");
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
function $parcel$export(e, n, v, s) {
|
|
@@ -110,6 +110,21 @@ var $622cd2936b18c771$export$4370d69198e9314a = function() {
|
|
|
110
110
|
for(var _i = 0; _i < arguments.length; _i++)values[_i] = arguments[_i];
|
|
111
111
|
return values.filter(Boolean).join(' ');
|
|
112
112
|
};
|
|
113
|
+
var $622cd2936b18c771$export$155f7ed6f228c17c = function(size) {
|
|
114
|
+
var _a;
|
|
115
|
+
if (size < 0) return '';
|
|
116
|
+
if (size === 0) return '0 B';
|
|
117
|
+
var i = Math.floor(Math.log(size) / Math.log(1024));
|
|
118
|
+
var value = (size / Math.pow(1024, i)).toFixed(2);
|
|
119
|
+
var unit = (_a = [
|
|
120
|
+
'B',
|
|
121
|
+
'kB',
|
|
122
|
+
'MB',
|
|
123
|
+
'GB',
|
|
124
|
+
'TB'
|
|
125
|
+
][i]) !== null && _a !== void 0 ? _a : 'B';
|
|
126
|
+
return "".concat(value, " ").concat(unit);
|
|
127
|
+
};
|
|
113
128
|
var $622cd2936b18c771$export$f169ab786cd97dc0 = function(_a) {
|
|
114
129
|
var styles = _a.styles, stylesOverrides = _a.stylesOverrides, customStyles = _a.customStyles, identifier = _a.identifier, type = _a.type;
|
|
115
130
|
return $622cd2936b18c771$export$4370d69198e9314a((0, ($parcel$interopDefault($iA2ta$lodashget)))(type ? (0, ($parcel$interopDefault($iA2ta$lodashget)))(styles, type) : styles, identifier), (0, ($parcel$interopDefault($iA2ta$lodashget)))(type ? (0, ($parcel$interopDefault($iA2ta$lodashget)))(stylesOverrides, type) : stylesOverrides, identifier), customStyles);
|
|
@@ -119,6 +134,60 @@ var $622cd2936b18c771$export$7493424cf90fe793 = function(value) {
|
|
|
119
134
|
if ((0, $iA2ta$lodash.isArray)(value)) return (0, $iA2ta$lodash.map)(value, 'value');
|
|
120
135
|
return value === null || value === void 0 ? void 0 : value.value;
|
|
121
136
|
};
|
|
137
|
+
var $622cd2936b18c771$export$648c405ef8d23fec = function(price) {
|
|
138
|
+
if (price == null || isNaN(price)) return "\u20AC -,-";
|
|
139
|
+
return (price / 100).toLocaleString('nl-BE', {
|
|
140
|
+
style: 'currency',
|
|
141
|
+
currency: 'EUR'
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
var $622cd2936b18c771$export$f3f93e5bb54c3de5 = function(nrn) {
|
|
145
|
+
if (!nrn || nrn.length > 11) return '';
|
|
146
|
+
var formatted = nrn;
|
|
147
|
+
if (nrn.length < 11) formatted = (0, $iA2ta$lodash.padStart)(nrn, 11, '0');
|
|
148
|
+
return "".concat(formatted.slice(0, 2), ".").concat(formatted.slice(2, 4), ".").concat(formatted.slice(4, 6), "-").concat(formatted.slice(6, 9), ".").concat(formatted.slice(9, 11));
|
|
149
|
+
};
|
|
150
|
+
var $622cd2936b18c771$export$b2669f8969cc59be = function(user) {
|
|
151
|
+
if (!user) return '';
|
|
152
|
+
var firstName = user.firstName, lastName = user.lastName, email = user.email;
|
|
153
|
+
if (firstName && lastName) return "".concat(firstName, " ").concat(lastName);
|
|
154
|
+
if (firstName) return firstName;
|
|
155
|
+
if (email) return email;
|
|
156
|
+
return '';
|
|
157
|
+
};
|
|
158
|
+
var $622cd2936b18c771$export$d9f806f9324c35ff = function(user) {
|
|
159
|
+
if (!user) return '';
|
|
160
|
+
var firstName = user.firstName, lastName = user.lastName, email = user.email;
|
|
161
|
+
if (firstName && lastName) return "".concat(firstName[0]).concat(lastName[0]);
|
|
162
|
+
if (email) return email[0];
|
|
163
|
+
return '?';
|
|
164
|
+
};
|
|
165
|
+
var $622cd2936b18c771$export$91d20e9290e3c358 = function(value) {
|
|
166
|
+
if (!value) return '';
|
|
167
|
+
var street = value.street, houseNumber = value.houseNumber, busNumber = value.busNumber, zipCode = value.zipCode, city = value.city, country = value.country;
|
|
168
|
+
var parts = [
|
|
169
|
+
street && houseNumber ? "".concat(street, " ").concat(houseNumber) : street || '',
|
|
170
|
+
busNumber ? "Bus ".concat(busNumber) : '',
|
|
171
|
+
zipCode && city ? "".concat(zipCode, " ").concat(city) : '',
|
|
172
|
+
country || ''
|
|
173
|
+
].filter(Boolean);
|
|
174
|
+
return parts.join(', ');
|
|
175
|
+
};
|
|
176
|
+
var $622cd2936b18c771$export$ba96624aa3b67894 = function(value) {
|
|
177
|
+
if (!value) return undefined;
|
|
178
|
+
var street = value.street, houseNumber = value.houseNumber, busNumber = value.busNumber, zipCode = value.zipCode, city = value.city, country = value.country, lat = value.lat, lng = value.lng;
|
|
179
|
+
if (lat != null && lng != null) return "https://www.google.com/maps/search/?api=1&query=".concat(lat, "%2C").concat(lng);
|
|
180
|
+
var parts = [
|
|
181
|
+
street,
|
|
182
|
+
houseNumber,
|
|
183
|
+
busNumber ? "Bus ".concat(busNumber) : '',
|
|
184
|
+
zipCode,
|
|
185
|
+
city,
|
|
186
|
+
country
|
|
187
|
+
].filter(Boolean).join(' ');
|
|
188
|
+
var query = encodeURIComponent(parts);
|
|
189
|
+
return "https://www.google.com/maps/search/?api=1&query=".concat(query);
|
|
190
|
+
};
|
|
122
191
|
|
|
123
192
|
|
|
124
193
|
var $f0c671820c340322$export$e2d2075c69d9100d = function(object) {
|
|
@@ -450,7 +519,7 @@ var $fbfda6b39c475fe4$var$styles = {
|
|
|
450
519
|
var $fbfda6b39c475fe4$export$2e2bcd8739ae039 = $fbfda6b39c475fe4$var$styles;
|
|
451
520
|
|
|
452
521
|
|
|
453
|
-
var $29a51bd84954e590$var$
|
|
522
|
+
var $29a51bd84954e590$var$AlertElement = function(props) {
|
|
454
523
|
var title = props.title, message = props.message, _a = props.type, type = _a === void 0 ? 'generic' : _a, _b = props.onClose, onClose = _b === void 0 ? (0, $iA2ta$lodash.noop) : _b, _c = props.onCollapse, onCollapse = _c === void 0 ? (0, $iA2ta$lodash.noop) : _c, _d = props.isCollapsible, isCollapsible = _d === void 0 ? false : _d, stylesOverrides = props.styles, iconAccessorOverride = props.iconAccessor;
|
|
455
524
|
var _e = (0, $iA2ta$react.useState)(false), isCollapsed = _e[0], setIsCollapsed = _e[1];
|
|
456
525
|
var handleGenerateStyle = function() {
|
|
@@ -534,7 +603,7 @@ var $29a51bd84954e590$var$BadgeElement = function(props) {
|
|
|
534
603
|
]
|
|
535
604
|
});
|
|
536
605
|
};
|
|
537
|
-
var $29a51bd84954e590$export$2e2bcd8739ae039 = $29a51bd84954e590$var$
|
|
606
|
+
var $29a51bd84954e590$export$2e2bcd8739ae039 = $29a51bd84954e590$var$AlertElement;
|
|
538
607
|
|
|
539
608
|
|
|
540
609
|
|
|
@@ -4094,7 +4163,7 @@ var $9420756208be2d43$var$defaultStyles = {
|
|
|
4094
4163
|
};
|
|
4095
4164
|
var $9420756208be2d43$var$underline = {
|
|
4096
4165
|
tab: {
|
|
4097
|
-
base: 'whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm cursor-pointer',
|
|
4166
|
+
base: 'whitespace-nowrap flex gap-2 py-4 px-1 border-b-2 font-medium text-sm cursor-pointer',
|
|
4098
4167
|
active: 'border-primary-500 text-primary-600',
|
|
4099
4168
|
inactive: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'
|
|
4100
4169
|
}
|
|
@@ -4178,16 +4247,18 @@ var $06795e94e474e27d$var$List = function(props) {
|
|
|
4178
4247
|
setActive
|
|
4179
4248
|
]);
|
|
4180
4249
|
(0, $iA2ta$react.useEffect)(function() {
|
|
4250
|
+
var _a;
|
|
4181
4251
|
var tab;
|
|
4182
4252
|
var tabs = (0, $iA2ta$react.Children).map(children, function(child) {
|
|
4183
4253
|
return child;
|
|
4184
4254
|
});
|
|
4185
|
-
var initialTab =
|
|
4186
|
-
|
|
4187
|
-
|
|
4255
|
+
var initialTab = (0, $iA2ta$lodash.find)(tabs, [
|
|
4256
|
+
'props.isInitial',
|
|
4257
|
+
true
|
|
4258
|
+
]);
|
|
4188
4259
|
if (initialTab !== undefined) tab = initialTab;
|
|
4189
4260
|
else tab = tabs[0];
|
|
4190
|
-
setActive && setActive(tab === null || tab === void 0 ? void 0 : tab.props.accessor);
|
|
4261
|
+
setActive && setActive((_a = tab === null || tab === void 0 ? void 0 : tab.props) === null || _a === void 0 ? void 0 : _a.accessor);
|
|
4191
4262
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4192
4263
|
}, []);
|
|
4193
4264
|
var handleCalculateActiveAccessor = function() {
|
|
@@ -4220,9 +4291,10 @@ var $06795e94e474e27d$var$List = function(props) {
|
|
|
4220
4291
|
onChange: handleChangeSelect,
|
|
4221
4292
|
children: (0, $iA2ta$react.Children).map(children, function(child) {
|
|
4222
4293
|
var _a;
|
|
4294
|
+
if (child.props.isHidden) return null;
|
|
4223
4295
|
return (0, $iA2ta$reactjsxruntime.jsx)("option", {
|
|
4224
4296
|
value: child.props.accessor,
|
|
4225
|
-
children: child.props.
|
|
4297
|
+
children: child.props.label
|
|
4226
4298
|
}, (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.accessor);
|
|
4227
4299
|
})
|
|
4228
4300
|
})
|
|
@@ -4239,7 +4311,7 @@ var $06795e94e474e27d$var$List = function(props) {
|
|
|
4239
4311
|
});
|
|
4240
4312
|
};
|
|
4241
4313
|
var $06795e94e474e27d$var$Item = function(props) {
|
|
4242
|
-
var
|
|
4314
|
+
var label = props.label, icon = props.icon, _a = props.as, LinkComponent = _a === void 0 ? 'a' : _a, _b = props.type, type = _b === void 0 ? 'underline' : _b, href = props.href, isCurrent = props.isCurrent, onClick = props.onClick, stylesOverrides = props.styles, isLoading = props.isLoading, isHidden = props.isHidden;
|
|
4243
4315
|
if (isHidden) return null;
|
|
4244
4316
|
var handleGenerateStyle = function() {
|
|
4245
4317
|
var result = (0, $f0c671820c340322$export$e2d2075c69d9100d)((0, $9420756208be2d43$export$2e2bcd8739ae039).base);
|
|
@@ -4250,18 +4322,24 @@ var $06795e94e474e27d$var$Item = function(props) {
|
|
|
4250
4322
|
return result;
|
|
4251
4323
|
};
|
|
4252
4324
|
var styles = handleGenerateStyle();
|
|
4253
|
-
if (href && LinkComponent) return (0, $iA2ta$reactjsxruntime.
|
|
4325
|
+
if (href && LinkComponent) return (0, $iA2ta$reactjsxruntime.jsxs)(LinkComponent, {
|
|
4254
4326
|
href: href,
|
|
4255
4327
|
className: (0, $622cd2936b18c771$export$4370d69198e9314a)(styles.tab.base, isCurrent ? styles.tab.active : styles.tab.inactive, isLoading && 'opacity-30 !text-gray-300 !cursor-default', isLoading && styles.tab.inactive),
|
|
4256
4328
|
onClick: onClick,
|
|
4257
|
-
children:
|
|
4329
|
+
children: [
|
|
4330
|
+
icon,
|
|
4331
|
+
label
|
|
4332
|
+
]
|
|
4258
4333
|
});
|
|
4259
|
-
return (0, $iA2ta$reactjsxruntime.
|
|
4334
|
+
return (0, $iA2ta$reactjsxruntime.jsxs)("div", {
|
|
4260
4335
|
className: (0, $622cd2936b18c771$export$4370d69198e9314a)(styles.tab.base, isCurrent ? styles.tab.active : styles.tab.inactive, isLoading && 'opacity-30 !text-gray-300 !cursor-default', isLoading && styles.tab.inactive),
|
|
4261
4336
|
onClick: !isLoading ? onClick : function() {
|
|
4262
4337
|
return null;
|
|
4263
4338
|
},
|
|
4264
|
-
children:
|
|
4339
|
+
children: [
|
|
4340
|
+
icon,
|
|
4341
|
+
label
|
|
4342
|
+
]
|
|
4265
4343
|
});
|
|
4266
4344
|
};
|
|
4267
4345
|
var $06795e94e474e27d$var$View = function(props) {
|
|
@@ -5919,8 +5997,12 @@ var $17bb03e8d27b8746$var$OpeningHourItem = function(props) {
|
|
|
5919
5997
|
value: (_g = options[(_f = (_e = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.day) !== null && _e !== void 0 ? _e : dayPlaceholder) !== null && _f !== void 0 ? _f : 0]) === null || _g === void 0 ? void 0 : _g.value
|
|
5920
5998
|
},
|
|
5921
5999
|
closed: (_h = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.closed) !== null && _h !== void 0 ? _h : false,
|
|
5922
|
-
openingTime: (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.openingTime) ? (0,
|
|
5923
|
-
|
|
6000
|
+
openingTime: (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.openingTime) ? (0, $iA2ta$luxon.DateTime).fromISO(defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.openingTime).minus({
|
|
6001
|
+
hours: 2
|
|
6002
|
+
}).toFormat('HH:mm') : '',
|
|
6003
|
+
closingTime: (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.closingTime) ? (0, $iA2ta$luxon.DateTime).fromISO(defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.closingTime).minus({
|
|
6004
|
+
hours: 2
|
|
6005
|
+
}).toFormat('HH:mm') : ''
|
|
5924
6006
|
};
|
|
5925
6007
|
}, [
|
|
5926
6008
|
dayPlaceholder,
|
|
@@ -5935,7 +6017,12 @@ var $17bb03e8d27b8746$var$OpeningHourItem = function(props) {
|
|
|
5935
6017
|
var toTimeStamp = (0, $iA2ta$react.useCallback)(function(value) {
|
|
5936
6018
|
if (value === undefined) return undefined;
|
|
5937
6019
|
var _a = value.split(':'), hours = _a[0], minutes = _a[1];
|
|
5938
|
-
return (0,
|
|
6020
|
+
return (0, $iA2ta$luxon.DateTime).utc().set({
|
|
6021
|
+
hour: Number(hours),
|
|
6022
|
+
minute: Number(minutes),
|
|
6023
|
+
second: 0,
|
|
6024
|
+
millisecond: 0
|
|
6025
|
+
}).toISO();
|
|
5939
6026
|
}, []);
|
|
5940
6027
|
var onSubmit = (0, $iA2ta$react.useCallback)(function(values) {
|
|
5941
6028
|
var _a;
|
|
@@ -6339,7 +6426,6 @@ var $9f6cfd21b337aca9$export$2e2bcd8739ae039 = $9f6cfd21b337aca9$var$OpeningsHou
|
|
|
6339
6426
|
|
|
6340
6427
|
|
|
6341
6428
|
|
|
6342
|
-
|
|
6343
6429
|
var $03b368478cf695f0$var$base = {
|
|
6344
6430
|
container: '',
|
|
6345
6431
|
head: 'flex justify-between',
|
|
@@ -6467,7 +6553,7 @@ var $7fcfa1d90c4a7e45$var$AddressInputGroupForm = function(props) {
|
|
|
6467
6553
|
}),
|
|
6468
6554
|
(0, $iA2ta$reactjsxruntime.jsx)("div", {
|
|
6469
6555
|
className: styles.body,
|
|
6470
|
-
children: (0, $iA2ta$reactjsxruntime.jsx)((0, ($parcel$interopDefault($iA2ta$
|
|
6556
|
+
children: (0, $iA2ta$reactjsxruntime.jsx)((0, ($parcel$interopDefault($iA2ta$ubilabsreactgeosuggest))), {
|
|
6471
6557
|
types: [
|
|
6472
6558
|
'address'
|
|
6473
6559
|
],
|
|
@@ -6555,8 +6641,7 @@ var $7fcfa1d90c4a7e45$var$AddressInputGroupForm = function(props) {
|
|
|
6555
6641
|
info: value === null || value === void 0 ? void 0 : value.info
|
|
6556
6642
|
};
|
|
6557
6643
|
onBlur && onBlur(location);
|
|
6558
|
-
}
|
|
6559
|
-
children: (0, $iA2ta$reactjsxruntime.jsx)((0, $iA2ta$reactjsxruntime.Fragment), {})
|
|
6644
|
+
}
|
|
6560
6645
|
})
|
|
6561
6646
|
}),
|
|
6562
6647
|
(0, $iA2ta$reactjsxruntime.jsxs)("div", {
|