Parse or format dates
This is a modified version from underscore. https://github.com/jashkenas/underscore/blob/master/underscore.js
With some difference:
getDocumentClientSize
inlined Object.is polyfill to avoid requiring consumers ship their own https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
Support style names that may come passed in prefixed by adding permutations of vendor prefixes.
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
Old Select
implementation is a disaster,
temporary dirty code.
Highlights all occurrences of search terms (searchText) within a string (textToHighlight). This function returns an array of strings and s (wrapping highlighted words).
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount
.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
如果传入为数字,返回值也为数字 如果传入为 Date 的实例,返回值也为 Date 的实例 默认返回 format 格式的字符串
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
关闭所有notify
关闭notify
notify容器Id
执行notify结束callback
关闭notify回调
Takes an array of chunks and combines chunks that overlap into single chunks.
Converts a hex value to a decimal
用于向上向下查找关联节点
Creates an instance of the element for the specified tag.
The name of an element.
创建承载notify portal的容器
Create a new placement.
(anchorBoundingBox, containerBoundingBox, contentDimension, options) => { name, getCSSStyle }
根据props生成初始 state
Convert a value into the proper css writable value. The style name name
should be logical (no hyphens), as specified
in CSSProperty.isUnitlessNumber
.
CSS property name such as topMargin
.
CSS property value such as 10px
.
Normalized style value with dimensions applied.
Returns a function, that, as long as it continues to be invoked, will not be triggered.
The function will be called after it stops being called for wait
milliseconds
Examine text for any matches. If we find matches, add them to the returned array as a "chunk" object.
returns result of applying ease math function to a number
A high order component to expose imperative APIs for popover.
Adds a popover prop to component.
Given a set of chunks to highlight, create an additional set of chunks to represent the bits of text between the highlighted text.
Creates an array of chunk objects representing both highlightable and non highlightable pieces of text that match each search word.
Find the first positioned ancestor up in the DOM tree.
dom element to search from
true if elem is considered an ancestor of itself
the first positioned ancestor node
Set focus to node
without scroll
Format a date
Format of the date, i.e. 'mm-dd-yy' or 'shortDate'
格式化一个 date 对象
The date to format
解析的格式,默认为 'default'
the i18n setting for fecha
date 对象
将文件的Byte转换为可读性更好的GB\MB\KB\B
大小,单位Byte
保留几位小数,默认值为1
格式化后的字符串
如果 props.format 有修改,则使用之,否则检查showSecond,判断是否要显示秒
Like _.get, but only supports objects! You don't need this function 99% of the time.
获取必要的判断数据
rootInfoMap
Get current scroll position in page
将一个字符串、数字转化为 Date 的实例
需要转换的值
Date 的实例
获取viewport的宽高
Converts an HSL color value to RGB.
Assumes: h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] Returns: { r, g, b } in the set [0, 255]
Converts an HSV color value to RGB.
Assumes: h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] Returns: { r, g, b } in the set [0, 255]
Hyphenates a camelcased CSS property name, for example:
hyphenateStyleName('backgroundColor') < "background-color" hyphenateStyleName('MozTransition') < "-moz-transition" hyphenateStyleName('msTransition') < "-ms-transition"
As Modernizr suggests (http://modernizr.com/docs/#prefixed), an ms
prefix
is converted to -ms-
.
Given a string or object, convert that input to RGB
Possible string inputs:
"red"
"#f00" or "f00"
"#ff0000" or "ff0000"
"#ff000000" or "ff000000"
"rgb 255 0 0" or "rgb (255, 0, 0)"
"rgb 1.0 0 0" or "rgb (1, 0, 0)"
"rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
"rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
"hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
"hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
"hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
This function is non-recursive, and handles cyclic values. It ignores symbol key properties in objects.
Test whether an object looks like a promise
Check to see if it looks like a CSS unit
(see matchers
above for definition).
Tests whether MaybeDerive is a covariant of Base
Show at most 5 pages
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
| anchor | | |
popover |
---|
--------------- |
anchor |
--------------- |
popover |
--------- |
--------------- |
anchor |
--------------- |
popover |
--------- |
------------------------------- |
popover |
--------- |
--------------------- |
-------------------- |
---------- |
popover |
--------- |
-------------------- |
-------------------- |
---------- |
popover |
--------- |
------------------------------- |
anchor |
---------------------- |
---------------------- |
anchor |
-------------------- |
---------------------- |
anchor |
-------------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
--------- |
popover |
---------------- |
anchor |
---------------- |
获得 YYYY-MM-DD 格式的日期字符串的快捷方法
需要格式化的字符串,兼容字符串、数字和 Date 实例
解析的格式,默认为 'YYYY-MM-DD',方便日常开发
格式化后的日期字符串
获得 YYYY-MM-DD HH:mm:ss 格式的日期字符串的快捷方法
需要格式化的字符串,兼容字符串、数字和 Date 实例
解析的格式,默认为 'YYYY-MM-DD HH:mm:ss',方便日常开发
格式化后的日期字符串
进入状态的识别
离开状态的识别
创建一个新state,每个state是一次性的,识别完成后需要创建一个新的state
state的名称
识别成功时的回调函数
Parse a date string into an object, changes - into /
Date string
Date parse format
解析日期,字符串转化为日期
需要解析的 date,默认应该传入字符串,但对下面两个情况也做了兼容:
解析的格式
the i18n setting for fecha
转化后的日期
Parse a base-16 hex value into a base-10 integer
vendor-specific prefix, eg: Webkit
style name, eg: transitionDuration
style name prefixed with prefix
, properly camelCased, eg:
WebkitTransitionDuration
Converts an RGB color to hex
Assumes r, g, and b are contained in the set [0, 255] Returns a 3 or 6 character hex
Converts an RGB color value to HSL. Assumes: r, g, and b are contained in [0, 255] or [0, 1] Returns: { h, s, l } in [0,1]
Converts an RGB color value to HSV
Assumes: r, g, and b are contained in the set [0, 255] or [0, 1] Returns: { h, s, v } in [0,1]
Handle bounds / percentage checking to conform to CSS color spec http://www.w3.org/TR/css3-color/ Assumes: r, g, b in [0, 255] or [0, 1] Returns: { r, g, b } in [0, 255]
changes scroll position inside an element
Sets the value for multiple styles on a node. If a value is specified as '' (empty string), the corresponding style property will be unset.
Performs equality by iterating through keys on an object and returning false when any key has values which are not strictly equal between the arguments. Returns true when the values of all keys are strictly equal.
notify显示
显示文案
显示时长
notify状态
notify消失时回调
scrolls element with a smooth behavior
element to scroll
target position x
target position y
animation duration
self invoked function that, given a context, steps through scrolling
Permissive string parsing. Take in a number of formats, and output an object
based on detected format. Returns { r, g, b }
or { h, s, l }
or { h, s, v}
sweet [main function]
[close function returned by openDialog]
将 key 对应的 value 写入 namespace 下 比较暴力,如果无法写入会把所有 Design 相关的缓存清除
true 表示成功,false 写入失败
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount
.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
If using the new style context, re-declare this in your class to be the
React.ContextType
of your static contextType
.
static contextType = MyContext
context!: React.ContextType<typeof MyContext>
If set, this.context
will be set at runtime to the current value of the given Context.
Usage:
type MyContext = number
const Ctx = React.createContext<MyContext>(0)
class Foo extends React.Component {
static contextType = Ctx
context!: React.ContextType<typeof Ctx>
render () {
return <>My context's value: {this.context}</>;
}
}
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount
.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
If using the new style context, re-declare this in your class to be the
React.ContextType
of your static contextType
.
static contextType = MyContext
context!: React.ContextType<typeof MyContext>
If set, this.context
will be set at runtime to the current value of the given Context.
Usage:
type MyContext = number
const Ctx = React.createContext<MyContext>(0)
class Foo extends React.Component {
static contextType = Ctx
context!: React.ContextType<typeof Ctx>
render () {
return <>My context's value: {this.context}</>;
}
}
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount
.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
A mention is surrounded by spaces
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount
.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
兼容老的参数
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
If using the new style context, re-declare this in your class to be the
React.ContextType
of your static contextType
.
static contextType = MyContext
context!: React.ContextType<typeof MyContext>
If set, this.context
will be set at runtime to the current value of the given Context.
Usage:
type MyContext = number
const Ctx = React.createContext<MyContext>(0)
class Foo extends React.Component {
static contextType = Ctx
context!: React.ContextType<typeof Ctx>
render () {
return <>My context's value: {this.context}</>;
}
}
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount
.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
judge if param 'item' selected
next state marked selected item or items
coordinate for seleted judging
option object after uniformed
index of option in options list
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
accept uniformed data to traverse then inject selected option or options to next state
props of Select
uniformed data
将使用 child-element 传入的 Options 格式化为对象数组(未严格约束) data-prop 的优先级高于 child-element
props of Select
uniformedData - 格式化后对象数组
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount
.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
根据选择的keys拼装一个选好的列
Array 一个keys的数组
rows Array 一个每行的数据的数组
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
选了一行
某一行的key
是否被选中
设置内部属性,cached选中结果
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
If using the new style context, re-declare this in your class to be the
React.ContextType
of your static contextType
.
static contextType = MyContext
context!: React.ContextType<typeof MyContext>
If set, this.context
will be set at runtime to the current value of the given Context.
Usage:
type MyContext = number
const Ctx = React.createContext<MyContext>(0)
class Foo extends React.Component {
static contextType = Ctx
context!: React.ContextType<typeof Ctx>
render () {
return <>My context's value: {this.context}</>;
}
}
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
设置弹框是否显示
是否显示弹框
是否选中全部
isSelectAll
是否选中了部分
是否选中了部分
切换是否监听事件
CSS properties which accept numbers but are not in units of "px".
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
Generated using TypeDoc
copied from https://github.com/alexreardon/memoize-one