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