@1771technologies/lytenyte-pro 0.0.62 → 0.0.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.
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { IsoResizeObserver, getPreciseElementDimensions, clsx } from "@1771technologies/js-utils";
3
- import { u as useDragStore, a as useDrag, C as Checkbox, I as Input, D as DragProvider } from "./drag-store-jYWgvRwR.js";
3
+ import { u as useDragStore, a as useDrag, C as Checkbox, I as Input, D as DragProvider } from "./drag-store-D6Jfml4y.js";
4
4
  import "@1771technologies/react-sizer";
5
5
  import { useCombinedRefs, useEvent } from "@1771technologies/react-utils";
6
6
  import "@1771technologies/grid-provider";
@@ -8,7 +8,7 @@ import { useRef, useState, useEffect, useCallback, useMemo, createContext, useCo
8
8
  import "@1771technologies/react-dragon";
9
9
  import "@1771technologies/grid-core";
10
10
  import { c as useGrid, G as GridProvider } from "./useScrollLock-D4UY33Sb.js";
11
- import { g as useEdgeScroll, h as useDraggable, c as canAgg, a as canMeasure, f as useDroppable, u as useAggregationSource, b as useMeasuresSource, d as useRowGroupsSource, e as useColumnPivotSource, P as Pill, M as MenuTrigger, i as PillManagerAggMenu, j as PillManagerMeasureMenu } from "./pill-DDgH6C0H.js";
11
+ import { g as useEdgeScroll, h as useDraggable, c as canAgg, a as canMeasure, f as useDroppable, u as useAggregationSource, b as useMeasuresSource, d as useRowGroupsSource, e as useColumnPivotSource, P as Pill, M as MenuTrigger, i as PillManagerAggMenu, j as PillManagerMeasureMenu } from "./pill-DA4yxWuW.js";
12
12
  import { A as ArrowRightIcon } from "./tickmark-icon-CoogRMoO.js";
13
13
  import { A as ArrowDownIcon } from "./arrow-down-icon-B-3ldODD.js";
14
14
  import { D as DragIcon, M as MeasuresIcon, C as ColumnPivotIcon, R as RowGroupIcon } from "./row-group-icon-DFUMye0v.js";
@@ -554,6 +554,9 @@ function CellMarkerRenderer({ row, api }) {
554
554
  doesRowHaveDetail && (isExpanded ? /* @__PURE__ */ jsx(CollapseButton, { onClick: toggleDetail }) : /* @__PURE__ */ jsx(ExpandButton, { onClick: toggleDetail }))
555
555
  ] });
556
556
  }
557
+ const LoadingSpinner = () => {
558
+ return /* @__PURE__ */ jsx("div", { className: "lng1771-spinner", children: /* @__PURE__ */ jsx("div", { className: "lng1771-circle" }) });
559
+ };
557
560
  function CellGroupRendererDefault({ api, row, column }) {
558
561
  if (!api.rowIsGroup(row)) {
559
562
  return /* @__PURE__ */ jsx("div", {});
@@ -568,6 +571,7 @@ function CellGroupRendererDefault({ api, row, column }) {
568
571
  if (isMulti && columnDepth !== rowDepth) {
569
572
  return /* @__PURE__ */ jsx("div", {});
570
573
  }
574
+ const isLoading = !!row.loading;
571
575
  return /* @__PURE__ */ jsxs(
572
576
  "div",
573
577
  {
@@ -580,7 +584,7 @@ function CellGroupRendererDefault({ api, row, column }) {
580
584
  height: "100%"
581
585
  },
582
586
  children: [
583
- /* @__PURE__ */ jsx(
587
+ !isLoading && !row.error && /* @__PURE__ */ jsx(
584
588
  GridButton,
585
589
  {
586
590
  onClick: () => api.rowGroupToggle(row),
@@ -592,6 +596,38 @@ function CellGroupRendererDefault({ api, row, column }) {
592
596
  children: "›"
593
597
  }
594
598
  ),
599
+ row.error && !isLoading && /* @__PURE__ */ jsx(
600
+ GridButton,
601
+ {
602
+ onClick: () => api.rowReloadExpansion?.(row),
603
+ style: {
604
+ width: 20,
605
+ height: 20,
606
+ color: "red"
607
+ },
608
+ children: /* @__PURE__ */ jsx(
609
+ "svg",
610
+ {
611
+ xmlns: "http://www.w3.org/2000/svg",
612
+ fill: "none",
613
+ viewBox: "0 0 24 24",
614
+ strokeWidth: 1.5,
615
+ stroke: "currentColor",
616
+ width: 20,
617
+ height: 20,
618
+ children: /* @__PURE__ */ jsx(
619
+ "path",
620
+ {
621
+ strokeLinecap: "round",
622
+ strokeLinejoin: "round",
623
+ d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"
624
+ }
625
+ )
626
+ }
627
+ )
628
+ }
629
+ ),
630
+ isLoading && /* @__PURE__ */ jsx(LoadingSpinner, {}),
595
631
  /* @__PURE__ */ jsx(
596
632
  "div",
597
633
  {
@@ -718,6 +754,84 @@ function useCellPositionChange(api, rowIndex, columnIndex, rowSpan, columnSpan)
718
754
  }, [api, columnIndex, ref, rowIndex, tryFocus]);
719
755
  return { handleRef, onFocus };
720
756
  }
757
+ const skeletonStyle = {
758
+ display: "block",
759
+ width: "80%",
760
+ height: "60%",
761
+ backgroundColor: "var(--lng1771-gray-05)",
762
+ borderRadius: "8px",
763
+ position: "relative",
764
+ overflow: "hidden"
765
+ };
766
+ const shimmerStyle = {
767
+ position: "absolute",
768
+ top: 0,
769
+ left: 0,
770
+ width: "100%",
771
+ height: "100%",
772
+ backgroundImage: "linear-gradient(90deg, var(--lng1771-gray-05) 0%, var(--lng1771-primary-10) 50%, var(--lng1771-gray-05) 100%)",
773
+ animation: "lng1771-shimmer 1.5s infinite"
774
+ };
775
+ const Skeleton = ({ className = "" }) => {
776
+ return /* @__PURE__ */ jsx(
777
+ "div",
778
+ {
779
+ style: {
780
+ display: "flex",
781
+ alignItems: "center",
782
+ justifyContent: "center",
783
+ width: "100%",
784
+ height: "100%"
785
+ },
786
+ children: /* @__PURE__ */ jsx("div", { style: skeletonStyle, className, children: /* @__PURE__ */ jsx("div", { style: shimmerStyle }) })
787
+ }
788
+ );
789
+ };
790
+ function ErrorCellRenderer({ api }) {
791
+ return /* @__PURE__ */ jsxs(
792
+ "button",
793
+ {
794
+ style: {
795
+ color: "red",
796
+ display: "flex",
797
+ alignItems: "center",
798
+ padding: 4,
799
+ width: "100%",
800
+ height: "100%",
801
+ justifyContent: "center",
802
+ border: "none",
803
+ backgroundColor: "transparent",
804
+ gap: 4
805
+ },
806
+ onClick: () => {
807
+ api.rowReload();
808
+ },
809
+ children: [
810
+ /* @__PURE__ */ jsx(
811
+ "svg",
812
+ {
813
+ xmlns: "http://www.w3.org/2000/svg",
814
+ fill: "none",
815
+ viewBox: "0 0 24 24",
816
+ strokeWidth: 1.5,
817
+ stroke: "currentColor",
818
+ width: 20,
819
+ height: 20,
820
+ children: /* @__PURE__ */ jsx(
821
+ "path",
822
+ {
823
+ strokeLinecap: "round",
824
+ strokeLinejoin: "round",
825
+ d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"
826
+ }
827
+ )
828
+ }
829
+ ),
830
+ "Retry"
831
+ ]
832
+ }
833
+ );
834
+ }
721
835
  function CellImpl({
722
836
  rowIndex,
723
837
  columnIndex,
@@ -755,7 +869,9 @@ function CellImpl({
755
869
  rowSpan,
756
870
  colSpan
757
871
  );
758
- return /* @__PURE__ */ jsx(
872
+ const isLoading = rowNode.loading && rowNode.data == null;
873
+ const isError = rowNode.error && rowNode.data === null;
874
+ return /* @__PURE__ */ jsxs(
759
875
  "div",
760
876
  {
761
877
  style: cx.style,
@@ -778,7 +894,11 @@ function CellImpl({
778
894
  tabIndex: -1,
779
895
  ...events,
780
896
  onFocus,
781
- children: /* @__PURE__ */ jsx(Renderer, { api, column, columnIndex, row: rowNode })
897
+ children: [
898
+ !isLoading && !isError && /* @__PURE__ */ jsx(Renderer, { api, column, columnIndex, row: rowNode }),
899
+ isLoading && /* @__PURE__ */ jsx(Skeleton, {}),
900
+ isError && (columnIndex === 0 && column.id !== COLUMN_MARKER_ID || api.getState().columnsVisible.peek()?.[0].id === COLUMN_MARKER_ID && columnIndex === 1) && /* @__PURE__ */ jsx(ErrorCellRenderer, { api })
901
+ ]
782
902
  }
783
903
  );
784
904
  }
@@ -1,8 +1,8 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useCallback, createContext, useContext, useMemo, forwardRef } from "react";
3
3
  import { c as useGrid, G as GridProvider } from "./useScrollLock-D4UY33Sb.js";
4
- import { S as Select } from "./select-005D5mHt.js";
5
- import { I as Input, C as Checkbox } from "./drag-store-jYWgvRwR.js";
4
+ import { S as Select } from "./select-zhKMpeeF.js";
5
+ import { I as Input, C as Checkbox } from "./drag-store-D6Jfml4y.js";
6
6
  import "@1771technologies/react-sizer";
7
7
  import "@1771technologies/react-utils";
8
8
  import "@1771technologies/grid-provider";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Checkbox, d as COLUMN_MARKER_ID, H as HEADER_CELL_POSITION, g as getTransform, e as COLUMN_EMPTY_PREFIX, f as HEADER_GROUP_CELL_POSITION, h as CollapseButton, F as FLOATING_CELL_POSITION, i as FULL_ENCODING, j as CellFullWidth, E as END_ENCODING, k as Cell, I as Input, G as GRID_CELL_POSITION, l as GridButton } from "./drag-store-jYWgvRwR.js";
2
- import { t, n, v, w, B, J, L, K, M, q, p, r, s, P, x, o, z, m, y, R, A } from "./drag-store-jYWgvRwR.js";
1
+ import { C as Checkbox, d as COLUMN_MARKER_ID, H as HEADER_CELL_POSITION, g as getTransform, e as COLUMN_EMPTY_PREFIX, f as HEADER_GROUP_CELL_POSITION, h as CollapseButton, F as FLOATING_CELL_POSITION, i as FULL_ENCODING, j as CellFullWidth, E as END_ENCODING, k as Cell, I as Input, G as GRID_CELL_POSITION, l as GridButton } from "./drag-store-D6Jfml4y.js";
2
+ import { t, n, v, w, B, J, L, K, M, q, p, r, s, P, x, o, z, m, y, R, A } from "./drag-store-D6Jfml4y.js";
3
3
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
4
4
  import { Sizer } from "@1771technologies/react-sizer";
5
5
  import { useEvent, useIsoEffect } from "@1771technologies/react-utils";
@@ -3786,7 +3786,9 @@ const createClientDataSourceReact = (init) => {
3786
3786
  return createClientDataSource(init);
3787
3787
  };
3788
3788
  function useClientDataSource(init) {
3789
- return useState(() => createClientDataSource(init))[0];
3789
+ return useState(() => {
3790
+ return createClientDataSource(init);
3791
+ })[0];
3790
3792
  }
3791
3793
  function useTreeDataSource(init) {
3792
3794
  const [ds] = useState(() => {
@@ -514,6 +514,15 @@ INPUT
514
514
  background-color: var(--lng1771-gray-50);
515
515
  }
516
516
  }
517
+
518
+ @keyframes lng1771-shimmer {
519
+ 0% {
520
+ transform: translateX(-100%);
521
+ }
522
+ 100% {
523
+ transform: translateX(100%);
524
+ }
525
+ }
517
526
  .lng1771-cell__marker {
518
527
  display: flex;
519
528
  align-items: center;
@@ -523,6 +532,32 @@ INPUT
523
532
  box-sizing: border-box;
524
533
  position: relative;
525
534
  }
535
+ .lng1771-spinner {
536
+ display: flex;
537
+ justify-content: center;
538
+ align-items: center;
539
+ width: 100%;
540
+ height: 100%;
541
+ }
542
+
543
+ .lng1771-circle {
544
+ width: 20px;
545
+ height: 20px;
546
+ box-sizing: border-box;
547
+ border: 3px solid rgba(0, 0, 0, 0.1);
548
+ border-bottom: 3px solid var(--lng1771-primary-50);
549
+ border-radius: 50%;
550
+ animation: lng1771-spin 1s linear infinite;
551
+ }
552
+
553
+ @keyframes lng1771-spin {
554
+ 0% {
555
+ transform: rotate(0deg);
556
+ }
557
+ 100% {
558
+ transform: rotate(360deg);
559
+ }
560
+ }
526
561
  .lng1771-row-container {
527
562
  background-color: var(--lng1771-gray-00);
528
563
  display: flex;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { useRef, useState, useEffect, useCallback, useMemo, forwardRef } from "react";
3
- import { u as useDragStore, b as useStore } from "./drag-store-jYWgvRwR.js";
3
+ import { u as useDragStore, b as useStore } from "./drag-store-D6Jfml4y.js";
4
4
  import { arrayOverlap, clsx } from "@1771technologies/js-utils";
5
5
  import { m as mergeProps, E as contains, P as PropTypes } from "./proptypes-BjYr2nFr.js";
6
6
  import { u as useButton } from "./useButton-DWXzFgcr.js";
@@ -3,8 +3,8 @@ import { c as useGrid, G as GridProvider } from "./useScrollLock-D4UY33Sb.js";
3
3
  import { useMemo, createContext, useState, useContext, forwardRef, useEffect, useCallback } from "react";
4
4
  import { clsx } from "@1771technologies/js-utils";
5
5
  import { useDroppable as useDroppable$1 } from "@1771technologies/react-dragon";
6
- import { c as canAgg, a as canMeasure, u as useAggregationSource, b as useMeasuresSource, d as useRowGroupsSource, e as useColumnPivotSource, f as useDroppable, g as useEdgeScroll, P as Pill, M as MenuTrigger, h as useDraggable, i as PillManagerAggMenu, j as PillManagerMeasureMenu } from "./pill-DDgH6C0H.js";
7
- import { u as useDragStore, a as useDrag, D as DragProvider } from "./drag-store-jYWgvRwR.js";
6
+ import { c as canAgg, a as canMeasure, u as useAggregationSource, b as useMeasuresSource, d as useRowGroupsSource, e as useColumnPivotSource, f as useDroppable, g as useEdgeScroll, P as Pill, M as MenuTrigger, h as useDraggable, i as PillManagerAggMenu, j as PillManagerMeasureMenu } from "./pill-DA4yxWuW.js";
7
+ import { u as useDragStore, a as useDrag, D as DragProvider } from "./drag-store-D6Jfml4y.js";
8
8
  import "@1771technologies/react-sizer";
9
9
  import { useCombinedRefs } from "@1771technologies/react-utils";
10
10
  import "@1771technologies/grid-provider";
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { clsx } from "@1771technologies/js-utils";
3
3
  import { A as ArrowDownIcon } from "./arrow-down-icon-B-3ldODD.js";
4
- import { c as CheckMark } from "./drag-store-jYWgvRwR.js";
4
+ import { c as CheckMark } from "./drag-store-D6Jfml4y.js";
5
5
  import "@1771technologies/react-sizer";
6
6
  import "@1771technologies/react-utils";
7
7
  import "@1771technologies/grid-provider";
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useMemo, useState, useEffect, createContext, useContext, forwardRef } from "react";
3
3
  import { c as useGrid, G as GridProvider } from "./useScrollLock-D4UY33Sb.js";
4
4
  import { clsx } from "@1771technologies/js-utils";
5
- import { S as Select } from "./select-005D5mHt.js";
5
+ import { S as Select } from "./select-zhKMpeeF.js";
6
6
  import { P as PlusIcon } from "./plus-icon-ToqW5CC-.js";
7
7
  import { C as CrossIcon } from "./cross-icon-CEMLAlFX.js";
8
8
  import { S as Separator } from "./separator-BnPPeAk8.js";
@@ -0,0 +1,3 @@
1
+ import { ServerDataSourceInitial } from '@1771technologies/grid-server-data-source';
2
+ import { ReactNode } from 'react';
3
+ export declare function useServerDataSource<D>(init: ServerDataSourceInitial<D, ReactNode>): import('@1771technologies/grid-types/pro').RowDataSourcePro<D, ReactNode>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1771technologies/lytenyte-pro",
3
- "version": "0.0.62",
3
+ "version": "0.0.64",
4
4
  "license": "COMMERCIAL",
5
5
  "type": "module",
6
6
  "files": [
@@ -70,25 +70,26 @@
70
70
  "react-dom": "^18.0.0 || ^19.0.0"
71
71
  },
72
72
  "dependencies": {
73
- "@1771technologies/grid-client-data-source-pro": "0.0.62",
74
- "@1771technologies/grid-core": "0.0.62",
75
- "@1771technologies/grid-design": "0.0.62",
76
- "@1771technologies/grid-provider": "0.0.62",
77
- "@1771technologies/grid-store-pro": "0.0.62",
78
- "@1771technologies/grid-tree-data-source": "0.0.62",
79
- "@1771technologies/grid-types": "0.0.62",
80
- "@1771technologies/js-utils": "0.0.62",
81
- "@1771technologies/lytenyte-core": "0.0.62",
82
- "@1771technologies/react-cascada": "0.0.62",
83
- "@1771technologies/react-dragon": "0.0.62",
84
- "@1771technologies/react-sizer": "0.0.62",
85
- "@1771technologies/react-split-pane": "0.0.62",
86
- "@1771technologies/react-utils": "0.0.62",
73
+ "@1771technologies/grid-client-data-source-pro": "0.0.64",
74
+ "@1771technologies/grid-core": "0.0.64",
75
+ "@1771technologies/grid-design": "0.0.64",
76
+ "@1771technologies/grid-provider": "0.0.64",
77
+ "@1771technologies/grid-store-pro": "0.0.64",
78
+ "@1771technologies/grid-tree-data-source": "0.0.64",
79
+ "@1771technologies/grid-types": "0.0.64",
80
+ "@1771technologies/js-utils": "0.0.64",
81
+ "@1771technologies/lytenyte-core": "0.0.64",
82
+ "@1771technologies/react-cascada": "0.0.64",
83
+ "@1771technologies/react-dragon": "0.0.64",
84
+ "@1771technologies/react-sizer": "0.0.64",
85
+ "@1771technologies/react-split-pane": "0.0.64",
86
+ "@1771technologies/react-utils": "0.0.64",
87
87
  "@base-ui-components/react": "1.0.0-alpha.7"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@types/react": "^19.0.1",
91
- "@types/react-dom": "^19.0.2"
91
+ "@types/react-dom": "^19.0.2",
92
+ "alasql": "^4.6.6"
92
93
  },
93
94
  "access": "public"
94
95
  }