From 907aaba725e0fbf2a4fcc525ee8d2c4ca268bebb Mon Sep 17 00:00:00 2001 From: yonghyon Date: Thu, 18 Jul 2024 21:33:26 +0900 Subject: [PATCH] webos3.x progressbar size --- com.twin.app.shoptime/package-lock.json | 3 ++ com.twin.app.shoptime/package.json | 5 +++- .../patches/@enact+ui+3.5.0.patch | 28 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 com.twin.app.shoptime/patches/@enact+ui+3.5.0.patch diff --git a/com.twin.app.shoptime/package-lock.json b/com.twin.app.shoptime/package-lock.json index af233cce..f34a992b 100644 --- a/com.twin.app.shoptime/package-lock.json +++ b/com.twin.app.shoptime/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "shopping-app-2.0", "version": "2.0.0", + "hasInstallScript": true, "license": "UNLICENSED", "dependencies": { "@enact/core": "^3.3.0", @@ -18,6 +19,8 @@ "axios": "^0.21.1", "google-libphonenumber": "^3.2.34", "ilib": "^14.3.0", + "patch-package": "^8.0.0", + "postinstall-postinstall": "^2.1.0", "prop-types": "^15.6.2", "qrcode": "^1.5.3", "raw-loader": "^4.0.2", diff --git a/com.twin.app.shoptime/package.json b/com.twin.app.shoptime/package.json index bc83431d..e4f5041a 100644 --- a/com.twin.app.shoptime/package.json +++ b/com.twin.app.shoptime/package.json @@ -13,7 +13,8 @@ "lint": "enact lint .", "license": "enact license", "test": "enact test", - "test-watch": "enact test --watch" + "test-watch": "enact test --watch", + "postinstall": "patch-package" }, "license": "UNLICENSED", "private": true, @@ -42,6 +43,8 @@ "axios": "^0.21.1", "google-libphonenumber": "^3.2.34", "ilib": "^14.3.0", + "patch-package": "^8.0.0", + "postinstall-postinstall": "^2.1.0", "prop-types": "^15.6.2", "qrcode": "^1.5.3", "raw-loader": "^4.0.2", diff --git a/com.twin.app.shoptime/patches/@enact+ui+3.5.0.patch b/com.twin.app.shoptime/patches/@enact+ui+3.5.0.patch new file mode 100644 index 00000000..9cefb3c6 --- /dev/null +++ b/com.twin.app.shoptime/patches/@enact+ui+3.5.0.patch @@ -0,0 +1,28 @@ +diff --git a/node_modules/@enact/ui/useScroll/Scrollbar.js b/node_modules/@enact/ui/useScroll/Scrollbar.js +index 12a810e..d228196 100644 +--- a/node_modules/@enact/ui/useScroll/Scrollbar.js ++++ b/node_modules/@enact/ui/useScroll/Scrollbar.js +@@ -128,8 +128,21 @@ var useScrollbar = function useScrollbar(props) { + scrollbarThumbSizeRatioBase = scrollViewSize / scrollContentSize, + scrollbarThumbProgressRatio = scrollOrigin / (scrollContentSize - scrollViewSize), + scrollbarThumbSizeRatio = Math.max(_resolution["default"].scale(minThumbSize) / trackSize, Math.min(1, scrollbarThumbSizeRatioBase)); +- setCSSVariable(scrollbarTrackRef.current, '--scrollbar-thumb-size-ratio', scrollbarThumbSizeRatio); +- setCSSVariable(scrollbarTrackRef.current, '--scrollbar-thumb-progress-ratio', scrollbarThumbProgressRatio); ++ // setCSSVariable(scrollbarTrackRef.current, '--scrollbar-thumb-size-ratio', scrollbarThumbSizeRatio); ++ // setCSSVariable(scrollbarTrackRef.current, '--scrollbar-thumb-progress-ratio', scrollbarThumbProgressRatio); ++ //for old chrome version ++ const thumb = scrollbarTrackRef.current?.childNodes?.[0]; ++ if(thumb){ ++ const thumbSize = (scrollbarThumbSizeRatio*100)+'%'; ++ const progress = ((1-scrollbarThumbSizeRatio) * scrollbarThumbProgressRatio)*100+'%'; ++ if(vertical){ ++ thumb.style.height = thumbSize; ++ thumb.style.top = progress; ++ }else{ ++ thumb.style.width = thumbSize; ++ thumb.style.left = progress; ++ } ++ } + } + + if (scrollbarHandle) {