gradio-pr-bot commited on
Commit
154d53f
·
verified ·
1 Parent(s): d669afd

Upload folder using huggingface_hub

Browse files
6.13.0/dataframe/shared/DataCell.svelte CHANGED
@@ -77,9 +77,11 @@
77
  class="body-cell {selection_classes}"
78
  class:flash={is_flash}
79
  class:first-column={is_first_column}
 
80
  data-row={row_idx}
81
  data-col={col_idx}
82
  data-testid={`cell-${row_idx}-${col_idx}`}
 
83
  {onmousedown}
84
  {ondblclick}
85
  {oncontextmenu}
@@ -122,6 +124,11 @@
122
  padding: 0;
123
  overflow: visible;
124
  box-sizing: border-box;
 
 
 
 
 
125
  }
126
 
127
  .body-cell.first-column {
 
77
  class="body-cell {selection_classes}"
78
  class:flash={is_flash}
79
  class:first-column={is_first_column}
80
+ class:static={is_static}
81
  data-row={row_idx}
82
  data-col={col_idx}
83
  data-testid={`cell-${row_idx}-${col_idx}`}
84
+ tabindex={is_static ? -1 : undefined}
85
  {onmousedown}
86
  {ondblclick}
87
  {oncontextmenu}
 
124
  padding: 0;
125
  overflow: visible;
126
  box-sizing: border-box;
127
+ user-select: none;
128
+ }
129
+
130
+ .body-cell.static {
131
+ user-select: text;
132
  }
133
 
134
  .body-cell.first-column {
6.13.0/dataframe/shared/EditableCell.svelte CHANGED
@@ -221,6 +221,7 @@
221
  font-weight: inherit;
222
  line-height: var(--line-lg);
223
  left: var(--size-2);
 
224
  }
225
 
226
  textarea:focus {
@@ -236,10 +237,6 @@
236
  position: relative;
237
  display: block;
238
  outline: none;
239
- -webkit-user-select: text;
240
- -moz-user-select: text;
241
- -ms-user-select: text;
242
- user-select: text;
243
  cursor: text;
244
  width: 100%;
245
  overflow-wrap: break-word;
 
221
  font-weight: inherit;
222
  line-height: var(--line-lg);
223
  left: var(--size-2);
224
+ user-select: text;
225
  }
226
 
227
  textarea:focus {
 
237
  position: relative;
238
  display: block;
239
  outline: none;
 
 
 
 
240
  cursor: text;
241
  width: 100%;
242
  overflow-wrap: break-word;
6.13.0/dataframe/shared/Table.svelte CHANGED
@@ -291,7 +291,13 @@
291
  row: number,
292
  col: number
293
  ): void {
294
- event.preventDefault();
 
 
 
 
 
 
295
  event.stopPropagation();
296
 
297
  const coord: CellCoordinate = [row, col];
@@ -332,7 +338,9 @@
332
  col_value: values?.map((r) => r[col]) ?? []
333
  } as any);
334
 
335
- tick().then(() => parent?.focus());
 
 
336
  }
337
 
338
  function handle_cell_dblclick(
@@ -340,15 +348,14 @@
340
  row: number,
341
  col: number
342
  ): void {
343
- event.preventDefault();
344
- event.stopPropagation();
345
- if (!editable) return;
346
  const col_is_static =
 
347
  static_columns.includes(col) ||
348
  static_columns.includes(resolved_headers[col]);
349
- if (!col_is_static) {
350
- editing = [row, col];
351
- }
 
352
  }
353
 
354
  function handle_blur(detail: {
@@ -999,8 +1006,10 @@
999
  editing[1] === col_idx
1000
  )}
1001
  is_flash={copy_flash && is_sel}
1002
- is_static={!!(cell.column.columnDef.meta as any)?.isStatic}
 
1003
  show_menu_button={editable &&
 
1004
  selected_cells.length === 1 &&
1005
  selected_cells[0][0] === row_idx &&
1006
  selected_cells[0][1] === col_idx}
@@ -1020,6 +1029,10 @@
1020
  ondblclick={(e) =>
1021
  handle_cell_dblclick(e, row_idx, col_idx)}
1022
  oncontextmenu={(e) => {
 
 
 
 
1023
  e.preventDefault();
1024
  toggle_cell_menu(e, row_idx, col_idx);
1025
  }}
 
291
  row: number,
292
  col: number
293
  ): void {
294
+ const col_is_static =
295
+ !editable ||
296
+ static_columns.includes(col) ||
297
+ static_columns.includes(resolved_headers[col]);
298
+ if (!col_is_static) {
299
+ event.preventDefault();
300
+ }
301
  event.stopPropagation();
302
 
303
  const coord: CellCoordinate = [row, col];
 
338
  col_value: values?.map((r) => r[col]) ?? []
339
  } as any);
340
 
341
+ if (!col_is_static) {
342
+ tick().then(() => parent?.focus());
343
+ }
344
  }
345
 
346
  function handle_cell_dblclick(
 
348
  row: number,
349
  col: number
350
  ): void {
 
 
 
351
  const col_is_static =
352
+ !editable ||
353
  static_columns.includes(col) ||
354
  static_columns.includes(resolved_headers[col]);
355
+ if (col_is_static) return;
356
+ event.preventDefault();
357
+ event.stopPropagation();
358
+ editing = [row, col];
359
  }
360
 
361
  function handle_blur(detail: {
 
1006
  editing[1] === col_idx
1007
  )}
1008
  is_flash={copy_flash && is_sel}
1009
+ is_static={!editable ||
1010
+ !!(cell.column.columnDef.meta as any)?.isStatic}
1011
  show_menu_button={editable &&
1012
+ !(cell.column.columnDef.meta as any)?.isStatic &&
1013
  selected_cells.length === 1 &&
1014
  selected_cells[0][0] === row_idx &&
1015
  selected_cells[0][1] === col_idx}
 
1029
  ondblclick={(e) =>
1030
  handle_cell_dblclick(e, row_idx, col_idx)}
1031
  oncontextmenu={(e) => {
1032
+ const is_static_cell = !!(
1033
+ cell.column.columnDef.meta as any
1034
+ )?.isStatic;
1035
+ if (!editable || is_static_cell) return;
1036
  e.preventDefault();
1037
  toggle_cell_menu(e, row_idx, col_idx);
1038
  }}