@ui5/webcomponents-base 2.27.0 → 2.27.1-rc.0
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 +13 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/UI5Element.js +10 -2
- package/dist/UI5Element.js.map +1 -1
- package/dist/config/Language.js +7 -6
- package/dist/config/Language.js.map +1 -1
- package/dist/custom-elements-internal.json +45 -45
- package/dist/custom-elements.json +45 -45
- package/dist/decorators/customElement.d.ts +1 -0
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/decorators/i18n.d.ts +3 -1
- package/dist/decorators/i18n.js +4 -1
- package/dist/decorators/i18n.js.map +1 -1
- package/dist/generated/VersionInfo.js +4 -4
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/prod/UI5Element.js +1 -1
- package/dist/prod/UI5Element.js.map +2 -2
- package/dist/prod/config/Language.js +1 -1
- package/dist/prod/config/Language.js.map +2 -2
- package/dist/prod/decorators/customElement.js.map +2 -2
- package/dist/prod/decorators/i18n.js +1 -1
- package/dist/prod/decorators/i18n.js.map +2 -2
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +2 -2
- package/package.json +3 -3
|
@@ -1826,6 +1826,51 @@
|
|
|
1826
1826
|
}
|
|
1827
1827
|
]
|
|
1828
1828
|
},
|
|
1829
|
+
{
|
|
1830
|
+
"kind": "javascript-module",
|
|
1831
|
+
"path": "dist/thirdparty/_merge.js",
|
|
1832
|
+
"declarations": [],
|
|
1833
|
+
"exports": [
|
|
1834
|
+
{
|
|
1835
|
+
"kind": "js",
|
|
1836
|
+
"name": "default",
|
|
1837
|
+
"declaration": {
|
|
1838
|
+
"name": "fnMerge",
|
|
1839
|
+
"module": "dist/thirdparty/_merge.js"
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
]
|
|
1843
|
+
},
|
|
1844
|
+
{
|
|
1845
|
+
"kind": "javascript-module",
|
|
1846
|
+
"path": "dist/thirdparty/isPlainObject.js",
|
|
1847
|
+
"declarations": [],
|
|
1848
|
+
"exports": [
|
|
1849
|
+
{
|
|
1850
|
+
"kind": "js",
|
|
1851
|
+
"name": "default",
|
|
1852
|
+
"declaration": {
|
|
1853
|
+
"name": "fnIsPlainObject",
|
|
1854
|
+
"module": "dist/thirdparty/isPlainObject.js"
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
]
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
"kind": "javascript-module",
|
|
1861
|
+
"path": "dist/thirdparty/merge.js",
|
|
1862
|
+
"declarations": [],
|
|
1863
|
+
"exports": [
|
|
1864
|
+
{
|
|
1865
|
+
"kind": "js",
|
|
1866
|
+
"name": "default",
|
|
1867
|
+
"declaration": {
|
|
1868
|
+
"name": "fnMerge",
|
|
1869
|
+
"module": "dist/thirdparty/merge.js"
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
]
|
|
1873
|
+
},
|
|
1829
1874
|
{
|
|
1830
1875
|
"kind": "javascript-module",
|
|
1831
1876
|
"path": "dist/theming/CustomStyle.js",
|
|
@@ -1925,51 +1970,6 @@
|
|
|
1925
1970
|
}
|
|
1926
1971
|
]
|
|
1927
1972
|
},
|
|
1928
|
-
{
|
|
1929
|
-
"kind": "javascript-module",
|
|
1930
|
-
"path": "dist/thirdparty/_merge.js",
|
|
1931
|
-
"declarations": [],
|
|
1932
|
-
"exports": [
|
|
1933
|
-
{
|
|
1934
|
-
"kind": "js",
|
|
1935
|
-
"name": "default",
|
|
1936
|
-
"declaration": {
|
|
1937
|
-
"name": "fnMerge",
|
|
1938
|
-
"module": "dist/thirdparty/_merge.js"
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
]
|
|
1942
|
-
},
|
|
1943
|
-
{
|
|
1944
|
-
"kind": "javascript-module",
|
|
1945
|
-
"path": "dist/thirdparty/isPlainObject.js",
|
|
1946
|
-
"declarations": [],
|
|
1947
|
-
"exports": [
|
|
1948
|
-
{
|
|
1949
|
-
"kind": "js",
|
|
1950
|
-
"name": "default",
|
|
1951
|
-
"declaration": {
|
|
1952
|
-
"name": "fnIsPlainObject",
|
|
1953
|
-
"module": "dist/thirdparty/isPlainObject.js"
|
|
1954
|
-
}
|
|
1955
|
-
}
|
|
1956
|
-
]
|
|
1957
|
-
},
|
|
1958
|
-
{
|
|
1959
|
-
"kind": "javascript-module",
|
|
1960
|
-
"path": "dist/thirdparty/merge.js",
|
|
1961
|
-
"declarations": [],
|
|
1962
|
-
"exports": [
|
|
1963
|
-
{
|
|
1964
|
-
"kind": "js",
|
|
1965
|
-
"name": "default",
|
|
1966
|
-
"declaration": {
|
|
1967
|
-
"name": "fnMerge",
|
|
1968
|
-
"module": "dist/thirdparty/merge.js"
|
|
1969
|
-
}
|
|
1970
|
-
}
|
|
1971
|
-
]
|
|
1972
|
-
},
|
|
1973
1973
|
{
|
|
1974
1974
|
"kind": "javascript-module",
|
|
1975
1975
|
"path": "dist/types/AnimationMode.js",
|
|
@@ -1800,6 +1800,51 @@
|
|
|
1800
1800
|
}
|
|
1801
1801
|
]
|
|
1802
1802
|
},
|
|
1803
|
+
{
|
|
1804
|
+
"kind": "javascript-module",
|
|
1805
|
+
"path": "dist/thirdparty/_merge.js",
|
|
1806
|
+
"declarations": [],
|
|
1807
|
+
"exports": [
|
|
1808
|
+
{
|
|
1809
|
+
"kind": "js",
|
|
1810
|
+
"name": "default",
|
|
1811
|
+
"declaration": {
|
|
1812
|
+
"name": "fnMerge",
|
|
1813
|
+
"module": "dist/thirdparty/_merge.js"
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
]
|
|
1817
|
+
},
|
|
1818
|
+
{
|
|
1819
|
+
"kind": "javascript-module",
|
|
1820
|
+
"path": "dist/thirdparty/isPlainObject.js",
|
|
1821
|
+
"declarations": [],
|
|
1822
|
+
"exports": [
|
|
1823
|
+
{
|
|
1824
|
+
"kind": "js",
|
|
1825
|
+
"name": "default",
|
|
1826
|
+
"declaration": {
|
|
1827
|
+
"name": "fnIsPlainObject",
|
|
1828
|
+
"module": "dist/thirdparty/isPlainObject.js"
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
]
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
"kind": "javascript-module",
|
|
1835
|
+
"path": "dist/thirdparty/merge.js",
|
|
1836
|
+
"declarations": [],
|
|
1837
|
+
"exports": [
|
|
1838
|
+
{
|
|
1839
|
+
"kind": "js",
|
|
1840
|
+
"name": "default",
|
|
1841
|
+
"declaration": {
|
|
1842
|
+
"name": "fnMerge",
|
|
1843
|
+
"module": "dist/thirdparty/merge.js"
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
]
|
|
1847
|
+
},
|
|
1803
1848
|
{
|
|
1804
1849
|
"kind": "javascript-module",
|
|
1805
1850
|
"path": "dist/theming/CustomStyle.js",
|
|
@@ -1899,51 +1944,6 @@
|
|
|
1899
1944
|
}
|
|
1900
1945
|
]
|
|
1901
1946
|
},
|
|
1902
|
-
{
|
|
1903
|
-
"kind": "javascript-module",
|
|
1904
|
-
"path": "dist/thirdparty/_merge.js",
|
|
1905
|
-
"declarations": [],
|
|
1906
|
-
"exports": [
|
|
1907
|
-
{
|
|
1908
|
-
"kind": "js",
|
|
1909
|
-
"name": "default",
|
|
1910
|
-
"declaration": {
|
|
1911
|
-
"name": "fnMerge",
|
|
1912
|
-
"module": "dist/thirdparty/_merge.js"
|
|
1913
|
-
}
|
|
1914
|
-
}
|
|
1915
|
-
]
|
|
1916
|
-
},
|
|
1917
|
-
{
|
|
1918
|
-
"kind": "javascript-module",
|
|
1919
|
-
"path": "dist/thirdparty/isPlainObject.js",
|
|
1920
|
-
"declarations": [],
|
|
1921
|
-
"exports": [
|
|
1922
|
-
{
|
|
1923
|
-
"kind": "js",
|
|
1924
|
-
"name": "default",
|
|
1925
|
-
"declaration": {
|
|
1926
|
-
"name": "fnIsPlainObject",
|
|
1927
|
-
"module": "dist/thirdparty/isPlainObject.js"
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
]
|
|
1931
|
-
},
|
|
1932
|
-
{
|
|
1933
|
-
"kind": "javascript-module",
|
|
1934
|
-
"path": "dist/thirdparty/merge.js",
|
|
1935
|
-
"declarations": [],
|
|
1936
|
-
"exports": [
|
|
1937
|
-
{
|
|
1938
|
-
"kind": "js",
|
|
1939
|
-
"name": "default",
|
|
1940
|
-
"declaration": {
|
|
1941
|
-
"name": "fnMerge",
|
|
1942
|
-
"module": "dist/thirdparty/merge.js"
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
1945
|
-
]
|
|
1946
|
-
},
|
|
1947
1947
|
{
|
|
1948
1948
|
"kind": "javascript-module",
|
|
1949
1949
|
"path": "dist/types/AnimationMode.js",
|
|
@@ -32,6 +32,7 @@ declare const customElement: (tagNameOrComponentSettings?: string | {
|
|
|
32
32
|
dependencies?: Array<typeof UI5Element>;
|
|
33
33
|
/**
|
|
34
34
|
* Whether the custom element should be re-rendered when the language changes.
|
|
35
|
+
* @deprecated automatically set for components that use i18n texts
|
|
35
36
|
*/
|
|
36
37
|
languageAware?: boolean;
|
|
37
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customElement.js","sourceRoot":"","sources":["../../src/decorators/customElement.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"customElement.js","sourceRoot":"","sources":["../../src/decorators/customElement.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,6BAoDnB,EAAE,EAAkB,EAAE;IACzB,OAAO,CAAC,MAAW,EAAE,EAAE;QACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC;YAC/D,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;QACtB,CAAC;QAED,IAAI,OAAO,0BAA0B,KAAK,QAAQ,EAAE,CAAC;YACpD,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,0BAA0B,CAAC;YACjD,OAAO;QACR,CAAC;QAED,MAAM,EACL,GAAG,EACH,aAAa,EACb,UAAU,EACV,IAAI,EACJ,cAAc,EACd,cAAc,EACd,iBAAiB,GAChB,GAAG,0BAA0B,CAAC;QAEhC,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC;QAC1B,IAAI,aAAa,EAAE,CAAC;YACnB,MAAM,CAAC,QAAQ,CAAC,aAAa,GAAG,aAAa,CAAC;QAC/C,CAAC;QACD,IAAI,IAAI,EAAE,CAAC;YACV,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;QAC7B,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YAChB,MAAM,CAAC,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC;QACzC,CAAC;QACD,IAAI,cAAc,EAAE,CAAC;YACpB,MAAM,CAAC,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC;QACjD,CAAC;QACD,IAAI,cAAc,EAAE,CAAC;YACpB,MAAM,CAAC,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC;QACjD,CAAC;QAED,IAAI,iBAAiB,EAAE,CAAC;YACvB,MAAM,CAAC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QACvD,CAAC;QAED,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,mBAA2B,EAAE,EAAE;YAC1F,MAAM,wBAAwB,GAAG,0BAA0B,CAAC,mBAAuC,CAAC,CAAC;YAErG,wBAAwB,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAmB,EAAE;gBAC9E,GAAG,EAAE,GAAG,EAAE,CAAC,0BAA0B,CAAC,mBAAuC,CAAC;aAC9E,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport type { Renderer } from \"../UI5Element.js\";\nimport type { TemplateFunction as Template } from \"../renderer/executeTemplate.js\";\nimport type { ComponentStylesData as Styles } from \"../types.js\";\n\n/**\n * Returns a custom element class decorator.\n *\n * @param { string | object } tagNameOrComponentSettings\n * @returns { ClassDecorator }\n */\nconst customElement = (tagNameOrComponentSettings: string | {\n\t/**\n\t * The tag name of the custom element (will be suffixed if the scoping feature is used).\n\t */\n\ttag?: string,\n\t/**\n\t * The renderer of the custom element - officially supported are: jsxRenderer and litRender (deprecated).\n\t */\n\trenderer?: Renderer,\n\t/**\n\t * The styles to be injected into the shadow root of the custom element.\n\t */\n\tstyles?: Styles,\n\t/**\n\t * The template function of the custom element - must match the renderer.\n\t */\n\ttemplate?: Template,\n\t/**\n\t * Other custom elements used in the shadow root of the custom element.\n\t * @deprecated no longer necessary for jsxRenderer-enabled components\n\t */\n\tdependencies?: Array<typeof UI5Element>,\n\t/**\n\t * Whether the custom element should be re-rendered when the language changes.\n\t * @deprecated automatically set for components that use i18n texts\n\t */\n\tlanguageAware?: boolean,\n\t/**\n\t * Whether the custom element should be re-rendered when the theme changes.\n\t */\n\tthemeAware?: boolean,\n\t/**\n\t * Whether the custom element needs the CLDR assets.\n\t */\n\tcldr?: boolean,\n\t/**\n\t * Whether the custom element supports the F6 Fast navigation feature (is a fast-navigation group).\n\t */\n\tfastNavigation?: boolean,\n\t/**\n\t * Whether the custom element is form-associated and implements form-relevant features.\n\t */\n\tformAssociated?: boolean,\n\t/**\n\t * The shadow root options of the custom element.\n\t */\n\tshadowRootOptions?: Partial<ShadowRootInit>,\n\t/**\n\t * A list of all features, supported by the custom element.\n\t * @deprecated no longer necessary for jsxRenderer-enabled components\n\t */\n\tfeatures?: Array<string>,\n} = {}): ClassDecorator => {\n\treturn (target: any) => {\n\t\tif (!Object.prototype.hasOwnProperty.call(target, \"metadata\")) {\n\t\t\ttarget.metadata = {};\n\t\t}\n\n\t\tif (typeof tagNameOrComponentSettings === \"string\") {\n\t\t\ttarget.metadata.tag = tagNameOrComponentSettings;\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\ttag,\n\t\t\tlanguageAware,\n\t\t\tthemeAware,\n\t\t\tcldr,\n\t\t\tfastNavigation,\n\t\t\tformAssociated,\n\t\t\tshadowRootOptions,\n\t\t } = tagNameOrComponentSettings;\n\n\t\ttarget.metadata.tag = tag;\n\t\tif (languageAware) {\n\t\t\ttarget.metadata.languageAware = languageAware;\n\t\t}\n\t\tif (cldr) {\n\t\t\ttarget.metadata.cldr = cldr;\n\t\t}\n\n\t\tif (themeAware) {\n\t\t\ttarget.metadata.themeAware = themeAware;\n\t\t}\n\t\tif (fastNavigation) {\n\t\t\ttarget.metadata.fastNavigation = fastNavigation;\n\t\t}\n\t\tif (formAssociated) {\n\t\t\ttarget.metadata.formAssociated = formAssociated;\n\t\t}\n\n\t\tif (shadowRootOptions) {\n\t\t\ttarget.metadata.shadowRootOptions = shadowRootOptions;\n\t\t}\n\n\t\t[\"renderer\", \"template\", \"styles\", \"dependencies\"].forEach((customElementEntity: string) => {\n\t\t\tconst customElementEntityValue = tagNameOrComponentSettings[customElementEntity as keyof typeof tag];\n\n\t\t\tcustomElementEntityValue && Object.defineProperty(target, customElementEntity, {\n\t\t\t\tget: () => tagNameOrComponentSettings[customElementEntity as keyof typeof tag],\n\t\t\t});\n\t\t});\n\t};\n};\n\nexport default customElement;\n"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type UI5Element from "../UI5Element.js";
|
|
2
2
|
type i18nDecorator = (target: typeof UI5Element, propertyName: string) => void;
|
|
3
3
|
/**
|
|
4
|
-
* A decorator that converts a static class member into an accessor for the i18n bundle with a specified name
|
|
4
|
+
* A decorator that converts a static class member into an accessor for the i18n bundle with a specified name.
|
|
5
|
+
* It also automatically marks the component as language-aware, so it re-renders whenever the language changes
|
|
6
|
+
* and translated strings are always up-to-date — removing the need to set `languageAware: true` in `@customElement`.
|
|
5
7
|
*
|
|
6
8
|
* @param { string } bundleName name of the i18n bundle to load
|
|
7
9
|
* @returns { i18nDecorator }
|
package/dist/decorators/i18n.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A decorator that converts a static class member into an accessor for the i18n bundle with a specified name
|
|
2
|
+
* A decorator that converts a static class member into an accessor for the i18n bundle with a specified name.
|
|
3
|
+
* It also automatically marks the component as language-aware, so it re-renders whenever the language changes
|
|
4
|
+
* and translated strings are always up-to-date — removing the need to set `languageAware: true` in `@customElement`.
|
|
3
5
|
*
|
|
4
6
|
* @param { string } bundleName name of the i18n bundle to load
|
|
5
7
|
* @returns { i18nDecorator }
|
|
@@ -26,6 +28,7 @@ const i18n = (bundleName) => {
|
|
|
26
28
|
bundleName,
|
|
27
29
|
target,
|
|
28
30
|
};
|
|
31
|
+
target.metadata.languageAware = true;
|
|
29
32
|
};
|
|
30
33
|
};
|
|
31
34
|
export default i18n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/decorators/i18n.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/decorators/i18n.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,MAAM,IAAI,GAAG,CAAC,UAAkB,EAAiB,EAAE;IAClD,OAAO,CAAC,MAAyB,EAAE,YAAoB,EAAE,EAAE;QAC1D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC3B,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,EAAE,CAAC;QAC3B,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE;YAC3C,GAAG;gBACF,OAAO,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YACvC,CAAC;YACD,GAAG,KAAI,CAAC;SACR,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG;YACpC,UAAU;YACV,MAAM;SACN,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC;IACtC,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\n\ntype i18nDecorator = (target: typeof UI5Element, propertyName: string) => void;\n\n/**\n * A decorator that converts a static class member into an accessor for the i18n bundle with a specified name.\n * It also automatically marks the component as language-aware, so it re-renders whenever the language changes\n * and translated strings are always up-to-date — removing the need to set `languageAware: true` in `@customElement`.\n *\n * @param { string } bundleName name of the i18n bundle to load\n * @returns { i18nDecorator }\n *\n * ```ts\n * class MyComponnet extends UI5Element {\n * @i18n('@ui5/webcomponents')\n * i18nBundle: I18nBundle;\n * }\n * ```\n */\nconst i18n = (bundleName: string): i18nDecorator => {\n\treturn (target: typeof UI5Element, propertyName: string) => {\n\t\tif (!target.metadata.i18n) {\n\t\t\ttarget.metadata.i18n = {};\n\t\t}\n\n\t\tObject.defineProperty(target, propertyName, {\n\t\t\tget() {\n\t\t\t\treturn target.i18nBundles[bundleName];\n\t\t\t},\n\t\t\tset() {},\n\t\t});\n\n\t\ttarget.metadata.i18n[propertyName] = {\n\t\t\tbundleName,\n\t\t\ttarget,\n\t\t};\n\t\ttarget.metadata.languageAware = true;\n\t};\n};\n\nexport default i18n;\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const VersionInfo = {
|
|
2
|
-
version: "2.27.0",
|
|
2
|
+
version: "2.27.1-rc.0",
|
|
3
3
|
major: 2,
|
|
4
4
|
minor: 27,
|
|
5
|
-
patch:
|
|
6
|
-
suffix: "",
|
|
5
|
+
patch: 1,
|
|
6
|
+
suffix: "-rc.0",
|
|
7
7
|
isNext: false,
|
|
8
|
-
buildTime:
|
|
8
|
+
buildTime: 1790328643,
|
|
9
9
|
};
|
|
10
10
|
export default VersionInfo;
|
|
11
11
|
//# sourceMappingURL=VersionInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"VersionInfo.js","sourceRoot":"","sources":["../../src/generated/VersionInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAU;CACrB,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["const VersionInfo = {\n\tversion: \"2.27.1-rc.0\",\n\tmajor: 2,\n\tminor: 27,\n\tpatch: 1,\n\tsuffix: \"-rc.0\",\n\tisNext: false,\n\tbuildTime: 1790328643,\n};\nexport default VersionInfo;"]}
|
package/dist/prod/UI5Element.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import"@ui5/webcomponents-base/dist/ssr-dom.js";import N from"./thirdparty/merge.js";import{boot as x}from"./Boot.js";import V from"./UI5ElementMetadata.js";import b from"./EventProvider.js";import j from"./updateShadowRoot.js";import{shouldIgnoreCustomElement as H}from"./IgnoreCustomElements.js";import{renderDeferred as $,renderImmediately as z,cancelRender as B,unregisterElement as q,registerElement as K}from"./Render.js";import{registerTag as W,isTagRegistered as X,recordTagRegistrationFailure as J}from"./CustomElementsRegistry.js";import{observeDOMNode as Y,unobserveDOMNode as G}from"./DOMObserver.js";import{skipOriginalEvent as Q}from"./config/NoConflict.js";import Z from"./locale/getEffectiveDir.js";import{kebabToCamelCase as m,camelToKebabCase as tt,kebabToPascalCase as P}from"./util/StringHelper.js";import w from"./util/isValidPropertyName.js";import{getSlotName as T,getSlottedNodesList as D}from"./util/SlotsHelper.js";import et from"./util/arraysAreEqual.js";import{markAsRtlAware as nt}from"./locale/RTLAwareRegistry.js";import st from"./renderer/executeTemplate.js";import{shouldScopeCustomElement as A}from"./CustomElementsScopeUtils.js";import{updateFormValue as ot,setFormValue as R}from"./features/InputElementsFormSupport.js";import{getI18nBundle as at}from"./i18nBundle.js";import{fetchCldr as it}from"./asset-registries/LocaleData.js";import C from"./locale/getLocale.js";import{getLanguageChangePending as O}from"./config/Language.js";import rt from"./util/createInstanceChecker.js";let lt=0;const L=new Map,M=new Map,U={fromAttribute(c,f){if(f===Boolean)return c!==null;if(f===Number)return c===null?void 0:parseFloat(c);if(f===Object||f===Array)try{return JSON.parse(c)}catch{return c}return c},toAttribute(c,f){return f===Boolean?c?"":null:f===Object||f===Array||c==null?null:String(c)}};function g(c){this._suppressInvalidation||this.constructor.getMetadata().isLanguageAware()&&O()||(this.onInvalidation(c),this._changedState.push(c),$(this),this._invalidationEventProvider.fireEvent("invalidate",{...c,target:this}))}function dt(c,f){do{const t=Object.getOwnPropertyDescriptor(c,f);if(t)return t;c=Object.getPrototypeOf(c)}while(c&&c!==HTMLElement.prototype)}class S extends HTMLElement{constructor(){super();this.__shouldHydrate=!1;this._rendered=!1;const t=this.constructor;this._changedState=[],this._suppressInvalidation=!0,this._inDOM=!1,this._fullyConnected=!1,this._childChangeListeners=new Map,this._slotChangeListeners=new Map,this._invalidationEventProvider=new b,this._componentStateFinalizedEventProvider=new b;let e;this._domRefReadyPromise=new Promise(n=>{e=n}),this._domRefReadyPromise._deferredResolve=e,this._doNotSyncAttributes=new Set,this._slotsAssignedNodes=new WeakMap,this._state={...t.getMetadata().getInitialState()},this.initializedProperties=new Map,this.constructor.getMetadata().getPropertiesList().forEach(n=>{if(this.hasOwnProperty(n)){const o=this[n];this.initializedProperties.set(n,o)}}),this._internals=this.attachInternals(),this._initShadowRoot()}_initShadowRoot(){const t=this.constructor;if(t._needsShadowDOM()){const e={mode:"open"};this.shadowRoot?this.__shouldHydrate=!0:this.attachShadow({...e,...t.getMetadata().getShadowRootOptions()}),t.getMetadata().slotsAreManaged()&&this.shadowRoot.addEventListener("slotchange",this._onShadowRootSlotChange.bind(this))}}_onShadowRootSlotChange(t){t.target?.getRootNode()===this.shadowRoot&&this._processChildren()}get _id(){return this.__id||(this.__id=`ui5wc_${++lt}`),this.__id}render(){const t=this.constructor.template;return st(t,this)}async connectedCallback(){const t=this.constructor;K(this),this.setAttribute(t.getMetadata().getPureTag(),""),t.getMetadata().supportsF6FastNavigation()&&!this.hasAttribute("data-sap-ui-fastnavgroup")&&this.setAttribute("data-sap-ui-fastnavgroup","true");const e=t.getMetadata().slotsAreManaged();this._inDOM=!0,e&&(this._startObservingDOMChildren(),await this._processChildren()),t.asyncFinished||await t._definePromise;const s=O();t.getMetadata().isLanguageAware()&&s&&await s,this._inDOM&&(this._rendered||z(this),this._domRefReadyPromise._deferredResolve(),this._fullyConnected=!0,this.onEnterDOM(),this.hasAttribute("autofocus")&&requestAnimationFrame(()=>{this.focus()}))}get definePromise(){const t=this.constructor;return!t.asyncFinished&&t._definePromise?t._definePromise:Promise.resolve()}disconnectedCallback(){const e=this.constructor.getMetadata().slotsAreManaged();this._inDOM=!1,e&&this._stopObservingDOMChildren(),this._fullyConnected&&(this.onExitDOM(),this._fullyConnected=!1),this._domRefReadyPromise._deferredResolve(),B(this),q(this)}onBeforeRendering(){}onAfterRendering(){}onEnterDOM(){}onExitDOM(){}_startObservingDOMChildren(){const e=this.constructor.getMetadata();if(!e.hasSlots())return;const n=e.canSlotText(),o={childList:!0,subtree:n,characterData:n};Y(this,this._processChildren.bind(this),o)}_stopObservingDOMChildren(){G(this)}async _processChildren(){this.constructor.getMetadata().hasSlots()&&await this._updateSlots()}async _updateSlots(){const t=this.constructor,e=t.getMetadata().getSlots(),s=t.getMetadata().canSlotText(),n=Array.from(s?this.childNodes:this.children),o=new Map,a=new Map;for(const[l,h]of Object.entries(e)){const d=h.propertyName||l;a.set(d,l),o.set(d,[...this._state[d]]),this._clearSlot(l,h)}const r=new Map,i=new Map;n.forEach((l,h)=>{const d=T(l),p=e[d];if(p===void 0){if(d!=="default"){const I=Object.keys(e).join(", ");console.warn(`Unknown slotName: ${d}, ignoring`,l,`Valid values are: ${I}`)}return}const _=p.propertyName||d;i.has(_)?i.get(_).push({child:l,idx:h}):i.set(_,[{child:l,idx:h}])}),i.forEach((l,h)=>{this._state[h]=l.sort((d,p)=>d.idx-p.idx).map(d=>d.child),this._state[m(h)]=this._state[h]});const u=n.map(async l=>{const h=T(l),d=e[h];if(d!==void 0){if(d.individualSlots){const p=(r.get(h)||0)+1;r.set(h,p),l._individualSlot=`${h}-${p}`}if(l instanceof HTMLElement){const p=l.localName;if(p.includes("-")&&!H(p)){if(!customElements.get(p)){const k=customElements.whenDefined(p);let E=L.get(p);E||(E=new Promise(F=>setTimeout(F,1e3)),L.set(p,E)),await Promise.race([k,E])}customElements.upgrade(l)}}if(l=t.getMetadata().constructor.validateSlotValue(l,d),y(l)&&d.invalidateOnChildChange){const p=this._getChildChangeListener(h);l.attachInvalidate.call(l,p)}l instanceof HTMLSlotElement&&this._attachSlotChange(l,h,!!d.invalidateOnChildChange)}});await Promise.all(u);let v=!1;for(const[l,h]of Object.entries(e)){const d=h.propertyName||l;et(o.get(d),this._state[d])||(g.call(this,{type:"slot",name:a.get(d),reason:"children"}),v=!0,t.getMetadata().isFormAssociated()&&R(this))}v||g.call(this,{type:"slot",name:"default",reason:"textcontent"})}_clearSlot(t,e){const s=e.propertyName||t;this._state[s].forEach(o=>{if(y(o)){const a=this._getChildChangeListener(t);o.detachInvalidate.call(o,a)}o instanceof HTMLSlotElement&&this._detachSlotChange(o,t)}),this._state[s]=[],this._state[m(s)]=this._state[s]}attachInvalidate(t){this._invalidationEventProvider.attachEvent("invalidate",t)}detachInvalidate(t){this._invalidationEventProvider.detachEvent("invalidate",t)}_onChildChange(t,e){this.constructor.getMetadata().shouldInvalidateOnChildChange(t,e.type,e.name)&&g.call(this,{type:"slot",name:t,reason:"childchange",child:e.target})}attributeChangedCallback(t,e,s){let n;if(this._doNotSyncAttributes.has(t))return;const o=this.constructor.getMetadata().getProperties(),a=t.replace(/^ui5-/,""),r=m(a);if(o.hasOwnProperty(r)){const i=o[r];n=(i.converter??U).fromAttribute(s,i.type),this[r]=n}}formAssociatedCallback(){this.constructor.getMetadata().isFormAssociated()&&ot(this)}static get formAssociated(){return this.getMetadata().isFormAssociated()}_updateAttribute(t,e){const s=this.constructor;if(!s.getMetadata().hasAttribute(t))return;const o=s.getMetadata().getProperties()[t];if(o.type===Object||o.type===Array)return;const a=tt(t),i=(o.converter||U).toAttribute(e,o.type);this._doNotSyncAttributes.add(a),i==null?this.removeAttribute(a):this.setAttribute(a,i),this._doNotSyncAttributes.delete(a)}_getChildChangeListener(t){return this._childChangeListeners.has(t)||this._childChangeListeners.set(t,this._onChildChange.bind(this,t)),this._childChangeListeners.get(t)}_getSlotChangeListener(t){return this._slotChangeListeners.has(t)||this._slotChangeListeners.set(t,this._onSlotChange.bind(this,t)),this._slotChangeListeners.get(t)}_attachSlotChange(t,e,s){const n=this._getSlotChangeListener(e);t.addEventListener("slotchange",o=>{if(n.call(t,o),s){const a=this._slotsAssignedNodes.get(t);a&&a.forEach(i=>{if(y(i)){const u=this._getChildChangeListener(e);i.detachInvalidate.call(i,u)}});const r=D([t]);this._slotsAssignedNodes.set(t,r),r.forEach(i=>{if(y(i)){const u=this._getChildChangeListener(e);i.attachInvalidate.call(i,u)}})}})}_detachSlotChange(t,e){t.removeEventListener("slotchange",this._getSlotChangeListener(e))}_onSlotChange(t){g.call(this,{type:"slot",name:t,reason:"slotchange"})}onInvalidation(t){}updateAttributes(){const e=this.constructor.getMetadata().getProperties();for(const[s,n]of Object.entries(e))this._updateAttribute(s,this[s])}_render(){const t=this.constructor,e=t.getMetadata().hasIndividualSlots();this.initializedProperties.size>0&&(Array.from(this.initializedProperties.entries()).forEach(([s,n])=>{delete this[s],this[s]=n}),this.initializedProperties.clear()),this._suppressInvalidation=!0;try{this.onBeforeRendering(),this._rendered||this.updateAttributes(),this._componentStateFinalizedEventProvider.fireEvent("componentStateFinalized")}finally{this._suppressInvalidation=!1}this._changedState=[],t._needsShadowDOM()&&j(this),this._rendered=!0,e&&this._assignIndividualSlotsToChildren(),this.onAfterRendering()}_assignIndividualSlotsToChildren(){Array.from(this.children).forEach(e=>{e._individualSlot&&e.setAttribute("slot",e._individualSlot)})}_waitForDomRef(){return this._domRefReadyPromise}getDomRef(){if(typeof this._getRealDomRef=="function")return this._getRealDomRef();if(!(!this.shadowRoot||this.shadowRoot.children.length===0))return this.shadowRoot.children[0]}getFocusDomRef(){const t=this.getDomRef();if(t)return t.querySelector("[data-sap-focus-ref]")||t}async getFocusDomRefAsync(){return await this._waitForDomRef(),this.getFocusDomRef()}async focus(t){await this._waitForDomRef();const e=this.getFocusDomRef();e===this||!this.isConnected?HTMLElement.prototype.focus.call(this,t):e&&typeof e.focus=="function"&&e.focus(t)}fireEvent(t,e,s=!1,n=!0){const o=this._fireEvent(t,e,s,n),a=P(t);return a!==t?o&&this._fireEvent(a,e,s,n):o}fireDecoratorEvent(t,e){const s=this.getEventData(t),n=s?s.cancelable:!1,o=s?s.bubbles:!1,a=this._fireEvent(t,e,n,o),r=P(t);return r!==t?a&&this._fireEvent(r,e,n,o):a}_fireEvent(t,e,s=!1,n=!0){const o=new CustomEvent(`ui5-${t}`,{detail:e,composed:!1,bubbles:n,cancelable:s}),a=this.dispatchEvent(o);if(Q(t))return a;const r=new CustomEvent(t,{detail:e,composed:!1,bubbles:n,cancelable:s});return this.dispatchEvent(r)&&a}getEventData(t){return this.constructor.getMetadata().getEvents()[t]}getSlottedNodes(t){return D(this[t])}attachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.attachEvent("componentStateFinalized",t)}detachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.detachEvent("componentStateFinalized",t)}get effectiveDir(){return nt(this.constructor),Z(this)}get isUI5Element(){return!0}get isUI5AbstractElement(){return!this.constructor._needsShadowDOM()}get classes(){return{}}get accessibilityInfo(){}static get observedAttributes(){return this.getMetadata().getAttributesList()}static get tagsToScope(){const t=this.getMetadata().getPureTag(),e=this.getUniqueDependencies().map(s=>s.getMetadata().getPureTag()).filter(A);return A(t)&&e.push(t),e}static _needsShadowDOM(){return!!this.template||Object.prototype.hasOwnProperty.call(this.prototype,"render")}static _generateAccessors(){const t=this.prototype,e=this.getMetadata().slotsAreManaged(),s=this.getMetadata().getProperties();for(const[n,o]of Object.entries(s)){w(n)||console.warn(`"${n}" is not a valid property name. Use a name that does not collide with DOM APIs`);const a=dt(t,n);let r;a?.set&&(r=a.set);let i;a?.get&&(i=a.get),Object.defineProperty(t,n,{get(){return i?i.call(this):this._state[n]},set(u){const v=this.constructor,l=i?i.call(this):this._state[n];if(l!==u){if(r?r.call(this,u):this._state[n]=u,g.call(this,{type:"property",name:n,newValue:u,oldValue:l}),this._rendered){const d=i?i.call(this):this._state[n];this._updateAttribute(n,d)}v.getMetadata().isFormAssociated()&&R(this)}}})}if(e){const n=this.getMetadata().getSlots();for(const[o,a]of Object.entries(n)){w(o)||console.warn(`"${o}" is not a valid property name. Use a name that does not collide with DOM APIs`);const r=a.propertyName||o,i={get(){return this._state[r]!==void 0?this._state[r]:[]},set(){throw new Error("Cannot set slot content directly, use the DOM APIs (appendChild, removeChild, etc...)")}};Object.defineProperty(t,r,i),r!==m(r)&&Object.defineProperty(t,m(r),i)}}}static{this.metadata={}}static{this.styles=""}static get dependencies(){return[]}static cacheUniqueDependencies(){const t=this.dependencies.filter((e,s,n)=>n.indexOf(e)===s);M.set(this,t)}static getUniqueDependencies(){return M.has(this)||this.cacheUniqueDependencies(),M.get(this)||[]}static async onDefine(){return Promise.resolve()}static fetchI18nBundles(){return Promise.all(Object.entries(this.getMetadata().getI18n()).map(t=>{const{bundleName:e}=t[1];return at(e)}))}static fetchCLDR(){return this.getMetadata().needsCLDR()?it(C().getLanguage(),C().getRegion(),C().getScript()):Promise.resolve()}static{this.i18nBundleStorage={}}static get i18nBundles(){return this.i18nBundleStorage}static define(){const t=async()=>{await x();const o=await Promise.all([this.fetchI18nBundles(),this.fetchCLDR(),this.onDefine()]),[a]=o;Object.entries(this.getMetadata().getI18n()).forEach((r,i)=>{const u=r[1].bundleName;this.i18nBundleStorage[u]=a[i]}),this.asyncFinished=!0};this._definePromise=t();const e=this.getMetadata().getTag(),s=X(e),n=customElements.get(e);return n&&!s?J(e):n||(this._generateAccessors(),W(e),customElements.define(e,this)),this}static getMetadata(){if(this.hasOwnProperty("_metadata"))return this._metadata;const t=[this.metadata];let e=this;for(;e!==S;)e=Object.getPrototypeOf(e),t.unshift(e.metadata);const s=N({},...t);return this._metadata=new V(s),this._metadata}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}}const y=rt("isUI5Element");export default S;export{y as instanceOfUI5Element};
|
|
1
|
+
"use strict";import"@ui5/webcomponents-base/dist/ssr-dom.js";import N from"./thirdparty/merge.js";import{boot as x}from"./Boot.js";import V from"./UI5ElementMetadata.js";import P from"./EventProvider.js";import j from"./updateShadowRoot.js";import{shouldIgnoreCustomElement as H}from"./IgnoreCustomElements.js";import{renderDeferred as $,renderImmediately as z,cancelRender as B,unregisterElement as q,registerElement as K}from"./Render.js";import{registerTag as W,isTagRegistered as X,recordTagRegistrationFailure as J}from"./CustomElementsRegistry.js";import{observeDOMNode as Y,unobserveDOMNode as G}from"./DOMObserver.js";import{skipOriginalEvent as Q}from"./config/NoConflict.js";import Z from"./locale/getEffectiveDir.js";import{kebabToCamelCase as g,camelToKebabCase as tt,kebabToPascalCase as w}from"./util/StringHelper.js";import T from"./util/isValidPropertyName.js";import{getSlotName as D,getSlottedNodesList as A}from"./util/SlotsHelper.js";import et from"./util/arraysAreEqual.js";import{markAsRtlAware as nt}from"./locale/RTLAwareRegistry.js";import st from"./renderer/executeTemplate.js";import{shouldScopeCustomElement as R}from"./CustomElementsScopeUtils.js";import{updateFormValue as ot,setFormValue as O}from"./features/InputElementsFormSupport.js";import{getI18nBundle as at}from"./i18nBundle.js";import{fetchCldr as it}from"./asset-registries/LocaleData.js";import C from"./locale/getLocale.js";import{getLanguageChangePending as M}from"./config/Language.js";import rt from"./util/createInstanceChecker.js";let lt=0;const L=new Map,S=new Map,U={fromAttribute(c,f){if(f===Boolean)return c!==null;if(f===Number)return c===null?void 0:parseFloat(c);if(f===Object||f===Array)try{return JSON.parse(c)}catch{return c}return c},toAttribute(c,f){return f===Boolean?c?"":null:f===Object||f===Array||c==null?null:String(c)}};function m(c){this._suppressInvalidation||this.constructor.getMetadata().isLanguageAware()&&M()||(this.onInvalidation(c),this._changedState.push(c),$(this),this._invalidationEventProvider.fireEvent("invalidate",{...c,target:this}))}function dt(c,f){do{const t=Object.getOwnPropertyDescriptor(c,f);if(t)return t;c=Object.getPrototypeOf(c)}while(c&&c!==HTMLElement.prototype)}class b extends HTMLElement{constructor(){super();this.__shouldHydrate=!1;this._rendered=!1;const t=this.constructor;this._changedState=[],this._suppressInvalidation=!0,this._inDOM=!1,this._fullyConnected=!1,this._childChangeListeners=new Map,this._slotChangeListeners=new Map,this._invalidationEventProvider=new P,this._componentStateFinalizedEventProvider=new P;let e;this._domRefReadyPromise=new Promise(n=>{e=n}),this._domRefReadyPromise._deferredResolve=e,this._doNotSyncAttributes=new Set,this._slotsAssignedNodes=new WeakMap,this._state={...t.getMetadata().getInitialState()},this.initializedProperties=new Map,this.constructor.getMetadata().getPropertiesList().forEach(n=>{if(this.hasOwnProperty(n)){const o=this[n];this.initializedProperties.set(n,o)}}),this._internals=this.attachInternals(),this._initShadowRoot()}_initShadowRoot(){const t=this.constructor;if(t._needsShadowDOM()){const e={mode:"open"};this.shadowRoot?this.__shouldHydrate=!0:this.attachShadow({...e,...t.getMetadata().getShadowRootOptions()}),t.getMetadata().slotsAreManaged()&&this.shadowRoot.addEventListener("slotchange",this._onShadowRootSlotChange.bind(this))}}_onShadowRootSlotChange(t){t.target?.getRootNode()===this.shadowRoot&&this._processChildren()}get _id(){return this.__id||(this.__id=`ui5wc_${++lt}`),this.__id}render(){const t=this.constructor.template;return st(t,this)}async connectedCallback(){const t=this.constructor;K(this),this.setAttribute(t.getMetadata().getPureTag(),""),t.getMetadata().supportsF6FastNavigation()&&!this.hasAttribute("data-sap-ui-fastnavgroup")&&this.setAttribute("data-sap-ui-fastnavgroup","true");const e=t.getMetadata().slotsAreManaged();this._inDOM=!0,e&&(this._startObservingDOMChildren(),await this._processChildren()),Object.prototype.hasOwnProperty.call(t,"asyncFinished")||await t._definePromise;const s=M();t.getMetadata().isLanguageAware()&&s&&await s,this._inDOM&&(this._rendered||z(this),this._domRefReadyPromise._deferredResolve(),this._fullyConnected=!0,this.onEnterDOM(),this.hasAttribute("autofocus")&&requestAnimationFrame(()=>{this.focus()}))}get definePromise(){const t=this.constructor;return!Object.prototype.hasOwnProperty.call(t,"asyncFinished")&&t._definePromise?t._definePromise:Promise.resolve()}disconnectedCallback(){const e=this.constructor.getMetadata().slotsAreManaged();this._inDOM=!1,e&&this._stopObservingDOMChildren(),this._fullyConnected&&(this.onExitDOM(),this._fullyConnected=!1),this._domRefReadyPromise._deferredResolve(),B(this),q(this)}onBeforeRendering(){}onAfterRendering(){}onEnterDOM(){}onExitDOM(){}_startObservingDOMChildren(){const e=this.constructor.getMetadata();if(!e.hasSlots())return;const n=e.canSlotText(),o={childList:!0,subtree:n,characterData:n};Y(this,this._processChildren.bind(this),o)}_stopObservingDOMChildren(){G(this)}async _processChildren(){this.constructor.getMetadata().hasSlots()&&await this._updateSlots()}async _updateSlots(){const t=this.constructor,e=t.getMetadata().getSlots(),s=t.getMetadata().canSlotText(),n=Array.from(s?this.childNodes:this.children),o=new Map,a=new Map;for(const[l,h]of Object.entries(e)){const d=h.propertyName||l;a.set(d,l),o.set(d,[...this._state[d]]),this._clearSlot(l,h)}const r=new Map,i=new Map;n.forEach((l,h)=>{const d=D(l),p=e[d];if(p===void 0){if(d!=="default"){const I=Object.keys(e).join(", ");console.warn(`Unknown slotName: ${d}, ignoring`,l,`Valid values are: ${I}`)}return}const _=p.propertyName||d;i.has(_)?i.get(_).push({child:l,idx:h}):i.set(_,[{child:l,idx:h}])}),i.forEach((l,h)=>{this._state[h]=l.sort((d,p)=>d.idx-p.idx).map(d=>d.child),this._state[g(h)]=this._state[h]});const u=n.map(async l=>{const h=D(l),d=e[h];if(d!==void 0){if(d.individualSlots){const p=(r.get(h)||0)+1;r.set(h,p),l._individualSlot=`${h}-${p}`}if(l instanceof HTMLElement){const p=l.localName;if(p.includes("-")&&!H(p)){if(!customElements.get(p)){const k=customElements.whenDefined(p);let E=L.get(p);E||(E=new Promise(F=>setTimeout(F,1e3)),L.set(p,E)),await Promise.race([k,E])}customElements.upgrade(l)}}if(l=t.getMetadata().constructor.validateSlotValue(l,d),y(l)&&d.invalidateOnChildChange){const p=this._getChildChangeListener(h);l.attachInvalidate.call(l,p)}l instanceof HTMLSlotElement&&this._attachSlotChange(l,h,!!d.invalidateOnChildChange)}});await Promise.all(u);let v=!1;for(const[l,h]of Object.entries(e)){const d=h.propertyName||l;et(o.get(d),this._state[d])||(m.call(this,{type:"slot",name:a.get(d),reason:"children"}),v=!0,t.getMetadata().isFormAssociated()&&O(this))}v||m.call(this,{type:"slot",name:"default",reason:"textcontent"})}_clearSlot(t,e){const s=e.propertyName||t;this._state[s].forEach(o=>{if(y(o)){const a=this._getChildChangeListener(t);o.detachInvalidate.call(o,a)}o instanceof HTMLSlotElement&&this._detachSlotChange(o,t)}),this._state[s]=[],this._state[g(s)]=this._state[s]}attachInvalidate(t){this._invalidationEventProvider.attachEvent("invalidate",t)}detachInvalidate(t){this._invalidationEventProvider.detachEvent("invalidate",t)}_onChildChange(t,e){this.constructor.getMetadata().shouldInvalidateOnChildChange(t,e.type,e.name)&&m.call(this,{type:"slot",name:t,reason:"childchange",child:e.target})}attributeChangedCallback(t,e,s){let n;if(this._doNotSyncAttributes.has(t))return;const o=this.constructor.getMetadata().getProperties(),a=t.replace(/^ui5-/,""),r=g(a);if(o.hasOwnProperty(r)){const i=o[r];n=(i.converter??U).fromAttribute(s,i.type),this[r]=n}}formAssociatedCallback(){this.constructor.getMetadata().isFormAssociated()&&ot(this)}static get formAssociated(){return this.getMetadata().isFormAssociated()}_updateAttribute(t,e){const s=this.constructor;if(!s.getMetadata().hasAttribute(t))return;const o=s.getMetadata().getProperties()[t];if(o.type===Object||o.type===Array)return;const a=tt(t),i=(o.converter||U).toAttribute(e,o.type);this._doNotSyncAttributes.add(a),i==null?this.removeAttribute(a):this.setAttribute(a,i),this._doNotSyncAttributes.delete(a)}_getChildChangeListener(t){return this._childChangeListeners.has(t)||this._childChangeListeners.set(t,this._onChildChange.bind(this,t)),this._childChangeListeners.get(t)}_getSlotChangeListener(t){return this._slotChangeListeners.has(t)||this._slotChangeListeners.set(t,this._onSlotChange.bind(this,t)),this._slotChangeListeners.get(t)}_attachSlotChange(t,e,s){const n=this._getSlotChangeListener(e);t.addEventListener("slotchange",o=>{if(n.call(t,o),s){const a=this._slotsAssignedNodes.get(t);a&&a.forEach(i=>{if(y(i)){const u=this._getChildChangeListener(e);i.detachInvalidate.call(i,u)}});const r=A([t]);this._slotsAssignedNodes.set(t,r),r.forEach(i=>{if(y(i)){const u=this._getChildChangeListener(e);i.attachInvalidate.call(i,u)}})}})}_detachSlotChange(t,e){t.removeEventListener("slotchange",this._getSlotChangeListener(e))}_onSlotChange(t){m.call(this,{type:"slot",name:t,reason:"slotchange"})}onInvalidation(t){}updateAttributes(){const e=this.constructor.getMetadata().getProperties();for(const[s,n]of Object.entries(e))this._updateAttribute(s,this[s])}_render(){const t=this.constructor;if(t.getMetadata().isLanguageAware()&&M())return;const e=t.getMetadata().hasIndividualSlots();this.initializedProperties.size>0&&(Array.from(this.initializedProperties.entries()).forEach(([s,n])=>{delete this[s],this[s]=n}),this.initializedProperties.clear()),this._suppressInvalidation=!0;try{this.onBeforeRendering(),this._rendered||this.updateAttributes(),this._componentStateFinalizedEventProvider.fireEvent("componentStateFinalized")}finally{this._suppressInvalidation=!1}this._changedState=[],t._needsShadowDOM()&&j(this),this._rendered=!0,e&&this._assignIndividualSlotsToChildren(),this.onAfterRendering()}_assignIndividualSlotsToChildren(){Array.from(this.children).forEach(e=>{e._individualSlot&&e.setAttribute("slot",e._individualSlot)})}_waitForDomRef(){return this._domRefReadyPromise}getDomRef(){if(typeof this._getRealDomRef=="function")return this._getRealDomRef();if(!(!this.shadowRoot||this.shadowRoot.children.length===0))return this.shadowRoot.children[0]}getFocusDomRef(){const t=this.getDomRef();if(t)return t.querySelector("[data-sap-focus-ref]")||t}async getFocusDomRefAsync(){return await this._waitForDomRef(),this.getFocusDomRef()}async focus(t){await this._waitForDomRef();const e=this.getFocusDomRef();e===this||!this.isConnected?HTMLElement.prototype.focus.call(this,t):e&&typeof e.focus=="function"&&e.focus(t)}fireEvent(t,e,s=!1,n=!0){const o=this._fireEvent(t,e,s,n),a=w(t);return a!==t?o&&this._fireEvent(a,e,s,n):o}fireDecoratorEvent(t,e){const s=this.getEventData(t),n=s?s.cancelable:!1,o=s?s.bubbles:!1,a=this._fireEvent(t,e,n,o),r=w(t);return r!==t?a&&this._fireEvent(r,e,n,o):a}_fireEvent(t,e,s=!1,n=!0){const o=new CustomEvent(`ui5-${t}`,{detail:e,composed:!1,bubbles:n,cancelable:s}),a=this.dispatchEvent(o);if(Q(t))return a;const r=new CustomEvent(t,{detail:e,composed:!1,bubbles:n,cancelable:s});return this.dispatchEvent(r)&&a}getEventData(t){return this.constructor.getMetadata().getEvents()[t]}getSlottedNodes(t){return A(this[t])}attachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.attachEvent("componentStateFinalized",t)}detachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.detachEvent("componentStateFinalized",t)}get effectiveDir(){return nt(this.constructor),Z(this)}get isUI5Element(){return!0}get isUI5AbstractElement(){return!this.constructor._needsShadowDOM()}get classes(){return{}}get accessibilityInfo(){}static get observedAttributes(){return this.getMetadata().getAttributesList()}static get tagsToScope(){const t=this.getMetadata().getPureTag(),e=this.getUniqueDependencies().map(s=>s.getMetadata().getPureTag()).filter(R);return R(t)&&e.push(t),e}static _needsShadowDOM(){return!!this.template||Object.prototype.hasOwnProperty.call(this.prototype,"render")}static _generateAccessors(){const t=this.prototype,e=this.getMetadata().slotsAreManaged(),s=this.getMetadata().getProperties();for(const[n,o]of Object.entries(s)){T(n)||console.warn(`"${n}" is not a valid property name. Use a name that does not collide with DOM APIs`);const a=dt(t,n);let r;a?.set&&(r=a.set);let i;a?.get&&(i=a.get),Object.defineProperty(t,n,{get(){return i?i.call(this):this._state[n]},set(u){const v=this.constructor,l=i?i.call(this):this._state[n];if(l!==u){if(r?r.call(this,u):this._state[n]=u,m.call(this,{type:"property",name:n,newValue:u,oldValue:l}),this._rendered){const d=i?i.call(this):this._state[n];this._updateAttribute(n,d)}v.getMetadata().isFormAssociated()&&O(this)}}})}if(e){const n=this.getMetadata().getSlots();for(const[o,a]of Object.entries(n)){T(o)||console.warn(`"${o}" is not a valid property name. Use a name that does not collide with DOM APIs`);const r=a.propertyName||o,i={get(){return this._state[r]!==void 0?this._state[r]:[]},set(){throw new Error("Cannot set slot content directly, use the DOM APIs (appendChild, removeChild, etc...)")}};Object.defineProperty(t,r,i),r!==g(r)&&Object.defineProperty(t,g(r),i)}}}static{this.metadata={}}static{this.styles=""}static get dependencies(){return[]}static cacheUniqueDependencies(){const t=this.dependencies.filter((e,s,n)=>n.indexOf(e)===s);S.set(this,t)}static getUniqueDependencies(){return S.has(this)||this.cacheUniqueDependencies(),S.get(this)||[]}static async onDefine(){return Promise.resolve()}static fetchI18nBundles(){return Promise.all(Object.entries(this.getMetadata().getI18n()).map(t=>{const{bundleName:e}=t[1];return at(e)}))}static fetchCLDR(){return this.getMetadata().needsCLDR()?it(C().getLanguage(),C().getRegion(),C().getScript()):Promise.resolve()}static{this.i18nBundleStorage={}}static get i18nBundles(){return this.i18nBundleStorage}static define(){const t=async()=>{await x();const o=await Promise.all([this.fetchI18nBundles(),this.fetchCLDR(),this.onDefine()]),[a]=o;Object.entries(this.getMetadata().getI18n()).forEach((r,i)=>{const u=r[1].bundleName;this.i18nBundleStorage[u]=a[i]}),this.asyncFinished=!0};this._definePromise=t();const e=this.getMetadata().getTag(),s=X(e),n=customElements.get(e);return n&&!s?J(e):n||(this._generateAccessors(),W(e),customElements.define(e,this)),this}static getMetadata(){if(this.hasOwnProperty("_metadata"))return this._metadata;const t=[this.metadata];let e=this;for(;e!==b;)e=Object.getPrototypeOf(e),t.unshift(e.metadata);const s=N({},...t);return this._metadata=new V(s),this._metadata}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}}const y=rt("isUI5Element");export default b;export{y as instanceOfUI5Element};
|
|
2
2
|
//# sourceMappingURL=UI5Element.js.map
|