@vertexvis/ui-react 0.0.14-canary.7 → 0.0.14
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/dist/bundle.cjs.js +61 -32
- 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 +58 -30
- 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/react-component-lib/createComponent.d.ts +1 -1
- package/dist/generated/react-component-lib/createOverlayComponent.d.ts +5 -4
- package/dist/generated/react-component-lib/utils/attachProps.d.ts +5 -1
- package/dist/generated/react-component-lib/utils/index.d.ts +5 -2
- package/package.json +4 -4
package/dist/bundle.cjs.js
CHANGED
|
@@ -5,7 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
6
|
|
|
7
7
|
var tslib = require('tslib');
|
|
8
|
-
var React =
|
|
8
|
+
var React = require('react');
|
|
9
|
+
var React__default = _interopDefault(React);
|
|
9
10
|
require('react-dom');
|
|
10
11
|
var loader = require('@vertexvis/ui/loader');
|
|
11
12
|
|
|
@@ -16,9 +17,7 @@ var dashToPascalCase = function (str) {
|
|
|
16
17
|
.map(function (segment) { return segment.charAt(0).toUpperCase() + segment.slice(1); })
|
|
17
18
|
.join('');
|
|
18
19
|
};
|
|
19
|
-
var camelToDashCase = function (str) {
|
|
20
|
-
return str.replace(/([A-Z])/g, function (m) { return "-" + m[0].toLowerCase(); });
|
|
21
|
-
};
|
|
20
|
+
var camelToDashCase = function (str) { return str.replace(/([A-Z])/g, function (m) { return "-".concat(m[0].toLowerCase()); }); };
|
|
22
21
|
|
|
23
22
|
var attachProps = function (node, newProps, oldProps) {
|
|
24
23
|
if (oldProps === void 0) { oldProps = {}; }
|
|
@@ -41,7 +40,7 @@ var attachProps = function (node, newProps, oldProps) {
|
|
|
41
40
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
42
41
|
var eventName = name.substring(2);
|
|
43
42
|
var eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
|
|
44
|
-
if (
|
|
43
|
+
if (!isCoveredByReact(eventNameLc)) {
|
|
45
44
|
syncEvent(node, eventNameLc, newProps[name]);
|
|
46
45
|
}
|
|
47
46
|
}
|
|
@@ -51,9 +50,6 @@ var attachProps = function (node, newProps, oldProps) {
|
|
|
51
50
|
if (propType === 'string') {
|
|
52
51
|
node.setAttribute(camelToDashCase(name), newProps[name]);
|
|
53
52
|
}
|
|
54
|
-
else {
|
|
55
|
-
node[name] = newProps[name];
|
|
56
|
-
}
|
|
57
53
|
}
|
|
58
54
|
});
|
|
59
55
|
}
|
|
@@ -82,19 +78,34 @@ var getClassName = function (classList, newProps, oldProps) {
|
|
|
82
78
|
incomingPropClasses.forEach(function (s) { return finalClassNames.push(s); });
|
|
83
79
|
return finalClassNames.join(' ');
|
|
84
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* Transforms a React event name to a browser event name.
|
|
83
|
+
*/
|
|
84
|
+
var transformReactEventName = function (eventNameSuffix) {
|
|
85
|
+
switch (eventNameSuffix) {
|
|
86
|
+
case 'doubleclick':
|
|
87
|
+
return 'dblclick';
|
|
88
|
+
}
|
|
89
|
+
return eventNameSuffix;
|
|
90
|
+
};
|
|
85
91
|
/**
|
|
86
92
|
* Checks if an event is supported in the current execution environment.
|
|
87
93
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
88
94
|
*/
|
|
89
|
-
var isCoveredByReact = function (eventNameSuffix
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
isSupported =
|
|
95
|
+
var isCoveredByReact = function (eventNameSuffix) {
|
|
96
|
+
if (typeof document === 'undefined') {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
var eventName = 'on' + transformReactEventName(eventNameSuffix);
|
|
101
|
+
var isSupported = eventName in document;
|
|
102
|
+
if (!isSupported) {
|
|
103
|
+
var element = document.createElement('div');
|
|
104
|
+
element.setAttribute(eventName, 'return;');
|
|
105
|
+
isSupported = typeof element[eventName] === 'function';
|
|
106
|
+
}
|
|
107
|
+
return isSupported;
|
|
96
108
|
}
|
|
97
|
-
return isSupported;
|
|
98
109
|
};
|
|
99
110
|
var syncEvent = function (node, eventName, newEventHandler) {
|
|
100
111
|
var eventStore = node.__events || (node.__events = {});
|
|
@@ -116,33 +127,38 @@ var arrayToMap = function (arr) {
|
|
|
116
127
|
return map;
|
|
117
128
|
};
|
|
118
129
|
|
|
119
|
-
|
|
130
|
+
var setRef = function (ref, value) {
|
|
131
|
+
if (typeof ref === 'function') {
|
|
132
|
+
ref(value);
|
|
133
|
+
}
|
|
134
|
+
else if (ref != null) {
|
|
135
|
+
// Cast as a MutableRef so we can assign current
|
|
136
|
+
ref.current = value;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
120
139
|
var mergeRefs = function () {
|
|
121
140
|
var refs = [];
|
|
122
141
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
123
142
|
refs[_i] = arguments[_i];
|
|
124
143
|
}
|
|
125
144
|
return function (value) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
ref(value);
|
|
129
|
-
}
|
|
130
|
-
else if (ref != null) {
|
|
131
|
-
// This is typed as readonly so we need to allow for override
|
|
132
|
-
ref.current = value;
|
|
133
|
-
}
|
|
145
|
+
refs.forEach(function (ref) {
|
|
146
|
+
setRef(ref, value);
|
|
134
147
|
});
|
|
135
148
|
};
|
|
136
149
|
};
|
|
137
150
|
var createForwardRef = function (ReactComponent, displayName) {
|
|
138
151
|
var forwardRef = function (props, ref) {
|
|
139
|
-
return
|
|
152
|
+
return React__default.createElement(ReactComponent, tslib.__assign({}, props, { forwardedRef: ref }));
|
|
140
153
|
};
|
|
141
154
|
forwardRef.displayName = displayName;
|
|
142
|
-
return
|
|
155
|
+
return React__default.forwardRef(forwardRef);
|
|
143
156
|
};
|
|
144
157
|
|
|
145
|
-
var createReactComponent = function (tagName, ReactComponentContext, manipulatePropsFunction) {
|
|
158
|
+
var createReactComponent = function (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) {
|
|
159
|
+
if (defineCustomElement !== undefined) {
|
|
160
|
+
defineCustomElement();
|
|
161
|
+
}
|
|
146
162
|
var displayName = dashToPascalCase(tagName);
|
|
147
163
|
var ReactComponent = /** @class */ (function (_super) {
|
|
148
164
|
tslib.__extends(class_1, _super);
|
|
@@ -162,14 +178,20 @@ var createReactComponent = function (tagName, ReactComponentContext, manipulateP
|
|
|
162
178
|
class_1.prototype.render = function () {
|
|
163
179
|
var _a = this.props, children = _a.children, forwardedRef = _a.forwardedRef, style = _a.style, className = _a.className, ref = _a.ref, cProps = tslib.__rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
|
|
164
180
|
var propsToPass = Object.keys(cProps).reduce(function (acc, name) {
|
|
181
|
+
var value = cProps[name];
|
|
165
182
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
166
183
|
var eventName = name.substring(2).toLowerCase();
|
|
167
|
-
if (typeof document !== 'undefined' && isCoveredByReact(eventName
|
|
168
|
-
acc[name] =
|
|
184
|
+
if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
|
|
185
|
+
acc[name] = value;
|
|
169
186
|
}
|
|
170
187
|
}
|
|
171
188
|
else {
|
|
172
|
-
|
|
189
|
+
// we should only render strings, booleans, and numbers as attrs in html.
|
|
190
|
+
// objects, functions, arrays etc get synced via properties on mount.
|
|
191
|
+
var type = typeof value;
|
|
192
|
+
if (type === 'string' || type === 'boolean' || type === 'number') {
|
|
193
|
+
acc[camelToDashCase(name)] = value;
|
|
194
|
+
}
|
|
173
195
|
}
|
|
174
196
|
return acc;
|
|
175
197
|
}, {});
|
|
@@ -177,6 +199,13 @@ var createReactComponent = function (tagName, ReactComponentContext, manipulateP
|
|
|
177
199
|
propsToPass = manipulatePropsFunction(this.props, propsToPass);
|
|
178
200
|
}
|
|
179
201
|
var newProps = tslib.__assign(tslib.__assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style: style });
|
|
202
|
+
/**
|
|
203
|
+
* We use createElement here instead of
|
|
204
|
+
* React.createElement to work around a
|
|
205
|
+
* bug in Vite (https://github.com/vitejs/vite/issues/6104).
|
|
206
|
+
* React.createElement causes all elements to be rendered
|
|
207
|
+
* as <tagname> instead of the actual Web Component.
|
|
208
|
+
*/
|
|
180
209
|
return React.createElement(tagName, newProps, children);
|
|
181
210
|
};
|
|
182
211
|
Object.defineProperty(class_1, "displayName", {
|
|
@@ -187,7 +216,7 @@ var createReactComponent = function (tagName, ReactComponentContext, manipulateP
|
|
|
187
216
|
configurable: true
|
|
188
217
|
});
|
|
189
218
|
return class_1;
|
|
190
|
-
}(
|
|
219
|
+
}(React__default.Component));
|
|
191
220
|
// If context was passed to createReactComponent then conditionally add it to the Component Class
|
|
192
221
|
if (ReactComponentContext) {
|
|
193
222
|
ReactComponent.contextType = ReactComponentContext;
|
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 VertexAutoResizeTextarea = /*@__PURE__*/createReactComponent<JSX.VertexAutoResizeTextarea, HTMLVertexAutoResizeTextareaElement>('vertex-auto-resize-textarea');\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 VertexChip = /*@__PURE__*/createReactComponent<JSX.VertexChip, HTMLVertexChipElement>('vertex-chip');\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 VertexColorCircle = /*@__PURE__*/createReactComponent<JSX.VertexColorCircle, HTMLVertexColorCircleElement>('vertex-color-circle');\nexport const VertexColorCirclePicker = /*@__PURE__*/createReactComponent<JSX.VertexColorCirclePicker, HTMLVertexColorCirclePickerElement>('vertex-color-circle-picker');\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 VertexDraggablePopover = /*@__PURE__*/createReactComponent<JSX.VertexDraggablePopover, HTMLVertexDraggablePopoverElement>('vertex-draggable-popover');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexExpandable = /*@__PURE__*/createReactComponent<JSX.VertexExpandable, HTMLVertexExpandableElement>('vertex-expandable');\nexport const VertexHelpTooltip = /*@__PURE__*/createReactComponent<JSX.VertexHelpTooltip, HTMLVertexHelpTooltipElement>('vertex-help-tooltip');\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 VertexResultList = /*@__PURE__*/createReactComponent<JSX.VertexResultList, HTMLVertexResultListElement>('vertex-result-list');\nexport const VertexSearchBar = /*@__PURE__*/createReactComponent<JSX.VertexSearchBar, HTMLVertexSearchBarElement>('vertex-search-bar');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSlider = /*@__PURE__*/createReactComponent<JSX.VertexSlider, HTMLVertexSliderElement>('vertex-slider');\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,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AAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
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) => 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 (!isCoveredByReact(eventNameLc)) {\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 }\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 * Transforms a React event name to a browser event name.\n */\nexport const transformReactEventName = (eventNameSuffix: string) => {\n switch (eventNameSuffix) {\n case 'doubleclick':\n return 'dblclick';\n }\n return eventNameSuffix;\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) => {\n if (typeof document === 'undefined') {\n return true;\n } else {\n const eventName = 'on' + transformReactEventName(eventNameSuffix);\n let isSupported = eventName in document;\n\n if (!isSupported) {\n const element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n }\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\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// This will be replaced with React.ForwardedRef when react-output-target is upgraded to React v17\nexport type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;\n\nexport const setRef = (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // Cast as a MutableRef so we can assign current\n (ref as React.MutableRefObject<any>).current = value;\n }\n};\n\nexport const mergeRefs = (\n ...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]\n): React.RefCallback<any> => {\n return (value: any) => {\n refs.forEach((ref) => {\n setRef(ref, value);\n });\n };\n};\n\nexport const createForwardRef = <PropType, ElementType>(ReactComponent: any, displayName: string) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: StencilReactForwardedRef<ElementType>\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport const defineCustomElement = (tagName: string, customElement: any) => {\n if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {\n customElements.define(tagName, customElement);\n }\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React, { createElement } from 'react';\n\nimport { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } 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 defineCustomElement?: () => void\n) => {\n if (defineCustomElement !== undefined) {\n defineCustomElement();\n }\n\n const displayName = dashToPascalCase(tagName);\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: any, name) => {\n const value = (cProps as any)[name];\n\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)) {\n acc[name] = value;\n }\n } else {\n // we should only render strings, booleans, and numbers as attrs in html.\n // objects, functions, arrays etc get synced via properties on mount.\n const type = typeof value;\n\n if (type === 'string' || type === 'boolean' || type === 'number') {\n acc[camelToDashCase(name)] = value;\n }\n }\n return acc;\n }, {} as ExpandedPropsTypes);\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n const newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n /**\n * We use createElement here instead of\n * React.createElement to work around a\n * bug in Vite (https://github.com/vitejs/vite/issues/6104).\n * React.createElement causes all elements to be rendered\n * as <tagname> instead of the actual Web Component.\n */\n return 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 VertexAutoResizeTextarea = /*@__PURE__*/createReactComponent<JSX.VertexAutoResizeTextarea, HTMLVertexAutoResizeTextareaElement>('vertex-auto-resize-textarea');\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 VertexChip = /*@__PURE__*/createReactComponent<JSX.VertexChip, HTMLVertexChipElement>('vertex-chip');\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 VertexColorCircle = /*@__PURE__*/createReactComponent<JSX.VertexColorCircle, HTMLVertexColorCircleElement>('vertex-color-circle');\nexport const VertexColorCirclePicker = /*@__PURE__*/createReactComponent<JSX.VertexColorCirclePicker, HTMLVertexColorCirclePickerElement>('vertex-color-circle-picker');\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 VertexDraggablePopover = /*@__PURE__*/createReactComponent<JSX.VertexDraggablePopover, HTMLVertexDraggablePopoverElement>('vertex-draggable-popover');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexExpandable = /*@__PURE__*/createReactComponent<JSX.VertexExpandable, HTMLVertexExpandableElement>('vertex-expandable');\nexport const VertexHelpTooltip = /*@__PURE__*/createReactComponent<JSX.VertexHelpTooltip, HTMLVertexHelpTooltipElement>('vertex-help-tooltip');\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 VertexResultList = /*@__PURE__*/createReactComponent<JSX.VertexResultList, HTMLVertexResultListElement>('vertex-result-list');\nexport const VertexSearchBar = /*@__PURE__*/createReactComponent<JSX.VertexSearchBar, HTMLVertexSearchBarElement>('vertex-search-bar');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSlider = /*@__PURE__*/createReactComponent<JSX.VertexSlider, HTMLVertexSliderElement>('vertex-slider');\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":["React","__extends","createElement","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,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C;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,gBAAgB,iBAAgB,oBAAoB,CAAoD,oBAAoB,CAAC,CAAC;AAC3I,IAAa,eAAe,iBAAgB,oBAAoB,CAAkD,mBAAmB,CAAC,CAAC;AACvI,IAAa,YAAY,iBAAgB,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,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=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),r=require("react"),o=(e=r)&&"object"==typeof e&&"default"in e?e.default:e;require("react-dom");var n=require("@vertexvis/ui/loader"),s=function(e){return e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())}))},i=function(e,t,r){var o=t.className||t.class,n=r.className||r.class,s=c(e),i=c(o?o.split(" "):[]),a=c(n?n.split(" "):[]),x=[];return s.forEach((function(e){i.has(e)?(x.push(e),i.delete(e)):a.has(e)||x.push(e)})),i.forEach((function(e){return x.push(e)})),x.join(" ")},a=function(e){if("undefined"==typeof document)return!0;var t="on"+function(e){switch(e){case"doubleclick":return"dblclick"}return e}(e),r=t in document;if(!r){var o=document.createElement("div");o.setAttribute(t,"return;"),r="function"==typeof o[t]}return r},x=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)})},c=function(e){var t=new Map;return e.forEach((function(e){return t.set(e,e)})),t},p=function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)},u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){e.forEach((function(e){p(e,t)}))}},l=function(e,n,c,p){void 0!==p&&p();var l=e.toLowerCase().split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(""),f=function(o){function n(e){var t=o.call(this,e)||this;return t.setComponentElRef=function(e){t.componentEl=e},t}return t.__extends(n,o),n.prototype.componentDidMount=function(){this.componentDidUpdate(this.props)},n.prototype.componentDidUpdate=function(e){!function(e,t,r){if(void 0===r&&(r={}),e instanceof Element){var o=i(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);a(n)||x(e,n,t[r])}else{e[r]=t[r],"string"===typeof t[r]&&e.setAttribute(s(r),t[r])}}))}}(this.componentEl,this.props,e)},n.prototype.render=function(){var o=this.props,n=o.children,i=o.forwardedRef,x=o.style,p=(o.className,o.ref,t.__rest(o,["children","forwardedRef","style","className","ref"])),l=Object.keys(p).reduce((function(e,t){var r=p[t];if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase()){var o=t.substring(2).toLowerCase();"undefined"!=typeof document&&a(o)&&(e[t]=r)}else{var n=typeof r;"string"!==n&&"boolean"!==n&&"number"!==n||(e[s(t)]=r)}return e}),{});c&&(l=c(this.props,l));var f=t.__assign(t.__assign({},l),{ref:u(i,this.setComponentElRef),style:x});return r.createElement(e,f,n)},Object.defineProperty(n,"displayName",{get:function(){return l},enumerable:!1,configurable:!0}),n}(o.Component);return n&&(f.contextType=n),function(e,r){var n=function(r,n){return o.createElement(e,t.__assign({},r,{forwardedRef:n}))};return n.displayName=r,o.forwardRef(n)}(f,l)};n.defineCustomElements();var f=l("vertex-auto-resize-textarea"),d=l("vertex-avatar"),v=l("vertex-avatar-group"),m=l("vertex-button"),V=l("vertex-card"),h=l("vertex-card-group"),b=l("vertex-chip"),g=l("vertex-click-to-edit-textfield"),y=l("vertex-collapsible"),C=l("vertex-color-circle"),E=l("vertex-color-circle-picker"),_=l("vertex-color-picker"),w=l("vertex-context-menu"),R=l("vertex-dialog"),k=l("vertex-draggable-popover"),L=l("vertex-dropdown-menu"),j=l("vertex-expandable"),T=l("vertex-help-tooltip"),M=l("vertex-icon"),N=l("vertex-icon-button"),O=l("vertex-logo-loading"),A=l("vertex-menu"),D=l("vertex-menu-divider"),P=l("vertex-menu-item"),U=l("vertex-popover"),q=l("vertex-radio"),z=l("vertex-radio-group"),S=l("vertex-resizable"),B=l("vertex-result-list"),G=l("vertex-search-bar"),I=l("vertex-select"),H=l("vertex-slider"),Z=l("vertex-spinner"),F=l("vertex-textfield"),J=l("vertex-toast"),K=l("vertex-toggle"),Q=l("vertex-tooltip");Object.keys(n).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})})),exports.VertexAutoResizeTextarea=f,exports.VertexAvatar=d,exports.VertexAvatarGroup=v,exports.VertexButton=m,exports.VertexCard=V,exports.VertexCardGroup=h,exports.VertexChip=b,exports.VertexClickToEditTextfield=g,exports.VertexCollapsible=y,exports.VertexColorCircle=C,exports.VertexColorCirclePicker=E,exports.VertexColorPicker=_,exports.VertexContextMenu=w,exports.VertexDialog=R,exports.VertexDraggablePopover=k,exports.VertexDropdownMenu=L,exports.VertexExpandable=j,exports.VertexHelpTooltip=T,exports.VertexIcon=M,exports.VertexIconButton=N,exports.VertexLogoLoading=O,exports.VertexMenu=A,exports.VertexMenuDivider=D,exports.VertexMenuItem=P,exports.VertexPopover=U,exports.VertexRadio=q,exports.VertexRadioGroup=z,exports.VertexResizable=S,exports.VertexResultList=B,exports.VertexSearchBar=G,exports.VertexSelect=I,exports.VertexSlider=H,exports.VertexSpinner=Z,exports.VertexTextfield=F,exports.VertexToast=J,exports.VertexToggle=K,exports.VertexTooltip=Q;
|
|
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 VertexAutoResizeTextarea = /*@__PURE__*/createReactComponent<JSX.VertexAutoResizeTextarea, HTMLVertexAutoResizeTextareaElement>('vertex-auto-resize-textarea');\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 VertexChip = /*@__PURE__*/createReactComponent<JSX.VertexChip, HTMLVertexChipElement>('vertex-chip');\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 VertexColorCircle = /*@__PURE__*/createReactComponent<JSX.VertexColorCircle, HTMLVertexColorCircleElement>('vertex-color-circle');\nexport const VertexColorCirclePicker = /*@__PURE__*/createReactComponent<JSX.VertexColorCirclePicker, HTMLVertexColorCirclePickerElement>('vertex-color-circle-picker');\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 VertexDraggablePopover = /*@__PURE__*/createReactComponent<JSX.VertexDraggablePopover, HTMLVertexDraggablePopoverElement>('vertex-draggable-popover');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexExpandable = /*@__PURE__*/createReactComponent<JSX.VertexExpandable, HTMLVertexExpandableElement>('vertex-expandable');\nexport const VertexHelpTooltip = /*@__PURE__*/createReactComponent<JSX.VertexHelpTooltip, HTMLVertexHelpTooltipElement>('vertex-help-tooltip');\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 VertexResultList = /*@__PURE__*/createReactComponent<JSX.VertexResultList, HTMLVertexResultListElement>('vertex-result-list');\nexport const VertexSearchBar = /*@__PURE__*/createReactComponent<JSX.VertexSearchBar, HTMLVertexSearchBarElement>('vertex-search-bar');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSlider = /*@__PURE__*/createReactComponent<JSX.VertexSlider, HTMLVertexSliderElement>('vertex-slider');\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","VertexAutoResizeTextarea","VertexAvatar","VertexAvatarGroup","VertexButton","VertexCard","VertexCardGroup","VertexChip","VertexClickToEditTextfield","VertexCollapsible","VertexColorCircle","VertexColorCirclePicker","VertexColorPicker","VertexContextMenu","VertexDialog","VertexDraggablePopover","VertexDropdownMenu","VertexExpandable","VertexHelpTooltip","VertexIcon","VertexIconButton","VertexLogoLoading","VertexMenu","VertexMenuDivider","VertexMenuItem","VertexPopover","VertexRadio","VertexRadioGroup","VertexResizable","VertexResultList","VertexSearchBar","VertexSelect","VertexSlider","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,CAChB,IAAMC,EAAUH,EAAII,cAAc,OAClCD,EAAQE,aAAaJ,EAAW,WAChCC,EAAqD,mBAA/BC,EAAgBF,GAGxC,OAAOC,GAGII,EAAY,SACvBC,EACAN,EACAO,GAEA,IAAMC,EAAaF,EAAKG,WAAaH,EAAKG,SAAW,IAC/CC,EAAkBF,EAAWR,GAG/BU,GACFJ,EAAKK,oBAAoBX,EAAWU,GAItCJ,EAAKM,iBACHZ,EACCQ,EAAWR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D,EAA+BlD,EAAsE,qBACrGmD,EAA0BnD,EAA4D,eACtFoD,EAA0CpD,EAA4F,kCACtIqD,EAAiCrD,EAA0E,sBAC3GsD,EAAiCtD,EAA0E,uBAC3GuD,EAAuCvD,EAAsF,8BAC7HwD,EAAiCxD,EAA0E,uBAC3GyD,EAAiCzD,EAA0E,uBAC3G0D,EAA4B1D,EAAgE,iBAC5F2D,EAAsC3D,EAAoF,4BAC1H4D,EAAkC5D,EAA4E,wBAC9G6D,EAAgC7D,EAAwE,qBACxG8D,EAAiC9D,EAA0E,uBAC3G+D,EAA0B/D,EAA4D,eACtFgE,EAAgChE,EAAwE,sBACxGiE,EAAiCjE,EAA0E,uBAC3GkE,EAA0BlE,EAA4D,eACtFmE,EAAiCnE,EAA0E,uBAC3GoE,EAA8BpE,EAAoE,oBAClGqE,EAA6BrE,EAAkE,kBAC/FsE,EAA2BtE,EAA8D,gBACzFuE,EAAgCvE,EAAwE,sBACxGwE,EAA+BxE,EAAsE,oBACrGyE,EAAgCzE,EAAwE,sBACxG0E,EAA+B1E,EAAsE,qBACrG2E,EAA4B3E,EAAgE,iBAC5F4E,EAA4B5E,EAAgE,iBAC5F6E,EAA6B7E,EAAkE,kBAC/F8E,EAA+B9E,EAAsE,oBACrG+E,EAA2B/E,EAA8D,gBACzFgF,EAA4BhF,EAAgE,iBAC5FiF,EAA6BjF,EAAkE"}
|
|
1
|
+
{"version":3,"file":"bundle.cjs.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) => 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 (!isCoveredByReact(eventNameLc)) {\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 }\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 * Transforms a React event name to a browser event name.\n */\nexport const transformReactEventName = (eventNameSuffix: string) => {\n switch (eventNameSuffix) {\n case 'doubleclick':\n return 'dblclick';\n }\n return eventNameSuffix;\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) => {\n if (typeof document === 'undefined') {\n return true;\n } else {\n const eventName = 'on' + transformReactEventName(eventNameSuffix);\n let isSupported = eventName in document;\n\n if (!isSupported) {\n const element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n }\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\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// This will be replaced with React.ForwardedRef when react-output-target is upgraded to React v17\nexport type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;\n\nexport const setRef = (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // Cast as a MutableRef so we can assign current\n (ref as React.MutableRefObject<any>).current = value;\n }\n};\n\nexport const mergeRefs = (\n ...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]\n): React.RefCallback<any> => {\n return (value: any) => {\n refs.forEach((ref) => {\n setRef(ref, value);\n });\n };\n};\n\nexport const createForwardRef = <PropType, ElementType>(ReactComponent: any, displayName: string) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: StencilReactForwardedRef<ElementType>\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport const defineCustomElement = (tagName: string, customElement: any) => {\n if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {\n customElements.define(tagName, customElement);\n }\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React, { createElement } from 'react';\n\nimport { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } 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 defineCustomElement?: () => void\n) => {\n if (defineCustomElement !== undefined) {\n defineCustomElement();\n }\n\n const displayName = dashToPascalCase(tagName);\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: any, name) => {\n const value = (cProps as any)[name];\n\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)) {\n acc[name] = value;\n }\n } else {\n // we should only render strings, booleans, and numbers as attrs in html.\n // objects, functions, arrays etc get synced via properties on mount.\n const type = typeof value;\n\n if (type === 'string' || type === 'boolean' || type === 'number') {\n acc[camelToDashCase(name)] = value;\n }\n }\n return acc;\n }, {} as ExpandedPropsTypes);\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n const newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n /**\n * We use createElement here instead of\n * React.createElement to work around a\n * bug in Vite (https://github.com/vitejs/vite/issues/6104).\n * React.createElement causes all elements to be rendered\n * as <tagname> instead of the actual Web Component.\n */\n return 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 VertexAutoResizeTextarea = /*@__PURE__*/createReactComponent<JSX.VertexAutoResizeTextarea, HTMLVertexAutoResizeTextareaElement>('vertex-auto-resize-textarea');\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 VertexChip = /*@__PURE__*/createReactComponent<JSX.VertexChip, HTMLVertexChipElement>('vertex-chip');\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 VertexColorCircle = /*@__PURE__*/createReactComponent<JSX.VertexColorCircle, HTMLVertexColorCircleElement>('vertex-color-circle');\nexport const VertexColorCirclePicker = /*@__PURE__*/createReactComponent<JSX.VertexColorCirclePicker, HTMLVertexColorCirclePickerElement>('vertex-color-circle-picker');\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 VertexDraggablePopover = /*@__PURE__*/createReactComponent<JSX.VertexDraggablePopover, HTMLVertexDraggablePopoverElement>('vertex-draggable-popover');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexExpandable = /*@__PURE__*/createReactComponent<JSX.VertexExpandable, HTMLVertexExpandableElement>('vertex-expandable');\nexport const VertexHelpTooltip = /*@__PURE__*/createReactComponent<JSX.VertexHelpTooltip, HTMLVertexHelpTooltipElement>('vertex-help-tooltip');\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 VertexResultList = /*@__PURE__*/createReactComponent<JSX.VertexResultList, HTMLVertexResultListElement>('vertex-result-list');\nexport const VertexSearchBar = /*@__PURE__*/createReactComponent<JSX.VertexSearchBar, HTMLVertexSearchBarElement>('vertex-search-bar');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSlider = /*@__PURE__*/createReactComponent<JSX.VertexSlider, HTMLVertexSliderElement>('vertex-slider');\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":["camelToDashCase","str","replace","m","toLowerCase","getClassName","classList","newProps","oldProps","newClassProp","className","class","oldClassProp","currentClasses","arrayToMap","incomingPropClasses","split","oldPropClasses","finalClassNames","forEach","currentClass","has","push","delete","s","join","isCoveredByReact","eventNameSuffix","document","eventName","transformReactEventName","isSupported","element","createElement","setAttribute","syncEvent","node","newEventHandler","eventStore","__events","oldEventHandler","removeEventListener","addEventListener","e","call","this","arr","map","Map","set","setRef","ref","value","current","mergeRefs","_i","refs","createReactComponent","tagName","ReactComponentContext","manipulatePropsFunction","defineCustomElement","undefined","displayName","segment","charAt","toUpperCase","slice","ReactComponent","props","_super","_this","componentEl","__extends","class_1","componentDidUpdate","prevProps","Element","Object","keys","name","indexOf","substring","eventNameLc","attachProps","_a","children","forwardedRef","style","cProps","propsToPass","reduce","acc","type","setComponentElRef","React","Component","contextType","forwardRef","createForwardRef","loader","VertexAutoResizeTextarea","VertexAvatar","VertexAvatarGroup","VertexButton","VertexCard","VertexCardGroup","VertexChip","VertexClickToEditTextfield","VertexCollapsible","VertexColorCircle","VertexColorCirclePicker","VertexColorPicker","VertexContextMenu","VertexDialog","VertexDraggablePopover","VertexDropdownMenu","VertexExpandable","VertexHelpTooltip","VertexIcon","VertexIconButton","VertexLogoLoading","VertexMenu","VertexMenuDivider","VertexMenuItem","VertexPopover","VertexRadio","VertexRadioGroup","VertexResizable","VertexResultList","VertexSearchBar","VertexSelect","VertexSlider","VertexSpinner","VertexTextfield","VertexToast","VertexToggle","VertexTooltip"],"mappings":"kOAMaA,EAAkB,SAACC,GAAgB,OAAAA,EAA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AAiCvD,EAA0E,uBAC3GwD,EAAiCxD,EAA0E,uBAC3GyD,EAA4BzD,EAAgE,iBAC5F0D,EAAsC1D,EAAoF,4BAC1H2D,EAAkC3D,EAA4E,wBAC9G4D,EAAgC5D,EAAwE,qBACxG6D,EAAiC7D,EAA0E,uBAC3G8D,EAA0B9D,EAA4D,eACtF+D,EAAgC/D,EAAwE,sBACxGgE,EAAiChE,EAA0E,uBAC3GiE,EAA0BjE,EAA4D,eACtFkE,EAAiClE,EAA0E,uBAC3GmE,EAA8BnE,EAAoE,oBAClGoE,EAA6BpE,EAAkE,kBAC/FqE,EAA2BrE,EAA8D,gBACzFsE,EAAgCtE,EAAwE,sBACxGuE,EAA+BvE,EAAsE,oBACrGwE,EAAgCxE,EAAwE,sBACxGyE,EAA+BzE,EAAsE,qBACrG0E,EAA4B1E,EAAgE,iBAC5F2E,EAA4B3E,EAAgE,iBAC5F4E,EAA6B5E,EAAkE,kBAC/F6E,EAA+B7E,EAAsE,oBACrG8E,EAA2B9E,EAA8D,gBACzF+E,EAA4B/E,EAAgE,iBAC5FgF,EAA6BhF,EAAkE"}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __assign, __extends, __rest } from 'tslib';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { createElement } from 'react';
|
|
3
3
|
import 'react-dom';
|
|
4
4
|
import { defineCustomElements } from '@vertexvis/ui/loader';
|
|
5
5
|
export * from '@vertexvis/ui/loader';
|
|
@@ -11,9 +11,7 @@ var dashToPascalCase = function (str) {
|
|
|
11
11
|
.map(function (segment) { return segment.charAt(0).toUpperCase() + segment.slice(1); })
|
|
12
12
|
.join('');
|
|
13
13
|
};
|
|
14
|
-
var camelToDashCase = function (str) {
|
|
15
|
-
return str.replace(/([A-Z])/g, function (m) { return "-" + m[0].toLowerCase(); });
|
|
16
|
-
};
|
|
14
|
+
var camelToDashCase = function (str) { return str.replace(/([A-Z])/g, function (m) { return "-".concat(m[0].toLowerCase()); }); };
|
|
17
15
|
|
|
18
16
|
var attachProps = function (node, newProps, oldProps) {
|
|
19
17
|
if (oldProps === void 0) { oldProps = {}; }
|
|
@@ -36,7 +34,7 @@ var attachProps = function (node, newProps, oldProps) {
|
|
|
36
34
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
37
35
|
var eventName = name.substring(2);
|
|
38
36
|
var eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
|
|
39
|
-
if (
|
|
37
|
+
if (!isCoveredByReact(eventNameLc)) {
|
|
40
38
|
syncEvent(node, eventNameLc, newProps[name]);
|
|
41
39
|
}
|
|
42
40
|
}
|
|
@@ -46,9 +44,6 @@ var attachProps = function (node, newProps, oldProps) {
|
|
|
46
44
|
if (propType === 'string') {
|
|
47
45
|
node.setAttribute(camelToDashCase(name), newProps[name]);
|
|
48
46
|
}
|
|
49
|
-
else {
|
|
50
|
-
node[name] = newProps[name];
|
|
51
|
-
}
|
|
52
47
|
}
|
|
53
48
|
});
|
|
54
49
|
}
|
|
@@ -77,19 +72,34 @@ var getClassName = function (classList, newProps, oldProps) {
|
|
|
77
72
|
incomingPropClasses.forEach(function (s) { return finalClassNames.push(s); });
|
|
78
73
|
return finalClassNames.join(' ');
|
|
79
74
|
};
|
|
75
|
+
/**
|
|
76
|
+
* Transforms a React event name to a browser event name.
|
|
77
|
+
*/
|
|
78
|
+
var transformReactEventName = function (eventNameSuffix) {
|
|
79
|
+
switch (eventNameSuffix) {
|
|
80
|
+
case 'doubleclick':
|
|
81
|
+
return 'dblclick';
|
|
82
|
+
}
|
|
83
|
+
return eventNameSuffix;
|
|
84
|
+
};
|
|
80
85
|
/**
|
|
81
86
|
* Checks if an event is supported in the current execution environment.
|
|
82
87
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
83
88
|
*/
|
|
84
|
-
var isCoveredByReact = function (eventNameSuffix
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
isSupported =
|
|
89
|
+
var isCoveredByReact = function (eventNameSuffix) {
|
|
90
|
+
if (typeof document === 'undefined') {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
var eventName = 'on' + transformReactEventName(eventNameSuffix);
|
|
95
|
+
var isSupported = eventName in document;
|
|
96
|
+
if (!isSupported) {
|
|
97
|
+
var element = document.createElement('div');
|
|
98
|
+
element.setAttribute(eventName, 'return;');
|
|
99
|
+
isSupported = typeof element[eventName] === 'function';
|
|
100
|
+
}
|
|
101
|
+
return isSupported;
|
|
91
102
|
}
|
|
92
|
-
return isSupported;
|
|
93
103
|
};
|
|
94
104
|
var syncEvent = function (node, eventName, newEventHandler) {
|
|
95
105
|
var eventStore = node.__events || (node.__events = {});
|
|
@@ -111,21 +121,23 @@ var arrayToMap = function (arr) {
|
|
|
111
121
|
return map;
|
|
112
122
|
};
|
|
113
123
|
|
|
114
|
-
|
|
124
|
+
var setRef = function (ref, value) {
|
|
125
|
+
if (typeof ref === 'function') {
|
|
126
|
+
ref(value);
|
|
127
|
+
}
|
|
128
|
+
else if (ref != null) {
|
|
129
|
+
// Cast as a MutableRef so we can assign current
|
|
130
|
+
ref.current = value;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
115
133
|
var mergeRefs = function () {
|
|
116
134
|
var refs = [];
|
|
117
135
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
118
136
|
refs[_i] = arguments[_i];
|
|
119
137
|
}
|
|
120
138
|
return function (value) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
ref(value);
|
|
124
|
-
}
|
|
125
|
-
else if (ref != null) {
|
|
126
|
-
// This is typed as readonly so we need to allow for override
|
|
127
|
-
ref.current = value;
|
|
128
|
-
}
|
|
139
|
+
refs.forEach(function (ref) {
|
|
140
|
+
setRef(ref, value);
|
|
129
141
|
});
|
|
130
142
|
};
|
|
131
143
|
};
|
|
@@ -137,7 +149,10 @@ var createForwardRef = function (ReactComponent, displayName) {
|
|
|
137
149
|
return React.forwardRef(forwardRef);
|
|
138
150
|
};
|
|
139
151
|
|
|
140
|
-
var createReactComponent = function (tagName, ReactComponentContext, manipulatePropsFunction) {
|
|
152
|
+
var createReactComponent = function (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) {
|
|
153
|
+
if (defineCustomElement !== undefined) {
|
|
154
|
+
defineCustomElement();
|
|
155
|
+
}
|
|
141
156
|
var displayName = dashToPascalCase(tagName);
|
|
142
157
|
var ReactComponent = /** @class */ (function (_super) {
|
|
143
158
|
__extends(class_1, _super);
|
|
@@ -157,14 +172,20 @@ var createReactComponent = function (tagName, ReactComponentContext, manipulateP
|
|
|
157
172
|
class_1.prototype.render = function () {
|
|
158
173
|
var _a = this.props, children = _a.children, forwardedRef = _a.forwardedRef, style = _a.style, className = _a.className, ref = _a.ref, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
|
|
159
174
|
var propsToPass = Object.keys(cProps).reduce(function (acc, name) {
|
|
175
|
+
var value = cProps[name];
|
|
160
176
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
161
177
|
var eventName = name.substring(2).toLowerCase();
|
|
162
|
-
if (typeof document !== 'undefined' && isCoveredByReact(eventName
|
|
163
|
-
acc[name] =
|
|
178
|
+
if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
|
|
179
|
+
acc[name] = value;
|
|
164
180
|
}
|
|
165
181
|
}
|
|
166
182
|
else {
|
|
167
|
-
|
|
183
|
+
// we should only render strings, booleans, and numbers as attrs in html.
|
|
184
|
+
// objects, functions, arrays etc get synced via properties on mount.
|
|
185
|
+
var type = typeof value;
|
|
186
|
+
if (type === 'string' || type === 'boolean' || type === 'number') {
|
|
187
|
+
acc[camelToDashCase(name)] = value;
|
|
188
|
+
}
|
|
168
189
|
}
|
|
169
190
|
return acc;
|
|
170
191
|
}, {});
|
|
@@ -172,7 +193,14 @@ var createReactComponent = function (tagName, ReactComponentContext, manipulateP
|
|
|
172
193
|
propsToPass = manipulatePropsFunction(this.props, propsToPass);
|
|
173
194
|
}
|
|
174
195
|
var newProps = __assign(__assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style: style });
|
|
175
|
-
|
|
196
|
+
/**
|
|
197
|
+
* We use createElement here instead of
|
|
198
|
+
* React.createElement to work around a
|
|
199
|
+
* bug in Vite (https://github.com/vitejs/vite/issues/6104).
|
|
200
|
+
* React.createElement causes all elements to be rendered
|
|
201
|
+
* as <tagname> instead of the actual Web Component.
|
|
202
|
+
*/
|
|
203
|
+
return createElement(tagName, newProps, children);
|
|
176
204
|
};
|
|
177
205
|
Object.defineProperty(class_1, "displayName", {
|
|
178
206
|
get: function () {
|
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 VertexAutoResizeTextarea = /*@__PURE__*/createReactComponent<JSX.VertexAutoResizeTextarea, HTMLVertexAutoResizeTextareaElement>('vertex-auto-resize-textarea');\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 VertexChip = /*@__PURE__*/createReactComponent<JSX.VertexChip, HTMLVertexChipElement>('vertex-chip');\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 VertexColorCircle = /*@__PURE__*/createReactComponent<JSX.VertexColorCircle, HTMLVertexColorCircleElement>('vertex-color-circle');\nexport const VertexColorCirclePicker = /*@__PURE__*/createReactComponent<JSX.VertexColorCirclePicker, HTMLVertexColorCirclePickerElement>('vertex-color-circle-picker');\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 VertexDraggablePopover = /*@__PURE__*/createReactComponent<JSX.VertexDraggablePopover, HTMLVertexDraggablePopoverElement>('vertex-draggable-popover');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexExpandable = /*@__PURE__*/createReactComponent<JSX.VertexExpandable, HTMLVertexExpandableElement>('vertex-expandable');\nexport const VertexHelpTooltip = /*@__PURE__*/createReactComponent<JSX.VertexHelpTooltip, HTMLVertexHelpTooltipElement>('vertex-help-tooltip');\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 VertexResultList = /*@__PURE__*/createReactComponent<JSX.VertexResultList, HTMLVertexResultListElement>('vertex-result-list');\nexport const VertexSearchBar = /*@__PURE__*/createReactComponent<JSX.VertexSearchBar, HTMLVertexSearchBarElement>('vertex-search-bar');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSlider = /*@__PURE__*/createReactComponent<JSX.VertexSlider, HTMLVertexSliderElement>('vertex-slider');\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,I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"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) => 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 (!isCoveredByReact(eventNameLc)) {\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 }\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 * Transforms a React event name to a browser event name.\n */\nexport const transformReactEventName = (eventNameSuffix: string) => {\n switch (eventNameSuffix) {\n case 'doubleclick':\n return 'dblclick';\n }\n return eventNameSuffix;\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) => {\n if (typeof document === 'undefined') {\n return true;\n } else {\n const eventName = 'on' + transformReactEventName(eventNameSuffix);\n let isSupported = eventName in document;\n\n if (!isSupported) {\n const element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n }\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\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// This will be replaced with React.ForwardedRef when react-output-target is upgraded to React v17\nexport type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;\n\nexport const setRef = (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // Cast as a MutableRef so we can assign current\n (ref as React.MutableRefObject<any>).current = value;\n }\n};\n\nexport const mergeRefs = (\n ...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]\n): React.RefCallback<any> => {\n return (value: any) => {\n refs.forEach((ref) => {\n setRef(ref, value);\n });\n };\n};\n\nexport const createForwardRef = <PropType, ElementType>(ReactComponent: any, displayName: string) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: StencilReactForwardedRef<ElementType>\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport const defineCustomElement = (tagName: string, customElement: any) => {\n if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {\n customElements.define(tagName, customElement);\n }\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React, { createElement } from 'react';\n\nimport { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } 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 defineCustomElement?: () => void\n) => {\n if (defineCustomElement !== undefined) {\n defineCustomElement();\n }\n\n const displayName = dashToPascalCase(tagName);\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: any, name) => {\n const value = (cProps as any)[name];\n\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)) {\n acc[name] = value;\n }\n } else {\n // we should only render strings, booleans, and numbers as attrs in html.\n // objects, functions, arrays etc get synced via properties on mount.\n const type = typeof value;\n\n if (type === 'string' || type === 'boolean' || type === 'number') {\n acc[camelToDashCase(name)] = value;\n }\n }\n return acc;\n }, {} as ExpandedPropsTypes);\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n const newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n /**\n * We use createElement here instead of\n * React.createElement to work around a\n * bug in Vite (https://github.com/vitejs/vite/issues/6104).\n * React.createElement causes all elements to be rendered\n * as <tagname> instead of the actual Web Component.\n */\n return 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 VertexAutoResizeTextarea = /*@__PURE__*/createReactComponent<JSX.VertexAutoResizeTextarea, HTMLVertexAutoResizeTextareaElement>('vertex-auto-resize-textarea');\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 VertexChip = /*@__PURE__*/createReactComponent<JSX.VertexChip, HTMLVertexChipElement>('vertex-chip');\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 VertexColorCircle = /*@__PURE__*/createReactComponent<JSX.VertexColorCircle, HTMLVertexColorCircleElement>('vertex-color-circle');\nexport const VertexColorCirclePicker = /*@__PURE__*/createReactComponent<JSX.VertexColorCirclePicker, HTMLVertexColorCirclePickerElement>('vertex-color-circle-picker');\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 VertexDraggablePopover = /*@__PURE__*/createReactComponent<JSX.VertexDraggablePopover, HTMLVertexDraggablePopoverElement>('vertex-draggable-popover');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexExpandable = /*@__PURE__*/createReactComponent<JSX.VertexExpandable, HTMLVertexExpandableElement>('vertex-expandable');\nexport const VertexHelpTooltip = /*@__PURE__*/createReactComponent<JSX.VertexHelpTooltip, HTMLVertexHelpTooltipElement>('vertex-help-tooltip');\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 VertexResultList = /*@__PURE__*/createReactComponent<JSX.VertexResultList, HTMLVertexResultListElement>('vertex-result-list');\nexport const VertexSearchBar = /*@__PURE__*/createReactComponent<JSX.VertexSearchBar, HTMLVertexSearchBarElement>('vertex-search-bar');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSlider = /*@__PURE__*/createReactComponent<JSX.VertexSlider, HTMLVertexSliderElement>('vertex-slider');\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,IAAK,OAAA,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,UAAC,CAAS,IAAK,OAAA,WAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAE,GAAA,CAAC,GAAA;;ACJzG,IAAM,WAAW,GAAG,UAAC,IAAiB,EAAE,QAAa,EAAE,QAAkB;IAAlB,yBAAA,EAAA,aAAkB;;IAE9E,IAAI,IAAI,YAAY,OAAO,E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C,CAAC;AACtI,IAAa,gBAAgB,iBAAgB,oBAAoB,CAAoD,oBAAoB,CAAC,CAAC;AAC3I,IAAa,eAAe,iBAAgB,oBAAoB,CAAkD,mBAAmB,CAAC,CAAC;AACvI,IAAa,YAAY,iBAAgB,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,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
|
|
1
|
+
import{__assign as e,__extends as t,__rest as r}from"tslib";import n,{createElement as o}from"react";import"react-dom";import{defineCustomElements as i}from"@vertexvis/ui/loader";export*from"@vertexvis/ui/loader";var c=function(e){return e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())}))},a=function(e,t,r){var n=t.className||t.class,o=r.className||r.class,i=f(e),c=f(n?n.split(" "):[]),a=f(o?o.split(" "):[]),s=[];return i.forEach((function(e){c.has(e)?(s.push(e),c.delete(e)):a.has(e)||s.push(e)})),c.forEach((function(e){return s.push(e)})),s.join(" ")},s=function(e){if("undefined"==typeof document)return!0;var t="on"+function(e){switch(e){case"doubleclick":return"dblclick"}return e}(e),r=t in document;if(!r){var n=document.createElement("div");n.setAttribute(t,"return;"),r="function"==typeof n[t]}return r},u=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)})},f=function(e){var t=new Map;return e.forEach((function(e){return t.set(e,e)})),t},l=function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)},p=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){e.forEach((function(e){l(e,t)}))}},v=function(i,f,l,v){void 0!==v&&v();var d=i.toLowerCase().split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(""),x=function(n){function f(e){var t=n.call(this,e)||this;return t.setComponentElRef=function(e){t.componentEl=e},t}return t(f,n),f.prototype.componentDidMount=function(){this.componentDidUpdate(this.props)},f.prototype.componentDidUpdate=function(e){!function(e,t,r){if(void 0===r&&(r={}),e instanceof Element){var n=a(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);s(o)||u(e,o,t[r])}else{e[r]=t[r],"string"===typeof t[r]&&e.setAttribute(c(r),t[r])}}))}}(this.componentEl,this.props,e)},f.prototype.render=function(){var t=this.props,n=t.children,a=t.forwardedRef,u=t.style,f=(t.className,t.ref,r(t,["children","forwardedRef","style","className","ref"])),v=Object.keys(f).reduce((function(e,t){var r=f[t];if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase()){var n=t.substring(2).toLowerCase();"undefined"!=typeof document&&s(n)&&(e[t]=r)}else{var o=typeof r;"string"!==o&&"boolean"!==o&&"number"!==o||(e[c(t)]=r)}return e}),{});l&&(v=l(this.props,v));var d=e(e({},v),{ref:p(a,this.setComponentElRef),style:u});return o(i,d,n)},Object.defineProperty(f,"displayName",{get:function(){return d},enumerable:!1,configurable:!0}),f}(n.Component);return f&&(x.contextType=f),function(t,r){var o=function(r,o){return n.createElement(t,e({},r,{forwardedRef:o}))};return o.displayName=r,n.forwardRef(o)}(x,d)};i();var d=v("vertex-auto-resize-textarea"),x=v("vertex-avatar"),m=v("vertex-avatar-group"),h=v("vertex-button"),b=v("vertex-card"),g=v("vertex-card-group"),y=v("vertex-chip"),E=v("vertex-click-to-edit-textfield"),w=v("vertex-collapsible"),C=v("vertex-color-circle"),N=v("vertex-color-circle-picker"),k=v("vertex-color-picker"),L=v("vertex-context-menu"),R=v("vertex-dialog"),j=v("vertex-draggable-popover"),O=v("vertex-dropdown-menu"),U=v("vertex-expandable"),A=v("vertex-help-tooltip"),_=v("vertex-icon"),D=v("vertex-icon-button"),z=v("vertex-logo-loading"),M=v("vertex-menu"),P=v("vertex-menu-divider"),T=v("vertex-menu-item"),Z=v("vertex-popover"),q=v("vertex-radio"),B=v("vertex-radio-group"),F=v("vertex-resizable"),G=v("vertex-result-list"),H=v("vertex-search-bar"),I=v("vertex-select"),J=v("vertex-slider"),K=v("vertex-spinner"),Q=v("vertex-textfield"),S=v("vertex-toast"),V=v("vertex-toggle"),W=v("vertex-tooltip");export{d as VertexAutoResizeTextarea,x as VertexAvatar,m as VertexAvatarGroup,h as VertexButton,b as VertexCard,g as VertexCardGroup,y as VertexChip,E as VertexClickToEditTextfield,w as VertexCollapsible,C as VertexColorCircle,N as VertexColorCirclePicker,k as VertexColorPicker,L as VertexContextMenu,R as VertexDialog,j as VertexDraggablePopover,O as VertexDropdownMenu,U as VertexExpandable,A as VertexHelpTooltip,_ as VertexIcon,D as VertexIconButton,z as VertexLogoLoading,M as VertexMenu,P as VertexMenuDivider,T as VertexMenuItem,Z as VertexPopover,q as VertexRadio,B as VertexRadioGroup,F as VertexResizable,G as VertexResultList,H as VertexSearchBar,I as VertexSelect,J as VertexSlider,K as VertexSpinner,Q as VertexTextfield,S as VertexToast,V as VertexToggle,W 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 VertexAutoResizeTextarea = /*@__PURE__*/createReactComponent<JSX.VertexAutoResizeTextarea, HTMLVertexAutoResizeTextareaElement>('vertex-auto-resize-textarea');\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 VertexChip = /*@__PURE__*/createReactComponent<JSX.VertexChip, HTMLVertexChipElement>('vertex-chip');\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 VertexColorCircle = /*@__PURE__*/createReactComponent<JSX.VertexColorCircle, HTMLVertexColorCircleElement>('vertex-color-circle');\nexport const VertexColorCirclePicker = /*@__PURE__*/createReactComponent<JSX.VertexColorCirclePicker, HTMLVertexColorCirclePickerElement>('vertex-color-circle-picker');\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 VertexDraggablePopover = /*@__PURE__*/createReactComponent<JSX.VertexDraggablePopover, HTMLVertexDraggablePopoverElement>('vertex-draggable-popover');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexExpandable = /*@__PURE__*/createReactComponent<JSX.VertexExpandable, HTMLVertexExpandableElement>('vertex-expandable');\nexport const VertexHelpTooltip = /*@__PURE__*/createReactComponent<JSX.VertexHelpTooltip, HTMLVertexHelpTooltipElement>('vertex-help-tooltip');\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 VertexResultList = /*@__PURE__*/createReactComponent<JSX.VertexResultList, HTMLVertexResultListElement>('vertex-result-list');\nexport const VertexSearchBar = /*@__PURE__*/createReactComponent<JSX.VertexSearchBar, HTMLVertexSearchBarElement>('vertex-search-bar');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSlider = /*@__PURE__*/createReactComponent<JSX.VertexSlider, HTMLVertexSliderElement>('vertex-slider');\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","VertexAutoResizeTextarea","VertexAvatar","VertexAvatarGroup","VertexButton","VertexCard","VertexCardGroup","VertexChip","VertexClickToEditTextfield","VertexCollapsible","VertexColorCircle","VertexColorCirclePicker","VertexColorPicker","VertexContextMenu","VertexDialog","VertexDraggablePopover","VertexDropdownMenu","VertexExpandable","VertexHelpTooltip","VertexIcon","VertexIconButton","VertexLogoLoading","VertexMenu","VertexMenuDivider","VertexMenuItem","VertexPopover","VertexRadio","VertexRadioGroup","VertexResizable","VertexResultList","VertexSearchBar","VertexSelect","VertexSlider","VertexSpinner","VertexTextfield","VertexToast","VertexToggle","VertexTooltip"],"mappings":"iMAAO,IC0CMA,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,EAAe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E,EAAkE,kBAC/F8E,EAA+B9E,EAAsE,oBACrG+E,EAA2B/E,EAA8D,gBACzFgF,EAA4BhF,EAAgE,iBAC5FiF,EAA6BjF,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) => 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 (!isCoveredByReact(eventNameLc)) {\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 }\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 * Transforms a React event name to a browser event name.\n */\nexport const transformReactEventName = (eventNameSuffix: string) => {\n switch (eventNameSuffix) {\n case 'doubleclick':\n return 'dblclick';\n }\n return eventNameSuffix;\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) => {\n if (typeof document === 'undefined') {\n return true;\n } else {\n const eventName = 'on' + transformReactEventName(eventNameSuffix);\n let isSupported = eventName in document;\n\n if (!isSupported) {\n const element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof (element as any)[eventName] === 'function';\n }\n\n return isSupported;\n }\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\nexport type StencilReactExternalProps<PropType, ElementType> = PropType &\n Omit<React.HTMLAttributes<ElementType>, 'style'> &\n StyleReactProps;\n\n// This will be replaced with React.ForwardedRef when react-output-target is upgraded to React v17\nexport type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;\n\nexport const setRef = (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n // Cast as a MutableRef so we can assign current\n (ref as React.MutableRefObject<any>).current = value;\n }\n};\n\nexport const mergeRefs = (\n ...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]\n): React.RefCallback<any> => {\n return (value: any) => {\n refs.forEach((ref) => {\n setRef(ref, value);\n });\n };\n};\n\nexport const createForwardRef = <PropType, ElementType>(ReactComponent: any, displayName: string) => {\n const forwardRef = (\n props: StencilReactExternalProps<PropType, ElementType>,\n ref: StencilReactForwardedRef<ElementType>\n ) => {\n return <ReactComponent {...props} forwardedRef={ref} />;\n };\n forwardRef.displayName = displayName;\n\n return React.forwardRef(forwardRef);\n};\n\nexport const defineCustomElement = (tagName: string, customElement: any) => {\n if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {\n customElements.define(tagName, customElement);\n }\n};\n\nexport * from './attachProps';\nexport * from './case';\n","import React, { createElement } from 'react';\n\nimport { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } 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 defineCustomElement?: () => void\n) => {\n if (defineCustomElement !== undefined) {\n defineCustomElement();\n }\n\n const displayName = dashToPascalCase(tagName);\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: any, name) => {\n const value = (cProps as any)[name];\n\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)) {\n acc[name] = value;\n }\n } else {\n // we should only render strings, booleans, and numbers as attrs in html.\n // objects, functions, arrays etc get synced via properties on mount.\n const type = typeof value;\n\n if (type === 'string' || type === 'boolean' || type === 'number') {\n acc[camelToDashCase(name)] = value;\n }\n }\n return acc;\n }, {} as ExpandedPropsTypes);\n\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n\n const newProps: Omit<StencilReactInternalProps<ElementType>, 'forwardedRef'> = {\n ...propsToPass,\n ref: mergeRefs(forwardedRef, this.setComponentElRef),\n style,\n };\n\n /**\n * We use createElement here instead of\n * React.createElement to work around a\n * bug in Vite (https://github.com/vitejs/vite/issues/6104).\n * React.createElement causes all elements to be rendered\n * as <tagname> instead of the actual Web Component.\n */\n return 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 VertexAutoResizeTextarea = /*@__PURE__*/createReactComponent<JSX.VertexAutoResizeTextarea, HTMLVertexAutoResizeTextareaElement>('vertex-auto-resize-textarea');\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 VertexChip = /*@__PURE__*/createReactComponent<JSX.VertexChip, HTMLVertexChipElement>('vertex-chip');\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 VertexColorCircle = /*@__PURE__*/createReactComponent<JSX.VertexColorCircle, HTMLVertexColorCircleElement>('vertex-color-circle');\nexport const VertexColorCirclePicker = /*@__PURE__*/createReactComponent<JSX.VertexColorCirclePicker, HTMLVertexColorCirclePickerElement>('vertex-color-circle-picker');\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 VertexDraggablePopover = /*@__PURE__*/createReactComponent<JSX.VertexDraggablePopover, HTMLVertexDraggablePopoverElement>('vertex-draggable-popover');\nexport const VertexDropdownMenu = /*@__PURE__*/createReactComponent<JSX.VertexDropdownMenu, HTMLVertexDropdownMenuElement>('vertex-dropdown-menu');\nexport const VertexExpandable = /*@__PURE__*/createReactComponent<JSX.VertexExpandable, HTMLVertexExpandableElement>('vertex-expandable');\nexport const VertexHelpTooltip = /*@__PURE__*/createReactComponent<JSX.VertexHelpTooltip, HTMLVertexHelpTooltipElement>('vertex-help-tooltip');\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 VertexResultList = /*@__PURE__*/createReactComponent<JSX.VertexResultList, HTMLVertexResultListElement>('vertex-result-list');\nexport const VertexSearchBar = /*@__PURE__*/createReactComponent<JSX.VertexSearchBar, HTMLVertexSearchBarElement>('vertex-search-bar');\nexport const VertexSelect = /*@__PURE__*/createReactComponent<JSX.VertexSelect, HTMLVertexSelectElement>('vertex-select');\nexport const VertexSlider = /*@__PURE__*/createReactComponent<JSX.VertexSlider, HTMLVertexSliderElement>('vertex-slider');\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":["camelToDashCase","str","replace","m","toLowerCase","getClassName","classList","newProps","oldProps","newClassProp","className","class","oldClassProp","currentClasses","arrayToMap","incomingPropClasses","split","oldPropClasses","finalClassNames","forEach","currentClass","has","push","delete","s","join","isCoveredByReact","eventNameSuffix","document","eventName","transformReactEventName","isSupported","element","createElement","setAttribute","syncEvent","node","newEventHandler","eventStore","__events","oldEventHandler","removeEventListener","addEventListener","e","call","this","arr","map","Map","set","setRef","ref","value","current","mergeRefs","_i","refs","createReactComponent","tagName","ReactComponentContext","manipulatePropsFunction","defineCustomElement","undefined","displayName","segment","charAt","toUpperCase","slice","ReactComponent","props","_super","_this","componentEl","__extends","class_1","componentDidUpdate","prevProps","Element","Object","keys","name","indexOf","substring","eventNameLc","attachProps","_a","children","forwardedRef","style","cProps","propsToPass","reduce","acc","type","setComponentElRef","React","Component","contextType","forwardRef","createForwardRef","defineCustomElements","VertexAutoResizeTextarea","VertexAvatar","VertexAvatarGroup","VertexButton","VertexCard","VertexCardGroup","VertexChip","VertexClickToEditTextfield","VertexCollapsible","VertexColorCircle","VertexColorCirclePicker","VertexColorPicker","VertexContextMenu","VertexDialog","VertexDraggablePopover","VertexDropdownMenu","VertexExpandable","VertexHelpTooltip","VertexIcon","VertexIconButton","VertexLogoLoading","VertexMenu","VertexMenuDivider","VertexMenuItem","VertexPopover","VertexRadio","VertexRadioGroup","VertexResizable","VertexResultList","VertexSearchBar","VertexSelect","VertexSlider","VertexSpinner","VertexTextfield","VertexToast","VertexToggle","VertexTooltip"],"mappings":"qNAAO,IAMMA,EAAkB,SAACC,GAAgB,OAAAA,EAAIC,QAAQ,YAAY,SAACC,GAAc,MAAA,WAAIA,EAAE,GAAGC,mBCkCnFC,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,MAkBjBC,EAAmB,SAACC,GAC/B,GAAwB,oBAAbC,SACT,OAAO,EAEP,IAAMC,EAAY,KAhBiB,SAACF,GACtC,OAAQA,GACN,IAAK,cACH,MAAO,WAEX,OAAOA,EAWoBG,CAAwBH,GAC7CI,EAAcF,KAAaD,SAE/B,I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ElementType> extends React.HTMLAttributes<El
|
|
|
6
6
|
forwardedRef: React.RefObject<ElementType>;
|
|
7
7
|
ref?: React.Ref<any>;
|
|
8
8
|
}
|
|
9
|
-
export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType> | undefined, manipulatePropsFunction?: ((originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes) | undefined) => React.ForwardRefExoticComponent<React.PropsWithoutRef<PropType & Omit<React.HTMLAttributes<ElementType>, "style"> & import("./interfaces").StyleReactProps> & React.RefAttributes<ElementType>>;
|
|
9
|
+
export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType> | undefined, manipulatePropsFunction?: ((originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes) | undefined, defineCustomElement?: () => void) => React.ForwardRefExoticComponent<React.PropsWithoutRef<PropType & Omit<React.HTMLAttributes<ElementType>, "style"> & import("./interfaces").StyleReactProps> & React.RefAttributes<ElementType>>;
|
|
10
10
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { OverlayEventDetail } from './interfaces';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { OverlayEventDetail } from './interfaces';
|
|
3
|
+
import { StencilReactForwardedRef } from './utils';
|
|
3
4
|
interface OverlayElement extends HTMLElement {
|
|
4
5
|
present: () => Promise<void>;
|
|
5
6
|
dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
|
|
@@ -12,9 +13,9 @@ export interface ReactOverlayProps {
|
|
|
12
13
|
onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
13
14
|
onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
14
15
|
}
|
|
15
|
-
export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(
|
|
16
|
+
export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(tagName: string, controller: {
|
|
16
17
|
create: (options: any) => Promise<OverlayType>;
|
|
17
|
-
}) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
|
|
18
|
-
forwardedRef?:
|
|
18
|
+
}, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
|
|
19
|
+
forwardedRef?: StencilReactForwardedRef<OverlayType> | undefined;
|
|
19
20
|
}> & React.RefAttributes<OverlayType>>;
|
|
20
21
|
export {};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
|
|
2
2
|
export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Transforms a React event name to a browser event name.
|
|
5
|
+
*/
|
|
6
|
+
export declare const transformReactEventName: (eventNameSuffix: string) => string;
|
|
3
7
|
/**
|
|
4
8
|
* Checks if an event is supported in the current execution environment.
|
|
5
9
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
6
10
|
*/
|
|
7
|
-
export declare const isCoveredByReact: (eventNameSuffix: string
|
|
11
|
+
export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
|
|
8
12
|
export declare const syncEvent: (node: Element & {
|
|
9
13
|
__events?: {
|
|
10
14
|
[key: string]: ((e: Event) => any) | undefined;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StyleReactProps } from '../interfaces';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
|
|
4
|
+
export type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;
|
|
5
|
+
export declare const setRef: (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => void;
|
|
6
|
+
export declare const mergeRefs: (...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]) => React.RefCallback<any>;
|
|
5
7
|
export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<PropType & Omit<React.HTMLAttributes<ElementType>, "style"> & StyleReactProps> & React.RefAttributes<ElementType>>;
|
|
8
|
+
export declare const defineCustomElement: (tagName: string, customElement: any) => void;
|
|
6
9
|
export * from './attachProps';
|
|
7
10
|
export * from './case';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertexvis/ui-react",
|
|
3
|
-
"version": "0.0.14
|
|
3
|
+
"version": "0.0.14",
|
|
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.5.1",
|
|
39
|
-
"@vertexwebui/build": "
|
|
39
|
+
"@vertexwebui/build": "0.0.14",
|
|
40
40
|
"eslint": "8.49.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": "
|
|
50
|
+
"@vertexvis/ui": "0.0.14"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "830b636fea592a9ca2f8fe40354198085437c34f"
|
|
53
53
|
}
|