@vaadin/react-components 24.8.3 → 24.8.5

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/TabSheet.js CHANGED
@@ -1,2 +1,2 @@
1
- var c=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var o in t)c(e,o,{get:t[o],enumerable:!0})},l=(e,t,o,b)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of M(t))!R.call(e,r)&&r!==o&&c(e,r,{get:()=>t[r],enumerable:!(b=P(t,r))||b.enumerable});return e},n=(e,t,o)=>(l(e,t,"default"),o&&l(o,t,"default"));export*from"@vaadin/tabsheet/vaadin-tabsheet.js";import m,{forwardRef as U}from"react";var p={};S(p,{Tab:()=>i,TabElement:()=>f});n(p,Q);import*as Q from"@vaadin/tabs/vaadin-tab.js";import{Tab as f}from"@vaadin/tabs/vaadin-tab.js";import*as u from"react";import{createComponent as N}from"./utils/createComponent.js";var _={},i=N({elementClass:f,events:_,react:u,tagName:"vaadin-tab"});import{TabSheet as I}from"@vaadin/tabsheet/vaadin-tabsheet.js";import*as W from"react";import{createComponent as w}from"./utils/createComponent.js";var k={onItemsChanged:"items-changed",onSelectedChanged:"selected-changed"},E=w({elementClass:I,events:k,react:W,tagName:"vaadin-tabsheet"});var s={};S(s,{Tabs:()=>h,TabsElement:()=>v});n(s,ae);import*as ae from"@vaadin/tabs/vaadin-tabs.js";import{Tabs as v}from"@vaadin/tabs/vaadin-tabs.js";import*as F from"react";import{createComponent as A}from"./utils/createComponent.js";var O={onSelectedChanged:"selected-changed",onItemsChanged:"items-changed"},h=A({elementClass:v,events:O,react:F,tagName:"vaadin-tabs"});import{jsx as y,jsxs as B}from"react/jsx-runtime";import{createElement as z}from"react";var g=e=>null,V=0,d=new WeakMap;function T(e){return e.props.id?e.props.id:(d.has(e)||d.set(e,"tabsheet-tab-"+V++),d.get(e))}function q(e,t){let{children:o,...b}=e,r=m.Children.toArray(o).filter(a=>m.isValidElement(a)&&a.type===g),C=m.Children.toArray(o).filter(a=>m.isValidElement(a)&&a.type!==g);return B(E,{...b,ref:t,children:[r.length>0?y(h,{slot:"tabs",children:r.map(a=>{let{children:D,label:G,...x}=a.props;return z(i,{...x,id:T(a),key:T(a)},a.props.label)})}):null,r.map(a=>y("div",{tab:T(a),children:a.props.children},T(a))),C]})}var be=U(q);function me(e){return console.warn("Using the `tab` helper function is deprecated. Use <TabSheetTab/> instead."),{tab:e}}export{be as TabSheet,I as TabSheetElement,g as TabSheetTab,me as tab};
1
+ var c=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var o in t)c(e,o,{get:t[o],enumerable:!0})},l=(e,t,o,b)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of M(t))!R.call(e,n)&&n!==o&&c(e,n,{get:()=>t[n],enumerable:!(b=P(t,n))||b.enumerable});return e},r=(e,t,o)=>(l(e,t,"default"),o&&l(o,t,"default"));export*from"@vaadin/tabsheet/vaadin-tabsheet.js";import m,{forwardRef as U}from"react";var p={};S(p,{Tab:()=>i,TabElement:()=>f});r(p,Q);import*as Q from"@vaadin/tabs/vaadin-tab.js";import{Tab as f}from"@vaadin/tabs/vaadin-tab.js";import*as u from"react";import{createComponent as N}from"./utils/createComponent.js";var _={},i=N({elementClass:f,events:_,react:u,tagName:"vaadin-tab"});import{TabSheet as I}from"@vaadin/tabsheet/vaadin-tabsheet.js";import*as W from"react";import{createComponent as w}from"./utils/createComponent.js";var k={onItemsChanged:"items-changed",onSelectedChanged:"selected-changed"},E=w({elementClass:I,events:k,react:W,tagName:"vaadin-tabsheet"});var s={};S(s,{Tabs:()=>d,TabsElement:()=>y});r(s,ae);import*as ae from"@vaadin/tabs/vaadin-tabs.js";import{Tabs as y}from"@vaadin/tabs/vaadin-tabs.js";import*as F from"react";import{createComponent as A}from"./utils/createComponent.js";var O={onSelectedChanged:"selected-changed",onItemsChanged:"items-changed"},d=A({elementClass:y,events:O,react:F,tagName:"vaadin-tabs"});import{jsx as g,jsxs as B}from"react/jsx-runtime";import{createElement as z}from"react";var v=e=>null,V=0,h=new WeakMap;function T(e){return e.props.id?e.props.id:(h.has(e)||h.set(e,"tabsheet-tab-"+V++),h.get(e))}function q(e,t){let{children:o,...b}=e,n=m.Children.toArray(o).filter(a=>m.isValidElement(a)&&a.type===v),C=m.Children.toArray(o).filter(a=>m.isValidElement(a)&&a.type!==v);return B(E,{...b,ref:t,children:[n.length>0?g(d,{slot:"tabs",children:n.map(a=>{let{children:D,label:G,...x}=a.props;return z(i,{...x,id:T(a),key:T(a)},a.props.label)})}):null,n.map(a=>g("div",{style:{display:"contents"},tab:T(a),children:a.props.children},T(a))),C]})}var be=U(q);function me(e){return console.warn("Using the `tab` helper function is deprecated. Use <TabSheetTab/> instead."),{tab:e}}export{be as TabSheet,I as TabSheetElement,v as TabSheetTab,me as tab};
2
2
  //# sourceMappingURL=TabSheet.js.map
package/TabSheet.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["src/TabSheet.tsx", "src/Tab.ts", "src/generated/Tab.ts", "src/generated/TabSheet.ts", "src/Tabs.ts", "src/generated/Tabs.ts"],
4
- "sourcesContent": ["export * from \"@vaadin/tabsheet/vaadin-tabsheet.js\";\nimport React, { forwardRef, type ForwardedRef, type ReactNode } from 'react';\nimport { Tab, type TabProps } from './Tab.js';\nimport {\n TabSheet as _TabSheet,\n type TabSheetElement,\n type TabSheetProps as _TabSheetProps,\n} from './generated/TabSheet.js';\nimport { Tabs } from './Tabs.js';\n\nexport * from './generated/TabSheet.js';\n\ntype TabSheetTabProps = Omit<TabProps, 'selected' | 'value'> & {\n /**\n * The label of the tab.\n */\n label?: ReactNode;\n};\n\ntype TabSheetTab = React.ReactElement<TabSheetTabProps>;\n\n/**\n * `TabSheetTab` is a helper component designed for creating tabs within a `<TabSheet/>`.\n * Use this component as a direct child of the `<TabSheet/>` component.\n * It accepts a `label` property, which can be either a string or a React node.\n * The children of the component will be rendered as the content of the tab.\n *\n * ### Usage\n *\n * ```tsx\n * <TabSheet>\n * <TabSheetTab label=\"Dashboard\">\n * <div>This is the Dashboard tab content</div>\n * </TabSheetTab>\n *\n * <TabSheetTab label={<i>Payment</i>}>\n * <div>This is the Payment tab content</div>\n * </TabSheetTab>\n * </TabSheet>\n * ```\n */\nexport const TabSheetTab = (_props: TabSheetTabProps) => null;\n\nlet uniqueId = 0;\nconst generatedTabIds = new WeakMap<TabSheetTab, string>();\nfunction getTabId(tab: TabSheetTab) {\n if (tab.props.id) {\n // Support custom id for a tabsheet tab\n return tab.props.id;\n }\n\n if (!generatedTabIds.has(tab)) {\n // Generate a temporary id for the tab while it's being rendered\n generatedTabIds.set(tab, 'tabsheet-tab-' + uniqueId++);\n }\n return generatedTabIds.get(tab);\n}\n\nexport type TabSheetProps = Partial<Omit<_TabSheetProps, 'items'>>;\n\nfunction TabSheet(props: TabSheetProps, ref: ForwardedRef<TabSheetElement>) {\n const { children, ...tabSheetRest } = props;\n\n // The direct TabSheetTab children of the TabSheet\n const tabs = React.Children.toArray(children).filter((child): child is TabSheetTab => {\n return React.isValidElement(child) && child.type === TabSheetTab;\n });\n\n // All the other children of the TabSheet\n const remainingChildren = React.Children.toArray(children).filter((child) => {\n return React.isValidElement(child) && child.type !== TabSheetTab;\n });\n\n return (\n <_TabSheet {...tabSheetRest} ref={ref}>\n {tabs.length > 0 ? (\n <Tabs slot=\"tabs\">\n {tabs.map((child) => {\n const { children, label, ...tabRest } = child.props;\n return (\n <Tab {...tabRest} id={getTabId(child)} key={getTabId(child)}>\n {child.props.label}\n </Tab>\n );\n })}\n </Tabs>\n ) : null}\n\n {tabs.map((child) => (\n <div {...{ tab: getTabId(child) }} key={getTabId(child)}>\n {child.props.children}\n </div>\n ))}\n\n {remainingChildren}\n </_TabSheet>\n );\n}\n\nconst ForwardedTabSheet = forwardRef(TabSheet);\n\nexport { ForwardedTabSheet as TabSheet };\n\n/**\n * A helper function that allows declaring the tab identifier on the children\n * of the `<TabSheet/>` component\n *\n * ### Usage\n *\n * ```tsx\n * <TabSheet>\n * <Tabs slot=\"tabs\">\n * <Tab id=\"about\">About</Tab>\n * <Tab id=\"contuct\">Contact us</Tab>\n * </Tabs>\n * <div {...tab('about')}>This tab is all about,..</div>\n * <div {...tab('contact')}>Our website: ...</div>\n * </TabSheet>\n * ```\n *\n * @param tab The identifier of the correspoding tab.\n *\n * @returns object with HTML attribute values recognized on tab sheet children.\n * @deprecated Use `<TabSheetTab/>` instead.\n */\nexport function tab(tab: string): Record<string, string> {\n console.warn('Using the `tab` helper function is deprecated. Use <TabSheetTab/> instead.');\n return { tab } as Record<string, string>;\n}\n", "export * from \"@vaadin/tabs/vaadin-tab.js\";\nexport * from './generated/Tab.js';\n", "import type {} from \"@lit/react\";\nimport { Tab as TabElement, } from \"@vaadin/tabs/vaadin-tab.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabElement, };\nexport type TabEventMap = Readonly<{}>;\nconst events = {} as TabEventMap;\nexport type TabProps = WebComponentProps<TabElement, TabEventMap>;\nexport const Tab = createComponent({\n elementClass: TabElement, events, react: React, tagName: \"vaadin-tab\"\n});\n", "import type { EventName } from \"@lit/react\";\nimport { TabSheet as TabSheetElement, type TabSheetEventMap as _TabSheetEventMap, } from \"@vaadin/tabsheet/vaadin-tabsheet.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabSheetElement, };\nexport type TabSheetEventMap = Readonly<{\n onItemsChanged: EventName<_TabSheetEventMap[\"items-changed\"]>;\n onSelectedChanged: EventName<_TabSheetEventMap[\"selected-changed\"]>;\n}>;\nconst events = { onItemsChanged: \"items-changed\", onSelectedChanged: \"selected-changed\" } as TabSheetEventMap;\nexport type TabSheetProps = WebComponentProps<TabSheetElement, TabSheetEventMap>;\nexport const TabSheet = createComponent({\n elementClass: TabSheetElement, events, react: React, tagName: \"vaadin-tabsheet\"\n});\n", "export * from \"@vaadin/tabs/vaadin-tabs.js\";\nexport * from './generated/Tabs.js';\n", "import type { EventName } from \"@lit/react\";\nimport { Tabs as TabsElement, type TabsEventMap as _TabsEventMap, } from \"@vaadin/tabs/vaadin-tabs.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabsElement, };\nexport type TabsEventMap = Readonly<{\n onSelectedChanged: EventName<_TabsEventMap[\"selected-changed\"]>;\n onItemsChanged: EventName<_TabsEventMap[\"items-changed\"]>;\n}>;\nconst events = { onSelectedChanged: \"selected-changed\", onItemsChanged: \"items-changed\" } as TabsEventMap;\nexport type TabsProps = WebComponentProps<TabsElement, TabsEventMap>;\nexport const Tabs = createComponent({\n elementClass: TabsElement, events, react: React, tagName: \"vaadin-tabs\"\n});\n"],
5
- "mappings": "kaAAA,WAAc,sCACd,OAAOA,GAAS,cAAAC,MAAqD,QCDrE,IAAAC,EAAA,GAAAC,EAAAD,EAAA,SAAAE,EAAA,eAAAC,IAAAC,EAAAJ,EAAAK,GAAA,UAAAA,MAAc,6BCCd,OAAS,OAAOC,MAAmB,6BACnC,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BAGxD,IAAMC,EAAS,CAAC,EAEHC,EAAMC,EAAgB,CAC/B,aAAcC,EAAY,OAAAH,EAAQ,MAAOI,EAAO,QAAS,YAC7D,CAAC,ECTD,OAAS,YAAYC,MAAoE,sCACzF,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BAMxD,IAAMC,EAAS,CAAE,eAAgB,gBAAiB,kBAAmB,kBAAmB,EAE3EC,EAAWC,EAAgB,CACpC,aAAcC,EAAiB,OAAAH,EAAQ,MAAOI,EAAO,QAAS,iBAClE,CAAC,ECbD,IAAAC,EAAA,GAAAC,EAAAD,EAAA,UAAA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H,EACE,KAEHF,EAAK,IAAKE,GACThB,EAAC,OAAU,IAAKO,EAASS,CAAK,EAC3B,SAAAA,EAAM,MAAM,UADyBT,EAASS,CAAK,CAEtD,CACD,EAEAC,GACH,CAEJ,CAEA,IAAMK,GAAoBC,EAAWd,CAAQ,EA0BtC,SAASe,GAAIA,EAAqC,CACvD,eAAQ,KAAK,4EAA4E,EAClF,CAAE,IAAAA,CAAI,CACf",
4
+ "sourcesContent": ["export * from \"@vaadin/tabsheet/vaadin-tabsheet.js\";\nimport React, { forwardRef, type ForwardedRef, type ReactNode } from 'react';\nimport { Tab, type TabProps } from './Tab.js';\nimport {\n TabSheet as _TabSheet,\n type TabSheetElement,\n type TabSheetProps as _TabSheetProps,\n} from './generated/TabSheet.js';\nimport { Tabs } from './Tabs.js';\n\nexport * from './generated/TabSheet.js';\n\ntype TabSheetTabProps = Omit<TabProps, 'selected' | 'value'> & {\n /**\n * The label of the tab.\n */\n label?: ReactNode;\n};\n\ntype TabSheetTab = React.ReactElement<TabSheetTabProps>;\n\n/**\n * `TabSheetTab` is a helper component designed for creating tabs within a `<TabSheet/>`.\n * Use this component as a direct child of the `<TabSheet/>` component.\n * It accepts a `label` property, which can be either a string or a React node.\n * The children of the component will be rendered as the content of the tab.\n *\n * ### Usage\n *\n * ```tsx\n * <TabSheet>\n * <TabSheetTab label=\"Dashboard\">\n * <div>This is the Dashboard tab content</div>\n * </TabSheetTab>\n *\n * <TabSheetTab label={<i>Payment</i>}>\n * <div>This is the Payment tab content</div>\n * </TabSheetTab>\n * </TabSheet>\n * ```\n */\nexport const TabSheetTab = (_props: TabSheetTabProps) => null;\n\nlet uniqueId = 0;\nconst generatedTabIds = new WeakMap<TabSheetTab, string>();\nfunction getTabId(tab: TabSheetTab) {\n if (tab.props.id) {\n // Support custom id for a tabsheet tab\n return tab.props.id;\n }\n\n if (!generatedTabIds.has(tab)) {\n // Generate a temporary id for the tab while it's being rendered\n generatedTabIds.set(tab, 'tabsheet-tab-' + uniqueId++);\n }\n return generatedTabIds.get(tab);\n}\n\nexport type TabSheetProps = Partial<Omit<_TabSheetProps, 'items'>>;\n\nfunction TabSheet(props: TabSheetProps, ref: ForwardedRef<TabSheetElement>) {\n const { children, ...tabSheetRest } = props;\n\n // The direct TabSheetTab children of the TabSheet\n const tabs = React.Children.toArray(children).filter((child): child is TabSheetTab => {\n return React.isValidElement(child) && child.type === TabSheetTab;\n });\n\n // All the other children of the TabSheet\n const remainingChildren = React.Children.toArray(children).filter((child) => {\n return React.isValidElement(child) && child.type !== TabSheetTab;\n });\n\n return (\n <_TabSheet {...tabSheetRest} ref={ref}>\n {tabs.length > 0 ? (\n <Tabs slot=\"tabs\">\n {tabs.map((child) => {\n const { children, label, ...tabRest } = child.props;\n return (\n <Tab {...tabRest} id={getTabId(child)} key={getTabId(child)}>\n {child.props.label}\n </Tab>\n );\n })}\n </Tabs>\n ) : null}\n\n {tabs.map((child) => (\n <div style={{ display: 'contents' }} {...{ tab: getTabId(child) }} key={getTabId(child)}>\n {child.props.children}\n </div>\n ))}\n\n {remainingChildren}\n </_TabSheet>\n );\n}\n\nconst ForwardedTabSheet = forwardRef(TabSheet);\n\nexport { ForwardedTabSheet as TabSheet };\n\n/**\n * A helper function that allows declaring the tab identifier on the children\n * of the `<TabSheet/>` component\n *\n * ### Usage\n *\n * ```tsx\n * <TabSheet>\n * <Tabs slot=\"tabs\">\n * <Tab id=\"about\">About</Tab>\n * <Tab id=\"contuct\">Contact us</Tab>\n * </Tabs>\n * <div {...tab('about')}>This tab is all about,..</div>\n * <div {...tab('contact')}>Our website: ...</div>\n * </TabSheet>\n * ```\n *\n * @param tab The identifier of the correspoding tab.\n *\n * @returns object with HTML attribute values recognized on tab sheet children.\n * @deprecated Use `<TabSheetTab/>` instead.\n */\nexport function tab(tab: string): Record<string, string> {\n console.warn('Using the `tab` helper function is deprecated. Use <TabSheetTab/> instead.');\n return { tab } as Record<string, string>;\n}\n", "export * from \"@vaadin/tabs/vaadin-tab.js\";\nexport * from './generated/Tab.js';\n", "import type {} from \"@lit/react\";\nimport { Tab as TabElement, } from \"@vaadin/tabs/vaadin-tab.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabElement, };\nexport type TabEventMap = Readonly<{}>;\nconst events = {} as TabEventMap;\nexport type TabProps = WebComponentProps<TabElement, TabEventMap>;\nexport const Tab = createComponent({\n elementClass: TabElement, events, react: React, tagName: \"vaadin-tab\"\n});\n", "import type { EventName } from \"@lit/react\";\nimport { TabSheet as TabSheetElement, type TabSheetEventMap as _TabSheetEventMap, } from \"@vaadin/tabsheet/vaadin-tabsheet.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabSheetElement, };\nexport type TabSheetEventMap = Readonly<{\n onItemsChanged: EventName<_TabSheetEventMap[\"items-changed\"]>;\n onSelectedChanged: EventName<_TabSheetEventMap[\"selected-changed\"]>;\n}>;\nconst events = { onItemsChanged: \"items-changed\", onSelectedChanged: \"selected-changed\" } as TabSheetEventMap;\nexport type TabSheetProps = WebComponentProps<TabSheetElement, TabSheetEventMap>;\nexport const TabSheet = createComponent({\n elementClass: TabSheetElement, events, react: React, tagName: \"vaadin-tabsheet\"\n});\n", "export * from \"@vaadin/tabs/vaadin-tabs.js\";\nexport * from './generated/Tabs.js';\n", "import type { EventName } from \"@lit/react\";\nimport { Tabs as TabsElement, type TabsEventMap as _TabsEventMap, } from \"@vaadin/tabs/vaadin-tabs.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabsElement, };\nexport type TabsEventMap = Readonly<{\n onSelectedChanged: EventName<_TabsEventMap[\"selected-changed\"]>;\n onItemsChanged: EventName<_TabsEventMap[\"items-changed\"]>;\n}>;\nconst events = { onSelectedChanged: \"selected-changed\", onItemsChanged: \"items-changed\" } as TabsEventMap;\nexport type TabsProps = WebComponentProps<TabsElement, TabsEventMap>;\nexport const Tabs =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AEhDC,EAAgB,IAAIE,CAAG,EAChC,CAIA,SAASC,EAASC,EAAsBC,EAAoC,CAC1E,GAAM,CAAE,SAAAC,EAAU,GAAGC,CAAa,EAAIH,EAGhCI,EAAOC,EAAM,SAAS,QAAQH,CAAQ,EAAE,OAAQI,GAC7CD,EAAM,eAAeC,CAAK,GAAKA,EAAM,OAASb,CACtD,EAGKc,EAAoBF,EAAM,SAAS,QAAQH,CAAQ,EAAE,OAAQI,GAC1DD,EAAM,eAAeC,CAAK,GAAKA,EAAM,OAASb,CACtD,EAED,OACEF,EAACQ,EAAA,CAAW,GAAGI,EAAc,IAAKF,EAC/B,UAAAG,EAAK,OAAS,EACbd,EAACkB,EAAA,CAAK,KAAK,OACR,SAAAJ,EAAK,IAAKE,GAAU,CACnB,GAAM,CAAE,SAAAJ,EAAU,MAAAO,EAAO,GAAGC,CAAQ,EAAIJ,EAAM,MAC9C,OACEd,EAACmB,EAAA,CAAK,GAAGD,EAAS,GAAIb,EAASS,CAAK,EAAG,IAAKT,EAASS,CAAK,GACvDA,EAAM,MAAM,KACf,CAEJ,CAAC,EACH,EACE,KAEHF,EAAK,IAAKE,GACThB,EAAC,OAAI,MAAO,CAAE,QAAS,UAAW,EAAS,IAAKO,EAASS,CAAK,EAC3D,SAAAA,EAAM,MAAM,UADyDT,EAASS,CAAK,CAEtF,CACD,EAEAC,GACH,CAEJ,CAEA,IAAMK,GAAoBC,EAAWd,CAAQ,EA0BtC,SAASe,GAAIA,EAAqC,CACvD,eAAQ,KAAK,4EAA4E,EAClF,CAAE,IAAAA,CAAI,CACf",
6
6
  "names": ["React", "forwardRef", "Tab_exports", "__export", "Tab", "TabElement", "__reExport", "vaadin_tab_star", "TabElement", "React", "createComponent", "events", "Tab", "createComponent", "TabElement", "React", "TabSheetElement", "React", "createComponent", "events", "TabSheet", "createComponent", "TabSheetElement", "React", "Tabs_exports", "__export", "Tabs", "TabsElement", "__reExport", "vaadin_tabs_star", "TabsElement", "React", "createComponent", "events", "Tabs", "createComponent", "TabsElement", "React", "jsx", "jsxs", "createElement", "TabSheetTab", "_props", "uniqueId", "generatedTabIds", "getTabId", "tab", "TabSheet", "props", "ref", "children", "tabSheetRest", "tabs", "React", "child", "remainingChildren", "Tabs", "label", "tabRest", "Tab", "ForwardedTabSheet", "forwardRef", "tab"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/react-components",
3
- "version": "24.8.3",
3
+ "version": "24.8.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -27,67 +27,67 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@lit/react": "^1.0.7",
30
- "@vaadin/a11y-base": "24.8.3",
31
- "@vaadin/accordion": "24.8.3",
32
- "@vaadin/app-layout": "24.8.3",
33
- "@vaadin/avatar": "24.8.3",
34
- "@vaadin/avatar-group": "24.8.3",
35
- "@vaadin/button": "24.8.3",
36
- "@vaadin/card": "24.8.3",
37
- "@vaadin/checkbox": "24.8.3",
38
- "@vaadin/checkbox-group": "24.8.3",
39
- "@vaadin/combo-box": "24.8.3",
40
- "@vaadin/component-base": "24.8.3",
41
- "@vaadin/confirm-dialog": "24.8.3",
42
- "@vaadin/context-menu": "24.8.3",
43
- "@vaadin/custom-field": "24.8.3",
44
- "@vaadin/date-picker": "24.8.3",
45
- "@vaadin/date-time-picker": "24.8.3",
46
- "@vaadin/details": "24.8.3",
47
- "@vaadin/dialog": "24.8.3",
48
- "@vaadin/email-field": "24.8.3",
49
- "@vaadin/field-base": "24.8.3",
50
- "@vaadin/field-highlighter": "24.8.3",
51
- "@vaadin/form-layout": "24.8.3",
52
- "@vaadin/grid": "24.8.3",
53
- "@vaadin/horizontal-layout": "24.8.3",
54
- "@vaadin/icon": "24.8.3",
55
- "@vaadin/icons": "24.8.3",
56
- "@vaadin/input-container": "24.8.3",
57
- "@vaadin/integer-field": "24.8.3",
58
- "@vaadin/item": "24.8.3",
59
- "@vaadin/list-box": "24.8.3",
60
- "@vaadin/lit-renderer": "24.8.3",
61
- "@vaadin/login": "24.8.3",
62
- "@vaadin/markdown": "24.8.3",
63
- "@vaadin/master-detail-layout": "24.8.3",
64
- "@vaadin/menu-bar": "24.8.3",
65
- "@vaadin/message-input": "24.8.3",
66
- "@vaadin/message-list": "24.8.3",
67
- "@vaadin/multi-select-combo-box": "24.8.3",
68
- "@vaadin/notification": "24.8.3",
69
- "@vaadin/number-field": "24.8.3",
70
- "@vaadin/overlay": "24.8.3",
71
- "@vaadin/password-field": "24.8.3",
72
- "@vaadin/popover": "24.8.3",
73
- "@vaadin/progress-bar": "24.8.3",
74
- "@vaadin/radio-group": "24.8.3",
75
- "@vaadin/scroller": "24.8.3",
76
- "@vaadin/select": "24.8.3",
77
- "@vaadin/side-nav": "24.8.3",
78
- "@vaadin/split-layout": "24.8.3",
79
- "@vaadin/tabs": "24.8.3",
80
- "@vaadin/tabsheet": "24.8.3",
81
- "@vaadin/text-area": "24.8.3",
82
- "@vaadin/text-field": "24.8.3",
83
- "@vaadin/time-picker": "24.8.3",
84
- "@vaadin/tooltip": "24.8.3",
85
- "@vaadin/upload": "24.8.3",
86
- "@vaadin/vaadin-lumo-styles": "24.8.3",
87
- "@vaadin/vaadin-material-styles": "24.8.3",
88
- "@vaadin/vaadin-themable-mixin": "24.8.3",
89
- "@vaadin/vertical-layout": "24.8.3",
90
- "@vaadin/virtual-list": "24.8.3"
30
+ "@vaadin/a11y-base": "24.8.5",
31
+ "@vaadin/accordion": "24.8.5",
32
+ "@vaadin/app-layout": "24.8.5",
33
+ "@vaadin/avatar": "24.8.5",
34
+ "@vaadin/avatar-group": "24.8.5",
35
+ "@vaadin/button": "24.8.5",
36
+ "@vaadin/card": "24.8.5",
37
+ "@vaadin/checkbox": "24.8.5",
38
+ "@vaadin/checkbox-group": "24.8.5",
39
+ "@vaadin/combo-box": "24.8.5",
40
+ "@vaadin/component-base": "24.8.5",
41
+ "@vaadin/confirm-dialog": "24.8.5",
42
+ "@vaadin/context-menu": "24.8.5",
43
+ "@vaadin/custom-field": "24.8.5",
44
+ "@vaadin/date-picker": "24.8.5",
45
+ "@vaadin/date-time-picker": "24.8.5",
46
+ "@vaadin/details": "24.8.5",
47
+ "@vaadin/dialog": "24.8.5",
48
+ "@vaadin/email-field": "24.8.5",
49
+ "@vaadin/field-base": "24.8.5",
50
+ "@vaadin/field-highlighter": "24.8.5",
51
+ "@vaadin/form-layout": "24.8.5",
52
+ "@vaadin/grid": "24.8.5",
53
+ "@vaadin/horizontal-layout": "24.8.5",
54
+ "@vaadin/icon": "24.8.5",
55
+ "@vaadin/icons": "24.8.5",
56
+ "@vaadin/input-container": "24.8.5",
57
+ "@vaadin/integer-field": "24.8.5",
58
+ "@vaadin/item": "24.8.5",
59
+ "@vaadin/list-box": "24.8.5",
60
+ "@vaadin/lit-renderer": "24.8.5",
61
+ "@vaadin/login": "24.8.5",
62
+ "@vaadin/markdown": "24.8.5",
63
+ "@vaadin/master-detail-layout": "24.8.5",
64
+ "@vaadin/menu-bar": "24.8.5",
65
+ "@vaadin/message-input": "24.8.5",
66
+ "@vaadin/message-list": "24.8.5",
67
+ "@vaadin/multi-select-combo-box": "24.8.5",
68
+ "@vaadin/notification": "24.8.5",
69
+ "@vaadin/number-field": "24.8.5",
70
+ "@vaadin/overlay": "24.8.5",
71
+ "@vaadin/password-field": "24.8.5",
72
+ "@vaadin/popover": "24.8.5",
73
+ "@vaadin/progress-bar": "24.8.5",
74
+ "@vaadin/radio-group": "24.8.5",
75
+ "@vaadin/scroller": "24.8.5",
76
+ "@vaadin/select": "24.8.5",
77
+ "@vaadin/side-nav": "24.8.5",
78
+ "@vaadin/split-layout": "24.8.5",
79
+ "@vaadin/tabs": "24.8.5",
80
+ "@vaadin/tabsheet": "24.8.5",
81
+ "@vaadin/text-area": "24.8.5",
82
+ "@vaadin/text-field": "24.8.5",
83
+ "@vaadin/time-picker": "24.8.5",
84
+ "@vaadin/tooltip": "24.8.5",
85
+ "@vaadin/upload": "24.8.5",
86
+ "@vaadin/vaadin-lumo-styles": "24.8.5",
87
+ "@vaadin/vaadin-material-styles": "24.8.5",
88
+ "@vaadin/vaadin-themable-mixin": "24.8.5",
89
+ "@vaadin/vertical-layout": "24.8.5",
90
+ "@vaadin/virtual-list": "24.8.5"
91
91
  },
92
92
  "author": "Vaadin Ltd.",
93
93
  "license": "Apache-2.0",
@@ -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:"24.8.3"});function s(e){const{elementClass:t}=e;return n("_properties"in t?{...e,elementClass:{name:t.name,prototype:{...t._properties,hidden:Boolean}}}:e)}export{s as createComponent};
1
+ import{createComponent as n}from"@lit/react";window.Vaadin??={},window.Vaadin.registrations??=[],window.Vaadin.registrations.push({is:"@vaadin/react-components",version:"24.8.5"});function s(e){const{elementClass:t}=e;return n("_properties"in t?{...e,elementClass:{name:t.name,prototype:{...t._properties,hidden:Boolean}}}:e)}export{s as createComponent};
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 */ '24.8.3',\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<\n I extends ThemePropertyMixinClass & HTMLElement,\n E extends EventNames = {},\n> = 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// 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): (props: WebComponentProps<I, E> & RefAttributes<I>) => React.ReactElement | null;\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"],
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 */ '24.8.5',\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<\n I extends ThemePropertyMixinClass & HTMLElement,\n E extends EventNames = {},\n> = 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// 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): (props: WebComponentProps<I, E> & RefAttributes<I>) => React.ReactElement | null;\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"],
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,QACnC,CAAC,EA2DM,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",
6
6
  "names": ["_createComponent", "createComponent", "options", "elementClass"]
7
7
  }