@ngstarter-ui/components 22.3.6 → 22.4.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/README.md +27 -0
- package/ai/component-registry.json +186 -101
- package/fesm2022/attachment-block-BK9QxVjq.mjs +163 -0
- package/fesm2022/attachment-block-BK9QxVjq.mjs.map +1 -0
- package/fesm2022/callout-block-Bl4GZYz8.mjs +196 -0
- package/fesm2022/callout-block-Bl4GZYz8.mjs.map +1 -0
- package/fesm2022/code-block.component-DCRD-9iP.mjs +393 -0
- package/fesm2022/code-block.component-DCRD-9iP.mjs.map +1 -0
- package/fesm2022/content-builder.store-D622mHxt.mjs +328 -0
- package/fesm2022/content-builder.store-D622mHxt.mjs.map +1 -0
- package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs +1110 -0
- package/fesm2022/content-editor-content-editable.directive-WzD9_71s.mjs.map +1 -0
- package/fesm2022/cursor-controller-DKfBII1n.mjs +55 -0
- package/fesm2022/cursor-controller-DKfBII1n.mjs.map +1 -0
- package/fesm2022/default-converters-9oSKDsXP.mjs +140 -0
- package/fesm2022/default-converters-9oSKDsXP.mjs.map +1 -0
- package/fesm2022/divider-block.component-Dvgeq_D0.mjs +148 -0
- package/fesm2022/divider-block.component-Dvgeq_D0.mjs.map +1 -0
- package/fesm2022/embed-block-CYkOv4Wt.mjs +565 -0
- package/fesm2022/embed-block-CYkOv4Wt.mjs.map +1 -0
- package/fesm2022/extra-block-defs-Cn_hfM3c.mjs +122 -0
- package/fesm2022/extra-block-defs-Cn_hfM3c.mjs.map +1 -0
- package/fesm2022/gallery-block-DT3uIURY.mjs +365 -0
- package/fesm2022/gallery-block-DT3uIURY.mjs.map +1 -0
- package/fesm2022/grid-block-ZVDT3m8-.mjs +504 -0
- package/fesm2022/grid-block-ZVDT3m8-.mjs.map +1 -0
- package/fesm2022/heading-block.component-iCpJGTMh.mjs +274 -0
- package/fesm2022/heading-block.component-iCpJGTMh.mjs.map +1 -0
- package/fesm2022/html-utils-DywL8gGa.mjs +24 -0
- package/fesm2022/html-utils-DywL8gGa.mjs.map +1 -0
- package/fesm2022/image-block.component-DJ7-HCR8.mjs +285 -0
- package/fesm2022/image-block.component-DJ7-HCR8.mjs.map +1 -0
- package/fesm2022/list-block.component-qFIebEBO.mjs +312 -0
- package/fesm2022/list-block.component-qFIebEBO.mjs.map +1 -0
- package/fesm2022/nested-blocks-CXhgXJ1H.mjs +345 -0
- package/fesm2022/nested-blocks-CXhgXJ1H.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-action-required.mjs +150 -45
- package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-alert.mjs +318 -133
- package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-announcement.mjs +280 -88
- package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs +647 -386
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-avatar.mjs +715 -482
- package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-badge.mjs +308 -97
- package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-block-loader.mjs +164 -47
- package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +278 -315
- package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +707 -205
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs +518 -175
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-button.mjs +294 -68
- package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-calendar.mjs +442 -250
- package/fesm2022/ngstarter-ui-components-calendar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs +159 -47
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-card.mjs +619 -194
- package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-carousel.mjs +1012 -634
- package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-checkbox.mjs +715 -308
- package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-chips.mjs +1397 -667
- package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +519 -357
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-picker.mjs +1218 -604
- package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs +265 -134
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs +190 -71
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-command-bar.mjs +197 -58
- package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs +2212 -1128
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +269 -183
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-confirm.mjs +164 -86
- package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +6240 -2
- package/fesm2022/ngstarter-ui-components-content-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +244 -108
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-core.mjs +2110 -1592
- package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-country-select.mjs +1970 -588
- package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-crop.mjs +249 -191
- package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-currency-select.mjs +1658 -452
- package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-data-view.mjs +4538 -2497
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs +357 -157
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-datepicker.mjs +2587 -1264
- package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-dialog.mjs +681 -385
- package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-digit-roller.mjs +1000 -750
- package/fesm2022/ngstarter-ui-components-digit-roller.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-divider.mjs +164 -41
- package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-drawer.mjs +218 -143
- package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +345 -247
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-empty-state.mjs +244 -74
- package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-events.mjs +467 -126
- package/fesm2022/ngstarter-ui-components-events.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-expand.mjs +191 -59
- package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-expansion.mjs +529 -193
- package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-file-type.mjs +270 -171
- package/fesm2022/ngstarter-ui-components-file-type.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +741 -352
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-form-builder.mjs +9032 -6964
- package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-form-field.mjs +741 -276
- package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-gauge.mjs +155 -43
- package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-grid.mjs +197 -81
- package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs +881 -740
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs +3573 -3656
- package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +277 -204
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-icon.mjs +209 -182
- package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +5096 -4066
- package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +45 -19
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs +333 -154
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs +564 -358
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +246 -167
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-incidents.mjs +732 -258
- package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +244 -182
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-input-mask.mjs +314 -174
- package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-input-validator.mjs +45 -69
- package/fesm2022/ngstarter-ui-components-input-validator.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-input.mjs +303 -161
- package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +504 -159
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-kbd.mjs +86 -30
- package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-layout.mjs +681 -220
- package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-list.mjs +968 -281
- package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-logo.mjs +181 -51
- package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-marquee.mjs +226 -147
- package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-menu.mjs +1686 -1091
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs +1541 -943
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-navigation.mjs +1035 -455
- package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-notifications.mjs +678 -230
- package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-number-input.mjs +616 -316
- package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-option.mjs +405 -163
- package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-overlay.mjs +107 -111
- package/fesm2022/ngstarter-ui-components-overlay.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +131 -76
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-paginator.mjs +543 -295
- package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-password-strength.mjs +785 -340
- package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs +3705 -2695
- package/fesm2022/ngstarter-ui-components-pdf-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-signer.mjs +1179 -851
- package/fesm2022/ngstarter-ui-components-pdf-signer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs +2973 -2070
- package/fesm2022/ngstarter-ui-components-pdf-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +2081 -770
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-pin-input.mjs +366 -198
- package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-popover.mjs +558 -308
- package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs +178 -73
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-radio-card.mjs +301 -105
- package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-radio.mjs +417 -157
- package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs +208 -88
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs +123 -74
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs +197 -95
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +383 -245
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +705 -581
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-segmented.mjs +422 -220
- package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-select.mjs +1862 -1159
- package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-side-panel.mjs +313 -118
- package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sidebar.mjs +1239 -470
- package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sidenav.mjs +664 -354
- package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +1092 -643
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-skeleton.mjs +153 -43
- package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +425 -108
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-slider.mjs +645 -487
- package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs +372 -354
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-sort.mjs +378 -147
- package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-spinner.mjs +242 -76
- package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs +142 -91
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-split.mjs +1067 -929
- package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-step-tracker.mjs +617 -331
- package/fesm2022/ngstarter-ui-components-step-tracker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-stepper.mjs +357 -126
- package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-suggestions.mjs +259 -72
- package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs +674 -267
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-table.mjs +1144 -662
- package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tabs.mjs +1236 -615
- package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +414 -216
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tiles.mjs +939 -647
- package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timeline.mjs +418 -122
- package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timepicker.mjs +870 -508
- package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs +651 -371
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-toolbar.mjs +727 -320
- package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tooltip.mjs +601 -521
- package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tree-select.mjs +1197 -434
- package/fesm2022/ngstarter-ui-components-tree-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-tree.mjs +1821 -1262
- package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-upload.mjs +1059 -345
- package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-video-player.mjs +763 -533
- package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs +630 -229
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs +40 -17
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-whiteboard.mjs +3039 -1803
- package/fesm2022/ngstarter-ui-components-whiteboard.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components.mjs +3 -5
- package/fesm2022/ngstarter-ui-components.mjs.map +1 -1
- package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs +264 -0
- package/fesm2022/paragraph-block.component-Csk8Gu3x.mjs.map +1 -0
- package/fesm2022/plain-text-settings-BnxCxLhA.mjs +354 -0
- package/fesm2022/plain-text-settings-BnxCxLhA.mjs.map +1 -0
- package/fesm2022/quote-block.component-tRmrU97F.mjs +309 -0
- package/fesm2022/quote-block.component-tRmrU97F.mjs.map +1 -0
- package/fesm2022/table-block.component-BuzRRggv.mjs +1859 -0
- package/fesm2022/table-block.component-BuzRRggv.mjs.map +1 -0
- package/fesm2022/toggle-block-C5Jo2YDf.mjs +150 -0
- package/fesm2022/toggle-block-C5Jo2YDf.mjs.map +1 -0
- package/fesm2022/upload-status-tZ0x0BUB.mjs +107 -0
- package/fesm2022/upload-status-tZ0x0BUB.mjs.map +1 -0
- package/fesm2022/video-block.component-CpAXibm6.mjs +312 -0
- package/fesm2022/video-block.component-CpAXibm6.mjs.map +1 -0
- package/package.json +11 -10
- package/styles/_tokens.scss +1 -0
- package/types/ngstarter-ui-components-action-required.d.ts +34 -14
- package/types/ngstarter-ui-components-alert.d.ts +53 -44
- package/types/ngstarter-ui-components-announcement.d.ts +74 -53
- package/types/ngstarter-ui-components-autocomplete.d.ts +141 -84
- package/types/ngstarter-ui-components-avatar.d.ts +113 -66
- package/types/ngstarter-ui-components-badge.d.ts +73 -37
- package/types/ngstarter-ui-components-block-loader.d.ts +32 -20
- package/types/ngstarter-ui-components-bottom-sheet.d.ts +125 -132
- package/types/ngstarter-ui-components-breadcrumbs.d.ts +93 -88
- package/types/ngstarter-ui-components-button-toggle.d.ts +124 -54
- package/types/ngstarter-ui-components-button.d.ts +69 -27
- package/types/ngstarter-ui-components-calendar.d.ts +123 -71
- package/types/ngstarter-ui-components-card-overlay.d.ts +31 -19
- package/types/ngstarter-ui-components-card.d.ts +75 -71
- package/types/ngstarter-ui-components-carousel.d.ts +115 -69
- package/types/ngstarter-ui-components-checkbox.d.ts +183 -86
- package/types/ngstarter-ui-components-chips.d.ts +288 -195
- package/types/ngstarter-ui-components-code-highlighter.d.ts +71 -28
- package/types/ngstarter-ui-components-color-picker.d.ts +140 -89
- package/types/ngstarter-ui-components-color-scheme.d.ts +43 -52
- package/types/ngstarter-ui-components-color-switcher.d.ts +46 -26
- package/types/ngstarter-ui-components-command-bar.d.ts +40 -26
- package/types/ngstarter-ui-components-comment-editor.d.ts +311 -235
- package/types/ngstarter-ui-components-comparison-slider.d.ts +41 -40
- package/types/ngstarter-ui-components-confirm.d.ts +24 -29
- package/types/ngstarter-ui-components-content-editor.d.ts +1482 -998
- package/types/ngstarter-ui-components-cookie-popup.d.ts +43 -38
- package/types/ngstarter-ui-components-core.d.ts +513 -467
- package/types/ngstarter-ui-components-country-select.d.ts +170 -97
- package/types/ngstarter-ui-components-crop.d.ts +67 -52
- package/types/ngstarter-ui-components-currency-select.d.ts +127 -90
- package/types/ngstarter-ui-components-data-view.d.ts +811 -567
- package/types/ngstarter-ui-components-date-format-select.d.ts +90 -58
- package/types/ngstarter-ui-components-datepicker.d.ts +589 -373
- package/types/ngstarter-ui-components-dialog.d.ts +138 -116
- package/types/ngstarter-ui-components-digit-roller.d.ts +228 -131
- package/types/ngstarter-ui-components-divider.d.ts +29 -17
- package/types/ngstarter-ui-components-drawer.d.ts +39 -30
- package/types/ngstarter-ui-components-emoji-picker.d.ts +69 -47
- package/types/ngstarter-ui-components-empty-state.d.ts +20 -28
- package/types/ngstarter-ui-components-events.d.ts +73 -57
- package/types/ngstarter-ui-components-expand.d.ts +55 -25
- package/types/ngstarter-ui-components-expansion.d.ts +93 -64
- package/types/ngstarter-ui-components-file-type.d.ts +53 -27
- package/types/ngstarter-ui-components-filter-builder.d.ts +131 -100
- package/types/ngstarter-ui-components-form-builder.d.ts +1094 -881
- package/types/ngstarter-ui-components-form-field.d.ts +116 -105
- package/types/ngstarter-ui-components-gauge.d.ts +32 -20
- package/types/ngstarter-ui-components-grid.d.ts +66 -50
- package/types/ngstarter-ui-components-guided-tour.d.ts +250 -222
- package/types/ngstarter-ui-components-headless-editor.d.ts +708 -658
- package/types/ngstarter-ui-components-headless-stepper.d.ts +84 -64
- package/types/ngstarter-ui-components-icon.d.ts +39 -38
- package/types/ngstarter-ui-components-image-designer.d.ts +422 -341
- package/types/ngstarter-ui-components-image-placeholder.d.ts +5 -8
- package/types/ngstarter-ui-components-image-resizer.d.ts +40 -33
- package/types/ngstarter-ui-components-image-viewer.d.ts +67 -54
- package/types/ngstarter-ui-components-image-zoom-viewer.d.ts +29 -33
- package/types/ngstarter-ui-components-incidents.d.ts +97 -104
- package/types/ngstarter-ui-components-inline-text-edit.d.ts +54 -39
- package/types/ngstarter-ui-components-input-mask.d.ts +54 -34
- package/types/ngstarter-ui-components-input-validator.d.ts +7 -11
- package/types/ngstarter-ui-components-input.d.ts +82 -54
- package/types/ngstarter-ui-components-kanban-board.d.ts +76 -63
- package/types/ngstarter-ui-components-kbd.d.ts +8 -12
- package/types/ngstarter-ui-components-layout.d.ts +131 -87
- package/types/ngstarter-ui-components-list.d.ts +123 -88
- package/types/ngstarter-ui-components-logo.d.ts +21 -21
- package/types/ngstarter-ui-components-marquee.d.ts +41 -34
- package/types/ngstarter-ui-components-menu.d.ts +329 -221
- package/types/ngstarter-ui-components-micro-chart.d.ts +385 -186
- package/types/ngstarter-ui-components-navigation.d.ts +186 -125
- package/types/ngstarter-ui-components-notifications.d.ts +104 -89
- package/types/ngstarter-ui-components-number-input.d.ts +138 -96
- package/types/ngstarter-ui-components-option.d.ts +102 -68
- package/types/ngstarter-ui-components-overlay.d.ts +7 -12
- package/types/ngstarter-ui-components-page-loading-bar.d.ts +23 -20
- package/types/ngstarter-ui-components-paginator.d.ts +171 -129
- package/types/ngstarter-ui-components-password-strength.d.ts +217 -102
- package/types/ngstarter-ui-components-pdf-builder.d.ts +717 -649
- package/types/ngstarter-ui-components-pdf-signer.d.ts +202 -142
- package/types/ngstarter-ui-components-pdf-viewer.d.ts +544 -385
- package/types/ngstarter-ui-components-phone-input.d.ts +175 -115
- package/types/ngstarter-ui-components-pin-input.d.ts +83 -45
- package/types/ngstarter-ui-components-popover.d.ts +128 -89
- package/types/ngstarter-ui-components-progress-bar.d.ts +49 -30
- package/types/ngstarter-ui-components-radio-card.d.ts +50 -34
- package/types/ngstarter-ui-components-radio.d.ts +100 -47
- package/types/ngstarter-ui-components-rail-nav.d.ts +36 -29
- package/types/ngstarter-ui-components-resizable-container.d.ts +30 -25
- package/types/ngstarter-ui-components-screen-loader.d.ts +38 -32
- package/types/ngstarter-ui-components-scroll-spy.d.ts +56 -60
- package/types/ngstarter-ui-components-scrollbar-area.d.ts +116 -86
- package/types/ngstarter-ui-components-segmented.d.ts +93 -61
- package/types/ngstarter-ui-components-select.d.ts +366 -266
- package/types/ngstarter-ui-components-side-panel.d.ts +59 -40
- package/types/ngstarter-ui-components-sidebar.d.ts +208 -154
- package/types/ngstarter-ui-components-sidenav.d.ts +136 -78
- package/types/ngstarter-ui-components-signature-pad.d.ts +165 -92
- package/types/ngstarter-ui-components-skeleton.d.ts +18 -17
- package/types/ngstarter-ui-components-slide-toggle.d.ts +113 -44
- package/types/ngstarter-ui-components-slider.d.ts +123 -82
- package/types/ngstarter-ui-components-snack-bar.d.ts +126 -134
- package/types/ngstarter-ui-components-sort.d.ts +99 -63
- package/types/ngstarter-ui-components-spinner.d.ts +49 -27
- package/types/ngstarter-ui-components-splash-screen.d.ts +34 -29
- package/types/ngstarter-ui-components-split.d.ts +276 -195
- package/types/ngstarter-ui-components-step-tracker.d.ts +102 -83
- package/types/ngstarter-ui-components-stepper.d.ts +57 -43
- package/types/ngstarter-ui-components-suggestions.d.ts +41 -28
- package/types/ngstarter-ui-components-tab-panel.d.ts +110 -83
- package/types/ngstarter-ui-components-table.d.ts +256 -228
- package/types/ngstarter-ui-components-tabs.d.ts +231 -138
- package/types/ngstarter-ui-components-thumbnail-maker.d.ts +40 -34
- package/types/ngstarter-ui-components-tiles.d.ts +166 -104
- package/types/ngstarter-ui-components-timeline.d.ts +45 -57
- package/types/ngstarter-ui-components-timepicker.d.ts +166 -111
- package/types/ngstarter-ui-components-timezone-select.d.ts +110 -70
- package/types/ngstarter-ui-components-toolbar.d.ts +89 -72
- package/types/ngstarter-ui-components-tooltip.d.ts +89 -52
- package/types/ngstarter-ui-components-tree-select.d.ts +182 -105
- package/types/ngstarter-ui-components-tree.d.ts +355 -229
- package/types/ngstarter-ui-components-upload.d.ts +216 -131
- package/types/ngstarter-ui-components-video-player.d.ts +130 -67
- package/types/ngstarter-ui-components-video-viewer.d.ts +140 -91
- package/types/ngstarter-ui-components-visual-builder.d.ts +5 -8
- package/types/ngstarter-ui-components-whiteboard.d.ts +412 -339
- package/types/ngstarter-ui-components.d.ts +2 -2
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs +0 -35
- package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-BgKuFsDy.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs +0 -26
- package/fesm2022/ngstarter-ui-components-content-editor-callout-block-CGTJefVK.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs +0 -220
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-B441NasU.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs +0 -99
- package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs +0 -40
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-D1nXMRXD.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs +0 -375
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-Bo3irEeG.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs +0 -80
- package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-Cbh0nblW.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs +0 -65
- package/fesm2022/ngstarter-ui-components-content-editor-grid-block-BVQTRzaX.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs +0 -137
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-CnbRqEWF.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs +0 -113
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-Cv9-02mR.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs +0 -188
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-yvSNKY0B.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs +0 -117
- package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Clz9SzCR.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs +0 -4464
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs +0 -132
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-CxDRklAS.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs +0 -171
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BNgtiV7U.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs +0 -1653
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs +0 -20
- package/fesm2022/ngstarter-ui-components-content-editor-toggle-block-Ch1kWIaX.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +0 -19
- package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs +0 -134
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-laP7DTyq.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs +0 -159
- package/fesm2022/ngstarter-ui-components-form-builder-plain-text-settings-GNXKGonc.mjs.map +0 -1
|
@@ -1,1653 +0,0 @@
|
|
|
1
|
-
import { a as CONTENT_BUILDER, C as ContentBuilderStore, c as cloneContentEditorValue, b as contentEditorText, d as ContentEditorContentEditableDirective, e as CONTENT_EDITOR_BLOCK } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CZn1p9ek.mjs';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, ElementRef, DestroyRef, output, afterNextRender, Directive, PLATFORM_ID, input, effect, Input, Renderer2, NgZone, booleanAttribute, HostBinding, ChangeDetectionStrategy, Component, ChangeDetectorRef, viewChild, computed, signal, untracked } from '@angular/core';
|
|
4
|
-
import { DOCUMENT, isPlatformServer, isPlatformBrowser } from '@angular/common';
|
|
5
|
-
import SelectionArea from '@viselect/vanilla';
|
|
6
|
-
import { Icon } from '@ngstarter-ui/components/icon';
|
|
7
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
|
-
import { fromEvent, Subject } from 'rxjs';
|
|
9
|
-
import { CdkMonitorFocus } from '@angular/cdk/a11y';
|
|
10
|
-
import { takeUntil } from 'rxjs/operators';
|
|
11
|
-
import { moveItemInArray } from '@angular/cdk/drag-drop';
|
|
12
|
-
|
|
13
|
-
class TableColumnsManagerDirective {
|
|
14
|
-
_elementRef = inject(ElementRef);
|
|
15
|
-
_destroyRef = inject(DestroyRef);
|
|
16
|
-
_document = inject(DOCUMENT);
|
|
17
|
-
_dragging = false;
|
|
18
|
-
_elementPosition = 0;
|
|
19
|
-
_cellWidth = 90;
|
|
20
|
-
columnAdded = output();
|
|
21
|
-
columnDeleted = output();
|
|
22
|
-
columnManagingStart = output();
|
|
23
|
-
columnManagingEnd = output();
|
|
24
|
-
constructor() {
|
|
25
|
-
afterNextRender(() => {
|
|
26
|
-
this._initResize();
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
onContextMenu(event) {
|
|
30
|
-
event.preventDefault();
|
|
31
|
-
event.stopPropagation();
|
|
32
|
-
}
|
|
33
|
-
_initResize() {
|
|
34
|
-
fromEvent(this._elementRef.nativeElement, 'mousedown')
|
|
35
|
-
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
36
|
-
.subscribe((event) => {
|
|
37
|
-
this._dragging = true;
|
|
38
|
-
const elementRect = this._elementRef.nativeElement.getBoundingClientRect();
|
|
39
|
-
this._elementPosition = elementRect.x + elementRect.width / 2;
|
|
40
|
-
this.columnManagingStart.emit();
|
|
41
|
-
});
|
|
42
|
-
fromEvent(this._document, 'mousemove')
|
|
43
|
-
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
44
|
-
.subscribe((event) => {
|
|
45
|
-
if (this._dragging) {
|
|
46
|
-
const elementRect = this._elementRef.nativeElement.getBoundingClientRect();
|
|
47
|
-
const elementRightPosition = elementRect.x + elementRect.width;
|
|
48
|
-
const elementLeftPosition = elementRect.x;
|
|
49
|
-
if (event.clientX > (this._elementPosition + this._cellWidth) && event.clientX > (elementRightPosition + this._cellWidth)) {
|
|
50
|
-
this._elementPosition = Math.max(this._elementPosition, elementRightPosition) + this._cellWidth;
|
|
51
|
-
this.columnAdded.emit();
|
|
52
|
-
}
|
|
53
|
-
else if (event.clientX < (this._elementPosition - this._cellWidth) && event.clientX < (elementLeftPosition - this._cellWidth)) {
|
|
54
|
-
this._elementPosition = Math.min(this._elementPosition, elementLeftPosition) - this._cellWidth;
|
|
55
|
-
this.columnDeleted.emit();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
fromEvent(this._document, 'mouseup')
|
|
60
|
-
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
61
|
-
.subscribe((event) => {
|
|
62
|
-
if (this._dragging) {
|
|
63
|
-
this._dragging = false;
|
|
64
|
-
this.columnManagingEnd.emit();
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TableColumnsManagerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
69
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: TableColumnsManagerDirective, isStandalone: true, selector: "[ngsTableColumnsManager]", outputs: { columnAdded: "columnAdded", columnDeleted: "columnDeleted", columnManagingStart: "columnManagingStart", columnManagingEnd: "columnManagingEnd" }, host: { listeners: { "contextmenu": "onContextMenu($event)" } }, ngImport: i0 });
|
|
70
|
-
}
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TableColumnsManagerDirective, decorators: [{
|
|
72
|
-
type: Directive,
|
|
73
|
-
args: [{
|
|
74
|
-
selector: '[ngsTableColumnsManager]',
|
|
75
|
-
host: {
|
|
76
|
-
'(contextmenu)': 'onContextMenu($event)',
|
|
77
|
-
}
|
|
78
|
-
}]
|
|
79
|
-
}], ctorParameters: () => [], propDecorators: { columnAdded: [{ type: i0.Output, args: ["columnAdded"] }], columnDeleted: [{ type: i0.Output, args: ["columnDeleted"] }], columnManagingStart: [{ type: i0.Output, args: ["columnManagingStart"] }], columnManagingEnd: [{ type: i0.Output, args: ["columnManagingEnd"] }] } });
|
|
80
|
-
|
|
81
|
-
class TableRowsManagerDirective {
|
|
82
|
-
_elementRef = inject(ElementRef);
|
|
83
|
-
_destroyRef = inject(DestroyRef);
|
|
84
|
-
_document = inject(DOCUMENT);
|
|
85
|
-
_dragging = false;
|
|
86
|
-
_elementPosition = 0;
|
|
87
|
-
_cellHeight = 24;
|
|
88
|
-
rowManagingStart = output();
|
|
89
|
-
rowManagingEnd = output();
|
|
90
|
-
rowAdded = output();
|
|
91
|
-
rowDeleted = output();
|
|
92
|
-
constructor() {
|
|
93
|
-
afterNextRender(() => {
|
|
94
|
-
this._initResize();
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
onContextMenu(event) {
|
|
98
|
-
event.preventDefault();
|
|
99
|
-
event.stopPropagation();
|
|
100
|
-
}
|
|
101
|
-
_initResize() {
|
|
102
|
-
fromEvent(this._elementRef.nativeElement, 'mousedown')
|
|
103
|
-
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
104
|
-
.subscribe((event) => {
|
|
105
|
-
this._dragging = true;
|
|
106
|
-
const elementRect = this._elementRef.nativeElement.getBoundingClientRect();
|
|
107
|
-
this._elementPosition = elementRect.y + elementRect.height / 2;
|
|
108
|
-
this.rowManagingStart.emit();
|
|
109
|
-
});
|
|
110
|
-
fromEvent(this._document, 'mousemove')
|
|
111
|
-
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
112
|
-
.subscribe((event) => {
|
|
113
|
-
if (this._dragging) {
|
|
114
|
-
const elementRect = this._elementRef.nativeElement.getBoundingClientRect();
|
|
115
|
-
const elementBottomPosition = elementRect.y + elementRect.height;
|
|
116
|
-
const elementTopPosition = elementRect.y;
|
|
117
|
-
if (event.clientY > (this._elementPosition + this._cellHeight) && event.clientY > (elementBottomPosition + this._cellHeight)) {
|
|
118
|
-
this._elementPosition = elementBottomPosition + this._cellHeight;
|
|
119
|
-
this.rowAdded.emit();
|
|
120
|
-
}
|
|
121
|
-
else if (event.clientY < (this._elementPosition - this._cellHeight) && event.clientY < (elementTopPosition - this._cellHeight)) {
|
|
122
|
-
this._elementPosition = elementTopPosition - this._cellHeight;
|
|
123
|
-
this.rowDeleted.emit();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
fromEvent(this._document, 'mouseup')
|
|
128
|
-
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
129
|
-
.subscribe((event) => {
|
|
130
|
-
if (this._dragging) {
|
|
131
|
-
this._dragging = false;
|
|
132
|
-
this.rowManagingEnd.emit();
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TableRowsManagerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
137
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: TableRowsManagerDirective, isStandalone: true, selector: "[ngsTableRowsManager]", outputs: { rowManagingStart: "rowManagingStart", rowManagingEnd: "rowManagingEnd", rowAdded: "rowAdded", rowDeleted: "rowDeleted" }, host: { listeners: { "contextmenu": "onContextMenu($event)" } }, ngImport: i0 });
|
|
138
|
-
}
|
|
139
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TableRowsManagerDirective, decorators: [{
|
|
140
|
-
type: Directive,
|
|
141
|
-
args: [{
|
|
142
|
-
selector: '[ngsTableRowsManager]',
|
|
143
|
-
host: {
|
|
144
|
-
'(contextmenu)': 'onContextMenu($event)',
|
|
145
|
-
}
|
|
146
|
-
}]
|
|
147
|
-
}], ctorParameters: () => [], propDecorators: { rowManagingStart: [{ type: i0.Output, args: ["rowManagingStart"] }], rowManagingEnd: [{ type: i0.Output, args: ["rowManagingEnd"] }], rowAdded: [{ type: i0.Output, args: ["rowAdded"] }], rowDeleted: [{ type: i0.Output, args: ["rowDeleted"] }] } });
|
|
148
|
-
|
|
149
|
-
const RESIZING_TABLE_CLASS = 'table-resizing';
|
|
150
|
-
const RESIZE_HANDLE_ACTIVE_CLASS = 'resize-handle--active';
|
|
151
|
-
class ResizableTableDirective {
|
|
152
|
-
el;
|
|
153
|
-
renderer;
|
|
154
|
-
ngZone;
|
|
155
|
-
_platformId = inject(PLATFORM_ID);
|
|
156
|
-
minColumnWidth = 120;
|
|
157
|
-
resizeHandleWidth = 5;
|
|
158
|
-
mutationObserverDebounceTime = 20;
|
|
159
|
-
resizeEnabled = input(true, /* @ts-ignore */
|
|
160
|
-
...(ngDevMode ? [{ debugName: "resizeEnabled" }] : /* istanbul ignore next */ []));
|
|
161
|
-
columnWidthChange = output();
|
|
162
|
-
columnWidthChangeStart = output();
|
|
163
|
-
columnWidthChangeEnd = output();
|
|
164
|
-
table;
|
|
165
|
-
wrapper = null;
|
|
166
|
-
resizeHandle = null;
|
|
167
|
-
colgroup = null;
|
|
168
|
-
colElements = [];
|
|
169
|
-
isResizing = false;
|
|
170
|
-
resizingColumnIndex = -1;
|
|
171
|
-
resizingColElement = null;
|
|
172
|
-
startX = 0;
|
|
173
|
-
startWidth = 0;
|
|
174
|
-
startEdgeXRelative = 0;
|
|
175
|
-
activeHoverColumnIndex = -1;
|
|
176
|
-
isHandleVisible = false;
|
|
177
|
-
destroy$ = new Subject();
|
|
178
|
-
hideHandleDebounced;
|
|
179
|
-
syncColumnsDebounced; // Debounce column synchronization
|
|
180
|
-
listeners = [];
|
|
181
|
-
observer = null;
|
|
182
|
-
constructor(el, renderer, ngZone) {
|
|
183
|
-
this.el = el;
|
|
184
|
-
this.renderer = renderer;
|
|
185
|
-
this.ngZone = ngZone;
|
|
186
|
-
this.table = this.el.nativeElement;
|
|
187
|
-
this.hideHandleDebounced = this.debounce(() => this.hideResizeHandle(), 50);
|
|
188
|
-
this.syncColumnsDebounced = this.debounce(() => {
|
|
189
|
-
this.syncColumnsAndColgroup();
|
|
190
|
-
this.ensureColWidths();
|
|
191
|
-
if (this.isHandleVisible) {
|
|
192
|
-
this.hideResizeHandle();
|
|
193
|
-
}
|
|
194
|
-
}, this.mutationObserverDebounceTime);
|
|
195
|
-
effect(() => {
|
|
196
|
-
if (!this.resizeEnabled()) {
|
|
197
|
-
if (this.isResizing)
|
|
198
|
-
this.stopResizing(false);
|
|
199
|
-
else
|
|
200
|
-
this.hideResizeHandle();
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
ngOnInit() {
|
|
205
|
-
}
|
|
206
|
-
ngAfterViewInit() {
|
|
207
|
-
if (isPlatformServer(this._platformId)) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
this.checkTableLayout();
|
|
211
|
-
this.createWrapperAndHandle();
|
|
212
|
-
this.syncColumnsAndColgroup();
|
|
213
|
-
if (!this.wrapper || !this.resizeHandle) {
|
|
214
|
-
console.error('ResizableTableDirective: Wrapper or handle creation failed.');
|
|
215
|
-
this.cleanupWrapperAndHandleOnError();
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
this.addWrapperListeners();
|
|
219
|
-
this.setupGlobalResizeListeners();
|
|
220
|
-
this.setupMutationObserver();
|
|
221
|
-
this.ensureColWidths();
|
|
222
|
-
}
|
|
223
|
-
ngOnDestroy() {
|
|
224
|
-
this.observer?.disconnect();
|
|
225
|
-
this.destroy$.next();
|
|
226
|
-
this.destroy$.complete();
|
|
227
|
-
this.listeners.forEach(unlisten => unlisten());
|
|
228
|
-
this.cleanupWrapperAndHandle();
|
|
229
|
-
}
|
|
230
|
-
checkTableLayout() {
|
|
231
|
-
if (getComputedStyle(this.table).tableLayout !== 'fixed') {
|
|
232
|
-
console.warn('ResizableTableDirective: table-layout: fixed is highly recommended.');
|
|
233
|
-
this.renderer.setStyle(this.table, 'table-layout', 'fixed');
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
syncColumnsAndColgroup() {
|
|
237
|
-
let requiredColumnCount = 0;
|
|
238
|
-
const firstDataRow = this.table.querySelector('tbody > tr:first-child');
|
|
239
|
-
if (firstDataRow) {
|
|
240
|
-
requiredColumnCount = firstDataRow.cells.length;
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
// If tbody is empty, try determining the column count from thead, if present
|
|
244
|
-
const firstHeadRow = this.table.querySelector('thead > tr:first-child');
|
|
245
|
-
if (firstHeadRow) {
|
|
246
|
-
requiredColumnCount = firstHeadRow.cells.length;
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
if (this.colgroup) {
|
|
250
|
-
this.colElements.forEach(col => this.renderer.removeChild(this.colgroup, col));
|
|
251
|
-
}
|
|
252
|
-
this.colElements = [];
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
this.colgroup = this.table.querySelector('colgroup');
|
|
257
|
-
const currentColElements = Array.from(this.colgroup.querySelectorAll('col'));
|
|
258
|
-
const currentColCount = currentColElements.length;
|
|
259
|
-
if (requiredColumnCount > currentColCount) {
|
|
260
|
-
for (let i = currentColCount; i < requiredColumnCount; i++) {
|
|
261
|
-
const col = this.renderer.createElement('col');
|
|
262
|
-
this.renderer.appendChild(this.colgroup, col);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
else if (requiredColumnCount < currentColCount) {
|
|
266
|
-
for (let i = currentColCount - 1; i >= requiredColumnCount; i--) {
|
|
267
|
-
this.renderer.removeChild(this.colgroup, currentColElements[i]);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
this.colElements = Array.from(this.colgroup.querySelectorAll('col'));
|
|
271
|
-
}
|
|
272
|
-
ensureColWidths() {
|
|
273
|
-
if (!this.resizeEnabled())
|
|
274
|
-
return;
|
|
275
|
-
const referenceRow = this.table.querySelector('tbody > tr:first-child, thead > tr:first-child');
|
|
276
|
-
if (!referenceRow || this.colElements.length !== referenceRow.cells.length) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
this.colElements.forEach((col, index) => {
|
|
280
|
-
if (!col.style.width && referenceRow.cells[index]) {
|
|
281
|
-
const cellWidth = referenceRow.cells[index].getBoundingClientRect().width;
|
|
282
|
-
if (cellWidth > 0) {
|
|
283
|
-
this.renderer.setStyle(col, 'width', `${cellWidth}px`);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
setupMutationObserver() {
|
|
289
|
-
const targetNode = this.table.querySelector('tbody') ?? this.table;
|
|
290
|
-
const config = {
|
|
291
|
-
childList: true,
|
|
292
|
-
subtree: true
|
|
293
|
-
};
|
|
294
|
-
const callback = (mutationsList, observer) => {
|
|
295
|
-
this.ngZone.runOutsideAngular(() => {
|
|
296
|
-
this.syncColumnsDebounced();
|
|
297
|
-
});
|
|
298
|
-
};
|
|
299
|
-
this.observer = new MutationObserver(callback);
|
|
300
|
-
this.observer.observe(targetNode, config);
|
|
301
|
-
}
|
|
302
|
-
createWrapperAndHandle() {
|
|
303
|
-
this.wrapper = this.renderer.createElement('div');
|
|
304
|
-
this.renderer.addClass(this.wrapper, 'resizable-table-wrapper');
|
|
305
|
-
this.resizeHandle = this.renderer.createElement('div');
|
|
306
|
-
this.renderer.addClass(this.resizeHandle, 'resizable-table-handle');
|
|
307
|
-
this.renderer.setStyle(this.resizeHandle, 'width', `${this.resizeHandleWidth}px`);
|
|
308
|
-
const parent = this.renderer.parentNode(this.table);
|
|
309
|
-
if (parent) {
|
|
310
|
-
this.renderer.insertBefore(parent, this.wrapper, this.table);
|
|
311
|
-
this.renderer.appendChild(this.wrapper, this.table);
|
|
312
|
-
this.renderer.appendChild(this.wrapper, this.resizeHandle);
|
|
313
|
-
}
|
|
314
|
-
else {
|
|
315
|
-
console.error('ResizableTableDirective: Table has no parent node.');
|
|
316
|
-
this.wrapper = null;
|
|
317
|
-
this.resizeHandle = null;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
cleanupWrapperAndHandle() {
|
|
321
|
-
if (this.wrapper && this.wrapper.parentNode) {
|
|
322
|
-
if (this.table.parentNode === this.wrapper) {
|
|
323
|
-
this.renderer.insertBefore(this.wrapper.parentNode, this.table, this.wrapper);
|
|
324
|
-
}
|
|
325
|
-
this.renderer.removeChild(this.wrapper.parentNode, this.wrapper);
|
|
326
|
-
}
|
|
327
|
-
else if (this.resizeHandle && this.resizeHandle.parentNode) {
|
|
328
|
-
this.renderer.removeChild(this.resizeHandle.parentNode, this.resizeHandle);
|
|
329
|
-
}
|
|
330
|
-
this.wrapper = null;
|
|
331
|
-
this.resizeHandle = null;
|
|
332
|
-
}
|
|
333
|
-
cleanupWrapperAndHandleOnError() {
|
|
334
|
-
if (this.wrapper && this.table.parentNode === this.wrapper) {
|
|
335
|
-
const parent = this.wrapper.parentNode;
|
|
336
|
-
if (parent) {
|
|
337
|
-
this.renderer.insertBefore(parent, this.table, this.wrapper);
|
|
338
|
-
this.renderer.removeChild(parent, this.wrapper);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
this.wrapper = null;
|
|
342
|
-
this.resizeHandle = null;
|
|
343
|
-
}
|
|
344
|
-
addWrapperListeners() {
|
|
345
|
-
if (!this.wrapper)
|
|
346
|
-
return;
|
|
347
|
-
this.ngZone.runOutsideAngular(() => {
|
|
348
|
-
const mm = this.renderer.listen(this.wrapper, 'mousemove', (e) => this.handleMouseMoveWrapper(e));
|
|
349
|
-
this.listeners.push(mm);
|
|
350
|
-
});
|
|
351
|
-
const md = this.renderer.listen(this.wrapper, 'mousedown', (e) => this.handleMouseDownWrapper(e));
|
|
352
|
-
const ml = this.renderer.listen(this.wrapper, 'mouseleave', (e) => { if (!this.isResizing)
|
|
353
|
-
this.hideResizeHandle(); });
|
|
354
|
-
this.listeners.push(md, ml);
|
|
355
|
-
}
|
|
356
|
-
handleMouseMoveWrapper(event) {
|
|
357
|
-
if (!this.resizeEnabled() || this.isResizing || !this.wrapper) {
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
const wrapperRect = this.wrapper.getBoundingClientRect();
|
|
361
|
-
const mouseXRelative = event.clientX - wrapperRect.left;
|
|
362
|
-
let targetColumnIndex = -1;
|
|
363
|
-
let edgeXPosition = 0;
|
|
364
|
-
const firstRow = this.table.querySelector('tbody > tr:first-child, thead > tr:first-child');
|
|
365
|
-
if (!firstRow) {
|
|
366
|
-
return;
|
|
367
|
-
}
|
|
368
|
-
if (this.colElements.length !== firstRow.cells.length) {
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
for (let i = 0; i < firstRow.cells.length; i++) {
|
|
372
|
-
const cell = firstRow.cells[i];
|
|
373
|
-
if (!cell) {
|
|
374
|
-
continue;
|
|
375
|
-
}
|
|
376
|
-
const cellRect = cell.getBoundingClientRect();
|
|
377
|
-
const cellEdgeX = cellRect.right - wrapperRect.left;
|
|
378
|
-
if (Math.abs(mouseXRelative - cellEdgeX) <= this.resizeHandleWidth / 2) {
|
|
379
|
-
if (this.colElements[i]) {
|
|
380
|
-
targetColumnIndex = i;
|
|
381
|
-
edgeXPosition = cellEdgeX;
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
if (targetColumnIndex !== -1) {
|
|
387
|
-
this.showResizeHandle(edgeXPosition);
|
|
388
|
-
this.activeHoverColumnIndex = targetColumnIndex;
|
|
389
|
-
}
|
|
390
|
-
else {
|
|
391
|
-
this.hideHandleDebounced();
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
handleMouseDownWrapper(event) {
|
|
395
|
-
if (this.resizeEnabled() && this.activeHoverColumnIndex !== -1 && this.isHandleVisible && this.wrapper) {
|
|
396
|
-
const targetCol = this.colElements[this.activeHoverColumnIndex];
|
|
397
|
-
const firstRow = this.table.querySelector('tbody > tr:first-child, thead > tr:first-child');
|
|
398
|
-
if (!targetCol || !firstRow || !firstRow.cells[this.activeHoverColumnIndex]) {
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
this.ensureColWidths();
|
|
402
|
-
this.isResizing = true;
|
|
403
|
-
this.resizingColumnIndex = this.activeHoverColumnIndex;
|
|
404
|
-
this.resizingColElement = targetCol;
|
|
405
|
-
this.startX = event.clientX;
|
|
406
|
-
const colStyleWidth = this.resizingColElement.style.width;
|
|
407
|
-
this.startWidth = colStyleWidth && colStyleWidth.endsWith('px')
|
|
408
|
-
? parseFloat(colStyleWidth)
|
|
409
|
-
: this.resizingColElement.getBoundingClientRect().width;
|
|
410
|
-
if (this.startWidth <= 0) {
|
|
411
|
-
this.startWidth = firstRow.cells[this.resizingColumnIndex].getBoundingClientRect().width;
|
|
412
|
-
}
|
|
413
|
-
const wrapperRect = this.wrapper.getBoundingClientRect();
|
|
414
|
-
const cellRect = firstRow.cells[this.resizingColumnIndex].getBoundingClientRect();
|
|
415
|
-
this.startEdgeXRelative = cellRect.right - wrapperRect.left;
|
|
416
|
-
this.renderer.addClass(this.table, RESIZING_TABLE_CLASS);
|
|
417
|
-
event.preventDefault();
|
|
418
|
-
this.columnWidthChangeStart.emit();
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
showResizeHandle(edgeX) {
|
|
422
|
-
if (!this.resizeHandle || !this.wrapper) {
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
const handleLeft = edgeX - (this.resizeHandleWidth / 2);
|
|
426
|
-
this.renderer.setStyle(this.resizeHandle, 'left', `${handleLeft}px`);
|
|
427
|
-
this.renderer.setStyle(this.resizeHandle, 'top', `${this.table.offsetTop}px`);
|
|
428
|
-
this.renderer.setStyle(this.resizeHandle, 'height', `${this.table.offsetHeight}px`);
|
|
429
|
-
this.renderer.addClass(this.resizeHandle, RESIZE_HANDLE_ACTIVE_CLASS);
|
|
430
|
-
this.isHandleVisible = true;
|
|
431
|
-
}
|
|
432
|
-
hideResizeHandle() {
|
|
433
|
-
if (this.resizeHandle && this.isHandleVisible) {
|
|
434
|
-
this.renderer.removeClass(this.resizeHandle, RESIZE_HANDLE_ACTIVE_CLASS);
|
|
435
|
-
this.isHandleVisible = false;
|
|
436
|
-
this.activeHoverColumnIndex = -1;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
debounce(func, wait) {
|
|
440
|
-
let timeout;
|
|
441
|
-
return (...args) => {
|
|
442
|
-
clearTimeout(timeout);
|
|
443
|
-
timeout = setTimeout(() => func.apply(this, args), wait);
|
|
444
|
-
};
|
|
445
|
-
}
|
|
446
|
-
setupGlobalResizeListeners() {
|
|
447
|
-
this.ngZone.runOutsideAngular(() => {
|
|
448
|
-
fromEvent(document, 'mousemove')
|
|
449
|
-
.pipe(takeUntil(this.destroy$))
|
|
450
|
-
.subscribe(event => {
|
|
451
|
-
if (!this.resizeEnabled() || !this.isResizing || !this.resizingColElement || !this.wrapper || !this.resizeHandle)
|
|
452
|
-
return;
|
|
453
|
-
if (!this.resizingColElement.parentElement) {
|
|
454
|
-
this.stopResizing();
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
|
-
const deltaX = event.clientX - this.startX;
|
|
458
|
-
const newWidth = this.startWidth + deltaX;
|
|
459
|
-
const finalWidth = Math.max(newWidth, this.minColumnWidth);
|
|
460
|
-
this.renderer.setStyle(this.resizingColElement, 'width', `${finalWidth}px`);
|
|
461
|
-
const actualDeltaX = finalWidth - this.startWidth;
|
|
462
|
-
const newEdgeXRelative = this.startEdgeXRelative + actualDeltaX;
|
|
463
|
-
const handleLeft = newEdgeXRelative - (this.resizeHandleWidth / 2);
|
|
464
|
-
this.renderer.setStyle(this.resizeHandle, 'left', `${handleLeft}px`);
|
|
465
|
-
if (!this.isHandleVisible) {
|
|
466
|
-
this.renderer.addClass(this.resizeHandle, RESIZE_HANDLE_ACTIVE_CLASS);
|
|
467
|
-
this.isHandleVisible = true;
|
|
468
|
-
}
|
|
469
|
-
this.updateHandleHeight();
|
|
470
|
-
});
|
|
471
|
-
fromEvent(document, 'mouseup')
|
|
472
|
-
.pipe(takeUntil(this.destroy$))
|
|
473
|
-
.subscribe(() => {
|
|
474
|
-
if (this.isResizing) {
|
|
475
|
-
this.ngZone.run(() => {
|
|
476
|
-
this.stopResizing(this.resizeEnabled());
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
});
|
|
480
|
-
});
|
|
481
|
-
}
|
|
482
|
-
stopResizing(commit = true) {
|
|
483
|
-
if (commit && this.resizingColElement) {
|
|
484
|
-
this.columnWidthChange.emit({
|
|
485
|
-
columnIndex: this.resizingColumnIndex,
|
|
486
|
-
width: this.resizingColElement.getBoundingClientRect().width
|
|
487
|
-
});
|
|
488
|
-
}
|
|
489
|
-
else if (this.resizingColElement) {
|
|
490
|
-
this.renderer.setStyle(this.resizingColElement, 'width', `${this.startWidth}px`);
|
|
491
|
-
}
|
|
492
|
-
this.renderer.removeClass(this.table, RESIZING_TABLE_CLASS);
|
|
493
|
-
this.hideResizeHandle();
|
|
494
|
-
this.isResizing = false;
|
|
495
|
-
this.resizingColumnIndex = -1;
|
|
496
|
-
this.resizingColElement = null;
|
|
497
|
-
this.columnWidthChangeEnd.emit();
|
|
498
|
-
}
|
|
499
|
-
updateHandleHeight() {
|
|
500
|
-
if (this.resizeHandle && this.isHandleVisible && this.wrapper) {
|
|
501
|
-
requestAnimationFrame(() => {
|
|
502
|
-
if (this.isHandleVisible && this.resizeHandle && this.table) {
|
|
503
|
-
this.renderer.setStyle(this.resizeHandle, 'top', `${this.table.offsetTop}px`);
|
|
504
|
-
this.renderer.setStyle(this.resizeHandle, 'height', `${this.table.offsetHeight}px`);
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ResizableTableDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
510
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: ResizableTableDirective, isStandalone: true, selector: "table[ngsResizableTable]", inputs: { minColumnWidth: { classPropertyName: "minColumnWidth", publicName: "minColumnWidth", isSignal: false, isRequired: false, transformFunction: null }, resizeHandleWidth: { classPropertyName: "resizeHandleWidth", publicName: "resizeHandleWidth", isSignal: false, isRequired: false, transformFunction: null }, mutationObserverDebounceTime: { classPropertyName: "mutationObserverDebounceTime", publicName: "mutationObserverDebounceTime", isSignal: false, isRequired: false, transformFunction: null }, resizeEnabled: { classPropertyName: "resizeEnabled", publicName: "resizeEnabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnWidthChange: "columnWidthChange", columnWidthChangeStart: "columnWidthChangeStart", columnWidthChangeEnd: "columnWidthChangeEnd" }, ngImport: i0 });
|
|
511
|
-
}
|
|
512
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ResizableTableDirective, decorators: [{
|
|
513
|
-
type: Directive,
|
|
514
|
-
args: [{
|
|
515
|
-
selector: 'table[ngsResizableTable]'
|
|
516
|
-
}]
|
|
517
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }], propDecorators: { minColumnWidth: [{
|
|
518
|
-
type: Input
|
|
519
|
-
}], resizeHandleWidth: [{
|
|
520
|
-
type: Input
|
|
521
|
-
}], mutationObserverDebounceTime: [{
|
|
522
|
-
type: Input
|
|
523
|
-
}], resizeEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizeEnabled", required: false }] }], columnWidthChange: [{ type: i0.Output, args: ["columnWidthChange"] }], columnWidthChangeStart: [{ type: i0.Output, args: ["columnWidthChangeStart"] }], columnWidthChangeEnd: [{ type: i0.Output, args: ["columnWidthChangeEnd"] }] } });
|
|
524
|
-
|
|
525
|
-
const HIDE_DELAY_MS = 300;
|
|
526
|
-
class DraggableTableComponent {
|
|
527
|
-
contentBuilder = inject(CONTENT_BUILDER);
|
|
528
|
-
_platformId = inject(PLATFORM_ID);
|
|
529
|
-
elRef = inject((ElementRef));
|
|
530
|
-
renderer = inject(Renderer2);
|
|
531
|
-
ngZone = inject(NgZone);
|
|
532
|
-
destroyRef = inject(DestroyRef);
|
|
533
|
-
table = null;
|
|
534
|
-
suppressInteractions = false;
|
|
535
|
-
columnHandler;
|
|
536
|
-
rowHandler;
|
|
537
|
-
dropIndicator;
|
|
538
|
-
hoveredCell = null;
|
|
539
|
-
hoveredColumnIndex = -1;
|
|
540
|
-
hoveredRowIndex = -1;
|
|
541
|
-
isDragging = false;
|
|
542
|
-
dragMode = null;
|
|
543
|
-
startX = 0;
|
|
544
|
-
startY = 0;
|
|
545
|
-
handlerStartY = 0;
|
|
546
|
-
draggedElement = null;
|
|
547
|
-
draggedElementSource = null;
|
|
548
|
-
startElementIndex = -1;
|
|
549
|
-
currentDropIndex = -1;
|
|
550
|
-
hideTimeoutId = null;
|
|
551
|
-
columnInfo = [];
|
|
552
|
-
rowInfo = [];
|
|
553
|
-
listeners = [];
|
|
554
|
-
boundOnDrag;
|
|
555
|
-
boundEndDrag;
|
|
556
|
-
handlerSize = 18;
|
|
557
|
-
handlerOffset = -9;
|
|
558
|
-
indicatorThickness = 3;
|
|
559
|
-
suppressResetTimeoutId = null;
|
|
560
|
-
scrollContainerRef = null; // Kept for backward compatibility; not used directly
|
|
561
|
-
scrollSub = null;
|
|
562
|
-
hostClass = true;
|
|
563
|
-
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
564
|
-
columnMoved = output();
|
|
565
|
-
rowMoved = output();
|
|
566
|
-
moveStart = output();
|
|
567
|
-
moveEnd = output();
|
|
568
|
-
constructor() {
|
|
569
|
-
this.boundOnDrag = this.onDrag.bind(this);
|
|
570
|
-
this.boundEndDrag = this.endDrag.bind(this);
|
|
571
|
-
}
|
|
572
|
-
ngOnInit() {
|
|
573
|
-
if (isPlatformServer(this._platformId)) {
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
|
-
this.createHandlers();
|
|
577
|
-
this.createDropIndicator();
|
|
578
|
-
this.prepareListeners();
|
|
579
|
-
}
|
|
580
|
-
ngAfterViewInit() {
|
|
581
|
-
if (isPlatformServer(this._platformId)) {
|
|
582
|
-
return;
|
|
583
|
-
}
|
|
584
|
-
this.table = this.elRef.nativeElement.querySelector('table');
|
|
585
|
-
if (!this.table) {
|
|
586
|
-
return;
|
|
587
|
-
}
|
|
588
|
-
if (getComputedStyle(this.table).position === 'static') {
|
|
589
|
-
this.renderer.setStyle(this.table, 'position', 'relative');
|
|
590
|
-
}
|
|
591
|
-
this.renderer.appendChild(this.table, this.columnHandler);
|
|
592
|
-
this.renderer.appendChild(this.table, this.rowHandler);
|
|
593
|
-
this.renderer.appendChild(this.table, this.dropIndicator);
|
|
594
|
-
this.attachListeners('element');
|
|
595
|
-
this.bindScrollContainerListener();
|
|
596
|
-
}
|
|
597
|
-
ngOnDestroy() {
|
|
598
|
-
if (isPlatformServer(this._platformId)) {
|
|
599
|
-
return;
|
|
600
|
-
}
|
|
601
|
-
this.unbindScrollContainerListener();
|
|
602
|
-
this.detachListeners('all');
|
|
603
|
-
this.cancelHideTimer();
|
|
604
|
-
if (this.suppressResetTimeoutId) {
|
|
605
|
-
clearTimeout(this.suppressResetTimeoutId);
|
|
606
|
-
this.suppressResetTimeoutId = null;
|
|
607
|
-
}
|
|
608
|
-
if (this.dropIndicator?.parentNode) {
|
|
609
|
-
this.renderer.removeChild(this.dropIndicator.parentNode, this.dropIndicator);
|
|
610
|
-
}
|
|
611
|
-
if (this.columnHandler?.parentNode) {
|
|
612
|
-
this.renderer.removeChild(this.columnHandler.parentNode, this.columnHandler);
|
|
613
|
-
}
|
|
614
|
-
if (this.rowHandler?.parentNode) {
|
|
615
|
-
this.renderer.removeChild(this.rowHandler.parentNode, this.rowHandler);
|
|
616
|
-
}
|
|
617
|
-
if (this.table) {
|
|
618
|
-
this.renderer.removeClass(this.table, 'dragging-column');
|
|
619
|
-
this.renderer.removeClass(this.table, 'dragging-row');
|
|
620
|
-
this.table.querySelectorAll('.dragging-source').forEach(el => this.renderer.removeClass(el, 'dragging-source'));
|
|
621
|
-
this.table.querySelectorAll('.col-highlight').forEach(el => this.renderer.removeClass(el, 'col-highlight'));
|
|
622
|
-
}
|
|
623
|
-
document.body.style.cursor = '';
|
|
624
|
-
this.columnInfo = [];
|
|
625
|
-
this.rowInfo = [];
|
|
626
|
-
this.currentDropIndex = -1;
|
|
627
|
-
this.suppressInteractions = false;
|
|
628
|
-
}
|
|
629
|
-
prepareListeners() {
|
|
630
|
-
this.listeners = [
|
|
631
|
-
{
|
|
632
|
-
name: 'tableMouseOver',
|
|
633
|
-
type: 'element',
|
|
634
|
-
target: () => this.table,
|
|
635
|
-
event: 'mouseover',
|
|
636
|
-
handler: this.onTableMouseOver.bind(this)
|
|
637
|
-
},
|
|
638
|
-
{
|
|
639
|
-
name: 'tableMouseLeave',
|
|
640
|
-
type: 'element',
|
|
641
|
-
target: () => this.table,
|
|
642
|
-
event: 'mouseleave',
|
|
643
|
-
handler: this.onTableMouseLeave.bind(this)
|
|
644
|
-
},
|
|
645
|
-
{
|
|
646
|
-
name: 'colHandlerMouseDown',
|
|
647
|
-
type: 'element',
|
|
648
|
-
target: () => this.columnHandler,
|
|
649
|
-
event: 'mousedown',
|
|
650
|
-
handler: (e) => this.onHandlerMouseDown(e, 'column')
|
|
651
|
-
},
|
|
652
|
-
{
|
|
653
|
-
name: 'colHandlerMouseEnter',
|
|
654
|
-
type: 'element',
|
|
655
|
-
target: () => this.columnHandler,
|
|
656
|
-
event: 'mouseenter',
|
|
657
|
-
handler: this.onHandlerMouseEnter.bind(this)
|
|
658
|
-
},
|
|
659
|
-
{
|
|
660
|
-
name: 'colHandlerMouseLeave',
|
|
661
|
-
type: 'element',
|
|
662
|
-
target: () => this.columnHandler,
|
|
663
|
-
event: 'mouseleave',
|
|
664
|
-
handler: this.onHandlerMouseLeave.bind(this)
|
|
665
|
-
},
|
|
666
|
-
{
|
|
667
|
-
name: 'rowHandlerMouseDown',
|
|
668
|
-
type: 'element',
|
|
669
|
-
target: () => this.rowHandler,
|
|
670
|
-
event: 'mousedown',
|
|
671
|
-
handler: (e) => this.onHandlerMouseDown(e, 'row')
|
|
672
|
-
},
|
|
673
|
-
{
|
|
674
|
-
name: 'rowHandlerMouseEnter',
|
|
675
|
-
type: 'element',
|
|
676
|
-
target: () => this.rowHandler,
|
|
677
|
-
event: 'mouseenter',
|
|
678
|
-
handler: this.onHandlerMouseEnter.bind(this)
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
name: 'rowHandlerMouseLeave',
|
|
682
|
-
type: 'element',
|
|
683
|
-
target: () => this.rowHandler,
|
|
684
|
-
event: 'mouseleave',
|
|
685
|
-
handler: this.onHandlerMouseLeave.bind(this)
|
|
686
|
-
},
|
|
687
|
-
{ name: 'docMouseMove', type: 'document', target: () => document, event: 'mousemove', handler: this.boundOnDrag },
|
|
688
|
-
{
|
|
689
|
-
name: 'docMouseUp', type: 'document', target: () => document, event: 'mouseup', handler: (e) => {
|
|
690
|
-
this.suppressInteractions = false;
|
|
691
|
-
this.boundEndDrag(e);
|
|
692
|
-
}
|
|
693
|
-
},
|
|
694
|
-
{
|
|
695
|
-
name: 'winBlur', type: 'document', target: () => window, event: 'blur', handler: () => {
|
|
696
|
-
this.suppressInteractions = false;
|
|
697
|
-
}
|
|
698
|
-
},
|
|
699
|
-
{
|
|
700
|
-
name: 'visibilityChange', type: 'document', target: () => document, event: 'visibilitychange', handler: () => {
|
|
701
|
-
if (document.visibilityState !== 'visible') {
|
|
702
|
-
this.suppressInteractions = false;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
},
|
|
706
|
-
];
|
|
707
|
-
}
|
|
708
|
-
attachListeners(type = 'element') {
|
|
709
|
-
this.ngZone.runOutsideAngular(() => {
|
|
710
|
-
this.listeners.forEach(listener => {
|
|
711
|
-
if (listener.type === 'document' && type !== 'document' && type !== 'all')
|
|
712
|
-
return;
|
|
713
|
-
if (listener.type === 'element' && type === 'document')
|
|
714
|
-
return;
|
|
715
|
-
if (listener.cleanup || !listener.target)
|
|
716
|
-
return;
|
|
717
|
-
const targetElement = listener.target();
|
|
718
|
-
if (!targetElement)
|
|
719
|
-
return;
|
|
720
|
-
listener.cleanup = this.renderer.listen(targetElement, listener.event, listener.handler);
|
|
721
|
-
});
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
detachListeners(type = 'all') {
|
|
725
|
-
this.listeners.forEach(listener => {
|
|
726
|
-
if (listener.type === 'document' && type !== 'document' && type !== 'all')
|
|
727
|
-
return;
|
|
728
|
-
if (listener.type === 'element' && type === 'document')
|
|
729
|
-
return;
|
|
730
|
-
if (listener.cleanup) {
|
|
731
|
-
listener.cleanup();
|
|
732
|
-
listener.cleanup = undefined;
|
|
733
|
-
}
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
onTableMouseOver(event) {
|
|
737
|
-
this.cancelHideTimer();
|
|
738
|
-
this.ensureScrollContainerListener();
|
|
739
|
-
if (!this.table || this.isDragging)
|
|
740
|
-
return;
|
|
741
|
-
if (this.suppressInteractions)
|
|
742
|
-
return;
|
|
743
|
-
const anyButtonDown = typeof event.buttons === 'number' ? event.buttons !== 0 : false;
|
|
744
|
-
if (anyButtonDown)
|
|
745
|
-
return;
|
|
746
|
-
const target = event.target;
|
|
747
|
-
const cell = target.closest('td, th');
|
|
748
|
-
if (cell && this.table.contains(cell)) {
|
|
749
|
-
const currentColumnIndex = cell.cellIndex;
|
|
750
|
-
const currentRow = cell.closest('tr');
|
|
751
|
-
const currentRowIndex = currentRow?.parentElement?.tagName === 'TBODY' ? Array.from(currentRow.parentElement.children).indexOf(currentRow) : -1;
|
|
752
|
-
this.hoveredCell = cell;
|
|
753
|
-
if (currentColumnIndex !== this.hoveredColumnIndex || this.columnHandler.style.visibility === 'hidden') {
|
|
754
|
-
this.hoveredColumnIndex = currentColumnIndex;
|
|
755
|
-
this.positionColumnHandler(cell);
|
|
756
|
-
this.renderer.setStyle(this.columnHandler, 'visibility', 'visible');
|
|
757
|
-
}
|
|
758
|
-
if (currentRowIndex !== -1) {
|
|
759
|
-
if (currentRowIndex !== this.hoveredRowIndex || this.rowHandler.style.visibility === 'hidden') {
|
|
760
|
-
this.hoveredRowIndex = currentRowIndex;
|
|
761
|
-
this.positionRowHandler(cell);
|
|
762
|
-
this.renderer.setStyle(this.rowHandler, 'visibility', 'visible');
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
else if (this.hoveredRowIndex !== -1) {
|
|
766
|
-
this.renderer.setStyle(this.rowHandler, 'visibility', 'hidden');
|
|
767
|
-
this.hoveredRowIndex = -1;
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
onTableMouseLeave(event) {
|
|
772
|
-
if (this.isDragging)
|
|
773
|
-
return;
|
|
774
|
-
if (this.suppressInteractions)
|
|
775
|
-
return;
|
|
776
|
-
const relatedTarget = event.relatedTarget;
|
|
777
|
-
if (relatedTarget !== this.columnHandler && relatedTarget !== this.rowHandler) {
|
|
778
|
-
this.scheduleHideHandlers();
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
onHandlerMouseEnter() {
|
|
782
|
-
this.cancelHideTimer();
|
|
783
|
-
}
|
|
784
|
-
onHandlerMouseLeave(event) {
|
|
785
|
-
if (this.isDragging)
|
|
786
|
-
return;
|
|
787
|
-
if (this.suppressInteractions)
|
|
788
|
-
return;
|
|
789
|
-
const relatedTarget = event.relatedTarget;
|
|
790
|
-
const isOverTable = relatedTarget && this.table && this.table.contains(relatedTarget);
|
|
791
|
-
const isOverOtherHandler = (event.target === this.columnHandler && relatedTarget === this.rowHandler) || (event.target === this.rowHandler && relatedTarget === this.columnHandler);
|
|
792
|
-
if (!isOverTable && !isOverOtherHandler) {
|
|
793
|
-
this.scheduleHideHandlers();
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
onHandlerMouseDown(event, mode) {
|
|
797
|
-
const isPrimary = (event.button === 0) && ((event.buttons & 1) === 1);
|
|
798
|
-
if (!isPrimary || event.ctrlKey) {
|
|
799
|
-
this.suppressInteractions = true;
|
|
800
|
-
event.preventDefault();
|
|
801
|
-
event.stopPropagation();
|
|
802
|
-
this.cancelHideTimer();
|
|
803
|
-
if (this.suppressResetTimeoutId) {
|
|
804
|
-
clearTimeout(this.suppressResetTimeoutId);
|
|
805
|
-
this.suppressResetTimeoutId = null;
|
|
806
|
-
}
|
|
807
|
-
this.suppressResetTimeoutId = setTimeout(() => {
|
|
808
|
-
this.suppressInteractions = false;
|
|
809
|
-
this.suppressResetTimeoutId = null;
|
|
810
|
-
}, 1200);
|
|
811
|
-
return;
|
|
812
|
-
}
|
|
813
|
-
this.startDrag(event, mode);
|
|
814
|
-
}
|
|
815
|
-
createHandlers() {
|
|
816
|
-
this.columnHandler = this.renderer.createElement('div');
|
|
817
|
-
this.columnHandler.oncontextmenu = ((e) => {
|
|
818
|
-
e.preventDefault();
|
|
819
|
-
e.stopPropagation();
|
|
820
|
-
});
|
|
821
|
-
this.renderer.addClass(this.columnHandler, 'drag-handler');
|
|
822
|
-
this.renderer.addClass(this.columnHandler, 'column-handler');
|
|
823
|
-
this.renderer.setStyle(this.columnHandler, 'position', 'fixed');
|
|
824
|
-
this.renderer.setStyle(this.columnHandler, 'visibility', 'hidden');
|
|
825
|
-
this.renderer.setStyle(this.columnHandler, 'z-index', '1000');
|
|
826
|
-
this.rowHandler = this.renderer.createElement('div');
|
|
827
|
-
this.rowHandler.oncontextmenu = ((e) => {
|
|
828
|
-
e.preventDefault();
|
|
829
|
-
e.stopPropagation();
|
|
830
|
-
});
|
|
831
|
-
this.renderer.addClass(this.rowHandler, 'drag-handler');
|
|
832
|
-
this.renderer.addClass(this.rowHandler, 'row-handler');
|
|
833
|
-
this.renderer.setStyle(this.rowHandler, 'position', 'fixed');
|
|
834
|
-
this.renderer.setStyle(this.rowHandler, 'visibility', 'hidden');
|
|
835
|
-
this.renderer.setStyle(this.rowHandler, 'z-index', '1000');
|
|
836
|
-
}
|
|
837
|
-
createDropIndicator() {
|
|
838
|
-
this.dropIndicator = this.renderer.createElement('div');
|
|
839
|
-
this.renderer.addClass(this.dropIndicator, 'drop-indicator');
|
|
840
|
-
}
|
|
841
|
-
positionColumnHandler(cellOrIndex) {
|
|
842
|
-
if (!this.table) {
|
|
843
|
-
return;
|
|
844
|
-
}
|
|
845
|
-
let targetCell = null;
|
|
846
|
-
if (typeof cellOrIndex === 'number') {
|
|
847
|
-
targetCell = this.findFirstVisibleCellInColumn(cellOrIndex);
|
|
848
|
-
if (!targetCell)
|
|
849
|
-
return;
|
|
850
|
-
}
|
|
851
|
-
else {
|
|
852
|
-
targetCell = cellOrIndex;
|
|
853
|
-
}
|
|
854
|
-
const tableRect = this.table.getBoundingClientRect();
|
|
855
|
-
const cellRect = targetCell.getBoundingClientRect();
|
|
856
|
-
const colHandlerLeft = cellRect.left + (cellRect.width / 2) - (this.handlerSize / 2);
|
|
857
|
-
const colHandlerTop = tableRect.top - this.handlerSize - this.handlerOffset;
|
|
858
|
-
this.renderer.setStyle(this.columnHandler, 'top', `${colHandlerTop}px`);
|
|
859
|
-
this.renderer.setStyle(this.columnHandler, 'left', `${colHandlerLeft}px`);
|
|
860
|
-
}
|
|
861
|
-
positionRowHandler(cell) {
|
|
862
|
-
if (!this.table || this.isDragging)
|
|
863
|
-
return;
|
|
864
|
-
const tableRect = this.table.getBoundingClientRect();
|
|
865
|
-
const cellRect = cell.getBoundingClientRect();
|
|
866
|
-
const rowHandlerTop = cellRect.top + (cellRect.height / 2) - (this.handlerSize / 2);
|
|
867
|
-
const rowHandlerLeft = tableRect.left - this.handlerSize - this.handlerOffset;
|
|
868
|
-
this.renderer.setStyle(this.rowHandler, 'top', `${rowHandlerTop}px`);
|
|
869
|
-
this.renderer.setStyle(this.rowHandler, 'left', `${rowHandlerLeft}px`);
|
|
870
|
-
}
|
|
871
|
-
scheduleHideHandlers() {
|
|
872
|
-
this.cancelHideTimer();
|
|
873
|
-
this.hideTimeoutId = setTimeout(() => {
|
|
874
|
-
this.hideHandlers();
|
|
875
|
-
this.hideTimeoutId = null;
|
|
876
|
-
}, HIDE_DELAY_MS);
|
|
877
|
-
}
|
|
878
|
-
cancelHideTimer() {
|
|
879
|
-
if (this.hideTimeoutId) {
|
|
880
|
-
clearTimeout(this.hideTimeoutId);
|
|
881
|
-
this.hideTimeoutId = null;
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
hideHandlers() {
|
|
885
|
-
if (!this.isDragging) {
|
|
886
|
-
this.renderer.setStyle(this.columnHandler, 'visibility', 'hidden');
|
|
887
|
-
this.renderer.setStyle(this.rowHandler, 'visibility', 'hidden');
|
|
888
|
-
this.renderer.setStyle(this.dropIndicator, 'visibility', 'hidden');
|
|
889
|
-
this.hoveredCell = null;
|
|
890
|
-
this.hoveredColumnIndex = -1;
|
|
891
|
-
this.hoveredRowIndex = -1;
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
startDrag(event, mode) {
|
|
895
|
-
const isPrimary = (event.button === 0) && ((event.buttons & 1) === 1);
|
|
896
|
-
if (!isPrimary || event.ctrlKey) {
|
|
897
|
-
return;
|
|
898
|
-
}
|
|
899
|
-
this.cancelHideTimer();
|
|
900
|
-
const sourceRow = mode === 'row' ? this.hoveredCell?.closest('tr') : null;
|
|
901
|
-
if (!this.table || (mode === 'row' && this.hoveredRowIndex < 0) ||
|
|
902
|
-
(mode === 'column' && this.hoveredColumnIndex < 0) ||
|
|
903
|
-
(mode === 'row' && sourceRow?.parentElement?.tagName !== 'TBODY')) {
|
|
904
|
-
return;
|
|
905
|
-
}
|
|
906
|
-
event.preventDefault();
|
|
907
|
-
this.isDragging = true;
|
|
908
|
-
this.dragMode = mode;
|
|
909
|
-
this.startX = event.clientX;
|
|
910
|
-
this.startY = event.clientY;
|
|
911
|
-
this.currentDropIndex = -1;
|
|
912
|
-
if (mode === 'column') {
|
|
913
|
-
this.startElementIndex = this.hoveredColumnIndex;
|
|
914
|
-
this.currentDropIndex = this.startElementIndex;
|
|
915
|
-
this.draggedElement = this.columnHandler;
|
|
916
|
-
this.draggedElementSource = null;
|
|
917
|
-
this.renderer.addClass(this.table, 'dragging-column');
|
|
918
|
-
this.styleColumnAsSource(this.startElementIndex, true);
|
|
919
|
-
this.calculateColumnInfo();
|
|
920
|
-
this.updateColumnHandlerPositionOnDrag(event.clientX);
|
|
921
|
-
this.renderer.setStyle(this.columnHandler, 'visibility', 'visible');
|
|
922
|
-
this.renderer.setStyle(this.rowHandler, 'visibility', 'hidden');
|
|
923
|
-
this.renderer.setStyle(this.dropIndicator, 'visibility', 'hidden');
|
|
924
|
-
}
|
|
925
|
-
else {
|
|
926
|
-
this.startElementIndex = this.hoveredRowIndex;
|
|
927
|
-
this.currentDropIndex = this.startElementIndex;
|
|
928
|
-
this.draggedElement = this.rowHandler;
|
|
929
|
-
this.draggedElementSource = sourceRow;
|
|
930
|
-
this.renderer.addClass(this.draggedElementSource, 'dragging-source');
|
|
931
|
-
this.renderer.addClass(this.table, 'dragging-row');
|
|
932
|
-
this.calculateRowInfo();
|
|
933
|
-
this.handlerStartY = parseFloat(this.rowHandler.style.top || '0');
|
|
934
|
-
this.updateRowHandlerPositionOnDrag(event.clientY);
|
|
935
|
-
this.renderer.setStyle(this.rowHandler, 'visibility', 'visible');
|
|
936
|
-
this.renderer.setStyle(this.columnHandler, 'visibility', 'hidden');
|
|
937
|
-
this.renderer.setStyle(this.dropIndicator, 'visibility', 'hidden');
|
|
938
|
-
}
|
|
939
|
-
if (this.draggedElement) {
|
|
940
|
-
this.renderer.addClass(this.draggedElement, 'dragging-active-handler');
|
|
941
|
-
}
|
|
942
|
-
this.attachListeners('document');
|
|
943
|
-
}
|
|
944
|
-
onDrag(event) {
|
|
945
|
-
if (!this.isDragging || !this.draggedElement || !this.table)
|
|
946
|
-
return;
|
|
947
|
-
if ((event.buttons & 1) !== 1) {
|
|
948
|
-
this.endDrag(event);
|
|
949
|
-
return;
|
|
950
|
-
}
|
|
951
|
-
event.preventDefault();
|
|
952
|
-
this.moveStart.emit();
|
|
953
|
-
const currentX = event.clientX;
|
|
954
|
-
const currentY = event.clientY;
|
|
955
|
-
document.body.style.cursor = 'grabbing';
|
|
956
|
-
if (this.dragMode === 'row') {
|
|
957
|
-
this.updateRowHandlerPositionOnDrag(currentY);
|
|
958
|
-
const currentHandlerCenterY = parseFloat(this.rowHandler.style.top || '0') + this.handlerSize / 2;
|
|
959
|
-
const newVisualTargetIndex = this.getVisualTargetRowIndex(currentHandlerCenterY);
|
|
960
|
-
if (newVisualTargetIndex !== -1) {
|
|
961
|
-
this.updateDropIndicator(newVisualTargetIndex, 'row');
|
|
962
|
-
this.currentDropIndex = newVisualTargetIndex;
|
|
963
|
-
}
|
|
964
|
-
else {
|
|
965
|
-
this.renderer.setStyle(this.dropIndicator, 'visibility', 'hidden');
|
|
966
|
-
this.currentDropIndex = -1;
|
|
967
|
-
}
|
|
968
|
-
this.clearDropHighlights();
|
|
969
|
-
}
|
|
970
|
-
else if (this.dragMode === 'column') {
|
|
971
|
-
this.updateColumnHandlerPositionOnDrag(currentX);
|
|
972
|
-
const currentHandlerCenterX = parseFloat(this.columnHandler.style.left || '0') + this.handlerSize / 2;
|
|
973
|
-
const newVisualTargetIndex = this.getVisualTargetColumnIndex(currentHandlerCenterX);
|
|
974
|
-
if (newVisualTargetIndex !== -1) {
|
|
975
|
-
this.updateDropIndicator(newVisualTargetIndex, 'column');
|
|
976
|
-
this.currentDropIndex = newVisualTargetIndex;
|
|
977
|
-
}
|
|
978
|
-
else {
|
|
979
|
-
this.renderer.setStyle(this.dropIndicator, 'visibility', 'hidden');
|
|
980
|
-
this.currentDropIndex = -1;
|
|
981
|
-
}
|
|
982
|
-
this.clearDropHighlights();
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
getVisualTargetColumnIndex(currentHandlerCenterX) {
|
|
986
|
-
if (this.startElementIndex < 0 || !this.columnInfo?.length)
|
|
987
|
-
return -1;
|
|
988
|
-
let potentialTargetIndex = this.startElementIndex;
|
|
989
|
-
const currentGeometry = this.columnInfo;
|
|
990
|
-
for (const targetColumn of currentGeometry) {
|
|
991
|
-
if (targetColumn.index === this.startElementIndex)
|
|
992
|
-
continue;
|
|
993
|
-
const targetCenter = targetColumn.center;
|
|
994
|
-
const threshold = targetColumn.width * 0.5;
|
|
995
|
-
if (targetColumn.index > this.startElementIndex && currentHandlerCenterX > targetCenter - threshold) {
|
|
996
|
-
potentialTargetIndex = Math.max(potentialTargetIndex, targetColumn.index);
|
|
997
|
-
}
|
|
998
|
-
else if (targetColumn.index < this.startElementIndex && currentHandlerCenterX < targetCenter + threshold) {
|
|
999
|
-
potentialTargetIndex = (potentialTargetIndex === this.startElementIndex) ? targetColumn.index : Math.min(potentialTargetIndex, targetColumn.index);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
return potentialTargetIndex;
|
|
1003
|
-
}
|
|
1004
|
-
getVisualTargetRowIndex(currentHandlerCenterY) {
|
|
1005
|
-
if (this.startElementIndex < 0 || !this.table?.tBodies[0] || !this.rowInfo?.length)
|
|
1006
|
-
return -1;
|
|
1007
|
-
let potentialTargetIndex = this.startElementIndex;
|
|
1008
|
-
const currentGeometry = this.rowInfo;
|
|
1009
|
-
for (const targetRow of currentGeometry) {
|
|
1010
|
-
if (targetRow.index === this.startElementIndex)
|
|
1011
|
-
continue;
|
|
1012
|
-
const targetCenter = targetRow.center;
|
|
1013
|
-
const threshold = targetRow.height * 0.5;
|
|
1014
|
-
if (targetRow.index > this.startElementIndex && currentHandlerCenterY > targetCenter - threshold) {
|
|
1015
|
-
potentialTargetIndex = Math.max(potentialTargetIndex, targetRow.index);
|
|
1016
|
-
}
|
|
1017
|
-
else if (targetRow.index < this.startElementIndex && currentHandlerCenterY < targetCenter + threshold) {
|
|
1018
|
-
potentialTargetIndex = (potentialTargetIndex === this.startElementIndex) ? targetRow.index : Math.min(potentialTargetIndex, targetRow.index);
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
return potentialTargetIndex;
|
|
1022
|
-
}
|
|
1023
|
-
updateColumnHandlerPositionOnDrag(currentX) {
|
|
1024
|
-
if (!this.table || !this.columnHandler)
|
|
1025
|
-
return;
|
|
1026
|
-
const handlerLeft = currentX - (this.handlerSize / 2);
|
|
1027
|
-
this.renderer.setStyle(this.columnHandler, 'left', `${handlerLeft}px`);
|
|
1028
|
-
}
|
|
1029
|
-
updateRowHandlerPositionOnDrag(currentY) {
|
|
1030
|
-
if (!this.table || !this.rowHandler)
|
|
1031
|
-
return;
|
|
1032
|
-
const deltaY = currentY - this.startY;
|
|
1033
|
-
const handlerTop = this.handlerStartY + deltaY;
|
|
1034
|
-
this.renderer.setStyle(this.rowHandler, 'top', `${handlerTop}px`);
|
|
1035
|
-
}
|
|
1036
|
-
endDrag(event) {
|
|
1037
|
-
if (!this.isDragging)
|
|
1038
|
-
return;
|
|
1039
|
-
this.detachListeners('document');
|
|
1040
|
-
event.preventDefault();
|
|
1041
|
-
this.renderer.setStyle(this.dropIndicator, 'visibility', 'hidden');
|
|
1042
|
-
if (!this.table) {
|
|
1043
|
-
this.cleanupDragState();
|
|
1044
|
-
return;
|
|
1045
|
-
}
|
|
1046
|
-
const finalTargetIndex = this.currentDropIndex;
|
|
1047
|
-
if (this.startElementIndex !== -1 && finalTargetIndex !== -1 && finalTargetIndex !== this.startElementIndex) {
|
|
1048
|
-
if (this.dragMode === 'column') {
|
|
1049
|
-
this.moveColumn(this.startElementIndex, finalTargetIndex);
|
|
1050
|
-
this.columnMoved.emit({
|
|
1051
|
-
startElementIndex: this.startElementIndex,
|
|
1052
|
-
finalTargetIndex
|
|
1053
|
-
});
|
|
1054
|
-
}
|
|
1055
|
-
else if (this.dragMode === 'row') {
|
|
1056
|
-
this.moveRow(this.startElementIndex, finalTargetIndex);
|
|
1057
|
-
this.rowMoved.emit({
|
|
1058
|
-
startElementIndex: this.startElementIndex,
|
|
1059
|
-
finalTargetIndex
|
|
1060
|
-
});
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
this.cleanupDragState();
|
|
1064
|
-
this.moveEnd.emit();
|
|
1065
|
-
this.table
|
|
1066
|
-
.querySelectorAll('td.dragging-source, th.dragging-source')
|
|
1067
|
-
.forEach(cell => {
|
|
1068
|
-
this.renderer.removeClass(cell, 'dragging-source');
|
|
1069
|
-
});
|
|
1070
|
-
}
|
|
1071
|
-
cleanupDragState() {
|
|
1072
|
-
const draggedMode = this.dragMode;
|
|
1073
|
-
const startIndex = this.startElementIndex;
|
|
1074
|
-
const sourceElement = this.draggedElementSource;
|
|
1075
|
-
const activeHandler = this.draggedElement;
|
|
1076
|
-
this.renderer.setStyle(this.dropIndicator, 'visibility', 'hidden');
|
|
1077
|
-
this.isDragging = false;
|
|
1078
|
-
this.dragMode = null;
|
|
1079
|
-
this.startElementIndex = -1;
|
|
1080
|
-
this.draggedElement = null;
|
|
1081
|
-
this.draggedElementSource = null;
|
|
1082
|
-
this.columnInfo = [];
|
|
1083
|
-
this.rowInfo = [];
|
|
1084
|
-
this.currentDropIndex = -1;
|
|
1085
|
-
this.handlerStartY = 0;
|
|
1086
|
-
this.suppressInteractions = false;
|
|
1087
|
-
this.clearDropHighlights();
|
|
1088
|
-
if (this.table) {
|
|
1089
|
-
if (draggedMode === 'column') {
|
|
1090
|
-
this.renderer.removeClass(this.table, 'dragging-column');
|
|
1091
|
-
if (startIndex >= 0) {
|
|
1092
|
-
this.styleColumnAsSource(startIndex, false);
|
|
1093
|
-
this.highlightColumn(startIndex, false);
|
|
1094
|
-
}
|
|
1095
|
-
else {
|
|
1096
|
-
this.table.querySelectorAll('td.dragging-source, th.dragging-source').forEach(cell => this.renderer.removeClass(cell, 'dragging-source'));
|
|
1097
|
-
this.table.querySelectorAll('.col-highlight').forEach(cell => this.renderer.removeClass(cell, 'col-highlight'));
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
else if (draggedMode === 'row') {
|
|
1101
|
-
this.renderer.removeClass(this.table, 'dragging-row');
|
|
1102
|
-
if (sourceElement)
|
|
1103
|
-
this.renderer.removeClass(sourceElement, 'dragging-source');
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
if (activeHandler) {
|
|
1107
|
-
this.renderer.removeClass(activeHandler, 'dragging-active-handler');
|
|
1108
|
-
}
|
|
1109
|
-
document.body.style.cursor = '';
|
|
1110
|
-
this.hideHandlers();
|
|
1111
|
-
this.cancelHideTimer();
|
|
1112
|
-
}
|
|
1113
|
-
moveRow(fromIndex, toIndex) {
|
|
1114
|
-
if (!this.table) {
|
|
1115
|
-
return;
|
|
1116
|
-
}
|
|
1117
|
-
const tbody = this.table.tBodies[0];
|
|
1118
|
-
if (!tbody) {
|
|
1119
|
-
return;
|
|
1120
|
-
}
|
|
1121
|
-
const visibleRows = Array.from(tbody.rows).filter(r => !r.classList.contains('dragging-source'));
|
|
1122
|
-
if (fromIndex < 0 || fromIndex >= visibleRows.length || toIndex < 0 || toIndex > visibleRows.length || fromIndex === toIndex) {
|
|
1123
|
-
const allRows = Array.from(tbody.rows);
|
|
1124
|
-
if (fromIndex < 0 || fromIndex >= allRows.length || toIndex < 0 || toIndex > allRows.length || fromIndex === toIndex) {
|
|
1125
|
-
return;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
const rowToMove = tbody.querySelector('tr.dragging-source');
|
|
1129
|
-
if (!rowToMove) {
|
|
1130
|
-
return;
|
|
1131
|
-
}
|
|
1132
|
-
const actualFromIndex = Array.from(tbody.rows).indexOf(rowToMove);
|
|
1133
|
-
const allRows = Array.from(tbody.rows);
|
|
1134
|
-
let referenceNode = null;
|
|
1135
|
-
let currentVisibleIndex = 0;
|
|
1136
|
-
let actualInsertIndex = -1;
|
|
1137
|
-
for (let i = 0; i < allRows.length; i++) {
|
|
1138
|
-
if (!allRows[i].classList.contains('dragging-source')) {
|
|
1139
|
-
if (currentVisibleIndex === toIndex) {
|
|
1140
|
-
actualInsertIndex = i;
|
|
1141
|
-
break;
|
|
1142
|
-
}
|
|
1143
|
-
currentVisibleIndex++;
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
if (actualInsertIndex === -1 && toIndex === visibleRows.length) {
|
|
1147
|
-
actualInsertIndex = allRows.length;
|
|
1148
|
-
}
|
|
1149
|
-
if (actualInsertIndex !== -1) {
|
|
1150
|
-
if (actualFromIndex < actualInsertIndex) {
|
|
1151
|
-
referenceNode = allRows[actualInsertIndex] ?? null;
|
|
1152
|
-
}
|
|
1153
|
-
else {
|
|
1154
|
-
referenceNode = allRows[actualInsertIndex];
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
else {
|
|
1158
|
-
return;
|
|
1159
|
-
}
|
|
1160
|
-
try {
|
|
1161
|
-
this.renderer.insertBefore(tbody, rowToMove, referenceNode);
|
|
1162
|
-
}
|
|
1163
|
-
catch (error) {
|
|
1164
|
-
}
|
|
1165
|
-
this.hoveredRowIndex = -1;
|
|
1166
|
-
}
|
|
1167
|
-
moveColumn(fromIndex, toIndex) {
|
|
1168
|
-
if (!this.table || fromIndex === toIndex || fromIndex < 0 || toIndex < 0) {
|
|
1169
|
-
return;
|
|
1170
|
-
}
|
|
1171
|
-
let moved = false;
|
|
1172
|
-
for (let i = 0; i < this.table.rows.length; i++) {
|
|
1173
|
-
const row = this.table.rows[i];
|
|
1174
|
-
const cells = Array.from(row.cells);
|
|
1175
|
-
if (fromIndex >= cells.length || toIndex > cells.length) {
|
|
1176
|
-
continue;
|
|
1177
|
-
}
|
|
1178
|
-
const cellToMove = cells[fromIndex];
|
|
1179
|
-
let referenceNode = null;
|
|
1180
|
-
if (fromIndex < toIndex) {
|
|
1181
|
-
referenceNode = cells[toIndex + 1] ?? null;
|
|
1182
|
-
}
|
|
1183
|
-
else {
|
|
1184
|
-
referenceNode = cells[toIndex];
|
|
1185
|
-
}
|
|
1186
|
-
if (cellToMove) {
|
|
1187
|
-
try {
|
|
1188
|
-
this.renderer.insertBefore(row, cellToMove, referenceNode);
|
|
1189
|
-
moved = true;
|
|
1190
|
-
}
|
|
1191
|
-
catch (error) {
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
styleColumnAsSource(columnIndex, add) {
|
|
1197
|
-
if (!this.table || columnIndex < 0)
|
|
1198
|
-
return;
|
|
1199
|
-
for (let i = 0; i < this.table.rows.length; i++) {
|
|
1200
|
-
const row = this.table.rows[i];
|
|
1201
|
-
if (columnIndex < row.cells.length) {
|
|
1202
|
-
const cell = row.cells[columnIndex];
|
|
1203
|
-
if (cell) {
|
|
1204
|
-
if (add) {
|
|
1205
|
-
this.renderer.addClass(cell, 'dragging-source');
|
|
1206
|
-
}
|
|
1207
|
-
else {
|
|
1208
|
-
this.renderer.removeClass(cell, 'dragging-source');
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
calculateColumnInfo() {
|
|
1215
|
-
this.columnInfo = [];
|
|
1216
|
-
if (!this.table || this.table.rows.length === 0)
|
|
1217
|
-
return;
|
|
1218
|
-
const referenceRow = this.table.tHead?.rows[0] ?? this.table.rows[0];
|
|
1219
|
-
if (!referenceRow)
|
|
1220
|
-
return;
|
|
1221
|
-
for (let i = 0; i < referenceRow.cells.length; i++) {
|
|
1222
|
-
const cell = referenceRow.cells[i];
|
|
1223
|
-
const rect = cell.getBoundingClientRect();
|
|
1224
|
-
this.columnInfo.push({ index: i, left: rect.left, width: rect.width, center: rect.left + rect.width / 2 });
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
calculateRowInfo() {
|
|
1228
|
-
this.rowInfo = [];
|
|
1229
|
-
if (!this.table || !this.table.tBodies[0])
|
|
1230
|
-
return;
|
|
1231
|
-
const tbody = this.table.tBodies[0];
|
|
1232
|
-
let visibleIndex = 0;
|
|
1233
|
-
for (let i = 0; i < tbody.rows.length; i++) {
|
|
1234
|
-
const row = tbody.rows[i];
|
|
1235
|
-
const rect = row.getBoundingClientRect();
|
|
1236
|
-
this.rowInfo.push({
|
|
1237
|
-
index: visibleIndex,
|
|
1238
|
-
element: row,
|
|
1239
|
-
top: rect.top,
|
|
1240
|
-
height: rect.height,
|
|
1241
|
-
center: rect.top + rect.height / 2
|
|
1242
|
-
});
|
|
1243
|
-
visibleIndex++;
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
findFirstVisibleCellInColumn(columnIndex) {
|
|
1247
|
-
if (!this.table || columnIndex < 0)
|
|
1248
|
-
return null;
|
|
1249
|
-
for (let i = 0; i < this.table.rows.length; i++) {
|
|
1250
|
-
const row = this.table.rows[i];
|
|
1251
|
-
if (columnIndex < row.cells.length) {
|
|
1252
|
-
const c = row.cells[columnIndex];
|
|
1253
|
-
if (c && c.offsetParent !== null) {
|
|
1254
|
-
return c;
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
return null;
|
|
1259
|
-
}
|
|
1260
|
-
updateDropIndicator(targetVisualIndex, mode) {
|
|
1261
|
-
if (!this.table || targetVisualIndex < 0 || this.startElementIndex < 0) {
|
|
1262
|
-
this.renderer.setStyle(this.dropIndicator, 'visibility', 'hidden');
|
|
1263
|
-
return;
|
|
1264
|
-
}
|
|
1265
|
-
const insertBeforeIndex = (targetVisualIndex <= this.startElementIndex) ? targetVisualIndex : targetVisualIndex + 1;
|
|
1266
|
-
if (insertBeforeIndex === this.startElementIndex || insertBeforeIndex === this.startElementIndex + 1) {
|
|
1267
|
-
this.renderer.setStyle(this.dropIndicator, 'visibility', 'hidden');
|
|
1268
|
-
return;
|
|
1269
|
-
}
|
|
1270
|
-
const tableRect = this.table.getBoundingClientRect();
|
|
1271
|
-
if (mode === 'column') {
|
|
1272
|
-
const referenceColumnInfo = this.columnInfo.find(c => c.index === insertBeforeIndex);
|
|
1273
|
-
let indicatorLeftTable = 0;
|
|
1274
|
-
if (referenceColumnInfo) {
|
|
1275
|
-
indicatorLeftTable = referenceColumnInfo.left - tableRect.left;
|
|
1276
|
-
}
|
|
1277
|
-
else {
|
|
1278
|
-
const lastColInfo = this.columnInfo[this.columnInfo.length - 1];
|
|
1279
|
-
indicatorLeftTable = lastColInfo ? (lastColInfo.left - tableRect.left + lastColInfo.width) : this.table.offsetWidth;
|
|
1280
|
-
}
|
|
1281
|
-
indicatorLeftTable -= Math.floor(this.indicatorThickness / 2);
|
|
1282
|
-
this.renderer.setStyle(this.dropIndicator, 'left', `${indicatorLeftTable}px`);
|
|
1283
|
-
this.renderer.setStyle(this.dropIndicator, 'top', `0px`);
|
|
1284
|
-
this.renderer.setStyle(this.dropIndicator, 'height', `${this.table.offsetHeight}px`);
|
|
1285
|
-
this.renderer.setStyle(this.dropIndicator, 'width', `${this.indicatorThickness}px`);
|
|
1286
|
-
this.renderer.removeStyle(this.dropIndicator, 'right');
|
|
1287
|
-
this.renderer.removeStyle(this.dropIndicator, 'bottom');
|
|
1288
|
-
}
|
|
1289
|
-
else {
|
|
1290
|
-
const referenceRowInfo = this.rowInfo.find(r => r.index === insertBeforeIndex);
|
|
1291
|
-
let indicatorTopTable = 0;
|
|
1292
|
-
if (referenceRowInfo) {
|
|
1293
|
-
indicatorTopTable = referenceRowInfo.top - tableRect.top;
|
|
1294
|
-
}
|
|
1295
|
-
else {
|
|
1296
|
-
const lastRowInfo = this.rowInfo[this.rowInfo.length - 1];
|
|
1297
|
-
indicatorTopTable = lastRowInfo
|
|
1298
|
-
? (lastRowInfo.top - tableRect.top + lastRowInfo.height)
|
|
1299
|
-
: (this.table.tBodies[0]?.offsetHeight ?? this.table.offsetHeight);
|
|
1300
|
-
}
|
|
1301
|
-
indicatorTopTable -= Math.floor(this.indicatorThickness / 2);
|
|
1302
|
-
this.renderer.setStyle(this.dropIndicator, 'top', `${indicatorTopTable}px`);
|
|
1303
|
-
this.renderer.setStyle(this.dropIndicator, 'left', `0px`);
|
|
1304
|
-
this.renderer.setStyle(this.dropIndicator, 'width', `${this.table.offsetWidth}px`);
|
|
1305
|
-
this.renderer.setStyle(this.dropIndicator, 'height', `${this.indicatorThickness}px`);
|
|
1306
|
-
this.renderer.removeStyle(this.dropIndicator, 'bottom');
|
|
1307
|
-
this.renderer.removeStyle(this.dropIndicator, 'right');
|
|
1308
|
-
}
|
|
1309
|
-
this.renderer.setStyle(this.dropIndicator, 'visibility', 'visible');
|
|
1310
|
-
}
|
|
1311
|
-
highlightColumn(index, add) {
|
|
1312
|
-
}
|
|
1313
|
-
clearDropHighlights() {
|
|
1314
|
-
}
|
|
1315
|
-
getCurrentScrollContainer() {
|
|
1316
|
-
if (isPlatformServer(this._platformId)) {
|
|
1317
|
-
return null;
|
|
1318
|
-
}
|
|
1319
|
-
try {
|
|
1320
|
-
const container = this.contentBuilder?.getScrollContainer?.();
|
|
1321
|
-
return container || null;
|
|
1322
|
-
}
|
|
1323
|
-
catch {
|
|
1324
|
-
return null;
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
bindScrollContainerListener() {
|
|
1328
|
-
if (isPlatformServer(this._platformId)) {
|
|
1329
|
-
return;
|
|
1330
|
-
}
|
|
1331
|
-
if (this.scrollSub) {
|
|
1332
|
-
return;
|
|
1333
|
-
}
|
|
1334
|
-
this.unbindScrollContainerListener();
|
|
1335
|
-
this.ngZone.runOutsideAngular(() => {
|
|
1336
|
-
const scroll$ = this.contentBuilder?.scrollContainerScrolled;
|
|
1337
|
-
if (!scroll$) {
|
|
1338
|
-
return;
|
|
1339
|
-
}
|
|
1340
|
-
this.scrollSub = scroll$
|
|
1341
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1342
|
-
.subscribe(() => this.onScrollContainerScrolled());
|
|
1343
|
-
});
|
|
1344
|
-
}
|
|
1345
|
-
unbindScrollContainerListener() {
|
|
1346
|
-
if (this.scrollSub) {
|
|
1347
|
-
try {
|
|
1348
|
-
this.scrollSub.unsubscribe();
|
|
1349
|
-
}
|
|
1350
|
-
catch { }
|
|
1351
|
-
this.scrollSub = null;
|
|
1352
|
-
}
|
|
1353
|
-
this.scrollContainerRef = null;
|
|
1354
|
-
}
|
|
1355
|
-
ensureScrollContainerListener() {
|
|
1356
|
-
if (isPlatformServer(this._platformId)) {
|
|
1357
|
-
return;
|
|
1358
|
-
}
|
|
1359
|
-
if (!this.scrollSub)
|
|
1360
|
-
this.bindScrollContainerListener();
|
|
1361
|
-
}
|
|
1362
|
-
onScrollContainerScrolled() {
|
|
1363
|
-
this.cancelHideTimer();
|
|
1364
|
-
this.hideHandlers();
|
|
1365
|
-
}
|
|
1366
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DraggableTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1367
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: DraggableTableComponent, isStandalone: true, selector: "ngs-draggable-table", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnMoved: "columnMoved", rowMoved: "rowMoved", moveStart: "moveStart", moveEnd: "moveEnd" }, host: { properties: { "class.disabled": "disabled() || null", "class.draggable-table-host": "this.hostClass" } }, exportAs: ["ngsDraggableTable"], ngImport: i0, template: "<ng-content/>\n", styles: [":host{display:block}:host ::ng-deep .drag-handler{position:fixed;width:18px;height:18px;background-color:#6496ffb3;border:1px solid var(--ngs-color-primary);border-radius:3px;cursor:grab;box-sizing:border-box;transition:background-color .2s ease,visibility .1s linear;z-index:1000;visibility:hidden}:host ::ng-deep .drag-handler:hover{background-color:var(--ngs-color-primary)}:host ::ng-deep .drag-handler.dragging-active-handler{cursor:grabbing!important;background-color:var(--ngs-color-primary)!important;border-color:var(--ngs-color-primary)!important;z-index:1001!important}:host ::ng-deep .drop-indicator{position:absolute;background-color:var(--ngs-color-primary);z-index:5;pointer-events:none;visibility:hidden}:host ::ng-deep tr.dragging-source,:host ::ng-deep td.dragging-source,:host ::ng-deep th.dragging-source{background:var(--ngs-color-surface-container-low)}:host ::ng-deep table.dragging-row td,:host ::ng-deep table.dragging-row th,:host ::ng-deep table.dragging-column td,:host ::ng-deep table.dragging-column th,:host ::ng-deep tr.dragging-source td,:host ::ng-deep tr.dragging-source th,:host ::ng-deep td.dragging-source,:host ::ng-deep th.dragging-source{pointer-events:none}:host.disabled ::ng-deep .drag-handler{visibility:hidden!important}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1368
|
-
}
|
|
1369
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DraggableTableComponent, decorators: [{
|
|
1370
|
-
type: Component,
|
|
1371
|
-
args: [{ selector: 'ngs-draggable-table', exportAs: 'ngsDraggableTable', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1372
|
-
'[class.disabled]': 'disabled() || null'
|
|
1373
|
-
}, template: "<ng-content/>\n", styles: [":host{display:block}:host ::ng-deep .drag-handler{position:fixed;width:18px;height:18px;background-color:#6496ffb3;border:1px solid var(--ngs-color-primary);border-radius:3px;cursor:grab;box-sizing:border-box;transition:background-color .2s ease,visibility .1s linear;z-index:1000;visibility:hidden}:host ::ng-deep .drag-handler:hover{background-color:var(--ngs-color-primary)}:host ::ng-deep .drag-handler.dragging-active-handler{cursor:grabbing!important;background-color:var(--ngs-color-primary)!important;border-color:var(--ngs-color-primary)!important;z-index:1001!important}:host ::ng-deep .drop-indicator{position:absolute;background-color:var(--ngs-color-primary);z-index:5;pointer-events:none;visibility:hidden}:host ::ng-deep tr.dragging-source,:host ::ng-deep td.dragging-source,:host ::ng-deep th.dragging-source{background:var(--ngs-color-surface-container-low)}:host ::ng-deep table.dragging-row td,:host ::ng-deep table.dragging-row th,:host ::ng-deep table.dragging-column td,:host ::ng-deep table.dragging-column th,:host ::ng-deep tr.dragging-source td,:host ::ng-deep tr.dragging-source th,:host ::ng-deep td.dragging-source,:host ::ng-deep th.dragging-source{pointer-events:none}:host.disabled ::ng-deep .drag-handler{visibility:hidden!important}\n"] }]
|
|
1374
|
-
}], ctorParameters: () => [], propDecorators: { hostClass: [{
|
|
1375
|
-
type: HostBinding,
|
|
1376
|
-
args: ['class.draggable-table-host']
|
|
1377
|
-
}], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], columnMoved: [{ type: i0.Output, args: ["columnMoved"] }], rowMoved: [{ type: i0.Output, args: ["rowMoved"] }], moveStart: [{ type: i0.Output, args: ["moveStart"] }], moveEnd: [{ type: i0.Output, args: ["moveEnd"] }] } });
|
|
1378
|
-
|
|
1379
|
-
class TableBlockComponent {
|
|
1380
|
-
_platformId = inject(PLATFORM_ID);
|
|
1381
|
-
_contentBuilder = inject(CONTENT_BUILDER);
|
|
1382
|
-
_store = inject(ContentBuilderStore);
|
|
1383
|
-
_cdr = inject(ChangeDetectorRef);
|
|
1384
|
-
_tableRef = viewChild.required('table', /* @ts-ignore */
|
|
1385
|
-
...(ngDevMode ? [{ debugName: "_tableRef" }] : /* istanbul ignore next */ []));
|
|
1386
|
-
id = input.required(/* @ts-ignore */
|
|
1387
|
-
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
1388
|
-
content = input.required(/* @ts-ignore */
|
|
1389
|
-
...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
1390
|
-
settings = input.required(/* @ts-ignore */
|
|
1391
|
-
...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
|
|
1392
|
-
index = input.required(/* @ts-ignore */
|
|
1393
|
-
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
1394
|
-
props = input([], /* @ts-ignore */
|
|
1395
|
-
...(ngDevMode ? [{ debugName: "props" }] : /* istanbul ignore next */ []));
|
|
1396
|
-
fullWidth = computed(() => this.settings().fullWidth !== false, /* @ts-ignore */
|
|
1397
|
-
...(ngDevMode ? [{ debugName: "fullWidth" }] : /* istanbul ignore next */ []));
|
|
1398
|
-
_content = signal([], /* @ts-ignore */
|
|
1399
|
-
...(ngDevMode ? [{ debugName: "_content" }] : /* istanbul ignore next */ []));
|
|
1400
|
-
_columnManaging = signal(false, /* @ts-ignore */
|
|
1401
|
-
...(ngDevMode ? [{ debugName: "_columnManaging" }] : /* istanbul ignore next */ []));
|
|
1402
|
-
_rowManaging = signal(false, /* @ts-ignore */
|
|
1403
|
-
...(ngDevMode ? [{ debugName: "_rowManaging" }] : /* istanbul ignore next */ []));
|
|
1404
|
-
_tableManging = signal(false, /* @ts-ignore */
|
|
1405
|
-
...(ngDevMode ? [{ debugName: "_tableManging" }] : /* istanbul ignore next */ []));
|
|
1406
|
-
_resizeManging = signal(false, /* @ts-ignore */
|
|
1407
|
-
...(ngDevMode ? [{ debugName: "_resizeManging" }] : /* istanbul ignore next */ []));
|
|
1408
|
-
initialized = signal(false, /* @ts-ignore */
|
|
1409
|
-
...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
|
|
1410
|
-
constructor() {
|
|
1411
|
-
effect(() => {
|
|
1412
|
-
const content = this.content();
|
|
1413
|
-
untracked(() => this._content.set(cloneContentEditorValue(content)));
|
|
1414
|
-
});
|
|
1415
|
-
}
|
|
1416
|
-
onCellContentChanged(cell, content) {
|
|
1417
|
-
cell.content = content;
|
|
1418
|
-
this.update();
|
|
1419
|
-
}
|
|
1420
|
-
onCellPropsChanged(cell, props) {
|
|
1421
|
-
cell.props = props;
|
|
1422
|
-
this.update();
|
|
1423
|
-
}
|
|
1424
|
-
ngOnInit() {
|
|
1425
|
-
this._content.set(cloneContentEditorValue(this.content()));
|
|
1426
|
-
}
|
|
1427
|
-
ngAfterViewInit() {
|
|
1428
|
-
if (isPlatformBrowser(this._platformId)) {
|
|
1429
|
-
const selection = new SelectionArea({
|
|
1430
|
-
selectables: ['.table td'],
|
|
1431
|
-
boundaries: ['.table'],
|
|
1432
|
-
features: {
|
|
1433
|
-
touch: true,
|
|
1434
|
-
range: true,
|
|
1435
|
-
deselectOnBlur: true,
|
|
1436
|
-
singleTap: {
|
|
1437
|
-
allow: false,
|
|
1438
|
-
intersect: 'native'
|
|
1439
|
-
}
|
|
1440
|
-
}
|
|
1441
|
-
}).on('start', ({ store, event }) => {
|
|
1442
|
-
if (!event.ctrlKey && !event.metaKey) {
|
|
1443
|
-
store.stored.forEach((el) => el.classList.remove('selected'));
|
|
1444
|
-
selection.clearSelection();
|
|
1445
|
-
}
|
|
1446
|
-
})
|
|
1447
|
-
.on('move', ({ store: { changed: { added, removed } } }) => {
|
|
1448
|
-
if (this._tableManging() || this._columnManaging() || this._rowManaging()) {
|
|
1449
|
-
return;
|
|
1450
|
-
}
|
|
1451
|
-
added.forEach(el => el.classList.add('selected'));
|
|
1452
|
-
removed.forEach(el => el.classList.remove('selected'));
|
|
1453
|
-
});
|
|
1454
|
-
}
|
|
1455
|
-
this.initialized.set(true);
|
|
1456
|
-
}
|
|
1457
|
-
focus() {
|
|
1458
|
-
}
|
|
1459
|
-
onTableFocusChange(type) {
|
|
1460
|
-
if (type === null) {
|
|
1461
|
-
this.clearCellsSelection();
|
|
1462
|
-
}
|
|
1463
|
-
}
|
|
1464
|
-
clearCellsSelection() {
|
|
1465
|
-
this._tableRef().nativeElement.querySelectorAll('td')
|
|
1466
|
-
.forEach((el) => el.classList.remove('selected'));
|
|
1467
|
-
this.update();
|
|
1468
|
-
}
|
|
1469
|
-
onColAdded() {
|
|
1470
|
-
this._content.update((content) => {
|
|
1471
|
-
content.forEach((row) => {
|
|
1472
|
-
row.push({
|
|
1473
|
-
content: [],
|
|
1474
|
-
props: [],
|
|
1475
|
-
styles: {},
|
|
1476
|
-
options: {
|
|
1477
|
-
colspan: 1,
|
|
1478
|
-
rowspan: 1
|
|
1479
|
-
}
|
|
1480
|
-
});
|
|
1481
|
-
});
|
|
1482
|
-
return content;
|
|
1483
|
-
});
|
|
1484
|
-
this._cdr.markForCheck();
|
|
1485
|
-
this.update();
|
|
1486
|
-
}
|
|
1487
|
-
onColDeleted() {
|
|
1488
|
-
if (this._content().length > 0 && this._content()[0].length === 1) {
|
|
1489
|
-
return;
|
|
1490
|
-
}
|
|
1491
|
-
let isLastColEmpty = false;
|
|
1492
|
-
this._content().forEach((row) => {
|
|
1493
|
-
if (contentEditorText(row[row.length - 1].content)) {
|
|
1494
|
-
isLastColEmpty = true;
|
|
1495
|
-
}
|
|
1496
|
-
});
|
|
1497
|
-
if (isLastColEmpty) {
|
|
1498
|
-
return;
|
|
1499
|
-
}
|
|
1500
|
-
this._content.update((content) => {
|
|
1501
|
-
content.forEach((row) => {
|
|
1502
|
-
row.splice(row.length - 1, 1);
|
|
1503
|
-
});
|
|
1504
|
-
return content;
|
|
1505
|
-
});
|
|
1506
|
-
this._cdr.markForCheck();
|
|
1507
|
-
this.update();
|
|
1508
|
-
}
|
|
1509
|
-
onRowAdded() {
|
|
1510
|
-
this._content.update((content) => {
|
|
1511
|
-
const row = [];
|
|
1512
|
-
for (let i = 0; i < content[0].length; i++) {
|
|
1513
|
-
row.push({
|
|
1514
|
-
content: [],
|
|
1515
|
-
props: [],
|
|
1516
|
-
styles: {},
|
|
1517
|
-
options: {
|
|
1518
|
-
colspan: 1,
|
|
1519
|
-
rowspan: 1
|
|
1520
|
-
}
|
|
1521
|
-
});
|
|
1522
|
-
}
|
|
1523
|
-
content.push(row);
|
|
1524
|
-
return content;
|
|
1525
|
-
});
|
|
1526
|
-
this._cdr.markForCheck();
|
|
1527
|
-
this.update();
|
|
1528
|
-
}
|
|
1529
|
-
onRowDeleted() {
|
|
1530
|
-
if (this._content().length === 1) {
|
|
1531
|
-
return;
|
|
1532
|
-
}
|
|
1533
|
-
let isLastRowEmpty = false;
|
|
1534
|
-
this._content()[this._content().length - 1].forEach((cell) => {
|
|
1535
|
-
if (contentEditorText(cell.content)) {
|
|
1536
|
-
isLastRowEmpty = true;
|
|
1537
|
-
}
|
|
1538
|
-
});
|
|
1539
|
-
if (isLastRowEmpty) {
|
|
1540
|
-
return;
|
|
1541
|
-
}
|
|
1542
|
-
this._content.update((content) => {
|
|
1543
|
-
content.splice(content.length - 1, 1);
|
|
1544
|
-
return content;
|
|
1545
|
-
});
|
|
1546
|
-
this._cdr.markForCheck();
|
|
1547
|
-
this.update();
|
|
1548
|
-
}
|
|
1549
|
-
onColumnManagingStart() {
|
|
1550
|
-
this._columnManaging.set(true);
|
|
1551
|
-
}
|
|
1552
|
-
onColumnManagingEnd() {
|
|
1553
|
-
this._columnManaging.set(false);
|
|
1554
|
-
}
|
|
1555
|
-
onRowManagingStart() {
|
|
1556
|
-
this._rowManaging.set(true);
|
|
1557
|
-
}
|
|
1558
|
-
onRowManagingEnd() {
|
|
1559
|
-
this._rowManaging.set(false);
|
|
1560
|
-
}
|
|
1561
|
-
onColumnWidthChange({ columnIndex, width }) {
|
|
1562
|
-
this._content.update((content) => {
|
|
1563
|
-
content.forEach(row => {
|
|
1564
|
-
const cell = row[columnIndex];
|
|
1565
|
-
if (cell)
|
|
1566
|
-
cell.options.width = width;
|
|
1567
|
-
});
|
|
1568
|
-
return content;
|
|
1569
|
-
});
|
|
1570
|
-
this.update();
|
|
1571
|
-
}
|
|
1572
|
-
onColumnMoved(event) {
|
|
1573
|
-
this._content.update((content) => {
|
|
1574
|
-
content.forEach(row => {
|
|
1575
|
-
moveItemInArray(row, event.startElementIndex, event.finalTargetIndex);
|
|
1576
|
-
});
|
|
1577
|
-
return content;
|
|
1578
|
-
});
|
|
1579
|
-
this._cdr.markForCheck();
|
|
1580
|
-
this.update();
|
|
1581
|
-
}
|
|
1582
|
-
onRowMoved(event) {
|
|
1583
|
-
this._content.update((content) => {
|
|
1584
|
-
moveItemInArray(content, event.startElementIndex, event.finalTargetIndex);
|
|
1585
|
-
return content;
|
|
1586
|
-
});
|
|
1587
|
-
this._cdr.markForCheck();
|
|
1588
|
-
this.update();
|
|
1589
|
-
}
|
|
1590
|
-
onMoveStart() {
|
|
1591
|
-
this._tableManging.set(true);
|
|
1592
|
-
}
|
|
1593
|
-
onMoveEnd() {
|
|
1594
|
-
this._tableManging.set(false);
|
|
1595
|
-
}
|
|
1596
|
-
onColumnWidthChangeStart() {
|
|
1597
|
-
this._tableManging.set(true);
|
|
1598
|
-
this._resizeManging.set(true);
|
|
1599
|
-
}
|
|
1600
|
-
onColumnWidthChangeEnd() {
|
|
1601
|
-
this._tableManging.set(false);
|
|
1602
|
-
this._resizeManging.set(false);
|
|
1603
|
-
this._cdr.markForCheck();
|
|
1604
|
-
}
|
|
1605
|
-
getData() {
|
|
1606
|
-
return {
|
|
1607
|
-
content: this._content(),
|
|
1608
|
-
settings: {
|
|
1609
|
-
...this.settings(),
|
|
1610
|
-
}
|
|
1611
|
-
};
|
|
1612
|
-
}
|
|
1613
|
-
isEmpty() {
|
|
1614
|
-
return false;
|
|
1615
|
-
}
|
|
1616
|
-
update() {
|
|
1617
|
-
this._store.updateBlock(this.id(), { content: this._content(), isEmpty: this.isEmpty() });
|
|
1618
|
-
this._contentBuilder.emitContentChangeEvent();
|
|
1619
|
-
}
|
|
1620
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TableBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1621
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: TableBlockComponent, isStandalone: true, selector: "ngs-table-block", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.is-full-width": "fullWidth()", "class.is-column-managing": "_columnManaging()", "class.is-row-managing": "_rowManaging()" } }, providers: [
|
|
1622
|
-
{
|
|
1623
|
-
provide: CONTENT_EDITOR_BLOCK,
|
|
1624
|
-
useExisting: TableBlockComponent,
|
|
1625
|
-
multi: true
|
|
1626
|
-
}
|
|
1627
|
-
], viewQueries: [{ propertyName: "_tableRef", first: true, predicate: ["table"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n [resizeEnabled]=\"!fullWidth()\"\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td\n [ngsContentEditorContentEditable]=\"cell.content\"\n [props]=\"cell.props\"\n (contentChanged)=\"onCellContentChanged(cell, $event)\"\n (propsChanged)=\"onCellPropsChanged(cell, $event)\"\n (blur)=\"clearCellsSelection()\"\n [rowSpan]=\"cell.options.rowspan\"\n [colSpan]=\"cell.options.colspan\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n <div class=\"resize-end\" ngsTableColumnsManager\n (columnManagingStart)=\"onColumnManagingStart()\"\n (columnManagingEnd)=\"onColumnManagingEnd()\"\n (columnAdded)=\"onColAdded()\"\n (columnDeleted)=\"onColDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n <div class=\"resize-bottom\" ngsTableRowsManager\n (rowManagingStart)=\"onRowManagingStart()\"\n (rowManagingEnd)=\"onRowManagingEnd()\"\n (rowAdded)=\"onRowAdded()\"\n (rowDeleted)=\"onRowDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n </ngs-draggable-table>\n </div>\n</div>\n", styles: [":host{display:block}:host.is-column-managing{cursor:col-resize;-webkit-user-select:none;user-select:none}:host.is-row-managing{cursor:row-resize;-webkit-user-select:none;user-select:none}:host .table-overflow{position:relative;padding-bottom:26px;overflow-y:hidden;overflow-x:auto;max-width:100%;width:var(--ngs-content-editor-builder-content-width, 704px)}:host .table-container{position:relative;width:max-content}:host table{width:auto;word-break:break-word;border-collapse:collapse;table-layout:fixed;border:1px solid var(--ngs-color-border);outline:none}:host table tr:not(:last-child){border-bottom:1px solid var(--ngs-color-border)}:host table td{min-width:120px;height:40px;padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);outline:none}:host table td:not(:last-child){border-right:1px solid var(--ngs-color-border)}:host table td.selected{background:var(--ngs-content-editor-selected-bg, var(--ngs-color-primary-container))}:host.is-full-width .table-overflow{width:auto;padding-inline-end:calc(var(--spacing, .25rem) * 5)}:host.is-full-width .table-container,:host.is-full-width table{width:100%}:host.is-full-width table col{width:auto!important}:host.is-full-width table td{min-width:0}:host .resize-end{position:absolute;width:calc(var(--spacing, .25rem) * 4);right:calc(calc(var(--spacing, .25rem) * 5) * -1);top:0;bottom:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-end:hover{cursor:col-resize;background:var(--ngs-color-surface-container-high)}:host .resize-bottom{position:absolute;height:calc(var(--spacing, .25rem) * 4);bottom:calc(calc(var(--spacing, .25rem) * 5) * -1);left:0;right:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-bottom:hover{cursor:row-resize;background:var(--ngs-color-surface-container-high)}:host .resize-icon{font-size:14px!important;height:14px!important;width:14px!important}:host.is-resizing{-webkit-user-select:none;user-select:none}:host table[ngsResizableTable] th.resizable-hover-handle:after,:host table[ngsResizableTable] td.resizable-hover-handle:after{opacity:1;visibility:visible}:host .table-resizing{cursor:col-resize!important;-webkit-user-select:none;user-select:none}:host .table-resizing+.resizable-table-handle{opacity:1;visibility:visible}:host .resizable-table-wrapper{position:relative}:host .resizable-table-handle{position:absolute;top:0;height:100%;background-color:var(--ngs-color-primary-400);cursor:col-resize;z-index:10;opacity:0;visibility:hidden;left:-9999px;transition:opacity .05s ease-in-out,visibility .05s ease-in-out}:host .resizable-table-handle.resize-handle--active{opacity:1;visibility:visible}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: ContentEditorContentEditableDirective, selector: "[ngsContentEditorContentEditable]", inputs: ["ngsContentEditorContentEditable", "settings", "props", "singleLine"], outputs: ["contentChanged", "propsChanged", "pressedEnter", "initialized"], exportAs: ["ngsContentEditorContentEditable"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "directive", type: TableColumnsManagerDirective, selector: "[ngsTableColumnsManager]", outputs: ["columnAdded", "columnDeleted", "columnManagingStart", "columnManagingEnd"] }, { kind: "directive", type: TableRowsManagerDirective, selector: "[ngsTableRowsManager]", outputs: ["rowManagingStart", "rowManagingEnd", "rowAdded", "rowDeleted"] }, { kind: "directive", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "directive", type: ResizableTableDirective, selector: "table[ngsResizableTable]", inputs: ["minColumnWidth", "resizeHandleWidth", "mutationObserverDebounceTime", "resizeEnabled"], outputs: ["columnWidthChange", "columnWidthChangeStart", "columnWidthChangeEnd"] }, { kind: "component", type: DraggableTableComponent, selector: "ngs-draggable-table", inputs: ["disabled"], outputs: ["columnMoved", "rowMoved", "moveStart", "moveEnd"], exportAs: ["ngsDraggableTable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1628
|
-
}
|
|
1629
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: TableBlockComponent, decorators: [{
|
|
1630
|
-
type: Component,
|
|
1631
|
-
args: [{ selector: 'ngs-table-block', imports: [
|
|
1632
|
-
ContentEditorContentEditableDirective,
|
|
1633
|
-
Icon,
|
|
1634
|
-
TableColumnsManagerDirective,
|
|
1635
|
-
TableRowsManagerDirective,
|
|
1636
|
-
CdkMonitorFocus,
|
|
1637
|
-
ResizableTableDirective,
|
|
1638
|
-
DraggableTableComponent
|
|
1639
|
-
], providers: [
|
|
1640
|
-
{
|
|
1641
|
-
provide: CONTENT_EDITOR_BLOCK,
|
|
1642
|
-
useExisting: TableBlockComponent,
|
|
1643
|
-
multi: true
|
|
1644
|
-
}
|
|
1645
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1646
|
-
'[class.is-full-width]': 'fullWidth()',
|
|
1647
|
-
'[class.is-column-managing]': '_columnManaging()',
|
|
1648
|
-
'[class.is-row-managing]': '_rowManaging()',
|
|
1649
|
-
}, template: "<div class=\"table-overflow\">\n <div class=\"table-container\">\n <ngs-draggable-table [disabled]=\"_resizeManging() || _columnManaging() || _rowManaging()\"\n (columnMoved)=\"onColumnMoved($event)\"\n (rowMoved)=\"onRowMoved($event)\"\n (moveStart)=\"onMoveStart()\"\n (moveEnd)=\"onMoveEnd()\">\n <table #table class=\"table\"\n ngsResizableTable\n [resizeEnabled]=\"!fullWidth()\"\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"onTableFocusChange($event)\"\n (columnWidthChangeStart)=\"onColumnWidthChangeStart()\"\n (columnWidthChangeEnd)=\"onColumnWidthChangeEnd()\"\n (columnWidthChange)=\"onColumnWidthChange($event)\">\n <colgroup>\n @for (cell of _content()[0]; track $index) {\n <col [style.width.px]=\"cell.options.width || null\">\n }\n </colgroup>\n <tbody>\n @for (row of _content(); track $index) {\n <tr>\n @for (cell of row; track $index) {\n <td\n [ngsContentEditorContentEditable]=\"cell.content\"\n [props]=\"cell.props\"\n (contentChanged)=\"onCellContentChanged(cell, $event)\"\n (propsChanged)=\"onCellPropsChanged(cell, $event)\"\n (blur)=\"clearCellsSelection()\"\n [rowSpan]=\"cell.options.rowspan\"\n [colSpan]=\"cell.options.colspan\"></td>\n }\n </tr>\n }\n </tbody>\n </table>\n <div class=\"resize-end\" ngsTableColumnsManager\n (columnManagingStart)=\"onColumnManagingStart()\"\n (columnManagingEnd)=\"onColumnManagingEnd()\"\n (columnAdded)=\"onColAdded()\"\n (columnDeleted)=\"onColDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n <div class=\"resize-bottom\" ngsTableRowsManager\n (rowManagingStart)=\"onRowManagingStart()\"\n (rowManagingEnd)=\"onRowManagingEnd()\"\n (rowAdded)=\"onRowAdded()\"\n (rowDeleted)=\"onRowDeleted()\">\n <ngs-icon name=\"fluent:add-24-regular\" class=\"resize-icon\" />\n </div>\n </ngs-draggable-table>\n </div>\n</div>\n", styles: [":host{display:block}:host.is-column-managing{cursor:col-resize;-webkit-user-select:none;user-select:none}:host.is-row-managing{cursor:row-resize;-webkit-user-select:none;user-select:none}:host .table-overflow{position:relative;padding-bottom:26px;overflow-y:hidden;overflow-x:auto;max-width:100%;width:var(--ngs-content-editor-builder-content-width, 704px)}:host .table-container{position:relative;width:max-content}:host table{width:auto;word-break:break-word;border-collapse:collapse;table-layout:fixed;border:1px solid var(--ngs-color-border);outline:none}:host table tr:not(:last-child){border-bottom:1px solid var(--ngs-color-border)}:host table td{min-width:120px;height:40px;padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);outline:none}:host table td:not(:last-child){border-right:1px solid var(--ngs-color-border)}:host table td.selected{background:var(--ngs-content-editor-selected-bg, var(--ngs-color-primary-container))}:host.is-full-width .table-overflow{width:auto;padding-inline-end:calc(var(--spacing, .25rem) * 5)}:host.is-full-width .table-container,:host.is-full-width table{width:100%}:host.is-full-width table col{width:auto!important}:host.is-full-width table td{min-width:0}:host .resize-end{position:absolute;width:calc(var(--spacing, .25rem) * 4);right:calc(calc(var(--spacing, .25rem) * 5) * -1);top:0;bottom:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-end:hover{cursor:col-resize;background:var(--ngs-color-surface-container-high)}:host .resize-bottom{position:absolute;height:calc(var(--spacing, .25rem) * 4);bottom:calc(calc(var(--spacing, .25rem) * 5) * -1);left:0;right:0;border-radius:var(--spacing, .25rem);background:var(--ngs-color-surface-container);display:flex;align-items:center;justify-content:center}:host .resize-bottom:hover{cursor:row-resize;background:var(--ngs-color-surface-container-high)}:host .resize-icon{font-size:14px!important;height:14px!important;width:14px!important}:host.is-resizing{-webkit-user-select:none;user-select:none}:host table[ngsResizableTable] th.resizable-hover-handle:after,:host table[ngsResizableTable] td.resizable-hover-handle:after{opacity:1;visibility:visible}:host .table-resizing{cursor:col-resize!important;-webkit-user-select:none;user-select:none}:host .table-resizing+.resizable-table-handle{opacity:1;visibility:visible}:host .resizable-table-wrapper{position:relative}:host .resizable-table-handle{position:absolute;top:0;height:100%;background-color:var(--ngs-color-primary-400);cursor:col-resize;z-index:10;opacity:0;visibility:hidden;left:-9999px;transition:opacity .05s ease-in-out,visibility .05s ease-in-out}:host .resizable-table-handle.resize-handle--active{opacity:1;visibility:visible}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
1650
|
-
}], ctorParameters: () => [], propDecorators: { _tableRef: [{ type: i0.ViewChild, args: ['table', { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1651
|
-
|
|
1652
|
-
export { TableBlockComponent };
|
|
1653
|
-
//# sourceMappingURL=ngstarter-ui-components-content-editor-table-block.component-D05mE7nQ.mjs.map
|