How to use @smile-io/ember-polaris - 10 common examples

To help you get started, we’ve selected a few @smile-io/ember-polaris 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 smile-io / ember-polaris / addon / components / polaris-resource-list.js View on Github external
*/
    previousLoading: false,

    /**
     * Internal property used to recreate React implementation's
     * `componentWillReceiveProps` behaviour.
     *
     * @property previousSelectedItems
     * @type {String|String[]}
     * @private
     */
    previousSelectedItems: null,

    itemsExist: gt('items.length', 0).readOnly(),

    selectId: computedIdVariation('id', 'Select').readOnly(),

    /**
     * ID used to identify our wrapper element from other instances
     */
    wrapperId: computed(function() {
      return guidFor(this);
    }).readOnly(),

    /**
     * List of item/id tuples needed for rendering items
     */
    itemsWithId: computed('items.[]', 'idForItem', function() {
      let { items, idForItem } = this.getProperties('items', 'idForItem');
      items = items || [];
      idForItem = idForItem || defaultIdForItem;
github smile-io / ember-polaris / addon / components / polaris-sticky.js View on Github external
*/
  style: null,

  /**
   * @property placeHolderNodeId
   * @type {String}
   * @private
   */
  placeHolderNodeId: computedIdVariation('elementId', 'PlaceHolder').readOnly(),

  /**
   * @property stickyNodeId
   * @type {String}
   * @private
   */
  stickyNodeId: computedIdVariation('elementId', 'Sticky').readOnly(),

  /**
   * @property placeHolderNode
   * @type {HTMLElement}
   * @private
   */
  placeHolderNode: computed(function() {
    return this.get('element').querySelector(
      `#${this.get('placeHolderNodeId')}`
    );
  }),

  /**
   * @property stickyNode
   * @type {HTMLElement}
   * @private
github smile-io / ember-polaris / addon / components / polaris-sticky.js View on Github external
isSticky: false,

  /**
   * @property style
   * @type {String}
   * @default null
   * @private
   */
  style: null,

  /**
   * @property placeHolderNodeId
   * @type {String}
   * @private
   */
  placeHolderNodeId: computedIdVariation('elementId', 'PlaceHolder').readOnly(),

  /**
   * @property stickyNodeId
   * @type {String}
   * @private
   */
  stickyNodeId: computedIdVariation('elementId', 'Sticky').readOnly(),

  /**
   * @property placeHolderNode
   * @type {HTMLElement}
   * @private
   */
  placeHolderNode: computed(function() {
    return this.get('element').querySelector(
      `#${this.get('placeHolderNodeId')}`
github smile-io / ember-polaris / addon / components / polaris-select.js View on Github external
options.forEach((optionOrGroup) => {
    if (isGroup(optionOrGroup)) {
      flatOptions = flatOptions.concat(optionOrGroup.options);
    } else {
      flatOptions.push(optionOrGroup);
    }
  });
github smile-io / ember-polaris / addon / components / polaris-select.js View on Github external
function normalizeOption(option) {
  if (isString(option)) {
    return normalizeStringOption(option);
  } else if (isGroup(option)) {
    let { title, options } = option;
    return {
      title,
      options: options.map((option) => {
        return isString(option) ? normalizeStringOption(option) : option;
      }),
    };
  }

  return option;
}
github smile-io / ember-polaris / addon / components / polaris-range-slider.js View on Github external
ariaDescribedBy: computed('error', 'helpText', function() {
    let { error, helpText, id } = this.getProperties('error', 'helpText', 'id');
    let describedBy = [];

    if (error) {
      describedBy.push(errorId(id));
    }

    if (helpText) {
      describedBy.push(helpTextId(id));
    }

    return describedBy.length ? describedBy.join(' ') : undefined;
  }).readOnly(),
github smile-io / ember-polaris / addon / components / polaris-select.js View on Github external
describedBy: computed('error', 'helpText', function() {
    let { error, helpText, _id: id } = this.getProperties(
      'error',
      'helpText',
      '_id'
    );
    let describedBy = [];

    if (helpText) {
      describedBy.push(helpTextId(id));
    }

    if (error) {
      describedBy.push(errorId(id));
    }

    return describedBy.length ? describedBy.join(' ') : undefined;
  }).readOnly(),
github smile-io / ember-polaris / addon / components / polaris-select.js View on Github external
describedBy: computed('error', 'helpText', function() {
    let { error, helpText, _id: id } = this.getProperties(
      'error',
      'helpText',
      '_id'
    );
    let describedBy = [];

    if (helpText) {
      describedBy.push(helpTextId(id));
    }

    if (error) {
      describedBy.push(errorId(id));
    }

    return describedBy.length ? describedBy.join(' ') : undefined;
  }).readOnly(),
github smile-io / ember-polaris / addon / components / polaris-range-slider.js View on Github external
ariaDescribedBy: computed('error', 'helpText', function() {
    let { error, helpText, id } = this.getProperties('error', 'helpText', 'id');
    let describedBy = [];

    if (error) {
      describedBy.push(errorId(id));
    }

    if (helpText) {
      describedBy.push(helpTextId(id));
    }

    return describedBy.length ? describedBy.join(' ') : undefined;
  }).readOnly(),
github smile-io / ember-polaris / addon / components / polaris-resource-list / filter-control.js View on Github external
import Component from '@ember/component';
import { computed, get } from '@ember/object';
import layout from '../../templates/components/polaris-resource-list/filter-control';
import { context } from '@smile-io/ember-polaris/components/polaris-resource-list';
import { FilterType } from '@smile-io/ember-polaris/components/polaris-resource-list/filter-control/filter-value-selector';

export default Component.extend(context.ConsumerMixin, {
  tagName: '',

  layout,

  /**
   * @property searchValue
   * @type {String}
   * @default null
   * @public
   */
  searchValue: null,

  /**
   * @property appliedFilters
   * @type {Object[]}
   * @default null