@cloudflare/kumo 2.13.2 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +2 -2
- package/ai/component-registry.json +548 -8
- package/ai/component-registry.md +853 -19
- package/ai/schemas.ts +90 -2
- package/dist/.build-complete +1 -1
- package/dist/ai/schemas.d.ts +311 -69
- package/dist/ai/schemas.js +185 -23
- package/dist/catalog.d.ts +11 -11
- package/dist/chunks/{AlertDialogTrigger-k3f8nevrda6awa4s.js → AlertDialogTrigger-dkihgpvj12si73w3.js} +5 -5
- package/dist/chunks/{AutocompleteItem-ksckpihly1c23f3j.js → AutocompleteItem-drxau0wm3735nihq.js} +17 -29
- package/dist/chunks/AutocompleteSeparator-hqtaxxxye1rfezfg.js +12 -0
- package/dist/chunks/{Button-oczevl8g75m85ew9.js → Button-ccl5r1xlbe3gh998.js} +3 -3
- package/dist/chunks/{CSPContext-guqghj8kxoukvlky.js → CSPContext-ctyrgg64girv38ls.js} +1 -7
- package/dist/chunks/{CSPProvider-f3it239kgztzgryk.js → CSPProvider-p9ensukmowjpkgc0.js} +2 -2
- package/dist/chunks/{CheckboxGroup-g5xn5gnq8ocqyoum.js → CheckboxGroup-knvypu2d1s0iz86k.js} +63 -45
- package/dist/chunks/{CheckboxGroupContext-f9wox07n2u5moq4h.js → CheckboxGroupContext-lgc9dwxou662i6zo.js} +3 -5
- package/dist/chunks/{CheckboxRoot-o5bfpje6e4p6pdgm.js → CheckboxIndicator-n982pbktfkxsa5zz.js} +128 -132
- package/dist/chunks/{CollapsiblePanel-e80n35tnsb2cskt9.js → CollapsiblePanel-jm0ni90g7wz7ppkc.js} +33 -36
- package/dist/chunks/{ComboboxClear-glm805v81uaaf3su.js → ComboboxClear-c2kvjkh9yc6xfl38.js} +83 -98
- package/dist/chunks/{ComboboxEmpty-hwv2kjxnf9un635e.js → ComboboxEmpty-o0q20j2l2syar9kx.js} +662 -586
- package/dist/chunks/{ComboboxPopup-fx7xex6g75t9u0gm.js → ComboboxPopup-oxgggc2wxy6bfmru.js} +57 -57
- package/dist/chunks/{CompositeItem-l7zee38lq5m224d5.js → CompositeItem-hzuk5x3e5zsfgnyj.js} +4 -7
- package/dist/chunks/CompositeList-lbr4enu6yzek7oa9.js +180 -0
- package/dist/chunks/{CompositeListContext-oetjj2x8li8678as.js → CompositeListContext-m9frxn53kkmr23d0.js} +2 -5
- package/dist/chunks/{CompositeRoot-l6ot8jo0umdics5m.js → CompositeRoot-g72lchaerolf5dc9.js} +61 -63
- package/dist/chunks/{CompositeRootContext-ofhzmevv7hadjhyy.js → CompositeRootContext-ixz4myr7uwvavx6w.js} +1 -1
- package/dist/chunks/DialogHandle-klk7uo1q1y8ghyx5.js +68 -0
- package/dist/chunks/{DialogPopup-mp89aob2nown2akq.js → DialogPopup-olsvyf7ulia6ekb1.js} +28 -71
- package/dist/chunks/DialogRoot-hl3genvzl9h8ridm.js +16 -0
- package/dist/chunks/{DialogTrigger-cmok07cf3ks0kzug.js → DialogTrigger-g44cuem7n4wez533.js} +23 -20
- package/dist/chunks/DialogViewport-e1tqfisqexc7o9z8.js +42 -0
- package/dist/chunks/{DirectionContext-jc1g0w645603sd6p.js → DirectionContext-opvqcb794uxicri4.js} +1 -4
- package/dist/chunks/{DirectionProvider-ihtfgxd5qpm6oth1.js → DirectionProvider-er2gibtc9a1f0kep.js} +2 -2
- package/dist/chunks/DrawerViewport-eqzib92gukr4qap3.js +1483 -0
- package/dist/chunks/{FieldControl-oz007qbkl6ejp7di.js → FieldControl-c5sahhd5xg3nr2x7.js} +58 -31
- package/dist/chunks/{FieldDescription-ju607ea6gwgzga8p.js → FieldDescription-ldfiii5bvssfib3d.js} +13 -12
- package/dist/chunks/{FieldItemContext-j85dc0ihramj5ezs.js → FieldItemContext-kpsmvqm5a98m8zpx.js} +1 -1
- package/dist/chunks/FieldLabel-j9teqs9f1exqv346.js +351 -0
- package/dist/chunks/{FieldsetLegend-j5piwq1giyhrr8s4.js → FieldsetLegend-jyy40ylt2ynkvgob.js} +7 -14
- package/dist/chunks/{FieldsetRootContext-b633e9uzilttuyfi.js → FieldsetRootContext-7nlstw7wronafxhw.js} +1 -1
- package/dist/chunks/{FloatingPortalLite-mlt7ztrvhzepwi5y.js → FloatingPortalLite-da0wdcmem7ahkle6.js} +3 -3
- package/dist/chunks/{FloatingTree-oosjswl1s9q4obvg.js → FloatingTree-lhdqtlu8s6m66n7l.js} +6 -6
- package/dist/chunks/Form-fjfbann47c7ws316.js +113 -0
- package/dist/chunks/{FormContext-xz0b4h7ue30fkkn1.js → FormContext-bsu99v8i8pwu1yxc.js} +4 -3
- package/dist/chunks/{Input-ovqfhsmpfcrg5czm.js → Input-irwtufp5t73pwnoj.js} +2 -2
- package/dist/chunks/{LabelableContext-hetas2e4y0kywfas.js → LabelableContext-ccxbhu73vrk089m1.js} +18 -45
- package/dist/chunks/ListboxSeparator-nfyv54r2v5qtmosj.js +21 -0
- package/dist/chunks/{MenuBackdrop-dlntmavtopj7wv0l.js → MenuBackdrop-ouznwyglg27bosoj.js} +7 -12
- package/dist/chunks/{MenuSubmenuTrigger-fzubf5xr7ohsgsi7.js → MenuSubmenuTrigger-mbbda6ucik6nphbq.js} +378 -292
- package/dist/chunks/{MenuTrigger-ntugq34yppc8ouwe.js → MenuTrigger-disngqnt74owi30p.js} +32 -41
- package/dist/chunks/{Menubar-d57cyjuztbge4dvv.js → Menubar-fluuxyn8c2zuz5pr.js} +12 -23
- package/dist/chunks/{MenubarContext-ei2r6vu6lmsspozo.js → MenubarContext-blatefsj42br7jh8.js} +1 -1
- package/dist/chunks/{MeterLabel-c40b0q8r81cftkjj.js → MeterLabel-k6no448jvaidaptf.js} +15 -18
- package/dist/chunks/NullStore-jwgpmovsgl47g9bv.js +109 -0
- package/dist/chunks/{PopoverClose-e91n3nkw16qnyese.js → PopoverClose-kpyt8hbqc52lnjb8.js} +183 -190
- package/dist/chunks/PrehydrationScript-j6zlrxmojrqni6b9.js +63 -0
- package/dist/chunks/{RadioGroup-lsix4haqxfigpuv8.js → RadioGroup-pok1e5qbnbujrz1e.js} +38 -35
- package/dist/chunks/{RadioGroupContext-ft0nndmzqynjz8a2.js → RadioGroupContext-galfnl2el7y2krov.js} +1 -1
- package/dist/chunks/{RadioIndicator-mwkahpwyqfc6yk1i.js → RadioIndicator-jd511oajbwmyjxbg.js} +49 -102
- package/dist/chunks/{ScrollAreaThumb-kmhan411yxfo0362.js → ScrollAreaThumb-eed3hf0pmrblshfw.js} +298 -385
- package/dist/chunks/{SelectGroupLabel-m4h5hrft9043nsd1.js → SelectSeparator-mrjooj7vmjez6fua.js} +447 -502
- package/dist/chunks/{Separator-b8wf5rea6m1cei8k.js → Separator-bcm4ezllqxvtpvuj.js} +2 -2
- package/dist/chunks/{SwitchRoot-e3hnyh3mf8qd30hj.js → SwitchRoot-gahuqddsq1s55p8m.js} +40 -85
- package/dist/chunks/{TabsList-c0inft3sf8gi2o4v.js → TabsList-ebl0v8gu8wn28zss.js} +204 -175
- package/dist/chunks/{Toggle-c8p9m3puz8l4mav7.js → Toggle-mbshs50266z9hgxp.js} +12 -13
- package/dist/chunks/{ToggleGroup-xz9zrh7t1htn6ht4.js → ToggleGroup-k2caz2ghv6zbzp5l.js} +13 -38
- package/dist/chunks/{ToggleGroupContext-cdk2zo6ciddpockn.js → ToggleGroupContext-h4v7jaf77rp2xng9.js} +3 -5
- package/dist/chunks/{ToolbarGroupContext-nriz3632ymugfj6h.js → ToolbarGroupContext-e5cg7needj0edodc.js} +3 -5
- package/dist/chunks/{ToolbarInput-er5t9irqvuwcjrir.js → ToolbarInput-i4h95tes75w0p5y2.js} +28 -33
- package/dist/chunks/{ToolbarRootContext-lvi96r1vvs93rhde.js → ToolbarRootContext-eqk40r8uh4h6r211.js} +1 -1
- package/dist/chunks/{TooltipPopup-l2zrbjavf1cqclfx.js → TooltipPopup-dm4y0hbdeylzp22y.js} +125 -127
- package/dist/chunks/{TooltipProvider-eyhgia63aq2x4frl.js → TooltipProvider-h40qf9wcn0atj15v.js} +14 -17
- package/dist/chunks/adaptiveOriginMiddleware-b8ztjthe278xq7lm.js +51 -0
- package/dist/chunks/{addEventListener-lhqvk2ahlzjsanyg.js → addEventListener-l40nxvf06iukgvnj.js} +1 -1
- package/dist/chunks/areArraysEqual-bcx201k1x9ziizym.js +15 -0
- package/dist/chunks/{autocomplete-dn6g4rc8bktdl4an.js → autocomplete-m6h1pbygknrz5div.js} +7 -7
- package/dist/chunks/{badge-xw5ydgdjx2o5qxbl.js → badge-dq8bx752b9dp7dst.js} +2 -1
- package/dist/chunks/{banner-n1ekcvrwashsgv93.js → banner-msnmqm7of2lck01x.js} +2 -2
- package/dist/chunks/{breadcrumbs-ffwe8tzqzmpyikq5.js → breadcrumbs-lhi1qrdh74mb4zsx.js} +4 -3
- package/dist/chunks/button-group-i9dh83xutyuxyry7.js +59 -0
- package/dist/chunks/{button-h36q7tklakhd38nx.js → button-pa1bq9b85hawg41a.js} +1 -1
- package/dist/chunks/{chart-qmls2klknm1pd6hs.js → chart-kd1xd6crso2i956o.js} +936 -49
- package/dist/chunks/{checkbox-jachq6akfh72x12r.js → checkbox-lbo436duy7krxcsk.js} +6 -7
- package/dist/chunks/clamp-jcjhzx71s6wt1rnc.js +7 -0
- package/dist/chunks/{clipboard-text-ms46uaujvkjmjnng.js → clipboard-text-gd6s3n1bqse9zgt8.js} +5 -5
- package/dist/chunks/{collapsible-jyajpe40jcca357s.js → collapsible-l8g94on4w7qfosmn.js} +1 -1
- package/dist/chunks/{combobox-hxarufzb1z61xnbv.js → combobox-hdxtsm2gqcxxgfju.js} +12 -11
- package/dist/chunks/{command-palette-iomiziccabzh4ogg.js → command-palette-crtm3nd32yjhuax1.js} +7 -7
- package/dist/chunks/{composite-o65hjzwwzb4kvl4w.js → composite-ab8dmdfoj6tmhcn1.js} +9 -21
- package/dist/chunks/{constants-j09lrtg73n4vlx5x.js → constants-flxfd6q03phtu007.js} +1 -1
- package/dist/chunks/{core-kjfqbvgicl9i3abf.js → core-n0de50o00ej2ecfe.js} +69 -55
- package/dist/chunks/createBaseUIEventDetails-3ob3qgs95ffm8l0w.js +49 -0
- package/dist/chunks/{ComboboxChipRemove-ksyozjezihhstmbu.js → createItems-b8n8vigg5nak6j9s.js} +113 -57
- package/dist/chunks/{createToastManager-kv89sv0xhhsvmq54.js → createToastManager-onmoqrmr8zo02rif.js} +305 -357
- package/dist/chunks/{css-d3t41yfupsmz7l1a.js → css-j501gxq1am2gnikh.js} +1 -1
- package/dist/chunks/{date-picker-fwe3vllwco4u1utz.js → date-picker-cotkexrpqu5tjikv.js} +54 -49
- package/dist/chunks/{date-range-picker-iymdx410i1hpvxai.js → date-range-picker-i6d8y1yemm7x5ins.js} +15 -14
- package/dist/chunks/{dialog-o0164pgcyc74lvp9.js → dialog-glpnivujociqs9lh.js} +13 -10
- package/dist/chunks/{dropdown-d5qrzj1w1a96w2we.js → dropdown-m53ji1d66mws89wh.js} +4 -4
- package/dist/chunks/{empty-ox60d384lkwbj5n4.js → empty-hkvg3is3uc6dj1at.js} +46 -38
- package/dist/chunks/{engine-io35xsj9fgfxtihg.js → engine-g5egnkub1ikv3wvy.js} +2 -2
- package/dist/chunks/{engine-javascript-d795u677f1802oaf.js → engine-javascript-e9xj8hhz9xfqhpnu.js} +200 -185
- package/dist/chunks/{engine-oniguruma-xjlw46ay321yj1av.js → engine-oniguruma-ias56ildu01gf939.js} +8 -7
- package/dist/chunks/error-f4f6l13zx6tynxmy.js +6 -0
- package/dist/chunks/{field-kgz7w7yixmtpg010.js → field-oqtso1v0oszlxi0e.js} +3 -3
- package/dist/chunks/{flow-fmfb3ri8cxo7w9ci.js → flow-iz8sn24h5q6q4b10.js} +76 -60
- package/dist/chunks/formatNumber-kcnmauoqxku5a84c.js +21 -0
- package/dist/chunks/{getCssDimensions-mi941fe1jvztqm6b.js → getCssDimensions-olosvhh5husavesv.js} +2 -2
- package/dist/chunks/getElementTransform-cuiqmjglkrz4db6c.js +38 -0
- package/dist/chunks/{getPseudoElementBounds-jg72lmrlwgbqhmjh.js → getPseudoElementBounds-x7b9uqi5hdb1lq2r.js} +13 -4
- package/dist/chunks/{github-light-kb466scjoy42qxpu.js → github-light-hir7yctc38258pwt.js} +1 -1
- package/dist/chunks/{graphql-gtqr4wytdf0qjybo.js → graphql-n9vlzkvcp2j19p7a.js} +1 -1
- package/dist/chunks/{html-ijyj3f9k0foag15c.js → html-nimj6ljkkifnc9ni.js} +2 -2
- package/dist/chunks/{index.parts-i4iu310eo65d7lfc.js → index.parts-b9zmk3ta77w8dy9f.js} +86 -34
- package/dist/chunks/{index.parts-mr7tgwe4pgfozkt5.js → index.parts-bq90erougcgrwlgk.js} +47 -50
- package/dist/chunks/{index.parts-7z8hqx6zl9yajzvs.js → index.parts-c1ocmbxanagpan6d.js} +206 -366
- package/dist/chunks/{index.parts-nd3mitrhxf806lsa.js → index.parts-cc0yi5vo7s4x3r9p.js} +140 -145
- package/dist/chunks/{index.parts-j2ecf25zajyd5ia3.js → index.parts-cdxa6fwtp3lpkpp4.js} +2 -2
- package/dist/chunks/{index.parts-komdbdvf823cm5jw.js → index.parts-cl2xux9bjec6cibd.js} +14 -11
- package/dist/chunks/{index.parts-bv57na43ve93uz3x.js → index.parts-d4wim8mcnl9a2n9d.js} +67 -36
- package/dist/chunks/{index.parts-gslyp9n88qdh38n1.js → index.parts-e9s1lqq3qa9l6ndm.js} +2 -2
- package/dist/chunks/{index.parts-i4lbjqdnhsnjtny6.js → index.parts-eks3uafpskcxle6j.js} +33 -22
- package/dist/chunks/{index2.parts-kiwz8e3k8utvm4zb.js → index.parts-fbip2x29k5okvypg.js} +9 -12
- package/dist/chunks/index.parts-fhza3s183grld7zq.js +102 -0
- package/dist/chunks/{index.parts-lz9cnngidxppvhz7.js → index.parts-ftxrjoy00esi3aau.js} +27 -40
- package/dist/chunks/{index.parts-kt0w73ciea6adi2i.js → index.parts-g390bxx23hdko02m.js} +2 -2
- package/dist/chunks/{index.parts-fl4zaorc97ed3keb.js → index.parts-gf9v1piz8xxt8ap1.js} +197 -244
- package/dist/chunks/{index.parts-ef9111sjk9e3al87.js → index.parts-h7wtkrxpz4m8eqn9.js} +63 -83
- package/dist/chunks/index.parts-hmx3qlh517ii56yi.js +116 -0
- package/dist/chunks/{index2.parts-mv7x6w0p2splvf6b.js → index.parts-i6gbeimeit8gzhvi.js} +2 -2
- package/dist/chunks/{index.parts-gj1k50tf9fcs7nru.js → index.parts-ioii4acz2bjrf6sb.js} +17 -21
- package/dist/chunks/{index.parts-i5twygaksh86erb7.js → index.parts-iq66xivmdw2mouvx.js} +7 -6
- package/dist/chunks/{index.parts-hxjt52jbictdzgad.js → index.parts-j6kbr29a542ya81m.js} +275 -388
- package/dist/chunks/{index.parts-lhpuh6pw7rjcddnl.js → index.parts-jjup1zgnozoxi7ky.js} +41 -57
- package/dist/chunks/index.parts-jknln7yxhdokkvd6.js +991 -0
- package/dist/chunks/{index.parts-nzwjx603vcq1kryz.js → index.parts-jpm6c0fe0gyky12m.js} +22 -54
- package/dist/chunks/{index.parts-jmb5ztstw4xlfyp9.js → index.parts-kgiqby97w6tn6jw7.js} +15 -20
- package/dist/chunks/{index.parts-c5yto0l67i7ok5fd.js → index.parts-lpafjiz853r94ydb.js} +59 -59
- package/dist/chunks/{index.parts-cpviii2nt413tb8k.js → index.parts-moguar0t0u4aumou.js} +6 -5
- package/dist/chunks/{index.parts-ieuelcd4z5e0mcb7.js → index.parts-mw0e646n3qp6v1qe.js} +11 -11
- package/dist/chunks/{index.parts-nc6jzjq91z2nye75.js → index.parts-olcmo45gi8e1qma1.js} +2 -3
- package/dist/chunks/{index.parts-bmzuqorz0tmneh7t.js → index.parts-p2lcxzhh1ll3584m.js} +41 -39
- package/dist/chunks/{inertValue-f9pgp32jxnm88df3.js → inertValue-e0o6qvuef83v78fk.js} +2 -2
- package/dist/chunks/inline-copy-text-gbd7jhwpor27l4rq.js +104 -0
- package/dist/chunks/{input-pehjmr1q131tz38w.js → input-c8lv9ulv0kortliq.js} +2 -2
- package/dist/chunks/{input-group-kshukialqry0fmra.js → input-group-fjr4r5ax0x78ppax.js} +10 -7
- package/dist/chunks/{input-ikfimmpl5sngvh9s.js → input-h5ox92gf13ge04hp.js} +11 -10
- package/dist/chunks/{isElementDisabled-ffsy1y4adxocmexb.js → isElementDisabled-o0j7po84u0xjuwgg.js} +1 -1
- package/dist/chunks/{label-ie2gpde0nco1avi7.js → label-gzyfw17u08irhdo8.js} +2 -2
- package/dist/chunks/{layer-card-dnikj7emx8qeaspz.js → layer-card-idh3863vdgprgqai.js} +5 -3
- package/dist/chunks/layer-dialog-j5ywmzs46ccg6oqy.js +381 -0
- package/dist/chunks/{link-gp4swsrd3vfnvori.js → link-cqyfjezntvr53rh7.js} +2 -2
- package/dist/chunks/locale-provider-kjlnws7jln3ak0dr.js +29 -0
- package/dist/chunks/{menubar-ljbsj2ulayebjyza.js → menubar-fjhotkmndttb8mua.js} +13 -12
- package/dist/chunks/{mergeCleanups-pexn3wul6a4zn873.js → mergeCleanups-ix8l84cgutsbotpd.js} +1 -1
- package/dist/chunks/{meter-fl03ece4glrrzizj.js → meter-majprsslwmpbmkzg.js} +1 -1
- package/dist/chunks/{pagination-i3jewbdolgru0xnr.js → pagination-oaenm9t7ou3lmcgw.js} +2 -2
- package/dist/chunks/{popover-jal8z9sv176703lf.js → popover-hr0bfgg48xzjggky.js} +2 -2
- package/dist/chunks/popupHandle-7ghmro8a5uerjwu5.js +177 -0
- package/dist/chunks/{popupStoreUtils-jrxqkz5jmlijlr91.js → popupStoreUtils-i0y57dvmcnqrh4pv.js} +178 -101
- package/dist/chunks/{popupStateMapping-hdv48wmkzb2mqful.js → popupTriggerMap-ehv0fuhnmy59j3pn.js} +167 -193
- package/dist/chunks/{portal-provider-gznk6snyqj6egd6d.js → portal-provider-eveknxf26oudn7pp.js} +4 -0
- package/dist/chunks/{radio-gvy6ekh5hu9awlru.js → radio-35dx7y6rjrezbjsp.js} +4 -4
- package/dist/chunks/reason-parts-m5ishukzeux3q0pc.js +39 -0
- package/dist/chunks/{resolveAriaLabelledBy-h9qwvo10ftlj6t9k.js → resolveAriaLabelledBy-nc8mdie5shy87nsb.js} +1 -1
- package/dist/chunks/{resolveValueLabel-bq3nrzord518kp9q.js → resolveValueLabel-hpmsash3ektitvnb.js} +44 -10
- package/dist/chunks/{safePolygon-szbj0u31i6mpt36d.js → safePolygon-kmd5wsz26l4xtj6c.js} +35 -29
- package/dist/chunks/{safeReact-bavzz23j5tex60z2.js → safeReact-hpp4cck3y2s5jg75.js} +2 -2
- package/dist/chunks/scrollable-b6m9ze1u7ps0q1qn.js +34 -0
- package/dist/chunks/{select-ndqpqpmqtmn497rq.js → select-futox5zqr3r80y9a.js} +8 -9
- package/dist/chunks/{sensitive-input-jtbp3mvdynz9wewu.js → sensitive-input-cw33yncetxk3fbrl.js} +3 -3
- package/dist/chunks/{serializeValue-ci3kihruew64i36f.js → serializeValue-ipcakiw32jb7kany.js} +1 -1
- package/dist/chunks/{sidebar-icky50wdc2b1biw8.js → sidebar-in9zhvr473afsjpp.js} +104 -31
- package/dist/chunks/{skeleton-line-hlk5vauzo7xsalbo.js → skeleton-line-m9dyh126t9k07jvg.js} +8 -5
- package/dist/chunks/{sql-do9h6435gka97c4c.js → sql-hqp2eekl7qhmxe92.js} +1 -1
- package/dist/chunks/{stringifyLocale-cl8et9xf6zon4qbs.js → stringifyLocale-bxsgxdnzaef2vcar.js} +1 -1
- package/dist/chunks/{styles-dbhgpd8fm76fdfo3.js → styles-kl02oyrlnld7arja.js} +2 -2
- package/dist/chunks/{surface-ef2kr5pn7r1y3ipk.js → surface-irf0af2mfglu4p0j.js} +1 -1
- package/dist/chunks/{switch-oghrd7f6i5jqar59.js → switch-cqsvolm7h69z7vgg.js} +3 -3
- package/dist/chunks/{table-miggde3uqhhrd5at.js → table-yf8ul2e5nbemioi1.js} +1 -1
- package/dist/chunks/{tabs-mr2dsloqfe0io4a5.js → tabs-gf57qqf1wcclaejq.js} +1 -1
- package/dist/chunks/tag-input-ohfybx5dbxy3houy.js +139 -0
- package/dist/chunks/{text-jzp4mdlr222iuzxt.js → text-f1wxz183ckq7qtl7.js} +3 -2
- package/dist/chunks/{toast-g435fvt74w5orxqo.js → toast-bzaothy2yrezh787.js} +7 -6
- package/dist/chunks/{toolbar-e0b61hr6ys6dmwhv.js → toolbar-h213d8e22yjh5cwq.js} +6 -5
- package/dist/chunks/{tooltip-jq15p5jzgfrhslpo.js → tooltip-o4natsv01lpq8oq2.js} +3 -3
- package/dist/chunks/{useAnchoredPopupScrollLock-lbrqp1zm5z821z20.js → useAnchoredPopupScrollLock-kp3kai20u91sdm7v.js} +4 -4
- package/dist/chunks/{useAnimationFrame-ssgc72hyq6sg3yit.js → useAnimationFrame-0tt315hl9n3jzl86.js} +5 -4
- package/dist/chunks/{useAriaLabelledBy-bvw56m1d7czf0w3f.js → useAriaLabelledBy-ox8dum59shmgypq1.js} +3 -6
- package/dist/chunks/{useBaseUiId-gqkl5ep5pn6hd0rw.js → useBaseUiId-lg1teubxudgin0w2.js} +2 -2
- package/dist/chunks/{useButton-cpo6u2idqcnou6vy.js → useButton-h7s9aq1sfw6arawe.js} +56 -21
- package/dist/chunks/{useClick-fvwb39qgead2jyft.js → useClick-l0p0endoxrlp0ae5.js} +8 -7
- package/dist/chunks/{useCollapsiblePanel-bw63vwvq9a3sj73q.js → useCollapsiblePanel-g6t146nqj521pild.js} +60 -71
- package/dist/chunks/{useCompositeItem-esr3n4pmlssiuxuy.js → useCompositeItem-p7090ga00dpqcg5j.js} +4 -4
- package/dist/chunks/useCompositeListItem-odg6yo4h8866b37o.js +54 -0
- package/dist/chunks/{useControlled-nlx0kk1ksgk0auvi.js → useControlled-lfns1ot6kwowa4t4.js} +3 -3
- package/dist/chunks/{useDismiss-kbtx2o3ruyh3jwgn.js → useDismiss-me91ertzzz3gly12.js} +54 -23
- package/dist/chunks/useFieldValidation-e5pc8loiwzd68g4f.js +224 -0
- package/dist/chunks/{useFilteredItems-ns32d3hpp626kt73.js → useFilteredItems-kw2za6m9bng7twr0.js} +36 -38
- package/dist/chunks/{useFloatingRootContext-o6mk8fvodtbbm2v1.js → useFloatingRootContext-c849wtis7gx013m8.js} +7 -7
- package/dist/chunks/{useFocus-gdfx28bn90keg8cf.js → useFocus-lqwrnfa1svv3bcx1.js} +14 -10
- package/dist/chunks/{useForcedRerendering-el1fbg3ib5yo0v7k.js → useForcedRerendering-i3n4ms0xose8borh.js} +1 -1
- package/dist/chunks/{useId-l9soitgw3e4jk5ie.js → useId-f8w657f9yys10abm.js} +2 -2
- package/dist/chunks/{useLabel-nh9hf8h7o6oquqn5.js → useLabel-kcggu762z3z2taeb.js} +10 -9
- package/dist/chunks/useLabelableId-gqiiuqqn2k0u62r4.js +56 -0
- package/dist/chunks/{useListNavigation-jnxpvegv3ak857b1.js → useListNavigation-3nyjs362qcau34in.js} +51 -39
- package/dist/chunks/{useOnMount-j4wobeq47l3u9olo.js → useOnMount-hadwgyauanbzrvem.js} +3 -3
- package/dist/chunks/{useOpenChangeComplete-dpkex2e23s1evpol.js → useOpenChangeComplete-lk2gfu250t7r20c6.js} +48 -38
- package/dist/chunks/usePopupHandleStore-hx871cmn66j0q7wz.js +27 -0
- package/dist/chunks/{usePopupViewport-hu0kn0ziyf1vqzrs.js → usePopupViewport-iy5j9zawjrr3pcs0.js} +89 -57
- package/dist/chunks/{usePositioner-fz9uswhkhg22lo42.js → usePositioner-k9nc7cl550bgfwzs.js} +151 -142
- package/dist/chunks/{usePreviousValue-le0grv8f43vmunn1.js → usePreviousValue-io5t1pdxehw21l85.js} +2 -2
- package/dist/chunks/{useRegisterFieldControl-m1rxsuvtpau2341n.js → useRegisterFieldControl-lvusf6vc963clx02.js} +16 -10
- package/dist/chunks/{useRegisteredLabelId-dh83mybmzy75waje.js → useRegisteredLabelId-hw6b87h1k7kow1o2.js} +4 -4
- package/dist/chunks/{useRender-gtnbrp1ityffi4xf.js → useRender-onwjigxa00uch2ip.js} +2 -2
- package/dist/chunks/{useRenderDialogRoot-hhowqeoreyr6uuc7.js → useRenderDialogRoot-lddunc01twftravv.js} +123 -110
- package/dist/chunks/{useRenderElement-m8kc7jyuczp71mq8.js → useRenderElement-lrvp2pwrpt5zq1zd.js} +56 -46
- package/dist/chunks/{useScrollLock-mpns3u42eks8hhex.js → useScrollLock-buonkbwuland9wl3.js} +65 -38
- package/dist/chunks/{useStableCallback-ninxmksdjvwl6ejj.js → useStableCallback-b1i1ghzd9k75bb85.js} +3 -3
- package/dist/chunks/{useSwipeDismiss-bpbyw2ihsw3fw6y9.js → useSwipeDismiss-m1s13x9t9ey9ax3p.js} +73 -175
- package/dist/chunks/{useTimeout-oqptmu2xmyv5ccic.js → useTimeout-cpql3c8p250cr093.js} +3 -3
- package/dist/chunks/{useTransitionStatus-ig4waxl2kervpyw4.js → useTransitionStatus-bwqaavnekreihom2.js} +9 -5
- package/dist/chunks/{useTriggerFocusGuards-j8nano0pqu9dscrz.js → useTriggerFocusGuards-lz7wt484xltizro4.js} +4 -3
- package/dist/chunks/{useTypeahead-onenwjyhgw955ygx.js → useTypeahead-kvag4w6hu2g1kbwt.js} +10 -17
- package/dist/chunks/{useValueAsRef-lrn42zari17368c9.js → useValueAsRef-o4s9ohb3aczypmnk.js} +3 -3
- package/dist/chunks/{useValueChanged-kthmz4wk7ywnjwtx.js → useValueChanged-cz5wflhe8g15n6w1.js} +5 -8
- package/dist/chunks/{valueToPercent-henpkkj3juy3ukeu.js → valueToPercent-d7gbqk1umostj7ch.js} +1 -1
- package/dist/chunks/{vendor-floating-ui-dsysdmve7iazaaes.js → vendor-floating-ui-fqblx3wa0r71mjoo.js} +87 -187
- package/dist/chunks/{vendor-utils-luqsvbyuig727bnr.js → vendor-utils-ecfbsk425x1bm0gh.js} +119 -29
- package/dist/chunks/vesper-g839e590k3dxnwh3.js +5 -0
- package/dist/chunks/{visuallyHidden-n14xllazfozg55ox.js → visuallyHidden-nous086atnlxtf74.js} +1 -1
- package/dist/chunks/{wasm-nfbosyhilcq70atf.js → wasm-cpasy0o9lsjrm39j.js} +1 -1
- package/dist/code/server.d.ts +9 -10
- package/dist/code/server.js +8 -7
- package/dist/code.d.ts +8 -8
- package/dist/code.js +18 -16
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button-group.d.ts +2 -0
- package/dist/components/button-group.js +3 -0
- package/dist/components/button.js +1 -1
- package/dist/components/chart.d.ts +2 -2
- package/dist/components/chart.js +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/clipboard-text.js +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/combobox.d.ts +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-palette.d.ts +1 -1
- package/dist/components/command-palette.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown.d.ts +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/flow.js +1 -1
- package/dist/components/inline-copy-text.d.ts +2 -0
- package/dist/components/inline-copy-text.js +3 -0
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.d.ts +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/label.js +1 -1
- package/dist/components/layer-card.js +1 -1
- package/dist/components/layer-dialog.d.ts +2 -0
- package/dist/components/layer-dialog.js +3 -0
- package/dist/components/link.d.ts +8 -9
- package/dist/components/link.js +1 -1
- package/dist/components/loader.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/meter.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/radio.d.ts +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sensitive-input.d.ts +1 -1
- package/dist/components/sensitive-input.js +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/surface.js +1 -1
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table-of-contents.d.ts +1 -1
- package/dist/components/table.d.ts +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tag-input.d.ts +2 -0
- package/dist/components/tag-input.js +3 -0
- package/dist/components/text.d.ts +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/toast.d.ts +1 -1
- package/dist/components/toast.js +2 -2
- package/dist/components/toolbar.d.ts +1 -1
- package/dist/components/toolbar.js +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/{index-BXsHCLB82.d.ts → index--RbAKeBL.d.ts} +1 -1
- package/dist/{index-CeBzVJP8.d.ts → index-BK1tZgmP.d.ts} +1 -1
- package/dist/{index-CGbkysYW2.d.ts → index-BMe3cpLB.d.ts} +5 -4
- package/dist/{index-Di3sC6UF.d.ts → index-C0d8uwYO.d.ts} +4 -4
- package/dist/index-C7RoG_CH.d.ts +57 -0
- package/dist/{index-DBlw3E9m.d.ts → index-CNJRbVxG.d.ts} +1 -1
- package/dist/{index-BcRyiNd72.d.ts → index-ChGFA5-n.d.ts} +5 -1
- package/dist/index-CiwC1j1N.d.ts +37 -0
- package/dist/{index-BoPqM1Ia2.d.ts → index-Cqrye3KD.d.ts} +1 -1
- package/dist/{index-Bw3M24Mi.d.ts → index-CrQi3QCY.d.ts} +2 -1
- package/dist/{index-BlEUcijd.d.ts → index-CtTNoYA2.d.ts} +69 -1
- package/dist/{index-D97n4Bpf2.d.ts → index-DWZia2ui.d.ts} +1 -1
- package/dist/index-NqlNd7cQ.d.ts +144 -0
- package/dist/index-jNWPjJl9.d.ts +75 -0
- package/dist/index.d.ts +31 -26
- package/dist/index.js +49 -44
- package/dist/{input-group-DpGSsAZy.d.ts → input-group-B3M_WRqm.d.ts} +1 -1
- package/dist/locale-provider-BLGya10h.d.ts +28 -0
- package/dist/{portal-provider-4AHCxYE6.d.ts → portal-provider-BAqPpq_a.d.ts} +4 -0
- package/dist/primitives/accordion.js +1 -1
- package/dist/primitives/alert-dialog.js +1 -1
- package/dist/primitives/autocomplete.js +1 -1
- package/dist/primitives/avatar.js +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/checkbox-group.js +1 -1
- package/dist/primitives/checkbox.js +1 -1
- package/dist/primitives/collapsible.js +1 -1
- package/dist/primitives/combobox.js +1 -1
- package/dist/primitives/context-menu.js +1 -1
- package/dist/primitives/csp-provider.js +1 -1
- package/dist/primitives/dialog.js +1 -1
- package/dist/primitives/direction-provider.js +2 -2
- package/dist/primitives/drawer.js +1 -1
- package/dist/primitives/field.js +1 -1
- package/dist/primitives/fieldset.js +1 -1
- package/dist/primitives/form.js +1 -1
- package/dist/primitives/input.js +1 -1
- package/dist/primitives/menu.js +1 -1
- package/dist/primitives/menubar.js +1 -1
- package/dist/primitives/meter.js +1 -1
- package/dist/primitives/navigation-menu.js +1 -1
- package/dist/primitives/number-field.js +1 -1
- package/dist/primitives/otp-field.js +1 -1
- package/dist/primitives/popover.js +1 -1
- package/dist/primitives/preview-card.js +1 -1
- package/dist/primitives/progress.js +1 -1
- package/dist/primitives/radio-group.js +1 -1
- package/dist/primitives/radio.js +1 -1
- package/dist/primitives/scroll-area.js +1 -1
- package/dist/primitives/select.js +1 -1
- package/dist/primitives/separator.js +1 -1
- package/dist/primitives/slider.js +1 -1
- package/dist/primitives/switch.js +1 -1
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/toast.js +1 -1
- package/dist/primitives/toggle-group.js +1 -1
- package/dist/primitives/toggle.js +1 -1
- package/dist/primitives/toolbar.js +1 -1
- package/dist/primitives/tooltip.js +1 -1
- package/dist/primitives.d.ts +1 -1
- package/dist/primitives.js +41 -41
- package/dist/scripts/theme-generator/config.d.ts +4 -5
- package/dist/scripts/theme-generator/types.d.ts +12 -13
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/{index-Dzzi1o7w2.d.ts → text-B4l7S5Z0.d.ts} +60 -1
- package/dist/{tooltip-BuCo6Ki4.d.ts → tooltip-D_vhi1PN.d.ts} +1 -1
- package/dist/{types-C402rKiz.d.ts → types-C6in2C8V.d.ts} +6 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +3 -2
- package/package.json +22 -5
- package/scripts/component-registry/discovery.ts +3 -0
- package/scripts/component-registry/metadata.ts +37 -0
- package/scripts/generate-globe-land-mask.mjs +80 -0
- package/dist/chunks/CheckboxIndicator-igofmpn0wcfdqooa.js +0 -49
- package/dist/chunks/CompositeList-tx08unuok7wsl2d9.js +0 -129
- package/dist/chunks/DialogHandle-b3froel96o9fwjmm.js +0 -139
- package/dist/chunks/DialogRoot-fp7d16uxogvye294.js +0 -15
- package/dist/chunks/FieldLabel-f6vwzm8nefzxwlh8.js +0 -558
- package/dist/chunks/Form-is7d5c1kbk1wn39s.js +0 -102
- package/dist/chunks/areArraysEqual-nlbeaqlzf4274zr3.js +0 -7
- package/dist/chunks/clamp-kvu4wtr1dw6b3pnd.js +0 -7
- package/dist/chunks/createBaseUIEventDetails-ddivuhl74gni72qn.js +0 -86
- package/dist/chunks/error-mm98alb8acdy93vq.js +0 -15
- package/dist/chunks/formatNumber-hjijm58g645q6a0n.js +0 -26
- package/dist/chunks/getEmptyRootContext-ekvv3rp5w16ewoqx.js +0 -18
- package/dist/chunks/index.parts-hve0zir3biaolih0.js +0 -128
- package/dist/chunks/index.parts-jv5kiaeixrjah9js.js +0 -119
- package/dist/chunks/index.parts-k7ezm98skegahepw.js +0 -2464
- package/dist/chunks/store-9b2cp7rx1dvq90fp.js +0 -88
- package/dist/chunks/useCompositeListItem-0exfww37ospqz69b.js +0 -75
- package/dist/chunks/useIsHydrating-b6whcsimonagru6u.js +0 -22
- package/dist/chunks/useLabelableId-b1kwq9st3rjrtakn.js +0 -60
- package/dist/chunks/vesper-ho3j3gt6ilwfuc1g.js +0 -5
- package/dist/cn-DCSItmT-.d.ts +0 -5
- /package/dist/{index-AMEc1MEg2.d.ts → index-AMEc1MEg.d.ts} +0 -0
- /package/dist/{index-D2Gvly0i2.d.ts → index-D2Gvly0i.d.ts} +0 -0
- /package/dist/{index-DIV3riUd2.d.ts → index-DIV3riUd.d.ts} +0 -0
- /package/dist/{index-FCkuxSvs2.d.ts → index-FCkuxSvs.d.ts} +0 -0
- /package/dist/{index-_Sl5wohy2.d.ts → index-_Sl5wohy.d.ts} +0 -0
- /package/dist/{index-bAud6rG22.d.ts → index-bAud6rG2.d.ts} +0 -0
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as EMPTY_ARRAY, d as useRefWithInit, o as EMPTY_OBJECT, r as mergeProps, s as NOOP, t as useRenderElement
|
|
3
|
-
import {
|
|
4
|
-
import { n as useIsoLayoutEffect } from "./safeReact-
|
|
5
|
-
import { n as useTimeout } from "./useTimeout-
|
|
6
|
-
import {
|
|
7
|
-
import { t as gecko } from "./engine-
|
|
8
|
-
import { E as
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
11
|
-
import {
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import { t as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import { t as
|
|
20
|
-
import { t as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { n as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { t as
|
|
27
|
-
import { t as
|
|
28
|
-
import { t as
|
|
29
|
-
import { t as
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { n as
|
|
33
|
-
import { t as
|
|
34
|
-
import {
|
|
2
|
+
import { a as EMPTY_ARRAY, d as useMergedRefs, f as useRefWithInit, o as EMPTY_OBJECT, r as mergeProps, s as NOOP, t as useRenderElement } from "./useRenderElement-lrvp2pwrpt5zq1zd.js";
|
|
3
|
+
import { r as ReactStore } from "./popupTriggerMap-ehv0fuhnmy59j3pn.js";
|
|
4
|
+
import { n as useIsoLayoutEffect } from "./safeReact-hpp4cck3y2s5jg75.js";
|
|
5
|
+
import { n as useTimeout } from "./useTimeout-cpql3c8p250cr093.js";
|
|
6
|
+
import { A as pressableTriggerOpenStateMapping, J as getTarget, et as stopEvent, f as getGridNavigatedIndex, g as isIndexOutOfListBounds, it as ios, nt as android, q as contains } from "./vendor-utils-ecfbsk425x1bm0gh.js";
|
|
7
|
+
import { t as gecko } from "./engine-g5egnkub1ikv3wvy.js";
|
|
8
|
+
import { E as isHTMLElement, S as getOverflowAncestors } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
|
|
9
|
+
import { E as pointer, b as keyboard, g as inputClear, h as inputChange, i as closePress, l as escapeKey, v as inputPress, w as none, y as itemPress } from "./reason-parts-m5ishukzeux3q0pc.js";
|
|
10
|
+
import { n as createGenericEventDetails, t as createChangeEventDetails } from "./createBaseUIEventDetails-3ob3qgs95ffm8l0w.js";
|
|
11
|
+
import { t as useValueAsRef } from "./useValueAsRef-o4s9ohb3aczypmnk.js";
|
|
12
|
+
import { t as useStableCallback } from "./useStableCallback-b1i1ghzd9k75bb85.js";
|
|
13
|
+
import { n as visuallyHiddenInput, t as visuallyHidden } from "./visuallyHidden-nous086atnlxtf74.js";
|
|
14
|
+
import { t as useDismiss } from "./useDismiss-me91ertzzz3gly12.js";
|
|
15
|
+
import { r as useOpenInteractionType } from "./useScrollLock-buonkbwuland9wl3.js";
|
|
16
|
+
import { t as useOpenChangeComplete } from "./useOpenChangeComplete-lk2gfu250t7r20c6.js";
|
|
17
|
+
import { t as useClick } from "./useClick-l0p0endoxrlp0ae5.js";
|
|
18
|
+
import { t as FOCUSABLE_POPUP_PROPS } from "./popupStoreUtils-i0y57dvmcnqrh4pv.js";
|
|
19
|
+
import { t as useTransitionStatus } from "./useTransitionStatus-bwqaavnekreihom2.js";
|
|
20
|
+
import { t as useFloatingRootContext } from "./useFloatingRootContext-c849wtis7gx013m8.js";
|
|
21
|
+
import { t as useListNavigation } from "./useListNavigation-3nyjs362qcau34in.js";
|
|
22
|
+
import { t as useBaseUiId } from "./useBaseUiId-lg1teubxudgin0w2.js";
|
|
23
|
+
import { n as useDirection } from "./DirectionContext-opvqcb794uxicri4.js";
|
|
24
|
+
import { a as useFieldRootContext, c as fieldValidityMapping, i as FieldRootContext, n as useLabelableContext, o as DEFAULT_FIELD_STATE_ATTRIBUTES, r as DEFAULT_FIELD_ROOT_CONTEXT } from "./LabelableContext-ccxbhu73vrk089m1.js";
|
|
25
|
+
import { n as useFormContext } from "./FormContext-bsu99v8i8pwu1yxc.js";
|
|
26
|
+
import { t as useLabelableId } from "./useLabelableId-gqiiuqqn2k0u62r4.js";
|
|
27
|
+
import { t as useControlled } from "./useControlled-lfns1ot6kwowa4t4.js";
|
|
28
|
+
import { t as useRegisterFieldControl } from "./useRegisterFieldControl-lvusf6vc963clx02.js";
|
|
29
|
+
import { t as useValueChanged } from "./useValueChanged-cz5wflhe8g15n6w1.js";
|
|
30
|
+
import { t as useButton } from "./useButton-h7s9aq1sfw6arawe.js";
|
|
31
|
+
import { r as isScrollableY } from "./scrollable-b6m9ze1u7ps0q1qn.js";
|
|
32
|
+
import { c as compareItemEquality, d as findSelectionIndex, f as isSelectedValueDirty, g as useOnFirstRender, h as selectedValueIncludes, l as defaultItemEquality, m as resolveSelectedIndex, n as hasNullItemLabel, o as stringifyAsLabel, p as removeItem, r as isGroupedItems, s as stringifyAsValue, t as flattenLeafItems, u as findItemIndex } from "./resolveValueLabel-hpmsash3ektitvnb.js";
|
|
33
|
+
import { t as stringifyLocale } from "./stringifyLocale-bxsgxdnzaef2vcar.js";
|
|
34
|
+
import { t as CompositeList } from "./CompositeList-lbr4enu6yzek7oa9.js";
|
|
35
|
+
import { t as useCompositeListItem } from "./useCompositeListItem-odg6yo4h8866b37o.js";
|
|
35
36
|
import * as React$1 from "react";
|
|
36
37
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
37
38
|
import * as ReactDOM from "react-dom";
|
|
38
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
39
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/floating-ui-react/hooks/gridNavigation.mjs
|
|
39
40
|
/**
|
|
40
41
|
* Positional arguments are deliberate: property names of an options object
|
|
41
42
|
* don't minify, and the signature is locked to the caller via `typeof` on the
|
|
@@ -64,7 +65,7 @@ function gridNavigation(event, prevIndex, listRef, orientation, loopFocus, rtl,
|
|
|
64
65
|
return isIndexOutOfListBounds(listRef.current, nextIndex) ? void 0 : nextIndex;
|
|
65
66
|
}
|
|
66
67
|
//#endregion
|
|
67
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
68
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/ComboboxRootContext.mjs
|
|
68
69
|
const ComboboxRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
69
70
|
ComboboxRootContext.displayName = "ComboboxRootContext";
|
|
70
71
|
const ComboboxFloatingContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
@@ -97,69 +98,73 @@ function useComboboxHasItemsContext() {
|
|
|
97
98
|
return React$1.useContext(ComboboxHasItemsContext);
|
|
98
99
|
}
|
|
99
100
|
//#endregion
|
|
100
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
101
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/store.mjs
|
|
102
|
+
/**
|
|
103
|
+
* Non-reactive values shared with the combobox parts. Nothing here is observable through
|
|
104
|
+
* `selectors`, so writing to a ref never notifies subscribers.
|
|
105
|
+
*/
|
|
101
106
|
const selectors = {
|
|
102
|
-
id:
|
|
103
|
-
labelId:
|
|
104
|
-
items:
|
|
105
|
-
selectedValue:
|
|
106
|
-
hasSelectionChips:
|
|
107
|
+
id: (state) => state.id,
|
|
108
|
+
labelId: (state) => state.labelId,
|
|
109
|
+
items: (state) => state.items,
|
|
110
|
+
selectedValue: (state) => state.selectedValue,
|
|
111
|
+
hasSelectionChips: (state) => {
|
|
107
112
|
const selectedValue = state.selectedValue;
|
|
108
113
|
return Array.isArray(selectedValue) && selectedValue.length > 0;
|
|
109
|
-
}
|
|
110
|
-
hasSelectedValue:
|
|
114
|
+
},
|
|
115
|
+
hasSelectedValue: (state) => {
|
|
111
116
|
const { selectedValue, selectionMode } = state;
|
|
112
117
|
if (selectedValue == null) return false;
|
|
113
118
|
if (selectionMode === "multiple" && Array.isArray(selectedValue)) return selectedValue.length > 0;
|
|
114
119
|
return true;
|
|
115
|
-
}
|
|
116
|
-
hasNullItemLabel:
|
|
120
|
+
},
|
|
121
|
+
hasNullItemLabel: (state, enabled) => {
|
|
117
122
|
return enabled ? hasNullItemLabel(state.items) : false;
|
|
118
|
-
}
|
|
119
|
-
open:
|
|
120
|
-
mounted:
|
|
121
|
-
forceMounted:
|
|
122
|
-
inline:
|
|
123
|
-
activeIndex:
|
|
124
|
-
selectedIndex:
|
|
125
|
-
isActive:
|
|
126
|
-
isSelected:
|
|
123
|
+
},
|
|
124
|
+
open: (state) => state.open,
|
|
125
|
+
mounted: (state) => state.mounted,
|
|
126
|
+
forceMounted: (state) => state.forceMounted,
|
|
127
|
+
inline: (state) => state.inline,
|
|
128
|
+
activeIndex: (state) => state.activeIndex,
|
|
129
|
+
selectedIndex: (state) => state.selectedIndex,
|
|
130
|
+
isActive: (state, index) => state.activeIndex === index,
|
|
131
|
+
isSelected: (state, itemValue) => {
|
|
127
132
|
const comparer = state.isItemEqualToValue;
|
|
128
133
|
const selectedValue = state.selectedValue;
|
|
129
134
|
if (Array.isArray(selectedValue)) return selectedValue.some((selectedItem) => compareItemEquality(itemValue, selectedItem, comparer));
|
|
130
135
|
return compareItemEquality(itemValue, selectedValue, comparer);
|
|
131
|
-
}
|
|
132
|
-
transitionStatus:
|
|
133
|
-
popupProps:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
136
|
+
},
|
|
137
|
+
transitionStatus: (state) => state.transitionStatus,
|
|
138
|
+
popupProps: (state) => state.popupProps,
|
|
139
|
+
listProps: (state) => state.listProps,
|
|
140
|
+
inputProps: (state) => state.inputProps,
|
|
141
|
+
triggerProps: (state) => state.triggerProps,
|
|
142
|
+
itemProps: (state) => state.itemProps,
|
|
143
|
+
positionerElement: (state) => state.positionerElement,
|
|
144
|
+
listElement: (state) => state.listElement,
|
|
145
|
+
popupId: (state) => state.popupId,
|
|
146
|
+
triggerElement: (state) => state.triggerElement,
|
|
147
|
+
inputElement: (state) => state.inputElement,
|
|
148
|
+
inputGroupElement: (state) => state.inputGroupElement,
|
|
149
|
+
popupSide: (state) => state.popupSide,
|
|
150
|
+
openMethod: (state) => state.openMethod,
|
|
151
|
+
inputInsidePopup: (state) => state.inputInsidePopup,
|
|
152
|
+
inputOwnsFormValue: (state) => state.inputOwnsFormValue,
|
|
153
|
+
selectionMode: (state) => state.selectionMode,
|
|
154
|
+
name: (state) => state.name,
|
|
155
|
+
form: (state) => state.form,
|
|
156
|
+
disabled: (state) => state.disabled,
|
|
157
|
+
readOnly: (state) => state.readOnly,
|
|
158
|
+
required: (state) => state.required,
|
|
159
|
+
grid: (state) => state.grid,
|
|
160
|
+
virtualized: (state) => state.virtualized,
|
|
161
|
+
itemToStringLabel: (state) => state.itemToStringLabel,
|
|
162
|
+
isItemEqualToValue: (state) => state.isItemEqualToValue,
|
|
163
|
+
modal: (state) => state.modal,
|
|
164
|
+
autoHighlight: (state) => state.autoHighlight
|
|
160
165
|
};
|
|
161
166
|
//#endregion
|
|
162
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
167
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/utils/index.mjs
|
|
163
168
|
/**
|
|
164
169
|
* Derives the default id assigned to `Combobox.Popup` when the input is rendered inside it.
|
|
165
170
|
* Shared by the popup (which applies it) and the trigger (which references it via `aria-controls`)
|
|
@@ -177,8 +182,7 @@ function getComboboxPopupId(rootId) {
|
|
|
177
182
|
function createCollatorItemFilter(collatorFilter, itemToStringLabel) {
|
|
178
183
|
return (item, query) => {
|
|
179
184
|
if (item == null) return false;
|
|
180
|
-
|
|
181
|
-
return collatorFilter.contains(itemString, query);
|
|
185
|
+
return collatorFilter.contains(item, query, itemToStringLabel);
|
|
182
186
|
};
|
|
183
187
|
}
|
|
184
188
|
/**
|
|
@@ -189,14 +193,14 @@ function createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel,
|
|
|
189
193
|
return (item, query) => {
|
|
190
194
|
if (item == null) return false;
|
|
191
195
|
if (!query) return true;
|
|
192
|
-
const
|
|
193
|
-
const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue,
|
|
196
|
+
const selectedValueToString = itemToStringLabel?.selected ?? itemToStringLabel;
|
|
197
|
+
const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue, selectedValueToString) : "";
|
|
194
198
|
if (selectedString && collatorFilter.contains(selectedString, query) && selectedString.length === query.length) return true;
|
|
195
|
-
return collatorFilter.contains(
|
|
199
|
+
return collatorFilter.contains(item, query, itemToStringLabel);
|
|
196
200
|
};
|
|
197
201
|
}
|
|
198
202
|
//#endregion
|
|
199
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
203
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/internals/filter.mjs
|
|
200
204
|
const filterCache = /* @__PURE__ */ new Map();
|
|
201
205
|
function getFilter(options = {}) {
|
|
202
206
|
const mergedOptions = {
|
|
@@ -232,7 +236,7 @@ function getFilter(options = {}) {
|
|
|
232
236
|
return filter;
|
|
233
237
|
}
|
|
234
238
|
//#endregion
|
|
235
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
239
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/utils/useFilter.mjs
|
|
236
240
|
/**
|
|
237
241
|
* Matches items against a query using `Intl.Collator` for robust string matching.
|
|
238
242
|
*/
|
|
@@ -252,32 +256,98 @@ function useComboboxFilter(options = {}) {
|
|
|
252
256
|
multiple
|
|
253
257
|
]);
|
|
254
258
|
return React$1.useMemo(() => ({
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
endsWith: coreFilter.endsWith
|
|
259
|
+
...coreFilter,
|
|
260
|
+
contains
|
|
258
261
|
}), [contains, coreFilter]);
|
|
259
262
|
}
|
|
260
263
|
//#endregion
|
|
261
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
264
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/utils/constants.mjs
|
|
262
265
|
const NO_ACTIVE_VALUE = Symbol("none");
|
|
263
266
|
const INITIAL_LAST_HIGHLIGHT = {
|
|
264
267
|
value: NO_ACTIVE_VALUE,
|
|
265
268
|
index: -1
|
|
266
269
|
};
|
|
267
270
|
//#endregion
|
|
268
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
271
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/items/itemCollection.mjs
|
|
272
|
+
function findCollectionItem(valueToItem, itemValue, isEqual) {
|
|
273
|
+
const exactItem = valueToItem.get(itemValue);
|
|
274
|
+
if (exactItem !== void 0 || isEqual === defaultItemEquality) return exactItem;
|
|
275
|
+
for (const [derivedValue, item] of valueToItem) if (compareItemEquality(derivedValue, itemValue, isEqual)) return item;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* An opaque collection created by `createItems()`.
|
|
279
|
+
*
|
|
280
|
+
* It carries the source item and derived value types so the root can infer the list item and
|
|
281
|
+
* selection value types.
|
|
282
|
+
*
|
|
283
|
+
* Pass it directly to the root's `items` prop; it has no public members.
|
|
284
|
+
*/
|
|
285
|
+
/**
|
|
286
|
+
* Internal shape of a collection. The extra members let the root project items to
|
|
287
|
+
* their values and resolve a selected value back to its label while items are unmounted.
|
|
288
|
+
*/
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/root/AriaCombobox.mjs
|
|
269
291
|
/**
|
|
270
292
|
* @internal
|
|
271
293
|
*/
|
|
272
294
|
function AriaCombobox(props) {
|
|
273
|
-
const { id: idProp, onOpenChangeComplete: onOpenChangeCompleteProp, defaultSelectedValue = null, selectedValue: selectedValueProp, onSelectedValueChange, defaultInputValue
|
|
295
|
+
const { id: idProp, onOpenChangeComplete: onOpenChangeCompleteProp, defaultSelectedValue = null, selectedValue: selectedValueProp, onSelectedValueChange, defaultInputValue, inputValue: inputValueProp, open: openProp, defaultOpen = false, selectionMode, onItemHighlighted: onItemHighlightedProp, name: nameProp, form, disabled: disabledProp = false, readOnly = false, required = false, inputRef: inputRefProp, grid = false, items: itemsProp, filteredItems: filteredItemsProp, filter: filterProp, filterQuery: filterQueryProp, openOnInputClick = true, autoHighlight = false, keepHighlight = false, highlightItemOnHover = true, loopFocus = true, itemToStringLabel: itemToStringLabelProp, itemToStringValue, isItemEqualToValue = defaultItemEquality, virtualized = false, inline: inlineProp = false, fillInputOnItemPress = true, modal = false, limit = -1, autoComplete = "list", formAutoComplete, locale, submitOnItemClick = false } = props;
|
|
274
296
|
const { clearErrors } = useFormContext();
|
|
275
297
|
const { setDirty, validityData, setFilled, name: fieldName, disabled: fieldDisabled, setTouched, setFocused, validationMode, validation } = useFieldRootContext();
|
|
276
298
|
const direction = useDirection();
|
|
277
299
|
const id = useLabelableId({ id: idProp });
|
|
278
300
|
const collatorFilter = useCoreFilter({ locale });
|
|
301
|
+
const collection = Array.isArray(itemsProp) ? null : itemsProp;
|
|
302
|
+
if (collection && typeof collection.label !== "function") throw new Error("Base UI: the `items` prop received an object that is not a collection, so its items cannot be read. Pass an array of items, an array of groups with items, or the result of `createItems()`. See https://base-ui.com/react/components/combobox#createitems");
|
|
303
|
+
const items = collection ? collection.data : itemsProp;
|
|
304
|
+
const itemToValue = collection?.value;
|
|
305
|
+
const storeItems = itemToValue ? void 0 : items;
|
|
306
|
+
const externalWindow = React$1.useMemo(() => {
|
|
307
|
+
if (!filteredItemsProp || !itemToValue) return;
|
|
308
|
+
const flat = flattenLeafItems(filteredItemsProp);
|
|
309
|
+
const values = flat.map(itemToValue);
|
|
310
|
+
let valueToItem;
|
|
311
|
+
return {
|
|
312
|
+
values,
|
|
313
|
+
findItem(itemValue, isEqual) {
|
|
314
|
+
if (!valueToItem) {
|
|
315
|
+
valueToItem = /* @__PURE__ */ new Map();
|
|
316
|
+
for (let i = 0; i < values.length; i += 1) if (!valueToItem.has(values[i])) valueToItem.set(values[i], flat[i]);
|
|
317
|
+
}
|
|
318
|
+
return findCollectionItem(valueToItem, itemValue, isEqual);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
}, [filteredItemsProp, itemToValue]);
|
|
322
|
+
const itemToStringLabel = React$1.useMemo(() => {
|
|
323
|
+
if (!collection) return itemToStringLabelProp;
|
|
324
|
+
return (itemValue) => {
|
|
325
|
+
return collection.label(itemValue, isItemEqualToValue, (unresolvedValue) => {
|
|
326
|
+
const externalItem = externalWindow?.findItem(unresolvedValue, isItemEqualToValue);
|
|
327
|
+
if (externalItem != null) return collection.itemLabel(externalItem);
|
|
328
|
+
return stringifyAsLabel(unresolvedValue, itemToStringLabelProp);
|
|
329
|
+
});
|
|
330
|
+
};
|
|
331
|
+
}, [
|
|
332
|
+
collection,
|
|
333
|
+
itemToStringLabelProp,
|
|
334
|
+
externalWindow,
|
|
335
|
+
isItemEqualToValue
|
|
336
|
+
]);
|
|
337
|
+
const filterItemToString = React$1.useMemo(() => {
|
|
338
|
+
if (!collection) return itemToStringLabelProp;
|
|
339
|
+
return Object.assign((item) => collection.itemLabel(item), { selected: (value) => stringifyAsLabel(value, itemToStringLabel) });
|
|
340
|
+
}, [
|
|
341
|
+
collection,
|
|
342
|
+
itemToStringLabel,
|
|
343
|
+
itemToStringLabelProp
|
|
344
|
+
]);
|
|
345
|
+
function stringifyValueLabel(item) {
|
|
346
|
+
return stringifyAsLabel(item, itemToStringLabel);
|
|
347
|
+
}
|
|
279
348
|
const [queryChangedAfterOpen, setQueryChangedAfterOpen] = React$1.useState(false);
|
|
280
349
|
const [closeQuery, setCloseQuery] = React$1.useState(null);
|
|
350
|
+
const previousCloseQueryRef = React$1.useRef(closeQuery);
|
|
281
351
|
const listRef = React$1.useRef([]);
|
|
282
352
|
const labelsRef = React$1.useRef([]);
|
|
283
353
|
const popupRef = React$1.useRef(null);
|
|
@@ -297,17 +367,15 @@ function AriaCombobox(props) {
|
|
|
297
367
|
*/
|
|
298
368
|
const valuesRef = React$1.useRef([]);
|
|
299
369
|
/**
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
* It accumulates values on first mount and does not remove them on unmount due to
|
|
303
|
-
* filtering, providing a stable index for selected value tracking.
|
|
370
|
+
* The item element that received the last `pointerdown`, used to detect whether a
|
|
371
|
+
* `mouseup` on an item belongs to a drag-select gesture that started elsewhere.
|
|
304
372
|
*/
|
|
305
|
-
const
|
|
373
|
+
const pointerDownItemRef = React$1.useRef(null);
|
|
306
374
|
const disabled = fieldDisabled || disabledProp;
|
|
307
375
|
const name = fieldName ?? nameProp;
|
|
308
376
|
const multiple = selectionMode === "multiple";
|
|
309
377
|
const single = selectionMode === "single";
|
|
310
|
-
const hasInputValue = inputValueProp !== void 0 ||
|
|
378
|
+
const hasInputValue = inputValueProp !== void 0 || defaultInputValue !== void 0;
|
|
311
379
|
const hasItems = items !== void 0;
|
|
312
380
|
const hasFilteredItemsProp = filteredItemsProp !== void 0;
|
|
313
381
|
let autoHighlightMode;
|
|
@@ -322,19 +390,15 @@ function AriaCombobox(props) {
|
|
|
322
390
|
const filter = React$1.useMemo(() => {
|
|
323
391
|
if (filterProp === null) return () => true;
|
|
324
392
|
if (filterProp !== void 0) return filterProp;
|
|
325
|
-
|
|
326
|
-
return createCollatorItemFilter(collatorFilter, itemToStringLabel);
|
|
393
|
+
return createCollatorItemFilter(collatorFilter, filterItemToString);
|
|
327
394
|
}, [
|
|
328
395
|
filterProp,
|
|
329
|
-
single,
|
|
330
|
-
selectedValue,
|
|
331
|
-
queryChangedAfterOpen,
|
|
332
396
|
collatorFilter,
|
|
333
|
-
|
|
397
|
+
filterItemToString
|
|
334
398
|
]);
|
|
335
399
|
const initialDefaultInputValue = useRefWithInit(() => {
|
|
336
|
-
if (hasInputValue) return
|
|
337
|
-
if (single) return
|
|
400
|
+
if (hasInputValue) return defaultInputValue ?? "";
|
|
401
|
+
if (single) return stringifyValueLabel(selectedValue);
|
|
338
402
|
return "";
|
|
339
403
|
}).current;
|
|
340
404
|
const [inputValue, setInputValueUnwrapped] = useControlled({
|
|
@@ -350,16 +414,12 @@ function AriaCombobox(props) {
|
|
|
350
414
|
state: "open"
|
|
351
415
|
});
|
|
352
416
|
const isGrouped = isGroupedItems(items);
|
|
353
|
-
const query =
|
|
354
|
-
const selectedLabelString = single ?
|
|
355
|
-
const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== "" && selectedLabelString
|
|
356
|
-
const filterQuery = shouldBypassFiltering ? "" : query;
|
|
357
|
-
const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering;
|
|
358
|
-
const flatItems = React$1.useMemo(() =>
|
|
359
|
-
if (!items) return EMPTY_ARRAY;
|
|
360
|
-
if (isGrouped) return items.flatMap((group) => group.items);
|
|
361
|
-
return items;
|
|
362
|
-
}, [items, isGrouped]);
|
|
417
|
+
const query = !open && closeQuery !== null ? closeQuery : String(inputValue).trim();
|
|
418
|
+
const selectedLabelString = single ? stringifyValueLabel(selectedValue) : "";
|
|
419
|
+
const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== "" && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);
|
|
420
|
+
const filterQuery = shouldBypassFiltering ? "" : filterQueryProp ?? query;
|
|
421
|
+
const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering && (!collection || collection.hasValue(selectedValue, isItemEqualToValue));
|
|
422
|
+
const flatItems = React$1.useMemo(() => items ? flattenLeafItems(items) : EMPTY_ARRAY, [items]);
|
|
363
423
|
const filteredItems = React$1.useMemo(() => {
|
|
364
424
|
if (filteredItemsProp && !shouldIgnoreExternalFiltering) return filteredItemsProp;
|
|
365
425
|
if (!items) return EMPTY_ARRAY;
|
|
@@ -369,10 +429,12 @@ function AriaCombobox(props) {
|
|
|
369
429
|
let currentCount = 0;
|
|
370
430
|
for (const group of groupedItems) {
|
|
371
431
|
if (limit > -1 && currentCount >= limit) break;
|
|
372
|
-
const candidateItems = filterQuery === "" ? group.items : group.items.filter((item) => filter(item, filterQuery, itemToStringLabel));
|
|
373
|
-
if (candidateItems.length === 0) continue;
|
|
374
432
|
const remainingLimit = limit > -1 ? limit - currentCount : Infinity;
|
|
375
|
-
const itemsToTake =
|
|
433
|
+
const itemsToTake = filterQuery === "" ? group.items.slice(0, remainingLimit) : [];
|
|
434
|
+
if (filterQuery !== "") for (const item of group.items) {
|
|
435
|
+
if (itemsToTake.length >= remainingLimit) break;
|
|
436
|
+
if (filter(item, filterQuery, filterItemToString)) itemsToTake.push(item);
|
|
437
|
+
}
|
|
376
438
|
if (itemsToTake.length > 0) {
|
|
377
439
|
const newGroup = {
|
|
378
440
|
...group,
|
|
@@ -388,7 +450,7 @@ function AriaCombobox(props) {
|
|
|
388
450
|
const limitedItems = [];
|
|
389
451
|
for (const item of flatItems) {
|
|
390
452
|
if (limit > -1 && limitedItems.length >= limit) break;
|
|
391
|
-
if (filter(item, filterQuery,
|
|
453
|
+
if (filter(item, filterQuery, filterItemToString)) limitedItems.push(item);
|
|
392
454
|
}
|
|
393
455
|
return limitedItems;
|
|
394
456
|
}, [
|
|
@@ -399,80 +461,91 @@ function AriaCombobox(props) {
|
|
|
399
461
|
filterQuery,
|
|
400
462
|
limit,
|
|
401
463
|
filter,
|
|
402
|
-
|
|
464
|
+
filterItemToString,
|
|
403
465
|
flatItems
|
|
404
466
|
]);
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
467
|
+
/**
|
|
468
|
+
* The filtered items flattened across groups and projected to their selection values.
|
|
469
|
+
*/
|
|
470
|
+
const flatFilteredValues = React$1.useMemo(() => {
|
|
471
|
+
if (externalWindow && filteredItems === filteredItemsProp) return externalWindow.values;
|
|
472
|
+
const flat = flattenLeafItems(filteredItems);
|
|
473
|
+
return itemToValue ? flat.map((item) => itemToValue(item)) : flat;
|
|
474
|
+
}, [
|
|
475
|
+
filteredItems,
|
|
476
|
+
filteredItemsProp,
|
|
477
|
+
externalWindow,
|
|
478
|
+
itemToValue
|
|
479
|
+
]);
|
|
480
|
+
const store = useRefWithInit(() => {
|
|
481
|
+
let initialSelectedIndex = null;
|
|
482
|
+
if (inlineProp && open && hasItems && selectionMode !== "none") initialSelectedIndex = findSelectionIndex(flatFilteredValues, selectedValue, isItemEqualToValue, multiple);
|
|
483
|
+
return new ReactStore({
|
|
484
|
+
id,
|
|
485
|
+
labelId: void 0,
|
|
486
|
+
selectedValue,
|
|
487
|
+
open,
|
|
488
|
+
items: storeItems,
|
|
489
|
+
selectionMode,
|
|
490
|
+
name,
|
|
491
|
+
form,
|
|
492
|
+
disabled,
|
|
493
|
+
readOnly,
|
|
494
|
+
required,
|
|
495
|
+
grid,
|
|
496
|
+
virtualized,
|
|
497
|
+
openOnInputClick,
|
|
498
|
+
itemToStringLabel,
|
|
499
|
+
isItemEqualToValue,
|
|
500
|
+
modal,
|
|
501
|
+
autoHighlight: autoHighlightMode,
|
|
502
|
+
submitOnItemClick,
|
|
503
|
+
hasInputValue,
|
|
504
|
+
mounted: false,
|
|
505
|
+
forceMounted: false,
|
|
506
|
+
transitionStatus: "idle",
|
|
507
|
+
inline: inlineProp,
|
|
508
|
+
activeIndex: null,
|
|
509
|
+
selectedIndex: initialSelectedIndex,
|
|
510
|
+
popupProps: {},
|
|
511
|
+
listProps: {},
|
|
512
|
+
inputProps: {},
|
|
513
|
+
triggerProps: {},
|
|
514
|
+
itemProps: EMPTY_OBJECT,
|
|
515
|
+
positionerElement: null,
|
|
516
|
+
listElement: null,
|
|
517
|
+
popupId: void 0,
|
|
518
|
+
triggerElement: null,
|
|
519
|
+
inputElement: null,
|
|
520
|
+
inputGroupElement: null,
|
|
521
|
+
popupSide: null,
|
|
522
|
+
openMethod: null,
|
|
523
|
+
inputInsidePopup: true,
|
|
524
|
+
inputOwnsFormValue: selectionMode === "none"
|
|
525
|
+
}, {
|
|
526
|
+
onOpenChangeComplete: NOOP,
|
|
527
|
+
setOpen: NOOP,
|
|
528
|
+
setInputValue: NOOP,
|
|
529
|
+
setSelectedValue: NOOP,
|
|
530
|
+
setIndices: NOOP,
|
|
531
|
+
handleSelection: NOOP,
|
|
532
|
+
forceMount: NOOP,
|
|
533
|
+
requestSubmit: NOOP,
|
|
534
|
+
listRef,
|
|
535
|
+
labelsRef,
|
|
536
|
+
popupRef,
|
|
537
|
+
emptyRef,
|
|
538
|
+
inputRef,
|
|
539
|
+
startDismissRef,
|
|
540
|
+
endDismissRef,
|
|
541
|
+
keyboardActiveRef,
|
|
542
|
+
chipsContainerRef,
|
|
543
|
+
clearRef,
|
|
544
|
+
valuesRef,
|
|
545
|
+
pointerDownItemRef,
|
|
546
|
+
selectionEventRef
|
|
547
|
+
}, selectors);
|
|
548
|
+
}).current;
|
|
476
549
|
const fieldRawValue = selectionMode === "none" ? inputValue : selectedValue;
|
|
477
550
|
const fieldStringValue = React$1.useMemo(() => {
|
|
478
551
|
if (selectionMode === "none") return fieldRawValue;
|
|
@@ -486,73 +559,94 @@ function AriaCombobox(props) {
|
|
|
486
559
|
]);
|
|
487
560
|
const onItemHighlighted = useStableCallback(onItemHighlightedProp);
|
|
488
561
|
const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp);
|
|
489
|
-
const activeIndex =
|
|
490
|
-
const selectedIndex =
|
|
491
|
-
const positionerElement =
|
|
492
|
-
const listElement =
|
|
493
|
-
const triggerElement =
|
|
494
|
-
const inputElement =
|
|
495
|
-
const inputGroupElement =
|
|
496
|
-
const inline =
|
|
497
|
-
const inputInsidePopup =
|
|
498
|
-
const inputOwnsFormValue =
|
|
562
|
+
const activeIndex = store.useState("activeIndex");
|
|
563
|
+
const selectedIndex = store.useState("selectedIndex");
|
|
564
|
+
const positionerElement = store.useState("positionerElement");
|
|
565
|
+
const listElement = store.useState("listElement");
|
|
566
|
+
const triggerElement = store.useState("triggerElement");
|
|
567
|
+
const inputElement = store.useState("inputElement");
|
|
568
|
+
const inputGroupElement = store.useState("inputGroupElement");
|
|
569
|
+
const inline = store.useState("inline");
|
|
570
|
+
const inputInsidePopup = store.useState("inputInsidePopup");
|
|
571
|
+
const inputOwnsFormValue = store.useState("inputOwnsFormValue");
|
|
572
|
+
const inputMatchesSelectedValue = single && !inputInsidePopup && inputValue === selectedLabelString;
|
|
499
573
|
const triggerRef = useValueAsRef(triggerElement);
|
|
500
574
|
const { mounted, setMounted, transitionStatus } = useTransitionStatus(open);
|
|
501
575
|
const { openMethod, triggerProps } = useOpenInteractionType(open);
|
|
502
576
|
const getStringifiedValueForForm = useStableCallback(() => fieldStringValue);
|
|
503
577
|
useRegisterFieldControl(inputInsidePopup ? triggerRef : inputRef, id, fieldRawValue, getStringifiedValueForForm, !disabled, nameProp);
|
|
504
578
|
const forceMount = useStableCallback(() => {
|
|
505
|
-
if (items) labelsRef.current =
|
|
579
|
+
if (items) labelsRef.current = flatFilteredValues.map(stringifyValueLabel);
|
|
506
580
|
else store.set("forceMounted", true);
|
|
507
581
|
});
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
582
|
+
/**
|
|
583
|
+
* Emits `onItemHighlighted` for the item at `index`, or clears the highlight when `index` is `-1`
|
|
584
|
+
* (a no-op if nothing was highlighted). Keeps `lastHighlightRef` in sync with what was emitted.
|
|
585
|
+
*/
|
|
586
|
+
const emitHighlight = useStableCallback((value, index, type) => {
|
|
587
|
+
if (index === -1) {
|
|
588
|
+
if (lastHighlightRef.current === INITIAL_LAST_HIGHLIGHT) return;
|
|
589
|
+
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
|
|
590
|
+
} else lastHighlightRef.current = {
|
|
591
|
+
value,
|
|
592
|
+
index
|
|
593
|
+
};
|
|
594
|
+
onItemHighlighted(value, createGenericEventDetails(type, void 0, { index }));
|
|
595
|
+
});
|
|
512
596
|
const setIndices = useStableCallback((options) => {
|
|
513
|
-
|
|
597
|
+
const update = {};
|
|
598
|
+
if (options.activeIndex !== void 0) update.activeIndex = options.activeIndex;
|
|
599
|
+
if (options.selectedIndex !== void 0) update.selectedIndex = options.selectedIndex;
|
|
600
|
+
store.update(update);
|
|
601
|
+
const activeIndexOption = options.activeIndex;
|
|
602
|
+
if (activeIndexOption === void 0) return;
|
|
514
603
|
const type = options.type || "none";
|
|
515
|
-
if (
|
|
516
|
-
|
|
517
|
-
if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {
|
|
518
|
-
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
|
|
519
|
-
onItemHighlighted(void 0, createGenericEventDetails(type, void 0, { index: -1 }));
|
|
520
|
-
}
|
|
521
|
-
} else {
|
|
522
|
-
const activeValue = valuesRef.current[options.activeIndex];
|
|
523
|
-
lastHighlightRef.current = {
|
|
524
|
-
value: activeValue,
|
|
525
|
-
index: options.activeIndex
|
|
526
|
-
};
|
|
527
|
-
onItemHighlighted(activeValue, createGenericEventDetails(type, void 0, { index: options.activeIndex }));
|
|
528
|
-
}
|
|
604
|
+
if (activeIndexOption === null) emitHighlight(void 0, -1, type);
|
|
605
|
+
else emitHighlight(valuesRef.current[activeIndexOption], activeIndexOption, type);
|
|
529
606
|
});
|
|
530
607
|
const setInputValue = useStableCallback((next, eventDetails) => {
|
|
531
|
-
hadInputClearRef.current = eventDetails.reason === inputClear;
|
|
532
608
|
props.onInputValueChange?.(next, eventDetails);
|
|
533
609
|
if (eventDetails.isCanceled) return;
|
|
610
|
+
hadInputClearRef.current = eventDetails.reason === inputClear;
|
|
534
611
|
if (eventDetails.reason === "input-change") {
|
|
612
|
+
if (open && closeQuery !== null) setCloseQuery(null);
|
|
535
613
|
const event = eventDetails.event;
|
|
536
614
|
const inputType = event.inputType;
|
|
537
615
|
if (event.type === "compositionend" || inputType != null && inputType !== "" && inputType !== "insertReplacementText") {
|
|
538
616
|
const hasQuery = next.trim() !== "";
|
|
539
617
|
if (hasQuery) setQueryChangedAfterOpen(true);
|
|
540
618
|
pendingQueryHighlightRef.current = { hasQuery };
|
|
541
|
-
|
|
619
|
+
const list = store.state.listElement;
|
|
620
|
+
if (!store.state.virtualized && list) {
|
|
621
|
+
const popup = popupRef.current;
|
|
622
|
+
for (const ancestor of getOverflowAncestors(list.firstElementChild ?? list)) {
|
|
623
|
+
if (!isHTMLElement(ancestor) || (popup ? !contains(popup, ancestor) : ancestor.getAttribute("role") === "dialog")) break;
|
|
624
|
+
if (isScrollableY(ancestor)) {
|
|
625
|
+
ancestor.scrollTop = 0;
|
|
626
|
+
break;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if (hasQuery && autoHighlightMode && store.state.activeIndex == null && (open || inline)) store.set("activeIndex", 0);
|
|
542
631
|
}
|
|
543
|
-
}
|
|
632
|
+
} else if (eventDetails.reason === "input-clear" && next === "" && store.state.inputInsidePopup) pendingQueryHighlightRef.current = {
|
|
633
|
+
hasQuery: false,
|
|
634
|
+
selection: true
|
|
635
|
+
};
|
|
544
636
|
setInputValueUnwrapped(next);
|
|
545
637
|
});
|
|
638
|
+
const handleInterruptedReopen = useStableCallback((isInputChange) => {
|
|
639
|
+
const clearsPendingInput = !isInputChange && inputInsidePopup && !inline && inputValue !== "" && (String(inputValue).trim() === closeQuery || inputValue === selectedLabelString);
|
|
640
|
+
if (!isInputChange && (clearsPendingInput || inputValue === "" || inputMatchesSelectedValue)) setQueryChangedAfterOpen(false);
|
|
641
|
+
setCloseQuery(null);
|
|
642
|
+
if (clearsPendingInput) setInputValue("", createChangeEventDetails(inputClear));
|
|
643
|
+
});
|
|
546
644
|
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
|
547
645
|
if (open === nextOpen) return;
|
|
548
|
-
if (eventDetails.reason === "escape-key" && hasItems &&
|
|
646
|
+
if (eventDetails.reason === "escape-key" && hasItems && flatFilteredValues.length === 0 && !emptyRef.current) eventDetails.allowPropagation();
|
|
549
647
|
props.onOpenChange?.(nextOpen, eventDetails);
|
|
550
648
|
if (eventDetails.isCanceled) return;
|
|
551
|
-
if (nextOpen &&
|
|
552
|
-
setQueryChangedAfterOpen(false);
|
|
553
|
-
setCloseQuery(null);
|
|
554
|
-
if (inputValue !== "") setInputValue("", createChangeEventDetails(inputClear, eventDetails.event));
|
|
555
|
-
}
|
|
649
|
+
if (nextOpen && closeQuery !== null) handleInterruptedReopen(eventDetails.reason === inputChange);
|
|
556
650
|
if (!nextOpen && queryChangedAfterOpen) {
|
|
557
651
|
if (single) {
|
|
558
652
|
if (!inline) setCloseQuery(query);
|
|
@@ -560,7 +654,7 @@ function AriaCombobox(props) {
|
|
|
560
654
|
} else if (multiple) {
|
|
561
655
|
if (!inline) setCloseQuery(query);
|
|
562
656
|
if (inputInsidePopup) setIndices({ activeIndex: null });
|
|
563
|
-
if (!inputInsidePopup || inline) setInputValue("", createChangeEventDetails(inputClear, eventDetails.event));
|
|
657
|
+
if (!inputInsidePopup || inline) setInputValue("", createChangeEventDetails(inputClear, eventDetails.event, void 0, { isItemPress: eventDetails.reason === itemPress }));
|
|
564
658
|
}
|
|
565
659
|
}
|
|
566
660
|
setOpenUnwrapped(nextOpen);
|
|
@@ -577,15 +671,9 @@ function AriaCombobox(props) {
|
|
|
577
671
|
onSelectedValueChange?.(nextValue, eventDetails);
|
|
578
672
|
if (eventDetails.isCanceled) return;
|
|
579
673
|
setSelectedValueUnwrapped(nextValue);
|
|
580
|
-
if (selectionMode === "none" && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup) setInputValue(
|
|
581
|
-
if (single && nextValue != null && eventDetails.reason !== "input-change" && queryChangedAfterOpen && !inline) setCloseQuery(query);
|
|
674
|
+
if (selectionMode === "none" && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup) setInputValue(stringifyValueLabel(nextValue), createChangeEventDetails(eventDetails.reason, eventDetails.event));
|
|
582
675
|
});
|
|
583
|
-
const handleSelection = useStableCallback((event,
|
|
584
|
-
let itemValue = passedValue;
|
|
585
|
-
if (itemValue === void 0) {
|
|
586
|
-
if (activeIndex === null) return;
|
|
587
|
-
itemValue = valuesRef.current[activeIndex];
|
|
588
|
-
}
|
|
676
|
+
const handleSelection = useStableCallback((event, itemValue) => {
|
|
589
677
|
const targetEl = getTarget(event);
|
|
590
678
|
const overrideEvent = selectionEventRef.current ?? event;
|
|
591
679
|
selectionEventRef.current = null;
|
|
@@ -597,12 +685,16 @@ function AriaCombobox(props) {
|
|
|
597
685
|
}
|
|
598
686
|
if (multiple) {
|
|
599
687
|
const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : [];
|
|
600
|
-
const
|
|
688
|
+
const isCurrentlySelected = selectedValueIncludes(currentSelectedValue, itemValue, isItemEqualToValue);
|
|
689
|
+
const nextValue = isCurrentlySelected ? removeItem(currentSelectedValue, itemValue, isItemEqualToValue) : [...currentSelectedValue, itemValue];
|
|
601
690
|
setSelectedValue(nextValue, eventDetails);
|
|
602
691
|
if (eventDetails.isCanceled) return;
|
|
603
692
|
if (!(inputRef.current ? inputRef.current.value.trim() !== "" : false)) return;
|
|
604
|
-
if (store.state.inputInsidePopup)
|
|
605
|
-
|
|
693
|
+
if (store.state.inputInsidePopup) {
|
|
694
|
+
setInputValue("", createChangeEventDetails(inputClear, eventDetails.event, void 0, { isItemPress: true }));
|
|
695
|
+
const pendingHighlight = pendingQueryHighlightRef.current;
|
|
696
|
+
if (pendingHighlight && !isCurrentlySelected) pendingHighlight.toggledValue = itemValue;
|
|
697
|
+
} else setOpen(false, eventDetails);
|
|
606
698
|
} else {
|
|
607
699
|
setSelectedValue(itemValue, eventDetails);
|
|
608
700
|
if (eventDetails.isCanceled) return;
|
|
@@ -610,7 +702,6 @@ function AriaCombobox(props) {
|
|
|
610
702
|
}
|
|
611
703
|
});
|
|
612
704
|
const requestSubmit = useStableCallback(() => {
|
|
613
|
-
if (!store.state.submitOnItemClick) return;
|
|
614
705
|
const formElement = validation.inputRef.current?.form ?? store.state.inputElement?.form;
|
|
615
706
|
if (formElement && typeof formElement.requestSubmit === "function") formElement.requestSubmit();
|
|
616
707
|
});
|
|
@@ -625,11 +716,13 @@ function AriaCombobox(props) {
|
|
|
625
716
|
});
|
|
626
717
|
else setIndices({ activeIndex: null });
|
|
627
718
|
if (multiple && inputRef.current && inputRef.current.value !== "" && !hadInputClearRef.current) setInputValue("", createChangeEventDetails(inputClear));
|
|
628
|
-
if (single)
|
|
629
|
-
if (
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
719
|
+
if (single) {
|
|
720
|
+
if (store.state.inputInsidePopup) {
|
|
721
|
+
if (inputRef.current && inputRef.current.value !== "") setInputValue("", createChangeEventDetails(inputClear));
|
|
722
|
+
} else {
|
|
723
|
+
const stringVal = stringifyValueLabel(selectedValue);
|
|
724
|
+
if (inputRef.current && inputRef.current.value !== stringVal) setInputValue(stringVal, createChangeEventDetails(stringVal === "" ? inputClear : none));
|
|
725
|
+
}
|
|
633
726
|
}
|
|
634
727
|
});
|
|
635
728
|
const resolvedPopupRef = React$1.useMemo(() => {
|
|
@@ -646,82 +739,87 @@ function AriaCombobox(props) {
|
|
|
646
739
|
});
|
|
647
740
|
React$1.useImperativeHandle(props.actionsRef, () => ({ unmount: handleUnmount }), [handleUnmount]);
|
|
648
741
|
useIsoLayoutEffect(function syncSelectedIndex() {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
if (
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
} else {
|
|
657
|
-
const index = findItemIndex(registry, selectedValue, isItemEqualToValue);
|
|
658
|
-
setIndices({ selectedIndex: index === -1 ? null : index });
|
|
659
|
-
}
|
|
742
|
+
const closeQueryReleased = previousCloseQueryRef.current !== null && closeQuery === null;
|
|
743
|
+
previousCloseQueryRef.current = closeQuery;
|
|
744
|
+
if (open && (!closeQueryReleased || !hasItems)) return;
|
|
745
|
+
if (!open) pointerDownItemRef.current = null;
|
|
746
|
+
if (selectionMode === "none") return;
|
|
747
|
+
const registry = hasItems ? flatFilteredValues : valuesRef.current;
|
|
748
|
+
setIndices({ selectedIndex: findSelectionIndex(registry, selectedValue, isItemEqualToValue, multiple) });
|
|
660
749
|
}, [
|
|
661
750
|
open,
|
|
751
|
+
closeQuery,
|
|
662
752
|
selectedValue,
|
|
663
|
-
items,
|
|
664
753
|
selectionMode,
|
|
665
|
-
flatItems,
|
|
666
754
|
multiple,
|
|
755
|
+
hasItems,
|
|
756
|
+
flatFilteredValues,
|
|
667
757
|
isItemEqualToValue,
|
|
668
758
|
setIndices
|
|
669
759
|
]);
|
|
670
760
|
useIsoLayoutEffect(() => {
|
|
671
761
|
if (items) {
|
|
672
|
-
valuesRef.current =
|
|
673
|
-
listRef.current.length =
|
|
762
|
+
valuesRef.current = flatFilteredValues;
|
|
763
|
+
listRef.current.length = flatFilteredValues.length;
|
|
674
764
|
}
|
|
675
|
-
}, [items,
|
|
765
|
+
}, [items, flatFilteredValues]);
|
|
676
766
|
useIsoLayoutEffect(() => {
|
|
677
767
|
const pendingHighlight = pendingQueryHighlightRef.current;
|
|
678
768
|
if (pendingHighlight) {
|
|
769
|
+
const listIsNavigable = open || inline || store.state.positionerElement?.hidden === false;
|
|
679
770
|
if (pendingHighlight.hasQuery) {
|
|
680
|
-
if (autoHighlightMode) store.set("activeIndex", 0);
|
|
681
|
-
|
|
682
|
-
|
|
771
|
+
if (autoHighlightMode && listIsNavigable) store.set("activeIndex", 0);
|
|
772
|
+
pendingQueryHighlightRef.current = null;
|
|
773
|
+
} else if (String(inputValue).trim() === "") {
|
|
774
|
+
pendingQueryHighlightRef.current = null;
|
|
775
|
+
if (listIsNavigable) {
|
|
776
|
+
const clearedBySelection = pendingHighlight.selection;
|
|
777
|
+
if (autoHighlightMode === "always" && !clearedBySelection && store.state.selectionMode === "none") store.set("activeIndex", 0);
|
|
778
|
+
queueMicrotask(() => {
|
|
779
|
+
if (!store.state.open && !store.state.inline || inputRef.current && inputRef.current.value.trim() !== "") return;
|
|
780
|
+
const currentSelectedValue = store.state.selectedValue;
|
|
781
|
+
const isMultiple = store.state.selectionMode === "multiple";
|
|
782
|
+
if (isMultiple && Array.isArray(currentSelectedValue) ? currentSelectedValue.length > 0 : store.state.selectionMode !== "none" && currentSelectedValue != null) {
|
|
783
|
+
const registry = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;
|
|
784
|
+
const toggledIndex = findItemIndex(registry, pendingHighlight.toggledValue, store.state.isItemEqualToValue);
|
|
785
|
+
store.set("activeIndex", toggledIndex !== -1 ? toggledIndex : findSelectionIndex(registry, currentSelectedValue, store.state.isItemEqualToValue, isMultiple));
|
|
786
|
+
} else if (clearedBySelection) store.set("activeIndex", null);
|
|
787
|
+
else if (autoHighlightMode === "always") store.set("activeIndex", 0);
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
}
|
|
683
791
|
}
|
|
684
792
|
if (!open && !inline) return;
|
|
685
|
-
const candidateItems = hasItems || hasFilteredItemsProp ?
|
|
793
|
+
const candidateItems = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;
|
|
686
794
|
const storeActiveIndex = store.state.activeIndex;
|
|
687
795
|
if (storeActiveIndex == null) {
|
|
688
796
|
if (autoHighlightMode === "always" && candidateItems.length > 0) {
|
|
689
797
|
store.set("activeIndex", 0);
|
|
690
798
|
return;
|
|
691
799
|
}
|
|
692
|
-
|
|
693
|
-
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
|
|
694
|
-
store.state.onItemHighlighted(void 0, createGenericEventDetails(none, void 0, { index: -1 }));
|
|
695
|
-
}
|
|
800
|
+
emitHighlight(void 0, -1, none);
|
|
696
801
|
return;
|
|
697
802
|
}
|
|
698
803
|
if (storeActiveIndex >= candidateItems.length) {
|
|
699
|
-
|
|
700
|
-
lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;
|
|
701
|
-
store.state.onItemHighlighted(void 0, createGenericEventDetails(none, void 0, { index: -1 }));
|
|
702
|
-
}
|
|
804
|
+
emitHighlight(void 0, -1, none);
|
|
703
805
|
store.set("activeIndex", null);
|
|
704
806
|
return;
|
|
705
807
|
}
|
|
706
808
|
const itemValue = candidateItems[storeActiveIndex];
|
|
707
809
|
const previouslyHighlightedItemValue = lastHighlightRef.current.value;
|
|
708
810
|
const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue);
|
|
709
|
-
if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem)
|
|
710
|
-
lastHighlightRef.current = {
|
|
711
|
-
value: itemValue,
|
|
712
|
-
index: storeActiveIndex
|
|
713
|
-
};
|
|
714
|
-
store.state.onItemHighlighted(itemValue, createGenericEventDetails(none, void 0, { index: storeActiveIndex }));
|
|
715
|
-
}
|
|
811
|
+
if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) emitHighlight(itemValue, storeActiveIndex, none);
|
|
716
812
|
}, [
|
|
717
813
|
activeIndex,
|
|
718
814
|
autoHighlightMode,
|
|
815
|
+
emitHighlight,
|
|
719
816
|
hasFilteredItemsProp,
|
|
720
817
|
hasItems,
|
|
721
|
-
|
|
818
|
+
flatFilteredValues,
|
|
722
819
|
inline,
|
|
723
820
|
open,
|
|
724
|
-
store
|
|
821
|
+
store,
|
|
822
|
+
inputValue
|
|
725
823
|
]);
|
|
726
824
|
useIsoLayoutEffect(() => {
|
|
727
825
|
if (selectionMode === "none") {
|
|
@@ -737,43 +835,48 @@ function AriaCombobox(props) {
|
|
|
737
835
|
multiple
|
|
738
836
|
]);
|
|
739
837
|
React$1.useEffect(() => {
|
|
740
|
-
if (hasItems && autoHighlightMode &&
|
|
838
|
+
if (hasItems && autoHighlightMode && flatFilteredValues.length === 0) setIndices({ activeIndex: null });
|
|
741
839
|
}, [
|
|
742
840
|
hasItems,
|
|
743
841
|
autoHighlightMode,
|
|
744
|
-
|
|
842
|
+
flatFilteredValues.length,
|
|
745
843
|
setIndices
|
|
746
844
|
]);
|
|
747
|
-
function
|
|
748
|
-
|
|
749
|
-
if (Array.isArray(value) && Array.isArray(initialValue)) return !areArraysEqual(value, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, isItemEqualToValue));
|
|
750
|
-
return value !== initialValue;
|
|
845
|
+
function handleQueryChanged() {
|
|
846
|
+
if (open && query !== "" && query !== String(initialDefaultInputValue) && !inputMatchesSelectedValue) setQueryChangedAfterOpen(true);
|
|
751
847
|
}
|
|
752
|
-
|
|
753
|
-
if (
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
848
|
+
function handleOpenChanged() {
|
|
849
|
+
if (open && closeQuery !== null) handleInterruptedReopen(false);
|
|
850
|
+
}
|
|
851
|
+
let syncedSelectedLabel = false;
|
|
852
|
+
function syncInputToSelectedLabel() {
|
|
853
|
+
if (!syncedSelectedLabel && inputValue !== selectedLabelString) {
|
|
854
|
+
syncedSelectedLabel = true;
|
|
855
|
+
setInputValue(selectedLabelString, createChangeEventDetails(none));
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
function handleSelectedValueChanged() {
|
|
757
859
|
if (selectionMode === "none") return;
|
|
758
860
|
clearErrors(name);
|
|
759
|
-
setDirty(isSelectedValueDirty(selectedValue));
|
|
861
|
+
setDirty(isSelectedValueDirty(selectedValue, validityData.initialValue, isItemEqualToValue));
|
|
760
862
|
validation.change(selectedValue);
|
|
761
|
-
if (single && !hasInputValue && !inputInsidePopup)
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
|
|
863
|
+
if (single && !hasInputValue && !inputInsidePopup) syncInputToSelectedLabel();
|
|
864
|
+
}
|
|
865
|
+
function syncInputAfterItemsOrLabelChange() {
|
|
866
|
+
if (single && !hasInputValue && !inputInsidePopup && !queryChangedAfterOpen) syncInputToSelectedLabel();
|
|
867
|
+
}
|
|
868
|
+
function handleInputValueChanged() {
|
|
767
869
|
if (selectionMode !== "none") return;
|
|
768
870
|
clearErrors(name);
|
|
769
871
|
setDirty(inputValue !== validityData.initialValue);
|
|
770
872
|
validation.change(inputValue);
|
|
771
|
-
}
|
|
772
|
-
useValueChanged(
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
873
|
+
}
|
|
874
|
+
useValueChanged(query, handleQueryChanged);
|
|
875
|
+
useValueChanged(open, handleOpenChanged);
|
|
876
|
+
useValueChanged(selectedValue, handleSelectedValueChanged);
|
|
877
|
+
useValueChanged(selectedLabelString, syncInputAfterItemsOrLabelChange);
|
|
878
|
+
useValueChanged(items, syncInputAfterItemsOrLabelChange);
|
|
879
|
+
useValueChanged(inputValue, handleInputValueChanged);
|
|
777
880
|
const floatingRootContext = useFloatingRootContext({
|
|
778
881
|
open: inline ? true : open,
|
|
779
882
|
onOpenChange: setOpen,
|
|
@@ -782,16 +885,13 @@ function AriaCombobox(props) {
|
|
|
782
885
|
floating: positionerElement
|
|
783
886
|
}
|
|
784
887
|
});
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
ariaHasPopup = grid ? "grid" : "listbox";
|
|
789
|
-
ariaExpanded = open ? "true" : "false";
|
|
790
|
-
}
|
|
888
|
+
const ariaHasPopup = grid ? "grid" : "listbox";
|
|
889
|
+
const expanded = open || inline;
|
|
890
|
+
const ariaExpanded = expanded ? "true" : "false";
|
|
791
891
|
const role = React$1.useMemo(() => {
|
|
792
892
|
const isPlainInput = inputElement?.tagName === "INPUT";
|
|
793
893
|
const shouldTreatAsInput = inputElement == null || isPlainInput;
|
|
794
|
-
const shouldApplyAria = shouldTreatAsInput ||
|
|
894
|
+
const shouldApplyAria = shouldTreatAsInput || expanded;
|
|
795
895
|
const reference = shouldTreatAsInput ? {
|
|
796
896
|
autoComplete: "off",
|
|
797
897
|
spellCheck: "false",
|
|
@@ -802,8 +902,8 @@ function AriaCombobox(props) {
|
|
|
802
902
|
reference.role = "combobox";
|
|
803
903
|
reference["aria-expanded"] = ariaExpanded;
|
|
804
904
|
reference["aria-haspopup"] = ariaHasPopup;
|
|
805
|
-
reference["aria-controls"] =
|
|
806
|
-
reference["aria-autocomplete"] = autoComplete;
|
|
905
|
+
reference["aria-controls"] = expanded ? listElement?.id : void 0;
|
|
906
|
+
reference["aria-autocomplete"] = readOnly ? "none" : autoComplete;
|
|
807
907
|
}
|
|
808
908
|
return {
|
|
809
909
|
reference,
|
|
@@ -811,21 +911,22 @@ function AriaCombobox(props) {
|
|
|
811
911
|
};
|
|
812
912
|
}, [
|
|
813
913
|
inputElement,
|
|
814
|
-
|
|
914
|
+
expanded,
|
|
815
915
|
ariaExpanded,
|
|
816
916
|
ariaHasPopup,
|
|
817
917
|
listElement?.id,
|
|
818
|
-
autoComplete
|
|
918
|
+
autoComplete,
|
|
919
|
+
readOnly
|
|
819
920
|
]);
|
|
820
921
|
const click = useClick(floatingRootContext, {
|
|
821
|
-
enabled: !
|
|
922
|
+
enabled: !disabled && openOnInputClick,
|
|
822
923
|
event: "mousedown-only",
|
|
823
924
|
toggle: false,
|
|
824
925
|
touchOpenDelay: inputInsidePopup ? 0 : 100,
|
|
825
926
|
reason: inputPress
|
|
826
927
|
});
|
|
827
928
|
const dismiss = useDismiss(floatingRootContext, {
|
|
828
|
-
enabled: !
|
|
929
|
+
enabled: !disabled && !inline,
|
|
829
930
|
outsidePressEvent: {
|
|
830
931
|
mouse: "sloppy",
|
|
831
932
|
touch: "intentional"
|
|
@@ -837,7 +938,7 @@ function AriaCombobox(props) {
|
|
|
837
938
|
}
|
|
838
939
|
});
|
|
839
940
|
const listNavigation = useListNavigation(floatingRootContext, {
|
|
840
|
-
enabled: !
|
|
941
|
+
enabled: !disabled,
|
|
841
942
|
id,
|
|
842
943
|
listRef,
|
|
843
944
|
activeIndex,
|
|
@@ -857,7 +958,7 @@ function AriaCombobox(props) {
|
|
|
857
958
|
if (!event) setIndices({ activeIndex: nextActiveIndex });
|
|
858
959
|
else setIndices({
|
|
859
960
|
activeIndex: nextActiveIndex,
|
|
860
|
-
type: keyboardActiveRef.current ?
|
|
961
|
+
type: keyboardActiveRef.current ? keyboard : pointer
|
|
861
962
|
});
|
|
862
963
|
}
|
|
863
964
|
});
|
|
@@ -871,11 +972,8 @@ function AriaCombobox(props) {
|
|
|
871
972
|
grid,
|
|
872
973
|
store
|
|
873
974
|
]);
|
|
874
|
-
const popupProps = React$1.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS,
|
|
875
|
-
|
|
876
|
-
dismiss.floating,
|
|
877
|
-
role.floating
|
|
878
|
-
]);
|
|
975
|
+
const popupProps = React$1.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, dismiss.floating), [dismiss.floating]);
|
|
976
|
+
const listProps = React$1.useMemo(() => mergeProps(listNavigation.floating, role.floating), [listNavigation.floating, role.floating]);
|
|
879
977
|
const itemProps = React$1.useMemo(() => {
|
|
880
978
|
const listNavigationItemProps = listNavigation.item;
|
|
881
979
|
if (!listNavigationItemProps) return EMPTY_OBJECT;
|
|
@@ -884,102 +982,71 @@ function AriaCombobox(props) {
|
|
|
884
982
|
onFocus: void 0
|
|
885
983
|
};
|
|
886
984
|
}, [listNavigation.item]);
|
|
985
|
+
store.useContextCallback("setOpen", setOpen);
|
|
986
|
+
store.useContextCallback("setInputValue", setInputValue);
|
|
987
|
+
store.useContextCallback("setSelectedValue", setSelectedValue);
|
|
988
|
+
store.useContextCallback("setIndices", setIndices);
|
|
989
|
+
store.useContextCallback("handleSelection", handleSelection);
|
|
990
|
+
store.useContextCallback("forceMount", forceMount);
|
|
991
|
+
store.useContextCallback("requestSubmit", requestSubmit);
|
|
992
|
+
store.useContextCallback("onOpenChangeComplete", onOpenChangeCompleteProp);
|
|
887
993
|
useOnFirstRender(() => {
|
|
888
994
|
store.update({
|
|
889
995
|
inline: inlineProp,
|
|
890
996
|
popupProps,
|
|
997
|
+
listProps,
|
|
891
998
|
inputProps,
|
|
892
999
|
triggerProps,
|
|
893
|
-
itemProps
|
|
894
|
-
setOpen,
|
|
895
|
-
setInputValue,
|
|
896
|
-
setSelectedValue,
|
|
897
|
-
setIndices,
|
|
898
|
-
onItemHighlighted,
|
|
899
|
-
handleSelection,
|
|
900
|
-
forceMount,
|
|
901
|
-
requestSubmit
|
|
1000
|
+
itemProps
|
|
902
1001
|
});
|
|
903
1002
|
});
|
|
904
|
-
|
|
905
|
-
store.update({
|
|
906
|
-
id,
|
|
907
|
-
selectedValue,
|
|
908
|
-
open,
|
|
909
|
-
mounted,
|
|
910
|
-
transitionStatus,
|
|
911
|
-
items,
|
|
912
|
-
inline: inlineProp,
|
|
913
|
-
popupProps,
|
|
914
|
-
inputProps,
|
|
915
|
-
triggerProps,
|
|
916
|
-
openMethod,
|
|
917
|
-
itemProps,
|
|
918
|
-
selectionMode,
|
|
919
|
-
name,
|
|
920
|
-
form,
|
|
921
|
-
disabled,
|
|
922
|
-
readOnly,
|
|
923
|
-
required,
|
|
924
|
-
grid,
|
|
925
|
-
isGrouped,
|
|
926
|
-
virtualized,
|
|
927
|
-
onOpenChangeComplete,
|
|
928
|
-
openOnInputClick,
|
|
929
|
-
itemToStringLabel,
|
|
930
|
-
modal,
|
|
931
|
-
autoHighlight: autoHighlightMode,
|
|
932
|
-
isItemEqualToValue,
|
|
933
|
-
submitOnItemClick,
|
|
934
|
-
hasInputValue,
|
|
935
|
-
requestSubmit,
|
|
936
|
-
inputOwnsFormValue: selectionMode === "none" && (inlineProp || !store.state.inputInsidePopup)
|
|
937
|
-
});
|
|
938
|
-
}, [
|
|
939
|
-
store,
|
|
1003
|
+
const syncedValues = {
|
|
940
1004
|
id,
|
|
941
1005
|
selectedValue,
|
|
942
1006
|
open,
|
|
943
1007
|
mounted,
|
|
944
1008
|
transitionStatus,
|
|
945
|
-
items,
|
|
1009
|
+
items: storeItems,
|
|
1010
|
+
inline: inlineProp,
|
|
946
1011
|
popupProps,
|
|
1012
|
+
listProps,
|
|
947
1013
|
inputProps,
|
|
1014
|
+
triggerProps,
|
|
948
1015
|
itemProps,
|
|
949
1016
|
openMethod,
|
|
950
|
-
triggerProps,
|
|
951
1017
|
selectionMode,
|
|
952
1018
|
name,
|
|
1019
|
+
form,
|
|
953
1020
|
disabled,
|
|
954
1021
|
readOnly,
|
|
955
1022
|
required,
|
|
956
|
-
validation,
|
|
957
1023
|
grid,
|
|
958
|
-
isGrouped,
|
|
959
1024
|
virtualized,
|
|
960
|
-
onOpenChangeComplete,
|
|
961
1025
|
openOnInputClick,
|
|
962
1026
|
itemToStringLabel,
|
|
963
1027
|
modal,
|
|
1028
|
+
autoHighlight: autoHighlightMode,
|
|
964
1029
|
isItemEqualToValue,
|
|
965
1030
|
submitOnItemClick,
|
|
966
|
-
hasInputValue
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1031
|
+
hasInputValue
|
|
1032
|
+
};
|
|
1033
|
+
useIsoLayoutEffect(() => {
|
|
1034
|
+
store.update({
|
|
1035
|
+
...syncedValues,
|
|
1036
|
+
inputOwnsFormValue: selectionMode === "none" && (inlineProp || !store.state.inputInsidePopup)
|
|
1037
|
+
});
|
|
1038
|
+
}, [store, ...Object.values(syncedValues)]);
|
|
972
1039
|
const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);
|
|
973
1040
|
const itemsContextValue = React$1.useMemo(() => ({
|
|
974
1041
|
query,
|
|
975
1042
|
hasItems,
|
|
976
1043
|
filteredItems,
|
|
977
|
-
|
|
1044
|
+
flatFilteredValues
|
|
978
1045
|
}), [
|
|
979
1046
|
query,
|
|
980
1047
|
hasItems,
|
|
981
1048
|
filteredItems,
|
|
982
|
-
|
|
1049
|
+
flatFilteredValues
|
|
983
1050
|
]);
|
|
984
1051
|
const serializedValue = React$1.useMemo(() => {
|
|
985
1052
|
if (Array.isArray(fieldRawValue)) return "";
|
|
@@ -1023,7 +1090,7 @@ function AriaCombobox(props) {
|
|
|
1023
1090
|
const nextValue = event.currentTarget.value;
|
|
1024
1091
|
const nextValueLower = nextValue.toLowerCase();
|
|
1025
1092
|
const details = createChangeEventDetails(none, event.nativeEvent);
|
|
1026
|
-
const findSerializedMatchIndex = () => valuesRef.current.findIndex((candidate) => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower ||
|
|
1093
|
+
const findSerializedMatchIndex = () => valuesRef.current.findIndex((candidate) => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyValueLabel(candidate).toLowerCase() === nextValueLower);
|
|
1027
1094
|
function handleChange() {
|
|
1028
1095
|
if (multiple) return;
|
|
1029
1096
|
if (selectionMode === "none") {
|
|
@@ -1078,23 +1145,32 @@ function AriaCombobox(props) {
|
|
|
1078
1145
|
})
|
|
1079
1146
|
});
|
|
1080
1147
|
}
|
|
1148
|
+
/**
|
|
1149
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
1150
|
+
* @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null}
|
|
1151
|
+
*/
|
|
1152
|
+
const popupSide = "data-popup-side";
|
|
1153
|
+
/**
|
|
1154
|
+
* Present when the corresponding items list is empty.
|
|
1155
|
+
*/
|
|
1156
|
+
const listEmpty = "data-list-empty";
|
|
1081
1157
|
//#endregion
|
|
1082
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1158
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/utils/stateAttributesMapping.mjs
|
|
1083
1159
|
const triggerStateAttributesMapping = {
|
|
1084
1160
|
...pressableTriggerOpenStateMapping,
|
|
1085
1161
|
...fieldValidityMapping,
|
|
1086
|
-
popupSide: (side) => side ? {
|
|
1087
|
-
listEmpty: (empty) => empty ? {
|
|
1162
|
+
popupSide: (side) => side ? { [popupSide]: side } : null,
|
|
1163
|
+
listEmpty: (empty) => empty ? { [listEmpty]: "" } : null
|
|
1088
1164
|
};
|
|
1089
1165
|
//#endregion
|
|
1090
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1166
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/chips/ComboboxChipsContext.mjs
|
|
1091
1167
|
const ComboboxChipsContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1092
1168
|
ComboboxChipsContext.displayName = "ComboboxChipsContext";
|
|
1093
1169
|
function useComboboxChipsContext() {
|
|
1094
1170
|
return React$1.useContext(ComboboxChipsContext);
|
|
1095
1171
|
}
|
|
1096
1172
|
//#endregion
|
|
1097
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1173
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/positioner/ComboboxPositionerContext.mjs
|
|
1098
1174
|
const ComboboxPositionerContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1099
1175
|
ComboboxPositionerContext.displayName = "ComboboxPositionerContext";
|
|
1100
1176
|
function useComboboxPositionerContext(optional) {
|
|
@@ -1103,7 +1179,7 @@ function useComboboxPositionerContext(optional) {
|
|
|
1103
1179
|
return context;
|
|
1104
1180
|
}
|
|
1105
1181
|
//#endregion
|
|
1106
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1182
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/utils/ComboboxInternalDismissButton.mjs
|
|
1107
1183
|
/**
|
|
1108
1184
|
* @internal
|
|
1109
1185
|
*/
|
|
@@ -1112,11 +1188,12 @@ const ComboboxInternalDismissButton = /*#__PURE__*/ React$1.forwardRef(function
|
|
|
1112
1188
|
const { buttonRef, getButtonProps } = useButton({ native: false });
|
|
1113
1189
|
const mergedRef = useMergedRefs(forwardedRef, buttonRef);
|
|
1114
1190
|
function handleDismiss(event) {
|
|
1115
|
-
store.
|
|
1191
|
+
store.context.setOpen(false, createChangeEventDetails(closePress, event.nativeEvent, event.currentTarget));
|
|
1116
1192
|
}
|
|
1193
|
+
const dismissProps = getButtonProps({ onClick: handleDismiss });
|
|
1117
1194
|
return /*#__PURE__*/ jsx("span", {
|
|
1118
1195
|
ref: mergedRef,
|
|
1119
|
-
...
|
|
1196
|
+
...dismissProps,
|
|
1120
1197
|
"aria-label": "Dismiss",
|
|
1121
1198
|
tabIndex: void 0,
|
|
1122
1199
|
style: visuallyHiddenInput
|
|
@@ -1124,7 +1201,50 @@ const ComboboxInternalDismissButton = /*#__PURE__*/ React$1.forwardRef(function
|
|
|
1124
1201
|
});
|
|
1125
1202
|
ComboboxInternalDismissButton.displayName = "ComboboxInternalDismissButton";
|
|
1126
1203
|
//#endregion
|
|
1127
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1204
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/utils/parts.mjs
|
|
1205
|
+
/**
|
|
1206
|
+
* The popup side is only meaningful while the positioner is mounted, as the store retains the
|
|
1207
|
+
* last resolved side after the popup unmounts.
|
|
1208
|
+
*/
|
|
1209
|
+
function usePopupSide(store) {
|
|
1210
|
+
const mounted = store.useState("mounted");
|
|
1211
|
+
const popupSide = store.useState("popupSide");
|
|
1212
|
+
const positionerElement = store.useState("positionerElement");
|
|
1213
|
+
return mounted && positionerElement ? popupSide : null;
|
|
1214
|
+
}
|
|
1215
|
+
/**
|
|
1216
|
+
* Whether the filtered list has no items to show.
|
|
1217
|
+
*/
|
|
1218
|
+
function useListEmpty() {
|
|
1219
|
+
return useComboboxDerivedItemsContext().filteredItems.length === 0;
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* The arrow keys that move the chip highlight backwards and forwards, in that order.
|
|
1223
|
+
*/
|
|
1224
|
+
function getChipNavigationKeys(direction) {
|
|
1225
|
+
return direction === "rtl" ? ["ArrowRight", "ArrowLeft"] : ["ArrowLeft", "ArrowRight"];
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Where the highlight lands once the chip at `index` is removed, or `undefined` for no highlight.
|
|
1229
|
+
*/
|
|
1230
|
+
function getIndexAfterChipRemoval(index, chipCount) {
|
|
1231
|
+
const nextIndex = index >= chipCount - 1 ? chipCount - 2 : index;
|
|
1232
|
+
return nextIndex >= 0 ? nextIndex : void 0;
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Commits the highlighted item by clicking it, tagging the originating event so the item's
|
|
1236
|
+
* handler can attribute the selection to it.
|
|
1237
|
+
*/
|
|
1238
|
+
function clickHighlightedItem(store, activeIndex, nativeEvent) {
|
|
1239
|
+
const listItem = store.context.listRef.current[activeIndex];
|
|
1240
|
+
if (listItem) {
|
|
1241
|
+
store.context.selectionEventRef.current = nativeEvent;
|
|
1242
|
+
listItem.click();
|
|
1243
|
+
store.context.selectionEventRef.current = null;
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
//#endregion
|
|
1247
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/input/ComboboxInput.mjs
|
|
1128
1248
|
/**
|
|
1129
1249
|
* A text input to search for items in the list.
|
|
1130
1250
|
* Renders an `<input>` element.
|
|
@@ -1139,34 +1259,30 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
|
|
|
1139
1259
|
const positioning = useComboboxPositionerContext(true);
|
|
1140
1260
|
const hasPositionerParent = Boolean(positioning);
|
|
1141
1261
|
const store = useComboboxRootContext();
|
|
1142
|
-
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
1143
1262
|
const inputValue = useComboboxInputValueContext();
|
|
1144
1263
|
const direction = useDirection();
|
|
1145
|
-
const required =
|
|
1146
|
-
const comboboxDisabled =
|
|
1147
|
-
const readOnly =
|
|
1148
|
-
const name =
|
|
1149
|
-
const form =
|
|
1150
|
-
const selectionMode =
|
|
1151
|
-
const autoHighlightMode =
|
|
1152
|
-
const inputProps =
|
|
1153
|
-
const triggerProps =
|
|
1154
|
-
const open =
|
|
1155
|
-
const mounted =
|
|
1156
|
-
const selectedValue =
|
|
1157
|
-
const
|
|
1158
|
-
const
|
|
1159
|
-
const
|
|
1160
|
-
const inline = useStore(store, selectors.inline);
|
|
1161
|
-
const modal = useStore(store, selectors.modal);
|
|
1264
|
+
const required = store.useState("required");
|
|
1265
|
+
const comboboxDisabled = store.useState("disabled");
|
|
1266
|
+
const readOnly = store.useState("readOnly");
|
|
1267
|
+
const name = store.useState("name");
|
|
1268
|
+
const form = store.useState("form");
|
|
1269
|
+
const selectionMode = store.useState("selectionMode");
|
|
1270
|
+
const autoHighlightMode = store.useState("autoHighlight");
|
|
1271
|
+
const inputProps = store.useState("inputProps");
|
|
1272
|
+
const triggerProps = store.useState("triggerProps");
|
|
1273
|
+
const open = store.useState("open");
|
|
1274
|
+
const mounted = store.useState("mounted");
|
|
1275
|
+
const selectedValue = store.useState("selectedValue");
|
|
1276
|
+
const rootId = store.useState("id");
|
|
1277
|
+
const inline = store.useState("inline");
|
|
1278
|
+
const modal = store.useState("modal");
|
|
1162
1279
|
const autoHighlightEnabled = Boolean(autoHighlightMode);
|
|
1163
|
-
const popupSide =
|
|
1280
|
+
const popupSide = usePopupSide(store);
|
|
1164
1281
|
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
1165
|
-
const listEmpty =
|
|
1282
|
+
const listEmpty = useListEmpty();
|
|
1166
1283
|
const isInsidePopup = hasPositionerParent || inline;
|
|
1167
1284
|
const focusManagerModal = !isInsidePopup || modal;
|
|
1168
1285
|
const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : void 0));
|
|
1169
|
-
const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, void 0);
|
|
1170
1286
|
const fieldStateForInput = hasPositionerParent ? DEFAULT_FIELD_STATE_ATTRIBUTES : fieldState;
|
|
1171
1287
|
const [composingValue, setComposingValue] = React$1.useState(null);
|
|
1172
1288
|
const isComposingRef = React$1.useRef(false);
|
|
@@ -1175,14 +1291,24 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
|
|
|
1175
1291
|
const inputOwnsFormValue = selectionMode === "none" && !hasPositionerParent;
|
|
1176
1292
|
const setInputElement = useStableCallback((element) => {
|
|
1177
1293
|
const nextIsInsidePopup = hasPositionerParent || store.state.inline;
|
|
1178
|
-
if (nextIsInsidePopup && !store.state.hasInputValue) store.
|
|
1294
|
+
if (nextIsInsidePopup && !store.state.hasInputValue) store.context.setInputValue("", createChangeEventDetails(none));
|
|
1179
1295
|
store.update({
|
|
1180
1296
|
inputElement: element,
|
|
1181
1297
|
inputInsidePopup: nextIsInsidePopup,
|
|
1182
1298
|
inputOwnsFormValue
|
|
1183
1299
|
});
|
|
1184
1300
|
});
|
|
1185
|
-
const validationProps = hasPositionerParent
|
|
1301
|
+
const validationProps = hasPositionerParent ? elementProps : validation.getValidationProps(disabled, elementProps);
|
|
1302
|
+
function clearHighlight() {
|
|
1303
|
+
store.context.setIndices({
|
|
1304
|
+
activeIndex: null,
|
|
1305
|
+
selectedIndex: null,
|
|
1306
|
+
type: store.context.keyboardActiveRef.current ? keyboard : pointer
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
function markPointerActive() {
|
|
1310
|
+
store.context.keyboardActiveRef.current = false;
|
|
1311
|
+
}
|
|
1186
1312
|
const state = {
|
|
1187
1313
|
...fieldStateForInput,
|
|
1188
1314
|
open,
|
|
@@ -1196,9 +1322,7 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
|
|
|
1196
1322
|
let nextIndex;
|
|
1197
1323
|
const { highlightedChipIndex } = comboboxChipsContext;
|
|
1198
1324
|
const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
|
|
1199
|
-
const
|
|
1200
|
-
const previousChipKey = isRtl ? "ArrowRight" : "ArrowLeft";
|
|
1201
|
-
const nextChipKey = isRtl ? "ArrowLeft" : "ArrowRight";
|
|
1325
|
+
const [previousChipKey, nextChipKey] = getChipNavigationKeys(direction);
|
|
1202
1326
|
if (highlightedChipIndex !== void 0) {
|
|
1203
1327
|
if (event.key === previousChipKey) {
|
|
1204
1328
|
event.preventDefault();
|
|
@@ -1210,26 +1334,14 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
|
|
|
1210
1334
|
else nextIndex = void 0;
|
|
1211
1335
|
} else if (event.key === "Backspace" || event.key === "Delete") {
|
|
1212
1336
|
event.preventDefault();
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
store.state.setIndices({
|
|
1216
|
-
activeIndex: null,
|
|
1217
|
-
selectedIndex: null,
|
|
1218
|
-
type: "keyboard"
|
|
1219
|
-
});
|
|
1337
|
+
nextIndex = getIndexAfterChipRemoval(highlightedChipIndex, selectedValue.length);
|
|
1338
|
+
clearHighlight();
|
|
1220
1339
|
}
|
|
1221
1340
|
return nextIndex;
|
|
1222
1341
|
}
|
|
1223
1342
|
if (event.key === previousChipKey && (event.currentTarget.selectionStart ?? 0) === 0 && selectedValue.length > 0) {
|
|
1224
1343
|
event.preventDefault();
|
|
1225
1344
|
nextIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : void 0;
|
|
1226
|
-
} else if (event.key === "Backspace" && event.currentTarget.value === "" && selectedValue.length > 0) {
|
|
1227
|
-
store.state.setIndices({
|
|
1228
|
-
activeIndex: null,
|
|
1229
|
-
selectedIndex: null,
|
|
1230
|
-
type: "keyboard"
|
|
1231
|
-
});
|
|
1232
|
-
event.preventDefault();
|
|
1233
1345
|
}
|
|
1234
1346
|
return nextIndex;
|
|
1235
1347
|
}
|
|
@@ -1237,18 +1349,17 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
|
|
|
1237
1349
|
state,
|
|
1238
1350
|
ref: [
|
|
1239
1351
|
forwardedRef,
|
|
1240
|
-
store.
|
|
1352
|
+
store.context.inputRef,
|
|
1241
1353
|
setInputElement
|
|
1242
1354
|
],
|
|
1243
1355
|
props: [
|
|
1244
1356
|
inputProps,
|
|
1245
1357
|
triggerProps,
|
|
1246
1358
|
{
|
|
1247
|
-
|
|
1248
|
-
value: componentProps.value ?? composingValue ?? inputValue,
|
|
1359
|
+
value: composingValue ?? inputValue,
|
|
1249
1360
|
"aria-readonly": readOnly || void 0,
|
|
1250
1361
|
"aria-required": required || void 0,
|
|
1251
|
-
"aria-labelledby":
|
|
1362
|
+
"aria-labelledby": fieldLabelId,
|
|
1252
1363
|
disabled,
|
|
1253
1364
|
readOnly,
|
|
1254
1365
|
required: selectionMode === "none" ? required : void 0,
|
|
@@ -1260,8 +1371,8 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
|
|
|
1260
1371
|
if (!inline || !shouldRestoreActiveIndexRef.current) return;
|
|
1261
1372
|
shouldRestoreActiveIndexRef.current = false;
|
|
1262
1373
|
const nextActiveIndex = lastActiveIndexRef.current;
|
|
1263
|
-
if (nextActiveIndex == null || !Object.hasOwn(store.
|
|
1264
|
-
store.
|
|
1374
|
+
if (nextActiveIndex == null || !Object.hasOwn(store.context.valuesRef.current, nextActiveIndex)) return;
|
|
1375
|
+
store.context.setIndices({ activeIndex: nextActiveIndex });
|
|
1265
1376
|
},
|
|
1266
1377
|
onBlur() {
|
|
1267
1378
|
setTouched(true);
|
|
@@ -1270,7 +1381,7 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
|
|
|
1270
1381
|
if (inline && activeIndex !== null && autoHighlightMode !== "always") {
|
|
1271
1382
|
lastActiveIndexRef.current = activeIndex;
|
|
1272
1383
|
shouldRestoreActiveIndexRef.current = true;
|
|
1273
|
-
store.
|
|
1384
|
+
store.context.setIndices({ activeIndex: null });
|
|
1274
1385
|
}
|
|
1275
1386
|
if (validationMode === "onBlur") {
|
|
1276
1387
|
const valueToValidate = selectionMode === "none" ? inputValue : selectedValue;
|
|
@@ -1286,65 +1397,47 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
|
|
|
1286
1397
|
isComposingRef.current = false;
|
|
1287
1398
|
const next = event.currentTarget.value;
|
|
1288
1399
|
setComposingValue(null);
|
|
1289
|
-
store.
|
|
1400
|
+
store.context.setInputValue(next, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
1290
1401
|
},
|
|
1291
1402
|
onChange(event) {
|
|
1292
|
-
const
|
|
1403
|
+
const nativeEvent = event.nativeEvent;
|
|
1404
|
+
const inputType = nativeEvent.inputType;
|
|
1293
1405
|
const autofillLikeInput = !inputType || inputType === "insertReplacementText";
|
|
1294
1406
|
const shouldOpenOnInput = isComposingRef.current || !autofillLikeInput;
|
|
1407
|
+
function maybeOpenOnInput(trimmed) {
|
|
1408
|
+
if (readOnly || disabled || !trimmed || !shouldOpenOnInput) return;
|
|
1409
|
+
store.context.setOpen(true, createChangeEventDetails(inputChange, nativeEvent));
|
|
1410
|
+
if (!autoHighlightEnabled) clearHighlight();
|
|
1411
|
+
}
|
|
1295
1412
|
if (isComposingRef.current) {
|
|
1296
1413
|
const nextVal = event.currentTarget.value;
|
|
1297
1414
|
setComposingValue(nextVal);
|
|
1298
|
-
if (nextVal === "" && !store.state.openOnInputClick && !store.state.inputInsidePopup) store.
|
|
1415
|
+
if (nextVal === "" && !store.state.openOnInputClick && !store.state.inputInsidePopup) store.context.setOpen(false, createChangeEventDetails(inputClear, nativeEvent));
|
|
1299
1416
|
const trimmed = nextVal.trim();
|
|
1300
1417
|
const shouldMaintainHighlight = autoHighlightEnabled && trimmed !== "";
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
store.state.setOpen(true, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
1304
|
-
if (!autoHighlightEnabled) store.state.setIndices({
|
|
1305
|
-
activeIndex: null,
|
|
1306
|
-
selectedIndex: null,
|
|
1307
|
-
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
1308
|
-
});
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) store.state.setIndices({
|
|
1312
|
-
activeIndex: null,
|
|
1313
|
-
selectedIndex: null,
|
|
1314
|
-
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
1315
|
-
});
|
|
1418
|
+
maybeOpenOnInput(trimmed);
|
|
1419
|
+
if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) clearHighlight();
|
|
1316
1420
|
return;
|
|
1317
1421
|
}
|
|
1318
|
-
const inputChangeDetails = createChangeEventDetails(inputChange,
|
|
1319
|
-
store.
|
|
1422
|
+
const inputChangeDetails = createChangeEventDetails(inputChange, nativeEvent);
|
|
1423
|
+
store.context.setInputValue(event.currentTarget.value, inputChangeDetails);
|
|
1320
1424
|
if (inputChangeDetails.isCanceled) return;
|
|
1321
1425
|
const empty = event.currentTarget.value === "";
|
|
1322
|
-
const clearDetails = createChangeEventDetails(inputClear,
|
|
1426
|
+
const clearDetails = createChangeEventDetails(inputClear, nativeEvent);
|
|
1323
1427
|
if (empty && !store.state.inputInsidePopup) {
|
|
1324
|
-
if (selectionMode === "single") store.
|
|
1325
|
-
if (!store.state.openOnInputClick) store.
|
|
1326
|
-
}
|
|
1327
|
-
const trimmed = event.currentTarget.value.trim();
|
|
1328
|
-
if (!readOnly && !disabled && trimmed) {
|
|
1329
|
-
if (shouldOpenOnInput) {
|
|
1330
|
-
store.state.setOpen(true, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
1331
|
-
if (!autoHighlightEnabled) store.state.setIndices({
|
|
1332
|
-
activeIndex: null,
|
|
1333
|
-
selectedIndex: null,
|
|
1334
|
-
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
1335
|
-
});
|
|
1336
|
-
}
|
|
1428
|
+
if (selectionMode === "single") store.context.setSelectedValue(null, clearDetails);
|
|
1429
|
+
if (!store.state.openOnInputClick) store.context.setOpen(false, clearDetails);
|
|
1337
1430
|
}
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
selectedIndex: null,
|
|
1341
|
-
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
1342
|
-
});
|
|
1431
|
+
maybeOpenOnInput(event.currentTarget.value.trim());
|
|
1432
|
+
if (open && store.state.activeIndex !== null && !autoHighlightEnabled) clearHighlight();
|
|
1343
1433
|
},
|
|
1344
1434
|
onKeyDown(event) {
|
|
1345
|
-
if (disabled || readOnly) return;
|
|
1346
1435
|
if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) return;
|
|
1347
|
-
store.
|
|
1436
|
+
store.context.keyboardActiveRef.current = true;
|
|
1437
|
+
if (disabled || readOnly) {
|
|
1438
|
+
if (readOnly && event.key === "Enter" && open && store.state.activeIndex !== null) stopEvent(event);
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1348
1441
|
const input = event.currentTarget;
|
|
1349
1442
|
const scrollAmount = input.scrollWidth - input.clientWidth;
|
|
1350
1443
|
const isRTL = direction === "rtl";
|
|
@@ -1366,8 +1459,8 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
|
|
|
1366
1459
|
const isClear = selectionMode === "multiple" && Array.isArray(selectedValue) ? selectedValue.length === 0 : selectedValue === null;
|
|
1367
1460
|
const details = createChangeEventDetails(escapeKey, event.nativeEvent);
|
|
1368
1461
|
const value = selectionMode === "multiple" ? [] : null;
|
|
1369
|
-
store.
|
|
1370
|
-
store.
|
|
1462
|
+
store.context.setInputValue("", details);
|
|
1463
|
+
store.context.setSelectedValue(value, details);
|
|
1371
1464
|
if (!isClear && !store.state.inline && !details.isPropagationAllowed) event.stopPropagation();
|
|
1372
1465
|
return;
|
|
1373
1466
|
}
|
|
@@ -1375,43 +1468,30 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
|
|
|
1375
1468
|
const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;
|
|
1376
1469
|
const removalIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : selectedValue.length - 1;
|
|
1377
1470
|
const newValue = selectedValue.filter((_, index) => index !== removalIndex);
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
selectedIndex: null,
|
|
1381
|
-
type: store.state.keyboardActiveRef.current ? "keyboard" : "pointer"
|
|
1382
|
-
});
|
|
1383
|
-
store.state.setSelectedValue(newValue, createChangeEventDetails(none, event.nativeEvent));
|
|
1471
|
+
clearHighlight();
|
|
1472
|
+
store.context.setSelectedValue(newValue, createChangeEventDetails(none, event.nativeEvent));
|
|
1384
1473
|
return;
|
|
1385
1474
|
}
|
|
1386
1475
|
const hadHighlightedChip = comboboxChipsContext?.highlightedChipIndex !== void 0;
|
|
1387
1476
|
const nextIndex = handleKeyDown(event);
|
|
1388
1477
|
comboboxChipsContext?.setHighlightedChipIndex(nextIndex);
|
|
1389
1478
|
if (nextIndex !== void 0) comboboxChipsContext?.chipsRef.current[nextIndex]?.focus();
|
|
1390
|
-
else if (hadHighlightedChip) store.
|
|
1479
|
+
else if (hadHighlightedChip) store.context.inputRef.current?.focus();
|
|
1391
1480
|
if (event.which === 229) return;
|
|
1392
1481
|
if (event.key === "Enter" && open) {
|
|
1393
1482
|
const activeIndex = store.state.activeIndex;
|
|
1394
1483
|
const nativeEvent = event.nativeEvent;
|
|
1395
1484
|
if (activeIndex === null) {
|
|
1396
1485
|
if (inline) return;
|
|
1397
|
-
store.
|
|
1486
|
+
store.context.setOpen(false, createChangeEventDetails(none, nativeEvent));
|
|
1398
1487
|
return;
|
|
1399
1488
|
}
|
|
1400
1489
|
stopEvent(event);
|
|
1401
|
-
|
|
1402
|
-
if (listItem) {
|
|
1403
|
-
store.state.selectionEventRef.current = nativeEvent;
|
|
1404
|
-
listItem.click();
|
|
1405
|
-
store.state.selectionEventRef.current = null;
|
|
1406
|
-
}
|
|
1490
|
+
clickHighlightedItem(store, activeIndex, nativeEvent);
|
|
1407
1491
|
}
|
|
1408
1492
|
},
|
|
1409
|
-
onPointerMove
|
|
1410
|
-
|
|
1411
|
-
},
|
|
1412
|
-
onPointerDown() {
|
|
1413
|
-
store.state.keyboardActiveRef.current = false;
|
|
1414
|
-
}
|
|
1493
|
+
onPointerMove: markPointerActive,
|
|
1494
|
+
onPointerDown: markPointerActive
|
|
1415
1495
|
},
|
|
1416
1496
|
validationProps
|
|
1417
1497
|
],
|
|
@@ -1421,11 +1501,11 @@ const ComboboxInput = /*#__PURE__*/ React$1.forwardRef(function ComboboxInput(co
|
|
|
1421
1501
|
value: DEFAULT_FIELD_ROOT_CONTEXT,
|
|
1422
1502
|
children: element
|
|
1423
1503
|
}) : element;
|
|
1424
|
-
return /*#__PURE__*/ jsxs(React$1.Fragment, { children: [open && focusManagerModal && /*#__PURE__*/ jsx(ComboboxInternalDismissButton, { ref: store.
|
|
1504
|
+
return /*#__PURE__*/ jsxs(React$1.Fragment, { children: [open && focusManagerModal && /*#__PURE__*/ jsx(ComboboxInternalDismissButton, { ref: store.context.startDismissRef }), renderedInput] });
|
|
1425
1505
|
});
|
|
1426
1506
|
ComboboxInput.displayName = "ComboboxInput";
|
|
1427
1507
|
//#endregion
|
|
1428
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1508
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/collection/GroupCollectionContext.mjs
|
|
1429
1509
|
const GroupCollectionContext = /*#__PURE__*/ React$1.createContext(null);
|
|
1430
1510
|
GroupCollectionContext.displayName = "GroupCollectionContext";
|
|
1431
1511
|
function useGroupCollectionContext() {
|
|
@@ -1440,7 +1520,7 @@ function GroupCollectionProvider(props) {
|
|
|
1440
1520
|
});
|
|
1441
1521
|
}
|
|
1442
1522
|
//#endregion
|
|
1443
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1523
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/collection/ComboboxCollection.mjs
|
|
1444
1524
|
/**
|
|
1445
1525
|
* Renders filtered list items.
|
|
1446
1526
|
* Doesn't render its own HTML element.
|
|
@@ -1454,11 +1534,10 @@ function ComboboxCollection(props) {
|
|
|
1454
1534
|
const { filteredItems } = useComboboxDerivedItemsContext();
|
|
1455
1535
|
const groupContext = useGroupCollectionContext();
|
|
1456
1536
|
const itemsToRender = groupContext ? groupContext.items : filteredItems;
|
|
1457
|
-
if (!itemsToRender) return null;
|
|
1458
1537
|
return /*#__PURE__*/ jsx(React$1.Fragment, { children: itemsToRender.map(children) });
|
|
1459
1538
|
}
|
|
1460
1539
|
//#endregion
|
|
1461
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1540
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/list/ComboboxList.mjs
|
|
1462
1541
|
/**
|
|
1463
1542
|
* A list container for the items.
|
|
1464
1543
|
* Renders a `<div>` element.
|
|
@@ -1472,11 +1551,12 @@ const ComboboxList = /*#__PURE__*/ React$1.forwardRef(function ComboboxList(comp
|
|
|
1472
1551
|
const floatingRootContext = useComboboxFloatingContext();
|
|
1473
1552
|
const hasPositionerContext = Boolean(useComboboxPositionerContext(true));
|
|
1474
1553
|
const { filteredItems, hasItems } = useComboboxDerivedItemsContext();
|
|
1475
|
-
const selectionMode =
|
|
1476
|
-
const grid =
|
|
1477
|
-
const
|
|
1478
|
-
const
|
|
1479
|
-
const
|
|
1554
|
+
const selectionMode = store.useState("selectionMode");
|
|
1555
|
+
const grid = store.useState("grid");
|
|
1556
|
+
const readOnly = store.useState("readOnly");
|
|
1557
|
+
const listProps = store.useState("listProps");
|
|
1558
|
+
const virtualized = store.useState("virtualized");
|
|
1559
|
+
const forceMounted = store.useState("forceMounted");
|
|
1480
1560
|
const multiple = selectionMode === "multiple";
|
|
1481
1561
|
const empty = filteredItems.length === 0;
|
|
1482
1562
|
const setPositionerElement = useStableCallback((element) => {
|
|
@@ -1499,49 +1579,44 @@ const ComboboxList = /*#__PURE__*/ React$1.forwardRef(function ComboboxList(comp
|
|
|
1499
1579
|
hasPositionerContext ? null : setPositionerElement
|
|
1500
1580
|
],
|
|
1501
1581
|
props: [
|
|
1502
|
-
|
|
1582
|
+
listProps,
|
|
1503
1583
|
{
|
|
1504
1584
|
children: resolvedChildren,
|
|
1505
1585
|
tabIndex: -1,
|
|
1506
1586
|
id: floatingId,
|
|
1507
1587
|
role: grid ? "grid" : "listbox",
|
|
1508
1588
|
"aria-multiselectable": multiple ? "true" : void 0,
|
|
1589
|
+
"aria-readonly": !grid && readOnly ? true : void 0,
|
|
1509
1590
|
onKeyDown(event) {
|
|
1510
1591
|
if (store.state.disabled || store.state.readOnly) return;
|
|
1511
1592
|
if (event.key === "Enter") {
|
|
1512
1593
|
const activeIndex = store.state.activeIndex;
|
|
1513
1594
|
if (activeIndex == null) return;
|
|
1514
1595
|
stopEvent(event);
|
|
1515
|
-
|
|
1516
|
-
const listItem = store.state.listRef.current[activeIndex];
|
|
1517
|
-
if (listItem) {
|
|
1518
|
-
store.state.selectionEventRef.current = nativeEvent;
|
|
1519
|
-
listItem.click();
|
|
1520
|
-
store.state.selectionEventRef.current = null;
|
|
1521
|
-
}
|
|
1596
|
+
clickHighlightedItem(store, activeIndex, event.nativeEvent);
|
|
1522
1597
|
}
|
|
1523
1598
|
},
|
|
1524
1599
|
onKeyDownCapture() {
|
|
1525
|
-
store.
|
|
1600
|
+
store.context.keyboardActiveRef.current = true;
|
|
1526
1601
|
},
|
|
1527
1602
|
onPointerMoveCapture() {
|
|
1528
|
-
store.
|
|
1603
|
+
store.context.keyboardActiveRef.current = false;
|
|
1529
1604
|
}
|
|
1530
1605
|
},
|
|
1531
1606
|
elementProps
|
|
1532
1607
|
]
|
|
1533
1608
|
});
|
|
1534
1609
|
if (virtualized) return element;
|
|
1535
|
-
const labelsRef = hasItems && !forceMounted ? void 0 : store.
|
|
1610
|
+
const labelsRef = hasItems && !forceMounted ? void 0 : store.context.labelsRef;
|
|
1536
1611
|
return /*#__PURE__*/ jsx(CompositeList, {
|
|
1537
|
-
elementsRef: store.
|
|
1612
|
+
elementsRef: store.context.listRef,
|
|
1538
1613
|
labelsRef,
|
|
1539
1614
|
children: element
|
|
1540
1615
|
});
|
|
1541
1616
|
});
|
|
1542
1617
|
ComboboxList.displayName = "ComboboxList";
|
|
1543
1618
|
//#endregion
|
|
1544
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1619
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/utils/useInitialLiveRegionTextMutation.mjs
|
|
1545
1620
|
const LIVE_REGION_MARKER = "";
|
|
1546
1621
|
function findLastTextNode(root) {
|
|
1547
1622
|
const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT);
|
|
@@ -1561,7 +1636,7 @@ function useInitialLiveRegionTextMutation() {
|
|
|
1561
1636
|
if (root == null) return;
|
|
1562
1637
|
const textNode = findLastTextNode(root);
|
|
1563
1638
|
if (textNode == null) return;
|
|
1564
|
-
const originalValue = textNode.
|
|
1639
|
+
const originalValue = textNode.data;
|
|
1565
1640
|
const markedValue = `${originalValue}${LIVE_REGION_MARKER}`;
|
|
1566
1641
|
textNode.nodeValue = markedValue;
|
|
1567
1642
|
timeout.start(200, () => {
|
|
@@ -1575,7 +1650,7 @@ function useInitialLiveRegionTextMutation() {
|
|
|
1575
1650
|
return rootRef;
|
|
1576
1651
|
}
|
|
1577
1652
|
//#endregion
|
|
1578
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1653
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/group/ComboboxGroupContext.mjs
|
|
1579
1654
|
const ComboboxGroupContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1580
1655
|
ComboboxGroupContext.displayName = "ComboboxGroupContext";
|
|
1581
1656
|
function useComboboxGroupContext() {
|
|
@@ -1584,7 +1659,7 @@ function useComboboxGroupContext() {
|
|
|
1584
1659
|
return context;
|
|
1585
1660
|
}
|
|
1586
1661
|
//#endregion
|
|
1587
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1662
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/group/ComboboxGroup.mjs
|
|
1588
1663
|
/**
|
|
1589
1664
|
* Groups related items with the corresponding label.
|
|
1590
1665
|
* Renders a `<div>` element.
|
|
@@ -1593,6 +1668,7 @@ function useComboboxGroupContext() {
|
|
|
1593
1668
|
*/
|
|
1594
1669
|
const ComboboxGroup = /*#__PURE__*/ React$1.forwardRef(function ComboboxGroup(componentProps, forwardedRef) {
|
|
1595
1670
|
const { render, className, style, items, ...elementProps } = componentProps;
|
|
1671
|
+
const grid = useComboboxRootContext().useState("grid");
|
|
1596
1672
|
const [labelId, setLabelId] = React$1.useState();
|
|
1597
1673
|
const contextValue = React$1.useMemo(() => ({
|
|
1598
1674
|
labelId,
|
|
@@ -1606,7 +1682,7 @@ const ComboboxGroup = /*#__PURE__*/ React$1.forwardRef(function ComboboxGroup(co
|
|
|
1606
1682
|
const element = useRenderElement("div", componentProps, {
|
|
1607
1683
|
ref: forwardedRef,
|
|
1608
1684
|
props: [{
|
|
1609
|
-
role: "group",
|
|
1685
|
+
role: grid ? "rowgroup" : "group",
|
|
1610
1686
|
"aria-labelledby": labelId
|
|
1611
1687
|
}, elementProps]
|
|
1612
1688
|
});
|
|
@@ -1622,7 +1698,7 @@ const ComboboxGroup = /*#__PURE__*/ React$1.forwardRef(function ComboboxGroup(co
|
|
|
1622
1698
|
});
|
|
1623
1699
|
ComboboxGroup.displayName = "ComboboxGroup";
|
|
1624
1700
|
//#endregion
|
|
1625
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1701
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/group-label/ComboboxGroupLabel.mjs
|
|
1626
1702
|
/**
|
|
1627
1703
|
* An accessible label that is automatically associated with its parent group.
|
|
1628
1704
|
* Renders a `<div>` element.
|
|
@@ -1636,17 +1712,20 @@ const ComboboxGroupLabel = /*#__PURE__*/ React$1.forwardRef(function ComboboxGro
|
|
|
1636
1712
|
useIsoLayoutEffect(() => {
|
|
1637
1713
|
setLabelId(id);
|
|
1638
1714
|
return () => {
|
|
1639
|
-
setLabelId(void 0);
|
|
1715
|
+
setLabelId((currentId) => currentId === id ? void 0 : currentId);
|
|
1640
1716
|
};
|
|
1641
1717
|
}, [id, setLabelId]);
|
|
1642
1718
|
return useRenderElement("div", componentProps, {
|
|
1643
1719
|
ref: forwardedRef,
|
|
1644
|
-
props: [{
|
|
1720
|
+
props: [{
|
|
1721
|
+
id,
|
|
1722
|
+
"aria-hidden": true
|
|
1723
|
+
}, elementProps]
|
|
1645
1724
|
});
|
|
1646
1725
|
});
|
|
1647
1726
|
ComboboxGroupLabel.displayName = "ComboboxGroupLabel";
|
|
1648
1727
|
//#endregion
|
|
1649
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1728
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/item/ComboboxItemContext.mjs
|
|
1650
1729
|
const ComboboxItemContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
1651
1730
|
ComboboxItemContext.displayName = "ComboboxItemContext";
|
|
1652
1731
|
function useComboboxItemContext() {
|
|
@@ -1655,44 +1734,44 @@ function useComboboxItemContext() {
|
|
|
1655
1734
|
return context;
|
|
1656
1735
|
}
|
|
1657
1736
|
//#endregion
|
|
1658
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1737
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/row/ComboboxRowContext.mjs
|
|
1659
1738
|
const ComboboxRowContext = /*#__PURE__*/ React$1.createContext(false);
|
|
1660
1739
|
ComboboxRowContext.displayName = "ComboboxRowContext";
|
|
1661
1740
|
function useComboboxRowContext() {
|
|
1662
1741
|
return React$1.useContext(ComboboxRowContext);
|
|
1663
1742
|
}
|
|
1664
1743
|
//#endregion
|
|
1665
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1744
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/item/ComboboxItem.mjs
|
|
1666
1745
|
function ComboboxItemInner(props) {
|
|
1667
1746
|
const { componentProps, forwardedRef, virtualized, indexFromFilter } = props;
|
|
1668
|
-
const { render, className, style, value: itemValue = null, index: indexProp, disabled = false, nativeButton = false, ...elementProps } = componentProps;
|
|
1669
|
-
const didPointerDownRef = React$1.useRef(false);
|
|
1747
|
+
const { render, className, style, value: itemValue = null, index: indexProp, disabled: disabledProp = false, nativeButton = false, ...elementProps } = componentProps;
|
|
1670
1748
|
const textRef = React$1.useRef(null);
|
|
1671
1749
|
const listItem = useCompositeListItem({
|
|
1750
|
+
guess: true,
|
|
1672
1751
|
index: indexProp,
|
|
1673
|
-
textRef
|
|
1674
|
-
indexGuessBehavior: IndexGuessBehavior.GuessFromOrder
|
|
1752
|
+
textRef
|
|
1675
1753
|
});
|
|
1676
1754
|
const store = useComboboxRootContext();
|
|
1677
1755
|
const isRow = useComboboxRowContext();
|
|
1678
1756
|
const hasItems = useComboboxHasItemsContext();
|
|
1679
|
-
const
|
|
1680
|
-
const
|
|
1681
|
-
const readOnly =
|
|
1682
|
-
const isItemEqualToValue =
|
|
1757
|
+
const selectionMode = store.useState("selectionMode");
|
|
1758
|
+
const rootDisabled = store.useState("disabled");
|
|
1759
|
+
const readOnly = store.useState("readOnly");
|
|
1760
|
+
const isItemEqualToValue = store.useState("isItemEqualToValue");
|
|
1761
|
+
const disabled = rootDisabled || disabledProp;
|
|
1683
1762
|
const selectable = selectionMode !== "none";
|
|
1684
|
-
const index = indexProp ??
|
|
1685
|
-
const hasRegistered =
|
|
1686
|
-
const rootId =
|
|
1687
|
-
const highlighted =
|
|
1688
|
-
const matchesSelectedValue =
|
|
1689
|
-
const itemProps =
|
|
1763
|
+
const index = indexProp ?? indexFromFilter ?? listItem.index;
|
|
1764
|
+
const hasRegistered = index !== -1;
|
|
1765
|
+
const rootId = store.useState("id");
|
|
1766
|
+
const highlighted = store.useState("isActive", index);
|
|
1767
|
+
const matchesSelectedValue = store.useState("isSelected", itemValue);
|
|
1768
|
+
const itemProps = store.useState("itemProps");
|
|
1690
1769
|
const itemRef = React$1.useRef(null);
|
|
1691
1770
|
const id = rootId != null && hasRegistered ? `${rootId}-${index}` : void 0;
|
|
1692
1771
|
const selected = matchesSelectedValue && selectable;
|
|
1693
1772
|
useIsoLayoutEffect(() => {
|
|
1694
1773
|
if (!(hasRegistered && (virtualized || indexProp != null))) return;
|
|
1695
|
-
const list = store.
|
|
1774
|
+
const list = store.context.listRef.current;
|
|
1696
1775
|
list[index] = itemRef.current;
|
|
1697
1776
|
return () => {
|
|
1698
1777
|
delete list[index];
|
|
@@ -1706,33 +1785,28 @@ function ComboboxItemInner(props) {
|
|
|
1706
1785
|
]);
|
|
1707
1786
|
useIsoLayoutEffect(() => {
|
|
1708
1787
|
if (!hasRegistered || hasItems) return;
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1711
|
-
if (selectionMode !== "none") store.state.allValuesRef.current.push(itemValue);
|
|
1788
|
+
const visibleValues = store.context.valuesRef.current;
|
|
1789
|
+
visibleValues[index] = itemValue;
|
|
1712
1790
|
return () => {
|
|
1713
|
-
delete
|
|
1791
|
+
delete visibleValues[index];
|
|
1714
1792
|
};
|
|
1715
1793
|
}, [
|
|
1716
1794
|
hasRegistered,
|
|
1717
1795
|
hasItems,
|
|
1718
1796
|
index,
|
|
1719
1797
|
itemValue,
|
|
1720
|
-
store
|
|
1721
|
-
selectionMode
|
|
1798
|
+
store
|
|
1722
1799
|
]);
|
|
1723
1800
|
useIsoLayoutEffect(() => {
|
|
1724
|
-
if (!open) {
|
|
1725
|
-
didPointerDownRef.current = false;
|
|
1726
|
-
return;
|
|
1727
|
-
}
|
|
1728
1801
|
if (!hasRegistered || hasItems) return;
|
|
1729
1802
|
const selectedValue = store.state.selectedValue;
|
|
1730
|
-
|
|
1731
|
-
if (
|
|
1803
|
+
let nextIndex = store.state.selectedIndex;
|
|
1804
|
+
if (store.state.selectionMode === "multiple" && Array.isArray(selectedValue)) nextIndex = resolveSelectedIndex(index, itemValue, store.context.valuesRef.current, selectedValue, isItemEqualToValue, nextIndex);
|
|
1805
|
+
else if (compareItemEquality(itemValue, selectedValue, isItemEqualToValue)) nextIndex = index;
|
|
1806
|
+
store.set("selectedIndex", nextIndex);
|
|
1732
1807
|
}, [
|
|
1733
1808
|
hasRegistered,
|
|
1734
1809
|
hasItems,
|
|
1735
|
-
open,
|
|
1736
1810
|
store,
|
|
1737
1811
|
index,
|
|
1738
1812
|
itemValue,
|
|
@@ -1751,11 +1825,11 @@ function ComboboxItemInner(props) {
|
|
|
1751
1825
|
};
|
|
1752
1826
|
function commitSelection(nativeEvent) {
|
|
1753
1827
|
function selectItem() {
|
|
1754
|
-
store.
|
|
1828
|
+
store.context.handleSelection(nativeEvent, itemValue);
|
|
1755
1829
|
}
|
|
1756
1830
|
if (store.state.submitOnItemClick) {
|
|
1757
1831
|
ReactDOM.flushSync(selectItem);
|
|
1758
|
-
store.
|
|
1832
|
+
store.context.requestSubmit();
|
|
1759
1833
|
} else selectItem();
|
|
1760
1834
|
}
|
|
1761
1835
|
const defaultProps = {
|
|
@@ -1764,7 +1838,7 @@ function ComboboxItemInner(props) {
|
|
|
1764
1838
|
"aria-selected": selectable ? selected : void 0,
|
|
1765
1839
|
tabIndex: void 0,
|
|
1766
1840
|
onPointerDownCapture(event) {
|
|
1767
|
-
|
|
1841
|
+
if (event.isPrimary) store.context.pointerDownItemRef.current = event.currentTarget;
|
|
1768
1842
|
event.preventDefault();
|
|
1769
1843
|
},
|
|
1770
1844
|
onMouseDown(event) {
|
|
@@ -1775,8 +1849,8 @@ function ComboboxItemInner(props) {
|
|
|
1775
1849
|
commitSelection(event.nativeEvent);
|
|
1776
1850
|
},
|
|
1777
1851
|
onMouseUp(event) {
|
|
1778
|
-
const pointerStartedOnItem =
|
|
1779
|
-
|
|
1852
|
+
const pointerStartedOnItem = store.context.pointerDownItemRef.current === event.currentTarget;
|
|
1853
|
+
store.context.pointerDownItemRef.current = null;
|
|
1780
1854
|
if (disabled || readOnly || event.button !== 0 || pointerStartedOnItem || !highlighted) return;
|
|
1781
1855
|
commitSelection(event.nativeEvent);
|
|
1782
1856
|
}
|
|
@@ -1814,13 +1888,15 @@ function ComboboxItemInner(props) {
|
|
|
1814
1888
|
*/
|
|
1815
1889
|
function ComboboxItemVirtualizedIndex(props) {
|
|
1816
1890
|
const { componentProps, forwardedRef } = props;
|
|
1817
|
-
const isItemEqualToValue =
|
|
1818
|
-
const {
|
|
1891
|
+
const isItemEqualToValue = useComboboxRootContext().useState("isItemEqualToValue");
|
|
1892
|
+
const { flatFilteredValues } = useComboboxDerivedItemsContext();
|
|
1893
|
+
const lookupValue = componentProps.value ?? null;
|
|
1894
|
+
const indexFromFilter = findItemIndex(flatFilteredValues, lookupValue, isItemEqualToValue);
|
|
1819
1895
|
return /*#__PURE__*/ jsx(ComboboxItemInner, {
|
|
1820
1896
|
componentProps,
|
|
1821
1897
|
forwardedRef,
|
|
1822
1898
|
virtualized: true,
|
|
1823
|
-
indexFromFilter
|
|
1899
|
+
indexFromFilter
|
|
1824
1900
|
});
|
|
1825
1901
|
}
|
|
1826
1902
|
/**
|
|
@@ -1830,7 +1906,7 @@ function ComboboxItemVirtualizedIndex(props) {
|
|
|
1830
1906
|
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1831
1907
|
*/
|
|
1832
1908
|
const ComboboxItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef(function ComboboxItem(componentProps, forwardedRef) {
|
|
1833
|
-
const virtualized =
|
|
1909
|
+
const virtualized = useComboboxRootContext().useState("virtualized");
|
|
1834
1910
|
if (virtualized && componentProps.index == null) return /*#__PURE__*/ jsx(ComboboxItemVirtualizedIndex, {
|
|
1835
1911
|
componentProps,
|
|
1836
1912
|
forwardedRef
|
|
@@ -1844,7 +1920,7 @@ const ComboboxItem = /*#__PURE__*/ React$1.memo(/*#__PURE__*/ React$1.forwardRef
|
|
|
1844
1920
|
}));
|
|
1845
1921
|
ComboboxItem.displayName = "ComboboxItem";
|
|
1846
1922
|
//#endregion
|
|
1847
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.
|
|
1923
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/combobox/empty/ComboboxEmpty.mjs
|
|
1848
1924
|
/**
|
|
1849
1925
|
* Renders its children only when the list is empty.
|
|
1850
1926
|
* Requires the `items` prop on the root component.
|
|
@@ -1866,7 +1942,7 @@ const ComboboxEmpty = /*#__PURE__*/ React$1.forwardRef(function ComboboxEmpty(co
|
|
|
1866
1942
|
return useRenderElement("div", componentProps, {
|
|
1867
1943
|
ref: [
|
|
1868
1944
|
forwardedRef,
|
|
1869
|
-
store.
|
|
1945
|
+
store.context.emptyRef,
|
|
1870
1946
|
emptyRef
|
|
1871
1947
|
],
|
|
1872
1948
|
props: [{
|
|
@@ -1879,4 +1955,4 @@ const ComboboxEmpty = /*#__PURE__*/ React$1.forwardRef(function ComboboxEmpty(co
|
|
|
1879
1955
|
});
|
|
1880
1956
|
ComboboxEmpty.displayName = "ComboboxEmpty";
|
|
1881
1957
|
//#endregion
|
|
1882
|
-
export {
|
|
1958
|
+
export { useComboboxFilter as C, useComboboxFloatingContext as D, useComboboxDerivedItemsContext as E, useComboboxInputValueContext as O, findCollectionItem as S, getComboboxPopupId as T, useComboboxPositionerContext as _, ComboboxGroupLabel as a, triggerStateAttributesMapping as b, ComboboxList as c, getChipNavigationKeys as d, getIndexAfterChipRemoval as f, ComboboxPositionerContext as g, ComboboxInternalDismissButton as h, useComboboxItemContext as i, useComboboxRootContext as k, ComboboxCollection as l, usePopupSide as m, ComboboxItem as n, ComboboxGroup as o, useListEmpty as p, ComboboxRowContext as r, useInitialLiveRegionTextMutation as s, ComboboxEmpty as t, ComboboxInput as u, ComboboxChipsContext as v, useCoreFilter as w, AriaCombobox as x, useComboboxChipsContext as y };
|