@pixum/combobox 1.6.0 → 1.6.3

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 (34) hide show
  1. package/CHANGELOG.md +620 -595
  2. package/lib/ComboBox.d.ts +5 -5
  3. package/lib/ComboBox.js +76 -105
  4. package/lib/ComboBox.js.map +1 -1
  5. package/lib/ComboboxOptions/Options.d.ts +12 -12
  6. package/lib/ComboboxOptions/Options.js +15 -23
  7. package/lib/ComboboxOptions/Options.js.map +1 -1
  8. package/lib/ComboboxOptions/OptionsGroup.d.ts +13 -13
  9. package/lib/ComboboxOptions/OptionsGroup.js +7 -38
  10. package/lib/ComboboxOptions/OptionsGroup.js.map +1 -1
  11. package/lib/ComboboxOptions/index.d.ts +4 -4
  12. package/lib/ComboboxOptions/index.js +21 -53
  13. package/lib/ComboboxOptions/index.js.map +1 -1
  14. package/lib/helper/calculateListMaxHeight.d.ts +1 -1
  15. package/lib/helper/calculateListMaxHeight.js +7 -11
  16. package/lib/helper/calculateListMaxHeight.js.map +1 -1
  17. package/lib/helper/scrollOptionToViewport.d.ts +1 -1
  18. package/lib/helper/scrollOptionToViewport.js +17 -21
  19. package/lib/helper/scrollOptionToViewport.js.map +1 -1
  20. package/lib/helper/useIsDesktopScreenWidth.d.ts +2 -2
  21. package/lib/helper/useIsDesktopScreenWidth.js +19 -21
  22. package/lib/helper/useIsDesktopScreenWidth.js.map +1 -1
  23. package/lib/index.d.ts +3 -3
  24. package/lib/index.js +3 -22
  25. package/lib/index.js.map +1 -1
  26. package/lib/types.d.ts +34 -34
  27. package/lib/types.js +1 -2
  28. package/package.json +2 -2
  29. package/lib/helper/useIsDesktop.d.ts +0 -1
  30. package/lib/helper/useIsDesktop.js +0 -14
  31. package/lib/helper/useIsDesktop.js.map +0 -1
  32. package/lib/helper/useScreenSize.d.ts +0 -5
  33. package/lib/helper/useScreenSize.js +0 -24
  34. package/lib/helper/useScreenSize.js.map +0 -1
@@ -1,22 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var react_1 = require("react");
4
- var useIsDesktopScreenWidth = function () {
5
- var hasWindowObject = typeof window !== 'undefined';
6
- if (hasWindowObject) {
7
- var _a = (0, react_1.useState)(window.innerWidth), screenWidth = _a[0], setScreenWidth_1 = _a[1];
8
- (0, react_1.useEffect)(function () {
9
- var handleResize = function () {
10
- setScreenWidth_1(window.innerWidth);
11
- };
12
- window.addEventListener('resize', handleResize);
13
- return function () {
14
- window.removeEventListener('resize', handleResize);
15
- };
16
- }, []);
17
- return screenWidth > 960;
18
- }
19
- return false;
20
- };
21
- exports.default = useIsDesktopScreenWidth;
1
+ import { useState, useEffect } from 'react';
2
+ const useIsDesktopScreenWidth = () => {
3
+ const hasWindowObject = typeof window !== 'undefined';
4
+ if (hasWindowObject) {
5
+ const [screenWidth, setScreenWidth] = useState(window.innerWidth);
6
+ useEffect(() => {
7
+ const handleResize = () => {
8
+ setScreenWidth(window.innerWidth);
9
+ };
10
+ window.addEventListener('resize', handleResize);
11
+ return () => {
12
+ window.removeEventListener('resize', handleResize);
13
+ };
14
+ }, []);
15
+ return screenWidth > 960;
16
+ }
17
+ return false;
18
+ };
19
+ export default useIsDesktopScreenWidth;
22
20
  //# sourceMappingURL=useIsDesktopScreenWidth.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIsDesktopScreenWidth.js","sourceRoot":"","sources":["../../src/helper/useIsDesktopScreenWidth.ts"],"names":[],"mappings":";;AAAA,+BAA2C;AAE3C,IAAM,uBAAuB,GAAG;IAC9B,IAAM,eAAe,GAAG,OAAO,MAAM,KAAK,WAAW,CAAA;IAErD,IAAI,eAAe,EAAE;QACb,IAAA,KAAgC,IAAA,gBAAQ,EAAC,MAAM,CAAC,UAAU,CAAC,EAA1D,WAAW,QAAA,EAAE,gBAAc,QAA+B,CAAA;QAEjE,IAAA,iBAAS,EAAC;YACR,IAAM,YAAY,GAAG;gBACnB,gBAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;YACnC,CAAC,CAAA;YAED,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;YAE/C,OAAO;gBACL,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;YACpD,CAAC,CAAA;QACH,CAAC,EAAE,EAAE,CAAC,CAAA;QAEN,OAAO,WAAW,GAAG,GAAG,CAAA;KACzB;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,kBAAe,uBAAuB,CAAA"}
1
+ {"version":3,"file":"useIsDesktopScreenWidth.js","sourceRoot":"","sources":["../../src/helper/useIsDesktopScreenWidth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3C,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACnC,MAAM,eAAe,GAAG,OAAO,MAAM,KAAK,WAAW,CAAA;IAErD,IAAI,eAAe,EAAE;QACnB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;QAEjE,SAAS,CAAC,GAAG,EAAE;YACb,MAAM,YAAY,GAAG,GAAG,EAAE;gBACxB,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;YACnC,CAAC,CAAA;YAED,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;YAE/C,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;YACpD,CAAC,CAAA;QACH,CAAC,EAAE,EAAE,CAAC,CAAA;QAEN,OAAO,WAAW,GAAG,GAAG,CAAA;KACzB;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,eAAe,uBAAuB,CAAA"}
package/lib/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import ComboBox from './ComboBox';
2
- export default ComboBox;
3
- export * from './types';
1
+ import ComboBox from './ComboBox';
2
+ export default ComboBox;
3
+ export * from './types';
package/lib/index.js CHANGED
@@ -1,23 +1,4 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- var __importDefault = (this && this.__importDefault) || function (mod) {
17
- return (mod && mod.__esModule) ? mod : { "default": mod };
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- var ComboBox_1 = __importDefault(require("./ComboBox"));
21
- exports.default = ComboBox_1.default;
22
- __exportStar(require("./types"), exports);
1
+ import ComboBox from './ComboBox';
2
+ export default ComboBox;
3
+ export * from './types';
23
4
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,wDAAiC;AACjC,kBAAe,kBAAQ,CAAA;AACvB,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,eAAe,QAAQ,CAAA;AACvB,cAAc,SAAS,CAAA"}
package/lib/types.d.ts CHANGED
@@ -1,34 +1,34 @@
1
- /// <reference types="react" />
2
- import { LeadingType, MenuItemProps } from '@pixum/menu-item';
3
- import { InputMode } from '@pixum/user-input';
4
- interface ComboBoxOptionsProps {
5
- options: Record<string, ComboBoxOptionProps[]> | ComboBoxOptionProps[];
6
- selectedOption?: string;
7
- onClick?: (value: string) => void;
8
- leadingType?: LeadingType;
9
- optionDetails?: React.ReactNode;
10
- }
11
- interface ComboBoxProps extends ComboBoxOptionsProps {
12
- className?: string;
13
- headline?: string;
14
- helperText?: string;
15
- id?: string;
16
- label?: string;
17
- isOpen: boolean;
18
- setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
19
- onChange?: (value: string) => void;
20
- onOptionItemClick?: (value: string) => void;
21
- onOutsideClick?: () => void;
22
- onClick?: () => void;
23
- onSheetClose?: () => void;
24
- placeholder?: string;
25
- searchPattern?: string;
26
- value?: string;
27
- noResultsText?: string;
28
- inputMode?: InputMode;
29
- withSearch?: boolean;
30
- }
31
- interface ComboBoxOptionProps extends MenuItemProps {
32
- key?: string;
33
- }
34
- export { ComboBoxProps, ComboBoxOptionProps, ComboBoxOptionsProps };
1
+ /// <reference types="react" />
2
+ import { LeadingType, MenuItemProps } from '@pixum/menu-item';
3
+ import { InputMode } from '@pixum/user-input';
4
+ interface ComboBoxOptionsProps {
5
+ options: Record<string, ComboBoxOptionProps[]> | ComboBoxOptionProps[];
6
+ selectedOption?: string;
7
+ onClick?: (value: string) => void;
8
+ leadingType?: LeadingType;
9
+ optionDetails?: React.ReactNode;
10
+ }
11
+ interface ComboBoxProps extends ComboBoxOptionsProps {
12
+ className?: string;
13
+ headline?: string;
14
+ helperText?: string;
15
+ id?: string;
16
+ label?: string;
17
+ isOpen: boolean;
18
+ setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
19
+ onChange?: (value: string) => void;
20
+ onOptionItemClick?: (value: string) => void;
21
+ onOutsideClick?: () => void;
22
+ onClick?: () => void;
23
+ onSheetClose?: () => void;
24
+ placeholder?: string;
25
+ searchPattern?: string;
26
+ value?: string;
27
+ noResultsText?: string;
28
+ inputMode?: InputMode;
29
+ withSearch?: boolean;
30
+ }
31
+ interface ComboBoxOptionProps extends MenuItemProps {
32
+ key?: string;
33
+ }
34
+ export { ComboBoxProps, ComboBoxOptionProps, ComboBoxOptionsProps };
package/lib/types.js CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixum/combobox",
3
- "version": "1.6.0",
3
+ "version": "1.6.3",
4
4
  "main": "lib/index.js",
5
5
  "module": "lib/index.js",
6
6
  "license": "UNLICENSED",
@@ -17,5 +17,5 @@
17
17
  "files": [
18
18
  "lib"
19
19
  ],
20
- "gitHead": "2c1327838107543cdf1c6e32c3f6180cf18a9d9c"
20
+ "gitHead": "e166510eb6d9ce70fbe7dbda8bf6af9c0b79fae0"
21
21
  }
@@ -1 +0,0 @@
1
- export declare const useIsDesktop: () => boolean;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useIsDesktop = void 0;
4
- var react_1 = require("react");
5
- var react_device_detect_1 = require("react-device-detect");
6
- var useIsDesktop = function () {
7
- var _a = (0, react_1.useState)(false), isPageLoaded = _a[0], setPageLoaded = _a[1];
8
- (0, react_1.useEffect)(function () {
9
- setPageLoaded(true);
10
- }, []);
11
- return (0, react_1.useMemo)(function () { return isPageLoaded && react_device_detect_1.isDesktop; }, [react_device_detect_1.isDesktop, isPageLoaded]);
12
- };
13
- exports.useIsDesktop = useIsDesktop;
14
- //# sourceMappingURL=useIsDesktop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useIsDesktop.js","sourceRoot":"","sources":["../../src/helper/useIsDesktop.ts"],"names":[],"mappings":";;;AAAA,+BAAoD;AACpD,2DAA+C;AAExC,IAAM,YAAY,GAAG;IACpB,IAAA,KAAgC,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAA9C,YAAY,QAAA,EAAE,aAAa,QAAmB,CAAA;IAErD,IAAA,iBAAS,EAAC;QACR,aAAa,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,IAAA,eAAO,EAAC,cAAM,OAAA,YAAY,IAAI,+BAAS,EAAzB,CAAyB,EAAE,CAAC,+BAAS,EAAE,YAAY,CAAC,CAAC,CAAA;AAC5E,CAAC,CAAA;AARY,QAAA,YAAY,gBAQxB"}
@@ -1,5 +0,0 @@
1
- declare const useScreenSize: () => {
2
- width: number;
3
- height: number;
4
- };
5
- export default useScreenSize;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var react_1 = require("react");
4
- var useScreenSize = function () {
5
- var _a = (0, react_1.useState)({
6
- width: window.innerWidth,
7
- height: window.innerHeight,
8
- }), screenSize = _a[0], setScreenSize = _a[1];
9
- (0, react_1.useEffect)(function () {
10
- var handleResize = function () {
11
- setScreenSize({
12
- width: window.innerWidth,
13
- height: window.innerHeight,
14
- });
15
- };
16
- window.addEventListener('resize', handleResize);
17
- return function () {
18
- window.removeEventListener('resize', handleResize);
19
- };
20
- }, []);
21
- return screenSize;
22
- };
23
- exports.default = useScreenSize;
24
- //# sourceMappingURL=useScreenSize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useScreenSize.js","sourceRoot":"","sources":["../../src/helper/useScreenSize.ts"],"names":[],"mappings":";;AAAA,+BAA2C;AAE3C,IAAM,aAAa,GAAG;IACd,IAAA,KAA8B,IAAA,gBAAQ,EAAC;QAC3C,KAAK,EAAE,MAAM,CAAC,UAAU;QACxB,MAAM,EAAE,MAAM,CAAC,WAAW;KAC3B,CAAC,EAHK,UAAU,QAAA,EAAE,aAAa,QAG9B,CAAA;IAEF,IAAA,iBAAS,EAAC;QACR,IAAM,YAAY,GAAG;YACnB,aAAa,CAAC;gBACZ,KAAK,EAAE,MAAM,CAAC,UAAU;gBACxB,MAAM,EAAE,MAAM,CAAC,WAAW;aAC3B,CAAC,CAAA;QACJ,CAAC,CAAA;QAED,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QAE/C,OAAO;YACL,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;QACpD,CAAC,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AAED,kBAAe,aAAa,CAAA"}