mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
config redirect
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
export declare function isDisabledReactIssue7711(element: Element): boolean;
|
||||
+1
@@ -0,0 +1 @@
|
||||
function r(n){let e=n.parentElement,l=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(l=e),e=e.parentElement;let t=(e==null?void 0:e.getAttribute("disabled"))==="";return t&&i(l)?!1:t}function i(n){if(!n)return!1;let e=n.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}export{r as isDisabledReactIssue7711};
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
export declare enum Focus {
|
||||
/** Focus the first non-disabled item. */
|
||||
First = 0,
|
||||
/** Focus the previous non-disabled item. */
|
||||
Previous = 1,
|
||||
/** Focus the next non-disabled item. */
|
||||
Next = 2,
|
||||
/** Focus the last non-disabled item. */
|
||||
Last = 3,
|
||||
/** Focus a specific item based on the `id` of the item. */
|
||||
Specific = 4,
|
||||
/** Focus no items at all. */
|
||||
Nothing = 5
|
||||
}
|
||||
export declare function calculateActiveIndex<TItem>(action: {
|
||||
focus: Focus.Specific;
|
||||
id: string;
|
||||
} | {
|
||||
focus: Exclude<Focus, Focus.Specific>;
|
||||
}, resolvers: {
|
||||
resolveItems(): TItem[];
|
||||
resolveActiveIndex(): number | null;
|
||||
resolveId(item: TItem): string;
|
||||
resolveDisabled(item: TItem): boolean;
|
||||
}): number | null;
|
||||
+1
@@ -0,0 +1 @@
|
||||
function f(r){throw new Error("Unexpected object: "+r)}var a=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(a||{});function x(r,n){let t=n.resolveItems();if(t.length<=0)return null;let l=n.resolveActiveIndex(),s=l!=null?l:-1,d=(()=>{switch(r.focus){case 0:return t.findIndex(e=>!n.resolveDisabled(e));case 1:{let e=t.slice().reverse().findIndex((i,c,u)=>s!==-1&&u.length-c-1>=s?!1:!n.resolveDisabled(i));return e===-1?e:t.length-1-e}case 2:return t.findIndex((e,i)=>i<=s?!1:!n.resolveDisabled(e));case 3:{let e=t.slice().reverse().findIndex(i=>!n.resolveDisabled(i));return e===-1?e:t.length-1-e}case 4:return t.findIndex(e=>n.resolveId(e)===r.id);case 5:return null;default:f(r)}})();return d===-1?l:d}export{a as Focus,x as calculateActiveIndex};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function classNames(...classes: (false | null | undefined | string)[]): string;
|
||||
+1
@@ -0,0 +1 @@
|
||||
function e(...n){return n.filter(Boolean).join(" ")}export{e as classNames};
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
export declare function disposables(): {
|
||||
enqueue(fn: Function): void;
|
||||
addEventListener<TEventName extends keyof WindowEventMap>(element: HTMLElement | Window | Document, name: TEventName, listener: (event: WindowEventMap[TEventName]) => any, options?: boolean | AddEventListenerOptions | undefined): () => void;
|
||||
requestAnimationFrame(callback: FrameRequestCallback): () => void;
|
||||
nextFrame(callback: FrameRequestCallback): () => void;
|
||||
setTimeout(callback: (...args: any[]) => void, ms?: number | undefined, ...args: any[]): () => void;
|
||||
microTask(cb: () => void): () => void;
|
||||
add(cb: () => void): () => void;
|
||||
dispose(): void;
|
||||
workQueue(): Promise<void>;
|
||||
};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{microTask as s}from'./micro-task.js';function m(){let n=[],i=[],r={enqueue(e){i.push(e)},addEventListener(e,t,a,o){return e.addEventListener(t,a,o),r.add(()=>e.removeEventListener(t,a,o))},requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return r.add(()=>cancelAnimationFrame(t))},nextFrame(...e){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...e))},setTimeout(...e){let t=setTimeout(...e);return r.add(()=>clearTimeout(t))},microTask(...e){let t={current:!0};return s(()=>{t.current&&e[0]()}),r.add(()=>{t.current=!1})},add(e){return n.push(e),()=>{let t=n.indexOf(e);if(t>=0){let[a]=n.splice(t,1);a()}}},dispose(){for(let e of n.splice(0))e()},async workQueue(){for(let e of i.splice(0))await e()}};return r}export{m as disposables};
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
export declare enum Focus {
|
||||
/** Focus the first non-disabled element */
|
||||
First = 1,
|
||||
/** Focus the previous non-disabled element */
|
||||
Previous = 2,
|
||||
/** Focus the next non-disabled element */
|
||||
Next = 4,
|
||||
/** Focus the last non-disabled element */
|
||||
Last = 8,
|
||||
/** Wrap tab around */
|
||||
WrapAround = 16,
|
||||
/** Prevent scrolling the focusable elements into view */
|
||||
NoScroll = 32
|
||||
}
|
||||
export declare enum FocusResult {
|
||||
/** Something went wrong while trying to focus. */
|
||||
Error = 0,
|
||||
/** When `Focus.WrapAround` is enabled, going from position `N` to `N+1` where `N` is the last index in the array, then we overflow. */
|
||||
Overflow = 1,
|
||||
/** Focus was successful. */
|
||||
Success = 2,
|
||||
/** When `Focus.WrapAround` is enabled, going from position `N` to `N-1` where `N` is the first index in the array, then we underflow. */
|
||||
Underflow = 3
|
||||
}
|
||||
export declare function getFocusableElements(container?: HTMLElement | null): HTMLElement[];
|
||||
export declare enum FocusableMode {
|
||||
/** The element itself must be focusable. */
|
||||
Strict = 0,
|
||||
/** The element should be inside of a focusable element. */
|
||||
Loose = 1
|
||||
}
|
||||
export declare function isFocusableElement(element: HTMLElement, mode?: FocusableMode): boolean;
|
||||
export declare function restoreFocusIfNecessary(element: HTMLElement | null): void;
|
||||
export declare function focusElement(element: HTMLElement | null): void;
|
||||
export declare function sortByDomNode<T>(nodes: T[], resolveKey?: (item: T) => HTMLElement | null): T[];
|
||||
export declare function focusFrom(current: HTMLElement | null, focus: Focus): FocusResult;
|
||||
export declare function focusIn(container: HTMLElement | HTMLElement[], focus: Focus, { sorted, relativeTo, skipElements, }?: Partial<{
|
||||
sorted: boolean;
|
||||
relativeTo: HTMLElement | null;
|
||||
skipElements: HTMLElement[];
|
||||
}>): FocusResult;
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{disposables as b}from'./disposables.js';import{match as M}from'./match.js';import{getOwnerDocument as m}from'./owner.js';let f=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var L=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n))(L||{}),N=(o=>(o[o.Error=0]="Error",o[o.Overflow=1]="Overflow",o[o.Success=2]="Success",o[o.Underflow=3]="Underflow",o))(N||{}),T=(r=>(r[r.Previous=-1]="Previous",r[r.Next=1]="Next",r))(T||{});function E(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(f)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var F=(r=>(r[r.Strict=0]="Strict",r[r.Loose=1]="Loose",r))(F||{});function h(e,t=0){var r;return e===((r=m(e))==null?void 0:r.body)?!1:M(t,{[0](){return e.matches(f)},[1](){let l=e;for(;l!==null;){if(l.matches(f))return!0;l=l.parentElement}return!1}})}function v(e){let t=m(e);b().nextFrame(()=>{t&&!h(t.activeElement,0)&&S(e)})}function S(e){e==null||e.focus({preventScroll:!0})}let H=["textarea","input"].join(",");function w(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,H))!=null?r:!1}function A(e,t=r=>r){return e.slice().sort((r,l)=>{let o=t(r),i=t(l);if(o===null||i===null)return 0;let n=o.compareDocumentPosition(i);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function g(e,t){return I(E(),t,{relativeTo:e})}function I(e,t,{sorted:r=!0,relativeTo:l=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,n=Array.isArray(e)?r?A(e):e:E(e);o.length>0&&(n=n.filter(s=>!o.includes(s))),l=l!=null?l:i.activeElement;let d=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),x=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,n.indexOf(l))-1;if(t&4)return Math.max(0,n.indexOf(l))+1;if(t&8)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),p=t&32?{preventScroll:!0}:{},c=0,a=n.length,u;do{if(c>=a||c+a<=0)return 0;let s=x+c;if(t&16)s=(s+a)%a;else{if(s<0)return 3;if(s>=a)return 1}u=n[s],u==null||u.focus(p),c+=d}while(u!==i.activeElement);return t&6&&w(u)&&u.select(),u.hasAttribute("tabindex")||u.setAttribute("tabindex","0"),2}export{L as Focus,N as FocusResult,F as FocusableMode,S as focusElement,g as focusFrom,I as focusIn,E as getFocusableElements,h as isFocusableElement,v as restoreFocusIfNecessary,A as sortByDomNode};
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
declare type Entries = [string, string][];
|
||||
export declare function objectToFormEntries(source?: Record<string, any>, parentKey?: string | null, entries?: Entries): Entries;
|
||||
export declare function attemptSubmit(element: HTMLElement): void;
|
||||
export {};
|
||||
+1
@@ -0,0 +1 @@
|
||||
function e(n={},r=null,t=[]){for(let[i,o]of Object.entries(n))f(t,s(r,i),o);return t}function s(n,r){return n?n+"["+r+"]":r}function f(n,r,t){if(Array.isArray(t))for(let[i,o]of t.entries())f(n,s(r,i.toString()),o);else t instanceof Date?n.push([r,t.toISOString()]):typeof t=="boolean"?n.push([r,t?"1":"0"]):typeof t=="string"?n.push([r,t]):typeof t=="number"?n.push([r,`${t}`]):t==null?n.push([r,""]):e(t,r,n)}function p(n){var t;let r=(t=n==null?void 0:n.form)!=null?t:n.closest("form");if(!!r){for(let i of r.elements)if(i.tagName==="INPUT"&&i.type==="submit"||i.tagName==="BUTTON"&&i.type==="submit"||i.nodeName==="INPUT"&&i.type==="image"){i.click();return}}}export{p as attemptSubmit,e as objectToFormEntries};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function match<TValue extends string | number = string, TReturnValue = unknown>(value: TValue, lookup: Record<TValue, TReturnValue | ((...args: any[]) => TReturnValue)>, ...args: any[]): TReturnValue;
|
||||
+1
@@ -0,0 +1 @@
|
||||
function u(r,n,...a){if(r in n){let e=n[r];return typeof e=="function"?e(...a):e}let t=new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,u),t}export{u as match};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function microTask(cb: () => void): void;
|
||||
+1
@@ -0,0 +1 @@
|
||||
function t(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(o=>setTimeout(()=>{throw o}))}export{t as microTask};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function once<T>(cb: (...args: T[]) => void): (...args: T[]) => void;
|
||||
+1
@@ -0,0 +1 @@
|
||||
function l(r){let e={called:!1};return(...t)=>{if(!e.called)return e.called=!0,r(...t)}}export{l as once};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { MutableRefObject } from 'react';
|
||||
export declare function getOwnerDocument<T extends Element | MutableRefObject<Element | null>>(element: T | null | undefined): Document | null;
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{isServer as n}from'./ssr.js';function e(r){return n?null:r instanceof Node?r.ownerDocument:r!=null&&r.hasOwnProperty("current")&&r.current instanceof Node?r.current.ownerDocument:document}export{e as getOwnerDocument};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function isIOS(): boolean;
|
||||
+1
@@ -0,0 +1 @@
|
||||
function o(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}export{o as isIOS};
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
import { ElementType, ReactElement } from 'react';
|
||||
import { Props, XOR, __, Expand } from '../types.js';
|
||||
export declare enum Features {
|
||||
/** No features at all */
|
||||
None = 0,
|
||||
/**
|
||||
* When used, this will allow us to use one of the render strategies.
|
||||
*
|
||||
* **The render strategies are:**
|
||||
* - **Unmount** _(Will unmount the component.)_
|
||||
* - **Hidden** _(Will hide the component using the [hidden] attribute.)_
|
||||
*/
|
||||
RenderStrategy = 1,
|
||||
/**
|
||||
* When used, this will allow the user of our component to be in control. This can be used when
|
||||
* you want to transition based on some state.
|
||||
*/
|
||||
Static = 2
|
||||
}
|
||||
export declare enum RenderStrategy {
|
||||
Unmount = 0,
|
||||
Hidden = 1
|
||||
}
|
||||
declare type PropsForFeature<TPassedInFeatures extends Features, TForFeature extends Features, TProps> = {
|
||||
[P in TPassedInFeatures]: P extends TForFeature ? TProps : __;
|
||||
}[TPassedInFeatures];
|
||||
export declare type PropsForFeatures<T extends Features> = XOR<PropsForFeature<T, Features.Static, {
|
||||
static?: boolean;
|
||||
}>, PropsForFeature<T, Features.RenderStrategy, {
|
||||
unmount?: boolean;
|
||||
}>>;
|
||||
export declare function render<TFeature extends Features, TTag extends ElementType, TSlot>({ ourProps, theirProps, slot, defaultTag, features, visible, name, }: {
|
||||
ourProps: Expand<Props<TTag, TSlot, any> & PropsForFeatures<TFeature>>;
|
||||
theirProps: Expand<Props<TTag, TSlot, any>>;
|
||||
slot?: TSlot;
|
||||
defaultTag: ElementType;
|
||||
features?: TFeature;
|
||||
visible?: boolean;
|
||||
name: string;
|
||||
}): ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
||||
/**
|
||||
* This is a hack, but basically we want to keep the full 'API' of the component, but we do want to
|
||||
* wrap it in a forwardRef so that we _can_ passthrough the ref
|
||||
*/
|
||||
export declare function forwardRefWithAs<T extends {
|
||||
name: string;
|
||||
displayName?: string;
|
||||
}>(component: T): T & {
|
||||
displayName: string;
|
||||
};
|
||||
export declare function compact<T extends Record<any, any>>(object: T): {} & T;
|
||||
export {};
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import{Fragment as c,cloneElement as P,createElement as b,forwardRef as E,isValidElement as x}from"react";import{match as R}from'./match.js';var S=(a=>(a[a.None=0]="None",a[a.RenderStrategy=1]="RenderStrategy",a[a.Static=2]="Static",a))(S||{}),j=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(j||{});function $({ourProps:r,theirProps:t,slot:e,defaultTag:a,features:o,visible:n=!0,name:l}){let s=T(t,r);if(n)return p(s,e,a,l);let u=o!=null?o:0;if(u&2){let{static:i=!1,...d}=s;if(i)return p(d,e,a,l)}if(u&1){let{unmount:i=!0,...d}=s;return R(i?0:1,{[0](){return null},[1](){return p({...d,hidden:!0,style:{display:"none"}},e,a,l)}})}return p(s,e,a,l)}function p(r,t={},e,a){let{as:o=e,children:n,refName:l="ref",...s}=m(r,["unmount","static"]),u=r.ref!==void 0?{[l]:r.ref}:{},i=typeof n=="function"?n(t):n;s.className&&typeof s.className=="function"&&(s.className=s.className(t));let d={};if(t){let f=!1,y=[];for(let[h,g]of Object.entries(t))typeof g=="boolean"&&(f=!0),g===!0&&y.push(h);f&&(d["data-headlessui-state"]=y.join(" "))}if(o===c&&Object.keys(F(s)).length>0){if(!x(i)||Array.isArray(i)&&i.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${a} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(f=>` - ${f}`).join(`
|
||||
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(f=>` - ${f}`).join(`
|
||||
`)].join(`
|
||||
`));return P(i,Object.assign({},T(i.props,F(m(s,["ref"]))),d,u,w(i.ref,u.ref)))}return b(o,Object.assign({},m(s,["ref"]),o!==c&&u,o!==c&&d),i)}function w(...r){return{ref:r.every(t=>t==null)?void 0:t=>{for(let e of r)e!=null&&(typeof e=="function"?e(t):e.current=t)}}}function T(...r){var a;if(r.length===0)return{};if(r.length===1)return r[0];let t={},e={};for(let o of r)for(let n in o)n.startsWith("on")&&typeof o[n]=="function"?((a=e[n])!=null||(e[n]=[]),e[n].push(o[n])):t[n]=o[n];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(e).map(o=>[o,void 0])));for(let o in e)Object.assign(t,{[o](n,...l){let s=e[o];for(let u of s){if((n instanceof Event||(n==null?void 0:n.nativeEvent)instanceof Event)&&n.defaultPrevented)return;u(n,...l)}}});return t}function C(r){var t;return Object.assign(E(r),{displayName:(t=r.displayName)!=null?t:r.name})}function F(r){let t=Object.assign({},r);for(let e in t)t[e]===void 0&&delete t[e];return t}function m(r,t=[]){let e=Object.assign({},r);for(let a of t)a in e&&delete e[a];return e}export{S as Features,j as RenderStrategy,F as compact,C as forwardRefWithAs,$ as render};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare const isServer: boolean;
|
||||
+1
@@ -0,0 +1 @@
|
||||
const e=typeof window=="undefined"||typeof document=="undefined";export{e as isServer};
|
||||
Reference in New Issue
Block a user