@lensui/lens-table 0.1.64 → 0.1.65
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/index.cjs +621 -399
- package/dist/index.css +151 -0
- package/dist/index.d.cts +22 -3
- package/dist/index.d.ts +22 -3
- package/dist/index.js +542 -320
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -2128,7 +2128,9 @@
|
|
|
2128
2128
|
}
|
|
2129
2129
|
.rvg-choice-content {
|
|
2130
2130
|
min-width: var(--reference-width);
|
|
2131
|
+
max-height: 240px;
|
|
2131
2132
|
padding: 5px;
|
|
2133
|
+
overflow-y: auto;
|
|
2132
2134
|
transform-origin: var(--transform-origin);
|
|
2133
2135
|
border-radius: 4px;
|
|
2134
2136
|
}
|
|
@@ -2650,3 +2652,152 @@
|
|
|
2650
2652
|
margin: 0;
|
|
2651
2653
|
-webkit-appearance: none;
|
|
2652
2654
|
}
|
|
2655
|
+
.rvg-searchable-choice-editor {
|
|
2656
|
+
display: flex;
|
|
2657
|
+
padding-right: 24px;
|
|
2658
|
+
align-items: center;
|
|
2659
|
+
}
|
|
2660
|
+
.rvg-searchable-choice-editor > input {
|
|
2661
|
+
min-width: 0;
|
|
2662
|
+
width: 100%;
|
|
2663
|
+
height: 100%;
|
|
2664
|
+
padding: 0 4px;
|
|
2665
|
+
border: 0;
|
|
2666
|
+
outline: 0;
|
|
2667
|
+
background: transparent;
|
|
2668
|
+
color: var(--rvg-color-text);
|
|
2669
|
+
font:
|
|
2670
|
+
var(--rvg-font-size-body) Inter,
|
|
2671
|
+
ui-sans-serif,
|
|
2672
|
+
system-ui,
|
|
2673
|
+
sans-serif;
|
|
2674
|
+
box-sizing: border-box;
|
|
2675
|
+
}
|
|
2676
|
+
.rvg-searchable-choice-editor > input.is-pristine {
|
|
2677
|
+
color: var(--rvg-color-subtle);
|
|
2678
|
+
}
|
|
2679
|
+
.rvg-searchable-choice-indicator {
|
|
2680
|
+
position: absolute;
|
|
2681
|
+
top: 50%;
|
|
2682
|
+
right: 4px;
|
|
2683
|
+
display: grid;
|
|
2684
|
+
width: 16px;
|
|
2685
|
+
height: 16px;
|
|
2686
|
+
place-items: center;
|
|
2687
|
+
border-radius: 3px;
|
|
2688
|
+
background: var(--rvg-color-hover-muted);
|
|
2689
|
+
transform: translateY(-50%);
|
|
2690
|
+
}
|
|
2691
|
+
.rvg-searchable-choice-content {
|
|
2692
|
+
z-index: 1000;
|
|
2693
|
+
}
|
|
2694
|
+
.rvg-searchable-choice-content .rvg-choice-item {
|
|
2695
|
+
width: 100%;
|
|
2696
|
+
border: 0;
|
|
2697
|
+
background: transparent;
|
|
2698
|
+
text-align: left;
|
|
2699
|
+
}
|
|
2700
|
+
.rvg-searchable-choice-content .rvg-choice-item:is(:hover, .is-active) {
|
|
2701
|
+
background: var(--rvg-color-hover);
|
|
2702
|
+
}
|
|
2703
|
+
.rvg-searchable-choice-content .rvg-choice-item.is-selected {
|
|
2704
|
+
background: var(--rvg-color-primary-soft);
|
|
2705
|
+
color: var(--rvg-color-primary);
|
|
2706
|
+
font-weight: 600;
|
|
2707
|
+
}
|
|
2708
|
+
.rvg-textarea-editor {
|
|
2709
|
+
padding-right: 24px;
|
|
2710
|
+
}
|
|
2711
|
+
.rvg-textarea-trigger {
|
|
2712
|
+
position: absolute;
|
|
2713
|
+
top: 50%;
|
|
2714
|
+
right: 4px;
|
|
2715
|
+
display: grid;
|
|
2716
|
+
width: 16px;
|
|
2717
|
+
height: 16px;
|
|
2718
|
+
padding: 0;
|
|
2719
|
+
place-items: center;
|
|
2720
|
+
border: 0;
|
|
2721
|
+
border-radius: 3px;
|
|
2722
|
+
background: var(--rvg-color-hover-muted);
|
|
2723
|
+
color: #3c4043;
|
|
2724
|
+
cursor: pointer;
|
|
2725
|
+
transform: translateY(-50%);
|
|
2726
|
+
}
|
|
2727
|
+
.rvg-multiline-icon {
|
|
2728
|
+
width: 13px;
|
|
2729
|
+
height: 13px;
|
|
2730
|
+
fill: currentColor;
|
|
2731
|
+
}
|
|
2732
|
+
.rvg-textarea-backdrop {
|
|
2733
|
+
position: fixed;
|
|
2734
|
+
z-index: 1200;
|
|
2735
|
+
inset: 0;
|
|
2736
|
+
display: grid;
|
|
2737
|
+
padding: 32px;
|
|
2738
|
+
place-items: center;
|
|
2739
|
+
background: rgb(0 0 0 / 24%);
|
|
2740
|
+
}
|
|
2741
|
+
.rvg-textarea-dialog {
|
|
2742
|
+
display: grid;
|
|
2743
|
+
width: min(720px, calc(100vw - 64px));
|
|
2744
|
+
max-height: calc(100vh - 64px);
|
|
2745
|
+
grid-template-rows: 52px minmax(220px, 1fr) 64px;
|
|
2746
|
+
overflow: hidden;
|
|
2747
|
+
border: 1px solid var(--rvg-color-border);
|
|
2748
|
+
border-radius: 12px;
|
|
2749
|
+
background: var(--rvg-color-bg);
|
|
2750
|
+
box-shadow: 0 18px 54px rgb(0 0 0 / 28%);
|
|
2751
|
+
}
|
|
2752
|
+
.rvg-textarea-dialog > header {
|
|
2753
|
+
display: flex;
|
|
2754
|
+
padding: 0 20px;
|
|
2755
|
+
align-items: center;
|
|
2756
|
+
border-bottom: 1px solid var(--rvg-color-grid);
|
|
2757
|
+
color: var(--rvg-color-text);
|
|
2758
|
+
font:
|
|
2759
|
+
600 16px Inter,
|
|
2760
|
+
ui-sans-serif,
|
|
2761
|
+
system-ui,
|
|
2762
|
+
sans-serif;
|
|
2763
|
+
}
|
|
2764
|
+
.rvg-textarea-dialog > textarea {
|
|
2765
|
+
min-height: 220px;
|
|
2766
|
+
margin: 20px;
|
|
2767
|
+
padding: 10px;
|
|
2768
|
+
resize: none;
|
|
2769
|
+
border: 1px solid var(--rvg-color-border);
|
|
2770
|
+
outline: none;
|
|
2771
|
+
background: var(--rvg-color-bg);
|
|
2772
|
+
color: var(--rvg-color-text);
|
|
2773
|
+
font:
|
|
2774
|
+
14px/1.5 Inter,
|
|
2775
|
+
ui-sans-serif,
|
|
2776
|
+
system-ui,
|
|
2777
|
+
sans-serif;
|
|
2778
|
+
}
|
|
2779
|
+
.rvg-textarea-dialog > textarea:focus {
|
|
2780
|
+
border-color: var(--rvg-color-primary);
|
|
2781
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--rvg-color-primary) 18%, transparent);
|
|
2782
|
+
}
|
|
2783
|
+
.rvg-textarea-dialog > footer {
|
|
2784
|
+
display: flex;
|
|
2785
|
+
padding: 12px 20px;
|
|
2786
|
+
align-items: center;
|
|
2787
|
+
justify-content: flex-end;
|
|
2788
|
+
border-top: 1px solid var(--rvg-color-grid);
|
|
2789
|
+
}
|
|
2790
|
+
.rvg-textarea-dialog > footer button {
|
|
2791
|
+
min-width: 88px;
|
|
2792
|
+
height: 36px;
|
|
2793
|
+
border: 0;
|
|
2794
|
+
border-radius: 6px;
|
|
2795
|
+
background: var(--rvg-color-primary);
|
|
2796
|
+
color: #fff;
|
|
2797
|
+
font:
|
|
2798
|
+
14px Inter,
|
|
2799
|
+
ui-sans-serif,
|
|
2800
|
+
system-ui,
|
|
2801
|
+
sans-serif;
|
|
2802
|
+
cursor: pointer;
|
|
2803
|
+
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, MouseEvent, CSSProperties, RefAttributes
|
|
1
|
+
import { ReactNode, MouseEvent, CSSProperties, RefAttributes } from 'react';
|
|
2
2
|
|
|
3
3
|
type GridKey = string | number;
|
|
4
4
|
type SelectionMode = 'single' | 'multiple';
|
|
@@ -193,15 +193,29 @@ interface GridColumn<Row> {
|
|
|
193
193
|
align?: 'left' | 'center' | 'right';
|
|
194
194
|
/** Enables double-click / Enter editing when an editor or fallback input exists. */
|
|
195
195
|
editable?: boolean | ((value: unknown, row: Row, rowIndex: number) => boolean);
|
|
196
|
-
/**
|
|
196
|
+
/** Hide the painted active-cell fill and border while preserving selection semantics. */
|
|
197
|
+
suppressSelectionStyle?: boolean;
|
|
198
|
+
/** Built-in editor configuration for text, numeric, selectable, multiline, date, time, and range cells. */
|
|
197
199
|
editor?: {
|
|
198
200
|
type: 'text';
|
|
201
|
+
} | {
|
|
202
|
+
type: 'number';
|
|
203
|
+
min?: number;
|
|
204
|
+
max?: number;
|
|
205
|
+
integer?: boolean;
|
|
199
206
|
} | {
|
|
200
207
|
type: 'select';
|
|
201
208
|
options: Array<{
|
|
202
209
|
label: string;
|
|
203
210
|
value: string;
|
|
204
211
|
}>;
|
|
212
|
+
searchable?: boolean;
|
|
213
|
+
allowCustomValue?: boolean;
|
|
214
|
+
maxDropdownHeight?: number;
|
|
215
|
+
} | {
|
|
216
|
+
type: 'textarea';
|
|
217
|
+
title?: string;
|
|
218
|
+
maxLength?: number;
|
|
205
219
|
} | {
|
|
206
220
|
type: 'date' | 'time' | 'date-time' | 'year' | 'month' | 'date-range' | 'time-range' | 'date-time-range';
|
|
207
221
|
format?: string;
|
|
@@ -441,7 +455,12 @@ interface ViewportRange {
|
|
|
441
455
|
columnEnd: number;
|
|
442
456
|
}
|
|
443
457
|
|
|
444
|
-
|
|
458
|
+
interface CompatibleReactElement {
|
|
459
|
+
type: any;
|
|
460
|
+
props: any;
|
|
461
|
+
key: string | null;
|
|
462
|
+
}
|
|
463
|
+
declare const Table: <Row extends object>(props: TableProps<Row> & RefAttributes<TableRef<Row>>) => CompatibleReactElement;
|
|
445
464
|
|
|
446
465
|
type LayoutColumn<Row> = GridColumn<Row> & {
|
|
447
466
|
rowSelection?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, MouseEvent, CSSProperties, RefAttributes
|
|
1
|
+
import { ReactNode, MouseEvent, CSSProperties, RefAttributes } from 'react';
|
|
2
2
|
|
|
3
3
|
type GridKey = string | number;
|
|
4
4
|
type SelectionMode = 'single' | 'multiple';
|
|
@@ -193,15 +193,29 @@ interface GridColumn<Row> {
|
|
|
193
193
|
align?: 'left' | 'center' | 'right';
|
|
194
194
|
/** Enables double-click / Enter editing when an editor or fallback input exists. */
|
|
195
195
|
editable?: boolean | ((value: unknown, row: Row, rowIndex: number) => boolean);
|
|
196
|
-
/**
|
|
196
|
+
/** Hide the painted active-cell fill and border while preserving selection semantics. */
|
|
197
|
+
suppressSelectionStyle?: boolean;
|
|
198
|
+
/** Built-in editor configuration for text, numeric, selectable, multiline, date, time, and range cells. */
|
|
197
199
|
editor?: {
|
|
198
200
|
type: 'text';
|
|
201
|
+
} | {
|
|
202
|
+
type: 'number';
|
|
203
|
+
min?: number;
|
|
204
|
+
max?: number;
|
|
205
|
+
integer?: boolean;
|
|
199
206
|
} | {
|
|
200
207
|
type: 'select';
|
|
201
208
|
options: Array<{
|
|
202
209
|
label: string;
|
|
203
210
|
value: string;
|
|
204
211
|
}>;
|
|
212
|
+
searchable?: boolean;
|
|
213
|
+
allowCustomValue?: boolean;
|
|
214
|
+
maxDropdownHeight?: number;
|
|
215
|
+
} | {
|
|
216
|
+
type: 'textarea';
|
|
217
|
+
title?: string;
|
|
218
|
+
maxLength?: number;
|
|
205
219
|
} | {
|
|
206
220
|
type: 'date' | 'time' | 'date-time' | 'year' | 'month' | 'date-range' | 'time-range' | 'date-time-range';
|
|
207
221
|
format?: string;
|
|
@@ -441,7 +455,12 @@ interface ViewportRange {
|
|
|
441
455
|
columnEnd: number;
|
|
442
456
|
}
|
|
443
457
|
|
|
444
|
-
|
|
458
|
+
interface CompatibleReactElement {
|
|
459
|
+
type: any;
|
|
460
|
+
props: any;
|
|
461
|
+
key: string | null;
|
|
462
|
+
}
|
|
463
|
+
declare const Table: <Row extends object>(props: TableProps<Row> & RefAttributes<TableRef<Row>>) => CompatibleReactElement;
|
|
445
464
|
|
|
446
465
|
type LayoutColumn<Row> = GridColumn<Row> & {
|
|
447
466
|
rowSelection?: boolean;
|