fixes for transpiling:

- importing Instance and HTMLElementWithValue types only as type
- import flatpicker plugins with: import {default as <PluginName>} from <file>
This commit is contained in:
ralf 2023-03-13 19:41:00 +01:00
parent 43dfaa6bc2
commit f5a1fce8bc
2 changed files with 7 additions and 7 deletions

View File

@ -12,12 +12,12 @@
import {css, html} from "@lion/core"; import {css, html} from "@lion/core";
import 'lit-flatpickr'; import 'lit-flatpickr';
import {dateStyles} from "./DateStyles"; import {dateStyles} from "./DateStyles";
import {Instance} from 'flatpickr/dist/types/instance'; import type {Instance} from 'flatpickr/dist/types/instance';
import "flatpickr/dist/plugins/scrollPlugin.js"; import {default as scrollPlugin} from "flatpickr/dist/plugins/scrollPlugin.js";
import "shortcut-buttons-flatpickr/dist/shortcut-buttons-flatpickr"; import {default as ShortcutButtonsPlugin} from "shortcut-buttons-flatpickr/dist/shortcut-buttons-flatpickr";
import flatpickr from "flatpickr"; import flatpickr from "flatpickr";
import {egw} from "../../jsapi/egw_global"; import {egw} from "../../jsapi/egw_global";
import {HTMLElementWithValue} from "@lion/form-core/types/FormControlMixinTypes"; import type {HTMLElementWithValue} from "@lion/form-core/types/FormControlMixinTypes";
import {Et2Textbox} from "../Et2Textbox/Et2Textbox"; import {Et2Textbox} from "../Et2Textbox/Et2Textbox";
import {Et2ButtonIcon} from "../Et2Button/Et2ButtonIcon"; import {Et2ButtonIcon} from "../Et2Button/Et2ButtonIcon";
import {FormControlMixin} from "@lion/form-core"; import {FormControlMixin} from "@lion/form-core";

View File

@ -11,7 +11,8 @@
import {css} from "@lion/core"; import {css} from "@lion/core";
import {Et2Date} from "./Et2Date"; import {Et2Date} from "./Et2Date";
import {Instance} from "flatpickr/dist/types/instance"; import type {Instance} from "flatpickr/dist/types/instance";
import {default as ShortcutButtonsPlugin} from "shortcut-buttons-flatpickr/dist/shortcut-buttons-flatpickr";
export class Et2DateTime extends Et2Date export class Et2DateTime extends Et2Date
@ -115,7 +116,6 @@ export class Et2DateTime extends Et2Date
*/ */
protected _buttonPlugin() protected _buttonPlugin()
{ {
// @ts-ignore TypeScript can't find ShortcutButtonsPlugin, but rollup does
return ShortcutButtonsPlugin({ return ShortcutButtonsPlugin({
button: [ button: [
{label: this.egw().lang("ok")}, {label: this.egw().lang("ok")},
@ -144,4 +144,4 @@ export class Et2DateTime extends Et2Date
} }
// @ts-ignore TypeScript is not recognizing that Et2DateTime is a LitElement // @ts-ignore TypeScript is not recognizing that Et2DateTime is a LitElement
customElements.define("et2-date-time", Et2DateTime); customElements.define("et2-date-time", Et2DateTime);