allaw-ui 0.1.35 → 0.1.37
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/atoms/inputs/TextArea.css +5 -2
- package/dist/components/atoms/inputs/TextArea.d.ts +1 -1
- package/dist/components/atoms/inputs/TextArea.js +1 -1
- package/dist/components/atoms/selects/Select.css +1 -1
- package/dist/components/molecules/documentCard/DocumentCard.d.ts +2 -1
- package/dist/components/molecules/documentCard/DocumentCard.js +16 -4
- package/package.json +1 -1
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
background: var(--Primary-Blanc, #fff);
|
|
61
61
|
padding: 10px;
|
|
62
62
|
field-sizing: content;
|
|
63
|
+
font-size: 16px;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
.text-area-default .text-area-input:hover {
|
|
@@ -74,11 +75,13 @@
|
|
|
74
75
|
width: 100%;
|
|
75
76
|
border: none;
|
|
76
77
|
outline: none;
|
|
77
|
-
color: var(--noir);
|
|
78
|
+
color: var(--noir, #171e25);
|
|
78
79
|
field-sizing: content;
|
|
80
|
+
font-size: 16px;
|
|
81
|
+
line-height: 24px;
|
|
82
|
+
padding: 8px;
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
/* Style variation */
|
|
82
85
|
.text-area-variation {
|
|
83
86
|
display: flex;
|
|
84
87
|
width: 100%;
|
|
@@ -11,7 +11,7 @@ export interface TextAreaProps {
|
|
|
11
11
|
isRequired?: boolean;
|
|
12
12
|
validate?: RegExp | keyof typeof commonRegex;
|
|
13
13
|
onError?: (error: string) => void;
|
|
14
|
-
onChange?: (
|
|
14
|
+
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
15
15
|
value?: string;
|
|
16
16
|
error?: string;
|
|
17
17
|
}
|
|
@@ -43,7 +43,7 @@ var TextArea = forwardRef(function (_a, ref) {
|
|
|
43
43
|
var handleChange = function (e) {
|
|
44
44
|
var newValue = e.target.value;
|
|
45
45
|
setValue(newValue);
|
|
46
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(
|
|
46
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
47
47
|
if (isTouched) {
|
|
48
48
|
validateTextArea();
|
|
49
49
|
}
|
|
@@ -4,10 +4,11 @@ export interface DocumentCardProps {
|
|
|
4
4
|
type: "document" | "note" | "invoice" | "waiting";
|
|
5
5
|
title: string;
|
|
6
6
|
date: Date;
|
|
7
|
-
status: "sent" | "received";
|
|
7
|
+
status: "sent" | "received" | "internal";
|
|
8
8
|
documents?: {
|
|
9
9
|
[key: string]: boolean;
|
|
10
10
|
};
|
|
11
|
+
onCardClick?: () => any;
|
|
11
12
|
documentCount?: string;
|
|
12
13
|
}
|
|
13
14
|
declare const DocumentCard: React.FC<DocumentCardProps>;
|
|
@@ -3,7 +3,7 @@ import "./DocumentCard.css";
|
|
|
3
3
|
import IconButton from "../../atoms/buttons/IconButton";
|
|
4
4
|
import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
|
|
5
5
|
var DocumentCard = function (_a) {
|
|
6
|
-
var type = _a.type, title = _a.title, date = _a.date, status = _a.status, _b = _a.documents, documents = _b === void 0 ? {} : _b, _c = _a.documentCount, documentCount = _c === void 0 ? "" : _c;
|
|
6
|
+
var type = _a.type, title = _a.title, date = _a.date, onCardClick = _a.onCardClick, status = _a.status, _b = _a.documents, documents = _b === void 0 ? {} : _b, _c = _a.documentCount, documentCount = _c === void 0 ? "" : _c;
|
|
7
7
|
var getIconName = function () {
|
|
8
8
|
switch (type) {
|
|
9
9
|
case "document":
|
|
@@ -18,6 +18,18 @@ var DocumentCard = function (_a) {
|
|
|
18
18
|
return "allaw-icon-document";
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
+
var getStatusName = function () {
|
|
22
|
+
switch (status) {
|
|
23
|
+
case "internal":
|
|
24
|
+
return "INTERNE";
|
|
25
|
+
case "received":
|
|
26
|
+
return "REÇU";
|
|
27
|
+
case "sent":
|
|
28
|
+
return "ENVOYÉ";
|
|
29
|
+
default:
|
|
30
|
+
return "INTERNE";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
21
33
|
var getDisplayType = function (type) {
|
|
22
34
|
if (type === "invoice") {
|
|
23
35
|
return "FACTURE";
|
|
@@ -33,7 +45,7 @@ var DocumentCard = function (_a) {
|
|
|
33
45
|
};
|
|
34
46
|
if (type === "waiting") {
|
|
35
47
|
var documentList = Object.keys(documents);
|
|
36
|
-
return (React.createElement("div", { className: "document-card waiting" },
|
|
48
|
+
return (React.createElement("div", { className: "document-card waiting", style: { cursor: onCardClick ? "pointer" : "default" }, onClick: function () { return onCardClick && onCardClick(); } },
|
|
37
49
|
React.createElement("div", { className: "document-card-left" },
|
|
38
50
|
React.createElement(OtherStatusTag, { type: "information", label: "Documents demand\u00E9s pour ce rendez-vous" }),
|
|
39
51
|
React.createElement("h3", { className: "document-card-title" }, title),
|
|
@@ -46,7 +58,7 @@ var DocumentCard = function (_a) {
|
|
|
46
58
|
React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-document" }),
|
|
47
59
|
React.createElement("span", { className: "document-count" }, documentCount))));
|
|
48
60
|
}
|
|
49
|
-
return (React.createElement("div", { className: "document-card" },
|
|
61
|
+
return (React.createElement("div", { className: "document-card", onClick: function () { return onCardClick && onCardClick(); }, style: { cursor: onCardClick ? "pointer" : "default" } },
|
|
50
62
|
React.createElement("div", { className: "document-card-left" },
|
|
51
63
|
React.createElement(IconButton, { style: "largeFilled", iconName: getIconName() }),
|
|
52
64
|
React.createElement("div", { className: "document-card-info" },
|
|
@@ -54,6 +66,6 @@ var DocumentCard = function (_a) {
|
|
|
54
66
|
React.createElement("h3", { className: "document-card-title" }, title),
|
|
55
67
|
React.createElement("span", { className: "document-card-date" }, formatDate(date)))),
|
|
56
68
|
React.createElement("div", { className: "document-card-right" },
|
|
57
|
-
React.createElement(OtherStatusTag, { type: "information", label:
|
|
69
|
+
React.createElement(OtherStatusTag, { type: "information", label: getStatusName() }))));
|
|
58
70
|
};
|
|
59
71
|
export default DocumentCard;
|