@deephaven/jsapi-components 0.60.1-beta.5 → 0.60.1-object-fetcher.6

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,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../src/TableInput.scss","../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;AC6LA;AC1LE;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA,aCRO","file":"TableInput.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n@import './util.scss';\n","// Styling overrides for bootstrap\n@use 'sass:map';\n\n// Override / set color variables\n$red: var(--dh-color-visual-red);\n$orange: var(--dh-color-visual-orange);\n$yellow: var(--dh-color-visual-yellow);\n$green: var(--dh-color-visual-green);\n$blue: var(--dh-color-visual-blue);\n$purple: var(--dh-color-visual-purple);\n\n// Fallback colors are used if theme isn't loaded\n// this is required for error messages if the API doesn't load\n\n//Define our Gray scale\n$gray-100: var(--dh-color-gray-900, #fcfcfa);\n$gray-200: var(--dh-color-gray-800);\n$gray-300: var(--dh-color-gray-700);\n$gray-400: var(--dh-color-gray-600);\n$gray-500: var(--dh-color-gray-500);\n// intentional duplicate, scale doesn't line up otherwise\n// as we have gray-850 and spectrum doesn't and it is needed\n$gray-600: var(--dh-color-gray-500);\n$gray-700: var(--dh-color-gray-400);\n$gray-800: var(--dh-color-gray-300);\n$gray-850: var(--dh-color-gray-200);\n$gray-900: var(--dh-color-gray-75);\n$black: var(--dh-color-black, #1a171a);\n$white: var(--dh-color-white, #f0f0ee);\n\n//Define some UI colors\n$interfacegray: var(--dh-color-content-bg, #2d2a2e);\n$interfaceblue: var(--dh-color-accent-bg);\n$interfacewhite: $white;\n$interfaceblack: $black;\n$content-bg: var(--dh-color-content-bg, #2d2a2e);\n$background: var(--dh-color-bg, #1a171a);\n$foreground: var(--dh-color-fg, #f0f0ee);\n\n// Extend default Bootstrap $grays map\n$grays-custom: (\n '850': $gray-850,\n);\n$grays: () !default;\n$grays: map-merge($grays, $grays-custom);\n\n// Extend default Bootstrap $colors map\n$colors-custom: (\n 'black': $black,\n);\n$colors: () !default;\n$colors: map-merge($colors, $colors-custom);\n\n// Override default Bootstrap $theme-colors map by mapping each key to itself.\n// These will then be re-mapped inside of `button-outline-variant` and\n// `button-outline-variant` mixins in `bootstrap_override_mixins_buttons.scss`\n$theme-colors-self-map: ();\n@each $key\n in (\n 'primary',\n 'secondary',\n 'success',\n 'info',\n 'warning',\n 'danger',\n 'light',\n 'dark'\n )\n{\n $theme-colors-self-map: map.set($theme-colors-self-map, $key, $key);\n}\n$theme-colors: () !default;\n$theme-colors: map-merge($theme-colors, $theme-colors-self-map);\n\n// Used by bootstrap_override_mixins_buttons.scss to map Bootstrap colors to\n// DH semantic colors\n$bootstrap-dh-semantic-map: (\n 'primary': 'accent',\n 'secondary': 'neutral',\n 'success': 'positive',\n 'info': 'info',\n 'warning': 'notice',\n 'danger': 'negative',\n // We shouldn't be using these, but mapping so they work with our custom\n // `color-yiq` mixin. If we find a way to remove $light + $dark that are\n // defined in Bootstrap _variables.scss, we should remove these\n 'light': 'neutral',\n 'dark': 'neutral',\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: var(--dh-color-accent-bg);\n$primary-hover: var(--dh-color-accent-hover-bg);\n$primary-dark: var(--dh-color-accent-down-bg);\n$secondary: var(--dh-color-neutral-bg);\n$secondary-hover: var(--dh-color-neutral-hover-bg);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: var(--dh-color-negative-bg);\n$danger-hover: var(--dh-color-negative-hover-bg);\n// We really don't want to use $light or $dark variables, but Bootstrap defines\n// them in _variables.scss. Explicitly setting them to ensure we are in control\n// of their values. If we can find a way to remove them, we should\n$light: var(--dh-color-gray-light);\n$dark: var(--dh-color-gray-dark);\n// Bootstrap doesn't define $mid, and we want to move away from this particular\n// semantic. Should be deleted by #1635\n$mid: var(--dh-color-gray-mid);\n\n$semantic-colors: (\n 'primary-hover': $primary-hover,\n 'primary-dark': $primary-dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n 'secondary-hover': $secondary-hover,\n 'danger-hover': $danger-hover,\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n$text-select-color: var(--dh-color-text-highlight);\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem var(--dh-color-dropshadow);\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n$btn-font-weight: var(--spectrum-global-font-weight-bold);\n$btn-line-height: 1.3;\n\n//Override Inputs\n$input-bg: var(--dh-color-input-bg);\n$input-disabled-bg: var(--dh-color-input-disabled-bg);\n$input-color: var(--dh-color-input-fg);\n$input-border-color: var(--dh-color-input-border);\n$input-placeholder-color: var(--dh-color-input-placeholder);\n$input-focus-border-color: var(--dh-color-input-focus-border);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: color-mix(\n in srgb,\n var(--dh-color-accent) 35%,\n transparent\n);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n$input-btn-line-height: 1.3;\n// Bootstrap uses a calc expression to determine the input height (calc(line-height + 2*padding-y + border)).\n// The padding-y value has to be in rem to match units as it is a SASS calc.\n// Using 0.42145rem with 1.3 line height gets us to spectrum's 32px.\n/* stylelint-disable-next-line number-max-precision */\n$input-btn-padding-y: 0.42145rem;\n\n//checkbox\n$custom-control-indicator-bg: var(--dh-color-input-bg);\n$custom-control-indicator-border-color: var(--dh-color-input-border);\n$custom-checkbox-indicator-border-radius: 2px;\n$custom-control-indicator-border-width: 2px;\n$custom-control-indicator-active-bg: var(--dh-color-input-bg);\n$custom-control-indicator-active-border-color: var(--dh-color-input-fg);\n$custom-control-indicator-checked-bg: var(--dh-color-input-fg);\n$custom-control-indicator-checked-color: black; // used as mask fill color\n$custom-checkbox-indicator-indeterminate-bg: var(--dh-color-input-fg);\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: var(--dh-color-input-disabled-bg);\n$custom-control-indicator-checked-disabled-bg: var(\n --dh-color-input-disabled-bg\n);\n$custom-control-label-disabled-color: var(--dh-color-input-disabled-fg);\n\n// The $custom-select-indicator variable is used by Bootstrap to provide the\n// icon for the select dropdown. Inline svgs can't use CSS variables, so we hard\n// code the color to #929192 (the default value of --dh-color-gray-600). PR #1651\n// overrides this icon altogether for known dropdowns, so technically we may not\n// need this, but it's here in case there are any remaining instances.\n$custom-select-indicator-color: #929192;\n$custom-select-bg: var(--dh-color-selector-bg);\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: $gray-500;\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $content-bg;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n$close-color: var(--dh-color-text);\n$close-text-shadow: none;\n\n// Toast notification\n$toast-bg: var(--dh-color-accent-100);\n$toast-color: var(--dh-color-text);\n$toast-error-bg: var(--dh-color-negative-bg);\n$toast-error-color: var(--dh-color-text);\n\n//tooltips\n$tooltip-bg: var(--dh-color-tooltip-bg);\n$tooltip-color: var(--dh-color-tooltip-fg);\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem var(--dh-color-tooltip-box-shadow);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: var(--dh-color-item-list-hover-bg);\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: var(--dh-color-popover-bg);\n$contextmenu-color: var(--dh-color-text);\n$contextmenu-disabled-color: var(--dh-color-input-disabled-fg);\n$contextmenu-keyboard-selected-bg: var(--dh-color-keyboard-selected-bg);\n$contextmenu-selected-bg: var(--dh-color-item-list-hover-bg);\n$contextmenu-selected-color: var(--dh-color-item-list-selected-fg);\n\n//hr\n$hr-border-color: var(--dh-color-hr);\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: $danger;\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n\n// This section of variables is not consumed directly by DH, but they need to be\n// defined for sass to compile _variables\n$table-dark-bg: $gray-800;\n$table-dark-accent-bg: var(--dh-color-highlight-hover);\n$table-dark-hover-bg: var(--dh-color-highlight-active);\n$table-dark-border-color: $gray-700;\n$popover-bg: var(--dh-color-tooltip-bg);\n$popover-border-color: var(--dh-color-overlay-modal-bg);\n$popover-header-bg: #000;\n$popover-arrow-outer-color: var(--dh-color-dropshadow);\n$custom-range-thumb-active-bg: var(--dh-color-accent-1100);\n","@import '@deephaven/components/scss/custom.scss';\n\n.table-input-container {\n .select-value-list-scroll-pane {\n min-height: 2.4rem;\n max-height: 12rem;\n z-index: 0;\n }\n .meta-row {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n padding-top: $spacer-1;\n }\n}\n","@use 'sass:math';\n\n//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size:\n $ant-size $ant-thickness,\n $ant-size $ant-thickness,\n $ant-thickness $ant-size,\n $ant-thickness $ant-size;\n background-position:\n 0 top,\n 0 bottom,\n left 0,\n right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 12%;\n$hover-bg-transparency: 14%;\n$active-bg-transparency: 28%;\n$exception-transparency: 13%;\n"]}
1
+ {"version":3,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../src/TableInput.scss","../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;ACyLA;ACtLE;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA,aCRO","file":"TableInput.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n","// Styling overrides for bootstrap\n@use 'sass:map';\n\n// Override / set color variables\n$red: var(--dh-color-visual-red);\n$orange: var(--dh-color-visual-orange);\n$yellow: var(--dh-color-visual-yellow);\n$green: var(--dh-color-visual-green);\n$blue: var(--dh-color-visual-blue);\n$purple: var(--dh-color-visual-purple);\n\n// Fallback colors are used if theme isn't loaded\n// this is required for error messages if the API doesn't load\n\n//Define our Gray scale\n$gray-100: var(--dh-color-gray-900, #fcfcfa);\n$gray-200: var(--dh-color-gray-800);\n$gray-300: var(--dh-color-gray-700);\n$gray-400: var(--dh-color-gray-600);\n$gray-500: var(--dh-color-gray-500);\n// intentional duplicate, scale doesn't line up otherwise\n// as we have gray-850 and spectrum doesn't and it is needed\n$gray-600: var(--dh-color-gray-500);\n$gray-700: var(--dh-color-gray-400);\n$gray-800: var(--dh-color-gray-300);\n$gray-850: var(--dh-color-gray-200);\n$gray-900: var(--dh-color-gray-75);\n$black: var(--dh-color-black, #1a171a);\n$white: var(--dh-color-white, #f0f0ee);\n\n//Define some UI colors\n$interfacegray: var(--dh-color-content-bg, #2d2a2e);\n$interfaceblue: var(--dh-color-accent-bg);\n$interfacewhite: $white;\n$interfaceblack: $black;\n$content-bg: var(--dh-color-content-bg, #2d2a2e);\n$background: var(--dh-color-bg, #1a171a);\n$foreground: var(--dh-color-fg, #f0f0ee);\n\n// Extend default Bootstrap $grays map\n$grays-custom: (\n '850': $gray-850,\n);\n$grays: () !default;\n$grays: map-merge($grays, $grays-custom);\n\n// Extend default Bootstrap $colors map\n$colors-custom: (\n 'black': $black,\n);\n$colors: () !default;\n$colors: map-merge($colors, $colors-custom);\n\n// Override default Bootstrap $theme-colors map by mapping each key to itself.\n// These will then be re-mapped inside of `button-outline-variant` and\n// `button-outline-variant` mixins in `bootstrap_override_mixins_buttons.scss`\n$theme-colors-self-map: ();\n@each $key\n in (\n 'primary',\n 'secondary',\n 'success',\n 'info',\n 'warning',\n 'danger',\n 'light',\n 'dark'\n )\n{\n $theme-colors-self-map: map.set($theme-colors-self-map, $key, $key);\n}\n$theme-colors: () !default;\n$theme-colors: map-merge($theme-colors, $theme-colors-self-map);\n\n// Used by bootstrap_override_mixins_buttons.scss to map Bootstrap colors to\n// DH semantic colors\n$bootstrap-dh-semantic-map: (\n 'primary': 'accent',\n 'secondary': 'neutral',\n 'success': 'positive',\n 'info': 'info',\n 'warning': 'notice',\n 'danger': 'negative',\n // We shouldn't be using these, but mapping so they work with our custom\n // `color-yiq` mixin. If we find a way to remove $light + $dark that are\n // defined in Bootstrap _variables.scss, we should remove these\n 'light': 'neutral',\n 'dark': 'neutral',\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: var(--dh-color-accent-bg);\n$primary-hover: var(--dh-color-accent-hover-bg);\n$primary-dark: var(--dh-color-accent-down-bg);\n$secondary: var(--dh-color-neutral-bg);\n$secondary-hover: var(--dh-color-neutral-hover-bg);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: var(--dh-color-negative-bg);\n$danger-hover: var(--dh-color-negative-hover-bg);\n// We really don't want to use $light or $dark variables, but Bootstrap defines\n// them in _variables.scss. Explicitly setting them to ensure we are in control\n// of their values. If we can find a way to remove them, we should\n$light: var(--dh-color-gray-light);\n$dark: var(--dh-color-gray-dark);\n// Bootstrap doesn't define $mid, and we want to move away from this particular\n// semantic. Should be deleted by #1635\n$mid: var(--dh-color-gray-mid);\n\n$semantic-colors: (\n 'primary-hover': $primary-hover,\n 'primary-dark': $primary-dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n 'secondary-hover': $secondary-hover,\n 'danger-hover': $danger-hover,\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n$text-select-color: var(--dh-color-text-highlight);\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem var(--dh-color-dropshadow);\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n$btn-font-weight: var(--spectrum-global-font-weight-bold);\n$btn-line-height: 1.3;\n\n//Override Inputs\n$input-bg: var(--dh-color-input-bg);\n$input-disabled-bg: var(--dh-color-input-disabled-bg);\n$input-color: var(--dh-color-input-fg);\n$input-border-color: var(--dh-color-input-border);\n$input-placeholder-color: var(--dh-color-input-placeholder);\n$input-focus-border-color: var(--dh-color-input-focus-border);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: hsla(var(--dh-color-accent-hsl), 0.35);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n$input-btn-line-height: 1.3;\n// Bootstrap uses a calc expression to determine the input height (calc(line-height + 2*padding-y + border)).\n// The padding-y value has to be in rem to match units as it is a SASS calc.\n// Using 0.42145rem with 1.3 line height gets us to spectrum's 32px.\n/* stylelint-disable-next-line number-max-precision */\n$input-btn-padding-y: 0.42145rem;\n\n//checkbox\n$custom-control-indicator-bg: var(--dh-color-input-bg);\n$custom-control-indicator-border-color: var(--dh-color-input-border);\n$custom-checkbox-indicator-border-radius: 2px;\n$custom-control-indicator-border-width: 2px;\n$custom-control-indicator-active-bg: var(--dh-color-input-bg);\n$custom-control-indicator-active-border-color: var(--dh-color-input-fg);\n$custom-control-indicator-checked-bg: var(--dh-color-input-fg);\n$custom-control-indicator-checked-color: black; // used as mask fill color\n$custom-checkbox-indicator-indeterminate-bg: var(--dh-color-input-fg);\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: var(--dh-color-input-disabled-bg);\n$custom-control-indicator-checked-disabled-bg: var(\n --dh-color-input-disabled-bg\n);\n$custom-control-label-disabled-color: var(--dh-color-input-disabled-fg);\n\n// The $custom-select-indicator variable is used by Bootstrap to provide the\n// icon for the select dropdown. Inline svgs can't use CSS variables, so we hard\n// code the color to #929192 (the default value of --dh-color-gray-600). PR #1651\n// overrides this icon altogether for known dropdowns, so technically we may not\n// need this, but it's here in case there are any remaining instances.\n$custom-select-indicator-color: #929192;\n$custom-select-bg: var(--dh-color-selector-bg);\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: $gray-500;\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $content-bg;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n$close-color: var(--dh-color-text);\n$close-text-shadow: none;\n\n// Toast notification\n$toast-bg: var(--dh-color-accent-100);\n$toast-color: var(--dh-color-text);\n$toast-error-bg: var(--dh-color-negative-bg);\n$toast-error-color: var(--dh-color-text);\n\n//tooltips\n$tooltip-bg: var(--dh-color-tooltip-bg);\n$tooltip-color: var(--dh-color-tooltip-fg);\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem var(--dh-color-tooltip-box-shadow);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: var(--dh-color-item-list-hover-bg);\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: var(--dh-color-popover-bg);\n$contextmenu-color: var(--dh-color-text);\n$contextmenu-disabled-color: var(--dh-color-input-disabled-fg);\n$contextmenu-keyboard-selected-bg: var(--dh-color-keyboard-selected-bg);\n$contextmenu-selected-bg: var(--dh-color-item-list-hover-bg);\n$contextmenu-selected-color: var(--dh-color-item-list-selected-fg);\n\n//hr\n$hr-border-color: var(--dh-color-hr);\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: $danger;\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n\n// This section of variables is not consumed directly by DH, but they need to be\n// defined for sass to compile _variables\n$table-dark-bg: $gray-800;\n$table-dark-accent-bg: var(--dh-color-highlight-hover);\n$table-dark-hover-bg: var(--dh-color-highlight-active);\n$table-dark-border-color: $gray-700;\n$popover-bg: var(--dh-color-tooltip-bg);\n$popover-border-color: var(--dh-color-overlay-modal-bg);\n$popover-header-bg: #000;\n$popover-arrow-outer-color: var(--dh-color-dropshadow);\n$custom-range-thumb-active-bg: var(--dh-color-accent-1100);\n","@import '@deephaven/components/scss/custom.scss';\n\n.table-input-container {\n .select-value-list-scroll-pane {\n min-height: 2.4rem;\n max-height: 12rem;\n z-index: 0;\n }\n .meta-row {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n padding-top: $spacer-1;\n }\n}\n","@use 'sass:math';\n\n//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size:\n $ant-size $ant-thickness,\n $ant-size $ant-thickness,\n $ant-thickness $ant-size,\n $ant-thickness $ant-size;\n background-position:\n 0 top,\n 0 bottom,\n left 0,\n right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n@function hsla-opacity($semantic-name, $i: 100) {\n @return hsla(var(--dh-color-#{$semantic-name}-hsl), math.div($i, 100));\n}\n\n@function accent-opacity($i: 100) {\n @return hsla-opacity('accent', $i);\n}\n\n@function background-opacity($i: 100) {\n @return hsla-opacity('bg', $i);\n}\n\n@function foreground-opacity($i: 100) {\n @return hsla-opacity('fg', $i);\n}\n\n$focus-bg-transparency: 0.12;\n$hover-bg-transparency: 0.14;\n$active-bg-transparency: 0.28;\n$exception-transparency: 0.13;\n"]}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from './ConnectionContext';
2
1
  export * from './HookTestUtils';
3
2
  export { default as TableInput } from './TableInput';
4
3
  export * from './RefreshTokenBootstrap';
@@ -7,7 +6,6 @@ export * from './TableDropdown';
7
6
  export { default as useBroadcastChannel } from './useBroadcastChannel';
8
7
  export { default as useBroadcastLoginListener } from './useBroadcastLoginListener';
9
8
  export * from './useCheckIfExistsValue';
10
- export * from './useConnection';
11
9
  export { default as useDebouncedViewportSearch } from './useDebouncedViewportSearch';
12
10
  export * from './useDebouncedViewportSelectionFilter';
13
11
  export * from './useFilterConditionFactories';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,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e,EAAE,MAAM,mBAAmB,CAAC;AAC/D,YAAY,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,cAAc,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export * from "./ConnectionContext.js";
2
1
  export * from "./HookTestUtils.js";
3
2
  export { default as TableInput } from "./TableInput.js";
4
3
  export * from "./RefreshTokenBootstrap.js";
@@ -7,7 +6,6 @@ export * from "./TableDropdown.js";
7
6
  export { default as useBroadcastChannel } from "./useBroadcastChannel.js";
8
7
  export { default as useBroadcastLoginListener } from "./useBroadcastLoginListener.js";
9
8
  export * from "./useCheckIfExistsValue.js";
10
- export * from "./useConnection.js";
11
9
  export { default as useDebouncedViewportSearch } from "./useDebouncedViewportSearch.js";
12
10
  export * from "./useDebouncedViewportSelectionFilter.js";
13
11
  export * from "./useFilterConditionFactories.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","TableInput","useBroadcastChannel","useBroadcastLoginListener","useDebouncedViewportSearch","useInitializeViewportData","useSelectDistinctTable","useSetPaddedViewportCallback","useTable","useTableColumn","useTableListener","useTableClose","useTableSize","useTableUtils","useViewportData"],"sources":["../src/index.ts"],"sourcesContent":["export * from './ConnectionContext';\nexport * from './HookTestUtils';\nexport { default as TableInput } from './TableInput';\nexport * from './RefreshTokenBootstrap';\nexport * from './RefreshTokenUtils';\nexport * from './TableDropdown';\nexport { default as useBroadcastChannel } from './useBroadcastChannel';\nexport { default as useBroadcastLoginListener } from './useBroadcastLoginListener';\nexport * from './useCheckIfExistsValue';\nexport * from './useConnection';\nexport { default as useDebouncedViewportSearch } from './useDebouncedViewportSearch';\nexport * from './useDebouncedViewportSelectionFilter';\nexport * from './useFilterConditionFactories';\nexport * from './useFilteredItemsWithDefaultValue';\nexport * from './useGetItemPosition';\nexport { default as useInitializeViewportData } from './useInitializeViewportData';\nexport * from './useSearchableViewportData';\nexport * from './useNotNullOrEmptyFilter';\nexport * from './usePickerWithSelectedValues';\nexport { default as useSelectDistinctTable } from './useSelectDistinctTable';\nexport { default as useSetPaddedViewportCallback } from './useSetPaddedViewportCallback';\nexport * from './useShowOnlyEmptyFilter';\nexport { default as useTable } from './useTable';\nexport { default as useTableColumn } from './useTableColumn';\nexport { default as useTableListener } from './useTableListener';\nexport { default as useTableClose } from './useTableClose';\nexport { default as useTableSize } from './useTableSize';\nexport { default as useTableUtils } from './useTableUtils';\nexport * from './useValueFilter';\nexport { default as useViewportData } from './useViewportData';\nexport type { UseSelectDistinctTableResult } from './useSelectDistinctTable';\nexport type { UseViewportDataResult } from './useViewportData';\nexport * from './useViewportFilter';\n"],"mappings":";;SAESA,OAAO,IAAIC,UAAU;AAAA;AAAA;AAAA;AAAA,SAIrBD,OAAO,IAAIE,mBAAmB;AAAA,SAC9BF,OAAO,IAAIG,yBAAyB;AAAA;AAAA;AAAA,SAGpCH,OAAO,IAAII,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA,SAKrCJ,OAAO,IAAIK,yBAAyB;AAAA;AAAA;AAAA;AAAA,SAIpCL,OAAO,IAAIM,sBAAsB;AAAA,SACjCN,OAAO,IAAIO,4BAA4B;AAAA;AAAA,SAEvCP,OAAO,IAAIQ,QAAQ;AAAA,SACnBR,OAAO,IAAIS,cAAc;AAAA,SACzBT,OAAO,IAAIU,gBAAgB;AAAA,SAC3BV,OAAO,IAAIW,aAAa;AAAA,SACxBX,OAAO,IAAIY,YAAY;AAAA,SACvBZ,OAAO,IAAIa,aAAa;AAAA;AAAA,SAExBb,OAAO,IAAIc,eAAe;AAAA"}
1
+ {"version":3,"file":"index.js","names":["default","TableInput","useBroadcastChannel","useBroadcastLoginListener","useDebouncedViewportSearch","useInitializeViewportData","useSelectDistinctTable","useSetPaddedViewportCallback","useTable","useTableColumn","useTableListener","useTableClose","useTableSize","useTableUtils","useViewportData"],"sources":["../src/index.ts"],"sourcesContent":["export * from './HookTestUtils';\nexport { default as TableInput } from './TableInput';\nexport * from './RefreshTokenBootstrap';\nexport * from './RefreshTokenUtils';\nexport * from './TableDropdown';\nexport { default as useBroadcastChannel } from './useBroadcastChannel';\nexport { default as useBroadcastLoginListener } from './useBroadcastLoginListener';\nexport * from './useCheckIfExistsValue';\nexport { default as useDebouncedViewportSearch } from './useDebouncedViewportSearch';\nexport * from './useDebouncedViewportSelectionFilter';\nexport * from './useFilterConditionFactories';\nexport * from './useFilteredItemsWithDefaultValue';\nexport * from './useGetItemPosition';\nexport { default as useInitializeViewportData } from './useInitializeViewportData';\nexport * from './useSearchableViewportData';\nexport * from './useNotNullOrEmptyFilter';\nexport * from './usePickerWithSelectedValues';\nexport { default as useSelectDistinctTable } from './useSelectDistinctTable';\nexport { default as useSetPaddedViewportCallback } from './useSetPaddedViewportCallback';\nexport * from './useShowOnlyEmptyFilter';\nexport { default as useTable } from './useTable';\nexport { default as useTableColumn } from './useTableColumn';\nexport { default as useTableListener } from './useTableListener';\nexport { default as useTableClose } from './useTableClose';\nexport { default as useTableSize } from './useTableSize';\nexport { default as useTableUtils } from './useTableUtils';\nexport * from './useValueFilter';\nexport { default as useViewportData } from './useViewportData';\nexport type { UseSelectDistinctTableResult } from './useSelectDistinctTable';\nexport type { UseViewportDataResult } from './useViewportData';\nexport * from './useViewportFilter';\n"],"mappings":";SACSA,OAAO,IAAIC,UAAU;AAAA;AAAA;AAAA;AAAA,SAIrBD,OAAO,IAAIE,mBAAmB;AAAA,SAC9BF,OAAO,IAAIG,yBAAyB;AAAA;AAAA,SAEpCH,OAAO,IAAII,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA,SAKrCJ,OAAO,IAAIK,yBAAyB;AAAA;AAAA;AAAA;AAAA,SAIpCL,OAAO,IAAIM,sBAAsB;AAAA,SACjCN,OAAO,IAAIO,4BAA4B;AAAA;AAAA,SAEvCP,OAAO,IAAIQ,QAAQ;AAAA,SACnBR,OAAO,IAAIS,cAAc;AAAA,SACzBT,OAAO,IAAIU,gBAAgB;AAAA,SAC3BV,OAAO,IAAIW,aAAa;AAAA,SACxBX,OAAO,IAAIY,YAAY;AAAA,SACvBZ,OAAO,IAAIa,aAAa;AAAA;AAAA,SAExBb,OAAO,IAAIc,eAAe;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCheckIfExistsValue.d.ts","sourceRoot":"","sources":["../src/useCheckIfExistsValue.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAIpD,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAC;IAErB,8BAA8B;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;IAE5B,kCAAkC;IAClC,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,EAC/B,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,EAC9B,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,OAAO,GACvB,kBAAkB,CAkCpB;AAED,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"useCheckIfExistsValue.d.ts","sourceRoot":"","sources":["../src/useCheckIfExistsValue.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAIpD,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAC;IAErB,8BAA8B;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAE9B;;;OAGG;IACH,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;IAE5B,kCAAkC;IAClC,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,EAC/B,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,EAC9B,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,OAAO,GACvB,kBAAkB,CA+BpB;AAED,eAAe,qBAAqB,CAAC"}
@@ -11,9 +11,7 @@ import useTableUtils from "./useTableUtils.js";
11
11
  export function useCheckIfExistsValue(table, columnNames, debounceMs, isCaseSensitive) {
12
12
  var tableUtils = useTableUtils();
13
13
  var [valueTrimmed, setValueTrimmed] = useState('');
14
- var {
15
- value: valueTrimmedDebounced
16
- } = useDebouncedValue(valueTrimmed, debounceMs);
14
+ var valueTrimmedDebounced = useDebouncedValue(valueTrimmed, debounceMs);
17
15
  var trimAndUpdateValue = useCallback(text => {
18
16
  setValueTrimmed(text.trim());
19
17
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"useCheckIfExistsValue.js","names":["useCallback","useState","useDebouncedValue","usePromiseFactory","useTableUtils","useCheckIfExistsValue","table","columnNames","debounceMs","isCaseSensitive","tableUtils","valueTrimmed","setValueTrimmed","value","valueTrimmedDebounced","trimAndUpdateValue","text","trim","data","valueExistsData","isLoading","valueExistsIsLoading","doesColumnValueExist","valueExists"],"sources":["../src/useCheckIfExistsValue.ts"],"sourcesContent":["import { useCallback, useState } from 'react';\nimport type { Table } from '@deephaven/jsapi-types';\nimport { useDebouncedValue, usePromiseFactory } from '@deephaven/react-hooks';\nimport useTableUtils from './useTableUtils';\n\nexport interface CheckIfExistsValue {\n /** Current trimmed value */\n valueTrimmed: string;\n\n /** Debounced trimmed value */\n valueTrimmedDebounced: string;\n\n /**\n * Whether the value exists in the given table columns. Will be null whenever\n * the value changes until the next check is complete.\n */\n valueExists: boolean | null;\n\n /** Trims and updates the value */\n trimAndUpdateValue: (value: string) => void;\n}\n\n/**\n * Manage a trimmed text value and check if it exists in a list of table columns.\n * @param table The table to check for the value\n * @param columnNames The column names to check\n * @param debounceMs Debounce timer for re-checking the value\n * @param isCaseSensitive Whether the value check is case sensitive\n */\nexport function useCheckIfExistsValue(\n table: Table | null | undefined,\n columnNames: string | string[],\n debounceMs: number,\n isCaseSensitive: boolean\n): CheckIfExistsValue {\n const tableUtils = useTableUtils();\n\n const [valueTrimmed, setValueTrimmed] = useState('');\n const { value: valueTrimmedDebounced } = useDebouncedValue(\n valueTrimmed,\n debounceMs\n );\n\n const trimAndUpdateValue = useCallback((text: string) => {\n setValueTrimmed(text.trim());\n }, []);\n\n const { data: valueExistsData, isLoading: valueExistsIsLoading } =\n usePromiseFactory(tableUtils.doesColumnValueExist, [\n table,\n columnNames,\n valueTrimmedDebounced,\n isCaseSensitive,\n ]);\n\n // If value check is loading or if debounce hasn't settled, set\n // `matchesExistingValue` to null since it is indeterminate\n const valueExists =\n valueExistsIsLoading || valueTrimmed !== valueTrimmedDebounced\n ? null\n : valueExistsData;\n\n return {\n valueTrimmed,\n valueTrimmedDebounced,\n valueExists,\n trimAndUpdateValue,\n };\n}\n\nexport default useCheckIfExistsValue;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAE7C,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ,wBAAwB;AAAC,OACvEC,aAAa;AAmBpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CACnCC,KAA+B,EAC/BC,WAA8B,EAC9BC,UAAkB,EAClBC,eAAwB,EACJ;EACpB,IAAMC,UAAU,GAAGN,aAAa,CAAC,CAAC;EAElC,IAAM,CAACO,YAAY,EAAEC,eAAe,CAAC,GAAGX,QAAQ,CAAC,EAAE,CAAC;EACpD,IAAM;IAAEY,KAAK,EAAEC;EAAsB,CAAC,GAAGZ,iBAAiB,CACxDS,YAAY,EACZH,UACF,CAAC;EAED,IAAMO,kBAAkB,GAAGf,WAAW,CAAEgB,IAAY,IAAK;IACvDJ,eAAe,CAACI,IAAI,CAACC,IAAI,CAAC,CAAC,CAAC;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,IAAM;IAAEC,IAAI,EAAEC,eAAe;IAAEC,SAAS,EAAEC;EAAqB,CAAC,GAC9DlB,iBAAiB,CAACO,UAAU,CAACY,oBAAoB,EAAE,CACjDhB,KAAK,EACLC,WAAW,EACXO,qBAAqB,EACrBL,eAAe,CAChB,CAAC;;EAEJ;EACA;EACA,IAAMc,WAAW,GACfF,oBAAoB,IAAIV,YAAY,KAAKG,qBAAqB,GAC1D,IAAI,GACJK,eAAe;EAErB,OAAO;IACLR,YAAY;IACZG,qBAAqB;IACrBS,WAAW;IACXR;EACF,CAAC;AACH;AAEA,eAAeV,qBAAqB"}
1
+ {"version":3,"file":"useCheckIfExistsValue.js","names":["useCallback","useState","useDebouncedValue","usePromiseFactory","useTableUtils","useCheckIfExistsValue","table","columnNames","debounceMs","isCaseSensitive","tableUtils","valueTrimmed","setValueTrimmed","valueTrimmedDebounced","trimAndUpdateValue","text","trim","data","valueExistsData","isLoading","valueExistsIsLoading","doesColumnValueExist","valueExists"],"sources":["../src/useCheckIfExistsValue.ts"],"sourcesContent":["import { useCallback, useState } from 'react';\nimport type { Table } from '@deephaven/jsapi-types';\nimport { useDebouncedValue, usePromiseFactory } from '@deephaven/react-hooks';\nimport useTableUtils from './useTableUtils';\n\nexport interface CheckIfExistsValue {\n /** Current trimmed value */\n valueTrimmed: string;\n\n /** Debounced trimmed value */\n valueTrimmedDebounced: string;\n\n /**\n * Whether the value exists in the given table columns. Will be null whenever\n * the value changes until the next check is complete.\n */\n valueExists: boolean | null;\n\n /** Trims and updates the value */\n trimAndUpdateValue: (value: string) => void;\n}\n\n/**\n * Manage a trimmed text value and check if it exists in a list of table columns.\n * @param table The table to check for the value\n * @param columnNames The column names to check\n * @param debounceMs Debounce timer for re-checking the value\n * @param isCaseSensitive Whether the value check is case sensitive\n */\nexport function useCheckIfExistsValue(\n table: Table | null | undefined,\n columnNames: string | string[],\n debounceMs: number,\n isCaseSensitive: boolean\n): CheckIfExistsValue {\n const tableUtils = useTableUtils();\n\n const [valueTrimmed, setValueTrimmed] = useState('');\n const valueTrimmedDebounced = useDebouncedValue(valueTrimmed, debounceMs);\n\n const trimAndUpdateValue = useCallback((text: string) => {\n setValueTrimmed(text.trim());\n }, []);\n\n const { data: valueExistsData, isLoading: valueExistsIsLoading } =\n usePromiseFactory(tableUtils.doesColumnValueExist, [\n table,\n columnNames,\n valueTrimmedDebounced,\n isCaseSensitive,\n ]);\n\n // If value check is loading or if debounce hasn't settled, set\n // `matchesExistingValue` to null since it is indeterminate\n const valueExists =\n valueExistsIsLoading || valueTrimmed !== valueTrimmedDebounced\n ? null\n : valueExistsData;\n\n return {\n valueTrimmed,\n valueTrimmedDebounced,\n valueExists,\n trimAndUpdateValue,\n };\n}\n\nexport default useCheckIfExistsValue;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAE7C,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ,wBAAwB;AAAC,OACvEC,aAAa;AAmBpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CACnCC,KAA+B,EAC/BC,WAA8B,EAC9BC,UAAkB,EAClBC,eAAwB,EACJ;EACpB,IAAMC,UAAU,GAAGN,aAAa,CAAC,CAAC;EAElC,IAAM,CAACO,YAAY,EAAEC,eAAe,CAAC,GAAGX,QAAQ,CAAC,EAAE,CAAC;EACpD,IAAMY,qBAAqB,GAAGX,iBAAiB,CAACS,YAAY,EAAEH,UAAU,CAAC;EAEzE,IAAMM,kBAAkB,GAAGd,WAAW,CAAEe,IAAY,IAAK;IACvDH,eAAe,CAACG,IAAI,CAACC,IAAI,CAAC,CAAC,CAAC;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,IAAM;IAAEC,IAAI,EAAEC,eAAe;IAAEC,SAAS,EAAEC;EAAqB,CAAC,GAC9DjB,iBAAiB,CAACO,UAAU,CAACW,oBAAoB,EAAE,CACjDf,KAAK,EACLC,WAAW,EACXM,qBAAqB,EACrBJ,eAAe,CAChB,CAAC;;EAEJ;EACA;EACA,IAAMa,WAAW,GACfF,oBAAoB,IAAIT,YAAY,KAAKE,qBAAqB,GAC1D,IAAI,GACJK,eAAe;EAErB,OAAO;IACLP,YAAY;IACZE,qBAAqB;IACrBS,WAAW;IACXR;EACF,CAAC;AACH;AAEA,eAAeT,qBAAqB"}
@@ -23,9 +23,7 @@ export function useDebouncedViewportSelectionFilter(_ref) {
23
23
 
24
24
  // Debounce so user can rapidly select multiple items in a row without the
25
25
  // cost of updating the table on each change
26
- var {
27
- value: debouncedValuesSelection
28
- } = useDebouncedValue(valuesSelection, DEBOUNCE_MS);
26
+ var debouncedValuesSelection = useDebouncedValue(valuesSelection, DEBOUNCE_MS);
29
27
 
30
28
  // In cases where a user rapidly selects then deselects the selection
31
29
  // reference will change, but the state it represents will remain unchanged.
@@ -1 +1 @@
1
- {"version":3,"file":"useDebouncedViewportSelectionFilter.js","names":["createSelectedValuesFilter","isSelectionMaybeInvertedEqual","useDebouncedValue","useIsEqualMemo","useMappedSelection","useMemo","useTableUtils","DEBOUNCE_MS","useDebouncedViewportSelectionFilter","_ref","viewportData","columnName","shouldSelectAllOnNoSelection","mapItemToValue","tableUtils","valuesSelection","value","debouncedValuesSelection","memoValuesSelection","selection","isInverted"],"sources":["../src/useDebouncedViewportSelectionFilter.ts"],"sourcesContent":["import {\n createSelectedValuesFilter,\n FilterConditionFactory,\n} from '@deephaven/jsapi-utils';\nimport {\n isSelectionMaybeInvertedEqual,\n useDebouncedValue,\n useIsEqualMemo,\n useMappedSelection,\n WindowedListData,\n} from '@deephaven/react-hooks';\nimport { KeyedItem } from '@deephaven/utils';\nimport { useMemo } from 'react';\nimport useTableUtils from './useTableUtils';\n\nexport const DEBOUNCE_MS = 300;\n\nexport interface UseDebouncedViewportSelectionFilterOptions<TItem, TValue> {\n viewportData: WindowedListData<KeyedItem<TItem>>;\n columnName: string;\n shouldSelectAllOnNoSelection: boolean;\n mapItemToValue: (item: KeyedItem<TItem>) => TValue;\n}\n\n/**\n * Creates a filter factory for the current selected keys of a viewport. The\n * selected keys will be mapped to values to match in a given column name. The\n * resulting filter factory is debounced to allow some cushion for cases where\n * a user rapidly changes selections, e.g. in a checkbox list.\n */\nexport function useDebouncedViewportSelectionFilter<TItem, TValue>({\n viewportData,\n columnName,\n shouldSelectAllOnNoSelection,\n mapItemToValue,\n}: UseDebouncedViewportSelectionFilterOptions<\n TItem,\n TValue\n>): FilterConditionFactory {\n const tableUtils = useTableUtils();\n\n // Map selection to values contained in the column to filter\n const valuesSelection = useMappedSelection(viewportData, mapItemToValue);\n\n // Debounce so user can rapidly select multiple items in a row without the\n // cost of updating the table on each change\n const { value: debouncedValuesSelection } = useDebouncedValue(\n valuesSelection,\n DEBOUNCE_MS\n );\n\n // In cases where a user rapidly selects then deselects the selection\n // reference will change, but the state it represents will remain unchanged.\n // Memoize based on the selection value to avoid unnecessarily re-applying\n // table filters.\n const memoValuesSelection = useIsEqualMemo(\n debouncedValuesSelection,\n isSelectionMaybeInvertedEqual\n );\n\n return useMemo(\n () =>\n createSelectedValuesFilter(\n tableUtils,\n columnName,\n memoValuesSelection.selection,\n shouldSelectAllOnNoSelection,\n memoValuesSelection.isInverted\n ),\n [columnName, memoValuesSelection, shouldSelectAllOnNoSelection, tableUtils]\n );\n}\n\nexport default useDebouncedViewportSelectionFilter;\n"],"mappings":"AAAA,SACEA,0BAA0B,QAErB,wBAAwB;AAC/B,SACEC,6BAA6B,EAC7BC,iBAAiB,EACjBC,cAAc,EACdC,kBAAkB,QAEb,wBAAwB;AAE/B,SAASC,OAAO,QAAQ,OAAO;AAAC,OACzBC,aAAa;AAEpB,OAAO,IAAMC,WAAW,GAAG,GAAG;AAS9B;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mCAAmCA,CAAAC,IAAA,EAQxB;EAAA,IARwC;IACjEC,YAAY;IACZC,UAAU;IACVC,4BAA4B;IAC5BC;EAIF,CAAC,GAAAJ,IAAA;EACC,IAAMK,UAAU,GAAGR,aAAa,CAAC,CAAC;;EAElC;EACA,IAAMS,eAAe,GAAGX,kBAAkB,CAACM,YAAY,EAAEG,cAAc,CAAC;;EAExE;EACA;EACA,IAAM;IAAEG,KAAK,EAAEC;EAAyB,CAAC,GAAGf,iBAAiB,CAC3Da,eAAe,EACfR,WACF,CAAC;;EAED;EACA;EACA;EACA;EACA,IAAMW,mBAAmB,GAAGf,cAAc,CACxCc,wBAAwB,EACxBhB,6BACF,CAAC;EAED,OAAOI,OAAO,CACZ,MACEL,0BAA0B,CACxBc,UAAU,EACVH,UAAU,EACVO,mBAAmB,CAACC,SAAS,EAC7BP,4BAA4B,EAC5BM,mBAAmB,CAACE,UACtB,CAAC,EACH,CAACT,UAAU,EAAEO,mBAAmB,EAAEN,4BAA4B,EAAEE,UAAU,CAC5E,CAAC;AACH;AAEA,eAAeN,mCAAmC"}
1
+ {"version":3,"file":"useDebouncedViewportSelectionFilter.js","names":["createSelectedValuesFilter","isSelectionMaybeInvertedEqual","useDebouncedValue","useIsEqualMemo","useMappedSelection","useMemo","useTableUtils","DEBOUNCE_MS","useDebouncedViewportSelectionFilter","_ref","viewportData","columnName","shouldSelectAllOnNoSelection","mapItemToValue","tableUtils","valuesSelection","debouncedValuesSelection","memoValuesSelection","selection","isInverted"],"sources":["../src/useDebouncedViewportSelectionFilter.ts"],"sourcesContent":["import {\n createSelectedValuesFilter,\n FilterConditionFactory,\n} from '@deephaven/jsapi-utils';\nimport {\n isSelectionMaybeInvertedEqual,\n useDebouncedValue,\n useIsEqualMemo,\n useMappedSelection,\n WindowedListData,\n} from '@deephaven/react-hooks';\nimport { KeyedItem } from '@deephaven/utils';\nimport { useMemo } from 'react';\nimport useTableUtils from './useTableUtils';\n\nexport const DEBOUNCE_MS = 300;\n\nexport interface UseDebouncedViewportSelectionFilterOptions<TItem, TValue> {\n viewportData: WindowedListData<KeyedItem<TItem>>;\n columnName: string;\n shouldSelectAllOnNoSelection: boolean;\n mapItemToValue: (item: KeyedItem<TItem>) => TValue;\n}\n\n/**\n * Creates a filter factory for the current selected keys of a viewport. The\n * selected keys will be mapped to values to match in a given column name. The\n * resulting filter factory is debounced to allow some cushion for cases where\n * a user rapidly changes selections, e.g. in a checkbox list.\n */\nexport function useDebouncedViewportSelectionFilter<TItem, TValue>({\n viewportData,\n columnName,\n shouldSelectAllOnNoSelection,\n mapItemToValue,\n}: UseDebouncedViewportSelectionFilterOptions<\n TItem,\n TValue\n>): FilterConditionFactory {\n const tableUtils = useTableUtils();\n\n // Map selection to values contained in the column to filter\n const valuesSelection = useMappedSelection(viewportData, mapItemToValue);\n\n // Debounce so user can rapidly select multiple items in a row without the\n // cost of updating the table on each change\n const debouncedValuesSelection = useDebouncedValue(\n valuesSelection,\n DEBOUNCE_MS\n );\n\n // In cases where a user rapidly selects then deselects the selection\n // reference will change, but the state it represents will remain unchanged.\n // Memoize based on the selection value to avoid unnecessarily re-applying\n // table filters.\n const memoValuesSelection = useIsEqualMemo(\n debouncedValuesSelection,\n isSelectionMaybeInvertedEqual\n );\n\n return useMemo(\n () =>\n createSelectedValuesFilter(\n tableUtils,\n columnName,\n memoValuesSelection.selection,\n shouldSelectAllOnNoSelection,\n memoValuesSelection.isInverted\n ),\n [columnName, memoValuesSelection, shouldSelectAllOnNoSelection, tableUtils]\n );\n}\n\nexport default useDebouncedViewportSelectionFilter;\n"],"mappings":"AAAA,SACEA,0BAA0B,QAErB,wBAAwB;AAC/B,SACEC,6BAA6B,EAC7BC,iBAAiB,EACjBC,cAAc,EACdC,kBAAkB,QAEb,wBAAwB;AAE/B,SAASC,OAAO,QAAQ,OAAO;AAAC,OACzBC,aAAa;AAEpB,OAAO,IAAMC,WAAW,GAAG,GAAG;AAS9B;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mCAAmCA,CAAAC,IAAA,EAQxB;EAAA,IARwC;IACjEC,YAAY;IACZC,UAAU;IACVC,4BAA4B;IAC5BC;EAIF,CAAC,GAAAJ,IAAA;EACC,IAAMK,UAAU,GAAGR,aAAa,CAAC,CAAC;;EAElC;EACA,IAAMS,eAAe,GAAGX,kBAAkB,CAACM,YAAY,EAAEG,cAAc,CAAC;;EAExE;EACA;EACA,IAAMG,wBAAwB,GAAGd,iBAAiB,CAChDa,eAAe,EACfR,WACF,CAAC;;EAED;EACA;EACA;EACA;EACA,IAAMU,mBAAmB,GAAGd,cAAc,CACxCa,wBAAwB,EACxBf,6BACF,CAAC;EAED,OAAOI,OAAO,CACZ,MACEL,0BAA0B,CACxBc,UAAU,EACVH,UAAU,EACVM,mBAAmB,CAACC,SAAS,EAC7BN,4BAA4B,EAC5BK,mBAAmB,CAACE,UACtB,CAAC,EACH,CAACR,UAAU,EAAEM,mBAAmB,EAAEL,4BAA4B,EAAEE,UAAU,CAC5E,CAAC;AACH;AAEA,eAAeN,mCAAmC"}
@@ -23,18 +23,11 @@ export interface UsePickerWithSelectedValuesResult<TItem, TValue> {
23
23
  * items are removed from the list and managed in a selectedValueMap data
24
24
  * structure. Useful for components that contain a picker but show selected
25
25
  * values in a separate component.
26
- * @param maybeTable The table to get the list of items from
27
- * @param columnName The column name to get the list of items from
28
- * @param mapItemToValue A function to map an item to a value
29
- * @param filterConditionFactories Optional filter condition factories to apply to the list
30
- * @param trimSearchText Whether to trim the search text before filtering. Defaults to false
26
+ * @param maybeTable
27
+ * @param columnName
28
+ * @param mapItemToValue
29
+ * @param filterConditionFactories
31
30
  */
32
- export declare function usePickerWithSelectedValues<TItem, TValue>({ maybeTable, columnName, mapItemToValue, filterConditionFactories, trimSearchText, }: {
33
- maybeTable: Table | null;
34
- columnName: string;
35
- mapItemToValue: (item: KeyedItem<TItem>) => TValue;
36
- filterConditionFactories?: FilterConditionFactory[];
37
- trimSearchText?: boolean;
38
- }): UsePickerWithSelectedValuesResult<TItem, TValue>;
31
+ export declare function usePickerWithSelectedValues<TItem, TValue>(maybeTable: Table | null, columnName: string, mapItemToValue: (item: KeyedItem<TItem>) => TValue, ...filterConditionFactories: FilterConditionFactory[]): UsePickerWithSelectedValuesResult<TItem, TValue>;
39
32
  export default usePickerWithSelectedValues;
40
33
  //# sourceMappingURL=usePickerWithSelectedValues.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePickerWithSelectedValues.d.ts","sourceRoot":"","sources":["../src/usePickerWithSelectedValues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAkC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAGL,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EAEL,SAAS,EAET,UAAU,EAGX,MAAM,kBAAkB,CAAC;AAE1B,OAAwB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAK3E,MAAM,WAAW,iCAAiC,CAAC,KAAK,EAAE,MAAM;IAC9D,IAAI,EAAE,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,4BAA4B,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,4BAA4B,EAAE,OAAO,CAAC;IACtC,WAAW,EAAE,GAAG,GAAG,IAAI,CAAC;IACxB,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzD,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACnD,cAAc,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,IAAI,CA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AAC;IACzD,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACnD,cAAc,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;CACtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,EACvD,UAAU,EAAE,KAAK,GAAG,IAAI,EACxB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,KAAK,MAAM,EAClD,GAAG,wBAAwB,EAAE,sBAAsB,EAAE,GACpD,iCAAiC,CAAC,KAAK,EAAE,MAAM,CAAC,CA0LlD;AAED,eAAe,2BAA2B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useMemo, useState } from 'react';
2
2
  import { createSearchTextFilter, createSelectedValuesFilter } from '@deephaven/jsapi-utils';
3
- import { useDebouncedCallback, useDebouncedValue, usePromiseFactory } from '@deephaven/react-hooks';
3
+ import { useDebouncedCallback, usePromiseFactory } from '@deephaven/react-hooks';
4
4
  import { COMBO_BOX_ITEM_HEIGHT, SEARCH_DEBOUNCE_MS, VIEWPORT_PADDING, VIEWPORT_SIZE } from '@deephaven/utils';
5
5
  import useFilterConditionFactories from "./useFilterConditionFactories.js";
6
6
  import useViewportData from "./useViewportData.js";
@@ -12,58 +12,36 @@ import useTableClose from "./useTableClose.js";
12
12
  * items are removed from the list and managed in a selectedValueMap data
13
13
  * structure. Useful for components that contain a picker but show selected
14
14
  * values in a separate component.
15
- * @param maybeTable The table to get the list of items from
16
- * @param columnName The column name to get the list of items from
17
- * @param mapItemToValue A function to map an item to a value
18
- * @param filterConditionFactories Optional filter condition factories to apply to the list
19
- * @param trimSearchText Whether to trim the search text before filtering. Defaults to false
15
+ * @param maybeTable
16
+ * @param columnName
17
+ * @param mapItemToValue
18
+ * @param filterConditionFactories
20
19
  */
21
- export function usePickerWithSelectedValues(_ref) {
22
- var {
23
- maybeTable,
24
- columnName,
25
- mapItemToValue,
26
- filterConditionFactories = [],
27
- trimSearchText = false
28
- } = _ref;
20
+ export function usePickerWithSelectedValues(maybeTable, columnName, mapItemToValue) {
29
21
  var tableUtils = useTableUtils();
30
22
 
31
23
  // `searchText` should always be up to date for controlled search input.
32
- // `appliedSearchText` will get updated after a delay to avoid updating
33
- // filters on every key stroke. It will also be trimmed of leading / trailing
34
- // spaces if `trimSearchText` is true.
24
+ // `debouncedSearchText` will get updated after a delay to avoid updating
25
+ // filters on every key stroke.
35
26
  var [searchText, setSearchText] = useState('');
36
- var [appliedSearchText, setAppliedSearchText] = useState('');
37
- var applySearchText = useCallback(text => {
38
- setAppliedSearchText(trimSearchText ? text.trim() : text);
39
- }, [trimSearchText]);
40
- var searchTextMaybeTrimmed = useMemo(() => trimSearchText ? searchText.trim() : searchText, [searchText, trimSearchText]);
27
+ var [debouncedSearchText, setDebouncedSearchText] = useState('');
41
28
  var [selectedKey, setSelectedKey] = useState(null);
42
29
  var [selectedValueMap, setSelectedValueMap] = useState(() => new Map());
43
30
  var {
44
31
  data: valueExists,
45
32
  isLoading: valueExistsIsLoading
46
- } = usePromiseFactory(tableUtils.doesColumnValueExist, [maybeTable, columnName, appliedSearchText, false /* isCaseSensitive */]);
47
-
48
- // The `searchTextFilter` starts getting applied to the list whenever
49
- // `appliedSearchText` changes, after which there is a small delay before the
50
- // items are in sync. Use a debounce timer to allow a little extra time
51
- // before calculating `searchTextExists` below. Note that there are 2 debounce
52
- // timers at play here:
53
- // 1. `onDebouncedSearchTextChange` applies the search text after user stops typing
54
- // 2. `useDebouncedValue` debounces whenever the result of the first debounce
55
- // changes, and `isApplyingFilter` will be true while this 2nd timer is active.
56
- var {
57
- isDebouncing: isApplyingFilter
58
- } = useDebouncedValue(appliedSearchText, SEARCH_DEBOUNCE_MS);
33
+ } = usePromiseFactory(tableUtils.doesColumnValueExist, [maybeTable, columnName, debouncedSearchText, false /* isCaseSensitive */]);
59
34
 
60
35
  // If value exists check is still loading or if debounce hasn't completed, set
61
36
  // `searchTextExists` to null since it is indeterminate.
62
- var searchTextExists = isApplyingFilter || valueExistsIsLoading ? null : valueExists;
63
- var searchTextFilter = useMemo(() => createSearchTextFilter(tableUtils, columnName, appliedSearchText), [appliedSearchText, columnName, tableUtils]);
37
+ var searchTextExists = valueExistsIsLoading || debouncedSearchText !== searchText ? null : valueExists;
38
+ var searchTextFilter = useMemo(() => createSearchTextFilter(tableUtils, columnName, debouncedSearchText), [columnName, debouncedSearchText, tableUtils]);
64
39
 
65
40
  // Filter out selected values from the picker
66
41
  var excludeSelectedValuesFilter = useMemo(() => createSelectedValuesFilter(tableUtils, columnName, new Set(selectedValueMap.keys()), false, true), [columnName, selectedValueMap, tableUtils]);
42
+ for (var _len = arguments.length, filterConditionFactories = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
43
+ filterConditionFactories[_key - 3] = arguments[_key];
44
+ }
67
45
  var {
68
46
  data: listTable
69
47
  } = usePromiseFactory(tableUtils.createDistinctSortedColumnTable, [maybeTable, columnName, 'asc', ...filterConditionFactories]);
@@ -74,9 +52,9 @@ export function usePickerWithSelectedValues(_ref) {
74
52
  viewportSize: VIEWPORT_SIZE,
75
53
  viewportPadding: VIEWPORT_PADDING
76
54
  });
77
- var hasSearchTextWithZeroResults = searchTextMaybeTrimmed.length > 0 && list.size === 0;
78
- var searchTextIsInSelectedValues = selectedValueMap.has(searchTextMaybeTrimmed);
79
- var onDebouncedSearchTextChange = useDebouncedCallback(applySearchText, SEARCH_DEBOUNCE_MS);
55
+ var hasSearchTextWithZeroResults = searchText.length > 0 && list.size === 0;
56
+ var searchTextIsInSelectedValues = selectedValueMap.has(searchText);
57
+ var onDebouncedSearchTextChange = useDebouncedCallback(setDebouncedSearchText, SEARCH_DEBOUNCE_MS);
80
58
  var onSearchTextChange = useCallback(text => {
81
59
  setSearchText(text);
82
60
  onDebouncedSearchTextChange(text);
@@ -84,7 +62,7 @@ export function usePickerWithSelectedValues(_ref) {
84
62
  var setSelectedKeyOnNextFrame = useDebouncedCallback(setSelectedKey, 0);
85
63
  var onSelectKey = useCallback(key => {
86
64
  setSearchText('');
87
- applySearchText('');
65
+ setDebouncedSearchText('');
88
66
 
89
67
  // Set the selection temporarily to avoid the picker staying open
90
68
  setSelectedKey(key);
@@ -110,7 +88,7 @@ export function usePickerWithSelectedValues(_ref) {
110
88
  });
111
89
  return next;
112
90
  });
113
- }, [applySearchText, setSelectedKeyOnNextFrame, list.viewportData, mapItemToValue]);
91
+ }, [setSelectedKeyOnNextFrame, list.viewportData, mapItemToValue]);
114
92
  var onAddValues = useCallback(values => {
115
93
  setSelectedValueMap(prev => {
116
94
  if (values.size === 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"usePickerWithSelectedValues.js","names":["useCallback","useMemo","useState","createSearchTextFilter","createSelectedValuesFilter","useDebouncedCallback","useDebouncedValue","usePromiseFactory","COMBO_BOX_ITEM_HEIGHT","SEARCH_DEBOUNCE_MS","VIEWPORT_PADDING","VIEWPORT_SIZE","useFilterConditionFactories","useViewportData","useViewportFilter","useTableUtils","useTableClose","usePickerWithSelectedValues","_ref","maybeTable","columnName","mapItemToValue","filterConditionFactories","trimSearchText","tableUtils","searchText","setSearchText","appliedSearchText","setAppliedSearchText","applySearchText","text","trim","searchTextMaybeTrimmed","selectedKey","setSelectedKey","selectedValueMap","setSelectedValueMap","Map","data","valueExists","isLoading","valueExistsIsLoading","doesColumnValueExist","isDebouncing","isApplyingFilter","searchTextExists","searchTextFilter","excludeSelectedValuesFilter","Set","keys","listTable","createDistinctSortedColumnTable","list","table","itemHeight","viewportSize","viewportPadding","hasSearchTextWithZeroResults","length","size","searchTextIsInSelectedValues","has","onDebouncedSearchTextChange","onSearchTextChange","setSelectedKeyOnNextFrame","onSelectKey","key","item","viewportData","findItem","value","prev","next","set","onAddValues","values","onRemoveValues","delete","filter"],"sources":["../src/usePickerWithSelectedValues.ts"],"sourcesContent":["import { Key, useCallback, useMemo, useState } from 'react';\nimport type { Table } from '@deephaven/jsapi-types';\nimport {\n createSearchTextFilter,\n createSelectedValuesFilter,\n FilterConditionFactory,\n} from '@deephaven/jsapi-utils';\nimport {\n useDebouncedCallback,\n useDebouncedValue,\n usePromiseFactory,\n} from '@deephaven/react-hooks';\nimport {\n COMBO_BOX_ITEM_HEIGHT,\n KeyedItem,\n SEARCH_DEBOUNCE_MS,\n SelectionT,\n VIEWPORT_PADDING,\n VIEWPORT_SIZE,\n} from '@deephaven/utils';\nimport useFilterConditionFactories from './useFilterConditionFactories';\nimport useViewportData, { UseViewportDataResult } from './useViewportData';\nimport useViewportFilter from './useViewportFilter';\nimport useTableUtils from './useTableUtils';\nimport useTableClose from './useTableClose';\n\nexport interface UsePickerWithSelectedValuesResult<TItem, TValue> {\n list: UseViewportDataResult<TItem, Table>;\n hasSearchTextWithZeroResults: boolean;\n searchText: string;\n searchTextExists: boolean | null;\n searchTextIsInSelectedValues: boolean;\n selectedKey: Key | null;\n selectedValueMap: ReadonlyMap<TValue, { value: TValue }>;\n onSearchTextChange: (searchText: string) => void;\n onSelectKey: (key: Key | null) => void;\n onAddValues: (values: ReadonlySet<TValue>) => void;\n onRemoveValues: (values: SelectionT<TValue>) => void;\n}\n\n/**\n * Manages a list of available items that can be searched and selected. Selected\n * items are removed from the list and managed in a selectedValueMap data\n * structure. Useful for components that contain a picker but show selected\n * values in a separate component.\n * @param maybeTable The table to get the list of items from\n * @param columnName The column name to get the list of items from\n * @param mapItemToValue A function to map an item to a value\n * @param filterConditionFactories Optional filter condition factories to apply to the list\n * @param trimSearchText Whether to trim the search text before filtering. Defaults to false\n */\nexport function usePickerWithSelectedValues<TItem, TValue>({\n maybeTable,\n columnName,\n mapItemToValue,\n filterConditionFactories = [],\n trimSearchText = false,\n}: {\n maybeTable: Table | null;\n columnName: string;\n mapItemToValue: (item: KeyedItem<TItem>) => TValue;\n filterConditionFactories?: FilterConditionFactory[];\n trimSearchText?: boolean;\n}): UsePickerWithSelectedValuesResult<TItem, TValue> {\n const tableUtils = useTableUtils();\n\n // `searchText` should always be up to date for controlled search input.\n // `appliedSearchText` will get updated after a delay to avoid updating\n // filters on every key stroke. It will also be trimmed of leading / trailing\n // spaces if `trimSearchText` is true.\n const [searchText, setSearchText] = useState('');\n const [appliedSearchText, setAppliedSearchText] = useState('');\n\n const applySearchText = useCallback(\n (text: string) => {\n setAppliedSearchText(trimSearchText ? text.trim() : text);\n },\n [trimSearchText]\n );\n\n const searchTextMaybeTrimmed = useMemo(\n () => (trimSearchText ? searchText.trim() : searchText),\n [searchText, trimSearchText]\n );\n\n const [selectedKey, setSelectedKey] = useState<Key | null>(null);\n const [selectedValueMap, setSelectedValueMap] = useState<\n Map<TValue, { value: TValue }>\n >(() => new Map());\n\n const { data: valueExists, isLoading: valueExistsIsLoading } =\n usePromiseFactory(tableUtils.doesColumnValueExist, [\n maybeTable,\n columnName,\n appliedSearchText,\n false /* isCaseSensitive */,\n ]);\n\n // The `searchTextFilter` starts getting applied to the list whenever\n // `appliedSearchText` changes, after which there is a small delay before the\n // items are in sync. Use a debounce timer to allow a little extra time\n // before calculating `searchTextExists` below. Note that there are 2 debounce\n // timers at play here:\n // 1. `onDebouncedSearchTextChange` applies the search text after user stops typing\n // 2. `useDebouncedValue` debounces whenever the result of the first debounce\n // changes, and `isApplyingFilter` will be true while this 2nd timer is active.\n const { isDebouncing: isApplyingFilter } = useDebouncedValue(\n appliedSearchText,\n SEARCH_DEBOUNCE_MS\n );\n\n // If value exists check is still loading or if debounce hasn't completed, set\n // `searchTextExists` to null since it is indeterminate.\n const searchTextExists =\n isApplyingFilter || valueExistsIsLoading ? null : valueExists;\n\n const searchTextFilter = useMemo(\n () => createSearchTextFilter(tableUtils, columnName, appliedSearchText),\n [appliedSearchText, columnName, tableUtils]\n );\n\n // Filter out selected values from the picker\n const excludeSelectedValuesFilter = useMemo(\n () =>\n createSelectedValuesFilter(\n tableUtils,\n columnName,\n new Set(selectedValueMap.keys()),\n false,\n true\n ),\n [columnName, selectedValueMap, tableUtils]\n );\n\n const { data: listTable } = usePromiseFactory(\n tableUtils.createDistinctSortedColumnTable,\n [maybeTable, columnName, 'asc', ...filterConditionFactories]\n );\n\n useTableClose(listTable);\n\n const list = useViewportData<TItem, Table>({\n table: listTable,\n itemHeight: COMBO_BOX_ITEM_HEIGHT,\n viewportSize: VIEWPORT_SIZE,\n viewportPadding: VIEWPORT_PADDING,\n });\n\n const hasSearchTextWithZeroResults =\n searchTextMaybeTrimmed.length > 0 && list.size === 0;\n const searchTextIsInSelectedValues = selectedValueMap.has(\n searchTextMaybeTrimmed as TValue\n );\n\n const onDebouncedSearchTextChange = useDebouncedCallback(\n applySearchText,\n SEARCH_DEBOUNCE_MS\n );\n\n const onSearchTextChange = useCallback(\n (text: string) => {\n setSearchText(text);\n onDebouncedSearchTextChange(text);\n },\n [onDebouncedSearchTextChange]\n );\n\n const setSelectedKeyOnNextFrame = useDebouncedCallback(setSelectedKey, 0);\n\n const onSelectKey = useCallback(\n (key: Key | null) => {\n setSearchText('');\n applySearchText('');\n\n // Set the selection temporarily to avoid the picker staying open\n setSelectedKey(key);\n\n // Clear the selection on next frame since selected items get removed from\n // the list and added to `selectedValues` Map\n setSelectedKeyOnNextFrame(null);\n\n // key will be null in scenarios where search text doesn't match an item\n // and user clicks outside of picker\n if (key == null) {\n return;\n }\n\n const item = list.viewportData.findItem(key);\n\n if (item == null) {\n return;\n }\n\n const value = mapItemToValue(item);\n\n setSelectedValueMap(prev => {\n const next = new Map(prev);\n next.set(value, { value });\n return next;\n });\n },\n [\n applySearchText,\n setSelectedKeyOnNextFrame,\n list.viewportData,\n mapItemToValue,\n ]\n );\n\n const onAddValues = useCallback((values: ReadonlySet<TValue>) => {\n setSelectedValueMap(prev => {\n if (values.size === 0) {\n return prev;\n }\n\n const next = new Map(prev);\n\n // eslint-disable-next-line no-restricted-syntax\n for (const value of values) {\n next.set(value, { value });\n }\n\n return next;\n });\n }, []);\n\n const onRemoveValues = useCallback((values: SelectionT<TValue>) => {\n setSelectedValueMap(prev => {\n if (values === 'all') {\n return new Map();\n }\n\n const next = new Map(prev);\n\n // eslint-disable-next-line no-restricted-syntax\n for (const value of values) {\n next.delete(value);\n }\n\n return next;\n });\n }, []);\n\n const filter = useFilterConditionFactories(\n list.table,\n searchTextFilter,\n excludeSelectedValuesFilter\n );\n\n useViewportFilter(list, filter);\n\n return useMemo(\n () => ({\n list,\n hasSearchTextWithZeroResults,\n searchText,\n searchTextExists,\n searchTextIsInSelectedValues,\n selectedKey,\n selectedValueMap,\n onSearchTextChange,\n onSelectKey,\n onAddValues,\n onRemoveValues,\n }),\n [\n hasSearchTextWithZeroResults,\n list,\n onAddValues,\n onRemoveValues,\n onSearchTextChange,\n onSelectKey,\n searchText,\n searchTextExists,\n searchTextIsInSelectedValues,\n selectedKey,\n selectedValueMap,\n ]\n );\n}\n\nexport default usePickerWithSelectedValues;\n"],"mappings":"AAAA,SAAcA,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAE3D,SACEC,sBAAsB,EACtBC,0BAA0B,QAErB,wBAAwB;AAC/B,SACEC,oBAAoB,EACpBC,iBAAiB,EACjBC,iBAAiB,QACZ,wBAAwB;AAC/B,SACEC,qBAAqB,EAErBC,kBAAkB,EAElBC,gBAAgB,EAChBC,aAAa,QACR,kBAAkB;AAAC,OACnBC,2BAA2B;AAAA,OAC3BC,eAAe;AAAA,OACfC,iBAAiB;AAAA,OACjBC,aAAa;AAAA,OACbC,aAAa;AAgBpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,2BAA2BA,CAAAC,IAAA,EAYU;EAAA,IAZM;IACzDC,UAAU;IACVC,UAAU;IACVC,cAAc;IAC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cAAc,GAAG5E,WAAW,CAAE2E,MAA0B,IAAK;IACjEvC,mBAAmB,CAACmC,IAAI,IAAI;MAC1B,IAAII,MAAM,KAAK,KAAK,EAAE;QACpB,OAAO,IAAItC,GAAG,CAAC,CAAC;MAClB;MAEA,IAAMmC,IAAI,GAAG,IAAInC,GAAG,CAACkC,IAAI,CAAC;;MAE1B;MACA,KAAK,IAAMD,KAAK,IAAIK,MAAM,EAAE;QAC1BH,IAAI,CAACK,MAAM,CAACP,KAAK,CAAC;MACpB;MAEA,OAAOE,IAAI;IACb,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,IAAMM,MAAM,GAAGlE,2BAA2B,CACxCwC,IAAI,CAACC,KAAK,EACVP,gBAAgB,EAChBC,2BACF,CAAC;EAEDjC,iBAAiB,CAACsC,IAAI,EAAE0B,MAAM,CAAC;EAE/B,OAAO7E,OAAO,CACZ,OAAO;IACLmD,IAAI;IACJK,4BAA4B;IAC5BhC,UAAU;IACVoB,gBAAgB;IAChBe,4BAA4B;IAC5B3B,WAAW;IACXE,gBAAgB;IAChB4B,kBAAkB;IAClBE,WAAW;IACXS,WAAW;IACXE;EACF,CAAC,CAAC,EACF,CACEnB,4BAA4B,EAC5BL,IAAI,EACJsB,WAAW,EACXE,cAAc,EACdb,kBAAkB,EAClBE,WAAW,EACXxC,UAAU,EACVoB,gBAAgB,EAChBe,4BAA4B,EAC5B3B,WAAW,EACXE,gBAAgB,CAEpB,CAAC;AACH;AAEA,eAAelB,2BAA2B"}
1
+ {"version":3,"file":"usePickerWithSelectedValues.js","names":["useCallback","useMemo","useState","createSearchTextFilter","createSelectedValuesFilter","useDebouncedCallback","usePromiseFactory","COMBO_BOX_ITEM_HEIGHT","SEARCH_DEBOUNCE_MS","VIEWPORT_PADDING","VIEWPORT_SIZE","useFilterConditionFactories","useViewportData","useViewportFilter","useTableUtils","useTableClose","usePickerWithSelectedValues","maybeTable","columnName","mapItemToValue","tableUtils","searchText","setSearchText","debouncedSearchText","setDebouncedSearchText","selectedKey","setSelectedKey","selectedValueMap","setSelectedValueMap","Map","data","valueExists","isLoading","valueExistsIsLoading","doesColumnValueExist","searchTextExists","searchTextFilter","excludeSelectedValuesFilter","Set","keys","_len","arguments","length","filterConditionFactories","Array","_key","listTable","createDistinctSortedColumnTable","list","table","itemHeight","viewportSize","viewportPadding","hasSearchTextWithZeroResults","size","searchTextIsInSelectedValues","has","onDebouncedSearchTextChange","onSearchTextChange","text","setSelectedKeyOnNextFrame","onSelectKey","key","item","viewportData","findItem","value","prev","next","set","onAddValues","values","onRemoveValues","delete","filter"],"sources":["../src/usePickerWithSelectedValues.ts"],"sourcesContent":["import { Key, useCallback, useMemo, useState } from 'react';\nimport type { Table } from '@deephaven/jsapi-types';\nimport {\n createSearchTextFilter,\n createSelectedValuesFilter,\n FilterConditionFactory,\n} from '@deephaven/jsapi-utils';\nimport {\n useDebouncedCallback,\n usePromiseFactory,\n} from '@deephaven/react-hooks';\nimport {\n COMBO_BOX_ITEM_HEIGHT,\n KeyedItem,\n SEARCH_DEBOUNCE_MS,\n SelectionT,\n VIEWPORT_PADDING,\n VIEWPORT_SIZE,\n} from '@deephaven/utils';\nimport useFilterConditionFactories from './useFilterConditionFactories';\nimport useViewportData, { UseViewportDataResult } from './useViewportData';\nimport useViewportFilter from './useViewportFilter';\nimport useTableUtils from './useTableUtils';\nimport useTableClose from './useTableClose';\n\nexport interface UsePickerWithSelectedValuesResult<TItem, TValue> {\n list: UseViewportDataResult<TItem, Table>;\n hasSearchTextWithZeroResults: boolean;\n searchText: string;\n searchTextExists: boolean | null;\n searchTextIsInSelectedValues: boolean;\n selectedKey: Key | null;\n selectedValueMap: ReadonlyMap<TValue, { value: TValue }>;\n onSearchTextChange: (searchText: string) => void;\n onSelectKey: (key: Key | null) => void;\n onAddValues: (values: ReadonlySet<TValue>) => void;\n onRemoveValues: (values: SelectionT<TValue>) => void;\n}\n\n/**\n * Manages a list of available items that can be searched and selected. Selected\n * items are removed from the list and managed in a selectedValueMap data\n * structure. Useful for components that contain a picker but show selected\n * values in a separate component.\n * @param maybeTable\n * @param columnName\n * @param mapItemToValue\n * @param filterConditionFactories\n */\nexport function usePickerWithSelectedValues<TItem, TValue>(\n maybeTable: Table | null,\n columnName: string,\n mapItemToValue: (item: KeyedItem<TItem>) => TValue,\n ...filterConditionFactories: FilterConditionFactory[]\n): UsePickerWithSelectedValuesResult<TItem, TValue> {\n const tableUtils = useTableUtils();\n\n // `searchText` should always be up to date for controlled search input.\n // `debouncedSearchText` will get updated after a delay to avoid updating\n // filters on every key stroke.\n const [searchText, setSearchText] = useState('');\n const [debouncedSearchText, setDebouncedSearchText] = useState('');\n\n const [selectedKey, setSelectedKey] = useState<Key | null>(null);\n const [selectedValueMap, setSelectedValueMap] = useState<\n Map<TValue, { value: TValue }>\n >(() => new Map());\n\n const { data: valueExists, isLoading: valueExistsIsLoading } =\n usePromiseFactory(tableUtils.doesColumnValueExist, [\n maybeTable,\n columnName,\n debouncedSearchText,\n false /* isCaseSensitive */,\n ]);\n\n // If value exists check is still loading or if debounce hasn't completed, set\n // `searchTextExists` to null since it is indeterminate.\n const searchTextExists =\n valueExistsIsLoading || debouncedSearchText !== searchText\n ? null\n : valueExists;\n\n const searchTextFilter = useMemo(\n () => createSearchTextFilter(tableUtils, columnName, debouncedSearchText),\n [columnName, debouncedSearchText, tableUtils]\n );\n\n // Filter out selected values from the picker\n const excludeSelectedValuesFilter = useMemo(\n () =>\n createSelectedValuesFilter(\n tableUtils,\n columnName,\n new Set(selectedValueMap.keys()),\n false,\n true\n ),\n [columnName, selectedValueMap, tableUtils]\n );\n\n const { data: listTable } = usePromiseFactory(\n tableUtils.createDistinctSortedColumnTable,\n [maybeTable, columnName, 'asc', ...filterConditionFactories]\n );\n\n useTableClose(listTable);\n\n const list = useViewportData<TItem, Table>({\n table: listTable,\n itemHeight: COMBO_BOX_ITEM_HEIGHT,\n viewportSize: VIEWPORT_SIZE,\n viewportPadding: VIEWPORT_PADDING,\n });\n\n const hasSearchTextWithZeroResults = searchText.length > 0 && list.size === 0;\n const searchTextIsInSelectedValues = selectedValueMap.has(\n searchText as TValue\n );\n\n const onDebouncedSearchTextChange = useDebouncedCallback(\n setDebouncedSearchText,\n SEARCH_DEBOUNCE_MS\n );\n\n const onSearchTextChange = useCallback(\n (text: string) => {\n setSearchText(text);\n onDebouncedSearchTextChange(text);\n },\n [onDebouncedSearchTextChange]\n );\n\n const setSelectedKeyOnNextFrame = useDebouncedCallback(setSelectedKey, 0);\n\n const onSelectKey = useCallback(\n (key: Key | null) => {\n setSearchText('');\n setDebouncedSearchText('');\n\n // Set the selection temporarily to avoid the picker staying open\n setSelectedKey(key);\n\n // Clear the selection on next frame since selected items get removed from\n // the list and added to `selectedValues` Map\n setSelectedKeyOnNextFrame(null);\n\n // key will be null in scenarios where search text doesn't match an item\n // and user clicks outside of picker\n if (key == null) {\n return;\n }\n\n const item = list.viewportData.findItem(key);\n\n if (item == null) {\n return;\n }\n\n const value = mapItemToValue(item);\n\n setSelectedValueMap(prev => {\n const next = new Map(prev);\n next.set(value, { value });\n return next;\n });\n },\n [setSelectedKeyOnNextFrame, list.viewportData, mapItemToValue]\n );\n\n const onAddValues = useCallback((values: ReadonlySet<TValue>) => {\n setSelectedValueMap(prev => {\n if (values.size === 0) {\n return prev;\n }\n\n const next = new Map(prev);\n\n // eslint-disable-next-line no-restricted-syntax\n for (const value of values) {\n next.set(value, { value });\n }\n\n return next;\n });\n }, []);\n\n const onRemoveValues = useCallback((values: SelectionT<TValue>) => {\n setSelectedValueMap(prev => {\n if (values === 'all') {\n return new Map();\n }\n\n const next = new Map(prev);\n\n // eslint-disable-next-line no-restricted-syntax\n for (const value of values) {\n next.delete(value);\n }\n\n return next;\n });\n }, []);\n\n const filter = useFilterConditionFactories(\n list.table,\n searchTextFilter,\n excludeSelectedValuesFilter\n );\n\n useViewportFilter(list, filter);\n\n return useMemo(\n () => ({\n list,\n hasSearchTextWithZeroResults,\n searchText,\n searchTextExists,\n searchTextIsInSelectedValues,\n selectedKey,\n selectedValueMap,\n onSearchTextChange,\n onSelectKey,\n onAddValues,\n onRemoveValues,\n }),\n [\n hasSearchTextWithZeroResults,\n list,\n onAddValues,\n onRemoveValues,\n onSearchTextChange,\n onSelectKey,\n searchText,\n searchTextExists,\n searchTextIsInSelectedValues,\n selectedKey,\n selectedValueMap,\n ]\n );\n}\n\nexport default usePickerWithSelectedValues;\n"],"mappings":"AAAA,SAAcA,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAE3D,SACEC,sBAAsB,EACtBC,0BAA0B,QAErB,wBAAwB;AAC/B,SACEC,oBAAoB,EACpBC,iBAAiB,QACZ,wBAAwB;AAC/B,SACEC,qBAAqB,EAErBC,kBAAkB,EAElBC,gBAAgB,EAChBC,aAAa,QACR,kBAAkB;AAAC,OACnBC,2BAA2B;AAAA,OAC3BC,eAAe;AAAA,OACfC,iBAAiB;AAAA,OACjBC,aAAa;AAAA,OACbC,aAAa;AAgBpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,2BAA2BA,CACzCC,UAAwB,EACxBC,UAAkB,EAClBC,cAAkD,EAEA;EAClD,IAAMC,UAAU,GAAGN,aAAa,CAAC,CAAC;;EAElC;EACA;EACA;EACA,IAAM,CAACO,UAAU,EAAEC,aAAa,CAAC,GAAGpB,QAAQ,CAAC,EAAE,CAAC;EAChD,IAAM,CAACqB,mBAAmB,EAAEC,sBAAsB,CAAC,GAAGtB,QAAQ,CAAC,EAAE,CAAC;EAElE,IAAM,CAACuB,WAAW,EAAEC,cAAc,CAAC,GAAGxB,QAAQ,CAAa,IAAI,CAAC;EAChE,IAAM,CAACyB,gBAAgB,EAAEC,mBAAmB,CAAC,GAAG1B,QAAQ,CAEtD,MAAM,IAAI2B,GAAG,CAAC,CAAC,CAAC;EAElB,IAAM;IAAEC,IAAI,EAAEC,WAAW;IAAEC,SAAS,EAAEC;EAAqB,CAAC,GAC1D3B,i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AClBG,WAAW,EACXxC,UAAU,EACVc,gBAAgB,EAChBoB,4BAA4B,EAC5B9B,WAAW,EACXE,gBAAgB,CAEpB,CAAC;AACH;AAEA,eAAeX,2BAA2B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/jsapi-components",
3
- "version": "0.60.1-beta.5+b047fa36",
3
+ "version": "0.60.1-object-fetcher.6+6a7af1e6",
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.60.1-beta.5+b047fa36",
26
- "@deephaven/jsapi-bootstrap": "^0.60.1-beta.5+b047fa36",
27
- "@deephaven/jsapi-types": "^0.60.1-beta.5+b047fa36",
28
- "@deephaven/jsapi-utils": "^0.60.1-beta.5+b047fa36",
29
- "@deephaven/log": "^0.60.1-beta.5+b047fa36",
30
- "@deephaven/react-hooks": "^0.60.1-beta.5+b047fa36",
31
- "@deephaven/utils": "^0.60.1-beta.5+b047fa36",
25
+ "@deephaven/components": "^0.60.1-object-fetcher.6+6a7af1e6",
26
+ "@deephaven/jsapi-bootstrap": "^0.60.1-object-fetcher.6+6a7af1e6",
27
+ "@deephaven/jsapi-types": "^0.60.1-object-fetcher.6+6a7af1e6",
28
+ "@deephaven/jsapi-utils": "^0.60.1-object-fetcher.6+6a7af1e6",
29
+ "@deephaven/log": "^0.60.1-object-fetcher.6+6a7af1e6",
30
+ "@deephaven/react-hooks": "^0.60.1-object-fetcher.6+6a7af1e6",
31
+ "@deephaven/utils": "^0.60.1-object-fetcher.6+6a7af1e6",
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.60.1-beta.5+b047fa36",
39
+ "@deephaven/jsapi-shim": "^0.60.1-object-fetcher.6+6a7af1e6",
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": "b047fa36de3a285be925736ef73722a60d1d9ed7"
54
+ "gitHead": "6a7af1e6366a33dddcd7534fbc0d50d82509a137"
55
55
  }
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import type { IdeConnection } from '@deephaven/jsapi-types';
3
- export declare const ConnectionContext: import("react").Context<IdeConnection | null>;
4
- export default ConnectionContext;
5
- //# sourceMappingURL=ConnectionContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConnectionContext.d.ts","sourceRoot":"","sources":["../src/ConnectionContext.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,eAAO,MAAM,iBAAiB,+CAA4C,CAAC;AAE3E,eAAe,iBAAiB,CAAC"}
@@ -1,4 +0,0 @@
1
- import { createContext } from 'react';
2
- export var ConnectionContext = /*#__PURE__*/createContext(null);
3
- export default ConnectionContext;
4
- //# sourceMappingURL=ConnectionContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConnectionContext.js","names":["createContext","ConnectionContext"],"sources":["../src/ConnectionContext.ts"],"sourcesContent":["import { createContext } from 'react';\nimport type { IdeConnection } from '@deephaven/jsapi-types';\n\nexport const ConnectionContext = createContext<IdeConnection | null>(null);\n\nexport default ConnectionContext;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,OAAO;AAGrC,OAAO,IAAMC,iBAAiB,gBAAGD,aAAa,CAAuB,IAAI,CAAC;AAE1E,eAAeC,iBAAiB"}
@@ -1,4 +0,0 @@
1
- import type { IdeConnection } from '@deephaven/jsapi-types';
2
- export declare function useConnection(): IdeConnection;
3
- export default useConnection;
4
- //# sourceMappingURL=useConnection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useConnection.d.ts","sourceRoot":"","sources":["../src/useConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,wBAAgB,aAAa,IAAI,aAAa,CAK7C;AAED,eAAe,aAAa,CAAC"}
@@ -1,7 +0,0 @@
1
- import { useContextOrThrow } from '@deephaven/react-hooks';
2
- import { ConnectionContext } from "./ConnectionContext.js";
3
- export function useConnection() {
4
- return useContextOrThrow(ConnectionContext, 'No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?');
5
- }
6
- export default useConnection;
7
- //# sourceMappingURL=useConnection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useConnection.js","names":["useContextOrThrow","ConnectionContext","useConnection"],"sources":["../src/useConnection.ts"],"sourcesContent":["import type { IdeConnection } from '@deephaven/jsapi-types';\nimport { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ConnectionContext } from './ConnectionContext';\n\nexport function useConnection(): IdeConnection {\n return useContextOrThrow(\n ConnectionContext,\n 'No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?'\n );\n}\n\nexport default useConnection;\n"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,wBAAwB;AAAC,SAClDC,iBAAiB;AAE1B,OAAO,SAASC,aAAaA,CAAA,EAAkB;EAC7C,OAAOF,iBAAiB,CACtBC,iBAAiB,EACjB,8FACF,CAAC;AACH;AAEA,eAAeC,aAAa"}