@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":"dropdown2.js","names":["#i18nController"],"sources":["../../src/dropdown/dropdown.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { query } from 'lit/decorators/query.js';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport type { PopoverAlign, PopoverPosition, PopoverType } from '@nvidia-elements/core/internal';\nimport {\n audit,\n excessiveInstanceLimit,\n I18nController,\n popoverStyles,\n scopedRegistry,\n TypeNativePopoverController,\n useStyles\n} from '@nvidia-elements/core/internal';\nimport styles from './dropdown.css?inline';\n\n/**\n * @element nve-dropdown\n * @description Generic dropdown element for rendering a variety of different content such as interactive navigation or form controls. [MDN Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)\n * @since 0.6.0\n * @entrypoint \\@nvidia-elements/core/dropdown\n * @event beforetoggle - Dispatched on a popover just before showing or hiding. [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforetoggle_event)\n * @event toggle - Dispatched on a popover element just after showing or hiding. [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/toggle_event)\n * @event open - Dispatched when the dropdown opens.\n * @event close - Dispatched when the dropdown closes.\n * @slot - default slot for dropdown content\n * @cssprop --border\n * @cssprop --border-radius\n * @cssprop --background\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --box-shadow\n * @cssprop --width\n * @cssprop --min-width\n * @cssprop --gap\n * @cssprop --arrow-transform - Transform applied to the popover arrow\n * @cssprop --animation-duration - Duration of dropdown open/close animations\n * @csspart icon-button - The close icon button element\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/menubar/\n */\n@audit({ excessiveInstanceLimit })\n@scopedRegistry()\nexport class Dropdown extends LitElement {\n static styles = useStyles([popoverStyles, styles]);\n\n static readonly metadata = {\n tag: 'nve-dropdown',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton\n };\n\n /**\n * (optional) By default the popover will automatically anchor itself relative to the trigger element.\n * Pass an optional custom anchor element as an idref string within the same render root or a HTMLElement DOM reference.\n */\n @property({ type: String }) anchor: string | HTMLElement;\n\n /**\n * @deprecated Use the popover API instead.\n * The trigger defines what element triggers an `open` interaction event.\n * A trigger can accept a idref string within the same render root or a HTMLElement DOM reference.\n */\n @property({ type: String }) trigger: string | HTMLElement;\n\n /**\n * Sets the side position of the popover relative to the provided anchor element.\n */\n @property({ type: String, reflect: true }) position: PopoverPosition = 'bottom';\n\n /**\n * Sets the alignment of the popover relative to the provided anchor element.\n * If an arrow exists the alginment will be relative to the arrow against the anchor.\n */\n @property({ type: String, reflect: true }) alignment: PopoverAlign = 'start';\n\n /**\n * @deprecated Use the popover API instead.\n * Determines if popover visibility behavior should be automatically controlled by the trigger.\n */\n @property({ type: Boolean, reflect: true, attribute: 'behavior-trigger' }) behaviorTrigger: boolean;\n\n /**\n * Determines if a close button should render within dropdown. Non-closable\n * dropdowns suit menu or selection patterns.\n */\n @property({ type: Boolean }) closable = false;\n\n /**\n * Determines if an arrow renders.\n */\n @property({ type: Boolean }) arrow = false;\n\n /** @private */\n @property({ type: Boolean, reflect: true }) modal = true;\n\n /** @private */\n @property({ type: String, attribute: 'popover-type' }) popoverType: PopoverType = 'auto';\n\n @query('.arrow') popoverArrow: HTMLElement;\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n protected typeNativePopoverController = new TypeNativePopoverController<Dropdown>(this);\n\n /** @private */\n get popoverDismissible() {\n return this.modal;\n }\n\n /**\n * Enables internal string values to update for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n render() {\n return html`\n <div internal-host>\n <slot name=\"header\"></slot>\n ${this.closable ? html`<nve-icon-button part=\"icon-button\" exportparts=\"icon:icon-button-icon\" @click=${this.hidePopover} icon-name=\"cancel\" container=\"flat\" size=\"sm\" .ariaLabel=${this.i18n.close}></nve-icon-button>` : ''}\n <slot></slot>\n <slot name=\"footer\"></slot>\n ${this.arrow ? html`<div class=\"arrow\"></div>` : ''}\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AA6CO,IAAA,IAAA,cAAuB,EAAW;;+BA4BgC,2BAMF,yBAY7B,iBAKH,iBAGe,uBAG8B,
|
|
1
|
+
{"version":3,"file":"dropdown2.js","names":["#i18nController"],"sources":["../../src/dropdown/dropdown.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { query } from 'lit/decorators/query.js';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport type { PopoverAlign, PopoverPosition, PopoverType } from '@nvidia-elements/core/internal';\nimport {\n audit,\n excessiveInstanceLimit,\n I18nController,\n popoverStyles,\n scopedRegistry,\n TypeNativePopoverController,\n useStyles\n} from '@nvidia-elements/core/internal';\nimport styles from './dropdown.css?inline';\n\n/**\n * @element nve-dropdown\n * @description Generic dropdown element for rendering a variety of different content such as interactive navigation or form controls. [MDN Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)\n * @since 0.6.0\n * @entrypoint \\@nvidia-elements/core/dropdown\n * @event beforetoggle - Dispatched on a popover just before showing or hiding. [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforetoggle_event)\n * @event toggle - Dispatched on a popover element just after showing or hiding. [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/toggle_event)\n * @event open - Dispatched when the dropdown opens.\n * @event close - Dispatched when the dropdown closes.\n * @slot - default slot for dropdown content\n * @cssprop --border\n * @cssprop --border-radius\n * @cssprop --background\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --box-shadow\n * @cssprop --width\n * @cssprop --min-width\n * @cssprop --gap\n * @cssprop --arrow-transform - Transform applied to the popover arrow\n * @cssprop --animation-duration - Duration of dropdown open/close animations\n * @csspart icon-button - The close icon button element\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/menubar/\n */\n@audit({ excessiveInstanceLimit })\n@scopedRegistry()\nexport class Dropdown extends LitElement {\n static styles = useStyles([popoverStyles, styles]);\n\n static readonly metadata = {\n tag: 'nve-dropdown',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton\n };\n\n /**\n * (optional) By default the popover will automatically anchor itself relative to the trigger element.\n * Pass an optional custom anchor element as an idref string within the same render root or a HTMLElement DOM reference.\n */\n @property({ type: String }) anchor: string | HTMLElement;\n\n /**\n * @deprecated Use the popover API instead.\n * The trigger defines what element triggers an `open` interaction event.\n * A trigger can accept a idref string within the same render root or a HTMLElement DOM reference.\n */\n @property({ type: String }) trigger: string | HTMLElement;\n\n /**\n * Sets the side position of the popover relative to the provided anchor element.\n */\n @property({ type: String, reflect: true }) position: PopoverPosition = 'bottom';\n\n /**\n * Sets the alignment of the popover relative to the provided anchor element.\n * If an arrow exists the alginment will be relative to the arrow against the anchor.\n */\n @property({ type: String, reflect: true }) alignment: PopoverAlign = 'start';\n\n /**\n * @deprecated Use the popover API instead.\n * Determines if popover visibility behavior should be automatically controlled by the trigger.\n */\n @property({ type: Boolean, reflect: true, attribute: 'behavior-trigger' }) behaviorTrigger: boolean;\n\n /**\n * Determines if a close button should render within dropdown. Non-closable\n * dropdowns suit menu or selection patterns.\n */\n @property({ type: Boolean }) closable = false;\n\n /**\n * Determines if an arrow renders.\n */\n @property({ type: Boolean }) arrow = false;\n\n /** @private */\n @property({ type: Boolean, reflect: true }) modal = true;\n\n /** @private */\n @property({ type: String, attribute: 'popover-type' }) popoverType: PopoverType = 'auto';\n\n @query('.arrow') popoverArrow: HTMLElement;\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n protected typeNativePopoverController = new TypeNativePopoverController<Dropdown>(this);\n\n /** @private */\n get popoverDismissible() {\n return this.modal;\n }\n\n /**\n * Enables internal string values to update for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n render() {\n return html`\n <div internal-host>\n <slot name=\"header\"></slot>\n ${this.closable ? html`<nve-icon-button part=\"icon-button\" exportparts=\"icon:icon-button-icon\" @click=${this.hidePopover} icon-name=\"cancel\" container=\"flat\" size=\"sm\" .ariaLabel=${this.i18n.close}></nve-icon-button>` : ''}\n <slot></slot>\n <slot name=\"footer\"></slot>\n ${this.arrow ? html`<div class=\"arrow\"></div>` : ''}\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AA6CO,IAAA,IAAA,cAAuB,EAAW;;+BA4BgC,2BAMF,yBAY7B,iBAKH,iBAGe,uBAG8B,kBAI1C,IAAI,EAAqB,KAAK,qCAE9B,IAAI,EAAsC,KAAK,cAUpD,KAAKA,GAAgB;;;gBAxExC,EAAU,CAAC,GAAe,EAAO,CAAC;;;kBAEvB;GACzB,KAAK;GACL,SAAS;GACV;;;4BAE2B,GACzB,EAAW,SAAS,MAAM,GAC5B;;CAmDD;CAKA,IAAI,qBAAqB;EACvB,OAAO,KAAK;;CAQd,SAAS;EACP,OAAO,CAAI,iDAGP,KAAK,WAAW,CAAI,mFAAkF,KAAK,YAAY,8DAA4D,KAAK,KAAK,MAAM,wBAAuB,GAAG,0CAG7N,KAAK,QAAQ,CAAI,8BAA8B,GAAG;;;GAlEvD,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,UAAA,KAAA,EAAA,KAO1B,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,KAK1B,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAMzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,aAAA,KAAA,EAAA,KAMzC,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;CAAoB,CAAC,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA,KAMzE,EAAS,EAAE,MAAM,SAAS,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAK3B,EAAS,EAAE,MAAM,SAAS,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA,KAG3B,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA,KAG1C,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAgB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAErD,EAAM,SAAS,CAAA,EAAA,EAAA,WAAA,gBAAA,KAAA,EAAA,KAcf,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,SA3E5B,EAAM,EAAE,wBAAA,IAAwB,CAAC,EACjC,GAAgB,CAAA,EAAA,EAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isSimpleFocusable as e } from "../internal/utils/focus.js";
|
|
2
2
|
import { appendRootNodeStyle as t, clickOutsideElementBounds as n, getFlattenedFocusableItems as r } from "../internal/utils/dom.js";
|
|
3
|
-
import { __decorate as i } from "../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate as i } from "../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorate.js";
|
|
4
4
|
import { audit as a } from "../internal/controllers/audit.controller.js";
|
|
5
5
|
import { useStyles as o } from "../internal/styles/index.js";
|
|
6
6
|
import s from "./dropdown-group.global.js";
|
|
@@ -14,7 +14,7 @@ var d = class extends c {
|
|
|
14
14
|
static {
|
|
15
15
|
this.metadata = {
|
|
16
16
|
tag: "nve-dropdown-group",
|
|
17
|
-
version: "0.1.
|
|
17
|
+
version: "0.1.1",
|
|
18
18
|
children: ["nve-dropdown"]
|
|
19
19
|
};
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-group.js","names":["#syncDropdowns","#pointerup","#_pointerup","#keydown","#onOpen","#onClose"],"sources":["../../src/dropdown-group/dropdown-group.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport {\n clickOutsideElementBounds,\n appendRootNodeStyle,\n getFlattenedFocusableItems,\n isSimpleFocusable,\n useStyles,\n audit\n} from '@nvidia-elements/core/internal';\nimport type { Dropdown } from '@nvidia-elements/core/dropdown';\nimport globalStyles from './dropdown-group.global.css?inline';\n\n/**\n * @element nve-dropdown-group\n * @description A Dropdown Group streamlines the management of linked dropdowns and supports nested dropdowns for a more organized and intuitive user experience\n * @since 1.30.1\n * @entrypoint \\@nvidia-elements/core/dropdown-group\n * @slot - default slot for dropdown content\n * @event open - Dispatched when a dropdown in the group opens\n * @event close - Dispatched when a dropdown in the group closes\n * @cssprop --nve-dropdown-group-spacing\n * @cssprop --nve-dropdown-group-transition\n * @cssprop --arrow-transform - Transform applied to the popover arrow\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/menubar/\n * @stable false\n */\n@audit()\nexport class DropdownGroup extends LitElement {\n static styles = useStyles([]);\n\n static readonly metadata = {\n tag: 'nve-dropdown-group',\n version: '0.0.0',\n children: ['nve-dropdown']\n };\n\n @queryAssignedElements() protected dropdowns!: Dropdown[];\n\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${this.#syncDropdowns}></slot>\n </div>\n `;\n }\n\n #_pointerup = (e: PointerEvent) => this.#pointerup(e);\n\n connectedCallback() {\n super.connectedCallback();\n appendRootNodeStyle(this, globalStyles);\n globalThis.document?.addEventListener('pointerup', this.#_pointerup);\n this.addEventListener('keydown', this.#keydown);\n this.addEventListener('open', this.#onOpen as EventListener);\n this.addEventListener('close', this.#onClose as EventListener);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n globalThis.document?.removeEventListener('pointerup', this.#_pointerup);\n this.removeEventListener('keydown', this.#keydown);\n this.removeEventListener('open', this.#onOpen as EventListener);\n this.removeEventListener('close', this.#onClose as EventListener);\n }\n\n #syncDropdowns() {\n this.dropdowns.forEach(dropdown => {\n dropdown.popoverType = 'manual';\n });\n }\n\n #pointerup(event: PointerEvent) {\n const multipleDropdownsOpen = this.dropdowns.some(dropdown => dropdown.matches(':popover-open'));\n const pointerIsOutsideGroup = this.dropdowns.every(dropdown => clickOutsideElementBounds(event, dropdown));\n if (multipleDropdownsOpen && pointerIsOutsideGroup) {\n this.close();\n }\n }\n\n #keydown(event: KeyboardEvent) {\n const target = event.target as HTMLElement;\n if (event.code === 'Escape') {\n this.close();\n }\n if (event.code === 'ArrowRight') {\n const targetId = target.getAttribute('popovertarget');\n const dropdown = this.dropdowns.find(d => d.id === targetId);\n dropdown?.showPopover();\n }\n if (event.code === 'ArrowLeft' && isSimpleFocusable(event.target as HTMLElement)) {\n target.closest('nve-dropdown')?.hidePopover();\n }\n }\n\n #onOpen(event: CustomEvent) {\n const dropdown = event.target as HTMLElement;\n const isLocalDropdown = dropdown.localName === 'nve-dropdown' && this.dropdowns.find(d => d === dropdown);\n if (isLocalDropdown) {\n getFlattenedFocusableItems(dropdown)[0]?.focus();\n }\n }\n\n #onClose(event: CustomEvent) {\n const element = event.target as HTMLElement;\n const isLocalDropdown = element.localName === 'nve-dropdown' && this.dropdowns.find(d => d === element);\n if (isLocalDropdown) {\n // _activeTrigger is a popover controller internal API\n const dropdown = element as Dropdown & { _activeTrigger?: HTMLElement };\n dropdown._activeTrigger?.focus();\n }\n }\n\n close() {\n this.querySelectorAll('nve-dropdown').forEach(d => d.hidePopover());\n }\n}\n"],"mappings":";;;;;;;;;AA+BO,IAAA,IAAA,cAA4B,EAAW;;gBAC5B,EAAU,EAAE,CAAC;;;kBAEF;GACzB,KAAK;GACL,SAAS;GACT,UAAU,CAAC,eAAA;GACZ;;CAID,SAAS;
|
|
1
|
+
{"version":3,"file":"dropdown-group.js","names":["#syncDropdowns","#pointerup","#_pointerup","#keydown","#onOpen","#onClose"],"sources":["../../src/dropdown-group/dropdown-group.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport {\n clickOutsideElementBounds,\n appendRootNodeStyle,\n getFlattenedFocusableItems,\n isSimpleFocusable,\n useStyles,\n audit\n} from '@nvidia-elements/core/internal';\nimport type { Dropdown } from '@nvidia-elements/core/dropdown';\nimport globalStyles from './dropdown-group.global.css?inline';\n\n/**\n * @element nve-dropdown-group\n * @description A Dropdown Group streamlines the management of linked dropdowns and supports nested dropdowns for a more organized and intuitive user experience\n * @since 1.30.1\n * @entrypoint \\@nvidia-elements/core/dropdown-group\n * @slot - default slot for dropdown content\n * @event open - Dispatched when a dropdown in the group opens\n * @event close - Dispatched when a dropdown in the group closes\n * @cssprop --nve-dropdown-group-spacing\n * @cssprop --nve-dropdown-group-transition\n * @cssprop --arrow-transform - Transform applied to the popover arrow\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/menubar/\n * @stable false\n */\n@audit()\nexport class DropdownGroup extends LitElement {\n static styles = useStyles([]);\n\n static readonly metadata = {\n tag: 'nve-dropdown-group',\n version: '0.0.0',\n children: ['nve-dropdown']\n };\n\n @queryAssignedElements() protected dropdowns!: Dropdown[];\n\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${this.#syncDropdowns}></slot>\n </div>\n `;\n }\n\n #_pointerup = (e: PointerEvent) => this.#pointerup(e);\n\n connectedCallback() {\n super.connectedCallback();\n appendRootNodeStyle(this, globalStyles);\n globalThis.document?.addEventListener('pointerup', this.#_pointerup);\n this.addEventListener('keydown', this.#keydown);\n this.addEventListener('open', this.#onOpen as EventListener);\n this.addEventListener('close', this.#onClose as EventListener);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n globalThis.document?.removeEventListener('pointerup', this.#_pointerup);\n this.removeEventListener('keydown', this.#keydown);\n this.removeEventListener('open', this.#onOpen as EventListener);\n this.removeEventListener('close', this.#onClose as EventListener);\n }\n\n #syncDropdowns() {\n this.dropdowns.forEach(dropdown => {\n dropdown.popoverType = 'manual';\n });\n }\n\n #pointerup(event: PointerEvent) {\n const multipleDropdownsOpen = this.dropdowns.some(dropdown => dropdown.matches(':popover-open'));\n const pointerIsOutsideGroup = this.dropdowns.every(dropdown => clickOutsideElementBounds(event, dropdown));\n if (multipleDropdownsOpen && pointerIsOutsideGroup) {\n this.close();\n }\n }\n\n #keydown(event: KeyboardEvent) {\n const target = event.target as HTMLElement;\n if (event.code === 'Escape') {\n this.close();\n }\n if (event.code === 'ArrowRight') {\n const targetId = target.getAttribute('popovertarget');\n const dropdown = this.dropdowns.find(d => d.id === targetId);\n dropdown?.showPopover();\n }\n if (event.code === 'ArrowLeft' && isSimpleFocusable(event.target as HTMLElement)) {\n target.closest('nve-dropdown')?.hidePopover();\n }\n }\n\n #onOpen(event: CustomEvent) {\n const dropdown = event.target as HTMLElement;\n const isLocalDropdown = dropdown.localName === 'nve-dropdown' && this.dropdowns.find(d => d === dropdown);\n if (isLocalDropdown) {\n getFlattenedFocusableItems(dropdown)[0]?.focus();\n }\n }\n\n #onClose(event: CustomEvent) {\n const element = event.target as HTMLElement;\n const isLocalDropdown = element.localName === 'nve-dropdown' && this.dropdowns.find(d => d === element);\n if (isLocalDropdown) {\n // _activeTrigger is a popover controller internal API\n const dropdown = element as Dropdown & { _activeTrigger?: HTMLElement };\n dropdown._activeTrigger?.focus();\n }\n }\n\n close() {\n this.querySelectorAll('nve-dropdown').forEach(d => d.hidePopover());\n }\n}\n"],"mappings":";;;;;;;;;AA+BO,IAAA,IAAA,cAA4B,EAAW;;gBAC5B,EAAU,EAAE,CAAC;;;kBAEF;GACzB,KAAK;GACL,SAAS;GACT,UAAU,CAAC,eAAA;GACZ;;CAID,SAAS;EACP,OAAO,CAAI,yCAEa,KAAKA,GAAe;;CAK9C,MAAe,MAAoB,KAAKC,GAAW,EAAE;CAErD,oBAAoB;EAMlB,AALA,MAAM,mBAAmB,EACzB,EAAoB,MAAM,EAAa,EACvC,WAAW,UAAU,iBAAiB,aAAa,KAAKC,GAAY,EACpE,KAAK,iBAAiB,WAAW,KAAKC,GAAS,EAC/C,KAAK,iBAAiB,QAAQ,KAAKC,GAAyB,EAC5D,KAAK,iBAAiB,SAAS,KAAKC,GAA0B;;CAGhE,uBAAuB;EAKrB,AAJA,MAAM,sBAAsB,EAC5B,WAAW,UAAU,oBAAoB,aAAa,KAAKH,GAAY,EACvE,KAAK,oBAAoB,WAAW,KAAKC,GAAS,EAClD,KAAK,oBAAoB,QAAQ,KAAKC,GAAyB,EAC/D,KAAK,oBAAoB,SAAS,KAAKC,GAA0B;;CAGnE,KAAiB;EACf,KAAK,UAAU,SAAQ,MAAY;GACjC,EAAS,cAAc;IACvB;;CAGJ,GAAW,GAAqB;EAC9B,IAAM,IAAwB,KAAK,UAAU,MAAK,MAAY,EAAS,QAAQ,gBAAgB,CAAC,EAC1F,IAAwB,KAAK,UAAU,OAAM,MAAY,EAA0B,GAAO,EAAS,CAAC;EAC1G,AAAI,KAAyB,KAC3B,KAAK,OAAO;;CAIhB,GAAS,GAAsB;EAC7B,IAAM,IAAS,EAAM;EAIrB,IAHI,EAAM,SAAS,YACjB,KAAK,OAAO,EAEV,EAAM,SAAS,cAAc;GAC/B,IAAM,IAAW,EAAO,aAAa,gBAAgB;GAErD,KADsB,UAAU,MAAK,MAAK,EAAE,OAAO,EACnD,EAAU,aAAa;;EAEzB,AAAI,EAAM,SAAS,eAAe,EAAkB,EAAM,OAAsB,IAC9E,EAAO,QAAQ,eAAe,EAAE,aAAa;;CAIjD,GAAQ,GAAoB;EAC1B,IAAM,IAAW,EAAM;EAEvB,AADwB,EAAS,cAAc,kBAAkB,KAAK,UAAU,MAAK,MAAK,MAAM,EAAS,IAEvG,EAA2B,EAAS,CAAC,IAAI,OAAO;;CAIpD,GAAS,GAAoB;EAC3B,IAAM,IAAU,EAAM;EAEtB,AADwB,EAAQ,cAAc,kBAAkB,KAAK,UAAU,MAAK,MAAK,MAAM,EAAQ,IAIrG,EAAS,gBAAgB,OAAO;;CAIpC,QAAQ;EACN,KAAK,iBAAiB,eAAe,CAAC,SAAQ,MAAK,EAAE,aAAa,CAAC;;;GA7EpE,GAAuB,CAAA,EAAA,EAAA,WAAA,aAAA,KAAA,EAAA,SAVzB,GAAO,CAAA,EAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropzone.util.js","names":[],"sources":["../../src/dropzone/dropzone.util.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { formatFileSize } from '@nvidia-elements/core/internal';\nimport type { Dropzone } from './dropzone';\nimport type { ValidatorResult } from '@nvidia-elements/forms';\n\nexport function getFileTypeSpecifiers(acceptTypes: string) {\n const types = acceptTypes.split(',').map((value: string) => {\n let type = value.trim();\n if (type.startsWith('.')) {\n type = type.slice(1);\n }\n if (type.endsWith('/*')) {\n type = type.split('/')[0]!;\n }\n if (type.includes('/')) {\n type = type.split('/')[1]!;\n }\n if (type.includes('+')) {\n type = type.split('+')[0]!;\n }\n return type;\n });\n return types;\n}\n\nexport function fileSizeValidator(value: unknown, element: unknown): ValidatorResult {\n const dropzone = element as Dropzone;\n const files = value as File[];\n\n if (!files || !Array.isArray(files) || files.length === 0) {\n return { validity: { valid: true } };\n }\n\n const invalid = files.filter(file => file.size > dropzone.maxFileSize).length > 0;\n\n if (invalid) {\n return {\n validity: { rangeOverflow: true, valid: false },\n message: `Some files exceed the maximum size of ${formatFileSize(dropzone.maxFileSize)}`\n };\n }\n return { validity: { valid: true } };\n}\n\nexport function fileTypeValidator(value: unknown, element: unknown): ValidatorResult {\n const dropzone = element as Dropzone;\n const files = value as File[];\n\n if (!files || !Array.isArray(files) || files.length === 0) {\n return { validity: { valid: true } };\n }\n\n const acceptedTypes = getFileTypeSpecifiers(dropzone.accept);\n\n const invalidFiles = files.filter(file => {\n return !acceptedTypes.some((acceptedType: string) => {\n return file.type.includes(acceptedType);\n });\n });\n\n if (invalidFiles.length > 0) {\n return { validity: { typeMismatch: true, valid: false }, message: `Some files are not of accepted types` };\n }\n return { validity: { valid: true } };\n}\n"],"mappings":";;AAOA,SAAgB,EAAsB,GAAqB;
|
|
1
|
+
{"version":3,"file":"dropzone.util.js","names":[],"sources":["../../src/dropzone/dropzone.util.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { formatFileSize } from '@nvidia-elements/core/internal';\nimport type { Dropzone } from './dropzone';\nimport type { ValidatorResult } from '@nvidia-elements/forms';\n\nexport function getFileTypeSpecifiers(acceptTypes: string) {\n const types = acceptTypes.split(',').map((value: string) => {\n let type = value.trim();\n if (type.startsWith('.')) {\n type = type.slice(1);\n }\n if (type.endsWith('/*')) {\n type = type.split('/')[0]!;\n }\n if (type.includes('/')) {\n type = type.split('/')[1]!;\n }\n if (type.includes('+')) {\n type = type.split('+')[0]!;\n }\n return type;\n });\n return types;\n}\n\nexport function fileSizeValidator(value: unknown, element: unknown): ValidatorResult {\n const dropzone = element as Dropzone;\n const files = value as File[];\n\n if (!files || !Array.isArray(files) || files.length === 0) {\n return { validity: { valid: true } };\n }\n\n const invalid = files.filter(file => file.size > dropzone.maxFileSize).length > 0;\n\n if (invalid) {\n return {\n validity: { rangeOverflow: true, valid: false },\n message: `Some files exceed the maximum size of ${formatFileSize(dropzone.maxFileSize)}`\n };\n }\n return { validity: { valid: true } };\n}\n\nexport function fileTypeValidator(value: unknown, element: unknown): ValidatorResult {\n const dropzone = element as Dropzone;\n const files = value as File[];\n\n if (!files || !Array.isArray(files) || files.length === 0) {\n return { validity: { valid: true } };\n }\n\n const acceptedTypes = getFileTypeSpecifiers(dropzone.accept);\n\n const invalidFiles = files.filter(file => {\n return !acceptedTypes.some((acceptedType: string) => {\n return file.type.includes(acceptedType);\n });\n });\n\n if (invalidFiles.length > 0) {\n return { validity: { typeMismatch: true, valid: false }, message: `Some files are not of accepted types` };\n }\n return { validity: { valid: true } };\n}\n"],"mappings":";;AAOA,SAAgB,EAAsB,GAAqB;CAiBzD,OAhBc,EAAY,MAAM,IAAI,CAAC,KAAK,MAAkB;EAC1D,IAAI,IAAO,EAAM,MAAM;EAavB,OAZI,EAAK,WAAW,IAAI,KACtB,IAAO,EAAK,MAAM,EAAE,GAElB,EAAK,SAAS,KAAK,KACrB,IAAO,EAAK,MAAM,IAAI,CAAC,KAErB,EAAK,SAAS,IAAI,KACpB,IAAO,EAAK,MAAM,IAAI,CAAC,KAErB,EAAK,SAAS,IAAI,KACpB,IAAO,EAAK,MAAM,IAAI,CAAC,KAElB;GAEF;;AAGT,SAAgB,EAAkB,GAAgB,GAAmC;CACnF,IAAM,IAAW,GACX,IAAQ;CAcd,OAZI,CAAC,KAAS,CAAC,MAAM,QAAQ,EAAM,IAAI,EAAM,WAAW,IAC/C,EAAE,UAAU,EAAE,OAAO,IAAM,EAAE,GAGtB,EAAM,QAAO,MAAQ,EAAK,OAAO,EAAS,YAAY,CAAC,SAAS,IAGvE;EACL,UAAU;GAAE,eAAe;GAAM,OAAO;GAAO;EAC/C,SAAS,yCAAyC,EAAe,EAAS,YAAY;EACvF,GAEI,EAAE,UAAU,EAAE,OAAO,IAAM,EAAE;;AAGtC,SAAgB,EAAkB,GAAgB,GAAmC;CACnF,IAAM,IAAW,GACX,IAAQ;CAEd,IAAI,CAAC,KAAS,CAAC,MAAM,QAAQ,EAAM,IAAI,EAAM,WAAW,GACtD,OAAO,EAAE,UAAU,EAAE,OAAO,IAAM,EAAE;CAGtC,IAAM,IAAgB,EAAsB,EAAS,OAAO;CAW5D,OATqB,EAAM,QAAO,MACzB,CAAC,EAAc,MAAM,MACnB,EAAK,KAAK,SAAS,EAAa,CACvC,CAGA,CAAa,SAAS,IACjB;EAAE,UAAU;GAAE,cAAc;GAAM,OAAO;GAAO;EAAE,SAAS;EAAwC,GAErG,EAAE,UAAU,EAAE,OAAO,IAAM,EAAE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { formatFileSize as e } from "../internal/utils/strings.js";
|
|
2
2
|
import { removeEmptyTextNode as t } from "../internal/utils/dom.js";
|
|
3
|
-
import { __decorate as n } from "../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate as n } from "../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorate.js";
|
|
4
4
|
import { I18nController as r } from "../internal/controllers/i18n.controller.js";
|
|
5
5
|
import { scopedRegistry as i } from "../internal/decorators/scoped-registry.js";
|
|
6
6
|
import { useStyles as a } from "../internal/styles/index.js";
|
|
@@ -13,14 +13,14 @@ import { query as m } from "lit/decorators/query.js";
|
|
|
13
13
|
import { FormControlMixin as h } from "@nvidia-elements/forms/mixin";
|
|
14
14
|
//#region src/dropzone/dropzone.ts
|
|
15
15
|
var g = class extends h(d) {
|
|
16
|
-
#e
|
|
16
|
+
#e;
|
|
17
17
|
static {
|
|
18
18
|
this.styles = a([s]);
|
|
19
19
|
}
|
|
20
20
|
static {
|
|
21
21
|
this.metadata = {
|
|
22
22
|
tag: "nve-dropzone",
|
|
23
|
-
version: "0.1.
|
|
23
|
+
version: "0.1.1",
|
|
24
24
|
validators: [l, c],
|
|
25
25
|
valueSchema: {
|
|
26
26
|
type: "array",
|
|
@@ -42,7 +42,7 @@ var g = class extends h(d) {
|
|
|
42
42
|
this.value = [], this.requestUpdate();
|
|
43
43
|
}
|
|
44
44
|
constructor() {
|
|
45
|
-
super(), this.accept = "image/gif, image/jpeg, image/png, image/svg+xml", this.maxFileSize = 2 * 1024 ** 2, this.i18n = this.#e.i18n, this.value = [];
|
|
45
|
+
super(), this.accept = "image/gif, image/jpeg, image/png, image/svg+xml", this.maxFileSize = 2 * 1024 ** 2, this.#e = new r(this), this.i18n = this.#e.i18n, this.value = [];
|
|
46
46
|
}
|
|
47
47
|
connectedCallback() {
|
|
48
48
|
super.connectedCallback(), this.setAttribute("nve-control", ""), globalThis.document.addEventListener("dragover", this.#t), globalThis.document.addEventListener("drop", this.#t);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropzone2.js","names":["#i18nController","#preventDefaults","#toggleHighlighted","#addFiles","#handleClick","#handleDragEnter","#handleDragOver","#handleDragLeave","#handleDrop","#removeEmptyNodes","#formatFileTypeSpecifiers","#handleFileInputChange"],"sources":["../../src/dropzone/dropzone.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { query } from 'lit/decorators/query.js';\nimport {\n formatFileSize,\n useStyles,\n removeEmptyTextNode,\n I18nController,\n scopedRegistry\n} from '@nvidia-elements/core/internal';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport styles from './dropzone.css?inline';\nimport { FormControlMixin } from '@nvidia-elements/forms/mixin';\nimport { fileTypeValidator, fileSizeValidator, getFileTypeSpecifiers } from './dropzone.util';\n\n/**\n * @element nve-dropzone\n * @description A dropzone form control that enables users to drag and drop files onto it.\n * @since 1.29.0\n * @entrypoint \\@nvidia-elements/core/dropzone\n * @event change - Dispatched when the value has changed (files located in event.target)\n * @slot - use only when custom messaging requires it\n * @cssprop --background\n * @cssprop --border-color\n * @cssprop --border-radius\n * @cssprop --padding\n * @cssprop --min-height\n * @cssprop --color\n * @slot icon - default slot for icon\n * @slot content - default slot for content\n * @csspart icon - The upload icon element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file\n * @stable false\n */\n@scopedRegistry()\nexport class Dropzone extends FormControlMixin<typeof LitElement, File[]>(LitElement) {\n @property()\n accept: string = `image/gif, image/jpeg, image/png, image/svg+xml`;\n\n @property({ attribute: 'max-file-size', type: Number })\n maxFileSize: number = 2 * 1024 ** 2;\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n /**\n * Enables internal string values to update for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n @query('#dropzone-input')\n private fileInput: HTMLInputElement;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-dropzone',\n version: '0.0.0',\n validators: [fileTypeValidator, fileSizeValidator],\n valueSchema: {\n type: 'array' as const,\n items: {\n type: 'object' as const,\n properties: {\n name: { type: 'string' as const },\n size: { type: 'number' as const },\n type: { type: 'string' as const }\n }\n }\n }\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon\n };\n\n formResetCallback() {\n this.value = [];\n this.requestUpdate();\n }\n\n constructor() {\n super();\n this.value = [];\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('nve-control', '');\n globalThis.document.addEventListener('dragover', this.#preventDefaults);\n globalThis.document.addEventListener('drop', this.#preventDefaults);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n globalThis.document.removeEventListener('dragover', this.#preventDefaults);\n globalThis.document.removeEventListener('drop', this.#preventDefaults);\n }\n\n #preventDefaults(event: Event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n #handleClick() {\n this.fileInput.click();\n }\n\n #handleDragEnter(event: DragEvent) {\n this.#preventDefaults(event);\n this.#toggleHighlighted(true);\n }\n\n #handleDragOver(event: DragEvent) {\n this.#preventDefaults(event);\n this.#toggleHighlighted(true);\n }\n\n #handleDragLeave(event: DragEvent) {\n this.#preventDefaults(event);\n this.#toggleHighlighted(false);\n }\n\n #handleDrop(event: DragEvent) {\n this.#preventDefaults(event);\n this.#toggleHighlighted(false);\n\n const files = Array.from(event.dataTransfer!.files);\n this.#addFiles(files);\n }\n\n #handleFileInputChange(event: Event) {\n this.#preventDefaults(event);\n\n const files = Array.from(this.fileInput.files!);\n this.#addFiles(files);\n\n this.fileInput.value = '';\n }\n\n #addFiles(files: File[]) {\n this.value = [...(this.value ?? []), ...files];\n this.dispatchChangeEvent();\n }\n\n #formatFileTypeSpecifiers(acceptTypes: string) {\n const types = getFileTypeSpecifiers(acceptTypes);\n\n if (types.length === 1) {\n return types[0]!.toUpperCase();\n }\n\n const lastType = types.pop();\n return `${types.join(', ').toUpperCase()} or ${lastType!.toUpperCase()}`;\n }\n\n #toggleHighlighted(highlighted: boolean) {\n this.toggleAttribute('highlighted', highlighted);\n }\n\n #removeEmptyNodes(e: Event) {\n (e.target as HTMLSlotElement).assignedNodes().forEach((node: Node) => removeEmptyTextNode(node));\n }\n\n render() {\n return html`<div internal-host>\n <div class=\"container\"\n @click=${this.#handleClick} \n @dragenter=${this.#handleDragEnter}\n @dragover=${this.#handleDragOver}\n @dragleave=${this.#handleDragLeave}\n @drop=${this.#handleDrop}>\n <svg class=\"border\" width=\"100%\" height=\"100%\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect width=\"100%\" height=\"100%\" fill=\"none\" rx=\"4\" ry=\"4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-dasharray=\"6,6\" stroke-dashoffset=\"0\" stroke-linecap=\"square\" />\n </svg>\n <slot name=\"icon\"><nve-icon part=\"icon\" class=\"icon\" name=\"upload\"></nve-icon></slot>\n <slot @slotchange=${this.#removeEmptyNodes}>\n <div class=\"text-center\">\n <div class=\"text-bold\">${this.i18n.dragAndDrop} ${this.i18n.files} ${this.i18n.or} <span class=\"text-emphasized\">${this.i18n.browseFiles}</span></div>\n <div class=\"text-muted\">${this.#formatFileTypeSpecifiers(this.accept)} — ${this.i18n.maxFileSize} ${formatFileSize(this.maxFileSize)}</div>\n </div>\n </slot>\n <input id=\"dropzone-input\" type=\"file\" accept=${this.accept} @change=${this.#handleFileInputChange} multiple hidden></input>\n </div>\n </div>`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAsCO,IAAA,IAAA,cAAuB,EAA4C,EAAW,CAAC;CAOpF
|
|
1
|
+
{"version":3,"file":"dropzone2.js","names":["#i18nController","#preventDefaults","#toggleHighlighted","#addFiles","#handleClick","#handleDragEnter","#handleDragOver","#handleDragLeave","#handleDrop","#removeEmptyNodes","#formatFileTypeSpecifiers","#handleFileInputChange"],"sources":["../../src/dropzone/dropzone.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { query } from 'lit/decorators/query.js';\nimport {\n formatFileSize,\n useStyles,\n removeEmptyTextNode,\n I18nController,\n scopedRegistry\n} from '@nvidia-elements/core/internal';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport styles from './dropzone.css?inline';\nimport { FormControlMixin } from '@nvidia-elements/forms/mixin';\nimport { fileTypeValidator, fileSizeValidator, getFileTypeSpecifiers } from './dropzone.util';\n\n/**\n * @element nve-dropzone\n * @description A dropzone form control that enables users to drag and drop files onto it.\n * @since 1.29.0\n * @entrypoint \\@nvidia-elements/core/dropzone\n * @event change - Dispatched when the value has changed (files located in event.target)\n * @slot - use only when custom messaging requires it\n * @cssprop --background\n * @cssprop --border-color\n * @cssprop --border-radius\n * @cssprop --padding\n * @cssprop --min-height\n * @cssprop --color\n * @slot icon - default slot for icon\n * @slot content - default slot for content\n * @csspart icon - The upload icon element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file\n * @stable false\n */\n@scopedRegistry()\nexport class Dropzone extends FormControlMixin<typeof LitElement, File[]>(LitElement) {\n @property()\n accept: string = `image/gif, image/jpeg, image/png, image/svg+xml`;\n\n @property({ attribute: 'max-file-size', type: Number })\n maxFileSize: number = 2 * 1024 ** 2;\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n /**\n * Enables internal string values to update for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n @query('#dropzone-input')\n private fileInput: HTMLInputElement;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-dropzone',\n version: '0.0.0',\n validators: [fileTypeValidator, fileSizeValidator],\n valueSchema: {\n type: 'array' as const,\n items: {\n type: 'object' as const,\n properties: {\n name: { type: 'string' as const },\n size: { type: 'number' as const },\n type: { type: 'string' as const }\n }\n }\n }\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon\n };\n\n formResetCallback() {\n this.value = [];\n this.requestUpdate();\n }\n\n constructor() {\n super();\n this.value = [];\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('nve-control', '');\n globalThis.document.addEventListener('dragover', this.#preventDefaults);\n globalThis.document.addEventListener('drop', this.#preventDefaults);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n globalThis.document.removeEventListener('dragover', this.#preventDefaults);\n globalThis.document.removeEventListener('drop', this.#preventDefaults);\n }\n\n #preventDefaults(event: Event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n #handleClick() {\n this.fileInput.click();\n }\n\n #handleDragEnter(event: DragEvent) {\n this.#preventDefaults(event);\n this.#toggleHighlighted(true);\n }\n\n #handleDragOver(event: DragEvent) {\n this.#preventDefaults(event);\n this.#toggleHighlighted(true);\n }\n\n #handleDragLeave(event: DragEvent) {\n this.#preventDefaults(event);\n this.#toggleHighlighted(false);\n }\n\n #handleDrop(event: DragEvent) {\n this.#preventDefaults(event);\n this.#toggleHighlighted(false);\n\n const files = Array.from(event.dataTransfer!.files);\n this.#addFiles(files);\n }\n\n #handleFileInputChange(event: Event) {\n this.#preventDefaults(event);\n\n const files = Array.from(this.fileInput.files!);\n this.#addFiles(files);\n\n this.fileInput.value = '';\n }\n\n #addFiles(files: File[]) {\n this.value = [...(this.value ?? []), ...files];\n this.dispatchChangeEvent();\n }\n\n #formatFileTypeSpecifiers(acceptTypes: string) {\n const types = getFileTypeSpecifiers(acceptTypes);\n\n if (types.length === 1) {\n return types[0]!.toUpperCase();\n }\n\n const lastType = types.pop();\n return `${types.join(', ').toUpperCase()} or ${lastType!.toUpperCase()}`;\n }\n\n #toggleHighlighted(highlighted: boolean) {\n this.toggleAttribute('highlighted', highlighted);\n }\n\n #removeEmptyNodes(e: Event) {\n (e.target as HTMLSlotElement).assignedNodes().forEach((node: Node) => removeEmptyTextNode(node));\n }\n\n render() {\n return html`<div internal-host>\n <div class=\"container\"\n @click=${this.#handleClick} \n @dragenter=${this.#handleDragEnter}\n @dragover=${this.#handleDragOver}\n @dragleave=${this.#handleDragLeave}\n @drop=${this.#handleDrop}>\n <svg class=\"border\" width=\"100%\" height=\"100%\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect width=\"100%\" height=\"100%\" fill=\"none\" rx=\"4\" ry=\"4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-dasharray=\"6,6\" stroke-dashoffset=\"0\" stroke-linecap=\"square\" />\n </svg>\n <slot name=\"icon\"><nve-icon part=\"icon\" class=\"icon\" name=\"upload\"></nve-icon></slot>\n <slot @slotchange=${this.#removeEmptyNodes}>\n <div class=\"text-center\">\n <div class=\"text-bold\">${this.i18n.dragAndDrop} ${this.i18n.files} ${this.i18n.or} <span class=\"text-emphasized\">${this.i18n.browseFiles}</span></div>\n <div class=\"text-muted\">${this.#formatFileTypeSpecifiers(this.accept)} — ${this.i18n.maxFileSize} ${formatFileSize(this.maxFileSize)}</div>\n </div>\n </slot>\n <input id=\"dropzone-input\" type=\"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,aAAW,KAAKC,GAAuB;;;GAjJxG,GAAU,CAAA,EAAA,EAAA,WAAA,UAAA,KAAA,EAAA,KAGV,EAAS;CAAE,WAAW;CAAiB,MAAM;CAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAQtD,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAE1B,EAAM,kBAAkB,CAAA,EAAA,EAAA,WAAA,aAAA,KAAA,EAAA,SAf1B,GAAgB,CAAA,EAAA,EAAA"}
|
package/dist/file/file2.js
CHANGED
package/dist/file/file2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file2.js","names":[],"sources":["../../src/file/file.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { CSSResult } from 'lit';\nimport { appendRootNodeStyle, useStyles } from '@nvidia-elements/core/internal';\nimport { Control } from '@nvidia-elements/core/forms';\nimport styles from './file.css?inline';\nimport globalStyles from './file.global.css?inline';\n\n/**\n * @element nve-file\n * @description A file picker is a control that enables users to choose a file value.\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/file\n * @cssprop --background\n * @cssprop --padding\n * @cssprop --border-radius\n * @cssprop --border\n * @cssprop --font-weight\n * @cssprop --font-size\n * @cssprop --text-decoration\n * @cssprop --cursor\n * @cssprop --gap\n * @cssprop --height\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file\n */\nexport class File extends Control {\n static styles: CSSResult[] = useStyles([...Control.styles, styles]);\n\n static readonly metadata = {\n tag: 'nve-file',\n version: '0.0.0'\n };\n\n connectedCallback() {\n super.connectedCallback();\n appendRootNodeStyle(this, globalStyles);\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAa,IAAb,cAA0B,EAAQ;;gBACH,EAAU,CAAC,GAAG,EAAQ,QAAQ,EAAO,CAAC;;;kBAExC;GACzB,KAAK;GACL,SAAS;GACV;;CAED,oBAAoB;
|
|
1
|
+
{"version":3,"file":"file2.js","names":[],"sources":["../../src/file/file.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { CSSResult } from 'lit';\nimport { appendRootNodeStyle, useStyles } from '@nvidia-elements/core/internal';\nimport { Control } from '@nvidia-elements/core/forms';\nimport styles from './file.css?inline';\nimport globalStyles from './file.global.css?inline';\n\n/**\n * @element nve-file\n * @description A file picker is a control that enables users to choose a file value.\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/file\n * @cssprop --background\n * @cssprop --padding\n * @cssprop --border-radius\n * @cssprop --border\n * @cssprop --font-weight\n * @cssprop --font-size\n * @cssprop --text-decoration\n * @cssprop --cursor\n * @cssprop --gap\n * @cssprop --height\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file\n */\nexport class File extends Control {\n static styles: CSSResult[] = useStyles([...Control.styles, styles]);\n\n static readonly metadata = {\n tag: 'nve-file',\n version: '0.0.0'\n };\n\n connectedCallback() {\n super.connectedCallback();\n appendRootNodeStyle(this, globalStyles);\n }\n}\n"],"mappings":";;;;;;AA0BA,IAAa,IAAb,cAA0B,EAAQ;;gBACH,EAAU,CAAC,GAAG,EAAQ,QAAQ,EAAO,CAAC;;;kBAExC;GACzB,KAAK;GACL,SAAS;GACV;;CAED,oBAAoB;EAElB,AADA,MAAM,mBAAmB,EACzB,EAAoB,MAAM,EAAa"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogService as e } from "../internal/services/log.service.js";
|
|
2
|
-
import { __decorate as t } from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import { __decorate as t } from "../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorate.js";
|
|
3
3
|
import { typeSSR as n } from "../internal/controllers/type-ssr.controller.js";
|
|
4
4
|
import { useStyles as r } from "../internal/styles/index.js";
|
|
5
5
|
import i from "./format-datetime.js";
|
|
@@ -13,7 +13,7 @@ var c = class extends a {
|
|
|
13
13
|
static {
|
|
14
14
|
this.metadata = {
|
|
15
15
|
tag: "nve-format-datetime",
|
|
16
|
-
version: "0.1.
|
|
16
|
+
version: "0.1.1"
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
get #e() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-datetime2.js","names":["#dateValue","#resolvedLocale","#formattedDate","#parseDate","#formatOptions","#hasPresetStyle","#presetFormatOptions","#granularFormatOptions","#onSlotChange"],"sources":["../../src/format-datetime/format-datetime.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { useStyles, typeSSR, LogService } from '@nvidia-elements/core/internal';\nimport styles from './format-datetime.css?inline';\n\n/**\n * @element nve-format-datetime\n * @description Formats a date/time value as localized text using the Intl.DateTimeFormat API. Renders inside a semantic time element.\n * Granular options (weekday, year, month, day, hour, minute, second) mirror the Intl.DateTimeFormat API. 'numeric' omits zero-padding, '2-digit' zero-pads.\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-datetime\n * @slot - Date string to format (such as 2023-07-28T04:20:17.434Z). Serves as fallback before hydration.\n */\n@typeSSR()\nexport class FormatDatetime extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-datetime',\n version: '0.0.0'\n };\n\n /**\n * Optional date string for values supplied by JavaScript or bound data.\n * By default, the component formats the element's text content, which also serves as the SSR fallback.\n * When both are present, this property takes precedence.\n */\n @property({ type: String }) date?: string;\n\n /**\n * Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default.\n */\n @property({ type: String }) locale?: string;\n\n /**\n * Weekday representation: 'long' | 'short' | 'narrow'.\n */\n @property({ type: String }) weekday?: 'long' | 'short' | 'narrow';\n\n /**\n * Year representation: 'numeric' | '2-digit'.\n */\n @property({ type: String }) year?: 'numeric' | '2-digit';\n\n /**\n * Month representation: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow'.\n */\n @property({ type: String }) month?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow';\n\n /**\n * Day representation: 'numeric' | '2-digit'.\n */\n @property({ type: String }) day?: 'numeric' | '2-digit';\n\n /**\n * Hour representation: 'numeric' | '2-digit'.\n */\n @property({ type: String }) hour?: 'numeric' | '2-digit';\n\n /**\n * Minute representation: 'numeric' | '2-digit'.\n */\n @property({ type: String }) minute?: 'numeric' | '2-digit';\n\n /**\n * Second representation: 'numeric' | '2-digit'.\n */\n @property({ type: String }) second?: 'numeric' | '2-digit';\n\n /**\n * Preset date formatting style: 'full' | 'long' | 'medium' | 'short'.\n * Preset styles take precedence over granular date and time part options.\n */\n @property({ type: String, attribute: 'date-style' }) dateStyle?: 'full' | 'long' | 'medium' | 'short';\n\n /**\n * Preset time formatting style: 'full' | 'long' | 'medium' | 'short'.\n * Preset styles take precedence over granular date and time part options.\n */\n @property({ type: String, attribute: 'time-style' }) timeStyle?: 'full' | 'long' | 'medium' | 'short';\n\n /**\n * Time zone name display: 'long' | 'short'. Use it with granular options only; preset styles ignore it.\n */\n @property({ type: String, attribute: 'time-zone-name' }) timeZoneName?: 'long' | 'short';\n\n /**\n * IANA time zone identifier (such as 'America/New_York', 'UTC').\n */\n @property({ type: String, attribute: 'time-zone' }) timeZone?: string;\n\n get #dateValue(): string {\n return this.date ?? this.textContent?.trim() ?? '';\n }\n\n get #resolvedLocale(): string | undefined {\n return this.locale ?? (globalThis.document?.documentElement?.lang || undefined);\n }\n\n get #formattedDate(): string {\n const iso = this.#dateValue;\n if (!iso) return '';\n\n const date = this.#parseDate(iso);\n if (!date) return iso;\n\n try {\n return new Intl.DateTimeFormat(this.#resolvedLocale, this.#formatOptions).format(date);\n } catch (e) {\n LogService.warn(`format-datetime: ${(e as Error).message}`);\n return iso;\n }\n }\n\n get #formatOptions(): Intl.DateTimeFormatOptions {\n return this.#hasPresetStyle ? this.#presetFormatOptions : this.#granularFormatOptions;\n }\n\n get #hasPresetStyle(): boolean {\n return this.dateStyle !== undefined || this.timeStyle !== undefined;\n }\n\n get #presetFormatOptions(): Intl.DateTimeFormatOptions {\n const options: Intl.DateTimeFormatOptions = {};\n\n if (this.dateStyle) options.dateStyle = this.dateStyle;\n if (this.timeStyle) options.timeStyle = this.timeStyle;\n if (this.timeZone) options.timeZone = this.timeZone;\n\n return options;\n }\n\n get #granularFormatOptions(): Intl.DateTimeFormatOptions {\n const options: Intl.DateTimeFormatOptions = {};\n\n if (this.weekday) options.weekday = this.weekday;\n if (this.year) options.year = this.year;\n if (this.month) options.month = this.month;\n if (this.day) options.day = this.day;\n if (this.hour) options.hour = this.hour;\n if (this.minute) options.minute = this.minute;\n if (this.second) options.second = this.second;\n if (this.timeZoneName) options.timeZoneName = this.timeZoneName;\n if (this.timeZone) options.timeZone = this.timeZone;\n\n return options;\n }\n\n #parseDate(iso: string): Date | null {\n const date = new Date(iso);\n if (!isNaN(date.getTime())) return date;\n\n LogService.warn(`format-datetime: invalid date value \"${iso}\"`);\n return null;\n }\n\n render() {\n return html`<time internal-host datetime=${this.#dateValue}>${this.#formattedDate}<slot @slotchange=${this.#onSlotChange} hidden></slot></time>`;\n }\n\n #onSlotChange() {\n this.requestUpdate();\n }\n}\n"],"mappings":";;;;;;;;AAiBO,IAAA,IAAA,cAA6B,EAAW;;gBAC7B,EAAU,CAAC,EAAO,CAAC;;;kBAER;GACzB,KAAK;GACL,SAAS;GACV;;CAuED,
|
|
1
|
+
{"version":3,"file":"format-datetime2.js","names":["#dateValue","#resolvedLocale","#formattedDate","#parseDate","#formatOptions","#hasPresetStyle","#presetFormatOptions","#granularFormatOptions","#onSlotChange"],"sources":["../../src/format-datetime/format-datetime.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { useStyles, typeSSR, LogService } from '@nvidia-elements/core/internal';\nimport styles from './format-datetime.css?inline';\n\n/**\n * @element nve-format-datetime\n * @description Formats a date/time value as localized text using the Intl.DateTimeFormat API. Renders inside a semantic time element.\n * Granular options (weekday, year, month, day, hour, minute, second) mirror the Intl.DateTimeFormat API. 'numeric' omits zero-padding, '2-digit' zero-pads.\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-datetime\n * @slot - Date string to format (such as 2023-07-28T04:20:17.434Z). Serves as fallback before hydration.\n */\n@typeSSR()\nexport class FormatDatetime extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-datetime',\n version: '0.0.0'\n };\n\n /**\n * Optional date string for values supplied by JavaScript or bound data.\n * By default, the component formats the element's text content, which also serves as the SSR fallback.\n * When both are present, this property takes precedence.\n */\n @property({ type: String }) date?: string;\n\n /**\n * Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default.\n */\n @property({ type: String }) locale?: string;\n\n /**\n * Weekday representation: 'long' | 'short' | 'narrow'.\n */\n @property({ type: String }) weekday?: 'long' | 'short' | 'narrow';\n\n /**\n * Year representation: 'numeric' | '2-digit'.\n */\n @property({ type: String }) year?: 'numeric' | '2-digit';\n\n /**\n * Month representation: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow'.\n */\n @property({ type: String }) month?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow';\n\n /**\n * Day representation: 'numeric' | '2-digit'.\n */\n @property({ type: String }) day?: 'numeric' | '2-digit';\n\n /**\n * Hour representation: 'numeric' | '2-digit'.\n */\n @property({ type: String }) hour?: 'numeric' | '2-digit';\n\n /**\n * Minute representation: 'numeric' | '2-digit'.\n */\n @property({ type: String }) minute?: 'numeric' | '2-digit';\n\n /**\n * Second representation: 'numeric' | '2-digit'.\n */\n @property({ type: String }) second?: 'numeric' | '2-digit';\n\n /**\n * Preset date formatting style: 'full' | 'long' | 'medium' | 'short'.\n * Preset styles take precedence over granular date and time part options.\n */\n @property({ type: String, attribute: 'date-style' }) dateStyle?: 'full' | 'long' | 'medium' | 'short';\n\n /**\n * Preset time formatting style: 'full' | 'long' | 'medium' | 'short'.\n * Preset styles take precedence over granular date and time part options.\n */\n @property({ type: String, attribute: 'time-style' }) timeStyle?: 'full' | 'long' | 'medium' | 'short';\n\n /**\n * Time zone name display: 'long' | 'short'. Use it with granular options only; preset styles ignore it.\n */\n @property({ type: String, attribute: 'time-zone-name' }) timeZoneName?: 'long' | 'short';\n\n /**\n * IANA time zone identifier (such as 'America/New_York', 'UTC').\n */\n @property({ type: String, attribute: 'time-zone' }) timeZone?: string;\n\n get #dateValue(): string {\n return this.date ?? this.textContent?.trim() ?? '';\n }\n\n get #resolvedLocale(): string | undefined {\n return this.locale ?? (globalThis.document?.documentElement?.lang || undefined);\n }\n\n get #formattedDate(): string {\n const iso = this.#dateValue;\n if (!iso) return '';\n\n const date = this.#parseDate(iso);\n if (!date) return iso;\n\n try {\n return new Intl.DateTimeFormat(this.#resolvedLocale, this.#formatOptions).format(date);\n } catch (e) {\n LogService.warn(`format-datetime: ${(e as Error).message}`);\n return iso;\n }\n }\n\n get #formatOptions(): Intl.DateTimeFormatOptions {\n return this.#hasPresetStyle ? this.#presetFormatOptions : this.#granularFormatOptions;\n }\n\n get #hasPresetStyle(): boolean {\n return this.dateStyle !== undefined || this.timeStyle !== undefined;\n }\n\n get #presetFormatOptions(): Intl.DateTimeFormatOptions {\n const options: Intl.DateTimeFormatOptions = {};\n\n if (this.dateStyle) options.dateStyle = this.dateStyle;\n if (this.timeStyle) options.timeStyle = this.timeStyle;\n if (this.timeZone) options.timeZone = this.timeZone;\n\n return options;\n }\n\n get #granularFormatOptions(): Intl.DateTimeFormatOptions {\n const options: Intl.DateTimeFormatOptions = {};\n\n if (this.weekday) options.weekday = this.weekday;\n if (this.year) options.year = this.year;\n if (this.month) options.month = this.month;\n if (this.day) options.day = this.day;\n if (this.hour) options.hour = this.hour;\n if (this.minute) options.minute = this.minute;\n if (this.second) options.second = this.second;\n if (this.timeZoneName) options.timeZoneName = this.timeZoneName;\n if (this.timeZone) options.timeZone = this.timeZone;\n\n return options;\n }\n\n #parseDate(iso: string): Date | null {\n const date = new Date(iso);\n if (!isNaN(date.getTime())) return date;\n\n LogService.warn(`format-datetime: invalid date value \"${iso}\"`);\n return null;\n }\n\n render() {\n return html`<time internal-host datetime=${this.#dateValue}>${this.#formattedDate}<slot @slotchange=${this.#onSlotChange} hidden></slot></time>`;\n }\n\n #onSlotChange() {\n this.requestUpdate();\n }\n}\n"],"mappings":";;;;;;;;AAiBO,IAAA,IAAA,cAA6B,EAAW;;gBAC7B,EAAU,CAAC,EAAO,CAAC;;;kBAER;GACzB,KAAK;GACL,SAAS;GACV;;CAuED,IAAIA,KAAqB;EACvB,OAAO,KAAK,QAAQ,KAAK,aAAa,MAAM,IAAI;;CAGlD,IAAIC,KAAsC;EACxC,OAAO,KAAK,WAAW,WAAW,UAAU,iBAAiB,QAAQ,KAAA;;CAGvE,IAAIC,KAAyB;EAC3B,IAAM,IAAM,KAAKF;EACjB,IAAI,CAAC,GAAK,OAAO;EAEjB,IAAM,IAAO,KAAKG,GAAW,EAAI;EACjC,IAAI,CAAC,GAAM,OAAO;EAElB,IAAI;GACF,OAAO,IAAI,KAAK,eAAe,KAAKF,IAAiB,KAAKG,GAAe,CAAC,OAAO,EAAK;WAC/E,GAAG;GAEV,OADA,EAAW,KAAK,oBAAqB,EAAY,UAAU,EACpD;;;CAIX,IAAIA,KAA6C;EAC/C,OAAO,KAAKC,KAAkB,KAAKC,KAAuB,KAAKC;;CAGjE,IAAIF,KAA2B;EAC7B,OAAO,KAAK,cAAc,KAAA,KAAa,KAAK,cAAc,KAAA;;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AA,WAAA,SAAA,KAAA,EAAA,KAK1B,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,OAAA,KAAA,EAAA,KAK1B,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAK1B,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,UAAA,KAAA,EAAA,KAK1B,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,UAAA,KAAA,EAAA,KAM1B,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAc,CAAC,CAAA,EAAA,EAAA,WAAA,aAAA,KAAA,EAAA,KAMnD,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAc,CAAC,CAAA,EAAA,EAAA,WAAA,aAAA,KAAA,EAAA,KAKnD,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAkB,CAAC,CAAA,EAAA,EAAA,WAAA,gBAAA,KAAA,EAAA,KAKvD,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAa,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,SA5EpD,GAAS,CAAA,EAAA,EAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogService as e } from "../internal/services/log.service.js";
|
|
2
|
-
import { __decorate as t } from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import { __decorate as t } from "../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorate.js";
|
|
3
3
|
import { typeSSR as n } from "../internal/controllers/type-ssr.controller.js";
|
|
4
4
|
import { useStyles as r } from "../internal/styles/index.js";
|
|
5
5
|
import i from "./format-number.js";
|
|
@@ -29,7 +29,7 @@ var c = [
|
|
|
29
29
|
static {
|
|
30
30
|
this.metadata = {
|
|
31
31
|
tag: "nve-format-number",
|
|
32
|
-
version: "0.1.
|
|
32
|
+
version: "0.1.1"
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
get #e() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-number2.js","names":["#rawValue","#resolvedLocale","#parsedNumber","#formatOptions","#formattedNumber","#onSlotChange"],"sources":["../../src/format-number/format-number.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { useStyles, typeSSR, LogService } from '@nvidia-elements/core/internal';\nimport styles from './format-number.css?inline';\n\nexport type FormatNumberStyle = 'decimal' | 'currency' | 'percent' | 'unit';\nexport type CurrencyDisplayOption = 'symbol' | 'code' | 'name' | 'narrowSymbol';\nexport type CurrencySignOption = 'standard' | 'accounting';\nexport type NotationOption = 'standard' | 'scientific' | 'engineering' | 'compact';\nexport type CompactDisplayOption = 'short' | 'long';\nexport type UnitDisplayOption = 'short' | 'long' | 'narrow';\nexport type SignDisplayOption = 'auto' | 'never' | 'always' | 'exceptZero';\n\nconst STRING_KEYS: [keyof FormatNumber, string][] = [\n ['currency', 'currency'],\n ['currencyDisplay', 'currencyDisplay'],\n ['currencySign', 'currencySign'],\n ['notation', 'notation'],\n ['compactDisplay', 'compactDisplay'],\n ['unit', 'unit'],\n ['unitDisplay', 'unitDisplay'],\n ['signDisplay', 'signDisplay']\n];\n\nconst NUMBER_KEYS: [keyof FormatNumber, string][] = [\n ['minimumFractionDigits', 'minimumFractionDigits'],\n ['maximumFractionDigits', 'maximumFractionDigits'],\n ['minimumIntegerDigits', 'minimumIntegerDigits']\n];\n\n/**\n * @element nve-format-number\n * @description A localized number formatter for currencies, percentages, units, and compact notation, backed by Intl.NumberFormat.\n * Provide a `currency` attribute when `formatStyle` is `currency`, and a `unit` attribute when `formatStyle` is `unit`.\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-number\n * @slot - Numeric string to format (such as 1234567 or 1234.56). Serves as fallback before hydration.\n */\n@typeSSR()\nexport class FormatNumber extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-number',\n version: '0.0.0'\n };\n\n /**\n * Optional numeric string for values supplied by JavaScript or bound data.\n * By default, the component formats the element's text content, which also serves as the SSR fallback.\n * When both are present, this property takes precedence.\n */\n @property({ type: String }) number?: string;\n\n /**\n * Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default.\n */\n @property({ type: String }) locale?: string;\n\n /**\n * Formatting style: 'decimal' | 'currency' | 'percent' | 'unit'.\n */\n @property({ type: String, attribute: 'format-style' }) formatStyle: FormatNumberStyle = 'decimal';\n\n /**\n * ISO 4217 currency code (such as USD or EUR). Required when formatStyle is currency.\n */\n @property({ type: String }) currency?: string;\n\n /**\n * Currency sign style: 'standard' | 'accounting'.\n */\n @property({ type: String, attribute: 'currency-sign' }) currencySign?: CurrencySignOption;\n\n /**\n * Currency display style: 'symbol' | 'code' | 'name' | 'narrowSymbol'.\n */\n @property({ type: String, attribute: 'currency-display' }) currencyDisplay?: CurrencyDisplayOption;\n\n /**\n * Unit identifier (such as kilometer or byte). Required when formatStyle is unit.\n */\n @property({ type: String }) unit?: string;\n\n /**\n * Unit display style: 'short' | 'long' | 'narrow'.\n */\n @property({ type: String, attribute: 'unit-display' }) unitDisplay?: UnitDisplayOption;\n\n /**\n * Number notation: 'standard' | 'scientific' | 'engineering' | 'compact'.\n */\n @property({ type: String }) notation?: NotationOption;\n\n /**\n * Compact notation display: 'short' | 'long'. Only applies when notation is compact.\n */\n @property({ type: String, attribute: 'compact-display' }) compactDisplay?: CompactDisplayOption;\n\n /**\n * Sign display: 'auto' | 'never' | 'always' | 'exceptZero'.\n */\n @property({ type: String, attribute: 'sign-display' }) signDisplay?: SignDisplayOption;\n\n /**\n * Grouping separators: 'auto' | 'always' | 'min2' | 'true' | 'false'.\n */\n @property({ type: String, attribute: 'use-grouping' }) useGrouping?: string;\n\n /**\n * Pad fraction output to at least this many digits (0-20).\n */\n @property({ type: Number, attribute: 'minimum-fraction-digits' }) minimumFractionDigits?: number;\n\n /**\n * Round fraction output to at most this many digits (0-20).\n */\n @property({ type: Number, attribute: 'maximum-fraction-digits' }) maximumFractionDigits?: number;\n\n /**\n * Pad integer output to at least this many digits (1-21).\n */\n @property({ type: Number, attribute: 'minimum-integer-digits' }) minimumIntegerDigits?: number;\n\n get #rawValue(): string {\n return this.number ?? this.textContent?.trim() ?? '';\n }\n\n get #resolvedLocale(): string | undefined {\n return this.locale ?? (globalThis.document?.documentElement?.lang || undefined);\n }\n\n get #parsedNumber(): number | null {\n const raw = this.#rawValue;\n if (!raw) return null;\n\n const numericValue = Number(raw);\n if (Number.isFinite(numericValue)) return numericValue;\n\n LogService.warn(`format-number: invalid numeric value \"${raw}\"`);\n return null;\n }\n\n get #formatOptions(): Intl.NumberFormatOptions {\n const options: Intl.NumberFormatOptions = { style: this.formatStyle };\n\n for (const [prop, key] of STRING_KEYS) {\n const value = this[prop] as string | undefined;\n if (value !== undefined) (options as Record<string, unknown>)[key] = value;\n }\n\n for (const [prop, key] of NUMBER_KEYS) {\n const value = this[prop] as number | undefined;\n if (value !== undefined) (options as Record<string, unknown>)[key] = value;\n }\n\n if (this.useGrouping !== undefined) {\n const grouping = this.useGrouping === 'false' ? false : this.useGrouping === 'true' ? true : this.useGrouping;\n (options as Record<string, unknown>).useGrouping = grouping;\n }\n\n return options;\n }\n\n get #formattedNumber(): string {\n const raw = this.#rawValue;\n if (!raw) return '';\n\n const numericValue = this.#parsedNumber;\n if (numericValue === null) return raw;\n\n try {\n return new Intl.NumberFormat(this.#resolvedLocale, this.#formatOptions).format(numericValue);\n } catch (e) {\n LogService.warn(`format-number: ${(e as Error).message}`);\n return raw;\n }\n }\n\n render() {\n return html`<data internal-host value=${this.#rawValue}>${this.#formattedNumber}<slot @slotchange=${this.#onSlotChange} hidden></slot></data>`;\n }\n\n #onSlotChange() {\n this.requestUpdate();\n }\n}\n"],"mappings":";;;;;;;;AAgBA,IAAM,IAA8C;CAClD,CAAC,YAAY,WAAW;CACxB,CAAC,mBAAmB,kBAAkB;CACtC,CAAC,gBAAgB,eAAe;CAChC,CAAC,YAAY,WAAW;CACxB,CAAC,kBAAkB,iBAAiB;CACpC,CAAC,QAAQ,OAAO;CAChB,CAAC,eAAe,cAAc;CAC9B,CAAC,eAAe,cAAA;CACjB,EAEK,IAA8C;CAClD,CAAC,yBAAyB,wBAAwB;CAClD,CAAC,yBAAyB,wBAAwB;CAClD,CAAC,wBAAwB,uBAAA;CAC1B,EAWM,IAAA,cAA2B,EAAW;;kCAuB6C;;;gBAtBxE,EAAU,CAAC,EAAO,CAAC;;;kBAER;GACzB,KAAK;GACL,SAAS;GACV;;CA+ED,
|
|
1
|
+
{"version":3,"file":"format-number2.js","names":["#rawValue","#resolvedLocale","#parsedNumber","#formatOptions","#formattedNumber","#onSlotChange"],"sources":["../../src/format-number/format-number.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { useStyles, typeSSR, LogService } from '@nvidia-elements/core/internal';\nimport styles from './format-number.css?inline';\n\nexport type FormatNumberStyle = 'decimal' | 'currency' | 'percent' | 'unit';\nexport type CurrencyDisplayOption = 'symbol' | 'code' | 'name' | 'narrowSymbol';\nexport type CurrencySignOption = 'standard' | 'accounting';\nexport type NotationOption = 'standard' | 'scientific' | 'engineering' | 'compact';\nexport type CompactDisplayOption = 'short' | 'long';\nexport type UnitDisplayOption = 'short' | 'long' | 'narrow';\nexport type SignDisplayOption = 'auto' | 'never' | 'always' | 'exceptZero';\n\nconst STRING_KEYS: [keyof FormatNumber, string][] = [\n ['currency', 'currency'],\n ['currencyDisplay', 'currencyDisplay'],\n ['currencySign', 'currencySign'],\n ['notation', 'notation'],\n ['compactDisplay', 'compactDisplay'],\n ['unit', 'unit'],\n ['unitDisplay', 'unitDisplay'],\n ['signDisplay', 'signDisplay']\n];\n\nconst NUMBER_KEYS: [keyof FormatNumber, string][] = [\n ['minimumFractionDigits', 'minimumFractionDigits'],\n ['maximumFractionDigits', 'maximumFractionDigits'],\n ['minimumIntegerDigits', 'minimumIntegerDigits']\n];\n\n/**\n * @element nve-format-number\n * @description A localized number formatter for currencies, percentages, units, and compact notation, backed by Intl.NumberFormat.\n * Provide a `currency` attribute when `formatStyle` is `currency`, and a `unit` attribute when `formatStyle` is `unit`.\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-number\n * @slot - Numeric string to format (such as 1234567 or 1234.56). Serves as fallback before hydration.\n */\n@typeSSR()\nexport class FormatNumber extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-number',\n version: '0.0.0'\n };\n\n /**\n * Optional numeric string for values supplied by JavaScript or bound data.\n * By default, the component formats the element's text content, which also serves as the SSR fallback.\n * When both are present, this property takes precedence.\n */\n @property({ type: String }) number?: string;\n\n /**\n * Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default.\n */\n @property({ type: String }) locale?: string;\n\n /**\n * Formatting style: 'decimal' | 'currency' | 'percent' | 'unit'.\n */\n @property({ type: String, attribute: 'format-style' }) formatStyle: FormatNumberStyle = 'decimal';\n\n /**\n * ISO 4217 currency code (such as USD or EUR). Required when formatStyle is currency.\n */\n @property({ type: String }) currency?: string;\n\n /**\n * Currency sign style: 'standard' | 'accounting'.\n */\n @property({ type: String, attribute: 'currency-sign' }) currencySign?: CurrencySignOption;\n\n /**\n * Currency display style: 'symbol' | 'code' | 'name' | 'narrowSymbol'.\n */\n @property({ type: String, attribute: 'currency-display' }) currencyDisplay?: CurrencyDisplayOption;\n\n /**\n * Unit identifier (such as kilometer or byte). Required when formatStyle is unit.\n */\n @property({ type: String }) unit?: string;\n\n /**\n * Unit display style: 'short' | 'long' | 'narrow'.\n */\n @property({ type: String, attribute: 'unit-display' }) unitDisplay?: UnitDisplayOption;\n\n /**\n * Number notation: 'standard' | 'scientific' | 'engineering' | 'compact'.\n */\n @property({ type: String }) notation?: NotationOption;\n\n /**\n * Compact notation display: 'short' | 'long'. Only applies when notation is compact.\n */\n @property({ type: String, attribute: 'compact-display' }) compactDisplay?: CompactDisplayOption;\n\n /**\n * Sign display: 'auto' | 'never' | 'always' | 'exceptZero'.\n */\n @property({ type: String, attribute: 'sign-display' }) signDisplay?: SignDisplayOption;\n\n /**\n * Grouping separators: 'auto' | 'always' | 'min2' | 'true' | 'false'.\n */\n @property({ type: String, attribute: 'use-grouping' }) useGrouping?: string;\n\n /**\n * Pad fraction output to at least this many digits (0-20).\n */\n @property({ type: Number, attribute: 'minimum-fraction-digits' }) minimumFractionDigits?: number;\n\n /**\n * Round fraction output to at most this many digits (0-20).\n */\n @property({ type: Number, attribute: 'maximum-fraction-digits' }) maximumFractionDigits?: number;\n\n /**\n * Pad integer output to at least this many digits (1-21).\n */\n @property({ type: Number, attribute: 'minimum-integer-digits' }) minimumIntegerDigits?: number;\n\n get #rawValue(): string {\n return this.number ?? this.textContent?.trim() ?? '';\n }\n\n get #resolvedLocale(): string | undefined {\n return this.locale ?? (globalThis.document?.documentElement?.lang || undefined);\n }\n\n get #parsedNumber(): number | null {\n const raw = this.#rawValue;\n if (!raw) return null;\n\n const numericValue = Number(raw);\n if (Number.isFinite(numericValue)) return numericValue;\n\n LogService.warn(`format-number: invalid numeric value \"${raw}\"`);\n return null;\n }\n\n get #formatOptions(): Intl.NumberFormatOptions {\n const options: Intl.NumberFormatOptions = { style: this.formatStyle };\n\n for (const [prop, key] of STRING_KEYS) {\n const value = this[prop] as string | undefined;\n if (value !== undefined) (options as Record<string, unknown>)[key] = value;\n }\n\n for (const [prop, key] of NUMBER_KEYS) {\n const value = this[prop] as number | undefined;\n if (value !== undefined) (options as Record<string, unknown>)[key] = value;\n }\n\n if (this.useGrouping !== undefined) {\n const grouping = this.useGrouping === 'false' ? false : this.useGrouping === 'true' ? true : this.useGrouping;\n (options as Record<string, unknown>).useGrouping = grouping;\n }\n\n return options;\n }\n\n get #formattedNumber(): string {\n const raw = this.#rawValue;\n if (!raw) return '';\n\n const numericValue = this.#parsedNumber;\n if (numericValue === null) return raw;\n\n try {\n return new Intl.NumberFormat(this.#resolvedLocale, this.#formatOptions).format(numericValue);\n } catch (e) {\n LogService.warn(`format-number: ${(e as Error).message}`);\n return raw;\n }\n }\n\n render() {\n return html`<data internal-host value=${this.#rawValue}>${this.#formattedNumber}<slot @slotchange=${this.#onSlotChange} hidden></slot></data>`;\n }\n\n #onSlotChange() {\n this.requestUpdate();\n }\n}\n"],"mappings":";;;;;;;;AAgBA,IAAM,IAA8C;CAClD,CAAC,YAAY,WAAW;CACxB,CAAC,mBAAmB,kBAAkB;CACtC,CAAC,gBAAgB,eAAe;CAChC,CAAC,YAAY,WAAW;CACxB,CAAC,kBAAkB,iBAAiB;CACpC,CAAC,QAAQ,OAAO;CAChB,CAAC,eAAe,cAAc;CAC9B,CAAC,eAAe,cAAA;CACjB,EAEK,IAA8C;CAClD,CAAC,yBAAyB,wBAAwB;CAClD,CAAC,yBAAyB,wBAAwB;CAClD,CAAC,wBAAwB,uBAAA;CAC1B,EAWM,IAAA,cAA2B,EAAW;;kCAuB6C;;;gBAtBxE,EAAU,CAAC,EAAO,CAAC;;;kBAER;GACzB,KAAK;GACL,SAAS;GACV;;CA+ED,IAAIA,KAAoB;EACtB,OAAO,KAAK,UAAU,KAAK,aAAa,MAAM,IAAI;;CAGpD,IAAIC,KAAsC;EACxC,OAAO,KAAK,WAAW,WAAW,UAAU,iBAAiB,QAAQ,KAAA;;CAGvE,IAAIC,KAA+B;EACjC,IAAM,IAAM,KAAKF;EACjB,IAAI,CAAC,GAAK,OAAO;EAEjB,IAAM,IAAe,OAAO,EAAI;EAIhC,OAHI,OAAO,SAAS,EAAa,GAAS,KAE1C,EAAW,KAAK,yCAAyC,EAAI,GAAG,EACzD;;CAGT,IAAIG,KAA2C;EAC7C,IA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KtD,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAoB,CAAC,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA,KAKzD,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAK1B,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAgB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAKrD,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAK1B,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAmB,CAAC,CAAA,EAAA,EAAA,WAAA,kBAAA,KAAA,EAAA,KAKxD,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAgB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAKrD,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAgB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAKrD,EAAS;CAAE,MAAM;CAAQ,WAAW;CAA2B,CAAC,CAAA,EAAA,EAAA,WAAA,yBAAA,KAAA,EAAA,KAKhE,EAAS;CAAE,MAAM;CAAQ,WAAW;CAA2B,CAAC,CAAA,EAAA,EAAA,WAAA,yBAAA,KAAA,EAAA,KAKhE,EAAS;CAAE,MAAM;CAAQ,WAAW;CAA0B,CAAC,CAAA,EAAA,EAAA,WAAA,wBAAA,KAAA,EAAA,SApFjE,GAAS,CAAA,EAAA,EAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogService as e } from "../internal/services/log.service.js";
|
|
2
|
-
import { __decorate as t } from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import { __decorate as t } from "../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorate.js";
|
|
3
3
|
import { typeSSR as n } from "../internal/controllers/type-ssr.controller.js";
|
|
4
4
|
import { useStyles as r } from "../internal/styles/index.js";
|
|
5
5
|
import i from "./format-relative-time.js";
|
|
@@ -53,7 +53,7 @@ var c = {
|
|
|
53
53
|
static {
|
|
54
54
|
this.metadata = {
|
|
55
55
|
tag: "nve-format-relative-time",
|
|
56
|
-
version: "0.1.
|
|
56
|
+
version: "0.1.1"
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
#e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-relative-time2.js","names":["#dateValue","#resolvedLocale","#computeUnit","#computeExplicitUnit","#formattedRelativeTime","#resolveValueAndUnit","#stopSync","#timer","#startSync","#getSyncInterval","#onSlotChange"],"sources":["../../src/format-relative-time/format-relative-time.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { useStyles, typeSSR, LogService } from '@nvidia-elements/core/internal';\nimport styles from './format-relative-time.css?inline';\n\ntype TimeUnitOption = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';\n\nconst UNIT_DIVISORS: Record<TimeUnitOption, number> = {\n second: 1000,\n minute: 60000,\n hour: 3600000,\n day: 86400000,\n week: 604800000,\n month: 2592000000,\n year: 31536000000\n};\n\nconst THRESHOLDS: { unit: TimeUnitOption; max: number }[] = [\n { unit: 'second', max: 60 },\n { unit: 'minute', max: 60 },\n { unit: 'hour', max: 24 },\n { unit: 'day', max: 7 },\n { unit: 'week', max: 4 },\n { unit: 'month', max: 12 },\n { unit: 'year', max: Number.POSITIVE_INFINITY }\n];\n\n/**\n * @element nve-format-relative-time\n * @description Formats a date/time value as localized relative text using the Intl.RelativeTimeFormat API. Renders inside a semantic time element.\n * Options mirror the Intl.RelativeTimeFormat API. When unit is 'auto', the component selects the best unit based on the time difference.\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-relative-time\n * @slot - Date string to format (such as 2023-07-28T04:20:17.434Z). Serves as fallback before hydration.\n */\n@typeSSR()\nexport class FormatRelativeTime extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-relative-time',\n version: '0.0.0'\n };\n\n /**\n * Optional date string for values supplied by JavaScript or bound data.\n * By default, the component formats the element's text content, which also serves as the SSR fallback.\n * When both are present, this property takes precedence.\n */\n @property({ type: String }) date?: string;\n\n /**\n * Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default.\n */\n @property({ type: String }) locale?: string;\n\n /**\n * Numeric formatting: 'always' | 'auto'. When 'auto', enables natural language forms such as 'yesterday' instead of '1 day ago'.\n */\n @property({ type: String }) numeric: 'always' | 'auto' = 'always';\n\n /**\n * Formatting length: 'long' | 'short' | 'narrow'. Controls verbosity (such as '3 days ago' vs '3d ago'). Maps to Intl.RelativeTimeFormat style option.\n */\n @property({ type: String, attribute: 'format-style' }) formatStyle: 'long' | 'short' | 'narrow' = 'long';\n\n /**\n * Time unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' | 'auto'. Use 'auto' to let the component select the most appropriate unit based on the time difference.\n */\n @property({ type: String }) unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' | 'auto' = 'auto';\n\n /**\n * When present, auto-updates the displayed relative time at appropriate intervals.\n */\n @property({ type: Boolean }) sync = false;\n\n #timer?: ReturnType<typeof setTimeout>;\n\n get #dateValue(): string {\n return this.date ?? this.textContent?.trim() ?? '';\n }\n\n get #resolvedLocale(): string | undefined {\n return this.locale ?? (globalThis.document?.documentElement?.lang || undefined);\n }\n\n #computeUnit(diffMs: number): { value: number; unit: Intl.RelativeTimeFormatUnit } {\n const absDiff = Math.abs(diffMs);\n const sign = diffMs < 0 ? -1 : 1;\n\n for (const { unit, max } of THRESHOLDS) {\n const value = Math.round(absDiff / UNIT_DIVISORS[unit]);\n if (value < max) return { value: sign * value, unit };\n }\n throw new Error('format-relative-time: no relative time threshold matched');\n }\n\n #computeExplicitUnit(diffMs: number, unit: TimeUnitOption): number {\n return Math.round(diffMs / UNIT_DIVISORS[unit]);\n }\n\n #resolveValueAndUnit(diffMs: number): { value: number; unit: Intl.RelativeTimeFormatUnit } {\n if (this.unit === 'auto') {\n return this.#computeUnit(diffMs);\n }\n return { unit: this.unit, value: this.#computeExplicitUnit(diffMs, this.unit) };\n }\n\n get #formattedRelativeTime(): string {\n const iso = this.#dateValue;\n if (!iso) return '';\n\n const target = new Date(iso);\n if (isNaN(target.getTime())) {\n LogService.warn(`format-relative-time: invalid date value \"${iso}\"`);\n return iso;\n }\n\n const { value, unit: resolvedUnit } = this.#resolveValueAndUnit(target.getTime() - Date.now());\n\n try {\n return new Intl.RelativeTimeFormat(this.#resolvedLocale, {\n numeric: this.numeric,\n style: this.formatStyle\n }).format(value, resolvedUnit);\n } catch (e) {\n LogService.warn(`format-relative-time: ${(e as Error).message}`);\n return iso;\n }\n }\n\n #getSyncInterval(): number {\n const iso = this.#dateValue;\n if (!iso) return 60000;\n\n const absDiff = Math.abs(new Date(iso).getTime() - Date.now());\n if (absDiff < 60000) return 10000;\n if (absDiff < 3600000) return 30000;\n if (absDiff < 86400000) return 300000;\n return 3600000;\n }\n\n #startSync() {\n this.#stopSync();\n if (!this.sync) return;\n\n this.#timer = setTimeout(() => {\n this.requestUpdate();\n this.#startSync();\n }, this.#getSyncInterval());\n }\n\n #stopSync() {\n if (this.#timer !== undefined) {\n clearTimeout(this.#timer);\n this.#timer = undefined;\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.sync) this.#startSync();\n }\n\n disconnectedCallback() {\n this.#stopSync();\n super.disconnectedCallback();\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('sync')) {\n if (this.sync) {\n this.#startSync();\n } else {\n this.#stopSync();\n }\n }\n }\n\n render() {\n return html`<time internal-host datetime=${this.#dateValue}>${this.#formattedRelativeTime}<slot @slotchange=${this.#onSlotChange} hidden></slot></time>`;\n }\n\n #onSlotChange() {\n this.requestUpdate();\n }\n}\n"],"mappings":";;;;;;;;AAUA,IAAM,IAAgD;CACpD,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;CACP,EAEK,IAAsD;CAC1D;EAAE,MAAM;EAAU,KAAK;EAAI;CAC3B;EAAE,MAAM;EAAU,KAAK;EAAI;CAC3B;EAAE,MAAM;EAAQ,KAAK;EAAI;CACzB;EAAE,MAAM;EAAO,KAAK;EAAG;CACvB;EAAE,MAAM;EAAQ,KAAK;EAAG;CACxB;EAAE,MAAM;EAAS,KAAK;EAAI;CAC1B;EAAE,MAAM;EAAQ,KAAK;;CACtB,EAWM,IAAA,cAAiC,EAAW;;8BAuBQ,6BAKyC,oBAKY,oBAK1E;;;gBArCpB,EAAU,CAAC,EAAO,CAAC;;;kBAER;GACzB,KAAK;GACL,SAAS;GACV;;CAkCD;CAEA,
|
|
1
|
+
{"version":3,"file":"format-relative-time2.js","names":["#dateValue","#resolvedLocale","#computeUnit","#computeExplicitUnit","#formattedRelativeTime","#resolveValueAndUnit","#stopSync","#timer","#startSync","#getSyncInterval","#onSlotChange"],"sources":["../../src/format-relative-time/format-relative-time.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { useStyles, typeSSR, LogService } from '@nvidia-elements/core/internal';\nimport styles from './format-relative-time.css?inline';\n\ntype TimeUnitOption = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';\n\nconst UNIT_DIVISORS: Record<TimeUnitOption, number> = {\n second: 1000,\n minute: 60000,\n hour: 3600000,\n day: 86400000,\n week: 604800000,\n month: 2592000000,\n year: 31536000000\n};\n\nconst THRESHOLDS: { unit: TimeUnitOption; max: number }[] = [\n { unit: 'second', max: 60 },\n { unit: 'minute', max: 60 },\n { unit: 'hour', max: 24 },\n { unit: 'day', max: 7 },\n { unit: 'week', max: 4 },\n { unit: 'month', max: 12 },\n { unit: 'year', max: Number.POSITIVE_INFINITY }\n];\n\n/**\n * @element nve-format-relative-time\n * @description Formats a date/time value as localized relative text using the Intl.RelativeTimeFormat API. Renders inside a semantic time element.\n * Options mirror the Intl.RelativeTimeFormat API. When unit is 'auto', the component selects the best unit based on the time difference.\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/format-relative-time\n * @slot - Date string to format (such as 2023-07-28T04:20:17.434Z). Serves as fallback before hydration.\n */\n@typeSSR()\nexport class FormatRelativeTime extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-format-relative-time',\n version: '0.0.0'\n };\n\n /**\n * Optional date string for values supplied by JavaScript or bound data.\n * By default, the component formats the element's text content, which also serves as the SSR fallback.\n * When both are present, this property takes precedence.\n */\n @property({ type: String }) date?: string;\n\n /**\n * Language tag (such as en-US, de-DE). Defaults to document.documentElement.lang or browser default.\n */\n @property({ type: String }) locale?: string;\n\n /**\n * Numeric formatting: 'always' | 'auto'. When 'auto', enables natural language forms such as 'yesterday' instead of '1 day ago'.\n */\n @property({ type: String }) numeric: 'always' | 'auto' = 'always';\n\n /**\n * Formatting length: 'long' | 'short' | 'narrow'. Controls verbosity (such as '3 days ago' vs '3d ago'). Maps to Intl.RelativeTimeFormat style option.\n */\n @property({ type: String, attribute: 'format-style' }) formatStyle: 'long' | 'short' | 'narrow' = 'long';\n\n /**\n * Time unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' | 'auto'. Use 'auto' to let the component select the most appropriate unit based on the time difference.\n */\n @property({ type: String }) unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' | 'auto' = 'auto';\n\n /**\n * When present, auto-updates the displayed relative time at appropriate intervals.\n */\n @property({ type: Boolean }) sync = false;\n\n #timer?: ReturnType<typeof setTimeout>;\n\n get #dateValue(): string {\n return this.date ?? this.textContent?.trim() ?? '';\n }\n\n get #resolvedLocale(): string | undefined {\n return this.locale ?? (globalThis.document?.documentElement?.lang || undefined);\n }\n\n #computeUnit(diffMs: number): { value: number; unit: Intl.RelativeTimeFormatUnit } {\n const absDiff = Math.abs(diffMs);\n const sign = diffMs < 0 ? -1 : 1;\n\n for (const { unit, max } of THRESHOLDS) {\n const value = Math.round(absDiff / UNIT_DIVISORS[unit]);\n if (value < max) return { value: sign * value, unit };\n }\n throw new Error('format-relative-time: no relative time threshold matched');\n }\n\n #computeExplicitUnit(diffMs: number, unit: TimeUnitOption): number {\n return Math.round(diffMs / UNIT_DIVISORS[unit]);\n }\n\n #resolveValueAndUnit(diffMs: number): { value: number; unit: Intl.RelativeTimeFormatUnit } {\n if (this.unit === 'auto') {\n return this.#computeUnit(diffMs);\n }\n return { unit: this.unit, value: this.#computeExplicitUnit(diffMs, this.unit) };\n }\n\n get #formattedRelativeTime(): string {\n const iso = this.#dateValue;\n if (!iso) return '';\n\n const target = new Date(iso);\n if (isNaN(target.getTime())) {\n LogService.warn(`format-relative-time: invalid date value \"${iso}\"`);\n return iso;\n }\n\n const { value, unit: resolvedUnit } = this.#resolveValueAndUnit(target.getTime() - Date.now());\n\n try {\n return new Intl.RelativeTimeFormat(this.#resolvedLocale, {\n numeric: this.numeric,\n style: this.formatStyle\n }).format(value, resolvedUnit);\n } catch (e) {\n LogService.warn(`format-relative-time: ${(e as Error).message}`);\n return iso;\n }\n }\n\n #getSyncInterval(): number {\n const iso = this.#dateValue;\n if (!iso) return 60000;\n\n const absDiff = Math.abs(new Date(iso).getTime() - Date.now());\n if (absDiff < 60000) return 10000;\n if (absDiff < 3600000) return 30000;\n if (absDiff < 86400000) return 300000;\n return 3600000;\n }\n\n #startSync() {\n this.#stopSync();\n if (!this.sync) return;\n\n this.#timer = setTimeout(() => {\n this.requestUpdate();\n this.#startSync();\n }, this.#getSyncInterval());\n }\n\n #stopSync() {\n if (this.#timer !== undefined) {\n clearTimeout(this.#timer);\n this.#timer = undefined;\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.sync) this.#startSync();\n }\n\n disconnectedCallback() {\n this.#stopSync();\n super.disconnectedCallback();\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('sync')) {\n if (this.sync) {\n this.#startSync();\n } else {\n this.#stopSync();\n }\n }\n }\n\n render() {\n return html`<time internal-host datetime=${this.#dateValue}>${this.#formattedRelativeTime}<slot @slotchange=${this.#onSlotChange} hidden></slot></time>`;\n }\n\n #onSlotChange() {\n this.requestUpdate();\n }\n}\n"],"mappings":";;;;;;;;AAUA,IAAM,IAAgD;CACpD,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,KAAK;CACL,MAAM;CACN,OAAO;CACP,MAAM;CACP,EAEK,IAAsD;CAC1D;EAAE,MAAM;EAAU,KAAK;EAAI;CAC3B;EAAE,MAAM;EAAU,KAAK;EAAI;CAC3B;EAAE,MAAM;EAAQ,KAAK;EAAI;CACzB;EAAE,MAAM;EAAO,KAAK;EAAG;CACvB;EAAE,MAAM;EAAQ,KAAK;EAAG;CACxB;EAAE,MAAM;EAAS,KAAK;EAAI;CAC1B;EAAE,MAAM;EAAQ,KAAK;;CACtB,EAWM,IAAA,cAAiC,EAAW;;8BAuBQ,6BAKyC,oBAKY,oBAK1E;;;gBArCpB,EAAU,CAAC,EAAO,CAAC;;;kBAER;GACzB,KAAK;GACL,SAAS;GACV;;CAkCD;CAEA,IAAIA,KAAqB;EACvB,OAAO,KAAK,QAAQ,KAAK,aAAa,MAAM,IAAI;;CAGlD,IAAIC,KAAsC;EACxC,OAAO,KAAK,WAAW,WAAW,UAAU,iBAAiB,QAAQ,KAAA;;CAGvE,GAAa,GAAsE;EACjF,IAAM,IAAU,KAAK,IAAI,EAAO,EAC1B,IAAO,IAAS,IAAI,KAAK;EAE/B,KAAK,IAAM,EAAE,SAAM,YAAS,GAAY;GACtC,IAAM,IAAQ,KAAK,MAAM,IAAU,EAAc,GAAM;GACvD,IAAI,IAAQ,GAA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AA;;CAIlB,oBAAoB;EAElB,AADA,MAAM,mBAAmB,EACrB,KAAK,QAAM,KAAKC,IAAY;;CAGlC,uBAAuB;EAErB,AADA,KAAKF,IAAW,EAChB,MAAM,sBAAsB;;CAG9B,QAAQ,GAA+B;EACrC,AAAI,EAAQ,IAAI,OAAO,KACjB,KAAK,OACP,KAAKE,IAAY,GAEjB,KAAKF,IAAW;;CAKtB,SAAS;EACP,OAAO,CAAI,iCAAgC,KAAKN,GAAW,IAAG,KAAKI,GAAuB,qBAAoB,KAAKM,GAAc;;CAGnI,KAAgB;EACd,KAAK,eAAe;;;GAvIrB,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAK1B,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,UAAA,KAAA,EAAA,KAK1B,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,KAK1B,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAgB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAKrD,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAK1B,EAAS,EAAE,MAAM,SAAS,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,SAvC7B,GAAS,CAAA,EAAA,EAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { appendRootNodeStyle as e, getAttributeListChanges as t } from "../../internal/utils/dom.js";
|
|
2
2
|
import { associateAriaDescribedBy as n, associateDataList as r, associateLabel as i, attachInternals as a } from "../../internal/utils/a11y.js";
|
|
3
|
-
import { __decorate as o } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate as o } from "../../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorate.js";
|
|
4
4
|
import { I18nController as s } from "../../internal/controllers/i18n.controller.js";
|
|
5
5
|
import { typeSSR as c } from "../../internal/controllers/type-ssr.controller.js";
|
|
6
6
|
import { hostAttr as l } from "../../internal/decorators/host-attr.js";
|
|
@@ -14,9 +14,15 @@ import { property as S } from "lit/decorators/property.js";
|
|
|
14
14
|
//#region src/forms/control/control.ts
|
|
15
15
|
var C = class extends v {
|
|
16
16
|
constructor(...e) {
|
|
17
|
-
super(...e), this.fitText = !1, this.fitContent = !1, this.i18n = this.#e.i18n, this.nveControl = "", this._associateDatalist = !0
|
|
17
|
+
super(...e), this.fitText = !1, this.fitContent = !1, this.#e = new s(this), this.i18n = this.#e.i18n, this.nveControl = "", this.#i = [], this._associateDatalist = !0, this.#a = () => {
|
|
18
|
+
this.#f(), this.input && this.#i.length === 0 && (this.#o(), this.#c());
|
|
19
|
+
}, this.#s = () => {
|
|
20
|
+
this.#f(), this.#p();
|
|
21
|
+
}, this.#l = () => {
|
|
22
|
+
this.#u();
|
|
23
|
+
};
|
|
18
24
|
}
|
|
19
|
-
#e
|
|
25
|
+
#e;
|
|
20
26
|
get #t() {
|
|
21
27
|
return this.shadowRoot?.querySelector("slot[name=\"label\"]")?.assignedElements({ flatten: !0 })?.[0];
|
|
22
28
|
}
|
|
@@ -25,7 +31,11 @@ var C = class extends v {
|
|
|
25
31
|
}
|
|
26
32
|
#r;
|
|
27
33
|
get input() {
|
|
28
|
-
|
|
34
|
+
if (!b && !this.#r) {
|
|
35
|
+
let e = this.querySelector("slot")?.assignedElements()?.find((e) => e.matches("input, select, selectmenu, textarea, [nve-control]")) ?? Array.from(this.shadowRoot.querySelector("slot")?.assignedElements({ flatten: !0 }) ?? []).find((e) => e.matches("input, select, selectmenu, textarea, [nve-control]"));
|
|
36
|
+
this.#r = e || this.querySelector(d);
|
|
37
|
+
}
|
|
38
|
+
return this.#r;
|
|
29
39
|
}
|
|
30
40
|
get prefixContent() {
|
|
31
41
|
return x;
|
|
@@ -33,14 +43,14 @@ var C = class extends v {
|
|
|
33
43
|
get suffixContent() {
|
|
34
44
|
return x;
|
|
35
45
|
}
|
|
36
|
-
#i
|
|
46
|
+
#i;
|
|
37
47
|
static {
|
|
38
48
|
this.styles = u([_]);
|
|
39
49
|
}
|
|
40
50
|
static {
|
|
41
51
|
this.metadata = {
|
|
42
52
|
tag: "nve-control",
|
|
43
|
-
version: "0.1.
|
|
53
|
+
version: "0.1.1"
|
|
44
54
|
};
|
|
45
55
|
}
|
|
46
56
|
render() {
|
|
@@ -52,9 +62,7 @@ var C = class extends v {
|
|
|
52
62
|
disconnectedCallback() {
|
|
53
63
|
super.disconnectedCallback(), this.shadowRoot.removeEventListener("slotchange", this.#a), this.shadowRoot.removeEventListener("slotchange", this.#s), this.fitText && this.input && (this.input.removeEventListener("input", this.#l), this.input.removeEventListener("change", this.#l)), this.#i.forEach((e) => e.disconnect()), this.#i.length = 0;
|
|
54
64
|
}
|
|
55
|
-
#a
|
|
56
|
-
this.#f(), this.input && this.#i.length === 0 && (this.#o(), this.#c());
|
|
57
|
-
};
|
|
65
|
+
#a;
|
|
58
66
|
reset() {
|
|
59
67
|
this.input.value = this.input.getAttribute("value") ?? "", this.requestUpdate(), this.dispatchEvent(new CustomEvent("reset", {
|
|
60
68
|
bubbles: !0,
|
|
@@ -64,15 +72,11 @@ var C = class extends v {
|
|
|
64
72
|
#o() {
|
|
65
73
|
m(this, this.#n), this.#i.push(...f(this), ...p(this, this.#n), h(this), t(this, ["hidden", "status"], () => this.#f())), this.#d(), this.#p(), this.shadowRoot.addEventListener("slotchange", this.#s);
|
|
66
74
|
}
|
|
67
|
-
#s
|
|
68
|
-
this.#f(), this.#p();
|
|
69
|
-
};
|
|
75
|
+
#s;
|
|
70
76
|
#c() {
|
|
71
77
|
this.fitText && (this.#u(), this.input.addEventListener("input", this.#l), this.input.addEventListener("change", this.#l));
|
|
72
78
|
}
|
|
73
|
-
#l
|
|
74
|
-
this.#u();
|
|
75
|
-
};
|
|
79
|
+
#l;
|
|
76
80
|
#u() {
|
|
77
81
|
if (this.input.tagName === "INPUT") {
|
|
78
82
|
let e = this.input.type === "text" ? 0 : 4;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control2.js","names":["#i18nController","#label","#messages","#input","#onRootSlotchange","#onInputSlotchange","#onFitTextUpdate","#observers","#updateStyleStates","#setupInput","#setupFitText","#polyfillShowPicker","#updateAssociations","#getCharacterWidth","#assignLabel"],"sources":["../../../src/forms/control/control.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TemplateResult } from 'lit';\nimport { LitElement, html, nothing, isServer } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport {\n attachInternals,\n useStyles,\n associateLabel,\n associateAriaDescribedBy,\n associateDataList,\n appendRootNodeStyle,\n getAttributeListChanges,\n I18nController,\n hostAttr,\n typeSSR\n} from '@nvidia-elements/core/internal';\nimport type { ControlMessage } from '../control-message/control-message.js';\nimport {\n setupControlValidationStates,\n setupControlStates,\n setupControlStatusStates,\n inputQuery\n} from '../utils/states.js';\nimport { setupControlLayoutStates } from '../utils/layout.js';\nimport globalStyles from './control.global.css?inline';\nimport styles from './control.css?inline';\n\n/**\n * @element nve-control\n * @description Wraps a form input with its associated label and validation messages, managing layout and accessibility associations.\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/forms\n * @slot - Control input element\n * @slot label - Label element\n * @cssprop --cursor\n * @cssprop --accent-color\n * @cssprop --color\n * @cssprop --label-color\n * @cssprop --label-width\n * @cssprop --label-font-weight\n * @cssprop --label-font-size\n * @cssprop --control-width\n * @cssprop --control-height\n\n * @aria https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals\n * @package true\n */\n@typeSSR()\nexport class Control extends LitElement {\n /** Set current visual state for control. This overrides any validation states active. */\n @property({ type: String }) status: 'warning' | 'error' | 'success' | 'disabled';\n\n /** Set current control + label + control message layout. Layouts will collapse based on available container space. */\n @property({ type: String, reflect: true }) layout:\n | 'vertical'\n | 'vertical-inline'\n | 'horizontal'\n | 'horizontal-inline';\n\n /** Sets the input to match the width of the active text content of the control value. Only applicable to vertical input box type controls (input, select) */\n @property({ type: Boolean, reflect: true, attribute: 'fit-text' }) fitText = false;\n\n /** Sets the input to match native default content block */\n @property({ type: Boolean, reflect: true, attribute: 'fit-content' }) fitContent = false;\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n /** Enables internal string values to update for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /** Set the visual prominence of the control */\n @property({ type: String, reflect: true }) prominence: 'muted';\n\n get #label() {\n return this.shadowRoot\n ?.querySelector<HTMLSlotElement>('slot[name=\"label\"]')\n ?.assignedElements({ flatten: true })?.[0] as HTMLLabelElement;\n }\n\n get #messages() {\n return (this.shadowRoot\n ?.querySelector<HTMLSlotElement>('slot[name=\"messages\"]')\n ?.assignedElements({ flatten: true }) ?? []) as ControlMessage[];\n }\n\n #input: HTMLInputElement;\n\n /** @private */\n get input(): HTMLInputElement {\n if (!isServer && !this.#input) {\n const slotted =\n this.querySelector('slot')\n ?.assignedElements()\n ?.find(i => i.matches(inputQuery)) ??\n Array.from(this.shadowRoot!.querySelector('slot')?.assignedElements({ flatten: true }) ?? []).find(i =>\n i.matches(inputQuery)\n );\n this.#input = (slotted ? slotted : this.querySelector(inputQuery)) as HTMLInputElement;\n }\n\n return this.#input;\n }\n\n /** @private */\n protected get prefixContent(): typeof nothing | TemplateResult {\n return nothing;\n }\n\n /** @private */\n protected get suffixContent(): typeof nothing | TemplateResult {\n return nothing;\n }\n\n @hostAttr({ attribute: 'nve-control' }) protected nveControl = '';\n\n /** @private */\n declare _internals: ElementInternals;\n\n #observers: (MutationObserver | ResizeObserver)[] = [];\n\n protected _associateDatalist = true;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-control',\n version: '0.0.0'\n };\n\n render() {\n return this.nveControl !== 'inline'\n ? html`\n <div internal-host part=\"_internal-host\">\n <slot name=\"label\" part=\"_label\"></slot>\n <div input part=\"_input\">\n ${this.prefixContent}\n <slot></slot>\n ${this.suffixContent}\n </div>\n <slot name=\"messages\" part=\"_messages\"></slot>\n </div>\n `\n : html`\n <div internal-host part=\"_internal-host\">\n <div input part=\"_input\"><slot interaction-state></slot></div>\n <slot name=\"label\" part=\"_label\"></slot>\n <slot name=\"messages\" part=\"_messages\"></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n appendRootNodeStyle(this, globalStyles);\n this.shadowRoot!.addEventListener('slotchange', this.#onRootSlotchange);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.shadowRoot!.removeEventListener('slotchange', this.#onRootSlotchange);\n this.shadowRoot!.removeEventListener('slotchange', this.#onInputSlotchange);\n if (this.fitText && this.input) {\n this.input.removeEventListener('input', this.#onFitTextUpdate);\n this.input.removeEventListener('change', this.#onFitTextUpdate);\n }\n this.#observers.forEach(observer => observer.disconnect());\n this.#observers.length = 0;\n }\n\n #onRootSlotchange = () => {\n this.#updateStyleStates();\n\n if (this.input && this.#observers.length === 0) {\n this.#setupInput();\n this.#setupFitText();\n }\n };\n\n /** Resets control value to initial attribute value and clears any active validation rules. */\n reset() {\n this.input.value = this.input.getAttribute('value') ?? '';\n this.requestUpdate();\n this.dispatchEvent(new CustomEvent('reset', { bubbles: true, composed: true }));\n }\n\n #setupInput() {\n setupControlValidationStates(this, this.#messages);\n\n this.#observers.push(\n ...setupControlStates(this),\n ...setupControlStatusStates(this, this.#messages),\n setupControlLayoutStates(this),\n getAttributeListChanges(this, ['hidden', 'status'], () => this.#updateStyleStates())\n );\n\n this.#polyfillShowPicker();\n this.#updateAssociations();\n this.shadowRoot!.addEventListener('slotchange', this.#onInputSlotchange);\n }\n\n #onInputSlotchange = () => {\n this.#updateStyleStates();\n this.#updateAssociations();\n };\n\n #setupFitText() {\n if (this.fitText) {\n this.#getCharacterWidth();\n this.input.addEventListener('input', this.#onFitTextUpdate);\n this.input.addEventListener('change', this.#onFitTextUpdate);\n }\n }\n\n #onFitTextUpdate = () => {\n this.#getCharacterWidth();\n };\n\n #getCharacterWidth() {\n if (this.input.tagName === 'INPUT') {\n const offset = this.input.type !== 'text' ? 4 : 0;\n this.style.setProperty('--control-width', `${this.input.value.length + offset}ch`);\n this.input.style.setProperty('max-width', `${this.input.value.length + 2}ch`, 'important');\n } else if (this.input.tagName === 'SELECT') {\n this.style.setProperty(\n '--control-width',\n `${(this.input as unknown as HTMLSelectElement).options[(this.input as unknown as HTMLSelectElement).selectedIndex]!.textContent!.length + 4}ch`\n );\n }\n }\n\n #polyfillShowPicker() {\n if (!this.input.showPicker) {\n this.input.showPicker = () => this.input.focus();\n }\n }\n\n #updateStyleStates() {\n if (this.input) {\n this.toggleAttribute('multiple', this.input?.multiple);\n this.input?.hasAttribute('size') ? this.setAttribute('size', '') : this.removeAttribute('size');\n }\n }\n\n #updateAssociations() {\n this.#assignLabel();\n associateLabel(this.#label, this.input);\n associateAriaDescribedBy(Array.from(this.#messages), this.input);\n\n if (this._associateDatalist) {\n associateDataList(this.querySelector<HTMLDataListElement>('datalist')!, this.input);\n }\n }\n\n #assignLabel() {\n const label =\n this.querySelector('label') ||\n (this.shadowRoot!.querySelector('slot')!\n .assignedNodes({ flatten: true })\n .find((i: Node) => (i as HTMLElement).tagName === 'LABEL') as HTMLLabelElement);\n if (label) {\n label.slot = 'label';\n }\n }\n\n protected showPicker() {\n try {\n this.input.showPicker();\n } catch {\n //\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAkDO,IAAA,IAAA,cAAsB,EAAW;;8BAYuC,sBAGM,gBAKhD,MAAA,EAAqB,wBA6CO,8BAOhC;;CAvD/B,KAAwC,IAAI,EAAqB,KAAK;CAQtE,KAAA,IAAa;AACX,SAAO,KAAK,YACR,cAA+B,uBAAqB,EACpD,iBAAiB,EAAE,SAAS,IAAM,CAAC,GAAG;;CAG5C,KAAA,IAAgB;AACd,S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,EAAA,SAlExC,GAAS,CAAA,EAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"control2.js","names":["#i18nController","#updateStyleStates","#observers","#setupInput","#setupFitText","#updateAssociations","#getCharacterWidth","#label","#messages","#input","#onRootSlotchange","#onInputSlotchange","#onFitTextUpdate","#polyfillShowPicker","#assignLabel"],"sources":["../../../src/forms/control/control.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TemplateResult } from 'lit';\nimport { LitElement, html, nothing, isServer } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport {\n attachInternals,\n useStyles,\n associateLabel,\n associateAriaDescribedBy,\n associateDataList,\n appendRootNodeStyle,\n getAttributeListChanges,\n I18nController,\n hostAttr,\n typeSSR\n} from '@nvidia-elements/core/internal';\nimport type { ControlMessage } from '../control-message/control-message.js';\nimport {\n setupControlValidationStates,\n setupControlStates,\n setupControlStatusStates,\n inputQuery\n} from '../utils/states.js';\nimport { setupControlLayoutStates } from '../utils/layout.js';\nimport globalStyles from './control.global.css?inline';\nimport styles from './control.css?inline';\n\n/**\n * @element nve-control\n * @description Wraps a form input with its associated label and validation messages, managing layout and accessibility associations.\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/forms\n * @slot - Control input element\n * @slot label - Label element\n * @cssprop --cursor\n * @cssprop --accent-color\n * @cssprop --color\n * @cssprop --label-color\n * @cssprop --label-width\n * @cssprop --label-font-weight\n * @cssprop --label-font-size\n * @cssprop --control-width\n * @cssprop --control-height\n\n * @aria https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals\n * @package true\n */\n@typeSSR()\nexport class Control extends LitElement {\n /** Set current visual state for control. This overrides any validation states active. */\n @property({ type: String }) status: 'warning' | 'error' | 'success' | 'disabled';\n\n /** Set current control + label + control message layout. Layouts will collapse based on available container space. */\n @property({ type: String, reflect: true }) layout:\n | 'vertical'\n | 'vertical-inline'\n | 'horizontal'\n | 'horizontal-inline';\n\n /** Sets the input to match the width of the active text content of the control value. Only applicable to vertical input box type controls (input, select) */\n @property({ type: Boolean, reflect: true, attribute: 'fit-text' }) fitText = false;\n\n /** Sets the input to match native default content block */\n @property({ type: Boolean, reflect: true, attribute: 'fit-content' }) fitContent = false;\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n /** Enables internal string values to update for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /** Set the visual prominence of the control */\n @property({ type: String, reflect: true }) prominence: 'muted';\n\n get #label() {\n return this.shadowRoot\n ?.querySelector<HTMLSlotElement>('slot[name=\"label\"]')\n ?.assignedElements({ flatten: true })?.[0] as HTMLLabelElement;\n }\n\n get #messages() {\n return (this.shadowRoot\n ?.querySelector<HTMLSlotElement>('slot[name=\"messages\"]')\n ?.assignedElements({ flatten: true }) ?? []) as ControlMessage[];\n }\n\n #input: HTMLInputElement;\n\n /** @private */\n get input(): HTMLInputElement {\n if (!isServer && !this.#input) {\n const slotted =\n this.querySelector('slot')\n ?.assignedElements()\n ?.find(i => i.matches(inputQuery)) ??\n Array.from(this.shadowRoot!.querySelector('slot')?.assignedElements({ flatten: true }) ?? []).find(i =>\n i.matches(inputQuery)\n );\n this.#input = (slotted ? slotted : this.querySelector(inputQuery)) as HTMLInputElement;\n }\n\n return this.#input;\n }\n\n /** @private */\n protected get prefixContent(): typeof nothing | TemplateResult {\n return nothing;\n }\n\n /** @private */\n protected get suffixContent(): typeof nothing | TemplateResult {\n return nothing;\n }\n\n @hostAttr({ attribute: 'nve-control' }) protected nveControl = '';\n\n /** @private */\n declare _internals: ElementInternals;\n\n #observers: (MutationObserver | ResizeObserver)[] = [];\n\n protected _associateDatalist = true;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-control',\n version: '0.0.0'\n };\n\n render() {\n return this.nveControl !== 'inline'\n ? html`\n <div internal-host part=\"_internal-host\">\n <slot name=\"label\" part=\"_label\"></slot>\n <div input part=\"_input\">\n ${this.prefixContent}\n <slot></slot>\n ${this.suffixContent}\n </div>\n <slot name=\"messages\" part=\"_messages\"></slot>\n </div>\n `\n : html`\n <div internal-host part=\"_internal-host\">\n <div input part=\"_input\"><slot interaction-state></slot></div>\n <slot name=\"label\" part=\"_label\"></slot>\n <slot name=\"messages\" part=\"_messages\"></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n appendRootNodeStyle(this, globalStyles);\n this.shadowRoot!.addEventListener('slotchange', this.#onRootSlotchange);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.shadowRoot!.removeEventListener('slotchange', this.#onRootSlotchange);\n this.shadowRoot!.removeEventListener('slotchange', this.#onInputSlotchange);\n if (this.fitText && this.input) {\n this.input.removeEventListener('input', this.#onFitTextUpdate);\n this.input.removeEventListener('change', this.#onFitTextUpdate);\n }\n this.#observers.forEach(observer => observer.disconnect());\n this.#observers.length = 0;\n }\n\n #onRootSlotchange = () => {\n this.#updateStyleStates();\n\n if (this.input && this.#observers.length === 0) {\n this.#setupInput();\n this.#setupFitText();\n }\n };\n\n /** Resets control value to initial attribute value and clears any active validation rules. */\n reset() {\n this.input.value = this.input.getAttribute('value') ?? '';\n this.requestUpdate();\n this.dispatchEvent(new CustomEvent('reset', { bubbles: true, composed: true }));\n }\n\n #setupInput() {\n setupControlValidationStates(this, this.#messages);\n\n this.#observers.push(\n ...setupControlStates(this),\n ...setupControlStatusStates(this, this.#messages),\n setupControlLayoutStates(this),\n getAttributeListChanges(this, ['hidden', 'status'], () => this.#updateStyleStates())\n );\n\n this.#polyfillShowPicker();\n this.#updateAssociations();\n this.shadowRoot!.addEventListener('slotchange', this.#onInputSlotchange);\n }\n\n #onInputSlotchange = () => {\n this.#updateStyleStates();\n this.#updateAssociations();\n };\n\n #setupFitText() {\n if (this.fitText) {\n this.#getCharacterWidth();\n this.input.addEventListener('input', this.#onFitTextUpdate);\n this.input.addEventListener('change', this.#onFitTextUpdate);\n }\n }\n\n #onFitTextUpdate = () => {\n this.#getCharacterWidth();\n };\n\n #getCharacterWidth() {\n if (this.input.tagName === 'INPUT') {\n const offset = this.input.type !== 'text' ? 4 : 0;\n this.style.setProperty('--control-width', `${this.input.value.length + offset}ch`);\n this.input.style.setProperty('max-width', `${this.input.value.length + 2}ch`, 'important');\n } else if (this.input.tagName === 'SELECT') {\n this.style.setProperty(\n '--control-width',\n `${(this.input as unknown as HTMLSelectElement).options[(this.input as unknown as HTMLSelectElement).selectedIndex]!.textContent!.length + 4}ch`\n );\n }\n }\n\n #polyfillShowPicker() {\n if (!this.input.showPicker) {\n this.input.showPicker = () => this.input.focus();\n }\n }\n\n #updateStyleStates() {\n if (this.input) {\n this.toggleAttribute('multiple', this.input?.multiple);\n this.input?.hasAttribute('size') ? this.setAttribute('size', '') : this.removeAttribute('size');\n }\n }\n\n #updateAssociations() {\n this.#assignLabel();\n associateLabel(this.#label, this.input);\n associateAriaDescribedBy(Array.from(this.#messages), this.input);\n\n if (this._associateDatalist) {\n associateDataList(this.querySelector<HTMLDataListElement>('datalist')!, this.input);\n }\n }\n\n #assignLabel() {\n const label =\n this.querySelector('label') ||\n (this.shadowRoot!.querySelector('slot')!\n .assignedNodes({ flatten: true })\n .find((i: Node) => (i as HTMLElement).tagName === 'LABEL') as HTMLLabelElement);\n if (label) {\n label.slot = 'label';\n }\n }\n\n protected showPicker() {\n try {\n this.input.showPicker();\n } catch {\n //\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAkDO,IAAA,IAAA,cAAsB,EAAW;;8BAYuC,sBAGM,cAE3C,IAAI,EAAqB,KAAK,cAGnC,KAAKA,GAAgB,wBA6CO,cAKX,EAAE,4BAEvB,oBAkDL;GAGxB,AAFA,KAAKC,IAAoB,EAErB,KAAK,SAAS,KAAKC,GAAW,WAAW,MAC3C,KAAKC,IAAa,EAClB,KAAKC,IAAe;qBA0BG;GAEzB,AADA,KAAKH,IAAoB,EACzB,KAAKI,IA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AAA,EAAA,WAAA,cAAA,KAAA,EAAA,SAlExC,GAAS,CAAA,EAAA,EAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { associateAriaDescribedBy as e, associateAriaLabel as t, associateControlGroup as n, attachInternals as r } from "../../internal/utils/a11y.js";
|
|
2
|
-
import { __decorate as i } from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import { __decorate as i } from "../../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorate.js";
|
|
3
3
|
import { useStyles as a } from "../../internal/styles/index.js";
|
|
4
4
|
import { inputQuery as o, setupControlGroupStates as s, setupControlStatusStates as c } from "../utils/states.js";
|
|
5
5
|
import { setupControlLayoutStates as l } from "../utils/layout.js";
|
|
@@ -24,7 +24,7 @@ var m = class extends d {
|
|
|
24
24
|
static {
|
|
25
25
|
this.metadata = {
|
|
26
26
|
tag: "nve-control-group",
|
|
27
|
-
version: "0.1.
|
|
27
|
+
version: "0.1.1"
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
render() {
|