mapState-helper.mjs 918 B

12345678910111213141516171819202122232425262728
  1. import { TABLE_INJECTION_KEY } from "../tokens.mjs";
  2. import { computed, inject } from "vue";
  3. //#region ../../packages/components/table/src/table-footer/mapState-helper.ts
  4. function useMapState() {
  5. const store = inject(TABLE_INJECTION_KEY)?.store;
  6. return {
  7. leftFixedLeafCount: computed(() => {
  8. return store?.states.fixedLeafColumnsLength.value ?? 0;
  9. }),
  10. rightFixedLeafCount: computed(() => {
  11. return store?.states.rightFixedColumns.value.length ?? 0;
  12. }),
  13. columnsCount: computed(() => {
  14. return store?.states.columns.value.length ?? 0;
  15. }),
  16. leftFixedCount: computed(() => {
  17. return store?.states.fixedColumns.value.length ?? 0;
  18. }),
  19. rightFixedCount: computed(() => {
  20. return store?.states.rightFixedColumns.value.length ?? 0;
  21. }),
  22. columns: computed(() => store?.states.columns.value ?? [])
  23. };
  24. }
  25. //#endregion
  26. export { useMapState as default };
  27. //# sourceMappingURL=mapState-helper.mjs.map