Skip to content

lsiden/wsc-ng-ledger

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

wsc-ng-ledger

Given an array of [ { desc: 'Item 1', amount: '100' }, ... ] the wsc-ledger directive displays an accounting ledger of items and their corresponding amounts as currency. Item descriptions and amounts are editable.

I designed wsc-ledger to bare-bones with as few dependencies and assumptions as possible.
For example, it does not depend on Bootstrap for styling. It leaves it up to the developer to display and update the total if required and to provide a button to add new items.

Usage

See example.html.

To edit, user clicks on a cell.

To save the edit, user hits Tab or Return or clicks outside the cell.

To abandon an edit and revert to the original value, user hits ESC.

Installation

bower install wsc-ledger

In your HTML file

<script src="./bower_components/wsc-ng-ledger/dist/wsc-ledger.js"></script>

or

<script src="./bower_components/wsc-ng-ledger/dist/wsc-ledger.min.js"></script>

Styling

wsc-ledger provides a minimal stylesheet, dist/wsc-ledger.css that you may link to

<link rel="stylesheet" href="dist/wsc-ledger.css">

or use as a template to write your own.

In order to keep wsc-ledger as independent as possible, I did not include any dependency on Twitter Bootstrap. Instead, wsc-ledger.css makes wsc-ledger responsive by setting a fixed with for the table's second column, while the first column's width is allowed to expand and contract with the width of the table element to fill the remaining space.

License

See LICENSE.md

About

Angular directive for accounting ledger

Resources

License

Stars

Watchers

Forks

Packages

No packages published