@nvidia-elements/core 0.1.0 → 0.1.1
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 +23 -0
- package/dist/_virtual/{_@oxc-project_runtime@0.123.0 → _@oxc-project_runtime@0.128.0}/helpers/decorate.js +1 -1
- package/dist/accordion/accordion2.js +12 -12
- package/dist/accordion/accordion2.js.map +1 -1
- package/dist/alert/alert-group2.js +2 -2
- package/dist/alert/alert-group2.js.map +1 -1
- package/dist/alert/alert2.js +5 -5
- package/dist/alert/alert2.js.map +1 -1
- package/dist/avatar/avatar-group2.js +1 -1
- package/dist/avatar/avatar-group2.js.map +1 -1
- package/dist/avatar/avatar2.js +2 -2
- package/dist/avatar/avatar2.js.map +1 -1
- package/dist/badge/badge2.js +4 -4
- package/dist/badge/badge2.js.map +1 -1
- package/dist/breadcrumb/breadcrumb2.js +2 -2
- package/dist/breadcrumb/breadcrumb2.js.map +1 -1
- package/dist/bundles/index.js +3 -3
- package/dist/button/button2.js +2 -2
- package/dist/button/button2.js.map +1 -1
- package/dist/button-group/button-group2.js +4 -4
- package/dist/button-group/button-group2.js.map +1 -1
- package/dist/card/card2.js +5 -5
- package/dist/card/card2.js.map +1 -1
- package/dist/chat-message/chat-message2.js +2 -2
- package/dist/chat-message/chat-message2.js.map +1 -1
- package/dist/checkbox/checkbox-group2.js +2 -2
- package/dist/checkbox/checkbox2.js +2 -2
- package/dist/color/color2.js +2 -2
- package/dist/color/color2.js.map +1 -1
- package/dist/combobox/combobox2.js +6 -6
- package/dist/combobox/combobox2.js.map +1 -1
- package/dist/copy-button/copy-button2.js +17 -17
- package/dist/copy-button/copy-button2.js.map +1 -1
- package/dist/custom-elements.json +2 -41
- package/dist/date/date2.js +2 -2
- package/dist/date/date2.js.map +1 -1
- package/dist/datetime/datetime2.js +2 -2
- package/dist/datetime/datetime2.js.map +1 -1
- package/dist/dialog/dialog-footer2.js +2 -2
- package/dist/dialog/dialog-footer2.js.map +1 -1
- package/dist/dialog/dialog-header2.js +2 -2
- package/dist/dialog/dialog-header2.js.map +1 -1
- package/dist/dialog/dialog2.js +4 -4
- package/dist/dialog/dialog2.js.map +1 -1
- package/dist/divider/divider2.js +2 -2
- package/dist/divider/divider2.js.map +1 -1
- package/dist/dot/dot2.js +2 -2
- package/dist/dot/dot2.js.map +1 -1
- package/dist/drawer/drawer-content2.js +2 -2
- package/dist/drawer/drawer-content2.js.map +1 -1
- package/dist/drawer/drawer-footer2.js +2 -2
- package/dist/drawer/drawer-footer2.js.map +1 -1
- package/dist/drawer/drawer-header2.js +2 -2
- package/dist/drawer/drawer-header2.js.map +1 -1
- package/dist/drawer/drawer2.js +8 -8
- package/dist/drawer/drawer2.js.map +1 -1
- package/dist/dropdown/dropdown-footer2.js +2 -2
- package/dist/dropdown/dropdown-footer2.js.map +1 -1
- package/dist/dropdown/dropdown-header2.js +2 -2
- package/dist/dropdown/dropdown-header2.js.map +1 -1
- package/dist/dropdown/dropdown2.js +4 -4
- package/dist/dropdown/dropdown2.js.map +1 -1
- package/dist/dropdown-group/dropdown-group.js +2 -2
- package/dist/dropdown-group/dropdown-group.js.map +1 -1
- package/dist/dropzone/dropzone.util.js.map +1 -1
- package/dist/dropzone/dropzone2.js +4 -4
- package/dist/dropzone/dropzone2.js.map +1 -1
- package/dist/file/file2.js +1 -1
- package/dist/file/file2.js.map +1 -1
- package/dist/format-datetime/format-datetime2.js +2 -2
- package/dist/format-datetime/format-datetime2.js.map +1 -1
- package/dist/format-number/format-number2.js +2 -2
- package/dist/format-number/format-number2.js.map +1 -1
- package/dist/format-relative-time/format-relative-time2.js +2 -2
- package/dist/format-relative-time/format-relative-time2.js.map +1 -1
- package/dist/forms/control/control2.js +19 -15
- package/dist/forms/control/control2.js.map +1 -1
- package/dist/forms/control-group/control-group2.js +2 -2
- package/dist/forms/control-group/control-group2.js.map +1 -1
- package/dist/forms/control-message/control-message2.js +2 -2
- package/dist/forms/control-message/control-message2.js.map +1 -1
- package/dist/forms/utils/layout.d.ts +2 -1
- package/dist/forms/utils/layout.js.map +1 -1
- package/dist/forms/utils/states.d.ts +0 -1
- package/dist/forms/utils/states.js.map +1 -1
- package/dist/forms/utils/types.d.ts +0 -24
- package/dist/grid/cell/cell2.js +1 -1
- package/dist/grid/cell/cell2.js.map +1 -1
- package/dist/grid/column/column2.js +2 -2
- package/dist/grid/column/column2.js.map +1 -1
- package/dist/grid/footer/footer2.js +2 -2
- package/dist/grid/footer/footer2.js.map +1 -1
- package/dist/grid/grid2.js +2 -2
- package/dist/grid/grid2.js.map +1 -1
- package/dist/grid/header/header2.js +2 -2
- package/dist/grid/header/header2.js.map +1 -1
- package/dist/grid/placeholder/placeholder2.js +1 -1
- package/dist/grid/placeholder/placeholder2.js.map +1 -1
- package/dist/grid/row/row2.js +2 -2
- package/dist/grid/row/row2.js.map +1 -1
- package/dist/icon/icon2.js +3 -3
- package/dist/icon/icon2.js.map +1 -1
- package/dist/icon/icons/academic-cap.js.map +1 -1
- package/dist/icon/icons/add-asset.js.map +1 -1
- package/dist/icon/icons/add-comment.js.map +1 -1
- package/dist/icon/icons/add-grid.js.map +1 -1
- package/dist/icon/icons/add-user.js.map +1 -1
- package/dist/icon/icons/add.js.map +1 -1
- package/dist/icon/icons/ancestors.js.map +1 -1
- package/dist/icon/icons/archive.js.map +1 -1
- package/dist/icon/icons/arrow-angle.js.map +1 -1
- package/dist/icon/icons/arrow-both.js.map +1 -1
- package/dist/icon/icons/arrow-cycle.js.map +1 -1
- package/dist/icon/icons/arrow-path-rounded-square.js.map +1 -1
- package/dist/icon/icons/arrow-stop.js.map +1 -1
- package/dist/icon/icons/arrow.js.map +1 -1
- package/dist/icon/icons/at-symbol.js.map +1 -1
- package/dist/icon/icons/backspace.js.map +1 -1
- package/dist/icon/icons/bar-pill-stack.js.map +1 -1
- package/dist/icon/icons/bars-3-bottom-left.js.map +1 -1
- package/dist/icon/icons/bars-3-bottom-right.js.map +1 -1
- package/dist/icon/icons/bars-3-center-left.js.map +1 -1
- package/dist/icon/icons/bars-3.js.map +1 -1
- package/dist/icon/icons/bars-4.js.map +1 -1
- package/dist/icon/icons/beaker.js.map +1 -1
- package/dist/icon/icons/bell-slash.js.map +1 -1
- package/dist/icon/icons/bell-stroke.js.map +1 -1
- package/dist/icon/icons/bell.js.map +1 -1
- package/dist/icon/icons/bold.js.map +1 -1
- package/dist/icon/icons/book.js.map +1 -1
- package/dist/icon/icons/bookmark-stroke.js.map +1 -1
- package/dist/icon/icons/bookmark.js.map +1 -1
- package/dist/icon/icons/bounding-box.js.map +1 -1
- package/dist/icon/icons/branch.js.map +1 -1
- package/dist/icon/icons/briefcase.js.map +1 -1
- package/dist/icon/icons/broadcast.js.map +1 -1
- package/dist/icon/icons/browser.js.map +1 -1
- package/dist/icon/icons/bug.js.map +1 -1
- package/dist/icon/icons/calendar.js.map +1 -1
- package/dist/icon/icons/camera.js.map +1 -1
- package/dist/icon/icons/cancel.js.map +1 -1
- package/dist/icon/icons/caret.js.map +1 -1
- package/dist/icon/icons/carets-closed-square.js.map +1 -1
- package/dist/icon/icons/carousel.js.map +1 -1
- package/dist/icon/icons/category-list.js.map +1 -1
- package/dist/icon/icons/chart-bar.js.map +1 -1
- package/dist/icon/icons/chat-bubble.js.map +1 -1
- package/dist/icon/icons/chat-bubbles.js.map +1 -1
- package/dist/icon/icons/check-badge.js.map +1 -1
- package/dist/icon/icons/check.js.map +1 -1
- package/dist/icon/icons/checklist.js.map +1 -1
- package/dist/icon/icons/checkmark-circle.js.map +1 -1
- package/dist/icon/icons/chevron.js.map +1 -1
- package/dist/icon/icons/chip.js.map +1 -1
- package/dist/icon/icons/circle-angled-line.js.map +1 -1
- package/dist/icon/icons/circle-dash.js.map +1 -1
- package/dist/icon/icons/circle-dot-arrows.js.map +1 -1
- package/dist/icon/icons/circle-dot.js.map +1 -1
- package/dist/icon/icons/circle-half.js.map +1 -1
- package/dist/icon/icons/circle-rule.js.map +1 -1
- package/dist/icon/icons/circle-tick.js.map +1 -1
- package/dist/icon/icons/circle.js.map +1 -1
- package/dist/icon/icons/clipboard.js.map +1 -1
- package/dist/icon/icons/clock-circle-arrow.js.map +1 -1
- package/dist/icon/icons/clock.js.map +1 -1
- package/dist/icon/icons/cloud-download.js.map +1 -1
- package/dist/icon/icons/cloud-upload.js.map +1 -1
- package/dist/icon/icons/cloud.js.map +1 -1
- package/dist/icon/icons/code.js.map +1 -1
- package/dist/icon/icons/collapse-all.js.map +1 -1
- package/dist/icon/icons/collapse-details.js.map +1 -1
- package/dist/icon/icons/color-palette.js.map +1 -1
- package/dist/icon/icons/columns.js.map +1 -1
- package/dist/icon/icons/compare.js.map +1 -1
- package/dist/icon/icons/computer.js.map +1 -1
- package/dist/icon/icons/connect-node.js.map +1 -1
- package/dist/icon/icons/connected-blocks.js.map +1 -1
- package/dist/icon/icons/copy.js.map +1 -1
- package/dist/icon/icons/cross-hairs.js.map +1 -1
- package/dist/icon/icons/cursor-rays.js.map +1 -1
- package/dist/icon/icons/cursor-ripples.js.map +1 -1
- package/dist/icon/icons/data-management.js.map +1 -1
- package/dist/icon/icons/delete-node.js.map +1 -1
- package/dist/icon/icons/delete.js.map +1 -1
- package/dist/icon/icons/doc-checkmark.js.map +1 -1
- package/dist/icon/icons/dock-bottom.js.map +1 -1
- package/dist/icon/icons/dock-none.js.map +1 -1
- package/dist/icon/icons/dock-side.js.map +1 -1
- package/dist/icon/icons/document-clipboard.js.map +1 -1
- package/dist/icon/icons/document.js.map +1 -1
- package/dist/icon/icons/dot-stroke.js.map +1 -1
- package/dist/icon/icons/dot.js.map +1 -1
- package/dist/icon/icons/double-chevron.js.map +1 -1
- package/dist/icon/icons/download.js.map +1 -1
- package/dist/icon/icons/drag.js.map +1 -1
- package/dist/icon/icons/dropper.js.map +1 -1
- package/dist/icon/icons/duplicate.js.map +1 -1
- package/dist/icon/icons/edit.js.map +1 -1
- package/dist/icon/icons/ellipses.js.map +1 -1
- package/dist/icon/icons/envelope.js.map +1 -1
- package/dist/icon/icons/exclamation-circle.js.map +1 -1
- package/dist/icon/icons/exclamation-mark.js.map +1 -1
- package/dist/icon/icons/exclamation-triangle.js.map +1 -1
- package/dist/icon/icons/expand-all.js.map +1 -1
- package/dist/icon/icons/expand-details.js.map +1 -1
- package/dist/icon/icons/expression.js.map +1 -1
- package/dist/icon/icons/eye-hidden.js.map +1 -1
- package/dist/icon/icons/eye.js.map +1 -1
- package/dist/icon/icons/face-frown.js.map +1 -1
- package/dist/icon/icons/face-smile.js.map +1 -1
- package/dist/icon/icons/fast-forward-10.js.map +1 -1
- package/dist/icon/icons/fast-forward.js.map +1 -1
- package/dist/icon/icons/film.js.map +1 -1
- package/dist/icon/icons/filter-stroke.js.map +1 -1
- package/dist/icon/icons/filter.js.map +1 -1
- package/dist/icon/icons/flag-stroke.js.map +1 -1
- package/dist/icon/icons/flag.js.map +1 -1
- package/dist/icon/icons/fold.js.map +1 -1
- package/dist/icon/icons/folder.js.map +1 -1
- package/dist/icon/icons/fork.js.map +1 -1
- package/dist/icon/icons/gear.js.map +1 -1
- package/dist/icon/icons/globe-alt-stroke.js.map +1 -1
- package/dist/icon/icons/globe.js.map +1 -1
- package/dist/icon/icons/group-boxes.js.map +1 -1
- package/dist/icon/icons/group.js.map +1 -1
- package/dist/icon/icons/hand.js.map +1 -1
- package/dist/icon/icons/hash.js.map +1 -1
- package/dist/icon/icons/heading.js.map +1 -1
- package/dist/icon/icons/home.js.map +1 -1
- package/dist/icon/icons/horizontal-rule.js.map +1 -1
- package/dist/icon/icons/hourglass-end.js.map +1 -1
- package/dist/icon/icons/hourglass-mid.js.map +1 -1
- package/dist/icon/icons/hourglass-start.js.map +1 -1
- package/dist/icon/icons/hourglass.js.map +1 -1
- package/dist/icon/icons/identification.js.map +1 -1
- package/dist/icon/icons/image.js.map +1 -1
- package/dist/icon/icons/inbox.js.map +1 -1
- package/dist/icon/icons/infinity.js.map +1 -1
- package/dist/icon/icons/information-circle-stroke.js.map +1 -1
- package/dist/icon/icons/inspect.js.map +1 -1
- package/dist/icon/icons/italic.js.map +1 -1
- package/dist/icon/icons/key.js.map +1 -1
- package/dist/icon/icons/keyboard.js.map +1 -1
- package/dist/icon/icons/laptop-phone.js.map +1 -1
- package/dist/icon/icons/layers.js.map +1 -1
- package/dist/icon/icons/lifebuoy.js.map +1 -1
- package/dist/icon/icons/lightbulb.js.map +1 -1
- package/dist/icon/icons/lightning-bolt.js.map +1 -1
- package/dist/icon/icons/link.js.map +1 -1
- package/dist/icon/icons/list-ordered.js.map +1 -1
- package/dist/icon/icons/list-unordered.js.map +1 -1
- package/dist/icon/icons/lock.js.map +1 -1
- package/dist/icon/icons/login.js.map +1 -1
- package/dist/icon/icons/logout.js.map +1 -1
- package/dist/icon/icons/looping-off.js.map +1 -1
- package/dist/icon/icons/looping.js.map +1 -1
- package/dist/icon/icons/map-drives.js.map +1 -1
- package/dist/icon/icons/map-pin.js.map +1 -1
- package/dist/icon/icons/map.js.map +1 -1
- package/dist/icon/icons/markdown.js.map +1 -1
- package/dist/icon/icons/maximize.js.map +1 -1
- package/dist/icon/icons/megaphone.js.map +1 -1
- package/dist/icon/icons/menu.js.map +1 -1
- package/dist/icon/icons/merge.js.map +1 -1
- package/dist/icon/icons/meter.js.map +1 -1
- package/dist/icon/icons/minimize.js.map +1 -1
- package/dist/icon/icons/minus-circle.js.map +1 -1
- package/dist/icon/icons/minus.js.map +1 -1
- package/dist/icon/icons/moon.js.map +1 -1
- package/dist/icon/icons/more-actions.js.map +1 -1
- package/dist/icon/icons/multiselect.js.map +1 -1
- package/dist/icon/icons/music-note.js.map +1 -1
- package/dist/icon/icons/newspaper.js.map +1 -1
- package/dist/icon/icons/not-allowed.js.map +1 -1
- package/dist/icon/icons/numbers.js.map +1 -1
- package/dist/icon/icons/office-building.js.map +1 -1
- package/dist/icon/icons/outline.js.map +1 -1
- package/dist/icon/icons/paper-airplane.js.map +1 -1
- package/dist/icon/icons/paper-clip.js.map +1 -1
- package/dist/icon/icons/pause.js.map +1 -1
- package/dist/icon/icons/pencil-square.js.map +1 -1
- package/dist/icon/icons/person-2.js.map +1 -1
- package/dist/icon/icons/person-3.js.map +1 -1
- package/dist/icon/icons/person-circle.js.map +1 -1
- package/dist/icon/icons/person.js.map +1 -1
- package/dist/icon/icons/phone.js.map +1 -1
- package/dist/icon/icons/picture-in-picture.js.map +1 -1
- package/dist/icon/icons/pie-chart.js.map +1 -1
- package/dist/icon/icons/pin.js.map +1 -1
- package/dist/icon/icons/pizza-slice.js.map +1 -1
- package/dist/icon/icons/placeholder.js.map +1 -1
- package/dist/icon/icons/play.js.map +1 -1
- package/dist/icon/icons/plug.js.map +1 -1
- package/dist/icon/icons/plus-circle.js.map +1 -1
- package/dist/icon/icons/plus-minus.js.map +1 -1
- package/dist/icon/icons/pointer-stroke.js.map +1 -1
- package/dist/icon/icons/pointer.js.map +1 -1
- package/dist/icon/icons/priority-high.js.map +1 -1
- package/dist/icon/icons/priority-low.js.map +1 -1
- package/dist/icon/icons/priority-medium.js.map +1 -1
- package/dist/icon/icons/projector.js.map +1 -1
- package/dist/icon/icons/pull-close.js.map +1 -1
- package/dist/icon/icons/pull-draft.js.map +1 -1
- package/dist/icon/icons/pull-open.js.map +1 -1
- package/dist/icon/icons/pulse.js.map +1 -1
- package/dist/icon/icons/puzzle-piece.js.map +1 -1
- package/dist/icon/icons/question-mark-circle-stroke.js.map +1 -1
- package/dist/icon/icons/question-mark-circle.js.map +1 -1
- package/dist/icon/icons/rectangle-group.js.map +1 -1
- package/dist/icon/icons/rectangle-stack-horizontal.js.map +1 -1
- package/dist/icon/icons/rectangle-stack-vertical.js.map +1 -1
- package/dist/icon/icons/redo.js.map +1 -1
- package/dist/icon/icons/refresh.js.map +1 -1
- package/dist/icon/icons/reply.js.map +1 -1
- package/dist/icon/icons/rewind-10.js.map +1 -1
- package/dist/icon/icons/rewind.js.map +1 -1
- package/dist/icon/icons/rocketship.js.map +1 -1
- package/dist/icon/icons/running.js.map +1 -1
- package/dist/icon/icons/scale.js.map +1 -1
- package/dist/icon/icons/scissors.js.map +1 -1
- package/dist/icon/icons/search.js.map +1 -1
- package/dist/icon/icons/sensor.js.map +1 -1
- package/dist/icon/icons/server-stack.js.map +1 -1
- package/dist/icon/icons/server.js.map +1 -1
- package/dist/icon/icons/shapes.js.map +1 -1
- package/dist/icon/icons/share.js.map +1 -1
- package/dist/icon/icons/signal-slash.js.map +1 -1
- package/dist/icon/icons/signal.js.map +1 -1
- package/dist/icon/icons/signpost.js.map +1 -1
- package/dist/icon/icons/sort-ascending.js.map +1 -1
- package/dist/icon/icons/sort-descending.js.map +1 -1
- package/dist/icon/icons/soundwave.js.map +1 -1
- package/dist/icon/icons/sparkles.js.map +1 -1
- package/dist/icon/icons/split-horizontal.js.map +1 -1
- package/dist/icon/icons/split-none.js.map +1 -1
- package/dist/icon/icons/split-vertical.js.map +1 -1
- package/dist/icon/icons/star-half.js.map +1 -1
- package/dist/icon/icons/star-stroke.js.map +1 -1
- package/dist/icon/icons/star.js.map +1 -1
- package/dist/icon/icons/start.js.map +1 -1
- package/dist/icon/icons/status-offline.js.map +1 -1
- package/dist/icon/icons/status-online.js.map +1 -1
- package/dist/icon/icons/stop-sign.js.map +1 -1
- package/dist/icon/icons/stop.js.map +1 -1
- package/dist/icon/icons/stopwatch.js.map +1 -1
- package/dist/icon/icons/strikethrough.js.map +1 -1
- package/dist/icon/icons/sun.js.map +1 -1
- package/dist/icon/icons/swatch.js.map +1 -1
- package/dist/icon/icons/switch-apps.js.map +1 -1
- package/dist/icon/icons/switch.js.map +1 -1
- package/dist/icon/icons/table.js.map +1 -1
- package/dist/icon/icons/tag.js.map +1 -1
- package/dist/icon/icons/task.js.map +1 -1
- package/dist/icon/icons/telescope.js.map +1 -1
- package/dist/icon/icons/template.js.map +1 -1
- package/dist/icon/icons/terminal.js.map +1 -1
- package/dist/icon/icons/thumb-stroke.js.map +1 -1
- package/dist/icon/icons/thumb.js.map +1 -1
- package/dist/icon/icons/traffic-cone.js.map +1 -1
- package/dist/icon/icons/transparent-box.js.map +1 -1
- package/dist/icon/icons/trend-down.js.map +1 -1
- package/dist/icon/icons/trend-up.js.map +1 -1
- package/dist/icon/icons/trophy.js.map +1 -1
- package/dist/icon/icons/truck.js.map +1 -1
- package/dist/icon/icons/typography.js.map +1 -1
- package/dist/icon/icons/undo.js.map +1 -1
- package/dist/icon/icons/unlock.js.map +1 -1
- package/dist/icon/icons/upload.js.map +1 -1
- package/dist/icon/icons/video-camera.js.map +1 -1
- package/dist/icon/icons/view-as-grid.js.map +1 -1
- package/dist/icon/icons/volume-muted.js.map +1 -1
- package/dist/icon/icons/volume.js.map +1 -1
- package/dist/icon/icons/wifi.js.map +1 -1
- package/dist/icon/icons/wrench.js.map +1 -1
- package/dist/icon/icons/x-circle.js.map +1 -1
- package/dist/icon/icons/zoom-in.js.map +1 -1
- package/dist/icon/icons/zoom-out.js.map +1 -1
- package/dist/icon/icons.js.map +1 -1
- package/dist/icon-button/icon-button2.js +2 -2
- package/dist/icon-button/icon-button2.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/input/input-group2.js +1 -1
- package/dist/input/input-group2.js.map +1 -1
- package/dist/input/input2.js +2 -2
- package/dist/internal/base/button.js +3 -3
- package/dist/internal/base/button.js.map +1 -1
- package/dist/internal/controllers/audit.controller.js.map +1 -1
- package/dist/internal/controllers/i18n.controller.js.map +1 -1
- package/dist/internal/controllers/keynav-grid.controller.js.map +1 -1
- package/dist/internal/controllers/keynav-list.controller.js.map +1 -1
- package/dist/internal/controllers/state-active.controller.js.map +1 -1
- package/dist/internal/controllers/state-current.controller.js.map +1 -1
- package/dist/internal/controllers/state-disabled.controller.js.map +1 -1
- package/dist/internal/controllers/state-expanded.controller.js.map +1 -1
- package/dist/internal/controllers/state-highlighted.controller.js.map +1 -1
- package/dist/internal/controllers/state-pressed.controller.js.map +1 -1
- package/dist/internal/controllers/state-scroll.controller.js.map +1 -1
- package/dist/internal/controllers/state-selected.controller.js.map +1 -1
- package/dist/internal/controllers/type-anchor.controller.js.map +1 -1
- package/dist/internal/controllers/type-button.controller.js.map +1 -1
- package/dist/internal/controllers/type-closable.controller.js.map +1 -1
- package/dist/internal/controllers/type-command.controller.js.map +1 -1
- package/dist/internal/controllers/type-expandable.controller.js.map +1 -1
- package/dist/internal/controllers/type-interest.controller.js.map +1 -1
- package/dist/internal/controllers/type-native-popover-trigger.controller.js.map +1 -1
- package/dist/internal/controllers/type-native-popover.controller.js.map +1 -1
- package/dist/internal/controllers/type-native-popover.utils.js.map +1 -1
- package/dist/internal/controllers/type-selectable.controller.js.map +1 -1
- package/dist/internal/controllers/type-ssr.controller.js +2 -2
- package/dist/internal/controllers/type-ssr.controller.js.map +1 -1
- package/dist/internal/controllers/type-submit.controller.js.map +1 -1
- package/dist/internal/controllers/type-touch.controller.js.map +1 -1
- package/dist/internal/decorators/host-attr.js.map +1 -1
- package/dist/internal/decorators/scoped-registry.js.map +1 -1
- package/dist/internal/services/global.service.js +1 -1
- package/dist/internal/services/global.service.js.map +1 -1
- package/dist/internal/services/global.utils.js.map +1 -1
- package/dist/internal/services/i18n.service.js.map +1 -1
- package/dist/internal/services/log.service.js.map +1 -1
- package/dist/internal/services/transition.service.js.map +1 -1
- package/dist/internal/styles/index.js.map +1 -1
- package/dist/internal/styles/popover2.js.map +1 -1
- package/dist/internal/utils/a11y.js.map +1 -1
- package/dist/internal/utils/audit-logs.js.map +1 -1
- package/dist/internal/utils/audit.js.map +1 -1
- package/dist/internal/utils/dom.js.map +1 -1
- package/dist/internal/utils/events.js.map +1 -1
- package/dist/internal/utils/focus.js.map +1 -1
- package/dist/internal/utils/keynav.js.map +1 -1
- package/dist/internal/utils/objects.js.map +1 -1
- package/dist/internal/utils/strings.js.map +1 -1
- package/dist/internal/utils/supports.js.map +1 -1
- package/dist/logo/logo2.js +2 -2
- package/dist/logo/logo2.js.map +1 -1
- package/dist/menu/menu-item2.js +2 -2
- package/dist/menu/menu-item2.js.map +1 -1
- package/dist/menu/menu2.js +2 -2
- package/dist/menu/menu2.js.map +1 -1
- package/dist/month/month2.js +2 -2
- package/dist/month/month2.js.map +1 -1
- package/dist/notification/notification-group2.js +2 -2
- package/dist/notification/notification-group2.js.map +1 -1
- package/dist/notification/notification2.js +4 -4
- package/dist/notification/notification2.js.map +1 -1
- package/dist/page/page-panel/page-panel-content2.js +1 -1
- package/dist/page/page-panel/page-panel-content2.js.map +1 -1
- package/dist/page/page-panel/page-panel-footer2.js +2 -2
- package/dist/page/page-panel/page-panel-footer2.js.map +1 -1
- package/dist/page/page-panel/page-panel-header2.js +2 -2
- package/dist/page/page-panel/page-panel-header2.js.map +1 -1
- package/dist/page/page-panel/page-panel2.js +5 -5
- package/dist/page/page-panel/page-panel2.js.map +1 -1
- package/dist/page/page2.js +2 -2
- package/dist/page/page2.js.map +1 -1
- package/dist/page-header/page-header2.js +1 -1
- package/dist/page-header/page-header2.js.map +1 -1
- package/dist/page-loader/page-loader2.js +2 -2
- package/dist/page-loader/page-loader2.js.map +1 -1
- package/dist/pagination/pagination2.js +4 -4
- package/dist/pagination/pagination2.js.map +1 -1
- package/dist/panel/panel2.js +8 -8
- package/dist/panel/panel2.js.map +1 -1
- package/dist/password/password2.js +2 -2
- package/dist/password/password2.js.map +1 -1
- package/dist/polyfills/custom-state-set.js.map +1 -1
- package/dist/polyfills/index.js.map +1 -1
- package/dist/preferences-input/preferences-input2.js +4 -4
- package/dist/preferences-input/preferences-input2.js.map +1 -1
- package/dist/progress-bar/progress-bar2.js +2 -2
- package/dist/progress-bar/progress-bar2.js.map +1 -1
- package/dist/progress-ring/progress-ring2.js +5 -5
- package/dist/progress-ring/progress-ring2.js.map +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +5 -5
- package/dist/progressive-filter-chip/progressive-filter-chip2.js.map +1 -1
- package/dist/pulse/pulse2.js +2 -2
- package/dist/pulse/pulse2.js.map +1 -1
- package/dist/radio/radio-group2.js +2 -2
- package/dist/radio/radio2.js +2 -2
- package/dist/range/range2.js +2 -2
- package/dist/range/range2.js.map +1 -1
- package/dist/resize-handle/resize-handle2.js +5 -5
- package/dist/resize-handle/resize-handle2.js.map +1 -1
- package/dist/search/search2.js +2 -2
- package/dist/search/search2.js.map +1 -1
- package/dist/select/select2.js +6 -6
- package/dist/select/select2.js.map +1 -1
- package/dist/skeleton/skeleton2.js +2 -2
- package/dist/skeleton/skeleton2.js.map +1 -1
- package/dist/sort-button/sort-button2.js +14 -14
- package/dist/sort-button/sort-button2.js.map +1 -1
- package/dist/sparkline/sparkline.utils.d.ts +0 -1
- package/dist/sparkline/sparkline.utils.js.map +1 -1
- package/dist/sparkline/sparkline2.js +2 -2
- package/dist/sparkline/sparkline2.js.map +1 -1
- package/dist/star-rating/star-rating2.js +4 -4
- package/dist/star-rating/star-rating2.js.map +1 -1
- package/dist/steps/steps2.js +7 -7
- package/dist/steps/steps2.js.map +1 -1
- package/dist/switch/switch-group2.js +2 -2
- package/dist/switch/switch2.js +2 -2
- package/dist/tabs/tabs-group2.js +16 -16
- package/dist/tabs/tabs-group2.js.map +1 -1
- package/dist/tabs/tabs2.js +7 -7
- package/dist/tabs/tabs2.js.map +1 -1
- package/dist/tag/tag2.js +5 -5
- package/dist/tag/tag2.js.map +1 -1
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time2.js +2 -2
- package/dist/time/time2.js.map +1 -1
- package/dist/toast/toast2.js +4 -4
- package/dist/toast/toast2.js.map +1 -1
- package/dist/toggletip/toggletip-footer2.js +2 -2
- package/dist/toggletip/toggletip-footer2.js.map +1 -1
- package/dist/toggletip/toggletip-header2.js +2 -2
- package/dist/toggletip/toggletip-header2.js.map +1 -1
- package/dist/toggletip/toggletip2.js +4 -4
- package/dist/toggletip/toggletip2.js.map +1 -1
- package/dist/toolbar/toolbar2.js +4 -4
- package/dist/toolbar/toolbar2.js.map +1 -1
- package/dist/tooltip/tooltip2.js +2 -2
- package/dist/tooltip/tooltip2.js.map +1 -1
- package/dist/tree/tree-node2.js +9 -9
- package/dist/tree/tree-node2.js.map +1 -1
- package/dist/tree/tree2.js +4 -4
- package/dist/tree/tree2.js.map +1 -1
- package/dist/tree/utils.js.map +1 -1
- package/dist/week/week2.js +2 -2
- package/dist/week/week2.js.map +1 -1
- package/package.json +18 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keynav-list.controller.js","names":["#config","#keynavDisabled","#initializeTabIndex","#clickItem","#focusItem","#getActiveItem","#setActiveItem"],"sources":["../../../src/internal/controllers/keynav-list.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { focusElement, initializeKeyListItems, setActiveKeyListItem } from '../utils/focus.js';\nimport { KeynavCode, validKeyNavigationCode } from '../utils/dom.js';\n\nexport interface KeynavListConfig {\n items: NodeListOf<HTMLElement> | HTMLElement[];\n layout?: 'both' | 'horizontal' | 'vertical';\n manageFocus?: boolean;\n manageTabindex?: boolean;\n loop?: boolean;\n dir?: string | null;\n}\n\nexport interface KeynavListElement {\n keynavListConfig: KeynavListConfig;\n}\n\n/** https://webaim.org/techniques/keyboard/ */\nexport function keyNavigationList<T extends ReactiveElement & KeynavListElement>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new KeyNavigationListController(instance));\n}\n\nexport class KeyNavigationListController<T extends ReactiveElement & KeynavListElement> implements ReactiveController {\n get #config(): KeynavListConfig & { items: HTMLElement[] } {\n return {\n layout: 'horizontal',\n manageFocus: true,\n manageTabindex: true,\n loop: false,\n dir: this.host.getAttribute('rtl'),\n ...this.host.keynavListConfig,\n items: Array.from(this.host.keynavListConfig.items).filter(\n (i: HTMLElement & { disabled?: boolean }) => !i.disabled\n )\n };\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n /** @private attr nve-keynav-disabled is an internal API for advanced use cases only */\n get #keynavDisabled() {\n return this.host.hasAttribute('nve-keynav-disabled');\n }\n\n async hostConnected() {\n await this.host.updateComplete;\n this.#initializeTabIndex();\n this.host.addEventListener('pointerup', (e: PointerEvent) => this.#clickItem(e));\n this.host.addEventListener('keydown', (e: KeyboardEvent) => this.#focusItem(e));\n }\n\n #initializeTabIndex() {\n const { manageFocus, manageTabindex, items } = this.#config;\n if (manageFocus && manageTabindex && !this.#keynavDisabled) {\n initializeKeyListItems(items);\n }\n }\n\n #clickItem(e: PointerEvent) {\n const item = this.#getActiveItem(e, this.#config.items);\n if (item) {\n this.#setActiveItem(e, item);\n }\n }\n\n #focusItem(e: KeyboardEvent) {\n if (validKeyNavigationCode(e) && !this.#keynavDisabled) {\n const { loop, layout, dir, items } = this.#config;\n const activeItem = this.#getActiveItem(e, items);\n if (activeItem) {\n const { next, previous } = getNextKeyListItem(activeItem, Array.from(items), {\n loop,\n layout,\n dir,\n code: e.code as KeynavCode\n });\n\n if (next !== previous) {\n this.#setActiveItem(e, items[next]!, items[previous]);\n }\n }\n }\n }\n\n #getActiveItem(e: Event, items: HTMLElement[]) {\n const focusedElement = e.composedPath()[0] as HTMLElement;\n return items.find(i => i === focusedElement) ? focusedElement : null;\n }\n\n #setActiveItem(e: KeyboardEvent | PointerEvent, activeItem: HTMLElement, previousItem?: HTMLElement) {\n const { manageFocus, manageTabindex, items } = this.#config;\n if (manageFocus) {\n if (manageTabindex) {\n setActiveKeyListItem(items, activeItem);\n }\n\n focusElement(activeItem);\n e.preventDefault();\n }\n\n const detail = {\n activeItem,\n previousItem,\n code: e instanceof KeyboardEvent ? e.code : null,\n metaKey: e.ctrlKey || e.metaKey,\n items\n };\n activeItem.dispatchEvent(new CustomEvent('nve-key-change', { bubbles: true, composed: true, detail }));\n }\n}\n\ninterface KeyListConfig {\n code: KeynavCode;\n loop?: boolean;\n layout?: 'horizontal' | 'vertical' | 'both';\n dir: string | null | undefined;\n}\n\nfunction resolveArrowDirection(config: KeyListConfig): 'backward' | 'forward' | null {\n const { code, layout, dir } = config;\n const start = dir === 'rtl' ? KeynavCode.ArrowRight : KeynavCode.ArrowLeft;\n const end = dir === 'rtl' ? KeynavCode.ArrowLeft : KeynavCode.ArrowRight;\n\n if (layout !== 'horizontal') {\n if (code === KeynavCode.ArrowUp) return 'backward';\n if (code === KeynavCode.ArrowDown) return 'forward';\n }\n\n if (layout !== 'vertical') {\n if (code === start) return 'backward';\n if (code === end) return 'forward';\n }\n\n return null;\n}\n\nfunction resolveSpecialKey(code: KeynavCode): 'home' | 'end' | 'pageup' | 'pagedown' | null {\n if (code === KeynavCode.End) return 'end';\n if (code === KeynavCode.Home) return 'home';\n if (code === KeynavCode.PageUp) return 'pageup';\n if (code === KeynavCode.PageDown) return 'pagedown';\n return null;\n}\n\nfunction navigateWithLoop(current: number, step: number, options: { limit: number; loop: boolean | undefined }) {\n const { limit, loop } = options;\n const next = current + step;\n if (next >= 0 && next <= limit) return next;\n return loop ? (step < 0 ? limit : 0) : current;\n}\n\nexport function getNextKeyListItem(item: HTMLElement, items: HTMLElement[], config: KeyListConfig) {\n let next = items.indexOf(item);\n const previous = next;\n const itemCount = items.length - 1;\n const direction = resolveArrowDirection(config);\n\n switch (direction ?? resolveSpecialKey(config.code)) {\n case 'backward':\n next = navigateWithLoop(next, -1, { limit: itemCount, loop: config.loop });\n break;\n case 'forward':\n next = navigateWithLoop(next, 1, { limit: itemCount, loop: config.loop });\n break;\n case 'end':\n next = itemCount;\n break;\n case 'home':\n next = 0;\n break;\n case 'pageup':\n next = Math.max(0, next - 4);\n break;\n case 'pagedown':\n next = Math.min(itemCount, next + 4);\n break;\n case null:\n break;\n }\n\n return { next, previous };\n}\n"],"mappings":";;;AAsBA,SAAgB,IAAmF;
|
|
1
|
+
{"version":3,"file":"keynav-list.controller.js","names":["#config","#keynavDisabled","#initializeTabIndex","#clickItem","#focusItem","#getActiveItem","#setActiveItem"],"sources":["../../../src/internal/controllers/keynav-list.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { focusElement, initializeKeyListItems, setActiveKeyListItem } from '../utils/focus.js';\nimport { KeynavCode, validKeyNavigationCode } from '../utils/dom.js';\n\nexport interface KeynavListConfig {\n items: NodeListOf<HTMLElement> | HTMLElement[];\n layout?: 'both' | 'horizontal' | 'vertical';\n manageFocus?: boolean;\n manageTabindex?: boolean;\n loop?: boolean;\n dir?: string | null;\n}\n\nexport interface KeynavListElement {\n keynavListConfig: KeynavListConfig;\n}\n\n/** https://webaim.org/techniques/keyboard/ */\nexport function keyNavigationList<T extends ReactiveElement & KeynavListElement>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new KeyNavigationListController(instance));\n}\n\nexport class KeyNavigationListController<T extends ReactiveElement & KeynavListElement> implements ReactiveController {\n get #config(): KeynavListConfig & { items: HTMLElement[] } {\n return {\n layout: 'horizontal',\n manageFocus: true,\n manageTabindex: true,\n loop: false,\n dir: this.host.getAttribute('rtl'),\n ...this.host.keynavListConfig,\n items: Array.from(this.host.keynavListConfig.items).filter(\n (i: HTMLElement & { disabled?: boolean }) => !i.disabled\n )\n };\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n /** @private attr nve-keynav-disabled is an internal API for advanced use cases only */\n get #keynavDisabled() {\n return this.host.hasAttribute('nve-keynav-disabled');\n }\n\n async hostConnected() {\n await this.host.updateComplete;\n this.#initializeTabIndex();\n this.host.addEventListener('pointerup', (e: PointerEvent) => this.#clickItem(e));\n this.host.addEventListener('keydown', (e: KeyboardEvent) => this.#focusItem(e));\n }\n\n #initializeTabIndex() {\n const { manageFocus, manageTabindex, items } = this.#config;\n if (manageFocus && manageTabindex && !this.#keynavDisabled) {\n initializeKeyListItems(items);\n }\n }\n\n #clickItem(e: PointerEvent) {\n const item = this.#getActiveItem(e, this.#config.items);\n if (item) {\n this.#setActiveItem(e, item);\n }\n }\n\n #focusItem(e: KeyboardEvent) {\n if (validKeyNavigationCode(e) && !this.#keynavDisabled) {\n const { loop, layout, dir, items } = this.#config;\n const activeItem = this.#getActiveItem(e, items);\n if (activeItem) {\n const { next, previous } = getNextKeyListItem(activeItem, Array.from(items), {\n loop,\n layout,\n dir,\n code: e.code as KeynavCode\n });\n\n if (next !== previous) {\n this.#setActiveItem(e, items[next]!, items[previous]);\n }\n }\n }\n }\n\n #getActiveItem(e: Event, items: HTMLElement[]) {\n const focusedElement = e.composedPath()[0] as HTMLElement;\n return items.find(i => i === focusedElement) ? focusedElement : null;\n }\n\n #setActiveItem(e: KeyboardEvent | PointerEvent, activeItem: HTMLElement, previousItem?: HTMLElement) {\n const { manageFocus, manageTabindex, items } = this.#config;\n if (manageFocus) {\n if (manageTabindex) {\n setActiveKeyListItem(items, activeItem);\n }\n\n focusElement(activeItem);\n e.preventDefault();\n }\n\n const detail = {\n activeItem,\n previousItem,\n code: e instanceof KeyboardEvent ? e.code : null,\n metaKey: e.ctrlKey || e.metaKey,\n items\n };\n activeItem.dispatchEvent(new CustomEvent('nve-key-change', { bubbles: true, composed: true, detail }));\n }\n}\n\ninterface KeyListConfig {\n code: KeynavCode;\n loop?: boolean;\n layout?: 'horizontal' | 'vertical' | 'both';\n dir: string | null | undefined;\n}\n\nfunction resolveArrowDirection(config: KeyListConfig): 'backward' | 'forward' | null {\n const { code, layout, dir } = config;\n const start = dir === 'rtl' ? KeynavCode.ArrowRight : KeynavCode.ArrowLeft;\n const end = dir === 'rtl' ? KeynavCode.ArrowLeft : KeynavCode.ArrowRight;\n\n if (layout !== 'horizontal') {\n if (code === KeynavCode.ArrowUp) return 'backward';\n if (code === KeynavCode.ArrowDown) return 'forward';\n }\n\n if (layout !== 'vertical') {\n if (code === start) return 'backward';\n if (code === end) return 'forward';\n }\n\n return null;\n}\n\nfunction resolveSpecialKey(code: KeynavCode): 'home' | 'end' | 'pageup' | 'pagedown' | null {\n if (code === KeynavCode.End) return 'end';\n if (code === KeynavCode.Home) return 'home';\n if (code === KeynavCode.PageUp) return 'pageup';\n if (code === KeynavCode.PageDown) return 'pagedown';\n return null;\n}\n\nfunction navigateWithLoop(current: number, step: number, options: { limit: number; loop: boolean | undefined }) {\n const { limit, loop } = options;\n const next = current + step;\n if (next >= 0 && next <= limit) return next;\n return loop ? (step < 0 ? limit : 0) : current;\n}\n\nexport function getNextKeyListItem(item: HTMLElement, items: HTMLElement[], config: KeyListConfig) {\n let next = items.indexOf(item);\n const previous = next;\n const itemCount = items.length - 1;\n const direction = resolveArrowDirection(config);\n\n switch (direction ?? resolveSpecialKey(config.code)) {\n case 'backward':\n next = navigateWithLoop(next, -1, { limit: itemCount, loop: config.loop });\n break;\n case 'forward':\n next = navigateWithLoop(next, 1, { limit: itemCount, loop: config.loop });\n break;\n case 'end':\n next = itemCount;\n break;\n case 'home':\n next = 0;\n break;\n case 'pageup':\n next = Math.max(0, next - 4);\n break;\n case 'pagedown':\n next = Math.min(itemCount, next + 4);\n break;\n case null:\n break;\n }\n\n return { next, previous };\n}\n"],"mappings":";;;AAsBA,SAAgB,IAAmF;CACjG,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAA4B,EAAS,CAAC;;AAGtF,IAAa,IAAb,MAAsH;CACpH,IAAIA,KAAuD;EACzD,OAAO;GACL,QAAQ;GACR,aAAa;GACb,gBAAgB;GAChB,MAAM;GACN,KAAK,KAAK,KAAK,aAAa,MAAM;GAClC,GAAG,KAAK,KAAK;GACb,OAAO,MAAM,KAAK,KAAK,KAAK,iBAAiB,MAAM,CAAC,QACjD,MAA4C,CAAC,EAAE,SACjD;GACF;;CAGH,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAI/B,IAAIC,KAAkB;EACpB,OAAO,KAAK,KAAK,aAAa,sBAAsB;;CAGtD,M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,EAAE;GACpC;EACF,KAAK,MACH;;CAGJ,OAAO;EAAE;EAAM;EAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-active.controller.js","names":["#emulateActive","#emulateInactive","#isValidKeyEvent"],"sources":["../../../src/internal/controllers/state-active.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds CSS State psuedo-selector :state(active) behavior for keydown space/enter for custom elements\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n */\nexport function stateActive<T extends Active>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateActiveController(instance));\n}\n\ntype Active = ReactiveElement & { disabled: boolean; _internals?: ElementInternals };\n\nexport class StateActiveController<T extends Active> implements ReactiveController {\n #initialized = false;\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n this.host.addEventListener('keypress', this.#emulateActive as EventListener);\n this.host.addEventListener('mousedown', this.#emulateActive as EventListener);\n this.host.addEventListener('keyup', this.#emulateInactive);\n this.host.addEventListener('blur', this.#emulateInactive);\n this.host.addEventListener('mouseup', this.#emulateInactive);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('keypress', this.#emulateActive as EventListener);\n this.host.removeEventListener('mousedown', this.#emulateActive as EventListener);\n this.host.removeEventListener('keyup', this.#emulateInactive);\n this.host.removeEventListener('blur', this.#emulateInactive);\n this.host.removeEventListener('mouseup', this.#emulateInactive);\n }\n\n #emulateActive = (e: KeyboardEvent | PointerEvent) => {\n if (!this.host.disabled && this.#isValidKeyEvent(e)) {\n this.host._internals!.states.add('active');\n }\n\n if (e instanceof KeyboardEvent && e.code === 'Space' && e.target === this.host) {\n e.preventDefault(); // prevent space bar scroll with standard button behavior\n }\n };\n\n #emulateInactive = () => {\n this.host._internals!.states.delete('active');\n };\n\n #isValidKeyEvent(e: KeyboardEvent | PointerEvent) {\n return e instanceof KeyboardEvent ? e.code === 'Space' || e.code === 'Enter' : true;\n }\n}\n"],"mappings":";;AAWA,SAAgB,IAAgD;
|
|
1
|
+
{"version":3,"file":"state-active.controller.js","names":["#emulateActive","#emulateInactive","#isValidKeyEvent"],"sources":["../../../src/internal/controllers/state-active.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds CSS State psuedo-selector :state(active) behavior for keydown space/enter for custom elements\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n */\nexport function stateActive<T extends Active>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateActiveController(instance));\n}\n\ntype Active = ReactiveElement & { disabled: boolean; _internals?: ElementInternals };\n\nexport class StateActiveController<T extends Active> implements ReactiveController {\n #initialized = false;\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n this.host.addEventListener('keypress', this.#emulateActive as EventListener);\n this.host.addEventListener('mousedown', this.#emulateActive as EventListener);\n this.host.addEventListener('keyup', this.#emulateInactive);\n this.host.addEventListener('blur', this.#emulateInactive);\n this.host.addEventListener('mouseup', this.#emulateInactive);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('keypress', this.#emulateActive as EventListener);\n this.host.removeEventListener('mousedown', this.#emulateActive as EventListener);\n this.host.removeEventListener('keyup', this.#emulateInactive);\n this.host.removeEventListener('blur', this.#emulateInactive);\n this.host.removeEventListener('mouseup', this.#emulateInactive);\n }\n\n #emulateActive = (e: KeyboardEvent | PointerEvent) => {\n if (!this.host.disabled && this.#isValidKeyEvent(e)) {\n this.host._internals!.states.add('active');\n }\n\n if (e instanceof KeyboardEvent && e.code === 'Space' && e.target === this.host) {\n e.preventDefault(); // prevent space bar scroll with standard button behavior\n }\n };\n\n #emulateInactive = () => {\n this.host._internals!.states.delete('active');\n };\n\n #isValidKeyEvent(e: KeyboardEvent | PointerEvent) {\n return e instanceof KeyboardEvent ? e.code === 'Space' || e.code === 'Enter' : true;\n }\n}\n"],"mappings":";;AAWA,SAAgB,IAAgD;CAC9D,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAsB,EAAS,CAAC;;AAKhF,IAAa,IAAb,MAAmF;CAEjF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EAMd,AALA,EAAgB,KAAK,KAAK,EAC1B,KAAK,KAAK,iBAAiB,YAAY,KAAKA,GAAgC,EAC5E,KAAK,KAAK,iBAAiB,aAAa,KAAKA,GAAgC,EAC7E,KAAK,KAAK,iBAAiB,SAAS,KAAKC,GAAiB,EAC1D,KAAK,KAAK,iBAAiB,QAAQ,KAAKA,GAAiB,EACzD,KAAK,KAAK,iBAAiB,WAAW,KAAKA,GAAiB;;CAG9D,mBAAmB;EAKjB,AAJA,KAAK,KAAK,oBAAoB,YAAY,KAAKD,GAAgC,EAC/E,KAAK,KAAK,oBAAoB,aAAa,KAAKA,GAAgC,EAChF,KAAK,KAAK,oBAAoB,SAAS,KAAKC,GAAiB,EAC7D,KAAK,KAAK,oBAAoB,QAAQ,KAAKA,GAAiB,EAC5D,KAAK,KAAK,oBAAoB,WAAW,KAAKA,GAAiB;;CAGjE,MAAkB,MAAoC;EAKpD,AAJI,CAAC,KAAK,KAAK,YAAY,KAAKC,GAAiB,EAAE,IACjD,KAAK,KAAK,WAAY,OAAO,IAAI,SAAS,EAGxC,aAAa,iBAAiB,EAAE,SAAS,WAAW,EAAE,WAAW,KAAK,QACxE,EAAE,gBAAgB;;CAItB,WAAyB;EACvB,KAAK,KAAK,WAAY,OAAO,OAAO,SAAS;;CAG/C,GAAiB,GAAiC;EAChD,OAAO,aAAa,gBAAgB,EAAE,SAAS,WAAW,EAAE,SAAS,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-current.controller.js","names":[],"sources":["../../../src/internal/controllers/state-current.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds current support for interactive custom elements including CSS State psuedo-selector :state(current) and aria-current.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current\n */\nexport function stateCurrent<T extends Current>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateCurrentController(instance));\n}\n\ntype Current = ReactiveElement & { current: 'page' | 'step'; readonly?: boolean; _internals?: ElementInternals };\n\nexport class StateCurrentController<T extends Current> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.readonly) {\n this.host._internals!.ariaCurrent = null;\n this.host._internals!.states.delete('current');\n return;\n }\n\n if (this.host._internals?.states.has('anchor') && this.host.current) {\n this.host._internals!.ariaCurrent = null;\n this.host._internals!.states.add('current');\n this.host.querySelector('a')?.setAttribute('aria-current', 'page');\n return;\n }\n\n if (this.host.current !== null && this.host.current !== undefined) {\n this.host._internals!.ariaCurrent = `${this.host.current}`;\n }\n\n if (this.host.current) {\n this.host._internals!.states.add('current');\n } else {\n this.host._internals!.states.delete('current');\n }\n }\n}\n"],"mappings":";;AAWA,SAAgB,IAAkD;
|
|
1
|
+
{"version":3,"file":"state-current.controller.js","names":[],"sources":["../../../src/internal/controllers/state-current.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds current support for interactive custom elements including CSS State psuedo-selector :state(current) and aria-current.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current\n */\nexport function stateCurrent<T extends Current>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateCurrentController(instance));\n}\n\ntype Current = ReactiveElement & { current: 'page' | 'step'; readonly?: boolean; _internals?: ElementInternals };\n\nexport class StateCurrentController<T extends Current> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.readonly) {\n this.host._internals!.ariaCurrent = null;\n this.host._internals!.states.delete('current');\n return;\n }\n\n if (this.host._internals?.states.has('anchor') && this.host.current) {\n this.host._internals!.ariaCurrent = null;\n this.host._internals!.states.add('current');\n this.host.querySelector('a')?.setAttribute('aria-current', 'page');\n return;\n }\n\n if (this.host.current !== null && this.host.current !== undefined) {\n this.host._internals!.ariaCurrent = `${this.host.current}`;\n }\n\n if (this.host.current) {\n this.host._internals!.states.add('current');\n } else {\n this.host._internals!.states.delete('current');\n }\n }\n}\n"],"mappings":";;AAWA,SAAgB,IAAkD;CAChE,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAuB,EAAS,CAAC;;AAKjF,IAAa,IAAb,MAAqF;CACnF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EACd,EAAgB,KAAK,KAAK;;CAG5B,cAAc;EACZ,IAAI,KAAK,KAAK,UAAU;GAEtB,AADA,KAAK,KAAK,WAAY,cAAc,MACpC,KAAK,KAAK,WAAY,OAAO,OAAO,UAAU;GAC9C;;EAGF,IAAI,KAAK,KAAK,YAAY,OAAO,IAAI,SAAS,IAAI,KAAK,KAAK,SAAS;GAGnE,AAFA,KAAK,KAAK,WAAY,cAAc,MACpC,KAAK,KAAK,WAAY,OAAO,IAAI,UAAU,EAC3C,KAAK,KAAK,cAAc,IAAI,EAAE,aAAa,gBAAgB,OAAO;GAClE;;EAOF,AAJI,KAAK,KAAK,YAAY,QAAQ,KAAK,KAAK,YAAY,KAAA,MACtD,KAAK,KAAK,WAAY,cAAc,GAAG,KAAK,KAAK,YAG/C,KAAK,KAAK,UACZ,KAAK,KAAK,WAAY,OAAO,IAAI,UAAU,GAE3C,KAAK,KAAK,WAAY,OAAO,OAAO,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-disabled.controller.js","names":[],"sources":["../../../src/internal/controllers/state-disabled.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds disabled support for interactive custom elements including CSS State psuedo-selector :state(disabled) and aria-disabled.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled\n */\nexport function stateDisabled<T extends Disabled>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateDisabledController(instance));\n}\n\nexport type Disabled = ReactiveElement & { disabled: boolean; readonly?: boolean; _internals?: ElementInternals };\n\nexport class StateDisabledController<T extends Disabled> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.disabled !== null && this.host.disabled !== undefined) {\n this.host._internals!.ariaDisabled = `${this.host.disabled}`;\n } else {\n this.host._internals!.ariaDisabled = null;\n }\n\n if (this.host.disabled) {\n this.host._internals!.states.add('disabled');\n } else {\n this.host._internals!.states.delete('disabled');\n }\n\n if (this.host.readonly) {\n this.host._internals!.ariaDisabled = null;\n }\n }\n}\n"],"mappings":";;AAYA,SAAgB,IAAoD;
|
|
1
|
+
{"version":3,"file":"state-disabled.controller.js","names":[],"sources":["../../../src/internal/controllers/state-disabled.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds disabled support for interactive custom elements including CSS State psuedo-selector :state(disabled) and aria-disabled.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled\n */\nexport function stateDisabled<T extends Disabled>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateDisabledController(instance));\n}\n\nexport type Disabled = ReactiveElement & { disabled: boolean; readonly?: boolean; _internals?: ElementInternals };\n\nexport class StateDisabledController<T extends Disabled> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.disabled !== null && this.host.disabled !== undefined) {\n this.host._internals!.ariaDisabled = `${this.host.disabled}`;\n } else {\n this.host._internals!.ariaDisabled = null;\n }\n\n if (this.host.disabled) {\n this.host._internals!.states.add('disabled');\n } else {\n this.host._internals!.states.delete('disabled');\n }\n\n if (this.host.readonly) {\n this.host._internals!.ariaDisabled = null;\n }\n }\n}\n"],"mappings":";;AAYA,SAAgB,IAAoD;CAClE,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAwB,EAAS,CAAC;;AAKlF,IAAa,IAAb,MAAuF;CACrF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EACd,EAAgB,KAAK,KAAK;;CAG5B,cAAc;EAaZ,AAZI,KAAK,KAAK,aAAa,QAAQ,KAAK,KAAK,aAAa,KAAA,IACxD,KAAK,KAAK,WAAY,eAAe,GAAG,KAAK,KAAK,aAElD,KAAK,KAAK,WAAY,eAAe,MAGnC,KAAK,KAAK,WACZ,KAAK,KAAK,WAAY,OAAO,IAAI,WAAW,GAE5C,KAAK,KAAK,WAAY,OAAO,OAAO,WAAW,EAG7C,KAAK,KAAK,aACZ,KAAK,KAAK,WAAY,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-expanded.controller.js","names":[],"sources":["../../../src/internal/controllers/state-expanded.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds expanded support for interactive custom elements including CSS State psuedo-selector :state(expanded) and aria-expanded.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded\n */\nexport function stateExpanded<T extends Expanded>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateExpandedController(instance));\n}\n\nexport type Expanded = ReactiveElement & { expanded: boolean; readonly?: boolean; _internals?: ElementInternals };\n\nexport class StateExpandedController<T extends Expanded> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.expanded !== null && this.host.expanded !== undefined) {\n this.host._internals!.ariaExpanded = `${this.host.expanded}`;\n }\n\n if (this.host.expanded) {\n this.host._internals!.states.add('expanded');\n } else {\n this.host._internals!.states.delete('expanded');\n }\n\n if (this.host.readonly) {\n this.host._internals!.ariaExpanded = null;\n this.host._internals!.states.delete('expanded');\n }\n }\n}\n"],"mappings":";;AAYA,SAAgB,IAAoD;
|
|
1
|
+
{"version":3,"file":"state-expanded.controller.js","names":[],"sources":["../../../src/internal/controllers/state-expanded.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds expanded support for interactive custom elements including CSS State psuedo-selector :state(expanded) and aria-expanded.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded\n */\nexport function stateExpanded<T extends Expanded>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateExpandedController(instance));\n}\n\nexport type Expanded = ReactiveElement & { expanded: boolean; readonly?: boolean; _internals?: ElementInternals };\n\nexport class StateExpandedController<T extends Expanded> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.expanded !== null && this.host.expanded !== undefined) {\n this.host._internals!.ariaExpanded = `${this.host.expanded}`;\n }\n\n if (this.host.expanded) {\n this.host._internals!.states.add('expanded');\n } else {\n this.host._internals!.states.delete('expanded');\n }\n\n if (this.host.readonly) {\n this.host._internals!.ariaExpanded = null;\n this.host._internals!.states.delete('expanded');\n }\n }\n}\n"],"mappings":";;AAYA,SAAgB,IAAoD;CAClE,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAwB,EAAS,CAAC;;AAKlF,IAAa,IAAb,MAAuF;CACrF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EACd,EAAgB,KAAK,KAAK;;CAG5B,cAAc;EAWZ,AAVI,KAAK,KAAK,aAAa,QAAQ,KAAK,KAAK,aAAa,KAAA,MACxD,KAAK,KAAK,WAAY,eAAe,GAAG,KAAK,KAAK,aAGhD,KAAK,KAAK,WACZ,KAAK,KAAK,WAAY,OAAO,IAAI,WAAW,GAE5C,KAAK,KAAK,WAAY,OAAO,OAAO,WAAW,EAG7C,KAAK,KAAK,aACZ,KAAK,KAAK,WAAY,eAAe,MACrC,KAAK,KAAK,WAAY,OAAO,OAAO,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-highlighted.controller.js","names":[],"sources":["../../../src/internal/controllers/state-highlighted.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds highlighted support for interactive custom elements including CSS State psuedo-selector :state(highlighted).\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n */\nexport function stateHighlighted<T extends Highlighted>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateHighlightedController(instance));\n}\n\nexport type Highlighted = ReactiveElement & { highlighted: boolean; _internals?: ElementInternals };\n\nexport class StateHighlightedController<T extends Highlighted> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.highlighted) {\n this.host._internals!.states.add('highlighted');\n } else {\n this.host._internals!.states.delete('highlighted');\n }\n }\n}\n"],"mappings":";;AAWA,SAAgB,IAA0D;
|
|
1
|
+
{"version":3,"file":"state-highlighted.controller.js","names":[],"sources":["../../../src/internal/controllers/state-highlighted.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds highlighted support for interactive custom elements including CSS State psuedo-selector :state(highlighted).\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n */\nexport function stateHighlighted<T extends Highlighted>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateHighlightedController(instance));\n}\n\nexport type Highlighted = ReactiveElement & { highlighted: boolean; _internals?: ElementInternals };\n\nexport class StateHighlightedController<T extends Highlighted> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.highlighted) {\n this.host._internals!.states.add('highlighted');\n } else {\n this.host._internals!.states.delete('highlighted');\n }\n }\n}\n"],"mappings":";;AAWA,SAAgB,IAA0D;CACxE,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAA2B,EAAS,CAAC;;AAKrF,IAAa,IAAb,MAA6F;CAC3F,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EACd,EAAgB,KAAK,KAAK;;CAG5B,cAAc;EACZ,AAAI,KAAK,KAAK,cACZ,KAAK,KAAK,WAAY,OAAO,IAAI,cAAc,GAE/C,KAAK,KAAK,WAAY,OAAO,OAAO,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-pressed.controller.js","names":[],"sources":["../../../src/internal/controllers/state-pressed.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds pressed support for interactive custom elements including CSS State psuedo-selector :state(pressed) and aria-pressed.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed\n */\nexport function statePressed<T extends Pressed>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StatePressedController(instance));\n}\n\nexport type Pressed = ReactiveElement & { pressed: boolean; readonly?: boolean; _internals?: ElementInternals };\n\nexport class StatePressedController<T extends Pressed> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.pressed !== null && this.host.pressed !== undefined) {\n this.host._internals!.ariaPressed = `${this.host.pressed}`;\n }\n\n if (this.host.pressed) {\n this.host._internals!.states.add('pressed');\n } else {\n this.host._internals!.states.delete('pressed');\n }\n\n if (this.host.readonly) {\n this.host._internals!.ariaPressed = null;\n this.host._internals!.states.delete('pressed');\n }\n }\n}\n"],"mappings":";;AAYA,SAAgB,IAAkD;
|
|
1
|
+
{"version":3,"file":"state-pressed.controller.js","names":[],"sources":["../../../src/internal/controllers/state-pressed.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds pressed support for interactive custom elements including CSS State psuedo-selector :state(pressed) and aria-pressed.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed\n */\nexport function statePressed<T extends Pressed>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StatePressedController(instance));\n}\n\nexport type Pressed = ReactiveElement & { pressed: boolean; readonly?: boolean; _internals?: ElementInternals };\n\nexport class StatePressedController<T extends Pressed> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.pressed !== null && this.host.pressed !== undefined) {\n this.host._internals!.ariaPressed = `${this.host.pressed}`;\n }\n\n if (this.host.pressed) {\n this.host._internals!.states.add('pressed');\n } else {\n this.host._internals!.states.delete('pressed');\n }\n\n if (this.host.readonly) {\n this.host._internals!.ariaPressed = null;\n this.host._internals!.states.delete('pressed');\n }\n }\n}\n"],"mappings":";;AAYA,SAAgB,IAAkD;CAChE,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAuB,EAAS,CAAC;;AAKjF,IAAa,IAAb,MAAqF;CACnF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EACd,EAAgB,KAAK,KAAK;;CAG5B,cAAc;EAWZ,AAVI,KAAK,KAAK,YAAY,QAAQ,KAAK,KAAK,YAAY,KAAA,MACtD,KAAK,KAAK,WAAY,cAAc,GAAG,KAAK,KAAK,YAG/C,KAAK,KAAK,UACZ,KAAK,KAAK,WAAY,OAAO,IAAI,UAAU,GAE3C,KAAK,KAAK,WAAY,OAAO,OAAO,UAAU,EAG5C,KAAK,KAAK,aACZ,KAAK,KAAK,WAAY,cAAc,MACpC,KAAK,KAAK,WAAY,OAAO,OAAO,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-scroll.controller.js","names":["#target","#offset","#startScroll","#onScrollEnd"],"sources":["../../../src/internal/controllers/state-scroll.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals, endOfScrollBox } from '@nvidia-elements/core/internal';\n\n/**\n * Adds active scroll state detection\n */\nexport function stateScroll<T extends Scroll>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateScrollController(instance));\n}\n\nexport interface StateScrollConfig {\n target?: HTMLElement;\n scrollOffset?: number;\n}\n\nexport type Scroll = ReactiveElement & {\n _internals?: ElementInternals;\n stateScrollConfig?: StateScrollConfig;\n};\n\nexport class StateScrollController<T extends Scroll> implements ReactiveController {\n get #target() {\n const target = this.host.stateScrollConfig?.target;\n return target ? target : this.host;\n }\n\n get #offset() {\n return this.host.stateScrollConfig?.scrollOffset ?? 0;\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostConnected() {\n await this.host.updateComplete;\n attachInternals(this.host);\n\n this.#startScroll();\n this.#target.addEventListener('scrollend', this.#onScrollEnd);\n }\n\n hostDisconnected() {\n this.#target.removeEventListener('scrollend', this.#onScrollEnd);\n }\n\n #onScrollEnd = () => {\n this.host._internals!.states.delete('scrolling');\n\n if (endOfScrollBox(this.#target, this.#offset)) {\n this.host.dispatchEvent(new CustomEvent('scrollboxend'));\n }\n\n this.#startScroll();\n };\n\n #startScroll() {\n this.#target.addEventListener('scroll', () => this.host._internals!.states.add('scrolling'), { once: true });\n }\n}\n"],"mappings":";;;AAUA,SAAgB,IAAgD;
|
|
1
|
+
{"version":3,"file":"state-scroll.controller.js","names":["#target","#offset","#startScroll","#onScrollEnd"],"sources":["../../../src/internal/controllers/state-scroll.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals, endOfScrollBox } from '@nvidia-elements/core/internal';\n\n/**\n * Adds active scroll state detection\n */\nexport function stateScroll<T extends Scroll>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateScrollController(instance));\n}\n\nexport interface StateScrollConfig {\n target?: HTMLElement;\n scrollOffset?: number;\n}\n\nexport type Scroll = ReactiveElement & {\n _internals?: ElementInternals;\n stateScrollConfig?: StateScrollConfig;\n};\n\nexport class StateScrollController<T extends Scroll> implements ReactiveController {\n get #target() {\n const target = this.host.stateScrollConfig?.target;\n return target ? target : this.host;\n }\n\n get #offset() {\n return this.host.stateScrollConfig?.scrollOffset ?? 0;\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostConnected() {\n await this.host.updateComplete;\n attachInternals(this.host);\n\n this.#startScroll();\n this.#target.addEventListener('scrollend', this.#onScrollEnd);\n }\n\n hostDisconnected() {\n this.#target.removeEventListener('scrollend', this.#onScrollEnd);\n }\n\n #onScrollEnd = () => {\n this.host._internals!.states.delete('scrolling');\n\n if (endOfScrollBox(this.#target, this.#offset)) {\n this.host.dispatchEvent(new CustomEvent('scrollboxend'));\n }\n\n this.#startScroll();\n };\n\n #startScroll() {\n this.#target.addEventListener('scroll', () => this.host._internals!.states.add('scrolling'), { once: true });\n }\n}\n"],"mappings":";;;AAUA,SAAgB,IAAgD;CAC9D,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAsB,EAAS,CAAC;;AAahF,IAAa,IAAb,MAAmF;CACjF,IAAIA,KAAU;EAEZ,OADe,KAAK,KAAK,mBAAmB,UACnB,KAAK;;CAGhC,IAAIC,KAAU;EACZ,OAAO,KAAK,KAAK,mBAAmB,gBAAgB;;CAGtD,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,MAAM,gBAAgB;EAKpB,AAJA,MAAM,KAAK,KAAK,gBAChB,EAAgB,KAAK,KAAK,EAE1B,KAAKC,IAAc,EACnB,KAAKF,GAAQ,iBAAiB,aAAa,KAAKG,GAAa;;CAG/D,mBAAmB;EACjB,KAAKH,GAAQ,oBAAoB,aAAa,KAAKG,GAAa;;CAGlE,WAAqB;EAOnB,AANA,KAAK,KAAK,WAAY,OAAO,OAAO,YAAY,EAE5C,EAAe,KAAKH,IAAS,KAAKC,GAAQ,IAC5C,KAAK,KAAK,cAAc,IAAI,YAAY,eAAe,CAAC,EAG1D,KAAKC,IAAc;;CAGrB,KAAe;EACb,KAAKF,GAAQ,iBAAiB,gBAAgB,KAAK,KAAK,WAAY,OAAO,IAAI,YAAY,EAAE,EAAE,MAAM,IAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-selected.controller.js","names":[],"sources":["../../../src/internal/controllers/state-selected.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds selected support for interactive custom elements including CSS State psuedo-selector :state(selected) and aria-selected.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected\n */\nexport function stateSelected<T extends Selected>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateSelectedController(instance));\n}\n\nexport type Selected = ReactiveElement & { selected: boolean; readonly?: boolean; _internals?: ElementInternals };\n\nexport class StateSelectedController<T extends Selected> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.readonly) {\n this.host._internals!.ariaSelected = null;\n this.host._internals!.states.delete('selected');\n return;\n }\n\n if (this.host._internals?.states.has('anchor') && this.host.selected) {\n this.host._internals!.ariaSelected = null;\n this.host._internals!.states.add('selected');\n this.host.querySelector('a')?.setAttribute('aria-current', 'page');\n return;\n }\n\n if (this.host.selected !== null && this.host.selected !== undefined) {\n this.host._internals!.ariaSelected = `${this.host.selected}`;\n }\n\n if (this.host.selected) {\n this.host._internals!.states.add('selected');\n } else {\n this.host._internals!.states.delete('selected');\n }\n }\n}\n"],"mappings":";;AAYA,SAAgB,IAAoD;
|
|
1
|
+
{"version":3,"file":"state-selected.controller.js","names":[],"sources":["../../../src/internal/controllers/state-selected.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds selected support for interactive custom elements including CSS State psuedo-selector :state(selected) and aria-selected.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected\n */\nexport function stateSelected<T extends Selected>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateSelectedController(instance));\n}\n\nexport type Selected = ReactiveElement & { selected: boolean; readonly?: boolean; _internals?: ElementInternals };\n\nexport class StateSelectedController<T extends Selected> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.readonly) {\n this.host._internals!.ariaSelected = null;\n this.host._internals!.states.delete('selected');\n return;\n }\n\n if (this.host._internals?.states.has('anchor') && this.host.selected) {\n this.host._internals!.ariaSelected = null;\n this.host._internals!.states.add('selected');\n this.host.querySelector('a')?.setAttribute('aria-current', 'page');\n return;\n }\n\n if (this.host.selected !== null && this.host.selected !== undefined) {\n this.host._internals!.ariaSelected = `${this.host.selected}`;\n }\n\n if (this.host.selected) {\n this.host._internals!.states.add('selected');\n } else {\n this.host._internals!.states.delete('selected');\n }\n }\n}\n"],"mappings":";;AAYA,SAAgB,IAAoD;CAClE,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAwB,EAAS,CAAC;;AAKlF,IAAa,IAAb,MAAuF;CACrF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EACd,EAAgB,KAAK,KAAK;;CAG5B,cAAc;EACZ,IAAI,KAAK,KAAK,UAAU;GAEtB,AADA,KAAK,KAAK,WAAY,eAAe,MACrC,KAAK,KAAK,WAAY,OAAO,OAAO,WAAW;GAC/C;;EAGF,IAAI,KAAK,KAAK,YAAY,OAAO,IAAI,SAAS,IAAI,KAAK,KAAK,UAAU;GAGpE,AAFA,KAAK,KAAK,WAAY,eAAe,MACrC,KAAK,KAAK,WAAY,OAAO,IAAI,WAAW,EAC5C,KAAK,KAAK,cAAc,IAAI,EAAE,aAAa,gBAAgB,OAAO;GAClE;;EAOF,AAJI,KAAK,KAAK,aAAa,QAAQ,KAAK,KAAK,aAAa,KAAA,MACxD,KAAK,KAAK,WAAY,eAAe,GAAG,KAAK,KAAK,aAGhD,KAAK,KAAK,WACZ,KAAK,KAAK,WAAY,OAAO,IAAI,WAAW,GAE5C,KAAK,KAAK,WAAY,OAAO,OAAO,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-anchor.controller.js","names":["#anchor","#slottedAnchor","#parentAnchor","#defaultSlot","#anchorSlot","#updateAnchorSlotAssignment"],"sources":["../../../src/internal/controllers/type-anchor.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { removeEmptyTextNode } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds anchor/link support for interactive custom elements.\n */\nexport function typeAnchor<T extends Anchor>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeAnchorController(instance));\n}\n\nexport interface Anchor extends ReactiveElement {\n disabled: boolean;\n readonly: boolean;\n _internals: ElementInternals;\n}\n\nexport class TypeAnchorController<T extends Anchor> implements ReactiveController {\n get #anchor() {\n return this.#slottedAnchor ? this.#slottedAnchor : this.#parentAnchor;\n }\n\n get #slottedAnchor() {\n // return elements that nest in a slot\n return this.host\n .shadowRoot!.querySelector<HTMLSlotElement>('slot, slot[name=anchor]')\n ?.assignedElements()\n ?.find(e => e?.tagName === 'A');\n }\n\n get #parentAnchor() {\n return this.host.parentElement?.tagName === 'A' ? (this.host.parentElement as HTMLAnchorElement) : null;\n }\n\n get #defaultSlot() {\n return this.host.shadowRoot!.querySelector<HTMLSlotElement>('slot:not([name])');\n }\n\n get #anchorSlot() {\n return this.host.shadowRoot!.querySelector<HTMLSlotElement>('slot[name=anchor]');\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostConnected() {\n attachInternals(this.host);\n await this.host.updateComplete;\n\n this.#updateAnchorSlotAssignment();\n\n if (this.#anchor) {\n this.host.readonly = true;\n this.host._internals?.states.add('anchor');\n } else {\n this.host._internals?.states.delete('anchor');\n }\n\n if (this.#parentAnchor) {\n this.#parentAnchor.style.textDecoration = 'none';\n this.host.style.cursor = 'pointer';\n }\n\n this.#anchor?.addEventListener('click', e => {\n if (this.host.disabled) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n });\n }\n\n #updateAnchorSlotAssignment() {\n if (this.#anchor && this.#anchorSlot) {\n this.#anchor.slot = 'anchor';\n this.#defaultSlot?.assignedNodes().forEach(node => removeEmptyTextNode(node));\n }\n }\n}\n"],"mappings":";;;AAWA,SAAgB,IAA+C;
|
|
1
|
+
{"version":3,"file":"type-anchor.controller.js","names":["#anchor","#slottedAnchor","#parentAnchor","#defaultSlot","#anchorSlot","#updateAnchorSlotAssignment"],"sources":["../../../src/internal/controllers/type-anchor.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { removeEmptyTextNode } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds anchor/link support for interactive custom elements.\n */\nexport function typeAnchor<T extends Anchor>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeAnchorController(instance));\n}\n\nexport interface Anchor extends ReactiveElement {\n disabled: boolean;\n readonly: boolean;\n _internals: ElementInternals;\n}\n\nexport class TypeAnchorController<T extends Anchor> implements ReactiveController {\n get #anchor() {\n return this.#slottedAnchor ? this.#slottedAnchor : this.#parentAnchor;\n }\n\n get #slottedAnchor() {\n // return elements that nest in a slot\n return this.host\n .shadowRoot!.querySelector<HTMLSlotElement>('slot, slot[name=anchor]')\n ?.assignedElements()\n ?.find(e => e?.tagName === 'A');\n }\n\n get #parentAnchor() {\n return this.host.parentElement?.tagName === 'A' ? (this.host.parentElement as HTMLAnchorElement) : null;\n }\n\n get #defaultSlot() {\n return this.host.shadowRoot!.querySelector<HTMLSlotElement>('slot:not([name])');\n }\n\n get #anchorSlot() {\n return this.host.shadowRoot!.querySelector<HTMLSlotElement>('slot[name=anchor]');\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostConnected() {\n attachInternals(this.host);\n await this.host.updateComplete;\n\n this.#updateAnchorSlotAssignment();\n\n if (this.#anchor) {\n this.host.readonly = true;\n this.host._internals?.states.add('anchor');\n } else {\n this.host._internals?.states.delete('anchor');\n }\n\n if (this.#parentAnchor) {\n this.#parentAnchor.style.textDecoration = 'none';\n this.host.style.cursor = 'pointer';\n }\n\n this.#anchor?.addEventListener('click', e => {\n if (this.host.disabled) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n });\n }\n\n #updateAnchorSlotAssignment() {\n if (this.#anchor && this.#anchorSlot) {\n this.#anchor.slot = 'anchor';\n this.#defaultSlot?.assignedNodes().forEach(node => removeEmptyTextNode(node));\n }\n }\n}\n"],"mappings":";;;AAWA,SAAgB,IAA+C;CAC7D,QAAQ,MAAkC,EAAO,gBAAiB,MAAgB,IAAI,EAAqB,EAAS,CAAC;;AASvH,IAAa,IAAb,MAAkF;CAChF,IAAIA,KAAU;EACZ,OAAO,KAAKC,KAAiB,KAAKA,KAAiB,KAAKC;;CAG1D,IAAID,KAAiB;EAEnB,OAAO,KAAK,KACT,WAAY,cAA+B,0BAA0B,EACpE,kBAAkB,EAClB,MAAK,MAAK,GAAG,YAAY,IAAI;;CAGnC,IAAIC,KAAgB;EAClB,OAAO,KAAK,KAAK,eAAe,YAAY,MAAO,KAAK,KAAK,gBAAsC;;CAGrG,IAAIC,KAAe;EACjB,OAAO,KAAK,KAAK,WAAY,cAA+B,mBAAmB;;CAGjF,IAAIC,KAAc;EAChB,OAAO,KAAK,KAAK,WAAY,cAA+B,oBAAoB;;CAGlF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,MAAM,gBAAgB;EAkBpB,AAjBA,EAAgB,KAAK,KAAK,EAC1B,MAAM,KAAK,KAAK,gBAEhB,KAAKC,IAA6B,EAE9B,KAAKL,MACP,KAAK,KAAK,WAAW,IACrB,KAAK,KAAK,YAAY,OAAO,IAAI,SAAS,IAE1C,KAAK,KAAK,YAAY,OAAO,OAAO,SAAS,EAG3C,KAAKE,OACP,KAAKA,GAAc,MAAM,iBAAiB,QAC1C,KAAK,KAAK,MAAM,SAAS,YAG3B,KAAKF,IAAS,iBAAiB,UAAS,MAAK;GAC3C,AAAI,KAAK,KAAK,aACZ,EAAE,gBAAgB,EAClB,EAAE,0BAA0B;IAE9B;;CAGJ,KAA8B;EAC5B,AAAI,KAAKA,MAAW,KAAKI,OACvB,KAAKJ,GAAQ,OAAO,UACpB,KAAKG,IAAc,eAAe,CAAC,SAAQ,MAAQ,EAAoB,EAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-button.controller.js","names":["#initialTabIndex"],"sources":["../../../src/internal/controllers/type-button.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds button support for interactive custom elements including aria-button and focus behavior.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role\n */\nexport function typeButton<T extends Button>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeButtonController(instance));\n}\n\nexport interface Button extends ReactiveElement {\n readonly: boolean;\n disabled: boolean;\n _internals?: ElementInternals;\n}\n\nexport class TypeButtonController<T extends Button> implements ReactiveController {\n #initialTabIndex: number;\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n\n if (this.host.hasAttribute('tabindex')) {\n this.#initialTabIndex = this.host.tabIndex;\n }\n }\n\n async hostUpdated() {\n await this.host.updateComplete;\n\n if (!this.host._internals!.role) {\n this.host._internals!.role = 'button';\n }\n\n this.host.tabIndex = this.host.disabled ? -1 : this.#initialTabIndex;\n\n if (this.host.readonly) {\n this.host._internals!.role = 'none';\n this.host.tabIndex = -1;\n this.host.removeAttribute('tabindex');\n }\n }\n}\n"],"mappings":";;AAWA,SAAgB,IAA+C;
|
|
1
|
+
{"version":3,"file":"type-button.controller.js","names":["#initialTabIndex"],"sources":["../../../src/internal/controllers/type-button.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds button support for interactive custom elements including aria-button and focus behavior.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role\n */\nexport function typeButton<T extends Button>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeButtonController(instance));\n}\n\nexport interface Button extends ReactiveElement {\n readonly: boolean;\n disabled: boolean;\n _internals?: ElementInternals;\n}\n\nexport class TypeButtonController<T extends Button> implements ReactiveController {\n #initialTabIndex: number;\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n\n if (this.host.hasAttribute('tabindex')) {\n this.#initialTabIndex = this.host.tabIndex;\n }\n }\n\n async hostUpdated() {\n await this.host.updateComplete;\n\n if (!this.host._internals!.role) {\n this.host._internals!.role = 'button';\n }\n\n this.host.tabIndex = this.host.disabled ? -1 : this.#initialTabIndex;\n\n if (this.host.readonly) {\n this.host._internals!.role = 'none';\n this.host.tabIndex = -1;\n this.host.removeAttribute('tabindex');\n }\n }\n}\n"],"mappings":";;AAWA,SAAgB,IAA+C;CAC7D,QAAQ,MAAkC,EAAO,gBAAiB,MAAgB,IAAI,EAAqB,EAAS,CAAC;;AASvH,IAAa,IAAb,MAAkF;CAChF;CAEA,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EAGd,AAFA,EAAgB,KAAK,KAAK,EAEtB,KAAK,KAAK,aAAa,WAAW,KACpC,KAAKA,KAAmB,KAAK,KAAK;;CAItC,MAAM,cAAc;EASlB,AARA,MAAM,KAAK,KAAK,gBAEX,KAAK,KAAK,WAAY,SACzB,KAAK,KAAK,WAAY,OAAO,WAG/B,KAAK,KAAK,WAAW,KAAK,KAAK,WAAW,KAAK,KAAKA,IAEhD,KAAK,KAAK,aACZ,KAAK,KAAK,WAAY,OAAO,QAC7B,KAAK,KAAK,WAAW,IACrB,KAAK,KAAK,gBAAgB,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-closable.controller.js","names":["#dispatchEvent"],"sources":["../../../src/internal/controllers/type-closable.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { attachInternals } from '../utils/a11y.js';\n\nexport type TypeClosable = ReactiveElement & { closable: boolean };\n\n/**\n * Controller for enabling closable behavior for elements.\n */\nexport class TypeClosableController<T extends TypeClosable> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n\n this.host.addEventListener('command', () => {\n this.host.hidden = true;\n this.#dispatchEvent();\n });\n }\n\n close() {\n if (this.host.closable) {\n this.#dispatchEvent();\n }\n }\n\n #dispatchEvent() {\n this.host.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true }));\n }\n}\n"],"mappings":";;AAWA,IAAa,IAAb,MAA0F;CACxF,YAAY,GAAiB;
|
|
1
|
+
{"version":3,"file":"type-closable.controller.js","names":["#dispatchEvent"],"sources":["../../../src/internal/controllers/type-closable.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { attachInternals } from '../utils/a11y.js';\n\nexport type TypeClosable = ReactiveElement & { closable: boolean };\n\n/**\n * Controller for enabling closable behavior for elements.\n */\nexport class TypeClosableController<T extends TypeClosable> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n\n this.host.addEventListener('command', () => {\n this.host.hidden = true;\n this.#dispatchEvent();\n });\n }\n\n close() {\n if (this.host.closable) {\n this.#dispatchEvent();\n }\n }\n\n #dispatchEvent() {\n this.host.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true }));\n }\n}\n"],"mappings":";;AAWA,IAAa,IAAb,MAA0F;CACxF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EAGd,AAFA,EAAgB,KAAK,KAAK,EAE1B,KAAK,KAAK,iBAAiB,iBAAiB;GAE1C,AADA,KAAK,KAAK,SAAS,IACnB,KAAKA,IAAgB;IACrB;;CAGJ,QAAQ;EACN,AAAI,KAAK,KAAK,YACZ,KAAKA,IAAgB;;CAIzB,KAAiB;EACf,KAAK,KAAK,cAAc,IAAI,YAAY,SAAS;GAAE,SAAS;GAAM,UAAU;GAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-command.controller.js","names":["#updateListener","#triggerCommand"],"sources":["../../../src/internal/controllers/type-command.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { getFlattenedDOMTree } from '../utils/dom.js';\n\n/**\n * Adds Invoker Commands API support for interactive custom elements.\n * https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API\n */\nexport function typeCommand<T extends Command>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new TypeCommandController(instance));\n}\n\nexport type Command = ReactiveElement &\n HTMLElement & {\n command: string;\n commandfor: string | null;\n commandForElement: HTMLElement | null;\n readonly: boolean;\n disabled: boolean;\n };\n\nexport class TypeCommandController<T extends Command> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostUpdated() {\n await this.host.updateComplete;\n this.#updateListener();\n }\n\n hostDisconnected() {\n this.host.removeEventListener('click', this.#triggerCommand);\n }\n\n #updateListener() {\n if (!this.host.readonly && !this.host.disabled) {\n this.host.addEventListener('click', this.#triggerCommand);\n } else {\n this.host.removeEventListener('click', this.#triggerCommand);\n }\n }\n\n #triggerCommand = () => {\n if ((this.host.commandfor || this.host.commandForElement) && globalThis.CommandEvent) {\n const match = getFlattenedDOMTree(this.host.getRootNode() as HTMLElement).find(\n el => el.id === this.host.commandfor || el === this.host.commandForElement\n );\n if (!match) {\n console.warn('commandForElement', this.host.commandfor || this.host.commandForElement, 'not found');\n } else {\n match.dispatchEvent(new globalThis.CommandEvent('command', { command: this.host.command, source: this.host }));\n }\n }\n };\n}\n"],"mappings":";;AAWA,SAAgB,IAAiD;
|
|
1
|
+
{"version":3,"file":"type-command.controller.js","names":["#updateListener","#triggerCommand"],"sources":["../../../src/internal/controllers/type-command.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { getFlattenedDOMTree } from '../utils/dom.js';\n\n/**\n * Adds Invoker Commands API support for interactive custom elements.\n * https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API\n */\nexport function typeCommand<T extends Command>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new TypeCommandController(instance));\n}\n\nexport type Command = ReactiveElement &\n HTMLElement & {\n command: string;\n commandfor: string | null;\n commandForElement: HTMLElement | null;\n readonly: boolean;\n disabled: boolean;\n };\n\nexport class TypeCommandController<T extends Command> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostUpdated() {\n await this.host.updateComplete;\n this.#updateListener();\n }\n\n hostDisconnected() {\n this.host.removeEventListener('click', this.#triggerCommand);\n }\n\n #updateListener() {\n if (!this.host.readonly && !this.host.disabled) {\n this.host.addEventListener('click', this.#triggerCommand);\n } else {\n this.host.removeEventListener('click', this.#triggerCommand);\n }\n }\n\n #triggerCommand = () => {\n if ((this.host.commandfor || this.host.commandForElement) && globalThis.CommandEvent) {\n const match = getFlattenedDOMTree(this.host.getRootNode() as HTMLElement).find(\n el => el.id === this.host.commandfor || el === this.host.commandForElement\n );\n if (!match) {\n console.warn('commandForElement', this.host.commandfor || this.host.commandForElement, 'not found');\n } else {\n match.dispatchEvent(new globalThis.CommandEvent('command', { command: this.host.command, source: this.host }));\n }\n }\n };\n}\n"],"mappings":";;AAWA,SAAgB,IAAiD;CAC/D,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAsB,EAAS,CAAC;;AAYhF,IAAa,IAAb,MAAoF;CAClF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,MAAM,cAAc;EAElB,AADA,MAAM,KAAK,KAAK,gBAChB,KAAKA,IAAiB;;CAGxB,mBAAmB;EACjB,KAAK,KAAK,oBAAoB,SAAS,KAAKC,GAAgB;;CAG9D,KAAkB;EAChB,AAAI,CAAC,KAAK,KAAK,YAAY,CAAC,KAAK,KAAK,WACpC,KAAK,KAAK,iBAAiB,SAAS,KAAKA,GAAgB,GAEzD,KAAK,KAAK,oBAAoB,SAAS,KAAKA,GAAgB;;CAIhE,WAAwB;EACtB,KAAK,KAAK,KAAK,cAAc,KAAK,KAAK,sBAAsB,WAAW,cAAc;GACpF,IAAM,IAAQ,EAAoB,KAAK,KAAK,aAAa,CAAgB,CAAC,MACxE,MAAM,EAAG,OAAO,KAAK,KAAK,cAAc,MAAO,KAAK,KAAK,kBAC1D;GACD,AAAK,IAGH,EAAM,cAAc,IAAI,WAAW,aAAa,WAAW;IAAE,SAAS,KAAK,KAAK;IAAS,QAAQ,KAAK;IAAM,CAAC,CAAC,GAF9G,QAAQ,KAAK,qBAAqB,KAAK,KAAK,cAAc,KAAK,KAAK,mBAAmB,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-expandable.controller.js","names":["#useHidden","#commandTriggered"],"sources":["../../../src/internal/controllers/type-expandable.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { attachInternals } from '../utils/a11y.js';\n\nexport type TypeExpandable = ReactiveElement & {\n expanded?: boolean;\n behaviorExpand?: boolean;\n expandable?: boolean;\n _internals?: ElementInternals;\n};\n\n/**\n * Controller for enabling expandable behavior for elements.\n * @event open - Dispatched when the expandable element opens.\n * @event close - Dispatched when the expandable element closes.\n * @property expanded - expanded state\n * @property behaviorExpand - determines if stateful auto behavior should enable\n */\nexport class TypeExpandableController<T extends TypeExpandable> implements ReactiveController {\n #commandTriggered = false;\n #useHidden = false;\n\n constructor(\n private host: T,\n config: { useHidden?: boolean } = {}\n ) {\n this.#useHidden = config.useHidden ?? false;\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n\n this.host.addEventListener('command', ((e: CommandEvent) => {\n this.#commandTriggered = true;\n if (e.command === '--toggle') {\n this.toggle();\n }\n\n if (e.command === '--open') {\n this.open();\n }\n\n if (e.command === '--close') {\n this.close();\n }\n this.#commandTriggered = false;\n }) as EventListener);\n }\n\n hostUpdated() {\n this.host.expandable\n ? this.host._internals!.states.add('expandable')\n : this.host._internals!.states.delete('expandable');\n }\n\n open() {\n if (this.host.behaviorExpand || this.#commandTriggered) {\n this.host.expanded = true;\n\n if (this.#useHidden) {\n this.host.hidden = false;\n }\n }\n\n this.host.dispatchEvent(new CustomEvent('open', { bubbles: true, composed: true }));\n }\n\n close() {\n if (this.host.behaviorExpand || this.#commandTriggered) {\n this.host.expanded = false;\n\n if (this.#useHidden) {\n this.host.hidden = true;\n }\n }\n\n this.host.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true }));\n }\n\n toggle() {\n if (this.host.expanded || (this.#useHidden && !this.host.hidden)) {\n this.close();\n } else {\n this.open();\n }\n }\n}\n"],"mappings":";;AAoBA,IAAa,IAAb,MAA8F;CAC5F,KAAoB;CACpB,KAAa;CAEb,YACE,GACA,IAAkC,EAAE,EACpC;
|
|
1
|
+
{"version":3,"file":"type-expandable.controller.js","names":["#useHidden","#commandTriggered"],"sources":["../../../src/internal/controllers/type-expandable.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { attachInternals } from '../utils/a11y.js';\n\nexport type TypeExpandable = ReactiveElement & {\n expanded?: boolean;\n behaviorExpand?: boolean;\n expandable?: boolean;\n _internals?: ElementInternals;\n};\n\n/**\n * Controller for enabling expandable behavior for elements.\n * @event open - Dispatched when the expandable element opens.\n * @event close - Dispatched when the expandable element closes.\n * @property expanded - expanded state\n * @property behaviorExpand - determines if stateful auto behavior should enable\n */\nexport class TypeExpandableController<T extends TypeExpandable> implements ReactiveController {\n #commandTriggered = false;\n #useHidden = false;\n\n constructor(\n private host: T,\n config: { useHidden?: boolean } = {}\n ) {\n this.#useHidden = config.useHidden ?? false;\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n\n this.host.addEventListener('command', ((e: CommandEvent) => {\n this.#commandTriggered = true;\n if (e.command === '--toggle') {\n this.toggle();\n }\n\n if (e.command === '--open') {\n this.open();\n }\n\n if (e.command === '--close') {\n this.close();\n }\n this.#commandTriggered = false;\n }) as EventListener);\n }\n\n hostUpdated() {\n this.host.expandable\n ? this.host._internals!.states.add('expandable')\n : this.host._internals!.states.delete('expandable');\n }\n\n open() {\n if (this.host.behaviorExpand || this.#commandTriggered) {\n this.host.expanded = true;\n\n if (this.#useHidden) {\n this.host.hidden = false;\n }\n }\n\n this.host.dispatchEvent(new CustomEvent('open', { bubbles: true, composed: true }));\n }\n\n close() {\n if (this.host.behaviorExpand || this.#commandTriggered) {\n this.host.expanded = false;\n\n if (this.#useHidden) {\n this.host.hidden = true;\n }\n }\n\n this.host.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true }));\n }\n\n toggle() {\n if (this.host.expanded || (this.#useHidden && !this.host.hidden)) {\n this.close();\n } else {\n this.open();\n }\n }\n}\n"],"mappings":";;AAoBA,IAAa,IAAb,MAA8F;CAC5F,KAAoB;CACpB,KAAa;CAEb,YACE,GACA,IAAkC,EAAE,EACpC;EAEA,AAJQ,KAAA,OAAA,GAGR,KAAKA,KAAa,EAAO,aAAa,IACtC,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EAGd,AAFA,EAAgB,KAAK,KAAK,EAE1B,KAAK,KAAK,iBAAiB,aAAa,MAAoB;GAa1D,AAZA,KAAKC,KAAoB,IACrB,EAAE,YAAY,cAChB,KAAK,QAAQ,EAGX,EAAE,YAAY,YAChB,KAAK,MAAM,EAGT,EAAE,YAAY,aAChB,KAAK,OAAO,EAEd,KAAKA,KAAoB;KACP;;CAGtB,cAAc;EACZ,KAAK,KAAK,aACN,KAAK,KAAK,WAAY,OAAO,IAAI,aAAa,GAC9C,KAAK,KAAK,WAAY,OAAO,OAAO,aAAa;;CAGvD,OAAO;EASL,CARI,KAAK,KAAK,kBAAkB,KAAKA,QACnC,KAAK,KAAK,WAAW,IAEjB,KAAKD,OACP,KAAK,KAAK,SAAS,MAIvB,KAAK,KAAK,cAAc,IAAI,YAAY,QAAQ;GAAE,SAAS;GAAM,UAAU;GAAM,CAAC,CAAC;;CAGrF,QAAQ;EASN,CARI,KAAK,KAAK,kBAAkB,KAAKC,QACnC,KAAK,KAAK,WAAW,IAEjB,KAAKD,OACP,KAAK,KAAK,SAAS,MAIvB,KAAK,KAAK,cAAc,IAAI,YAAY,SAAS;GAAE,SAAS;GAAM,UAAU;GAAM,CAAC,CAAC;;CAGtF,SAAS;EACP,AAAI,KAAK,KAAK,YAAa,KAAKA,MAAc,CAAC,KAAK,KAAK,SACvD,KAAK,OAAO,GAEZ,KAAK,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-interest.controller.js","names":["#setupInterestEvents","#teardownInterestEvents","#interestSetupComplete","#triggerInterest","#triggerLoseInterest","#updateInterestForElement"],"sources":["../../../src/internal/controllers/type-interest.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { getFlattenedDOMTree } from '../utils/dom.js';\n\nexport type InterestEvent = Event & {\n source: HTMLElement;\n};\n\n/**\n * Adds Interest Invoker Commands API support for interactive custom elements.\n * https://developer.mozilla.org/en-US/docs/Web/API/Popover_API/Using_interest_invokers\n */\nexport function typeInterest<T extends Interest>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new TypeInterestController(instance));\n}\n\nexport type Interest = ReactiveElement &\n HTMLElement & {\n interestfor: string | null;\n interestForElement: HTMLElement | null;\n readonly: boolean;\n disabled: boolean;\n };\n\nexport class TypeInterestController<T extends Interest> implements ReactiveController {\n #interestSetupComplete = false;\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostConnected() {\n await this.#setupInterestEvents();\n }\n\n async hostUpdated() {\n await this.#setupInterestEvents();\n }\n\n hostDisconnected() {\n this.#teardownInterestEvents();\n }\n\n async #setupInterestEvents() {\n await this.host.updateComplete;\n if (!this.#interestSetupComplete) {\n this.#interestSetupComplete = true;\n this.host.addEventListener('mouseenter', this.#triggerInterest);\n this.host.addEventListener('mouseleave', this.#triggerLoseInterest);\n this.host.addEventListener('focus', this.#triggerInterest);\n this.host.addEventListener('blur', this.#triggerLoseInterest);\n }\n }\n\n #teardownInterestEvents() {\n this.#interestSetupComplete = false;\n this.host.removeEventListener('mouseenter', this.#triggerInterest);\n this.host.removeEventListener('mouseleave', this.#triggerLoseInterest);\n this.host.removeEventListener('focus', this.#triggerInterest);\n this.host.removeEventListener('blur', this.#triggerLoseInterest);\n }\n\n #triggerInterest = () => {\n this.#updateInterestForElement();\n if (this.host.interestForElement) {\n const event = new Event('interest', { cancelable: true }) as InterestEvent;\n event.source = this.host;\n this.host.interestForElement.dispatchEvent(event);\n }\n };\n\n #triggerLoseInterest = () => {\n this.#updateInterestForElement();\n if (this.host.interestForElement) {\n const event = new Event('loseinterest', { cancelable: true }) as InterestEvent;\n event.source = this.host;\n this.host.interestForElement.dispatchEvent(event);\n }\n };\n\n // we can only do this on interaction as its too costly to do this on every getter or update of the interestfor attribute, this diverges from the native behavior of the interestfor attribute\n #updateInterestForElement() {\n const interestForIdRef = this.host.getAttribute('interestfor');\n if (interestForIdRef && !this.host.interestForElement) {\n this.host.interestForElement = getFlattenedDOMTree(this.host.getRootNode() as HTMLElement).find(\n el => el.id === interestForIdRef\n )!;\n }\n\n // legacy behavior that allows popovertarget to trigger interestfor behavior for hint type popovers\n const popovertargetIdRef = this.host.getAttribute('popovertarget');\n if (popovertargetIdRef && !interestForIdRef) {\n const target = getFlattenedDOMTree(this.host.getRootNode() as HTMLElement).find(\n el => el.id === popovertargetIdRef\n );\n if (target && target.popover === 'hint') {\n this.host.interestForElement = target;\n }\n }\n }\n}\n"],"mappings":";;AAeA,SAAgB,IAAmD;
|
|
1
|
+
{"version":3,"file":"type-interest.controller.js","names":["#setupInterestEvents","#teardownInterestEvents","#interestSetupComplete","#triggerInterest","#triggerLoseInterest","#updateInterestForElement"],"sources":["../../../src/internal/controllers/type-interest.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { getFlattenedDOMTree } from '../utils/dom.js';\n\nexport type InterestEvent = Event & {\n source: HTMLElement;\n};\n\n/**\n * Adds Interest Invoker Commands API support for interactive custom elements.\n * https://developer.mozilla.org/en-US/docs/Web/API/Popover_API/Using_interest_invokers\n */\nexport function typeInterest<T extends Interest>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new TypeInterestController(instance));\n}\n\nexport type Interest = ReactiveElement &\n HTMLElement & {\n interestfor: string | null;\n interestForElement: HTMLElement | null;\n readonly: boolean;\n disabled: boolean;\n };\n\nexport class TypeInterestController<T extends Interest> implements ReactiveController {\n #interestSetupComplete = false;\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostConnected() {\n await this.#setupInterestEvents();\n }\n\n async hostUpdated() {\n await this.#setupInterestEvents();\n }\n\n hostDisconnected() {\n this.#teardownInterestEvents();\n }\n\n async #setupInterestEvents() {\n await this.host.updateComplete;\n if (!this.#interestSetupComplete) {\n this.#interestSetupComplete = true;\n this.host.addEventListener('mouseenter', this.#triggerInterest);\n this.host.addEventListener('mouseleave', this.#triggerLoseInterest);\n this.host.addEventListener('focus', this.#triggerInterest);\n this.host.addEventListener('blur', this.#triggerLoseInterest);\n }\n }\n\n #teardownInterestEvents() {\n this.#interestSetupComplete = false;\n this.host.removeEventListener('mouseenter', this.#triggerInterest);\n this.host.removeEventListener('mouseleave', this.#triggerLoseInterest);\n this.host.removeEventListener('focus', this.#triggerInterest);\n this.host.removeEventListener('blur', this.#triggerLoseInterest);\n }\n\n #triggerInterest = () => {\n this.#updateInterestForElement();\n if (this.host.interestForElement) {\n const event = new Event('interest', { cancelable: true }) as InterestEvent;\n event.source = this.host;\n this.host.interestForElement.dispatchEvent(event);\n }\n };\n\n #triggerLoseInterest = () => {\n this.#updateInterestForElement();\n if (this.host.interestForElement) {\n const event = new Event('loseinterest', { cancelable: true }) as InterestEvent;\n event.source = this.host;\n this.host.interestForElement.dispatchEvent(event);\n }\n };\n\n // we can only do this on interaction as its too costly to do this on every getter or update of the interestfor attribute, this diverges from the native behavior of the interestfor attribute\n #updateInterestForElement() {\n const interestForIdRef = this.host.getAttribute('interestfor');\n if (interestForIdRef && !this.host.interestForElement) {\n this.host.interestForElement = getFlattenedDOMTree(this.host.getRootNode() as HTMLElement).find(\n el => el.id === interestForIdRef\n )!;\n }\n\n // legacy behavior that allows popovertarget to trigger interestfor behavior for hint type popovers\n const popovertargetIdRef = this.host.getAttribute('popovertarget');\n if (popovertargetIdRef && !interestForIdRef) {\n const target = getFlattenedDOMTree(this.host.getRootNode() as HTMLElement).find(\n el => el.id === popovertargetIdRef\n );\n if (target && target.popover === 'hint') {\n this.host.interestForElement = target;\n }\n }\n }\n}\n"],"mappings":";;AAeA,SAAgB,IAAmD;CACjE,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAuB,EAAS,CAAC;;AAWjF,IAAa,IAAb,MAAsF;CACpF,KAAyB;CAEzB,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,MAAM,gBAAgB;EACpB,MAAM,KAAKA,IAAsB;;CAGnC,MA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AClE,IAAI,KAAsB,CAAC,GAAkB;GAC3C,IAAM,IAAS,EAAoB,KAAK,KAAK,aAAa,CAAgB,CAAC,MACzE,MAAM,EAAG,OAAO,EACjB;GACD,AAAI,KAAU,EAAO,YAAY,WAC/B,KAAK,KAAK,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-native-popover-trigger.controller.js","names":["#click"],"sources":["../../../src/internal/controllers/type-native-popover-trigger.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveElement, ReactiveController } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { getFlattenedDOMTree } from '../utils/dom.js';\nimport { getHostAnchor } from './type-native-popover.utils.js';\n\nexport interface NativePopoverTrigger extends ReactiveElement {\n disabled: boolean;\n popoverTargetAction: 'show' | 'hide' | 'toggle';\n popoverTargetElement: HTMLElement | null;\n popovertarget: string;\n anchor?: HTMLElement;\n}\n\nexport function typeNativePopoverTrigger<T extends NativePopoverTrigger>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new TypeNativePopoverTriggerController(instance));\n}\n\nexport class TypeNativePopoverTriggerController<T extends NativePopoverTrigger> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n this.host.addEventListener('click', this.#click);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('click', this.#click);\n }\n\n #click = () => {\n let source = this.host as HTMLElement;\n let popoverTargetElement = this.host.popoverTargetElement;\n\n // we can only do this on interaction as its too costly to do this on every getter or update of the popovertarget attribute, this diverges from the native behavior of the popovertarget attribute\n if (!popoverTargetElement && this.host.popovertarget) {\n popoverTargetElement = getFlattenedDOMTree(this.host.getRootNode()).find(e => e.id === this.host.popovertarget)!;\n this.host.popoverTargetElement = popoverTargetElement ?? null;\n }\n\n // if popover has explicit anchor, use it as the source\n if ((popoverTargetElement as NativePopoverTrigger)?.anchor) {\n source = getHostAnchor(popoverTargetElement as NativePopoverTrigger);\n }\n\n if (popoverTargetElement && !this.host.disabled) {\n if (this.host.popoverTargetAction === 'hide') {\n popoverTargetElement.hidePopover();\n } else if (this.host.popoverTargetAction === 'show') {\n popoverTargetElement.showPopover({ source });\n } else {\n popoverTargetElement.togglePopover({ source });\n }\n }\n };\n}\n"],"mappings":";;;AAgBA,SAAgB,IAA2E;
|
|
1
|
+
{"version":3,"file":"type-native-popover-trigger.controller.js","names":["#click"],"sources":["../../../src/internal/controllers/type-native-popover-trigger.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveElement, ReactiveController } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { getFlattenedDOMTree } from '../utils/dom.js';\nimport { getHostAnchor } from './type-native-popover.utils.js';\n\nexport interface NativePopoverTrigger extends ReactiveElement {\n disabled: boolean;\n popoverTargetAction: 'show' | 'hide' | 'toggle';\n popoverTargetElement: HTMLElement | null;\n popovertarget: string;\n anchor?: HTMLElement;\n}\n\nexport function typeNativePopoverTrigger<T extends NativePopoverTrigger>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new TypeNativePopoverTriggerController(instance));\n}\n\nexport class TypeNativePopoverTriggerController<T extends NativePopoverTrigger> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n this.host.addEventListener('click', this.#click);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('click', this.#click);\n }\n\n #click = () => {\n let source = this.host as HTMLElement;\n let popoverTargetElement = this.host.popoverTargetElement;\n\n // we can only do this on interaction as its too costly to do this on every getter or update of the popovertarget attribute, this diverges from the native behavior of the popovertarget attribute\n if (!popoverTargetElement && this.host.popovertarget) {\n popoverTargetElement = getFlattenedDOMTree(this.host.getRootNode()).find(e => e.id === this.host.popovertarget)!;\n this.host.popoverTargetElement = popoverTargetElement ?? null;\n }\n\n // if popover has explicit anchor, use it as the source\n if ((popoverTargetElement as NativePopoverTrigger)?.anchor) {\n source = getHostAnchor(popoverTargetElement as NativePopoverTrigger);\n }\n\n if (popoverTargetElement && !this.host.disabled) {\n if (this.host.popoverTargetAction === 'hide') {\n popoverTargetElement.hidePopover();\n } else if (this.host.popoverTargetAction === 'show') {\n popoverTargetElement.showPopover({ source });\n } else {\n popoverTargetElement.togglePopover({ source });\n }\n }\n };\n}\n"],"mappings":";;;AAgBA,SAAgB,IAA2E;CACzF,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAmC,EAAS,CAAC;;AAG7F,IAAa,IAAb,MAA8G;CAC5G,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EACd,KAAK,KAAK,iBAAiB,SAAS,KAAKA,GAAO;;CAGlD,mBAAmB;EACjB,KAAK,KAAK,oBAAoB,SAAS,KAAKA,GAAO;;CAGrD,WAAe;EACb,IAAI,IAAS,KAAK,MACd,IAAuB,KAAK,KAAK;EAarC,AAVI,CAAC,KAAwB,KAAK,KAAK,kBACrC,IAAuB,EAAoB,KAAK,KAAK,aAAa,CAAC,CAAC,MAAK,MAAK,EAAE,OAAO,KAAK,KAAK,cAAc,EAC/G,KAAK,KAAK,uBAAuB,KAAwB,OAItD,GAA+C,WAClD,IAAS,EAAc,EAA6C,GAGlE,KAAwB,CAAC,KAAK,KAAK,aACjC,KAAK,KAAK,wBAAwB,SACpC,EAAqB,aAAa,GACzB,KAAK,KAAK,wBAAwB,SAC3C,EAAqB,YAAY,EAAE,WAAQ,CAAC,GAE5C,EAAqB,cAAc,EAAE,WAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-native-popover.controller.js","names":["#nativeTriggers","#updateLegacyTriggers","#setupLegacyTriggers","#setupModalLightDismiss","#toggleFocus","#parseInterestDelay","#interestTimeout","#observers","#pointerdownWithinModal","#legacyHostTrigger","#previousLegacyTrigger"],"sources":["../../../src/internal/controllers/type-native-popover.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { clickOutsideElementBounds, generateId, getAttributeListChanges } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\nimport { focusElement } from '../utils/focus.js';\nimport { getHostAnchor, getHostTrigger, hasOpenPopover } from './type-native-popover.utils.js';\nimport type { PopoverType } from '../types/index.js';\nimport type { InterestEvent } from './type-interest.controller.js';\n\nexport interface NativePopover extends ReactiveElement {\n anchor?: HTMLElement | string;\n closeTimeout?: number;\n popoverType?: PopoverType;\n modal?: boolean;\n popoverDismissible?: boolean;\n _activeTrigger?: HTMLElement;\n _internals?: ElementInternals;\n\n /** @deprecated */\n trigger?: HTMLElement | string;\n /** @deprecated */\n openDelay?: number;\n /** @deprecated */\n behaviorTrigger?: boolean;\n}\n\n/**\n * https://open-ui.org/components/popup.research.explainer\n */\nexport class TypeNativePopoverController<T extends NativePopover> implements ReactiveController {\n get #nativeTriggers(): HTMLElement[] {\n const root = this.host.getRootNode() as HTMLElement;\n const popoverTargetTriggers = Array.from(\n root.querySelectorAll(`[popovertarget=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const commandForTriggers = Array.from(\n root.querySelectorAll(`[commandfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const interestForTriggers = Array.from(\n root.querySelectorAll(`[interestfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n return [...popoverTargetTriggers, ...commandForTriggers, ...interestForTriggers];\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n\n const showPopover = this.host.showPopover;\n this.host.showPopover = (options?: ShowPopoverOptions) => {\n if (this.host.isConnected) {\n // provide legacy fallback for source anchor or trigger if not provided, this can happen if the popover is dynamically created in the DOM without the use of the standard popover api or legacy trigger based api\n let source: HTMLElement | Element | null = options?.source ?? null;\n if (!source) {\n if (this.host.anchor) {\n source = getHostAnchor(this.host);\n } else if (this.host.trigger) {\n source = getHostTrigger(this.host, this.host.trigger);\n } else {\n source = globalThis.document.activeElement;\n }\n }\n\n showPopover.call(this.host, { source: source as HTMLElement });\n }\n };\n }\n\n // eslint-disable-next-line max-lines-per-function\n async hostConnected() {\n attachInternals(this.host);\n this.host.popover = this.host.popoverType ?? null;\n await this.host.updateComplete;\n this.host.setAttribute('nve-popover', '');\n this.#updateLegacyTriggers();\n this.#setupLegacyTriggers(); // eslint-disable-line @typescript-eslint/no-floating-promises\n this.#setupModalLightDismiss();\n this.host.inert = this.host.matches(':not(:popover-open)') && !!this.#nativeTriggers.length;\n\n this.host.addEventListener('beforetoggle', e => {\n if (e.newState === 'open') {\n this.host._internals!.states.add('transition-start');\n }\n });\n\n this.host.addEventListener('toggle', (e: ToggleEvent) => {\n if (this.host.behaviorTrigger) {\n this.host.hidden = e.newState === 'closed';\n }\n\n if (e.newState === 'open' && this.host.closeTimeout) {\n setTimeout(() => this.host.hidePopover(), this.host.closeTimeout);\n }\n\n this.host.inert = this.host.matches(':not(:popover-open)');\n\n if (this.host.modal) {\n this.#toggleFocus(e.newState === 'open', e.target as HTMLElement);\n }\n\n this.host.dispatchEvent(\n new CustomEvent(e.newState === 'open' && e.oldState !== 'open' ? 'open' : 'close', {\n bubbles: true,\n composed: true,\n detail: { trigger: e.source }\n })\n );\n });\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API#creating_declarative_popovers\n this.host.addEventListener('command', ((e: CommandEvent) => {\n if (e.command === 'toggle-popover') {\n this.host.togglePopover({ source: e.source as HTMLElement });\n }\n\n if (e.command === 'hide-popover') {\n this.host.hidePopover();\n }\n\n if (e.command === 'show-popover') {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }) as EventListener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Popover_API/Using_interest_invokers\n this.host.addEventListener('interest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n const interestDelayStart = this.host.openDelay ?? this.#parseInterestDelay();\n if (interestDelayStart) {\n this.#interestTimeout = setTimeout(() => {\n if (this.host.isConnected) {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }, interestDelayStart);\n } else {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }\n }) as EventListener);\n\n this.host.addEventListener('loseinterest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n this.host.hidePopover();\n }\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }) as EventListener);\n }\n\n #interestTimeout: ReturnType<typeof setTimeout> | null = null;\n #observers: MutationObserver[] = [];\n #previousLegacyTrigger: HTMLButtonElement | null = null;\n\n async hostUpdated() {\n this.host.popover = this.host.popoverType ?? null;\n this.#updateLegacyTriggers();\n }\n\n hostDisconnected() {\n this.#observers.forEach(observer => observer.disconnect());\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }\n\n #parseInterestDelay(): number {\n const style = getComputedStyle(this.host);\n const raw = (style as unknown as { interestDelayStart: string }).interestDelayStart;\n if (!raw) {\n return 0;\n }\n const value = parseFloat(raw);\n return raw.endsWith('ms') ? value : value * 1000;\n }\n\n #pointerdownWithinModal = false;\n\n #setupModalLightDismiss() {\n this.host.addEventListener('pointerdown', e => {\n if (this.host.modal && this.host.matches(':popover-open')) {\n this.#pointerdownWithinModal = clickOutsideElementBounds(e, this.host);\n }\n });\n\n this.host.addEventListener('pointerup', e => {\n if (\n this.#pointerdownWithinModal &&\n this.host.popoverDismissible &&\n this.host.modal &&\n this.host.matches(':popover-open') &&\n !hasOpenPopover(this.host) &&\n clickOutsideElementBounds(e, this.host)\n ) {\n this.host.hidePopover();\n }\n });\n }\n\n get #legacyHostTrigger(): HTMLElement | null {\n return this.host.trigger ? (getHostTrigger(this.host, this.host.trigger) as HTMLButtonElement) : null;\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n async #setupLegacyTriggers() {\n await new Promise(r => requestAnimationFrame(r));\n\n // setup hidden updates for legacy triggers\n this.#observers.push(\n getAttributeListChanges(this.host, ['hidden'], () => {\n if (this.host.isConnected && !this.host.hidden && !this.host.matches(':popover-open')) {\n this.host.showPopover();\n }\n\n if (this.host.isConnected && this.host.hidden && this.host.matches(':popover-open')) {\n this.host.hidePopover();\n }\n })\n );\n\n // determine if popover is open by default\n if (\n this.host.isConnected &&\n !this.#nativeTriggers.length &&\n !this.host.hidden &&\n !this.host.matches(':popover-open')\n ) {\n this.host.popover = 'manual';\n this.host.showPopover();\n }\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n #updateLegacyTriggers() {\n const trigger = this.#legacyHostTrigger as HTMLButtonElement;\n\n // Clean up previous trigger if it changed\n if (this.#previousLegacyTrigger && this.#previousLegacyTrigger !== trigger) {\n this.#previousLegacyTrigger.popoverTargetElement = null;\n this.#previousLegacyTrigger.removeAttribute('popovertarget');\n }\n\n // if not a hint type setup native popovertarget\n if (trigger) {\n if (this.host.popoverType === 'hint') {\n trigger.addEventListener('mouseenter', () => this.host.showPopover({ source: trigger as HTMLElement }));\n trigger.addEventListener('mouseleave', () => this.host.hidePopover());\n trigger.addEventListener('focusout', () => this.host.hidePopover());\n } else {\n this.host.id = this.host.id ? this.host.id : generateId();\n trigger.popoverTargetElement = this.host;\n trigger.setAttribute('popovertarget', this.host.id);\n }\n this.#previousLegacyTrigger = trigger;\n }\n }\n\n #toggleFocus(open: boolean, target: HTMLElement) {\n if (open) {\n // only focus popover if not the active element and not containing the active element already\n if ((this.host.getRootNode() as Document).activeElement !== this.host && !this.host.shadowRoot!.activeElement) {\n focusElement(this.host);\n }\n } else {\n focusElement(target);\n }\n }\n}\n"],"mappings":";;;;;AA+BA,IAAa,IAAb,MAAgG;CAC9F,KAAA,IAAqC;EACnC,IAAM,IAAO,KAAK,KAAK,aAAa,EAC9B,IAAwB,MAAM,KAClC,EAAK,iBAAiB,mBAAmB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CACnG,EAEK,IAAqB,MAAM,KAC/B,EAAK,iBAAiB,gBAAgB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CAChG,EAEK,IAAsB,MAAM,KAChC,EAAK,iBAAiB,iBAAiB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CACjG;AAED,SAAO;GAAC,GAAG;GAAuB,GAAG;GAAoB,GAAG;GAAoB;;CAGlF,YAAY,GAAiB;AAC3B,EADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;EAE7B,IAAM,IAAc,KAAK,KAAK;AAC9B,OAAK,KAAK,eAAe,MAAiC;AACxD,OAAI,KAAK,KAAK,aAAa;IAEzB,IAAI,IAAuC,GAAS,UAAU;AAW9D,IAVA,AAMI,MALE,KAAK,KAAK,SACH,EAAc,KAAK,KAAK,GACxB,KAAK,KAAK,UACV,EAAe,KAAK,MAAM,KAAK,KAAK,QAAQ,GAE5C,WAAW,SAAS,eAIjC,EAAY,KAAK,KAAK,MAAM,EAAU,WAAuB,CAAC;;;;CAMpE,MAAM,gBAAgB;AAwEpB,EAvEA,EAAgB,KAAK,KAAK,EAC1B,KAAK,KAAK,UAAU,KAAK,KAAK,eAAe,MAC7C,MAAM,KAAK,KAAK,gBA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
{"version":3,"file":"type-native-popover.controller.js","names":["#nativeTriggers","#updateLegacyTriggers","#setupLegacyTriggers","#setupModalLightDismiss","#toggleFocus","#parseInterestDelay","#interestTimeout","#observers","#pointerdownWithinModal","#legacyHostTrigger","#previousLegacyTrigger"],"sources":["../../../src/internal/controllers/type-native-popover.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { clickOutsideElementBounds, generateId, getAttributeListChanges } from '../utils/dom.js';\nimport { attachInternals } from '../utils/a11y.js';\nimport { focusElement } from '../utils/focus.js';\nimport { getHostAnchor, getHostTrigger, hasOpenPopover } from './type-native-popover.utils.js';\nimport type { PopoverType } from '../types/index.js';\nimport type { InterestEvent } from './type-interest.controller.js';\n\nexport interface NativePopover extends ReactiveElement {\n anchor?: HTMLElement | string;\n closeTimeout?: number;\n popoverType?: PopoverType;\n modal?: boolean;\n popoverDismissible?: boolean;\n _activeTrigger?: HTMLElement;\n _internals?: ElementInternals;\n\n /** @deprecated */\n trigger?: HTMLElement | string;\n /** @deprecated */\n openDelay?: number;\n /** @deprecated */\n behaviorTrigger?: boolean;\n}\n\n/**\n * https://open-ui.org/components/popup.research.explainer\n */\nexport class TypeNativePopoverController<T extends NativePopover> implements ReactiveController {\n get #nativeTriggers(): HTMLElement[] {\n const root = this.host.getRootNode() as HTMLElement;\n const popoverTargetTriggers = Array.from(\n root.querySelectorAll(`[popovertarget=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const commandForTriggers = Array.from(\n root.querySelectorAll(`[commandfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n const interestForTriggers = Array.from(\n root.querySelectorAll(`[interestfor=\"${CSS.escape ? CSS.escape(this.host.id) : this.host.id}\"]`)\n ) as HTMLElement[];\n\n return [...popoverTargetTriggers, ...commandForTriggers, ...interestForTriggers];\n }\n\n constructor(private host: T) {\n this.host.addController(this);\n\n const showPopover = this.host.showPopover;\n this.host.showPopover = (options?: ShowPopoverOptions) => {\n if (this.host.isConnected) {\n // provide legacy fallback for source anchor or trigger if not provided, this can happen if the popover is dynamically created in the DOM without the use of the standard popover api or legacy trigger based api\n let source: HTMLElement | Element | null = options?.source ?? null;\n if (!source) {\n if (this.host.anchor) {\n source = getHostAnchor(this.host);\n } else if (this.host.trigger) {\n source = getHostTrigger(this.host, this.host.trigger);\n } else {\n source = globalThis.document.activeElement;\n }\n }\n\n showPopover.call(this.host, { source: source as HTMLElement });\n }\n };\n }\n\n // eslint-disable-next-line max-lines-per-function\n async hostConnected() {\n attachInternals(this.host);\n this.host.popover = this.host.popoverType ?? null;\n await this.host.updateComplete;\n this.host.setAttribute('nve-popover', '');\n this.#updateLegacyTriggers();\n this.#setupLegacyTriggers(); // eslint-disable-line @typescript-eslint/no-floating-promises\n this.#setupModalLightDismiss();\n this.host.inert = this.host.matches(':not(:popover-open)') && !!this.#nativeTriggers.length;\n\n this.host.addEventListener('beforetoggle', e => {\n if (e.newState === 'open') {\n this.host._internals!.states.add('transition-start');\n }\n });\n\n this.host.addEventListener('toggle', (e: ToggleEvent) => {\n if (this.host.behaviorTrigger) {\n this.host.hidden = e.newState === 'closed';\n }\n\n if (e.newState === 'open' && this.host.closeTimeout) {\n setTimeout(() => this.host.hidePopover(), this.host.closeTimeout);\n }\n\n this.host.inert = this.host.matches(':not(:popover-open)');\n\n if (this.host.modal) {\n this.#toggleFocus(e.newState === 'open', e.target as HTMLElement);\n }\n\n this.host.dispatchEvent(\n new CustomEvent(e.newState === 'open' && e.oldState !== 'open' ? 'open' : 'close', {\n bubbles: true,\n composed: true,\n detail: { trigger: e.source }\n })\n );\n });\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API#creating_declarative_popovers\n this.host.addEventListener('command', ((e: CommandEvent) => {\n if (e.command === 'toggle-popover') {\n this.host.togglePopover({ source: e.source as HTMLElement });\n }\n\n if (e.command === 'hide-popover') {\n this.host.hidePopover();\n }\n\n if (e.command === 'show-popover') {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }) as EventListener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Popover_API/Using_interest_invokers\n this.host.addEventListener('interest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n const interestDelayStart = this.host.openDelay ?? this.#parseInterestDelay();\n if (interestDelayStart) {\n this.#interestTimeout = setTimeout(() => {\n if (this.host.isConnected) {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }, interestDelayStart);\n } else {\n this.host.showPopover({ source: e.source as HTMLElement });\n }\n }\n }) as EventListener);\n\n this.host.addEventListener('loseinterest', ((e: InterestEvent) => {\n const isCustomElement = e.source?.localName.includes('-');\n if (isCustomElement) {\n this.host.hidePopover();\n }\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }) as EventListener);\n }\n\n #interestTimeout: ReturnType<typeof setTimeout> | null = null;\n #observers: MutationObserver[] = [];\n #previousLegacyTrigger: HTMLButtonElement | null = null;\n\n async hostUpdated() {\n this.host.popover = this.host.popoverType ?? null;\n this.#updateLegacyTriggers();\n }\n\n hostDisconnected() {\n this.#observers.forEach(observer => observer.disconnect());\n\n if (this.#interestTimeout) {\n clearTimeout(this.#interestTimeout);\n this.#interestTimeout = null;\n }\n }\n\n #parseInterestDelay(): number {\n const style = getComputedStyle(this.host);\n const raw = (style as unknown as { interestDelayStart: string }).interestDelayStart;\n if (!raw) {\n return 0;\n }\n const value = parseFloat(raw);\n return raw.endsWith('ms') ? value : value * 1000;\n }\n\n #pointerdownWithinModal = false;\n\n #setupModalLightDismiss() {\n this.host.addEventListener('pointerdown', e => {\n if (this.host.modal && this.host.matches(':popover-open')) {\n this.#pointerdownWithinModal = clickOutsideElementBounds(e, this.host);\n }\n });\n\n this.host.addEventListener('pointerup', e => {\n if (\n this.#pointerdownWithinModal &&\n this.host.popoverDismissible &&\n this.host.modal &&\n this.host.matches(':popover-open') &&\n !hasOpenPopover(this.host) &&\n clickOutsideElementBounds(e, this.host)\n ) {\n this.host.hidePopover();\n }\n });\n }\n\n get #legacyHostTrigger(): HTMLElement | null {\n return this.host.trigger ? (getHostTrigger(this.host, this.host.trigger) as HTMLButtonElement) : null;\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n async #setupLegacyTriggers() {\n await new Promise(r => requestAnimationFrame(r));\n\n // setup hidden updates for legacy triggers\n this.#observers.push(\n getAttributeListChanges(this.host, ['hidden'], () => {\n if (this.host.isConnected && !this.host.hidden && !this.host.matches(':popover-open')) {\n this.host.showPopover();\n }\n\n if (this.host.isConnected && this.host.hidden && this.host.matches(':popover-open')) {\n this.host.hidePopover();\n }\n })\n );\n\n // determine if popover is open by default\n if (\n this.host.isConnected &&\n !this.#nativeTriggers.length &&\n !this.host.hidden &&\n !this.host.matches(':popover-open')\n ) {\n this.host.popover = 'manual';\n this.host.showPopover();\n }\n }\n\n /**\n * @deprecated Legacy behavior that allows popovers to show as open by default when using the legacy trigger based api\n */\n #updateLegacyTriggers() {\n const trigger = this.#legacyHostTrigger as HTMLButtonElement;\n\n // Clean up previous trigger if it changed\n if (this.#previousLegacyTrigger && this.#previousLegacyTrigger !== trigger) {\n this.#previousLegacyTrigger.popoverTargetElement = null;\n this.#previousLegacyTrigger.removeAttribute('popovertarget');\n }\n\n // if not a hint type setup native popovertarget\n if (trigger) {\n if (this.host.popoverType === 'hint') {\n trigger.addEventListener('mouseenter', () => this.host.showPopover({ source: trigger as HTMLElement }));\n trigger.addEventListener('mouseleave', () => this.host.hidePopover());\n trigger.addEventListener('focusout', () => this.host.hidePopover());\n } else {\n this.host.id = this.host.id ? this.host.id : generateId();\n trigger.popoverTargetElement = this.host;\n trigger.setAttribute('popovertarget', this.host.id);\n }\n this.#previousLegacyTrigger = trigger;\n }\n }\n\n #toggleFocus(open: boolean, target: HTMLElement) {\n if (open) {\n // only focus popover if not the active element and not containing the active element already\n if ((this.host.getRootNode() as Document).activeElement !== this.host && !this.host.shadowRoot!.activeElement) {\n focusElement(this.host);\n }\n } else {\n focusElement(target);\n }\n }\n}\n"],"mappings":";;;;;AA+BA,IAAa,IAAb,MAAgG;CAC9F,IAAIA,KAAiC;EACnC,IAAM,IAAO,KAAK,KAAK,aAAa,EAC9B,IAAwB,MAAM,KAClC,EAAK,iBAAiB,mBAAmB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CACnG,EAEK,IAAqB,MAAM,KAC/B,EAAK,iBAAiB,gBAAgB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CAChG,EAEK,IAAsB,MAAM,KAChC,EAAK,iBAAiB,iBAAiB,IAAI,SAAS,IAAI,OAAO,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG,IAAI,CACjG;EAED,OAAO;GAAC,GAAG;GAAuB,GAAG;GAAoB,GAAG;GAAoB;;CAGlF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;EAE7B,IAAM,IAAc,KAAK,KAAK;EAC9B,KAAK,KAAK,eAAe,MAAiC;GACxD,IAAI,KAAK,KAAK,aAAa;IAEzB,IAAI,IAAuC,GAAS,UAAU;IAW9D,AAVA,AAMI,MALE,KAAK,KAAK,SACH,EAAc,KAAK,KAAK,GACxB,KAAK,KAAK,UACV,EAAe,KAAK,MAAM,KAAK,KAAK,QAAQ,GAE5C,WAAW,SAAS,eAIjC,EAAY,KAAK,KAAK,MAAM,EAAU,WAAuB,CAAC;;;;CAMpE,MAAM,gBAAgB;EAwEpB,AAvEA,EAAgB,KAAK,KAAK,EAC1B,KAAK,KAAK,UAAU,KAAK,KAAK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AAY,iBAC9F,EAAa,KAAK,KAAK,GAGzB,EAAa,EAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-native-popover.utils.js","names":[],"sources":["../../../src/internal/controllers/type-native-popover.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LogService } from '../services/log.service.js';\nimport { getIdMatchNotFoundWarning } from '../utils/audit-logs.js';\nimport { generateId, getFlattenedDOMTree, getAnchorNames, appendAnchorName } from '../utils/dom.js';\n\nexport function associateAnchor(host: HTMLElement, anchor: HTMLElement) {\n const anchorNames = getAnchorNames(anchor);\n let anchorId = anchorNames.find(name => name.startsWith('--_'));\n if (!anchorId) {\n anchorId = `--${anchor.id && !anchor.id.includes(':') ? `_${anchor.id}` : generateId()}`;\n appendAnchorName(anchor, anchorId);\n }\n host.style.positionAnchor = anchorId;\n}\n\nexport function getHostTrigger(element: HTMLElement, trigger: HTMLElement | string) {\n if (typeof trigger === 'string') {\n return (\n (getFlattenedDOMTree(element.parentNode as HTMLElement)\n .filter(el => el?.id !== '')\n .find(el => el.id === trigger) as HTMLButtonElement) ?? globalThis.document.body\n );\n } else {\n return trigger as HTMLButtonElement;\n }\n}\n\nexport function getHostAnchor(host: HTMLElement & { anchor?: HTMLElement | string; _activeTrigger?: HTMLElement }) {\n const anchor = host.anchor ?? host._activeTrigger;\n\n if (typeof anchor === 'string' && anchor?.length) {\n const match = getFlattenedDOMTree(host.parentNode as HTMLElement).find(el => el.id === anchor);\n\n if (!match) {\n LogService.warn(getIdMatchNotFoundWarning(anchor));\n }\n\n return match ?? globalThis.document.body;\n } else if (anchor && anchor !== globalThis.document.body) {\n return anchor as HTMLElement;\n } else {\n return globalThis.document.body;\n }\n}\n\nexport function hasOpenPopover(host: HTMLElement) {\n return !!getFlattenedDOMTree(host).filter(e => e.popover && e.matches(':popover-open')).length;\n}\n"],"mappings":";;;;AAiBA,SAAgB,EAAe,GAAsB,GAA+B;
|
|
1
|
+
{"version":3,"file":"type-native-popover.utils.js","names":[],"sources":["../../../src/internal/controllers/type-native-popover.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LogService } from '../services/log.service.js';\nimport { getIdMatchNotFoundWarning } from '../utils/audit-logs.js';\nimport { generateId, getFlattenedDOMTree, getAnchorNames, appendAnchorName } from '../utils/dom.js';\n\nexport function associateAnchor(host: HTMLElement, anchor: HTMLElement) {\n const anchorNames = getAnchorNames(anchor);\n let anchorId = anchorNames.find(name => name.startsWith('--_'));\n if (!anchorId) {\n anchorId = `--${anchor.id && !anchor.id.includes(':') ? `_${anchor.id}` : generateId()}`;\n appendAnchorName(anchor, anchorId);\n }\n host.style.positionAnchor = anchorId;\n}\n\nexport function getHostTrigger(element: HTMLElement, trigger: HTMLElement | string) {\n if (typeof trigger === 'string') {\n return (\n (getFlattenedDOMTree(element.parentNode as HTMLElement)\n .filter(el => el?.id !== '')\n .find(el => el.id === trigger) as HTMLButtonElement) ?? globalThis.document.body\n );\n } else {\n return trigger as HTMLButtonElement;\n }\n}\n\nexport function getHostAnchor(host: HTMLElement & { anchor?: HTMLElement | string; _activeTrigger?: HTMLElement }) {\n const anchor = host.anchor ?? host._activeTrigger;\n\n if (typeof anchor === 'string' && anchor?.length) {\n const match = getFlattenedDOMTree(host.parentNode as HTMLElement).find(el => el.id === anchor);\n\n if (!match) {\n LogService.warn(getIdMatchNotFoundWarning(anchor));\n }\n\n return match ?? globalThis.document.body;\n } else if (anchor && anchor !== globalThis.document.body) {\n return anchor as HTMLElement;\n } else {\n return globalThis.document.body;\n }\n}\n\nexport function hasOpenPopover(host: HTMLElement) {\n return !!getFlattenedDOMTree(host).filter(e => e.popover && e.matches(':popover-open')).length;\n}\n"],"mappings":";;;;AAiBA,SAAgB,EAAe,GAAsB,GAA+B;CAQhF,OAPE,OAAO,KAAY,WAElB,EAAoB,EAAQ,WAA0B,CACpD,QAAO,MAAM,GAAI,OAAO,GAAG,CAC3B,MAAK,MAAM,EAAG,OAAO,EAAQ,IAA0B,WAAW,SAAS,OAGzE;;AAIX,SAAgB,EAAc,GAAqF;CACjH,IAAM,IAAS,EAAK,UAAU,EAAK;CAEnC,IAAI,OAAO,KAAW,YAAY,GAAQ,QAAQ;EAChD,IAAM,IAAQ,EAAoB,EAAK,WAA0B,CAAC,MAAK,MAAM,EAAG,OAAO,EAAO;EAM9F,OAJK,KACH,EAAW,KAAK,EAA0B,EAAO,CAAC,EAG7C,KAAS,WAAW,SAAS;QAC/B,IAAI,KAAU,MAAW,WAAW,SAAS,MAClD,OAAO;MAEP,OAAO,WAAW,SAAS;;AAI/B,SAAgB,EAAe,GAAmB;CAChD,OAAO,CAAC,CAAC,EAAoB,EAAK,CAAC,QAAO,MAAK,EAAE,WAAW,EAAE,QAAQ,gBAAgB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-selectable.controller.js","names":["#commandTriggered"],"sources":["../../../src/internal/controllers/type-selectable.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { attachInternals } from '../utils/a11y.js';\n\nexport type TypeSelectable = ReactiveElement & {\n selected?: boolean;\n behaviorSelect?: boolean;\n selectable?: 'single' | 'multi';\n _internals?: ElementInternals;\n};\n\n/**\n * Controller for enabling selectable behavior for elements.\n * @event select - Dispatched when the selectable element selects.\n * @property selected - selected state\n * @property behaviorSelect - determines if stateful auto behavior should enable\n */\nexport class TypeSelectableController<T extends TypeSelectable> implements ReactiveController {\n #commandTriggered = false;\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n\n this.host.addEventListener('command', ((e: CommandEvent) => {\n this.#commandTriggered = true;\n if (e.command === '--toggle-select') {\n this.toggle();\n }\n\n if (e.command === '--select') {\n this.select();\n }\n\n if (e.command === '--deselect') {\n this.host.selected = false;\n }\n this.#commandTriggered = false;\n }) as EventListener);\n }\n\n hostUpdated() {\n this.host.selectable === 'single'\n ? this.host._internals!.states.add('selectable-single')\n : this.host._internals!.states.delete('selectable-single');\n this.host.selectable === 'multi'\n ? this.host._internals!.states.add('selectable-multi')\n : this.host._internals!.states.delete('selectable-multi');\n }\n\n select() {\n if (this.host.behaviorSelect || this.#commandTriggered) {\n this.host.selected = true;\n }\n\n this.host.dispatchEvent(new CustomEvent('select', { bubbles: true, composed: true, detail: this.host }));\n }\n\n deselect() {\n if (this.host.behaviorSelect || this.#commandTriggered) {\n this.host.selected = false;\n }\n\n this.host.dispatchEvent(new CustomEvent('select', { bubbles: true, composed: true, detail: this.host }));\n }\n\n toggle() {\n if (this.host.selected) {\n this.deselect();\n } else {\n this.select();\n }\n }\n}\n"],"mappings":";;AAmBA,IAAa,IAAb,MAA8F;CAC5F,KAAoB;CACpB,YAAY,GAAiB;
|
|
1
|
+
{"version":3,"file":"type-selectable.controller.js","names":["#commandTriggered"],"sources":["../../../src/internal/controllers/type-selectable.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport { attachInternals } from '../utils/a11y.js';\n\nexport type TypeSelectable = ReactiveElement & {\n selected?: boolean;\n behaviorSelect?: boolean;\n selectable?: 'single' | 'multi';\n _internals?: ElementInternals;\n};\n\n/**\n * Controller for enabling selectable behavior for elements.\n * @event select - Dispatched when the selectable element selects.\n * @property selected - selected state\n * @property behaviorSelect - determines if stateful auto behavior should enable\n */\nexport class TypeSelectableController<T extends TypeSelectable> implements ReactiveController {\n #commandTriggered = false;\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n\n this.host.addEventListener('command', ((e: CommandEvent) => {\n this.#commandTriggered = true;\n if (e.command === '--toggle-select') {\n this.toggle();\n }\n\n if (e.command === '--select') {\n this.select();\n }\n\n if (e.command === '--deselect') {\n this.host.selected = false;\n }\n this.#commandTriggered = false;\n }) as EventListener);\n }\n\n hostUpdated() {\n this.host.selectable === 'single'\n ? this.host._internals!.states.add('selectable-single')\n : this.host._internals!.states.delete('selectable-single');\n this.host.selectable === 'multi'\n ? this.host._internals!.states.add('selectable-multi')\n : this.host._internals!.states.delete('selectable-multi');\n }\n\n select() {\n if (this.host.behaviorSelect || this.#commandTriggered) {\n this.host.selected = true;\n }\n\n this.host.dispatchEvent(new CustomEvent('select', { bubbles: true, composed: true, detail: this.host }));\n }\n\n deselect() {\n if (this.host.behaviorSelect || this.#commandTriggered) {\n this.host.selected = false;\n }\n\n this.host.dispatchEvent(new CustomEvent('select', { bubbles: true, composed: true, detail: this.host }));\n }\n\n toggle() {\n if (this.host.selected) {\n this.deselect();\n } else {\n this.select();\n }\n }\n}\n"],"mappings":";;AAmBA,IAAa,IAAb,MAA8F;CAC5F,KAAoB;CACpB,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EAGd,AAFA,EAAgB,KAAK,KAAK,EAE1B,KAAK,KAAK,iBAAiB,aAAa,MAAoB;GAa1D,AAZA,KAAKA,KAAoB,IACrB,EAAE,YAAY,qBAChB,KAAK,QAAQ,EAGX,EAAE,YAAY,cAChB,KAAK,QAAQ,EAGX,EAAE,YAAY,iBAChB,KAAK,KAAK,WAAW,KAEvB,KAAKA,KAAoB;KACP;;CAGtB,cAAc;EAIZ,AAHA,KAAK,KAAK,eAAe,WACrB,KAAK,KAAK,WAAY,OAAO,IAAI,oBAAoB,GACrD,KAAK,KAAK,WAAY,OAAO,OAAO,oBAAoB,EAC5D,KAAK,KAAK,eAAe,UACrB,KAAK,KAAK,WAAY,OAAO,IAAI,mBAAmB,GACpD,KAAK,KAAK,WAAY,OAAO,OAAO,mBAAmB;;CAG7D,SAAS;EAKP,CAJI,KAAK,KAAK,kBAAkB,KAAKA,QACnC,KAAK,KAAK,WAAW,KAGvB,KAAK,KAAK,cAAc,IAAI,YAAY,UAAU;GAAE,SAAS;GAAM,UAAU;GAAM,QAAQ,KAAK;GAAM,CAAC,CAAC;;CAG1G,WAAW;EAKT,CAJI,KAAK,KAAK,kBAAkB,KAAKA,QACnC,KAAK,KAAK,WAAW,KAGvB,KAAK,KAAK,cAAc,IAAI,YAAY,UAAU;GAAE,SAAS;GAAM,UAAU;GAAM,QAAQ,KAAK;GAAM,CAAC,CAAC;;CAG1G,SAAS;EACP,AAAI,KAAK,KAAK,WACZ,KAAK,UAAU,GAEf,KAAK,QAAQ"}
|
|
@@ -8,7 +8,7 @@ function i(e = { log: !0 }) {
|
|
|
8
8
|
}
|
|
9
9
|
var a = class {
|
|
10
10
|
constructor(i, a) {
|
|
11
|
-
if (this.host = i, this.options = a, this.didSSR = !!this.host.shadowRoot, this.host.addController(this), this.didSSR) {
|
|
11
|
+
if (this.host = i, this.options = a, this.didSSR = !!this.host.shadowRoot, this.#e = !0, this.host.addController(this), this.didSSR) {
|
|
12
12
|
let a = this.options, o = i.update;
|
|
13
13
|
Object.defineProperty(i, "update", { value: function() {
|
|
14
14
|
try {
|
|
@@ -21,7 +21,7 @@ var a = class {
|
|
|
21
21
|
} });
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
#e
|
|
24
|
+
#e;
|
|
25
25
|
hostUpdated() {
|
|
26
26
|
this.didSSR && this.#e && (this.#e = !1, this.host.shadowRoot?.querySelectorAll("slot").forEach((e) => {
|
|
27
27
|
e.dispatchEvent(new Event("slotchange", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-ssr.controller.js","names":["#firstUpdate"],"sources":["../../../src/internal/controllers/type-ssr.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement, RenderOptions, TemplateResult } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { render } from 'lit';\nimport { LogService } from '../services/log.service.js';\nimport { getSSRMismatchWarning } from '../utils/audit-logs.js';\nimport { getEnv } from '../services/global.utils.js';\n\ntype UnprotectedLitElement = ReactiveElement & {\n update: () => void;\n render: () => TemplateResult;\n renderOptions: RenderOptions;\n _internals?: ElementInternals;\n};\n\n/**\n * Catch and manage hydration related fallbacks for SSR\n */\nexport function typeSSR<T extends UnprotectedLitElement>(options: { log?: boolean } = { log: true }): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!(\n (instance: T & { _internals: ElementInternals }) => new TypeSSRController(instance, options)\n );\n}\n\nexport class TypeSSRController<T extends ReactiveElement> implements ReactiveController {\n // https://www.konnorrogers.com/posts/2024/running-lit-ssr-in-web-awesome#hydration-errors\n didSSR = Boolean(this.host.shadowRoot);\n\n constructor(\n private host: T & UnprotectedLitElement,\n private options: { log?: boolean }\n ) {\n this.host.addController(this);\n\n // https://github.com/lit/lit/issues/1434#issuecomment-1598332000\n if (this.didSSR) {\n const controllerOptions = this.options;\n const updateOriginal = host.update;\n Object.defineProperty(host, 'update', {\n value: function () {\n try {\n updateOriginal.call(host);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (_) {\n const renderRoot = host.renderRoot as HTMLElement;\n renderRoot.innerHTML = renderRoot.innerHTML.split('<!--lit-part ')[0]!;\n render(host.render(), renderRoot, host.renderOptions);\n\n if (getEnv() !== 'production' && controllerOptions.log) {\n LogService.warn(getSSRMismatchWarning(host.localName));\n }\n }\n return updateOriginal;\n }\n });\n }\n }\n\n #firstUpdate = true;\n hostUpdated() {\n // https://github.com/lit/lit/discussions/4697\n // https://github.com/w3c/csswg-drafts/issues/6867#issuecomment-1599444407\n if (this.didSSR && this.#firstUpdate) {\n this.#firstUpdate = false;\n this.host.shadowRoot?.querySelectorAll('slot').forEach(slotElement => {\n slotElement.dispatchEvent(new Event('slotchange', { bubbles: true, composed: false, cancelable: false }));\n });\n\n // if SSR reflect role attribute to host\n if (this.host._internals?.role) {\n this.host.setAttribute('role', this.host._internals.role);\n }\n }\n }\n}\n"],"mappings":";;;;;AAoBA,SAAgB,EAAyC,IAA6B,EAAE,KAAK,IAAM,EAAkB;
|
|
1
|
+
{"version":3,"file":"type-ssr.controller.js","names":["#firstUpdate"],"sources":["../../../src/internal/controllers/type-ssr.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement, RenderOptions, TemplateResult } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { render } from 'lit';\nimport { LogService } from '../services/log.service.js';\nimport { getSSRMismatchWarning } from '../utils/audit-logs.js';\nimport { getEnv } from '../services/global.utils.js';\n\ntype UnprotectedLitElement = ReactiveElement & {\n update: () => void;\n render: () => TemplateResult;\n renderOptions: RenderOptions;\n _internals?: ElementInternals;\n};\n\n/**\n * Catch and manage hydration related fallbacks for SSR\n */\nexport function typeSSR<T extends UnprotectedLitElement>(options: { log?: boolean } = { log: true }): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!(\n (instance: T & { _internals: ElementInternals }) => new TypeSSRController(instance, options)\n );\n}\n\nexport class TypeSSRController<T extends ReactiveElement> implements ReactiveController {\n // https://www.konnorrogers.com/posts/2024/running-lit-ssr-in-web-awesome#hydration-errors\n didSSR = Boolean(this.host.shadowRoot);\n\n constructor(\n private host: T & UnprotectedLitElement,\n private options: { log?: boolean }\n ) {\n this.host.addController(this);\n\n // https://github.com/lit/lit/issues/1434#issuecomment-1598332000\n if (this.didSSR) {\n const controllerOptions = this.options;\n const updateOriginal = host.update;\n Object.defineProperty(host, 'update', {\n value: function () {\n try {\n updateOriginal.call(host);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (_) {\n const renderRoot = host.renderRoot as HTMLElement;\n renderRoot.innerHTML = renderRoot.innerHTML.split('<!--lit-part ')[0]!;\n render(host.render(), renderRoot, host.renderOptions);\n\n if (getEnv() !== 'production' && controllerOptions.log) {\n LogService.warn(getSSRMismatchWarning(host.localName));\n }\n }\n return updateOriginal;\n }\n });\n }\n }\n\n #firstUpdate = true;\n hostUpdated() {\n // https://github.com/lit/lit/discussions/4697\n // https://github.com/w3c/csswg-drafts/issues/6867#issuecomment-1599444407\n if (this.didSSR && this.#firstUpdate) {\n this.#firstUpdate = false;\n this.host.shadowRoot?.querySelectorAll('slot').forEach(slotElement => {\n slotElement.dispatchEvent(new Event('slotchange', { bubbles: true, composed: false, cancelable: false }));\n });\n\n // if SSR reflect role attribute to host\n if (this.host._internals?.role) {\n this.host.setAttribute('role', this.host._internals.role);\n }\n }\n }\n}\n"],"mappings":";;;;;AAoBA,SAAgB,EAAyC,IAA6B,EAAE,KAAK,IAAM,EAAkB;CACnH,QAAQ,MACN,EAAO,gBACJ,MAAmD,IAAI,EAAkB,GAAU,EAAQ,CAC7F;;AAGL,IAAa,IAAb,MAAwF;CAItF,YACE,GACA,GACA;EAIA,IANQ,KAAA,OAAA,GACA,KAAA,UAAA,iBAJD,EAAQ,KAAK,KAAK,sBAgCZ,IA1Bb,KAAK,KAAK,cAAc,KAAK,EAGzB,KAAK,QAAQ;GACf,IAAM,IAAoB,KAAK,SACzB,IAAiB,EAAK;GAC5B,OAAO,eAAe,GAAM,UAAU,EACpC,OAAO,WAAY;IACjB,IAAI;KACF,EAAe,KAAK,EAAK;YAEf;KACV,IAAM,IAAa,EAAK;KAIxB,AAHA,EAAW,YAAY,EAAW,UAAU,MAAM,gBAAgB,CAAC,IACnE,EAAO,EAAK,QAAQ,EAAE,GAAY,EAAK,cAAc,EAEjD,GAAQ,KAAK,gBAAgB,EAAkB,OACjD,EAAW,KAAK,EAAsB,EAAK,UAAU,CAAC;;IAG1D,OAAO;MAEV,CAAC;;;CAIN;CACA,cAAc;EAGZ,AAAI,KAAK,UAAU,KAAKA,OACtB,KAAKA,KAAe,IACpB,KAAK,KAAK,YAAY,iBAAiB,OAAO,CAAC,SAAQ,MAAe;GACpE,EAAY,cAAc,IAAI,MAAM,cAAc;IAAE,SAAS;IAAM,UAAU;IAAO,YAAY;IAAO,CAAC,CAAC;IACzG,EAGE,KAAK,KAAK,YAAY,QACxB,KAAK,KAAK,aAAa,QAAQ,KAAK,KAAK,WAAW,KAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-submit.controller.js","names":["#setButtonType","#setupNativeButtonBehavior","#removeNativeButtonBehavior","#triggerNativeButtonBehavior","#emulateKeyBoardEventBehavior","#requestSubmit","#createSubmitter","#submitter"],"sources":["../../../src/internal/controllers/type-submit.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { stopEvent } from '../utils/events.js';\nimport { onKeys } from '../utils/keynav.js';\n\n/**\n * Adds Form submit support for interactive custom elements.\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event\n */\nexport function typeSubmit<T extends Submit>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeSubmitController(instance));\n}\n\nexport type Submit = ReactiveElement &\n HTMLElement & {\n name: string;\n value: string;\n disabled: boolean;\n type: 'button' | 'submit' | 'reset';\n readonly: boolean;\n form?: HTMLFormElement | null;\n _internals: ElementInternals;\n };\n\nexport class TypeSubmitController<T extends Submit> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostUpdated() {\n await this.host.updateComplete;\n this.#setButtonType();\n this.#setupNativeButtonBehavior();\n }\n\n hostDisconnected() {\n this.#removeNativeButtonBehavior();\n }\n\n #setButtonType() {\n if (!this.host.type && !this.host.hasAttribute('type') && this.host.closest('form')) {\n this.host.type = 'submit';\n }\n }\n\n #setupNativeButtonBehavior() {\n this.#removeNativeButtonBehavior();\n if (!this.host.readonly && !this.host.disabled) {\n this.host.addEventListener('click', this.#triggerNativeButtonBehavior);\n this.host.addEventListener('keyup', this.#emulateKeyBoardEventBehavior);\n }\n }\n\n #removeNativeButtonBehavior() {\n this.host.removeEventListener('click', this.#triggerNativeButtonBehavior);\n this.host.removeEventListener('keyup', this.#emulateKeyBoardEventBehavior);\n }\n\n // when submitting forms with Enter key, default submit button receives click event from the form\n #emulateKeyBoardEventBehavior = (event: KeyboardEvent) => {\n onKeys(['Enter', 'Space'], event, () => this.host.click());\n };\n\n #triggerNativeButtonBehavior = (event: Event) => {\n if (this.host.disabled) {\n stopEvent(event);\n return;\n }\n\n if (this.host.type === 'submit' && this.host.form) {\n this.#requestSubmit();\n } else if (this.host.type === 'reset') {\n this.host.form?.reset();\n }\n };\n\n #requestSubmit() {\n this.#createSubmitter();\n this.host.form!.addEventListener(\n 'submit',\n () => {\n setTimeout(() => this.#submitter.remove(), 0);\n },\n { once: true }\n );\n this.host.form!.appendChild(this.#submitter);\n this.host.form!.requestSubmit(this.#submitter);\n }\n\n #submitter: HTMLButtonElement;\n // https://github.com/WICG/webcomponents/issues/814\n #createSubmitter() {\n if (!this.#submitter) {\n this.#submitter = globalThis.document.createElement('button');\n this.#submitter.type = 'submit';\n this.#submitter.name = this.host.name ?? '';\n this.#submitter.value = this.host.value ?? '';\n this.#submitter.style.display = 'none';\n }\n }\n}\n"],"mappings":";;;AAYA,SAAgB,IAA+C;
|
|
1
|
+
{"version":3,"file":"type-submit.controller.js","names":["#setButtonType","#setupNativeButtonBehavior","#removeNativeButtonBehavior","#triggerNativeButtonBehavior","#emulateKeyBoardEventBehavior","#requestSubmit","#createSubmitter","#submitter"],"sources":["../../../src/internal/controllers/type-submit.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { stopEvent } from '../utils/events.js';\nimport { onKeys } from '../utils/keynav.js';\n\n/**\n * Adds Form submit support for interactive custom elements.\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event\n */\nexport function typeSubmit<T extends Submit>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeSubmitController(instance));\n}\n\nexport type Submit = ReactiveElement &\n HTMLElement & {\n name: string;\n value: string;\n disabled: boolean;\n type: 'button' | 'submit' | 'reset';\n readonly: boolean;\n form?: HTMLFormElement | null;\n _internals: ElementInternals;\n };\n\nexport class TypeSubmitController<T extends Submit> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostUpdated() {\n await this.host.updateComplete;\n this.#setButtonType();\n this.#setupNativeButtonBehavior();\n }\n\n hostDisconnected() {\n this.#removeNativeButtonBehavior();\n }\n\n #setButtonType() {\n if (!this.host.type && !this.host.hasAttribute('type') && this.host.closest('form')) {\n this.host.type = 'submit';\n }\n }\n\n #setupNativeButtonBehavior() {\n this.#removeNativeButtonBehavior();\n if (!this.host.readonly && !this.host.disabled) {\n this.host.addEventListener('click', this.#triggerNativeButtonBehavior);\n this.host.addEventListener('keyup', this.#emulateKeyBoardEventBehavior);\n }\n }\n\n #removeNativeButtonBehavior() {\n this.host.removeEventListener('click', this.#triggerNativeButtonBehavior);\n this.host.removeEventListener('keyup', this.#emulateKeyBoardEventBehavior);\n }\n\n // when submitting forms with Enter key, default submit button receives click event from the form\n #emulateKeyBoardEventBehavior = (event: KeyboardEvent) => {\n onKeys(['Enter', 'Space'], event, () => this.host.click());\n };\n\n #triggerNativeButtonBehavior = (event: Event) => {\n if (this.host.disabled) {\n stopEvent(event);\n return;\n }\n\n if (this.host.type === 'submit' && this.host.form) {\n this.#requestSubmit();\n } else if (this.host.type === 'reset') {\n this.host.form?.reset();\n }\n };\n\n #requestSubmit() {\n this.#createSubmitter();\n this.host.form!.addEventListener(\n 'submit',\n () => {\n setTimeout(() => this.#submitter.remove(), 0);\n },\n { once: true }\n );\n this.host.form!.appendChild(this.#submitter);\n this.host.form!.requestSubmit(this.#submitter);\n }\n\n #submitter: HTMLButtonElement;\n // https://github.com/WICG/webcomponents/issues/814\n #createSubmitter() {\n if (!this.#submitter) {\n this.#submitter = globalThis.document.createElement('button');\n this.#submitter.type = 'submit';\n this.#submitter.name = this.host.name ?? '';\n this.#submitter.value = this.host.value ?? '';\n this.#submitter.style.display = 'none';\n }\n }\n}\n"],"mappings":";;;AAYA,SAAgB,IAA+C;CAC7D,QAAQ,MAAkC,EAAO,gBAAiB,MAAgB,IAAI,EAAqB,EAAS,CAAC;;AAcvH,IAAa,IAAb,MAAkF;CAChF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,MAAM,cAAc;EAGlB,AAFA,MAAM,KAAK,KAAK,gBAChB,KAAKA,IAAgB,EACrB,KAAKC,IAA4B;;CAGnC,mBAAmB;EACjB,KAAKC,IAA6B;;CAGpC,KAAiB;EACf,AAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,KAAK,aAAa,OAAO,IAAI,KAAK,KAAK,QAAQ,OAAO,KACjF,KAAK,KAAK,OAAO;;CAIrB,KAA6B;EAE3B,AADA,KAAKA,IAA6B,EAC9B,CAAC,KAAK,KAAK,YAAY,CAAC,KAAK,KAAK,aACpC,KAAK,KAAK,iBAAiB,SAAS,KAAKC,GAA6B,EACtE,KAAK,KAAK,iBAAiB,SAAS,KAAKC,GAA8B;;CAI3E,KAA8B;EAE5B,AADA,KAAK,KAAK,oBAAoB,SAAS,KAAKD,GAA6B,EACzE,KAAK,KAAK,oBAAoB,SAAS,KAAKC,GAA8B;;CAI5E,MAAiC,MAAyB;EACxD,EAAO,CAAC,SAAS,QAAQ,EAAE,SAAa,KAAK,KAAK,OAAO,CAAC;;CAG5D,MAAgC,MAAiB;EAC/C,IAAI,KAAK,KAAK,UAAU;GACtB,EAAU,EAAM;GAChB;;EAGF,AAAI,KAAK,KAAK,SAAS,YAAY,KAAK,KAAK,OAC3C,KAAKC,IAAgB,GACZ,KAAK,KAAK,SAAS,WAC5B,KAAK,KAAK,MAAM,OAAO;;CAI3B,KAAiB;EAUf,AATA,KAAKC,IAAkB,EACvB,KAAK,KAAK,KAAM,iBACd,gBACM;GACJ,iBAAiB,KAAKC,GAAW,QAAQ,EAAE,EAAE;KAE/C,EAAE,MAAM,IAAM,CACf,EACD,KAAK,KAAK,KAAM,YAAY,KAAKA,GAAW,EAC5C,KAAK,KAAK,KAAM,cAAc,KAAKA,GAAW;;CAGhD;CAEA,KAAmB;EACjB,AAAK,KAAKA,OACR,KAAKA,KAAa,WAAW,SAAS,cAAc,SAAS,EAC7D,KAAKA,GAAW,OAAO,UACvB,KAAKA,GAAW,OAAO,KAAK,KAAK,QAAQ,IACzC,KAAKA,GAAW,QAAQ,KAAK,KAAK,SAAS,IAC3C,KAAKA,GAAW,MAAM,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-touch.controller.js","names":["#start","#end","#move","#startPosition","#pointerId","#getCoordinatesFromPointerEvent"],"sources":["../../../src/internal/controllers/type-touch.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveElement, ReactiveController } from 'lit';\nimport type { LegacyDecoratorTarget, OffsetPoint, Point } from '../types/index.js';\nimport { getDifference } from '../utils/objects.js';\n\nexport class NveTouchEvent extends Event {\n x: number;\n y: number;\n offsetX: number;\n offsetY: number;\n\n constructor(event: 'nve-touch-start' | 'nve-touch-move' | 'nve-touch-end', point: Point & OffsetPoint) {\n super(event);\n this.x = point.x;\n this.y = point.y;\n this.offsetX = point.offsetX;\n this.offsetY = point.offsetY;\n }\n}\n\n/**\n * @event nve-touch-start\n * @event nve-touch-move\n * @event nve-touch-end\n */\nexport function typeTouch<T extends ReactiveElement>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeTouchController(instance));\n}\n\nexport class TypeTouchController<T extends ReactiveElement> implements ReactiveController {\n #startPosition: Point;\n #pointerId: number;\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n this.host.addEventListener('pointerdown', this.#start);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('pointerdown', this.#start);\n globalThis.document.removeEventListener('pointerup', this.#end);\n globalThis.document.removeEventListener('pointermove', this.#move);\n }\n\n #start = (e: PointerEvent) => {\n if (e.composedPath().find(el => el === this.host)) {\n this.#startPosition = { x: e.clientX, y: e.clientY };\n this.#pointerId = e.pointerId;\n this.host.setPointerCapture(this.#pointerId);\n globalThis.document.addEventListener('pointerup', this.#end);\n globalThis.document.addEventListener('pointermove', this.#move);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-start', { ...this.#startPosition, offsetX: 0, offsetY: 0 }));\n }\n };\n\n #move = (e: PointerEvent) => {\n requestAnimationFrame(() => {\n const point = this.#getCoordinatesFromPointerEvent(e);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-move', point));\n this.#startPosition = { x: e.clientX, y: e.clientY };\n });\n };\n\n #end = (e: PointerEvent) => {\n if (this.#startPosition) {\n globalThis.document.removeEventListener('pointerup', this.#end, false);\n globalThis.document.removeEventListener('pointermove', this.#move, false);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-end', this.#getCoordinatesFromPointerEvent(e)));\n this.host.releasePointerCapture(this.#pointerId);\n this.#pointerId = null as unknown as number;\n }\n };\n\n #getCoordinatesFromPointerEvent(e: PointerEvent) {\n const value = {\n offsetX: getDifference(this.#startPosition.x, e.clientX),\n offsetY: getDifference(this.#startPosition.y, e.clientY),\n x: e.clientX,\n y: e.clientY\n };\n return value;\n }\n}\n"],"mappings":";;AAOA,IAAa,IAAb,cAAmC,MAAM;CAMvC,YAAY,GAA+D,GAA4B;
|
|
1
|
+
{"version":3,"file":"type-touch.controller.js","names":["#start","#end","#move","#startPosition","#pointerId","#getCoordinatesFromPointerEvent"],"sources":["../../../src/internal/controllers/type-touch.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveElement, ReactiveController } from 'lit';\nimport type { LegacyDecoratorTarget, OffsetPoint, Point } from '../types/index.js';\nimport { getDifference } from '../utils/objects.js';\n\nexport class NveTouchEvent extends Event {\n x: number;\n y: number;\n offsetX: number;\n offsetY: number;\n\n constructor(event: 'nve-touch-start' | 'nve-touch-move' | 'nve-touch-end', point: Point & OffsetPoint) {\n super(event);\n this.x = point.x;\n this.y = point.y;\n this.offsetX = point.offsetX;\n this.offsetY = point.offsetY;\n }\n}\n\n/**\n * @event nve-touch-start\n * @event nve-touch-move\n * @event nve-touch-end\n */\nexport function typeTouch<T extends ReactiveElement>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => target.addInitializer!((instance: T) => new TypeTouchController(instance));\n}\n\nexport class TypeTouchController<T extends ReactiveElement> implements ReactiveController {\n #startPosition: Point;\n #pointerId: number;\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n this.host.addEventListener('pointerdown', this.#start);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('pointerdown', this.#start);\n globalThis.document.removeEventListener('pointerup', this.#end);\n globalThis.document.removeEventListener('pointermove', this.#move);\n }\n\n #start = (e: PointerEvent) => {\n if (e.composedPath().find(el => el === this.host)) {\n this.#startPosition = { x: e.clientX, y: e.clientY };\n this.#pointerId = e.pointerId;\n this.host.setPointerCapture(this.#pointerId);\n globalThis.document.addEventListener('pointerup', this.#end);\n globalThis.document.addEventListener('pointermove', this.#move);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-start', { ...this.#startPosition, offsetX: 0, offsetY: 0 }));\n }\n };\n\n #move = (e: PointerEvent) => {\n requestAnimationFrame(() => {\n const point = this.#getCoordinatesFromPointerEvent(e);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-move', point));\n this.#startPosition = { x: e.clientX, y: e.clientY };\n });\n };\n\n #end = (e: PointerEvent) => {\n if (this.#startPosition) {\n globalThis.document.removeEventListener('pointerup', this.#end, false);\n globalThis.document.removeEventListener('pointermove', this.#move, false);\n this.host.dispatchEvent(new NveTouchEvent('nve-touch-end', this.#getCoordinatesFromPointerEvent(e)));\n this.host.releasePointerCapture(this.#pointerId);\n this.#pointerId = null as unknown as number;\n }\n };\n\n #getCoordinatesFromPointerEvent(e: PointerEvent) {\n const value = {\n offsetX: getDifference(this.#startPosition.x, e.clientX),\n offsetY: getDifference(this.#startPosition.y, e.clientY),\n x: e.clientX,\n y: e.clientY\n };\n return value;\n }\n}\n"],"mappings":";;AAOA,IAAa,IAAb,cAAmC,MAAM;CAMvC,YAAY,GAA+D,GAA4B;EAKrG,AAJA,MAAM,EAAM,EACZ,KAAK,IAAI,EAAM,GACf,KAAK,IAAI,EAAM,GACf,KAAK,UAAU,EAAM,SACrB,KAAK,UAAU,EAAM;;;AASzB,SAAgB,IAAuD;CACrE,QAAQ,MAAkC,EAAO,gBAAiB,MAAgB,IAAI,EAAoB,EAAS,CAAC;;AAGtH,IAAa,IAAb,MAA0F;CACxF;CACA;CAEA,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,KAAK;;CAG/B,gBAAgB;EACd,KAAK,KAAK,iBAAiB,eAAe,KAAKA,GAAO;;CAGx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EA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-attr.js","names":[],"sources":["../../../src/internal/decorators/host-attr.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyDeclaration } from 'lit';\nimport { property } from 'lit/decorators/property.js';\n\n/**\n * Enables declarative way to set host element attributes such as slots.\n * Use when needing to set host attributes but not create a public API property/attr for consumer.\n */\nexport function hostAttr(options: PropertyDeclaration = { type: String, reflect: true }) {\n return property({ type: String, reflect: true, ...options });\n}\n"],"mappings":";;AAUA,SAAgB,EAAS,IAA+B;CAAE,MAAM;CAAQ,SAAS;CAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"host-attr.js","names":[],"sources":["../../../src/internal/decorators/host-attr.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyDeclaration } from 'lit';\nimport { property } from 'lit/decorators/property.js';\n\n/**\n * Enables declarative way to set host element attributes such as slots.\n * Use when needing to set host attributes but not create a public API property/attr for consumer.\n */\nexport function hostAttr(options: PropertyDeclaration = { type: String, reflect: true }) {\n return property({ type: String, reflect: true, ...options });\n}\n"],"mappings":";;AAUA,SAAgB,EAAS,IAA+B;CAAE,MAAM;CAAQ,SAAS;CAAM,EAAE;CACvF,OAAO,EAAS;EAAE,MAAM;EAAQ,SAAS;EAAM,GAAG;EAAS,CAAC"}
|