@patternfly/react-templates 1.1.0-prerelease.3 → 1.1.0-prerelease.31

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.
Files changed (108) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/README.md +2 -17
  3. package/components/package.json +1 -1
  4. package/dist/dynamic/components/Dropdown/package.json +1 -0
  5. package/dist/dynamic/components/Select/package.json +1 -1
  6. package/dist/dynamic-modules.json +14 -3
  7. package/dist/esm/components/Dropdown/SimpleDropdown.d.ts +48 -0
  8. package/dist/esm/components/Dropdown/SimpleDropdown.d.ts.map +1 -0
  9. package/dist/esm/components/Dropdown/SimpleDropdown.js +33 -0
  10. package/dist/esm/components/Dropdown/SimpleDropdown.js.map +1 -0
  11. package/dist/esm/components/Dropdown/index.d.ts +2 -0
  12. package/dist/esm/components/Dropdown/index.d.ts.map +1 -0
  13. package/dist/esm/components/Dropdown/index.js +2 -0
  14. package/dist/esm/components/Dropdown/index.js.map +1 -0
  15. package/dist/esm/components/Select/CheckboxSelect.d.ts +7 -3
  16. package/dist/esm/components/Select/CheckboxSelect.d.ts.map +1 -1
  17. package/dist/esm/components/Select/CheckboxSelect.js +14 -6
  18. package/dist/esm/components/Select/CheckboxSelect.js.map +1 -1
  19. package/dist/esm/components/Select/MultiTypeaheadSelect.d.ts +33 -0
  20. package/dist/esm/components/Select/MultiTypeaheadSelect.d.ts.map +1 -0
  21. package/dist/esm/components/Select/MultiTypeaheadSelect.js +186 -0
  22. package/dist/esm/components/Select/MultiTypeaheadSelect.js.map +1 -0
  23. package/dist/esm/components/Select/{SelectSimple.d.ts → SimpleSelect.d.ts} +12 -7
  24. package/dist/esm/components/Select/SimpleSelect.d.ts.map +1 -0
  25. package/dist/esm/components/Select/SimpleSelect.js +39 -0
  26. package/dist/esm/components/Select/SimpleSelect.js.map +1 -0
  27. package/dist/esm/components/Select/TypeaheadSelect.d.ts +35 -0
  28. package/dist/esm/components/Select/TypeaheadSelect.d.ts.map +1 -0
  29. package/dist/esm/components/Select/TypeaheadSelect.js +194 -0
  30. package/dist/esm/components/Select/TypeaheadSelect.js.map +1 -0
  31. package/dist/esm/components/Select/index.d.ts +3 -1
  32. package/dist/esm/components/Select/index.d.ts.map +1 -1
  33. package/dist/esm/components/Select/index.js +3 -1
  34. package/dist/esm/components/Select/index.js.map +1 -1
  35. package/dist/esm/components/index.d.ts +1 -0
  36. package/dist/esm/components/index.d.ts.map +1 -1
  37. package/dist/esm/components/index.js +1 -0
  38. package/dist/esm/components/index.js.map +1 -1
  39. package/dist/js/components/Dropdown/SimpleDropdown.d.ts +48 -0
  40. package/dist/js/components/Dropdown/SimpleDropdown.d.ts.map +1 -0
  41. package/dist/js/components/Dropdown/SimpleDropdown.js +36 -0
  42. package/dist/js/components/Dropdown/SimpleDropdown.js.map +1 -0
  43. package/dist/js/components/Dropdown/index.d.ts +2 -0
  44. package/dist/js/components/Dropdown/index.d.ts.map +1 -0
  45. package/dist/js/components/Dropdown/index.js +5 -0
  46. package/dist/js/components/Dropdown/index.js.map +1 -0
  47. package/dist/js/components/Select/CheckboxSelect.d.ts +7 -3
  48. package/dist/js/components/Select/CheckboxSelect.d.ts.map +1 -1
  49. package/dist/js/components/Select/CheckboxSelect.js +14 -6
  50. package/dist/js/components/Select/CheckboxSelect.js.map +1 -1
  51. package/dist/js/components/Select/MultiTypeaheadSelect.d.ts +33 -0
  52. package/dist/js/components/Select/MultiTypeaheadSelect.d.ts.map +1 -0
  53. package/dist/js/components/Select/MultiTypeaheadSelect.js +190 -0
  54. package/dist/js/components/Select/MultiTypeaheadSelect.js.map +1 -0
  55. package/dist/js/components/Select/{SelectSimple.d.ts → SimpleSelect.d.ts} +12 -7
  56. package/dist/js/components/Select/SimpleSelect.d.ts.map +1 -0
  57. package/dist/js/components/Select/SimpleSelect.js +42 -0
  58. package/dist/js/components/Select/SimpleSelect.js.map +1 -0
  59. package/dist/js/components/Select/TypeaheadSelect.d.ts +35 -0
  60. package/dist/js/components/Select/TypeaheadSelect.d.ts.map +1 -0
  61. package/dist/js/components/Select/TypeaheadSelect.js +198 -0
  62. package/dist/js/components/Select/TypeaheadSelect.js.map +1 -0
  63. package/dist/js/components/Select/index.d.ts +3 -1
  64. package/dist/js/components/Select/index.d.ts.map +1 -1
  65. package/dist/js/components/Select/index.js +3 -1
  66. package/dist/js/components/Select/index.js.map +1 -1
  67. package/dist/js/components/index.d.ts +1 -0
  68. package/dist/js/components/index.d.ts.map +1 -1
  69. package/dist/js/components/index.js +1 -0
  70. package/dist/js/components/index.js.map +1 -1
  71. package/dist/umd/assets/output-DV5sTbNI.css +26066 -0
  72. package/dist/umd/react-templates.min.js +1 -1
  73. package/package.json +7 -10
  74. package/rollup.config.mjs +8 -0
  75. package/src/components/Dropdown/SimpleDropdown.tsx +139 -0
  76. package/src/components/Dropdown/__tests__/SimpleDropdown.test.tsx +266 -0
  77. package/src/components/Dropdown/__tests__/__snapshots__/SimpleDropdown.test.tsx.snap +153 -0
  78. package/src/components/Dropdown/examples/DropdownTemplates.md +24 -0
  79. package/src/components/Dropdown/examples/SimpleDropdownExample.tsx +53 -0
  80. package/src/components/Dropdown/index.ts +1 -0
  81. package/src/components/Select/CheckboxSelect.tsx +23 -7
  82. package/src/components/Select/MultiTypeaheadSelect.tsx +348 -0
  83. package/src/components/Select/{SelectSimple.tsx → SimpleSelect.tsx} +39 -18
  84. package/src/components/Select/TypeaheadSelect.tsx +342 -0
  85. package/src/components/Select/{CheckboxSelect.test.tsx → __tests__/CheckboxSelect.test.tsx} +29 -1
  86. package/src/components/Select/{CheckboxSelectSnapshots.test.tsx → __tests__/CheckboxSelectSnapshots.test.tsx} +1 -1
  87. package/src/components/Select/__tests__/MultiTypeaheadSelect.test.tsx +414 -0
  88. package/src/components/Select/__tests__/SimpleSelect.test.tsx +241 -0
  89. package/src/components/Select/__tests__/TypeaheadSelect.test.tsx +408 -0
  90. package/src/components/Select/{__snapshots__ → __tests__/__snapshots__}/CheckboxSelectSnapshots.test.tsx.snap +7 -2
  91. package/src/components/Select/__tests__/__snapshots__/MultiTypeaheadSelect.test.tsx.snap +180 -0
  92. package/src/components/Select/__tests__/__snapshots__/SimpleSelect.test.tsx.snap +170 -0
  93. package/src/components/Select/__tests__/__snapshots__/TypeaheadSelect.test.tsx.snap +180 -0
  94. package/src/components/Select/examples/CheckboxSelectDemo.tsx +25 -8
  95. package/src/components/Select/examples/MultiTypeaheadSelectDemo.tsx +35 -0
  96. package/src/components/Select/examples/SelectTemplates.md +17 -4
  97. package/src/components/Select/examples/SimpleSelectDemo.tsx +36 -0
  98. package/src/components/Select/examples/TypeaheadSelectDemo.tsx +35 -0
  99. package/src/components/Select/index.ts +3 -1
  100. package/src/components/index.ts +1 -0
  101. package/dist/esm/components/Select/SelectSimple.d.ts.map +0 -1
  102. package/dist/esm/components/Select/SelectSimple.js +0 -31
  103. package/dist/esm/components/Select/SelectSimple.js.map +0 -1
  104. package/dist/js/components/Select/SelectSimple.d.ts.map +0 -1
  105. package/dist/js/components/Select/SelectSimple.js +0 -34
  106. package/dist/js/components/Select/SelectSimple.js.map +0 -1
  107. package/rollup.config.js +0 -7
  108. package/src/components/Select/examples/SelectSimpleDemo.tsx +0 -26
package/CHANGELOG.md CHANGED
@@ -3,6 +3,138 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.1.0-prerelease.31](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.30...@patternfly/react-templates@1.1.0-prerelease.31) (2024-07-19)
7
+
8
+ **Note:** Version bump only for package @patternfly/react-templates
9
+
10
+ # [1.1.0-prerelease.30](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.29...@patternfly/react-templates@1.1.0-prerelease.30) (2024-07-18)
11
+
12
+ **Note:** Version bump only for package @patternfly/react-templates
13
+
14
+ # [1.1.0-prerelease.29](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.28...@patternfly/react-templates@1.1.0-prerelease.29) (2024-07-18)
15
+
16
+ **Note:** Version bump only for package @patternfly/react-templates
17
+
18
+ # [1.1.0-prerelease.28](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.27...@patternfly/react-templates@1.1.0-prerelease.28) (2024-07-17)
19
+
20
+ ### Features
21
+
22
+ - **MultiTypeaheadSelect:** Add MultiTypeaheadSelect to react-templates ([#10757](https://github.com/patternfly/patternfly-react/issues/10757)) ([943e19d](https://github.com/patternfly/patternfly-react/commit/943e19dc049ee9a0f047c89b0e456cdc69c56547))
23
+
24
+ # [1.1.0-prerelease.27](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.26...@patternfly/react-templates@1.1.0-prerelease.27) (2024-07-16)
25
+
26
+ **Note:** Version bump only for package @patternfly/react-templates
27
+
28
+ # [1.1.0-prerelease.26](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.25...@patternfly/react-templates@1.1.0-prerelease.26) (2024-07-16)
29
+
30
+ **Note:** Version bump only for package @patternfly/react-templates
31
+
32
+ # [1.1.0-prerelease.25](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.24...@patternfly/react-templates@1.1.0-prerelease.25) (2024-07-15)
33
+
34
+ **Note:** Version bump only for package @patternfly/react-templates
35
+
36
+ # [1.1.0-prerelease.24](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.23...@patternfly/react-templates@1.1.0-prerelease.24) (2024-07-15)
37
+
38
+ ### Bug Fixes
39
+
40
+ - **SimpleSelect,CheckboxSelect:** Handle initial selection(s) ([#10734](https://github.com/patternfly/patternfly-react/issues/10734)) ([3b857f8](https://github.com/patternfly/patternfly-react/commit/3b857f8b06440bccc8e7979cf686f4e3261ff4df))
41
+
42
+ # [1.1.0-prerelease.23](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.22...@patternfly/react-templates@1.1.0-prerelease.23) (2024-07-11)
43
+
44
+ **Note:** Version bump only for package @patternfly/react-templates
45
+
46
+ # [1.1.0-prerelease.22](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.21...@patternfly/react-templates@1.1.0-prerelease.22) (2024-07-11)
47
+
48
+ ### Bug Fixes
49
+
50
+ - **TypeaheadSelect:** Add callback on clear selection ([#10719](https://github.com/patternfly/patternfly-react/issues/10719)) ([7e51bfb](https://github.com/patternfly/patternfly-react/commit/7e51bfb4e7825fb99b626bc3e96aabdad3296244))
51
+
52
+ # [1.1.0-prerelease.21](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.20...@patternfly/react-templates@1.1.0-prerelease.21) (2024-07-09)
53
+
54
+ **Note:** Version bump only for package @patternfly/react-templates
55
+
56
+ # [1.1.0-prerelease.20](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.19...@patternfly/react-templates@1.1.0-prerelease.20) (2024-07-03)
57
+
58
+ ### Features
59
+
60
+ - **templates:** add TypeaheadSelect tests ([#10669](https://github.com/patternfly/patternfly-react/issues/10669)) ([d573604](https://github.com/patternfly/patternfly-react/commit/d573604608b325f7537285adee04e80293c67c90))
61
+
62
+ # [1.1.0-prerelease.19](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.18...@patternfly/react-templates@1.1.0-prerelease.19) (2024-07-02)
63
+
64
+ **Note:** Version bump only for package @patternfly/react-templates
65
+
66
+ # [1.1.0-prerelease.18](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.17...@patternfly/react-templates@1.1.0-prerelease.18) (2024-07-01)
67
+
68
+ **Note:** Version bump only for package @patternfly/react-templates
69
+
70
+ # [1.1.0-prerelease.17](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.16...@patternfly/react-templates@1.1.0-prerelease.17) (2024-06-20)
71
+
72
+ ### Features
73
+
74
+ - **templates:** toggle props & improvements ([#10473](https://github.com/patternfly/patternfly-react/issues/10473)) ([315fc80](https://github.com/patternfly/patternfly-react/commit/315fc80a0fb820d092505f1911c8889599170cd0))
75
+
76
+ # [1.1.0-prerelease.16](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.15...@patternfly/react-templates@1.1.0-prerelease.16) (2024-06-13)
77
+
78
+ ### Bug Fixes
79
+
80
+ - **deps:** update dependency tslib to ^2.6.3 ([#10562](https://github.com/patternfly/patternfly-react/issues/10562)) ([d702534](https://github.com/patternfly/patternfly-react/commit/d702534ce520316060be56eb0f1c4d8396bd57ed))
81
+
82
+ ### Features
83
+
84
+ - **MenuToggle:** add OUIA support ([#10414](https://github.com/patternfly/patternfly-react/issues/10414)) ([7574a50](https://github.com/patternfly/patternfly-react/commit/7574a50c5a1b59b666d8689c4f68c2062d89ec59))
85
+
86
+ # [1.1.0-prerelease.15](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.14...@patternfly/react-templates@1.1.0-prerelease.15) (2024-05-31)
87
+
88
+ **Note:** Version bump only for package @patternfly/react-templates
89
+
90
+ # [1.1.0-prerelease.14](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.13...@patternfly/react-templates@1.1.0-prerelease.14) (2024-05-22)
91
+
92
+ **Note:** Version bump only for package @patternfly/react-templates
93
+
94
+ # [1.1.0-prerelease.13](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.12...@patternfly/react-templates@1.1.0-prerelease.13) (2024-05-20)
95
+
96
+ **Note:** Version bump only for package @patternfly/react-templates
97
+
98
+ # [1.1.0-prerelease.12](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.11...@patternfly/react-templates@1.1.0-prerelease.12) (2024-05-15)
99
+
100
+ **Note:** Version bump only for package @patternfly/react-templates
101
+
102
+ # [1.1.0-prerelease.11](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.10...@patternfly/react-templates@1.1.0-prerelease.11) (2024-05-10)
103
+
104
+ **Note:** Version bump only for package @patternfly/react-templates
105
+
106
+ # [1.1.0-prerelease.10](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.9...@patternfly/react-templates@1.1.0-prerelease.10) (2024-05-10)
107
+
108
+ **Note:** Version bump only for package @patternfly/react-templates
109
+
110
+ # [1.1.0-prerelease.9](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.8...@patternfly/react-templates@1.1.0-prerelease.9) (2024-05-10)
111
+
112
+ ### Features
113
+
114
+ - **Dropdown:** Added simple template ([#10308](https://github.com/patternfly/patternfly-react/issues/10308)) ([86dcc02](https://github.com/patternfly/patternfly-react/commit/86dcc02e909b8f1d5288f5653bc290088e41b375))
115
+ - **Select:** Typeahead example ([#10207](https://github.com/patternfly/patternfly-react/issues/10207)) ([2d19e26](https://github.com/patternfly/patternfly-react/commit/2d19e26b5fa95f6da0fa6b16f5bf9a299cf58df8))
116
+ - **Select:** Typeahead template ([#10235](https://github.com/patternfly/patternfly-react/issues/10235)) ([c7d2e9f](https://github.com/patternfly/patternfly-react/commit/c7d2e9fcaee50cd17a306a0f25e43e96f78e4217))
117
+
118
+ # [1.1.0-prerelease.8](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.7...@patternfly/react-templates@1.1.0-prerelease.8) (2024-04-30)
119
+
120
+ **Note:** Version bump only for package @patternfly/react-templates
121
+
122
+ # [1.1.0-prerelease.7](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.6...@patternfly/react-templates@1.1.0-prerelease.7) (2024-04-30)
123
+
124
+ **Note:** Version bump only for package @patternfly/react-templates
125
+
126
+ # [1.1.0-prerelease.6](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.5...@patternfly/react-templates@1.1.0-prerelease.6) (2024-04-29)
127
+
128
+ **Note:** Version bump only for package @patternfly/react-templates
129
+
130
+ # 1.1.0-prerelease.5 (2024-04-29)
131
+
132
+ **Note:** Version bump only for package @patternfly/react-templates
133
+
134
+ # [1.1.0-prerelease.4](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-templates@1.1.0-prerelease.3...@patternfly/react-templates@1.1.0-prerelease.4) (2024-04-26)
135
+
136
+ **Note:** Version bump only for package @patternfly/react-templates
137
+
6
138
  # 1.1.0-prerelease.3 (2024-04-24)
7
139
 
8
140
  **Note:** Version bump only for package @patternfly/react-templates
package/README.md CHANGED
@@ -2,30 +2,15 @@
2
2
 
3
3
  This package provides wrapped Patternfly component demos with a streamlined API for ease of use.
4
4
 
5
- ### Prerequisite
6
-
7
- #### Node Environment
8
-
9
- This project currently supports [Node Active LTS](https://github.com/nodejs/Release#release-schedule) releases. Please stay current with Node Active LTS when developing patternfly-react.
10
-
11
- For example, to develop with Node 18, use the following:
12
-
13
- ```
14
- nvm install 18
15
- nvm use 18
16
- ```
17
-
18
- This project also requires a Yarn version of >=1.6.0. The latest version can be installed from the [Yarn](https://yarnpkg.com/) home page.
19
-
20
5
  ### Installing
21
6
 
22
- ```
7
+ ```sh
23
8
  yarn add @patternfly/react-templates
24
9
  ```
25
10
 
26
11
  or
27
12
 
28
- ```
13
+ ```sh
29
14
  npm install @patternfly/react-templates --save
30
15
  ```
31
16
 
@@ -1 +1 @@
1
- {"name":"@patternfly/react-templates-components","main":"../dist/js/components/index.js","module":"../dist/esm/components/index.js","typings":"../dist/esm/components/index.d.ts","version":"1.1.0-prerelease.2","private":true}
1
+ {"name":"@patternfly/react-templates-components","main":"../dist/js/components/index.js","module":"../dist/esm/components/index.js","typings":"../dist/esm/components/index.d.ts","version":"1.1.0-prerelease.30","private":true}
@@ -0,0 +1 @@
1
+ {"name":"@patternfly/react-templates-dropdown-dynamic","main":"../../../js/components/Dropdown/index.js","module":"../../../esm/components/Dropdown/index.js","typings":"../../../esm/components/Dropdown/index.d.ts","version":"1.1.0-prerelease.30","private":true}
@@ -1 +1 @@
1
- {"name":"@patternfly/react-templates-select-dynamic","main":"../../../js/components/Select/index.js","module":"../../../esm/components/Select/index.js","typings":"../../../esm/components/Select/index.d.ts","version":"1.1.0-prerelease.2","private":true}
1
+ {"name":"@patternfly/react-templates-select-dynamic","main":"../../../js/components/Select/index.js","module":"../../../esm/components/Select/index.js","typings":"../../../esm/components/Select/index.d.ts","version":"1.1.0-prerelease.30","private":true}
@@ -2,7 +2,18 @@
2
2
  "CheckboxSelect": "dist/dynamic/components/Select",
3
3
  "CheckboxSelectOption": "dist/dynamic/components/Select",
4
4
  "CheckboxSelectProps": "dist/dynamic/components/Select",
5
- "SelectSimple": "dist/dynamic/components/Select",
6
- "SelectSimpleOption": "dist/dynamic/components/Select",
7
- "SelectSimpleProps": "dist/dynamic/components/Select"
5
+ "MultiTypeaheadSelect": "dist/dynamic/components/Select",
6
+ "MultiTypeaheadSelectBase": "dist/dynamic/components/Select",
7
+ "MultiTypeaheadSelectOption": "dist/dynamic/components/Select",
8
+ "MultiTypeaheadSelectProps": "dist/dynamic/components/Select",
9
+ "SimpleDropdown": "dist/dynamic/components/Dropdown",
10
+ "SimpleDropdownItem": "dist/dynamic/components/Dropdown",
11
+ "SimpleDropdownProps": "dist/dynamic/components/Dropdown",
12
+ "SimpleSelect": "dist/dynamic/components/Select",
13
+ "SimpleSelectOption": "dist/dynamic/components/Select",
14
+ "SimpleSelectProps": "dist/dynamic/components/Select",
15
+ "TypeaheadSelect": "dist/dynamic/components/Select",
16
+ "TypeaheadSelectBase": "dist/dynamic/components/Select",
17
+ "TypeaheadSelectOption": "dist/dynamic/components/Select",
18
+ "TypeaheadSelectProps": "dist/dynamic/components/Select"
8
19
  }
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import { DropdownItemProps, DropdownProps } from '@patternfly/react-core/dist/esm/components/Dropdown';
3
+ import { MenuToggleProps } from '@patternfly/react-core/dist/esm/components/MenuToggle';
4
+ import { OUIAProps } from '@patternfly/react-core/dist/esm/helpers';
5
+ export interface SimpleDropdownItem extends Omit<DropdownItemProps, 'content'> {
6
+ /** Content of the dropdown item. If the isDivider prop is true, this prop will be ignored. */
7
+ content?: React.ReactNode;
8
+ /** Unique identifier for the dropdown item, which is used in the dropdown onSelect callback */
9
+ value: string | number;
10
+ /** Callback for when the dropdown item is clicked. */
11
+ onClick?: (event?: any) => void;
12
+ /** URL to redirect to when the dropdown item is clicked. */
13
+ to?: string;
14
+ /** Flag indicating whether the dropdown item should render as a divider. If true, the item will be rendered without
15
+ * the dropdown item wrapper.
16
+ */
17
+ isDivider?: boolean;
18
+ }
19
+ export interface SimpleDropdownProps extends Omit<DropdownProps, 'toggle'>, OUIAProps {
20
+ /** Initial items of the dropdown. */
21
+ initialItems?: SimpleDropdownItem[];
22
+ /** @hide Forwarded ref */
23
+ innerRef?: React.Ref<any>;
24
+ /** Flag indicating the dropdown should be disabled. */
25
+ isDisabled?: boolean;
26
+ /** Flag indicated whether the dropdown toggle should take up the full width of its parent. */
27
+ isToggleFullWidth?: boolean;
28
+ /** Callback triggered when any dropdown item is clicked. */
29
+ onSelect?: (event?: React.MouseEvent<Element, MouseEvent>, value?: string | number) => void;
30
+ /** Callback triggered when the dropdown toggle opens or closes. */
31
+ onToggle?: (nextIsOpen: boolean) => void;
32
+ /** Flag indicating the dropdown toggle should be focused after a dropdown item is clicked. */
33
+ shouldFocusToggleOnSelect?: boolean;
34
+ /** Adds an accessible name to the dropdown toggle. Required when the dropdown toggle does not
35
+ * have any text content.
36
+ */
37
+ toggleAriaLabel?: string;
38
+ /** Content of the toggle. */
39
+ toggleContent: React.ReactNode;
40
+ /** Variant style of the dropdown toggle. */
41
+ toggleVariant?: 'default' | 'plain' | 'plainText';
42
+ /** Width of the toggle. */
43
+ toggleWidth?: string;
44
+ /** Additional props passed to the toggle. */
45
+ toggleProps?: MenuToggleProps;
46
+ }
47
+ export declare const SimpleDropdown: React.ForwardRefExoticComponent<SimpleDropdownProps & React.RefAttributes<any>>;
48
+ //# sourceMappingURL=SimpleDropdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimpleDropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/SimpleDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIL,iBAAiB,EACjB,aAAa,EACd,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAiC,eAAe,EAAE,MAAM,uDAAuD,CAAC;AAEvH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC;IAC5E,8FAA8F;IAC9F,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,+FAA+F;IAC/F,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,sDAAsD;IACtD,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,EAAE,SAAS;IACnF,qCAAqC;IACrC,YAAY,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACpC,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,uDAAuD;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8FAA8F;IAC9F,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5F,mEAAmE;IACnE,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,8FAA8F;IAC9F,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6BAA6B;IAC7B,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,4CAA4C;IAC5C,aAAa,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;IAClD,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAgFD,eAAO,MAAM,cAAc,iFAEzB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { __rest } from "tslib";
2
+ import React from 'react';
3
+ import { Dropdown, DropdownItem, DropdownList } from '@patternfly/react-core/dist/esm/components/Dropdown';
4
+ import { MenuToggle } from '@patternfly/react-core/dist/esm/components/MenuToggle';
5
+ import { Divider } from '@patternfly/react-core/dist/esm/components/Divider';
6
+ const SimpleDropdownBase = (_a) => {
7
+ var { innerRef, initialItems, onSelect: onSelectProp, onToggle: onToggleProp, isDisabled, toggleAriaLabel, toggleContent, isToggleFullWidth, toggleVariant = 'default', toggleWidth, toggleProps, shouldFocusToggleOnSelect } = _a, props = __rest(_a, ["innerRef", "initialItems", "onSelect", "onToggle", "isDisabled", "toggleAriaLabel", "toggleContent", "isToggleFullWidth", "toggleVariant", "toggleWidth", "toggleProps", "shouldFocusToggleOnSelect"]);
8
+ const [isOpen, setIsOpen] = React.useState(false);
9
+ const onSelect = (event, value) => {
10
+ onSelectProp && onSelectProp(event, value);
11
+ onToggleProp && onToggleProp(false);
12
+ setIsOpen(false);
13
+ };
14
+ const onToggle = () => {
15
+ onToggleProp && onToggleProp(!isOpen);
16
+ setIsOpen(!isOpen);
17
+ };
18
+ const dropdownToggle = (toggleRef) => (React.createElement(MenuToggle, Object.assign({ ref: toggleRef, onClick: onToggle, isExpanded: isOpen, isDisabled: isDisabled, variant: toggleVariant, "aria-label": toggleAriaLabel, isFullWidth: isToggleFullWidth, style: {
19
+ width: toggleWidth
20
+ } }, toggleProps), toggleContent));
21
+ const dropdownSimpleItems = initialItems === null || initialItems === void 0 ? void 0 : initialItems.map((item) => {
22
+ const { content, onClick, to, value, isDivider } = item, itemProps = __rest(item, ["content", "onClick", "to", "value", "isDivider"]);
23
+ return isDivider ? (React.createElement(Divider, { component: "li", key: value })) : (React.createElement(DropdownItem, Object.assign({ onClick: onClick, to: to, key: value, value: value }, itemProps), content));
24
+ });
25
+ return (React.createElement(Dropdown, Object.assign({ toggle: dropdownToggle, isOpen: isOpen, onSelect: onSelect, shouldFocusToggleOnSelect: shouldFocusToggleOnSelect, onOpenChange: (isOpen) => {
26
+ onToggleProp && onToggleProp(isOpen);
27
+ setIsOpen(isOpen);
28
+ }, ref: innerRef }, props),
29
+ React.createElement(DropdownList, null, dropdownSimpleItems)));
30
+ };
31
+ export const SimpleDropdown = React.forwardRef((props, ref) => (React.createElement(SimpleDropdownBase, Object.assign({}, props, { innerRef: ref }))));
32
+ SimpleDropdown.displayName = 'SimpleDropdown';
33
+ //# sourceMappingURL=SimpleDropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimpleDropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/SimpleDropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EAGb,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAsC,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,OAAO,EAAE,MAAM,oDAAoD,CAAC;AA+C7E,MAAM,kBAAkB,GAAiD,CAAC,EAcp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UAAK,IAAI,EAA/D,kDAAwD,CAAO,CAAC;QAEtE,OAAO,SAAS,CAAC,CAAC,CAAC,CACjB,oBAAC,OAAO,IAAC,SAAS,EAAC,IAAI,EAAC,GAAG,EAAE,KAAK,GAAI,CACvC,CAAC,CAAC,CAAC,CACF,oBAAC,YAAY,kBAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,IAAM,SAAS,GAC5E,OAAO,CACK,CAChB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,oBAAC,QAAQ,kBACP,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,yBAAyB,EAAE,yBAAyB,EACpD,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;YACvB,YAAY,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;YACrC,SAAS,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC,EACD,GAAG,EAAE,QAAQ,IACT,KAAK;QAET,oBAAC,YAAY,QAAE,mBAAmB,CAAgB,CACzC,CACZ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAA0B,EAAE,GAAmB,EAAE,EAAE,CAAC,CAClG,oBAAC,kBAAkB,oBAAK,KAAK,IAAE,QAAQ,EAAE,GAAG,IAAI,CACjD,CAAC,CAAC;AAEH,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './SimpleDropdown';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './SimpleDropdown';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
- import { SelectOptionProps } from '@patternfly/react-core';
2
+ import { MenuToggleProps, SelectOptionProps, SelectProps } from '@patternfly/react-core';
3
3
  export interface CheckboxSelectOption extends Omit<SelectOptionProps, 'content'> {
4
4
  /** Content of the select option. */
5
5
  content: React.ReactNode;
6
6
  /** Value of the select option. */
7
7
  value: string | number;
8
8
  }
9
- export interface CheckboxSelectProps {
9
+ export interface CheckboxSelectProps extends Omit<SelectProps, 'toggle'> {
10
10
  /** @hide Forwarded ref */
11
11
  innerRef?: React.Ref<any>;
12
12
  /** Initial options of the select. */
@@ -17,8 +17,12 @@ export interface CheckboxSelectProps {
17
17
  onToggle?: (nextIsOpen: boolean) => void;
18
18
  /** Flag indicating the select should be disabled. */
19
19
  isDisabled?: boolean;
20
- /** Content of the toggle. Defaults to the selected option. */
20
+ /** Content of the toggle. Defaults to a string with badge count of selected options. */
21
21
  toggleContent?: React.ReactNode;
22
+ /** Width of the toggle. */
23
+ toggleWidth?: string;
24
+ /** Additional props passed to the toggle. */
25
+ toggleProps?: MenuToggleProps;
22
26
  }
23
27
  export declare const CheckboxSelect: React.ForwardRefExoticComponent<CheckboxSelectProps & React.RefAttributes<any>>;
24
28
  //# sourceMappingURL=CheckboxSelect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/CheckboxSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAOL,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC;IAC9E,oCAAoC;IACpC,OAAO,EAAE,KAAK,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ACrC,cAAc,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACxC,uCAAuC;IACvC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5F,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wFAAwF;IACxF,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAyFD,eAAO,MAAM,cAAc,iFAEzB,CAAC"}
@@ -2,13 +2,18 @@ import { __rest } from "tslib";
2
2
  import React from 'react';
3
3
  import { Badge, MenuToggle, Select, SelectList, SelectOption } from '@patternfly/react-core';
4
4
  const CheckboxSelectBase = (_a) => {
5
- var { innerRef, initialOptions, isDisabled, onSelect: passedOnSelect, onToggle, toggleContent } = _a, props = __rest(_a, ["innerRef", "initialOptions", "isDisabled", "onSelect", "onToggle", "toggleContent"]);
5
+ var { innerRef, initialOptions, isDisabled, onSelect: passedOnSelect, onToggle, toggleContent, toggleWidth = '200px', toggleProps } = _a, props = __rest(_a, ["innerRef", "initialOptions", "isDisabled", "onSelect", "onToggle", "toggleContent", "toggleWidth", "toggleProps"]);
6
6
  const [isOpen, setIsOpen] = React.useState(false);
7
7
  const [selected, setSelected] = React.useState([]);
8
+ React.useEffect(() => {
9
+ var _a;
10
+ const selectedOptions = initialOptions === null || initialOptions === void 0 ? void 0 : initialOptions.filter((option) => option.selected);
11
+ setSelected((_a = selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.map((selectedOption) => String(selectedOption.value))) !== null && _a !== void 0 ? _a : []);
12
+ }, [initialOptions]);
8
13
  const checkboxSelectOptions = initialOptions === null || initialOptions === void 0 ? void 0 : initialOptions.map((option) => {
9
14
  const { content, value } = option, props = __rest(option, ["content", "value"]);
10
15
  const isSelected = selected.includes(`${value}`);
11
- return (React.createElement(SelectOption, Object.assign({}, props, { value: value, key: value, hasCheckbox: true, isSelected: isSelected }), content));
16
+ return (React.createElement(SelectOption, Object.assign({ value: value, key: value, hasCheckbox: true, isSelected: isSelected }, props), content));
12
17
  });
13
18
  const onToggleClick = () => {
14
19
  onToggle && onToggle(!isOpen);
@@ -27,10 +32,13 @@ const CheckboxSelectBase = (_a) => {
27
32
  const defaultToggleContent = (React.createElement(React.Fragment, null,
28
33
  "Filter by status",
29
34
  selected.length > 0 && React.createElement(Badge, { isRead: true }, selected.length)));
30
- const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onToggleClick, isExpanded: isOpen, isDisabled: isDisabled, style: {
31
- width: '200px'
32
- } }, toggleContent || defaultToggleContent));
33
- return (React.createElement(Select, Object.assign({ id: "checkbox-select", isOpen: isOpen, selected: selected, onSelect: onSelect, onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: toggle, ref: innerRef, role: "menu" }, props),
35
+ const toggle = (toggleRef) => (React.createElement(MenuToggle, Object.assign({ ref: toggleRef, onClick: onToggleClick, isExpanded: isOpen, isDisabled: isDisabled, style: {
36
+ width: toggleWidth
37
+ } }, toggleProps), toggleContent || defaultToggleContent));
38
+ return (React.createElement(Select, Object.assign({ isOpen: isOpen, selected: selected, onSelect: onSelect, onOpenChange: (isOpen) => {
39
+ onToggle && onToggle(isOpen);
40
+ setIsOpen(isOpen);
41
+ }, toggle: toggle, ref: innerRef, role: "menu" }, props),
34
42
  React.createElement(SelectList, null, checkboxSelectOptions)));
35
43
  };
36
44
  export const CheckboxSelect = React.forwardRef((props, ref) => (React.createElement(CheckboxSelectBase, Object.assign({}, props, { innerRef: ref }))));
@@ -1 +1 @@
1
- {"version":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E,QAAQ,CAAC,MAAM,CAAS,CAC9D,CACJ,CAAC;IAEF,MAAM,MAAM,GAAG,CAAC,SAAuC,EAAE,EAAE,CAAC,CAC1D,oBAAC,UAAU,kBACT,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,UAAU,EACtB,KAAK,EACH;YACE,KAAK,EAAE,WAAW;SACI,IAEtB,WAAW,GAEd,aAAa,IAAI,oBAAoB,CAC3B,CACd,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,kBACL,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;YACvB,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC7B,SAAS,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC,EACD,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,MAAM,IACP,KAAK;QAET,oBAAC,UAAU,QAAE,qBAAqB,CAAc,CACzC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAA0B,EAAE,GAAmB,EAAE,EAAE,CAAC,CAClG,oBAAC,kBAAkB,oBAAK,KAAK,IAAE,QAAQ,EAAE,GAAG,IAAI,CACjD,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { SelectOptionProps, MenuToggleProps, SelectProps } from '@patternfly/react-core';
3
+ export interface MultiTypeaheadSelectOption extends Omit<SelectOptionProps, 'content'> {
4
+ /** Content of the select option. */
5
+ content: string | number;
6
+ /** Value of the select option. */
7
+ value: string | number;
8
+ }
9
+ export interface MultiTypeaheadSelectProps extends Omit<SelectProps, 'toggle' | 'onSelect'> {
10
+ /** @hide Forwarded ref */
11
+ innerRef?: React.Ref<any>;
12
+ /** Initial options of the select. */
13
+ initialOptions: MultiTypeaheadSelectOption[];
14
+ /** Callback triggered on selection. */
15
+ onSelectionChange?: (_event: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<HTMLInputElement>, selections: (string | number)[]) => void;
16
+ /** Callback triggered when the select opens or closes. */
17
+ onToggle?: (nextIsOpen: boolean) => void;
18
+ /** Callback triggered when the text in the input field changes. */
19
+ onInputChange?: (newValue: string) => void;
20
+ /** Placeholder text for the select input. */
21
+ placeholder?: string;
22
+ /** Message to display when no options match the filter. */
23
+ noOptionsFoundMessage?: string | ((filter: string) => string);
24
+ /** Flag indicating the select should be disabled. */
25
+ isDisabled?: boolean;
26
+ /** Width of the toggle. */
27
+ toggleWidth?: string;
28
+ /** Additional props passed to the toggle. */
29
+ toggleProps?: MenuToggleProps;
30
+ }
31
+ export declare const MultiTypeaheadSelectBase: React.FunctionComponent<MultiTypeaheadSelectProps>;
32
+ export declare const MultiTypeaheadSelect: React.ForwardRefExoticComponent<MultiTypeaheadSelectProps & React.RefAttributes<any>>;
33
+ //# sourceMappingURL=MultiTypeaheadSelect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiTypeaheadSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/MultiTypeaheadSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIL,iBAAiB,EAOjB,eAAe,EACf,WAAW,EAGZ,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC;IACpF,oCAAoC;IACpC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,kCAAkC;IAClC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,UAAU,CAAC;IACzF,0BAA0B;IAC1B,QAAQ,CAAC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