@aussieljk/forkbook 0.0.1-4 → 0.0.1-6
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/LICENSE +22 -0
- package/README.md +35 -53
- package/dist/_browser-chunks/{Color-KRDPNBZS.js → Color-2BMQTRYG.js} +3 -3
- package/dist/_browser-chunks/WithTooltip-GJACFWKM.js +196 -0
- package/dist/_browser-chunks/chunk-6AKCRYVX.js +6 -0
- package/dist/_browser-chunks/chunk-6EJEEII7.js +1149 -0
- package/dist/_browser-chunks/{chunk-LXQPPHMD.js → chunk-6IKB2UHQ.js} +27 -27
- package/dist/_browser-chunks/chunk-DPRGR3QP.js +5995 -0
- package/dist/_browser-chunks/{chunk-K6GRZSXS.js → chunk-EQKMUQF3.js} +4 -3
- package/dist/_browser-chunks/{chunk-GU3X2J4S.js → chunk-FRAOQJDI.js} +3 -1
- package/dist/_browser-chunks/{chunk-2SCZVUKW.js → chunk-H4ZHAXN3.js} +1 -1
- package/dist/_browser-chunks/{chunk-ZLWA5RIE.js → chunk-I4ATZPNZ.js} +1 -1
- package/dist/_browser-chunks/{chunk-6SHRDXGF.js → chunk-IJYLSHY7.js} +173 -87
- package/dist/_browser-chunks/{chunk-SZCSXISG.js → chunk-NA4ITZTK.js} +7 -5
- package/dist/_browser-chunks/chunk-NGMQJMCY.js +53 -0
- package/dist/_browser-chunks/{chunk-K2B36HKM.js → chunk-O24AZJZ7.js} +1 -1
- package/dist/_browser-chunks/{chunk-BZGX2THJ.js → chunk-QAHDGPZ7.js} +3 -3
- package/dist/_browser-chunks/{chunk-NMRSYACM.js → chunk-SFMQDIN2.js} +4 -3
- package/dist/_browser-chunks/{chunk-ZTQ5MEJ5.js → chunk-UMGDO2ZM.js} +3 -37
- package/dist/_browser-chunks/{chunk-FVSEPWWX.js → chunk-X7D777E6.js} +547 -1622
- package/dist/_browser-chunks/{chunk-52CW7FF7.js → chunk-YYWKZ7O3.js} +3 -1
- package/dist/_node-chunks/{attached-runtime-CYMSKF3A.js → attached-runtime-EBWIOQZN.js} +29 -29
- package/dist/_node-chunks/{builder-manager-RMLSIO45.js → builder-manager-ETBLZ2RH.js} +288 -349
- package/dist/_node-chunks/{chunk-IR34HUSL.js → chunk-252Y5WHZ.js} +7 -7
- package/dist/_node-chunks/{chunk-VPOJCHKM.js → chunk-25PXULSJ.js} +14 -14
- package/dist/_node-chunks/chunk-2DBJWMYE.js +495 -0
- package/dist/_node-chunks/{chunk-KXDJ77EW.js → chunk-3UWWRDA5.js} +7 -7
- package/dist/_node-chunks/{chunk-DVLFCSDG.js → chunk-4KCQYJT6.js} +7 -7
- package/dist/_node-chunks/{chunk-X3E55W5S.js → chunk-4MJIPOJ5.js} +6 -6
- package/dist/_node-chunks/{chunk-5TPSYG4L.js → chunk-4WLIN3VZ.js} +8 -8
- package/dist/_node-chunks/{chunk-WBTLBIED.js → chunk-4XNPO23I.js} +6 -6
- package/dist/_node-chunks/{chunk-NHIRHARE.js → chunk-5T635FTI.js} +10 -10
- package/dist/_node-chunks/{chunk-YU2WFBFL.js → chunk-5Z6MT4RI.js} +8 -8
- package/dist/_node-chunks/{chunk-2QWFS23O.js → chunk-644CUCK5.js} +7 -7
- package/dist/_node-chunks/{chunk-7XCJ7RAJ.js → chunk-7E27CGRU.js} +7 -7
- package/dist/_node-chunks/{chunk-WS367FSJ.js → chunk-A35J7YYA.js} +6 -6
- package/dist/_node-chunks/{chunk-ILFIERUB.js → chunk-ALHPFKVB.js} +8 -8
- package/dist/_node-chunks/{chunk-SQMCVWOR.js → chunk-ANDQVXYX.js} +8 -8
- package/dist/_node-chunks/{chunk-HUFAUSEX.js → chunk-AS4SFRCZ.js} +6 -6
- package/dist/_node-chunks/{chunk-XBXGLD3K.js → chunk-BLUMKQQB.js} +6 -6
- package/dist/_node-chunks/{chunk-QU5ANYM7.js → chunk-C5JG7EKF.js} +6 -6
- package/dist/_node-chunks/{chunk-P6QAFJ5M.js → chunk-CBUQY454.js} +7 -15
- package/dist/_node-chunks/{chunk-4LPAWP5S.js → chunk-CF7KLGUW.js} +22 -20
- package/dist/_node-chunks/{chunk-MOITZTEA.js → chunk-CGVPHZVD.js} +8 -8
- package/dist/_node-chunks/{chunk-2NWHHNNI.js → chunk-DABFUVLR.js} +6 -6
- package/dist/_node-chunks/{chunk-XH6TDVML.js → chunk-DCNZ6SFN.js} +6 -6
- package/dist/_node-chunks/{chunk-F2N6BJRH.js → chunk-DDGW2EBW.js} +29843 -51588
- package/dist/_node-chunks/{chunk-OS5LQEC6.js → chunk-DRLBJM6X.js} +7 -7
- package/dist/_node-chunks/{chunk-GEMKJCEE.js → chunk-E3O7VAPG.js} +10 -10
- package/dist/_node-chunks/{chunk-4GD7MMLJ.js → chunk-FIFCNBTL.js} +7 -7
- package/dist/_node-chunks/{chunk-UMZSNFWM.js → chunk-FQWTUSYB.js} +6 -6
- package/dist/_node-chunks/{chunk-JEEXR245.js → chunk-G6YNW4FK.js} +7 -7
- package/dist/_node-chunks/{chunk-HP5UY6OY.js → chunk-GDFQQO5U.js} +6 -6
- package/dist/_node-chunks/{chunk-653BSJIX.js → chunk-GGTXOH3W.js} +6 -6
- package/dist/_node-chunks/{chunk-PDCSUZ4L.js → chunk-GIOREKIG.js} +7 -7
- package/dist/_node-chunks/{chunk-V2JDVM46.js → chunk-GOFK4EKU.js} +6 -6
- package/dist/_node-chunks/{chunk-INEYTOWF.js → chunk-GQ3HJNIH.js} +10 -13
- package/dist/_node-chunks/{chunk-2APY2YSW.js → chunk-GRTI5653.js} +7 -7
- package/dist/_node-chunks/{chunk-KN2S7JF2.js → chunk-HKL3VOYX.js} +6 -6
- package/dist/_node-chunks/{chunk-A2UMIN5B.js → chunk-HUPRQZ3I.js} +7 -7
- package/dist/_node-chunks/{chunk-7JA2DMCJ.js → chunk-HWRHYM7Z.js} +6 -6
- package/dist/_node-chunks/{chunk-SBQT3LMM.js → chunk-I7HRDCNY.js} +10 -10
- package/dist/_node-chunks/{chunk-2IJCISIB.js → chunk-IFPMZ247.js} +6 -6
- package/dist/_node-chunks/{chunk-DIUBMAMV.js → chunk-J6M5CRYZ.js} +8 -8
- package/dist/_node-chunks/{chunk-IBO346NQ.js → chunk-JPXJI6QR.js} +60 -134
- package/dist/_node-chunks/{chunk-STRSG3GT.js → chunk-JS2J2SKX.js} +6 -6
- package/dist/_node-chunks/{chunk-FNGLVURC.js → chunk-JZWF3XLN.js} +6 -6
- package/dist/_node-chunks/{chunk-KINEBDMM.js → chunk-KF3FT3NI.js} +9 -9
- package/dist/_node-chunks/chunk-KWPWQA7G.js +2609 -0
- package/dist/_node-chunks/{chunk-OIIORQX5.js → chunk-L4JGWK4K.js} +6 -6
- package/dist/_node-chunks/{chunk-MRZD5SBV.js → chunk-LFIFBDMS.js} +6 -6
- package/dist/_node-chunks/{chunk-UAALLQAQ.js → chunk-LWKLJYYQ.js} +6 -6
- package/dist/_node-chunks/{chunk-AFKKN27O.js → chunk-LXVSVTQ3.js} +6 -6
- package/dist/_node-chunks/chunk-MDW3GSU3.js +69 -0
- package/dist/_node-chunks/{chunk-UXW4I2CN.js → chunk-MFN2XBPL.js} +7 -7
- package/dist/_node-chunks/{chunk-ESZVID7Q.js → chunk-MQFB44YS.js} +7 -7
- package/dist/_node-chunks/{chunk-3XDIBUGD.js → chunk-MZ2GSR3G.js} +23 -51
- package/dist/_node-chunks/{chunk-POXTROIX.js → chunk-N7HEOGTM.js} +9 -6
- package/dist/_node-chunks/{chunk-UIFLXDUL.js → chunk-NUAQC3XP.js} +16 -13
- package/dist/_node-chunks/{chunk-BOUA7OB7.js → chunk-NX6CSWF3.js} +8 -8
- package/dist/_node-chunks/{chunk-B3LK7C7B.js → chunk-NZ7EQWYA.js} +9 -9
- package/dist/_node-chunks/{chunk-U5QMVW3H.js → chunk-OLGIDCVD.js} +650 -9
- package/dist/_node-chunks/{chunk-NAYTBC72.js → chunk-P65JVLO3.js} +8 -8
- package/dist/_node-chunks/{chunk-M2UZP5GC.js → chunk-PAN35AYX.js} +7 -7
- package/dist/_node-chunks/{chunk-GZBUCUF7.js → chunk-PLWLCVP2.js} +6 -6
- package/dist/_node-chunks/{chunk-A4YELYR3.js → chunk-Q4BEWGMK.js} +6 -6
- package/dist/_node-chunks/{chunk-YYIZ2PC4.js → chunk-QNUXGVZZ.js} +6 -6
- package/dist/_node-chunks/{chunk-WHZWLJGO.js → chunk-R5DWO2S2.js} +31 -30
- package/dist/_node-chunks/{chunk-RMLENEZC.js → chunk-SLZV7PTQ.js} +8 -8
- package/dist/_node-chunks/{chunk-B5VFV3ZW.js → chunk-TIRP5JQM.js} +11 -10
- package/dist/_node-chunks/{chunk-TLVEPWBN.js → chunk-TMXWDY2O.js} +6 -6
- package/dist/_node-chunks/{chunk-LGUMVMBA.js → chunk-TN3ULFFZ.js} +6 -6
- package/dist/_node-chunks/{chunk-5ZLOPVTG.js → chunk-TPSJW4CQ.js} +6 -6
- package/dist/_node-chunks/{chunk-RNF3Z4ZJ.js → chunk-TYBPAV3X.js} +6 -6
- package/dist/_node-chunks/chunk-UUE3PSJB.js +11 -0
- package/dist/_node-chunks/chunk-VKNRNBTB.js +18 -0
- package/dist/_node-chunks/{chunk-6Y6RBJD7.js → chunk-VPU4E7DI.js} +25 -8
- package/dist/_node-chunks/{chunk-FJDJE7XC.js → chunk-WIQ6Y3NX.js} +6 -6
- package/dist/_node-chunks/{chunk-DD2S4BFV.js → chunk-WRG3CFGS.js} +6 -6
- package/dist/_node-chunks/{chunk-FAZ3MUOI.js → chunk-X3RTVNRN.js} +7 -7
- package/dist/_node-chunks/chunk-XOGU5PWI.js +347 -0
- package/dist/_node-chunks/{chunk-AU3SF2WM.js → chunk-XWGMQW2H.js} +6 -6
- package/dist/_node-chunks/chunk-YCXTTQ7K.js +620 -0
- package/dist/_node-chunks/{chunk-KZBZYQTZ.js → chunk-YHH57LHY.js} +9 -9
- package/dist/_node-chunks/{chunk-J3M3X7GO.js → chunk-YMZ2SGFK.js} +6 -6
- package/dist/_node-chunks/{chunk-AY6B2C46.js → chunk-YNENOZRY.js} +7 -7
- package/dist/_node-chunks/{chunk-CGWACHNW.js → chunk-YPGVYNJB.js} +6 -6
- package/dist/_node-chunks/{chunk-OQ4NCWE4.js → chunk-YQDBSAXW.js} +7 -7
- package/dist/_node-chunks/{chunk-YGXJOSRU.js → chunk-Z4NZLBOX.js} +7 -7
- package/dist/_node-chunks/{chunk-74IEHSIR.js → chunk-ZC3ZZKMS.js} +8 -8
- package/dist/_node-chunks/{chunk-QDLR4JF5.js → chunk-ZCITDAV4.js} +34 -949
- package/dist/_node-chunks/chunk-ZNSGFYAT.js +25 -0
- package/dist/_node-chunks/{chunk-XD5SYXAU.js → chunk-ZSH6BUCW.js} +25 -25
- package/dist/_node-chunks/{chunk-X2KWNNFB.js → chunk-ZTFNOXZF.js} +6 -6
- package/dist/_node-chunks/dist-GGTGKXZA.js +27 -0
- package/dist/_node-chunks/dist-NS676VJR.js +16 -0
- package/dist/_node-chunks/{local-runtime-KTI3DH6X.js → local-runtime-BUTEKJYV.js} +20 -20
- package/dist/_node-chunks/{mdx-plugin-2E3SW5TL.js → mdx-plugin-7WXQIHPV.js} +2263 -130
- package/dist/_node-chunks/{monorepo-MWAMFHKY.js → monorepo-NCD3X2BR.js} +11 -11
- package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-MGORG6W7.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-SD3B272K.js} +11 -11
- package/dist/_node-chunks/optimized-tests-ITVOHEOA.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-QTQOY7E7.js → pattern-copy-play-3QJANDJD.js} +9 -9
- package/dist/_node-chunks/postinstallAddon-LEUHOKX6.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-T7DZNKMB.js → rehype-external-links-4LR5BDR2.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-CSHI5WYI.js → rehype-slug-PWFRGOEV.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-RAZD36YR.js → relaxed-limits-VNNWUW7X.js} +11 -11
- package/dist/_node-chunks/{run-S6XSLPEB.js → run-RUAAWEQT.js} +13 -13
- package/dist/_node-chunks/{run-KJ3Z2TTY.js → run-YK6ARCWS.js} +17 -17
- package/dist/_node-chunks/session-id-JJYVZAKO.js +23 -0
- package/dist/_node-chunks/{setup-35J66GFB.js → setup-4QKCICV6.js} +8 -8
- package/dist/_node-chunks/{vitest.config.4.template-Z7OCRDKD.js → vitest.config.4.template-WVFLIXN7.js} +7 -7
- package/dist/actions/decorator.js +2 -1
- package/dist/actions/index.js +2 -1
- package/dist/addon-a11y/index.js +2 -1
- package/dist/addon-a11y/manager.js +24 -17
- package/dist/addon-a11y/preset.js +7 -7
- package/dist/addon-a11y/preview.js +2 -1
- package/dist/addon-docs/blocks.js +46 -25
- package/dist/addon-docs/manager.js +2 -2
- package/dist/addon-docs/preset.js +10 -10
- package/dist/addon-links/index.js +3 -2
- package/dist/addon-links/preview.d.ts +1 -1
- package/dist/addon-links/preview.js +3 -2
- package/dist/addon-links/react/index.js +2 -1
- package/dist/addon-mcp/preset.js +8 -8
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +17 -45
- package/dist/addon-ondevice-actions/index.js +5 -1
- package/dist/addon-ondevice-actions/register.js +5 -1
- package/dist/addon-pseudo-states/manager.js +2 -2
- package/dist/addon-pseudo-states/preview.d.ts +1 -1
- package/dist/addon-themes/manager.js +1 -1
- package/dist/addon-themes/postinstall.js +7 -7
- package/dist/addon-vitest/constants.js +8 -8
- package/dist/addon-vitest/manager.js +8 -8
- package/dist/addon-vitest/node/coverage-reporter.js +8 -8
- package/dist/addon-vitest/node/vitest.js +16 -16
- package/dist/addon-vitest/postinstall.js +10 -10
- package/dist/addon-vitest/preset.js +15 -16
- package/dist/addon-vitest/vitest-plugin/global-setup.js +7 -7
- package/dist/addon-vitest/vitest-plugin/index.js +17 -17
- package/dist/babel/index.d.ts +91 -842
- package/dist/babel/index.js +13 -19
- package/dist/bin/core.js +61 -60
- package/dist/bin/dispatcher.js +10 -10
- package/dist/bin/loader.js +16 -15
- package/dist/builder-vite/index.js +15 -15
- package/dist/builder-vite/preset.js +13 -13
- package/dist/{chunk-DF6btpT3.d.ts → chunk-BGhyFTJO.d.ts} +2 -2
- package/dist/chunk-CV4-Z2pn.d.ts +30 -0
- package/dist/{chunk-DvufcbCc.d.ts → chunk-CVY28Ngy.d.ts} +1 -1
- package/dist/{chunk-B2t1tGRh.d.ts → chunk-CYuvV2sR.d.ts} +11 -13
- package/dist/{chunk-BYnH2sbb.d.ts → chunk-ClI-HEh5.d.ts} +1 -1
- package/dist/{chunk-DIz17UEJ.d.ts → chunk-CzmZhVrn.d.ts} +35 -1
- package/dist/{chunk-B2xylxt5.d.ts → chunk-DROZ9oel.d.ts} +7 -271
- package/dist/cli/index.d.ts +13 -866
- package/dist/cli/index.js +42 -4952
- package/dist/cli/tools/sdk/child-host.d.ts +1 -1
- package/dist/cli/tools/sdk/child-host.js +17 -17
- package/dist/cli/tools/sdk/index.d.ts +1 -1
- package/dist/cli/tools/sdk/index.js +18 -18
- package/dist/cli-commands/bin/index.js +7 -7
- package/dist/client-logger/index.js +3 -1
- package/dist/common/index.d.ts +5 -4
- package/dist/common/index.js +35 -37
- package/dist/components/index.d.ts +14 -231
- package/dist/components/index.js +2518 -8365
- package/dist/core-events/index.d.ts +4 -3
- package/dist/core-events/index.js +3 -1
- package/dist/core-server/index.d.ts +2 -2
- package/dist/core-server/index.js +450 -147
- package/dist/core-server/presets/common-manager.js +96 -894
- package/dist/core-server/presets/common-override-preset.js +12 -10
- package/dist/core-server/presets/common-preset.js +39 -40
- package/dist/create/bin/index.js +7 -7
- package/dist/create/index.js +15 -15
- package/dist/csf/index.d.ts +2 -2
- package/dist/csf/index.js +27 -93
- package/dist/csf-tools/index.d.ts +2 -12
- package/dist/csf-tools/index.js +14 -14
- package/dist/instrumenter/index.js +3 -1
- package/dist/manager/_manager-chunks/{globals-runtime-dKGpUUSb.js → globals-runtime-B-IeQLQu.js} +285 -61
- package/dist/manager/_manager-chunks/{globals-runtime-DuLFjsF4.js → globals-runtime-B5-0Ccbv.js} +1 -1
- package/dist/manager/_manager-chunks/{globals-runtime-8HkdnU2F.js → globals-runtime-B71TiXST.js} +93 -2146
- package/dist/manager/_manager-chunks/globals-runtime-BMCaBukU.js +413 -0
- package/dist/manager/_manager-chunks/globals-runtime-BUP5e_t9.js +1396 -0
- package/dist/manager/_manager-chunks/globals-runtime-C7mqoHpE.js +2093 -0
- package/dist/manager/_manager-chunks/globals-runtime-CBviMKtt.js +446 -0
- package/dist/manager/_manager-chunks/{globals-runtime-eLPTIfX-.js → globals-runtime-CYNosEiD.js} +1 -2
- package/dist/manager/_manager-chunks/globals-runtime-C_evJrEn.js +1960 -0
- package/dist/manager/_manager-chunks/{globals-runtime-C02fvgcd.js → globals-runtime-CdgVeAbk.js} +408 -377
- package/dist/manager/_manager-chunks/{globals-runtime-BmphMP6z.js → globals-runtime-Cqn8KdSZ.js} +4 -4
- package/dist/manager/_manager-chunks/{globals-runtime-ZHrQFa3-.js → globals-runtime-CrIF09P8.js} +1246 -539
- package/dist/manager/_manager-chunks/{globals-runtime-BvM-NY2g.js → globals-runtime-Ct1kY4wb.js} +638 -1731
- package/dist/manager/_manager-chunks/globals-runtime-CvyFEPIY.js +5282 -0
- package/dist/manager/_manager-chunks/{globals-runtime-FC201B7s.js → globals-runtime-DMBjo1QS.js} +2 -1
- package/dist/manager/_manager-chunks/{globals-runtime-C9P2ZbMM.js → globals-runtime-DUK6bGcb.js} +52 -25
- package/dist/manager/_manager-chunks/globals-runtime-DedfO-DP.js +3414 -0
- package/dist/manager/_manager-chunks/{globals-runtime-q5R9dawi.js → globals-runtime-DqhIYwLp.js} +165 -152
- package/dist/manager/_manager-chunks/globals-runtime-XSxCU7PR.js +41 -0
- package/dist/manager/_manager-chunks/runtime-BR5z0WoJ.js +456 -0
- package/dist/manager/_manager-chunks/{runtime-DdCaBowH.js → runtime-BgYvp1WN.js} +15 -7
- package/dist/manager/_manager-chunks/{runtime-BGvLm94o.js → runtime-CHI-LHF1.js} +3 -3
- package/dist/manager/_manager-chunks/{runtime-BdLdsHca.js → runtime-CUymj6EY.js} +280 -288
- package/dist/manager/_manager-chunks/runtime-CaU1DSEZ.js +528 -0
- package/dist/manager/_manager-chunks/{runtime-DMig8mT7.js → runtime-CqItbdKW.js} +3 -2
- package/dist/manager/_manager-chunks/{runtime-B9QzcYO3.js → runtime-D4ZOOIV0.js} +5 -531
- package/dist/manager/_manager-chunks/{runtime-50_aob4S.js → runtime-DER98nV0.js} +3 -19
- package/dist/manager/_manager-chunks/{runtime-CE2sHVqs.js → runtime-DrTLBe7a.js} +39 -40
- package/dist/manager/_manager-chunks/runtime-MAf7Wpk5.js +692 -0
- package/dist/manager/_manager-chunks/{runtime-CKP1i0--.js → runtime-cVFIMcca.js} +1 -1
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/globals.d.ts +1 -1
- package/dist/manager/globals.js +1 -1
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +22 -28
- package/dist/manager-errors.d.ts +1 -1
- package/dist/mcp/index.js +8 -8
- package/dist/mocking-utils/index.js +16 -11
- package/dist/nextjs-vite/index.js +3 -2
- package/dist/nextjs-vite/node/index.js +7 -7
- package/dist/nextjs-vite/preset.js +11 -11
- package/dist/nextjs-vite/vite-plugin/index.js +7 -7
- package/dist/nextjs-vite-plugin/index.d.ts +1 -2
- package/dist/nextjs-vite-plugin/index.js +12 -27
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
- package/dist/node-logger/index.d.ts +65 -72
- package/dist/node-logger/index.js +11 -12
- package/dist/oxc-parser/index.js +11 -13
- package/dist/oxc-parser/worker.js +10 -10
- package/dist/preview/_chunks/{runtime-DVM_AHbR.js → runtime-6P-h06Te.js} +51 -50
- package/dist/preview/_chunks/{runtime-BoxmlDdB.js → runtime-B9KKIDGa.js} +202 -81
- package/dist/preview/_chunks/{runtime-BIzIdDbb.js → runtime-BPwAnlRx.js} +482 -334
- package/dist/preview/_chunks/{runtime-q3wt0e_N.js → runtime-BUnOhg9h.js} +2 -2
- package/dist/preview/_chunks/runtime-Bcv1hJky.js +6305 -0
- package/dist/preview/_chunks/{runtime-CqHxptiK.js → runtime-C1jgT6tJ.js} +93 -2145
- package/dist/preview/_chunks/{runtime-D7B4bVe_.js → runtime-C8QFpkFV.js} +6 -6
- package/dist/preview/_chunks/{runtime-CijtAN7R.js → runtime-DdqR8Fd0.js} +15 -6
- package/dist/preview/_chunks/{runtime-B3y8ocOg.js → runtime-DvBfMhis.js} +2 -2
- package/dist/preview/_chunks/{runtime-BZSnICCg.js → runtime-WapFVPAh.js} +29 -29
- package/dist/preview/runtime.js +1 -1
- package/dist/preview-api/index.d.ts +1 -1
- package/dist/preview-api/index.js +2 -1
- package/dist/preview-errors.d.ts +1 -1
- package/dist/react/docgen/docgen-worker.js +11 -12
- package/dist/react/entry-preview.js +2 -1
- package/dist/react/index.js +6 -4
- package/dist/react/preset.js +13 -14
- package/dist/react/preview.js +3 -2
- package/dist/react-native/bin/get-stories.js +8 -8
- package/dist/react-native/index.js +25 -211
- package/dist/react-native/metro/node.js +10 -9
- package/dist/react-native/metro/withStorybook.js +11 -10
- package/dist/react-native/scripts/generate.js +8 -8
- package/dist/react-vite/node/index.js +7 -7
- package/dist/react-vite/preset.js +7 -7
- package/dist/router/index.js +3 -1
- package/dist/server-errors.d.ts +1 -1
- package/dist/server-errors.js +9 -9
- package/dist/shared/open-service/index.d.ts +1 -1
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
- package/dist/telemetry/index.js +43 -45
- package/dist/test/index.js +808 -573
- package/dist/theming/create.js +2 -1
- package/dist/theming/index.js +22 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +17 -45
- package/dist/_browser-chunks/WithTooltip-523JD6VH.js +0 -1619
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +0 -20
- package/dist/_browser-chunks/chunk-UDQ3XQFC.js +0 -108
- package/dist/_node-chunks/chunk-7XCEKQGV.js +0 -18
- package/dist/_node-chunks/chunk-EGS2SAD2.js +0 -5414
- package/dist/_node-chunks/chunk-GKTCJPLL.js +0 -36
- package/dist/_node-chunks/chunk-HENM5ZK3.js +0 -1877
- package/dist/_node-chunks/chunk-HQM4ISVU.js +0 -11
- package/dist/_node-chunks/chunk-K3I3G4VL.js +0 -4731
- package/dist/_node-chunks/chunk-MZMPFII2.js +0 -29
- package/dist/_node-chunks/chunk-NYAWUR6L.js +0 -3823
- package/dist/_node-chunks/chunk-NYRUWAL3.js +0 -23
- package/dist/_node-chunks/chunk-SSZ5REKS.js +0 -3008
- package/dist/_node-chunks/chunk-WEW23EEE.js +0 -662
- package/dist/_node-chunks/chunk-XWQEWRFD.js +0 -51
- package/dist/_node-chunks/dist-CNA633FI.js +0 -16
- package/dist/_node-chunks/globby-HRQV5N3V.js +0 -2884
- package/dist/_node-chunks/jiti-WE7NHS2Y.js +0 -3848
- package/dist/_node-chunks/lib-7MVA6CTW.js +0 -366
- package/dist/_node-chunks/optimized-tests-IAX6YURR.js +0 -22
- package/dist/_node-chunks/postinstallAddon-ROH2TBJX.js +0 -20
- package/dist/_node-chunks/session-id-GM226DGP.js +0 -23
- package/dist/chunk-BfBzpgct.d.ts +0 -916
- package/dist/core-server/presets/common-manager.css +0 -170
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +0 -3389
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +0 -9766
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +0 -5357
- package/dist/manager/_manager-chunks/runtime-89Cb0A8U.js +0 -998
- package/dist/manager/_manager-chunks/runtime-wL4UO7YO.js +0 -452
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +0 -1102
- package/dist/preview/_chunks/runtime-DZToXfvO.js +0 -9767
package/dist/manager/_manager-chunks/{globals-runtime-8HkdnU2F.js → globals-runtime-B71TiXST.js}
RENAMED
|
@@ -1,2059 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { b as require_lib, y as require_css_escape } from "./globals-runtime-BvM-NY2g.js";
|
|
5
|
-
import { d as a, f as init_adobe_css_tools } from "./globals-runtime-DwFqpqya.js";
|
|
6
|
-
import { n as getConfig, r as init_dom_esm } from "./globals-runtime-DkAPXCvc.js";
|
|
7
|
-
//#region ../../node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/polyfills/array.from.mjs
|
|
8
|
-
function isCallable(fn) {
|
|
9
|
-
return typeof fn === "function" || toStr.call(fn) === "[object Function]";
|
|
10
|
-
}
|
|
11
|
-
function toInteger(value) {
|
|
12
|
-
var number = Number(value);
|
|
13
|
-
if (isNaN(number)) return 0;
|
|
14
|
-
if (number === 0 || !isFinite(number)) return number;
|
|
15
|
-
return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
|
|
16
|
-
}
|
|
17
|
-
function toLength(value) {
|
|
18
|
-
var len = toInteger(value);
|
|
19
|
-
return Math.min(Math.max(len, 0), maxSafeInteger);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Creates an array from an iterable object.
|
|
23
|
-
* @param iterable An iterable object to convert to an array.
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* Creates an array from an iterable object.
|
|
27
|
-
* @param iterable An iterable object to convert to an array.
|
|
28
|
-
* @param mapfn A mapping function to call on every element of the array.
|
|
29
|
-
* @param thisArg Value of 'this' used to invoke the mapfn.
|
|
30
|
-
*/
|
|
31
|
-
function arrayFrom(arrayLike, mapFn) {
|
|
32
|
-
var C = Array;
|
|
33
|
-
var items = Object(arrayLike);
|
|
34
|
-
if (arrayLike == null) throw new TypeError("Array.from requires an array-like object - not null or undefined");
|
|
35
|
-
if (typeof mapFn !== "undefined") {
|
|
36
|
-
if (!isCallable(mapFn)) throw new TypeError("Array.from: when provided, the second argument must be a function");
|
|
37
|
-
}
|
|
38
|
-
var len = toLength(items.length);
|
|
39
|
-
var A = isCallable(C) ? Object(new C(len)) : new Array(len);
|
|
40
|
-
var k = 0;
|
|
41
|
-
var kValue;
|
|
42
|
-
while (k < len) {
|
|
43
|
-
kValue = items[k];
|
|
44
|
-
if (mapFn) A[k] = mapFn(kValue, k);
|
|
45
|
-
else A[k] = kValue;
|
|
46
|
-
k += 1;
|
|
47
|
-
}
|
|
48
|
-
A.length = len;
|
|
49
|
-
return A;
|
|
50
|
-
}
|
|
51
|
-
var toStr, maxSafeInteger;
|
|
52
|
-
function init_array_from() {
|
|
53
|
-
return (init_array_from = __esmMin((() => {
|
|
54
|
-
toStr = Object.prototype.toString;
|
|
55
|
-
maxSafeInteger = Math.pow(2, 53) - 1;
|
|
56
|
-
})))();
|
|
57
|
-
}
|
|
58
|
-
//#endregion
|
|
59
|
-
//#region ../../node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/polyfills/SetLike.mjs
|
|
60
|
-
function _typeof$1(o) {
|
|
61
|
-
"@babel/helpers - typeof";
|
|
62
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
63
|
-
return typeof o;
|
|
64
|
-
} : function(o) {
|
|
65
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
66
|
-
}, _typeof$1(o);
|
|
67
|
-
}
|
|
68
|
-
function _classCallCheck(instance, Constructor) {
|
|
69
|
-
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
70
|
-
}
|
|
71
|
-
function _defineProperties(target, props) {
|
|
72
|
-
for (var i = 0; i < props.length; i++) {
|
|
73
|
-
var descriptor = props[i];
|
|
74
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
75
|
-
descriptor.configurable = true;
|
|
76
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
77
|
-
Object.defineProperty(target, _toPropertyKey$1(descriptor.key), descriptor);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
81
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
82
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
83
|
-
Object.defineProperty(Constructor, "prototype", { writable: false });
|
|
84
|
-
return Constructor;
|
|
85
|
-
}
|
|
86
|
-
function _defineProperty$1(obj, key, value) {
|
|
87
|
-
key = _toPropertyKey$1(key);
|
|
88
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
89
|
-
value,
|
|
90
|
-
enumerable: true,
|
|
91
|
-
configurable: true,
|
|
92
|
-
writable: true
|
|
93
|
-
});
|
|
94
|
-
else obj[key] = value;
|
|
95
|
-
return obj;
|
|
96
|
-
}
|
|
97
|
-
function _toPropertyKey$1(arg) {
|
|
98
|
-
var key = _toPrimitive$1(arg, "string");
|
|
99
|
-
return _typeof$1(key) === "symbol" ? key : String(key);
|
|
100
|
-
}
|
|
101
|
-
function _toPrimitive$1(input, hint) {
|
|
102
|
-
if (_typeof$1(input) !== "object" || input === null) return input;
|
|
103
|
-
var prim = input[Symbol.toPrimitive];
|
|
104
|
-
if (prim !== void 0) {
|
|
105
|
-
var res = prim.call(input, hint || "default");
|
|
106
|
-
if (_typeof$1(res) !== "object") return res;
|
|
107
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
108
|
-
}
|
|
109
|
-
return (hint === "string" ? String : Number)(input);
|
|
110
|
-
}
|
|
111
|
-
var SetLike, SetLike_default;
|
|
112
|
-
function init_SetLike() {
|
|
113
|
-
return (init_SetLike = __esmMin((() => {
|
|
114
|
-
SetLike = /*#__PURE__*/ function() {
|
|
115
|
-
function SetLike() {
|
|
116
|
-
var items = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
117
|
-
_classCallCheck(this, SetLike);
|
|
118
|
-
_defineProperty$1(this, "items", void 0);
|
|
119
|
-
this.items = items;
|
|
120
|
-
}
|
|
121
|
-
_createClass(SetLike, [
|
|
122
|
-
{
|
|
123
|
-
key: "add",
|
|
124
|
-
value: function add(value) {
|
|
125
|
-
if (this.has(value) === false) this.items.push(value);
|
|
126
|
-
return this;
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
key: "clear",
|
|
131
|
-
value: function clear() {
|
|
132
|
-
this.items = [];
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
key: "delete",
|
|
137
|
-
value: function _delete(value) {
|
|
138
|
-
var previousLength = this.items.length;
|
|
139
|
-
this.items = this.items.filter(function(item) {
|
|
140
|
-
return item !== value;
|
|
141
|
-
});
|
|
142
|
-
return previousLength !== this.items.length;
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
key: "forEach",
|
|
147
|
-
value: function forEach(callbackfn) {
|
|
148
|
-
var _this = this;
|
|
149
|
-
this.items.forEach(function(item) {
|
|
150
|
-
callbackfn(item, item, _this);
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
key: "has",
|
|
156
|
-
value: function has(value) {
|
|
157
|
-
return this.items.indexOf(value) !== -1;
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
key: "size",
|
|
162
|
-
get: function get() {
|
|
163
|
-
return this.items.length;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
]);
|
|
167
|
-
return SetLike;
|
|
168
|
-
}();
|
|
169
|
-
SetLike_default = typeof Set === "undefined" ? Set : SetLike;
|
|
170
|
-
})))();
|
|
171
|
-
}
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region ../../node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/getRole.mjs
|
|
174
|
-
/**
|
|
175
|
-
* Safe Element.localName for all supported environments
|
|
176
|
-
* @param element
|
|
177
|
-
*/
|
|
178
|
-
function getLocalName(element) {
|
|
179
|
-
var _element$localName;
|
|
180
|
-
return (_element$localName = element.localName) !== null && _element$localName !== void 0 ? _element$localName : element.tagName.toLowerCase();
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
*
|
|
184
|
-
* @param element
|
|
185
|
-
* @param role The role used for this element. This is specified to control whether you want to use the implicit or explicit role.
|
|
186
|
-
*/
|
|
187
|
-
function hasGlobalAriaAttributes(element, role) {
|
|
188
|
-
return [
|
|
189
|
-
"aria-atomic",
|
|
190
|
-
"aria-busy",
|
|
191
|
-
"aria-controls",
|
|
192
|
-
"aria-current",
|
|
193
|
-
"aria-description",
|
|
194
|
-
"aria-describedby",
|
|
195
|
-
"aria-details",
|
|
196
|
-
"aria-dropeffect",
|
|
197
|
-
"aria-flowto",
|
|
198
|
-
"aria-grabbed",
|
|
199
|
-
"aria-hidden",
|
|
200
|
-
"aria-keyshortcuts",
|
|
201
|
-
"aria-label",
|
|
202
|
-
"aria-labelledby",
|
|
203
|
-
"aria-live",
|
|
204
|
-
"aria-owns",
|
|
205
|
-
"aria-relevant",
|
|
206
|
-
"aria-roledescription"
|
|
207
|
-
].some(function(attributeName) {
|
|
208
|
-
var _prohibitedAttributes;
|
|
209
|
-
return element.hasAttribute(attributeName) && !((_prohibitedAttributes = prohibitedAttributes[role]) !== null && _prohibitedAttributes !== void 0 && _prohibitedAttributes.has(attributeName));
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
function ignorePresentationalRole(element, implicitRole) {
|
|
213
|
-
return hasGlobalAriaAttributes(element, implicitRole);
|
|
214
|
-
}
|
|
215
|
-
function getRole(element) {
|
|
216
|
-
var explicitRole = getExplicitRole(element);
|
|
217
|
-
if (explicitRole === null || presentationRoles.indexOf(explicitRole) !== -1) {
|
|
218
|
-
var implicitRole = getImplicitRole(element);
|
|
219
|
-
if (presentationRoles.indexOf(explicitRole || "") === -1 || ignorePresentationalRole(element, implicitRole || "")) return implicitRole;
|
|
220
|
-
}
|
|
221
|
-
return explicitRole;
|
|
222
|
-
}
|
|
223
|
-
function getImplicitRole(element) {
|
|
224
|
-
var mappedByTag = localNameToRoleMappings[getLocalName(element)];
|
|
225
|
-
if (mappedByTag !== void 0) return mappedByTag;
|
|
226
|
-
switch (getLocalName(element)) {
|
|
227
|
-
case "a":
|
|
228
|
-
case "area":
|
|
229
|
-
case "link":
|
|
230
|
-
if (element.hasAttribute("href")) return "link";
|
|
231
|
-
break;
|
|
232
|
-
case "img":
|
|
233
|
-
if (element.getAttribute("alt") === "" && !ignorePresentationalRole(element, "img")) return "presentation";
|
|
234
|
-
return "img";
|
|
235
|
-
case "input":
|
|
236
|
-
var type = element.type;
|
|
237
|
-
switch (type) {
|
|
238
|
-
case "button":
|
|
239
|
-
case "image":
|
|
240
|
-
case "reset":
|
|
241
|
-
case "submit": return "button";
|
|
242
|
-
case "checkbox":
|
|
243
|
-
case "radio": return type;
|
|
244
|
-
case "range": return "slider";
|
|
245
|
-
case "email":
|
|
246
|
-
case "tel":
|
|
247
|
-
case "text":
|
|
248
|
-
case "url":
|
|
249
|
-
if (element.hasAttribute("list")) return "combobox";
|
|
250
|
-
return "textbox";
|
|
251
|
-
case "search":
|
|
252
|
-
if (element.hasAttribute("list")) return "combobox";
|
|
253
|
-
return "searchbox";
|
|
254
|
-
case "number": return "spinbutton";
|
|
255
|
-
default: return null;
|
|
256
|
-
}
|
|
257
|
-
case "select":
|
|
258
|
-
if (element.hasAttribute("multiple") || element.size > 1) return "listbox";
|
|
259
|
-
return "combobox";
|
|
260
|
-
}
|
|
261
|
-
return null;
|
|
262
|
-
}
|
|
263
|
-
function getExplicitRole(element) {
|
|
264
|
-
var role = element.getAttribute("role");
|
|
265
|
-
if (role !== null) {
|
|
266
|
-
var explicitRole = role.trim().split(" ")[0];
|
|
267
|
-
if (explicitRole.length > 0) return explicitRole;
|
|
268
|
-
}
|
|
269
|
-
return null;
|
|
270
|
-
}
|
|
271
|
-
var localNameToRoleMappings, prohibitedAttributes;
|
|
272
|
-
function init_getRole() {
|
|
273
|
-
return (init_getRole = __esmMin((() => {
|
|
274
|
-
init_util();
|
|
275
|
-
localNameToRoleMappings = {
|
|
276
|
-
article: "article",
|
|
277
|
-
aside: "complementary",
|
|
278
|
-
button: "button",
|
|
279
|
-
datalist: "listbox",
|
|
280
|
-
dd: "definition",
|
|
281
|
-
details: "group",
|
|
282
|
-
dialog: "dialog",
|
|
283
|
-
dt: "term",
|
|
284
|
-
fieldset: "group",
|
|
285
|
-
figure: "figure",
|
|
286
|
-
form: "form",
|
|
287
|
-
footer: "contentinfo",
|
|
288
|
-
h1: "heading",
|
|
289
|
-
h2: "heading",
|
|
290
|
-
h3: "heading",
|
|
291
|
-
h4: "heading",
|
|
292
|
-
h5: "heading",
|
|
293
|
-
h6: "heading",
|
|
294
|
-
header: "banner",
|
|
295
|
-
hr: "separator",
|
|
296
|
-
html: "document",
|
|
297
|
-
legend: "legend",
|
|
298
|
-
li: "listitem",
|
|
299
|
-
math: "math",
|
|
300
|
-
main: "main",
|
|
301
|
-
menu: "list",
|
|
302
|
-
nav: "navigation",
|
|
303
|
-
ol: "list",
|
|
304
|
-
optgroup: "group",
|
|
305
|
-
option: "option",
|
|
306
|
-
output: "status",
|
|
307
|
-
progress: "progressbar",
|
|
308
|
-
section: "region",
|
|
309
|
-
summary: "button",
|
|
310
|
-
table: "table",
|
|
311
|
-
tbody: "rowgroup",
|
|
312
|
-
textarea: "textbox",
|
|
313
|
-
tfoot: "rowgroup",
|
|
314
|
-
td: "cell",
|
|
315
|
-
th: "columnheader",
|
|
316
|
-
thead: "rowgroup",
|
|
317
|
-
tr: "row",
|
|
318
|
-
ul: "list"
|
|
319
|
-
};
|
|
320
|
-
prohibitedAttributes = {
|
|
321
|
-
caption: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
322
|
-
code: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
323
|
-
deletion: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
324
|
-
emphasis: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
325
|
-
generic: /* @__PURE__ */ new Set([
|
|
326
|
-
"aria-label",
|
|
327
|
-
"aria-labelledby",
|
|
328
|
-
"aria-roledescription"
|
|
329
|
-
]),
|
|
330
|
-
insertion: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
331
|
-
none: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
332
|
-
paragraph: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
333
|
-
presentation: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
334
|
-
strong: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
335
|
-
subscript: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
336
|
-
superscript: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"])
|
|
337
|
-
};
|
|
338
|
-
})))();
|
|
339
|
-
}
|
|
340
|
-
//#endregion
|
|
341
|
-
//#region ../../node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/util.mjs
|
|
342
|
-
function isElement$2(node) {
|
|
343
|
-
return node !== null && node.nodeType === node.ELEMENT_NODE;
|
|
344
|
-
}
|
|
345
|
-
function isHTMLTableCaptionElement(node) {
|
|
346
|
-
return isElement$2(node) && getLocalName(node) === "caption";
|
|
347
|
-
}
|
|
348
|
-
function isHTMLInputElement(node) {
|
|
349
|
-
return isElement$2(node) && getLocalName(node) === "input";
|
|
350
|
-
}
|
|
351
|
-
function isHTMLOptGroupElement(node) {
|
|
352
|
-
return isElement$2(node) && getLocalName(node) === "optgroup";
|
|
353
|
-
}
|
|
354
|
-
function isHTMLSelectElement(node) {
|
|
355
|
-
return isElement$2(node) && getLocalName(node) === "select";
|
|
356
|
-
}
|
|
357
|
-
function isHTMLTableElement(node) {
|
|
358
|
-
return isElement$2(node) && getLocalName(node) === "table";
|
|
359
|
-
}
|
|
360
|
-
function isHTMLTextAreaElement(node) {
|
|
361
|
-
return isElement$2(node) && getLocalName(node) === "textarea";
|
|
362
|
-
}
|
|
363
|
-
function safeWindow(node) {
|
|
364
|
-
var defaultView = (node.ownerDocument === null ? node : node.ownerDocument).defaultView;
|
|
365
|
-
if (defaultView === null) throw new TypeError("no window available");
|
|
366
|
-
return defaultView;
|
|
367
|
-
}
|
|
368
|
-
function isHTMLFieldSetElement(node) {
|
|
369
|
-
return isElement$2(node) && getLocalName(node) === "fieldset";
|
|
370
|
-
}
|
|
371
|
-
function isHTMLLegendElement(node) {
|
|
372
|
-
return isElement$2(node) && getLocalName(node) === "legend";
|
|
373
|
-
}
|
|
374
|
-
function isHTMLSlotElement(node) {
|
|
375
|
-
return isElement$2(node) && getLocalName(node) === "slot";
|
|
376
|
-
}
|
|
377
|
-
function isSVGElement(node) {
|
|
378
|
-
return isElement$2(node) && node.ownerSVGElement !== void 0;
|
|
379
|
-
}
|
|
380
|
-
function isSVGSVGElement(node) {
|
|
381
|
-
return isElement$2(node) && getLocalName(node) === "svg";
|
|
382
|
-
}
|
|
383
|
-
function isSVGTitleElement(node) {
|
|
384
|
-
return isSVGElement(node) && getLocalName(node) === "title";
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
*
|
|
388
|
-
* @param {Node} node -
|
|
389
|
-
* @param {string} attributeName -
|
|
390
|
-
* @returns {Element[]} -
|
|
391
|
-
*/
|
|
392
|
-
function queryIdRefs(node, attributeName) {
|
|
393
|
-
if (isElement$2(node) && node.hasAttribute(attributeName)) {
|
|
394
|
-
var ids = node.getAttribute(attributeName).split(" ");
|
|
395
|
-
var root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
|
|
396
|
-
return ids.map(function(id) {
|
|
397
|
-
return root.getElementById(id);
|
|
398
|
-
}).filter(function(element) {
|
|
399
|
-
return element !== null;
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
return [];
|
|
403
|
-
}
|
|
404
|
-
function hasAnyConcreteRoles(node, roles) {
|
|
405
|
-
if (isElement$2(node)) return roles.indexOf(getRole(node)) !== -1;
|
|
406
|
-
return false;
|
|
407
|
-
}
|
|
408
|
-
var presentationRoles;
|
|
409
|
-
function init_util() {
|
|
410
|
-
return (init_util = __esmMin((() => {
|
|
411
|
-
init_getRole();
|
|
412
|
-
presentationRoles = ["presentation", "none"];
|
|
413
|
-
})))();
|
|
414
|
-
}
|
|
415
|
-
//#endregion
|
|
416
|
-
//#region ../../node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/accessible-name-and-description.mjs
|
|
417
|
-
/**
|
|
418
|
-
* A string of characters where all carriage returns, newlines, tabs, and form-feeds are replaced with a single space, and multiple spaces are reduced to a single space. The string contains only character data; it does not contain any markup.
|
|
419
|
-
*/
|
|
420
|
-
/**
|
|
421
|
-
* interface for an options-bag where `window.getComputedStyle` can be mocked
|
|
422
|
-
*/
|
|
423
|
-
/**
|
|
424
|
-
*
|
|
425
|
-
* @param {string} string -
|
|
426
|
-
* @returns {FlatString} -
|
|
427
|
-
*/
|
|
428
|
-
function asFlatString(s) {
|
|
429
|
-
return s.trim().replace(/\s\s+/g, " ");
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
*
|
|
433
|
-
* @param node -
|
|
434
|
-
* @param options - These are not optional to prevent accidentally calling it without options in `computeAccessibleName`
|
|
435
|
-
* @returns {boolean} -
|
|
436
|
-
*/
|
|
437
|
-
function isHidden(node, getComputedStyleImplementation) {
|
|
438
|
-
if (!isElement$2(node)) return false;
|
|
439
|
-
if (node.hasAttribute("hidden") || node.getAttribute("aria-hidden") === "true") return true;
|
|
440
|
-
var style = getComputedStyleImplementation(node);
|
|
441
|
-
return style.getPropertyValue("display") === "none" || style.getPropertyValue("visibility") === "hidden";
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* @param {Node} node -
|
|
445
|
-
* @returns {boolean} - As defined in step 2E of https://w3c.github.io/accname/#mapping_additional_nd_te
|
|
446
|
-
*/
|
|
447
|
-
function isControl(node) {
|
|
448
|
-
return hasAnyConcreteRoles(node, [
|
|
449
|
-
"button",
|
|
450
|
-
"combobox",
|
|
451
|
-
"listbox",
|
|
452
|
-
"textbox"
|
|
453
|
-
]) || hasAbstractRole(node, "range");
|
|
454
|
-
}
|
|
455
|
-
function hasAbstractRole(node, role) {
|
|
456
|
-
if (!isElement$2(node)) return false;
|
|
457
|
-
switch (role) {
|
|
458
|
-
case "range": return hasAnyConcreteRoles(node, [
|
|
459
|
-
"meter",
|
|
460
|
-
"progressbar",
|
|
461
|
-
"scrollbar",
|
|
462
|
-
"slider",
|
|
463
|
-
"spinbutton"
|
|
464
|
-
]);
|
|
465
|
-
default: throw new TypeError("No knowledge about abstract role '".concat(role, "'. This is likely a bug :("));
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* element.querySelectorAll but also considers owned tree
|
|
470
|
-
* @param element
|
|
471
|
-
* @param selectors
|
|
472
|
-
*/
|
|
473
|
-
function querySelectorAllSubtree(element, selectors) {
|
|
474
|
-
var elements = arrayFrom(element.querySelectorAll(selectors));
|
|
475
|
-
queryIdRefs(element, "aria-owns").forEach(function(root) {
|
|
476
|
-
elements.push.apply(elements, arrayFrom(root.querySelectorAll(selectors)));
|
|
477
|
-
});
|
|
478
|
-
return elements;
|
|
479
|
-
}
|
|
480
|
-
function querySelectedOptions(listbox) {
|
|
481
|
-
if (isHTMLSelectElement(listbox)) return listbox.selectedOptions || querySelectorAllSubtree(listbox, "[selected]");
|
|
482
|
-
return querySelectorAllSubtree(listbox, "[aria-selected=\"true\"]");
|
|
483
|
-
}
|
|
484
|
-
function isMarkedPresentational(node) {
|
|
485
|
-
return hasAnyConcreteRoles(node, presentationRoles);
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Elements specifically listed in html-aam
|
|
489
|
-
*
|
|
490
|
-
* We don't need this for `label` or `legend` elements.
|
|
491
|
-
* Their implicit roles already allow "naming from content".
|
|
492
|
-
*
|
|
493
|
-
* sources:
|
|
494
|
-
*
|
|
495
|
-
* - https://w3c.github.io/html-aam/#table-element
|
|
496
|
-
*/
|
|
497
|
-
function isNativeHostLanguageTextAlternativeElement(node) {
|
|
498
|
-
return isHTMLTableCaptionElement(node);
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* https://w3c.github.io/aria/#namefromcontent
|
|
502
|
-
*/
|
|
503
|
-
function allowsNameFromContent(node) {
|
|
504
|
-
return hasAnyConcreteRoles(node, [
|
|
505
|
-
"button",
|
|
506
|
-
"cell",
|
|
507
|
-
"checkbox",
|
|
508
|
-
"columnheader",
|
|
509
|
-
"gridcell",
|
|
510
|
-
"heading",
|
|
511
|
-
"label",
|
|
512
|
-
"legend",
|
|
513
|
-
"link",
|
|
514
|
-
"menuitem",
|
|
515
|
-
"menuitemcheckbox",
|
|
516
|
-
"menuitemradio",
|
|
517
|
-
"option",
|
|
518
|
-
"radio",
|
|
519
|
-
"row",
|
|
520
|
-
"rowheader",
|
|
521
|
-
"switch",
|
|
522
|
-
"tab",
|
|
523
|
-
"tooltip",
|
|
524
|
-
"treeitem"
|
|
525
|
-
]);
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* TODO https://github.com/eps1lon/dom-accessibility-api/issues/100
|
|
529
|
-
*/
|
|
530
|
-
function isDescendantOfNativeHostLanguageTextAlternativeElement(node) {
|
|
531
|
-
return false;
|
|
532
|
-
}
|
|
533
|
-
function getValueOfTextbox(element) {
|
|
534
|
-
if (isHTMLInputElement(element) || isHTMLTextAreaElement(element)) return element.value;
|
|
535
|
-
return element.textContent || "";
|
|
536
|
-
}
|
|
537
|
-
function getTextualContent(declaration) {
|
|
538
|
-
var content = declaration.getPropertyValue("content");
|
|
539
|
-
if (/^["'].*["']$/.test(content)) return content.slice(1, -1);
|
|
540
|
-
return "";
|
|
541
|
-
}
|
|
542
|
-
/**
|
|
543
|
-
* https://html.spec.whatwg.org/multipage/forms.html#category-label
|
|
544
|
-
* TODO: form-associated custom elements
|
|
545
|
-
* @param element
|
|
546
|
-
*/
|
|
547
|
-
function isLabelableElement(element) {
|
|
548
|
-
var localName = getLocalName(element);
|
|
549
|
-
return localName === "button" || localName === "input" && element.getAttribute("type") !== "hidden" || localName === "meter" || localName === "output" || localName === "progress" || localName === "select" || localName === "textarea";
|
|
550
|
-
}
|
|
551
|
-
/**
|
|
552
|
-
* > [...], then the first such descendant in tree order is the label element's labeled control.
|
|
553
|
-
* -- https://html.spec.whatwg.org/multipage/forms.html#labeled-control
|
|
554
|
-
* @param element
|
|
555
|
-
*/
|
|
556
|
-
function findLabelableElement(element) {
|
|
557
|
-
if (isLabelableElement(element)) return element;
|
|
558
|
-
var labelableElement = null;
|
|
559
|
-
element.childNodes.forEach(function(childNode) {
|
|
560
|
-
if (labelableElement === null && isElement$2(childNode)) {
|
|
561
|
-
var descendantLabelableElement = findLabelableElement(childNode);
|
|
562
|
-
if (descendantLabelableElement !== null) labelableElement = descendantLabelableElement;
|
|
563
|
-
}
|
|
564
|
-
});
|
|
565
|
-
return labelableElement;
|
|
566
|
-
}
|
|
567
|
-
/**
|
|
568
|
-
* Polyfill of HTMLLabelElement.control
|
|
569
|
-
* https://html.spec.whatwg.org/multipage/forms.html#labeled-control
|
|
570
|
-
* @param label
|
|
571
|
-
*/
|
|
572
|
-
function getControlOfLabel(label) {
|
|
573
|
-
if (label.control !== void 0) return label.control;
|
|
574
|
-
var htmlFor = label.getAttribute("for");
|
|
575
|
-
if (htmlFor !== null) return label.ownerDocument.getElementById(htmlFor);
|
|
576
|
-
return findLabelableElement(label);
|
|
577
|
-
}
|
|
578
|
-
/**
|
|
579
|
-
* Polyfill of HTMLInputElement.labels
|
|
580
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/labels
|
|
581
|
-
* @param element
|
|
582
|
-
*/
|
|
583
|
-
function getLabels(element) {
|
|
584
|
-
var labelsProperty = element.labels;
|
|
585
|
-
if (labelsProperty === null) return labelsProperty;
|
|
586
|
-
if (labelsProperty !== void 0) return arrayFrom(labelsProperty);
|
|
587
|
-
if (!isLabelableElement(element)) return null;
|
|
588
|
-
var document = element.ownerDocument;
|
|
589
|
-
return arrayFrom(document.querySelectorAll("label")).filter(function(label) {
|
|
590
|
-
return getControlOfLabel(label) === element;
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
/**
|
|
594
|
-
* Gets the contents of a slot used for computing the accname
|
|
595
|
-
* @param slot
|
|
596
|
-
*/
|
|
597
|
-
function getSlotContents(slot) {
|
|
598
|
-
var assignedNodes = slot.assignedNodes();
|
|
599
|
-
if (assignedNodes.length === 0) return arrayFrom(slot.childNodes);
|
|
600
|
-
return assignedNodes;
|
|
601
|
-
}
|
|
602
|
-
/**
|
|
603
|
-
* implements https://w3c.github.io/accname/#mapping_additional_nd_te
|
|
604
|
-
* @param root
|
|
605
|
-
* @param options
|
|
606
|
-
* @returns
|
|
607
|
-
*/
|
|
608
|
-
function computeTextAlternative(root) {
|
|
609
|
-
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
610
|
-
var consultedNodes = new SetLike_default();
|
|
611
|
-
var window = safeWindow(root);
|
|
612
|
-
var _options$compute = options.compute, compute = _options$compute === void 0 ? "name" : _options$compute, _options$computedStyl = options.computedStyleSupportsPseudoElements, computedStyleSupportsPseudoElements = _options$computedStyl === void 0 ? options.getComputedStyle !== void 0 : _options$computedStyl, _options$getComputedS = options.getComputedStyle, getComputedStyle = _options$getComputedS === void 0 ? window.getComputedStyle.bind(window) : _options$getComputedS, _options$hidden = options.hidden, hidden = _options$hidden === void 0 ? false : _options$hidden;
|
|
613
|
-
function computeMiscTextAlternative(node, context) {
|
|
614
|
-
var accumulatedText = "";
|
|
615
|
-
if (isElement$2(node) && computedStyleSupportsPseudoElements) {
|
|
616
|
-
var beforeContent = getTextualContent(getComputedStyle(node, "::before"));
|
|
617
|
-
accumulatedText = "".concat(beforeContent, " ").concat(accumulatedText);
|
|
618
|
-
}
|
|
619
|
-
(isHTMLSlotElement(node) ? getSlotContents(node) : arrayFrom(node.childNodes).concat(queryIdRefs(node, "aria-owns"))).forEach(function(child) {
|
|
620
|
-
var result = computeTextAlternative(child, {
|
|
621
|
-
isEmbeddedInLabel: context.isEmbeddedInLabel,
|
|
622
|
-
isReferenced: false,
|
|
623
|
-
recursion: true
|
|
624
|
-
});
|
|
625
|
-
var separator = (isElement$2(child) ? getComputedStyle(child).getPropertyValue("display") : "inline") !== "inline" ? " " : "";
|
|
626
|
-
accumulatedText += "".concat(separator).concat(result).concat(separator);
|
|
627
|
-
});
|
|
628
|
-
if (isElement$2(node) && computedStyleSupportsPseudoElements) {
|
|
629
|
-
var afterContent = getTextualContent(getComputedStyle(node, "::after"));
|
|
630
|
-
accumulatedText = "".concat(accumulatedText, " ").concat(afterContent);
|
|
631
|
-
}
|
|
632
|
-
return accumulatedText.trim();
|
|
633
|
-
}
|
|
634
|
-
/**
|
|
635
|
-
*
|
|
636
|
-
* @param element
|
|
637
|
-
* @param attributeName
|
|
638
|
-
* @returns A string non-empty string or `null`
|
|
639
|
-
*/
|
|
640
|
-
function useAttribute(element, attributeName) {
|
|
641
|
-
var attribute = element.getAttributeNode(attributeName);
|
|
642
|
-
if (attribute !== null && !consultedNodes.has(attribute) && attribute.value.trim() !== "") {
|
|
643
|
-
consultedNodes.add(attribute);
|
|
644
|
-
return attribute.value;
|
|
645
|
-
}
|
|
646
|
-
return null;
|
|
647
|
-
}
|
|
648
|
-
function computeTooltipAttributeValue(node) {
|
|
649
|
-
if (!isElement$2(node)) return null;
|
|
650
|
-
return useAttribute(node, "title");
|
|
651
|
-
}
|
|
652
|
-
function computeElementTextAlternative(node) {
|
|
653
|
-
if (!isElement$2(node)) return null;
|
|
654
|
-
if (isHTMLFieldSetElement(node)) {
|
|
655
|
-
consultedNodes.add(node);
|
|
656
|
-
var children = arrayFrom(node.childNodes);
|
|
657
|
-
for (var i = 0; i < children.length; i += 1) {
|
|
658
|
-
var child = children[i];
|
|
659
|
-
if (isHTMLLegendElement(child)) return computeTextAlternative(child, {
|
|
660
|
-
isEmbeddedInLabel: false,
|
|
661
|
-
isReferenced: false,
|
|
662
|
-
recursion: false
|
|
663
|
-
});
|
|
664
|
-
}
|
|
665
|
-
} else if (isHTMLTableElement(node)) {
|
|
666
|
-
consultedNodes.add(node);
|
|
667
|
-
var _children = arrayFrom(node.childNodes);
|
|
668
|
-
for (var _i = 0; _i < _children.length; _i += 1) {
|
|
669
|
-
var _child = _children[_i];
|
|
670
|
-
if (isHTMLTableCaptionElement(_child)) return computeTextAlternative(_child, {
|
|
671
|
-
isEmbeddedInLabel: false,
|
|
672
|
-
isReferenced: false,
|
|
673
|
-
recursion: false
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
} else if (isSVGSVGElement(node)) {
|
|
677
|
-
consultedNodes.add(node);
|
|
678
|
-
var _children2 = arrayFrom(node.childNodes);
|
|
679
|
-
for (var _i2 = 0; _i2 < _children2.length; _i2 += 1) {
|
|
680
|
-
var _child2 = _children2[_i2];
|
|
681
|
-
if (isSVGTitleElement(_child2)) return _child2.textContent;
|
|
682
|
-
}
|
|
683
|
-
return null;
|
|
684
|
-
} else if (getLocalName(node) === "img" || getLocalName(node) === "area") {
|
|
685
|
-
var nameFromAlt = useAttribute(node, "alt");
|
|
686
|
-
if (nameFromAlt !== null) return nameFromAlt;
|
|
687
|
-
} else if (isHTMLOptGroupElement(node)) {
|
|
688
|
-
var nameFromLabel = useAttribute(node, "label");
|
|
689
|
-
if (nameFromLabel !== null) return nameFromLabel;
|
|
690
|
-
}
|
|
691
|
-
if (isHTMLInputElement(node) && (node.type === "button" || node.type === "submit" || node.type === "reset")) {
|
|
692
|
-
var nameFromValue = useAttribute(node, "value");
|
|
693
|
-
if (nameFromValue !== null) return nameFromValue;
|
|
694
|
-
if (node.type === "submit") return "Submit";
|
|
695
|
-
if (node.type === "reset") return "Reset";
|
|
696
|
-
}
|
|
697
|
-
var labels = getLabels(node);
|
|
698
|
-
if (labels !== null && labels.length !== 0) {
|
|
699
|
-
consultedNodes.add(node);
|
|
700
|
-
return arrayFrom(labels).map(function(element) {
|
|
701
|
-
return computeTextAlternative(element, {
|
|
702
|
-
isEmbeddedInLabel: true,
|
|
703
|
-
isReferenced: false,
|
|
704
|
-
recursion: true
|
|
705
|
-
});
|
|
706
|
-
}).filter(function(label) {
|
|
707
|
-
return label.length > 0;
|
|
708
|
-
}).join(" ");
|
|
709
|
-
}
|
|
710
|
-
if (isHTMLInputElement(node) && node.type === "image") {
|
|
711
|
-
var _nameFromAlt = useAttribute(node, "alt");
|
|
712
|
-
if (_nameFromAlt !== null) return _nameFromAlt;
|
|
713
|
-
var nameFromTitle = useAttribute(node, "title");
|
|
714
|
-
if (nameFromTitle !== null) return nameFromTitle;
|
|
715
|
-
return "Submit Query";
|
|
716
|
-
}
|
|
717
|
-
if (hasAnyConcreteRoles(node, ["button"])) {
|
|
718
|
-
var nameFromSubTree = computeMiscTextAlternative(node, {
|
|
719
|
-
isEmbeddedInLabel: false,
|
|
720
|
-
isReferenced: false
|
|
721
|
-
});
|
|
722
|
-
if (nameFromSubTree !== "") return nameFromSubTree;
|
|
723
|
-
}
|
|
724
|
-
return null;
|
|
725
|
-
}
|
|
726
|
-
function computeTextAlternative(current, context) {
|
|
727
|
-
if (consultedNodes.has(current)) return "";
|
|
728
|
-
if (!hidden && isHidden(current, getComputedStyle) && !context.isReferenced) {
|
|
729
|
-
consultedNodes.add(current);
|
|
730
|
-
return "";
|
|
731
|
-
}
|
|
732
|
-
var labelAttributeNode = isElement$2(current) ? current.getAttributeNode("aria-labelledby") : null;
|
|
733
|
-
var labelElements = labelAttributeNode !== null && !consultedNodes.has(labelAttributeNode) ? queryIdRefs(current, "aria-labelledby") : [];
|
|
734
|
-
if (compute === "name" && !context.isReferenced && labelElements.length > 0) {
|
|
735
|
-
consultedNodes.add(labelAttributeNode);
|
|
736
|
-
return labelElements.map(function(element) {
|
|
737
|
-
return computeTextAlternative(element, {
|
|
738
|
-
isEmbeddedInLabel: context.isEmbeddedInLabel,
|
|
739
|
-
isReferenced: true,
|
|
740
|
-
recursion: false
|
|
741
|
-
});
|
|
742
|
-
}).join(" ");
|
|
743
|
-
}
|
|
744
|
-
var skipToStep2E = context.recursion && isControl(current) && compute === "name";
|
|
745
|
-
if (!skipToStep2E) {
|
|
746
|
-
var ariaLabel = (isElement$2(current) && current.getAttribute("aria-label") || "").trim();
|
|
747
|
-
if (ariaLabel !== "" && compute === "name") {
|
|
748
|
-
consultedNodes.add(current);
|
|
749
|
-
return ariaLabel;
|
|
750
|
-
}
|
|
751
|
-
if (!isMarkedPresentational(current)) {
|
|
752
|
-
var elementTextAlternative = computeElementTextAlternative(current);
|
|
753
|
-
if (elementTextAlternative !== null) {
|
|
754
|
-
consultedNodes.add(current);
|
|
755
|
-
return elementTextAlternative;
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
if (hasAnyConcreteRoles(current, ["menu"])) {
|
|
760
|
-
consultedNodes.add(current);
|
|
761
|
-
return "";
|
|
762
|
-
}
|
|
763
|
-
if (skipToStep2E || context.isEmbeddedInLabel || context.isReferenced) {
|
|
764
|
-
if (hasAnyConcreteRoles(current, ["combobox", "listbox"])) {
|
|
765
|
-
consultedNodes.add(current);
|
|
766
|
-
var selectedOptions = querySelectedOptions(current);
|
|
767
|
-
if (selectedOptions.length === 0) return isHTMLInputElement(current) ? current.value : "";
|
|
768
|
-
return arrayFrom(selectedOptions).map(function(selectedOption) {
|
|
769
|
-
return computeTextAlternative(selectedOption, {
|
|
770
|
-
isEmbeddedInLabel: context.isEmbeddedInLabel,
|
|
771
|
-
isReferenced: false,
|
|
772
|
-
recursion: true
|
|
773
|
-
});
|
|
774
|
-
}).join(" ");
|
|
775
|
-
}
|
|
776
|
-
if (hasAbstractRole(current, "range")) {
|
|
777
|
-
consultedNodes.add(current);
|
|
778
|
-
if (current.hasAttribute("aria-valuetext")) return current.getAttribute("aria-valuetext");
|
|
779
|
-
if (current.hasAttribute("aria-valuenow")) return current.getAttribute("aria-valuenow");
|
|
780
|
-
return current.getAttribute("value") || "";
|
|
781
|
-
}
|
|
782
|
-
if (hasAnyConcreteRoles(current, ["textbox"])) {
|
|
783
|
-
consultedNodes.add(current);
|
|
784
|
-
return getValueOfTextbox(current);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
if (allowsNameFromContent(current) || isElement$2(current) && context.isReferenced || isNativeHostLanguageTextAlternativeElement(current) || isDescendantOfNativeHostLanguageTextAlternativeElement(current)) {
|
|
788
|
-
var accumulatedText2F = computeMiscTextAlternative(current, {
|
|
789
|
-
isEmbeddedInLabel: context.isEmbeddedInLabel,
|
|
790
|
-
isReferenced: false
|
|
791
|
-
});
|
|
792
|
-
if (accumulatedText2F !== "") {
|
|
793
|
-
consultedNodes.add(current);
|
|
794
|
-
return accumulatedText2F;
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
if (current.nodeType === current.TEXT_NODE) {
|
|
798
|
-
consultedNodes.add(current);
|
|
799
|
-
return current.textContent || "";
|
|
800
|
-
}
|
|
801
|
-
if (context.recursion) {
|
|
802
|
-
consultedNodes.add(current);
|
|
803
|
-
return computeMiscTextAlternative(current, {
|
|
804
|
-
isEmbeddedInLabel: context.isEmbeddedInLabel,
|
|
805
|
-
isReferenced: false
|
|
806
|
-
});
|
|
807
|
-
}
|
|
808
|
-
var tooltipAttributeValue = computeTooltipAttributeValue(current);
|
|
809
|
-
if (tooltipAttributeValue !== null) {
|
|
810
|
-
consultedNodes.add(current);
|
|
811
|
-
return tooltipAttributeValue;
|
|
812
|
-
}
|
|
813
|
-
consultedNodes.add(current);
|
|
814
|
-
return "";
|
|
815
|
-
}
|
|
816
|
-
return asFlatString(computeTextAlternative(root, {
|
|
817
|
-
isEmbeddedInLabel: false,
|
|
818
|
-
isReferenced: compute === "description",
|
|
819
|
-
recursion: false
|
|
820
|
-
}));
|
|
821
|
-
}
|
|
822
|
-
function init_accessible_name_and_description() {
|
|
823
|
-
return (init_accessible_name_and_description = __esmMin((() => {
|
|
824
|
-
init_array_from();
|
|
825
|
-
init_SetLike();
|
|
826
|
-
init_util();
|
|
827
|
-
})))();
|
|
828
|
-
}
|
|
829
|
-
//#endregion
|
|
830
|
-
//#region ../../node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/accessible-description.mjs
|
|
831
|
-
function _typeof(o) {
|
|
832
|
-
"@babel/helpers - typeof";
|
|
833
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
834
|
-
return typeof o;
|
|
835
|
-
} : function(o) {
|
|
836
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
837
|
-
}, _typeof(o);
|
|
838
|
-
}
|
|
839
|
-
function ownKeys(e, r) {
|
|
840
|
-
var t = Object.keys(e);
|
|
841
|
-
if (Object.getOwnPropertySymbols) {
|
|
842
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
843
|
-
r && (o = o.filter(function(r) {
|
|
844
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
845
|
-
})), t.push.apply(t, o);
|
|
846
|
-
}
|
|
847
|
-
return t;
|
|
848
|
-
}
|
|
849
|
-
function _objectSpread(e) {
|
|
850
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
851
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
852
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
|
|
853
|
-
_defineProperty(e, r, t[r]);
|
|
854
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
|
|
855
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
return e;
|
|
859
|
-
}
|
|
860
|
-
function _defineProperty(obj, key, value) {
|
|
861
|
-
key = _toPropertyKey(key);
|
|
862
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
863
|
-
value,
|
|
864
|
-
enumerable: true,
|
|
865
|
-
configurable: true,
|
|
866
|
-
writable: true
|
|
867
|
-
});
|
|
868
|
-
else obj[key] = value;
|
|
869
|
-
return obj;
|
|
870
|
-
}
|
|
871
|
-
function _toPropertyKey(arg) {
|
|
872
|
-
var key = _toPrimitive(arg, "string");
|
|
873
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
874
|
-
}
|
|
875
|
-
function _toPrimitive(input, hint) {
|
|
876
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
877
|
-
var prim = input[Symbol.toPrimitive];
|
|
878
|
-
if (prim !== void 0) {
|
|
879
|
-
var res = prim.call(input, hint || "default");
|
|
880
|
-
if (_typeof(res) !== "object") return res;
|
|
881
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
882
|
-
}
|
|
883
|
-
return (hint === "string" ? String : Number)(input);
|
|
884
|
-
}
|
|
885
|
-
/**
|
|
886
|
-
* @param root
|
|
887
|
-
* @param options
|
|
888
|
-
* @returns
|
|
889
|
-
*/
|
|
890
|
-
function computeAccessibleDescription(root) {
|
|
891
|
-
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
892
|
-
var description = queryIdRefs(root, "aria-describedby").map(function(element) {
|
|
893
|
-
return computeTextAlternative(element, _objectSpread(_objectSpread({}, options), {}, { compute: "description" }));
|
|
894
|
-
}).join(" ");
|
|
895
|
-
if (description === "") {
|
|
896
|
-
var ariaDescription = root.getAttribute("aria-description");
|
|
897
|
-
description = ariaDescription === null ? "" : ariaDescription;
|
|
898
|
-
}
|
|
899
|
-
if (description === "") {
|
|
900
|
-
var title = root.getAttribute("title");
|
|
901
|
-
description = title === null ? "" : title;
|
|
902
|
-
}
|
|
903
|
-
return description;
|
|
904
|
-
}
|
|
905
|
-
function init_accessible_description() {
|
|
906
|
-
return (init_accessible_description = __esmMin((() => {
|
|
907
|
-
init_accessible_name_and_description();
|
|
908
|
-
init_util();
|
|
909
|
-
})))();
|
|
910
|
-
}
|
|
911
|
-
//#endregion
|
|
912
|
-
//#region ../../node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/accessible-name.mjs
|
|
913
|
-
/**
|
|
914
|
-
* https://w3c.github.io/aria/#namefromprohibited
|
|
915
|
-
*/
|
|
916
|
-
function prohibitsNaming(node) {
|
|
917
|
-
return hasAnyConcreteRoles(node, [
|
|
918
|
-
"caption",
|
|
919
|
-
"code",
|
|
920
|
-
"deletion",
|
|
921
|
-
"emphasis",
|
|
922
|
-
"generic",
|
|
923
|
-
"insertion",
|
|
924
|
-
"none",
|
|
925
|
-
"paragraph",
|
|
926
|
-
"presentation",
|
|
927
|
-
"strong",
|
|
928
|
-
"subscript",
|
|
929
|
-
"superscript"
|
|
930
|
-
]);
|
|
931
|
-
}
|
|
932
|
-
/**
|
|
933
|
-
* implements https://w3c.github.io/accname/#mapping_additional_nd_name
|
|
934
|
-
* @param root
|
|
935
|
-
* @param options
|
|
936
|
-
* @returns
|
|
937
|
-
*/
|
|
938
|
-
function computeAccessibleName(root) {
|
|
939
|
-
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
940
|
-
if (prohibitsNaming(root)) return "";
|
|
941
|
-
return computeTextAlternative(root, options);
|
|
942
|
-
}
|
|
943
|
-
function init_accessible_name() {
|
|
944
|
-
return (init_accessible_name = __esmMin((() => {
|
|
945
|
-
init_accessible_name_and_description();
|
|
946
|
-
init_util();
|
|
947
|
-
})))();
|
|
948
|
-
}
|
|
949
|
-
//#endregion
|
|
950
|
-
//#region ../../node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/index.mjs
|
|
951
|
-
function init_dist() {
|
|
952
|
-
return (init_dist = __esmMin((() => {
|
|
953
|
-
init_accessible_description();
|
|
954
|
-
init_accessible_name();
|
|
955
|
-
})))();
|
|
956
|
-
}
|
|
957
|
-
//#endregion
|
|
958
|
-
//#region ../../node_modules/@testing-library/jest-dom/dist/matchers-35e4d3bd.mjs
|
|
959
|
-
function checkHasWindow(htmlElement, ErrorClass, ...args) {
|
|
960
|
-
if (!htmlElement || !htmlElement.ownerDocument || !htmlElement.ownerDocument.defaultView) throw new ErrorClass(htmlElement, ...args);
|
|
961
|
-
}
|
|
962
|
-
function checkNode(node, ...args) {
|
|
963
|
-
checkHasWindow(node, NodeTypeError, ...args);
|
|
964
|
-
if (!(node instanceof node.ownerDocument.defaultView.Node)) throw new NodeTypeError(node, ...args);
|
|
965
|
-
}
|
|
966
|
-
function checkHtmlElement(htmlElement, ...args) {
|
|
967
|
-
checkHasWindow(htmlElement, HtmlElementTypeError, ...args);
|
|
968
|
-
const window = htmlElement.ownerDocument.defaultView;
|
|
969
|
-
if (!(htmlElement instanceof window.HTMLElement) && !(htmlElement instanceof window.SVGElement)) throw new HtmlElementTypeError(htmlElement, ...args);
|
|
970
|
-
}
|
|
971
|
-
function parseCSS(css, ...args) {
|
|
972
|
-
const ast = a(`selector { ${css} }`, { silent: true }).stylesheet;
|
|
973
|
-
if (ast.parsingErrors && ast.parsingErrors.length > 0) {
|
|
974
|
-
const { reason, line } = ast.parsingErrors[0];
|
|
975
|
-
throw new InvalidCSSError({
|
|
976
|
-
css,
|
|
977
|
-
message: `Syntax error parsing expected css: ${reason} on line: ${line}`
|
|
978
|
-
}, ...args);
|
|
979
|
-
}
|
|
980
|
-
return ast.rules[0].declarations.filter((d) => d.type === "declaration").reduce((obj, { property, value }) => Object.assign(obj, { [property]: value }), {});
|
|
981
|
-
}
|
|
982
|
-
function display(context, value) {
|
|
983
|
-
return typeof value === "string" ? value : context.utils.stringify(value);
|
|
984
|
-
}
|
|
985
|
-
function getMessage(context, matcher, expectedLabel, expectedValue, receivedLabel, receivedValue) {
|
|
986
|
-
return [
|
|
987
|
-
`${matcher}\n`,
|
|
988
|
-
`${expectedLabel}:\n${context.utils.EXPECTED_COLOR((0, import_redent$1.default)(display(context, expectedValue), 2))}`,
|
|
989
|
-
`${receivedLabel}:\n${context.utils.RECEIVED_COLOR((0, import_redent$1.default)(display(context, receivedValue), 2))}`
|
|
990
|
-
].join("\n");
|
|
991
|
-
}
|
|
992
|
-
function matches(textToMatch, matcher) {
|
|
993
|
-
if (matcher instanceof RegExp) return matcher.test(textToMatch);
|
|
994
|
-
else return textToMatch.includes(String(matcher));
|
|
995
|
-
}
|
|
996
|
-
function deprecate(name, replacementText) {
|
|
997
|
-
console.warn(`Warning: ${name} has been deprecated and will be removed in future updates.`, replacementText);
|
|
998
|
-
}
|
|
999
|
-
function normalize$1(text) {
|
|
1000
|
-
return text.replace(/\s+/g, " ").trim();
|
|
1001
|
-
}
|
|
1002
|
-
function getTag(element) {
|
|
1003
|
-
return element.tagName && element.tagName.toLowerCase();
|
|
1004
|
-
}
|
|
1005
|
-
function getSelectValue({ multiple, options }) {
|
|
1006
|
-
const selectedOptions = [...options].filter((option) => option.selected);
|
|
1007
|
-
if (multiple) return [...selectedOptions].map((opt) => opt.value);
|
|
1008
|
-
/* istanbul ignore if */
|
|
1009
|
-
if (selectedOptions.length === 0) return;
|
|
1010
|
-
return selectedOptions[0].value;
|
|
1011
|
-
}
|
|
1012
|
-
function getInputValue(inputElement) {
|
|
1013
|
-
switch (inputElement.type) {
|
|
1014
|
-
case "number": return inputElement.value === "" ? null : Number(inputElement.value);
|
|
1015
|
-
case "checkbox": return inputElement.checked;
|
|
1016
|
-
default: return inputElement.value;
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
function getAccessibleValue(element) {
|
|
1020
|
-
if (!rolesSupportingValues.includes(element.getAttribute("role"))) return;
|
|
1021
|
-
return Number(element.getAttribute("aria-valuenow"));
|
|
1022
|
-
}
|
|
1023
|
-
function getSingleElementValue(element) {
|
|
1024
|
-
/* istanbul ignore if */
|
|
1025
|
-
if (!element) return;
|
|
1026
|
-
switch (element.tagName.toLowerCase()) {
|
|
1027
|
-
case "input": return getInputValue(element);
|
|
1028
|
-
case "select": return getSelectValue(element);
|
|
1029
|
-
default: return element.value ?? getAccessibleValue(element);
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
function toSentence(array, { wordConnector = ", ", lastWordConnector = " and " } = {}) {
|
|
1033
|
-
return [array.slice(0, -1).join(wordConnector), array[array.length - 1]].join(array.length > 1 ? lastWordConnector : "");
|
|
1034
|
-
}
|
|
1035
|
-
function compareAsSet(val1, val2) {
|
|
1036
|
-
if (Array.isArray(val1) && Array.isArray(val2)) return [...new Set(val1)].every((v) => new Set(val2).has(v));
|
|
1037
|
-
return val1 === val2;
|
|
1038
|
-
}
|
|
1039
|
-
function toBeInTheDOM(element, container) {
|
|
1040
|
-
deprecate("toBeInTheDOM", "Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container.");
|
|
1041
|
-
if (element) checkHtmlElement(element, toBeInTheDOM, this);
|
|
1042
|
-
if (container) checkHtmlElement(container, toBeInTheDOM, this);
|
|
1043
|
-
return {
|
|
1044
|
-
pass: container ? container.contains(element) : !!element,
|
|
1045
|
-
message: () => {
|
|
1046
|
-
return [
|
|
1047
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeInTheDOM`, "element", ""),
|
|
1048
|
-
"",
|
|
1049
|
-
"Received:",
|
|
1050
|
-
` ${this.utils.printReceived(element ? element.cloneNode(false) : element)}`
|
|
1051
|
-
].join("\n");
|
|
1052
|
-
}
|
|
1053
|
-
};
|
|
1054
|
-
}
|
|
1055
|
-
function toBeInTheDocument(element) {
|
|
1056
|
-
if (element !== null || !this.isNot) checkHtmlElement(element, toBeInTheDocument, this);
|
|
1057
|
-
const pass = element === null ? false : element.ownerDocument === element.getRootNode({ composed: true });
|
|
1058
|
-
const errorFound = () => {
|
|
1059
|
-
return `expected document not to contain element, found ${this.utils.stringify(element.cloneNode(true))} instead`;
|
|
1060
|
-
};
|
|
1061
|
-
const errorNotFound = () => {
|
|
1062
|
-
return `element could not be found in the document`;
|
|
1063
|
-
};
|
|
1064
|
-
return {
|
|
1065
|
-
pass,
|
|
1066
|
-
message: () => {
|
|
1067
|
-
return [
|
|
1068
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeInTheDocument`, "element", ""),
|
|
1069
|
-
"",
|
|
1070
|
-
this.utils.RECEIVED_COLOR(this.isNot ? errorFound() : errorNotFound())
|
|
1071
|
-
].join("\n");
|
|
1072
|
-
}
|
|
1073
|
-
};
|
|
1074
|
-
}
|
|
1075
|
-
function toBeEmpty(element) {
|
|
1076
|
-
deprecate("toBeEmpty", "Please use instead toBeEmptyDOMElement for finding empty nodes in the DOM.");
|
|
1077
|
-
checkHtmlElement(element, toBeEmpty, this);
|
|
1078
|
-
return {
|
|
1079
|
-
pass: element.innerHTML === "",
|
|
1080
|
-
message: () => {
|
|
1081
|
-
return [
|
|
1082
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeEmpty`, "element", ""),
|
|
1083
|
-
"",
|
|
1084
|
-
"Received:",
|
|
1085
|
-
` ${this.utils.printReceived(element.innerHTML)}`
|
|
1086
|
-
].join("\n");
|
|
1087
|
-
}
|
|
1088
|
-
};
|
|
1089
|
-
}
|
|
1090
|
-
function toBeEmptyDOMElement(element) {
|
|
1091
|
-
checkHtmlElement(element, toBeEmptyDOMElement, this);
|
|
1092
|
-
return {
|
|
1093
|
-
pass: isEmptyElement(element),
|
|
1094
|
-
message: () => {
|
|
1095
|
-
return [
|
|
1096
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeEmptyDOMElement`, "element", ""),
|
|
1097
|
-
"",
|
|
1098
|
-
"Received:",
|
|
1099
|
-
` ${this.utils.printReceived(element.innerHTML)}`
|
|
1100
|
-
].join("\n");
|
|
1101
|
-
}
|
|
1102
|
-
};
|
|
1103
|
-
}
|
|
1104
|
-
/**
|
|
1105
|
-
* Identifies if an element doesn't contain child nodes (excluding comments)
|
|
1106
|
-
* ℹ Node.COMMENT_NODE can't be used because of the following issue
|
|
1107
|
-
* https://github.com/jsdom/jsdom/issues/2220
|
|
1108
|
-
*
|
|
1109
|
-
* @param {*} element an HtmlElement or SVGElement
|
|
1110
|
-
* @return {*} true if the element only contains comments or none
|
|
1111
|
-
*/
|
|
1112
|
-
function isEmptyElement(element) {
|
|
1113
|
-
return [...element.childNodes].filter((node) => node.nodeType !== 8).length === 0;
|
|
1114
|
-
}
|
|
1115
|
-
function toContainElement(container, element) {
|
|
1116
|
-
checkHtmlElement(container, toContainElement, this);
|
|
1117
|
-
if (element !== null) checkHtmlElement(element, toContainElement, this);
|
|
1118
|
-
return {
|
|
1119
|
-
pass: container.contains(element),
|
|
1120
|
-
message: () => {
|
|
1121
|
-
return [
|
|
1122
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toContainElement`, "element", "element"),
|
|
1123
|
-
"",
|
|
1124
|
-
this.utils.RECEIVED_COLOR(`${this.utils.stringify(container.cloneNode(false))} ${this.isNot ? "contains:" : "does not contain:"} ${this.utils.stringify(element ? element.cloneNode(false) : element)}
|
|
1125
|
-
`)
|
|
1126
|
-
].join("\n");
|
|
1127
|
-
}
|
|
1128
|
-
};
|
|
1129
|
-
}
|
|
1130
|
-
function getNormalizedHtml(container, htmlText) {
|
|
1131
|
-
const div = container.ownerDocument.createElement("div");
|
|
1132
|
-
div.innerHTML = htmlText;
|
|
1133
|
-
return div.innerHTML;
|
|
1134
|
-
}
|
|
1135
|
-
function toContainHTML(container, htmlText) {
|
|
1136
|
-
checkHtmlElement(container, toContainHTML, this);
|
|
1137
|
-
if (typeof htmlText !== "string") throw new Error(`.toContainHTML() expects a string value, got ${htmlText}`);
|
|
1138
|
-
return {
|
|
1139
|
-
pass: container.outerHTML.includes(getNormalizedHtml(container, htmlText)),
|
|
1140
|
-
message: () => {
|
|
1141
|
-
return [
|
|
1142
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toContainHTML`, "element", ""),
|
|
1143
|
-
"Expected:",
|
|
1144
|
-
` ${this.utils.EXPECTED_COLOR(htmlText)}`,
|
|
1145
|
-
"Received:",
|
|
1146
|
-
` ${this.utils.printReceived(container.cloneNode(true))}`
|
|
1147
|
-
].join("\n");
|
|
1148
|
-
}
|
|
1149
|
-
};
|
|
1150
|
-
}
|
|
1151
|
-
function toHaveTextContent(node, checkWith, options = { normalizeWhitespace: true }) {
|
|
1152
|
-
checkNode(node, toHaveTextContent, this);
|
|
1153
|
-
const textContent = options.normalizeWhitespace ? normalize$1(node.textContent) : node.textContent.replace(/\u00a0/g, " ");
|
|
1154
|
-
const checkingWithEmptyString = textContent !== "" && checkWith === "";
|
|
1155
|
-
return {
|
|
1156
|
-
pass: !checkingWithEmptyString && matches(textContent, checkWith),
|
|
1157
|
-
message: () => {
|
|
1158
|
-
const to = this.isNot ? "not to" : "to";
|
|
1159
|
-
return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveTextContent`, "element", ""), checkingWithEmptyString ? `Checking with empty string will always match, use .toBeEmptyDOMElement() instead` : `Expected element ${to} have text content`, checkWith, "Received", textContent);
|
|
1160
|
-
}
|
|
1161
|
-
};
|
|
1162
|
-
}
|
|
1163
|
-
function toHaveAccessibleDescription(htmlElement, expectedAccessibleDescription) {
|
|
1164
|
-
checkHtmlElement(htmlElement, toHaveAccessibleDescription, this);
|
|
1165
|
-
const actualAccessibleDescription = computeAccessibleDescription(htmlElement);
|
|
1166
|
-
const missingExpectedValue = arguments.length === 1;
|
|
1167
|
-
let pass = false;
|
|
1168
|
-
if (missingExpectedValue) pass = actualAccessibleDescription !== "";
|
|
1169
|
-
else pass = expectedAccessibleDescription instanceof RegExp ? expectedAccessibleDescription.test(actualAccessibleDescription) : this.equals(actualAccessibleDescription, expectedAccessibleDescription);
|
|
1170
|
-
return {
|
|
1171
|
-
pass,
|
|
1172
|
-
message: () => {
|
|
1173
|
-
const to = this.isNot ? "not to" : "to";
|
|
1174
|
-
return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.${toHaveAccessibleDescription.name}`, "element", ""), `Expected element ${to} have accessible description`, expectedAccessibleDescription, "Received", actualAccessibleDescription);
|
|
1175
|
-
}
|
|
1176
|
-
};
|
|
1177
|
-
}
|
|
1178
|
-
function toHaveAccessibleErrorMessage(htmlElement, expectedAccessibleErrorMessage) {
|
|
1179
|
-
checkHtmlElement(htmlElement, toHaveAccessibleErrorMessage, this);
|
|
1180
|
-
const to = this.isNot ? "not to" : "to";
|
|
1181
|
-
const method = this.isNot ? ".not.toHaveAccessibleErrorMessage" : ".toHaveAccessibleErrorMessage";
|
|
1182
|
-
const errormessageId = htmlElement.getAttribute("aria-errormessage");
|
|
1183
|
-
if (!!errormessageId && /\s+/.test(errormessageId)) return {
|
|
1184
|
-
pass: false,
|
|
1185
|
-
message: () => {
|
|
1186
|
-
return getMessage(this, this.utils.matcherHint(method, "element"), "Expected element's `aria-errormessage` attribute to be empty or a single, valid ID", "", "Received", `aria-errormessage="${errormessageId}"`);
|
|
1187
|
-
}
|
|
1188
|
-
};
|
|
1189
|
-
const ariaInvalidVal = htmlElement.getAttribute(ariaInvalidName);
|
|
1190
|
-
if (!htmlElement.hasAttribute(ariaInvalidName) || validStates.includes(ariaInvalidVal)) return {
|
|
1191
|
-
pass: false,
|
|
1192
|
-
message: () => {
|
|
1193
|
-
return getMessage(this, this.utils.matcherHint(method, "element"), "Expected element to be marked as invalid with attribute", `${ariaInvalidName}="${String(true)}"`, "Received", htmlElement.hasAttribute("aria-invalid") ? `${ariaInvalidName}="${htmlElement.getAttribute(ariaInvalidName)}` : null);
|
|
1194
|
-
}
|
|
1195
|
-
};
|
|
1196
|
-
const error = normalize$1(htmlElement.ownerDocument.getElementById(errormessageId)?.textContent ?? "");
|
|
1197
|
-
return {
|
|
1198
|
-
pass: expectedAccessibleErrorMessage === void 0 ? Boolean(error) : expectedAccessibleErrorMessage instanceof RegExp ? expectedAccessibleErrorMessage.test(error) : this.equals(error, expectedAccessibleErrorMessage),
|
|
1199
|
-
message: () => {
|
|
1200
|
-
return getMessage(this, this.utils.matcherHint(method, "element"), `Expected element ${to} have accessible error message`, expectedAccessibleErrorMessage ?? "", "Received", error);
|
|
1201
|
-
}
|
|
1202
|
-
};
|
|
1203
|
-
}
|
|
1204
|
-
function toHaveRole(htmlElement, expectedRole) {
|
|
1205
|
-
checkHtmlElement(htmlElement, toHaveRole, this);
|
|
1206
|
-
const actualRoles = getExplicitOrImplicitRoles(htmlElement);
|
|
1207
|
-
return {
|
|
1208
|
-
pass: actualRoles.some((el) => el === expectedRole),
|
|
1209
|
-
message: () => {
|
|
1210
|
-
const to = this.isNot ? "not to" : "to";
|
|
1211
|
-
return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.${toHaveRole.name}`, "element", ""), `Expected element ${to} have role`, expectedRole, "Received", actualRoles.join(", "));
|
|
1212
|
-
}
|
|
1213
|
-
};
|
|
1214
|
-
}
|
|
1215
|
-
function getExplicitOrImplicitRoles(htmlElement) {
|
|
1216
|
-
if (htmlElement.hasAttribute("role")) return htmlElement.getAttribute("role").split(" ").filter(Boolean);
|
|
1217
|
-
return getImplicitAriaRoles(htmlElement);
|
|
1218
|
-
}
|
|
1219
|
-
function getImplicitAriaRoles(currentNode) {
|
|
1220
|
-
for (const { match, roles } of elementRoleList) if (match(currentNode)) return [...roles];
|
|
1221
|
-
/* istanbul ignore next */
|
|
1222
|
-
return [];
|
|
1223
|
-
}
|
|
1224
|
-
/**
|
|
1225
|
-
* Transform the roles map (with required attributes and constraints) to a list
|
|
1226
|
-
* of roles. Each item in the list has functions to match an element against it.
|
|
1227
|
-
*
|
|
1228
|
-
* Essentially copied over from [dom-testing-library's
|
|
1229
|
-
* helpers](https://github.com/testing-library/dom-testing-library/blob/bd04cf95a1ed85a2238f7dfc1a77d5d16b4f59dc/src/role-helpers.js#L80)
|
|
1230
|
-
*
|
|
1231
|
-
* TODO: If we are truly just copying over stuff, would it make sense to move
|
|
1232
|
-
* this to a separate package?
|
|
1233
|
-
*
|
|
1234
|
-
* TODO: This technique relies on CSS selectors; are those consistently
|
|
1235
|
-
* available in all jest-dom environments? Why do other matchers in this package
|
|
1236
|
-
* not use them like this?
|
|
1237
|
-
*/
|
|
1238
|
-
function buildElementRoleList(elementRolesMap) {
|
|
1239
|
-
function makeElementSelector({ name, attributes }) {
|
|
1240
|
-
return `${name}${attributes.map(({ name: attributeName, value, constraints = [] }) => {
|
|
1241
|
-
if (constraints.indexOf("undefined") !== -1) return `:not([${attributeName}])`;
|
|
1242
|
-
else if (value) return `[${attributeName}="${value}"]`;
|
|
1243
|
-
else return `[${attributeName}]`;
|
|
1244
|
-
}).join("")}`;
|
|
1245
|
-
}
|
|
1246
|
-
function getSelectorSpecificity({ attributes = [] }) {
|
|
1247
|
-
return attributes.length;
|
|
1248
|
-
}
|
|
1249
|
-
function bySelectorSpecificity({ specificity: leftSpecificity }, { specificity: rightSpecificity }) {
|
|
1250
|
-
return rightSpecificity - leftSpecificity;
|
|
1251
|
-
}
|
|
1252
|
-
function match(element) {
|
|
1253
|
-
let { attributes = [] } = element;
|
|
1254
|
-
const typeTextIndex = attributes.findIndex((attribute) => attribute.value && attribute.name === "type" && attribute.value === "text");
|
|
1255
|
-
if (typeTextIndex >= 0) attributes = [...attributes.slice(0, typeTextIndex), ...attributes.slice(typeTextIndex + 1)];
|
|
1256
|
-
const selector = makeElementSelector({
|
|
1257
|
-
...element,
|
|
1258
|
-
attributes
|
|
1259
|
-
});
|
|
1260
|
-
return (node) => {
|
|
1261
|
-
if (typeTextIndex >= 0 && node.type !== "text") return false;
|
|
1262
|
-
return node.matches(selector);
|
|
1263
|
-
};
|
|
1264
|
-
}
|
|
1265
|
-
let result = [];
|
|
1266
|
-
for (const [element, roles] of elementRolesMap.entries()) result = [...result, {
|
|
1267
|
-
match: match(element),
|
|
1268
|
-
roles: Array.from(roles),
|
|
1269
|
-
specificity: getSelectorSpecificity(element)
|
|
1270
|
-
}];
|
|
1271
|
-
return result.sort(bySelectorSpecificity);
|
|
1272
|
-
}
|
|
1273
|
-
function toHaveAccessibleName(htmlElement, expectedAccessibleName) {
|
|
1274
|
-
checkHtmlElement(htmlElement, toHaveAccessibleName, this);
|
|
1275
|
-
const actualAccessibleName = computeAccessibleName(htmlElement);
|
|
1276
|
-
const missingExpectedValue = arguments.length === 1;
|
|
1277
|
-
let pass = false;
|
|
1278
|
-
if (missingExpectedValue) pass = actualAccessibleName !== "";
|
|
1279
|
-
else pass = expectedAccessibleName instanceof RegExp ? expectedAccessibleName.test(actualAccessibleName) : this.equals(actualAccessibleName, expectedAccessibleName);
|
|
1280
|
-
return {
|
|
1281
|
-
pass,
|
|
1282
|
-
message: () => {
|
|
1283
|
-
const to = this.isNot ? "not to" : "to";
|
|
1284
|
-
return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.${toHaveAccessibleName.name}`, "element", ""), `Expected element ${to} have accessible name`, expectedAccessibleName, "Received", actualAccessibleName);
|
|
1285
|
-
}
|
|
1286
|
-
};
|
|
1287
|
-
}
|
|
1288
|
-
function printAttribute(stringify, name, value) {
|
|
1289
|
-
return value === void 0 ? name : `${name}=${stringify(value)}`;
|
|
1290
|
-
}
|
|
1291
|
-
function getAttributeComment(stringify, name, value) {
|
|
1292
|
-
return value === void 0 ? `element.hasAttribute(${stringify(name)})` : `element.getAttribute(${stringify(name)}) === ${stringify(value)}`;
|
|
1293
|
-
}
|
|
1294
|
-
function toHaveAttribute(htmlElement, name, expectedValue) {
|
|
1295
|
-
checkHtmlElement(htmlElement, toHaveAttribute, this);
|
|
1296
|
-
const isExpectedValuePresent = expectedValue !== void 0;
|
|
1297
|
-
const hasAttribute = htmlElement.hasAttribute(name);
|
|
1298
|
-
const receivedValue = htmlElement.getAttribute(name);
|
|
1299
|
-
return {
|
|
1300
|
-
pass: isExpectedValuePresent ? hasAttribute && this.equals(receivedValue, expectedValue) : hasAttribute,
|
|
1301
|
-
message: () => {
|
|
1302
|
-
const to = this.isNot ? "not to" : "to";
|
|
1303
|
-
const receivedAttribute = hasAttribute ? printAttribute(this.utils.stringify, name, receivedValue) : null;
|
|
1304
|
-
const matcher = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveAttribute`, "element", this.utils.printExpected(name), {
|
|
1305
|
-
secondArgument: isExpectedValuePresent ? this.utils.printExpected(expectedValue) : void 0,
|
|
1306
|
-
comment: getAttributeComment(this.utils.stringify, name, expectedValue)
|
|
1307
|
-
});
|
|
1308
|
-
return getMessage(this, matcher, `Expected the element ${to} have attribute`, printAttribute(this.utils.stringify, name, expectedValue), "Received", receivedAttribute);
|
|
1309
|
-
}
|
|
1310
|
-
};
|
|
1311
|
-
}
|
|
1312
|
-
function getExpectedClassNamesAndOptions(params) {
|
|
1313
|
-
const lastParam = params.pop();
|
|
1314
|
-
let expectedClassNames, options;
|
|
1315
|
-
if (typeof lastParam === "object" && !(lastParam instanceof RegExp)) {
|
|
1316
|
-
expectedClassNames = params;
|
|
1317
|
-
options = lastParam;
|
|
1318
|
-
} else {
|
|
1319
|
-
expectedClassNames = params.concat(lastParam);
|
|
1320
|
-
options = { exact: false };
|
|
1321
|
-
}
|
|
1322
|
-
return {
|
|
1323
|
-
expectedClassNames,
|
|
1324
|
-
options
|
|
1325
|
-
};
|
|
1326
|
-
}
|
|
1327
|
-
function splitClassNames(str) {
|
|
1328
|
-
if (!str) return [];
|
|
1329
|
-
return str.split(/\s+/).filter((s) => s.length > 0);
|
|
1330
|
-
}
|
|
1331
|
-
function isSubset$1(subset, superset) {
|
|
1332
|
-
return subset.every((strOrRegexp) => typeof strOrRegexp === "string" ? superset.includes(strOrRegexp) : superset.some((className) => strOrRegexp.test(className)));
|
|
1333
|
-
}
|
|
1334
|
-
function toHaveClass(htmlElement, ...params) {
|
|
1335
|
-
checkHtmlElement(htmlElement, toHaveClass, this);
|
|
1336
|
-
const { expectedClassNames, options } = getExpectedClassNamesAndOptions(params);
|
|
1337
|
-
const received = splitClassNames(htmlElement.getAttribute("class"));
|
|
1338
|
-
const expected = expectedClassNames.reduce((acc, className) => acc.concat(typeof className === "string" || !className ? splitClassNames(className) : className), []);
|
|
1339
|
-
const hasRegExp = expected.some((className) => className instanceof RegExp);
|
|
1340
|
-
if (options.exact && hasRegExp) throw new Error("Exact option does not support RegExp expected class names");
|
|
1341
|
-
if (options.exact) return {
|
|
1342
|
-
pass: isSubset$1(expected, received) && expected.length === received.length,
|
|
1343
|
-
message: () => {
|
|
1344
|
-
const to = this.isNot ? "not to" : "to";
|
|
1345
|
-
return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveClass`, "element", this.utils.printExpected(expected.join(" "))), `Expected the element ${to} have EXACTLY defined classes`, expected.join(" "), "Received", received.join(" "));
|
|
1346
|
-
}
|
|
1347
|
-
};
|
|
1348
|
-
return expected.length > 0 ? {
|
|
1349
|
-
pass: isSubset$1(expected, received),
|
|
1350
|
-
message: () => {
|
|
1351
|
-
const to = this.isNot ? "not to" : "to";
|
|
1352
|
-
return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveClass`, "element", this.utils.printExpected(expected.join(" "))), `Expected the element ${to} have class`, expected.join(" "), "Received", received.join(" "));
|
|
1353
|
-
}
|
|
1354
|
-
} : {
|
|
1355
|
-
pass: this.isNot ? received.length > 0 : false,
|
|
1356
|
-
message: () => this.isNot ? getMessage(this, this.utils.matcherHint(".not.toHaveClass", "element", ""), "Expected the element to have classes", "(none)", "Received", received.join(" ")) : [this.utils.matcherHint(`.toHaveClass`, "element"), "At least one expected class must be provided."].join("\n")
|
|
1357
|
-
};
|
|
1358
|
-
}
|
|
1359
|
-
function getStyleDeclaration(document, css) {
|
|
1360
|
-
const styles = {};
|
|
1361
|
-
const copy = document.createElement("div");
|
|
1362
|
-
Object.keys(css).forEach((property) => {
|
|
1363
|
-
copy.style[property] = css[property];
|
|
1364
|
-
styles[property] = copy.style[property];
|
|
1365
|
-
});
|
|
1366
|
-
return styles;
|
|
1367
|
-
}
|
|
1368
|
-
function isSubset(styles, computedStyle) {
|
|
1369
|
-
return !!Object.keys(styles).length && Object.entries(styles).every(([prop, value]) => {
|
|
1370
|
-
const isCustomProperty = prop.startsWith("--");
|
|
1371
|
-
const spellingVariants = [prop];
|
|
1372
|
-
if (!isCustomProperty) spellingVariants.push(prop.toLowerCase());
|
|
1373
|
-
return spellingVariants.some((name) => computedStyle[name] === value || computedStyle.getPropertyValue(name) === value);
|
|
1374
|
-
});
|
|
1375
|
-
}
|
|
1376
|
-
function printoutStyles(styles) {
|
|
1377
|
-
return Object.keys(styles).sort().map((prop) => `${prop}: ${styles[prop]};`).join("\n");
|
|
1378
|
-
}
|
|
1379
|
-
function expectedDiff(diffFn, expected, computedStyles) {
|
|
1380
|
-
const received = Array.from(computedStyles).filter((prop) => expected[prop] !== void 0).reduce((obj, prop) => Object.assign(obj, { [prop]: computedStyles.getPropertyValue(prop) }), {});
|
|
1381
|
-
return diffFn(printoutStyles(expected), printoutStyles(received)).replace(`${import_picocolors_browser.default.red("+ Received")}\n`, "");
|
|
1382
|
-
}
|
|
1383
|
-
function toHaveStyle(htmlElement, css) {
|
|
1384
|
-
checkHtmlElement(htmlElement, toHaveStyle, this);
|
|
1385
|
-
const parsedCSS = typeof css === "object" ? css : parseCSS(css, toHaveStyle, this);
|
|
1386
|
-
const { getComputedStyle } = htmlElement.ownerDocument.defaultView;
|
|
1387
|
-
const expected = getStyleDeclaration(htmlElement.ownerDocument, parsedCSS);
|
|
1388
|
-
const received = getComputedStyle(htmlElement);
|
|
1389
|
-
return {
|
|
1390
|
-
pass: isSubset(expected, received),
|
|
1391
|
-
message: () => {
|
|
1392
|
-
const matcher = `${this.isNot ? ".not" : ""}.toHaveStyle`;
|
|
1393
|
-
return [this.utils.matcherHint(matcher, "element", ""), expectedDiff(this.utils.diff, expected, received)].join("\n\n");
|
|
1394
|
-
}
|
|
1395
|
-
};
|
|
1396
|
-
}
|
|
1397
|
-
function toHaveFocus(element) {
|
|
1398
|
-
checkHtmlElement(element, toHaveFocus, this);
|
|
1399
|
-
return {
|
|
1400
|
-
pass: element.ownerDocument.activeElement === element,
|
|
1401
|
-
message: () => {
|
|
1402
|
-
return [
|
|
1403
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveFocus`, "element", ""),
|
|
1404
|
-
"",
|
|
1405
|
-
...this.isNot ? ["Received element is focused:", ` ${this.utils.printReceived(element)}`] : [
|
|
1406
|
-
"Expected element with focus:",
|
|
1407
|
-
` ${this.utils.printExpected(element)}`,
|
|
1408
|
-
"Received element with focus:",
|
|
1409
|
-
` ${this.utils.printReceived(element.ownerDocument.activeElement)}`
|
|
1410
|
-
]
|
|
1411
|
-
].join("\n");
|
|
1412
|
-
}
|
|
1413
|
-
};
|
|
1414
|
-
}
|
|
1415
|
-
function getMultiElementValue(elements) {
|
|
1416
|
-
const types = [...new Set(elements.map((element) => element.type))];
|
|
1417
|
-
if (types.length !== 1) throw new Error("Multiple form elements with the same name must be of the same type");
|
|
1418
|
-
switch (types[0]) {
|
|
1419
|
-
case "radio": {
|
|
1420
|
-
const theChosenOne = elements.find((radio) => radio.checked);
|
|
1421
|
-
return theChosenOne ? theChosenOne.value : void 0;
|
|
1422
|
-
}
|
|
1423
|
-
case "checkbox": return elements.filter((checkbox) => checkbox.checked).map((checkbox) => checkbox.value);
|
|
1424
|
-
default: return elements.map((element) => element.value);
|
|
1425
|
-
}
|
|
1426
|
-
}
|
|
1427
|
-
function getFormValue(container, name) {
|
|
1428
|
-
const elements = [...container.querySelectorAll(`[name="${(0, import_css_escape$1.default)(name)}"]`)];
|
|
1429
|
-
/* istanbul ignore if */
|
|
1430
|
-
if (elements.length === 0) return;
|
|
1431
|
-
switch (elements.length) {
|
|
1432
|
-
case 1: return getSingleElementValue(elements[0]);
|
|
1433
|
-
default: return getMultiElementValue(elements);
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
function getPureName(name) {
|
|
1437
|
-
return /\[\]$/.test(name) ? name.slice(0, -2) : name;
|
|
1438
|
-
}
|
|
1439
|
-
function getAllFormValues(container) {
|
|
1440
|
-
return Array.from(container.elements).map((element) => element.name).reduce((obj, name) => ({
|
|
1441
|
-
...obj,
|
|
1442
|
-
[getPureName(name)]: getFormValue(container, name)
|
|
1443
|
-
}), {});
|
|
1444
|
-
}
|
|
1445
|
-
function toHaveFormValues(formElement, expectedValues) {
|
|
1446
|
-
checkHtmlElement(formElement, toHaveFormValues, this);
|
|
1447
|
-
if (!formElement.elements) throw new Error("toHaveFormValues must be called on a form or a fieldset");
|
|
1448
|
-
const formValues = getAllFormValues(formElement);
|
|
1449
|
-
return {
|
|
1450
|
-
pass: Object.entries(expectedValues).every(([name, expectedValue]) => compareAsSet(formValues[name], expectedValue)),
|
|
1451
|
-
message: () => {
|
|
1452
|
-
const to = this.isNot ? "not to" : "to";
|
|
1453
|
-
const matcher = `${this.isNot ? ".not" : ""}.toHaveFormValues`;
|
|
1454
|
-
const commonKeyValues = Object.keys(formValues).filter((key) => expectedValues.hasOwnProperty(key)).reduce((obj, key) => ({
|
|
1455
|
-
...obj,
|
|
1456
|
-
[key]: formValues[key]
|
|
1457
|
-
}), {});
|
|
1458
|
-
return [
|
|
1459
|
-
this.utils.matcherHint(matcher, "element", ""),
|
|
1460
|
-
`Expected the element ${to} have form values`,
|
|
1461
|
-
this.utils.diff(expectedValues, commonKeyValues)
|
|
1462
|
-
].join("\n\n");
|
|
1463
|
-
}
|
|
1464
|
-
};
|
|
1465
|
-
}
|
|
1466
|
-
function isStyleVisible(element) {
|
|
1467
|
-
const { getComputedStyle } = element.ownerDocument.defaultView;
|
|
1468
|
-
const { display, visibility, opacity } = getComputedStyle(element);
|
|
1469
|
-
return display !== "none" && visibility !== "hidden" && visibility !== "collapse" && opacity !== "0" && opacity !== 0;
|
|
1470
|
-
}
|
|
1471
|
-
function isAttributeVisible(element, previousElement) {
|
|
1472
|
-
let detailsVisibility;
|
|
1473
|
-
if (previousElement) detailsVisibility = element.nodeName === "DETAILS" && previousElement.nodeName !== "SUMMARY" ? element.hasAttribute("open") : true;
|
|
1474
|
-
else detailsVisibility = element.nodeName === "DETAILS" ? element.hasAttribute("open") : true;
|
|
1475
|
-
return !element.hasAttribute("hidden") && detailsVisibility;
|
|
1476
|
-
}
|
|
1477
|
-
function isElementVisible(element, previousElement) {
|
|
1478
|
-
return isStyleVisible(element) && isAttributeVisible(element, previousElement) && (!element.parentElement || isElementVisible(element.parentElement, element));
|
|
1479
|
-
}
|
|
1480
|
-
function toBeVisible(element) {
|
|
1481
|
-
checkHtmlElement(element, toBeVisible, this);
|
|
1482
|
-
const isInDocument = element.ownerDocument === element.getRootNode({ composed: true });
|
|
1483
|
-
const isVisible = isInDocument && isElementVisible(element);
|
|
1484
|
-
return {
|
|
1485
|
-
pass: isVisible,
|
|
1486
|
-
message: () => {
|
|
1487
|
-
const is = isVisible ? "is" : "is not";
|
|
1488
|
-
return [
|
|
1489
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeVisible`, "element", ""),
|
|
1490
|
-
"",
|
|
1491
|
-
`Received element ${is} visible${isInDocument ? "" : " (element is not in the document)"}:`,
|
|
1492
|
-
` ${this.utils.printReceived(element.cloneNode(false))}`
|
|
1493
|
-
].join("\n");
|
|
1494
|
-
}
|
|
1495
|
-
};
|
|
1496
|
-
}
|
|
1497
|
-
function isFirstLegendChildOfFieldset(element, parent) {
|
|
1498
|
-
return getTag(element) === "legend" && getTag(parent) === "fieldset" && element.isSameNode(Array.from(parent.children).find((child) => getTag(child) === "legend"));
|
|
1499
|
-
}
|
|
1500
|
-
function isElementDisabledByParent(element, parent) {
|
|
1501
|
-
return isElementDisabled(parent) && !isFirstLegendChildOfFieldset(element, parent);
|
|
1502
|
-
}
|
|
1503
|
-
function isCustomElement(tag) {
|
|
1504
|
-
return tag.includes("-");
|
|
1505
|
-
}
|
|
1506
|
-
function canElementBeDisabled(element) {
|
|
1507
|
-
const tag = getTag(element);
|
|
1508
|
-
return FORM_TAGS$2.includes(tag) || isCustomElement(tag);
|
|
1509
|
-
}
|
|
1510
|
-
function isElementDisabled(element) {
|
|
1511
|
-
return canElementBeDisabled(element) && element.hasAttribute("disabled");
|
|
1512
|
-
}
|
|
1513
|
-
function isAncestorDisabled(element) {
|
|
1514
|
-
const parent = element.parentElement;
|
|
1515
|
-
return Boolean(parent) && (isElementDisabledByParent(element, parent) || isAncestorDisabled(parent));
|
|
1516
|
-
}
|
|
1517
|
-
function isElementOrAncestorDisabled(element) {
|
|
1518
|
-
return canElementBeDisabled(element) && (isElementDisabled(element) || isAncestorDisabled(element));
|
|
1519
|
-
}
|
|
1520
|
-
function toBeDisabled(element) {
|
|
1521
|
-
checkHtmlElement(element, toBeDisabled, this);
|
|
1522
|
-
const isDisabled = isElementOrAncestorDisabled(element);
|
|
1523
|
-
return {
|
|
1524
|
-
pass: isDisabled,
|
|
1525
|
-
message: () => {
|
|
1526
|
-
const is = isDisabled ? "is" : "is not";
|
|
1527
|
-
return [
|
|
1528
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeDisabled`, "element", ""),
|
|
1529
|
-
"",
|
|
1530
|
-
`Received element ${is} disabled:`,
|
|
1531
|
-
` ${this.utils.printReceived(element.cloneNode(false))}`
|
|
1532
|
-
].join("\n");
|
|
1533
|
-
}
|
|
1534
|
-
};
|
|
1535
|
-
}
|
|
1536
|
-
function toBeEnabled(element) {
|
|
1537
|
-
checkHtmlElement(element, toBeEnabled, this);
|
|
1538
|
-
const isEnabled = !isElementOrAncestorDisabled(element);
|
|
1539
|
-
return {
|
|
1540
|
-
pass: isEnabled,
|
|
1541
|
-
message: () => {
|
|
1542
|
-
const is = isEnabled ? "is" : "is not";
|
|
1543
|
-
return [
|
|
1544
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeEnabled`, "element", ""),
|
|
1545
|
-
"",
|
|
1546
|
-
`Received element ${is} enabled:`,
|
|
1547
|
-
` ${this.utils.printReceived(element.cloneNode(false))}`
|
|
1548
|
-
].join("\n");
|
|
1549
|
-
}
|
|
1550
|
-
};
|
|
1551
|
-
}
|
|
1552
|
-
function isRequiredOnFormTagsExceptInput(element) {
|
|
1553
|
-
return FORM_TAGS$1.includes(getTag(element)) && element.hasAttribute("required");
|
|
1554
|
-
}
|
|
1555
|
-
function isRequiredOnSupportedInput(element) {
|
|
1556
|
-
return getTag(element) === "input" && element.hasAttribute("required") && (element.hasAttribute("type") && !UNSUPPORTED_INPUT_TYPES.includes(element.getAttribute("type")) || !element.hasAttribute("type"));
|
|
1557
|
-
}
|
|
1558
|
-
function isElementRequiredByARIA(element) {
|
|
1559
|
-
return element.hasAttribute("aria-required") && element.getAttribute("aria-required") === "true" && (ARIA_FORM_TAGS.includes(getTag(element)) || element.hasAttribute("role") && SUPPORTED_ARIA_ROLES.includes(element.getAttribute("role")));
|
|
1560
|
-
}
|
|
1561
|
-
function toBeRequired(element) {
|
|
1562
|
-
checkHtmlElement(element, toBeRequired, this);
|
|
1563
|
-
const isRequired = isRequiredOnFormTagsExceptInput(element) || isRequiredOnSupportedInput(element) || isElementRequiredByARIA(element);
|
|
1564
|
-
return {
|
|
1565
|
-
pass: isRequired,
|
|
1566
|
-
message: () => {
|
|
1567
|
-
const is = isRequired ? "is" : "is not";
|
|
1568
|
-
return [
|
|
1569
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeRequired`, "element", ""),
|
|
1570
|
-
"",
|
|
1571
|
-
`Received element ${is} required:`,
|
|
1572
|
-
` ${this.utils.printReceived(element.cloneNode(false))}`
|
|
1573
|
-
].join("\n");
|
|
1574
|
-
}
|
|
1575
|
-
};
|
|
1576
|
-
}
|
|
1577
|
-
function isElementHavingAriaInvalid(element) {
|
|
1578
|
-
return element.hasAttribute("aria-invalid") && element.getAttribute("aria-invalid") !== "false";
|
|
1579
|
-
}
|
|
1580
|
-
function isSupportsValidityMethod(element) {
|
|
1581
|
-
return FORM_TAGS.includes(getTag(element));
|
|
1582
|
-
}
|
|
1583
|
-
function isElementInvalid(element) {
|
|
1584
|
-
const isHaveAriaInvalid = isElementHavingAriaInvalid(element);
|
|
1585
|
-
if (isSupportsValidityMethod(element)) return isHaveAriaInvalid || !element.checkValidity();
|
|
1586
|
-
else return isHaveAriaInvalid;
|
|
1587
|
-
}
|
|
1588
|
-
function toBeInvalid(element) {
|
|
1589
|
-
checkHtmlElement(element, toBeInvalid, this);
|
|
1590
|
-
const isInvalid = isElementInvalid(element);
|
|
1591
|
-
return {
|
|
1592
|
-
pass: isInvalid,
|
|
1593
|
-
message: () => {
|
|
1594
|
-
const is = isInvalid ? "is" : "is not";
|
|
1595
|
-
return [
|
|
1596
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeInvalid`, "element", ""),
|
|
1597
|
-
"",
|
|
1598
|
-
`Received element ${is} currently invalid:`,
|
|
1599
|
-
` ${this.utils.printReceived(element.cloneNode(false))}`
|
|
1600
|
-
].join("\n");
|
|
1601
|
-
}
|
|
1602
|
-
};
|
|
1603
|
-
}
|
|
1604
|
-
function toBeValid(element) {
|
|
1605
|
-
checkHtmlElement(element, toBeValid, this);
|
|
1606
|
-
const isValid = !isElementInvalid(element);
|
|
1607
|
-
return {
|
|
1608
|
-
pass: isValid,
|
|
1609
|
-
message: () => {
|
|
1610
|
-
const is = isValid ? "is" : "is not";
|
|
1611
|
-
return [
|
|
1612
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeValid`, "element", ""),
|
|
1613
|
-
"",
|
|
1614
|
-
`Received element ${is} currently valid:`,
|
|
1615
|
-
` ${this.utils.printReceived(element.cloneNode(false))}`
|
|
1616
|
-
].join("\n");
|
|
1617
|
-
}
|
|
1618
|
-
};
|
|
1619
|
-
}
|
|
1620
|
-
function toHaveValue(htmlElement, expectedValue) {
|
|
1621
|
-
checkHtmlElement(htmlElement, toHaveValue, this);
|
|
1622
|
-
if (htmlElement.tagName.toLowerCase() === "input" && ["checkbox", "radio"].includes(htmlElement.type)) throw new Error("input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead");
|
|
1623
|
-
const receivedValue = getSingleElementValue(htmlElement);
|
|
1624
|
-
const expectsValue = expectedValue !== void 0;
|
|
1625
|
-
let expectedTypedValue = expectedValue;
|
|
1626
|
-
let receivedTypedValue = receivedValue;
|
|
1627
|
-
if (expectedValue == receivedValue && expectedValue !== receivedValue) {
|
|
1628
|
-
expectedTypedValue = `${expectedValue} (${typeof expectedValue})`;
|
|
1629
|
-
receivedTypedValue = `${receivedValue} (${typeof receivedValue})`;
|
|
1630
|
-
}
|
|
1631
|
-
return {
|
|
1632
|
-
pass: expectsValue ? compareAsSet(receivedValue, expectedValue) : Boolean(receivedValue),
|
|
1633
|
-
message: () => {
|
|
1634
|
-
const to = this.isNot ? "not to" : "to";
|
|
1635
|
-
const matcher = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveValue`, "element", expectedValue);
|
|
1636
|
-
return getMessage(this, matcher, `Expected the element ${to} have value`, expectsValue ? expectedTypedValue : "(any)", "Received", receivedTypedValue);
|
|
1637
|
-
}
|
|
1638
|
-
};
|
|
1639
|
-
}
|
|
1640
|
-
function toHaveDisplayValue(htmlElement, expectedValue) {
|
|
1641
|
-
checkHtmlElement(htmlElement, toHaveDisplayValue, this);
|
|
1642
|
-
const tagName = htmlElement.tagName.toLowerCase();
|
|
1643
|
-
if (![
|
|
1644
|
-
"select",
|
|
1645
|
-
"input",
|
|
1646
|
-
"textarea"
|
|
1647
|
-
].includes(tagName)) throw new Error(".toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.");
|
|
1648
|
-
if (tagName === "input" && ["radio", "checkbox"].includes(htmlElement.type)) throw new Error(`.toHaveDisplayValue() currently does not support input[type="${htmlElement.type}"], try with another matcher instead.`);
|
|
1649
|
-
const values = getValues(tagName, htmlElement);
|
|
1650
|
-
const expectedValues = getExpectedValues(expectedValue);
|
|
1651
|
-
const numberOfMatchesWithValues = expectedValues.filter((expected) => values.some((value) => expected instanceof RegExp ? expected.test(value) : this.equals(value, String(expected)))).length;
|
|
1652
|
-
const matchedWithAllValues = numberOfMatchesWithValues === values.length;
|
|
1653
|
-
const matchedWithAllExpectedValues = numberOfMatchesWithValues === expectedValues.length;
|
|
1654
|
-
return {
|
|
1655
|
-
pass: matchedWithAllValues && matchedWithAllExpectedValues,
|
|
1656
|
-
message: () => getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveDisplayValue`, "element", ""), `Expected element ${this.isNot ? "not " : ""}to have display value`, expectedValue, "Received", values)
|
|
1657
|
-
};
|
|
1658
|
-
}
|
|
1659
|
-
function getValues(tagName, htmlElement) {
|
|
1660
|
-
return tagName === "select" ? Array.from(htmlElement).filter((option) => option.selected).map((option) => option.textContent) : [htmlElement.value];
|
|
1661
|
-
}
|
|
1662
|
-
function getExpectedValues(expectedValue) {
|
|
1663
|
-
return expectedValue instanceof Array ? expectedValue : [expectedValue];
|
|
1664
|
-
}
|
|
1665
|
-
function toBeChecked(element) {
|
|
1666
|
-
checkHtmlElement(element, toBeChecked, this);
|
|
1667
|
-
const isValidInput = () => {
|
|
1668
|
-
return element.tagName.toLowerCase() === "input" && ["checkbox", "radio"].includes(element.type);
|
|
1669
|
-
};
|
|
1670
|
-
const isValidAriaElement = () => {
|
|
1671
|
-
return roleSupportsChecked(element.getAttribute("role")) && ["true", "false"].includes(element.getAttribute("aria-checked"));
|
|
1672
|
-
};
|
|
1673
|
-
if (!isValidInput() && !isValidAriaElement()) return {
|
|
1674
|
-
pass: false,
|
|
1675
|
-
message: () => `only inputs with type="checkbox" or type="radio" or elements with ${supportedRolesSentence()} and a valid aria-checked attribute can be used with .toBeChecked(). Use .toHaveValue() instead`
|
|
1676
|
-
};
|
|
1677
|
-
const isChecked = () => {
|
|
1678
|
-
if (isValidInput()) return element.checked;
|
|
1679
|
-
return element.getAttribute("aria-checked") === "true";
|
|
1680
|
-
};
|
|
1681
|
-
return {
|
|
1682
|
-
pass: isChecked(),
|
|
1683
|
-
message: () => {
|
|
1684
|
-
const is = isChecked() ? "is" : "is not";
|
|
1685
|
-
return [
|
|
1686
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBeChecked`, "element", ""),
|
|
1687
|
-
"",
|
|
1688
|
-
`Received element ${is} checked:`,
|
|
1689
|
-
` ${this.utils.printReceived(element.cloneNode(false))}`
|
|
1690
|
-
].join("\n");
|
|
1691
|
-
}
|
|
1692
|
-
};
|
|
1693
|
-
}
|
|
1694
|
-
function supportedRolesSentence() {
|
|
1695
|
-
return toSentence(supportedRoles().map((role) => `role="${role}"`), { lastWordConnector: " or " });
|
|
1696
|
-
}
|
|
1697
|
-
function supportedRoles() {
|
|
1698
|
-
return import_lib$1.roles.keys().filter(roleSupportsChecked);
|
|
1699
|
-
}
|
|
1700
|
-
function roleSupportsChecked(role) {
|
|
1701
|
-
return import_lib$1.roles.get(role)?.props["aria-checked"] !== void 0;
|
|
1702
|
-
}
|
|
1703
|
-
function toBePartiallyChecked(element) {
|
|
1704
|
-
checkHtmlElement(element, toBePartiallyChecked, this);
|
|
1705
|
-
const isValidInput = () => {
|
|
1706
|
-
return element.tagName.toLowerCase() === "input" && element.type === "checkbox";
|
|
1707
|
-
};
|
|
1708
|
-
const isValidAriaElement = () => {
|
|
1709
|
-
return element.getAttribute("role") === "checkbox";
|
|
1710
|
-
};
|
|
1711
|
-
if (!isValidInput() && !isValidAriaElement()) return {
|
|
1712
|
-
pass: false,
|
|
1713
|
-
message: () => "only inputs with type=\"checkbox\" or elements with role=\"checkbox\" and a valid aria-checked attribute can be used with .toBePartiallyChecked(). Use .toHaveValue() instead"
|
|
1714
|
-
};
|
|
1715
|
-
const isPartiallyChecked = () => {
|
|
1716
|
-
const isAriaMixed = element.getAttribute("aria-checked") === "mixed";
|
|
1717
|
-
if (isValidInput()) return element.indeterminate || isAriaMixed;
|
|
1718
|
-
return isAriaMixed;
|
|
1719
|
-
};
|
|
1720
|
-
return {
|
|
1721
|
-
pass: isPartiallyChecked(),
|
|
1722
|
-
message: () => {
|
|
1723
|
-
const is = isPartiallyChecked() ? "is" : "is not";
|
|
1724
|
-
return [
|
|
1725
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBePartiallyChecked`, "element", ""),
|
|
1726
|
-
"",
|
|
1727
|
-
`Received element ${is} partially checked:`,
|
|
1728
|
-
` ${this.utils.printReceived(element.cloneNode(false))}`
|
|
1729
|
-
].join("\n");
|
|
1730
|
-
}
|
|
1731
|
-
};
|
|
1732
|
-
}
|
|
1733
|
-
function toHaveDescription(htmlElement, checkWith) {
|
|
1734
|
-
deprecate("toHaveDescription", "Please use toHaveAccessibleDescription.");
|
|
1735
|
-
checkHtmlElement(htmlElement, toHaveDescription, this);
|
|
1736
|
-
const expectsDescription = checkWith !== void 0;
|
|
1737
|
-
const descriptionIDs = (htmlElement.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean);
|
|
1738
|
-
let description = "";
|
|
1739
|
-
if (descriptionIDs.length > 0) {
|
|
1740
|
-
const document = htmlElement.ownerDocument;
|
|
1741
|
-
description = normalize$1(descriptionIDs.map((descriptionID) => document.getElementById(descriptionID)).filter(Boolean).map((el) => el.textContent).join(" "));
|
|
1742
|
-
}
|
|
1743
|
-
return {
|
|
1744
|
-
pass: expectsDescription ? checkWith instanceof RegExp ? checkWith.test(description) : this.equals(description, checkWith) : Boolean(description),
|
|
1745
|
-
message: () => {
|
|
1746
|
-
const to = this.isNot ? "not to" : "to";
|
|
1747
|
-
return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveDescription`, "element", ""), `Expected the element ${to} have description`, this.utils.printExpected(checkWith), "Received", this.utils.printReceived(description));
|
|
1748
|
-
}
|
|
1749
|
-
};
|
|
1750
|
-
}
|
|
1751
|
-
function toHaveErrorMessage(htmlElement, checkWith) {
|
|
1752
|
-
deprecate("toHaveErrorMessage", "Please use toHaveAccessibleErrorMessage.");
|
|
1753
|
-
checkHtmlElement(htmlElement, toHaveErrorMessage, this);
|
|
1754
|
-
if (!htmlElement.hasAttribute("aria-invalid") || htmlElement.getAttribute("aria-invalid") === "false") {
|
|
1755
|
-
const not = this.isNot ? ".not" : "";
|
|
1756
|
-
return {
|
|
1757
|
-
pass: false,
|
|
1758
|
-
message: () => {
|
|
1759
|
-
return getMessage(this, this.utils.matcherHint(`${not}.toHaveErrorMessage`, "element", ""), `Expected the element to have invalid state indicated by`, "aria-invalid=\"true\"", "Received", htmlElement.hasAttribute("aria-invalid") ? `aria-invalid="${htmlElement.getAttribute("aria-invalid")}"` : this.utils.printReceived(""));
|
|
1760
|
-
}
|
|
1761
|
-
};
|
|
1762
|
-
}
|
|
1763
|
-
const expectsErrorMessage = checkWith !== void 0;
|
|
1764
|
-
const errormessageIDs = (htmlElement.getAttribute("aria-errormessage") || "").split(/\s+/).filter(Boolean);
|
|
1765
|
-
let errormessage = "";
|
|
1766
|
-
if (errormessageIDs.length > 0) {
|
|
1767
|
-
const document = htmlElement.ownerDocument;
|
|
1768
|
-
errormessage = normalize$1(errormessageIDs.map((errormessageID) => document.getElementById(errormessageID)).filter(Boolean).map((el) => el.textContent).join(" "));
|
|
1769
|
-
}
|
|
1770
|
-
return {
|
|
1771
|
-
pass: expectsErrorMessage ? checkWith instanceof RegExp ? checkWith.test(errormessage) : this.equals(errormessage, checkWith) : Boolean(errormessage),
|
|
1772
|
-
message: () => {
|
|
1773
|
-
const to = this.isNot ? "not to" : "to";
|
|
1774
|
-
return getMessage(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveErrorMessage`, "element", ""), `Expected the element ${to} have error message`, this.utils.printExpected(checkWith), "Received", this.utils.printReceived(errormessage));
|
|
1775
|
-
}
|
|
1776
|
-
};
|
|
1777
|
-
}
|
|
1778
|
-
/**
|
|
1779
|
-
* Returns the selection from the element.
|
|
1780
|
-
*
|
|
1781
|
-
* @param element {HTMLElement} The element to get the selection from.
|
|
1782
|
-
* @returns {String} The selection.
|
|
1783
|
-
*/
|
|
1784
|
-
function getSelection(element) {
|
|
1785
|
-
const selection = element.ownerDocument.getSelection();
|
|
1786
|
-
if (["input", "textarea"].includes(element.tagName.toLowerCase())) {
|
|
1787
|
-
if (["radio", "checkbox"].includes(element.type)) return "";
|
|
1788
|
-
return element.value.toString().substring(element.selectionStart, element.selectionEnd);
|
|
1789
|
-
}
|
|
1790
|
-
if (selection.anchorNode === null || selection.focusNode === null) return "";
|
|
1791
|
-
const originalRange = selection.getRangeAt(0);
|
|
1792
|
-
const temporaryRange = element.ownerDocument.createRange();
|
|
1793
|
-
if (selection.containsNode(element, false)) {
|
|
1794
|
-
temporaryRange.selectNodeContents(element);
|
|
1795
|
-
selection.removeAllRanges();
|
|
1796
|
-
selection.addRange(temporaryRange);
|
|
1797
|
-
} else if (element.contains(selection.anchorNode) && element.contains(selection.focusNode));
|
|
1798
|
-
else {
|
|
1799
|
-
const selectionStartsWithinElement = element === originalRange.startContainer || element.contains(originalRange.startContainer);
|
|
1800
|
-
const selectionEndsWithinElement = element === originalRange.endContainer || element.contains(originalRange.endContainer);
|
|
1801
|
-
selection.removeAllRanges();
|
|
1802
|
-
if (selectionStartsWithinElement || selectionEndsWithinElement) {
|
|
1803
|
-
temporaryRange.selectNodeContents(element);
|
|
1804
|
-
if (selectionStartsWithinElement) temporaryRange.setStart(originalRange.startContainer, originalRange.startOffset);
|
|
1805
|
-
if (selectionEndsWithinElement) temporaryRange.setEnd(originalRange.endContainer, originalRange.endOffset);
|
|
1806
|
-
selection.addRange(temporaryRange);
|
|
1807
|
-
}
|
|
1808
|
-
}
|
|
1809
|
-
const result = selection.toString();
|
|
1810
|
-
selection.removeAllRanges();
|
|
1811
|
-
selection.addRange(originalRange);
|
|
1812
|
-
return result;
|
|
1813
|
-
}
|
|
1814
|
-
/**
|
|
1815
|
-
* Checks if the element has the string selected.
|
|
1816
|
-
*
|
|
1817
|
-
* @param htmlElement {HTMLElement} The html element to check the selection for.
|
|
1818
|
-
* @param expectedSelection {String} The selection as a string.
|
|
1819
|
-
*/
|
|
1820
|
-
function toHaveSelection(htmlElement, expectedSelection) {
|
|
1821
|
-
checkHtmlElement(htmlElement, toHaveSelection, this);
|
|
1822
|
-
const expectsSelection = expectedSelection !== void 0;
|
|
1823
|
-
if (expectsSelection && typeof expectedSelection !== "string") throw new Error(`expected selection must be a string or undefined`);
|
|
1824
|
-
const receivedSelection = getSelection(htmlElement);
|
|
1825
|
-
return {
|
|
1826
|
-
pass: expectsSelection ? compareAsSet(receivedSelection, expectedSelection) : Boolean(receivedSelection),
|
|
1827
|
-
message: () => {
|
|
1828
|
-
const to = this.isNot ? "not to" : "to";
|
|
1829
|
-
const matcher = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toHaveSelection`, "element", expectedSelection);
|
|
1830
|
-
return getMessage(this, matcher, `Expected the element ${to} have selection`, expectsSelection ? expectedSelection : "(any)", "Received", receivedSelection);
|
|
1831
|
-
}
|
|
1832
|
-
};
|
|
1833
|
-
}
|
|
1834
|
-
function toBePressed(element) {
|
|
1835
|
-
checkHtmlElement(element, toBePressed, this);
|
|
1836
|
-
const roles = (element.getAttribute("role") || "").split(" ").map((role) => role.trim());
|
|
1837
|
-
const isButton = element.tagName.toLowerCase() === "button" || element.tagName.toLowerCase() === "input" && element.type === "button" || roles.includes("button");
|
|
1838
|
-
const pressedAttribute = element.getAttribute("aria-pressed");
|
|
1839
|
-
if (!isButton || !(pressedAttribute === "true" || pressedAttribute === "false")) return {
|
|
1840
|
-
pass: false,
|
|
1841
|
-
message: () => `Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePressed()`
|
|
1842
|
-
};
|
|
1843
|
-
return {
|
|
1844
|
-
pass: isButton && pressedAttribute === "true",
|
|
1845
|
-
message: () => {
|
|
1846
|
-
const matcher = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBePressed`, "element", "");
|
|
1847
|
-
return getMessage(this, matcher, `Expected element to have`, `aria-pressed="${this.isNot ? "false" : "true"}"`, `Received`, `aria-pressed="${pressedAttribute}"`);
|
|
1848
|
-
}
|
|
1849
|
-
};
|
|
1850
|
-
}
|
|
1851
|
-
function toBePartiallyPressed(element) {
|
|
1852
|
-
checkHtmlElement(element, toBePartiallyPressed, this);
|
|
1853
|
-
const roles = (element.getAttribute("role") || "").split(" ").map((role) => role.trim());
|
|
1854
|
-
const isButton = element.tagName.toLowerCase() === "button" || element.tagName.toLowerCase() === "input" && element.type === "button" || roles.includes("button");
|
|
1855
|
-
const pressedAttribute = element.getAttribute("aria-pressed");
|
|
1856
|
-
if (!isButton || !(pressedAttribute === "true" || pressedAttribute === "false" || pressedAttribute === "mixed")) return {
|
|
1857
|
-
pass: false,
|
|
1858
|
-
message: () => `Only button or input with type="button" or element with role="button" and a valid aria-pressed attribute can be used with .toBePartiallyPressed()`
|
|
1859
|
-
};
|
|
1860
|
-
return {
|
|
1861
|
-
pass: isButton && pressedAttribute === "mixed",
|
|
1862
|
-
message: () => {
|
|
1863
|
-
const to = this.isNot ? "not to" : "to";
|
|
1864
|
-
const matcher = this.utils.matcherHint(`${this.isNot ? ".not" : ""}.toBePartiallyPressed`, "element", "");
|
|
1865
|
-
return getMessage(this, matcher, `Expected element ${to} have`, `aria-pressed="mixed"`, `Received`, `aria-pressed="${pressedAttribute}"`);
|
|
1866
|
-
}
|
|
1867
|
-
};
|
|
1868
|
-
}
|
|
1869
|
-
function makeDocumentPositionErrorString(documentPosition) {
|
|
1870
|
-
if (documentPosition in DOCUMENT_POSITIONS_STRINGS) return `${DOCUMENT_POSITIONS_STRINGS[documentPosition]} (${documentPosition})`;
|
|
1871
|
-
return `Unknown document position (${documentPosition})`;
|
|
1872
|
-
}
|
|
1873
|
-
function checkToAppear(methodName, targetDocumentPosition) {
|
|
1874
|
-
return function(element, secondElement) {
|
|
1875
|
-
checkHtmlElement(element, toAppearBefore, this);
|
|
1876
|
-
checkHtmlElement(secondElement, toAppearBefore, this);
|
|
1877
|
-
const documentPosition = element.compareDocumentPosition(secondElement);
|
|
1878
|
-
return {
|
|
1879
|
-
pass: documentPosition === targetDocumentPosition,
|
|
1880
|
-
message: () => {
|
|
1881
|
-
return [
|
|
1882
|
-
this.utils.matcherHint(`${this.isNot ? ".not" : ""}.${methodName}`, "element", "secondElement"),
|
|
1883
|
-
"",
|
|
1884
|
-
`Received: ${makeDocumentPositionErrorString(documentPosition)}`
|
|
1885
|
-
].join("\n");
|
|
1886
|
-
}
|
|
1887
|
-
};
|
|
1888
|
-
};
|
|
1889
|
-
}
|
|
1890
|
-
function toAppearBefore(element, secondElement) {
|
|
1891
|
-
return checkToAppear("toAppearBefore", DOCUMENT_POSITION_FOLLOWING).apply(this, [element, secondElement]);
|
|
1892
|
-
}
|
|
1893
|
-
function toAppearAfter(element, secondElement) {
|
|
1894
|
-
return checkToAppear("toAppearAfter", DOCUMENT_POSITION_PRECEDING).apply(this, [element, secondElement]);
|
|
1895
|
-
}
|
|
1896
|
-
var import_redent$1, import_lib$1, import_picocolors_browser, import_css_escape$1, GenericTypeError, HtmlElementTypeError, NodeTypeError, InvalidCSSError, rolesSupportingValues, ariaInvalidName, validStates, elementRoleList, FORM_TAGS$2, FORM_TAGS$1, ARIA_FORM_TAGS, UNSUPPORTED_INPUT_TYPES, SUPPORTED_ARIA_ROLES, FORM_TAGS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_PRECEDING, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITIONS_STRINGS;
|
|
1897
|
-
function init_matchers_35e4d3bd() {
|
|
1898
|
-
return (init_matchers_35e4d3bd = __esmMin((() => {
|
|
1899
|
-
import_redent$1 = /* @__PURE__ */ __toESM(require_redent(), 1);
|
|
1900
|
-
init_adobe_css_tools();
|
|
1901
|
-
init_dist();
|
|
1902
|
-
import_lib$1 = require_lib();
|
|
1903
|
-
import_picocolors_browser = /* @__PURE__ */ __toESM(require_picocolors_browser(), 1);
|
|
1904
|
-
import_css_escape$1 = /* @__PURE__ */ __toESM(require_css_escape(), 1);
|
|
1905
|
-
GenericTypeError = class extends Error {
|
|
1906
|
-
constructor(expectedString, received, matcherFn, context) {
|
|
1907
|
-
super();
|
|
1908
|
-
/* istanbul ignore next */
|
|
1909
|
-
if (Error.captureStackTrace) Error.captureStackTrace(this, matcherFn);
|
|
1910
|
-
let withType = "";
|
|
1911
|
-
try {
|
|
1912
|
-
withType = context.utils.printWithType("Received", received, context.utils.printReceived);
|
|
1913
|
-
} catch (e) {}
|
|
1914
|
-
this.message = [
|
|
1915
|
-
context.utils.matcherHint(`${context.isNot ? ".not" : ""}.${matcherFn.name}`, "received", ""),
|
|
1916
|
-
"",
|
|
1917
|
-
`${context.utils.RECEIVED_COLOR("received")} value must ${expectedString}.`,
|
|
1918
|
-
withType
|
|
1919
|
-
].join("\n");
|
|
1920
|
-
}
|
|
1921
|
-
};
|
|
1922
|
-
HtmlElementTypeError = class extends GenericTypeError {
|
|
1923
|
-
constructor(...args) {
|
|
1924
|
-
super("be an HTMLElement or an SVGElement", ...args);
|
|
1925
|
-
}
|
|
1926
|
-
};
|
|
1927
|
-
NodeTypeError = class extends GenericTypeError {
|
|
1928
|
-
constructor(...args) {
|
|
1929
|
-
super("be a Node", ...args);
|
|
1930
|
-
}
|
|
1931
|
-
};
|
|
1932
|
-
InvalidCSSError = class extends Error {
|
|
1933
|
-
constructor(received, matcherFn, context) {
|
|
1934
|
-
super();
|
|
1935
|
-
/* istanbul ignore next */
|
|
1936
|
-
if (Error.captureStackTrace) Error.captureStackTrace(this, matcherFn);
|
|
1937
|
-
this.message = [
|
|
1938
|
-
received.message,
|
|
1939
|
-
"",
|
|
1940
|
-
context.utils.RECEIVED_COLOR(`Failing css:`),
|
|
1941
|
-
context.utils.RECEIVED_COLOR(`${received.css}`)
|
|
1942
|
-
].join("\n");
|
|
1943
|
-
}
|
|
1944
|
-
};
|
|
1945
|
-
rolesSupportingValues = [
|
|
1946
|
-
"meter",
|
|
1947
|
-
"progressbar",
|
|
1948
|
-
"slider",
|
|
1949
|
-
"spinbutton"
|
|
1950
|
-
];
|
|
1951
|
-
ariaInvalidName = "aria-invalid";
|
|
1952
|
-
validStates = ["false"];
|
|
1953
|
-
elementRoleList = buildElementRoleList(import_lib$1.elementRoles);
|
|
1954
|
-
FORM_TAGS$2 = [
|
|
1955
|
-
"fieldset",
|
|
1956
|
-
"input",
|
|
1957
|
-
"select",
|
|
1958
|
-
"optgroup",
|
|
1959
|
-
"option",
|
|
1960
|
-
"button",
|
|
1961
|
-
"textarea"
|
|
1962
|
-
];
|
|
1963
|
-
FORM_TAGS$1 = ["select", "textarea"];
|
|
1964
|
-
ARIA_FORM_TAGS = [
|
|
1965
|
-
"input",
|
|
1966
|
-
"select",
|
|
1967
|
-
"textarea"
|
|
1968
|
-
];
|
|
1969
|
-
UNSUPPORTED_INPUT_TYPES = [
|
|
1970
|
-
"color",
|
|
1971
|
-
"hidden",
|
|
1972
|
-
"range",
|
|
1973
|
-
"submit",
|
|
1974
|
-
"image",
|
|
1975
|
-
"reset"
|
|
1976
|
-
];
|
|
1977
|
-
SUPPORTED_ARIA_ROLES = [
|
|
1978
|
-
"checkbox",
|
|
1979
|
-
"combobox",
|
|
1980
|
-
"gridcell",
|
|
1981
|
-
"listbox",
|
|
1982
|
-
"radiogroup",
|
|
1983
|
-
"spinbutton",
|
|
1984
|
-
"textbox",
|
|
1985
|
-
"tree"
|
|
1986
|
-
];
|
|
1987
|
-
FORM_TAGS = [
|
|
1988
|
-
"form",
|
|
1989
|
-
"input",
|
|
1990
|
-
"select",
|
|
1991
|
-
"textarea"
|
|
1992
|
-
];
|
|
1993
|
-
DOCUMENT_POSITION_DISCONNECTED = 1;
|
|
1994
|
-
DOCUMENT_POSITION_PRECEDING = 2;
|
|
1995
|
-
DOCUMENT_POSITION_FOLLOWING = 4;
|
|
1996
|
-
DOCUMENT_POSITION_CONTAINS = 8;
|
|
1997
|
-
DOCUMENT_POSITION_CONTAINED_BY = 16;
|
|
1998
|
-
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
|
|
1999
|
-
DOCUMENT_POSITIONS_STRINGS = {
|
|
2000
|
-
[DOCUMENT_POSITION_DISCONNECTED]: "Node.DOCUMENT_POSITION_DISCONNECTED",
|
|
2001
|
-
[DOCUMENT_POSITION_PRECEDING]: "Node.DOCUMENT_POSITION_PRECEDING",
|
|
2002
|
-
[DOCUMENT_POSITION_FOLLOWING]: "Node.DOCUMENT_POSITION_FOLLOWING",
|
|
2003
|
-
[DOCUMENT_POSITION_CONTAINS]: "Node.DOCUMENT_POSITION_CONTAINS",
|
|
2004
|
-
[DOCUMENT_POSITION_CONTAINED_BY]: "Node.DOCUMENT_POSITION_CONTAINED_BY",
|
|
2005
|
-
[DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC]: "Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC"
|
|
2006
|
-
};
|
|
2007
|
-
})))();
|
|
2008
|
-
}
|
|
2009
|
-
//#endregion
|
|
2010
|
-
//#region ../../node_modules/@testing-library/jest-dom/dist/matchers.mjs
|
|
2011
|
-
var matchers_exports = /* @__PURE__ */ __exportAll({
|
|
2012
|
-
toAppearAfter: () => toAppearAfter,
|
|
2013
|
-
toAppearBefore: () => toAppearBefore,
|
|
2014
|
-
toBeChecked: () => toBeChecked,
|
|
2015
|
-
toBeDisabled: () => toBeDisabled,
|
|
2016
|
-
toBeEmpty: () => toBeEmpty,
|
|
2017
|
-
toBeEmptyDOMElement: () => toBeEmptyDOMElement,
|
|
2018
|
-
toBeEnabled: () => toBeEnabled,
|
|
2019
|
-
toBeInTheDOM: () => toBeInTheDOM,
|
|
2020
|
-
toBeInTheDocument: () => toBeInTheDocument,
|
|
2021
|
-
toBeInvalid: () => toBeInvalid,
|
|
2022
|
-
toBePartiallyChecked: () => toBePartiallyChecked,
|
|
2023
|
-
toBePartiallyPressed: () => toBePartiallyPressed,
|
|
2024
|
-
toBePressed: () => toBePressed,
|
|
2025
|
-
toBeRequired: () => toBeRequired,
|
|
2026
|
-
toBeValid: () => toBeValid,
|
|
2027
|
-
toBeVisible: () => toBeVisible,
|
|
2028
|
-
toContainElement: () => toContainElement,
|
|
2029
|
-
toContainHTML: () => toContainHTML,
|
|
2030
|
-
toHaveAccessibleDescription: () => toHaveAccessibleDescription,
|
|
2031
|
-
toHaveAccessibleErrorMessage: () => toHaveAccessibleErrorMessage,
|
|
2032
|
-
toHaveAccessibleName: () => toHaveAccessibleName,
|
|
2033
|
-
toHaveAttribute: () => toHaveAttribute,
|
|
2034
|
-
toHaveClass: () => toHaveClass,
|
|
2035
|
-
toHaveDescription: () => toHaveDescription,
|
|
2036
|
-
toHaveDisplayValue: () => toHaveDisplayValue,
|
|
2037
|
-
toHaveErrorMessage: () => toHaveErrorMessage,
|
|
2038
|
-
toHaveFocus: () => toHaveFocus,
|
|
2039
|
-
toHaveFormValues: () => toHaveFormValues,
|
|
2040
|
-
toHaveRole: () => toHaveRole,
|
|
2041
|
-
toHaveSelection: () => toHaveSelection,
|
|
2042
|
-
toHaveStyle: () => toHaveStyle,
|
|
2043
|
-
toHaveTextContent: () => toHaveTextContent,
|
|
2044
|
-
toHaveValue: () => toHaveValue
|
|
2045
|
-
});
|
|
2046
|
-
function init_matchers() {
|
|
2047
|
-
return (init_matchers = __esmMin((() => {
|
|
2048
|
-
init_matchers_35e4d3bd();
|
|
2049
|
-
require_redent();
|
|
2050
|
-
init_dist();
|
|
2051
|
-
require_lib();
|
|
2052
|
-
require_css_escape();
|
|
2053
|
-
})))();
|
|
2054
|
-
}
|
|
2055
|
-
//#endregion
|
|
2056
|
-
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/isElementType.js
|
|
1
|
+
import { n as __esmMin, r as __exportAll } from "./globals-runtime-BdGkqNEt.js";
|
|
2
|
+
import { n as getConfig, r as init_dom_esm } from "./globals-runtime-CvyFEPIY.js";
|
|
3
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/misc/isElementType.js
|
|
2057
4
|
function isElementType(element, tag, props) {
|
|
2058
5
|
if (element.namespaceURI && element.namespaceURI !== "http://www.w3.org/1999/xhtml") return false;
|
|
2059
6
|
tag = Array.isArray(tag) ? tag : [tag];
|
|
@@ -2062,7 +9,7 @@ function isElementType(element, tag, props) {
|
|
|
2062
9
|
return true;
|
|
2063
10
|
}
|
|
2064
11
|
//#endregion
|
|
2065
|
-
//#region
|
|
12
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/misc/getWindow.js
|
|
2066
13
|
function getWindow(node) {
|
|
2067
14
|
var _node_ownerDocument;
|
|
2068
15
|
if (isDocument$1(node) && node.defaultView) return node.defaultView;
|
|
@@ -2076,7 +23,7 @@ function describe(val) {
|
|
|
2076
23
|
return typeof val === "function" ? `function ${val.name}` : val === null ? "null" : String(val);
|
|
2077
24
|
}
|
|
2078
25
|
//#endregion
|
|
2079
|
-
//#region
|
|
26
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/Blob.js
|
|
2080
27
|
function readBlobText(blob, FileReader) {
|
|
2081
28
|
return new Promise((res, rej) => {
|
|
2082
29
|
const fr = new FileReader();
|
|
@@ -2089,7 +36,7 @@ function readBlobText(blob, FileReader) {
|
|
|
2089
36
|
});
|
|
2090
37
|
}
|
|
2091
38
|
//#endregion
|
|
2092
|
-
//#region
|
|
39
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/FileList.js
|
|
2093
40
|
function createFileList(window, files) {
|
|
2094
41
|
const list = {
|
|
2095
42
|
...files,
|
|
@@ -2105,7 +52,7 @@ function createFileList(window, files) {
|
|
|
2105
52
|
return list;
|
|
2106
53
|
}
|
|
2107
54
|
//#endregion
|
|
2108
|
-
//#region
|
|
55
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/DataTransfer.js
|
|
2109
56
|
function _define_property$8(obj, key, value) {
|
|
2110
57
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
2111
58
|
value,
|
|
@@ -2216,7 +163,7 @@ function init_DataTransfer() {
|
|
|
2216
163
|
})))();
|
|
2217
164
|
}
|
|
2218
165
|
//#endregion
|
|
2219
|
-
//#region
|
|
166
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/Clipboard.js
|
|
2220
167
|
function _define_property$7(obj, key, value) {
|
|
2221
168
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
2222
169
|
value,
|
|
@@ -2340,7 +287,7 @@ function init_Clipboard() {
|
|
|
2340
287
|
})))();
|
|
2341
288
|
}
|
|
2342
289
|
//#endregion
|
|
2343
|
-
//#region
|
|
290
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/focus/selector.js
|
|
2344
291
|
var FOCUSABLE_SELECTOR;
|
|
2345
292
|
function init_selector() {
|
|
2346
293
|
return (init_selector = __esmMin((() => {
|
|
@@ -2358,7 +305,7 @@ function init_selector() {
|
|
|
2358
305
|
})))();
|
|
2359
306
|
}
|
|
2360
307
|
//#endregion
|
|
2361
|
-
//#region
|
|
308
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/focus/isFocusable.js
|
|
2362
309
|
function isFocusable(element) {
|
|
2363
310
|
return element.matches(FOCUSABLE_SELECTOR);
|
|
2364
311
|
}
|
|
@@ -2368,12 +315,12 @@ function init_isFocusable() {
|
|
|
2368
315
|
})))();
|
|
2369
316
|
}
|
|
2370
317
|
//#endregion
|
|
2371
|
-
//#region
|
|
318
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/misc/cloneEvent.js
|
|
2372
319
|
function cloneEvent(event) {
|
|
2373
320
|
return new event.constructor(event.type, event);
|
|
2374
321
|
}
|
|
2375
322
|
//#endregion
|
|
2376
|
-
//#region
|
|
323
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/misc/isDisabled.js
|
|
2377
324
|
function isDisabled(element) {
|
|
2378
325
|
for (let el = element; el; el = el.parentElement) if (isElementType(el, [
|
|
2379
326
|
"button",
|
|
@@ -2396,7 +343,7 @@ function init_isDisabled() {
|
|
|
2396
343
|
return (init_isDisabled = __esmMin((() => {})))();
|
|
2397
344
|
}
|
|
2398
345
|
//#endregion
|
|
2399
|
-
//#region
|
|
346
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/focus/getActiveElement.js
|
|
2400
347
|
function getActiveElement(document) {
|
|
2401
348
|
const activeElement = document.activeElement;
|
|
2402
349
|
if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.shadowRoot) {
|
|
@@ -2416,7 +363,7 @@ function init_getActiveElement() {
|
|
|
2416
363
|
})))();
|
|
2417
364
|
}
|
|
2418
365
|
//#endregion
|
|
2419
|
-
//#region
|
|
366
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/misc/findClosest.js
|
|
2420
367
|
function findClosest(element, callback) {
|
|
2421
368
|
let el = element;
|
|
2422
369
|
do {
|
|
@@ -2425,7 +372,7 @@ function findClosest(element, callback) {
|
|
|
2425
372
|
} while (el && el !== element.ownerDocument.body);
|
|
2426
373
|
}
|
|
2427
374
|
//#endregion
|
|
2428
|
-
//#region
|
|
375
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/edit/isContentEditable.js
|
|
2429
376
|
function isContentEditable(element) {
|
|
2430
377
|
return element.hasAttribute("contenteditable") && (element.getAttribute("contenteditable") == "true" || element.getAttribute("contenteditable") == "");
|
|
2431
378
|
}
|
|
@@ -2439,7 +386,7 @@ function getElement$1(node) {
|
|
|
2439
386
|
return node.nodeType === 1 ? node : node.parentElement;
|
|
2440
387
|
}
|
|
2441
388
|
//#endregion
|
|
2442
|
-
//#region
|
|
389
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/click/isClickableInput.js
|
|
2443
390
|
function isClickableInput(element) {
|
|
2444
391
|
return isElementType(element, "button") || isElementType(element, "input") && element.type in clickableInputTypes;
|
|
2445
392
|
}
|
|
@@ -2460,7 +407,7 @@ function init_isClickableInput() {
|
|
|
2460
407
|
})))();
|
|
2461
408
|
}
|
|
2462
409
|
//#endregion
|
|
2463
|
-
//#region
|
|
410
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/edit/isEditable.js
|
|
2464
411
|
function isEditable(element) {
|
|
2465
412
|
return isEditableInputOrTextArea(element) && !element.readOnly || isContentEditable(element);
|
|
2466
413
|
}
|
|
@@ -2488,7 +435,7 @@ function init_isEditable() {
|
|
|
2488
435
|
})))();
|
|
2489
436
|
}
|
|
2490
437
|
//#endregion
|
|
2491
|
-
//#region
|
|
438
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/focus/selection.js
|
|
2492
439
|
/**
|
|
2493
440
|
* Determine if the element has its own selection implementation
|
|
2494
441
|
* and does not interact with the Document Selection API.
|
|
@@ -2508,7 +455,7 @@ function init_selection() {
|
|
|
2508
455
|
})))();
|
|
2509
456
|
}
|
|
2510
457
|
//#endregion
|
|
2511
|
-
//#region
|
|
458
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/selection/updateSelectionOnFocus.js
|
|
2512
459
|
/**
|
|
2513
460
|
* Reset the Document Selection when moving focus into an element
|
|
2514
461
|
* with own selection implementation.
|
|
@@ -2533,7 +480,7 @@ function init_updateSelectionOnFocus() {
|
|
|
2533
480
|
})))();
|
|
2534
481
|
}
|
|
2535
482
|
//#endregion
|
|
2536
|
-
//#region
|
|
483
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/wrapEvent.js
|
|
2537
484
|
function wrapEvent(cb, _element) {
|
|
2538
485
|
return getConfig().eventWrapper(cb);
|
|
2539
486
|
}
|
|
@@ -2543,7 +490,7 @@ function init_wrapEvent() {
|
|
|
2543
490
|
})))();
|
|
2544
491
|
}
|
|
2545
492
|
//#endregion
|
|
2546
|
-
//#region
|
|
493
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/focus.js
|
|
2547
494
|
/**
|
|
2548
495
|
* Focus closest focusable element.
|
|
2549
496
|
*/ function focusElement(element) {
|
|
@@ -2569,7 +516,7 @@ function init_focus() {
|
|
|
2569
516
|
})))();
|
|
2570
517
|
}
|
|
2571
518
|
//#endregion
|
|
2572
|
-
//#region
|
|
519
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/behavior/registry.js
|
|
2573
520
|
var behavior;
|
|
2574
521
|
function init_registry() {
|
|
2575
522
|
return (init_registry = __esmMin((() => {
|
|
@@ -2577,7 +524,7 @@ function init_registry() {
|
|
|
2577
524
|
})))();
|
|
2578
525
|
}
|
|
2579
526
|
//#endregion
|
|
2580
|
-
//#region
|
|
527
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/behavior/click.js
|
|
2581
528
|
function init_click() {
|
|
2582
529
|
return (init_click = __esmMin((() => {
|
|
2583
530
|
init_Clipboard();
|
|
@@ -2602,7 +549,7 @@ function init_click() {
|
|
|
2602
549
|
})))();
|
|
2603
550
|
}
|
|
2604
551
|
//#endregion
|
|
2605
|
-
//#region
|
|
552
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/document/UI.js
|
|
2606
553
|
function isUIValue(value) {
|
|
2607
554
|
return typeof value === "object" && UIValue in value;
|
|
2608
555
|
}
|
|
@@ -2673,7 +620,7 @@ function init_UI() {
|
|
|
2673
620
|
})))();
|
|
2674
621
|
}
|
|
2675
622
|
//#endregion
|
|
2676
|
-
//#region
|
|
623
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/edit/timeValue.js
|
|
2677
624
|
function buildTimeValue(value) {
|
|
2678
625
|
const onlyDigitsValue = value.replace(/\D/g, "");
|
|
2679
626
|
if (onlyDigitsValue.length < 2) return value;
|
|
@@ -2708,7 +655,7 @@ function init_timeValue() {
|
|
|
2708
655
|
})))();
|
|
2709
656
|
}
|
|
2710
657
|
//#endregion
|
|
2711
|
-
//#region
|
|
658
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/edit/maxLength.js
|
|
2712
659
|
function getMaxLength(element) {
|
|
2713
660
|
var _element_getAttribute;
|
|
2714
661
|
const attr = (_element_getAttribute = element.getAttribute("maxlength")) !== null && _element_getAttribute !== void 0 ? _element_getAttribute : "";
|
|
@@ -2732,7 +679,7 @@ function init_maxLength() {
|
|
|
2732
679
|
})))();
|
|
2733
680
|
}
|
|
2734
681
|
//#endregion
|
|
2735
|
-
//#region
|
|
682
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/focus/cursor.js
|
|
2736
683
|
function getNextCursorPosition(node, offset, direction, inputType) {
|
|
2737
684
|
if (isTextNode(node) && offset + direction >= 0 && offset + direction <= node.nodeValue.length) return {
|
|
2738
685
|
node,
|
|
@@ -2816,7 +763,7 @@ function init_cursor() {
|
|
|
2816
763
|
return (init_cursor = __esmMin((() => {})))();
|
|
2817
764
|
}
|
|
2818
765
|
//#endregion
|
|
2819
|
-
//#region
|
|
766
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/document/trackValue.js
|
|
2820
767
|
function isReact17Element(element) {
|
|
2821
768
|
return Object.getOwnPropertyNames(element).some((k) => k.startsWith("__react")) && getWindow(element).REACT_VERSION === 17;
|
|
2822
769
|
}
|
|
@@ -2853,7 +800,7 @@ function init_trackValue() {
|
|
|
2853
800
|
})))();
|
|
2854
801
|
}
|
|
2855
802
|
//#endregion
|
|
2856
|
-
//#region
|
|
803
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/selection/getTargetTypeAndSelection.js
|
|
2857
804
|
/**
|
|
2858
805
|
* Determine which selection logic and selection ranges to consider.
|
|
2859
806
|
*/ function getTargetTypeAndSelection(node) {
|
|
@@ -2879,7 +826,7 @@ function init_getTargetTypeAndSelection() {
|
|
|
2879
826
|
})))();
|
|
2880
827
|
}
|
|
2881
828
|
//#endregion
|
|
2882
|
-
//#region
|
|
829
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/selection/getInputRange.js
|
|
2883
830
|
/**
|
|
2884
831
|
* Get the range that would be overwritten by input.
|
|
2885
832
|
*/ function getInputRange(focusNode) {
|
|
@@ -2896,7 +843,7 @@ function init_getInputRange() {
|
|
|
2896
843
|
})))();
|
|
2897
844
|
}
|
|
2898
845
|
//#endregion
|
|
2899
|
-
//#region
|
|
846
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/selection/setSelection.js
|
|
2900
847
|
/**
|
|
2901
848
|
* Set the selection
|
|
2902
849
|
*/ function setSelection({ focusNode, focusOffset, anchorNode = focusNode, anchorOffset = focusOffset }) {
|
|
@@ -2915,7 +862,7 @@ function init_setSelection() {
|
|
|
2915
862
|
})))();
|
|
2916
863
|
}
|
|
2917
864
|
//#endregion
|
|
2918
|
-
//#region
|
|
865
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/input.js
|
|
2919
866
|
function isDateOrTime(element) {
|
|
2920
867
|
return isElementType(element, "input") && ["date", "time"].includes(element.type);
|
|
2921
868
|
}
|
|
@@ -3034,7 +981,7 @@ function init_input() {
|
|
|
3034
981
|
})))();
|
|
3035
982
|
}
|
|
3036
983
|
//#endregion
|
|
3037
|
-
//#region
|
|
984
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/behavior/cut.js
|
|
3038
985
|
function init_cut() {
|
|
3039
986
|
return (init_cut = __esmMin((() => {
|
|
3040
987
|
init_Clipboard();
|
|
@@ -3049,7 +996,7 @@ function init_cut() {
|
|
|
3049
996
|
})))();
|
|
3050
997
|
}
|
|
3051
998
|
//#endregion
|
|
3052
|
-
//#region
|
|
999
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/document/getValueOrTextContent.js
|
|
3053
1000
|
function getValueOrTextContent(element) {
|
|
3054
1001
|
// istanbul ignore if
|
|
3055
1002
|
if (!element) return null;
|
|
@@ -3063,7 +1010,7 @@ function init_getValueOrTextContent() {
|
|
|
3063
1010
|
})))();
|
|
3064
1011
|
}
|
|
3065
1012
|
//#endregion
|
|
3066
|
-
//#region
|
|
1013
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/misc/isVisible.js
|
|
3067
1014
|
function isVisible(element) {
|
|
3068
1015
|
const window = getWindow(element);
|
|
3069
1016
|
for (let el = element; el === null || el === void 0 ? void 0 : el.ownerDocument; el = el.parentElement) {
|
|
@@ -3077,7 +1024,7 @@ function init_isVisible() {
|
|
|
3077
1024
|
return (init_isVisible = __esmMin((() => {})))();
|
|
3078
1025
|
}
|
|
3079
1026
|
//#endregion
|
|
3080
|
-
//#region
|
|
1027
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/focus/getTabDestination.js
|
|
3081
1028
|
function getTabDestination(activeElement, shift) {
|
|
3082
1029
|
const document = activeElement.ownerDocument;
|
|
3083
1030
|
const focusableElements = document.querySelectorAll(FOCUSABLE_SELECTOR);
|
|
@@ -3128,7 +1075,7 @@ function init_getTabDestination() {
|
|
|
3128
1075
|
})))();
|
|
3129
1076
|
}
|
|
3130
1077
|
//#endregion
|
|
3131
|
-
//#region
|
|
1078
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/selection/moveSelection.js
|
|
3132
1079
|
/**
|
|
3133
1080
|
* Move the selection
|
|
3134
1081
|
*/ function moveSelection(node, direction) {
|
|
@@ -3160,7 +1107,7 @@ function init_moveSelection() {
|
|
|
3160
1107
|
})))();
|
|
3161
1108
|
}
|
|
3162
1109
|
//#endregion
|
|
3163
|
-
//#region
|
|
1110
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/selection/selectAll.js
|
|
3164
1111
|
/**
|
|
3165
1112
|
* Expand a selection like the browser does when pressing Ctrl+A.
|
|
3166
1113
|
*/ function selectAll(target) {
|
|
@@ -3193,7 +1140,7 @@ function init_selectAll() {
|
|
|
3193
1140
|
})))();
|
|
3194
1141
|
}
|
|
3195
1142
|
//#endregion
|
|
3196
|
-
//#region
|
|
1143
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/selection/setSelectionRange.js
|
|
3197
1144
|
/**
|
|
3198
1145
|
* Backward-compatible selection.
|
|
3199
1146
|
*
|
|
@@ -3220,7 +1167,7 @@ function init_setSelectionRange() {
|
|
|
3220
1167
|
})))();
|
|
3221
1168
|
}
|
|
3222
1169
|
//#endregion
|
|
3223
|
-
//#region
|
|
1170
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/radio.js
|
|
3224
1171
|
function walkRadio(instance, el, direction) {
|
|
3225
1172
|
const window = getWindow(el);
|
|
3226
1173
|
const group = Array.from(el.ownerDocument.querySelectorAll(el.name ? `input[type="radio"][name="${window.CSS.escape(el.name)}"]` : `input[type="radio"][name=""], input[type="radio"]:not([name])`));
|
|
@@ -3241,7 +1188,7 @@ function init_radio() {
|
|
|
3241
1188
|
})))();
|
|
3242
1189
|
}
|
|
3243
1190
|
//#endregion
|
|
3244
|
-
//#region
|
|
1191
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/behavior/keydown.js
|
|
3245
1192
|
var keydownBehavior, combinationBehavior;
|
|
3246
1193
|
function init_keydown() {
|
|
3247
1194
|
return (init_keydown = __esmMin((() => {
|
|
@@ -3329,7 +1276,7 @@ function init_keydown() {
|
|
|
3329
1276
|
})))();
|
|
3330
1277
|
}
|
|
3331
1278
|
//#endregion
|
|
3332
|
-
//#region
|
|
1279
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/behavior/keypress.js
|
|
3333
1280
|
var ClickInputOnEnter, SubmitSingleInputOnEnter;
|
|
3334
1281
|
function init_keypress() {
|
|
3335
1282
|
return (init_keypress = __esmMin((() => {
|
|
@@ -3377,7 +1324,7 @@ function init_keypress() {
|
|
|
3377
1324
|
})))();
|
|
3378
1325
|
}
|
|
3379
1326
|
//#endregion
|
|
3380
|
-
//#region
|
|
1327
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/behavior/keyup.js
|
|
3381
1328
|
var keyupBehavior;
|
|
3382
1329
|
function init_keyup() {
|
|
3383
1330
|
return (init_keyup = __esmMin((() => {
|
|
@@ -3394,7 +1341,7 @@ function init_keyup() {
|
|
|
3394
1341
|
})))();
|
|
3395
1342
|
}
|
|
3396
1343
|
//#endregion
|
|
3397
|
-
//#region
|
|
1344
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/behavior/paste.js
|
|
3398
1345
|
function init_paste() {
|
|
3399
1346
|
return (init_paste = __esmMin((() => {
|
|
3400
1347
|
init_Clipboard();
|
|
@@ -3411,7 +1358,7 @@ function init_paste() {
|
|
|
3411
1358
|
})))();
|
|
3412
1359
|
}
|
|
3413
1360
|
//#endregion
|
|
3414
|
-
//#region
|
|
1361
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/eventMap.js
|
|
3415
1362
|
function getEventClass(type) {
|
|
3416
1363
|
return eventMap[type].EventType;
|
|
3417
1364
|
}
|
|
@@ -3690,7 +1637,7 @@ function init_eventMap() {
|
|
|
3690
1637
|
})))();
|
|
3691
1638
|
}
|
|
3692
1639
|
//#endregion
|
|
3693
|
-
//#region
|
|
1640
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/createEvent.js
|
|
3694
1641
|
function createEvent(type, target, init) {
|
|
3695
1642
|
const window = getWindow(target);
|
|
3696
1643
|
const { EventType, defaultInit } = eventMap[type];
|
|
@@ -3855,7 +1802,7 @@ function init_createEvent() {
|
|
|
3855
1802
|
})))();
|
|
3856
1803
|
}
|
|
3857
1804
|
//#endregion
|
|
3858
|
-
//#region
|
|
1805
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/dispatchEvent.js
|
|
3859
1806
|
function dispatchUIEvent(target, type, init, preventDefault = false) {
|
|
3860
1807
|
if (isMouseEvent(type) || isKeyboardEvent(type)) init = {
|
|
3861
1808
|
...init,
|
|
@@ -3900,7 +1847,7 @@ function init_dispatchEvent() {
|
|
|
3900
1847
|
})))();
|
|
3901
1848
|
}
|
|
3902
1849
|
//#endregion
|
|
3903
|
-
//#region
|
|
1850
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/document/patchFocus.js
|
|
3904
1851
|
function patchFocus(HTMLElement) {
|
|
3905
1852
|
if (HTMLElement.prototype[patched]) return;
|
|
3906
1853
|
const { focus, blur } = HTMLElement.prototype;
|
|
@@ -3966,7 +1913,7 @@ function init_patchFocus() {
|
|
|
3966
1913
|
})))();
|
|
3967
1914
|
}
|
|
3968
1915
|
//#endregion
|
|
3969
|
-
//#region
|
|
1916
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/document/interceptor.js
|
|
3970
1917
|
function prepareInterceptor(element, propName, interceptorImpl) {
|
|
3971
1918
|
const prototypeDescriptor = Object.getOwnPropertyDescriptor(element.constructor.prototype, propName);
|
|
3972
1919
|
const objectDescriptor = Object.getOwnPropertyDescriptor(element, propName);
|
|
@@ -4052,7 +1999,7 @@ function init_interceptor() {
|
|
|
4052
1999
|
})))();
|
|
4053
2000
|
}
|
|
4054
2001
|
//#endregion
|
|
4055
|
-
//#region
|
|
2002
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/document/prepareDocument.js
|
|
4056
2003
|
function prepareDocument(document) {
|
|
4057
2004
|
if (document[isPrepared]) return;
|
|
4058
2005
|
document.addEventListener("focus", (e) => {
|
|
@@ -4098,7 +2045,7 @@ function init_prepareDocument() {
|
|
|
4098
2045
|
})))();
|
|
4099
2046
|
}
|
|
4100
2047
|
//#endregion
|
|
4101
|
-
//#region
|
|
2048
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/misc/getDocumentFromNode.js
|
|
4102
2049
|
function getDocumentFromNode(el) {
|
|
4103
2050
|
return isDocument(el) ? el : el.ownerDocument;
|
|
4104
2051
|
}
|
|
@@ -4106,7 +2053,7 @@ function isDocument(node) {
|
|
|
4106
2053
|
return node.nodeType === 9;
|
|
4107
2054
|
}
|
|
4108
2055
|
//#endregion
|
|
4109
|
-
//#region
|
|
2056
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/misc/level.js
|
|
4110
2057
|
function setLevelRef(instance, level) {
|
|
4111
2058
|
instance.levelRefs[level] = {};
|
|
4112
2059
|
}
|
|
@@ -4124,14 +2071,14 @@ function init_level() {
|
|
|
4124
2071
|
})))();
|
|
4125
2072
|
}
|
|
4126
2073
|
//#endregion
|
|
4127
|
-
//#region
|
|
2074
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/misc/wait.js
|
|
4128
2075
|
function wait(config) {
|
|
4129
2076
|
const delay = config.delay;
|
|
4130
2077
|
if (typeof delay !== "number") return;
|
|
4131
2078
|
return Promise.all([new Promise((resolve) => globalThis.setTimeout(() => resolve(), delay)), config.advanceTimers(delay)]);
|
|
4132
2079
|
}
|
|
4133
2080
|
//#endregion
|
|
4134
|
-
//#region
|
|
2081
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/options.js
|
|
4135
2082
|
var PointerEventsCheckLevel;
|
|
4136
2083
|
function init_options() {
|
|
4137
2084
|
return (init_options = __esmMin((() => {
|
|
@@ -4148,7 +2095,7 @@ function init_options() {
|
|
|
4148
2095
|
})))();
|
|
4149
2096
|
}
|
|
4150
2097
|
//#endregion
|
|
4151
|
-
//#region
|
|
2098
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/system/keyboard.js
|
|
4152
2099
|
function _define_property$6(obj, key, value) {
|
|
4153
2100
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
4154
2101
|
value,
|
|
@@ -4298,7 +2245,7 @@ function init_keyboard() {
|
|
|
4298
2245
|
})))();
|
|
4299
2246
|
}
|
|
4300
2247
|
//#endregion
|
|
4301
|
-
//#region
|
|
2248
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/keyboard/keyMap.js
|
|
4302
2249
|
var defaultKeyMap$1;
|
|
4303
2250
|
function init_keyMap() {
|
|
4304
2251
|
return (init_keyMap = __esmMin((() => {
|
|
@@ -4470,7 +2417,7 @@ function init_keyMap() {
|
|
|
4470
2417
|
})))();
|
|
4471
2418
|
}
|
|
4472
2419
|
//#endregion
|
|
4473
|
-
//#region
|
|
2420
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/pointer/keyMap.js
|
|
4474
2421
|
var defaultKeyMap;
|
|
4475
2422
|
function init_keyMap$1() {
|
|
4476
2423
|
return (init_keyMap$1 = __esmMin((() => {
|
|
@@ -4506,7 +2453,7 @@ function init_keyMap$1() {
|
|
|
4506
2453
|
})))();
|
|
4507
2454
|
}
|
|
4508
2455
|
//#endregion
|
|
4509
|
-
//#region
|
|
2456
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/system/pointer/buttons.js
|
|
4510
2457
|
function _define_property$5(obj, key, value) {
|
|
4511
2458
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
4512
2459
|
value,
|
|
@@ -4574,7 +2521,7 @@ function init_buttons() {
|
|
|
4574
2521
|
})))();
|
|
4575
2522
|
}
|
|
4576
2523
|
//#endregion
|
|
4577
|
-
//#region
|
|
2524
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/system/pointer/device.js
|
|
4578
2525
|
function _define_property$4(obj, key, value) {
|
|
4579
2526
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
4580
2527
|
value,
|
|
@@ -4608,7 +2555,7 @@ function init_device() {
|
|
|
4608
2555
|
})))();
|
|
4609
2556
|
}
|
|
4610
2557
|
//#endregion
|
|
4611
|
-
//#region
|
|
2558
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/misc/getTreeDiff.js
|
|
4612
2559
|
function getTreeDiff(a, b) {
|
|
4613
2560
|
const treeA = [];
|
|
4614
2561
|
for (let el = a; el; el = el.parentElement) treeA.push(el);
|
|
@@ -4623,7 +2570,7 @@ function getTreeDiff(a, b) {
|
|
|
4623
2570
|
];
|
|
4624
2571
|
}
|
|
4625
2572
|
//#endregion
|
|
4626
|
-
//#region
|
|
2573
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/selection/resolveCaretPosition.js
|
|
4627
2574
|
function resolveCaretPosition({ target, node, offset }) {
|
|
4628
2575
|
if (hasOwnSelection(target)) return {
|
|
4629
2576
|
node: target,
|
|
@@ -4665,7 +2612,7 @@ function init_resolveCaretPosition() {
|
|
|
4665
2612
|
})))();
|
|
4666
2613
|
}
|
|
4667
2614
|
//#endregion
|
|
4668
|
-
//#region
|
|
2615
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/selection/setSelectionPerMouse.js
|
|
4669
2616
|
function setSelectionPerMouseDown({ document, target, clickCount, node, offset }) {
|
|
4670
2617
|
if (hasNoSelection(target)) return;
|
|
4671
2618
|
const targetHasOwnSelection = hasOwnSelection(target);
|
|
@@ -4720,7 +2667,7 @@ function init_setSelectionPerMouse() {
|
|
|
4720
2667
|
})))();
|
|
4721
2668
|
}
|
|
4722
2669
|
//#endregion
|
|
4723
|
-
//#region
|
|
2670
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/event/selection/modifySelectionPerMouse.js
|
|
4724
2671
|
function modifySelectionPerMouseMove(selectionRange, { document, target, node, offset }) {
|
|
4725
2672
|
const selectionFocus = resolveCaretPosition({
|
|
4726
2673
|
target,
|
|
@@ -4754,13 +2701,13 @@ function init_modifySelectionPerMouse() {
|
|
|
4754
2701
|
})))();
|
|
4755
2702
|
}
|
|
4756
2703
|
//#endregion
|
|
4757
|
-
//#region
|
|
2704
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/system/pointer/shared.js
|
|
4758
2705
|
function isDifferentPointerPosition(positionA, positionB) {
|
|
4759
2706
|
var _positionA_coords, _positionB_coords, _positionA_coords1, _positionB_coords1, _positionA_coords2, _positionB_coords2, _positionA_coords3, _positionB_coords3, _positionA_coords4, _positionB_coords4, _positionA_coords5, _positionB_coords5, _positionA_coords6, _positionB_coords6, _positionA_coords7, _positionB_coords7, _positionA_coords8, _positionB_coords8, _positionA_coords9, _positionB_coords9, _positionA_caret, _positionB_caret, _positionA_caret1, _positionB_caret1;
|
|
4760
2707
|
return positionA.target !== positionB.target || ((_positionA_coords = positionA.coords) === null || _positionA_coords === void 0 ? void 0 : _positionA_coords.x) !== ((_positionB_coords = positionB.coords) === null || _positionB_coords === void 0 ? void 0 : _positionB_coords.x) || ((_positionA_coords1 = positionA.coords) === null || _positionA_coords1 === void 0 ? void 0 : _positionA_coords1.y) !== ((_positionB_coords1 = positionB.coords) === null || _positionB_coords1 === void 0 ? void 0 : _positionB_coords1.y) || ((_positionA_coords2 = positionA.coords) === null || _positionA_coords2 === void 0 ? void 0 : _positionA_coords2.clientX) !== ((_positionB_coords2 = positionB.coords) === null || _positionB_coords2 === void 0 ? void 0 : _positionB_coords2.clientX) || ((_positionA_coords3 = positionA.coords) === null || _positionA_coords3 === void 0 ? void 0 : _positionA_coords3.clientY) !== ((_positionB_coords3 = positionB.coords) === null || _positionB_coords3 === void 0 ? void 0 : _positionB_coords3.clientY) || ((_positionA_coords4 = positionA.coords) === null || _positionA_coords4 === void 0 ? void 0 : _positionA_coords4.offsetX) !== ((_positionB_coords4 = positionB.coords) === null || _positionB_coords4 === void 0 ? void 0 : _positionB_coords4.offsetX) || ((_positionA_coords5 = positionA.coords) === null || _positionA_coords5 === void 0 ? void 0 : _positionA_coords5.offsetY) !== ((_positionB_coords5 = positionB.coords) === null || _positionB_coords5 === void 0 ? void 0 : _positionB_coords5.offsetY) || ((_positionA_coords6 = positionA.coords) === null || _positionA_coords6 === void 0 ? void 0 : _positionA_coords6.pageX) !== ((_positionB_coords6 = positionB.coords) === null || _positionB_coords6 === void 0 ? void 0 : _positionB_coords6.pageX) || ((_positionA_coords7 = positionA.coords) === null || _positionA_coords7 === void 0 ? void 0 : _positionA_coords7.pageY) !== ((_positionB_coords7 = positionB.coords) === null || _positionB_coords7 === void 0 ? void 0 : _positionB_coords7.pageY) || ((_positionA_coords8 = positionA.coords) === null || _positionA_coords8 === void 0 ? void 0 : _positionA_coords8.screenX) !== ((_positionB_coords8 = positionB.coords) === null || _positionB_coords8 === void 0 ? void 0 : _positionB_coords8.screenX) || ((_positionA_coords9 = positionA.coords) === null || _positionA_coords9 === void 0 ? void 0 : _positionA_coords9.screenY) !== ((_positionB_coords9 = positionB.coords) === null || _positionB_coords9 === void 0 ? void 0 : _positionB_coords9.screenY) || ((_positionA_caret = positionA.caret) === null || _positionA_caret === void 0 ? void 0 : _positionA_caret.node) !== ((_positionB_caret = positionB.caret) === null || _positionB_caret === void 0 ? void 0 : _positionB_caret.node) || ((_positionA_caret1 = positionA.caret) === null || _positionA_caret1 === void 0 ? void 0 : _positionA_caret1.offset) !== ((_positionB_caret1 = positionB.caret) === null || _positionB_caret1 === void 0 ? void 0 : _positionB_caret1.offset);
|
|
4761
2708
|
}
|
|
4762
2709
|
//#endregion
|
|
4763
|
-
//#region
|
|
2710
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/system/pointer/mouse.js
|
|
4764
2711
|
function _define_property$3(obj, key, value) {
|
|
4765
2712
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
4766
2713
|
value,
|
|
@@ -4924,7 +2871,7 @@ function init_mouse() {
|
|
|
4924
2871
|
})))();
|
|
4925
2872
|
}
|
|
4926
2873
|
//#endregion
|
|
4927
|
-
//#region
|
|
2874
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/pointer/cssPointerEvents.js
|
|
4928
2875
|
function hasPointerEvents(instance, element) {
|
|
4929
2876
|
var _checkPointerEvents;
|
|
4930
2877
|
return ((_checkPointerEvents = checkPointerEvents(instance, element)) === null || _checkPointerEvents === void 0 ? void 0 : _checkPointerEvents.pointerEvents) !== "none";
|
|
@@ -5009,7 +2956,7 @@ function init_cssPointerEvents() {
|
|
|
5009
2956
|
})))();
|
|
5010
2957
|
}
|
|
5011
2958
|
//#endregion
|
|
5012
|
-
//#region
|
|
2959
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/system/pointer/pointer.js
|
|
5013
2960
|
function _define_property$2(obj, key, value) {
|
|
5014
2961
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
5015
2962
|
value,
|
|
@@ -5124,7 +3071,7 @@ function init_pointer() {
|
|
|
5124
3071
|
})))();
|
|
5125
3072
|
}
|
|
5126
3073
|
//#endregion
|
|
5127
|
-
//#region
|
|
3074
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/system/pointer/index.js
|
|
5128
3075
|
function _define_property$1(obj, key, value) {
|
|
5129
3076
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
5130
3077
|
value,
|
|
@@ -5257,7 +3204,7 @@ function init_pointer$1() {
|
|
|
5257
3204
|
})))();
|
|
5258
3205
|
}
|
|
5259
3206
|
//#endregion
|
|
5260
|
-
//#region
|
|
3207
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/system/index.js
|
|
5261
3208
|
function _define_property(obj, key, value) {
|
|
5262
3209
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
5263
3210
|
value,
|
|
@@ -5298,7 +3245,7 @@ function init_system() {
|
|
|
5298
3245
|
})))();
|
|
5299
3246
|
}
|
|
5300
3247
|
//#endregion
|
|
5301
|
-
//#region
|
|
3248
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/convenience/click.js
|
|
5302
3249
|
async function click$1(element) {
|
|
5303
3250
|
const pointerIn = [];
|
|
5304
3251
|
if (!this.config.skipHover) pointerIn.push({ target: element });
|
|
@@ -5315,7 +3262,7 @@ async function tripleClick$1(element) {
|
|
|
5315
3262
|
return this.pointer([{ target: element }, "[MouseLeft][MouseLeft][MouseLeft]"]);
|
|
5316
3263
|
}
|
|
5317
3264
|
//#endregion
|
|
5318
|
-
//#region
|
|
3265
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/convenience/hover.js
|
|
5319
3266
|
async function hover$1(element) {
|
|
5320
3267
|
return this.pointer({ target: element });
|
|
5321
3268
|
}
|
|
@@ -5330,12 +3277,12 @@ function init_hover() {
|
|
|
5330
3277
|
})))();
|
|
5331
3278
|
}
|
|
5332
3279
|
//#endregion
|
|
5333
|
-
//#region
|
|
3280
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/convenience/tab.js
|
|
5334
3281
|
async function tab$1({ shift } = {}) {
|
|
5335
3282
|
return this.keyboard(shift === true ? "{Shift>}{Tab}{/Shift}" : shift === false ? "[/ShiftLeft][/ShiftRight]{Tab}" : "{Tab}");
|
|
5336
3283
|
}
|
|
5337
3284
|
//#endregion
|
|
5338
|
-
//#region
|
|
3285
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/keyDef/readNextDescriptor.js
|
|
5339
3286
|
/**
|
|
5340
3287
|
* Read the next key definition from user input
|
|
5341
3288
|
*
|
|
@@ -5420,7 +3367,7 @@ function init_readNextDescriptor() {
|
|
|
5420
3367
|
})))();
|
|
5421
3368
|
}
|
|
5422
3369
|
//#endregion
|
|
5423
|
-
//#region
|
|
3370
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/keyboard/parseKeyDef.js
|
|
5424
3371
|
/**
|
|
5425
3372
|
* Parse key definitions per `keyboardMap`
|
|
5426
3373
|
*
|
|
@@ -5466,7 +3413,7 @@ function init_parseKeyDef() {
|
|
|
5466
3413
|
})))();
|
|
5467
3414
|
}
|
|
5468
3415
|
//#endregion
|
|
5469
|
-
//#region
|
|
3416
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/keyboard/index.js
|
|
5470
3417
|
async function keyboard$1(text) {
|
|
5471
3418
|
const actions = parseKeyDef$1(this.config.keyboardMap, text);
|
|
5472
3419
|
for (let i = 0; i < actions.length; i++) {
|
|
@@ -5495,7 +3442,7 @@ function init_keyboard$1() {
|
|
|
5495
3442
|
})))();
|
|
5496
3443
|
}
|
|
5497
3444
|
//#endregion
|
|
5498
|
-
//#region
|
|
3445
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/document/copySelection.js
|
|
5499
3446
|
function copySelection(target) {
|
|
5500
3447
|
const data = hasOwnSelection(target) ? { "text/plain": readSelectedValueFromInput(target) } : { "text/plain": String(target.ownerDocument.getSelection()) };
|
|
5501
3448
|
const dt = createDataTransfer(getWindow(target));
|
|
@@ -5515,7 +3462,7 @@ function init_copySelection() {
|
|
|
5515
3462
|
})))();
|
|
5516
3463
|
}
|
|
5517
3464
|
//#endregion
|
|
5518
|
-
//#region
|
|
3465
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/clipboard/copy.js
|
|
5519
3466
|
async function copy$1() {
|
|
5520
3467
|
var _doc_activeElement;
|
|
5521
3468
|
const doc = this.config.document;
|
|
@@ -5532,7 +3479,7 @@ function init_copy() {
|
|
|
5532
3479
|
})))();
|
|
5533
3480
|
}
|
|
5534
3481
|
//#endregion
|
|
5535
|
-
//#region
|
|
3482
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/clipboard/cut.js
|
|
5536
3483
|
async function cut$1() {
|
|
5537
3484
|
var _doc_activeElement;
|
|
5538
3485
|
const doc = this.config.document;
|
|
@@ -5549,7 +3496,7 @@ function init_cut$1() {
|
|
|
5549
3496
|
})))();
|
|
5550
3497
|
}
|
|
5551
3498
|
//#endregion
|
|
5552
|
-
//#region
|
|
3499
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/clipboard/paste.js
|
|
5553
3500
|
async function paste$1(clipboardData) {
|
|
5554
3501
|
var _doc_activeElement, _ref;
|
|
5555
3502
|
const doc = this.config.document;
|
|
@@ -5571,7 +3518,7 @@ function init_paste$1() {
|
|
|
5571
3518
|
})))();
|
|
5572
3519
|
}
|
|
5573
3520
|
//#endregion
|
|
5574
|
-
//#region
|
|
3521
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/pointer/parseKeyDef.js
|
|
5575
3522
|
function parseKeyDef(pointerMap, keys) {
|
|
5576
3523
|
const defs = [];
|
|
5577
3524
|
do {
|
|
@@ -5593,7 +3540,7 @@ function init_parseKeyDef$1() {
|
|
|
5593
3540
|
})))();
|
|
5594
3541
|
}
|
|
5595
3542
|
//#endregion
|
|
5596
|
-
//#region
|
|
3543
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/pointer/index.js
|
|
5597
3544
|
async function pointer$1(input) {
|
|
5598
3545
|
const { pointerMap } = this.config;
|
|
5599
3546
|
const actions = [];
|
|
@@ -5659,7 +3606,7 @@ function init_pointer$2() {
|
|
|
5659
3606
|
})))();
|
|
5660
3607
|
}
|
|
5661
3608
|
//#endregion
|
|
5662
|
-
//#region
|
|
3609
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utility/clear.js
|
|
5663
3610
|
async function clear$1(element) {
|
|
5664
3611
|
if (!isEditable(element) || isDisabled(element)) throw new Error("clear()` is only supported on editable elements.");
|
|
5665
3612
|
focusElement(element);
|
|
@@ -5686,7 +3633,7 @@ function init_clear() {
|
|
|
5686
3633
|
})))();
|
|
5687
3634
|
}
|
|
5688
3635
|
//#endregion
|
|
5689
|
-
//#region
|
|
3636
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utility/selectOptions.js
|
|
5690
3637
|
async function selectOptions$1(select, values) {
|
|
5691
3638
|
return selectOptionsBase.call(this, true, select, values);
|
|
5692
3639
|
}
|
|
@@ -5775,7 +3722,7 @@ function init_selectOptions() {
|
|
|
5775
3722
|
})))();
|
|
5776
3723
|
}
|
|
5777
3724
|
//#endregion
|
|
5778
|
-
//#region
|
|
3725
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utility/type.js
|
|
5779
3726
|
async function type$1(element, text, { skipClick = this.config.skipClick, skipAutoClose = this.config.skipAutoClose, initialSelectionStart, initialSelectionEnd } = {}) {
|
|
5780
3727
|
if (element.disabled) return;
|
|
5781
3728
|
if (!skipClick) await this.click(element);
|
|
@@ -5791,7 +3738,7 @@ function init_type() {
|
|
|
5791
3738
|
})))();
|
|
5792
3739
|
}
|
|
5793
3740
|
//#endregion
|
|
5794
|
-
//#region
|
|
3741
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utils/edit/setFiles.js
|
|
5795
3742
|
function restoreProperty(obj, prop, descriptor) {
|
|
5796
3743
|
if (descriptor) Object.defineProperty(obj, prop, descriptor);
|
|
5797
3744
|
else delete obj[prop];
|
|
@@ -5843,7 +3790,7 @@ function init_setFiles() {
|
|
|
5843
3790
|
})))();
|
|
5844
3791
|
}
|
|
5845
3792
|
//#endregion
|
|
5846
|
-
//#region
|
|
3793
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/utility/upload.js
|
|
5847
3794
|
async function upload$1(element, fileOrFiles) {
|
|
5848
3795
|
const input = isElementType(element, "label") ? element.control : element;
|
|
5849
3796
|
if (!input || !isElementType(input, "input", { type: "file" })) throw new TypeError(`The ${input === element ? "given" : "associated"} ${input === null || input === void 0 ? void 0 : input.tagName} element does not accept file uploads`);
|
|
@@ -5887,7 +3834,7 @@ function init_upload() {
|
|
|
5887
3834
|
})))();
|
|
5888
3835
|
}
|
|
5889
3836
|
//#endregion
|
|
5890
|
-
//#region
|
|
3837
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/setup/api.js
|
|
5891
3838
|
var userEventApi;
|
|
5892
3839
|
function init_api() {
|
|
5893
3840
|
return (init_api = __esmMin((() => {
|
|
@@ -5922,7 +3869,7 @@ function init_api() {
|
|
|
5922
3869
|
})))();
|
|
5923
3870
|
}
|
|
5924
3871
|
//#endregion
|
|
5925
|
-
//#region
|
|
3872
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/setup/wrapAsync.js
|
|
5926
3873
|
/**
|
|
5927
3874
|
* Wrap an internal Promise
|
|
5928
3875
|
*/ function wrapAsync(implementation) {
|
|
@@ -5934,7 +3881,7 @@ function init_wrapAsync() {
|
|
|
5934
3881
|
})))();
|
|
5935
3882
|
}
|
|
5936
3883
|
//#endregion
|
|
5937
|
-
//#region
|
|
3884
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/setup/setup.js
|
|
5938
3885
|
function createConfig(options = {}, defaults = defaultOptionsSetup, node) {
|
|
5939
3886
|
const document = getDocument(options, node, defaults);
|
|
5940
3887
|
return {
|
|
@@ -6044,7 +3991,7 @@ function init_setup() {
|
|
|
6044
3991
|
})))();
|
|
6045
3992
|
}
|
|
6046
3993
|
//#endregion
|
|
6047
|
-
//#region
|
|
3994
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/setup/directApi.js
|
|
6048
3995
|
var directApi_exports = /* @__PURE__ */ __exportAll({
|
|
6049
3996
|
clear: () => clear,
|
|
6050
3997
|
click: () => click,
|
|
@@ -6121,7 +4068,7 @@ function init_directApi() {
|
|
|
6121
4068
|
})))();
|
|
6122
4069
|
}
|
|
6123
4070
|
//#endregion
|
|
6124
|
-
//#region
|
|
4071
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/setup/index.js
|
|
6125
4072
|
var userEvent;
|
|
6126
4073
|
function init_setup$1() {
|
|
6127
4074
|
return (init_setup$1 = __esmMin((() => {
|
|
@@ -6134,11 +4081,11 @@ function init_setup$1() {
|
|
|
6134
4081
|
})))();
|
|
6135
4082
|
}
|
|
6136
4083
|
//#endregion
|
|
6137
|
-
//#region
|
|
4084
|
+
//#region ../node_modules/@testing-library/user-event/dist/esm/index.js
|
|
6138
4085
|
function init_esm() {
|
|
6139
4086
|
return (init_esm = __esmMin((() => {
|
|
6140
4087
|
init_setup$1();
|
|
6141
4088
|
})))();
|
|
6142
4089
|
}
|
|
6143
4090
|
//#endregion
|
|
6144
|
-
export {
|
|
4091
|
+
export { init_setup$1 as n, userEvent as r, init_esm as t };
|