@universe-platform/ui 0.1.0-beta.76 → 0.1.0-beta.77

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/index.d.mts CHANGED
@@ -283,7 +283,7 @@ declare function parseLinkValue(val: CellValue<'LINK'> | string): {
283
283
  label: string;
284
284
  };
285
285
  declare function resolveProtocol(url: string): string;
286
- declare function LinkPickerCell({ value, onChange, readOnly }: LinkPickerCellProps): react_jsx_runtime.JSX.Element;
286
+ declare function LinkPickerCell({ value, onChange, column, readOnly }: LinkPickerCellProps): react_jsx_runtime.JSX.Element;
287
287
 
288
288
  interface RelationPickerCellProps {
289
289
  value: CellValue<'RELATION'> | string;
package/dist/index.d.ts CHANGED
@@ -283,7 +283,7 @@ declare function parseLinkValue(val: CellValue<'LINK'> | string): {
283
283
  label: string;
284
284
  };
285
285
  declare function resolveProtocol(url: string): string;
286
- declare function LinkPickerCell({ value, onChange, readOnly }: LinkPickerCellProps): react_jsx_runtime.JSX.Element;
286
+ declare function LinkPickerCell({ value, onChange, column, readOnly }: LinkPickerCellProps): react_jsx_runtime.JSX.Element;
287
287
 
288
288
  interface RelationPickerCellProps {
289
289
  value: CellValue<'RELATION'> | string;
package/dist/index.js CHANGED
@@ -3635,14 +3635,16 @@ function resolveProtocol(url) {
3635
3635
  }
3636
3636
  return `https://${trimmed}`;
3637
3637
  }
3638
- function LinkPickerCell({ value, onChange, readOnly = false }) {
3638
+ function LinkPickerCell({ value, onChange, column, readOnly = false }) {
3639
+ var _a, _b;
3639
3640
  const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
3640
3641
  const containerRef = (0, import_react7.useRef)(null);
3641
3642
  const urlInputRef = (0, import_react7.useRef)(null);
3642
3643
  const { targetRef, handleMouseEnter, handleMouseLeave, renderTooltip } = useSmartTooltip();
3643
3644
  const [popoverPos, setPopoverPos] = (0, import_react7.useState)({ top: 0, right: 0 });
3644
3645
  const currentLink = parseLinkValue(value);
3645
- const displayLabel = currentLink.label && currentLink.label.trim() || currentLink.url;
3646
+ const fixedLabel = String((_b = (_a = column == null ? void 0 : column.config) == null ? void 0 : _a.fixedLabel) != null ? _b : "").trim();
3647
+ const displayLabel = fixedLabel || currentLink.label && currentLink.label.trim() || currentLink.url;
3646
3648
  const targetHref = resolveProtocol(currentLink.url);
3647
3649
  const [draftUrl, setDraftUrl] = (0, import_react7.useState)(currentLink.url);
3648
3650
  const [draftLabel, setDraftLabel] = (0, import_react7.useState)(currentLink.label);
@@ -3699,8 +3701,8 @@ function LinkPickerCell({ value, onChange, readOnly = false }) {
3699
3701
  updatePopoverPosition();
3700
3702
  setIsOpen(true);
3701
3703
  setTimeout(() => {
3702
- var _a;
3703
- (_a = urlInputRef.current) == null ? void 0 : _a.focus();
3704
+ var _a2;
3705
+ (_a2 = urlInputRef.current) == null ? void 0 : _a2.focus();
3704
3706
  }, 50);
3705
3707
  };
3706
3708
  (0, import_react7.useEffect)(() => {
@@ -3875,7 +3877,7 @@ function LinkPickerCell({ value, onChange, readOnly = false }) {
3875
3877
  }
3876
3878
  )
3877
3879
  ] }),
3878
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
3880
+ !fixedLabel && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
3879
3881
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "block text-xs font-medium text-slate-700 mb-1", children: [
3880
3882
  "\u05D8\u05E7\u05E1\u05D8 \u05DC\u05EA\u05E6\u05D5\u05D2\u05D4 ",
3881
3883
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-slate-400 font-normal", children: "(\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)" })
@@ -5363,8 +5365,8 @@ var CELL_RENDERERS = {
5363
5365
  },
5364
5366
  TIME: ({ value }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TimePickerCell, { value, onChange: () => {
5365
5367
  }, readOnly: true }),
5366
- LINK: ({ value }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LinkPickerCell, { value, onChange: () => {
5367
- }, readOnly: true }),
5368
+ LINK: ({ value, column }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LinkPickerCell, { value, onChange: () => {
5369
+ }, column, readOnly: true }),
5368
5370
  BOOLEAN: ({ value }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex items-center justify-center w-full h-full p-2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { type: "checkbox", checked: !!value, readOnly: true, className: "w-4 h-4 rounded border-slate-300 text-brand" }) }),
5369
5371
  GOOGLE_DRIVE_FILE: ({ value }) => {
5370
5372
  const files = Array.isArray(value) ? value : value ? [value] : [];
package/dist/index.mjs CHANGED
@@ -3420,14 +3420,16 @@ function resolveProtocol(url) {
3420
3420
  }
3421
3421
  return `https://${trimmed}`;
3422
3422
  }
3423
- function LinkPickerCell({ value, onChange, readOnly = false }) {
3423
+ function LinkPickerCell({ value, onChange, column, readOnly = false }) {
3424
+ var _a, _b;
3424
3425
  const [isOpen, setIsOpen] = useState6(false);
3425
3426
  const containerRef = useRef6(null);
3426
3427
  const urlInputRef = useRef6(null);
3427
3428
  const { targetRef, handleMouseEnter, handleMouseLeave, renderTooltip } = useSmartTooltip();
3428
3429
  const [popoverPos, setPopoverPos] = useState6({ top: 0, right: 0 });
3429
3430
  const currentLink = parseLinkValue(value);
3430
- const displayLabel = currentLink.label && currentLink.label.trim() || currentLink.url;
3431
+ const fixedLabel = String((_b = (_a = column == null ? void 0 : column.config) == null ? void 0 : _a.fixedLabel) != null ? _b : "").trim();
3432
+ const displayLabel = fixedLabel || currentLink.label && currentLink.label.trim() || currentLink.url;
3431
3433
  const targetHref = resolveProtocol(currentLink.url);
3432
3434
  const [draftUrl, setDraftUrl] = useState6(currentLink.url);
3433
3435
  const [draftLabel, setDraftLabel] = useState6(currentLink.label);
@@ -3484,8 +3486,8 @@ function LinkPickerCell({ value, onChange, readOnly = false }) {
3484
3486
  updatePopoverPosition();
3485
3487
  setIsOpen(true);
3486
3488
  setTimeout(() => {
3487
- var _a;
3488
- (_a = urlInputRef.current) == null ? void 0 : _a.focus();
3489
+ var _a2;
3490
+ (_a2 = urlInputRef.current) == null ? void 0 : _a2.focus();
3489
3491
  }, 50);
3490
3492
  };
3491
3493
  useEffect5(() => {
@@ -3660,7 +3662,7 @@ function LinkPickerCell({ value, onChange, readOnly = false }) {
3660
3662
  }
3661
3663
  )
3662
3664
  ] }),
3663
- /* @__PURE__ */ jsxs6("div", { children: [
3665
+ !fixedLabel && /* @__PURE__ */ jsxs6("div", { children: [
3664
3666
  /* @__PURE__ */ jsxs6("label", { className: "block text-xs font-medium text-slate-700 mb-1", children: [
3665
3667
  "\u05D8\u05E7\u05E1\u05D8 \u05DC\u05EA\u05E6\u05D5\u05D2\u05D4 ",
3666
3668
  /* @__PURE__ */ jsx6("span", { className: "text-slate-400 font-normal", children: "(\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)" })
@@ -5148,8 +5150,8 @@ var CELL_RENDERERS = {
5148
5150
  },
5149
5151
  TIME: ({ value }) => /* @__PURE__ */ jsx12(TimePickerCell, { value, onChange: () => {
5150
5152
  }, readOnly: true }),
5151
- LINK: ({ value }) => /* @__PURE__ */ jsx12(LinkPickerCell, { value, onChange: () => {
5152
- }, readOnly: true }),
5153
+ LINK: ({ value, column }) => /* @__PURE__ */ jsx12(LinkPickerCell, { value, onChange: () => {
5154
+ }, column, readOnly: true }),
5153
5155
  BOOLEAN: ({ value }) => /* @__PURE__ */ jsx12("div", { className: "flex items-center justify-center w-full h-full p-2", children: /* @__PURE__ */ jsx12("input", { type: "checkbox", checked: !!value, readOnly: true, className: "w-4 h-4 rounded border-slate-300 text-brand" }) }),
5154
5156
  GOOGLE_DRIVE_FILE: ({ value }) => {
5155
5157
  const files = Array.isArray(value) ? value : value ? [value] : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universe-platform/ui",
3
- "version": "0.1.0-beta.76",
3
+ "version": "0.1.0-beta.77",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",