ngwr 6.1.1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -3
- package/README.md +179 -32
- package/affix/styles/_index.scss +12 -0
- package/alert/styles/_index.scss +75 -32
- package/anchor/styles/_index.scss +59 -0
- package/aurora/aurora.scss +1 -0
- package/aurora/styles/_index.scss +30 -0
- package/avatar/styles/_index.scss +30 -14
- package/back-top/styles/_index.scss +42 -0
- package/badge/styles/_index.scss +80 -0
- package/badge/styles/_tag.scss +81 -0
- package/bar-chart/styles/_index.scss +56 -0
- package/blur-text/blur-text.scss +1 -0
- package/blur-text/styles/_index.scss +14 -0
- package/border-glow/border-glow.scss +4 -0
- package/border-glow/styles/_index.scss +228 -0
- package/breadcrumbs/breadcrumbs.scss +1 -0
- package/breadcrumbs/styles/_index.scss +76 -0
- package/button/styles/_index.scss +148 -125
- package/calendar/styles/_index.scss +252 -0
- package/calendar-heatmap/styles/_index.scss +69 -0
- package/card/card.scss +1 -0
- package/card/styles/_index.scss +96 -0
- package/carousel/styles/_index.scss +102 -0
- package/cascader/cascader.scss +1 -0
- package/cascader/styles/_index.scss +174 -0
- package/checkbox/styles/_index.scss +76 -60
- package/circular-text/circular-text.scss +1 -0
- package/circular-text/styles/_index.scss +45 -0
- package/click-spark/click-spark.scss +1 -0
- package/click-spark/styles/_index.scss +16 -0
- package/collapse/styles/_index.scss +92 -0
- package/color-picker/styles/_index.scss +247 -0
- package/command-palette/styles/_index.scss +188 -0
- package/compare/styles/_index.scss +100 -0
- package/context-menu/styles/_index.scss +112 -0
- package/counter/styles/_index.scss +44 -0
- package/date-picker/styles/_index.scss +204 -0
- package/decrypt-text/decrypt-text.scss +1 -0
- package/decrypt-text/styles/_index.scss +26 -0
- package/density/styles/_index.scss +37 -0
- package/descriptions/styles/_index.scss +104 -0
- package/dialog/styles/_index.scss +101 -27
- package/divider/styles/_index.scss +43 -24
- package/donut-chart/styles/_index.scss +76 -0
- package/drag-drop/sortable-list.scss +1 -0
- package/drag-drop/styles/_index.scss +99 -0
- package/drawer/styles/_index.scss +164 -0
- package/dropdown/styles/_index.scss +76 -56
- package/empty/styles/_index.scss +49 -0
- package/falling-text/falling-text.scss +1 -0
- package/falling-text/styles/_index.scss +30 -0
- package/fesm2022/ngwr-affix.mjs +102 -0
- package/fesm2022/ngwr-affix.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +70 -52
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +103 -0
- package/fesm2022/ngwr-anchor.mjs.map +1 -0
- package/fesm2022/ngwr-aurora.mjs +309 -0
- package/fesm2022/ngwr-aurora.mjs.map +1 -0
- package/fesm2022/ngwr-avatar.mjs +81 -71
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +81 -0
- package/fesm2022/ngwr-back-top.mjs.map +1 -0
- package/fesm2022/ngwr-badge.mjs +192 -0
- package/fesm2022/ngwr-badge.mjs.map +1 -0
- package/fesm2022/ngwr-bar-chart.mjs +69 -0
- package/fesm2022/ngwr-bar-chart.mjs.map +1 -0
- package/fesm2022/ngwr-blur-text.mjs +181 -0
- package/fesm2022/ngwr-blur-text.mjs.map +1 -0
- package/fesm2022/ngwr-border-glow.mjs +278 -0
- package/fesm2022/ngwr-border-glow.mjs.map +1 -0
- package/fesm2022/ngwr-breadcrumbs.mjs +101 -0
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -0
- package/fesm2022/ngwr-button.mjs +179 -104
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +145 -0
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -0
- package/fesm2022/ngwr-calendar.mjs +402 -0
- package/fesm2022/ngwr-calendar.mjs.map +1 -0
- package/fesm2022/ngwr-card.mjs +100 -0
- package/fesm2022/ngwr-card.mjs.map +1 -0
- package/fesm2022/ngwr-carousel.mjs +128 -0
- package/fesm2022/ngwr-carousel.mjs.map +1 -0
- package/fesm2022/ngwr-cascader.mjs +280 -0
- package/fesm2022/ngwr-cascader.mjs.map +1 -0
- package/fesm2022/ngwr-checkbox.mjs +214 -54
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +168 -0
- package/fesm2022/ngwr-circular-text.mjs.map +1 -0
- package/fesm2022/ngwr-click-spark.mjs +163 -0
- package/fesm2022/ngwr-click-spark.mjs.map +1 -0
- package/fesm2022/ngwr-clipboard.mjs +130 -0
- package/fesm2022/ngwr-clipboard.mjs.map +1 -0
- package/fesm2022/ngwr-collapse.mjs +232 -0
- package/fesm2022/ngwr-collapse.mjs.map +1 -0
- package/fesm2022/ngwr-color-picker.mjs +646 -0
- package/fesm2022/ngwr-color-picker.mjs.map +1 -0
- package/fesm2022/ngwr-command-palette.mjs +259 -0
- package/fesm2022/ngwr-command-palette.mjs.map +1 -0
- package/fesm2022/ngwr-compare.mjs +137 -0
- package/fesm2022/ngwr-compare.mjs.map +1 -0
- package/fesm2022/ngwr-confetti.mjs +160 -0
- package/fesm2022/ngwr-confetti.mjs.map +1 -0
- package/fesm2022/ngwr-context-menu.mjs +653 -0
- package/fesm2022/ngwr-context-menu.mjs.map +1 -0
- package/fesm2022/ngwr-cookie.mjs +127 -0
- package/fesm2022/ngwr-cookie.mjs.map +1 -0
- package/fesm2022/ngwr-counter.mjs +415 -0
- package/fesm2022/ngwr-counter.mjs.map +1 -0
- package/fesm2022/ngwr-date-adapter-fns.mjs +180 -0
- package/fesm2022/ngwr-date-adapter-fns.mjs.map +1 -0
- package/fesm2022/ngwr-date-adapter-luxon.mjs +201 -0
- package/fesm2022/ngwr-date-adapter-luxon.mjs.map +1 -0
- package/fesm2022/ngwr-date-adapter.mjs +419 -0
- package/fesm2022/ngwr-date-adapter.mjs.map +1 -0
- package/fesm2022/ngwr-date-picker.mjs +624 -0
- package/fesm2022/ngwr-date-picker.mjs.map +1 -0
- package/fesm2022/ngwr-decrypt-text.mjs +396 -0
- package/fesm2022/ngwr-decrypt-text.mjs.map +1 -0
- package/fesm2022/ngwr-density.mjs +157 -0
- package/fesm2022/ngwr-density.mjs.map +1 -0
- package/fesm2022/ngwr-descriptions.mjs +83 -0
- package/fesm2022/ngwr-descriptions.mjs.map +1 -0
- package/fesm2022/ngwr-dialog.mjs +249 -377
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +315 -0
- package/fesm2022/ngwr-directives.mjs.map +1 -0
- package/fesm2022/ngwr-divider.mjs +74 -59
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +131 -0
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -0
- package/fesm2022/ngwr-drag-drop.mjs +117 -0
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -0
- package/fesm2022/ngwr-drawer.mjs +315 -0
- package/fesm2022/ngwr-drawer.mjs.map +1 -0
- package/fesm2022/ngwr-dropdown.mjs +276 -229
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +57 -0
- package/fesm2022/ngwr-empty.mjs.map +1 -0
- package/fesm2022/ngwr-falling-text.mjs +316 -0
- package/fesm2022/ngwr-falling-text.mjs.map +1 -0
- package/fesm2022/ngwr-file-upload.mjs +260 -0
- package/fesm2022/ngwr-file-upload.mjs.map +1 -0
- package/fesm2022/ngwr-form.mjs +133 -48
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +373 -0
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -0
- package/fesm2022/ngwr-gauge.mjs +83 -0
- package/fesm2022/ngwr-gauge.mjs.map +1 -0
- package/fesm2022/ngwr-glitch-text.mjs +67 -0
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -0
- package/fesm2022/ngwr-gradient-text.mjs +109 -0
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -0
- package/fesm2022/ngwr-hotkey.mjs +263 -0
- package/fesm2022/ngwr-hotkey.mjs.map +1 -0
- package/fesm2022/ngwr-i18n-en.mjs +168 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -0
- package/fesm2022/ngwr-i18n-ru.mjs +156 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -0
- package/fesm2022/ngwr-i18n.mjs +478 -0
- package/fesm2022/ngwr-i18n.mjs.map +1 -0
- package/fesm2022/ngwr-icon-adapters-feather.mjs +74 -0
- package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -0
- package/fesm2022/ngwr-icon-adapters-lucide.mjs +88 -0
- package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -0
- package/fesm2022/ngwr-icon.mjs +189 -649
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +299 -0
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -0
- package/fesm2022/ngwr-input-number.mjs +239 -0
- package/fesm2022/ngwr-input-number.mjs.map +1 -0
- package/fesm2022/ngwr-input-otp.mjs +216 -0
- package/fesm2022/ngwr-input-otp.mjs.map +1 -0
- package/fesm2022/ngwr-input.mjs +183 -104
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +47 -0
- package/fesm2022/ngwr-keyboard.mjs.map +1 -0
- package/fesm2022/ngwr-knob.mjs +227 -0
- package/fesm2022/ngwr-knob.mjs.map +1 -0
- package/fesm2022/ngwr-layout.mjs +197 -0
- package/fesm2022/ngwr-layout.mjs.map +1 -0
- package/fesm2022/ngwr-lightbox.mjs +131 -0
- package/fesm2022/ngwr-lightbox.mjs.map +1 -0
- package/fesm2022/ngwr-line-chart.mjs +176 -0
- package/fesm2022/ngwr-line-chart.mjs.map +1 -0
- package/fesm2022/ngwr-list.mjs +132 -0
- package/fesm2022/ngwr-list.mjs.map +1 -0
- package/fesm2022/ngwr-loading-bar.mjs +160 -0
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -0
- package/fesm2022/ngwr-marquee.mjs +224 -0
- package/fesm2022/ngwr-marquee.mjs.map +1 -0
- package/fesm2022/ngwr-media.mjs +132 -0
- package/fesm2022/ngwr-media.mjs.map +1 -0
- package/fesm2022/ngwr-mention.mjs +374 -0
- package/fesm2022/ngwr-mention.mjs.map +1 -0
- package/fesm2022/ngwr-meta.mjs +266 -0
- package/fesm2022/ngwr-meta.mjs.map +1 -0
- package/fesm2022/ngwr-meter-group.mjs +73 -0
- package/fesm2022/ngwr-meter-group.mjs.map +1 -0
- package/fesm2022/ngwr-overlay.mjs +145 -0
- package/fesm2022/ngwr-overlay.mjs.map +1 -0
- package/fesm2022/ngwr-page-header.mjs +53 -0
- package/fesm2022/ngwr-page-header.mjs.map +1 -0
- package/fesm2022/ngwr-pagination.mjs +152 -96
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +290 -11
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +63 -0
- package/fesm2022/ngwr-platform.mjs.map +1 -0
- package/fesm2022/ngwr-popconfirm.mjs +188 -0
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -0
- package/fesm2022/ngwr-popover.mjs +361 -0
- package/fesm2022/ngwr-popover.mjs.map +1 -0
- package/fesm2022/ngwr-progress.mjs +47 -39
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +160 -179
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +204 -0
- package/fesm2022/ngwr-radio.mjs.map +1 -0
- package/fesm2022/ngwr-rating.mjs +180 -0
- package/fesm2022/ngwr-rating.mjs.map +1 -0
- package/fesm2022/ngwr-result.mjs +119 -0
- package/fesm2022/ngwr-result.mjs.map +1 -0
- package/fesm2022/ngwr-rotating-text.mjs +256 -0
- package/fesm2022/ngwr-rotating-text.mjs.map +1 -0
- package/fesm2022/ngwr-scramble-text.mjs +165 -0
- package/fesm2022/ngwr-scramble-text.mjs.map +1 -0
- package/fesm2022/ngwr-scroll.mjs +107 -0
- package/fesm2022/ngwr-scroll.mjs.map +1 -0
- package/fesm2022/ngwr-segmented.mjs +96 -0
- package/fesm2022/ngwr-segmented.mjs.map +1 -0
- package/fesm2022/ngwr-select.mjs +844 -309
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +127 -0
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -0
- package/fesm2022/ngwr-sidebar.mjs +134 -0
- package/fesm2022/ngwr-sidebar.mjs.map +1 -0
- package/fesm2022/ngwr-skeleton.mjs +59 -34
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +234 -0
- package/fesm2022/ngwr-slider.mjs.map +1 -0
- package/fesm2022/ngwr-sparkline.mjs +104 -0
- package/fesm2022/ngwr-sparkline.mjs.map +1 -0
- package/fesm2022/ngwr-speed-dial.mjs +79 -0
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -0
- package/fesm2022/ngwr-spinner.mjs +34 -28
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor.mjs +970 -0
- package/fesm2022/ngwr-splash-cursor.mjs.map +1 -0
- package/fesm2022/ngwr-split-text.mjs +200 -0
- package/fesm2022/ngwr-split-text.mjs.map +1 -0
- package/fesm2022/ngwr-splitter.mjs +125 -0
- package/fesm2022/ngwr-splitter.mjs.map +1 -0
- package/fesm2022/ngwr-spotlight-card.mjs +138 -0
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -0
- package/fesm2022/ngwr-squircle.mjs +320 -0
- package/fesm2022/ngwr-squircle.mjs.map +1 -0
- package/fesm2022/ngwr-star-border.mjs +72 -0
- package/fesm2022/ngwr-star-border.mjs.map +1 -0
- package/fesm2022/ngwr-statistic.mjs +220 -0
- package/fesm2022/ngwr-statistic.mjs.map +1 -0
- package/fesm2022/ngwr-stepper.mjs +186 -0
- package/fesm2022/ngwr-stepper.mjs.map +1 -0
- package/fesm2022/ngwr-storage.mjs +317 -0
- package/fesm2022/ngwr-storage.mjs.map +1 -0
- package/fesm2022/ngwr-switch.mjs +99 -0
- package/fesm2022/ngwr-switch.mjs.map +1 -0
- package/fesm2022/ngwr-table.mjs +217 -206
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +217 -0
- package/fesm2022/ngwr-tabs.mjs.map +1 -0
- package/fesm2022/ngwr-textarea.mjs +106 -120
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +152 -0
- package/fesm2022/ngwr-theme.mjs.map +1 -0
- package/fesm2022/ngwr-tilt-card.mjs +137 -0
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -0
- package/fesm2022/ngwr-timeline.mjs +73 -0
- package/fesm2022/ngwr-timeline.mjs.map +1 -0
- package/fesm2022/ngwr-toast.mjs +446 -0
- package/fesm2022/ngwr-toast.mjs.map +1 -0
- package/fesm2022/ngwr-toolbar.mjs +46 -0
- package/fesm2022/ngwr-toolbar.mjs.map +1 -0
- package/fesm2022/ngwr-tree.mjs +483 -0
- package/fesm2022/ngwr-tree.mjs.map +1 -0
- package/fesm2022/ngwr-typewriter.mjs +229 -0
- package/fesm2022/ngwr-typewriter.mjs.map +1 -0
- package/fesm2022/ngwr-typography.mjs +79 -0
- package/fesm2022/ngwr-typography.mjs.map +1 -0
- package/fesm2022/ngwr-utils.mjs +535 -0
- package/fesm2022/ngwr-utils.mjs.map +1 -0
- package/fesm2022/ngwr-validators.mjs +214 -0
- package/fesm2022/ngwr-validators.mjs.map +1 -0
- package/fesm2022/ngwr-version.mjs +51 -0
- package/fesm2022/ngwr-version.mjs.map +1 -0
- package/fesm2022/ngwr-virtual-scroll.mjs +99 -0
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -0
- package/fesm2022/ngwr-waves.mjs +356 -0
- package/fesm2022/ngwr-waves.mjs.map +1 -0
- package/fesm2022/ngwr-window.mjs +1141 -0
- package/fesm2022/ngwr-window.mjs.map +1 -0
- package/fesm2022/ngwr.mjs +0 -3
- package/fesm2022/ngwr.mjs.map +1 -1
- package/file-upload/styles/_index.scss +152 -0
- package/form/styles/_index.scss +85 -42
- package/gauge/styles/_index.scss +37 -0
- package/glitch-text/glitch-text.scss +1 -0
- package/glitch-text/styles/_index.scss +144 -0
- package/gradient-text/gradient-text.scss +1 -0
- package/gradient-text/styles/_index.scss +113 -0
- package/icon/styles/_index.scss +21 -15
- package/image-cropper/styles/_index.scss +114 -0
- package/input/styles/_index.scss +133 -93
- package/input-number/styles/_index.scss +75 -0
- package/input-otp/styles/_index.scss +53 -0
- package/keyboard/styles/_index.scss +55 -0
- package/knob/styles/_index.scss +54 -0
- package/layout/styles/_index.scss +65 -0
- package/lightbox/lightbox.scss +1 -0
- package/lightbox/styles/_index.scss +144 -0
- package/line-chart/styles/_index.scss +93 -0
- package/list/list.scss +1 -0
- package/list/styles/_index.scss +101 -0
- package/loading-bar/loading-bar.scss +1 -0
- package/loading-bar/styles/_index.scss +29 -0
- package/marquee/marquee.scss +1 -0
- package/marquee/styles/_index.scss +138 -0
- package/mention/styles/_index.scss +47 -0
- package/meter-group/styles/_index.scss +61 -0
- package/package.json +576 -99
- package/page-header/styles/_index.scss +78 -0
- package/pagination/styles/_index.scss +89 -34
- package/popconfirm/styles/_index.scss +32 -0
- package/popover/styles/_index.scss +83 -0
- package/progress/styles/_index.scss +29 -14
- package/qr/styles/_index.scss +6 -3
- package/radio/styles/_index.scss +111 -0
- package/rating/styles/_index.scss +63 -0
- package/result/styles/_index.scss +69 -0
- package/rotating-text/rotating-text.scss +1 -0
- package/rotating-text/styles/_index.scss +39 -0
- package/schematics/collection.json +37 -0
- package/schematics/component-style/index.js +49 -0
- package/{cdk/utils/index.d.ts → schematics/component-style/schema.js} +2 -8
- package/schematics/component-style/schema.json +20 -0
- package/schematics/icon-set/index.js +96 -0
- package/schematics/icon-set/schema.js +8 -0
- package/schematics/icon-set/schema.json +39 -0
- package/schematics/migrations/v7/index.js +187 -0
- package/schematics/migrations.json +10 -0
- package/schematics/ng-add/index.js +180 -0
- package/schematics/ng-add/schema.js +8 -0
- package/schematics/ng-add/schema.json +80 -0
- package/schematics/page/index.js +63 -0
- package/schematics/page/schema.js +8 -0
- package/schematics/page/schema.json +39 -0
- package/schematics/page/templates.js +198 -0
- package/schematics/provider/index.js +126 -0
- package/schematics/provider/schema.js +8 -0
- package/schematics/provider/schema.json +52 -0
- package/schematics/use/index.js +143 -0
- package/schematics/use/schema.js +8 -0
- package/schematics/use/schema.json +25 -0
- package/schematics/use/symbol-map.json +356 -0
- package/scramble-text/scramble-text.scss +1 -0
- package/scramble-text/styles/_index.scss +8 -0
- package/segmented/styles/_index.scss +92 -0
- package/select/styles/_index.scss +245 -159
- package/shiny-text/shiny-text.scss +1 -0
- package/shiny-text/styles/_index.scss +101 -0
- package/sidebar/styles/_index.scss +208 -0
- package/skeleton/styles/_index.scss +33 -33
- package/slider/styles/_index.scss +77 -0
- package/sparkline/styles/_index.scss +9 -0
- package/speed-dial/styles/_index.scss +158 -0
- package/spinner/styles/_index.scss +38 -22
- package/splash-cursor/splash-cursor.scss +1 -0
- package/splash-cursor/styles/_index.scss +27 -0
- package/split-text/split-text.scss +1 -0
- package/split-text/styles/_index.scss +22 -0
- package/splitter/styles/_index.scss +85 -0
- package/spotlight-card/spotlight-card.scss +1 -0
- package/spotlight-card/styles/_index.scss +43 -0
- package/squircle/styles/_index.scss +34 -0
- package/star-border/star-border.scss +1 -0
- package/star-border/styles/_index.scss +118 -0
- package/statistic/styles/_index.scss +54 -0
- package/stepper/styles/_index.scss +162 -0
- package/styles/_animations.scss +198 -0
- package/styles/_breakpoints.scss +75 -0
- package/styles/_grid.scss +71 -0
- package/styles/_reset.scss +123 -0
- package/styles/_typography.scss +122 -0
- package/styles.scss +102 -13
- package/switch/styles/_index.scss +82 -0
- package/table/styles/_index.scss +255 -4
- package/tabs/styles/_index.scss +71 -0
- package/textarea/styles/_index.scss +47 -56
- package/theme/styles/_colors.scss +83 -0
- package/theme/styles/_dark.scss +85 -0
- package/theme/styles/_focus.scss +93 -0
- package/theme/styles/_index.scss +5 -0
- package/theme/styles/_mixins.scss +57 -0
- package/theme/styles/_variables.scss +118 -0
- package/tilt-card/styles/_index.scss +40 -0
- package/tilt-card/tilt-card.scss +1 -0
- package/timeline/styles/_index.scss +127 -0
- package/toast/styles/_index.scss +263 -0
- package/toolbar/styles/_index.scss +65 -0
- package/tree/styles/_index.scss +271 -0
- package/types/ngwr-affix.d.ts +43 -0
- package/types/ngwr-alert.d.ts +68 -0
- package/types/ngwr-anchor.d.ts +53 -0
- package/types/ngwr-aurora.d.ts +52 -0
- package/types/ngwr-avatar.d.ts +90 -0
- package/types/ngwr-back-top.d.ts +37 -0
- package/types/ngwr-badge.d.ts +158 -0
- package/types/ngwr-bar-chart.d.ts +47 -0
- package/types/ngwr-blur-text.d.ts +62 -0
- package/types/ngwr-border-glow.d.ts +66 -0
- package/types/ngwr-breadcrumbs.d.ts +61 -0
- package/types/ngwr-button.d.ts +176 -0
- package/types/ngwr-calendar-heatmap.d.ts +58 -0
- package/types/ngwr-calendar.d.ts +116 -0
- package/types/ngwr-card.d.ts +50 -0
- package/types/ngwr-carousel.d.ts +57 -0
- package/types/ngwr-cascader.d.ts +107 -0
- package/types/ngwr-checkbox.d.ts +139 -0
- package/types/ngwr-circular-text.d.ts +49 -0
- package/types/ngwr-click-spark.d.ts +52 -0
- package/types/ngwr-clipboard.d.ts +53 -0
- package/types/ngwr-collapse.d.ts +139 -0
- package/types/ngwr-color-picker.d.ts +302 -0
- package/types/ngwr-command-palette.d.ts +113 -0
- package/types/ngwr-compare.d.ts +55 -0
- package/types/ngwr-confetti.d.ts +70 -0
- package/types/ngwr-context-menu.d.ts +207 -0
- package/types/ngwr-cookie.d.ts +60 -0
- package/types/ngwr-counter.d.ts +182 -0
- package/types/ngwr-date-adapter-fns.d.ts +73 -0
- package/types/ngwr-date-adapter-luxon.d.ts +73 -0
- package/types/ngwr-date-adapter.d.ts +198 -0
- package/types/ngwr-date-picker.d.ts +117 -0
- package/types/ngwr-decrypt-text.d.ts +85 -0
- package/types/ngwr-density.d.ts +97 -0
- package/types/ngwr-descriptions.d.ts +41 -0
- package/types/ngwr-dialog.d.ts +210 -0
- package/types/ngwr-directives.d.ts +125 -0
- package/types/ngwr-divider.d.ts +73 -0
- package/types/ngwr-donut-chart.d.ts +53 -0
- package/types/ngwr-drag-drop.d.ts +83 -0
- package/types/ngwr-drawer.d.ts +155 -0
- package/types/ngwr-dropdown.d.ts +124 -0
- package/types/ngwr-empty.d.ts +38 -0
- package/types/ngwr-falling-text.d.ts +63 -0
- package/types/ngwr-file-upload.d.ts +94 -0
- package/types/ngwr-form.d.ts +95 -0
- package/types/ngwr-fuzzy-text.d.ts +74 -0
- package/types/ngwr-gauge.d.ts +39 -0
- package/types/ngwr-glitch-text.d.ts +31 -0
- package/types/ngwr-gradient-text.d.ts +46 -0
- package/types/ngwr-hotkey.d.ts +142 -0
- package/types/ngwr-i18n-en.d.ts +18 -0
- package/types/ngwr-i18n-ru.d.ts +6 -0
- package/types/ngwr-i18n.d.ts +336 -0
- package/types/ngwr-icon-adapters-feather.d.ts +44 -0
- package/types/ngwr-icon-adapters-lucide.d.ts +54 -0
- package/types/ngwr-icon.d.ts +180 -0
- package/types/ngwr-image-cropper.d.ts +110 -0
- package/types/ngwr-input-number.d.ts +77 -0
- package/types/ngwr-input-otp.d.ts +78 -0
- package/types/ngwr-input.d.ts +131 -0
- package/types/ngwr-keyboard.d.ts +34 -0
- package/types/ngwr-knob.d.ts +77 -0
- package/types/ngwr-layout.d.ts +89 -0
- package/types/ngwr-lightbox.d.ts +50 -0
- package/types/ngwr-line-chart.d.ts +90 -0
- package/types/ngwr-list.d.ts +71 -0
- package/types/ngwr-loading-bar.d.ts +79 -0
- package/types/ngwr-marquee.d.ts +95 -0
- package/types/ngwr-media.d.ts +74 -0
- package/types/ngwr-mention.d.ts +110 -0
- package/types/ngwr-meta.d.ts +164 -0
- package/types/ngwr-meter-group.d.ts +57 -0
- package/types/ngwr-overlay.d.ts +110 -0
- package/types/ngwr-page-header.d.ts +35 -0
- package/types/ngwr-pagination.d.ts +119 -0
- package/types/ngwr-pipes.d.ts +177 -0
- package/types/ngwr-platform.d.ts +38 -0
- package/types/ngwr-popconfirm.d.ts +79 -0
- package/types/ngwr-popover.d.ts +90 -0
- package/types/ngwr-progress.d.ts +33 -0
- package/types/ngwr-qr.d.ts +56 -0
- package/types/ngwr-radio.d.ts +120 -0
- package/types/ngwr-rating.d.ts +62 -0
- package/types/ngwr-result.d.ts +64 -0
- package/types/ngwr-rotating-text.d.ts +72 -0
- package/types/ngwr-scramble-text.d.ts +49 -0
- package/types/ngwr-scroll.d.ts +65 -0
- package/types/ngwr-segmented.d.ts +65 -0
- package/types/ngwr-select.d.ts +413 -0
- package/types/ngwr-shiny-text.d.ts +70 -0
- package/types/ngwr-sidebar.d.ts +83 -0
- package/types/ngwr-skeleton.d.ts +41 -0
- package/types/ngwr-slider.d.ts +86 -0
- package/types/ngwr-sparkline.d.ts +48 -0
- package/types/ngwr-speed-dial.d.ts +51 -0
- package/types/ngwr-spinner.d.ts +41 -0
- package/types/ngwr-splash-cursor.d.ts +94 -0
- package/types/ngwr-split-text.d.ts +83 -0
- package/types/ngwr-splitter.d.ts +52 -0
- package/types/ngwr-spotlight-card.d.ts +71 -0
- package/types/ngwr-squircle.d.ts +132 -0
- package/types/ngwr-star-border.d.ts +40 -0
- package/types/ngwr-statistic.d.ts +88 -0
- package/types/ngwr-stepper.d.ts +99 -0
- package/types/ngwr-storage.d.ts +178 -0
- package/types/ngwr-switch.d.ts +39 -0
- package/types/ngwr-table.d.ts +237 -0
- package/types/ngwr-tabs.d.ts +125 -0
- package/types/ngwr-textarea.d.ts +60 -0
- package/types/ngwr-theme.d.ts +124 -0
- package/types/ngwr-tilt-card.d.ts +63 -0
- package/types/ngwr-timeline.d.ts +40 -0
- package/types/ngwr-toast.d.ts +230 -0
- package/types/ngwr-toolbar.d.ts +30 -0
- package/types/ngwr-tree.d.ts +150 -0
- package/types/ngwr-typewriter.d.ts +84 -0
- package/types/ngwr-typography.d.ts +56 -0
- package/types/ngwr-utils.d.ts +447 -0
- package/types/ngwr-validators.d.ts +70 -0
- package/types/ngwr-version.d.ts +44 -0
- package/types/ngwr-virtual-scroll.d.ts +64 -0
- package/types/ngwr-waves.d.ts +71 -0
- package/types/ngwr-window.d.ts +437 -0
- package/typewriter/styles/_index.scss +33 -0
- package/typewriter/typewriter.scss +1 -0
- package/typography/styles/_index.scss +211 -0
- package/virtual-scroll/styles/_index.scss +27 -0
- package/virtual-scroll/virtual-scroll.scss +1 -0
- package/waves/styles/_index.scss +24 -0
- package/waves/waves.scss +1 -0
- package/window/styles/_index.scss +430 -0
- package/alert/index.d.ts +0 -32
- package/alert/styles/theming.scss +0 -26
- package/alert/styles/vars.scss +0 -11
- package/avatar/index.d.ts +0 -30
- package/button/index.d.ts +0 -45
- package/button/styles/vars.scss +0 -13
- package/cdk/index.d.ts +0 -24
- package/cdk/rxjs/index.d.ts +0 -40
- package/cdk/types/index.d.ts +0 -27
- package/checkbox/index.d.ts +0 -31
- package/checkbox/styles/vars.scss +0 -16
- package/dialog/index.d.ts +0 -193
- package/dialog/styles/vars.scss +0 -7
- package/divider/index.d.ts +0 -16
- package/dropdown/index.d.ts +0 -68
- package/dropdown/styles/vars.scss +0 -18
- package/fesm2022/ngwr-cdk-rxjs.mjs +0 -53
- package/fesm2022/ngwr-cdk-rxjs.mjs.map +0 -1
- package/fesm2022/ngwr-cdk-types.mjs +0 -44
- package/fesm2022/ngwr-cdk-types.mjs.map +0 -1
- package/fesm2022/ngwr-cdk-utils.mjs +0 -30
- package/fesm2022/ngwr-cdk-utils.mjs.map +0 -1
- package/fesm2022/ngwr-cdk.mjs +0 -46
- package/fesm2022/ngwr-cdk.mjs.map +0 -1
- package/fesm2022/ngwr-tag.mjs +0 -87
- package/fesm2022/ngwr-tag.mjs.map +0 -1
- package/form/index.d.ts +0 -28
- package/icon/index.d.ts +0 -830
- package/icon/styles/vars.scss +0 -3
- package/input/index.d.ts +0 -43
- package/input/styles/vars.scss +0 -17
- package/pagination/index.d.ts +0 -34
- package/pagination/styles/vars.scss +0 -14
- package/pipes/index.d.ts +0 -17
- package/progress/index.d.ts +0 -13
- package/progress/styles/theming.scss +0 -8
- package/progress/styles/vars.scss +0 -6
- package/qr/index.d.ts +0 -127
- package/select/index.d.ts +0 -121
- package/select/styles/vars.scss +0 -32
- package/skeleton/index.d.ts +0 -13
- package/spinner/index.d.ts +0 -23
- package/styles/animations.scss +0 -92
- package/styles/cdk.scss +0 -5
- package/styles/colors.scss +0 -72
- package/styles/grid.scss +0 -99
- package/styles/maps.scss +0 -31
- package/styles/reset.scss +0 -112
- package/styles/variables.scss +0 -72
- package/table/index.d.ts +0 -101
- package/table/styles/table-filter.scss +0 -202
- package/table/styles/table-sort.scss +0 -47
- package/table/styles/table.scss +0 -232
- package/table/styles/vars.scss +0 -21
- package/tag/index.d.ts +0 -24
- package/tag/styles/_index.scss +0 -32
- package/tag/styles/theming.scss +0 -21
- package/tag/styles/vars.scss +0 -12
- package/textarea/index.d.ts +0 -47
- package/textarea/styles/vars.scss +0 -17
- /package/{index.d.ts → types/ngwr.d.ts} +0 -0
|
@@ -0,0 +1,653 @@
|
|
|
1
|
+
import { ScrollStrategyOptions } from '@angular/cdk/overlay';
|
|
2
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { input, computed, inject, ElementRef, ViewContainerRef, DestroyRef, ViewEncapsulation, Component, Directive, viewChild, TemplateRef } from '@angular/core';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { WR_OVERLAY } from 'ngwr/overlay';
|
|
7
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
8
|
+
import { WrIcon } from 'ngwr/icon';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @license
|
|
12
|
+
*
|
|
13
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
14
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
15
|
+
*/
|
|
16
|
+
/** Hover delay (ms) before a submenu opens. */
|
|
17
|
+
const SUBMENU_OPEN_DELAY = 120;
|
|
18
|
+
/** Grace window (ms) before a submenu closes when the cursor leaves it. */
|
|
19
|
+
const SUBMENU_CLOSE_DELAY = 240;
|
|
20
|
+
/** Animation duration of the submenu — mirrors the root menu CSS. */
|
|
21
|
+
const SUBMENU_TRANSITION_MS = 220;
|
|
22
|
+
/**
|
|
23
|
+
* Single row inside a `<wr-context-menu>`. Mirrors `<wr-dropdown-item>` —
|
|
24
|
+
* rendered as a menu item with an optional leading icon and an optional
|
|
25
|
+
* nested `[submenu]` that opens to the right on hover.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```html
|
|
29
|
+
* <wr-context-menu #menu>
|
|
30
|
+
* <wr-context-menu-item icon="copy" (click)="copy()">Copy</wr-context-menu-item>
|
|
31
|
+
* <wr-context-menu-item icon="more" [submenu]="extras">More…</wr-context-menu-item>
|
|
32
|
+
* </wr-context-menu>
|
|
33
|
+
*
|
|
34
|
+
* <wr-context-menu #extras>
|
|
35
|
+
* <wr-context-menu-item (click)="duplicate()">Duplicate</wr-context-menu-item>
|
|
36
|
+
* <wr-context-menu-item (click)="archive()">Archive</wr-context-menu-item>
|
|
37
|
+
* </wr-context-menu>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
class WrContextMenuItem {
|
|
41
|
+
/** Optional leading icon name. @default null */
|
|
42
|
+
icon = input(null, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
44
|
+
/** Disable interaction (suppresses pointer + keyboard). @default false */
|
|
45
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
46
|
+
/**
|
|
47
|
+
* Optional nested `<wr-context-menu>`. When set, hovering the item
|
|
48
|
+
* (or pressing →) opens it to the right with a chevron indicator.
|
|
49
|
+
*/
|
|
50
|
+
submenu = input(null, /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "submenu" }] : /* istanbul ignore next */ []));
|
|
52
|
+
classes = computed(() => {
|
|
53
|
+
const parts = ['wr-context-menu-item'];
|
|
54
|
+
if (this.disabled())
|
|
55
|
+
parts.push('wr-context-menu-item--disabled');
|
|
56
|
+
if (this.submenu())
|
|
57
|
+
parts.push('wr-context-menu-item--has-submenu');
|
|
58
|
+
return parts.join(' ');
|
|
59
|
+
}, /* @ts-ignore */
|
|
60
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
61
|
+
host = inject(ElementRef);
|
|
62
|
+
overlay = inject(WR_OVERLAY);
|
|
63
|
+
vcr = inject(ViewContainerRef);
|
|
64
|
+
scrollStrategies = inject(ScrollStrategyOptions);
|
|
65
|
+
destroyRef = inject(DestroyRef);
|
|
66
|
+
submenuRef = null;
|
|
67
|
+
openTimer = null;
|
|
68
|
+
closeTimer = null;
|
|
69
|
+
submenuOpen = false;
|
|
70
|
+
/**
|
|
71
|
+
* Global registry of open submenus keyed by the host element of the
|
|
72
|
+
* item that owns them. Used to cascade-close descendants when a
|
|
73
|
+
* parent submenu is disposed — Angular's onDestroy on detached
|
|
74
|
+
* portals doesn't always tear down the deepest grand-children's
|
|
75
|
+
* overlays in the right order, leaving orphaned floating panes.
|
|
76
|
+
*/
|
|
77
|
+
static openSubmenus = new Map();
|
|
78
|
+
/**
|
|
79
|
+
* Dispose every open submenu pane on the page. Called by the root
|
|
80
|
+
* `WrContextMenu` when its own overlay closes — destroyRef cascade
|
|
81
|
+
* isn't reliable across separate overlay panes (each pane lives in
|
|
82
|
+
* the CDK overlay container, not inside the parent pane's view).
|
|
83
|
+
*/
|
|
84
|
+
static disposeAll(immediate) {
|
|
85
|
+
for (const [, owner] of [...WrContextMenuItem.openSubmenus]) {
|
|
86
|
+
owner.disposeSubmenu(immediate);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
constructor() {
|
|
90
|
+
this.destroyRef.onDestroy(() => this.disposeSubmenu(true));
|
|
91
|
+
}
|
|
92
|
+
/** @internal Keyboard activation — Enter / Space. */
|
|
93
|
+
activate(event) {
|
|
94
|
+
if (this.disabled())
|
|
95
|
+
return;
|
|
96
|
+
if (this.submenu()) {
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
this.scheduleOpen(0);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
this.host.nativeElement.click();
|
|
103
|
+
}
|
|
104
|
+
/** @internal Right-arrow opens the submenu. */
|
|
105
|
+
onArrowRight(event) {
|
|
106
|
+
if (this.disabled() || !this.submenu())
|
|
107
|
+
return;
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
this.scheduleOpen(0);
|
|
110
|
+
}
|
|
111
|
+
/** @internal Left-arrow closes the submenu (if open). */
|
|
112
|
+
onArrowLeft(event) {
|
|
113
|
+
if (!this.submenu() || !this.submenuOpen)
|
|
114
|
+
return;
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
this.scheduleClose(0);
|
|
117
|
+
}
|
|
118
|
+
/** @internal Hover schedules a submenu open after a small delay. */
|
|
119
|
+
onMouseEnter() {
|
|
120
|
+
if (this.disabled() || !this.submenu())
|
|
121
|
+
return;
|
|
122
|
+
this.cancelClose();
|
|
123
|
+
this.scheduleOpen(SUBMENU_OPEN_DELAY);
|
|
124
|
+
}
|
|
125
|
+
/** @internal Hover-out schedules a close with a grace window. */
|
|
126
|
+
onMouseLeave(event) {
|
|
127
|
+
if (!this.submenu())
|
|
128
|
+
return;
|
|
129
|
+
this.cancelOpen();
|
|
130
|
+
// Only skip the close when the cursor is moving into MY OWN submenu
|
|
131
|
+
// (the user is drilling further down). Moving elsewhere — sibling
|
|
132
|
+
// item, ancestor menu, or completely off the chain — should close
|
|
133
|
+
// this item's submenu and let the cascade-on-dispose tear down any
|
|
134
|
+
// descendants.
|
|
135
|
+
if (this.relatedTargetIsInsideOwnSubmenu(event))
|
|
136
|
+
return;
|
|
137
|
+
this.scheduleClose(SUBMENU_CLOSE_DELAY);
|
|
138
|
+
}
|
|
139
|
+
// Submenu lifecycle
|
|
140
|
+
scheduleOpen(delay) {
|
|
141
|
+
if (this.submenuRef)
|
|
142
|
+
return;
|
|
143
|
+
this.cancelOpen();
|
|
144
|
+
if (delay === 0) {
|
|
145
|
+
this.openSubmenu();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
this.openTimer = setTimeout(() => {
|
|
149
|
+
this.openTimer = null;
|
|
150
|
+
this.openSubmenu();
|
|
151
|
+
}, delay);
|
|
152
|
+
}
|
|
153
|
+
scheduleClose(delay) {
|
|
154
|
+
this.cancelClose();
|
|
155
|
+
if (delay === 0) {
|
|
156
|
+
this.disposeSubmenu(false);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.closeTimer = setTimeout(() => {
|
|
160
|
+
this.closeTimer = null;
|
|
161
|
+
this.disposeSubmenu(false);
|
|
162
|
+
}, delay);
|
|
163
|
+
}
|
|
164
|
+
cancelOpen() {
|
|
165
|
+
if (this.openTimer !== null) {
|
|
166
|
+
clearTimeout(this.openTimer);
|
|
167
|
+
this.openTimer = null;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
cancelClose() {
|
|
171
|
+
if (this.closeTimer !== null) {
|
|
172
|
+
clearTimeout(this.closeTimer);
|
|
173
|
+
this.closeTimer = null;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
openSubmenu() {
|
|
177
|
+
const panel = this.submenu();
|
|
178
|
+
if (!panel || this.submenuRef)
|
|
179
|
+
return;
|
|
180
|
+
// Position to the right of the item, vertically aligned with the
|
|
181
|
+
// item's top. Falls back to opening to the LEFT if there's no room.
|
|
182
|
+
const positions = [
|
|
183
|
+
{ originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: 4 },
|
|
184
|
+
{ originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top', offsetX: -4 },
|
|
185
|
+
];
|
|
186
|
+
const positionStrategy = this.overlay
|
|
187
|
+
.position()
|
|
188
|
+
.flexibleConnectedTo(this.host)
|
|
189
|
+
.withPositions(positions)
|
|
190
|
+
.withPush(true);
|
|
191
|
+
this.submenuRef = this.overlay.create({
|
|
192
|
+
positionStrategy,
|
|
193
|
+
scrollStrategy: this.scrollStrategies.reposition(),
|
|
194
|
+
panelClass: ['wr-context-menu-overlay', 'wr-context-menu-overlay--submenu'],
|
|
195
|
+
});
|
|
196
|
+
const portal = new TemplatePortal(panel.contentTpl(), this.vcr);
|
|
197
|
+
this.submenuRef.attach(portal);
|
|
198
|
+
// Mirror the open animation pattern from the root menu directive.
|
|
199
|
+
const pane = this.submenuRef.overlayElement;
|
|
200
|
+
requestAnimationFrame(() => pane.classList.add('wr-context-menu-overlay--open'));
|
|
201
|
+
// Track mouse entering / leaving the submenu so we don't auto-close
|
|
202
|
+
// when the cursor crosses the gap between item and submenu pane.
|
|
203
|
+
pane.addEventListener('mouseenter', this.onSubmenuEnter);
|
|
204
|
+
pane.addEventListener('mouseleave', this.onSubmenuLeave);
|
|
205
|
+
this.submenuOpen = true;
|
|
206
|
+
WrContextMenuItem.openSubmenus.set(this.host.nativeElement, this);
|
|
207
|
+
}
|
|
208
|
+
/** Bound handlers (= preserves identity for removeEventListener). */
|
|
209
|
+
onSubmenuEnter = () => {
|
|
210
|
+
this.cancelClose();
|
|
211
|
+
// Cursor is inside our pane — keep the whole chain (root + every
|
|
212
|
+
// ancestor submenu) alive.
|
|
213
|
+
WrContextMenu.keepChainAlive();
|
|
214
|
+
};
|
|
215
|
+
onSubmenuLeave = (event) => {
|
|
216
|
+
// Only stay open if the cursor is moving into a DESCENDANT submenu
|
|
217
|
+
// of ours (an item inside our pane opening its own submenu). Moving
|
|
218
|
+
// back up to an ancestor menu, sideways to a sibling, or completely
|
|
219
|
+
// off-chain should dismiss this submenu (cascade-on-dispose then
|
|
220
|
+
// tears down any deeper levels we own).
|
|
221
|
+
if (this.relatedTargetIsInsideDescendantSubmenu(event))
|
|
222
|
+
return;
|
|
223
|
+
this.scheduleClose(SUBMENU_CLOSE_DELAY);
|
|
224
|
+
// If the cursor left ALL menu panes (root + every submenu), tear
|
|
225
|
+
// down the whole chain. Otherwise just close this pane and let the
|
|
226
|
+
// user continue navigating ancestors.
|
|
227
|
+
if (!this.relatedTargetIsInsideAnyMenu(event)) {
|
|
228
|
+
WrContextMenu.scheduleChainClose();
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
relatedTargetIsInsideAnyMenu(event) {
|
|
232
|
+
const related = event.relatedTarget;
|
|
233
|
+
if (!(related instanceof Element))
|
|
234
|
+
return false;
|
|
235
|
+
return !!related.closest('.wr-context-menu-overlay');
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* `true` when the cursor moved from this item directly into the pane
|
|
239
|
+
* of its own (just-opening) submenu — drilling down. Sibling items
|
|
240
|
+
* and ancestor menus do NOT count.
|
|
241
|
+
*/
|
|
242
|
+
relatedTargetIsInsideOwnSubmenu(event) {
|
|
243
|
+
const related = event.relatedTarget;
|
|
244
|
+
if (!(related instanceof Element) || !this.submenuRef)
|
|
245
|
+
return false;
|
|
246
|
+
return this.submenuRef.overlayElement.contains(related);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* `true` when the cursor moved from our submenu pane into another
|
|
250
|
+
* submenu pane whose owner-item lives INSIDE ours — the user is
|
|
251
|
+
* drilling further down the chain (e.g., from the Share submenu into
|
|
252
|
+
* the Export-as submenu). Moving back up the chain returns false so
|
|
253
|
+
* we close.
|
|
254
|
+
*/
|
|
255
|
+
relatedTargetIsInsideDescendantSubmenu(event) {
|
|
256
|
+
const related = event.relatedTarget;
|
|
257
|
+
if (!(related instanceof Element) || !this.submenuRef)
|
|
258
|
+
return false;
|
|
259
|
+
const targetPane = related.closest('.wr-context-menu-overlay');
|
|
260
|
+
if (!targetPane)
|
|
261
|
+
return false;
|
|
262
|
+
const myPane = this.submenuRef.overlayElement;
|
|
263
|
+
if (targetPane === myPane)
|
|
264
|
+
return true;
|
|
265
|
+
// Find the owner-item of the pane the cursor is heading into. If
|
|
266
|
+
// that owner-item is inside our own pane, the destination is a
|
|
267
|
+
// descendant submenu.
|
|
268
|
+
for (const [ownerEl, owner] of WrContextMenuItem.openSubmenus) {
|
|
269
|
+
if (owner.submenuRef?.overlayElement === targetPane) {
|
|
270
|
+
return myPane.contains(ownerEl);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
disposeSubmenu(immediate) {
|
|
276
|
+
this.cancelOpen();
|
|
277
|
+
this.cancelClose();
|
|
278
|
+
const ref = this.submenuRef;
|
|
279
|
+
if (!ref)
|
|
280
|
+
return;
|
|
281
|
+
this.submenuRef = null;
|
|
282
|
+
this.submenuOpen = false;
|
|
283
|
+
WrContextMenuItem.openSubmenus.delete(this.host.nativeElement);
|
|
284
|
+
const pane = ref.overlayElement;
|
|
285
|
+
pane.removeEventListener('mouseenter', this.onSubmenuEnter);
|
|
286
|
+
pane.removeEventListener('mouseleave', this.onSubmenuLeave);
|
|
287
|
+
// Cascade-close any descendant submenus whose owner-item lives inside
|
|
288
|
+
// the pane we're about to dispose. Without this, when a parent submenu
|
|
289
|
+
// closes (via hover-out grace timer), a grandchild submenu whose owner
|
|
290
|
+
// is rendered inside the parent's portal is orphaned — its OverlayRef
|
|
291
|
+
// stays alive in the DOM with no parent to reach it from.
|
|
292
|
+
for (const [ownerEl, owner] of WrContextMenuItem.openSubmenus) {
|
|
293
|
+
if (pane.contains(ownerEl))
|
|
294
|
+
owner.disposeSubmenu(immediate);
|
|
295
|
+
}
|
|
296
|
+
if (immediate) {
|
|
297
|
+
ref.dispose();
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
pane.classList.remove('wr-context-menu-overlay--open');
|
|
301
|
+
setTimeout(() => ref.dispose(), SUBMENU_TRANSITION_MS);
|
|
302
|
+
}
|
|
303
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrContextMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
304
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: WrContextMenuItem, isStandalone: true, selector: "wr-context-menu-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, submenu: { classPropertyName: "submenu", publicName: "submenu", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "menuitem" }, listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave($event)", "keydown.enter": "activate($event)", "keydown.space": "activate($event)", "keydown.arrowRight": "onArrowRight($event)", "keydown.arrowLeft": "onArrowLeft($event)" }, properties: { "class": "classes()", "attr.tabindex": "-1", "attr.aria-disabled": "disabled() ? true : null", "attr.aria-haspopup": "submenu() ? \"menu\" : null", "attr.aria-expanded": "submenu() ? (submenuOpen ? \"true\" : \"false\") : null" } }, ngImport: i0, template: "@if (icon(); as name) {\n <wr-icon class=\"wr-context-menu-item__icon\" [name]=\"name\" size=\"14\" />\n}\n<span class=\"wr-context-menu-item__label\"><ng-content /></span>\n@if (submenu()) {\n <svg\n class=\"wr-icon__svg wr-context-menu-item__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n}\n", dependencies: [{ kind: "component", type: WrIcon, selector: "wr-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
305
|
+
}
|
|
306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrContextMenuItem, decorators: [{
|
|
307
|
+
type: Component,
|
|
308
|
+
args: [{ selector: 'wr-context-menu-item', encapsulation: ViewEncapsulation.None, host: {
|
|
309
|
+
role: 'menuitem',
|
|
310
|
+
'[class]': 'classes()',
|
|
311
|
+
'[attr.tabindex]': '-1',
|
|
312
|
+
'[attr.aria-disabled]': 'disabled() ? true : null',
|
|
313
|
+
'[attr.aria-haspopup]': 'submenu() ? "menu" : null',
|
|
314
|
+
'[attr.aria-expanded]': 'submenu() ? (submenuOpen ? "true" : "false") : null',
|
|
315
|
+
'(mouseenter)': 'onMouseEnter()',
|
|
316
|
+
'(mouseleave)': 'onMouseLeave($event)',
|
|
317
|
+
'(keydown.enter)': 'activate($event)',
|
|
318
|
+
'(keydown.space)': 'activate($event)',
|
|
319
|
+
'(keydown.arrowRight)': 'onArrowRight($event)',
|
|
320
|
+
'(keydown.arrowLeft)': 'onArrowLeft($event)',
|
|
321
|
+
}, imports: [WrIcon], template: "@if (icon(); as name) {\n <wr-icon class=\"wr-context-menu-item__icon\" [name]=\"name\" size=\"14\" />\n}\n<span class=\"wr-context-menu-item__label\"><ng-content /></span>\n@if (submenu()) {\n <svg\n class=\"wr-icon__svg wr-context-menu-item__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n}\n" }]
|
|
322
|
+
}], ctorParameters: () => [], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], submenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "submenu", required: false }] }] } });
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* @license
|
|
326
|
+
*
|
|
327
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
328
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
329
|
+
*/
|
|
330
|
+
/**
|
|
331
|
+
* Attach to any element to show a `<wr-context-menu>` at the pointer
|
|
332
|
+
* position when the user right-clicks (or sends a `contextmenu` event by
|
|
333
|
+
* any means — long-press on touch, Shift+F10, etc.). The native browser
|
|
334
|
+
* menu is suppressed for the host element.
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* ```html
|
|
338
|
+
* <div [wrContextMenu]="menu">Right-click me</div>
|
|
339
|
+
* <wr-context-menu #menu>
|
|
340
|
+
* <wr-context-menu-item (click)="copy()">Copy</wr-context-menu-item>
|
|
341
|
+
* <wr-context-menu-item (click)="remove()">Delete</wr-context-menu-item>
|
|
342
|
+
* </wr-context-menu>
|
|
343
|
+
* ```
|
|
344
|
+
*
|
|
345
|
+
* @see https://ngwr.dev/components/context-menu
|
|
346
|
+
*/
|
|
347
|
+
class WrContextMenu {
|
|
348
|
+
/** Menu to open. Pass a `<wr-context-menu>` template reference. */
|
|
349
|
+
menu = input.required({ ...(ngDevMode ? { debugName: "menu" } : /* istanbul ignore next */ {}), alias: 'wrContextMenu' });
|
|
350
|
+
host = inject(ElementRef);
|
|
351
|
+
overlay = inject(WR_OVERLAY);
|
|
352
|
+
vcr = inject(ViewContainerRef);
|
|
353
|
+
scrollStrategies = inject(ScrollStrategyOptions);
|
|
354
|
+
destroyRef = inject(DestroyRef);
|
|
355
|
+
overlayRef = null;
|
|
356
|
+
closingTimer = null;
|
|
357
|
+
leaveTimer = null;
|
|
358
|
+
/**
|
|
359
|
+
* Single open root menu at a time. Submenu items use this to signal
|
|
360
|
+
* chain-level hover state: when the cursor enters ANY pane in the
|
|
361
|
+
* chain (root or submenu) `keepChainAlive()` cancels the close timer;
|
|
362
|
+
* when the cursor leaves ALL panes `scheduleChainClose()` starts it.
|
|
363
|
+
* The whole chain (root → submenus) tears down through the root's
|
|
364
|
+
* close (submenus react to their owner-item destroyRef + the static
|
|
365
|
+
* registry in `WrContextMenuItem`).
|
|
366
|
+
*/
|
|
367
|
+
static activeRoot = null;
|
|
368
|
+
/** Called from a submenu pane's mouseenter — keep the whole chain alive. */
|
|
369
|
+
static keepChainAlive() {
|
|
370
|
+
WrContextMenu.activeRoot?.cancelLeaveTimer();
|
|
371
|
+
}
|
|
372
|
+
/** Called from a submenu pane's mouseleave when the cursor left ALL menus. */
|
|
373
|
+
static scheduleChainClose() {
|
|
374
|
+
WrContextMenu.activeRoot?.scheduleLeave();
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Open/close animation duration in ms. Matches the longest SCSS
|
|
378
|
+
* transition on `.wr-context-menu-overlay` (the spring-scale curve).
|
|
379
|
+
* The directive holds the overlay alive for this long during close
|
|
380
|
+
* so the exit animation can play before the pane is removed from
|
|
381
|
+
* the DOM.
|
|
382
|
+
*/
|
|
383
|
+
static TRANSITION_MS = 220;
|
|
384
|
+
/**
|
|
385
|
+
* Grace window after the cursor leaves the root pane. Long enough
|
|
386
|
+
* for the user to dip momentarily into the gap between the root and
|
|
387
|
+
* a submenu (or back from a submenu), short enough to feel snappy
|
|
388
|
+
* on a deliberate hover-out.
|
|
389
|
+
*/
|
|
390
|
+
static LEAVE_DELAY = 240;
|
|
391
|
+
constructor() {
|
|
392
|
+
this.destroyRef.onDestroy(() => this.closeOverlay());
|
|
393
|
+
}
|
|
394
|
+
/** @internal Right-click handler — opens at the pointer (or re-positions if already open). */
|
|
395
|
+
onContextMenu(event) {
|
|
396
|
+
event.preventDefault();
|
|
397
|
+
event.stopPropagation();
|
|
398
|
+
// Re-open at the new position even if it was already open.
|
|
399
|
+
// Use page coords (document-relative) so the menu anchors to the
|
|
400
|
+
// zone it was opened over — scrolling the page carries the menu
|
|
401
|
+
// along with the content, matching native + PrimeNG behavior.
|
|
402
|
+
this.closeOverlay();
|
|
403
|
+
this.openOverlay(event.pageX, event.pageY);
|
|
404
|
+
}
|
|
405
|
+
/** Close the menu. */
|
|
406
|
+
close() {
|
|
407
|
+
this.closeOverlay();
|
|
408
|
+
}
|
|
409
|
+
// Overlay
|
|
410
|
+
openOverlay(x, y) {
|
|
411
|
+
// GlobalPositionStrategy uses margins, which led to flaky positioning
|
|
412
|
+
// (`position: static` inline overridden by our `!important`, etc.).
|
|
413
|
+
// Use it just to create the overlay, then write the coords directly to
|
|
414
|
+
// the pane element via `top`/`left` so the menu sits exactly where the
|
|
415
|
+
// user clicked and never moves until we close it.
|
|
416
|
+
this.overlayRef = this.overlay.create({
|
|
417
|
+
positionStrategy: this.overlay.position().global(),
|
|
418
|
+
// `noop` so scroll doesn't dismiss the menu. With absolute coords
|
|
419
|
+
// pinned to viewport (`position: fixed` in the panel CSS), the menu
|
|
420
|
+
// visually stays put as the page scrolls underneath.
|
|
421
|
+
scrollStrategy: this.scrollStrategies.noop(),
|
|
422
|
+
panelClass: ['wr-context-menu-overlay'],
|
|
423
|
+
});
|
|
424
|
+
const portal = new TemplatePortal(this.menu().contentTpl(), this.vcr);
|
|
425
|
+
this.overlayRef.attach(portal);
|
|
426
|
+
// Position model: the pane uses `position: fixed` (panel CSS) but we
|
|
427
|
+
// want the menu to anchor to the DOCUMENT — when the user scrolls,
|
|
428
|
+
// the menu should travel with the content it was opened over (native
|
|
429
|
+
// browser + PrimeNG behavior). Strategy:
|
|
430
|
+
//
|
|
431
|
+
// - Record the page coords (pageX/pageY = document-relative).
|
|
432
|
+
// - Each frame the user scrolls, set top/left to (pageX/Y minus the
|
|
433
|
+
// current scroll offset). At scroll 0 this matches clientX/Y; as
|
|
434
|
+
// scroll grows the menu shifts up/left visually, which is exactly
|
|
435
|
+
// what `position: absolute` inside an un-fixed container would do
|
|
436
|
+
// naturally — we just have to emulate it manually because CDK's
|
|
437
|
+
// overlay container is `position: fixed`.
|
|
438
|
+
const pane = this.overlayRef.overlayElement;
|
|
439
|
+
pane.style.right = 'auto';
|
|
440
|
+
pane.style.bottom = 'auto';
|
|
441
|
+
pane.style.margin = '0';
|
|
442
|
+
const sync = () => {
|
|
443
|
+
pane.style.top = `${y - window.scrollY}px`;
|
|
444
|
+
pane.style.left = `${x - window.scrollX}px`;
|
|
445
|
+
};
|
|
446
|
+
sync();
|
|
447
|
+
// Trigger the open transition on the next frame — adding the class
|
|
448
|
+
// synchronously with attach would skip the initial 0→1 frame and
|
|
449
|
+
// the menu would just appear without animating.
|
|
450
|
+
requestAnimationFrame(() => pane.classList.add('wr-context-menu-overlay--open'));
|
|
451
|
+
// Hover-out closes the menu after a grace window, unless the
|
|
452
|
+
// cursor moved INTO a descendant submenu (any other
|
|
453
|
+
// `.wr-context-menu-overlay`). Re-entering the root cancels the
|
|
454
|
+
// scheduled close so the user can dip out and back without losing
|
|
455
|
+
// the menu.
|
|
456
|
+
const onPaneLeave = (event) => {
|
|
457
|
+
const related = event.relatedTarget;
|
|
458
|
+
// Moving into ANY other menu pane (a submenu) keeps the chain
|
|
459
|
+
// alive — the submenu's own mouseenter will cancel any pending
|
|
460
|
+
// chain-close. Only schedule when the cursor genuinely left the
|
|
461
|
+
// chain.
|
|
462
|
+
if (related instanceof Element && related.closest('.wr-context-menu-overlay'))
|
|
463
|
+
return;
|
|
464
|
+
this.scheduleLeave();
|
|
465
|
+
};
|
|
466
|
+
const onPaneEnter = () => this.cancelLeaveTimer();
|
|
467
|
+
pane.addEventListener('mouseleave', onPaneLeave);
|
|
468
|
+
pane.addEventListener('mouseenter', onPaneEnter);
|
|
469
|
+
WrContextMenu.activeRoot = this;
|
|
470
|
+
this.overlayRef.detachments().subscribe(() => {
|
|
471
|
+
pane.removeEventListener('mouseleave', onPaneLeave);
|
|
472
|
+
pane.removeEventListener('mouseenter', onPaneEnter);
|
|
473
|
+
});
|
|
474
|
+
// Capture-phase listener on document catches scroll events from ANY
|
|
475
|
+
// ancestor (window, html, body, custom scroll containers), so the
|
|
476
|
+
// menu stays anchored to the click position even inside scrollable
|
|
477
|
+
// layouts.
|
|
478
|
+
document.addEventListener('scroll', sync, { capture: true, passive: true });
|
|
479
|
+
// On resize the page layout reflows — the original pageX/pageY no
|
|
480
|
+
// longer points at whatever the user right-clicked. Dismiss the menu
|
|
481
|
+
// rather than dragging it across a now-stale coordinate (matches
|
|
482
|
+
// PrimeNG / native behavior).
|
|
483
|
+
const onResize = () => this.closeOverlay();
|
|
484
|
+
window.addEventListener('resize', onResize, { passive: true });
|
|
485
|
+
this.overlayRef.detachments().subscribe(() => {
|
|
486
|
+
document.removeEventListener('scroll', sync, { capture: true });
|
|
487
|
+
window.removeEventListener('resize', onResize);
|
|
488
|
+
});
|
|
489
|
+
// The right-click that opens the menu still has `mouseup` + `auxclick`
|
|
490
|
+
// events pending. CDK's `outsidePointerEvents()` listens to pointerdown
|
|
491
|
+
// / auxclick and would fire on those — closing the menu the instant
|
|
492
|
+
// the user lifts their finger. Two-part guard:
|
|
493
|
+
// 1. Track the open timestamp.
|
|
494
|
+
// 2. Ignore any outside events that arrive within a short window
|
|
495
|
+
// after the open (long enough to cover the original mouseup +
|
|
496
|
+
// auxclick, short enough that a deliberate second click is
|
|
497
|
+
// still respected).
|
|
498
|
+
const openedAt = performance.now();
|
|
499
|
+
const ref = this.overlayRef;
|
|
500
|
+
ref
|
|
501
|
+
.outsidePointerEvents()
|
|
502
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
503
|
+
.subscribe(() => {
|
|
504
|
+
if (performance.now() - openedAt < 200)
|
|
505
|
+
return;
|
|
506
|
+
this.closeOverlay();
|
|
507
|
+
});
|
|
508
|
+
this.overlayRef
|
|
509
|
+
.keydownEvents()
|
|
510
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
511
|
+
.subscribe(event => {
|
|
512
|
+
if (event.key === 'Escape') {
|
|
513
|
+
event.preventDefault();
|
|
514
|
+
this.closeOverlay();
|
|
515
|
+
this.host.nativeElement.focus();
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
closeOverlay() {
|
|
520
|
+
if (!this.overlayRef)
|
|
521
|
+
return;
|
|
522
|
+
this.cancelLeaveTimer();
|
|
523
|
+
if (WrContextMenu.activeRoot === this)
|
|
524
|
+
WrContextMenu.activeRoot = null;
|
|
525
|
+
// Submenu panes live in the CDK overlay container, not inside the
|
|
526
|
+
// root pane's view — destroyRef cascade through portal detach
|
|
527
|
+
// doesn't reach them. Close them all explicitly first so they
|
|
528
|
+
// don't float when the root is dismissed (outside-click, Esc, etc).
|
|
529
|
+
WrContextMenuItem.disposeAll(false);
|
|
530
|
+
const ref = this.overlayRef;
|
|
531
|
+
const pane = ref.overlayElement;
|
|
532
|
+
// Detach immediately would skip the exit animation. Remove the open
|
|
533
|
+
// class first so the SCSS transition runs back to the default
|
|
534
|
+
// (faded + scaled-down) state, then dispose after the transition.
|
|
535
|
+
pane.classList.remove('wr-context-menu-overlay--open');
|
|
536
|
+
if (this.closingTimer !== null)
|
|
537
|
+
clearTimeout(this.closingTimer);
|
|
538
|
+
this.closingTimer = setTimeout(() => {
|
|
539
|
+
ref.dispose();
|
|
540
|
+
this.closingTimer = null;
|
|
541
|
+
}, WrContextMenu.TRANSITION_MS);
|
|
542
|
+
// Mark immediately so a subsequent right-click opens a fresh menu
|
|
543
|
+
// rather than landing on the disposing one.
|
|
544
|
+
this.overlayRef = null;
|
|
545
|
+
}
|
|
546
|
+
cancelLeaveTimer() {
|
|
547
|
+
if (this.leaveTimer !== null) {
|
|
548
|
+
clearTimeout(this.leaveTimer);
|
|
549
|
+
this.leaveTimer = null;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
scheduleLeave() {
|
|
553
|
+
this.cancelLeaveTimer();
|
|
554
|
+
this.leaveTimer = setTimeout(() => {
|
|
555
|
+
this.leaveTimer = null;
|
|
556
|
+
this.closeOverlay();
|
|
557
|
+
}, WrContextMenu.LEAVE_DELAY);
|
|
558
|
+
}
|
|
559
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrContextMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
560
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.1", type: WrContextMenu, isStandalone: true, selector: "[wrContextMenu]", inputs: { menu: { classPropertyName: "menu", publicName: "wrContextMenu", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "contextmenu": "onContextMenu($event)" } }, ngImport: i0 });
|
|
561
|
+
}
|
|
562
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrContextMenu, decorators: [{
|
|
563
|
+
type: Directive,
|
|
564
|
+
args: [{
|
|
565
|
+
selector: '[wrContextMenu]',
|
|
566
|
+
host: {
|
|
567
|
+
'(contextmenu)': 'onContextMenu($event)',
|
|
568
|
+
},
|
|
569
|
+
}]
|
|
570
|
+
}], ctorParameters: () => [], propDecorators: { menu: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrContextMenu", required: true }] }] } });
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* @license
|
|
574
|
+
*
|
|
575
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
576
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
577
|
+
*/
|
|
578
|
+
/**
|
|
579
|
+
* Container for the rows shown when a {@link WrContextMenu} opens.
|
|
580
|
+
* The component itself doesn't render; the directive portals the inner
|
|
581
|
+
* template into an overlay positioned at the pointer.
|
|
582
|
+
*
|
|
583
|
+
* @example
|
|
584
|
+
* ```html
|
|
585
|
+
* <div [wrContextMenu]="menu">Right-click me</div>
|
|
586
|
+
* <wr-context-menu #menu>
|
|
587
|
+
* <wr-context-menu-item icon="copy" (click)="copy()">Copy</wr-context-menu-item>
|
|
588
|
+
* <wr-context-menu-item icon="trash" (click)="remove()">Delete</wr-context-menu-item>
|
|
589
|
+
* </wr-context-menu>
|
|
590
|
+
* ```
|
|
591
|
+
*/
|
|
592
|
+
class WrContextMenuPanel {
|
|
593
|
+
/** The internal template the directive portals into the overlay. @internal */
|
|
594
|
+
contentTpl = viewChild.required(TemplateRef);
|
|
595
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrContextMenuPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
596
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.1", type: WrContextMenuPanel, isStandalone: true, selector: "wr-context-menu", host: { styleAttribute: "display:none" }, viewQueries: [{ propertyName: "contentTpl", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], exportAs: ["wrContextMenu"], ngImport: i0, template: '<ng-template><div class="wr-context-menu" role="menu"><ng-content /></div></ng-template>', isInline: true, encapsulation: i0.ViewEncapsulation.None });
|
|
597
|
+
}
|
|
598
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrContextMenuPanel, decorators: [{
|
|
599
|
+
type: Component,
|
|
600
|
+
args: [{
|
|
601
|
+
selector: 'wr-context-menu',
|
|
602
|
+
template: '<ng-template><div class="wr-context-menu" role="menu"><ng-content /></div></ng-template>',
|
|
603
|
+
exportAs: 'wrContextMenu',
|
|
604
|
+
encapsulation: ViewEncapsulation.None,
|
|
605
|
+
host: { style: 'display:none' },
|
|
606
|
+
}]
|
|
607
|
+
}], propDecorators: { contentTpl: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* @license
|
|
611
|
+
*
|
|
612
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
613
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
614
|
+
*/
|
|
615
|
+
/**
|
|
616
|
+
* Thin horizontal separator inside a `<wr-context-menu>`. Use it to
|
|
617
|
+
* group related items (e.g., a destructive action below a divider, or
|
|
618
|
+
* a "More" section below the primary items).
|
|
619
|
+
*
|
|
620
|
+
* @example
|
|
621
|
+
* ```html
|
|
622
|
+
* <wr-context-menu #menu>
|
|
623
|
+
* <wr-context-menu-item (click)="copy()">Copy</wr-context-menu-item>
|
|
624
|
+
* <wr-context-menu-item (click)="paste()">Paste</wr-context-menu-item>
|
|
625
|
+
* <wr-context-menu-divider />
|
|
626
|
+
* <wr-context-menu-item (click)="remove()">Delete</wr-context-menu-item>
|
|
627
|
+
* </wr-context-menu>
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
class WrContextMenuDivider {
|
|
631
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrContextMenuDivider, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
632
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.1", type: WrContextMenuDivider, isStandalone: true, selector: "wr-context-menu-divider", host: { attributes: { "role": "separator", "aria-orientation": "horizontal" }, classAttribute: "wr-context-menu-divider" }, ngImport: i0, template: '', isInline: true, encapsulation: i0.ViewEncapsulation.None });
|
|
633
|
+
}
|
|
634
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrContextMenuDivider, decorators: [{
|
|
635
|
+
type: Component,
|
|
636
|
+
args: [{
|
|
637
|
+
selector: 'wr-context-menu-divider',
|
|
638
|
+
template: '',
|
|
639
|
+
encapsulation: ViewEncapsulation.None,
|
|
640
|
+
host: {
|
|
641
|
+
class: 'wr-context-menu-divider',
|
|
642
|
+
role: 'separator',
|
|
643
|
+
'aria-orientation': 'horizontal',
|
|
644
|
+
},
|
|
645
|
+
}]
|
|
646
|
+
}] });
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Generated bundle index. Do not edit.
|
|
650
|
+
*/
|
|
651
|
+
|
|
652
|
+
export { WrContextMenu, WrContextMenuDivider, WrContextMenuItem, WrContextMenuPanel };
|
|
653
|
+
//# sourceMappingURL=ngwr-context-menu.mjs.map
|