@pixum/combobox 1.6.0 → 1.6.4

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.
@@ -1,22 +1,22 @@
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
+ "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;
22
22
  //# sourceMappingURL=useIsDesktopScreenWidth.js.map
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,23 @@
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
+ "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);
23
23
  //# sourceMappingURL=index.js.map
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,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# 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.4",
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": "5b77d0c36b3bad7aef4ff5286195490b512b44de"
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"}