diff --git a/api/js/etemplate/Et2Date/Et2Date.ts b/api/js/etemplate/Et2Date/Et2Date.ts index f51c8cb5ea..754348ee3e 100644 --- a/api/js/etemplate/Et2Date/Et2Date.ts +++ b/api/js/etemplate/Et2Date/Et2Date.ts @@ -129,8 +129,16 @@ export class Et2Date extends Et2InputWidget(LionInputDatepicker) return [ ...super.styles, css` - /* Custom CSS */ - `, + :host([focused]) ::slotted(button), :host(:hover) ::slotted(button) { + display: inline-block; + } + ::slotted(.calendar_button) { + border: none; + background: transparent; + margin-left: -20px; + display: none; + } + `, ]; } @@ -182,6 +190,51 @@ export class Et2Date extends Et2InputWidget(LionInputDatepicker) return this.modelValue.toJSON(); } + get _overlayReferenceNode() + { + return this.getInputNode(); + } + + /** + * @override Configures OverlayMixin + * @desc overrides default configuration options for this component + * @returns {Object} + */ + _defineOverlayConfig() + { + this.hasArrow = false; + if(window.innerWidth >= 600) + { + return { + hidesOnOutsideClick: true, + placementMode: 'local', + popperConfig: { + placement: 'bottom-end', + }, + }; + } + return super.withBottomSheetConfig(); + } + + /** + * Overriding parent to add class to button, and use an image instead of unicode emoji + */ + // eslint-disable-next-line class-methods-use-this + _invokerTemplate() + { + return html` + + `; + } } // @ts-ignore TypeScript is not recognizing that Et2Date is a LitElement