@fctc/sme-widget-ui 1.3.3 → 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/README.md +93 -93
- package/dist/index.js +53 -30
- package/dist/index.mjs +49 -26
- package/dist/widgets.d.mts +4 -20
- package/dist/widgets.d.ts +4 -20
- package/dist/widgets.js +53 -30
- package/dist/widgets.mjs +49 -26
- package/package.json +71 -71
- package/dist/.babelrc +0 -7
- package/dist/.editorconfig +0 -10
- package/dist/.eslintignore +0 -6
- package/dist/.eslintrc.cjs +0 -66
- package/dist/.gitattributes +0 -4
- package/dist/.prettierrc +0 -4
package/README.md
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
# edu-widget-ui
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Getting started
|
|
6
|
-
|
|
7
|
-
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
|
8
|
-
|
|
9
|
-
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
|
10
|
-
|
|
11
|
-
## Add your files
|
|
12
|
-
|
|
13
|
-
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
|
14
|
-
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
cd existing_repo
|
|
18
|
-
git remote add origin https://gitlab.atomsolution.vn/education-erp/edu-widget-ui.git
|
|
19
|
-
git branch -M main
|
|
20
|
-
git push -uf origin main
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Integrate with your tools
|
|
24
|
-
|
|
25
|
-
- [ ] [Set up project integrations](https://gitlab.atomsolution.vn/education-erp/edu-widget-ui/-/settings/integrations)
|
|
26
|
-
|
|
27
|
-
## Collaborate with your team
|
|
28
|
-
|
|
29
|
-
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
|
30
|
-
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
|
31
|
-
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
|
32
|
-
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
|
33
|
-
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
|
34
|
-
|
|
35
|
-
## Test and Deploy
|
|
36
|
-
|
|
37
|
-
Use the built-in continuous integration in GitLab.
|
|
38
|
-
|
|
39
|
-
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
|
40
|
-
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
|
41
|
-
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
|
42
|
-
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
|
43
|
-
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
|
44
|
-
|
|
45
|
-
***
|
|
46
|
-
|
|
47
|
-
# Editing this README
|
|
48
|
-
|
|
49
|
-
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
|
50
|
-
|
|
51
|
-
## Suggestions for a good README
|
|
52
|
-
|
|
53
|
-
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
|
54
|
-
|
|
55
|
-
## Name
|
|
56
|
-
Choose a self-explaining name for your project.
|
|
57
|
-
|
|
58
|
-
## Description
|
|
59
|
-
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
|
60
|
-
|
|
61
|
-
## Badges
|
|
62
|
-
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
|
63
|
-
|
|
64
|
-
## Visuals
|
|
65
|
-
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
|
66
|
-
|
|
67
|
-
## Installation
|
|
68
|
-
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
|
69
|
-
|
|
70
|
-
## Usage
|
|
71
|
-
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
|
72
|
-
|
|
73
|
-
## Support
|
|
74
|
-
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
|
75
|
-
|
|
76
|
-
## Roadmap
|
|
77
|
-
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
|
78
|
-
|
|
79
|
-
## Contributing
|
|
80
|
-
State if you are open to contributions and what your requirements are for accepting them.
|
|
81
|
-
|
|
82
|
-
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
|
83
|
-
|
|
84
|
-
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
|
85
|
-
|
|
86
|
-
## Authors and acknowledgment
|
|
87
|
-
Show your appreciation to those who have contributed to the project.
|
|
88
|
-
|
|
89
|
-
## License
|
|
90
|
-
For open source projects, say how it is licensed.
|
|
91
|
-
|
|
92
|
-
## Project status
|
|
93
|
-
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
|
1
|
+
# edu-widget-ui
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
|
8
|
+
|
|
9
|
+
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
|
10
|
+
|
|
11
|
+
## Add your files
|
|
12
|
+
|
|
13
|
+
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
|
14
|
+
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
cd existing_repo
|
|
18
|
+
git remote add origin https://gitlab.atomsolution.vn/education-erp/edu-widget-ui.git
|
|
19
|
+
git branch -M main
|
|
20
|
+
git push -uf origin main
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Integrate with your tools
|
|
24
|
+
|
|
25
|
+
- [ ] [Set up project integrations](https://gitlab.atomsolution.vn/education-erp/edu-widget-ui/-/settings/integrations)
|
|
26
|
+
|
|
27
|
+
## Collaborate with your team
|
|
28
|
+
|
|
29
|
+
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
|
30
|
+
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
|
31
|
+
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
|
32
|
+
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
|
33
|
+
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
|
34
|
+
|
|
35
|
+
## Test and Deploy
|
|
36
|
+
|
|
37
|
+
Use the built-in continuous integration in GitLab.
|
|
38
|
+
|
|
39
|
+
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
|
40
|
+
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
|
41
|
+
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
|
42
|
+
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
|
43
|
+
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
# Editing this README
|
|
48
|
+
|
|
49
|
+
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
|
50
|
+
|
|
51
|
+
## Suggestions for a good README
|
|
52
|
+
|
|
53
|
+
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
|
54
|
+
|
|
55
|
+
## Name
|
|
56
|
+
Choose a self-explaining name for your project.
|
|
57
|
+
|
|
58
|
+
## Description
|
|
59
|
+
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
|
60
|
+
|
|
61
|
+
## Badges
|
|
62
|
+
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
|
63
|
+
|
|
64
|
+
## Visuals
|
|
65
|
+
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
|
69
|
+
|
|
70
|
+
## Usage
|
|
71
|
+
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
|
72
|
+
|
|
73
|
+
## Support
|
|
74
|
+
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
|
75
|
+
|
|
76
|
+
## Roadmap
|
|
77
|
+
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
|
78
|
+
|
|
79
|
+
## Contributing
|
|
80
|
+
State if you are open to contributions and what your requirements are for accepting them.
|
|
81
|
+
|
|
82
|
+
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
|
83
|
+
|
|
84
|
+
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
|
85
|
+
|
|
86
|
+
## Authors and acknowledgment
|
|
87
|
+
Show your appreciation to those who have contributed to the project.
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
For open source projects, say how it is licensed.
|
|
91
|
+
|
|
92
|
+
## Project status
|
|
93
|
+
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
package/dist/index.js
CHANGED
|
@@ -34226,42 +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,
|
|
34245
|
+
tableGroupController,
|
|
34246
|
+
many2manyController,
|
|
34247
|
+
tableHeadController
|
|
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,
|
|
34255
34262
|
searchController,
|
|
34256
|
-
viewData,
|
|
34257
34263
|
setDomain,
|
|
34258
|
-
|
|
34259
|
-
|
|
34260
|
-
|
|
34261
|
-
|
|
34262
|
-
|
|
34263
|
-
|
|
34264
|
-
} =
|
|
34264
|
+
viewData,
|
|
34265
|
+
groupByList,
|
|
34266
|
+
setGroupByList,
|
|
34267
|
+
selectedRowKeys,
|
|
34268
|
+
setSelectedRowKeys,
|
|
34269
|
+
setPageLimit
|
|
34270
|
+
} = many2manyController;
|
|
34265
34271
|
const {
|
|
34266
34272
|
context,
|
|
34267
34273
|
domain: domainSearch,
|
|
@@ -34277,12 +34283,27 @@ var Many2ManyField = (props) => {
|
|
|
34277
34283
|
setGroupBy,
|
|
34278
34284
|
clearSearch
|
|
34279
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]);
|
|
34280
34301
|
return (0, import_react_dom8.createPortal)(
|
|
34281
34302
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
34282
34303
|
"div",
|
|
34283
34304
|
{
|
|
34284
34305
|
style: {
|
|
34285
|
-
zIndex:
|
|
34306
|
+
zIndex: 999
|
|
34286
34307
|
},
|
|
34287
34308
|
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
34288
34309
|
children: [
|
|
@@ -34330,7 +34351,8 @@ var Many2ManyField = (props) => {
|
|
|
34330
34351
|
aid,
|
|
34331
34352
|
domainSearch,
|
|
34332
34353
|
evalJSONContext,
|
|
34333
|
-
clearSearch
|
|
34354
|
+
clearSearch,
|
|
34355
|
+
groupByList
|
|
34334
34356
|
}
|
|
34335
34357
|
) }),
|
|
34336
34358
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
@@ -34350,7 +34372,7 @@ var Many2ManyField = (props) => {
|
|
|
34350
34372
|
}
|
|
34351
34373
|
)
|
|
34352
34374
|
] }),
|
|
34353
|
-
!
|
|
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)(
|
|
34354
34376
|
"div",
|
|
34355
34377
|
{
|
|
34356
34378
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -34376,6 +34398,7 @@ var Many2ManyField = (props) => {
|
|
|
34376
34398
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
34377
34399
|
TableBody,
|
|
34378
34400
|
{
|
|
34401
|
+
tableGroupController,
|
|
34379
34402
|
columns,
|
|
34380
34403
|
rows,
|
|
34381
34404
|
rootField,
|
|
@@ -34462,12 +34485,12 @@ var Many2ManyField = (props) => {
|
|
|
34462
34485
|
};
|
|
34463
34486
|
|
|
34464
34487
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34465
|
-
var
|
|
34488
|
+
var import_react64 = __toESM(require("react"));
|
|
34466
34489
|
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
34467
34490
|
var CustomMenuList = (props) => {
|
|
34468
34491
|
const { options: options2, children, selectProps } = props;
|
|
34469
34492
|
const { setIsShowModalMany2Many, searchable } = selectProps;
|
|
34470
|
-
const limitedChildren =
|
|
34493
|
+
const limitedChildren = import_react64.default.Children.toArray(children).slice(0, 10);
|
|
34471
34494
|
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(components.MenuList, { ...props, className: "z-[99]", children: [
|
|
34472
34495
|
limitedChildren,
|
|
34473
34496
|
options2?.length > 0 && (options2?.length > 10 || searchable) && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
@@ -34511,7 +34534,7 @@ var Many2OneField = (props) => {
|
|
|
34511
34534
|
setInputValue,
|
|
34512
34535
|
setDomainObject
|
|
34513
34536
|
} = props;
|
|
34514
|
-
const actionId = (0,
|
|
34537
|
+
const actionId = (0, import_react64.useMemo)(
|
|
34515
34538
|
() => menuList?.flatMap(
|
|
34516
34539
|
(item) => item?.child_id.filter(
|
|
34517
34540
|
(childItem) => childItem?.is_display && childItem?.action?.res_model === relation
|
|
@@ -34568,7 +34591,7 @@ var Many2OneField = (props) => {
|
|
|
34568
34591
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34569
34592
|
(option) => option.value === tempSelectedOption?.value
|
|
34570
34593
|
) : currentValue ? currentValue : null;
|
|
34571
|
-
(0,
|
|
34594
|
+
(0, import_react64.useEffect)(() => {
|
|
34572
34595
|
if (error2 && selectedOption) {
|
|
34573
34596
|
methods?.clearErrors(name2);
|
|
34574
34597
|
}
|
|
@@ -34582,7 +34605,7 @@ var Many2OneField = (props) => {
|
|
|
34582
34605
|
classNames: {
|
|
34583
34606
|
control: ({ isFocused }) => `w-full flex h-full ring-0 cursor-pointer outline-0 bg-white shadow-none rounded-[10px] py-2 px-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isForm && (isFocused ? "border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]")} ${readonly && "!cursor-not-allowed"} ${isEditTable && "md:!min-w-[300px] max-w-[300px] !rounded-none !border !border-transparent !border-b !border-[#f7f7f7] hover:border-b-primary !bg-transparent min-h-auto"}`,
|
|
34584
34607
|
valueContainer: () => "!m-0 !p-0 ",
|
|
34585
|
-
singleValue: () => `!m-0
|
|
34608
|
+
singleValue: () => `!m-0`,
|
|
34586
34609
|
input: () => "!m-0 !p-0",
|
|
34587
34610
|
dropdownIndicator: () => `${isEditTable ? "invisible group-hover:visible" : ""} !m-0 !p-0`,
|
|
34588
34611
|
clearIndicator: () => `${isEditTable ? "invisible group-hover:visible !m-0 !p-0" : ""} `,
|
|
@@ -34751,11 +34774,11 @@ var StatusbarDurationField = (props) => {
|
|
|
34751
34774
|
};
|
|
34752
34775
|
|
|
34753
34776
|
// src/widgets/basic/status-bar-field/option/option.tsx
|
|
34754
|
-
var
|
|
34777
|
+
var import_react65 = require("react");
|
|
34755
34778
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
34756
34779
|
var StatusBarOptionField = (props) => {
|
|
34757
34780
|
const { selection, defaultValue } = props;
|
|
34758
|
-
const memoizedStatusOptions = (0,
|
|
34781
|
+
const memoizedStatusOptions = (0, import_react65.useMemo)(() => selection, [selection]);
|
|
34759
34782
|
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
34760
34783
|
"div",
|
|
34761
34784
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -34107,42 +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,
|
|
34126
|
+
tableGroupController,
|
|
34127
|
+
many2manyController,
|
|
34128
|
+
tableHeadController
|
|
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,
|
|
34136
34143
|
searchController,
|
|
34137
|
-
viewData,
|
|
34138
34144
|
setDomain,
|
|
34139
|
-
|
|
34140
|
-
|
|
34141
|
-
|
|
34142
|
-
|
|
34143
|
-
|
|
34144
|
-
|
|
34145
|
-
} =
|
|
34145
|
+
viewData,
|
|
34146
|
+
groupByList,
|
|
34147
|
+
setGroupByList,
|
|
34148
|
+
selectedRowKeys,
|
|
34149
|
+
setSelectedRowKeys,
|
|
34150
|
+
setPageLimit
|
|
34151
|
+
} = many2manyController;
|
|
34146
34152
|
const {
|
|
34147
34153
|
context,
|
|
34148
34154
|
domain: domainSearch,
|
|
@@ -34158,12 +34164,27 @@ var Many2ManyField = (props) => {
|
|
|
34158
34164
|
setGroupBy,
|
|
34159
34165
|
clearSearch
|
|
34160
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]);
|
|
34161
34182
|
return createPortal5(
|
|
34162
34183
|
/* @__PURE__ */ jsxs71(
|
|
34163
34184
|
"div",
|
|
34164
34185
|
{
|
|
34165
34186
|
style: {
|
|
34166
|
-
zIndex:
|
|
34187
|
+
zIndex: 999
|
|
34167
34188
|
},
|
|
34168
34189
|
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
34169
34190
|
children: [
|
|
@@ -34211,7 +34232,8 @@ var Many2ManyField = (props) => {
|
|
|
34211
34232
|
aid,
|
|
34212
34233
|
domainSearch,
|
|
34213
34234
|
evalJSONContext,
|
|
34214
|
-
clearSearch
|
|
34235
|
+
clearSearch,
|
|
34236
|
+
groupByList
|
|
34215
34237
|
}
|
|
34216
34238
|
) }),
|
|
34217
34239
|
/* @__PURE__ */ jsx103(
|
|
@@ -34231,7 +34253,7 @@ var Many2ManyField = (props) => {
|
|
|
34231
34253
|
}
|
|
34232
34254
|
)
|
|
34233
34255
|
] }),
|
|
34234
|
-
!
|
|
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(
|
|
34235
34257
|
"div",
|
|
34236
34258
|
{
|
|
34237
34259
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -34257,6 +34279,7 @@ var Many2ManyField = (props) => {
|
|
|
34257
34279
|
/* @__PURE__ */ jsx103(
|
|
34258
34280
|
TableBody,
|
|
34259
34281
|
{
|
|
34282
|
+
tableGroupController,
|
|
34260
34283
|
columns,
|
|
34261
34284
|
rows,
|
|
34262
34285
|
rootField,
|
|
@@ -34343,7 +34366,7 @@ var Many2ManyField = (props) => {
|
|
|
34343
34366
|
};
|
|
34344
34367
|
|
|
34345
34368
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34346
|
-
import React17, { useEffect as
|
|
34369
|
+
import React17, { useEffect as useEffect25, useMemo as useMemo9 } from "react";
|
|
34347
34370
|
import { Fragment as Fragment30, jsx as jsx104, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
34348
34371
|
var CustomMenuList = (props) => {
|
|
34349
34372
|
const { options: options2, children, selectProps } = props;
|
|
@@ -34449,7 +34472,7 @@ var Many2OneField = (props) => {
|
|
|
34449
34472
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34450
34473
|
(option) => option.value === tempSelectedOption?.value
|
|
34451
34474
|
) : currentValue ? currentValue : null;
|
|
34452
|
-
|
|
34475
|
+
useEffect25(() => {
|
|
34453
34476
|
if (error2 && selectedOption) {
|
|
34454
34477
|
methods?.clearErrors(name2);
|
|
34455
34478
|
}
|
|
@@ -34463,7 +34486,7 @@ var Many2OneField = (props) => {
|
|
|
34463
34486
|
classNames: {
|
|
34464
34487
|
control: ({ isFocused }) => `w-full flex h-full ring-0 cursor-pointer outline-0 bg-white shadow-none rounded-[10px] py-2 px-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isForm && (isFocused ? "border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]")} ${readonly && "!cursor-not-allowed"} ${isEditTable && "md:!min-w-[300px] max-w-[300px] !rounded-none !border !border-transparent !border-b !border-[#f7f7f7] hover:border-b-primary !bg-transparent min-h-auto"}`,
|
|
34465
34488
|
valueContainer: () => "!m-0 !p-0 ",
|
|
34466
|
-
singleValue: () => `!m-0
|
|
34489
|
+
singleValue: () => `!m-0`,
|
|
34467
34490
|
input: () => "!m-0 !p-0",
|
|
34468
34491
|
dropdownIndicator: () => `${isEditTable ? "invisible group-hover:visible" : ""} !m-0 !p-0`,
|
|
34469
34492
|
clearIndicator: () => `${isEditTable ? "invisible group-hover:visible !m-0 !p-0" : ""} `,
|
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,13 +407,11 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
421
407
|
onChangeData: any;
|
|
422
408
|
rootField: any;
|
|
423
409
|
}) => {};
|
|
424
|
-
setPage?: (page: number) => void;
|
|
425
|
-
setDomain?: Dispatch<SetStateAction<any>>;
|
|
426
|
-
searchController: SearchController;
|
|
427
410
|
evalJSONContext?: any;
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
411
|
+
searchController: SearchController;
|
|
412
|
+
tableGroupController: (props: TableGroupControllerProps) => TableGroupControllerReturn;
|
|
413
|
+
many2manyController?: any;
|
|
414
|
+
tableHeadController?: any;
|
|
431
415
|
}
|
|
432
416
|
|
|
433
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,13 +407,11 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
421
407
|
onChangeData: any;
|
|
422
408
|
rootField: any;
|
|
423
409
|
}) => {};
|
|
424
|
-
setPage?: (page: number) => void;
|
|
425
|
-
setDomain?: Dispatch<SetStateAction<any>>;
|
|
426
|
-
searchController: SearchController;
|
|
427
410
|
evalJSONContext?: any;
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
411
|
+
searchController: SearchController;
|
|
412
|
+
tableGroupController: (props: TableGroupControllerProps) => TableGroupControllerReturn;
|
|
413
|
+
many2manyController?: any;
|
|
414
|
+
tableHeadController?: any;
|
|
431
415
|
}
|
|
432
416
|
|
|
433
417
|
declare const Many2ManyField: (props: Many2ManyProps) => React$1.ReactPortal;
|
package/dist/widgets.js
CHANGED
|
@@ -33852,42 +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,
|
|
33871
|
+
tableGroupController,
|
|
33872
|
+
many2manyController,
|
|
33873
|
+
tableHeadController
|
|
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,
|
|
33881
33888
|
searchController,
|
|
33882
|
-
viewData,
|
|
33883
33889
|
setDomain,
|
|
33884
|
-
|
|
33885
|
-
|
|
33886
|
-
|
|
33887
|
-
|
|
33888
|
-
|
|
33889
|
-
|
|
33890
|
-
} =
|
|
33890
|
+
viewData,
|
|
33891
|
+
groupByList,
|
|
33892
|
+
setGroupByList,
|
|
33893
|
+
selectedRowKeys,
|
|
33894
|
+
setSelectedRowKeys,
|
|
33895
|
+
setPageLimit
|
|
33896
|
+
} = many2manyController;
|
|
33891
33897
|
const {
|
|
33892
33898
|
context,
|
|
33893
33899
|
domain: domainSearch,
|
|
@@ -33903,12 +33909,27 @@ var Many2ManyField = (props) => {
|
|
|
33903
33909
|
setGroupBy,
|
|
33904
33910
|
clearSearch
|
|
33905
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]);
|
|
33906
33927
|
return (0, import_react_dom8.createPortal)(
|
|
33907
33928
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
33908
33929
|
"div",
|
|
33909
33930
|
{
|
|
33910
33931
|
style: {
|
|
33911
|
-
zIndex:
|
|
33932
|
+
zIndex: 999
|
|
33912
33933
|
},
|
|
33913
33934
|
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
33914
33935
|
children: [
|
|
@@ -33956,7 +33977,8 @@ var Many2ManyField = (props) => {
|
|
|
33956
33977
|
aid,
|
|
33957
33978
|
domainSearch,
|
|
33958
33979
|
evalJSONContext,
|
|
33959
|
-
clearSearch
|
|
33980
|
+
clearSearch,
|
|
33981
|
+
groupByList
|
|
33960
33982
|
}
|
|
33961
33983
|
) }),
|
|
33962
33984
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
@@ -33976,7 +33998,7 @@ var Many2ManyField = (props) => {
|
|
|
33976
33998
|
}
|
|
33977
33999
|
)
|
|
33978
34000
|
] }),
|
|
33979
|
-
!
|
|
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)(
|
|
33980
34002
|
"div",
|
|
33981
34003
|
{
|
|
33982
34004
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -34002,6 +34024,7 @@ var Many2ManyField = (props) => {
|
|
|
34002
34024
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
34003
34025
|
TableBody,
|
|
34004
34026
|
{
|
|
34027
|
+
tableGroupController,
|
|
34005
34028
|
columns,
|
|
34006
34029
|
rows,
|
|
34007
34030
|
rootField,
|
|
@@ -34088,12 +34111,12 @@ var Many2ManyField = (props) => {
|
|
|
34088
34111
|
};
|
|
34089
34112
|
|
|
34090
34113
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34091
|
-
var
|
|
34114
|
+
var import_react64 = __toESM(require("react"));
|
|
34092
34115
|
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
34093
34116
|
var CustomMenuList = (props) => {
|
|
34094
34117
|
const { options: options2, children, selectProps } = props;
|
|
34095
34118
|
const { setIsShowModalMany2Many, searchable } = selectProps;
|
|
34096
|
-
const limitedChildren =
|
|
34119
|
+
const limitedChildren = import_react64.default.Children.toArray(children).slice(0, 10);
|
|
34097
34120
|
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(components.MenuList, { ...props, className: "z-[99]", children: [
|
|
34098
34121
|
limitedChildren,
|
|
34099
34122
|
options2?.length > 0 && (options2?.length > 10 || searchable) && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
@@ -34137,7 +34160,7 @@ var Many2OneField = (props) => {
|
|
|
34137
34160
|
setInputValue,
|
|
34138
34161
|
setDomainObject
|
|
34139
34162
|
} = props;
|
|
34140
|
-
const actionId = (0,
|
|
34163
|
+
const actionId = (0, import_react64.useMemo)(
|
|
34141
34164
|
() => menuList?.flatMap(
|
|
34142
34165
|
(item) => item?.child_id.filter(
|
|
34143
34166
|
(childItem) => childItem?.is_display && childItem?.action?.res_model === relation
|
|
@@ -34194,7 +34217,7 @@ var Many2OneField = (props) => {
|
|
|
34194
34217
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34195
34218
|
(option) => option.value === tempSelectedOption?.value
|
|
34196
34219
|
) : currentValue ? currentValue : null;
|
|
34197
|
-
(0,
|
|
34220
|
+
(0, import_react64.useEffect)(() => {
|
|
34198
34221
|
if (error2 && selectedOption) {
|
|
34199
34222
|
methods?.clearErrors(name2);
|
|
34200
34223
|
}
|
|
@@ -34208,7 +34231,7 @@ var Many2OneField = (props) => {
|
|
|
34208
34231
|
classNames: {
|
|
34209
34232
|
control: ({ isFocused }) => `w-full flex h-full ring-0 cursor-pointer outline-0 bg-white shadow-none rounded-[10px] py-2 px-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isForm && (isFocused ? "border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]")} ${readonly && "!cursor-not-allowed"} ${isEditTable && "md:!min-w-[300px] max-w-[300px] !rounded-none !border !border-transparent !border-b !border-[#f7f7f7] hover:border-b-primary !bg-transparent min-h-auto"}`,
|
|
34210
34233
|
valueContainer: () => "!m-0 !p-0 ",
|
|
34211
|
-
singleValue: () => `!m-0
|
|
34234
|
+
singleValue: () => `!m-0`,
|
|
34212
34235
|
input: () => "!m-0 !p-0",
|
|
34213
34236
|
dropdownIndicator: () => `${isEditTable ? "invisible group-hover:visible" : ""} !m-0 !p-0`,
|
|
34214
34237
|
clearIndicator: () => `${isEditTable ? "invisible group-hover:visible !m-0 !p-0" : ""} `,
|
|
@@ -34377,11 +34400,11 @@ var StatusbarDurationField = (props) => {
|
|
|
34377
34400
|
};
|
|
34378
34401
|
|
|
34379
34402
|
// src/widgets/basic/status-bar-field/option/option.tsx
|
|
34380
|
-
var
|
|
34403
|
+
var import_react65 = require("react");
|
|
34381
34404
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
34382
34405
|
var StatusBarOptionField = (props) => {
|
|
34383
34406
|
const { selection, defaultValue } = props;
|
|
34384
|
-
const memoizedStatusOptions = (0,
|
|
34407
|
+
const memoizedStatusOptions = (0, import_react65.useMemo)(() => selection, [selection]);
|
|
34385
34408
|
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
34386
34409
|
"div",
|
|
34387
34410
|
{
|
package/dist/widgets.mjs
CHANGED
|
@@ -33789,42 +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,
|
|
33808
|
+
tableGroupController,
|
|
33809
|
+
many2manyController,
|
|
33810
|
+
tableHeadController
|
|
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,
|
|
33818
33825
|
searchController,
|
|
33819
|
-
viewData,
|
|
33820
33826
|
setDomain,
|
|
33821
|
-
|
|
33822
|
-
|
|
33823
|
-
|
|
33824
|
-
|
|
33825
|
-
|
|
33826
|
-
|
|
33827
|
-
} =
|
|
33827
|
+
viewData,
|
|
33828
|
+
groupByList,
|
|
33829
|
+
setGroupByList,
|
|
33830
|
+
selectedRowKeys,
|
|
33831
|
+
setSelectedRowKeys,
|
|
33832
|
+
setPageLimit
|
|
33833
|
+
} = many2manyController;
|
|
33828
33834
|
const {
|
|
33829
33835
|
context,
|
|
33830
33836
|
domain: domainSearch,
|
|
@@ -33840,12 +33846,27 @@ var Many2ManyField = (props) => {
|
|
|
33840
33846
|
setGroupBy,
|
|
33841
33847
|
clearSearch
|
|
33842
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]);
|
|
33843
33864
|
return createPortal5(
|
|
33844
33865
|
/* @__PURE__ */ jsxs71(
|
|
33845
33866
|
"div",
|
|
33846
33867
|
{
|
|
33847
33868
|
style: {
|
|
33848
|
-
zIndex:
|
|
33869
|
+
zIndex: 999
|
|
33849
33870
|
},
|
|
33850
33871
|
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
33851
33872
|
children: [
|
|
@@ -33893,7 +33914,8 @@ var Many2ManyField = (props) => {
|
|
|
33893
33914
|
aid,
|
|
33894
33915
|
domainSearch,
|
|
33895
33916
|
evalJSONContext,
|
|
33896
|
-
clearSearch
|
|
33917
|
+
clearSearch,
|
|
33918
|
+
groupByList
|
|
33897
33919
|
}
|
|
33898
33920
|
) }),
|
|
33899
33921
|
/* @__PURE__ */ jsx103(
|
|
@@ -33913,7 +33935,7 @@ var Many2ManyField = (props) => {
|
|
|
33913
33935
|
}
|
|
33914
33936
|
)
|
|
33915
33937
|
] }),
|
|
33916
|
-
!
|
|
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(
|
|
33917
33939
|
"div",
|
|
33918
33940
|
{
|
|
33919
33941
|
className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
@@ -33939,6 +33961,7 @@ var Many2ManyField = (props) => {
|
|
|
33939
33961
|
/* @__PURE__ */ jsx103(
|
|
33940
33962
|
TableBody,
|
|
33941
33963
|
{
|
|
33964
|
+
tableGroupController,
|
|
33942
33965
|
columns,
|
|
33943
33966
|
rows,
|
|
33944
33967
|
rootField,
|
|
@@ -34025,7 +34048,7 @@ var Many2ManyField = (props) => {
|
|
|
34025
34048
|
};
|
|
34026
34049
|
|
|
34027
34050
|
// src/widgets/basic/many2one-field/many2one.tsx
|
|
34028
|
-
import React17, { useEffect as
|
|
34051
|
+
import React17, { useEffect as useEffect25, useMemo as useMemo9 } from "react";
|
|
34029
34052
|
import { Fragment as Fragment30, jsx as jsx104, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
34030
34053
|
var CustomMenuList = (props) => {
|
|
34031
34054
|
const { options: options2, children, selectProps } = props;
|
|
@@ -34131,7 +34154,7 @@ var Many2OneField = (props) => {
|
|
|
34131
34154
|
const selectedOption = tempSelectedOption && options2?.length > 0 ? options2.find(
|
|
34132
34155
|
(option) => option.value === tempSelectedOption?.value
|
|
34133
34156
|
) : currentValue ? currentValue : null;
|
|
34134
|
-
|
|
34157
|
+
useEffect25(() => {
|
|
34135
34158
|
if (error2 && selectedOption) {
|
|
34136
34159
|
methods?.clearErrors(name2);
|
|
34137
34160
|
}
|
|
@@ -34145,7 +34168,7 @@ var Many2OneField = (props) => {
|
|
|
34145
34168
|
classNames: {
|
|
34146
34169
|
control: ({ isFocused }) => `w-full flex h-full ring-0 cursor-pointer outline-0 bg-white shadow-none rounded-[10px] py-2 px-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isForm && (isFocused ? "border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]")} ${readonly && "!cursor-not-allowed"} ${isEditTable && "md:!min-w-[300px] max-w-[300px] !rounded-none !border !border-transparent !border-b !border-[#f7f7f7] hover:border-b-primary !bg-transparent min-h-auto"}`,
|
|
34147
34170
|
valueContainer: () => "!m-0 !p-0 ",
|
|
34148
|
-
singleValue: () => `!m-0
|
|
34171
|
+
singleValue: () => `!m-0`,
|
|
34149
34172
|
input: () => "!m-0 !p-0",
|
|
34150
34173
|
dropdownIndicator: () => `${isEditTable ? "invisible group-hover:visible" : ""} !m-0 !p-0`,
|
|
34151
34174
|
clearIndicator: () => `${isEditTable ? "invisible group-hover:visible !m-0 !p-0" : ""} `,
|
package/package.json
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@fctc/sme-widget-ui",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"main": "dist/index.cjs",
|
|
5
|
-
"module": "dist/index.mjs",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"import": "./dist/index.mjs",
|
|
11
|
-
"require": "./dist/index.cjs"
|
|
12
|
-
},
|
|
13
|
-
"./hooks": {
|
|
14
|
-
"types": "./dist/hooks.d.ts",
|
|
15
|
-
"import": "./dist/hooks.mjs",
|
|
16
|
-
"require": "./dist/hooks.cjs"
|
|
17
|
-
},
|
|
18
|
-
"./icons": {
|
|
19
|
-
"types": "./dist/icons.d.ts",
|
|
20
|
-
"import": "./dist/icons.mjs",
|
|
21
|
-
"require": "./dist/icons.cjs"
|
|
22
|
-
},
|
|
23
|
-
"./types": {
|
|
24
|
-
"types": "./dist/types.d.ts",
|
|
25
|
-
"import": "./dist/types.mjs",
|
|
26
|
-
"require": "./dist/types.cjs"
|
|
27
|
-
},
|
|
28
|
-
"./widgets": {
|
|
29
|
-
"types": "./dist/widgets.d.ts",
|
|
30
|
-
"import": "./dist/widgets.mjs",
|
|
31
|
-
"require": "./dist/widgets.cjs"
|
|
32
|
-
},
|
|
33
|
-
"./utils": {
|
|
34
|
-
"types": "./dist/utils.d.ts",
|
|
35
|
-
"import": "./dist/utils.mjs",
|
|
36
|
-
"require": "./dist/utils.cjs"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"files": [
|
|
40
|
-
"dist"
|
|
41
|
-
],
|
|
42
|
-
"scripts": {
|
|
43
|
-
"build": "tsup",
|
|
44
|
-
"test": "jest"
|
|
45
|
-
},
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"@headlessui/react": "^2.2.7",
|
|
48
|
-
"@types/react-dom": "^19.1.7",
|
|
49
|
-
"react-dom": "18.0.0",
|
|
50
|
-
"zod": "^3.24.2"
|
|
51
|
-
},
|
|
52
|
-
"devDependencies": {
|
|
53
|
-
"@hookform/resolvers": "^4.1.3",
|
|
54
|
-
"@types/react": "18.0.0",
|
|
55
|
-
"i18next": "^24.2.3",
|
|
56
|
-
"i18next-browser-languagedetector": "^8.0.4",
|
|
57
|
-
"jest": "^29.7.0",
|
|
58
|
-
"moment": "^2.30.1",
|
|
59
|
-
"react": "18.0.0",
|
|
60
|
-
"react-datepicker": "^8.2.1",
|
|
61
|
-
"react-hook-form": "^7.54.2",
|
|
62
|
-
"react-i18next": "^15.4.1",
|
|
63
|
-
"react-redux": "^9.2.0",
|
|
64
|
-
"react-select": "^5.10.1",
|
|
65
|
-
"react-toastify": "^11.0.5",
|
|
66
|
-
"react-tooltip": "^5.28.0",
|
|
67
|
-
"tailwindcss": "^3",
|
|
68
|
-
"tsup": "^8.0.0",
|
|
69
|
-
"typescript": "^5.8.2"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@fctc/sme-widget-ui",
|
|
3
|
+
"version": "1.3.5",
|
|
4
|
+
"main": "dist/index.cjs",
|
|
5
|
+
"module": "dist/index.mjs",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.cjs"
|
|
12
|
+
},
|
|
13
|
+
"./hooks": {
|
|
14
|
+
"types": "./dist/hooks.d.ts",
|
|
15
|
+
"import": "./dist/hooks.mjs",
|
|
16
|
+
"require": "./dist/hooks.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./icons": {
|
|
19
|
+
"types": "./dist/icons.d.ts",
|
|
20
|
+
"import": "./dist/icons.mjs",
|
|
21
|
+
"require": "./dist/icons.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./types": {
|
|
24
|
+
"types": "./dist/types.d.ts",
|
|
25
|
+
"import": "./dist/types.mjs",
|
|
26
|
+
"require": "./dist/types.cjs"
|
|
27
|
+
},
|
|
28
|
+
"./widgets": {
|
|
29
|
+
"types": "./dist/widgets.d.ts",
|
|
30
|
+
"import": "./dist/widgets.mjs",
|
|
31
|
+
"require": "./dist/widgets.cjs"
|
|
32
|
+
},
|
|
33
|
+
"./utils": {
|
|
34
|
+
"types": "./dist/utils.d.ts",
|
|
35
|
+
"import": "./dist/utils.mjs",
|
|
36
|
+
"require": "./dist/utils.cjs"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsup",
|
|
44
|
+
"test": "jest"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@headlessui/react": "^2.2.7",
|
|
48
|
+
"@types/react-dom": "^19.1.7",
|
|
49
|
+
"react-dom": "18.0.0",
|
|
50
|
+
"zod": "^3.24.2"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@hookform/resolvers": "^4.1.3",
|
|
54
|
+
"@types/react": "18.0.0",
|
|
55
|
+
"i18next": "^24.2.3",
|
|
56
|
+
"i18next-browser-languagedetector": "^8.0.4",
|
|
57
|
+
"jest": "^29.7.0",
|
|
58
|
+
"moment": "^2.30.1",
|
|
59
|
+
"react": "18.0.0",
|
|
60
|
+
"react-datepicker": "^8.2.1",
|
|
61
|
+
"react-hook-form": "^7.54.2",
|
|
62
|
+
"react-i18next": "^15.4.1",
|
|
63
|
+
"react-redux": "^9.2.0",
|
|
64
|
+
"react-select": "^5.10.1",
|
|
65
|
+
"react-toastify": "^11.0.5",
|
|
66
|
+
"react-tooltip": "^5.28.0",
|
|
67
|
+
"tailwindcss": "^3",
|
|
68
|
+
"tsup": "^8.0.0",
|
|
69
|
+
"typescript": "^5.8.2"
|
|
70
|
+
}
|
|
71
|
+
}
|
package/dist/.babelrc
DELETED
package/dist/.editorconfig
DELETED
package/dist/.eslintignore
DELETED
package/dist/.eslintrc.cjs
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: { browser: true, es2020: true },
|
|
4
|
-
extends: [
|
|
5
|
-
'eslint:recommended',
|
|
6
|
-
'plugin:@typescript-eslint/recommended',
|
|
7
|
-
'plugin:prettier/recommended',
|
|
8
|
-
],
|
|
9
|
-
ignorePatterns: ['dist', '.eslintrc.cjs', 'commitlint.config.cjs'],
|
|
10
|
-
parser: '@typescript-eslint/parser',
|
|
11
|
-
overrides: [
|
|
12
|
-
{
|
|
13
|
-
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx', '**/*.cjs'],
|
|
14
|
-
plugins: [
|
|
15
|
-
'@typescript-eslint',
|
|
16
|
-
'unused-imports',
|
|
17
|
-
'simple-import-sort',
|
|
18
|
-
'react-refresh',
|
|
19
|
-
],
|
|
20
|
-
rules: {
|
|
21
|
-
'react-refresh/only-export-components': [
|
|
22
|
-
'warn',
|
|
23
|
-
{ allowConstantExport: true },
|
|
24
|
-
],
|
|
25
|
-
'import/prefer-default-export': 'off',
|
|
26
|
-
'simple-import-sort/imports': [
|
|
27
|
-
'error',
|
|
28
|
-
{
|
|
29
|
-
groups: [
|
|
30
|
-
// Packages `react` related packages come first.
|
|
31
|
-
['^react', '^@?\\w'],
|
|
32
|
-
// Internal packages.
|
|
33
|
-
['^(@|components)(/.*|$)'],
|
|
34
|
-
// Side effect imports.
|
|
35
|
-
['^\\u0000'],
|
|
36
|
-
// Parent imports. Put `..` last.
|
|
37
|
-
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
|
38
|
-
// Other relative imports. Put same-folder imports and `.` last.
|
|
39
|
-
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
|
40
|
-
// Style imports.
|
|
41
|
-
['^.+\\.?(css)$'],
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
'prettier/prettier': [
|
|
46
|
-
'error',
|
|
47
|
-
{
|
|
48
|
-
endOfLine: 'auto',
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
'react/react-in-jsx-scope': 'off',
|
|
52
|
-
'no-param-reassign': 'off',
|
|
53
|
-
'simple-import-sort/exports': 'error',
|
|
54
|
-
'@typescript-eslint/no-unused-vars': 'off',
|
|
55
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
56
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
57
|
-
'@typescript-eslint/ban-ts-comment': 'off',
|
|
58
|
-
'@typescript-eslint/ban-types': 'off',
|
|
59
|
-
'unused-imports/no-unused-imports': 'error',
|
|
60
|
-
'unused-imports/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
61
|
-
'no-plusplus': 'off',
|
|
62
|
-
'no-case-declarations': 'off',
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
}
|
package/dist/.gitattributes
DELETED
package/dist/.prettierrc
DELETED