How to use the metal-state.Config.oneOf 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-chart / src / Chart.js View on Github external
this.chart.destroy();
  }
}

/**
 * State definition.
 * @static
 * @type {!Object}
 */
Chart.STATE = {
  /**
   * Built-in types for Chart.js
   * @type {!String}
   */
  type: {
    value: Config.oneOf(['bar', 'bubble', 'line', 'pie', 'polarArea', 'radar']),
  },

  /**
   * Data used to render Chart.js
   * @type {!Object}
   */
  data: {
    value: {}
  },

  /**
   * Styling options for Chart.js
   * @type {!Object}
   */
  options: {
    value: {}
github LiferayCloud / marble / packages / marble-button / src / Button.js View on Github external
* @default undefined
   * @type {?(string|undefined)}
   */
  elementClasses: Config.string(),

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

  /**
   * @default undefined
   * @type {?string}
   */
  format: Config.oneOf(['squared', 'rounded']),

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

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

  /**
   * @default left
   * @type {?string}
github LiferayCloud / marble / packages / marble-checkbox-group / src / CheckboxGroup.js View on Github external
})
  ).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
   */
  style: Config.oneOf([
    'checkbox-group',
    'checkbox-group checkbox-group-inline'
  ]).value('checkbox-group'),
};

Soy.register(CheckboxGroup, templates);

export {CheckboxGroup};
export default CheckboxGroup;
github LiferayCloud / marble / packages / marble-spinner / src / Spinner.js View on Github external
* 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);

export {Spinner};
export default Spinner;
github LiferayCloud / marble / packages / marble-button / src / Button.js View on Github external
*/
  size: Config.oneOf(['xs', 'sm', 'md', 'lg']).value('md'),

  /**
   * @default default
   * @type {?(string|undefined)}
   */
  style: Config.oneOf(['accent', 'default', 'link', 'primary', 'success', 'danger', 'warning']).value(
    'default'
  ),

  /**
   * @default undefined
   * @type {?string}
   */
  target: Config.oneOf(['_blank', '_self', '_parent', '_top']),

  /**
   * @default button
   * @type {?string}
   */
  type: Config.oneOf(['button', 'reset', 'submit']).value('button'),

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

Soy.register(Button, templates);
github LiferayCloud / marble / packages / marble-spinner / src / Spinner.js View on Github external
* 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);

export {Spinner};
export default Spinner;
github LiferayCloud / marble / packages / marble-button / src / Button.js View on Github external
* @default undefined
   * @type {?(string|undefined)}
   */
  href: Config.string(),

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

  /**
   * @default left
   * @type {?string}
   */
  iconAlignment: Config.oneOf(['left', 'right']).value('left'),

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

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

  /**
   * @default false
   * @type {?boolean}
github LiferayCloud / marble / packages / marble-radio-group / src / RadioGroup.js View on Github external
})
  ).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
   */
  style: Config.oneOf([
    'radio-group',
    'radio-group radio-group-inline'
  ]).value('radio-group'),
};

Soy.register(RadioGroup, templates);

export {RadioGroup};
export default RadioGroup;
github LiferayCloud / marble / packages / marble-timestamp / src / Timestamp.js View on Github external
* 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;