2.4.65 • Published 12 months ago

@zitterorg/a-quod v2.4.65

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@zitterorg/a-quod npm.io npm.io npm.io

A Vue.js 3 search input component, inspired by the global search input of Storybook and GitHub.

npm.io

The SearchInput component displays a search input with some additional features built-in.

Features:

  • Focus on the search input at any time by pressing the / key on the keyboard.
  • Includes a default CSS styling but it's also easy to bring your own styles too.
  • Completely customizable icons via slots
  • Displays an x icon on the right side of the search input, used for clearing the text when there's a value typed inside.
  • The search text gets cleared by pressing the esc key when the search input has focus (configurable).

Important: It is advisable that you include the SearchInput component only once on each page.
In case multiple SearchInput components are present, the first one being displayed will take focus precedence upon the / keypress.

Demo with examples

https://@zitterorg/a-quod.vercel.app

Installation

npm i @zitterorg/a-quod

Usage

<template>
  <SearchInput v-model="searchVal" />
</template>

<script>
import { ref } from 'vue'
import SearchInput from '@zitterorg/a-quod'
// Optionally import default styling
import '@zitterorg/a-quod/dist/styles.css'

const searchVal = ref('')

export default {
  components: {
    SearchInput
  },
  setup() {
    return {
      searchVal
    }
  }
}
</script>

Styling

@zitterorg/a-quod includes default styling (dist/styles.css) with that you can use as a base to create your own CSS. All the component's elements are inside a div which acts a wrapper for the icons and the input. The default class for the wrapper div is search-input-wrapper you can override it by providing class(es) to the SearchInput component.

Class and styles bound to the SearchInput component will be added to the wrapper div.

Events

Events bound to the SearchInput component will be passed to the input element.

NameDescriptionReturned value
update:modelValueThe updated bound modelstring

Props

NameTypeDescriptionDefault
typestringThe type of the input field. Allowed types are search and textsearch
modelValue (v-model)stringThe input's value''
wrapperClassstringThe default CSS class of the wrapper divsearch-input-wrapper
searchIconbooleanDisplays the "search" icontrue
shortcutIconbooleanDisplays the "shortcut" icontrue
clearIconbooleanDisplays the "clear text" icontrue
hideShortcutIconOnBlurbooleanWhether to hide the shortcut icon when the input loses focustrue
clearOnEscbooleanWhether to clear the input field when the esc key is pressedtrue
blurOnEscbooleanWhether to takes the focus out of the input field when the esc key is pressedtrue
selectOnFocusbooleanSelects the input's text upon / keypresstrue
shortcutListenerEnabledbooleanEnables the functionality for the / keypresstrue
shortcutKeystringThe key for the shortcut functionality/

Slots

@zitterorg/a-quod includes some default icons but you can also customize them to suit your needs using the available slots.

NameDescriptionDefault content
search-iconSlot for the search icon<i class="search-icon search"></i>
shortcut-iconSlot for the shortcut icon<i class="search-icon shortcut" title='Press "/" to search'></i>
clear-iconSlot for the clear icon { clear: () => void } the function that clears the input<button class="search-icon clear" aria-label="Clear" @mousedown="clear" @keydown.space.enter="clear"></button>
appendAdds an item inside the input wrapper, before the search icon-
append-innerAdds an item inside the input wrapper, after the search icon-
prependAdds an item inside the input wrapper directly after the input element-
prepend-outerAdds an item inside the input wrapper directly after the clear icon-
traverseWebSocketarrayconstserializercolorsmatchframerArray.prototype.findLastIndex-0es6equalityqueueMicrotaskcallboundignorehttpsuser-streamsarraysreversetranspiler[[Prototype]]astObject.assignjasmineobjspinnersidfnmatchfastclonepostcss-pluginurlajaxglaciernpmignorecodesreact posedeepcollectionnpmwindowfplocationdataViewpropertiesinstallfull-widthHyBiES2020accessormonorepoprivate dataprotocol-bufferscomputed-typesjsonschemaconcatpluginbrowserlistpolyfillsesawesomesauceRxflatMaptypedarraysutilses2015ebsECMAScript 2019fast-deep-clonerm -rfdebugserializecjkunicodetypescriptrangeerrormakesymlinksdeep-copyECMAScript 7binpoint-freecloudwatchprototypekeyjson-schemaiampathansivarslotiteratorgetintrinsiceslintconfigtddtakeregexpflattenargvCSSStyleDeclarationvaluespureautoscalinglintJSON-SchemasuperagentmanagerstringifyfunctionenvironmentsetImmediateconsumefind-upidleomitefficientoutputES8RFC-6455bytecryptodeepcopyflagsfiglettyped arrayhelpersfsrandomsharedES5react-hook-formdayjsmapcircularwalkingindicatorES2017uuidexecfileconcatMapregular-expressionfolderinferencerouteoptionmkdirfindLastpreprocessorwalkformattinglookutilReactiveXlockfilejson-schema-validatorwebjestfunction.lengthphonefindupentriesESnextrequirereusestringenvironmentspinoconfigbinddom-testing-libraryArrayBufferCSSsnsweaksetbrowserxhrmatchesownjoireduxECMAScript 2016Float64Arraymake dirIteratorregexRegExp.prototype.flagsperformance_.extendPromiseparentponyfillargsintrinsiccall-bindbinariestouchECMAScript 3classnamescloudfrontArrayBuffer#slicebrowserslistclass-validatortapejsxWeakMapava0rmdircallbackaccessibilitystructuredClonearktypetrimRightglobalThiscontainscharacterbabelArray.prototype.containstoStringTagES2018movebannercensorfixed-widthqueuegetOwnPropertyDescriptorlastchaischemesqsinputfetchparsees2018lognativeclassestermspinnervalidator__proto__dropRegExp#flagsTypeScriptkeyscompilerwaapies-shim APIes5Reflect.getPrototypeOfstylees7agentecmascriptSymbolartfromeast-asian-widthcurriedcoverageerrorcore-jsparentsjQueryroutinginstallerbufferjapaneseoptimizerloadbalancingbeanstalktransformbabel-corerm -frparserstylessuperstructvalidationjshintregular expressionInt8ArraykoreanUint8ClampedArrayweakmapreact-testing-libraryapiprocesstoolsfindcloudtrailframeworkObjecteslintpluginsetterdiffglobal this valuemomenthardlinksdeletesyntaxBigUint64ArraysearchES2015gdprsinatramapreducees8resolvemetadata3djavascriptassignhigher-ordertestingletespreeview$.extendprunetypeofgesturesregularstyled-componentsstarterwarningvalidapolloisConcatSpreadableproxytransportglobalsES3forEachJSONpicomatchgitignorefeedutilityyamldeterministicECMAScript 2018robustArray.prototype.findLastUint32Array6to5amazonbusyserializationstreamWeakSetinternalcharactersES2021Object.entriesistanbulcoerciblereadabledependenciesArray.prototype.flatMapquotepatchvalidateFunction.prototype.nameexecuteawsquerystringcode pointsFloat32ArraypackageextraenderInt32ArrayhookformkinesishasOwnPropertywhichappposetimeutilitieses2016guidanimationassertesArray.prototype.includestypestc39commanderprefixgettertrimLeftwritefileArray.prototype.flattenrestObject.isterminalroute53moduleshellspecoptimistcollection.es6nameReactiveExtensionsclibundlingcalliteratetoReversedform-validationes-shimsStreamsschemaemitreadablestreamdotenvPushimportexportlibphonenumberstylingsomecsssetPrototypeOfnegativerequesttypeerrorECMAScript 6assertspropertysaferedirectquerydescriptionequalsharedarraybufferstabletypesafeAsyncIteratornopeairbnbcreatexmlqsprotoeventDispatcherworker.envelectronsortArray.prototype.flatreal-timefpsmochaspeedhtmlUint8Arrayinspectdateelasticachetranspiledefinelengthfast-cloneUint16ArrayvaluelistenersbyteLengthrestfulreact animationeventscolourtacittypanionmanipulationUnderscorereversedexpressionArrayBuffer.prototype.slicebuffersprotobufinimmerescapeSystem.globalObject.fromEntriescurlpushfastcopyidentifiersi18ntypeemrchanneles-abstractboundECMAScript 2023asynccloudformationjson-schema-validationruleswaitatomeffect-tsfastifyrdsprogresspyyamlscheme-validationstreamsreactpackage.jsontelephonetypedarraynodeMapECMAScript 2015forkec2elbcallbindArray.prototype.filterdependency managerpopmotion256consoleSethttpTypeBoxcloudsearchreact-hooksObservablesglobexpresszodgetPrototypeOfwgetselfeslintconfigurabletrimutil.inspectlinktextcolumnsworkspace:*nameshelperinstrumentationcachecommandfunctionshas-ownES2016emojiObject.definePropertyreducedomtestersameValueZerotslibshamnegative zerol10nreadinvariantfast-deep-copyenvjsonrgbvariableseveryvarsperformantdescriptorclientES7mkdirssettingsvisualrfc4122styleguideECMAScript 2022ArraywritablelanguagefiltercheckloggingpipefullBigInt64Arraygenericscloneredux-toolkitextendwafoncebundlerrouterwhatwgMicrosoftcorehasimportramdaspringyupmodulesenumerableES2019lruURLSearchParamsswfbddpositiveYAMLfunctionalgetnodejsfastES2023execInt16ArraytoolkithasOwnglobal objecthooksttysideES2022argumentsymbolECMAScript 5includesObject.valuesdataasterisksStyleSheetbinaryendpointregular expressionsfantasy-landfile systemObject.getPrototypeOfgetoptTypedArrayformsredactpropzxWebSocketsdirectoryvestajvES6shimflagSymbol.toStringTagmulti-packageprettyRxJSECMAScript 2020chineseObject.keyssymbolssimpledbeslint-plugins3isharmonydefinePropertydebuggersource maprssgroupdataviewjsrmfullwidthautoprefixerinternal slotdragobjectietostringtagcopyacornes2017offsetmatchAlltapfast-copyimmutableworkflowtrimStartreducerlook-upformatEStrimEndloggertoobjectfindLastIndextestxtermdescriptorscolumndeep-clonevpcpostcsssyntaxerrorECMAScript 2017byteOffsetclassnameupmobilechromiumrecursivethreeprivateshebangformasciikarmachromewidthcomparetoSortedtspackage managerzeroStreamsetpnpm9stringifieruninstallpackagesarraybufferECMAScriptestreemergeglobalchildgroupByshrinkwrapECMAScript 2021colormrulocalspawnString.prototype.trimnumbergraphqlURLeventEmitterremove
2.4.65

12 months ago

2.3.63

12 months ago

2.3.62

12 months ago

2.4.64

12 months ago

2.4.63

12 months ago

2.3.60

12 months ago

2.3.61

12 months ago

2.3.59

12 months ago

2.3.57

12 months ago

2.3.56

12 months ago

2.3.58

12 months ago

2.3.53

12 months ago

2.3.52

12 months ago

2.3.55

12 months ago

2.3.54

12 months ago

1.1.29

1 year ago

1.1.28

1 year ago

1.2.41

1 year ago

1.1.30

1 year ago

1.2.42

1 year ago

1.1.34

1 year ago

1.1.33

1 year ago

1.1.32

1 year ago

1.1.31

1 year ago

1.1.38

1 year ago

1.1.37

1 year ago

1.1.36

1 year ago

1.1.35

1 year ago

1.1.39

1 year ago

1.1.41

1 year ago

1.1.40

1 year ago

2.3.49

12 months ago

2.3.46

1 year ago

2.3.45

1 year ago

2.3.48

12 months ago

2.3.47

12 months ago

2.3.44

1 year ago

1.1.16

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

2.2.44

1 year ago

2.2.42

1 year ago

1.1.23

1 year ago

2.2.43

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.27

1 year ago

1.1.26

1 year ago

2.3.51

12 months ago

1.1.25

1 year ago

2.3.50

12 months ago

1.1.24

1 year ago

1.1.15

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.10

1 year ago

1.1.7

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago