@design.estate/dees-catalog 3.63.0 → 3.65.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.
@@ -196,6 +196,7 @@ export const tableStyles: CSSResult[] = [
196
196
  tbody tr {
197
197
  transition: background-color 0.15s ease;
198
198
  position: relative;
199
+ user-select: none;
199
200
  }
200
201
 
201
202
  /* Default horizontal lines (bottom border only) */
@@ -371,32 +372,32 @@ export const tableStyles: CSSResult[] = [
371
372
  min-height: 24px;
372
373
  line-height: 24px;
373
374
  }
374
- td input {
375
- position: absolute;
376
- top: 4px;
377
- bottom: 4px;
378
- left: 20px;
379
- right: 20px;
380
- width: calc(100% - 40px);
381
- height: calc(100% - 8px);
382
- padding: 0 12px;
383
- outline: none;
384
- border: 1px solid var(--dees-color-border-default);
385
- border-radius: 6px;
386
- background: ${cssManager.bdTheme('hsl(0 0% 100%)', 'hsl(0 0% 9%)')};
387
- color: var(--dees-color-text-primary);
388
- font-family: inherit;
389
- font-size: inherit;
390
- font-weight: inherit;
391
- transition: all 0.15s ease;
392
- box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
375
+
376
+ /* Editable cell affordances */
377
+ td.editable {
378
+ cursor: text;
393
379
  }
394
-
395
- td input:focus {
396
- border-color: ${cssManager.bdTheme('hsl(222.2 47.4% 51.2%)', 'hsl(217.2 91.2% 59.8%)')};
397
- outline: 2px solid transparent;
398
- outline-offset: 2px;
399
- box-shadow: 0 0 0 2px ${cssManager.bdTheme('hsl(222.2 47.4% 51.2% / 0.2)', 'hsl(217.2 91.2% 59.8% / 0.2)')};
380
+ td.focused {
381
+ outline: 2px solid ${cssManager.bdTheme(
382
+ 'hsl(222.2 47.4% 51.2% / 0.6)',
383
+ 'hsl(217.2 91.2% 59.8% / 0.6)'
384
+ )};
385
+ outline-offset: -2px;
386
+ }
387
+ td.editingCell {
388
+ padding: 0;
389
+ }
390
+ td.editingCell .innerCellContainer {
391
+ padding: 0;
392
+ line-height: normal;
393
+ }
394
+ td.editingCell dees-input-text,
395
+ td.editingCell dees-input-checkbox,
396
+ td.editingCell dees-input-dropdown,
397
+ td.editingCell dees-input-datepicker,
398
+ td.editingCell dees-input-tags {
399
+ display: block;
400
+ width: 100%;
400
401
  }
401
402
 
402
403
  /* filter row */
@@ -15,6 +15,34 @@ export interface ITableAction<T = any> {
15
15
  actionFunc: (actionDataArg: ITableActionDataArg<T>) => Promise<any>;
16
16
  }
17
17
 
18
+ /**
19
+ * Available cell editor types. Each maps to a dees-input-* component.
20
+ * Use `editor` on `Column<T>` to opt a column into in-cell editing.
21
+ */
22
+ export type TCellEditorType =
23
+ | 'text'
24
+ | 'number'
25
+ | 'checkbox'
26
+ | 'dropdown'
27
+ | 'date'
28
+ | 'tags';
29
+
30
+ /** Detail payload for the `cellEdit` CustomEvent dispatched on commit. */
31
+ export interface ICellEditDetail<T = any> {
32
+ row: T;
33
+ key: string;
34
+ oldValue: any;
35
+ newValue: any;
36
+ }
37
+
38
+ /** Detail payload for the `cellEditError` CustomEvent dispatched on validation failure. */
39
+ export interface ICellEditErrorDetail<T = any> {
40
+ row: T;
41
+ key: string;
42
+ value: any;
43
+ message: string;
44
+ }
45
+
18
46
  export interface Column<T = any> {
19
47
  key: keyof T | string;
20
48
  header?: string | TemplateResult;
@@ -24,6 +52,18 @@ export interface Column<T = any> {
24
52
  /** whether this column participates in per-column quick filtering (default: true) */
25
53
  filterable?: boolean;
26
54
  hidden?: boolean;
55
+ /** Marks the column as editable. Shorthand for `editor: 'text'` if no editor is specified. */
56
+ editable?: boolean;
57
+ /** Editor type — picks the dees-input-* component used for in-cell editing. */
58
+ editor?: TCellEditorType;
59
+ /** Editor-specific options forwarded to the editor (e.g. `{ options: [...] }` for dropdowns). */
60
+ editorOptions?: Record<string, any>;
61
+ /** Convert raw row value -> editor value. Defaults to identity. */
62
+ format?: (raw: any, row: T) => any;
63
+ /** Convert editor value -> raw row value. Defaults to identity. */
64
+ parse?: (editorValue: any, row: T) => any;
65
+ /** Validate the parsed value before commit. Return string for error, true/void for ok. */
66
+ validate?: (value: any, row: T) => true | string | void;
27
67
  }
28
68
 
29
69
  /**