@perspective-dev/viewer 4.3.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/perspective-viewer.js +2 -2
- package/dist/cdn/perspective-viewer.js.map +4 -4
- package/dist/css/botanical.css +1 -1
- package/dist/css/dracula.css +1 -1
- package/dist/css/gruvbox-dark.css +1 -1
- package/dist/css/gruvbox.css +1 -1
- package/dist/css/icons.css +1 -1
- package/dist/css/intl/de.css +1 -1
- package/dist/css/intl/es.css +1 -1
- package/dist/css/intl/fr.css +1 -1
- package/dist/css/intl/ja.css +1 -1
- package/dist/css/intl/pt.css +1 -1
- package/dist/css/intl/zh.css +1 -1
- package/dist/css/intl.css +1 -1
- package/dist/css/monokai.css +1 -1
- package/dist/css/phosphor.css +1 -0
- package/dist/css/pro-dark.css +1 -1
- package/dist/css/pro.css +1 -1
- package/dist/css/solarized-dark.css +1 -1
- package/dist/css/solarized.css +1 -1
- package/dist/css/themes.css +1 -1
- package/dist/css/vaporwave.css +1 -1
- package/dist/esm/extensions.d.ts +4 -0
- package/dist/esm/perspective-viewer.d.ts +1 -0
- package/dist/esm/perspective-viewer.inline.js +2 -2
- package/dist/esm/perspective-viewer.inline.js.map +4 -4
- package/dist/esm/perspective-viewer.js +2 -2
- package/dist/esm/perspective-viewer.js.map +4 -4
- package/dist/esm/plugin.d.ts +9 -9
- package/dist/esm/ts-rs/NumberForegroundMode.d.ts +1 -1
- package/dist/esm/ts-rs/ViewerConfig.d.ts +36 -0
- package/dist/wasm/perspective-viewer.d.ts +68 -59
- package/dist/wasm/perspective-viewer.js +216 -171
- package/dist/wasm/perspective-viewer.wasm +0 -0
- package/dist/wasm/perspective-viewer.wasm.d.ts +19 -20
- package/package.json +7 -5
- package/src/{less/aggregate-selector.less → css/aggregate-selector.css} +23 -20
- package/src/css/column-dropdown.css +109 -0
- package/src/{less/column-selector.less → css/column-selector.css} +160 -158
- package/src/{less/column-settings-panel.less → css/column-settings-panel.css} +70 -59
- package/src/{less/column-style.less → css/column-style.css} +52 -66
- package/src/{less/column-symbol-attributes.less → css/column-symbol-attributes.css} +15 -14
- package/src/{less/config-selector.less → css/config-selector.css} +151 -135
- package/src/{less/containers/dropdown-menu.less → css/containers/dropdown-menu.css} +20 -19
- package/src/{less/containers/pairs-list.less → css/containers/pairs-list.css} +13 -12
- package/src/{themes/variables.less → css/containers/scroll-panel.css} +25 -22
- package/src/{less/containers/split-panel.less → css/containers/split-panel.css} +15 -14
- package/src/{less/containers/tabs.less → css/containers/tabs.css} +17 -19
- package/src/css/dom/checkbox.css +102 -0
- package/src/css/dom/scrollbar.css +35 -0
- package/src/{less/dom/select.less → css/dom/select.css} +17 -18
- package/src/{less/empty-column.less → css/empty-column.css} +19 -18
- package/src/{less/expression-editor.less → css/expression-editor.css} +19 -18
- package/src/{less/filter-dropdown.less → css/filter-dropdown.css} +12 -11
- package/src/{less/filter-item.less → css/filter-item.css} +16 -15
- package/src/{less/form/code-editor.less → css/form/code-editor.css} +26 -30
- package/src/{less/form/debug.less → css/form/debug.css} +19 -18
- package/src/{less/function-dropdown.less → css/function-dropdown.css} +12 -11
- package/src/css/plugin-selector.css +261 -0
- package/src/{less/render-warning.less → css/render-warning.css} +18 -17
- package/src/{less/status-bar.less → css/status-bar.css} +157 -145
- package/src/css/type-icon.css +116 -0
- package/src/{less/viewer.less → css/viewer.css} +112 -146
- package/src/rust/components/column_dropdown.rs +229 -119
- package/src/rust/components/column_selector/active_column.rs +81 -62
- package/src/rust/components/column_selector/add_expression_button.rs +1 -0
- package/src/rust/components/column_selector/aggregate_selector.rs +25 -15
- package/src/rust/components/column_selector/config_selector.rs +315 -199
- package/src/rust/components/column_selector/empty_column.rs +2 -2
- package/src/rust/components/column_selector/expr_edit_button.rs +8 -2
- package/src/rust/components/column_selector/filter_column.rs +37 -26
- package/src/rust/components/column_selector/inactive_column.rs +41 -29
- package/src/rust/components/column_selector/invalid_column.rs +7 -18
- package/src/rust/components/column_selector/pivot_column.rs +11 -5
- package/src/rust/components/column_selector/sort_column.rs +23 -13
- package/src/rust/components/column_selector.rs +163 -84
- package/src/rust/components/column_settings_sidebar/style_tab/symbol/row_selector.rs +1 -1
- package/src/rust/components/column_settings_sidebar/style_tab/symbol/symbol_pairs.rs +3 -2
- package/src/rust/components/column_settings_sidebar/style_tab/symbol/symbol_pairs_item.rs +3 -2
- package/src/rust/components/column_settings_sidebar/style_tab/symbol/symbol_selector.rs +2 -3
- package/src/rust/components/column_settings_sidebar/style_tab/symbol.rs +7 -1
- package/src/rust/components/column_settings_sidebar/style_tab.rs +153 -112
- package/src/rust/components/column_settings_sidebar.rs +91 -53
- package/src/rust/components/containers/dragdrop_list.rs +2 -1
- package/src/rust/components/containers/sidebar_close_button.rs +1 -1
- package/src/rust/components/containers/split_panel.rs +1 -0
- package/src/rust/components/containers/tab_list.rs +1 -1
- package/src/rust/components/copy_dropdown.rs +7 -28
- package/src/rust/components/datetime_column_style/custom.rs +2 -2
- package/src/rust/components/datetime_column_style/simple.rs +2 -2
- package/src/rust/components/datetime_column_style.rs +4 -2
- package/src/rust/components/editable_header.rs +7 -4
- package/src/rust/components/empty_row.rs +1 -1
- package/src/rust/components/export_dropdown.rs +4 -30
- package/src/rust/components/expression_editor.rs +19 -10
- package/src/rust/components/filter_dropdown.rs +246 -102
- package/src/rust/components/font_loader.rs +11 -28
- package/src/rust/components/form/code_editor.rs +17 -2
- package/src/rust/components/form/color_range_selector.rs +19 -6
- package/src/rust/components/form/debug.rs +30 -13
- package/src/rust/components/function_dropdown.rs +186 -113
- package/src/rust/components/main_panel.rs +71 -89
- package/src/rust/components/mod.rs +1 -1
- package/src/rust/components/modal.rs +7 -1
- package/src/rust/components/number_column_style.rs +30 -7
- package/src/rust/components/plugin_selector.rs +34 -102
- package/src/rust/components/portal.rs +274 -0
- package/src/rust/components/render_warning.rs +72 -123
- package/src/rust/components/settings_panel.rs +115 -11
- package/src/rust/components/status_bar.rs +222 -98
- package/src/rust/components/status_bar_counter.rs +8 -20
- package/src/rust/components/status_indicator.rs +64 -114
- package/src/rust/components/string_column_style.rs +2 -2
- package/src/rust/components/style/style_cache.rs +5 -1
- package/src/rust/components/viewer.rs +391 -40
- package/src/rust/config/number_column_style.rs +5 -1
- package/src/rust/config/viewer_config.rs +2 -2
- package/src/rust/custom_elements/copy_dropdown.rs +102 -21
- package/src/rust/custom_elements/debug_plugin.rs +4 -4
- package/src/rust/custom_elements/export_dropdown.rs +102 -20
- package/src/rust/custom_elements/mod.rs +0 -7
- package/src/rust/custom_elements/modal.rs +7 -103
- package/src/rust/custom_elements/viewer.rs +114 -39
- package/src/rust/custom_events.rs +23 -2
- package/src/rust/dragdrop.rs +149 -10
- package/src/{less/containers/scroll-panel.less → rust/engines.rs} +15 -13
- package/src/rust/js/plugin.rs +1 -1
- package/src/rust/lib.rs +10 -4
- package/src/rust/presentation/props.rs +39 -0
- package/src/rust/presentation/sheets.rs +3 -3
- package/src/rust/presentation.rs +44 -8
- package/src/rust/renderer/limits.rs +32 -3
- package/src/{less/dom/scrollbar.less → rust/renderer/props.rs} +18 -19
- package/src/rust/renderer.rs +93 -14
- package/src/rust/session/column_defaults_update.rs +1 -1
- package/src/rust/session/metadata.rs +23 -2
- package/src/rust/session/props.rs +178 -0
- package/src/rust/session.rs +124 -117
- package/src/rust/tasks/column_locator.rs +133 -0
- package/src/rust/{model → tasks}/columns_iter_set.rs +14 -23
- package/src/rust/{model → tasks}/edit_expression.rs +34 -10
- package/src/rust/{model → tasks}/eject.rs +2 -2
- package/src/rust/{model → tasks}/get_viewer_config.rs +0 -11
- package/src/rust/{model → tasks}/intersection_observer.rs +19 -3
- package/src/{less/containers/radio-list.less → rust/tasks/is_invalid_drop.rs} +21 -14
- package/src/rust/tasks/mod.rs +52 -0
- package/src/rust/{model → tasks}/plugin_column_styles.rs +69 -46
- package/src/rust/{model → tasks}/resize_observer.rs +39 -6
- package/src/rust/{model → tasks}/restore_and_render.rs +4 -3
- package/src/rust/{model → tasks}/send_plugin_config.rs +1 -1
- package/src/rust/tasks/structural.rs +53 -0
- package/src/rust/utils/mod.rs +4 -0
- package/src/rust/utils/modal_position.rs +110 -0
- package/src/rust/utils/ptr_eq_rc.rs +74 -0
- package/src/rust/utils/pubsub.rs +11 -1
- package/src/svg/bg-pattern.png +0 -0
- package/src/svg/close-icon.svg +1 -1
- package/src/svg/datagrid-select-row-tree.svg +13 -0
- package/src/svg/expression.svg +1 -1
- package/src/svg/mega-menu-icons-candlestick.svg +1 -1
- package/src/svg/mega-menu-icons-datagrid.svg +1 -2
- package/src/svg/mega-menu-icons-heatmap.svg +1 -1
- package/src/svg/mega-menu-icons-map-scatter.svg +1 -1
- package/src/svg/mega-menu-icons-ohlc.svg +1 -1
- package/src/svg/mega-menu-icons-sunburst.svg +1 -1
- package/src/svg/mega-menu-icons-treemap.svg +1 -1
- package/src/svg/mega-menu-icons-x-bar.svg +1 -1
- package/src/svg/mega-menu-icons-x-y-line.svg +1 -1
- package/src/svg/mega-menu-icons-x-y-scatter.svg +1 -1
- package/src/svg/mega-menu-icons-y-area.svg +1 -1
- package/src/svg/mega-menu-icons-y-bar.svg +1 -1
- package/src/svg/mega-menu-icons-y-line.svg +1 -1
- package/src/svg/mega-menu-icons-y-scatter.svg +1 -1
- package/src/svg/radio-hover.svg +1 -1
- package/src/svg/radio-off.svg +1 -1
- package/src/svg/radio-on.svg +1 -1
- package/src/themes/botanical.css +157 -0
- package/src/themes/defaults.css +157 -0
- package/src/themes/dracula.css +233 -0
- package/src/themes/gruvbox-dark.css +255 -0
- package/src/themes/gruvbox.css +134 -0
- package/src/themes/icons.css +107 -0
- package/src/themes/intl/de.css +102 -0
- package/src/themes/intl/es.css +102 -0
- package/src/themes/intl/fr.css +102 -0
- package/src/themes/intl/ja.css +102 -0
- package/src/themes/intl/pt.css +102 -0
- package/src/themes/intl/zh.css +102 -0
- package/src/themes/intl.css +102 -0
- package/src/themes/monokai.css +233 -0
- package/src/themes/phosphor.css +184 -0
- package/src/themes/pro-dark.css +158 -0
- package/src/themes/{themes.less → pro.css} +17 -21
- package/src/themes/solarized-dark.css +135 -0
- package/src/themes/solarized.css +95 -0
- package/src/themes/themes.css +23 -0
- package/src/themes/vaporwave.css +256 -0
- package/src/ts/extensions.ts +8 -1
- package/src/ts/perspective-viewer.ts +1 -0
- package/src/ts/plugin.ts +9 -9
- package/src/ts/ts-rs/NumberForegroundMode.ts +1 -1
- package/src/ts/ts-rs/ViewerConfig.ts +15 -0
- package/dist/css/variables.css +0 -0
- package/src/less/column-dropdown.less +0 -95
- package/src/less/dom/checkbox.less +0 -100
- package/src/less/plugin-selector.less +0 -183
- package/src/less/type-icon.less +0 -68
- package/src/rust/components/error_message.rs +0 -56
- package/src/rust/custom_elements/column_dropdown.rs +0 -123
- package/src/rust/custom_elements/filter_dropdown.rs +0 -179
- package/src/rust/custom_elements/function_dropdown.rs +0 -115
- package/src/rust/model/column_locator.rs +0 -82
- package/src/rust/model/is_invalid_drop.rs +0 -36
- package/src/rust/model/mod.rs +0 -100
- package/src/rust/model/reset_all.rs +0 -38
- package/src/rust/model/structural.rs +0 -244
- package/src/themes/botanical.less +0 -142
- package/src/themes/dracula.less +0 -101
- package/src/themes/gruvbox-dark.less +0 -116
- package/src/themes/gruvbox.less +0 -152
- package/src/themes/icons.less +0 -130
- package/src/themes/intl/de.less +0 -102
- package/src/themes/intl/es.less +0 -102
- package/src/themes/intl/fr.less +0 -102
- package/src/themes/intl/ja.less +0 -102
- package/src/themes/intl/pt.less +0 -102
- package/src/themes/intl/zh.less +0 -102
- package/src/themes/intl.less +0 -102
- package/src/themes/monokai.less +0 -107
- package/src/themes/pro-dark.less +0 -147
- package/src/themes/pro.less +0 -186
- package/src/themes/solarized-dark.less +0 -78
- package/src/themes/solarized.less +0 -102
- package/src/themes/vaporwave.less +0 -145
- /package/dist/wasm/snippets/{perspective-viewer-d729f682ba5c19df → perspective-viewer-d924246f0b4a3dce}/inline0.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-d729f682ba5c19df → perspective-viewer-d924246f0b4a3dce}/inline1.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-d729f682ba5c19df → perspective-viewer-d924246f0b4a3dce}/inline2.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-d729f682ba5c19df → perspective-viewer-d924246f0b4a3dce}/inline3.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-d729f682ba5c19df → perspective-viewer-d924246f0b4a3dce}/inline4.js +0 -0
- /package/src/rust/{model → tasks}/copy_export.rs +0 -0
- /package/src/rust/{model → tasks}/export_app.rs +0 -0
- /package/src/rust/{model → tasks}/export_method.rs +0 -0
- /package/src/rust/{model → tasks}/update_and_render.rs +0 -0
|
@@ -1,95 +0,0 @@
|
|
|
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
|
-
@import "dom/scrollbar.less";
|
|
14
|
-
|
|
15
|
-
@mixin icon {
|
|
16
|
-
background-repeat: no-repeat;
|
|
17
|
-
background-color: var(--icon--color);
|
|
18
|
-
content: "";
|
|
19
|
-
display: inline-block;
|
|
20
|
-
-webkit-mask-size: cover;
|
|
21
|
-
mask-size: cover;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
:host {
|
|
25
|
-
box-sizing: border-box;
|
|
26
|
-
position: fixed;
|
|
27
|
-
z-index: 10000;
|
|
28
|
-
outline: none;
|
|
29
|
-
font-size: 0.75em;
|
|
30
|
-
border: inherit;
|
|
31
|
-
// box-shadow: 0 2px 4px 0 rgb(0 0 0 / 10%);
|
|
32
|
-
user-select: none;
|
|
33
|
-
background-color: var(--icon--color, #fff) !important;
|
|
34
|
-
color: var(--plugin--background, #333) !important;
|
|
35
|
-
// padding: 6px 8px;
|
|
36
|
-
border: 1px solid var(--icon--color) !important;
|
|
37
|
-
max-width: 300px;
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
max-height: 600px;
|
|
40
|
-
overflow: auto;
|
|
41
|
-
@include scrollbar;
|
|
42
|
-
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
|
|
46
|
-
.selected {
|
|
47
|
-
background-color: var(--plugin--background) !important;
|
|
48
|
-
color: var(--icon--color) !important;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
span {
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
padding: 4px 5px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.no-results {
|
|
57
|
-
padding: 3px 24px 6px 11px;
|
|
58
|
-
color: var(--error--color);
|
|
59
|
-
font-size: 8px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.no-results:before {
|
|
63
|
-
content: var(--no-results--content, "Invalid Column");
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
#add-expression {
|
|
67
|
-
&:before {
|
|
68
|
-
@include icon;
|
|
69
|
-
width: 14px;
|
|
70
|
-
height: 12px;
|
|
71
|
-
margin-right: 5px;
|
|
72
|
-
-webkit-mask-image: var(--add-expression-icon--mask-image);
|
|
73
|
-
mask-image: var(--add-expression-icon--mask-image);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
:host(:hover) {
|
|
79
|
-
.selected {
|
|
80
|
-
background-color: var(--icon--color, #fff) !important;
|
|
81
|
-
color: var(--plugin--background, #333) !important;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
span:hover,
|
|
85
|
-
span.selected:hover {
|
|
86
|
-
background-color: var(--plugin--background) !important;
|
|
87
|
-
color: var(--icon--color) !important;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
:host(.no-results) {
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
background-color: transparent !important;
|
|
94
|
-
border: none !important;
|
|
95
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
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
|
-
@mixin icon {
|
|
14
|
-
background-repeat: no-repeat;
|
|
15
|
-
background-color: var(--icon--color);
|
|
16
|
-
content: "";
|
|
17
|
-
display: inline-block;
|
|
18
|
-
-webkit-mask-size: cover;
|
|
19
|
-
mask-size: cover;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
:host {
|
|
23
|
-
input[type="checkbox"].alternate {
|
|
24
|
-
appearance: none;
|
|
25
|
-
height: 14px;
|
|
26
|
-
width: 14px;
|
|
27
|
-
padding: 0px;
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
outline: none;
|
|
30
|
-
margin: 0 5px;
|
|
31
|
-
|
|
32
|
-
&:before {
|
|
33
|
-
@include icon;
|
|
34
|
-
width: 14px;
|
|
35
|
-
height: 14px;
|
|
36
|
-
font-family: var(--button--font-family, inherit);
|
|
37
|
-
background-color: var(--icon--color, #ccc);
|
|
38
|
-
-webkit-mask-image: var(--inactive-column-selector--content, none);
|
|
39
|
-
mask-image: var(--inactive-column-selector--content, none);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&:hover {
|
|
43
|
-
border-radius: 2px;
|
|
44
|
-
outline: 1px solid var(--icon--color);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&:checked:hover {
|
|
48
|
-
background-color: var(--icon--color, #ccc);
|
|
49
|
-
&:before {
|
|
50
|
-
background-color: var(--plugin--background, #ccc);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&:checked:before {
|
|
55
|
-
-webkit-mask-image: var(--active-column-selector--content, none);
|
|
56
|
-
mask-image: var(--active-column-selector--content, none);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
input[type="checkbox"] {
|
|
61
|
-
float: left;
|
|
62
|
-
appearance: none;
|
|
63
|
-
height: 14px;
|
|
64
|
-
width: 14px;
|
|
65
|
-
padding: 0px;
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
outline: none;
|
|
68
|
-
margin: 0 5px 0 0;
|
|
69
|
-
|
|
70
|
-
&:checked:before {
|
|
71
|
-
-webkit-mask-image: var(--column-checkbox-on--mask-image);
|
|
72
|
-
mask-image: var(--column-checkbox-on--mask-image);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&[disabled]:before {
|
|
76
|
-
opacity: 0.2s;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&:before {
|
|
80
|
-
@include icon;
|
|
81
|
-
height: 13px;
|
|
82
|
-
width: 13px;
|
|
83
|
-
-webkit-mask-image: var(--column-checkbox-off--mask-image);
|
|
84
|
-
mask-image: var(--column-checkbox-off--mask-image);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
&:hover {
|
|
88
|
-
background-color: transparent;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
&:hover:before {
|
|
92
|
-
-webkit-mask-image: var(--column-checkbox-hover--mask-image);
|
|
93
|
-
mask-image: var(--column-checkbox-hover--mask-image);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
input[type="checkbox"]:not(:disabled) {
|
|
98
|
-
cursor: pointer;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
@@ -1,183 +0,0 @@
|
|
|
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
|
-
@import "dom/scrollbar.less";
|
|
14
|
-
|
|
15
|
-
:host {
|
|
16
|
-
#settings_panel {
|
|
17
|
-
#plugin_selector_container.open ~ * {
|
|
18
|
-
opacity: 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
#plugin_selector_container {
|
|
22
|
-
min-height: var(
|
|
23
|
-
--plugin-selector--height,
|
|
24
|
-
var(--status-bar--height, 48px)
|
|
25
|
-
);
|
|
26
|
-
display: flex;
|
|
27
|
-
white-space: nowrap;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
flex: 0 0 auto;
|
|
30
|
-
|
|
31
|
-
// Overflow the padding bounds of the container
|
|
32
|
-
// TODO these bounds exist to protext the resizer and scrollbar (left &
|
|
33
|
-
// right resp) but we really should find a way to remove it and delegate
|
|
34
|
-
// to sub-containers.
|
|
35
|
-
margin: 0 0px 0 -9px;
|
|
36
|
-
|
|
37
|
-
#plugin_selector_border {
|
|
38
|
-
height: 2px;
|
|
39
|
-
min-height: 2px;
|
|
40
|
-
width: 100%;
|
|
41
|
-
background-color: var(--inactive--color, #6e6e6e);
|
|
42
|
-
margin-top: 2px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.plugin-selector-options {
|
|
46
|
-
overflow-y: auto;
|
|
47
|
-
@include scrollbar;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&.open {
|
|
51
|
-
position: absolute;
|
|
52
|
-
margin: 0;
|
|
53
|
-
top: 0;
|
|
54
|
-
left: 0;
|
|
55
|
-
right: 0;
|
|
56
|
-
bottom: 0;
|
|
57
|
-
|
|
58
|
-
// This element is first in the container but visually "overlaps"
|
|
59
|
-
// when expanded
|
|
60
|
-
z-index: 3;
|
|
61
|
-
color: var(--icon--color, #042121);
|
|
62
|
-
// background: var(--plugin--background);
|
|
63
|
-
|
|
64
|
-
.plugin-select-item {
|
|
65
|
-
padding-left: 8px;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.plugin-select-item-name {
|
|
70
|
-
padding-left: 10px;
|
|
71
|
-
font-size: 1.33333em;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.plugin-select-item-name:before {
|
|
75
|
-
// This value is set in a `style` tag from Yew!
|
|
76
|
-
content: var(--default-column-title);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.plugin-select-item {
|
|
80
|
-
// width: 48px;
|
|
81
|
-
padding-left: 9px;
|
|
82
|
-
height: var(
|
|
83
|
-
--plugin-selector--height,
|
|
84
|
-
var(--status-bar--height, 48px)
|
|
85
|
-
);
|
|
86
|
-
min-height: var(
|
|
87
|
-
--plugin-selector--height,
|
|
88
|
-
var(--status-bar--height, 48px)
|
|
89
|
-
);
|
|
90
|
-
display: flex;
|
|
91
|
-
align-items: center;
|
|
92
|
-
border-bottom: 1px solid transparent;
|
|
93
|
-
box-shadow: 0px 1px var(--inactive--color, #6e6e6e);
|
|
94
|
-
cursor: pointer;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Hadn't seen this technique before, makes sizing/positioning these
|
|
98
|
-
// trivial. There's some indication this doesn't work on non-chrome
|
|
99
|
-
// https://stackoverflow.com/questions/36259410/how-to-set-size-of-svg-image-in-before-pseudo-class
|
|
100
|
-
// https://stackoverflow.com/questions/21509982/change-svg-fill-color-in-before-or-after-css
|
|
101
|
-
.plugin-select-item:before {
|
|
102
|
-
content: "";
|
|
103
|
-
display: inline-block;
|
|
104
|
-
height: 35px;
|
|
105
|
-
width: 40px;
|
|
106
|
-
-webkit-mask-size: cover;
|
|
107
|
-
mask-size: cover;
|
|
108
|
-
background-repeat: no-repeat;
|
|
109
|
-
background-color: var(--icon--color);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.plugin-select-item:hover {
|
|
113
|
-
background-color: var(--icon--color, #042121);
|
|
114
|
-
color: var(--plugin--background, #fdfffd);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.plugin-select-item:hover:before {
|
|
118
|
-
background-color: var(--plugin--background, #fdfffd);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.plugin-select-item[data-plugin="Candlestick"]:before {
|
|
122
|
-
// mask-image: var(--plugin-selector-candlestick--content);
|
|
123
|
-
-webkit-mask-image: var(--plugin-selector-candlestick--content);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.plugin-select-item[data-plugin="Heatmap"]:before {
|
|
127
|
-
-webkit-mask-image: var(--plugin-selector-heatmap--content);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.plugin-select-item[data-plugin="Map Scatter"]:before {
|
|
131
|
-
-webkit-mask-image: var(--plugin-selector-map-scatter--content);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.plugin-select-item[data-plugin="OHLC"]:before {
|
|
135
|
-
-webkit-mask-image: var(--plugin-selector-ohlc--content);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.plugin-select-item[data-plugin="Sunburst"]:before {
|
|
139
|
-
-webkit-mask-image: var(--plugin-selector-sunburst--content);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.plugin-select-item[data-plugin="Treemap"]:before {
|
|
143
|
-
-webkit-mask-image: var(--plugin-selector-treemap--content);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.plugin-select-item[data-plugin="X Bar"]:before {
|
|
147
|
-
-webkit-mask-image: var(--plugin-selector-x-bar--content);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.plugin-select-item[data-plugin="X/Y Line"]:before {
|
|
151
|
-
-webkit-mask-image: var(--plugin-selector-x-y-line--content);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.plugin-select-item[data-plugin="X/Y Scatter"]:before {
|
|
155
|
-
-webkit-mask-image: var(--plugin-selector-x-y-scatter--content);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.plugin-select-item[data-plugin="Y Area"]:before {
|
|
159
|
-
-webkit-mask-image: var(--plugin-selector-y-area--content);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.plugin-select-item[data-plugin="Y Bar"]:before {
|
|
163
|
-
-webkit-mask-image: var(--plugin-selector-y-bar--content);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.plugin-select-item[data-plugin="Y Line"]:before {
|
|
167
|
-
-webkit-mask-image: var(--plugin-selector-y-line--content);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.plugin-select-item[data-plugin="Y Scatter"]:before {
|
|
171
|
-
-webkit-mask-image: var(--plugin-selector-y-scatter--content);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.plugin-select-item[data-plugin="Datagrid"]:before {
|
|
175
|
-
-webkit-mask-image: var(--plugin-selector-datagrid--content);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
#plugin_selector {
|
|
180
|
-
flex-grow: 1;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
package/src/less/type-icon.less
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
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 #selected-columns .type-icon,
|
|
14
|
-
:host #sub-columns .type-icon {
|
|
15
|
-
position: absolute;
|
|
16
|
-
left: 15px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
:host .type-icon {
|
|
20
|
-
height: 13px;
|
|
21
|
-
width: 13px;
|
|
22
|
-
background-repeat: no-repeat;
|
|
23
|
-
background-color: var(--icon--color);
|
|
24
|
-
content: "";
|
|
25
|
-
display: inline-block;
|
|
26
|
-
-webkit-mask-size: cover;
|
|
27
|
-
mask-size: cover;
|
|
28
|
-
flex-shrink: 0;
|
|
29
|
-
|
|
30
|
-
&.none {
|
|
31
|
-
content: none;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&.integer {
|
|
35
|
-
-webkit-mask-image: var(--column-type-integer--mask-image);
|
|
36
|
-
mask-image: var(--column-type-integer--mask-image);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&.float {
|
|
40
|
-
-webkit-mask-image: var(--column-type-float--mask-image);
|
|
41
|
-
mask-image: var(--column-type-float--mask-image);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&.string {
|
|
45
|
-
-webkit-mask-image: var(--column-type-string--mask-image);
|
|
46
|
-
mask-image: var(--column-type-string--mask-image);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&.boolean {
|
|
50
|
-
-webkit-mask-image: var(--column-type-boolean--mask-image);
|
|
51
|
-
mask-image: var(--column-type-boolean--mask-image);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&.date {
|
|
55
|
-
-webkit-mask-image: var(--column-type-date--mask-image);
|
|
56
|
-
mask-image: var(--column-type-date--mask-image);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&.datetime {
|
|
60
|
-
-webkit-mask-image: var(--column-type-datetime--mask-image);
|
|
61
|
-
mask-image: var(--column-type-datetime--mask-image);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&.expression {
|
|
65
|
-
-webkit-mask-image: var(--add-expression-icon--mask-image);
|
|
66
|
-
mask-image: var(--add-expression-icon--mask-image);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
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 perspective_client::clone;
|
|
14
|
-
use yew::prelude::*;
|
|
15
|
-
use yew::{Properties, function_component, html};
|
|
16
|
-
|
|
17
|
-
use crate::components::style::LocalStyle;
|
|
18
|
-
use crate::css;
|
|
19
|
-
use crate::session::Session;
|
|
20
|
-
use crate::utils::AddListener;
|
|
21
|
-
|
|
22
|
-
#[derive(PartialEq, Properties)]
|
|
23
|
-
pub struct ErrorMessageProps {
|
|
24
|
-
pub session: Session,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
#[function_component(ErrorMessage)]
|
|
28
|
-
pub fn error_message(p: &ErrorMessageProps) -> yew::Html {
|
|
29
|
-
let error = use_state(|| p.session.get_error());
|
|
30
|
-
use_effect_with(
|
|
31
|
-
(error.setter(), p.session.clone()),
|
|
32
|
-
|(set_error, session)| {
|
|
33
|
-
let sub = session.table_errored.add_listener({
|
|
34
|
-
clone!(set_error);
|
|
35
|
-
move |y| set_error.set(Some(y))
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
|| drop(sub)
|
|
39
|
-
},
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
html! {
|
|
43
|
-
<>
|
|
44
|
-
<LocalStyle href={css!("render-warning")} />
|
|
45
|
-
<div
|
|
46
|
-
class="plugin_information plugin_information--warning"
|
|
47
|
-
id="plugin_information--size"
|
|
48
|
-
>
|
|
49
|
-
<span class="plugin_information__icon" />
|
|
50
|
-
<span class="plugin_information__text" id="plugin_information_count">
|
|
51
|
-
if let Some(msg) = error.as_ref() { { msg } }
|
|
52
|
-
</span>
|
|
53
|
-
</div>
|
|
54
|
-
</>
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
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 std::collections::HashSet;
|
|
14
|
-
|
|
15
|
-
use perspective_client::clone;
|
|
16
|
-
use perspective_client::config::Expression;
|
|
17
|
-
use perspective_js::json;
|
|
18
|
-
use perspective_js::utils::global;
|
|
19
|
-
use wasm_bindgen::JsCast;
|
|
20
|
-
use wasm_bindgen::prelude::*;
|
|
21
|
-
use web_sys::*;
|
|
22
|
-
use yew::html::ImplicitClone;
|
|
23
|
-
use yew::{Callback, props};
|
|
24
|
-
|
|
25
|
-
use crate::components::column_dropdown::*;
|
|
26
|
-
use crate::components::column_selector::InPlaceColumn;
|
|
27
|
-
use crate::custom_elements::modal::*;
|
|
28
|
-
use crate::session::Session;
|
|
29
|
-
use crate::*;
|
|
30
|
-
|
|
31
|
-
#[wasm_bindgen]
|
|
32
|
-
#[derive(Clone)]
|
|
33
|
-
pub struct ColumnDropDownElement {
|
|
34
|
-
modal: ModalElement<ColumnDropDown>,
|
|
35
|
-
session: Session,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
impl ImplicitClone for ColumnDropDownElement {}
|
|
39
|
-
|
|
40
|
-
impl ColumnDropDownElement {
|
|
41
|
-
pub fn new(session: Session) -> Self {
|
|
42
|
-
let dropdown = global::document()
|
|
43
|
-
.create_element("perspective-dropdown")
|
|
44
|
-
.unwrap()
|
|
45
|
-
.unchecked_into::<HtmlElement>();
|
|
46
|
-
|
|
47
|
-
let props = props!(ColumnDropDownProps {});
|
|
48
|
-
let modal = ModalElement::new(dropdown, props, false, None);
|
|
49
|
-
Self { modal, session }
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
pub fn autocomplete(
|
|
53
|
-
&self,
|
|
54
|
-
target: HtmlInputElement,
|
|
55
|
-
exclude: HashSet<String>,
|
|
56
|
-
callback: Callback<InPlaceColumn>,
|
|
57
|
-
) -> Option<()> {
|
|
58
|
-
let input = target.value();
|
|
59
|
-
let metadata = self.session.metadata();
|
|
60
|
-
let mut values: Vec<InPlaceColumn> = vec![];
|
|
61
|
-
let small_input = input.to_lowercase();
|
|
62
|
-
for col in metadata.get_table_columns()? {
|
|
63
|
-
if !exclude.contains(col) && col.to_lowercase().contains(&small_input) {
|
|
64
|
-
values.push(InPlaceColumn::Column(col.to_owned()));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
for col in self.session.metadata().get_expression_columns() {
|
|
69
|
-
if !exclude.contains(col) && col.to_lowercase().contains(&small_input) {
|
|
70
|
-
values.push(InPlaceColumn::Column(col.to_owned()));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
clone!(self.modal, self.session);
|
|
75
|
-
ApiFuture::spawn(async move {
|
|
76
|
-
if !exclude.contains(&input) {
|
|
77
|
-
let is_expr = session.validate_expr(&input).await?.is_none();
|
|
78
|
-
|
|
79
|
-
if is_expr {
|
|
80
|
-
values.push(InPlaceColumn::Expression(Expression::new(
|
|
81
|
-
None,
|
|
82
|
-
input.into(),
|
|
83
|
-
)));
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
let classes = modal.custom_element.class_list();
|
|
88
|
-
let no_results = json!(["no-results"]);
|
|
89
|
-
if values.is_empty() {
|
|
90
|
-
classes.add(&no_results).unwrap();
|
|
91
|
-
} else {
|
|
92
|
-
classes.remove(&no_results).unwrap();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
modal.send_message_batch(vec![
|
|
96
|
-
ColumnDropDownMsg::SetCallback(callback),
|
|
97
|
-
ColumnDropDownMsg::SetValues(values, target.get_bounding_client_rect().width()),
|
|
98
|
-
]);
|
|
99
|
-
|
|
100
|
-
modal.open(target.unchecked_into(), None).await
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
Some(())
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
pub fn item_select(&self) {
|
|
107
|
-
self.modal.send_message(ColumnDropDownMsg::ItemSelect);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
pub fn item_down(&self) {
|
|
111
|
-
self.modal.send_message(ColumnDropDownMsg::ItemDown);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
pub fn item_up(&self) {
|
|
115
|
-
self.modal.send_message(ColumnDropDownMsg::ItemUp);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
pub fn hide(&self) -> ApiResult<()> {
|
|
119
|
-
self.modal.hide()
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
pub fn connected_callback(&self) {}
|
|
123
|
-
}
|