@vertexvis/ui-react 0.0.10-canary.9 → 0.0.11-canary.10
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/LICENSE +1 -1
- package/dist/bundle.cjs.js +14 -0
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.cjs.min.js +1 -1
- package/dist/bundle.cjs.min.js.map +1 -1
- package/dist/bundle.esm.js +8 -1
- package/dist/bundle.esm.js.map +1 -1
- package/dist/bundle.esm.min.js +1 -1
- package/dist/bundle.esm.min.js.map +1 -1
- package/dist/generated/ui.d.ts +7 -0
- package/package.json +4 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2021 Vertex Software
|
|
3
|
+
Copyright (c) 2021 - Present Vertex Software, Inc.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/bundle.cjs.js
CHANGED
|
@@ -198,7 +198,10 @@ var createReactComponent = function (tagName, ReactComponentContext, manipulateP
|
|
|
198
198
|
/* eslint-disable */
|
|
199
199
|
loader.defineCustomElements();
|
|
200
200
|
var VertexAvatar = /*@__PURE__*/ createReactComponent('vertex-avatar');
|
|
201
|
+
var VertexAvatarGroup = /*@__PURE__*/ createReactComponent('vertex-avatar-group');
|
|
201
202
|
var VertexButton = /*@__PURE__*/ createReactComponent('vertex-button');
|
|
203
|
+
var VertexCard = /*@__PURE__*/ createReactComponent('vertex-card');
|
|
204
|
+
var VertexCardGroup = /*@__PURE__*/ createReactComponent('vertex-card-group');
|
|
202
205
|
var VertexClickToEditTextfield = /*@__PURE__*/ createReactComponent('vertex-click-to-edit-textfield');
|
|
203
206
|
var VertexCollapsible = /*@__PURE__*/ createReactComponent('vertex-collapsible');
|
|
204
207
|
var VertexColorPicker = /*@__PURE__*/ createReactComponent('vertex-color-picker');
|
|
@@ -207,14 +210,18 @@ var VertexDialog = /*@__PURE__*/ createReactComponent('vertex-dialog');
|
|
|
207
210
|
var VertexDropdownMenu = /*@__PURE__*/ createReactComponent('vertex-dropdown-menu');
|
|
208
211
|
var VertexIcon = /*@__PURE__*/ createReactComponent('vertex-icon');
|
|
209
212
|
var VertexIconButton = /*@__PURE__*/ createReactComponent('vertex-icon-button');
|
|
213
|
+
var VertexLogoLoading = /*@__PURE__*/ createReactComponent('vertex-logo-loading');
|
|
210
214
|
var VertexMenu = /*@__PURE__*/ createReactComponent('vertex-menu');
|
|
211
215
|
var VertexMenuDivider = /*@__PURE__*/ createReactComponent('vertex-menu-divider');
|
|
212
216
|
var VertexMenuItem = /*@__PURE__*/ createReactComponent('vertex-menu-item');
|
|
213
217
|
var VertexPopover = /*@__PURE__*/ createReactComponent('vertex-popover');
|
|
218
|
+
var VertexRadio = /*@__PURE__*/ createReactComponent('vertex-radio');
|
|
219
|
+
var VertexRadioGroup = /*@__PURE__*/ createReactComponent('vertex-radio-group');
|
|
214
220
|
var VertexResizable = /*@__PURE__*/ createReactComponent('vertex-resizable');
|
|
215
221
|
var VertexSelect = /*@__PURE__*/ createReactComponent('vertex-select');
|
|
216
222
|
var VertexSpinner = /*@__PURE__*/ createReactComponent('vertex-spinner');
|
|
217
223
|
var VertexTextfield = /*@__PURE__*/ createReactComponent('vertex-textfield');
|
|
224
|
+
var VertexToast = /*@__PURE__*/ createReactComponent('vertex-toast');
|
|
218
225
|
var VertexToggle = /*@__PURE__*/ createReactComponent('vertex-toggle');
|
|
219
226
|
var VertexTooltip = /*@__PURE__*/ createReactComponent('vertex-tooltip');
|
|
220
227
|
|
|
@@ -227,7 +234,10 @@ Object.keys(loader).forEach(function (k) {
|
|
|
227
234
|
});
|
|
228
235
|
});
|
|
229
236
|
exports.VertexAvatar = VertexAvatar;
|
|
237
|
+
exports.VertexAvatarGroup = VertexAvatarGroup;
|
|
230
238
|
exports.VertexButton = VertexButton;
|
|
239
|
+
exports.VertexCard = VertexCard;
|
|
240
|
+
exports.VertexCardGroup = VertexCardGroup;
|
|
231
241
|
exports.VertexClickToEditTextfield = VertexClickToEditTextfield;
|
|
232
242
|
exports.VertexCollapsible = VertexCollapsible;
|
|
233
243
|
exports.VertexColorPicker = VertexColorPicker;
|
|
@@ -236,14 +246,18 @@ exports.VertexDialog = VertexDialog;
|
|
|
236
246
|
exports.VertexDropdownMenu = VertexDropdownMenu;
|
|
237
247
|
exports.VertexIcon = VertexIcon;
|
|
238
248
|
exports.VertexIconButton = VertexIconButton;
|
|
249
|
+
exports.VertexLogoLoading = VertexLogoLoading;
|
|
239
250
|
exports.VertexMenu = VertexMenu;
|
|
240
251
|
exports.VertexMenuDivider = VertexMenuDivider;
|
|
241
252
|
exports.VertexMenuItem = VertexMenuItem;
|
|
242
253
|
exports.VertexPopover = VertexPopover;
|
|
254
|
+
exports.VertexRadio = VertexRadio;
|
|
255
|
+
exports.VertexRadioGroup = VertexRadioGroup;
|
|
243
256
|
exports.VertexResizable = VertexResizable;
|
|
244
257
|
exports.VertexSelect = VertexSelect;
|
|
245
258
|
exports.VertexSpinner = VertexSpinner;
|
|
246
259
|
exports.VertexTextfield = VertexTextfield;
|
|
260
|
+
exports.VertexToast = VertexToast;
|
|
247
261
|
exports.VertexToggle = VertexToggle;
|
|
248
262
|
exports.VertexTooltip = VertexTooltip;
|
|
249
263
|
//# sourceMappingURL=bundle.cjs.js.map
|
package/dist/bundle.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.cjs.js","sources":["../src/generated/react-component-lib/utils/case.ts","../src/generated/react-component-lib/utils/attachProps.ts","../src/generated/react-component-lib/utils/index.tsx","../src/generated/react-component-lib/createComponent.tsx","../src/generated/ui.ts"],"sourcesContent":["export const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\nexport const camelToDashCase = (str: string) =>\n str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);\n","import { camelToDashCase } from './case';\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n // add any classes in className to the class list\n const className = getClassName(node.classList, newProps, oldProps);\n if (className !== '') {\n node.className = className;\n }\n\n Object.keys(newProps).forEach((name) => {\n if (\n name === 'children' ||\n name === 'style' ||\n name === 'ref' ||\n name === 'class' ||\n name === 'className' ||\n name === 'forwardedRef'\n ) {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (typeof document !== 'undefined' && !isCoveredByReact(eventNameLc, document)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n const propType = typeof newProps[name];\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name]);\n } else {\n (node as any)[name] = newProps[name];\n }\n }\n });\n }\n};\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class;\n const oldClassProp: string = oldProps.className || oldProps.class;\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach((s) => finalClassNames.push(s));\n return finalClassNames.join(' ');\n};\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix: string, doc: Document) => {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n};\n\nexport const syncEvent = (\n node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n eventName: string,\n newEventHandler?: (e: Event) => any,\n) => {\n const eventStore = node.__events || (node.__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n if (newEventHandler) {\n newEventHandler.call(this, e);\n }\n }),\n );\n};\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n};\n","import React from 'react';\n\nimport type { StyleReactProps } from '../interfaces';\n\ntype Mutable<T> = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ?\n\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// The comma in the type is to trick typescript because it things a single generic in a tsx file is jsx\nexport const mergeRefs = <ElementType,>(...refs: React.Ref<ElementType>[]) => (\n value: ElementType,\n) =>\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // This is typed as readonly so we need to allow for override\n (ref as Mutable<React.RefObject<ElementType>>).current = value;\n }\n });\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React from 'react';\n\nimport {\n attachProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n mergeRefs,\n} from './utils';\n\nexport interface HTMLStencilElement extends HTMLElement {\n componentOnReady(): Promise<this>;\n}\n\ninterface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef: React.RefObject<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <\n PropType,\n ElementType extends HTMLStencilElement,\n ContextStateType = {},\n ExpandedPropsTypes = {}\n>(\n tagName: string,\n ReactComponentContext?: React.Context<ContextStateType>,\n manipulatePropsFunction?: (\n originalProps: StencilReactInternalProps<ElementType>,\n propsToPass: any,\n ) => ExpandedPropsTypes,\n) => {\n const displayName = dashToPascalCase(tagName);\n\n const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {\n componentEl!: ElementType;\n\n setComponentElRef = (element: ElementType) => {\n this.componentEl = element;\n };\n\n constructor(props: StencilReactInternalProps<ElementType>) {\n super(props);\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: StencilReactInternalProps<ElementType>) {\n attachProps(this.componentEl, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n let propsToPass = Object.keys(cProps).reduce((acc, name) => {\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== 'undefined' && isCoveredByReact(eventName, document)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n let newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n\n // If context was passed to createReactComponent then conditionally add it to the Component Class\n if (ReactComponentContext) {\n ReactComponent.contextType = ReactComponentContext;\n }\n\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport type { JSX } from '@vertexvis/ui';\n\nimport { defineCustomElements } from '@vertexvis/ui/loader';\n\ndefineCustomElements();\nexport const VertexAvatar = /*@__PURE__*/createReactComponent<JSX.VertexAvatar, HTMLVertexAvatarElement>('vertex-avatar');\nexport const VertexButton = /*@__PURE__*/createReactComponent<JSX.VertexButton, HTMLVertexButtonElement>('vertex-button');\nexport const VertexClickToEditTextfield = /*@__PURE__*/createReactComponent<JSX.VertexClickToEditTextfield, HTMLVertexClickToEditTextfieldElement>('vertex-click-to-edit-textfield');\nexport const VertexCollapsible = /*@__PURE__*/createReactComponent<JSX.VertexCollapsible, HTMLVertexCollapsibleElement>('vertex-collapsible');\nexport const VertexColorPicker = /*@__PURE__*/createReactComponent<JSX.VertexColorPicker, HTMLVertexColorPickerElement>('vertex-color-picker');\nexport const VertexContextMenu = /*@__PURE__*/createReactComponent<JSX.VertexContextMenu, HTMLVertexContextMenuElement>('vertex-context-menu');\nexport const VertexDialog = /*@__PURE__*/createReactComponent<JSX.VertexDialog, HTMLVertexDialogElement>('vertex-dialog');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexIcon = /*@__PURE__*/createReactComponent<JSX.VertexIcon, HTMLVertexIconElement>('vertex-icon');\nexport const VertexIconButton = /*@__PURE__*/createReactComponent<JSX.VertexIconButton, HTMLVertexIconButtonElement>('vertex-icon-button');\nexport const VertexMenu = /*@__PURE__*/createReactComponent<JSX.VertexMenu, HTMLVertexMenuElement>('vertex-menu');\nexport const VertexMenuDivider = /*@__PURE__*/createReactComponent<JSX.VertexMenuDivider, HTMLVertexMenuDividerElement>('vertex-menu-divider');\nexport const VertexMenuItem = /*@__PURE__*/createReactComponent<JSX.VertexMenuItem, HTMLVertexMenuItemElement>('vertex-menu-item');\nexport const VertexPopover = /*@__PURE__*/createReactComponent<JSX.VertexPopover, HTMLVertexPopoverElement>('vertex-popover');\nexport const VertexResizable = /*@__PURE__*/createReactComponent<JSX.VertexResizable, HTMLVertexResizableElement>('vertex-resizable');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSpinner = /*@__PURE__*/createReactComponent<JSX.VertexSpinner, HTMLVertexSpinnerElement>('vertex-spinner');\nexport const VertexTextfield = /*@__PURE__*/createReactComponent<JSX.VertexTextfield, HTMLVertexTextfieldElement>('vertex-textfield');\nexport const VertexToggle = /*@__PURE__*/createReactComponent<JSX.VertexToggle, HTMLVertexToggleElement>('vertex-toggle');\nexport const VertexTooltip = /*@__PURE__*/createReactComponent<JSX.VertexTooltip, HTMLVertexTooltipElement>('vertex-tooltip');\n"],"names":["__extends","defineCustomElements"],"mappings":";;;;;;;;;;;AAAO,IAAM,gBAAgB,GAAG,UAAC,GAAW;IAC1C,OAAA,GAAG;SACA,WAAW,EAAE;SACb,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,UAAC,OAAO,IAAK,OAAA,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAA,CAAC;SACpE,IAAI,CAAC,EAAE,CAAC;AAJX,CAIW,CAAC;AACP,IAAM,eAAe,GAAG,UAAC,GAAW;IACzC,OAAA,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,UAAC,CAAS,IAAK,OAAA,MAAI,CAAC,CAAC,CAAC,CAAC,CA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B,CAA8C,gBAAgB,CAAC,CAAC;AAC9H,IAAa,eAAe,iBAAgB,oBAAoB,CAAkD,kBAAkB,CAAC,CAAC;AACtI,IAAa,YAAY,iBAAgB,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,IAAa,aAAa,iBAAgB,oBAAoB,CAA8C,gBAAgB,CAAC,CAAC;AAC9H,IAAa,eAAe,iBAAgB,oBAAoB,CAAkD,kBAAkB,CAAC,CAAC;AACtI,IAAa,YAAY,iBAAgB,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,IAAa,aAAa,iBAAgB,oBAAoB,CAA8C,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"bundle.cjs.js","sources":["../src/generated/react-component-lib/utils/case.ts","../src/generated/react-component-lib/utils/attachProps.ts","../src/generated/react-component-lib/utils/index.tsx","../src/generated/react-component-lib/createComponent.tsx","../src/generated/ui.ts"],"sourcesContent":["export const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\nexport const camelToDashCase = (str: string) =>\n str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);\n","import { camelToDashCase } from './case';\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n // add any classes in className to the class list\n const className = getClassName(node.classList, newProps, oldProps);\n if (className !== '') {\n node.className = className;\n }\n\n Object.keys(newProps).forEach((name) => {\n if (\n name === 'children' ||\n name === 'style' ||\n name === 'ref' ||\n name === 'class' ||\n name === 'className' ||\n name === 'forwardedRef'\n ) {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (typeof document !== 'undefined' && !isCoveredByReact(eventNameLc, document)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n const propType = typeof newProps[name];\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name]);\n } else {\n (node as any)[name] = newProps[name];\n }\n }\n });\n }\n};\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class;\n const oldClassProp: string = oldProps.className || oldProps.class;\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach((s) => finalClassNames.push(s));\n return finalClassNames.join(' ');\n};\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix: string, doc: Document) => {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n};\n\nexport const syncEvent = (\n node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n eventName: string,\n newEventHandler?: (e: Event) => any,\n) => {\n const eventStore = node.__events || (node.__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n if (newEventHandler) {\n newEventHandler.call(this, e);\n }\n }),\n );\n};\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n};\n","import React from 'react';\n\nimport type { StyleReactProps } from '../interfaces';\n\ntype Mutable<T> = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ?\n\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// The comma in the type is to trick typescript because it things a single generic in a tsx file is jsx\nexport const mergeRefs = <ElementType,>(...refs: React.Ref<ElementType>[]) => (\n value: ElementType,\n) =>\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // This is typed as readonly so we need to allow for override\n (ref as Mutable<React.RefObject<ElementType>>).current = value;\n }\n });\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React from 'react';\n\nimport {\n attachProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n mergeRefs,\n} from './utils';\n\nexport interface HTMLStencilElement extends HTMLElement {\n componentOnReady(): Promise<this>;\n}\n\ninterface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef: React.RefObject<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <\n PropType,\n ElementType extends HTMLStencilElement,\n ContextStateType = {},\n ExpandedPropsTypes = {}\n>(\n tagName: string,\n ReactComponentContext?: React.Context<ContextStateType>,\n manipulatePropsFunction?: (\n originalProps: StencilReactInternalProps<ElementType>,\n propsToPass: any,\n ) => ExpandedPropsTypes,\n) => {\n const displayName = dashToPascalCase(tagName);\n\n const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {\n componentEl!: ElementType;\n\n setComponentElRef = (element: ElementType) => {\n this.componentEl = element;\n };\n\n constructor(props: StencilReactInternalProps<ElementType>) {\n super(props);\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: StencilReactInternalProps<ElementType>) {\n attachProps(this.componentEl, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n let propsToPass = Object.keys(cProps).reduce((acc, name) => {\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== 'undefined' && isCoveredByReact(eventName, document)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n let newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n\n // If context was passed to createReactComponent then conditionally add it to the Component Class\n if (ReactComponentContext) {\n ReactComponent.contextType = ReactComponentContext;\n }\n\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport type { JSX } from '@vertexvis/ui';\n\nimport { defineCustomElements } from '@vertexvis/ui/loader';\n\ndefineCustomElements();\nexport const VertexAvatar = /*@__PURE__*/createReactComponent<JSX.VertexAvatar, HTMLVertexAvatarElement>('vertex-avatar');\nexport const VertexAvatarGroup = /*@__PURE__*/createReactComponent<JSX.VertexAvatarGroup, HTMLVertexAvatarGroupElement>('vertex-avatar-group');\nexport const VertexButton = /*@__PURE__*/createReactComponent<JSX.VertexButton, HTMLVertexButtonElement>('vertex-button');\nexport const VertexCard = /*@__PURE__*/createReactComponent<JSX.VertexCard, HTMLVertexCardElement>('vertex-card');\nexport const VertexCardGroup = /*@__PURE__*/createReactComponent<JSX.VertexCardGroup, HTMLVertexCardGroupElement>('vertex-card-group');\nexport const VertexClickToEditTextfield = /*@__PURE__*/createReactComponent<JSX.VertexClickToEditTextfield, HTMLVertexClickToEditTextfieldElement>('vertex-click-to-edit-textfield');\nexport const VertexCollapsible = /*@__PURE__*/createReactComponent<JSX.VertexCollapsible, HTMLVertexCollapsibleElement>('vertex-collapsible');\nexport const VertexColorPicker = /*@__PURE__*/createReactComponent<JSX.VertexColorPicker, HTMLVertexColorPickerElement>('vertex-color-picker');\nexport const VertexContextMenu = /*@__PURE__*/createReactComponent<JSX.VertexContextMenu, HTMLVertexContextMenuElement>('vertex-context-menu');\nexport const VertexDialog = /*@__PURE__*/createReactComponent<JSX.VertexDialog, HTMLVertexDialogElement>('vertex-dialog');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexIcon = /*@__PURE__*/createReactComponent<JSX.VertexIcon, HTMLVertexIconElement>('vertex-icon');\nexport const VertexIconButton = /*@__PURE__*/createReactComponent<JSX.VertexIconButton, HTMLVertexIconButtonElement>('vertex-icon-button');\nexport const VertexLogoLoading = /*@__PURE__*/createReactComponent<JSX.VertexLogoLoading, HTMLVertexLogoLoadingElement>('vertex-logo-loading');\nexport const VertexMenu = /*@__PURE__*/createReactComponent<JSX.VertexMenu, HTMLVertexMenuElement>('vertex-menu');\nexport const VertexMenuDivider = /*@__PURE__*/createReactComponent<JSX.VertexMenuDivider, HTMLVertexMenuDividerElement>('vertex-menu-divider');\nexport const VertexMenuItem = /*@__PURE__*/createReactComponent<JSX.VertexMenuItem, HTMLVertexMenuItemElement>('vertex-menu-item');\nexport const VertexPopover = /*@__PURE__*/createReactComponent<JSX.VertexPopover, HTMLVertexPopoverElement>('vertex-popover');\nexport const VertexRadio = /*@__PURE__*/createReactComponent<JSX.VertexRadio, HTMLVertexRadioElement>('vertex-radio');\nexport const VertexRadioGroup = /*@__PURE__*/createReactComponent<JSX.VertexRadioGroup, HTMLVertexRadioGroupElement>('vertex-radio-group');\nexport const VertexResizable = /*@__PURE__*/createReactComponent<JSX.VertexResizable, HTMLVertexResizableElement>('vertex-resizable');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSpinner = /*@__PURE__*/createReactComponent<JSX.VertexSpinner, HTMLVertexSpinnerElement>('vertex-spinner');\nexport const VertexTextfield = /*@__PURE__*/createReactComponent<JSX.VertexTextfield, HTMLVertexTextfieldElement>('vertex-textfield');\nexport const VertexToast = /*@__PURE__*/createReactComponent<JSX.VertexToast, HTMLVertexToastElement>('vertex-toast');\nexport const VertexToggle = /*@__PURE__*/createReactComponent<JSX.VertexToggle, HTMLVertexToggleElement>('vertex-toggle');\nexport const VertexTooltip = /*@__PURE__*/createReactComponent<JSX.VertexTooltip, HTMLVertexTooltipElement>('vertex-tooltip');\n"],"names":["__extends","defineCustomElements"],"mappings":";;;;;;;;;;;AAAO,IAAM,gBAAgB,GAAG,UAAC,GAAW;IAC1C,OAAA,GAAG;SACA,WAAW,EAAE;SACb,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,UAAC,OAAO,IAAK,OAAA,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAA,CAAC;SACpE,IAAI,CAAC,EAAE,CAAC;AAJX,CAIW,CAAC;AACP,IAAM,eAAe,GAAG,UAAC,GAAW;IACzC,OAAA,GAAG,CAAC,OAAO,CAAC,UAAU,EA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AAoD,oBAAoB,CAAC,CAAC;AAC3I,IAAa,iBAAiB,iBAAgB,oBAAoB,CAAsD,qBAAqB,CAAC,CAAC;AAC/I,IAAa,UAAU,iBAAgB,oBAAoB,CAAwC,aAAa,CAAC,CAAC;AAClH,IAAa,iBAAiB,iBAAgB,oBAAoB,CAAsD,qBAAqB,CAAC,CAAC;AAC/I,IAAa,cAAc,iBAAgB,oBAAoB,CAAgD,kBAAkB,CAAC,CAAC;AACnI,IAAa,aAAa,iBAAgB,oBAAoB,CAA8C,gBAAgB,CAAC,CAAC;AAC9H,IAAa,WAAW,iBAAgB,oBAAoB,CAA0C,cAAc,CAAC,CAAC;AACtH,IAAa,gBAAgB,iBAAgB,oBAAoB,CAAoD,oBAAoB,CAAC,CAAC;AAC3I,IAAa,eAAe,iBAAgB,oBAAoB,CAAkD,kBAAkB,CAAC,CAAC;AACtI,IAAa,YAAY,iBAAgB,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,IAAa,aAAa,iBAAgB,oBAAoB,CAA8C,gBAAgB,CAAC,CAAC;AAC9H,IAAa,eAAe,iBAAgB,oBAAoB,CAAkD,kBAAkB,CAAC,CAAC;AACtI,IAAa,WAAW,iBAAgB,oBAAoB,CAA0C,cAAc,CAAC,CAAC;AACtH,IAAa,YAAY,iBAAgB,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,IAAa,aAAa,iBAAgB,oBAAoB,CAA8C,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/bundle.cjs.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),r=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e;require("react-dom");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),r=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e;require("react-dom");var o=require("@vertexvis/ui/loader"),n=function(e,t,r){var o=t.className||t.class,n=r.className||r.class,s=a(e),i=a(o?o.split(" "):[]),u=a(n?n.split(" "):[]),p=[];return s.forEach((function(e){i.has(e)?(p.push(e),i.delete(e)):u.has(e)||p.push(e)})),i.forEach((function(e){return p.push(e)})),p.join(" ")},s=function(e,t){var r="on"+e,o=r in t;if(!o){var n=t.createElement("div");n.setAttribute(r,"return;"),o="function"==typeof n[r]}return o},i=function(e,t,r){var o=e.__events||(e.__events={}),n=o[t];n&&e.removeEventListener(t,n),e.addEventListener(t,o[t]=function(e){r&&r.call(this,e)})},a=function(e){var t=new Map;return e.forEach((function(e){return t.set(e,e)})),t},u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.forEach((function(e){"function"==typeof e?e(t):null!=e&&(e.current=t)}))}},p=function(e,o,a){var p=e.toLowerCase().split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(""),c=function(o){function c(e){var t=o.call(this,e)||this;return t.setComponentElRef=function(e){t.componentEl=e},t}return t.__extends(c,o),c.prototype.componentDidMount=function(){this.componentDidUpdate(this.props)},c.prototype.componentDidUpdate=function(e){!function(e,t,r){if(void 0===r&&(r={}),e instanceof Element){var o=n(e.classList,t,r);""!==o&&(e.className=o),Object.keys(t).forEach((function(r){if("children"!==r&&"style"!==r&&"ref"!==r&&"class"!==r&&"className"!==r&&"forwardedRef"!==r)if(0===r.indexOf("on")&&r[2]===r[2].toUpperCase()){var o=r.substring(2),n=o[0].toLowerCase()+o.substring(1);"undefined"==typeof document||s(n,document)||i(e,n,t[r])}else{e[r]=t[r],"string"===typeof t[r]?e.setAttribute(r.replace(/([A-Z])/g,(function(e){return"-"+e[0].toLowerCase()})),t[r]):e[r]=t[r]}}))}}(this.componentEl,this.props,e)},c.prototype.render=function(){var o=this.props,n=o.children,i=o.forwardedRef,p=o.style,c=(o.className,o.ref,t.__rest(o,["children","forwardedRef","style","className","ref"])),x=Object.keys(c).reduce((function(e,t){if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase()){var r=t.substring(2).toLowerCase();"undefined"!=typeof document&&s(r,document)&&(e[t]=c[t])}else e[t]=c[t];return e}),{});a&&(x=a(this.props,x));var f=t.__assign(t.__assign({},x),{ref:u(i,this.setComponentElRef),style:p});return r.createElement(e,f,n)},Object.defineProperty(c,"displayName",{get:function(){return p},enumerable:!1,configurable:!0}),c}(r.Component);return o&&(c.contextType=o),function(e,o){var n=function(o,n){return r.createElement(e,t.__assign({},o,{forwardedRef:n}))};return n.displayName=o,r.forwardRef(n)}(c,p)};o.defineCustomElements();var c=p("vertex-avatar"),x=p("vertex-avatar-group"),f=p("vertex-button"),l=p("vertex-card"),d=p("vertex-card-group"),v=p("vertex-click-to-edit-textfield"),m=p("vertex-collapsible"),V=p("vertex-color-picker"),h=p("vertex-context-menu"),g=p("vertex-dialog"),b=p("vertex-dropdown-menu"),y=p("vertex-icon"),E=p("vertex-icon-button"),C=p("vertex-logo-loading"),_=p("vertex-menu"),w=p("vertex-menu-divider"),R=p("vertex-menu-item"),j=p("vertex-popover"),L=p("vertex-radio"),M=p("vertex-radio-group"),N=p("vertex-resizable"),O=p("vertex-select"),k=p("vertex-spinner"),T=p("vertex-textfield"),A=p("vertex-toast"),D=p("vertex-toggle"),P=p("vertex-tooltip");Object.keys(o).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return o[e]}})})),exports.VertexAvatar=c,exports.VertexAvatarGroup=x,exports.VertexButton=f,exports.VertexCard=l,exports.VertexCardGroup=d,exports.VertexClickToEditTextfield=v,exports.VertexCollapsible=m,exports.VertexColorPicker=V,exports.VertexContextMenu=h,exports.VertexDialog=g,exports.VertexDropdownMenu=b,exports.VertexIcon=y,exports.VertexIconButton=E,exports.VertexLogoLoading=C,exports.VertexMenu=_,exports.VertexMenuDivider=w,exports.VertexMenuItem=R,exports.VertexPopover=j,exports.VertexRadio=L,exports.VertexRadioGroup=M,exports.VertexResizable=N,exports.VertexSelect=O,exports.VertexSpinner=k,exports.VertexTextfield=T,exports.VertexToast=A,exports.VertexToggle=D,exports.VertexTooltip=P;
|
|
2
2
|
//# sourceMappingURL=bundle.cjs.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.cjs.min.js","sources":["../src/generated/react-component-lib/utils/attachProps.ts","../src/generated/react-component-lib/utils/index.tsx","../src/generated/react-component-lib/createComponent.tsx","../src/generated/react-component-lib/utils/case.ts","../src/generated/ui.ts"],"sourcesContent":["import { camelToDashCase } from './case';\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n // add any classes in className to the class list\n const className = getClassName(node.classList, newProps, oldProps);\n if (className !== '') {\n node.className = className;\n }\n\n Object.keys(newProps).forEach((name) => {\n if (\n name === 'children' ||\n name === 'style' ||\n name === 'ref' ||\n name === 'class' ||\n name === 'className' ||\n name === 'forwardedRef'\n ) {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (typeof document !== 'undefined' && !isCoveredByReact(eventNameLc, document)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n const propType = typeof newProps[name];\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name]);\n } else {\n (node as any)[name] = newProps[name];\n }\n }\n });\n }\n};\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class;\n const oldClassProp: string = oldProps.className || oldProps.class;\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach((s) => finalClassNames.push(s));\n return finalClassNames.join(' ');\n};\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix: string, doc: Document) => {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n};\n\nexport const syncEvent = (\n node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n eventName: string,\n newEventHandler?: (e: Event) => any,\n) => {\n const eventStore = node.__events || (node.__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n if (newEventHandler) {\n newEventHandler.call(this, e);\n }\n }),\n );\n};\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n};\n","import React from 'react';\n\nimport type { StyleReactProps } from '../interfaces';\n\ntype Mutable<T> = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ?\n\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// The comma in the type is to trick typescript because it things a single generic in a tsx file is jsx\nexport const mergeRefs = <ElementType,>(...refs: React.Ref<ElementType>[]) => (\n value: ElementType,\n) =>\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // This is typed as readonly so we need to allow for override\n (ref as Mutable<React.RefObject<ElementType>>).current = value;\n }\n });\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React from 'react';\n\nimport {\n attachProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n mergeRefs,\n} from './utils';\n\nexport interface HTMLStencilElement extends HTMLElement {\n componentOnReady(): Promise<this>;\n}\n\ninterface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef: React.RefObject<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <\n PropType,\n ElementType extends HTMLStencilElement,\n ContextStateType = {},\n ExpandedPropsTypes = {}\n>(\n tagName: string,\n ReactComponentContext?: React.Context<ContextStateType>,\n manipulatePropsFunction?: (\n originalProps: StencilReactInternalProps<ElementType>,\n propsToPass: any,\n ) => ExpandedPropsTypes,\n) => {\n const displayName = dashToPascalCase(tagName);\n\n const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {\n componentEl!: ElementType;\n\n setComponentElRef = (element: ElementType) => {\n this.componentEl = element;\n };\n\n constructor(props: StencilReactInternalProps<ElementType>) {\n super(props);\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: StencilReactInternalProps<ElementType>) {\n attachProps(this.componentEl, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n let propsToPass = Object.keys(cProps).reduce((acc, name) => {\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== 'undefined' && isCoveredByReact(eventName, document)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n let newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n\n // If context was passed to createReactComponent then conditionally add it to the Component Class\n if (ReactComponentContext) {\n ReactComponent.contextType = ReactComponentContext;\n }\n\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","export const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\nexport const camelToDashCase = (str: string) =>\n str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport type { JSX } from '@vertexvis/ui';\n\nimport { defineCustomElements } from '@vertexvis/ui/loader';\n\ndefineCustomElements();\nexport const VertexAvatar = /*@__PURE__*/createReactComponent<JSX.VertexAvatar, HTMLVertexAvatarElement>('vertex-avatar');\nexport const VertexButton = /*@__PURE__*/createReactComponent<JSX.VertexButton, HTMLVertexButtonElement>('vertex-button');\nexport const VertexClickToEditTextfield = /*@__PURE__*/createReactComponent<JSX.VertexClickToEditTextfield, HTMLVertexClickToEditTextfieldElement>('vertex-click-to-edit-textfield');\nexport const VertexCollapsible = /*@__PURE__*/createReactComponent<JSX.VertexCollapsible, HTMLVertexCollapsibleElement>('vertex-collapsible');\nexport const VertexColorPicker = /*@__PURE__*/createReactComponent<JSX.VertexColorPicker, HTMLVertexColorPickerElement>('vertex-color-picker');\nexport const VertexContextMenu = /*@__PURE__*/createReactComponent<JSX.VertexContextMenu, HTMLVertexContextMenuElement>('vertex-context-menu');\nexport const VertexDialog = /*@__PURE__*/createReactComponent<JSX.VertexDialog, HTMLVertexDialogElement>('vertex-dialog');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexIcon = /*@__PURE__*/createReactComponent<JSX.VertexIcon, HTMLVertexIconElement>('vertex-icon');\nexport const VertexIconButton = /*@__PURE__*/createReactComponent<JSX.VertexIconButton, HTMLVertexIconButtonElement>('vertex-icon-button');\nexport const VertexMenu = /*@__PURE__*/createReactComponent<JSX.VertexMenu, HTMLVertexMenuElement>('vertex-menu');\nexport const VertexMenuDivider = /*@__PURE__*/createReactComponent<JSX.VertexMenuDivider, HTMLVertexMenuDividerElement>('vertex-menu-divider');\nexport const VertexMenuItem = /*@__PURE__*/createReactComponent<JSX.VertexMenuItem, HTMLVertexMenuItemElement>('vertex-menu-item');\nexport const VertexPopover = /*@__PURE__*/createReactComponent<JSX.VertexPopover, HTMLVertexPopoverElement>('vertex-popover');\nexport const VertexResizable = /*@__PURE__*/createReactComponent<JSX.VertexResizable, HTMLVertexResizableElement>('vertex-resizable');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSpinner = /*@__PURE__*/createReactComponent<JSX.VertexSpinner, HTMLVertexSpinnerElement>('vertex-spinner');\nexport const VertexTextfield = /*@__PURE__*/createReactComponent<JSX.VertexTextfield, HTMLVertexTextfieldElement>('vertex-textfield');\nexport const VertexToggle = /*@__PURE__*/createReactComponent<JSX.VertexToggle, HTMLVertexToggleElement>('vertex-toggle');\nexport const VertexTooltip = /*@__PURE__*/createReactComponent<JSX.VertexTooltip, HTMLVertexTooltipElement>('vertex-tooltip');\n"],"names":["getClassName","classList","newProps","oldProps","newClassProp","className","class","oldClassProp","currentClasses","arrayToMap","incomingPropClasses","split","oldPropClasses","finalClassNames","forEach","currentClass","has","push","delete","s","join","isCoveredByReact","eventNameSuffix","doc","eventName","isSupported","element","createElement","setAttribute","syncEvent","node","newEventHandler","eventStore","__events","oldEventHandler","removeEventListener","addEventListener","e","call","this","arr","map","Map","set","mergeRefs","_i","refs","value","ref","current","createReactComponent","tagName","ReactComponentContext","manipulatePropsFunction","displayName","toLowerCase","segment","charAt","toUpperCase","slice","ReactComponent","props","_super","_this","componentEl","__extends","class_1","componentDidUpdate","prevProps","Element","Object","keys","name","indexOf","substring","eventNameLc","document","replace","m","attachProps","_a","children","forwardedRef","style","cProps","propsToPass","reduce","acc","setComponentElRef","React","Component","contextType","forwardRef","createForwardRef","loader","VertexAvatar","VertexButton","VertexClickToEditTextfield","VertexCollapsible","VertexColorPicker","VertexContextMenu","VertexDialog","VertexDropdownMenu","VertexIcon","VertexIconButton","VertexMenu","VertexMenuDivider","VertexMenuItem","VertexPopover","VertexResizable","VertexSelect","VertexSpinner","VertexTextfield","VertexToggle","VertexTooltip"],"mappings":"8NA0CaA,EAAe,SAACC,EAAyBC,EAAeC,GACnE,IAAMC,EAAuBF,EAASG,WAAaH,EAASI,MACtDC,EAAuBJ,EAASE,WAAaF,EAASG,MAEtDE,EAAiBC,EAAWR,GAC5BS,EAAsBD,EAAWL,EAAeA,EAAaO,MAAM,KAAO,IAC1EC,EAAiBH,EAAWF,EAAeA,EAAaI,MAAM,KAAO,IACrEE,EAA4B,GAclC,OAXAL,EAAeM,SAAQ,SAACC,GAClBL,EAAoBM,IAAID,IAE1BF,EAAgBI,KAAKF,GACrBL,EAAoBQ,OAAOH,IACjBH,EAAeI,IAAID,IAE7BF,EAAgBI,KAAKF,MAGzBL,EAAoBI,SAAQ,SAACK,GAAM,OAAAN,EAAgBI,KAAKE,MACjDN,EAAgBO,KAAK,MAOjBC,EAAmB,SAACC,EAAyBC,GACxD,IAAMC,EAAY,KAAOF,EACrBG,E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EACAN,GAEA,IAAMsC,EAAa,SACjB/B,EACAb,GAEA,OAAOyC,gBAAC7B,gBAAmBC,GAAOqB,aAAclC,MAIlD,OAFA4C,EAAWtC,YAAcA,EAElBmC,EAAMG,WAAWA,GCwDjBC,CAAwCjC,EAAgBN,IE1FjEwC,6BASaC,EAA4B7C,EAAgE,iBAC5F8C,EAA4B9C,EAAgE,iBAC5F+C,EAA0C/C,EAA4F,kCACtIgD,EAAiChD,EAA0E,sBAC3GiD,EAAiCjD,EAA0E,uBAC3GkD,EAAiClD,EAA0E,uBAC3GmD,EAA4BnD,EAAgE,iBAC5FoD,EAAkCpD,EAA4E,wBAC9GqD,EAA0BrD,EAA4D,eACtFsD,EAAgCtD,EAAwE,sBACxGuD,EAA0BvD,EAA4D,eACtFwD,EAAiCxD,EAA0E,uBAC3GyD,EAA8BzD,EAAoE,oBAClG0D,EAA6B1D,EAAkE,kBAC/F2D,EAA+B3D,EAAsE,oBACrG4D,EAA4B5D,EAAgE,iBAC5F6D,EAA6B7D,EAAkE,kBAC/F8D,EAA+B9D,EAAsE,oBACrG+D,EAA4B/D,EAAgE,iBAC5FgE,EAA6BhE,EAAkE"}
|
|
1
|
+
{"version":3,"file":"bundle.cjs.min.js","sources":["../src/generated/react-component-lib/utils/attachProps.ts","../src/generated/react-component-lib/utils/index.tsx","../src/generated/react-component-lib/createComponent.tsx","../src/generated/react-component-lib/utils/case.ts","../src/generated/ui.ts"],"sourcesContent":["import { camelToDashCase } from './case';\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n // add any classes in className to the class list\n const className = getClassName(node.classList, newProps, oldProps);\n if (className !== '') {\n node.className = className;\n }\n\n Object.keys(newProps).forEach((name) => {\n if (\n name === 'children' ||\n name === 'style' ||\n name === 'ref' ||\n name === 'class' ||\n name === 'className' ||\n name === 'forwardedRef'\n ) {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (typeof document !== 'undefined' && !isCoveredByReact(eventNameLc, document)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n const propType = typeof newProps[name];\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name]);\n } else {\n (node as any)[name] = newProps[name];\n }\n }\n });\n }\n};\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class;\n const oldClassProp: string = oldProps.className || oldProps.class;\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach((s) => finalClassNames.push(s));\n return finalClassNames.join(' ');\n};\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix: string, doc: Document) => {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n};\n\nexport const syncEvent = (\n node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n eventName: string,\n newEventHandler?: (e: Event) => any,\n) => {\n const eventStore = node.__events || (node.__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n if (newEventHandler) {\n newEventHandler.call(this, e);\n }\n }),\n );\n};\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n};\n","import React from 'react';\n\nimport type { StyleReactProps } from '../interfaces';\n\ntype Mutable<T> = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ?\n\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// The comma in the type is to trick typescript because it things a single generic in a tsx file is jsx\nexport const mergeRefs = <ElementType,>(...refs: React.Ref<ElementType>[]) => (\n value: ElementType,\n) =>\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // This is typed as readonly so we need to allow for override\n (ref as Mutable<React.RefObject<ElementType>>).current = value;\n }\n });\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React from 'react';\n\nimport {\n attachProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n mergeRefs,\n} from './utils';\n\nexport interface HTMLStencilElement extends HTMLElement {\n componentOnReady(): Promise<this>;\n}\n\ninterface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef: React.RefObject<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <\n PropType,\n ElementType extends HTMLStencilElement,\n ContextStateType = {},\n ExpandedPropsTypes = {}\n>(\n tagName: string,\n ReactComponentContext?: React.Context<ContextStateType>,\n manipulatePropsFunction?: (\n originalProps: StencilReactInternalProps<ElementType>,\n propsToPass: any,\n ) => ExpandedPropsTypes,\n) => {\n const displayName = dashToPascalCase(tagName);\n\n const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {\n componentEl!: ElementType;\n\n setComponentElRef = (element: ElementType) => {\n this.componentEl = element;\n };\n\n constructor(props: StencilReactInternalProps<ElementType>) {\n super(props);\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: StencilReactInternalProps<ElementType>) {\n attachProps(this.componentEl, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n let propsToPass = Object.keys(cProps).reduce((acc, name) => {\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== 'undefined' && isCoveredByReact(eventName, document)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n let newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n\n // If context was passed to createReactComponent then conditionally add it to the Component Class\n if (ReactComponentContext) {\n ReactComponent.contextType = ReactComponentContext;\n }\n\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","export const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\nexport const camelToDashCase = (str: string) =>\n str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport type { JSX } from '@vertexvis/ui';\n\nimport { defineCustomElements } from '@vertexvis/ui/loader';\n\ndefineCustomElements();\nexport const VertexAvatar = /*@__PURE__*/createReactComponent<JSX.VertexAvatar, HTMLVertexAvatarElement>('vertex-avatar');\nexport const VertexAvatarGroup = /*@__PURE__*/createReactComponent<JSX.VertexAvatarGroup, HTMLVertexAvatarGroupElement>('vertex-avatar-group');\nexport const VertexButton = /*@__PURE__*/createReactComponent<JSX.VertexButton, HTMLVertexButtonElement>('vertex-button');\nexport const VertexCard = /*@__PURE__*/createReactComponent<JSX.VertexCard, HTMLVertexCardElement>('vertex-card');\nexport const VertexCardGroup = /*@__PURE__*/createReactComponent<JSX.VertexCardGroup, HTMLVertexCardGroupElement>('vertex-card-group');\nexport const VertexClickToEditTextfield = /*@__PURE__*/createReactComponent<JSX.VertexClickToEditTextfield, HTMLVertexClickToEditTextfieldElement>('vertex-click-to-edit-textfield');\nexport const VertexCollapsible = /*@__PURE__*/createReactComponent<JSX.VertexCollapsible, HTMLVertexCollapsibleElement>('vertex-collapsible');\nexport const VertexColorPicker = /*@__PURE__*/createReactComponent<JSX.VertexColorPicker, HTMLVertexColorPickerElement>('vertex-color-picker');\nexport const VertexContextMenu = /*@__PURE__*/createReactComponent<JSX.VertexContextMenu, HTMLVertexContextMenuElement>('vertex-context-menu');\nexport const VertexDialog = /*@__PURE__*/createReactComponent<JSX.VertexDialog, HTMLVertexDialogElement>('vertex-dialog');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexIcon = /*@__PURE__*/createReactComponent<JSX.VertexIcon, HTMLVertexIconElement>('vertex-icon');\nexport const VertexIconButton = /*@__PURE__*/createReactComponent<JSX.VertexIconButton, HTMLVertexIconButtonElement>('vertex-icon-button');\nexport const VertexLogoLoading = /*@__PURE__*/createReactComponent<JSX.VertexLogoLoading, HTMLVertexLogoLoadingElement>('vertex-logo-loading');\nexport const VertexMenu = /*@__PURE__*/createReactComponent<JSX.VertexMenu, HTMLVertexMenuElement>('vertex-menu');\nexport const VertexMenuDivider = /*@__PURE__*/createReactComponent<JSX.VertexMenuDivider, HTMLVertexMenuDividerElement>('vertex-menu-divider');\nexport const VertexMenuItem = /*@__PURE__*/createReactComponent<JSX.VertexMenuItem, HTMLVertexMenuItemElement>('vertex-menu-item');\nexport const VertexPopover = /*@__PURE__*/createReactComponent<JSX.VertexPopover, HTMLVertexPopoverElement>('vertex-popover');\nexport const VertexRadio = /*@__PURE__*/createReactComponent<JSX.VertexRadio, HTMLVertexRadioElement>('vertex-radio');\nexport const VertexRadioGroup = /*@__PURE__*/createReactComponent<JSX.VertexRadioGroup, HTMLVertexRadioGroupElement>('vertex-radio-group');\nexport const VertexResizable = /*@__PURE__*/createReactComponent<JSX.VertexResizable, HTMLVertexResizableElement>('vertex-resizable');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSpinner = /*@__PURE__*/createReactComponent<JSX.VertexSpinner, HTMLVertexSpinnerElement>('vertex-spinner');\nexport const VertexTextfield = /*@__PURE__*/createReactComponent<JSX.VertexTextfield, HTMLVertexTextfieldElement>('vertex-textfield');\nexport const VertexToast = /*@__PURE__*/createReactComponent<JSX.VertexToast, HTMLVertexToastElement>('vertex-toast');\nexport const VertexToggle = /*@__PURE__*/createReactComponent<JSX.VertexToggle, HTMLVertexToggleElement>('vertex-toggle');\nexport const VertexTooltip = /*@__PURE__*/createReactComponent<JSX.VertexTooltip, HTMLVertexTooltipElement>('vertex-tooltip');\n"],"names":["getClassName","classList","newProps","oldProps","newClassProp","className","class","oldClassProp","currentClasses","arrayToMap","incomingPropClasses","split","oldPropClasses","finalClassNames","forEach","currentClass","has","push","delete","s","join","isCoveredByReact","eventNameSuffix","doc","eventName","isSupported","element","createElement","setAttribute","syncEvent","node","newEventHandler","eventStore","__events","oldEventHandler","removeEventListener","addEventListener","e","call","this","arr","map","Map","set","mergeRefs","_i","refs","value","ref","current","createReactComponent","tagName","ReactComponentContext","manipulatePropsFunction","displayName","toLowerCase","segment","charAt","toUpperCase","slice","ReactComponent","props","_super","_this","componentEl","__extends","class_1","componentDidUpdate","prevProps","Element","Object","keys","name","indexOf","substring","eventNameLc","document","replace","m","attachProps","_a","children","forwardedRef","style","cProps","propsToPass","reduce","acc","setComponentElRef","React","Component","contextType","forwardRef","createForwardRef","loader","VertexAvatar","VertexAvatarGroup","VertexButton","VertexCard","VertexCardGroup","VertexClickToEditTextfield","VertexCollapsible","VertexColorPicker","VertexContextMenu","VertexDialog","VertexDropdownMenu","VertexIcon","VertexIconButton","VertexLogoLoading","VertexMenu","VertexMenuDivider","VertexMenuItem","VertexPopover","VertexRadio","VertexRadioGroup","VertexResizable","VertexSelect","VertexSpinner","VertexTextfield","VertexToast","VertexToggle","VertexTooltip"],"mappings":"8NA0CaA,EAAe,SAACC,EAAyBC,EAAeC,GACnE,IAAMC,EAAuBF,EAASG,WAAaH,EAASI,MACtDC,EAAuBJ,EAASE,WAAaF,EAASG,MAEtDE,EAAiBC,EAAWR,GAC5BS,EAAsBD,EAAWL,EAAeA,EAAaO,MAAM,KAAO,IAC1EC,EAAiBH,EAAWF,EAAeA,EAAaI,MAAM,KAAO,IACrEE,EAA4B,GAclC,OAXAL,EAAeM,SAAQ,SAACC,GAClBL,EAAoBM,IAAID,IAE1BF,EAAgBI,KAAKF,GACrBL,EAAoBQ,OAAOH,IACjBH,EAAeI,IAAID,IAE7BF,EAAgBI,KAAKF,MAGzBL,EAAoBI,SAAQ,SAACK,GAAM,OAAAN,EAAgBI,KAAKE,MACjDN,EAAgBO,KAAK,MAOjBC,EAAmB,SAACC,EAAyBC,GACxD,IAAMC,EAAY,KAAOF,EACrBG,EAAcD,KAAaD,EAE/B,IAAKE,EAAa,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,EACAb,GAEA,OAAOyC,gBAAC7B,gBAAmBC,GAAOqB,aAAclC,MAIlD,OAFA4C,EAAWtC,YAAcA,EAElBmC,EAAMG,WAAWA,GCwDjBC,CAAwCjC,EAAgBN,IE1FjEwC,6BASaC,EAA4B7C,EAAgE,iBAC5F8C,EAAiC9C,EAA0E,uBAC3G+C,EAA4B/C,EAAgE,iBAC5FgD,EAA0BhD,EAA4D,eACtFiD,EAA+BjD,EAAsE,qBACrGkD,EAA0ClD,EAA4F,kCACtImD,EAAiCnD,EAA0E,sBAC3GoD,EAAiCpD,EAA0E,uBAC3GqD,EAAiCrD,EAA0E,uBAC3GsD,EAA4BtD,EAAgE,iBAC5FuD,EAAkCvD,EAA4E,wBAC9GwD,EAA0BxD,EAA4D,eACtFyD,EAAgCzD,EAAwE,sBACxG0D,EAAiC1D,EAA0E,uBAC3G2D,EAA0B3D,EAA4D,eACtF4D,EAAiC5D,EAA0E,uBAC3G6D,EAA8B7D,EAAoE,oBAClG8D,EAA6B9D,EAAkE,kBAC/F+D,EAA2B/D,EAA8D,gBACzFgE,EAAgChE,EAAwE,sBACxGiE,EAA+BjE,EAAsE,oBACrGkE,EAA4BlE,EAAgE,iBAC5FmE,EAA6BnE,EAAkE,kBAC/FoE,EAA+BpE,EAAsE,oBACrGqE,EAA2BrE,EAA8D,gBACzFsE,EAA4BtE,EAAgE,iBAC5FuE,EAA6BvE,EAAkE"}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -193,7 +193,10 @@ var createReactComponent = function (tagName, ReactComponentContext, manipulateP
|
|
|
193
193
|
/* eslint-disable */
|
|
194
194
|
defineCustomElements();
|
|
195
195
|
var VertexAvatar = /*@__PURE__*/ createReactComponent('vertex-avatar');
|
|
196
|
+
var VertexAvatarGroup = /*@__PURE__*/ createReactComponent('vertex-avatar-group');
|
|
196
197
|
var VertexButton = /*@__PURE__*/ createReactComponent('vertex-button');
|
|
198
|
+
var VertexCard = /*@__PURE__*/ createReactComponent('vertex-card');
|
|
199
|
+
var VertexCardGroup = /*@__PURE__*/ createReactComponent('vertex-card-group');
|
|
197
200
|
var VertexClickToEditTextfield = /*@__PURE__*/ createReactComponent('vertex-click-to-edit-textfield');
|
|
198
201
|
var VertexCollapsible = /*@__PURE__*/ createReactComponent('vertex-collapsible');
|
|
199
202
|
var VertexColorPicker = /*@__PURE__*/ createReactComponent('vertex-color-picker');
|
|
@@ -202,16 +205,20 @@ var VertexDialog = /*@__PURE__*/ createReactComponent('vertex-dialog');
|
|
|
202
205
|
var VertexDropdownMenu = /*@__PURE__*/ createReactComponent('vertex-dropdown-menu');
|
|
203
206
|
var VertexIcon = /*@__PURE__*/ createReactComponent('vertex-icon');
|
|
204
207
|
var VertexIconButton = /*@__PURE__*/ createReactComponent('vertex-icon-button');
|
|
208
|
+
var VertexLogoLoading = /*@__PURE__*/ createReactComponent('vertex-logo-loading');
|
|
205
209
|
var VertexMenu = /*@__PURE__*/ createReactComponent('vertex-menu');
|
|
206
210
|
var VertexMenuDivider = /*@__PURE__*/ createReactComponent('vertex-menu-divider');
|
|
207
211
|
var VertexMenuItem = /*@__PURE__*/ createReactComponent('vertex-menu-item');
|
|
208
212
|
var VertexPopover = /*@__PURE__*/ createReactComponent('vertex-popover');
|
|
213
|
+
var VertexRadio = /*@__PURE__*/ createReactComponent('vertex-radio');
|
|
214
|
+
var VertexRadioGroup = /*@__PURE__*/ createReactComponent('vertex-radio-group');
|
|
209
215
|
var VertexResizable = /*@__PURE__*/ createReactComponent('vertex-resizable');
|
|
210
216
|
var VertexSelect = /*@__PURE__*/ createReactComponent('vertex-select');
|
|
211
217
|
var VertexSpinner = /*@__PURE__*/ createReactComponent('vertex-spinner');
|
|
212
218
|
var VertexTextfield = /*@__PURE__*/ createReactComponent('vertex-textfield');
|
|
219
|
+
var VertexToast = /*@__PURE__*/ createReactComponent('vertex-toast');
|
|
213
220
|
var VertexToggle = /*@__PURE__*/ createReactComponent('vertex-toggle');
|
|
214
221
|
var VertexTooltip = /*@__PURE__*/ createReactComponent('vertex-tooltip');
|
|
215
222
|
|
|
216
|
-
export { VertexAvatar, VertexButton, VertexClickToEditTextfield, VertexCollapsible, VertexColorPicker, VertexContextMenu, VertexDialog, VertexDropdownMenu, VertexIcon, VertexIconButton, VertexMenu, VertexMenuDivider, VertexMenuItem, VertexPopover, VertexResizable, VertexSelect, VertexSpinner, VertexTextfield, VertexToggle, VertexTooltip };
|
|
223
|
+
export { VertexAvatar, VertexAvatarGroup, VertexButton, VertexCard, VertexCardGroup, VertexClickToEditTextfield, VertexCollapsible, VertexColorPicker, VertexContextMenu, VertexDialog, VertexDropdownMenu, VertexIcon, VertexIconButton, VertexLogoLoading, VertexMenu, VertexMenuDivider, VertexMenuItem, VertexPopover, VertexRadio, VertexRadioGroup, VertexResizable, VertexSelect, VertexSpinner, VertexTextfield, VertexToast, VertexToggle, VertexTooltip };
|
|
217
224
|
//# sourceMappingURL=bundle.esm.js.map
|
package/dist/bundle.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.esm.js","sources":["../src/generated/react-component-lib/utils/case.ts","../src/generated/react-component-lib/utils/attachProps.ts","../src/generated/react-component-lib/utils/index.tsx","../src/generated/react-component-lib/createComponent.tsx","../src/generated/ui.ts"],"sourcesContent":["export const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\nexport const camelToDashCase = (str: string) =>\n str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);\n","import { camelToDashCase } from './case';\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n // add any classes in className to the class list\n const className = getClassName(node.classList, newProps, oldProps);\n if (className !== '') {\n node.className = className;\n }\n\n Object.keys(newProps).forEach((name) => {\n if (\n name === 'children' ||\n name === 'style' ||\n name === 'ref' ||\n name === 'class' ||\n name === 'className' ||\n name === 'forwardedRef'\n ) {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (typeof document !== 'undefined' && !isCoveredByReact(eventNameLc, document)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n const propType = typeof newProps[name];\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name]);\n } else {\n (node as any)[name] = newProps[name];\n }\n }\n });\n }\n};\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class;\n const oldClassProp: string = oldProps.className || oldProps.class;\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach((s) => finalClassNames.push(s));\n return finalClassNames.join(' ');\n};\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix: string, doc: Document) => {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n};\n\nexport const syncEvent = (\n node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n eventName: string,\n newEventHandler?: (e: Event) => any,\n) => {\n const eventStore = node.__events || (node.__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n if (newEventHandler) {\n newEventHandler.call(this, e);\n }\n }),\n );\n};\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n};\n","import React from 'react';\n\nimport type { StyleReactProps } from '../interfaces';\n\ntype Mutable<T> = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ?\n\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// The comma in the type is to trick typescript because it things a single generic in a tsx file is jsx\nexport const mergeRefs = <ElementType,>(...refs: React.Ref<ElementType>[]) => (\n value: ElementType,\n) =>\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // This is typed as readonly so we need to allow for override\n (ref as Mutable<React.RefObject<ElementType>>).current = value;\n }\n });\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React from 'react';\n\nimport {\n attachProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n mergeRefs,\n} from './utils';\n\nexport interface HTMLStencilElement extends HTMLElement {\n componentOnReady(): Promise<this>;\n}\n\ninterface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef: React.RefObject<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <\n PropType,\n ElementType extends HTMLStencilElement,\n ContextStateType = {},\n ExpandedPropsTypes = {}\n>(\n tagName: string,\n ReactComponentContext?: React.Context<ContextStateType>,\n manipulatePropsFunction?: (\n originalProps: StencilReactInternalProps<ElementType>,\n propsToPass: any,\n ) => ExpandedPropsTypes,\n) => {\n const displayName = dashToPascalCase(tagName);\n\n const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {\n componentEl!: ElementType;\n\n setComponentElRef = (element: ElementType) => {\n this.componentEl = element;\n };\n\n constructor(props: StencilReactInternalProps<ElementType>) {\n super(props);\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: StencilReactInternalProps<ElementType>) {\n attachProps(this.componentEl, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n let propsToPass = Object.keys(cProps).reduce((acc, name) => {\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== 'undefined' && isCoveredByReact(eventName, document)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n let newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n\n // If context was passed to createReactComponent then conditionally add it to the Component Class\n if (ReactComponentContext) {\n ReactComponent.contextType = ReactComponentContext;\n }\n\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport type { JSX } from '@vertexvis/ui';\n\nimport { defineCustomElements } from '@vertexvis/ui/loader';\n\ndefineCustomElements();\nexport const VertexAvatar = /*@__PURE__*/createReactComponent<JSX.VertexAvatar, HTMLVertexAvatarElement>('vertex-avatar');\nexport const VertexButton = /*@__PURE__*/createReactComponent<JSX.VertexButton, HTMLVertexButtonElement>('vertex-button');\nexport const VertexClickToEditTextfield = /*@__PURE__*/createReactComponent<JSX.VertexClickToEditTextfield, HTMLVertexClickToEditTextfieldElement>('vertex-click-to-edit-textfield');\nexport const VertexCollapsible = /*@__PURE__*/createReactComponent<JSX.VertexCollapsible, HTMLVertexCollapsibleElement>('vertex-collapsible');\nexport const VertexColorPicker = /*@__PURE__*/createReactComponent<JSX.VertexColorPicker, HTMLVertexColorPickerElement>('vertex-color-picker');\nexport const VertexContextMenu = /*@__PURE__*/createReactComponent<JSX.VertexContextMenu, HTMLVertexContextMenuElement>('vertex-context-menu');\nexport const VertexDialog = /*@__PURE__*/createReactComponent<JSX.VertexDialog, HTMLVertexDialogElement>('vertex-dialog');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexIcon = /*@__PURE__*/createReactComponent<JSX.VertexIcon, HTMLVertexIconElement>('vertex-icon');\nexport const VertexIconButton = /*@__PURE__*/createReactComponent<JSX.VertexIconButton, HTMLVertexIconButtonElement>('vertex-icon-button');\nexport const VertexMenu = /*@__PURE__*/createReactComponent<JSX.VertexMenu, HTMLVertexMenuElement>('vertex-menu');\nexport const VertexMenuDivider = /*@__PURE__*/createReactComponent<JSX.VertexMenuDivider, HTMLVertexMenuDividerElement>('vertex-menu-divider');\nexport const VertexMenuItem = /*@__PURE__*/createReactComponent<JSX.VertexMenuItem, HTMLVertexMenuItemElement>('vertex-menu-item');\nexport const VertexPopover = /*@__PURE__*/createReactComponent<JSX.VertexPopover, HTMLVertexPopoverElement>('vertex-popover');\nexport const VertexResizable = /*@__PURE__*/createReactComponent<JSX.VertexResizable, HTMLVertexResizableElement>('vertex-resizable');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSpinner = /*@__PURE__*/createReactComponent<JSX.VertexSpinner, HTMLVertexSpinnerElement>('vertex-spinner');\nexport const VertexTextfield = /*@__PURE__*/createReactComponent<JSX.VertexTextfield, HTMLVertexTextfieldElement>('vertex-textfield');\nexport const VertexToggle = /*@__PURE__*/createReactComponent<JSX.VertexToggle, HTMLVertexToggleElement>('vertex-toggle');\nexport const VertexTooltip = /*@__PURE__*/createReactComponent<JSX.VertexTooltip, HTMLVertexTooltipElement>('vertex-tooltip');\n"],"names":[],"mappings":";;;;;;AAAO,IAAM,gBAAgB,GAAG,UAAC,GAAW;IAC1C,OAAA,GAAG;SACA,WAAW,EAAE;SACb,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,UAAC,OAAO,IAAK,OAAA,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAA,CAAC;SACpE,IAAI,CAAC,EAAE,CAAC;AAJX,CAIW,CAAC;AACP,IAAM,eAAe,GAAG,UAAC,GAAW;IACzC,OAAA,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,UAAC,CAAS,IAAK,OAAA,MAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAI,GAAA,CAAC;AAAhE,CAAgE;;ACL3D,IAAM,WAAW,GAAG,UAAC,IAAiB,EAAE,QAAa,EAAE,QAAkB;IAAlB,yBAAA,EAAA,aAAkB;;IAE9E,IAAI,IAAI,YAAY,OAAO,EAAE;;QAE3B,IAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnE,IAAI,SAAS,KAAK,EAAE,EAAE;YACpB,IAAI,CAAC,SAAS,GAAG,SAAS,CAA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IAAa,aAAa,iBAAgB,oBAAoB,CAA8C,gBAAgB,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"bundle.esm.js","sources":["../src/generated/react-component-lib/utils/case.ts","../src/generated/react-component-lib/utils/attachProps.ts","../src/generated/react-component-lib/utils/index.tsx","../src/generated/react-component-lib/createComponent.tsx","../src/generated/ui.ts"],"sourcesContent":["export const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\nexport const camelToDashCase = (str: string) =>\n str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);\n","import { camelToDashCase } from './case';\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n // add any classes in className to the class list\n const className = getClassName(node.classList, newProps, oldProps);\n if (className !== '') {\n node.className = className;\n }\n\n Object.keys(newProps).forEach((name) => {\n if (\n name === 'children' ||\n name === 'style' ||\n name === 'ref' ||\n name === 'class' ||\n name === 'className' ||\n name === 'forwardedRef'\n ) {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (typeof document !== 'undefined' && !isCoveredByReact(eventNameLc, document)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n const propType = typeof newProps[name];\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name]);\n } else {\n (node as any)[name] = newProps[name];\n }\n }\n });\n }\n};\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class;\n const oldClassProp: string = oldProps.className || oldProps.class;\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach((s) => finalClassNames.push(s));\n return finalClassNames.join(' ');\n};\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix: string, doc: Document) => {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n};\n\nexport const syncEvent = (\n node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n eventName: string,\n newEventHandler?: (e: Event) => any,\n) => {\n const eventStore = node.__events || (node.__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n if (newEventHandler) {\n newEventHandler.call(this, e);\n }\n }),\n );\n};\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n};\n","import React from 'react';\n\nimport type { StyleReactProps } from '../interfaces';\n\ntype Mutable<T> = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ?\n\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// The comma in the type is to trick typescript because it things a single generic in a tsx file is jsx\nexport const mergeRefs = <ElementType,>(...refs: React.Ref<ElementType>[]) => (\n value: ElementType,\n) =>\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // This is typed as readonly so we need to allow for override\n (ref as Mutable<React.RefObject<ElementType>>).current = value;\n }\n });\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React from 'react';\n\nimport {\n attachProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n mergeRefs,\n} from './utils';\n\nexport interface HTMLStencilElement extends HTMLElement {\n componentOnReady(): Promise<this>;\n}\n\ninterface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef: React.RefObject<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <\n PropType,\n ElementType extends HTMLStencilElement,\n ContextStateType = {},\n ExpandedPropsTypes = {}\n>(\n tagName: string,\n ReactComponentContext?: React.Context<ContextStateType>,\n manipulatePropsFunction?: (\n originalProps: StencilReactInternalProps<ElementType>,\n propsToPass: any,\n ) => ExpandedPropsTypes,\n) => {\n const displayName = dashToPascalCase(tagName);\n\n const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {\n componentEl!: ElementType;\n\n setComponentElRef = (element: ElementType) => {\n this.componentEl = element;\n };\n\n constructor(props: StencilReactInternalProps<ElementType>) {\n super(props);\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: StencilReactInternalProps<ElementType>) {\n attachProps(this.componentEl, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n let propsToPass = Object.keys(cProps).reduce((acc, name) => {\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== 'undefined' && isCoveredByReact(eventName, document)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n let newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n\n // If context was passed to createReactComponent then conditionally add it to the Component Class\n if (ReactComponentContext) {\n ReactComponent.contextType = ReactComponentContext;\n }\n\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport type { JSX } from '@vertexvis/ui';\n\nimport { defineCustomElements } from '@vertexvis/ui/loader';\n\ndefineCustomElements();\nexport const VertexAvatar = /*@__PURE__*/createReactComponent<JSX.VertexAvatar, HTMLVertexAvatarElement>('vertex-avatar');\nexport const VertexAvatarGroup = /*@__PURE__*/createReactComponent<JSX.VertexAvatarGroup, HTMLVertexAvatarGroupElement>('vertex-avatar-group');\nexport const VertexButton = /*@__PURE__*/createReactComponent<JSX.VertexButton, HTMLVertexButtonElement>('vertex-button');\nexport const VertexCard = /*@__PURE__*/createReactComponent<JSX.VertexCard, HTMLVertexCardElement>('vertex-card');\nexport const VertexCardGroup = /*@__PURE__*/createReactComponent<JSX.VertexCardGroup, HTMLVertexCardGroupElement>('vertex-card-group');\nexport const VertexClickToEditTextfield = /*@__PURE__*/createReactComponent<JSX.VertexClickToEditTextfield, HTMLVertexClickToEditTextfieldElement>('vertex-click-to-edit-textfield');\nexport const VertexCollapsible = /*@__PURE__*/createReactComponent<JSX.VertexCollapsible, HTMLVertexCollapsibleElement>('vertex-collapsible');\nexport const VertexColorPicker = /*@__PURE__*/createReactComponent<JSX.VertexColorPicker, HTMLVertexColorPickerElement>('vertex-color-picker');\nexport const VertexContextMenu = /*@__PURE__*/createReactComponent<JSX.VertexContextMenu, HTMLVertexContextMenuElement>('vertex-context-menu');\nexport const VertexDialog = /*@__PURE__*/createReactComponent<JSX.VertexDialog, HTMLVertexDialogElement>('vertex-dialog');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexIcon = /*@__PURE__*/createReactComponent<JSX.VertexIcon, HTMLVertexIconElement>('vertex-icon');\nexport const VertexIconButton = /*@__PURE__*/createReactComponent<JSX.VertexIconButton, HTMLVertexIconButtonElement>('vertex-icon-button');\nexport const VertexLogoLoading = /*@__PURE__*/createReactComponent<JSX.VertexLogoLoading, HTMLVertexLogoLoadingElement>('vertex-logo-loading');\nexport const VertexMenu = /*@__PURE__*/createReactComponent<JSX.VertexMenu, HTMLVertexMenuElement>('vertex-menu');\nexport const VertexMenuDivider = /*@__PURE__*/createReactComponent<JSX.VertexMenuDivider, HTMLVertexMenuDividerElement>('vertex-menu-divider');\nexport const VertexMenuItem = /*@__PURE__*/createReactComponent<JSX.VertexMenuItem, HTMLVertexMenuItemElement>('vertex-menu-item');\nexport const VertexPopover = /*@__PURE__*/createReactComponent<JSX.VertexPopover, HTMLVertexPopoverElement>('vertex-popover');\nexport const VertexRadio = /*@__PURE__*/createReactComponent<JSX.VertexRadio, HTMLVertexRadioElement>('vertex-radio');\nexport const VertexRadioGroup = /*@__PURE__*/createReactComponent<JSX.VertexRadioGroup, HTMLVertexRadioGroupElement>('vertex-radio-group');\nexport const VertexResizable = /*@__PURE__*/createReactComponent<JSX.VertexResizable, HTMLVertexResizableElement>('vertex-resizable');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSpinner = /*@__PURE__*/createReactComponent<JSX.VertexSpinner, HTMLVertexSpinnerElement>('vertex-spinner');\nexport const VertexTextfield = /*@__PURE__*/createReactComponent<JSX.VertexTextfield, HTMLVertexTextfieldElement>('vertex-textfield');\nexport const VertexToast = /*@__PURE__*/createReactComponent<JSX.VertexToast, HTMLVertexToastElement>('vertex-toast');\nexport const VertexToggle = /*@__PURE__*/createReactComponent<JSX.VertexToggle, HTMLVertexToggleElement>('vertex-toggle');\nexport const VertexTooltip = /*@__PURE__*/createReactComponent<JSX.VertexTooltip, HTMLVertexTooltipElement>('vertex-tooltip');\n"],"names":[],"mappings":";;;;;;AAAO,IAAM,gBAAgB,GAAG,UAAC,GAAW;IAC1C,OAAA,GAAG;SACA,WAAW,EAAE;SACb,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,UAAC,OAAO,IAAK,OAAA,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAA,CAAC;SACpE,IAAI,CAAC,EAAE,CAAC;AAJX,CAIW,CAAC;AACP,IAAM,eAAe,GAAG,UAAC,GAAW;IACzC,OAAA,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,UAAC,CAAS,IAAK,OAAA,MAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAI,GAAA,CAAC;AAAhE,CAAgE;;ACL3D,IAAM,WAAW,GAAG,UAAC,IAAiB,EAAE,QAAa,EAAE,QAAkB;IAAlB,yBAAA,EAAA,aAAkB;;IAE9E,IAAI,IAAI,YAAY,OAAO,EAAE;;QAE3B,IAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnE,IAAI,SAAS,KAAK,EAAE,EAAE;YACpB,IAAI,CAAC,SAAS,GAAG,SAAS,CA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ACtH,IAAa,gBAAgB,iBAAgB,oBAAoB,CAAoD,oBAAoB,CAAC,CAAC;AAC3I,IAAa,eAAe,iBAAgB,oBAAoB,CAAkD,kBAAkB,CAAC,CAAC;AACtI,IAAa,YAAY,iBAAgB,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,IAAa,aAAa,iBAAgB,oBAAoB,CAA8C,gBAAgB,CAAC,CAAC;AAC9H,IAAa,eAAe,iBAAgB,oBAAoB,CAAkD,kBAAkB,CAAC,CAAC;AACtI,IAAa,WAAW,iBAAgB,oBAAoB,CAA0C,cAAc,CAAC,CAAC;AACtH,IAAa,YAAY,iBAAgB,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,IAAa,aAAa,iBAAgB,oBAAoB,CAA8C,gBAAgB,CAAC;;;;"}
|
package/dist/bundle.esm.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__extends as t,__rest as r}from"tslib";import n from"react";import"react-dom";import{defineCustomElements as o}from"@vertexvis/ui/loader";export*from"@vertexvis/ui/loader";var i=function(e,t,r){var n=t.className||t.class,o=r.className||r.class,i=
|
|
1
|
+
import{__assign as e,__extends as t,__rest as r}from"tslib";import n from"react";import"react-dom";import{defineCustomElements as o}from"@vertexvis/ui/loader";export*from"@vertexvis/ui/loader";var i=function(e,t,r){var n=t.className||t.class,o=r.className||r.class,i=c(e),a=c(n?n.split(" "):[]),s=c(o?o.split(" "):[]),u=[];return i.forEach((function(e){a.has(e)?(u.push(e),a.delete(e)):s.has(e)||u.push(e)})),a.forEach((function(e){return u.push(e)})),u.join(" ")},a=function(e,t){var r="on"+e,n=r in t;if(!n){var o=t.createElement("div");o.setAttribute(r,"return;"),n="function"==typeof o[r]}return n},s=function(e,t,r){var n=e.__events||(e.__events={}),o=n[t];o&&e.removeEventListener(t,o),e.addEventListener(t,n[t]=function(e){r&&r.call(this,e)})},c=function(e){var t=new Map;return e.forEach((function(e){return t.set(e,e)})),t},u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.forEach((function(e){"function"==typeof e?e(t):null!=e&&(e.current=t)}))}},f=function(o,c,f){var p=o.toLowerCase().split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(""),l=function(c){function l(e){var t=c.call(this,e)||this;return t.setComponentElRef=function(e){t.componentEl=e},t}return t(l,c),l.prototype.componentDidMount=function(){this.componentDidUpdate(this.props)},l.prototype.componentDidUpdate=function(e){!function(e,t,r){if(void 0===r&&(r={}),e instanceof Element){var n=i(e.classList,t,r);""!==n&&(e.className=n),Object.keys(t).forEach((function(r){if("children"!==r&&"style"!==r&&"ref"!==r&&"class"!==r&&"className"!==r&&"forwardedRef"!==r)if(0===r.indexOf("on")&&r[2]===r[2].toUpperCase()){var n=r.substring(2),o=n[0].toLowerCase()+n.substring(1);"undefined"==typeof document||a(o,document)||s(e,o,t[r])}else{e[r]=t[r],"string"===typeof t[r]?e.setAttribute(r.replace(/([A-Z])/g,(function(e){return"-"+e[0].toLowerCase()})),t[r]):e[r]=t[r]}}))}}(this.componentEl,this.props,e)},l.prototype.render=function(){var t=this.props,i=t.children,s=t.forwardedRef,c=t.style,p=(t.className,t.ref,r(t,["children","forwardedRef","style","className","ref"])),l=Object.keys(p).reduce((function(e,t){if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase()){var r=t.substring(2).toLowerCase();"undefined"!=typeof document&&a(r,document)&&(e[t]=p[t])}else e[t]=p[t];return e}),{});f&&(l=f(this.props,l));var v=e(e({},l),{ref:u(s,this.setComponentElRef),style:c});return n.createElement(o,v,i)},Object.defineProperty(l,"displayName",{get:function(){return p},enumerable:!1,configurable:!0}),l}(n.Component);return c&&(l.contextType=c),function(t,r){var o=function(r,o){return n.createElement(t,e({},r,{forwardedRef:o}))};return o.displayName=r,n.forwardRef(o)}(l,p)};o();var p=f("vertex-avatar"),l=f("vertex-avatar-group"),v=f("vertex-button"),d=f("vertex-card"),m=f("vertex-card-group"),x=f("vertex-click-to-edit-textfield"),h=f("vertex-collapsible"),y=f("vertex-color-picker"),g=f("vertex-context-menu"),b=f("vertex-dialog"),E=f("vertex-dropdown-menu"),w=f("vertex-icon"),C=f("vertex-icon-button"),N=f("vertex-logo-loading"),L=f("vertex-menu"),R=f("vertex-menu-divider"),j=f("vertex-menu-item"),O=f("vertex-popover"),U=f("vertex-radio"),k=f("vertex-radio-group"),A=f("vertex-resizable"),_=f("vertex-select"),D=f("vertex-spinner"),M=f("vertex-textfield"),z=f("vertex-toast"),P=f("vertex-toggle"),T=f("vertex-tooltip");export{p as VertexAvatar,l as VertexAvatarGroup,v as VertexButton,d as VertexCard,m as VertexCardGroup,x as VertexClickToEditTextfield,h as VertexCollapsible,y as VertexColorPicker,g as VertexContextMenu,b as VertexDialog,E as VertexDropdownMenu,w as VertexIcon,C as VertexIconButton,N as VertexLogoLoading,L as VertexMenu,R as VertexMenuDivider,j as VertexMenuItem,O as VertexPopover,U as VertexRadio,k as VertexRadioGroup,A as VertexResizable,_ as VertexSelect,D as VertexSpinner,M as VertexTextfield,z as VertexToast,P as VertexToggle,T as VertexTooltip};
|
|
2
2
|
//# sourceMappingURL=bundle.esm.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.esm.min.js","sources":["../src/generated/react-component-lib/utils/case.ts","../src/generated/react-component-lib/utils/attachProps.ts","../src/generated/react-component-lib/utils/index.tsx","../src/generated/react-component-lib/createComponent.tsx","../src/generated/ui.ts"],"sourcesContent":["export const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\nexport const camelToDashCase = (str: string) =>\n str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);\n","import { camelToDashCase } from './case';\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n // add any classes in className to the class list\n const className = getClassName(node.classList, newProps, oldProps);\n if (className !== '') {\n node.className = className;\n }\n\n Object.keys(newProps).forEach((name) => {\n if (\n name === 'children' ||\n name === 'style' ||\n name === 'ref' ||\n name === 'class' ||\n name === 'className' ||\n name === 'forwardedRef'\n ) {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (typeof document !== 'undefined' && !isCoveredByReact(eventNameLc, document)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n const propType = typeof newProps[name];\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name]);\n } else {\n (node as any)[name] = newProps[name];\n }\n }\n });\n }\n};\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class;\n const oldClassProp: string = oldProps.className || oldProps.class;\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach((s) => finalClassNames.push(s));\n return finalClassNames.join(' ');\n};\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix: string, doc: Document) => {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n};\n\nexport const syncEvent = (\n node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n eventName: string,\n newEventHandler?: (e: Event) => any,\n) => {\n const eventStore = node.__events || (node.__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n if (newEventHandler) {\n newEventHandler.call(this, e);\n }\n }),\n );\n};\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n};\n","import React from 'react';\n\nimport type { StyleReactProps } from '../interfaces';\n\ntype Mutable<T> = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ?\n\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// The comma in the type is to trick typescript because it things a single generic in a tsx file is jsx\nexport const mergeRefs = <ElementType,>(...refs: React.Ref<ElementType>[]) => (\n value: ElementType,\n) =>\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // This is typed as readonly so we need to allow for override\n (ref as Mutable<React.RefObject<ElementType>>).current = value;\n }\n });\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React from 'react';\n\nimport {\n attachProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n mergeRefs,\n} from './utils';\n\nexport interface HTMLStencilElement extends HTMLElement {\n componentOnReady(): Promise<this>;\n}\n\ninterface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef: React.RefObject<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <\n PropType,\n ElementType extends HTMLStencilElement,\n ContextStateType = {},\n ExpandedPropsTypes = {}\n>(\n tagName: string,\n ReactComponentContext?: React.Context<ContextStateType>,\n manipulatePropsFunction?: (\n originalProps: StencilReactInternalProps<ElementType>,\n propsToPass: any,\n ) => ExpandedPropsTypes,\n) => {\n const displayName = dashToPascalCase(tagName);\n\n const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {\n componentEl!: ElementType;\n\n setComponentElRef = (element: ElementType) => {\n this.componentEl = element;\n };\n\n constructor(props: StencilReactInternalProps<ElementType>) {\n super(props);\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: StencilReactInternalProps<ElementType>) {\n attachProps(this.componentEl, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n let propsToPass = Object.keys(cProps).reduce((acc, name) => {\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== 'undefined' && isCoveredByReact(eventName, document)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n let newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n\n // If context was passed to createReactComponent then conditionally add it to the Component Class\n if (ReactComponentContext) {\n ReactComponent.contextType = ReactComponentContext;\n }\n\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport type { JSX } from '@vertexvis/ui';\n\nimport { defineCustomElements } from '@vertexvis/ui/loader';\n\ndefineCustomElements();\nexport const VertexAvatar = /*@__PURE__*/createReactComponent<JSX.VertexAvatar, HTMLVertexAvatarElement>('vertex-avatar');\nexport const VertexButton = /*@__PURE__*/createReactComponent<JSX.VertexButton, HTMLVertexButtonElement>('vertex-button');\nexport const VertexClickToEditTextfield = /*@__PURE__*/createReactComponent<JSX.VertexClickToEditTextfield, HTMLVertexClickToEditTextfieldElement>('vertex-click-to-edit-textfield');\nexport const VertexCollapsible = /*@__PURE__*/createReactComponent<JSX.VertexCollapsible, HTMLVertexCollapsibleElement>('vertex-collapsible');\nexport const VertexColorPicker = /*@__PURE__*/createReactComponent<JSX.VertexColorPicker, HTMLVertexColorPickerElement>('vertex-color-picker');\nexport const VertexContextMenu = /*@__PURE__*/createReactComponent<JSX.VertexContextMenu, HTMLVertexContextMenuElement>('vertex-context-menu');\nexport const VertexDialog = /*@__PURE__*/createReactComponent<JSX.VertexDialog, HTMLVertexDialogElement>('vertex-dialog');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexIcon = /*@__PURE__*/createReactComponent<JSX.VertexIcon, HTMLVertexIconElement>('vertex-icon');\nexport const VertexIconButton = /*@__PURE__*/createReactComponent<JSX.VertexIconButton, HTMLVertexIconButtonElement>('vertex-icon-button');\nexport const VertexMenu = /*@__PURE__*/createReactComponent<JSX.VertexMenu, HTMLVertexMenuElement>('vertex-menu');\nexport const VertexMenuDivider = /*@__PURE__*/createReactComponent<JSX.VertexMenuDivider, HTMLVertexMenuDividerElement>('vertex-menu-divider');\nexport const VertexMenuItem = /*@__PURE__*/createReactComponent<JSX.VertexMenuItem, HTMLVertexMenuItemElement>('vertex-menu-item');\nexport const VertexPopover = /*@__PURE__*/createReactComponent<JSX.VertexPopover, HTMLVertexPopoverElement>('vertex-popover');\nexport const VertexResizable = /*@__PURE__*/createReactComponent<JSX.VertexResizable, HTMLVertexResizableElement>('vertex-resizable');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSpinner = /*@__PURE__*/createReactComponent<JSX.VertexSpinner, HTMLVertexSpinnerElement>('vertex-spinner');\nexport const VertexTextfield = /*@__PURE__*/createReactComponent<JSX.VertexTextfield, HTMLVertexTextfieldElement>('vertex-textfield');\nexport const VertexToggle = /*@__PURE__*/createReactComponent<JSX.VertexToggle, HTMLVertexToggleElement>('vertex-toggle');\nexport const VertexTooltip = /*@__PURE__*/createReactComponent<JSX.VertexTooltip, HTMLVertexTooltipElement>('vertex-tooltip');\n"],"names":["getClassName","classList","newProps","oldProps","newClassProp","className","class","oldClassProp","currentClasses","arrayToMap","incomingPropClasses","split","oldPropClasses","finalClassNames","forEach","currentClass","has","push","delete","s","join","isCoveredByReact","eventNameSuffix","doc","eventName","isSupported","element","createElement","setAttribute","syncEvent","node","newEventHandler","eventStore","__events","oldEventHandler","removeEventListener","addEventListener","e","call","this","arr","map","Map","set","mergeRefs","_i","refs","value","ref","current","createReactComponent","tagName","ReactComponentContext","manipulatePropsFunction","displayName","toLowerCase","segment","charAt","toUpperCase","slice","ReactComponent","props","_super","_this","componentEl","__extends","class_1","componentDidUpdate","prevProps","Element","Object","keys","name","indexOf","substring","eventNameLc","document","replace","m","attachProps","_a","children","forwardedRef","style","cProps","propsToPass","reduce","acc","setComponentElRef","React","Component","contextType","forwardRef","createForwardRef","defineCustomElements","VertexAvatar","VertexButton","VertexClickToEditTextfield","VertexCollapsible","VertexColorPicker","VertexContextMenu","VertexDialog","VertexDropdownMenu","VertexIcon","VertexIconButton","VertexMenu","VertexMenuDivider","VertexMenuItem","VertexPopover","VertexRes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B7D,EAAkE,kBAC/F8D,EAA+B9D,EAAsE,oBACrG+D,EAA4B/D,EAAgE,iBAC5FgE,EAA6BhE,EAAkE"}
|
|
1
|
+
{"version":3,"file":"bundle.esm.min.js","sources":["../src/generated/react-component-lib/utils/case.ts","../src/generated/react-component-lib/utils/attachProps.ts","../src/generated/react-component-lib/utils/index.tsx","../src/generated/react-component-lib/createComponent.tsx","../src/generated/ui.ts"],"sourcesContent":["export const dashToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\nexport const camelToDashCase = (str: string) =>\n str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);\n","import { camelToDashCase } from './case';\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n // add any classes in className to the class list\n const className = getClassName(node.classList, newProps, oldProps);\n if (className !== '') {\n node.className = className;\n }\n\n Object.keys(newProps).forEach((name) => {\n if (\n name === 'children' ||\n name === 'style' ||\n name === 'ref' ||\n name === 'class' ||\n name === 'className' ||\n name === 'forwardedRef'\n ) {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n\n if (typeof document !== 'undefined' && !isCoveredByReact(eventNameLc, document)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n } else {\n (node as any)[name] = newProps[name];\n const propType = typeof newProps[name];\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name]);\n } else {\n (node as any)[name] = newProps[name];\n }\n }\n });\n }\n};\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class;\n const oldClassProp: string = oldProps.className || oldProps.class;\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n const finalClassNames: string[] = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach((s) => finalClassNames.push(s));\n return finalClassNames.join(' ');\n};\n\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix: string, doc: Document) => {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in doc;\n\n if (!isSupported) {\n const element = doc.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n};\n\nexport const syncEvent = (\n node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n eventName: string,\n newEventHandler?: (e: Event) => any,\n) => {\n const eventStore = node.__events || (node.__events = {});\n const oldEventHandler = eventStore[eventName];\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler(e: Event) {\n if (newEventHandler) {\n newEventHandler.call(this, e);\n }\n }),\n );\n};\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s));\n return map;\n};\n","import React from 'react';\n\nimport type { StyleReactProps } from '../interfaces';\n\ntype Mutable<T> = { -readonly [P in keyof T]-?: T[P] }; // Remove readonly and ?\n\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// The comma in the type is to trick typescript because it things a single generic in a tsx file is jsx\nexport const mergeRefs = <ElementType,>(...refs: React.Ref<ElementType>[]) => (\n value: ElementType,\n) =>\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // This is typed as readonly so we need to allow for override\n (ref as Mutable<React.RefObject<ElementType>>).current = value;\n }\n });\n\nexport const createForwardRef = <PropType, ElementType>(\n ReactComponent: any,\n displayName: string,\n) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: React.Ref<ElementType>,\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React from 'react';\n\nimport {\n attachProps,\n createForwardRef,\n dashToPascalCase,\n isCoveredByReact,\n mergeRefs,\n} from './utils';\n\nexport interface HTMLStencilElement extends HTMLElement {\n componentOnReady(): Promise<this>;\n}\n\ninterface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {\n forwardedRef: React.RefObject<ElementType>;\n ref?: React.Ref<any>;\n}\n\nexport const createReactComponent = <\n PropType,\n ElementType extends HTMLStencilElement,\n ContextStateType = {},\n ExpandedPropsTypes = {}\n>(\n tagName: string,\n ReactComponentContext?: React.Context<ContextStateType>,\n manipulatePropsFunction?: (\n originalProps: StencilReactInternalProps<ElementType>,\n propsToPass: any,\n ) => ExpandedPropsTypes,\n) => {\n const displayName = dashToPascalCase(tagName);\n\n const ReactComponent = class extends React.Component<StencilReactInternalProps<ElementType>> {\n componentEl!: ElementType;\n\n setComponentElRef = (element: ElementType) => {\n this.componentEl = element;\n };\n\n constructor(props: StencilReactInternalProps<ElementType>) {\n super(props);\n }\n\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n\n componentDidUpdate(prevProps: StencilReactInternalProps<ElementType>) {\n attachProps(this.componentEl, this.props, prevProps);\n }\n\n render() {\n const { children, forwardedRef, style, className, ref, ...cProps } = this.props;\n\n let propsToPass = Object.keys(cProps).reduce((acc, name) => {\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== 'undefined' && isCoveredByReact(eventName, document)) {\n (acc as any)[name] = (cProps as any)[name];\n }\n } else {\n (acc as any)[name] = (cProps as any)[name];\n }\n return acc;\n }, {});\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n let newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n return React.createElement(tagName, newProps, children);\n }\n\n static get displayName() {\n return displayName;\n }\n };\n\n // If context was passed to createReactComponent then conditionally add it to the Component Class\n if (ReactComponentContext) {\n ReactComponent.contextType = ReactComponentContext;\n }\n\n return createForwardRef<PropType, ElementType>(ReactComponent, displayName);\n};\n","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\n\nimport type { JSX } from '@vertexvis/ui';\n\nimport { defineCustomElements } from '@vertexvis/ui/loader';\n\ndefineCustomElements();\nexport const VertexAvatar = /*@__PURE__*/createReactComponent<JSX.VertexAvatar, HTMLVertexAvatarElement>('vertex-avatar');\nexport const VertexAvatarGroup = /*@__PURE__*/createReactComponent<JSX.VertexAvatarGroup, HTMLVertexAvatarGroupElement>('vertex-avatar-group');\nexport const VertexButton = /*@__PURE__*/createReactComponent<JSX.VertexButton, HTMLVertexButtonElement>('vertex-button');\nexport const VertexCard = /*@__PURE__*/createReactComponent<JSX.VertexCard, HTMLVertexCardElement>('vertex-card');\nexport const VertexCardGroup = /*@__PURE__*/createReactComponent<JSX.VertexCardGroup, HTMLVertexCardGroupElement>('vertex-card-group');\nexport const VertexClickToEditTextfield = /*@__PURE__*/createReactComponent<JSX.VertexClickToEditTextfield, HTMLVertexClickToEditTextfieldElement>('vertex-click-to-edit-textfield');\nexport const VertexCollapsible = /*@__PURE__*/createReactComponent<JSX.VertexCollapsible, HTMLVertexCollapsibleElement>('vertex-collapsible');\nexport const VertexColorPicker = /*@__PURE__*/createReactComponent<JSX.VertexColorPicker, HTMLVertexColorPickerElement>('vertex-color-picker');\nexport const VertexContextMenu = /*@__PURE__*/createReactComponent<JSX.VertexContextMenu, HTMLVertexContextMenuElement>('vertex-context-menu');\nexport const VertexDialog = /*@__PURE__*/createReactComponent<JSX.VertexDialog, HTMLVertexDialogElement>('vertex-dialog');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexIcon = /*@__PURE__*/createReactComponent<JSX.VertexIcon, HTMLVertexIconElement>('vertex-icon');\nexport const VertexIconButton = /*@__PURE__*/createReactComponent<JSX.VertexIconButton, HTMLVertexIconButtonElement>('vertex-icon-button');\nexport const VertexLogoLoading = /*@__PURE__*/createReactComponent<JSX.VertexLogoLoading, HTMLVertexLogoLoadingElement>('vertex-logo-loading');\nexport const VertexMenu = /*@__PURE__*/createReactComponent<JSX.VertexMenu, HTMLVertexMenuElement>('vertex-menu');\nexport const VertexMenuDivider = /*@__PURE__*/createReactComponent<JSX.VertexMenuDivider, HTMLVertexMenuDividerElement>('vertex-menu-divider');\nexport const VertexMenuItem = /*@__PURE__*/createReactComponent<JSX.VertexMenuItem, HTMLVertexMenuItemElement>('vertex-menu-item');\nexport const VertexPopover = /*@__PURE__*/createReactComponent<JSX.VertexPopover, HTMLVertexPopoverElement>('vertex-popover');\nexport const VertexRadio = /*@__PURE__*/createReactComponent<JSX.VertexRadio, HTMLVertexRadioElement>('vertex-radio');\nexport const VertexRadioGroup = /*@__PURE__*/createReactComponent<JSX.VertexRadioGroup, HTMLVertexRadioGroupElement>('vertex-radio-group');\nexport const VertexResizable = /*@__PURE__*/createReactComponent<JSX.VertexResizable, HTMLVertexResizableElement>('vertex-resizable');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSpinner = /*@__PURE__*/createReactComponent<JSX.VertexSpinner, HTMLVertexSpinnerElement>('vertex-spinner');\nexport const VertexTextfield = /*@__PURE__*/createReactComponent<JSX.VertexTextfield, HTMLVertexTextfieldElement>('vertex-textfield');\nexport const VertexToast = /*@__PURE__*/createReactComponent<JSX.VertexToast, HTMLVertexToastElement>('vertex-toast');\nexport const VertexToggle = /*@__PURE__*/createReactComponent<JSX.VertexToggle, HTMLVertexToggleElement>('vertex-toggle');\nexport const VertexTooltip = /*@__PURE__*/createReactComponent<JSX.VertexTooltip, HTMLVertexTooltipElement>('vertex-tooltip');\n"],"names":["getClassName","classList","newProps","oldProps","newClassProp","className","class","oldClassProp","currentClasses","arrayToMap","incomingPropClasses","split","oldPropClasses","finalClassNames","forEach","currentClass","has","push","delete","s","join","isCoveredByReact","eventNameSuffix","doc","eventName","isSupported","element","createElement","setAttribute","syncEvent","node","newEventHandler","eventStore","__events","oldEventHandler","removeEventListener","addEventListener","e","call","this","arr","map","Map","set","mergeRefs","_i","refs","value","ref","current","createReactComponent","tagName","ReactComponentContext","manipulatePropsFunction","displayName","toLowerCase","segment","charAt","toUpperCase","slice","ReactComponent","props","_super","_this","componentEl","__extends","class_1","componentDidUpdate","prevProps","Element","Object","keys","name","indexOf","substring","eventNameLc","document","replace","m","attachProps","_a","children","forwardedRef","style","cProps","propsToPass","reduce","acc","setComponentElRef","React","Component","contextType","forwardRef","createForwardRef","defineCustomElements","VertexAvatar","VertexAvatarGroup","VertexButton","VertexCard","VertexCardGroup","VertexClickToEditTextfield","VertexCollapsible","VertexColorPicker","VertexContextMenu","VertexDialog","VertexDropdownMenu","VertexIcon","VertexIconButton","VertexLogoLoading","VertexMenu","VertexMenuDivider","VertexMenuItem","VertexPopover","VertexRadio","VertexRadioGroup","VertexResizable","VertexSelect","VertexSpinner","VertexTextfield","Vertex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9D,EAAkE,kBAC/F+D,EAA2B/D,EAA8D,gBACzFgE,EAAgChE,EAAwE,sBACxGiE,EAA+BjE,EAAsE,oBACrGkE,EAA4BlE,EAAgE,iBAC5FmE,EAA6BnE,EAAkE,kBAC/FoE,EAA+BpE,EAAsE,oBACrGqE,EAA2BrE,EAA8D,gBACzFsE,EAA4BtE,EAAgE,iBAC5FuE,EAA6BvE,EAAkE"}
|
package/dist/generated/ui.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { JSX } from '@vertexvis/ui';
|
|
3
3
|
export declare const VertexAvatar: import("react").ForwardRefExoticComponent<JSX.VertexAvatar & Omit<import("react").HTMLAttributes<HTMLVertexAvatarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexAvatarElement>>;
|
|
4
|
+
export declare const VertexAvatarGroup: import("react").ForwardRefExoticComponent<JSX.VertexAvatarGroup & Omit<import("react").HTMLAttributes<HTMLVertexAvatarGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexAvatarGroupElement>>;
|
|
4
5
|
export declare const VertexButton: import("react").ForwardRefExoticComponent<JSX.VertexButton & Omit<import("react").HTMLAttributes<HTMLVertexButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexButtonElement>>;
|
|
6
|
+
export declare const VertexCard: import("react").ForwardRefExoticComponent<JSX.VertexCard & Omit<import("react").HTMLAttributes<HTMLVertexCardElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexCardElement>>;
|
|
7
|
+
export declare const VertexCardGroup: import("react").ForwardRefExoticComponent<JSX.VertexCardGroup & Omit<import("react").HTMLAttributes<HTMLVertexCardGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexCardGroupElement>>;
|
|
5
8
|
export declare const VertexClickToEditTextfield: import("react").ForwardRefExoticComponent<JSX.VertexClickToEditTextfield & Omit<import("react").HTMLAttributes<HTMLVertexClickToEditTextfieldElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexClickToEditTextfieldElement>>;
|
|
6
9
|
export declare const VertexCollapsible: import("react").ForwardRefExoticComponent<JSX.VertexCollapsible & Omit<import("react").HTMLAttributes<HTMLVertexCollapsibleElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexCollapsibleElement>>;
|
|
7
10
|
export declare const VertexColorPicker: import("react").ForwardRefExoticComponent<JSX.VertexColorPicker & Omit<import("react").HTMLAttributes<HTMLVertexColorPickerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexColorPickerElement>>;
|
|
@@ -10,13 +13,17 @@ export declare const VertexDialog: import("react").ForwardRefExoticComponent<JSX
|
|
|
10
13
|
export declare const VertexDropdownMenu: import("react").ForwardRefExoticComponent<JSX.VertexDropdownMenu & Omit<import("react").HTMLAttributes<HTMLVertexDropdownMenuElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexDropdownMenuElement>>;
|
|
11
14
|
export declare const VertexIcon: import("react").ForwardRefExoticComponent<JSX.VertexIcon & Omit<import("react").HTMLAttributes<HTMLVertexIconElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexIconElement>>;
|
|
12
15
|
export declare const VertexIconButton: import("react").ForwardRefExoticComponent<JSX.VertexIconButton & Omit<import("react").HTMLAttributes<HTMLVertexIconButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexIconButtonElement>>;
|
|
16
|
+
export declare const VertexLogoLoading: import("react").ForwardRefExoticComponent<JSX.VertexLogoLoading & Omit<import("react").HTMLAttributes<HTMLVertexLogoLoadingElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexLogoLoadingElement>>;
|
|
13
17
|
export declare const VertexMenu: import("react").ForwardRefExoticComponent<JSX.VertexMenu & Omit<import("react").HTMLAttributes<HTMLVertexMenuElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexMenuElement>>;
|
|
14
18
|
export declare const VertexMenuDivider: import("react").ForwardRefExoticComponent<JSX.VertexMenuDivider & Omit<import("react").HTMLAttributes<HTMLVertexMenuDividerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexMenuDividerElement>>;
|
|
15
19
|
export declare const VertexMenuItem: import("react").ForwardRefExoticComponent<JSX.VertexMenuItem & Omit<import("react").HTMLAttributes<HTMLVertexMenuItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexMenuItemElement>>;
|
|
16
20
|
export declare const VertexPopover: import("react").ForwardRefExoticComponent<JSX.VertexPopover & Omit<import("react").HTMLAttributes<HTMLVertexPopoverElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexPopoverElement>>;
|
|
21
|
+
export declare const VertexRadio: import("react").ForwardRefExoticComponent<JSX.VertexRadio & Omit<import("react").HTMLAttributes<HTMLVertexRadioElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexRadioElement>>;
|
|
22
|
+
export declare const VertexRadioGroup: import("react").ForwardRefExoticComponent<JSX.VertexRadioGroup & Omit<import("react").HTMLAttributes<HTMLVertexRadioGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexRadioGroupElement>>;
|
|
17
23
|
export declare const VertexResizable: import("react").ForwardRefExoticComponent<JSX.VertexResizable & Omit<import("react").HTMLAttributes<HTMLVertexResizableElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexResizableElement>>;
|
|
18
24
|
export declare const VertexSelect: import("react").ForwardRefExoticComponent<JSX.VertexSelect & Omit<import("react").HTMLAttributes<HTMLVertexSelectElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexSelectElement>>;
|
|
19
25
|
export declare const VertexSpinner: import("react").ForwardRefExoticComponent<JSX.VertexSpinner & Omit<import("react").HTMLAttributes<HTMLVertexSpinnerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexSpinnerElement>>;
|
|
20
26
|
export declare const VertexTextfield: import("react").ForwardRefExoticComponent<JSX.VertexTextfield & Omit<import("react").HTMLAttributes<HTMLVertexTextfieldElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexTextfieldElement>>;
|
|
27
|
+
export declare const VertexToast: import("react").ForwardRefExoticComponent<JSX.VertexToast & Omit<import("react").HTMLAttributes<HTMLVertexToastElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexToastElement>>;
|
|
21
28
|
export declare const VertexToggle: import("react").ForwardRefExoticComponent<JSX.VertexToggle & Omit<import("react").HTMLAttributes<HTMLVertexToggleElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexToggleElement>>;
|
|
22
29
|
export declare const VertexTooltip: import("react").ForwardRefExoticComponent<JSX.VertexTooltip & Omit<import("react").HTMLAttributes<HTMLVertexTooltipElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVertexTooltipElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertexvis/ui-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11-canary.10",
|
|
4
4
|
"description": "React bindings for the Vertex component library.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Vertex Developers <support@vertexvis.com> (https://developer.vertexvis.com)",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@types/react": "^17.0.3",
|
|
37
37
|
"@types/react-dom": "^17.0.2",
|
|
38
38
|
"@vertexvis/eslint-config-vertexvis-typescript": "^0.4.0",
|
|
39
|
-
"@vertexwebui/build": "^0.0.
|
|
39
|
+
"@vertexwebui/build": "^0.0.11-canary.10",
|
|
40
40
|
"eslint": "^7.23.0",
|
|
41
41
|
"react": "^17.0.1",
|
|
42
42
|
"react-dom": "^17.0.1",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"react-dom": ">=16.0.0 <18.0.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@vertexvis/ui": "^0.0.
|
|
50
|
+
"@vertexvis/ui": "^0.0.11-canary.10"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "8593db3d45a4f9ee424e835eaac0c939ec6f6afe"
|
|
53
53
|
}
|