@melt-ui/svelte
Advanced tools
Comparing version 0.39.5 to 0.40.0
import { useEscapeKeydown, usePopper } from '../../internal/actions/index.js'; | ||
import { FIRST_LAST_KEYS, addHighlight, addMeltEventListener, back, builder, createElHelpers, derivedVisible, effect, executeCallbacks, forward, generateId, getOptions, getPortalDestination, isBrowser, isElementDisabled, isHTMLElement, isHTMLInputElement, kbd, last, next, noop, omit, overridable, prev, removeHighlight, removeScroll, sleep, styleToString, toWritableStores, } from '../../internal/helpers/index.js'; | ||
import { debounceable } from '../../internal/helpers/store/debounceable.js'; | ||
import deepEqual from 'deep-equal'; | ||
import { dequal as deepEqual } from 'dequal'; | ||
import { onMount, tick } from 'svelte'; | ||
@@ -6,0 +6,0 @@ import { derived, get, readonly, writable } from 'svelte/store'; |
@@ -103,2 +103,3 @@ /// <reference types="svelte" /> | ||
defaultOpen: import("svelte/store").Writable<false>; | ||
typeahead: import("svelte/store").Writable<true>; | ||
}; | ||
@@ -179,3 +180,4 @@ }; | ||
forceVisible: import("svelte/store").Writable<boolean>; | ||
typeahead?: import("svelte/store").Writable<boolean | undefined> | undefined; | ||
}; | ||
}; |
@@ -122,2 +122,3 @@ /// <reference types="svelte" /> | ||
defaultOpen: import("svelte/store").Writable<false>; | ||
typeahead: import("svelte/store").Writable<true>; | ||
}; | ||
@@ -172,3 +173,4 @@ }; | ||
forceVisible: import("svelte/store").Writable<boolean>; | ||
typeahead: import("svelte/store").Writable<boolean>; | ||
}; | ||
}; |
@@ -17,2 +17,3 @@ import { overridable, toWritableStores } from '../../internal/helpers/index.js'; | ||
forceVisible: false, | ||
typeahead: true, | ||
}; | ||
@@ -19,0 +20,0 @@ export function createDropdownMenu(props) { |
@@ -53,2 +53,3 @@ /// <reference types="svelte" /> | ||
forceVisible: Writable<boolean>; | ||
typeahead: Writable<boolean>; | ||
}; | ||
@@ -124,2 +125,3 @@ createCheckboxItem: (props?: _CheckboxItemProps) => { | ||
defaultOpen: Writable<false>; | ||
typeahead: Writable<true>; | ||
}; | ||
@@ -126,0 +128,0 @@ }; |
@@ -26,6 +26,7 @@ import { createSeparator } from '../index.js'; | ||
defaultOpen: false, | ||
typeahead: true, | ||
}; | ||
export function createMenuBuilder(opts) { | ||
const { name, selector } = createElHelpers(opts.selector); | ||
const { preventScroll, arrowSize, positioning, closeOnEscape, closeOnOutsideClick, portal, forceVisible, } = opts.rootOptions; | ||
const { preventScroll, arrowSize, positioning, closeOnEscape, closeOnOutsideClick, portal, forceVisible, typeahead, } = opts.rootOptions; | ||
const rootOpen = opts.rootOpen; | ||
@@ -146,3 +147,3 @@ const rootActiveTrigger = opts.rootActiveTrigger; | ||
const isModifierKey = e.ctrlKey || e.altKey || e.metaKey; | ||
if (!isModifierKey && isCharacterKey) { | ||
if (!isModifierKey && isCharacterKey && get(typeahead) === true) { | ||
handleTypeaheadSearch(e.key, getMenuItems(menuEl)); | ||
@@ -608,3 +609,3 @@ } | ||
} | ||
if (!isModifierKey && isCharacterKey) { | ||
if (!isModifierKey && isCharacterKey && get(typeahead) === true) { | ||
// typeahead logic | ||
@@ -611,0 +612,0 @@ handleTypeaheadSearch(e.key, getMenuItems(menuEl)); |
@@ -84,2 +84,7 @@ import type { FloatingConfig } from '../../internal/actions/index.js'; | ||
forceVisible?: boolean; | ||
/** | ||
* Whether to use typeahead to automatically focus elements. | ||
* @default true | ||
*/ | ||
typeahead?: boolean; | ||
}; | ||
@@ -129,2 +134,3 @@ export type _CreateSubmenuProps = Pick<_CreateMenuProps, 'arrowSize' | 'positioning'> & { | ||
forceVisible: Writable<boolean>; | ||
typeahead: Writable<boolean>; | ||
}; | ||
@@ -131,0 +137,0 @@ disableTriggerRefocus?: boolean; |
@@ -135,2 +135,3 @@ /// <reference types="svelte" /> | ||
defaultOpen: import("svelte/store").Writable<false>; | ||
typeahead: import("svelte/store").Writable<true>; | ||
}; | ||
@@ -188,2 +189,3 @@ }; | ||
forceVisible: import("svelte/store").Writable<boolean>; | ||
typeahead?: import("svelte/store").Writable<boolean | undefined> | undefined; | ||
}; | ||
@@ -190,0 +192,0 @@ }; |
import { createLabel, createSeparator } from '../index.js'; | ||
import { usePopper, usePortal } from '../../internal/actions/index.js'; | ||
import { usePopper } from '../../internal/actions/index.js'; | ||
import { FIRST_LAST_KEYS, SELECTION_KEYS, addEventListener, addHighlight, addMeltEventListener, back, builder, createElHelpers, createTypeaheadSearch, derivedVisible, effect, executeCallbacks, forward, generateId, getFirstOption, getNextFocusable, getOptions, getPortalDestination, getPreviousFocusable, handleRovingFocus, isBrowser, isElementDisabled, isHTMLElement, kbd, last, next, noop, omit, overridable, prev, removeHighlight, removeScroll, sleep, styleToString, toWritableStores, toggle, } from '../../internal/helpers/index.js'; | ||
@@ -4,0 +4,0 @@ import { onMount, tick } from 'svelte'; |
@@ -661,3 +661,3 @@ import { builder, createElHelpers, effect, executeCallbacks, generateId, getElementByMeltId, isBrowser, isHTMLElement, kbd, omit, overridable, styleToString, toWritableStores, addMeltEventListener, } from '../../internal/helpers/index.js'; | ||
updateTag, | ||
removeTag | ||
removeTag, | ||
}, | ||
@@ -664,0 +664,0 @@ options, |
@@ -1,2 +0,2 @@ | ||
import deepEqual from 'deep-equal'; | ||
import { dequal as deepEqual } from 'dequal'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Returns the element some number before the given index. If the target index is out of bounds: |
{ | ||
"name": "@melt-ui/svelte", | ||
"version": "0.39.5", | ||
"version": "0.40.0", | ||
"license": "MIT", | ||
@@ -42,3 +42,3 @@ "exports": { | ||
"@floating-ui/dom": "^1.4.5", | ||
"deep-equal": "^2.2.2", | ||
"dequal": "^2.0.3", | ||
"focus-trap": "^7.5.2", | ||
@@ -72,3 +72,2 @@ "nanoid": "^4.0.2" | ||
"@testing-library/user-event": "^14.4.3", | ||
"@types/deep-equal": "^1.0.1", | ||
"@types/jest-axe": "^3.5.5", | ||
@@ -75,0 +74,0 @@ "@types/prettier": "^2.7.3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
592377
76
13709
+ Addeddequal@^2.0.3
+ Addeddequal@2.0.3(transitive)
- Removeddeep-equal@^2.2.2
- Removedarray-buffer-byte-length@1.0.2(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.8(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removeddeep-equal@2.2.3(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-get-iterator@1.1.3(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-intrinsic@1.2.6(transitive)
- Removedgopd@1.2.0(transitive)
- Removedhas-bigints@1.1.0(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinternal-slot@1.1.0(transitive)
- Removedis-arguments@1.2.0(transitive)
- Removedis-array-buffer@3.0.5(transitive)
- Removedis-bigint@1.1.0(transitive)
- Removedis-boolean-object@1.2.1(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-date-object@1.1.0(transitive)
- Removedis-map@2.0.3(transitive)
- Removedis-number-object@1.1.1(transitive)
- Removedis-regex@1.2.1(transitive)
- Removedis-set@2.0.3(transitive)
- Removedis-shared-array-buffer@1.0.4(transitive)
- Removedis-string@1.1.1(transitive)
- Removedis-symbol@1.1.1(transitive)
- Removedis-weakmap@2.0.2(transitive)
- Removedis-weakset@2.0.4(transitive)
- Removedisarray@2.0.5(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject-is@1.1.6(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.7(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedregexp.prototype.flags@1.5.3(transitive)
- Removedsafe-regex-test@1.1.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedstop-iteration-iterator@1.1.0(transitive)
- Removedwhich-boxed-primitive@1.1.1(transitive)
- Removedwhich-collection@1.0.2(transitive)
- Removedwhich-typed-array@1.1.18(transitive)