How to use the yox.define function in yox

To help you get started, we’ve selected a few yox 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 divawth / bell-ui / src / component / divider / Divider.ts View on Github external
// import './style/Divider.styl'

import {
  FALSE,
  RAW_STRING,
  RAW_BOOLEAN,
  RAW_LEFT,
  RAW_RIGHT,
  RAW_CENTER,
} from '../constant'

import {
  oneOf,
} from '../util'

export default Yox.define({

  template,

  name: '${prefix}Divider',

  propTypes: {
    vertical: {
      type: RAW_BOOLEAN,
      value: FALSE,
    },
    dashed: {
      type: RAW_BOOLEAN,
      value: FALSE,
    },
    align: {
      type: oneOf([RAW_CENTER, RAW_LEFT, RAW_RIGHT]),
github divawth / bell-ui / src / component / exception / Exception.ts View on Github external
import Yox from 'yox'

import template from './template/Exception.hbs'
// import './style/Exception.styl'

import {
  RAW_STRING,
} from '../constant'

import {
  oneOf,
} from '../util'

export default Yox.define({

  template,

  name: '${prefix}Exception',

  propTypes: {
    title: {
      type: RAW_STRING,
    },
    subTitle: {
      type: RAW_STRING,
    },
    status: {
      type: oneOf([403, 404, 500]),
    },
    className: {
github divawth / bell-ui / src / component / tabs / Tabs.ts View on Github external
RAW_BOOLEAN,
  RAW_DEFAULT,
} from '../constant'

import {
  oneOf,
} from '../util'

interface Tab {
  name: string,
  icon: string,
  label: string,
  disabled: boolean,
}

export default Yox.define({

  template,

  name: '${prefix}Tabs',

  propTypes: {
    type: {
      type: oneOf(['card']),
    },
    size: {
      type: oneOf([RAW_DEFAULT, RAW_SMALL, RAW_LARGE]),
      value: RAW_DEFAULT,
    },
    closable: {
      type: RAW_BOOLEAN,
      value: FALSE,
github divawth / bell-ui / dist / components / divider / Divider.js View on Github external
import Yox from 'yox';
import template from './template/Divider.hbs';
import { FALSE, RAW_STRING, RAW_BOOLEAN, RAW_LEFT, RAW_RIGHT, RAW_CENTER, RAW_VERTICAL, RAW_HORIZONTAL, } from '../constant';
import { oneOf, } from '../util';
export default Yox.define({
    propTypes: {
        type: {
            type: oneOf([RAW_HORIZONTAL, RAW_VERTICAL]),
            value: RAW_HORIZONTAL
        },
        dashed: {
            type: RAW_BOOLEAN,
            value: FALSE
        },
        align: {
            type: oneOf([RAW_CENTER, RAW_LEFT, RAW_RIGHT]),
            value: RAW_CENTER
        },
        className: {
            type: RAW_STRING
        },
github divawth / bell-ui / dist / components / grid / Col.js View on Github external
import Yox from 'yox';
import template from './template/Col.hbs';
import { RAW_STRING, RAW_NUMERIC, RAW_OBJECT } from '../constant';
import { findComponentUpward } from '../util';
export default Yox.define({
    propTypes: {
        span: {
            type: RAW_NUMERIC
        },
        order: {
            type: RAW_NUMERIC
        },
        offset: {
            type: RAW_NUMERIC
        },
        push: {
            type: RAW_NUMERIC
        },
        pull: {
            type: RAW_NUMERIC
        },
github divawth / bell-ui / src / component / modal / Confirm.ts View on Github external
TRUE,
  FALSE,
  RAW_STRING,
  RAW_BOOLEAN,
  RAW_FUNCTION,
  RAW_TYPE_ARRAY,
  RAW_TYPE_PRIMARY,
  RAW_NUMERIC,
} from '../constant'

import {
  oneOf,
  screenWidth,
} from '../util'

export default Yox.define({

  template,

  name: '${prefix}Confirm',

  propTypes: {
    title: {
      type: RAW_STRING,
    },
    content: {
      type: RAW_STRING,
      required: TRUE,
    },
    closable: {
      type: RAW_BOOLEAN,
      value: FALSE,
github divawth / bell-ui / src / component / collapse / CollapseItem.ts View on Github external
import Icon from '../icon/Icon'
import template from './template/CollapseItem.hbs'

import {
  TRUE,
  FALSE,
  RAW_STRING,
  RAW_BOOLEAN,
  RAW_NUMBER,
} from '../constant'

import {
  findComponentUpward,
} from '../util'

export default Yox.define({

  template,

  name: '${prefix}CollapseItem',

  propTypes: {
    title: {
      type: RAW_STRING,
      required: TRUE,
    },
    name: {
      type: [RAW_STRING, RAW_NUMBER],
      required: TRUE,
    },
    disabled: {
      type: RAW_BOOLEAN,
github divawth / bell-ui / dist / components / timePicker / TimePicker.js View on Github external
import Yox from 'yox';
import template from './template/TimePicker.hbs';
import { RAW_STRING, RAW_NUMBER, RAW_FUNCTION, } from '../constant';
export default Yox.define({
    propTypes: {
        unit: {
            type: RAW_STRING,
            value: '分'
        },
        onChange: {
            type: RAW_FUNCTION
        },
        tens: {
            type: RAW_NUMBER,
            value: 0
        },
        ones: {
            type: RAW_NUMBER,
            value: 0
        }
github divawth / bell-ui / dist / components / badge / Badge.js View on Github external
import Yox from 'yox';
import template from './template/Badge.hbs';
import { FALSE, RAW_STRING, RAW_BOOLEAN, RAW_NUMERIC, RAW_TYPE_ARRAY, RAW_TYPE_ERROR, } from '../constant';
import { oneOf, } from '../util';
export default Yox.define({
    propTypes: {
        text: {
            type: RAW_STRING
        },
        count: {
            type: RAW_NUMERIC
        },
        maxCount: {
            type: RAW_NUMERIC,
            value: 999
        },
        dot: {
            type: RAW_BOOLEAN,
            value: FALSE
        },
        hidden: {
github divawth / bell-ui / src / component / card / CardBody.ts View on Github external
import Yox from 'yox'

import template from './template/CardBody.hbs'

import {
  RAW_STRING,
} from '../constant'

export default Yox.define({

  template,

  name: '${prefix}CardBody',

  propTypes: {
    className: {
      type: RAW_STRING,
    },
    style: {
      type: RAW_STRING,
    }
  },
})

yox

A lightweight mvvm framework

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis