datavis-glide 4.0.1 → 4.1.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.
@@ -0,0 +1,32 @@
1
+ export function writeToClipboard(text) {
2
+ if (navigator.clipboard && navigator.clipboard.writeText) {
3
+ return navigator.clipboard.writeText(text);
4
+ }
5
+
6
+ var textArea = document.createElement('textarea');
7
+ textArea.value = text;
8
+ textArea.setAttribute('readonly', '');
9
+ textArea.style.position = 'fixed';
10
+ textArea.style.left = '-999999px';
11
+ textArea.style.top = '0';
12
+ document.body.appendChild(textArea);
13
+ textArea.focus();
14
+ textArea.select();
15
+
16
+ var ok = false;
17
+
18
+ try {
19
+ ok = document.execCommand('copy');
20
+ }
21
+ catch (e) {
22
+ ok = false;
23
+ }
24
+
25
+ document.body.removeChild(textArea);
26
+
27
+ if (ok) {
28
+ return Promise.resolve();
29
+ }
30
+
31
+ return Promise.reject(new Error('Clipboard write failed'));
32
+ }
package/src/util/misc.js CHANGED
@@ -682,10 +682,16 @@ export function makeOperationButton(type, op, index, opts) {
682
682
  }
683
683
  else {
684
684
  if (op.icon) {
685
- btn.appendChild(makeOperationIcon(op));
685
+ var icon = makeOperationIcon(op);
686
+ if (op.label) {
687
+ icon.style.paddingRight = '0.25em';
688
+ }
689
+ btn.setAttribute('data-icon', op.icon);
690
+ btn.appendChild(icon);
686
691
  }
687
692
  if (op.label) {
688
693
  btn.classList.add('wcdv_nowrap');
694
+ btn.setAttribute('aria-label', op.label);
689
695
  btn.append(op.label);
690
696
  }
691
697
  else {
@@ -694,6 +700,7 @@ export function makeOperationButton(type, op, index, opts) {
694
700
  }
695
701
  if (op.tooltip) {
696
702
  btn.setAttribute('title', op.tooltip);
703
+ btn.setAttribute('aria-description', op.tooltip);
697
704
  }
698
705
  return btn;
699
706
  }
package/wcdatavis.css CHANGED
@@ -284,6 +284,35 @@ div.wcdv_titlebar_controls button.wcdv_icon_button > svg.wcdv_icon {
284
284
  margin-top: -4px;
285
285
  }
286
286
 
287
+ div.wcdv_titlebar_controls button.wcdv_icon_button[disabled] > svg.wcdv_icon {
288
+ opacity: 0.4;
289
+ cursor: default;
290
+ }
291
+
292
+ .wcdv_toast {
293
+ position: fixed;
294
+ right: 16px;
295
+ bottom: 16px;
296
+ max-width: 320px;
297
+ padding: 8px 12px;
298
+ border-radius: 6px;
299
+ background-color: rgba(33, 33, 33, 0.94);
300
+ color: #FFF;
301
+ font-size: 13px;
302
+ line-height: 1.4;
303
+ box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
304
+ opacity: 0;
305
+ pointer-events: none;
306
+ transform: translateY(10px);
307
+ transition: opacity 150ms ease, transform 150ms ease;
308
+ z-index: 2000;
309
+ }
310
+
311
+ .wcdv_toast.wcdv_toast_visible {
312
+ opacity: 1;
313
+ transform: translateY(0);
314
+ }
315
+
287
316
  /******************************************************************************/
288
317
 
289
318
  .wcdv_grid_content {
@@ -724,6 +753,23 @@ button.wcdv_operation[data-operation-type="cell"]:disabled > svg.wcdv_icon {
724
753
  margin: -0.3333em 0 -0.3333em 0;
725
754
  }
726
755
 
756
+ .wcdv_sort_priority_badge {
757
+ display: inline-flex;
758
+ align-items: center;
759
+ justify-content: center;
760
+ min-width: 1.25em;
761
+ height: 1.25em;
762
+ padding: 0 0.25em;
763
+ margin: 0 0.35em 0 0.05em;
764
+ border-radius: 0.7em;
765
+ background-color: #FFF;
766
+ color: #737373;
767
+ font-size: 0.7em;
768
+ font-weight: bold;
769
+ line-height: 1;
770
+ vertical-align: super;
771
+ }
772
+
727
773
  /*
728
774
  td.wcdv_group_col_spacer,
729
775
  td.wcdv_group_value {
@@ -1083,6 +1129,14 @@ tr.wcdvgrid_more td {
1083
1129
  background-color: rgba(255, 235, 59, .4);
1084
1130
  }
1085
1131
 
1132
+ .wcdv_grid_table table td.wcdv_selected_cell {
1133
+ background-color: rgba(33, 150, 243, 0.25);
1134
+ }
1135
+
1136
+ .wcdv_grid_table table td.wcdv_selected_cell_anchor {
1137
+ box-shadow: inset 0 0 0 2px #1E88E5;
1138
+ }
1139
+
1086
1140
  .wcdv_grid_table table td.wcdv_focus {
1087
1141
  background-color: rgba(76, 175, 80, .3);
1088
1142
  }