@krak-stack/registry 0.11.7 → 0.11.9
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/CHANGELOG.md +54 -0
- package/README.md +39 -0
- package/dist/components/app-switcher/html.d.ts +2 -2
- package/dist/components/asset-input/html.d.ts +70 -0
- package/dist/components/asset-input/html.js +1549 -0
- package/dist/components/asset-input/index.d.ts +280 -0
- package/dist/components/asset-input/react.d.ts +32 -0
- package/dist/components/asset-input/react.js +2269 -0
- package/dist/components/asset-input/schema.d.ts +93 -0
- package/dist/components/asset-input/upload.d.ts +15 -0
- package/dist/components/asset-table/html.d.ts +110 -0
- package/dist/components/asset-table/html.js +4934 -0
- package/dist/components/asset-table/index.d.ts +225 -0
- package/dist/components/asset-table/react.d.ts +21 -0
- package/dist/components/asset-table/react.js +8241 -0
- package/dist/components/asset-table/schema.d.ts +73 -0
- package/dist/components/audit-log-table/html.js +47 -13
- package/dist/components/audit-log-table/react.js +36 -12
- package/dist/components/copy-button/html.d.ts +2 -2
- package/dist/components/danger-confirmation/html.d.ts +2 -2
- package/dist/components/data-table/classes.d.ts +2 -0
- package/dist/components/data-table/html.d.ts +58 -0
- package/dist/components/data-table/html.js +47 -13
- package/dist/components/data-table/index.d.ts +51 -1
- package/dist/components/data-table/react.d.ts +1 -0
- package/dist/components/data-table/react.js +36 -12
- package/dist/components/data-table/schema.d.ts +93 -3
- package/dist/components/date-input/html.d.ts +2 -2
- package/dist/components/docs/html.js +22 -4
- package/dist/components/docs/react.js +33 -2
- package/dist/components/editable-text/html.d.ts +2 -2
- package/dist/components/editing-locale-switcher/html.d.ts +2 -2
- package/dist/components/effect-form/react.js +343 -138
- package/dist/components/file-input/classes.d.ts +1 -1
- package/dist/components/file-input/file-type.d.ts +1 -0
- package/dist/components/file-input/html.d.ts +8 -1
- package/dist/components/file-input/html.js +170 -12
- package/dist/components/file-input/index.d.ts +1 -0
- package/dist/components/file-input/react.d.ts +9 -1
- package/dist/components/file-input/react.js +277 -127
- package/dist/components/file-input/schema.d.ts +1 -0
- package/dist/components/form/react.d.ts +5 -5
- package/dist/components/form/react.js +343 -138
- package/dist/components/icon-input/html.js +19 -5
- package/dist/components/icon-input/react.js +70 -13
- package/dist/components/locale-switcher/html.d.ts +2 -2
- package/dist/components/map-menu/html.d.ts +10 -4
- package/dist/components/map-menu/html.js +13 -8
- package/dist/components/map-menu/index.d.ts +5 -4
- package/dist/components/map-menu/react.d.ts +28 -17
- package/dist/components/map-menu/react.js +84 -178
- package/dist/components/map-menu/schema.d.ts +6 -0
- package/dist/components/map-menu/shared.d.ts +4 -0
- package/dist/components/permissions-input/classes.d.ts +8 -0
- package/dist/components/permissions-input/html.d.ts +41 -0
- package/dist/components/permissions-input/html.js +130 -0
- package/dist/components/permissions-input/index.d.ts +80 -0
- package/dist/components/permissions-input/react.d.ts +7 -0
- package/dist/components/permissions-input/react.js +201 -0
- package/dist/components/permissions-input/schema.d.ts +33 -0
- package/dist/components/phone-number-input/html.js +48 -14
- package/dist/components/phone-number-input/react.js +67 -10
- package/dist/components/presence-transition/index.d.ts +2 -2
- package/dist/components/search-menu/html.d.ts +2 -2
- package/dist/components/sidebar-layout/html.d.ts +3 -2
- package/dist/components/sidebar-layout/html.js +20 -2
- package/dist/components/sidebar-layout/index.d.ts +1 -0
- package/dist/components/sidebar-layout/react.js +33 -2
- package/dist/components/time-input/html.d.ts +2 -2
- package/dist/components/timezone-input/html.js +48 -14
- package/dist/components/timezone-input/react.js +67 -10
- package/dist/components/tracking-notice/html.d.ts +4 -4
- package/dist/components/tracking-notice/index.d.ts +2 -2
- package/dist/components/upload-attachment/classes.d.ts +3 -2
- package/dist/components/upload-attachment/html.d.ts +1 -1
- package/dist/components/upload-attachment/html.js +7 -5
- package/dist/components/upload-attachment/react.d.ts +3 -1
- package/dist/components/upload-attachment/react.js +25 -17
- package/dist/components/virtualized-combobox/classes.d.ts +12 -0
- package/dist/components/virtualized-combobox/html.d.ts +45 -3
- package/dist/components/virtualized-combobox/html.js +48 -14
- package/dist/components/virtualized-combobox/index.d.ts +55 -4
- package/dist/components/virtualized-combobox/react.d.ts +6 -2
- package/dist/components/virtualized-combobox/react.js +67 -10
- package/dist/components/virtualized-combobox/schema.d.ts +60 -4
- package/dist/components/webhook-delivery-table/html.js +47 -13
- package/dist/components/webhook-delivery-table/react.js +36 -12
- package/dist/lib/access/index.d.ts +61 -0
- package/dist/lib/access/index.js +92 -0
- package/dist/lib/access/table/classes.d.ts +13 -0
- package/dist/lib/access/table/html.d.ts +39 -0
- package/dist/lib/access/table/html.js +157 -0
- package/dist/lib/access/table/index.d.ts +32 -0
- package/dist/lib/access/table/react.d.ts +3 -0
- package/dist/lib/access/table/react.js +195 -0
- package/dist/lib/access/table/schema.d.ts +43 -0
- package/dist/lib/docs.integrations.server.js +23 -1
- package/dist/lib/docs.js +33 -2
- package/dist/lib/docs.server.js +29 -2
- package/dist/lib/documentation-toolkit.js +23 -1
- package/dist/lib/effect-ui-adapter/use-model.d.ts +1 -1
- package/dist/lib/effect-ui-adapter/use-model.js +19 -11
- package/dist/lib/lucide-effect.d.ts +19 -19
- package/dist/lib/lucide-effect.js +38 -38
- package/dist/services/assets/library.d.ts +221 -0
- package/dist/services/assets/schema.d.ts +3 -0
- package/dist/services/assets/url.d.ts +12 -0
- package/dist/services/assets/use-library.d.ts +20 -0
- package/package.json +13 -1
|
@@ -489,6 +489,7 @@ var tableClasses = {
|
|
|
489
489
|
actionTrigger: `size-8 ${cellTriggerFocus}`,
|
|
490
490
|
actionsCell: "sticky right-0 z-20 w-10 min-w-10 cursor-default bg-background p-0 transition-colors group-hover/row:bg-[color-mix(in_oklab,var(--muted)_50%,var(--background))]",
|
|
491
491
|
actionsAlign: "flex min-h-12 items-center justify-end pe-1",
|
|
492
|
+
row: "h-16 [&:where(:not(:last-child))>td]:border-b",
|
|
492
493
|
header: "relative h-12 p-0",
|
|
493
494
|
stickyHeader: "sticky top-0 z-30 bg-background",
|
|
494
495
|
stickyHeaderRule: "after:border-border after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:border-b",
|
|
@@ -555,6 +556,7 @@ var DataTableItemSchema = Schema4.Struct({
|
|
|
555
556
|
value: Schema4.NonEmptyString,
|
|
556
557
|
label: Schema4.String
|
|
557
558
|
}).annotate({ identifier: "DataTableItem" });
|
|
559
|
+
var TableIconSchema = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableIcon" });
|
|
558
560
|
var DataTableReferenceSchema = Schema4.Struct({
|
|
559
561
|
label: Schema4.String,
|
|
560
562
|
description: Schema4.optionalKey(Schema4.String),
|
|
@@ -594,11 +596,15 @@ var DataTableActionSchema = Schema4.Struct({
|
|
|
594
596
|
variant: Schema4.optionalKey(Schema4.Literals(["default", "destructive"])),
|
|
595
597
|
disabled: Schema4.optionalKey(Schema4.Boolean)
|
|
596
598
|
}).annotate({ identifier: "DataTableAction" });
|
|
599
|
+
var DataTableRowActionSchema = Schema4.Struct({
|
|
600
|
+
...DataTableActionSchema.fields,
|
|
601
|
+
icon: Schema4.optionalKey(TableIconSchema)
|
|
602
|
+
}).annotate({ identifier: "DataTableRowAction" });
|
|
597
603
|
var DataTableRowSchema = Schema4.Struct({
|
|
598
604
|
id: Schema4.NonEmptyString,
|
|
599
605
|
label: Schema4.String,
|
|
600
606
|
cells: Schema4.Record(Schema4.String, DataTableCellValueSchema),
|
|
601
|
-
actions: Schema4.optionalKey(Schema4.Array(
|
|
607
|
+
actions: Schema4.optionalKey(Schema4.Array(DataTableRowActionSchema)),
|
|
602
608
|
primaryActionId: Schema4.optionalKey(Schema4.String),
|
|
603
609
|
groups: Schema4.optionalKey(Schema4.Record(Schema4.String, Schema4.Array(Schema4.String))),
|
|
604
610
|
selectable: Schema4.optionalKey(Schema4.Boolean),
|
|
@@ -633,11 +639,10 @@ var DataTableBadgeOptionSchema = Schema4.Struct({
|
|
|
633
639
|
"muted"
|
|
634
640
|
]))
|
|
635
641
|
}).annotate({ identifier: "DataTableBadgeOption" });
|
|
636
|
-
var BadgeIcon = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableBadgeIcon" });
|
|
637
642
|
var DataTableBadgeOptionsSchema = Schema4.Struct({
|
|
638
643
|
options: Schema4.optionalKey(Schema4.Array(DataTableBadgeOptionSchema.mapFields((fields) => ({
|
|
639
644
|
...fields,
|
|
640
|
-
icon: Schema4.optionalKey(
|
|
645
|
+
icon: Schema4.optionalKey(TableIconSchema)
|
|
641
646
|
}))))
|
|
642
647
|
}).annotate({ identifier: "DataTableBadgeOptions" });
|
|
643
648
|
var DataTableFieldSchema = Schema4.Union([
|
|
@@ -652,6 +657,7 @@ var DataTableFieldSchema = Schema4.Union([
|
|
|
652
657
|
type: Schema4.Literal("number"),
|
|
653
658
|
typeOptions: Schema4.optionalKey(Schema4.Struct({
|
|
654
659
|
locale: Schema4.optionalKey(Schema4.String),
|
|
660
|
+
format: Schema4.optionalKey(Schema4.Literal("bytes")),
|
|
655
661
|
style: Schema4.optionalKey(Schema4.Literals(["decimal", "percent", "currency", "unit"])),
|
|
656
662
|
currency: Schema4.optionalKey(Schema4.String),
|
|
657
663
|
unit: Schema4.optionalKey(Schema4.String),
|
|
@@ -661,7 +667,14 @@ var DataTableFieldSchema = Schema4.Union([
|
|
|
661
667
|
exportFormat: Schema4.optionalKey(Schema4.Literals(["raw", "formatted"]))
|
|
662
668
|
}).annotate({ identifier: "DataTableNumberFormat" }))
|
|
663
669
|
}),
|
|
664
|
-
Schema4.Struct({
|
|
670
|
+
Schema4.Struct({
|
|
671
|
+
...column,
|
|
672
|
+
type: Schema4.Literal("reference"),
|
|
673
|
+
typeOptions: Schema4.optionalKey(Schema4.Struct({
|
|
674
|
+
imageVariant: Schema4.optionalKey(Schema4.Literals(["circle", "square"])),
|
|
675
|
+
fallbackIcons: Schema4.optionalKey(Schema4.Record(Schema4.String, TableIconSchema))
|
|
676
|
+
}).annotate({ identifier: "DataTableReferenceOptions" }))
|
|
677
|
+
}),
|
|
665
678
|
Schema4.Struct({
|
|
666
679
|
...column,
|
|
667
680
|
type: Schema4.Literal("date"),
|
|
@@ -948,9 +961,17 @@ var isTableBoolean = Schema5.is(Schema5.Boolean);
|
|
|
948
961
|
var isTableReference = Schema5.is(DataTableReferenceSchema);
|
|
949
962
|
var isTableList = Schema5.is(Schema5.Array(DataTableItemSchema));
|
|
950
963
|
var tableInitials = (label) => label.trim().split(/\s+/).slice(0, 2).map((word) => word.slice(0, 1)).join("").toLocaleUpperCase();
|
|
964
|
+
var formatBytes = (bytes, locale) => {
|
|
965
|
+
const [unit, scale] = bytes >= 1024 ** 2 ? ["megabyte", 1024 ** 2] : bytes >= 1024 ? ["kilobyte", 1024] : ["byte", 1];
|
|
966
|
+
return new Intl.NumberFormat(locale, {
|
|
967
|
+
style: "unit",
|
|
968
|
+
unit,
|
|
969
|
+
maximumFractionDigits: 1
|
|
970
|
+
}).format(bytes / scale);
|
|
971
|
+
};
|
|
951
972
|
var formatNumberValue = (value, options, defaultLocale = "en") => {
|
|
952
|
-
const { locale,
|
|
953
|
-
return new Intl.NumberFormat(locale ?? defaultLocale,
|
|
973
|
+
const { locale, format, ...intlOptions } = options ?? {};
|
|
974
|
+
return format === "bytes" ? formatBytes(value, locale ?? defaultLocale) : new Intl.NumberFormat(locale ?? defaultLocale, intlOptions).format(value);
|
|
954
975
|
};
|
|
955
976
|
var tableBooleanLabel = (value, options) => (value ? options?.trueLabel : options?.falseLabel) ?? String(value);
|
|
956
977
|
var decodeDateInput = Schema5.decodeUnknownOption(DataTableDateInputSchema);
|
|
@@ -2089,6 +2110,7 @@ var DataTable = Html2.component({
|
|
|
2089
2110
|
filterColumnId,
|
|
2090
2111
|
childSearch,
|
|
2091
2112
|
icon,
|
|
2113
|
+
rowIcon,
|
|
2092
2114
|
separatorBefore
|
|
2093
2115
|
}) => {
|
|
2094
2116
|
if (children || filterEditor) {
|
|
@@ -2161,7 +2183,7 @@ var DataTable = Html2.component({
|
|
|
2161
2183
|
value: id,
|
|
2162
2184
|
closeOnClick: !searchLabel
|
|
2163
2185
|
});
|
|
2164
|
-
const content = part.children(checked !== undefined && h.span.attr("aria-hidden", "true").class("w-3").children(checked ? "✓" : ""), indicator(icon), name);
|
|
2186
|
+
const content = part.children(rowIcon?.(h, { size: 16, className: "shrink-0" }), checked !== undefined && h.span.attr("aria-hidden", "true").class("w-3").children(checked ? "✓" : ""), indicator(icon), name);
|
|
2165
2187
|
return separatorBefore ? h.div.children(MenuSeparator(h, menu), content) : content;
|
|
2166
2188
|
})))));
|
|
2167
2189
|
}
|
|
@@ -2278,12 +2300,18 @@ var DataTable = Html2.component({
|
|
|
2278
2300
|
}
|
|
2279
2301
|
case "boolean":
|
|
2280
2302
|
return isTableBoolean(value) ? h.label.attr("data-slot", "data-table-boolean-cell").class(cn(booleanCellControl, column.editable && !disabled && "hover:bg-muted/50 cursor-pointer")).children(check(keyOf("edit", row.id, column.id), `${column.headerName}: ${row.label}`, value, (value) => edit(DataTableEdit.SetBoolean({ value })), { readOnly: !column.editable || disabled }, true)) : empty;
|
|
2281
|
-
case "reference":
|
|
2282
|
-
|
|
2283
|
-
|
|
2303
|
+
case "reference": {
|
|
2304
|
+
if (!isTableReference(value))
|
|
2305
|
+
return empty;
|
|
2306
|
+
const image = value.imageSrc && !model.failedImages.includes(value.imageSrc) ? value.imageSrc : undefined;
|
|
2307
|
+
const fallbackIcons = column.typeOptions?.fallbackIcons;
|
|
2308
|
+
const fallbackIcon = fallbackIcons && Object.hasOwn(fallbackIcons, row.id) ? fallbackIcons[row.id] : undefined;
|
|
2309
|
+
return h.div.class(tableClasses.reference).children(h.span.class(cn(tableClasses.referenceAvatar, column.typeOptions?.imageVariant === "square" ? "rounded-md" : "rounded-full")).children((!image || !fallbackIcon) && h.span.attr("aria-hidden", "true").children(fallbackIcon?.(h, { size: 16 }) ?? tableInitials(value.label)), image && h.img.attrs({
|
|
2310
|
+
src: image,
|
|
2284
2311
|
alt: "",
|
|
2285
2312
|
loading: "lazy"
|
|
2286
|
-
}).class("absolute inset-0 size-full object-cover").on("error", DataTableMessage.ReferenceImageFailed({ src:
|
|
2313
|
+
}).class("absolute inset-0 size-full object-cover").on("error", DataTableMessage.ReferenceImageFailed({ src: image }))), h.div.class(tableClasses.referenceText).children(h.span.class(tableClasses.referenceName).attr("title", value.label).children(value.label), value.description && h.span.class(tableClasses.referenceDescription).children(value.description)));
|
|
2314
|
+
}
|
|
2287
2315
|
case "list": {
|
|
2288
2316
|
const current = isTableList(value) ? value : [];
|
|
2289
2317
|
const visible = current.slice(0, column.visibleCount ?? 3);
|
|
@@ -2370,13 +2398,19 @@ var DataTable = Html2.component({
|
|
|
2370
2398
|
};
|
|
2371
2399
|
const dragHandle = (row) => draggable && h.span.attr("aria-hidden", "true").class("inline-flex size-8 cursor-grab items-center justify-center text-muted-foreground").draggable({ [RowDrag]: row.id }, { effectAllowed: "move" }).on("dragstart", DataTableMessage.DragStarted({ rowId: row.id })).on("dragend", DataTableMessage.DragEnded()).children(GripVertical(h, { size: 16 }));
|
|
2372
2400
|
const rowControls = (row, siblings, key) => {
|
|
2373
|
-
const items = tableRowActions(row, siblings, reorder, copy)
|
|
2401
|
+
const items = tableRowActions(row, siblings, reorder, copy).map((item) => {
|
|
2402
|
+
if ("icon" in item) {
|
|
2403
|
+
const { icon, ...action } = item;
|
|
2404
|
+
return { ...action, rowIcon: icon };
|
|
2405
|
+
}
|
|
2406
|
+
return { ...item, icon: undefined };
|
|
2407
|
+
});
|
|
2374
2408
|
return items.length > 0 && menu(keyOf("row", key, row.id), copy.actions, `${copy.actions}: ${row.label}`, items, false, undefined, false, "actions");
|
|
2375
2409
|
};
|
|
2376
2410
|
const renderRow = (row, siblings, key, group) => {
|
|
2377
2411
|
const primary = row.actions?.find(({ id, disabled }) => id === row.primaryActionId && !disabled);
|
|
2378
2412
|
const activate = props.rowActivation ? DataTableMessage.RowActivated({ rowId: row.id }) : primary && DataTableMessage.RowActionRequested({ rowId: row.id, actionId: primary.id });
|
|
2379
|
-
const tr = h.tr.key(keyOf(key, row.id)).class(cn("group/row hover:bg-muted/50 data-[selected]:bg-muted/40
|
|
2413
|
+
const tr = h.tr.key(keyOf(key, row.id)).class(cn("group/row hover:bg-muted/50 data-[selected]:bg-muted/40", tableClasses.row, props.rowActivation && "cursor-pointer")).attr("data-selected", selected.has(row.id) ? "" : undefined);
|
|
2380
2414
|
const rowElement = props.rowActivation && activate ? tr.attr("tabindex", "0").on("click", activate).on("keydown", (event) => !event.repeat && !event.composing && (event.key === "Enter" || event.key === " ") ? activate : undefined, { preventDefault: true }) : tr;
|
|
2381
2415
|
const ignoreActivation = () => {
|
|
2382
2416
|
return;
|
|
@@ -114,8 +114,10 @@ export declare const isTableList: <I>(input: I) => input is I & readonly {
|
|
|
114
114
|
readonly label: string;
|
|
115
115
|
}[];
|
|
116
116
|
export declare const tableInitials: (label: string) => string;
|
|
117
|
+
export declare const formatBytes: (bytes: number, locale: string) => string;
|
|
117
118
|
export declare const formatNumberValue: (value: number, options: (Intl.NumberFormatOptions & {
|
|
118
119
|
locale?: string;
|
|
120
|
+
format?: "bytes";
|
|
119
121
|
}) | undefined, defaultLocale?: string) => string;
|
|
120
122
|
type DateColumnType = "date" | "dateTime";
|
|
121
123
|
export declare const resolveDate: (value: unknown, type: DateColumnType) => {
|
|
@@ -177,6 +179,7 @@ export declare const filterTableColumns: (rows: readonly DataTableRow[], columns
|
|
|
177
179
|
readonly name: string;
|
|
178
180
|
readonly variant?: "default" | "destructive" | undefined;
|
|
179
181
|
readonly disabled?: boolean | undefined;
|
|
182
|
+
readonly icon?: (<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">) | undefined;
|
|
180
183
|
}[] | undefined;
|
|
181
184
|
readonly primaryActionId?: string | undefined;
|
|
182
185
|
readonly groups?: {
|
|
@@ -205,6 +208,7 @@ export declare const sortTableRows: (rows: readonly DataTableRow[], columns: rea
|
|
|
205
208
|
readonly name: string;
|
|
206
209
|
readonly variant?: "default" | "destructive" | undefined;
|
|
207
210
|
readonly disabled?: boolean | undefined;
|
|
211
|
+
readonly icon?: (<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">) | undefined;
|
|
208
212
|
}[] | undefined;
|
|
209
213
|
readonly primaryActionId?: string | undefined;
|
|
210
214
|
readonly groups?: {
|
|
@@ -231,6 +235,7 @@ export declare const filterTableRows: (rows: readonly DataTableRow[], columns: r
|
|
|
231
235
|
readonly name: string;
|
|
232
236
|
readonly variant?: "default" | "destructive" | undefined;
|
|
233
237
|
readonly disabled?: boolean | undefined;
|
|
238
|
+
readonly icon?: (<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">) | undefined;
|
|
234
239
|
}[] | undefined;
|
|
235
240
|
readonly primaryActionId?: string | undefined;
|
|
236
241
|
readonly groups?: {
|
|
@@ -551,7 +556,7 @@ export declare const DataTableMessage: UiSchema.TaggedEnum<{
|
|
|
551
556
|
export declare const dataTableOptions: {
|
|
552
557
|
readonly name: "DataTable";
|
|
553
558
|
readonly props: Schema.Struct<{
|
|
554
|
-
readonly classes: Schema.optional<Schema.$Record<Schema.Literals<("actionTrigger" | "actionsAlign" | "actionsCell" | "cell" | "cellContent" | "count" | "group" | "groupContent" | "groupSticky" | "groupTrigger" | "header" | "headerTrigger" | "menubar" | "reference" | "referenceAvatar" | "referenceDescription" | "referenceName" | "referenceText" | "relationshipCell" | "relationshipTrigger" | "resizeHandle" | "selectedTrigger" | "selectionCell" | "selectionCenter" | "stickyHeader" | "stickyHeaderRule" | "toolbar" | "toolbarMenus" | "toolbarSearch")[]>, Schema.optionalKey<Schema.String>>>;
|
|
559
|
+
readonly classes: Schema.optional<Schema.$Record<Schema.Literals<("actionTrigger" | "actionsAlign" | "actionsCell" | "cell" | "cellContent" | "count" | "group" | "groupContent" | "groupSticky" | "groupTrigger" | "header" | "headerTrigger" | "menubar" | "reference" | "referenceAvatar" | "referenceDescription" | "referenceName" | "referenceText" | "relationshipCell" | "relationshipTrigger" | "resizeHandle" | "row" | "selectedTrigger" | "selectionCell" | "selectionCenter" | "stickyHeader" | "stickyHeaderRule" | "toolbar" | "toolbarMenus" | "toolbarSearch")[]>, Schema.optionalKey<Schema.String>>>;
|
|
555
560
|
readonly className: Schema.optionalKey<Schema.String>;
|
|
556
561
|
readonly locale: Schema.optionalKey<Schema.String>;
|
|
557
562
|
readonly label: Schema.String;
|
|
@@ -571,6 +576,7 @@ export declare const dataTableOptions: {
|
|
|
571
576
|
readonly name: Schema.String;
|
|
572
577
|
readonly variant: Schema.optionalKey<Schema.Literals<readonly ["default", "destructive"]>>;
|
|
573
578
|
readonly disabled: Schema.optionalKey<Schema.Boolean>;
|
|
579
|
+
readonly icon: Schema.optionalKey<Schema.declare<<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">, <Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">>>;
|
|
574
580
|
}>>>;
|
|
575
581
|
readonly primaryActionId: Schema.optionalKey<Schema.String>;
|
|
576
582
|
readonly groups: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
@@ -646,6 +652,7 @@ export declare const dataTableOptions: {
|
|
|
646
652
|
readonly type: Schema.Literal<"number">;
|
|
647
653
|
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
648
654
|
readonly locale: Schema.optionalKey<Schema.String>;
|
|
655
|
+
readonly format: Schema.optionalKey<Schema.Literal<"bytes">>;
|
|
649
656
|
readonly style: Schema.optionalKey<Schema.Literals<readonly ["decimal", "percent", "currency", "unit"]>>;
|
|
650
657
|
readonly currency: Schema.optionalKey<Schema.String>;
|
|
651
658
|
readonly unit: Schema.optionalKey<Schema.String>;
|
|
@@ -670,6 +677,10 @@ export declare const dataTableOptions: {
|
|
|
670
677
|
readonly emptyLabel: Schema.optionalKey<Schema.String>;
|
|
671
678
|
readonly nulls: Schema.optionalKey<Schema.Literals<readonly ["first", "last"]>>;
|
|
672
679
|
readonly type: Schema.Literal<"reference">;
|
|
680
|
+
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
681
|
+
readonly imageVariant: Schema.optionalKey<Schema.Literals<readonly ["circle", "square"]>>;
|
|
682
|
+
readonly fallbackIcons: Schema.optionalKey<Schema.$Record<Schema.String, Schema.declare<<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">, <Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">>>>;
|
|
683
|
+
}>>;
|
|
673
684
|
}>, Schema.Struct<{
|
|
674
685
|
readonly id: Schema.NonEmptyString;
|
|
675
686
|
readonly headerName: Schema.String;
|
|
@@ -792,6 +803,7 @@ export declare const dataTableOptions: {
|
|
|
792
803
|
readonly type: Schema.Literal<"number">;
|
|
793
804
|
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
794
805
|
readonly locale: Schema.optionalKey<Schema.String>;
|
|
806
|
+
readonly format: Schema.optionalKey<Schema.Literal<"bytes">>;
|
|
795
807
|
readonly style: Schema.optionalKey<Schema.Literals<readonly ["decimal", "percent", "currency", "unit"]>>;
|
|
796
808
|
readonly currency: Schema.optionalKey<Schema.String>;
|
|
797
809
|
readonly unit: Schema.optionalKey<Schema.String>;
|
|
@@ -843,6 +855,7 @@ export declare const dataTableOptions: {
|
|
|
843
855
|
readonly type: Schema.Literal<"number">;
|
|
844
856
|
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
845
857
|
readonly locale: Schema.optionalKey<Schema.String>;
|
|
858
|
+
readonly format: Schema.optionalKey<Schema.Literal<"bytes">>;
|
|
846
859
|
readonly style: Schema.optionalKey<Schema.Literals<readonly ["decimal", "percent", "currency", "unit"]>>;
|
|
847
860
|
readonly currency: Schema.optionalKey<Schema.String>;
|
|
848
861
|
readonly unit: Schema.optionalKey<Schema.String>;
|
|
@@ -867,6 +880,10 @@ export declare const dataTableOptions: {
|
|
|
867
880
|
readonly emptyLabel: Schema.optionalKey<Schema.String>;
|
|
868
881
|
readonly nulls: Schema.optionalKey<Schema.Literals<readonly ["first", "last"]>>;
|
|
869
882
|
readonly type: Schema.Literal<"reference">;
|
|
883
|
+
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
884
|
+
readonly imageVariant: Schema.optionalKey<Schema.Literals<readonly ["circle", "square"]>>;
|
|
885
|
+
readonly fallbackIcons: Schema.optionalKey<Schema.$Record<Schema.String, Schema.declare<<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">, <Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">>>>;
|
|
886
|
+
}>>;
|
|
870
887
|
}>, Schema.Struct<{
|
|
871
888
|
readonly id: Schema.NonEmptyString;
|
|
872
889
|
readonly headerName: Schema.String;
|
|
@@ -987,6 +1004,10 @@ export declare const dataTableOptions: {
|
|
|
987
1004
|
readonly emptyLabel: Schema.optionalKey<Schema.String>;
|
|
988
1005
|
readonly nulls: Schema.optionalKey<Schema.Literals<readonly ["first", "last"]>>;
|
|
989
1006
|
readonly type: Schema.Literal<"reference">;
|
|
1007
|
+
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
1008
|
+
readonly imageVariant: Schema.optionalKey<Schema.Literals<readonly ["circle", "square"]>>;
|
|
1009
|
+
readonly fallbackIcons: Schema.optionalKey<Schema.$Record<Schema.String, Schema.declare<<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">, <Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">>>>;
|
|
1010
|
+
}>>;
|
|
990
1011
|
readonly fields: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
991
1012
|
readonly id: Schema.NonEmptyString;
|
|
992
1013
|
readonly headerName: Schema.String;
|
|
@@ -1030,6 +1051,7 @@ export declare const dataTableOptions: {
|
|
|
1030
1051
|
readonly type: Schema.Literal<"number">;
|
|
1031
1052
|
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
1032
1053
|
readonly locale: Schema.optionalKey<Schema.String>;
|
|
1054
|
+
readonly format: Schema.optionalKey<Schema.Literal<"bytes">>;
|
|
1033
1055
|
readonly style: Schema.optionalKey<Schema.Literals<readonly ["decimal", "percent", "currency", "unit"]>>;
|
|
1034
1056
|
readonly currency: Schema.optionalKey<Schema.String>;
|
|
1035
1057
|
readonly unit: Schema.optionalKey<Schema.String>;
|
|
@@ -1054,6 +1076,10 @@ export declare const dataTableOptions: {
|
|
|
1054
1076
|
readonly emptyLabel: Schema.optionalKey<Schema.String>;
|
|
1055
1077
|
readonly nulls: Schema.optionalKey<Schema.Literals<readonly ["first", "last"]>>;
|
|
1056
1078
|
readonly type: Schema.Literal<"reference">;
|
|
1079
|
+
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
1080
|
+
readonly imageVariant: Schema.optionalKey<Schema.Literals<readonly ["circle", "square"]>>;
|
|
1081
|
+
readonly fallbackIcons: Schema.optionalKey<Schema.$Record<Schema.String, Schema.declare<<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">, <Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">>>>;
|
|
1082
|
+
}>>;
|
|
1057
1083
|
}>, Schema.Struct<{
|
|
1058
1084
|
readonly id: Schema.NonEmptyString;
|
|
1059
1085
|
readonly headerName: Schema.String;
|
|
@@ -1223,6 +1249,7 @@ export declare const dataTableOptions: {
|
|
|
1223
1249
|
readonly type: Schema.Literal<"number">;
|
|
1224
1250
|
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
1225
1251
|
readonly locale: Schema.optionalKey<Schema.String>;
|
|
1252
|
+
readonly format: Schema.optionalKey<Schema.Literal<"bytes">>;
|
|
1226
1253
|
readonly style: Schema.optionalKey<Schema.Literals<readonly ["decimal", "percent", "currency", "unit"]>>;
|
|
1227
1254
|
readonly currency: Schema.optionalKey<Schema.String>;
|
|
1228
1255
|
readonly unit: Schema.optionalKey<Schema.String>;
|
|
@@ -1247,6 +1274,10 @@ export declare const dataTableOptions: {
|
|
|
1247
1274
|
readonly emptyLabel: Schema.optionalKey<Schema.String>;
|
|
1248
1275
|
readonly nulls: Schema.optionalKey<Schema.Literals<readonly ["first", "last"]>>;
|
|
1249
1276
|
readonly type: Schema.Literal<"reference">;
|
|
1277
|
+
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
1278
|
+
readonly imageVariant: Schema.optionalKey<Schema.Literals<readonly ["circle", "square"]>>;
|
|
1279
|
+
readonly fallbackIcons: Schema.optionalKey<Schema.$Record<Schema.String, Schema.declare<<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">, <Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">>>>;
|
|
1280
|
+
}>>;
|
|
1250
1281
|
}>, Schema.Struct<{
|
|
1251
1282
|
readonly id: Schema.NonEmptyString;
|
|
1252
1283
|
readonly headerName: Schema.String;
|
|
@@ -1418,6 +1449,7 @@ export declare const dataTableOptions: {
|
|
|
1418
1449
|
readonly type: Schema.Literal<"number">;
|
|
1419
1450
|
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
1420
1451
|
readonly locale: Schema.optionalKey<Schema.String>;
|
|
1452
|
+
readonly format: Schema.optionalKey<Schema.Literal<"bytes">>;
|
|
1421
1453
|
readonly style: Schema.optionalKey<Schema.Literals<readonly ["decimal", "percent", "currency", "unit"]>>;
|
|
1422
1454
|
readonly currency: Schema.optionalKey<Schema.String>;
|
|
1423
1455
|
readonly unit: Schema.optionalKey<Schema.String>;
|
|
@@ -1442,6 +1474,10 @@ export declare const dataTableOptions: {
|
|
|
1442
1474
|
readonly emptyLabel: Schema.optionalKey<Schema.String>;
|
|
1443
1475
|
readonly nulls: Schema.optionalKey<Schema.Literals<readonly ["first", "last"]>>;
|
|
1444
1476
|
readonly type: Schema.Literal<"reference">;
|
|
1477
|
+
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
1478
|
+
readonly imageVariant: Schema.optionalKey<Schema.Literals<readonly ["circle", "square"]>>;
|
|
1479
|
+
readonly fallbackIcons: Schema.optionalKey<Schema.$Record<Schema.String, Schema.declare<<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">, <Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">>>>;
|
|
1480
|
+
}>>;
|
|
1445
1481
|
}>, Schema.Struct<{
|
|
1446
1482
|
readonly id: Schema.NonEmptyString;
|
|
1447
1483
|
readonly headerName: Schema.String;
|
|
@@ -1611,6 +1647,7 @@ export declare const dataTableOptions: {
|
|
|
1611
1647
|
readonly type: Schema.Literal<"number">;
|
|
1612
1648
|
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
1613
1649
|
readonly locale: Schema.optionalKey<Schema.String>;
|
|
1650
|
+
readonly format: Schema.optionalKey<Schema.Literal<"bytes">>;
|
|
1614
1651
|
readonly style: Schema.optionalKey<Schema.Literals<readonly ["decimal", "percent", "currency", "unit"]>>;
|
|
1615
1652
|
readonly currency: Schema.optionalKey<Schema.String>;
|
|
1616
1653
|
readonly unit: Schema.optionalKey<Schema.String>;
|
|
@@ -1635,6 +1672,10 @@ export declare const dataTableOptions: {
|
|
|
1635
1672
|
readonly emptyLabel: Schema.optionalKey<Schema.String>;
|
|
1636
1673
|
readonly nulls: Schema.optionalKey<Schema.Literals<readonly ["first", "last"]>>;
|
|
1637
1674
|
readonly type: Schema.Literal<"reference">;
|
|
1675
|
+
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
1676
|
+
readonly imageVariant: Schema.optionalKey<Schema.Literals<readonly ["circle", "square"]>>;
|
|
1677
|
+
readonly fallbackIcons: Schema.optionalKey<Schema.$Record<Schema.String, Schema.declare<<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">, <Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">>>>;
|
|
1678
|
+
}>>;
|
|
1638
1679
|
}>, Schema.Struct<{
|
|
1639
1680
|
readonly id: Schema.NonEmptyString;
|
|
1640
1681
|
readonly headerName: Schema.String;
|
|
@@ -1817,6 +1858,7 @@ export declare const dataTableOptions: {
|
|
|
1817
1858
|
readonly type: Schema.Literal<"number">;
|
|
1818
1859
|
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
1819
1860
|
readonly locale: Schema.optionalKey<Schema.String>;
|
|
1861
|
+
readonly format: Schema.optionalKey<Schema.Literal<"bytes">>;
|
|
1820
1862
|
readonly style: Schema.optionalKey<Schema.Literals<readonly ["decimal", "percent", "currency", "unit"]>>;
|
|
1821
1863
|
readonly currency: Schema.optionalKey<Schema.String>;
|
|
1822
1864
|
readonly unit: Schema.optionalKey<Schema.String>;
|
|
@@ -1841,6 +1883,10 @@ export declare const dataTableOptions: {
|
|
|
1841
1883
|
readonly emptyLabel: Schema.optionalKey<Schema.String>;
|
|
1842
1884
|
readonly nulls: Schema.optionalKey<Schema.Literals<readonly ["first", "last"]>>;
|
|
1843
1885
|
readonly type: Schema.Literal<"reference">;
|
|
1886
|
+
readonly typeOptions: Schema.optionalKey<Schema.Struct<{
|
|
1887
|
+
readonly imageVariant: Schema.optionalKey<Schema.Literals<readonly ["circle", "square"]>>;
|
|
1888
|
+
readonly fallbackIcons: Schema.optionalKey<Schema.$Record<Schema.String, Schema.declare<<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">, <Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">>>>;
|
|
1889
|
+
}>>;
|
|
1844
1890
|
}>, Schema.Struct<{
|
|
1845
1891
|
readonly id: Schema.NonEmptyString;
|
|
1846
1892
|
readonly headerName: Schema.String;
|
|
@@ -2592,6 +2638,7 @@ export declare const tableRowActions: (row: DataTableRow, siblings: readonly Dat
|
|
|
2592
2638
|
name: string;
|
|
2593
2639
|
variant?: "default" | "destructive" | undefined;
|
|
2594
2640
|
disabled?: boolean | undefined;
|
|
2641
|
+
icon?: (<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">) | undefined;
|
|
2595
2642
|
message: {
|
|
2596
2643
|
readonly _tag: "RowActionRequested";
|
|
2597
2644
|
readonly rowId: string;
|
|
@@ -2687,6 +2734,7 @@ export declare const dataTablePage: (props: DataTableProps, model: TableModel, l
|
|
|
2687
2734
|
readonly name: string;
|
|
2688
2735
|
readonly variant?: "default" | "destructive" | undefined;
|
|
2689
2736
|
readonly disabled?: boolean | undefined;
|
|
2737
|
+
readonly icon?: (<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">) | undefined;
|
|
2690
2738
|
}[] | undefined;
|
|
2691
2739
|
readonly primaryActionId?: string | undefined;
|
|
2692
2740
|
readonly groups?: {
|
|
@@ -2713,6 +2761,7 @@ export declare const dataTablePage: (props: DataTableProps, model: TableModel, l
|
|
|
2713
2761
|
readonly name: string;
|
|
2714
2762
|
readonly variant?: "default" | "destructive" | undefined;
|
|
2715
2763
|
readonly disabled?: boolean | undefined;
|
|
2764
|
+
readonly icon?: (<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">) | undefined;
|
|
2716
2765
|
}[] | undefined;
|
|
2717
2766
|
readonly primaryActionId?: string | undefined;
|
|
2718
2767
|
readonly groups?: {
|
|
@@ -2739,6 +2788,7 @@ export declare const dataTablePage: (props: DataTableProps, model: TableModel, l
|
|
|
2739
2788
|
readonly name: string;
|
|
2740
2789
|
readonly variant?: "default" | "destructive" | undefined;
|
|
2741
2790
|
readonly disabled?: boolean | undefined;
|
|
2791
|
+
readonly icon?: (<Msg>(h: import("effect/ui/html/Html").H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => import("effect/ui/html/Html").SvgElement<Msg, never, SVGSVGElement, "svg">) | undefined;
|
|
2742
2792
|
}[] | undefined;
|
|
2743
2793
|
readonly primaryActionId?: string | undefined;
|
|
2744
2794
|
readonly groups?: {
|
|
@@ -43,6 +43,7 @@ export interface DataTableReferenceItem {
|
|
|
43
43
|
/** Secondary text, such as a user's email or a record identifier. */
|
|
44
44
|
description?: string | null;
|
|
45
45
|
imageSrc?: string | null;
|
|
46
|
+
fallbackIcon?: ReactNode;
|
|
46
47
|
}
|
|
47
48
|
export interface DataTableReferenceOptions<TData> {
|
|
48
49
|
getItem: (row: TData) => DataTableReferenceItem | null | undefined;
|
|
@@ -635,6 +635,7 @@ var tableClasses = {
|
|
|
635
635
|
actionTrigger: `size-8 ${cellTriggerFocus}`,
|
|
636
636
|
actionsCell: "sticky right-0 z-20 w-10 min-w-10 cursor-default bg-background p-0 transition-colors group-hover/row:bg-[color-mix(in_oklab,var(--muted)_50%,var(--background))]",
|
|
637
637
|
actionsAlign: "flex min-h-12 items-center justify-end pe-1",
|
|
638
|
+
row: "h-16 [&:where(:not(:last-child))>td]:border-b",
|
|
638
639
|
header: "relative h-12 p-0",
|
|
639
640
|
stickyHeader: "sticky top-0 z-30 bg-background",
|
|
640
641
|
stickyHeaderRule: "after:border-border after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:border-b",
|
|
@@ -707,6 +708,7 @@ var DataTableItemSchema = Schema4.Struct({
|
|
|
707
708
|
value: Schema4.NonEmptyString,
|
|
708
709
|
label: Schema4.String
|
|
709
710
|
}).annotate({ identifier: "DataTableItem" });
|
|
711
|
+
var TableIconSchema = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableIcon" });
|
|
710
712
|
var DataTableReferenceSchema = Schema4.Struct({
|
|
711
713
|
label: Schema4.String,
|
|
712
714
|
description: Schema4.optionalKey(Schema4.String),
|
|
@@ -746,11 +748,15 @@ var DataTableActionSchema = Schema4.Struct({
|
|
|
746
748
|
variant: Schema4.optionalKey(Schema4.Literals(["default", "destructive"])),
|
|
747
749
|
disabled: Schema4.optionalKey(Schema4.Boolean)
|
|
748
750
|
}).annotate({ identifier: "DataTableAction" });
|
|
751
|
+
var DataTableRowActionSchema = Schema4.Struct({
|
|
752
|
+
...DataTableActionSchema.fields,
|
|
753
|
+
icon: Schema4.optionalKey(TableIconSchema)
|
|
754
|
+
}).annotate({ identifier: "DataTableRowAction" });
|
|
749
755
|
var DataTableRowSchema = Schema4.Struct({
|
|
750
756
|
id: Schema4.NonEmptyString,
|
|
751
757
|
label: Schema4.String,
|
|
752
758
|
cells: Schema4.Record(Schema4.String, DataTableCellValueSchema),
|
|
753
|
-
actions: Schema4.optionalKey(Schema4.Array(
|
|
759
|
+
actions: Schema4.optionalKey(Schema4.Array(DataTableRowActionSchema)),
|
|
754
760
|
primaryActionId: Schema4.optionalKey(Schema4.String),
|
|
755
761
|
groups: Schema4.optionalKey(Schema4.Record(Schema4.String, Schema4.Array(Schema4.String))),
|
|
756
762
|
selectable: Schema4.optionalKey(Schema4.Boolean),
|
|
@@ -785,11 +791,10 @@ var DataTableBadgeOptionSchema = Schema4.Struct({
|
|
|
785
791
|
"muted"
|
|
786
792
|
]))
|
|
787
793
|
}).annotate({ identifier: "DataTableBadgeOption" });
|
|
788
|
-
var BadgeIcon = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableBadgeIcon" });
|
|
789
794
|
var DataTableBadgeOptionsSchema = Schema4.Struct({
|
|
790
795
|
options: Schema4.optionalKey(Schema4.Array(DataTableBadgeOptionSchema.mapFields((fields) => ({
|
|
791
796
|
...fields,
|
|
792
|
-
icon: Schema4.optionalKey(
|
|
797
|
+
icon: Schema4.optionalKey(TableIconSchema)
|
|
793
798
|
}))))
|
|
794
799
|
}).annotate({ identifier: "DataTableBadgeOptions" });
|
|
795
800
|
var DataTableFieldSchema = Schema4.Union([
|
|
@@ -804,6 +809,7 @@ var DataTableFieldSchema = Schema4.Union([
|
|
|
804
809
|
type: Schema4.Literal("number"),
|
|
805
810
|
typeOptions: Schema4.optionalKey(Schema4.Struct({
|
|
806
811
|
locale: Schema4.optionalKey(Schema4.String),
|
|
812
|
+
format: Schema4.optionalKey(Schema4.Literal("bytes")),
|
|
807
813
|
style: Schema4.optionalKey(Schema4.Literals(["decimal", "percent", "currency", "unit"])),
|
|
808
814
|
currency: Schema4.optionalKey(Schema4.String),
|
|
809
815
|
unit: Schema4.optionalKey(Schema4.String),
|
|
@@ -813,7 +819,14 @@ var DataTableFieldSchema = Schema4.Union([
|
|
|
813
819
|
exportFormat: Schema4.optionalKey(Schema4.Literals(["raw", "formatted"]))
|
|
814
820
|
}).annotate({ identifier: "DataTableNumberFormat" }))
|
|
815
821
|
}),
|
|
816
|
-
Schema4.Struct({
|
|
822
|
+
Schema4.Struct({
|
|
823
|
+
...column,
|
|
824
|
+
type: Schema4.Literal("reference"),
|
|
825
|
+
typeOptions: Schema4.optionalKey(Schema4.Struct({
|
|
826
|
+
imageVariant: Schema4.optionalKey(Schema4.Literals(["circle", "square"])),
|
|
827
|
+
fallbackIcons: Schema4.optionalKey(Schema4.Record(Schema4.String, TableIconSchema))
|
|
828
|
+
}).annotate({ identifier: "DataTableReferenceOptions" }))
|
|
829
|
+
}),
|
|
817
830
|
Schema4.Struct({
|
|
818
831
|
...column,
|
|
819
832
|
type: Schema4.Literal("date"),
|
|
@@ -1092,9 +1105,17 @@ var isTableBoolean = Schema5.is(Schema5.Boolean);
|
|
|
1092
1105
|
var isTableReference = Schema5.is(DataTableReferenceSchema);
|
|
1093
1106
|
var isTableList = Schema5.is(Schema5.Array(DataTableItemSchema));
|
|
1094
1107
|
var tableInitials = (label) => label.trim().split(/\s+/).slice(0, 2).map((word) => word.slice(0, 1)).join("").toLocaleUpperCase();
|
|
1108
|
+
var formatBytes = (bytes, locale) => {
|
|
1109
|
+
const [unit, scale] = bytes >= 1024 ** 2 ? ["megabyte", 1024 ** 2] : bytes >= 1024 ? ["kilobyte", 1024] : ["byte", 1];
|
|
1110
|
+
return new Intl.NumberFormat(locale, {
|
|
1111
|
+
style: "unit",
|
|
1112
|
+
unit,
|
|
1113
|
+
maximumFractionDigits: 1
|
|
1114
|
+
}).format(bytes / scale);
|
|
1115
|
+
};
|
|
1095
1116
|
var formatNumberValue = (value, options, defaultLocale = "en") => {
|
|
1096
|
-
const { locale,
|
|
1097
|
-
return new Intl.NumberFormat(locale ?? defaultLocale,
|
|
1117
|
+
const { locale, format, ...intlOptions } = options ?? {};
|
|
1118
|
+
return format === "bytes" ? formatBytes(value, locale ?? defaultLocale) : new Intl.NumberFormat(locale ?? defaultLocale, intlOptions).format(value);
|
|
1098
1119
|
};
|
|
1099
1120
|
var tableBooleanLabel = (value, options) => (value ? options?.trueLabel : options?.falseLabel) ?? String(value);
|
|
1100
1121
|
var decodeDateInput = Schema5.decodeUnknownOption(DataTableDateInputSchema);
|
|
@@ -2027,6 +2048,7 @@ var DataTableReferenceCell = ({
|
|
|
2027
2048
|
if (!item)
|
|
2028
2049
|
return emptyLabel;
|
|
2029
2050
|
const initials = tableInitials(item.label);
|
|
2051
|
+
const image = item.imageSrc && item.imageSrc !== failedImage ? item.imageSrc : undefined;
|
|
2030
2052
|
return /* @__PURE__ */ jsxs3("div", {
|
|
2031
2053
|
className: tableClasses.reference,
|
|
2032
2054
|
children: [
|
|
@@ -2036,14 +2058,16 @@ var DataTableReferenceCell = ({
|
|
|
2036
2058
|
"aria-hidden": "true",
|
|
2037
2059
|
className: "[&_svg]:size-4",
|
|
2038
2060
|
children: item.icon
|
|
2039
|
-
}) :
|
|
2040
|
-
src:
|
|
2041
|
-
alt: item.label,
|
|
2061
|
+
}) : image ? /* @__PURE__ */ jsx3("img", {
|
|
2062
|
+
src: image,
|
|
2063
|
+
alt: item.fallbackIcon ? "" : item.label,
|
|
2064
|
+
loading: "lazy",
|
|
2042
2065
|
className: "size-full object-cover",
|
|
2043
|
-
onError: () => setFailedImage(
|
|
2066
|
+
onError: () => setFailedImage(image)
|
|
2044
2067
|
}) : /* @__PURE__ */ jsx3("span", {
|
|
2045
2068
|
"aria-hidden": "true",
|
|
2046
|
-
|
|
2069
|
+
className: "[&_svg]:size-4",
|
|
2070
|
+
children: item.fallbackIcon ?? initials
|
|
2047
2071
|
})
|
|
2048
2072
|
}),
|
|
2049
2073
|
/* @__PURE__ */ jsxs3("div", {
|
|
@@ -3585,7 +3609,7 @@ var TableDataRow = ({
|
|
|
3585
3609
|
ref: measureRef,
|
|
3586
3610
|
"data-index": virtualIndex,
|
|
3587
3611
|
"aria-rowindex": virtualIndex === undefined ? undefined : virtualIndex + 2,
|
|
3588
|
-
className: cn("group/row data-[drop-position=before]:[&>td]:border-primary data-[drop-position=after]:[&>td]:border-primary
|
|
3612
|
+
className: cn("group/row data-[drop-position=before]:[&>td]:border-primary data-[drop-position=after]:[&>td]:border-primary data-[drag-source=true]:opacity-40 data-[drop-position=after]:[&>td]:border-b-2 data-[drop-position=before]:[&>td]:border-t-2", tableClasses.row, store.config.onRowClicked && "cursor-pointer"),
|
|
3589
3613
|
"data-state": store.state.rowSelection[row.id] && "selected",
|
|
3590
3614
|
"data-table-row": row.id,
|
|
3591
3615
|
onClick: () => store.config.onRowClicked?.(row.data),
|