@elliemae/ds-page-header-v2 3.52.0-rc.2 → 3.52.0-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/page-header-editable-title/useDerivedStateFromProps.js +3 -3
- package/dist/cjs/components/page-header-editable-title/useDerivedStateFromProps.js.map +2 -2
- package/dist/esm/components/page-header-editable-title/useDerivedStateFromProps.js +1 -1
- package/dist/esm/components/page-header-editable-title/useDerivedStateFromProps.js.map +1 -1
- package/package.json +14 -14
@@ -34,14 +34,14 @@ __export(useDerivedStateFromProps_exports, {
|
|
34
34
|
module.exports = __toCommonJS(useDerivedStateFromProps_exports);
|
35
35
|
var React = __toESM(require("react"));
|
36
36
|
var import_react = require("react");
|
37
|
-
var
|
37
|
+
var import_lodash_es = require("lodash-es");
|
38
38
|
const defaultPropUpdateOnChange = (prop) => prop;
|
39
39
|
function defaultShouldUpdate({ prop, prevProp, stateValue }) {
|
40
|
-
return !(0,
|
40
|
+
return !(0, import_lodash_es.isEqual)(prop, prevProp) && !(0, import_lodash_es.isEqual)(prop, stateValue);
|
41
41
|
}
|
42
42
|
function setStateWithUpdate(onUpdate, setState) {
|
43
43
|
return (state) => {
|
44
|
-
setState((prevState) => onUpdate((0,
|
44
|
+
setState((prevState) => onUpdate((0, import_lodash_es.isFunction)(state) ? state(prevState) : state, prevState));
|
45
45
|
};
|
46
46
|
}
|
47
47
|
const useDerivedStateFromProps = (prop, options = {}) => {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../src/components/page-header-editable-title/useDerivedStateFromProps.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
-
"sourcesContent": ["import type React from 'react';\nimport { useRef, useState } from 'react';\nimport { isEqual, isFunction } from 'lodash';\n\ninterface ShouldUpdateArg {\n prop: unknown;\n prevProp: unknown;\n stateValue: unknown;\n}\n\ntype OnUpdateT<T> = (prop: T, prevProp?: T | Record<string, never>) => T;\n\ninterface OptionsT<T> {\n onUpdate?: OnUpdateT<T>;\n shouldUpdate?: (arg: ShouldUpdateArg) => boolean;\n updateOnStateChange?: boolean;\n}\n\nconst defaultPropUpdateOnChange = <T>(prop: T) => prop;\n\nfunction defaultShouldUpdate({ prop, prevProp, stateValue }: ShouldUpdateArg) {\n return !isEqual(prop, prevProp) && !isEqual(prop, stateValue);\n}\n\nfunction setStateWithUpdate<T>(onUpdate: OnUpdateT<T>, setState: React.Dispatch<React.SetStateAction<T>>) {\n return (state: React.SetStateAction<T>) => {\n setState((prevState: T) => onUpdate(isFunction(state) ? state(prevState) : state, prevState));\n };\n}\n\nexport const useDerivedStateFromProps = <T>(\n prop: T,\n options: OptionsT<T> = {},\n): [T, React.Dispatch<React.SetStateAction<T>>] => {\n const {\n onUpdate = defaultPropUpdateOnChange as OnUpdateT<T>,\n shouldUpdate = defaultShouldUpdate,\n updateOnStateChange = false,\n } = options;\n\n const [stateValue, setState] = useState(onUpdate(prop, {}));\n const handleSetState = updateOnStateChange ? setStateWithUpdate(onUpdate, setState) : setState;\n const prevProp = useRef(prop);\n\n if (\n shouldUpdate({\n prop,\n prevProp: prevProp.current,\n stateValue,\n })\n ) {\n const nextProp = onUpdate(prop, prevProp.current);\n setState(nextProp);\n }\n prevProp.current = prop;\n return [stateValue, handleSetState];\n};\n\nexport default useDerivedStateFromProps;\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAiC;AACjC,
|
4
|
+
"sourcesContent": ["import type React from 'react';\nimport { useRef, useState } from 'react';\nimport { isEqual, isFunction } from 'lodash-es';\n\ninterface ShouldUpdateArg {\n prop: unknown;\n prevProp: unknown;\n stateValue: unknown;\n}\n\ntype OnUpdateT<T> = (prop: T, prevProp?: T | Record<string, never>) => T;\n\ninterface OptionsT<T> {\n onUpdate?: OnUpdateT<T>;\n shouldUpdate?: (arg: ShouldUpdateArg) => boolean;\n updateOnStateChange?: boolean;\n}\n\nconst defaultPropUpdateOnChange = <T>(prop: T) => prop;\n\nfunction defaultShouldUpdate({ prop, prevProp, stateValue }: ShouldUpdateArg) {\n return !isEqual(prop, prevProp) && !isEqual(prop, stateValue);\n}\n\nfunction setStateWithUpdate<T>(onUpdate: OnUpdateT<T>, setState: React.Dispatch<React.SetStateAction<T>>) {\n return (state: React.SetStateAction<T>) => {\n setState((prevState: T) => onUpdate(isFunction(state) ? state(prevState) : state, prevState));\n };\n}\n\nexport const useDerivedStateFromProps = <T>(\n prop: T,\n options: OptionsT<T> = {},\n): [T, React.Dispatch<React.SetStateAction<T>>] => {\n const {\n onUpdate = defaultPropUpdateOnChange as OnUpdateT<T>,\n shouldUpdate = defaultShouldUpdate,\n updateOnStateChange = false,\n } = options;\n\n const [stateValue, setState] = useState(onUpdate(prop, {}));\n const handleSetState = updateOnStateChange ? setStateWithUpdate(onUpdate, setState) : setState;\n const prevProp = useRef(prop);\n\n if (\n shouldUpdate({\n prop,\n prevProp: prevProp.current,\n stateValue,\n })\n ) {\n const nextProp = onUpdate(prop, prevProp.current);\n setState(nextProp);\n }\n prevProp.current = prop;\n return [stateValue, handleSetState];\n};\n\nexport default useDerivedStateFromProps;\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAiC;AACjC,uBAAoC;AAgBpC,MAAM,4BAA4B,CAAI,SAAY;AAElD,SAAS,oBAAoB,EAAE,MAAM,UAAU,WAAW,GAAoB;AAC5E,SAAO,KAAC,0BAAQ,MAAM,QAAQ,KAAK,KAAC,0BAAQ,MAAM,UAAU;AAC9D;AAEA,SAAS,mBAAsB,UAAwB,UAAmD;AACxG,SAAO,CAAC,UAAmC;AACzC,aAAS,CAAC,cAAiB,aAAS,6BAAW,KAAK,IAAI,MAAM,SAAS,IAAI,OAAO,SAAS,CAAC;AAAA,EAC9F;AACF;AAEO,MAAM,2BAA2B,CACtC,MACA,UAAuB,CAAC,MACyB;AACjD,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,eAAe;AAAA,IACf,sBAAsB;AAAA,EACxB,IAAI;AAEJ,QAAM,CAAC,YAAY,QAAQ,QAAI,uBAAS,SAAS,MAAM,CAAC,CAAC,CAAC;AAC1D,QAAM,iBAAiB,sBAAsB,mBAAmB,UAAU,QAAQ,IAAI;AACtF,QAAM,eAAW,qBAAO,IAAI;AAE5B,MACE,aAAa;AAAA,IACX;AAAA,IACA,UAAU,SAAS;AAAA,IACnB;AAAA,EACF,CAAC,GACD;AACA,UAAM,WAAW,SAAS,MAAM,SAAS,OAAO;AAChD,aAAS,QAAQ;AAAA,EACnB;AACA,WAAS,UAAU;AACnB,SAAO,CAAC,YAAY,cAAc;AACpC;AAEA,IAAO,mCAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { useRef, useState } from "react";
|
3
|
-
import { isEqual, isFunction } from "lodash";
|
3
|
+
import { isEqual, isFunction } from "lodash-es";
|
4
4
|
const defaultPropUpdateOnChange = (prop) => prop;
|
5
5
|
function defaultShouldUpdate({ prop, prevProp, stateValue }) {
|
6
6
|
return !isEqual(prop, prevProp) && !isEqual(prop, stateValue);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/page-header-editable-title/useDerivedStateFromProps.ts"],
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { useRef, useState } from 'react';\nimport { isEqual, isFunction } from 'lodash';\n\ninterface ShouldUpdateArg {\n prop: unknown;\n prevProp: unknown;\n stateValue: unknown;\n}\n\ntype OnUpdateT<T> = (prop: T, prevProp?: T | Record<string, never>) => T;\n\ninterface OptionsT<T> {\n onUpdate?: OnUpdateT<T>;\n shouldUpdate?: (arg: ShouldUpdateArg) => boolean;\n updateOnStateChange?: boolean;\n}\n\nconst defaultPropUpdateOnChange = <T>(prop: T) => prop;\n\nfunction defaultShouldUpdate({ prop, prevProp, stateValue }: ShouldUpdateArg) {\n return !isEqual(prop, prevProp) && !isEqual(prop, stateValue);\n}\n\nfunction setStateWithUpdate<T>(onUpdate: OnUpdateT<T>, setState: React.Dispatch<React.SetStateAction<T>>) {\n return (state: React.SetStateAction<T>) => {\n setState((prevState: T) => onUpdate(isFunction(state) ? state(prevState) : state, prevState));\n };\n}\n\nexport const useDerivedStateFromProps = <T>(\n prop: T,\n options: OptionsT<T> = {},\n): [T, React.Dispatch<React.SetStateAction<T>>] => {\n const {\n onUpdate = defaultPropUpdateOnChange as OnUpdateT<T>,\n shouldUpdate = defaultShouldUpdate,\n updateOnStateChange = false,\n } = options;\n\n const [stateValue, setState] = useState(onUpdate(prop, {}));\n const handleSetState = updateOnStateChange ? setStateWithUpdate(onUpdate, setState) : setState;\n const prevProp = useRef(prop);\n\n if (\n shouldUpdate({\n prop,\n prevProp: prevProp.current,\n stateValue,\n })\n ) {\n const nextProp = onUpdate(prop, prevProp.current);\n setState(nextProp);\n }\n prevProp.current = prop;\n return [stateValue, handleSetState];\n};\n\nexport default useDerivedStateFromProps;\n"],
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { useRef, useState } from 'react';\nimport { isEqual, isFunction } from 'lodash-es';\n\ninterface ShouldUpdateArg {\n prop: unknown;\n prevProp: unknown;\n stateValue: unknown;\n}\n\ntype OnUpdateT<T> = (prop: T, prevProp?: T | Record<string, never>) => T;\n\ninterface OptionsT<T> {\n onUpdate?: OnUpdateT<T>;\n shouldUpdate?: (arg: ShouldUpdateArg) => boolean;\n updateOnStateChange?: boolean;\n}\n\nconst defaultPropUpdateOnChange = <T>(prop: T) => prop;\n\nfunction defaultShouldUpdate({ prop, prevProp, stateValue }: ShouldUpdateArg) {\n return !isEqual(prop, prevProp) && !isEqual(prop, stateValue);\n}\n\nfunction setStateWithUpdate<T>(onUpdate: OnUpdateT<T>, setState: React.Dispatch<React.SetStateAction<T>>) {\n return (state: React.SetStateAction<T>) => {\n setState((prevState: T) => onUpdate(isFunction(state) ? state(prevState) : state, prevState));\n };\n}\n\nexport const useDerivedStateFromProps = <T>(\n prop: T,\n options: OptionsT<T> = {},\n): [T, React.Dispatch<React.SetStateAction<T>>] => {\n const {\n onUpdate = defaultPropUpdateOnChange as OnUpdateT<T>,\n shouldUpdate = defaultShouldUpdate,\n updateOnStateChange = false,\n } = options;\n\n const [stateValue, setState] = useState(onUpdate(prop, {}));\n const handleSetState = updateOnStateChange ? setStateWithUpdate(onUpdate, setState) : setState;\n const prevProp = useRef(prop);\n\n if (\n shouldUpdate({\n prop,\n prevProp: prevProp.current,\n stateValue,\n })\n ) {\n const nextProp = onUpdate(prop, prevProp.current);\n setState(nextProp);\n }\n prevProp.current = prop;\n return [stateValue, handleSetState];\n};\n\nexport default useDerivedStateFromProps;\n"],
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,gBAAgB;AACjC,SAAS,SAAS,kBAAkB;AAgBpC,MAAM,4BAA4B,CAAI,SAAY;AAElD,SAAS,oBAAoB,EAAE,MAAM,UAAU,WAAW,GAAoB;AAC5E,SAAO,CAAC,QAAQ,MAAM,QAAQ,KAAK,CAAC,QAAQ,MAAM,UAAU;AAC9D;AAEA,SAAS,mBAAsB,UAAwB,UAAmD;AACxG,SAAO,CAAC,UAAmC;AACzC,aAAS,CAAC,cAAiB,SAAS,WAAW,KAAK,IAAI,MAAM,SAAS,IAAI,OAAO,SAAS,CAAC;AAAA,EAC9F;AACF;AAEO,MAAM,2BAA2B,CACtC,MACA,UAAuB,CAAC,MACyB;AACjD,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,eAAe;AAAA,IACf,sBAAsB;AAAA,EACxB,IAAI;AAEJ,QAAM,CAAC,YAAY,QAAQ,IAAI,SAAS,SAAS,MAAM,CAAC,CAAC,CAAC;AAC1D,QAAM,iBAAiB,sBAAsB,mBAAmB,UAAU,QAAQ,IAAI;AACtF,QAAM,WAAW,OAAO,IAAI;AAE5B,MACE,aAAa;AAAA,IACX;AAAA,IACA,UAAU,SAAS;AAAA,IACnB;AAAA,EACF,CAAC,GACD;AACA,UAAM,WAAW,SAAS,MAAM,SAAS,OAAO;AAChD,aAAS,QAAQ;AAAA,EACnB;AACA,WAAS,UAAU;AACnB,SAAO,CAAC,YAAY,cAAc;AACpC;AAEA,IAAO,mCAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@elliemae/ds-page-header-v2",
|
3
|
-
"version": "3.52.0-rc.
|
3
|
+
"version": "3.52.0-rc.21",
|
4
4
|
"license": "MIT",
|
5
5
|
"description": "ICE MT - Dimsum - Page Header V2",
|
6
6
|
"files": [
|
@@ -37,26 +37,26 @@
|
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
39
|
"prop-types": "~15.8.1",
|
40
|
-
"@elliemae/ds-breadcrumb": "3.52.0-rc.
|
41
|
-
"@elliemae/ds-button": "3.52.0-rc.
|
42
|
-
"@elliemae/ds-form": "3.52.0-rc.
|
43
|
-
"@elliemae/ds-form-input-text": "3.52.0-rc.
|
44
|
-
"@elliemae/ds-grid": "3.52.0-rc.
|
45
|
-
"@elliemae/ds-icon": "3.52.0-rc.
|
46
|
-
"@elliemae/ds-
|
47
|
-
"@elliemae/ds-icons": "3.52.0-rc.
|
48
|
-
"@elliemae/ds-
|
49
|
-
"@elliemae/ds-system": "3.52.0-rc.
|
50
|
-
"@elliemae/ds-truncated-tooltip-text": "3.52.0-rc.
|
40
|
+
"@elliemae/ds-breadcrumb": "3.52.0-rc.21",
|
41
|
+
"@elliemae/ds-button": "3.52.0-rc.21",
|
42
|
+
"@elliemae/ds-form": "3.52.0-rc.21",
|
43
|
+
"@elliemae/ds-form-input-text": "3.52.0-rc.21",
|
44
|
+
"@elliemae/ds-grid": "3.52.0-rc.21",
|
45
|
+
"@elliemae/ds-icon": "3.52.0-rc.21",
|
46
|
+
"@elliemae/ds-props-helpers": "3.52.0-rc.21",
|
47
|
+
"@elliemae/ds-icons": "3.52.0-rc.21",
|
48
|
+
"@elliemae/ds-skeleton": "3.52.0-rc.21",
|
49
|
+
"@elliemae/ds-system": "3.52.0-rc.21",
|
50
|
+
"@elliemae/ds-truncated-tooltip-text": "3.52.0-rc.21"
|
51
51
|
},
|
52
52
|
"devDependencies": {
|
53
53
|
"@elliemae/pui-cli": "9.0.0-next.55",
|
54
54
|
"jest": "~29.7.0",
|
55
55
|
"styled-components": "~5.3.9",
|
56
|
-
"@elliemae/ds-monorepo-devops": "3.52.0-rc.
|
56
|
+
"@elliemae/ds-monorepo-devops": "3.52.0-rc.21"
|
57
57
|
},
|
58
58
|
"peerDependencies": {
|
59
|
-
"lodash": "^4.17.21",
|
59
|
+
"lodash-es": "^4.17.21",
|
60
60
|
"react": "^18.3.1",
|
61
61
|
"react-dom": "^18.3.1",
|
62
62
|
"styled-components": "~5.3.9"
|