@vonage/vivid 5.15.1 → 5.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/definition.cjs +7 -207
- package/accordion/definition.js +2 -199
- package/accordion/index.cjs +4 -4
- package/accordion/index.js +93 -127
- package/accordion-item/definition.cjs +6 -146
- package/accordion-item/definition.js +2 -139
- package/accordion-item/index.cjs +1 -1
- package/accordion-item/index.js +6 -2
- package/action-group/definition.cjs +5 -69
- package/action-group/definition.js +1 -62
- package/action-group/index.cjs +4 -4
- package/action-group/index.js +16 -46
- package/alert/definition.cjs +6 -201
- package/alert/definition.js +2 -194
- package/alert/index.cjs +15 -15
- package/alert/index.js +90 -136
- package/audio-player/definition.cjs +6 -459
- package/audio-player/definition.js +2 -452
- package/audio-player/index.cjs +49 -49
- package/audio-player/index.js +234 -302
- package/avatar/definition.cjs +6 -117
- package/avatar/definition.js +2 -110
- package/avatar/index.cjs +14 -14
- package/avatar/index.js +44 -84
- package/badge/definition.cjs +6 -85
- package/badge/definition.js +2 -78
- package/badge/index.cjs +4 -4
- package/badge/index.js +21 -65
- package/banner/definition.cjs +6 -160
- package/banner/definition.js +2 -153
- package/banner/index.cjs +13 -13
- package/banner/index.js +76 -109
- package/breadcrumb/definition.cjs +5 -97
- package/breadcrumb/definition.js +1 -90
- package/breadcrumb/index.cjs +4 -4
- package/breadcrumb/index.js +33 -59
- package/breadcrumb-item/definition.cjs +7 -47
- package/breadcrumb-item/definition.js +3 -40
- package/breadcrumb-item/index.cjs +5 -5
- package/breadcrumb-item/index.js +20 -32
- package/bundled/affix.cjs +10 -10
- package/bundled/affix.js +44 -57
- package/bundled/anchored.cjs +3 -3
- package/bundled/anchored.js +47 -65
- package/bundled/aria.cjs +1 -1
- package/bundled/aria.js +6 -6
- package/bundled/attribute-binding-behaviour.cjs +1 -1
- package/bundled/attribute-binding-behaviour.js +17 -28
- package/bundled/base-color-picker.cjs +10 -10
- package/bundled/base-color-picker.js +115 -197
- package/bundled/base-progress.cjs +1 -1
- package/bundled/base-progress.js +29 -56
- package/bundled/breadcrumb-item.cjs +1 -1
- package/bundled/breadcrumb-item.js +11 -20
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +65 -100
- package/bundled/calendar-event.cjs +1 -1
- package/bundled/calendar-event.js +11 -34
- package/bundled/calendar-picker.template.cjs +77 -77
- package/bundled/calendar-picker.template.js +2883 -3347
- package/bundled/char-count.cjs +7 -7
- package/bundled/char-count.js +31 -46
- package/bundled/children.cjs +1 -1
- package/bundled/children.js +27 -45
- package/bundled/class-names.cjs +1 -1
- package/bundled/class-names.js +8 -8
- package/bundled/data-grid.options.cjs +1 -1
- package/bundled/data-grid.options.js +22 -26
- package/bundled/decorate.cjs +1 -0
- package/bundled/decorate.js +9 -0
- package/bundled/definition.cjs +1 -39
- package/bundled/definition.js +5 -122
- package/bundled/definition10.cjs +18 -72
- package/bundled/definition10.js +74 -355
- package/bundled/definition11.cjs +10 -12
- package/bundled/definition11.js +28 -92
- package/bundled/definition12.cjs +72 -18
- package/bundled/definition12.js +192 -222
- package/bundled/definition13.cjs +20 -10
- package/bundled/definition13.js +55 -41
- package/bundled/definition14.cjs +5 -1
- package/bundled/definition14.js +11 -20
- package/bundled/definition15.cjs +19 -5
- package/bundled/definition15.js +77 -28
- package/bundled/definition16.cjs +12 -29
- package/bundled/definition16.js +80 -78
- package/bundled/definition17.cjs +17 -17
- package/bundled/definition17.js +126 -98
- package/bundled/definition18.cjs +87 -13
- package/bundled/definition18.js +423 -134
- package/bundled/definition19.cjs +5 -87
- package/bundled/definition19.js +16 -742
- package/bundled/definition2.cjs +8 -8
- package/bundled/definition2.js +79 -122
- package/bundled/definition20.cjs +26 -16
- package/bundled/definition20.js +153 -98
- package/bundled/definition21.cjs +29 -5
- package/bundled/definition21.js +174 -18
- package/bundled/definition22.cjs +38 -23
- package/bundled/definition22.js +70 -149
- package/bundled/definition3.cjs +1 -29
- package/bundled/definition3.js +183 -194
- package/bundled/definition4.cjs +24 -6
- package/bundled/definition4.js +88 -40
- package/bundled/definition5.cjs +30 -1
- package/bundled/definition5.js +48 -346
- package/bundled/definition6.cjs +28 -30
- package/bundled/definition6.js +110 -264
- package/bundled/definition7.cjs +6 -30
- package/bundled/definition7.js +22 -288
- package/bundled/definition8.cjs +13 -18
- package/bundled/definition8.js +150 -132
- package/bundled/definition9.cjs +12 -14
- package/bundled/definition9.js +67 -235
- package/bundled/delegates-aria.cjs +1 -1
- package/bundled/delegates-aria.js +56 -88
- package/bundled/dialog.cjs +1 -0
- package/bundled/dialog.js +6 -0
- package/bundled/divider.cjs +1 -1
- package/bundled/divider.js +16 -33
- package/bundled/dom.cjs +1 -1
- package/bundled/dom.js +5 -5
- package/bundled/enums.cjs +1 -1
- package/bundled/enums.js +16 -9
- package/bundled/floating-ui.dom.cjs +1 -1
- package/bundled/floating-ui.dom.js +953 -1238
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +165 -318
- package/bundled/form-element.cjs +1 -1
- package/bundled/form-element.js +33 -55
- package/bundled/host-semantics.cjs +1 -1
- package/bundled/host-semantics.js +46 -69
- package/bundled/key-codes.cjs +1 -1
- package/bundled/key-codes.js +4 -16
- package/bundled/linkable.cjs +6 -6
- package/bundled/linkable.js +25 -45
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +176 -351
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +451 -564
- package/bundled/mixins.cjs +20 -20
- package/bundled/mixins.js +162 -210
- package/bundled/normalize.cjs +1 -1
- package/bundled/normalize.js +6 -6
- package/bundled/numbers.cjs +1 -1
- package/bundled/numbers.js +9 -11
- package/bundled/picker-field.template.cjs +23 -23
- package/bundled/picker-field.template.js +108 -171
- package/bundled/playbackRates.cjs +1 -1
- package/bundled/playbackRates.js +10 -10
- package/bundled/ref.cjs +1 -1
- package/bundled/ref.js +10 -14
- package/bundled/repeat.cjs +1 -1
- package/bundled/repeat.js +421 -552
- package/bundled/scrollIntoView.cjs +1 -1
- package/bundled/scrollIntoView.js +26 -29
- package/bundled/single-date-picker.cjs +1 -1
- package/bundled/single-date-picker.js +23 -38
- package/bundled/single-value-picker.cjs +1 -1
- package/bundled/single-value-picker.js +58 -86
- package/bundled/slider.template.cjs +14 -14
- package/bundled/slider.template.js +67 -78
- package/bundled/slottable-request.cjs +4 -4
- package/bundled/slottable-request.js +1907 -2904
- package/bundled/slotted.cjs +1 -1
- package/bundled/slotted.js +47 -97
- package/bundled/strings.cjs +1 -1
- package/bundled/strings.js +6 -6
- package/bundled/text-field.cjs +1 -1
- package/bundled/text-field.js +4 -4
- package/bundled/time-selection-picker.template.cjs +26 -26
- package/bundled/time-selection-picker.template.js +355 -552
- package/bundled/trapped-focus.cjs +1 -1
- package/bundled/trapped-focus.js +18 -25
- package/bundled/vivid-element.cjs +4 -5
- package/bundled/vivid-element.js +1781 -2806
- package/bundled/when.cjs +1 -1
- package/bundled/when.js +10 -10
- package/bundled/with-contextual-help.cjs +1 -1
- package/bundled/with-contextual-help.js +15 -31
- package/bundled/with-error-text.cjs +1 -1
- package/bundled/with-error-text.js +25 -38
- package/bundled/with-success-text.cjs +1 -1
- package/bundled/with-success-text.js +8 -15
- package/button/definition.cjs +6 -14
- package/button/definition.js +3 -4
- package/button/index.cjs +1 -1
- package/button/index.js +6 -2
- package/calendar/definition.cjs +5 -358
- package/calendar/definition.js +1 -351
- package/calendar/index.cjs +20 -20
- package/calendar/index.js +165 -427
- package/calendar-event/definition.cjs +6 -58
- package/calendar-event/definition.js +2 -51
- package/calendar-event/index.cjs +7 -7
- package/calendar-event/index.js +25 -41
- package/card/definition.cjs +6 -194
- package/card/definition.js +2 -187
- package/card/index.cjs +37 -34
- package/card/index.js +83 -133
- package/checkbox/definition.cjs +6 -209
- package/checkbox/definition.js +2 -202
- package/checkbox/index.cjs +1 -1
- package/checkbox/index.js +6 -2
- package/color-picker/definition.cjs +6 -1175
- package/color-picker/definition.js +2 -1168
- package/color-picker/index.cjs +94 -94
- package/color-picker/index.js +605 -737
- package/combobox/definition.cjs +6 -647
- package/combobox/definition.js +2 -640
- package/combobox/index.cjs +38 -37
- package/combobox/index.js +258 -458
- package/contextual-help/definition.cjs +6 -63
- package/contextual-help/definition.js +2 -56
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +6 -2
- package/country/definition.cjs +6 -340
- package/country/definition.js +2 -333
- package/country/index.cjs +6 -6
- package/country/index.js +1209 -308
- package/custom-elements.json +1247 -1173
- package/data-grid/definition.cjs +10 -2350
- package/data-grid/definition.js +2 -2339
- package/data-grid/index.cjs +65 -65
- package/data-grid/index.js +644 -997
- package/date-picker/definition.cjs +6 -152
- package/date-picker/definition.js +2 -145
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +66 -114
- package/date-range-picker/definition.cjs +6 -467
- package/date-range-picker/definition.js +2 -460
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +218 -334
- package/date-time-picker/definition.cjs +6 -285
- package/date-time-picker/definition.js +2 -278
- package/date-time-picker/index.cjs +4 -4
- package/date-time-picker/index.js +116 -211
- package/dial-pad/definition.cjs +6 -460
- package/dial-pad/definition.js +2 -453
- package/dial-pad/index.cjs +44 -43
- package/dial-pad/index.js +197 -288
- package/dialog/definition.cjs +6 -349
- package/dialog/definition.js +2 -342
- package/dialog/index.cjs +28 -28
- package/dialog/index.js +148 -229
- package/divider/definition.cjs +6 -42
- package/divider/definition.js +2 -35
- package/divider/index.cjs +1 -1
- package/divider/index.js +5 -2
- package/elevation/definition.cjs +4 -11
- package/elevation/definition.js +2 -2
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +5 -2
- package/empty-state/definition.cjs +6 -86
- package/empty-state/definition.js +2 -79
- package/empty-state/index.cjs +9 -9
- package/empty-state/index.js +28 -60
- package/fab/definition.cjs +6 -105
- package/fab/definition.js +2 -98
- package/fab/index.cjs +17 -17
- package/fab/index.js +46 -81
- package/file-picker/definition.cjs +6 -523
- package/file-picker/definition.js +2 -516
- package/file-picker/index.cjs +32 -29
- package/file-picker/index.js +254 -356
- package/header/definition.cjs +5 -78
- package/header/definition.js +1 -71
- package/header/index.cjs +6 -6
- package/header/index.js +28 -42
- package/icon/definition.cjs +5 -202
- package/icon/definition.js +1 -195
- package/icon/index.cjs +1 -1
- package/icon/index.js +5 -2
- package/index.cjs +353 -356
- package/index.js +79 -78
- package/layout/definition.cjs +5 -72
- package/layout/definition.js +1 -65
- package/layout/index.cjs +2 -2
- package/layout/index.js +10 -51
- package/lib/alert/alert.d.ts +0 -1
- package/lib/audio-player/audio-player.d.ts +0 -1
- package/lib/banner/banner.d.ts +0 -2
- package/lib/button/button.d.ts +0 -1
- package/lib/calendar/calendar.d.ts +0 -1
- package/lib/combobox/combobox.d.ts +0 -3
- package/lib/data-grid/data-grid-cell.d.ts +0 -3
- package/lib/data-grid/data-grid-row.d.ts +0 -3
- package/lib/data-grid/data-grid.d.ts +0 -1
- package/lib/date-time-picker/date-time-picker.d.ts +0 -4
- package/lib/dial-pad/dial-pad.d.ts +6 -2
- package/lib/dialog/dialog.d.ts +0 -1
- package/lib/fab/fab.d.ts +0 -1
- package/lib/file-picker/file-picker.d.ts +1 -1
- package/lib/icon/icon.d.ts +0 -1
- package/lib/menu/menu.d.ts +0 -1
- package/lib/option/option.d.ts +4 -1
- package/lib/pagination/pagination.d.ts +0 -4
- package/lib/popover/popover.d.ts +0 -5
- package/lib/rich-text-editor/rte/exports.d.ts +1 -0
- package/lib/rich-text-editor/rte/features/alignment.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/character-count.d.ts +21 -0
- package/lib/rich-text-editor/rte/features/font-size-picker.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/internal/basic-text-blocks.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/keyboard-shortcuts.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/text-color-picker.d.ts +1 -1
- package/lib/rich-text-editor/rte/public-interface.d.ts +6 -0
- package/lib/searchable-select/option-tag.d.ts +0 -1
- package/lib/split-button/split-button.d.ts +0 -2
- package/lib/tab/tab.d.ts +0 -2
- package/lib/table/definition.d.ts +2 -1
- package/lib/table/table-header-cell.d.ts +3 -0
- package/lib/table/table-sorting-button.d.ts +415 -0
- package/lib/table/table-sorting-button.template.d.ts +3 -0
- package/lib/tag/tag.d.ts +0 -2
- package/lib/toggletip/toggletip.d.ts +0 -1
- package/lib/tree-item/tree-item.d.ts +0 -2
- package/lib/tree-view/tree-view.d.ts +0 -1
- package/locales/de-DE.cjs +266 -550
- package/locales/de-DE.js +264 -548
- package/locales/en-GB.cjs +266 -382
- package/locales/en-GB.js +264 -380
- package/locales/en-US.cjs +266 -550
- package/locales/en-US.js +264 -548
- package/locales/ja-JP.cjs +266 -549
- package/locales/ja-JP.js +264 -547
- package/locales/zh-CN.cjs +266 -551
- package/locales/zh-CN.js +264 -549
- package/menu/definition.cjs +6 -393
- package/menu/definition.js +2 -386
- package/menu/index.cjs +1 -1
- package/menu/index.js +6 -2
- package/menu-item/definition.cjs +7 -14
- package/menu-item/definition.js +3 -3
- package/menu-item/index.cjs +1 -1
- package/menu-item/index.js +6 -2
- package/nav/definition.cjs +5 -27
- package/nav/definition.js +1 -20
- package/nav/index.cjs +3 -3
- package/nav/index.js +7 -10
- package/nav-disclosure/definition.cjs +6 -122
- package/nav-disclosure/definition.js +2 -115
- package/nav-disclosure/index.cjs +8 -8
- package/nav-disclosure/index.js +49 -86
- package/nav-item/definition.cjs +6 -79
- package/nav-item/definition.js +2 -72
- package/nav-item/index.cjs +2 -2
- package/nav-item/index.js +33 -58
- package/note/definition.cjs +6 -61
- package/note/definition.js +2 -54
- package/note/index.cjs +5 -5
- package/note/index.js +24 -38
- package/number-field/definition.cjs +6 -440
- package/number-field/definition.js +2 -433
- package/number-field/index.cjs +31 -31
- package/number-field/index.js +160 -328
- package/option/definition.cjs +6 -13
- package/option/definition.js +3 -3
- package/option/index.cjs +1 -1
- package/option/index.js +6 -2
- package/package.json +15 -17
- package/pagination/definition.cjs +6 -254
- package/pagination/definition.js +2 -247
- package/pagination/index.cjs +37 -37
- package/pagination/index.js +148 -186
- package/popover/definition.cjs +6 -356
- package/popover/definition.js +2 -349
- package/popover/index.cjs +16 -16
- package/popover/index.js +161 -239
- package/popup/definition.cjs +5 -13
- package/popup/definition.js +3 -4
- package/popup/index.cjs +1 -1
- package/popup/index.js +6 -2
- package/progress/definition.cjs +5 -87
- package/progress/definition.js +1 -80
- package/progress/index.cjs +9 -9
- package/progress/index.js +33 -55
- package/progress-ring/definition.cjs +5 -95
- package/progress-ring/definition.js +1 -88
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +5 -2
- package/radio/definition.cjs +5 -227
- package/radio/definition.js +1 -220
- package/radio/index.cjs +1 -1
- package/radio/index.js +5 -2
- package/radio-group/definition.cjs +6 -361
- package/radio-group/definition.js +2 -354
- package/radio-group/index.cjs +10 -10
- package/radio-group/index.js +160 -242
- package/range-slider/definition.cjs +6 -632
- package/range-slider/definition.js +2 -625
- package/range-slider/index.cjs +41 -41
- package/range-slider/index.js +259 -429
- package/rich-text-editor/definition.cjs +33 -15694
- package/rich-text-editor/definition.js +3 -15662
- package/rich-text-editor/index.cjs +18 -18
- package/rich-text-editor/index.js +9129 -11475
- package/rich-text-view/definition.cjs +5 -171
- package/rich-text-view/definition.js +1 -164
- package/rich-text-view/index.cjs +1 -1
- package/rich-text-view/index.js +68 -102
- package/searchable-select/definition.cjs +5 -1401
- package/searchable-select/definition.js +2 -1395
- package/searchable-select/index.cjs +94 -94
- package/searchable-select/index.js +600 -1015
- package/select/definition.cjs +6 -1002
- package/select/definition.js +2 -995
- package/select/index.cjs +1 -1
- package/select/index.js +6 -2
- package/selectable-box/definition.cjs +6 -174
- package/selectable-box/definition.js +2 -167
- package/selectable-box/index.cjs +18 -18
- package/selectable-box/index.js +66 -127
- package/shared/foundation/test-utilities/fixture.d.ts +1 -1
- package/shared/patterns/linkable.d.ts +1 -1
- package/side-drawer/definition.cjs +5 -130
- package/side-drawer/definition.js +1 -123
- package/side-drawer/index.cjs +7 -7
- package/side-drawer/index.js +47 -89
- package/simple-color-picker/definition.cjs +6 -225
- package/simple-color-picker/definition.js +2 -218
- package/simple-color-picker/index.cjs +15 -15
- package/simple-color-picker/index.js +98 -135
- package/slider/definition.cjs +6 -499
- package/slider/definition.js +2 -492
- package/slider/index.cjs +1 -1
- package/slider/index.js +6 -2
- package/split-button/definition.cjs +6 -176
- package/split-button/definition.js +2 -169
- package/split-button/index.cjs +15 -15
- package/split-button/index.js +74 -135
- package/status/definition.cjs +6 -82
- package/status/definition.js +2 -75
- package/status/index.cjs +7 -7
- package/status/index.js +35 -52
- package/switch/definition.cjs +6 -148
- package/switch/definition.js +2 -141
- package/switch/index.cjs +8 -8
- package/switch/index.js +48 -92
- package/tab/definition.cjs +6 -127
- package/tab/definition.js +2 -120
- package/tab/index.cjs +1 -1
- package/tab/index.js +6 -2
- package/tab-panel/definition.cjs +5 -29
- package/tab-panel/definition.js +1 -22
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +5 -2
- package/table/definition.cjs +18 -174
- package/table/definition.js +3 -158
- package/table/index.cjs +19 -10
- package/table/index.js +74 -82
- package/tabs/definition.cjs +7 -467
- package/tabs/definition.js +2 -459
- package/tabs/index.cjs +11 -11
- package/tabs/index.js +169 -296
- package/tag/definition.cjs +6 -176
- package/tag/definition.js +2 -169
- package/tag/index.cjs +26 -26
- package/tag/index.js +64 -125
- package/tag-group/definition.cjs +5 -40
- package/tag-group/definition.js +1 -33
- package/tag-group/index.cjs +4 -4
- package/tag-group/index.js +10 -21
- package/text-area/definition.cjs +6 -355
- package/text-area/definition.js +2 -348
- package/text-area/index.cjs +11 -11
- package/text-area/index.js +153 -260
- package/text-field/definition.cjs +6 -423
- package/text-field/definition.js +2 -416
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +6 -2
- package/time-picker/definition.cjs +7 -43
- package/time-picker/definition.js +3 -36
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +24 -29
- package/toggletip/definition.cjs +6 -159
- package/toggletip/definition.js +2 -152
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +6 -2
- package/tooltip/definition.cjs +6 -139
- package/tooltip/definition.js +2 -132
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +6 -2
- package/tree-item/definition.cjs +6 -13
- package/tree-item/definition.js +3 -3
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +6 -2
- package/tree-view/definition.cjs +6 -302
- package/tree-view/definition.js +2 -295
- package/tree-view/index.cjs +11 -11
- package/tree-view/index.js +145 -174
- package/unbundled/affix.cjs +89 -62
- package/unbundled/affix.js +58 -55
- package/unbundled/anchored.cjs +87 -94
- package/unbundled/anchored.js +74 -90
- package/unbundled/attribute-binding-behaviour.cjs +37 -42
- package/unbundled/attribute-binding-behaviour.js +31 -40
- package/unbundled/base-color-picker.cjs +226 -275
- package/unbundled/base-color-picker.js +214 -272
- package/unbundled/base-progress.cjs +63 -78
- package/unbundled/base-progress.js +57 -76
- package/unbundled/breadcrumb-item.cjs +24 -28
- package/unbundled/breadcrumb-item.js +18 -26
- package/unbundled/button.cjs +115 -166
- package/unbundled/button.js +109 -164
- package/unbundled/calendar-event.cjs +28 -41
- package/unbundled/calendar-event.js +22 -39
- package/unbundled/calendar-picker.template.cjs +4967 -792
- package/unbundled/calendar-picker.template.js +4907 -781
- package/unbundled/char-count.cjs +50 -80
- package/unbundled/char-count.js +44 -78
- package/unbundled/chunk.cjs +28 -0
- package/unbundled/data-grid.options.cjs +80 -29
- package/unbundled/data-grid.options.js +51 -23
- package/unbundled/decorate.cjs +14 -0
- package/unbundled/decorate.js +9 -0
- package/unbundled/definition.cjs +42 -405
- package/unbundled/definition.js +24 -399
- package/unbundled/definition10.cjs +253 -0
- package/unbundled/definition10.js +229 -0
- package/unbundled/definition11.cjs +397 -0
- package/unbundled/definition11.js +379 -0
- package/unbundled/definition12.cjs +317 -0
- package/unbundled/definition12.js +287 -0
- package/unbundled/definition13.cjs +321 -0
- package/unbundled/definition13.js +303 -0
- package/unbundled/definition14.cjs +406 -0
- package/unbundled/definition14.js +388 -0
- package/unbundled/definition15.cjs +107 -0
- package/unbundled/definition15.js +89 -0
- package/unbundled/definition16.cjs +63 -0
- package/unbundled/definition16.js +45 -0
- package/unbundled/definition17.cjs +151 -0
- package/unbundled/definition17.js +133 -0
- package/unbundled/definition18.cjs +47 -0
- package/unbundled/definition18.js +35 -0
- package/unbundled/definition19.cjs +98 -0
- package/unbundled/definition19.js +80 -0
- package/unbundled/definition2.cjs +180 -220
- package/unbundled/definition2.js +162 -215
- package/unbundled/definition20.cjs +56 -0
- package/unbundled/definition20.js +43 -0
- package/unbundled/definition21.cjs +304 -0
- package/unbundled/definition21.js +285 -0
- package/unbundled/definition22.cjs +179 -0
- package/unbundled/definition22.js +161 -0
- package/unbundled/definition23.cjs +161 -0
- package/unbundled/definition23.js +143 -0
- package/unbundled/definition24.cjs +157 -0
- package/unbundled/definition24.js +139 -0
- package/unbundled/definition25.cjs +75 -0
- package/unbundled/definition25.js +57 -0
- package/unbundled/definition26.cjs +363 -0
- package/unbundled/definition26.js +345 -0
- package/unbundled/definition27.cjs +137 -0
- package/unbundled/definition27.js +119 -0
- package/unbundled/definition28.cjs +538 -0
- package/unbundled/definition28.js +520 -0
- package/unbundled/definition29.cjs +236 -0
- package/unbundled/definition29.js +212 -0
- package/unbundled/definition3.cjs +131 -284
- package/unbundled/definition3.js +113 -279
- package/unbundled/definition30.cjs +559 -0
- package/unbundled/definition30.js +541 -0
- package/unbundled/definition31.cjs +1265 -0
- package/unbundled/definition31.js +1247 -0
- package/unbundled/definition32.cjs +1908 -0
- package/unbundled/definition32.js +1866 -0
- package/unbundled/definition33.cjs +346 -0
- package/unbundled/definition33.js +256 -0
- package/unbundled/definition34.cjs +46 -0
- package/unbundled/definition34.js +33 -0
- package/unbundled/definition35.cjs +152 -0
- package/unbundled/definition35.js +134 -0
- package/unbundled/definition36.cjs +426 -0
- package/unbundled/definition36.js +408 -0
- package/unbundled/definition37.cjs +247 -0
- package/unbundled/definition37.js +229 -0
- package/unbundled/definition38.cjs +411 -0
- package/unbundled/definition38.js +393 -0
- package/unbundled/definition39.cjs +299 -0
- package/unbundled/definition39.js +281 -0
- package/unbundled/definition4.cjs +186 -205
- package/unbundled/definition4.js +162 -200
- package/unbundled/definition40.cjs +81 -0
- package/unbundled/definition40.js +63 -0
- package/unbundled/definition41.cjs +100 -0
- package/unbundled/definition41.js +82 -0
- package/unbundled/definition42.cjs +468 -0
- package/unbundled/definition42.js +450 -0
- package/unbundled/definition43.cjs +86 -0
- package/unbundled/definition43.js +68 -0
- package/unbundled/definition44.cjs +60 -0
- package/unbundled/definition44.js +41 -0
- package/unbundled/definition45.cjs +124 -0
- package/unbundled/definition45.js +106 -0
- package/unbundled/definition46.cjs +85 -0
- package/unbundled/definition46.js +67 -0
- package/unbundled/definition47.cjs +52 -0
- package/unbundled/definition47.js +31 -0
- package/unbundled/definition48.cjs +69 -0
- package/unbundled/definition48.js +51 -0
- package/unbundled/definition49.cjs +377 -0
- package/unbundled/definition49.js +359 -0
- package/unbundled/definition5.cjs +69 -298
- package/unbundled/definition5.js +44 -293
- package/unbundled/definition50.cjs +246 -0
- package/unbundled/definition50.js +228 -0
- package/unbundled/definition51.cjs +337 -0
- package/unbundled/definition51.js +319 -0
- package/unbundled/definition52.cjs +86 -0
- package/unbundled/definition52.js +67 -0
- package/unbundled/definition53.cjs +193 -0
- package/unbundled/definition53.js +174 -0
- package/unbundled/definition54.cjs +297 -0
- package/unbundled/definition54.js +279 -0
- package/unbundled/definition55.cjs +510 -0
- package/unbundled/definition55.js +492 -0
- package/unbundled/definition56.cjs +3659 -0
- package/unbundled/definition56.js +3478 -0
- package/unbundled/definition57.cjs +837 -0
- package/unbundled/definition57.js +819 -0
- package/unbundled/definition58.cjs +147 -0
- package/unbundled/definition58.js +129 -0
- package/unbundled/definition59.cjs +1081 -0
- package/unbundled/definition59.js +1063 -0
- package/unbundled/definition6.cjs +88 -56
- package/unbundled/definition6.js +69 -52
- package/unbundled/definition60.cjs +149 -0
- package/unbundled/definition60.js +131 -0
- package/unbundled/definition61.cjs +116 -0
- package/unbundled/definition61.js +97 -0
- package/unbundled/definition62.cjs +213 -0
- package/unbundled/definition62.js +195 -0
- package/unbundled/definition63.cjs +159 -0
- package/unbundled/definition63.js +141 -0
- package/unbundled/definition64.cjs +86 -0
- package/unbundled/definition64.js +68 -0
- package/unbundled/definition65.cjs +126 -0
- package/unbundled/definition65.js +107 -0
- package/unbundled/definition66.cjs +49 -0
- package/unbundled/definition66.js +28 -0
- package/unbundled/definition67.cjs +119 -0
- package/unbundled/definition67.js +101 -0
- package/unbundled/definition68.cjs +374 -0
- package/unbundled/definition68.js +349 -0
- package/unbundled/definition69.cjs +57 -0
- package/unbundled/definition69.js +38 -0
- package/unbundled/definition7.cjs +190 -0
- package/unbundled/definition7.js +166 -0
- package/unbundled/definition70.cjs +155 -0
- package/unbundled/definition70.js +137 -0
- package/unbundled/definition71.cjs +302 -0
- package/unbundled/definition71.js +284 -0
- package/unbundled/definition72.cjs +48 -0
- package/unbundled/definition72.js +37 -0
- package/unbundled/definition73.cjs +171 -0
- package/unbundled/definition73.js +147 -0
- package/unbundled/definition74.cjs +232 -0
- package/unbundled/definition74.js +213 -0
- package/unbundled/definition75.cjs +533 -0
- package/unbundled/definition75.js +513 -0
- package/unbundled/definition8.cjs +63 -0
- package/unbundled/definition8.js +44 -0
- package/unbundled/definition9.cjs +183 -0
- package/unbundled/definition9.js +165 -0
- package/unbundled/delegates-aria.cjs +90 -131
- package/unbundled/delegates-aria.js +77 -127
- package/unbundled/dialog.cjs +15 -0
- package/unbundled/dialog.js +10 -0
- package/unbundled/divider.cjs +42 -50
- package/unbundled/divider.js +30 -47
- package/unbundled/enums.cjs +166 -107
- package/unbundled/enums.js +95 -94
- package/unbundled/form-associated.cjs +408 -463
- package/unbundled/form-associated.js +396 -460
- package/unbundled/form-element.cjs +74 -83
- package/unbundled/form-element.js +68 -81
- package/unbundled/host-semantics.cjs +70 -89
- package/unbundled/host-semantics.js +57 -85
- package/unbundled/key-codes.cjs +16 -10
- package/unbundled/key-codes.js +5 -7
- package/unbundled/linkable.cjs +35 -56
- package/unbundled/linkable.js +27 -52
- package/unbundled/listbox.cjs +363 -465
- package/unbundled/listbox.js +357 -463
- package/unbundled/localized.cjs +79 -74
- package/unbundled/localized.js +61 -70
- package/unbundled/mixins.cjs +222 -223
- package/unbundled/mixins.js +186 -211
- package/unbundled/picker-field.template.cjs +188 -217
- package/unbundled/picker-field.template.js +165 -208
- package/unbundled/playbackRates.cjs +18 -11
- package/unbundled/playbackRates.js +13 -9
- package/unbundled/scrollIntoView.cjs +38 -43
- package/unbundled/scrollIntoView.js +33 -41
- package/unbundled/single-date-picker.cjs +48 -45
- package/unbundled/single-date-picker.js +43 -43
- package/unbundled/single-value-picker.cjs +106 -114
- package/unbundled/single-value-picker.js +101 -112
- package/unbundled/slider.template.cjs +107 -73
- package/unbundled/slider.template.js +67 -62
- package/unbundled/slottable-request.cjs +145 -3700
- package/unbundled/slottable-request.js +98 -3681
- package/unbundled/text-field.cjs +9 -5
- package/unbundled/text-field.js +4 -3
- package/unbundled/time-selection-picker.template.cjs +611 -755
- package/unbundled/time-selection-picker.template.js +554 -742
- package/unbundled/trapped-focus.cjs +45 -35
- package/unbundled/trapped-focus.js +34 -32
- package/unbundled/vivid-element.cjs +281 -274
- package/unbundled/vivid-element.js +239 -266
- package/unbundled/with-contextual-help.cjs +35 -39
- package/unbundled/with-contextual-help.js +29 -37
- package/unbundled/with-error-text.cjs +45 -55
- package/unbundled/with-error-text.js +39 -53
- package/unbundled/with-success-text.cjs +18 -22
- package/unbundled/with-success-text.js +12 -20
- package/video-player/definition.cjs +5 -69835
- package/video-player/definition.js +1 -69828
- package/video-player/index.cjs +44 -39
- package/video-player/index.js +23517 -35507
- package/visually-hidden/definition.cjs +5 -30
- package/visually-hidden/definition.js +1 -23
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +5 -2
- package/vivid.api.json +331 -1874
- package/bundled/index.cjs +0 -1
- package/bundled/index.js +0 -6
- package/unbundled/_commonjsHelpers.cjs +0 -40
- package/unbundled/_commonjsHelpers.js +0 -36
- package/unbundled/index.cjs +0 -11
- package/unbundled/index.js +0 -9
package/data-grid/index.js
CHANGED
|
@@ -1,1060 +1,707 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { c as
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { t as e } from "../bundled/localized.js";
|
|
2
|
+
import { O as t, T as n, c as r, d as i, l as a, o, s as ee, t as s, u as te, w as c } from "../bundled/vivid-element.js";
|
|
3
|
+
import { t as l } from "../bundled/repeat.js";
|
|
4
|
+
import { t as u } from "../bundled/normalize.js";
|
|
5
|
+
import { t as d } from "../bundled/when.js";
|
|
6
|
+
import { r as f, t as p } from "../bundled/slotted.js";
|
|
7
|
+
import { t as m } from "../bundled/children.js";
|
|
8
|
+
import { n as h, r as g } from "../bundled/definition.js";
|
|
9
|
+
import { r as _, t as v } from "../bundled/definition2.js";
|
|
10
|
+
import { t as y } from "../bundled/decorate.js";
|
|
11
|
+
import { t as b } from "../bundled/class-names.js";
|
|
12
|
+
import { a as ne, c as x, i as S, l as C, n as w, o as T, r as E, s as D, t as O } from "../bundled/key-codes.js";
|
|
13
|
+
import { n as k, t as A } from "../bundled/host-semantics.js";
|
|
14
|
+
import { a as j, i as M, n as N, r as P, t as F } from "../bundled/data-grid.options.js";
|
|
15
|
+
//#region ../../node_modules/.pnpm/@microsoft+fast-web-utilities@6.0.0/node_modules/@microsoft/fast-web-utilities/dist/events.js
|
|
16
|
+
var I = "focus", L = "focusin", R = "focusout", z = "keydown", B = ":host{display:block}:host([generate-header=sticky]){max-block-size:400px}.base{--scrollbar-track-color:transparent;--scrollbar-thumb-color:color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%);scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.base ::-webkit-scrollbar{width:4px}.base ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.base ::-webkit-scrollbar-thumb{background-color:var(--scrollbar-fallback-track-color,var(--scrollbar-thumb-color));border:0;border-radius:4px}.base{block-size:inherit;inline-size:100%;max-block-size:inherit;position:relative;overflow:auto}", V = ".base.connotation-cta{--_connotation-color-primary:var(--vvd-data-grid-row-cta-primary,var(--vvd-color-cta-500));--_connotation-color-primary-text:var(--vvd-data-grid-row-cta-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-data-grid-row-cta-primary-increment,var(--vvd-color-cta-600));--_connotation-color-firm:var(--vvd-data-grid-row-cta-firm,var(--vvd-color-cta-600));--_connotation-color-faint:var(--vvd-data-grid-row-cta-faint,var(--vvd-color-cta-50));--_connotation-color-soft:var(--vvd-data-grid-row-cta-soft,var(--vvd-color-cta-100));--_connotation-color-pale:var(--vvd-data-grid-row-cta-pale,var(--vvd-color-cta-300));--_connotation-color-dim:var(--vvd-data-grid-row-cta-dim,var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary:var(--vvd-data-grid-row-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-primary-text:var(--vvd-data-grid-row-accent-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-data-grid-row-accent-primary-increment,var(--vvd-color-neutral-800));--_connotation-color-firm:var(--vvd-data-grid-row-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-faint:var(--vvd-data-grid-row-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-data-grid-row-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-pale:var(--vvd-data-grid-row-accent-pale,var(--vvd-color-neutral-300));--_connotation-color-dim:var(--vvd-data-grid-row-accent-dim,var(--vvd-color-neutral-200))}.base{--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}@media (hover:hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}.base{box-sizing:border-box;width:100%;color:var(--vvd-color-canvas-text);display:grid}:host([row-type=sticky-header]) .base{z-index:9;background:var(--data-grid-row-background,var(--vvd-color-canvas));position:sticky;top:0}:host([row-type=hidden-header]) .base{display:none}:host([selected]:not([row-type*=header])) .base{background-color:var(--_appearance-color-fill)}", H = ":host{block-size:100%;min-inline-size:80px}:host(:focus-visible){outline:none}:host([data-fixed]){z-index:5;background:var(--data-grid-cell-background,var(--vvd-color-surface-2dp));position:sticky}:host([data-fixed]):before{z-index:1;width:1px;content:\"\";pointer-events:none;block-size:100%;position:absolute;top:0;right:0;box-shadow:4px 0 4px #0000001a,2px 0 2px #0000000d,1px 0 1px #0000000d}.base.connotation-cta{--_connotation-color-primary:var(--vvd-data-grid-cell-cta-primary,var(--vvd-color-cta-500));--_connotation-color-primary-text:var(--vvd-data-grid-cell-cta-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-data-grid-cell-cta-primary-increment,var(--vvd-color-cta-600));--_connotation-color-firm:var(--vvd-data-grid-cell-cta-firm,var(--vvd-color-cta-600));--_connotation-color-soft:var(--vvd-data-grid-cell-cta-soft,var(--vvd-color-cta-100));--_connotation-color-faint:var(--vvd-data-grid-cell-cta-faint,var(--vvd-color-cta-50));--_connotation-color-pale:var(--vvd-data-grid-cell-cta-pale,var(--vvd-color-cta-300));--_connotation-color-dim:var(--vvd-data-grid-cell-cta-dim,var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary:var(--vvd-data-grid-cell-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-primary-text:var(--vvd-data-grid-cell-accent-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-data-grid-cell-accent-primary-increment,var(--vvd-color-neutral-800));--_connotation-color-firm:var(--vvd-data-grid-cell-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-soft:var(--vvd-data-grid-cell-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-faint:var(--vvd-data-grid-cell-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-pale:var(--vvd-data-grid-cell-accent-pale,var(--vvd-color-neutral-300));--_connotation-color-dim:var(--vvd-data-grid-cell-accent-dim,var(--vvd-color-neutral-200))}.base{--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}@media (hover:hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}.base{box-sizing:border-box;border-bottom:1px solid var(--vvd-color-neutral-300);block-size:var(--data-grid-cell-block-size,var(--_data-grid-cell-default-block-size));color:var(--_appearance-color-text);font:var(--vvd-typography-base);min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) + 8));align-items:center;padding-block:13px 14px;padding-inline:12px;display:flex}:host(:focus-visible) .base{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}:host([cell-type=columnheader]) .base{border-color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold);--_data-grid-cell-default-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) + 8));--_data-grid-cell-default-white-space:nowrap}:host(:not([cell-type=columnheader])) .base{--_data-grid-cell-default-block-size:100%;--_data-grid-cell-default-white-space:normal}:host([selected]:not([cell-type=columnheader])) .base{background-color:var(--_appearance-color-fill)}.content{align-items:center;display:flex;overflow:hidden}.content[role=button]{cursor:pointer}slot:not([name]){text-overflow:ellipsis;white-space:var(--data-grid-cell-white-space,var(--_data-grid-cell-default-white-space));display:block;overflow:hidden}:host(:not([cell-type=columnheader][aria-sort])) slot:not([name]){inline-size:100%}.header-icon{flex-shrink:0;margin-inline-start:16px}slot[name=action-items]{flex-shrink:0;align-items:center;display:flex}.base.has-action-items slot[name=action-items]{margin-inline-start:16px}", U = {
|
|
17
|
+
none: "none",
|
|
18
|
+
singleRow: "single-row",
|
|
19
|
+
multiRow: "multi-row",
|
|
20
|
+
singleCell: "single-cell",
|
|
21
|
+
multiCell: "multi-cell"
|
|
22
|
+
}, W = class e extends s {
|
|
23
|
+
static generateTemplateColumns(e) {
|
|
24
|
+
let t = "";
|
|
25
|
+
return e.forEach((e) => {
|
|
26
|
+
t = `${t}${t === "" ? "" : " "}1fr`;
|
|
27
|
+
}), t;
|
|
28
|
+
}
|
|
29
|
+
noTabbingChanged() {
|
|
30
|
+
this.$fastController.isConnected && this.#e();
|
|
31
|
+
}
|
|
32
|
+
#e() {
|
|
33
|
+
this.setAttribute("tabIndex", this.noTabbing || this.contains(document.activeElement) ? "-1" : "0");
|
|
34
|
+
}
|
|
35
|
+
generateHeaderChanged() {
|
|
36
|
+
this.$fastController.isConnected && this.toggleGeneratedHeader();
|
|
37
|
+
}
|
|
38
|
+
gridTemplateColumnsChanged() {
|
|
39
|
+
/* v8 ignore if -- @preserve */
|
|
40
|
+
this.$fastController.isConnected && (this.updateRowIndexes(), this.fixedColumns && this.fixedColumns > 0 && this.applyFixedColumns());
|
|
41
|
+
}
|
|
42
|
+
rowsDataChanged() {
|
|
43
|
+
this.columnDefinitions === null && this.rowsData.length > 0 && (this.columnDefinitions = e.generateColumns(this.rowsData[0])), this.$fastController.isConnected && this.toggleGeneratedHeader();
|
|
44
|
+
}
|
|
45
|
+
columnDefinitionsChanged() {
|
|
46
|
+
if (this.columnDefinitions === null) {
|
|
47
|
+
this.generatedGridTemplateColumns = "";
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
/* v8 ignore if -- @preserve */
|
|
51
|
+
this.generatedGridTemplateColumns = e.generateTemplateColumns(this.columnDefinitions), this.$fastController.isConnected && (this.columnDefinitionsStale = !0, this.queueRowIndexUpdate());
|
|
52
|
+
}
|
|
53
|
+
headerCellItemTemplateChanged() {
|
|
54
|
+
/* v8 ignore if -- @preserve */
|
|
55
|
+
this.$fastController.isConnected && this.generatedHeader !== null && (this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate);
|
|
56
|
+
}
|
|
57
|
+
focusRowIndexChanged() {
|
|
58
|
+
this.$fastController.isConnected && this.queueFocusUpdate();
|
|
59
|
+
}
|
|
60
|
+
focusColumnIndexChanged() {
|
|
61
|
+
this.$fastController.isConnected && this.queueFocusUpdate();
|
|
62
|
+
}
|
|
63
|
+
fixedColumnsChanged() {
|
|
64
|
+
/* v8 ignore if -- @preserve */
|
|
65
|
+
this.$fastController.isConnected && (this.applyFixedColumns(), this.setupResizeObserver());
|
|
66
|
+
}
|
|
67
|
+
setupResizeObserver() {
|
|
68
|
+
this.resizeObserver &&= (this.resizeObserver.disconnect(), void 0), typeof ResizeObserver < "u" && this.fixedColumns && this.fixedColumns > 0 && (this.resizeObserver = new ResizeObserver(() => {
|
|
69
|
+
this.applyFixedColumns();
|
|
70
|
+
}), this.resizeObserver.observe(this));
|
|
71
|
+
}
|
|
72
|
+
connectedCallback() {
|
|
73
|
+
super.connectedCallback(), this.rowItemTemplate === void 0 && (this.rowItemTemplate = this.defaultRowItemTemplate), this.behaviorOrchestrator === null && (this.behaviorOrchestrator = r.create(this), this.$fastController.addBehavior(this.behaviorOrchestrator), this.behaviorOrchestrator.addBehaviorFactory(new l(u((e) => e.rowsData), u((e) => e.rowItemTemplate), { positioning: !0 }), this.appendChild(document.createComment("")))), this.toggleGeneratedHeader(), this.addEventListener("row-focused", this.handleRowFocus), this.addEventListener(I, this.handleFocus), this.addEventListener(z, this.handleKeydown), this.addEventListener(R, this.handleFocusOut), this.observer = new MutationObserver(this.onChildListChange), this.observer.observe(this, { childList: !0 }), this.setupResizeObserver(), t.enqueue(this.queueRowIndexUpdate), this.#e(), c.getNotifier(this).subscribe(this.#s, "columnDefinitions");
|
|
74
|
+
}
|
|
75
|
+
disconnectedCallback() {
|
|
76
|
+
super.disconnectedCallback(), this.removeEventListener("row-focused", this.handleRowFocus), this.removeEventListener(I, this.handleFocus), this.removeEventListener(z, this.handleKeydown), this.removeEventListener(R, this.handleFocusOut), this.observer.disconnect(), this.resizeObserver &&= (this.resizeObserver.disconnect(), void 0), this.generatedHeader = null, c.getNotifier(this).unsubscribe(this.#s, "columnDefinitions");
|
|
77
|
+
}
|
|
78
|
+
handleRowFocus(e) {
|
|
79
|
+
this.isUpdatingFocus = !0;
|
|
80
|
+
let t = e.target;
|
|
81
|
+
this.focusRowIndex = this.rowElements.indexOf(t), this.focusColumnIndex = t.focusColumnIndex, this.setAttribute("tabIndex", "-1"), this.isUpdatingFocus = !1;
|
|
82
|
+
}
|
|
83
|
+
handleFocus(e) {
|
|
84
|
+
this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, !0);
|
|
85
|
+
}
|
|
86
|
+
handleFocusOut(e) {
|
|
87
|
+
(e.relatedTarget === null || !this.contains(e.relatedTarget)) && this.setAttribute("tabIndex", this.noTabbing ? "-1" : "0");
|
|
88
|
+
}
|
|
89
|
+
handleKeydown(e) {
|
|
90
|
+
if (e.defaultPrevented) return;
|
|
91
|
+
let t, n = this.rowElements.length - 1, r = this.offsetHeight + this.scrollTop, i = this.rowElements[n];
|
|
92
|
+
switch (e.key) {
|
|
93
|
+
case S:
|
|
94
|
+
e.preventDefault(), this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, !0);
|
|
95
|
+
break;
|
|
96
|
+
case O:
|
|
97
|
+
e.preventDefault(), this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, !0);
|
|
98
|
+
break;
|
|
99
|
+
case C:
|
|
100
|
+
if (e.preventDefault(), this.rowElements.length === 0) {
|
|
101
|
+
this.focusOnCell(0, 0, !1);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (this.focusRowIndex === 0) {
|
|
105
|
+
this.focusOnCell(0, this.focusColumnIndex, !1);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
for (t = this.focusRowIndex - 1; t >= 0; t--) {
|
|
109
|
+
let e = this.rowElements[t];
|
|
110
|
+
if (e.offsetTop < this.scrollTop) {
|
|
111
|
+
this.scrollTop = e.offsetTop + e.clientHeight - this.clientHeight;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
this.focusOnCell(t, this.focusColumnIndex, !1);
|
|
116
|
+
break;
|
|
117
|
+
case x:
|
|
118
|
+
if (e.preventDefault(), this.rowElements.length === 0) {
|
|
119
|
+
this.focusOnCell(0, 0, !1);
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
if (this.focusRowIndex >= n || i.offsetTop + i.offsetHeight <= r) {
|
|
123
|
+
this.focusOnCell(n, this.focusColumnIndex, !1);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
for (t = this.focusRowIndex + 1; t <= n; t++) {
|
|
127
|
+
let e = this.rowElements[t];
|
|
128
|
+
if (e.offsetTop + e.offsetHeight > r) {
|
|
129
|
+
let t = 0;
|
|
130
|
+
this.generateHeader === j.sticky && this.generatedHeader !== null && (t = this.generatedHeader.clientHeight), this.scrollTop = e.offsetTop - t;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
this.focusOnCell(t, this.focusColumnIndex, !1);
|
|
135
|
+
break;
|
|
136
|
+
case D:
|
|
137
|
+
/* v8 ignore else -- @preserve */
|
|
138
|
+
e.ctrlKey && (e.preventDefault(), this.focusOnCell(0, 0, !0));
|
|
139
|
+
break;
|
|
140
|
+
case "End":
|
|
141
|
+
/* v8 ignore else -- @preserve */
|
|
142
|
+
e.ctrlKey && this.columnDefinitions !== null && (e.preventDefault(), this.focusOnCell(this.rowElements.length - 1, this.columnDefinitions.length - 1, !0));
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
queueFocusUpdate() {
|
|
147
|
+
this.isUpdatingFocus && this.contains(document.activeElement) || this.pendingFocusUpdate === !1 && (this.pendingFocusUpdate = !0, t.enqueue(() => this.updateFocus()));
|
|
148
|
+
}
|
|
149
|
+
updateFocus() {
|
|
150
|
+
this.pendingFocusUpdate = !1, this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, !0);
|
|
151
|
+
}
|
|
152
|
+
toggleGeneratedHeader() {
|
|
153
|
+
if (this.generatedHeader !== null && (this.removeChild(this.generatedHeader), this.generatedHeader = null), this.generateHeader !== j.none && this.columnDefinitions !== null) {
|
|
154
|
+
let e = document.createElement(this.rowElementTag);
|
|
155
|
+
/* v8 ignore else -- @preserve */
|
|
156
|
+
this.generatedHeader = e, this.generatedHeader.columnDefinitions = this.columnDefinitions, this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns, this.generatedHeader.rowType = this.generateHeader === j.sticky ? M.stickyHeader : M.header, this.firstChild !== null && this.insertBefore(e, this.firstChild);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
slottedRowElementsChanged(e, t) {
|
|
161
|
+
this._resetSelection();
|
|
162
|
+
}
|
|
163
|
+
get #t() {
|
|
164
|
+
return this.rowElements.filter((e) => e.selected);
|
|
165
|
+
}
|
|
166
|
+
get #n() {
|
|
167
|
+
return this.rowElements.reduce((e, t) => {
|
|
168
|
+
let n = Array.from(t.children).filter((e) => e.selected);
|
|
169
|
+
return e.concat(n);
|
|
170
|
+
}, []);
|
|
171
|
+
}
|
|
172
|
+
selectionModeChanged(e) {
|
|
173
|
+
if (e === void 0) {
|
|
174
|
+
t.enqueue(this._resetSelection);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
this._resetSelection(!0);
|
|
178
|
+
}
|
|
179
|
+
#r = (e) => {
|
|
180
|
+
(e.key === "Enter" || e.key === " ") && this.#i(e);
|
|
181
|
+
};
|
|
182
|
+
#i = ({ target: e, ctrlKey: t, shiftKey: n, metaKey: r }) => {
|
|
183
|
+
if (!(e.getAttribute("role") !== "gridcell" || e.getAttribute("cell-type") !== "default")) {
|
|
184
|
+
if (this.selectionMode === U.singleCell || this.selectionMode === U.multiCell) {
|
|
185
|
+
this.#a({
|
|
186
|
+
target: e,
|
|
187
|
+
ctrlKey: t,
|
|
188
|
+
shiftKey: n,
|
|
189
|
+
metaKey: r
|
|
190
|
+
});
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
(this.selectionMode === U.singleRow || this.selectionMode === U.multiRow) && this.#o({
|
|
194
|
+
target: e,
|
|
195
|
+
ctrlKey: t,
|
|
196
|
+
shiftKey: n,
|
|
197
|
+
metaKey: r
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
#a = ({ target: e, ctrlKey: t, shiftKey: n, metaKey: r }) => {
|
|
202
|
+
let i = e;
|
|
203
|
+
if (this.selectionMode === U.multiCell && (t || n || r)) i.selected = !this.#n.includes(i);
|
|
204
|
+
else {
|
|
205
|
+
let e = i.selected;
|
|
206
|
+
this._resetSelection(!0), i.selected = !e;
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
#o = ({ target: e, ctrlKey: t, shiftKey: n, metaKey: r }) => {
|
|
210
|
+
let i = e.parentNode;
|
|
211
|
+
if (this.selectionMode === U.multiRow && (t || n || r)) i.selected = !this.#t.includes(i);
|
|
212
|
+
else {
|
|
213
|
+
let e = i.selected;
|
|
214
|
+
this._resetSelection(!0), i.selected = !e;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
constructor() {
|
|
218
|
+
super(), this.noTabbing = !1, this.generateHeader = j.default, this.rowsData = [], this.columnDefinitions = null, this.focusRowIndex = 0, this.focusColumnIndex = 0, this.fixedColumnsPositions = [], this.behaviorOrchestrator = null, this.generatedHeader = null, this.isUpdatingFocus = !1, this.pendingFocusUpdate = !1, this.rowindexUpdateQueued = !1, this.columnDefinitionsStale = !0, this.generatedGridTemplateColumns = "", this.focusOnCell = (e, t, n) => {
|
|
219
|
+
if (this.rowElements.length === 0) {
|
|
220
|
+
this.focusRowIndex = 0, this.focusColumnIndex = 0;
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
let r = Math.max(0, Math.min(this.rowElements.length - 1, e)), i = this.rowElements[r].querySelectorAll("[role=\"cell\"], [role=\"gridcell\"], [role=\"columnheader\"], [role=\"rowheader\"], [data-vvd-component=\"data-grid-cell\"]"), a = i[Math.max(0, Math.min(i.length - 1, t))];
|
|
224
|
+
n && this.scrollHeight !== this.clientHeight && (r < this.focusRowIndex && this.scrollTop > 0 || r > this.focusRowIndex && this.scrollTop < this.scrollHeight - this.clientHeight) && a.scrollIntoView({
|
|
225
|
+
block: "center",
|
|
226
|
+
inline: "center"
|
|
227
|
+
}), a.focus();
|
|
228
|
+
}, this.onChildListChange = (e, t) => {
|
|
229
|
+
/* v8 ignore else -- @preserve */
|
|
230
|
+
e && e.length && (e.forEach((e) => {
|
|
231
|
+
e.addedNodes.forEach((e) => {
|
|
232
|
+
e.nodeType === 1 && (e.getAttribute("role") === "row" || e.getAttribute("row-type") === "default") && (e.columnDefinitions = this.columnDefinitions);
|
|
233
|
+
});
|
|
234
|
+
}), this.queueRowIndexUpdate());
|
|
235
|
+
}, this.queueRowIndexUpdate = () => {
|
|
236
|
+
this.rowindexUpdateQueued || (this.rowindexUpdateQueued = !0, t.enqueue(this.updateRowIndexes));
|
|
237
|
+
}, this.updateRowIndexes = () => {
|
|
238
|
+
let e = this.gridTemplateColumns;
|
|
239
|
+
if (e === void 0) {
|
|
240
|
+
if (this.generatedGridTemplateColumns === "" && this.rowElements.length > 0) {
|
|
241
|
+
let e = this.rowElements[0];
|
|
242
|
+
this.generatedGridTemplateColumns = Array(e.cellElements.length).fill("1fr").join(" ");
|
|
243
|
+
}
|
|
244
|
+
e = this.generatedGridTemplateColumns;
|
|
245
|
+
}
|
|
246
|
+
this.rowElements.forEach((t, n) => {
|
|
247
|
+
let r = t;
|
|
248
|
+
r.rowIndex = n, r.gridTemplateColumns = e, this.columnDefinitionsStale && (r.columnDefinitions = this.columnDefinitions);
|
|
249
|
+
}), this.rowindexUpdateQueued = !1, this.columnDefinitionsStale = !1;
|
|
250
|
+
}, this._resetSelection = (e = !1) => {
|
|
251
|
+
let t = Array.from(this.querySelectorAll("[role=\"gridcell\"], [cell-type=\"default\"]")), n = Array.from(this.querySelectorAll("[role=\"row\"], [row-type=\"default\"]"));
|
|
252
|
+
if (this.selectionMode === U.singleCell || this.selectionMode === U.multiCell) {
|
|
253
|
+
for (let n of t) n._selectable = !0, n.selected = e ? !1 : n.selected || !1;
|
|
254
|
+
for (let e of n) e._selectable = !1, e.selected = !1;
|
|
255
|
+
}
|
|
256
|
+
if (this.selectionMode === U.none) for (let e of [...t, ...n]) e._selectable = !1, e.selected = !1;
|
|
257
|
+
if (this.selectionMode === U.singleRow || this.selectionMode === U.multiRow) {
|
|
258
|
+
for (let e of t) e._selectable = !1, e.selected = !1;
|
|
259
|
+
for (let t of n) t._selectable = !0, t.selected = e ? !1 : t.selected || !1;
|
|
260
|
+
}
|
|
261
|
+
}, this.addEventListener("click", this.#i), this.addEventListener("keydown", this.#r);
|
|
262
|
+
}
|
|
263
|
+
#s = { handleChange(e, t) {
|
|
264
|
+
/* v8 ignore else -- @preserve */
|
|
265
|
+
t === "columnDefinitions" && e.$fastController.isConnected && e.toggleGeneratedHeader();
|
|
266
|
+
} };
|
|
267
|
+
static generateColumns(e) {
|
|
268
|
+
return Object.keys(e).map((e, t) => ({
|
|
269
|
+
columnDataKey: e,
|
|
270
|
+
gridColumn: `${t}`
|
|
271
|
+
}));
|
|
272
|
+
}
|
|
273
|
+
applyFixedColumns() {
|
|
274
|
+
if (!this.fixedColumns || this.fixedColumns <= 0) {
|
|
275
|
+
this.clearFixedColumns();
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
this.calculateFixedColumnPositions(), this.applyFixedColumnStyling();
|
|
279
|
+
}
|
|
280
|
+
applyFixedColumnStyling() {
|
|
281
|
+
this.rowElements.forEach((e) => {
|
|
282
|
+
let t = e.querySelectorAll("[role=\"cell\"], [role=\"gridcell\"], [role=\"columnheader\"], [cell-type=\"default\"], [cell-type=\"columnheader\"]");
|
|
283
|
+
this.fixedColumnsPositions.forEach((e, n) => {
|
|
284
|
+
/* v8 ignore else -- @preserve */
|
|
285
|
+
if (n < t.length) {
|
|
286
|
+
let r = t[n];
|
|
287
|
+
/* v8 ignore else -- @preserve */
|
|
288
|
+
typeof r.setFixedPosition == "function" && r.setFixedPosition(`${e}px`);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
calculateFixedColumnPositions() {
|
|
294
|
+
if (this.fixedColumnsPositions = [], this.rowElements.length === 0) return;
|
|
295
|
+
let e = this.rowElements[0].querySelectorAll("[role=\"cell\"], [role=\"gridcell\"], [role=\"columnheader\"], [cell-type=\"default\"], [cell-type=\"columnheader\"]"), t = 0;
|
|
296
|
+
for (let n = 0; n < Math.min(this.fixedColumns, e.length); n++) this.fixedColumnsPositions.push(t), t += e[n].offsetWidth;
|
|
297
|
+
}
|
|
298
|
+
clearFixedColumns() {
|
|
299
|
+
if (this.rowElements.length === 0) {
|
|
300
|
+
this.fixedColumnsPositions = [];
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
this.rowElements.forEach((e) => {
|
|
304
|
+
let t = e.querySelectorAll("[role=\"cell\"], [role=\"gridcell\"], [role=\"columnheader\"], [cell-type=\"default\"], [cell-type=\"columnheader\"]");
|
|
305
|
+
this.fixedColumnsPositions.forEach((e, n) => {
|
|
306
|
+
/* v8 ignore else -- @preserve */
|
|
307
|
+
if (n < t.length) {
|
|
308
|
+
let e = t[n];
|
|
309
|
+
/* v8 ignore else -- @preserve */
|
|
310
|
+
typeof e.setFixedPosition == "function" && e.setFixedPosition(void 0);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
}), this.fixedColumnsPositions = [];
|
|
314
|
+
}
|
|
19
315
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
switch (this.isActiveCell = !0, this.cellType) {
|
|
85
|
-
case v.columnHeader:
|
|
86
|
-
if (this.columnDefinition !== null && this.columnDefinition.headerCellInternalFocusQueue !== !0 && typeof this.columnDefinition.headerCellFocusTargetCallback == "function") {
|
|
87
|
-
const t = this.columnDefinition.headerCellFocusTargetCallback(this);
|
|
88
|
-
t !== null && t.focus();
|
|
89
|
-
}
|
|
90
|
-
break;
|
|
91
|
-
default:
|
|
92
|
-
if (this.columnDefinition !== null && this.columnDefinition.cellInternalFocusQueue !== !0 && typeof this.columnDefinition.cellFocusTargetCallback == "function") {
|
|
93
|
-
const t = this.columnDefinition.cellFocusTargetCallback(this);
|
|
94
|
-
t !== null && t.focus();
|
|
95
|
-
}
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
this.$emit("cell-focused", this);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
handleFocusout(e) {
|
|
102
|
-
this.shadowRoot.querySelector(".base").classList.remove("active"), this !== document.activeElement && !this.contains(document.activeElement) && (this.isActiveCell = !1);
|
|
103
|
-
}
|
|
104
|
-
handleKeydown(e) {
|
|
105
|
-
if (!(e.defaultPrevented || this.columnDefinition === null || this.cellType === v.default && this.columnDefinition.cellInternalFocusQueue !== !0 || this.cellType === v.columnHeader && this.columnDefinition.headerCellInternalFocusQueue !== !0))
|
|
106
|
-
switch (e.key) {
|
|
107
|
-
case P:
|
|
108
|
-
case te:
|
|
109
|
-
if (this.contains(document.activeElement) && document.activeElement !== this)
|
|
110
|
-
return;
|
|
111
|
-
switch (this.cellType) {
|
|
112
|
-
case v.columnHeader: {
|
|
113
|
-
if (this.columnDefinition.headerCellFocusTargetCallback !== void 0) {
|
|
114
|
-
const t = this.columnDefinition.headerCellFocusTargetCallback(this);
|
|
115
|
-
t !== null && t.focus(), e.preventDefault();
|
|
116
|
-
}
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
default: {
|
|
120
|
-
if (this.columnDefinition.cellFocusTargetCallback !== void 0) {
|
|
121
|
-
const t = this.columnDefinition.cellFocusTargetCallback(this);
|
|
122
|
-
t !== null && t.focus(), e.preventDefault();
|
|
123
|
-
}
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
break;
|
|
128
|
-
case ee: {
|
|
129
|
-
this.contains(document.activeElement) && document.activeElement !== this && (this.focus(), e.preventDefault());
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
updateCellView() {
|
|
135
|
-
if (this.disconnectCellView(), this.columnDefinition !== null) {
|
|
136
|
-
switch (this.cellType) {
|
|
137
|
-
case v.columnHeader:
|
|
138
|
-
this.columnDefinition.headerCellTemplate !== void 0 ? this.customCellView = this.columnDefinition.headerCellTemplate.render(
|
|
139
|
-
this,
|
|
140
|
-
this
|
|
141
|
-
) : this.customCellView = pe.render(
|
|
142
|
-
this,
|
|
143
|
-
this
|
|
144
|
-
);
|
|
145
|
-
break;
|
|
146
|
-
case v.rowHeader:
|
|
147
|
-
case v.default:
|
|
148
|
-
this.columnDefinition.cellTemplate !== void 0 ? this.customCellView = this.columnDefinition.cellTemplate.render(
|
|
149
|
-
this,
|
|
150
|
-
this
|
|
151
|
-
) : this.customCellView = fe.render(this, this);
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
this.columnDefinition?.sortable ? this.columnDefinition.sortDirection ? this.sortDirection = this.columnDefinition.sortDirection : this.sortDirection = _.none : this.sortDirection = void 0;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
disconnectCellView() {
|
|
158
|
-
this.customCellView !== null && (this.customCellView.dispose(), this.customCellView = null);
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* @internal
|
|
162
|
-
*/
|
|
163
|
-
ariaSelectedChanged(e, t) {
|
|
164
|
-
super.ariaSelectedChanged(e, t), this._selectable = t !== null, this.selected = t === "true";
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* @internal
|
|
168
|
-
*/
|
|
169
|
-
ariaSortChanged(e, t) {
|
|
170
|
-
if (super.ariaSortChanged(e, t), t === null) {
|
|
171
|
-
this.sortDirection = void 0;
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
this.sortDirection = t;
|
|
175
|
-
}
|
|
176
|
-
#e() {
|
|
177
|
-
return this.columnDefinition && this.columnDefinition.columnDataKey ? this.columnDefinition.columnDataKey : this.textContent.trim();
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* @internal
|
|
181
|
-
*/
|
|
182
|
-
_handleInteraction() {
|
|
183
|
-
const e = this.cellType === "columnheader";
|
|
184
|
-
return e && this.sortDirection !== void 0 && this.$emit("sort", {
|
|
185
|
-
columnDataKey: this.#e(),
|
|
186
|
-
sortDirection: this.sortDirection
|
|
187
|
-
}), (e ? this.columnDefinition?.headerCellInternalFocusQueue : this.columnDefinition?.cellInternalFocusQueue) || this.$emit("cell-click", {
|
|
188
|
-
cell: this,
|
|
189
|
-
row: this.parentElement,
|
|
190
|
-
isHeaderCell: e,
|
|
191
|
-
columnDataKey: this.#e()
|
|
192
|
-
}), !0;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
C([
|
|
196
|
-
f({ attribute: "cell-type" })
|
|
197
|
-
], p.prototype, "cellType");
|
|
198
|
-
C([
|
|
199
|
-
f({ attribute: "grid-column" })
|
|
200
|
-
], p.prototype, "gridColumn");
|
|
201
|
-
C([
|
|
202
|
-
a
|
|
203
|
-
], p.prototype, "rowData");
|
|
204
|
-
C([
|
|
205
|
-
a
|
|
206
|
-
], p.prototype, "columnDefinition");
|
|
207
|
-
C([
|
|
208
|
-
a
|
|
209
|
-
], p.prototype, "_selectable");
|
|
210
|
-
C([
|
|
211
|
-
f({ mode: "boolean" })
|
|
212
|
-
], p.prototype, "selected");
|
|
213
|
-
C([
|
|
214
|
-
f({ attribute: "sort-direction" })
|
|
215
|
-
], p.prototype, "sortDirection");
|
|
216
|
-
C([
|
|
217
|
-
a
|
|
218
|
-
], p.prototype, "_actionItemsSlottedContent");
|
|
219
|
-
var ve = Object.defineProperty, h = (i, e, t, l) => {
|
|
220
|
-
for (var o = void 0, n = i.length - 1, r; n >= 0; n--)
|
|
221
|
-
(r = i[n]) && (o = r(e, t, o) || o);
|
|
222
|
-
return o && ve(e, t, o), o;
|
|
316
|
+
y([a({
|
|
317
|
+
attribute: "no-tabbing",
|
|
318
|
+
mode: "boolean"
|
|
319
|
+
})], W.prototype, "noTabbing", void 0), y([a({ attribute: "generate-header" })], W.prototype, "generateHeader", void 0), y([a({ attribute: "grid-template-columns" })], W.prototype, "gridTemplateColumns", void 0), y([n], W.prototype, "rowsData", void 0), y([n], W.prototype, "columnDefinitions", void 0), y([n], W.prototype, "rowItemTemplate", void 0), y([n], W.prototype, "cellItemTemplate", void 0), y([n], W.prototype, "headerCellItemTemplate", void 0), y([n], W.prototype, "focusRowIndex", void 0), y([n], W.prototype, "focusColumnIndex", void 0), y([a({
|
|
320
|
+
attribute: "fixed-columns",
|
|
321
|
+
converter: te
|
|
322
|
+
})], W.prototype, "fixedColumns", void 0), y([n], W.prototype, "defaultRowItemTemplate", void 0), y([n], W.prototype, "rowElementTag", void 0), y([n], W.prototype, "rowElements", void 0), y([n], W.prototype, "slottedRowElements", void 0), y([a({ attribute: "selection-mode" })], W.prototype, "selectionMode", void 0);
|
|
323
|
+
//#endregion
|
|
324
|
+
//#region src/lib/data-grid/data-grid-row.ts
|
|
325
|
+
var G = class extends A(s) {
|
|
326
|
+
constructor(...e) {
|
|
327
|
+
super(...e), this.rowType = M.default, this.rowData = null, this.columnDefinitions = null, this.behaviorOrchestrator = null, this.focusColumnIndex = 0, this.updateRowStyle = () => {
|
|
328
|
+
this.style.gridTemplateColumns = this.gridTemplateColumns;
|
|
329
|
+
}, this.ariaSelected = null, this._selectable = !1, this.selected = !1;
|
|
330
|
+
}
|
|
331
|
+
gridTemplateColumnsChanged() {
|
|
332
|
+
this.$fastController.isConnected && this.updateRowStyle();
|
|
333
|
+
}
|
|
334
|
+
rowTypeChanged() {
|
|
335
|
+
this.$fastController.isConnected && this.updateItemTemplate();
|
|
336
|
+
}
|
|
337
|
+
cellItemTemplateChanged() {
|
|
338
|
+
this.updateItemTemplate();
|
|
339
|
+
}
|
|
340
|
+
headerCellItemTemplateChanged() {
|
|
341
|
+
this.updateItemTemplate();
|
|
342
|
+
}
|
|
343
|
+
connectedCallback() {
|
|
344
|
+
super.connectedCallback(), this.behaviorOrchestrator === null && (this.updateItemTemplate(), this.behaviorOrchestrator = r.create(this), this.$fastController.addBehavior(this.behaviorOrchestrator), this.behaviorOrchestrator.addBehaviorFactory(new l(u((e) => e.columnDefinitions), u((e) => e.activeCellItemTemplate), { positioning: !0 }), this.appendChild(document.createComment("")))), this.addEventListener("cell-focused", this.handleCellFocus), this.addEventListener(R, this.handleFocusout), this.addEventListener(z, this.handleKeydown), this.updateRowStyle();
|
|
345
|
+
}
|
|
346
|
+
disconnectedCallback() {
|
|
347
|
+
super.disconnectedCallback(), this.removeEventListener("cell-focused", this.handleCellFocus), this.removeEventListener(R, this.handleFocusout), this.removeEventListener(z, this.handleKeydown);
|
|
348
|
+
}
|
|
349
|
+
handleFocusout(e) {
|
|
350
|
+
/* v8 ignore else -- @preserve */
|
|
351
|
+
this.contains(document.activeElement) || (this.focusColumnIndex = 0);
|
|
352
|
+
}
|
|
353
|
+
handleCellFocus(e) {
|
|
354
|
+
this.focusColumnIndex = this.cellElements.indexOf(e.target), this.$emit("row-focused", this);
|
|
355
|
+
}
|
|
356
|
+
handleKeydown(e) {
|
|
357
|
+
if (e.defaultPrevented) return;
|
|
358
|
+
let t = 0;
|
|
359
|
+
switch (e.key) {
|
|
360
|
+
case w:
|
|
361
|
+
t = Math.max(0, this.focusColumnIndex - 1), this.cellElements[t].focus(), e.preventDefault();
|
|
362
|
+
break;
|
|
363
|
+
case E:
|
|
364
|
+
t = Math.min(this.cellElements.length - 1, this.focusColumnIndex + 1), this.cellElements[t].focus(), e.preventDefault();
|
|
365
|
+
break;
|
|
366
|
+
case D:
|
|
367
|
+
e.ctrlKey || (this.cellElements[0].focus(), e.preventDefault());
|
|
368
|
+
break;
|
|
369
|
+
case "End":
|
|
370
|
+
e.ctrlKey || (this.cellElements[this.cellElements.length - 1].focus(), e.preventDefault());
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
updateItemTemplate() {
|
|
375
|
+
this.activeCellItemTemplate = this.rowType === M.default && this.cellItemTemplate !== void 0 ? this.cellItemTemplate : this.rowType === M.default && this.cellItemTemplate === void 0 ? this.defaultCellItemTemplate : this.headerCellItemTemplate === void 0 ? this.defaultHeaderCellItemTemplate : this.headerCellItemTemplate;
|
|
376
|
+
}
|
|
377
|
+
ariaSelectedChanged(e, t) {
|
|
378
|
+
super.ariaSelectedChanged(e, t), this._selectable = t !== null, this.selected = t === "true";
|
|
379
|
+
}
|
|
223
380
|
};
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* @internal
|
|
238
|
-
*/
|
|
239
|
-
rowTypeChanged() {
|
|
240
|
-
this.$fastController.isConnected && this.updateItemTemplate();
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* @internal
|
|
244
|
-
*/
|
|
245
|
-
cellItemTemplateChanged() {
|
|
246
|
-
this.updateItemTemplate();
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* @internal
|
|
250
|
-
*/
|
|
251
|
-
headerCellItemTemplateChanged() {
|
|
252
|
-
this.updateItemTemplate();
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* @internal
|
|
256
|
-
*/
|
|
257
|
-
connectedCallback() {
|
|
258
|
-
super.connectedCallback(), this.behaviorOrchestrator === null && (this.updateItemTemplate(), this.behaviorOrchestrator = A.create(this), this.$fastController.addBehavior(this.behaviorOrchestrator), this.behaviorOrchestrator.addBehaviorFactory(
|
|
259
|
-
new L(
|
|
260
|
-
T((e) => e.columnDefinitions),
|
|
261
|
-
T((e) => e.activeCellItemTemplate),
|
|
262
|
-
{ positioning: !0 }
|
|
263
|
-
),
|
|
264
|
-
this.appendChild(document.createComment(""))
|
|
265
|
-
)), this.addEventListener("cell-focused", this.handleCellFocus), this.addEventListener(w, this.handleFocusout), this.addEventListener(y, this.handleKeydown), this.updateRowStyle();
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* @internal
|
|
269
|
-
*/
|
|
270
|
-
disconnectedCallback() {
|
|
271
|
-
super.disconnectedCallback(), this.removeEventListener("cell-focused", this.handleCellFocus), this.removeEventListener(
|
|
272
|
-
w,
|
|
273
|
-
this.handleFocusout
|
|
274
|
-
), this.removeEventListener(y, this.handleKeydown);
|
|
275
|
-
}
|
|
276
|
-
handleFocusout(e) {
|
|
277
|
-
this.contains(document.activeElement) || (this.focusColumnIndex = 0);
|
|
278
|
-
}
|
|
279
|
-
handleCellFocus(e) {
|
|
280
|
-
this.focusColumnIndex = this.cellElements.indexOf(e.target), this.$emit("row-focused", this);
|
|
281
|
-
}
|
|
282
|
-
handleKeydown(e) {
|
|
283
|
-
if (e.defaultPrevented)
|
|
284
|
-
return;
|
|
285
|
-
let t = 0;
|
|
286
|
-
switch (e.key) {
|
|
287
|
-
case ie:
|
|
288
|
-
t = Math.max(0, this.focusColumnIndex - 1), this.cellElements[t].focus(), e.preventDefault();
|
|
289
|
-
break;
|
|
290
|
-
case oe:
|
|
291
|
-
t = Math.min(
|
|
292
|
-
this.cellElements.length - 1,
|
|
293
|
-
this.focusColumnIndex + 1
|
|
294
|
-
), this.cellElements[t].focus(), e.preventDefault();
|
|
295
|
-
break;
|
|
296
|
-
case K:
|
|
297
|
-
e.ctrlKey || (this.cellElements[0].focus(), e.preventDefault());
|
|
298
|
-
break;
|
|
299
|
-
case M:
|
|
300
|
-
e.ctrlKey || (this.cellElements[this.cellElements.length - 1].focus(), e.preventDefault());
|
|
301
|
-
break;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
updateItemTemplate() {
|
|
305
|
-
this.activeCellItemTemplate = this.rowType === g.default && this.cellItemTemplate !== void 0 ? this.cellItemTemplate : this.rowType === g.default && this.cellItemTemplate === void 0 ? this.defaultCellItemTemplate : this.headerCellItemTemplate !== void 0 ? this.headerCellItemTemplate : this.defaultHeaderCellItemTemplate;
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* @internal
|
|
309
|
-
*/
|
|
310
|
-
ariaSelectedChanged(e, t) {
|
|
311
|
-
super.ariaSelectedChanged(e, t), this._selectable = t !== null, this.selected = t === "true";
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
h([
|
|
315
|
-
f({ attribute: "grid-template-columns" })
|
|
316
|
-
], c.prototype, "gridTemplateColumns");
|
|
317
|
-
h([
|
|
318
|
-
f({ attribute: "row-type" })
|
|
319
|
-
], c.prototype, "rowType");
|
|
320
|
-
h([
|
|
321
|
-
a
|
|
322
|
-
], c.prototype, "rowData");
|
|
323
|
-
h([
|
|
324
|
-
a
|
|
325
|
-
], c.prototype, "columnDefinitions");
|
|
326
|
-
h([
|
|
327
|
-
a
|
|
328
|
-
], c.prototype, "cellItemTemplate");
|
|
329
|
-
h([
|
|
330
|
-
a
|
|
331
|
-
], c.prototype, "headerCellItemTemplate");
|
|
332
|
-
h([
|
|
333
|
-
a
|
|
334
|
-
], c.prototype, "rowIndex");
|
|
335
|
-
h([
|
|
336
|
-
a
|
|
337
|
-
], c.prototype, "activeCellItemTemplate");
|
|
338
|
-
h([
|
|
339
|
-
a
|
|
340
|
-
], c.prototype, "defaultCellItemTemplate");
|
|
341
|
-
h([
|
|
342
|
-
a
|
|
343
|
-
], c.prototype, "defaultHeaderCellItemTemplate");
|
|
344
|
-
h([
|
|
345
|
-
a
|
|
346
|
-
], c.prototype, "cellElements");
|
|
347
|
-
h([
|
|
348
|
-
a
|
|
349
|
-
], c.prototype, "_selectable");
|
|
350
|
-
h([
|
|
351
|
-
f({ mode: "boolean" })
|
|
352
|
-
], c.prototype, "selected");
|
|
353
|
-
var ge = Object.defineProperty, d = (i, e, t, l) => {
|
|
354
|
-
for (var o = void 0, n = i.length - 1, r; n >= 0; n--)
|
|
355
|
-
(r = i[n]) && (o = r(e, t, o) || o);
|
|
356
|
-
return o && ge(e, t, o), o;
|
|
357
|
-
};
|
|
358
|
-
const m = {
|
|
359
|
-
none: "none",
|
|
360
|
-
singleRow: "single-row",
|
|
361
|
-
multiRow: "multi-row",
|
|
362
|
-
singleCell: "single-cell",
|
|
363
|
-
multiCell: "multi-cell"
|
|
364
|
-
}, s = class k extends $ {
|
|
365
|
-
constructor() {
|
|
366
|
-
super(), this.noTabbing = !1, this.generateHeader = b.default, this.rowsData = [], this.columnDefinitions = null, this.focusRowIndex = 0, this.focusColumnIndex = 0, this.fixedColumnsPositions = [], this.behaviorOrchestrator = null, this.generatedHeader = null, this.isUpdatingFocus = !1, this.pendingFocusUpdate = !1, this.rowindexUpdateQueued = !1, this.columnDefinitionsStale = !0, this.generatedGridTemplateColumns = "", this.focusOnCell = (e, t, l) => {
|
|
367
|
-
if (this.rowElements.length === 0) {
|
|
368
|
-
this.focusRowIndex = 0, this.focusColumnIndex = 0;
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
const o = Math.max(
|
|
372
|
-
0,
|
|
373
|
-
Math.min(this.rowElements.length - 1, e)
|
|
374
|
-
), r = this.rowElements[o].querySelectorAll(
|
|
375
|
-
'[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"], [data-vvd-component="data-grid-cell"]'
|
|
376
|
-
), x = Math.max(
|
|
377
|
-
0,
|
|
378
|
-
Math.min(r.length - 1, t)
|
|
379
|
-
), R = r[x];
|
|
380
|
-
l && this.scrollHeight !== this.clientHeight && (o < this.focusRowIndex && this.scrollTop > 0 || o > this.focusRowIndex && this.scrollTop < this.scrollHeight - this.clientHeight) && R.scrollIntoView({ block: "center", inline: "center" }), R.focus();
|
|
381
|
-
}, this.onChildListChange = (e, t) => {
|
|
382
|
-
e && e.length && (e.forEach((l) => {
|
|
383
|
-
l.addedNodes.forEach((o) => {
|
|
384
|
-
o.nodeType === 1 && (o.getAttribute("role") === "row" || o.getAttribute("row-type") === "default") && (o.columnDefinitions = this.columnDefinitions);
|
|
385
|
-
});
|
|
386
|
-
}), this.queueRowIndexUpdate());
|
|
387
|
-
}, this.queueRowIndexUpdate = () => {
|
|
388
|
-
this.rowindexUpdateQueued || (this.rowindexUpdateQueued = !0, D.enqueue(this.updateRowIndexes));
|
|
389
|
-
}, this.updateRowIndexes = () => {
|
|
390
|
-
let e = this.gridTemplateColumns;
|
|
391
|
-
if (e === void 0) {
|
|
392
|
-
if (this.generatedGridTemplateColumns === "" && this.rowElements.length > 0) {
|
|
393
|
-
const t = this.rowElements[0];
|
|
394
|
-
this.generatedGridTemplateColumns = new Array(
|
|
395
|
-
t.cellElements.length
|
|
396
|
-
).fill("1fr").join(" ");
|
|
397
|
-
}
|
|
398
|
-
e = this.generatedGridTemplateColumns;
|
|
399
|
-
}
|
|
400
|
-
this.rowElements.forEach((t, l) => {
|
|
401
|
-
const o = t;
|
|
402
|
-
o.rowIndex = l, o.gridTemplateColumns = e, this.columnDefinitionsStale && (o.columnDefinitions = this.columnDefinitions);
|
|
403
|
-
}), this.rowindexUpdateQueued = !1, this.columnDefinitionsStale = !1;
|
|
404
|
-
}, this.#i = (e) => {
|
|
405
|
-
(e.key === "Enter" || e.key === " ") && this.#t(e);
|
|
406
|
-
}, this.#t = ({ target: e, ctrlKey: t, shiftKey: l, metaKey: o }) => {
|
|
407
|
-
if (!(e.getAttribute("role") !== "gridcell" || e.getAttribute("cell-type") !== "default")) {
|
|
408
|
-
if (this.selectionMode === m.singleCell || this.selectionMode === m.multiCell) {
|
|
409
|
-
this.#l({ target: e, ctrlKey: t, shiftKey: l, metaKey: o });
|
|
410
|
-
return;
|
|
411
|
-
}
|
|
412
|
-
(this.selectionMode === m.singleRow || this.selectionMode === m.multiRow) && this.#n({ target: e, ctrlKey: t, shiftKey: l, metaKey: o });
|
|
413
|
-
}
|
|
414
|
-
}, this.#l = ({
|
|
415
|
-
target: e,
|
|
416
|
-
ctrlKey: t,
|
|
417
|
-
shiftKey: l,
|
|
418
|
-
metaKey: o
|
|
419
|
-
}) => {
|
|
420
|
-
const n = e;
|
|
421
|
-
if (this.selectionMode === m.multiCell && (t || l || o))
|
|
422
|
-
n.selected = !this.#r.includes(n);
|
|
423
|
-
else {
|
|
424
|
-
const r = n.selected;
|
|
425
|
-
this._resetSelection(!0), n.selected = !r;
|
|
426
|
-
}
|
|
427
|
-
}, this.#n = ({
|
|
428
|
-
target: e,
|
|
429
|
-
ctrlKey: t,
|
|
430
|
-
shiftKey: l,
|
|
431
|
-
metaKey: o
|
|
432
|
-
}) => {
|
|
433
|
-
const n = e.parentNode;
|
|
434
|
-
if (this.selectionMode === m.multiRow && (t || l || o))
|
|
435
|
-
n.selected = !this.#a.includes(n);
|
|
436
|
-
else {
|
|
437
|
-
const r = n.selected;
|
|
438
|
-
this._resetSelection(!0), n.selected = !r;
|
|
439
|
-
}
|
|
440
|
-
}, this.#o = {
|
|
441
|
-
handleChange(e, t) {
|
|
442
|
-
t === "columnDefinitions" && e.$fastController.isConnected && e.toggleGeneratedHeader();
|
|
443
|
-
}
|
|
444
|
-
}, this._resetSelection = (e = !1) => {
|
|
445
|
-
const t = Array.from(
|
|
446
|
-
this.querySelectorAll('[role="gridcell"], [cell-type="default"]')
|
|
447
|
-
), l = Array.from(
|
|
448
|
-
this.querySelectorAll('[role="row"], [row-type="default"]')
|
|
449
|
-
);
|
|
450
|
-
if (this.selectionMode === m.singleCell || this.selectionMode === m.multiCell) {
|
|
451
|
-
for (const o of t)
|
|
452
|
-
o._selectable = !0, o.selected = e ? !1 : o.selected || !1;
|
|
453
|
-
for (const o of l)
|
|
454
|
-
o._selectable = !1, o.selected = !1;
|
|
455
|
-
}
|
|
456
|
-
if (this.selectionMode === m.none)
|
|
457
|
-
for (const o of [...t, ...l])
|
|
458
|
-
o._selectable = !1, o.selected = !1;
|
|
459
|
-
if (this.selectionMode === m.singleRow || this.selectionMode === m.multiRow) {
|
|
460
|
-
for (const o of t)
|
|
461
|
-
o._selectable = !1, o.selected = !1;
|
|
462
|
-
for (const o of l)
|
|
463
|
-
o._selectable = !0, o.selected = e ? !1 : o.selected || !1;
|
|
464
|
-
}
|
|
465
|
-
}, this.addEventListener("click", this.#t), this.addEventListener("keydown", this.#i);
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* generates a gridTemplateColumns based on columndata array
|
|
469
|
-
*/
|
|
470
|
-
static generateTemplateColumns(e) {
|
|
471
|
-
let t = "";
|
|
472
|
-
return e.forEach((l) => {
|
|
473
|
-
t = `${t}${t === "" ? "" : " "}1fr`;
|
|
474
|
-
}), t;
|
|
475
|
-
}
|
|
476
|
-
/**
|
|
477
|
-
* @internal
|
|
478
|
-
*/
|
|
479
|
-
noTabbingChanged() {
|
|
480
|
-
this.$fastController.isConnected && this.#e();
|
|
481
|
-
}
|
|
482
|
-
#e() {
|
|
483
|
-
this.setAttribute(
|
|
484
|
-
"tabIndex",
|
|
485
|
-
this.noTabbing || this.contains(document.activeElement) ? "-1" : "0"
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
/**
|
|
489
|
-
* @internal
|
|
490
|
-
*/
|
|
491
|
-
generateHeaderChanged() {
|
|
492
|
-
this.$fastController.isConnected && this.toggleGeneratedHeader();
|
|
493
|
-
}
|
|
494
|
-
/**
|
|
495
|
-
* @internal
|
|
496
|
-
*/
|
|
497
|
-
gridTemplateColumnsChanged() {
|
|
498
|
-
this.$fastController.isConnected && (this.updateRowIndexes(), this.fixedColumns && this.fixedColumns > 0 && this.applyFixedColumns());
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* @internal
|
|
502
|
-
*/
|
|
503
|
-
rowsDataChanged() {
|
|
504
|
-
this.columnDefinitions === null && this.rowsData.length > 0 && (this.columnDefinitions = k.generateColumns(this.rowsData[0])), this.$fastController.isConnected && this.toggleGeneratedHeader();
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* @internal
|
|
508
|
-
*/
|
|
509
|
-
columnDefinitionsChanged() {
|
|
510
|
-
if (this.columnDefinitions === null) {
|
|
511
|
-
this.generatedGridTemplateColumns = "";
|
|
512
|
-
return;
|
|
513
|
-
}
|
|
514
|
-
this.generatedGridTemplateColumns = k.generateTemplateColumns(
|
|
515
|
-
this.columnDefinitions
|
|
516
|
-
), this.$fastController.isConnected && (this.columnDefinitionsStale = !0, this.queueRowIndexUpdate());
|
|
517
|
-
}
|
|
518
|
-
/**
|
|
519
|
-
* @internal
|
|
520
|
-
*/
|
|
521
|
-
headerCellItemTemplateChanged() {
|
|
522
|
-
this.$fastController.isConnected && this.generatedHeader !== null && (this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate);
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* @internal
|
|
526
|
-
*/
|
|
527
|
-
focusRowIndexChanged() {
|
|
528
|
-
this.$fastController.isConnected && this.queueFocusUpdate();
|
|
529
|
-
}
|
|
530
|
-
/**
|
|
531
|
-
* @internal
|
|
532
|
-
*/
|
|
533
|
-
focusColumnIndexChanged() {
|
|
534
|
-
this.$fastController.isConnected && this.queueFocusUpdate();
|
|
535
|
-
}
|
|
536
|
-
/**
|
|
537
|
-
* @internal
|
|
538
|
-
*/
|
|
539
|
-
fixedColumnsChanged() {
|
|
540
|
-
this.$fastController.isConnected && (this.applyFixedColumns(), this.setupResizeObserver());
|
|
541
|
-
}
|
|
542
|
-
/**
|
|
543
|
-
* @internal
|
|
544
|
-
*/
|
|
545
|
-
setupResizeObserver() {
|
|
546
|
-
this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0), typeof ResizeObserver < "u" && this.fixedColumns && this.fixedColumns > 0 && (this.resizeObserver = new ResizeObserver(() => {
|
|
547
|
-
this.applyFixedColumns();
|
|
548
|
-
}), this.resizeObserver.observe(this));
|
|
549
|
-
}
|
|
550
|
-
/**
|
|
551
|
-
* @internal
|
|
552
|
-
*/
|
|
553
|
-
connectedCallback() {
|
|
554
|
-
super.connectedCallback(), this.rowItemTemplate === void 0 && (this.rowItemTemplate = this.defaultRowItemTemplate), this.behaviorOrchestrator === null && (this.behaviorOrchestrator = A.create(this), this.$fastController.addBehavior(this.behaviorOrchestrator), this.behaviorOrchestrator.addBehaviorFactory(
|
|
555
|
-
new L(
|
|
556
|
-
T((e) => e.rowsData),
|
|
557
|
-
T((e) => e.rowItemTemplate),
|
|
558
|
-
{ positioning: !0 }
|
|
559
|
-
),
|
|
560
|
-
this.appendChild(document.createComment(""))
|
|
561
|
-
)), this.toggleGeneratedHeader(), this.addEventListener("row-focused", this.handleRowFocus), this.addEventListener(z, this.handleFocus), this.addEventListener(y, this.handleKeydown), this.addEventListener(w, this.handleFocusOut), this.observer = new MutationObserver(this.onChildListChange), this.observer.observe(this, { childList: !0 }), this.setupResizeObserver(), D.enqueue(this.queueRowIndexUpdate), this.#e(), H.getNotifier(this).subscribe(
|
|
562
|
-
this.#o,
|
|
563
|
-
"columnDefinitions"
|
|
564
|
-
);
|
|
565
|
-
}
|
|
566
|
-
/**
|
|
567
|
-
* @internal
|
|
568
|
-
*/
|
|
569
|
-
disconnectedCallback() {
|
|
570
|
-
super.disconnectedCallback(), this.removeEventListener("row-focused", this.handleRowFocus), this.removeEventListener(z, this.handleFocus), this.removeEventListener(y, this.handleKeydown), this.removeEventListener(
|
|
571
|
-
w,
|
|
572
|
-
this.handleFocusOut
|
|
573
|
-
), this.observer.disconnect(), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = void 0), this.generatedHeader = null, H.getNotifier(this).unsubscribe(
|
|
574
|
-
this.#o,
|
|
575
|
-
"columnDefinitions"
|
|
576
|
-
);
|
|
577
|
-
}
|
|
578
|
-
/**
|
|
579
|
-
* @internal
|
|
580
|
-
*/
|
|
581
|
-
handleRowFocus(e) {
|
|
582
|
-
this.isUpdatingFocus = !0;
|
|
583
|
-
const t = e.target;
|
|
584
|
-
this.focusRowIndex = this.rowElements.indexOf(t), this.focusColumnIndex = t.focusColumnIndex, this.setAttribute("tabIndex", "-1"), this.isUpdatingFocus = !1;
|
|
585
|
-
}
|
|
586
|
-
/**
|
|
587
|
-
* @internal
|
|
588
|
-
*/
|
|
589
|
-
handleFocus(e) {
|
|
590
|
-
this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, !0);
|
|
591
|
-
}
|
|
592
|
-
/**
|
|
593
|
-
* @internal
|
|
594
|
-
*/
|
|
595
|
-
handleFocusOut(e) {
|
|
596
|
-
(e.relatedTarget === null || !this.contains(e.relatedTarget)) && this.setAttribute("tabIndex", this.noTabbing ? "-1" : "0");
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* @internal
|
|
600
|
-
*/
|
|
601
|
-
handleKeydown(e) {
|
|
602
|
-
if (e.defaultPrevented)
|
|
603
|
-
return;
|
|
604
|
-
let t;
|
|
605
|
-
const l = this.rowElements.length - 1, o = this.offsetHeight + this.scrollTop, n = this.rowElements[l];
|
|
606
|
-
switch (e.key) {
|
|
607
|
-
case re:
|
|
608
|
-
e.preventDefault(), this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, !0);
|
|
609
|
-
break;
|
|
610
|
-
case ae:
|
|
611
|
-
e.preventDefault(), this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, !0);
|
|
612
|
-
break;
|
|
613
|
-
case ne:
|
|
614
|
-
if (e.preventDefault(), this.rowElements.length === 0) {
|
|
615
|
-
this.focusOnCell(0, 0, !1);
|
|
616
|
-
break;
|
|
617
|
-
}
|
|
618
|
-
if (this.focusRowIndex === 0) {
|
|
619
|
-
this.focusOnCell(0, this.focusColumnIndex, !1);
|
|
620
|
-
return;
|
|
621
|
-
}
|
|
622
|
-
for (t = this.focusRowIndex - 1, t; t >= 0; t--) {
|
|
623
|
-
const r = this.rowElements[t];
|
|
624
|
-
if (r.offsetTop < this.scrollTop) {
|
|
625
|
-
this.scrollTop = r.offsetTop + r.clientHeight - this.clientHeight;
|
|
626
|
-
break;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
this.focusOnCell(t, this.focusColumnIndex, !1);
|
|
630
|
-
break;
|
|
631
|
-
case le:
|
|
632
|
-
if (e.preventDefault(), this.rowElements.length === 0) {
|
|
633
|
-
this.focusOnCell(0, 0, !1);
|
|
634
|
-
break;
|
|
635
|
-
}
|
|
636
|
-
if (this.focusRowIndex >= l || n.offsetTop + n.offsetHeight <= o) {
|
|
637
|
-
this.focusOnCell(l, this.focusColumnIndex, !1);
|
|
638
|
-
return;
|
|
639
|
-
}
|
|
640
|
-
for (t = this.focusRowIndex + 1, t; t <= l; t++) {
|
|
641
|
-
const r = this.rowElements[t];
|
|
642
|
-
if (r.offsetTop + r.offsetHeight > o) {
|
|
643
|
-
let x = 0;
|
|
644
|
-
this.generateHeader === b.sticky && this.generatedHeader !== null && (x = this.generatedHeader.clientHeight), this.scrollTop = r.offsetTop - x;
|
|
645
|
-
break;
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
this.focusOnCell(t, this.focusColumnIndex, !1);
|
|
649
|
-
break;
|
|
650
|
-
case K: {
|
|
651
|
-
e.ctrlKey && (e.preventDefault(), this.focusOnCell(0, 0, !0));
|
|
652
|
-
break;
|
|
653
|
-
}
|
|
654
|
-
case M: {
|
|
655
|
-
e.ctrlKey && this.columnDefinitions !== null && (e.preventDefault(), this.focusOnCell(
|
|
656
|
-
this.rowElements.length - 1,
|
|
657
|
-
this.columnDefinitions.length - 1,
|
|
658
|
-
!0
|
|
659
|
-
));
|
|
660
|
-
break;
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
queueFocusUpdate() {
|
|
665
|
-
this.isUpdatingFocus && this.contains(document.activeElement) || this.pendingFocusUpdate === !1 && (this.pendingFocusUpdate = !0, D.enqueue(() => this.updateFocus()));
|
|
666
|
-
}
|
|
667
|
-
updateFocus() {
|
|
668
|
-
this.pendingFocusUpdate = !1, this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, !0);
|
|
669
|
-
}
|
|
670
|
-
toggleGeneratedHeader() {
|
|
671
|
-
if (this.generatedHeader !== null && (this.removeChild(this.generatedHeader), this.generatedHeader = null), this.generateHeader !== b.none && this.columnDefinitions !== null) {
|
|
672
|
-
const e = document.createElement(
|
|
673
|
-
this.rowElementTag
|
|
674
|
-
);
|
|
675
|
-
this.generatedHeader = e, this.generatedHeader.columnDefinitions = this.columnDefinitions, this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns, this.generatedHeader.rowType = this.generateHeader === b.sticky ? g.stickyHeader : g.header, this.firstChild !== null && this.insertBefore(e, this.firstChild);
|
|
676
|
-
return;
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
/**
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
* @internal
|
|
683
|
-
*/
|
|
684
|
-
slottedRowElementsChanged(e, t) {
|
|
685
|
-
this._resetSelection();
|
|
686
|
-
}
|
|
687
|
-
get #a() {
|
|
688
|
-
return this.rowElements.filter((e) => e.selected);
|
|
689
|
-
}
|
|
690
|
-
get #r() {
|
|
691
|
-
return this.rowElements.reduce((e, t) => {
|
|
692
|
-
const o = Array.from(t.children).filter(
|
|
693
|
-
(n) => n.selected
|
|
694
|
-
);
|
|
695
|
-
return e.concat(o);
|
|
696
|
-
}, []);
|
|
697
|
-
}
|
|
698
|
-
selectionModeChanged(e) {
|
|
699
|
-
if (e === void 0) {
|
|
700
|
-
D.enqueue(this._resetSelection);
|
|
701
|
-
return;
|
|
702
|
-
}
|
|
703
|
-
this._resetSelection(!0);
|
|
704
|
-
}
|
|
705
|
-
#i;
|
|
706
|
-
#t;
|
|
707
|
-
#l;
|
|
708
|
-
#n;
|
|
709
|
-
#o;
|
|
710
|
-
static generateColumns(e) {
|
|
711
|
-
return Object.keys(e).map((t, l) => ({
|
|
712
|
-
columnDataKey: t,
|
|
713
|
-
gridColumn: `${l}`
|
|
714
|
-
}));
|
|
715
|
-
}
|
|
716
|
-
/**
|
|
717
|
-
* @internal
|
|
718
|
-
*/
|
|
719
|
-
applyFixedColumns() {
|
|
720
|
-
if (!this.fixedColumns || this.fixedColumns <= 0) {
|
|
721
|
-
this.clearFixedColumns();
|
|
722
|
-
return;
|
|
723
|
-
}
|
|
724
|
-
this.calculateFixedColumnPositions(), this.applyFixedColumnStyling();
|
|
725
|
-
}
|
|
726
|
-
/**
|
|
727
|
-
* Applies fixed columns styling using cached positions
|
|
728
|
-
* @internal
|
|
729
|
-
*/
|
|
730
|
-
applyFixedColumnStyling() {
|
|
731
|
-
this.rowElements.forEach((e) => {
|
|
732
|
-
const t = e.querySelectorAll(
|
|
733
|
-
'[role="cell"], [role="gridcell"], [role="columnheader"], [cell-type="default"], [cell-type="columnheader"]'
|
|
734
|
-
);
|
|
735
|
-
this.fixedColumnsPositions.forEach((l, o) => {
|
|
736
|
-
if (o < t.length) {
|
|
737
|
-
const n = t[o];
|
|
738
|
-
typeof n.setFixedPosition == "function" && n.setFixedPosition(`${l}px`);
|
|
739
|
-
}
|
|
740
|
-
});
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
/**
|
|
744
|
-
* Calculates and caches fixed columns positions based on current layout
|
|
745
|
-
* @internal
|
|
746
|
-
*/
|
|
747
|
-
calculateFixedColumnPositions() {
|
|
748
|
-
if (this.fixedColumnsPositions = [], this.rowElements.length === 0) return;
|
|
749
|
-
const e = this.rowElements[0].querySelectorAll(
|
|
750
|
-
'[role="cell"], [role="gridcell"], [role="columnheader"], [cell-type="default"], [cell-type="columnheader"]'
|
|
751
|
-
);
|
|
752
|
-
let t = 0;
|
|
753
|
-
for (let l = 0; l < Math.min(this.fixedColumns, e.length); l++)
|
|
754
|
-
this.fixedColumnsPositions.push(t), t += e[l].offsetWidth;
|
|
755
|
-
}
|
|
756
|
-
/**
|
|
757
|
-
* Clears all fixed columns state and styling
|
|
758
|
-
* @internal
|
|
759
|
-
*/
|
|
760
|
-
clearFixedColumns() {
|
|
761
|
-
if (this.rowElements.length === 0) {
|
|
762
|
-
this.fixedColumnsPositions = [];
|
|
763
|
-
return;
|
|
764
|
-
}
|
|
765
|
-
this.rowElements.forEach((e) => {
|
|
766
|
-
const t = e.querySelectorAll(
|
|
767
|
-
'[role="cell"], [role="gridcell"], [role="columnheader"], [cell-type="default"], [cell-type="columnheader"]'
|
|
768
|
-
);
|
|
769
|
-
this.fixedColumnsPositions.forEach((l, o) => {
|
|
770
|
-
if (o < t.length) {
|
|
771
|
-
const n = t[o];
|
|
772
|
-
typeof n.setFixedPosition == "function" && n.setFixedPosition(void 0);
|
|
773
|
-
}
|
|
774
|
-
});
|
|
775
|
-
}), this.fixedColumnsPositions = [];
|
|
776
|
-
}
|
|
777
|
-
};
|
|
778
|
-
d([
|
|
779
|
-
f({ attribute: "no-tabbing", mode: "boolean" })
|
|
780
|
-
], s.prototype, "noTabbing");
|
|
781
|
-
d([
|
|
782
|
-
f({ attribute: "generate-header" })
|
|
783
|
-
], s.prototype, "generateHeader");
|
|
784
|
-
d([
|
|
785
|
-
f({ attribute: "grid-template-columns" })
|
|
786
|
-
], s.prototype, "gridTemplateColumns");
|
|
787
|
-
d([
|
|
788
|
-
a
|
|
789
|
-
], s.prototype, "rowsData");
|
|
790
|
-
d([
|
|
791
|
-
a
|
|
792
|
-
], s.prototype, "columnDefinitions");
|
|
793
|
-
d([
|
|
794
|
-
a
|
|
795
|
-
], s.prototype, "rowItemTemplate");
|
|
796
|
-
d([
|
|
797
|
-
a
|
|
798
|
-
], s.prototype, "cellItemTemplate");
|
|
799
|
-
d([
|
|
800
|
-
a
|
|
801
|
-
], s.prototype, "headerCellItemTemplate");
|
|
802
|
-
d([
|
|
803
|
-
a
|
|
804
|
-
], s.prototype, "focusRowIndex");
|
|
805
|
-
d([
|
|
806
|
-
a
|
|
807
|
-
], s.prototype, "focusColumnIndex");
|
|
808
|
-
d([
|
|
809
|
-
f({ attribute: "fixed-columns", converter: J })
|
|
810
|
-
], s.prototype, "fixedColumns");
|
|
811
|
-
d([
|
|
812
|
-
a
|
|
813
|
-
], s.prototype, "defaultRowItemTemplate");
|
|
814
|
-
d([
|
|
815
|
-
a
|
|
816
|
-
], s.prototype, "rowElementTag");
|
|
817
|
-
d([
|
|
818
|
-
a
|
|
819
|
-
], s.prototype, "rowElements");
|
|
820
|
-
d([
|
|
821
|
-
a
|
|
822
|
-
], s.prototype, "slottedRowElements");
|
|
823
|
-
d([
|
|
824
|
-
f({ attribute: "selection-mode" })
|
|
825
|
-
], s.prototype, "selectionMode");
|
|
826
|
-
let Ce = s;
|
|
827
|
-
function be(i) {
|
|
828
|
-
const e = i.tagFor(c);
|
|
829
|
-
return u`
|
|
830
|
-
<${e}
|
|
831
|
-
:rowData="${(t) => t}"
|
|
832
|
-
:cellItemTemplate="${(t, l) => l.parent.cellItemTemplate}"
|
|
833
|
-
:headerCellItemTemplate="${(t, l) => l.parent.headerCellItemTemplate}"
|
|
834
|
-
></${e}>
|
|
381
|
+
y([a({ attribute: "grid-template-columns" })], G.prototype, "gridTemplateColumns", void 0), y([a({ attribute: "row-type" })], G.prototype, "rowType", void 0), y([n], G.prototype, "rowData", void 0), y([n], G.prototype, "columnDefinitions", void 0), y([n], G.prototype, "cellItemTemplate", void 0), y([n], G.prototype, "headerCellItemTemplate", void 0), y([n], G.prototype, "rowIndex", void 0), y([n], G.prototype, "activeCellItemTemplate", void 0), y([n], G.prototype, "defaultCellItemTemplate", void 0), y([n], G.prototype, "defaultHeaderCellItemTemplate", void 0), y([n], G.prototype, "cellElements", void 0), y([n], G.prototype, "_selectable", void 0), y([a({ mode: "boolean" })], G.prototype, "selected", void 0);
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region src/lib/data-grid/data-grid.template.ts
|
|
384
|
+
function K(e) {
|
|
385
|
+
let t = e.tagFor(G);
|
|
386
|
+
return i`
|
|
387
|
+
<${t}
|
|
388
|
+
:rowData="${(e) => e}"
|
|
389
|
+
:cellItemTemplate="${(e, t) => t.parent.cellItemTemplate}"
|
|
390
|
+
:headerCellItemTemplate="${(e, t) => t.parent.headerCellItemTemplate}"
|
|
391
|
+
></${t}>
|
|
835
392
|
`;
|
|
836
393
|
}
|
|
837
|
-
function
|
|
838
|
-
|
|
394
|
+
function q(e) {
|
|
395
|
+
return e.selectionMode === void 0 || e.selectionMode === U.none ? null : e.selectionMode.includes("multi") ? "true" : "false";
|
|
839
396
|
}
|
|
840
|
-
function
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
e.setAttribute("row-type", t);
|
|
850
|
-
}
|
|
851
|
-
}
|
|
397
|
+
function J(e) {
|
|
398
|
+
if (e.columnDefinitions === null) {
|
|
399
|
+
let t = e.querySelector("[cell-type=\"columnheader\"]")?.parentElement;
|
|
400
|
+
if (e.generateHeader === j.default && (t?.getAttribute("row-type") === M.header || t?.getAttribute("row-type") === M.stickyHeader)) return;
|
|
401
|
+
if (t) {
|
|
402
|
+
let n = e.generateHeader === j.sticky ? M.stickyHeader : M.header;
|
|
403
|
+
t.setAttribute("row-type", n);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
852
406
|
}
|
|
853
|
-
function
|
|
854
|
-
|
|
407
|
+
function re(e, { event: t }) {
|
|
408
|
+
t.stopPropagation();
|
|
855
409
|
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
410
|
+
var Y = (e) => {
|
|
411
|
+
let t = K(e), n = e.tagFor(G, !0);
|
|
412
|
+
return i`
|
|
859
413
|
<template
|
|
860
|
-
aria-multiselectable="${
|
|
414
|
+
aria-multiselectable="${q}"
|
|
861
415
|
role="grid"
|
|
862
416
|
tabindex="0"
|
|
863
|
-
@sort="${
|
|
864
|
-
:rowElementTag="${() =>
|
|
865
|
-
:defaultRowItemTemplate="${
|
|
866
|
-
${
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
417
|
+
@sort="${re}"
|
|
418
|
+
:rowElementTag="${() => n}"
|
|
419
|
+
:defaultRowItemTemplate="${t}"
|
|
420
|
+
${m({
|
|
421
|
+
property: "rowElements",
|
|
422
|
+
filter: f("[role=row],[data-vvd-component=data-grid-row]")
|
|
423
|
+
})}
|
|
870
424
|
>
|
|
871
425
|
<div class="base">
|
|
872
|
-
${
|
|
873
|
-
<slot ${
|
|
426
|
+
${J}
|
|
427
|
+
<slot ${p("slottedRowElements")}></slot>
|
|
874
428
|
</div>
|
|
875
429
|
</template>
|
|
876
430
|
`;
|
|
431
|
+
}, X = i`
|
|
432
|
+
<template>
|
|
433
|
+
${(e) => e.rowData === null || e.columnDefinition === null || e.columnDefinition.columnDataKey === null ? null : e.rowData[e.columnDefinition.columnDataKey]}
|
|
434
|
+
</template>
|
|
435
|
+
`, ie = i`
|
|
436
|
+
<template>
|
|
437
|
+
${(e) => e.columnDefinition.title === void 0 ? e.columnDefinition.columnDataKey : e.columnDefinition.title}
|
|
438
|
+
</template>
|
|
439
|
+
`, Z = class extends e(A(s)) {
|
|
440
|
+
constructor(...e) {
|
|
441
|
+
super(...e), this.cellType = P.default, this.rowData = null, this.columnDefinition = null, this.isActiveCell = !1, this.customCellView = null, this.updateCellStyle = () => {
|
|
442
|
+
this.gridColumn && !this.gridColumn.includes("undefined") ? this.style.gridColumn = this.gridColumn : this.style.removeProperty("grid-column");
|
|
443
|
+
}, this._selectable = !1, this.selected = !1, this.ariaSelected = null, this.ariaSort = null;
|
|
444
|
+
}
|
|
445
|
+
cellTypeChanged() {
|
|
446
|
+
this.$fastController.isConnected && this.updateCellView();
|
|
447
|
+
}
|
|
448
|
+
gridColumnChanged() {
|
|
449
|
+
this.$fastController.isConnected && this.updateCellStyle();
|
|
450
|
+
}
|
|
451
|
+
columnDefinitionChanged(e, t) {
|
|
452
|
+
this.$fastController.isConnected && this.updateCellView();
|
|
453
|
+
}
|
|
454
|
+
updateFixedStyle() {
|
|
455
|
+
this.fixedPosition === void 0 ? (this.removeAttribute("data-fixed"), this.style.removeProperty("left")) : (this.setAttribute("data-fixed", ""), this.style.left = this.fixedPosition);
|
|
456
|
+
}
|
|
457
|
+
setFixedPosition(e) {
|
|
458
|
+
this.fixedPosition = e, this.updateFixedStyle();
|
|
459
|
+
}
|
|
460
|
+
connectedCallback() {
|
|
461
|
+
super.connectedCallback(), this.addEventListener(L, this.handleFocusin), this.addEventListener(R, this.handleFocusout), this.addEventListener(z, this.handleKeydown), this.style.gridColumn = `${this.columnDefinition?.gridColumn === void 0 ? 0 : this.columnDefinition.gridColumn}`, this.updateCellView(), this.updateCellStyle(), this.updateFixedStyle();
|
|
462
|
+
}
|
|
463
|
+
disconnectedCallback() {
|
|
464
|
+
super.disconnectedCallback(), this.removeEventListener(L, this.handleFocusin), this.removeEventListener(R, this.handleFocusout), this.removeEventListener(z, this.handleKeydown), this.disconnectCellView();
|
|
465
|
+
}
|
|
466
|
+
handleFocusin(e) {
|
|
467
|
+
if (this.shadowRoot.querySelector(".base").classList.add("active"), !this.isActiveCell) {
|
|
468
|
+
switch (this.isActiveCell = !0, this.cellType) {
|
|
469
|
+
case P.columnHeader:
|
|
470
|
+
if (this.columnDefinition !== null && this.columnDefinition.headerCellInternalFocusQueue !== !0 && typeof this.columnDefinition.headerCellFocusTargetCallback == "function") {
|
|
471
|
+
let e = this.columnDefinition.headerCellFocusTargetCallback(this);
|
|
472
|
+
/* v8 ignore else -- @preserve */
|
|
473
|
+
e !== null && e.focus();
|
|
474
|
+
}
|
|
475
|
+
break;
|
|
476
|
+
default:
|
|
477
|
+
if (this.columnDefinition !== null && this.columnDefinition.cellInternalFocusQueue !== !0 && typeof this.columnDefinition.cellFocusTargetCallback == "function") {
|
|
478
|
+
let e = this.columnDefinition.cellFocusTargetCallback(this);
|
|
479
|
+
/* v8 ignore else -- @preserve */
|
|
480
|
+
e !== null && e.focus();
|
|
481
|
+
}
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
this.$emit("cell-focused", this);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
handleFocusout(e) {
|
|
488
|
+
/* v8 ignore else -- @preserve */
|
|
489
|
+
this.shadowRoot.querySelector(".base").classList.remove("active"), this !== document.activeElement && !this.contains(document.activeElement) && (this.isActiveCell = !1);
|
|
490
|
+
}
|
|
491
|
+
handleKeydown(e) {
|
|
492
|
+
if (!(e.defaultPrevented || this.columnDefinition === null || this.cellType === P.default && this.columnDefinition.cellInternalFocusQueue !== !0 || this.cellType === P.columnHeader && this.columnDefinition.headerCellInternalFocusQueue !== !0)) switch (e.key) {
|
|
493
|
+
case ne:
|
|
494
|
+
case "F2":
|
|
495
|
+
if (this.contains(document.activeElement) && document.activeElement !== this) return;
|
|
496
|
+
switch (this.cellType) {
|
|
497
|
+
case P.columnHeader:
|
|
498
|
+
if (this.columnDefinition.headerCellFocusTargetCallback !== void 0) {
|
|
499
|
+
let t = this.columnDefinition.headerCellFocusTargetCallback(this);
|
|
500
|
+
t !== null && t.focus(), e.preventDefault();
|
|
501
|
+
}
|
|
502
|
+
break;
|
|
503
|
+
default:
|
|
504
|
+
if (this.columnDefinition.cellFocusTargetCallback !== void 0) {
|
|
505
|
+
let t = this.columnDefinition.cellFocusTargetCallback(this);
|
|
506
|
+
t !== null && t.focus(), e.preventDefault();
|
|
507
|
+
}
|
|
508
|
+
break;
|
|
509
|
+
}
|
|
510
|
+
break;
|
|
511
|
+
case T:
|
|
512
|
+
/* v8 ignore else -- @preserve */
|
|
513
|
+
this.contains(document.activeElement) && document.activeElement !== this && (this.focus(), e.preventDefault());
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
updateCellView() {
|
|
518
|
+
if (this.disconnectCellView(), this.columnDefinition !== null) {
|
|
519
|
+
switch (this.cellType) {
|
|
520
|
+
case P.columnHeader:
|
|
521
|
+
this.columnDefinition.headerCellTemplate === void 0 ? this.customCellView = ie.render(this, this) : this.customCellView = this.columnDefinition.headerCellTemplate.render(this, this);
|
|
522
|
+
break;
|
|
523
|
+
case P.rowHeader:
|
|
524
|
+
case P.default:
|
|
525
|
+
this.columnDefinition.cellTemplate === void 0 ? this.customCellView = X.render(this, this) : this.customCellView = this.columnDefinition.cellTemplate.render(this, this);
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
this.columnDefinition?.sortable ? this.columnDefinition.sortDirection ? this.sortDirection = this.columnDefinition.sortDirection : this.sortDirection = N.none : this.sortDirection = void 0;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
disconnectCellView() {
|
|
532
|
+
this.customCellView !== null && (this.customCellView.dispose(), this.customCellView = null);
|
|
533
|
+
}
|
|
534
|
+
ariaSelectedChanged(e, t) {
|
|
535
|
+
super.ariaSelectedChanged(e, t), this._selectable = t !== null, this.selected = t === "true";
|
|
536
|
+
}
|
|
537
|
+
ariaSortChanged(e, t) {
|
|
538
|
+
if (super.ariaSortChanged(e, t), t === null) {
|
|
539
|
+
this.sortDirection = void 0;
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
this.sortDirection = t;
|
|
543
|
+
}
|
|
544
|
+
#e() {
|
|
545
|
+
return this.columnDefinition && this.columnDefinition.columnDataKey ? this.columnDefinition.columnDataKey : this.textContent.trim();
|
|
546
|
+
}
|
|
547
|
+
_handleInteraction() {
|
|
548
|
+
let e = this.cellType === "columnheader";
|
|
549
|
+
return e && this.sortDirection !== void 0 && this.$emit("sort", {
|
|
550
|
+
columnDataKey: this.#e(),
|
|
551
|
+
sortDirection: this.sortDirection
|
|
552
|
+
}), (e ? this.columnDefinition?.headerCellInternalFocusQueue : this.columnDefinition?.cellInternalFocusQueue) || this.$emit("cell-click", {
|
|
553
|
+
cell: this,
|
|
554
|
+
row: this.parentElement,
|
|
555
|
+
isHeaderCell: e,
|
|
556
|
+
columnDataKey: this.#e()
|
|
557
|
+
}), !0;
|
|
558
|
+
}
|
|
877
559
|
};
|
|
878
|
-
|
|
879
|
-
|
|
560
|
+
y([a({ attribute: "cell-type" })], Z.prototype, "cellType", void 0), y([a({ attribute: "grid-column" })], Z.prototype, "gridColumn", void 0), y([n], Z.prototype, "rowData", void 0), y([n], Z.prototype, "columnDefinition", void 0), y([n], Z.prototype, "_selectable", void 0), y([a({ mode: "boolean" })], Z.prototype, "selected", void 0), y([a({ attribute: "sort-direction" })], Z.prototype, "sortDirection", void 0), y([n], Z.prototype, "_actionItemsSlottedContent", void 0);
|
|
561
|
+
//#endregion
|
|
562
|
+
//#region src/lib/data-grid/data-grid-row.template.ts
|
|
563
|
+
function ae(e) {
|
|
564
|
+
return e._selectable && e.selected ? "true" : e._selectable && !e.selected ? "false" : null;
|
|
880
565
|
}
|
|
881
|
-
function
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
<${
|
|
885
|
-
cell-type="${(
|
|
886
|
-
grid-column="${(
|
|
887
|
-
:rowData="${(
|
|
888
|
-
:columnDefinition="${(
|
|
889
|
-
selected="${(
|
|
890
|
-
></${
|
|
566
|
+
function oe(e) {
|
|
567
|
+
let t = e.tagFor(Z);
|
|
568
|
+
return i`
|
|
569
|
+
<${t}
|
|
570
|
+
cell-type="${(e) => e.isRowHeader ? "rowheader" : void 0}"
|
|
571
|
+
grid-column="${(e, t) => t.index + 1}"
|
|
572
|
+
:rowData="${(e, t) => t.parent.rowData}"
|
|
573
|
+
:columnDefinition="${(e) => e}"
|
|
574
|
+
selected="${(e, t) => t.parent.ariaSelected === "true" ? !0 : null}"
|
|
575
|
+
></${t}>
|
|
891
576
|
`;
|
|
892
577
|
}
|
|
893
|
-
function
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
<${
|
|
578
|
+
function se(e) {
|
|
579
|
+
let t = e.tagFor(Z);
|
|
580
|
+
return i`
|
|
581
|
+
<${t}
|
|
897
582
|
cell-type="columnheader"
|
|
898
|
-
grid-column="${(
|
|
899
|
-
:columnDefinition="${(
|
|
900
|
-
></${
|
|
583
|
+
grid-column="${(e, t) => t.index + 1}"
|
|
584
|
+
:columnDefinition="${(e) => e}"
|
|
585
|
+
></${t}>
|
|
901
586
|
`;
|
|
902
587
|
}
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
588
|
+
var ce = (e) => {
|
|
589
|
+
let t = oe(e), n = se(e);
|
|
590
|
+
return i`
|
|
906
591
|
<template
|
|
907
|
-
${
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
class="${(
|
|
912
|
-
:defaultCellItemTemplate="${
|
|
913
|
-
:defaultHeaderCellItemTemplate="${
|
|
914
|
-
${
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
)
|
|
919
|
-
})}
|
|
592
|
+
${k({
|
|
593
|
+
role: "row",
|
|
594
|
+
ariaSelected: ae
|
|
595
|
+
})}
|
|
596
|
+
class="${(e) => e.rowType === "default" ? "" : e.rowType}"
|
|
597
|
+
:defaultCellItemTemplate="${t}"
|
|
598
|
+
:defaultHeaderCellItemTemplate="${n}"
|
|
599
|
+
${m({
|
|
600
|
+
property: "cellElements",
|
|
601
|
+
filter: f("[role=\"cell\"],[role=\"gridcell\"],[role=\"columnheader\"],[role=\"rowheader\"],[data-vvd-component=\"data-grid-cell\"]")
|
|
602
|
+
})}
|
|
920
603
|
>
|
|
921
604
|
<div
|
|
922
|
-
class="${
|
|
923
|
-
style="grid-template-columns: ${(
|
|
605
|
+
class="${(e) => b("base", ["selected", !!e.selected])}"
|
|
606
|
+
style="grid-template-columns: ${(e) => e.gridTemplateColumns};"
|
|
924
607
|
>
|
|
925
|
-
<slot ${
|
|
608
|
+
<slot ${p("slottedCellElements")}></slot>
|
|
926
609
|
</div>
|
|
927
610
|
</template>
|
|
928
611
|
`;
|
|
929
612
|
};
|
|
930
|
-
|
|
931
|
-
|
|
613
|
+
//#endregion
|
|
614
|
+
//#region src/lib/data-grid/data-grid-cell.template.ts
|
|
615
|
+
function Q(e) {
|
|
616
|
+
return e.cellType === "columnheader" && e.sortDirection !== void 0 && e.sortDirection !== N.other;
|
|
932
617
|
}
|
|
933
|
-
function
|
|
934
|
-
|
|
618
|
+
function le(e) {
|
|
619
|
+
return e.sortDirection === N.ascending ? "sort-asc-solid" : e.sortDirection === N.descending ? "sort-desc-solid" : "sort-solid";
|
|
935
620
|
}
|
|
936
|
-
function
|
|
937
|
-
|
|
621
|
+
function ue(e) {
|
|
622
|
+
return e._selectable && e.selected ? "true" : e._selectable && !e.selected ? "false" : null;
|
|
938
623
|
}
|
|
939
|
-
function
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
${
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
<${e} class="header-icon" name="${Ee}"></${e}>
|
|
946
|
-
`
|
|
947
|
-
)}
|
|
624
|
+
function de(e) {
|
|
625
|
+
let t = e.tagFor(_);
|
|
626
|
+
return i`
|
|
627
|
+
${d(Q, i`
|
|
628
|
+
<${t} class="header-icon" name="${le}"></${t}>
|
|
629
|
+
`)}
|
|
948
630
|
`;
|
|
949
631
|
}
|
|
950
|
-
function
|
|
951
|
-
|
|
632
|
+
function fe(e) {
|
|
633
|
+
return e.cellType === P.columnHeader && e.sortDirection !== void 0;
|
|
952
634
|
}
|
|
953
|
-
function
|
|
954
|
-
|
|
635
|
+
function $(e) {
|
|
636
|
+
return e.sortDirection ?? N.none;
|
|
955
637
|
}
|
|
956
|
-
function
|
|
957
|
-
|
|
958
|
-
|
|
638
|
+
function pe(e) {
|
|
639
|
+
let t = $(e);
|
|
640
|
+
return e.locale.dataGrid.cell.sortStatus?.[t];
|
|
959
641
|
}
|
|
960
|
-
function
|
|
961
|
-
|
|
962
|
-
|
|
642
|
+
function me(e) {
|
|
643
|
+
let t = $(e);
|
|
644
|
+
return e.locale.dataGrid.cell.sortInstruction?.[t];
|
|
963
645
|
}
|
|
964
|
-
function
|
|
965
|
-
|
|
646
|
+
function he(e) {
|
|
647
|
+
return [pe(e), me(e)].filter((e) => !!e).join(" ").trim();
|
|
966
648
|
}
|
|
967
|
-
function
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
649
|
+
function ge(e, t) {
|
|
650
|
+
if (t.key === "Enter" || t.key === " ") {
|
|
651
|
+
if (t.target.closest("[slot=\"action-items\"]")) return !0;
|
|
652
|
+
e._handleInteraction();
|
|
653
|
+
}
|
|
654
|
+
return !0;
|
|
973
655
|
}
|
|
974
|
-
function
|
|
975
|
-
|
|
656
|
+
function _e(e, t) {
|
|
657
|
+
return t.target.closest("[slot=\"action-items\"]") || e._handleInteraction(), !0;
|
|
976
658
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
"base",
|
|
983
|
-
["selected", !!l],
|
|
984
|
-
["has-action-items", !!o?.length]
|
|
985
|
-
);
|
|
986
|
-
return u`
|
|
659
|
+
//#endregion
|
|
660
|
+
//#region src/lib/data-grid/index.ts
|
|
661
|
+
ee(o("data-grid", W, Y, [o("data-grid-row", G, ce, [o("data-grid-cell", Z, (e) => {
|
|
662
|
+
let t = e.tagFor(g);
|
|
663
|
+
return i`
|
|
987
664
|
<template
|
|
988
665
|
tabindex="-1"
|
|
989
|
-
${
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
@click="${(
|
|
995
|
-
@keydown="${(
|
|
666
|
+
${k({
|
|
667
|
+
role: (e) => F[e.cellType] ?? F.default,
|
|
668
|
+
ariaSelected: ue,
|
|
669
|
+
ariaSort: (e) => e.sortDirection ?? null
|
|
670
|
+
})}
|
|
671
|
+
@click="${(e, t) => _e(e, t.event)}"
|
|
672
|
+
@keydown="${(e, t) => ge(e, t.event)}"
|
|
996
673
|
>
|
|
997
|
-
<div class="${t}">
|
|
674
|
+
<div class="${({ selected: e, _actionItemsSlottedContent: t }) => b("base", ["selected", !!e], ["has-action-items", !!t?.length])}">
|
|
998
675
|
<div
|
|
999
676
|
class="content"
|
|
1000
|
-
role="${(
|
|
677
|
+
role="${(e) => Q(e) ? "button" : void 0}"
|
|
1001
678
|
>
|
|
1002
|
-
${(
|
|
679
|
+
${(e) => e.selected ? i`<${t}
|
|
1003
680
|
data-announcement="selection"
|
|
1004
681
|
>
|
|
1005
|
-
${(
|
|
1006
|
-
</${
|
|
682
|
+
${(e) => e.locale.dataGrid.cell.selected}
|
|
683
|
+
</${t}>` : null}
|
|
1007
684
|
<slot></slot>
|
|
1008
|
-
${
|
|
1009
|
-
E,
|
|
1010
|
-
u`<${e}
|
|
685
|
+
${d(Q, i`<${t}
|
|
1011
686
|
data-announcement="button-role"
|
|
1012
687
|
>
|
|
1013
|
-
${(
|
|
1014
|
-
</${
|
|
1015
|
-
`
|
|
1016
|
-
|
|
1017
|
-
${I(
|
|
1018
|
-
Se,
|
|
1019
|
-
u`<${e}
|
|
688
|
+
${(e) => e.locale.dataGrid.cell.button}
|
|
689
|
+
</${t}>
|
|
690
|
+
`)}
|
|
691
|
+
${d(fe, i`<${t}
|
|
1020
692
|
aria-live="polite"
|
|
1021
693
|
data-announcement="sort-state"
|
|
1022
694
|
>
|
|
1023
|
-
${
|
|
1024
|
-
</${
|
|
1025
|
-
|
|
1026
|
-
${(l) => Fe(i)}
|
|
695
|
+
${he}
|
|
696
|
+
</${t}>`)}
|
|
697
|
+
${(t) => de(e)}
|
|
1027
698
|
</div>
|
|
1028
699
|
<slot
|
|
1029
700
|
name="action-items"
|
|
1030
|
-
${
|
|
701
|
+
${p("_actionItemsSlottedContent")}
|
|
1031
702
|
></slot>
|
|
1032
703
|
</div>
|
|
1033
704
|
</template>
|
|
1034
705
|
`;
|
|
1035
|
-
},
|
|
1036
|
-
|
|
1037
|
-
p,
|
|
1038
|
-
Ae,
|
|
1039
|
-
[W, Z],
|
|
1040
|
-
{
|
|
1041
|
-
styles: he
|
|
1042
|
-
}
|
|
1043
|
-
), Pe = F(
|
|
1044
|
-
"data-grid-row",
|
|
1045
|
-
c,
|
|
1046
|
-
ke,
|
|
1047
|
-
[Le],
|
|
1048
|
-
{
|
|
1049
|
-
styles: ue
|
|
1050
|
-
}
|
|
1051
|
-
), Me = F(
|
|
1052
|
-
"data-grid",
|
|
1053
|
-
Ce,
|
|
1054
|
-
xe,
|
|
1055
|
-
[Pe],
|
|
1056
|
-
{
|
|
1057
|
-
styles: de
|
|
1058
|
-
}
|
|
1059
|
-
), Ke = X(Me);
|
|
1060
|
-
Ke();
|
|
706
|
+
}, [v, h], { styles: H })], { styles: V })], { styles: B }))();
|
|
707
|
+
//#endregion
|