@perspective-dev/viewer 4.0.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/LICENSE.md +193 -0
- package/README.md +4 -0
- package/dist/cdn/perspective-viewer.js +3 -0
- package/dist/cdn/perspective-viewer.js.map +7 -0
- package/dist/css/dracula.css +1 -0
- package/dist/css/gruvbox-dark.css +1 -0
- package/dist/css/gruvbox.css +1 -0
- package/dist/css/icons.css +1 -0
- package/dist/css/intl/de.css +1 -0
- package/dist/css/intl/es.css +1 -0
- package/dist/css/intl/fr.css +1 -0
- package/dist/css/intl/ja.css +1 -0
- package/dist/css/intl/pt.css +1 -0
- package/dist/css/intl/zh.css +1 -0
- package/dist/css/intl.css +1 -0
- package/dist/css/monokai.css +1 -0
- package/dist/css/pro-dark.css +1 -0
- package/dist/css/pro.css +1 -0
- package/dist/css/solarized-dark.css +1 -0
- package/dist/css/solarized.css +1 -0
- package/dist/css/themes.css +1 -0
- package/dist/css/vaporwave.css +1 -0
- package/dist/css/variables.css +0 -0
- package/dist/esm/bootstrap.d.ts +1 -0
- package/dist/esm/extensions.d.ts +70 -0
- package/dist/esm/perspective-viewer.d.ts +39 -0
- package/dist/esm/perspective-viewer.inline.js +3 -0
- package/dist/esm/perspective-viewer.inline.js.map +7 -0
- package/dist/esm/perspective-viewer.js +3 -0
- package/dist/esm/perspective-viewer.js.map +7 -0
- package/dist/esm/plugin.d.ts +195 -0
- package/dist/esm/ts-rs/Aggregate.d.ts +1 -0
- package/dist/esm/ts-rs/ColumnConfigValues.d.ts +31 -0
- package/dist/esm/ts-rs/CustomDatetimeFormat.d.ts +1 -0
- package/dist/esm/ts-rs/CustomDatetimeStyleConfig.d.ts +15 -0
- package/dist/esm/ts-rs/CustomNumberFormatConfig.d.ts +18 -0
- package/dist/esm/ts-rs/DatetimeColorMode.d.ts +1 -0
- package/dist/esm/ts-rs/DatetimeFormatType.d.ts +6 -0
- package/dist/esm/ts-rs/Expressions.d.ts +3 -0
- package/dist/esm/ts-rs/Filter.d.ts +2 -0
- package/dist/esm/ts-rs/FilterReducer.d.ts +1 -0
- package/dist/esm/ts-rs/FilterTerm.d.ts +2 -0
- package/dist/esm/ts-rs/FormatMode.d.ts +1 -0
- package/dist/esm/ts-rs/FormatUnit.d.ts +1 -0
- package/dist/esm/ts-rs/NumberBackgroundMode.d.ts +1 -0
- package/dist/esm/ts-rs/NumberForegroundMode.d.ts +1 -0
- package/dist/esm/ts-rs/OptionalUpdate.d.ts +1 -0
- package/dist/esm/ts-rs/PluginConfig.d.ts +2 -0
- package/dist/esm/ts-rs/RoundingMode.d.ts +1 -0
- package/dist/esm/ts-rs/RoundingPriority.d.ts +1 -0
- package/dist/esm/ts-rs/Scalar.d.ts +5 -0
- package/dist/esm/ts-rs/SignDisplay.d.ts +1 -0
- package/dist/esm/ts-rs/SimpleDatetimeFormat.d.ts +1 -0
- package/dist/esm/ts-rs/SimpleDatetimeStyleConfig.d.ts +6 -0
- package/dist/esm/ts-rs/Sort.d.ts +2 -0
- package/dist/esm/ts-rs/SortDir.d.ts +1 -0
- package/dist/esm/ts-rs/StringColorMode.d.ts +1 -0
- package/dist/esm/ts-rs/TrailingZeroDisplay.d.ts +1 -0
- package/dist/esm/ts-rs/UseGrouping.d.ts +1 -0
- package/dist/esm/ts-rs/ViewerConfigUpdate.d.ts +102 -0
- package/dist/esm/ts-rs/serde_json/JsonValue.d.ts +3 -0
- package/dist/wasm/perspective-viewer.d.ts +1291 -0
- package/dist/wasm/perspective-viewer.js +3883 -0
- package/dist/wasm/perspective-viewer.wasm +0 -0
- package/dist/wasm/perspective-viewer.wasm.d.ts +142 -0
- package/dist/wasm/snippets/perspective-viewer-c69283f6f62a5f14/inline0.js +1 -0
- package/dist/wasm/snippets/perspective-viewer-c69283f6f62a5f14/inline1.js +1 -0
- package/dist/wasm/snippets/perspective-viewer-c69283f6f62a5f14/inline2.js +1 -0
- package/dist/wasm/snippets/perspective-viewer-c69283f6f62a5f14/inline3.js +44 -0
- package/dist/wasm/snippets/perspective-viewer-c69283f6f62a5f14/inline4.js +1 -0
- package/package.json +55 -0
- package/src/less/aggregate-selector.less +72 -0
- package/src/less/column-dropdown.less +95 -0
- package/src/less/column-selector.less +551 -0
- package/src/less/column-settings-panel.less +255 -0
- package/src/less/column-style.less +319 -0
- package/src/less/column-symbol-attributes.less +73 -0
- package/src/less/config-selector.less +363 -0
- package/src/less/containers/dropdown-menu.less +94 -0
- package/src/less/containers/pairs-list.less +46 -0
- package/src/less/containers/radio-list.less +29 -0
- package/src/less/containers/scroll-panel.less +27 -0
- package/src/less/containers/split-panel.less +80 -0
- package/src/less/containers/tabs.less +90 -0
- package/src/less/dom/checkbox.less +100 -0
- package/src/less/dom/scrollbar.less +35 -0
- package/src/less/dom/select.less +63 -0
- package/src/less/empty-column.less +72 -0
- package/src/less/expression-editor.less +152 -0
- package/src/less/filter-dropdown.less +53 -0
- package/src/less/filter-item.less +126 -0
- package/src/less/form/code-editor.less +137 -0
- package/src/less/form/debug.less +88 -0
- package/src/less/function-dropdown.less +45 -0
- package/src/less/plugin-selector.less +173 -0
- package/src/less/render-warning.less +81 -0
- package/src/less/status-bar.less +551 -0
- package/src/less/type-icon.less +68 -0
- package/src/less/viewer.less +368 -0
- package/src/rust/components/column_dropdown.rs +162 -0
- package/src/rust/components/column_selector/active_column.rs +462 -0
- package/src/rust/components/column_selector/add_expression_button.rs +59 -0
- package/src/rust/components/column_selector/aggregate_selector.rs +186 -0
- package/src/rust/components/column_selector/config_selector.rs +674 -0
- package/src/rust/components/column_selector/empty_column.rs +134 -0
- package/src/rust/components/column_selector/expression_toolbar.rs +45 -0
- package/src/rust/components/column_selector/filter_column.rs +530 -0
- package/src/rust/components/column_selector/inactive_column.rs +221 -0
- package/src/rust/components/column_selector/invalid_column.rs +37 -0
- package/src/rust/components/column_selector/pivot_column.rs +93 -0
- package/src/rust/components/column_selector/sort_column.rs +135 -0
- package/src/rust/components/column_selector.rs +426 -0
- package/src/rust/components/column_settings_sidebar/attributes_tab.rs +34 -0
- package/src/rust/components/column_settings_sidebar/mod.rs +17 -0
- package/src/rust/components/column_settings_sidebar/save_settings.rs +68 -0
- package/src/rust/components/column_settings_sidebar/sidebar.rs +396 -0
- package/src/rust/components/column_settings_sidebar/style_tab/column_style.rs +177 -0
- package/src/rust/components/column_settings_sidebar/style_tab/stub.rs +34 -0
- package/src/rust/components/column_settings_sidebar/style_tab/symbol/row_selector.rs +101 -0
- package/src/rust/components/column_settings_sidebar/style_tab/symbol/symbol_config.rs +24 -0
- package/src/rust/components/column_settings_sidebar/style_tab/symbol/symbol_pairs.rs +185 -0
- package/src/rust/components/column_settings_sidebar/style_tab/symbol/symbol_selector.rs +55 -0
- package/src/rust/components/column_settings_sidebar/style_tab/symbol.rs +131 -0
- package/src/rust/components/column_settings_sidebar/style_tab.rs +231 -0
- package/src/rust/components/containers/dragdrop_list.rs +325 -0
- package/src/rust/components/containers/dropdown_menu.rs +104 -0
- package/src/rust/components/containers/kvpair.rs +47 -0
- package/src/rust/components/containers/mod.rs +28 -0
- package/src/rust/components/containers/scroll_panel.rs +311 -0
- package/src/rust/components/containers/scroll_panel_item.rs +111 -0
- package/src/rust/components/containers/select.rs +269 -0
- package/src/rust/components/containers/sidebar.rs +89 -0
- package/src/rust/components/containers/split_panel.rs +483 -0
- package/src/rust/components/containers/tab_list.rs +104 -0
- package/src/rust/components/containers/tests/mod.rs +11 -0
- package/src/rust/components/containers/tests/split_panel.rs +91 -0
- package/src/rust/components/containers/trap_door_panel.rs +50 -0
- package/src/rust/components/copy_dropdown.rs +136 -0
- package/src/rust/components/datetime_column_style/custom.rs +222 -0
- package/src/rust/components/datetime_column_style/simple.rs +122 -0
- package/src/rust/components/datetime_column_style.rs +284 -0
- package/src/rust/components/editable_header.rs +183 -0
- package/src/rust/components/empty_row.rs +169 -0
- package/src/rust/components/error_message.rs +56 -0
- package/src/rust/components/export_dropdown.rs +153 -0
- package/src/rust/components/expression_editor.rs +153 -0
- package/src/rust/components/filter_dropdown.rs +144 -0
- package/src/rust/components/font_loader.rs +254 -0
- package/src/rust/components/form/code_editor.rs +286 -0
- package/src/rust/components/form/color_range_selector.rs +115 -0
- package/src/rust/components/form/color_selector.rs +54 -0
- package/src/rust/components/form/debug.rs +253 -0
- package/src/rust/components/form/highlight.rs +50 -0
- package/src/rust/components/form/mod.rs +29 -0
- package/src/rust/components/form/number_field.rs +72 -0
- package/src/rust/components/form/number_input.rs +45 -0
- package/src/rust/components/form/number_range_field.rs +77 -0
- package/src/rust/components/form/optional_field.rs +53 -0
- package/src/rust/components/form/select_field.rs +104 -0
- package/src/rust/components/function_dropdown.rs +151 -0
- package/src/rust/components/mod.rs +45 -0
- package/src/rust/components/modal.rs +171 -0
- package/src/rust/components/number_column_style.rs +522 -0
- package/src/rust/components/plugin_selector.rs +196 -0
- package/src/rust/components/render_warning.rs +178 -0
- package/src/rust/components/status_bar.rs +315 -0
- package/src/rust/components/status_bar_counter.rs +229 -0
- package/src/rust/components/status_indicator.rs +164 -0
- package/src/rust/components/string_column_style.rs +186 -0
- package/src/rust/components/style/local_style.rs +35 -0
- package/src/rust/components/style/mod.rs +52 -0
- package/src/rust/components/style/style_cache.rs +132 -0
- package/src/rust/components/style/style_provider.rs +65 -0
- package/src/rust/components/style_controls/number_string_format/digits_section.rs +140 -0
- package/src/rust/components/style_controls/number_string_format/misc_section.rs +56 -0
- package/src/rust/components/style_controls/number_string_format/style_section.rs +69 -0
- package/src/rust/components/style_controls/number_string_format/types.rs +31 -0
- package/src/rust/components/style_controls/number_string_format.rs +259 -0
- package/src/rust/components/style_controls.rs +15 -0
- package/src/rust/components/type_icon.rs +53 -0
- package/src/rust/components/viewer.rs +668 -0
- package/src/rust/config/columns_config.rs +132 -0
- package/src/rust/config/datetime_column_style/color_mode.rs +62 -0
- package/src/rust/config/datetime_column_style/custom.rs +121 -0
- package/src/rust/config/datetime_column_style/custom_format.rs +90 -0
- package/src/rust/config/datetime_column_style/simple.rs +55 -0
- package/src/rust/config/datetime_column_style/simple_format.rs +86 -0
- package/src/rust/config/datetime_column_style.rs +104 -0
- package/src/rust/config/mod.rs +30 -0
- package/src/rust/config/number_column_style.rs +138 -0
- package/src/rust/config/number_string_format/enums.rs +298 -0
- package/src/rust/config/number_string_format.rs +269 -0
- package/src/rust/config/string_column_style.rs +140 -0
- package/src/rust/config/view_config.rs +24 -0
- package/src/rust/config/viewer_config.rs +337 -0
- package/src/rust/custom_elements/column_dropdown.rs +123 -0
- package/src/rust/custom_elements/copy_dropdown.rs +112 -0
- package/src/rust/custom_elements/debug_plugin.rs +114 -0
- package/src/rust/custom_elements/export_dropdown.rs +112 -0
- package/src/rust/custom_elements/filter_dropdown.rs +179 -0
- package/src/rust/custom_elements/function_dropdown.rs +115 -0
- package/src/rust/custom_elements/mod.rs +24 -0
- package/src/rust/custom_elements/modal.rs +395 -0
- package/src/rust/custom_elements/viewer.rs +880 -0
- package/src/rust/custom_events.rs +214 -0
- package/src/rust/dragdrop.rs +362 -0
- package/src/rust/exprtk/cursor.rs +81 -0
- package/src/rust/exprtk/mod.rs +17 -0
- package/src/rust/exprtk/tokenize/comment.rs +21 -0
- package/src/rust/exprtk/tokenize/number.rs +44 -0
- package/src/rust/exprtk/tokenize/string.rs +98 -0
- package/src/rust/exprtk/tokenize/symbol.rs +26 -0
- package/src/rust/exprtk/tokenize.rs +190 -0
- package/src/rust/js/clipboard.rs +77 -0
- package/src/rust/js/clipboard_item.rs +21 -0
- package/src/rust/js/intersection_observer.rs +32 -0
- package/src/rust/js/mimetype.rs +42 -0
- package/src/rust/js/mod.rs +29 -0
- package/src/rust/js/plugin.rs +167 -0
- package/src/rust/js/resize_observer.rs +37 -0
- package/src/rust/js/testing.rs +149 -0
- package/src/rust/lib.rs +116 -0
- package/src/rust/model/columns_iter_set.rs +340 -0
- package/src/rust/model/copy_export.rs +157 -0
- package/src/rust/model/create_col.rs +59 -0
- package/src/rust/model/edit_expression.rs +95 -0
- package/src/rust/model/export_app.rs +58 -0
- package/src/rust/model/export_method.rs +151 -0
- package/src/rust/model/get_viewer_config.rs +85 -0
- package/src/rust/model/intersection_observer.rs +81 -0
- package/src/rust/model/is_invalid_drop.rs +36 -0
- package/src/rust/model/mod.rs +93 -0
- package/src/rust/model/plugin_column_styles.rs +106 -0
- package/src/rust/model/resize_observer.rs +98 -0
- package/src/rust/model/restore_and_render.rs +113 -0
- package/src/rust/model/structural.rs +73 -0
- package/src/rust/model/update_and_render.rs +74 -0
- package/src/rust/presentation.rs +370 -0
- package/src/rust/renderer/activate.rs +49 -0
- package/src/rust/renderer/limits.rs +200 -0
- package/src/rust/renderer/plugin_store.rs +45 -0
- package/src/rust/renderer/registry.rs +135 -0
- package/src/rust/renderer/render_timer.rs +185 -0
- package/src/rust/renderer.rs +463 -0
- package/src/rust/session/column_defaults_update.rs +141 -0
- package/src/rust/session/drag_drop_update.rs +179 -0
- package/src/rust/session/metadata.rs +308 -0
- package/src/rust/session/replace_expression_update.rs +131 -0
- package/src/rust/session/view_subscription.rs +189 -0
- package/src/rust/session.rs +794 -0
- package/src/rust/utils/browser/blob.rs +49 -0
- package/src/rust/utils/browser/download.rs +26 -0
- package/src/rust/utils/browser/mod.rs +24 -0
- package/src/rust/utils/browser/request_animation_frame.rs +76 -0
- package/src/rust/utils/browser/selection.rs +79 -0
- package/src/rust/utils/browser/tests/debounce.rs +114 -0
- package/src/rust/utils/browser/tests/mod.rs +13 -0
- package/src/rust/utils/custom_element.rs +85 -0
- package/src/rust/utils/datetime.rs +49 -0
- package/src/rust/utils/debounce.rs +54 -0
- package/src/rust/utils/hooks/mod.rs +15 -0
- package/src/rust/utils/hooks/use_async_callback.rs +53 -0
- package/src/rust/utils/mod.rs +114 -0
- package/src/rust/utils/number_format.rs +48 -0
- package/src/rust/utils/pubsub.rs +222 -0
- package/src/rust/utils/scope.rs +54 -0
- package/src/rust/utils/tee.rs +88 -0
- package/src/rust/utils/tests/mod.rs +14 -0
- package/src/rust/utils/tests/pubsub.rs +95 -0
- package/src/rust/utils/tests/request_animation_frame.rs +42 -0
- package/src/rust/utils/wasm_abi.rs +61 -0
- package/src/rust/utils/weak_scope.rs +39 -0
- package/src/svg/align-scroll-icon.svg +7 -0
- package/src/svg/bg-pattern.png +0 -0
- package/src/svg/boolean-type.svg +3 -0
- package/src/svg/checkbox-checked-icon.svg +7 -0
- package/src/svg/checkbox-hover.svg +4 -0
- package/src/svg/checkbox-off.svg +4 -0
- package/src/svg/checkbox-on.svg +4 -0
- package/src/svg/checkbox-unchecked-icon.svg +3 -0
- package/src/svg/close-icon.svg +6 -0
- package/src/svg/column-settings-icon.svg +6 -0
- package/src/svg/datagrid-select-column.svg +15 -0
- package/src/svg/datagrid-select-region.svg +15 -0
- package/src/svg/datagrid-select-row.svg +13 -0
- package/src/svg/datagrid.svg +13 -0
- package/src/svg/date-type.svg +23 -0
- package/src/svg/downloading.gif +0 -0
- package/src/svg/drag-handle.svg +10 -0
- package/src/svg/drawer-bg-pattern-hidpi.png +0 -0
- package/src/svg/drawer-tab-hover.svg +8 -0
- package/src/svg/drawer-tab-invert-hover.svg +9 -0
- package/src/svg/drawer-tab-invert.svg +8 -0
- package/src/svg/drawer-tab.svg +7 -0
- package/src/svg/dropdown-selector-light.svg +3 -0
- package/src/svg/dropdown-selector.svg +3 -0
- package/src/svg/duplicate-icon.svg +4 -0
- package/src/svg/editable-icon.svg +5 -0
- package/src/svg/export-icon.svg +4 -0
- package/src/svg/expression.svg +10 -0
- package/src/svg/free-scroll-icon.svg +5 -0
- package/src/svg/inactive-mouseover.svg +4 -0
- package/src/svg/mega-menu-icons-candlestick.svg +38 -0
- package/src/svg/mega-menu-icons-datagrid.svg +38 -0
- package/src/svg/mega-menu-icons-heatmap.svg +60 -0
- package/src/svg/mega-menu-icons-map-scatter.svg +43 -0
- package/src/svg/mega-menu-icons-ohlc.svg +40 -0
- package/src/svg/mega-menu-icons-sunburst.svg +39 -0
- package/src/svg/mega-menu-icons-treemap.svg +44 -0
- package/src/svg/mega-menu-icons-x-bar.svg +36 -0
- package/src/svg/mega-menu-icons-x-y-line.svg +38 -0
- package/src/svg/mega-menu-icons-x-y-scatter.svg +72 -0
- package/src/svg/mega-menu-icons-y-area.svg +73 -0
- package/src/svg/mega-menu-icons-y-bar.svg +36 -0
- package/src/svg/mega-menu-icons-y-line.svg +36 -0
- package/src/svg/mega-menu-icons-y-scatter.svg +72 -0
- package/src/svg/number-type.svg +4 -0
- package/src/svg/radio-hover.svg +4 -0
- package/src/svg/radio-off.svg +3 -0
- package/src/svg/radio-on.svg +4 -0
- package/src/svg/read-only-icon.svg +6 -0
- package/src/svg/revert-icon.svg +4 -0
- package/src/svg/sort-abs-asc-icon.svg +3 -0
- package/src/svg/sort-abs-col-asc-icon.svg +3 -0
- package/src/svg/sort-abs-col-desc-icon.svg +3 -0
- package/src/svg/sort-abs-desc-icon.svg +3 -0
- package/src/svg/sort-asc-icon.svg +4 -0
- package/src/svg/sort-col-asc-icon.svg +4 -0
- package/src/svg/sort-col-desc-icon.svg +4 -0
- package/src/svg/sort-desc-icon.svg +4 -0
- package/src/svg/sort-none-icon.svg +3 -0
- package/src/svg/status_error.svg +70 -0
- package/src/svg/status_ok.svg +26 -0
- package/src/svg/string-type.svg +8 -0
- package/src/svg/theme-icon.svg +5 -0
- package/src/svg/updating.gif +0 -0
- package/src/themes/dracula.less +101 -0
- package/src/themes/gruvbox-dark.less +116 -0
- package/src/themes/gruvbox.less +152 -0
- package/src/themes/icons.less +130 -0
- package/src/themes/intl/de.less +102 -0
- package/src/themes/intl/es.less +102 -0
- package/src/themes/intl/fr.less +102 -0
- package/src/themes/intl/ja.less +102 -0
- package/src/themes/intl/pt.less +102 -0
- package/src/themes/intl/zh.less +102 -0
- package/src/themes/intl.less +102 -0
- package/src/themes/monokai.less +107 -0
- package/src/themes/pro-dark.less +147 -0
- package/src/themes/pro.less +186 -0
- package/src/themes/solarized-dark.less +78 -0
- package/src/themes/solarized.less +102 -0
- package/src/themes/themes.less +21 -0
- package/src/themes/vaporwave.less +145 -0
- package/src/themes/variables.less +24 -0
- package/src/ts/bootstrap.ts +26 -0
- package/src/ts/extensions.ts +124 -0
- package/src/ts/perspective-viewer.cdn.ts +19 -0
- package/src/ts/perspective-viewer.inline.ts +23 -0
- package/src/ts/perspective-viewer.ts +59 -0
- package/src/ts/plugin.ts +279 -0
- package/src/ts/ts-rs/Aggregate.ts +3 -0
- package/src/ts/ts-rs/ColumnConfigValues.ts +14 -0
- package/src/ts/ts-rs/CustomDatetimeFormat.ts +3 -0
- package/src/ts/ts-rs/CustomDatetimeStyleConfig.ts +5 -0
- package/src/ts/ts-rs/CustomNumberFormatConfig.ts +8 -0
- package/src/ts/ts-rs/DatetimeColorMode.ts +3 -0
- package/src/ts/ts-rs/DatetimeFormatType.ts +8 -0
- package/src/ts/ts-rs/Expressions.ts +3 -0
- package/src/ts/ts-rs/Filter.ts +4 -0
- package/src/ts/ts-rs/FilterReducer.ts +3 -0
- package/src/ts/ts-rs/FilterTerm.ts +4 -0
- package/src/ts/ts-rs/FormatMode.ts +3 -0
- package/src/ts/ts-rs/FormatUnit.ts +3 -0
- package/src/ts/ts-rs/NumberBackgroundMode.ts +3 -0
- package/src/ts/ts-rs/NumberForegroundMode.ts +3 -0
- package/src/ts/ts-rs/OnUpdateData.ts +8 -0
- package/src/ts/ts-rs/OptionalUpdate.ts +3 -0
- package/src/ts/ts-rs/PluginConfig.ts +4 -0
- package/src/ts/ts-rs/RoundingMode.ts +3 -0
- package/src/ts/ts-rs/RoundingPriority.ts +3 -0
- package/src/ts/ts-rs/Scalar.ts +7 -0
- package/src/ts/ts-rs/SignDisplay.ts +3 -0
- package/src/ts/ts-rs/SimpleDatetimeFormat.ts +3 -0
- package/src/ts/ts-rs/SimpleDatetimeStyleConfig.ts +4 -0
- package/src/ts/ts-rs/Sort.ts +4 -0
- package/src/ts/ts-rs/SortDir.ts +3 -0
- package/src/ts/ts-rs/StringColorMode.ts +3 -0
- package/src/ts/ts-rs/TrailingZeroDisplay.ts +3 -0
- package/src/ts/ts-rs/UseGrouping.ts +3 -0
- package/src/ts/ts-rs/ViewOnUpdateResp.ts +3 -0
- package/src/ts/ts-rs/ViewerConfigUpdate.ts +90 -0
- package/src/ts/ts-rs/serde_json/JsonValue.ts +3 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
2
|
+
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
|
|
3
|
+
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
|
|
4
|
+
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
|
|
5
|
+
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
|
|
6
|
+
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
7
|
+
// ┃ Copyright (c) 2017, the Perspective Authors. ┃
|
|
8
|
+
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
|
|
9
|
+
// ┃ This file is part of the Perspective library, distributed under the terms ┃
|
|
10
|
+
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
|
|
11
|
+
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
12
|
+
|
|
13
|
+
:host {
|
|
14
|
+
--settings-panel-z-index: 10;
|
|
15
|
+
--icon--color: #ff0000;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
::slotted(*) {
|
|
19
|
+
pointer-events: var(--override-content-pointer-events);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host .sidebar_close_button {
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 0;
|
|
25
|
+
padding-top: 15px;
|
|
26
|
+
padding-bottom: 15px;
|
|
27
|
+
z-index: 10000;
|
|
28
|
+
height: 48px;
|
|
29
|
+
&:hover {
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.sidebar_close_button_inner {
|
|
34
|
+
border-radius: 5px 0 0 5px;
|
|
35
|
+
height: 18px;
|
|
36
|
+
background-color: var(--plugin--background);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.sidebar_close_button_inner:before {
|
|
40
|
+
display: inline-block;
|
|
41
|
+
height: 18px;
|
|
42
|
+
width: 26px;
|
|
43
|
+
content: "";
|
|
44
|
+
mask-size: cover;
|
|
45
|
+
-webkit-mask-size: cover;
|
|
46
|
+
background-repeat: no-repeat;
|
|
47
|
+
background-color: var(--icon--color);
|
|
48
|
+
mask-image: var(--drawer-tab-icon--mask-image);
|
|
49
|
+
-webkit-mask-image: var(--drawer-tab-icon--mask-image);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:hover .sidebar_close_button_inner:before {
|
|
53
|
+
mask-image: var(--drawer-tab-icon--hover--mask-image);
|
|
54
|
+
-webkit-mask-image: var(--drawer-tab-icon--hover--mask-image);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host #settings_close_button,
|
|
59
|
+
:host #column_settings_close_button {
|
|
60
|
+
left: -26px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host #debug_close_button.sidebar_close_button .sidebar_close_button_inner {
|
|
64
|
+
background-attachment: fixed;
|
|
65
|
+
background: var(--sidebar--background);
|
|
66
|
+
background-size: 4px;
|
|
67
|
+
|
|
68
|
+
&:before {
|
|
69
|
+
mask-image: var(--drawer-tab-icon--hover--mask-image);
|
|
70
|
+
-webkit-mask-image: var(--drawer-tab-icon--hover--mask-image);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host
|
|
75
|
+
#debug_close_button.sidebar_close_button:hover
|
|
76
|
+
.sidebar_close_button_inner:before {
|
|
77
|
+
mask-image: var(--drawer-tab-icon--mask-image);
|
|
78
|
+
-webkit-mask-image: var(--drawer-tab-icon--mask-image);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host #debug_open_button.sidebar_close_button {
|
|
82
|
+
right: 0px;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
.sidebar_close_button_inner {
|
|
85
|
+
background-color: transparent;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host #debug_open_button.sidebar_close_button .sidebar_close_button_inner {
|
|
90
|
+
&:before {
|
|
91
|
+
mask-image: var(--drawer-tab-inverted-icon--mask-image);
|
|
92
|
+
-webkit-mask-image: var(--drawer-tab-inverted-icon--mask-image);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:hover:before {
|
|
96
|
+
mask-image: var(--drawer-tab-inverted-icon--hover--mask-image);
|
|
97
|
+
-webkit-mask-image: var(--drawer-tab-inverted-icon--hover--mask-image);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host #debug_close_button.sidebar_close_button {
|
|
102
|
+
right: 0px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host(:hover) {
|
|
106
|
+
#menu-bar {
|
|
107
|
+
opacity: 1 !important;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
#settings_button,
|
|
111
|
+
#settings_button.titled {
|
|
112
|
+
opacity: 1;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host {
|
|
117
|
+
position: relative;
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
align-items: stretch;
|
|
121
|
+
font-size: 0.75em;
|
|
122
|
+
|
|
123
|
+
* {
|
|
124
|
+
box-sizing: border-box;
|
|
125
|
+
line-height: 1.25;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
#app_panel {
|
|
129
|
+
position: absolute;
|
|
130
|
+
bottom: 0px;
|
|
131
|
+
left: 0;
|
|
132
|
+
right: 0;
|
|
133
|
+
top: 0;
|
|
134
|
+
height: auto;
|
|
135
|
+
flex-direction: row-reverse;
|
|
136
|
+
& > .split-panel-divider {
|
|
137
|
+
border-left: 1px solid var(--inactive--color, #6e6e6e);
|
|
138
|
+
margin-right: -5px;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
#modal_panel {
|
|
143
|
+
flex: 1 1 auto;
|
|
144
|
+
margin: var(--modal-panel--margin);
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
#modal_panel > .split-panel-divider {
|
|
149
|
+
border-left: 1px solid var(--inactive--color, #6e6e6e);
|
|
150
|
+
margin-right: -5px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
#status_bar {
|
|
154
|
+
// position: absolute;
|
|
155
|
+
// bottom: 0;
|
|
156
|
+
// left: 0;
|
|
157
|
+
// right: 0;
|
|
158
|
+
height: var(--status-bar--height, 48px);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
#main_column {
|
|
162
|
+
display: flex;
|
|
163
|
+
flex: 1 1 auto;
|
|
164
|
+
flex-direction: column;
|
|
165
|
+
position: relative;
|
|
166
|
+
margin: var(--main-column--margin);
|
|
167
|
+
border: var(--main-column--border);
|
|
168
|
+
border-width: var(--main-column--border-width);
|
|
169
|
+
border-radius: var(--main-column--border-radius);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
#main_panel_container {
|
|
173
|
+
position: absolute;
|
|
174
|
+
top: var(--status-bar--height, 48px);
|
|
175
|
+
bottom: 0;
|
|
176
|
+
left: 0;
|
|
177
|
+
right: 0;
|
|
178
|
+
box-shadow: var(--plugin--box-shadow, none);
|
|
179
|
+
background: var(--plugin--background, none);
|
|
180
|
+
overflow: hidden;
|
|
181
|
+
border: var(--plugin--border, none);
|
|
182
|
+
|
|
183
|
+
&.settings-closed.titled {
|
|
184
|
+
top: var(--status-bar--height, 48px);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&.settings-closed {
|
|
188
|
+
position: absolute;
|
|
189
|
+
top: 0;
|
|
190
|
+
bottom: 0;
|
|
191
|
+
left: 0;
|
|
192
|
+
right: 0;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
#settings_panel {
|
|
197
|
+
position: relative;
|
|
198
|
+
flex: 0 0 auto;
|
|
199
|
+
padding: 0pc;
|
|
200
|
+
padding-left: 8px;
|
|
201
|
+
box-sizing: border-box;
|
|
202
|
+
width: 100%;
|
|
203
|
+
z-index: var(--settings-panel-z-index);
|
|
204
|
+
|
|
205
|
+
& > .split-panel-child {
|
|
206
|
+
overflow: hidden;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
& > .split-panel-divider {
|
|
210
|
+
border-top: 1px solid var(--inactive--color, #6e6e6e);
|
|
211
|
+
border-bottom: 2px solid var(--inactive--color, #6e6e6e);
|
|
212
|
+
margin-left: -9px;
|
|
213
|
+
margin-right: 0px;
|
|
214
|
+
flex: 0 0 4px;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
#column_settings_sidebar .split-panel-divider {
|
|
219
|
+
border-top: 1px solid var(--inactive--color, #6e6e6e);
|
|
220
|
+
border-bottom: 2px solid var(--inactive--color, #6e6e6e);
|
|
221
|
+
margin-left: -9px;
|
|
222
|
+
margin-right: -4px;
|
|
223
|
+
flex: 0 0 4px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.noselect {
|
|
227
|
+
-webkit-touch-callout: none;
|
|
228
|
+
/* iOS Safari */
|
|
229
|
+
-webkit-user-select: none;
|
|
230
|
+
/* Safari */
|
|
231
|
+
-khtml-user-select: none;
|
|
232
|
+
/* Konqueror HTML */
|
|
233
|
+
-moz-user-select: none;
|
|
234
|
+
/* Firefox */
|
|
235
|
+
-ms-user-select: none;
|
|
236
|
+
/* Internet Explorer/Edge */
|
|
237
|
+
user-select: none;
|
|
238
|
+
/* Non-prefixed version, currently supported by Chrome and Opera */
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.sidebar_column {
|
|
242
|
+
background: var(--sidebar--background);
|
|
243
|
+
background-size: 4px;
|
|
244
|
+
background-attachment: fixed;
|
|
245
|
+
|
|
246
|
+
display: flex;
|
|
247
|
+
list-style: none;
|
|
248
|
+
flex-direction: column;
|
|
249
|
+
flex: 1;
|
|
250
|
+
|
|
251
|
+
// Needs 2 because it must take precedence over teh chart legend.
|
|
252
|
+
z-index: 2;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
#plugin_selector {
|
|
256
|
+
margin-top: 3px;
|
|
257
|
+
border-bottom-width: 1px;
|
|
258
|
+
border-style: solid;
|
|
259
|
+
border-color: var(--inactive--color, #c5c9d0);
|
|
260
|
+
border-top-width: 0px;
|
|
261
|
+
border-left-width: 0px;
|
|
262
|
+
border-right-width: 0px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
#settings_button {
|
|
266
|
+
opacity: 0;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
#settings_button.titled {
|
|
270
|
+
opacity: 0.2;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
#settings_button {
|
|
274
|
+
position: absolute;
|
|
275
|
+
top: 0;
|
|
276
|
+
right: 0;
|
|
277
|
+
margin: var(--settings-button--margin, 14px 0 0 0);
|
|
278
|
+
padding: 0;
|
|
279
|
+
background-color: var(--plugin--background);
|
|
280
|
+
margin-right: 14px;
|
|
281
|
+
padding: 2px 12px;
|
|
282
|
+
overflow: hidden;
|
|
283
|
+
display: flex;
|
|
284
|
+
align-items: center;
|
|
285
|
+
justify-content: center;
|
|
286
|
+
z-index: 10000;
|
|
287
|
+
border: 1px solid var(--inactive--color);
|
|
288
|
+
border-radius: 2px;
|
|
289
|
+
font-size: 10px;
|
|
290
|
+
font-weight: normal;
|
|
291
|
+
|
|
292
|
+
&:hover {
|
|
293
|
+
color: var(--plugin--background, inherit);
|
|
294
|
+
background-color: var(--icon--color);
|
|
295
|
+
cursor: pointer;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&:before {
|
|
299
|
+
font-feature-settings: "liga";
|
|
300
|
+
content: var(--config-button-icon--content, "Configure");
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
#main_column #settings_button {
|
|
305
|
+
border: none;
|
|
306
|
+
opacity: 1;
|
|
307
|
+
background-color: transparent;
|
|
308
|
+
margin-right: 0px;
|
|
309
|
+
padding: 0;
|
|
310
|
+
border-radius: 0px;
|
|
311
|
+
|
|
312
|
+
&:before {
|
|
313
|
+
display: inline-block;
|
|
314
|
+
height: 18px;
|
|
315
|
+
width: 26px;
|
|
316
|
+
content: "";
|
|
317
|
+
mask-size: cover;
|
|
318
|
+
-webkit-mask-size: cover; //40px 35px;
|
|
319
|
+
background-repeat: no-repeat;
|
|
320
|
+
background-color: var(--icon--color);
|
|
321
|
+
mask-image: var(--drawer-tab-icon--mask-image);
|
|
322
|
+
-webkit-mask-image: var(--drawer-tab-icon--mask-image);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.split-panel.orient-reverse
|
|
327
|
+
> .split-panel-child:not(:last-child):not(.is-width-override) {
|
|
328
|
+
max-width: 300px;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
#expr_panel_header,
|
|
332
|
+
.sidebar_header {
|
|
333
|
+
min-height: 48px;
|
|
334
|
+
overflow: hidden;
|
|
335
|
+
display: flex;
|
|
336
|
+
flex-direction: column;
|
|
337
|
+
justify-content: center;
|
|
338
|
+
border-bottom: 1px solid var(--inactive--color, #6e6e6e);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
#expr_panel_header_title,
|
|
342
|
+
.sidebar_header_title {
|
|
343
|
+
padding-left: 9px;
|
|
344
|
+
overflow: hidden;
|
|
345
|
+
white-space: nowrap;
|
|
346
|
+
text-overflow: ellipsis;
|
|
347
|
+
margin-right: 30px;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
#expr_panel_border,
|
|
351
|
+
.sidebar_border {
|
|
352
|
+
height: 2px;
|
|
353
|
+
width: 100%;
|
|
354
|
+
background-color: var(--inactive--color, #6e6e6e);
|
|
355
|
+
margin-top: 1px;
|
|
356
|
+
flex-shrink: 0;
|
|
357
|
+
flex-grow: 0;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.expr_editor_column {
|
|
361
|
+
z-index: 2;
|
|
362
|
+
width: 100%;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.is-width-override > .expr_editor_column {
|
|
366
|
+
min-width: unset;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
2
|
+
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
|
|
3
|
+
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
|
|
4
|
+
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
|
|
5
|
+
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
|
|
6
|
+
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
7
|
+
// ┃ Copyright (c) 2017, the Perspective Authors. ┃
|
|
8
|
+
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
|
|
9
|
+
// ┃ This file is part of the Perspective library, distributed under the terms ┃
|
|
10
|
+
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
|
|
11
|
+
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
12
|
+
|
|
13
|
+
use web_sys::*;
|
|
14
|
+
use yew::prelude::*;
|
|
15
|
+
|
|
16
|
+
use super::column_selector::InPlaceColumn;
|
|
17
|
+
use super::modal::*;
|
|
18
|
+
use crate::utils::WeakScope;
|
|
19
|
+
|
|
20
|
+
static CSS: &str = include_str!(concat!(env!("OUT_DIR"), "/css/column-dropdown.css"));
|
|
21
|
+
|
|
22
|
+
pub enum ColumnDropDownMsg {
|
|
23
|
+
SetValues(Vec<InPlaceColumn>, f64),
|
|
24
|
+
SetCallback(Callback<InPlaceColumn>),
|
|
25
|
+
ItemDown,
|
|
26
|
+
ItemUp,
|
|
27
|
+
ItemSelect,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
pub struct ColumnDropDown {
|
|
31
|
+
values: Option<Vec<InPlaceColumn>>,
|
|
32
|
+
selected: usize,
|
|
33
|
+
width: f64,
|
|
34
|
+
on_select: Option<Callback<InPlaceColumn>>,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#[derive(Properties, PartialEq)]
|
|
38
|
+
pub struct ColumnDropDownProps {
|
|
39
|
+
#[prop_or_default]
|
|
40
|
+
pub weak_link: WeakScope<ColumnDropDown>,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
impl ModalLink<ColumnDropDown> for ColumnDropDownProps {
|
|
44
|
+
fn weak_link(&self) -> &'_ WeakScope<ColumnDropDown> {
|
|
45
|
+
&self.weak_link
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
impl Component for ColumnDropDown {
|
|
50
|
+
type Message = ColumnDropDownMsg;
|
|
51
|
+
type Properties = ColumnDropDownProps;
|
|
52
|
+
|
|
53
|
+
fn create(ctx: &Context<Self>) -> Self {
|
|
54
|
+
ctx.set_modal_link();
|
|
55
|
+
Self {
|
|
56
|
+
values: Some(vec![]),
|
|
57
|
+
selected: 0,
|
|
58
|
+
width: 0.0,
|
|
59
|
+
on_select: None,
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
fn update(&mut self, _ctx: &Context<Self>, msg: Self::Message) -> bool {
|
|
64
|
+
match msg {
|
|
65
|
+
ColumnDropDownMsg::SetCallback(callback) => {
|
|
66
|
+
self.on_select = Some(callback);
|
|
67
|
+
false
|
|
68
|
+
},
|
|
69
|
+
ColumnDropDownMsg::SetValues(values, width) => {
|
|
70
|
+
self.values = Some(values);
|
|
71
|
+
self.selected = 0;
|
|
72
|
+
self.width = width;
|
|
73
|
+
true
|
|
74
|
+
},
|
|
75
|
+
ColumnDropDownMsg::ItemSelect => {
|
|
76
|
+
if let Some(ref values) = self.values {
|
|
77
|
+
match values.get(self.selected) {
|
|
78
|
+
None => {
|
|
79
|
+
console::error_1(&"Selected out-of-bounds".into());
|
|
80
|
+
false
|
|
81
|
+
},
|
|
82
|
+
Some(x) => {
|
|
83
|
+
self.on_select.as_ref().unwrap().emit(x.clone());
|
|
84
|
+
false
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
console::error_1(&"No Values".into());
|
|
89
|
+
false
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
ColumnDropDownMsg::ItemDown => {
|
|
93
|
+
self.selected += 1;
|
|
94
|
+
if let Some(ref values) = self.values
|
|
95
|
+
&& self.selected >= values.len()
|
|
96
|
+
{
|
|
97
|
+
self.selected = 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
true
|
|
101
|
+
},
|
|
102
|
+
ColumnDropDownMsg::ItemUp => {
|
|
103
|
+
if let Some(ref values) = self.values
|
|
104
|
+
&& self.selected < 1
|
|
105
|
+
{
|
|
106
|
+
self.selected = values.len();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
self.selected -= 1;
|
|
110
|
+
true
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
fn changed(&mut self, _ctx: &Context<Self>, _old: &Self::Properties) -> bool {
|
|
116
|
+
false
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
fn view(&self, _ctx: &Context<Self>) -> Html {
|
|
120
|
+
let body = html! {
|
|
121
|
+
if let Some(ref values) = self.values {
|
|
122
|
+
if !values.is_empty() {
|
|
123
|
+
{ for values
|
|
124
|
+
.iter()
|
|
125
|
+
.enumerate()
|
|
126
|
+
.map(|(idx, value)| {
|
|
127
|
+
let click = self.on_select.as_ref().unwrap().reform({
|
|
128
|
+
let value = value.clone();
|
|
129
|
+
move |_: MouseEvent| value.clone()
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
let row = match value {
|
|
133
|
+
InPlaceColumn::Column(col) => html! {
|
|
134
|
+
<span>{ col }</span>
|
|
135
|
+
},
|
|
136
|
+
InPlaceColumn::Expression(col) => html! {
|
|
137
|
+
<span id="add-expression">{ col.name.clone() }</span>
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
html! {
|
|
142
|
+
if idx == self.selected {
|
|
143
|
+
<span onmousedown={ click } class="selected">{ row }</span>
|
|
144
|
+
} else {
|
|
145
|
+
<span onmousedown={ click }>{ row }</span>
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}) }
|
|
149
|
+
} else {
|
|
150
|
+
<span class="no-results" />
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
let position = format!(
|
|
156
|
+
":host{{min-width:{}px;max-width:{}px}}",
|
|
157
|
+
self.width, self.width
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
html! { <><style>{ &CSS }</style><style>{ position }</style>{ body }</> }
|
|
161
|
+
}
|
|
162
|
+
}
|