@ai-matrx/records-ui 0.93.85 → 0.93.87
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 +10 -0
- package/dist/index.cjs +14 -9
- 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 +14 -9
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
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" | "member" | "text" | "long_text" | "currency" | "percent" | "datetime" | "email" | "url" | "phone" | "attachment";
|
|
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" | "member" | "text" | "long_text" | "currency" | "percent" | "datetime" | "email" | "url" | "phone" | "attachment";
|
|
2324
2324
|
label: string;
|
|
2325
2325
|
}[];
|
|
2326
2326
|
/**
|
package/dist/index.js
CHANGED
|
@@ -31517,14 +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 };
|
|
31521
|
+
var SLOT_MIN = 36;
|
|
31521
31522
|
function toolbarFold(input) {
|
|
31522
31523
|
const { available, needsNow, gap, folded } = input;
|
|
31523
31524
|
const pieces = [
|
|
31524
31525
|
{ piece: input.look, stage: 1, guess: FOLDED_GUESS.look },
|
|
31525
31526
|
{ piece: input.chooser, stage: 2, guess: FOLDED_GUESS.chooser },
|
|
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
|
+
...input.tools ? [{ piece: input.tools, stage: 3, guess: FOLDED_GUESS.tools }] : []
|
|
31528
31528
|
];
|
|
31529
31529
|
const widthAt = ({ piece, stage, guess }, fold) => {
|
|
31530
31530
|
if (piece.now === 0 && piece.full === null) return 0;
|
|
@@ -31532,13 +31532,18 @@ function toolbarFold(input) {
|
|
|
31532
31532
|
return piece.full ?? piece.now;
|
|
31533
31533
|
};
|
|
31534
31534
|
const withGap = (width) => width > 0 ? width + gap : 0;
|
|
31535
|
-
const
|
|
31536
|
-
const
|
|
31537
|
-
const
|
|
31535
|
+
const shareNow = input.share ? withGap(input.share.now) : 0;
|
|
31536
|
+
const base = pieces.reduce((rest, p) => rest - withGap(p.piece.now), needsNow - shareNow);
|
|
31537
|
+
const stages = input.tools ? [0, 1, 2, 3] : [0, 1, 2];
|
|
31538
|
+
const shareOn = input.share ? withGap(input.share.full ?? input.share.now) : 0;
|
|
31539
|
+
const needs = stages.map((fold) => pieces.reduce((sum, p) => sum + withGap(widthAt(p, fold)), base + shareOn));
|
|
31538
31540
|
const fits = needs.findIndex((need) => need <= available + 0.5);
|
|
31539
31541
|
if (fits >= 0) return stages[fits];
|
|
31540
31542
|
const least = Math.min(...needs);
|
|
31541
|
-
|
|
31543
|
+
const most = stages[needs.findIndex((need) => need <= least + 0.5)];
|
|
31544
|
+
if (!input.tools || !input.share) return most;
|
|
31545
|
+
const fixed = pieces.reduce((sum, p) => sum + withGap(p.stage === 3 ? SLOT_MIN : widthAt(p, 3)), base + shareOn);
|
|
31546
|
+
return fixed > available + 0.5 ? 4 : most;
|
|
31542
31547
|
}
|
|
31543
31548
|
function naturalWidth(el) {
|
|
31544
31549
|
const html = el;
|
|
@@ -31561,7 +31566,7 @@ function rowNeeds(row) {
|
|
|
31561
31566
|
const innerStyle = typeof getComputedStyle === "undefined" ? null : getComputedStyle(piece);
|
|
31562
31567
|
const innerGap = innerStyle ? parseFloat(innerStyle.columnGap || "0") || 0 : 0;
|
|
31563
31568
|
needs += inner.reduce((sum, c) => sum + naturalWidth(c), 0) + innerGap * Math.max(0, inner.length - 1);
|
|
31564
|
-
} else {
|
|
31569
|
+
} else if (!piece.hasAttribute("data-toolbar-fit-gives")) {
|
|
31565
31570
|
needs += naturalWidth(piece);
|
|
31566
31571
|
}
|
|
31567
31572
|
}
|
|
@@ -32433,7 +32438,7 @@ function TablePage({
|
|
|
32433
32438
|
] }) }) : !lookShowing && main === "records" && view && !phone && !controlsInSheet ? (
|
|
32434
32439
|
/* The reserved place gives way first when the row is narrow (a chat artifact, the
|
|
32435
32440
|
smallest window): it holds nothing, so it shrinks before a real control is cut. */
|
|
32436
|
-
/* @__PURE__ */ jsx105("span", { "aria-hidden": "true", className: "invisible flex min-w-0 shrink items-center overflow-hidden", "data-view-look-place": "", children: /* @__PURE__ */ jsxs95(Button80, { size: "sm", variant: "outline", className: "h-8 gap-1.5 px-2 text-xs", tabIndex: -1, children: [
|
|
32441
|
+
/* @__PURE__ */ jsx105("span", { "aria-hidden": "true", className: "invisible flex min-w-0 shrink items-center overflow-hidden", "data-view-look-place": "", "data-toolbar-fit-gives": "", children: /* @__PURE__ */ jsxs95(Button80, { size: "sm", variant: "outline", className: "h-8 gap-1.5 px-2 text-xs", tabIndex: -1, children: [
|
|
32437
32442
|
/* @__PURE__ */ jsx105("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full" }),
|
|
32438
32443
|
LOOK_WORDS.folded
|
|
32439
32444
|
] }) })
|