{"version":3,"sources":["webpack:///./packages/core/functionality/form.js","webpack:///./build-targets/theme/packages/core/functionality/materialTextFields.js","webpack:///./build-targets/theme/packages/core/functionality/patches/mdc-textfield.js","webpack:///./packages/core/functionality/childViews.js","webpack:///./build-targets/theme/packages/core/functionality/patches/mdc-list.js","webpack:///./packages/core/functionality/keyEvents.js","webpack:///./packages/core/functionality/drop.js","webpack:///./build-targets/theme/packages/core/functionality/materialRipples.js","webpack:///./build-targets/theme/packages/core/functionality/materialCheckboxes.js","webpack:///./build-targets/theme/packages/core/functionality/materialMenus.js"],"names":["NAME","Props","blurred","e","cacheFormValues","this","_formValues","formChanged","formValues","cacheQueries","inputs","_","each","$","el","elName","name","id","type","checkForm","$submit","length","submitReady","enable","data","html","disable","failure","error","thing","model","isModel","collection","isCollection","submitting","rejectWith","arguments","$el","removeClass","hide","fieldAdded","validator","$target","target","enabled","plugin","addField","revalidateFieldOnAdd","revalidateField","fieldMutating","_cacheFields","removeField","fieldMutated","fieldRemoved","fieldValidationFailure","fvf","fieldValidationSuccess","errorCache","submitted","remove","element","attr","flushCachedFormValues","focus","selector","formValidationFailure","set","map","getValidationErrors","input","dispatcher","trigger","eventStr","module","title","i18n","t","description","formValidationSuccess","values","i","$idx","all","idx","slice","match","isNull","replace","isNumeric","prop","filter","val","topLevelName","join","isUndefined","reduce","memo","index","arrayToCsv","csvToArray","concat","checkedRadio","is","checkedBoxes","elIdx","validation","Plugins","GetInstance","getInvalidFields","hideField","$form","plugins","$input","find","$formGroup","closest","Invoke","nxIgnore","inputChanged","changeEvent","jQuery","Event","nxIgnores","hasClass","isValid","keydown","keyCode","which","at","get","prepareForm","off","Destroy","disableCache","renderForm","toggleClass","disabledCount","emptyCount","inputCount","not","$element","isAppend","value","restoreCachedFormValue","hasValue","isArray","isString","trim","tooltip","$validationErrors","errorCacheView","setElement","render","isEmpty","whenShown","then","reset","state","inputName","has","setForm","v","setValue","setFormValidation","Initialize","instance","event","on","args","preventDefault","$submitButton","stopPropagation","validate","showField","nxUnignore","show","submit","Deferred","confirmed","addClass","confirmMessage","apply","submitArgs","cancelled","cancelEventStr","confirmedEventStr","confirmedMethod","cancelledMethod","once","extend","message","isFunction","yesEvent","noEvent","confirmViewOpts","result","key","unescapeAttributeName","requiresChanges","success","constructor","__isModel__","__isCollection__","resolveWith","rest","hideOnSubmit","removeOnHide","resetOnSubmit","stopListening","removeOnSubmit","toggleField","bool","validateField","datepickerChanged","select2changed","hasFunctionality","extendFunctionality","__isForm__","addInitializer","opts","isForm","events","change","setModel","wrap","call","isShown","resetOnShow","unsavedChanges","noProxy","isNew","validatorFields","CoreCollection","addSubView","FormErrorListView","fields","Register","options","excluded","$field","isObject","framework","form","rendered","defer","listenTo","dispatcherSubmitEvent","viewCollection","debounce","materialTextFields","dateComponents","cleanUp","invoke","currentTarget","forEach","textField","input_","foundation_","deactivateFocus","materialTextFieldFloatLabel","shouldFloat","c","getMaterailTextField","label_","float","notchOutline","purgeEls","querySelectorAll","getExcludedViews","field","ttInputEl","querySelector","classList","inputEl","MDCTextField","contains","textfield","notchOutlinePatched_","foundation","adapter","adapter_","openNotch","notchOutlinePatchTimeout","clearTimeout","hasOutline","labelScale","cssClasses","DENSE","numbers","DENSE_LABEL_SCALE","LABEL_SCALE","labelWidth","getLabelWidth","isNaN","setTimeout","destroy","forceFloat","hasLabel","root_","isFocused","inputFocusHandler_","floatLabel","notchOutlinePatch","getAttribute","push","add","addChildViewListener","func","childViews","addChildViewListeners","getChildViewCollection","Error","removeChildViewListeners","addedChildViewModel","compartor","resetChildViews","removeChildView","childView","addChildView","append","cid","newChildView","mainOptions","omit","k","__isView__","childCollection","isAppViewModel","__name__","_view","_viewQueue","isMyOriginalCollection","maxItems","keys","childViewClass","viewClass","childViewProto","prototype","childId","childViewOptions","_childViewOptions","attributes","viewOptions","viewSpec","opt","template","childViewAttributes","draggable","undefined","href","_options","ex","console","log","childModelCount","appendTo","$childTargetEl","indexOf","prependTo","warn","previousChildView","after","lastAdded","noRender","renderedOnce","noShow","addChildViews","parentCollection","modelCids","pluck","models","view","breakItUp","totalLength","size","amount","delay","first","m","lazyLoad","initializeLazyLoad","start","lazyLoadIndex","partial","bind","additionalOpts","childrenEl","forwardOnly","cleanUpChildViews","detachChildViews","detach","getChildViewByModel","hasOwnProperty","childViewCollection","lazyLoadedForward","reachedBeginning","reachedEnd","lazyLoadItems","totalItems","moveChildViewToIndex","oldIndex","newIndex","ignoreCollection","temp","end","ignoreEl","getIndex","silent","cv","from","to","prepareChildViews","_childViewFilterStr","$childSearchFilter","childViewTarget","childviewTarget","lazyloader","destroyMethod","initializeMethod","pluginObj","$pluginEl","initOpts","cb","LazyLoader","direction","removeAllChildViews","removeChildViewListener","empty","searchAndFilterChildren","str","attributeKey","minimumLength","hasResults","originalEvent","split","parseInt","detail","toLowerCase","removeAttribute","shown","some","attrKey","includes","getLabel","toggle","setAttribute","__isChildViews__","disableChildViews","isChildViews","showLoaded","arrowNavigationPatch","list","arrowNavaigationPatched_","focusPrevElement","prevIndex","wrapFocus_","getListItemCount","listItemEl","listElements","LIST_ITEM_DISABLED_CLASS","focusNextElement","nextIndex","disabledListItemCheckboxPatch","disabledListItemCheckboxPatched_","initializeListType","setCheckedCheckboxOrRadioAtIndex","isChecked","toggleEl","strings","CHECKBOX_RADIO_SELECTOR","checked","document","createEvent","initEvent","dispatchEvent","keysDown","subscribers","commandKeys","isKeyDown","_k","window","addEventListener","defaultPrevented","execute","commandKey","metaKey","ctrlKey","isInput","subscriber","withinEl","keyEvents","global","requiresCommandKey","_key","allowInput","modifier","keyCount","splice","defaults","Drop","drop","dropped","dropView","dropEvent","isEvtWithFiles","getFilesFromEvent","files","catch","stopDropPropagation","materialRipples","MDCRipple","ripple","activate","deactivate","materialCheckboxes","checkboxEl","checkbox","MDCCheckbox","formField","MDCFormField","Menu","anchorEl","dropdownToggle","parentElement","hoist","horizontal","destroyOnClose","onClosed","closed","onOpen","opened","onAction","itemSelected","recalculatePosition","onClick","clicked","onTap","unbounded","onToggleClick","toggleClicked","onToggleTap","menu","createMenu","_open","autoOpen","open","backdrop","body","removeChild","menuSurface_","isHoistedElement_","appendChild","parentNode","_ignoreItemSelection","close","onMenuClose","MDCMenu","list_","setVerticalOrientation","handleBodyTap_","evt","handleBodyClick","registerBodyTapListener_","deregisterBodyTapListener_","removeEventListener","listen","MDCMenuSurfaceFoundation","OPENED_EVENT","CLOSED_EVENT","reEnableTouchEventsTimeout","style","item","onMenuItemSelect","MouseEvent","bubbles","cancelable","simulateClickBody","setFixedPosition","hoistMenuToBody","createElement","cancelItem","innerWidth","onMenuOpen","menuSurface","dimensions_","getInnerDimensions","autoPosition_","materialMenus","addMaterialMenu","els"],"mappings":";uyBAIA,MAAMA,EAAO,OASAC,EAAQ,CAMpBC,QAAQC,GACP,EAWDC,kBAOCC,KAAKC,YAAcD,KAAKE,YAAcF,KAAKG,aAAe,CAAC,CAC5D,EASAC,eACCJ,KAAKK,OAAS,CAAC,EAEfC,EAAEC,KAAKP,KAAKQ,EAAE,WAAWC,IAExB,MAAMC,EAASD,EAAGE,KAAOF,EAAGE,KAAOF,EAAGG,GAEvB,SAAXH,EAAGI,MAA8B,YAAXJ,EAAGI,KAUzBH,IACHV,KAAKK,OAAQ,IAAGK,KAAYV,KAAKQ,EAAEC,IAR9BT,KAAKK,OAAQ,IAAGK,OAEpBV,KAAKK,OAAQ,IAAGK,KAAYV,KAAKQ,EAAG,gBAAeE,OAOrD,GAEF,EASAI,UAAUhB,GAEJE,KAAKe,SAAYf,KAAKe,QAAQC,SAE/BhB,KAAKiB,eACRjB,KAAKe,QAAQG,SACTlB,KAAKe,QAAQI,KAAK,kBACrBnB,KAAKe,QAAQK,KAAKpB,KAAKe,QAAQI,KAAK,oBAGrCnB,KAAKe,QAAQM,UACTrB,KAAKe,QAAQI,KAAK,mBACrBnB,KAAKe,QAAQK,KAAKpB,KAAKe,QAAQI,KAAK,oBAGvC,EAqBAG,QAAQC,EAAOC,GAGd,GAAIA,EACH,GAAIxB,KAAKyB,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bsa,EAAc3R,KAAK6O,GACnB9W,GAAQ8W,EAAKI,MAAM,EAIpB5X,EACEE,GAAG,gBAAiBoF,GACpBpF,GAAG,aAAcoF,GACjBpF,GAAG,gBAAgB,KACnB,MAAMzJ,EAAKuJ,EAASvJ,GACd+jB,EAAM/jB,EAAGkQ,UAAUG,SAAS,4BAC/B,CAACrQ,GACD4P,YACA,IAAIrG,EAASvJ,GAAG6P,iBAAiB,8BACjCtG,EAASuG,oBAEZ+T,EAAgBE,EAAI1gB,KAAKsc,GACjB,IAAID,EAAKC,EAAUpW,EAAUsD,EAAKgX,gBACxC,GAEL,GAAG3kB,GAhCkD2C,C","file":"33.bundle.min.js?2.23.2.92950101.1696963302561","sourcesContent":["/**\n * @module core/functionality/form\n */\n\nconst NAME = 'form';\n\nimport CoreCollection from '../lib/netx-collection';\nimport FormErrorListView from '@netx/core-app/views/formErrorListView';\n\nimport {unescapeAttributeName} from '@netx/core/lib/underscore-netx';\n\nimport 'core-libs/formValidation-netx';\n\nexport const Props = {\n\t/**\n\t * Do anything you want when a field loses focus\n\t * @method\n\t * @param {event} e jQuery event\n\t */\n\tblurred(e) {\n\t\t//\n\t},\n\n\t/**\n\t * To support arbitrary re-rendering of the form at any time,\n\t * we cache all form values in _.formValues during preRender\n\t * and restore them (one by one) in postRender.\n\t * @see restoreCachedFormValue\n\t * @see flushCachedFormValues\n\t * @method\n\t */\n\tcacheFormValues() {\n\t\t//this._formValues = this.formChanged ? this.formValues() : {};\n\t\t// TODO: this sometimes fails, because subclasses override .formValues() in all sorts\n\t\t// of different ways. I had a note in here to not do that ... but it's been pretty useful.\n\t\t//\n\t\t// I think the solution is to call the non-overriden method, Netx.Views.FormView.protytpe.formValues(),\n\t\t// for just this specific case:\n\t\tthis._formValues = this.formChanged ? this.formValues() : {};\n\t},\n\n\t/**\n\t * You may want to override this.cacheQueries(), to cache more queries.\n\t * By default it caches jQuery queries, by name, for all form inputs. They are stored in the object this.inputs.\n\t * Example: if the template contains a form field named \"address\", it will be cached in this.inputs.$address .\n\t * (The leading $ is a naming convention to indicate a jQuery query.)\n\t * @method\n\t */\n\tcacheQueries() {\n\t\tthis.inputs = {};\n\n\t\t_.each(this.$(':input'), el => {\n\t\t\t// if element doesn't have a name, use id; if not that, fuggedaboutit.\n\t\t\tconst elName = el.name ? el.name : el.id;\n\n\t\t\tif (el.type == 'radio' || el.type == 'checkbox') {\n\t\t\t\t// Radios always come in groups, checkboxes sometimes do too.\n\t\t\t\t// If we haven't cached the complete group yet,\n\t\t\t\tif (!this.inputs[`$${elName}`]) {\n\t\t\t\t\t// cache it now.\n\t\t\t\t\tthis.inputs[`$${elName}`] = this.$(`:input[name=\"${elName}\"]`);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// or if the element is unnamed, discard it.\n\t\t\tif (elName) {\n\t\t\t\tthis.inputs[`$${elName}`] = this.$(el);\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * this.checkForm() is called at render, and on every form change.\n\t * If your form needs to manipulate itself based on changes, override this method to do that.\n\t * By default, it enables or disables the submit button based on the return value of this.submitReady();\n\t * @method\n\t * @param {event} e jQueryEvent (optional)\n\t */\n\tcheckForm(e) {\n\t\t// if this form hasn't ever rendered, there's nothing we can do here.\n\t\tif (!this.$submit || !this.$submit.length) return;\n\n\t\tif (this.submitReady()) {\n\t\t\tthis.$submit.enable();\n\t\t\tif (this.$submit.data('enabled-label')) {\n\t\t\t\tthis.$submit.html(this.$submit.data('enabled-label'));\n\t\t\t}\n\t\t} else {\n\t\t\tthis.$submit.disable();\n\t\t\tif (this.$submit.data('disabled-label')) {\n\t\t\t\tthis.$submit.html(this.$submit.data('disabled-label'));\n\t\t\t}\n\t\t}\n\t},\n\n\t// /**\n\t// * this.clearForm() clears out all values in the form.\n\t// * http://stackoverflow.com/questions/680241/resetting-a-multi-stage-form-with-jquery\n\t// * @method\n\t// * @deprecated\n\t// * @todo This is all handled in our reset wrapper above.\n\t// */\n\t// clearForm() {\n\t// \tconsole.warn('formView.clearForm deprecated, gone in 8.13');\n\t// \tthis.$el.find('input:text, input:password, input:file, select, textarea').val('');\n\t// \tthis.$el.find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected');\n\t// \t// TODO: reset changes?\n\t// }\n\n\t/**\n\t * Is called when this.eventStr + \":error\" is triggered\n\t * @method\n\t * @param {string} error Error string\n\t */\n\tfailure(error, thing) {\n\t\t// Check that the failure was for us (comes from :error)\n\t\t// Our pattern has been to have the model/collection as the second argument passed back from the success event\n\t\tif (thing) {\n\t\t\tif (this.model && thing.isModel) {\n\t\t\t\tif (thing !== this.model) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if (this.collection && thing.isCollection) {\n\t\t\t\tif (thing !== this.collection) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.submitting) {\n\t\t\tthis.submitting.rejectWith(this, arguments);\n\t\t\tdelete this.submitting;\n\t\t}\n\t\tthis.$el.removeClass('form-submitting');\n\t\tthis.$('.form-submitting').hide();\n\t},\n\n\t/**\n\t * A new input field was added\n\t * @method\n\t * @param e Field added event (nx)\n\t */\n\tfieldAdded(e) {\n\t\tconst validator = this.validator;\n\t\tconst $target = $(e.target);\n\t\tif (validator.enabled && validator.plugin) {\n\t\t\tvalidator.plugin.addField($target);\n\t\t\tif (this.revalidateFieldOnAdd) {\n\t\t\t\tvalidator.plugin.revalidateField($target);\n\t\t\t}\n\t\t}\n\t\t// Add reference to the cached queries\n\t\tif (this.inputs) {\n\t\t\tthis.inputs['$' + e.target.name] = $target;\n\t\t}\n\t},\n\n\t/**\n\t * An input field is being modifed, assume it will be non recoverable and remove from\n\t * the validation instance (will be added back in `this.fieldMutated` if the proper event is fired by the view in charge)\n\t * @method\n\t * @param e Field changing event (nx)\n\t */\n\tfieldMutating(e) {\n\t\tconst validator = this.validator;\n\n\t\tvalidator.enabled &&\n\t\t\tvalidator.plugin &&\n\t\t\tvalidator.plugin._cacheFields[e.target.name] &&\n\t\t\tvalidator.plugin.removeField($(e.target));\n\t},\n\n\t/**\n\t * Should be fired right after the input field has been mutated (see `this.fieldMutating`)\n\t * @method\n\t * @param e Field changed event (nx)\n\t */\n\tfieldMutated(e) {\n\t\tconst validator = this.validator;\n\t\tconst $target = $(e.target);\n\t\tif (validator.enabled && validator.plugin) {\n\t\t\tvalidator.plugin.addField($target).revalidateField($target);\n\t\t}\n\t\t// Add reference back to the cached queries\n\t\tif (this.inputs) {\n\t\t\tthis.inputs['$' + e.target.name] = $target;\n\t\t}\n\t},\n\n\t/**\n\t * Should be fired right before the filed is removed from the DOM\n\t * Important that the input is still in the DOM so we can properyly remove validation\n\t * @method\n\t * @param e Field removed event (nx)\n\t */\n\tfieldRemoved(e) {\n\t\tconst validator = this.validator;\n\n\t\tvalidator.enabled &&\n\t\t\tvalidator.plugin &&\n\t\t\tvalidator.plugin._cacheFields[e.target.name] &&\n\t\t\tvalidator.plugin.removeField($(e.target));\n\n\t\t// Remove cached query\n\t\tif (this.inputs) {\n\t\t\tdelete this.inputs['$' + e.target.name];\n\t\t}\n\t},\n\n\t/**\n\t * A field has been deemed invalid\n\t * @method\n\t * @param {event} e jQuery event\n\t * @param {object} fvf formValidation field object\n\t */\n\tfieldValidationFailure(e, fvf) {\n\t\t//console.log( \"field validation error\", e, fvf );\n\t\t// TODO: Revisit if you notice anything weird with tooltips on form errors. Does not seem to be needed anymore.\n\t\t// if(e.target.attributes.getNamedItem('data-fv-container') === null) {\n\t\t// \tvar $parent = data.element.parents('.form-group'),\n\t\t// \t\t$icon\t= $parent.find('.form-control-feedback[data-fv-icon-for=\"' + data.field + '\"]'),\n\t\t// \t\ttitle\t= $icon.data('bs.tooltip').getTitle();\n\t\t// \t// Destroy the old tooltip and create a new one positioned to the right\n\t\t// \t$icon.tooltip('destroy').tooltip({\n\t\t// \t\thtml: true,\n\t\t// \t\tplacement: 'right',\n\t\t// \t\ttitle: title\n\t\t// \t} );\n\t\t// }\n\t},\n\n\t/**\n\t * A field has been deemed valid\n\t * @method\n\t * @param {event} e jQuery event\n\t * @param {object} fvf formValidation field object\n\t */\n\tfieldValidationSuccess(e, fvf) {\n\t\t// console.log( \"field validation success\", e, fvf );\n\t\t// If we have submitted before then we obviously had some errors\n\t\tif (this.errorCache.length && this.submitted) {\n\t\t\tthis.errorCache.remove(fvf.element.attr('name'));\n\t\t}\n\t},\n\n\t/**\n\t * Clear all form values we may have cached during a render\n\t * @method\n\t * @see cacheFormValues\n\t * @see restoreCachedFormValue\n\t */\n\tflushCachedFormValues() {\n\t\tdelete this._formValues;\n\t},\n\n\t/**\n\t * this.focus() is called when the form is shown or rendered; override it to set form focus how you like it.\n\t * The default does this: http://stackoverflow.com/questions/267615/focusing-first-control-in-the-form-using-jquery\n\t * @method\n\t * @param {string} selector jQuery selector string\n\t */\n\tfocus(selector) {\n\t\tif (selector == null) {\n\t\t\tthis.$('form:not(.filter) :input:visible:enabled:first').focus();\n\t\t} else {\n\t\t\tthis.$(selector).focus();\n\t\t}\n\t},\n\n\t/**\n\t * The form was submitted but was invalid\n\t * @method\n\t * @param {event} e jQuery event\n\t * @fires (this.eventStr):validation:failure\n\t * @fires module:notification#notification\n\t */\n\tformValidationFailure(e) {\n\t\t// Set errors\n\t\tthis.errorCache.set(\n\t\t\t_.map(this.getValidationErrors(), input => {\n\t\t\t\treturn {\n\t\t\t\t\tid: input.name,\n\t\t\t\t\tname: input.name,\n\t\t\t\t\tinput: $(input),\n\t\t\t\t};\n\t\t\t}),\n\t\t);\n\n\t\tdispatcher.trigger(`${this.eventStr}:validation:failure`, this);\n\t\tthis.submitted = true;\n\t\t// We will need to rethink this as you cannot read the whole message in that little notification box.\n\t\tdispatcher.trigger('notification', {\n\t\t\tmodule: 'app',\n\t\t\ttitle: i18n.t('i18n.error'),\n\t\t\tdescription: i18n.t('i18n.invalidForm'),\n\t\t\ttype: 'danger',\n\t\t});\n\t},\n\n\t/**\n\t * Form was successfully validated\n\t * @method\n\t * @param {event} e jQuery event\n\t */\n\tformValidationSuccess(e) {\n\t\t// forward the event\n\t\tdispatcher.trigger(`${this.eventStr}:validation:success`, this);\n\t},\n\n\t/**\n\t * this.formValues() gathers the names and values of all the form inputs into one simple JS object for submission to a submit event handler.\n\t * This should not need to be overridden -- if it's not working, let's fix it.\n\t * @method\n\t * @return {object} Object containing input form values\n\t */\n\tformValues() {\n\t\t// HACK: the initial query caching can fail for the assetAttributes view, because its fields\n\t\t// all have templates that are still loading. We solved that for childViews ... so attrs should\n\t\t// just be converted to childViews. For now, make sure we get everything by caching once more.\n\t\t//\n\t\t// TODO: this shouldn't be necessary now that templates are preloaded. Remove this?\n\t\t// No, so much depends on this behavior apparently - that is how unknown (new) inputs magically found their way in to this.inputs.\n\t\tthis.cacheQueries();\n\n\t\tconst values = {};\n\t\t_.each(this.inputs, (i, $idx, all) => {\n\t\t\t// TODO: there's some oddness here:\n\t\t\t// At this point, i is a jquery selector,\n\t\t\t// but we're also using $(i) below -- which works, but is not necessary.\n\t\t\t// Also: use .is() to determine attr type & state, instead of all that .attr/.prop stuff.\n\t\t\t// In general this method needs cleanup & better doc, but it's working, so ...\n\n\t\t\t// '$foo' -> 'foo'\n\t\t\tlet idx = $idx.slice(1);\n\n\t\t\t// Skip any auto-generated form elements created by select2 -- they don't contain our data.\n\t\t\t// TODO: do this in cacheQueries() instead. (Never even cache these.)\n\t\t\tif (idx.match(/s2id_autogen\\d/)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If we have multiple inputs with array styled names (like attribute[0], attribute[1]);\n\t\t\tlet match = idx.match(/\\[(.*?)\\]/g);\n\n\t\t\tif (!_.isNull(match)) {\n\t\t\t\tif (match.length === 1) {\n\t\t\t\t\tidx = idx.replace(/\\[(.*?)\\]/, '');\n\t\t\t\t\tif (!values[idx]) {\n\t\t\t\t\t\tvalues[idx] = _.isNumeric(idx) ? [] : {};\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-useless-escape\n\t\t\t\t\tvalues[idx][match[0].replace(/[\\[\\]']+/g, '')] =\n\t\t\t\t\t\ti.attr('type') == 'checkbox'\n\t\t\t\t\t\t\t? i.prop('checked')\n\t\t\t\t\t\t\t: i.attr('type') == 'radio'\n\t\t\t\t\t\t\t? i.filter(':checked').val()\n\t\t\t\t\t\t\t: i.val();\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// (like attribute[thing1][thing], attribute[thing2][thing])\n\t\t\t\t\tconst topLevelName = idx.replace(match.join(''), '');\n\t\t\t\t\tif (_.isUndefined(values[topLevelName])) {\n\t\t\t\t\t\tvalues[topLevelName] = {};\n\t\t\t\t\t}\n\t\t\t\t\t_.reduce(\n\t\t\t\t\t\tmatch,\n\t\t\t\t\t\t(memo, name, index, all) => {\n\t\t\t\t\t\t\t// eslint-disable-next-line no-useless-escape\n\t\t\t\t\t\t\tname = name.replace(/[\\[\\]']+/g, '');\n\t\t\t\t\t\t\tif (_.isUndefined(memo[name])) {\n\t\t\t\t\t\t\t\tmemo[name] =\n\t\t\t\t\t\t\t\t\tindex + 1 < all.length\n\t\t\t\t\t\t\t\t\t\t? {}\n\t\t\t\t\t\t\t\t\t\t: i.attr('type') == 'checkbox'\n\t\t\t\t\t\t\t\t\t\t? i.prop('checked')\n\t\t\t\t\t\t\t\t\t\t: i.attr('type') == 'radio'\n\t\t\t\t\t\t\t\t\t\t? i.filter(':checked').val()\n\t\t\t\t\t\t\t\t\t\t: i.val();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn memo[name];\n\t\t\t\t\t\t},\n\t\t\t\t\t\tvalues[topLevelName],\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we have broken a multiselect into individual checkboxes, save only the box that's checked.\n\t\t\tmatch = idx.match(/-checkbox(\\d+)$/);\n\t\t\t// DEVNOTE: to match normal multiselect behavior, we need 'null' instead of empty array for no selection.\n\t\t\tif (!_.isNull(match)) {\n\t\t\t\tif (!values[match[1]]) {\n\t\t\t\t\tvalues[match[1]] = '';\n\t\t\t\t}\n\t\t\t\tif ($(i).prop('checked')) {\n\t\t\t\t\t// convert the csv to an array, append to it, then convert back\n\t\t\t\t\tvalues[match[1]] = _.arrayToCsv(\n\t\t\t\t\t\t_.csvToArray(values[match[1]]).concat($(i).val()),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for multiselects, encode the array value as CSV.\n\t\t\tif (i.prop('multiple')) {\n\t\t\t\tvalues[idx] = _.arrayToCsv(i.val());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If this is a radio button, find the radio button by this name that's actually checked\n\t\t\tif ($(i).attr('type') == 'radio') {\n\t\t\t\tconst checkedRadio = this.$(':input[name=\"' + i[0].name + '\"]:checked');\n\t\t\t\tif (checkedRadio.length) {\n\t\t\t\t\ti = checkedRadio;\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If this is a checkbox group, amalgamate the checked values.\n\t\t\tif (i.is(':checkbox') && i.length > 1) {\n\t\t\t\tconst checkedBoxes = this.$(':input[name=\"' + i[0].name + '\"]:checked');\n\t\t\t\t// convert to array of values:\n\t\t\t\tvalues[idx] = checkedBoxes.map(function(elIdx, el) {\n\t\t\t\t\treturn $(el).val();\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvalues[idx] = i.attr('type') == 'checkbox' ? i.prop('checked') : i.val();\n\t\t});\n\n\t\treturn values;\n\t},\n\n\t/**\n\t * Gets a jQuery array of invalid fields\n\t * @method\n\t * @return {array} Invalid fields\n\t */\n\tgetValidationErrors() {\n\t\tconst validation = this.Plugins.GetInstance('validation');\n\t\tif (validation) {\n\t\t\treturn validation.getInvalidFields();\n\t\t}\n\t\treturn [];\n\t},\n\n\t/**\n\t * Ok, there are some issues with trying to be agnostic and having input/select ui plugins that hide the original element\n\t * you still want that hidden element to be validated but it is almost impossible to know (without modifying code each time you add a plugin)\n\t * if the element was hidden intentionally (like we do in attribute forms) and when an element was hidden to manipulate the ui only.\n\t * Solution: rather than calling hide/show/toggle directly on the elements in the view- pass the elements through here.\n\t * It also handles bulk hiding (the validator will look at parents for the data-nx-ignore=\"validation\" attribute as well)\n\t * If validation is not turned on for whatever reason the element passed will be sent to where it would have gone\n\t * @param {element} input The jQuery element to hide\n\t */\n\thideField(...input) {\n\t\tconst inputs = [...input];\n\t\tconst $form = this.$form;\n\t\tconst plugins = this.Plugins;\n\t\tconst validation = this.validator.enabled;\n\n\t\t_.each(inputs, input => {\n\t\t\tlet $input = $(input);\n\t\t\tif (!$input.is(':input')) {\n\t\t\t\t$input = $input.find(':input');\n\t\t\t}\n\n\t\t\tlet $formGroup = $input.closest('.form-group');\n\t\t\tif (!$formGroup.length) {\n\t\t\t\t$formGroup = $input;\n\t\t\t}\n\n\t\t\tif (validation) {\n\t\t\t\t_.each($input, el => {\n\t\t\t\t\tel.name &&\n\t\t\t\t\t\tplugins.Invoke('validation', $form, 'updateStatus', [\n\t\t\t\t\t\t\tel.name,\n\t\t\t\t\t\t\t'VALID',\n\t\t\t\t\t\t]);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t$input.nxIgnore('validation');\n\t\t\t$formGroup.hide();\n\t\t});\n\t},\n\n\t/**\n\t * Tell FormView that a form changed happened.\n\t * It sets the formChanged flag, and calls checkForm() to potentially enable the submit button.\n\t * Form input change events are forwarded here (see events{} block).\n\t * Various other form tricks (like adding/removing inputs from the form) may also need to trigger this.\n\t * @method\n\t * @param {event} e Change event (optional)\n\t */\n\tinputChanged(e) {\n\t\tlet $target, changeEvent;\n\t\tif (e instanceof jQuery.Event) {\n\t\t\tchangeEvent = e;\n\t\t\t$target = this.$(changeEvent.target);\n\t\t\tif (\n\t\t\t\t$target.nxIgnores('change') ||\n\t\t\t\t$target.hasClass('select2-search__field')\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.formChanged = true;\n\t\tthis.trigger('formChanged', $target);\n\t\tthis.checkForm(changeEvent);\n\t},\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\tisValid() {\n\t\treturn this.submitReady();\n\t},\n\n\t/**\n\t * this.keydown() checks if there are more erros and focus the input with the next error\n\t * @method\n\t * @param {event} e jQuery event\n\t */\n\tkeydown(e) {\n\t\tconst keyCode = e.keyCode || e.which;\n\t\t// Only care if it was an enter key\n\t\tif (keyCode === 13 && this.errorCache.length) {\n\t\t\tthis.errorCache\n\t\t\t\t.at(0)\n\t\t\t\t.get('input')\n\t\t\t\t.focus();\n\t\t}\n\t},\n\n\t/** @override */\n\tprepareForm() {\n\t\t// Cleanup\n\t\tthis.$form && this.$form.off();\n\t\tthis.validator.enabled = false;\n\t\tthis.Plugins.Destroy('validation');\n\n\t\tif (this.disableCache) {\n\t\t\t// Fresh start\n\t\t\tthis.formChanged = false;\n\t\t\tthis._formValues = {};\n\t\t} else {\n\t\t\tthis.cacheFormValues();\n\t\t}\n\t},\n\n\t/**\n\t * Do not override postRender() without calling the superclass imlementation (this._super ) explicity!\n\t * Sets up submit target and calls {@link #cacheQueries} and {@link #checkForm}.\n\t * @method\n\t */\n\trenderForm() {\n\t\t// Cache\n\t\tthis.$form = this.$('form:first');\n\t\tthis.$submit = this.$('[type=\"submit\"]');\n\t\tthis.$target = this.$('.target');\n\n\t\t/**\n\t\t * Form permissions:\n\t\t * Asset and category models have an 'allows' method that checks their internal permissions\n\t\t * against the current use ID and one of the default permission types (for instance, 'modify').\n\t\t *\n\t\t * If this.model.allows() is a method, and this.matrix is a string,\n\t\t * FormView will test that string using that function, and put the form into 'read-only' mode if the test fails:\n\t\t * the class 'read-only' will be added to the top-level element, and all inputs will be disabled.\n\t\t *\n\t\t * Individual form inputs that need to override this can set the HTML attrbute \"data-nx-matrix\"\n\t\t * to a different permision name (for instance, 'read') and that permission will be tested instead.\n\t\t */\n\n\t\t// https://jira.netx.net/browse/DAM-9780\n\t\t// We do not want to collide with `attributePermissions` and `permissionMatrix`\n\t\t// Really, we need to break the attribute code out of formView and let it do what it does best: forms\n\t\tlet readonly = false;\n\n\t\tthis.$el.toggleClass('read-only', readonly);\n\n\t\tlet disabledCount = 0;\n\t\tlet emptyCount = 0;\n\t\tlet inputCount = 0;\n\t\t// TODO: Start using form names and target our searches for inputs to that specific form\n\t\t// That way we can start utilizing nested forms without interference\n\t\t// Iterate over each input in the form:\n\t\t_.each(this.$(':input').not(':button'), element => {\n\t\t\tconst $element = $(element);\n\t\t\t// Is this input for toggling \"append value\"?\n\t\t\tconst isAppend = $element.hasClass('nx-append-value');\n\n\t\t\t// Track amount of inputs\n\t\t\t// Omit \"append value\" toggles\n\t\t\tif (!isAppend) {\n\t\t\t\tinputCount++;\n\t\t\t}\n\n\t\t\tconst $input = $element;\n\t\t\t// TODO: This code will never get hit because we explicitely set this to fale with no way to change it from the outside\n\t\t\t// Disable the input if we're read-only:\n\t\t\tif (readonly) {\n\t\t\t\tconst disableInput = !$input.nxIgnores('matrix');\n\n\t\t\t\t$input\n\t\t\t\t\t.prop('disabled', disableInput)\n\t\t\t\t\t.closest('.form-group')\n\t\t\t\t\t.toggleClass('read-only', disableInput);\n\n\t\t\t\t// Track the amount of disabled inputs\n\t\t\t\tif (disableInput) {\n\t\t\t\t\tdisabledCount++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// restore the value from before render, if any\n\t\t\tconst cachedValue = this.restoreCachedFormValue($element) || $input.val();\n\t\t\tconst value = cachedValue;\n\t\t\tlet hasValue = !_.isUndefined(value);\n\t\t\tif (hasValue) {\n\t\t\t\tif (_.isArray(value)) {\n\t\t\t\t\thasValue = value.length > 0;\n\t\t\t\t} else if (_.isString(value)) {\n\t\t\t\t\thasValue = value.trim() != '';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Track the amount of empty inputs\n\t\t\tif (!isAppend && !hasValue) {\n\t\t\t\temptyCount++;\n\t\t\t}\n\t\t});\n\n\t\t// if our form has any backbone tooltips, initialize that piece of Backbone.\n\t\tthis.$('[data-toggle=\"tooltip\"]').tooltip();\n\n\t\tthis.cacheQueries();\n\n\t\t// Validation error list element\n\t\tthis.$validationErrors = this.$('[data-nx-control=\"validation-errors\"]');\n\t\tthis.errorCacheView.setElement(this.$validationErrors).render();\n\n\t\t// Are all the fileds disabled\n\t\tthis.$el.toggleClass(\n\t\t\t'all-fields-disabled',\n\t\t\t!_.isEmpty(this.inputs) && disabledCount >= inputCount,\n\t\t);\n\t\t// Are all the fields empty\n\t\tthis.$el.toggleClass(\n\t\t\t'all-fields-empty',\n\t\t\t!_.isEmpty(this.inputs) && emptyCount >= inputCount,\n\t\t);\n\n\t\t// DEVNOTE: X7 core code should not be making UX decisions like\n\t\t// determining whether a form field gains focus when shown. The\n\t\t// theme itself should decide when to utilize a formView's focus() method.\n\t\t// this.focus();\n\n\t\t// Most likely cases of this- modals\n\t\t// If the element is not visible then neither is any of its inputs\n\t\t// We can not get validation on inputs that are not visible\n\t\t// So let's wait to check the form until it is shown\n\t\tthis.whenShown.then(this.checkForm);\n\t},\n\n\t/**\n\t * this.reset() is intended to reset the form into a clean initial state.\n\t * The actual reset of the form is handled in a wrapper above.\n\t * This method is intended to provide child views the ability to reset private\n\t * variables, set up complex UI elements, etc.\n\t * this.reset() is called automatically when this.show() is called, if the\n\t * boolean this.resetOnShow is true and the view is not already visible in the DOM.\n\t * @method\n\t */\n\treset() {\n\t\tconst $form = this.$('form');\n\t\t// Vanilla reset\n\t\t$form.length && $form[0].reset();\n\t\t// Validator reset - only resets fields that would be validated\n\t\tthis.validator.enabled &&\n\t\t\tthis.Plugins.Invoke('validation', $form, 'resetForm');\n\n\t\t// Other\n\t\tthis.formChanged = false;\n\t\tthis.submitted = false;\n\t\t// If the submitting promise is still around for some reason\n\t\tif (this.submitting) {\n\t\t\t// And it is still in a pending state - reject\n\t\t\tthis.submitting.state() === 'pending' && this.submitting.rejectWith(this);\n\t\t\tdelete this.submitting;\n\t\t}\n\t},\n\n\t/**\n\t * Restore a single form value from the cache\n\t * @method\n\t * @param {object} element jQuery element\n\t * @return {mixed} Cached value\n\t * @see cacheFormValues\n\t * @see flushCachedFormValues\n\t */\n\trestoreCachedFormValue($element) {\n\t\tconst inputName = $element.attr('name');\n\t\tlet value;\n\n\t\tif (\n\t\t\tinputName == null ||\n\t\t\tinputName === false ||\n\t\t\t!this._formValues ||\n\t\t\t!_.has(this._formValues, inputName)\n\t\t)\n\t\t\treturn value;\n\n\t\t// We have to unpack the cache differently for different input types.\n\t\tif ($element.prop('multiple')) {\n\t\t\tvalue = _.csvToArray(this._formValues[inputName]);\n\t\t\t$element.val(value);\n\t\t\treturn value;\n\t\t}\n\t\tif ($element.attr('type') === 'checkbox') {\n\t\t\tvalue = this._formValues[inputName];\n\t\t\t$element.prop('checked', value);\n\t\t\treturn value;\n\t\t}\n\n\t\t// If it's a radio, we need to check the correct option in the group\n\t\tif ($element.attr('type') === 'radio') {\n\t\t\tvalue = this._formValues[inputName];\n\t\t\t$element.prop('checked', $element.val() === value);\n\t\t\treturn value;\n\t\t}\n\n\t\tvalue = this._formValues[inputName];\n\t\t$element.val(value);\n\t\treturn value;\n\t},\n\n\t/**\n\t * this.setForm(values) sets all inputs to the values given.\n\t * @method\n\t * @param {object} values Form values\n\t */\n\tsetForm(values) {\n\t\t_.each(values, (v, idx) => this.setValue(idx, v));\n\t},\n\n\t/**\n\t * this.setFormValidation() is called at postRender and initializes form validation\n\t * @method\n\t * @param {element} $form Form element\n\t */\n\tsetFormValidation($form) {\n\t\t$form = $form || this.$('form[data-nx-validate-form]');\n\n\t\t// Cleanup\n\t\tthis.Plugins.Destroy('validation');\n\t\tthis.validator.enabled = false;\n\n\t\tif (!$form.length) return;\n\n\t\tthis.validator.enabled = true;\n\t\tthis.Plugins.Initialize('validation', $form).then(instance => {\n\t\t\t// Store\n\t\t\tthis.validator.plugin = instance;\n\n\t\t\t// Pipe some events\n\t\t\t_.each(\n\t\t\t\t['err.form.fv', 'err.field.fv', 'success.form.fv', 'success.field.fv'],\n\t\t\t\tevent => {\n\t\t\t\t\t$form.off(event).on(event, (...args) => {\n\t\t\t\t\t\tthis.trigger(`validation:${event}`, ...args);\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t);\n\n\t\t\t// FV does a weird thing: it catches submit events, preventsDefault() on them,\n\t\t\t// and detects if they were due to a submit button click or not.\n\t\t\t// BUT it doesn't call stopPropagation() on them.\n\t\t\t// Then after validation succeeds, it triggers a new submit event\n\t\t\t// *only if* the original submit was from a button click. But\n\t\t\t// the original submit event propagates either way.\n\t\t\t//\n\t\t\t// So our submit event handler would get two submit events if form is valid & submit button was clicked,\n\t\t\t// but one otherwise, whether or not the form is valid. That's bizarre.\n\t\t\t//\n\t\t\t// FV's official policy is that you should give up on the submit event and listen\n\t\t\t// for their success event instead; however, that requires a lot of special-FV-handling\n\t\t\t// code, and not all our forms have FV on them. Either they don't understand\n\t\t\t// the problem well enough, or I don't understand their special needs yet ...\n\t\t\t//\n\t\t\t// FormView wants to get one event if validation succeeds, no events otherwise.\n\t\t\t// It wants to remain agnostic about where the event came from, and\n\t\t\t// whether or not fv is enabled.\n\t\t\t//\n\t\t\t// Here we override FV, to have it stopPropagation on the original event if\n\t\t\t// fv already detected a button click.\n\t\t\t//\n\t\t\t// TODO: test in all browsers, with all three submission techniques: click submit,\n\t\t\t// trigger submit event, or call view.submit().\n\t\t\t//\n\t\t\t// Tested in Chrome, works fine.\n\t\t\t// Tested in Safari, works fine.\n\t\t\t$form.off('submit.fv').on('submit.fv', e => {\n\t\t\t\t// fv does this.\n\t\t\t\te.preventDefault();\n\t\t\t\t// fv doesn't do this.\n\t\t\t\tinstance.$submitButton && e.stopPropagation();\n\t\t\t\tinstance.validate();\n\t\t\t});\n\n\t\t\t// Let the view know\n\t\t\tthis.trigger('validation:set', this, instance);\n\t\t});\n\t},\n\n\t/**\n\t * Set an individual form value.\n\t * @method\n\t * @param {string} input Input name\n\t * @param {string} value New input value\n\t */\n\tsetValue(input, value) {\n\t\tthis.$(':input')\n\t\t\t.filter(`[name=\"${input}\"]`)\n\t\t\t.val(value);\n\t},\n\n\t/**\n\t * Ok, there are some issues with trying to be agnostic and having input/select ui plugins that hide the original element\n\t * you still want that hidden element to be validated but it is almost impossible to know (without modifying code each time you add a plugin)\n\t * if the element was hidden intentionally (like we do in attribute forms) and when an element was hidden to manipulate the ui only.\n\t *\n\t * Solution: rather than calling hide/show/toggle directly on the elements in the view- pass the elements through here.\n\t * It also handles bulk hiding (the validator will look at parents for the data-nx-ignore=\"validation\" attribute as well)\n\t * If validation is not turned on for whatever reason the element passed will be sent to where it would have gone\n\t * @param {element} input The jQuery element to hide\n\t * @fires module:app#app:resize\n\t */\n\tshowField(...input) {\n\t\tconst inputs = [...input];\n\t\tconst $form = this.$form;\n\t\tconst plugins = this.Plugins;\n\t\tconst validation = this.validator.enabled;\n\n\t\t_.each(inputs, input => {\n\t\t\tlet $input = $(input);\n\t\t\tif (!$input.is(':input')) {\n\t\t\t\t$input = $input.find(':input');\n\t\t\t}\n\n\t\t\tlet $formGroup = $input.closest('.form-group');\n\t\t\tif (!$formGroup.length) {\n\t\t\t\t$formGroup = $input;\n\t\t\t}\n\n\t\t\t$input.nxUnignore('validation');\n\t\t\t$formGroup.show();\n\n\t\t\tif (validation) {\n\t\t\t\t_.each($input, el => {\n\t\t\t\t\tel.name &&\n\t\t\t\t\t\tplugins.Invoke('validation', $form, 'resetField', [el.name]);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * this.submit() submits the current form by triggering the event this.eventStr + \":confirmed\" on dispatcher,\n\t * with the arguments returned by this.submitArgs(). A controller should catch this event\n\t * and perform whatever steps are necessary.\n\t *\n\t * @method\n\t * @param {method} submit Submit method\n\t * @param {event} e Submit event\n\t * @fires (this.eventStr):cancelled\n\t * @fires (this.eventStr):confirmed\n\t */\n\tsubmit(e) {\n\t\t// The cake stops here:\n\t\tif (e && e.preventDefault) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t} else {\n\t\t\t// There was no event argument, so we weren't called by an event handler.\n\t\t\t// Instead, other code called submit() directly.\n\t\t\t// However, that circumvents any form validation that might be present.\n\t\t\t// So we re-trigger a new submit event, which will call this method again\n\t\t\t// if validation succeeds.\n\t\t\t//\n\t\t\t// In other words, there isn't & should not be a difference between calling\n\t\t\t// this method and triggering a submit event. We are agnostic, and that is good!\n\t\t\treturn this.$('form:first').trigger('submit');\n\t\t}\n\n\t\t// Yes, the form may be valid ... but what if we disabled the submit for other reasons?\n\t\tif (!this.submitReady()) {\n\t\t\treturn this.checkForm();\n\t\t}\n\n\t\t// Let it be known\n\t\tthis.submitted = true;\n\n\t\t// Track our submit\n\t\tif (this.submitting && this.submitting.state() === 'pending') {\n\t\t\tthis.submitting.rejectWith(this);\n\t\t}\n\t\tthis.submitting = new $.Deferred();\n\n\t\tconst confirmed = () => {\n\t\t\tthis.$el.addClass('form-submitting');\n\n\t\t\t// Just submit it\n\t\t\t// Disable submit buttons\n\t\t\tthis.$('[type=\"submit\"]').disable();\n\n\t\t\t// DAM-15747 if there is a confirmMessage, then let\n\t\t\t// confirmView trigger the :confirmed event, no doubling down\n\t\t\tif (!this.confirmMessage) {\n\t\t\t\tdispatcher.trigger.apply(\n\t\t\t\t\tdispatcher,\n\t\t\t\t\t[this.eventStr + ':confirmed'].concat(this.submitArgs.apply(this)),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.$('.form-submitting').show();\n\t\t};\n\n\t\tconst cancelled = () => {\n\t\t\tif (!this.submitting) return;\n\t\t\tthis.submitting.rejectWith(this);\n\t\t\tdelete this.submitting;\n\t\t};\n\n\t\tif (this.confirmMessage) {\n\t\t\t// Confirm before submit:\n\t\t\t// If we have a confirmation message, fire a confirmation modal\n\t\t\tconst cancelEventStr = `${this.eventStr}:cancelled`;\n\t\t\t// We do want fire our `:confirmed` event twice\n\t\t\tconst confirmedEventStr = `${this.eventStr}:confirmed`;\n\n\t\t\t// custom listener methods are safe to remove\n\t\t\tconst confirmedMethod = () => {\n\t\t\t\tdispatcher.off(cancelEventStr, cancelledMethod);\n\t\t\t\tconfirmed();\n\t\t\t};\n\t\t\tconst cancelledMethod = () => {\n\t\t\t\tdispatcher.off(confirmedEventStr, confirmedMethod);\n\t\t\t\t// Re-enable etc\n\t\t\t\tthis.checkForm();\n\t\t\t\tcancelled();\n\t\t\t};\n\t\t\tdispatcher.once(confirmedEventStr, confirmedMethod);\n\t\t\tdispatcher.once(cancelEventStr, cancelledMethod);\n\n\t\t\tdispatcher.trigger.apply(\n\t\t\t\tdispatcher,\n\t\t\t\t[\n\t\t\t\t\t'app:confirm',\n\t\t\t\t\t_.extend(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmessage: _.isFunction(this.confirmMessage)\n\t\t\t\t\t\t\t\t? this.confirmMessage()\n\t\t\t\t\t\t\t\t: this.confirmMessage,\n\t\t\t\t\t\t\tyesEvent: confirmedEventStr,\n\t\t\t\t\t\t\tnoEvent: cancelEventStr,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tthis.confirmViewOpts,\n\t\t\t\t\t),\n\t\t\t\t].concat(this.submitArgs()),\n\t\t\t);\n\t\t} else {\n\t\t\t// just do it!\n\t\t\tconfirmed();\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * this.submitArgs() can be overriden to return an array of whatever args you want to pass.\n\t * by default we return three args: an object with all the input form values, our model or collection,\n\t * and this.args (which may be undefined)\n\t * @method\n\t * @return {array} Two element array: object containing input form values, and this.args\n\t */\n\tsubmitArgs() {\n\t\tconst formValues = this.formValues();\n\t\tlet _formValues = {};\n\n\t\t// Unescape our from value keys as they were escaped via the name when injecting attributes\n\t\t_.reduce(\n\t\t\tformValues,\n\t\t\t(result, value, key) => {\n\t\t\t\tresult[unescapeAttributeName(key)] = value;\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\t_formValues,\n\t\t);\n\n\t\treturn [_formValues, this.model || this.collection].concat(this.args);\n\t},\n\n\t/**\n\t * submitReady() tests if the form can be submitted yet.\n\t * There is a wrapper above for this that checks form validation and the result of this method\n\t * Returns true by default; can be overridden with any submit-enable test you like.\n\t * @method\n\t * @return {boolean} Status of the submit action: ready or not.\n\t */\n\tsubmitReady() {\n\t\tconst validation = this.Plugins.GetInstance('validation');\n\t\treturn (\n\t\t\t(!validation || validation.isValid() !== false) &&\n\t\t\t(!this.requiresChanges || this.formChanged)\n\t\t);\n\t},\n\n\t/**\n\t * Is called when :success is triggered\n\t * @method\n\t * @param {Netx.Model|Netx.Collection} thing Netx.Model or Netx.Collection\n\t * @param {boolean} isNew Whether the model was new or not\n\t */\n\tsuccess(thing) {\n\t\t// Check that the success was for us (comes from :success)\n\t\t// Our pattern has been to have the model/collection as the first argument passed back from the success event\n\t\tif (thing) {\n\t\t\tif (this.model && thing.constructor.__isModel__) {\n\t\t\t\tif (thing !== this.model) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if (this.collection && thing.constructor.__isCollection__) {\n\t\t\t\tif (thing !== this.collection) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Let the form know it is no longer changed (as data has most likely been saved)\n\t\tthis.formChanged = false;\n\t\t// Resolve submitting promise and pass back any arguments that may have come with the success\n\t\tif (this.submitting) {\n\t\t\tthis.submitting.resolveWith(this, _.rest(arguments));\n\t\t\tdelete this.submitting;\n\t\t}\n\t\t// Hide on submit\n\t\tif (this.hideOnSubmit) {\n\t\t\tif (!this.removeOnHide) {\n\t\t\t\t// Reset form\n\t\t\t\tif (this.resetOnSubmit) this.reset();\n\t\t\t}\n\t\t\tthis.hide();\n\t\t\tthis.stopListening(dispatcher, `${this.eventStr}:success`, this.success);\n\t\t}\n\t\t// Remove on submit\n\t\telse if (this.removeOnSubmit) {\n\t\t\t// Let hide handle the remove in case there are any theme related animations, etc\n\t\t\t// so set this.removeOnHide to true and call this.hide\n\t\t\tthis.removeOnHide = true;\n\t\t\tthis.hide();\n\t\t\tthis.stopListening(dispatcher, `${this.eventStr}:success`, this.success);\n\t\t}\n\t\t// Nothing\n\t\telse {\n\t\t\t// Reset form\n\t\t\tif (this.resetOnSubmit) this.reset();\n\t\t\t// Reset validation\n\t\t\tif (this.validator.enabled) {\n\t\t\t\tthis.setFormValidation();\n\t\t\t\tthis.checkForm();\n\t\t\t}\n\t\t}\n\n\t\tthis.formChanged = false;\n\t\tthis.$el.removeClass('form-submitting');\n\t\tthis.$('.form-submitting').hide();\n\t},\n\n\t/**\n\t * Ok, there are some issues with trying to be agnostic and having input/select ui plugins that hide the original element\n\t * you still want that hidden element to be validated but it is almost impossible to know (without modifying code each time you add a plugin)\n\t * if the element was hidden intentionally (like we do in attribute forms) and when an element was hidden to manipulate the ui only.\n\t * Solution: rather than calling hide/show/toggle directly on the elements in the view- pass the elements through here.\n\t * It also handles bulk hiding (the validator will look at parents for the data-nx-ignore=\"validation\" attribute as well)\n\t * If validation is not turned on for whatever reason the element passed will be sent to where it would have gone\n\t * @param {element} input The jQuery element to hide\n\t * @param {boolean} bool Hide/show boolean\n\t */\n\ttoggleField(input, bool) {\n\t\tthis[bool === true ? 'showField' : 'hideField'](input);\n\t},\n\n\t/**\n\t * Helper for validating field\n\t * @method\n\t * @param {element|string} input Input element or `name`\n\t */\n\tvalidateField(input) {\n\t\t// validateField does not seem to do much in this case\n\t\t// but revalidateField gets us what we want\n\t\tthis.validator.enabled &&\n\t\t\tthis.Plugins.Invoke('validation', this.$form, 'revalidateField', [input]);\n\t},\n\n\t//\n\t// HELPERS\n\t// When some plugins just can't get the field to fire a correct change\n\t//\n\t/**\n\t * datepicker just doesn't seem to fire the change event formValidation needs properly\n\t * @method\n\t */\n\tdatepickerChanged(e) {\n\t\t// TODO: The plugin fires a change event when the date picker is first shown... cannot seems to find a clean way to get around it\n\t\t// aside from editing their code.\n\t\t// It is in the `update` method and at the very bottom...\n\t\tthis.validateField($(e.target));\n\t},\n\n\t/**\n\t * select2 multiple just doesn't seem to fire the change event formValidation needs properly\n\t * @method\n\t */\n\tselect2changed(e) {\n\t\tthis.validateField($(e.target));\n\t},\n\n\t// /**\n\t// * Before child views are attached, search for form elements that will need validation attached.\n\t// */\n\t// hook_preChildren: function(){\n\t// \tthis._forms = this.$('form[data-nx-validate-form]');\n\t// },\n};\n\nexport default function(target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.extendFunctionality(Props);\n\ttarget.__isForm__ = true;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tinstance.isForm = true;\n\t\tinstance.$el.addClass('form-view');\n\t\tinstance.events = {\n\t\t\tsubmit: 'submit',\n\t\t\t'click .nx-cancel:first': 'cancel',\n\t\t\t'click [data-nx-control=\"close\"]:first': 'cancel',\n\t\t\t'change .select2-hidden-accessible': 'select2changed',\n\t\t\t'change [data-provide=\"datepicker\"]': 'datepickerChanged',\n\t\t\tchange: 'inputChanged',\n\t\t\tinput: 'inputChanged',\n\t\t\t// Used to check if we need to lead the user to another invalid field\n\t\t\t'blur input, select, textarea': 'blurred',\n\t\t\t// Used to check if we need to lead the user to another invalid field\n\t\t\t'keydown input': 'keydown',\n\t\t\t'keyup textarea': 'inputChanged',\n\t\t\t'click select': 'inputChanged',\n\t\t\t'nx.fieldAdded :input': 'fieldAdded',\n\t\t\t'nx.fieldMutated :input': 'fieldMutated',\n\t\t\t'nx.fieldMutating :input': 'fieldMutating',\n\t\t\t'nx.fieldRemoved :input': 'fieldRemoved',\n\t\t\t...instance.events,\n\t\t};\n\n\t\t/** @override */\n\t\tinstance.setModel = _.wrap(instance.setModel, (setModel, model, opts) => {\n\t\t\t// flush our cache when our model changes\n\t\t\tinstance.flushCachedFormValues();\n\t\t\tinstance.formChanged = false;\n\n\t\t\treturn setModel.call(instance, model, opts);\n\t\t});\n\n\t\t/** @override */\n\t\tinstance.show = _.wrap(instance.show, show => {\n\t\t\tif (!instance.isShown && instance.resetOnShow) {\n\t\t\t\tinstance.reset();\n\t\t\t}\n\t\t\treturn show.call(instance);\n\t\t});\n\n\t\tif (!instance.unsavedChanges) {\n\t\t\tinstance.unsavedChanges = (unsavedChanges, noProxy) => {\n\t\t\t\t// First check us:\n\t\t\t\t// We are a `formView` AND\n\t\t\t\t// We have changed OR\n\t\t\t\t// We have a model and it is new\n\t\t\t\tif (\n\t\t\t\t\tinstance.formChanged ||\n\t\t\t\t\t(instance.model && instance.model.isNew())\n\t\t\t\t) {\n\t\t\t\t\treturn instance;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Alternately, this.eventStr is the prefix for both the submit & cancel events generated by the form.\n\t\t * For instance, if eventStr == 'module:foo',\n\t\t * form sumission will trigger 'module:foo:confirmed' on the dispatcher, and cancel will trigger 'module:foo:cancelled'.\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tinstance.eventStr = opts.eventStr || 'module:foo';\n\n\t\t/**\n\t\t * this.confirmMessage contains a confirmation string that pops up in a confirmView before submission.\n\t\t * If you don't want any confirmation pop-up, undefine this property.\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tinstance.confirmMessage = opts.confirmMessage || false; //'Warning! This process cannot be undone. Please confirm you want to execute this job on these assets.'\n\n\t\t/**\n\t\t * Should we diable caching values at `preRender`?\n\t\t * @type {boolean}\n\t\t * @default\n\t\t */\n\t\tinstance.disableCache = opts.disableCache === true;\n\n\t\tinstance.hideOnSubmit = opts.hideOnSubmit === true;\n\n\t\tinstance.removeOnSubmit = opts.removeOnSubmit === true;\n\n\t\tinstance.revalidateFieldOnAdd = opts.revalidateFieldOnAdd === true;\n\n\t\t/**\n\t\t * resetOnShow determines whether this.reset() will be called when the form is\n\t\t * first shown. Reset will only be called when this.show() is called on a form that\n\t\t * is not yet visible.\n\t\t * @type {boolean}\n\t\t * @default\n\t\t */\n\t\tinstance.resetOnShow = opts.resetOnShow === true;\n\n\t\t/**\n\t\t * Signifies that not only must a form be valid to submit but a change must have been made as well\n\t\t * @type {boolean}\n\t\t */\n\t\tinstance.requiresChanges = opts.requiresChanges !== false;\n\n\t\t/**\n\t\t * Whether to reset form on submit\n\t\t * @type {boolean}\n\t\t */\n\t\tinstance.resetOnSubmit = opts.resetOnSubmit !== false;\n\n\t\t/**\n\t\t * Custum validation\n\t\t * @memberOf Netx.Views.FormView\n\t\t * @alias validatorFields\n\t\t * @type {object}\n\t\t */\n\t\tinstance.validatorFields = opts.validatorFields || {};\n\n\t\t/**\n\t\t * Options for confirmViewModal when triggering a confirm on form submit\n\t\t * @memberOf Netx.Views.FormView\n\t\t * @alias confirmViewOpts\n\t\t * @type {Object}\n\t\t */\n\t\tinstance.confirmViewOpts = opts.confirmViewOpts || {};\n\n\t\t/**\n\t\t * Error cache\n\t\t * Stores invalid fields when validation is turned on\n\t\t * @memberOf Netx.Views.FormView\n\t\t * @alias errorCache\n\t\t * @type {Netx.Collection}\n\t\t */\n\t\tinstance.errorCache = new CoreCollection([]);\n\n\t\t/**\n\t\t * Error cache view\n\t\t * If your template has an element with [data-nx-control=\"validation-errors\"], then errors will be listed there automatically on a bad submit\n\t\t * @memberOf Netx.Views.FormView\n\t\t * @alias errorCacheView\n\t\t * @type {Netx.Views.FormErrorListView}\n\t\t */\n\t\tinstance.errorCacheView = instance.addSubView(\n\t\t\tnew FormErrorListView({\n\t\t\t\tcollection: instance.errorCache,\n\t\t\t}),\n\t\t);\n\n\t\t/**\n\t\t * Form validator object\n\t\t * @memberOf Netx.Views.FormView\n\t\t * @alias validator\n\t\t * @type {object}\n\t\t */\n\t\tinstance.validator = _.extend(\n\t\t\t{\n\t\t\t\tenabled: false,\n\t\t\t\tplugin: null,\n\t\t\t\tfields: {},\n\t\t\t},\n\t\t\topts.validator,\n\t\t);\n\n\t\t/**\n\t\t * @property {object} Plugins - Plugins for this view\n\t\t * @property {object} Plugins.validation - Validation\n\t\t */\n\t\tinstance.Plugins.Register({\n\t\t\tvalidation: {\n\t\t\t\tname: 'formValidation',\n\t\t\t\toptions: {\n\t\t\t\t\tmessage: i18n.t('i18n.valueIsNotValid'),\n\t\t\t\t\texcluded: [\n\t\t\t\t\t\t':disabled',\n\t\t\t\t\t\t($field, validator) => {\n\t\t\t\t\t\t\treturn $field.nxIgnores('validation');\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tfields:\n\t\t\t\t\t\t_.isObject(instance.validator) &&\n\t\t\t\t\t\t_.isObject(instance.validator.fields)\n\t\t\t\t\t\t\t? instance.validator.fields\n\t\t\t\t\t\t\t: {},\n\t\t\t\t\tframework: 'bootstrap',\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\n\t\t// If form values were passed, set them at render\n\t\tif (opts.form) {\n\t\t\tinstance.rendered.then(() => {\n\t\t\t\tinstance.setForm(opts.form);\n\t\t\t});\n\t\t}\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', instance.prepareForm)\n\t\t\t.on('postRenderHook', () => {\n\t\t\t\tinstance.renderForm();\n\t\t\t\t// We do not want to setFormValidation before the view has ran all the code\n\t\t\t\t// in its `postRender`\n\t\t\t\t_.defer(() => {\n\t\t\t\t\t// Set form validation\n\t\t\t\t\tinstance.setFormValidation();\n\t\t\t\t});\n\t\t\t})\n\t\t\t.listenTo(dispatcher, `${instance.eventStr}:success`, instance.success)\n\t\t\t.listenTo(dispatcher, `${instance.eventStr}:error`, instance.failure)\n\t\t\t.listenTo(\n\t\t\t\tinstance,\n\t\t\t\t'validation:err.form.fv',\n\t\t\t\tinstance.formValidationFailure,\n\t\t\t)\n\t\t\t.listenTo(\n\t\t\t\tinstance,\n\t\t\t\t'validation:err.field.fv',\n\t\t\t\tinstance.fieldValidationFailure,\n\t\t\t)\n\t\t\t.listenTo(\n\t\t\t\tinstance,\n\t\t\t\t'validation:success.form.fv',\n\t\t\t\tinstance.formValidationSuccess,\n\t\t\t)\n\t\t\t.listenTo(\n\t\t\t\tinstance,\n\t\t\t\t'validation:success.field.fv',\n\t\t\t\tinstance.fieldValidationSuccess,\n\t\t\t);\n\n\t\t// HTML-948: if the formview has .dispatcherSubmitEvent set, trigger form submit when dispatcher triggers that event\n\t\tif (instance.dispatcherSubmitEvent) {\n\t\t\tinstance.listenTo(\n\t\t\t\tdispatcher,\n\t\t\t\tinstance.dispatcherSubmitEvent,\n\t\t\t\tinstance.submit,\n\t\t\t);\n\t\t}\n\t\tif (instance.viewCollection) {\n\t\t\t// Each `childView` could have its own set inputs - when they render we need to:\n\t\t\t// Cache queries\n\t\t\t// Check the form (enable/disable submit) if applicable\n\t\t\tinstance.listenTo(\n\t\t\t\tinstance.viewCollection,\n\t\t\t\t'view:rendered',\n\t\t\t\t_.debounce(() => {\n\t\t\t\t\tinstance.cacheQueries();\n\t\t\t\t\tinstance.checkForm();\n\t\t\t\t}, 50),\n\t\t\t);\n\t\t}\n\t}, NAME);\n\n\treturn target;\n}\n","const NAME = 'materialTextFields';\n\nimport {MDCTextField} from '@material/textfield';\nimport {purgeEls} from '@netx/core/lib/utils';\nimport {notchOutlinePatch} from './patches/mdc-textfield';\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tlet materialTextFields = [];\n\t\tlet dateComponents = [];\n\n\t\tconst cleanUp = () => {\n\t\t\t_.invoke(materialTextFields, 'destroy');\n\t\t\tmaterialTextFields = [];\n\t\t\tdateComponents = [];\n\t\t};\n\n\t\tconst getMaterailTextField = (el) => {\n\t\t\tfor (let i = 0, c = materialTextFields.length; i < c; i++) {\n\t\t\t\tconst textField = materialTextFields[i];\n\t\t\t\tif (textField.input_ === el) {\n\t\t\t\t\treturn textField;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tinstance.events = {\n\t\t\t'change .mdc-text-field [data-provide=\"datepicker\"]'(e) {\n\t\t\t\tconst target = e.currentTarget;\n\t\t\t\tdateComponents.forEach((textField) => {\n\t\t\t\t\tif (textField.input_ !== target) return;\n\t\t\t\t\t// This will fix the floating label and validation\n\t\t\t\t\tconst foundation = textField.foundation_;\n\t\t\t\t\tfoundation.deactivateFocus();\n\t\t\t\t});\n\t\t\t},\n\t\t\t...instance.events,\n\t\t};\n\n\t\tinstance.materialTextFieldFloatLabel = (el, shouldFloat = false) => {\n\t\t\tconst textField = getMaterailTextField(el);\n\t\t\tif (!textField || !textField.label_) return;\n\t\t\ttextField.label_.float(shouldFloat);\n\t\t\ttextField.foundation_.notchOutline &&\n\t\t\t\ttextField.foundation_.notchOutline(shouldFloat);\n\t\t};\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', cleanUp)\n\t\t\t.on('removeHook', cleanUp)\n\t\t\t.on('postRenderHook', () => {\n\t\t\t\tdateComponents = [];\n\t\t\t\tmaterialTextFields = purgeEls(\n\t\t\t\t\t[...instance.el.querySelectorAll('.mdc-text-field')],\n\t\t\t\t\tinstance.getExcludedViews(),\n\t\t\t\t).map((field) => {\n\t\t\t\t\t// Hack for typeahead - we want the styles but mdc will grab it first (since it gets prepended)\n\t\t\t\t\t// Remove the class before creating mdc-text-field and then re-add\n\t\t\t\t\tconst ttInputEl = field.querySelector(\n\t\t\t\t\t\t'.mdc-text-field__input.tt-hint',\n\t\t\t\t\t);\n\t\t\t\t\tif (ttInputEl) {\n\t\t\t\t\t\tttInputEl.classList.remove('mdc-text-field__input');\n\t\t\t\t\t}\n\n\t\t\t\t\tconst inputEl = field.querySelector('.mdc-text-field__input');\n\t\t\t\t\tif (!inputEl) return;\n\n\t\t\t\t\tconst textField = new MDCTextField(field);\n\t\t\t\t\tif (field.classList.contains('mdc-text-field--textarea')) {\n\t\t\t\t\t\tnotchOutlinePatch(textField);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (inputEl.getAttribute('data-provide') === 'datepicker') {\n\t\t\t\t\t\tdateComponents.push(textField);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Put the class back for styles\n\t\t\t\t\tif (ttInputEl) {\n\t\t\t\t\t\tttInputEl.classList.add('mdc-text-field__input');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn textField;\n\t\t\t\t});\n\t\t\t});\n\t}, NAME);\n\n\treturn target;\n}\n","import {cssClasses, numbers} from '@material/textfield/constants';\n\n/**\n * As of v3 there is no mechanism for material components to know that measurable widths\n * have changed - so if a textfield has a value, is a textarea, and was rendered prior to\n * being measurable in the DOM, we wind up with a missing floating label\n * This will hopefully go away as we switch over to react\n * @function\n * @param {MDCTextfield} textfield Instance of mdc-textfield\n */\nexport const notchOutlinePatch = (textfield) => {\n\t// Do not patch twice\n\tif (!textfield || textfield.notchOutlinePatched_) return;\n\ttextfield.notchOutlinePatched_ = true;\n\n\tconst foundation = textfield.foundation_;\n\tconst adapter = foundation.adapter_;\n\tfoundation.notchOutline = _.wrap(\n\t\tfoundation.notchOutline,\n\t\t(notchOutline, openNotch) => {\n\t\t\ttextfield.notchOutlinePatchTimeout &&\n\t\t\t\tclearTimeout(textfield.notchOutlinePatchTimeout);\n\t\t\tif (!adapter.hasOutline()) return;\n\t\t\tif (!openNotch) return notchOutline.call(foundation, openNotch);\n\n\t\t\tconst isDense = adapter.hasClass(cssClasses.DENSE);\n\t\t\tconst labelScale = isDense\n\t\t\t\t? numbers.DENSE_LABEL_SCALE\n\t\t\t\t: numbers.LABEL_SCALE;\n\t\t\tconst labelWidth = adapter.getLabelWidth() * labelScale;\n\t\t\tif (!labelWidth || isNaN(labelWidth)) {\n\t\t\t\treturn (textfield.notchOutlinePatchTimeout = setTimeout(() => {\n\t\t\t\t\tfoundation.notchOutline(openNotch);\n\t\t\t\t}, 100));\n\t\t\t}\n\t\t\tadapter.notchOutline(labelWidth);\n\t\t},\n\t);\n\n\t// Make sure we clean up our timer\n\tfoundation.destroy = _.wrap(foundation.destroy, (destroy) => {\n\t\ttextfield.notchOutlinePatchTimeout &&\n\t\t\tclearTimeout(textfield.notchOutlinePatchTimeout);\n\t\tdestroy.call(foundation);\n\t});\n\n\t// Fun hack for our inputs that have floating labels regardless of having a value or not\n\tconst forceFloat =\n\t\tadapter.hasLabel() &&\n\t\ttextfield.label_.root_.classList.contains(\n\t\t\t'mdc-floating-label--float-above',\n\t\t);\n\n\t// Since this patch is applied after init and init calls float label if there is a value, call it again\n\t// As seen in foundation.init:\n\tif (adapter.isFocused()) {\n\t\tfoundation.inputFocusHandler_();\n\t} else if (forceFloat || (adapter.hasLabel() && foundation.shouldFloat)) {\n\t\tfoundation.notchOutline(true);\n\t\tadapter.floatLabel(true);\n\t}\n};\n","/**\n * @module core/functionality/childViews\n */\n\nconst NAME = 'childViews';\n\nimport LazyLoader from 'core-libs/nx-lazyloader';\n\nconst Props = {\n\t/**\n\t * @method\n\t * @param {string} event Event\n\t * @param {function} func Callback\n\t */\n\taddChildViewListener(event, func) {\n\t\t_.each(this.childViews, (v) => this.listenTo(v, event, func));\n\t},\n\n\t/**\n\t * Setup listeners on child views\n\t * @method\n\t * @private\n\t */\n\taddChildViewListeners() {\n\t\tconst collection = this.getChildViewCollection();\n\n\t\tif (!collection) {\n\t\t\tthrow new Error(\"Can't use child views without a collection\");\n\t\t}\n\n\t\tthis.removeChildViewListeners(collection);\n\n\t\t// Listen for child events:\n\t\t// ------------------------\n\t\t// Do we re-render on every add?\n\t\tthis.listenTo(collection, 'add', this.addedChildViewModel);\n\n\t\t// Sort has fired\n\t\t// TODO: Somewhere something is triggering sort - and it isn't backbone (because I know the compartor is not set and backbone will not sort without one)\n\t\t// This was causing us to render all the children in an asset gallery, and then immediately reset and re-add them\n\t\t// I have searched the codebase and can not find where this is happening, but it is possible this is a variable named event string...\n\t\t// Haven't gone deep enough in the debugger to spot it\n\t\t// Regardless, nothing should be bypassing this check and triggering `sort`\n\t\tif (collection.compartor) {\n\t\t\tthis.listenTo(collection, 'sort', this.resetChildViews);\n\t\t}\n\t\t// Respond to a remove on our collection by removing the view.\n\t\tthis.listenTo(collection, 'remove', this.removeChildView);\n\t\t// And if our collection is reset, update everything\n\t\tthis.listenTo(collection, 'reset', this.resetChildViews);\n\n\t\treturn this;\n\t},\n\n\t/**\n\t * @method\n\t */\n\taddedChildViewModel(model) {\n\t\tthis.childView.reset ? this.render() : this.addChildView(model);\n\t},\n\n\t/**\n\t * Internal function to install one child view\n\t * @private\n\t * @param {Netx.Model} model Model\n\t * @returns {Netx.View} Child view\n\t */\n\taddChildView(model, append) {\n\t\tif (!model) return;\n\n\t\t// Recycling is good! Create storage for child views if it doesn't exist yet, indexed by model.cid.\n\t\tthis.childViews = this.childViews || {};\n\n\t\tlet childView = this.childViews[model.cid];\n\t\tlet newChildView = false;\n\n\t\t// Create main options\n\t\t// Loop over each thing in this.childView, excluding this.options.options, and execute\n\t\t// any value that may be a function\n\t\tconst mainOptions = {};\n\t\t_.each(_.omit(this.childView, 'options'), (v, k) => {\n\t\t\tlet val = v;\n\t\t\tif (_.isFunction(v) && !v.__isView__) {\n\t\t\t\tval = v.call(this, model);\n\t\t\t}\n\t\t\tmainOptions[k] = val;\n\t\t});\n\n\t\tconst childCollection = this.getChildViewCollection();\n\t\tconst isAppViewModel = model.constructor.__name__ === 'AppView';\n\n\t\tlet _view;\n\t\t// Check and see if it was in the view queue\n\t\tif (\n\t\t\t!childView &&\n\t\t\tmodel.get('queued') &&\n\t\t\tthis._viewQueue &&\n\t\t\tisAppViewModel\n\t\t) {\n\t\t\tif (this._viewQueue.get(model.id)) {\n\t\t\t\t_view = model.get('view');\n\t\t\t\tif (_view) {\n\t\t\t\t\t// Get the view\n\t\t\t\t\tchildView = this.childViews[model.cid] = _view;\n\t\t\t\t\t// Make sure it knows who its rightful owner is\n\t\t\t\t\tmodel.collection = this.viewCollection;\n\t\t\t\t\t// We are new!\n\t\t\t\t\tnewChildView = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check and see if the view was already created via another `viewCollection`\n\t\tif (\n\t\t\t!childView &&\n\t\t\tisAppViewModel &&\n\t\t\tthis.viewCollection &&\n\t\t\t!model.isMyOriginalCollection(this.viewCollection)\n\t\t) {\n\t\t\t_view = model.get('view');\n\t\t\tif (_view) {\n\t\t\t\tchildView = this.childViews[model.cid] = _view;\n\t\t\t\t// We are new!\n\t\t\t\tnewChildView = true;\n\t\t\t}\n\t\t}\n\n\t\t// New childView\n\t\tif (!childView) {\n\t\t\t// Respect max items\n\t\t\t// Do it in here so we do not erroneously think we have exceeded our limits i nthe event of a detach re-add deal\n\t\t\tif (\n\t\t\t\tmainOptions.maxItems &&\n\t\t\t\t_.keys(this.childViews).length >= mainOptions.maxItems\n\t\t\t)\n\t\t\t\treturn;\n\n\t\t\t////////////////////////////////\n\t\t\t// CHILD VIEW SETUP\n\t\t\t////////////////////////////////\n\n\t\t\t// Child View class:\n\t\t\tconst childViewClass = mainOptions.viewClass;\n\n\t\t\t// if the child class isn't specified assume we do not want to output anything\n\t\t\tif (!childViewClass) return;\n\n\t\t\tconst childViewProto = childViewClass.prototype;\n\t\t\t// console.log( this, childViewClass );\n\t\t\tconst childViewModule = childViewProto.module\n\t\t\t\t? childViewProto.module\n\t\t\t\t: 'none';\n\n\t\t\t// Child View ID, if defined.\n\t\t\tconst childId = mainOptions.id ? {id: mainOptions.id} : {};\n\n\t\t\t// Child View options:\n\t\t\tlet childViewOptions = {};\n\t\t\tlet _childViewOptions = this.childView.options || {};\n\n\t\t\t// If we are an appView model, extend anything on the model to our childView options\n\t\t\tif (isAppViewModel) {\n\t\t\t\t_.each(model.attributes.viewOptions, (v, k) => {\n\t\t\t\t\tchildViewOptions[k] = v;\n\t\t\t\t});\n\t\t\t\tchildViewOptions.viewSpec = model;\n\t\t\t}\n\n\t\t\t// Check if any of our child view options are functions\n\t\t\tif (!_.isFunction(_childViewOptions)) {\n\t\t\t\t_.each(_.omit(_childViewOptions, 'template'), (opt, key) => {\n\t\t\t\t\tlet val = opt;\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Do not execute method overrides - leave them as is\n\t\t\t\t\t\t_.isFunction(opt) &&\n\t\t\t\t\t\t!opt.__isView__\n\t\t\t\t\t) {\n\t\t\t\t\t\tval = opt.call(this, model);\n\t\t\t\t\t}\n\n\t\t\t\t\tchildViewOptions[key] = val;\n\t\t\t\t});\n\t\t\t\tif (_childViewOptions.template) {\n\t\t\t\t\tchildViewOptions.template = _childViewOptions.template;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Child View attributes:\n\t\t\tconst childViewAttributes = childViewOptions.attributes || {};\n\t\t\t// Check if any of our attributes are functions\n\t\t\t_.each(childViewAttributes, (attr, key, all) => {\n\t\t\t\tif (!_.isFunction(attr)) return;\n\t\t\t\tall[key] = attr.call(this, model);\n\t\t\t});\n\t\t\t// If draggable is true add the attibute draggable=\"true\" to the child view\n\t\t\tchildViewAttributes.draggable =\n\t\t\t\tmainOptions.draggable === true ? true : undefined;\n\t\t\tif (mainOptions.href) {\n\t\t\t\tchildViewAttributes.href = mainOptions.href;\n\t\t\t}\n\t\t\t////////////////////////////////\n\t\t\t// !CHILD VIEW SETUP\n\t\t\t////////////////////////////////\n\n\t\t\t////////////////////////////////\n\t\t\t// CHILD VIEW CREATION\n\t\t\t////////////////////////////////\n\t\t\tlet _options = {};\n\n\t\t\t// Only extend the model/collection if it is not AppView/AppViews\n\t\t\t// For edge cases see Netx.Views.AppModalCrumbsView\n\t\t\tif (childCollection.constructor.__name__ !== 'AppViews') {\n\t\t\t\t_options.collection = childCollection;\n\t\t\t}\n\t\t\tif (!isAppViewModel) {\n\t\t\t\t_options.model = model;\n\t\t\t}\n\n\t\t\t// Put them all together in order:\n\t\t\t// First the options we just defined\n\t\t\t// Then the options parsed in childView setup\n\t\t\t// Then the childId (which is collected from the parsed main options)\n\t\t\t// And lastly, the parsed attributes options\n\t\t\t_.extend(_options, childViewOptions, childId, {\n\t\t\t\tattributes: childViewAttributes,\n\t\t\t});\n\t\t\ttry {\n\t\t\t\t// Allow one last chance to take full control over what gets extended to the childView\n\t\t\t\tif (_.isFunction(_childViewOptions)) {\n\t\t\t\t\t_.extend(_options, _childViewOptions.call(this, model, _options));\n\t\t\t\t}\n\t\t\t} catch (ex) {\n\t\t\t\tconsole.log(ex);\n\t\t\t}\n\n\t\t\t// Create\n\t\t\tthis.childViews[model.cid] = childView = new childViewClass(_options);\n\n\t\t\t// If the model present on options is not of type Netx.Models.AppView then do not set the view\n\t\t\t// this will override the correct one\n\t\t\tif (\n\t\t\t\tisAppViewModel &&\n\t\t\t\t!(_options.model && _options.model.constructor.__name__ === 'AppView')\n\t\t\t) {\n\t\t\t\tmodel.set('view', childView);\n\t\t\t}\n\t\t\t// We are new!\n\t\t\tnewChildView = true;\n\t\t\t////////////////////////////////\n\t\t\t// !CHILD VIEW CREATION\n\t\t\t////////////////////////////////\n\t\t}\n\t\t// ! New childView\n\n\t\t// ////////////////////////////////////\n\t\t// // SET TARGET\n\t\t// ////////////////////////////////////\n\t\t// var target;\n\t\t// // If target is explicitly set to false, use this.$el\n\t\t// if( mainOptions.target === false ) {\n\t\t// \ttarget = this.$el;\n\t\t// }\n\t\t// // If set\n\t\t// else if( mainOptions.target ) {\n\t\t// \ttarget = this.$( mainOptions.target );\n\t\t// }\n\t\t// // Target was either not provided or could not be found\n\t\t// if ( !target || target.length === 0 ) {\n\t\t// \t// Try for .nx-childview or [data-nx-childviews] else use this.$el\n\t\t// \t// TODO: this must be better targeted - we need to make sure we do not wind up grabbing a nested childView element\n\t\t// \t// TODO: switch over to `.nx-childviews` for better performance\n\t\t// \tvar childviewTarget = this.$('.nx-childviews, [data-nx-childviews]');\n\t\t// \ttarget = childviewTarget.length ? childviewTarget.first() : this.$el;\n\t\t// }\n\t\t// ////////////////////////////////////\n\t\t// // !SET TARGET\n\t\t// ////////////////////////////////////\n\n\t\t////////////////////////////////////\n\t\t// POSITION IN DOM\n\t\t////////////////////////////////////\n\t\tconst childModelCount = childCollection.length;\n\t\tif (append === true) {\n\t\t\tchildView.$el.appendTo(this.$childTargetEl);\n\t\t} else {\n\t\t\t// Add the view in the specific order it appears in the collection.\n\t\t\t// NOTE: sometimes we are called by backbone with a model\n\t\t\t// that is identical to, but not the same as, some model in the collection --\n\t\t\t// for instance, if we call set() from a method parser, so the models haven't been unified yet.\n\t\t\t// This line works around that.\n\t\t\tlet idx = childCollection.indexOf(childCollection.get(model.id));\n\t\t\t// However, if the model has no ID, the previous search fails, but the simpler case works.\n\t\t\tif (idx === -1) {\n\t\t\t\tidx = childCollection.indexOf(model);\n\t\t\t}\n\t\t\t// Before\n\t\t\tif (idx === 0) {\n\t\t\t\tchildView.$el.prependTo(this.$childTargetEl);\n\t\t\t}\n\t\t\t// If we are the last view, append to the end of the target:\n\t\t\telse if (idx === childModelCount - 1) {\n\t\t\t\t// If there is a view all children element, insert before\n\t\t\t\tchildView.$el.appendTo(this.$childTargetEl);\n\t\t\t}\n\t\t\t// collection.indexOf(model) can return -1 if the model has no id.\n\t\t\telse if (idx === -1) {\n\t\t\t\tif (model.id) {\n\t\t\t\t\t// Otherwise, this really shouldn't happen unless something is using addChildView in an unsupported way.\n\t\t\t\t\tconsole.warn('adding child view not in childViews collection', model);\n\t\t\t\t}\n\t\t\t\t// Either way, we ought to add what we were asked to add, so append the model's view.\n\t\t\t\tchildView.$el.appendTo(this.$childTargetEl);\n\t\t\t}\n\t\t\t// After\n\t\t\telse {\n\t\t\t\t// Otherwise, insert this view after the previous model's view\n\t\t\t\tconst previousChildView = this.childViews[\n\t\t\t\t\tchildCollection.at(idx - 1).cid\n\t\t\t\t];\n\t\t\t\tpreviousChildView != null\n\t\t\t\t\t? previousChildView.$el.after(childView.el)\n\t\t\t\t\t: childView.$el.appendTo(this.$childTargetEl);\n\t\t\t}\n\t\t}\n\t\t////////////////////////////////////\n\t\t// !POSITION IN DOM\n\t\t////////////////////////////////////\n\n\t\t// Let the child view know it's just been added to its parent view\n\t\tchildView.trigger('addedToParent', this);\n\n\t\t// Let the view know a child view was added\n\t\tthis.trigger('addedChildView', childView);\n\n\t\tif (newChildView) {\n\t\t\tthis.trigger('addedNewChildView', childView)\n\t\t\t\t// Listeners for the life of the child view:\n\t\t\t\t// When removed\n\t\t\t\t.listenTo(childView, 'remove', () => {\n\t\t\t\t\tthis.trigger('removedChildView', childView).stopListening(childView);\n\t\t\t\t});\n\t\t}\n\n\t\t// The boolean lastAdded can be set true on a model before it is added to a collecton, to indicate that no more models are being added after this one.\n\t\t// This causes the addedChildViews event to be triggered on the parent collection's view after the child model view is rendered.\n\t\t// Use this for one-off additions to a view, to trigger post-rendering things (like grid resizing).\n\t\t// (Normal childView processing does not need to worry about this.)\n\t\t// TODO: This feels like a hack, but I don't have a better idea yet.\n\t\tif (model.lastAdded) {\n\t\t\tdelete model.lastAdded;\n\t\t\tthis.trigger('addedChildViews');\n\t\t}\n\n\t\tif (newChildView) {\n\t\t\t// Allow views to access info before the render actually oocurs on viewSpec related views\n\t\t\tif (isAppViewModel) {\n\t\t\t\t_.defer(() => {\n\t\t\t\t\t// Trigger first render. After that, the view will render itself on its own model's events.\n\t\t\t\t\t// TODO: views should decide when to render. They can listen for 'addedToParent' if they need to re-render when re-added.\n\t\t\t\t\t// For now - as I do not want to fix every view that is depending on this behavior\n\t\t\t\t\tif (mainOptions.noRender !== true && !childView.renderedOnce) {\n\t\t\t\t\t\tchildView.render();\n\t\t\t\t\t\t!mainOptions.noShow &&\n\t\t\t\t\t\t\tthis.whenShown.then(() => {\n\t\t\t\t\t\t\t\tchildView.show();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// Trigger first render. After that, the view will render itself on its own model's events.\n\t\t\t\t// TODO: views should decide when to render. They can listen for 'addedToParent' if they need to re-render when re-added.\n\t\t\t\t// For now - as I do not want to fix every view that is depending on this behavior\n\t\t\t\tif (mainOptions.noRender !== true) {\n\t\t\t\t\tchildView.render();\n\t\t\t\t\t!mainOptions.noShow &&\n\t\t\t\t\t\tthis.whenShown.then(() => {\n\t\t\t\t\t\t\tchildView.show();\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Return new child view\n\t\treturn childView;\n\t},\n\n\t/**\n\t * Internal function to add one child view for each collection model\n\t * @method\n\t * @private\n\t * @todo Cleanup/reorganize?\n\t */\n\taddChildViews() {\n\t\t// Add child views, if required.\n\t\tconst addedCVs = [];\n\t\tconst parentCollection = this.getChildViewCollection();\n\n\t\t// We have a collection to work off of\n\t\tif (!parentCollection) return this;\n\n\t\t// Free all views from this.childViews that are not specific to models in parentCollection.\n\t\t// (NOTE: we could defer this block for performance if necessary.)\n\t\t// NOTE: any other code that stores views in this.childViews (to track rendering & lifecycle)\n\t\t// is totally incompatible with the childView system! We used to do that a lot,\n\t\t// but for best results, store such views by calling this.addSubView(view), which stores\n\t\t// them in this.subViews{}.\n\t\tconst modelCids = _.pluck(parentCollection.models, 'cid');\n\n\t\t_.each(this.childViews, (view, cid) => {\n\t\t\tif (modelCids.indexOf(cid) > -1) return;\n\t\t\tview.remove();\n\t\t\tdelete this.childViews[cid];\n\t\t});\n\n\t\tthis.trigger('addingChildViews', this);\n\t\t// Opting to break up the adding into chunks\n\t\tif (this.childView.breakItUp) {\n\t\t\tconst opts = _.isObject(this.childView.breakItUp)\n\t\t\t\t? this.childView.breakItUp\n\t\t\t\t: {};\n\t\t\tconst totalLength = this.childView.maxItems || parentCollection.length;\n\n\t\t\tthis.breakItUp(\n\t\t\t\t{\n\t\t\t\t\tsize: totalLength,\n\t\t\t\t\tamount: opts.amount || 50,\n\t\t\t\t\tdelay: opts.delay || 0,\n\t\t\t\t},\n\t\t\t\t(index) => {\n\t\t\t\t\tthis.addChildView(parentCollection.at(index), true);\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tthis.trigger('addedChildViews', this);\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t\t// We only want to display a certain number of childViews\n\t\telse if (this.childView.maxItems) {\n\t\t\t_.each(_.first(parentCollection.models, this.childView.maxItems), (m) =>\n\t\t\t\tthis.addChildView(m, true),\n\t\t\t);\n\t\t}\n\t\t// Lazy load children\n\t\telse if (this.childView.lazyLoad) {\n\t\t\tthis.Plugins.Destroy('lazyloader');\n\t\t\tthis.initializeLazyLoad();\n\n\t\t\tconst start = this.lazyLoadIndex;\n\t\t\tthis.lazyLoadIndex = start + 25;\n\n\t\t\tconst models = parentCollection.models.slice(start, this.lazyLoadIndex);\n\t\t\tmodels.forEach(_.partial(this.addChildView.bind(this), _, true));\n\n\t\t\tlet additionalOpts = this.childView.lazyLoad;\n\t\t\tif (_.isFunction(additionalOpts)) {\n\t\t\t\tadditionalOpts = additionalOpts.call(this);\n\t\t\t}\n\n\t\t\tmodels.length &&\n\t\t\t\tthis.Plugins.Initialize(\n\t\t\t\t\t'lazyloader',\n\t\t\t\t\tthis.$el,\n\t\t\t\t\t_.extend(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchildrenEl: this.$childTargetEl[0],\n\t\t\t\t\t\t\ttarget: this,\n\t\t\t\t\t\t\tforwardOnly: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tadditionalOpts,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t}\n\t\t// Show everything we've got\n\t\telse {\n\t\t\tparentCollection.each((m) => this.addChildView(m, true));\n\t\t}\n\t},\n\n\t/** @method */\n\tcleanUpChildViews() {\n\t\t// Remove any children we may have.\n\t\t_.invoke(this.childViews, 'remove');\n\t\tdelete this.childViews;\n\t},\n\n\t/**\n\t * @method\n\t */\n\tdetachChildViews() {\n\t\t// protect child views from losing their event listeners:\n\t\t// remove them from this.$el before we call .html() on it.\n\t\t// http://tbranyen.com/post/missing-jquery-events-while-rendering\n\t\t_.each(this.childViews, (v) => v.$el.detach());\n\t},\n\n\t/**\n\t * @method\n\t * @param {Netx.Model} model Model\n\t * @return {Netx.View} Child view\n\t */\n\tgetChildViewByModel(model) {\n\t\tconst childViews = this.childViews;\n\n\t\t// Simplest way (should always work)\n\t\tlet childView = childViews[model.cid];\n\t\tif (childView) {\n\t\t\treturn childView;\n\t\t}\n\n\t\t// But if not, the next simple way is to get it via the order in the child view collection\n\t\tconst collection = this.getChildViewCollection();\n\t\tif (collection) {\n\t\t\tconst idx = collection.indexOf(model);\n\t\t\tchildView =\n\t\t\t\tidx > -1 && childViews[collection.at(collection.indexOf(model)).cid];\n\t\t\tif (childView.model === model) return childView;\n\t\t}\n\n\t\t// If SOMEHOW nothing above worked, loop ovet child views and find the first one that has\n\t\t// the modeltied to it\n\t\tfor (let key in childViews) {\n\t\t\tif (childViews.hasOwnProperty(key)) {\n\t\t\t\tchildView = childViews[key];\n\t\t\t\tif (childView.model.cid === model.cid) {\n\t\t\t\t\treturn childView;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * @method\n\t * @return {module:core/lib/netx-collection} Collection\n\t */\n\tgetChildViewCollection() {\n\t\t// View have a collection\n\t\t// This is to avoid the fact we try and push a different (t initialize in some childView parents\n\t\t// that is fine in itself - except for when you want loading classes to reflect that collection in the childView\n\t\tconst childViewCollection = this.childView.collection;\n\t\t// This is to avoid the fact we try and push a different collection in at initialize in some childView parents\n\t\t// that is fine in itself - except for when you want loading classes to reflect that collection in the childView\n\t\tlet parentCollection;\n\t\tif (childViewCollection) {\n\t\t\tparentCollection = _.isFunction(childViewCollection)\n\t\t\t\t? childViewCollection(this.model)\n\t\t\t\t: childViewCollection;\n\t\t}\n\t\treturn parentCollection || this.collection;\n\t},\n\n\t/**\n\t * @method\n\t */\n\tinitializeLazyLoad() {\n\t\tthis.lazyLoadedForward = this.reachedBeginning = true;\n\t\tthis.reachedEnd = false;\n\t\tthis.lazyLoadIndex = 0;\n\t},\n\n\t/**\n\t * @method\n\t * @return {number} Items loading\n\t */\n\tlazyLoadItems() {\n\t\tif (this.reachedEnd) return false;\n\n\t\tconst parentCollection = this.getChildViewCollection();\n\n\t\tconst pageSize = 3;\n\t\tconst totalItems = parentCollection.length;\n\n\t\t// Always forward\n\t\tthis.lazyLoadedForward = true;\n\n\t\tthis.reachedEnd = this.lazyLoadIndex >= totalItems - 1;\n\n\t\tconst start = this.lazyLoadIndex;\n\t\tthis.lazyLoadIndex = start + pageSize;\n\t\tparentCollection.models\n\t\t\t.slice(start, this.lazyLoadIndex)\n\t\t\t.forEach((model) => this.addChildView(model, true));\n\n\t\treturn totalItems === 0 ? 0 : false;\n\t},\n\n\t/**\n\t * @method\n\t * @param {number} oldIndex Old index\n\t * @param {number} newIndex New index\n\t * @param {object} opts Options\n\t * @property {object} opts - Options\n\t * @property {boolean} opts.ignoreCollection - If true, the child view collection model order will not be modified\n\t * @property {boolean} opts.ignoreEl - If true, the child view elements order will not be modified\n\t */\n\tmoveChildViewToIndex(oldIndex, newIndex, opts = {}) {\n\t\tif (newIndex === oldIndex) return this;\n\n\t\t// Child view collection\n\t\tconst collection = this.getChildViewCollection();\n\n\t\t// Assume the collection is up to date and it is a view trying to catch up (in cases where multiple views use the same child view collection)\n\t\t// in which case we are using the newIndex as our point of reference for data\n\t\tconst idx = opts.ignoreCollection ? newIndex : oldIndex;\n\n\t\t// Get the model being moved\n\t\tconst temp = collection.at(idx);\n\n\t\t// Get the child view being moved\n\t\tconst childView = this.getChildViewByModel(temp);\n\n\t\tif (!childView) return this;\n\n\t\t// Indexes\n\t\tlet start = oldIndex;\n\t\tlet end = newIndex;\n\t\t// We are modifying everything between the start and end of the move\n\t\t// Adjust if old index is after the new index, we want to increment from the lowest index\n\t\t// Add 1 to start so that we are not hitting the moving element again - that gets\n\t\tif (oldIndex > newIndex) {\n\t\t\tstart = newIndex + 1;\n\t\t\tend = oldIndex;\n\t\t}\n\n\t\t// Correct placement in DOM\n\t\tif (!opts.ignoreEl) {\n\t\t\t// Detach and preserve\n\t\t\tchildView.$el.detach();\n\n\t\t\t// Beginning\n\t\t\tif (newIndex === 0) {\n\t\t\t\tchildView.$el.prependTo(this.$childTargetEl);\n\t\t\t}\n\t\t\t// End\n\t\t\telse if (idx === collection.length - 1) {\n\t\t\t\tchildView.$el.appendTo(this.$childTargetEl);\n\t\t\t}\n\t\t\t// Otherwise, insert this view after the previous model's view\n\t\t\telse {\n\t\t\t\tconst previousChildView = this.getChildViewByModel(\n\t\t\t\t\tcollection.at(newIndex - 1),\n\t\t\t\t);\n\t\t\t\t!_.isUndefined(previousChildView)\n\t\t\t\t\t? previousChildView.$el.after(childView.el)\n\t\t\t\t\t: childView.$el.appendTo(this.$childTargetEl);\n\t\t\t}\n\t\t}\n\n\t\t// Correct placement in child view collection (that way subsequent re-renders will maintain the child view order)\n\t\tif (!opts.ignoreCollection && newIndex !== temp.getIndex()) {\n\t\t\t// Remove it, silently\n\t\t\tcollection.remove(temp, {silent: true});\n\t\t\t// Add it back in at the new index, silently (we will fire an event when this is over)\n\t\t\tcollection.add(temp, {at: newIndex, silent: true});\n\t\t}\n\n\t\t// Loop over and emit events to all sibling child views affected by this move\n\t\tfor (let i = start, cv; i <= end; i++) {\n\t\t\tcv = this.getChildViewByModel(collection.at(i));\n\t\t\tcv && cv.trigger('movedToIndex', cv, this, {from: i - 1, to: i});\n\t\t}\n\t\t// We moved\n\t\tchildView.trigger(\n\t\t\t'movedToIndex',\n\t\t\tchildView,\n\t\t\tthis,\n\t\t\t_.extend({}, opts, {from: oldIndex, to: newIndex}),\n\t\t);\n\n\t\t// Corrected placement in collection\n\t\tif (!opts.ignoreCollection) {\n\t\t\tcollection.trigger(\n\t\t\t\t'movedItem',\n\t\t\t\tcollection,\n\t\t\t\tchildView,\n\t\t\t\tthis,\n\t\t\t\t_.extend({}, opts, {from: oldIndex, to: newIndex}),\n\t\t\t);\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t/**\n\t * @method\n\t */\n\tprepareChildViews() {\n\t\tif (!this.childView) return;\n\n\t\t// Wait until we have rendered, as childViews could be trying to add themselves before this.$el\n\t\t// has anything in it, in which case they wind up in the root of this.$el (for a brief second)\n\t\t// This method cleans up any existing listeners as well - so no need to manage that here\n\t\tthis.addChildViewListeners();\n\n\t\t// Put back child filter string if available\n\t\tif (this._childViewFilterStr) {\n\t\t\tconst $childSearchFilter = this.$('.nx-filter-children');\n\t\t\tif ($childSearchFilter.length) {\n\t\t\t\t$childSearchFilter.val(this._childViewFilterStr);\n\t\t\t}\n\t\t}\n\n\t\t// Unset before moving forward\n\t\tdelete this.$childTargetEl;\n\n\t\tconst childViewTarget = this.childView.target;\n\t\tif (childViewTarget === false) {\n\t\t\tthis.$childTargetEl = this.$el;\n\t\t} else if (childViewTarget) {\n\t\t\tif (_.isFunction(childViewTarget)) {\n\t\t\t\t// TODO: support this being a function so that we can have a way to do our split column childViews -\n\t\t\t\t// really, here we would negate `this.$childTargetEl` and in the `addChildView` method if `this.$childTargetEl` is undefined\n\t\t\t\t// we would check if it is a function - call the function and pass the child view's model and the view can tell us where it should be\n\t\t\t\t// appended\n\t\t\t} else {\n\t\t\t\tthis.$childTargetEl = this.$(childViewTarget);\n\t\t\t}\n\t\t}\n\t\t// Target was either not provided or could not be found\n\t\tif (!this.$childTargetEl || this.$childTargetEl.length === 0) {\n\t\t\tconst childviewTarget = this.$('.nx-childviews:first');\n\t\t\tthis.$childTargetEl = childviewTarget.length\n\t\t\t\t? childviewTarget.first()\n\t\t\t\t: this.$el;\n\t\t}\n\n\t\tif (this.childView.lazyLoad) {\n\t\t\tthis.Plugins.Register({\n\t\t\t\tlazyloader: {\n\t\t\t\t\tname: 'LazyLoader',\n\t\t\t\t\tdestroyMethod(instance) {\n\t\t\t\t\t\tthis.off(instance.destroy());\n\t\t\t\t\t},\n\t\t\t\t\tinitializeMethod(pluginObj, $pluginEl, initOpts, cb) {\n\t\t\t\t\t\tconst instance = new LazyLoader(\n\t\t\t\t\t\t\t$pluginEl[0],\n\t\t\t\t\t\t\t_.extend({}, pluginObj.options, initOpts),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tcb(instance);\n\t\t\t\t\t},\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdirection: 'horizontal',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// Add child views, if defined.\n\t\tthis.addChildViews();\n\t},\n\n\t/**\n\t * @method\n\t */\n\tremoveAllChildViews() {\n\t\t_.invoke(this.childViews, 'remove');\n\t\tthis.childViews = {};\n\t},\n\n\t/**\n\t * Respond to collection remove events by removing the associated childView, if it exists.\n\t * @method\n\t * @private\n\t * @param {Netx.Model} model Model\n\t */\n\tremoveChildView(model, collection, opts = {}) {\n\t\tconst childView = this.childViews[model.cid];\n\t\tif (!childView) return;\n\n\t\tthis.stopListening(childView);\n\t\tchildView.remove();\n\t\tdelete this.childViews[model.cid];\n\t\tthis.trigger('removedChildView', childView);\n\t\treturn childView;\n\t},\n\n\t/**\n\t * @method\n\t * @param {string} event Event\n\t * @param {function} func Callback\n\t */\n\tremoveChildViewListener(event, func) {\n\t\t_.each(this.childViews, (v) => this.stopListening(v, event, func));\n\t},\n\n\t/**\n\t * Remove listners on child views\n\t * @method\n\t */\n\tremoveChildViewListeners(collection) {\n\t\treturn this.stopListening(collection, 'add', this.addedChildViewModel)\n\t\t\t.stopListening(collection, 'sort', this.resetChildViews)\n\t\t\t.stopListening(collection, 'remove', this.removeChildView)\n\t\t\t.stopListening(collection, 'reset', this.resetChildViews)\n\t\t\t.stopListening('addedChildViews');\n\t},\n\n\t/**\n\t * Internal function to reset the child views to match the current collection\n\t * @method\n\t * @private\n\t */\n\tresetChildViews() {\n\t\tconst collection = this.getChildViewCollection();\n\n\t\tif (!collection.length) {\n\t\t\tthis.Plugins.Destroy('lazyloader');\n\t\t\tthis.$childTargetEl.empty();\n\t\t\t_.invoke(this.childViews, 'remove');\n\t\t\tthis.childViews = {};\n\t\t\treturn this;\n\t\t}\n\n\t\t// Detach all child views we have.\n\t\tthis.detachChildViews();\n\t\t// this.trigger('childViewsReset');\n\t\t// Add back the ones we want.\n\t\tthis.addChildViews();\n\n\t\treturn this;\n\t},\n\n\t/**\n\t * Provided a search event, loop over child views and check a particular key, on its model, for the searched value\n\t * @method\n\t * @param {event} e Search event\n\t */\n\tsearchAndFilterChildren(e) {\n\t\t// Search str\n\t\tlet str = '';\n\t\tlet attributeKey = [];\n\t\tlet minimumLength = 2;\n\t\tlet hasResults = true;\n\n\t\tif (e && e.originalEvent) {\n\t\t\t// This ends here - do not want parent views to get this event\n\t\t\te.stopPropagation();\n\t\t\tconst $target = this.$(e.target);\n\n\t\t\t// Do not interfere with children\n\t\t\tif (this.$childTargetEl.find($target).length) return;\n\n\t\t\tif ($target.attr('data-nx-search-key')) {\n\t\t\t\tattributeKey = $target.attr('data-nx-search-key').split(',');\n\t\t\t}\n\t\t\tminimumLength =\n\t\t\t\tparseInt($target.attr('data-nx-search-minLength')) || minimumLength;\n\t\t\tstr = e.originalEvent.detail || '';\n\t\t}\n\n\t\t// Store so we can put back after renders\n\t\tthis._childViewFilterStr = str;\n\n\t\t// Lowercase it\n\t\tstr = str.toLowerCase();\n\n\t\tif (str.length < minimumLength) {\n\t\t\t// show all child search views\n\t\t\t_.each(this.childViews, (cv) => cv.$el.show());\n\t\t\tthis.el.removeAttribute('data-nx-no-matches');\n\t\t} else if (str.length >= minimumLength) {\n\t\t\tlet shown = 0;\n\t\t\t// hide all search views that don't match this string\n\t\t\t_.each(this.childViews, (cv) => {\n\t\t\t\tconst model = cv.model;\n\t\t\t\tlet show = attributeKey.some((attrKey) => {\n\t\t\t\t\tconst value = model.get(attrKey);\n\t\t\t\t\treturn value != null && value.toLowerCase().includes(str);\n\t\t\t\t});\n\t\t\t\t// Fallback to model title\n\t\t\t\tif (!show) {\n\t\t\t\t\tshow = model.getLabel().toLowerCase().includes(str);\n\t\t\t\t}\n\t\t\t\tshow && shown++;\n\t\t\t\tcv.$el.toggle(show);\n\n\t\t\t\t// make sure the first child view\n\t\t\t\t// is tabable when filtering\n\t\t\t\tif (show && shown === 1) {\n\t\t\t\t\tcv.$el.attr('tabindex', '0');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\thasResults = shown > 0;\n\n\t\t\tshown === 0\n\t\t\t\t? this.el.setAttribute('data-nx-no-matches', true)\n\t\t\t\t: this.el.removeAttribute('data-nx-no-matches');\n\t\t}\n\n\t\tthis.trigger('filteredChildren', this, hasResults);\n\n\t\treturn hasResults;\n\t},\n};\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.extendFunctionality(Props);\n\ttarget.__isChildViews__ = true;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\t// As we transition over to react we may find ourselves still stuck with views that extended views\n\t\t// that utilize child functionality - rather than making it so we have to jump through a million hoopd\n\t\t// or rewrite the thing entirely... just provide a quick way to opt out\n\t\tif (opts.disableChildViews === true) return;\n\n\t\tinstance.isChildViews = true;\n\t\tinstance.childViews = {};\n\n\t\t// Simply add an `` to the tmeplate and you can filter the children\n\t\t// It defaults to comparing the search string to the model attribute `name` - if you need to compare to a different attribute use `data-nx-search-key=\"myDesiredKey\"`\n\t\t// It defaults to a minimum input length of 2 before filtering, if you need to modify this use `data-nx-search-minLength=\"5\"`\n\t\tinstance.events['search .nx-filter-children'] = 'searchAndFilterChildren';\n\t\t/**\n\t\t * Store so that we can put back after renders\n\t\t * @memberOf Netx.View\n\t\t * @alias _childViewFilterStr\n\t\t * @type {string}\n\t\t */\n\t\tinstance._childViewFilterStr = '';\n\n\t\tinstance.childView = opts.childView;\n\n\t\t// Wrap the excluded views method\n\t\tinstance.getExcludedViews = _.wrap(\n\t\t\tinstance.getExcludedViews,\n\t\t\t(getExcludedViews) => {\n\t\t\t\treturn _.pluck(instance.childViews, 'el').concat(\n\t\t\t\t\tgetExcludedViews.call(instance),\n\t\t\t\t);\n\t\t\t},\n\t\t);\n\n\t\tif (!instance.unsavedChanges) {\n\t\t\tinstance.unsavedChanges = (unsavedChanges, noProxy) => {\n\t\t\t\tlet hasUnsavedChanges = false;\n\t\t\t\tconst childViews = instance.childViews;\n\t\t\t\tconst keys = _.keys(childViews);\n\t\t\t\tfor (let i = 0, c = keys.length, childView; i < c; i++) {\n\t\t\t\t\tchildView = childViews[keys[i]];\n\t\t\t\t\tif (childView.unsavedChanges()) {\n\t\t\t\t\t\treturn noProxy ? childView : instance;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', instance.detachChildViews)\n\t\t\t.on('postRenderHook', instance.prepareChildViews)\n\t\t\t.on('removeHook', instance.cleanUpChildViews)\n\t\t\t.on('bindCollectionEventsHook', instance.addChildViewListeners)\n\t\t\t//.on('unbindCollectionEventsHook', instance.removeChildViewListeners)\n\t\t\t// cancel loading classes if child views are added.\n\t\t\t// This passes the childView to showLoaded which hurts the loading class removal\n\t\t\t// We no longer check that thing is of model or collection in showLoaded\n\t\t\t// this.listenTo(this, \"addedChildView\", _.debounce( this.showLoaded, 100 ) );\n\t\t\t.on('addedChildViews', () => {\n\t\t\t\tinstance.showLoaded();\n\t\t\t})\n\t\t\t.on('hidden', () => {\n\t\t\t\t_.invoke(instance.childViews, 'trigger', 'hiddenByProxy', instance);\n\t\t\t})\n\t\t\t.on('shown', () => {\n\t\t\t\t_.invoke(instance.childViews, 'trigger', 'shownByProxy', instance);\n\t\t\t});\n\t}, NAME);\n\n\treturn target;\n}\n","import {cssClasses, strings} from '@material/list/constants';\n\n/**\n * As of v2 they stopped checking disabled items\n * I can understand this from an accessibility standpoint, in a world where disabled items are visible\n * but in our theme we hide disabled list tiems from the user\n * @function\n * @param {MDCList} list Instance of mdc-list\n */\nexport const arrowNavigationPatch = (list) => {\n\t// Do not patch twice\n\tif (!list || list.arrowNavaigationPatched_) return;\n\n\tlist.arrowNavaigationPatched_ = true;\n\n\tconst foundation = list.foundation_;\n\n\tfoundation.focusPrevElement = _.wrap(\n\t\tfoundation.focusPrevElement,\n\t\t(focusPrevElement, index) => {\n\t\t\tlet prevIndex = index - 1;\n\t\t\tif (prevIndex < 0) {\n\t\t\t\t// Return early because first item is already focused.\n\t\t\t\tif (!foundation.wrapFocus_) return index;\n\t\t\t\tprevIndex = foundation.adapter_.getListItemCount() - 1;\n\t\t\t}\n\n\t\t\t// Skip disabled items\n\t\t\tconst listItemEl = list.listElements[prevIndex];\n\t\t\tif (\n\t\t\t\tlistItemEl &&\n\t\t\t\tlistItemEl.classList.contains(cssClasses.LIST_ITEM_DISABLED_CLASS)\n\t\t\t) {\n\t\t\t\treturn foundation.focusPrevElement(prevIndex);\n\t\t\t}\n\n\t\t\t// Carry on\n\t\t\treturn focusPrevElement.call(foundation, index);\n\t\t},\n\t);\n\n\tfoundation.focusNextElement = _.wrap(\n\t\tfoundation.focusNextElement,\n\t\t(focusNextElement, index) => {\n\t\t\tconst count = foundation.adapter_.getListItemCount();\n\t\t\tlet nextIndex = index + 1;\n\t\t\tif (nextIndex >= count) {\n\t\t\t\t// Return early because last item is already focused.\n\t\t\t\tif (!foundation.wrapFocus_) return index;\n\t\t\t\tnextIndex = 0;\n\t\t\t}\n\n\t\t\t// Skip disabled items\n\t\t\tconst listItemEl = list.listElements[nextIndex];\n\t\t\tif (\n\t\t\t\tlistItemEl &&\n\t\t\t\tlistItemEl.classList.contains(cssClasses.LIST_ITEM_DISABLED_CLASS)\n\t\t\t) {\n\t\t\t\treturn foundation.focusNextElement(nextIndex);\n\t\t\t}\n\n\t\t\t// Carry on\n\t\t\treturn focusNextElement.call(foundation, index);\n\t\t},\n\t);\n};\n\n/**\n * https://github.com/material-components/material-components-web/issues/4696\n * @function\n * @param {MDCList} list MDCList\n */\nexport const disabledListItemCheckboxPatch = (list) => {\n\t// Do not patch twice\n\tif (!list || list.disabledListItemCheckboxPatched_) return;\n\n\tlist.prototype.initializeListType = _.wrap(\n\t\tlist.prototype.initializeListType,\n\t\tfunction (initializeListType) {\n\t\t\tconst foundation = this.foundation_;\n\t\t\tconst adapter = foundation.adapter_;\n\n\t\t\tadapter.setCheckedCheckboxOrRadioAtIndex = (index, isChecked) => {\n\t\t\t\tconst listItem = this.listElements[index];\n\t\t\t\tconst toggleEl = listItem.querySelector(\n\t\t\t\t\tstrings.CHECKBOX_RADIO_SELECTOR,\n\t\t\t\t);\n\t\t\t\t// This is all this was overriden for\n\t\t\t\tif (!toggleEl) return;\n\n\t\t\t\ttoggleEl.checked = isChecked;\n\t\t\t\tconst event = document.createEvent('Event');\n\t\t\t\tevent.initEvent('change', true, true);\n\t\t\t\ttoggleEl.dispatchEvent(event);\n\t\t\t};\n\n\t\t\treturn initializeListType.call(this);\n\t\t},\n\t);\n};\n","/**\n * @module core/functionality/keyEvents\n */\n\nconst NAME = 'keyEvents';\n\nimport {keys} from '@netx/core-app/properties/keypress';\n\nlet keysDown = [];\nlet subscribers = {};\n\nconst commandKeys = [91, 93, 17];\n\n/**\n * @function\n * @param {array|number|string} key Key(s) to test\n * @return {boolean} Key(s) down\n */\nconst isKeyDown = key => {\n\tif (!_.isArray(key)) {\n\t\tkey = [key];\n\t}\n\n\tfor (let i = 0, c = key.length, _k; i < c; i++) {\n\t\t_k = keys[key[i]] || key[i];\n\t\tif (keysDown.indexOf(_k) < 0) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n};\n\nwindow.addEventListener('keydown', e => {\n\tlet keyCode = e.keyCode || e.which;\n\tkeysDown.indexOf(keyCode) < 0 && keysDown.push(keyCode);\n\n\tif (e.defaultPrevented) return true;\n\n\tconst execute = (event, view) => {\n\t\tkeysDown = [];\n\n\t\tif (_.isFunction(event)) {\n\t\t\tevent.apply(view, [e]);\n\t\t} else if (_.isString(event)) {\n\t\t\t_.isFunction(view[event])\n\t\t\t\t? view[event](e)\n\t\t\t\t: console.warn(`\"${event}\" method could not be found on view`);\n\t\t}\n\t};\n\n\tconst commandKey = e.metaKey || e.ctrlKey;\n\tconst isInput = $(e.target).is(':input');\n\n\t_.each(subscribers, subscriber => {\n\t\tconst view = subscriber.view;\n\t\tif (!view.isShown) return;\n\t\tconst withinEl = view.el.contains(e.target);\n\n\t\tconst keyEvents = subscriber.events;\n\n\t\t_.each(keyEvents, (event, k) => {\n\t\t\tif (!withinEl && !event.global) return;\n\n\t\t\tconst requiresCommandKey = event.commandKey || event.ctrlKey;\n\t\t\tif (requiresCommandKey && !commandKey) return;\n\n\t\t\tconst _key = keys[k] || k;\n\t\t\tif (isKeyDown(_key)) {\n\t\t\t\tif (!event.execute && !isInput) return execute(event, view);\n\n\t\t\t\tif (isInput && !event.allowInput) return;\n\n\t\t\t\tif (!event.modifier) {\n\t\t\t\t\tconst keyCount = keysDown.length;\n\t\t\t\t\tif (requiresCommandKey) {\n\t\t\t\t\t\tif (commandKey && keyCount === 2) {\n\t\t\t\t\t\t\texecute(event.execute, view);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (keyCount === 1) {\n\t\t\t\t\t\texecute(event.execute, view);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tisKeyDown(event.modifier) && execute(event.execute, view);\n\t\t\t}\n\t\t});\n\t});\n\treturn true;\n});\n\nwindow.addEventListener('keyup', e => {\n\tconst keyCode = e.keyCode || e.which;\n\n\tif (commandKeys.includes(keyCode)) {\n\t\tkeysDown = [];\n\t\twindow.keysDown = keysDown;\n\t\treturn;\n\t}\n\n\tconst idx = keysDown.indexOf(keyCode);\n\tidx > -1 && keysDown.splice(idx, 1);\n});\n\nexport default function(target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tif (opts.keyEvents) {\n\t\t\tsubscribers[instance.cid] = {\n\t\t\t\tview: instance,\n\t\t\t\tevents: opts.keyEvents,\n\t\t\t};\n\n\t\t\tinstance.on('removeHook', () => {\n\t\t\t\tdelete subscribers[instance.cid];\n\t\t\t});\n\t\t}\n\t}, NAME);\n\n\treturn target;\n}\n","/**\n * @module core/functionality/drop\n * This functionality hanldles propagation and routing when something is droped the view\n */\n\nimport {isEvtWithFiles} from 'react-dropzone/dist/es/utils';\nimport {fromEvent as getFilesFromEvent} from 'file-selector';\n\nconst NAME = 'drop';\n\nconst defaults = {};\n\nexport class Drop {\n\t/** @method */\n\tconstructor(view, opts = {}) {\n\t\topts = this.options = {...defaults, ...opts};\n\n\t\tconst events = {\n\t\t\tdrop: (e) => {\n\t\t\t\tthis.dropped(e);\n\t\t\t},\n\t\t};\n\n\t\tview.events = {\n\t\t\t...events,\n\t\t\t...view.events,\n\t\t};\n\n\t\tthis.dropView = view;\n\t}\n\n\t/**\n\t * @method\n\t * @param {event} e Drop event\n\t * @fires module:asset#asset:move:selected\n\t * @fires module:category#category:move:selected\n\t * @fires module:upload#upload:import:clicked\n\t */\n\tdropped(e) {\n\t\tif (e.defaultPrevented) return;\n\n\t\t// if this.dropView.dropEvent is undefined then we are blocking drops for this view (DAM-9869)\n\t\t// meaning they wont get picked up by parent views with this functionality, like appView\n\t\tif (this.dropView.dropped) {\n\t\t\tthis.dropView.dropped(e);\n\t\t}\n\t\tif (this.dropView.dropEvent) {\n\t\t\tif (isEvtWithFiles(e.originalEvent)) {\n\t\t\t\tgetFilesFromEvent(e.originalEvent)\n\t\t\t\t\t.then((files) => {\n\t\t\t\t\t\t// trigger whatever dropEvent is specified in the view.`\n\t\t\t\t\t\tdispatcher.trigger(this.dropView.dropEvent, files);\n\t\t\t\t\t})\n\t\t\t\t\t.catch((ex) => {});\n\t\t\t}\n\t\t}\n\t\t// Stop bubbling if we want to\n\t\tif (\n\t\t\tthis.dropView.dropped ||\n\t\t\tthis.dropView.dropEvent ||\n\t\t\tthis.dropView.stopDropPropagation\n\t\t) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t}\n\t/** method */\n\tdestroy() {\n\t\tdelete this;\n\t}\n}\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tconst drop = new Drop(instance, opts);\n\t\t// Hey, listen!\n\t\tinstance.on('removeHook', () => {\n\t\t\tdrop.destroy();\n\t\t});\n\t}, NAME);\n\n\treturn target;\n}\n","const NAME = 'materialRipples';\n\nimport {MDCRipple} from '@material/ripple';\nimport {purgeEls} from '@netx/core/lib/utils';\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tlet materialRipples = [];\n\n\t\tconst cleanUp = () => {\n\t\t\t_.invoke(materialRipples, 'destroy');\n\t\t\tmaterialRipples = [];\n\t\t};\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', cleanUp)\n\t\t\t.on('removeHook', cleanUp)\n\t\t\t.on('postRenderHook', () => {\n\t\t\t\tmaterialRipples = purgeEls(\n\t\t\t\t\t[...instance.el.querySelectorAll('.mdc-ripple-surface')],\n\t\t\t\t\tinstance.getExcludedViews(),\n\t\t\t\t).map((el) => new MDCRipple(el));\n\t\t\t})\n\t\t\t.on('materialRipples:ripple', (el) => {\n\t\t\t\tconst ripple = materialRipples.find((ripple) => ripple.root_ === el);\n\t\t\t\tif (!ripple) return;\n\n\t\t\t\tconst foundation = ripple.foundation_;\n\t\t\t\tfoundation.activate();\n\t\t\t\tfoundation.deactivate();\n\t\t\t});\n\t}, NAME);\n\n\treturn target;\n}\n","const NAME = 'materialCheckboxes';\n\nimport './css/materialCheckboxes.less';\n\nimport {MDCFormField} from '@material/form-field';\nimport {MDCCheckbox} from '@material/checkbox';\nimport {purgeEls} from '@netx/core/lib/utils';\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tlet materialCheckboxes = [];\n\n\t\tconst cleanUp = () => {\n\t\t\t_.invoke(materialCheckboxes, 'destroy');\n\t\t\tmaterialCheckboxes = [];\n\t\t};\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', cleanUp)\n\t\t\t.on('removeHook', cleanUp)\n\t\t\t.on('postRenderHook', () => {\n\t\t\t\tpurgeEls(\n\t\t\t\t\t[...instance.el.querySelectorAll('.mdc-form-field')],\n\t\t\t\t\tinstance.getExcludedViews(),\n\t\t\t\t).forEach((field) => {\n\t\t\t\t\tconst checkboxEl = field.querySelector('.mdc-checkbox');\n\t\t\t\t\tif (!checkboxEl) return;\n\n\t\t\t\t\tconst checkbox = new MDCCheckbox(checkboxEl);\n\t\t\t\t\tmaterialCheckboxes.push(checkbox);\n\n\t\t\t\t\tconst formField = new MDCFormField(field);\n\t\t\t\t\tformField.input = checkbox;\n\t\t\t\t\tmaterialCheckboxes.push(formField);\n\t\t\t\t});\n\t\t\t});\n\t}, NAME);\n\n\treturn target;\n}\n","const NAME = 'materialMenus';\n\nimport {MDCMenu} from '@material/menu';\nimport {MDCMenuSurfaceFoundation} from '@material/menu-surface/foundation';\nimport {simulateClickBody} from '@netx/core/lib/utils';\n\nimport {MDCRipple} from '@material/ripple';\n\nimport {isMobile} from '@netx/core/lib/underscore-netx';\nimport {purgeEls} from '@netx/core/lib/utils';\n\nimport {arrowNavigationPatch} from './patches/mdc-list';\n\nclass Menu {\n\t/**\n\t * @method\n\t */\n\tconstructor(anchorEl, view, opts = {}) {\n\t\tthis.anchorEl = anchorEl;\n\t\tthis.view = view;\n\n\t\tconst el = (this.el = anchorEl.querySelector('.mdc-menu-surface'));\n\t\tconst dropdownToggle = (this.dropdownToggle = el.parentElement.querySelector(\n\t\t\t'.menu-button, .dropdown-toggle',\n\t\t));\n\n\t\tthis.hoist =\n\t\t\topts.hoist === true || el.classList.contains('mdc-menu--hoist');\n\t\tthis.horizontal =\n\t\t\topts.horizontal === true || el.classList.contains('mdc-menu--horizontal');\n\t\tthis.destroyOnClose = opts.destroyOnClose === true;\n\n\t\tel.addEventListener(\n\t\t\t'MDCMenuSurface:closed',\n\t\t\t(this.onClosed = this.closed.bind(this)),\n\t\t);\n\t\tel.addEventListener(\n\t\t\t'MDCMenuSurface:opened',\n\t\t\t(this.onOpen = this.opened.bind(this)),\n\t\t);\n\t\tel.addEventListener(\n\t\t\t'MDCList:action',\n\t\t\t(this.onAction = this.itemSelected.bind(this)),\n\t\t);\n\n\t\t// For our \"special\" menus that have dropdown in them\n\t\t// we need to not do this but until the facets refactor to the sidebar\n\t\t// we need this\n\t\t$(el)\n\t\t\t.on('shown.bs.dropdown', () => {\n\t\t\t\tthis.recalculatePosition();\n\t\t\t})\n\t\t\t.on('hidden.bs.dropdown', () => {\n\t\t\t\tthis.recalculatePosition();\n\t\t\t});\n\n\t\tel.addEventListener('click', (this.onClick = this.clicked.bind(this)));\n\t\tel.addEventListener('touchstart', (this.onTap = this.clicked.bind(this)));\n\t\tif (dropdownToggle) {\n\t\t\t// If in an mdc-list-item the ripple gets double applied\n\t\t\tif (!dropdownToggle.closest('.mdc-list-item__meta')) {\n\t\t\t\tthis.ripple = new MDCRipple(dropdownToggle);\n\t\t\t\tthis.ripple.unbounded = true;\n\t\t\t}\n\n\t\t\tdropdownToggle.addEventListener(\n\t\t\t\t'click',\n\t\t\t\t(this.onToggleClick = this.toggleClicked.bind(this)),\n\t\t\t);\n\t\t\tdropdownToggle.addEventListener(\n\t\t\t\t'touchstart',\n\t\t\t\t(this.onToggleTap = this.toggleClicked.bind(this)),\n\t\t\t);\n\t\t}\n\n\t\tif (!this.hoist) {\n\t\t\tthis.menu = this.createMenu(el); //new MDCMenu(el);\n\t\t}\n\n\t\tthis._open = false;\n\n\t\tif (\n\t\t\topts.autoOpen === true ||\n\t\t\tel.classList.contains('mdc-menu-surface--auto-open')\n\t\t) {\n\t\t\tthis.open();\n\t\t}\n\t}\n\n\t/** @method */\n\tcleanUp() {\n\t\tif (this.backdrop) {\n\t\t\tdocument.body.removeChild(this.backdrop);\n\t\t\tdelete this.backdrop;\n\t\t}\n\n\t\tconst menu = this.menu;\n\t\tif (!menu) return;\n\n\t\t// Put the element back - would be nice if the mdc-menu-surface did this\n\t\t// maybe they do and i missed it (like a config or whatever)\n\t\tif (this.hoist && menu.menuSurface_.foundation_.isHoistedElement_) {\n\t\t\tthis.anchorEl.appendChild(menu.root_.parentNode.removeChild(menu.root_));\n\t\t}\n\n\t\tmenu.destroy();\n\t\tdelete this.menu;\n\t}\n\n\t/**\n\t * @method\n\t * @param {event} e `click` event\n\t */\n\tclicked(e) {\n\t\t// When we click on an action our event listeners in core fire\n\t\t// but mdc list items (which live in mdc menus) can be triggered\n\t\t// by `space`, `enter` and `click`\n\t\t// So, when a click occurs we do not want to fire the action off in\n\t\t// here as to not have it fire twice\n\t\t// When we rework our actions we should keep this in mind\n\t\tif (e.target.classList.contains('nx-action')) {\n\t\t\tthis._ignoreItemSelection = true;\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis._ignoreItemSelection = false;\n\t\t\t}, 20);\n\t\t}\n\t}\n\n\t/** @method */\n\tclose() {\n\t\tconst menu = this.menu;\n\t\tif (!menu || !menu.open) return;\n\n\t\tmenu.open = false;\n\t}\n\n\t/** @method */\n\tclosed() {\n\t\tif (!this._open) return;\n\t\tthis._open = false;\n\t\tthis.anchorEl.classList.remove('open');\n\n\t\tif (this.view.onMenuClose) {\n\t\t\tthis.view.onMenuClose(this.menu);\n\t\t}\n\n\t\tif (this.destroyOnClose) {\n\t\t\tthis.destroy();\n\t\t} else if (this.hoist) {\n\t\t\tthis.cleanUp();\n\t\t}\n\t}\n\n\t/** @method */\n\tcreateMenu() {\n\t\tconst menu = (this.menu = new MDCMenu(this.el));\n\t\tarrowNavigationPatch(menu.list_);\n\n\t\t// DAM-15440 - if the menu is open when the view re-renders,\n\t\t// the menu will not reopen, because this.menu.open remains falsely true\n\t\tmenu.open = false;\n\n\t\tif (this.horizontal) {\n\t\t\tmenu.list_.foundation_.setVerticalOrientation(false);\n\t\t}\n\n\t\t// Need to look into mdc's pull request\n\t\t// HACK\n\t\t// Support mobile \"tap\"\n\t\tmenu.menuSurface_.handleBodyTap_ = (evt) => {\n\t\t\treturn menu.menuSurface_.foundation_.handleBodyClick(evt);\n\t\t};\n\t\tmenu.menuSurface_.registerBodyTapListener_ = () => {\n\t\t\treturn document.body.addEventListener(\n\t\t\t\t'touchstart',\n\t\t\t\tmenu.menuSurface_.handleBodyTap_,\n\t\t\t);\n\t\t};\n\t\tmenu.menuSurface_.deregisterBodyTapListener_ = function () {\n\t\t\treturn document.body.removeEventListener(\n\t\t\t\t'touchstart',\n\t\t\t\tmenu.menuSurface_.handleBodyTap_,\n\t\t\t);\n\t\t};\n\t\tmenu.menuSurface_.listen(\n\t\t\tMDCMenuSurfaceFoundation.strings.OPENED_EVENT,\n\t\t\tmenu.menuSurface_.registerBodyTapListener_,\n\t\t);\n\t\tmenu.menuSurface_.listen(\n\t\t\tMDCMenuSurfaceFoundation.strings.CLOSED_EVENT,\n\t\t\tmenu.menuSurface_.deregisterBodyTapListener_,\n\t\t);\n\n\t\t// menu-surface/foundation is not checking if the menu is even open. So, it will\n\t\t// will add the `mdc-menu-surface--open` modifier class and immediately remove it\n\t\t// (as the menu animation does not need to occur), which makes the menu toggle light up\n\t\t// We use thae `mdc-menu-surface--open` to display that a menu toggle is active\n\t\tmenu.menuSurface_.foundation_.close = _.wrap(\n\t\t\tmenu.menuSurface_.foundation_.close,\n\t\t\t(close) => {\n\t\t\t\tif (!menu.open) return;\n\n\t\t\t\t// On mobile we wind up clicking on any element that is behind the menu\n\t\t\t\t// in that click position - do not allow any interactive clicks for 300ms\n\t\t\t\tthis.reEnableTouchEventsTimeout &&\n\t\t\t\t\tclearTimeout(this.reEnableTouchEventsTimeout);\n\t\t\t\tdocument.body.style['pointer-events'] = 'none';\n\n\t\t\t\tthis.reEnableTouchEventsTimeout = setTimeout(() => {\n\t\t\t\t\tdocument.body.style['pointer-events'] = '';\n\t\t\t\t}, 300);\n\n\t\t\t\tclose.call(menu.menuSurface_.foundation_);\n\t\t\t},\n\t\t);\n\n\t\treturn menu;\n\t}\n\n\t/** @method */\n\tdestroy() {\n\t\tif (this.dropdownToggle) {\n\t\t\tthis.dropdownToggle.removeEventListener('click', this.onToggleClick);\n\t\t\tthis.dropdownToggle.removeEventListener('touchstart', this.onToggleTap);\n\t\t\tdelete this.dropdownToggle;\n\t\t}\n\n\t\tthis.cleanUp();\n\t\tdelete this.menu;\n\n\t\tthis.ripple && this.ripple.destroy();\n\n\t\tconst el = this.el;\n\t\tel.removeEventListener('click', this.onClick);\n\t\tel.removeEventListener('touchstart', this.onTap);\n\t\tel.removeEventListener('MDCList:action', this.onAction);\n\t\tel.removeEventListener('MDCMenuSurface:closed', this.onClosed);\n\t\tel.removeEventListener('MDCMenuSurface:opened', this.onOpen);\n\t\t$(el).off('.bs.dropdown');\n\n\t\tdelete this.anchorEl;\n\t\tdelete this.el;\n\t\tdelete this.view;\n\t}\n\n\t/**\n\t * @method\n\t * @param {event} e `MDCList:action` event\n\t */\n\titemSelected(e) {\n\t\t// Defer because our `click` event comes immediately after `MDCList:action`\n\t\t// we want to know if it was via a `click` or other (`space`, `enter`)\n\t\t_.defer(() => {\n\t\t\tif (!this._ignoreItemSelection) {\n\t\t\t\tconst item = this.menu.list_.listElements[e.detail.index];\n\t\t\t\tif (!item || !item.classList.contains('nx-action')) {\n\t\t\t\t\tif (this.view.onMenuItemSelect) {\n\t\t\t\t\t\tthis.view.onMenuItemSelect(item, this.menu);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Pass along to our action event handler\n\t\t\t\tconst evt = new MouseEvent('click', {\n\t\t\t\t\tbubbles: false,\n\t\t\t\t\tcancelable: true,\n\t\t\t\t\tview: window,\n\t\t\t\t});\n\t\t\t\titem.dispatchEvent(evt);\n\t\t\t}\n\t\t});\n\t}\n\n\t/** @method */\n\topen() {\n\t\tconst el = this.el;\n\t\tlet menu = this.menu;\n\n\t\tsimulateClickBody();\n\n\t\tif (menu && menu.open) return;\n\n\t\tif (this.hoist) {\n\t\t\tmenu = this.createMenu();\n\t\t\tmenu.setFixedPosition(true);\n\t\t\tmenu.hoistMenuToBody();\n\n\t\t\tconst backdrop = (this.backdrop = document.createElement('div'));\n\t\t\tbackdrop.classList.add('mdc-menu-backdrop');\n\t\t\tdocument.body.appendChild(backdrop);\n\n\t\t\tconst cancelItem = el.querySelector('.mdc-list-item.cancel');\n\t\t\tcancelItem &&\n\t\t\t\tcancelItem.classList.toggle(\n\t\t\t\t\t'mdc-list-item--disabled',\n\t\t\t\t\twindow.innerWidth >= 767,\n\t\t\t\t);\n\t\t}\n\n\t\tif (!menu || menu.open) return;\n\n\t\tthis.reEnableTouchEventsTimeout &&\n\t\t\tclearTimeout(this.reEnableTouchEventsTimeout);\n\t\tmenu.root_.style['pointer-events'] = 'none';\n\n\t\tmenu.open = true;\n\t}\n\n\t/** @method */\n\topened() {\n\t\tif (this._open) return;\n\n\t\tconst menu = this.menu;\n\n\t\tthis._open = true;\n\t\tthis.anchorEl.classList.add('open');\n\n\t\tif (this.view.onMenuOpen) {\n\t\t\tthis.view.onMenuOpen(menu);\n\t\t}\n\n\t\tthis.reEnableTouchEventsTimeout &&\n\t\t\tclearTimeout(this.reEnableTouchEventsTimeout);\n\t\tthis.reEnableTouchEventsTimeout = setTimeout(() => {\n\t\t\tmenu.root_.style['pointer-events'] = '';\n\t\t}, 300);\n\t}\n\n\t/** @method */\n\trecalculatePosition() {\n\t\tif (!this.menu || !this._open) return;\n\t\tconst menuSurface = this.menu.menuSurface_.foundation_;\n\t\tmenuSurface.dimensions_ = menuSurface.adapter_.getInnerDimensions();\n\t\tmenuSurface.autoPosition_();\n\t}\n\n\t/** @method */\n\ttoggle() {\n\t\tconst menu = this.menu;\n\t\t!menu || !menu.open ? this.open() : this.close();\n\t}\n\n\t/**\n\t * @method\n\t * @param {event} e `click` event\n\t */\n\ttoggleClicked(e) {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tthis.open();\n\t}\n}\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tlet materialMenus = [];\n\n\t\tconst cleanUp = () => {\n\t\t\t_.invoke(materialMenus, 'destroy');\n\t\t\tmaterialMenus = [];\n\t\t};\n\n\t\tinstance.addMaterialMenu = (el, show) => {\n\t\t\tconst menu = new Menu(el, instance);\n\t\t\tmaterialMenus.push(menu);\n\t\t\tshow && menu.open();\n\t\t};\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', cleanUp)\n\t\t\t.on('removeHook', cleanUp)\n\t\t\t.on('renderedHook', () => {\n\t\t\t\tconst el = instance.el;\n\t\t\t\tconst els = el.classList.contains('mdc-menu-surface--anchor')\n\t\t\t\t\t? [el]\n\t\t\t\t\t: purgeEls(\n\t\t\t\t\t\t\t[...instance.el.querySelectorAll('.mdc-menu-surface--anchor')],\n\t\t\t\t\t\t\tinstance.getExcludedViews(),\n\t\t\t\t\t );\n\t\t\t\tmaterialMenus = els.map((anchorEl) => {\n\t\t\t\t\treturn new Menu(anchorEl, instance, opts.materialMenus);\n\t\t\t\t});\n\t\t\t});\n\t}, NAME);\n\n\treturn target;\n}\n"],"sourceRoot":""}