@os-design-mobile/menu 1.0.101 → 1.0.102
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Menu.d.ts +16 -0
- package/dist/Menu.d.ts.map +1 -0
- package/dist/MenuDivider.d.ts +8 -0
- package/dist/MenuDivider.d.ts.map +1 -0
- package/dist/MenuGroup.d.ts +51 -0
- package/dist/MenuGroup.d.ts.map +1 -0
- package/dist/MenuItem.d.ts +20 -0
- package/dist/MenuItem.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/package.json +11 -10
package/dist/Menu.d.ts
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
2
|
+
import { View } from 'react-native';
|
3
|
+
import { type ModalProps } from '@os-design-mobile/modal';
|
4
|
+
export interface MenuProps extends PropsWithChildren<ModalProps> {
|
5
|
+
/**
|
6
|
+
* Whether the menu closes when the user selects a menu item.
|
7
|
+
* @default true
|
8
|
+
*/
|
9
|
+
closeOnSelect?: boolean;
|
10
|
+
}
|
11
|
+
/**
|
12
|
+
* The dropdown menu.
|
13
|
+
*/
|
14
|
+
declare const Menu: React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<View>>;
|
15
|
+
export default Menu;
|
16
|
+
//# sourceMappingURL=Menu.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../src/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,KAAK,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAOjE,MAAM,WAAW,SAAU,SAAQ,iBAAiB,CAAC,UAAU,CAAC;IAC9D;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAOD;;GAEG;AACH,QAAA,MAAM,IAAI,wEAwCT,CAAC;AAIF,eAAe,IAAI,CAAC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { View, type ViewProps } from 'react-native';
|
2
|
+
export type MenuDividerProps = ViewProps;
|
3
|
+
/**
|
4
|
+
* The divider of menu items.
|
5
|
+
*/
|
6
|
+
declare const MenuDivider: import("react").ForwardRefExoticComponent<ViewProps & import("react").RefAttributes<View>>;
|
7
|
+
export default MenuDivider;
|
8
|
+
//# sourceMappingURL=MenuDivider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuDivider.d.ts","sourceRoot":"","sources":["../src/MenuDivider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC;AASzC;;GAEG;AACH,QAAA,MAAM,WAAW,4FAEf,CAAC;AAIH,eAAe,WAAW,CAAC"}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
2
|
+
import { View, type ViewProps } from 'react-native';
|
3
|
+
interface BaseMenuGroupProps<T> extends PropsWithChildren<ViewProps> {
|
4
|
+
/**
|
5
|
+
* The title of the menu group.
|
6
|
+
* @default undefined
|
7
|
+
*/
|
8
|
+
title?: string;
|
9
|
+
/**
|
10
|
+
* The max number of options that the user can select. Zero means unlimited.
|
11
|
+
* Works only when multiple is true.
|
12
|
+
* @default 0
|
13
|
+
*/
|
14
|
+
maxSelectedItems?: number;
|
15
|
+
/**
|
16
|
+
* Selected menu items.
|
17
|
+
* @default undefined
|
18
|
+
*/
|
19
|
+
value?: T;
|
20
|
+
/**
|
21
|
+
* The default value.
|
22
|
+
* @default undefined
|
23
|
+
*/
|
24
|
+
defaultValue?: T;
|
25
|
+
/**
|
26
|
+
* The change event handler.
|
27
|
+
* @default undefined
|
28
|
+
*/
|
29
|
+
onChange?: (value: T) => void;
|
30
|
+
}
|
31
|
+
interface MenuGroupNotMultipleProps extends BaseMenuGroupProps<string | null> {
|
32
|
+
/**
|
33
|
+
* Is it possible to select multiple values.
|
34
|
+
* @default false
|
35
|
+
*/
|
36
|
+
multiple?: false;
|
37
|
+
}
|
38
|
+
interface MenuGroupMultipleProps extends BaseMenuGroupProps<string[]> {
|
39
|
+
/**
|
40
|
+
* Is it possible to select multiple values.
|
41
|
+
* @default false
|
42
|
+
*/
|
43
|
+
multiple: true;
|
44
|
+
}
|
45
|
+
export type MenuGroupProps = MenuGroupNotMultipleProps | MenuGroupMultipleProps;
|
46
|
+
/**
|
47
|
+
* The group of menu items.
|
48
|
+
*/
|
49
|
+
declare const MenuGroup: React.ForwardRefExoticComponent<MenuGroupProps & React.RefAttributes<View>>;
|
50
|
+
export default MenuGroup;
|
51
|
+
//# sourceMappingURL=MenuGroup.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuGroup.d.ts","sourceRoot":"","sources":["../src/MenuGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAEZ,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,UAAU,kBAAkB,CAAC,CAAC,CAAE,SAAQ,iBAAiB,CAAC,SAAS,CAAC;IAClE;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,CAAC,CAAC;IACV;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B;AACD,UAAU,yBAA0B,SAAQ,kBAAkB,CAAC,MAAM,GAAG,IAAI,CAAC;IAC3E;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AACD,UAAU,sBAAuB,SAAQ,kBAAkB,CAAC,MAAM,EAAE,CAAC;IACnE;;;OAGG;IACH,QAAQ,EAAE,IAAI,CAAC;CAChB;AACD,MAAM,MAAM,cAAc,GAAG,yBAAyB,GAAG,sBAAsB,CAAC;AAUhF;;GAEG;AACH,QAAA,MAAM,SAAS,6EA4Fd,CAAC;AAIF,eAAe,SAAS,CAAC"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
2
|
+
import { type ButtonProps } from '@os-design-mobile/button';
|
3
|
+
export interface MenuItemProps extends PropsWithChildren<Omit<ButtonProps, 'type' | 'size'>> {
|
4
|
+
/**
|
5
|
+
* Whether the menu item is selected.
|
6
|
+
* @default false
|
7
|
+
*/
|
8
|
+
selected?: boolean;
|
9
|
+
/**
|
10
|
+
* The value of the menu item.
|
11
|
+
* @default undefined
|
12
|
+
*/
|
13
|
+
value?: string;
|
14
|
+
}
|
15
|
+
/**
|
16
|
+
* The base menu item.
|
17
|
+
*/
|
18
|
+
declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<import("react").ForwardRefExoticComponent<Omit<import("react-native-gesture-handler").RectButtonProps, "innerRef"> & import("react").RefAttributes<any>>>>;
|
19
|
+
export default MenuItem;
|
20
|
+
//# sourceMappingURL=MenuItem.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../src/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EAKvB,MAAM,OAAO,CAAC;AAGf,OAAe,EAAE,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMpE,MAAM,WAAW,aACf,SAAQ,iBAAiB,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC7D;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAYD;;GAEG;AACH,QAAA,MAAM,QAAQ,oPAiFb,CAAC;AAIF,eAAe,QAAQ,CAAC"}
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
export { default as Menu } from './Menu';
|
2
|
+
export { default as MenuDivider } from './MenuDivider';
|
3
|
+
export { default as MenuGroup } from './MenuGroup';
|
4
|
+
export { default as MenuItem } from './MenuItem';
|
5
|
+
export * from './Menu';
|
6
|
+
export * from './MenuDivider';
|
7
|
+
export * from './MenuGroup';
|
8
|
+
export * from './MenuItem';
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjD,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
package/package.json
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@os-design-mobile/menu",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.102",
|
4
4
|
"license": "UNLICENSED",
|
5
5
|
"repository": "git@gitlab.com:os-team/libs/os-design-mobile.git",
|
6
6
|
"type": "module",
|
7
|
-
"main": "dist/index.js",
|
8
|
-
"types": "dist/index.d.ts",
|
7
|
+
"main": "./dist/index.js",
|
8
|
+
"types": "./dist/index.d.ts",
|
9
|
+
"react-native": "./src/index.ts",
|
9
10
|
"files": [
|
10
11
|
"dist",
|
11
12
|
"src",
|
@@ -20,7 +21,7 @@
|
|
20
21
|
"scripts": {
|
21
22
|
"clean": "rimraf dist",
|
22
23
|
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx --out-dir dist --source-maps",
|
23
|
-
"build:types": "tsc --
|
24
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist",
|
24
25
|
"build": "yarn clean && npm-run-all 'build:*'",
|
25
26
|
"ncu": "ncu -u '/^(?!(react|react-native)$).*$/'"
|
26
27
|
},
|
@@ -28,15 +29,15 @@
|
|
28
29
|
"access": "public"
|
29
30
|
},
|
30
31
|
"dependencies": {
|
31
|
-
"@os-design-mobile/button": "^1.0.
|
32
|
-
"@os-design-mobile/icons": "^1.0.
|
33
|
-
"@os-design-mobile/modal": "^1.0.
|
34
|
-
"@os-design-mobile/theming": "^1.0.
|
32
|
+
"@os-design-mobile/button": "^1.0.70",
|
33
|
+
"@os-design-mobile/icons": "^1.0.66",
|
34
|
+
"@os-design-mobile/modal": "^1.0.106",
|
35
|
+
"@os-design-mobile/theming": "^1.0.48",
|
35
36
|
"@os-design/menu-utils": "^1.0.25",
|
36
37
|
"@os-design/use-forwarded-state": "^1.0.27"
|
37
38
|
},
|
38
39
|
"devDependencies": {
|
39
|
-
"@os-design-mobile/text": "^1.0.
|
40
|
+
"@os-design-mobile/text": "^1.0.64"
|
40
41
|
},
|
41
42
|
"peerDependencies": {
|
42
43
|
"@emotion/native": ">=11",
|
@@ -48,5 +49,5 @@
|
|
48
49
|
"react-native-safe-area-context": ">=3",
|
49
50
|
"react-native-svg": ">=12"
|
50
51
|
},
|
51
|
-
"gitHead": "
|
52
|
+
"gitHead": "1de2f821ec10cf3084e3d92df85e74d5632ab005"
|
52
53
|
}
|