npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@asdfgertyjhnpm/quo-sed-natus

v1.0.0

Published

Common Utils For React Component.

Downloads

2

Maintainers

baoh44843baoh44843

Keywords

ES2019lazyvarutilsflagtestingstringifierbrowsercheckcollection.es6ECMAScript 2021viewArray.prototype.filterxtermpackagenpmpluginhttpstimebootstrap cssTypeBoxArray.prototype.findLastfullFloat64Arraytyped arrayxdg-openObservableInt16Arrayjson-schemaWeakMapfast-deep-copygetreadablelockfiledotenvfast-copyeslinthigher-ordertypesArray.prototype.includestoolkitbuffersfindLastes2015BigInt64ArraytextmacosmruObject.fromEntriesbindlook-upgrouplibphonenumberrandomnativecoreruntimecolumnsduplexschemaloggerexecmimequoteoptimizerlogWebSocketsarktypestreams2byteconfigurableprotoqssortspeedenvfullwidthrmdirquerystringidlemonorepowordbreakstructuredClonefromttycall-bindutilitypropcommand-linesharedworkspace:*.envimmutablefastclonesanitizationmake dirassertespreprocessor-0windowslimitederror-handlingshebangES2020sigintstreamcolorsCSSwatchFilefindbabel-coremkdirsvaluesloadingframeworktc39ratelimitInt8ArraywatchstringifytslibdescriptorsremovelesscsssameValueZeroECMAScript 2023websiteirqSetfigletmergeinterruptsexpressvalides8protobufflagscoercibleeventDispatcherlruapiReflect.getPrototypeOfset3dasciiflattrimEndthreermtoArraywarningwhatwgeslintpluginartopenerglobcompilerjavascriptbabelfolderspawnES8ECMAScript 3eventEmitterCSSStyleDeclarationcore-jslengthlessidtoobjectgdprqueueintrinsicimportawesomesaucejwtsetPrototypeOfnegative zeroobjectexpressionsuperagentcommanderreal-timeUint16ArrayajaxconcatMapString.prototype.matchAllStyleSheetformUnderscoreredux-toolkitdeletejsArray.prototype.flatMapmime-dbPromisenegativeconstFunction.prototype.nameES2021ES2023uninstallECMAScript 7ECMAScript 2017domeslint-plugintranspilercallbindreducertermArrayastnested csssortedcode pointsbddargvnodeECMAScript 5codesYAMLSymbol.toStringTagES5bundlerUint8ClampedArraymkdirpoptimistwritegetPrototypeOfencryptionmobilecss lesstrimsidelaunchoptionargumentsgetintrinsicURLSearchParamstddsetterfseventsdateclassesinferencehookformhelperssanitize

Readme

@asdfgertyjhnpm/quo-sed-natus

Common Utils For React Component.

NPM version npm download build status Codecov bundle size dumi

Install

@asdfgertyjhnpm/quo-sed-natus

API

createChainedFunction

(...functions): Function

Create a function which will call all the functions with it's arguments from left to right.

import createChainedFunction from '@asdfgertyjhnpm/quo-sed-natus/lib/createChainedFunction';

deprecated

(prop: string, instead: string, component: string): void

Log an error message to warn developers that prop is deprecated.

import deprecated from '@asdfgertyjhnpm/quo-sed-natus/lib/deprecated';

getContainerRenderMixin

(config: Object): Object

To generate a mixin which will render specific component into specific container automatically.

import getContainerRenderMixin from '@asdfgertyjhnpm/quo-sed-natus/lib/getContainerRenderMixin';

Fields in config and their meanings.

| Field | Type | Description | Default | | ------------- | ---------------------------- | -------------------------------------------------------------------------- | ------- | | autoMount | boolean | Whether to render component into container automatically | true | | autoDestroy | boolean | Whether to remove container automatically while the component is unmounted | true | | isVisible | (instance): boolean | A function to get current visibility of the component | - | | isForceRender | (instance): boolean | A function to determine whether to render popup even it's not visible | - | | getComponent | (instance, extra): ReactNode | A function to get the component which will be rendered into container | - | | getContainer | (instance): HTMLElement | A function to get the container | |

Portal

Render children to the specific container;

import Portal from '@asdfgertyjhnpm/quo-sed-natus/lib/Portal';

Props:

| Prop | Type | Description | Default | | ------------ | --------------- | ------------------------------- | ------- | | children | ReactChildren | Content render to the container | - | | getContainer | (): HTMLElement | A function to get the container | - |

getScrollBarSize

(fresh?: boolean): number

Get the width of scrollbar.

import getScrollBarSize from '@asdfgertyjhnpm/quo-sed-natus/lib/getScrollBarSize';

guid

(): string

To generate a global unique id across current application.

import guid from '@asdfgertyjhnpm/quo-sed-natus/lib/guid';

pickAttrs

(props: Object): Object

Pick valid HTML attributes and events from props.

import pickAttrs from '@asdfgertyjhnpm/quo-sed-natus/lib/pickAttrs';

warn

(msg: string): void

A shallow wrapper of console.warn.

import warn from '@asdfgertyjhnpm/quo-sed-natus/lib/warn';

warning

(valid: boolean, msg: string): void

A shallow wrapper of warning, but only warning once for the same message.

import warning, { noteOnce } from '@asdfgertyjhnpm/quo-sed-natus/lib/warning';

warning(false, '[antd Component] test hello world');

// Low level note
noteOnce(false, '[antd Component] test hello world');

Children

A collection of functions to operate React elements' children.

Children/mapSelf

(children): children

Return a shallow copy of children.

import mapSelf from '@asdfgertyjhnpm/quo-sed-natus/lib/Children/mapSelf';

Children/toArray

(children: ReactNode[]): ReactNode[]

Convert children into an array.

import toArray from '@asdfgertyjhnpm/quo-sed-natus/lib/Children/toArray';

Dom

A collection of functions to operate DOM elements.

Dom/addEventlistener

(target: ReactNode, eventType: string, listener: Function): { remove: Function }

A shallow wrapper of add-dom-event-listener.

import addEventlistener from '@asdfgertyjhnpm/quo-sed-natus/lib/Dom/addEventlistener';

Dom/canUseDom

(): boolean

Check if DOM is available.

import canUseDom from '@asdfgertyjhnpm/quo-sed-natus/lib/Dom/canUseDom';

Dom/class

A collection of functions to operate DOM nodes' class name.

  • hasClass(node: HTMLElement, className: string): boolean
  • addClass(node: HTMLElement, className: string): void
  • removeClass(node: HTMLElement, className: string): void
import cssClass from '@asdfgertyjhnpm/quo-sed-natus/lib/Dom/class;

Dom/contains

(root: HTMLElement, node: HTMLElement): boolean

Check if node is equal to root or in the subtree of root.

import contains from '@asdfgertyjhnpm/quo-sed-natus/lib/Dom/contains';

Dom/css

A collection of functions to get or set css styles.

  • get(node: HTMLElement, name?: string): any
  • set(node: HTMLElement, name?: string, value: any) | set(node, object)
  • getOuterWidth(el: HTMLElement): number
  • getOuterHeight(el: HTMLElement): number
  • getDocSize(): { width: number, height: number }
  • getClientSize(): { width: number, height: number }
  • getScroll(): { scrollLeft: number, scrollTop: number }
  • getOffset(node: HTMLElement): { left: number, top: number }
import css from '@asdfgertyjhnpm/quo-sed-natus/lib/Dom/css';

Dom/focus

A collection of functions to operate focus status of DOM node.

  • saveLastFocusNode(): void
  • clearLastFocusNode(): void
  • backLastFocusNode(): void
  • getFocusNodeList(node: HTMLElement): HTMLElement[] get a list of focusable nodes from the subtree of node.
  • limitTabRange(node: HTMLElement, e: Event): void
import focus from '@asdfgertyjhnpm/quo-sed-natus/lib/Dom/focus';

Dom/support

{ animation: boolean | Object, transition: boolean | Object }

A flag to tell whether current environment supports animationend or transitionend.

import support from '@asdfgertyjhnpm/quo-sed-natus/lib/Dom/support';

KeyCode

Enum

Enum of KeyCode, please check the definition of it.

import KeyCode from '@asdfgertyjhnpm/quo-sed-natus/lib/KeyCode';

KeyCode.isTextModifyingKeyEvent

(e: Event): boolean

Whether text and modified key is entered at the same time.

KeyCode.isCharacterKey

(keyCode: KeyCode): boolean

Whether character is entered.

ScrollLocker

ScrollLocker<{lock: (options: {container: HTMLElement}) => void, unLock: () => void}>

improve shake when page scroll bar hidden.

ScrollLocker change body style, and add a class ant-scrolling-effect when called, so if you page look abnormal, please check this;

import ScrollLocker from '@asdfgertyjhnpm/quo-sed-natus/lib/Dom/scrollLocker';

const scrollLocker = new ScrollLocker();

// lock
scrollLocker.lock()

// unLock
scrollLocker.unLock()

License

MIT