From 2e712c47bc34111c9c768ef1aeaf14b777616fa5 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 25 Aug 2021 15:35:06 -0600 Subject: [PATCH] Move the rest of the WebComponents into their own directory to get ready for tests --- api/js/etemplate/Et2Box/Et2Box.ts | 2 +- api/js/etemplate/Et2Button/Et2Button.ts | 2 +- .../etemplate/Et2Button/test/Et2Button.test.ts | 2 +- api/js/etemplate/{ => Et2Date}/Et2Date.ts | 0 .../etemplate/{ => Et2Textarea}/Et2Textarea.ts | 8 ++++---- .../etemplate/{ => Et2Textbox}/Et2Textbox.ts | 8 ++++---- api/js/etemplate/{ => Et2Widget}/Et2Widget.ts | 18 +++++++++--------- api/js/etemplate/et2_core_widget.ts | 2 +- api/js/etemplate/etemplate2.ts | 6 +++--- 9 files changed, 24 insertions(+), 24 deletions(-) rename api/js/etemplate/{ => Et2Date}/Et2Date.ts (100%) rename api/js/etemplate/{ => Et2Textarea}/Et2Textarea.ts (84%) rename api/js/etemplate/{ => Et2Textbox}/Et2Textbox.ts (73%) rename api/js/etemplate/{ => Et2Widget}/Et2Widget.ts (97%) diff --git a/api/js/etemplate/Et2Box/Et2Box.ts b/api/js/etemplate/Et2Box/Et2Box.ts index ccc1a6c444..043059b399 100644 --- a/api/js/etemplate/Et2Box/Et2Box.ts +++ b/api/js/etemplate/Et2Box/Et2Box.ts @@ -10,7 +10,7 @@ import {css, html, LitElement} from "../../../../node_modules/@lion/core/index.js"; -import {Et2Widget} from "../Et2Widget"; +import {Et2Widget} from "../Et2Widget/Et2Widget"; export class Et2Box extends Et2Widget(LitElement) { diff --git a/api/js/etemplate/Et2Button/Et2Button.ts b/api/js/etemplate/Et2Button/Et2Button.ts index 2c378e7d2f..289d491c50 100644 --- a/api/js/etemplate/Et2Button/Et2Button.ts +++ b/api/js/etemplate/Et2Button/Et2Button.ts @@ -13,7 +13,7 @@ import {css, html} from "../../../../node_modules/@lion/core/index.js"; import {LionButton} from "../../../../node_modules/@lion/button/index.js"; import {SlotMixin} from "../../../../node_modules/@lion/core/src/SlotMixin.js"; import {Et2InputWidget} from "../Et2InputWidget/Et2InputWidget"; -import {Et2Widget} from "../Et2Widget"; +import {Et2Widget} from "../Et2Widget/Et2Widget"; export class Et2Button extends Et2InputWidget(Et2Widget(SlotMixin(LionButton))) { diff --git a/api/js/etemplate/Et2Button/test/Et2Button.test.ts b/api/js/etemplate/Et2Button/test/Et2Button.test.ts index 8c51066796..212bd03368 100644 --- a/api/js/etemplate/Et2Button/test/Et2Button.test.ts +++ b/api/js/etemplate/Et2Button/test/Et2Button.test.ts @@ -3,7 +3,7 @@ */ import {assert, fixture} from '@open-wc/testing'; import {Et2Button} from "../Et2Button"; -import type {Et2Widget} from "../../Et2Widget"; +import type {Et2Widget} from "../../Et2Widget/Et2Widget"; import {html} from "lit-element"; import * as sinon from 'sinon'; diff --git a/api/js/etemplate/Et2Date.ts b/api/js/etemplate/Et2Date/Et2Date.ts similarity index 100% rename from api/js/etemplate/Et2Date.ts rename to api/js/etemplate/Et2Date/Et2Date.ts diff --git a/api/js/etemplate/Et2Textarea.ts b/api/js/etemplate/Et2Textarea/Et2Textarea.ts similarity index 84% rename from api/js/etemplate/Et2Textarea.ts rename to api/js/etemplate/Et2Textarea/Et2Textarea.ts index c22ceb479a..037a97c589 100644 --- a/api/js/etemplate/Et2Textarea.ts +++ b/api/js/etemplate/Et2Textarea/Et2Textarea.ts @@ -9,10 +9,10 @@ */ -import {css, html} from "../../../node_modules/@lion/core/index.js" -import {LionTextarea} from "../../../node_modules/@lion/textarea/index.js" -import {Et2InputWidget} from "./Et2InputWidget/Et2InputWidget"; -import {Et2Widget} from "./Et2Widget"; +import {css, html} from "@lion/core" +import {LionTextarea} from "@lion/textarea" +import {Et2InputWidget} from "../Et2InputWidget/Et2InputWidget"; +import {Et2Widget} from "../Et2Widget/Et2Widget"; export class Et2Textarea extends Et2InputWidget(Et2Widget(LionTextarea)) diff --git a/api/js/etemplate/Et2Textbox.ts b/api/js/etemplate/Et2Textbox/Et2Textbox.ts similarity index 73% rename from api/js/etemplate/Et2Textbox.ts rename to api/js/etemplate/Et2Textbox/Et2Textbox.ts index 498f2f89ec..a7692ae29c 100644 --- a/api/js/etemplate/Et2Textbox.ts +++ b/api/js/etemplate/Et2Textbox/Et2Textbox.ts @@ -9,10 +9,10 @@ */ -import {css, html} from "../../../node_modules/@lion/core/index.js" -import {LionInput} from "../../../node_modules/@lion/input/index.js" -import {Et2InputWidget} from "./Et2InputWidget/Et2InputWidget"; -import {Et2Widget} from "./Et2Widget"; +import {css, html} from "@lion/core" +import {LionInput} from "@lion/input" +import {Et2InputWidget} from "../Et2InputWidget/Et2InputWidget"; +import {Et2Widget} from "../Et2Widget/Et2Widget"; export class Et2Textbox extends Et2InputWidget(Et2Widget(LionInput)) { diff --git a/api/js/etemplate/Et2Widget.ts b/api/js/etemplate/Et2Widget/Et2Widget.ts similarity index 97% rename from api/js/etemplate/Et2Widget.ts rename to api/js/etemplate/Et2Widget/Et2Widget.ts index b46c93ef75..7bfa1a2ffb 100644 --- a/api/js/etemplate/Et2Widget.ts +++ b/api/js/etemplate/Et2Widget/Et2Widget.ts @@ -1,14 +1,14 @@ -import {et2_IDOMNode, et2_implements_registry} from "./et2_core_interfaces"; -import {et2_arrayMgr} from "./et2_core_arrayMgr"; -import {et2_attribute_registry, et2_registry, et2_widget} from "./et2_core_widget"; -import type {etemplate2} from "./etemplate2"; -import {et2_compileLegacyJS} from "./et2_core_legacyJSFunctions"; -import {et2_cloneObject, et2_csvSplit} from "./et2_core_common"; +import {et2_IDOMNode, et2_implements_registry} from "../et2_core_interfaces"; +import {et2_arrayMgr} from "../et2_core_arrayMgr"; +import {et2_attribute_registry, et2_registry, et2_widget} from "../et2_core_widget"; +import type {etemplate2} from "../etemplate2"; +import {et2_compileLegacyJS} from "../et2_core_legacyJSFunctions"; +import {et2_cloneObject, et2_csvSplit} from "../et2_core_common"; // @ts-ignore -import type {IegwAppLocal} from "../jsapi/egw_global"; -import {ClassWithAttributes, ClassWithInterfaces} from "./et2_core_inheritance"; +import type {IegwAppLocal} from "../../jsapi/egw_global"; +import {ClassWithAttributes, ClassWithInterfaces} from "../et2_core_inheritance"; import {LitElement} from "@lion/core"; -import type {et2_container} from "./et2_core_baseWidget"; +import type {et2_container} from "../et2_core_baseWidget"; /** * This mixin will allow any LitElement to become an Et2Widget diff --git a/api/js/etemplate/et2_core_widget.ts b/api/js/etemplate/et2_core_widget.ts index 8f55602550..d7e4acf8c8 100644 --- a/api/js/etemplate/et2_core_widget.ts +++ b/api/js/etemplate/et2_core_widget.ts @@ -22,7 +22,7 @@ import {egw, IegwAppLocal} from "../jsapi/egw_global"; import {et2_cloneObject, et2_csvSplit} from "./et2_core_common"; import {et2_compileLegacyJS} from "./et2_core_legacyJSFunctions"; import {et2_IDOMNode, et2_IInputNode} from "./et2_core_interfaces"; -import {loadWebComponent} from "./Et2Widget"; +import {loadWebComponent} from "./Et2Widget/Et2Widget"; // fixing circular dependencies by only importing type import type {et2_container} from "./et2_core_baseWidget"; import type {et2_inputWidget} from "./et2_core_inputWidget"; diff --git a/api/js/etemplate/etemplate2.ts b/api/js/etemplate/etemplate2.ts index b889b95e41..355b84f394 100644 --- a/api/js/etemplate/etemplate2.ts +++ b/api/js/etemplate/etemplate2.ts @@ -25,9 +25,9 @@ import '../jsapi/egw_json.js'; import {egwIsMobile} from "../egw_action/egw_action_common.js"; import './Et2Box/Et2Box'; import './Et2Button/Et2Button'; -import './Et2Date'; -import './Et2Textarea'; -import './Et2Textbox'; +import './Et2Date/Et2Date'; +import './Et2Textarea/Et2Textarea'; +import './Et2Textbox/Et2Textbox'; /* Include all widget classes here, we only care about them registering, not importing anything*/ import './et2_widget_vfs'; // Vfs must be first (before et2_widget_file) due to import cycle import './et2_widget_template';