allaw-ui 4.0.8 → 4.0.9
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.
|
@@ -12,10 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import React, { useState, useEffect } from "react";
|
|
13
13
|
import styles from "./contactCardEdit.module.css";
|
|
14
14
|
import Input from "../../atoms/inputs/Input";
|
|
15
|
+
import Select from "../../atoms/selects/Select";
|
|
15
16
|
import Datepicker from "../../atoms/datepickers/Datepicker";
|
|
16
17
|
import IconButton from "../../atoms/buttons/IconButton";
|
|
17
18
|
var ContactCardEdit = function (_a) {
|
|
18
|
-
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;
|
|
19
20
|
var _j = useState({
|
|
20
21
|
firstName: "",
|
|
21
22
|
lastName: "",
|
|
@@ -38,6 +39,13 @@ var ContactCardEdit = function (_a) {
|
|
|
38
39
|
setInternalEditData(updater);
|
|
39
40
|
}
|
|
40
41
|
};
|
|
42
|
+
// Options par défaut si non fournies
|
|
43
|
+
var defaultClientTypeOptions = [
|
|
44
|
+
{ label: "Client du cabinet", value: "Client du cabinet" },
|
|
45
|
+
{ label: "Client de l'étude", value: "Client de l'étude" },
|
|
46
|
+
{ label: "Contact", value: "Contact" },
|
|
47
|
+
];
|
|
48
|
+
var finalClientTypeOptions = clientTypeOptions || defaultClientTypeOptions;
|
|
41
49
|
// Initialisation des données d'édition
|
|
42
50
|
useEffect(function () {
|
|
43
51
|
if (name && !controlled) {
|
|
@@ -119,6 +127,12 @@ var ContactCardEdit = function (_a) {
|
|
|
119
127
|
return updateEditData(function (prev) { return (__assign(__assign({}, prev), { lastName: value })); });
|
|
120
128
|
}, disableAutofill: true }))),
|
|
121
129
|
React.createElement("div", { className: styles.infoContainer },
|
|
130
|
+
React.createElement("div", { className: styles.infoItem },
|
|
131
|
+
React.createElement("i", { className: "allaw-icon-user ".concat(styles.infoIcon) }),
|
|
132
|
+
React.createElement("div", { className: styles.clientTypeSelectContainer },
|
|
133
|
+
React.createElement(Select, { items: finalClientTypeOptions, selectedItem: editData.clientType, placeholder: "Type de client", onChange: function (value) {
|
|
134
|
+
return updateEditData(function (prev) { return (__assign(__assign({}, prev), { clientType: value })); });
|
|
135
|
+
} }))),
|
|
122
136
|
React.createElement("div", { className: styles.telephoneEmailItems },
|
|
123
137
|
React.createElement("div", { className: styles.infoItem },
|
|
124
138
|
React.createElement("i", { className: "allaw-icon-phone ".concat(styles.infoIcon) }),
|