@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-72698.1 → 0.0.0-bugfix-dev-KB-72892.1
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.
- package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +6 -29
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +0 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +2 -7
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +1 -11
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +3 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +0 -8
- package/dist/custom-elements/index.js +7 -30
- package/dist/esm/ez-custom-form-input_2.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +6 -29
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-10820c20.entry.js +1 -0
- package/dist/ezui/{p-d9545f64.entry.js → p-75669111.entry.js} +1 -1
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +0 -1
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +1 -2
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +0 -1
- package/package.json +1 -1
- package/dist/ezui/p-e26f12dd.entry.js +0 -1
|
@@ -12,7 +12,6 @@ export default class DataSource implements IServerSideDatasource {
|
|
|
12
12
|
private duObserver;
|
|
13
13
|
private handleSavingCanceled;
|
|
14
14
|
private handleDataChanged;
|
|
15
|
-
private createRecordIdList;
|
|
16
15
|
/**
|
|
17
16
|
* Nesse ponto, o registro já se encontra atualizado no DU,
|
|
18
17
|
* basta então passar seu valor para que a garde possa atualizar sua linha.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Action, DataUnit
|
|
1
|
+
import { Action, DataUnit } from "@sankhyalabs/core";
|
|
2
2
|
import { CellPosition, ColDef, GridApi, GridOptions } from "ag-grid-community";
|
|
3
3
|
import { IRecordValidator } from "../../../../utils/form/interfaces";
|
|
4
4
|
import { ICustomEditorInfo } from "../../../../utils/customEditor/interfaces/ICustomEditorInfo";
|
|
@@ -20,7 +20,6 @@ export default class GridEditionManager {
|
|
|
20
20
|
private _invalidCell;
|
|
21
21
|
constructor(dataUnit: DataUnit, useEnterLikeTab: boolean, recordsValidator: IRecordValidator, editionIsDisabled: () => boolean, customEditors?: Map<string, ICustomEditorInfo>, customRenders?: Map<string, ICustomRenderInfo>, enableContinuousInsert?: boolean);
|
|
22
22
|
configureGrid(options: GridOptions): GridOptions;
|
|
23
|
-
updateCurrentEditorGuiValue(updatedRowValue: Record): void;
|
|
24
23
|
private canContinuousInsert;
|
|
25
24
|
proceedAutoSave(): void;
|
|
26
25
|
recordValidate(): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,H as s,c as e,g as o}from"./p-23a36bb6.js";import{C as n}from"./p-4607fb89.js";import{ObjectUtils as l,HTMLBuilder as h,StringUtils as a,ElementIDUtils as d}from"@sankhyalabs/core";import{A as r}from"./p-2187f86c.js";import"./p-ab574d59.js";import"./p-b853763b.js";const c=class{constructor(i){t(this,i),this.gui=void 0,this.customEditor=void 0,this.formViewField=void 0,this.value=void 0,this.detailContext=void 0,this.builderFallback=void 0,this.selectedRecord=void 0}async setFocus(){var t,i;null===(i=null===(t=this.gui)||void 0===t?void 0:t.setFocus)||void 0===i||i.call(t)}async setBlur(){var t,i;null===(i=null===(t=this.gui)||void 0===t?void 0:t.setBlur)||void 0===i||i.call(t)}async isInvalid(){var t,i;return(null===(i=null===(t=this.gui)||void 0===t?void 0:t.isInvalid)||void 0===i?void 0:i.call(t))||!1}watchValue(){this.handleValue(this.gui)}watchCustomEditor(){this.getContent()}watchFormViewField(t,i){l.equals(t,i)||this.getContent()}watchDetailContext(){this.getContent()}watchBuilderFallback(){this.getContent()}watchSelectedRecord(t,i){t.__record__id__!==i.__record__id__&&this.getContent()}getContent(){var t,s;const e=new Map;for(const t in this.formViewField.props)e.set(t,this.formViewField.props[t]);const o={value:this.value,name:this.formViewField.name,currentEditor:this.builderFallback(this.formViewField),setValue:t=>this.setValue(t),getValue:this.getValue,record:this.selectedRecord,editorMetadata:{label:this.formViewField.label,hidden:!1===(null===(t=this.formViewField.props)||void 0===t?void 0:t.visible),userInterface:this.formViewField.userInterface,options:null===(s=this.formViewField.props)||void 0===s?void 0:s.options,props:this.formViewField.props?e:void 0,optionLoader:this.formViewField.optionLoader},source:n.FORM,detailContext:this.detailContext};let l=this.customEditor.getEditorElement(o);return l?l instanceof HTMLElement||"string"==typeof l?("string"==typeof l&&(l=h.parseElement(l)),l.setAttribute("value",this.value),void(this.gui=i("div",{key:a.generateUUID(),ref:t=>t&&t.appendChild(l)}))):(this.handleValue(l),void(this.gui=l)):(l=this.builderFallback(this.formViewField),this.handleValue(l),void(this.gui=l))}setValue(t){this.value=t}getValue(){return this.value}handleValue(t){var i;null===(i=t.t)||void 0===i||i.forEach((t=>{t.i.value=this.value}))}componentWillLoad(){this.getContent()}render(){return i(s,null,this.gui)}static get watchers(){return{value:["watchValue"],customEditor:["watchCustomEditor"],formViewField:["watchFormViewField"],detailContext:["watchDetailContext"],builderFallback:["watchBuilderFallback"],selectedRecord:["watchSelectedRecord"]}}},u=class{constructor(i){t(this,i),this.saveEdition=e(this,"saveEdition",7),this.cancelEdition=e(this,"cancelEdition",7),this._newValue=void 0,this.value=void 0,this.styled=void 0}async applyFocusSelect(){this.calcSizeInput(this.value,!0)}calcSizeInput(t,i=!1){var s,e;const o=null===(e=null===(s=this._inputElement)||void 0===s?void 0:s.shadowRoot)||void 0===e?void 0:e.querySelector("input");if(null!=o){const s=this.getWidthValue(t);o.style.width=s+"px",i&&setTimeout((()=>o.select()),100)}}getWidthValue(t){if(null!=this._valueBasis){const i=this._valueBasis;if(null!=t){const s=2;return i.innerHTML=t,i.clientWidth>0?i.clientWidth+s:s}i.innerHTML=""}return 0}setStyledInput(){var t,i;let s="",e="",o="";null!=this.styled&&(s=this.styled.fontSize,e=this.styled.fontWeight,o=this.styled.fontFamily);const n=null===(i=null===(t=this._inputElement)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("input");null!=n&&(n.style.fontSize=s,n.style.fontWeight=e,n.style.fontFamily=o);const l=this._valueBasis;null!=l&&(l.style.fontSize=s,l.style.fontWeight=e,l.style.fontFamily=o)}handleSaveEdition(){this._newValue?this.saveEdition.emit({value:this.value,newValue:this._newValue}):r.alert("Aviso","Não é possível salvar um campo em branco.").then((()=>{this.setNewValue(this.value,!0)}))}handleCancelEdition(){this.cancelEdition.emit()}setNewValue(t,i=!1){this._newValue=t,this.calcSizeInput(this._newValue,i)}componentDidLoad(){this.applyFocusSelect(),this.setNewValue(this.value)}componentDidRender(){this.setStyledInput()}render(){return d.addIDInfoIfNotExists(this._element,"input"),i(s,null,i("span",{class:"text-edit__hidden-value",ref:t=>this._valueBasis=t}),i("ez-text-input",{"data-element-id":d.getInternalIDInfo("textInput"),onInput:()=>{this.calcSizeInput(this._newValue)},class:"text-edit__form-input",value:this._newValue,ref:t=>this._inputElement=t,mode:"slim",onEzChange:t=>this.setNewValue(null==t?void 0:t.detail),noBorder:!0}),i("ez-button",{class:"text-edit__icon-check",mode:"icon",iconName:"check",size:"small",onClick:()=>{this.handleSaveEdition()}}),i("ez-button",{class:"text-edit__icon-close",mode:"icon",iconName:"close",size:"small",onClick:()=>{this.handleCancelEdition()}}))}get _element(){return o(this)}};u.style=":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";export{c as ez_custom_form_input,u as ez_text_edit}
|