npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kll_/basic

v0.1.7

Published

Plugin de fonctionnalités de base pour le framework KLL

Downloads

2

Readme

KLL Framework Plugins

This documentation provides an overview of the plugins available for the KLL Framework. Each plugin is designed to extend the functionality of the KLL Framework, providing developers with more tools to create dynamic and interactive web applications.

Available Plugins

1. CreateComponentPlugin

Overview

The CreateComponentPlugin allows developers to dynamically create new components with specified parameters and automatically hydrates them.

Usage

To use this plugin, instantiate it with a reference to your KLL instance. You can then call its action method to create a new component.

Parameters

  • templateName: The name of the template to use for the new component.
  • ctrlName: The name of the controller to bind with the component.
  • id: A unique identifier for the new component.
  • stateAttrs: (Optional) Initial state attributes for the component.

Returns

  • HTMLElement: The newly created and hydrated DOM element.

2. SmartRenderPlugin

Overview

The SmartRenderPlugin injects state into a component and renders it by replacing placeholders with the state object's corresponding values.

Usage

Instantiate the plugin with a reference to your KLL instance. Use the action method to inject and render the state into a specified element.

Parameters

  • element: The HTML element to inject variables and render.
  • state: The state object whose properties will be injected into the component.

Returns

  • This method updates the innerHTML of the element with the injected state values.

3. ManageAttrsPlugin

Overview

The ManageAttrsPlugin provides a powerful way to manage the attributes of an HTML element, including custom data-, kll-, and aria- attributes, as well as handling element state attributes like disabled, checked, and selected.

Usage

After instantiating this plugin with your KLL instance, use its action method on an HTML element to manage its attributes.

Parameters

  • element: The HTML element to manage attributes.

Returns

  • A complex object containing proxies for data, kll, aria, and state attributes, allowing for dynamic management and updates of these attributes on the targeted element.

Installation

To use these plugins, include them in your project alongside the KLL Framework. Ensure that you have a KLL instance created, and then instantiate each plugin with this instance.

//main.js
import { KLL } from '@kll_/core'
import { CreateComponentPlugin, SmartRenderPlugin, ManageAttrsPlugin } from '@kll_/basic'

const config = {
  plugins: [CreateComponentPlugin, SmartRenderPlugin, ManageAttrsPlugin],
}

// Initialize KLL
const app = new KLL(config)