@watermarkinsights/ripple-react 5.11.2 → 5.13.0-alpha.1

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.
Files changed (47) hide show
  1. package/README.md +0 -1
  2. package/package.json +14 -35
  3. package/dist/components/index.d.ts +0 -1
  4. package/dist/components/index.js +0 -2
  5. package/dist/components/index.js.map +0 -1
  6. package/dist/components/stencil-generated/index.d.ts +0 -1
  7. package/dist/components/stencil-generated/index.js +0 -29
  8. package/dist/components/stencil-generated/index.js.map +0 -1
  9. package/dist/components.d.ts +0 -48
  10. package/dist/components.js +0 -51
  11. package/dist/components.js.map +0 -1
  12. package/dist/index.d.ts +0 -1
  13. package/dist/index.js +0 -4
  14. package/dist/index.js.map +0 -1
  15. package/dist/react-component-lib/ReactProps.d.ts +0 -3
  16. package/dist/react-component-lib/ReactProps.js +0 -1
  17. package/dist/react-component-lib/ReactProps.js.map +0 -1
  18. package/dist/react-component-lib/createComponent.d.ts +0 -10
  19. package/dist/react-component-lib/createComponent.js +0 -106
  20. package/dist/react-component-lib/createComponent.js.map +0 -1
  21. package/dist/react-component-lib/createControllerComponent.d.ts +0 -43
  22. package/dist/react-component-lib/createControllerComponent.js +0 -146
  23. package/dist/react-component-lib/createControllerComponent.js.map +0 -1
  24. package/dist/react-component-lib/createOverlayComponent.d.ts +0 -21
  25. package/dist/react-component-lib/createOverlayComponent.js +0 -189
  26. package/dist/react-component-lib/createOverlayComponent.js.map +0 -1
  27. package/dist/react-component-lib/index.d.ts +0 -2
  28. package/dist/react-component-lib/index.js +0 -3
  29. package/dist/react-component-lib/index.js.map +0 -1
  30. package/dist/react-component-lib/interfaces.d.ts +0 -29
  31. package/dist/react-component-lib/interfaces.js +0 -1
  32. package/dist/react-component-lib/interfaces.js.map +0 -1
  33. package/dist/react-component-lib/utils/attachEventProps.d.ts +0 -8
  34. package/dist/react-component-lib/utils/attachEventProps.js +0 -79
  35. package/dist/react-component-lib/utils/attachEventProps.js.map +0 -1
  36. package/dist/react-component-lib/utils/attachProps.d.ts +0 -16
  37. package/dist/react-component-lib/utils/attachProps.js +0 -109
  38. package/dist/react-component-lib/utils/attachProps.js.map +0 -1
  39. package/dist/react-component-lib/utils/case.d.ts +0 -2
  40. package/dist/react-component-lib/utils/case.js +0 -9
  41. package/dist/react-component-lib/utils/case.js.map +0 -1
  42. package/dist/react-component-lib/utils/dev.d.ts +0 -2
  43. package/dist/react-component-lib/utils/dev.js +0 -13
  44. package/dist/react-component-lib/utils/dev.js.map +0 -1
  45. package/dist/react-component-lib/utils/index.d.ts +0 -10
  46. package/dist/react-component-lib/utils/index.js +0 -47
  47. package/dist/react-component-lib/utils/index.js.map +0 -1
@@ -1,51 +0,0 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- /* auto-generated react proxies */
4
- import { createReactComponent } from './react-component-lib';
5
- export var PrivCalendar = /*@__PURE__*/ createReactComponent('priv-calendar');
6
- export var PrivChartPopover = /*@__PURE__*/ createReactComponent('priv-chart-popover');
7
- export var PrivNavigatorButton = /*@__PURE__*/ createReactComponent('priv-navigator-button');
8
- export var PrivNavigatorItem = /*@__PURE__*/ createReactComponent('priv-navigator-item');
9
- export var PrivOptionList = /*@__PURE__*/ createReactComponent('priv-option-list');
10
- export var WmActionMenu = /*@__PURE__*/ createReactComponent('wm-action-menu');
11
- export var WmButton = /*@__PURE__*/ createReactComponent('wm-button');
12
- export var WmChart = /*@__PURE__*/ createReactComponent('wm-chart');
13
- export var WmChartSlice = /*@__PURE__*/ createReactComponent('wm-chart-slice');
14
- export var WmDateRange = /*@__PURE__*/ createReactComponent('wm-date-range');
15
- export var WmDatepicker = /*@__PURE__*/ createReactComponent('wm-datepicker');
16
- export var WmFile = /*@__PURE__*/ createReactComponent('wm-file');
17
- export var WmFileList = /*@__PURE__*/ createReactComponent('wm-file-list');
18
- export var WmInput = /*@__PURE__*/ createReactComponent('wm-input');
19
- export var WmLineChart = /*@__PURE__*/ createReactComponent('wm-line-chart');
20
- export var WmMenuitem = /*@__PURE__*/ createReactComponent('wm-menuitem');
21
- export var WmModal = /*@__PURE__*/ createReactComponent('wm-modal');
22
- export var WmModalFooter = /*@__PURE__*/ createReactComponent('wm-modal-footer');
23
- export var WmModalHeader = /*@__PURE__*/ createReactComponent('wm-modal-header');
24
- export var WmModalPss = /*@__PURE__*/ createReactComponent('wm-modal-pss');
25
- export var WmModalPssFooter = /*@__PURE__*/ createReactComponent('wm-modal-pss-footer');
26
- export var WmModalPssHeader = /*@__PURE__*/ createReactComponent('wm-modal-pss-header');
27
- export var WmNavigation = /*@__PURE__*/ createReactComponent('wm-navigation');
28
- export var WmNavigationHamburger = /*@__PURE__*/ createReactComponent('wm-navigation-hamburger');
29
- export var WmNavigationItem = /*@__PURE__*/ createReactComponent('wm-navigation-item');
30
- export var WmNavigator = /*@__PURE__*/ createReactComponent('wm-navigator');
31
- export var WmNestedSelect = /*@__PURE__*/ createReactComponent('wm-nested-select');
32
- export var WmOptgroup = /*@__PURE__*/ createReactComponent('wm-optgroup');
33
- export var WmOption = /*@__PURE__*/ createReactComponent('wm-option');
34
- export var WmPagination = /*@__PURE__*/ createReactComponent('wm-pagination');
35
- export var WmProgressIndicator = /*@__PURE__*/ createReactComponent('wm-progress-indicator');
36
- export var WmProgressMonitor = /*@__PURE__*/ createReactComponent('wm-progress-monitor');
37
- export var WmProgressSlice = /*@__PURE__*/ createReactComponent('wm-progress-slice');
38
- export var WmSearch = /*@__PURE__*/ createReactComponent('wm-search');
39
- export var WmSelect = /*@__PURE__*/ createReactComponent('wm-select');
40
- export var WmSnackbar = /*@__PURE__*/ createReactComponent('wm-snackbar');
41
- export var WmTabItem = /*@__PURE__*/ createReactComponent('wm-tab-item');
42
- export var WmTabList = /*@__PURE__*/ createReactComponent('wm-tab-list');
43
- export var WmTabPanel = /*@__PURE__*/ createReactComponent('wm-tab-panel');
44
- export var WmTagInput = /*@__PURE__*/ createReactComponent('wm-tag-input');
45
- export var WmTagOption = /*@__PURE__*/ createReactComponent('wm-tag-option');
46
- export var WmTextarea = /*@__PURE__*/ createReactComponent('wm-textarea');
47
- export var WmTimepicker = /*@__PURE__*/ createReactComponent('wm-timepicker');
48
- export var WmToggletip = /*@__PURE__*/ createReactComponent('wm-toggletip');
49
- export var WmUploader = /*@__PURE__*/ createReactComponent('wm-uploader');
50
- export var WmWrapper = /*@__PURE__*/ createReactComponent('wm-wrapper');
51
- //# sourceMappingURL=components.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB,kCAAkC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAM7D,MAAM,CAAC,IAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,MAAM,CAAC,IAAM,gBAAgB,GAAG,aAAa,CAAA,oBAAoB,CAAoD,oBAAoB,CAAC,CAAC;AAC3I,MAAM,CAAC,IAAM,mBAAmB,GAAG,aAAa,CAAA,oBAAoB,CAA0D,uBAAuB,CAAC,CAAC;AACvJ,MAAM,CAAC,IAAM,iBAAiB,GAAG,aAAa,CAAA,oBAAoB,CAAsD,qBAAqB,CAAC,CAAC;AAC/I,MAAM,CAAC,IAAM,cAAc,GAAG,aAAa,CAAA,oBAAoB,CAAgD,kBAAkB,CAAC,CAAC;AACnI,MAAM,CAAC,IAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,gBAAgB,CAAC,CAAC;AAC3H,MAAM,CAAC,IAAM,QAAQ,GAAG,aAAa,CAAA,oBAAoB,CAAoC,WAAW,CAAC,CAAC;AAC1G,MAAM,CAAC,IAAM,OAAO,GAAG,aAAa,CAAA,oBAAoB,CAAkC,UAAU,CAAC,CAAC;AACtG,MAAM,CAAC,IAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,gBAAgB,CAAC,CAAC;AAC3H,MAAM,CA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AA,oBAAoB,CAAwC,cAAc,CAAC,CAAC;AACnH,MAAM,CAAC,IAAM,UAAU,GAAG,aAAa,CAAA,oBAAoB,CAAwC,cAAc,CAAC,CAAC;AACnH,MAAM,CAAC,IAAM,WAAW,GAAG,aAAa,CAAA,oBAAoB,CAA0C,eAAe,CAAC,CAAC;AACvH,MAAM,CAAC,IAAM,UAAU,GAAG,aAAa,CAAA,oBAAoB,CAAwC,aAAa,CAAC,CAAC;AAClH,MAAM,CAAC,IAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,MAAM,CAAC,IAAM,WAAW,GAAG,aAAa,CAAA,oBAAoB,CAA0C,cAAc,CAAC,CAAC;AACtH,MAAM,CAAC,IAAM,UAAU,GAAG,aAAa,CAAA,oBAAoB,CAAwC,aAAa,CAAC,CAAC;AAClH,MAAM,CAAC,IAAM,SAAS,GAAG,aAAa,CAAA,oBAAoB,CAAsC,YAAY,CAAC,CAAC"}
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components';
package/dist/index.js DELETED
@@ -1,4 +0,0 @@
1
- import { defineCustomElements, applyPolyfills } from '@watermarkinsights/ripple/dist/loader';
2
- applyPolyfills().then(function () { return defineCustomElements(); });
3
- export * from './components';
4
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC7F,cAAc,EAAE,CAAC,IAAI,CAAC,cAAc,OAAO,oBAAoB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,cAAc,cAAc,CAAC"}
@@ -1,3 +0,0 @@
1
- export interface ReactProps {
2
- className?: string;
3
- }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=ReactProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactProps.js","sourceRoot":"","sources":["../../src/react-component-lib/ReactProps.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export interface HTMLStencilElement extends HTMLElement {
3
- componentOnReady(): Promise<this>;
4
- }
5
- interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
6
- forwardedRef: React.RefObject<ElementType>;
7
- ref?: React.Ref<any>;
8
- }
9
- export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType>, manipulatePropsFunction?: (originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes, defineCustomElement?: () => void) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
10
- export {};
@@ -1,106 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- var __assign = (this && this.__assign) || function () {
15
- __assign = Object.assign || function(t) {
16
- for (var s, i = 1, n = arguments.length; i < n; i++) {
17
- s = arguments[i];
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
19
- t[p] = s[p];
20
- }
21
- return t;
22
- };
23
- return __assign.apply(this, arguments);
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- import React, { createElement } from 'react';
37
- import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
38
- export var createReactComponent = function (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) {
39
- if (defineCustomElement !== undefined) {
40
- defineCustomElement();
41
- }
42
- var displayName = dashToPascalCase(tagName);
43
- var ReactComponent = /** @class */ (function (_super) {
44
- __extends(class_1, _super);
45
- function class_1(props) {
46
- var _this = _super.call(this, props) || this;
47
- _this.setComponentElRef = function (element) {
48
- _this.componentEl = element;
49
- };
50
- return _this;
51
- }
52
- class_1.prototype.componentDidMount = function () {
53
- this.componentDidUpdate(this.props);
54
- };
55
- class_1.prototype.componentDidUpdate = function (prevProps) {
56
- attachProps(this.componentEl, this.props, prevProps);
57
- };
58
- class_1.prototype.render = function () {
59
- 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"]);
60
- var propsToPass = Object.keys(cProps).reduce(function (acc, name) {
61
- var value = cProps[name];
62
- if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
63
- var eventName = name.substring(2).toLowerCase();
64
- if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
65
- acc[name] = value;
66
- }
67
- }
68
- else {
69
- // we should only render strings, booleans, and numbers as attrs in html.
70
- // objects, functions, arrays etc get synced via properties on mount.
71
- var type = typeof value;
72
- if (type === 'string' || type === 'boolean' || type === 'number') {
73
- acc[camelToDashCase(name)] = value;
74
- }
75
- }
76
- return acc;
77
- }, {});
78
- if (manipulatePropsFunction) {
79
- propsToPass = manipulatePropsFunction(this.props, propsToPass);
80
- }
81
- var newProps = __assign(__assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style: style });
82
- /**
83
- * We use createElement here instead of
84
- * React.createElement to work around a
85
- * bug in Vite (https://github.com/vitejs/vite/issues/6104).
86
- * React.createElement causes all elements to be rendered
87
- * as <tagname> instead of the actual Web Component.
88
- */
89
- return createElement(tagName, newProps, children);
90
- };
91
- Object.defineProperty(class_1, "displayName", {
92
- get: function () {
93
- return displayName;
94
- },
95
- enumerable: false,
96
- configurable: true
97
- });
98
- return class_1;
99
- }(React.Component));
100
- // If context was passed to createReactComponent then conditionally add it to the Component Class
101
- if (ReactComponentContext) {
102
- ReactComponent.contextType = ReactComponentContext;
103
- }
104
- return createForwardRef(ReactComponent, displayName);
105
- };
106
- //# sourceMappingURL=createComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createComponent.js","sourceRoot":"","sources":["../../src/react-component-lib/createComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAWxH,MAAM,CAAC,IAAM,oBAAoB,GAAG,UAMlC,OAAe,EACf,qBAAuD,EACvD,uBAGuB,EACvB,mBAAgC;IAEhC,IAAI,mBAAmB,KAAK,SAAS,EAAE;QACrC,mBAAmB,EAAE,CAAC;KACvB;IAED,IAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAM,cAAc;QAAiB,2BAAuD;QAO1F,iBAAY,KAA6C;YAAzD,YACE,kBAAM,KAAK,CAAC,SACb;YAND,uBAAiB,GAAG,UAAC,OAAoB;gBACvC,KAAI,CAAC,WAAW,GAAG,OAAO,CAAC;YAC7B,CAAC,CAAC;;QAIF,CAAC;QAED,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EAAwB,CAAC,CAAC;YAE7B,IAAI,uBAAuB,EAAE;gBAC3B,WAAW,GAAG,uBAAuB,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;aAChE;YAED,IAAM,QAAQ,yBACT,WAAW,KACd,GAAG,EAAE,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC,EACpD,KAAK,OAAA,GACN,CAAC;YAEF;;;;;;eAMG;YACH,OAAO,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC;QAED,sBAAW,sBAAW;iBAAtB;gBACE,OAAO,WAAW,CAAC;YACrB,CAAC;;;WAAA;QACH,cAAC;IAAD,CAAC,AAjEsB,CAAc,KAAK,CAAC,SAAS,EAiEnD,CAAC;IAEF,iGAAiG;IACjG,IAAI,qBAAqB,EAAE;QACzB,cAAc,CAAC,WAAW,GAAG,qBAAqB,CAAC;KACpD;IAED,OAAO,gBAAgB,CAAwB,cAAc,EAAE,WAAW,CAAC,CAAC;AAC9E,CAAC,CAAC"}
@@ -1,43 +0,0 @@
1
- import React from 'react';
2
- interface LoadingElement {
3
- present: () => any;
4
- dismiss: () => any;
5
- }
6
- interface ReactControllerProps<E> {
7
- isOpen: boolean;
8
- onDidDismiss: (event: CustomEvent<E>) => void;
9
- }
10
- export declare function createControllerComponent<OptionsType extends object, LoadingElementType extends LoadingElement, OverlayEventDetail>(displayName: string, controller: {
11
- create: (options: any) => Promise<LoadingElementType>;
12
- }): {
13
- new (props: OptionsType & ReactControllerProps<OverlayEventDetail>): {
14
- controller?: LoadingElementType;
15
- componentDidMount(): Promise<void>;
16
- componentDidUpdate(prevProps: OptionsType & ReactControllerProps<OverlayEventDetail>): Promise<void>;
17
- present(prevProps?: OptionsType & ReactControllerProps<OverlayEventDetail>): Promise<void>;
18
- render(): null;
19
- context: any;
20
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void;
21
- forceUpdate(callback?: () => void): void;
22
- readonly props: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>> & Readonly<{
23
- children?: React.ReactNode;
24
- }>;
25
- state: Readonly<{}>;
26
- refs: {
27
- [key: string]: React.ReactInstance;
28
- };
29
- shouldComponentUpdate?(nextProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, nextState: Readonly<{}>, nextContext: any): boolean;
30
- componentWillUnmount?(): void;
31
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
32
- getSnapshotBeforeUpdate?(prevProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, prevState: Readonly<{}>): any;
33
- componentWillMount?(): void;
34
- UNSAFE_componentWillMount?(): void;
35
- componentWillReceiveProps?(nextProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, nextContext: any): void;
36
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, nextContext: any): void;
37
- componentWillUpdate?(nextProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, nextState: Readonly<{}>, nextContext: any): void;
38
- UNSAFE_componentWillUpdate?(nextProps: Readonly<OptionsType & ReactControllerProps<OverlayEventDetail>>, nextState: Readonly<{}>, nextContext: any): void;
39
- };
40
- readonly displayName: string;
41
- contextType?: React.Context<any>;
42
- };
43
- export {};
@@ -1,146 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- var __assign = (this && this.__assign) || function () {
15
- __assign = Object.assign || function(t) {
16
- for (var s, i = 1, n = arguments.length; i < n; i++) {
17
- s = arguments[i];
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
19
- t[p] = s[p];
20
- }
21
- return t;
22
- };
23
- return __assign.apply(this, arguments);
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
- function verb(n) { return function (v) { return step([n, v]); }; }
38
- function step(op) {
39
- if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
41
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
- if (y = 0, t) op = [op[0] & 2, t.value];
43
- switch (op[0]) {
44
- case 0: case 1: t = op; break;
45
- case 4: _.label++; return { value: op[1], done: false };
46
- case 5: _.label++; y = op[1]; op = [0]; continue;
47
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
- default:
49
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
- if (t[2]) _.ops.pop();
54
- _.trys.pop(); continue;
55
- }
56
- op = body.call(thisArg, _);
57
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
- }
60
- };
61
- var __rest = (this && this.__rest) || function (s, e) {
62
- var t = {};
63
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
64
- t[p] = s[p];
65
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
66
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
67
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
68
- t[p[i]] = s[p[i]];
69
- }
70
- return t;
71
- };
72
- import React from 'react';
73
- import { attachEventProps } from './utils/attachEventProps';
74
- export function createControllerComponent(displayName, controller) {
75
- var dismissEventName = "on" + displayName + "DidDismiss";
76
- return /** @class */ (function (_super) {
77
- __extends(ReactControllerComponent, _super);
78
- function ReactControllerComponent(props) {
79
- return _super.call(this, props) || this;
80
- }
81
- Object.defineProperty(ReactControllerComponent, "displayName", {
82
- get: function () {
83
- return displayName;
84
- },
85
- enumerable: false,
86
- configurable: true
87
- });
88
- ReactControllerComponent.prototype.componentDidMount = function () {
89
- return __awaiter(this, void 0, void 0, function () {
90
- var isOpen;
91
- return __generator(this, function (_a) {
92
- isOpen = this.props.isOpen;
93
- if (isOpen) {
94
- this.present();
95
- }
96
- return [2 /*return*/];
97
- });
98
- });
99
- };
100
- ReactControllerComponent.prototype.componentDidUpdate = function (prevProps) {
101
- return __awaiter(this, void 0, void 0, function () {
102
- return __generator(this, function (_a) {
103
- switch (_a.label) {
104
- case 0:
105
- if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
106
- this.present(prevProps);
107
- }
108
- if (!(this.controller &&
109
- prevProps.isOpen !== this.props.isOpen &&
110
- this.props.isOpen === false)) return [3 /*break*/, 2];
111
- return [4 /*yield*/, this.controller.dismiss()];
112
- case 1:
113
- _a.sent();
114
- _a.label = 2;
115
- case 2: return [2 /*return*/];
116
- }
117
- });
118
- });
119
- };
120
- ReactControllerComponent.prototype.present = function (prevProps) {
121
- return __awaiter(this, void 0, void 0, function () {
122
- var _a, isOpen, onDidDismiss, cProps, elementProps, _b;
123
- var _c;
124
- return __generator(this, function (_d) {
125
- switch (_d.label) {
126
- case 0:
127
- _a = this.props, isOpen = _a.isOpen, onDidDismiss = _a.onDidDismiss, cProps = __rest(_a, ["isOpen", "onDidDismiss"]);
128
- elementProps = __assign(__assign({}, cProps), (_c = {}, _c[dismissEventName] = onDidDismiss, _c));
129
- _b = this;
130
- return [4 /*yield*/, controller.create(__assign({}, elementProps))];
131
- case 1:
132
- _b.controller = _d.sent();
133
- attachEventProps(this.controller, elementProps, prevProps);
134
- this.controller.present();
135
- return [2 /*return*/];
136
- }
137
- });
138
- });
139
- };
140
- ReactControllerComponent.prototype.render = function () {
141
- return null;
142
- };
143
- return ReactControllerComponent;
144
- }(React.Component));
145
- }
146
- //# sourceMappingURL=createControllerComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createControllerComponent.js","sourceRoot":"","sources":["../../src/react-component-lib/createControllerComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAY5D,MAAM,UAAU,yBAAyB,CAIvC,WAAmB,EAAE,UAAqE;IAC1F,IAAM,gBAAgB,GAAG,OAAK,WAAW,eAAY,CAAC;IAItD;QAA8C,4CAAsB;QAGlE,kCAAY,KAA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E,OAAO,IAAI,CAAC;QACd,CAAC;QACH,+BAAC;IAAD,CAAC,AA/CM,CAAuC,KAAK,CAAC,SAAS,GA+C3D;AACJ,CAAC"}
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { OverlayEventDetail } from './interfaces';
3
- import { StencilReactForwardedRef } from './utils';
4
- interface OverlayElement extends HTMLElement {
5
- present: () => Promise<void>;
6
- dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
7
- }
8
- export interface ReactOverlayProps {
9
- children?: React.ReactNode;
10
- isOpen: boolean;
11
- onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
12
- onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
13
- onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
14
- onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
15
- }
16
- export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(tagName: string, controller: {
17
- create: (options: any) => Promise<OverlayType>;
18
- }, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
19
- forwardedRef?: StencilReactForwardedRef<OverlayType>;
20
- }> & React.RefAttributes<OverlayType>>;
21
- export {};
@@ -1,189 +0,0 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- var __assign = (this && this.__assign) || function () {
15
- __assign = Object.assign || function(t) {
16
- for (var s, i = 1, n = arguments.length; i < n; i++) {
17
- s = arguments[i];
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
19
- t[p] = s[p];
20
- }
21
- return t;
22
- };
23
- return __assign.apply(this, arguments);
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
- function verb(n) { return function (v) { return step([n, v]); }; }
38
- function step(op) {
39
- if (f) throw new TypeError("Generator is already executing.");
40
- while (_) try {
41
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
- if (y = 0, t) op = [op[0] & 2, t.value];
43
- switch (op[0]) {
44
- case 0: case 1: t = op; break;
45
- case 4: _.label++; return { value: op[1], done: false };
46
- case 5: _.label++; y = op[1]; op = [0]; continue;
47
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
- default:
49
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
- if (t[2]) _.ops.pop();
54
- _.trys.pop(); continue;
55
- }
56
- op = body.call(thisArg, _);
57
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
- }
60
- };
61
- var __rest = (this && this.__rest) || function (s, e) {
62
- var t = {};
63
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
64
- t[p] = s[p];
65
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
66
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
67
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
68
- t[p[i]] = s[p[i]];
69
- }
70
- return t;
71
- };
72
- import React from 'react';
73
- import ReactDOM from 'react-dom';
74
- import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
75
- export var createOverlayComponent = function (tagName, controller, customElement) {
76
- defineCustomElement(tagName, customElement);
77
- var displayName = dashToPascalCase(tagName);
78
- var didDismissEventName = "on" + displayName + "DidDismiss";
79
- var didPresentEventName = "on" + displayName + "DidPresent";
80
- var willDismissEventName = "on" + displayName + "WillDismiss";
81
- var willPresentEventName = "on" + displayName + "WillPresent";
82
- var isDismissing = false;
83
- var Overlay = /** @class */ (function (_super) {
84
- __extends(Overlay, _super);
85
- function Overlay(props) {
86
- var _this = _super.call(this, props) || this;
87
- if (typeof document !== 'undefined') {
88
- _this.el = document.createElement('div');
89
- }
90
- _this.handleDismiss = _this.handleDismiss.bind(_this);
91
- return _this;
92
- }
93
- Object.defineProperty(Overlay, "displayName", {
94
- get: function () {
95
- return displayName;
96
- },
97
- enumerable: false,
98
- configurable: true
99
- });
100
- Overlay.prototype.componentDidMount = function () {
101
- if (this.props.isOpen) {
102
- this.present();
103
- }
104
- };
105
- Overlay.prototype.componentWillUnmount = function () {
106
- if (this.overlay) {
107
- this.overlay.dismiss();
108
- }
109
- };
110
- Overlay.prototype.handleDismiss = function (event) {
111
- if (this.props.onDidDismiss) {
112
- this.props.onDidDismiss(event);
113
- }
114
- setRef(this.props.forwardedRef, null);
115
- };
116
- Overlay.prototype.shouldComponentUpdate = function (nextProps) {
117
- // Check if the overlay component is about to dismiss
118
- if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
119
- isDismissing = true;
120
- }
121
- return true;
122
- };
123
- Overlay.prototype.componentDidUpdate = function (prevProps) {
124
- return __awaiter(this, void 0, void 0, function () {
125
- return __generator(this, function (_a) {
126
- switch (_a.label) {
127
- case 0:
128
- if (this.overlay) {
129
- attachProps(this.overlay, this.props, prevProps);
130
- }
131
- if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
132
- this.present(prevProps);
133
- }
134
- if (!(this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false)) return [3 /*break*/, 2];
135
- return [4 /*yield*/, this.overlay.dismiss()];
136
- case 1:
137
- _a.sent();
138
- isDismissing = false;
139
- /**
140
- * Now that the overlay is dismissed
141
- * we need to render again so that any
142
- * inner components will be unmounted
143
- */
144
- this.forceUpdate();
145
- _a.label = 2;
146
- case 2: return [2 /*return*/];
147
- }
148
- });
149
- });
150
- };
151
- Overlay.prototype.present = function (prevProps) {
152
- return __awaiter(this, void 0, void 0, function () {
153
- var _a, children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent, cProps, elementProps, _b;
154
- var _c;
155
- var _this = this;
156
- return __generator(this, function (_d) {
157
- switch (_d.label) {
158
- case 0:
159
- _a = this.props, children = _a.children, isOpen = _a.isOpen, onDidDismiss = _a.onDidDismiss, onDidPresent = _a.onDidPresent, onWillDismiss = _a.onWillDismiss, onWillPresent = _a.onWillPresent, cProps = __rest(_a, ["children", "isOpen", "onDidDismiss", "onDidPresent", "onWillDismiss", "onWillPresent"]);
160
- elementProps = __assign(__assign({}, cProps), (_c = { ref: this.props.forwardedRef }, _c[didDismissEventName] = this.handleDismiss, _c[didPresentEventName] = function (e) { return _this.props.onDidPresent && _this.props.onDidPresent(e); }, _c[willDismissEventName] = function (e) { return _this.props.onWillDismiss && _this.props.onWillDismiss(e); }, _c[willPresentEventName] = function (e) { return _this.props.onWillPresent && _this.props.onWillPresent(e); }, _c));
161
- _b = this;
162
- return [4 /*yield*/, controller.create(__assign(__assign({}, elementProps), { component: this.el, componentProps: {} }))];
163
- case 1:
164
- _b.overlay = _d.sent();
165
- setRef(this.props.forwardedRef, this.overlay);
166
- attachProps(this.overlay, elementProps, prevProps);
167
- return [4 /*yield*/, this.overlay.present()];
168
- case 2:
169
- _d.sent();
170
- return [2 /*return*/];
171
- }
172
- });
173
- });
174
- };
175
- Overlay.prototype.render = function () {
176
- /**
177
- * Continue to render the component even when
178
- * overlay is dismissing otherwise component
179
- * will be hidden before animation is done.
180
- */
181
- return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
182
- };
183
- return Overlay;
184
- }(React.Component));
185
- return React.forwardRef(function (props, ref) {
186
- return React.createElement(Overlay, __assign({}, props, { forwardedRef: ref }));
187
- });
188
- };
189
- //# sourceMappingURL=createOverlayComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createOverlayComponent.js","sourceRoot":"","sources":["../../src/react-component-lib/createOverlayComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAGjC,OAAO,EAA4B,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAgB/G,MAAM,CAAC,IAAM,sBAAsB,GAAG,UACpC,OAAe,EACf,UAA8D,EAC9D,aAAmB;IAEnB,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAE5C,IAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,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CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export { createReactComponent } from './createComponent';
2
- export { createOverlayComponent } from './createOverlayComponent';
@@ -1,3 +0,0 @@
1
- export { createReactComponent } from './createComponent';
2
- export { createOverlayComponent } from './createOverlayComponent';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react-component-lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}