@fctc/sme-widget-ui 1.3.4 → 1.3.5
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.js +50 -29
- package/dist/index.mjs +46 -25
- package/dist/widgets.d.mts +3 -20
- package/dist/widgets.d.ts +3 -20
- package/dist/widgets.js +50 -29
- package/dist/widgets.mjs +46 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34226,43 +34226,48 @@ var StatusDropdownField = (props) => {
|
|
|
34226
34226
|
|
|
34227
34227
|
// src/widgets/basic/many2many-field/many2many.tsx
|
|
34228
34228
|
var import_react_dom8 = require("react-dom");
|
|
34229
|
+
var import_react63 = require("react");
|
|
34229
34230
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
34230
34231
|
var Many2ManyField = (props) => {
|
|
34231
34232
|
const {
|
|
34232
34233
|
aid,
|
|
34233
34234
|
title,
|
|
34234
34235
|
onClose,
|
|
34235
|
-
page,
|
|
34236
|
-
rows,
|
|
34237
|
-
columns,
|
|
34238
34236
|
renderField,
|
|
34239
|
-
isDataLoading,
|
|
34240
34237
|
relation,
|
|
34241
|
-
onToggleColumnOptional,
|
|
34242
|
-
isDataFetched,
|
|
34243
|
-
isPlaceholderData,
|
|
34244
|
-
optionsObject,
|
|
34245
34238
|
onChoose,
|
|
34246
34239
|
onAddNew,
|
|
34247
|
-
selectedRowKeys,
|
|
34248
|
-
handleCreateNewOnPage,
|
|
34249
34240
|
rootField,
|
|
34241
|
+
isDisplayCheckbox,
|
|
34250
34242
|
onAddRow,
|
|
34251
34243
|
onClickRow,
|
|
34252
|
-
totalRows,
|
|
34253
|
-
setPage,
|
|
34254
34244
|
evalJSONContext,
|
|
34255
|
-
searchController,
|
|
34256
34245
|
tableGroupController,
|
|
34257
|
-
|
|
34258
|
-
|
|
34259
|
-
isDisplayCheckbox,
|
|
34260
|
-
checkedAll,
|
|
34261
|
-
handleCheckBoxAll,
|
|
34262
|
-
selectedRowKeysRef,
|
|
34263
|
-
typeTable,
|
|
34264
|
-
setSelectedRowKeys
|
|
34246
|
+
many2manyController,
|
|
34247
|
+
tableHeadController
|
|
34265
34248
|
} = props;
|
|
34249
|
+
const {
|
|
34250
|
+
handleCreateNewOnPage,
|
|
34251
|
+
optionsObject,
|
|
34252
|
+
rows,
|
|
34253
|
+
columns,
|
|
34254
|
+
typeTable,
|
|
34255
|
+
isLoading,
|
|
34256
|
+
isFetched,
|
|
34257
|
+
isPlaceholderData,
|
|
34258
|
+
setPage,
|
|
34259
|
+
page,
|
|
34260
|
+
totalRows,
|
|
34261
|
+
onToggleColumnOptional,
|
|
34262
|
+
searchController,
|
|
34263
|
+
setDomain,
|
|
34264
|
+
viewData,
|
|
34265
|
+
groupByList,
|
|
34266
|
+
setGroupByList,
|
|
34267
|
+
selectedRowKeys,
|
|
34268
|
+
setSelectedRowKeys,
|
|
34269
|
+
setPageLimit
|
|
34270
|
+
} = many2manyController;
|
|
34266
34271
|
const {
|
|
34267
34272
|
context,
|
|
34268
34273
|
domain: domainSearch,
|
|
@@ -34278,6 +34283,21 @@ var Many2ManyField = (props) => {
|
|
|
34278
34283
|
setGroupBy,
|
|
34279
34284
|
clearSearch
|
|
34280
34285
|
} = searchController;
|
|
34286
|
+
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
34287
|
+
(0, import_react63.useEffect)(() => {
|
|
34288
|
+
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
34289
|
+
if (groupItems?.length > 0) {
|
|
34290
|
+
typeof setPageLimit === "function" && setPageLimit(80);
|
|
34291
|
+
} else {
|
|
34292
|
+
typeof setPageLimit === "function" && setPageLimit(10);
|
|
34293
|
+
}
|
|
34294
|
+
if (groupItems?.[0]) {
|
|
34295
|
+
typeof setGroupByList === "function" && setGroupByList(groupItems?.[0]);
|
|
34296
|
+
}
|
|
34297
|
+
return () => {
|
|
34298
|
+
typeof setGroupByList === "function" && setGroupByList(null);
|
|
34299
|
+
};
|
|
34300
|
+
}, [selectedTags]);
|
|
34281
34301
|
return (0, import_react_dom8.createPortal)(
|
|
34282
34302
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
34283
34303
|
"div",
|
|
@@ -34331,7 +34351,8 @@ var Many2ManyField = (props) => {
|
|
|
34331
34351
|
aid,
|
|
34332
34352
|
domainSearch,
|
|
34333
34353
|
evalJSONContext,
|
|
34334
|
-
clearSearch
|
|
34354
|
+
clearSearch,
|
|
34355
|
+
groupByList
|
|
34335
34356
|
}
|
|
34336
34357
|
) }),
|
|
34337
34358
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
@@ -34351,7 +34372,7 @@ var Many2ManyField = (props) => {
|
|
|
34351
34372
|
}
|
|
34352
34373
|
)
|
|
34353
34374
|
] }),
|
|
34354
|
-
!
|
|
34375
|
+
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "relative h-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
34355
34376
|
"div",
|
|
34356
34377
|
{
|
|
34357
34378
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -34464,12 +34485,12 @@ var Many2ManyField = (props) => {
|
|
|
34464
34485
|
};
|
|
34465
34486
|
|
|
34466
34487
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34467
|
-
var
|
|
34488
|
+
var import_react64 = __toESM(require("react"));
|
|
34468
34489
|
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
34469
34490
|
var CustomMenuList = (props) => {
|
|
34470
34491
|
const { options: options2, children, selectProps } = props;
|
|
34471
34492
|
const { setIsShowModalMany2Many, searchable } = selectProps;
|
|
34472
|
-
const limitedChildren =
|
|
34493
|
+
const limitedChildren = import_react64.default.Children.toArray(children).slice(0, 10);
|
|
34473
34494
|
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(components.MenuList, { ...props, className: "z-[99]", children: [
|
|
34474
34495
|
limitedChildren,
|
|
34475
34496
|
options2?.length > 0 && (options2?.length > 10 || searchable) && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
@@ -34513,7 +34534,7 @@ var Many2OneField = (props) => {
|
|
|
34513
34534
|
setInputValue,
|
|
34514
34535
|
setDomainObject
|
|
34515
34536
|
} = props;
|
|
34516
|
-
const actionId = (0,
|
|
34537
|
+
const actionId = (0, import_react64.useMemo)(
|
|
34517
34538
|
() => menuList?.flatMap(
|
|
34518
34539
|
(item) => item?.child_id.filter(
|
|
34519
34540
|
(childItem) => childItem?.is_display && childItem?.action?.res_model === relation
|
|
@@ -34570,7 +34591,7 @@ var Many2OneField = (props) => {
|
|
|
34570
34591
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34571
34592
|
(option) => option.value === tempSelectedOption?.value
|
|
34572
34593
|
) : currentValue ? currentValue : null;
|
|
34573
|
-
(0,
|
|
34594
|
+
(0, import_react64.useEffect)(() => {
|
|
34574
34595
|
if (error2 && selectedOption) {
|
|
34575
34596
|
methods?.clearErrors(name2);
|
|
34576
34597
|
}
|
|
@@ -34753,11 +34774,11 @@ var StatusbarDurationField = (props) => {
|
|
|
34753
34774
|
};
|
|
34754
34775
|
|
|
34755
34776
|
// src/widgets/basic/status-bar-field/option/option.tsx
|
|
34756
|
-
var
|
|
34777
|
+
var import_react65 = require("react");
|
|
34757
34778
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
34758
34779
|
var StatusBarOptionField = (props) => {
|
|
34759
34780
|
const { selection, defaultValue } = props;
|
|
34760
|
-
const memoizedStatusOptions = (0,
|
|
34781
|
+
const memoizedStatusOptions = (0, import_react65.useMemo)(() => selection, [selection]);
|
|
34761
34782
|
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
34762
34783
|
"div",
|
|
34763
34784
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -34107,43 +34107,48 @@ var StatusDropdownField = (props) => {
|
|
|
34107
34107
|
|
|
34108
34108
|
// src/widgets/basic/many2many-field/many2many.tsx
|
|
34109
34109
|
import { createPortal as createPortal5 } from "react-dom";
|
|
34110
|
+
import { useEffect as useEffect24 } from "react";
|
|
34110
34111
|
import { jsx as jsx103, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
34111
34112
|
var Many2ManyField = (props) => {
|
|
34112
34113
|
const {
|
|
34113
34114
|
aid,
|
|
34114
34115
|
title,
|
|
34115
34116
|
onClose,
|
|
34116
|
-
page,
|
|
34117
|
-
rows,
|
|
34118
|
-
columns,
|
|
34119
34117
|
renderField,
|
|
34120
|
-
isDataLoading,
|
|
34121
34118
|
relation,
|
|
34122
|
-
onToggleColumnOptional,
|
|
34123
|
-
isDataFetched,
|
|
34124
|
-
isPlaceholderData,
|
|
34125
|
-
optionsObject,
|
|
34126
34119
|
onChoose,
|
|
34127
34120
|
onAddNew,
|
|
34128
|
-
selectedRowKeys,
|
|
34129
|
-
handleCreateNewOnPage,
|
|
34130
34121
|
rootField,
|
|
34122
|
+
isDisplayCheckbox,
|
|
34131
34123
|
onAddRow,
|
|
34132
34124
|
onClickRow,
|
|
34133
|
-
totalRows,
|
|
34134
|
-
setPage,
|
|
34135
34125
|
evalJSONContext,
|
|
34136
|
-
searchController,
|
|
34137
34126
|
tableGroupController,
|
|
34138
|
-
|
|
34139
|
-
|
|
34140
|
-
isDisplayCheckbox,
|
|
34141
|
-
checkedAll,
|
|
34142
|
-
handleCheckBoxAll,
|
|
34143
|
-
selectedRowKeysRef,
|
|
34144
|
-
typeTable,
|
|
34145
|
-
setSelectedRowKeys
|
|
34127
|
+
many2manyController,
|
|
34128
|
+
tableHeadController
|
|
34146
34129
|
} = props;
|
|
34130
|
+
const {
|
|
34131
|
+
handleCreateNewOnPage,
|
|
34132
|
+
optionsObject,
|
|
34133
|
+
rows,
|
|
34134
|
+
columns,
|
|
34135
|
+
typeTable,
|
|
34136
|
+
isLoading,
|
|
34137
|
+
isFetched,
|
|
34138
|
+
isPlaceholderData,
|
|
34139
|
+
setPage,
|
|
34140
|
+
page,
|
|
34141
|
+
totalRows,
|
|
34142
|
+
onToggleColumnOptional,
|
|
34143
|
+
searchController,
|
|
34144
|
+
setDomain,
|
|
34145
|
+
viewData,
|
|
34146
|
+
groupByList,
|
|
34147
|
+
setGroupByList,
|
|
34148
|
+
selectedRowKeys,
|
|
34149
|
+
setSelectedRowKeys,
|
|
34150
|
+
setPageLimit
|
|
34151
|
+
} = many2manyController;
|
|
34147
34152
|
const {
|
|
34148
34153
|
context,
|
|
34149
34154
|
domain: domainSearch,
|
|
@@ -34159,6 +34164,21 @@ var Many2ManyField = (props) => {
|
|
|
34159
34164
|
setGroupBy,
|
|
34160
34165
|
clearSearch
|
|
34161
34166
|
} = searchController;
|
|
34167
|
+
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
34168
|
+
useEffect24(() => {
|
|
34169
|
+
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
34170
|
+
if (groupItems?.length > 0) {
|
|
34171
|
+
typeof setPageLimit === "function" && setPageLimit(80);
|
|
34172
|
+
} else {
|
|
34173
|
+
typeof setPageLimit === "function" && setPageLimit(10);
|
|
34174
|
+
}
|
|
34175
|
+
if (groupItems?.[0]) {
|
|
34176
|
+
typeof setGroupByList === "function" && setGroupByList(groupItems?.[0]);
|
|
34177
|
+
}
|
|
34178
|
+
return () => {
|
|
34179
|
+
typeof setGroupByList === "function" && setGroupByList(null);
|
|
34180
|
+
};
|
|
34181
|
+
}, [selectedTags]);
|
|
34162
34182
|
return createPortal5(
|
|
34163
34183
|
/* @__PURE__ */ jsxs71(
|
|
34164
34184
|
"div",
|
|
@@ -34212,7 +34232,8 @@ var Many2ManyField = (props) => {
|
|
|
34212
34232
|
aid,
|
|
34213
34233
|
domainSearch,
|
|
34214
34234
|
evalJSONContext,
|
|
34215
|
-
clearSearch
|
|
34235
|
+
clearSearch,
|
|
34236
|
+
groupByList
|
|
34216
34237
|
}
|
|
34217
34238
|
) }),
|
|
34218
34239
|
/* @__PURE__ */ jsx103(
|
|
@@ -34232,7 +34253,7 @@ var Many2ManyField = (props) => {
|
|
|
34232
34253
|
}
|
|
34233
34254
|
)
|
|
34234
34255
|
] }),
|
|
34235
|
-
!
|
|
34256
|
+
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ jsx103("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx103("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx103(
|
|
34236
34257
|
"div",
|
|
34237
34258
|
{
|
|
34238
34259
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -34345,7 +34366,7 @@ var Many2ManyField = (props) => {
|
|
|
34345
34366
|
};
|
|
34346
34367
|
|
|
34347
34368
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34348
|
-
import React17, { useEffect as
|
|
34369
|
+
import React17, { useEffect as useEffect25, useMemo as useMemo9 } from "react";
|
|
34349
34370
|
import { Fragment as Fragment30, jsx as jsx104, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
34350
34371
|
var CustomMenuList = (props) => {
|
|
34351
34372
|
const { options: options2, children, selectProps } = props;
|
|
@@ -34451,7 +34472,7 @@ var Many2OneField = (props) => {
|
|
|
34451
34472
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34452
34473
|
(option) => option.value === tempSelectedOption?.value
|
|
34453
34474
|
) : currentValue ? currentValue : null;
|
|
34454
|
-
|
|
34475
|
+
useEffect25(() => {
|
|
34455
34476
|
if (error2 && selectedOption) {
|
|
34456
34477
|
methods?.clearErrors(name2);
|
|
34457
34478
|
}
|
package/dist/widgets.d.mts
CHANGED
|
@@ -393,27 +393,13 @@ interface SearchController {
|
|
|
393
393
|
interface Many2ManyProps extends IInputFieldProps {
|
|
394
394
|
aid?: number | null;
|
|
395
395
|
title?: string;
|
|
396
|
-
isDataLoading?: any;
|
|
397
|
-
isDataFetched?: any;
|
|
398
|
-
isPlaceholderData?: any;
|
|
399
396
|
isDisplayCheckbox?: boolean;
|
|
400
|
-
optionsObject?: any;
|
|
401
|
-
selectedRowKeys?: any;
|
|
402
|
-
handleCreateNewOnPage?: any;
|
|
403
|
-
typeTable?: any;
|
|
404
|
-
rows: any;
|
|
405
|
-
columns: any;
|
|
406
|
-
page?: any;
|
|
407
|
-
totalRows?: number;
|
|
408
397
|
rootField?: any;
|
|
409
|
-
viewData?: any;
|
|
410
398
|
onAddNew?: any;
|
|
411
399
|
onChoose?: any;
|
|
412
400
|
onClose?: any;
|
|
413
401
|
onAddRow?: Function;
|
|
414
402
|
onClickRow?: Function;
|
|
415
|
-
onToggleColumnOptional?: any;
|
|
416
|
-
setSelectedRowKeys?: any;
|
|
417
403
|
renderField?: ({ row, col, indexRow, onChangeData, rootField, }: {
|
|
418
404
|
row: any;
|
|
419
405
|
col: any;
|
|
@@ -421,14 +407,11 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
421
407
|
onChangeData: any;
|
|
422
408
|
rootField: any;
|
|
423
409
|
}) => {};
|
|
424
|
-
|
|
425
|
-
setDomain?: Dispatch<SetStateAction<any>>;
|
|
410
|
+
evalJSONContext?: any;
|
|
426
411
|
searchController: SearchController;
|
|
427
412
|
tableGroupController: (props: TableGroupControllerProps) => TableGroupControllerReturn;
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
handleCheckBoxAll?: any;
|
|
431
|
-
selectedRowKeysRef?: any;
|
|
413
|
+
many2manyController?: any;
|
|
414
|
+
tableHeadController?: any;
|
|
432
415
|
}
|
|
433
416
|
|
|
434
417
|
declare const Many2ManyField: (props: Many2ManyProps) => React$1.ReactPortal;
|
package/dist/widgets.d.ts
CHANGED
|
@@ -393,27 +393,13 @@ interface SearchController {
|
|
|
393
393
|
interface Many2ManyProps extends IInputFieldProps {
|
|
394
394
|
aid?: number | null;
|
|
395
395
|
title?: string;
|
|
396
|
-
isDataLoading?: any;
|
|
397
|
-
isDataFetched?: any;
|
|
398
|
-
isPlaceholderData?: any;
|
|
399
396
|
isDisplayCheckbox?: boolean;
|
|
400
|
-
optionsObject?: any;
|
|
401
|
-
selectedRowKeys?: any;
|
|
402
|
-
handleCreateNewOnPage?: any;
|
|
403
|
-
typeTable?: any;
|
|
404
|
-
rows: any;
|
|
405
|
-
columns: any;
|
|
406
|
-
page?: any;
|
|
407
|
-
totalRows?: number;
|
|
408
397
|
rootField?: any;
|
|
409
|
-
viewData?: any;
|
|
410
398
|
onAddNew?: any;
|
|
411
399
|
onChoose?: any;
|
|
412
400
|
onClose?: any;
|
|
413
401
|
onAddRow?: Function;
|
|
414
402
|
onClickRow?: Function;
|
|
415
|
-
onToggleColumnOptional?: any;
|
|
416
|
-
setSelectedRowKeys?: any;
|
|
417
403
|
renderField?: ({ row, col, indexRow, onChangeData, rootField, }: {
|
|
418
404
|
row: any;
|
|
419
405
|
col: any;
|
|
@@ -421,14 +407,11 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
421
407
|
onChangeData: any;
|
|
422
408
|
rootField: any;
|
|
423
409
|
}) => {};
|
|
424
|
-
|
|
425
|
-
setDomain?: Dispatch<SetStateAction<any>>;
|
|
410
|
+
evalJSONContext?: any;
|
|
426
411
|
searchController: SearchController;
|
|
427
412
|
tableGroupController: (props: TableGroupControllerProps) => TableGroupControllerReturn;
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
handleCheckBoxAll?: any;
|
|
431
|
-
selectedRowKeysRef?: any;
|
|
413
|
+
many2manyController?: any;
|
|
414
|
+
tableHeadController?: any;
|
|
432
415
|
}
|
|
433
416
|
|
|
434
417
|
declare const Many2ManyField: (props: Many2ManyProps) => React$1.ReactPortal;
|
package/dist/widgets.js
CHANGED
|
@@ -33852,43 +33852,48 @@ var StatusDropdownField = (props) => {
|
|
|
33852
33852
|
|
|
33853
33853
|
// src/widgets/basic/many2many-field/many2many.tsx
|
|
33854
33854
|
var import_react_dom8 = require("react-dom");
|
|
33855
|
+
var import_react63 = require("react");
|
|
33855
33856
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
33856
33857
|
var Many2ManyField = (props) => {
|
|
33857
33858
|
const {
|
|
33858
33859
|
aid,
|
|
33859
33860
|
title,
|
|
33860
33861
|
onClose,
|
|
33861
|
-
page,
|
|
33862
|
-
rows,
|
|
33863
|
-
columns,
|
|
33864
33862
|
renderField,
|
|
33865
|
-
isDataLoading,
|
|
33866
33863
|
relation,
|
|
33867
|
-
onToggleColumnOptional,
|
|
33868
|
-
isDataFetched,
|
|
33869
|
-
isPlaceholderData,
|
|
33870
|
-
optionsObject,
|
|
33871
33864
|
onChoose,
|
|
33872
33865
|
onAddNew,
|
|
33873
|
-
selectedRowKeys,
|
|
33874
|
-
handleCreateNewOnPage,
|
|
33875
33866
|
rootField,
|
|
33867
|
+
isDisplayCheckbox,
|
|
33876
33868
|
onAddRow,
|
|
33877
33869
|
onClickRow,
|
|
33878
|
-
totalRows,
|
|
33879
|
-
setPage,
|
|
33880
33870
|
evalJSONContext,
|
|
33881
|
-
searchController,
|
|
33882
33871
|
tableGroupController,
|
|
33883
|
-
|
|
33884
|
-
|
|
33885
|
-
isDisplayCheckbox,
|
|
33886
|
-
checkedAll,
|
|
33887
|
-
handleCheckBoxAll,
|
|
33888
|
-
selectedRowKeysRef,
|
|
33889
|
-
typeTable,
|
|
33890
|
-
setSelectedRowKeys
|
|
33872
|
+
many2manyController,
|
|
33873
|
+
tableHeadController
|
|
33891
33874
|
} = props;
|
|
33875
|
+
const {
|
|
33876
|
+
handleCreateNewOnPage,
|
|
33877
|
+
optionsObject,
|
|
33878
|
+
rows,
|
|
33879
|
+
columns,
|
|
33880
|
+
typeTable,
|
|
33881
|
+
isLoading,
|
|
33882
|
+
isFetched,
|
|
33883
|
+
isPlaceholderData,
|
|
33884
|
+
setPage,
|
|
33885
|
+
page,
|
|
33886
|
+
totalRows,
|
|
33887
|
+
onToggleColumnOptional,
|
|
33888
|
+
searchController,
|
|
33889
|
+
setDomain,
|
|
33890
|
+
viewData,
|
|
33891
|
+
groupByList,
|
|
33892
|
+
setGroupByList,
|
|
33893
|
+
selectedRowKeys,
|
|
33894
|
+
setSelectedRowKeys,
|
|
33895
|
+
setPageLimit
|
|
33896
|
+
} = many2manyController;
|
|
33892
33897
|
const {
|
|
33893
33898
|
context,
|
|
33894
33899
|
domain: domainSearch,
|
|
@@ -33904,6 +33909,21 @@ var Many2ManyField = (props) => {
|
|
|
33904
33909
|
setGroupBy,
|
|
33905
33910
|
clearSearch
|
|
33906
33911
|
} = searchController;
|
|
33912
|
+
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
33913
|
+
(0, import_react63.useEffect)(() => {
|
|
33914
|
+
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
33915
|
+
if (groupItems?.length > 0) {
|
|
33916
|
+
typeof setPageLimit === "function" && setPageLimit(80);
|
|
33917
|
+
} else {
|
|
33918
|
+
typeof setPageLimit === "function" && setPageLimit(10);
|
|
33919
|
+
}
|
|
33920
|
+
if (groupItems?.[0]) {
|
|
33921
|
+
typeof setGroupByList === "function" && setGroupByList(groupItems?.[0]);
|
|
33922
|
+
}
|
|
33923
|
+
return () => {
|
|
33924
|
+
typeof setGroupByList === "function" && setGroupByList(null);
|
|
33925
|
+
};
|
|
33926
|
+
}, [selectedTags]);
|
|
33907
33927
|
return (0, import_react_dom8.createPortal)(
|
|
33908
33928
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
33909
33929
|
"div",
|
|
@@ -33957,7 +33977,8 @@ var Many2ManyField = (props) => {
|
|
|
33957
33977
|
aid,
|
|
33958
33978
|
domainSearch,
|
|
33959
33979
|
evalJSONContext,
|
|
33960
|
-
clearSearch
|
|
33980
|
+
clearSearch,
|
|
33981
|
+
groupByList
|
|
33961
33982
|
}
|
|
33962
33983
|
) }),
|
|
33963
33984
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
@@ -33977,7 +33998,7 @@ var Many2ManyField = (props) => {
|
|
|
33977
33998
|
}
|
|
33978
33999
|
)
|
|
33979
34000
|
] }),
|
|
33980
|
-
!
|
|
34001
|
+
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "relative h-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
33981
34002
|
"div",
|
|
33982
34003
|
{
|
|
33983
34004
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -34090,12 +34111,12 @@ var Many2ManyField = (props) => {
|
|
|
34090
34111
|
};
|
|
34091
34112
|
|
|
34092
34113
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34093
|
-
var
|
|
34114
|
+
var import_react64 = __toESM(require("react"));
|
|
34094
34115
|
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
34095
34116
|
var CustomMenuList = (props) => {
|
|
34096
34117
|
const { options: options2, children, selectProps } = props;
|
|
34097
34118
|
const { setIsShowModalMany2Many, searchable } = selectProps;
|
|
34098
|
-
const limitedChildren =
|
|
34119
|
+
const limitedChildren = import_react64.default.Children.toArray(children).slice(0, 10);
|
|
34099
34120
|
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(components.MenuList, { ...props, className: "z-[99]", children: [
|
|
34100
34121
|
limitedChildren,
|
|
34101
34122
|
options2?.length > 0 && (options2?.length > 10 || searchable) && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
@@ -34139,7 +34160,7 @@ var Many2OneField = (props) => {
|
|
|
34139
34160
|
setInputValue,
|
|
34140
34161
|
setDomainObject
|
|
34141
34162
|
} = props;
|
|
34142
|
-
const actionId = (0,
|
|
34163
|
+
const actionId = (0, import_react64.useMemo)(
|
|
34143
34164
|
() => menuList?.flatMap(
|
|
34144
34165
|
(item) => item?.child_id.filter(
|
|
34145
34166
|
(childItem) => childItem?.is_display && childItem?.action?.res_model === relation
|
|
@@ -34196,7 +34217,7 @@ var Many2OneField = (props) => {
|
|
|
34196
34217
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34197
34218
|
(option) => option.value === tempSelectedOption?.value
|
|
34198
34219
|
) : currentValue ? currentValue : null;
|
|
34199
|
-
(0,
|
|
34220
|
+
(0, import_react64.useEffect)(() => {
|
|
34200
34221
|
if (error2 && selectedOption) {
|
|
34201
34222
|
methods?.clearErrors(name2);
|
|
34202
34223
|
}
|
|
@@ -34379,11 +34400,11 @@ var StatusbarDurationField = (props) => {
|
|
|
34379
34400
|
};
|
|
34380
34401
|
|
|
34381
34402
|
// src/widgets/basic/status-bar-field/option/option.tsx
|
|
34382
|
-
var
|
|
34403
|
+
var import_react65 = require("react");
|
|
34383
34404
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
34384
34405
|
var StatusBarOptionField = (props) => {
|
|
34385
34406
|
const { selection, defaultValue } = props;
|
|
34386
|
-
const memoizedStatusOptions = (0,
|
|
34407
|
+
const memoizedStatusOptions = (0, import_react65.useMemo)(() => selection, [selection]);
|
|
34387
34408
|
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
34388
34409
|
"div",
|
|
34389
34410
|
{
|
package/dist/widgets.mjs
CHANGED
|
@@ -33789,43 +33789,48 @@ var StatusDropdownField = (props) => {
|
|
|
33789
33789
|
|
|
33790
33790
|
// src/widgets/basic/many2many-field/many2many.tsx
|
|
33791
33791
|
import { createPortal as createPortal5 } from "react-dom";
|
|
33792
|
+
import { useEffect as useEffect24 } from "react";
|
|
33792
33793
|
import { jsx as jsx103, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
33793
33794
|
var Many2ManyField = (props) => {
|
|
33794
33795
|
const {
|
|
33795
33796
|
aid,
|
|
33796
33797
|
title,
|
|
33797
33798
|
onClose,
|
|
33798
|
-
page,
|
|
33799
|
-
rows,
|
|
33800
|
-
columns,
|
|
33801
33799
|
renderField,
|
|
33802
|
-
isDataLoading,
|
|
33803
33800
|
relation,
|
|
33804
|
-
onToggleColumnOptional,
|
|
33805
|
-
isDataFetched,
|
|
33806
|
-
isPlaceholderData,
|
|
33807
|
-
optionsObject,
|
|
33808
33801
|
onChoose,
|
|
33809
33802
|
onAddNew,
|
|
33810
|
-
selectedRowKeys,
|
|
33811
|
-
handleCreateNewOnPage,
|
|
33812
33803
|
rootField,
|
|
33804
|
+
isDisplayCheckbox,
|
|
33813
33805
|
onAddRow,
|
|
33814
33806
|
onClickRow,
|
|
33815
|
-
totalRows,
|
|
33816
|
-
setPage,
|
|
33817
33807
|
evalJSONContext,
|
|
33818
|
-
searchController,
|
|
33819
33808
|
tableGroupController,
|
|
33820
|
-
|
|
33821
|
-
|
|
33822
|
-
isDisplayCheckbox,
|
|
33823
|
-
checkedAll,
|
|
33824
|
-
handleCheckBoxAll,
|
|
33825
|
-
selectedRowKeysRef,
|
|
33826
|
-
typeTable,
|
|
33827
|
-
setSelectedRowKeys
|
|
33809
|
+
many2manyController,
|
|
33810
|
+
tableHeadController
|
|
33828
33811
|
} = props;
|
|
33812
|
+
const {
|
|
33813
|
+
handleCreateNewOnPage,
|
|
33814
|
+
optionsObject,
|
|
33815
|
+
rows,
|
|
33816
|
+
columns,
|
|
33817
|
+
typeTable,
|
|
33818
|
+
isLoading,
|
|
33819
|
+
isFetched,
|
|
33820
|
+
isPlaceholderData,
|
|
33821
|
+
setPage,
|
|
33822
|
+
page,
|
|
33823
|
+
totalRows,
|
|
33824
|
+
onToggleColumnOptional,
|
|
33825
|
+
searchController,
|
|
33826
|
+
setDomain,
|
|
33827
|
+
viewData,
|
|
33828
|
+
groupByList,
|
|
33829
|
+
setGroupByList,
|
|
33830
|
+
selectedRowKeys,
|
|
33831
|
+
setSelectedRowKeys,
|
|
33832
|
+
setPageLimit
|
|
33833
|
+
} = many2manyController;
|
|
33829
33834
|
const {
|
|
33830
33835
|
context,
|
|
33831
33836
|
domain: domainSearch,
|
|
@@ -33841,6 +33846,21 @@ var Many2ManyField = (props) => {
|
|
|
33841
33846
|
setGroupBy,
|
|
33842
33847
|
clearSearch
|
|
33843
33848
|
} = searchController;
|
|
33849
|
+
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
33850
|
+
useEffect24(() => {
|
|
33851
|
+
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
33852
|
+
if (groupItems?.length > 0) {
|
|
33853
|
+
typeof setPageLimit === "function" && setPageLimit(80);
|
|
33854
|
+
} else {
|
|
33855
|
+
typeof setPageLimit === "function" && setPageLimit(10);
|
|
33856
|
+
}
|
|
33857
|
+
if (groupItems?.[0]) {
|
|
33858
|
+
typeof setGroupByList === "function" && setGroupByList(groupItems?.[0]);
|
|
33859
|
+
}
|
|
33860
|
+
return () => {
|
|
33861
|
+
typeof setGroupByList === "function" && setGroupByList(null);
|
|
33862
|
+
};
|
|
33863
|
+
}, [selectedTags]);
|
|
33844
33864
|
return createPortal5(
|
|
33845
33865
|
/* @__PURE__ */ jsxs71(
|
|
33846
33866
|
"div",
|
|
@@ -33894,7 +33914,8 @@ var Many2ManyField = (props) => {
|
|
|
33894
33914
|
aid,
|
|
33895
33915
|
domainSearch,
|
|
33896
33916
|
evalJSONContext,
|
|
33897
|
-
clearSearch
|
|
33917
|
+
clearSearch,
|
|
33918
|
+
groupByList
|
|
33898
33919
|
}
|
|
33899
33920
|
) }),
|
|
33900
33921
|
/* @__PURE__ */ jsx103(
|
|
@@ -33914,7 +33935,7 @@ var Many2ManyField = (props) => {
|
|
|
33914
33935
|
}
|
|
33915
33936
|
)
|
|
33916
33937
|
] }),
|
|
33917
|
-
!
|
|
33938
|
+
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ jsx103("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx103("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx103(
|
|
33918
33939
|
"div",
|
|
33919
33940
|
{
|
|
33920
33941
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -34027,7 +34048,7 @@ var Many2ManyField = (props) => {
|
|
|
34027
34048
|
};
|
|
34028
34049
|
|
|
34029
34050
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34030
|
-
import React17, { useEffect as
|
|
34051
|
+
import React17, { useEffect as useEffect25, useMemo as useMemo9 } from "react";
|
|
34031
34052
|
import { Fragment as Fragment30, jsx as jsx104, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
34032
34053
|
var CustomMenuList = (props) => {
|
|
34033
34054
|
const { options: options2, children, selectProps } = props;
|
|
@@ -34133,7 +34154,7 @@ var Many2OneField = (props) => {
|
|
|
34133
34154
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34134
34155
|
(option) => option.value === tempSelectedOption?.value
|
|
34135
34156
|
) : currentValue ? currentValue : null;
|
|
34136
|
-
|
|
34157
|
+
useEffect25(() => {
|
|
34137
34158
|
if (error2 && selectedOption) {
|
|
34138
34159
|
methods?.clearErrors(name2);
|
|
34139
34160
|
}
|