Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for Popover API #13113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/runtime-dom/src/jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
security?: string
unselectable?: 'on' | 'off'

popover?: '' | 'auto' | 'manual'

// Living Standard
/**
* Hints at the type of data that might be entered by the user while editing the element or its contents
Expand Down Expand Up @@ -382,6 +384,8 @@ export interface ButtonHTMLAttributes extends HTMLAttributes {
formnovalidate?: Booleanish
formtarget?: string
name?: string
popovertarget?: string
popovertargetaction?: 'hide' | 'show' | 'toggle'
type?: 'submit' | 'reset' | 'button'
value?: string | ReadonlyArray<string> | number
}
Expand All @@ -407,7 +411,6 @@ export interface DataHTMLAttributes extends HTMLAttributes {
export interface DetailsHTMLAttributes extends HTMLAttributes {
name?: string
open?: Booleanish
onToggle?: (payload: ToggleEvent) => void
}

export interface DelHTMLAttributes extends HTMLAttributes {
Expand All @@ -417,6 +420,7 @@ export interface DelHTMLAttributes extends HTMLAttributes {

export interface DialogHTMLAttributes extends HTMLAttributes {
open?: Booleanish
onCancel?: (payload: Event) => void
onClose?: (payload: Event) => void
}

Expand Down Expand Up @@ -549,6 +553,8 @@ export interface InputHTMLAttributes extends HTMLAttributes {
name?: string
pattern?: string
placeholder?: string
popovertarget?: string
popovertargetaction?: 'toggle' | 'show' | 'hide'
readonly?: Booleanish
required?: Booleanish
size?: Numberish
Expand Down Expand Up @@ -1382,6 +1388,10 @@ export interface Events {
// transition events
onTransitionend: TransitionEvent
onTransitionstart: TransitionEvent

// Toggle Events
onToggle?: ToggleEvent
onBeforetoggle?: ToggleEvent
}

type EventHandlers<E> = {
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/src/domAttrConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export const isKnownHtmlAttr: (key: string) => boolean = /*@__PURE__*/ makeMap(
`height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,` +
`ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
`manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
`open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
`open,optimum,pattern,ping,placeholder,popover,popovertarget,popovertargetaction,` +
`poster,preload,radiogroup,readonly,` +
`referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
`selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
`start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
Expand Down