-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathui-grid.pinning.min.js
6 lines (6 loc) · 3 KB
/
ui-grid.pinning.min.js
1
2
3
4
5
6
/*!
* ui-grid - v4.12.7 - 2024-04-12
* http://ui-grid.info/
* Copyright (c) 2024 ; License: MIT
*/
!function(){"use strict";var n=angular.module("ui.grid.pinning",["ui.grid"]);n.constant("uiGridPinningConstants",{container:{LEFT:"left",RIGHT:"right",NONE:""}}),n.service("uiGridPinningService",["gridUtil","GridRenderContainer","i18nService","uiGridPinningConstants",function(o,n,c,d){var u={initializeGrid:function(e){u.defaultGridOptions(e.options),e.registerColumnBuilder(u.pinningColumnBuilder);var n={pinning:{columnPinned:function(n,i){}}},i={pinning:{pinColumn:function(n,i){u.pinColumn(e,n,i)}}};e.api.registerEventsFromObject(n),e.api.registerMethodsFromObject(i)},defaultGridOptions:function(n){n.enablePinning=!1!==n.enablePinning,n.hidePinLeft=n.enablePinning&&n.hidePinLeft,n.hidePinRight=n.enablePinning&&n.hidePinRight},pinningColumnBuilder:function(n,i,e){var t,r;n.enablePinning=(void 0===n.enablePinning?e:n).enablePinning,n.hidePinLeft=(void 0===n.hidePinLeft?e:n).hidePinLeft,n.hidePinRight=(void 0===n.hidePinRight?e:n).hidePinRight,n.pinnedLeft?(i.renderContainer="left",i.grid.createLeftContainer()):n.pinnedRight&&(i.renderContainer="right",i.grid.createRightContainer()),n.enablePinning&&(e={name:"ui.grid.pinning.pinLeft",title:c.get().pinning.pinLeft,icon:"ui-grid-icon-left-open",shown:function(){return void 0===this.context.col.renderContainer||!this.context.col.renderContainer||"left"!==this.context.col.renderContainer},action:function(){u.pinColumn(this.context.col.grid,this.context.col,d.container.LEFT)}},t={name:"ui.grid.pinning.pinRight",title:c.get().pinning.pinRight,icon:"ui-grid-icon-right-open",shown:function(){return void 0===this.context.col.renderContainer||!this.context.col.renderContainer||"right"!==this.context.col.renderContainer},action:function(){u.pinColumn(this.context.col.grid,this.context.col,d.container.RIGHT)}},r={name:"ui.grid.pinning.unpin",title:c.get().pinning.unpin,icon:"ui-grid-icon-cancel",shown:function(){return void 0!==this.context.col.renderContainer&&null!==this.context.col.renderContainer&&"body"!==this.context.col.renderContainer},action:function(){u.pinColumn(this.context.col.grid,this.context.col,d.container.NONE)}},n.hidePinLeft||o.arrayContainsObjectWithProperty(i.menuItems,"name","ui.grid.pinning.pinLeft")||i.menuItems.push(e),n.hidePinRight||o.arrayContainsObjectWithProperty(i.menuItems,"name","ui.grid.pinning.pinRight")||i.menuItems.push(t),o.arrayContainsObjectWithProperty(i.menuItems,"name","ui.grid.pinning.unpin")||i.menuItems.push(r))},pinColumn:function(n,i,e){e===d.container.NONE?(i.renderContainer=null,i.colDef.pinnedLeft=i.colDef.pinnedRight=!1):(i.renderContainer=e)===d.container.LEFT?n.createLeftContainer():e===d.container.RIGHT&&n.createRightContainer(),n.refresh().then(function(){n.api.pinning.raise.columnPinned(i.colDef,e)})}};return u}]),n.directive("uiGridPinning",["gridUtil","uiGridPinningService",function(n,r){return{require:"uiGrid",scope:!1,compile:function(){return{pre:function(n,i,e,t){r.initializeGrid(t.grid)},post:function(n,i,e,t){}}}}}])}();