@ui5/webcomponents-base 2.5.0 → 2.6.0-rc.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.
- package/CHANGELOG.md +20 -0
- package/cypress/specs/Boot.cy.ts +1 -5
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/ManagedStyles.d.ts +4 -6
- package/dist/ManagedStyles.js +6 -16
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/UI5Element.d.ts +27 -13
- package/dist/UI5Element.js +16 -2
- package/dist/UI5Element.js.map +1 -1
- package/dist/asset-registries/Themes.d.ts +3 -6
- package/dist/asset-registries/Themes.js +1 -2
- package/dist/asset-registries/Themes.js.map +1 -1
- package/dist/custom-elements-internal.json +69 -165
- package/dist/custom-elements.json +69 -66
- package/dist/decorators/bound.d.ts +1 -0
- package/dist/decorators/bound.js +34 -0
- package/dist/decorators/bound.js.map +1 -0
- package/dist/decorators.d.ts +3 -1
- package/dist/decorators.js +3 -1
- package/dist/decorators.js.map +1 -1
- package/dist/features/OpenUI5Enablement.d.ts +1 -1
- package/dist/generated/VersionInfo.js +4 -4
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/css/BusyIndicator.css.d.ts +2 -3
- package/dist/generated/css/BusyIndicator.css.js +1 -6
- package/dist/generated/css/BusyIndicator.css.js.map +1 -1
- package/dist/generated/css/FontFace.css.d.ts +2 -3
- package/dist/generated/css/FontFace.css.js +1 -6
- package/dist/generated/css/FontFace.css.js.map +1 -1
- package/dist/generated/css/OverrideFontFace.css.d.ts +2 -3
- package/dist/generated/css/OverrideFontFace.css.js +1 -6
- package/dist/generated/css/OverrideFontFace.css.js.map +1 -1
- package/dist/generated/css/SystemCSSVars.css.d.ts +2 -3
- package/dist/generated/css/SystemCSSVars.css.js +1 -6
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/jsx-dev-runtime.d.ts +4 -0
- package/dist/jsx-dev-runtime.js +43 -0
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.d.ts +50 -0
- package/dist/jsx-runtime.js +27 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-utils.d.ts +3 -0
- package/dist/jsx-utils.js +40 -0
- package/dist/jsx-utils.js.map +1 -0
- package/dist/prod/ManagedStyles.js +1 -1
- package/dist/prod/ManagedStyles.js.map +3 -3
- package/dist/prod/UI5Element.js +1 -1
- package/dist/prod/UI5Element.js.map +3 -3
- package/dist/prod/asset-registries/Themes.js +1 -1
- package/dist/prod/asset-registries/Themes.js.map +2 -2
- package/dist/prod/decorators/bound.js +2 -0
- package/dist/prod/decorators/bound.js.map +7 -0
- package/dist/prod/decorators.js +1 -1
- package/dist/prod/decorators.js.map +3 -3
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +2 -2
- package/dist/prod/generated/css/BusyIndicator.css.js +1 -1
- package/dist/prod/generated/css/BusyIndicator.css.js.map +3 -3
- package/dist/prod/generated/css/FontFace.css.js +1 -1
- package/dist/prod/generated/css/FontFace.css.js.map +3 -3
- package/dist/prod/generated/css/OverrideFontFace.css.js +1 -1
- package/dist/prod/generated/css/OverrideFontFace.css.js.map +3 -3
- package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js.map +3 -3
- package/dist/prod/index.d.js +2 -0
- package/dist/prod/index.d.js.map +7 -0
- package/dist/prod/jsx-dev-runtime.js +2 -0
- package/dist/prod/jsx-dev-runtime.js.map +7 -0
- package/dist/prod/jsx-runtime.js +2 -0
- package/dist/prod/jsx-runtime.js.map +7 -0
- package/dist/prod/jsx-utils.js +2 -0
- package/dist/prod/jsx-utils.js.map +7 -0
- package/dist/prod/renderer/JsxRenderer.js +2 -0
- package/dist/prod/renderer/JsxRenderer.js.map +7 -0
- package/dist/prod/renderer/LitRenderer.js +1 -1
- package/dist/prod/renderer/LitRenderer.js.map +3 -3
- package/dist/prod/renderer/executeTemplate.js +1 -1
- package/dist/prod/renderer/executeTemplate.js.map +3 -3
- package/dist/prod/theming/getStylesString.js +1 -1
- package/dist/prod/theming/getStylesString.js.map +2 -2
- package/dist/prod/thirdparty/preact/jsx.d.js +2 -0
- package/dist/prod/thirdparty/preact/jsx.d.js.map +7 -0
- package/dist/prod/thirdparty/preact/jsxRuntime.module.d.js +2 -0
- package/dist/prod/thirdparty/preact/jsxRuntime.module.d.js.map +7 -0
- package/dist/prod/thirdparty/preact/jsxRuntime.module.js +2 -0
- package/dist/prod/thirdparty/preact/preact.module.d.js +2 -0
- package/dist/prod/thirdparty/preact/preact.module.d.js.map +7 -0
- package/dist/prod/thirdparty/preact/preact.module.js +2 -0
- package/dist/prod/updateShadowRoot.js +1 -1
- package/dist/prod/updateShadowRoot.js.map +3 -3
- package/dist/prod/util/StringHelper.js +1 -1
- package/dist/prod/util/StringHelper.js.map +3 -3
- package/dist/prod/util/dragAndDrop/DragRegistry.js +1 -1
- package/dist/prod/util/dragAndDrop/DragRegistry.js.map +2 -2
- package/dist/prod/util/dragAndDrop/handleDragOver.js +2 -0
- package/dist/prod/util/dragAndDrop/handleDragOver.js.map +7 -0
- package/dist/prod/util/dragAndDrop/handleDrop.js +2 -0
- package/dist/prod/util/dragAndDrop/handleDrop.js.map +7 -0
- package/dist/prod/util/hash2str.js +2 -0
- package/dist/prod/util/hash2str.js.map +7 -0
- package/dist/prod/util/toLowercaseEnumValue.js +2 -0
- package/dist/prod/util/toLowercaseEnumValue.js.map +7 -0
- package/dist/renderer/JsxRenderer.d.ts +3 -0
- package/dist/renderer/JsxRenderer.js +16 -0
- package/dist/renderer/JsxRenderer.js.map +1 -0
- package/dist/renderer/LitRenderer.js +4 -3
- package/dist/renderer/LitRenderer.js.map +1 -1
- package/dist/renderer/executeTemplate.d.ts +3 -12
- package/dist/renderer/executeTemplate.js +1 -20
- package/dist/renderer/executeTemplate.js.map +1 -1
- package/dist/theming/getStylesString.js +2 -4
- package/dist/theming/getStylesString.js.map +1 -1
- package/dist/thirdparty/preact/jsx.d.ts +2616 -0
- package/dist/thirdparty/preact/jsxRuntime.module.d.ts +62 -0
- package/dist/thirdparty/preact/jsxRuntime.module.js +2 -0
- package/dist/thirdparty/preact/preact.module.d.ts +398 -0
- package/dist/thirdparty/preact/preact.module.js +2 -0
- package/dist/types.d.ts +23 -25
- package/dist/types.js.map +1 -1
- package/dist/updateShadowRoot.js +1 -2
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/StringHelper.d.ts +2 -1
- package/dist/util/StringHelper.js +4 -1
- package/dist/util/StringHelper.js.map +1 -1
- package/dist/util/dragAndDrop/DragRegistry.d.ts +22 -1
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
- package/dist/util/dragAndDrop/handleDragOver.d.ts +16 -0
- package/dist/util/dragAndDrop/handleDragOver.js +42 -0
- package/dist/util/dragAndDrop/handleDragOver.js.map +1 -0
- package/dist/util/dragAndDrop/handleDrop.d.ts +5 -0
- package/dist/util/dragAndDrop/handleDrop.js +22 -0
- package/dist/util/dragAndDrop/handleDrop.js.map +1 -0
- package/dist/util/getClassCopy.d.ts +6 -0
- package/dist/util/hash2str.d.ts +1 -0
- package/dist/util/hash2str.js +14 -0
- package/dist/util/hash2str.js.map +1 -0
- package/dist/util/toLowercaseEnumValue.d.ts +3 -0
- package/dist/util/toLowercaseEnumValue.js +4 -0
- package/dist/util/toLowercaseEnumValue.js.map +1 -0
- package/index.js +0 -6
- package/package-scripts.cjs +1 -1
- package/package.json +10 -5
- package/src/thirdparty/preact/jsxRuntime.module.js +2 -0
- package/src/thirdparty/preact/preact.module.js +2 -0
- package/src/thirdparty/preact/version.txt +1 -0
- package/dist/prod/types/AriaHasPopup.js +0 -2
- package/dist/prod/types/AriaHasPopup.js.map +0 -7
- package/dist/prod/types/AriaLandmarkRole.js +0 -2
- package/dist/prod/types/AriaLandmarkRole.js.map +0 -7
- package/dist/prod/types/AriaRole.js +0 -2
- package/dist/prod/types/AriaRole.js.map +0 -7
- package/dist/prod/util/getParentElement.js +0 -2
- package/dist/prod/util/getParentElement.js.map +0 -7
- package/dist/prod/util/isElementContainingBlock.js +0 -2
- package/dist/prod/util/isElementContainingBlock.js.map +0 -7
- package/dist/types/AriaHasPopup.d.ts +0 -32
- package/dist/types/AriaHasPopup.js +0 -34
- package/dist/types/AriaHasPopup.js.map +0 -1
- package/dist/types/AriaLandmarkRole.d.ts +0 -79
- package/dist/types/AriaLandmarkRole.js +0 -81
- package/dist/types/AriaLandmarkRole.js.map +0 -1
- package/dist/types/AriaRole.d.ts +0 -27
- package/dist/types/AriaRole.js +0 -29
- package/dist/types/AriaRole.js.map +0 -1
- package/dist/util/getParentElement.d.ts +0 -2
- package/dist/util/getParentElement.js +0 -5
- package/dist/util/getParentElement.js.map +0 -1
- package/dist/util/isElementContainingBlock.d.ts +0 -2
- package/dist/util/isElementContainingBlock.js +0 -11
- package/dist/util/isElementContainingBlock.js.map +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Intentionally not using a relative path to take advantage of
|
|
2
|
+
// the TS version resolution mechanism
|
|
3
|
+
export { Fragment } from './preact.module.d.ts';
|
|
4
|
+
import {
|
|
5
|
+
ComponentType,
|
|
6
|
+
ComponentChild,
|
|
7
|
+
ComponentChildren,
|
|
8
|
+
VNode,
|
|
9
|
+
Attributes
|
|
10
|
+
} from './preact.module.d.ts';
|
|
11
|
+
import { JSXInternal } from './jsx.d.ts';
|
|
12
|
+
|
|
13
|
+
export function jsx(
|
|
14
|
+
type: string,
|
|
15
|
+
props: JSXInternal.HTMLAttributes &
|
|
16
|
+
JSXInternal.SVGAttributes &
|
|
17
|
+
Record<string, any> & { children?: ComponentChild },
|
|
18
|
+
key?: string
|
|
19
|
+
): VNode<any>;
|
|
20
|
+
export function jsx<P>(
|
|
21
|
+
type: ComponentType<P>,
|
|
22
|
+
props: Attributes & P & { children?: ComponentChild },
|
|
23
|
+
key?: string
|
|
24
|
+
): VNode<any>;
|
|
25
|
+
|
|
26
|
+
export function jsxs(
|
|
27
|
+
type: string,
|
|
28
|
+
props: JSXInternal.HTMLAttributes &
|
|
29
|
+
JSXInternal.SVGAttributes &
|
|
30
|
+
Record<string, any> & { children?: ComponentChild[] },
|
|
31
|
+
key?: string
|
|
32
|
+
): VNode<any>;
|
|
33
|
+
export function jsxs<P>(
|
|
34
|
+
type: ComponentType<P>,
|
|
35
|
+
props: Attributes & P & { children?: ComponentChild[] },
|
|
36
|
+
key?: string
|
|
37
|
+
): VNode<any>;
|
|
38
|
+
|
|
39
|
+
export function jsxDEV(
|
|
40
|
+
type: string,
|
|
41
|
+
props: JSXInternal.HTMLAttributes &
|
|
42
|
+
JSXInternal.SVGAttributes &
|
|
43
|
+
Record<string, any> & { children?: ComponentChildren },
|
|
44
|
+
key?: string
|
|
45
|
+
): VNode<any>;
|
|
46
|
+
export function jsxDEV<P>(
|
|
47
|
+
type: ComponentType<P>,
|
|
48
|
+
props: Attributes & P & { children?: ComponentChildren },
|
|
49
|
+
key?: string
|
|
50
|
+
): VNode<any>;
|
|
51
|
+
|
|
52
|
+
// These are not expected to be used manually, but by a JSX transform
|
|
53
|
+
export function jsxTemplate(
|
|
54
|
+
template: string[],
|
|
55
|
+
...expressions: any[]
|
|
56
|
+
): VNode<any>;
|
|
57
|
+
export function jsxAttr(name: string, value: any): string | null;
|
|
58
|
+
export function jsxEscape<T>(
|
|
59
|
+
value: T
|
|
60
|
+
): string | null | VNode<any> | Array<string | null | VNode>;
|
|
61
|
+
|
|
62
|
+
export { JSXInternal as JSX };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{options as r,Fragment as e}from"./preact.module.js";export{Fragment}from"./preact.module.js";var t=/["&<]/;function n(r){if(0===r.length||!1===t.test(r))return r;for(var e=0,n=0,o="",f="";n<r.length;n++){switch(r.charCodeAt(n)){case 34:f=""";break;case 38:f="&";break;case 60:f="<";break;default:continue}n!==e&&(o+=r.slice(e,n)),o+=f,e=n+1}return n!==e&&(o+=r.slice(e,n)),o}var o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=0,i=Array.isArray;function u(e,t,n,o,i,u){t||(t={});var a,c,l=t;"ref"in t&&(a=t.ref,delete t.ref);var p={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--f,__i:-1,__u:0,__source:i,__self:u};if("function"==typeof e&&(a=e.defaultProps))for(c in a)void 0===l[c]&&(l[c]=a[c]);return r.vnode&&r.vnode(p),p}function a(r){var t=u(e,{tpl:r,exprs:[].slice.call(arguments,1)});return t.key=t.__v,t}var c={},l=/[A-Z]/g;function p(e,t){if(r.attr){var f=r.attr(e,t);if("string"==typeof f)return f}if("ref"===e||"key"===e)return"";if("style"===e&&"object"==typeof t){var i="";for(var u in t){var a=t[u];if(null!=a&&""!==a){var p="-"==u[0]?u:c[u]||(c[u]=u.replace(l,"-$&").toLowerCase()),s=";";"number"!=typeof a||p.startsWith("--")||o.test(p)||(s="px;"),i=i+p+":"+a+s}}return e+'="'+i+'"'}return null==t||!1===t||"function"==typeof t||"object"==typeof t?"":!0===t?e:e+'="'+n(t)+'"'}function s(r){if(null==r||"boolean"==typeof r||"function"==typeof r)return null;if("object"==typeof r){if(void 0===r.constructor)return r;if(i(r)){for(var e=0;e<r.length;e++)r[e]=s(r[e]);return r}}return n(""+r)}export{u as jsx,p as jsxAttr,u as jsxDEV,s as jsxEscape,a as jsxTemplate,u as jsxs};
|
|
2
|
+
//# sourceMappingURL=jsxRuntime.module.js.map
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
export as namespace preact;
|
|
2
|
+
|
|
3
|
+
import { JSXInternal } from './jsx';
|
|
4
|
+
|
|
5
|
+
export import JSX = JSXInternal;
|
|
6
|
+
|
|
7
|
+
//
|
|
8
|
+
// Preact Virtual DOM
|
|
9
|
+
// -----------------------------------
|
|
10
|
+
|
|
11
|
+
export interface VNode<P = {}> {
|
|
12
|
+
type: ComponentType<P> | string;
|
|
13
|
+
props: P & { children: ComponentChildren };
|
|
14
|
+
key: Key;
|
|
15
|
+
/**
|
|
16
|
+
* ref is not guaranteed by React.ReactElement, for compatibility reasons
|
|
17
|
+
* with popular react libs we define it as optional too
|
|
18
|
+
*/
|
|
19
|
+
ref?: Ref<any> | null;
|
|
20
|
+
/**
|
|
21
|
+
* The time this `vnode` started rendering. Will only be set when
|
|
22
|
+
* the devtools are attached.
|
|
23
|
+
* Default value: `0`
|
|
24
|
+
*/
|
|
25
|
+
startTime?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The time that the rendering of this `vnode` was completed. Will only be
|
|
28
|
+
* set when the devtools are attached.
|
|
29
|
+
* Default value: `-1`
|
|
30
|
+
*/
|
|
31
|
+
endTime?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//
|
|
35
|
+
// Preact Component interface
|
|
36
|
+
// -----------------------------------
|
|
37
|
+
|
|
38
|
+
export type Key = string | number | any;
|
|
39
|
+
|
|
40
|
+
export type RefObject<T> = { current: T | null };
|
|
41
|
+
export type RefCallback<T> = (instance: T | null) => void;
|
|
42
|
+
export type Ref<T> = RefObject<T> | RefCallback<T> | null;
|
|
43
|
+
|
|
44
|
+
export type ComponentChild =
|
|
45
|
+
| VNode<any>
|
|
46
|
+
| object
|
|
47
|
+
| string
|
|
48
|
+
| number
|
|
49
|
+
| bigint
|
|
50
|
+
| boolean
|
|
51
|
+
| null
|
|
52
|
+
| undefined;
|
|
53
|
+
export type ComponentChildren = ComponentChild[] | ComponentChild;
|
|
54
|
+
|
|
55
|
+
export interface Attributes {
|
|
56
|
+
key?: Key | undefined;
|
|
57
|
+
jsx?: boolean | undefined;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ClassAttributes<T> extends Attributes {
|
|
61
|
+
ref?: Ref<T>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface PreactDOMAttributes {
|
|
65
|
+
children?: ComponentChildren;
|
|
66
|
+
dangerouslySetInnerHTML?: {
|
|
67
|
+
__html: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface ErrorInfo {
|
|
72
|
+
componentStack?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type RenderableProps<P, RefType = any> = P &
|
|
76
|
+
Readonly<Attributes & { children?: ComponentChildren; ref?: Ref<RefType> }>;
|
|
77
|
+
|
|
78
|
+
export type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;
|
|
79
|
+
export type ComponentFactory<P = {}> = ComponentType<P>;
|
|
80
|
+
|
|
81
|
+
export type ComponentProps<
|
|
82
|
+
C extends ComponentType<any> | keyof JSXInternal.IntrinsicElements
|
|
83
|
+
> = C extends ComponentType<infer P>
|
|
84
|
+
? P
|
|
85
|
+
: C extends keyof JSXInternal.IntrinsicElements
|
|
86
|
+
? JSXInternal.IntrinsicElements[C]
|
|
87
|
+
: never;
|
|
88
|
+
|
|
89
|
+
export interface FunctionComponent<P = {}> {
|
|
90
|
+
(props: RenderableProps<P>, context?: any): ComponentChildren;
|
|
91
|
+
displayName?: string;
|
|
92
|
+
defaultProps?: Partial<P> | undefined;
|
|
93
|
+
}
|
|
94
|
+
export interface FunctionalComponent<P = {}> extends FunctionComponent<P> {}
|
|
95
|
+
|
|
96
|
+
export interface ComponentClass<P = {}, S = {}> {
|
|
97
|
+
new (props: P, context?: any): Component<P, S>;
|
|
98
|
+
displayName?: string;
|
|
99
|
+
defaultProps?: Partial<P>;
|
|
100
|
+
contextType?: Context<any>;
|
|
101
|
+
getDerivedStateFromProps?(
|
|
102
|
+
props: Readonly<P>,
|
|
103
|
+
state: Readonly<S>
|
|
104
|
+
): Partial<S> | null;
|
|
105
|
+
getDerivedStateFromError?(error: any): Partial<S> | null;
|
|
106
|
+
}
|
|
107
|
+
export interface ComponentConstructor<P = {}, S = {}>
|
|
108
|
+
extends ComponentClass<P, S> {}
|
|
109
|
+
|
|
110
|
+
// Type alias for a component instance considered generally, whether stateless or stateful.
|
|
111
|
+
export type AnyComponent<P = {}, S = {}> =
|
|
112
|
+
| FunctionComponent<P>
|
|
113
|
+
| ComponentConstructor<P, S>;
|
|
114
|
+
|
|
115
|
+
export interface Component<P = {}, S = {}> {
|
|
116
|
+
componentWillMount?(): void;
|
|
117
|
+
componentDidMount?(): void;
|
|
118
|
+
componentWillUnmount?(): void;
|
|
119
|
+
getChildContext?(): object;
|
|
120
|
+
componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
|
|
121
|
+
shouldComponentUpdate?(
|
|
122
|
+
nextProps: Readonly<P>,
|
|
123
|
+
nextState: Readonly<S>,
|
|
124
|
+
nextContext: any
|
|
125
|
+
): boolean;
|
|
126
|
+
componentWillUpdate?(
|
|
127
|
+
nextProps: Readonly<P>,
|
|
128
|
+
nextState: Readonly<S>,
|
|
129
|
+
nextContext: any
|
|
130
|
+
): void;
|
|
131
|
+
getSnapshotBeforeUpdate?(oldProps: Readonly<P>, oldState: Readonly<S>): any;
|
|
132
|
+
componentDidUpdate?(
|
|
133
|
+
previousProps: Readonly<P>,
|
|
134
|
+
previousState: Readonly<S>,
|
|
135
|
+
snapshot: any
|
|
136
|
+
): void;
|
|
137
|
+
componentDidCatch?(error: any, errorInfo: ErrorInfo): void;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export abstract class Component<P, S> {
|
|
141
|
+
constructor(props?: P, context?: any);
|
|
142
|
+
|
|
143
|
+
static displayName?: string;
|
|
144
|
+
static defaultProps?: any;
|
|
145
|
+
static contextType?: Context<any>;
|
|
146
|
+
|
|
147
|
+
// Static members cannot reference class type parameters. This is not
|
|
148
|
+
// supported in TypeScript. Reusing the same type arguments from `Component`
|
|
149
|
+
// will lead to an impossible state where one cannot satisfy the type
|
|
150
|
+
// constraint under no circumstances, see #1356.In general type arguments
|
|
151
|
+
// seem to be a bit buggy and not supported well at the time of this
|
|
152
|
+
// writing with TS 3.3.3333.
|
|
153
|
+
static getDerivedStateFromProps?(
|
|
154
|
+
props: Readonly<object>,
|
|
155
|
+
state: Readonly<object>
|
|
156
|
+
): object | null;
|
|
157
|
+
static getDerivedStateFromError?(error: any): object | null;
|
|
158
|
+
|
|
159
|
+
state: Readonly<S>;
|
|
160
|
+
props: RenderableProps<P>;
|
|
161
|
+
context: any;
|
|
162
|
+
base?: Element | Text;
|
|
163
|
+
|
|
164
|
+
// From https://github.com/DefinitelyTyped/DefinitelyTyped/blob/e836acc75a78cf0655b5dfdbe81d69fdd4d8a252/types/react/index.d.ts#L402
|
|
165
|
+
// // We MUST keep setState() as a unified signature because it allows proper checking of the method return type.
|
|
166
|
+
// // See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257
|
|
167
|
+
setState<K extends keyof S>(
|
|
168
|
+
state:
|
|
169
|
+
| ((
|
|
170
|
+
prevState: Readonly<S>,
|
|
171
|
+
props: Readonly<P>
|
|
172
|
+
) => Pick<S, K> | Partial<S> | null)
|
|
173
|
+
| (Pick<S, K> | Partial<S> | null),
|
|
174
|
+
callback?: () => void
|
|
175
|
+
): void;
|
|
176
|
+
|
|
177
|
+
forceUpdate(callback?: () => void): void;
|
|
178
|
+
|
|
179
|
+
abstract render(
|
|
180
|
+
props?: RenderableProps<P>,
|
|
181
|
+
state?: Readonly<S>,
|
|
182
|
+
context?: any
|
|
183
|
+
): ComponentChildren;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
//
|
|
187
|
+
// Preact createElement
|
|
188
|
+
// -----------------------------------
|
|
189
|
+
|
|
190
|
+
export function createElement(
|
|
191
|
+
type: 'input',
|
|
192
|
+
props:
|
|
193
|
+
| (JSXInternal.DOMAttributes<HTMLInputElement> &
|
|
194
|
+
ClassAttributes<HTMLInputElement>)
|
|
195
|
+
| null,
|
|
196
|
+
...children: ComponentChildren[]
|
|
197
|
+
): VNode<
|
|
198
|
+
JSXInternal.DOMAttributes<HTMLInputElement> &
|
|
199
|
+
ClassAttributes<HTMLInputElement>
|
|
200
|
+
>;
|
|
201
|
+
export function createElement<
|
|
202
|
+
P extends JSXInternal.HTMLAttributes<T>,
|
|
203
|
+
T extends HTMLElement
|
|
204
|
+
>(
|
|
205
|
+
type: keyof JSXInternal.IntrinsicElements,
|
|
206
|
+
props: (ClassAttributes<T> & P) | null,
|
|
207
|
+
...children: ComponentChildren[]
|
|
208
|
+
): VNode<ClassAttributes<T> & P>;
|
|
209
|
+
export function createElement<
|
|
210
|
+
P extends JSXInternal.SVGAttributes<T>,
|
|
211
|
+
T extends HTMLElement
|
|
212
|
+
>(
|
|
213
|
+
type: keyof JSXInternal.IntrinsicSVGElements,
|
|
214
|
+
props: (ClassAttributes<T> & P) | null,
|
|
215
|
+
...children: ComponentChildren[]
|
|
216
|
+
): VNode<ClassAttributes<T> & P>;
|
|
217
|
+
export function createElement<T extends HTMLElement>(
|
|
218
|
+
type: string,
|
|
219
|
+
props:
|
|
220
|
+
| (ClassAttributes<T> &
|
|
221
|
+
JSXInternal.HTMLAttributes &
|
|
222
|
+
JSXInternal.SVGAttributes)
|
|
223
|
+
| null,
|
|
224
|
+
...children: ComponentChildren[]
|
|
225
|
+
): VNode<
|
|
226
|
+
ClassAttributes<T> & JSXInternal.HTMLAttributes & JSXInternal.SVGAttributes
|
|
227
|
+
>;
|
|
228
|
+
export function createElement<P>(
|
|
229
|
+
type: ComponentType<P> | string,
|
|
230
|
+
props: (Attributes & P) | null,
|
|
231
|
+
...children: ComponentChildren[]
|
|
232
|
+
): VNode<P>;
|
|
233
|
+
export namespace createElement {
|
|
234
|
+
export import JSX = JSXInternal;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export function h(
|
|
238
|
+
type: 'input',
|
|
239
|
+
props:
|
|
240
|
+
| (JSXInternal.DOMAttributes<HTMLInputElement> &
|
|
241
|
+
ClassAttributes<HTMLInputElement>)
|
|
242
|
+
| null,
|
|
243
|
+
...children: ComponentChildren[]
|
|
244
|
+
): VNode<
|
|
245
|
+
JSXInternal.DOMAttributes<HTMLInputElement> &
|
|
246
|
+
ClassAttributes<HTMLInputElement>
|
|
247
|
+
>;
|
|
248
|
+
export function h<
|
|
249
|
+
P extends JSXInternal.HTMLAttributes<T>,
|
|
250
|
+
T extends HTMLElement
|
|
251
|
+
>(
|
|
252
|
+
type: keyof JSXInternal.IntrinsicElements,
|
|
253
|
+
props: (ClassAttributes<T> & P) | null,
|
|
254
|
+
...children: ComponentChildren[]
|
|
255
|
+
): VNode<ClassAttributes<T> & P>;
|
|
256
|
+
export function h<
|
|
257
|
+
P extends JSXInternal.SVGAttributes<T>,
|
|
258
|
+
T extends HTMLElement
|
|
259
|
+
>(
|
|
260
|
+
type: keyof JSXInternal.IntrinsicSVGElements,
|
|
261
|
+
props: (ClassAttributes<T> & P) | null,
|
|
262
|
+
...children: ComponentChildren[]
|
|
263
|
+
): VNode<ClassAttributes<T> & P>;
|
|
264
|
+
export function h<T extends HTMLElement>(
|
|
265
|
+
type: string,
|
|
266
|
+
props:
|
|
267
|
+
| (ClassAttributes<T> &
|
|
268
|
+
JSXInternal.HTMLAttributes &
|
|
269
|
+
JSXInternal.SVGAttributes)
|
|
270
|
+
| null,
|
|
271
|
+
...children: ComponentChildren[]
|
|
272
|
+
): VNode<
|
|
273
|
+
| (ClassAttributes<T> &
|
|
274
|
+
JSXInternal.HTMLAttributes &
|
|
275
|
+
JSXInternal.SVGAttributes)
|
|
276
|
+
| null
|
|
277
|
+
>;
|
|
278
|
+
export function h<P>(
|
|
279
|
+
type: ComponentType<P> | string,
|
|
280
|
+
props: (Attributes & P) | null,
|
|
281
|
+
...children: ComponentChildren[]
|
|
282
|
+
): VNode<Attributes & P>;
|
|
283
|
+
export namespace h {
|
|
284
|
+
export import JSX = JSXInternal;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
//
|
|
288
|
+
// Preact render
|
|
289
|
+
// -----------------------------------
|
|
290
|
+
interface ContainerNode {
|
|
291
|
+
readonly nodeType: number;
|
|
292
|
+
readonly parentNode: ContainerNode | null;
|
|
293
|
+
readonly firstChild: ContainerNode | null;
|
|
294
|
+
readonly childNodes: ArrayLike<ContainerNode>;
|
|
295
|
+
|
|
296
|
+
contains(other: ContainerNode | null): boolean;
|
|
297
|
+
insertBefore(node: ContainerNode, child: ContainerNode | null): ContainerNode;
|
|
298
|
+
appendChild(node: ContainerNode): ContainerNode;
|
|
299
|
+
removeChild(child: ContainerNode): ContainerNode;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export function render(vnode: ComponentChild, parent: ContainerNode): void;
|
|
303
|
+
/**
|
|
304
|
+
* @deprecated Will be removed in v11.
|
|
305
|
+
*
|
|
306
|
+
* Replacement Preact 10+ implementation can be found here: https://gist.github.com/developit/f4c67a2ede71dc2fab7f357f39cff28c
|
|
307
|
+
*/
|
|
308
|
+
export function render(
|
|
309
|
+
vnode: ComponentChild,
|
|
310
|
+
parent: ContainerNode,
|
|
311
|
+
replaceNode?: Element | Text
|
|
312
|
+
): void;
|
|
313
|
+
export function hydrate(vnode: ComponentChild, parent: ContainerNode): void;
|
|
314
|
+
export function cloneElement(
|
|
315
|
+
vnode: VNode<any>,
|
|
316
|
+
props?: any,
|
|
317
|
+
...children: ComponentChildren[]
|
|
318
|
+
): VNode<any>;
|
|
319
|
+
export function cloneElement<P>(
|
|
320
|
+
vnode: VNode<P>,
|
|
321
|
+
props?: any,
|
|
322
|
+
...children: ComponentChildren[]
|
|
323
|
+
): VNode<P>;
|
|
324
|
+
|
|
325
|
+
//
|
|
326
|
+
// Preact Built-in Components
|
|
327
|
+
// -----------------------------------
|
|
328
|
+
|
|
329
|
+
// TODO: Revisit what the public type of this is...
|
|
330
|
+
export let Fragment: FunctionComponent<{}>;
|
|
331
|
+
|
|
332
|
+
//
|
|
333
|
+
// Preact options
|
|
334
|
+
// -----------------------------------
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Global options for preact
|
|
338
|
+
*/
|
|
339
|
+
export interface Options {
|
|
340
|
+
/** Attach a hook that is invoked whenever a VNode is created. */
|
|
341
|
+
vnode?(vnode: VNode): void;
|
|
342
|
+
/** Attach a hook that is invoked immediately before a vnode is unmounted. */
|
|
343
|
+
unmount?(vnode: VNode): void;
|
|
344
|
+
/** Attach a hook that is invoked after a vnode has rendered. */
|
|
345
|
+
diffed?(vnode: VNode): void;
|
|
346
|
+
event?(e: Event): any;
|
|
347
|
+
requestAnimationFrame?(callback: () => void): void;
|
|
348
|
+
debounceRendering?(cb: () => void): void;
|
|
349
|
+
useDebugValue?(value: string | number): void;
|
|
350
|
+
_addHookName?(name: string | number): void;
|
|
351
|
+
__suspenseDidResolve?(vnode: VNode, cb: () => void): void;
|
|
352
|
+
// __canSuspenseResolve?(vnode: VNode, cb: () => void): void;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Customize attribute serialization when a precompiled JSX transform
|
|
356
|
+
* is used.
|
|
357
|
+
*/
|
|
358
|
+
attr?(name: string, value: any): string | void;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export let options: Options;
|
|
362
|
+
|
|
363
|
+
//
|
|
364
|
+
// Preact helpers
|
|
365
|
+
// -----------------------------------
|
|
366
|
+
export function createRef<T = any>(): RefObject<T>;
|
|
367
|
+
export function toChildArray(
|
|
368
|
+
children: ComponentChildren
|
|
369
|
+
): Array<VNode | string | number>;
|
|
370
|
+
export function isValidElement(vnode: any): vnode is VNode;
|
|
371
|
+
|
|
372
|
+
//
|
|
373
|
+
// Context
|
|
374
|
+
// -----------------------------------
|
|
375
|
+
export interface Consumer<T>
|
|
376
|
+
extends FunctionComponent<{
|
|
377
|
+
children: (value: T) => ComponentChildren;
|
|
378
|
+
}> {}
|
|
379
|
+
export interface PreactConsumer<T> extends Consumer<T> {}
|
|
380
|
+
|
|
381
|
+
export interface Provider<T>
|
|
382
|
+
extends FunctionComponent<{
|
|
383
|
+
value: T;
|
|
384
|
+
children?: ComponentChildren;
|
|
385
|
+
}> {}
|
|
386
|
+
export interface PreactProvider<T> extends Provider<T> {}
|
|
387
|
+
export type ContextType<C extends Context<any>> = C extends Context<infer T>
|
|
388
|
+
? T
|
|
389
|
+
: never;
|
|
390
|
+
|
|
391
|
+
export interface Context<T> {
|
|
392
|
+
Consumer: Consumer<T>;
|
|
393
|
+
Provider: Provider<T>;
|
|
394
|
+
displayName?: string;
|
|
395
|
+
}
|
|
396
|
+
export interface PreactContext<T> extends Context<T> {}
|
|
397
|
+
|
|
398
|
+
export function createContext<T>(defaultValue: T): Context<T>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var n,l,u,t,i,o,r,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var u in l)n[u]=l[u];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function g(l,u,t){var i,o,r,e={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=u[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===e[r]&&(e[r]=l.defaultProps[r]);return m(l,e,i,o,null)}function m(n,t,i,o,r){var e={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?C(n):null}function S(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return S(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,u,t,o,r,f,c,s;for(i.sort(e);n=i.shift();)n.__d&&(u=i.length,o=void 0,f=(r=(t=n).__v).__e,c=[],s=[],t.__P&&((o=w({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),F(t.__P,o,r,t.__n,t.__P.namespaceURI,32&r.__u?[f]:null,c,null==f?C(r):f,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,z(c,o,s),o.__e!=f&&S(o)),i.length>u&&i.sort(e));P.__r=0}function $(n,l,u,t,i,o,r,e,f,c,s){var a,h,y,d,w,_,g=t&&t.__k||v,m=l.length;for(f=I(u,l,g,f),a=0;a<m;a++)null!=(y=u.__k[a])&&(h=-1===y.__i?p:g[y.__i]||p,y.__i=a,_=F(n,y,h,i,o,r,e,f,c,s),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&V(h.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),4&y.__u||h.__k===y.__k?f=H(y,f,n):"function"==typeof y.type&&void 0!==_?f=_:d&&(f=d.nextSibling),y.__u&=-7);return u.__e=w,f}function I(n,l,u,t){var i,o,r,e,f,c=l.length,s=u.length,a=s,h=0;for(n.__k=[],i=0;i<c;i++)null!=(o=l[i])&&"boolean"!=typeof o&&"function"!=typeof o?(e=i+h,(o=n.__k[i]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(k,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,r=null,-1!==(f=o.__i=O(o,u,e,a))&&(a--,(r=u[f])&&(r.__u|=2)),null==r||null===r.__v?(-1==f&&h--,"function"!=typeof o.type&&(o.__u|=4)):f!==e&&(f==e-1?h--:f==e+1?h++:(f>e?h--:h++,o.__u|=4))):o=n.__k[i]=null;if(a)for(i=0;i<s;i++)null!=(r=u[i])&&0==(2&r.__u)&&(r.__e==t&&(t=C(r)),q(r,r));return t}function H(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=H(t[i],l,u));return l}n.__e!=l&&(l&&n.type&&!u.contains(l)&&(l=C(n)),u.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8===l.nodeType);return l}function L(n,l){return l=l||[],null==n||"boolean"==typeof n||(d(n)?n.some(function(n){L(n,l)}):l.push(n)),l}function O(n,l,u,t){var i=n.key,o=n.type,r=u-1,e=u+1,f=l[u];if(null===f||f&&i==f.key&&o===f.type&&0==(2&f.__u))return u;if(("function"!=typeof o||o===k||i)&&t>(null!=f&&0==(2&f.__u)?1:0))for(;r>=0||e<l.length;){if(r>=0){if((f=l[r])&&0==(2&f.__u)&&i==f.key&&o===f.type)return r;r--}if(e<l.length){if((f=l[e])&&0==(2&f.__u)&&i==f.key&&o===f.type)return e;e++}}return-1}function T(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px"}function j(n,l,u,t,i){var o,r;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||T(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(f,"$1")),l=l.toLowerCase()in n||"onFocusOut"===l||"onFocusIn"===l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=c,n.addEventListener(l,o?a:s,o)):n.removeEventListener(l,o?a:s,o);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{r=n.tagName&&n.tagName.includes("-"),u!==t&&(n[l]=null!=u||r?u:"");break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u))}}function A(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function F(n,u,t,i,o,r,e,f,c,s){var a,h,p,v,y,g,m,b,C,S,M,P,I,H,L,O,T,j=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),r=[f=u.__e=t.__e]),(a=l.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,C="prototype"in j&&j.prototype.render,S=(a=j.contextType)&&i[a.__c],M=a?S?S.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(C?u.__c=h=new j(b,M):(u.__c=h=new x(b,M),h.constructor=j,h.render=B),S&&S.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),C&&null==h.__s&&(h.__s=h.state),C&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)C&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),C&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(C&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v===t.__v)){for(u.__v!==t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),C&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,g)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,I=l.__r,H=0,C){for(h.state=h.__s,h.__d=!1,I&&I(u),a=h.render(h.props,h.state,h.context),L=0;L<h._sb.length;L++)h.__h.push(h._sb[L]);h._sb=[]}else do{h.__d=!1,I&&I(u),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++H<25);h.state=h.__s,null!=h.getChildContext&&(i=w(w({},i),h.getChildContext())),C&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(v,y)),f=$(n,d(O=null!=a&&a.type===k&&null==a.key?a.props.children:a)?O:[O],u,t,i,o,r,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(u.__v=null,c||null!=r)if(n.then){for(u.__u|=c?160:128;f&&8===f.nodeType&&f.nextSibling;)f=f.nextSibling;r[r.indexOf(f)]=null,u.__e=f}else for(T=r.length;T--;)_(r[T]);else u.__e=t.__e,u.__k=t.__k;l.__e(n,u,t)}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=N(t.__e,u,t,i,o,r,e,c,s);return(a=l.diffed)&&a(u),128&u.__u?void 0:f}function z(n,u,t){for(var i=0;i<t.length;i++)V(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function N(u,t,i,o,r,e,f,c,s){var a,h,v,y,w,g,m,b,k=i.props,x=t.props,S=t.type;if("svg"===S?r="http://www.w3.org/2000/svg":"math"===S?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((w=e[a])&&"setAttribute"in w==!!S&&(S?w.localName===S:3===w.nodeType)){u=w,e[a]=null;break}if(null==u){if(null===S)return document.createTextNode(x);u=document.createElementNS(r,S,x.is&&x),c&&(l.__m&&l.__m(t,e),c=!1),e=null}if(null===S)k===x||c&&u.data===x||(u.data=x);else{if(e=e&&n.call(u.childNodes),k=i.props||p,!c&&null!=e)for(k={},a=0;a<u.attributes.length;a++)k[(w=u.attributes[a]).name]=w.value;for(a in k)if(w=k[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=w;else if(!(a in x)){if("value"==a&&"defaultValue"in x||"checked"==a&&"defaultChecked"in x)continue;j(u,a,null,w,r)}for(a in x)w=x[a],"children"==a?y=w:"dangerouslySetInnerHTML"==a?h=w:"value"==a?g=w:"checked"==a?m=w:c&&"function"!=typeof w||k[a]===w||(a.startsWith("on")&&(b=o[Object.keys(o)[0]].props.value,w=w.bind(b)),j(u,a,w,k[a],r));if(h)c||v&&(h.__html===v.__html||h.__html===u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),$(u,d(y)?y:[y],t,i,o,"foreignObject"===S?"http://www.w3.org/1999/xhtml":r,e,f,e?e[0]:i.__k&&C(i,0),c,s),null!=e)for(a=e.length;a--;)_(e[a]);c||(a="value","progress"===S&&null==g?u.removeAttribute("value"):void 0!==g&&(g!==u[a]||"progress"===S&&!g||"option"===S&&g!==k[a])&&j(u,a,g,k[a],r),a="checked",void 0!==m&&m!==u[a]&&j(u,a,m,k[a],r))}return u}function V(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u))}else n.current=u}catch(n){l.__e(n,t)}}function q(n,u,t){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||V(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&q(i[o],u,t||"function"!=typeof n.type);t||_(n.__e),n.__c=n.__=n.__e=void 0}function B(n,l,u){return this.constructor(n,u)}function D(u,t,i){var o,r,e,f;t===document&&(t=document.documentElement),l.__&&l.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,e=[],f=[],F(t,u=(!o&&i||t).__k=g(k,null,[u]),r||p,p,t.namespaceURI,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,e,!o&&i?i:r?r.__e:t.firstChild,o,f),z(e,u,f)}function E(n,l){D(n,l,E)}function G(l,u,t){var i,o,r,e,f=w({},l.props);for(r in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=void 0===u[r]&&void 0!==e?e[r]:u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,o||l.ref,null)}function J(n,l){var u={__c:l="__cC"+h++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},u),this.props)),n&&w(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=A(!1),a=A(!0),h=0;export{x as Component,k as Fragment,G as cloneElement,J as createContext,g as createElement,b as createRef,g as h,E as hydrate,t as isValidElement,l as options,D as render,L as toChildArray};
|
|
2
|
+
//# sourceMappingURL=preact.module.js.map
|
package/dist/types.d.ts
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
type PromiseResolve = (value: void | PromiseLike<void>) => void;
|
|
4
|
-
type Timeout = ReturnType<typeof setTimeout>;
|
|
5
|
-
type Interval = ReturnType<typeof setInterval>;
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
type StyleData = StyleDataCSP | string;
|
|
12
|
-
type ComponentStylesData = Array<ComponentStylesData> | Array<StyleData> | StyleData;
|
|
13
|
-
type ClassMapValue = Record<string, boolean>;
|
|
14
|
-
type ClassMap = {
|
|
1
|
+
import type { JSX } from "./jsx-runtime.d.ts";
|
|
2
|
+
export type LowercaseString<T> = T extends string ? Lowercase<T> : never;
|
|
3
|
+
export type PromiseResolve = (value: void | PromiseLike<void>) => void;
|
|
4
|
+
export type Timeout = ReturnType<typeof setTimeout>;
|
|
5
|
+
export type Interval = ReturnType<typeof setInterval>;
|
|
6
|
+
export type StyleData = string;
|
|
7
|
+
export type ComponentStylesData = Array<ComponentStylesData> | string;
|
|
8
|
+
export type ClassMapValue = Record<string, boolean>;
|
|
9
|
+
export type ClassMap = {
|
|
15
10
|
[x: string]: ClassMapValue | ClassMap;
|
|
16
11
|
};
|
|
17
|
-
type PassiveEventListenerObject = EventListenerObject & {
|
|
12
|
+
export type PassiveEventListenerObject = EventListenerObject & {
|
|
18
13
|
passive: boolean;
|
|
19
14
|
};
|
|
20
|
-
type
|
|
21
|
-
type
|
|
22
|
-
type
|
|
23
|
-
type
|
|
24
|
-
|
|
15
|
+
export type AriaRole = JSX.AriaRole;
|
|
16
|
+
export type AriaHasPopup = "dialog" | "grid" | "listbox" | "menu" | "tree";
|
|
17
|
+
export type AriaCurrent = "page" | "step" | "location" | "date" | "time" | "true" | "false" | boolean | undefined;
|
|
18
|
+
export type AriaAutoComplete = "list" | "none" | "inline" | "both" | undefined;
|
|
19
|
+
export type AriaLandmarkRole = "none" | "banner" | "main" | "region" | "navigation" | "search" | "complementary" | "form" | "contentinfo";
|
|
20
|
+
export type AccessibilityInfo = {
|
|
21
|
+
role?: AriaRole;
|
|
25
22
|
type?: LowercaseString<string>;
|
|
26
23
|
description?: string;
|
|
27
24
|
disabled?: boolean;
|
|
@@ -29,15 +26,16 @@ type AccessibilityInfo = {
|
|
|
29
26
|
required?: boolean;
|
|
30
27
|
children?: Array<HTMLElement>;
|
|
31
28
|
};
|
|
32
|
-
type AccessibilityAttributes = {
|
|
29
|
+
export type AccessibilityAttributes = {
|
|
33
30
|
ariaSetsize?: number;
|
|
34
31
|
ariaPosinset?: number;
|
|
32
|
+
ariaLabel?: string;
|
|
35
33
|
controls?: LowercaseString<string>;
|
|
36
34
|
expanded?: "true" | "false" | boolean;
|
|
37
|
-
hasPopup?:
|
|
35
|
+
hasPopup?: AriaHasPopup;
|
|
38
36
|
name?: string;
|
|
39
|
-
role?:
|
|
37
|
+
role?: AriaRole;
|
|
40
38
|
ariaKeyShortcuts?: string;
|
|
41
|
-
|
|
39
|
+
ariaCurrent?: AriaCurrent;
|
|
40
|
+
current?: AriaCurrent;
|
|
42
41
|
};
|
|
43
|
-
export type { AccessibilityInfo, AccessibilityAttributes, PromiseResolve, Timeout, Interval, StyleData, StyleDataCSP, ComponentStylesData, ClassMap, ClassMapValue, PassiveEventListenerObject, };
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSX } from \"./jsx-runtime.d.ts\";\n\n// General utils\nexport type LowercaseString<T> = T extends string ? Lowercase<T> : never;\n\n// Core Framework types\nexport type PromiseResolve = (value: void | PromiseLike<void>) => void;\nexport type Timeout = ReturnType<typeof setTimeout>;\nexport type Interval = ReturnType<typeof setInterval>;\n\nexport type StyleData = string;\n\nexport type ComponentStylesData = Array<ComponentStylesData> | string;\nexport type ClassMapValue = Record<string, boolean>\n\nexport type ClassMap = { [x: string] : ClassMapValue | ClassMap };\n\nexport type PassiveEventListenerObject = EventListenerObject & { passive: boolean };\n\n// Accessibility\nexport type AriaRole = JSX.AriaRole;\nexport type AriaHasPopup = \"dialog\" | \"grid\" | \"listbox\" | \"menu\" | \"tree\";\nexport type AriaCurrent = \"page\" | \"step\" | \"location\" | \"date\" | \"time\" | \"true\" | \"false\" | boolean | undefined;\nexport type AriaAutoComplete = \"list\" | \"none\" | \"inline\" | \"both\" | undefined;\nexport type AriaLandmarkRole = \"none\" | \"banner\" | \"main\" | \"region\" | \"navigation\" | \"search\" | \"complementary\" | \"form\" | \"contentinfo\"\n\nexport type AccessibilityInfo = {\n\t// The WAI-ARIA role of the component.\n\trole?: AriaRole,\n\n\t// A translated text that represents the component type. Used when several components share same role,\n\t// f.e. Select and ComboBox both have role=\"combobox\".\n\ttype?: LowercaseString<string>,\n\n\t// A translated text that represents relevant component description/state - value, placeholder, label, etc.\n\tdescription?: string,\n\n\t // The component disabled state.\n\tdisabled?: boolean,\n\n\t// The component readonly state.\n\treadonly?: boolean,\n\n\t// The component required state.\n\trequired?: boolean,\n\n\t// An array of elements, aggregated by the component\n\t// <b>Note:</b> Children should only be provided when it is helpful to understand the accessibility context.\n\tchildren?: Array<HTMLElement>,\n}\n\nexport type AccessibilityAttributes = {\n\tariaSetsize?: number,\n\tariaPosinset?: number,\n\tariaLabel?: string,\n\tcontrols?: LowercaseString<string>\n\texpanded?: \"true\" | \"false\" | boolean,\n\thasPopup?: AriaHasPopup,\n\tname?: string,\n\trole?: AriaRole,\n\tariaKeyShortcuts?: string,\n\tariaCurrent?: AriaCurrent,\n\tcurrent?: AriaCurrent,\n}\n"]}
|
package/dist/updateShadowRoot.js
CHANGED
|
@@ -6,13 +6,12 @@ import getConstructableStyle from "./theming/getConstructableStyle.js";
|
|
|
6
6
|
const updateShadowRoot = (element) => {
|
|
7
7
|
const ctor = element.constructor;
|
|
8
8
|
const shadowRoot = element.shadowRoot;
|
|
9
|
-
const renderResult = element.render(); // this is checked before calling updateShadowRoot
|
|
10
9
|
if (!shadowRoot) {
|
|
11
10
|
console.warn(`There is no shadow root to update`); // eslint-disable-line
|
|
12
11
|
return;
|
|
13
12
|
}
|
|
14
13
|
shadowRoot.adoptedStyleSheets = getConstructableStyle(ctor);
|
|
15
|
-
ctor.renderer(
|
|
14
|
+
ctor.renderer(element, shadowRoot);
|
|
16
15
|
};
|
|
17
16
|
export default updateShadowRoot;
|
|
18
17
|
//# sourceMappingURL=updateShadowRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateShadowRoot.js","sourceRoot":"","sources":["../src/updateShadowRoot.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AAGvE;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,OAAmB,EAAE,EAAE;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAgC,CAAC;IACtD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"updateShadowRoot.js","sourceRoot":"","sources":["../src/updateShadowRoot.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AAGvE;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,OAAmB,EAAE,EAAE;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAgC,CAAC;IACtD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAEtC,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC,sBAAsB;QACzE,OAAO;IACR,CAAC;IAED,UAAU,CAAC,kBAAkB,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import getConstructableStyle from \"./theming/getConstructableStyle.js\";\nimport type UI5Element from \"./UI5Element.js\";\n\n/**\n * Updates the shadow root of a UI5Element or its static area item\n * @param element\n */\nconst updateShadowRoot = (element: UI5Element) => {\n\tconst ctor = element.constructor as typeof UI5Element;\n\tconst shadowRoot = element.shadowRoot;\n\n\tif (!shadowRoot) {\n\t\tconsole.warn(`There is no shadow root to update`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tshadowRoot.adoptedStyleSheets = getConstructableStyle(ctor);\n\tctor.renderer(element, shadowRoot);\n};\n\nexport default updateShadowRoot;\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const kebabToCamelCase: (string: string) => string;
|
|
2
2
|
declare const camelToKebabCase: (string: string) => string;
|
|
3
|
+
declare const pascalToKebabCase: (pascalString: string) => string;
|
|
3
4
|
declare const kebabToPascalCase: (src: string) => string;
|
|
4
|
-
export { kebabToCamelCase, camelToKebabCase, kebabToPascalCase };
|
|
5
|
+
export { kebabToCamelCase, camelToKebabCase, pascalToKebabCase, kebabToPascalCase, };
|
|
@@ -15,6 +15,9 @@ const camelToKebabCase = (string) => {
|
|
|
15
15
|
}
|
|
16
16
|
return camelToKebabMap.get(string);
|
|
17
17
|
};
|
|
18
|
+
const pascalToKebabCase = (pascalString) => {
|
|
19
|
+
return camelToKebabCase(pascalString);
|
|
20
|
+
};
|
|
18
21
|
const toCamelCase = (parts) => {
|
|
19
22
|
return parts.map((string, index) => {
|
|
20
23
|
return index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
|
@@ -30,5 +33,5 @@ const kebabToPascalCase = (src) => {
|
|
|
30
33
|
kebabToPascalMap.set(src, result);
|
|
31
34
|
return result;
|
|
32
35
|
};
|
|
33
|
-
export { kebabToCamelCase, camelToKebabCase, kebabToPascalCase };
|
|
36
|
+
export { kebabToCamelCase, camelToKebabCase, pascalToKebabCase, kebabToPascalCase, };
|
|
34
37
|
//# sourceMappingURL=StringHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringHelper.js","sourceRoot":"","sources":["../../src/util/StringHelper.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;AAClD,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;AAClD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEnD,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC3C,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9C,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,eAAe,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC3C,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QACxE,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,eAAe,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,KAAoB,EAAE,EAAE;IAC5C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAClC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5G,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAAE,EAAE;IACzC,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,UAAU,EAAE,CAAC;QAChB,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpE,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,OAAO,
|
|
1
|
+
{"version":3,"file":"StringHelper.js","sourceRoot":"","sources":["../../src/util/StringHelper.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;AAClD,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;AAClD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEnD,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC3C,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9C,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,eAAe,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC3C,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QACxE,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,eAAe,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,YAAoB,EAAE,EAAE;IAClD,OAAO,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,KAAoB,EAAE,EAAE;IAC5C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAClC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5G,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAAE,EAAE;IACzC,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,UAAU,EAAE,CAAC;QAChB,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpE,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,GACjB,CAAC","sourcesContent":["const kebabToCamelMap = new Map<string, string>();\nconst camelToKebabMap = new Map<string, string>();\nconst kebabToPascalMap = new Map<string, string>();\n\nconst kebabToCamelCase = (string: string) => {\n\tif (!kebabToCamelMap.has(string)) {\n\t\tconst result = toCamelCase(string.split(\"-\"));\n\t\tkebabToCamelMap.set(string, result);\n\t}\n\treturn kebabToCamelMap.get(string)!;\n};\n\nconst camelToKebabCase = (string: string) => {\n\tif (!camelToKebabMap.has(string)) {\n\t\tconst result = string.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n\t\tcamelToKebabMap.set(string, result);\n\t}\n\treturn camelToKebabMap.get(string)!;\n};\n\nconst pascalToKebabCase = (pascalString: string) => {\n\treturn camelToKebabCase(pascalString);\n};\n\nconst toCamelCase = (parts: Array<string>) => {\n\treturn parts.map((string, index) => {\n\t\treturn index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n\t}).join(\"\");\n};\n\nconst kebabToPascalCase = (src: string) => {\n\tconst cachedName = kebabToPascalMap.get(src);\n\tif (cachedName) {\n\t\treturn cachedName;\n\t}\n\n\tconst camelStr = kebabToCamelCase(src);\n\tconst result = camelStr.charAt(0).toUpperCase() + camelStr.slice(1);\n\tkebabToPascalMap.set(src, result);\n\treturn result;\n};\n\nexport {\n\tkebabToCamelCase,\n\tcamelToKebabCase,\n\tpascalToKebabCase,\n\tkebabToPascalCase,\n};\n"]}
|