@deephaven/iris-grid 0.85.3-core-plugins.6 → 0.86.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/dist/IrisGrid.d.ts +9 -4
- package/dist/IrisGrid.d.ts.map +1 -1
- package/dist/IrisGrid.js +94 -60
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridPartitionSelector.css +1 -2
- package/dist/IrisGridPartitionSelector.css.map +1 -1
- package/dist/IrisGridPartitionSelector.d.ts +5 -6
- package/dist/IrisGridPartitionSelector.d.ts.map +1 -1
- package/dist/IrisGridPartitionSelector.js +68 -84
- package/dist/IrisGridPartitionSelector.js.map +1 -1
- package/dist/IrisGridPartitionedTableModel.d.ts +5 -0
- package/dist/IrisGridPartitionedTableModel.d.ts.map +1 -1
- package/dist/IrisGridPartitionedTableModel.js +24 -4
- package/dist/IrisGridPartitionedTableModel.js.map +1 -1
- package/dist/IrisGridProxyModel.js +1 -1
- package/dist/IrisGridProxyModel.js.map +1 -1
- package/dist/IrisGridTableModel.d.ts +2 -0
- package/dist/IrisGridTableModel.d.ts.map +1 -1
- package/dist/IrisGridTableModel.js +36 -27
- package/dist/IrisGridTableModel.js.map +1 -1
- package/dist/PartitionedGridModel.d.ts +5 -1
- package/dist/PartitionedGridModel.d.ts.map +1 -1
- package/dist/PartitionedGridModel.js.map +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts.map +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.js +11 -0
- package/dist/mousehandlers/IrisGridContextMenuHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridPartitionedTableMouseHandler.d.ts +12 -0
- package/dist/mousehandlers/IrisGridPartitionedTableMouseHandler.d.ts.map +1 -0
- package/dist/mousehandlers/IrisGridPartitionedTableMouseHandler.js +38 -0
- package/dist/mousehandlers/IrisGridPartitionedTableMouseHandler.js.map +1 -0
- package/dist/mousehandlers/index.d.ts +1 -0
- package/dist/mousehandlers/index.d.ts.map +1 -1
- package/dist/mousehandlers/index.js +1 -0
- package/dist/mousehandlers/index.js.map +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../src/IrisGridPartitionSelector.scss","../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;AC6LA;AC5LA;EACE;EACA;EACA;EACA;EACA,SCDS;EDET,KCFS;;ADIT;EACE;EACA;EACA,KCPO;;ADSP;EACE;;AAGJ;EACE;EACA;EACA;EACA;EACA,KClBO","file":"IrisGridPartitionSelector.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.iris-grid-partition-selector {\n display: flex;\n flex-wrap: wrap;\n background: var(--dh-color-surface-bg);\n align-items: center;\n padding: $spacer-2;\n gap: $spacer-2;\n\n .column-selector {\n display: flex;\n align-items: center;\n gap: $spacer-2;\n\n .custom-select {\n min-width: 4rem;\n }\n }\n .partition-button-group {\n display: flex;\n border: 1px var(--dh-color-hr);\n border-style: none solid;\n padding: 0 $spacer-2;\n gap: $spacer-2;\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: 28%;\n"]}
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../src/IrisGridPartitionSelector.scss","../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;AC6LA;AC5LA;EACE;EACA;EACA;EACA;EACA,SCDS;EDET,KCFS;;ADIT;EACE;EACA;EACA,KCPO;;ADSP;EACE;;AAGJ;EACE;EACA;EACA;EACA,KCjBO","file":"IrisGridPartitionSelector.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.iris-grid-partition-selector {\n display: flex;\n flex-wrap: wrap;\n background: var(--dh-color-surface-bg);\n align-items: center;\n padding: $spacer-2;\n gap: $spacer-2;\n\n .column-selector {\n display: flex;\n align-items: center;\n gap: $spacer-2;\n\n .custom-select {\n min-width: 4rem;\n }\n }\n .partition-button-group {\n display: flex;\n border-right: 1px solid var(--dh-color-hr);\n padding: 0 $spacer-2;\n gap: $spacer-2;\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: 28%;\n"]}
|
|
@@ -7,15 +7,14 @@ import './IrisGridPartitionSelector.scss';
|
|
|
7
7
|
import { PartitionConfig, PartitionedGridModel } from './PartitionedGridModel';
|
|
8
8
|
interface IrisGridPartitionSelectorProps {
|
|
9
9
|
model: PartitionedGridModel;
|
|
10
|
-
partitionConfig
|
|
10
|
+
partitionConfig?: PartitionConfig;
|
|
11
11
|
onChange: (partitionConfig: PartitionConfig) => void;
|
|
12
12
|
}
|
|
13
13
|
interface IrisGridPartitionSelectorState {
|
|
14
14
|
isLoading: boolean;
|
|
15
|
+
baseTable: dh.Table | null;
|
|
15
16
|
keysTable: dh.Table | null;
|
|
16
17
|
partitionTables: dh.Table[] | null;
|
|
17
|
-
/** The filters to apply to each partition table */
|
|
18
|
-
partitionFilters: dh.FilterCondition[][] | null;
|
|
19
18
|
}
|
|
20
19
|
declare class IrisGridPartitionSelector extends Component<IrisGridPartitionSelectorProps, IrisGridPartitionSelectorState> {
|
|
21
20
|
constructor(props: IrisGridPartitionSelectorProps);
|
|
@@ -24,7 +23,7 @@ declare class IrisGridPartitionSelector extends Component<IrisGridPartitionSelec
|
|
|
24
23
|
componentWillUnmount(): void;
|
|
25
24
|
pending: Pending;
|
|
26
25
|
tableUtils: TableUtils;
|
|
27
|
-
|
|
26
|
+
handlePartitionTableClick(): void;
|
|
28
27
|
handleMergeClick(): void;
|
|
29
28
|
/**
|
|
30
29
|
* Handles when a partition dropdown selection is changed. Will send an update with the new partition config
|
|
@@ -40,9 +39,9 @@ declare class IrisGridPartitionSelector extends Component<IrisGridPartitionSelec
|
|
|
40
39
|
*/
|
|
41
40
|
getDisplayValue(index: number, value: unknown): string;
|
|
42
41
|
/**
|
|
43
|
-
* Update the
|
|
42
|
+
* Update the options on the partition dropdown tables
|
|
44
43
|
*/
|
|
45
|
-
|
|
44
|
+
updatePartitionOptions(): Promise<void>;
|
|
46
45
|
getPartitionFilters(partitionTables: dh.Table[]): dh.FilterCondition[][];
|
|
47
46
|
getCachedChangeCallback: ((index: number) => (value: unknown) => Promise<void>) & memoizee.Memoized<(index: number) => (value: unknown) => Promise<void>>;
|
|
48
47
|
getCachedFormatValueCallback: ((index: number) => (value: unknown) => string) & memoizee.Memoized<(index: number) => (value: unknown) => string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridPartitionSelector.d.ts","sourceRoot":"","sources":["../src/IrisGridPartitionSelector.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAMhC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAiB,OAAO,EAAgB,MAAM,kBAAkB,CAAC;AACxE,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,oBAAoB,EA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,yBAAyB,IAAI,IAAI;IAajC,gBAAgB,IAAI,IAAI;IAYxB;;;;OAIG;IACG,qBAAqB,CACzB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,OAAO,GACrB,OAAO,CAAC,IAAI,CAAC;IAoDhB,UAAU,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI;IAOlD;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM;IAiBtD;;OAEG;IACG,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAyB7C,mBAAmB,CAAC,eAAe,EAAE,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,eAAe,EAAE,EAAE;IAmCxE,uBAAuB,WACb,MAAM,aAAa,OAAO,gDAA1B,MAAM,aAAa,OAAO,oBAElC;IAEF,4BAA4B,WAClB,MAAM,aAAa,OAAO,yCAA1B,MAAM,aAAa,OAAO,aAClC;IAEF,MAAM,IAAI,GAAG,CAAC,OAAO;CA8DtB;AAED,eAAe,yBAAyB,CAAC"}
|
|
@@ -25,7 +25,7 @@ class IrisGridPartitionSelector extends Component {
|
|
|
25
25
|
_defineProperty(this, "tableUtils", void 0);
|
|
26
26
|
_defineProperty(this, "getCachedChangeCallback", memoizee(index => value => this.handlePartitionSelect(index, value)));
|
|
27
27
|
_defineProperty(this, "getCachedFormatValueCallback", memoizee(index => value => this.getDisplayValue(index, value)));
|
|
28
|
-
this.
|
|
28
|
+
this.handlePartitionTableClick = this.handlePartitionTableClick.bind(this);
|
|
29
29
|
this.handleMergeClick = this.handleMergeClick.bind(this);
|
|
30
30
|
this.handlePartitionSelect = this.handlePartitionSelect.bind(this);
|
|
31
31
|
var {
|
|
@@ -36,8 +36,8 @@ class IrisGridPartitionSelector extends Component {
|
|
|
36
36
|
this.state = {
|
|
37
37
|
// We start be loading the partition tables, so we should be in a loading state
|
|
38
38
|
isLoading: true,
|
|
39
|
+
baseTable: null,
|
|
39
40
|
keysTable: null,
|
|
40
|
-
partitionFilters: null,
|
|
41
41
|
partitionTables: null
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -48,26 +48,14 @@ class IrisGridPartitionSelector extends Component {
|
|
|
48
48
|
model
|
|
49
49
|
} = _this.props;
|
|
50
50
|
try {
|
|
51
|
-
var keysTable = yield _this.pending.add(model.partitionKeysTable().then(keyTable =>
|
|
52
|
-
|
|
53
|
-
keyTable.applySort(sorts);
|
|
54
|
-
return keyTable;
|
|
55
|
-
}), t => t.close());
|
|
56
|
-
var partitionTables = yield Promise.all(model.partitionColumns.map( /*#__PURE__*/function () {
|
|
57
|
-
var _ref = _asyncToGenerator(function* (_, i) {
|
|
58
|
-
return _this.pending.add(keysTable.selectDistinct(model.partitionColumns.slice(0, i + 1)), t => t.close());
|
|
59
|
-
});
|
|
60
|
-
return function (_x, _x2) {
|
|
61
|
-
return _ref.apply(this, arguments);
|
|
62
|
-
};
|
|
63
|
-
}()));
|
|
64
|
-
var partitionFilters = _this.getPartitionFilters(partitionTables);
|
|
51
|
+
var keysTable = yield _this.pending.add(model.partitionKeysTable().then(keyTable => keyTable), t => t.close());
|
|
52
|
+
var baseTable = yield _this.pending.add(model.partitionBaseTable(), t => t.close());
|
|
65
53
|
_this.setState({
|
|
66
|
-
isLoading: false,
|
|
67
54
|
keysTable,
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
baseTable,
|
|
56
|
+
isLoading: false
|
|
70
57
|
});
|
|
58
|
+
_this.updatePartitionOptions();
|
|
71
59
|
} catch (e) {
|
|
72
60
|
if (!PromiseUtils.isCanceled(e)) {
|
|
73
61
|
// Just re-throw the error if it's not a cancel
|
|
@@ -84,23 +72,26 @@ class IrisGridPartitionSelector extends Component {
|
|
|
84
72
|
partitionConfig
|
|
85
73
|
} = this.props;
|
|
86
74
|
if (prevConfig !== partitionConfig) {
|
|
87
|
-
this.
|
|
75
|
+
this.updatePartitionOptions();
|
|
88
76
|
}
|
|
89
77
|
}
|
|
90
78
|
componentWillUnmount() {
|
|
91
79
|
this.pending.cancel();
|
|
92
80
|
var {
|
|
93
81
|
keysTable,
|
|
82
|
+
baseTable,
|
|
94
83
|
partitionTables
|
|
95
84
|
} = this.state;
|
|
85
|
+
baseTable === null || baseTable === void 0 ? void 0 : baseTable.close();
|
|
96
86
|
keysTable === null || keysTable === void 0 ? void 0 : keysTable.close();
|
|
97
87
|
partitionTables === null || partitionTables === void 0 ? void 0 : partitionTables.forEach(table => table.close());
|
|
98
88
|
}
|
|
99
|
-
|
|
100
|
-
log.debug2('
|
|
89
|
+
handlePartitionTableClick() {
|
|
90
|
+
log.debug2('handlePartitionTableClick');
|
|
101
91
|
var {
|
|
102
92
|
partitionConfig
|
|
103
93
|
} = this.props;
|
|
94
|
+
assertNotNull(partitionConfig);
|
|
104
95
|
var newPartitionConfig = _objectSpread({}, partitionConfig);
|
|
105
96
|
// Toggle between Keys and Partition mode
|
|
106
97
|
newPartitionConfig.mode = partitionConfig.mode === 'keys' ? 'partition' : 'keys';
|
|
@@ -111,6 +102,7 @@ class IrisGridPartitionSelector extends Component {
|
|
|
111
102
|
var {
|
|
112
103
|
partitionConfig
|
|
113
104
|
} = this.props;
|
|
105
|
+
assertNotNull(partitionConfig);
|
|
114
106
|
var newPartitionConfig = _objectSpread({}, partitionConfig);
|
|
115
107
|
// Toggle between Merged and Partition mode
|
|
116
108
|
newPartitionConfig.mode = partitionConfig.mode === 'merged' ? 'partition' : 'merged';
|
|
@@ -126,31 +118,25 @@ class IrisGridPartitionSelector extends Component {
|
|
|
126
118
|
var _this2 = this;
|
|
127
119
|
return _asyncToGenerator(function* () {
|
|
128
120
|
var {
|
|
129
|
-
model,
|
|
130
121
|
partitionConfig: prevConfig
|
|
131
122
|
} = _this2.props;
|
|
123
|
+
assertNotNull(prevConfig);
|
|
132
124
|
log.debug('handlePartitionSelect', index, selectedValue, prevConfig);
|
|
133
125
|
var newPartitions = [...prevConfig.partitions];
|
|
134
126
|
newPartitions[index] = selectedValue;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
_this2.sendUpdate({
|
|
139
|
-
partitions: newPartitions,
|
|
140
|
-
mode: 'partition'
|
|
141
|
-
});
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
127
|
+
var {
|
|
128
|
+
baseTable
|
|
129
|
+
} = _this2.state;
|
|
144
130
|
var {
|
|
145
131
|
keysTable
|
|
146
132
|
} = _this2.state;
|
|
147
|
-
|
|
133
|
+
assertNotNull(baseTable);
|
|
148
134
|
assertNotNull(keysTable);
|
|
149
135
|
try {
|
|
150
136
|
_this2.setState({
|
|
151
137
|
isLoading: true
|
|
152
138
|
});
|
|
153
|
-
var t = yield _this2.pending.add(
|
|
139
|
+
var t = yield _this2.pending.add(baseTable.copy(), tCopy => tCopy.close());
|
|
154
140
|
|
|
155
141
|
// Apply our partition filters, and just get the first value
|
|
156
142
|
var partitionFilters = newPartitions.slice(0, index + 1).map((partition, i) => {
|
|
@@ -164,10 +150,7 @@ class IrisGridPartitionSelector extends Component {
|
|
|
164
150
|
// Core JSAPI returns undefined for null table values,
|
|
165
151
|
// coalesce with null to differentiate null from no selection in the dropdown
|
|
166
152
|
// https://github.com/deephaven/deephaven-core/issues/5400
|
|
167
|
-
partitions:
|
|
168
|
-
var _data$rows$0$get;
|
|
169
|
-
return (_data$rows$0$get = data.rows[0].get(column)) !== null && _data$rows$0$get !== void 0 ? _data$rows$0$get : null;
|
|
170
|
-
}),
|
|
153
|
+
partitions: keysTable.columns.map(column => data.rows[0].get(column)),
|
|
171
154
|
mode: 'partition'
|
|
172
155
|
};
|
|
173
156
|
t.close();
|
|
@@ -214,35 +197,48 @@ class IrisGridPartitionSelector extends Component {
|
|
|
214
197
|
}
|
|
215
198
|
|
|
216
199
|
/**
|
|
217
|
-
* Update the
|
|
200
|
+
* Update the options on the partition dropdown tables
|
|
218
201
|
*/
|
|
219
|
-
|
|
220
|
-
var
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
202
|
+
updatePartitionOptions() {
|
|
203
|
+
var _this3 = this;
|
|
204
|
+
return _asyncToGenerator(function* () {
|
|
205
|
+
var {
|
|
206
|
+
model
|
|
207
|
+
} = _this3.props;
|
|
208
|
+
var {
|
|
209
|
+
partitionConfig: prevConfig
|
|
210
|
+
} = _this3.props;
|
|
211
|
+
if (prevConfig == null) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
var {
|
|
215
|
+
keysTable
|
|
216
|
+
} = _this3.state;
|
|
217
|
+
assertNotNull(keysTable);
|
|
218
|
+
var partitionFilters = [...prevConfig.partitions].map((partition, i) => {
|
|
219
|
+
var partitionColumn = keysTable.columns[i];
|
|
220
|
+
return _this3.tableUtils.makeNullableEqFilter(partitionColumn, partition);
|
|
221
|
+
});
|
|
222
|
+
var partitionTables = yield Promise.all(model.partitionColumns.map( /*#__PURE__*/function () {
|
|
223
|
+
var _ref = _asyncToGenerator(function* (_, i) {
|
|
224
|
+
keysTable.applyFilter(partitionFilters.slice(0, i));
|
|
225
|
+
return keysTable.selectDistinct(model.partitionColumns.slice(0, i + 1));
|
|
226
|
+
});
|
|
227
|
+
return function (_x, _x2) {
|
|
228
|
+
return _ref.apply(this, arguments);
|
|
229
|
+
};
|
|
230
|
+
}()));
|
|
231
|
+
_this3.setState({
|
|
232
|
+
partitionTables
|
|
233
|
+
});
|
|
234
|
+
})();
|
|
240
235
|
}
|
|
241
236
|
getPartitionFilters(partitionTables) {
|
|
242
237
|
var {
|
|
243
238
|
model,
|
|
244
239
|
partitionConfig
|
|
245
240
|
} = this.props;
|
|
241
|
+
assertNotNull(partitionConfig);
|
|
246
242
|
var {
|
|
247
243
|
partitions
|
|
248
244
|
} = partitionConfig;
|
|
@@ -274,17 +270,8 @@ class IrisGridPartitionSelector extends Component {
|
|
|
274
270
|
} = this.props;
|
|
275
271
|
var {
|
|
276
272
|
isLoading,
|
|
277
|
-
partitionFilters,
|
|
278
273
|
partitionTables
|
|
279
274
|
} = this.state;
|
|
280
|
-
var {
|
|
281
|
-
partitions
|
|
282
|
-
} = partitionConfig;
|
|
283
|
-
if (partitionFilters !== null && partitionTables !== null) {
|
|
284
|
-
partitionFilters.forEach((filter, index) => {
|
|
285
|
-
partitionTables[index].applyFilter(filter);
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
275
|
var partitionSelectors = model.partitionColumns.map((column, index) => /*#__PURE__*/_jsxs("div", {
|
|
289
276
|
className: "column-selector",
|
|
290
277
|
children: [(partitionTables === null || partitionTables === void 0 ? void 0 : partitionTables[index]) && /*#__PURE__*/_jsx(Picker, {
|
|
@@ -294,30 +281,27 @@ class IrisGridPartitionSelector extends Component {
|
|
|
294
281
|
direction: "bottom",
|
|
295
282
|
shouldFlip: false,
|
|
296
283
|
keyColumn: partitionTables[index].columns[index].name,
|
|
297
|
-
|
|
284
|
+
selectedKey: (partitionConfig === null || partitionConfig === void 0 ? void 0 : partitionConfig.mode) === 'partition' ? partitionConfig.partitions[index] : null,
|
|
285
|
+
placeholder: "Select a key",
|
|
298
286
|
labelColumn: partitionTables[index].columns[index].name,
|
|
299
287
|
onChange: this.getCachedChangeCallback(index),
|
|
300
|
-
|
|
301
|
-
isDisabled: index > 0 && partitionConfig.mode !== 'partition' || isLoading
|
|
288
|
+
isDisabled: isLoading || partitionConfig == null
|
|
302
289
|
}), model.partitionColumns.length - 1 === index || /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
303
290
|
icon: vsChevronRight
|
|
304
291
|
})]
|
|
305
292
|
}, "selector-".concat(column.name)));
|
|
306
293
|
return /*#__PURE__*/_jsxs("div", {
|
|
307
294
|
className: "iris-grid-partition-selector",
|
|
308
|
-
children: [/*#__PURE__*/
|
|
309
|
-
className: "table-name",
|
|
310
|
-
children: "Partitioned Table"
|
|
311
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
295
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
312
296
|
className: "partition-button-group",
|
|
313
297
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
314
|
-
onClick: this.
|
|
298
|
+
onClick: this.handlePartitionTableClick,
|
|
315
299
|
kind: "inline",
|
|
316
|
-
tooltip:
|
|
300
|
+
tooltip: model.isPartitionAwareSourceTable ? 'View keys as table' : 'View underlying partition table',
|
|
317
301
|
icon: vsKey,
|
|
318
|
-
active: partitionConfig.mode === 'keys',
|
|
319
|
-
disabled: isLoading,
|
|
320
|
-
children: "
|
|
302
|
+
active: (partitionConfig === null || partitionConfig === void 0 ? void 0 : partitionConfig.mode) === 'keys',
|
|
303
|
+
disabled: isLoading || partitionConfig == null,
|
|
304
|
+
children: "Partitions"
|
|
321
305
|
}), /*#__PURE__*/_jsx(Button, {
|
|
322
306
|
onClick: this.handleMergeClick,
|
|
323
307
|
kind: "inline",
|
|
@@ -326,9 +310,9 @@ class IrisGridPartitionSelector extends Component {
|
|
|
326
310
|
icon: vsMerge,
|
|
327
311
|
rotation: 90
|
|
328
312
|
}),
|
|
329
|
-
active: partitionConfig.mode === 'merged',
|
|
330
|
-
disabled: isLoading,
|
|
331
|
-
children:
|
|
313
|
+
active: (partitionConfig === null || partitionConfig === void 0 ? void 0 : partitionConfig.mode) === 'merged',
|
|
314
|
+
disabled: isLoading || partitionConfig == null,
|
|
315
|
+
children: model.isPartitionAwareSourceTable ? 'Coalesce' : 'Merge'
|
|
332
316
|
})]
|
|
333
317
|
}), partitionSelectors]
|
|
334
318
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridPartitionSelector.js","names":["React","Component","memoizee","FontAwesomeIcon","Button","vsChevronRight","vsMerge","vsKey","Log","Picker","TableUtils","assertNotNull","Pending","PromiseUtils","jsx","_jsx","jsxs","_jsxs","log","module","IrisGridPartitionSelector","constructor","props","_defineProperty","index","value","handlePartitionSelect","getDisplayValue","handleKeyTableClick","bind","handleMergeClick","model","tableUtils","dh","pending","state","isLoading","keysTable","partitionFilters","partitionTables","componentDidMount","_this","_asyncToGenerator","add","partitionKeysTable","then","keyTable","sorts","partitionColumns","map","column","sort","desc","applySort","t","close","Promise","all","_ref","_","i","selectDistinct","slice","_x","_x2","apply","arguments","getPartitionFilters","setState","e","isCanceled","componentDidUpdate","prevProps","partitionConfig","prevConfig","updatePartitionFilters","componentWillUnmount","cancel","forEach","table","debug2","newPartitionConfig","_objectSpread","mode","sendUpdate","selectedValue","_this2","debug","newPartitions","partitions","length","copy","tCopy","partition","partitionColumn","columns","makeNullableEqFilter","applyFilter","setViewport","data","getViewportData","newConfig","_data$rows$0$get","rows","get","error","onChange","undefined","isCharType","type","toString","String","fromCharCode","parseInt","displayString","name","Error","concat","push","previousFilter","previousPartition","previousColumn","partitionFilter","render","filter","partitionSelectors","className","children","label","labelPosition","direction","shouldFlip","keyColumn","placeholder","labelColumn","getCachedChangeCallback","defaultSelectedKey","isDisabled","icon","onClick","kind","tooltip","active","disabled","rotation"],"sources":["../src/IrisGridPartitionSelector.tsx"],"sourcesContent":["import React, { Component } from 'react';\nimport memoizee from 'memoizee';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { Button, ItemKey } from '@deephaven/components';\nimport { vsChevronRight, vsMerge, vsKey } from '@deephaven/icons';\nimport Log from '@deephaven/log';\nimport { Picker } from '@deephaven/jsapi-components';\nimport type { dh } from '@deephaven/jsapi-types';\nimport { TableUtils } from '@deephaven/jsapi-utils';\nimport { assertNotNull, Pending, PromiseUtils } from '@deephaven/utils';\nimport './IrisGridPartitionSelector.scss';\nimport { PartitionConfig, PartitionedGridModel } from './PartitionedGridModel';\n\nconst log = Log.module('IrisGridPartitionSelector');\n\ninterface IrisGridPartitionSelectorProps {\n model: PartitionedGridModel;\n partitionConfig: PartitionConfig;\n onChange: (partitionConfig: PartitionConfig) => void;\n}\ninterface IrisGridPartitionSelectorState {\n isLoading: boolean;\n\n keysTable: dh.Table | null;\n\n partitionTables: dh.Table[] | null;\n\n /** The filters to apply to each partition table */\n partitionFilters: dh.FilterCondition[][] | null;\n}\nclass IrisGridPartitionSelector extends Component<\n IrisGridPartitionSelectorProps,\n IrisGridPartitionSelectorState\n> {\n constructor(props: IrisGridPartitionSelectorProps) {\n super(props);\n\n this.handleKeyTableClick = this.handleKeyTableClick.bind(this);\n this.handleMergeClick = this.handleMergeClick.bind(this);\n this.handlePartitionSelect = this.handlePartitionSelect.bind(this);\n\n const { model } = props;\n this.tableUtils = new TableUtils(model.dh);\n this.pending = new Pending();\n\n this.state = {\n // We start be loading the partition tables, so we should be in a loading state\n isLoading: true,\n\n keysTable: null,\n partitionFilters: null,\n partitionTables: null,\n };\n }\n\n async componentDidMount(): Promise<void> {\n const { model } = this.props;\n\n try {\n const keysTable = await this.pending.add(\n model.partitionKeysTable().then(keyTable => {\n const sorts = model.partitionColumns.map(column =>\n column.sort().desc()\n );\n keyTable.applySort(sorts);\n return keyTable;\n }),\n t => t.close()\n );\n\n const partitionTables = await Promise.all(\n model.partitionColumns.map(async (_, i) =>\n this.pending.add(\n keysTable.selectDistinct(model.partitionColumns.slice(0, i + 1)),\n t => t.close()\n )\n )\n );\n\n const partitionFilters = this.getPartitionFilters(partitionTables);\n this.setState({\n isLoading: false,\n keysTable,\n partitionFilters,\n partitionTables,\n });\n } catch (e) {\n if (!PromiseUtils.isCanceled(e)) {\n // Just re-throw the error if it's not a cancel\n throw e;\n }\n }\n }\n\n componentDidUpdate(prevProps: IrisGridPartitionSelectorProps): void {\n const { partitionConfig: prevConfig } = prevProps;\n\n const { partitionConfig } = this.props;\n\n if (prevConfig !== partitionConfig) {\n this.updatePartitionFilters();\n }\n }\n\n componentWillUnmount(): void {\n this.pending.cancel();\n\n const { keysTable, partitionTables } = this.state;\n keysTable?.close();\n partitionTables?.forEach(table => table.close());\n }\n\n pending: Pending;\n\n tableUtils: TableUtils;\n\n handleKeyTableClick(): void {\n log.debug2('handleKeyTableClick');\n\n const { partitionConfig } = this.props;\n const newPartitionConfig = { ...partitionConfig };\n // Toggle between Keys and Partition mode\n newPartitionConfig.mode =\n partitionConfig.mode === 'keys' ? 'partition' : 'keys';\n this.sendUpdate(newPartitionConfig);\n }\n\n handleMergeClick(): void {\n log.debug2('handleMergeClick');\n\n const { partitionConfig } = this.props;\n const newPartitionConfig = { ...partitionConfig };\n // Toggle between Merged and Partition mode\n newPartitionConfig.mode =\n partitionConfig.mode === 'merged' ? 'partition' : 'merged';\n this.sendUpdate(newPartitionConfig);\n }\n\n /**\n * Handles when a partition dropdown selection is changed. Will send an update with the new partition config\n * @param index Index of the partition column that was changed\n * @param selectedValue Selected value of the partition column\n */\n async handlePartitionSelect(\n index: number,\n selectedValue: unknown\n ): Promise<void> {\n const { model, partitionConfig: prevConfig } = this.props;\n\n log.debug('handlePartitionSelect', index, selectedValue, prevConfig);\n\n const newPartitions = [...prevConfig.partitions];\n newPartitions[index] = selectedValue;\n\n // If it's the last partition changed, we know it's already a valid value, just emit it\n if (index === model.partitionColumns.length - 1) {\n this.sendUpdate({ partitions: newPartitions, mode: 'partition' });\n return;\n }\n\n const { keysTable } = this.state;\n // Otherwise, we need to get the value from a filtered key table\n assertNotNull(keysTable);\n try {\n this.setState({ isLoading: true });\n const t = await this.pending.add(keysTable.copy(), tCopy =>\n tCopy.close()\n );\n\n // Apply our partition filters, and just get the first value\n const partitionFilters = newPartitions\n .slice(0, index + 1)\n .map((partition, i) => {\n const partitionColumn = t.columns[i];\n return this.tableUtils.makeNullableEqFilter(\n partitionColumn,\n partition\n );\n });\n t.applyFilter(partitionFilters);\n t.setViewport(0, 0, t.columns);\n const data = await this.pending.add(t.getViewportData());\n const newConfig: PartitionConfig = {\n // Core JSAPI returns undefined for null table values,\n // coalesce with null to differentiate null from no selection in the dropdown\n // https://github.com/deephaven/deephaven-core/issues/5400\n partitions: t.columns.map(column => data.rows[0].get(column) ?? null),\n mode: 'partition',\n };\n t.close();\n this.sendUpdate(newConfig);\n } catch (e) {\n if (!PromiseUtils.isCanceled(e)) {\n log.error('Unable to get partition tables', e);\n }\n } finally {\n this.setState({ isLoading: false });\n }\n }\n\n sendUpdate(partitionConfig: PartitionConfig): void {\n log.debug2('sendUpdate', partitionConfig);\n\n const { onChange } = this.props;\n onChange(partitionConfig);\n }\n\n /**\n * Calls model.displayString with a special character case\n * @param index The index of the partition column to get the display value for\n * @param value The partition value to get the display value for\n */\n getDisplayValue(index: number, value: unknown): string {\n const { model } = this.props;\n\n if (value === null) {\n return '(null)';\n }\n\n if (value === undefined || value === '') {\n return '';\n }\n const column = model.partitionColumns[index];\n if (TableUtils.isCharType(column.type) && value.toString().length > 0) {\n return String.fromCharCode(parseInt(value.toString(), 10));\n }\n return model.displayString(value, column.type, column.name);\n }\n\n /**\n * Update the filters on the partition dropdown tables\n */\n updatePartitionFilters(): void {\n const { partitionTables } = this.state;\n assertNotNull(partitionTables);\n\n const { partitionConfig } = this.props;\n const { mode } = partitionConfig;\n log.debug('updatePartitionFilters', partitionConfig);\n if (mode !== 'partition') {\n // We only need to update the filters if the mode is `partitions`\n // In the other modes, we disable the dropdowns anyway\n return;\n }\n\n const partitionFilters = this.getPartitionFilters(partitionTables);\n this.setState({ partitionFilters });\n }\n\n getPartitionFilters(partitionTables: dh.Table[]): dh.FilterCondition[][] {\n const { model, partitionConfig } = this.props;\n const { partitions } = partitionConfig;\n log.debug('getPartitionFilters', partitionConfig);\n\n if (partitions.length !== partitionTables.length) {\n throw new Error(\n `Invalid partition config set. Expected ${partitionTables.length} partitions, but got ${partitions.length}`\n );\n }\n\n // The filters are applied in order, so we need to build up the filters for each partition\n const partitionFilters: dh.FilterCondition[][] = [];\n for (let i = 0; i < partitions.length; i += 1) {\n if (i === 0) {\n // There's no reason to ever filter the first table\n partitionFilters.push([]);\n } else {\n const previousFilter = partitionFilters[i - 1];\n const previousPartition = partitions[i - 1];\n const previousColumn = model.partitionColumns[i - 1];\n const partitionFilter = [\n ...previousFilter,\n this.tableUtils.makeNullableEqFilter(\n previousColumn,\n previousPartition\n ),\n ];\n partitionFilters.push(partitionFilter);\n }\n }\n return partitionFilters;\n }\n\n getCachedChangeCallback = memoizee(\n (index: number) => (value: unknown) =>\n this.handlePartitionSelect(index, value)\n );\n\n getCachedFormatValueCallback = memoizee(\n (index: number) => (value: unknown) => this.getDisplayValue(index, value)\n );\n\n render(): JSX.Element {\n const { model, partitionConfig } = this.props;\n const { isLoading, partitionFilters, partitionTables } = this.state;\n\n const { partitions } = partitionConfig;\n\n if (partitionFilters !== null && partitionTables !== null) {\n partitionFilters.forEach((filter, index) => {\n partitionTables[index].applyFilter(filter as dh.FilterCondition[]);\n });\n }\n const partitionSelectors = model.partitionColumns.map((column, index) => (\n <div key={`selector-${column.name}`} className=\"column-selector\">\n {partitionTables?.[index] && (\n <Picker\n label={column.name}\n labelPosition=\"side\"\n table={partitionTables[index]}\n direction=\"bottom\"\n shouldFlip={false}\n keyColumn={partitionTables[index].columns[index].name}\n placeholder={'Loading...' as string}\n labelColumn={partitionTables[index].columns[index].name}\n onChange={this.getCachedChangeCallback(index)}\n defaultSelectedKey={partitions[index] as ItemKey}\n isDisabled={\n (index > 0 && partitionConfig.mode !== 'partition') || isLoading\n }\n />\n )}\n {model.partitionColumns.length - 1 === index || (\n <FontAwesomeIcon icon={vsChevronRight} />\n )}\n </div>\n ));\n return (\n <div className=\"iris-grid-partition-selector\">\n <div className=\"table-name\">Partitioned Table</div>\n <div className=\"partition-button-group\">\n <Button\n onClick={this.handleKeyTableClick}\n kind=\"inline\"\n tooltip=\"View keys as table\"\n icon={vsKey}\n active={partitionConfig.mode === 'keys'}\n disabled={isLoading}\n >\n Keys\n </Button>\n <Button\n onClick={this.handleMergeClick}\n kind=\"inline\"\n tooltip=\"View all partitions as one merged table\"\n icon={<FontAwesomeIcon icon={vsMerge} rotation={90} />}\n active={partitionConfig.mode === 'merged'}\n disabled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AE;UAAG,CAAE,CAAE;UACvDF,MAAM,EAAErE,eAAe,CAACU,IAAI,KAAK,QAAS;UAC1C4D,QAAQ,EAAE3G,SAAU;UAAA2F,QAAA,EACrB;QAED,CAAQ,CAAC;MAAA,CACN,CAAC,EACLF,kBAAkB;IAAA,CAChB,CAAC;EAEV;AACF;AAEA,eAAezG,yBAAyB"}
|
|
1
|
+
{"version":3,"file":"IrisGridPartitionSelector.js","names":["React","Component","memoizee","FontAwesomeIcon","Button","vsChevronRight","vsMerge","vsKey","Log","Picker","TableUtils","assertNotNull","Pending","PromiseUtils","jsx","_jsx","jsxs","_jsxs","log","module","IrisGridPartitionSelector","constructor","props","_defineProperty","index","value","handlePartitionSelect","getDisplayValue","handlePartitionTableClick","bind","handleMergeClick","model","tableUtils","dh","pending","state","isLoading","baseTable","keysTable","partitionTables","componentDidMount","_this","_asyncToGenerator","add","partitionKeysTable","then","keyTable","t","close","partitionBaseTable","setState","updatePartitionOptions","e","isCanceled","componentDidUpdate","prevProps","partitionConfig","prevConfig","componentWillUnmount","cancel","forEach","table","debug2","newPartitionConfig","_objectSpread","mode","sendUpdate","selectedValue","_this2","debug","newPartitions","partitions","copy","tCopy","partitionFilters","slice","map","partition","i","partitionColumn","columns","makeNullableEqFilter","applyFilter","setViewport","data","getViewportData","newConfig","column","rows","get","error","onChange","undefined","partitionColumns","isCharType","type","toString","length","String","fromCharCode","parseInt","displayString","name","_this3","Promise","all","_ref","_","selectDistinct","_x","_x2","apply","arguments","getPartitionFilters","Error","concat","push","previousFilter","previousPartition","previousColumn","partitionFilter","render","partitionSelectors","className","children","label","labelPosition","direction","shouldFlip","keyColumn","selectedKey","placeholder","labelColumn","getCachedChangeCallback","isDisabled","icon","onClick","kind","tooltip","isPartitionAwareSourceTable","active","disabled","rotation"],"sources":["../src/IrisGridPartitionSelector.tsx"],"sourcesContent":["import React, { Component } from 'react';\nimport memoizee from 'memoizee';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { Button, ItemKey } from '@deephaven/components';\nimport { vsChevronRight, vsMerge, vsKey } from '@deephaven/icons';\nimport Log from '@deephaven/log';\nimport { Picker } from '@deephaven/jsapi-components';\nimport type { dh } from '@deephaven/jsapi-types';\nimport { TableUtils } from '@deephaven/jsapi-utils';\nimport { assertNotNull, Pending, PromiseUtils } from '@deephaven/utils';\nimport './IrisGridPartitionSelector.scss';\nimport { PartitionConfig, PartitionedGridModel } from './PartitionedGridModel';\n\nconst log = Log.module('IrisGridPartitionSelector');\n\ninterface IrisGridPartitionSelectorProps {\n model: PartitionedGridModel;\n partitionConfig?: PartitionConfig;\n onChange: (partitionConfig: PartitionConfig) => void;\n}\ninterface IrisGridPartitionSelectorState {\n isLoading: boolean;\n\n baseTable: dh.Table | null;\n\n keysTable: dh.Table | null;\n\n partitionTables: dh.Table[] | null;\n}\nclass IrisGridPartitionSelector extends Component<\n IrisGridPartitionSelectorProps,\n IrisGridPartitionSelectorState\n> {\n constructor(props: IrisGridPartitionSelectorProps) {\n super(props);\n\n this.handlePartitionTableClick = this.handlePartitionTableClick.bind(this);\n this.handleMergeClick = this.handleMergeClick.bind(this);\n this.handlePartitionSelect = this.handlePartitionSelect.bind(this);\n\n const { model } = props;\n this.tableUtils = new TableUtils(model.dh);\n this.pending = new Pending();\n\n this.state = {\n // We start be loading the partition tables, so we should be in a loading state\n isLoading: true,\n\n baseTable: null,\n keysTable: null,\n partitionTables: null,\n };\n }\n\n async componentDidMount(): Promise<void> {\n const { model } = this.props;\n\n try {\n const keysTable = await this.pending.add(\n model.partitionKeysTable().then(keyTable => keyTable),\n t => t.close()\n );\n\n const baseTable = await this.pending.add(model.partitionBaseTable(), t =>\n t.close()\n );\n\n this.setState({\n keysTable,\n baseTable,\n isLoading: false,\n });\n this.updatePartitionOptions();\n } catch (e) {\n if (!PromiseUtils.isCanceled(e)) {\n // Just re-throw the error if it's not a cancel\n throw e;\n }\n }\n }\n\n componentDidUpdate(prevProps: IrisGridPartitionSelectorProps): void {\n const { partitionConfig: prevConfig } = prevProps;\n\n const { partitionConfig } = this.props;\n\n if (prevConfig !== partitionConfig) {\n this.updatePartitionOptions();\n }\n }\n\n componentWillUnmount(): void {\n this.pending.cancel();\n\n const { keysTable, baseTable, partitionTables } = this.state;\n baseTable?.close();\n keysTable?.close();\n partitionTables?.forEach(table => table.close());\n }\n\n pending: Pending;\n\n tableUtils: TableUtils;\n\n handlePartitionTableClick(): void {\n log.debug2('handlePartitionTableClick');\n\n const { partitionConfig } = this.props;\n assertNotNull(partitionConfig);\n\n const newPartitionConfig = { ...partitionConfig };\n // Toggle between Keys and Partition mode\n newPartitionConfig.mode =\n partitionConfig.mode === 'keys' ? 'partition' : 'keys';\n this.sendUpdate(newPartitionConfig);\n }\n\n handleMergeClick(): void {\n log.debug2('handleMergeClick');\n\n const { partitionConfig } = this.props;\n assertNotNull(partitionConfig);\n const newPartitionConfig = { ...partitionConfig };\n // Toggle between Merged and Partition mode\n newPartitionConfig.mode =\n partitionConfig.mode === 'merged' ? 'partition' : 'merged';\n this.sendUpdate(newPartitionConfig);\n }\n\n /**\n * Handles when a partition dropdown selection is changed. Will send an update with the new partition config\n * @param index Index of the partition column that was changed\n * @param selectedValue Selected value of the partition column\n */\n async handlePartitionSelect(\n index: number,\n selectedValue: unknown\n ): Promise<void> {\n const { partitionConfig: prevConfig } = this.props;\n assertNotNull(prevConfig);\n\n log.debug('handlePartitionSelect', index, selectedValue, prevConfig);\n\n const newPartitions = [...prevConfig.partitions];\n newPartitions[index] = selectedValue;\n\n const { baseTable } = this.state;\n const { keysTable } = this.state;\n\n assertNotNull(baseTable);\n assertNotNull(keysTable);\n try {\n this.setState({ isLoading: true });\n\n const t = await this.pending.add(baseTable.copy(), tCopy =>\n tCopy.close()\n );\n\n // Apply our partition filters, and just get the first value\n const partitionFilters = newPartitions\n .slice(0, index + 1)\n .map((partition, i) => {\n const partitionColumn = t.columns[i];\n return this.tableUtils.makeNullableEqFilter(\n partitionColumn,\n partition\n );\n });\n t.applyFilter(partitionFilters);\n t.setViewport(0, 0, t.columns);\n const data = await this.pending.add(t.getViewportData());\n const newConfig: PartitionConfig = {\n // Core JSAPI returns undefined for null table values,\n // coalesce with null to differentiate null from no selection in the dropdown\n // https://github.com/deephaven/deephaven-core/issues/5400\n partitions: keysTable.columns.map(column => data.rows[0].get(column)),\n mode: 'partition',\n };\n t.close();\n this.sendUpdate(newConfig);\n } catch (e) {\n if (!PromiseUtils.isCanceled(e)) {\n log.error('Unable to get partition tables', e);\n }\n } finally {\n this.setState({ isLoading: false });\n }\n }\n\n sendUpdate(partitionConfig: PartitionConfig): void {\n log.debug2('sendUpdate', partitionConfig);\n\n const { onChange } = this.props;\n onChange(partitionConfig);\n }\n\n /**\n * Calls model.displayString with a special character case\n * @param index The index of the partition column to get the display value for\n * @param value The partition value to get the display value for\n */\n getDisplayValue(index: number, value: unknown): string {\n const { model } = this.props;\n\n if (value === null) {\n return '(null)';\n }\n\n if (value === undefined || value === '') {\n return '';\n }\n const column = model.partitionColumns[index];\n if (TableUtils.isCharType(column.type) && value.toString().length > 0) {\n return String.fromCharCode(parseInt(value.toString(), 10));\n }\n return model.displayString(value, column.type, column.name);\n }\n\n /**\n * Update the options on the partition dropdown tables\n */\n async updatePartitionOptions(): Promise<void> {\n const { model } = this.props;\n const { partitionConfig: prevConfig } = this.props;\n if (prevConfig == null) {\n return;\n }\n\n const { keysTable } = this.state;\n assertNotNull(keysTable);\n\n const partitionFilters = [...prevConfig.partitions].map((partition, i) => {\n const partitionColumn = keysTable.columns[i];\n return this.tableUtils.makeNullableEqFilter(partitionColumn, partition);\n });\n\n const partitionTables = await Promise.all(\n model.partitionColumns.map(async (_, i) => {\n keysTable.applyFilter(partitionFilters.slice(0, i));\n return keysTable.selectDistinct(model.partitionColumns.slice(0, i + 1));\n })\n );\n\n this.setState({ partitionTables });\n }\n\n getPartitionFilters(partitionTables: dh.Table[]): dh.FilterCondition[][] {\n const { model, partitionConfig } = this.props;\n assertNotNull(partitionConfig);\n const { partitions } = partitionConfig;\n log.debug('getPartitionFilters', partitionConfig);\n\n if (partitions.length !== partitionTables.length) {\n throw new Error(\n `Invalid partition config set. Expected ${partitionTables.length} partitions, but got ${partitions.length}`\n );\n }\n\n // The filters are applied in order, so we need to build up the filters for each partition\n const partitionFilters: dh.FilterCondition[][] = [];\n for (let i = 0; i < partitions.length; i += 1) {\n if (i === 0) {\n // There's no reason to ever filter the first table\n partitionFilters.push([]);\n } else {\n const previousFilter = partitionFilters[i - 1];\n const previousPartition = partitions[i - 1];\n const previousColumn = model.partitionColumns[i - 1];\n const partitionFilter = [\n ...previousFilter,\n this.tableUtils.makeNullableEqFilter(\n previousColumn,\n previousPartition\n ),\n ];\n partitionFilters.push(partitionFilter);\n }\n }\n return partitionFilters;\n }\n\n getCachedChangeCallback = memoizee(\n (index: number) => (value: unknown) =>\n this.handlePartitionSelect(index, value)\n );\n\n getCachedFormatValueCallback = memoizee(\n (index: number) => (value: unknown) => this.getDisplayValue(index, value)\n );\n\n render(): JSX.Element {\n const { model, partitionConfig } = this.props;\n const { isLoading, partitionTables } = this.state;\n\n const partitionSelectors = model.partitionColumns.map((column, index) => (\n <div key={`selector-${column.name}`} className=\"column-selector\">\n {partitionTables?.[index] && (\n <Picker\n label={column.name}\n labelPosition=\"side\"\n table={partitionTables[index]}\n direction=\"bottom\"\n shouldFlip={false}\n keyColumn={partitionTables[index].columns[index].name}\n selectedKey={\n partitionConfig?.mode === 'partition'\n ? (partitionConfig.partitions[index] as ItemKey)\n : null\n }\n placeholder=\"Select a key\"\n labelColumn={partitionTables[index].columns[index].name}\n onChange={this.getCachedChangeCallback(index)}\n isDisabled={isLoading || partitionConfig == null}\n />\n )}\n {model.partitionColumns.length - 1 === index || (\n <FontAwesomeIcon icon={vsChevronRight} />\n )}\n </div>\n ));\n return (\n <div className=\"iris-grid-partition-selector\">\n <div className=\"partition-button-group\">\n <Button\n onClick={this.handlePartitionTableClick}\n kind=\"inline\"\n tooltip={\n model.isPartitionAwareSourceTable\n ? 'View keys as table'\n : 'View underlying partition table'\n }\n icon={vsKey}\n active={partitionConfig?.mode === 'keys'}\n disabled={isLoading || partitionConfig == null}\n >\n Partitions\n </Button>\n <Button\n onClick={this.handleMergeClick}\n kind=\"inline\"\n tooltip=\"View all partitions as one merged table\"\n icon={<FontAwesomeIcon icon={vsMerge} rotation={90} />}\n active={partitionConfig?.mode === 'merged'}\n disabled={isLoading || partitionConfig == null}\n >\n {model.isPartitionAwareSourceTable ? 'Coalesce' : 'Merge'}\n </Button>\n </div>\n {partitionSelectors}\n </div>\n );\n }\n}\n\nexport default IrisGridPartitionSelector;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,QAAQ,MAAM,UAAU;AAC/B,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SAASC,MAAM,QAAiB,uBAAuB;AACvD,SAASC,cAAc,EAAEC,OAAO,EAAEC,KAAK,QAAQ,kBAAkB;AACjE,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,MAAM,QAAQ,6BAA6B;AAEpD,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,aAAa,EAAEC,OAAO,EAAEC,YAAY,QAAQ,kBAAkB;AAAC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAIxE,IAAMC,GAAG,GAAGV,GAAG,CAACW,MAAM,CAAC,2BAA2B,CAAC;AAgBnD,MAAMC,yBAAyB,SAASnB,SAAS,CAG/C;EACAoB,WAAWA,CAACC,KAAqC,EAAE;IACjD,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA,kCAuPWrB,QAAQ,CAC/BsB,KAAa,IAAMC,KAAc,IAChC,IAAI,CAACC,qBAAqB,CAACF,KAAK,EAAEC,KAAK,CAC3C,CAAC;IAAAF,eAAA,uCAE8BrB,QAAQ,CACpCsB,KAAa,IAAMC,KAAc,IAAK,IAAI,C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EAAE,IAAI,CAAC1G,gBAAiB;UAC/B2G,IAAI,EAAC,QAAQ;UACbC,OAAO,EAAC,yCAAyC;UACjDH,IAAI,eAAExH,IAAA,CAACZ,eAAe;YAACoI,IAAI,EAAEjI,OAAQ;YAACwI,QAAQ,EAAE;UAAG,CAAE,CAAE;UACvDF,MAAM,EAAE,CAAApF,eAAe,aAAfA,eAAe,uBAAfA,eAAe,CAAES,IAAI,MAAK,QAAS;UAC3C4E,QAAQ,EAAEzG,SAAS,IAAIoB,eAAe,IAAI,IAAK;UAAAoE,QAAA,EAE9C7F,KAAK,CAAC4G,2BAA2B,GAAG,UAAU,GAAG;QAAO,CACnD,CAAC;MAAA,CACN,CAAC,EACLjB,kBAAkB;IAAA,CAChB,CAAC;EAEV;AACF;AAEA,eAAetG,yBAAyB"}
|
|
@@ -12,12 +12,17 @@ declare class IrisGridPartitionedTableModel extends EmptyIrisGridModel implement
|
|
|
12
12
|
*/
|
|
13
13
|
constructor(dh: typeof DhType, partitionedTable: DhType.PartitionedTable, formatter?: Formatter);
|
|
14
14
|
get isPartitionRequired(): boolean;
|
|
15
|
+
get isPartitionAwareSourceTable(): boolean;
|
|
15
16
|
get isReversible(): boolean;
|
|
16
17
|
displayString(value: unknown, columnType: string, columnName?: ColumnName): string;
|
|
17
18
|
close(): void;
|
|
18
19
|
get columns(): readonly DhType.Column[];
|
|
19
20
|
get partitionColumns(): readonly DhType.Column[];
|
|
21
|
+
get columnCount(): number;
|
|
22
|
+
getColumnIndexByName(columnName: string): number;
|
|
23
|
+
textForColumnHeader(column: number, depth?: number | undefined): string | undefined;
|
|
20
24
|
partitionKeysTable(): Promise<DhType.Table>;
|
|
25
|
+
partitionBaseTable(): Promise<DhType.Table>;
|
|
21
26
|
partitionMergedTable(): Promise<DhType.Table>;
|
|
22
27
|
partitionTable(partitions: unknown[]): Promise<DhType.Table>;
|
|
23
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IrisGridPartitionedTableModel.d.ts","sourceRoot":"","sources":["../src/IrisGridPartitionedTableModel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,cAAM,6BACJ,SAAQ,kBACR,YAAW,4BAA4B;IAEvC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,CAAC;IAEnD;;;;OAIG;gBAED,EAAE,EAAE,OAAO,MAAM,EACjB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EACzC,SAAS,YAAoB;IAM/B,IAAI,mBAAmB,IAAI,OAAO,CAEjC;IAED,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,aAAa,CACX,KAAK,EAAE,OAAO,EACd,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,UAAU,GACtB,MAAM;IAIT,KAAK,IAAI,IAAI;IAIb,IAAI,OAAO,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,CAEtC;IAED,IAAI,gBAAgB,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,CAE/C;
|
|
1
|
+
{"version":3,"file":"IrisGridPartitionedTableModel.d.ts","sourceRoot":"","sources":["../src/IrisGridPartitionedTableModel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,cAAM,6BACJ,SAAQ,kBACR,YAAW,4BAA4B;IAEvC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,CAAC;IAEnD;;;;OAIG;gBAED,EAAE,EAAE,OAAO,MAAM,EACjB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EACzC,SAAS,YAAoB;IAM/B,IAAI,mBAAmB,IAAI,OAAO,CAEjC;IAED,IAAI,2BAA2B,IAAI,OAAO,CAEzC;IAED,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,aAAa,CACX,KAAK,EAAE,OAAO,EACd,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,UAAU,GACtB,MAAM;IAIT,KAAK,IAAI,IAAI;IAIb,IAAI,OAAO,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,CAEtC;IAED,IAAI,gBAAgB,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,CAE/C;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAIhD,mBAAmB,CACjB,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,GAAG,SAAS;IAIf,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IAI3C,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IAK3C,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IAI7C,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;CAgBnE;AAED,eAAe,6BAA6B,CAAC"}
|
|
@@ -23,6 +23,9 @@ class IrisGridPartitionedTableModel extends EmptyIrisGridModel {
|
|
|
23
23
|
get isPartitionRequired() {
|
|
24
24
|
return true;
|
|
25
25
|
}
|
|
26
|
+
get isPartitionAwareSourceTable() {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
26
29
|
get isReversible() {
|
|
27
30
|
return false;
|
|
28
31
|
}
|
|
@@ -38,23 +41,40 @@ class IrisGridPartitionedTableModel extends EmptyIrisGridModel {
|
|
|
38
41
|
get partitionColumns() {
|
|
39
42
|
return this.partitionedTable.keyColumns;
|
|
40
43
|
}
|
|
44
|
+
get columnCount() {
|
|
45
|
+
return this.columns.length;
|
|
46
|
+
}
|
|
47
|
+
getColumnIndexByName(columnName) {
|
|
48
|
+
return this.columns.findIndex(column => column.name === columnName);
|
|
49
|
+
}
|
|
50
|
+
textForColumnHeader(column, depth) {
|
|
51
|
+
var _this$columns$column$;
|
|
52
|
+
return (_this$columns$column$ = this.columns[column].name) !== null && _this$columns$column$ !== void 0 ? _this$columns$column$ : '';
|
|
53
|
+
}
|
|
41
54
|
partitionKeysTable() {
|
|
42
55
|
var _this = this;
|
|
43
56
|
return _asyncToGenerator(function* () {
|
|
44
57
|
return _this.partitionedTable.getKeyTable();
|
|
45
58
|
})();
|
|
46
59
|
}
|
|
47
|
-
|
|
60
|
+
partitionBaseTable() {
|
|
48
61
|
var _this2 = this;
|
|
49
62
|
return _asyncToGenerator(function* () {
|
|
50
|
-
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
+
return _this2.partitionedTable.getBaseTable();
|
|
51
65
|
})();
|
|
52
66
|
}
|
|
53
|
-
|
|
67
|
+
partitionMergedTable() {
|
|
54
68
|
var _this3 = this;
|
|
69
|
+
return _asyncToGenerator(function* () {
|
|
70
|
+
return _this3.partitionedTable.getMergedTable();
|
|
71
|
+
})();
|
|
72
|
+
}
|
|
73
|
+
partitionTable(partitions) {
|
|
74
|
+
var _this4 = this;
|
|
55
75
|
return _asyncToGenerator(function* () {
|
|
56
76
|
try {
|
|
57
|
-
var table = yield
|
|
77
|
+
var table = yield _this4.partitionedTable.getTable(partitions);
|
|
58
78
|
if (table == null) {
|
|
59
79
|
// TODO: Will be unnecessary with https://github.com/deephaven/deephaven-core/pull/5050
|
|
60
80
|
throw new MissingPartitionError('Partition not found');
|