@fctc/sme-widget-ui 1.3.4 → 1.3.6
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 +55 -31
- package/dist/index.mjs +51 -27
- package/dist/widgets.d.mts +3 -20
- package/dist/widgets.d.ts +3 -20
- package/dist/widgets.js +55 -31
- package/dist/widgets.mjs +51 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34226,43 +34226,49 @@ 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
|
+
specification
|
|
34271
|
+
} = many2manyController;
|
|
34266
34272
|
const {
|
|
34267
34273
|
context,
|
|
34268
34274
|
domain: domainSearch,
|
|
@@ -34278,6 +34284,21 @@ var Many2ManyField = (props) => {
|
|
|
34278
34284
|
setGroupBy,
|
|
34279
34285
|
clearSearch
|
|
34280
34286
|
} = searchController;
|
|
34287
|
+
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
34288
|
+
(0, import_react63.useEffect)(() => {
|
|
34289
|
+
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
34290
|
+
if (groupItems?.length > 0) {
|
|
34291
|
+
typeof setPageLimit === "function" && setPageLimit(80);
|
|
34292
|
+
} else {
|
|
34293
|
+
typeof setPageLimit === "function" && setPageLimit(10);
|
|
34294
|
+
}
|
|
34295
|
+
if (groupItems?.[0]) {
|
|
34296
|
+
typeof setGroupByList === "function" && setGroupByList(groupItems?.[0]);
|
|
34297
|
+
}
|
|
34298
|
+
return () => {
|
|
34299
|
+
typeof setGroupByList === "function" && setGroupByList(null);
|
|
34300
|
+
};
|
|
34301
|
+
}, [selectedTags]);
|
|
34281
34302
|
return (0, import_react_dom8.createPortal)(
|
|
34282
34303
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
34283
34304
|
"div",
|
|
@@ -34300,7 +34321,7 @@ var Many2ManyField = (props) => {
|
|
|
34300
34321
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
|
|
34301
34322
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(CloseIcon, {}) })
|
|
34302
34323
|
] }),
|
|
34303
|
-
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "grid grid-cols-
|
|
34324
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
|
|
34304
34325
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
34305
34326
|
Search,
|
|
34306
34327
|
{
|
|
@@ -34331,7 +34352,8 @@ var Many2ManyField = (props) => {
|
|
|
34331
34352
|
aid,
|
|
34332
34353
|
domainSearch,
|
|
34333
34354
|
evalJSONContext,
|
|
34334
|
-
clearSearch
|
|
34355
|
+
clearSearch,
|
|
34356
|
+
groupByList
|
|
34335
34357
|
}
|
|
34336
34358
|
) }),
|
|
34337
34359
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
@@ -34351,7 +34373,7 @@ var Many2ManyField = (props) => {
|
|
|
34351
34373
|
}
|
|
34352
34374
|
)
|
|
34353
34375
|
] }),
|
|
34354
|
-
!
|
|
34376
|
+
!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
34377
|
"div",
|
|
34356
34378
|
{
|
|
34357
34379
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -34406,7 +34428,9 @@ var Many2ManyField = (props) => {
|
|
|
34406
34428
|
typeTable,
|
|
34407
34429
|
selectedRowKeysRef,
|
|
34408
34430
|
selectedRowKeys,
|
|
34409
|
-
setSelectedRowKeys
|
|
34431
|
+
setSelectedRowKeys,
|
|
34432
|
+
groupByList,
|
|
34433
|
+
specification
|
|
34410
34434
|
}
|
|
34411
34435
|
)
|
|
34412
34436
|
]
|
|
@@ -34464,12 +34488,12 @@ var Many2ManyField = (props) => {
|
|
|
34464
34488
|
};
|
|
34465
34489
|
|
|
34466
34490
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34467
|
-
var
|
|
34491
|
+
var import_react64 = __toESM(require("react"));
|
|
34468
34492
|
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
34469
34493
|
var CustomMenuList = (props) => {
|
|
34470
34494
|
const { options: options2, children, selectProps } = props;
|
|
34471
34495
|
const { setIsShowModalMany2Many, searchable } = selectProps;
|
|
34472
|
-
const limitedChildren =
|
|
34496
|
+
const limitedChildren = import_react64.default.Children.toArray(children).slice(0, 10);
|
|
34473
34497
|
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(components.MenuList, { ...props, className: "z-[99]", children: [
|
|
34474
34498
|
limitedChildren,
|
|
34475
34499
|
options2?.length > 0 && (options2?.length > 10 || searchable) && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
@@ -34513,7 +34537,7 @@ var Many2OneField = (props) => {
|
|
|
34513
34537
|
setInputValue,
|
|
34514
34538
|
setDomainObject
|
|
34515
34539
|
} = props;
|
|
34516
|
-
const actionId = (0,
|
|
34540
|
+
const actionId = (0, import_react64.useMemo)(
|
|
34517
34541
|
() => menuList?.flatMap(
|
|
34518
34542
|
(item) => item?.child_id.filter(
|
|
34519
34543
|
(childItem) => childItem?.is_display && childItem?.action?.res_model === relation
|
|
@@ -34570,7 +34594,7 @@ var Many2OneField = (props) => {
|
|
|
34570
34594
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34571
34595
|
(option) => option.value === tempSelectedOption?.value
|
|
34572
34596
|
) : currentValue ? currentValue : null;
|
|
34573
|
-
(0,
|
|
34597
|
+
(0, import_react64.useEffect)(() => {
|
|
34574
34598
|
if (error2 && selectedOption) {
|
|
34575
34599
|
methods?.clearErrors(name2);
|
|
34576
34600
|
}
|
|
@@ -34753,11 +34777,11 @@ var StatusbarDurationField = (props) => {
|
|
|
34753
34777
|
};
|
|
34754
34778
|
|
|
34755
34779
|
// src/widgets/basic/status-bar-field/option/option.tsx
|
|
34756
|
-
var
|
|
34780
|
+
var import_react65 = require("react");
|
|
34757
34781
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
34758
34782
|
var StatusBarOptionField = (props) => {
|
|
34759
34783
|
const { selection, defaultValue } = props;
|
|
34760
|
-
const memoizedStatusOptions = (0,
|
|
34784
|
+
const memoizedStatusOptions = (0, import_react65.useMemo)(() => selection, [selection]);
|
|
34761
34785
|
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
34762
34786
|
"div",
|
|
34763
34787
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -34107,43 +34107,49 @@ 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
|
+
specification
|
|
34152
|
+
} = many2manyController;
|
|
34147
34153
|
const {
|
|
34148
34154
|
context,
|
|
34149
34155
|
domain: domainSearch,
|
|
@@ -34159,6 +34165,21 @@ var Many2ManyField = (props) => {
|
|
|
34159
34165
|
setGroupBy,
|
|
34160
34166
|
clearSearch
|
|
34161
34167
|
} = searchController;
|
|
34168
|
+
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
34169
|
+
useEffect24(() => {
|
|
34170
|
+
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
34171
|
+
if (groupItems?.length > 0) {
|
|
34172
|
+
typeof setPageLimit === "function" && setPageLimit(80);
|
|
34173
|
+
} else {
|
|
34174
|
+
typeof setPageLimit === "function" && setPageLimit(10);
|
|
34175
|
+
}
|
|
34176
|
+
if (groupItems?.[0]) {
|
|
34177
|
+
typeof setGroupByList === "function" && setGroupByList(groupItems?.[0]);
|
|
34178
|
+
}
|
|
34179
|
+
return () => {
|
|
34180
|
+
typeof setGroupByList === "function" && setGroupByList(null);
|
|
34181
|
+
};
|
|
34182
|
+
}, [selectedTags]);
|
|
34162
34183
|
return createPortal5(
|
|
34163
34184
|
/* @__PURE__ */ jsxs71(
|
|
34164
34185
|
"div",
|
|
@@ -34181,7 +34202,7 @@ var Many2ManyField = (props) => {
|
|
|
34181
34202
|
/* @__PURE__ */ jsx103("div", { className: "text-[20px] font-semibold", children: title }),
|
|
34182
34203
|
/* @__PURE__ */ jsx103("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx103(CloseIcon, {}) })
|
|
34183
34204
|
] }),
|
|
34184
|
-
/* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-
|
|
34205
|
+
/* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
|
|
34185
34206
|
/* @__PURE__ */ jsx103("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx103(
|
|
34186
34207
|
Search,
|
|
34187
34208
|
{
|
|
@@ -34212,7 +34233,8 @@ var Many2ManyField = (props) => {
|
|
|
34212
34233
|
aid,
|
|
34213
34234
|
domainSearch,
|
|
34214
34235
|
evalJSONContext,
|
|
34215
|
-
clearSearch
|
|
34236
|
+
clearSearch,
|
|
34237
|
+
groupByList
|
|
34216
34238
|
}
|
|
34217
34239
|
) }),
|
|
34218
34240
|
/* @__PURE__ */ jsx103(
|
|
@@ -34232,7 +34254,7 @@ var Many2ManyField = (props) => {
|
|
|
34232
34254
|
}
|
|
34233
34255
|
)
|
|
34234
34256
|
] }),
|
|
34235
|
-
!
|
|
34257
|
+
!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
34258
|
"div",
|
|
34237
34259
|
{
|
|
34238
34260
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -34287,7 +34309,9 @@ var Many2ManyField = (props) => {
|
|
|
34287
34309
|
typeTable,
|
|
34288
34310
|
selectedRowKeysRef,
|
|
34289
34311
|
selectedRowKeys,
|
|
34290
|
-
setSelectedRowKeys
|
|
34312
|
+
setSelectedRowKeys,
|
|
34313
|
+
groupByList,
|
|
34314
|
+
specification
|
|
34291
34315
|
}
|
|
34292
34316
|
)
|
|
34293
34317
|
]
|
|
@@ -34345,7 +34369,7 @@ var Many2ManyField = (props) => {
|
|
|
34345
34369
|
};
|
|
34346
34370
|
|
|
34347
34371
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34348
|
-
import React17, { useEffect as
|
|
34372
|
+
import React17, { useEffect as useEffect25, useMemo as useMemo9 } from "react";
|
|
34349
34373
|
import { Fragment as Fragment30, jsx as jsx104, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
34350
34374
|
var CustomMenuList = (props) => {
|
|
34351
34375
|
const { options: options2, children, selectProps } = props;
|
|
@@ -34451,7 +34475,7 @@ var Many2OneField = (props) => {
|
|
|
34451
34475
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34452
34476
|
(option) => option.value === tempSelectedOption?.value
|
|
34453
34477
|
) : currentValue ? currentValue : null;
|
|
34454
|
-
|
|
34478
|
+
useEffect25(() => {
|
|
34455
34479
|
if (error2 && selectedOption) {
|
|
34456
34480
|
methods?.clearErrors(name2);
|
|
34457
34481
|
}
|
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,49 @@ 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
|
+
specification
|
|
33897
|
+
} = many2manyController;
|
|
33892
33898
|
const {
|
|
33893
33899
|
context,
|
|
33894
33900
|
domain: domainSearch,
|
|
@@ -33904,6 +33910,21 @@ var Many2ManyField = (props) => {
|
|
|
33904
33910
|
setGroupBy,
|
|
33905
33911
|
clearSearch
|
|
33906
33912
|
} = searchController;
|
|
33913
|
+
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
33914
|
+
(0, import_react63.useEffect)(() => {
|
|
33915
|
+
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
33916
|
+
if (groupItems?.length > 0) {
|
|
33917
|
+
typeof setPageLimit === "function" && setPageLimit(80);
|
|
33918
|
+
} else {
|
|
33919
|
+
typeof setPageLimit === "function" && setPageLimit(10);
|
|
33920
|
+
}
|
|
33921
|
+
if (groupItems?.[0]) {
|
|
33922
|
+
typeof setGroupByList === "function" && setGroupByList(groupItems?.[0]);
|
|
33923
|
+
}
|
|
33924
|
+
return () => {
|
|
33925
|
+
typeof setGroupByList === "function" && setGroupByList(null);
|
|
33926
|
+
};
|
|
33927
|
+
}, [selectedTags]);
|
|
33907
33928
|
return (0, import_react_dom8.createPortal)(
|
|
33908
33929
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
33909
33930
|
"div",
|
|
@@ -33926,7 +33947,7 @@ var Many2ManyField = (props) => {
|
|
|
33926
33947
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
|
|
33927
33948
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(CloseIcon, {}) })
|
|
33928
33949
|
] }),
|
|
33929
|
-
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "grid grid-cols-
|
|
33950
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
|
|
33930
33951
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
33931
33952
|
Search,
|
|
33932
33953
|
{
|
|
@@ -33957,7 +33978,8 @@ var Many2ManyField = (props) => {
|
|
|
33957
33978
|
aid,
|
|
33958
33979
|
domainSearch,
|
|
33959
33980
|
evalJSONContext,
|
|
33960
|
-
clearSearch
|
|
33981
|
+
clearSearch,
|
|
33982
|
+
groupByList
|
|
33961
33983
|
}
|
|
33962
33984
|
) }),
|
|
33963
33985
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
@@ -33977,7 +33999,7 @@ var Many2ManyField = (props) => {
|
|
|
33977
33999
|
}
|
|
33978
34000
|
)
|
|
33979
34001
|
] }),
|
|
33980
|
-
!
|
|
34002
|
+
!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
34003
|
"div",
|
|
33982
34004
|
{
|
|
33983
34005
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -34032,7 +34054,9 @@ var Many2ManyField = (props) => {
|
|
|
34032
34054
|
typeTable,
|
|
34033
34055
|
selectedRowKeysRef,
|
|
34034
34056
|
selectedRowKeys,
|
|
34035
|
-
setSelectedRowKeys
|
|
34057
|
+
setSelectedRowKeys,
|
|
34058
|
+
groupByList,
|
|
34059
|
+
specification
|
|
34036
34060
|
}
|
|
34037
34061
|
)
|
|
34038
34062
|
]
|
|
@@ -34090,12 +34114,12 @@ var Many2ManyField = (props) => {
|
|
|
34090
34114
|
};
|
|
34091
34115
|
|
|
34092
34116
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34093
|
-
var
|
|
34117
|
+
var import_react64 = __toESM(require("react"));
|
|
34094
34118
|
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
34095
34119
|
var CustomMenuList = (props) => {
|
|
34096
34120
|
const { options: options2, children, selectProps } = props;
|
|
34097
34121
|
const { setIsShowModalMany2Many, searchable } = selectProps;
|
|
34098
|
-
const limitedChildren =
|
|
34122
|
+
const limitedChildren = import_react64.default.Children.toArray(children).slice(0, 10);
|
|
34099
34123
|
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(components.MenuList, { ...props, className: "z-[99]", children: [
|
|
34100
34124
|
limitedChildren,
|
|
34101
34125
|
options2?.length > 0 && (options2?.length > 10 || searchable) && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
@@ -34139,7 +34163,7 @@ var Many2OneField = (props) => {
|
|
|
34139
34163
|
setInputValue,
|
|
34140
34164
|
setDomainObject
|
|
34141
34165
|
} = props;
|
|
34142
|
-
const actionId = (0,
|
|
34166
|
+
const actionId = (0, import_react64.useMemo)(
|
|
34143
34167
|
() => menuList?.flatMap(
|
|
34144
34168
|
(item) => item?.child_id.filter(
|
|
34145
34169
|
(childItem) => childItem?.is_display && childItem?.action?.res_model === relation
|
|
@@ -34196,7 +34220,7 @@ var Many2OneField = (props) => {
|
|
|
34196
34220
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34197
34221
|
(option) => option.value === tempSelectedOption?.value
|
|
34198
34222
|
) : currentValue ? currentValue : null;
|
|
34199
|
-
(0,
|
|
34223
|
+
(0, import_react64.useEffect)(() => {
|
|
34200
34224
|
if (error2 && selectedOption) {
|
|
34201
34225
|
methods?.clearErrors(name2);
|
|
34202
34226
|
}
|
|
@@ -34379,11 +34403,11 @@ var StatusbarDurationField = (props) => {
|
|
|
34379
34403
|
};
|
|
34380
34404
|
|
|
34381
34405
|
// src/widgets/basic/status-bar-field/option/option.tsx
|
|
34382
|
-
var
|
|
34406
|
+
var import_react65 = require("react");
|
|
34383
34407
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
34384
34408
|
var StatusBarOptionField = (props) => {
|
|
34385
34409
|
const { selection, defaultValue } = props;
|
|
34386
|
-
const memoizedStatusOptions = (0,
|
|
34410
|
+
const memoizedStatusOptions = (0, import_react65.useMemo)(() => selection, [selection]);
|
|
34387
34411
|
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
34388
34412
|
"div",
|
|
34389
34413
|
{
|
package/dist/widgets.mjs
CHANGED
|
@@ -33789,43 +33789,49 @@ 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
|
+
specification
|
|
33834
|
+
} = many2manyController;
|
|
33829
33835
|
const {
|
|
33830
33836
|
context,
|
|
33831
33837
|
domain: domainSearch,
|
|
@@ -33841,6 +33847,21 @@ var Many2ManyField = (props) => {
|
|
|
33841
33847
|
setGroupBy,
|
|
33842
33848
|
clearSearch
|
|
33843
33849
|
} = searchController;
|
|
33850
|
+
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
33851
|
+
useEffect24(() => {
|
|
33852
|
+
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
33853
|
+
if (groupItems?.length > 0) {
|
|
33854
|
+
typeof setPageLimit === "function" && setPageLimit(80);
|
|
33855
|
+
} else {
|
|
33856
|
+
typeof setPageLimit === "function" && setPageLimit(10);
|
|
33857
|
+
}
|
|
33858
|
+
if (groupItems?.[0]) {
|
|
33859
|
+
typeof setGroupByList === "function" && setGroupByList(groupItems?.[0]);
|
|
33860
|
+
}
|
|
33861
|
+
return () => {
|
|
33862
|
+
typeof setGroupByList === "function" && setGroupByList(null);
|
|
33863
|
+
};
|
|
33864
|
+
}, [selectedTags]);
|
|
33844
33865
|
return createPortal5(
|
|
33845
33866
|
/* @__PURE__ */ jsxs71(
|
|
33846
33867
|
"div",
|
|
@@ -33863,7 +33884,7 @@ var Many2ManyField = (props) => {
|
|
|
33863
33884
|
/* @__PURE__ */ jsx103("div", { className: "text-[20px] font-semibold", children: title }),
|
|
33864
33885
|
/* @__PURE__ */ jsx103("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx103(CloseIcon, {}) })
|
|
33865
33886
|
] }),
|
|
33866
|
-
/* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-
|
|
33887
|
+
/* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
|
|
33867
33888
|
/* @__PURE__ */ jsx103("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx103(
|
|
33868
33889
|
Search,
|
|
33869
33890
|
{
|
|
@@ -33894,7 +33915,8 @@ var Many2ManyField = (props) => {
|
|
|
33894
33915
|
aid,
|
|
33895
33916
|
domainSearch,
|
|
33896
33917
|
evalJSONContext,
|
|
33897
|
-
clearSearch
|
|
33918
|
+
clearSearch,
|
|
33919
|
+
groupByList
|
|
33898
33920
|
}
|
|
33899
33921
|
) }),
|
|
33900
33922
|
/* @__PURE__ */ jsx103(
|
|
@@ -33914,7 +33936,7 @@ var Many2ManyField = (props) => {
|
|
|
33914
33936
|
}
|
|
33915
33937
|
)
|
|
33916
33938
|
] }),
|
|
33917
|
-
!
|
|
33939
|
+
!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
33940
|
"div",
|
|
33919
33941
|
{
|
|
33920
33942
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -33969,7 +33991,9 @@ var Many2ManyField = (props) => {
|
|
|
33969
33991
|
typeTable,
|
|
33970
33992
|
selectedRowKeysRef,
|
|
33971
33993
|
selectedRowKeys,
|
|
33972
|
-
setSelectedRowKeys
|
|
33994
|
+
setSelectedRowKeys,
|
|
33995
|
+
groupByList,
|
|
33996
|
+
specification
|
|
33973
33997
|
}
|
|
33974
33998
|
)
|
|
33975
33999
|
]
|
|
@@ -34027,7 +34051,7 @@ var Many2ManyField = (props) => {
|
|
|
34027
34051
|
};
|
|
34028
34052
|
|
|
34029
34053
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34030
|
-
import React17, { useEffect as
|
|
34054
|
+
import React17, { useEffect as useEffect25, useMemo as useMemo9 } from "react";
|
|
34031
34055
|
import { Fragment as Fragment30, jsx as jsx104, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
34032
34056
|
var CustomMenuList = (props) => {
|
|
34033
34057
|
const { options: options2, children, selectProps } = props;
|
|
@@ -34133,7 +34157,7 @@ var Many2OneField = (props) => {
|
|
|
34133
34157
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34134
34158
|
(option) => option.value === tempSelectedOption?.value
|
|
34135
34159
|
) : currentValue ? currentValue : null;
|
|
34136
|
-
|
|
34160
|
+
useEffect25(() => {
|
|
34137
34161
|
if (error2 && selectedOption) {
|
|
34138
34162
|
methods?.clearErrors(name2);
|
|
34139
34163
|
}
|