@universe-platform/ui 0.1.0-beta.62 → 0.1.0-beta.64

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/globals.css CHANGED
@@ -772,6 +772,9 @@
772
772
  .max-w-4xl {
773
773
  max-width: var(--container-4xl);
774
774
  }
775
+ .max-w-\[10rem\] {
776
+ max-width: 10rem;
777
+ }
775
778
  .max-w-\[70\%\] {
776
779
  max-width: 70%;
777
780
  }
package/dist/index.js CHANGED
@@ -3947,7 +3947,9 @@ var FormulaDisplay = ({ value, column }) => {
3947
3947
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SmartTextCell, { value: text2, tooltipText: text2, readOnly: true });
3948
3948
  };
3949
3949
  var FormulaInputRenderer = ({ value, column, context }) => {
3950
- const live = (context == null ? void 0 : context.rowData) ? computeFormulaValue(column, context.rowData) : value;
3950
+ var _a, _b, _c, _d;
3951
+ const hasExternalRefs = ((_d = (_c = (_b = (_a = column == null ? void 0 : column.config) == null ? void 0 : _a.formula) == null ? void 0 : _b.externalRefs) == null ? void 0 : _c.length) != null ? _d : 0) > 0;
3952
+ const live = (context == null ? void 0 : context.rowData) && !hasExternalRefs ? computeFormulaValue(column, context.rowData) : value;
3951
3953
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FormulaDisplay, { value: live, column });
3952
3954
  };
3953
3955
 
@@ -6243,51 +6245,61 @@ var import_jsx_runtime14 = require("react/jsx-runtime");
6243
6245
  function RelationButtonsView({ groups, onSelect, disabled, stacked = false }) {
6244
6246
  const visible = groups.filter((g) => g.options.length > 0);
6245
6247
  if (visible.length === 0) return null;
6246
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `grid grid-cols-1 gap-2.5 ${stacked ? "" : "md:grid-cols-2"}`, children: visible.map((group) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
6247
- "div",
6248
- {
6249
- className: "bg-white border border-slate-200 rounded-xl p-3 flex flex-col gap-2.5 shadow-2xs",
6250
- children: [
6251
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center justify-between gap-2 pb-2 border-b border-slate-100", children: [
6252
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-xs font-bold text-slate-800 truncate", title: group.title, children: group.title }),
6248
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `grid grid-cols-1 gap-2.5 ${stacked ? "" : "md:grid-cols-2"}`, children: visible.map((group) => {
6249
+ const titleIsDuplicate = group.options.some(
6250
+ (opt) => opt.label.trim() === group.title.trim()
6251
+ );
6252
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6253
+ "div",
6254
+ {
6255
+ className: "bg-white border border-slate-200 rounded-xl px-3 py-2.5 shadow-2xs",
6256
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-wrap items-end gap-x-2 gap-y-2.5", children: [
6257
+ !titleIsDuplicate && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6258
+ "span",
6259
+ {
6260
+ className: "self-end h-8 inline-flex items-center text-xs font-bold text-slate-800 max-w-[10rem] truncate",
6261
+ title: group.title,
6262
+ children: group.title
6263
+ }
6264
+ ),
6265
+ group.options.map((opt) => {
6266
+ const active = group.activeId === opt.id;
6267
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col items-center gap-0.5", children: [
6268
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6269
+ "span",
6270
+ {
6271
+ className: `text-[11px] font-bold leading-none ${active ? "text-indigo-700" : "text-slate-500"}`,
6272
+ children: opt.count
6273
+ }
6274
+ ),
6275
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6276
+ "button",
6277
+ {
6278
+ type: "button",
6279
+ disabled,
6280
+ onClick: () => onSelect(group.key, active ? void 0 : opt.id),
6281
+ title: active ? "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D9\u05D8\u05D5\u05DC \u05D4\u05E1\u05D9\u05E0\u05D5\u05DF" : `\u05E1\u05E0\u05DF \u05DC\u05E4\u05D9: ${opt.label}`,
6282
+ "aria-pressed": active,
6283
+ className: `px-3 h-8 rounded-md border text-xs font-semibold whitespace-nowrap shadow-2xs transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none ${active ? "bg-indigo-600 border-indigo-600 text-white hover:bg-indigo-700" : "bg-white border-slate-300 text-slate-700 hover:bg-slate-50 hover:border-slate-400"}`,
6284
+ children: opt.label
6285
+ }
6286
+ )
6287
+ ] }, opt.id);
6288
+ }),
6253
6289
  group.activeId ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6254
6290
  "button",
6255
6291
  {
6256
6292
  type: "button",
6257
6293
  onClick: () => onSelect(group.key, void 0),
6258
- className: "text-[11px] font-semibold text-rose-600 hover:text-rose-700 hover:underline cursor-pointer shrink-0",
6294
+ className: "self-end h-8 inline-flex items-center px-1 text-[11px] font-semibold text-rose-600 hover:text-rose-700 hover:underline cursor-pointer shrink-0 whitespace-nowrap",
6259
6295
  children: "\u05E0\u05E7\u05D4 \u05E1\u05D9\u05E0\u05D5\u05DF"
6260
6296
  }
6261
6297
  ) : null
6262
- ] }),
6263
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-wrap items-end gap-x-2 gap-y-2.5", children: group.options.map((opt) => {
6264
- const active = group.activeId === opt.id;
6265
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col items-center gap-0.5", children: [
6266
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6267
- "span",
6268
- {
6269
- className: `text-[11px] font-bold leading-none ${active ? "text-indigo-700" : "text-slate-500"}`,
6270
- children: opt.count
6271
- }
6272
- ),
6273
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6274
- "button",
6275
- {
6276
- type: "button",
6277
- disabled,
6278
- onClick: () => onSelect(group.key, active ? void 0 : opt.id),
6279
- title: active ? "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D9\u05D8\u05D5\u05DC \u05D4\u05E1\u05D9\u05E0\u05D5\u05DF" : `\u05E1\u05E0\u05DF \u05DC\u05E4\u05D9: ${opt.label}`,
6280
- "aria-pressed": active,
6281
- className: `px-3 h-8 rounded-md border text-xs font-semibold whitespace-nowrap shadow-2xs transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none ${active ? "bg-indigo-600 border-indigo-600 text-white hover:bg-indigo-700" : "bg-white border-slate-300 text-slate-700 hover:bg-slate-50 hover:border-slate-400"}`,
6282
- children: opt.label
6283
- }
6284
- )
6285
- ] }, opt.id);
6286
- }) })
6287
- ]
6288
- },
6289
- group.key
6290
- )) });
6298
+ ] })
6299
+ },
6300
+ group.key
6301
+ );
6302
+ }) });
6291
6303
  }
6292
6304
 
6293
6305
  // src/components/TableBlock/RelationButtonsBar.tsx
package/dist/index.mjs CHANGED
@@ -3792,7 +3792,9 @@ var FormulaDisplay = ({ value, column }) => {
3792
3792
  return /* @__PURE__ */ jsx8(SmartTextCell, { value: text2, tooltipText: text2, readOnly: true });
3793
3793
  };
3794
3794
  var FormulaInputRenderer = ({ value, column, context }) => {
3795
- const live = (context == null ? void 0 : context.rowData) ? computeFormulaValue(column, context.rowData) : value;
3795
+ var _a, _b, _c, _d;
3796
+ const hasExternalRefs = ((_d = (_c = (_b = (_a = column == null ? void 0 : column.config) == null ? void 0 : _a.formula) == null ? void 0 : _b.externalRefs) == null ? void 0 : _c.length) != null ? _d : 0) > 0;
3797
+ const live = (context == null ? void 0 : context.rowData) && !hasExternalRefs ? computeFormulaValue(column, context.rowData) : value;
3796
3798
  return /* @__PURE__ */ jsx8(FormulaDisplay, { value: live, column });
3797
3799
  };
3798
3800
 
@@ -6088,51 +6090,61 @@ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
6088
6090
  function RelationButtonsView({ groups, onSelect, disabled, stacked = false }) {
6089
6091
  const visible = groups.filter((g) => g.options.length > 0);
6090
6092
  if (visible.length === 0) return null;
6091
- return /* @__PURE__ */ jsx14("div", { className: `grid grid-cols-1 gap-2.5 ${stacked ? "" : "md:grid-cols-2"}`, children: visible.map((group) => /* @__PURE__ */ jsxs12(
6092
- "div",
6093
- {
6094
- className: "bg-white border border-slate-200 rounded-xl p-3 flex flex-col gap-2.5 shadow-2xs",
6095
- children: [
6096
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between gap-2 pb-2 border-b border-slate-100", children: [
6097
- /* @__PURE__ */ jsx14("span", { className: "text-xs font-bold text-slate-800 truncate", title: group.title, children: group.title }),
6093
+ return /* @__PURE__ */ jsx14("div", { className: `grid grid-cols-1 gap-2.5 ${stacked ? "" : "md:grid-cols-2"}`, children: visible.map((group) => {
6094
+ const titleIsDuplicate = group.options.some(
6095
+ (opt) => opt.label.trim() === group.title.trim()
6096
+ );
6097
+ return /* @__PURE__ */ jsx14(
6098
+ "div",
6099
+ {
6100
+ className: "bg-white border border-slate-200 rounded-xl px-3 py-2.5 shadow-2xs",
6101
+ children: /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-end gap-x-2 gap-y-2.5", children: [
6102
+ !titleIsDuplicate && /* @__PURE__ */ jsx14(
6103
+ "span",
6104
+ {
6105
+ className: "self-end h-8 inline-flex items-center text-xs font-bold text-slate-800 max-w-[10rem] truncate",
6106
+ title: group.title,
6107
+ children: group.title
6108
+ }
6109
+ ),
6110
+ group.options.map((opt) => {
6111
+ const active = group.activeId === opt.id;
6112
+ return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-center gap-0.5", children: [
6113
+ /* @__PURE__ */ jsx14(
6114
+ "span",
6115
+ {
6116
+ className: `text-[11px] font-bold leading-none ${active ? "text-indigo-700" : "text-slate-500"}`,
6117
+ children: opt.count
6118
+ }
6119
+ ),
6120
+ /* @__PURE__ */ jsx14(
6121
+ "button",
6122
+ {
6123
+ type: "button",
6124
+ disabled,
6125
+ onClick: () => onSelect(group.key, active ? void 0 : opt.id),
6126
+ title: active ? "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D9\u05D8\u05D5\u05DC \u05D4\u05E1\u05D9\u05E0\u05D5\u05DF" : `\u05E1\u05E0\u05DF \u05DC\u05E4\u05D9: ${opt.label}`,
6127
+ "aria-pressed": active,
6128
+ className: `px-3 h-8 rounded-md border text-xs font-semibold whitespace-nowrap shadow-2xs transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none ${active ? "bg-indigo-600 border-indigo-600 text-white hover:bg-indigo-700" : "bg-white border-slate-300 text-slate-700 hover:bg-slate-50 hover:border-slate-400"}`,
6129
+ children: opt.label
6130
+ }
6131
+ )
6132
+ ] }, opt.id);
6133
+ }),
6098
6134
  group.activeId ? /* @__PURE__ */ jsx14(
6099
6135
  "button",
6100
6136
  {
6101
6137
  type: "button",
6102
6138
  onClick: () => onSelect(group.key, void 0),
6103
- className: "text-[11px] font-semibold text-rose-600 hover:text-rose-700 hover:underline cursor-pointer shrink-0",
6139
+ className: "self-end h-8 inline-flex items-center px-1 text-[11px] font-semibold text-rose-600 hover:text-rose-700 hover:underline cursor-pointer shrink-0 whitespace-nowrap",
6104
6140
  children: "\u05E0\u05E7\u05D4 \u05E1\u05D9\u05E0\u05D5\u05DF"
6105
6141
  }
6106
6142
  ) : null
6107
- ] }),
6108
- /* @__PURE__ */ jsx14("div", { className: "flex flex-wrap items-end gap-x-2 gap-y-2.5", children: group.options.map((opt) => {
6109
- const active = group.activeId === opt.id;
6110
- return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-center gap-0.5", children: [
6111
- /* @__PURE__ */ jsx14(
6112
- "span",
6113
- {
6114
- className: `text-[11px] font-bold leading-none ${active ? "text-indigo-700" : "text-slate-500"}`,
6115
- children: opt.count
6116
- }
6117
- ),
6118
- /* @__PURE__ */ jsx14(
6119
- "button",
6120
- {
6121
- type: "button",
6122
- disabled,
6123
- onClick: () => onSelect(group.key, active ? void 0 : opt.id),
6124
- title: active ? "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D9\u05D8\u05D5\u05DC \u05D4\u05E1\u05D9\u05E0\u05D5\u05DF" : `\u05E1\u05E0\u05DF \u05DC\u05E4\u05D9: ${opt.label}`,
6125
- "aria-pressed": active,
6126
- className: `px-3 h-8 rounded-md border text-xs font-semibold whitespace-nowrap shadow-2xs transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none ${active ? "bg-indigo-600 border-indigo-600 text-white hover:bg-indigo-700" : "bg-white border-slate-300 text-slate-700 hover:bg-slate-50 hover:border-slate-400"}`,
6127
- children: opt.label
6128
- }
6129
- )
6130
- ] }, opt.id);
6131
- }) })
6132
- ]
6133
- },
6134
- group.key
6135
- )) });
6143
+ ] })
6144
+ },
6145
+ group.key
6146
+ );
6147
+ }) });
6136
6148
  }
6137
6149
 
6138
6150
  // src/components/TableBlock/RelationButtonsBar.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universe-platform/ui",
3
- "version": "0.1.0-beta.62",
3
+ "version": "0.1.0-beta.64",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",