lib/Map/AbsConcept.js
function(options) {
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);

  Concept.call(this, options.name || options.id);

  /**
   * Gets or sets the name of the concept item.  This property is observable.
   * @type {String}
   */
  this.id = options.id;

  /**
   * Gets the list of absCodes contained in this group.  This property is observable.
   * @type {AbsConcept[]}
   */
  this.items = [];

  /**
   * Gets or sets a value indicating whether this concept item is currently open.  When an
   * item is open, its child items (if any) are visible.  This property is observable.
   * @type {Boolean}
   */
  this.isOpen = true;

  /**
   * Flag to say if this if this node is selectable.  This property is observable.
   * @type {Boolean}
   */
  this.isSelectable = false;

  /**
   * Flag to say if this if this concept only allows more than one active child. (Defaults to false.)
   * @type {Boolean}
   */
  this.allowMultiple = defaultValue(options.allowMultiple, false);

  if (defined(options.codes)) {
    var anyActive = buildConceptTree(this, options.filter, this, options.codes);
    // If no codes were made active via the 'filter' parameter, activate the first one.
    if (!anyActive && this.items.length > 0) {
      this.items[0].isActive = true;
    }
  }

  knockout.track(this, ["items", "isOpen"]); // name, isSelectable already tracked by Concept

  // Returns a flat array of all the active AbsCodes under this concept (walking the tree).
  // For this calculation, a concept may be active independently of its children.
  knockout.defineProperty(this, "activeItems", {
    get: function() {
      return getActiveChildren(this);
    }
  });

  knockout.getObservable(this, "activeItems").subscribe(function(activeItems) {
    options.activeItemsChangedCallback(this, activeItems);
  }, this);
}
function(options) {
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);

  Concept.call(this, options.name || options.id);

  /**
   * Gets or sets the name of the concept item.  This property is observable.
   * @type {String}
   */
  this.id = options.id;

  /**
   * Gets the list of absCodes contained in this group.  This property is observable.
   * @type {AbsConcept[]}
   */
  this.items = [];

  /**
   * Gets or sets a value indicating whether this concept item is currently open.  When an
   * item is open, its child items (if any) are visible.  This property is observable.
   * @type {Boolean}
   */
  this.isOpen = true;

  /**
   * Flag to say if this if this node is selectable.  This property is observable.
   * @type {Boolean}
   */
  this.isSelectable = false;

  /**
   * Flag to say if this if this concept only allows more than one active child. (Defaults to false.)
   * @type {Boolean}
   */
  this.allowMultiple = defaultValue(options.allowMultiple, false);

  if (defined(options.codes)) {
    var anyActive = buildConceptTree(this, options.filter, this, options.codes);
    // If no codes were made active via the 'filter' parameter, activate the first one.
    if (!anyActive && this.items.length > 0) {
      this.items[0].isActive = true;
    }
  }

  knockout.track(this, ["items", "isOpen"]); // name, isSelectable already tracked by Concept

  // Returns a flat array of all the active AbsCodes under this concept (walking the tree).
  // For this calculation, a concept may be active independently of its children.
  knockout.defineProperty(this, "activeItems", {
    get: function() {
      return getActiveChildren(this);
    }
  });

  knockout.getObservable(this, "activeItems").subscribe(function(activeItems) {
    options.activeItemsChangedCallback(this, activeItems);
  }, this);
}
function ( options ) { options = defaultValue ( options , defaultValue . EMPTY_OBJECT ) ; Concept . call ( this , options . name || options . id ) ; /**
   * Gets or sets the name of the concept item.  This property is observable.
   * @type {String}
   */ this . id = options . id ; /**
   * Gets the list of absCodes contained in this group.  This property is observable.
   * @type {AbsConcept[]}
   */ this . items = [ ] ; /**
   * Gets or sets a value indicating whether this concept item is currently open.  When an
   * item is open, its child items (if any) are visible.  This property is observable.
   * @type {Boolean}
   */ this . isOpen = true ; /**
   * Flag to say if this if this node is selectable.  This property is observable.
   * @type {Boolean}
   */ this . isSelectable = false ; /**
   * Flag to say if this if this concept only allows more than one active child. (Defaults to false.)
   * @type {Boolean}
   */ this . allowMultiple = defaultValue ( options . allowMultiple , false ) ; if ( defined ( options . codes ) ) { var anyActive = buildConceptTree ( this , options . filter , this , options . codes ) ; // If no codes were made active via the 'filter' parameter, activate the first one. if ( ! anyActive && this . items . length > 0 ) { this . items [ 0 ] . isActive = true ; } } knockout . track ( this , [ "items" , "isOpen" ] ) ; // name, isSelectable already tracked by Concept // Returns a flat array of all the active AbsCodes under this concept (walking the tree). // For this calculation, a concept may be active independently of its children. knockout . defineProperty ( this , "activeItems" , { get : function ( ) { return getActiveChildren ( this ) ; } } ) ; knockout . getObservable ( this , "activeItems" ) . subscribe ( function ( activeItems ) { options . activeItemsChangedCallback ( this , activeItems ) ; } , this ) ; }
Represents an ABS concept associated with a AbsDataset.
An AbsConcept contains an array one of more AbsCodes.

@alias AbsConcept
@constructor
@extends Concept
@param {Object} [options] Object with the following properties:
@param {String} [options.name] The concept's human-readable name, eg. "Region Type".
@param {String[]} [options.id] The concept's id (the name given to it by the ABS), eg. "REGIONTYPE".
@param {Object[]} [options.codes] ABS code objects describing a tree of codes under this concept,
eg. [{code: '01_02', description: 'Negative/Nil Income', parentCode: 'TOT', parentDescription: 'Total'}, ...].
@param {String[]} [options.filter] The initial concepts and codes to activate.
@param {Boolean} [options.allowMultiple] Does this concept only allow multiple active children (eg. all except Region type)?
@param {Function} [options.activeItemsChangedCallback] A function called when activeItems changes.
Represents an ABS concept associated with a AbsDataset . An AbsConcept contains an array one of more AbsCodes .