7243044a6efc7e5966e5f3a271960c5d8d95a20ed676da972430ad18c2c7bb1214f5963d0da6c5eeabcab8beac8dd3d7d9347a83479a16da7d6a836a77510f 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { inject, computed } from 'vue';
  2. import { TABLE_INJECTION_KEY } from '../tokens.mjs';
  3. function useMapState() {
  4. const table = inject(TABLE_INJECTION_KEY);
  5. const store = table == null ? void 0 : table.store;
  6. const leftFixedLeafCount = computed(() => {
  7. var _a;
  8. return (_a = store == null ? void 0 : store.states.fixedLeafColumnsLength.value) != null ? _a : 0;
  9. });
  10. const rightFixedLeafCount = computed(() => {
  11. var _a;
  12. return (_a = store == null ? void 0 : store.states.rightFixedColumns.value.length) != null ? _a : 0;
  13. });
  14. const columnsCount = computed(() => {
  15. var _a;
  16. return (_a = store == null ? void 0 : store.states.columns.value.length) != null ? _a : 0;
  17. });
  18. const leftFixedCount = computed(() => {
  19. var _a;
  20. return (_a = store == null ? void 0 : store.states.fixedColumns.value.length) != null ? _a : 0;
  21. });
  22. const rightFixedCount = computed(() => {
  23. var _a;
  24. return (_a = store == null ? void 0 : store.states.rightFixedColumns.value.length) != null ? _a : 0;
  25. });
  26. return {
  27. leftFixedLeafCount,
  28. rightFixedLeafCount,
  29. columnsCount,
  30. leftFixedCount,
  31. rightFixedCount,
  32. columns: computed(() => {
  33. var _a;
  34. return (_a = store == null ? void 0 : store.states.columns.value) != null ? _a : [];
  35. })
  36. };
  37. }
  38. export { useMapState as default };
  39. //# sourceMappingURL=mapState-helper.mjs.map