allaw-ui 0.1.68 → 0.1.70
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/components/molecules/clientLinkCard/ClientLinkCard.css +5 -5
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
- package/dist/components/atoms/buttons/ActionCircleButton.d.ts +0 -9
- package/dist/components/atoms/buttons/ActionCircleButton.js +0 -23
- package/dist/components/atoms/buttons/AgendaSlot.d.ts +0 -10
- package/dist/components/atoms/buttons/AgendaSlot.js +0 -7
- package/dist/components/atoms/buttons/FavoriteToggle.d.ts +0 -8
- package/dist/components/atoms/buttons/FavoriteToggle.js +0 -11
- package/dist/components/atoms/buttons/FilterButton.d.ts +0 -9
- package/dist/components/atoms/buttons/FilterButton.js +0 -9
- package/dist/components/atoms/buttons/FilterButtonPrimary.d.ts +0 -9
- package/dist/components/atoms/buttons/FilterButtonPrimary.js +0 -46
- package/dist/components/atoms/buttons/GhostButton.d.ts +0 -14
- package/dist/components/atoms/buttons/GhostButton.js +0 -11
- package/dist/components/atoms/buttons/IconButton.d.ts +0 -11
- package/dist/components/atoms/buttons/IconButton.js +0 -14
- package/dist/components/atoms/buttons/OAuthProviderButton.d.ts +0 -12
- package/dist/components/atoms/buttons/OAuthProviderButton.js +0 -143
- package/dist/components/atoms/buttons/PendingDocuments.d.ts +0 -10
- package/dist/components/atoms/buttons/PendingDocuments.js +0 -13
- package/dist/components/atoms/buttons/PrimaryButton.d.ts +0 -17
- package/dist/components/atoms/buttons/PrimaryButton.js +0 -117
- package/dist/components/atoms/buttons/SecondaryButton.d.ts +0 -18
- package/dist/components/atoms/buttons/SecondaryButton.js +0 -117
- package/dist/components/atoms/buttons/TabNavigation.d.ts +0 -13
- package/dist/components/atoms/buttons/TabNavigation.js +0 -10
- package/dist/components/atoms/buttons/TertiaryButton.d.ts +0 -11
- package/dist/components/atoms/buttons/TertiaryButton.js +0 -10
- package/dist/components/atoms/buttons/index.d.ts +0 -22
- package/dist/components/atoms/buttons/index.js +0 -11
- package/dist/components/atoms/checkboxes/Checkbox.d.ts +0 -14
- package/dist/components/atoms/checkboxes/Checkbox.js +0 -19
- package/dist/components/atoms/checkboxes/index.d.ts +0 -2
- package/dist/components/atoms/checkboxes/index.js +0 -1
- package/dist/components/atoms/filter/Filter.d.ts +0 -17
- package/dist/components/atoms/filter/Filter.js +0 -70
- package/dist/components/atoms/filter/index.d.ts +0 -2
- package/dist/components/atoms/filter/index.js +0 -1
- package/dist/components/atoms/filters/SingleFilter.d.ts +0 -17
- package/dist/components/atoms/filters/SingleFilter.js +0 -81
- package/dist/components/atoms/filters/index.d.ts +0 -2
- package/dist/components/atoms/filters/index.js +0 -1
- package/dist/components/atoms/inputs/Input.d.ts +0 -22
- package/dist/components/atoms/inputs/Input.js +0 -86
- package/dist/components/atoms/inputs/SearchBar.d.ts +0 -12
- package/dist/components/atoms/inputs/SearchBar.js +0 -20
- package/dist/components/atoms/inputs/TextArea.d.ts +0 -21
- package/dist/components/atoms/inputs/TextArea.js +0 -66
- package/dist/components/atoms/inputs/index.d.ts +0 -6
- package/dist/components/atoms/inputs/index.js +0 -3
- package/dist/components/atoms/progressBars/ProgressBar.d.ts +0 -15
- package/dist/components/atoms/progressBars/ProgressBar.js +0 -18
- package/dist/components/atoms/progressBars/index.d.ts +0 -2
- package/dist/components/atoms/progressBars/index.js +0 -1
- package/dist/components/atoms/radios/RadioButton.d.ts +0 -11
- package/dist/components/atoms/radios/RadioButton.js +0 -10
- package/dist/components/atoms/radios/index.d.ts +0 -2
- package/dist/components/atoms/radios/index.js +0 -1
- package/dist/components/atoms/selects/ComboBox.d.ts +0 -27
- package/dist/components/atoms/selects/ComboBox.js +0 -172
- package/dist/components/atoms/selects/Select.d.ts +0 -25
- package/dist/components/atoms/selects/Select.js +0 -127
- package/dist/components/atoms/selects/index.d.ts +0 -4
- package/dist/components/atoms/selects/index.js +0 -2
- package/dist/components/atoms/tags/AppointementStatusTag.d.ts +0 -8
- package/dist/components/atoms/tags/AppointementStatusTag.js +0 -42
- package/dist/components/atoms/tags/FolderStatusTag.d.ts +0 -7
- package/dist/components/atoms/tags/FolderStatusTag.js +0 -8
- package/dist/components/atoms/tags/OtherStatusTag.d.ts +0 -10
- package/dist/components/atoms/tags/OtherStatusTag.js +0 -10
- package/dist/components/atoms/tags/index.d.ts +0 -6
- package/dist/components/atoms/tags/index.js +0 -3
- package/dist/components/atoms/typography/Heading.d.ts +0 -10
- package/dist/components/atoms/typography/Heading.js +0 -7
- package/dist/components/atoms/typography/Paragraph.d.ts +0 -12
- package/dist/components/atoms/typography/Paragraph.js +0 -33
- package/dist/components/atoms/typography/SmallTitle.d.ts +0 -9
- package/dist/components/atoms/typography/SmallTitle.js +0 -7
- package/dist/components/atoms/typography/Subtitle.d.ts +0 -9
- package/dist/components/atoms/typography/Subtitle.js +0 -7
- package/dist/components/atoms/typography/TinyInfo.d.ts +0 -12
- package/dist/components/atoms/typography/TinyInfo.js +0 -15
- package/dist/components/atoms/typography/index.d.ts +0 -10
- package/dist/components/atoms/typography/index.js +0 -5
- package/dist/components/atoms/uiVariables/BorderRadius.d.ts +0 -6
- package/dist/components/atoms/uiVariables/BorderRadius.js +0 -12
- package/dist/components/atoms/uiVariables/Shadows.d.ts +0 -6
- package/dist/components/atoms/uiVariables/Shadows.js +0 -11
- package/dist/components/atoms/uiVariables/Strokes.d.ts +0 -6
- package/dist/components/atoms/uiVariables/Strokes.js +0 -10
- package/dist/components/atoms/uiVariables/index.d.ts +0 -3
- package/dist/components/atoms/uiVariables/index.js +0 -3
- package/dist/components/molecules/appointmentSlot/AppointmentSlot.d.ts +0 -25
- package/dist/components/molecules/appointmentSlot/AppointmentSlot.js +0 -109
- package/dist/components/molecules/appointmentSlot/index.d.ts +0 -2
- package/dist/components/molecules/appointmentSlot/index.js +0 -1
- package/dist/components/molecules/breadcrumb/Breadcrumb.d.ts +0 -12
- package/dist/components/molecules/breadcrumb/Breadcrumb.js +0 -12
- package/dist/components/molecules/breadcrumb/index.d.ts +0 -2
- package/dist/components/molecules/breadcrumb/index.js +0 -1
- package/dist/components/molecules/caseCard/CaseCard.d.ts +0 -14
- package/dist/components/molecules/caseCard/CaseCard.js +0 -20
- package/dist/components/molecules/caseCard/index.d.ts +0 -2
- package/dist/components/molecules/caseCard/index.js +0 -1
- package/dist/components/molecules/caseLinkCard/CaseLinkCard.d.ts +0 -11
- package/dist/components/molecules/caseLinkCard/CaseLinkCard.js +0 -30
- package/dist/components/molecules/caseLinkCard/index.d.ts +0 -2
- package/dist/components/molecules/caseLinkCard/index.js +0 -1
- package/dist/components/molecules/checkboxForm/CheckboxForm.d.ts +0 -17
- package/dist/components/molecules/checkboxForm/CheckboxForm.js +0 -24
- package/dist/components/molecules/checkboxForm/index.d.ts +0 -2
- package/dist/components/molecules/checkboxForm/index.js +0 -1
- package/dist/components/molecules/clientLinkCard/ClientLinkCard.d.ts +0 -13
- package/dist/components/molecules/clientLinkCard/ClientLinkCard.js +0 -16
- package/dist/components/molecules/clientLinkCard/index.d.ts +0 -2
- package/dist/components/molecules/clientLinkCard/index.js +0 -1
- package/dist/components/molecules/contactCard/ContactCard.d.ts +0 -17
- package/dist/components/molecules/contactCard/ContactCard.js +0 -80
- package/dist/components/molecules/contactCard/index.d.ts +0 -2
- package/dist/components/molecules/contactCard/index.js +0 -1
- package/dist/components/molecules/documentCard/DocumentCard.d.ts +0 -15
- package/dist/components/molecules/documentCard/DocumentCard.js +0 -72
- package/dist/components/molecules/documentCard/index.d.ts +0 -2
- package/dist/components/molecules/documentCard/index.js +0 -1
- package/dist/components/molecules/employeeCard/EmployeeCard.d.ts +0 -15
- package/dist/components/molecules/employeeCard/EmployeeCard.js +0 -34
- package/dist/components/molecules/employeeCard/index.d.ts +0 -2
- package/dist/components/molecules/employeeCard/index.js +0 -1
- package/dist/components/molecules/loadingBox/LoadingBox.d.ts +0 -9
- package/dist/components/molecules/loadingBox/LoadingBox.js +0 -7
- package/dist/components/molecules/loadingBox/index.d.ts +0 -2
- package/dist/components/molecules/loadingBox/index.js +0 -1
- package/dist/components/molecules/proCard/ProCard.d.ts +0 -13
- package/dist/components/molecules/proCard/ProCard.js +0 -25
- package/dist/components/molecules/proCard/index.d.ts +0 -2
- package/dist/components/molecules/proCard/index.js +0 -1
- package/dist/components/molecules/radioForm/RadioForm.d.ts +0 -12
- package/dist/components/molecules/radioForm/RadioForm.js +0 -27
- package/dist/components/molecules/radioForm/index.d.ts +0 -2
- package/dist/components/molecules/radioForm/index.js +0 -1
- package/dist/components/molecules/selectForm/SelectForm.d.ts +0 -15
- package/dist/components/molecules/selectForm/SelectForm.js +0 -15
- package/dist/components/molecules/selectForm/index.d.ts +0 -2
- package/dist/components/molecules/selectForm/index.js +0 -1
- package/dist/components/molecules/stepper/Stepper.d.ts +0 -34
- package/dist/components/molecules/stepper/Stepper.js +0 -123
- package/dist/components/molecules/stepper/index.d.ts +0 -2
- package/dist/components/molecules/stepper/index.js +0 -1
- package/dist/index.d.ts +0 -51
- package/dist/index.js +0 -71
- package/dist/utils/regex.d.ts +0 -5
- package/dist/utils/regex.js +0 -7
- package/dist/utils/utils.d.ts +0 -2
- package/dist/utils/utils.js +0 -48
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { ButtonHTMLAttributes } from "react";
|
|
2
|
-
import "./PrimaryButton.css";
|
|
3
|
-
import "../../../styles/global.css";
|
|
4
|
-
export interface PrimaryButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
-
startIcon?: React.ReactNode;
|
|
6
|
-
endIcon?: React.ReactNode;
|
|
7
|
-
startIconName?: string;
|
|
8
|
-
endIconName?: string;
|
|
9
|
-
label: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
onClick?: () => Promise<void> | void;
|
|
12
|
-
fullWidth?: boolean;
|
|
13
|
-
type?: "button" | "submit" | "reset";
|
|
14
|
-
isLoading?: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const PrimaryButton: React.ForwardRefExoticComponent<PrimaryButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
-
export default PrimaryButton;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
50
|
-
var t = {};
|
|
51
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
52
|
-
t[p] = s[p];
|
|
53
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
54
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
55
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
56
|
-
t[p[i]] = s[p[i]];
|
|
57
|
-
}
|
|
58
|
-
return t;
|
|
59
|
-
};
|
|
60
|
-
import React, { forwardRef, useImperativeHandle, useState, useEffect, } from "react";
|
|
61
|
-
import "./PrimaryButton.css";
|
|
62
|
-
import "../../../styles/global.css";
|
|
63
|
-
var PrimaryButton = forwardRef(function (_a, ref) {
|
|
64
|
-
var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onClick = _a.onClick, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? "button" : _d, _e = _a.isLoading, isLoading = _e === void 0 ? false : _e, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "onClick", "fullWidth", "type", "isLoading"]);
|
|
65
|
-
var buttonRef = React.useRef(null);
|
|
66
|
-
var _f = useState(false), internalIsLoading = _f[0], setInternalIsLoading = _f[1];
|
|
67
|
-
var _g = useState(""), loadingDots = _g[0], setLoadingDots = _g[1];
|
|
68
|
-
useImperativeHandle(ref, function () { return buttonRef.current; });
|
|
69
|
-
var isButtonLoading = isLoading || internalIsLoading;
|
|
70
|
-
useEffect(function () {
|
|
71
|
-
var interval = null;
|
|
72
|
-
if (isButtonLoading) {
|
|
73
|
-
interval = setInterval(function () {
|
|
74
|
-
setLoadingDots(function (prev) {
|
|
75
|
-
if (prev.length >= 3)
|
|
76
|
-
return "";
|
|
77
|
-
return prev + ".";
|
|
78
|
-
});
|
|
79
|
-
}, 500);
|
|
80
|
-
}
|
|
81
|
-
return function () {
|
|
82
|
-
if (interval) {
|
|
83
|
-
clearInterval(interval);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}, [isButtonLoading]);
|
|
87
|
-
var handleClick = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
-
return __generator(this, function (_a) {
|
|
89
|
-
switch (_a.label) {
|
|
90
|
-
case 0:
|
|
91
|
-
if (isButtonLoading) {
|
|
92
|
-
event.preventDefault();
|
|
93
|
-
return [2 /*return*/];
|
|
94
|
-
}
|
|
95
|
-
if (!onClick) return [3 /*break*/, 4];
|
|
96
|
-
setInternalIsLoading(true);
|
|
97
|
-
_a.label = 1;
|
|
98
|
-
case 1:
|
|
99
|
-
_a.trys.push([1, , 3, 4]);
|
|
100
|
-
return [4 /*yield*/, onClick()];
|
|
101
|
-
case 2:
|
|
102
|
-
_a.sent();
|
|
103
|
-
return [3 /*break*/, 4];
|
|
104
|
-
case 3:
|
|
105
|
-
setInternalIsLoading(false);
|
|
106
|
-
return [7 /*endfinally*/];
|
|
107
|
-
case 4: return [2 /*return*/];
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}); };
|
|
111
|
-
return (React.createElement("button", __assign({ ref: buttonRef, className: "primary-button ".concat(disabled ? "primary-button-disabled" : "primary-button-enabled", " ").concat(fullWidth ? "primary-button-full-width" : "", " ").concat(isButtonLoading ? "primary-button-loading" : ""), disabled: disabled, onClick: handleClick, type: type }, props),
|
|
112
|
-
startIcon && (React.createElement("span", { className: "primary-button-icon ".concat(startIconName) })),
|
|
113
|
-
React.createElement("span", { className: "primary-button-label" }, label),
|
|
114
|
-
isButtonLoading ? (React.createElement("span", { className: "primary-button-loading-dots" }, loadingDots)) : (endIcon && React.createElement("span", { className: "primary-button-icon ".concat(endIconName) }))));
|
|
115
|
-
});
|
|
116
|
-
PrimaryButton.displayName = "PrimaryButton";
|
|
117
|
-
export default PrimaryButton;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React, { ButtonHTMLAttributes } from "react";
|
|
2
|
-
import "./SecondaryButton.css";
|
|
3
|
-
import "../../../styles/global.css";
|
|
4
|
-
export interface SecondaryButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
-
startIcon?: React.ReactNode;
|
|
6
|
-
endIcon?: React.ReactNode;
|
|
7
|
-
startIconName?: string;
|
|
8
|
-
endIconName?: string;
|
|
9
|
-
label: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
mode?: "dark" | "light";
|
|
12
|
-
onClick?: () => Promise<void> | void;
|
|
13
|
-
fullWidth?: boolean;
|
|
14
|
-
type?: "button" | "submit" | "reset";
|
|
15
|
-
isLoading?: boolean;
|
|
16
|
-
}
|
|
17
|
-
declare const SecondaryButton: React.ForwardRefExoticComponent<SecondaryButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
-
export default SecondaryButton;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
50
|
-
var t = {};
|
|
51
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
52
|
-
t[p] = s[p];
|
|
53
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
54
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
55
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
56
|
-
t[p[i]] = s[p[i]];
|
|
57
|
-
}
|
|
58
|
-
return t;
|
|
59
|
-
};
|
|
60
|
-
import React, { forwardRef, useImperativeHandle, useState, useEffect, } from "react";
|
|
61
|
-
import "./SecondaryButton.css";
|
|
62
|
-
import "../../../styles/global.css";
|
|
63
|
-
var SecondaryButton = forwardRef(function (_a, ref) {
|
|
64
|
-
var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.mode, mode = _c === void 0 ? "dark" : _c, onClick = _a.onClick, _d = _a.fullWidth, fullWidth = _d === void 0 ? false : _d, _e = _a.type, type = _e === void 0 ? "button" : _e, _f = _a.isLoading, isLoading = _f === void 0 ? false : _f, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "mode", "onClick", "fullWidth", "type", "isLoading"]);
|
|
65
|
-
var buttonRef = React.useRef(null);
|
|
66
|
-
var _g = useState(false), internalIsLoading = _g[0], setInternalIsLoading = _g[1];
|
|
67
|
-
var _h = useState(""), loadingDots = _h[0], setLoadingDots = _h[1];
|
|
68
|
-
useImperativeHandle(ref, function () { return buttonRef.current; });
|
|
69
|
-
var isButtonLoading = isLoading || internalIsLoading;
|
|
70
|
-
useEffect(function () {
|
|
71
|
-
var interval = null;
|
|
72
|
-
if (isButtonLoading) {
|
|
73
|
-
interval = setInterval(function () {
|
|
74
|
-
setLoadingDots(function (prev) {
|
|
75
|
-
if (prev.length >= 3)
|
|
76
|
-
return "";
|
|
77
|
-
return prev + ".";
|
|
78
|
-
});
|
|
79
|
-
}, 500);
|
|
80
|
-
}
|
|
81
|
-
return function () {
|
|
82
|
-
if (interval) {
|
|
83
|
-
clearInterval(interval);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}, [isButtonLoading]);
|
|
87
|
-
var handleClick = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
-
return __generator(this, function (_a) {
|
|
89
|
-
switch (_a.label) {
|
|
90
|
-
case 0:
|
|
91
|
-
if (isButtonLoading) {
|
|
92
|
-
event.preventDefault();
|
|
93
|
-
return [2 /*return*/];
|
|
94
|
-
}
|
|
95
|
-
if (!onClick) return [3 /*break*/, 4];
|
|
96
|
-
setInternalIsLoading(true);
|
|
97
|
-
_a.label = 1;
|
|
98
|
-
case 1:
|
|
99
|
-
_a.trys.push([1, , 3, 4]);
|
|
100
|
-
return [4 /*yield*/, onClick()];
|
|
101
|
-
case 2:
|
|
102
|
-
_a.sent();
|
|
103
|
-
return [3 /*break*/, 4];
|
|
104
|
-
case 3:
|
|
105
|
-
setInternalIsLoading(false);
|
|
106
|
-
return [7 /*endfinally*/];
|
|
107
|
-
case 4: return [2 /*return*/];
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}); };
|
|
111
|
-
return (React.createElement("button", __assign({ ref: buttonRef, className: "secondary-button ".concat(disabled ? "secondary-button-disabled" : "secondary-button-enabled", " secondary-button-").concat(mode, " ").concat(fullWidth ? "secondary-button-full-width" : "", " ").concat(isButtonLoading ? "secondary-button-loading" : ""), disabled: disabled, onClick: handleClick, type: type }, props),
|
|
112
|
-
startIcon && (React.createElement("span", { className: "secondary-button-icon ".concat(startIconName) })),
|
|
113
|
-
React.createElement("span", { className: "secondary-button-label" }, label),
|
|
114
|
-
isButtonLoading ? (React.createElement("span", { className: "secondary-button-loading-dots" }, loadingDots)) : (endIcon && React.createElement("span", { className: "secondary-button-icon ".concat(endIconName) }))));
|
|
115
|
-
});
|
|
116
|
-
SecondaryButton.displayName = "SecondaryButton";
|
|
117
|
-
export default SecondaryButton;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./TabNavigation.css";
|
|
3
|
-
import "../../../styles/global.css";
|
|
4
|
-
export interface TabNavigationProps {
|
|
5
|
-
tabs: {
|
|
6
|
-
label: string;
|
|
7
|
-
isActive: boolean;
|
|
8
|
-
hasNotification: boolean;
|
|
9
|
-
}[];
|
|
10
|
-
onTabClick: (index: number) => void;
|
|
11
|
-
}
|
|
12
|
-
declare const TabNavigation: React.FC<TabNavigationProps>;
|
|
13
|
-
export default TabNavigation;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./TabNavigation.css";
|
|
3
|
-
import "../../../styles/global.css";
|
|
4
|
-
var TabNavigation = function (_a) {
|
|
5
|
-
var tabs = _a.tabs, onTabClick = _a.onTabClick;
|
|
6
|
-
return (React.createElement("div", { className: "tab-navigation" }, tabs.map(function (tab, index) { return (React.createElement("div", { key: index, className: "tab-item ".concat(tab.isActive ? "active" : "inactive"), onClick: function () { return onTabClick(index); } },
|
|
7
|
-
React.createElement("span", { className: "tab-label" }, tab.label),
|
|
8
|
-
tab.hasNotification && React.createElement("span", { className: "tab-notification-dot" }))); })));
|
|
9
|
-
};
|
|
10
|
-
export default TabNavigation;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./TertiaryButton.css";
|
|
3
|
-
import "../../../styles/global.css";
|
|
4
|
-
export interface TertiaryButtonProps {
|
|
5
|
-
startIcon?: string;
|
|
6
|
-
label: string;
|
|
7
|
-
variant?: boolean;
|
|
8
|
-
onClick?: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare const TertiaryButton: React.FC<TertiaryButtonProps>;
|
|
11
|
-
export default TertiaryButton;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./TertiaryButton.css";
|
|
3
|
-
import "../../../styles/global.css";
|
|
4
|
-
var TertiaryButton = function (_a) {
|
|
5
|
-
var startIcon = _a.startIcon, label = _a.label, _b = _a.variant, variant = _b === void 0 ? false : _b, onClick = _a.onClick;
|
|
6
|
-
return (React.createElement("button", { type: "button", className: "tertiary-button ".concat(variant ? "tertiary-button-variant" : "tertiary-button-default"), onClick: onClick },
|
|
7
|
-
startIcon && React.createElement("span", { className: "tertiary-button-icon ".concat(startIcon) }),
|
|
8
|
-
React.createElement("span", { className: "tertiary-button-label" }, label)));
|
|
9
|
-
};
|
|
10
|
-
export default TertiaryButton;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export { default as FavoriteToggle } from "./FavoriteToggle";
|
|
2
|
-
export { default as FilterButtonPrimary } from "./FilterButtonPrimary";
|
|
3
|
-
export { default as FilterButton } from "./FilterButton";
|
|
4
|
-
export { default as GhostButton } from "./GhostButton";
|
|
5
|
-
export { default as IconButton } from "./IconButton";
|
|
6
|
-
export { default as PendingDocuments } from "./PendingDocuments";
|
|
7
|
-
export { default as PrimaryButton } from "./PrimaryButton";
|
|
8
|
-
export { default as SecondaryButton } from "./SecondaryButton";
|
|
9
|
-
export { default as TabNavigation } from "./TabNavigation";
|
|
10
|
-
export { default as TertiaryButton } from "./TertiaryButton";
|
|
11
|
-
export { default as OAuthProviderButton } from "./OAuthProviderButton";
|
|
12
|
-
export type { FavoriteToggleProps } from "./FavoriteToggle";
|
|
13
|
-
export type { FilterButtonProps } from "./FilterButton";
|
|
14
|
-
export type { GhostButtonProps } from "./GhostButton";
|
|
15
|
-
export type { IconButtonProps } from "./IconButton";
|
|
16
|
-
export type { PendingDocumentsProps } from "./PendingDocuments";
|
|
17
|
-
export type { PrimaryButtonProps } from "./PrimaryButton";
|
|
18
|
-
export type { SecondaryButtonProps } from "./SecondaryButton";
|
|
19
|
-
export type { TabNavigationProps } from "./TabNavigation";
|
|
20
|
-
export type { TertiaryButtonProps } from "./TertiaryButton";
|
|
21
|
-
export type { OAuthProviderButtonProps } from "./OAuthProviderButton";
|
|
22
|
-
export type { FilterButtonPrimaryProps } from "./FilterButtonPrimary";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { default as FavoriteToggle } from "./FavoriteToggle";
|
|
2
|
-
export { default as FilterButtonPrimary } from "./FilterButtonPrimary";
|
|
3
|
-
export { default as FilterButton } from "./FilterButton";
|
|
4
|
-
export { default as GhostButton } from "./GhostButton";
|
|
5
|
-
export { default as IconButton } from "./IconButton";
|
|
6
|
-
export { default as PendingDocuments } from "./PendingDocuments";
|
|
7
|
-
export { default as PrimaryButton } from "./PrimaryButton";
|
|
8
|
-
export { default as SecondaryButton } from "./SecondaryButton";
|
|
9
|
-
export { default as TabNavigation } from "./TabNavigation";
|
|
10
|
-
export { default as TertiaryButton } from "./TertiaryButton";
|
|
11
|
-
export { default as OAuthProviderButton } from "./OAuthProviderButton";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./Checkbox.css";
|
|
3
|
-
import "../../../styles/global.css";
|
|
4
|
-
export interface CheckboxProps {
|
|
5
|
-
id?: string;
|
|
6
|
-
checked?: boolean;
|
|
7
|
-
onChange?: (checked: boolean) => void;
|
|
8
|
-
color?: string;
|
|
9
|
-
size?: "default" | "small";
|
|
10
|
-
style?: "default" | "light";
|
|
11
|
-
markType?: "cross" | "check";
|
|
12
|
-
}
|
|
13
|
-
declare const Checkbox: React.FC<CheckboxProps>;
|
|
14
|
-
export default Checkbox;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import "./Checkbox.css";
|
|
3
|
-
import "../../../styles/global.css";
|
|
4
|
-
var Checkbox = function (_a) {
|
|
5
|
-
var id = _a.id, _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.color, color = _c === void 0 ? "noir" : _c, _d = _a.size, size = _d === void 0 ? "default" : _d, _e = _a.style, style = _e === void 0 ? "default" : _e, _f = _a.markType, markType = _f === void 0 ? "cross" : _f;
|
|
6
|
-
var _g = useState(checked), isChecked = _g[0], setIsChecked = _g[1];
|
|
7
|
-
var handleClick = function (e) {
|
|
8
|
-
e.preventDefault();
|
|
9
|
-
e.stopPropagation();
|
|
10
|
-
var newChecked = !isChecked;
|
|
11
|
-
setIsChecked(newChecked);
|
|
12
|
-
if (onChange) {
|
|
13
|
-
onChange(newChecked);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var checkboxColor = style === "light" ? "light" : color;
|
|
17
|
-
return (React.createElement("button", { id: id, className: "checkbox ".concat(isChecked ? "checkbox-pressed" : "checkbox-default", " ").concat("checkbox-".concat(checkboxColor), " ").concat(size === "small" ? "checkbox-small" : "", " ").concat(style === "light" ? "checkbox-light" : ""), onClick: handleClick }, isChecked && (React.createElement("span", { className: "checkbox-icon ".concat(markType === "cross" ? "allaw-icon-close" : "allaw-icon-check", " ").concat("checkbox-icon-".concat(checkboxColor), " ").concat(style === "light" ? "checkbox-icon-light" : "") }))));
|
|
18
|
-
};
|
|
19
|
-
export default Checkbox;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Checkbox } from "./Checkbox";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import "./Basefiler.css";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export type FilterProps = {
|
|
4
|
-
defaultSelectedValue?: string;
|
|
5
|
-
filterData: {
|
|
6
|
-
value: string;
|
|
7
|
-
name: string;
|
|
8
|
-
}[];
|
|
9
|
-
setFilter: (selectedValue: string) => void;
|
|
10
|
-
children?: React.ReactNode;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
showNumIndic?: boolean;
|
|
13
|
-
showBackdrop?: boolean;
|
|
14
|
-
isStatusTag?: boolean;
|
|
15
|
-
};
|
|
16
|
-
declare const BaseFilter: ({ showNumIndic, required, defaultSelectedValue, filterData, setFilter, showBackdrop, children, ...props }: FilterProps) => React.JSX.Element;
|
|
17
|
-
export default BaseFilter;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import "./Basefiler.css";
|
|
24
|
-
import { FilterButtonPrimary, PrimaryButton } from "../buttons";
|
|
25
|
-
import { TinyInfo } from "../typography";
|
|
26
|
-
import React, { useState } from "react";
|
|
27
|
-
var BaseFilter = function (_a) {
|
|
28
|
-
var _b = _a.showNumIndic, showNumIndic = _b === void 0 ? false : _b, _c = _a.required, required = _c === void 0 ? true : _c, defaultSelectedValue = _a.defaultSelectedValue, filterData = _a.filterData, setFilter = _a.setFilter, _d = _a.showBackdrop, showBackdrop = _d === void 0 ? false : _d, children = _a.children, props = __rest(_a, ["showNumIndic", "required", "defaultSelectedValue", "filterData", "setFilter", "showBackdrop", "children"]);
|
|
29
|
-
var _e = useState(false), isOpen = _e[0], setIsOpen = _e[1];
|
|
30
|
-
var _f = useState(defaultSelectedValue || ""), selectedValue = _f[0], setSelectedValue = _f[1];
|
|
31
|
-
var handleClose = function () {
|
|
32
|
-
setFilter(selectedValue);
|
|
33
|
-
setIsOpen(false);
|
|
34
|
-
};
|
|
35
|
-
var handleButtonTap = function () {
|
|
36
|
-
isOpen ? handleClose() : setIsOpen(true);
|
|
37
|
-
};
|
|
38
|
-
var Item = function (_a) {
|
|
39
|
-
var name = _a.name, value = _a.value;
|
|
40
|
-
return (React.createElement("button", { className: "item", onClick: function () { setSelectedValue(value); handleClose(); } },
|
|
41
|
-
React.createElement("div", { className: "round" },
|
|
42
|
-
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
43
|
-
React.createElement("span", null, name)));
|
|
44
|
-
};
|
|
45
|
-
var SmallItem = function (_a) {
|
|
46
|
-
var name = _a.name, value = _a.value;
|
|
47
|
-
return (React.createElement("button", { className: "smallItem", onClick: function () { setSelectedValue(value); } },
|
|
48
|
-
React.createElement("div", { className: "round" },
|
|
49
|
-
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
50
|
-
React.createElement("span", null, name)));
|
|
51
|
-
};
|
|
52
|
-
return (React.createElement(React.Fragment, null,
|
|
53
|
-
React.createElement("div", __assign({ className: "baseFilter" }, props),
|
|
54
|
-
React.createElement(FilterButtonPrimary, { onClick: handleButtonTap, zIndex: "2000" },
|
|
55
|
-
children,
|
|
56
|
-
React.createElement("p", { style: { color: "#25BEEB", fontWeight: "600" } }, showNumIndic && "(".concat(selectedValue.length, ")"))),
|
|
57
|
-
isOpen && (React.createElement("div", { className: "options" }, filterData && filterData.length > 0 &&
|
|
58
|
-
filterData.map(function (item, idx) { return (React.createElement(Item, { name: item.name, value: item.value, key: idx })); }))),
|
|
59
|
-
React.createElement("div", { className: "optionsSmall", style: { bottom: isOpen ? "0" : "-100%" } },
|
|
60
|
-
React.createElement("div", { className: "row" },
|
|
61
|
-
React.createElement("div", { style: { minWidth: "20px" } }),
|
|
62
|
-
React.createElement(TinyInfo, { text: children, variant: "bold14", color: "noir" }),
|
|
63
|
-
React.createElement("button", { className: "closeButton", onClick: handleClose },
|
|
64
|
-
React.createElement("i", { className: "allaw-icon-close" }))),
|
|
65
|
-
React.createElement("div", { className: "choices" }, filterData && filterData.length > 0 &&
|
|
66
|
-
filterData.map(function (item, idx) { return (React.createElement(SmallItem, { name: item.name, value: item.value, key: idx })); })),
|
|
67
|
-
React.createElement(PrimaryButton, { label: "Voir les r\u00E9sultats", onClick: handleClose }))),
|
|
68
|
-
isOpen && (React.createElement("div", { className: "backdrop", onClick: handleClose }))));
|
|
69
|
-
};
|
|
70
|
-
export default BaseFilter;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Filter } from "./Filter";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import "./SingleFilter.css";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export type SingleFilterProps = {
|
|
4
|
-
defaultSelectedValue?: string;
|
|
5
|
-
filterData: {
|
|
6
|
-
value: string;
|
|
7
|
-
name: string;
|
|
8
|
-
}[];
|
|
9
|
-
setFilter: (selectedValue: string) => void;
|
|
10
|
-
children?: React.ReactNode;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
showNumIndic?: boolean;
|
|
13
|
-
showBackdrop?: boolean;
|
|
14
|
-
isStatusTag?: boolean;
|
|
15
|
-
};
|
|
16
|
-
declare const SingleFilter: ({ showNumIndic, required, defaultSelectedValue, filterData, setFilter, showBackdrop, children, ...props }: SingleFilterProps) => React.JSX.Element;
|
|
17
|
-
export default SingleFilter;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import "./SingleFilter.css";
|
|
24
|
-
import { FilterButtonPrimary, PrimaryButton } from "../buttons";
|
|
25
|
-
import { TinyInfo } from "../typography";
|
|
26
|
-
import React, { useState, useEffect } from "react";
|
|
27
|
-
var SingleFilter = function (_a) {
|
|
28
|
-
var _b = _a.showNumIndic, showNumIndic = _b === void 0 ? false : _b, _c = _a.required, required = _c === void 0 ? true : _c, defaultSelectedValue = _a.defaultSelectedValue, filterData = _a.filterData, setFilter = _a.setFilter, _d = _a.showBackdrop, showBackdrop = _d === void 0 ? false : _d, children = _a.children, props = __rest(_a, ["showNumIndic", "required", "defaultSelectedValue", "filterData", "setFilter", "showBackdrop", "children"]);
|
|
29
|
-
var _e = useState(false), isOpen = _e[0], setIsOpen = _e[1];
|
|
30
|
-
var _f = useState(defaultSelectedValue || ""), selectedValue = _f[0], setSelectedValue = _f[1];
|
|
31
|
-
useEffect(function () {
|
|
32
|
-
if (selectedValue) {
|
|
33
|
-
setFilter(selectedValue);
|
|
34
|
-
}
|
|
35
|
-
}, [selectedValue, setFilter]);
|
|
36
|
-
var handleClose = function () {
|
|
37
|
-
setIsOpen(false);
|
|
38
|
-
};
|
|
39
|
-
var handleButtonTap = function () {
|
|
40
|
-
setIsOpen(!isOpen);
|
|
41
|
-
};
|
|
42
|
-
var Item = function (_a) {
|
|
43
|
-
var name = _a.name, value = _a.value;
|
|
44
|
-
return (React.createElement("button", { className: "item", onClick: function () {
|
|
45
|
-
setSelectedValue(value);
|
|
46
|
-
handleClose();
|
|
47
|
-
} },
|
|
48
|
-
React.createElement("div", { className: "round" },
|
|
49
|
-
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
50
|
-
React.createElement("span", null, name)));
|
|
51
|
-
};
|
|
52
|
-
var SmallItem = function (_a) {
|
|
53
|
-
var name = _a.name, value = _a.value;
|
|
54
|
-
return (React.createElement("button", { className: "smallItem", onClick: function () {
|
|
55
|
-
setSelectedValue(value);
|
|
56
|
-
} },
|
|
57
|
-
React.createElement("div", { className: "round" },
|
|
58
|
-
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
59
|
-
React.createElement("span", null, name)));
|
|
60
|
-
};
|
|
61
|
-
return (React.createElement(React.Fragment, null,
|
|
62
|
-
React.createElement("div", __assign({ className: "baseFilter" }, props),
|
|
63
|
-
React.createElement(FilterButtonPrimary, { onClick: handleButtonTap },
|
|
64
|
-
children,
|
|
65
|
-
React.createElement("p", { style: { color: "#25BEEB", fontWeight: "600" } }, showNumIndic && "(".concat(selectedValue.length, ")"))),
|
|
66
|
-
isOpen && (React.createElement("div", { className: "options" }, filterData &&
|
|
67
|
-
filterData.length > 0 &&
|
|
68
|
-
filterData.map(function (item, idx) { return (React.createElement(Item, { name: item.name, value: item.value, key: idx })); }))),
|
|
69
|
-
React.createElement("div", { className: "optionsSmall", style: { bottom: isOpen ? "0" : "-100%" } },
|
|
70
|
-
React.createElement("div", { className: "row" },
|
|
71
|
-
React.createElement("div", { style: { minWidth: "20px" } }),
|
|
72
|
-
React.createElement(TinyInfo, { text: children, variant: "bold14", color: "noir" }),
|
|
73
|
-
React.createElement("button", { className: "closeButton", onClick: handleClose },
|
|
74
|
-
React.createElement("i", { className: "allaw-icon-close" }))),
|
|
75
|
-
React.createElement("div", { className: "choices" }, filterData &&
|
|
76
|
-
filterData.length > 0 &&
|
|
77
|
-
filterData.map(function (item, idx) { return (React.createElement(SmallItem, { name: item.name, value: item.value, key: idx })); })),
|
|
78
|
-
React.createElement(PrimaryButton, { label: "Voir les r\u00E9sultats", onClick: handleClose }))),
|
|
79
|
-
isOpen && React.createElement("div", { className: "backdrop", onClick: handleClose })));
|
|
80
|
-
};
|
|
81
|
-
export default SingleFilter;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SingleFilter } from "./SingleFilter";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./Input.css";
|
|
3
|
-
import "../../../styles/global.css";
|
|
4
|
-
import "../../../styles/icons.css";
|
|
5
|
-
import { commonRegex } from "../../../utils/regex";
|
|
6
|
-
export interface InputProps {
|
|
7
|
-
title: string;
|
|
8
|
-
style?: "default" | "variation" | "password";
|
|
9
|
-
placeholder: string;
|
|
10
|
-
endIcon?: string;
|
|
11
|
-
isRequired?: boolean;
|
|
12
|
-
validate?: RegExp | keyof typeof commonRegex;
|
|
13
|
-
onError?: (error: string) => void;
|
|
14
|
-
onChange?: (value: string) => void;
|
|
15
|
-
value?: string;
|
|
16
|
-
error?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface InputRef {
|
|
19
|
-
validate: () => boolean;
|
|
20
|
-
}
|
|
21
|
-
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>>;
|
|
22
|
-
export default Input;
|