How to use the metal-state.Config.bool function in metal-state

To help you get started, we’ve selected a few metal-state 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 LiferayCloud / marble / packages / marble-checkbox / src / Checkbox.js View on Github external
this.checked = !this.checked;
    this.emit('check', e);
  }
}

/**
 * State definition.
 * @static
 * @type {!Object}
 */
Checkbox.STATE = {
  /**
   * The checked status of the input element.
   * @type {!Bool}
   */
  checked: Config.bool(),

  /**
   * The name and ID of the input element.
   * @type {!String}
   */
  id: Config.string(),

  /**
   * The label of the input element.
   * @type {!String}
   */
  label: Config.string(),

  /**
   * The value of the input element.
   * @type {!String}
github LiferayCloud / marble / packages / marble-timestamp / src / Timestamp.js View on Github external
.tz(timezone)
          .format('MMM DD YYYY, h:mma (UTCZ)');
      }
    }
  }
}

/**
 * State definition.
 * @static
 * @type {!Object}
 */
Timestamp.STATE = {
  childElementClasses: Config.string().value(''),
  elementClasses: Config.string().value(''),
  hasTitle: Config.bool().value(false),
  label: Config.string()
    .internal(true)
    .value(''),
  time: Config.number().value(0),
  title: Config.string()
    .internal(true)
    .value(undefined),
  type: Config.oneOf(['timestamp', 'duration'])
    .value('timestamp'),
};

Soy.register(Timestamp, templates);

export {Timestamp};
export default Timestamp;
github LiferayCloud / marble / packages / marble-radio-group / src / RadioGroup.js View on Github external
/**
 * State definition.
 * @static
 * @type {!Object}
 */
RadioGroup.STATE = {
  /**
   * The list of radio items
   * @type {?Array|undefined}
   * @default undefined
   */
  items: Config.arrayOf(
    Config.shapeOf({
      id: Config.string(),
      checked: Config.bool(),
      label: Config.string(),
      value: Config.string(),
    })
  ).required(),

  /**
   * The name param used on each radio
   * @type {?String}
   * @default undefined
   */
  name: Config.string().required(),

  /**
   * The style of the radio group
   * @type {!String}
   * @default radio-group
github LiferayCloud / marble / packages / marble-checkbox-group / src / CheckboxGroup.js View on Github external
/**
 * State definition.
 * @static
 * @type {!Object}
 */
CheckboxGroup.STATE = {
  /**
   * The list of radio items
   * @type {?Array|undefined}
   * @default undefined
   */
  items: Config.arrayOf(
    Config.shapeOf({
      id: Config.string(),
      checked: Config.bool(),
      label: Config.string(),
      value: Config.string(),
    })
  ).required(),

  /**
   * The name param used on each radio
   * @type {?String}
   * @default undefined
   */
  name: Config.string().required(),

  /**
   * The style of the radio group
   * @type {!String}
   * @default radio-group
github LiferayCloud / marble / packages / marble-spinner / src / Spinner.js View on Github external
/**
 * Spinner component.
 */
class Spinner extends Component {}

/**
 * State definition.
 * @static
 * @type {!Object}
 */
Spinner.STATE = {
  /**
   * Indicates if the spinner rotation is done or not
   * @type {!Boolean}
   */
  isDone: Config.bool(),

  /**
   * The size of the spinner
   * @type {!String|undefined}
   */
  size: Config.oneOf(['small', 'medium', 'large']),

  /**
   * The style of the spinner
   * @type {!String|undefined}
   */
  style: Config.oneOf(['danger', 'success', 'warning', 'white']),
};

Soy.register(Spinner, templates);
github LiferayCloud / marble / packages / marble-button / src / Button.js View on Github external
/**
 * @static
 * @type {!Object}
 */
Button.STATE = {
  /**
   * @default false
   * @type {?boolean}
   */
  block: Config.bool().value(false),

  /**
   * @default false
   * @type {?boolean}
   */
  disabled: Config.bool().value(false),

  /**
   * @default undefined
   * @type {?(string|undefined)}
   */
  elementClasses: Config.string(),

  /**
   * @default false
   * @type {?boolean}
   */
  focusTabIndex: Config.bool().value(false),

  /**
   * @default undefined
   * @type {?string}
github LiferayCloud / marble / packages / marble-topbar / src / Topbar.js View on Github external
href: Config.string(),
    icon: Config.string(),
    image: Config.string(),
    text: Config.string(),
  }),

  /**
   * The list of menu items
   * @type {?Array|undefined}
   * @default undefined
   */
  items: Config.arrayOf(
    Config.shapeOf({
      href: Config.string(),
      label: Config.string(),
      selected: Config.bool(),
      target: Config.string(),
      type: Config.string(),
      variant: Config.string(),
    })
  ).value([]),
};

Soy.register(Topbar, templates);

export {Topbar};
export default Topbar;