vue2-excel-grid 2.3.0 → 2.4.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-excel-grid",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Excel-style grid component for Vue 2.6.14 with virtual scrolling",
5
5
  "license": "MIT",
6
6
  "author": "Fozilbek Raimberdiyev",
@@ -792,6 +792,38 @@
792
792
 
793
793
  <!-- Resize indicator line -->
794
794
  <div v-if="resizing.active" class="eg-resize-line" :style="resizeLineStyle"></div>
795
+
796
+ <!-- Loading overlay (host-driven, e.g. during an async data fetch) -->
797
+ <div v-if="loading" class="eg-loading-overlay">
798
+ <template v-if="columns && columns.length">
799
+ <div class="eg-skeleton">
800
+ <div class="eg-skeleton-row eg-skeleton-row-header" :style="{ height: headerRowHeight + 'px' }">
801
+ <div
802
+ v-for="col in leafCols"
803
+ :key="'sk-h-' + col._flatIndex"
804
+ class="eg-skeleton-block"
805
+ :style="{ width: getColW(col._flatIndex) + 'px' }"
806
+ ></div>
807
+ </div>
808
+ <div
809
+ v-for="r in 20"
810
+ :key="'sk-r-' + r"
811
+ class="eg-skeleton-row"
812
+ :style="{ height: _rowH + 'px' }"
813
+ >
814
+ <div
815
+ v-for="col in leafCols"
816
+ :key="'sk-c-' + col._flatIndex"
817
+ class="eg-skeleton-block"
818
+ :style="{ width: getColW(col._flatIndex) + 'px' }"
819
+ ></div>
820
+ </div>
821
+ </div>
822
+ </template>
823
+ <template v-else>
824
+ <div class="eg-loading-spinner"></div>
825
+ </template>
826
+ </div>
795
827
  </div><!-- end container -->
796
828
 
797
829
  <!-- Import progress overlay -->
@@ -1314,6 +1346,21 @@ const ExcelGridComponent = {
1314
1346
  */
1315
1347
  locked: { type: Boolean, default: false },
1316
1348
 
1349
+ /**
1350
+ * Host-driven loading state (e.g. while an async data fetch is in
1351
+ * flight). When `true`, only the grid body (`.eg-container`) is
1352
+ * covered — the toolbar stays visible and interactive. If `columns`
1353
+ * is non-empty, a shimmering skeleton matching each column's width is
1354
+ * shown; otherwise a plain centered spinner is shown. Purely visual —
1355
+ * doesn't block edits/interaction the way `locked` does (combine both
1356
+ * if that's also needed).
1357
+ * @type {Boolean}
1358
+ * @default false
1359
+ * @example
1360
+ * <excel-grid :columns="columns" v-model="data" :loading="isFetching" />
1361
+ */
1362
+ loading: { type: Boolean, default: false },
1363
+
1317
1364
  /** Show "Column info" / "Row info" items in the context menu (dev/debug aid). */
1318
1365
  devMode: { type: Boolean, default: false },
1319
1366
 
@@ -8007,6 +8054,60 @@ export default ExcelGridComponent
8007
8054
  to { transform: rotate(360deg); }
8008
8055
  }
8009
8056
 
8057
+ /* ===== LOADING OVERLAY (loading prop) ===== */
8058
+ .eg-loading-overlay {
8059
+ position: absolute;
8060
+ inset: 0;
8061
+ background: var(--eg-color-overlay-bg, var(--eg-color-overlay-bg-default));
8062
+ display: flex;
8063
+ align-items: center;
8064
+ justify-content: center;
8065
+ z-index: 90;
8066
+ overflow: hidden;
8067
+ }
8068
+ .eg-loading-spinner {
8069
+ width: 32px;
8070
+ height: 32px;
8071
+ border: 3px solid var(--eg-color-border-cell, var(--eg-color-border-cell-default));
8072
+ border-top-color: var(--eg-color-accent, var(--eg-color-accent-default));
8073
+ border-radius: 50%;
8074
+ animation: eg-spin 0.8s linear infinite;
8075
+ }
8076
+ .eg-skeleton {
8077
+ width: 100%;
8078
+ height: 100%;
8079
+ overflow: hidden;
8080
+ }
8081
+ .eg-skeleton-row {
8082
+ display: flex;
8083
+ align-items: center;
8084
+ padding: 0 4px;
8085
+ box-sizing: border-box;
8086
+ }
8087
+ .eg-skeleton-row-header {
8088
+ background: var(--eg-color-header-bg, var(--eg-color-header-bg-default));
8089
+ }
8090
+ .eg-skeleton-block {
8091
+ height: 60%;
8092
+ margin: 0 2px;
8093
+ border-radius: var(--eg-radius, var(--eg-radius-default));
8094
+ background: linear-gradient(
8095
+ 90deg,
8096
+ var(--eg-color-border-cell, var(--eg-color-border-cell-default)) 25%,
8097
+ var(--eg-color-cell-readonly, var(--eg-color-cell-readonly-default)) 37%,
8098
+ var(--eg-color-border-cell, var(--eg-color-border-cell-default)) 63%
8099
+ );
8100
+ background-size: 400% 100%;
8101
+ animation: eg-skeleton-shimmer 1.4s ease infinite;
8102
+ }
8103
+ @keyframes eg-skeleton-shimmer {
8104
+ 0% { background-position: 100% 50%; }
8105
+ 100% { background-position: 0 50%; }
8106
+ }
8107
+ @media (prefers-reduced-motion: reduce) {
8108
+ .eg-skeleton-block, .eg-loading-spinner { animation: none; }
8109
+ }
8110
+
8010
8111
  /* ===== READONLY CELL ===== */
8011
8112
  /* !important throughout: same-specificity as the base .eg-cell / .eg-cell-active /
8012
8113
  .eg-cell-selected rules, so which one wins would otherwise depend on source