uomtiles 0.1.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/.output/nitro.json +15 -0
- package/.output/public/_nuxt/1d1PDhA4.js +1 -0
- package/.output/public/_nuxt/3B2XYGg4.js +1 -0
- package/.output/public/_nuxt/981KwFWf.js +1 -0
- package/.output/public/_nuxt/B30dSvM4.js +1 -0
- package/.output/public/_nuxt/BN1Gp4Dm.js +1 -0
- package/.output/public/_nuxt/BQlj8Xoe.js +6 -0
- package/.output/public/_nuxt/BRkljK8J.js +1 -0
- package/.output/public/_nuxt/BSdHYVlE2.js +1 -0
- package/.output/public/_nuxt/B_MqTg2k2.js +1 -0
- package/.output/public/_nuxt/BiWblTbb2.js +64 -0
- package/.output/public/_nuxt/BrPwntMr.js +1 -0
- package/.output/public/_nuxt/BskybydR.js +1 -0
- package/.output/public/_nuxt/ByRlKR9F.js +1 -0
- package/.output/public/_nuxt/C0Zdl2EE2.js +1 -0
- package/.output/public/_nuxt/C4qlzA4o.js +1 -0
- package/.output/public/_nuxt/C7HxHbxA.js +1 -0
- package/.output/public/_nuxt/C97TfNgP.js +3 -0
- package/.output/public/_nuxt/CNs_Ozdc.js +1 -0
- package/.output/public/_nuxt/CPuhwLY1.js +1 -0
- package/.output/public/_nuxt/CVE291Pi.js +1 -0
- package/.output/public/_nuxt/C_0VY3Cv2.js +4 -0
- package/.output/public/_nuxt/Ce26t8_Y.js +1 -0
- package/.output/public/_nuxt/CfW544W5.js +1 -0
- package/.output/public/_nuxt/CgMd2Y5s.js +2 -0
- package/.output/public/_nuxt/CgdzV712.js +1 -0
- package/.output/public/_nuxt/D1wVNWS0.js +1 -0
- package/.output/public/_nuxt/DC3bhq63.js +1 -0
- package/.output/public/_nuxt/DK3Fl9T5.js +1 -0
- package/.output/public/_nuxt/DL1MZZLI.js +1 -0
- package/.output/public/_nuxt/DXm-42Fi.js +1 -0
- package/.output/public/_nuxt/Djg3Kzfv.js +1 -0
- package/.output/public/_nuxt/DkcySee1.js +1 -0
- package/.output/public/_nuxt/DmN-PKW1.js +1 -0
- package/.output/public/_nuxt/DtFVCXI9.js +1 -0
- package/.output/public/_nuxt/Dz7VMlHR.js +1 -0
- package/.output/public/_nuxt/NL65vbjG2.js +1 -0
- package/.output/public/_nuxt/Oxy7pKSk.js +3 -0
- package/.output/public/_nuxt/Pik8or8N2.js +1 -0
- package/.output/public/_nuxt/XZ59tThl.js +1 -0
- package/.output/public/_nuxt/ZpWjFsgV.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/9f85104e-738d-4a74-8daa-40b136ce17d5.json +1 -0
- package/.output/public/_nuxt/dXz6dFgW2.js +1 -0
- package/.output/public/_nuxt/entry.P6tFNE31.css +1 -0
- package/.output/public/_nuxt/error-404.Biv0P6cJ.css +1 -0
- package/.output/public/_nuxt/error-500.8ok468rV.css +1 -0
- package/.output/public/_nuxt/j0MRD-c3.js +1 -0
- package/.output/public/_nuxt/local-pixel-diff.worker-C6RdZoCq.js +2 -0
- package/.output/public/_nuxt/maplibre-gl-worker.nfnkSQvL.mjs +6 -0
- package/.output/public/_nuxt/nearest-area.worker-iSLH0Y_s.js +2 -0
- package/.output/public/_nuxt/q7DkoVkj.js +828 -0
- package/.output/public/_nuxt/raster-tile.worker-BFlOgJig.js +2 -0
- package/.output/public/_nuxt/services._3nQizF8.css +1 -0
- package/.output/public/_nuxt/sql-wasm.DfANybxk.wasm +0 -0
- package/.output/public/_nuxt/tile-diff.worker-CvWWI_eu.js +1 -0
- package/.output/public/_nuxt/zZ1EGR7Y.js +1 -0
- package/.output/public/apple-touch-icon.png +0 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/favicon.svg +8 -0
- package/.output/public/icon-192.png +0 -0
- package/.output/public/icon-512.png +0 -0
- package/.output/public/site.webmanifest +11 -0
- package/.output/server/chunks/_/config.mjs +208 -0
- package/.output/server/chunks/_/config.mjs.map +1 -0
- package/.output/server/chunks/_/data-directory.mjs +24 -0
- package/.output/server/chunks/_/data-directory.mjs.map +1 -0
- package/.output/server/chunks/_/error-500.mjs +20 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -0
- package/.output/server/chunks/_/file-workspace.mjs +910 -0
- package/.output/server/chunks/_/file-workspace.mjs.map +1 -0
- package/.output/server/chunks/_/icons.mjs +6269 -0
- package/.output/server/chunks/_/icons.mjs.map +1 -0
- package/.output/server/chunks/_/map-service.mjs +233 -0
- package/.output/server/chunks/_/map-service.mjs.map +1 -0
- package/.output/server/chunks/_/missing-tile.mjs +104 -0
- package/.output/server/chunks/_/missing-tile.mjs.map +1 -0
- package/.output/server/chunks/_/pixel-diff.mjs +78 -0
- package/.output/server/chunks/_/pixel-diff.mjs.map +1 -0
- package/.output/server/chunks/_/uom-auth.mjs +334 -0
- package/.output/server/chunks/_/uom-auth.mjs.map +1 -0
- package/.output/server/chunks/_/uom-map.mjs +265 -0
- package/.output/server/chunks/_/uom-map.mjs.map +1 -0
- package/.output/server/chunks/build/Alert-0ngTJXxP.mjs +5076 -0
- package/.output/server/chunks/build/Alert-0ngTJXxP.mjs.map +1 -0
- package/.output/server/chunks/build/DashboardSidebarToggle-pncTaIJq.mjs +569 -0
- package/.output/server/chunks/build/DashboardSidebarToggle-pncTaIJq.mjs.map +1 -0
- package/.output/server/chunks/build/Empty-CkW3mADt.mjs +359 -0
- package/.output/server/chunks/build/Empty-CkW3mADt.mjs.map +1 -0
- package/.output/server/chunks/build/FocusScope-Cf0lg0zt.mjs +207 -0
- package/.output/server/chunks/build/FocusScope-Cf0lg0zt.mjs.map +1 -0
- package/.output/server/chunks/build/FormField-CEUZHcv7.mjs +278 -0
- package/.output/server/chunks/build/FormField-CEUZHcv7.mjs.map +1 -0
- package/.output/server/chunks/build/Input-BeNavYXb.mjs +592 -0
- package/.output/server/chunks/build/Input-BeNavYXb.mjs.map +1 -0
- package/.output/server/chunks/build/MapBaseLayerTabs-4445J6yh.mjs +2003 -0
- package/.output/server/chunks/build/MapBaseLayerTabs-4445J6yh.mjs.map +1 -0
- package/.output/server/chunks/build/Modal-DNZtVxca.mjs +1326 -0
- package/.output/server/chunks/build/Modal-DNZtVxca.mjs.map +1 -0
- package/.output/server/chunks/build/OnlineMap-CKwiuqUY.mjs +146 -0
- package/.output/server/chunks/build/OnlineMap-CKwiuqUY.mjs.map +1 -0
- package/.output/server/chunks/build/Pagination-CDHx4HTZ.mjs +1025 -0
- package/.output/server/chunks/build/Pagination-CDHx4HTZ.mjs.map +1 -0
- package/.output/server/chunks/build/PopperArrow-Bqfdf2Et.mjs +2066 -0
- package/.output/server/chunks/build/PopperArrow-Bqfdf2Et.mjs.map +1 -0
- package/.output/server/chunks/build/ScrollArea-BQK3em8b.mjs +379 -0
- package/.output/server/chunks/build/ScrollArea-BQK3em8b.mjs.map +1 -0
- package/.output/server/chunks/build/Slider-D-n8Y0CX.mjs +1087 -0
- package/.output/server/chunks/build/Slider-D-n8Y0CX.mjs.map +1 -0
- package/.output/server/chunks/build/Tooltip-CkpSktvJ.mjs +1345 -0
- package/.output/server/chunks/build/Tooltip-CkpSktvJ.mjs.map +1 -0
- package/.output/server/chunks/build/_virtual_public-CeOptKUP.mjs +7 -0
- package/.output/server/chunks/build/_virtual_public-CeOptKUP.mjs.map +1 -0
- package/.output/server/chunks/build/advanced-D1onodoF.mjs +1430 -0
- package/.output/server/chunks/build/advanced-D1onodoF.mjs.map +1 -0
- package/.output/server/chunks/build/compare-DmSAW8oA.mjs +1093 -0
- package/.output/server/chunks/build/compare-DmSAW8oA.mjs.map +1 -0
- package/.output/server/chunks/build/dashboard-BJxrZ19n.mjs +3217 -0
- package/.output/server/chunks/build/dashboard-BJxrZ19n.mjs.map +1 -0
- package/.output/server/chunks/build/details-CBMqXYyo.mjs +3714 -0
- package/.output/server/chunks/build/details-CBMqXYyo.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-D9aQjJRn.mjs +86 -0
- package/.output/server/chunks/build/error-404-D9aQjJRn.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-styles.DciiguV6.mjs +9 -0
- package/.output/server/chunks/build/error-404-styles.DciiguV6.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-BNyA3wrb.mjs +74 -0
- package/.output/server/chunks/build/error-500-BNyA3wrb.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-styles.C562DYMR.mjs +9 -0
- package/.output/server/chunks/build/error-500-styles.C562DYMR.mjs.map +1 -0
- package/.output/server/chunks/build/esm-Dp2lJXbp.mjs +1121 -0
- package/.output/server/chunks/build/esm-Dp2lJXbp.mjs.map +1 -0
- package/.output/server/chunks/build/interval-BxUMpo78.mjs +411 -0
- package/.output/server/chunks/build/interval-BxUMpo78.mjs.map +1 -0
- package/.output/server/chunks/build/login-lbtjN0MV.mjs +642 -0
- package/.output/server/chunks/build/login-lbtjN0MV.mjs.map +1 -0
- package/.output/server/chunks/build/pages-Ba0Eixbd.mjs +220 -0
- package/.output/server/chunks/build/pages-Ba0Eixbd.mjs.map +1 -0
- package/.output/server/chunks/build/services-DuJwjAB8.mjs +3005 -0
- package/.output/server/chunks/build/services-DuJwjAB8.mjs.map +1 -0
- package/.output/server/chunks/build/services-styles.eoO16BY9.mjs +9 -0
- package/.output/server/chunks/build/services-styles.eoO16BY9.mjs.map +1 -0
- package/.output/server/chunks/build/tasks-CyN9x492.mjs +915 -0
- package/.output/server/chunks/build/tasks-CyN9x492.mjs.map +1 -0
- package/.output/server/chunks/build/tasks-D_Q5EDnn.mjs +87 -0
- package/.output/server/chunks/build/tasks-D_Q5EDnn.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +6215 -0
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/captcha.post.mjs +21 -0
- package/.output/server/chunks/routes/api/auth/captcha.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/login.post.mjs +27 -0
- package/.output/server/chunks/routes/api/auth/login.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/logout.post.mjs +22 -0
- package/.output/server/chunks/routes/api/auth/logout.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/map-token.post.mjs +22 -0
- package/.output/server/chunks/routes/api/auth/map-token.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/send-sms.post.mjs +31 -0
- package/.output/server/chunks/routes/api/auth/send-sms.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/auth/status.get.mjs +21 -0
- package/.output/server/chunks/routes/api/auth/status.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map/base/_baseLayer/_zoom/_tileX/_tileY_.get.mjs +44 -0
- package/.output/server/chunks/routes/api/map/base/_baseLayer/_zoom/_tileX/_tileY_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map/live/status.get.mjs +32 -0
- package/.output/server/chunks/routes/api/map/live/status.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map/online/_layerGroup/_zoom/_tileX/_tileY_.get.mjs +48 -0
- package/.output/server/chunks/routes/api/map/online/_layerGroup/_zoom/_tileX/_tileY_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map/online-root/_layerGroup/_rootX/_rootY_.get.mjs +46 -0
- package/.output/server/chunks/routes/api/map/online-root/_layerGroup/_rootX/_rootY_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map-service/config.post.mjs +38 -0
- package/.output/server/chunks/routes/api/map-service/config.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map-service/file.post.mjs +41 -0
- package/.output/server/chunks/routes/api/map-service/file.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map-service/source.post.mjs +35 -0
- package/.output/server/chunks/routes/api/map-service/source.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/map-service/status.get.mjs +32 -0
- package/.output/server/chunks/routes/api/map-service/status.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename/analysis.get.mjs +47 -0
- package/.output/server/chunks/routes/api/workspace/_filename/analysis.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename/download.get.mjs +38 -0
- package/.output/server/chunks/routes/api/workspace/_filename/download.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename/export/_format_.get.mjs +42 -0
- package/.output/server/chunks/routes/api/workspace/_filename/export/_format_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename/tile.get.mjs +48 -0
- package/.output/server/chunks/routes/api/workspace/_filename/tile.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename/tiles.get.mjs +45 -0
- package/.output/server/chunks/routes/api/workspace/_filename/tiles.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/_filename_.delete.mjs +32 -0
- package/.output/server/chunks/routes/api/workspace/_filename_.delete.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/compare/batch.get.mjs +38 -0
- package/.output/server/chunks/routes/api/workspace/compare/batch.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/compare.post.mjs +33 -0
- package/.output/server/chunks/routes/api/workspace/compare.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/fetch.post.mjs +33 -0
- package/.output/server/chunks/routes/api/workspace/fetch.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/files.get.mjs +27 -0
- package/.output/server/chunks/routes/api/workspace/files.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/files.post.mjs +38 -0
- package/.output/server/chunks/routes/api/workspace/files.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/stop.post.mjs +32 -0
- package/.output/server/chunks/routes/api/workspace/stop.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workspace/tasks.post.mjs +36 -0
- package/.output/server/chunks/routes/api/workspace/tasks.post.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +422 -0
- package/.output/server/chunks/routes/renderer.mjs.map +1 -0
- package/.output/server/chunks/routes/services/wms.get.mjs +54 -0
- package/.output/server/chunks/routes/services/wms.get.mjs.map +1 -0
- package/.output/server/chunks/routes/services/wmts.get.mjs +54 -0
- package/.output/server/chunks/routes/services/wmts.get.mjs.map +1 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
- package/.output/server/chunks/virtual/entry.mjs +18545 -0
- package/.output/server/chunks/virtual/entry.mjs.map +1 -0
- package/.output/server/chunks/virtual/precomputed.mjs +4 -0
- package/.output/server/chunks/virtual/precomputed.mjs.map +1 -0
- package/.output/server/chunks/virtual/styles.mjs +10 -0
- package/.output/server/chunks/virtual/styles.mjs.map +1 -0
- package/.output/server/index.mjs +12 -0
- package/.output/server/index.mjs.map +1 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +14611 -0
- package/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +295 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +701 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/common.js +75 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/format.js +39 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +47 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +128 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +19 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +13 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +17 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +16 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +30 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +78 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +100 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +58 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +48 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +203 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +33 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +132 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +165 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +79 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +92 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +76 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +66 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +45 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +103 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +36 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +92 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +62 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +25 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +16 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +57 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +33 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +12 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +125 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +19 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +25 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +36 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +91 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +46 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +42 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +123 -0
- package/.output/server/node_modules/@iconify/utils/lib/index.js +52 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +30 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +105 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +9 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +113 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +31 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +13 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +9 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +41 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +22 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +67 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +54 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +7 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +22 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +8 -0
- package/.output/server/node_modules/@iconify/utils/package.json +119 -0
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6801 -0
- package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +692 -0
- package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1420 -0
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1903 -0
- package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6976 -0
- package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1841 -0
- package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +904 -0
- package/.output/server/node_modules/@vue/server-renderer/package.json +53 -0
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +609 -0
- package/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
- package/.output/server/node_modules/consola/dist/core.mjs +512 -0
- package/.output/server/node_modules/consola/dist/index.mjs +651 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/.output/server/node_modules/consola/package.json +136 -0
- package/.output/server/node_modules/devalue/index.js +17 -0
- package/.output/server/node_modules/devalue/package.json +39 -0
- package/.output/server/node_modules/devalue/src/base64.js +60 -0
- package/.output/server/node_modules/devalue/src/constants.js +12 -0
- package/.output/server/node_modules/devalue/src/operations.js +193 -0
- package/.output/server/node_modules/devalue/src/parse.js +270 -0
- package/.output/server/node_modules/devalue/src/stringify.js +428 -0
- package/.output/server/node_modules/devalue/src/uneval.js +582 -0
- package/.output/server/node_modules/devalue/src/utils.js +185 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
- package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/entities/package.json +120 -0
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/.output/server/node_modules/estree-walker/package.json +37 -0
- package/.output/server/node_modules/fflate/esm/index.mjs +2710 -0
- package/.output/server/node_modules/fflate/package.json +128 -0
- package/.output/server/node_modules/fnv1a-64/dist/index.mjs +95 -0
- package/.output/server/node_modules/fnv1a-64/package.json +75 -0
- package/.output/server/node_modules/hookable/dist/index.mjs +257 -0
- package/.output/server/node_modules/hookable/package.json +53 -0
- package/.output/server/node_modules/nostics/dist/formatters/ansi.mjs +19 -0
- package/.output/server/node_modules/nostics/dist/index.mjs +187 -0
- package/.output/server/node_modules/nostics/package.json +125 -0
- package/.output/server/node_modules/object-identity/index.js +60 -0
- package/.output/server/node_modules/object-identity/package.json +40 -0
- package/.output/server/node_modules/p-limit/index.js +104 -0
- package/.output/server/node_modules/p-limit/package.json +58 -0
- package/.output/server/node_modules/pmtiles/dist/esm/index.js +2 -0
- package/.output/server/node_modules/pmtiles/package.json +50 -0
- package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/.output/server/node_modules/source-map-js/package.json +71 -0
- package/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/.output/server/node_modules/tailwindcss/dist/chunk-DCG7AFIE.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/dist/colors.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/package.json +89 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
- package/.output/server/node_modules/ufo/package.json +48 -0
- package/.output/server/node_modules/unhead/dist/client.mjs +22 -0
- package/.output/server/node_modules/unhead/dist/index.mjs +52 -0
- package/.output/server/node_modules/unhead/dist/legacy.mjs +33 -0
- package/.output/server/node_modules/unhead/dist/minify.mjs +183 -0
- package/.output/server/node_modules/unhead/dist/parser.mjs +518 -0
- package/.output/server/node_modules/unhead/dist/plugins.mjs +631 -0
- package/.output/server/node_modules/unhead/dist/scripts.node.mjs +6 -0
- package/.output/server/node_modules/unhead/dist/server.mjs +99 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BEmVMkeA.mjs +673 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BGFxPGPQ.mjs +47 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BQWSw36o.mjs +192 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Bb4d5b9h.mjs +67 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BdK3SLPN.mjs +585 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Bf_fPVYA.mjs +6 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Bm4Y6XQI.mjs +17 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.C3b2Ipoj.mjs +223 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CGPOfp5O.mjs +32 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CHEy9ana.mjs +7 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CTjuIdzk.mjs +27 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CfKy3Kuq.mjs +196 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.D7HkBzZn.mjs +59 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DNKiVLV7.mjs +400 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.MC5RsXLj.mjs +19 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.jEy9BmRq.mjs +264 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.tQnRaXfX.mjs +240 -0
- package/.output/server/node_modules/unhead/dist/stream/client.mjs +28 -0
- package/.output/server/node_modules/unhead/dist/stream/iife.mjs +2 -0
- package/.output/server/node_modules/unhead/dist/stream/server.mjs +264 -0
- package/.output/server/node_modules/unhead/dist/utils.mjs +7 -0
- package/.output/server/node_modules/unhead/package.json +179 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/vue/index.js +7 -0
- package/.output/server/node_modules/vue/index.mjs +1 -0
- package/.output/server/node_modules/vue/package.json +112 -0
- package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +278 -0
- package/.output/server/node_modules/vue-bundle-renderer/package.json +54 -0
- package/.output/server/node_modules/yocto-queue/index.js +90 -0
- package/.output/server/node_modules/yocto-queue/package.json +48 -0
- package/.output/server/node_modules/zod/index.js +4 -0
- package/.output/server/node_modules/zod/package.json +135 -0
- package/.output/server/node_modules/zod/v4/classic/checks.js +1 -0
- package/.output/server/node_modules/zod/v4/classic/coerce.js +17 -0
- package/.output/server/node_modules/zod/v4/classic/compat.js +31 -0
- package/.output/server/node_modules/zod/v4/classic/errors.js +48 -0
- package/.output/server/node_modules/zod/v4/classic/external.js +20 -0
- package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +599 -0
- package/.output/server/node_modules/zod/v4/classic/iso.js +30 -0
- package/.output/server/node_modules/zod/v4/classic/package.json +7 -0
- package/.output/server/node_modules/zod/v4/classic/parse.js +15 -0
- package/.output/server/node_modules/zod/v4/classic/schemas.js +1395 -0
- package/.output/server/node_modules/zod/v4/core/api.js +1087 -0
- package/.output/server/node_modules/zod/v4/core/checks.js +575 -0
- package/.output/server/node_modules/zod/v4/core/core.js +78 -0
- package/.output/server/node_modules/zod/v4/core/doc.js +35 -0
- package/.output/server/node_modules/zod/v4/core/errors.js +185 -0
- package/.output/server/node_modules/zod/v4/core/index.js +16 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +601 -0
- package/.output/server/node_modules/zod/v4/core/json-schema.js +1 -0
- package/.output/server/node_modules/zod/v4/core/package.json +7 -0
- package/.output/server/node_modules/zod/v4/core/parse.js +93 -0
- package/.output/server/node_modules/zod/v4/core/regexes.js +139 -0
- package/.output/server/node_modules/zod/v4/core/registries.js +51 -0
- package/.output/server/node_modules/zod/v4/core/schemas.js +2239 -0
- package/.output/server/node_modules/zod/v4/core/to-json-schema.js +448 -0
- package/.output/server/node_modules/zod/v4/core/util.js +674 -0
- package/.output/server/node_modules/zod/v4/core/versions.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/ar.js +106 -0
- package/.output/server/node_modules/zod/v4/locales/az.js +105 -0
- package/.output/server/node_modules/zod/v4/locales/be.js +156 -0
- package/.output/server/node_modules/zod/v4/locales/bg.js +120 -0
- package/.output/server/node_modules/zod/v4/locales/ca.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/cs.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/da.js +115 -0
- package/.output/server/node_modules/zod/v4/locales/de.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/el.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/en.js +113 -0
- package/.output/server/node_modules/zod/v4/locales/eo.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/es.js +132 -0
- package/.output/server/node_modules/zod/v4/locales/fa.js +114 -0
- package/.output/server/node_modules/zod/v4/locales/fi.js +112 -0
- package/.output/server/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/fr.js +125 -0
- package/.output/server/node_modules/zod/v4/locales/he.js +214 -0
- package/.output/server/node_modules/zod/v4/locales/hr.js +122 -0
- package/.output/server/node_modules/zod/v4/locales/hu.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/hy.js +147 -0
- package/.output/server/node_modules/zod/v4/locales/id.js +106 -0
- package/.output/server/node_modules/zod/v4/locales/index.js +52 -0
- package/.output/server/node_modules/zod/v4/locales/is.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/it.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ja.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/ka.js +112 -0
- package/.output/server/node_modules/zod/v4/locales/kh.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/km.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/ko.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/lt.js +203 -0
- package/.output/server/node_modules/zod/v4/locales/mk.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/ms.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/nl.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/no.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ota.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/package.json +7 -0
- package/.output/server/node_modules/zod/v4/locales/pl.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/ps.js +114 -0
- package/.output/server/node_modules/zod/v4/locales/pt.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ro.js +119 -0
- package/.output/server/node_modules/zod/v4/locales/ru.js +156 -0
- package/.output/server/node_modules/zod/v4/locales/sl.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/sv.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/ta.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/th.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/tr.js +105 -0
- package/.output/server/node_modules/zod/v4/locales/ua.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/uk.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ur.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/uz.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/vi.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/yo.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/.output/server/package.json +37 -0
- package/LICENSE +3 -0
- package/README.md +125 -0
- package/dist/src/bbox.js +55 -0
- package/dist/src/cli.js +255 -0
- package/dist/src/config.js +56 -0
- package/dist/src/core/fetch-process.js +19 -0
- package/dist/src/core/grid-renderer.js +149 -0
- package/dist/src/core/lease.js +103 -0
- package/dist/src/core/paths.js +13 -0
- package/dist/src/core/png.js +192 -0
- package/dist/src/core/raster-style.js +33 -0
- package/dist/src/core/uomtiles.js +307 -0
- package/dist/src/fetcher.js +208 -0
- package/dist/src/geographic-grid.js +162 -0
- package/dist/src/grid-crawl.js +478 -0
- package/dist/src/mask-image.js +16 -0
- package/dist/src/official-grid.js +51 -0
- package/dist/src/quality.js +30 -0
- package/dist/src/token.js +206 -0
- package/package.json +68 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +8 -0
- package/public/icon-192.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/site.webmanifest +11 -0
|
@@ -0,0 +1,3714 @@
|
|
|
1
|
+
import { ap as useFetch, _ as _sfc_main$5, d as useComponentProps, e as useLocale, f as useAppConfig, ax as createRef, t as tv, l as createReusableTemplate, g as useForwardProps, r as reactivePick, P as Primitive } from '../virtual/entry.mjs';
|
|
2
|
+
import { u as useVirtualizer } from './esm-Dp2lJXbp.mjs';
|
|
3
|
+
import { _ as _sfc_main$1 } from './Pagination-CDHx4HTZ.mjs';
|
|
4
|
+
import { u as useFileWorkspace, _ as _sfc_main$2 } from './Empty-CkW3mADt.mjs';
|
|
5
|
+
import { defineComponent, ref, computed, withAsyncContext, watch, unref, mergeProps, isRef, useSlots, useModel, useTemplateRef, toRef, withCtx, createVNode, openBlock, createBlock, Fragment, renderList, renderSlot, createCommentVNode, createTextVNode, toDisplayString, mergeModels, shallowRef, watchEffect, h, useSSRContext } from 'vue';
|
|
6
|
+
import { Q as upperFirst, D as defu } from '../nitro/nitro.mjs';
|
|
7
|
+
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderAttr, ssrRenderClass, ssrRenderStyle, ssrRenderList, ssrRenderSlot } from 'vue/server-renderer';
|
|
8
|
+
import 'unhead/plugins';
|
|
9
|
+
import 'unhead/utils';
|
|
10
|
+
import '../routes/renderer.mjs';
|
|
11
|
+
import 'unhead/server';
|
|
12
|
+
import 'unhead/legacy';
|
|
13
|
+
import 'nostics';
|
|
14
|
+
import 'vue-bundle-renderer/runtime';
|
|
15
|
+
import 'devalue';
|
|
16
|
+
import 'fnv1a-64';
|
|
17
|
+
import 'object-identity';
|
|
18
|
+
import 'tailwindcss/colors';
|
|
19
|
+
import 'node:http';
|
|
20
|
+
import 'node:https';
|
|
21
|
+
import 'node:events';
|
|
22
|
+
import 'node:buffer';
|
|
23
|
+
import 'node:fs';
|
|
24
|
+
import 'node:path';
|
|
25
|
+
import 'node:crypto';
|
|
26
|
+
import 'node:url';
|
|
27
|
+
import '@iconify/utils';
|
|
28
|
+
import 'consola';
|
|
29
|
+
|
|
30
|
+
//#region node_modules/.pnpm/@tanstack+table-core@8.21.3/node_modules/@tanstack/table-core/build/lib/index.mjs
|
|
31
|
+
/**
|
|
32
|
+
* table-core
|
|
33
|
+
*
|
|
34
|
+
* Copyright (c) TanStack
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the MIT license found in the
|
|
37
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
38
|
+
*
|
|
39
|
+
* @license MIT
|
|
40
|
+
*/
|
|
41
|
+
function functionalUpdate(updater, input) {
|
|
42
|
+
return typeof updater === "function" ? updater(input) : updater;
|
|
43
|
+
}
|
|
44
|
+
function makeStateUpdater(key, instance) {
|
|
45
|
+
return (updater) => {
|
|
46
|
+
instance.setState((old) => {
|
|
47
|
+
return {
|
|
48
|
+
...old,
|
|
49
|
+
[key]: functionalUpdate(updater, old[key])
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function isFunction(d) {
|
|
55
|
+
return d instanceof Function;
|
|
56
|
+
}
|
|
57
|
+
function isNumberArray(d) {
|
|
58
|
+
return Array.isArray(d) && d.every((val) => typeof val === "number");
|
|
59
|
+
}
|
|
60
|
+
function flattenBy(arr, getChildren) {
|
|
61
|
+
const flat = [];
|
|
62
|
+
const recurse = (subArr) => {
|
|
63
|
+
subArr.forEach((item) => {
|
|
64
|
+
flat.push(item);
|
|
65
|
+
const children = getChildren(item);
|
|
66
|
+
if (children != null && children.length) recurse(children);
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
recurse(arr);
|
|
70
|
+
return flat;
|
|
71
|
+
}
|
|
72
|
+
function memo(getDeps, fn, opts) {
|
|
73
|
+
let deps = [];
|
|
74
|
+
let result;
|
|
75
|
+
return (depArgs) => {
|
|
76
|
+
let depTime;
|
|
77
|
+
if (opts.key && opts.debug) depTime = Date.now();
|
|
78
|
+
const newDeps = getDeps(depArgs);
|
|
79
|
+
if (!(newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep))) return result;
|
|
80
|
+
deps = newDeps;
|
|
81
|
+
let resultTime;
|
|
82
|
+
if (opts.key && opts.debug) resultTime = Date.now();
|
|
83
|
+
result = fn(...newDeps);
|
|
84
|
+
opts == null || opts.onChange == null || opts.onChange(result);
|
|
85
|
+
if (opts.key && opts.debug) {
|
|
86
|
+
if (opts != null && opts.debug()) {
|
|
87
|
+
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
88
|
+
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
|
|
89
|
+
const resultFpsPercentage = resultEndTime / 16;
|
|
90
|
+
const pad = (str, num) => {
|
|
91
|
+
str = String(str);
|
|
92
|
+
while (str.length < num) str = " " + str;
|
|
93
|
+
return str;
|
|
94
|
+
};
|
|
95
|
+
console.info(`%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`, `
|
|
96
|
+
font-size: .6rem;
|
|
97
|
+
font-weight: bold;
|
|
98
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120))}deg 100% 31%);`, opts == null ? void 0 : opts.key);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function getMemoOptions(tableOptions, debugLevel, key, onChange) {
|
|
105
|
+
return {
|
|
106
|
+
debug: () => {
|
|
107
|
+
var _tableOptions$debugAl;
|
|
108
|
+
return (_tableOptions$debugAl = tableOptions == null ? void 0 : tableOptions.debugAll) != null ? _tableOptions$debugAl : tableOptions[debugLevel];
|
|
109
|
+
},
|
|
110
|
+
key: false,
|
|
111
|
+
onChange
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function createCell(table, row, column, columnId) {
|
|
115
|
+
const getRenderValue = () => {
|
|
116
|
+
var _cell$getValue;
|
|
117
|
+
return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : table.options.renderFallbackValue;
|
|
118
|
+
};
|
|
119
|
+
const cell = {
|
|
120
|
+
id: `${row.id}_${column.id}`,
|
|
121
|
+
row,
|
|
122
|
+
column,
|
|
123
|
+
getValue: () => row.getValue(columnId),
|
|
124
|
+
renderValue: getRenderValue,
|
|
125
|
+
getContext: memo(() => [
|
|
126
|
+
table,
|
|
127
|
+
column,
|
|
128
|
+
row,
|
|
129
|
+
cell
|
|
130
|
+
], (table, column, row, cell) => ({
|
|
131
|
+
table,
|
|
132
|
+
column,
|
|
133
|
+
row,
|
|
134
|
+
cell,
|
|
135
|
+
getValue: cell.getValue,
|
|
136
|
+
renderValue: cell.renderValue
|
|
137
|
+
}), getMemoOptions(table.options, "debugCells"))
|
|
138
|
+
};
|
|
139
|
+
table._features.forEach((feature) => {
|
|
140
|
+
feature.createCell == null || feature.createCell(cell, column, row, table);
|
|
141
|
+
}, {});
|
|
142
|
+
return cell;
|
|
143
|
+
}
|
|
144
|
+
function createColumn(table, columnDef, depth, parent) {
|
|
145
|
+
var _ref, _resolvedColumnDef$id;
|
|
146
|
+
const resolvedColumnDef = {
|
|
147
|
+
...table._getDefaultColumnDef(),
|
|
148
|
+
...columnDef
|
|
149
|
+
};
|
|
150
|
+
const accessorKey = resolvedColumnDef.accessorKey;
|
|
151
|
+
let id = (_ref = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : accessorKey ? typeof String.prototype.replaceAll === "function" ? accessorKey.replaceAll(".", "_") : accessorKey.replace(/\./g, "_") : void 0) != null ? _ref : typeof resolvedColumnDef.header === "string" ? resolvedColumnDef.header : void 0;
|
|
152
|
+
let accessorFn;
|
|
153
|
+
if (resolvedColumnDef.accessorFn) accessorFn = resolvedColumnDef.accessorFn;
|
|
154
|
+
else if (accessorKey) {
|
|
155
|
+
if (accessorKey.includes(".")) accessorFn = (originalRow) => {
|
|
156
|
+
let result = originalRow;
|
|
157
|
+
for (const key of accessorKey.split(".")) {
|
|
158
|
+
var _result;
|
|
159
|
+
result = (_result = result) == null ? void 0 : _result[key];
|
|
160
|
+
}
|
|
161
|
+
return result;
|
|
162
|
+
};
|
|
163
|
+
else accessorFn = (originalRow) => originalRow[resolvedColumnDef.accessorKey];
|
|
164
|
+
}
|
|
165
|
+
if (!id) throw new Error();
|
|
166
|
+
let column = {
|
|
167
|
+
id: `${String(id)}`,
|
|
168
|
+
accessorFn,
|
|
169
|
+
parent,
|
|
170
|
+
depth,
|
|
171
|
+
columnDef: resolvedColumnDef,
|
|
172
|
+
columns: [],
|
|
173
|
+
getFlatColumns: memo(() => [true], () => {
|
|
174
|
+
var _column$columns;
|
|
175
|
+
return [column, ...(_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap((d) => d.getFlatColumns())];
|
|
176
|
+
}, getMemoOptions(table.options, "debugColumns")),
|
|
177
|
+
getLeafColumns: memo(() => [table._getOrderColumnsFn()], (orderColumns) => {
|
|
178
|
+
var _column$columns2;
|
|
179
|
+
if ((_column$columns2 = column.columns) != null && _column$columns2.length) return orderColumns(column.columns.flatMap((column) => column.getLeafColumns()));
|
|
180
|
+
return [column];
|
|
181
|
+
}, getMemoOptions(table.options, "debugColumns"))
|
|
182
|
+
};
|
|
183
|
+
for (const feature of table._features) feature.createColumn == null || feature.createColumn(column, table);
|
|
184
|
+
return column;
|
|
185
|
+
}
|
|
186
|
+
var debug = "debugHeaders";
|
|
187
|
+
function createHeader(table, column, options) {
|
|
188
|
+
var _options$id;
|
|
189
|
+
let header = {
|
|
190
|
+
id: (_options$id = options.id) != null ? _options$id : column.id,
|
|
191
|
+
column,
|
|
192
|
+
index: options.index,
|
|
193
|
+
isPlaceholder: !!options.isPlaceholder,
|
|
194
|
+
placeholderId: options.placeholderId,
|
|
195
|
+
depth: options.depth,
|
|
196
|
+
subHeaders: [],
|
|
197
|
+
colSpan: 0,
|
|
198
|
+
rowSpan: 0,
|
|
199
|
+
headerGroup: null,
|
|
200
|
+
getLeafHeaders: () => {
|
|
201
|
+
const leafHeaders = [];
|
|
202
|
+
const recurseHeader = (h) => {
|
|
203
|
+
if (h.subHeaders && h.subHeaders.length) h.subHeaders.map(recurseHeader);
|
|
204
|
+
leafHeaders.push(h);
|
|
205
|
+
};
|
|
206
|
+
recurseHeader(header);
|
|
207
|
+
return leafHeaders;
|
|
208
|
+
},
|
|
209
|
+
getContext: () => ({
|
|
210
|
+
table,
|
|
211
|
+
header,
|
|
212
|
+
column
|
|
213
|
+
})
|
|
214
|
+
};
|
|
215
|
+
table._features.forEach((feature) => {
|
|
216
|
+
feature.createHeader == null || feature.createHeader(header, table);
|
|
217
|
+
});
|
|
218
|
+
return header;
|
|
219
|
+
}
|
|
220
|
+
var Headers = { createTable: (table) => {
|
|
221
|
+
table.getHeaderGroups = memo(() => [
|
|
222
|
+
table.getAllColumns(),
|
|
223
|
+
table.getVisibleLeafColumns(),
|
|
224
|
+
table.getState().columnPinning.left,
|
|
225
|
+
table.getState().columnPinning.right
|
|
226
|
+
], (allColumns, leafColumns, left, right) => {
|
|
227
|
+
var _left$map$filter, _right$map$filter;
|
|
228
|
+
const leftColumns = (_left$map$filter = left == null ? void 0 : left.map((columnId) => leafColumns.find((d) => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
|
|
229
|
+
const rightColumns = (_right$map$filter = right == null ? void 0 : right.map((columnId) => leafColumns.find((d) => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];
|
|
230
|
+
const centerColumns = leafColumns.filter((column) => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
|
|
231
|
+
return buildHeaderGroups(allColumns, [
|
|
232
|
+
...leftColumns,
|
|
233
|
+
...centerColumns,
|
|
234
|
+
...rightColumns
|
|
235
|
+
], table);
|
|
236
|
+
}, getMemoOptions(table.options, debug));
|
|
237
|
+
table.getCenterHeaderGroups = memo(() => [
|
|
238
|
+
table.getAllColumns(),
|
|
239
|
+
table.getVisibleLeafColumns(),
|
|
240
|
+
table.getState().columnPinning.left,
|
|
241
|
+
table.getState().columnPinning.right
|
|
242
|
+
], (allColumns, leafColumns, left, right) => {
|
|
243
|
+
leafColumns = leafColumns.filter((column) => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
|
|
244
|
+
return buildHeaderGroups(allColumns, leafColumns, table, "center");
|
|
245
|
+
}, getMemoOptions(table.options, debug));
|
|
246
|
+
table.getLeftHeaderGroups = memo(() => [
|
|
247
|
+
table.getAllColumns(),
|
|
248
|
+
table.getVisibleLeafColumns(),
|
|
249
|
+
table.getState().columnPinning.left
|
|
250
|
+
], (allColumns, leafColumns, left) => {
|
|
251
|
+
var _left$map$filter2;
|
|
252
|
+
return buildHeaderGroups(allColumns, (_left$map$filter2 = left == null ? void 0 : left.map((columnId) => leafColumns.find((d) => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [], table, "left");
|
|
253
|
+
}, getMemoOptions(table.options, debug));
|
|
254
|
+
table.getRightHeaderGroups = memo(() => [
|
|
255
|
+
table.getAllColumns(),
|
|
256
|
+
table.getVisibleLeafColumns(),
|
|
257
|
+
table.getState().columnPinning.right
|
|
258
|
+
], (allColumns, leafColumns, right) => {
|
|
259
|
+
var _right$map$filter2;
|
|
260
|
+
return buildHeaderGroups(allColumns, (_right$map$filter2 = right == null ? void 0 : right.map((columnId) => leafColumns.find((d) => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [], table, "right");
|
|
261
|
+
}, getMemoOptions(table.options, debug));
|
|
262
|
+
table.getFooterGroups = memo(() => [table.getHeaderGroups()], (headerGroups) => {
|
|
263
|
+
return [...headerGroups].reverse();
|
|
264
|
+
}, getMemoOptions(table.options, debug));
|
|
265
|
+
table.getLeftFooterGroups = memo(() => [table.getLeftHeaderGroups()], (headerGroups) => {
|
|
266
|
+
return [...headerGroups].reverse();
|
|
267
|
+
}, getMemoOptions(table.options, debug));
|
|
268
|
+
table.getCenterFooterGroups = memo(() => [table.getCenterHeaderGroups()], (headerGroups) => {
|
|
269
|
+
return [...headerGroups].reverse();
|
|
270
|
+
}, getMemoOptions(table.options, debug));
|
|
271
|
+
table.getRightFooterGroups = memo(() => [table.getRightHeaderGroups()], (headerGroups) => {
|
|
272
|
+
return [...headerGroups].reverse();
|
|
273
|
+
}, getMemoOptions(table.options, debug));
|
|
274
|
+
table.getFlatHeaders = memo(() => [table.getHeaderGroups()], (headerGroups) => {
|
|
275
|
+
return headerGroups.map((headerGroup) => {
|
|
276
|
+
return headerGroup.headers;
|
|
277
|
+
}).flat();
|
|
278
|
+
}, getMemoOptions(table.options, debug));
|
|
279
|
+
table.getLeftFlatHeaders = memo(() => [table.getLeftHeaderGroups()], (left) => {
|
|
280
|
+
return left.map((headerGroup) => {
|
|
281
|
+
return headerGroup.headers;
|
|
282
|
+
}).flat();
|
|
283
|
+
}, getMemoOptions(table.options, debug));
|
|
284
|
+
table.getCenterFlatHeaders = memo(() => [table.getCenterHeaderGroups()], (left) => {
|
|
285
|
+
return left.map((headerGroup) => {
|
|
286
|
+
return headerGroup.headers;
|
|
287
|
+
}).flat();
|
|
288
|
+
}, getMemoOptions(table.options, debug));
|
|
289
|
+
table.getRightFlatHeaders = memo(() => [table.getRightHeaderGroups()], (left) => {
|
|
290
|
+
return left.map((headerGroup) => {
|
|
291
|
+
return headerGroup.headers;
|
|
292
|
+
}).flat();
|
|
293
|
+
}, getMemoOptions(table.options, debug));
|
|
294
|
+
table.getCenterLeafHeaders = memo(() => [table.getCenterFlatHeaders()], (flatHeaders) => {
|
|
295
|
+
return flatHeaders.filter((header) => {
|
|
296
|
+
var _header$subHeaders;
|
|
297
|
+
return !((_header$subHeaders = header.subHeaders) != null && _header$subHeaders.length);
|
|
298
|
+
});
|
|
299
|
+
}, getMemoOptions(table.options, debug));
|
|
300
|
+
table.getLeftLeafHeaders = memo(() => [table.getLeftFlatHeaders()], (flatHeaders) => {
|
|
301
|
+
return flatHeaders.filter((header) => {
|
|
302
|
+
var _header$subHeaders2;
|
|
303
|
+
return !((_header$subHeaders2 = header.subHeaders) != null && _header$subHeaders2.length);
|
|
304
|
+
});
|
|
305
|
+
}, getMemoOptions(table.options, debug));
|
|
306
|
+
table.getRightLeafHeaders = memo(() => [table.getRightFlatHeaders()], (flatHeaders) => {
|
|
307
|
+
return flatHeaders.filter((header) => {
|
|
308
|
+
var _header$subHeaders3;
|
|
309
|
+
return !((_header$subHeaders3 = header.subHeaders) != null && _header$subHeaders3.length);
|
|
310
|
+
});
|
|
311
|
+
}, getMemoOptions(table.options, debug));
|
|
312
|
+
table.getLeafHeaders = memo(() => [
|
|
313
|
+
table.getLeftHeaderGroups(),
|
|
314
|
+
table.getCenterHeaderGroups(),
|
|
315
|
+
table.getRightHeaderGroups()
|
|
316
|
+
], (left, center, right) => {
|
|
317
|
+
var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;
|
|
318
|
+
return [
|
|
319
|
+
...(_left$0$headers = (_left$ = left[0]) == null ? void 0 : _left$.headers) != null ? _left$0$headers : [],
|
|
320
|
+
...(_center$0$headers = (_center$ = center[0]) == null ? void 0 : _center$.headers) != null ? _center$0$headers : [],
|
|
321
|
+
...(_right$0$headers = (_right$ = right[0]) == null ? void 0 : _right$.headers) != null ? _right$0$headers : []
|
|
322
|
+
].map((header) => {
|
|
323
|
+
return header.getLeafHeaders();
|
|
324
|
+
}).flat();
|
|
325
|
+
}, getMemoOptions(table.options, debug));
|
|
326
|
+
} };
|
|
327
|
+
function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
|
|
328
|
+
var _headerGroups$0$heade, _headerGroups$;
|
|
329
|
+
let maxDepth = 0;
|
|
330
|
+
const findMaxDepth = function(columns, depth) {
|
|
331
|
+
if (depth === void 0) depth = 1;
|
|
332
|
+
maxDepth = Math.max(maxDepth, depth);
|
|
333
|
+
columns.filter((column) => column.getIsVisible()).forEach((column) => {
|
|
334
|
+
var _column$columns;
|
|
335
|
+
if ((_column$columns = column.columns) != null && _column$columns.length) findMaxDepth(column.columns, depth + 1);
|
|
336
|
+
}, 0);
|
|
337
|
+
};
|
|
338
|
+
findMaxDepth(allColumns);
|
|
339
|
+
let headerGroups = [];
|
|
340
|
+
const createHeaderGroup = (headersToGroup, depth) => {
|
|
341
|
+
const headerGroup = {
|
|
342
|
+
depth,
|
|
343
|
+
id: [headerFamily, `${depth}`].filter(Boolean).join("_"),
|
|
344
|
+
headers: []
|
|
345
|
+
};
|
|
346
|
+
const pendingParentHeaders = [];
|
|
347
|
+
headersToGroup.forEach((headerToGroup) => {
|
|
348
|
+
const latestPendingParentHeader = [...pendingParentHeaders].reverse()[0];
|
|
349
|
+
const isLeafHeader = headerToGroup.column.depth === headerGroup.depth;
|
|
350
|
+
let column;
|
|
351
|
+
let isPlaceholder = false;
|
|
352
|
+
if (isLeafHeader && headerToGroup.column.parent) column = headerToGroup.column.parent;
|
|
353
|
+
else {
|
|
354
|
+
column = headerToGroup.column;
|
|
355
|
+
isPlaceholder = true;
|
|
356
|
+
}
|
|
357
|
+
if (latestPendingParentHeader && (latestPendingParentHeader == null ? void 0 : latestPendingParentHeader.column) === column) latestPendingParentHeader.subHeaders.push(headerToGroup);
|
|
358
|
+
else {
|
|
359
|
+
const header = createHeader(table, column, {
|
|
360
|
+
id: [
|
|
361
|
+
headerFamily,
|
|
362
|
+
depth,
|
|
363
|
+
column.id,
|
|
364
|
+
headerToGroup == null ? void 0 : headerToGroup.id
|
|
365
|
+
].filter(Boolean).join("_"),
|
|
366
|
+
isPlaceholder,
|
|
367
|
+
placeholderId: isPlaceholder ? `${pendingParentHeaders.filter((d) => d.column === column).length}` : void 0,
|
|
368
|
+
depth,
|
|
369
|
+
index: pendingParentHeaders.length
|
|
370
|
+
});
|
|
371
|
+
header.subHeaders.push(headerToGroup);
|
|
372
|
+
pendingParentHeaders.push(header);
|
|
373
|
+
}
|
|
374
|
+
headerGroup.headers.push(headerToGroup);
|
|
375
|
+
headerToGroup.headerGroup = headerGroup;
|
|
376
|
+
});
|
|
377
|
+
headerGroups.push(headerGroup);
|
|
378
|
+
if (depth > 0) createHeaderGroup(pendingParentHeaders, depth - 1);
|
|
379
|
+
};
|
|
380
|
+
createHeaderGroup(columnsToGroup.map((column, index) => createHeader(table, column, {
|
|
381
|
+
depth: maxDepth,
|
|
382
|
+
index
|
|
383
|
+
})), maxDepth - 1);
|
|
384
|
+
headerGroups.reverse();
|
|
385
|
+
const recurseHeadersForSpans = (headers) => {
|
|
386
|
+
return headers.filter((header) => header.column.getIsVisible()).map((header) => {
|
|
387
|
+
let colSpan = 0;
|
|
388
|
+
let rowSpan = 0;
|
|
389
|
+
let childRowSpans = [0];
|
|
390
|
+
if (header.subHeaders && header.subHeaders.length) {
|
|
391
|
+
childRowSpans = [];
|
|
392
|
+
recurseHeadersForSpans(header.subHeaders).forEach((_ref) => {
|
|
393
|
+
let { colSpan: childColSpan, rowSpan: childRowSpan } = _ref;
|
|
394
|
+
colSpan += childColSpan;
|
|
395
|
+
childRowSpans.push(childRowSpan);
|
|
396
|
+
});
|
|
397
|
+
} else colSpan = 1;
|
|
398
|
+
const minChildRowSpan = Math.min(...childRowSpans);
|
|
399
|
+
rowSpan = rowSpan + minChildRowSpan;
|
|
400
|
+
header.colSpan = colSpan;
|
|
401
|
+
header.rowSpan = rowSpan;
|
|
402
|
+
return {
|
|
403
|
+
colSpan,
|
|
404
|
+
rowSpan
|
|
405
|
+
};
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
recurseHeadersForSpans((_headerGroups$0$heade = (_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) != null ? _headerGroups$0$heade : []);
|
|
409
|
+
return headerGroups;
|
|
410
|
+
}
|
|
411
|
+
var createRow = (table, id, original, rowIndex, depth, subRows, parentId) => {
|
|
412
|
+
let row = {
|
|
413
|
+
id,
|
|
414
|
+
index: rowIndex,
|
|
415
|
+
original,
|
|
416
|
+
depth,
|
|
417
|
+
parentId,
|
|
418
|
+
_valuesCache: {},
|
|
419
|
+
_uniqueValuesCache: {},
|
|
420
|
+
getValue: (columnId) => {
|
|
421
|
+
if (row._valuesCache.hasOwnProperty(columnId)) return row._valuesCache[columnId];
|
|
422
|
+
const column = table.getColumn(columnId);
|
|
423
|
+
if (!(column != null && column.accessorFn)) return;
|
|
424
|
+
row._valuesCache[columnId] = column.accessorFn(row.original, rowIndex);
|
|
425
|
+
return row._valuesCache[columnId];
|
|
426
|
+
},
|
|
427
|
+
getUniqueValues: (columnId) => {
|
|
428
|
+
if (row._uniqueValuesCache.hasOwnProperty(columnId)) return row._uniqueValuesCache[columnId];
|
|
429
|
+
const column = table.getColumn(columnId);
|
|
430
|
+
if (!(column != null && column.accessorFn)) return;
|
|
431
|
+
if (!column.columnDef.getUniqueValues) {
|
|
432
|
+
row._uniqueValuesCache[columnId] = [row.getValue(columnId)];
|
|
433
|
+
return row._uniqueValuesCache[columnId];
|
|
434
|
+
}
|
|
435
|
+
row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(row.original, rowIndex);
|
|
436
|
+
return row._uniqueValuesCache[columnId];
|
|
437
|
+
},
|
|
438
|
+
renderValue: (columnId) => {
|
|
439
|
+
var _row$getValue;
|
|
440
|
+
return (_row$getValue = row.getValue(columnId)) != null ? _row$getValue : table.options.renderFallbackValue;
|
|
441
|
+
},
|
|
442
|
+
subRows: [],
|
|
443
|
+
getLeafRows: () => flattenBy(row.subRows, (d) => d.subRows),
|
|
444
|
+
getParentRow: () => row.parentId ? table.getRow(row.parentId, true) : void 0,
|
|
445
|
+
getParentRows: () => {
|
|
446
|
+
let parentRows = [];
|
|
447
|
+
let currentRow = row;
|
|
448
|
+
while (true) {
|
|
449
|
+
const parentRow = currentRow.getParentRow();
|
|
450
|
+
if (!parentRow) break;
|
|
451
|
+
parentRows.push(parentRow);
|
|
452
|
+
currentRow = parentRow;
|
|
453
|
+
}
|
|
454
|
+
return parentRows.reverse();
|
|
455
|
+
},
|
|
456
|
+
getAllCells: memo(() => [table.getAllLeafColumns()], (leafColumns) => {
|
|
457
|
+
return leafColumns.map((column) => {
|
|
458
|
+
return createCell(table, row, column, column.id);
|
|
459
|
+
});
|
|
460
|
+
}, getMemoOptions(table.options, "debugRows")),
|
|
461
|
+
_getAllCellsByColumnId: memo(() => [row.getAllCells()], (allCells) => {
|
|
462
|
+
return allCells.reduce((acc, cell) => {
|
|
463
|
+
acc[cell.column.id] = cell;
|
|
464
|
+
return acc;
|
|
465
|
+
}, {});
|
|
466
|
+
}, getMemoOptions(table.options, "debugRows"))
|
|
467
|
+
};
|
|
468
|
+
for (let i = 0; i < table._features.length; i++) {
|
|
469
|
+
const feature = table._features[i];
|
|
470
|
+
feature == null || feature.createRow == null || feature.createRow(row, table);
|
|
471
|
+
}
|
|
472
|
+
return row;
|
|
473
|
+
};
|
|
474
|
+
var ColumnFaceting = { createColumn: (column, table) => {
|
|
475
|
+
column._getFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, column.id);
|
|
476
|
+
column.getFacetedRowModel = () => {
|
|
477
|
+
if (!column._getFacetedRowModel) return table.getPreFilteredRowModel();
|
|
478
|
+
return column._getFacetedRowModel();
|
|
479
|
+
};
|
|
480
|
+
column._getFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, column.id);
|
|
481
|
+
column.getFacetedUniqueValues = () => {
|
|
482
|
+
if (!column._getFacetedUniqueValues) return /* @__PURE__ */ new Map();
|
|
483
|
+
return column._getFacetedUniqueValues();
|
|
484
|
+
};
|
|
485
|
+
column._getFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, column.id);
|
|
486
|
+
column.getFacetedMinMaxValues = () => {
|
|
487
|
+
if (!column._getFacetedMinMaxValues) return;
|
|
488
|
+
return column._getFacetedMinMaxValues();
|
|
489
|
+
};
|
|
490
|
+
} };
|
|
491
|
+
var includesString = (row, columnId, filterValue) => {
|
|
492
|
+
var _filterValue$toString, _row$getValue;
|
|
493
|
+
const search = filterValue == null || (_filterValue$toString = filterValue.toString()) == null ? void 0 : _filterValue$toString.toLowerCase();
|
|
494
|
+
return Boolean((_row$getValue = row.getValue(columnId)) == null || (_row$getValue = _row$getValue.toString()) == null || (_row$getValue = _row$getValue.toLowerCase()) == null ? void 0 : _row$getValue.includes(search));
|
|
495
|
+
};
|
|
496
|
+
includesString.autoRemove = (val) => testFalsey(val);
|
|
497
|
+
var includesStringSensitive = (row, columnId, filterValue) => {
|
|
498
|
+
var _row$getValue2;
|
|
499
|
+
return Boolean((_row$getValue2 = row.getValue(columnId)) == null || (_row$getValue2 = _row$getValue2.toString()) == null ? void 0 : _row$getValue2.includes(filterValue));
|
|
500
|
+
};
|
|
501
|
+
includesStringSensitive.autoRemove = (val) => testFalsey(val);
|
|
502
|
+
var equalsString = (row, columnId, filterValue) => {
|
|
503
|
+
var _row$getValue3;
|
|
504
|
+
return ((_row$getValue3 = row.getValue(columnId)) == null || (_row$getValue3 = _row$getValue3.toString()) == null ? void 0 : _row$getValue3.toLowerCase()) === (filterValue == null ? void 0 : filterValue.toLowerCase());
|
|
505
|
+
};
|
|
506
|
+
equalsString.autoRemove = (val) => testFalsey(val);
|
|
507
|
+
var arrIncludes = (row, columnId, filterValue) => {
|
|
508
|
+
var _row$getValue4;
|
|
509
|
+
return (_row$getValue4 = row.getValue(columnId)) == null ? void 0 : _row$getValue4.includes(filterValue);
|
|
510
|
+
};
|
|
511
|
+
arrIncludes.autoRemove = (val) => testFalsey(val);
|
|
512
|
+
var arrIncludesAll = (row, columnId, filterValue) => {
|
|
513
|
+
return !filterValue.some((val) => {
|
|
514
|
+
var _row$getValue5;
|
|
515
|
+
return !((_row$getValue5 = row.getValue(columnId)) != null && _row$getValue5.includes(val));
|
|
516
|
+
});
|
|
517
|
+
};
|
|
518
|
+
arrIncludesAll.autoRemove = (val) => testFalsey(val) || !(val != null && val.length);
|
|
519
|
+
var arrIncludesSome = (row, columnId, filterValue) => {
|
|
520
|
+
return filterValue.some((val) => {
|
|
521
|
+
var _row$getValue6;
|
|
522
|
+
return (_row$getValue6 = row.getValue(columnId)) == null ? void 0 : _row$getValue6.includes(val);
|
|
523
|
+
});
|
|
524
|
+
};
|
|
525
|
+
arrIncludesSome.autoRemove = (val) => testFalsey(val) || !(val != null && val.length);
|
|
526
|
+
var equals = (row, columnId, filterValue) => {
|
|
527
|
+
return row.getValue(columnId) === filterValue;
|
|
528
|
+
};
|
|
529
|
+
equals.autoRemove = (val) => testFalsey(val);
|
|
530
|
+
var weakEquals = (row, columnId, filterValue) => {
|
|
531
|
+
return row.getValue(columnId) == filterValue;
|
|
532
|
+
};
|
|
533
|
+
weakEquals.autoRemove = (val) => testFalsey(val);
|
|
534
|
+
var inNumberRange = (row, columnId, filterValue) => {
|
|
535
|
+
let [min, max] = filterValue;
|
|
536
|
+
const rowValue = row.getValue(columnId);
|
|
537
|
+
return rowValue >= min && rowValue <= max;
|
|
538
|
+
};
|
|
539
|
+
inNumberRange.resolveFilterValue = (val) => {
|
|
540
|
+
let [unsafeMin, unsafeMax] = val;
|
|
541
|
+
let parsedMin = typeof unsafeMin !== "number" ? parseFloat(unsafeMin) : unsafeMin;
|
|
542
|
+
let parsedMax = typeof unsafeMax !== "number" ? parseFloat(unsafeMax) : unsafeMax;
|
|
543
|
+
let min = unsafeMin === null || Number.isNaN(parsedMin) ? -Infinity : parsedMin;
|
|
544
|
+
let max = unsafeMax === null || Number.isNaN(parsedMax) ? Infinity : parsedMax;
|
|
545
|
+
if (min > max) {
|
|
546
|
+
const temp = min;
|
|
547
|
+
min = max;
|
|
548
|
+
max = temp;
|
|
549
|
+
}
|
|
550
|
+
return [min, max];
|
|
551
|
+
};
|
|
552
|
+
inNumberRange.autoRemove = (val) => testFalsey(val) || testFalsey(val[0]) && testFalsey(val[1]);
|
|
553
|
+
var filterFns = {
|
|
554
|
+
includesString,
|
|
555
|
+
includesStringSensitive,
|
|
556
|
+
equalsString,
|
|
557
|
+
arrIncludes,
|
|
558
|
+
arrIncludesAll,
|
|
559
|
+
arrIncludesSome,
|
|
560
|
+
equals,
|
|
561
|
+
weakEquals,
|
|
562
|
+
inNumberRange
|
|
563
|
+
};
|
|
564
|
+
function testFalsey(val) {
|
|
565
|
+
return val === void 0 || val === null || val === "";
|
|
566
|
+
}
|
|
567
|
+
var ColumnFiltering = {
|
|
568
|
+
getDefaultColumnDef: () => {
|
|
569
|
+
return { filterFn: "auto" };
|
|
570
|
+
},
|
|
571
|
+
getInitialState: (state) => {
|
|
572
|
+
return {
|
|
573
|
+
columnFilters: [],
|
|
574
|
+
...state
|
|
575
|
+
};
|
|
576
|
+
},
|
|
577
|
+
getDefaultOptions: (table) => {
|
|
578
|
+
return {
|
|
579
|
+
onColumnFiltersChange: makeStateUpdater("columnFilters", table),
|
|
580
|
+
filterFromLeafRows: false,
|
|
581
|
+
maxLeafRowFilterDepth: 100
|
|
582
|
+
};
|
|
583
|
+
},
|
|
584
|
+
createColumn: (column, table) => {
|
|
585
|
+
column.getAutoFilterFn = () => {
|
|
586
|
+
const firstRow = table.getCoreRowModel().flatRows[0];
|
|
587
|
+
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
588
|
+
if (typeof value === "string") return filterFns.includesString;
|
|
589
|
+
if (typeof value === "number") return filterFns.inNumberRange;
|
|
590
|
+
if (typeof value === "boolean") return filterFns.equals;
|
|
591
|
+
if (value !== null && typeof value === "object") return filterFns.equals;
|
|
592
|
+
if (Array.isArray(value)) return filterFns.arrIncludes;
|
|
593
|
+
return filterFns.weakEquals;
|
|
594
|
+
};
|
|
595
|
+
column.getFilterFn = () => {
|
|
596
|
+
var _table$options$filter, _table$options$filter2;
|
|
597
|
+
return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === "auto" ? column.getAutoFilterFn() : (_table$options$filter = (_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[column.columnDef.filterFn]) != null ? _table$options$filter : filterFns[column.columnDef.filterFn];
|
|
598
|
+
};
|
|
599
|
+
column.getCanFilter = () => {
|
|
600
|
+
var _column$columnDef$ena, _table$options$enable, _table$options$enable2;
|
|
601
|
+
return ((_column$columnDef$ena = column.columnDef.enableColumnFilter) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnFilters) != null ? _table$options$enable : true) && ((_table$options$enable2 = table.options.enableFilters) != null ? _table$options$enable2 : true) && !!column.accessorFn;
|
|
602
|
+
};
|
|
603
|
+
column.getIsFiltered = () => column.getFilterIndex() > -1;
|
|
604
|
+
column.getFilterValue = () => {
|
|
605
|
+
var _table$getState$colum;
|
|
606
|
+
return (_table$getState$colum = table.getState().columnFilters) == null || (_table$getState$colum = _table$getState$colum.find((d) => d.id === column.id)) == null ? void 0 : _table$getState$colum.value;
|
|
607
|
+
};
|
|
608
|
+
column.getFilterIndex = () => {
|
|
609
|
+
var _table$getState$colum2, _table$getState$colum3;
|
|
610
|
+
return (_table$getState$colum2 = (_table$getState$colum3 = table.getState().columnFilters) == null ? void 0 : _table$getState$colum3.findIndex((d) => d.id === column.id)) != null ? _table$getState$colum2 : -1;
|
|
611
|
+
};
|
|
612
|
+
column.setFilterValue = (value) => {
|
|
613
|
+
table.setColumnFilters((old) => {
|
|
614
|
+
const filterFn = column.getFilterFn();
|
|
615
|
+
const previousFilter = old == null ? void 0 : old.find((d) => d.id === column.id);
|
|
616
|
+
const newFilter = functionalUpdate(value, previousFilter ? previousFilter.value : void 0);
|
|
617
|
+
if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {
|
|
618
|
+
var _old$filter;
|
|
619
|
+
return (_old$filter = old == null ? void 0 : old.filter((d) => d.id !== column.id)) != null ? _old$filter : [];
|
|
620
|
+
}
|
|
621
|
+
const newFilterObj = {
|
|
622
|
+
id: column.id,
|
|
623
|
+
value: newFilter
|
|
624
|
+
};
|
|
625
|
+
if (previousFilter) {
|
|
626
|
+
var _old$map;
|
|
627
|
+
return (_old$map = old == null ? void 0 : old.map((d) => {
|
|
628
|
+
if (d.id === column.id) return newFilterObj;
|
|
629
|
+
return d;
|
|
630
|
+
})) != null ? _old$map : [];
|
|
631
|
+
}
|
|
632
|
+
if (old != null && old.length) return [...old, newFilterObj];
|
|
633
|
+
return [newFilterObj];
|
|
634
|
+
});
|
|
635
|
+
};
|
|
636
|
+
},
|
|
637
|
+
createRow: (row, _table) => {
|
|
638
|
+
row.columnFilters = {};
|
|
639
|
+
row.columnFiltersMeta = {};
|
|
640
|
+
},
|
|
641
|
+
createTable: (table) => {
|
|
642
|
+
table.setColumnFilters = (updater) => {
|
|
643
|
+
const leafColumns = table.getAllLeafColumns();
|
|
644
|
+
const updateFn = (old) => {
|
|
645
|
+
var _functionalUpdate;
|
|
646
|
+
return (_functionalUpdate = functionalUpdate(updater, old)) == null ? void 0 : _functionalUpdate.filter((filter) => {
|
|
647
|
+
const column = leafColumns.find((d) => d.id === filter.id);
|
|
648
|
+
if (column) {
|
|
649
|
+
if (shouldAutoRemoveFilter(column.getFilterFn(), filter.value, column)) return false;
|
|
650
|
+
}
|
|
651
|
+
return true;
|
|
652
|
+
});
|
|
653
|
+
};
|
|
654
|
+
table.options.onColumnFiltersChange == null || table.options.onColumnFiltersChange(updateFn);
|
|
655
|
+
};
|
|
656
|
+
table.resetColumnFilters = (defaultState) => {
|
|
657
|
+
var _table$initialState$c, _table$initialState;
|
|
658
|
+
table.setColumnFilters(defaultState ? [] : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) != null ? _table$initialState$c : []);
|
|
659
|
+
};
|
|
660
|
+
table.getPreFilteredRowModel = () => table.getCoreRowModel();
|
|
661
|
+
table.getFilteredRowModel = () => {
|
|
662
|
+
if (!table._getFilteredRowModel && table.options.getFilteredRowModel) table._getFilteredRowModel = table.options.getFilteredRowModel(table);
|
|
663
|
+
if (table.options.manualFiltering || !table._getFilteredRowModel) return table.getPreFilteredRowModel();
|
|
664
|
+
return table._getFilteredRowModel();
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
function shouldAutoRemoveFilter(filterFn, value, column) {
|
|
669
|
+
return (filterFn && filterFn.autoRemove ? filterFn.autoRemove(value, column) : false) || typeof value === "undefined" || typeof value === "string" && !value;
|
|
670
|
+
}
|
|
671
|
+
var sum = (columnId, _leafRows, childRows) => {
|
|
672
|
+
return childRows.reduce((sum, next) => {
|
|
673
|
+
const nextValue = next.getValue(columnId);
|
|
674
|
+
return sum + (typeof nextValue === "number" ? nextValue : 0);
|
|
675
|
+
}, 0);
|
|
676
|
+
};
|
|
677
|
+
var min = (columnId, _leafRows, childRows) => {
|
|
678
|
+
let min;
|
|
679
|
+
childRows.forEach((row) => {
|
|
680
|
+
const value = row.getValue(columnId);
|
|
681
|
+
if (value != null && (min > value || min === void 0 && value >= value)) min = value;
|
|
682
|
+
});
|
|
683
|
+
return min;
|
|
684
|
+
};
|
|
685
|
+
var max = (columnId, _leafRows, childRows) => {
|
|
686
|
+
let max;
|
|
687
|
+
childRows.forEach((row) => {
|
|
688
|
+
const value = row.getValue(columnId);
|
|
689
|
+
if (value != null && (max < value || max === void 0 && value >= value)) max = value;
|
|
690
|
+
});
|
|
691
|
+
return max;
|
|
692
|
+
};
|
|
693
|
+
var extent = (columnId, _leafRows, childRows) => {
|
|
694
|
+
let min;
|
|
695
|
+
let max;
|
|
696
|
+
childRows.forEach((row) => {
|
|
697
|
+
const value = row.getValue(columnId);
|
|
698
|
+
if (value != null) {
|
|
699
|
+
if (min === void 0) {
|
|
700
|
+
if (value >= value) min = max = value;
|
|
701
|
+
} else {
|
|
702
|
+
if (min > value) min = value;
|
|
703
|
+
if (max < value) max = value;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
return [min, max];
|
|
708
|
+
};
|
|
709
|
+
var mean = (columnId, leafRows) => {
|
|
710
|
+
let count = 0;
|
|
711
|
+
let sum = 0;
|
|
712
|
+
leafRows.forEach((row) => {
|
|
713
|
+
let value = row.getValue(columnId);
|
|
714
|
+
if (value != null && (value = +value) >= value) ++count, sum += value;
|
|
715
|
+
});
|
|
716
|
+
if (count) return sum / count;
|
|
717
|
+
};
|
|
718
|
+
var median = (columnId, leafRows) => {
|
|
719
|
+
if (!leafRows.length) return;
|
|
720
|
+
const values = leafRows.map((row) => row.getValue(columnId));
|
|
721
|
+
if (!isNumberArray(values)) return;
|
|
722
|
+
if (values.length === 1) return values[0];
|
|
723
|
+
const mid = Math.floor(values.length / 2);
|
|
724
|
+
const nums = values.sort((a, b) => a - b);
|
|
725
|
+
return values.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2;
|
|
726
|
+
};
|
|
727
|
+
var unique = (columnId, leafRows) => {
|
|
728
|
+
return Array.from(new Set(leafRows.map((d) => d.getValue(columnId))).values());
|
|
729
|
+
};
|
|
730
|
+
var uniqueCount = (columnId, leafRows) => {
|
|
731
|
+
return new Set(leafRows.map((d) => d.getValue(columnId))).size;
|
|
732
|
+
};
|
|
733
|
+
var count = (_columnId, leafRows) => {
|
|
734
|
+
return leafRows.length;
|
|
735
|
+
};
|
|
736
|
+
var aggregationFns = {
|
|
737
|
+
sum,
|
|
738
|
+
min,
|
|
739
|
+
max,
|
|
740
|
+
extent,
|
|
741
|
+
mean,
|
|
742
|
+
median,
|
|
743
|
+
unique,
|
|
744
|
+
uniqueCount,
|
|
745
|
+
count
|
|
746
|
+
};
|
|
747
|
+
var ColumnGrouping = {
|
|
748
|
+
getDefaultColumnDef: () => {
|
|
749
|
+
return {
|
|
750
|
+
aggregatedCell: (props) => {
|
|
751
|
+
var _toString, _props$getValue;
|
|
752
|
+
return (_toString = (_props$getValue = props.getValue()) == null || _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _toString : null;
|
|
753
|
+
},
|
|
754
|
+
aggregationFn: "auto"
|
|
755
|
+
};
|
|
756
|
+
},
|
|
757
|
+
getInitialState: (state) => {
|
|
758
|
+
return {
|
|
759
|
+
grouping: [],
|
|
760
|
+
...state
|
|
761
|
+
};
|
|
762
|
+
},
|
|
763
|
+
getDefaultOptions: (table) => {
|
|
764
|
+
return {
|
|
765
|
+
onGroupingChange: makeStateUpdater("grouping", table),
|
|
766
|
+
groupedColumnMode: "reorder"
|
|
767
|
+
};
|
|
768
|
+
},
|
|
769
|
+
createColumn: (column, table) => {
|
|
770
|
+
column.toggleGrouping = () => {
|
|
771
|
+
table.setGrouping((old) => {
|
|
772
|
+
if (old != null && old.includes(column.id)) return old.filter((d) => d !== column.id);
|
|
773
|
+
return [...old != null ? old : [], column.id];
|
|
774
|
+
});
|
|
775
|
+
};
|
|
776
|
+
column.getCanGroup = () => {
|
|
777
|
+
var _column$columnDef$ena, _table$options$enable;
|
|
778
|
+
return ((_column$columnDef$ena = column.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableGrouping) != null ? _table$options$enable : true) && (!!column.accessorFn || !!column.columnDef.getGroupingValue);
|
|
779
|
+
};
|
|
780
|
+
column.getIsGrouped = () => {
|
|
781
|
+
var _table$getState$group;
|
|
782
|
+
return (_table$getState$group = table.getState().grouping) == null ? void 0 : _table$getState$group.includes(column.id);
|
|
783
|
+
};
|
|
784
|
+
column.getGroupedIndex = () => {
|
|
785
|
+
var _table$getState$group2;
|
|
786
|
+
return (_table$getState$group2 = table.getState().grouping) == null ? void 0 : _table$getState$group2.indexOf(column.id);
|
|
787
|
+
};
|
|
788
|
+
column.getToggleGroupingHandler = () => {
|
|
789
|
+
const canGroup = column.getCanGroup();
|
|
790
|
+
return () => {
|
|
791
|
+
if (!canGroup) return;
|
|
792
|
+
column.toggleGrouping();
|
|
793
|
+
};
|
|
794
|
+
};
|
|
795
|
+
column.getAutoAggregationFn = () => {
|
|
796
|
+
const firstRow = table.getCoreRowModel().flatRows[0];
|
|
797
|
+
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
798
|
+
if (typeof value === "number") return aggregationFns.sum;
|
|
799
|
+
if (Object.prototype.toString.call(value) === "[object Date]") return aggregationFns.extent;
|
|
800
|
+
};
|
|
801
|
+
column.getAggregationFn = () => {
|
|
802
|
+
var _table$options$aggreg, _table$options$aggreg2;
|
|
803
|
+
if (!column) throw new Error();
|
|
804
|
+
return isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === "auto" ? column.getAutoAggregationFn() : (_table$options$aggreg = (_table$options$aggreg2 = table.options.aggregationFns) == null ? void 0 : _table$options$aggreg2[column.columnDef.aggregationFn]) != null ? _table$options$aggreg : aggregationFns[column.columnDef.aggregationFn];
|
|
805
|
+
};
|
|
806
|
+
},
|
|
807
|
+
createTable: (table) => {
|
|
808
|
+
table.setGrouping = (updater) => table.options.onGroupingChange == null ? void 0 : table.options.onGroupingChange(updater);
|
|
809
|
+
table.resetGrouping = (defaultState) => {
|
|
810
|
+
var _table$initialState$g, _table$initialState;
|
|
811
|
+
table.setGrouping(defaultState ? [] : (_table$initialState$g = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) != null ? _table$initialState$g : []);
|
|
812
|
+
};
|
|
813
|
+
table.getPreGroupedRowModel = () => table.getFilteredRowModel();
|
|
814
|
+
table.getGroupedRowModel = () => {
|
|
815
|
+
if (!table._getGroupedRowModel && table.options.getGroupedRowModel) table._getGroupedRowModel = table.options.getGroupedRowModel(table);
|
|
816
|
+
if (table.options.manualGrouping || !table._getGroupedRowModel) return table.getPreGroupedRowModel();
|
|
817
|
+
return table._getGroupedRowModel();
|
|
818
|
+
};
|
|
819
|
+
},
|
|
820
|
+
createRow: (row, table) => {
|
|
821
|
+
row.getIsGrouped = () => !!row.groupingColumnId;
|
|
822
|
+
row.getGroupingValue = (columnId) => {
|
|
823
|
+
if (row._groupingValuesCache.hasOwnProperty(columnId)) return row._groupingValuesCache[columnId];
|
|
824
|
+
const column = table.getColumn(columnId);
|
|
825
|
+
if (!(column != null && column.columnDef.getGroupingValue)) return row.getValue(columnId);
|
|
826
|
+
row._groupingValuesCache[columnId] = column.columnDef.getGroupingValue(row.original);
|
|
827
|
+
return row._groupingValuesCache[columnId];
|
|
828
|
+
};
|
|
829
|
+
row._groupingValuesCache = {};
|
|
830
|
+
},
|
|
831
|
+
createCell: (cell, column, row, table) => {
|
|
832
|
+
cell.getIsGrouped = () => column.getIsGrouped() && column.id === row.groupingColumnId;
|
|
833
|
+
cell.getIsPlaceholder = () => !cell.getIsGrouped() && column.getIsGrouped();
|
|
834
|
+
cell.getIsAggregated = () => {
|
|
835
|
+
var _row$subRows;
|
|
836
|
+
return !cell.getIsGrouped() && !cell.getIsPlaceholder() && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
function orderColumns(leafColumns, grouping, groupedColumnMode) {
|
|
841
|
+
if (!(grouping != null && grouping.length) || !groupedColumnMode) return leafColumns;
|
|
842
|
+
const nonGroupingColumns = leafColumns.filter((col) => !grouping.includes(col.id));
|
|
843
|
+
if (groupedColumnMode === "remove") return nonGroupingColumns;
|
|
844
|
+
return [...grouping.map((g) => leafColumns.find((col) => col.id === g)).filter(Boolean), ...nonGroupingColumns];
|
|
845
|
+
}
|
|
846
|
+
var ColumnOrdering = {
|
|
847
|
+
getInitialState: (state) => {
|
|
848
|
+
return {
|
|
849
|
+
columnOrder: [],
|
|
850
|
+
...state
|
|
851
|
+
};
|
|
852
|
+
},
|
|
853
|
+
getDefaultOptions: (table) => {
|
|
854
|
+
return { onColumnOrderChange: makeStateUpdater("columnOrder", table) };
|
|
855
|
+
},
|
|
856
|
+
createColumn: (column, table) => {
|
|
857
|
+
column.getIndex = memo((position) => [_getVisibleLeafColumns(table, position)], (columns) => columns.findIndex((d) => d.id === column.id), getMemoOptions(table.options, "debugColumns"));
|
|
858
|
+
column.getIsFirstColumn = (position) => {
|
|
859
|
+
var _columns$;
|
|
860
|
+
return ((_columns$ = _getVisibleLeafColumns(table, position)[0]) == null ? void 0 : _columns$.id) === column.id;
|
|
861
|
+
};
|
|
862
|
+
column.getIsLastColumn = (position) => {
|
|
863
|
+
var _columns;
|
|
864
|
+
const columns = _getVisibleLeafColumns(table, position);
|
|
865
|
+
return ((_columns = columns[columns.length - 1]) == null ? void 0 : _columns.id) === column.id;
|
|
866
|
+
};
|
|
867
|
+
},
|
|
868
|
+
createTable: (table) => {
|
|
869
|
+
table.setColumnOrder = (updater) => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater);
|
|
870
|
+
table.resetColumnOrder = (defaultState) => {
|
|
871
|
+
var _table$initialState$c;
|
|
872
|
+
table.setColumnOrder(defaultState ? [] : (_table$initialState$c = table.initialState.columnOrder) != null ? _table$initialState$c : []);
|
|
873
|
+
};
|
|
874
|
+
table._getOrderColumnsFn = memo(() => [
|
|
875
|
+
table.getState().columnOrder,
|
|
876
|
+
table.getState().grouping,
|
|
877
|
+
table.options.groupedColumnMode
|
|
878
|
+
], (columnOrder, grouping, groupedColumnMode) => (columns) => {
|
|
879
|
+
let orderedColumns = [];
|
|
880
|
+
if (!(columnOrder != null && columnOrder.length)) orderedColumns = columns;
|
|
881
|
+
else {
|
|
882
|
+
const columnOrderCopy = [...columnOrder];
|
|
883
|
+
const columnsCopy = [...columns];
|
|
884
|
+
while (columnsCopy.length && columnOrderCopy.length) {
|
|
885
|
+
const targetColumnId = columnOrderCopy.shift();
|
|
886
|
+
const foundIndex = columnsCopy.findIndex((d) => d.id === targetColumnId);
|
|
887
|
+
if (foundIndex > -1) orderedColumns.push(columnsCopy.splice(foundIndex, 1)[0]);
|
|
888
|
+
}
|
|
889
|
+
orderedColumns = [...orderedColumns, ...columnsCopy];
|
|
890
|
+
}
|
|
891
|
+
return orderColumns(orderedColumns, grouping, groupedColumnMode);
|
|
892
|
+
}, getMemoOptions(table.options, "debugTable"));
|
|
893
|
+
}
|
|
894
|
+
};
|
|
895
|
+
var getDefaultColumnPinningState = () => ({
|
|
896
|
+
left: [],
|
|
897
|
+
right: []
|
|
898
|
+
});
|
|
899
|
+
var ColumnPinning = {
|
|
900
|
+
getInitialState: (state) => {
|
|
901
|
+
return {
|
|
902
|
+
columnPinning: getDefaultColumnPinningState(),
|
|
903
|
+
...state
|
|
904
|
+
};
|
|
905
|
+
},
|
|
906
|
+
getDefaultOptions: (table) => {
|
|
907
|
+
return { onColumnPinningChange: makeStateUpdater("columnPinning", table) };
|
|
908
|
+
},
|
|
909
|
+
createColumn: (column, table) => {
|
|
910
|
+
column.pin = (position) => {
|
|
911
|
+
const columnIds = column.getLeafColumns().map((d) => d.id).filter(Boolean);
|
|
912
|
+
table.setColumnPinning((old) => {
|
|
913
|
+
var _old$left3, _old$right3;
|
|
914
|
+
if (position === "right") {
|
|
915
|
+
var _old$left, _old$right;
|
|
916
|
+
return {
|
|
917
|
+
left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter((d) => !(columnIds != null && columnIds.includes(d))),
|
|
918
|
+
right: [...((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter((d) => !(columnIds != null && columnIds.includes(d))), ...columnIds]
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
if (position === "left") {
|
|
922
|
+
var _old$left2, _old$right2;
|
|
923
|
+
return {
|
|
924
|
+
left: [...((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter((d) => !(columnIds != null && columnIds.includes(d))), ...columnIds],
|
|
925
|
+
right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter((d) => !(columnIds != null && columnIds.includes(d)))
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
return {
|
|
929
|
+
left: ((_old$left3 = old == null ? void 0 : old.left) != null ? _old$left3 : []).filter((d) => !(columnIds != null && columnIds.includes(d))),
|
|
930
|
+
right: ((_old$right3 = old == null ? void 0 : old.right) != null ? _old$right3 : []).filter((d) => !(columnIds != null && columnIds.includes(d)))
|
|
931
|
+
};
|
|
932
|
+
});
|
|
933
|
+
};
|
|
934
|
+
column.getCanPin = () => {
|
|
935
|
+
return column.getLeafColumns().some((d) => {
|
|
936
|
+
var _d$columnDef$enablePi, _ref, _table$options$enable;
|
|
937
|
+
return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_ref = (_table$options$enable = table.options.enableColumnPinning) != null ? _table$options$enable : table.options.enablePinning) != null ? _ref : true);
|
|
938
|
+
});
|
|
939
|
+
};
|
|
940
|
+
column.getIsPinned = () => {
|
|
941
|
+
const leafColumnIds = column.getLeafColumns().map((d) => d.id);
|
|
942
|
+
const { left, right } = table.getState().columnPinning;
|
|
943
|
+
const isLeft = leafColumnIds.some((d) => left == null ? void 0 : left.includes(d));
|
|
944
|
+
const isRight = leafColumnIds.some((d) => right == null ? void 0 : right.includes(d));
|
|
945
|
+
return isLeft ? "left" : isRight ? "right" : false;
|
|
946
|
+
};
|
|
947
|
+
column.getPinnedIndex = () => {
|
|
948
|
+
var _table$getState$colum, _table$getState$colum2;
|
|
949
|
+
const position = column.getIsPinned();
|
|
950
|
+
return position ? (_table$getState$colum = (_table$getState$colum2 = table.getState().columnPinning) == null || (_table$getState$colum2 = _table$getState$colum2[position]) == null ? void 0 : _table$getState$colum2.indexOf(column.id)) != null ? _table$getState$colum : -1 : 0;
|
|
951
|
+
};
|
|
952
|
+
},
|
|
953
|
+
createRow: (row, table) => {
|
|
954
|
+
row.getCenterVisibleCells = memo(() => [
|
|
955
|
+
row._getAllVisibleCells(),
|
|
956
|
+
table.getState().columnPinning.left,
|
|
957
|
+
table.getState().columnPinning.right
|
|
958
|
+
], (allCells, left, right) => {
|
|
959
|
+
const leftAndRight = [...left != null ? left : [], ...right != null ? right : []];
|
|
960
|
+
return allCells.filter((d) => !leftAndRight.includes(d.column.id));
|
|
961
|
+
}, getMemoOptions(table.options, "debugRows"));
|
|
962
|
+
row.getLeftVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left], (allCells, left) => {
|
|
963
|
+
return (left != null ? left : []).map((columnId) => allCells.find((cell) => cell.column.id === columnId)).filter(Boolean).map((d) => ({
|
|
964
|
+
...d,
|
|
965
|
+
position: "left"
|
|
966
|
+
}));
|
|
967
|
+
}, getMemoOptions(table.options, "debugRows"));
|
|
968
|
+
row.getRightVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
|
|
969
|
+
return (right != null ? right : []).map((columnId) => allCells.find((cell) => cell.column.id === columnId)).filter(Boolean).map((d) => ({
|
|
970
|
+
...d,
|
|
971
|
+
position: "right"
|
|
972
|
+
}));
|
|
973
|
+
}, getMemoOptions(table.options, "debugRows"));
|
|
974
|
+
},
|
|
975
|
+
createTable: (table) => {
|
|
976
|
+
table.setColumnPinning = (updater) => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater);
|
|
977
|
+
table.resetColumnPinning = (defaultState) => {
|
|
978
|
+
var _table$initialState$c, _table$initialState;
|
|
979
|
+
return table.setColumnPinning(defaultState ? getDefaultColumnPinningState() : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) != null ? _table$initialState$c : getDefaultColumnPinningState());
|
|
980
|
+
};
|
|
981
|
+
table.getIsSomeColumnsPinned = (position) => {
|
|
982
|
+
var _pinningState$positio;
|
|
983
|
+
const pinningState = table.getState().columnPinning;
|
|
984
|
+
if (!position) {
|
|
985
|
+
var _pinningState$left, _pinningState$right;
|
|
986
|
+
return Boolean(((_pinningState$left = pinningState.left) == null ? void 0 : _pinningState$left.length) || ((_pinningState$right = pinningState.right) == null ? void 0 : _pinningState$right.length));
|
|
987
|
+
}
|
|
988
|
+
return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
|
|
989
|
+
};
|
|
990
|
+
table.getLeftLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
|
|
991
|
+
return (left != null ? left : []).map((columnId) => allColumns.find((column) => column.id === columnId)).filter(Boolean);
|
|
992
|
+
}, getMemoOptions(table.options, "debugColumns"));
|
|
993
|
+
table.getRightLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
|
|
994
|
+
return (right != null ? right : []).map((columnId) => allColumns.find((column) => column.id === columnId)).filter(Boolean);
|
|
995
|
+
}, getMemoOptions(table.options, "debugColumns"));
|
|
996
|
+
table.getCenterLeafColumns = memo(() => [
|
|
997
|
+
table.getAllLeafColumns(),
|
|
998
|
+
table.getState().columnPinning.left,
|
|
999
|
+
table.getState().columnPinning.right
|
|
1000
|
+
], (allColumns, left, right) => {
|
|
1001
|
+
const leftAndRight = [...left != null ? left : [], ...right != null ? right : []];
|
|
1002
|
+
return allColumns.filter((d) => !leftAndRight.includes(d.id));
|
|
1003
|
+
}, getMemoOptions(table.options, "debugColumns"));
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
function safelyAccessDocument(_document) {
|
|
1007
|
+
return _document || null;
|
|
1008
|
+
}
|
|
1009
|
+
var defaultColumnSizing = {
|
|
1010
|
+
size: 150,
|
|
1011
|
+
minSize: 20,
|
|
1012
|
+
maxSize: Number.MAX_SAFE_INTEGER
|
|
1013
|
+
};
|
|
1014
|
+
var getDefaultColumnSizingInfoState = () => ({
|
|
1015
|
+
startOffset: null,
|
|
1016
|
+
startSize: null,
|
|
1017
|
+
deltaOffset: null,
|
|
1018
|
+
deltaPercentage: null,
|
|
1019
|
+
isResizingColumn: false,
|
|
1020
|
+
columnSizingStart: []
|
|
1021
|
+
});
|
|
1022
|
+
var ColumnSizing = {
|
|
1023
|
+
getDefaultColumnDef: () => {
|
|
1024
|
+
return defaultColumnSizing;
|
|
1025
|
+
},
|
|
1026
|
+
getInitialState: (state) => {
|
|
1027
|
+
return {
|
|
1028
|
+
columnSizing: {},
|
|
1029
|
+
columnSizingInfo: getDefaultColumnSizingInfoState(),
|
|
1030
|
+
...state
|
|
1031
|
+
};
|
|
1032
|
+
},
|
|
1033
|
+
getDefaultOptions: (table) => {
|
|
1034
|
+
return {
|
|
1035
|
+
columnResizeMode: "onEnd",
|
|
1036
|
+
columnResizeDirection: "ltr",
|
|
1037
|
+
onColumnSizingChange: makeStateUpdater("columnSizing", table),
|
|
1038
|
+
onColumnSizingInfoChange: makeStateUpdater("columnSizingInfo", table)
|
|
1039
|
+
};
|
|
1040
|
+
},
|
|
1041
|
+
createColumn: (column, table) => {
|
|
1042
|
+
column.getSize = () => {
|
|
1043
|
+
var _column$columnDef$min, _ref, _column$columnDef$max;
|
|
1044
|
+
const columnSize = table.getState().columnSizing[column.id];
|
|
1045
|
+
return Math.min(Math.max((_column$columnDef$min = column.columnDef.minSize) != null ? _column$columnDef$min : defaultColumnSizing.minSize, (_ref = columnSize != null ? columnSize : column.columnDef.size) != null ? _ref : defaultColumnSizing.size), (_column$columnDef$max = column.columnDef.maxSize) != null ? _column$columnDef$max : defaultColumnSizing.maxSize);
|
|
1046
|
+
};
|
|
1047
|
+
column.getStart = memo((position) => [
|
|
1048
|
+
position,
|
|
1049
|
+
_getVisibleLeafColumns(table, position),
|
|
1050
|
+
table.getState().columnSizing
|
|
1051
|
+
], (position, columns) => columns.slice(0, column.getIndex(position)).reduce((sum, column) => sum + column.getSize(), 0), getMemoOptions(table.options, "debugColumns"));
|
|
1052
|
+
column.getAfter = memo((position) => [
|
|
1053
|
+
position,
|
|
1054
|
+
_getVisibleLeafColumns(table, position),
|
|
1055
|
+
table.getState().columnSizing
|
|
1056
|
+
], (position, columns) => columns.slice(column.getIndex(position) + 1).reduce((sum, column) => sum + column.getSize(), 0), getMemoOptions(table.options, "debugColumns"));
|
|
1057
|
+
column.resetSize = () => {
|
|
1058
|
+
table.setColumnSizing((_ref2) => {
|
|
1059
|
+
let { [column.id]: _, ...rest } = _ref2;
|
|
1060
|
+
return rest;
|
|
1061
|
+
});
|
|
1062
|
+
};
|
|
1063
|
+
column.getCanResize = () => {
|
|
1064
|
+
var _column$columnDef$ena, _table$options$enable;
|
|
1065
|
+
return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnResizing) != null ? _table$options$enable : true);
|
|
1066
|
+
};
|
|
1067
|
+
column.getIsResizing = () => {
|
|
1068
|
+
return table.getState().columnSizingInfo.isResizingColumn === column.id;
|
|
1069
|
+
};
|
|
1070
|
+
},
|
|
1071
|
+
createHeader: (header, table) => {
|
|
1072
|
+
header.getSize = () => {
|
|
1073
|
+
let sum = 0;
|
|
1074
|
+
const recurse = (header) => {
|
|
1075
|
+
if (header.subHeaders.length) header.subHeaders.forEach(recurse);
|
|
1076
|
+
else {
|
|
1077
|
+
var _header$column$getSiz;
|
|
1078
|
+
sum += (_header$column$getSiz = header.column.getSize()) != null ? _header$column$getSiz : 0;
|
|
1079
|
+
}
|
|
1080
|
+
};
|
|
1081
|
+
recurse(header);
|
|
1082
|
+
return sum;
|
|
1083
|
+
};
|
|
1084
|
+
header.getStart = () => {
|
|
1085
|
+
if (header.index > 0) {
|
|
1086
|
+
const prevSiblingHeader = header.headerGroup.headers[header.index - 1];
|
|
1087
|
+
return prevSiblingHeader.getStart() + prevSiblingHeader.getSize();
|
|
1088
|
+
}
|
|
1089
|
+
return 0;
|
|
1090
|
+
};
|
|
1091
|
+
header.getResizeHandler = (_contextDocument) => {
|
|
1092
|
+
const column = table.getColumn(header.column.id);
|
|
1093
|
+
const canResize = column == null ? void 0 : column.getCanResize();
|
|
1094
|
+
return (e) => {
|
|
1095
|
+
if (!column || !canResize) return;
|
|
1096
|
+
e.persist == null || e.persist();
|
|
1097
|
+
if (isTouchStartEvent(e)) {
|
|
1098
|
+
if (e.touches && e.touches.length > 1) return;
|
|
1099
|
+
}
|
|
1100
|
+
const startSize = header.getSize();
|
|
1101
|
+
const columnSizingStart = header ? header.getLeafHeaders().map((d) => [d.column.id, d.column.getSize()]) : [[column.id, column.getSize()]];
|
|
1102
|
+
const clientX = isTouchStartEvent(e) ? Math.round(e.touches[0].clientX) : e.clientX;
|
|
1103
|
+
const newColumnSizing = {};
|
|
1104
|
+
const updateOffset = (eventType, clientXPos) => {
|
|
1105
|
+
if (typeof clientXPos !== "number") return;
|
|
1106
|
+
table.setColumnSizingInfo((old) => {
|
|
1107
|
+
var _old$startOffset, _old$startSize;
|
|
1108
|
+
const deltaDirection = table.options.columnResizeDirection === "rtl" ? -1 : 1;
|
|
1109
|
+
const deltaOffset = (clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0)) * deltaDirection;
|
|
1110
|
+
const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
|
|
1111
|
+
old.columnSizingStart.forEach((_ref3) => {
|
|
1112
|
+
let [columnId, headerSize] = _ref3;
|
|
1113
|
+
newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
|
|
1114
|
+
});
|
|
1115
|
+
return {
|
|
1116
|
+
...old,
|
|
1117
|
+
deltaOffset,
|
|
1118
|
+
deltaPercentage
|
|
1119
|
+
};
|
|
1120
|
+
});
|
|
1121
|
+
if (table.options.columnResizeMode === "onChange" || eventType === "end") table.setColumnSizing((old) => ({
|
|
1122
|
+
...old,
|
|
1123
|
+
...newColumnSizing
|
|
1124
|
+
}));
|
|
1125
|
+
};
|
|
1126
|
+
const onMove = (clientXPos) => updateOffset("move", clientXPos);
|
|
1127
|
+
const onEnd = (clientXPos) => {
|
|
1128
|
+
updateOffset("end", clientXPos);
|
|
1129
|
+
table.setColumnSizingInfo((old) => ({
|
|
1130
|
+
...old,
|
|
1131
|
+
isResizingColumn: false,
|
|
1132
|
+
startOffset: null,
|
|
1133
|
+
startSize: null,
|
|
1134
|
+
deltaOffset: null,
|
|
1135
|
+
deltaPercentage: null,
|
|
1136
|
+
columnSizingStart: []
|
|
1137
|
+
}));
|
|
1138
|
+
};
|
|
1139
|
+
const contextDocument = safelyAccessDocument(_contextDocument);
|
|
1140
|
+
const mouseEvents = {
|
|
1141
|
+
moveHandler: (e) => onMove(e.clientX),
|
|
1142
|
+
upHandler: (e) => {
|
|
1143
|
+
contextDocument?.removeEventListener("mousemove", mouseEvents.moveHandler);
|
|
1144
|
+
contextDocument?.removeEventListener("mouseup", mouseEvents.upHandler);
|
|
1145
|
+
onEnd(e.clientX);
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1148
|
+
const touchEvents = {
|
|
1149
|
+
moveHandler: (e) => {
|
|
1150
|
+
if (e.cancelable) {
|
|
1151
|
+
e.preventDefault();
|
|
1152
|
+
e.stopPropagation();
|
|
1153
|
+
}
|
|
1154
|
+
onMove(e.touches[0].clientX);
|
|
1155
|
+
return false;
|
|
1156
|
+
},
|
|
1157
|
+
upHandler: (e) => {
|
|
1158
|
+
var _e$touches$;
|
|
1159
|
+
contextDocument?.removeEventListener("touchmove", touchEvents.moveHandler);
|
|
1160
|
+
contextDocument?.removeEventListener("touchend", touchEvents.upHandler);
|
|
1161
|
+
if (e.cancelable) {
|
|
1162
|
+
e.preventDefault();
|
|
1163
|
+
e.stopPropagation();
|
|
1164
|
+
}
|
|
1165
|
+
onEnd((_e$touches$ = e.touches[0]) == null ? void 0 : _e$touches$.clientX);
|
|
1166
|
+
}
|
|
1167
|
+
};
|
|
1168
|
+
const passiveIfSupported = passiveEventSupported() ? { passive: false } : false;
|
|
1169
|
+
if (isTouchStartEvent(e)) {
|
|
1170
|
+
contextDocument?.addEventListener("touchmove", touchEvents.moveHandler, passiveIfSupported);
|
|
1171
|
+
contextDocument?.addEventListener("touchend", touchEvents.upHandler, passiveIfSupported);
|
|
1172
|
+
} else {
|
|
1173
|
+
contextDocument?.addEventListener("mousemove", mouseEvents.moveHandler, passiveIfSupported);
|
|
1174
|
+
contextDocument?.addEventListener("mouseup", mouseEvents.upHandler, passiveIfSupported);
|
|
1175
|
+
}
|
|
1176
|
+
table.setColumnSizingInfo((old) => ({
|
|
1177
|
+
...old,
|
|
1178
|
+
startOffset: clientX,
|
|
1179
|
+
startSize,
|
|
1180
|
+
deltaOffset: 0,
|
|
1181
|
+
deltaPercentage: 0,
|
|
1182
|
+
columnSizingStart,
|
|
1183
|
+
isResizingColumn: column.id
|
|
1184
|
+
}));
|
|
1185
|
+
};
|
|
1186
|
+
};
|
|
1187
|
+
},
|
|
1188
|
+
createTable: (table) => {
|
|
1189
|
+
table.setColumnSizing = (updater) => table.options.onColumnSizingChange == null ? void 0 : table.options.onColumnSizingChange(updater);
|
|
1190
|
+
table.setColumnSizingInfo = (updater) => table.options.onColumnSizingInfoChange == null ? void 0 : table.options.onColumnSizingInfoChange(updater);
|
|
1191
|
+
table.resetColumnSizing = (defaultState) => {
|
|
1192
|
+
var _table$initialState$c;
|
|
1193
|
+
table.setColumnSizing(defaultState ? {} : (_table$initialState$c = table.initialState.columnSizing) != null ? _table$initialState$c : {});
|
|
1194
|
+
};
|
|
1195
|
+
table.resetHeaderSizeInfo = (defaultState) => {
|
|
1196
|
+
var _table$initialState$c2;
|
|
1197
|
+
table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_table$initialState$c2 = table.initialState.columnSizingInfo) != null ? _table$initialState$c2 : getDefaultColumnSizingInfoState());
|
|
1198
|
+
};
|
|
1199
|
+
table.getTotalSize = () => {
|
|
1200
|
+
var _table$getHeaderGroup, _table$getHeaderGroup2;
|
|
1201
|
+
return (_table$getHeaderGroup = (_table$getHeaderGroup2 = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup2.headers.reduce((sum, header) => {
|
|
1202
|
+
return sum + header.getSize();
|
|
1203
|
+
}, 0)) != null ? _table$getHeaderGroup : 0;
|
|
1204
|
+
};
|
|
1205
|
+
table.getLeftTotalSize = () => {
|
|
1206
|
+
var _table$getLeftHeaderG, _table$getLeftHeaderG2;
|
|
1207
|
+
return (_table$getLeftHeaderG = (_table$getLeftHeaderG2 = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG2.headers.reduce((sum, header) => {
|
|
1208
|
+
return sum + header.getSize();
|
|
1209
|
+
}, 0)) != null ? _table$getLeftHeaderG : 0;
|
|
1210
|
+
};
|
|
1211
|
+
table.getCenterTotalSize = () => {
|
|
1212
|
+
var _table$getCenterHeade, _table$getCenterHeade2;
|
|
1213
|
+
return (_table$getCenterHeade = (_table$getCenterHeade2 = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade2.headers.reduce((sum, header) => {
|
|
1214
|
+
return sum + header.getSize();
|
|
1215
|
+
}, 0)) != null ? _table$getCenterHeade : 0;
|
|
1216
|
+
};
|
|
1217
|
+
table.getRightTotalSize = () => {
|
|
1218
|
+
var _table$getRightHeader, _table$getRightHeader2;
|
|
1219
|
+
return (_table$getRightHeader = (_table$getRightHeader2 = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader2.headers.reduce((sum, header) => {
|
|
1220
|
+
return sum + header.getSize();
|
|
1221
|
+
}, 0)) != null ? _table$getRightHeader : 0;
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
var passiveSupported = null;
|
|
1226
|
+
function passiveEventSupported() {
|
|
1227
|
+
if (typeof passiveSupported === "boolean") return passiveSupported;
|
|
1228
|
+
let supported = false;
|
|
1229
|
+
try {
|
|
1230
|
+
const options = { get passive() {
|
|
1231
|
+
supported = true;
|
|
1232
|
+
return false;
|
|
1233
|
+
} };
|
|
1234
|
+
const noop = () => {};
|
|
1235
|
+
(void 0).addEventListener("test", noop, options);
|
|
1236
|
+
(void 0).removeEventListener("test", noop);
|
|
1237
|
+
} catch (err) {
|
|
1238
|
+
supported = false;
|
|
1239
|
+
}
|
|
1240
|
+
passiveSupported = supported;
|
|
1241
|
+
return passiveSupported;
|
|
1242
|
+
}
|
|
1243
|
+
function isTouchStartEvent(e) {
|
|
1244
|
+
return e.type === "touchstart";
|
|
1245
|
+
}
|
|
1246
|
+
var ColumnVisibility = {
|
|
1247
|
+
getInitialState: (state) => {
|
|
1248
|
+
return {
|
|
1249
|
+
columnVisibility: {},
|
|
1250
|
+
...state
|
|
1251
|
+
};
|
|
1252
|
+
},
|
|
1253
|
+
getDefaultOptions: (table) => {
|
|
1254
|
+
return { onColumnVisibilityChange: makeStateUpdater("columnVisibility", table) };
|
|
1255
|
+
},
|
|
1256
|
+
createColumn: (column, table) => {
|
|
1257
|
+
column.toggleVisibility = (value) => {
|
|
1258
|
+
if (column.getCanHide()) table.setColumnVisibility((old) => ({
|
|
1259
|
+
...old,
|
|
1260
|
+
[column.id]: value != null ? value : !column.getIsVisible()
|
|
1261
|
+
}));
|
|
1262
|
+
};
|
|
1263
|
+
column.getIsVisible = () => {
|
|
1264
|
+
var _ref, _table$getState$colum;
|
|
1265
|
+
const childColumns = column.columns;
|
|
1266
|
+
return (_ref = childColumns.length ? childColumns.some((c) => c.getIsVisible()) : (_table$getState$colum = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum[column.id]) != null ? _ref : true;
|
|
1267
|
+
};
|
|
1268
|
+
column.getCanHide = () => {
|
|
1269
|
+
var _column$columnDef$ena, _table$options$enable;
|
|
1270
|
+
return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableHiding) != null ? _table$options$enable : true);
|
|
1271
|
+
};
|
|
1272
|
+
column.getToggleVisibilityHandler = () => {
|
|
1273
|
+
return (e) => {
|
|
1274
|
+
column.toggleVisibility == null || column.toggleVisibility(e.target.checked);
|
|
1275
|
+
};
|
|
1276
|
+
};
|
|
1277
|
+
},
|
|
1278
|
+
createRow: (row, table) => {
|
|
1279
|
+
row._getAllVisibleCells = memo(() => [row.getAllCells(), table.getState().columnVisibility], (cells) => {
|
|
1280
|
+
return cells.filter((cell) => cell.column.getIsVisible());
|
|
1281
|
+
}, getMemoOptions(table.options, "debugRows"));
|
|
1282
|
+
row.getVisibleCells = memo(() => [
|
|
1283
|
+
row.getLeftVisibleCells(),
|
|
1284
|
+
row.getCenterVisibleCells(),
|
|
1285
|
+
row.getRightVisibleCells()
|
|
1286
|
+
], (left, center, right) => [
|
|
1287
|
+
...left,
|
|
1288
|
+
...center,
|
|
1289
|
+
...right
|
|
1290
|
+
], getMemoOptions(table.options, "debugRows"));
|
|
1291
|
+
},
|
|
1292
|
+
createTable: (table) => {
|
|
1293
|
+
const makeVisibleColumnsMethod = (key, getColumns) => {
|
|
1294
|
+
return memo(() => [getColumns(), getColumns().filter((d) => d.getIsVisible()).map((d) => d.id).join("_")], (columns) => {
|
|
1295
|
+
return columns.filter((d) => d.getIsVisible == null ? void 0 : d.getIsVisible());
|
|
1296
|
+
}, getMemoOptions(table.options, "debugColumns"));
|
|
1297
|
+
};
|
|
1298
|
+
table.getVisibleFlatColumns = makeVisibleColumnsMethod("getVisibleFlatColumns", () => table.getAllFlatColumns());
|
|
1299
|
+
table.getVisibleLeafColumns = makeVisibleColumnsMethod("getVisibleLeafColumns", () => table.getAllLeafColumns());
|
|
1300
|
+
table.getLeftVisibleLeafColumns = makeVisibleColumnsMethod("getLeftVisibleLeafColumns", () => table.getLeftLeafColumns());
|
|
1301
|
+
table.getRightVisibleLeafColumns = makeVisibleColumnsMethod("getRightVisibleLeafColumns", () => table.getRightLeafColumns());
|
|
1302
|
+
table.getCenterVisibleLeafColumns = makeVisibleColumnsMethod("getCenterVisibleLeafColumns", () => table.getCenterLeafColumns());
|
|
1303
|
+
table.setColumnVisibility = (updater) => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater);
|
|
1304
|
+
table.resetColumnVisibility = (defaultState) => {
|
|
1305
|
+
var _table$initialState$c;
|
|
1306
|
+
table.setColumnVisibility(defaultState ? {} : (_table$initialState$c = table.initialState.columnVisibility) != null ? _table$initialState$c : {});
|
|
1307
|
+
};
|
|
1308
|
+
table.toggleAllColumnsVisible = (value) => {
|
|
1309
|
+
var _value;
|
|
1310
|
+
value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();
|
|
1311
|
+
table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({
|
|
1312
|
+
...obj,
|
|
1313
|
+
[column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value
|
|
1314
|
+
}), {}));
|
|
1315
|
+
};
|
|
1316
|
+
table.getIsAllColumnsVisible = () => !table.getAllLeafColumns().some((column) => !(column.getIsVisible != null && column.getIsVisible()));
|
|
1317
|
+
table.getIsSomeColumnsVisible = () => table.getAllLeafColumns().some((column) => column.getIsVisible == null ? void 0 : column.getIsVisible());
|
|
1318
|
+
table.getToggleAllColumnsVisibilityHandler = () => {
|
|
1319
|
+
return (e) => {
|
|
1320
|
+
var _target;
|
|
1321
|
+
table.toggleAllColumnsVisible((_target = e.target) == null ? void 0 : _target.checked);
|
|
1322
|
+
};
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1325
|
+
};
|
|
1326
|
+
function _getVisibleLeafColumns(table, position) {
|
|
1327
|
+
return !position ? table.getVisibleLeafColumns() : position === "center" ? table.getCenterVisibleLeafColumns() : position === "left" ? table.getLeftVisibleLeafColumns() : table.getRightVisibleLeafColumns();
|
|
1328
|
+
}
|
|
1329
|
+
var GlobalFaceting = { createTable: (table) => {
|
|
1330
|
+
table._getGlobalFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, "__global__");
|
|
1331
|
+
table.getGlobalFacetedRowModel = () => {
|
|
1332
|
+
if (table.options.manualFiltering || !table._getGlobalFacetedRowModel) return table.getPreFilteredRowModel();
|
|
1333
|
+
return table._getGlobalFacetedRowModel();
|
|
1334
|
+
};
|
|
1335
|
+
table._getGlobalFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, "__global__");
|
|
1336
|
+
table.getGlobalFacetedUniqueValues = () => {
|
|
1337
|
+
if (!table._getGlobalFacetedUniqueValues) return /* @__PURE__ */ new Map();
|
|
1338
|
+
return table._getGlobalFacetedUniqueValues();
|
|
1339
|
+
};
|
|
1340
|
+
table._getGlobalFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, "__global__");
|
|
1341
|
+
table.getGlobalFacetedMinMaxValues = () => {
|
|
1342
|
+
if (!table._getGlobalFacetedMinMaxValues) return;
|
|
1343
|
+
return table._getGlobalFacetedMinMaxValues();
|
|
1344
|
+
};
|
|
1345
|
+
} };
|
|
1346
|
+
var GlobalFiltering = {
|
|
1347
|
+
getInitialState: (state) => {
|
|
1348
|
+
return {
|
|
1349
|
+
globalFilter: void 0,
|
|
1350
|
+
...state
|
|
1351
|
+
};
|
|
1352
|
+
},
|
|
1353
|
+
getDefaultOptions: (table) => {
|
|
1354
|
+
return {
|
|
1355
|
+
onGlobalFilterChange: makeStateUpdater("globalFilter", table),
|
|
1356
|
+
globalFilterFn: "auto",
|
|
1357
|
+
getColumnCanGlobalFilter: (column) => {
|
|
1358
|
+
var _table$getCoreRowMode;
|
|
1359
|
+
const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null || (_table$getCoreRowMode = _table$getCoreRowMode._getAllCellsByColumnId()[column.id]) == null ? void 0 : _table$getCoreRowMode.getValue();
|
|
1360
|
+
return typeof value === "string" || typeof value === "number";
|
|
1361
|
+
}
|
|
1362
|
+
};
|
|
1363
|
+
},
|
|
1364
|
+
createColumn: (column, table) => {
|
|
1365
|
+
column.getCanGlobalFilter = () => {
|
|
1366
|
+
var _column$columnDef$ena, _table$options$enable, _table$options$enable2, _table$options$getCol;
|
|
1367
|
+
return ((_column$columnDef$ena = column.columnDef.enableGlobalFilter) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableGlobalFilter) != null ? _table$options$enable : true) && ((_table$options$enable2 = table.options.enableFilters) != null ? _table$options$enable2 : true) && ((_table$options$getCol = table.options.getColumnCanGlobalFilter == null ? void 0 : table.options.getColumnCanGlobalFilter(column)) != null ? _table$options$getCol : true) && !!column.accessorFn;
|
|
1368
|
+
};
|
|
1369
|
+
},
|
|
1370
|
+
createTable: (table) => {
|
|
1371
|
+
table.getGlobalAutoFilterFn = () => {
|
|
1372
|
+
return filterFns.includesString;
|
|
1373
|
+
};
|
|
1374
|
+
table.getGlobalFilterFn = () => {
|
|
1375
|
+
var _table$options$filter, _table$options$filter2;
|
|
1376
|
+
const { globalFilterFn } = table.options;
|
|
1377
|
+
return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === "auto" ? table.getGlobalAutoFilterFn() : (_table$options$filter = (_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[globalFilterFn]) != null ? _table$options$filter : filterFns[globalFilterFn];
|
|
1378
|
+
};
|
|
1379
|
+
table.setGlobalFilter = (updater) => {
|
|
1380
|
+
table.options.onGlobalFilterChange == null || table.options.onGlobalFilterChange(updater);
|
|
1381
|
+
};
|
|
1382
|
+
table.resetGlobalFilter = (defaultState) => {
|
|
1383
|
+
table.setGlobalFilter(defaultState ? void 0 : table.initialState.globalFilter);
|
|
1384
|
+
};
|
|
1385
|
+
}
|
|
1386
|
+
};
|
|
1387
|
+
var RowExpanding = {
|
|
1388
|
+
getInitialState: (state) => {
|
|
1389
|
+
return {
|
|
1390
|
+
expanded: {},
|
|
1391
|
+
...state
|
|
1392
|
+
};
|
|
1393
|
+
},
|
|
1394
|
+
getDefaultOptions: (table) => {
|
|
1395
|
+
return {
|
|
1396
|
+
onExpandedChange: makeStateUpdater("expanded", table),
|
|
1397
|
+
paginateExpandedRows: true
|
|
1398
|
+
};
|
|
1399
|
+
},
|
|
1400
|
+
createTable: (table) => {
|
|
1401
|
+
let registered = false;
|
|
1402
|
+
let queued = false;
|
|
1403
|
+
table._autoResetExpanded = () => {
|
|
1404
|
+
var _ref, _table$options$autoRe;
|
|
1405
|
+
if (!registered) {
|
|
1406
|
+
table._queue(() => {
|
|
1407
|
+
registered = true;
|
|
1408
|
+
});
|
|
1409
|
+
return;
|
|
1410
|
+
}
|
|
1411
|
+
if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetExpanded) != null ? _ref : !table.options.manualExpanding) {
|
|
1412
|
+
if (queued) return;
|
|
1413
|
+
queued = true;
|
|
1414
|
+
table._queue(() => {
|
|
1415
|
+
table.resetExpanded();
|
|
1416
|
+
queued = false;
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
};
|
|
1420
|
+
table.setExpanded = (updater) => table.options.onExpandedChange == null ? void 0 : table.options.onExpandedChange(updater);
|
|
1421
|
+
table.toggleAllRowsExpanded = (expanded) => {
|
|
1422
|
+
if (expanded != null ? expanded : !table.getIsAllRowsExpanded()) table.setExpanded(true);
|
|
1423
|
+
else table.setExpanded({});
|
|
1424
|
+
};
|
|
1425
|
+
table.resetExpanded = (defaultState) => {
|
|
1426
|
+
var _table$initialState$e, _table$initialState;
|
|
1427
|
+
table.setExpanded(defaultState ? {} : (_table$initialState$e = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) != null ? _table$initialState$e : {});
|
|
1428
|
+
};
|
|
1429
|
+
table.getCanSomeRowsExpand = () => {
|
|
1430
|
+
return table.getPrePaginationRowModel().flatRows.some((row) => row.getCanExpand());
|
|
1431
|
+
};
|
|
1432
|
+
table.getToggleAllRowsExpandedHandler = () => {
|
|
1433
|
+
return (e) => {
|
|
1434
|
+
e.persist == null || e.persist();
|
|
1435
|
+
table.toggleAllRowsExpanded();
|
|
1436
|
+
};
|
|
1437
|
+
};
|
|
1438
|
+
table.getIsSomeRowsExpanded = () => {
|
|
1439
|
+
const expanded = table.getState().expanded;
|
|
1440
|
+
return expanded === true || Object.values(expanded).some(Boolean);
|
|
1441
|
+
};
|
|
1442
|
+
table.getIsAllRowsExpanded = () => {
|
|
1443
|
+
const expanded = table.getState().expanded;
|
|
1444
|
+
if (typeof expanded === "boolean") return expanded === true;
|
|
1445
|
+
if (!Object.keys(expanded).length) return false;
|
|
1446
|
+
if (table.getRowModel().flatRows.some((row) => !row.getIsExpanded())) return false;
|
|
1447
|
+
return true;
|
|
1448
|
+
};
|
|
1449
|
+
table.getExpandedDepth = () => {
|
|
1450
|
+
let maxDepth = 0;
|
|
1451
|
+
(table.getState().expanded === true ? Object.keys(table.getRowModel().rowsById) : Object.keys(table.getState().expanded)).forEach((id) => {
|
|
1452
|
+
const splitId = id.split(".");
|
|
1453
|
+
maxDepth = Math.max(maxDepth, splitId.length);
|
|
1454
|
+
});
|
|
1455
|
+
return maxDepth;
|
|
1456
|
+
};
|
|
1457
|
+
table.getPreExpandedRowModel = () => table.getSortedRowModel();
|
|
1458
|
+
table.getExpandedRowModel = () => {
|
|
1459
|
+
if (!table._getExpandedRowModel && table.options.getExpandedRowModel) table._getExpandedRowModel = table.options.getExpandedRowModel(table);
|
|
1460
|
+
if (table.options.manualExpanding || !table._getExpandedRowModel) return table.getPreExpandedRowModel();
|
|
1461
|
+
return table._getExpandedRowModel();
|
|
1462
|
+
};
|
|
1463
|
+
},
|
|
1464
|
+
createRow: (row, table) => {
|
|
1465
|
+
row.toggleExpanded = (expanded) => {
|
|
1466
|
+
table.setExpanded((old) => {
|
|
1467
|
+
var _expanded;
|
|
1468
|
+
const exists = old === true ? true : !!(old != null && old[row.id]);
|
|
1469
|
+
let oldExpanded = {};
|
|
1470
|
+
if (old === true) Object.keys(table.getRowModel().rowsById).forEach((rowId) => {
|
|
1471
|
+
oldExpanded[rowId] = true;
|
|
1472
|
+
});
|
|
1473
|
+
else oldExpanded = old;
|
|
1474
|
+
expanded = (_expanded = expanded) != null ? _expanded : !exists;
|
|
1475
|
+
if (!exists && expanded) return {
|
|
1476
|
+
...oldExpanded,
|
|
1477
|
+
[row.id]: true
|
|
1478
|
+
};
|
|
1479
|
+
if (exists && !expanded) {
|
|
1480
|
+
const { [row.id]: _, ...rest } = oldExpanded;
|
|
1481
|
+
return rest;
|
|
1482
|
+
}
|
|
1483
|
+
return old;
|
|
1484
|
+
});
|
|
1485
|
+
};
|
|
1486
|
+
row.getIsExpanded = () => {
|
|
1487
|
+
var _table$options$getIsR;
|
|
1488
|
+
const expanded = table.getState().expanded;
|
|
1489
|
+
return !!((_table$options$getIsR = table.options.getIsRowExpanded == null ? void 0 : table.options.getIsRowExpanded(row)) != null ? _table$options$getIsR : expanded === true || (expanded == null ? void 0 : expanded[row.id]));
|
|
1490
|
+
};
|
|
1491
|
+
row.getCanExpand = () => {
|
|
1492
|
+
var _table$options$getRow, _table$options$enable, _row$subRows;
|
|
1493
|
+
return (_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
|
|
1494
|
+
};
|
|
1495
|
+
row.getIsAllParentsExpanded = () => {
|
|
1496
|
+
let isFullyExpanded = true;
|
|
1497
|
+
let currentRow = row;
|
|
1498
|
+
while (isFullyExpanded && currentRow.parentId) {
|
|
1499
|
+
currentRow = table.getRow(currentRow.parentId, true);
|
|
1500
|
+
isFullyExpanded = currentRow.getIsExpanded();
|
|
1501
|
+
}
|
|
1502
|
+
return isFullyExpanded;
|
|
1503
|
+
};
|
|
1504
|
+
row.getToggleExpandedHandler = () => {
|
|
1505
|
+
const canExpand = row.getCanExpand();
|
|
1506
|
+
return () => {
|
|
1507
|
+
if (!canExpand) return;
|
|
1508
|
+
row.toggleExpanded();
|
|
1509
|
+
};
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
};
|
|
1513
|
+
var defaultPageIndex = 0;
|
|
1514
|
+
var defaultPageSize = 10;
|
|
1515
|
+
var getDefaultPaginationState = () => ({
|
|
1516
|
+
pageIndex: defaultPageIndex,
|
|
1517
|
+
pageSize: defaultPageSize
|
|
1518
|
+
});
|
|
1519
|
+
var RowPagination = {
|
|
1520
|
+
getInitialState: (state) => {
|
|
1521
|
+
return {
|
|
1522
|
+
...state,
|
|
1523
|
+
pagination: {
|
|
1524
|
+
...getDefaultPaginationState(),
|
|
1525
|
+
...state == null ? void 0 : state.pagination
|
|
1526
|
+
}
|
|
1527
|
+
};
|
|
1528
|
+
},
|
|
1529
|
+
getDefaultOptions: (table) => {
|
|
1530
|
+
return { onPaginationChange: makeStateUpdater("pagination", table) };
|
|
1531
|
+
},
|
|
1532
|
+
createTable: (table) => {
|
|
1533
|
+
let registered = false;
|
|
1534
|
+
let queued = false;
|
|
1535
|
+
table._autoResetPageIndex = () => {
|
|
1536
|
+
var _ref, _table$options$autoRe;
|
|
1537
|
+
if (!registered) {
|
|
1538
|
+
table._queue(() => {
|
|
1539
|
+
registered = true;
|
|
1540
|
+
});
|
|
1541
|
+
return;
|
|
1542
|
+
}
|
|
1543
|
+
if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetPageIndex) != null ? _ref : !table.options.manualPagination) {
|
|
1544
|
+
if (queued) return;
|
|
1545
|
+
queued = true;
|
|
1546
|
+
table._queue(() => {
|
|
1547
|
+
table.resetPageIndex();
|
|
1548
|
+
queued = false;
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
table.setPagination = (updater) => {
|
|
1553
|
+
const safeUpdater = (old) => {
|
|
1554
|
+
return functionalUpdate(updater, old);
|
|
1555
|
+
};
|
|
1556
|
+
return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);
|
|
1557
|
+
};
|
|
1558
|
+
table.resetPagination = (defaultState) => {
|
|
1559
|
+
var _table$initialState$p;
|
|
1560
|
+
table.setPagination(defaultState ? getDefaultPaginationState() : (_table$initialState$p = table.initialState.pagination) != null ? _table$initialState$p : getDefaultPaginationState());
|
|
1561
|
+
};
|
|
1562
|
+
table.setPageIndex = (updater) => {
|
|
1563
|
+
table.setPagination((old) => {
|
|
1564
|
+
let pageIndex = functionalUpdate(updater, old.pageIndex);
|
|
1565
|
+
const maxPageIndex = typeof table.options.pageCount === "undefined" || table.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : table.options.pageCount - 1;
|
|
1566
|
+
pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex));
|
|
1567
|
+
return {
|
|
1568
|
+
...old,
|
|
1569
|
+
pageIndex
|
|
1570
|
+
};
|
|
1571
|
+
});
|
|
1572
|
+
};
|
|
1573
|
+
table.resetPageIndex = (defaultState) => {
|
|
1574
|
+
var _table$initialState$p2, _table$initialState;
|
|
1575
|
+
table.setPageIndex(defaultState ? defaultPageIndex : (_table$initialState$p2 = (_table$initialState = table.initialState) == null || (_table$initialState = _table$initialState.pagination) == null ? void 0 : _table$initialState.pageIndex) != null ? _table$initialState$p2 : defaultPageIndex);
|
|
1576
|
+
};
|
|
1577
|
+
table.resetPageSize = (defaultState) => {
|
|
1578
|
+
var _table$initialState$p3, _table$initialState2;
|
|
1579
|
+
table.setPageSize(defaultState ? defaultPageSize : (_table$initialState$p3 = (_table$initialState2 = table.initialState) == null || (_table$initialState2 = _table$initialState2.pagination) == null ? void 0 : _table$initialState2.pageSize) != null ? _table$initialState$p3 : defaultPageSize);
|
|
1580
|
+
};
|
|
1581
|
+
table.setPageSize = (updater) => {
|
|
1582
|
+
table.setPagination((old) => {
|
|
1583
|
+
const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize));
|
|
1584
|
+
const topRowIndex = old.pageSize * old.pageIndex;
|
|
1585
|
+
const pageIndex = Math.floor(topRowIndex / pageSize);
|
|
1586
|
+
return {
|
|
1587
|
+
...old,
|
|
1588
|
+
pageIndex,
|
|
1589
|
+
pageSize
|
|
1590
|
+
};
|
|
1591
|
+
});
|
|
1592
|
+
};
|
|
1593
|
+
table.setPageCount = (updater) => table.setPagination((old) => {
|
|
1594
|
+
var _table$options$pageCo;
|
|
1595
|
+
let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
|
|
1596
|
+
if (typeof newPageCount === "number") newPageCount = Math.max(-1, newPageCount);
|
|
1597
|
+
return {
|
|
1598
|
+
...old,
|
|
1599
|
+
pageCount: newPageCount
|
|
1600
|
+
};
|
|
1601
|
+
});
|
|
1602
|
+
table.getPageOptions = memo(() => [table.getPageCount()], (pageCount) => {
|
|
1603
|
+
let pageOptions = [];
|
|
1604
|
+
if (pageCount && pageCount > 0) pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i);
|
|
1605
|
+
return pageOptions;
|
|
1606
|
+
}, getMemoOptions(table.options, "debugTable"));
|
|
1607
|
+
table.getCanPreviousPage = () => table.getState().pagination.pageIndex > 0;
|
|
1608
|
+
table.getCanNextPage = () => {
|
|
1609
|
+
const { pageIndex } = table.getState().pagination;
|
|
1610
|
+
const pageCount = table.getPageCount();
|
|
1611
|
+
if (pageCount === -1) return true;
|
|
1612
|
+
if (pageCount === 0) return false;
|
|
1613
|
+
return pageIndex < pageCount - 1;
|
|
1614
|
+
};
|
|
1615
|
+
table.previousPage = () => {
|
|
1616
|
+
return table.setPageIndex((old) => old - 1);
|
|
1617
|
+
};
|
|
1618
|
+
table.nextPage = () => {
|
|
1619
|
+
return table.setPageIndex((old) => {
|
|
1620
|
+
return old + 1;
|
|
1621
|
+
});
|
|
1622
|
+
};
|
|
1623
|
+
table.firstPage = () => {
|
|
1624
|
+
return table.setPageIndex(0);
|
|
1625
|
+
};
|
|
1626
|
+
table.lastPage = () => {
|
|
1627
|
+
return table.setPageIndex(table.getPageCount() - 1);
|
|
1628
|
+
};
|
|
1629
|
+
table.getPrePaginationRowModel = () => table.getExpandedRowModel();
|
|
1630
|
+
table.getPaginationRowModel = () => {
|
|
1631
|
+
if (!table._getPaginationRowModel && table.options.getPaginationRowModel) table._getPaginationRowModel = table.options.getPaginationRowModel(table);
|
|
1632
|
+
if (table.options.manualPagination || !table._getPaginationRowModel) return table.getPrePaginationRowModel();
|
|
1633
|
+
return table._getPaginationRowModel();
|
|
1634
|
+
};
|
|
1635
|
+
table.getPageCount = () => {
|
|
1636
|
+
var _table$options$pageCo2;
|
|
1637
|
+
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getRowCount() / table.getState().pagination.pageSize);
|
|
1638
|
+
};
|
|
1639
|
+
table.getRowCount = () => {
|
|
1640
|
+
var _table$options$rowCou;
|
|
1641
|
+
return (_table$options$rowCou = table.options.rowCount) != null ? _table$options$rowCou : table.getPrePaginationRowModel().rows.length;
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
};
|
|
1645
|
+
var getDefaultRowPinningState = () => ({
|
|
1646
|
+
top: [],
|
|
1647
|
+
bottom: []
|
|
1648
|
+
});
|
|
1649
|
+
var RowPinning = {
|
|
1650
|
+
getInitialState: (state) => {
|
|
1651
|
+
return {
|
|
1652
|
+
rowPinning: getDefaultRowPinningState(),
|
|
1653
|
+
...state
|
|
1654
|
+
};
|
|
1655
|
+
},
|
|
1656
|
+
getDefaultOptions: (table) => {
|
|
1657
|
+
return { onRowPinningChange: makeStateUpdater("rowPinning", table) };
|
|
1658
|
+
},
|
|
1659
|
+
createRow: (row, table) => {
|
|
1660
|
+
row.pin = (position, includeLeafRows, includeParentRows) => {
|
|
1661
|
+
const leafRowIds = includeLeafRows ? row.getLeafRows().map((_ref) => {
|
|
1662
|
+
let { id } = _ref;
|
|
1663
|
+
return id;
|
|
1664
|
+
}) : [];
|
|
1665
|
+
const parentRowIds = includeParentRows ? row.getParentRows().map((_ref2) => {
|
|
1666
|
+
let { id } = _ref2;
|
|
1667
|
+
return id;
|
|
1668
|
+
}) : [];
|
|
1669
|
+
const rowIds = /* @__PURE__ */ new Set([
|
|
1670
|
+
...parentRowIds,
|
|
1671
|
+
row.id,
|
|
1672
|
+
...leafRowIds
|
|
1673
|
+
]);
|
|
1674
|
+
table.setRowPinning((old) => {
|
|
1675
|
+
var _old$top3, _old$bottom3;
|
|
1676
|
+
if (position === "bottom") {
|
|
1677
|
+
var _old$top, _old$bottom;
|
|
1678
|
+
return {
|
|
1679
|
+
top: ((_old$top = old == null ? void 0 : old.top) != null ? _old$top : []).filter((d) => !(rowIds != null && rowIds.has(d))),
|
|
1680
|
+
bottom: [...((_old$bottom = old == null ? void 0 : old.bottom) != null ? _old$bottom : []).filter((d) => !(rowIds != null && rowIds.has(d))), ...Array.from(rowIds)]
|
|
1681
|
+
};
|
|
1682
|
+
}
|
|
1683
|
+
if (position === "top") {
|
|
1684
|
+
var _old$top2, _old$bottom2;
|
|
1685
|
+
return {
|
|
1686
|
+
top: [...((_old$top2 = old == null ? void 0 : old.top) != null ? _old$top2 : []).filter((d) => !(rowIds != null && rowIds.has(d))), ...Array.from(rowIds)],
|
|
1687
|
+
bottom: ((_old$bottom2 = old == null ? void 0 : old.bottom) != null ? _old$bottom2 : []).filter((d) => !(rowIds != null && rowIds.has(d)))
|
|
1688
|
+
};
|
|
1689
|
+
}
|
|
1690
|
+
return {
|
|
1691
|
+
top: ((_old$top3 = old == null ? void 0 : old.top) != null ? _old$top3 : []).filter((d) => !(rowIds != null && rowIds.has(d))),
|
|
1692
|
+
bottom: ((_old$bottom3 = old == null ? void 0 : old.bottom) != null ? _old$bottom3 : []).filter((d) => !(rowIds != null && rowIds.has(d)))
|
|
1693
|
+
};
|
|
1694
|
+
});
|
|
1695
|
+
};
|
|
1696
|
+
row.getCanPin = () => {
|
|
1697
|
+
var _ref3;
|
|
1698
|
+
const { enableRowPinning, enablePinning } = table.options;
|
|
1699
|
+
if (typeof enableRowPinning === "function") return enableRowPinning(row);
|
|
1700
|
+
return (_ref3 = enableRowPinning != null ? enableRowPinning : enablePinning) != null ? _ref3 : true;
|
|
1701
|
+
};
|
|
1702
|
+
row.getIsPinned = () => {
|
|
1703
|
+
const rowIds = [row.id];
|
|
1704
|
+
const { top, bottom } = table.getState().rowPinning;
|
|
1705
|
+
const isTop = rowIds.some((d) => top == null ? void 0 : top.includes(d));
|
|
1706
|
+
const isBottom = rowIds.some((d) => bottom == null ? void 0 : bottom.includes(d));
|
|
1707
|
+
return isTop ? "top" : isBottom ? "bottom" : false;
|
|
1708
|
+
};
|
|
1709
|
+
row.getPinnedIndex = () => {
|
|
1710
|
+
var _ref4, _visiblePinnedRowIds$;
|
|
1711
|
+
const position = row.getIsPinned();
|
|
1712
|
+
if (!position) return -1;
|
|
1713
|
+
const visiblePinnedRowIds = (_ref4 = position === "top" ? table.getTopRows() : table.getBottomRows()) == null ? void 0 : _ref4.map((_ref5) => {
|
|
1714
|
+
let { id } = _ref5;
|
|
1715
|
+
return id;
|
|
1716
|
+
});
|
|
1717
|
+
return (_visiblePinnedRowIds$ = visiblePinnedRowIds == null ? void 0 : visiblePinnedRowIds.indexOf(row.id)) != null ? _visiblePinnedRowIds$ : -1;
|
|
1718
|
+
};
|
|
1719
|
+
},
|
|
1720
|
+
createTable: (table) => {
|
|
1721
|
+
table.setRowPinning = (updater) => table.options.onRowPinningChange == null ? void 0 : table.options.onRowPinningChange(updater);
|
|
1722
|
+
table.resetRowPinning = (defaultState) => {
|
|
1723
|
+
var _table$initialState$r, _table$initialState;
|
|
1724
|
+
return table.setRowPinning(defaultState ? getDefaultRowPinningState() : (_table$initialState$r = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.rowPinning) != null ? _table$initialState$r : getDefaultRowPinningState());
|
|
1725
|
+
};
|
|
1726
|
+
table.getIsSomeRowsPinned = (position) => {
|
|
1727
|
+
var _pinningState$positio;
|
|
1728
|
+
const pinningState = table.getState().rowPinning;
|
|
1729
|
+
if (!position) {
|
|
1730
|
+
var _pinningState$top, _pinningState$bottom;
|
|
1731
|
+
return Boolean(((_pinningState$top = pinningState.top) == null ? void 0 : _pinningState$top.length) || ((_pinningState$bottom = pinningState.bottom) == null ? void 0 : _pinningState$bottom.length));
|
|
1732
|
+
}
|
|
1733
|
+
return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
|
|
1734
|
+
};
|
|
1735
|
+
table._getPinnedRows = (visibleRows, pinnedRowIds, position) => {
|
|
1736
|
+
var _table$options$keepPi;
|
|
1737
|
+
return (((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ? (pinnedRowIds != null ? pinnedRowIds : []).map((rowId) => {
|
|
1738
|
+
const row = table.getRow(rowId, true);
|
|
1739
|
+
return row.getIsAllParentsExpanded() ? row : null;
|
|
1740
|
+
}) : (pinnedRowIds != null ? pinnedRowIds : []).map((rowId) => visibleRows.find((row) => row.id === rowId))).filter(Boolean).map((d) => ({
|
|
1741
|
+
...d,
|
|
1742
|
+
position
|
|
1743
|
+
}));
|
|
1744
|
+
};
|
|
1745
|
+
table.getTopRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top], (allRows, topPinnedRowIds) => table._getPinnedRows(allRows, topPinnedRowIds, "top"), getMemoOptions(table.options, "debugRows"));
|
|
1746
|
+
table.getBottomRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.bottom], (allRows, bottomPinnedRowIds) => table._getPinnedRows(allRows, bottomPinnedRowIds, "bottom"), getMemoOptions(table.options, "debugRows"));
|
|
1747
|
+
table.getCenterRows = memo(() => [
|
|
1748
|
+
table.getRowModel().rows,
|
|
1749
|
+
table.getState().rowPinning.top,
|
|
1750
|
+
table.getState().rowPinning.bottom
|
|
1751
|
+
], (allRows, top, bottom) => {
|
|
1752
|
+
const topAndBottom = /* @__PURE__ */ new Set([...top != null ? top : [], ...bottom != null ? bottom : []]);
|
|
1753
|
+
return allRows.filter((d) => !topAndBottom.has(d.id));
|
|
1754
|
+
}, getMemoOptions(table.options, "debugRows"));
|
|
1755
|
+
}
|
|
1756
|
+
};
|
|
1757
|
+
var RowSelection = {
|
|
1758
|
+
getInitialState: (state) => {
|
|
1759
|
+
return {
|
|
1760
|
+
rowSelection: {},
|
|
1761
|
+
...state
|
|
1762
|
+
};
|
|
1763
|
+
},
|
|
1764
|
+
getDefaultOptions: (table) => {
|
|
1765
|
+
return {
|
|
1766
|
+
onRowSelectionChange: makeStateUpdater("rowSelection", table),
|
|
1767
|
+
enableRowSelection: true,
|
|
1768
|
+
enableMultiRowSelection: true,
|
|
1769
|
+
enableSubRowSelection: true
|
|
1770
|
+
};
|
|
1771
|
+
},
|
|
1772
|
+
createTable: (table) => {
|
|
1773
|
+
table.setRowSelection = (updater) => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater);
|
|
1774
|
+
table.resetRowSelection = (defaultState) => {
|
|
1775
|
+
var _table$initialState$r;
|
|
1776
|
+
return table.setRowSelection(defaultState ? {} : (_table$initialState$r = table.initialState.rowSelection) != null ? _table$initialState$r : {});
|
|
1777
|
+
};
|
|
1778
|
+
table.toggleAllRowsSelected = (value) => {
|
|
1779
|
+
table.setRowSelection((old) => {
|
|
1780
|
+
value = typeof value !== "undefined" ? value : !table.getIsAllRowsSelected();
|
|
1781
|
+
const rowSelection = { ...old };
|
|
1782
|
+
const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows;
|
|
1783
|
+
if (value) preGroupedFlatRows.forEach((row) => {
|
|
1784
|
+
if (!row.getCanSelect()) return;
|
|
1785
|
+
rowSelection[row.id] = true;
|
|
1786
|
+
});
|
|
1787
|
+
else preGroupedFlatRows.forEach((row) => {
|
|
1788
|
+
delete rowSelection[row.id];
|
|
1789
|
+
});
|
|
1790
|
+
return rowSelection;
|
|
1791
|
+
});
|
|
1792
|
+
};
|
|
1793
|
+
table.toggleAllPageRowsSelected = (value) => table.setRowSelection((old) => {
|
|
1794
|
+
const resolvedValue = typeof value !== "undefined" ? value : !table.getIsAllPageRowsSelected();
|
|
1795
|
+
const rowSelection = { ...old };
|
|
1796
|
+
table.getRowModel().rows.forEach((row) => {
|
|
1797
|
+
mutateRowIsSelected(rowSelection, row.id, resolvedValue, true, table);
|
|
1798
|
+
});
|
|
1799
|
+
return rowSelection;
|
|
1800
|
+
});
|
|
1801
|
+
table.getPreSelectedRowModel = () => table.getCoreRowModel();
|
|
1802
|
+
table.getSelectedRowModel = memo(() => [table.getState().rowSelection, table.getCoreRowModel()], (rowSelection, rowModel) => {
|
|
1803
|
+
if (!Object.keys(rowSelection).length) return {
|
|
1804
|
+
rows: [],
|
|
1805
|
+
flatRows: [],
|
|
1806
|
+
rowsById: {}
|
|
1807
|
+
};
|
|
1808
|
+
return selectRowsFn(table, rowModel);
|
|
1809
|
+
}, getMemoOptions(table.options, "debugTable"));
|
|
1810
|
+
table.getFilteredSelectedRowModel = memo(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {
|
|
1811
|
+
if (!Object.keys(rowSelection).length) return {
|
|
1812
|
+
rows: [],
|
|
1813
|
+
flatRows: [],
|
|
1814
|
+
rowsById: {}
|
|
1815
|
+
};
|
|
1816
|
+
return selectRowsFn(table, rowModel);
|
|
1817
|
+
}, getMemoOptions(table.options, "debugTable"));
|
|
1818
|
+
table.getGroupedSelectedRowModel = memo(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {
|
|
1819
|
+
if (!Object.keys(rowSelection).length) return {
|
|
1820
|
+
rows: [],
|
|
1821
|
+
flatRows: [],
|
|
1822
|
+
rowsById: {}
|
|
1823
|
+
};
|
|
1824
|
+
return selectRowsFn(table, rowModel);
|
|
1825
|
+
}, getMemoOptions(table.options, "debugTable"));
|
|
1826
|
+
table.getIsAllRowsSelected = () => {
|
|
1827
|
+
const preGroupedFlatRows = table.getFilteredRowModel().flatRows;
|
|
1828
|
+
const { rowSelection } = table.getState();
|
|
1829
|
+
let isAllRowsSelected = Boolean(preGroupedFlatRows.length && Object.keys(rowSelection).length);
|
|
1830
|
+
if (isAllRowsSelected) {
|
|
1831
|
+
if (preGroupedFlatRows.some((row) => row.getCanSelect() && !rowSelection[row.id])) isAllRowsSelected = false;
|
|
1832
|
+
}
|
|
1833
|
+
return isAllRowsSelected;
|
|
1834
|
+
};
|
|
1835
|
+
table.getIsAllPageRowsSelected = () => {
|
|
1836
|
+
const paginationFlatRows = table.getPaginationRowModel().flatRows.filter((row) => row.getCanSelect());
|
|
1837
|
+
const { rowSelection } = table.getState();
|
|
1838
|
+
let isAllPageRowsSelected = !!paginationFlatRows.length;
|
|
1839
|
+
if (isAllPageRowsSelected && paginationFlatRows.some((row) => !rowSelection[row.id])) isAllPageRowsSelected = false;
|
|
1840
|
+
return isAllPageRowsSelected;
|
|
1841
|
+
};
|
|
1842
|
+
table.getIsSomeRowsSelected = () => {
|
|
1843
|
+
var _table$getState$rowSe;
|
|
1844
|
+
const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
|
|
1845
|
+
return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;
|
|
1846
|
+
};
|
|
1847
|
+
table.getIsSomePageRowsSelected = () => {
|
|
1848
|
+
const paginationFlatRows = table.getPaginationRowModel().flatRows;
|
|
1849
|
+
return table.getIsAllPageRowsSelected() ? false : paginationFlatRows.filter((row) => row.getCanSelect()).some((d) => d.getIsSelected() || d.getIsSomeSelected());
|
|
1850
|
+
};
|
|
1851
|
+
table.getToggleAllRowsSelectedHandler = () => {
|
|
1852
|
+
return (e) => {
|
|
1853
|
+
table.toggleAllRowsSelected(e.target.checked);
|
|
1854
|
+
};
|
|
1855
|
+
};
|
|
1856
|
+
table.getToggleAllPageRowsSelectedHandler = () => {
|
|
1857
|
+
return (e) => {
|
|
1858
|
+
table.toggleAllPageRowsSelected(e.target.checked);
|
|
1859
|
+
};
|
|
1860
|
+
};
|
|
1861
|
+
},
|
|
1862
|
+
createRow: (row, table) => {
|
|
1863
|
+
row.toggleSelected = (value, opts) => {
|
|
1864
|
+
const isSelected = row.getIsSelected();
|
|
1865
|
+
table.setRowSelection((old) => {
|
|
1866
|
+
var _opts$selectChildren;
|
|
1867
|
+
value = typeof value !== "undefined" ? value : !isSelected;
|
|
1868
|
+
if (row.getCanSelect() && isSelected === value) return old;
|
|
1869
|
+
const selectedRowIds = { ...old };
|
|
1870
|
+
mutateRowIsSelected(selectedRowIds, row.id, value, (_opts$selectChildren = opts == null ? void 0 : opts.selectChildren) != null ? _opts$selectChildren : true, table);
|
|
1871
|
+
return selectedRowIds;
|
|
1872
|
+
});
|
|
1873
|
+
};
|
|
1874
|
+
row.getIsSelected = () => {
|
|
1875
|
+
const { rowSelection } = table.getState();
|
|
1876
|
+
return isRowSelected(row, rowSelection);
|
|
1877
|
+
};
|
|
1878
|
+
row.getIsSomeSelected = () => {
|
|
1879
|
+
const { rowSelection } = table.getState();
|
|
1880
|
+
return isSubRowSelected(row, rowSelection) === "some";
|
|
1881
|
+
};
|
|
1882
|
+
row.getIsAllSubRowsSelected = () => {
|
|
1883
|
+
const { rowSelection } = table.getState();
|
|
1884
|
+
return isSubRowSelected(row, rowSelection) === "all";
|
|
1885
|
+
};
|
|
1886
|
+
row.getCanSelect = () => {
|
|
1887
|
+
var _table$options$enable;
|
|
1888
|
+
if (typeof table.options.enableRowSelection === "function") return table.options.enableRowSelection(row);
|
|
1889
|
+
return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;
|
|
1890
|
+
};
|
|
1891
|
+
row.getCanSelectSubRows = () => {
|
|
1892
|
+
var _table$options$enable2;
|
|
1893
|
+
if (typeof table.options.enableSubRowSelection === "function") return table.options.enableSubRowSelection(row);
|
|
1894
|
+
return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;
|
|
1895
|
+
};
|
|
1896
|
+
row.getCanMultiSelect = () => {
|
|
1897
|
+
var _table$options$enable3;
|
|
1898
|
+
if (typeof table.options.enableMultiRowSelection === "function") return table.options.enableMultiRowSelection(row);
|
|
1899
|
+
return (_table$options$enable3 = table.options.enableMultiRowSelection) != null ? _table$options$enable3 : true;
|
|
1900
|
+
};
|
|
1901
|
+
row.getToggleSelectedHandler = () => {
|
|
1902
|
+
const canSelect = row.getCanSelect();
|
|
1903
|
+
return (e) => {
|
|
1904
|
+
var _target;
|
|
1905
|
+
if (!canSelect) return;
|
|
1906
|
+
row.toggleSelected((_target = e.target) == null ? void 0 : _target.checked);
|
|
1907
|
+
};
|
|
1908
|
+
};
|
|
1909
|
+
}
|
|
1910
|
+
};
|
|
1911
|
+
var mutateRowIsSelected = (selectedRowIds, id, value, includeChildren, table) => {
|
|
1912
|
+
var _row$subRows;
|
|
1913
|
+
const row = table.getRow(id, true);
|
|
1914
|
+
if (value) {
|
|
1915
|
+
if (!row.getCanMultiSelect()) Object.keys(selectedRowIds).forEach((key) => delete selectedRowIds[key]);
|
|
1916
|
+
if (row.getCanSelect()) selectedRowIds[id] = true;
|
|
1917
|
+
} else delete selectedRowIds[id];
|
|
1918
|
+
if (includeChildren && (_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) row.subRows.forEach((row) => mutateRowIsSelected(selectedRowIds, row.id, value, includeChildren, table));
|
|
1919
|
+
};
|
|
1920
|
+
function selectRowsFn(table, rowModel) {
|
|
1921
|
+
const rowSelection = table.getState().rowSelection;
|
|
1922
|
+
const newSelectedFlatRows = [];
|
|
1923
|
+
const newSelectedRowsById = {};
|
|
1924
|
+
const recurseRows = function(rows, depth) {
|
|
1925
|
+
return rows.map((row) => {
|
|
1926
|
+
var _row$subRows2;
|
|
1927
|
+
const isSelected = isRowSelected(row, rowSelection);
|
|
1928
|
+
if (isSelected) {
|
|
1929
|
+
newSelectedFlatRows.push(row);
|
|
1930
|
+
newSelectedRowsById[row.id] = row;
|
|
1931
|
+
}
|
|
1932
|
+
if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) row = {
|
|
1933
|
+
...row,
|
|
1934
|
+
subRows: recurseRows(row.subRows)
|
|
1935
|
+
};
|
|
1936
|
+
if (isSelected) return row;
|
|
1937
|
+
}).filter(Boolean);
|
|
1938
|
+
};
|
|
1939
|
+
return {
|
|
1940
|
+
rows: recurseRows(rowModel.rows),
|
|
1941
|
+
flatRows: newSelectedFlatRows,
|
|
1942
|
+
rowsById: newSelectedRowsById
|
|
1943
|
+
};
|
|
1944
|
+
}
|
|
1945
|
+
function isRowSelected(row, selection) {
|
|
1946
|
+
var _selection$row$id;
|
|
1947
|
+
return (_selection$row$id = selection[row.id]) != null ? _selection$row$id : false;
|
|
1948
|
+
}
|
|
1949
|
+
function isSubRowSelected(row, selection, table) {
|
|
1950
|
+
var _row$subRows3;
|
|
1951
|
+
if (!((_row$subRows3 = row.subRows) != null && _row$subRows3.length)) return false;
|
|
1952
|
+
let allChildrenSelected = true;
|
|
1953
|
+
let someSelected = false;
|
|
1954
|
+
row.subRows.forEach((subRow) => {
|
|
1955
|
+
if (someSelected && !allChildrenSelected) return;
|
|
1956
|
+
if (subRow.getCanSelect()) {
|
|
1957
|
+
if (isRowSelected(subRow, selection)) someSelected = true;
|
|
1958
|
+
else allChildrenSelected = false;
|
|
1959
|
+
}
|
|
1960
|
+
if (subRow.subRows && subRow.subRows.length) {
|
|
1961
|
+
const subRowChildrenSelected = isSubRowSelected(subRow, selection);
|
|
1962
|
+
if (subRowChildrenSelected === "all") someSelected = true;
|
|
1963
|
+
else if (subRowChildrenSelected === "some") {
|
|
1964
|
+
someSelected = true;
|
|
1965
|
+
allChildrenSelected = false;
|
|
1966
|
+
} else allChildrenSelected = false;
|
|
1967
|
+
}
|
|
1968
|
+
});
|
|
1969
|
+
return allChildrenSelected ? "all" : someSelected ? "some" : false;
|
|
1970
|
+
}
|
|
1971
|
+
var reSplitAlphaNumeric = /([0-9]+)/gm;
|
|
1972
|
+
var alphanumeric = (rowA, rowB, columnId) => {
|
|
1973
|
+
return compareAlphanumeric(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
|
|
1974
|
+
};
|
|
1975
|
+
var alphanumericCaseSensitive = (rowA, rowB, columnId) => {
|
|
1976
|
+
return compareAlphanumeric(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
|
|
1977
|
+
};
|
|
1978
|
+
var text = (rowA, rowB, columnId) => {
|
|
1979
|
+
return compareBasic(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
|
|
1980
|
+
};
|
|
1981
|
+
var textCaseSensitive = (rowA, rowB, columnId) => {
|
|
1982
|
+
return compareBasic(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
|
|
1983
|
+
};
|
|
1984
|
+
var datetime = (rowA, rowB, columnId) => {
|
|
1985
|
+
const a = rowA.getValue(columnId);
|
|
1986
|
+
const b = rowB.getValue(columnId);
|
|
1987
|
+
return a > b ? 1 : a < b ? -1 : 0;
|
|
1988
|
+
};
|
|
1989
|
+
var basic = (rowA, rowB, columnId) => {
|
|
1990
|
+
return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId));
|
|
1991
|
+
};
|
|
1992
|
+
function compareBasic(a, b) {
|
|
1993
|
+
return a === b ? 0 : a > b ? 1 : -1;
|
|
1994
|
+
}
|
|
1995
|
+
function toString(a) {
|
|
1996
|
+
if (typeof a === "number") {
|
|
1997
|
+
if (isNaN(a) || a === Infinity || a === -Infinity) return "";
|
|
1998
|
+
return String(a);
|
|
1999
|
+
}
|
|
2000
|
+
if (typeof a === "string") return a;
|
|
2001
|
+
return "";
|
|
2002
|
+
}
|
|
2003
|
+
function compareAlphanumeric(aStr, bStr) {
|
|
2004
|
+
const a = aStr.split(reSplitAlphaNumeric).filter(Boolean);
|
|
2005
|
+
const b = bStr.split(reSplitAlphaNumeric).filter(Boolean);
|
|
2006
|
+
while (a.length && b.length) {
|
|
2007
|
+
const aa = a.shift();
|
|
2008
|
+
const bb = b.shift();
|
|
2009
|
+
const an = parseInt(aa, 10);
|
|
2010
|
+
const bn = parseInt(bb, 10);
|
|
2011
|
+
const combo = [an, bn].sort();
|
|
2012
|
+
if (isNaN(combo[0])) {
|
|
2013
|
+
if (aa > bb) return 1;
|
|
2014
|
+
if (bb > aa) return -1;
|
|
2015
|
+
continue;
|
|
2016
|
+
}
|
|
2017
|
+
if (isNaN(combo[1])) return isNaN(an) ? -1 : 1;
|
|
2018
|
+
if (an > bn) return 1;
|
|
2019
|
+
if (bn > an) return -1;
|
|
2020
|
+
}
|
|
2021
|
+
return a.length - b.length;
|
|
2022
|
+
}
|
|
2023
|
+
var sortingFns = {
|
|
2024
|
+
alphanumeric,
|
|
2025
|
+
alphanumericCaseSensitive,
|
|
2026
|
+
text,
|
|
2027
|
+
textCaseSensitive,
|
|
2028
|
+
datetime,
|
|
2029
|
+
basic
|
|
2030
|
+
};
|
|
2031
|
+
var builtInFeatures = [
|
|
2032
|
+
Headers,
|
|
2033
|
+
ColumnVisibility,
|
|
2034
|
+
ColumnOrdering,
|
|
2035
|
+
ColumnPinning,
|
|
2036
|
+
ColumnFaceting,
|
|
2037
|
+
ColumnFiltering,
|
|
2038
|
+
GlobalFaceting,
|
|
2039
|
+
GlobalFiltering,
|
|
2040
|
+
{
|
|
2041
|
+
getInitialState: (state) => {
|
|
2042
|
+
return {
|
|
2043
|
+
sorting: [],
|
|
2044
|
+
...state
|
|
2045
|
+
};
|
|
2046
|
+
},
|
|
2047
|
+
getDefaultColumnDef: () => {
|
|
2048
|
+
return {
|
|
2049
|
+
sortingFn: "auto",
|
|
2050
|
+
sortUndefined: 1
|
|
2051
|
+
};
|
|
2052
|
+
},
|
|
2053
|
+
getDefaultOptions: (table) => {
|
|
2054
|
+
return {
|
|
2055
|
+
onSortingChange: makeStateUpdater("sorting", table),
|
|
2056
|
+
isMultiSortEvent: (e) => {
|
|
2057
|
+
return e.shiftKey;
|
|
2058
|
+
}
|
|
2059
|
+
};
|
|
2060
|
+
},
|
|
2061
|
+
createColumn: (column, table) => {
|
|
2062
|
+
column.getAutoSortingFn = () => {
|
|
2063
|
+
const firstRows = table.getFilteredRowModel().flatRows.slice(10);
|
|
2064
|
+
let isString = false;
|
|
2065
|
+
for (const row of firstRows) {
|
|
2066
|
+
const value = row == null ? void 0 : row.getValue(column.id);
|
|
2067
|
+
if (Object.prototype.toString.call(value) === "[object Date]") return sortingFns.datetime;
|
|
2068
|
+
if (typeof value === "string") {
|
|
2069
|
+
isString = true;
|
|
2070
|
+
if (value.split(reSplitAlphaNumeric).length > 1) return sortingFns.alphanumeric;
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
if (isString) return sortingFns.text;
|
|
2074
|
+
return sortingFns.basic;
|
|
2075
|
+
};
|
|
2076
|
+
column.getAutoSortDir = () => {
|
|
2077
|
+
const firstRow = table.getFilteredRowModel().flatRows[0];
|
|
2078
|
+
if (typeof (firstRow == null ? void 0 : firstRow.getValue(column.id)) === "string") return "asc";
|
|
2079
|
+
return "desc";
|
|
2080
|
+
};
|
|
2081
|
+
column.getSortingFn = () => {
|
|
2082
|
+
var _table$options$sortin, _table$options$sortin2;
|
|
2083
|
+
if (!column) throw new Error();
|
|
2084
|
+
return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === "auto" ? column.getAutoSortingFn() : (_table$options$sortin = (_table$options$sortin2 = table.options.sortingFns) == null ? void 0 : _table$options$sortin2[column.columnDef.sortingFn]) != null ? _table$options$sortin : sortingFns[column.columnDef.sortingFn];
|
|
2085
|
+
};
|
|
2086
|
+
column.toggleSorting = (desc, multi) => {
|
|
2087
|
+
const nextSortingOrder = column.getNextSortingOrder();
|
|
2088
|
+
const hasManualValue = typeof desc !== "undefined" && desc !== null;
|
|
2089
|
+
table.setSorting((old) => {
|
|
2090
|
+
const existingSorting = old == null ? void 0 : old.find((d) => d.id === column.id);
|
|
2091
|
+
const existingIndex = old == null ? void 0 : old.findIndex((d) => d.id === column.id);
|
|
2092
|
+
let newSorting = [];
|
|
2093
|
+
let sortAction;
|
|
2094
|
+
let nextDesc = hasManualValue ? desc : nextSortingOrder === "desc";
|
|
2095
|
+
if (old != null && old.length && column.getCanMultiSort() && multi) {
|
|
2096
|
+
if (existingSorting) sortAction = "toggle";
|
|
2097
|
+
else sortAction = "add";
|
|
2098
|
+
} else if (old != null && old.length && existingIndex !== old.length - 1) sortAction = "replace";
|
|
2099
|
+
else if (existingSorting) sortAction = "toggle";
|
|
2100
|
+
else sortAction = "replace";
|
|
2101
|
+
if (sortAction === "toggle") {
|
|
2102
|
+
if (!hasManualValue) {
|
|
2103
|
+
if (!nextSortingOrder) sortAction = "remove";
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
if (sortAction === "add") {
|
|
2107
|
+
var _table$options$maxMul;
|
|
2108
|
+
newSorting = [...old, {
|
|
2109
|
+
id: column.id,
|
|
2110
|
+
desc: nextDesc
|
|
2111
|
+
}];
|
|
2112
|
+
newSorting.splice(0, newSorting.length - ((_table$options$maxMul = table.options.maxMultiSortColCount) != null ? _table$options$maxMul : Number.MAX_SAFE_INTEGER));
|
|
2113
|
+
} else if (sortAction === "toggle") newSorting = old.map((d) => {
|
|
2114
|
+
if (d.id === column.id) return {
|
|
2115
|
+
...d,
|
|
2116
|
+
desc: nextDesc
|
|
2117
|
+
};
|
|
2118
|
+
return d;
|
|
2119
|
+
});
|
|
2120
|
+
else if (sortAction === "remove") newSorting = old.filter((d) => d.id !== column.id);
|
|
2121
|
+
else newSorting = [{
|
|
2122
|
+
id: column.id,
|
|
2123
|
+
desc: nextDesc
|
|
2124
|
+
}];
|
|
2125
|
+
return newSorting;
|
|
2126
|
+
});
|
|
2127
|
+
};
|
|
2128
|
+
column.getFirstSortDir = () => {
|
|
2129
|
+
var _ref, _column$columnDef$sor;
|
|
2130
|
+
return ((_ref = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : table.options.sortDescFirst) != null ? _ref : column.getAutoSortDir() === "desc") ? "desc" : "asc";
|
|
2131
|
+
};
|
|
2132
|
+
column.getNextSortingOrder = (multi) => {
|
|
2133
|
+
var _table$options$enable, _table$options$enable2;
|
|
2134
|
+
const firstSortDirection = column.getFirstSortDir();
|
|
2135
|
+
const isSorted = column.getIsSorted();
|
|
2136
|
+
if (!isSorted) return firstSortDirection;
|
|
2137
|
+
if (isSorted !== firstSortDirection && ((_table$options$enable = table.options.enableSortingRemoval) != null ? _table$options$enable : true) && (multi ? (_table$options$enable2 = table.options.enableMultiRemove) != null ? _table$options$enable2 : true : true)) return false;
|
|
2138
|
+
return isSorted === "desc" ? "asc" : "desc";
|
|
2139
|
+
};
|
|
2140
|
+
column.getCanSort = () => {
|
|
2141
|
+
var _column$columnDef$ena, _table$options$enable3;
|
|
2142
|
+
return ((_column$columnDef$ena = column.columnDef.enableSorting) != null ? _column$columnDef$ena : true) && ((_table$options$enable3 = table.options.enableSorting) != null ? _table$options$enable3 : true) && !!column.accessorFn;
|
|
2143
|
+
};
|
|
2144
|
+
column.getCanMultiSort = () => {
|
|
2145
|
+
var _ref2, _column$columnDef$ena2;
|
|
2146
|
+
return (_ref2 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : table.options.enableMultiSort) != null ? _ref2 : !!column.accessorFn;
|
|
2147
|
+
};
|
|
2148
|
+
column.getIsSorted = () => {
|
|
2149
|
+
var _table$getState$sorti;
|
|
2150
|
+
const columnSort = (_table$getState$sorti = table.getState().sorting) == null ? void 0 : _table$getState$sorti.find((d) => d.id === column.id);
|
|
2151
|
+
return !columnSort ? false : columnSort.desc ? "desc" : "asc";
|
|
2152
|
+
};
|
|
2153
|
+
column.getSortIndex = () => {
|
|
2154
|
+
var _table$getState$sorti2, _table$getState$sorti3;
|
|
2155
|
+
return (_table$getState$sorti2 = (_table$getState$sorti3 = table.getState().sorting) == null ? void 0 : _table$getState$sorti3.findIndex((d) => d.id === column.id)) != null ? _table$getState$sorti2 : -1;
|
|
2156
|
+
};
|
|
2157
|
+
column.clearSorting = () => {
|
|
2158
|
+
table.setSorting((old) => old != null && old.length ? old.filter((d) => d.id !== column.id) : []);
|
|
2159
|
+
};
|
|
2160
|
+
column.getToggleSortingHandler = () => {
|
|
2161
|
+
const canSort = column.getCanSort();
|
|
2162
|
+
return (e) => {
|
|
2163
|
+
if (!canSort) return;
|
|
2164
|
+
e.persist == null || e.persist();
|
|
2165
|
+
column.toggleSorting == null || column.toggleSorting(void 0, column.getCanMultiSort() ? table.options.isMultiSortEvent == null ? void 0 : table.options.isMultiSortEvent(e) : false);
|
|
2166
|
+
};
|
|
2167
|
+
};
|
|
2168
|
+
},
|
|
2169
|
+
createTable: (table) => {
|
|
2170
|
+
table.setSorting = (updater) => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater);
|
|
2171
|
+
table.resetSorting = (defaultState) => {
|
|
2172
|
+
var _table$initialState$s, _table$initialState;
|
|
2173
|
+
table.setSorting(defaultState ? [] : (_table$initialState$s = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) != null ? _table$initialState$s : []);
|
|
2174
|
+
};
|
|
2175
|
+
table.getPreSortedRowModel = () => table.getGroupedRowModel();
|
|
2176
|
+
table.getSortedRowModel = () => {
|
|
2177
|
+
if (!table._getSortedRowModel && table.options.getSortedRowModel) table._getSortedRowModel = table.options.getSortedRowModel(table);
|
|
2178
|
+
if (table.options.manualSorting || !table._getSortedRowModel) return table.getPreSortedRowModel();
|
|
2179
|
+
return table._getSortedRowModel();
|
|
2180
|
+
};
|
|
2181
|
+
}
|
|
2182
|
+
},
|
|
2183
|
+
ColumnGrouping,
|
|
2184
|
+
RowExpanding,
|
|
2185
|
+
RowPagination,
|
|
2186
|
+
RowPinning,
|
|
2187
|
+
RowSelection,
|
|
2188
|
+
ColumnSizing
|
|
2189
|
+
];
|
|
2190
|
+
function createTable(options) {
|
|
2191
|
+
var _options$_features, _options$initialState;
|
|
2192
|
+
const _features = [...builtInFeatures, ...(_options$_features = options._features) != null ? _options$_features : []];
|
|
2193
|
+
let table = { _features };
|
|
2194
|
+
const defaultOptions = table._features.reduce((obj, feature) => {
|
|
2195
|
+
return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(table));
|
|
2196
|
+
}, {});
|
|
2197
|
+
const mergeOptions = (options) => {
|
|
2198
|
+
if (table.options.mergeOptions) return table.options.mergeOptions(defaultOptions, options);
|
|
2199
|
+
return {
|
|
2200
|
+
...defaultOptions,
|
|
2201
|
+
...options
|
|
2202
|
+
};
|
|
2203
|
+
};
|
|
2204
|
+
let initialState = { ...(_options$initialState = options.initialState) != null ? _options$initialState : {} };
|
|
2205
|
+
table._features.forEach((feature) => {
|
|
2206
|
+
var _feature$getInitialSt;
|
|
2207
|
+
initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;
|
|
2208
|
+
});
|
|
2209
|
+
const queued = [];
|
|
2210
|
+
let queuedTimeout = false;
|
|
2211
|
+
const coreInstance = {
|
|
2212
|
+
_features,
|
|
2213
|
+
options: {
|
|
2214
|
+
...defaultOptions,
|
|
2215
|
+
...options
|
|
2216
|
+
},
|
|
2217
|
+
initialState,
|
|
2218
|
+
_queue: (cb) => {
|
|
2219
|
+
queued.push(cb);
|
|
2220
|
+
if (!queuedTimeout) {
|
|
2221
|
+
queuedTimeout = true;
|
|
2222
|
+
Promise.resolve().then(() => {
|
|
2223
|
+
while (queued.length) queued.shift()();
|
|
2224
|
+
queuedTimeout = false;
|
|
2225
|
+
}).catch((error) => setTimeout(() => {
|
|
2226
|
+
throw error;
|
|
2227
|
+
}));
|
|
2228
|
+
}
|
|
2229
|
+
},
|
|
2230
|
+
reset: () => {
|
|
2231
|
+
table.setState(table.initialState);
|
|
2232
|
+
},
|
|
2233
|
+
setOptions: (updater) => {
|
|
2234
|
+
const newOptions = functionalUpdate(updater, table.options);
|
|
2235
|
+
table.options = mergeOptions(newOptions);
|
|
2236
|
+
},
|
|
2237
|
+
getState: () => {
|
|
2238
|
+
return table.options.state;
|
|
2239
|
+
},
|
|
2240
|
+
setState: (updater) => {
|
|
2241
|
+
table.options.onStateChange == null || table.options.onStateChange(updater);
|
|
2242
|
+
},
|
|
2243
|
+
_getRowId: (row, index, parent) => {
|
|
2244
|
+
var _table$options$getRow;
|
|
2245
|
+
return (_table$options$getRow = table.options.getRowId == null ? void 0 : table.options.getRowId(row, index, parent)) != null ? _table$options$getRow : `${parent ? [parent.id, index].join(".") : index}`;
|
|
2246
|
+
},
|
|
2247
|
+
getCoreRowModel: () => {
|
|
2248
|
+
if (!table._getCoreRowModel) table._getCoreRowModel = table.options.getCoreRowModel(table);
|
|
2249
|
+
return table._getCoreRowModel();
|
|
2250
|
+
},
|
|
2251
|
+
getRowModel: () => {
|
|
2252
|
+
return table.getPaginationRowModel();
|
|
2253
|
+
},
|
|
2254
|
+
getRow: (id, searchAll) => {
|
|
2255
|
+
let row = (searchAll ? table.getPrePaginationRowModel() : table.getRowModel()).rowsById[id];
|
|
2256
|
+
if (!row) {
|
|
2257
|
+
row = table.getCoreRowModel().rowsById[id];
|
|
2258
|
+
if (!row) throw new Error();
|
|
2259
|
+
}
|
|
2260
|
+
return row;
|
|
2261
|
+
},
|
|
2262
|
+
_getDefaultColumnDef: memo(() => [table.options.defaultColumn], (defaultColumn) => {
|
|
2263
|
+
var _defaultColumn;
|
|
2264
|
+
defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
|
|
2265
|
+
return {
|
|
2266
|
+
header: (props) => {
|
|
2267
|
+
const resolvedColumnDef = props.header.column.columnDef;
|
|
2268
|
+
if (resolvedColumnDef.accessorKey) return resolvedColumnDef.accessorKey;
|
|
2269
|
+
if (resolvedColumnDef.accessorFn) return resolvedColumnDef.id;
|
|
2270
|
+
return null;
|
|
2271
|
+
},
|
|
2272
|
+
cell: (props) => {
|
|
2273
|
+
var _props$renderValue$to, _props$renderValue;
|
|
2274
|
+
return (_props$renderValue$to = (_props$renderValue = props.renderValue()) == null || _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) != null ? _props$renderValue$to : null;
|
|
2275
|
+
},
|
|
2276
|
+
...table._features.reduce((obj, feature) => {
|
|
2277
|
+
return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
|
|
2278
|
+
}, {}),
|
|
2279
|
+
...defaultColumn
|
|
2280
|
+
};
|
|
2281
|
+
}, getMemoOptions(options, "debugColumns")),
|
|
2282
|
+
_getColumnDefs: () => table.options.columns,
|
|
2283
|
+
getAllColumns: memo(() => [table._getColumnDefs()], (columnDefs) => {
|
|
2284
|
+
const recurseColumns = function(columnDefs, parent, depth) {
|
|
2285
|
+
if (depth === void 0) depth = 0;
|
|
2286
|
+
return columnDefs.map((columnDef) => {
|
|
2287
|
+
const column = createColumn(table, columnDef, depth, parent);
|
|
2288
|
+
const groupingColumnDef = columnDef;
|
|
2289
|
+
column.columns = groupingColumnDef.columns ? recurseColumns(groupingColumnDef.columns, column, depth + 1) : [];
|
|
2290
|
+
return column;
|
|
2291
|
+
});
|
|
2292
|
+
};
|
|
2293
|
+
return recurseColumns(columnDefs);
|
|
2294
|
+
}, getMemoOptions(options, "debugColumns")),
|
|
2295
|
+
getAllFlatColumns: memo(() => [table.getAllColumns()], (allColumns) => {
|
|
2296
|
+
return allColumns.flatMap((column) => {
|
|
2297
|
+
return column.getFlatColumns();
|
|
2298
|
+
});
|
|
2299
|
+
}, getMemoOptions(options, "debugColumns")),
|
|
2300
|
+
_getAllFlatColumnsById: memo(() => [table.getAllFlatColumns()], (flatColumns) => {
|
|
2301
|
+
return flatColumns.reduce((acc, column) => {
|
|
2302
|
+
acc[column.id] = column;
|
|
2303
|
+
return acc;
|
|
2304
|
+
}, {});
|
|
2305
|
+
}, getMemoOptions(options, "debugColumns")),
|
|
2306
|
+
getAllLeafColumns: memo(() => [table.getAllColumns(), table._getOrderColumnsFn()], (allColumns, orderColumns) => {
|
|
2307
|
+
return orderColumns(allColumns.flatMap((column) => column.getLeafColumns()));
|
|
2308
|
+
}, getMemoOptions(options, "debugColumns")),
|
|
2309
|
+
getColumn: (columnId) => {
|
|
2310
|
+
return table._getAllFlatColumnsById()[columnId];
|
|
2311
|
+
}
|
|
2312
|
+
};
|
|
2313
|
+
Object.assign(table, coreInstance);
|
|
2314
|
+
for (let index = 0; index < table._features.length; index++) {
|
|
2315
|
+
const feature = table._features[index];
|
|
2316
|
+
feature == null || feature.createTable == null || feature.createTable(table);
|
|
2317
|
+
}
|
|
2318
|
+
return table;
|
|
2319
|
+
}
|
|
2320
|
+
function getCoreRowModel() {
|
|
2321
|
+
return (table) => memo(() => [table.options.data], (data) => {
|
|
2322
|
+
const rowModel = {
|
|
2323
|
+
rows: [],
|
|
2324
|
+
flatRows: [],
|
|
2325
|
+
rowsById: {}
|
|
2326
|
+
};
|
|
2327
|
+
const accessRows = function(originalRows, depth, parentRow) {
|
|
2328
|
+
if (depth === void 0) depth = 0;
|
|
2329
|
+
const rows = [];
|
|
2330
|
+
for (let i = 0; i < originalRows.length; i++) {
|
|
2331
|
+
const row = createRow(table, table._getRowId(originalRows[i], i, parentRow), originalRows[i], i, depth, void 0, parentRow == null ? void 0 : parentRow.id);
|
|
2332
|
+
rowModel.flatRows.push(row);
|
|
2333
|
+
rowModel.rowsById[row.id] = row;
|
|
2334
|
+
rows.push(row);
|
|
2335
|
+
if (table.options.getSubRows) {
|
|
2336
|
+
var _row$originalSubRows;
|
|
2337
|
+
row.originalSubRows = table.options.getSubRows(originalRows[i], i);
|
|
2338
|
+
if ((_row$originalSubRows = row.originalSubRows) != null && _row$originalSubRows.length) row.subRows = accessRows(row.originalSubRows, depth + 1, row);
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
return rows;
|
|
2342
|
+
};
|
|
2343
|
+
rowModel.rows = accessRows(data);
|
|
2344
|
+
return rowModel;
|
|
2345
|
+
}, getMemoOptions(table.options, "debugTable", "getRowModel", () => table._autoResetPageIndex()));
|
|
2346
|
+
}
|
|
2347
|
+
function getExpandedRowModel() {
|
|
2348
|
+
return (table) => memo(() => [
|
|
2349
|
+
table.getState().expanded,
|
|
2350
|
+
table.getPreExpandedRowModel(),
|
|
2351
|
+
table.options.paginateExpandedRows
|
|
2352
|
+
], (expanded, rowModel, paginateExpandedRows) => {
|
|
2353
|
+
if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) return rowModel;
|
|
2354
|
+
if (!paginateExpandedRows) return rowModel;
|
|
2355
|
+
return expandRows(rowModel);
|
|
2356
|
+
}, getMemoOptions(table.options, "debugTable"));
|
|
2357
|
+
}
|
|
2358
|
+
function expandRows(rowModel) {
|
|
2359
|
+
const expandedRows = [];
|
|
2360
|
+
const handleRow = (row) => {
|
|
2361
|
+
var _row$subRows;
|
|
2362
|
+
expandedRows.push(row);
|
|
2363
|
+
if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getIsExpanded()) row.subRows.forEach(handleRow);
|
|
2364
|
+
};
|
|
2365
|
+
rowModel.rows.forEach(handleRow);
|
|
2366
|
+
return {
|
|
2367
|
+
rows: expandedRows,
|
|
2368
|
+
flatRows: rowModel.flatRows,
|
|
2369
|
+
rowsById: rowModel.rowsById
|
|
2370
|
+
};
|
|
2371
|
+
}
|
|
2372
|
+
function filterRows(rows, filterRowImpl, table) {
|
|
2373
|
+
if (table.options.filterFromLeafRows) return filterRowModelFromLeafs(rows, filterRowImpl, table);
|
|
2374
|
+
return filterRowModelFromRoot(rows, filterRowImpl, table);
|
|
2375
|
+
}
|
|
2376
|
+
function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
|
|
2377
|
+
var _table$options$maxLea;
|
|
2378
|
+
const newFilteredFlatRows = [];
|
|
2379
|
+
const newFilteredRowsById = {};
|
|
2380
|
+
const maxDepth = (_table$options$maxLea = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea : 100;
|
|
2381
|
+
const recurseFilterRows = function(rowsToFilter, depth) {
|
|
2382
|
+
if (depth === void 0) depth = 0;
|
|
2383
|
+
const rows = [];
|
|
2384
|
+
for (let i = 0; i < rowsToFilter.length; i++) {
|
|
2385
|
+
var _row$subRows;
|
|
2386
|
+
let row = rowsToFilter[i];
|
|
2387
|
+
const newRow = createRow(table, row.id, row.original, row.index, row.depth, void 0, row.parentId);
|
|
2388
|
+
newRow.columnFilters = row.columnFilters;
|
|
2389
|
+
if ((_row$subRows = row.subRows) != null && _row$subRows.length && depth < maxDepth) {
|
|
2390
|
+
newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
|
|
2391
|
+
row = newRow;
|
|
2392
|
+
if (filterRow(row) && !newRow.subRows.length) {
|
|
2393
|
+
rows.push(row);
|
|
2394
|
+
newFilteredRowsById[row.id] = row;
|
|
2395
|
+
newFilteredFlatRows.push(row);
|
|
2396
|
+
continue;
|
|
2397
|
+
}
|
|
2398
|
+
if (filterRow(row) || newRow.subRows.length) {
|
|
2399
|
+
rows.push(row);
|
|
2400
|
+
newFilteredRowsById[row.id] = row;
|
|
2401
|
+
newFilteredFlatRows.push(row);
|
|
2402
|
+
continue;
|
|
2403
|
+
}
|
|
2404
|
+
} else {
|
|
2405
|
+
row = newRow;
|
|
2406
|
+
if (filterRow(row)) {
|
|
2407
|
+
rows.push(row);
|
|
2408
|
+
newFilteredRowsById[row.id] = row;
|
|
2409
|
+
newFilteredFlatRows.push(row);
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
return rows;
|
|
2414
|
+
};
|
|
2415
|
+
return {
|
|
2416
|
+
rows: recurseFilterRows(rowsToFilter),
|
|
2417
|
+
flatRows: newFilteredFlatRows,
|
|
2418
|
+
rowsById: newFilteredRowsById
|
|
2419
|
+
};
|
|
2420
|
+
}
|
|
2421
|
+
function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
|
|
2422
|
+
var _table$options$maxLea2;
|
|
2423
|
+
const newFilteredFlatRows = [];
|
|
2424
|
+
const newFilteredRowsById = {};
|
|
2425
|
+
const maxDepth = (_table$options$maxLea2 = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea2 : 100;
|
|
2426
|
+
const recurseFilterRows = function(rowsToFilter, depth) {
|
|
2427
|
+
if (depth === void 0) depth = 0;
|
|
2428
|
+
const rows = [];
|
|
2429
|
+
for (let i = 0; i < rowsToFilter.length; i++) {
|
|
2430
|
+
let row = rowsToFilter[i];
|
|
2431
|
+
if (filterRow(row)) {
|
|
2432
|
+
var _row$subRows2;
|
|
2433
|
+
if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length && depth < maxDepth) {
|
|
2434
|
+
const newRow = createRow(table, row.id, row.original, row.index, row.depth, void 0, row.parentId);
|
|
2435
|
+
newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
|
|
2436
|
+
row = newRow;
|
|
2437
|
+
}
|
|
2438
|
+
rows.push(row);
|
|
2439
|
+
newFilteredFlatRows.push(row);
|
|
2440
|
+
newFilteredRowsById[row.id] = row;
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
return rows;
|
|
2444
|
+
};
|
|
2445
|
+
return {
|
|
2446
|
+
rows: recurseFilterRows(rowsToFilter),
|
|
2447
|
+
flatRows: newFilteredFlatRows,
|
|
2448
|
+
rowsById: newFilteredRowsById
|
|
2449
|
+
};
|
|
2450
|
+
}
|
|
2451
|
+
function getFilteredRowModel() {
|
|
2452
|
+
return (table) => memo(() => [
|
|
2453
|
+
table.getPreFilteredRowModel(),
|
|
2454
|
+
table.getState().columnFilters,
|
|
2455
|
+
table.getState().globalFilter
|
|
2456
|
+
], (rowModel, columnFilters, globalFilter) => {
|
|
2457
|
+
if (!rowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
|
|
2458
|
+
for (let i = 0; i < rowModel.flatRows.length; i++) {
|
|
2459
|
+
rowModel.flatRows[i].columnFilters = {};
|
|
2460
|
+
rowModel.flatRows[i].columnFiltersMeta = {};
|
|
2461
|
+
}
|
|
2462
|
+
return rowModel;
|
|
2463
|
+
}
|
|
2464
|
+
const resolvedColumnFilters = [];
|
|
2465
|
+
const resolvedGlobalFilters = [];
|
|
2466
|
+
(columnFilters != null ? columnFilters : []).forEach((d) => {
|
|
2467
|
+
var _filterFn$resolveFilt;
|
|
2468
|
+
const column = table.getColumn(d.id);
|
|
2469
|
+
if (!column) return;
|
|
2470
|
+
const filterFn = column.getFilterFn();
|
|
2471
|
+
if (!filterFn) return;
|
|
2472
|
+
resolvedColumnFilters.push({
|
|
2473
|
+
id: d.id,
|
|
2474
|
+
filterFn,
|
|
2475
|
+
resolvedValue: (_filterFn$resolveFilt = filterFn.resolveFilterValue == null ? void 0 : filterFn.resolveFilterValue(d.value)) != null ? _filterFn$resolveFilt : d.value
|
|
2476
|
+
});
|
|
2477
|
+
});
|
|
2478
|
+
const filterableIds = (columnFilters != null ? columnFilters : []).map((d) => d.id);
|
|
2479
|
+
const globalFilterFn = table.getGlobalFilterFn();
|
|
2480
|
+
const globallyFilterableColumns = table.getAllLeafColumns().filter((column) => column.getCanGlobalFilter());
|
|
2481
|
+
if (globalFilter && globalFilterFn && globallyFilterableColumns.length) {
|
|
2482
|
+
filterableIds.push("__global__");
|
|
2483
|
+
globallyFilterableColumns.forEach((column) => {
|
|
2484
|
+
var _globalFilterFn$resol;
|
|
2485
|
+
resolvedGlobalFilters.push({
|
|
2486
|
+
id: column.id,
|
|
2487
|
+
filterFn: globalFilterFn,
|
|
2488
|
+
resolvedValue: (_globalFilterFn$resol = globalFilterFn.resolveFilterValue == null ? void 0 : globalFilterFn.resolveFilterValue(globalFilter)) != null ? _globalFilterFn$resol : globalFilter
|
|
2489
|
+
});
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
let currentColumnFilter;
|
|
2493
|
+
let currentGlobalFilter;
|
|
2494
|
+
for (let j = 0; j < rowModel.flatRows.length; j++) {
|
|
2495
|
+
const row = rowModel.flatRows[j];
|
|
2496
|
+
row.columnFilters = {};
|
|
2497
|
+
if (resolvedColumnFilters.length) for (let i = 0; i < resolvedColumnFilters.length; i++) {
|
|
2498
|
+
currentColumnFilter = resolvedColumnFilters[i];
|
|
2499
|
+
const id = currentColumnFilter.id;
|
|
2500
|
+
row.columnFilters[id] = currentColumnFilter.filterFn(row, id, currentColumnFilter.resolvedValue, (filterMeta) => {
|
|
2501
|
+
row.columnFiltersMeta[id] = filterMeta;
|
|
2502
|
+
});
|
|
2503
|
+
}
|
|
2504
|
+
if (resolvedGlobalFilters.length) {
|
|
2505
|
+
for (let i = 0; i < resolvedGlobalFilters.length; i++) {
|
|
2506
|
+
currentGlobalFilter = resolvedGlobalFilters[i];
|
|
2507
|
+
const id = currentGlobalFilter.id;
|
|
2508
|
+
if (currentGlobalFilter.filterFn(row, id, currentGlobalFilter.resolvedValue, (filterMeta) => {
|
|
2509
|
+
row.columnFiltersMeta[id] = filterMeta;
|
|
2510
|
+
})) {
|
|
2511
|
+
row.columnFilters.__global__ = true;
|
|
2512
|
+
break;
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
if (row.columnFilters.__global__ !== true) row.columnFilters.__global__ = false;
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
const filterRowsImpl = (row) => {
|
|
2519
|
+
for (let i = 0; i < filterableIds.length; i++) if (row.columnFilters[filterableIds[i]] === false) return false;
|
|
2520
|
+
return true;
|
|
2521
|
+
};
|
|
2522
|
+
return filterRows(rowModel.rows, filterRowsImpl, table);
|
|
2523
|
+
}, getMemoOptions(table.options, "debugTable", "getFilteredRowModel", () => table._autoResetPageIndex()));
|
|
2524
|
+
}
|
|
2525
|
+
function getSortedRowModel() {
|
|
2526
|
+
return (table) => memo(() => [table.getState().sorting, table.getPreSortedRowModel()], (sorting, rowModel) => {
|
|
2527
|
+
if (!rowModel.rows.length || !(sorting != null && sorting.length)) return rowModel;
|
|
2528
|
+
const sortingState = table.getState().sorting;
|
|
2529
|
+
const sortedFlatRows = [];
|
|
2530
|
+
const availableSorting = sortingState.filter((sort) => {
|
|
2531
|
+
var _table$getColumn;
|
|
2532
|
+
return (_table$getColumn = table.getColumn(sort.id)) == null ? void 0 : _table$getColumn.getCanSort();
|
|
2533
|
+
});
|
|
2534
|
+
const columnInfoById = {};
|
|
2535
|
+
availableSorting.forEach((sortEntry) => {
|
|
2536
|
+
const column = table.getColumn(sortEntry.id);
|
|
2537
|
+
if (!column) return;
|
|
2538
|
+
columnInfoById[sortEntry.id] = {
|
|
2539
|
+
sortUndefined: column.columnDef.sortUndefined,
|
|
2540
|
+
invertSorting: column.columnDef.invertSorting,
|
|
2541
|
+
sortingFn: column.getSortingFn()
|
|
2542
|
+
};
|
|
2543
|
+
});
|
|
2544
|
+
const sortData = (rows) => {
|
|
2545
|
+
const sortedData = rows.map((row) => ({ ...row }));
|
|
2546
|
+
sortedData.sort((rowA, rowB) => {
|
|
2547
|
+
for (let i = 0; i < availableSorting.length; i += 1) {
|
|
2548
|
+
var _sortEntry$desc;
|
|
2549
|
+
const sortEntry = availableSorting[i];
|
|
2550
|
+
const columnInfo = columnInfoById[sortEntry.id];
|
|
2551
|
+
const sortUndefined = columnInfo.sortUndefined;
|
|
2552
|
+
const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
|
|
2553
|
+
let sortInt = 0;
|
|
2554
|
+
if (sortUndefined) {
|
|
2555
|
+
const aValue = rowA.getValue(sortEntry.id);
|
|
2556
|
+
const bValue = rowB.getValue(sortEntry.id);
|
|
2557
|
+
const aUndefined = aValue === void 0;
|
|
2558
|
+
const bUndefined = bValue === void 0;
|
|
2559
|
+
if (aUndefined || bUndefined) {
|
|
2560
|
+
if (sortUndefined === "first") return aUndefined ? -1 : 1;
|
|
2561
|
+
if (sortUndefined === "last") return aUndefined ? 1 : -1;
|
|
2562
|
+
sortInt = aUndefined && bUndefined ? 0 : aUndefined ? sortUndefined : -sortUndefined;
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
if (sortInt === 0) sortInt = columnInfo.sortingFn(rowA, rowB, sortEntry.id);
|
|
2566
|
+
if (sortInt !== 0) {
|
|
2567
|
+
if (isDesc) sortInt *= -1;
|
|
2568
|
+
if (columnInfo.invertSorting) sortInt *= -1;
|
|
2569
|
+
return sortInt;
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
return rowA.index - rowB.index;
|
|
2573
|
+
});
|
|
2574
|
+
sortedData.forEach((row) => {
|
|
2575
|
+
var _row$subRows;
|
|
2576
|
+
sortedFlatRows.push(row);
|
|
2577
|
+
if ((_row$subRows = row.subRows) != null && _row$subRows.length) row.subRows = sortData(row.subRows);
|
|
2578
|
+
});
|
|
2579
|
+
return sortedData;
|
|
2580
|
+
};
|
|
2581
|
+
return {
|
|
2582
|
+
rows: sortData(rowModel.rows),
|
|
2583
|
+
flatRows: sortedFlatRows,
|
|
2584
|
+
rowsById: rowModel.rowsById
|
|
2585
|
+
};
|
|
2586
|
+
}, getMemoOptions(table.options, "debugTable", "getSortedRowModel", () => table._autoResetPageIndex()));
|
|
2587
|
+
}
|
|
2588
|
+
//#endregion
|
|
2589
|
+
//#region node_modules/.pnpm/@tanstack+vue-table@8.21.3_vue@3.5.41_typescript@6.0.3_/node_modules/@tanstack/vue-table/build/lib/index.mjs
|
|
2590
|
+
/**
|
|
2591
|
+
* vue-table
|
|
2592
|
+
*
|
|
2593
|
+
* Copyright (c) TanStack
|
|
2594
|
+
*
|
|
2595
|
+
* This source code is licensed under the MIT license found in the
|
|
2596
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
2597
|
+
*
|
|
2598
|
+
* @license MIT
|
|
2599
|
+
*/
|
|
2600
|
+
function trueFn() {
|
|
2601
|
+
return true;
|
|
2602
|
+
}
|
|
2603
|
+
var $PROXY = Symbol("merge-proxy");
|
|
2604
|
+
var propTraps = {
|
|
2605
|
+
get(_, property, receiver) {
|
|
2606
|
+
if (property === $PROXY) return receiver;
|
|
2607
|
+
return _.get(property);
|
|
2608
|
+
},
|
|
2609
|
+
has(_, property) {
|
|
2610
|
+
return _.has(property);
|
|
2611
|
+
},
|
|
2612
|
+
set: trueFn,
|
|
2613
|
+
deleteProperty: trueFn,
|
|
2614
|
+
getOwnPropertyDescriptor(_, property) {
|
|
2615
|
+
return {
|
|
2616
|
+
configurable: true,
|
|
2617
|
+
enumerable: true,
|
|
2618
|
+
get() {
|
|
2619
|
+
return _.get(property);
|
|
2620
|
+
},
|
|
2621
|
+
set: trueFn,
|
|
2622
|
+
deleteProperty: trueFn
|
|
2623
|
+
};
|
|
2624
|
+
},
|
|
2625
|
+
ownKeys(_) {
|
|
2626
|
+
return _.keys();
|
|
2627
|
+
}
|
|
2628
|
+
};
|
|
2629
|
+
function resolveSource(s) {
|
|
2630
|
+
return "value" in s ? s.value : s;
|
|
2631
|
+
}
|
|
2632
|
+
function mergeProxy() {
|
|
2633
|
+
for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) sources[_key] = arguments[_key];
|
|
2634
|
+
return new Proxy({
|
|
2635
|
+
get(property) {
|
|
2636
|
+
for (let i = sources.length - 1; i >= 0; i--) {
|
|
2637
|
+
const v = resolveSource(sources[i])[property];
|
|
2638
|
+
if (v !== void 0) return v;
|
|
2639
|
+
}
|
|
2640
|
+
},
|
|
2641
|
+
has(property) {
|
|
2642
|
+
for (let i = sources.length - 1; i >= 0; i--) if (property in resolveSource(sources[i])) return true;
|
|
2643
|
+
return false;
|
|
2644
|
+
},
|
|
2645
|
+
keys() {
|
|
2646
|
+
const keys = [];
|
|
2647
|
+
for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));
|
|
2648
|
+
return [...Array.from(new Set(keys))];
|
|
2649
|
+
}
|
|
2650
|
+
}, propTraps);
|
|
2651
|
+
}
|
|
2652
|
+
var FlexRender = defineComponent({
|
|
2653
|
+
props: ["render", "props"],
|
|
2654
|
+
setup: (props) => {
|
|
2655
|
+
return () => {
|
|
2656
|
+
if (typeof props.render === "function" || typeof props.render === "object") return h(props.render, props.props);
|
|
2657
|
+
return props.render;
|
|
2658
|
+
};
|
|
2659
|
+
}
|
|
2660
|
+
});
|
|
2661
|
+
function getOptionsWithReactiveData(options) {
|
|
2662
|
+
return mergeProxy(options, { data: unref(options.data) });
|
|
2663
|
+
}
|
|
2664
|
+
function useVueTable(initialOptions) {
|
|
2665
|
+
const IS_REACTIVE = isRef(initialOptions.data);
|
|
2666
|
+
const table = createTable(mergeProxy({
|
|
2667
|
+
state: {},
|
|
2668
|
+
onStateChange: () => {},
|
|
2669
|
+
renderFallbackValue: null,
|
|
2670
|
+
mergeOptions(defaultOptions, options) {
|
|
2671
|
+
return IS_REACTIVE ? {
|
|
2672
|
+
...defaultOptions,
|
|
2673
|
+
...options
|
|
2674
|
+
} : mergeProxy(defaultOptions, options);
|
|
2675
|
+
}
|
|
2676
|
+
}, IS_REACTIVE ? getOptionsWithReactiveData(initialOptions) : initialOptions));
|
|
2677
|
+
if (IS_REACTIVE) {
|
|
2678
|
+
const dataRef = shallowRef(initialOptions.data);
|
|
2679
|
+
watch(dataRef, () => {
|
|
2680
|
+
table.setState((prev) => ({
|
|
2681
|
+
...prev,
|
|
2682
|
+
data: dataRef.value
|
|
2683
|
+
}));
|
|
2684
|
+
}, { immediate: true });
|
|
2685
|
+
}
|
|
2686
|
+
const state = ref(table.initialState);
|
|
2687
|
+
watchEffect(() => {
|
|
2688
|
+
table.setOptions((prev) => {
|
|
2689
|
+
var _initialOptions$state;
|
|
2690
|
+
const stateProxy = new Proxy({}, { get: (_, prop) => state.value[prop] });
|
|
2691
|
+
return mergeProxy(prev, IS_REACTIVE ? getOptionsWithReactiveData(initialOptions) : initialOptions, {
|
|
2692
|
+
state: mergeProxy(stateProxy, (_initialOptions$state = initialOptions.state) != null ? _initialOptions$state : {}),
|
|
2693
|
+
onStateChange: (updater) => {
|
|
2694
|
+
if (updater instanceof Function) state.value = updater(state.value);
|
|
2695
|
+
else state.value = updater;
|
|
2696
|
+
initialOptions.onStateChange == null || initialOptions.onStateChange(updater);
|
|
2697
|
+
}
|
|
2698
|
+
});
|
|
2699
|
+
});
|
|
2700
|
+
});
|
|
2701
|
+
return table;
|
|
2702
|
+
}
|
|
2703
|
+
//#endregion
|
|
2704
|
+
//#region virtual:nuxt:node_modules%2F.cache%2Fnuxt%2F.nuxt%2Fui%2Ftable.ts
|
|
2705
|
+
var virtual_nuxt_node_modules_2F_cache_2Fnuxt_2F_nuxt_2Fui_2Ftable_default = {
|
|
2706
|
+
"slots": {
|
|
2707
|
+
"root": "relative overflow-auto outline-primary/25 focus-visible:outline-3",
|
|
2708
|
+
"base": "min-w-full overflow-clip",
|
|
2709
|
+
"caption": "sr-only",
|
|
2710
|
+
"thead": "relative",
|
|
2711
|
+
"tbody": "isolate [&>tr]:data-[selectable=true]:hover:bg-elevated/50 [&>tr]:data-[selectable=true]:outline-primary/25 [&>tr]:data-[selectable=true]:focus-visible:outline-3 divide-y divide-default",
|
|
2712
|
+
"tfoot": "relative",
|
|
2713
|
+
"tr": "data-[selected=true]:bg-elevated/50",
|
|
2714
|
+
"th": "px-4 py-3.5 text-sm text-highlighted text-start font-semibold [&:has([role=checkbox])]:pe-0",
|
|
2715
|
+
"td": "p-4 text-sm text-muted whitespace-nowrap [&:has([role=checkbox])]:pe-0",
|
|
2716
|
+
"separator": "absolute z-1 start-0 w-full h-px bg-(--ui-border-accented)",
|
|
2717
|
+
"empty": "py-6 text-center text-sm text-muted",
|
|
2718
|
+
"loading": "py-6 text-center"
|
|
2719
|
+
},
|
|
2720
|
+
"variants": {
|
|
2721
|
+
"pinned": { "true": {
|
|
2722
|
+
"th": "sticky bg-default/75 z-1",
|
|
2723
|
+
"td": "sticky bg-default/75 z-1"
|
|
2724
|
+
} },
|
|
2725
|
+
"sticky": {
|
|
2726
|
+
"true": {
|
|
2727
|
+
"thead": "sticky top-0 inset-x-0 bg-default/75 backdrop-blur z-1",
|
|
2728
|
+
"tfoot": "sticky bottom-0 inset-x-0 bg-default/75 backdrop-blur z-1"
|
|
2729
|
+
},
|
|
2730
|
+
"header": { "thead": "sticky top-0 inset-x-0 bg-default/75 backdrop-blur z-1" },
|
|
2731
|
+
"footer": { "tfoot": "sticky bottom-0 inset-x-0 bg-default/75 backdrop-blur z-1" }
|
|
2732
|
+
},
|
|
2733
|
+
"loading": { "true": { "thead": "after:absolute after:z-1 after:h-px motion-reduce:after:inset-x-0 motion-reduce:after:animate-pulse" } },
|
|
2734
|
+
"externalScroll": { "true": { "root": "overflow-visible" } },
|
|
2735
|
+
"loadingAnimation": {
|
|
2736
|
+
"carousel": "",
|
|
2737
|
+
"carousel-inverse": "",
|
|
2738
|
+
"swing": "",
|
|
2739
|
+
"elastic": ""
|
|
2740
|
+
},
|
|
2741
|
+
"loadingColor": {
|
|
2742
|
+
"primary": "",
|
|
2743
|
+
"secondary": "",
|
|
2744
|
+
"success": "",
|
|
2745
|
+
"info": "",
|
|
2746
|
+
"warning": "",
|
|
2747
|
+
"error": "",
|
|
2748
|
+
"neutral": ""
|
|
2749
|
+
}
|
|
2750
|
+
},
|
|
2751
|
+
"compoundVariants": [
|
|
2752
|
+
{
|
|
2753
|
+
"loading": true,
|
|
2754
|
+
"loadingColor": "primary",
|
|
2755
|
+
"class": { "thead": "after:bg-primary" }
|
|
2756
|
+
},
|
|
2757
|
+
{
|
|
2758
|
+
"loading": true,
|
|
2759
|
+
"loadingColor": "secondary",
|
|
2760
|
+
"class": { "thead": "after:bg-secondary" }
|
|
2761
|
+
},
|
|
2762
|
+
{
|
|
2763
|
+
"loading": true,
|
|
2764
|
+
"loadingColor": "success",
|
|
2765
|
+
"class": { "thead": "after:bg-success" }
|
|
2766
|
+
},
|
|
2767
|
+
{
|
|
2768
|
+
"loading": true,
|
|
2769
|
+
"loadingColor": "info",
|
|
2770
|
+
"class": { "thead": "after:bg-info" }
|
|
2771
|
+
},
|
|
2772
|
+
{
|
|
2773
|
+
"loading": true,
|
|
2774
|
+
"loadingColor": "warning",
|
|
2775
|
+
"class": { "thead": "after:bg-warning" }
|
|
2776
|
+
},
|
|
2777
|
+
{
|
|
2778
|
+
"loading": true,
|
|
2779
|
+
"loadingColor": "error",
|
|
2780
|
+
"class": { "thead": "after:bg-error" }
|
|
2781
|
+
},
|
|
2782
|
+
{
|
|
2783
|
+
"loading": true,
|
|
2784
|
+
"loadingColor": "neutral",
|
|
2785
|
+
"class": { "thead": "after:bg-inverted" }
|
|
2786
|
+
},
|
|
2787
|
+
{
|
|
2788
|
+
"loading": true,
|
|
2789
|
+
"loadingAnimation": "carousel",
|
|
2790
|
+
"class": { "thead": "motion-safe:after:animate-[carousel_2s_ease-in-out_infinite] motion-safe:rtl:after:animate-[carousel-rtl_2s_ease-in-out_infinite]" }
|
|
2791
|
+
},
|
|
2792
|
+
{
|
|
2793
|
+
"loading": true,
|
|
2794
|
+
"loadingAnimation": "carousel-inverse",
|
|
2795
|
+
"class": { "thead": "motion-safe:after:animate-[carousel-inverse_2s_ease-in-out_infinite] motion-safe:rtl:after:animate-[carousel-inverse-rtl_2s_ease-in-out_infinite]" }
|
|
2796
|
+
},
|
|
2797
|
+
{
|
|
2798
|
+
"loading": true,
|
|
2799
|
+
"loadingAnimation": "swing",
|
|
2800
|
+
"class": { "thead": "motion-safe:after:animate-[swing_2s_ease-in-out_infinite]" }
|
|
2801
|
+
},
|
|
2802
|
+
{
|
|
2803
|
+
"loading": true,
|
|
2804
|
+
"loadingAnimation": "elastic",
|
|
2805
|
+
"class": { "thead": "motion-safe:after:animate-[elastic_2s_ease-in-out_infinite]" }
|
|
2806
|
+
}
|
|
2807
|
+
],
|
|
2808
|
+
"defaultVariants": {
|
|
2809
|
+
"loadingColor": "primary",
|
|
2810
|
+
"loadingAnimation": "carousel"
|
|
2811
|
+
}
|
|
2812
|
+
};
|
|
2813
|
+
//#endregion
|
|
2814
|
+
//#region node_modules/.pnpm/@nuxt+ui@4.10.0_e299f0a9b209424c2a6c150f5a1a8167/node_modules/@nuxt/ui/dist/runtime/components/Table.vue
|
|
2815
|
+
var _sfc_main = /*@__PURE__*/ Object.assign({ inheritAttrs: false }, {
|
|
2816
|
+
__name: "UTable",
|
|
2817
|
+
__ssrInlineRender: true,
|
|
2818
|
+
props: /*@__PURE__*/ mergeModels({
|
|
2819
|
+
as: {
|
|
2820
|
+
type: null,
|
|
2821
|
+
required: false
|
|
2822
|
+
},
|
|
2823
|
+
data: {
|
|
2824
|
+
type: Array,
|
|
2825
|
+
required: false
|
|
2826
|
+
},
|
|
2827
|
+
columns: {
|
|
2828
|
+
type: Array,
|
|
2829
|
+
required: false
|
|
2830
|
+
},
|
|
2831
|
+
caption: {
|
|
2832
|
+
type: String,
|
|
2833
|
+
required: false
|
|
2834
|
+
},
|
|
2835
|
+
meta: {
|
|
2836
|
+
type: Object,
|
|
2837
|
+
required: false
|
|
2838
|
+
},
|
|
2839
|
+
virtualize: {
|
|
2840
|
+
type: [Boolean, Object],
|
|
2841
|
+
required: false,
|
|
2842
|
+
default: false
|
|
2843
|
+
},
|
|
2844
|
+
empty: {
|
|
2845
|
+
type: String,
|
|
2846
|
+
required: false
|
|
2847
|
+
},
|
|
2848
|
+
sticky: {
|
|
2849
|
+
type: [Boolean, String],
|
|
2850
|
+
required: false
|
|
2851
|
+
},
|
|
2852
|
+
loading: {
|
|
2853
|
+
type: Boolean,
|
|
2854
|
+
required: false
|
|
2855
|
+
},
|
|
2856
|
+
loadingColor: {
|
|
2857
|
+
type: null,
|
|
2858
|
+
required: false
|
|
2859
|
+
},
|
|
2860
|
+
loadingAnimation: {
|
|
2861
|
+
type: null,
|
|
2862
|
+
required: false
|
|
2863
|
+
},
|
|
2864
|
+
watchOptions: {
|
|
2865
|
+
type: Object,
|
|
2866
|
+
required: false,
|
|
2867
|
+
default: () => ({ deep: true })
|
|
2868
|
+
},
|
|
2869
|
+
globalFilterOptions: {
|
|
2870
|
+
type: Object,
|
|
2871
|
+
required: false
|
|
2872
|
+
},
|
|
2873
|
+
columnFiltersOptions: {
|
|
2874
|
+
type: Object,
|
|
2875
|
+
required: false
|
|
2876
|
+
},
|
|
2877
|
+
columnPinningOptions: {
|
|
2878
|
+
type: Object,
|
|
2879
|
+
required: false
|
|
2880
|
+
},
|
|
2881
|
+
columnSizingOptions: {
|
|
2882
|
+
type: Object,
|
|
2883
|
+
required: false
|
|
2884
|
+
},
|
|
2885
|
+
visibilityOptions: {
|
|
2886
|
+
type: Object,
|
|
2887
|
+
required: false
|
|
2888
|
+
},
|
|
2889
|
+
sortingOptions: {
|
|
2890
|
+
type: Object,
|
|
2891
|
+
required: false
|
|
2892
|
+
},
|
|
2893
|
+
groupingOptions: {
|
|
2894
|
+
type: Object,
|
|
2895
|
+
required: false
|
|
2896
|
+
},
|
|
2897
|
+
expandedOptions: {
|
|
2898
|
+
type: Object,
|
|
2899
|
+
required: false
|
|
2900
|
+
},
|
|
2901
|
+
rowSelectionOptions: {
|
|
2902
|
+
type: Object,
|
|
2903
|
+
required: false
|
|
2904
|
+
},
|
|
2905
|
+
rowPinningOptions: {
|
|
2906
|
+
type: Object,
|
|
2907
|
+
required: false
|
|
2908
|
+
},
|
|
2909
|
+
paginationOptions: {
|
|
2910
|
+
type: Object,
|
|
2911
|
+
required: false
|
|
2912
|
+
},
|
|
2913
|
+
facetedOptions: {
|
|
2914
|
+
type: Object,
|
|
2915
|
+
required: false
|
|
2916
|
+
},
|
|
2917
|
+
onSelect: {
|
|
2918
|
+
type: Function,
|
|
2919
|
+
required: false
|
|
2920
|
+
},
|
|
2921
|
+
onHover: {
|
|
2922
|
+
type: Function,
|
|
2923
|
+
required: false
|
|
2924
|
+
},
|
|
2925
|
+
onContextmenu: {
|
|
2926
|
+
type: [Function, Array],
|
|
2927
|
+
required: false
|
|
2928
|
+
},
|
|
2929
|
+
class: {
|
|
2930
|
+
type: null,
|
|
2931
|
+
required: false
|
|
2932
|
+
},
|
|
2933
|
+
ui: {
|
|
2934
|
+
type: Object,
|
|
2935
|
+
required: false
|
|
2936
|
+
},
|
|
2937
|
+
state: {
|
|
2938
|
+
type: Object,
|
|
2939
|
+
required: false
|
|
2940
|
+
},
|
|
2941
|
+
onStateChange: {
|
|
2942
|
+
type: Function,
|
|
2943
|
+
required: false
|
|
2944
|
+
},
|
|
2945
|
+
renderFallbackValue: {
|
|
2946
|
+
type: null,
|
|
2947
|
+
required: false
|
|
2948
|
+
},
|
|
2949
|
+
_features: {
|
|
2950
|
+
type: Array,
|
|
2951
|
+
required: false
|
|
2952
|
+
},
|
|
2953
|
+
autoResetAll: {
|
|
2954
|
+
type: Boolean,
|
|
2955
|
+
required: false
|
|
2956
|
+
},
|
|
2957
|
+
debugAll: {
|
|
2958
|
+
type: Boolean,
|
|
2959
|
+
required: false
|
|
2960
|
+
},
|
|
2961
|
+
debugCells: {
|
|
2962
|
+
type: Boolean,
|
|
2963
|
+
required: false
|
|
2964
|
+
},
|
|
2965
|
+
debugColumns: {
|
|
2966
|
+
type: Boolean,
|
|
2967
|
+
required: false
|
|
2968
|
+
},
|
|
2969
|
+
debugHeaders: {
|
|
2970
|
+
type: Boolean,
|
|
2971
|
+
required: false
|
|
2972
|
+
},
|
|
2973
|
+
debugRows: {
|
|
2974
|
+
type: Boolean,
|
|
2975
|
+
required: false
|
|
2976
|
+
},
|
|
2977
|
+
debugTable: {
|
|
2978
|
+
type: Boolean,
|
|
2979
|
+
required: false
|
|
2980
|
+
},
|
|
2981
|
+
defaultColumn: {
|
|
2982
|
+
type: Object,
|
|
2983
|
+
required: false
|
|
2984
|
+
},
|
|
2985
|
+
getRowId: {
|
|
2986
|
+
type: Function,
|
|
2987
|
+
required: false
|
|
2988
|
+
},
|
|
2989
|
+
getSubRows: {
|
|
2990
|
+
type: Function,
|
|
2991
|
+
required: false
|
|
2992
|
+
},
|
|
2993
|
+
initialState: {
|
|
2994
|
+
type: Object,
|
|
2995
|
+
required: false
|
|
2996
|
+
},
|
|
2997
|
+
mergeOptions: {
|
|
2998
|
+
type: Function,
|
|
2999
|
+
required: false
|
|
3000
|
+
}
|
|
3001
|
+
}, {
|
|
3002
|
+
"globalFilter": { type: String },
|
|
3003
|
+
"globalFilterModifiers": {},
|
|
3004
|
+
"columnFilters": { type: Array },
|
|
3005
|
+
"columnFiltersModifiers": {},
|
|
3006
|
+
"columnOrder": { type: Array },
|
|
3007
|
+
"columnOrderModifiers": {},
|
|
3008
|
+
"columnVisibility": { type: Object },
|
|
3009
|
+
"columnVisibilityModifiers": {},
|
|
3010
|
+
"columnPinning": { type: Object },
|
|
3011
|
+
"columnPinningModifiers": {},
|
|
3012
|
+
"columnSizing": { type: Object },
|
|
3013
|
+
"columnSizingModifiers": {},
|
|
3014
|
+
"columnSizingInfo": { type: Object },
|
|
3015
|
+
"columnSizingInfoModifiers": {},
|
|
3016
|
+
"rowSelection": { type: Object },
|
|
3017
|
+
"rowSelectionModifiers": {},
|
|
3018
|
+
"rowPinning": { type: Object },
|
|
3019
|
+
"rowPinningModifiers": {},
|
|
3020
|
+
"sorting": { type: Array },
|
|
3021
|
+
"sortingModifiers": {},
|
|
3022
|
+
"grouping": { type: Array },
|
|
3023
|
+
"groupingModifiers": {},
|
|
3024
|
+
"expanded": { type: [Boolean, Object] },
|
|
3025
|
+
"expandedModifiers": {},
|
|
3026
|
+
"pagination": { type: Object },
|
|
3027
|
+
"paginationModifiers": {}
|
|
3028
|
+
}),
|
|
3029
|
+
emits: [
|
|
3030
|
+
"update:globalFilter",
|
|
3031
|
+
"update:columnFilters",
|
|
3032
|
+
"update:columnOrder",
|
|
3033
|
+
"update:columnVisibility",
|
|
3034
|
+
"update:columnPinning",
|
|
3035
|
+
"update:columnSizing",
|
|
3036
|
+
"update:columnSizingInfo",
|
|
3037
|
+
"update:rowSelection",
|
|
3038
|
+
"update:rowPinning",
|
|
3039
|
+
"update:sorting",
|
|
3040
|
+
"update:grouping",
|
|
3041
|
+
"update:expanded",
|
|
3042
|
+
"update:pagination"
|
|
3043
|
+
],
|
|
3044
|
+
setup(__props, { expose: __expose }) {
|
|
3045
|
+
const _props = __props;
|
|
3046
|
+
const slots = useSlots();
|
|
3047
|
+
const props = useComponentProps("table", _props);
|
|
3048
|
+
const { t } = useLocale();
|
|
3049
|
+
const appConfig = useAppConfig();
|
|
3050
|
+
const data = createRef(props.data ?? [], props.watchOptions?.deep !== false);
|
|
3051
|
+
const meta = computed(() => props.meta ?? {});
|
|
3052
|
+
const columns = computed(() => processColumns(props.columns ?? Object.keys(data.value[0] ?? {}).map((accessorKey) => ({
|
|
3053
|
+
accessorKey,
|
|
3054
|
+
header: upperFirst(accessorKey)
|
|
3055
|
+
}))));
|
|
3056
|
+
function processColumns(columns2) {
|
|
3057
|
+
return columns2.map((column) => {
|
|
3058
|
+
const col = { ...column };
|
|
3059
|
+
if ("columns" in col && col.columns) col.columns = processColumns(col.columns);
|
|
3060
|
+
if (!col.cell) col.cell = ({ getValue }) => {
|
|
3061
|
+
const value = getValue();
|
|
3062
|
+
if (value === "" || value === null || value === void 0) return "\xA0";
|
|
3063
|
+
return String(value);
|
|
3064
|
+
};
|
|
3065
|
+
return col;
|
|
3066
|
+
});
|
|
3067
|
+
}
|
|
3068
|
+
const isExternalScroll = computed(() => typeof props.virtualize === "object" && !!props.virtualize.getScrollElement);
|
|
3069
|
+
const ui = computed(() => tv({
|
|
3070
|
+
extend: virtual_nuxt_node_modules_2F_cache_2Fnuxt_2F_nuxt_2Fui_2Ftable_default,
|
|
3071
|
+
...appConfig.ui?.table || {}
|
|
3072
|
+
})({
|
|
3073
|
+
sticky: props.sticky,
|
|
3074
|
+
loading: props.loading,
|
|
3075
|
+
loadingColor: props.loadingColor,
|
|
3076
|
+
loadingAnimation: props.loadingAnimation,
|
|
3077
|
+
externalScroll: isExternalScroll.value
|
|
3078
|
+
}));
|
|
3079
|
+
const [DefineTableTemplate, ReuseTableTemplate] = createReusableTemplate();
|
|
3080
|
+
const [DefineRowTemplate, ReuseRowTemplate] = createReusableTemplate({ props: {
|
|
3081
|
+
row: {
|
|
3082
|
+
type: Object,
|
|
3083
|
+
required: true
|
|
3084
|
+
},
|
|
3085
|
+
style: {
|
|
3086
|
+
type: Object,
|
|
3087
|
+
required: false
|
|
3088
|
+
}
|
|
3089
|
+
} });
|
|
3090
|
+
const hasFooter = computed(() => {
|
|
3091
|
+
function hasFooterRecursive(columns2) {
|
|
3092
|
+
for (const column of columns2) {
|
|
3093
|
+
if ("footer" in column) return true;
|
|
3094
|
+
if ("columns" in column && hasFooterRecursive(column.columns)) return true;
|
|
3095
|
+
}
|
|
3096
|
+
return false;
|
|
3097
|
+
}
|
|
3098
|
+
return hasFooterRecursive(columns.value);
|
|
3099
|
+
});
|
|
3100
|
+
const globalFilterState = useModel(__props, "globalFilter");
|
|
3101
|
+
const columnFiltersState = useModel(__props, "columnFilters");
|
|
3102
|
+
const columnOrderState = useModel(__props, "columnOrder");
|
|
3103
|
+
const columnVisibilityState = useModel(__props, "columnVisibility");
|
|
3104
|
+
const columnPinningState = useModel(__props, "columnPinning");
|
|
3105
|
+
const columnSizingState = useModel(__props, "columnSizing");
|
|
3106
|
+
const columnSizingInfoState = useModel(__props, "columnSizingInfo");
|
|
3107
|
+
const rowSelectionState = useModel(__props, "rowSelection");
|
|
3108
|
+
const rowPinningState = useModel(__props, "rowPinning");
|
|
3109
|
+
const sortingState = useModel(__props, "sorting");
|
|
3110
|
+
const groupingState = useModel(__props, "grouping");
|
|
3111
|
+
const expandedState = useModel(__props, "expanded");
|
|
3112
|
+
const paginationState = useModel(__props, "pagination");
|
|
3113
|
+
const rootRef = useTemplateRef("rootRef");
|
|
3114
|
+
const tableRef = useTemplateRef("tableRef");
|
|
3115
|
+
const tableApi = useVueTable({
|
|
3116
|
+
...useForwardProps(reactivePick(props, "_features", "autoResetAll", "debugAll", "debugCells", "debugColumns", "debugHeaders", "debugRows", "debugTable", "defaultColumn", "getRowId", "getSubRows", "initialState", "mergeOptions", "renderFallbackValue")).value,
|
|
3117
|
+
get data() {
|
|
3118
|
+
return data.value;
|
|
3119
|
+
},
|
|
3120
|
+
get columns() {
|
|
3121
|
+
return columns.value;
|
|
3122
|
+
},
|
|
3123
|
+
meta: meta.value,
|
|
3124
|
+
getCoreRowModel: getCoreRowModel(),
|
|
3125
|
+
...props.globalFilterOptions || {},
|
|
3126
|
+
...globalFilterState.value !== void 0 && { onGlobalFilterChange: (updaterOrValue) => valueUpdater(updaterOrValue, globalFilterState) },
|
|
3127
|
+
...props.columnFiltersOptions || {},
|
|
3128
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
3129
|
+
...columnFiltersState.value !== void 0 && { onColumnFiltersChange: (updaterOrValue) => valueUpdater(updaterOrValue, columnFiltersState) },
|
|
3130
|
+
...columnOrderState.value !== void 0 && { onColumnOrderChange: (updaterOrValue) => valueUpdater(updaterOrValue, columnOrderState) },
|
|
3131
|
+
...props.visibilityOptions || {},
|
|
3132
|
+
...columnVisibilityState.value !== void 0 && { onColumnVisibilityChange: (updaterOrValue) => valueUpdater(updaterOrValue, columnVisibilityState) },
|
|
3133
|
+
...props.columnPinningOptions || {},
|
|
3134
|
+
...columnPinningState.value !== void 0 && { onColumnPinningChange: (updaterOrValue) => valueUpdater(updaterOrValue, columnPinningState) },
|
|
3135
|
+
...props.columnSizingOptions || {},
|
|
3136
|
+
...columnSizingState.value !== void 0 && { onColumnSizingChange: (updaterOrValue) => valueUpdater(updaterOrValue, columnSizingState) },
|
|
3137
|
+
...columnSizingInfoState.value !== void 0 && { onColumnSizingInfoChange: (updaterOrValue) => valueUpdater(updaterOrValue, columnSizingInfoState) },
|
|
3138
|
+
...props.rowSelectionOptions || {},
|
|
3139
|
+
...rowSelectionState.value !== void 0 && { onRowSelectionChange: (updaterOrValue) => valueUpdater(updaterOrValue, rowSelectionState) },
|
|
3140
|
+
...props.rowPinningOptions || {},
|
|
3141
|
+
...rowPinningState.value !== void 0 && { onRowPinningChange: (updaterOrValue) => valueUpdater(updaterOrValue, rowPinningState) },
|
|
3142
|
+
...props.sortingOptions || {},
|
|
3143
|
+
getSortedRowModel: getSortedRowModel(),
|
|
3144
|
+
...sortingState.value !== void 0 && { onSortingChange: (updaterOrValue) => valueUpdater(updaterOrValue, sortingState) },
|
|
3145
|
+
...props.groupingOptions || {},
|
|
3146
|
+
...groupingState.value !== void 0 && { onGroupingChange: (updaterOrValue) => valueUpdater(updaterOrValue, groupingState) },
|
|
3147
|
+
...props.expandedOptions || {},
|
|
3148
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
3149
|
+
...expandedState.value !== void 0 && { onExpandedChange: (updaterOrValue) => valueUpdater(updaterOrValue, expandedState) },
|
|
3150
|
+
...props.paginationOptions || {},
|
|
3151
|
+
...paginationState.value !== void 0 && { onPaginationChange: (updaterOrValue) => valueUpdater(updaterOrValue, paginationState) },
|
|
3152
|
+
...props.facetedOptions || {},
|
|
3153
|
+
state: {
|
|
3154
|
+
get globalFilter() {
|
|
3155
|
+
return globalFilterState.value;
|
|
3156
|
+
},
|
|
3157
|
+
get columnFilters() {
|
|
3158
|
+
return columnFiltersState.value;
|
|
3159
|
+
},
|
|
3160
|
+
get columnOrder() {
|
|
3161
|
+
return columnOrderState.value;
|
|
3162
|
+
},
|
|
3163
|
+
get columnVisibility() {
|
|
3164
|
+
return columnVisibilityState.value;
|
|
3165
|
+
},
|
|
3166
|
+
get columnPinning() {
|
|
3167
|
+
return columnPinningState.value;
|
|
3168
|
+
},
|
|
3169
|
+
get expanded() {
|
|
3170
|
+
return expandedState.value;
|
|
3171
|
+
},
|
|
3172
|
+
get rowSelection() {
|
|
3173
|
+
return rowSelectionState.value;
|
|
3174
|
+
},
|
|
3175
|
+
get sorting() {
|
|
3176
|
+
return sortingState.value;
|
|
3177
|
+
},
|
|
3178
|
+
get grouping() {
|
|
3179
|
+
return groupingState.value;
|
|
3180
|
+
},
|
|
3181
|
+
get rowPinning() {
|
|
3182
|
+
return rowPinningState.value;
|
|
3183
|
+
},
|
|
3184
|
+
get columnSizing() {
|
|
3185
|
+
return columnSizingState.value;
|
|
3186
|
+
},
|
|
3187
|
+
get columnSizingInfo() {
|
|
3188
|
+
return columnSizingInfoState.value;
|
|
3189
|
+
},
|
|
3190
|
+
get pagination() {
|
|
3191
|
+
return paginationState.value;
|
|
3192
|
+
}
|
|
3193
|
+
}
|
|
3194
|
+
});
|
|
3195
|
+
const rows = computed(() => tableApi.getRowModel().rows);
|
|
3196
|
+
const topRows = computed(() => props.virtualize ? [] : tableApi.getTopRows());
|
|
3197
|
+
const bottomRows = computed(() => props.virtualize ? [] : tableApi.getBottomRows());
|
|
3198
|
+
const centerRows = computed(() => topRows.value.length || bottomRows.value.length ? tableApi.getCenterRows() : rows.value);
|
|
3199
|
+
const virtualizerProps = toRef(() => defu(typeof props.virtualize === "boolean" ? {} : props.virtualize, {
|
|
3200
|
+
estimateSize: 65,
|
|
3201
|
+
overscan: 12
|
|
3202
|
+
}));
|
|
3203
|
+
const getScrollElement = () => (isExternalScroll.value ? virtualizerProps.value.getScrollElement?.() : rootRef.value?.$el) ?? null;
|
|
3204
|
+
const scrollMargin = computed(() => virtualizerProps.value.scrollMargin ?? 0);
|
|
3205
|
+
const virtualizer = !!props.virtualize && useVirtualizer({
|
|
3206
|
+
...virtualizerProps.value,
|
|
3207
|
+
get count() {
|
|
3208
|
+
return centerRows.value.length;
|
|
3209
|
+
},
|
|
3210
|
+
get scrollMargin() {
|
|
3211
|
+
return scrollMargin.value;
|
|
3212
|
+
},
|
|
3213
|
+
getScrollElement,
|
|
3214
|
+
estimateSize: (index) => {
|
|
3215
|
+
const estimate = virtualizerProps.value.estimateSize;
|
|
3216
|
+
return typeof estimate === "function" ? estimate(index) : estimate;
|
|
3217
|
+
}
|
|
3218
|
+
});
|
|
3219
|
+
const virtualItems = computed(() => virtualizer ? virtualizer.value.getVirtualItems() : []);
|
|
3220
|
+
const virtualPaddingTop = computed(() => (virtualItems.value[0]?.start ?? 0) - scrollMargin.value);
|
|
3221
|
+
const virtualPaddingBottom = computed(() => {
|
|
3222
|
+
if (!virtualizer || !virtualItems.value.length) return 0;
|
|
3223
|
+
return virtualizer.value.getTotalSize() - (virtualItems.value[virtualItems.value.length - 1]?.end ?? 0) + scrollMargin.value;
|
|
3224
|
+
});
|
|
3225
|
+
function valueUpdater(updaterOrValue, ref) {
|
|
3226
|
+
ref.value = typeof updaterOrValue === "function" ? updaterOrValue(ref.value) : updaterOrValue;
|
|
3227
|
+
}
|
|
3228
|
+
function onRowSelect(e, row) {
|
|
3229
|
+
if (!props.onSelect) return;
|
|
3230
|
+
const target = e.target;
|
|
3231
|
+
if (target.closest("button") || target.closest("a")) return;
|
|
3232
|
+
e.preventDefault();
|
|
3233
|
+
e.stopPropagation();
|
|
3234
|
+
props.onSelect(e, row);
|
|
3235
|
+
}
|
|
3236
|
+
function onRowHover(e, row) {
|
|
3237
|
+
if (!props.onHover) return;
|
|
3238
|
+
props.onHover(e, row);
|
|
3239
|
+
}
|
|
3240
|
+
function onRowContextmenu(e, row) {
|
|
3241
|
+
if (!props.onContextmenu) return;
|
|
3242
|
+
if (Array.isArray(props.onContextmenu)) props.onContextmenu.forEach((fn) => fn(e, row));
|
|
3243
|
+
else props.onContextmenu(e, row);
|
|
3244
|
+
}
|
|
3245
|
+
function resolveValue(prop, arg) {
|
|
3246
|
+
if (typeof prop === "function") return prop(arg);
|
|
3247
|
+
return prop;
|
|
3248
|
+
}
|
|
3249
|
+
function getColumnStyles(column) {
|
|
3250
|
+
const styles = {};
|
|
3251
|
+
const pinned = column.getIsPinned();
|
|
3252
|
+
if (pinned === "left") styles.left = `${column.getStart("left")}px`;
|
|
3253
|
+
else if (pinned === "right") styles.right = `${column.getAfter("right")}px`;
|
|
3254
|
+
return styles;
|
|
3255
|
+
}
|
|
3256
|
+
watch(() => props.data, () => {
|
|
3257
|
+
data.value = props.data ? [...props.data] : [];
|
|
3258
|
+
}, props.watchOptions);
|
|
3259
|
+
__expose({
|
|
3260
|
+
get $el() {
|
|
3261
|
+
return rootRef.value?.$el;
|
|
3262
|
+
},
|
|
3263
|
+
tableRef,
|
|
3264
|
+
tableApi
|
|
3265
|
+
});
|
|
3266
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
3267
|
+
_push(`<!--[-->`);
|
|
3268
|
+
_push(ssrRenderComponent(unref(DefineRowTemplate), null, {
|
|
3269
|
+
default: withCtx(({ row, style }, _push, _parent, _scopeId) => {
|
|
3270
|
+
if (_push) {
|
|
3271
|
+
_push(`<tr${ssrRenderAttr("data-selected", row.getIsSelected())}${ssrRenderAttr("data-selectable", !!unref(props).onSelect || !!unref(props).onHover || !!unref(props).onContextmenu)}${ssrRenderAttr("data-expanded", row.getIsExpanded())}${ssrRenderAttr("data-pinned", row.getIsPinned() || void 0)}${ssrRenderAttr("role", unref(props).onSelect ? "button" : void 0)}${ssrRenderAttr("tabindex", unref(props).onSelect ? 0 : void 0)} data-slot="tr" class="${ssrRenderClass(ui.value.tr({ class: [unref(props).ui?.tr, resolveValue(unref(tableApi).options.meta?.class?.tr, row)] }))}" style="${ssrRenderStyle([resolveValue(unref(tableApi).options.meta?.style?.tr, row), style])}"${_scopeId}><!--[-->`);
|
|
3272
|
+
ssrRenderList(row.getVisibleCells(), (cell) => {
|
|
3273
|
+
_push(`<td${ssrRenderAttr("data-pinned", cell.column.getIsPinned())}${ssrRenderAttr("colspan", resolveValue(cell.column.columnDef.meta?.colspan?.td, cell))}${ssrRenderAttr("rowspan", resolveValue(cell.column.columnDef.meta?.rowspan?.td, cell))} data-slot="td" class="${ssrRenderClass(ui.value.td({
|
|
3274
|
+
class: [unref(props).ui?.td, resolveValue(cell.column.columnDef.meta?.class?.td, cell)],
|
|
3275
|
+
pinned: !!cell.column.getIsPinned()
|
|
3276
|
+
}))}" style="${ssrRenderStyle([getColumnStyles(cell.column), resolveValue(cell.column.columnDef.meta?.style?.td, cell)])}"${_scopeId}>`);
|
|
3277
|
+
ssrRenderSlot(_ctx.$slots, `${cell.column.id}-cell`, mergeProps({ ref_for: true }, cell.getContext()), () => {
|
|
3278
|
+
_push(ssrRenderComponent(unref(FlexRender), {
|
|
3279
|
+
render: cell.column.columnDef.cell,
|
|
3280
|
+
props: cell.getContext()
|
|
3281
|
+
}, null, _parent, _scopeId));
|
|
3282
|
+
}, _push, _parent, _scopeId);
|
|
3283
|
+
_push(`</td>`);
|
|
3284
|
+
});
|
|
3285
|
+
_push(`<!--]--></tr>`);
|
|
3286
|
+
if (row.getIsExpanded()) {
|
|
3287
|
+
_push(`<tr data-slot="tr" class="${ssrRenderClass(ui.value.tr({ class: [unref(props).ui?.tr] }))}"${_scopeId}><td${ssrRenderAttr("colspan", row.getAllCells().length)} data-slot="td" class="${ssrRenderClass(ui.value.td({ class: [unref(props).ui?.td] }))}"${_scopeId}>`);
|
|
3288
|
+
ssrRenderSlot(_ctx.$slots, "expanded", { row }, null, _push, _parent, _scopeId);
|
|
3289
|
+
_push(`</td></tr>`);
|
|
3290
|
+
} else _push(`<!---->`);
|
|
3291
|
+
} else return [createVNode("tr", {
|
|
3292
|
+
"data-selected": row.getIsSelected(),
|
|
3293
|
+
"data-selectable": !!unref(props).onSelect || !!unref(props).onHover || !!unref(props).onContextmenu,
|
|
3294
|
+
"data-expanded": row.getIsExpanded(),
|
|
3295
|
+
"data-pinned": row.getIsPinned() || void 0,
|
|
3296
|
+
role: unref(props).onSelect ? "button" : void 0,
|
|
3297
|
+
tabindex: unref(props).onSelect ? 0 : void 0,
|
|
3298
|
+
"data-slot": "tr",
|
|
3299
|
+
class: ui.value.tr({ class: [unref(props).ui?.tr, resolveValue(unref(tableApi).options.meta?.class?.tr, row)] }),
|
|
3300
|
+
style: [resolveValue(unref(tableApi).options.meta?.style?.tr, row), style],
|
|
3301
|
+
onClick: ($event) => onRowSelect($event, row),
|
|
3302
|
+
onPointerenter: ($event) => onRowHover($event, row),
|
|
3303
|
+
onPointerleave: ($event) => onRowHover($event, null),
|
|
3304
|
+
onContextmenu: ($event) => onRowContextmenu($event, row)
|
|
3305
|
+
}, [(openBlock(true), createBlock(Fragment, null, renderList(row.getVisibleCells(), (cell) => {
|
|
3306
|
+
return openBlock(), createBlock("td", {
|
|
3307
|
+
key: cell.id,
|
|
3308
|
+
"data-pinned": cell.column.getIsPinned(),
|
|
3309
|
+
colspan: resolveValue(cell.column.columnDef.meta?.colspan?.td, cell),
|
|
3310
|
+
rowspan: resolveValue(cell.column.columnDef.meta?.rowspan?.td, cell),
|
|
3311
|
+
"data-slot": "td",
|
|
3312
|
+
class: ui.value.td({
|
|
3313
|
+
class: [unref(props).ui?.td, resolveValue(cell.column.columnDef.meta?.class?.td, cell)],
|
|
3314
|
+
pinned: !!cell.column.getIsPinned()
|
|
3315
|
+
}),
|
|
3316
|
+
style: [getColumnStyles(cell.column), resolveValue(cell.column.columnDef.meta?.style?.td, cell)]
|
|
3317
|
+
}, [renderSlot(_ctx.$slots, `${cell.column.id}-cell`, mergeProps({ ref_for: true }, cell.getContext()), () => [createVNode(unref(FlexRender), {
|
|
3318
|
+
render: cell.column.columnDef.cell,
|
|
3319
|
+
props: cell.getContext()
|
|
3320
|
+
}, null, 8, ["render", "props"])])], 14, [
|
|
3321
|
+
"data-pinned",
|
|
3322
|
+
"colspan",
|
|
3323
|
+
"rowspan"
|
|
3324
|
+
]);
|
|
3325
|
+
}), 128))], 46, [
|
|
3326
|
+
"data-selected",
|
|
3327
|
+
"data-selectable",
|
|
3328
|
+
"data-expanded",
|
|
3329
|
+
"data-pinned",
|
|
3330
|
+
"role",
|
|
3331
|
+
"tabindex",
|
|
3332
|
+
"onClick",
|
|
3333
|
+
"onPointerenter",
|
|
3334
|
+
"onPointerleave",
|
|
3335
|
+
"onContextmenu"
|
|
3336
|
+
]), row.getIsExpanded() ? (openBlock(), createBlock("tr", {
|
|
3337
|
+
key: 0,
|
|
3338
|
+
"data-slot": "tr",
|
|
3339
|
+
class: ui.value.tr({ class: [unref(props).ui?.tr] })
|
|
3340
|
+
}, [createVNode("td", {
|
|
3341
|
+
colspan: row.getAllCells().length,
|
|
3342
|
+
"data-slot": "td",
|
|
3343
|
+
class: ui.value.td({ class: [unref(props).ui?.td] })
|
|
3344
|
+
}, [renderSlot(_ctx.$slots, "expanded", { row })], 10, ["colspan"])], 2)) : createCommentVNode("", true)];
|
|
3345
|
+
}),
|
|
3346
|
+
_: 3
|
|
3347
|
+
}, _parent));
|
|
3348
|
+
_push(ssrRenderComponent(unref(DefineTableTemplate), null, {
|
|
3349
|
+
default: withCtx((_, _push, _parent, _scopeId) => {
|
|
3350
|
+
if (_push) {
|
|
3351
|
+
_push(`<table data-slot="base" class="${ssrRenderClass(ui.value.base({ class: [unref(props).ui?.base] }))}"${_scopeId}>`);
|
|
3352
|
+
if (unref(props).caption || !!slots.caption) {
|
|
3353
|
+
_push(`<caption data-slot="caption" class="${ssrRenderClass(ui.value.caption({ class: [unref(props).ui?.caption] }))}"${_scopeId}>`);
|
|
3354
|
+
ssrRenderSlot(_ctx.$slots, "caption", {}, () => {
|
|
3355
|
+
_push(`${ssrInterpolate(unref(props).caption)}`);
|
|
3356
|
+
}, _push, _parent, _scopeId);
|
|
3357
|
+
_push(`</caption>`);
|
|
3358
|
+
} else _push(`<!---->`);
|
|
3359
|
+
_push(`<thead data-slot="thead" class="${ssrRenderClass(ui.value.thead({ class: [unref(props).ui?.thead] }))}"${_scopeId}><!--[-->`);
|
|
3360
|
+
ssrRenderList(unref(tableApi).getHeaderGroups(), (headerGroup) => {
|
|
3361
|
+
_push(`<tr data-slot="tr" class="${ssrRenderClass(ui.value.tr({ class: [unref(props).ui?.tr] }))}"${_scopeId}><!--[-->`);
|
|
3362
|
+
ssrRenderList(headerGroup.headers, (header) => {
|
|
3363
|
+
_push(`<th${ssrRenderAttr("data-pinned", header.column.getIsPinned())}${ssrRenderAttr("scope", header.colSpan > 1 ? "colgroup" : "col")}${ssrRenderAttr("colspan", header.colSpan > 1 ? header.colSpan : void 0)}${ssrRenderAttr("rowspan", header.rowSpan > 1 ? header.rowSpan : void 0)} data-slot="th" class="${ssrRenderClass(ui.value.th({
|
|
3364
|
+
class: [unref(props).ui?.th, resolveValue(header.column.columnDef.meta?.class?.th, header)],
|
|
3365
|
+
pinned: !!header.column.getIsPinned()
|
|
3366
|
+
}))}" style="${ssrRenderStyle([getColumnStyles(header.column), resolveValue(header.column.columnDef.meta?.style?.th, header)])}"${_scopeId}>`);
|
|
3367
|
+
ssrRenderSlot(_ctx.$slots, `${header.id}-header`, mergeProps({ ref_for: true }, header.getContext()), () => {
|
|
3368
|
+
if (!header.isPlaceholder) _push(ssrRenderComponent(unref(FlexRender), {
|
|
3369
|
+
render: header.column.columnDef.header,
|
|
3370
|
+
props: header.getContext()
|
|
3371
|
+
}, null, _parent, _scopeId));
|
|
3372
|
+
else _push(`<!---->`);
|
|
3373
|
+
}, _push, _parent, _scopeId);
|
|
3374
|
+
_push(`</th>`);
|
|
3375
|
+
});
|
|
3376
|
+
_push(`<!--]--></tr>`);
|
|
3377
|
+
});
|
|
3378
|
+
_push(`<!--]--><tr data-slot="separator" class="${ssrRenderClass(ui.value.separator({ class: [unref(props).ui?.separator] }))}"${_scopeId}></tr></thead><tbody data-slot="tbody" class="${ssrRenderClass(ui.value.tbody({ class: [unref(props).ui?.tbody] }))}"${_scopeId}>`);
|
|
3379
|
+
ssrRenderSlot(_ctx.$slots, "body-top", {}, null, _push, _parent, _scopeId);
|
|
3380
|
+
if (rows.value.length) {
|
|
3381
|
+
_push(`<!--[--><!--[-->`);
|
|
3382
|
+
ssrRenderList(topRows.value, (row) => {
|
|
3383
|
+
_push(ssrRenderComponent(unref(ReuseRowTemplate), {
|
|
3384
|
+
key: row.id,
|
|
3385
|
+
row
|
|
3386
|
+
}, null, _parent, _scopeId));
|
|
3387
|
+
});
|
|
3388
|
+
_push(`<!--]-->`);
|
|
3389
|
+
if (unref(virtualizer)) {
|
|
3390
|
+
_push(`<!--[-->`);
|
|
3391
|
+
if (virtualPaddingTop.value > 0) _push(`<tr style="${ssrRenderStyle({ height: `${virtualPaddingTop.value}px` })}" aria-hidden="true"${_scopeId}><td${ssrRenderAttr("colspan", unref(tableApi).getAllLeafColumns().length)}${_scopeId}></td></tr>`);
|
|
3392
|
+
else _push(`<!---->`);
|
|
3393
|
+
_push(`<!--[-->`);
|
|
3394
|
+
ssrRenderList(virtualItems.value, (virtualRow) => {
|
|
3395
|
+
_push(`<!--[-->`);
|
|
3396
|
+
if (centerRows.value[virtualRow.index]) _push(ssrRenderComponent(unref(ReuseRowTemplate), {
|
|
3397
|
+
row: centerRows.value[virtualRow.index],
|
|
3398
|
+
style: { height: `${virtualRow.size}px` }
|
|
3399
|
+
}, null, _parent, _scopeId));
|
|
3400
|
+
else _push(`<!---->`);
|
|
3401
|
+
_push(`<!--]-->`);
|
|
3402
|
+
});
|
|
3403
|
+
_push(`<!--]-->`);
|
|
3404
|
+
if (virtualPaddingBottom.value > 0) _push(`<tr style="${ssrRenderStyle({ height: `${virtualPaddingBottom.value}px` })}" aria-hidden="true"${_scopeId}><td${ssrRenderAttr("colspan", unref(tableApi).getAllLeafColumns().length)}${_scopeId}></td></tr>`);
|
|
3405
|
+
else _push(`<!---->`);
|
|
3406
|
+
_push(`<!--]-->`);
|
|
3407
|
+
} else {
|
|
3408
|
+
_push(`<!--[-->`);
|
|
3409
|
+
ssrRenderList(centerRows.value, (row) => {
|
|
3410
|
+
_push(ssrRenderComponent(unref(ReuseRowTemplate), {
|
|
3411
|
+
key: row.id,
|
|
3412
|
+
row
|
|
3413
|
+
}, null, _parent, _scopeId));
|
|
3414
|
+
});
|
|
3415
|
+
_push(`<!--]-->`);
|
|
3416
|
+
}
|
|
3417
|
+
_push(`<!--[-->`);
|
|
3418
|
+
ssrRenderList(bottomRows.value, (row) => {
|
|
3419
|
+
_push(ssrRenderComponent(unref(ReuseRowTemplate), {
|
|
3420
|
+
key: row.id,
|
|
3421
|
+
row
|
|
3422
|
+
}, null, _parent, _scopeId));
|
|
3423
|
+
});
|
|
3424
|
+
_push(`<!--]--><!--]-->`);
|
|
3425
|
+
} else if (unref(props).loading && !!slots["loading"]) {
|
|
3426
|
+
_push(`<tr${_scopeId}><td${ssrRenderAttr("colspan", unref(tableApi).getAllLeafColumns().length)} data-slot="loading" class="${ssrRenderClass(ui.value.loading({ class: unref(props).ui?.loading }))}"${_scopeId}>`);
|
|
3427
|
+
ssrRenderSlot(_ctx.$slots, "loading", {}, null, _push, _parent, _scopeId);
|
|
3428
|
+
_push(`</td></tr>`);
|
|
3429
|
+
} else {
|
|
3430
|
+
_push(`<tr${_scopeId}><td${ssrRenderAttr("colspan", unref(tableApi).getAllLeafColumns().length)} data-slot="empty" class="${ssrRenderClass(ui.value.empty({ class: unref(props).ui?.empty }))}"${_scopeId}>`);
|
|
3431
|
+
ssrRenderSlot(_ctx.$slots, "empty", {}, () => {
|
|
3432
|
+
_push(`${ssrInterpolate(unref(props).empty || unref(t)("table.noData"))}`);
|
|
3433
|
+
}, _push, _parent, _scopeId);
|
|
3434
|
+
_push(`</td></tr>`);
|
|
3435
|
+
}
|
|
3436
|
+
ssrRenderSlot(_ctx.$slots, "body-bottom", {}, null, _push, _parent, _scopeId);
|
|
3437
|
+
_push(`</tbody>`);
|
|
3438
|
+
if (hasFooter.value) {
|
|
3439
|
+
_push(`<tfoot data-slot="tfoot" class="${ssrRenderClass(ui.value.tfoot({ class: [unref(props).ui?.tfoot] }))}"${_scopeId}><tr data-slot="separator" class="${ssrRenderClass(ui.value.separator({ class: [unref(props).ui?.separator] }))}"${_scopeId}></tr><!--[-->`);
|
|
3440
|
+
ssrRenderList(unref(tableApi).getFooterGroups(), (footerGroup) => {
|
|
3441
|
+
_push(`<tr data-slot="tr" class="${ssrRenderClass(ui.value.tr({ class: [unref(props).ui?.tr] }))}"${_scopeId}><!--[-->`);
|
|
3442
|
+
ssrRenderList(footerGroup.headers, (header) => {
|
|
3443
|
+
_push(`<th${ssrRenderAttr("data-pinned", header.column.getIsPinned())}${ssrRenderAttr("colspan", header.colSpan > 1 ? header.colSpan : void 0)}${ssrRenderAttr("rowspan", header.rowSpan > 1 ? header.rowSpan : void 0)} data-slot="th" class="${ssrRenderClass(ui.value.th({
|
|
3444
|
+
class: [unref(props).ui?.th, resolveValue(header.column.columnDef.meta?.class?.th, header)],
|
|
3445
|
+
pinned: !!header.column.getIsPinned()
|
|
3446
|
+
}))}" style="${ssrRenderStyle([getColumnStyles(header.column), resolveValue(header.column.columnDef.meta?.style?.th, header)])}"${_scopeId}>`);
|
|
3447
|
+
ssrRenderSlot(_ctx.$slots, `${header.id}-footer`, mergeProps({ ref_for: true }, header.getContext()), () => {
|
|
3448
|
+
if (!header.isPlaceholder) _push(ssrRenderComponent(unref(FlexRender), {
|
|
3449
|
+
render: header.column.columnDef.footer,
|
|
3450
|
+
props: header.getContext()
|
|
3451
|
+
}, null, _parent, _scopeId));
|
|
3452
|
+
else _push(`<!---->`);
|
|
3453
|
+
}, _push, _parent, _scopeId);
|
|
3454
|
+
_push(`</th>`);
|
|
3455
|
+
});
|
|
3456
|
+
_push(`<!--]--></tr>`);
|
|
3457
|
+
});
|
|
3458
|
+
_push(`<!--]--></tfoot>`);
|
|
3459
|
+
} else _push(`<!---->`);
|
|
3460
|
+
_push(`</table>`);
|
|
3461
|
+
} else return [createVNode("table", {
|
|
3462
|
+
ref_key: "tableRef",
|
|
3463
|
+
ref: tableRef,
|
|
3464
|
+
"data-slot": "base",
|
|
3465
|
+
class: ui.value.base({ class: [unref(props).ui?.base] })
|
|
3466
|
+
}, [
|
|
3467
|
+
unref(props).caption || !!slots.caption ? (openBlock(), createBlock("caption", {
|
|
3468
|
+
key: 0,
|
|
3469
|
+
"data-slot": "caption",
|
|
3470
|
+
class: ui.value.caption({ class: [unref(props).ui?.caption] })
|
|
3471
|
+
}, [renderSlot(_ctx.$slots, "caption", {}, () => [createTextVNode(toDisplayString(unref(props).caption), 1)])], 2)) : createCommentVNode("", true),
|
|
3472
|
+
createVNode("thead", {
|
|
3473
|
+
"data-slot": "thead",
|
|
3474
|
+
class: ui.value.thead({ class: [unref(props).ui?.thead] })
|
|
3475
|
+
}, [(openBlock(true), createBlock(Fragment, null, renderList(unref(tableApi).getHeaderGroups(), (headerGroup) => {
|
|
3476
|
+
return openBlock(), createBlock("tr", {
|
|
3477
|
+
key: headerGroup.id,
|
|
3478
|
+
"data-slot": "tr",
|
|
3479
|
+
class: ui.value.tr({ class: [unref(props).ui?.tr] })
|
|
3480
|
+
}, [(openBlock(true), createBlock(Fragment, null, renderList(headerGroup.headers, (header) => {
|
|
3481
|
+
return openBlock(), createBlock("th", {
|
|
3482
|
+
key: header.id,
|
|
3483
|
+
"data-pinned": header.column.getIsPinned(),
|
|
3484
|
+
scope: header.colSpan > 1 ? "colgroup" : "col",
|
|
3485
|
+
colspan: header.colSpan > 1 ? header.colSpan : void 0,
|
|
3486
|
+
rowspan: header.rowSpan > 1 ? header.rowSpan : void 0,
|
|
3487
|
+
"data-slot": "th",
|
|
3488
|
+
class: ui.value.th({
|
|
3489
|
+
class: [unref(props).ui?.th, resolveValue(header.column.columnDef.meta?.class?.th, header)],
|
|
3490
|
+
pinned: !!header.column.getIsPinned()
|
|
3491
|
+
}),
|
|
3492
|
+
style: [getColumnStyles(header.column), resolveValue(header.column.columnDef.meta?.style?.th, header)]
|
|
3493
|
+
}, [renderSlot(_ctx.$slots, `${header.id}-header`, mergeProps({ ref_for: true }, header.getContext()), () => [!header.isPlaceholder ? (openBlock(), createBlock(unref(FlexRender), {
|
|
3494
|
+
key: 0,
|
|
3495
|
+
render: header.column.columnDef.header,
|
|
3496
|
+
props: header.getContext()
|
|
3497
|
+
}, null, 8, ["render", "props"])) : createCommentVNode("", true)])], 14, [
|
|
3498
|
+
"data-pinned",
|
|
3499
|
+
"scope",
|
|
3500
|
+
"colspan",
|
|
3501
|
+
"rowspan"
|
|
3502
|
+
]);
|
|
3503
|
+
}), 128))], 2);
|
|
3504
|
+
}), 128)), createVNode("tr", {
|
|
3505
|
+
"data-slot": "separator",
|
|
3506
|
+
class: ui.value.separator({ class: [unref(props).ui?.separator] })
|
|
3507
|
+
}, null, 2)], 2),
|
|
3508
|
+
createVNode("tbody", {
|
|
3509
|
+
"data-slot": "tbody",
|
|
3510
|
+
class: ui.value.tbody({ class: [unref(props).ui?.tbody] })
|
|
3511
|
+
}, [
|
|
3512
|
+
renderSlot(_ctx.$slots, "body-top"),
|
|
3513
|
+
rows.value.length ? (openBlock(), createBlock(Fragment, { key: 0 }, [
|
|
3514
|
+
(openBlock(true), createBlock(Fragment, null, renderList(topRows.value, (row) => {
|
|
3515
|
+
return openBlock(), createBlock(unref(ReuseRowTemplate), {
|
|
3516
|
+
key: row.id,
|
|
3517
|
+
row
|
|
3518
|
+
}, null, 8, ["row"]);
|
|
3519
|
+
}), 128)),
|
|
3520
|
+
unref(virtualizer) ? (openBlock(), createBlock(Fragment, { key: 0 }, [
|
|
3521
|
+
virtualPaddingTop.value > 0 ? (openBlock(), createBlock("tr", {
|
|
3522
|
+
key: 0,
|
|
3523
|
+
style: { height: `${virtualPaddingTop.value}px` },
|
|
3524
|
+
"aria-hidden": "true"
|
|
3525
|
+
}, [createVNode("td", { colspan: unref(tableApi).getAllLeafColumns().length }, null, 8, ["colspan"])], 4)) : createCommentVNode("", true),
|
|
3526
|
+
(openBlock(true), createBlock(Fragment, null, renderList(virtualItems.value, (virtualRow) => {
|
|
3527
|
+
return openBlock(), createBlock(Fragment, { key: centerRows.value[virtualRow.index]?.id ?? `virtual-${virtualRow.index}` }, [centerRows.value[virtualRow.index] ? (openBlock(), createBlock(unref(ReuseRowTemplate), {
|
|
3528
|
+
key: 0,
|
|
3529
|
+
row: centerRows.value[virtualRow.index],
|
|
3530
|
+
style: { height: `${virtualRow.size}px` }
|
|
3531
|
+
}, null, 8, ["row", "style"])) : createCommentVNode("", true)], 64);
|
|
3532
|
+
}), 128)),
|
|
3533
|
+
virtualPaddingBottom.value > 0 ? (openBlock(), createBlock("tr", {
|
|
3534
|
+
key: 1,
|
|
3535
|
+
style: { height: `${virtualPaddingBottom.value}px` },
|
|
3536
|
+
"aria-hidden": "true"
|
|
3537
|
+
}, [createVNode("td", { colspan: unref(tableApi).getAllLeafColumns().length }, null, 8, ["colspan"])], 4)) : createCommentVNode("", true)
|
|
3538
|
+
], 64)) : (openBlock(true), createBlock(Fragment, { key: 1 }, renderList(centerRows.value, (row) => {
|
|
3539
|
+
return openBlock(), createBlock(unref(ReuseRowTemplate), {
|
|
3540
|
+
key: row.id,
|
|
3541
|
+
row
|
|
3542
|
+
}, null, 8, ["row"]);
|
|
3543
|
+
}), 128)),
|
|
3544
|
+
(openBlock(true), createBlock(Fragment, null, renderList(bottomRows.value, (row) => {
|
|
3545
|
+
return openBlock(), createBlock(unref(ReuseRowTemplate), {
|
|
3546
|
+
key: row.id,
|
|
3547
|
+
row
|
|
3548
|
+
}, null, 8, ["row"]);
|
|
3549
|
+
}), 128))
|
|
3550
|
+
], 64)) : unref(props).loading && !!slots["loading"] ? (openBlock(), createBlock("tr", { key: 1 }, [createVNode("td", {
|
|
3551
|
+
colspan: unref(tableApi).getAllLeafColumns().length,
|
|
3552
|
+
"data-slot": "loading",
|
|
3553
|
+
class: ui.value.loading({ class: unref(props).ui?.loading })
|
|
3554
|
+
}, [renderSlot(_ctx.$slots, "loading")], 10, ["colspan"])])) : (openBlock(), createBlock("tr", { key: 2 }, [createVNode("td", {
|
|
3555
|
+
colspan: unref(tableApi).getAllLeafColumns().length,
|
|
3556
|
+
"data-slot": "empty",
|
|
3557
|
+
class: ui.value.empty({ class: unref(props).ui?.empty })
|
|
3558
|
+
}, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref(props).empty || unref(t)("table.noData")), 1)])], 10, ["colspan"])])),
|
|
3559
|
+
renderSlot(_ctx.$slots, "body-bottom")
|
|
3560
|
+
], 2),
|
|
3561
|
+
hasFooter.value ? (openBlock(), createBlock("tfoot", {
|
|
3562
|
+
key: 1,
|
|
3563
|
+
"data-slot": "tfoot",
|
|
3564
|
+
class: ui.value.tfoot({ class: [unref(props).ui?.tfoot] })
|
|
3565
|
+
}, [createVNode("tr", {
|
|
3566
|
+
"data-slot": "separator",
|
|
3567
|
+
class: ui.value.separator({ class: [unref(props).ui?.separator] })
|
|
3568
|
+
}, null, 2), (openBlock(true), createBlock(Fragment, null, renderList(unref(tableApi).getFooterGroups(), (footerGroup) => {
|
|
3569
|
+
return openBlock(), createBlock("tr", {
|
|
3570
|
+
key: footerGroup.id,
|
|
3571
|
+
"data-slot": "tr",
|
|
3572
|
+
class: ui.value.tr({ class: [unref(props).ui?.tr] })
|
|
3573
|
+
}, [(openBlock(true), createBlock(Fragment, null, renderList(footerGroup.headers, (header) => {
|
|
3574
|
+
return openBlock(), createBlock("th", {
|
|
3575
|
+
key: header.id,
|
|
3576
|
+
"data-pinned": header.column.getIsPinned(),
|
|
3577
|
+
colspan: header.colSpan > 1 ? header.colSpan : void 0,
|
|
3578
|
+
rowspan: header.rowSpan > 1 ? header.rowSpan : void 0,
|
|
3579
|
+
"data-slot": "th",
|
|
3580
|
+
class: ui.value.th({
|
|
3581
|
+
class: [unref(props).ui?.th, resolveValue(header.column.columnDef.meta?.class?.th, header)],
|
|
3582
|
+
pinned: !!header.column.getIsPinned()
|
|
3583
|
+
}),
|
|
3584
|
+
style: [getColumnStyles(header.column), resolveValue(header.column.columnDef.meta?.style?.th, header)]
|
|
3585
|
+
}, [renderSlot(_ctx.$slots, `${header.id}-footer`, mergeProps({ ref_for: true }, header.getContext()), () => [!header.isPlaceholder ? (openBlock(), createBlock(unref(FlexRender), {
|
|
3586
|
+
key: 0,
|
|
3587
|
+
render: header.column.columnDef.footer,
|
|
3588
|
+
props: header.getContext()
|
|
3589
|
+
}, null, 8, ["render", "props"])) : createCommentVNode("", true)])], 14, [
|
|
3590
|
+
"data-pinned",
|
|
3591
|
+
"colspan",
|
|
3592
|
+
"rowspan"
|
|
3593
|
+
]);
|
|
3594
|
+
}), 128))], 2);
|
|
3595
|
+
}), 128))], 2)) : createCommentVNode("", true)
|
|
3596
|
+
], 2)];
|
|
3597
|
+
}),
|
|
3598
|
+
_: 3
|
|
3599
|
+
}, _parent));
|
|
3600
|
+
_push(ssrRenderComponent(unref(Primitive), mergeProps({
|
|
3601
|
+
ref_key: "rootRef",
|
|
3602
|
+
ref: rootRef,
|
|
3603
|
+
as: unref(props).as,
|
|
3604
|
+
"data-slot": "root"
|
|
3605
|
+
}, _ctx.$attrs, { class: ui.value.root({ class: [unref(props).ui?.root, unref(props).class] }) }), {
|
|
3606
|
+
default: withCtx((_, _push, _parent, _scopeId) => {
|
|
3607
|
+
if (_push) _push(ssrRenderComponent(unref(ReuseTableTemplate), null, null, _parent, _scopeId));
|
|
3608
|
+
else return [createVNode(unref(ReuseTableTemplate))];
|
|
3609
|
+
}),
|
|
3610
|
+
_: 1
|
|
3611
|
+
}, _parent));
|
|
3612
|
+
_push(`<!--]-->`);
|
|
3613
|
+
};
|
|
3614
|
+
}
|
|
3615
|
+
});
|
|
3616
|
+
var _sfc_setup$1 = _sfc_main.setup;
|
|
3617
|
+
_sfc_main.setup = (props, ctx) => {
|
|
3618
|
+
const ssrContext = useSSRContext();
|
|
3619
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/.pnpm/@nuxt+ui@4.10.0_e299f0a9b209424c2a6c150f5a1a8167/node_modules/@nuxt/ui/dist/runtime/components/Table.vue");
|
|
3620
|
+
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
3621
|
+
};
|
|
3622
|
+
//#endregion
|
|
3623
|
+
//#region app/pages/tasks/details.vue?vue&type=script&setup=true&lang.ts
|
|
3624
|
+
var pageSize = 50;
|
|
3625
|
+
var details_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
3626
|
+
__name: "details",
|
|
3627
|
+
__ssrInlineRender: true,
|
|
3628
|
+
async setup(__props) {
|
|
3629
|
+
let __temp, __restore;
|
|
3630
|
+
const workspace = useFileWorkspace();
|
|
3631
|
+
const page = ref(1);
|
|
3632
|
+
const columns = [
|
|
3633
|
+
{
|
|
3634
|
+
accessorKey: "z",
|
|
3635
|
+
header: "Z"
|
|
3636
|
+
},
|
|
3637
|
+
{
|
|
3638
|
+
accessorKey: "x",
|
|
3639
|
+
header: "X"
|
|
3640
|
+
},
|
|
3641
|
+
{
|
|
3642
|
+
accessorKey: "y",
|
|
3643
|
+
header: "Y"
|
|
3644
|
+
},
|
|
3645
|
+
{
|
|
3646
|
+
accessorKey: "bytes",
|
|
3647
|
+
header: "PNG 大小"
|
|
3648
|
+
}
|
|
3649
|
+
];
|
|
3650
|
+
const url = computed(() => workspace.selected.value ? `/api/workspace/${encodeURIComponent(workspace.selected.value.filename)}/tiles` : "");
|
|
3651
|
+
const { data, pending, refresh } = ([__temp, __restore] = withAsyncContext(() => useFetch(() => url.value || "/api/workspace/files", {
|
|
3652
|
+
query: computed(() => url.value ? {
|
|
3653
|
+
page: page.value,
|
|
3654
|
+
pageSize
|
|
3655
|
+
} : {}),
|
|
3656
|
+
watch: [page],
|
|
3657
|
+
default: () => ({
|
|
3658
|
+
items: [],
|
|
3659
|
+
total: 0
|
|
3660
|
+
})
|
|
3661
|
+
}, "$gTTlf7Gqcc")), __temp = await __temp, __restore(), __temp);
|
|
3662
|
+
watch(() => workspace.selected.value?.summary, () => refresh());
|
|
3663
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
3664
|
+
const _component_UIcon = _sfc_main$5;
|
|
3665
|
+
const _component_UTable = _sfc_main;
|
|
3666
|
+
const _component_UPagination = _sfc_main$1;
|
|
3667
|
+
const _component_UEmpty = _sfc_main$2;
|
|
3668
|
+
if (!unref(workspace).ready.value) {
|
|
3669
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "grid h-full min-h-[360px] place-items-center" }, _attrs))}><div class="flex flex-col items-center gap-3 text-sm text-muted">`);
|
|
3670
|
+
_push(ssrRenderComponent(_component_UIcon, {
|
|
3671
|
+
name: "i-lucide-loader-circle",
|
|
3672
|
+
class: "size-5 animate-spin text-primary"
|
|
3673
|
+
}, null, _parent));
|
|
3674
|
+
_push(`<span>加载任务明细</span></div></div>`);
|
|
3675
|
+
} else if (unref(workspace).selected.value?.kind === "uomtiles") {
|
|
3676
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "flex h-full min-h-0 flex-col overflow-hidden" }, _attrs))}><div class="flex items-center justify-between border-b border-default px-5 py-4"><h1 class="text-base font-semibold">瓦片明细</h1><span class="uom-mono text-xs text-muted">${ssrInterpolate(unref(data).total)} tiles</span></div>`);
|
|
3677
|
+
_push(ssrRenderComponent(_component_UTable, {
|
|
3678
|
+
data: unref(data).items,
|
|
3679
|
+
columns,
|
|
3680
|
+
loading: unref(pending),
|
|
3681
|
+
sticky: "",
|
|
3682
|
+
class: "min-h-0 flex-1"
|
|
3683
|
+
}, null, _parent));
|
|
3684
|
+
_push(`<div class="flex justify-end border-t border-default px-5 py-3">`);
|
|
3685
|
+
_push(ssrRenderComponent(_component_UPagination, {
|
|
3686
|
+
page: unref(page),
|
|
3687
|
+
"onUpdate:page": ($event) => isRef(page) ? page.value = $event : null,
|
|
3688
|
+
"items-per-page": pageSize,
|
|
3689
|
+
total: unref(data).total
|
|
3690
|
+
}, null, _parent));
|
|
3691
|
+
_push(`</div></div>`);
|
|
3692
|
+
} else {
|
|
3693
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "grid h-full place-items-center" }, _attrs))}>`);
|
|
3694
|
+
_push(ssrRenderComponent(_component_UEmpty, {
|
|
3695
|
+
icon: "i-lucide-list",
|
|
3696
|
+
title: "没有可显示的任务明细"
|
|
3697
|
+
}, null, _parent));
|
|
3698
|
+
_push(`</div>`);
|
|
3699
|
+
}
|
|
3700
|
+
};
|
|
3701
|
+
}
|
|
3702
|
+
});
|
|
3703
|
+
//#endregion
|
|
3704
|
+
//#region app/pages/tasks/details.vue
|
|
3705
|
+
var _sfc_setup = details_vue_vue_type_script_setup_true_lang_default.setup;
|
|
3706
|
+
details_vue_vue_type_script_setup_true_lang_default.setup = (props, ctx) => {
|
|
3707
|
+
const ssrContext = useSSRContext();
|
|
3708
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/tasks/details.vue");
|
|
3709
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
3710
|
+
};
|
|
3711
|
+
var details_default = details_vue_vue_type_script_setup_true_lang_default;
|
|
3712
|
+
|
|
3713
|
+
export { details_default as default };
|
|
3714
|
+
//# sourceMappingURL=details-CBMqXYyo.mjs.map
|