@ai-matrx/records-ui 0.93.84 → 0.93.85
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 +5 -0
- package/dist/index.cjs +18 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2320,7 +2320,7 @@ interface CustomFieldsAgentDoor {
|
|
|
2320
2320
|
setValues: (values: CustomFieldValuesRequest) => Promise<CustomFieldSetResult>;
|
|
2321
2321
|
}
|
|
2322
2322
|
declare const ADDABLE_TYPES: {
|
|
2323
|
-
value: "number" | "
|
|
2323
|
+
value: "number" | "attachment" | "currency" | "datetime" | "email" | "text" | "member" | "percent" | "phone" | "url" | "long_text";
|
|
2324
2324
|
label: string;
|
|
2325
2325
|
}[];
|
|
2326
2326
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -2320,7 +2320,7 @@ interface CustomFieldsAgentDoor {
|
|
|
2320
2320
|
setValues: (values: CustomFieldValuesRequest) => Promise<CustomFieldSetResult>;
|
|
2321
2321
|
}
|
|
2322
2322
|
declare const ADDABLE_TYPES: {
|
|
2323
|
-
value: "number" | "
|
|
2323
|
+
value: "number" | "attachment" | "currency" | "datetime" | "email" | "text" | "member" | "percent" | "phone" | "url" | "long_text";
|
|
2324
2324
|
label: string;
|
|
2325
2325
|
}[];
|
|
2326
2326
|
/**
|
package/dist/index.js
CHANGED
|
@@ -31517,13 +31517,14 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
31517
31517
|
|
|
31518
31518
|
// src/toolbarFit.ts
|
|
31519
31519
|
import { useEffect as useEffect81, useState as useState93 } from "react";
|
|
31520
|
-
var FOLDED_GUESS = { look: 104, chooser: 96, tools: 120 };
|
|
31520
|
+
var FOLDED_GUESS = { look: 104, chooser: 96, tools: 120, share: 0 };
|
|
31521
31521
|
function toolbarFold(input) {
|
|
31522
31522
|
const { available, needsNow, gap, folded } = input;
|
|
31523
31523
|
const pieces = [
|
|
31524
31524
|
{ piece: input.look, stage: 1, guess: FOLDED_GUESS.look },
|
|
31525
31525
|
{ piece: input.chooser, stage: 2, guess: FOLDED_GUESS.chooser },
|
|
31526
|
-
...input.tools ? [{ piece: input.tools, stage: 3, guess: FOLDED_GUESS.tools }] : []
|
|
31526
|
+
...input.tools ? [{ piece: input.tools, stage: 3, guess: FOLDED_GUESS.tools }] : [],
|
|
31527
|
+
...input.tools && input.share ? [{ piece: input.share, stage: 4, guess: FOLDED_GUESS.share }] : []
|
|
31527
31528
|
];
|
|
31528
31529
|
const widthAt = ({ piece, stage, guess }, fold) => {
|
|
31529
31530
|
if (piece.now === 0 && piece.full === null) return 0;
|
|
@@ -31532,7 +31533,7 @@ function toolbarFold(input) {
|
|
|
31532
31533
|
};
|
|
31533
31534
|
const withGap = (width) => width > 0 ? width + gap : 0;
|
|
31534
31535
|
const base = pieces.reduce((rest, p) => rest - withGap(p.piece.now), needsNow);
|
|
31535
|
-
const stages = input.tools ? [0, 1, 2, 3] : [0, 1, 2];
|
|
31536
|
+
const stages = input.tools ? input.share ? [0, 1, 2, 3, 4] : [0, 1, 2, 3] : [0, 1, 2];
|
|
31536
31537
|
const needs = stages.map((fold) => pieces.reduce((sum, p) => sum + withGap(widthAt(p, fold)), base));
|
|
31537
31538
|
const fits = needs.findIndex((need) => need <= available + 0.5);
|
|
31538
31539
|
if (fits >= 0) return stages[fits];
|
|
@@ -31573,9 +31574,10 @@ function useToolbarFit(row) {
|
|
|
31573
31574
|
const widths = {
|
|
31574
31575
|
look: { full: null, folded: null },
|
|
31575
31576
|
chooser: { full: null, folded: null },
|
|
31576
|
-
tools: { full: null, folded: null }
|
|
31577
|
+
tools: { full: null, folded: null },
|
|
31578
|
+
share: { full: null, folded: null }
|
|
31577
31579
|
};
|
|
31578
|
-
const stageOf = { look: 1, chooser: 2, tools: 3 };
|
|
31580
|
+
const stageOf = { look: 1, chooser: 2, tools: 3, share: 4 };
|
|
31579
31581
|
let current = 0;
|
|
31580
31582
|
let pending = 0;
|
|
31581
31583
|
let stopped = false;
|
|
@@ -31585,7 +31587,7 @@ function useToolbarFit(row) {
|
|
|
31585
31587
|
const available = row.clientWidth;
|
|
31586
31588
|
if (available <= 0) return;
|
|
31587
31589
|
const read = (name) => {
|
|
31588
|
-
const el = name === "tools" ? row.querySelector(":scope > [data-toolbar-fit-slot]") : row.querySelector(`:scope > [data-toolbar-fit="${name}"]`);
|
|
31590
|
+
const el = name === "tools" ? row.querySelector(":scope > [data-toolbar-fit-slot]") : name === "share" ? row.querySelector('[data-toolbar-fit="share"]') : row.querySelector(`:scope > [data-toolbar-fit="${name}"]`);
|
|
31589
31591
|
const now = !el ? 0 : name === "tools" ? slotNeeds(el) : naturalWidth(el);
|
|
31590
31592
|
const w = widths[name];
|
|
31591
31593
|
if (el && now > 0) {
|
|
@@ -31598,8 +31600,11 @@ function useToolbarFit(row) {
|
|
|
31598
31600
|
const look = read("look");
|
|
31599
31601
|
const chooser = read("chooser");
|
|
31600
31602
|
const tools = read("tools");
|
|
31603
|
+
const shareEl = row.querySelector('[data-toolbar-fit="share"]');
|
|
31604
|
+
const shareRead = shareEl ? read("share") : null;
|
|
31605
|
+
const share = shareRead && (shareRead.now > 0 || shareRead.full !== null) ? shareRead : void 0;
|
|
31601
31606
|
const { needs, gap } = rowNeeds(row);
|
|
31602
|
-
const next = toolbarFold({ available, needsNow: needs, gap, folded: current, look, chooser, tools });
|
|
31607
|
+
const next = toolbarFold({ available, needsNow: needs, gap, folded: current, look, chooser, tools, share });
|
|
31603
31608
|
if (next !== current) {
|
|
31604
31609
|
current = next;
|
|
31605
31610
|
setFold(next);
|
|
@@ -32016,6 +32021,7 @@ function TablePage({
|
|
|
32016
32021
|
const chooserInline = !designated && !phone && toolbarFold2 < 2;
|
|
32017
32022
|
const chooserCompact = !designated && !phone && toolbarFold2 >= 2;
|
|
32018
32023
|
const controlsInSheet = phone && !designated;
|
|
32024
|
+
const shareInMenu = phone || toolbarFold2 >= 4;
|
|
32019
32025
|
useEffect82(() => {
|
|
32020
32026
|
if (face.kind !== "designated") return;
|
|
32021
32027
|
if (hostFromLink || opened.layout || layoutChosen) return;
|
|
@@ -32240,7 +32246,7 @@ function TablePage({
|
|
|
32240
32246
|
rights.share && canShare ? /* @__PURE__ */ jsx105(Button80, { size: "sm", variant: "ghost", className: "h-8", onClick: () => setShareAsked((n) => n + 1), "data-table-sheet-share": "", children: "Share\u2026" }) : null
|
|
32241
32247
|
] }) : void 0;
|
|
32242
32248
|
const pageActions = /* @__PURE__ */ jsxs95(Fragment44, { children: [
|
|
32243
|
-
organizationId ? /* @__PURE__ */ jsx105(
|
|
32249
|
+
organizationId ? /* @__PURE__ */ jsx105("span", { className: shareInMenu ? "hidden" : "flex shrink-0 items-center", "data-toolbar-fit": "share", children: /* @__PURE__ */ jsx105(
|
|
32244
32250
|
ShareControl,
|
|
32245
32251
|
{
|
|
32246
32252
|
kind: "table",
|
|
@@ -32250,10 +32256,10 @@ function TablePage({
|
|
|
32250
32256
|
may: rights.share,
|
|
32251
32257
|
whyNot: rights.read ? rights.why("share") : void 0,
|
|
32252
32258
|
initiallyOpen: shareFromLink || shareAsked > 0,
|
|
32253
|
-
...
|
|
32259
|
+
...shareInMenu ? { className: "hidden" } : {}
|
|
32254
32260
|
},
|
|
32255
|
-
|
|
32256
|
-
) : null,
|
|
32261
|
+
shareInMenu ? `share-${shareAsked}` : "share"
|
|
32262
|
+
) }, "share") : null,
|
|
32257
32263
|
/* @__PURE__ */ jsxs95(DropdownMenu5, { children: [
|
|
32258
32264
|
/* @__PURE__ */ jsx105(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsx105(Button80, { size: "sm", variant: "ghost", "aria-label": "Table menu", title: "Table menu", "data-table-menu": "", children: /* @__PURE__ */ jsxs95("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "currentColor", "aria-hidden": "true", children: [
|
|
32259
32265
|
/* @__PURE__ */ jsx105("circle", { cx: "5", cy: "12", r: "1.75" }),
|
|
@@ -32276,7 +32282,7 @@ function TablePage({
|
|
|
32276
32282
|
},
|
|
32277
32283
|
entry.key
|
|
32278
32284
|
)),
|
|
32279
|
-
|
|
32285
|
+
shareInMenu && rights.share && canShare ? /* @__PURE__ */ jsxs95(Fragment44, { children: [
|
|
32280
32286
|
/* @__PURE__ */ jsx105(DropdownMenuSeparator4, {}),
|
|
32281
32287
|
/* @__PURE__ */ jsx105(DropdownMenuItem5, { onSelect: () => setShareAsked((n) => n + 1), "data-table-menu-share": "", children: "Share\u2026" })
|
|
32282
32288
|
] }) : null,
|