@vaadin/react-components 25.3.0-alpha7 → 25.3.0-alpha8
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.
- package/ContextMenu.d.ts +11 -7
- package/ContextMenu.d.ts.map +1 -1
- package/ContextMenu.js +1 -1
- package/ContextMenu.js.map +2 -2
- package/ContextMenuItem.d.ts +2 -0
- package/ContextMenuItem.d.ts.map +1 -0
- package/ContextMenuItem.js +2 -0
- package/ContextMenuItem.js.map +7 -0
- package/ContextMenuListBox.d.ts +2 -0
- package/ContextMenuListBox.d.ts.map +1 -0
- package/ContextMenuListBox.js +2 -0
- package/ContextMenuListBox.js.map +7 -0
- package/package.json +75 -65
- package/utils/createComponent.js +1 -1
- package/utils/createComponent.js.map +1 -1
package/ContextMenu.d.ts
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { type ComponentType, type ReactElement, type RefAttributes } from 'react';
|
|
2
|
-
import { type ContextMenuRendererContext, type ContextMenuElement, type ContextMenuProps as _ContextMenuProps, type
|
|
2
|
+
import { type ContextMenuRendererContext, type ContextMenuElement, type ContextMenuProps as _ContextMenuProps, type ContextMenuItemData as _ContextMenuItemData } from './generated/ContextMenu.js';
|
|
3
3
|
import { type ReactContextRendererProps } from './renderers/useContextRenderer.js';
|
|
4
4
|
export * from './generated/ContextMenu.js';
|
|
5
5
|
export type ContextMenuReactRendererProps = ReactContextRendererProps<ContextMenuRendererContext, ContextMenuElement>;
|
|
6
|
-
export type
|
|
6
|
+
export type ContextMenuItemData<TItemData extends object = object> = Omit<_ContextMenuItemData<TItemData>, 'component' | 'children'> & {
|
|
7
7
|
component?: ReactElement | string;
|
|
8
|
-
children?: Array<
|
|
8
|
+
children?: Array<ContextMenuItemData<TItemData>>;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use `ContextMenuItemData` instead.
|
|
12
|
+
*/
|
|
13
|
+
export type ContextMenuItem<TItemData extends object = object> = ContextMenuItemData<TItemData>;
|
|
14
|
+
export type ContextMenuItemSelectedEvent<TItem extends ContextMenuItemData = ContextMenuItemData> = CustomEvent<{
|
|
15
|
+
value: ContextMenuItemData<TItem>;
|
|
12
16
|
}>;
|
|
13
|
-
export type ContextMenuProps<TItem extends
|
|
17
|
+
export type ContextMenuProps<TItem extends ContextMenuItemData = ContextMenuItemData> = Partial<Omit<_ContextMenuProps, 'opened' | 'renderer' | 'items' | 'onItemSelected'>> & Readonly<{
|
|
14
18
|
renderer?: ComponentType<ContextMenuReactRendererProps> | null;
|
|
15
19
|
items?: Array<TItem>;
|
|
16
20
|
onItemSelected?: (event: ContextMenuItemSelectedEvent<TItem>) => void;
|
|
17
21
|
}>;
|
|
18
|
-
declare const ForwardedContextMenu: <TItem extends
|
|
22
|
+
declare const ForwardedContextMenu: <TItem extends ContextMenuItemData = ContextMenuItemData>(props: ContextMenuProps<TItem> & RefAttributes<ContextMenuElement>) => ReactElement | null;
|
|
19
23
|
export { ForwardedContextMenu as ContextMenu };
|
|
20
24
|
//# sourceMappingURL=ContextMenu.d.ts.map
|
package/ContextMenu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["src/ContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAiC,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AACjH,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,IAAI,iBAAiB,EAC1C,KAAK,
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["src/ContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAiC,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AACjH,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,IAAI,iBAAiB,EAC1C,KAAK,mBAAmB,IAAI,oBAAoB,EACjD,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,yBAAyB,EAAsB,MAAM,mCAAmC,CAAC;AAGvG,cAAc,4BAA4B,CAAC;AAE3C,MAAM,MAAM,6BAA6B,GAAG,yBAAyB,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;AAEtH,MAAM,MAAM,mBAAmB,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,CACvE,oBAAoB,CAAC,SAAS,CAAC,EAC/B,WAAW,GAAG,UAAU,CACzB,GAAG;IACF,SAAS,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAElC,QAAQ,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC;CAClD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,IAAI,mBAAmB,CAAC,SAAS,CAAC,CAAC;AAEhG,MAAM,MAAM,4BAA4B,CAAC,KAAK,SAAS,mBAAmB,GAAG,mBAAmB,IAAI,WAAW,CAAC;IAC9G,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;CACnC,CAAC,CAAC;AAKH,MAAM,MAAM,gBAAgB,CAAC,KAAK,SAAS,mBAAmB,GAAG,mBAAmB,IAAI,OAAO,CAC7F,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,gBAAgB,CAAC,CAC5E,GACC,QAAQ,CAAC;IACP,QAAQ,CAAC,EAAE,aAAa,CAAC,6BAA6B,CAAC,GAAG,IAAI,CAAC;IAE/D,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAErB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,4BAA4B,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;CACvE,CAAC,CAAC;AAmCL,QAAA,MAAM,oBAAoB,EAA8B,CAAC,KAAK,SAAS,mBAAmB,GAAG,mBAAmB,EAC9G,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,kBAAkB,CAAC,KAC/D,YAAY,GAAG,IAAI,CAAC;AAEzB,OAAO,EAAE,oBAAoB,IAAI,WAAW,EAAE,CAAC"}
|
package/ContextMenu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"@vaadin/context-menu/vaadin-context-menu.js";import{forwardRef as l}from"react";import{ContextMenu as
|
|
1
|
+
export*from"@vaadin/context-menu/vaadin-context-menu.js";import{forwardRef as l}from"react";import{ContextMenu as p}from"@vaadin/context-menu/vaadin-context-menu.js";import*as C from"react";import{createComponent as s}from"./utils/createComponent.js";var d={onCloseAllMenus:"close-all-menus",onClosed:"closed",onItemSelected:"item-selected",onItemsOutsideClick:"items-outside-click",onOpenedChanged:"opened-changed"},o=s({elementClass:p,events:d,react:C,tagName:"vaadin-context-menu"});import{useContextRenderer as M}from"./renderers/useContextRenderer.js";import{getOriginalItem as c,mapItemsWithComponents as I}from"./utils/mapItemsWithComponents.js";import{jsxs as E}from"react/jsx-runtime";function i(e,a){let[m,r]=M(e.renderer),[u,x]=I(e.items,"vaadin-context-menu-item"),n=e.onItemSelected;return E(o,{...e,ref:a,renderer:r,items:x,onItemSelected:n?t=>{Object.assign(t.detail,{value:c(t.detail.value)}),n(t)}:void 0,children:[e.children,m,u]})}var S=l(i);export{S as ContextMenu,p as ContextMenuElement};
|
|
2
2
|
//# sourceMappingURL=ContextMenu.js.map
|
package/ContextMenu.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["src/ContextMenu.tsx", "src/generated/ContextMenu.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"@vaadin/context-menu/vaadin-context-menu.js\";\nimport { type ComponentType, type ForwardedRef, forwardRef, type ReactElement, type RefAttributes } from 'react';\nimport {\n ContextMenu as _ContextMenu,\n type ContextMenuRendererContext,\n type ContextMenuElement,\n type ContextMenuProps as _ContextMenuProps,\n type
|
|
5
|
-
"mappings": "AAAA,WAAc,8CACd,OAAgD,cAAAA,MAAyD,QCAzG,OAAS,eAAeC,MAA6E,8CACrG,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BASxD,IAAMC,EAAS,CAAE,gBAAiB,kBAAmB,SAAU,SAAU,eAAgB,gBAAiB,oBAAqB,sBAAuB,gBAAiB,gBAAiB,EAE3KC,EAAcC,EAAgB,CACvC,aAAcC,EAAoB,OAAAH,EAAQ,MAAOI,EAAO,QAAS,qBACrE,CAAC,EDPD,OAAyC,sBAAAC,MAA0B,oCACnE,OAAS,mBAAAC,EAAiB,0BAAAC,MAA8B,
|
|
4
|
+
"sourcesContent": ["export * from \"@vaadin/context-menu/vaadin-context-menu.js\";\nimport { type ComponentType, type ForwardedRef, forwardRef, type ReactElement, type RefAttributes } from 'react';\nimport {\n ContextMenu as _ContextMenu,\n type ContextMenuRendererContext,\n type ContextMenuElement,\n type ContextMenuProps as _ContextMenuProps,\n type ContextMenuItemData as _ContextMenuItemData,\n} from './generated/ContextMenu.js';\nimport { type ReactContextRendererProps, useContextRenderer } from './renderers/useContextRenderer.js';\nimport { getOriginalItem, mapItemsWithComponents } from './utils/mapItemsWithComponents.js';\n\nexport * from './generated/ContextMenu.js';\n\nexport type ContextMenuReactRendererProps = ReactContextRendererProps<ContextMenuRendererContext, ContextMenuElement>;\n\nexport type ContextMenuItemData<TItemData extends object = object> = Omit<\n _ContextMenuItemData<TItemData>,\n 'component' | 'children'\n> & {\n component?: ReactElement | string;\n\n children?: Array<ContextMenuItemData<TItemData>>;\n};\n\n/**\n * @deprecated Use `ContextMenuItemData` instead.\n */\nexport type ContextMenuItem<TItemData extends object = object> = ContextMenuItemData<TItemData>;\n\nexport type ContextMenuItemSelectedEvent<TItem extends ContextMenuItemData = ContextMenuItemData> = CustomEvent<{\n value: ContextMenuItemData<TItem>;\n}>;\n\n// The 'opened' property is omitted because it is readonly in the web component.\n// So you cannot set it up manually, only read from the component.\n// For changing the property, use specific methods of the component.\nexport type ContextMenuProps<TItem extends ContextMenuItemData = ContextMenuItemData> = Partial<\n Omit<_ContextMenuProps, 'opened' | 'renderer' | 'items' | 'onItemSelected'>\n> &\n Readonly<{\n renderer?: ComponentType<ContextMenuReactRendererProps> | null;\n\n items?: Array<TItem>;\n\n onItemSelected?: (event: ContextMenuItemSelectedEvent<TItem>) => void;\n }>;\n\nfunction ContextMenu<TItem extends ContextMenuItemData = ContextMenuItemData>(\n props: ContextMenuProps<TItem>,\n ref: ForwardedRef<ContextMenuElement>,\n): ReactElement | null {\n const [portals, renderer] = useContextRenderer(props.renderer);\n const [itemPortals, webComponentItems] = mapItemsWithComponents(props.items, 'vaadin-context-menu-item');\n\n const onItemSelected = props.onItemSelected;\n const mappedOnItemSelected = onItemSelected\n ? (event: CustomEvent<{ value: _ContextMenuItemData }>) => {\n // Replace the mapped web component item with the original item\n Object.assign(event.detail, {\n value: getOriginalItem(event.detail.value),\n });\n\n onItemSelected(event as ContextMenuItemSelectedEvent<TItem>);\n }\n : undefined;\n return (\n <_ContextMenu\n {...props}\n ref={ref}\n renderer={renderer}\n items={webComponentItems}\n onItemSelected={mappedOnItemSelected}\n >\n {props.children}\n {portals}\n {itemPortals}\n </_ContextMenu>\n );\n}\n\nconst ForwardedContextMenu = forwardRef(ContextMenu) as <TItem extends ContextMenuItemData = ContextMenuItemData>(\n props: ContextMenuProps<TItem> & RefAttributes<ContextMenuElement>,\n) => ReactElement | null;\n\nexport { ForwardedContextMenu as ContextMenu };\n", "import type { EventName } from \"@lit/react\";\nimport { ContextMenu as ContextMenuElement, type ContextMenuEventMap as _ContextMenuEventMap, } from \"@vaadin/context-menu/vaadin-context-menu.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { ContextMenuElement, };\nexport type ContextMenuEventMap = Readonly<{\n onCloseAllMenus: EventName<_ContextMenuEventMap[\"close-all-menus\"]>;\n onClosed: EventName<_ContextMenuEventMap[\"closed\"]>;\n onItemSelected: EventName<_ContextMenuEventMap[\"item-selected\"]>;\n onItemsOutsideClick: EventName<_ContextMenuEventMap[\"items-outside-click\"]>;\n onOpenedChanged: EventName<_ContextMenuEventMap[\"opened-changed\"]>;\n}>;\nconst events = { onCloseAllMenus: \"close-all-menus\", onClosed: \"closed\", onItemSelected: \"item-selected\", onItemsOutsideClick: \"items-outside-click\", onOpenedChanged: \"opened-changed\" } as ContextMenuEventMap;\nexport type ContextMenuProps = WebComponentProps<ContextMenuElement, ContextMenuEventMap>;\nexport const ContextMenu = createComponent({\n elementClass: ContextMenuElement, events, react: React, tagName: \"vaadin-context-menu\"\n});\n"],
|
|
5
|
+
"mappings": "AAAA,WAAc,8CACd,OAAgD,cAAAA,MAAyD,QCAzG,OAAS,eAAeC,MAA6E,8CACrG,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BASxD,IAAMC,EAAS,CAAE,gBAAiB,kBAAmB,SAAU,SAAU,eAAgB,gBAAiB,oBAAqB,sBAAuB,gBAAiB,gBAAiB,EAE3KC,EAAcC,EAAgB,CACvC,aAAcC,EAAoB,OAAAH,EAAQ,MAAOI,EAAO,QAAS,qBACrE,CAAC,EDPD,OAAyC,sBAAAC,MAA0B,oCACnE,OAAS,mBAAAC,EAAiB,0BAAAC,MAA8B,oCAyDpD,eAAAC,MAAA,oBAnBJ,SAASC,EACPC,EACAC,EACqB,CACrB,GAAM,CAACC,EAASC,CAAQ,EAAIR,EAAmBK,EAAM,QAAQ,EACvD,CAACI,EAAaC,CAAiB,EAAIR,EAAuBG,EAAM,MAAO,0BAA0B,EAEjGM,EAAiBN,EAAM,eAW7B,OACEF,EAACC,EAAA,CACE,GAAGC,EACJ,IAAKC,EACL,SAAUE,EACV,MAAOE,EACP,eAhByBC,EACxBC,GAAwD,CAEvD,OAAO,OAAOA,EAAM,OAAQ,CAC1B,MAAOX,EAAgBW,EAAM,OAAO,KAAK,CAC3C,CAAC,EAEDD,EAAeC,CAA4C,CAC7D,EACA,OASC,UAAAP,EAAM,SACNE,EACAE,GACH,CAEJ,CAEA,IAAMI,EAAuBC,EAAWV,CAAW",
|
|
6
6
|
"names": ["forwardRef", "ContextMenuElement", "React", "createComponent", "events", "ContextMenu", "createComponent", "ContextMenuElement", "React", "useContextRenderer", "getOriginalItem", "mapItemsWithComponents", "jsxs", "ContextMenu", "props", "ref", "portals", "renderer", "itemPortals", "webComponentItems", "onItemSelected", "event", "ForwardedContextMenu", "forwardRef"]
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenuItem.d.ts","sourceRoot":"","sources":["src/ContextMenuItem.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export*from"@vaadin/context-menu/vaadin-context-menu-item.js";import{ContextMenuItem as e}from"@vaadin/context-menu/vaadin-context-menu-item.js";import*as t from"react";import{createComponent as o}from"./utils/createComponent.js";var n={},r=o({elementClass:e,events:n,react:t,tagName:"vaadin-context-menu-item"});export{r as ContextMenuItem,e as ContextMenuItemElement};
|
|
2
|
+
//# sourceMappingURL=ContextMenuItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/ContextMenuItem.ts", "src/generated/ContextMenuItem.ts"],
|
|
4
|
+
"sourcesContent": ["export * from \"@vaadin/context-menu/vaadin-context-menu-item.js\";\nexport * from './generated/ContextMenuItem.js';\n", "import type {} from \"@lit/react\";\nimport { ContextMenuItem as ContextMenuItemElement, } from \"@vaadin/context-menu/vaadin-context-menu-item.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { ContextMenuItemElement, };\nexport type ContextMenuItemEventMap = Readonly<{}>;\nconst events = {} as ContextMenuItemEventMap;\nexport type ContextMenuItemProps = WebComponentProps<ContextMenuItemElement, ContextMenuItemEventMap>;\nexport const ContextMenuItem = createComponent({\n elementClass: ContextMenuItemElement, events, react: React, tagName: \"vaadin-context-menu-item\"\n});\n"],
|
|
5
|
+
"mappings": "AAAA,WAAc,mDCCd,OAAS,mBAAmBA,MAA+B,mDAC3D,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BAGxD,IAAMC,EAAS,CAAC,EAEHC,EAAkBC,EAAgB,CAC3C,aAAcC,EAAwB,OAAAH,EAAQ,MAAOI,EAAO,QAAS,0BACzE,CAAC",
|
|
6
|
+
"names": ["ContextMenuItemElement", "React", "createComponent", "events", "ContextMenuItem", "createComponent", "ContextMenuItemElement", "React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenuListBox.d.ts","sourceRoot":"","sources":["src/ContextMenuListBox.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export*from"@vaadin/context-menu/vaadin-context-menu-list-box.js";import{ContextMenuListBox as t}from"@vaadin/context-menu/vaadin-context-menu-list-box.js";import*as e from"react";import{createComponent as o}from"./utils/createComponent.js";var n={},r=o({elementClass:t,events:n,react:e,tagName:"vaadin-context-menu-list-box"});export{r as ContextMenuListBox,t as ContextMenuListBoxElement};
|
|
2
|
+
//# sourceMappingURL=ContextMenuListBox.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/ContextMenuListBox.ts", "src/generated/ContextMenuListBox.ts"],
|
|
4
|
+
"sourcesContent": ["export * from \"@vaadin/context-menu/vaadin-context-menu-list-box.js\";\nexport * from './generated/ContextMenuListBox.js';\n", "import type {} from \"@lit/react\";\nimport { ContextMenuListBox as ContextMenuListBoxElement, } from \"@vaadin/context-menu/vaadin-context-menu-list-box.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { ContextMenuListBoxElement, };\nexport type ContextMenuListBoxEventMap = Readonly<{}>;\nconst events = {} as ContextMenuListBoxEventMap;\nexport type ContextMenuListBoxProps = WebComponentProps<ContextMenuListBoxElement, ContextMenuListBoxEventMap>;\nexport const ContextMenuListBox = createComponent({\n elementClass: ContextMenuListBoxElement, events, react: React, tagName: \"vaadin-context-menu-list-box\"\n});\n"],
|
|
5
|
+
"mappings": "AAAA,WAAc,uDCCd,OAAS,sBAAsBA,MAAkC,uDACjE,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BAGxD,IAAMC,EAAS,CAAC,EAEHC,EAAqBC,EAAgB,CAC9C,aAAcC,EAA2B,OAAAH,EAAQ,MAAOI,EAAO,QAAS,8BAC5E,CAAC",
|
|
6
|
+
"names": ["ContextMenuListBoxElement", "React", "createComponent", "events", "ContextMenuListBox", "createComponent", "ContextMenuListBoxElement", "React"]
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/react-components",
|
|
3
|
-
"version": "25.3.0-
|
|
3
|
+
"version": "25.3.0-alpha8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -27,70 +27,70 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@lit/react": "^1.0.7",
|
|
30
|
-
"@vaadin/a11y-base": "25.3.0-
|
|
31
|
-
"@vaadin/accordion": "25.3.0-
|
|
32
|
-
"@vaadin/app-layout": "25.3.0-
|
|
33
|
-
"@vaadin/avatar": "25.3.0-
|
|
34
|
-
"@vaadin/avatar-group": "25.3.0-
|
|
35
|
-
"@vaadin/badge": "25.3.0-
|
|
36
|
-
"@vaadin/breadcrumbs": "25.3.0-
|
|
37
|
-
"@vaadin/button": "25.3.0-
|
|
38
|
-
"@vaadin/card": "25.3.0-
|
|
39
|
-
"@vaadin/checkbox": "25.3.0-
|
|
40
|
-
"@vaadin/checkbox-group": "25.3.0-
|
|
41
|
-
"@vaadin/combo-box": "25.3.0-
|
|
42
|
-
"@vaadin/component-base": "25.3.0-
|
|
43
|
-
"@vaadin/confirm-dialog": "25.3.0-
|
|
44
|
-
"@vaadin/context-menu": "25.3.0-
|
|
45
|
-
"@vaadin/custom-field": "25.3.0-
|
|
46
|
-
"@vaadin/date-picker": "25.3.0-
|
|
47
|
-
"@vaadin/date-time-picker": "25.3.0-
|
|
48
|
-
"@vaadin/details": "25.3.0-
|
|
49
|
-
"@vaadin/dialog": "25.3.0-
|
|
50
|
-
"@vaadin/email-field": "25.3.0-
|
|
51
|
-
"@vaadin/field-base": "25.3.0-
|
|
52
|
-
"@vaadin/field-highlighter": "25.3.0-
|
|
53
|
-
"@vaadin/form-layout": "25.3.0-
|
|
54
|
-
"@vaadin/grid": "25.3.0-
|
|
55
|
-
"@vaadin/horizontal-layout": "25.3.0-
|
|
56
|
-
"@vaadin/icon": "25.3.0-
|
|
57
|
-
"@vaadin/icons": "25.3.0-
|
|
58
|
-
"@vaadin/input-container": "25.3.0-
|
|
59
|
-
"@vaadin/integer-field": "25.3.0-
|
|
60
|
-
"@vaadin/item": "25.3.0-
|
|
61
|
-
"@vaadin/list-box": "25.3.0-
|
|
62
|
-
"@vaadin/lit-renderer": "25.3.0-
|
|
63
|
-
"@vaadin/login": "25.3.0-
|
|
64
|
-
"@vaadin/markdown": "25.3.0-
|
|
65
|
-
"@vaadin/master-detail-layout": "25.3.0-
|
|
66
|
-
"@vaadin/menu-bar": "25.3.0-
|
|
67
|
-
"@vaadin/message-input": "25.3.0-
|
|
68
|
-
"@vaadin/message-list": "25.3.0-
|
|
69
|
-
"@vaadin/multi-select-combo-box": "25.3.0-
|
|
70
|
-
"@vaadin/notification": "25.3.0-
|
|
71
|
-
"@vaadin/number-field": "25.3.0-
|
|
72
|
-
"@vaadin/overlay": "25.3.0-
|
|
73
|
-
"@vaadin/password-field": "25.3.0-
|
|
74
|
-
"@vaadin/popover": "25.3.0-
|
|
75
|
-
"@vaadin/progress-bar": "25.3.0-
|
|
76
|
-
"@vaadin/radio-group": "25.3.0-
|
|
77
|
-
"@vaadin/scroller": "25.3.0-
|
|
78
|
-
"@vaadin/select": "25.3.0-
|
|
79
|
-
"@vaadin/side-nav": "25.3.0-
|
|
80
|
-
"@vaadin/slider": "25.3.0-
|
|
81
|
-
"@vaadin/split-layout": "25.3.0-
|
|
82
|
-
"@vaadin/switch": "25.3.0-
|
|
83
|
-
"@vaadin/tabs": "25.3.0-
|
|
84
|
-
"@vaadin/tabsheet": "25.3.0-
|
|
85
|
-
"@vaadin/text-area": "25.3.0-
|
|
86
|
-
"@vaadin/text-field": "25.3.0-
|
|
87
|
-
"@vaadin/time-picker": "25.3.0-
|
|
88
|
-
"@vaadin/tooltip": "25.3.0-
|
|
89
|
-
"@vaadin/upload": "25.3.0-
|
|
90
|
-
"@vaadin/vaadin-lumo-styles": "25.3.0-
|
|
91
|
-
"@vaadin/vaadin-themable-mixin": "25.3.0-
|
|
92
|
-
"@vaadin/vertical-layout": "25.3.0-
|
|
93
|
-
"@vaadin/virtual-list": "25.3.0-
|
|
30
|
+
"@vaadin/a11y-base": "25.3.0-alpha8",
|
|
31
|
+
"@vaadin/accordion": "25.3.0-alpha8",
|
|
32
|
+
"@vaadin/app-layout": "25.3.0-alpha8",
|
|
33
|
+
"@vaadin/avatar": "25.3.0-alpha8",
|
|
34
|
+
"@vaadin/avatar-group": "25.3.0-alpha8",
|
|
35
|
+
"@vaadin/badge": "25.3.0-alpha8",
|
|
36
|
+
"@vaadin/breadcrumbs": "25.3.0-alpha8",
|
|
37
|
+
"@vaadin/button": "25.3.0-alpha8",
|
|
38
|
+
"@vaadin/card": "25.3.0-alpha8",
|
|
39
|
+
"@vaadin/checkbox": "25.3.0-alpha8",
|
|
40
|
+
"@vaadin/checkbox-group": "25.3.0-alpha8",
|
|
41
|
+
"@vaadin/combo-box": "25.3.0-alpha8",
|
|
42
|
+
"@vaadin/component-base": "25.3.0-alpha8",
|
|
43
|
+
"@vaadin/confirm-dialog": "25.3.0-alpha8",
|
|
44
|
+
"@vaadin/context-menu": "25.3.0-alpha8",
|
|
45
|
+
"@vaadin/custom-field": "25.3.0-alpha8",
|
|
46
|
+
"@vaadin/date-picker": "25.3.0-alpha8",
|
|
47
|
+
"@vaadin/date-time-picker": "25.3.0-alpha8",
|
|
48
|
+
"@vaadin/details": "25.3.0-alpha8",
|
|
49
|
+
"@vaadin/dialog": "25.3.0-alpha8",
|
|
50
|
+
"@vaadin/email-field": "25.3.0-alpha8",
|
|
51
|
+
"@vaadin/field-base": "25.3.0-alpha8",
|
|
52
|
+
"@vaadin/field-highlighter": "25.3.0-alpha8",
|
|
53
|
+
"@vaadin/form-layout": "25.3.0-alpha8",
|
|
54
|
+
"@vaadin/grid": "25.3.0-alpha8",
|
|
55
|
+
"@vaadin/horizontal-layout": "25.3.0-alpha8",
|
|
56
|
+
"@vaadin/icon": "25.3.0-alpha8",
|
|
57
|
+
"@vaadin/icons": "25.3.0-alpha8",
|
|
58
|
+
"@vaadin/input-container": "25.3.0-alpha8",
|
|
59
|
+
"@vaadin/integer-field": "25.3.0-alpha8",
|
|
60
|
+
"@vaadin/item": "25.3.0-alpha8",
|
|
61
|
+
"@vaadin/list-box": "25.3.0-alpha8",
|
|
62
|
+
"@vaadin/lit-renderer": "25.3.0-alpha8",
|
|
63
|
+
"@vaadin/login": "25.3.0-alpha8",
|
|
64
|
+
"@vaadin/markdown": "25.3.0-alpha8",
|
|
65
|
+
"@vaadin/master-detail-layout": "25.3.0-alpha8",
|
|
66
|
+
"@vaadin/menu-bar": "25.3.0-alpha8",
|
|
67
|
+
"@vaadin/message-input": "25.3.0-alpha8",
|
|
68
|
+
"@vaadin/message-list": "25.3.0-alpha8",
|
|
69
|
+
"@vaadin/multi-select-combo-box": "25.3.0-alpha8",
|
|
70
|
+
"@vaadin/notification": "25.3.0-alpha8",
|
|
71
|
+
"@vaadin/number-field": "25.3.0-alpha8",
|
|
72
|
+
"@vaadin/overlay": "25.3.0-alpha8",
|
|
73
|
+
"@vaadin/password-field": "25.3.0-alpha8",
|
|
74
|
+
"@vaadin/popover": "25.3.0-alpha8",
|
|
75
|
+
"@vaadin/progress-bar": "25.3.0-alpha8",
|
|
76
|
+
"@vaadin/radio-group": "25.3.0-alpha8",
|
|
77
|
+
"@vaadin/scroller": "25.3.0-alpha8",
|
|
78
|
+
"@vaadin/select": "25.3.0-alpha8",
|
|
79
|
+
"@vaadin/side-nav": "25.3.0-alpha8",
|
|
80
|
+
"@vaadin/slider": "25.3.0-alpha8",
|
|
81
|
+
"@vaadin/split-layout": "25.3.0-alpha8",
|
|
82
|
+
"@vaadin/switch": "25.3.0-alpha8",
|
|
83
|
+
"@vaadin/tabs": "25.3.0-alpha8",
|
|
84
|
+
"@vaadin/tabsheet": "25.3.0-alpha8",
|
|
85
|
+
"@vaadin/text-area": "25.3.0-alpha8",
|
|
86
|
+
"@vaadin/text-field": "25.3.0-alpha8",
|
|
87
|
+
"@vaadin/time-picker": "25.3.0-alpha8",
|
|
88
|
+
"@vaadin/tooltip": "25.3.0-alpha8",
|
|
89
|
+
"@vaadin/upload": "25.3.0-alpha8",
|
|
90
|
+
"@vaadin/vaadin-lumo-styles": "25.3.0-alpha8",
|
|
91
|
+
"@vaadin/vaadin-themable-mixin": "25.3.0-alpha8",
|
|
92
|
+
"@vaadin/vertical-layout": "25.3.0-alpha8",
|
|
93
|
+
"@vaadin/virtual-list": "25.3.0-alpha8"
|
|
94
94
|
},
|
|
95
95
|
"author": "Vaadin Ltd.",
|
|
96
96
|
"license": "Apache-2.0",
|
|
@@ -189,6 +189,14 @@
|
|
|
189
189
|
"types": "./ContextMenu.d.ts",
|
|
190
190
|
"default": "./ContextMenu.js"
|
|
191
191
|
},
|
|
192
|
+
"./ContextMenuItem.js": {
|
|
193
|
+
"types": "./ContextMenuItem.d.ts",
|
|
194
|
+
"default": "./ContextMenuItem.js"
|
|
195
|
+
},
|
|
196
|
+
"./ContextMenuListBox.js": {
|
|
197
|
+
"types": "./ContextMenuListBox.d.ts",
|
|
198
|
+
"default": "./ContextMenuListBox.js"
|
|
199
|
+
},
|
|
192
200
|
"./CustomField.js": {
|
|
193
201
|
"types": "./CustomField.d.ts",
|
|
194
202
|
"default": "./CustomField.js"
|
|
@@ -469,6 +477,8 @@
|
|
|
469
477
|
"./ComboBox": "./ComboBox.js",
|
|
470
478
|
"./ConfirmDialog": "./ConfirmDialog.js",
|
|
471
479
|
"./ContextMenu": "./ContextMenu.js",
|
|
480
|
+
"./ContextMenuItem": "./ContextMenuItem.js",
|
|
481
|
+
"./ContextMenuListBox": "./ContextMenuListBox.js",
|
|
472
482
|
"./CustomField": "./CustomField.js",
|
|
473
483
|
"./DatePicker": "./DatePicker.js",
|
|
474
484
|
"./DateTimePicker": "./DateTimePicker.js",
|
package/utils/createComponent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createComponent as n}from"@lit/react";window.Vaadin??={},window.Vaadin.registrations??=[],window.Vaadin.registrations.push({is:"@vaadin/react-components",version:"25.3.0-
|
|
1
|
+
import{createComponent as n}from"@lit/react";window.Vaadin??={},window.Vaadin.registrations??=[],window.Vaadin.registrations.push({is:"@vaadin/react-components",version:"25.3.0-alpha8"});function o(e){const{elementClass:t}=e;return n("_properties"in t?{...e,elementClass:{name:t.name,prototype:{...t._properties,hidden:Boolean}}}:e)}function r(e){return o(e)}export{o as createComponent,r as createThemedComponent};
|
|
2
2
|
//# sourceMappingURL=createComponent.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/utils/createComponent.ts"],
|
|
4
|
-
"sourcesContent": ["import { createComponent as _createComponent, type EventName } from '@lit/react';\nimport type { ThemePropertyMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';\nimport type React from 'react';\nimport type { RefAttributes } from 'react';\n\ndeclare const __VERSION__: string;\n\ndeclare global {\n interface VaadinRegistration {\n is: string;\n version: string;\n }\n\n interface Vaadin {\n registrations?: VaadinRegistration[];\n }\n\n interface Window {\n // @ts-expect-error: Different declaration from one of the dependencies.\n Vaadin?: Vaadin;\n }\n}\n\nwindow.Vaadin ??= {};\nwindow.Vaadin.registrations ??= [];\nwindow.Vaadin.registrations.push({\n is: '@vaadin/react-components',\n version: /* updated-by-script */ '25.3.0-
|
|
4
|
+
"sourcesContent": ["import { createComponent as _createComponent, type EventName } from '@lit/react';\nimport type { ThemePropertyMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';\nimport type React from 'react';\nimport type { RefAttributes } from 'react';\n\ndeclare const __VERSION__: string;\n\ndeclare global {\n interface VaadinRegistration {\n is: string;\n version: string;\n }\n\n interface Vaadin {\n registrations?: VaadinRegistration[];\n }\n\n interface Window {\n // @ts-expect-error: Different declaration from one of the dependencies.\n Vaadin?: Vaadin;\n }\n}\n\nwindow.Vaadin ??= {};\nwindow.Vaadin.registrations ??= [];\nwindow.Vaadin.registrations.push({\n is: '@vaadin/react-components',\n version: /* updated-by-script */ '25.3.0-alpha8',\n});\n\n// TODO: Remove when types from @lit-labs/react are exported\nexport type EventNames = Record<string, EventName | string>;\ntype Constructor<T> = { new (): T; name: string };\ntype PolymerConstructor<T> = Constructor<T> & { _properties: Record<string, unknown> };\ntype Options<I extends HTMLElement, E extends EventNames = {}> = Readonly<{\n displayName?: string;\n elementClass: Constructor<I> | PolymerConstructor<I>;\n events?: E;\n react: typeof window.React;\n tagName: string;\n}>;\n\n// A map of expected event listener types based on EventNames.\ntype EventListeners<R extends EventNames> = {\n [K in keyof R]?: R[K] extends EventName ? (e: R[K]['__eventType']) => void : (e: Event) => void;\n};\n\n// Props derived from custom element class. Currently has limitations of making\n// all properties optional and also surfaces life cycle methods in autocomplete.\n// TODO: LoginOverlay has \"autofocus\" property, so we add it back manually.\ntype ElementProps<I> = Partial<Omit<I, keyof HTMLElement>> & { autofocus?: boolean };\n\n// Acceptable props to the React component.\ntype ComponentProps<I, E extends EventNames = {}> = Omit<\n React.HTMLAttributes<I>,\n // Prefer type of provided event handler props or those on element over\n // built-in HTMLAttributes\n keyof E | keyof ElementProps<I>\n> &\n EventListeners<E> &\n ElementProps<I>;\n\nexport type ThemedWebComponentProps<I extends HTMLElement, E extends EventNames = {}> = ComponentProps<I, E> & {\n /**\n * Attribute that can be used by the component to apply built-in style variants,\n * or to propagate its value to the sub-components in Shadow DOM.\n *\n * @see ThemePropertyMixinClass#_theme\n */\n theme?: string;\n};\n\ntype AllWebComponentProps<I extends HTMLElement, E extends EventNames = {}> = I extends ThemePropertyMixinClass\n ? ThemedWebComponentProps<I, E>\n : ComponentProps<I, E>;\n\nexport type WebComponentProps<I extends HTMLElement, E extends EventNames = {}> = Partial<AllWebComponentProps<I, E>>;\n\n/**\n * The type of a React component created from a Vaadin web component.\n */\nexport type ReactWebComponent<I extends HTMLElement, E extends EventNames = {}> = (\n props: WebComponentProps<I, E> & RefAttributes<I>,\n) => React.ReactElement | null;\n\n/**\n * The type of a React component that always accepts a `theme` property, even if\n * the underlying web component does not use `ThemableMixin` / does not expose\n * `ThemePropertyMixinClass` in its type. Used for components that support theme\n * variants through the `theme` attribute without the mixin.\n */\nexport type ThemedReactWebComponent<I extends HTMLElement, E extends EventNames = {}> = (\n props: Partial<ThemedWebComponentProps<I, E>> & RefAttributes<I>,\n) => React.ReactElement | null;\n\n// We need a separate declaration here; otherwise, the TypeScript fails into the\n// endless loop trying to resolve the typings.\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>(\n options: Options<I, E>,\n): ReactWebComponent<I, E>;\n\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>(options: Options<I, E>): any {\n const { elementClass } = options;\n\n return _createComponent(\n '_properties' in elementClass\n ? {\n ...options,\n // TODO: improve or remove the Polymer workaround\n // 'createComponent' relies on key presence on the custom element class,\n // but Polymer defines properties on the prototype when the first element\n // is created. Workaround: pass a mock object with properties in\n // the prototype.\n elementClass: {\n // @ts-expect-error: it is a specific workaround for Polymer classes.\n name: elementClass.name,\n prototype: { ...elementClass._properties, hidden: Boolean },\n },\n }\n : options,\n );\n}\n\n// A separate declaration is needed here for the same reason as `createComponent`.\nexport function createThemedComponent<I extends HTMLElement, E extends EventNames = {}>(\n options: Options<I, E>,\n): ThemedReactWebComponent<I, E>;\n\n// Creates a React component that always accepts a `theme` property, regardless of\n// whether the underlying web component uses `ThemableMixin`. This only widens the\n// type: the runtime is identical to `createComponent`. `@lit/react` already forwards\n// any prop that is not defined on the element prototype (such as `theme` on a\n// non-`ThemableMixin` element) to the DOM as an attribute, so no runtime change is\n// needed \u2014 this function exists purely to expose `theme` at the type level.\nexport function createThemedComponent<I extends HTMLElement, E extends EventNames = {}>(options: Options<I, E>): any {\n return createComponent(options);\n}\n"],
|
|
5
5
|
"mappings": "AAAA,OAAS,mBAAmBA,MAAwC,aAuBpE,OAAO,SAAW,CAAC,EACnB,OAAO,OAAO,gBAAkB,CAAC,EACjC,OAAO,OAAO,cAAc,KAAK,CAC/B,GAAI,2BACJ,QAAiC,eACnC,CAAC,EAyEM,SAASC,EAAkEC,EAA6B,CAC7G,KAAM,CAAE,aAAAC,CAAa,EAAID,EAEzB,OAAOF,EACL,gBAAiBG,EACb,CACE,GAAGD,EAMH,aAAc,CAEZ,KAAMC,EAAa,KACnB,UAAW,CAAE,GAAGA,EAAa,YAAa,OAAQ,OAAQ,CAC5D,CACF,EACAD,CACN,CACF,CAaO,SAASE,EAAwEF,EAA6B,CACnH,OAAOD,EAAgBC,CAAO,CAChC",
|
|
6
6
|
"names": ["_createComponent", "createComponent", "options", "elementClass", "createThemedComponent"]
|
|
7
7
|
}
|