vue2-excel-grid 2.10.0 → 2.11.1

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.10.0",
3
+ "version": "2.11.1",
4
4
  "description": "Excel-style grid component for Vue 2.6.14 with virtual scrolling",
5
5
  "license": "MIT",
6
6
  "author": "Fozilbek Raimberdiyev",
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  class="eg-shell"
4
- :class="['eg-size-' + internalSize, 'eg-theme-' + internalTheme, { 'eg-shell-fullscreen': isFullscreen, 'eg-locked': internalLocked }]"
4
+ :class="['eg-size-' + internalSize, 'eg-theme-' + internalTheme, { 'eg-shell-fullscreen': isFullscreen, 'eg-locked': internalLocked, 'eg-dark': isDarkMode }]"
5
5
  :style="shellStyle"
6
6
  >
7
7
  <!-- Toolbar -->
@@ -1021,6 +1021,7 @@ import { formatNumber as _formatNumber } from '../utils/numberFormat.js'
1021
1021
  import { Mask, MaskInput } from '../utils/mask.js'
1022
1022
  import { listVersions, getVersion, deleteVersion, saveOrTouchVersion, putBuffer, getBuffer, clearBuffer } from '../utils/idbStore.js'
1023
1023
  import { hashRows, hashRowsAsync } from '../utils/dataHash.js'
1024
+ import { globalConfig } from '../config.js'
1024
1025
 
1025
1026
  const SIZE_CONFIG = {
1026
1027
  small: { row: 22, header: 24, footer: 24, filter: 26 },
@@ -1475,6 +1476,15 @@ const ExcelGridComponent = {
1475
1476
  */
1476
1477
  theme: { type: String, default: 'antd' },
1477
1478
 
1479
+ /**
1480
+ * Dark mode toggle.
1481
+ * - `true`: enables dark mode styling and sets `color-scheme: dark`.
1482
+ * - `false`: forces light mode styling and sets `color-scheme: light` (prevents OS dark mode leak).
1483
+ * - `null` / `undefined` (default): inherits the global configuration from `Vue.use(Vue2ExcelGrid, { darkMode })`.
1484
+ * Accepts a Boolean, a getter Function (`() => boolean`), or `'auto'` / `'system'`.
1485
+ */
1486
+ darkMode: { type: [Boolean, Function, String], default: null },
1487
+
1478
1488
  /**
1479
1489
  * Shows a filter row directly beneath the column headers (inside the
1480
1490
  * sticky header area). Each leaf column gets a filter control matched to
@@ -1844,6 +1854,19 @@ const ExcelGridComponent = {
1844
1854
  },
1845
1855
 
1846
1856
  computed: {
1857
+ isDarkMode() {
1858
+ let val = this.darkMode
1859
+ if (val === null || val === undefined) {
1860
+ val = globalConfig ? globalConfig.darkMode : null
1861
+ }
1862
+ if (typeof val === 'function') {
1863
+ val = val()
1864
+ }
1865
+ if (val === 'auto' || val === 'system') {
1866
+ return typeof window !== 'undefined' && !!window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
1867
+ }
1868
+ return Boolean(val)
1869
+ },
1847
1870
  hoverTooltipStyle() {
1848
1871
  if (!this.hoverTooltip) return {}
1849
1872
  const { rect, text } = this.hoverTooltip
@@ -7404,6 +7427,9 @@ export default ExcelGridComponent
7404
7427
  border: 1px solid var(--eg-color-border, var(--eg-color-border-default));
7405
7428
  border-radius: var(--eg-radius, var(--eg-radius-default));
7406
7429
  overflow: hidden;
7430
+ color-scheme: light;
7431
+ background: var(--eg-color-cell-bg, var(--eg-color-cell-bg-default));
7432
+ color: var(--eg-color-text, var(--eg-color-text-default));
7407
7433
  }
7408
7434
 
7409
7435
  .eg-shell-fullscreen {
@@ -7698,6 +7724,128 @@ export default ExcelGridComponent
7698
7724
  --eg-color-row-stripe-default: #FAFBFB;
7699
7725
  }
7700
7726
 
7727
+ /* ── Dark Mode ─────────────────────────────────────────────────── */
7728
+ .eg-shell.eg-dark {
7729
+ color-scheme: dark;
7730
+
7731
+ /* Accent (lighter for dark backgrounds) */
7732
+ --eg-color-accent-default: #4aba7c;
7733
+ --eg-color-accent-dark-default: #2d9e5c;
7734
+ --eg-color-accent-soft-default: rgba(74, 186, 124, 0.2);
7735
+
7736
+ /* Error */
7737
+ --eg-color-error-default: #f87171;
7738
+ --eg-color-error-soft-default: #2d0f0f;
7739
+ --eg-color-error-dark-default: #fca5a5;
7740
+
7741
+ /* Borders */
7742
+ --eg-color-border-default: #3d3d3d;
7743
+ --eg-color-border-cell-default: #2a2a2a;
7744
+ --eg-color-border-strong-default: #555555;
7745
+
7746
+ /* Headers */
7747
+ --eg-color-header-bg-default: #252525;
7748
+ --eg-color-header-group-bg-default: #252525;
7749
+ --eg-color-group-border-default: #2d9e5c;
7750
+ --eg-color-group-bg-collapsed-default: #217346;
7751
+
7752
+ /* Cell states */
7753
+ --eg-color-cell-bg-default: #1e1e1e;
7754
+ --eg-color-cell-selected-default: #1a3d2a;
7755
+ --eg-color-cell-fill-preview-default: #145022;
7756
+ --eg-color-cell-readonly-default: #171717;
7757
+ --eg-color-cell-readonly-selected-default: #163020;
7758
+ --eg-color-cell-readonly-pattern-default: rgba(255, 255, 255, 0.06);
7759
+ --eg-color-footer-bg-default: #1a1a1a;
7760
+
7761
+ /* Row effects */
7762
+ --eg-color-row-hover-default: #242f27;
7763
+ --eg-color-row-stripe-default: #1a1a1a;
7764
+
7765
+ /* Dropdown / Select / Context menu */
7766
+ --eg-color-option-hover-bg-default: #242f27;
7767
+ --eg-color-option-active-hover-bg-default: #1a4d30;
7768
+ --eg-color-overlay-bg-default: rgba(28, 28, 28, 0.95);
7769
+
7770
+ /* Checkbox */
7771
+ --eg-color-checkbox-border-default: #6e6e6e;
7772
+ --eg-color-checkbox-disabled-checked-default: #404040;
7773
+
7774
+ /* Text */
7775
+ --eg-color-text-default: #d4d4d4;
7776
+ --eg-color-text-secondary-default: #a0a0a0;
7777
+ --eg-color-text-muted-default: #6e6e6e;
7778
+
7779
+ /* Shadows */
7780
+ --eg-shadow-dropdown-default: 1px 2px 10px rgba(0, 0, 0, 0.55);
7781
+ --eg-shadow-dialog-default: 0 2px 16px rgba(0, 0, 0, 0.65);
7782
+ --eg-shadow-tooltip-default: 0 1px 5px rgba(0, 0, 0, 0.55);
7783
+ --eg-color-freeze-shadow-default: rgba(0, 0, 0, 0.45);
7784
+ }
7785
+
7786
+ /* Theme-specific dark mode adjustments */
7787
+ .eg-shell.eg-theme-antd.eg-dark {
7788
+ --eg-color-accent-default: #1668DC;
7789
+ --eg-color-accent-dark-default: #1554AD;
7790
+ --eg-color-accent-soft-default: #111A2C;
7791
+ --eg-color-cell-selected-default: #111A2C;
7792
+ --eg-color-cell-fill-preview-default: #153450;
7793
+ --eg-color-row-hover-default: #1f1f1f;
7794
+ --eg-color-option-hover-bg-default: #111A2C;
7795
+ }
7796
+
7797
+ .eg-shell.eg-theme-material.eg-dark {
7798
+ --eg-color-accent-default: #90CAF9;
7799
+ --eg-color-accent-dark-default: #42A5F5;
7800
+ --eg-color-accent-soft-default: #1E2A38;
7801
+ --eg-color-cell-selected-default: #1E2A38;
7802
+ }
7803
+
7804
+ .eg-shell.eg-theme-polaris.eg-dark {
7805
+ --eg-color-accent-default: #00A67E;
7806
+ --eg-color-accent-dark-default: #008060;
7807
+ --eg-color-accent-soft-default: #102A22;
7808
+ --eg-color-cell-selected-default: #102A22;
7809
+ }
7810
+
7811
+ .eg-shell.eg-theme-carbon.eg-dark {
7812
+ --eg-color-accent-default: #4589FF;
7813
+ --eg-color-accent-dark-default: #0F62FE;
7814
+ --eg-color-accent-soft-default: #002D9C;
7815
+ --eg-color-cell-selected-default: #002D9C;
7816
+ }
7817
+
7818
+ .eg-shell.eg-theme-fluent.eg-dark {
7819
+ --eg-color-accent-default: #2886DE;
7820
+ --eg-color-accent-dark-default: #0078D4;
7821
+ --eg-color-accent-soft-default: #0C2B47;
7822
+ --eg-color-cell-selected-default: #0C2B47;
7823
+ }
7824
+
7825
+ /* Dark scrollbars */
7826
+ .eg-shell.eg-dark .eg-container::-webkit-scrollbar,
7827
+ .eg-shell.eg-dark .eg-scroll-body::-webkit-scrollbar,
7828
+ .eg-shell.eg-dark .eg-main-cells::-webkit-scrollbar {
7829
+ width: 10px;
7830
+ height: 10px;
7831
+ }
7832
+ .eg-shell.eg-dark .eg-container::-webkit-scrollbar-track,
7833
+ .eg-shell.eg-dark .eg-scroll-body::-webkit-scrollbar-track,
7834
+ .eg-shell.eg-dark .eg-main-cells::-webkit-scrollbar-track {
7835
+ background: #1e1e1e;
7836
+ }
7837
+ .eg-shell.eg-dark .eg-container::-webkit-scrollbar-thumb,
7838
+ .eg-shell.eg-dark .eg-scroll-body::-webkit-scrollbar-thumb,
7839
+ .eg-shell.eg-dark .eg-main-cells::-webkit-scrollbar-thumb {
7840
+ background: #3d3d3d;
7841
+ border-radius: 4px;
7842
+ }
7843
+ .eg-shell.eg-dark .eg-container::-webkit-scrollbar-thumb:hover,
7844
+ .eg-shell.eg-dark .eg-scroll-body::-webkit-scrollbar-thumb:hover,
7845
+ .eg-shell.eg-dark .eg-main-cells::-webkit-scrollbar-thumb:hover {
7846
+ background: #555555;
7847
+ }
7848
+
7701
7849
  .eg-wrapper {
7702
7850
  display: flex;
7703
7851
  flex-direction: column;
@@ -8205,28 +8353,31 @@ export default ExcelGridComponent
8205
8353
  position: fixed;
8206
8354
  background: var(--eg-color-menu-bg, var(--eg-color-cell-bg, var(--eg-color-cell-bg-default)));
8207
8355
  border: 1px solid var(--eg-color-border, var(--eg-color-border-default));
8208
- border-top: 3px solid var(--eg-color-accent, var(--eg-color-accent-default));
8209
8356
  border-radius: var(--eg-radius, var(--eg-radius-default));
8210
8357
  box-shadow: var(--eg-shadow-dropdown, var(--eg-shadow-dropdown-default));
8211
8358
  z-index: 9999;
8212
- min-width: 160px;
8359
+ min-width: 170px;
8213
8360
  font-size: var(--eg-font-size, var(--eg-font-size-default));
8214
8361
  padding: 4px 0;
8215
8362
  color: var(--eg-color-text, var(--eg-color-text-default));
8363
+ user-select: none;
8364
+ box-sizing: border-box;
8216
8365
  }
8217
8366
 
8218
8367
  /* Only 3 short items ("A → Z" / "Z → A" / "Clear sort") — the generic
8219
- 160px context-menu min-width looks oversized next to it, especially
8368
+ context-menu min-width looks oversized next to it, especially
8220
8369
  at size="small" where rows/text are much smaller. */
8221
8370
  .eg-sort-menu {
8222
- min-width: 110px;
8371
+ min-width: 120px;
8223
8372
  }
8224
8373
 
8225
8374
  .eg-context-item {
8226
- padding: 6px 16px;
8375
+ padding: 6px 14px;
8227
8376
  cursor: pointer;
8228
8377
  position: relative;
8229
8378
  white-space: nowrap;
8379
+ box-sizing: border-box;
8380
+ transition: background-color 0.12s ease, color 0.12s ease;
8230
8381
  }
8231
8382
 
8232
8383
  .eg-context-item:hover {
@@ -8243,9 +8394,14 @@ export default ExcelGridComponent
8243
8394
  .eg-context-item-active::before {
8244
8395
  content: '✓';
8245
8396
  position: absolute;
8246
- left: 4px;
8397
+ left: 6px;
8247
8398
  top: 50%;
8248
8399
  transform: translateY(-50%);
8400
+ font-weight: bold;
8401
+ }
8402
+
8403
+ .eg-sort-menu .eg-context-item {
8404
+ padding-left: 22px;
8249
8405
  }
8250
8406
 
8251
8407
  .eg-context-separator {
@@ -8254,26 +8410,367 @@ export default ExcelGridComponent
8254
8410
  margin: 4px 0;
8255
8411
  }
8256
8412
 
8257
- .eg-context-submenu-parent::after { content: ' ▶'; float: right; }
8413
+ .eg-context-submenu-parent {
8414
+ display: flex;
8415
+ align-items: center;
8416
+ justify-content: space-between;
8417
+ }
8418
+ .eg-context-submenu-parent::after {
8419
+ content: '›';
8420
+ font-size: 15px;
8421
+ line-height: 1;
8422
+ font-weight: 600;
8423
+ margin-left: 12px;
8424
+ color: var(--eg-color-text-secondary, var(--eg-color-text-secondary-default));
8425
+ }
8258
8426
 
8259
8427
  .eg-context-submenu {
8260
8428
  display: none;
8261
8429
  position: absolute;
8262
- left: 100%;
8430
+ left: calc(100% + 2px);
8263
8431
  top: -4px;
8264
8432
  background: var(--eg-color-menu-bg, var(--eg-color-cell-bg, var(--eg-color-cell-bg-default)));
8265
8433
  border: 1px solid var(--eg-color-border, var(--eg-color-border-default));
8266
- border-top: 3px solid var(--eg-color-accent, var(--eg-color-accent-default));
8267
8434
  border-radius: var(--eg-radius, var(--eg-radius-default));
8268
8435
  box-shadow: var(--eg-shadow-dropdown, var(--eg-shadow-dropdown-default));
8269
8436
  min-width: 160px;
8270
8437
  padding: 4px 0;
8271
8438
  z-index: 10000;
8272
8439
  color: var(--eg-color-text, var(--eg-color-text-default));
8440
+ box-sizing: border-box;
8273
8441
  }
8274
8442
 
8275
8443
  .eg-context-submenu-parent:hover .eg-context-submenu { display: block; }
8276
8444
 
8445
+ /* ── Theme-specific context menu & actions dropdown styling ──────── */
8446
+
8447
+ /* Shopify Polaris (ActionList inside Popover) */
8448
+ .eg-theme-polaris .eg-context-menu,
8449
+ .eg-theme-polaris .eg-context-submenu {
8450
+ background: #FFFFFF;
8451
+ border: 1px solid #D2D5D8;
8452
+ border-radius: 8px;
8453
+ box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09), 0 1px 3px rgba(0, 0, 0, 0.05);
8454
+ padding: 4px;
8455
+ font-family: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
8456
+ color: #202223;
8457
+ }
8458
+ .eg-theme-polaris .eg-context-item {
8459
+ margin: 1px 0;
8460
+ padding: 6px 10px;
8461
+ border-radius: 6px;
8462
+ font-size: 13px;
8463
+ font-weight: 450;
8464
+ color: #202223;
8465
+ }
8466
+ .eg-theme-polaris .eg-context-item:hover {
8467
+ background: #F1F2F4;
8468
+ color: #202223;
8469
+ }
8470
+ .eg-theme-polaris .eg-context-item-active {
8471
+ color: #008060;
8472
+ font-weight: 600;
8473
+ }
8474
+ .eg-theme-polaris .eg-context-separator {
8475
+ height: 1px;
8476
+ background: #E1E3E5;
8477
+ margin: 4px 2px;
8478
+ }
8479
+ .eg-theme-polaris .eg-context-submenu-parent::after {
8480
+ color: #6D7175;
8481
+ }
8482
+ .eg-theme-polaris .eg-sort-menu .eg-context-item {
8483
+ padding-left: 22px;
8484
+ }
8485
+
8486
+ /* Ant Design 5 (Clean 8px rounded popup with subtle hover) */
8487
+ .eg-theme-antd .eg-context-menu,
8488
+ .eg-theme-antd .eg-context-submenu {
8489
+ background: #FFFFFF;
8490
+ border: 1px solid rgba(5, 5, 5, 0.06);
8491
+ border-radius: 8px;
8492
+ box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
8493
+ padding: 4px;
8494
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
8495
+ color: rgba(0, 0, 0, 0.88);
8496
+ }
8497
+ .eg-theme-antd .eg-context-item {
8498
+ margin: 1px 0;
8499
+ padding: 5px 12px;
8500
+ border-radius: 4px;
8501
+ font-size: 13px;
8502
+ color: rgba(0, 0, 0, 0.88);
8503
+ }
8504
+ .eg-theme-antd .eg-context-item:hover {
8505
+ background: rgba(0, 0, 0, 0.04);
8506
+ color: rgba(0, 0, 0, 0.88);
8507
+ }
8508
+ .eg-theme-antd .eg-context-item-active {
8509
+ color: #1677FF;
8510
+ font-weight: 600;
8511
+ }
8512
+ .eg-theme-antd .eg-context-separator {
8513
+ height: 1px;
8514
+ background: rgba(5, 5, 5, 0.06);
8515
+ margin: 4px 0;
8516
+ }
8517
+ .eg-theme-antd .eg-context-submenu-parent::after {
8518
+ color: rgba(0, 0, 0, 0.45);
8519
+ }
8520
+ .eg-theme-antd .eg-sort-menu .eg-context-item {
8521
+ padding-left: 22px;
8522
+ }
8523
+
8524
+ /* Material Design 3 (Elevated surface with blue accents) */
8525
+ .eg-theme-material .eg-context-menu,
8526
+ .eg-theme-material .eg-context-submenu {
8527
+ background: #FFFFFF;
8528
+ border: 1px solid #BBDEFB;
8529
+ border-radius: 8px;
8530
+ box-shadow: 0 4px 16px rgba(21, 101, 192, 0.15), 0 1px 4px rgba(21, 101, 192, 0.10);
8531
+ padding: 6px 0;
8532
+ font-family: 'Roboto', 'Google Sans', Arial, sans-serif;
8533
+ color: #1E3A5F;
8534
+ }
8535
+ .eg-theme-material .eg-context-item {
8536
+ margin: 0;
8537
+ padding: 7px 16px;
8538
+ border-radius: 0;
8539
+ font-size: 13px;
8540
+ color: #1E3A5F;
8541
+ }
8542
+ .eg-theme-material .eg-context-item:hover {
8543
+ background: #DBEAFE;
8544
+ color: #1565C0;
8545
+ }
8546
+ .eg-theme-material .eg-context-item-active {
8547
+ color: #1565C0;
8548
+ font-weight: 600;
8549
+ }
8550
+ .eg-theme-material .eg-context-separator {
8551
+ height: 1px;
8552
+ background: #E2EDF8;
8553
+ margin: 4px 0;
8554
+ }
8555
+ .eg-theme-material .eg-context-submenu-parent::after {
8556
+ color: #4B7BA8;
8557
+ }
8558
+ .eg-theme-material .eg-sort-menu .eg-context-item {
8559
+ padding-left: 22px;
8560
+ }
8561
+
8562
+ /* Fluent UI / Office 365 (Warm gray, subtle hover) */
8563
+ .eg-theme-fluent .eg-context-menu,
8564
+ .eg-theme-fluent .eg-context-submenu {
8565
+ background: #FFFFFF;
8566
+ border: 1px solid #D2D0CE;
8567
+ border-radius: 4px;
8568
+ box-shadow: 0 6.4px 14.4px 0 rgba(0, 0, 0, 0.13), 0 1.2px 3.6px 0 rgba(0, 0, 0, 0.11);
8569
+ padding: 4px 0;
8570
+ font-family: 'Segoe UI', Calibri, Arial, sans-serif;
8571
+ color: #323130;
8572
+ }
8573
+ .eg-theme-fluent .eg-context-item {
8574
+ margin: 0;
8575
+ padding: 6px 14px;
8576
+ border-radius: 0;
8577
+ font-size: 13px;
8578
+ color: #323130;
8579
+ }
8580
+ .eg-theme-fluent .eg-context-item:hover {
8581
+ background: #F3F2F1;
8582
+ color: #201F1E;
8583
+ }
8584
+ .eg-theme-fluent .eg-context-item-active {
8585
+ color: #0078D4;
8586
+ font-weight: 600;
8587
+ }
8588
+ .eg-theme-fluent .eg-context-separator {
8589
+ height: 1px;
8590
+ background: #EDEBE9;
8591
+ margin: 4px 0;
8592
+ }
8593
+ .eg-theme-fluent .eg-context-submenu-parent::after {
8594
+ color: #605E5C;
8595
+ }
8596
+ .eg-theme-fluent .eg-sort-menu .eg-context-item {
8597
+ padding-left: 22px;
8598
+ }
8599
+
8600
+ /* IBM Carbon (Industrial 0px radius, left-border hover indicator) */
8601
+ .eg-theme-carbon .eg-context-menu,
8602
+ .eg-theme-carbon .eg-context-submenu {
8603
+ background: #FFFFFF;
8604
+ border: 1px solid #C6C6C6;
8605
+ border-radius: 0px;
8606
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.30);
8607
+ padding: 0;
8608
+ font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
8609
+ color: #161616;
8610
+ }
8611
+ .eg-theme-carbon .eg-context-item {
8612
+ margin: 0;
8613
+ padding: 8px 16px;
8614
+ border-radius: 0;
8615
+ font-size: 14px;
8616
+ color: #161616;
8617
+ border-left: 3px solid transparent;
8618
+ }
8619
+ .eg-theme-carbon .eg-context-item:hover {
8620
+ background: #E8E8E8;
8621
+ color: #161616;
8622
+ border-left-color: #0F62FE;
8623
+ }
8624
+ .eg-theme-carbon .eg-context-item-active {
8625
+ color: #0F62FE;
8626
+ font-weight: 600;
8627
+ }
8628
+ .eg-theme-carbon .eg-context-separator {
8629
+ height: 1px;
8630
+ background: #E0E0E0;
8631
+ margin: 0;
8632
+ }
8633
+ .eg-theme-carbon .eg-context-submenu-parent::after {
8634
+ color: #525252;
8635
+ }
8636
+ .eg-theme-carbon .eg-sort-menu .eg-context-item {
8637
+ padding-left: 22px;
8638
+ }
8639
+
8640
+ /* Excel 365 (Clean spreadsheet classic style) */
8641
+ .eg-theme-excel .eg-context-menu,
8642
+ .eg-theme-excel .eg-context-submenu {
8643
+ background: #FFFFFF;
8644
+ border: 1px solid #D9D9D9;
8645
+ border-radius: 4px;
8646
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
8647
+ padding: 4px 0;
8648
+ color: #000000;
8649
+ }
8650
+ .eg-theme-excel .eg-context-item {
8651
+ margin: 0;
8652
+ padding: 6px 16px;
8653
+ border-radius: 0;
8654
+ font-size: 13px;
8655
+ color: #000000;
8656
+ }
8657
+ .eg-theme-excel .eg-context-item:hover {
8658
+ background: #E2EFDA;
8659
+ color: #185A30;
8660
+ }
8661
+ .eg-theme-excel .eg-context-item-active {
8662
+ color: #217346;
8663
+ font-weight: 600;
8664
+ }
8665
+ .eg-theme-excel .eg-context-separator {
8666
+ height: 1px;
8667
+ background: #E0E0E0;
8668
+ margin: 4px 0;
8669
+ }
8670
+
8671
+ /* Dark Mode (unified dark container & theme dark accents) */
8672
+ .eg-shell.eg-dark .eg-context-menu,
8673
+ .eg-shell.eg-dark .eg-context-submenu {
8674
+ background: #202123;
8675
+ border-color: #383838;
8676
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
8677
+ color: #D4D4D4;
8678
+ }
8679
+ .eg-shell.eg-dark .eg-context-item {
8680
+ color: #D4D4D4;
8681
+ }
8682
+ .eg-shell.eg-dark .eg-context-item:hover {
8683
+ background: #2D2F31;
8684
+ color: #FFFFFF;
8685
+ }
8686
+ .eg-shell.eg-dark .eg-context-separator {
8687
+ background: #383838;
8688
+ }
8689
+ .eg-shell.eg-dark .eg-context-submenu-parent::after {
8690
+ color: #A0A0A0;
8691
+ }
8692
+
8693
+ .eg-shell.eg-theme-polaris.eg-dark .eg-context-menu,
8694
+ .eg-shell.eg-theme-polaris.eg-dark .eg-context-submenu {
8695
+ background: #202123;
8696
+ border-color: #383D40;
8697
+ }
8698
+ .eg-shell.eg-theme-polaris.eg-dark .eg-context-item:hover {
8699
+ background: #2A2D30;
8700
+ color: #FFFFFF;
8701
+ }
8702
+ .eg-shell.eg-theme-polaris.eg-dark .eg-context-item-active {
8703
+ color: #00A67E;
8704
+ }
8705
+ .eg-shell.eg-theme-polaris.eg-dark .eg-context-separator {
8706
+ background: #383D40;
8707
+ }
8708
+
8709
+ .eg-shell.eg-theme-antd.eg-dark .eg-context-menu,
8710
+ .eg-shell.eg-theme-antd.eg-dark .eg-context-submenu {
8711
+ background: #1F1F1F;
8712
+ border-color: #303030;
8713
+ }
8714
+ .eg-shell.eg-theme-antd.eg-dark .eg-context-item:hover {
8715
+ background: rgba(255, 255, 255, 0.08);
8716
+ color: #FFFFFF;
8717
+ }
8718
+ .eg-shell.eg-theme-antd.eg-dark .eg-context-item-active {
8719
+ color: #1668DC;
8720
+ }
8721
+ .eg-shell.eg-theme-antd.eg-dark .eg-context-separator {
8722
+ background: #303030;
8723
+ }
8724
+
8725
+ .eg-shell.eg-theme-material.eg-dark .eg-context-menu,
8726
+ .eg-shell.eg-theme-material.eg-dark .eg-context-submenu {
8727
+ background: #19222D;
8728
+ border-color: #2A3A4D;
8729
+ }
8730
+ .eg-shell.eg-theme-material.eg-dark .eg-context-item:hover {
8731
+ background: #243447;
8732
+ color: #90CAF9;
8733
+ }
8734
+ .eg-shell.eg-theme-material.eg-dark .eg-context-item-active {
8735
+ color: #90CAF9;
8736
+ }
8737
+ .eg-shell.eg-theme-material.eg-dark .eg-context-separator {
8738
+ background: #2A3A4D;
8739
+ }
8740
+
8741
+ .eg-shell.eg-theme-fluent.eg-dark .eg-context-menu,
8742
+ .eg-shell.eg-theme-fluent.eg-dark .eg-context-submenu {
8743
+ background: #252423;
8744
+ border-color: #3B3A39;
8745
+ }
8746
+ .eg-shell.eg-theme-fluent.eg-dark .eg-context-item:hover {
8747
+ background: #323130;
8748
+ color: #FFFFFF;
8749
+ }
8750
+ .eg-shell.eg-theme-fluent.eg-dark .eg-context-item-active {
8751
+ color: #2886DE;
8752
+ }
8753
+ .eg-shell.eg-theme-fluent.eg-dark .eg-context-separator {
8754
+ background: #3B3A39;
8755
+ }
8756
+
8757
+ .eg-shell.eg-theme-carbon.eg-dark .eg-context-menu,
8758
+ .eg-shell.eg-theme-carbon.eg-dark .eg-context-submenu {
8759
+ background: #262626;
8760
+ border-color: #393939;
8761
+ }
8762
+ .eg-shell.eg-theme-carbon.eg-dark .eg-context-item:hover {
8763
+ background: #353535;
8764
+ color: #FFFFFF;
8765
+ border-left-color: #4589FF;
8766
+ }
8767
+ .eg-shell.eg-theme-carbon.eg-dark .eg-context-item-active {
8768
+ color: #4589FF;
8769
+ }
8770
+ .eg-shell.eg-theme-carbon.eg-dark .eg-context-separator {
8771
+ background: #393939;
8772
+ }
8773
+
8277
8774
  /* devMode — column/row info modal */
8278
8775
  .eg-info-modal-backdrop {
8279
8776
  position: fixed;
@@ -9008,6 +9505,23 @@ export default ExcelGridComponent
9008
9505
  font-size: 14px;
9009
9506
  padding: 8px 14px;
9010
9507
  }
9508
+ /* Theme enhancements for EgSelect / EgTreeSelect dropdowns */
9509
+ .eg-theme-polaris .eg-select-dropdown {
9510
+ padding: 4px;
9511
+ }
9512
+ .eg-theme-polaris .eg-select-option {
9513
+ margin: 1px 0;
9514
+ border-radius: 6px;
9515
+ padding: 6px 10px;
9516
+ }
9517
+ .eg-theme-antd .eg-select-dropdown {
9518
+ padding: 4px;
9519
+ }
9520
+ .eg-theme-antd .eg-select-option {
9521
+ margin: 1px 0;
9522
+ border-radius: 4px;
9523
+ padding: 5px 12px;
9524
+ }
9011
9525
  .eg-select-dot {
9012
9526
  width: 9px;
9013
9527
  height: 9px;
package/src/config.js ADDED
@@ -0,0 +1,22 @@
1
+ import Vue from 'vue'
2
+
3
+ const state = (Vue && typeof Vue.observable === 'function')
4
+ ? Vue.observable({ darkMode: null })
5
+ : { darkMode: null }
6
+
7
+ export const globalConfig = state
8
+
9
+ /**
10
+ * Update global vue2-excel-grid configuration reactively.
11
+ * @param {Object} options
12
+ */
13
+ export function setGlobalGridConfig(options = {}) {
14
+ if (options && typeof options === 'object') {
15
+ Object.keys(options).forEach(key => {
16
+ globalConfig[key] = options[key]
17
+ })
18
+ }
19
+ }
20
+
21
+ export const setGlobalConfig = setGlobalGridConfig
22
+
package/src/index.js CHANGED
@@ -3,15 +3,17 @@ import EgCheckbox from './components/EgCheckbox.vue'
3
3
  import EgSelect from './components/EgSelect.vue'
4
4
  import EgTreeSelect from './components/EgTreeSelect.vue'
5
5
  import { version } from '../package.json'
6
+ import { globalConfig, setGlobalGridConfig, setGlobalConfig } from './config.js'
6
7
 
7
- export { ExcelGrid, EgCheckbox, EgSelect, EgTreeSelect, version }
8
+ export { ExcelGrid, EgCheckbox, EgSelect, EgTreeSelect, version, globalConfig, setGlobalGridConfig, setGlobalConfig }
8
9
 
9
10
  export default {
10
11
  version,
11
12
  install(Vue, options = {}) {
12
13
  if (options && typeof options === 'object') {
13
14
  Object.keys(options).forEach(key => {
14
- if (ExcelGrid.props && ExcelGrid.props[key] !== undefined) {
15
+ globalConfig[key] = options[key]
16
+ if (key !== 'darkMode' && ExcelGrid.props && ExcelGrid.props[key] !== undefined) {
15
17
  const val = options[key]
16
18
  if (typeof ExcelGrid.props[key] !== 'object') {
17
19
  // Convert to object notation if it was just a constructor like `props: { fitColumns: Boolean }`
@@ -21,6 +23,7 @@ export default {
21
23
  }
22
24
  })
23
25
  }
26
+ Vue.prototype.$excelGridConfig = globalConfig
24
27
  Vue.component('Vue2ExcelGrid', ExcelGrid)
25
28
  Vue.component('Vue2EgCheckbox', EgCheckbox)
26
29
  Vue.component('Vue2EgSelect', EgSelect)