@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
|
@@ -16,18 +16,28 @@ use wasm_bindgen::JsValue;
|
|
|
16
16
|
use web_sys::*;
|
|
17
17
|
use yew::prelude::*;
|
|
18
18
|
|
|
19
|
-
use crate::PerspectiveProperties;
|
|
20
19
|
use crate::custom_events::CustomEvents;
|
|
21
|
-
use crate::
|
|
22
|
-
use crate::
|
|
23
|
-
use crate::session::*;
|
|
20
|
+
use crate::renderer::Renderer;
|
|
21
|
+
use crate::session::{Session, TableErrorState, TableLoadState, ViewStats};
|
|
24
22
|
use crate::utils::*;
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
/// Value-prop version: no PubSub subscriptions, no reducer.
|
|
25
|
+
/// The parent (`StatusBar`) re-renders this component whenever
|
|
26
|
+
/// `update_count`, `error`, or `stats` change (via root's
|
|
27
|
+
/// `IncrementUpdateCount` / `DecrementUpdateCount` / `UpdateSession` messages).
|
|
28
|
+
#[derive(PartialEq, Properties)]
|
|
27
29
|
pub struct StatusIndicatorProps {
|
|
28
30
|
pub custom_events: CustomEvents,
|
|
29
31
|
pub renderer: Renderer,
|
|
30
32
|
pub session: Session,
|
|
33
|
+
/// Number of in-flight renders (>0 → "updating" spinner).
|
|
34
|
+
pub update_count: u32,
|
|
35
|
+
/// Full error state (if any), used for the error dialog and reconnect.
|
|
36
|
+
pub error: Option<TableErrorState>,
|
|
37
|
+
/// Whether a table has been loaded.
|
|
38
|
+
pub has_table: Option<TableLoadState>,
|
|
39
|
+
/// Row/column statistics — used to distinguish "loading" from "connected".
|
|
40
|
+
pub stats: Option<ViewStats>,
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
/// An indicator component which displays the current status of the perspective
|
|
@@ -35,68 +45,62 @@ pub struct StatusIndicatorProps {
|
|
|
35
45
|
/// reconnect callback when in an error state.
|
|
36
46
|
#[function_component]
|
|
37
47
|
pub fn StatusIndicator(props: &StatusIndicatorProps) -> Html {
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.view_created
|
|
61
|
-
.add_listener(set_state.callback(|_| StatusIconStateAction::Decrement)),
|
|
62
|
-
];
|
|
63
|
-
|
|
64
|
-
move || drop(subs)
|
|
65
|
-
},
|
|
66
|
-
);
|
|
48
|
+
let has_table_cells = props
|
|
49
|
+
.stats
|
|
50
|
+
.as_ref()
|
|
51
|
+
.and_then(|s| s.num_table_cells)
|
|
52
|
+
.is_some();
|
|
53
|
+
|
|
54
|
+
let state = if let Some(err) = &props.error {
|
|
55
|
+
StatusIconState::Errored(
|
|
56
|
+
err.message(),
|
|
57
|
+
err.stacktrace(),
|
|
58
|
+
err.kind(),
|
|
59
|
+
err.is_reconnect(),
|
|
60
|
+
)
|
|
61
|
+
} else if !has_table_cells && matches!(props.has_table, Some(TableLoadState::Loading)) {
|
|
62
|
+
StatusIconState::Loading
|
|
63
|
+
} else if props.update_count > 0 {
|
|
64
|
+
StatusIconState::Updating
|
|
65
|
+
} else if has_table_cells {
|
|
66
|
+
StatusIconState::Normal
|
|
67
|
+
} else {
|
|
68
|
+
StatusIconState::Uninitialized
|
|
69
|
+
};
|
|
67
70
|
|
|
68
|
-
let class_name = match
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
let class_name = match &state {
|
|
72
|
+
StatusIconState::Errored(_, _, _, true) => "errored",
|
|
73
|
+
StatusIconState::Errored(_, _, _, false) => "errored disabled",
|
|
74
|
+
StatusIconState::Normal => "connected",
|
|
75
|
+
StatusIconState::Updating => "updating",
|
|
76
|
+
StatusIconState::Loading => "loading",
|
|
77
|
+
StatusIconState::Uninitialized => "uninitialized",
|
|
75
78
|
};
|
|
76
79
|
|
|
77
80
|
let onclick = use_async_callback(
|
|
78
|
-
(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
(
|
|
82
|
+
props.session.clone(),
|
|
83
|
+
props.renderer.clone(),
|
|
84
|
+
props.custom_events.clone(),
|
|
85
|
+
state.clone(),
|
|
86
|
+
),
|
|
87
|
+
async move |_: MouseEvent, (session, renderer, custom_events, state)| {
|
|
88
|
+
match &state {
|
|
81
89
|
StatusIconState::Errored(..) => {
|
|
82
|
-
|
|
90
|
+
session.reconnect().await?;
|
|
83
91
|
let cfg = ViewConfigUpdate::default();
|
|
84
|
-
|
|
92
|
+
session.update_view_config(cfg)?;
|
|
93
|
+
renderer.apply_pending_plugin()?;
|
|
94
|
+
renderer
|
|
95
|
+
.draw(session.validate().await?.create_view())
|
|
96
|
+
.await?;
|
|
85
97
|
},
|
|
86
98
|
StatusIconState::Normal => {
|
|
87
|
-
|
|
88
|
-
.custom_events
|
|
89
|
-
.dispatch_event("status-indicator-click", JsValue::UNDEFINED)?;
|
|
99
|
+
custom_events.dispatch_event("status-indicator-click", JsValue::UNDEFINED)?;
|
|
90
100
|
},
|
|
91
101
|
_ => {},
|
|
92
102
|
};
|
|
93
103
|
|
|
94
|
-
// if let StatusIconState::Errored(..) = &**state {
|
|
95
|
-
// props.session.reconnect().await?;
|
|
96
|
-
// let cfg = ViewConfigUpdate::default();
|
|
97
|
-
// props.update_and_render(cfg)?.await?;
|
|
98
|
-
// }
|
|
99
|
-
|
|
100
104
|
Ok::<_, ApiError>(())
|
|
101
105
|
},
|
|
102
106
|
);
|
|
@@ -108,7 +112,7 @@ pub fn StatusIndicator(props: &StatusIndicatorProps) -> Html {
|
|
|
108
112
|
<span id="status" class={class_name} />
|
|
109
113
|
<span id="status_updating" class={class_name} />
|
|
110
114
|
</div>
|
|
111
|
-
if let StatusIconState::Errored(err, stack, kind) =
|
|
115
|
+
if let StatusIconState::Errored(err, stack, kind, _) = &state {
|
|
112
116
|
<div class="error-dialog">
|
|
113
117
|
<div class="error-dialog-message">{ format!("{} {}", kind, err) }</div>
|
|
114
118
|
<div class="error-dialog-stack">{ stack }</div>
|
|
@@ -119,65 +123,11 @@ pub fn StatusIndicator(props: &StatusIndicatorProps) -> Html {
|
|
|
119
123
|
}
|
|
120
124
|
}
|
|
121
125
|
|
|
122
|
-
#[derive(Clone,
|
|
126
|
+
#[derive(Clone, Debug, PartialEq)]
|
|
123
127
|
enum StatusIconState {
|
|
124
128
|
Loading,
|
|
125
|
-
Updating
|
|
126
|
-
Errored(String, String, &'static str),
|
|
129
|
+
Updating,
|
|
130
|
+
Errored(String, String, &'static str, bool),
|
|
127
131
|
Normal,
|
|
128
|
-
|
|
129
|
-
#[default]
|
|
130
|
-
Unititialized,
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
#[derive(Clone, Debug)]
|
|
134
|
-
enum StatusIconStateAction {
|
|
135
|
-
Increment,
|
|
136
|
-
Decrement,
|
|
137
|
-
Load(Option<ViewStats>),
|
|
138
|
-
SetError(ApiError),
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
impl Reducible for StatusIconState {
|
|
142
|
-
type Action = StatusIconStateAction;
|
|
143
|
-
|
|
144
|
-
fn reduce(self: std::rc::Rc<Self>, action: Self::Action) -> std::rc::Rc<Self> {
|
|
145
|
-
let new_status = match (&*self, action.clone()) {
|
|
146
|
-
(StatusIconState::Updating(x), StatusIconStateAction::Increment) => {
|
|
147
|
-
Self::Updating(x + 1)
|
|
148
|
-
},
|
|
149
|
-
(StatusIconState::Updating(x), StatusIconStateAction::Decrement) if *x > 1 => {
|
|
150
|
-
Self::Updating(x - 1)
|
|
151
|
-
},
|
|
152
|
-
(_, StatusIconStateAction::Load(stats)) => {
|
|
153
|
-
if stats.and_then(|x| x.num_table_cells).is_some() {
|
|
154
|
-
StatusIconState::Normal
|
|
155
|
-
} else {
|
|
156
|
-
Self::Loading
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
(_, StatusIconStateAction::SetError(e)) => {
|
|
160
|
-
Self::Errored(e.message(), e.stacktrace(), e.kind())
|
|
161
|
-
},
|
|
162
|
-
(
|
|
163
|
-
StatusIconState::Loading,
|
|
164
|
-
StatusIconStateAction::Increment | StatusIconStateAction::Decrement,
|
|
165
|
-
) => StatusIconState::Loading,
|
|
166
|
-
(_, StatusIconStateAction::Increment) => Self::Updating(1),
|
|
167
|
-
(StatusIconState::Errored(x, y, z), _) => {
|
|
168
|
-
StatusIconState::Errored(x.clone(), y.clone(), z)
|
|
169
|
-
},
|
|
170
|
-
(_, StatusIconStateAction::Decrement) => StatusIconState::Normal,
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
new_status.into()
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
#[extend::ext]
|
|
178
|
-
impl<T: Reducible + 'static> UseReducerDispatcher<T> {
|
|
179
|
-
fn callback<U>(&self, action: impl Fn(U) -> T::Action + 'static) -> Callback<U> {
|
|
180
|
-
let dispatcher = self.clone();
|
|
181
|
-
Callback::from(move |event| dispatcher.dispatch(action(event)))
|
|
182
|
-
}
|
|
132
|
+
Uninitialized,
|
|
183
133
|
}
|
|
@@ -40,8 +40,8 @@ impl ModalLink<StringColumnStyle> for StringColumnStyleProps {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
impl PartialEq for StringColumnStyleProps {
|
|
43
|
-
fn eq(&self,
|
|
44
|
-
|
|
43
|
+
fn eq(&self, other: &Self) -> bool {
|
|
44
|
+
self.config == other.config && self.default_config == other.default_config
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -24,7 +24,11 @@ type CSSResource = (&'static str, &'static str);
|
|
|
24
24
|
/// A dictionary of CSS fragments for native HTML elements which should always
|
|
25
25
|
/// be loaded (and perhaps lack yew components wrappers from which to have
|
|
26
26
|
/// their styles registered).
|
|
27
|
-
static DOM_STYLES: &[CSSResource] = &[
|
|
27
|
+
static DOM_STYLES: &[CSSResource] = &[
|
|
28
|
+
css!("dom/checkbox"),
|
|
29
|
+
css!("dom/scrollbar"),
|
|
30
|
+
css!("dom/select"),
|
|
31
|
+
];
|
|
28
32
|
|
|
29
33
|
thread_local! {
|
|
30
34
|
/// Cache of `CssStyleSheet` objects, which can safely be re-used across
|