Options
All
  • Public
  • Public/Protected
  • All
Menu

formulize :waxing_crescent_moon:

formula UI generator

NPM

npm version Join the chat at https://gitter.im/KennethanCeyer/PIGNOSE GitHub stars GitHub license

Build Status codecov Coverage Status Test Coverage

Maintainability CodeFactor dependencies Status devDependencies Status

:package: Installation

git

$ git clone [email protected]:KennethanCeyer/formulize

npm

$ npm install formulize

yarn

$ yarn add formulize

:clap: Getting started

This plugin helps you to make formulas WYSWYG UI

this plugin is based metric-parser

demo page

Sample screen

:page_with_curl: Example (basic)

<div id="formulize"></div>

If you want to make UI into #formulize

typescript

import { UI } from 'formulize';

const target = document.getElementById('formulize');
const formulize = new UI(target, {
    ...options
});

const data: Tree = {
    operator: '*',
    operand1: { value: { type: 'unit', unit: 1 } },
    operand2: { value: { type: 'unit', unit: 2 } }
};

formulize.setData(data);

javascript (ES6)

import { UI } from 'formulize';

const target = document.getElementById('formulize');
const formulize = new UI(target, {
    ...options
});

const data = {
    operator: '*',
    operand1: { value: { type: 'unit', unit: 1 } },
    operand2: { value: { type: 'unit', unit: 2 } }
};

formulize.setData(data);

jQuery

$(function() {
    $('#formulize').formulize({
        ...options
    });

    const formulize = $('#formulize').data('$formulize');
    const data = {
        operator: '*',
        operand1: { value: { type: 'unit', unit: 1 } },
        operand2: { value: { type: 'unit', unit: 2 } }
    };

    formulize.setData(data);

    // unrecommended way
    $('#formulize').setData(data);
});

:triangular_flag_on_post: Roadmap

  • [x] support typescript
  • [x] update formula tree parser
  • [x] support reference docs
  • [x] follow clean code philosophy
  • [x] follow object based implementation
  • [x] support UMD module
  • [x] support code qualify tool
  • [x] support automation test environment
  • [x] support scss style file
  • [ ] support multiple themes
  • [ ] support unit code to achieve coverage over 90%
  • [ ] support integration testing with mocking dom in the code-level
  • [ ] support e2e testing
  • [ ] add guideline in Github WIKI
  • [ ] add guideline snippet gist and jsfiddle
  • [ ] add contributor guidelines
  • [ ] support cdn

:mag: License

FOSSA Status

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Type aliases

FormulizeData

FormulizeData: string | number | HTMLElement | JQuery | any

FormulizeEvent

FormulizeEvent: "input"

PipeInsert

PipeInsert: function

Type declaration

PipeParse

PipeParse: function

Type declaration

    • (elem: HTMLElement): any
    • Parameters

      • elem: HTMLElement

      Returns any

Variables

Const _MODULE_VERSION_

_MODULE_VERSION_: "0.0.13" = "0.0.13"

Const global

Const specialCharacters

specialCharacters: string[] = [')', '!', '@', '#', '$', '%', '^', '&', 'x', '(']

Const supportedCharacters

supportedCharacters: (string | number)[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 'x', '*', '/', '.', '+', '-', '%', '^', '(', ')']

Functions

getVersion

  • getVersion(): string

methodBinder

  • methodBinder(this: JQuery, name: string, ...args: any[]): JQuery

pluginBinder

  • pluginBinder(): void

Object literals

Const defaultOptions

defaultOptions: object

id

id: string = "formulize"

text

text: object

error

error: string = "error"

formula

formula: string = "formula"

pass

pass: string = "passed"

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc