triafly-ui-kit 1.0.98 → 1.0.100

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 CHANGED
@@ -1,93 +1,93 @@
1
- # ui-kit
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://git.3afly.ru/triafly-data-platform/ui-kit.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://git.3afly.ru/triafly-data-platform/ui-kit/-/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
+ # ui-kit
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://git.3afly.ru/triafly-data-platform/ui-kit.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://git.3afly.ru/triafly-data-platform/ui-kit/-/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.
@@ -0,0 +1 @@
1
+ .dropdown-search-input-container{position:relative;width:100%;display:flex;flex-direction:column;gap:8px;min-width:200px}.dropdown-search-input{display:flex;justify-content:space-between;align-items:center;padding:10.5px 8px;background-color:var(--color-bg-neutral-basic-default);border:1px solid var(--color-border-primary-default);border-radius:8px;cursor:pointer;min-height:40px;flex-direction:row}.dropdown-search-input:hover{box-shadow:inset 0 0 0 1px var(--color-border-primary-default)}.dropdown-search-input:focus{outline:none;border-color:var(--color-text-brand-default)}.dropdown-search-input--expanded{box-shadow:inset 0 0 0 1px var(--color-border-primary-default)}.dropdown-search-input--disabled{background-color:var(--color-bg-island-disabled);cursor:not-allowed;opacity:.5}.dropdown-search-input--error{border-color:var(--color-border-error-default)}.dropdown-search-input__value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-search-input__indicators{display:flex;align-items:center;gap:8px}.dropdown-search-input__clear{background:none;border:none;font-size:18px;cursor:pointer;color:var(--color-border-primary-default);padding:0;width:20px;height:20px;display:flex;align-items:center;justify-content:center}.dropdown-search-input__clear:hover{color:#333}.dropdown-search-input__caret{color:var(--color-border-primary-default);width:16px;height:16px}.dropdown-search-input-suggestions-portal{border:1px solid var(--color-border-primary-default);border-radius:8px;box-shadow:0 0 10px -2px var(--effectseffect-shadow-XL);padding:8px;background-color:var(--color-bg-neutral-basic-default);margin-top:-1px}.dropdown-search-input-suggestions-portal .text-input.clearable input{padding-right:0!important}.dropdown-search-input-suggestions-portal__input-search{width:100%}.dropdown-search-input-suggestions-list{list-style:none;margin:0;padding:0;max-height:250px;overflow-y:auto}.dropdown-search-input-suggestions-list__item{padding:8px;cursor:pointer;border-radius:6px}.dropdown-search-input-suggestions-list__item:hover{background-color:var(--color-bg-neutral-lightest-default)}.dropdown-search-input-suggestions-list__item:last-child{border-bottom:none}.dropdown-search-input-suggestions-list__item--selected{font-weight:600}.dropdown-search-input-suggestions-list__empty{padding:16px;text-align:center;color:var(--color-text-secondary-default);font-style:italic;cursor:default}.dropdown-search-input-suggestions-list__empty:hover{background-color:transparent;cursor:default}.dropdown-search-input__error-message{color:var(--color-text-error-default);font-size:12px;margin-top:4px}
@@ -1 +1 @@
1
- .search-input{border:1px solid var(--color-border-primary-default);border-radius:22px;margin:0 12px 0 0}.search-input:focus-within{border:2px solid var(--color-border-primary-default);margin:0 11px 0 -1px}.search-input:focus-within .text-input .input-container input{margin:-1px}.search-input .text-input .input-container input{border:none}.search-input .text-input .input-container input:focus{outline:none}.search-input__label{margin:0 0 8px}.search-input .guess-box{padding:0 12px 12px}.search-input .guess-box ul{border-top:1px solid var(--color-border-primary-default);padding:12px 0 0}.search-input .guess-box ul li{min-height:36px;display:flex;align-items:center;padding:0 8px;cursor:pointer}.search-input .guess-box ul li:hover{background-color:var(--color-bg-innerisland-default)}.dropdown-input-test{position:relative}.dropdown-input-test .caret{display:none;fill:var(--color-icon-secondary-default);position:absolute;bottom:9px;right:10px}.dropdown-input-test .input-box{position:relative;cursor:pointer;display:flex;justify-content:space-between;align-items:center;outline:none;background-color:var(--color-bg-neutral-basic-default)}.dropdown-input-test .input-box.disabled{background-color:var(--color-bg-island-disabled);pointer-events:none}.dropdown-input-test .input-box.invalid{border-color:var(--color-border-error-default)}.dropdown-input-test .input-box.invalid>span{color:var(--color-border-error-default)}.dropdown-input-test .input-box.invalid svg *{fill:var(--color-border-error-default)}.dropdown-input-test .input-box .placeholder{color:var(--color-text-secondary-default)}.search-input-container{position:relative;display:inline-block;width:100%}.search-input-container .caret{position:absolute;right:10px;top:50%;transform:translateY(-50%);cursor:pointer;z-index:1;fill:var(--color-icon-secondary-default)}.suggestions-portal{background-color:var(--color-bg-neutral-basic-default);border-radius:8px;border:1px solid var(--color-border-primary-default);box-shadow:0 2px 8px #00000026;overflow-y:auto}.suggestions-portal .suggestions-list{list-style:none;padding:0;margin:0}.suggestions-portal .suggestions-list li{padding:8px 12px;min-height:36px;cursor:pointer;display:flex;align-items:center;overflow-wrap:anywhere}.suggestions-portal .suggestions-list li:hover{background-color:var(--color-bg-neutral-lightest-default)}
1
+ .search-input{border:1px solid var(--color-border-primary-default);border-radius:22px;margin:0 12px 0 0}.search-input:focus-within{border:2px solid var(--color-border-primary-default);margin:0 11px 0 -1px}.search-input:focus-within .text-input .input-container input{margin:-1px}.search-input .text-input .input-container input{border:none}.search-input .text-input .input-container input:focus{outline:none}.search-input__label{margin:0 0 8px}.search-input .guess-box{padding:0 12px 12px}.search-input .guess-box ul{border-top:1px solid var(--color-border-primary-default);padding:12px 0 0}.search-input .guess-box ul li{min-height:36px;display:flex;align-items:center;padding:0 8px;cursor:pointer}.search-input .guess-box ul li:hover{background-color:var(--color-bg-innerisland-default)}.dropdown-input-test{position:relative}.dropdown-input-test .caret{display:none;fill:var(--color-icon-secondary-default);position:absolute;bottom:9px;right:10px}.dropdown-input-test .input-box{position:relative;cursor:pointer;display:flex;justify-content:space-between;align-items:center;outline:none;background-color:var(--color-bg-neutral-basic-default)}.dropdown-input-test .input-box.disabled{background-color:var(--color-bg-island-disabled);pointer-events:none}.dropdown-input-test .input-box.invalid{border-color:var(--color-border-error-default)}.dropdown-input-test .input-box.invalid>span{color:var(--color-border-error-default)}.dropdown-input-test .input-box.invalid svg *{fill:var(--color-border-error-default)}.dropdown-input-test .input-box .placeholder{color:var(--color-text-secondary-default)}.search-input-container{position:relative;display:inline-block;width:100%}.search-input-container .caret{display:none;position:absolute;right:10px;top:50%;transform:translateY(-50%);cursor:pointer;z-index:1;fill:var(--color-icon-secondary-default)}.suggestions-portal{background-color:var(--color-bg-neutral-basic-default);border-radius:8px;border:1px solid var(--color-border-primary-default);box-shadow:0 2px 8px #00000026;overflow-y:auto}.suggestions-portal .suggestions-list{list-style:none;padding:0;margin:0}.suggestions-portal .suggestions-list li{padding:8px 12px;min-height:36px;cursor:pointer;display:flex;align-items:center;overflow-wrap:anywhere}.suggestions-portal .suggestions-list li:hover{background-color:var(--color-bg-neutral-lightest-default)}
@@ -1 +1 @@
1
- ._container_x4z3a_1{position:relative;width:100%;height:100vh;padding:20px;display:flex;flex-wrap:wrap;justify-content:space-between;align-content:space-between;border:1px dashed #ccc;box-sizing:border-box}._trigger_x4z3a_27{padding:8px 16px;background-color:#1976d2;color:#fff;border-radius:4px;font-size:14px;cursor:pointer;transition:background-color .2s;text-align:center}._trigger_x4z3a_27:hover{background-color:#1565c0}._clickTrigger_x4z3a_57{background-color:#388e3c}._clickTrigger_x4z3a_57:hover{background-color:#2e7d32}._positionsContainer_x4z3a_75{padding:20px}._positionGroup_x4z3a_83{display:flex;gap:20px;margin-bottom:30px;justify-content:center;flex-wrap:wrap}
1
+ ._container_193w2_1{position:relative;width:100%;height:100vh;padding:20px;display:flex;flex-wrap:wrap;justify-content:space-between;align-content:space-between;border:1px dashed #ccc;box-sizing:border-box}._trigger_193w2_14{padding:8px 16px;background-color:#1976d2;color:#fff;border-radius:4px;font-size:14px;cursor:pointer;transition:background-color .2s;text-align:center}._trigger_193w2_14:hover{background-color:#1565c0}._clickTrigger_193w2_29{background-color:#388e3c}._clickTrigger_193w2_29:hover{background-color:#2e7d32}._positionsContainer_193w2_38{padding:20px}._positionGroup_193w2_42{display:flex;gap:20px;margin-bottom:30px;justify-content:center;flex-wrap:wrap}
@@ -0,0 +1,135 @@
1
+ import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
+ import { createPortal as j } from "react-dom";
3
+ import { useState as d, useRef as N, useEffect as f } from "react";
4
+ import { getPortalContainer as z, releasePortal as V } from "../../../shared/utils/fn/portals.js";
5
+ import { TextInput as U } from "../TextInput/TextInput.js";
6
+ import { IconX as X, IconCaretUpDown as Y } from "../Icons/Icons.js";
7
+ import '../../../assets/src/components/Ui/DropdownSearchInput/DropdownSearchInput.css';/* empty css */
8
+ const C = "dropdown-search-input-global-portal", q = ({
9
+ label: b,
10
+ placeholder: P = "Выберите опцию",
11
+ isDisabled: x = !1,
12
+ errorMessage: S = "",
13
+ hasError: k = !1,
14
+ className: R = "",
15
+ isClearable: $ = !0,
16
+ value: w = "",
17
+ onChange: i,
18
+ options: s = []
19
+ }) => {
20
+ const [E, g] = d(""), [t, p] = d(null), [h, c] = d(s), [v, a] = d(!1), [L, D] = d(!1), l = N(null), u = N(null), I = N(null);
21
+ f(() => (u.current = z(C), () => V(C)), []), f(() => {
22
+ if (w) {
23
+ const e = s.find((n) => n.value === w);
24
+ e && p(e);
25
+ } else
26
+ p(null);
27
+ }, [w, s]), f(() => {
28
+ c(s);
29
+ }, [s]), f(() => {
30
+ const e = (n) => {
31
+ const o = l.current && !l.current.contains(n.target), _ = u.current && !u.current.contains(n.target);
32
+ o && _ && a(!1);
33
+ };
34
+ return document.addEventListener("mousedown", e), () => {
35
+ document.removeEventListener("mousedown", e);
36
+ };
37
+ }, []);
38
+ const A = () => {
39
+ if (!x) {
40
+ if (!v && l.current) {
41
+ const e = l.current.getBoundingClientRect(), n = window.innerHeight - e.bottom;
42
+ D(n < 304 && e.top >= 304);
43
+ }
44
+ a(!0), g((t == null ? void 0 : t.value) ?? ""), t != null && t.label ? c([t]) : c(s), setTimeout(() => {
45
+ var e;
46
+ (e = I.current) == null || e.focus();
47
+ }, 0);
48
+ }
49
+ }, B = (e) => {
50
+ const n = e.target.value;
51
+ if (g(n), n.trim() === "")
52
+ c(s);
53
+ else {
54
+ const o = s.filter(
55
+ (_) => _.label.toLowerCase().includes(n.toLowerCase())
56
+ );
57
+ c(o);
58
+ }
59
+ }, y = (e) => {
60
+ p(e), i == null || i(e.value), a(!1), g("");
61
+ }, H = () => {
62
+ p(null), i == null || i(""), a(!1);
63
+ }, K = (e) => {
64
+ e.key === "Escape" ? a(!1) : e.key === "Enter" && h.length > 0 && y(h[0]);
65
+ }, T = () => {
66
+ if (!v || !l.current || !u.current)
67
+ return null;
68
+ const e = l.current.getBoundingClientRect(), n = {
69
+ position: "fixed",
70
+ width: e.width,
71
+ left: e.left,
72
+ maxHeight: "304px",
73
+ zIndex: 9999,
74
+ overflow: "auto"
75
+ };
76
+ return L ? n.bottom = `${window.innerHeight - e.top}px` : n.top = `${e.bottom}px`, j(
77
+ /* @__PURE__ */ m("div", { className: "dropdown-search-input-suggestions-portal", style: n, children: [
78
+ /* @__PURE__ */ r("div", { className: "dropdown-search-input-suggestions-portal__header", children: /* @__PURE__ */ r(
79
+ U,
80
+ {
81
+ ref: I,
82
+ placeholder: "Поиск...",
83
+ value: E,
84
+ onChange: B,
85
+ onKeyDown: K,
86
+ className: "dropdown-search-input-suggestions-portal__input-search sm",
87
+ isClearable: !0
88
+ }
89
+ ) }),
90
+ /* @__PURE__ */ r("ul", { className: "dropdown-search-input-suggestions-list", children: h.length === 0 ? /* @__PURE__ */ r("li", { className: "dropdown-search-input-suggestions-list__empty", children: "Нет результатов" }) : h.map((o) => /* @__PURE__ */ r(
91
+ "li",
92
+ {
93
+ className: `dropdown-search-input-suggestions-list__item ${(t == null ? void 0 : t.value) === o.value ? "dropdown-search-input-suggestions-list__item--selected" : ""}`,
94
+ onClick: () => y(o),
95
+ children: o.label
96
+ },
97
+ o.value
98
+ )) })
99
+ ] }),
100
+ u.current
101
+ );
102
+ };
103
+ return /* @__PURE__ */ m("div", { className: "dropdown-search-input-container", ref: l, children: [
104
+ b && /* @__PURE__ */ r("label", { children: b }),
105
+ /* @__PURE__ */ m(
106
+ "div",
107
+ {
108
+ className: `dropdown-search-input ${k ? "dropdown-search-input--error" : ""} ${x ? "dropdown-search-input--disabled" : ""} ${v && "dropdown-search-input--expanded"} ${R}`,
109
+ onClick: A,
110
+ children: [
111
+ /* @__PURE__ */ r("div", { className: "dropdown-search-input__value", children: t ? t.label : P }),
112
+ /* @__PURE__ */ m("div", { className: "dropdown-search-input__indicators", children: [
113
+ $ && t && /* @__PURE__ */ r(
114
+ "div",
115
+ {
116
+ className: "dropdown-search-input__clear",
117
+ onClick: (e) => {
118
+ e.stopPropagation(), H();
119
+ },
120
+ children: /* @__PURE__ */ r(X, { size: 20 })
121
+ }
122
+ ),
123
+ !t && /* @__PURE__ */ r(Y, { className: "dropdown-search-input__indicators" })
124
+ ] })
125
+ ]
126
+ }
127
+ ),
128
+ T(),
129
+ k && S && /* @__PURE__ */ r("div", { className: "dropdown-search-input__error-message", children: S })
130
+ ] });
131
+ };
132
+ q.displayName = "DropdownSearchInput";
133
+ export {
134
+ q as DropdownSearchInput
135
+ };
@@ -0,0 +1,4 @@
1
+ import { DropdownSearchInput as p } from "./DropdownSearchInput.js";
2
+ export {
3
+ p as DropdownSearchInput
4
+ };
@@ -1,129 +1,136 @@
1
- import { jsx as A } from "react/jsx-runtime";
2
- import d, { useContext as I, useMemo as b, useEffect as E, useCallback as f } from "react";
3
- import { FormContext as D } from "../FormContext/FormContext.js";
1
+ import { jsx as k } from "react/jsx-runtime";
2
+ import C, { useContext as A, useMemo as b, useEffect as D, useCallback as E } from "react";
3
+ import { FormContext as f } from "../FormContext/FormContext.js";
4
4
  import { validateRule as R } from "../utils/fn.js";
5
5
  import { getChildType as x } from "./fn.js";
6
- const B = d.memo(
6
+ const j = C.memo(
7
7
  ({
8
8
  name: o,
9
- children: a,
9
+ children: e,
10
10
  rules: c,
11
- label: C,
11
+ label: d,
12
12
  isDisabled: v,
13
13
  style: m,
14
14
  classNameItem: y
15
15
  }) => {
16
- const e = I(D), [, F] = d.useReducer((t) => t + 1, 0), g = v || (e == null ? void 0 : e.disabled), u = b(() => Array.isArray(o) ? o : [o], [o]);
17
- E(() => {
18
- if (e)
19
- return e.setFieldRules(u, c || []), e.subscribe(u, F);
20
- }, [u, c, e]);
21
- const s = e == null ? void 0 : e.getFieldValue(u), i = e == null ? void 0 : e.getFieldError(u), n = f(
16
+ const a = A(f), [, F] = C.useReducer((t) => t + 1, 0), g = v || (a == null ? void 0 : a.disabled), u = b(() => Array.isArray(o) ? o : [o], [o]);
17
+ D(() => {
18
+ if (a)
19
+ return a.setFieldRules(u, c || []), a.subscribe(u, F);
20
+ }, [u, c, a]);
21
+ const r = a == null ? void 0 : a.getFieldValue(u), p = a == null ? void 0 : a.getFieldError(u), n = E(
22
22
  (t) => {
23
- if (!g && (e == null || e.setFieldValue(u, t), c)) {
24
- const r = c.map((l) => R(l, t)).filter(Boolean);
25
- e == null || e.setFieldError(u, r);
23
+ if (!g && (a == null || a.setFieldValue(u, t), c)) {
24
+ const s = c.map((i) => R(i, t)).filter(Boolean);
25
+ a == null || a.setFieldError(u, s);
26
26
  }
27
27
  },
28
28
  [u, c, g]
29
- ), h = x(a), k = b(() => {
29
+ ), h = x(e), I = b(() => {
30
30
  const t = {
31
31
  name: u,
32
- label: C,
32
+ label: d,
33
33
  isDisabled: g,
34
- hasError: !!(i != null && i.length),
35
- errorMessage: (i == null ? void 0 : i[0]) || a.props.errorMessage
34
+ hasError: !!(p != null && p.length),
35
+ errorMessage: (p == null ? void 0 : p[0]) || e.props.errorMessage
36
36
  };
37
37
  switch (h) {
38
38
  case "TextareaInput":
39
39
  return {
40
40
  ...t,
41
- value: s || "",
41
+ value: r || "",
42
42
  onChange: n
43
43
  };
44
44
  case "DropdownInput":
45
45
  return {
46
46
  ...t,
47
- value: s,
47
+ value: r,
48
48
  onChange: n
49
49
  };
50
50
  case "TextInput":
51
51
  return {
52
52
  ...t,
53
- ...a.props,
54
- value: s || "",
55
- onChange: (r) => {
56
- var l, p;
57
- n(r.target.value), (p = (l = a.props).onChange) == null || p.call(l, r);
53
+ ...e.props,
54
+ value: r || "",
55
+ onChange: (s) => {
56
+ var i, l;
57
+ n(s.target.value), (l = (i = e.props).onChange) == null || l.call(i, s);
58
58
  }
59
59
  };
60
60
  case "NumberInput":
61
61
  return {
62
62
  ...t,
63
- ...a.props,
64
- value: s || Number(s) || "",
65
- onChange: (r) => {
66
- var l, p;
67
- n(r.target.value), (p = (l = a.props).onChange) == null || p.call(l, r);
63
+ ...e.props,
64
+ value: r || Number(r) || "",
65
+ onChange: (s) => {
66
+ var i, l;
67
+ n(s.target.value), (l = (i = e.props).onChange) == null || l.call(i, s);
68
68
  }
69
69
  };
70
70
  case "ButtonsArray":
71
71
  return {
72
72
  ...t,
73
- ...a.props,
74
- tabs: a.props.tabs || [],
75
- activeKey: s !== void 0 ? s : null,
76
- onChange: (r) => n(r)
73
+ ...e.props,
74
+ tabs: e.props.tabs || [],
75
+ activeKey: r !== void 0 ? r : null,
76
+ onChange: (s) => n(s)
77
77
  };
78
78
  case "Checkbox":
79
79
  return {
80
80
  ...t,
81
- isChecked: !!s,
82
- onChange: (r) => n(r.target.checked)
81
+ isChecked: !!r,
82
+ onChange: (s) => n(s.target.checked)
83
83
  };
84
84
  case "Radio":
85
85
  return {
86
86
  ...t,
87
87
  radioId: `radio-${Array.isArray(o) ? o.join("-") : o}`,
88
- value: a.props.value,
89
- isChecked: s === a.props.value,
90
- onChange: () => n(a.props.value)
88
+ value: e.props.value,
89
+ isChecked: r === e.props.value,
90
+ onChange: () => n(e.props.value)
91
91
  };
92
92
  case "SearchInput":
93
93
  return {
94
94
  ...t,
95
- value: s,
95
+ value: r,
96
+ onChange: n
97
+ };
98
+ case "DropdownSearchInput":
99
+ return {
100
+ ...t,
101
+ ...e.props,
102
+ value: r,
96
103
  onChange: n
97
104
  };
98
105
  case "Switch":
99
106
  return {
100
107
  ...t,
101
- isChecked: !!s,
102
- onChange: (r) => n(r.target.checked)
108
+ isChecked: !!r,
109
+ onChange: (s) => n(s.target.checked)
103
110
  };
104
111
  case "FileUpload":
105
112
  return {
106
113
  ...t,
107
- value: Array.isArray(s) ? s : [],
108
- onChange: (r) => n(r)
114
+ value: Array.isArray(r) ? r : [],
115
+ onChange: (s) => n(s)
109
116
  };
110
117
  default:
111
- return t;
118
+ return { ...t, ...e.props };
112
119
  }
113
120
  }, [
114
121
  u,
115
- C,
116
- i,
117
- s,
122
+ d,
123
+ p,
124
+ r,
118
125
  h,
119
126
  n,
120
- a.props.value,
127
+ e.props.value,
121
128
  g
122
129
  ]);
123
- return /* @__PURE__ */ A("div", { className: y, style: m, children: d.cloneElement(a, k) });
130
+ return /* @__PURE__ */ k("div", { className: y, style: m, children: C.cloneElement(e, I) });
124
131
  },
125
- (o, a) => o.name === a.name && o.rules === a.rules && o.label === a.label && o.isDisabled === a.isDisabled
132
+ (o, e) => o.name === e.name && o.rules === e.rules && o.label === e.label && o.isDisabled === e.isDisabled
126
133
  );
127
134
  export {
128
- B as FormItem
135
+ j as FormItem
129
136
  };
package/dist/main.d.ts CHANGED
@@ -173,7 +173,7 @@ export declare const DropdownInput: default_2.FC<DropdownInputProps>;
173
173
 
174
174
  declare type DropdownInputProps = {
175
175
  label?: string;
176
- options: Option_2[];
176
+ options: Option_3[];
177
177
  value?: string | number;
178
178
  onChange?: (value: string) => void;
179
179
  name?: string;
@@ -193,6 +193,25 @@ declare type DropdownMenuProps = {
193
193
  iconTrigger?: default_2.ReactNode | string;
194
194
  };
195
195
 
196
+ export declare const DropdownSearchInput: React.FC<DropdownSearchInputProps>;
197
+
198
+ export declare type DropdownSearchInputProps = {
199
+ name?: string;
200
+ label?: string;
201
+ type?: string;
202
+ placeholder?: string;
203
+ id?: string;
204
+ isDisabled?: boolean;
205
+ isClearable?: boolean;
206
+ hasError?: boolean;
207
+ errorMessage?: string;
208
+ isLoading?: boolean;
209
+ className?: string;
210
+ options?: Option_2[];
211
+ value?: string;
212
+ onChange?: (value: string) => void;
213
+ };
214
+
196
215
  declare type EditorFormat = "plain" | "json" | "yml" | "xml";
197
216
 
198
217
  declare type FieldPath = string | string[];
@@ -1080,12 +1099,18 @@ declare type Option_2 = {
1080
1099
  value: string;
1081
1100
  label: string;
1082
1101
  };
1102
+ export { Option_2 as Option }
1083
1103
 
1084
1104
  declare type Option_3 = {
1085
1105
  value: string;
1086
1106
  label: string;
1087
1107
  };
1088
1108
 
1109
+ declare type Option_4 = {
1110
+ value: string;
1111
+ label: string;
1112
+ };
1113
+
1089
1114
  export declare const Pagination: React.FC<PaginationProps>;
1090
1115
 
1091
1116
  declare type PaginationProps = {
@@ -1132,7 +1157,7 @@ declare type SearchInputProps = {
1132
1157
  errorMessage?: string;
1133
1158
  isLoading?: boolean;
1134
1159
  className?: string;
1135
- options?: Option_3[];
1160
+ options?: Option_4[];
1136
1161
  value?: string;
1137
1162
  onChange?: (value: string) => void;
1138
1163
  };