@deephaven/jsapi-components 0.48.1-beta.0 → 0.48.1-beta.1

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,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import type { dh as DhType } from '@deephaven/jsapi-types';
3
- export declare function makeApiContextWrapper(dh: DhType): ({ children }: {
3
+ export declare function makeApiContextWrapper(dh: DhType): ({ children, }: {
4
4
  children?: ReactNode;
5
5
  }) => JSX.Element;
6
6
  declare const _default: {
@@ -1 +1 @@
1
- {"version":3,"file":"HookTestUtils.d.ts","sourceRoot":"","sources":["../src/HookTestUtils.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE3D,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM;eACe,SAAS;kBAGvE;;;;AAED,wBAEE"}
1
+ {"version":3,"file":"HookTestUtils.d.ts","sourceRoot":"","sources":["../src/HookTestUtils.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE3D,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM;eAIjC,SAAS;MAClB,WAAW,CAGhB;;;;AAED,wBAEE"}
@@ -1 +1 @@
1
- {"version":3,"file":"HookTestUtils.js","names":["React","ApiContext","makeApiContextWrapper","dh","ApiContextWrapper","children"],"sources":["../src/HookTestUtils.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { ApiContext } from '@deephaven/jsapi-bootstrap';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\n\nexport function makeApiContextWrapper(dh: DhType) {\n return function ApiContextWrapper({ children }: { children?: ReactNode }) {\n return <ApiContext.Provider value={dh}>{children}</ApiContext.Provider>;\n };\n}\n\nexport default {\n makeApiContextWrapper,\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,UAAU,QAAQ,4BAA4B;AAAC;AAGxD,OAAO,SAASC,qBAAqB,CAACC,EAAU,EAAE;EAChD,OAAO,SAASC,iBAAiB,OAAyC;IAAA,IAAxC;MAAEC;IAAmC,CAAC;IACtE,oBAAO,KAAC,UAAU,CAAC,QAAQ;MAAC,KAAK,EAAEF,EAAG;MAAA,UAAEE;IAAQ,EAAuB;EACzE,CAAC;AACH;AAEA,eAAe;EACbH;AACF,CAAC"}
1
+ {"version":3,"file":"HookTestUtils.js","names":["React","ApiContext","makeApiContextWrapper","dh","ApiContextWrapper","children"],"sources":["../src/HookTestUtils.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { ApiContext } from '@deephaven/jsapi-bootstrap';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\n\nexport function makeApiContextWrapper(dh: DhType) {\n return function ApiContextWrapper({\n children,\n }: {\n children?: ReactNode;\n }): JSX.Element {\n return <ApiContext.Provider value={dh}>{children}</ApiContext.Provider>;\n };\n}\n\nexport default {\n makeApiContextWrapper,\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,UAAU,QAAQ,4BAA4B;AAAC;AAGxD,OAAO,SAASC,qBAAqB,CAACC,EAAU,EAAE;EAChD,OAAO,SAASC,iBAAiB,OAIjB;IAAA,IAJkB;MAChCC;IAGF,CAAC;IACC,oBAAO,KAAC,UAAU,CAAC,QAAQ;MAAC,KAAK,EAAEF,EAAG;MAAA,UAAEE;IAAQ,EAAuB;EACzE,CAAC;AACH;AAEA,eAAe;EACbH;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshTokenBootstrap.d.ts","sourceRoot":"","sources":["../src/RefreshTokenBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAShE,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,GACT,EAAE,0BAA0B,eAoC5B;AAED,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"RefreshTokenBootstrap.d.ts","sourceRoot":"","sources":["../src/RefreshTokenBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAShE,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,GACT,EAAE,0BAA0B,GAAG,GAAG,CAAC,OAAO,CAoC1C;AAED,eAAe,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshTokenBootstrap.js","names":["React","useCallback","useEffect","useState","useApi","useClient","useBroadcastLoginListener","readRefreshToken","RefreshTokenContext","storeRefreshToken","RefreshTokenBootstrap","children","api","client","token","setToken","listenForTokenUpdates","cleanup","addEventListener","CoreClient","EVENT_REFRESH_TOKEN_UPDATED","event","detail","newToken","onLogin","onLogout"],"sources":["../src/RefreshTokenBootstrap.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { useApi, useClient } from '@deephaven/jsapi-bootstrap';\nimport useBroadcastLoginListener from './useBroadcastLoginListener';\nimport {\n readRefreshToken,\n RefreshTokenContext,\n storeRefreshToken,\n} from './RefreshTokenUtils';\n\nexport type RefreshTokenBootstrapProps = {\n /**\n * The children to render wrapped with the RefreshTokenContext.\n */\n children: React.ReactNode;\n};\n\n/**\n * RefreshTokenBootstrap component. Handles storing and reading the refresh token.\n */\nexport function RefreshTokenBootstrap({\n children,\n}: RefreshTokenBootstrapProps) {\n const api = useApi();\n const client = useClient();\n const [token, setToken] = useState(readRefreshToken());\n\n useEffect(\n function listenForTokenUpdates() {\n const cleanup = client.addEventListener(\n api.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,\n (event: CustomEvent) => {\n const { detail: newToken } = event;\n storeRefreshToken(newToken);\n setToken(newToken);\n }\n );\n return cleanup;\n },\n [api, client, token]\n );\n\n const onLogin = useCallback(() => {\n setToken(readRefreshToken());\n }, []);\n\n const onLogout = useCallback(() => {\n storeRefreshToken(null);\n setToken(null);\n }, []);\n\n useBroadcastLoginListener(onLogin, onLogout);\n\n return (\n <RefreshTokenContext.Provider value={token}>\n {children}\n </RefreshTokenContext.Provider>\n );\n}\n\nexport default RefreshTokenBootstrap;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC/D,SAASC,MAAM,EAAEC,SAAS,QAAQ,4BAA4B;AAAC,OACxDC,yBAAyB;AAAA,SAE9BC,gBAAgB,EAChBC,mBAAmB,EACnBC,iBAAiB;AAAA;AAUnB;AACA;AACA;AACA,OAAO,SAASC,qBAAqB,OAEN;EAAA,IAFO;IACpCC;EAC0B,CAAC;EAC3B,IAAMC,GAAG,GAAGR,MAAM,EAAE;EACpB,IAAMS,MAAM,GAAGR,SAAS,EAAE;EAC1B,IAAM,CAACS,KAAK,EAAEC,QAAQ,CAAC,GAAGZ,QAAQ,CAACI,gBAAgB,EAAE,CAAC;EAEtDL,SAAS,CACP,SAASc,qBAAqB,GAAG;IAC/B,IAAMC,OAAO,GAAGJ,MAAM,CAACK,gBAAgB,CACrCN,GAAG,CAACO,UAAU,CAACC,2BAA2B,EACzCC,KAAkB,IAAK;MACtB,IAAM;QAAEC,MAAM,EAAEC;MAAS,CAAC,GAAGF,KAAK;MAClCZ,iBAAiB,CAACc,QAAQ,CAAC;MAC3BR,QAAQ,CAACQ,QAAQ,CAAC;IACpB,CAAC,CACF;IACD,OAAON,OAAO;EAChB,CAAC,EACD,CAACL,GAAG,EAAEC,MAAM,EAAEC,KAAK,CAAC,CACrB;EAED,IAAMU,OAAO,GAAGvB,WAAW,CAAC,MAAM;IAChCc,QAAQ,CAACR,gBAAgB,EAAE,CAAC;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,IAAMkB,QAAQ,GAAGxB,WAAW,CAAC,MAAM;IACjCQ,iBAAiB,CAAC,IAAI,CAAC;IACvBM,QAAQ,CAAC,IAAI,CAAC;EAChB,CAAC,EAAE,EAAE,CAAC;EAENT,yBAAyB,CAACkB,OAAO,EAAEC,QAAQ,CAAC;EAE5C,oBACE,KAAC,mBAAmB,CAAC,QAAQ;IAAC,KAAK,EAAEX,KAAM;IAAA,UACxCH;EAAQ,EACoB;AAEnC;AAEA,eAAeD,qBAAqB"}
1
+ {"version":3,"file":"RefreshTokenBootstrap.js","names":["React","useCallback","useEffect","useState","useApi","useClient","useBroadcastLoginListener","readRefreshToken","RefreshTokenContext","storeRefreshToken","RefreshTokenBootstrap","children","api","client","token","setToken","listenForTokenUpdates","cleanup","addEventListener","CoreClient","EVENT_REFRESH_TOKEN_UPDATED","event","detail","newToken","onLogin","onLogout"],"sources":["../src/RefreshTokenBootstrap.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { useApi, useClient } from '@deephaven/jsapi-bootstrap';\nimport useBroadcastLoginListener from './useBroadcastLoginListener';\nimport {\n readRefreshToken,\n RefreshTokenContext,\n storeRefreshToken,\n} from './RefreshTokenUtils';\n\nexport type RefreshTokenBootstrapProps = {\n /**\n * The children to render wrapped with the RefreshTokenContext.\n */\n children: React.ReactNode;\n};\n\n/**\n * RefreshTokenBootstrap component. Handles storing and reading the refresh token.\n */\nexport function RefreshTokenBootstrap({\n children,\n}: RefreshTokenBootstrapProps): JSX.Element {\n const api = useApi();\n const client = useClient();\n const [token, setToken] = useState(readRefreshToken());\n\n useEffect(\n function listenForTokenUpdates() {\n const cleanup = client.addEventListener(\n api.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,\n (event: CustomEvent) => {\n const { detail: newToken } = event;\n storeRefreshToken(newToken);\n setToken(newToken);\n }\n );\n return cleanup;\n },\n [api, client, token]\n );\n\n const onLogin = useCallback(() => {\n setToken(readRefreshToken());\n }, []);\n\n const onLogout = useCallback(() => {\n storeRefreshToken(null);\n setToken(null);\n }, []);\n\n useBroadcastLoginListener(onLogin, onLogout);\n\n return (\n <RefreshTokenContext.Provider value={token}>\n {children}\n </RefreshTokenContext.Provider>\n );\n}\n\nexport default RefreshTokenBootstrap;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC/D,SAASC,MAAM,EAAEC,SAAS,QAAQ,4BAA4B;AAAC,OACxDC,yBAAyB;AAAA,SAE9BC,gBAAgB,EAChBC,mBAAmB,EACnBC,iBAAiB;AAAA;AAUnB;AACA;AACA;AACA,OAAO,SAASC,qBAAqB,OAEO;EAAA,IAFN;IACpCC;EAC0B,CAAC;EAC3B,IAAMC,GAAG,GAAGR,MAAM,EAAE;EACpB,IAAMS,MAAM,GAAGR,SAAS,EAAE;EAC1B,IAAM,CAACS,KAAK,EAAEC,QAAQ,CAAC,GAAGZ,QAAQ,CAACI,gBAAgB,EAAE,CAAC;EAEtDL,SAAS,CACP,SAASc,qBAAqB,GAAG;IAC/B,IAAMC,OAAO,GAAGJ,MAAM,CAACK,gBAAgB,CACrCN,GAAG,CAACO,UAAU,CAACC,2BAA2B,EACzCC,KAAkB,IAAK;MACtB,IAAM;QAAEC,MAAM,EAAEC;MAAS,CAAC,GAAGF,KAAK;MAClCZ,iBAAiB,CAACc,QAAQ,CAAC;MAC3BR,QAAQ,CAACQ,QAAQ,CAAC;IACpB,CAAC,CACF;IACD,OAAON,OAAO;EAChB,CAAC,EACD,CAACL,GAAG,EAAEC,MAAM,EAAEC,KAAK,CAAC,CACrB;EAED,IAAMU,OAAO,GAAGvB,WAAW,CAAC,MAAM;IAChCc,QAAQ,CAACR,gBAAgB,EAAE,CAAC;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,IAAMkB,QAAQ,GAAGxB,WAAW,CAAC,MAAM;IACjCQ,iBAAiB,CAAC,IAAI,CAAC;IACvBM,QAAQ,CAAC,IAAI,CAAC;EAChB,CAAC,EAAE,EAAE,CAAC;EAENT,yBAAyB,CAACkB,OAAO,EAAEC,QAAQ,CAAC;EAE5C,oBACE,KAAC,mBAAmB,CAAC,QAAQ;IAAC,KAAK,EAAEX,KAAM;IAAA,UACxCH;EAAQ,EACoB;AAEnC;AAEA,eAAeD,qBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshTokenUtils.d.ts","sourceRoot":"","sources":["../src/RefreshTokenUtils.ts"],"names":[],"mappings":";AAIA,eAAO,MAAM,iBAAiB,8CAA8C,CAAC;AAE7E,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D,eAAO,MAAM,mBAAmB,8CAA2C,CAAC;AAI5E;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,YAAY,GAAG,IAAI,CAUtD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,QAiB3D"}
1
+ {"version":3,"file":"RefreshTokenUtils.d.ts","sourceRoot":"","sources":["../src/RefreshTokenUtils.ts"],"names":[],"mappings":";AAIA,eAAO,MAAM,iBAAiB,8CAA8C,CAAC;AAE7E,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D,eAAO,MAAM,mBAAmB,8CAA2C,CAAC;AAI5E;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,YAAY,GAAG,IAAI,CAUtD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAiBlE"}
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshTokenUtils.js","names":["createContext","Cookies","Log","REFRESH_TOKEN_KEY","RefreshTokenContext","log","module","readRefreshToken","cookieToken","get","JSON","parse","e","error","storeRefreshToken","token","remove","stringify","bytes","expiry","expires","Date","set","secure","sameSite"],"sources":["../src/RefreshTokenUtils.ts"],"sourcesContent":["import { createContext } from 'react';\nimport Cookies from 'js-cookie';\nimport Log from '@deephaven/log';\n\nexport const REFRESH_TOKEN_KEY = 'io.deephaven.web.client.auth.refreshToken';\n\nexport type RefreshToken = { bytes: string; expiry: number };\n\nexport const RefreshTokenContext = createContext<RefreshToken | null>(null);\n\nconst log = Log.module('RefreshTokenUtils');\n\n/**\n * Read the refresh token from our cookie store\n * @returns RefreshToken if it exists, null otherwise\n */\nexport function readRefreshToken(): RefreshToken | null {\n const cookieToken = Cookies.get(REFRESH_TOKEN_KEY);\n try {\n if (cookieToken != null) {\n return JSON.parse(cookieToken);\n }\n } catch (e) {\n log.error('Error parsing refresh token', cookieToken, e);\n }\n return null;\n}\n\n/**\n * Store the provided refresh token as a cookie\n * @param token The refresh token to store\n */\nexport function storeRefreshToken(token: RefreshToken | null) {\n if (token == null) {\n Cookies.remove(REFRESH_TOKEN_KEY);\n return;\n }\n\n const cookieToken = JSON.stringify({\n bytes: token.bytes,\n expiry: token.expiry,\n });\n const expires = new Date(token.expiry);\n\n Cookies.set(REFRESH_TOKEN_KEY, cookieToken, {\n secure: true,\n sameSite: 'strict',\n expires,\n });\n}\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,OAAO;AACrC,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAOC,GAAG,MAAM,gBAAgB;AAEhC,OAAO,IAAMC,iBAAiB,GAAG,2CAA2C;AAI5E,OAAO,IAAMC,mBAAmB,gBAAGJ,aAAa,CAAsB,IAAI,CAAC;AAE3E,IAAMK,GAAG,GAAGH,GAAG,CAACI,MAAM,CAAC,mBAAmB,CAAC;;AAE3C;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgB,GAAwB;EACtD,IAAMC,WAAW,GAAGP,OAAO,CAACQ,GAAG,CAACN,iBAAiB,CAAC;EAClD,IAAI;IACF,IAAIK,WAAW,IAAI,IAAI,EAAE;MACvB,OAAOE,IAAI,CAACC,KAAK,CAACH,WAAW,CAAC;IAChC;EACF,CAAC,CAAC,OAAOI,CAAC,EAAE;IACVP,GAAG,CAACQ,KAAK,CAAC,6BAA6B,EAAEL,WAAW,EAAEI,CAAC,CAAC;EAC1D;EACA,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASE,iBAAiB,CAACC,KAA0B,EAAE;EAC5D,IAAIA,KAAK,IAAI,IAAI,EAAE;IACjBd,OAAO,CAACe,MAAM,CAACb,iBAAiB,CAAC;IACjC;EACF;EAEA,IAAMK,WAAW,GAAGE,IAAI,CAACO,SAAS,CAAC;IACjCC,KAAK,EAAEH,KAAK,CAACG,KAAK;IAClBC,MAAM,EAAEJ,KAAK,CAACI;EAChB,CAAC,CAAC;EACF,IAAMC,OAAO,GAAG,IAAIC,IAAI,CAACN,KAAK,CAACI,MAAM,CAAC;EAEtClB,OAAO,CAACqB,GAAG,CAACnB,iBAAiB,EAAEK,WAAW,EAAE;IAC1Ce,MAAM,EAAE,IAAI;IACZC,QAAQ,EAAE,QAAQ;IAClBJ;EACF,CAAC,CAAC;AACJ"}
1
+ {"version":3,"file":"RefreshTokenUtils.js","names":["createContext","Cookies","Log","REFRESH_TOKEN_KEY","RefreshTokenContext","log","module","readRefreshToken","cookieToken","get","JSON","parse","e","error","storeRefreshToken","token","remove","stringify","bytes","expiry","expires","Date","set","secure","sameSite"],"sources":["../src/RefreshTokenUtils.ts"],"sourcesContent":["import { createContext } from 'react';\nimport Cookies from 'js-cookie';\nimport Log from '@deephaven/log';\n\nexport const REFRESH_TOKEN_KEY = 'io.deephaven.web.client.auth.refreshToken';\n\nexport type RefreshToken = { bytes: string; expiry: number };\n\nexport const RefreshTokenContext = createContext<RefreshToken | null>(null);\n\nconst log = Log.module('RefreshTokenUtils');\n\n/**\n * Read the refresh token from our cookie store\n * @returns RefreshToken if it exists, null otherwise\n */\nexport function readRefreshToken(): RefreshToken | null {\n const cookieToken = Cookies.get(REFRESH_TOKEN_KEY);\n try {\n if (cookieToken != null) {\n return JSON.parse(cookieToken);\n }\n } catch (e) {\n log.error('Error parsing refresh token', cookieToken, e);\n }\n return null;\n}\n\n/**\n * Store the provided refresh token as a cookie\n * @param token The refresh token to store\n */\nexport function storeRefreshToken(token: RefreshToken | null): void {\n if (token == null) {\n Cookies.remove(REFRESH_TOKEN_KEY);\n return;\n }\n\n const cookieToken = JSON.stringify({\n bytes: token.bytes,\n expiry: token.expiry,\n });\n const expires = new Date(token.expiry);\n\n Cookies.set(REFRESH_TOKEN_KEY, cookieToken, {\n secure: true,\n sameSite: 'strict',\n expires,\n });\n}\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,OAAO;AACrC,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAOC,GAAG,MAAM,gBAAgB;AAEhC,OAAO,IAAMC,iBAAiB,GAAG,2CAA2C;AAI5E,OAAO,IAAMC,mBAAmB,gBAAGJ,aAAa,CAAsB,IAAI,CAAC;AAE3E,IAAMK,GAAG,GAAGH,GAAG,CAACI,MAAM,CAAC,mBAAmB,CAAC;;AAE3C;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgB,GAAwB;EACtD,IAAMC,WAAW,GAAGP,OAAO,CAACQ,GAAG,CAACN,iBAAiB,CAAC;EAClD,IAAI;IACF,IAAIK,WAAW,IAAI,IAAI,EAAE;MACvB,OAAOE,IAAI,CAACC,KAAK,CAACH,WAAW,CAAC;IAChC;EACF,CAAC,CAAC,OAAOI,CAAC,EAAE;IACVP,GAAG,CAACQ,KAAK,CAAC,6BAA6B,EAAEL,WAAW,EAAEI,CAAC,CAAC;EAC1D;EACA,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASE,iBAAiB,CAACC,KAA0B,EAAQ;EAClE,IAAIA,KAAK,IAAI,IAAI,EAAE;IACjBd,OAAO,CAACe,MAAM,CAACb,iBAAiB,CAAC;IACjC;EACF;EAEA,IAAMK,WAAW,GAAGE,IAAI,CAACO,SAAS,CAAC;IACjCC,KAAK,EAAEH,KAAK,CAACG,KAAK;IAClBC,MAAM,EAAEJ,KAAK,CAACI;EAChB,CAAC,CAAC;EACF,IAAMC,OAAO,GAAG,IAAIC,IAAI,CAACN,KAAK,CAACI,MAAM,CAAC;EAEtClB,OAAO,CAACqB,GAAG,CAACnB,iBAAiB,EAAEK,WAAW,EAAE;IAC1Ce,MAAM,EAAE,IAAI;IACZC,QAAQ,EAAE,QAAQ;IAClBJ;EACF,CAAC,CAAC;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"useBroadcastChannel.d.ts","sourceRoot":"","sources":["../src/useBroadcastChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,EACR,MAAM,wBAAwB,CAAC;AAOhC,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,CAAC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,IAAqB,EACzE,IAAI,SAAyB,oBA2B9B;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"useBroadcastChannel.d.ts","sourceRoot":"","sources":["../src/useBroadcastChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,EACR,MAAM,wBAAwB,CAAC;AAOhC,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,CAAC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,IAAqB,EACzE,IAAI,SAAyB,GAC5B,gBAAgB,CA0BlB;AAED,eAAe,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useBroadcastChannel.js","names":["BROADCAST_CHANNEL_NAME","isMessage","Log","EMPTY_FUNCTION","useEffect","useMemo","log","module","useBroadcastChannel","onEvent","name","channel","BroadcastChannel","close","handleEvent","event","data","debug","addEventListener","removeEventListener"],"sources":["../src/useBroadcastChannel.ts"],"sourcesContent":["import {\n BROADCAST_CHANNEL_NAME,\n isMessage,\n Message,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { EMPTY_FUNCTION } from '@deephaven/utils';\nimport { useEffect, useMemo } from 'react';\n\nconst log = Log.module('useBroadcastChannel');\n\nexport function useBroadcastChannel(\n onEvent: (event: MessageEvent<Message<unknown>>) => void = EMPTY_FUNCTION,\n name = BROADCAST_CHANNEL_NAME\n) {\n const channel = useMemo(() => new BroadcastChannel(name), [name]);\n useEffect(\n () => () => {\n channel.close();\n },\n [channel]\n );\n\n useEffect(() => {\n function handleEvent(event: MessageEvent) {\n const { data } = event;\n if (!isMessage(data)) {\n log.debug('Ignoring non-deephaven message', data);\n return;\n }\n log.debug('event received', data);\n onEvent(event);\n }\n channel.addEventListener('message', handleEvent);\n return () => {\n channel.removeEventListener('message', handleEvent);\n };\n }, [channel, onEvent]);\n\n return channel;\n}\n\nexport default useBroadcastChannel;\n"],"mappings":"AAAA,SACEA,sBAAsB,EACtBC,SAAS,QAEJ,wBAAwB;AAC/B,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAE1C,IAAMC,GAAG,GAAGJ,GAAG,CAACK,MAAM,CAAC,qBAAqB,CAAC;AAE7C,OAAO,SAASC,mBAAmB,GAGjC;EAAA,IAFAC,OAAwD,uEAAGN,cAAc;EAAA,IACzEO,IAAI,uEAAGV,sBAAsB;EAE7B,IAAMW,OAAO,GAAGN,OAAO,CAAC,MAAM,IAAIO,gBAAgB,CAACF,IAAI,CAAC,EAAE,CAACA,IAAI,CAAC,CAAC;EACjEN,SAAS,CACP,MAAM,MAAM;IACVO,OAAO,CAACE,KAAK,EAAE;EACjB,CAAC,EACD,CAACF,OAAO,CAAC,CACV;EAEDP,SAAS,CAAC,MAAM;IACd,SAASU,WAAW,CAACC,KAAmB,EAAE;MACxC,IAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK;MACtB,IAAI,CAACd,SAAS,CAACe,IAAI,CAAC,EAAE;QACpBV,GAAG,CAACW,KAAK,CAAC,gCAAgC,EAAED,IAAI,CAAC;QACjD;MACF;MACAV,GAAG,CAACW,KAAK,CAAC,gBAAgB,EAAED,IAAI,CAAC;MACjCP,OAAO,CAACM,KAAK,CAAC;IAChB;IACAJ,OAAO,CAACO,gBAAgB,CAAC,SAAS,EAAEJ,WAAW,CAAC;IAChD,OAAO,MAAM;MACXH,OAAO,CAACQ,mBAAmB,CAAC,SAAS,EAAEL,WAAW,CAAC;IACrD,CAAC;EACH,CAAC,EAAE,CAACH,OAAO,EAAEF,OAAO,CAAC,CAAC;EAEtB,OAAOE,OAAO;AAChB;AAEA,eAAeH,mBAAmB"}
1
+ {"version":3,"file":"useBroadcastChannel.js","names":["BROADCAST_CHANNEL_NAME","isMessage","Log","EMPTY_FUNCTION","useEffect","useMemo","log","module","useBroadcastChannel","onEvent","name","channel","BroadcastChannel","close","handleEvent","event","data","debug","addEventListener","removeEventListener"],"sources":["../src/useBroadcastChannel.ts"],"sourcesContent":["import {\n BROADCAST_CHANNEL_NAME,\n isMessage,\n Message,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { EMPTY_FUNCTION } from '@deephaven/utils';\nimport { useEffect, useMemo } from 'react';\n\nconst log = Log.module('useBroadcastChannel');\n\nexport function useBroadcastChannel(\n onEvent: (event: MessageEvent<Message<unknown>>) => void = EMPTY_FUNCTION,\n name = BROADCAST_CHANNEL_NAME\n): BroadcastChannel {\n const channel = useMemo(() => new BroadcastChannel(name), [name]);\n useEffect(\n () => () => {\n channel.close();\n },\n [channel]\n );\n\n useEffect(() => {\n function handleEvent(event: MessageEvent): void {\n const { data } = event;\n if (!isMessage(data)) {\n log.debug('Ignoring non-deephaven message', data);\n return;\n }\n log.debug('event received', data);\n onEvent(event);\n }\n channel.addEventListener('message', handleEvent);\n return () => {\n channel.removeEventListener('message', handleEvent);\n };\n }, [channel, onEvent]);\n\n return channel;\n}\n\nexport default useBroadcastChannel;\n"],"mappings":"AAAA,SACEA,sBAAsB,EACtBC,SAAS,QAEJ,wBAAwB;AAC/B,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAE1C,IAAMC,GAAG,GAAGJ,GAAG,CAACK,MAAM,CAAC,qBAAqB,CAAC;AAE7C,OAAO,SAASC,mBAAmB,GAGf;EAAA,IAFlBC,OAAwD,uEAAGN,cAAc;EAAA,IACzEO,IAAI,uEAAGV,sBAAsB;EAE7B,IAAMW,OAAO,GAAGN,OAAO,CAAC,MAAM,IAAIO,gBAAgB,CAACF,IAAI,CAAC,EAAE,CAACA,IAAI,CAAC,CAAC;EACjEN,SAAS,CACP,MAAM,MAAM;IACVO,OAAO,CAACE,KAAK,EAAE;EACjB,CAAC,EACD,CAACF,OAAO,CAAC,CACV;EAEDP,SAAS,CAAC,MAAM;IACd,SAASU,WAAW,CAACC,KAAmB,EAAQ;MAC9C,IAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK;MACtB,IAAI,CAACd,SAAS,CAACe,IAAI,CAAC,EAAE;QACpBV,GAAG,CAACW,KAAK,CAAC,gCAAgC,EAAED,IAAI,CAAC;QACjD;MACF;MACAV,GAAG,CAACW,KAAK,CAAC,gBAAgB,EAAED,IAAI,CAAC;MACjCP,OAAO,CAACM,KAAK,CAAC;IAChB;IACAJ,OAAO,CAACO,gBAAgB,CAAC,SAAS,EAAEJ,WAAW,CAAC;IAChD,OAAO,MAAM;MACXH,OAAO,CAACQ,mBAAmB,CAAC,SAAS,EAAEL,WAAW,CAAC;IACrD,CAAC;EACH,CAAC,EAAE,CAACH,OAAO,EAAEF,OAAO,CAAC,CAAC;EAEtB,OAAOE,OAAO;AAChB;AAEA,eAAeH,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useBroadcastLoginListener.d.ts","sourceRoot":"","sources":["../src/useBroadcastLoginListener.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EAIvB,MAAM,wBAAwB,CAAC;AAIhC,wBAAgB,yBAAyB,CACvC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,IAAI,EAClD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,IAAI,QAcrD;AAED,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"useBroadcastLoginListener.d.ts","sourceRoot":"","sources":["../src/useBroadcastLoginListener.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EAIvB,MAAM,wBAAwB,CAAC;AAIhC,wBAAgB,yBAAyB,CACvC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,IAAI,EAClD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,IAAI,GACnD,IAAI,CAaN;AAED,eAAe,yBAAyB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useBroadcastLoginListener.js","names":["isBroadcastLoginMessage","isBroadcastLogoutMessage","useCallback","useBroadcastChannel","useBroadcastLoginListener","onLogin","onLogout","onMessage","event","data"],"sources":["../src/useBroadcastLoginListener.ts"],"sourcesContent":["import {\n BroadcastLoginMessage,\n BroadcastLogoutMessage,\n isBroadcastLoginMessage,\n isBroadcastLogoutMessage,\n Message,\n} from '@deephaven/jsapi-utils';\nimport { useCallback } from 'react';\nimport useBroadcastChannel from './useBroadcastChannel';\n\nexport function useBroadcastLoginListener(\n onLogin?: (message: BroadcastLoginMessage) => void,\n onLogout?: (message: BroadcastLogoutMessage) => void\n) {\n const onMessage = useCallback(\n (event: MessageEvent<Message<unknown>>) => {\n if (isBroadcastLoginMessage(event.data)) {\n onLogin?.(event.data);\n } else if (isBroadcastLogoutMessage(event.data)) {\n onLogout?.(event.data);\n }\n },\n [onLogin, onLogout]\n );\n\n useBroadcastChannel(onMessage);\n}\n\nexport default useBroadcastLoginListener;\n"],"mappings":"AAAA,SAGEA,uBAAuB,EACvBC,wBAAwB,QAEnB,wBAAwB;AAC/B,SAASC,WAAW,QAAQ,OAAO;AAAC,OAC7BC,mBAAmB;AAE1B,OAAO,SAASC,yBAAyB,CACvCC,OAAkD,EAClDC,QAAoD,EACpD;EACA,IAAMC,SAAS,GAAGL,WAAW,CAC1BM,KAAqC,IAAK;IACzC,IAAIR,uBAAuB,CAACQ,KAAK,CAACC,IAAI,CAAC,EAAE;MACvCJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAGG,KAAK,CAACC,IAAI,CAAC;IACvB,CAAC,MAAM,IAAIR,wBAAwB,CAACO,KAAK,CAACC,IAAI,CAAC,EAAE;MAC/CH,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGE,KAAK,CAACC,IAAI,CAAC;IACxB;EACF,CAAC,EACD,CAACJ,OAAO,EAAEC,QAAQ,CAAC,CACpB;EAEDH,mBAAmB,CAACI,SAAS,CAAC;AAChC;AAEA,eAAeH,yBAAyB"}
1
+ {"version":3,"file":"useBroadcastLoginListener.js","names":["isBroadcastLoginMessage","isBroadcastLogoutMessage","useCallback","useBroadcastChannel","useBroadcastLoginListener","onLogin","onLogout","onMessage","event","data"],"sources":["../src/useBroadcastLoginListener.ts"],"sourcesContent":["import {\n BroadcastLoginMessage,\n BroadcastLogoutMessage,\n isBroadcastLoginMessage,\n isBroadcastLogoutMessage,\n Message,\n} from '@deephaven/jsapi-utils';\nimport { useCallback } from 'react';\nimport useBroadcastChannel from './useBroadcastChannel';\n\nexport function useBroadcastLoginListener(\n onLogin?: (message: BroadcastLoginMessage) => void,\n onLogout?: (message: BroadcastLogoutMessage) => void\n): void {\n const onMessage = useCallback(\n (event: MessageEvent<Message<unknown>>) => {\n if (isBroadcastLoginMessage(event.data)) {\n onLogin?.(event.data);\n } else if (isBroadcastLogoutMessage(event.data)) {\n onLogout?.(event.data);\n }\n },\n [onLogin, onLogout]\n );\n\n useBroadcastChannel(onMessage);\n}\n\nexport default useBroadcastLoginListener;\n"],"mappings":"AAAA,SAGEA,uBAAuB,EACvBC,wBAAwB,QAEnB,wBAAwB;AAC/B,SAASC,WAAW,QAAQ,OAAO;AAAC,OAC7BC,mBAAmB;AAE1B,OAAO,SAASC,yBAAyB,CACvCC,OAAkD,EAClDC,QAAoD,EAC9C;EACN,IAAMC,SAAS,GAAGL,WAAW,CAC1BM,KAAqC,IAAK;IACzC,IAAIR,uBAAuB,CAACQ,KAAK,CAACC,IAAI,CAAC,EAAE;MACvCJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAGG,KAAK,CAACC,IAAI,CAAC;IACvB,CAAC,MAAM,IAAIR,wBAAwB,CAACO,KAAK,CAACC,IAAI,CAAC,EAAE;MAC/CH,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGE,KAAK,CAACC,IAAI,CAAC;IACxB;EACF,CAAC,EACD,CAACJ,OAAO,EAAEC,QAAQ,CAAC,CACpB;EAEDH,mBAAmB,CAACI,SAAS,CAAC;AAChC;AAEA,eAAeH,yBAAyB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetItemPosition.d.ts","sourceRoot":"","sources":["../src/useGetItemPosition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,UAAU,EACV,YAAY,EACZ,UAAU,EACV,SAAa,EACb,KAAK,GACN,EAAE,yBAAyB,yBAc3B;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"useGetItemPosition.d.ts","sourceRoot":"","sources":["../src/useGetItemPosition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,UAAU,EACV,YAAY,EACZ,UAAU,EACV,SAAa,EACb,KAAK,GACN,EAAE,yBAAyB,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAcnD;AAED,eAAe,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGetItemPosition.js","names":["useCallback","useGetItemPosition","table","columnName","defaultValue","itemHeight","topOffset","value","column","findColumn","rowIndex","seekRow","defaultItemOffset"],"sources":["../src/useGetItemPosition.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport type { Table } from '@deephaven/jsapi-types';\n\nexport interface UseGetItemPositionOptions {\n table?: Table | null;\n columnName: string;\n defaultValue?: string | null;\n itemHeight: number;\n topOffset?: number;\n value: string;\n}\n\n/**\n * Gets an item's position in a list of items based on its row index in a table.\n * @param table Table to search for the item in\n * @param columnName Column name to search for the item in\n * @param defaultValue Optional default value. This would be the first item in\n * the list and not expected to be in the Table.\n * @param itemHeight Height of each item in the list\n * @param topOffset Optional pixel offset from the top of the list\n * @param value Value to search for in the column\n */\nexport function useGetItemPosition({\n table,\n columnName,\n defaultValue,\n itemHeight,\n topOffset = 0,\n value,\n}: UseGetItemPositionOptions) {\n return useCallback(async () => {\n if (table == null || value === '' || value === defaultValue) {\n return topOffset;\n }\n\n const column = table.findColumn(columnName);\n const rowIndex = await table.seekRow(0, column, 'String', value);\n\n // If a default item exists at the top of the list, offset the item index by 1\n const defaultItemOffset = defaultValue == null ? 0 : 1;\n\n return (rowIndex + defaultItemOffset) * itemHeight + topOffset;\n }, [columnName, defaultValue, itemHeight, table, topOffset, value]);\n}\n\nexport default useGetItemPosition;\n"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AAYnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkB,OAOJ;EAAA,IAPK;IACjCC,KAAK;IACLC,UAAU;IACVC,YAAY;IACZC,UAAU;IACVC,SAAS,GAAG,CAAC;IACbC;EACyB,CAAC;EAC1B,OAAOP,WAAW,iCAAC,aAAY;IAC7B,IAAIE,KAAK,IAAI,IAAI,IAAIK,KAAK,KAAK,EAAE,IAAIA,KAAK,KAAKH,YAAY,EAAE;MAC3D,OAAOE,SAAS;IAClB;IAEA,IAAME,MAAM,GAAGN,KAAK,CAACO,UAAU,CAACN,UAAU,CAAC;IAC3C,IAAMO,QAAQ,SAASR,KAAK,CAACS,OAAO,CAAC,CAAC,EAAEH,MAAM,EAAE,QAAQ,EAAED,KAAK,CAAC;;IAEhE;IACA,IAAMK,iBAAiB,GAAGR,YAAY,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC;IAEtD,OAAO,CAACM,QAAQ,GAAGE,iBAAiB,IAAIP,UAAU,GAAGC,SAAS;EAChE,CAAC,GAAE,CAACH,UAAU,EAAEC,YAAY,EAAEC,UAAU,EAAEH,KAAK,EAAEI,SAAS,EAAEC,KAAK,CAAC,CAAC;AACrE;AAEA,eAAeN,kBAAkB"}
1
+ {"version":3,"file":"useGetItemPosition.js","names":["useCallback","useGetItemPosition","table","columnName","defaultValue","itemHeight","topOffset","value","column","findColumn","rowIndex","seekRow","defaultItemOffset"],"sources":["../src/useGetItemPosition.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport type { Table } from '@deephaven/jsapi-types';\n\nexport interface UseGetItemPositionOptions {\n table?: Table | null;\n columnName: string;\n defaultValue?: string | null;\n itemHeight: number;\n topOffset?: number;\n value: string;\n}\n\n/**\n * Gets an item's position in a list of items based on its row index in a table.\n * @param table Table to search for the item in\n * @param columnName Column name to search for the item in\n * @param defaultValue Optional default value. This would be the first item in\n * the list and not expected to be in the Table.\n * @param itemHeight Height of each item in the list\n * @param topOffset Optional pixel offset from the top of the list\n * @param value Value to search for in the column\n */\nexport function useGetItemPosition({\n table,\n columnName,\n defaultValue,\n itemHeight,\n topOffset = 0,\n value,\n}: UseGetItemPositionOptions): () => Promise<number> {\n return useCallback(async () => {\n if (table == null || value === '' || value === defaultValue) {\n return topOffset;\n }\n\n const column = table.findColumn(columnName);\n const rowIndex = await table.seekRow(0, column, 'String', value);\n\n // If a default item exists at the top of the list, offset the item index by 1\n const defaultItemOffset = defaultValue == null ? 0 : 1;\n\n return (rowIndex + defaultItemOffset) * itemHeight + topOffset;\n }, [columnName, defaultValue, itemHeight, table, topOffset, value]);\n}\n\nexport default useGetItemPosition;\n"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AAYnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkB,OAOmB;EAAA,IAPlB;IACjCC,KAAK;IACLC,UAAU;IACVC,YAAY;IACZC,UAAU;IACVC,SAAS,GAAG,CAAC;IACbC;EACyB,CAAC;EAC1B,OAAOP,WAAW,iCAAC,aAAY;IAC7B,IAAIE,KAAK,IAAI,IAAI,IAAIK,KAAK,KAAK,EAAE,IAAIA,KAAK,KAAKH,YAAY,EAAE;MAC3D,OAAOE,SAAS;IAClB;IAEA,IAAME,MAAM,GAAGN,KAAK,CAACO,UAAU,CAACN,UAAU,CAAC;IAC3C,IAAMO,QAAQ,SAASR,KAAK,CAACS,OAAO,CAAC,CAAC,EAAEH,MAAM,EAAE,QAAQ,EAAED,KAAK,CAAC;;IAEhE;IACA,IAAMK,iBAAiB,GAAGR,YAAY,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC;IAEtD,OAAO,CAACM,QAAQ,GAAGE,iBAAiB,IAAIP,UAAU,GAAGC,SAAS;EAChE,CAAC,GAAE,CAACH,UAAU,EAAEC,YAAY,EAAEC,UAAU,EAAEH,KAAK,EAAEI,SAAS,EAAEC,KAAK,CAAC,CAAC;AACrE;AAEA,eAAeN,kBAAkB"}
@@ -1,3 +1,4 @@
1
- export declare function useNotNullOrEmptyFilter(columnNames: string | string[], conditionOperator?: 'and' | 'or'): import("@deephaven/jsapi-utils").FilterConditionFactory;
1
+ import { FilterConditionFactory } from '@deephaven/jsapi-utils';
2
+ export declare function useNotNullOrEmptyFilter(columnNames: string | string[], conditionOperator?: 'and' | 'or'): FilterConditionFactory;
2
3
  export default useNotNullOrEmptyFilter;
3
4
  //# sourceMappingURL=useNotNullOrEmptyFilter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNotNullOrEmptyFilter.d.ts","sourceRoot":"","sources":["../src/useNotNullOrEmptyFilter.ts"],"names":[],"mappings":"AAOA,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,EAC9B,iBAAiB,GAAE,KAAK,GAAG,IAAW,2DAkBvC;AAED,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"useNotNullOrEmptyFilter.d.ts","sourceRoot":"","sources":["../src/useNotNullOrEmptyFilter.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAGhC,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,EAC9B,iBAAiB,GAAE,KAAK,GAAG,IAAW,GACrC,sBAAsB,CAiBxB;AAED,eAAe,uBAAuB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useNotNullOrEmptyFilter.js","names":["useMemo","createFilterConditionFactory","createNotNullOrEmptyFilterCondition","useTableUtils","useNotNullOrEmptyFilter","columnNames","conditionOperator","tableUtils","notNullOrEmptyFilterCondition"],"sources":["../src/useNotNullOrEmptyFilter.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n createFilterConditionFactory,\n createNotNullOrEmptyFilterCondition,\n} from '@deephaven/jsapi-utils';\nimport useTableUtils from './useTableUtils';\n\nexport function useNotNullOrEmptyFilter(\n columnNames: string | string[],\n conditionOperator: 'and' | 'or' = 'or'\n) {\n const tableUtils = useTableUtils();\n\n const notNullOrEmptyFilterCondition = useMemo(\n () => createNotNullOrEmptyFilterCondition(tableUtils),\n [tableUtils]\n );\n\n return useMemo(\n () =>\n createFilterConditionFactory(\n columnNames,\n notNullOrEmptyFilterCondition,\n conditionOperator\n ),\n [columnNames, conditionOperator, notNullOrEmptyFilterCondition]\n );\n}\n\nexport default useNotNullOrEmptyFilter;\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SACEC,4BAA4B,EAC5BC,mCAAmC,QAC9B,wBAAwB;AAAC,OACzBC,aAAa;AAEpB,OAAO,SAASC,uBAAuB,CACrCC,WAA8B,EAE9B;EAAA,IADAC,iBAA+B,uEAAG,IAAI;EAEtC,IAAMC,UAAU,GAAGJ,aAAa,EAAE;EAElC,IAAMK,6BAA6B,GAAGR,OAAO,CAC3C,MAAME,mCAAmC,CAACK,UAAU,CAAC,EACrD,CAACA,UAAU,CAAC,CACb;EAED,OAAOP,OAAO,CACZ,MACEC,4BAA4B,CAC1BI,WAAW,EACXG,6BAA6B,EAC7BF,iBAAiB,CAClB,EACH,CAACD,WAAW,EAAEC,iBAAiB,EAAEE,6BAA6B,CAAC,CAChE;AACH;AAEA,eAAeJ,uBAAuB"}
1
+ {"version":3,"file":"useNotNullOrEmptyFilter.js","names":["useMemo","createFilterConditionFactory","createNotNullOrEmptyFilterCondition","useTableUtils","useNotNullOrEmptyFilter","columnNames","conditionOperator","tableUtils","notNullOrEmptyFilterCondition"],"sources":["../src/useNotNullOrEmptyFilter.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n createFilterConditionFactory,\n createNotNullOrEmptyFilterCondition,\n FilterConditionFactory,\n} from '@deephaven/jsapi-utils';\nimport useTableUtils from './useTableUtils';\n\nexport function useNotNullOrEmptyFilter(\n columnNames: string | string[],\n conditionOperator: 'and' | 'or' = 'or'\n): FilterConditionFactory {\n const tableUtils = useTableUtils();\n\n const notNullOrEmptyFilterCondition = useMemo(\n () => createNotNullOrEmptyFilterCondition(tableUtils),\n [tableUtils]\n );\n\n return useMemo(\n () =>\n createFilterConditionFactory(\n columnNames,\n notNullOrEmptyFilterCondition,\n conditionOperator\n ),\n [columnNames, conditionOperator, notNullOrEmptyFilterCondition]\n );\n}\n\nexport default useNotNullOrEmptyFilter;\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SACEC,4BAA4B,EAC5BC,mCAAmC,QAE9B,wBAAwB;AAAC,OACzBC,aAAa;AAEpB,OAAO,SAASC,uBAAuB,CACrCC,WAA8B,EAEN;EAAA,IADxBC,iBAA+B,uEAAG,IAAI;EAEtC,IAAMC,UAAU,GAAGJ,aAAa,EAAE;EAElC,IAAMK,6BAA6B,GAAGR,OAAO,CAC3C,MAAME,mCAAmC,CAACK,UAAU,CAAC,EACrD,CAACA,UAAU,CAAC,CACb;EAED,OAAOP,OAAO,CACZ,MACEC,4BAA4B,CAC1BI,WAAW,EACXG,6BAA6B,EAC7BF,iBAAiB,CAClB,EACH,CAACD,WAAW,EAAEC,iBAAiB,EAAEE,6BAA6B,CAAC,CAChE;AACH;AAEA,eAAeJ,uBAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSetPaddedViewportCallback.d.ts","sourceRoot":"","sources":["../src/useSetPaddedViewportCallback.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAG/D;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI,EAC/B,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,cAGgB,MAAM,UAY9C;AAED,eAAe,4BAA4B,CAAC"}
1
+ {"version":3,"file":"useSetPaddedViewportCallback.d.ts","sourceRoot":"","sources":["../src/useSetPaddedViewportCallback.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAG/D;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI,EAC/B,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,GACtB,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAc5B;AAED,eAAe,4BAA4B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSetPaddedViewportCallback.js","names":["useCallback","getSize","padFirstAndLastRow","useSetPaddedViewportCallback","table","viewportSize","viewportPadding","setPaddedViewport","firstRow","first","last","setViewport"],"sources":["../src/useSetPaddedViewportCallback.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport type { Table, TreeTable } from '@deephaven/jsapi-types';\nimport { getSize, padFirstAndLastRow } from '@deephaven/jsapi-utils';\n\n/**\n * Creates a callback function that will set a Table viewport. The callback has\n * a closure over the Table, a desired viewport size, and additional padding.\n * These will be combined with a first row index passed to the callback to\n * calculate the final viewport.\n * @param table Table to call `setViewport` on.\n * @param viewportSize The desired viewport size.\n * @param viewportPadding Padding to add before and after the viewport.\n * @returns A callback function for setting the viewport.\n */\nexport function useSetPaddedViewportCallback(\n table: Table | TreeTable | null,\n viewportSize: number,\n viewportPadding: number\n) {\n return useCallback(\n function setPaddedViewport(firstRow: number) {\n const [first, last] = padFirstAndLastRow(\n firstRow,\n viewportSize,\n viewportPadding,\n getSize(table)\n );\n\n table?.setViewport(first, last);\n },\n [table, viewportPadding, viewportSize]\n );\n}\n\nexport default useSetPaddedViewportCallback;\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AAEnC,SAASC,OAAO,EAAEC,kBAAkB,QAAQ,wBAAwB;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4B,CAC1CC,KAA+B,EAC/BC,YAAoB,EACpBC,eAAuB,EACvB;EACA,OAAON,WAAW,CAChB,SAASO,iBAAiB,CAACC,QAAgB,EAAE;IAC3C,IAAM,CAACC,KAAK,EAAEC,IAAI,CAAC,GAAGR,kBAAkB,CACtCM,QAAQ,EACRH,YAAY,EACZC,eAAe,EACfL,OAAO,CAACG,KAAK,CAAC,CACf;IAEDA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEO,WAAW,CAACF,KAAK,EAAEC,IAAI,CAAC;EACjC,CAAC,EACD,CAACN,KAAK,EAAEE,eAAe,EAAED,YAAY,CAAC,CACvC;AACH;AAEA,eAAeF,4BAA4B"}
1
+ {"version":3,"file":"useSetPaddedViewportCallback.js","names":["useCallback","getSize","padFirstAndLastRow","useSetPaddedViewportCallback","table","viewportSize","viewportPadding","setPaddedViewport","firstRow","first","last","setViewport"],"sources":["../src/useSetPaddedViewportCallback.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport type { Table, TreeTable } from '@deephaven/jsapi-types';\nimport { getSize, padFirstAndLastRow } from '@deephaven/jsapi-utils';\n\n/**\n * Creates a callback function that will set a Table viewport. The callback has\n * a closure over the Table, a desired viewport size, and additional padding.\n * These will be combined with a first row index passed to the callback to\n * calculate the final viewport.\n * @param table Table to call `setViewport` on.\n * @param viewportSize The desired viewport size.\n * @param viewportPadding Padding to add before and after the viewport.\n * @returns A callback function for setting the viewport.\n */\nexport function useSetPaddedViewportCallback(\n table: Table | TreeTable | null,\n viewportSize: number,\n viewportPadding: number\n): (firstRow: number) => void {\n return useCallback(\n function setPaddedViewport(firstRow: number) {\n const [first, last] = padFirstAndLastRow(\n firstRow,\n viewportSize,\n viewportPadding,\n getSize(table)\n );\n\n table?.setViewport(first, last);\n },\n [table, viewportPadding, viewportSize]\n );\n}\n\nexport default useSetPaddedViewportCallback;\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AAEnC,SAASC,OAAO,EAAEC,kBAAkB,QAAQ,wBAAwB;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4B,CAC1CC,KAA+B,EAC/BC,YAAoB,EACpBC,eAAuB,EACK;EAC5B,OAAON,WAAW,CAChB,SAASO,iBAAiB,CAACC,QAAgB,EAAE;IAC3C,IAAM,CAACC,KAAK,EAAEC,IAAI,CAAC,GAAGR,kBAAkB,CACtCM,QAAQ,EACRH,YAAY,EACZC,eAAe,EACfL,OAAO,CAACG,KAAK,CAAC,CACf;IAEDA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEO,WAAW,CAACF,KAAK,EAAEC,IAAI,CAAC;EACjC,CAAC,EACD,CAACN,KAAK,EAAEE,eAAe,EAAED,YAAY,CAAC,CACvC;AACH;AAEA,eAAeF,4BAA4B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/jsapi-components",
3
- "version": "0.48.1-beta.0+302d1c2f",
3
+ "version": "0.48.1-beta.1+32e6d208",
4
4
  "description": "Deephaven JSAPI Components",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -22,13 +22,13 @@
22
22
  "build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
23
23
  },
24
24
  "dependencies": {
25
- "@deephaven/components": "^0.48.1-beta.0+302d1c2f",
26
- "@deephaven/jsapi-bootstrap": "^0.48.1-beta.0+302d1c2f",
27
- "@deephaven/jsapi-types": "^0.48.1-beta.0+302d1c2f",
28
- "@deephaven/jsapi-utils": "^0.48.1-beta.0+302d1c2f",
29
- "@deephaven/log": "^0.48.1-beta.0+302d1c2f",
30
- "@deephaven/react-hooks": "^0.48.1-beta.0+302d1c2f",
31
- "@deephaven/utils": "^0.48.1-beta.0+302d1c2f",
25
+ "@deephaven/components": "^0.48.1-beta.1+32e6d208",
26
+ "@deephaven/jsapi-bootstrap": "^0.48.1-beta.1+32e6d208",
27
+ "@deephaven/jsapi-types": "^0.48.1-beta.1+32e6d208",
28
+ "@deephaven/jsapi-utils": "^0.48.1-beta.1+32e6d208",
29
+ "@deephaven/log": "^0.48.1-beta.1+32e6d208",
30
+ "@deephaven/react-hooks": "^0.48.1-beta.1+32e6d208",
31
+ "@deephaven/utils": "^0.48.1-beta.1+32e6d208",
32
32
  "@types/js-cookie": "^3.0.3",
33
33
  "classnames": "^2.3.2",
34
34
  "js-cookie": "^3.0.5",
@@ -36,7 +36,7 @@
36
36
  "prop-types": "^15.8.1"
37
37
  },
38
38
  "devDependencies": {
39
- "@deephaven/jsapi-shim": "^0.48.1-beta.0+302d1c2f",
39
+ "@deephaven/jsapi-shim": "^0.48.1-beta.1+32e6d208",
40
40
  "react-test-renderer": "^17.0.2"
41
41
  },
42
42
  "peerDependencies": {
@@ -51,5 +51,5 @@
51
51
  "publishConfig": {
52
52
  "access": "public"
53
53
  },
54
- "gitHead": "302d1c2f1af98161da2931ac3413f14938deb257"
54
+ "gitHead": "32e6d208d0977092f315caa122b8ab23f0fc110a"
55
55
  }