mapState-helper.mjs 970 B

123456789101112131415161718192021222324252627282930313233
  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. return store.states.fixedLeafColumnsLength.value;
  8. });
  9. const rightFixedLeafCount = computed(() => {
  10. return store.states.rightFixedColumns.value.length;
  11. });
  12. const columnsCount = computed(() => {
  13. return store.states.columns.value.length;
  14. });
  15. const leftFixedCount = computed(() => {
  16. return store.states.fixedColumns.value.length;
  17. });
  18. const rightFixedCount = computed(() => {
  19. return store.states.rightFixedColumns.value.length;
  20. });
  21. return {
  22. leftFixedLeafCount,
  23. rightFixedLeafCount,
  24. columnsCount,
  25. leftFixedCount,
  26. rightFixedCount,
  27. columns: store.states.columns
  28. };
  29. }
  30. export { useMapState as default };
  31. //# sourceMappingURL=mapState-helper.mjs.map