@rebasepro/ui 0.2.5 → 0.4.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.
- package/dist/components/Card.d.ts +2 -3
- package/dist/components/FilterChip.d.ts +2 -10
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +8 -2
- package/dist/index.es.js +112 -94
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +111 -93
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -3
- package/src/components/Card.tsx +1 -1
- package/src/components/DebouncedTextField.tsx +57 -16
- package/src/components/FilterChip.tsx +8 -13
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +3 -2
- package/src/components/VirtualTable/VirtualTableProps.tsx +21 -12
package/dist/index.umd.js
CHANGED
|
@@ -3182,49 +3182,80 @@
|
|
|
3182
3182
|
small: "px-2 py-0.5 text-xs",
|
|
3183
3183
|
medium: "px-2.5 py-1 text-xs"
|
|
3184
3184
|
};
|
|
3185
|
-
|
|
3186
|
-
const $ = reactCompilerRuntime.c(
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3185
|
+
const FilterChip = React.forwardRef(function FilterChip2(t0, ref) {
|
|
3186
|
+
const $ = reactCompilerRuntime.c(22);
|
|
3187
|
+
let children;
|
|
3188
|
+
let className;
|
|
3189
|
+
let icon;
|
|
3190
|
+
let onClick;
|
|
3191
|
+
let rest;
|
|
3192
|
+
let t1;
|
|
3193
|
+
let t2;
|
|
3194
|
+
let t3;
|
|
3195
|
+
if ($[0] !== t0) {
|
|
3196
|
+
({
|
|
3197
|
+
children,
|
|
3198
|
+
active: t1,
|
|
3199
|
+
onClick,
|
|
3200
|
+
icon,
|
|
3201
|
+
size: t2,
|
|
3202
|
+
className,
|
|
3203
|
+
disabled: t3,
|
|
3204
|
+
...rest
|
|
3205
|
+
} = t0);
|
|
3206
|
+
$[0] = t0;
|
|
3207
|
+
$[1] = children;
|
|
3208
|
+
$[2] = className;
|
|
3209
|
+
$[3] = icon;
|
|
3210
|
+
$[4] = onClick;
|
|
3211
|
+
$[5] = rest;
|
|
3212
|
+
$[6] = t1;
|
|
3213
|
+
$[7] = t2;
|
|
3214
|
+
$[8] = t3;
|
|
3215
|
+
} else {
|
|
3216
|
+
children = $[1];
|
|
3217
|
+
className = $[2];
|
|
3218
|
+
icon = $[3];
|
|
3219
|
+
onClick = $[4];
|
|
3220
|
+
rest = $[5];
|
|
3221
|
+
t1 = $[6];
|
|
3222
|
+
t2 = $[7];
|
|
3223
|
+
t3 = $[8];
|
|
3224
|
+
}
|
|
3196
3225
|
const active = t1 === void 0 ? false : t1;
|
|
3197
3226
|
const size = t2 === void 0 ? "medium" : t2;
|
|
3198
3227
|
const disabled = t3 === void 0 ? false : t3;
|
|
3199
3228
|
const t4 = sizeClasses[size];
|
|
3200
3229
|
let t5;
|
|
3201
|
-
if ($[
|
|
3230
|
+
if ($[9] !== active || $[10] !== className || $[11] !== disabled || $[12] !== t4) {
|
|
3202
3231
|
t5 = cls("inline-flex items-center gap-1 rounded-full", "font-medium whitespace-nowrap select-none shrink-0", "transition-all duration-150", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50", t4, active ? "bg-primary/12 text-primary dark:bg-primary/20 dark:text-primary shadow-[inset_0_0_0_1.5px_var(--color-primary)]" : cls("bg-surface-accent-100 text-text-secondary dark:bg-surface-accent-800 dark:text-text-secondary-dark", !disabled && "cursor-pointer hover:bg-surface-accent-200 dark:hover:bg-surface-accent-700"), disabled && "opacity-50 cursor-not-allowed", className);
|
|
3203
|
-
$[
|
|
3204
|
-
$[
|
|
3205
|
-
$[
|
|
3206
|
-
$[
|
|
3207
|
-
$[
|
|
3232
|
+
$[9] = active;
|
|
3233
|
+
$[10] = className;
|
|
3234
|
+
$[11] = disabled;
|
|
3235
|
+
$[12] = t4;
|
|
3236
|
+
$[13] = t5;
|
|
3208
3237
|
} else {
|
|
3209
|
-
t5 = $[
|
|
3238
|
+
t5 = $[13];
|
|
3210
3239
|
}
|
|
3211
3240
|
let t6;
|
|
3212
|
-
if ($[
|
|
3213
|
-
t6 = /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick, disabled, className: t5, children: [
|
|
3241
|
+
if ($[14] !== children || $[15] !== disabled || $[16] !== icon || $[17] !== onClick || $[18] !== ref || $[19] !== rest || $[20] !== t5) {
|
|
3242
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsxs("button", { ref, type: "button", onClick, disabled, className: t5, ...rest, children: [
|
|
3214
3243
|
icon,
|
|
3215
3244
|
children
|
|
3216
3245
|
] });
|
|
3217
|
-
$[
|
|
3218
|
-
$[
|
|
3219
|
-
$[
|
|
3220
|
-
$[
|
|
3221
|
-
$[
|
|
3222
|
-
$[
|
|
3246
|
+
$[14] = children;
|
|
3247
|
+
$[15] = disabled;
|
|
3248
|
+
$[16] = icon;
|
|
3249
|
+
$[17] = onClick;
|
|
3250
|
+
$[18] = ref;
|
|
3251
|
+
$[19] = rest;
|
|
3252
|
+
$[20] = t5;
|
|
3253
|
+
$[21] = t6;
|
|
3223
3254
|
} else {
|
|
3224
|
-
t6 = $[
|
|
3255
|
+
t6 = $[21];
|
|
3225
3256
|
}
|
|
3226
3257
|
return t6;
|
|
3227
|
-
}
|
|
3258
|
+
});
|
|
3228
3259
|
const colorClasses = {
|
|
3229
3260
|
info: "bg-sky-200 dark:bg-teal-900",
|
|
3230
3261
|
warn: "bg-orange-200 dark:bg-yellow-950"
|
|
@@ -7553,73 +7584,59 @@
|
|
|
7553
7584
|
});
|
|
7554
7585
|
Badge.displayName = "Badge";
|
|
7555
7586
|
function DebouncedTextField(props) {
|
|
7556
|
-
const
|
|
7557
|
-
const
|
|
7558
|
-
const
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
|
|
7587
|
+
const [internalValue, setInternalValue] = React.useState(props.value ?? "");
|
|
7588
|
+
const lastSentValueRef = React.useRef(props.value ?? "");
|
|
7589
|
+
const timerRef = React.useRef(void 0);
|
|
7590
|
+
React.useEffect(() => {
|
|
7591
|
+
const externalValue = props.value ?? "";
|
|
7592
|
+
if (externalValue !== lastSentValueRef.current) {
|
|
7593
|
+
setInternalValue(externalValue);
|
|
7594
|
+
lastSentValueRef.current = externalValue;
|
|
7595
|
+
}
|
|
7596
|
+
}, [props.value]);
|
|
7597
|
+
React.useEffect(() => {
|
|
7598
|
+
return () => {
|
|
7599
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
7565
7600
|
};
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
}
|
|
7582
|
-
|
|
7583
|
-
|
|
7601
|
+
}, []);
|
|
7602
|
+
const flushChange = React.useCallback((value, event) => {
|
|
7603
|
+
if (timerRef.current) {
|
|
7604
|
+
clearTimeout(timerRef.current);
|
|
7605
|
+
timerRef.current = void 0;
|
|
7606
|
+
}
|
|
7607
|
+
if (value !== props.value && props.onChange) {
|
|
7608
|
+
lastSentValueRef.current = value;
|
|
7609
|
+
const e = {
|
|
7610
|
+
...event,
|
|
7611
|
+
target: {
|
|
7612
|
+
...event?.target,
|
|
7613
|
+
value,
|
|
7614
|
+
name: props.name
|
|
7615
|
+
}
|
|
7616
|
+
};
|
|
7617
|
+
props.onChange(e);
|
|
7618
|
+
}
|
|
7619
|
+
}, [props.value, props.onChange, props.name]);
|
|
7620
|
+
const internalOnChange = React.useCallback((event_0) => {
|
|
7621
|
+
const newValue = event_0.target.value;
|
|
7622
|
+
setInternalValue(newValue);
|
|
7623
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
7624
|
+
const eventCopy = {
|
|
7625
|
+
...event_0,
|
|
7626
|
+
target: {
|
|
7627
|
+
...event_0?.target,
|
|
7628
|
+
name: event_0?.target?.name
|
|
7584
7629
|
}
|
|
7585
7630
|
};
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
}
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
$[6] = deferredValue;
|
|
7596
|
-
$[7] = props.value;
|
|
7597
|
-
$[8] = t3;
|
|
7598
|
-
} else {
|
|
7599
|
-
t3 = $[8];
|
|
7600
|
-
}
|
|
7601
|
-
React.useEffect(t2, t3);
|
|
7602
|
-
let t4;
|
|
7603
|
-
if ($[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
7604
|
-
t4 = (event) => {
|
|
7605
|
-
previousEventRef.current = event;
|
|
7606
|
-
setInternalValue(event.target.value);
|
|
7607
|
-
};
|
|
7608
|
-
$[9] = t4;
|
|
7609
|
-
} else {
|
|
7610
|
-
t4 = $[9];
|
|
7611
|
-
}
|
|
7612
|
-
const internalOnChange = t4;
|
|
7613
|
-
let t5;
|
|
7614
|
-
if ($[10] !== internalValue || $[11] !== props) {
|
|
7615
|
-
t5 = /* @__PURE__ */ jsxRuntime.jsx(TextField, { ...props, onChange: internalOnChange, value: internalValue });
|
|
7616
|
-
$[10] = internalValue;
|
|
7617
|
-
$[11] = props;
|
|
7618
|
-
$[12] = t5;
|
|
7619
|
-
} else {
|
|
7620
|
-
t5 = $[12];
|
|
7621
|
-
}
|
|
7622
|
-
return t5;
|
|
7631
|
+
timerRef.current = setTimeout(() => {
|
|
7632
|
+
flushChange(newValue, eventCopy);
|
|
7633
|
+
}, 150);
|
|
7634
|
+
}, [flushChange]);
|
|
7635
|
+
const internalOnBlur = React.useCallback((event_1) => {
|
|
7636
|
+
flushChange(internalValue, event_1);
|
|
7637
|
+
props.onBlur?.(event_1);
|
|
7638
|
+
}, [internalValue, flushChange, props.onBlur]);
|
|
7639
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TextField, { ...props, onChange: internalOnChange, onBlur: internalOnBlur, value: internalValue });
|
|
7623
7640
|
}
|
|
7624
7641
|
const styles = `
|
|
7625
7642
|
@keyframes shimmer {
|
|
@@ -8339,7 +8356,8 @@
|
|
|
8339
8356
|
height: headerHeight
|
|
8340
8357
|
}, children: [
|
|
8341
8358
|
columns.map((column_0, columnIndex) => {
|
|
8342
|
-
const
|
|
8359
|
+
const columnFilter = column_0 && filter && filter[column_0.key] ? filter[column_0.key] : void 0;
|
|
8360
|
+
const filterForThisProperty = columnFilter ? Array.isArray(columnFilter[0]) ? columnFilter[0] : columnFilter : void 0;
|
|
8343
8361
|
const isDraggable = !column_0.frozen && !!onColumnsOrderChange;
|
|
8344
8362
|
const isDragging = draggingColumnId === column_0.key;
|
|
8345
8363
|
return /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(SortableColumnHeader, { column: column_0, columnIndex, columnRefs, isResizing, onFilterUpdate, filter: filterForThisProperty, sortByProperty, currentSort, onColumnSort, onClickResizeColumn, createFilterField, isDragging, isDraggable }) }, "header_" + column_0.key);
|