CheckBox constructor
@param {aria.widgets.CfgBeans:CheckBoxCfg} cfg the widget configuration
@param {aria.templates.TemplateCtxt} ctxt template context
@param {Number} lineNumber Line number corresponding in the .tpl file where the widget is created
2667
function (cfg, ctxt, lineNumber) {
        this.$Input.constructor.apply(this, arguments);
        this._setSkinObj(this._skinnableClass);
        this._setInputType();
        this._setIconPrefix();
        this._setState();
        if (!this._skinObj.simpleHTML) {
            /**
             * Instance of the Icon widget used by this widget.
             * @type aria.widgets.Icon
             * @protected
             */
            this._icon = new ariaWidgetsIcon({
                icon : this._getIconName(this._state),
                verticalAlign : cfg.verticalAlign
            }, ctxt, lineNumber);

            this._icon.extraAttributes = (this._cfg.waiAria) ? "role='presentation'" : "";
        }

        /**
         * True if the widget is currently focues.
         * @type Boolean
         * @protected
         */
        this._hasFocus = false;

    }
1135183
function Node(cfg) {

  this.namespace     = cfg.namespace || null;
  this.text          = cfg.text;
  this._selfCloseTag = cfg.selfCloseTag;


  Object.defineProperties(this, {
    nodeType: {
      value: cfg.nodeType
    },
    nodeName: {
      value: cfg.nodeType == 1 ? cfg.nodeName : '#text'
    },
    childNodes: {
      value: cfg.childNodes
    },
    firstChild: {
      get: function(){
        return this.childNodes[0] || null;
      }
    },
    lastChild: {
      get: function(){
        return this.childNodes[this.childNodes.length-1] || null;
      }
    },
    parentNode: {
      value: cfg.parentNode || null
    },
    attributes: {
      value: cfg.attributes || []
    },
    innerHTML: {
      get: function(){
        var
          result = '',
          cNode;
        for (var i = 0, l = this.childNodes.length; i < l; i++) {
          cNode = this.childNodes[i];
          result += cNode.nodeType === 3 ? cNode.text : cNode.outerHTML;
        }
        return result;
      }
    },
    outerHTML: {
      get: function(){
        if (this.nodeType != 3){
          var
            str,
            attrs = (this.attributes.map(function(elem){
              return elem.name + (elem.value ? '=' + '"'+ elem.value +'"' : '');
            }) || []).join(' '),
            childs = '';

          str = '<' + this.nodeName + (attrs ? ' ' + attrs : '') + (this._selfCloseTag ? '/' : '') + '>';

          if (!this._selfCloseTag){
            childs = (this._selfCloseTag ? '' : this.childNodes.map(function(child){
              return child.outerHTML;
            }) || []).join('');

            str += childs;
            str += '</' + this.nodeName + '>';
          }
        }
        else{
          str = this.textContent;
        }
        return str;
      }
    },
    textContent: {
      get: function(){
        if (this.nodeType == Node.TEXT_NODE){
          return this.text;
        }
        else{
          return this.childNodes.map(function(node){
            return node.textContent;
          }).join('').replace(/\x20+/g, ' ');
        }
      }
    }
  });
}
1108583
def _draw_linenumber(self, posno, lineno):
        
        self._draw_text(
            self._get_linenumber_pos(posno),
            str(lineno).rjust(self.line_number_chars),
            font=self.fonts.get_font(self.line_number_bold,
                                     self.line_number_italic),
            fill=self.line_number_fg,
        )
289929
function (tplCtxt, cfg, options) {
            var binding, bindings, id, type;

            /**
             * Array of objects which are either a section (recognizable through its _type property = TYPE_SECTION) or
             * the following structure: {_type: TYPE_BEHAVIOR, behavior: behavior, id: id }
             * @protected
             * @type Array
             */
            this._content = [];

            /**
             * Section which contains this section, or null if this section has no parent (either it has not been
             * included in the template section tree yet, or it is the root of a template section tree)
             * @type aria.templates.Section
             */
            this.parent = null;

            /**
             * The following variable is set to true when init has been done.
             * @protected
             * @type Boolean
             */
            this._initWidgetsDone = false;

            /**
             * HTML content of the section. Maybe null for subsections.
             * @type String
             */
            this.html = null;

            /**
             * List of bindings done for this section
             * @protected
             * @type Array
             */
            this._bindings = [];

            /**
             * Binding between processing indicator and this section
             * @protected
             * @type Object
             */
            this._processing = null;

            /**
             * Overlay id, in case a processing indicator is linked to this section.
             * @protected
             * @type String
             */
            this._overlayId = null;

            /**
             * Array of delegateIds
             * @type Array
             */
            this.delegateIds = [];

            /**
             * Configuration has gone OK
             * @type Boolean
             */
            this.cfgOk = true;

            /**
             * Template context of this section
             * @type aria.templates.TemplateCtxt
             */
            this.tplCtxt = tplCtxt;

            /**
             * List of callback for on statements in this section
             * @type Array
             */
            this.delegateCallbacks = [];

            /**
             * Specificies that this section is a root section (content of a template, without name of id)
             * @type Boolean
             */
            this.isRoot = (options && options.isRoot === true);

            /**
             * Id map of the section. It is only present on root sections and on sections which have been added to the
             * root section. Sub-sections reuse the idMap of their parent section.
             * @type Object
             */
            this.idMap = (options && options.ownIdMap) ? {} : null;

            /**
             * The widget configuration, as declared in the template.
             * @protected
             * @type Object
             */
            this._cfg = cfg;

            this._normalizeCallbacks();

            /**
             * Id for event delegation (used for keyboard navigation and events specified in section configuration)
             * @type String
             */
            this.delegateId = ariaUtilsDelegate.add({
                fn : this._onDomEvent,
                scope : this
            });

            // stop here for root context
            if (this.isRoot) {
                return;
            }

            // normalize configuration
            this.cfgOk = ariaCoreJsonValidator.validateCfg("aria.templates.CfgBeans." + this.$class + "Cfg", cfg, {
                msg : this.INVALID_CONFIGURATION,
                params : [this.tplCtxt.tplClasspath, cfg.id]
            });
            if (!this.cfgOk) {
                return;
            }

            type = cfg.type;
            bindings = cfg.bindRefreshTo;
            id = cfg.id;

            var domId;
            if (id) {
                if (!regexpForId.test(id)) {
                    this.$logError(this.INVALID_SECTION_ID, [this.tplCtxt.tplClasspath, id]);
                    this.cfgOk = false;
                    return;
                }

                if (id.indexOf('+') > -1) {
                    if (Aria.testMode) {
                        domId = this.tplCtxt.$getAutoId(id);
                    }
                    // From the application's point of view, an id with a '+' inside it is equivalent to no id at all.
                    // We only use the id with a '+' inside it to generate the id used in the DOM
                    delete cfg.id;
                    id = null;
                }

            }

            /**
             * DOM type for this section
             * @type String
             */
            this.domType = type;

            /**
             * Specify the DomId for the section
             * @type String
             */
            this._domId = domId || (id ? this.tplCtxt.$getId(id) : this._createDynamicId());

            /**
             * Id of the section
             * @type String
             */
            this.id = id || "_gen_" + this._domId;

            /**
             * Whether waiAria should be activated or not
             * @type Boolean
             */
            this.waiAria = cfg.waiAria;

            /**
             * When waiAria is activated and processingLabel is defined, specifies the interval at which this label is read
             * @type Number
             */
            this.waiAriaProcessingLabelReadInterval = cfg.waiAriaProcessingLabelReadInterval;

            /**
            When waiAria is activated and processingLabel is defined, specifies if this label should be read once first (without having to wait for the first interval occurrence).
             * @type Boolean
             */
            this.waiAriaProcessingLabelReadOnceFirst = cfg.waiAriaProcessingLabelReadOnceFirst;

            /**
             * Configuration for keyboard shortcuts
             * @type Object
             */
            this.keyMap = cfg.keyMap;

            /**
             * Configuration for table navigation
             * @type Object
             */
            this.tableNav = cfg.tableNav;

            /**
             * Processing label of this section
             * @type String
             */
            this.processingLabel = cfg.processingLabel;

            /**
             * Don't change the processing indicator. Flag to avoid updating the datamodel more than once
             * @type Boolean
             * @private
             */
            this.__skipProcessingChange = false;

            /**
             * Macro to use when refreshing the section.
             * @type aria.templates.CfgBeans:MacroCfg
             */
            this.macro = cfg.macro ? tplCtxt.checkMacro(cfg.macro) : null;

            /**
             * SectionWrapper object
             * @type aria.templates.SectionWrapper
             */
            this.wrapper = null;

            // register binding on this section
            for (var i = 0; binding = bindings[i]; i++) {
                this.registerBinding(binding, this._notifyDataChange);
            }

            // register binding to the processing indicator
            this.registerProcessing(cfg.bindProcessingTo);

            /**
             * TODOC
             * @type Object
             * @protected
             */
            this._refreshMgrInfo = null;

            /**
             * Html attributes of the section
             * @type aria.templates.CfgBeans:HtmlAttribute
             */
            this.attributes = cfg.attributes;

            /**
             * Attributes binding configuration
             * @type aria.templates.CfgBeans:BindingConfiguration
             */
            this._attributesBinding = null;

            /**
             * Listener added to the data model bound to the section attributes
             * @type aria.core.CfgBeans:Callback
             */
            this._attributesChangeListener = null;

            // register binding for attributes
            var attributeBind = (cfg.bind && cfg.bind.attributes) ? cfg.bind.attributes : null;
            this._attributesBinding = attributeBind;
            if (attributeBind) {
                this.attributes = this.__json.copy(attributeBind.inside[attributeBind.to]);
                this._attributesChangeListener = this.registerBinding(attributeBind, this._notifyAttributeChange);
            }

            // register binding for animation
            var animationBind = (cfg.bind && cfg.bind.animation) ? cfg.bind.animation : null;
            if (animationBind) {
                cfg.animation = animationBind.inside[animationBind.to];
                this._animationChangeListener = this.registerBinding(animationBind,this._notifyAnimationChange);
            }

        }
411905
function (cfg) {
            if (!ariaCoreJsonValidator.normalize({
                json : cfg,
                beanName : "aria.templates.CfgBeans.InitTemplateCfg"
            })) {
                return false;
            }
            this._out = null;
            this._cfg = cfg;
            if (cfg.id) {
                this._id = cfg.id;
            } else {
                this._id = "tpl" + idCount;
                idCount++;
            }

            if (Aria.testMode) {
                this._prefixIds = {};
            }

            // if the template has been customized, the widget returns already the actual (customized) classpath
            this.tplClasspath = cfg.classpath;

            // TODO: check if cfg.classpath corresponds to a template is a template
            var tpl;
            try {
                tpl = Aria.getClassInstance(cfg.classpath);
            } catch (e) {
                this.$logError(this.TEMPLATE_CONSTR_ERROR, [cfg.classpath], e);
                return false;
            }
            this._tpl = tpl;

            // set the macro after tpl
            if (cfg.macro == null) {
                cfg.macro = {
                    name : "main",
                    args : cfg.args,
                    scope : tpl
                };
            }
            cfg.macro = this.checkMacro(cfg.macro);

            // PTR05228660: use private interface for performances
            var context = cfg.context, moduleCtrl = cfg.moduleCtrl, data = cfg.data;
            var privateInfo, moduleCtrlPrivate;

            // retrieve information from context if not specified
            if (context && !moduleCtrl) {
                if (!data) {
                    data = context.data;
                }
                moduleCtrl = context.moduleCtrl;
            }

            if (moduleCtrl) {
                // When a moduleCtrl is used, the ModuleCtrlFactory should be loaded.
                // However, the ModuleCtrlFactory is not a static dependency cause sometimes we don't need it.
                // TODO: today, we just fail if it's not here, replace this with a silent dynamic loading
                // (Aria.load)
                if (!aria.templates.ModuleCtrlFactory) {
                    this.$logError(this.MISSING_MODULE_CTRL_FACTORY, [cfg.classpath]);
                } else {

                    if (!__getModulePrivateInfo) {
                        __getModulePrivateInfo = aria.templates.ModuleCtrlFactory.__getModulePrivateInfoMethod();
                    }
                    privateInfo = __getModulePrivateInfo.call(this, moduleCtrl);

                    if (!privateInfo) {
                        // if privateInfo is null, it means either the module controller was not created through
                        // aria.templates.ModuleCtrlFactory or it was already disposed (error was already logged in
                        // __getModulePrivateInfo)
                        return false;
                    }
                    moduleCtrlPrivate = privateInfo.moduleCtrlPrivate;

                    if (!data) {
                        data = moduleCtrlPrivate.getData();
                    } else {
                        // data where specified. If a context was also specified, try to match data with a sub
                        // controller
                        if (context) {
                            var newModuleCtrl = moduleCtrlPrivate.getSubModuleCtrl(data);
                            if (newModuleCtrl != moduleCtrl) {
                                moduleCtrl = newModuleCtrl;
                                // update moduleCtrl info
                                privateInfo = __getModulePrivateInfo.call(this, moduleCtrl);
                                if (!privateInfo) {
                                    // if privateInfo is null, it means either the module controller was not created
                                    // through aria.templates.ModuleCtrlFactory or it was already disposed (error
                                    // was already logged in __getModulePrivateInfo)
                                    return false;
                                }
                                moduleCtrlPrivate = privateInfo.moduleCtrlPrivate;
                            }
                        }
                    }
                }
            }

            this.data = data;
            this.moduleCtrl = moduleCtrl;
            if (privateInfo) {
                this.flowCtrl = privateInfo.flowCtrl;
                this.flowCtrlPrivate = privateInfo.flowCtrlPrivate;
                this.moduleCtrlPrivate = moduleCtrlPrivate;
                this.moduleRes = moduleCtrlPrivate.getResourceSet();
            }

            // update configuration
            cfg.data = data;
            cfg.moduleCtrl = moduleCtrl;

            // register this template in the templateCtxtManager
            ariaTemplatesTemplateCtxtManager.add(this);

            if (this.data != null) {
                this.__dataGround = {
                    data : this.data
                };
            }

            // We no longer create new methods in a closure each time a new instance of a template is created,
            // instead we use the interface mechanism to expose methods to the template and prevent access to the
            // template context
            // LEAK & PERF IMPROVMENT : interface on these two functions results in poor performance and leaks

            var oSelf = this, index, name;

            for (index = 0; name = paramMapping[index]; index++) {
                tpl[name] = this[name];
            }

            var functionUtils = ariaUtilsFunction;
            for (index = 0; name = methodMapping[index]; index++) {
                tpl[name] = functionUtils.bind(this[name], this);
            }

            // do not use bind for __$write as this method is called intensively (Perf improvment)
            tpl.__$write = function (s, line) {
                return oSelf.__$write(s, line, this.$classpath);
            };

            if (this.moduleCtrl) {
                this.moduleCtrl.$on({
                    '*' : {
                        fn : tpl.onModuleEvent,
                        scope : tpl
                    },
                    'beforeDispose' : {
                        fn : this._beforeModuleDispose,
                        scope : this
                    }
                });
            }
            if (this.flowCtrl) {
                this.flowCtrl.$on({
                    '*' : tpl.onFlowEvent,
                    scope : tpl
                });
            }

            this._width = {};
            this._height = {};
            this.$setViewportWidth(ariaTemplatesLayout.realWidth(cfg.width));
            this.$setViewportHeight(ariaTemplatesLayout.realHeight(cfg.height));
            this.$setSizeCfg(tpl.__$width, tpl.__$height);
            this.__addDebugInfo(cfg.tplDiv);
            var res = tpl.__$initTemplate();
            this.__loadLibs(tpl.__$macrolibs, "macrolibs");
            return res;
        }
321854
function validatorNum( msg ) {
		return function() {
			var value = this.getValue(),
				pass = !!( CKEDITOR.dialog.validate.integer()( value ) && value > 0 );

			if ( !pass ) {
				alert( msg );
				this.select();
			}

			return pass;
		};
	}
346933
function Checkbox({ children, ...props }) {
  const { getLabelProps, ...fieldCtx } = useFieldContext();
  const { getFocusProps, keyboardFocused } = useKeyboardFocus();

  /**
   * Due to us applying keyboard-only focus events to 2 separate elements (the input and label)
   * we must apply the original `onMouseDown` event to the `onMouseUp` event of the label.
   *
   * By passing the original props within `getFocusProps` we are able to allow
   * `event.preventDefault()` to still prevent chained events as expected.
   */
  const { onMouseDown: onFocusMouseDown, ...keyboardFocusedProps } = getFocusProps(props);

  const modifiedFieldCtx = {
    getLabelProps: ({ onMouseUp, ...other }) =>
      getLabelProps({ onMouseUp: composeEventHandlers(onMouseUp, onFocusMouseDown), ...other }),
    ...fieldCtx
  };

  return (
    <FieldContext.Provider value={modifiedFieldCtx}>
      <CheckboxContext.Provider value={{ isFocused: keyboardFocused }}>
        <StyledCheck>
          <StyledCheckInput
            {...modifiedFieldCtx.getInputProps({
              'data-garden-id': 'forms.checkbox',
              'data-garden-version': PACKAGE_VERSION,
              ...keyboardFocusedProps
            })}
          />
          {children}
        </StyledCheck>
      </CheckboxContext.Provider>
    </FieldContext.Provider>
  );
}
262470
function createEnablerCheckbox (api, title, isEnabled, appendTo, callback) {
    var container = document.getElementById(appendTo);

    var label = document.createElement('label');
    label.classList.add('topcoat-checkbox');

    var checkbox = document.createElement('input');
    checkbox.type = 'checkbox';
    checkbox.value = api;
    checkbox.checked = isEnabled;
    label.htmlFor = checkbox.id = 'enable_' + api;

    checkbox.onchange = function (e) {
        e.preventDefault();
        callback(e);
    };

    var div = document.createElement('div');
    div.classList.add('topcoat-checkbox__checkmark');

    var text = document.createElement('span');
    text.innerText = title;

    label.appendChild(checkbox);
    label.appendChild(div);
    label.appendChild(text);

    container.appendChild(label);
}
1257205
function (cfg) {

            var jsonValidator = ariaCoreJsonValidator;
            this._cfgOk = jsonValidator.validateCfg("aria.html.beans.TemplateCfg.Properties", cfg);
            if (this._needCreatingModuleCtrl) {
                this._cfgOk = this._cfgOk
                && jsonValidator.validateCfg("aria.templates.CfgBeans.InitModuleCtrl", cfg.moduleCtrl);
            }
        }
1348111
def style_checkboxes(widget):
    

    ww = widget.findChildren(QCheckBox)
    for w in ww:
        w.setStyleSheet("QCheckBox:focus {border: 1px solid #000000;}")
1012758
function (cfg, callback) {
        if (cfg.allSelectors.length > 0) {
            var selector = cfg.allSelectors.splice(0, 1)[0];
            var one = {
                name : selector.name,
                cfg : cfg,
                selector : selector,
                callback : {
                    fn : allTests,
                    scope : this,
                    args : [cfg, callback]
                }
            };

            runTest(one);
        } else {
            logResults(cfg.incremental);
            aria.ext.StressCss.__callback(callback);
        }
    }
1279231
function (tmpCfg, callback) {
            var div = tmpCfg.div;
            // check if the div is still in the dom
            // (because it could be inside a template which was refreshed, so no longer in the dom)
            if (!ariaUtilsDom.isInDom(div)) {
                this.$callback(callback);
                return;
            }
            var tplWidget = div.__widget;
            Aria.loadTemplate(tmpCfg, function (args) {
                // remap widget content
                if (args.success && tplWidget) {
                    var tplCtxt = args.tplCtxt;
                    var tplCtxtManager = ariaTemplatesTemplateCtxtManager;
                    // TODO: find a cleaner way to do this
                    // as this template is inside a template widget, it is not a root template
                    // (even if we reloaded it with Aria.loadTemplate)
                    // This is necessary for the inspector not to display the template twice:
                    tplCtxtManager.remove(tplCtxt); // remove the template from the list of root templates
                    args.tplCtxt._cfg.isRootTemplate = false; // remove the root template flag
                    tplCtxtManager.add(tplCtxt); // add the template back to the list of templates
                    tplWidget.subTplCtxt = tplCtxt; // add the reference to the template context in the template
                    // widget
                }

                if (callback != null) {
                    this.$callback(callback);
                }
            });
        }
882557
function(html, lineNumbers)
  {
    // html = utils.trim(html);

    var _this = this,
        opts = _this.opts,
        lines = getLines(html),
        padLength = opts.padLineNumbers,
        firstLine = parseInt(opts.firstLine || 1),
        brushName = opts.brush,
        html = ''
        ;

    for (var i = 0, l = lines.length; i < l; i++)
    {
      var line = lines[i],
          indent = /^(&nbsp;|\s)+/.exec(line),
          spaces = null,
          lineNumber = lineNumbers ? lineNumbers[i] : firstLine + i;
          ;

      if (indent != null)
      {
        spaces = indent[0].toString();
        line = line.substr(spaces.length);
        spaces = spaces.replace(' ', opts.space);
      }

      // line = utils.trim(line);

      if (line.length == 0)
        line = opts.space;

      html += _this.wrapLine(
        i,
        lineNumber,
        (spaces != null ? '<code class="' + brushName + ' spaces">' + spaces + '</code>' : '') + line
      );
    }

    return html;
  }
1334349
function (cfg, context, lineNumber) {
            /**
             * The widget configuration, as declared in the template.
             * @protected
             * @type Object
             */
            this._cfg = cfg;

            /**
             * Template context
             * @protected
             * @type aria.templates.TemplateCtxt
             */
            this._context = context;

            /**
             * Line number for this widget
             * @protected
             * @type Number
             */
            this._lineNumber = lineNumber;

            /**
             * Array of used dynamic ids.
             * @protected
             * @type Array
             */
            this._dynamicIds = null;

            // Notify the Skin Manager that a new widget was created
            ariaTemplatesCSSMgr.loadWidgetDependencies(this.$classpath, this.$css);

            /**
             * True if the CSS is loaded, false otherwise. This is to make sure the CSS is not unloaded twice.
             * @type Boolean
             */
            this.__cssLoaded = true;
        }
1037819
function (cfg, ctxt, lineNumber) {
        var controller = new ariaWidgetsControllersDateController();
        this.$TextInput.constructor.call(this, cfg, ctxt, lineNumber, controller);
        controller.setPattern(cfg.pattern);
        if (cfg.minValue) {
            controller.setMinValue(new Date(cfg.minValue));
        }
        if (cfg.maxValue) {
            controller.setMaxValue(new Date(cfg.maxValue));
        }
        if (cfg.referenceDate) {
            controller.setReferenceDate(new Date(cfg.referenceDate));
        }
    }
1343349
function (cfg, ctxt) {
        this.$ActionWidget.constructor.apply(this, arguments);

        /**
         * Tells if the mouse is currently over the widget.
         * @protected
         * @type Boolean
         */
        this._mouseOver = false;

        /**
         * Tells if the mouse is currently pressing the widget.
         * @protected
         * @type Boolean
         */
        this._mousePressed = false;

        /**
         * Tells if a key down event happened before the last click event. This prevents an enter event to fire the
         * action twice.
         * @protected
         * @type Boolean
         */
        this._keyPressed = false;

        /**
         * Tells if the widget is currently focused.
         * @type Boolean
         */
        this._focused = false;

        this._updateState(true);

        /**
         * Tells if the widgets is using a tabindex (for tab navigation).
         * @protected
         * @type Boolean
         * @override
         */
        this._customTabIndexProvided = true;

        /**
         * Skin configutation for simpleHTML
         * @type Object
         * @protected
         */
        this._simpleHTML = aria.widgets.AriaSkinInterface.getSkinObject(this._skinnableClass, cfg.sclass).simpleHTML;

        if (!this._simpleHTML) {
            /**
             * Frame containing this widget.
             * @protected
             * @type {aria.widgets.frames.Frame}
             */
            this._frame = ariaWidgetsFramesFrameFactory.createFrame({
                height : cfg.height,
                width : cfg.width,
                state : this._state,
                sclass : cfg.sclass,
                skinnableClass : this._skinnableClass,
                // added in PTR 05170822 to avoid the internal scrollbard for content
                scrollBarX : false,
                scrollBarY : false
            });
        }
    }
1020886
function(lineNumber)
        {
            var list = this.getParam('highlight', []);

            if (typeof(list) != 'object' && list.push == null)
                list = [ list ];

            return indexOf(list, lineNumber.toString()) != -1;
        }