allaw-ui 4.0.7 → 4.0.8
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,11 +12,10 @@ 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";
|
|
16
15
|
import Datepicker from "../../atoms/datepickers/Datepicker";
|
|
17
16
|
import IconButton from "../../atoms/buttons/IconButton";
|
|
18
17
|
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,
|
|
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;
|
|
20
19
|
var _j = useState({
|
|
21
20
|
firstName: "",
|
|
22
21
|
lastName: "",
|
|
@@ -39,13 +38,6 @@ var ContactCardEdit = function (_a) {
|
|
|
39
38
|
setInternalEditData(updater);
|
|
40
39
|
}
|
|
41
40
|
};
|
|
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;
|
|
49
41
|
// Initialisation des données d'édition
|
|
50
42
|
useEffect(function () {
|
|
51
43
|
if (name && !controlled) {
|
|
@@ -127,12 +119,6 @@ var ContactCardEdit = function (_a) {
|
|
|
127
119
|
return updateEditData(function (prev) { return (__assign(__assign({}, prev), { lastName: value })); });
|
|
128
120
|
}, disableAutofill: true }))),
|
|
129
121
|
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
|
-
} }))),
|
|
136
122
|
React.createElement("div", { className: styles.telephoneEmailItems },
|
|
137
123
|
React.createElement("div", { className: styles.infoItem },
|
|
138
124
|
React.createElement("i", { className: "allaw-icon-phone ".concat(styles.infoIcon) }),
|