Giter VIP home page Giter VIP logo

Comments (7)

jahaganiev avatar jahaganiev commented on May 22, 2024 1

Thanks for the input @brandiqa!

We've made online playground demo Preline UI + QWIK here: https://stackblitz.com/edit/preline-qwik?file=tailwind.config.js

Step by step Framework Guides will be available soon with the next update.

Cheers!
Jaha

from preline.

jahaganiev avatar jahaganiev commented on May 22, 2024 1

Hey folks,

We've just shipped v1.9.0 update with Framework Guides for Qwik here. Thanks a lot @brandiqa for the request and sharing your work around solutions.

Cheers!

from preline.

brandiqa avatar brandiqa commented on May 22, 2024

I've realized PartyTown is not applicable in this context since preline.js is a first party script required for the functioning of the web app, hence I've updated the proposal.

I would also suggest having typescript support. Can discuss that on a separate thread

from preline.

Easy-Cloud-in avatar Easy-Cloud-in commented on May 22, 2024

In QWIK @types/preline is required to run properly.

from preline.

brandiqa avatar brandiqa commented on May 22, 2024

In QWIK @types/preline is required to run properly.

Couldn't find the package or code for @types/preline. Kindly clarify what you mean?

from preline.

brandiqa avatar brandiqa commented on May 22, 2024

In regards to TypeScript support, I've come up with a workaround.

I've created the file src/types/preline/index.d.ts within my Qwik project with the following code:

export {};

declare global {
  interface Window {
    HSAccordion: {
      show(accordionEL: HTMLElement): void;
      hide(accordionEL: HTMLElement): void;
    };
    HSCollapse: {
      toggle(collapseEL: HTMLElement): void;
      show(collapseEL: HTMLElement): void;
      hide(collapseEL: HTMLElement): void;
    };
    HSDropdown: {
      open(dropdownEl: HTMLElement): void;
      close(dropdownEl: HTMLElement, noAnimation: boolean): void;
      toggle(dropdownEl: HTMLElement): void;
    };
    HSOverlay: {
      toggle(overlayEL: HTMLElement): void;
      open(overlayEL: HTMLElement): void;
      close(overlayEL: HTMLElement): Promise;
    };
    HSTabs: {
      open(tabToggleEL: HTMLElement): void;
    };
    HSTooltip: {
      show(tooltipEL: HTMLElement): void;
      hide(tooltipEL: HTMLElement): void;
    };
  }
}

Then I've updated tsconfig.json to include the above defintion:

{
  "compilerOptions": {
    "allowJs": true,
    "target": "ES2017",
    "module": "ES2022",
    "lib": ["es2022", "DOM", "WebWorker", "DOM.Iterable"],
    "jsx": "react-jsx",
    "jsxImportSource": "@builder.io/qwik",
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true,
    "moduleResolution": "node",
    "esModuleInterop": true,
    "skipLibCheck": true,
    "incremental": true,
    "isolatedModules": true,
    "outDir": "tmp",
    "noEmit": true,
    "types": ["node", "vite/client", "./src/types/preline"],
    "paths": {
      "~/*": ["./src/*"]
    }
  },
  "files": ["./.eslintrc.cjs"],
  "include": ["src", "./*.d.ts"]
}

VSCode Eslint plugin no longer throws warnings when programmatically calling HS functions. Below is an example of how I've used it in Qwik:

export const closeSidebar = () => {
  const sidebarEl = document.getElementById("application-sidebar");
  if (sidebarEl) window.HSOverlay.close(sidebarEl);
};

from preline.

brandiqa avatar brandiqa commented on May 22, 2024

There's a typo in the description:

"Qwick is an instant-loading framework with minimal overhead"

from preline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.