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

@pitaya-components/linear-progress

v0.0.6

Published

Pitaya-Framework Component Linear Progress.

Downloads

6

Readme

Description

Pitaya-framework template component.

This documentation assumes you are at least slightly familiar with aurelia and its usage. If not, we highly suggest you take a look at its Quick Start section first to get a better understanding of the approaches that are presented it here.

Screenshot

Screenshot

Demo

MDC Design & API Documentation

Installation

npm install @pitaya-components/master-component --save

Basic Usage

Import

You have a few options when importing a component into your layout:

Template
<template>
	<require from="@pitaya-components/master-component/dist/native-modules/master-component"></require>
    ...
</template>
View model
@viewResources( "@pitaya-components/master-component/dist/native-modules/master-component" )
export class MyView
{
	...
}
Global resources
export function configure( config: FrameworkConfiguration )
{
	config.globalResources( [
		PLATFORM.moduleName( "@pitaya-components/master-component/dist/native-modules/master-component" )
	] );
}

Initialization

Our components are usually initialized by defining them in your views HTML. And can be accessed afterwards in the corresponding view model.

Template
<template>
	<master-component
		view-model.ref="masterComponent"
		on-attached.call="_masterComponentHasBeenAttached(component)"
	></master-component>
	...
</template>
View model
import {MasterComponent} from "@pitaya-components/master-component";

export class MyView
{
	public component: MasterComponent;

	public doSomething()
	{
		this.component.title = "Bananarama";
	}
}

Variants

Simple component

Put different variants here

<master-component></master-component>

Event handlers

Attaching an event handler is as simple as adding on-<event>.call="<function>(<parameters>)". The function that you specify has to be defined as a method on the view model class, so that aurelias template engine can use it.

Template
<pitaya-button	
	on-click.call="myButtonHasBeenClicked(event)"
>
	BUTTON LABEL
</pitaya-button>
View model
export class MyView
{
	public myButtonHasBeenClicked(event: CustomEvent)
	{
		console.log("Event detail:", event.detail);
	}
}

You also can pass any parameter you like. Specifying event just tells the component that you wish to receive the event object, but if you define something else, it will be passed down to your function just like one would expect.

Template
<pitaya-button	
	on-click.call="myButtonHasBeenClicked('my custom message')"
>
	BUTTON LABEL
</pitaya-button>
View model
export class MyView
{
	public myButtonHasBeenClicked(message: string)
	{
		console.log(message);
	}
}

Bindables

A bindable is part of a core functionality of aurelia which basically allows you to configure a component from within your HTML code. They can be set/accessed via HTML attribute and also programmatically.

Template
<master-component	
	title="Super duper template component"
></master-component>
View model
import {MasterComponent} from "@pitaya-components/master-component";

export class MyView
{
	public component: MasterComponent;
	
	public someMethod()
	{
		this.component.title    = "Super duper template component";
	}
}

Bindable properties

| Attribute / Property | Type | --- | --- | | title | string | on-attached | ( component ) => {}

Methods and properties

| Method Signature | Description | --- | --- | | title: string | Sets the title | onAttached: Function | Sets the onAttached callback | reinitialize() => Promise <void> \| void | Reinitializes the component

Style Customization

SASS mixins

| Mixin | Desciption | --- | --- | | master-component-background | Sets the background color

With this component we are relying on the [PLACEHOLDER] component of MDC. Check out the documentation to learn how to use their SASS mixins.

Dependencies

| Package | Url | | --- | --- | | aurelia-framework | aurelia-framework | | Aurelia-typed-observable-plugin | Aurelia-typed-observable-plugin |

Changes

The main repository uses tagged Releases to communicate changes between versions.

FAQ

Q: Why another JavaScript framework?
A: Read this article for a detailed overview of ours goals.

Reach Out!

Find us on Twitter for the latest news, and please consider giving us a ?? star on GitHub!

Support

For contributions in the form of bug fixes and changes, feel free to use Pull Requests or send us a DM on Twitter to discuss how best to approach your issue.

License

The Master component source code is licensed under the MIT license.