From ba1e19280c18629ea0ab76f95d73551b7fd1c087 Mon Sep 17 00:00:00 2001 From: Treecat Date: Wed, 31 May 2023 20:39:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=97=A0jira:=20fix:material=20=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/bundle.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/fineui/src/bundle.js b/packages/fineui/src/bundle.js index 7d9f259d1..e1bfd7707 100644 --- a/packages/fineui/src/bundle.js +++ b/packages/fineui/src/bundle.js @@ -11,6 +11,7 @@ Object.assign(_global, { _: fuiExport._, $: fuiExport.$, jQuery: fuiExport.$, + _global, }); Object.assign(_global.BI, fuiExport, injectFn); From f85867bb66463860a797006d12b9ee032083fd1b Mon Sep 17 00:00:00 2001 From: Treecat Date: Mon, 16 Oct 2023 17:17:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?KERNEL-15856=20fix:=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E8=B0=83=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/5.inject.js | 4 + .../platform/web/jquery/jquery.polyfill.js | 96 ------------------- packages/fineui/webpack/attachments.js | 2 - 3 files changed, 4 insertions(+), 98 deletions(-) delete mode 100644 packages/fineui/src/core/platform/web/jquery/jquery.polyfill.js diff --git a/packages/fineui/src/core/5.inject.js b/packages/fineui/src/core/5.inject.js index 0246f2497..1ee1b3173 100644 --- a/packages/fineui/src/core/5.inject.js +++ b/packages/fineui/src/core/5.inject.js @@ -601,3 +601,7 @@ export function getResource(type, config) { } throw new Error("unknown type: [" + type + "] undefined"); } + +export function getClass(xtype) { + return kv[xtype] || serviceInjection[xtype]; +} \ No newline at end of file diff --git a/packages/fineui/src/core/platform/web/jquery/jquery.polyfill.js b/packages/fineui/src/core/platform/web/jquery/jquery.polyfill.js deleted file mode 100644 index d7fb59e75..000000000 --- a/packages/fineui/src/core/platform/web/jquery/jquery.polyfill.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 用于 jquery 在 worker 环境或者 V8 引擎的 polyfill - */ -// import { _global } from "@/core/0.foundation"; - -const _global = globalThis; - -const document = {}; -const fakeElement = Object.create(document); - -Object.assign(document, { - parentNode: null, - nodeType: 9, - head: fakeElement, - body: fakeElement, - ownerDocument: document, - documentElement: document, - toString() { - return "FakeDocument"; - }, - appendChild(child) { - return child; - }, - implementation: { - createHTMLDocument() { - return { - body: { - childNodes: [], - }, - }; - }, - createDocumentFragment() { - return this; - }, - }, - getElementById() { - return fakeElement; - }, - createElement() { - return fakeElement; - }, - createDocumentFragment() { - return this; - }, - cloneNode() { - return this; - }, - getElementsByTagName() { - return [fakeElement]; - }, - getElementsByClassName() { - return [fakeElement]; - }, - setAttribute() { - return null; - }, - getAttribute() { - return null; - }, - removeChild() { - return null; - }, - addEventListener() { - return null; - }, - removeEventListener() { - return null; - }, -}); - -Object.assign(fakeElement, { - nodeType: 1, - style: {}, - ownerDocument: document, - parentNod: fakeElement, - firstChild: fakeElement, - lastChild: fakeElement, - toString() { - return "FakeElement"; - }, -}); - -function polyfillProps(key, obj) { - _global[key] = _global[key] || obj; - if (typeof obj === "object") { - try { - Object.assign(_global[key], obj); - } catch(err) { - // _global[key] 可能只有 get 方法 - } - } -} - -_global.window = _global; -polyfillProps("XMLHttpRequest", function () {}); -polyfillProps("document", document); diff --git a/packages/fineui/webpack/attachments.js b/packages/fineui/webpack/attachments.js index 7e6549d83..286a1ea5d 100644 --- a/packages/fineui/webpack/attachments.js +++ b/packages/fineui/webpack/attachments.js @@ -1,6 +1,5 @@ const { sync, uniq } = require("./utils"); -const jqueryPolyfill = "./src/core/platform/web/jquery/jquery.polyfill.js"; const configJS = "./src/core/platform/web/config.js"; const runtimePolyfill = ["core-js/stable"]; @@ -34,7 +33,6 @@ const fineui = [].concat( ); const fineuiForWorker = [].concat( - jqueryPolyfill, basicAttachmentMap.js_bundle, basicAttachmentMap.ui, basicAttachmentMap.ts From 3995479d53bc38a829a1d5d9357ff73476abde38 Mon Sep 17 00:00:00 2001 From: Treecat Date: Mon, 16 Oct 2023 17:18:47 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Revert=20"=E6=97=A0jira:=20fix:material=20?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E9=97=AE=E9=A2=98"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba1e19280c18629ea0ab76f95d73551b7fd1c087. --- packages/fineui/src/bundle.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/fineui/src/bundle.js b/packages/fineui/src/bundle.js index e1bfd7707..7d9f259d1 100644 --- a/packages/fineui/src/bundle.js +++ b/packages/fineui/src/bundle.js @@ -11,7 +11,6 @@ Object.assign(_global, { _: fuiExport._, $: fuiExport.$, jQuery: fuiExport.$, - _global, }); Object.assign(_global.BI, fuiExport, injectFn);