ecotransac-shared-js 1.1.15 → 1.1.17

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/index.d.mts CHANGED
@@ -929,6 +929,13 @@ declare const getFieldValues: <D>(fields: Field<D>[], propertyState: State, data
929
929
  value: string;
930
930
  isNotDefined: boolean;
931
931
  } | null)[];
932
+ type GetValueProps = {
933
+ value: unknown;
934
+ name: string;
935
+ isCurrency: boolean;
936
+ options: SelectOption[] | undefined;
937
+ };
938
+ declare const getValue: (params: GetValueProps) => string | null;
932
939
 
933
940
  declare const getLabel: <T>(list: {
934
941
  value: T;
@@ -1018,4 +1025,4 @@ declare const MANDATE_EXCLUSIVITY: {
1018
1025
  label: string;
1019
1026
  }[];
1020
1027
 
1021
- export { COMPANY_INFO, CONDITIONS, COUNTRIES, type Condition, ESTATE_CONDITION, EXPOSURES, type Field, GENDER, HEATING_ENERGY, IDENTIFICATION_DOCUMENTS, KITCHEN_TYPE, LEASE_ESTABLISHMENT, LEASE_TRANSFERT_PERMISSIONS, LEGAL_NATURE, MANDATE_EXCLUSIVITY, MARITAL_STATUS, PRENUP_TYPES, SHARING_CONFIGURATION, STANDINGS, type SelectOption, type State, VIEWS, and, featuresFormFields, formatAddress, formatAgentLegalData, formatDate, formatMandateNumber, formatNumber, formatPhone, formatPrice, formatSeconds, getAgencyFees, getFeesPercentage, getFieldValues, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
1028
+ export { COMPANY_INFO, CONDITIONS, COUNTRIES, type Condition, ESTATE_CONDITION, EXPOSURES, type Field, GENDER, HEATING_ENERGY, IDENTIFICATION_DOCUMENTS, KITCHEN_TYPE, LEASE_ESTABLISHMENT, LEASE_TRANSFERT_PERMISSIONS, LEGAL_NATURE, MANDATE_EXCLUSIVITY, MARITAL_STATUS, PRENUP_TYPES, SHARING_CONFIGURATION, STANDINGS, type SelectOption, type State, VIEWS, and, featuresFormFields, formatAddress, formatAgentLegalData, formatDate, formatMandateNumber, formatNumber, formatPhone, formatPrice, formatSeconds, getAgencyFees, getFeesPercentage, getFieldValues, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, getValue, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
package/dist/index.d.ts CHANGED
@@ -929,6 +929,13 @@ declare const getFieldValues: <D>(fields: Field<D>[], propertyState: State, data
929
929
  value: string;
930
930
  isNotDefined: boolean;
931
931
  } | null)[];
932
+ type GetValueProps = {
933
+ value: unknown;
934
+ name: string;
935
+ isCurrency: boolean;
936
+ options: SelectOption[] | undefined;
937
+ };
938
+ declare const getValue: (params: GetValueProps) => string | null;
932
939
 
933
940
  declare const getLabel: <T>(list: {
934
941
  value: T;
@@ -1018,4 +1025,4 @@ declare const MANDATE_EXCLUSIVITY: {
1018
1025
  label: string;
1019
1026
  }[];
1020
1027
 
1021
- export { COMPANY_INFO, CONDITIONS, COUNTRIES, type Condition, ESTATE_CONDITION, EXPOSURES, type Field, GENDER, HEATING_ENERGY, IDENTIFICATION_DOCUMENTS, KITCHEN_TYPE, LEASE_ESTABLISHMENT, LEASE_TRANSFERT_PERMISSIONS, LEGAL_NATURE, MANDATE_EXCLUSIVITY, MARITAL_STATUS, PRENUP_TYPES, SHARING_CONFIGURATION, STANDINGS, type SelectOption, type State, VIEWS, and, featuresFormFields, formatAddress, formatAgentLegalData, formatDate, formatMandateNumber, formatNumber, formatPhone, formatPrice, formatSeconds, getAgencyFees, getFeesPercentage, getFieldValues, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
1028
+ export { COMPANY_INFO, CONDITIONS, COUNTRIES, type Condition, ESTATE_CONDITION, EXPOSURES, type Field, GENDER, HEATING_ENERGY, IDENTIFICATION_DOCUMENTS, KITCHEN_TYPE, LEASE_ESTABLISHMENT, LEASE_TRANSFERT_PERMISSIONS, LEGAL_NATURE, MANDATE_EXCLUSIVITY, MARITAL_STATUS, PRENUP_TYPES, SHARING_CONFIGURATION, STANDINGS, type SelectOption, type State, VIEWS, and, featuresFormFields, formatAddress, formatAgentLegalData, formatDate, formatMandateNumber, formatNumber, formatPhone, formatPrice, formatSeconds, getAgencyFees, getFeesPercentage, getFieldValues, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, getValue, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
package/dist/index.js CHANGED
@@ -66,6 +66,7 @@ __export(src_exports, {
66
66
  getNetPrice: () => getNetPrice,
67
67
  getPropertyState: () => getPropertyState,
68
68
  getPropertyTitle: () => getPropertyTitle,
69
+ getValue: () => getValue,
69
70
  mandateFormFields: () => mandateFormFields,
70
71
  not: () => not,
71
72
  only: () => only,
@@ -1043,18 +1044,38 @@ var surfacesFormFields = [
1043
1044
  name: "livingArea",
1044
1045
  fieldType: "number",
1045
1046
  label: "Surface habitable",
1046
- condition: and(not("isLand"), not("isForProfessionalUse")),
1047
- props: { suffix: "m\xB2" },
1048
- requiredFor: ["MANDATE_CREATION" /* MandateCreation */, "DIFFUSION" /* Diffusion */]
1047
+ condition: and(
1048
+ not("isForProfessionalUse"),
1049
+ not("isLand"),
1050
+ not("isParking"),
1051
+ not("isBuilding")
1052
+ ),
1053
+ props: { suffix: "m\xB2" }
1054
+ },
1055
+ {
1056
+ name: "livingArea",
1057
+ fieldType: "number",
1058
+ label: "Surface habitable totale de l'immeuble",
1059
+ condition: only("isBuilding"),
1060
+ props: { suffix: "m\xB2" }
1061
+ },
1062
+ {
1063
+ name: "livingArea",
1064
+ fieldType: "number",
1065
+ label: "Surface au sol",
1066
+ condition: only("isParking"),
1067
+ props: { suffix: "m\xB2" }
1049
1068
  },
1050
- // TODO: use only one field for livingArea
1051
1069
  {
1052
1070
  name: "livingArea",
1053
1071
  fieldType: "number",
1054
1072
  label: "Surface utile",
1055
- condition: and(not("isLand"), only("isForProfessionalUse")),
1056
- props: { suffix: "m\xB2" },
1057
- requiredFor: ["MANDATE_CREATION" /* MandateCreation */, "DIFFUSION" /* Diffusion */]
1073
+ condition: and(
1074
+ only("isForProfessionalUse"),
1075
+ not("isLand"),
1076
+ not("isParking")
1077
+ ),
1078
+ props: { suffix: "m\xB2" }
1058
1079
  },
1059
1080
  {
1060
1081
  name: "carrezLawArea",
@@ -1186,6 +1207,15 @@ var surfacesFormFields = [
1186
1207
  label: "Num\xE9ro des lot(s) vendu(s)",
1187
1208
  props: { placeholder: "Non renseign\xE9" },
1188
1209
  requiredFor: ["MANDATE_CREATION" /* MandateCreation */]
1210
+ },
1211
+ {
1212
+ name: "cadastreReference",
1213
+ fieldType: "text",
1214
+ label: "R\xE9f\xE9rence(s) cadastrale(s)",
1215
+ props: {
1216
+ tooltip: "Retrouvez la/les r\xE9f\xE9rence(s) sur cadastre.gouv.fr",
1217
+ placeholder: "Exemple : Section AB, Parcelle 1234"
1218
+ }
1189
1219
  }
1190
1220
  ];
1191
1221
  var propertyFields = [
@@ -1366,14 +1396,6 @@ var mandateFormFields = [
1366
1396
  // FIXME: required if not low price
1367
1397
  props: { suffix: "%" }
1368
1398
  },
1369
- {
1370
- name: "specialConditions",
1371
- fieldType: "textarea",
1372
- label: "Conditions particuli\xE8res du mandat",
1373
- requiredFor: [],
1374
- condition: void 0,
1375
- props: { className: "md:col-span-2", placeholder: "Aucune" }
1376
- },
1377
1399
  {
1378
1400
  name: "netOwnerRent",
1379
1401
  fieldType: "number",
@@ -1395,7 +1417,11 @@ var mandateFormFields = [
1395
1417
  label: "D\xE9p\xF4t de garantie",
1396
1418
  fieldType: "number",
1397
1419
  requiredFor: ["MANDATE_CREATION" /* MandateCreation */],
1398
- condition: and(only("isForProfessionalUse"), only("isLeaseRightsTransfer"))
1420
+ condition: and(only("isForProfessionalUse"), only("isLeaseRightsTransfer")),
1421
+ props: {
1422
+ suffix: "\u20AC",
1423
+ tooltip: "Montant maximum autoris\xE9 : 1 mois de loyer hors charges"
1424
+ }
1399
1425
  },
1400
1426
  {
1401
1427
  name: "isVatApplicable",
@@ -1450,6 +1476,14 @@ var mandateFormFields = [
1450
1476
  label: "Ordre du professionnel charg\xE9 de la pr\xE9sente cession qui re\xE7oit le s\xE9questre",
1451
1477
  requiredFor: ["MANDATE_CREATION" /* MandateCreation */],
1452
1478
  condition: only("isForProfessionalUse")
1479
+ },
1480
+ {
1481
+ name: "specialConditions",
1482
+ fieldType: "textarea",
1483
+ label: "Conditions particuli\xE8res du mandat",
1484
+ requiredFor: [],
1485
+ condition: void 0,
1486
+ props: { className: "md:col-span-2", placeholder: "Aucune" }
1453
1487
  }
1454
1488
  ];
1455
1489
 
@@ -1506,6 +1540,7 @@ var MANDATE_EXCLUSIVITY = [
1506
1540
  getNetPrice,
1507
1541
  getPropertyState,
1508
1542
  getPropertyTitle,
1543
+ getValue,
1509
1544
  mandateFormFields,
1510
1545
  not,
1511
1546
  only,
package/dist/index.mjs CHANGED
@@ -964,18 +964,38 @@ var surfacesFormFields = [
964
964
  name: "livingArea",
965
965
  fieldType: "number",
966
966
  label: "Surface habitable",
967
- condition: and(not("isLand"), not("isForProfessionalUse")),
968
- props: { suffix: "m\xB2" },
969
- requiredFor: ["MANDATE_CREATION" /* MandateCreation */, "DIFFUSION" /* Diffusion */]
967
+ condition: and(
968
+ not("isForProfessionalUse"),
969
+ not("isLand"),
970
+ not("isParking"),
971
+ not("isBuilding")
972
+ ),
973
+ props: { suffix: "m\xB2" }
974
+ },
975
+ {
976
+ name: "livingArea",
977
+ fieldType: "number",
978
+ label: "Surface habitable totale de l'immeuble",
979
+ condition: only("isBuilding"),
980
+ props: { suffix: "m\xB2" }
981
+ },
982
+ {
983
+ name: "livingArea",
984
+ fieldType: "number",
985
+ label: "Surface au sol",
986
+ condition: only("isParking"),
987
+ props: { suffix: "m\xB2" }
970
988
  },
971
- // TODO: use only one field for livingArea
972
989
  {
973
990
  name: "livingArea",
974
991
  fieldType: "number",
975
992
  label: "Surface utile",
976
- condition: and(not("isLand"), only("isForProfessionalUse")),
977
- props: { suffix: "m\xB2" },
978
- requiredFor: ["MANDATE_CREATION" /* MandateCreation */, "DIFFUSION" /* Diffusion */]
993
+ condition: and(
994
+ only("isForProfessionalUse"),
995
+ not("isLand"),
996
+ not("isParking")
997
+ ),
998
+ props: { suffix: "m\xB2" }
979
999
  },
980
1000
  {
981
1001
  name: "carrezLawArea",
@@ -1107,6 +1127,15 @@ var surfacesFormFields = [
1107
1127
  label: "Num\xE9ro des lot(s) vendu(s)",
1108
1128
  props: { placeholder: "Non renseign\xE9" },
1109
1129
  requiredFor: ["MANDATE_CREATION" /* MandateCreation */]
1130
+ },
1131
+ {
1132
+ name: "cadastreReference",
1133
+ fieldType: "text",
1134
+ label: "R\xE9f\xE9rence(s) cadastrale(s)",
1135
+ props: {
1136
+ tooltip: "Retrouvez la/les r\xE9f\xE9rence(s) sur cadastre.gouv.fr",
1137
+ placeholder: "Exemple : Section AB, Parcelle 1234"
1138
+ }
1110
1139
  }
1111
1140
  ];
1112
1141
  var propertyFields = [
@@ -1287,14 +1316,6 @@ var mandateFormFields = [
1287
1316
  // FIXME: required if not low price
1288
1317
  props: { suffix: "%" }
1289
1318
  },
1290
- {
1291
- name: "specialConditions",
1292
- fieldType: "textarea",
1293
- label: "Conditions particuli\xE8res du mandat",
1294
- requiredFor: [],
1295
- condition: void 0,
1296
- props: { className: "md:col-span-2", placeholder: "Aucune" }
1297
- },
1298
1319
  {
1299
1320
  name: "netOwnerRent",
1300
1321
  fieldType: "number",
@@ -1316,7 +1337,11 @@ var mandateFormFields = [
1316
1337
  label: "D\xE9p\xF4t de garantie",
1317
1338
  fieldType: "number",
1318
1339
  requiredFor: ["MANDATE_CREATION" /* MandateCreation */],
1319
- condition: and(only("isForProfessionalUse"), only("isLeaseRightsTransfer"))
1340
+ condition: and(only("isForProfessionalUse"), only("isLeaseRightsTransfer")),
1341
+ props: {
1342
+ suffix: "\u20AC",
1343
+ tooltip: "Montant maximum autoris\xE9 : 1 mois de loyer hors charges"
1344
+ }
1320
1345
  },
1321
1346
  {
1322
1347
  name: "isVatApplicable",
@@ -1371,6 +1396,14 @@ var mandateFormFields = [
1371
1396
  label: "Ordre du professionnel charg\xE9 de la pr\xE9sente cession qui re\xE7oit le s\xE9questre",
1372
1397
  requiredFor: ["MANDATE_CREATION" /* MandateCreation */],
1373
1398
  condition: only("isForProfessionalUse")
1399
+ },
1400
+ {
1401
+ name: "specialConditions",
1402
+ fieldType: "textarea",
1403
+ label: "Conditions particuli\xE8res du mandat",
1404
+ requiredFor: [],
1405
+ condition: void 0,
1406
+ props: { className: "md:col-span-2", placeholder: "Aucune" }
1374
1407
  }
1375
1408
  ];
1376
1409
 
@@ -1426,6 +1459,7 @@ export {
1426
1459
  getNetPrice,
1427
1460
  getPropertyState,
1428
1461
  getPropertyTitle,
1462
+ getValue,
1429
1463
  mandateFormFields,
1430
1464
  not,
1431
1465
  only,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecotransac-shared-js",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "modules": "dist/index.mjs",