How to use kpc - 10 common examples

To help you get started, we’ve selected a few kpc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ksc-fe / kpc / components / message / index.spec.js View on Github external
it('set duration', async function() {
        this.enableTimeouts(false);

        Message.info('test', 500);

        const message = getElement('.k-message');
        expect(message.outerHTML).to.matchSnapshot();
        // should not remove when mouseenter
        dispatchEvent(message, 'mouseenter');
        await wait(1000);
        let message1 = getElement('.k-message');
        expect(message1).eql(message);

        dispatchEvent(message, 'mouseleave');
        await wait(300);
        message1 = getElement('.k-message');
        expect(message1).eql(message);

        await wait(700);
        message1 = getElement('.k-message');
github ksc-fe / kpc / components / form / demos / custom / index.jsx View on Github external
import React from 'react';
import {Form, FormItem} from 'kpc/components/form';
import {Input} from 'kpc/components/input';
import {Button} from 'kpc/components/button';
import './index.styl';

// 添加全局规则
Form.addMethod('letter', (value, item, param) => {
    return /^[a-z|A-Z]+$/.test(value);
}, '只能输入字母');

export default class Demo extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            "descriptions": [
                "",
                ""
            ]
        };
        this._onChangeValue = this._onChangeValue.bind(this);
        this.add = this.add.bind(this);
        this.remove = this.remove.bind(this);
    }
github ksc-fe / kpc / components / form / demos / custom / index.js View on Github external
export {default as data} from './index.json';
import Intact from 'intact';
import template from './index.vdt';
import './index.styl'; 

import {Form} from 'kpc/components/form';

// 添加全局规则
Form.addMethod('letter', (value, item, param) => {
    return /^[a-z|A-Z]+$/.test(value);
}, '只能输入字母');

export default class extends Intact {
    @Intact.template()
    static template = template;

    defaults() {
        return {
            descriptions: ['', '']
        }
    }

    add() {
        this.set('descriptions', this.get('descriptions').concat(''));
    }
github ksc-fe / kpc / components / dialog / demos / asyncClose / index.jsx View on Github external
}, () => {
                // if error, don't close dialog
                dialog.hideLoading();
                Message.error('error occured');
            });
        }
github ksc-fe / kpc / components / dialog / demos / asyncClose / index.vue View on Github external
}, () => {
                    // if error, don't close dialog
                    dialog.hideLoading();
                    Message.error('error occured');
                });
            }
github ksc-fe / kpc / components / dialog / demos / asyncClose / index.js View on Github external
}, () => {
                // if error, don't close dialog
                dialog.hideLoading();
                Message.error('error occured');
            });
        }
github ksc-fe / kpc / components / pagination / demos / current / index.js View on Github external
_fetch1(c, current) {
        // fetch data
        this.set('current1', current);
        Message.info(`current page: ${current}`);
    }
github ksc-fe / kpc / components / app / demos / basic / index.js View on Github external
_mount() {
        // 通过container来指明挂载点
        this.app = new App({container: this.refs.container});
    }
github Javey / vdt.js / site / webpack.config.js View on Github external
var webpackConfig = require('kpc/src/webpack.config');
var path = require('path');
var webpack = require('webpack');
// var HtmlWebpackPlugin = require('html-webpack-plugin');

webpackConfig.entry.all = path.resolve(__dirname, './js/app/routes.js');
webpackConfig.output.path = path.resolve(__dirname, './dist');
// webpackConfig.output.filename = '[name].[chunkhash:8].js';
process.disableHardSource = true;
process.disableHMR = true;
webpackConfig.module.rules.push({
    test: /\.json$/,
    loader: 'json-loader'
});
webpackConfig.module.noParse = [
    /node_modules\/benchmark/
];
webpackConfig.module.rules[0].exclude = [
    /node_modules(?!([\/\\]kpc)|([\/\\]misstime))/, 
    /node_modules[\/\\]kpc.*lib/
];
// webpackConfig.plugins = webpackConfig.plugins.filter(item => {
    // return !(item instanceof webpack.optimize.UglifyJsPlugin);
// });
// webpackConfig.plugins.push(
    // new webpack.ProvidePlugin({
        // Intact: 'kpc/src/js/lib/intact',
        // _: 'kpc/src/js/lib/underscore',
    // }),
    // new HtmlWebpackPlugin({
        // template: path.resolve(__dirname, './index.html'),