@sankhyalabs/ezui 2.3.9 → 2.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ export declare class EzActionsButton {
4
4
  private _listContainer;
5
5
  private _button;
6
6
  private _floatingID;
7
+ private _arrowOffset;
7
8
  private _element;
8
9
  private _selectedAction;
9
10
  /**
@@ -57,8 +58,12 @@ export declare class EzActionsButton {
57
58
  isOpened(): Promise<boolean>;
58
59
  innerClickCheck: (floatingContainer: HTMLElement, node: HTMLElement) => boolean;
59
60
  private showActions;
61
+ private getPositionTop;
62
+ private getBoundingLeft;
63
+ private getPositionLeft;
60
64
  private hasLabelOrCheckOption;
61
65
  private hasIconName;
66
+ private controlScrollPage;
62
67
  private handlerButtonClick;
63
68
  private actionClick;
64
69
  componentWillLoad(): void;
@@ -78,7 +78,7 @@ export declare class EzGrid {
78
78
  * Aplica um filtro rápido.
79
79
  */
80
80
  quickFilter(term: string): Promise<void>;
81
- componentWillLoad(): void;
81
+ onSelectionChange(evt: CustomEvent): void;
82
82
  onColumnStateChange(type: string, state: Array<EzGridColumn>, info: any): void;
83
83
  private createConfigFromState;
84
84
  componentDidLoad(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/ezui",
3
- "version": "2.3.9",
3
+ "version": "2.3.11",
4
4
  "description": "Biblioteca de componentes Sankhya.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/custom-elements/index.js",
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as o,H as n,g as s}from"./p-3c7ea91b.js";import{FloatingManager as a}from"@sankhyalabs/core";import"./p-0b44cf1c.js";import{C as e}from"./p-4a5e37a7.js";import"./p-e1148f5c.js";import"./p-b853763b.js";let c=class{constructor(o){t(this,o),this.ezAction=i(this,"ezAction",7),this.enabled=!0,this.size="medium",this.showLabel=!1,this.checkOption=!1,this.isTransparent=!1,this.arrowActive=!1,this.innerClickCheck=(t,i)=>{var o;if(i&&t){if(i===t)return!0;const n=t.children;for(let t=0;t<n.length;t++)if(null===(o=n[t].shadowRoot)||void 0===o?void 0:o.contains(i))return!0}return!1}}async hideActions(){null!=this._floatingID&&a.close(this._floatingID),this._floatingID=void 0}async isOpened(){return null!=this._floatingID}showActions(){var t,i;if(!this.enabled)return;const o=null===(t=this._element)||void 0===t?void 0:t.getBoundingClientRect();let n=o?o.x-(this.arrowActive?5:0)+"px":null,s={autoClose:!0,innerClickTest:this.innerClickCheck,isFixed:!0,left:n};this._floatingID=a.float(this._actionsList,this._listContainer,s);const e=document.body.clientWidth,c=null===(i=this._actionsList)||void 0===i?void 0:i.getBoundingClientRect();(null==c?void 0:c.right)>e&&(n=e-c.width+"px",s={autoClose:!0,innerClickTest:this.innerClickCheck,left:n},a.updateFloatPosition(this._actionsList,this._listContainer,s)),window.requestAnimationFrame((()=>{this._actionsList.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}))}hasLabelOrCheckOption(){var t;return(this.showLabel||this.checkOption)&&(null===(t=this.actions)||void 0===t?void 0:t.length)>0}hasIconName(){var t;return null===(t=this.actions)||void 0===t?void 0:t.some((t=>null!=t.iconName))}handlerButtonClick(){this.showActions()}actionClick(t){this._selectedAction=t,this.hideActions(),this.ezAction.emit(t)}componentWillLoad(){if(null==this.actions){this.actions=[];const t=this._element.querySelectorAll("action");t&&t.forEach((t=>{let i=t.innerText,o=t.getAttribute("value");o||(o=i),this.actions.push({label:i,value:o}),t.hidden=!0}))}}componentDidLoad(){e.applyVarsButton(this._element,this._button)}componentDidRender(){null==this._floatingID&&this._actionsList.remove(),this.hasLabelOrCheckOption()&&(this.value?this._selectedAction=this.actions.find((t=>t.value===this.value)):this._selectedAction||(this._selectedAction=this.actions[0]))}render(){var t;return o(n,null,o("ez-button",{ref:t=>this._button=t,class:(this.isTransparent?"ez-actions-button__btn-transparent":"")+(this.showLabel?" ez-actions-button__btn-label":""),label:this.showLabel&&(null===(t=this._selectedAction)||void 0===t?void 0:t.label),enabled:this.enabled,mode:this.showLabel?void 0:"icon",iconName:this.showLabel?"":this.displayIcon||"dots-vertical",size:this.size,onClick:()=>this.handlerButtonClick()},this.showLabel&&o("ez-icon",{class:"ez-actions-button__icon-right",slot:"rightIcon",iconName:this.displayIcon||"dots-vertical"})),o("section",{class:"ez-actions-button__list-container",ref:t=>this._listContainer=t},this.arrowActive&&o("div",{class:"ez-actions-button__arrow"+(this.isTransparent?" ez-actions-button__arrow--upped":"")}),o("div",{ref:t=>this._actionsList=t,class:"ez-actions-button__actions-list"+(this.arrowActive&&!this.isTransparent?" ez-actions-button__actions-list--lowered":"")},this.actions.map((t=>{var i;return o("ez-button",{size:"small",label:t.label,onClick:()=>this.actionClick(t),class:"ez-actions-button__btn-action"+(this.checkOption||this.hasIconName()?" ez-actions-button__btn-action--spaced":"")},this.checkOption&&(null===(i=this._selectedAction)||void 0===i?void 0:i.value)===t.value&&o("ez-icon",{class:"ez-actions-button__icon-check",slot:"leftIcon",size:"small",iconName:"check"}),!this.checkOption&&t.iconName&&o("ez-icon",{class:"ez-actions-button__icon-item",slot:"leftIcon",size:"small",iconName:t.iconName}))})))))}get _element(){return s(this)}};c.style=":host{--ez-actions-button__actions-list--border-radius:var(--border--radius-medium, 12px);--ez-actions-button__actions-list--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-actions-button__actions-list--background-color:var(--background--xlight, #fff);--ez-actions-button__actions-list--padding:var(--space--small, 6px);--ez-actions-button__actions-list--top-margin:var(--space-small, 6px);--ez-actions-button__btn-action--min-width:'auto';--ez-actions-button__btn-action--background-color:var(--background--xlight, #fff);display:flex;flex-direction:column;height:fit-content;user-select:none}.ez-actions-button__actions-list{display:flex;flex-direction:column;position:fixed;width:fit-content;height:fit-content;z-index:var(--more-visible, 2);padding:var(--ez-actions-button__actions-list--padding);margin-top:var(--ez-actions-button__actions-list--top-margin);background-color:var(--ez-actions-button__actions-list--background-color);border-radius:var(--ez-actions-button__actions-list--border-radius);box-shadow:var(--ez-actions-button__actions-list--box-shadow)}.ez-actions-button__actions-list--lowered{margin-top:calc(var(--ez-actions-button__actions-list--top-margin) + 6px)}.ez-actions-button__btn-action{--ez-button--justify-content:flex-start;--ez-button--width:100%;--ez-button--min-width:var(--ez-actions-button__btn-action--min-width);--ez-button--background-color:var(--ez-actions-button__btn-action--background-color);--ez-button--font-weight:var(--text-weight--medium, 400);--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__btn-action--spaced{--ez-button--padding-left:calc(var(--space--medium, 12px) + 24px)}.ez-actions-button__icon-right{margin-left:var(--space--small, 6px)}.ez-actions-button__icon-check,.ez-actions-button__icon-item{position:absolute;left:var(--space--medium, 12px)}.ez-actions-button__icon-check{color:var(--ez-button--hover-color)}.ez-actions-button__arrow{position:fixed;border-left:10px solid transparent;border-right:10px solid transparent;width:0;height:0;margin-left:6px;z-index:calc(var(--more-visible, 2) + 1);border-bottom:15px solid var(--ez-actions-button__btn-action--background-color)}.ez-actions-button__arrow--upped{margin-top:calc((var(--ez-actions-button__actions-list--top-margin) + 3px) * -1)}.ez-actions-button__arrow:only-child{display:none}.ez-actions-button__btn-transparent{--ez-button--background-color:transparent;--ez-button--hover--background-color:transparent;--ez-button--active--background-color:transparent;--ez-button--focus--border:none}.ez-actions-button__btn-label{--ez-button--padding-left:var(--space--medium, 12px);--ez-button--padding-right:var(--space--medium, 12px)}.ez-actions-button__list-container{position:relative}";export{c as ez_actions_button}