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

mokihi-js

v1.0.1

Published

An opensource package for ExtJS 6.2.0 GPL bundled with a collection of useful component wrapper functions.

Downloads

9

Readme

mokihi-js

MōkihiJS

npm version npm downloads npm downloads npm downloads npm downloads node contributors stars commits last commit License

An opensource package for ExtJS 6.2.0 GPL bundled with a collection of useful component wrapper functions.

This is the continuation of KonyvtarJS, bundled together with ExtJS 6.2.0 GPL instead of having it as another external lib, this package aims to provide both ExtJS 6.2.0 GPL and functionalities of KonyvtarJS as a single package for easy setup and ease of use.

Quickstart

Installation

$ npm install --save mokihi-js

Usage (NPM):

const Mokihi = require('mokihi-js');

Example (Using express and express-es6-template-engine):

@app.js

const express = require('express');
const es6Renderer = require('express-es6-template-engine');
const MokihiSetup = require('mokihi-js').setup;
const Mokihi = require('mokihi-js').core;

const app = express();

app.engine('html', es6Renderer);
app.set('views', 'views');
app.set('view engine', 'html');

app.get('/', function (req, res) {
    res.render('template', {
        locals: {
            MokihiCss: MokihiSetup.loadExtJsCss(),
            MokihiScript: MokihiSetup.loadExtJsScript(),
            Mokihi
        }
    });
});

app.listen(3000);

@template.html

<!DOCTYPE html>
<html>
<head>
    <style> ${MokihiCss} </style>
    <script type="text/javascript"> ${MokihiScript} </script>
    <script type="text/javascript"> var Mokihi = ${Mokihi}; </script>
</head>
<body>
</body>
</html>

Running Tests

DISCLAIMER

Available test cases are those that can be tested on the backend when calling Mokihi as an object, some functionalities dont have test cases since it is required to render a UI to load the ExtJS since it is a client side library and it does not support server side rendering.

Hence this package may or may not contain any bug upon release, if you ever encountered a bug please do report it immediately by creating an issue, or feel free to make a contribution instead.

$ npm test

Documentation

Table of Contents

Features

Component

  • query
/**
 * * Sample Usage:
 *
 * * @View
 * * {
 * *    xtype: 'button',
 * *    reference: 'sample-button'
 * * }
 *
 * * @Controller
 * * Mokihi.component.query('button[reference = sample-button]');
 *
 * @param {string} queryString
 */
Mokihi.component.query(queryString);
  • reference
/**
 * * Sample Usage:
 *
 * * @View
 * * {
 * *    xtype: 'button',
 * *    reference: 'sample-button'
 * * }
 *
 * * @Controller
 * * Mokihi.component.reference('button', 'sample-button');
 *
 * @param {string} component
 * @param {string} reference
 */
Mokihi.component.reference(component, reference);

Ajax

  • request
/**
 * * Sample Usage:
 *
 * * @Controller
 * * Mokihi.ajax.request('/login', 'POST', { user: john, pass: doe }, function (){}, function (){}, false);
 *
 * @param {string} url
 * @param {string} method
 * @param {object} params
 * @param {function} sucessCallback
 * @param {function} failureCallback
 * @param {boolean} async
 */
Mokihi.ajax.request(url, method, params, sucessCallback, failureCallback, async);
  • get
/**
 * * Sample Usage:
 *
 * * @Controller
 * * Mokihi.ajax.get('/login', { user: john, pass: doe }, function (){}, function (){}, false);
 *
 * @param {string} url
 * @param {object} params
 * @param {function} sucessCallback
 * @param {function} failureCallback
 * @param {boolean} async
 */
Mokihi.ajax.get(url, params, sucessCallback, failureCallback, async);
  • post
/**
 * * Sample Usage:
 *
 * * @Controller
 * * Mokihi.ajax.post('/login', { user: john, pass: doe }, function (){}, function (){}, false);
 *
 * @param {string} url
 * @param {object} params
 * @param {function} sucessCallback
 * @param {function} failureCallback
 * @param {boolean} async
 */
Mokihi.ajax.post(url, params, sucessCallback, failureCallback, async);
  • put
/**
 * * Sample Usage:
 *
 * * @Controller
 * * Mokihi.ajax.put('/login', { user: john, pass: doe }, function (){}, function (){}, false);
 *
 * @param {string} url
 * @param {object} params
 * @param {function} sucessCallback
 * @param {function} failureCallback
 * @param {boolean} async
 */
Mokihi.ajax.put(url, params, sucessCallback, failureCallback, async);
  • delete
/**
 * * Sample Usage:
 *
 * * @Controller
 * * Mokihi.ajax.delete('/login', { user: john, pass: doe }, function (){}, function (){}, false);
 *
 * @param {string} url
 * @param {object} params
 * @param {function} sucessCallback
 * @param {function} failureCallback
 * @param {boolean} async
 */
Mokihi.ajax.delete(url, params, sucessCallback, failureCallback, async);

Url

  • convertObjectToQuery
/**
 * * Sample Usage:
 *
 * * @Controller
 * * Mokihi.url.convertObjectToQuery({ user: john, pass: doe });
 *
 * @param {object} params
 */
Mokihi.url.convertObjectToQuery(params);

Button

  • get
/**
 * * Sample Usage:
 *
 * * @View
 * * {
 * *    xtype: 'button',
 * *    reference: 'sample-button'
 * * }
 *
 * * @Controller
 * * Mokihi.button.get('sample-button');
 *
 * @param {string} reference
 */
Mokihi.button.get(reference);
  • disable
/**
 * * Sample Usage:
 *
 * * @View
 * * {
 * *    xtype: 'button',
 * *    reference: 'sample-button'
 * * }
 *
 * * @Controller
 * * Mokihi.button.disable('sample-button');
 *
 * @param {string} reference
 */
Mokihi.button.disable(reference);
  • enable
/**
 * * Sample Usage:
 *
 * * @View
 * * {
 * *    xtype: 'button',
 * *    reference: 'sample-button'
 * * }
 *
 * * @Controller
 * * Mokihi.button.enable('sample-button');
 *
 * @param {string} reference
 */
Mokihi.button.enable(reference);

Store

  • create
/**
 * * Sample Usage:
 *
 * * @Controller
 * * Mokihi.store.create('/users', { active: true }, grid, true, 25);
 *
 * @param {string} url
 * @param {object} extraParams
 * @param {string} component
 * @param {boolean} autoLoad
 * @param {number} pageSize
 */
Mokihi.store.create(url, extraParams, component, autoLoad, pageSize);
  • tree
/**
 * * Sample Usage:
 *
 * * @Controller
 * * Mokihi.store.tree('/menus', { userId: 2 }, grid, true, true);
 *
 * @param {string} url
 * @param {object} extraParams
 * @param {string} component
 * @param {boolean} autoLoad
 * @param {boolean} folderSort
 */
Mokihi.store.tree(url, extraParams, component, autoLoad, folderSort);
  • local
/**
 * * Sample Usage:
 *
 * * @Controller
 * * var employees = [
 * *    { name: 'John Doe' },
 * *    { name: 'Jane Doe' }
 * * ];
 * * Mokihi.store.local(employees);
 *
 * @param {array} records
 */
Mokihi.store.local(records);

Combobox

  • get
/**
 * * Sample Usage:
 *
 * * @View
 * * {
 * *    xtype: 'combobox',
 * *    reference: 'sample-combobox'
 * * }
 *
 * * @Controller
 * * Mokihi.combobox.get('sample-combobox');
 *
 * @param {string} reference
 */
Mokihi.combobox.get(reference);
  • setup
/**
 * * Sample Usage:
 *
 * * @View
 * * {
 * *    xtype: 'combobox',
 * *    reference: 'sample-combobox'
 * * }
 *
 * * @Controller
 * * Mokihi.combobox.setup('sample-combobox', '/contries', { region: southeast });
 *
 * @param {string} reference
 * @param {string} storeUrl
 * @param {object} filters
 */
Mokihi.combobox.setup(reference, storeUrl, filters);
  • getRecordById
/**
 *
 * * @View
 * * {
 * *    xtype: 'combobox',
 * *    reference: 'sample-combobox'
 * * }
 *
 * * @Controller
 * * Sample Usage: Mokihi.combobox.getRecordById('sample-combobox', 2);
 *
 * @param {string} reference
 * @param {number} id
 */
Mokihi.combobox.getRecordById(reference, id);

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Related Projects

You might want to checkout these projects:

  • NchikotaJS - An opensource tech stack composed of ExpressJS, NodeJS, ExtJS.
  • PasserelleJS - An opensource API gateway built with ExpressJS.
  • KonyvtarJS - An opensource library/package of code wrappers for ExtJS 6.2.0 GPL.

Author

Eagan Martin

License

Copyright © 2019, Eagan Martin. Release under the GPL-3.0 License