/*! SearchPanes 2.0.0 * 2019-2022 SpryMedia Ltd - datatables.net/license */ (function () { 'use strict'; var $$4; var dataTable$1; function setJQuery$4(jq) { $$4 = jq; dataTable$1 = jq.fn.dataTable; } var SearchPane = /** @class */ (function () { /** * Creates the panes, sets up the search function * * @param paneSettings The settings for the searchPanes * @param opts The options for the default features * @param index the index of the column for this pane * @param panesContainer The overall container for SearchPanes that this pane will be attached to * @param panes The custom pane settings if this is a custom pane * @returns {object} the pane that has been created, including the table and the index of the pane */ function SearchPane(paneSettings, opts, index, panesContainer, panes) { var _this = this; if (panes === void 0) { panes = null; } // Check that the required version of DataTables is included if (!dataTable$1 || !dataTable$1.versionCheck || !dataTable$1.versionCheck('1.10.0')) { throw new Error('SearchPane requires DataTables 1.10 or newer'); } // Check that Select is included // eslint-disable-next-line no-extra-parens if (!dataTable$1.select) { throw new Error('SearchPane requires Select'); } var table = new dataTable$1.Api(paneSettings); this.classes = $$4.extend(true, {}, SearchPane.classes); // Get options from user this.c = $$4.extend(true, {}, SearchPane.defaults, opts); if (opts && opts.hideCount && opts.viewCount === undefined) { this.c.viewCount = !this.c.hideCount; } var rowLength = table.columns().eq(0).toArray().length; this.s = { colExists: index < rowLength, colOpts: undefined, customPaneSettings: panes, displayed: false, dt: table, dtPane: undefined, firstSet: true, index: index, indexes: [], listSet: false, name: undefined, rowData: { arrayFilter: [], arrayOriginal: [], bins: {}, binsOriginal: {}, filterMap: new Map(), totalOptions: 0 }, scrollTop: 0, searchFunction: undefined, selections: [], serverSelect: [], serverSelecting: false, tableLength: null, updating: false }; this.s.colOpts = this.s.colExists ? this._getOptions() : this._getBonusOptions(); this.dom = { buttonGroup: $$4('
').addClass(this.classes.buttonGroup), clear: $$4('') .attr('disabled', 'true') .addClass(this.classes.disabledButton) .addClass(this.classes.paneButton) .addClass(this.classes.clearButton) .html(this.s.dt.i18n('searchPanes.clearPane', this.c.i18n.clearPane)), collapseButton: $$4('') .addClass(this.classes.paneButton) .addClass(this.classes.collapseButton), container: $$4('
') .addClass(this.classes.container) .addClass(this.s.colOpts.className) .addClass(this.classes.layout + (parseInt(this.c.layout.split('-')[1], 10) < 10 ? this.c.layout : this.c.layout.split('-')[0] + '-9')) .addClass(this.s.customPaneSettings && this.s.customPaneSettings.className ? this.s.customPaneSettings.className : ''), countButton: $$4('') .addClass(this.classes.paneButton) .addClass(this.classes.countButton), dtP: $$4('
' + (this.s.colExists ? $$4(this.s.dt.column(this.s.index).header()).text() : this.s.customPaneSettings.header || 'Custom Pane') + '
'), lower: $$4('
').addClass(this.classes.subRow2).addClass(this.classes.narrowButton), nameButton: $$4('') .addClass(this.classes.paneButton) .addClass(this.classes.nameButton), panesContainer: panesContainer, searchBox: $$4('').addClass(this.classes.paneInputButton).addClass(this.classes.search), searchButton: $$4('