zcomponents-ui 1.1.6 → 1.2.0

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 (29) hide show
  1. package/dist/{index-BDEyCrDG.js → index-CfSBwowY.js} +215 -92
  2. package/dist/index-CfSBwowY.js.map +1 -0
  3. package/dist/{index-Ctbq3kHw.js → index-DC_KVC71.js} +214 -94
  4. package/dist/index-DC_KVC71.js.map +1 -0
  5. package/dist/index.cjs.js +315 -3
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.d.ts +80 -3
  8. package/dist/index.esm.js +319 -3
  9. package/dist/index.esm.js.map +1 -1
  10. package/dist/react-hook-form.cjs.js +1 -1
  11. package/dist/react-hook-form.d.ts +24 -5
  12. package/dist/react-hook-form.esm.js +1 -1
  13. package/dist/types/components/ZDrop/components/ZDropList/ZDropListAutoHeightWrapper/index.d.ts +3 -0
  14. package/dist/types/components/ZDrop/types/zDropTypes.d.ts +22 -3
  15. package/dist/types/components/ZDropButton/components/ZDropButtonContent/index.d.ts +3 -0
  16. package/dist/types/components/ZDropButton/components/ZDropButtonList/index.d.ts +3 -0
  17. package/dist/types/components/ZDropButton/components/ZDropButtonListItem/index.d.ts +3 -0
  18. package/dist/types/components/ZDropButton/components/ZDropButtonSearch/index.d.ts +3 -0
  19. package/dist/types/components/ZDropButton/components/ZDropButtonToggle/index.d.ts +3 -0
  20. package/dist/types/components/ZDropButton/index.d.ts +10 -0
  21. package/dist/types/components/ZDropButton/types/zDropButtonTypes.d.ts +69 -0
  22. package/dist/types/helpers/classNames.d.ts +1 -1
  23. package/dist/types/helpers/getAvailableSpace.d.ts +6 -0
  24. package/dist/types/index.d.ts +2 -0
  25. package/dist/zcomponents-ui.css +1 -1
  26. package/dist/zcomponents-ui.css.map +1 -1
  27. package/package.json +1 -1
  28. package/dist/index-BDEyCrDG.js.map +0 -1
  29. package/dist/index-Ctbq3kHw.js.map +0 -1
package/dist/index.esm.js CHANGED
@@ -1,5 +1,321 @@
1
- export { Z as ZDrop, a as ZDropField } from './index-Ctbq3kHw.js';
2
- import 'react/jsx-runtime';
1
+ import { c as classNames, g as getAvailableSpace, u as useOutsideClose } from './index-DC_KVC71.js';
2
+ export { a as ZDrop, Z as ZDropField } from './index-DC_KVC71.js';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import { useContext, useRef, useState, useCallback, useLayoutEffect, useEffect, createContext } from 'react';
3
5
  import 'react-hook-form';
4
- import 'react';
6
+
7
+ var styles = {"zd-button":"ZDropButton-module_zd-button__XVZ-w","zd-button__toggle":"ZDropButton-module_zd-button__toggle__0jdWn","zd-button__toggle-title":"ZDropButton-module_zd-button__toggle-title__OaiVF","zd-button__toggle-icon":"ZDropButton-module_zd-button__toggle-icon__G4tnb","zd-button__content":"ZDropButton-module_zd-button__content__FS-6m","zd-button__search":"ZDropButton-module_zd-button__search__6Nbrx","zd-button__search-input-field":"ZDropButton-module_zd-button__search-input-field__K2avH","zd-button__search-input":"ZDropButton-module_zd-button__search-input__1e643","zd-button__search-clear-btn":"ZDropButton-module_zd-button__search-clear-btn__hJo2h","zd-button__search-clear-btn-icon":"ZDropButton-module_zd-button__search-clear-btn-icon__PWwHy","zd-button__list":"ZDropButton-module_zd-button__list__prV7p","zd-button__list-item":"ZDropButton-module_zd-button__list-item__uRK0D","zd-button__list-item--active":"ZDropButton-module_zd-button__list-item--active__oPoZA","zd-button__list-item-icon":"ZDropButton-module_zd-button__list-item-icon__xgqOm","zd-button__list-item-title":"ZDropButton-module_zd-button__list-item-title__RHTpc"};
8
+
9
+ const ButtonDropdownToggle = (props) => {
10
+ const { title, toggleIcon, toggleClassName, children, onButtonToggleClick } = props;
11
+ const toggleClasses = classNames(styles["zd-button__toggle"], toggleClassName);
12
+ const onToggleClick = (e) => {
13
+ onButtonToggleClick();
14
+ };
15
+ const onToggleMouseLeave = (e) => {
16
+ e.currentTarget.blur();
17
+ };
18
+ return (jsxs("button", { className: toggleClasses, onMouseLeave: onToggleMouseLeave, onClick: onToggleClick, children: [toggleIcon && (jsx("div", { className: styles["zd-button__toggle-icon"], children: toggleIcon })), title && (jsx("span", { className: styles["zd-button__toggle-title"], children: title })), children] }));
19
+ };
20
+
21
+ const ZDropButtonContent = (props) => {
22
+ const { children, position = "bottom-left" } = props;
23
+ const { isOpen, buttonContainerRef, searchInputRef } = useContext(ZDropButtonContext);
24
+ const contentRef = useRef(null);
25
+ const [forcedPositionX, setForcedPositionX] = useState();
26
+ const [forcedPositionY, setForcedPositionY] = useState();
27
+ const [contentHeightValue, setContentHeightValue] = useState();
28
+ const positionStyles = {
29
+ position: "absolute",
30
+ ...(position.includes("top") ? { bottom: "100%" } : { top: "100%" }),
31
+ ...(position.includes("left") ? { left: 0 } : { right: 0 }),
32
+ ...(forcedPositionX && { ...forcedPositionX }),
33
+ ...(forcedPositionY && { ...forcedPositionY }),
34
+ ...(contentHeightValue && { maxHeight: contentHeightValue + "px" }),
35
+ };
36
+ const calculateContentHeight = useCallback(() => {
37
+ var _a, _b, _c, _d;
38
+ if ((contentRef === null || contentRef === void 0 ? void 0 : contentRef.current) && (buttonContainerRef === null || buttonContainerRef === void 0 ? void 0 : buttonContainerRef.current)) {
39
+ const searchInputHeight = (_b = (_a = searchInputRef === null || searchInputRef === void 0 ? void 0 : searchInputRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0;
40
+ const { top, bottom } = getAvailableSpace(buttonContainerRef.current);
41
+ const availableTop = Math.max(0, top - searchInputHeight);
42
+ const availableBottom = Math.max(0, bottom - searchInputHeight);
43
+ const liElementHeight = (_d = (_c = contentRef === null || contentRef === void 0 ? void 0 : contentRef.current) === null || _c === void 0 ? void 0 : _c.querySelector("li")) === null || _d === void 0 ? void 0 : _d.getBoundingClientRect().height;
44
+ if (!liElementHeight) {
45
+ return;
46
+ }
47
+ const approvedHeight = liElementHeight * 2;
48
+ if (position.includes("top") && availableTop > approvedHeight) {
49
+ setContentHeightValue(availableTop);
50
+ return;
51
+ }
52
+ if (position.includes("top") && availableTop <= approvedHeight) {
53
+ setContentHeightValue(availableBottom);
54
+ setForcedPositionY({ top: "100%", bottom: "auto" });
55
+ return;
56
+ }
57
+ if (position.includes("bottom") && availableBottom > approvedHeight) {
58
+ setContentHeightValue(availableBottom);
59
+ return;
60
+ }
61
+ if (position.includes("bottom") && availableBottom <= approvedHeight) {
62
+ setContentHeightValue(availableTop);
63
+ setForcedPositionY({ top: "auto", bottom: "100%" });
64
+ }
65
+ }
66
+ }, [buttonContainerRef, searchInputRef, position]);
67
+ const preventFromOverflowX = useCallback(() => {
68
+ if (!(buttonContainerRef === null || buttonContainerRef === void 0 ? void 0 : buttonContainerRef.current) || !contentRef.current) {
69
+ return;
70
+ }
71
+ const buttonRect = buttonContainerRef.current.getBoundingClientRect();
72
+ const contentWidth = contentRef.current.clientWidth;
73
+ const viewportWidth = window.innerWidth;
74
+ const isOverflowLeft = buttonRect.left - contentWidth < 0;
75
+ const isOverflowRight = buttonRect.right + contentWidth > viewportWidth;
76
+ if (isOverflowRight && !isOverflowLeft) {
77
+ setForcedPositionX({ right: 0, left: "auto" });
78
+ return;
79
+ }
80
+ if (!isOverflowRight && isOverflowLeft) {
81
+ setForcedPositionX({ left: 0, right: "auto" });
82
+ return;
83
+ }
84
+ setForcedPositionX(undefined);
85
+ }, [buttonContainerRef]);
86
+ const preventFromOverflowY = useCallback(() => {
87
+ if (!(buttonContainerRef === null || buttonContainerRef === void 0 ? void 0 : buttonContainerRef.current) || !contentRef.current) {
88
+ return;
89
+ }
90
+ const toggleButtonHeight = buttonContainerRef.current.scrollHeight;
91
+ const buttonDropdownPositionY = buttonContainerRef.current.getBoundingClientRect().y;
92
+ const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
93
+ const isOverFlowTop = buttonDropdownPositionY < contentRef.current.clientHeight;
94
+ const isOverFlowBottom = buttonDropdownPositionY +
95
+ toggleButtonHeight +
96
+ contentRef.current.clientHeight >
97
+ viewportHeight;
98
+ if (!isOverFlowTop && !isOverFlowBottom) {
99
+ setForcedPositionY(undefined);
100
+ setContentHeightValue(undefined);
101
+ return;
102
+ }
103
+ if (!isOverFlowTop && isOverFlowBottom) {
104
+ setForcedPositionY({ top: "auto", bottom: "100%" });
105
+ setContentHeightValue(undefined);
106
+ return;
107
+ }
108
+ if (isOverFlowTop && !isOverFlowBottom) {
109
+ setForcedPositionY({ top: "100%", bottom: "auto" });
110
+ setContentHeightValue(undefined);
111
+ return;
112
+ }
113
+ if (isOverFlowTop && isOverFlowBottom) {
114
+ calculateContentHeight();
115
+ }
116
+ }, [buttonContainerRef, calculateContentHeight]);
117
+ useLayoutEffect(() => {
118
+ if (isOpen) {
119
+ preventFromOverflowX();
120
+ preventFromOverflowY();
121
+ }
122
+ }, [isOpen]);
123
+ useLayoutEffect(() => {
124
+ if (isOpen) {
125
+ let timeId;
126
+ const onResize = () => {
127
+ clearTimeout(timeId);
128
+ timeId = setTimeout(() => {
129
+ preventFromOverflowX();
130
+ preventFromOverflowY();
131
+ }, 50);
132
+ };
133
+ window.addEventListener("resize", onResize);
134
+ return () => {
135
+ clearTimeout(timeId);
136
+ window.removeEventListener("resize", onResize);
137
+ };
138
+ }
139
+ }, [isOpen, preventFromOverflowX, preventFromOverflowY]);
140
+ if (!isOpen) {
141
+ return null;
142
+ }
143
+ return (jsx("div", { className: styles["zd-button__content"], style: positionStyles, ref: contentRef, children: children }));
144
+ };
145
+
146
+ const ZDropButtonList = (props) => {
147
+ const { children } = props;
148
+ return jsx("ul", { className: styles["zd-button__list"], children: children });
149
+ };
150
+
151
+ const ZDropButtonListItem = (props) => {
152
+ const { index, title, Icon, urlPath, className, linkAs: LinkTag = "a", isActive = false, children, } = props;
153
+ const { addToRefs, optionsRef, onItemSelect, searchInputRef } = useContext(ZDropButtonContext);
154
+ const itemContainerClasses = (isActive) => classNames(styles["zd-button__list-item"], {
155
+ [styles["zd-button__list-item--active"]]: !urlPath && isActive,
156
+ }, className);
157
+ const onItemClick = (e) => {
158
+ if (!urlPath) {
159
+ e.preventDefault();
160
+ e.stopPropagation();
161
+ }
162
+ onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect(index);
163
+ };
164
+ const onItemMouseEnter = () => {
165
+ optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.current[index].focus();
166
+ };
167
+ const onItemMouseLeave = () => {
168
+ optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.current[index].blur();
169
+ };
170
+ const onItemKeyDown = (e) => {
171
+ var _a, _b;
172
+ if ([" ", "Enter"].includes(e.key)) {
173
+ if (urlPath) {
174
+ return e.currentTarget.click();
175
+ }
176
+ e.preventDefault();
177
+ e.stopPropagation();
178
+ onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect(index);
179
+ return;
180
+ }
181
+ if (e.key === "ArrowUp" && index !== 0) {
182
+ e.preventDefault();
183
+ e.stopPropagation();
184
+ optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.current[index - 1].focus();
185
+ return;
186
+ }
187
+ if (e.key === "ArrowUp" && index === 0) {
188
+ e.preventDefault();
189
+ e.stopPropagation();
190
+ if (searchInputRef === null || searchInputRef === void 0 ? void 0 : searchInputRef.current) {
191
+ searchInputRef.current.focus();
192
+ return;
193
+ }
194
+ optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.current[optionsRef.current.length - 1].focus();
195
+ return;
196
+ }
197
+ if (e.key === "ArrowDown" &&
198
+ (optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.current) &&
199
+ index !== ((_a = optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.current) === null || _a === void 0 ? void 0 : _a.length) - 1) {
200
+ e.preventDefault();
201
+ e.stopPropagation();
202
+ optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.current[index + 1].focus();
203
+ return;
204
+ }
205
+ if (e.key === "ArrowDown" &&
206
+ (optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.current) &&
207
+ index === ((_b = optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.current) === null || _b === void 0 ? void 0 : _b.length) - 1) {
208
+ e.preventDefault();
209
+ e.stopPropagation();
210
+ if (searchInputRef === null || searchInputRef === void 0 ? void 0 : searchInputRef.current) {
211
+ searchInputRef.current.focus();
212
+ return;
213
+ }
214
+ optionsRef.current[0].focus();
215
+ }
216
+ };
217
+ const ItemTypeComponent = urlPath ? LinkTag : "div";
218
+ return (jsx("li", { children: jsxs(ItemTypeComponent, { ref: (el) => addToRefs === null || addToRefs === void 0 ? void 0 : addToRefs(el, index), className: itemContainerClasses(isActive), tabIndex: 0, onClick: onItemClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, onKeyDown: onItemKeyDown, ...(urlPath &&
219
+ (LinkTag === "a" ? { href: urlPath } : { to: urlPath })), children: [Icon && (jsx("div", { className: styles["zd-button__list-item-icon"], children: Icon })), jsx("span", { className: styles["zd-button__list-item-title"], children: title }), children] }) }));
220
+ };
221
+
222
+ const ZDropButtonSearch = (props) => {
223
+ const { placeholder, searchIcon, clearIcon, searchClassName, shouldFocusOnOpen = false, } = props;
224
+ const { onSearch, searchInputRef, optionsRef, isOpen } = useContext(ZDropButtonContext);
225
+ const [isSearchActive, setIsSearchActive] = useState(false);
226
+ const searchFormClasses = classNames(styles["zd-button__search"]);
227
+ const searchInputFieldClasses = classNames(styles["zd-button__search-input-field"], { active: isSearchActive }, searchClassName);
228
+ const onInputChange = (e) => {
229
+ onSearch === null || onSearch === void 0 ? void 0 : onSearch(e);
230
+ };
231
+ const onSearchMouseEnter = () => {
232
+ setIsSearchActive(true);
233
+ };
234
+ const onSearchMouseLeave = (e) => {
235
+ var _a;
236
+ if ((searchInputRef === null || searchInputRef === void 0 ? void 0 : searchInputRef.current) && !((_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.value)) {
237
+ e.target.blur();
238
+ setIsSearchActive(false);
239
+ }
240
+ };
241
+ const onSearchKeyDown = (e) => {
242
+ var _a, _b;
243
+ if (["ArrowDown", "Tab"].includes(e.key)) {
244
+ e.preventDefault();
245
+ !((_a = searchInputRef === null || searchInputRef === void 0 ? void 0 : searchInputRef.current) === null || _a === void 0 ? void 0 : _a.value) && setIsSearchActive(false);
246
+ optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.current[0].focus();
247
+ }
248
+ if (["ArrowUp"].includes(e.key)) {
249
+ e.preventDefault();
250
+ !((_b = searchInputRef === null || searchInputRef === void 0 ? void 0 : searchInputRef.current) === null || _b === void 0 ? void 0 : _b.value) && setIsSearchActive(false);
251
+ optionsRef === null || optionsRef === void 0 ? void 0 : optionsRef.current[optionsRef.current.length - 1].focus();
252
+ }
253
+ };
254
+ const onClearClick = (e) => {
255
+ e.preventDefault();
256
+ e.stopPropagation();
257
+ if (searchInputRef === null || searchInputRef === void 0 ? void 0 : searchInputRef.current) {
258
+ searchInputRef.current.value = "";
259
+ searchInputRef.current.focus();
260
+ }
261
+ onSearch === null || onSearch === void 0 ? void 0 : onSearch({
262
+ target: { value: "" },
263
+ });
264
+ setIsSearchActive(false);
265
+ };
266
+ useEffect(() => {
267
+ if ((searchInputRef === null || searchInputRef === void 0 ? void 0 : searchInputRef.current) && isOpen && shouldFocusOnOpen) {
268
+ searchInputRef.current.focus();
269
+ }
270
+ }, []);
271
+ return (jsx("form", { className: searchFormClasses, onMouseEnter: onSearchMouseEnter, onMouseLeave: onSearchMouseLeave, onKeyDown: onSearchKeyDown, children: jsxs("div", { className: searchInputFieldClasses, children: [searchIcon && jsx("div", { children: searchIcon }), jsx("input", { className: styles["zd-button__search-input"], onChange: onInputChange, ref: searchInputRef, placeholder: placeholder }), jsx("button", { className: styles["zd-button__search-clear-btn"], type: "button", onClick: onClearClick, children: clearIcon || (jsx("span", { className: styles["zd-button__search-clear-btn-icon"] })) })] }) }));
272
+ };
273
+
274
+ const ZDropButtonContext = createContext({});
275
+ const ZDropButton = (props) => {
276
+ const { options, title, className, toggleClassName, children, onToggle, toggleIcon, onHide, onSelect, onSearch, isOutsideClickActive = true, } = props;
277
+ const buttonContainerRef = useRef(null);
278
+ const optionsRef = useRef([]);
279
+ const searchInputRef = useRef(null);
280
+ const [isOpen, setIsOpen] = useState(false);
281
+ const buttonContainerClasses = classNames(styles["zd-button"], className);
282
+ const addToRefs = (element, index) => {
283
+ return (optionsRef.current[index] = element);
284
+ };
285
+ const onButtonToggleClick = () => {
286
+ setIsOpen((prev) => !prev);
287
+ onHide === null || onHide === void 0 ? void 0 : onHide();
288
+ onToggle === null || onToggle === void 0 ? void 0 : onToggle();
289
+ };
290
+ const onItemSelect = (selectedItem) => {
291
+ setIsOpen(false);
292
+ onHide === null || onHide === void 0 ? void 0 : onHide();
293
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedItem);
294
+ };
295
+ useOutsideClose(buttonContainerRef, () => {
296
+ setIsOpen(false);
297
+ onHide === null || onHide === void 0 ? void 0 : onHide();
298
+ }, {
299
+ isActive: isOpen && isOutsideClickActive,
300
+ });
301
+ useEffect(() => {
302
+ optionsRef.current = optionsRef.current.slice(0, options === null || options === void 0 ? void 0 : options.length);
303
+ }, [options]);
304
+ return (jsx(ZDropButtonContext.Provider, { value: {
305
+ isOpen,
306
+ onButtonToggleClick,
307
+ onItemSelect,
308
+ onSearch,
309
+ buttonContainerRef,
310
+ optionsRef,
311
+ searchInputRef,
312
+ addToRefs,
313
+ }, children: jsxs("div", { ref: buttonContainerRef, className: buttonContainerClasses, children: [jsx(ButtonDropdownToggle, { title: title, toggleIcon: toggleIcon, toggleClassName: toggleClassName, onButtonToggleClick: onButtonToggleClick }), isOpen && children] }) }));
314
+ };
315
+ ZDropButton.Content = ZDropButtonContent;
316
+ ZDropButton.List = ZDropButtonList;
317
+ ZDropButton.Item = ZDropButtonListItem;
318
+ ZDropButton.Search = ZDropButtonSearch;
319
+
320
+ export { ZDropButton };
5
321
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/components/ZDropButton/components/ZDropButtonToggle/index.tsx","../src/components/ZDropButton/components/ZDropButtonContent/index.tsx","../src/components/ZDropButton/components/ZDropButtonList/index.tsx","../src/components/ZDropButton/components/ZDropButtonListItem/index.tsx","../src/components/ZDropButton/components/ZDropButtonSearch/index.tsx","../src/components/ZDropButton/index.tsx"],"sourcesContent":[null,null,null,null,null,null],"names":["_jsxs","_jsx","ZDropButtonToggle"],"mappings":";;;;;;;;AAKA,MAAM,oBAAoB,GAAG,CAAC,KAA6B,KAAI;AAC7D,IAAA,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,EAAE,GACzE,KAAK;IAEP,MAAM,aAAa,GAAG,UAAU,CAC9B,MAAM,CAAC,mBAAmB,CAAC,EAC3B,eAAe,CAChB;AAED,IAAA,MAAM,aAAa,GAAyC,CAAC,CAAC,KAAI;AAChE,QAAA,mBAAmB,EAAE;AACvB,IAAA,CAAC;AAED,IAAA,MAAM,kBAAkB,GAAyC,CAAC,CAAC,KAAI;AACrE,QAAA,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE;AACxB,IAAA,CAAC;IAED,QACEA,iBACE,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,kBAAkB,EAChC,OAAO,EAAE,aAAa,aAErB,UAAU,KACTC,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC,EAAA,QAAA,EAAG,UAAU,GAAO,CACrE,EACA,KAAK,KACJA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,MAAM,CAAC,yBAAyB,CAAC,YAAG,KAAK,EAAA,CAAQ,CACnE,EACA,QAAQ,CAAA,EAAA,CACF;AAEb,CAAC;;ACxBD,MAAM,kBAAkB,GAAG,CAAC,KAA8B,KAAI;IAC5D,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,aAAa,EAAE,GAAG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BAAmB,EAAA,CACxC,EACD,MAAM,IAAI,QAAQ,CAAA,EAAA,CACf,EAAA,CACsB;AAElC;AAEA,WAAW,CAAC,OAAO,GAAG,kBAAkB;AACxC,WAAW,CAAC,IAAI,GAAG,eAAe;AAClC,WAAW,CAAC,IAAI,GAAG,mBAAmB;AACtC,WAAW,CAAC,MAAM,GAAG,iBAAiB;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BDEyCrDG.js');
3
+ var index = require('./index-CfSBwowY.js');
4
4
  require('react/jsx-runtime');
5
5
  require('react-hook-form');
6
6
  require('react');
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { FieldValues, Control, Path, RegisterOptions } from 'react-hook-form';
3
- import { ReactElement, FocusEventHandler, MouseEventHandler, ReactNode, Ref, RefObject, KeyboardEventHandler, ChangeEventHandler } from 'react';
3
+ import { ReactElement, FocusEventHandler, MouseEventHandler, RefObject, ReactNode, Ref, KeyboardEventHandler, ChangeEventHandler } from 'react';
4
4
 
5
5
  type ZDropOption = string | number | {
6
6
  [key: string]: any;
@@ -46,7 +46,7 @@ type SearchFilter = ({ options, currentValue, labelKey, }: {
46
46
  currentValue: string;
47
47
  labelKey: string;
48
48
  }) => ZDropOption[];
49
- interface ZDropProps {
49
+ interface ZDropBaseProps {
50
50
  name: string;
51
51
  options?: ZDropOption[];
52
52
  value?: ZDropValue;
@@ -69,16 +69,34 @@ interface ZDropProps {
69
69
  expandToggleRenderer?: ExpandToggleRenderer;
70
70
  clearIcon?: ReactElement;
71
71
  noDataContent?: string | ReactElement;
72
- referenceElementClassName?: string;
73
- positionToReferenceElement?: "top" | "bottom";
72
+ isAutoHeightEnabled?: boolean;
73
+ autoHeightPosition?: "top" | "bottom";
74
74
  listMaxHeightLimiter?: number;
75
75
  styleClasses?: StyleClasses;
76
76
  }
77
+ interface ZDropWithReferenceElementProps extends ZDropBaseProps {
78
+ referenceElementClassName?: string;
79
+ positionToReferenceElement?: "top" | "bottom";
80
+ isAutoHeightEnabled?: never;
81
+ autoHeightPosition?: never;
82
+ }
83
+ interface ZDropWithAutoHeightProps extends ZDropBaseProps {
84
+ referenceElementClassName?: never;
85
+ positionToReferenceElement?: never;
86
+ isAutoHeightEnabled?: boolean;
87
+ autoHeightPosition?: "top" | "bottom";
88
+ }
89
+ type ZDropProps = ZDropWithReferenceElementProps | ZDropWithAutoHeightProps;
77
90
  interface ZDropLabelProps {
78
91
  name?: string;
79
92
  label?: string | ReactElement;
80
93
  className?: string;
81
94
  }
95
+ interface ZDropListAutoHeightWrapperProps {
96
+ containerRef: RefObject<HTMLDivElement | null>;
97
+ position?: "top" | "bottom";
98
+ children: ReactNode;
99
+ }
82
100
  interface ZDropListWrapperProps {
83
101
  referenceElementClassName: string;
84
102
  positionToReferenceElement?: "top" | "bottom";
@@ -98,6 +116,7 @@ interface ZDropListProps {
98
116
  currentSearchedValue?: string;
99
117
  listStyleClasses?: ListStyleClasses;
100
118
  isListWrapperEnabled?: boolean;
119
+ isAutoHeightEnabled?: boolean;
101
120
  }
102
121
  interface ZDropListItemProps {
103
122
  option: ZDropOption;
@@ -243,4 +262,4 @@ type ZDropFieldProps<TFieldValues extends FieldValues = FieldValues> = Omit<ZDro
243
262
  declare function ZDropField<TFieldValues extends FieldValues = FieldValues>(props: ZDropFieldProps<TFieldValues>): react_jsx_runtime.JSX.Element;
244
263
 
245
264
  export { ZDropField };
246
- export type { Clear, ExpandToggleRenderer, InputOptionRemove, InputStyleClasses, ListStyleClasses, OptionRenderer, OptionsRef, SearchFilter, StyleClasses, ToggleStyleClasses, ValueRenderer, ZDropClearButtonProps, ZDropDefaultSearchFilter, ZDropInputProps, ZDropLabelProps, ZDropListItemProps, ZDropListNoDataProps, ZDropListProps, ZDropListVisibilityToggleProps, ZDropListWrapperProps, ZDropMultipleInputItemProps, ZDropMultipleInputProps, ZDropMultipleValue, ZDropOption, ZDropProps, ZDropSingleInputProps, ZDropSingleInputValueRendererProps, ZDropSingleValue, ZDropValue };
265
+ export type { Clear, ExpandToggleRenderer, InputOptionRemove, InputStyleClasses, ListStyleClasses, OptionRenderer, OptionsRef, SearchFilter, StyleClasses, ToggleStyleClasses, ValueRenderer, ZDropBaseProps, ZDropClearButtonProps, ZDropDefaultSearchFilter, ZDropInputProps, ZDropLabelProps, ZDropListAutoHeightWrapperProps, ZDropListItemProps, ZDropListNoDataProps, ZDropListProps, ZDropListVisibilityToggleProps, ZDropListWrapperProps, ZDropMultipleInputItemProps, ZDropMultipleInputProps, ZDropMultipleValue, ZDropOption, ZDropProps, ZDropSingleInputProps, ZDropSingleInputValueRendererProps, ZDropSingleValue, ZDropValue, ZDropWithAutoHeightProps, ZDropWithReferenceElementProps };
@@ -1,4 +1,4 @@
1
- export { a as ZDropField } from './index-Ctbq3kHw.js';
1
+ export { Z as ZDropField } from './index-DC_KVC71.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react-hook-form';
4
4
  import 'react';
@@ -0,0 +1,3 @@
1
+ import { ZDropListAutoHeightWrapperProps } from "../../../types/zDropTypes";
2
+ declare const ZDropListAutoHeightWrapper: (props: ZDropListAutoHeightWrapperProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ZDropListAutoHeightWrapper;
@@ -43,7 +43,7 @@ export type SearchFilter = ({ options, currentValue, labelKey, }: {
43
43
  currentValue: string;
44
44
  labelKey: string;
45
45
  }) => ZDropOption[];
46
- export interface ZDropProps {
46
+ export interface ZDropBaseProps {
47
47
  name: string;
48
48
  options?: ZDropOption[];
49
49
  value?: ZDropValue;
@@ -66,16 +66,34 @@ export interface ZDropProps {
66
66
  expandToggleRenderer?: ExpandToggleRenderer;
67
67
  clearIcon?: ReactElement;
68
68
  noDataContent?: string | ReactElement;
69
- referenceElementClassName?: string;
70
- positionToReferenceElement?: "top" | "bottom";
69
+ isAutoHeightEnabled?: boolean;
70
+ autoHeightPosition?: "top" | "bottom";
71
71
  listMaxHeightLimiter?: number;
72
72
  styleClasses?: StyleClasses;
73
73
  }
74
+ export interface ZDropWithReferenceElementProps extends ZDropBaseProps {
75
+ referenceElementClassName?: string;
76
+ positionToReferenceElement?: "top" | "bottom";
77
+ isAutoHeightEnabled?: never;
78
+ autoHeightPosition?: never;
79
+ }
80
+ export interface ZDropWithAutoHeightProps extends ZDropBaseProps {
81
+ referenceElementClassName?: never;
82
+ positionToReferenceElement?: never;
83
+ isAutoHeightEnabled?: boolean;
84
+ autoHeightPosition?: "top" | "bottom";
85
+ }
86
+ export type ZDropProps = ZDropWithReferenceElementProps | ZDropWithAutoHeightProps;
74
87
  export interface ZDropLabelProps {
75
88
  name?: string;
76
89
  label?: string | ReactElement;
77
90
  className?: string;
78
91
  }
92
+ export interface ZDropListAutoHeightWrapperProps {
93
+ containerRef: RefObject<HTMLDivElement | null>;
94
+ position?: "top" | "bottom";
95
+ children: ReactNode;
96
+ }
79
97
  export interface ZDropListWrapperProps {
80
98
  referenceElementClassName: string;
81
99
  positionToReferenceElement?: "top" | "bottom";
@@ -95,6 +113,7 @@ export interface ZDropListProps {
95
113
  currentSearchedValue?: string;
96
114
  listStyleClasses?: ListStyleClasses;
97
115
  isListWrapperEnabled?: boolean;
116
+ isAutoHeightEnabled?: boolean;
98
117
  }
99
118
  export interface ZDropListItemProps {
100
119
  option: ZDropOption;
@@ -0,0 +1,3 @@
1
+ import { ZDropButtonContentProps } from "components/ZDropButton/types/zDropButtonTypes";
2
+ declare const ZDropButtonContent: (props: ZDropButtonContentProps) => import("react/jsx-runtime").JSX.Element | null;
3
+ export default ZDropButtonContent;
@@ -0,0 +1,3 @@
1
+ import { ZDropButtonListProps } from "components/ZDropButton/types/zDropButtonTypes";
2
+ declare const ZDropButtonList: (props: ZDropButtonListProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ZDropButtonList;
@@ -0,0 +1,3 @@
1
+ import { ZDropButtonListItemProps } from "components/ZDropButton/types/zDropButtonTypes";
2
+ declare const ZDropButtonListItem: (props: ZDropButtonListItemProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ZDropButtonListItem;
@@ -0,0 +1,3 @@
1
+ import { ZDropButtonSearchProps } from "components/ZDropButton/types/zDropButtonTypes";
2
+ declare const ZDropButtonSearch: (props: ZDropButtonSearchProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ZDropButtonSearch;
@@ -0,0 +1,3 @@
1
+ import { ZDropButtonToggleProps } from "components/ZDropButton/types/zDropButtonTypes";
2
+ declare const ButtonDropdownToggle: (props: ZDropButtonToggleProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ButtonDropdownToggle;
@@ -0,0 +1,10 @@
1
+ import { ZDropButtonContextType, ZDropButtonProps } from "./types/zDropButtonTypes";
2
+ export declare const ZDropButtonContext: import("react").Context<ZDropButtonContextType>;
3
+ declare const ZDropButton: {
4
+ (props: ZDropButtonProps): import("react/jsx-runtime").JSX.Element;
5
+ Content: (props: import("./types/zDropButtonTypes").ZDropButtonContentProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ List: (props: import("./types/zDropButtonTypes").ZDropButtonListProps) => import("react/jsx-runtime").JSX.Element;
7
+ Item: (props: import("./types/zDropButtonTypes").ZDropButtonListItemProps) => import("react/jsx-runtime").JSX.Element;
8
+ Search: (props: import("./types/zDropButtonTypes").ZDropButtonSearchProps) => import("react/jsx-runtime").JSX.Element;
9
+ };
10
+ export default ZDropButton;
@@ -0,0 +1,69 @@
1
+ import { ChangeEvent, JSX, ReactElement, ReactNode, RefObject } from "react";
2
+ export interface ZDropButtonBaseProps {
3
+ options: any[];
4
+ className?: string;
5
+ toggleClassName?: string;
6
+ children: ReactNode;
7
+ onToggle?: Function;
8
+ onSelect?: Function;
9
+ onHide?: Function;
10
+ onSearch?: (e: ChangeEvent<HTMLInputElement>) => void;
11
+ isOutsideClickActive?: boolean;
12
+ }
13
+ export interface ToggleButtonTitleRequireProps extends ZDropButtonBaseProps {
14
+ title: string | number;
15
+ toggleIcon?: ReactElement;
16
+ }
17
+ export interface ToggleButtonIconRequireProps extends ZDropButtonBaseProps {
18
+ title?: string | number;
19
+ toggleIcon: ReactElement;
20
+ }
21
+ export type ZDropButtonProps = ToggleButtonTitleRequireProps | ToggleButtonIconRequireProps;
22
+ export type ZDropItemSelectHandler = (selectedItemIndex: number) => void;
23
+ export type ZDropButtonContextType = {
24
+ isOpen?: boolean;
25
+ onButtonToggleClick?: () => void;
26
+ onItemSelect?: ZDropItemSelectHandler;
27
+ onSearch?: (e: ChangeEvent<HTMLInputElement>) => void;
28
+ buttonContainerRef?: RefObject<HTMLDivElement | null>;
29
+ optionsRef?: RefObject<HTMLLIElement[]>;
30
+ searchInputRef?: RefObject<HTMLInputElement | null>;
31
+ addToRefs?: Function;
32
+ };
33
+ export interface ZDropButtonContentProps {
34
+ children: ReactNode;
35
+ position?: "left" | "right" | "top" | "bottom" | "top left" | "top right" | "bottom left" | "bottom right";
36
+ }
37
+ export interface ZDropButtonToggleProps {
38
+ title?: string | number;
39
+ toggleIcon?: ReactElement;
40
+ toggleClassName?: string;
41
+ children?: ReactNode;
42
+ onButtonToggleClick: () => void;
43
+ }
44
+ export interface ZDropButtonListProps {
45
+ children: ReactNode;
46
+ }
47
+ export type LinkLikeComponent = React.ComponentType<{
48
+ to?: string;
49
+ children?: React.ReactNode;
50
+ }>;
51
+ type LinkAs = "a" | LinkLikeComponent;
52
+ export interface ZDropButtonListItemProps {
53
+ index: number;
54
+ title: string | number;
55
+ Icon?: JSX.Element;
56
+ urlPath?: string;
57
+ className?: string;
58
+ linkAs?: LinkAs;
59
+ isActive?: boolean;
60
+ children?: ReactNode;
61
+ }
62
+ export interface ZDropButtonSearchProps {
63
+ placeholder?: string;
64
+ searchIcon?: ReactElement;
65
+ clearIcon?: ReactElement;
66
+ searchClassName?: string;
67
+ shouldFocusOnOpen?: boolean;
68
+ }
69
+ export {};
@@ -1,5 +1,5 @@
1
1
  interface ClassNames {
2
- [key: string]: boolean;
2
+ [key: string]: boolean | undefined;
3
3
  }
4
4
  export declare const classNames: (...params: (string | ClassNames | undefined)[]) => string;
5
5
  export {};
@@ -0,0 +1,6 @@
1
+ type AvailableSpace = {
2
+ top: number;
3
+ bottom: number;
4
+ };
5
+ export declare const getAvailableSpace: (element: HTMLElement | null) => AvailableSpace;
6
+ export {};
@@ -1,3 +1,5 @@
1
1
  export { default as ZDrop } from "./components/ZDrop";
2
2
  export { ZDropField } from "./components/ZDrop/integrations/react-hook-form/ZDropField";
3
+ export { default as ZDropButton } from "./components/ZDropButton";
3
4
  export type * from "./components/ZDrop/types/zDropTypes";
5
+ export type * from "./components/ZDropButton/types/zDropButtonTypes";