@tellescope/react-components 1.182.0 → 1.183.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellescope/react-components",
3
- "version": "1.182.0",
3
+ "version": "1.183.0",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -47,13 +47,13 @@
47
47
  "@reduxjs/toolkit": "^1.6.2",
48
48
  "@stripe/react-stripe-js": "^2.9.0",
49
49
  "@stripe/stripe-js": "^1.52.1",
50
- "@tellescope/constants": "^1.182.0",
51
- "@tellescope/sdk": "^1.182.0",
52
- "@tellescope/types-client": "^1.182.0",
53
- "@tellescope/types-models": "^1.182.0",
54
- "@tellescope/types-utilities": "^1.182.0",
55
- "@tellescope/utilities": "^1.182.0",
56
- "@tellescope/validation": "^1.182.0",
50
+ "@tellescope/constants": "^1.183.0",
51
+ "@tellescope/sdk": "^1.183.0",
52
+ "@tellescope/types-client": "^1.183.0",
53
+ "@tellescope/types-models": "^1.183.0",
54
+ "@tellescope/types-utilities": "^1.183.0",
55
+ "@tellescope/utilities": "^1.183.0",
56
+ "@tellescope/validation": "^1.183.0",
57
57
  "@typescript-eslint/eslint-plugin": "^4.33.0",
58
58
  "@typescript-eslint/parser": "^4.33.0",
59
59
  "css-to-react-native": "^3.0.0",
@@ -84,7 +84,7 @@
84
84
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
85
85
  "react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
86
86
  },
87
- "gitHead": "76fbac14a3c471a878c803d7be06c3179e62b385",
87
+ "gitHead": "1b65f936169b011cfd20179c25625af7a6f34cba",
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  }
package/src/forms.tsx CHANGED
@@ -226,14 +226,15 @@ interface LoadingButtonProps extends SubmitButtonOptions {
226
226
  uniquenessError?: string,
227
227
  onError?: OnApiError,
228
228
  onClick?: ((...args: any[]) => void) | (() => Promise<any>),
229
+ muiColor?: string,
229
230
  }
230
- export const LoadingButton = ({ disabled, uniquenessError, throwOnError, variant="contained", onError, submitting, onClick, submitText="Submit", submittingText="Submitting", type, style={ marginTop: 5, width: '100%' } }: LoadingButtonProps & Styled & { type?: 'submit'}) => {
231
+ export const LoadingButton = ({ muiColor, disabled, uniquenessError, throwOnError, variant="contained", onError, submitting, onClick, submitText="Submit", submittingText="Submitting", type, style={ marginTop: 5, width: '100%' } }: LoadingButtonProps & Styled & { type?: 'submit'}) => {
231
232
  const { errorDisplay, handleAPIError, loading } = useHandleError({ onError, uniquenessError })
232
233
  const formLoading = React.useContext(WithHTMLFormContext)?.loading
233
234
 
234
235
  return (
235
236
  <>
236
- <Button color="primary" variant={variant} type={type} onClick={() => handleAPIError(async () => {
237
+ <Button color={muiColor as any || "primary"} variant={variant} type={type} onClick={() => handleAPIError(async () => {
237
238
  if (!onClick) return
238
239
  await onClick()
239
240
  })}
@@ -394,8 +394,14 @@ export const ModelSearchInput = <T,>({
394
394
 
395
395
  ...props
396
396
  } : ModelSearchProps<T>) => {
397
+ let dontPersist = false
398
+ try { // may fail to load if enduser session
399
+ const [organizationLoading] = useOrganization()
400
+ dontPersist = !!(value_is_loaded(organizationLoading) ? organizationLoading.value?.settings?.interface?.dontPersistSearches : undefined )
401
+ } catch(err) {}
402
+
397
403
  const cacheKey = `search-cache-${filterKey}`
398
- const [_query, _setQuery] = useState(read_local_storage(cacheKey) || '')
404
+ const [_query, _setQuery] = useState(dontPersist ? '' : (read_local_storage(cacheKey) || ''))
399
405
 
400
406
  const query = value ?? _query
401
407
  const setQuery = onChange ?? _setQuery