@elliemae/ds-props-helpers 3.50.0-next.1 → 3.50.0-next.2
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/globalProps/getGlobalAttributes.js.map +2 -2
- package/dist/cjs/globalProps/useGetGlobalAttributes.js.map +2 -2
- package/dist/esm/globalProps/getGlobalAttributes.js.map +2 -2
- package/dist/esm/globalProps/useGetGlobalAttributes.js.map +2 -2
- package/dist/types/globalProps/getGlobalAttributes.d.ts +3 -3
- package/dist/types/globalProps/useGetGlobalAttributes.d.ts +1 -1
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/globalProps/getGlobalAttributes.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { AllHTMLAttributes, AriaAttributes, DOMAttributes, HTMLAttributes } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { GlobalAttributes } from './constants.js';\nimport { globalAttributes } from './constants.js';\n\ntype GenericGlobalAttributes<
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,uBAAiC;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { AllHTMLAttributes, AriaAttributes, DOMAttributes, HTMLAttributes } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { GlobalAttributes } from './constants.js';\nimport { globalAttributes } from './constants.js';\n\ntype GenericGlobalAttributes<ElementType = Element> = Omit<\n AriaAttributes &\n DOMAttributes<ElementType> &\n HTMLAttributes<ElementType> &\n AllHTMLAttributes<ElementType> & { tabIndex?: TypescriptHelpersT.WCAGTabIndex },\n 'dangerouslySetInnerHTML' | 'as'\n>;\n\nexport type GlobalAttributesT<ElementType = Element, CustomProps extends Record<string, any> = object> = Partial<\n Pick<CustomProps, keyof GenericGlobalAttributes<ElementType>> &\n Omit<GenericGlobalAttributes<ElementType>, keyof CustomProps>\n>;\n\nexport const getGlobalAttributes = <\n PropsType,\n ElementType extends Element = Element,\n CustomProps extends Record<string, any> = object,\n>(\n props: PropsType,\n overrides?: Partial<GlobalAttributes<CallableFunction>>,\n): GlobalAttributesT<ElementType, CustomProps> => {\n const globalAttributesObject = {} as GlobalAttributesT<ElementType, CustomProps>;\n Object.entries(props as Record<string, unknown>).forEach(([key, value]) => {\n if (key in globalAttributes || key.startsWith('data-')) {\n if (\n overrides &&\n key in overrides &&\n typeof value === 'function' &&\n typeof overrides[key as keyof GlobalAttributes] === 'function'\n ) {\n const newFunc = (...args: unknown[]) => {\n (value as CallableFunction)(...args);\n (overrides[key as keyof GlobalAttributes] as CallableFunction)(...args);\n };\n globalAttributesObject[key as keyof GlobalAttributesT<ElementType, CustomProps>] =\n newFunc as unknown as PropsType[keyof PropsType];\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n globalAttributesObject[key as keyof GlobalAttributesT<ElementType, CustomProps>] = value;\n }\n }\n });\n return globalAttributesObject;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,uBAAiC;AAe1B,MAAM,sBAAsB,CAKjC,OACA,cACgD;AAChD,QAAM,yBAAyB,CAAC;AAChC,SAAO,QAAQ,KAAgC,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AACzE,QAAI,OAAO,qCAAoB,IAAI,WAAW,OAAO,GAAG;AACtD,UACE,aACA,OAAO,aACP,OAAO,UAAU,cACjB,OAAO,UAAU,GAA6B,MAAM,YACpD;AACA,cAAM,UAAU,IAAI,SAAoB;AACtC,UAAC,MAA2B,GAAG,IAAI;AACnC,UAAC,UAAU,GAA6B,EAAuB,GAAG,IAAI;AAAA,QACxE;AACA,+BAAuB,GAAwD,IAC7E;AAAA,MACJ,OAAO;AAEL,+BAAuB,GAAwD,IAAI;AAAA,MACrF;AAAA,IACF;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/globalProps/useGetGlobalAttributes.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemo } from 'react';\nimport type { GlobalAttributes } from './constants.js';\nimport { getGlobalAttributes } from './getGlobalAttributes.js';\nimport type { GlobalAttributesT } from './getGlobalAttributes.js';\n\nexport const useGetGlobalAttributes =
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AAExB,iCAAoC;AAG7B,MAAM,yBAAyB,
|
|
4
|
+
"sourcesContent": ["import { useMemo } from 'react';\nimport type { GlobalAttributes } from './constants.js';\nimport { getGlobalAttributes } from './getGlobalAttributes.js';\nimport type { GlobalAttributesT } from './getGlobalAttributes.js';\n\nexport const useGetGlobalAttributes = <\n Props extends object,\n ElementType extends Element = Element,\n CustomAttributes extends object = object,\n>(\n props: Props,\n overrides?: Partial<GlobalAttributes<CallableFunction>>,\n): GlobalAttributesT<ElementType, CustomAttributes> => {\n const componentGlobalAttributes: GlobalAttributesT<ElementType, CustomAttributes> = useMemo(\n () => getGlobalAttributes<Props, ElementType, CustomAttributes>(props, overrides),\n [props, overrides],\n );\n return componentGlobalAttributes;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AAExB,iCAAoC;AAG7B,MAAM,yBAAyB,CAKpC,OACA,cACqD;AACrD,QAAM,gCAA8E;AAAA,IAClF,UAAM,gDAA0D,OAAO,SAAS;AAAA,IAChF,CAAC,OAAO,SAAS;AAAA,EACnB;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/globalProps/getGlobalAttributes.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { AllHTMLAttributes, AriaAttributes, DOMAttributes, HTMLAttributes } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { GlobalAttributes } from './constants.js';\nimport { globalAttributes } from './constants.js';\n\ntype GenericGlobalAttributes<
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,wBAAwB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { AllHTMLAttributes, AriaAttributes, DOMAttributes, HTMLAttributes } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { GlobalAttributes } from './constants.js';\nimport { globalAttributes } from './constants.js';\n\ntype GenericGlobalAttributes<ElementType = Element> = Omit<\n AriaAttributes &\n DOMAttributes<ElementType> &\n HTMLAttributes<ElementType> &\n AllHTMLAttributes<ElementType> & { tabIndex?: TypescriptHelpersT.WCAGTabIndex },\n 'dangerouslySetInnerHTML' | 'as'\n>;\n\nexport type GlobalAttributesT<ElementType = Element, CustomProps extends Record<string, any> = object> = Partial<\n Pick<CustomProps, keyof GenericGlobalAttributes<ElementType>> &\n Omit<GenericGlobalAttributes<ElementType>, keyof CustomProps>\n>;\n\nexport const getGlobalAttributes = <\n PropsType,\n ElementType extends Element = Element,\n CustomProps extends Record<string, any> = object,\n>(\n props: PropsType,\n overrides?: Partial<GlobalAttributes<CallableFunction>>,\n): GlobalAttributesT<ElementType, CustomProps> => {\n const globalAttributesObject = {} as GlobalAttributesT<ElementType, CustomProps>;\n Object.entries(props as Record<string, unknown>).forEach(([key, value]) => {\n if (key in globalAttributes || key.startsWith('data-')) {\n if (\n overrides &&\n key in overrides &&\n typeof value === 'function' &&\n typeof overrides[key as keyof GlobalAttributes] === 'function'\n ) {\n const newFunc = (...args: unknown[]) => {\n (value as CallableFunction)(...args);\n (overrides[key as keyof GlobalAttributes] as CallableFunction)(...args);\n };\n globalAttributesObject[key as keyof GlobalAttributesT<ElementType, CustomProps>] =\n newFunc as unknown as PropsType[keyof PropsType];\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n globalAttributesObject[key as keyof GlobalAttributesT<ElementType, CustomProps>] = value;\n }\n }\n });\n return globalAttributesObject;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,wBAAwB;AAe1B,MAAM,sBAAsB,CAKjC,OACA,cACgD;AAChD,QAAM,yBAAyB,CAAC;AAChC,SAAO,QAAQ,KAAgC,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AACzE,QAAI,OAAO,oBAAoB,IAAI,WAAW,OAAO,GAAG;AACtD,UACE,aACA,OAAO,aACP,OAAO,UAAU,cACjB,OAAO,UAAU,GAA6B,MAAM,YACpD;AACA,cAAM,UAAU,IAAI,SAAoB;AACtC,UAAC,MAA2B,GAAG,IAAI;AACnC,UAAC,UAAU,GAA6B,EAAuB,GAAG,IAAI;AAAA,QACxE;AACA,+BAAuB,GAAwD,IAC7E;AAAA,MACJ,OAAO;AAEL,+BAAuB,GAAwD,IAAI;AAAA,MACrF;AAAA,IACF;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/globalProps/useGetGlobalAttributes.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type { GlobalAttributes } from './constants.js';\nimport { getGlobalAttributes } from './getGlobalAttributes.js';\nimport type { GlobalAttributesT } from './getGlobalAttributes.js';\n\nexport const useGetGlobalAttributes =
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAExB,SAAS,2BAA2B;AAG7B,MAAM,yBAAyB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type { GlobalAttributes } from './constants.js';\nimport { getGlobalAttributes } from './getGlobalAttributes.js';\nimport type { GlobalAttributesT } from './getGlobalAttributes.js';\n\nexport const useGetGlobalAttributes = <\n Props extends object,\n ElementType extends Element = Element,\n CustomAttributes extends object = object,\n>(\n props: Props,\n overrides?: Partial<GlobalAttributes<CallableFunction>>,\n): GlobalAttributesT<ElementType, CustomAttributes> => {\n const componentGlobalAttributes: GlobalAttributesT<ElementType, CustomAttributes> = useMemo(\n () => getGlobalAttributes<Props, ElementType, CustomAttributes>(props, overrides),\n [props, overrides],\n );\n return componentGlobalAttributes;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAExB,SAAS,2BAA2B;AAG7B,MAAM,yBAAyB,CAKpC,OACA,cACqD;AACrD,QAAM,4BAA8E;AAAA,IAClF,MAAM,oBAA0D,OAAO,SAAS;AAAA,IAChF,CAAC,OAAO,SAAS;AAAA,EACnB;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AllHTMLAttributes, AriaAttributes, DOMAttributes, HTMLAttributes } from 'react';
|
|
2
2
|
import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
|
3
3
|
import type { GlobalAttributes } from './constants.js';
|
|
4
|
-
type GenericGlobalAttributes<
|
|
4
|
+
type GenericGlobalAttributes<ElementType = Element> = Omit<AriaAttributes & DOMAttributes<ElementType> & HTMLAttributes<ElementType> & AllHTMLAttributes<ElementType> & {
|
|
5
5
|
tabIndex?: TypescriptHelpersT.WCAGTabIndex;
|
|
6
6
|
}, 'dangerouslySetInnerHTML' | 'as'>;
|
|
7
|
-
export type GlobalAttributesT<
|
|
8
|
-
export declare const getGlobalAttributes: <
|
|
7
|
+
export type GlobalAttributesT<ElementType = Element, CustomProps extends Record<string, any> = object> = Partial<Pick<CustomProps, keyof GenericGlobalAttributes<ElementType>> & Omit<GenericGlobalAttributes<ElementType>, keyof CustomProps>>;
|
|
8
|
+
export declare const getGlobalAttributes: <PropsType, ElementType extends Element = Element, CustomProps extends Record<string, any> = object>(props: PropsType, overrides?: Partial<GlobalAttributes<CallableFunction>>) => GlobalAttributesT<ElementType, CustomProps>;
|
|
9
9
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { GlobalAttributes } from './constants.js';
|
|
2
2
|
import type { GlobalAttributesT } from './getGlobalAttributes.js';
|
|
3
|
-
export declare const useGetGlobalAttributes: <
|
|
3
|
+
export declare const useGetGlobalAttributes: <Props extends object, ElementType extends Element = Element, CustomAttributes extends object = object>(props: Props, overrides?: Partial<GlobalAttributes<CallableFunction>>) => GlobalAttributesT<ElementType, CustomAttributes>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-props-helpers",
|
|
3
|
-
"version": "3.50.0-next.
|
|
3
|
+
"version": "3.50.0-next.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Props Helpers",
|
|
6
6
|
"files": [
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"fast-deep-equal": "~3.1.3",
|
|
37
37
|
"prop-types": "~15.8.1",
|
|
38
|
-
"@elliemae/ds-system": "3.50.0-next.
|
|
39
|
-
"@elliemae/ds-typescript-helpers": "3.50.0-next.
|
|
38
|
+
"@elliemae/ds-system": "3.50.0-next.2",
|
|
39
|
+
"@elliemae/ds-typescript-helpers": "3.50.0-next.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@elliemae/pui-cli": "9.0.0-next.
|
|
43
|
-
"@elliemae/ds-monorepo-devops": "3.50.0-next.
|
|
42
|
+
"@elliemae/pui-cli": "9.0.0-next.31",
|
|
43
|
+
"@elliemae/ds-monorepo-devops": "3.50.0-next.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"lodash": "^4.17.21",
|
|
47
|
-
"react": "
|
|
47
|
+
"react": "^17.0.2",
|
|
48
48
|
"react-dom": "^17.0.2"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|