allaw-ui 4.0.2 → 4.0.3
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.
|
@@ -10,6 +10,10 @@ export interface ContactCardEditProps {
|
|
|
10
10
|
hideActions?: boolean;
|
|
11
11
|
controlled?: boolean;
|
|
12
12
|
hasExternalChanges?: boolean;
|
|
13
|
+
clientTypeOptions?: {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}[];
|
|
13
17
|
datepickerYearDropdownItemNumber?: number;
|
|
14
18
|
datepickerMaxDaysInPast?: number;
|
|
15
19
|
datepickerMinDate?: Date;
|
|
@@ -16,7 +16,7 @@ import Select from "../../atoms/selects/Select";
|
|
|
16
16
|
import Datepicker from "../../atoms/datepickers/Datepicker";
|
|
17
17
|
import IconButton from "../../atoms/buttons/IconButton";
|
|
18
18
|
var ContactCardEdit = function (_a) {
|
|
19
|
-
var name = _a.name, status = _a.status, phone = _a.phone, email = _a.email, _b = _a.clientOfStudy, clientOfStudy = _b === void 0 ? false : _b, _c = _a.officeName, officeName = _c === void 0 ? "du cabinet" : _c, birthDate = _a.birthDate, _d = _a.hideActions, hideActions = _d === void 0 ? false : _d, _e = _a.controlled, controlled = _e === void 0 ? false : _e, _f = _a.hasExternalChanges, hasExternalChanges = _f === void 0 ? false : _f, _g = _a.datepickerYearDropdownItemNumber, datepickerYearDropdownItemNumber = _g === void 0 ? 10 : _g, datepickerMaxDaysInPast = _a.datepickerMaxDaysInPast, datepickerMinDate = _a.datepickerMinDate, datepickerMaxDate = _a.datepickerMaxDate, _h = _a.datepickerDisableFutur, datepickerDisableFutur = _h === void 0 ? true : _h, externalEditData = _a.editData, onEditDataChange = _a.onEditDataChange, onSave = _a.onSave, onCancel = _a.onCancel;
|
|
19
|
+
var name = _a.name, status = _a.status, phone = _a.phone, email = _a.email, _b = _a.clientOfStudy, clientOfStudy = _b === void 0 ? false : _b, _c = _a.officeName, officeName = _c === void 0 ? "du cabinet" : _c, birthDate = _a.birthDate, _d = _a.hideActions, hideActions = _d === void 0 ? false : _d, _e = _a.controlled, controlled = _e === void 0 ? false : _e, _f = _a.hasExternalChanges, hasExternalChanges = _f === void 0 ? false : _f, clientTypeOptions = _a.clientTypeOptions, _g = _a.datepickerYearDropdownItemNumber, datepickerYearDropdownItemNumber = _g === void 0 ? 10 : _g, datepickerMaxDaysInPast = _a.datepickerMaxDaysInPast, datepickerMinDate = _a.datepickerMinDate, datepickerMaxDate = _a.datepickerMaxDate, _h = _a.datepickerDisableFutur, datepickerDisableFutur = _h === void 0 ? true : _h, externalEditData = _a.editData, onEditDataChange = _a.onEditDataChange, onSave = _a.onSave, onCancel = _a.onCancel;
|
|
20
20
|
var _j = useState({
|
|
21
21
|
firstName: "",
|
|
22
22
|
lastName: "",
|
|
@@ -39,12 +39,13 @@ var ContactCardEdit = function (_a) {
|
|
|
39
39
|
setInternalEditData(updater);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
// Options
|
|
43
|
-
var
|
|
42
|
+
// Options par défaut si non fournies
|
|
43
|
+
var defaultClientTypeOptions = [
|
|
44
44
|
{ label: "Client du cabinet", value: "Client du cabinet" },
|
|
45
45
|
{ label: "Client de l'étude", value: "Client de l'étude" },
|
|
46
46
|
{ label: "Contact", value: "Contact" },
|
|
47
47
|
];
|
|
48
|
+
var finalClientTypeOptions = clientTypeOptions || defaultClientTypeOptions;
|
|
48
49
|
// Initialisation des données d'édition
|
|
49
50
|
useEffect(function () {
|
|
50
51
|
if (name && !controlled) {
|
|
@@ -129,7 +130,7 @@ var ContactCardEdit = function (_a) {
|
|
|
129
130
|
React.createElement("div", { className: styles.infoItem },
|
|
130
131
|
React.createElement("i", { className: "allaw-icon-user ".concat(styles.infoIcon) }),
|
|
131
132
|
React.createElement("div", { className: styles.clientTypeSelectContainer },
|
|
132
|
-
React.createElement(Select, { items:
|
|
133
|
+
React.createElement(Select, { items: finalClientTypeOptions, selectedItem: editData.clientType, placeholder: "Type de client", onChange: function (value) {
|
|
133
134
|
return updateEditData(function (prev) { return (__assign(__assign({}, prev), { clientType: value })); });
|
|
134
135
|
} }))),
|
|
135
136
|
React.createElement("div", { className: styles.telephoneEmailItems },
|
|
@@ -113,6 +113,20 @@
|
|
|
113
113
|
min-width: 160px;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
/* Media queries pour les largeurs en fonction du viewport */
|
|
117
|
+
@media (min-width: 1152px) {
|
|
118
|
+
.phoneInputContainer {
|
|
119
|
+
width: 190px;
|
|
120
|
+
min-width: 190px;
|
|
121
|
+
max-width: 190px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.clientTypeSelectContainer {
|
|
125
|
+
max-width: 190px;
|
|
126
|
+
min-width: 190px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
116
130
|
/* Media queries responsive */
|
|
117
131
|
@media (max-width: 1000px) {
|
|
118
132
|
.phoneInputContainer {
|