All Downloads are FREE. Search and download functionalities are using the official Maven repository.

views.static.entity.js.entity-module.js.map Maven / Gradle / Ivy

There is a newer version: 4.5.1
Show newest version
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"jQuery\"","webpack:///./src/js/events/SortableTableEvent.ts","webpack:///./src/js/components/MultiValueAutoSuggest.ts","webpack:///./src/js/components/EmbeddedCollection.ts","webpack:///./src/js/modules/EntityModule.ts","webpack:///./src/js/components/SortableTable.ts","webpack:///./src/js/entity-module.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","jQuery","SortableTableEvent","__webpack_exports__","MultiValueAutoSuggest","MultiValueAutoSuggestControlAdapter","jquery__WEBPACK_IMPORTED_MODULE_0__","element","_this","this","bootstrapUiModule","window","BootstrapUiModule","items","find","first","editItemTemplate","length","removeClass","triggerChange","controller","data","removeHandler","e","preventDefault","currentTarget","closest","remove","addClass","click","adapter","getTarget","on","stopPropagation","selectedValue","getValue","escapeHtml","item","refTarget","html","replace","label","append","reset","node","target","map","ix","hidden","val","context","toArray","selectValue","newValue","trigger","triggerSubmit","$","EmbeddedCollection","entityModule","EntityModule","wrapper","filter","results","is","templatePrefix","attr","nextItemIndex","targetPrefix","parentItem","parentPrefix","parentTemplate","sortIndex","id","template","each","initializeFormElements","_components_EmbeddedCollection__WEBPACK_IMPORTED_MODULE_0__","_components_MultiValueAutoSuggest__WEBPACK_IMPORTED_MODULE_1__","documentInitialized","initializers","registerInitializer","callback","callIfAlreadyInitialized","push","undefined","emSortableTable","dependsonConfig","options","hide","dependsOn","container","keyCode","which","value_1","clone","innerText","removeAttr","clickEvent","tooltip","SortableTable","_events_SortableTableEvent__WEBPACK_IMPORTED_MODULE_0__","dataIsLoading","sortOnProperty","propertyName","currentIndex","sort","prop","order","dir","splice","concat","moveToPage","page","init","table","parseInt","formName","form","doesDataLoadWithAjax","size","totalPages","currentSort","sortables","this_1","index","MOVE_TO_PAGE","event","pageNumber","SORT","propertyToSortOn","select","keypress","isNaN","self","special","LOAD_DATA","_default","params","loadData","PREPARE_DATA","prepareData","sortProperties","loadDataWithAjax","baseParams","itemTable","serializeArray","x","extend","param","replaceWith","loadedTable","done","NEW_DATA_LOADED","fail","form_1","paramName","paramValue","control","isArray","requireHiddenElement_1","submit","pathUrl","location","href","split","_modules_EntityModule__WEBPACK_IMPORTED_MODULE_0__","_components_SortableTable__WEBPACK_IMPORTED_MODULE_1__","_components_MultiValueAutoSuggest__WEBPACK_IMPORTED_MODULE_2__","ControlAdapterFactory","register","initializeControlAdapters","document","ready","fn","_emSortableTable"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,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-module.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 16);\n","module.exports = jQuery;","/*\n * Copyright 2014 the original author or authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum SortableTableEvent\n{\n    /**\n     * Trigger this event with the page number as parameter.\n     */\n    MOVE_TO_PAGE = 'emSortableTable:moveToPage',\n\n    /**\n     * Trigger this event with the new field name to sort on as parameter.\n     */\n    SORT = 'emSortableTable:sort',\n\n    /**\n     * Subscribe to this event if you want to modify the parameters for loading the data.\n     */\n    PREPARE_DATA = 'emSortableTable:prepareData',\n\n    /**\n     * Subscribe to this event if you want to modify the parameters for loading the data,\n     * or if you want to implement custom data loading and rendering.\n     * Prevent the default event handling in the latter case.\n     */\n    LOAD_DATA = 'emSortableTable:loadData',\n\n    /**\n     * Subscribe to this event if you want to be notified if data new has been loaded\n     */\n    NEW_DATA_LOADED = 'emSortableTable:newDataLoaded',\n}\n","/*\n * Copyright 2014 the original author or authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as $ from 'jquery';\n\nexport class MultiValueAutoSuggest\n{\n    private bootstrapUiModule: any;\n\n    constructor( element: JQuery )\n    {\n        this.bootstrapUiModule = (window).BootstrapUiModule;\n\n        const items = element.find( '[data-role=items]' ).first();\n        const editItemTemplate = element.find( '[data-role=edit-item-template]' ).first();\n\n        if ( items.find( 'tr' ).length > 1 ) {\n            items.removeClass( 'd-none' );\n        }\n\n        const triggerChange = () => {\n            const controller = element.data( 'bootstrapui-adapter' ) as BootstrapUiControlAdapter;\n            if ( controller ) {\n                controller.triggerChange();\n            }\n        };\n\n        const removeHandler = ( e: JQueryEventObject ) => {\n            e.preventDefault();\n            $( e.currentTarget ).closest( '[data-role=item]' ).remove();\n            if ( items.find( 'tr' ).length === 1 ) {\n                items.addClass( 'd-none' );\n            }\n            triggerChange();\n        };\n\n        items.find( '[data-action=remove-item]' ).click( removeHandler );\n\n        const adapter = element.find( '[data-role=control]' ).first().data( 'bootstrapui-adapter' );\n        $( adapter.getTarget() ).on( 'bootstrapui.change', ( e: JQueryEventObject, adapter: any ) => {\n            e.stopPropagation();\n            const selectedValue = adapter.getValue()[0];\n            if ( selectedValue.value !== '' ) {\n                const value = MultiValueAutoSuggest.escapeHtml( '' + selectedValue.value );\n\n                if ( items.find( '[value=\"' + value + '\"]' ).length === 0 ) {\n                    const item = $( $( this.bootstrapUiModule.refTarget( editItemTemplate ) )\n                                    .html()\n                                    .replace( '{{id}}', value )\n                                    .replace( '{{label}}', MultiValueAutoSuggest.escapeHtml( '' + selectedValue.label ) ) );\n                    item.find( '[data-action=remove-item]' ).click( removeHandler );\n                    items.append( item );\n                    items.removeClass( 'd-none' );\n                }\n                adapter.reset();\n                triggerChange();\n            }\n        } );\n    }\n\n    private static escapeHtml( value: string ): string\n    {\n        return value.replace( /&/g, '&' )\n                    .replace( //g, '>' )\n                    .replace( /\"/g, '"' );\n    }\n}\n\n/**\n * Control adapter implementation for a multi-value autosuggest control.\n * With limited support as it only allows fetching the values.\n */\nexport class MultiValueAutoSuggestControlAdapter implements BootstrapUiControlAdapter\n{\n    private items: JQuery;\n    private target: any;\n\n    constructor( node: any )\n    {\n        this.target = node;\n        this.items = $( node ).find( '[data-role=items]' ).first();\n    }\n\n    getTarget(): any\n    {\n        return this.target;\n    }\n\n    getValue(): BootstrapUiControlValueHolder[]\n    {\n        return this.items.find( 'input[type=hidden]' )\n                   .map( ( ix, hidden ) => {\n                       const val = $( hidden ).val();\n                       return {\n                           label: val,\n                           value: val,\n                           context: hidden,\n                       };\n                   } ).toArray() as BootstrapUiControlValueHolder[];\n    }\n\n    reset(): void\n    {\n    }\n\n    selectValue( newValue: any ): void\n    {\n    }\n\n    triggerChange(): void\n    {\n        $( this.getTarget() ).trigger( 'bootstrapui.change', [this] );\n    }\n\n    triggerSubmit(): void\n    {\n        $( this.getTarget() ).trigger( 'bootstrapui.submit', [this] );\n    }\n}\n","/*\n * Copyright 2014 the original author or authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class EmbeddedCollection\n{\n    private bootstrapUiModule: any;\n    private entityModule: any;\n\n    constructor( element: JQuery )\n    {\n        this.bootstrapUiModule = (window).BootstrapUiModule;\n        this.entityModule = (window).EntityModule;\n\n        const wrapper = element;\n\n        const filter = ( results: any ) => {\n            return results.filter( ( ix: number, element: any ) => {\n                return $( element ).closest( '[data-item-format]' ).is( wrapper );\n            } );\n        };\n\n        const items = filter( wrapper.find( '[data-role=items]' ) ).first();\n        const editItemTemplate = filter( wrapper.find( '[data-role=edit-item-template]' ) ).first();\n\n        const templatePrefix = editItemTemplate.attr( 'data-template-prefix' );\n        let nextItemIndex = editItemTemplate.data( 'next-item-index' );\n        let targetPrefix = wrapper.attr( 'data-item-format' );\n\n        const parentItem = wrapper.closest( '[data-item-prefix]' );\n\n        if ( parentItem.length ) {\n            const parentPrefix = parentItem.attr( 'data-item-prefix' );\n            const parentTemplate = parentItem.closest( '[data-item-format]' ).attr( 'data-item-format' );\n            targetPrefix = targetPrefix.replace( parentTemplate, parentPrefix );\n        }\n\n        filter( items.find( '[data-action=remove-item]' ) ).click( ( e: JQueryEventObject ) => {\n            e.preventDefault();\n            $( e.currentTarget ).closest( '[data-role=item]' ).remove();\n        } );\n\n        filter( wrapper.find( '[data-action=add-item]' ) ).click( () => {\n            const sortIndex = nextItemIndex++;\n            const id = 'item-' + sortIndex;\n            const target = targetPrefix.replace( '{{key}}', id );\n\n            const template = $( this.bootstrapUiModule.refTarget( editItemTemplate ).html() );\n            template.attr( 'data-item-key', id );\n            template.attr( 'data-item-prefix', target );\n\n            template.find( '[name^=\"' + templatePrefix + '\"]' ).each( ( ix: number, node: any ) => {\n                $( node ).attr( 'name', $( node ).attr( 'name' ).replace( templatePrefix, target ) );\n            } );\n            template.find( '[name^=\"_' + templatePrefix + '\"]' ).each( ( ix: number, node: any ) => {\n                $( node ).attr( 'name', $( node ).attr( 'name' ).replace( '_' + templatePrefix, '_' + target ) );\n            } );\n            template.find( '[for^=\"' + templatePrefix + '\"]' ).each( ( ix: number, node: any ) => {\n                $( node ).attr( 'for', $( node ).attr( 'for' ).replace( templatePrefix, target ) );\n            } );\n            template.find( '[id^=\"' + templatePrefix + '\"]' ).each( ( ix: number, node: any ) => {\n                $( node ).attr( 'id', $( node ).attr( 'id' ).replace( templatePrefix, target ) );\n            } );\n\n            template.find( '[data-action=remove-item]' ).click( ( e: JQueryEventObject ) => {\n                e.preventDefault();\n                $( e.currentTarget ).closest( '[data-role=item]' ).remove();\n            } );\n\n            template.find( '[name=\"' + target + '.sortIndex\"]' )\n                    .attr( 'value', sortIndex );\n\n            items.append( template );\n\n            this.entityModule.initializeFormElements( template );\n        } );\n    }\n\n}\n","/*\n * Copyright 2014 the original author or authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {EmbeddedCollection} from '../components/EmbeddedCollection';\nimport {MultiValueAutoSuggest} from '../components/MultiValueAutoSuggest';\n\nexport class EntityModule\n{\n    private documentInitialized: boolean = false;\n    private initializers: any = [];\n    private bootstrapUiModule: any;\n\n    constructor()\n    {\n        this.bootstrapUiModule = (window).BootstrapUiModule;\n    }\n\n    /**\n     * Register an additional initializer that should execute when running initializeFormElements.\n     * An initializer is a callback function that will optionally receive the container node as argument.\n     *\n     * @param callback function to execute\n     * @param callIfAlreadyInitialized should the initializer execute immediately if document has been initialized already - defaults to true\n     */\n    registerInitializer( callback: any, callIfAlreadyInitialized: any )\n    {\n        this.initializers.push( callback );\n\n        const shouldExecute = (callIfAlreadyInitialized === undefined || true === callIfAlreadyInitialized) && this.documentInitialized;\n\n        if ( shouldExecute ) {\n            callback();\n        }\n    }\n\n    /**\n     * Scan for and initialize all known form element types.\n     * This will in turn call BootstrapUiModule.initializeFormElements() if called at any time past the initial document initialization.\n     *\n     * @param node optional parent to limit the scan\n     */\n    initializeFormElements( node?: any )\n    {\n        // Dispatch to BootstrapUiModule directly if initial document initialization has happened\n        if ( (node !== undefined || this.documentInitialized) && this.bootstrapUiModule && this.bootstrapUiModule.initializeFormElements ) {\n            this.bootstrapUiModule.initializeFormElements( node );\n        }\n\n        if ( node === undefined && !this.documentInitialized ) {\n            this.documentInitialized = true;\n        }\n\n        /**\n         * Initialize sortable tables.\n         */\n        $( '[data-tbl-type=\"paged\"]', node ).emSortableTable();\n\n        /**\n         * Initialize depends-on conditions between controls.\n         */\n        $( '[data-dependson]', node ).each( function ( ix, n ) {\n            const dependsonConfig = $( this ).data( 'dependson' );\n            const options = dependsonConfig['options'] != null ? dependsonConfig['options'] : {hide: false};\n            delete dependsonConfig['options'];\n\n            $( n ).dependsOn( dependsonConfig, options );\n        } );\n\n        /**\n         * Initialize multi value controls.\n         */\n        $( '.js-multi-value-control', node ).each( ( ix, element ) => {\n            const container = $( element );\n\n            container.find( '.js-multi-value-input' ).on( 'keypress', ( e ) => {\n                const keyCode = (e.keyCode ? e.keyCode : e.which);\n                if ( keyCode === 13 ) {\n                    e.preventDefault();\n                    const value = $( e.currentTarget ).val();\n                    if ( value ) {\n                        const template = container.find( '.js-multi-value-template' ).clone( false );\n                        template.removeClass( 'd-none js-multi-value-template' );\n                        template.addClass( 'js-multi-value-item' );\n\n                        template.find( '.js-multi-value-value' ).each( ( i: number, node: any ) => {\n                            node.innerText = value;\n                        } );\n\n                        template.find( '[type=hidden]' ).val( value ).removeAttr( 'disabled' );\n                        container.find( 'table' ).append( template );\n\n                        template.find( 'a' ).on( 'click', ( clickEvent ) => {\n                            clickEvent.preventDefault();\n                            $( clickEvent.currentTarget ).closest( 'tr' ).remove();\n                        } );\n\n                        $( e.currentTarget ).val( '' );\n                    }\n                }\n            } );\n\n            container.find( '.js-multi-value-item a' ).on( 'click', ( clickEvent ) => {\n                clickEvent.preventDefault();\n                $( clickEvent.currentTarget ).closest( 'tr' ).remove();\n            } );\n        } );\n\n        /**\n         * Experimental: initialize embedded collections.\n         */\n        $( '.js-embedded-collection-form-group', node ).each( ( ix, n ) => new EmbeddedCollection( $( n ) ) );\n\n        /**\n         * Experimental: initialize multi-value autosuggest.\n         */\n        $( '.js-multi-value-autosuggest', node ).each( ( ix, n ) => new MultiValueAutoSuggest( $( n ) ) );\n\n        /**\n         * Initialize tooltips.\n         */\n        $( '[data-toggle=\"tooltip\"]', node ).tooltip();\n\n        // Dispatch to additional initializers\n        for ( let i = 0; i < this.initializers.length; i++ ) {\n            this.initializers[i]( node );\n        }\n    }\n}\n","import {SortableTableEvent} from '../events/SortableTableEvent';\nimport {EntityModule} from '../modules/EntityModule';\n\nexport class SortableTable\n{\n    private page: number;\n    private size: number;\n    private sort: any;\n    private doesDataLoadWithAjax: boolean;\n    private totalPages: number;\n    private formName: string;\n    private sortables: any;\n    private form: JQuery;\n    private table: JQuery;\n    private entityModule: EntityModule;\n    private pageNumber: number;\n    private dataIsLoading: boolean = false;\n\n    constructor( element: JQuery )\n    {\n        this.init( element );\n        this.entityModule = (window).EntityModule;\n    }\n\n    init( element: JQuery )\n    {\n        this.table = $( element );\n        const id = $( element ).attr( 'data-tbl' );\n        this.page = parseInt( this.table.attr( 'data-tbl-current-page' ), 10 );\n        this.formName = $( element ).attr( 'data-tbl-form' );\n        this.form = $( 'form[name=' + this.formName + ']' );\n        this.doesDataLoadWithAjax = this.table.data( 'tbl-ajax-load' );\n\n        this.size = parseInt( this.table.attr( 'data-tbl-size' ), 10 );\n        this.totalPages = parseInt( this.table.attr( 'data-tbl-total-pages' ), 10 );\n\n        const currentSort = this.table.data( 'tbl-sort' );\n        this.sort = currentSort != null ? currentSort : [];\n\n        this.sortables = $( \"[data-tbl='\" + id + \"'][data-tbl-sort-property]\", this.table );\n        this.sortables.removeClass( 'asc', 'desc' );\n\n        for ( let i = 0; i < this.sort.length; i++ ) {\n            const order = this.sort[i];\n\n            $( \"[data-tbl='\" + id + \"'][data-tbl-sort-property='\" + order.prop + \"']\", this.table )\n                .each( ( index: number, item: any ) => {\n                    if ( i === 0 ) {\n                        $( item ).addClass( order.dir === 'ASC' ? 'asc' : 'desc' );\n                    }\n                    order.prop = $( item ).data( 'tbl-sort-property' );\n                } );\n        }\n\n        this.table.on( SortableTableEvent.MOVE_TO_PAGE, ( event: JQueryEventObject, pageNumber: number ) => {\n            this.moveToPage( pageNumber );\n        } );\n\n        this.table.on( SortableTableEvent.SORT, ( event: JQueryEventObject, propertyToSortOn: string ) => {\n            this.sortOnProperty( propertyToSortOn );\n        } );\n\n        this.form.on( 'submit', ( e: JQueryEventObject ) => {\n            if ( this.doesDataLoadWithAjax && !this.dataIsLoading) {\n                e.preventDefault();\n                this.dataIsLoading = true;\n                this.table.trigger( SortableTableEvent.MOVE_TO_PAGE, this.page );\n            }\n        } );\n\n        $( \"[data-tbl='\" + id + \"'][data-tbl-page]\" ).click( ( e: JQueryEventObject ) => {\n            e.preventDefault();\n            e.stopPropagation();\n\n            this.table.trigger( SortableTableEvent.MOVE_TO_PAGE, parseInt( $( e.currentTarget ).attr( 'data-tbl-page' ), 10 ) );\n        } );\n\n        $( \"input[type='text'][data-tbl='\" + id + \"'][data-tbl-page-selector]\" )\n            .click( ( event: JQueryEventObject ) => {\n                event.preventDefault();\n                $( event.currentTarget ).select();\n            } )\n            .keypress( ( event: JQueryEventObject ) => {\n                const keyCode = (event.keyCode ? event.keyCode : event.which);\n                if ( keyCode === 13 ) {\n                    event.preventDefault();\n                    let pageNumber = parseInt( $( event.currentTarget ).val(), 10 );\n\n                    if ( isNaN( pageNumber ) ) {\n                        $(  event.currentTarget ).addClass( 'has-error' );\n                    }\n                    else {\n                        $(  event.currentTarget ).removeClass( 'has-error' );\n                        if ( pageNumber < 1 ) {\n                            pageNumber = 1;\n                        }\n                        else if ( pageNumber > this.totalPages ) {\n                            pageNumber = this.totalPages;\n                        }\n                        this.table.trigger( SortableTableEvent.MOVE_TO_PAGE, pageNumber - 1 );\n                    }\n                }\n            } );\n\n        this.sortables.click( ( e: JQueryEventObject ) => {\n            e.preventDefault();\n            e.stopPropagation();\n            this.table.trigger( SortableTableEvent.SORT, $( e.target ).data( 'tbl-sort-property' ) );\n        } );\n        const self = this;\n\n        jQuery.event.special[SortableTableEvent.LOAD_DATA] = {\n            _default: function ( event: JQueryEventObject, params: any ) {\n                // fallback to default loading of paged data\n                self.loadData( params );\n            },\n        };\n\n        jQuery.event.special[SortableTableEvent.PREPARE_DATA] = {\n            _default: function ( event: JQueryEventObject, params: any ) {\n                // fallback to default to prepare the paged data loading\n                self.prepareData( params );\n            },\n        };\n    }\n\n    moveToPage( pageNumber: number )\n    {\n        const params: any = {\n            page: pageNumber, size: this.size,\n        };\n\n        if ( this.sort != null && this.sort.length > 0 ) {\n            const sortProperties = [];\n\n            for ( let i = 0; i < this.sort.length; i++ ) {\n                sortProperties.push( this.sort[i].prop + ',' + this.sort[i].dir );\n            }\n\n            params['sort'] = sortProperties;\n        }\n\n        this.table.trigger( SortableTableEvent.PREPARE_DATA, params );\n\n        this.table.trigger( SortableTableEvent.LOAD_DATA, params );\n    }\n\n    // Todo: the find of the table is not ideal\n    loadDataWithAjax( baseParams: any, form: any )\n    {\n        let params: any = {};\n        const itemTable = $( '.pcs-body-section' ).find( '.panel-default' );\n\n        form.serializeArray().map( ( x: any ) => {\n            params[x.name] = x.value;\n        } );\n\n        params = $.extend( params, baseParams );\n\n        $.get( '#', $.param( params, true ), ( data ) => {\n            itemTable.replaceWith( data );\n            const loadedTable =  $('[data-tbl-type=\"paged\"]');\n            this.init(loadedTable);\n        } ).done(() => {\n            this.dataIsLoading = false;\n            this.table.trigger( SortableTableEvent.NEW_DATA_LOADED );\n        }).fail(() => {\n            // Retry on fail\n            this.loadDataWithAjax(baseParams, form);\n        });\n    }\n\n    prepareData( params: any )\n    {\n        if ( this.doesDataLoadWithAjax ) {\n            params['_partial'] = '::itemsTable';\n        }\n    }\n\n    loadData( params: any )\n    {\n        if ( this.formName ) {\n            const form = $( 'form[name=' + this.formName + ']' );\n\n            const requireHiddenElement = ( name: string, value: any ) => {\n                if ( value ) {\n                    $( 'input[name=' + name + '][type=hidden]' ).remove();\n\n                    const control = $( 'input[name=' + name + ']', form );\n                    if ( control.length ) {\n                        control.val( value );\n                    }\n                    else {\n                        if ( $.isArray( value ) ) {\n                            for ( let i = 0; i < value.length; i++ ) {\n                                form.append( '' );\n                            }\n                        }\n                        else {\n                            form.append( '' );\n                        }\n                    }\n                }\n            };\n\n            $.each( params, ( paramName: string, paramValue: any ) => {\n                requireHiddenElement( paramName, paramValue );\n            } );\n\n            if ( this.doesDataLoadWithAjax ) {\n                this.dataIsLoading = true;\n                this.loadDataWithAjax( params, form );\n            }\n            else {\n                form.submit();\n            }\n        }\n        else {\n            const pathUrl = window.location.href.split( '?' )[0];\n            window.location.href = pathUrl + '?' + $.param( params, true );\n        }\n    }\n\n    sortOnProperty = ( propertyName: string ) => {\n        let currentIndex = -1;\n\n        for ( let i = 0; i < this.sort.length && currentIndex < 0; i++ ) {\n            if ( this.sort[i].prop === propertyName ) {\n                currentIndex = i;\n            }\n        }\n\n        const order = {\n            prop: propertyName, dir: 'ASC',\n        };\n\n        if ( currentIndex > -1 ) {\n            if ( currentIndex === 0 ) {\n                order.dir = this.sort[currentIndex].dir === 'ASC' ? 'DESC' : 'ASC';\n            }\n\n            if ( this.sort.length > 1 ) {\n                this.sort.splice( currentIndex, 1 );\n            }\n            else {\n                this.sort = [];\n            }\n        }\n\n        this.sort = [order].concat( this.sort );\n\n        this.moveToPage( this.page );\n    }\n\n}\n","/*\n * Copyright 2014 the original author or authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {EntityModule} from \"./modules/EntityModule\";\nimport {SortableTable} from \"./components/SortableTable\";\nimport {MultiValueAutoSuggestControlAdapter} from './components/MultiValueAutoSuggest';\n\nconst entityModule = new EntityModule();\nconst bootstrapUiModule = window.BootstrapUiModule;\n\nif ( bootstrapUiModule.ControlAdapterFactory ) {\n    bootstrapUiModule.ControlAdapterFactory.register( 'multi-value-autosuggest', function( node ) {\n        bootstrapUiModule.ControlAdapterFactory.initializeControlAdapters( node );\n        return new MultiValueAutoSuggestControlAdapter( node );\n    } );\n}\n\n\n$( document ).ready( function() {\n    entityModule.initializeFormElements();\n} );\n\nwindow.EntityModule = entityModule;\n\n/**\n * Expose JQuery plugin emSortableTable, creates a SortableTable when called.\n */\n$.fn.emSortableTable = function() {\n    return this.each( function() {\n        if ( !this._emSortableTable ) {\n            this._emSortableTable = new SortableTable( this );\n        }\n    } );\n};\n"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy