@ui5/webcomponents-base 0.0.0-d9b978d1d → 0.0.0-da0d3eb88
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 +653 -0
- package/README.md +0 -8
- package/config/wdio.conf.cjs +0 -8
- package/dist/.tsbuildinfo +1 -1
- package/dist/Boot.d.ts +3 -2
- package/dist/Boot.js +8 -6
- package/dist/Boot.js.map +1 -1
- package/dist/Device.d.ts +1 -2
- package/dist/Device.js +5 -12
- package/dist/Device.js.map +1 -1
- package/dist/IgnoreCustomElements.d.ts +3 -5
- package/dist/IgnoreCustomElements.js +3 -5
- package/dist/IgnoreCustomElements.js.map +1 -1
- package/dist/InitialConfiguration.d.ts +1 -2
- package/dist/InitialConfiguration.js +1 -5
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/Keys.d.ts +3 -1
- package/dist/Keys.js +5 -1
- package/dist/Keys.js.map +1 -1
- package/dist/ManagedStyles.js +24 -98
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/MediaRange.d.ts +6 -12
- package/dist/MediaRange.js +21 -31
- package/dist/MediaRange.js.map +1 -1
- package/dist/UI5Element.d.ts +36 -54
- package/dist/UI5Element.js +152 -101
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +12 -13
- package/dist/UI5ElementMetadata.js +24 -13
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/asset-registries/Icons.js +1 -1
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/asset-registries/Illustrations.d.ts +1 -0
- package/dist/asset-registries/Illustrations.js +12 -19
- package/dist/asset-registries/Illustrations.js.map +1 -1
- package/dist/asset-registries/LocaleData.js +1 -1
- package/dist/asset-registries/LocaleData.js.map +1 -1
- package/dist/asset-registries/i18n.d.ts +2 -2
- package/dist/asset-registries/i18n.js +2 -2
- package/dist/asset-registries/i18n.js.map +1 -1
- package/dist/asset-registries/util/IconCollectionsByTheme.d.ts +1 -1
- package/dist/asset-registries/util/IconCollectionsByTheme.js +1 -1
- package/dist/asset-registries/util/IconCollectionsByTheme.js.map +1 -1
- package/dist/asset-registries/util/getIconCollectionByTheme.d.ts +3 -3
- package/dist/asset-registries/util/getIconCollectionByTheme.js +3 -3
- package/dist/asset-registries/util/getIconCollectionByTheme.js.map +1 -1
- package/dist/config/AnimationMode.js +2 -1
- package/dist/config/AnimationMode.js.map +1 -1
- package/dist/config/Icons.d.ts +7 -7
- package/dist/config/Icons.js +7 -7
- package/dist/config/Icons.js.map +1 -1
- package/dist/config/Language.d.ts +1 -1
- package/dist/config/Language.js +6 -3
- package/dist/config/Language.js.map +1 -1
- package/dist/config/Theme.d.ts +4 -3
- package/dist/config/Theme.js +13 -6
- package/dist/config/Theme.js.map +1 -1
- package/dist/config/ThemeRoot.d.ts +2 -4
- package/dist/config/ThemeRoot.js +2 -4
- package/dist/config/ThemeRoot.js.map +1 -1
- package/dist/config/Timezone.d.ts +1 -1
- package/dist/config/Timezone.js +1 -1
- package/dist/config/Timezone.js.map +1 -1
- package/dist/css/SystemCSSVars.css +0 -8
- package/dist/decorators/customElement.d.ts +3 -3
- package/dist/decorators/customElement.js +11 -6
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/decorators/event.d.ts +5 -2
- package/dist/decorators/event.js.map +1 -1
- package/dist/decorators.d.ts +5 -0
- package/dist/decorators.js +6 -0
- package/dist/decorators.js.map +1 -0
- package/dist/delegate/ItemNavigation.d.ts +8 -8
- package/dist/delegate/ItemNavigation.js +9 -9
- package/dist/delegate/ItemNavigation.js.map +1 -1
- package/dist/delegate/ResizeHandler.d.ts +4 -6
- package/dist/delegate/ResizeHandler.js +4 -6
- package/dist/delegate/ResizeHandler.js.map +1 -1
- package/dist/features/InputElementsFormSupport.d.ts +18 -0
- package/dist/features/InputElementsFormSupport.js +40 -0
- package/dist/features/InputElementsFormSupport.js.map +1 -0
- package/dist/features/OpenUI5Support.d.ts +0 -2
- package/dist/features/OpenUI5Support.js +6 -21
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/features/patchPatcher.d.ts +11 -0
- package/dist/features/patchPatcher.js +11 -0
- package/dist/features/patchPatcher.js.map +1 -0
- package/dist/features/patchPopup.d.ts +14 -0
- package/dist/features/patchPopup.js +50 -0
- package/dist/features/patchPopup.js.map +1 -0
- package/dist/generated/AssetParameters.js +1 -1
- package/dist/generated/AssetParameters.js.map +1 -1
- package/dist/generated/VersionInfo.js +5 -5
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/i18nBundle.d.ts +1 -3
- package/dist/i18nBundle.js +1 -4
- package/dist/i18nBundle.js.map +1 -1
- package/dist/locale/applyDirection.d.ts +3 -2
- package/dist/locale/applyDirection.js +3 -2
- package/dist/locale/applyDirection.js.map +1 -1
- package/dist/locale/getEffectiveDir.d.ts +1 -1
- package/dist/locale/getEffectiveDir.js +3 -19
- package/dist/locale/getEffectiveDir.js.map +1 -1
- package/dist/renderer/LitRenderer.js +2 -8
- package/dist/renderer/LitRenderer.js.map +1 -1
- package/dist/renderer/directives/style-map.d.ts +13 -0
- package/dist/renderer/directives/style-map.js +59 -59
- package/dist/renderer/directives/style-map.js.map +1 -0
- package/dist/renderer/executeTemplate.d.ts +8 -0
- package/dist/renderer/executeTemplate.js +1 -0
- package/dist/renderer/executeTemplate.js.map +1 -1
- package/dist/sap/base/Log.js +698 -188
- package/dist/sap/base/assert.js +28 -1
- package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
- package/dist/sap/base/security/URLListValidator.js +253 -6
- package/dist/sap/base/security/encodeCSS.js +34 -8
- package/dist/sap/base/security/encodeXML.js +47 -17
- package/dist/sap/base/security/sanitizeHTML.js +35 -13
- package/dist/sap/base/strings/toHex.js +27 -2
- package/dist/sap/base/util/now.js +24 -3
- package/dist/sap/base/util/uid.js +27 -0
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +1 -1
- package/dist/ssr-dom-shim.d.ts +1 -0
- package/dist/ssr-dom-shim.js +12 -0
- package/dist/ssr-dom-shim.js.map +1 -0
- package/dist/ssr-dom.d.ts +0 -0
- package/dist/ssr-dom.js +0 -0
- package/dist/theming/getConstructableStyle.d.ts +1 -1
- package/dist/theming/getConstructableStyle.js +3 -3
- package/dist/theming/getConstructableStyle.js.map +1 -1
- package/dist/theming/getEffectiveStyle.d.ts +1 -1
- package/dist/theming/getEffectiveStyle.js +5 -12
- package/dist/theming/getEffectiveStyle.js.map +1 -1
- package/dist/types/AnimationMode.d.ts +0 -8
- package/dist/types/AnimationMode.js +0 -8
- package/dist/types/AnimationMode.js.map +1 -1
- package/dist/types/AriaHasPopup.d.ts +32 -0
- package/dist/types/AriaHasPopup.js +34 -0
- package/dist/types/AriaHasPopup.js.map +1 -0
- package/dist/types/AriaLandmarkRole.d.ts +79 -0
- package/dist/types/AriaLandmarkRole.js +81 -0
- package/dist/types/AriaLandmarkRole.js.map +1 -0
- package/dist/types/AriaRole.d.ts +27 -0
- package/dist/types/AriaRole.js +29 -0
- package/dist/types/AriaRole.js.map +1 -0
- package/dist/types/CSSColor.d.ts +0 -4
- package/dist/types/CSSColor.js +0 -4
- package/dist/types/CSSColor.js.map +1 -1
- package/dist/types/CSSSize.d.ts +0 -4
- package/dist/types/CSSSize.js +0 -4
- package/dist/types/CSSSize.js.map +1 -1
- package/dist/types/CalendarType.d.ts +0 -9
- package/dist/types/CalendarType.js +0 -9
- package/dist/types/CalendarType.js.map +1 -1
- package/dist/types/DOMReference.d.ts +1 -5
- package/dist/types/DOMReference.js +1 -5
- package/dist/types/DOMReference.js.map +1 -1
- package/dist/types/DataType.d.ts +1 -6
- package/dist/types/DataType.js +1 -6
- package/dist/types/DataType.js.map +1 -1
- package/dist/types/Float.d.ts +0 -3
- package/dist/types/Float.js +0 -3
- package/dist/types/Float.js.map +1 -1
- package/dist/types/Integer.d.ts +0 -3
- package/dist/types/Integer.js +0 -3
- package/dist/types/Integer.js.map +1 -1
- package/dist/types/InvisibleMessageMode.d.ts +0 -6
- package/dist/types/InvisibleMessageMode.js +0 -6
- package/dist/types/InvisibleMessageMode.js.map +1 -1
- package/dist/types/ItemNavigationBehavior.d.ts +0 -6
- package/dist/types/ItemNavigationBehavior.js +0 -6
- package/dist/types/ItemNavigationBehavior.js.map +1 -1
- package/dist/types/MovePlacement.d.ts +20 -0
- package/dist/types/MovePlacement.js +22 -0
- package/dist/types/MovePlacement.js.map +1 -0
- package/dist/types/NavigationMode.d.ts +0 -8
- package/dist/types/NavigationMode.js +0 -8
- package/dist/types/NavigationMode.js.map +1 -1
- package/dist/types/Orientation.d.ts +16 -0
- package/dist/types/Orientation.js +18 -0
- package/dist/types/Orientation.js.map +1 -0
- package/dist/types/ValueState.d.ts +3 -17
- package/dist/types/ValueState.js +3 -17
- package/dist/types/ValueState.js.map +1 -1
- package/dist/types.d.ts +24 -1
- package/dist/types.js.map +1 -1
- package/dist/updateShadowRoot.d.ts +1 -2
- package/dist/updateShadowRoot.js +5 -29
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/InvisibleMessage.js +2 -2
- package/dist/util/InvisibleMessage.js.map +1 -1
- package/dist/util/PopupUtils.d.ts +1 -3
- package/dist/util/PopupUtils.js +1 -15
- package/dist/util/PopupUtils.js.map +1 -1
- package/dist/util/clamp.js +2 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/createLinkInHead.d.ts +1 -1
- package/dist/util/createLinkInHead.js +1 -1
- package/dist/util/createLinkInHead.js.map +1 -1
- package/dist/util/detectNavigatorLanguage.d.ts +2 -2
- package/dist/util/detectNavigatorLanguage.js +6 -1
- package/dist/util/detectNavigatorLanguage.js.map +1 -1
- package/dist/util/dragAndDrop/DragRegistry.d.ts +12 -0
- package/dist/util/dragAndDrop/DragRegistry.js +68 -0
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -0
- package/dist/util/dragAndDrop/findClosestPosition.d.ts +7 -0
- package/dist/util/dragAndDrop/findClosestPosition.js +59 -0
- package/dist/util/dragAndDrop/findClosestPosition.js.map +1 -0
- package/dist/util/dragAndDrop/longDragOverHandler.d.ts +2 -0
- package/dist/util/dragAndDrop/longDragOverHandler.js +25 -0
- package/dist/util/dragAndDrop/longDragOverHandler.js.map +1 -0
- package/dist/util/getClassCopy.d.ts +17 -12
- package/dist/util/getDesigntimePropertyAsArray.d.ts +2 -2
- package/dist/util/getDesigntimePropertyAsArray.js +2 -1
- package/dist/util/getDesigntimePropertyAsArray.js.map +1 -1
- package/index.js +1 -17
- package/package-scripts.cjs +18 -14
- package/package.json +20 -8
- package/src/css/SystemCSSVars.css +0 -8
- package/tsconfig.json +3 -0
- package/.eslintignore +0 -16
- package/.eslintrc.cjs +0 -3
- package/bundle.esm.js +0 -67
- package/dist/CSP.d.ts +0 -30
- package/dist/CSP.js +0 -51
- package/dist/CSP.js.map +0 -1
- package/dist/StaticArea.js +0 -7
- package/dist/StaticArea.js.map +0 -1
- package/dist/StaticAreaItem.d.ts +0 -37
- package/dist/StaticAreaItem.js +0 -102
- package/dist/StaticAreaItem.js.map +0 -1
- package/dist/api.json +0 -1
- package/dist/config/RTL.d.ts +0 -7
- package/dist/config/RTL.js +0 -37
- package/dist/config/RTL.js.map +0 -1
- package/dist/theming/getEffectiveLinksHrefs.d.ts +0 -3
- package/dist/theming/getEffectiveLinksHrefs.js +0 -17
- package/dist/theming/getEffectiveLinksHrefs.js.map +0 -1
- package/dist/theming/preloadLinks.d.ts +0 -3
- package/dist/theming/preloadLinks.js +0 -19
- package/dist/theming/preloadLinks.js.map +0 -1
- package/dist/util/createStyleInHead.d.ts +0 -8
- package/dist/util/createStyleInHead.js +0 -18
- package/dist/util/createStyleInHead.js.map +0 -1
- package/lib/generate-asset-parameters/index.js +0 -27
- package/lib/generate-styles/index.js +0 -31
- package/lib/generate-version-info/index.js +0 -32
- package/src/renderer/directives/style-map.js +0 -72
- package/used-modules.txt +0 -10
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { getUrl } from "../CSP.js";
|
|
2
|
-
import { getFeature } from "../FeaturesRegistry.js";
|
|
3
|
-
const MAX_DEPTH_INHERITED_CLASSES = 10; // TypeScript complains about Infinity and big numbers
|
|
4
|
-
const getEffectiveLinksHrefs = (ElementClass, forStaticArea = false) => {
|
|
5
|
-
const stylesData = ElementClass[forStaticArea ? "staticAreaStyles" : "styles"];
|
|
6
|
-
if (!stylesData) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const stylesDataArray = Array.isArray(stylesData) ? stylesData : [stylesData];
|
|
10
|
-
const openUI5Enablement = getFeature("OpenUI5Enablement");
|
|
11
|
-
if (openUI5Enablement) {
|
|
12
|
-
stylesDataArray.push(openUI5Enablement.getBusyIndicatorStyles());
|
|
13
|
-
}
|
|
14
|
-
return stylesDataArray.flat(MAX_DEPTH_INHERITED_CLASSES).filter(data => !!data).map(data => getUrl(data.packageName, data.fileName));
|
|
15
|
-
};
|
|
16
|
-
export default getEffectiveLinksHrefs;
|
|
17
|
-
//# sourceMappingURL=getEffectiveLinksHrefs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getEffectiveLinksHrefs.js","sourceRoot":"","sources":["../../src/theming/getEffectiveLinksHrefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAKpD,MAAM,2BAA2B,GAAG,EAAE,CAAC,CAAC,sDAAsD;AAE9F,MAAM,sBAAsB,GAAG,CAAC,YAA+B,EAAE,aAAa,GAAG,KAAK,EAAE,EAAE;IACzF,MAAM,UAAU,GAAwB,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAEpG,IAAI,CAAC,UAAU,EAAE;QAChB,OAAO;KACP;IAED,MAAM,eAAe,GAAwB,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAEnG,MAAM,iBAAiB,GAAG,UAAU,CAA2B,mBAAmB,CAAC,CAAC;IACpF,IAAI,iBAAiB,EAAE;QACtB,eAAe,CAAC,IAAI,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,CAAC;KACjE;IAED,OAAO,eAAe,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAE,IAAqB,CAAC,WAAW,EAAG,IAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC1K,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import { getUrl } from \"../CSP.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport type UI5Element from \"../UI5Element.js\";\nimport type OpenUI5Enablement from \"../features/OpenUI5Enablement.js\";\nimport type { ComponentStylesData, StyleDataCSP } from \"../types.js\";\n\nconst MAX_DEPTH_INHERITED_CLASSES = 10; // TypeScript complains about Infinity and big numbers\n\nconst getEffectiveLinksHrefs = (ElementClass: typeof UI5Element, forStaticArea = false) => {\n\tconst stylesData: ComponentStylesData = ElementClass[forStaticArea ? \"staticAreaStyles\" : \"styles\"];\n\n\tif (!stylesData) {\n\t\treturn;\n\t}\n\n\tconst stylesDataArray: ComponentStylesData = Array.isArray(stylesData) ? stylesData : [stylesData];\n\n\tconst openUI5Enablement = getFeature<typeof OpenUI5Enablement>(\"OpenUI5Enablement\");\n\tif (openUI5Enablement) {\n\t\tstylesDataArray.push(openUI5Enablement.getBusyIndicatorStyles());\n\t}\n\n\treturn stylesDataArray.flat(MAX_DEPTH_INHERITED_CLASSES).filter(data => !!data).map(data => getUrl((data as StyleDataCSP).packageName, (data as StyleDataCSP).fileName));\n};\n\nexport default getEffectiveLinksHrefs;\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import getEffectiveLinksHrefs from "./getEffectiveLinksHrefs.js";
|
|
2
|
-
import createLinkInHead from "../util/createLinkInHead.js";
|
|
3
|
-
import { shouldUseLinks, shouldPreloadLinks } from "../CSP.js";
|
|
4
|
-
const preloaded = new Set();
|
|
5
|
-
const preloadLinks = (ElementClass) => {
|
|
6
|
-
if (!shouldUseLinks() || !shouldPreloadLinks()) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const linksHrefs = getEffectiveLinksHrefs(ElementClass, false) || [];
|
|
10
|
-
const staticAreaLinksHrefs = getEffectiveLinksHrefs(ElementClass, true) || [];
|
|
11
|
-
[...linksHrefs, ...staticAreaLinksHrefs].forEach(href => {
|
|
12
|
-
if (!preloaded.has(href)) {
|
|
13
|
-
createLinkInHead(href, { rel: "preload", as: "style" });
|
|
14
|
-
preloaded.add(href);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
export default preloadLinks;
|
|
19
|
-
//# sourceMappingURL=preloadLinks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preloadLinks.js","sourceRoot":"","sources":["../../src/theming/preloadLinks.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/D,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;AAEpC,MAAM,YAAY,GAAG,CAAC,YAA+B,EAAE,EAAE;IACxD,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,kBAAkB,EAAE,EAAE;QAC/C,OAAO;KACP;IAED,MAAM,UAAU,GAAG,sBAAsB,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;IACrE,MAAM,oBAAoB,GAAG,sBAAsB,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAE9E,CAAC,GAAG,UAAU,EAAE,GAAG,oBAAoB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACvD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACzB,gBAAgB,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;YACxD,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACpB;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import getEffectiveLinksHrefs from \"./getEffectiveLinksHrefs.js\";\nimport createLinkInHead from \"../util/createLinkInHead.js\";\nimport { shouldUseLinks, shouldPreloadLinks } from \"../CSP.js\";\nimport type UI5Element from \"../UI5Element.js\";\n\nconst preloaded = new Set<string>();\n\nconst preloadLinks = (ElementClass: typeof UI5Element) => {\n\tif (!shouldUseLinks() || !shouldPreloadLinks()) {\n\t\treturn;\n\t}\n\n\tconst linksHrefs = getEffectiveLinksHrefs(ElementClass, false) || [];\n\tconst staticAreaLinksHrefs = getEffectiveLinksHrefs(ElementClass, true) || [];\n\n\t[...linksHrefs, ...staticAreaLinksHrefs].forEach(href => {\n\t\tif (!preloaded.has(href)) {\n\t\t\tcreateLinkInHead(href, { rel: \"preload\", as: \"style\" });\n\t\t\tpreloaded.add(href);\n\t\t}\n\t});\n};\n\nexport default preloadLinks;\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a <style> tag in the <head> tag
|
|
3
|
-
* @param cssText - the CSS
|
|
4
|
-
* @param attributes - optional attributes to add to the tag
|
|
5
|
-
* @returns {HTMLElement}
|
|
6
|
-
*/
|
|
7
|
-
declare const createStyleInHead: (cssText: string, attributes?: Record<string, string>) => HTMLStyleElement;
|
|
8
|
-
export default createStyleInHead;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a <style> tag in the <head> tag
|
|
3
|
-
* @param cssText - the CSS
|
|
4
|
-
* @param attributes - optional attributes to add to the tag
|
|
5
|
-
* @returns {HTMLElement}
|
|
6
|
-
*/
|
|
7
|
-
const createStyleInHead = (cssText, attributes) => {
|
|
8
|
-
const style = document.createElement("style");
|
|
9
|
-
style.type = "text/css";
|
|
10
|
-
if (attributes) {
|
|
11
|
-
Object.entries(attributes).forEach(pair => style.setAttribute(...pair));
|
|
12
|
-
}
|
|
13
|
-
style.textContent = cssText;
|
|
14
|
-
document.head.appendChild(style);
|
|
15
|
-
return style;
|
|
16
|
-
};
|
|
17
|
-
export default createStyleInHead;
|
|
18
|
-
//# sourceMappingURL=createStyleInHead.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createStyleInHead.js","sourceRoot":"","sources":["../../src/util/createStyleInHead.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAE,UAAmC,EAAE,EAAE;IAClF,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;IAExB,IAAI,UAAU,EAAE;QACf,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;KACxE;IAED,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["/**\n * Creates a <style> tag in the <head> tag\n * @param cssText - the CSS\n * @param attributes - optional attributes to add to the tag\n * @returns {HTMLElement}\n */\nconst createStyleInHead = (cssText: string, attributes?: Record<string, string>) => {\n\tconst style = document.createElement(\"style\");\n\tstyle.type = \"text/css\";\n\n\tif (attributes) {\n\t\tObject.entries(attributes).forEach(pair => style.setAttribute(...pair));\n\t}\n\n\tstyle.textContent = cssText;\n\tdocument.head.appendChild(style);\n\treturn style;\n};\n\nexport default createStyleInHead;\n"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import fs from "fs/promises";
|
|
2
|
-
import assets from "@ui5/webcomponents-tools/assets-meta.js";
|
|
3
|
-
|
|
4
|
-
const fileContent = `const assetParameters = ${JSON.stringify(assets)};
|
|
5
|
-
|
|
6
|
-
const DEFAULT_THEME = assetParameters.themes.default;
|
|
7
|
-
const SUPPORTED_THEMES = assetParameters.themes.all;
|
|
8
|
-
const DEFAULT_LANGUAGE = assetParameters.languages.default;
|
|
9
|
-
const DEFAULT_LOCALE = assetParameters.locales.default;
|
|
10
|
-
const SUPPORTED_LOCALES = assetParameters.locales.all;
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
DEFAULT_THEME,
|
|
14
|
-
SUPPORTED_THEMES,
|
|
15
|
-
DEFAULT_LANGUAGE,
|
|
16
|
-
DEFAULT_LOCALE,
|
|
17
|
-
SUPPORTED_LOCALES,
|
|
18
|
-
};`;
|
|
19
|
-
|
|
20
|
-
const generate = async () => {
|
|
21
|
-
await fs.mkdir("src/generated/", { recursive: true });
|
|
22
|
-
return fs.writeFile("src/generated/AssetParameters.ts", fileContent);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
generate().then(() => {
|
|
26
|
-
console.log("Assets parameters generated.");
|
|
27
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import fs from 'fs/promises';
|
|
2
|
-
import path from "path";
|
|
3
|
-
import CleanCSS from "clean-css";
|
|
4
|
-
|
|
5
|
-
const generate = async () => {
|
|
6
|
-
await fs.mkdir("src/generated/css/", {recursive: true});
|
|
7
|
-
|
|
8
|
-
const files = (await fs.readdir("src/css/")).filter(file => file.endsWith(".css"));
|
|
9
|
-
const filesPromises = files.map(async file => {
|
|
10
|
-
let content = await fs.readFile(path.join("src/css/", file));
|
|
11
|
-
const res = new CleanCSS().minify(`${content}`);
|
|
12
|
-
content = `import type { StyleData } from "../../types.js";
|
|
13
|
-
|
|
14
|
-
const styleData: StyleData = {
|
|
15
|
-
packageName: "@ui5/webcomponents-base",
|
|
16
|
-
fileName: "${file}",
|
|
17
|
-
content: \`${res.styles}\`,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default styleData;
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
return fs.writeFile(path.join("src/generated/css/", `${file}.ts`), content);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
return Promise.all(filesPromises);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
generate().then(() => {
|
|
30
|
-
console.log("Styles files generated.");
|
|
31
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import fs from "fs/promises";
|
|
2
|
-
|
|
3
|
-
const generate = async () => {
|
|
4
|
-
const version = JSON.parse(await fs.readFile("package.json")).version;
|
|
5
|
-
|
|
6
|
-
// Parse version
|
|
7
|
-
const matches = version.match(/^([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/);
|
|
8
|
-
if (!matches) {
|
|
9
|
-
throw new Error("Unsupported version format");
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const isNext = version.match(/[a-f0-9]{9}$/);
|
|
13
|
-
const buildTime = Math.floor(new Date().getTime() / 1000);
|
|
14
|
-
|
|
15
|
-
const fileContent = `const VersionInfo = {
|
|
16
|
-
version: "${version}",
|
|
17
|
-
major: ${matches[1]},
|
|
18
|
-
minor: ${matches[2]},
|
|
19
|
-
patch: ${matches[3]},
|
|
20
|
-
suffix: "${matches[4]}",
|
|
21
|
-
isNext: ${isNext ? "true" : "false"},
|
|
22
|
-
buildTime: ${buildTime},
|
|
23
|
-
};
|
|
24
|
-
export default VersionInfo;`;
|
|
25
|
-
|
|
26
|
-
await fs.mkdir("src/generated/", { recursive: true });
|
|
27
|
-
await fs.writeFile("src/generated/VersionInfo.ts", fileContent);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
generate().then(() => {
|
|
31
|
-
console.log("Version info file generated.");
|
|
32
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2018 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* This is the original style-map.js directive from lit-html 2 with the only difference that "render" is not called even for the first rendering (update is used instead)
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { noChange } from 'lit-html';
|
|
12
|
-
import { directive, Directive, PartType, } from 'lit-html/directive.js';
|
|
13
|
-
class StyleMapDirective extends Directive {
|
|
14
|
-
constructor(partInfo) {
|
|
15
|
-
var _a;
|
|
16
|
-
super(partInfo);
|
|
17
|
-
if (partInfo.type !== PartType.ATTRIBUTE ||
|
|
18
|
-
partInfo.name !== 'style' ||
|
|
19
|
-
((_a = partInfo.strings) === null || _a === void 0 ? void 0 : _a.length) > 2) {
|
|
20
|
-
throw new Error('The `styleMap` directive must be used in the `style` attribute ' +
|
|
21
|
-
'and must be the only part in the attribute.');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
render(styleInfo) {
|
|
25
|
-
return "";
|
|
26
|
-
}
|
|
27
|
-
update(part, [styleInfo]) {
|
|
28
|
-
const { style } = part.element;
|
|
29
|
-
if (this._previousStyleProperties === undefined) {
|
|
30
|
-
this._previousStyleProperties = new Set();
|
|
31
|
-
for (const name in styleInfo) {
|
|
32
|
-
this._previousStyleProperties.add(name);
|
|
33
|
-
}
|
|
34
|
-
// return this.render(styleInfo);
|
|
35
|
-
}
|
|
36
|
-
// Remove old properties that no longer exist in styleInfo
|
|
37
|
-
// We use forEach() instead of for-of so that re don't require down-level
|
|
38
|
-
// iteration.
|
|
39
|
-
this._previousStyleProperties.forEach((name) => {
|
|
40
|
-
// If the name isn't in styleInfo or it's null/undefined
|
|
41
|
-
if (styleInfo[name] == null) {
|
|
42
|
-
this._previousStyleProperties.delete(name);
|
|
43
|
-
if (name.includes('-')) {
|
|
44
|
-
style.removeProperty(name);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
// Note reset using empty string (vs null) as IE11 does not always
|
|
48
|
-
// reset via null (https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style#setting_styles)
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
|
-
style[name] = '';
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
// Add or update properties
|
|
55
|
-
for (const name in styleInfo) {
|
|
56
|
-
const value = styleInfo[name];
|
|
57
|
-
if (value != null) {
|
|
58
|
-
this._previousStyleProperties.add(name);
|
|
59
|
-
if (name.includes('-')) {
|
|
60
|
-
style.setProperty(name, value);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
-
style[name] = value;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return noChange;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export const styleMap = directive(StyleMapDirective);
|
package/used-modules.txt
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Needed files from OpenUI5
|
|
2
|
-
|
|
3
|
-
sap/base/util/now.js
|
|
4
|
-
sap/base/Log.js
|
|
5
|
-
sap/base/assert.js
|
|
6
|
-
sap/base/security/URLListValidator.js
|
|
7
|
-
sap/base/security/sanitizeHTML.js
|
|
8
|
-
sap/base/strings/toHex.js
|
|
9
|
-
sap/base/security/encodeXML.js
|
|
10
|
-
sap/base/security/encodeCSS.js
|