@servicetitan/link-item 38.1.0 → 38.2.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sidenav-link-item.tsx"],"sourcesContent":["import { useMemo, useCallback, FC, PropsWithChildren } from 'react';\nimport { withRouter, RouteComponentProps, matchPath } from 'react-router-dom';\n\nimport { SideNav } from '@servicetitan/design-system';\n\ninterface SideNavLinkItemProps extends PropsWithChildren<{}> {\n exact?: boolean;\n pathname: string;\n search?: string;\n className?: string;\n}\n\nconst SideNavLinkItemUnwrapped: FC<SideNavLinkItemProps & RouteComponentProps> = ({\n exact,\n pathname,\n search,\n className,\n children,\n history,\n}) => {\n const href = useMemo(\n () => history.createHref({ pathname, search }),\n [history, pathname, search]\n );\n\n const handleClick = useCallback(() => {\n history.push(pathname + (search ?? ''));\n }, [history, pathname, search]);\n\n return (\n <SideNav.Item\n href={href}\n active={!!matchPath(history.location.pathname, { exact, path: pathname })}\n onClick={handleClick}\n className={className}\n >\n {children}\n </SideNav.Item>\n );\n};\n\nexport const SideNavLinkItem = withRouter(SideNavLinkItemUnwrapped);\n"],"names":["useMemo","useCallback","withRouter","matchPath","SideNav","SideNavLinkItemUnwrapped","exact","pathname","search","className","children","history","href","createHref","handleClick","push","Item","active","location","path","onClick","SideNavLinkItem"],"mappings":";AAAA,SAASA,OAAO,EAAEC,WAAW,QAA+B,QAAQ;AACpE,SAASC,UAAU,EAAuBC,SAAS,QAAQ,mBAAmB;AAE9E,SAASC,OAAO,QAAQ,8BAA8B;AAStD,MAAMC,2BAA2E,CAAC,EAC9EC,KAAK,EACLC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACV;IACG,MAAMC,OAAOZ,QACT,IAAMW,QAAQE,UAAU,CAAC;YAAEN;YAAUC;QAAO,IAC5C;QAACG;QAASJ;QAAUC;KAAO;IAG/B,MAAMM,cAAcb,YAAY;QAC5BU,QAAQI,IAAI,CAACR,
|
|
1
|
+
{"version":3,"sources":["../src/sidenav-link-item.tsx"],"sourcesContent":["import { useMemo, useCallback, FC, PropsWithChildren } from 'react';\nimport { withRouter, RouteComponentProps, matchPath } from 'react-router-dom';\n\nimport { SideNav } from '@servicetitan/design-system';\n\ninterface SideNavLinkItemProps extends PropsWithChildren<{}> {\n exact?: boolean;\n pathname: string;\n search?: string;\n className?: string;\n}\n\nconst SideNavLinkItemUnwrapped: FC<SideNavLinkItemProps & RouteComponentProps> = ({\n exact,\n pathname,\n search,\n className,\n children,\n history,\n}) => {\n const href = useMemo(\n () => history.createHref({ pathname, search }),\n [history, pathname, search]\n );\n\n const handleClick = useCallback(() => {\n history.push(pathname + (search ?? ''));\n }, [history, pathname, search]);\n\n return (\n <SideNav.Item\n href={href}\n active={!!matchPath(history.location.pathname, { exact, path: pathname })}\n onClick={handleClick}\n className={className}\n >\n {children}\n </SideNav.Item>\n );\n};\n\nexport const SideNavLinkItem = withRouter(SideNavLinkItemUnwrapped);\n"],"names":["useMemo","useCallback","withRouter","matchPath","SideNav","SideNavLinkItemUnwrapped","exact","pathname","search","className","children","history","href","createHref","handleClick","push","Item","active","location","path","onClick","SideNavLinkItem"],"mappings":";AAAA,SAASA,OAAO,EAAEC,WAAW,QAA+B,QAAQ;AACpE,SAASC,UAAU,EAAuBC,SAAS,QAAQ,mBAAmB;AAE9E,SAASC,OAAO,QAAQ,8BAA8B;AAStD,MAAMC,2BAA2E,CAAC,EAC9EC,KAAK,EACLC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,OAAO,EACV;IACG,MAAMC,OAAOZ,QACT,IAAMW,QAAQE,UAAU,CAAC;YAAEN;YAAUC;QAAO,IAC5C;QAACG;QAASJ;QAAUC;KAAO;IAG/B,MAAMM,cAAcb,YAAY;QAC5BU,QAAQI,IAAI,CAACR,YAAYC,mBAAAA,oBAAAA,SAAU;IACvC,GAAG;QAACG;QAASJ;QAAUC;KAAO;IAE9B,qBACI,KAACJ,QAAQY,IAAI;QACTJ,MAAMA;QACNK,QAAQ,CAAC,CAACd,UAAUQ,QAAQO,QAAQ,CAACX,QAAQ,EAAE;YAAED;YAAOa,MAAMZ;QAAS;QACvEa,SAASN;QACTL,WAAWA;kBAEVC;;AAGb;AAEA,OAAO,MAAMW,kBAAkBnB,WAAWG,0BAA0B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/link-item",
|
|
3
|
-
"version": "38.
|
|
3
|
+
"version": "38.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/link-item",
|
|
6
6
|
"repository": {
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"cli": {
|
|
35
35
|
"webpack": false
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "b013c9f39c05c44f888a5bca5ff6aadb89cd7a6f"
|
|
38
38
|
}
|