@ui5/webcomponents-base 2.19.0-rc.2 → 2.19.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/AGENTS.md +193 -0
- package/CHANGELOG.md +20 -0
- package/CLAUDE.md +1 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/UI5Element.d.ts +20 -3
- package/dist/UI5Element.js +34 -19
- package/dist/UI5Element.js.map +1 -1
- package/dist/asset-registries/Themes.d.ts +5 -2
- package/dist/asset-registries/Themes.js +3 -3
- package/dist/asset-registries/Themes.js.map +1 -1
- package/dist/css/SystemCSSVars.css +28 -3
- package/dist/custom-elements-internal.json +51 -0
- package/dist/custom-elements.json +51 -0
- package/dist/decorators/slot-strict.d.ts +4 -0
- package/dist/decorators/slot-strict.js +31 -0
- package/dist/decorators/slot-strict.js.map +1 -0
- package/dist/decorators.d.ts +2 -1
- package/dist/decorators.js +2 -1
- package/dist/decorators.js.map +1 -1
- package/dist/features/InputElementsFormSupport.d.ts +1 -1
- package/dist/features/InputElementsFormSupport.js +6 -2
- package/dist/features/InputElementsFormSupport.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/css/SystemCSSVars.css.d.ts +1 -1
- package/dist/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- 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 +3 -3
- package/dist/prod/decorators/slot-strict.js +2 -0
- package/dist/prod/decorators/slot-strict.js.map +7 -0
- package/dist/prod/decorators.js +1 -1
- package/dist/prod/decorators.js.map +3 -3
- package/dist/prod/features/InputElementsFormSupport.js +1 -1
- package/dist/prod/features/InputElementsFormSupport.js.map +3 -3
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/prod/index.js +1 -1
- package/dist/prod/index.js.map +3 -3
- package/dist/prod/theming/applyTheme.js +1 -1
- package/dist/prod/theming/applyTheme.js.map +3 -3
- package/dist/prod/theming/componentStyles.js +3 -0
- package/dist/prod/theming/componentStyles.js.map +7 -0
- package/dist/prod/updateShadowRoot.js +1 -1
- package/dist/prod/updateShadowRoot.js.map +3 -3
- package/dist/prod/util/createInstanceChecker.js +2 -0
- package/dist/prod/util/createInstanceChecker.js.map +7 -0
- package/dist/prod/util/createMultiInstanceChecker.js +2 -0
- package/dist/prod/util/createMultiInstanceChecker.js.map +7 -0
- package/dist/theming/applyTheme.js +8 -2
- package/dist/theming/applyTheme.js.map +1 -1
- package/dist/theming/componentStyles.d.ts +3 -0
- package/dist/theming/componentStyles.js +15 -0
- package/dist/theming/componentStyles.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js.map +1 -1
- package/dist/updateShadowRoot.js +2 -1
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/createInstanceChecker.d.ts +2 -0
- package/dist/util/createInstanceChecker.js +8 -0
- package/dist/util/createInstanceChecker.js.map +1 -0
- package/dist/util/createMultiInstanceChecker.d.ts +2 -0
- package/dist/util/createMultiInstanceChecker.js +19 -0
- package/dist/util/createMultiInstanceChecker.js.map +1 -0
- package/dist/util/getClassCopy.d.ts +2 -1
- package/package.json +3 -3
- package/src/css/SystemCSSVars.css +28 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Themes.js","sourceRoot":"","sources":["../../src/asset-registries/Themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAA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AC,GAAG,CAAC,GAAG,WAAW,IAAI,SAAS,EAAE,CAAC,CAAC;IAC7D,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,wBAAwB;QACxB,IAAI,CAAC,cAAc,EAAE,CAAC;YACrB,OAAO,CAAC,KAAK,CAAC,UAAU,SAAS,iCAAiC,WAAW,GAAG,CAAC,CAAC,CAAC,yBAAyB;QAC7G,CAAC;QACD,OAAO;IACR,CAAC;IACD,IAAI,IAAI,CAAC;IACT,IAAI,CAAC;QACJ,IAAI,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,KAAc,CAAC;QACzB,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB;QAChE,OAAO;IACR,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,GAAG,EAAE;IAClC,OAAO,kBAAkB,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,EAAE;IAC3C,OAAO,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,OAAO,EACN,6BAA6B,EAC7B,mCAAmC,EACnC,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,GACjB,CAAC","sourcesContent":["import { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport { mergeStyles } from \"../ManagedStyles.js\";\nimport { fireThemeRegistered } from \"../theming/ThemeRegistered.js\";\n\ntype ThemeData = string;\ntype ThemeLoader = (themeName: string) => Promise<string>;\n\ntype CSSVariablesTarget = \"root\" | \"host\";\n\nconst themeStyles = new Map<string, string>();\nconst loaders = new Map<string, ThemeLoader>();\nconst customLoaders = new Map<string, ThemeLoader>();\nconst registeredPackages = new Map<string, { cssVariablesTarget: CSSVariablesTarget }>();\nconst registeredThemes = new Set<string>();\n\nconst registerThemePropertiesLoader = (packageName: string, themeName: string, loader: ThemeLoader, cssVariablesTarget: CSSVariablesTarget = \"root\") => {\n\tloaders.set(`${packageName}/${themeName}`, loader);\n\tregisteredPackages.set(packageName, { cssVariablesTarget });\n\tregisteredThemes.add(themeName);\n\tfireThemeRegistered(themeName);\n};\n\nconst registerCustomThemePropertiesLoader = (packageName: string, themeName: string, loader: ThemeLoader) => {\n\tcustomLoaders.set(`${packageName}/${themeName}`, loader);\n};\n\nconst getThemeProperties = async (packageName: string, themeName: string, externalThemeName?: string) => {\n\tconst cacheKey = `${packageName}_${themeName}_${externalThemeName || \"\"}`;\n\tconst cachedStyleData = themeStyles.get(cacheKey);\n\tif (cachedStyleData !== undefined) { // it's valid for style to be an empty string\n\t\treturn cachedStyleData;\n\t}\n\n\tif (!registeredThemes.has(themeName)) {\n\t\tconst regThemesStr = [...registeredThemes.values()].join(\", \");\n\t\tconsole.warn(`You have requested a non-registered theme ${themeName} - falling back to ${DEFAULT_THEME}. Registered themes are: ${regThemesStr}`); /* eslint-disable-line */\n\t\treturn _getThemeProperties(packageName, DEFAULT_THEME);\n\t}\n\n\tconst [style, customStyle] = await Promise.all([\n\t\t_getThemeProperties(packageName, themeName),\n\t\texternalThemeName ? _getThemeProperties(packageName, externalThemeName, true) : undefined,\n\t]);\n\n\tconst styleData = mergeStyles(style, customStyle);\n\tif (styleData) {\n\t\tthemeStyles.set(cacheKey, styleData);\n\t}\n\n\treturn styleData;\n};\n\nconst _getThemeProperties = async (packageName: string, themeName: string, forCustomTheme = false) => {\n\tconst loadersMap = forCustomTheme ? customLoaders : loaders;\n\tconst loader = loadersMap.get(`${packageName}/${themeName}`);\n\tif (!loader) {\n\t\t// no themes for package\n\t\tif (!forCustomTheme) {\n\t\t\tconsole.error(`Theme [${themeName}] not registered for package [${packageName}]`); /* eslint-disable-line */\n\t\t}\n\t\treturn;\n\t}\n\tlet data;\n\ttry {\n\t\tdata = await loader(themeName);\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(packageName, e.message); /* eslint-disable-line */\n\t\treturn;\n\t}\n\n\treturn data;\n};\n\nconst getRegisteredPackages = () => {\n\treturn registeredPackages;\n};\n\nconst isThemeRegistered = (theme: string) => {\n\treturn registeredThemes.has(theme);\n};\n\nexport {\n\tregisterThemePropertiesLoader,\n\tregisterCustomThemePropertiesLoader,\n\tgetThemeProperties,\n\tgetRegisteredPackages,\n\tisThemeRegistered,\n};\n\nexport type {\n\tThemeData,\n\tThemeLoader,\n};\n"]}
|
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
|
|
2
|
+
/*
|
|
3
|
+
Use a non-existent variable to always trigger the fallback.
|
|
4
|
+
Because this variable is never defined, the fallback is used
|
|
5
|
+
in all cases.
|
|
6
|
+
|
|
7
|
+
Using `initial` as a fallback can work only for properties
|
|
8
|
+
that treat it as an invalid value. To avoid this inconsistency,
|
|
9
|
+
we intentionally reference an undefined variable, which is
|
|
10
|
+
always considered invalid and undefined.
|
|
11
|
+
*/
|
|
12
|
+
--_ui5-cozy-size: var(--_ui5-f2d95f8);
|
|
13
|
+
|
|
14
|
+
--_ui5-compact-size: ;
|
|
15
|
+
--_ui5_content_density: cozy;
|
|
3
16
|
}
|
|
4
17
|
|
|
5
18
|
[data-ui5-compact-size],
|
|
6
19
|
.ui5-content-density-compact,
|
|
7
20
|
.sapUiSizeCompact {
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
--_ui5-cozy-size: ;
|
|
22
|
+
/*
|
|
23
|
+
Use a non-existent variable to always trigger the fallback.
|
|
24
|
+
Because this variable is never defined, the fallback is used
|
|
25
|
+
in all cases.
|
|
26
|
+
|
|
27
|
+
Using `initial` as a fallback can work only for properties
|
|
28
|
+
that treat it as an invalid value. To avoid this inconsistency,
|
|
29
|
+
we intentionally reference an undefined variable, which is
|
|
30
|
+
always considered invalid and undefined.
|
|
31
|
+
*/
|
|
32
|
+
--_ui5-compact-size: var(--_ui5-f2d95f8);
|
|
33
|
+
--_ui5_content_density: compact;
|
|
34
|
+
}
|
|
@@ -1316,6 +1316,21 @@
|
|
|
1316
1316
|
}
|
|
1317
1317
|
]
|
|
1318
1318
|
},
|
|
1319
|
+
{
|
|
1320
|
+
"kind": "javascript-module",
|
|
1321
|
+
"path": "dist/decorators/slot-strict.js",
|
|
1322
|
+
"declarations": [],
|
|
1323
|
+
"exports": [
|
|
1324
|
+
{
|
|
1325
|
+
"kind": "js",
|
|
1326
|
+
"name": "default",
|
|
1327
|
+
"declaration": {
|
|
1328
|
+
"name": "slot",
|
|
1329
|
+
"module": "dist/decorators/slot-strict.js"
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
]
|
|
1333
|
+
},
|
|
1319
1334
|
{
|
|
1320
1335
|
"kind": "javascript-module",
|
|
1321
1336
|
"path": "dist/decorators/slot.js",
|
|
@@ -1817,6 +1832,12 @@
|
|
|
1817
1832
|
}
|
|
1818
1833
|
]
|
|
1819
1834
|
},
|
|
1835
|
+
{
|
|
1836
|
+
"kind": "javascript-module",
|
|
1837
|
+
"path": "dist/theming/componentStyles.js",
|
|
1838
|
+
"declarations": [],
|
|
1839
|
+
"exports": []
|
|
1840
|
+
},
|
|
1820
1841
|
{
|
|
1821
1842
|
"kind": "javascript-module",
|
|
1822
1843
|
"path": "dist/theming/getConstructableStyle.js",
|
|
@@ -2454,6 +2475,21 @@
|
|
|
2454
2475
|
}
|
|
2455
2476
|
]
|
|
2456
2477
|
},
|
|
2478
|
+
{
|
|
2479
|
+
"kind": "javascript-module",
|
|
2480
|
+
"path": "dist/util/createInstanceChecker.js",
|
|
2481
|
+
"declarations": [],
|
|
2482
|
+
"exports": [
|
|
2483
|
+
{
|
|
2484
|
+
"kind": "js",
|
|
2485
|
+
"name": "default",
|
|
2486
|
+
"declaration": {
|
|
2487
|
+
"name": "createChecker",
|
|
2488
|
+
"module": "dist/util/createInstanceChecker.js"
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
]
|
|
2492
|
+
},
|
|
2457
2493
|
{
|
|
2458
2494
|
"kind": "javascript-module",
|
|
2459
2495
|
"path": "dist/util/createLinkInHead.js",
|
|
@@ -2469,6 +2505,21 @@
|
|
|
2469
2505
|
}
|
|
2470
2506
|
]
|
|
2471
2507
|
},
|
|
2508
|
+
{
|
|
2509
|
+
"kind": "javascript-module",
|
|
2510
|
+
"path": "dist/util/createMultiInstanceChecker.js",
|
|
2511
|
+
"declarations": [],
|
|
2512
|
+
"exports": [
|
|
2513
|
+
{
|
|
2514
|
+
"kind": "js",
|
|
2515
|
+
"name": "default",
|
|
2516
|
+
"declaration": {
|
|
2517
|
+
"name": "createMultiInstanceChecker",
|
|
2518
|
+
"module": "dist/util/createMultiInstanceChecker.js"
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
]
|
|
2522
|
+
},
|
|
2472
2523
|
{
|
|
2473
2524
|
"kind": "javascript-module",
|
|
2474
2525
|
"path": "dist/util/debounce.js",
|
|
@@ -1298,6 +1298,21 @@
|
|
|
1298
1298
|
}
|
|
1299
1299
|
]
|
|
1300
1300
|
},
|
|
1301
|
+
{
|
|
1302
|
+
"kind": "javascript-module",
|
|
1303
|
+
"path": "dist/decorators/slot-strict.js",
|
|
1304
|
+
"declarations": [],
|
|
1305
|
+
"exports": [
|
|
1306
|
+
{
|
|
1307
|
+
"kind": "js",
|
|
1308
|
+
"name": "default",
|
|
1309
|
+
"declaration": {
|
|
1310
|
+
"name": "slot",
|
|
1311
|
+
"module": "dist/decorators/slot-strict.js"
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
]
|
|
1315
|
+
},
|
|
1301
1316
|
{
|
|
1302
1317
|
"kind": "javascript-module",
|
|
1303
1318
|
"path": "dist/decorators/slot.js",
|
|
@@ -1791,6 +1806,12 @@
|
|
|
1791
1806
|
}
|
|
1792
1807
|
]
|
|
1793
1808
|
},
|
|
1809
|
+
{
|
|
1810
|
+
"kind": "javascript-module",
|
|
1811
|
+
"path": "dist/theming/componentStyles.js",
|
|
1812
|
+
"declarations": [],
|
|
1813
|
+
"exports": []
|
|
1814
|
+
},
|
|
1794
1815
|
{
|
|
1795
1816
|
"kind": "javascript-module",
|
|
1796
1817
|
"path": "dist/theming/getConstructableStyle.js",
|
|
@@ -2151,6 +2172,21 @@
|
|
|
2151
2172
|
}
|
|
2152
2173
|
]
|
|
2153
2174
|
},
|
|
2175
|
+
{
|
|
2176
|
+
"kind": "javascript-module",
|
|
2177
|
+
"path": "dist/util/createInstanceChecker.js",
|
|
2178
|
+
"declarations": [],
|
|
2179
|
+
"exports": [
|
|
2180
|
+
{
|
|
2181
|
+
"kind": "js",
|
|
2182
|
+
"name": "default",
|
|
2183
|
+
"declaration": {
|
|
2184
|
+
"name": "createChecker",
|
|
2185
|
+
"module": "dist/util/createInstanceChecker.js"
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
]
|
|
2189
|
+
},
|
|
2154
2190
|
{
|
|
2155
2191
|
"kind": "javascript-module",
|
|
2156
2192
|
"path": "dist/util/createLinkInHead.js",
|
|
@@ -2166,6 +2202,21 @@
|
|
|
2166
2202
|
}
|
|
2167
2203
|
]
|
|
2168
2204
|
},
|
|
2205
|
+
{
|
|
2206
|
+
"kind": "javascript-module",
|
|
2207
|
+
"path": "dist/util/createMultiInstanceChecker.js",
|
|
2208
|
+
"declarations": [],
|
|
2209
|
+
"exports": [
|
|
2210
|
+
{
|
|
2211
|
+
"kind": "js",
|
|
2212
|
+
"name": "default",
|
|
2213
|
+
"declaration": {
|
|
2214
|
+
"name": "createMultiInstanceChecker",
|
|
2215
|
+
"module": "dist/util/createMultiInstanceChecker.js"
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
]
|
|
2219
|
+
},
|
|
2169
2220
|
{
|
|
2170
2221
|
"kind": "javascript-module",
|
|
2171
2222
|
"path": "dist/util/debounce.js",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Slot, DefaultSlot } from "../UI5Element.js";
|
|
2
|
+
import type { Slot as SlotMetadata } from "../UI5ElementMetadata.js";
|
|
3
|
+
declare function slot<T extends Record<K, Slot<unknown> | DefaultSlot<unknown>>, K extends string>(slotData?: SlotMetadata): (target: T, prop: K) => void;
|
|
4
|
+
export default slot;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function slot(slotData) {
|
|
2
|
+
return (target, slotKey) => {
|
|
3
|
+
const ctor = target.constructor;
|
|
4
|
+
if (!Object.prototype.hasOwnProperty.call(ctor, "metadata")) {
|
|
5
|
+
ctor.metadata = {};
|
|
6
|
+
}
|
|
7
|
+
const metadata = ctor.metadata;
|
|
8
|
+
if (!metadata.slots) {
|
|
9
|
+
metadata.slots = {};
|
|
10
|
+
}
|
|
11
|
+
const slotMetadata = metadata.slots;
|
|
12
|
+
if (slotData && slotData.default && slotMetadata.default) {
|
|
13
|
+
throw new Error("Only one slot can be the default slot.");
|
|
14
|
+
}
|
|
15
|
+
const key = slotData && slotData.default ? "default" : slotKey;
|
|
16
|
+
slotData = slotData || { type: HTMLElement };
|
|
17
|
+
if (!slotData.type) {
|
|
18
|
+
slotData.type = HTMLElement;
|
|
19
|
+
}
|
|
20
|
+
if (!slotMetadata[key]) {
|
|
21
|
+
slotMetadata[key] = slotData;
|
|
22
|
+
}
|
|
23
|
+
if (slotData.default) {
|
|
24
|
+
delete slotMetadata.default.default;
|
|
25
|
+
slotMetadata.default.propertyName = slotKey;
|
|
26
|
+
}
|
|
27
|
+
ctor.metadata.managedSlots = true;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export default slot;
|
|
31
|
+
//# sourceMappingURL=slot-strict.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-strict.js","sourceRoot":"","sources":["../../src/decorators/slot-strict.ts"],"names":[],"mappings":"AAIA,SAAS,IAAI,CAGX,QAAuB;IACxB,OAAO,CAAC,MAAW,EAAE,OAAw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,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport type { Slot, DefaultSlot } from \"../UI5Element.js\";\nimport type { Slot as SlotMetadata } from \"../UI5ElementMetadata.js\";\n\nfunction slot<\n\tT extends Record<K, Slot<unknown> | DefaultSlot<unknown>>,\n\tK extends string\n>(slotData?: SlotMetadata): (target: T, prop: K) => void {\n\treturn (target: any, slotKey: string | symbol) => {\n\t\tconst ctor = target.constructor as typeof UI5Element;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(ctor, \"metadata\")) {\n\t\t\tctor.metadata = {};\n\t\t}\n\n\t\tconst metadata = ctor.metadata;\n\t\tif (!metadata.slots) {\n\t\t\tmetadata.slots = {};\n\t\t}\n\n\t\tconst slotMetadata = metadata.slots;\n\n\t\tif (slotData && slotData.default && slotMetadata.default) {\n\t\t\tthrow new Error(\"Only one slot can be the default slot.\");\n\t\t}\n\n\t\tconst key = slotData && slotData.default ? \"default\" : (slotKey as string);\n\t\tslotData = slotData || { type: HTMLElement };\n\n\t\tif (!slotData.type) {\n\t\t\tslotData.type = HTMLElement;\n\t\t}\n\n\t\tif (!slotMetadata[key]) {\n\t\t\tslotMetadata[key] = slotData;\n\t\t}\n\n\t\tif (slotData.default) {\n\t\t\tdelete slotMetadata.default.default;\n\t\t\tslotMetadata.default.propertyName = slotKey as string;\n\t\t}\n\n\t\tctor.metadata.managedSlots = true;\n\t};\n}\n\nexport default slot;\n"]}
|
package/dist/decorators.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import event from "./decorators/event.js";
|
|
|
3
3
|
import eventStrict from "./decorators/event-strict.js";
|
|
4
4
|
import property from "./decorators/property.js";
|
|
5
5
|
import slot from "./decorators/slot.js";
|
|
6
|
+
import slotStrict from "./decorators/slot-strict.js";
|
|
6
7
|
import bound from "./decorators/bound.js";
|
|
7
8
|
import i18n from "./decorators/i18n.js";
|
|
8
|
-
export { customElement, event, eventStrict, property, slot, bound, i18n, };
|
|
9
|
+
export { customElement, event, eventStrict, property, slot, slotStrict, bound, i18n, };
|
package/dist/decorators.js
CHANGED
|
@@ -3,7 +3,8 @@ import event from "./decorators/event.js";
|
|
|
3
3
|
import eventStrict from "./decorators/event-strict.js";
|
|
4
4
|
import property from "./decorators/property.js";
|
|
5
5
|
import slot from "./decorators/slot.js";
|
|
6
|
+
import slotStrict from "./decorators/slot-strict.js";
|
|
6
7
|
import bound from "./decorators/bound.js";
|
|
7
8
|
import i18n from "./decorators/i18n.js";
|
|
8
|
-
export { customElement, event, eventStrict, property, slot, bound, i18n, };
|
|
9
|
+
export { customElement, event, eventStrict, property, slot, slotStrict, bound, i18n, };
|
|
9
10
|
//# sourceMappingURL=decorators.js.map
|
package/dist/decorators.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,OAAO,EACN,aAAa,EACb,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,IAAI,GACJ,CAAC","sourcesContent":["import customElement from \"./decorators/customElement.js\";\nimport event from \"./decorators/event.js\";\nimport eventStrict from \"./decorators/event-strict.js\";\nimport property from \"./decorators/property.js\";\nimport slot from \"./decorators/slot.js\";\nimport bound from \"./decorators/bound.js\";\nimport i18n from \"./decorators/i18n.js\";\n\nexport {\n\tcustomElement,\n\tevent,\n\teventStrict,\n\tproperty,\n\tslot,\n\tbound,\n\ti18n,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,UAAU,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,OAAO,EACN,aAAa,EACb,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,KAAK,EACL,IAAI,GACJ,CAAC","sourcesContent":["import customElement from \"./decorators/customElement.js\";\nimport event from \"./decorators/event.js\";\nimport eventStrict from \"./decorators/event-strict.js\";\nimport property from \"./decorators/property.js\";\nimport slot from \"./decorators/slot.js\";\nimport slotStrict from \"./decorators/slot-strict.js\";\nimport bound from \"./decorators/bound.js\";\nimport i18n from \"./decorators/i18n.js\";\n\nexport {\n\tcustomElement,\n\tevent,\n\teventStrict,\n\tproperty,\n\tslot,\n\tslotStrict,\n\tbound,\n\ti18n,\n};\n"]}
|
|
@@ -9,7 +9,7 @@ interface IFormInputElement extends UI5Element {
|
|
|
9
9
|
declare const updateFormValue: (element: IFormInputElement | UI5Element) => void;
|
|
10
10
|
declare const setFormValue: (element: IFormInputElement) => void;
|
|
11
11
|
declare const setFormValidity: (element: IFormInputElement) => Promise<void>;
|
|
12
|
-
declare const submitForm: (element: UI5Element) => void
|
|
12
|
+
declare const submitForm: (element: UI5Element) => Promise<void>;
|
|
13
13
|
declare const resetForm: (element: UI5Element) => void;
|
|
14
14
|
export { updateFormValue, setFormValue, setFormValidity, submitForm, resetForm, };
|
|
15
15
|
export type { IFormInputElement, };
|
|
@@ -15,9 +15,11 @@ const setFormValue = (element) => {
|
|
|
15
15
|
element._internals.setFormValue(element.formFormattedValue);
|
|
16
16
|
};
|
|
17
17
|
const setFormValidity = async (element) => {
|
|
18
|
-
if (!element._internals?.form) {
|
|
18
|
+
if (!element.isUI5Element || !element._internals?.form) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
+
element._internals.setValidity({ customError: true }, " "); // treat the form as invalid until CLDR and message bundles are loaded
|
|
22
|
+
await element.definePromise;
|
|
21
23
|
if (element.formValidity && Object.keys(element.formValidity).some(key => key)) {
|
|
22
24
|
const focusRef = await element.formElementAnchor?.();
|
|
23
25
|
element._internals.setValidity(element.formValidity, element.formValidityMessage, focusRef);
|
|
@@ -26,7 +28,9 @@ const setFormValidity = async (element) => {
|
|
|
26
28
|
element._internals.setValidity({});
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
|
-
const submitForm = (element) => {
|
|
31
|
+
const submitForm = async (element) => {
|
|
32
|
+
const elements = [...(element._internals?.form?.elements ?? [])];
|
|
33
|
+
await Promise.all(elements.map(el => { return isInputElement(el) ? setFormValidity(el) : Promise.resolve(); }));
|
|
30
34
|
element._internals?.form?.requestSubmit();
|
|
31
35
|
};
|
|
32
36
|
const resetForm = (element) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputElementsFormSupport.js","sourceRoot":"","sources":["../../src/features/InputElementsFormSupport.ts"],"names":[],"mappings":"AAUA,MAAM,eAAe,GAAG,CAAC,OAAuC,EAAE,EAAE;IACnE,IAAI,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,YAAY,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAA0B,EAAE,EAAE;IACnD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC;QAC/B,OAAO;IACR,CAAC;IAED,eAAe,CAAC,OAAO,CAAC,CAAC;IAEzB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,OAAO,CAAC,UAAU,EAAE,YAAY,C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,EACf,UAAU,EACV,SAAS,GACT,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\n\ninterface IFormInputElement extends UI5Element {\n\tname?: string;\n\tformFormattedValue: FormData | string | null;\n\tformValidityMessage?: string;\n\tformValidity?: ValidityStateFlags;\n\tformElementAnchor?: () => HTMLElement | undefined | Promise<HTMLElement | undefined>;\n}\n\nconst updateFormValue = (element: IFormInputElement | UI5Element) => {\n\tif (isInputElement(element)) {\n\t\tsetFormValue(element);\n\t}\n};\n\nconst setFormValue = (element: IFormInputElement) => {\n\tif (!element._internals?.form) {\n\t\treturn;\n\t}\n\n\tsetFormValidity(element);\n\n\tif (!element.name) {\n\t\telement._internals?.setFormValue(null);\n\t\treturn;\n\t}\n\n\telement._internals.setFormValue(element.formFormattedValue);\n};\n\nconst setFormValidity = async (element: IFormInputElement) => {\n\tif (!element.isUI5Element || !element._internals?.form) {\n\t\treturn;\n\t}\n\n\telement._internals.setValidity({ customError: true }, \" \"); // treat the form as invalid until CLDR and message bundles are loaded\n\tawait element.definePromise;\n\n\tif (element.formValidity && Object.keys(element.formValidity).some(key => key)) {\n\t\tconst focusRef = await element.formElementAnchor?.();\n\t\telement._internals.setValidity(element.formValidity, element.formValidityMessage, focusRef);\n\t} else {\n\t\telement._internals.setValidity({});\n\t}\n};\n\nconst submitForm = async (element: UI5Element) => {\n\tconst elements = [...(element._internals?.form?.elements ?? [])] as Array<IFormInputElement | UI5Element>;\n\n\tawait Promise.all(elements.map(el => { return isInputElement(el) ? setFormValidity(el) : Promise.resolve(); }));\n\n\telement._internals?.form?.requestSubmit();\n};\n\nconst resetForm = (element: UI5Element) => {\n\telement._internals?.form?.reset();\n};\n\nconst isInputElement = (element: IFormInputElement | UI5Element): element is IFormInputElement => {\n\treturn \"formFormattedValue\" in element && \"name\" in element;\n};\n\nexport {\n\tupdateFormValue,\n\tsetFormValue,\n\tsetFormValidity,\n\tsubmitForm,\n\tresetForm,\n};\n\nexport type {\n\tIFormInputElement,\n};\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const VersionInfo = {
|
|
2
|
-
version: "2.19.0-rc.
|
|
2
|
+
version: "2.19.0-rc.3",
|
|
3
3
|
major: 2,
|
|
4
4
|
minor: 19,
|
|
5
5
|
patch: 0,
|
|
6
|
-
suffix: "-rc.
|
|
6
|
+
suffix: "-rc.3",
|
|
7
7
|
isNext: false,
|
|
8
|
-
buildTime:
|
|
8
|
+
buildTime: 1770288860,
|
|
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,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.19.0-rc.
|
|
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.19.0-rc.3\",\n\tmajor: 2,\n\tminor: 19,\n\tpatch: 0,\n\tsuffix: \"-rc.3\",\n\tisNext: false,\n\tbuildTime: 1770288860,\n};\nexport default VersionInfo;"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: ":root{--_ui5_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5_content_density:compact}";
|
|
1
|
+
declare const _default: ":root{--_ui5-cozy-size:var(--_ui5-f2d95f8);--_ui5-compact-size: ;--_ui5_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5-cozy-size: ;--_ui5-compact-size:var(--_ui5-f2d95f8);--_ui5_content_density:compact}";
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default `:root{--_ui5_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5_content_density:compact}`;
|
|
1
|
+
export default `:root{--_ui5-cozy-size:var(--_ui5-f2d95f8);--_ui5-compact-size: ;--_ui5_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5-cozy-size: ;--_ui5-compact-size:var(--_ui5-f2d95f8);--_ui5_content_density:compact}`;
|
|
2
2
|
//# sourceMappingURL=SystemCSSVars.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemCSSVars.css.js","sourceRoot":"","sources":["../../../src/generated/css/SystemCSSVars.css.ts"],"names":[],"mappings":"AAAA,eAAe,
|
|
1
|
+
{"version":3,"file":"SystemCSSVars.css.js","sourceRoot":"","sources":["../../../src/generated/css/SystemCSSVars.css.ts"],"names":[],"mappings":"AAAA,eAAe,gQAAgQ,CAAC","sourcesContent":["export default `:root{--_ui5-cozy-size:var(--_ui5-f2d95f8);--_ui5-compact-size: ;--_ui5_content_density:cozy}.sapUiSizeCompact,.ui5-content-density-compact,[data-ui5-compact-size]{--_ui5-cozy-size: ;--_ui5-compact-size:var(--_ui5-f2d95f8);--_ui5_content_density:compact}`;"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import customElement from "./decorators/customElement.js";
|
|
|
16
16
|
import event from "./decorators/event.js";
|
|
17
17
|
import property from "./decorators/property.js";
|
|
18
18
|
import slot from "./decorators/slot.js";
|
|
19
|
+
import slotStrict from "./decorators/slot-strict.js";
|
|
19
20
|
import ItemNavigation from "./delegate/ItemNavigation.js";
|
|
20
21
|
import ResizeHandler from "./delegate/ResizeHandler.js";
|
|
21
22
|
import ScrollEnablement from "./delegate/ScrollEnablement.js";
|
|
@@ -38,7 +39,7 @@ import { renderDeferred, renderImmediately, cancelRender, renderFinished } from
|
|
|
38
39
|
import { addCustomCSS, attachThemeLoaded, detachThemeLoaded } from "./Theming.js";
|
|
39
40
|
import UI5Element from "./UI5Element.js";
|
|
40
41
|
export default UI5Element;
|
|
41
|
-
export { startMultipleDrag, scroll, slideDown, slideUp, getAnimationMode, setAnimationMode, getCalendarType, getFirstDayOfWeek, getLegacyDateCalendarCustomizing, setDefaultIconCollection, getDefaultIconCollection, getEffectiveIconCollection, RegisteredIconCollection, getLanguage, setLanguage, getDefaultLanguage, setFetchDefaultLanguage, getFetchDefaultLanguage, getNoConflict, setNoConflict, getTheme, setTheme, getDefaultTheme, customElement, event, property, slot, ItemNavigation, ResizeHandler, ScrollEnablement, applyDirection, attachDirectionChange, detachDirectionChange, getEffectiveDir, attachLanguageChange, detachLanguageChange, URLListValidator, sanitizeHTML, registerI18nLoader, registerLocaleDataLoader, registerThemePropertiesLoader, registerIconLoader, attachBoot, setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, getEffectiveScopingSuffixForTag, supportsTouch, isSafari, isChrome, isFirefox, isPhone, isTablet, isDesktop, isCombi, isIOS, isAndroid, EventProvider, I18nBundle, getI18nBundle, registerCustomI18nBundleGetter, MediaRange, renderDeferred, renderImmediately, cancelRender, renderFinished, addCustomCSS, attachThemeLoaded, detachThemeLoaded, UI5Element, };
|
|
42
|
+
export { startMultipleDrag, scroll, slideDown, slideUp, getAnimationMode, setAnimationMode, getCalendarType, getFirstDayOfWeek, getLegacyDateCalendarCustomizing, setDefaultIconCollection, getDefaultIconCollection, getEffectiveIconCollection, RegisteredIconCollection, getLanguage, setLanguage, getDefaultLanguage, setFetchDefaultLanguage, getFetchDefaultLanguage, getNoConflict, setNoConflict, getTheme, setTheme, getDefaultTheme, customElement, event, property, slot, slotStrict, ItemNavigation, ResizeHandler, ScrollEnablement, applyDirection, attachDirectionChange, detachDirectionChange, getEffectiveDir, attachLanguageChange, detachLanguageChange, URLListValidator, sanitizeHTML, registerI18nLoader, registerLocaleDataLoader, registerThemePropertiesLoader, registerIconLoader, attachBoot, setCustomElementsScopingSuffix, getCustomElementsScopingSuffix, setCustomElementsScopingRules, getCustomElementsScopingRules, getEffectiveScopingSuffixForTag, supportsTouch, isSafari, isChrome, isFirefox, isPhone, isTablet, isDesktop, isCombi, isIOS, isAndroid, EventProvider, I18nBundle, getI18nBundle, registerCustomI18nBundleGetter, MediaRange, renderDeferred, renderImmediately, cancelRender, renderFinished, addCustomCSS, attachThemeLoaded, detachThemeLoaded, UI5Element, };
|
|
42
43
|
type TargetedCustomEvent<D, T> = Omit<CustomEvent<D>, "currentTarget"> & {
|
|
43
44
|
currentTarget: T;
|
|
44
45
|
};
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import customElement from "./decorators/customElement.js";
|
|
|
18
18
|
import event from "./decorators/event.js";
|
|
19
19
|
import property from "./decorators/property.js";
|
|
20
20
|
import slot from "./decorators/slot.js";
|
|
21
|
+
import slotStrict from "./decorators/slot-strict.js";
|
|
21
22
|
// delegate/
|
|
22
23
|
import ItemNavigation from "./delegate/ItemNavigation.js";
|
|
23
24
|
import ResizeHandler from "./delegate/ResizeHandler.js";
|
|
@@ -61,7 +62,7 @@ scroll, slideDown, slideUp,
|
|
|
61
62
|
// config/
|
|
62
63
|
getAnimationMode, setAnimationMode, getCalendarType, getFirstDayOfWeek, getLegacyDateCalendarCustomizing, setDefaultIconCollection, getDefaultIconCollection, getEffectiveIconCollection, RegisteredIconCollection, getLanguage, setLanguage, getDefaultLanguage, setFetchDefaultLanguage, getFetchDefaultLanguage, getNoConflict, setNoConflict, getTheme, setTheme, getDefaultTheme,
|
|
63
64
|
// decorators/
|
|
64
|
-
customElement, event, property, slot,
|
|
65
|
+
customElement, event, property, slot, slotStrict,
|
|
65
66
|
// delegate/
|
|
66
67
|
ItemNavigation, ResizeHandler, ScrollEnablement,
|
|
67
68
|
// locale/
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc;AACd,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAE9C,UAAU;AACV,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,EACN,wBAAwB,EACxB,wBAAwB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AAC7F,OAAO,0BAA0B,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACN,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACN,QAAQ,EACR,QAAQ,EACR,eAAe,GACf,MAAM,mBAAmB,CAAC;AAE3B,cAAc;AACd,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC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ACb,YAAY,EACZ,iBAAiB,EACjB,iBAAiB;AAEjB,gBAAgB;AAChB,UAAU,GACV,CAAC","sourcesContent":["import type { JSX } from \"./jsx-runtime.d.ts\";\n\n// animations/\nimport scroll from \"./animations/scroll.js\";\nimport slideDown from \"./animations/slideDown.js\";\nimport slideUp from \"./animations/slideUp.js\";\n\n// config/\nimport { getAnimationMode, setAnimationMode } from \"./config/AnimationMode.js\";\nimport { getCalendarType } from \"./config/CalendarType.js\";\nimport { getFirstDayOfWeek, getLegacyDateCalendarCustomizing } from \"./config/FormatSettings.js\";\nimport {\n\tsetDefaultIconCollection,\n\tgetDefaultIconCollection,\n} from \"./config/Icons.js\";\nimport { RegisteredIconCollection } from \"./asset-registries/util/IconCollectionsByTheme.js\";\nimport getEffectiveIconCollection from \"./asset-registries/util/getIconCollectionByTheme.js\";\nimport { startMultipleDrag } from \"./DragAndDrop.js\";\nimport {\n\tgetLanguage,\n\tsetLanguage,\n\tgetDefaultLanguage,\n\tsetFetchDefaultLanguage,\n\tgetFetchDefaultLanguage,\n} from \"./config/Language.js\";\nimport { getNoConflict, setNoConflict } from \"./config/NoConflict.js\";\nimport {\n\tgetTheme,\n\tsetTheme,\n\tgetDefaultTheme,\n} from \"./config/Theme.js\";\n\n// decorators/\nimport customElement from \"./decorators/customElement.js\";\nimport event from \"./decorators/event.js\";\nimport property from \"./decorators/property.js\";\nimport slot from \"./decorators/slot.js\";\nimport slotStrict from \"./decorators/slot-strict.js\";\n\n// delegate/\nimport ItemNavigation from \"./delegate/ItemNavigation.js\";\nimport ResizeHandler from \"./delegate/ResizeHandler.js\";\nimport ScrollEnablement from \"./delegate/ScrollEnablement.js\";\n\n// locale/\nimport applyDirection from \"./locale/applyDirection.js\";\nimport { attachDirectionChange, detachDirectionChange } from \"./locale/directionChange.js\";\nimport getEffectiveDir from \"./locale/getEffectiveDir.js\";\nimport { attachLanguageChange, detachLanguageChange } from \"./locale/languageChange.js\";\n\n// util/\nimport { URLListValidator, sanitizeHTML } from \"./util/HTMLSanitizer.js\";\n\n// Assets.ts\nimport { registerI18nLoader } from \"./asset-registries/i18n.js\";\nimport { registerLocaleDataLoader } from \"./asset-registries/LocaleData.js\";\nimport { registerThemePropertiesLoader } from \"./asset-registries/Themes.js\";\nimport { registerIconLoader } from \"./asset-registries/Icons.js\";\n\n// Boot.ts\nimport { attachBoot } from \"./Boot.js\";\n\n// CustomElementsScope.ts\nimport {\n\tsetCustomElementsScopingSuffix,\n\tgetCustomElementsScopingSuffix,\n\tsetCustomElementsScopingRules,\n\tgetCustomElementsScopingRules,\n\tgetEffectiveScopingSuffixForTag,\n} from \"./CustomElementsScope.js\";\n\n// Device.ts\nimport {\n\tsupportsTouch,\n\tisSafari,\n\tisChrome,\n\tisFirefox,\n\tisPhone,\n\tisTablet,\n\tisDesktop,\n\tisCombi,\n\tisIOS,\n\tisAndroid,\n} from \"./Device.js\";\n\n// EventProvider.ts\nimport EventProvider from \"./EventProvider.js\";\n\n// i18nBundle.ts\nimport I18nBundle, { getI18nBundle, registerCustomI18nBundleGetter } from \"./i18nBundle.js\";\n\n// MediaRange.ts\nimport MediaRange from \"./MediaRange.js\";\n\n// Render.ts\nimport {\n\trenderDeferred,\n\trenderImmediately,\n\tcancelRender,\n\trenderFinished,\n} from \"./Render.js\";\n\n// Theming.ts\nimport { addCustomCSS, attachThemeLoaded, detachThemeLoaded } from \"./Theming.js\";\n\n// UI5Element.ts\nimport UI5Element from \"./UI5Element.js\";\n\nexport default UI5Element;\nexport {\n\t// drag and drop\n\tstartMultipleDrag,\n\n\t// animations/\n\tscroll,\n\tslideDown,\n\tslideUp,\n\n\t// config/\n\tgetAnimationMode,\n\tsetAnimationMode,\n\tgetCalendarType,\n\tgetFirstDayOfWeek,\n\tgetLegacyDateCalendarCustomizing,\n\tsetDefaultIconCollection,\n\tgetDefaultIconCollection,\n\tgetEffectiveIconCollection,\n\tRegisteredIconCollection,\n\tgetLanguage,\n\tsetLanguage,\n\tgetDefaultLanguage,\n\tsetFetchDefaultLanguage,\n\tgetFetchDefaultLanguage,\n\tgetNoConflict,\n\tsetNoConflict,\n\tgetTheme,\n\tsetTheme,\n\tgetDefaultTheme,\n\n\t// decorators/\n\tcustomElement,\n\tevent,\n\tproperty,\n\tslot,\n\tslotStrict,\n\n\t// delegate/\n\tItemNavigation,\n\tResizeHandler,\n\tScrollEnablement,\n\n\t// locale/\n\tapplyDirection,\n\tattachDirectionChange,\n\tdetachDirectionChange,\n\tgetEffectiveDir,\n\tattachLanguageChange,\n\tdetachLanguageChange,\n\n\t// util/\n\tURLListValidator,\n\tsanitizeHTML,\n\n\t// Assets.ts\n\tregisterI18nLoader,\n\tregisterLocaleDataLoader,\n\tregisterThemePropertiesLoader,\n\tregisterIconLoader,\n\n\t// Boot.ts\n\tattachBoot,\n\n\t// CustomElementsScope.ts\n\tsetCustomElementsScopingSuffix,\n\tgetCustomElementsScopingSuffix,\n\tsetCustomElementsScopingRules,\n\tgetCustomElementsScopingRules,\n\tgetEffectiveScopingSuffixForTag,\n\n\t// Device.ts\n\tsupportsTouch,\n\tisSafari,\n\tisChrome,\n\tisFirefox,\n\tisPhone,\n\tisTablet,\n\tisDesktop,\n\tisCombi,\n\tisIOS,\n\tisAndroid,\n\n\t// EventProvider.ts\n\tEventProvider,\n\n\t// i18nBundle.ts\n\tI18nBundle,\n\tgetI18nBundle,\n\tregisterCustomI18nBundleGetter,\n\n\t// MediaRange.ts\n\tMediaRange,\n\n\t// Render.ts\n\trenderDeferred,\n\trenderImmediately,\n\tcancelRender,\n\trenderFinished,\n\n\t// Theming.ts\n\taddCustomCSS,\n\tattachThemeLoaded,\n\tdetachThemeLoaded,\n\n\t// UI5Element.ts\n\tUI5Element,\n};\n\ntype TargetedCustomEvent<D, T> = Omit<CustomEvent<D>, \"currentTarget\"> & { currentTarget: T };\n// export type UI5NativeEvent<T extends keyof HTMLElementTagNameMap, N> = Parameters<JSX.IntrinsicElements[T][N]>[0];\nexport type UI5CustomEvent<T extends UI5Element, N extends keyof T[\"eventDetails\"]> = TargetedCustomEvent<T[\"eventDetails\"][N], T>;\nexport type JsxTemplateResult = JSX.Element | void;\nexport type JsxTemplate = () => JsxTemplateResult;\n\nexport type * from \"./types.d.ts\";\nexport type * from \"./jsx-runtime.d.ts\";\n"]}
|
package/dist/prod/UI5Element.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import"@ui5/webcomponents-base/dist/ssr-dom.js";import F from"./thirdparty/merge.js";import{boot as N}from"./Boot.js";import k from"./UI5ElementMetadata.js";import S from"./EventProvider.js";import x from"./updateShadowRoot.js";import{shouldIgnoreCustomElement as V}from"./IgnoreCustomElements.js";import{renderDeferred as j,renderImmediately as H,cancelRender as $}from"./Render.js";import{registerTag as z,isTagRegistered as B,recordTagRegistrationFailure as K}from"./CustomElementsRegistry.js";import{observeDOMNode as q,unobserveDOMNode as W}from"./DOMObserver.js";import{skipOriginalEvent as X}from"./config/NoConflict.js";import Y from"./locale/getEffectiveDir.js";import{kebabToCamelCase as m,camelToKebabCase as J,kebabToPascalCase as w}from"./util/StringHelper.js";import P from"./util/isValidPropertyName.js";import{getSlotName as G,getSlottedNodesList as D}from"./util/SlotsHelper.js";import Q from"./util/arraysAreEqual.js";import{markAsRtlAware as Z}from"./locale/RTLAwareRegistry.js";import tt from"./renderer/executeTemplate.js";import{shouldScopeCustomElement as T}from"./CustomElementsScopeUtils.js";import{updateFormValue as et,setFormValue as A}from"./features/InputElementsFormSupport.js";import{getI18nBundle as nt}from"./i18nBundle.js";import{fetchCldr as st}from"./asset-registries/LocaleData.js";import M from"./locale/getLocale.js";import{getLanguageChangePending as ot}from"./config/Language.js";let it=0;const R=new Map,I=new Map,O={fromAttribute(c,f){return f===Boolean?c!==null:f===Number?c===null?void 0:parseFloat(c):c},toAttribute(c,f){return f===Boolean?c?"":null:f===Object||f===Array||c==null?null:String(c)}};function y(c){this._suppressInvalidation||this.constructor.getMetadata().isLanguageAware()&&ot()||(this.onInvalidation(c),this._changedState.push(c),j(this),this._invalidationEventProvider.fireEvent("invalidate",{...c,target:this}))}function at(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 S,this._componentStateFinalizedEventProvider=new S;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_${++it}`),this.__id}render(){const t=this.constructor.template;return tt(t,this)}async connectedCallback(){const t=this.constructor;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,this._inDOM&&(H(this),this._domRefReadyPromise._deferredResolve(),this._fullyConnected=!0,this.onEnterDOM())}disconnectedCallback(){const e=this.constructor.getMetadata().slotsAreManaged();this._inDOM=!1,e&&this._stopObservingDOMChildren(),this._fullyConnected&&(this.onExitDOM(),this._fullyConnected=!1),this._domRefReadyPromise._deferredResolve(),$(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};q(this,this._processChildren.bind(this),o)}_stopObservingDOMChildren(){W(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,u]of Object.entries(e)){const d=u.propertyName||l;a.set(d,l),o.set(d,[...this._state[d]]),this._clearSlot(l,u)}const r=new Map,i=new Map,h=n.map(async(l,u)=>{const d=G(l),g=e[d];if(g===void 0){if(d!=="default"){const p=Object.keys(e).join(", ");console.warn(`Unknown slotName: ${d}, ignoring`,l,`Valid values are: ${p}`)}return}if(g.individualSlots){const p=(r.get(d)||0)+1;r.set(d,p),l._individualSlot=`${d}-${p}`}if(l instanceof HTMLElement){const p=l.localName;if(p.includes("-")&&!V(p)){if(!customElements.get(p)){const L=customElements.whenDefined(p);let E=R.get(p);E||(E=new Promise(U=>setTimeout(U,1e3)),R.set(p,E)),await Promise.race([L,E])}customElements.upgrade(l)}}if(l=t.getMetadata().constructor.validateSlotValue(l,g),v(l)&&g.invalidateOnChildChange){const p=this._getChildChangeListener(d);l.attachInvalidate.call(l,p)}l instanceof HTMLSlotElement&&this._attachSlotChange(l,d,!!g.invalidateOnChildChange);const C=g.propertyName||d;i.has(C)?i.get(C).push({child:l,idx:u}):i.set(C,[{child:l,idx:u}])});await Promise.all(h),i.forEach((l,u)=>{this._state[u]=l.sort((d,g)=>d.idx-g.idx).map(d=>d.child),this._state[m(u)]=this._state[u]});let _=!1;for(const[l,u]of Object.entries(e)){const d=u.propertyName||l;Q(o.get(d),this._state[d])||(y.call(this,{type:"slot",name:a.get(d),reason:"children"}),_=!0,t.getMetadata().isFormAssociated()&&A(this))}_||y.call(this,{type:"slot",name:"default",reason:"textcontent"})}_clearSlot(t,e){const s=e.propertyName||t;this._state[s].forEach(o=>{if(v(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)&&y.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??O).fromAttribute(s,i.type),this[r]=n}}formAssociatedCallback(){this.constructor.getMetadata().isFormAssociated()&&et(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],a=J(t),i=(o.converter||O).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(v(i)){const h=this._getChildChangeListener(e);i.detachInvalidate.call(i,h)}});const r=D([t]);this._slotsAssignedNodes.set(t,r),r.forEach(i=>{if(v(i)){const h=this._getChildChangeListener(e);i.attachInvalidate.call(i,h)}})}})}_detachSlotChange(t,e){t.removeEventListener("slotchange",this._getSlotChangeListener(e))}_onSlotChange(t){y.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()&&x(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(X(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 Z(this.constructor),Y(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(T);return T(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)){P(n)||console.warn(`"${n}" is not a valid property name. Use a name that does not collide with DOM APIs`);const a=at(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(h){const _=this.constructor,l=i?i.call(this):this._state[n];if(l!==h){if(r?r.call(this,h):this._state[n]=h,y.call(this,{type:"property",name:n,newValue:h,oldValue:l}),this._rendered){const d=i?i.call(this):this._state[n];this._updateAttribute(n,d)}_.getMetadata().isFormAssociated()&&A(this)}}})}if(e){const n=this.getMetadata().getSlots();for(const[o,a]of Object.entries(n)){P(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);I.set(this,t)}static getUniqueDependencies(){return I.has(this)||this.cacheUniqueDependencies(),I.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 nt(e)}))}static fetchCLDR(){return this.getMetadata().needsCLDR()?st(M().getLanguage(),M().getRegion(),M().getScript()):Promise.resolve()}static{this.i18nBundleStorage={}}static get i18nBundles(){return this.i18nBundleStorage}static define(){const t=async()=>{await N();const o=await Promise.all([this.fetchI18nBundles(),this.fetchCLDR(),this.onDefine()]),[a]=o;Object.entries(this.getMetadata().getI18n()).forEach((r,i)=>{const h=r[1].bundleName;this.i18nBundleStorage[h]=a[i]}),this.asyncFinished=!0};this.definePromise=t();const e=this.getMetadata().getTag(),s=B(e),n=customElements.get(e);return n&&!s?K(e):n||(this._generateAccessors(),z(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=F({},...t);return this._metadata=new k(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 v=c=>"isUI5Element"in c;export default b;export{v as instanceOfUI5Element};
|
|
1
|
+
"use strict";import"@ui5/webcomponents-base/dist/ssr-dom.js";import F from"./thirdparty/merge.js";import{boot as N}from"./Boot.js";import x from"./UI5ElementMetadata.js";import b from"./EventProvider.js";import V from"./updateShadowRoot.js";import{shouldIgnoreCustomElement as j}from"./IgnoreCustomElements.js";import{renderDeferred as H,renderImmediately as $,cancelRender as z}from"./Render.js";import{registerTag as B,isTagRegistered as K,recordTagRegistrationFailure as q}from"./CustomElementsRegistry.js";import{observeDOMNode as W,unobserveDOMNode as X}from"./DOMObserver.js";import{skipOriginalEvent as Y}from"./config/NoConflict.js";import J from"./locale/getEffectiveDir.js";import{kebabToCamelCase as m,camelToKebabCase as G,kebabToPascalCase as P}from"./util/StringHelper.js";import T from"./util/isValidPropertyName.js";import{getSlotName as w,getSlottedNodesList as D}from"./util/SlotsHelper.js";import Q from"./util/arraysAreEqual.js";import{markAsRtlAware as Z}from"./locale/RTLAwareRegistry.js";import tt from"./renderer/executeTemplate.js";import{shouldScopeCustomElement as A}from"./CustomElementsScopeUtils.js";import{updateFormValue as et,setFormValue as R}from"./features/InputElementsFormSupport.js";import{getI18nBundle as nt}from"./i18nBundle.js";import{fetchCldr as st}from"./asset-registries/LocaleData.js";import C from"./locale/getLocale.js";import{getLanguageChangePending as ot}from"./config/Language.js";import at from"./util/createInstanceChecker.js";let it=0;const O=new Map,M=new Map,L={fromAttribute(c,f){return f===Boolean?c!==null:f===Number?c===null?void 0:parseFloat(c):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()&&ot()||(this.onInvalidation(c),this._changedState.push(c),H(this),this._invalidationEventProvider.fireEvent("invalidate",{...c,target:this}))}function rt(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_${++it}`),this.__id}render(){const t=this.constructor.template;return tt(t,this)}async connectedCallback(){const t=this.constructor;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,this._inDOM&&($(this),this._domRefReadyPromise._deferredResolve(),this._fullyConnected=!0,this.onEnterDOM())}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(),z(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};W(this,this._processChildren.bind(this),o)}_stopObservingDOMChildren(){X(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,i=new Map;for(const[l,h]of Object.entries(e)){const d=h.propertyName||l;i.set(d,l),o.set(d,[...this._state[d]]),this._clearSlot(l,h)}const r=new Map,a=new Map;n.forEach((l,h)=>{const d=w(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;a.has(_)?a.get(_).push({child:l,idx:h}):a.set(_,[{child:l,idx:h}])}),a.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=w(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("-")&&!j(p)){if(!customElements.get(p)){const U=customElements.whenDefined(p);let E=O.get(p);E||(E=new Promise(k=>setTimeout(k,1e3)),O.set(p,E)),await Promise.race([U,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;Q(o.get(d),this._state[d])||(g.call(this,{type:"slot",name:i.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 i=this._getChildChangeListener(t);o.detachInvalidate.call(o,i)}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(),i=t.replace(/^ui5-/,""),r=m(i);if(o.hasOwnProperty(r)){const a=o[r];n=(a.converter??L).fromAttribute(s,a.type),this[r]=n}}formAssociatedCallback(){this.constructor.getMetadata().isFormAssociated()&&et(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],i=G(t),a=(o.converter||L).toAttribute(e,o.type);this._doNotSyncAttributes.add(i),a==null?this.removeAttribute(i):this.setAttribute(i,a),this._doNotSyncAttributes.delete(i)}_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 i=this._slotsAssignedNodes.get(t);i&&i.forEach(a=>{if(y(a)){const u=this._getChildChangeListener(e);a.detachInvalidate.call(a,u)}});const r=D([t]);this._slotsAssignedNodes.set(t,r),r.forEach(a=>{if(y(a)){const u=this._getChildChangeListener(e);a.attachInvalidate.call(a,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()&&V(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),i=P(t);return i!==t?o&&this._fireEvent(i,e,s,n):o}fireDecoratorEvent(t,e){const s=this.getEventData(t),n=s?s.cancelable:!1,o=s?s.bubbles:!1,i=this._fireEvent(t,e,n,o),r=P(t);return r!==t?i&&this._fireEvent(r,e,n,o):i}_fireEvent(t,e,s=!1,n=!0){const o=new CustomEvent(`ui5-${t}`,{detail:e,composed:!1,bubbles:n,cancelable:s}),i=this.dispatchEvent(o);if(Y(t))return i;const r=new CustomEvent(t,{detail:e,composed:!1,bubbles:n,cancelable:s});return this.dispatchEvent(r)&&i}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 Z(this.constructor),J(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)){T(n)||console.warn(`"${n}" is not a valid property name. Use a name that does not collide with DOM APIs`);const i=rt(t,n);let r;i?.set&&(r=i.set);let a;i?.get&&(a=i.get),Object.defineProperty(t,n,{get(){return a?a.call(this):this._state[n]},set(u){const v=this.constructor,l=a?a.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=a?a.call(this):this._state[n];this._updateAttribute(n,d)}v.getMetadata().isFormAssociated()&&R(this)}}})}if(e){const n=this.getMetadata().getSlots();for(const[o,i]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=i.propertyName||o,a={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,a),r!==m(r)&&Object.defineProperty(t,m(r),a)}}}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 nt(e)}))}static fetchCLDR(){return this.getMetadata().needsCLDR()?st(C().getLanguage(),C().getRegion(),C().getScript()):Promise.resolve()}static{this.i18nBundleStorage={}}static get i18nBundles(){return this.i18nBundleStorage}static define(){const t=async()=>{await N();const o=await Promise.all([this.fetchI18nBundles(),this.fetchCLDR(),this.onDefine()]),[i]=o;Object.entries(this.getMetadata().getI18n()).forEach((r,a)=>{const u=r[1].bundleName;this.i18nBundleStorage[u]=i[a]}),this.asyncFinished=!0};this._definePromise=t();const e=this.getMetadata().getTag(),s=K(e),n=customElements.get(e);return n&&!s?q(e):n||(this._generateAccessors(),B(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=F({},...t);return this._metadata=new x(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=at("isUI5Element");export default S;export{y as instanceOfUI5Element};
|
|
2
2
|
//# sourceMappingURL=UI5Element.js.map
|