@fctc/sme-widget-ui 1.5.8 → 1.6.0
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/icons.js +3 -3
- package/dist/icons.mjs +3 -3
- package/dist/index.js +21 -12
- package/dist/index.mjs +26 -17
- package/dist/widgets.js +21 -12
- package/dist/widgets.mjs +26 -17
- package/package.json +1 -1
package/dist/icons.js
CHANGED
|
@@ -398,21 +398,21 @@ var DownloadIcon = () => {
|
|
|
398
398
|
"path",
|
|
399
399
|
{
|
|
400
400
|
d: "M13.2169 18.5417H7.78356C3.69189 18.5417 1.94189 16.7917 1.94189 12.7V12.5917C1.94189 8.89167 3.40023 7.10833 6.66689 6.8C7.00023 6.775 7.31689 7.025 7.35023 7.36667C7.38356 7.70833 7.13356 8.01667 6.78356 8.05C4.16689 8.29167 3.19189 9.525 3.19189 12.6V12.7083C3.19189 16.1 4.39189 17.3 7.78356 17.3H13.2169C16.6086 17.3 17.8086 16.1 17.8086 12.7083V12.6C17.8086 9.50833 16.8169 8.275 14.1502 8.05C13.8086 8.01667 13.5502 7.71667 13.5836 7.375C13.6169 7.03333 13.9086 6.775 14.2586 6.80833C17.5752 7.09167 19.0586 8.88333 19.0586 12.6083V12.7167C19.0586 16.7917 17.3086 18.5417 13.2169 18.5417Z",
|
|
401
|
-
fill: "
|
|
401
|
+
fill: "currentColor"
|
|
402
402
|
}
|
|
403
403
|
),
|
|
404
404
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
405
405
|
"path",
|
|
406
406
|
{
|
|
407
407
|
d: "M10.5 13.025C10.1583 13.025 9.875 12.7417 9.875 12.4V1.66667C9.875 1.32501 10.1583 1.04167 10.5 1.04167C10.8417 1.04167 11.125 1.32501 11.125 1.66667V12.4C11.125 12.75 10.8417 13.025 10.5 13.025Z",
|
|
408
|
-
fill: "
|
|
408
|
+
fill: "currentColor"
|
|
409
409
|
}
|
|
410
410
|
),
|
|
411
411
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
412
412
|
"path",
|
|
413
413
|
{
|
|
414
414
|
d: "M10.5 13.9583C10.3417 13.9583 10.1834 13.9 10.0584 13.775L7.2667 10.9833C7.02503 10.7417 7.02503 10.3417 7.2667 10.1C7.50837 9.85833 7.90837 9.85833 8.15003 10.1L10.5 12.45L12.85 10.1C13.0917 9.85833 13.4917 9.85833 13.7334 10.1C13.975 10.3417 13.975 10.7417 13.7334 10.9833L10.9417 13.775C10.8167 13.9 10.6584 13.9583 10.5 13.9583Z",
|
|
415
|
-
fill: "
|
|
415
|
+
fill: "currentColor"
|
|
416
416
|
}
|
|
417
417
|
)
|
|
418
418
|
]
|
package/dist/icons.mjs
CHANGED
|
@@ -337,21 +337,21 @@ var DownloadIcon = () => {
|
|
|
337
337
|
"path",
|
|
338
338
|
{
|
|
339
339
|
d: "M13.2169 18.5417H7.78356C3.69189 18.5417 1.94189 16.7917 1.94189 12.7V12.5917C1.94189 8.89167 3.40023 7.10833 6.66689 6.8C7.00023 6.775 7.31689 7.025 7.35023 7.36667C7.38356 7.70833 7.13356 8.01667 6.78356 8.05C4.16689 8.29167 3.19189 9.525 3.19189 12.6V12.7083C3.19189 16.1 4.39189 17.3 7.78356 17.3H13.2169C16.6086 17.3 17.8086 16.1 17.8086 12.7083V12.6C17.8086 9.50833 16.8169 8.275 14.1502 8.05C13.8086 8.01667 13.5502 7.71667 13.5836 7.375C13.6169 7.03333 13.9086 6.775 14.2586 6.80833C17.5752 7.09167 19.0586 8.88333 19.0586 12.6083V12.7167C19.0586 16.7917 17.3086 18.5417 13.2169 18.5417Z",
|
|
340
|
-
fill: "
|
|
340
|
+
fill: "currentColor"
|
|
341
341
|
}
|
|
342
342
|
),
|
|
343
343
|
/* @__PURE__ */ jsx13(
|
|
344
344
|
"path",
|
|
345
345
|
{
|
|
346
346
|
d: "M10.5 13.025C10.1583 13.025 9.875 12.7417 9.875 12.4V1.66667C9.875 1.32501 10.1583 1.04167 10.5 1.04167C10.8417 1.04167 11.125 1.32501 11.125 1.66667V12.4C11.125 12.75 10.8417 13.025 10.5 13.025Z",
|
|
347
|
-
fill: "
|
|
347
|
+
fill: "currentColor"
|
|
348
348
|
}
|
|
349
349
|
),
|
|
350
350
|
/* @__PURE__ */ jsx13(
|
|
351
351
|
"path",
|
|
352
352
|
{
|
|
353
353
|
d: "M10.5 13.9583C10.3417 13.9583 10.1834 13.9 10.0584 13.775L7.2667 10.9833C7.02503 10.7417 7.02503 10.3417 7.2667 10.1C7.50837 9.85833 7.90837 9.85833 8.15003 10.1L10.5 12.45L12.85 10.1C13.0917 9.85833 13.4917 9.85833 13.7334 10.1C13.975 10.3417 13.975 10.7417 13.7334 10.9833L10.9417 13.775C10.8167 13.9 10.6584 13.9583 10.5 13.9583Z",
|
|
354
|
-
fill: "
|
|
354
|
+
fill: "currentColor"
|
|
355
355
|
}
|
|
356
356
|
)
|
|
357
357
|
]
|
package/dist/index.js
CHANGED
|
@@ -5425,21 +5425,21 @@ var DownloadIcon = () => {
|
|
|
5425
5425
|
"path",
|
|
5426
5426
|
{
|
|
5427
5427
|
d: "M13.2169 18.5417H7.78356C3.69189 18.5417 1.94189 16.7917 1.94189 12.7V12.5917C1.94189 8.89167 3.40023 7.10833 6.66689 6.8C7.00023 6.775 7.31689 7.025 7.35023 7.36667C7.38356 7.70833 7.13356 8.01667 6.78356 8.05C4.16689 8.29167 3.19189 9.525 3.19189 12.6V12.7083C3.19189 16.1 4.39189 17.3 7.78356 17.3H13.2169C16.6086 17.3 17.8086 16.1 17.8086 12.7083V12.6C17.8086 9.50833 16.8169 8.275 14.1502 8.05C13.8086 8.01667 13.5502 7.71667 13.5836 7.375C13.6169 7.03333 13.9086 6.775 14.2586 6.80833C17.5752 7.09167 19.0586 8.88333 19.0586 12.6083V12.7167C19.0586 16.7917 17.3086 18.5417 13.2169 18.5417Z",
|
|
5428
|
-
fill: "
|
|
5428
|
+
fill: "currentColor"
|
|
5429
5429
|
}
|
|
5430
5430
|
),
|
|
5431
5431
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5432
5432
|
"path",
|
|
5433
5433
|
{
|
|
5434
5434
|
d: "M10.5 13.025C10.1583 13.025 9.875 12.7417 9.875 12.4V1.66667C9.875 1.32501 10.1583 1.04167 10.5 1.04167C10.8417 1.04167 11.125 1.32501 11.125 1.66667V12.4C11.125 12.75 10.8417 13.025 10.5 13.025Z",
|
|
5435
|
-
fill: "
|
|
5435
|
+
fill: "currentColor"
|
|
5436
5436
|
}
|
|
5437
5437
|
),
|
|
5438
5438
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5439
5439
|
"path",
|
|
5440
5440
|
{
|
|
5441
5441
|
d: "M10.5 13.9583C10.3417 13.9583 10.1834 13.9 10.0584 13.775L7.2667 10.9833C7.02503 10.7417 7.02503 10.3417 7.2667 10.1C7.50837 9.85833 7.90837 9.85833 8.15003 10.1L10.5 12.45L12.85 10.1C13.0917 9.85833 13.4917 9.85833 13.7334 10.1C13.975 10.3417 13.975 10.7417 13.7334 10.9833L10.9417 13.775C10.8167 13.9 10.6584 13.9583 10.5 13.9583Z",
|
|
5442
|
-
fill: "
|
|
5442
|
+
fill: "currentColor"
|
|
5443
5443
|
}
|
|
5444
5444
|
)
|
|
5445
5445
|
]
|
|
@@ -32714,10 +32714,10 @@ var DownLoadBinaryField = (props) => {
|
|
|
32714
32714
|
{
|
|
32715
32715
|
type: "button",
|
|
32716
32716
|
onClick: handleFileDownload,
|
|
32717
|
-
className: "flex items-center gap-1 text-blue-700",
|
|
32717
|
+
className: "flex items-center gap-1 text-blue-700 my-auto",
|
|
32718
32718
|
children: [
|
|
32719
32719
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(DownloadIcon, {}),
|
|
32720
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-sm italic underline", children: i18n_default.t("download_file") })
|
|
32720
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-sm italic underline text-primary", children: i18n_default.t("download_file") })
|
|
32721
32721
|
]
|
|
32722
32722
|
}
|
|
32723
32723
|
);
|
|
@@ -33467,19 +33467,28 @@ var Many2ManyTagField = (props) => {
|
|
|
33467
33467
|
clearErrors(name2);
|
|
33468
33468
|
}
|
|
33469
33469
|
}, [field.value]);
|
|
33470
|
-
const filteredValue =
|
|
33471
|
-
(
|
|
33472
|
-
|
|
33473
|
-
|
|
33474
|
-
|
|
33475
|
-
|
|
33470
|
+
const filteredValue = (0, import_react58.useMemo)(() => {
|
|
33471
|
+
if (!Array.isArray(field?.value)) return null;
|
|
33472
|
+
const fieldValueMapped = field.value.map((v) => ({
|
|
33473
|
+
value: v?.id,
|
|
33474
|
+
label: v?.display_name ?? v?.name,
|
|
33475
|
+
...v
|
|
33476
|
+
}));
|
|
33477
|
+
const fromOptions = options2?.filter(
|
|
33478
|
+
(opt) => field.value.some((v) => v.id === opt.value)
|
|
33479
|
+
) ?? [];
|
|
33480
|
+
const missingFromOptions = fieldValueMapped?.filter(
|
|
33481
|
+
(fv) => !options2?.some((opt) => opt?.value === fv?.value)
|
|
33482
|
+
);
|
|
33483
|
+
return [...fromOptions, ...missingFromOptions];
|
|
33484
|
+
}, [field?.value, options2]);
|
|
33476
33485
|
const handleChange = (selectedOptions) => {
|
|
33477
33486
|
const newValue = transfer(selectedOptions);
|
|
33478
33487
|
field.onChange(newValue);
|
|
33479
33488
|
onChange2?.(name2 ?? "", newValue);
|
|
33480
33489
|
clearErrors(name2);
|
|
33481
33490
|
};
|
|
33482
|
-
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "group h-full", children: [
|
|
33491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "group h-full overflow-y-auto", children: [
|
|
33483
33492
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
33484
33493
|
StateManagedSelect$1,
|
|
33485
33494
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -5306,21 +5306,21 @@ var DownloadIcon = () => {
|
|
|
5306
5306
|
"path",
|
|
5307
5307
|
{
|
|
5308
5308
|
d: "M13.2169 18.5417H7.78356C3.69189 18.5417 1.94189 16.7917 1.94189 12.7V12.5917C1.94189 8.89167 3.40023 7.10833 6.66689 6.8C7.00023 6.775 7.31689 7.025 7.35023 7.36667C7.38356 7.70833 7.13356 8.01667 6.78356 8.05C4.16689 8.29167 3.19189 9.525 3.19189 12.6V12.7083C3.19189 16.1 4.39189 17.3 7.78356 17.3H13.2169C16.6086 17.3 17.8086 16.1 17.8086 12.7083V12.6C17.8086 9.50833 16.8169 8.275 14.1502 8.05C13.8086 8.01667 13.5502 7.71667 13.5836 7.375C13.6169 7.03333 13.9086 6.775 14.2586 6.80833C17.5752 7.09167 19.0586 8.88333 19.0586 12.6083V12.7167C19.0586 16.7917 17.3086 18.5417 13.2169 18.5417Z",
|
|
5309
|
-
fill: "
|
|
5309
|
+
fill: "currentColor"
|
|
5310
5310
|
}
|
|
5311
5311
|
),
|
|
5312
5312
|
/* @__PURE__ */ jsx13(
|
|
5313
5313
|
"path",
|
|
5314
5314
|
{
|
|
5315
5315
|
d: "M10.5 13.025C10.1583 13.025 9.875 12.7417 9.875 12.4V1.66667C9.875 1.32501 10.1583 1.04167 10.5 1.04167C10.8417 1.04167 11.125 1.32501 11.125 1.66667V12.4C11.125 12.75 10.8417 13.025 10.5 13.025Z",
|
|
5316
|
-
fill: "
|
|
5316
|
+
fill: "currentColor"
|
|
5317
5317
|
}
|
|
5318
5318
|
),
|
|
5319
5319
|
/* @__PURE__ */ jsx13(
|
|
5320
5320
|
"path",
|
|
5321
5321
|
{
|
|
5322
5322
|
d: "M10.5 13.9583C10.3417 13.9583 10.1834 13.9 10.0584 13.775L7.2667 10.9833C7.02503 10.7417 7.02503 10.3417 7.2667 10.1C7.50837 9.85833 7.90837 9.85833 8.15003 10.1L10.5 12.45L12.85 10.1C13.0917 9.85833 13.4917 9.85833 13.7334 10.1C13.975 10.3417 13.975 10.7417 13.7334 10.9833L10.9417 13.775C10.8167 13.9 10.6584 13.9583 10.5 13.9583Z",
|
|
5323
|
-
fill: "
|
|
5323
|
+
fill: "currentColor"
|
|
5324
5324
|
}
|
|
5325
5325
|
)
|
|
5326
5326
|
]
|
|
@@ -32595,10 +32595,10 @@ var DownLoadBinaryField = (props) => {
|
|
|
32595
32595
|
{
|
|
32596
32596
|
type: "button",
|
|
32597
32597
|
onClick: handleFileDownload,
|
|
32598
|
-
className: "flex items-center gap-1 text-blue-700",
|
|
32598
|
+
className: "flex items-center gap-1 text-blue-700 my-auto",
|
|
32599
32599
|
children: [
|
|
32600
32600
|
/* @__PURE__ */ jsx81(DownloadIcon, {}),
|
|
32601
|
-
/* @__PURE__ */ jsx81("span", { className: "text-sm italic underline", children: i18n_default.t("download_file") })
|
|
32601
|
+
/* @__PURE__ */ jsx81("span", { className: "text-sm italic underline text-primary", children: i18n_default.t("download_file") })
|
|
32602
32602
|
]
|
|
32603
32603
|
}
|
|
32604
32604
|
);
|
|
@@ -33200,7 +33200,7 @@ var ImageField = (props) => {
|
|
|
33200
33200
|
};
|
|
33201
33201
|
|
|
33202
33202
|
// src/widgets/basic/many2many-tags-field/many2many-tags.tsx
|
|
33203
|
-
import React16, { useEffect as useEffect19 } from "react";
|
|
33203
|
+
import React16, { useEffect as useEffect19, useMemo as useMemo9 } from "react";
|
|
33204
33204
|
|
|
33205
33205
|
// src/widgets/basic/information-field/information.tsx
|
|
33206
33206
|
import { Fragment as Fragment26, jsx as jsx90, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
@@ -33348,19 +33348,28 @@ var Many2ManyTagField = (props) => {
|
|
|
33348
33348
|
clearErrors(name2);
|
|
33349
33349
|
}
|
|
33350
33350
|
}, [field.value]);
|
|
33351
|
-
const filteredValue =
|
|
33352
|
-
(
|
|
33353
|
-
|
|
33354
|
-
|
|
33355
|
-
|
|
33356
|
-
|
|
33351
|
+
const filteredValue = useMemo9(() => {
|
|
33352
|
+
if (!Array.isArray(field?.value)) return null;
|
|
33353
|
+
const fieldValueMapped = field.value.map((v) => ({
|
|
33354
|
+
value: v?.id,
|
|
33355
|
+
label: v?.display_name ?? v?.name,
|
|
33356
|
+
...v
|
|
33357
|
+
}));
|
|
33358
|
+
const fromOptions = options2?.filter(
|
|
33359
|
+
(opt) => field.value.some((v) => v.id === opt.value)
|
|
33360
|
+
) ?? [];
|
|
33361
|
+
const missingFromOptions = fieldValueMapped?.filter(
|
|
33362
|
+
(fv) => !options2?.some((opt) => opt?.value === fv?.value)
|
|
33363
|
+
);
|
|
33364
|
+
return [...fromOptions, ...missingFromOptions];
|
|
33365
|
+
}, [field?.value, options2]);
|
|
33357
33366
|
const handleChange = (selectedOptions) => {
|
|
33358
33367
|
const newValue = transfer(selectedOptions);
|
|
33359
33368
|
field.onChange(newValue);
|
|
33360
33369
|
onChange2?.(name2 ?? "", newValue);
|
|
33361
33370
|
clearErrors(name2);
|
|
33362
33371
|
};
|
|
33363
|
-
return /* @__PURE__ */ jsxs62("div", { className: "group h-full", children: [
|
|
33372
|
+
return /* @__PURE__ */ jsxs62("div", { className: "group h-full overflow-y-auto", children: [
|
|
33364
33373
|
/* @__PURE__ */ jsx91(
|
|
33365
33374
|
StateManagedSelect$1,
|
|
33366
33375
|
{
|
|
@@ -34484,7 +34493,7 @@ var Many2ManyField = (props) => {
|
|
|
34484
34493
|
};
|
|
34485
34494
|
|
|
34486
34495
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34487
|
-
import React18, { useEffect as useEffect25, useMemo as
|
|
34496
|
+
import React18, { useEffect as useEffect25, useMemo as useMemo10 } from "react";
|
|
34488
34497
|
import { Fragment as Fragment30, jsx as jsx104, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
34489
34498
|
var CustomMenuList2 = (props) => {
|
|
34490
34499
|
const { options: options2, children, selectProps } = props;
|
|
@@ -34533,7 +34542,7 @@ var Many2OneField = (props) => {
|
|
|
34533
34542
|
setInputValue,
|
|
34534
34543
|
setDomainObject
|
|
34535
34544
|
} = props;
|
|
34536
|
-
const actionId =
|
|
34545
|
+
const actionId = useMemo10(
|
|
34537
34546
|
() => menuList?.flatMap(
|
|
34538
34547
|
(item) => item?.child_id.filter(
|
|
34539
34548
|
(childItem) => childItem?.is_display && childItem?.action?.res_model === relation
|
|
@@ -34773,11 +34782,11 @@ var StatusbarDurationField = (props) => {
|
|
|
34773
34782
|
};
|
|
34774
34783
|
|
|
34775
34784
|
// src/widgets/basic/status-bar-field/option/option.tsx
|
|
34776
|
-
import { useMemo as
|
|
34785
|
+
import { useMemo as useMemo11 } from "react";
|
|
34777
34786
|
import { jsx as jsx106, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
34778
34787
|
var StatusBarOptionField = (props) => {
|
|
34779
34788
|
const { selection, defaultValue } = props;
|
|
34780
|
-
const memoizedStatusOptions =
|
|
34789
|
+
const memoizedStatusOptions = useMemo11(() => selection, [selection]);
|
|
34781
34790
|
return /* @__PURE__ */ jsx106(
|
|
34782
34791
|
"div",
|
|
34783
34792
|
{
|
package/dist/widgets.js
CHANGED
|
@@ -8384,21 +8384,21 @@ var DownloadIcon = () => {
|
|
|
8384
8384
|
"path",
|
|
8385
8385
|
{
|
|
8386
8386
|
d: "M13.2169 18.5417H7.78356C3.69189 18.5417 1.94189 16.7917 1.94189 12.7V12.5917C1.94189 8.89167 3.40023 7.10833 6.66689 6.8C7.00023 6.775 7.31689 7.025 7.35023 7.36667C7.38356 7.70833 7.13356 8.01667 6.78356 8.05C4.16689 8.29167 3.19189 9.525 3.19189 12.6V12.7083C3.19189 16.1 4.39189 17.3 7.78356 17.3H13.2169C16.6086 17.3 17.8086 16.1 17.8086 12.7083V12.6C17.8086 9.50833 16.8169 8.275 14.1502 8.05C13.8086 8.01667 13.5502 7.71667 13.5836 7.375C13.6169 7.03333 13.9086 6.775 14.2586 6.80833C17.5752 7.09167 19.0586 8.88333 19.0586 12.6083V12.7167C19.0586 16.7917 17.3086 18.5417 13.2169 18.5417Z",
|
|
8387
|
-
fill: "
|
|
8387
|
+
fill: "currentColor"
|
|
8388
8388
|
}
|
|
8389
8389
|
),
|
|
8390
8390
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8391
8391
|
"path",
|
|
8392
8392
|
{
|
|
8393
8393
|
d: "M10.5 13.025C10.1583 13.025 9.875 12.7417 9.875 12.4V1.66667C9.875 1.32501 10.1583 1.04167 10.5 1.04167C10.8417 1.04167 11.125 1.32501 11.125 1.66667V12.4C11.125 12.75 10.8417 13.025 10.5 13.025Z",
|
|
8394
|
-
fill: "
|
|
8394
|
+
fill: "currentColor"
|
|
8395
8395
|
}
|
|
8396
8396
|
),
|
|
8397
8397
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
8398
8398
|
"path",
|
|
8399
8399
|
{
|
|
8400
8400
|
d: "M10.5 13.9583C10.3417 13.9583 10.1834 13.9 10.0584 13.775L7.2667 10.9833C7.02503 10.7417 7.02503 10.3417 7.2667 10.1C7.50837 9.85833 7.90837 9.85833 8.15003 10.1L10.5 12.45L12.85 10.1C13.0917 9.85833 13.4917 9.85833 13.7334 10.1C13.975 10.3417 13.975 10.7417 13.7334 10.9833L10.9417 13.775C10.8167 13.9 10.6584 13.9583 10.5 13.9583Z",
|
|
8401
|
-
fill: "
|
|
8401
|
+
fill: "currentColor"
|
|
8402
8402
|
}
|
|
8403
8403
|
)
|
|
8404
8404
|
]
|
|
@@ -32340,10 +32340,10 @@ var DownLoadBinaryField = (props) => {
|
|
|
32340
32340
|
{
|
|
32341
32341
|
type: "button",
|
|
32342
32342
|
onClick: handleFileDownload,
|
|
32343
|
-
className: "flex items-center gap-1 text-blue-700",
|
|
32343
|
+
className: "flex items-center gap-1 text-blue-700 my-auto",
|
|
32344
32344
|
children: [
|
|
32345
32345
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(DownloadIcon, {}),
|
|
32346
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-sm italic underline", children: i18n_default.t("download_file") })
|
|
32346
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-sm italic underline text-primary", children: i18n_default.t("download_file") })
|
|
32347
32347
|
]
|
|
32348
32348
|
}
|
|
32349
32349
|
);
|
|
@@ -33093,19 +33093,28 @@ var Many2ManyTagField = (props) => {
|
|
|
33093
33093
|
clearErrors(name2);
|
|
33094
33094
|
}
|
|
33095
33095
|
}, [field.value]);
|
|
33096
|
-
const filteredValue =
|
|
33097
|
-
(
|
|
33098
|
-
|
|
33099
|
-
|
|
33100
|
-
|
|
33101
|
-
|
|
33096
|
+
const filteredValue = (0, import_react58.useMemo)(() => {
|
|
33097
|
+
if (!Array.isArray(field?.value)) return null;
|
|
33098
|
+
const fieldValueMapped = field.value.map((v) => ({
|
|
33099
|
+
value: v?.id,
|
|
33100
|
+
label: v?.display_name ?? v?.name,
|
|
33101
|
+
...v
|
|
33102
|
+
}));
|
|
33103
|
+
const fromOptions = options2?.filter(
|
|
33104
|
+
(opt) => field.value.some((v) => v.id === opt.value)
|
|
33105
|
+
) ?? [];
|
|
33106
|
+
const missingFromOptions = fieldValueMapped?.filter(
|
|
33107
|
+
(fv) => !options2?.some((opt) => opt?.value === fv?.value)
|
|
33108
|
+
);
|
|
33109
|
+
return [...fromOptions, ...missingFromOptions];
|
|
33110
|
+
}, [field?.value, options2]);
|
|
33102
33111
|
const handleChange = (selectedOptions) => {
|
|
33103
33112
|
const newValue = transfer(selectedOptions);
|
|
33104
33113
|
field.onChange(newValue);
|
|
33105
33114
|
onChange2?.(name2 ?? "", newValue);
|
|
33106
33115
|
clearErrors(name2);
|
|
33107
33116
|
};
|
|
33108
|
-
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "group h-full", children: [
|
|
33117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "group h-full overflow-y-auto", children: [
|
|
33109
33118
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
33110
33119
|
StateManagedSelect$1,
|
|
33111
33120
|
{
|
package/dist/widgets.mjs
CHANGED
|
@@ -8321,21 +8321,21 @@ var DownloadIcon = () => {
|
|
|
8321
8321
|
"path",
|
|
8322
8322
|
{
|
|
8323
8323
|
d: "M13.2169 18.5417H7.78356C3.69189 18.5417 1.94189 16.7917 1.94189 12.7V12.5917C1.94189 8.89167 3.40023 7.10833 6.66689 6.8C7.00023 6.775 7.31689 7.025 7.35023 7.36667C7.38356 7.70833 7.13356 8.01667 6.78356 8.05C4.16689 8.29167 3.19189 9.525 3.19189 12.6V12.7083C3.19189 16.1 4.39189 17.3 7.78356 17.3H13.2169C16.6086 17.3 17.8086 16.1 17.8086 12.7083V12.6C17.8086 9.50833 16.8169 8.275 14.1502 8.05C13.8086 8.01667 13.5502 7.71667 13.5836 7.375C13.6169 7.03333 13.9086 6.775 14.2586 6.80833C17.5752 7.09167 19.0586 8.88333 19.0586 12.6083V12.7167C19.0586 16.7917 17.3086 18.5417 13.2169 18.5417Z",
|
|
8324
|
-
fill: "
|
|
8324
|
+
fill: "currentColor"
|
|
8325
8325
|
}
|
|
8326
8326
|
),
|
|
8327
8327
|
/* @__PURE__ */ jsx15(
|
|
8328
8328
|
"path",
|
|
8329
8329
|
{
|
|
8330
8330
|
d: "M10.5 13.025C10.1583 13.025 9.875 12.7417 9.875 12.4V1.66667C9.875 1.32501 10.1583 1.04167 10.5 1.04167C10.8417 1.04167 11.125 1.32501 11.125 1.66667V12.4C11.125 12.75 10.8417 13.025 10.5 13.025Z",
|
|
8331
|
-
fill: "
|
|
8331
|
+
fill: "currentColor"
|
|
8332
8332
|
}
|
|
8333
8333
|
),
|
|
8334
8334
|
/* @__PURE__ */ jsx15(
|
|
8335
8335
|
"path",
|
|
8336
8336
|
{
|
|
8337
8337
|
d: "M10.5 13.9583C10.3417 13.9583 10.1834 13.9 10.0584 13.775L7.2667 10.9833C7.02503 10.7417 7.02503 10.3417 7.2667 10.1C7.50837 9.85833 7.90837 9.85833 8.15003 10.1L10.5 12.45L12.85 10.1C13.0917 9.85833 13.4917 9.85833 13.7334 10.1C13.975 10.3417 13.975 10.7417 13.7334 10.9833L10.9417 13.775C10.8167 13.9 10.6584 13.9583 10.5 13.9583Z",
|
|
8338
|
-
fill: "
|
|
8338
|
+
fill: "currentColor"
|
|
8339
8339
|
}
|
|
8340
8340
|
)
|
|
8341
8341
|
]
|
|
@@ -32277,10 +32277,10 @@ var DownLoadBinaryField = (props) => {
|
|
|
32277
32277
|
{
|
|
32278
32278
|
type: "button",
|
|
32279
32279
|
onClick: handleFileDownload,
|
|
32280
|
-
className: "flex items-center gap-1 text-blue-700",
|
|
32280
|
+
className: "flex items-center gap-1 text-blue-700 my-auto",
|
|
32281
32281
|
children: [
|
|
32282
32282
|
/* @__PURE__ */ jsx81(DownloadIcon, {}),
|
|
32283
|
-
/* @__PURE__ */ jsx81("span", { className: "text-sm italic underline", children: i18n_default.t("download_file") })
|
|
32283
|
+
/* @__PURE__ */ jsx81("span", { className: "text-sm italic underline text-primary", children: i18n_default.t("download_file") })
|
|
32284
32284
|
]
|
|
32285
32285
|
}
|
|
32286
32286
|
);
|
|
@@ -32882,7 +32882,7 @@ var ImageField = (props) => {
|
|
|
32882
32882
|
};
|
|
32883
32883
|
|
|
32884
32884
|
// src/widgets/basic/many2many-tags-field/many2many-tags.tsx
|
|
32885
|
-
import React16, { useEffect as useEffect19 } from "react";
|
|
32885
|
+
import React16, { useEffect as useEffect19, useMemo as useMemo9 } from "react";
|
|
32886
32886
|
|
|
32887
32887
|
// src/widgets/basic/information-field/information.tsx
|
|
32888
32888
|
import { Fragment as Fragment26, jsx as jsx90, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
@@ -33030,19 +33030,28 @@ var Many2ManyTagField = (props) => {
|
|
|
33030
33030
|
clearErrors(name2);
|
|
33031
33031
|
}
|
|
33032
33032
|
}, [field.value]);
|
|
33033
|
-
const filteredValue =
|
|
33034
|
-
(
|
|
33035
|
-
|
|
33036
|
-
|
|
33037
|
-
|
|
33038
|
-
|
|
33033
|
+
const filteredValue = useMemo9(() => {
|
|
33034
|
+
if (!Array.isArray(field?.value)) return null;
|
|
33035
|
+
const fieldValueMapped = field.value.map((v) => ({
|
|
33036
|
+
value: v?.id,
|
|
33037
|
+
label: v?.display_name ?? v?.name,
|
|
33038
|
+
...v
|
|
33039
|
+
}));
|
|
33040
|
+
const fromOptions = options2?.filter(
|
|
33041
|
+
(opt) => field.value.some((v) => v.id === opt.value)
|
|
33042
|
+
) ?? [];
|
|
33043
|
+
const missingFromOptions = fieldValueMapped?.filter(
|
|
33044
|
+
(fv) => !options2?.some((opt) => opt?.value === fv?.value)
|
|
33045
|
+
);
|
|
33046
|
+
return [...fromOptions, ...missingFromOptions];
|
|
33047
|
+
}, [field?.value, options2]);
|
|
33039
33048
|
const handleChange = (selectedOptions) => {
|
|
33040
33049
|
const newValue = transfer(selectedOptions);
|
|
33041
33050
|
field.onChange(newValue);
|
|
33042
33051
|
onChange2?.(name2 ?? "", newValue);
|
|
33043
33052
|
clearErrors(name2);
|
|
33044
33053
|
};
|
|
33045
|
-
return /* @__PURE__ */ jsxs62("div", { className: "group h-full", children: [
|
|
33054
|
+
return /* @__PURE__ */ jsxs62("div", { className: "group h-full overflow-y-auto", children: [
|
|
33046
33055
|
/* @__PURE__ */ jsx91(
|
|
33047
33056
|
StateManagedSelect$1,
|
|
33048
33057
|
{
|
|
@@ -34166,7 +34175,7 @@ var Many2ManyField = (props) => {
|
|
|
34166
34175
|
};
|
|
34167
34176
|
|
|
34168
34177
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34169
|
-
import React18, { useEffect as useEffect25, useMemo as
|
|
34178
|
+
import React18, { useEffect as useEffect25, useMemo as useMemo10 } from "react";
|
|
34170
34179
|
import { Fragment as Fragment30, jsx as jsx104, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
34171
34180
|
var CustomMenuList2 = (props) => {
|
|
34172
34181
|
const { options: options2, children, selectProps } = props;
|
|
@@ -34215,7 +34224,7 @@ var Many2OneField = (props) => {
|
|
|
34215
34224
|
setInputValue,
|
|
34216
34225
|
setDomainObject
|
|
34217
34226
|
} = props;
|
|
34218
|
-
const actionId =
|
|
34227
|
+
const actionId = useMemo10(
|
|
34219
34228
|
() => menuList?.flatMap(
|
|
34220
34229
|
(item) => item?.child_id.filter(
|
|
34221
34230
|
(childItem) => childItem?.is_display && childItem?.action?.res_model === relation
|
|
@@ -34455,11 +34464,11 @@ var StatusbarDurationField = (props) => {
|
|
|
34455
34464
|
};
|
|
34456
34465
|
|
|
34457
34466
|
// src/widgets/basic/status-bar-field/option/option.tsx
|
|
34458
|
-
import { useMemo as
|
|
34467
|
+
import { useMemo as useMemo11 } from "react";
|
|
34459
34468
|
import { jsx as jsx106, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
34460
34469
|
var StatusBarOptionField = (props) => {
|
|
34461
34470
|
const { selection, defaultValue } = props;
|
|
34462
|
-
const memoizedStatusOptions =
|
|
34471
|
+
const memoizedStatusOptions = useMemo11(() => selection, [selection]);
|
|
34463
34472
|
return /* @__PURE__ */ jsx106(
|
|
34464
34473
|
"div",
|
|
34465
34474
|
{
|