@kouji-ui/components 0.1.1 → 0.1.3
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/fesm2022/kouji-ui-components.mjs +17668 -0
- package/fesm2022/kouji-ui-components.mjs.map +1 -0
- package/package.json +21 -11
- package/types/kouji-ui-components.d.ts +8032 -0
- package/.turbo/turbo-build.log +0 -29
- package/CHANGELOG.md +0 -192
- package/ng-package.json +0 -7
- package/src/accordion/_examples/accordion.default.example.ts +0 -31
- package/src/accordion/_examples/accordion.disabled.example.ts +0 -38
- package/src/accordion/_examples/accordion.multiple.example.ts +0 -31
- package/src/accordion/_examples/accordion.rich-content.example.ts +0 -49
- package/src/accordion/_examples/index.ts +0 -6
- package/src/accordion/accordion.arrow-nav.example.ts +0 -39
- package/src/accordion/accordion.css +0 -68
- package/src/accordion/accordion.playground.ts +0 -119
- package/src/accordion/accordion.spec.ts +0 -117
- package/src/accordion/accordion.ts +0 -153
- package/src/accordion/accordion.usage.example.ts +0 -38
- package/src/accordion/accordion.value.example.ts +0 -60
- package/src/accordion/index.ts +0 -1
- package/src/alert/_examples/alert.banner.example.ts +0 -56
- package/src/alert/_examples/alert.dismissible.example.ts +0 -53
- package/src/alert/_examples/alert.example.ts +0 -40
- package/src/alert/_examples/alert.variants.example.ts +0 -66
- package/src/alert/_examples/alert.with-actions.example.ts +0 -57
- package/src/alert/_examples/index.ts +0 -7
- package/src/alert/alert.css +0 -133
- package/src/alert/alert.playground.ts +0 -111
- package/src/alert/alert.spec.ts +0 -167
- package/src/alert/alert.ts +0 -250
- package/src/alert/alert.usage.example.ts +0 -58
- package/src/alert/index.ts +0 -8
- package/src/avatar/_examples/avatar-group.example.ts +0 -31
- package/src/avatar/_examples/avatar-group.list.example.ts +0 -45
- package/src/avatar/_examples/avatar-group.overflow.example.ts +0 -33
- package/src/avatar/_examples/avatar-group.shapes.example.ts +0 -39
- package/src/avatar/_examples/avatar-group.sizes.example.ts +0 -44
- package/src/avatar/_examples/avatar.default.example.ts +0 -18
- package/src/avatar/_examples/avatar.initials.example.ts +0 -20
- package/src/avatar/_examples/avatar.shapes.example.ts +0 -22
- package/src/avatar/_examples/avatar.sizes.example.ts +0 -26
- package/src/avatar/_examples/avatar.with-image.example.ts +0 -20
- package/src/avatar/_examples/index.ts +0 -12
- package/src/avatar/avatar-group.spec.ts +0 -138
- package/src/avatar/avatar-group.ts +0 -127
- package/src/avatar/avatar-group.usage.example.ts +0 -30
- package/src/avatar/avatar.css +0 -58
- package/src/avatar/avatar.playground.ts +0 -95
- package/src/avatar/avatar.ts +0 -123
- package/src/avatar/index.ts +0 -2
- package/src/badge/_examples/badge.default.example.ts +0 -18
- package/src/badge/_examples/badge.sizes.example.ts +0 -25
- package/src/badge/_examples/badge.variants.example.ts +0 -24
- package/src/badge/_examples/badge.with-dot.example.ts +0 -31
- package/src/badge/_examples/badge.with-icon.example.ts +0 -23
- package/src/badge/_examples/index.ts +0 -7
- package/src/badge/badge.css +0 -59
- package/src/badge/badge.playground.ts +0 -49
- package/src/badge/badge.ts +0 -86
- package/src/badge/badge.usage.example.ts +0 -22
- package/src/badge/index.ts +0 -1
- package/src/breadcrumb/_examples/breadcrumb.custom-separator.example.ts +0 -53
- package/src/breadcrumb/_examples/breadcrumb.example.ts +0 -48
- package/src/breadcrumb/_examples/breadcrumb.long-path.example.ts +0 -58
- package/src/breadcrumb/_examples/breadcrumb.truncated.example.ts +0 -59
- package/src/breadcrumb/_examples/breadcrumb.with-icons.example.ts +0 -66
- package/src/breadcrumb/_examples/index.ts +0 -7
- package/src/breadcrumb/breadcrumb.css +0 -121
- package/src/breadcrumb/breadcrumb.playground.ts +0 -93
- package/src/breadcrumb/breadcrumb.spec.ts +0 -230
- package/src/breadcrumb/breadcrumb.ts +0 -272
- package/src/breadcrumb/breadcrumb.usage.example.ts +0 -45
- package/src/breadcrumb/index.ts +0 -1
- package/src/button/_examples/button.anchor.example.ts +0 -18
- package/src/button/_examples/button.configured.example.ts +0 -43
- package/src/button/_examples/button.disabled.example.ts +0 -25
- package/src/button/_examples/button.example.ts +0 -22
- package/src/button/_examples/button.icon.example.ts +0 -27
- package/src/button/_examples/button.loading.example.ts +0 -31
- package/src/button/_examples/button.pressed.example.ts +0 -24
- package/src/button/_examples/button.sizes.example.ts +0 -26
- package/src/button/_examples/button.usage.example.ts +0 -66
- package/src/button/_examples/button.variants.example.ts +0 -26
- package/src/button/_examples/index.ts +0 -12
- package/src/button/button.css +0 -263
- package/src/button/button.playground.ts +0 -79
- package/src/button/button.spec.ts +0 -100
- package/src/button/button.ts +0 -150
- package/src/button/index.ts +0 -1
- package/src/button-group/_examples/button-group.example.ts +0 -30
- package/src/button-group/_examples/button-group.icon-only.example.ts +0 -30
- package/src/button-group/_examples/button-group.toggle.example.ts +0 -36
- package/src/button-group/_examples/button-group.variants.example.ts +0 -40
- package/src/button-group/_examples/button-group.vertical.example.ts +0 -29
- package/src/button-group/_examples/index.ts +0 -7
- package/src/button-group/button-group.css +0 -80
- package/src/button-group/button-group.playground.ts +0 -94
- package/src/button-group/button-group.spec.ts +0 -119
- package/src/button-group/button-group.ts +0 -130
- package/src/button-group/button-group.usage.example.ts +0 -35
- package/src/button-group/index.ts +0 -1
- package/src/calendar/_examples/calendar.example.ts +0 -33
- package/src/calendar/_examples/index.ts +0 -3
- package/src/calendar/calendar.css +0 -129
- package/src/calendar/calendar.playground.ts +0 -84
- package/src/calendar/calendar.spec.ts +0 -50
- package/src/calendar/calendar.ts +0 -171
- package/src/calendar/calendar.usage.example.ts +0 -33
- package/src/calendar/index.ts +0 -1
- package/src/card/_examples/card.cover.example.ts +0 -53
- package/src/card/_examples/card.example.ts +0 -27
- package/src/card/_examples/card.full.example.ts +0 -51
- package/src/card/_examples/index.ts +0 -5
- package/src/card/card.css +0 -120
- package/src/card/card.playground.ts +0 -116
- package/src/card/card.spec.ts +0 -50
- package/src/card/card.ts +0 -194
- package/src/card/card.usage.example.ts +0 -46
- package/src/card/index.ts +0 -1
- package/src/carousel/_examples/carousel.autoplay.example.ts +0 -69
- package/src/carousel/_examples/carousel.example.ts +0 -60
- package/src/carousel/_examples/carousel.indicators.example.ts +0 -64
- package/src/carousel/_examples/carousel.lazy-load.example.ts +0 -85
- package/src/carousel/_examples/carousel.tabs-pattern.example.ts +0 -61
- package/src/carousel/_examples/index.ts +0 -7
- package/src/carousel/carousel.css +0 -181
- package/src/carousel/carousel.playground.ts +0 -135
- package/src/carousel/carousel.spec.ts +0 -211
- package/src/carousel/carousel.ts +0 -399
- package/src/carousel/carousel.usage.example.ts +0 -46
- package/src/carousel/index.ts +0 -1
- package/src/cascade-select/_examples/cascade-select.data-driven.example.ts +0 -119
- package/src/cascade-select/_examples/cascade-select.disabled.example.ts +0 -74
- package/src/cascade-select/_examples/cascade-select.example.ts +0 -80
- package/src/cascade-select/_examples/cascade-select.field.example.ts +0 -73
- package/src/cascade-select/_examples/cascade-select.path.example.ts +0 -85
- package/src/cascade-select/_examples/index.ts +0 -7
- package/src/cascade-select/cascade-select.css +0 -120
- package/src/cascade-select/cascade-select.playground.ts +0 -133
- package/src/cascade-select/cascade-select.ts +0 -201
- package/src/cascade-select/cascade-select.usage.example.ts +0 -44
- package/src/cascade-select/index.ts +0 -5
- package/src/chat/_examples/chat-bubble.example.ts +0 -71
- package/src/chat/_examples/chat-bubble.grouped.example.ts +0 -69
- package/src/chat/_examples/chat-bubble.sides.example.ts +0 -41
- package/src/chat/_examples/chat-bubble.variants.example.ts +0 -58
- package/src/chat/_examples/chat-bubble.with-state.example.ts +0 -57
- package/src/chat/_examples/index.ts +0 -7
- package/src/chat/chat.css +0 -231
- package/src/chat/chat.playground.ts +0 -171
- package/src/chat/chat.spec.ts +0 -343
- package/src/chat/chat.ts +0 -269
- package/src/chat/chat.usage.example.ts +0 -49
- package/src/chat/index.ts +0 -13
- package/src/checkbox/_examples/checkbox.checked.example.ts +0 -20
- package/src/checkbox/_examples/checkbox.default.example.ts +0 -20
- package/src/checkbox/_examples/checkbox.disabled.example.ts +0 -26
- package/src/checkbox/_examples/checkbox.indeterminate.example.ts +0 -20
- package/src/checkbox/_examples/checkbox.usage.example.ts +0 -62
- package/src/checkbox/_examples/index.ts +0 -7
- package/src/checkbox/checkbox.css +0 -74
- package/src/checkbox/checkbox.playground.ts +0 -68
- package/src/checkbox/checkbox.ts +0 -122
- package/src/checkbox/index.ts +0 -1
- package/src/color-picker/_examples/color-picker.alpha.example.ts +0 -36
- package/src/color-picker/_examples/color-picker.example.ts +0 -34
- package/src/color-picker/_examples/color-picker.hex-input.example.ts +0 -53
- package/src/color-picker/_examples/color-picker.in-form.example.ts +0 -60
- package/src/color-picker/_examples/color-picker.usage.example.ts +0 -58
- package/src/color-picker/_examples/color-picker.with-presets.example.ts +0 -45
- package/src/color-picker/_examples/index.ts +0 -8
- package/src/color-picker/color-picker.css +0 -183
- package/src/color-picker/color-picker.playground.ts +0 -83
- package/src/color-picker/color-picker.spec.ts +0 -94
- package/src/color-picker/color-picker.ts +0 -234
- package/src/color-picker/index.ts +0 -1
- package/src/combobox/_examples/combobox.async.example.ts +0 -85
- package/src/combobox/_examples/combobox.empty-state.example.ts +0 -36
- package/src/combobox/_examples/combobox.example.ts +0 -36
- package/src/combobox/_examples/combobox.free-text.example.ts +0 -42
- package/src/combobox/_examples/combobox.usage.example.ts +0 -51
- package/src/combobox/_examples/combobox.with-icons.example.ts +0 -49
- package/src/combobox/_examples/index.ts +0 -8
- package/src/combobox/combobox.css +0 -101
- package/src/combobox/combobox.playground.ts +0 -90
- package/src/combobox/combobox.spec.ts +0 -111
- package/src/combobox/combobox.ts +0 -219
- package/src/combobox/index.ts +0 -6
- package/src/command-palette/_examples/command-palette.async.example.ts +0 -99
- package/src/command-palette/_examples/command-palette.dialog.example.ts +0 -90
- package/src/command-palette/_examples/command-palette.example.ts +0 -40
- package/src/command-palette/_examples/command-palette.fuzzy.example.ts +0 -54
- package/src/command-palette/_examples/command-palette.groups.example.ts +0 -55
- package/src/command-palette/_examples/command-palette.usage.example.ts +0 -49
- package/src/command-palette/_examples/index.ts +0 -8
- package/src/command-palette/command-palette.css +0 -234
- package/src/command-palette/command-palette.playground.ts +0 -119
- package/src/command-palette/command-palette.ts +0 -448
- package/src/command-palette/index.ts +0 -10
- package/src/confirm-popup/_examples/confirm-popup.destructive.example.ts +0 -72
- package/src/confirm-popup/_examples/confirm-popup.example.ts +0 -82
- package/src/confirm-popup/_examples/confirm-popup.placement.example.ts +0 -97
- package/src/confirm-popup/_examples/confirm-popup.usage.example.ts +0 -94
- package/src/confirm-popup/_examples/confirm-popup.with-message.example.ts +0 -76
- package/src/confirm-popup/_examples/index.ts +0 -7
- package/src/confirm-popup/confirm-popup.css +0 -47
- package/src/confirm-popup/confirm-popup.playground.ts +0 -109
- package/src/confirm-popup/confirm-popup.spec.ts +0 -209
- package/src/confirm-popup/confirm-popup.ts +0 -279
- package/src/confirm-popup/index.ts +0 -1
- package/src/date-picker/_examples/date-picker.disabled-dates.example.ts +0 -44
- package/src/date-picker/_examples/date-picker.example.ts +0 -38
- package/src/date-picker/_examples/date-picker.locale.example.ts +0 -50
- package/src/date-picker/_examples/date-picker.readonly.example.ts +0 -32
- package/src/date-picker/_examples/date-picker.usage.example.ts +0 -60
- package/src/date-picker/_examples/date-picker.with-min-max.example.ts +0 -47
- package/src/date-picker/_examples/index.ts +0 -8
- package/src/date-picker/date-picker.css +0 -61
- package/src/date-picker/date-picker.playground.ts +0 -79
- package/src/date-picker/date-picker.spec.ts +0 -71
- package/src/date-picker/date-picker.ts +0 -185
- package/src/date-picker/index.ts +0 -1
- package/src/dialog/_examples/dialog.confirmation.example.ts +0 -30
- package/src/dialog/_examples/dialog.default.example.ts +0 -30
- package/src/dialog/_examples/dialog.nested.example.ts +0 -86
- package/src/dialog/_examples/dialog.scrollable.example.ts +0 -30
- package/src/dialog/_examples/dialog.usage.example.ts +0 -57
- package/src/dialog/_examples/dialog.with-form.example.ts +0 -48
- package/src/dialog/_examples/index.ts +0 -8
- package/src/dialog/dialog.css +0 -56
- package/src/dialog/dialog.playground.ts +0 -136
- package/src/dialog/dialog.ts +0 -82
- package/src/dialog/index.ts +0 -1
- package/src/divider/_examples/divider.example.ts +0 -27
- package/src/divider/_examples/divider.sizes.example.ts +0 -33
- package/src/divider/_examples/divider.structural.example.ts +0 -55
- package/src/divider/_examples/divider.usage.example.ts +0 -48
- package/src/divider/_examples/divider.variants.example.ts +0 -33
- package/src/divider/_examples/divider.vertical.example.ts +0 -38
- package/src/divider/_examples/divider.with-content.example.ts +0 -38
- package/src/divider/_examples/index.ts +0 -9
- package/src/divider/divider.css +0 -93
- package/src/divider/divider.playground.ts +0 -97
- package/src/divider/divider.spec.ts +0 -207
- package/src/divider/divider.ts +0 -220
- package/src/divider/index.ts +0 -1
- package/src/drawer/_examples/drawer.example.ts +0 -30
- package/src/drawer/_examples/drawer.modal-vs-non-modal.example.ts +0 -27
- package/src/drawer/_examples/drawer.scrollable.example.ts +0 -30
- package/src/drawer/_examples/drawer.sides.example.ts +0 -32
- package/src/drawer/_examples/drawer.usage.example.ts +0 -56
- package/src/drawer/_examples/drawer.with-form.example.ts +0 -48
- package/src/drawer/_examples/index.ts +0 -8
- package/src/drawer/drawer.css +0 -130
- package/src/drawer/drawer.playground.ts +0 -107
- package/src/drawer/drawer.spec.ts +0 -216
- package/src/drawer/drawer.ts +0 -85
- package/src/drawer/index.ts +0 -1
- package/src/dropdown-menu/_examples/dropdown-menu.disabled.example.ts +0 -19
- package/src/dropdown-menu/_examples/dropdown-menu.example.ts +0 -20
- package/src/dropdown-menu/_examples/dropdown-menu.shortcuts.example.ts +0 -31
- package/src/dropdown-menu/_examples/dropdown-menu.sides.example.ts +0 -18
- package/src/dropdown-menu/_examples/dropdown-menu.usage.example.ts +0 -56
- package/src/dropdown-menu/_examples/dropdown-menu.with-icons.example.ts +0 -31
- package/src/dropdown-menu/_examples/dropdown-menu.with-separator.example.ts +0 -41
- package/src/dropdown-menu/_examples/index.ts +0 -9
- package/src/dropdown-menu/dropdown-menu.css +0 -108
- package/src/dropdown-menu/dropdown-menu.playground.ts +0 -109
- package/src/dropdown-menu/dropdown-menu.spec.ts +0 -5
- package/src/dropdown-menu/dropdown-menu.ts +0 -128
- package/src/dropdown-menu/index.ts +0 -1
- package/src/empty-state/_examples/empty-state.error.example.ts +0 -63
- package/src/empty-state/_examples/empty-state.example.ts +0 -59
- package/src/empty-state/_examples/empty-state.search.example.ts +0 -82
- package/src/empty-state/_examples/empty-state.sizes.example.ts +0 -76
- package/src/empty-state/_examples/empty-state.usage.example.ts +0 -66
- package/src/empty-state/_examples/empty-state.with-actions.example.ts +0 -68
- package/src/empty-state/_examples/index.ts +0 -8
- package/src/empty-state/empty-state.css +0 -114
- package/src/empty-state/empty-state.playground.ts +0 -87
- package/src/empty-state/empty-state.spec.ts +0 -211
- package/src/empty-state/empty-state.ts +0 -276
- package/src/empty-state/index.ts +0 -1
- package/src/example-components.ts +0 -396
- package/src/field/_examples/field.disabled.example.ts +0 -49
- package/src/field/_examples/field.example.ts +0 -51
- package/src/field/_examples/field.required.example.ts +0 -46
- package/src/field/_examples/field.with-error.example.ts +0 -73
- package/src/field/_examples/field.with-prefix-suffix.example.ts +0 -63
- package/src/field/_examples/index.ts +0 -7
- package/src/field/field.css +0 -138
- package/src/field/field.playground.ts +0 -108
- package/src/field/field.spec.ts +0 -132
- package/src/field/field.ts +0 -232
- package/src/field/field.usage.example.ts +0 -63
- package/src/field/index.ts +0 -7
- package/src/file-upload/_examples/file-upload.dropzone.example.ts +0 -32
- package/src/file-upload/_examples/file-upload.example.ts +0 -29
- package/src/file-upload/_examples/file-upload.image-preview.example.ts +0 -31
- package/src/file-upload/_examples/file-upload.multiple.example.ts +0 -23
- package/src/file-upload/_examples/file-upload.with-progress.example.ts +0 -59
- package/src/file-upload/_examples/index.ts +0 -7
- package/src/file-upload/file-upload.css +0 -207
- package/src/file-upload/file-upload.playground.ts +0 -84
- package/src/file-upload/file-upload.spec.ts +0 -94
- package/src/file-upload/file-upload.ts +0 -301
- package/src/file-upload/file-upload.usage.example.ts +0 -45
- package/src/file-upload/index.ts +0 -1
- package/src/form/_examples/form.async-submit.example.ts +0 -72
- package/src/form/_examples/form.compound.example.ts +0 -93
- package/src/form/_examples/form.example.ts +0 -70
- package/src/form/_examples/form.validation.example.ts +0 -67
- package/src/form/_examples/index.ts +0 -6
- package/src/form/form.css +0 -63
- package/src/form/form.playground.ts +0 -145
- package/src/form/form.spec.ts +0 -96
- package/src/form/form.ts +0 -216
- package/src/form/form.usage.example.ts +0 -63
- package/src/form/index.ts +0 -5
- package/src/icon/_examples/icon.gallery.example.ts +0 -199
- package/src/icon/_examples/icon.usage.example.ts +0 -46
- package/src/icon/_examples/index.ts +0 -4
- package/src/icon/icon.playground.ts +0 -63
- package/src/icon/index.ts +0 -5
- package/src/icon/lucide/icon-names.generated.ts +0 -1708
- package/src/icon/lucide/icon-names.ts +0 -18
- package/src/icon/lucide/index.ts +0 -2
- package/src/icon/lucide/provide-lucide-icons.ts +0 -96
- package/src/input/_examples/index.ts +0 -4
- package/src/input/_examples/input.color.example.ts +0 -33
- package/src/input/_examples/input.example.ts +0 -22
- package/src/input/index.ts +0 -1
- package/src/input/input.css +0 -70
- package/src/input/input.playground.ts +0 -79
- package/src/input/input.spec.ts +0 -98
- package/src/input/input.ts +0 -158
- package/src/input/input.usage.example.ts +0 -40
- package/src/input-group/_examples/index.ts +0 -7
- package/src/input-group/_examples/input-group.button.example.ts +0 -43
- package/src/input-group/_examples/input-group.example.ts +0 -39
- package/src/input-group/_examples/input-group.icon.example.ts +0 -49
- package/src/input-group/_examples/input-group.url.example.ts +0 -36
- package/src/input-group/_examples/input-group.variants.example.ts +0 -39
- package/src/input-group/index.ts +0 -1
- package/src/input-group/input-group.css +0 -125
- package/src/input-group/input-group.playground.ts +0 -90
- package/src/input-group/input-group.ts +0 -142
- package/src/input-group/input-group.usage.example.ts +0 -47
- package/src/input-mask/_examples/index.ts +0 -8
- package/src/input-mask/_examples/input-mask.credit-card.example.ts +0 -90
- package/src/input-mask/_examples/input-mask.custom-tokens.example.ts +0 -87
- package/src/input-mask/_examples/input-mask.date.example.ts +0 -61
- package/src/input-mask/_examples/input-mask.example.ts +0 -61
- package/src/input-mask/_examples/input-mask.usage.example.ts +0 -44
- package/src/input-mask/_examples/input-mask.validation.example.ts +0 -80
- package/src/input-mask/index.ts +0 -9
- package/src/input-mask/input-mask.css +0 -39
- package/src/input-mask/input-mask.playground.ts +0 -79
- package/src/input-mask/input-mask.ts +0 -130
- package/src/input-otp/_examples/index.ts +0 -8
- package/src/input-otp/_examples/input-otp.autosubmit.example.ts +0 -71
- package/src/input-otp/_examples/input-otp.example.ts +0 -47
- package/src/input-otp/_examples/input-otp.lengths.example.ts +0 -67
- package/src/input-otp/_examples/input-otp.masked.example.ts +0 -46
- package/src/input-otp/_examples/input-otp.reactive.example.ts +0 -58
- package/src/input-otp/_examples/input-otp.separator.example.ts +0 -49
- package/src/input-otp/index.ts +0 -1
- package/src/input-otp/input-otp.css +0 -87
- package/src/input-otp/input-otp.playground.ts +0 -107
- package/src/input-otp/input-otp.ts +0 -244
- package/src/input-otp/input-otp.usage.example.ts +0 -45
- package/src/kbd/_examples/index.ts +0 -6
- package/src/kbd/_examples/kbd.combo.example.ts +0 -24
- package/src/kbd/_examples/kbd.example.ts +0 -22
- package/src/kbd/_examples/kbd.in-tooltip.example.ts +0 -43
- package/src/kbd/_examples/kbd.sizes.example.ts +0 -31
- package/src/kbd/index.ts +0 -1
- package/src/kbd/kbd.css +0 -67
- package/src/kbd/kbd.playground.ts +0 -51
- package/src/kbd/kbd.spec.ts +0 -123
- package/src/kbd/kbd.ts +0 -123
- package/src/kbd/kbd.usage.example.ts +0 -38
- package/src/link/_examples/index.ts +0 -8
- package/src/link/_examples/link.disabled.example.ts +0 -23
- package/src/link/_examples/link.example.ts +0 -26
- package/src/link/_examples/link.external.example.ts +0 -33
- package/src/link/_examples/link.in-prose.example.ts +0 -36
- package/src/link/_examples/link.sizes.example.ts +0 -28
- package/src/link/_examples/link.variants.example.ts +0 -25
- package/src/link/index.ts +0 -1
- package/src/link/link.css +0 -104
- package/src/link/link.playground.ts +0 -98
- package/src/link/link.spec.ts +0 -146
- package/src/link/link.ts +0 -133
- package/src/link/link.usage.example.ts +0 -37
- package/src/list/_examples/index.ts +0 -7
- package/src/list/_examples/list.divided.example.ts +0 -32
- package/src/list/_examples/list.example.ts +0 -31
- package/src/list/_examples/list.interactive.example.ts +0 -51
- package/src/list/_examples/list.nav.example.ts +0 -44
- package/src/list/_examples/list.with-icons.example.ts +0 -97
- package/src/list/index.ts +0 -1
- package/src/list/list.css +0 -166
- package/src/list/list.playground.ts +0 -90
- package/src/list/list.spec.ts +0 -121
- package/src/list/list.ts +0 -227
- package/src/list/list.usage.example.ts +0 -45
- package/src/menubar/_examples/index.ts +0 -6
- package/src/menubar/_examples/menubar.disabled-item.example.ts +0 -23
- package/src/menubar/_examples/menubar.example.ts +0 -22
- package/src/menubar/_examples/menubar.with-shortcuts.example.ts +0 -33
- package/src/menubar/_examples/menubar.with-submenu.example.ts +0 -76
- package/src/menubar/index.ts +0 -1
- package/src/menubar/menubar.css +0 -62
- package/src/menubar/menubar.playground.ts +0 -96
- package/src/menubar/menubar.ts +0 -160
- package/src/menubar/menubar.usage.example.ts +0 -33
- package/src/number-input/_examples/index.ts +0 -7
- package/src/number-input/_examples/number-input.currency.example.ts +0 -35
- package/src/number-input/_examples/number-input.decimal.example.ts +0 -34
- package/src/number-input/_examples/number-input.example.ts +0 -24
- package/src/number-input/_examples/number-input.min-max.example.ts +0 -33
- package/src/number-input/_examples/number-input.with-stepper.example.ts +0 -45
- package/src/number-input/index.ts +0 -1
- package/src/number-input/number-input.css +0 -115
- package/src/number-input/number-input.playground.ts +0 -92
- package/src/number-input/number-input.spec.ts +0 -102
- package/src/number-input/number-input.ts +0 -212
- package/src/number-input/number-input.usage.example.ts +0 -73
- package/src/overlay/overlay.css +0 -32
- package/src/overlay-badge/_examples/index.ts +0 -7
- package/src/overlay-badge/_examples/overlay-badge.described.example.ts +0 -36
- package/src/overlay-badge/_examples/overlay-badge.dot.example.ts +0 -28
- package/src/overlay-badge/_examples/overlay-badge.example.ts +0 -34
- package/src/overlay-badge/_examples/overlay-badge.on-avatar.example.ts +0 -38
- package/src/overlay-badge/_examples/overlay-badge.positions.example.ts +0 -39
- package/src/overlay-badge/index.ts +0 -1
- package/src/overlay-badge/overlay-badge.css +0 -118
- package/src/overlay-badge/overlay-badge.playground.ts +0 -92
- package/src/overlay-badge/overlay-badge.spec.ts +0 -174
- package/src/overlay-badge/overlay-badge.ts +0 -232
- package/src/overlay-badge/overlay-badge.usage.example.ts +0 -44
- package/src/pagination/_examples/index.ts +0 -7
- package/src/pagination/_examples/pagination.boundaries.example.ts +0 -56
- package/src/pagination/_examples/pagination.compact.example.ts +0 -42
- package/src/pagination/_examples/pagination.example.ts +0 -55
- package/src/pagination/_examples/pagination.large.example.ts +0 -54
- package/src/pagination/_examples/pagination.with-info.example.ts +0 -49
- package/src/pagination/index.ts +0 -1
- package/src/pagination/pagination.css +0 -146
- package/src/pagination/pagination.playground.ts +0 -107
- package/src/pagination/pagination.spec.ts +0 -202
- package/src/pagination/pagination.ts +0 -432
- package/src/pagination/pagination.usage.example.ts +0 -50
- package/src/password-input/_examples/index.ts +0 -6
- package/src/password-input/_examples/password-input.example.ts +0 -24
- package/src/password-input/_examples/password-input.strength.example.ts +0 -45
- package/src/password-input/_examples/password-input.toggle.example.ts +0 -43
- package/src/password-input/_examples/password-input.with-rules.example.ts +0 -78
- package/src/password-input/index.ts +0 -1
- package/src/password-input/password-input.css +0 -155
- package/src/password-input/password-input.playground.ts +0 -81
- package/src/password-input/password-input.spec.ts +0 -129
- package/src/password-input/password-input.ts +0 -254
- package/src/password-input/password-input.usage.example.ts +0 -55
- package/src/playground-types.ts +0 -47
- package/src/popover/_examples/index.ts +0 -7
- package/src/popover/_examples/popover.cancellable.example.ts +0 -20
- package/src/popover/_examples/popover.example.ts +0 -20
- package/src/popover/_examples/popover.modal.example.ts +0 -22
- package/src/popover/_examples/popover.sides.example.ts +0 -37
- package/src/popover/_examples/popover.with-form.example.ts +0 -38
- package/src/popover/index.ts +0 -1
- package/src/popover/popover.css +0 -71
- package/src/popover/popover.playground.ts +0 -86
- package/src/popover/popover.spec.ts +0 -5
- package/src/popover/popover.ts +0 -94
- package/src/popover/popover.usage.example.ts +0 -48
- package/src/progress-bar/_examples/index.ts +0 -7
- package/src/progress-bar/_examples/progress-bar.example.ts +0 -22
- package/src/progress-bar/_examples/progress-bar.indeterminate.example.ts +0 -23
- package/src/progress-bar/_examples/progress-bar.sizes.example.ts +0 -29
- package/src/progress-bar/_examples/progress-bar.variants.example.ts +0 -30
- package/src/progress-bar/_examples/progress-bar.with-label.example.ts +0 -30
- package/src/progress-bar/index.ts +0 -1
- package/src/progress-bar/progress-bar.css +0 -113
- package/src/progress-bar/progress-bar.playground.ts +0 -87
- package/src/progress-bar/progress-bar.spec.ts +0 -233
- package/src/progress-bar/progress-bar.ts +0 -155
- package/src/progress-bar/progress-bar.usage.example.ts +0 -52
- package/src/public-api.ts +0 -61
- package/src/radio/_examples/index.ts +0 -6
- package/src/radio/_examples/radio.default.example.ts +0 -26
- package/src/radio/_examples/radio.disabled.example.ts +0 -26
- package/src/radio/_examples/radio.group.example.ts +0 -27
- package/src/radio/_examples/radio.inline.example.ts +0 -26
- package/src/radio/index.ts +0 -1
- package/src/radio/radio.css +0 -58
- package/src/radio/radio.playground.ts +0 -90
- package/src/radio/radio.ts +0 -143
- package/src/radio/radio.usage.example.ts +0 -54
- package/src/select/_examples/index.ts +0 -6
- package/src/select/_examples/select.default.example.ts +0 -26
- package/src/select/_examples/select.disabled.example.ts +0 -24
- package/src/select/_examples/select.grouped.example.ts +0 -37
- package/src/select/_examples/select.placeholder.example.ts +0 -26
- package/src/select/index.ts +0 -1
- package/src/select/select.css +0 -65
- package/src/select/select.playground.ts +0 -81
- package/src/select/select.ts +0 -176
- package/src/select/select.usage.example.ts +0 -64
- package/src/skeleton/_examples/index.ts +0 -6
- package/src/skeleton/_examples/skeleton.animations.example.ts +0 -52
- package/src/skeleton/_examples/skeleton.card.example.ts +0 -68
- package/src/skeleton/_examples/skeleton.example.ts +0 -24
- package/src/skeleton/_examples/skeleton.shapes.example.ts +0 -55
- package/src/skeleton/index.ts +0 -1
- package/src/skeleton/skeleton.css +0 -111
- package/src/skeleton/skeleton.playground.ts +0 -80
- package/src/skeleton/skeleton.spec.ts +0 -126
- package/src/skeleton/skeleton.ts +0 -155
- package/src/skeleton/skeleton.usage.example.ts +0 -49
- package/src/slider/_examples/index.ts +0 -7
- package/src/slider/_examples/slider.example.ts +0 -41
- package/src/slider/_examples/slider.formatted.example.ts +0 -53
- package/src/slider/_examples/slider.range.example.ts +0 -48
- package/src/slider/_examples/slider.vertical.example.ts +0 -48
- package/src/slider/_examples/slider.with-marks.example.ts +0 -46
- package/src/slider/index.ts +0 -1
- package/src/slider/slider.css +0 -172
- package/src/slider/slider.playground.ts +0 -88
- package/src/slider/slider.spec.ts +0 -139
- package/src/slider/slider.ts +0 -246
- package/src/slider/slider.usage.example.ts +0 -68
- package/src/speed-dial/_examples/index.ts +0 -7
- package/src/speed-dial/_examples/speed-dial.directions.example.ts +0 -85
- package/src/speed-dial/_examples/speed-dial.disabled.example.ts +0 -71
- package/src/speed-dial/_examples/speed-dial.example.ts +0 -48
- package/src/speed-dial/_examples/speed-dial.usage.example.ts +0 -59
- package/src/speed-dial/_examples/speed-dial.with-tooltips.example.ts +0 -65
- package/src/speed-dial/index.ts +0 -1
- package/src/speed-dial/speed-dial.css +0 -137
- package/src/speed-dial/speed-dial.playground.ts +0 -137
- package/src/speed-dial/speed-dial.spec.ts +0 -191
- package/src/speed-dial/speed-dial.ts +0 -257
- package/src/spinner/_examples/index.ts +0 -8
- package/src/spinner/_examples/spinner.animations.example.ts +0 -54
- package/src/spinner/_examples/spinner.example.ts +0 -26
- package/src/spinner/_examples/spinner.in-button.example.ts +0 -51
- package/src/spinner/_examples/spinner.sizes.example.ts +0 -31
- package/src/spinner/_examples/spinner.usage.example.ts +0 -45
- package/src/spinner/_examples/spinner.variants.example.ts +0 -34
- package/src/spinner/index.ts +0 -1
- package/src/spinner/spinner.css +0 -161
- package/src/spinner/spinner.playground.ts +0 -68
- package/src/spinner/spinner.spec.ts +0 -184
- package/src/spinner/spinner.ts +0 -185
- package/src/stepper/_examples/index.ts +0 -8
- package/src/stepper/_examples/stepper.example.ts +0 -62
- package/src/stepper/_examples/stepper.non-linear.example.ts +0 -63
- package/src/stepper/_examples/stepper.optional-step.example.ts +0 -62
- package/src/stepper/_examples/stepper.usage.example.ts +0 -73
- package/src/stepper/_examples/stepper.vertical.example.ts +0 -66
- package/src/stepper/_examples/stepper.with-error.example.ts +0 -63
- package/src/stepper/index.ts +0 -1
- package/src/stepper/stepper.css +0 -147
- package/src/stepper/stepper.playground.ts +0 -88
- package/src/stepper/stepper.spec.ts +0 -200
- package/src/stepper/stepper.ts +0 -242
- package/src/table/_examples/index.ts +0 -23
- package/src/table/_examples/table.column-pinning.example.ts +0 -55
- package/src/table/_examples/table.column-resize.example.ts +0 -49
- package/src/table/_examples/table.column-visibility.example.ts +0 -52
- package/src/table/_examples/table.density.example.ts +0 -71
- package/src/table/_examples/table.editable.example.ts +0 -85
- package/src/table/_examples/table.empty-and-error.example.ts +0 -112
- package/src/table/_examples/table.example.ts +0 -45
- package/src/table/_examples/table.export.example.ts +0 -82
- package/src/table/_examples/table.filterable.example.ts +0 -67
- package/src/table/_examples/table.grouping.example.ts +0 -63
- package/src/table/_examples/table.keyboard.example.ts +0 -115
- package/src/table/_examples/table.master-detail.example.ts +0 -102
- package/src/table/_examples/table.persistence.example.ts +0 -85
- package/src/table/_examples/table.playground.ts +0 -154
- package/src/table/_examples/table.row-pinning.example.ts +0 -71
- package/src/table/_examples/table.selection.example.ts +0 -67
- package/src/table/_examples/table.server-mode.example.ts +0 -120
- package/src/table/_examples/table.sortable.example.ts +0 -49
- package/src/table/_examples/table.theming.example.ts +0 -64
- package/src/table/_examples/table.usage.example.ts +0 -90
- package/src/table/_examples/table.virtualized.example.ts +0 -122
- package/src/table/index.ts +0 -11
- package/src/table/table-cell-editor-outlet.ts +0 -111
- package/src/table/table-editors/boolean-editor.ts +0 -71
- package/src/table/table-editors/date-editor.ts +0 -117
- package/src/table/table-editors/editors.spec.ts +0 -147
- package/src/table/table-editors/index.ts +0 -41
- package/src/table/table-editors/number-editor.ts +0 -89
- package/src/table/table-editors/select-editor.ts +0 -107
- package/src/table/table-editors/text-editor.ts +0 -82
- package/src/table/table-export.spec.ts +0 -33
- package/src/table/table-export.ts +0 -53
- package/src/table/table-filter-outlet.ts +0 -137
- package/src/table/table-filters/date-filter.ts +0 -122
- package/src/table/table-filters/filters.css +0 -53
- package/src/table/table-filters/filters.spec.ts +0 -277
- package/src/table/table-filters/index.ts +0 -11
- package/src/table/table-filters/number-filter.ts +0 -232
- package/src/table/table-filters/select-filter.ts +0 -129
- package/src/table/table-filters/text-filter.ts +0 -110
- package/src/table/table-pagination.spec.ts +0 -118
- package/src/table/table-pagination.ts +0 -191
- package/src/table/table-side-panel.spec.ts +0 -170
- package/src/table/table-side-panel.ts +0 -263
- package/src/table/table-status-bar.spec.ts +0 -78
- package/src/table/table-status-bar.ts +0 -70
- package/src/table/table-toolbar.spec.ts +0 -180
- package/src/table/table-toolbar.ts +0 -244
- package/src/table/table-virtual.spec.ts +0 -103
- package/src/table/table-virtual.ts +0 -180
- package/src/table/table.css +0 -468
- package/src/table/table.spec.ts +0 -175
- package/src/table/table.ts +0 -1009
- package/src/tabs/_examples/index.ts +0 -8
- package/src/tabs/_examples/tabs.controlled.example.ts +0 -59
- package/src/tabs/_examples/tabs.disabled.example.ts +0 -34
- package/src/tabs/_examples/tabs.example.ts +0 -34
- package/src/tabs/_examples/tabs.manual-activation.example.ts +0 -34
- package/src/tabs/_examples/tabs.usage.example.ts +0 -43
- package/src/tabs/_examples/tabs.vertical.example.ts +0 -33
- package/src/tabs/index.ts +0 -1
- package/src/tabs/tabs.css +0 -80
- package/src/tabs/tabs.playground.ts +0 -88
- package/src/tabs/tabs.spec.ts +0 -135
- package/src/tabs/tabs.ts +0 -204
- package/src/tag/_examples/index.ts +0 -9
- package/src/tag/_examples/tag.example.ts +0 -22
- package/src/tag/_examples/tag.list.example.ts +0 -38
- package/src/tag/_examples/tag.removable.example.ts +0 -39
- package/src/tag/_examples/tag.selectable.example.ts +0 -33
- package/src/tag/_examples/tag.sizes.example.ts +0 -25
- package/src/tag/_examples/tag.usage.example.ts +0 -62
- package/src/tag/_examples/tag.variants.example.ts +0 -29
- package/src/tag/index.ts +0 -1
- package/src/tag/tag.css +0 -167
- package/src/tag/tag.playground.ts +0 -63
- package/src/tag/tag.spec.ts +0 -153
- package/src/tag/tag.ts +0 -186
- package/src/test-setup.ts +0 -5
- package/src/textarea/_examples/index.ts +0 -8
- package/src/textarea/_examples/textarea.autoresize.example.ts +0 -37
- package/src/textarea/_examples/textarea.character-count.example.ts +0 -34
- package/src/textarea/_examples/textarea.example.ts +0 -22
- package/src/textarea/_examples/textarea.no-resize.example.ts +0 -28
- package/src/textarea/_examples/textarea.usage.example.ts +0 -50
- package/src/textarea/_examples/textarea.with-field.example.ts +0 -66
- package/src/textarea/index.ts +0 -1
- package/src/textarea/textarea.css +0 -117
- package/src/textarea/textarea.playground.ts +0 -70
- package/src/textarea/textarea.spec.ts +0 -161
- package/src/textarea/textarea.ts +0 -339
- package/src/time-picker/_examples/index.ts +0 -8
- package/src/time-picker/_examples/time-picker.12-hour.example.ts +0 -24
- package/src/time-picker/_examples/time-picker.example.ts +0 -24
- package/src/time-picker/_examples/time-picker.formatted.example.ts +0 -32
- package/src/time-picker/_examples/time-picker.range.example.ts +0 -54
- package/src/time-picker/_examples/time-picker.usage.example.ts +0 -53
- package/src/time-picker/_examples/time-picker.with-seconds.example.ts +0 -24
- package/src/time-picker/index.ts +0 -1
- package/src/time-picker/time-picker.css +0 -126
- package/src/time-picker/time-picker.playground.ts +0 -72
- package/src/time-picker/time-picker.spec.ts +0 -77
- package/src/time-picker/time-picker.ts +0 -207
- package/src/toast/_examples/index.ts +0 -7
- package/src/toast/_examples/toast.default.example.ts +0 -37
- package/src/toast/_examples/toast.dismissible.example.ts +0 -38
- package/src/toast/_examples/toast.usage.example.ts +0 -57
- package/src/toast/_examples/toast.variants.example.ts +0 -43
- package/src/toast/_examples/toast.with-action.example.ts +0 -46
- package/src/toast/index.ts +0 -1
- package/src/toast/toast.css +0 -115
- package/src/toast/toast.playground.ts +0 -61
- package/src/toast/toast.ts +0 -168
- package/src/toggle/_examples/index.ts +0 -7
- package/src/toggle/_examples/toggle.checked.example.ts +0 -20
- package/src/toggle/_examples/toggle.default.example.ts +0 -20
- package/src/toggle/_examples/toggle.disabled.example.ts +0 -26
- package/src/toggle/_examples/toggle.usage.example.ts +0 -51
- package/src/toggle/_examples/toggle.with-label.example.ts +0 -30
- package/src/toggle/index.ts +0 -1
- package/src/toggle/toggle.css +0 -123
- package/src/toggle/toggle.playground.ts +0 -65
- package/src/toggle/toggle.ts +0 -113
- package/src/tooltip/_examples/index.ts +0 -9
- package/src/tooltip/_examples/tooltip.delays.example.ts +0 -16
- package/src/tooltip/_examples/tooltip.disabled.example.ts +0 -16
- package/src/tooltip/_examples/tooltip.example.ts +0 -16
- package/src/tooltip/_examples/tooltip.group.example.ts +0 -20
- package/src/tooltip/_examples/tooltip.rich.example.ts +0 -19
- package/src/tooltip/_examples/tooltip.sides.example.ts +0 -18
- package/src/tooltip/_examples/tooltip.usage.example.ts +0 -50
- package/src/tooltip/index.ts +0 -1
- package/src/tooltip/tooltip.css +0 -61
- package/src/tooltip/tooltip.playground.ts +0 -79
- package/src/tooltip/tooltip.spec.ts +0 -5
- package/src/tooltip/tooltip.ts +0 -102
- package/src/tree-select/_examples/index.ts +0 -8
- package/src/tree-select/_examples/tree-select.disabled.example.ts +0 -106
- package/src/tree-select/_examples/tree-select.example.ts +0 -65
- package/src/tree-select/_examples/tree-select.expanded.example.ts +0 -72
- package/src/tree-select/_examples/tree-select.field.example.ts +0 -77
- package/src/tree-select/_examples/tree-select.multi.example.ts +0 -73
- package/src/tree-select/_examples/tree-select.usage.example.ts +0 -85
- package/src/tree-select/index.ts +0 -1
- package/src/tree-select/tree-select.css +0 -220
- package/src/tree-select/tree-select.playground.ts +0 -83
- package/src/tree-select/tree-select.ts +0 -348
- package/src/typography/_examples/index.ts +0 -9
- package/src/typography/_examples/typography.blockquote.example.ts +0 -34
- package/src/typography/_examples/typography.code.example.ts +0 -32
- package/src/typography/_examples/typography.example.ts +0 -42
- package/src/typography/_examples/typography.lead.example.ts +0 -37
- package/src/typography/_examples/typography.muted.example.ts +0 -27
- package/src/typography/_examples/typography.truncate.example.ts +0 -41
- package/src/typography/_examples/typography.usage.example.ts +0 -44
- package/src/typography/index.ts +0 -8
- package/src/typography/typography.playground.ts +0 -101
- package/src/typography/typography.spec.ts +0 -70
- package/src/typography/typography.ts +0 -105
- package/tsconfig.lib.json +0 -25
- package/tsconfig.lib.prod.json +0 -17
- package/tsconfig.spec.json +0 -16
- package/vite.config.ts +0 -33
package/src/table/table.css
DELETED
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
/* Density + variant tokens. All spacing via --kj-base-space-*.
|
|
2
|
-
*
|
|
3
|
-
* Sizing contract: the table is container-driven. If a parent gives `<kj-table>`
|
|
4
|
-
* a fixed height (`height: 400px`, a flex/grid track, etc.) the body fills
|
|
5
|
-
* the remaining space inside the wrapper and the row-scroll happens INSIDE
|
|
6
|
-
* `.kj-table-body`. If no parent constraint is set, the table grows to its
|
|
7
|
-
* natural content height — no internal scroll. `min-height: 0` / `min-width: 0`
|
|
8
|
-
* are the magic flex pieces that let the body actually shrink past content
|
|
9
|
-
* to honour an outer constraint. The same applies for width: the wrapper
|
|
10
|
-
* fills the host's width and the body scrolls horizontally when columns
|
|
11
|
-
* overflow.
|
|
12
|
-
*/
|
|
13
|
-
:host {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
min-height: 0;
|
|
17
|
-
min-width: 0;
|
|
18
|
-
font-family: var(--kj-font-sans);
|
|
19
|
-
font-size: var(--kj-text-sm);
|
|
20
|
-
/* Default row height — predictable + virtualization-friendly. Density
|
|
21
|
-
variants below override; consumers can also write the var directly
|
|
22
|
-
(`<kj-table style="--kj-table-row-height: 2.75rem">…</kj-table>`). */
|
|
23
|
-
--kj-table-row-height: 2.25rem;
|
|
24
|
-
}
|
|
25
|
-
:host([data-density="compact"]) { --kj-table-row-height: 1.75rem; }
|
|
26
|
-
:host([data-density="comfortable"]) { --kj-table-row-height: 2.75rem; }
|
|
27
|
-
|
|
28
|
-
.kj-table-wrapper {
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
flex: 1 1 auto;
|
|
32
|
-
min-height: 0;
|
|
33
|
-
min-width: 0;
|
|
34
|
-
position: relative;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.kj-table-body {
|
|
38
|
-
position: relative;
|
|
39
|
-
overflow: auto;
|
|
40
|
-
/* Use block layout (not flex) for the body so the `<table>` keeps its
|
|
41
|
-
natural row-height behaviour. With flex, a child `<table>` stretched
|
|
42
|
-
to fill the body — that made a single row balloon to fill the entire
|
|
43
|
-
viewport when filters narrowed the result set. Block layout lets the
|
|
44
|
-
table size to its content; the body's `overflow: auto` still scrolls
|
|
45
|
-
when there are many rows, and the leftover space appears below the
|
|
46
|
-
last row when there are few. */
|
|
47
|
-
display: block;
|
|
48
|
-
flex: 1 1 auto;
|
|
49
|
-
min-height: 0;
|
|
50
|
-
min-width: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.kj-table-body > table {
|
|
54
|
-
/* Table never flex-grows; row heights stay content-driven (or row-height
|
|
55
|
-
CSS var-driven if the consumer sets `--kj-table-row-height`). */
|
|
56
|
-
min-width: 100%;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
:host th,
|
|
60
|
-
:host td {
|
|
61
|
-
height: var(--kj-table-row-height);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
:host table {
|
|
65
|
-
width: 100%;
|
|
66
|
-
border-collapse: collapse;
|
|
67
|
-
background: var(--kj-bg-surface);
|
|
68
|
-
color: var(--kj-fg-default);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
:host th,
|
|
72
|
-
:host td {
|
|
73
|
-
text-align: left;
|
|
74
|
-
padding: var(--kj-base-space-sm) var(--kj-base-space-md);
|
|
75
|
-
border-bottom: 1px solid var(--kj-border-default);
|
|
76
|
-
position: relative;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
:host th {
|
|
80
|
-
font-weight: 600;
|
|
81
|
-
background: var(--kj-bg-elevated);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/* ── Sort indicator ─────────────────────────────────────────────
|
|
85
|
-
The wrapper template renders a `<i kjIcon>` after the header label
|
|
86
|
-
when the column is sortable. CSS here just owns layout + tint:
|
|
87
|
-
- default → muted (unsorted/sortable)
|
|
88
|
-
- data-sort=… → brand primary
|
|
89
|
-
The icon sits inline so it survives the resize handle on the right
|
|
90
|
-
edge of the cell. */
|
|
91
|
-
:host th[aria-sort] {
|
|
92
|
-
user-select: none;
|
|
93
|
-
}
|
|
94
|
-
.kj-table-sort-indicator {
|
|
95
|
-
display: inline-flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
margin-inline-start: var(--kj-base-space-xs, 0.25rem);
|
|
98
|
-
color: var(--kj-fg-subtle, var(--kj-fg-muted));
|
|
99
|
-
transition: color var(--kj-transition);
|
|
100
|
-
vertical-align: middle;
|
|
101
|
-
}
|
|
102
|
-
:host th[data-sort="asc"] .kj-table-sort-indicator,
|
|
103
|
-
:host th[data-sort="desc"] .kj-table-sort-indicator {
|
|
104
|
-
color: var(--kj-fg-primary);
|
|
105
|
-
}
|
|
106
|
-
:host th[aria-sort]:hover .kj-table-sort-indicator,
|
|
107
|
-
:host th[aria-sort]:focus-visible .kj-table-sort-indicator {
|
|
108
|
-
color: var(--kj-fg-default);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
:host([data-density="compact"]) th,
|
|
112
|
-
:host([data-density="compact"]) td {
|
|
113
|
-
padding: var(--kj-base-space-xs) var(--kj-base-space-sm);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
:host([data-density="comfortable"]) th,
|
|
117
|
-
:host([data-density="comfortable"]) td {
|
|
118
|
-
padding: var(--kj-base-space-md) var(--kj-base-space-lg);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
:host([data-variant="striped"]) tbody tr:nth-child(even) td {
|
|
122
|
-
background: var(--kj-bg-elevated);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
:host([data-variant="clean"]) th,
|
|
126
|
-
:host([data-variant="clean"]) td {
|
|
127
|
-
border-bottom-color: transparent;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
:host td:focus-visible,
|
|
131
|
-
:host th:focus-visible {
|
|
132
|
-
outline: 2px solid var(--kj-border-focus);
|
|
133
|
-
outline-offset: -2px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/* Inline cell editors must NOT push the column wider than its existing
|
|
137
|
-
content. A bare `<input>` (and the styled select trigger) has an
|
|
138
|
-
intrinsic min-content width — ~20 chars from `size` for inputs, the
|
|
139
|
-
selected label for triggers — that table auto-layout uses to size the
|
|
140
|
-
column.
|
|
141
|
-
|
|
142
|
-
Trick: render an invisible "ghost" of the cell's value so the cell
|
|
143
|
-
keeps its natural content width, then lift every editor host out of
|
|
144
|
-
the in-flow stacking context with `position: absolute`. Editors use
|
|
145
|
-
`display: contents` by default — we override that while editing so
|
|
146
|
-
they actually get a box that can be positioned. */
|
|
147
|
-
:host td.kj-table-cell--editing {
|
|
148
|
-
position: relative;
|
|
149
|
-
}
|
|
150
|
-
:host td .kj-table-cell-ghost {
|
|
151
|
-
visibility: hidden;
|
|
152
|
-
white-space: pre;
|
|
153
|
-
display: inline-block;
|
|
154
|
-
pointer-events: none;
|
|
155
|
-
}
|
|
156
|
-
/* `::ng-deep` is required because the editor components are created
|
|
157
|
-
dynamically via `ViewContainerRef.createComponent` from inside the
|
|
158
|
-
`kjCellEditorOutlet` directive. Dynamic elements don't inherit the
|
|
159
|
-
parent template's emulated-encapsulation attributes, so a scoped
|
|
160
|
-
selector wouldn't match. */
|
|
161
|
-
/* `!important` is needed to override the editor / input components'
|
|
162
|
-
inline `style="display: contents"` host bindings (those win over
|
|
163
|
-
stylesheets). `::ng-deep` reaches the dynamically-created editor
|
|
164
|
-
components, which don't inherit the parent template's emulated
|
|
165
|
-
encapsulation attributes. */
|
|
166
|
-
:host td.kj-table-cell--editing ::ng-deep kj-text-editor,
|
|
167
|
-
:host td.kj-table-cell--editing ::ng-deep kj-number-editor,
|
|
168
|
-
:host td.kj-table-cell--editing ::ng-deep kj-select-editor,
|
|
169
|
-
:host td.kj-table-cell--editing ::ng-deep kj-date-editor,
|
|
170
|
-
:host td.kj-table-cell--editing ::ng-deep kj-boolean-editor {
|
|
171
|
-
position: absolute !important;
|
|
172
|
-
inset: 0 !important;
|
|
173
|
-
display: flex !important;
|
|
174
|
-
align-items: center !important;
|
|
175
|
-
padding: inherit !important;
|
|
176
|
-
background: var(--kj-bg-surface);
|
|
177
|
-
z-index: 1;
|
|
178
|
-
}
|
|
179
|
-
:host td.kj-table-cell--editing ::ng-deep kj-input,
|
|
180
|
-
:host td.kj-table-cell--editing ::ng-deep kj-number-input,
|
|
181
|
-
:host td.kj-table-cell--editing ::ng-deep kj-select {
|
|
182
|
-
display: flex !important;
|
|
183
|
-
width: 100% !important;
|
|
184
|
-
min-width: 0 !important;
|
|
185
|
-
box-sizing: border-box;
|
|
186
|
-
}
|
|
187
|
-
:host td.kj-table-cell--editing ::ng-deep input,
|
|
188
|
-
:host td.kj-table-cell--editing ::ng-deep .kj-select-trigger {
|
|
189
|
-
width: 100% !important;
|
|
190
|
-
min-width: 0 !important;
|
|
191
|
-
box-sizing: border-box;
|
|
192
|
-
}
|
|
193
|
-
/* The anchor span itself contributes nothing to layout — the directive
|
|
194
|
-
creates the editor as its NEXT SIBLING in the cell, not as a child. */
|
|
195
|
-
:host td .kj-table-editor-anchor {
|
|
196
|
-
display: none;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/* Selected rows get a brand-accent tint + a left border stripe so a
|
|
200
|
-
keyboard user can tell which row is selected at a glance, even when
|
|
201
|
-
the row is not focused. */
|
|
202
|
-
:host tr[data-selected] td {
|
|
203
|
-
background: color-mix(in oklab, var(--kj-bg-primary, var(--kj-bg-accent, currentColor)) 12%, var(--kj-bg-surface));
|
|
204
|
-
}
|
|
205
|
-
:host tr[data-selected] td:first-child {
|
|
206
|
-
box-shadow: inset 3px 0 0 0 var(--kj-bg-primary, var(--kj-fg-primary));
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/* ── Pinned columns ─────────────────────────────────────────────
|
|
210
|
-
Sticky positioning + a visible boundary (border + soft shadow) so the
|
|
211
|
-
pinned edge reads as a separate region from the scrolling middle. The
|
|
212
|
-
:host([data-variant]) toggles don't affect pin borders — they're a
|
|
213
|
-
structural cue, not a visual variant. */
|
|
214
|
-
:host td[data-pin="left"],
|
|
215
|
-
:host th[data-pin="left"] {
|
|
216
|
-
position: sticky;
|
|
217
|
-
left: 0;
|
|
218
|
-
z-index: 1;
|
|
219
|
-
background: var(--kj-bg-surface);
|
|
220
|
-
}
|
|
221
|
-
:host td[data-pin="right"],
|
|
222
|
-
:host th[data-pin="right"] {
|
|
223
|
-
position: sticky;
|
|
224
|
-
right: 0;
|
|
225
|
-
z-index: 1;
|
|
226
|
-
background: var(--kj-bg-surface);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/* Boundary indicator on the inside edge of each pinned region.
|
|
230
|
-
|
|
231
|
-
Last LEFT-pinned cell: a `[data-pin="left"]` whose next sibling is NOT
|
|
232
|
-
also left-pinned — uses `:not(:has(+ ...))`.
|
|
233
|
-
|
|
234
|
-
First RIGHT-pinned cell: a `[data-pin="right"]` whose previous sibling
|
|
235
|
-
is NOT right-pinned — uses the `:not([..]) + [data-pin="right"]` pattern.
|
|
236
|
-
|
|
237
|
-
Both are purely declarative; no JS bookkeeping. */
|
|
238
|
-
:host td[data-pin="left"]:not(:has(+ td[data-pin="left"])),
|
|
239
|
-
:host th[data-pin="left"]:not(:has(+ th[data-pin="left"])) {
|
|
240
|
-
border-right: 1px solid var(--kj-border-strong, var(--kj-border-default));
|
|
241
|
-
box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.25);
|
|
242
|
-
}
|
|
243
|
-
:host tr > :not([data-pin="right"]) + td[data-pin="right"],
|
|
244
|
-
:host tr > :not([data-pin="right"]) + th[data-pin="right"] {
|
|
245
|
-
border-left: 1px solid var(--kj-border-strong, var(--kj-border-default));
|
|
246
|
-
box-shadow: -4px 0 6px -4px rgba(0, 0, 0, 0.25);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/* Striped variant: pinned cells still get the alternate background so the
|
|
250
|
-
sticky cell doesn't visually float over a coloured row beneath it. */
|
|
251
|
-
:host([data-variant="striped"]) tbody tr:nth-child(even) td[data-pin] {
|
|
252
|
-
background: var(--kj-bg-elevated);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/* ── Resize handle ──────────────────────────────────────────────
|
|
256
|
-
Always-visible thin track on the right edge of each `<th>`; widens
|
|
257
|
-
and brightens to the focus color on hover/focus so users can tell
|
|
258
|
-
it's draggable. Hidden when no resize is enabled (the host doesn't
|
|
259
|
-
render the element). */
|
|
260
|
-
.kj-table-resize-handle {
|
|
261
|
-
position: absolute;
|
|
262
|
-
top: 25%;
|
|
263
|
-
right: 0;
|
|
264
|
-
width: 6px;
|
|
265
|
-
height: 50%;
|
|
266
|
-
cursor: col-resize;
|
|
267
|
-
user-select: none;
|
|
268
|
-
touch-action: none;
|
|
269
|
-
background: transparent;
|
|
270
|
-
border-right: 2px solid var(--kj-border-strong, var(--kj-border-default));
|
|
271
|
-
transition: border-color var(--kj-transition), background var(--kj-transition), width var(--kj-transition);
|
|
272
|
-
}
|
|
273
|
-
.kj-table-resize-handle:hover,
|
|
274
|
-
.kj-table-resize-handle:focus-visible {
|
|
275
|
-
border-right-color: var(--kj-border-focus);
|
|
276
|
-
background: color-mix(in srgb, var(--kj-border-focus) 20%, transparent);
|
|
277
|
-
width: 8px;
|
|
278
|
-
outline: none;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/* ── Resize preview guide ───────────────────────────────────────
|
|
282
|
-
While a column is being resized (TanStack `onEnd` mode), the
|
|
283
|
-
wrapper sets `data-resizing` on the header and pipes the live
|
|
284
|
-
cursor delta into `--kj-resize-delta`. The handle becomes a
|
|
285
|
-
tall vertical line anchored to the column's current right edge
|
|
286
|
-
and translated by the delta — it visually tracks where the new
|
|
287
|
-
edge will land before the column actually reflows on mouseup.
|
|
288
|
-
|
|
289
|
-
`top: 0; height: 9999px` overflows the `<th>`; the surrounding
|
|
290
|
-
`.kj-table-body` has `overflow: auto`, so the visible portion
|
|
291
|
-
is naturally clipped to the table's height. */
|
|
292
|
-
:host th[data-resizing] .kj-table-resize-handle {
|
|
293
|
-
top: 0;
|
|
294
|
-
height: 9999px;
|
|
295
|
-
width: 0;
|
|
296
|
-
background: transparent;
|
|
297
|
-
border-right: 2px solid var(--kj-border-focus, var(--kj-bg-primary));
|
|
298
|
-
transform: translateX(var(--kj-resize-delta, 0px));
|
|
299
|
-
pointer-events: none;
|
|
300
|
-
z-index: 3;
|
|
301
|
-
transition: none;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
/* ── Selection column ───────────────────────────────────────────
|
|
305
|
-
Leading checkbox column auto-rendered when `kjSelectionMode` is
|
|
306
|
-
`'single'` or `'multi'`. Narrow fixed-width column so the row
|
|
307
|
-
data starts at a predictable horizontal position. */
|
|
308
|
-
:host th.kj-table-select-cell,
|
|
309
|
-
:host td.kj-table-select-cell {
|
|
310
|
-
width: 2.5rem;
|
|
311
|
-
padding-inline: var(--kj-base-space-sm);
|
|
312
|
-
text-align: center;
|
|
313
|
-
vertical-align: middle;
|
|
314
|
-
}
|
|
315
|
-
.kj-table-select-cell kj-checkbox {
|
|
316
|
-
display: inline-flex;
|
|
317
|
-
align-items: center;
|
|
318
|
-
justify-content: center;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/* ── Filter row beneath the header row ──────────────────────────
|
|
322
|
-
Each cell hosts a styled filter input (text / number / date / select)
|
|
323
|
-
mounted by the wrapper. We keep the row visually distinct from headers
|
|
324
|
-
with a lighter background + thinner padding, and let the input fill
|
|
325
|
-
the cell width so filters feel column-anchored. */
|
|
326
|
-
.kj-table-filter-row > th {
|
|
327
|
-
font-weight: 400;
|
|
328
|
-
background: var(--kj-bg-surface);
|
|
329
|
-
border-top: 1px solid var(--kj-border-muted, var(--kj-border-default));
|
|
330
|
-
}
|
|
331
|
-
.kj-table-filter-cell {
|
|
332
|
-
padding-top: var(--kj-base-space-xs);
|
|
333
|
-
padding-bottom: var(--kj-base-space-xs);
|
|
334
|
-
vertical-align: middle;
|
|
335
|
-
}
|
|
336
|
-
.kj-table-filter-cell .kj-table-filter-anchor + *,
|
|
337
|
-
.kj-table-filter-cell kj-input,
|
|
338
|
-
.kj-table-filter-cell kj-number-input,
|
|
339
|
-
.kj-table-filter-cell kj-date-picker,
|
|
340
|
-
.kj-table-filter-cell kj-select {
|
|
341
|
-
width: 100%;
|
|
342
|
-
}
|
|
343
|
-
.kj-table-filter-anchor {
|
|
344
|
-
display: block;
|
|
345
|
-
width: 100%;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/* Inline editors get the same compact xs treatment as filter cells. The
|
|
349
|
-
filter inputs already bind `kjSize="xs"` themselves; this rule covers the
|
|
350
|
-
editor anchors that mount unsized primitives at runtime. */
|
|
351
|
-
:host .kj-table-editor-anchor .kj-input,
|
|
352
|
-
:host .kj-table-editor-anchor .kj-select {
|
|
353
|
-
--kj-input-height: 1.75rem;
|
|
354
|
-
--kj-input-font-size: var(--kj-text-xs);
|
|
355
|
-
--kj-input-padding-x: var(--kj-base-space-sm);
|
|
356
|
-
--kj-input-padding-y: 0;
|
|
357
|
-
--kj-input-radius: var(--kj-radius-selector);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/* Empty / error / loading panes. */
|
|
361
|
-
.kj-table-empty,
|
|
362
|
-
.kj-table-error,
|
|
363
|
-
.kj-table-loading {
|
|
364
|
-
display: flex;
|
|
365
|
-
align-items: center;
|
|
366
|
-
justify-content: center;
|
|
367
|
-
padding: var(--kj-base-space-lg);
|
|
368
|
-
color: var(--kj-fg-muted);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
/* ── Loading state ──────────────────────────────────────────────
|
|
372
|
-
Two modes:
|
|
373
|
-
- Initial load (`data-has-rows="false"`): full-pane overlay with
|
|
374
|
-
a centered "Loading…" message. The user has nothing to look at
|
|
375
|
-
yet so we cover the empty body.
|
|
376
|
-
- Subsequent reloads (`data-has-rows="true"`): a slim 2px brand
|
|
377
|
-
stripe at the top of the body. The stale rows stay readable
|
|
378
|
-
and pointer events keep working — the user can sort/scroll/
|
|
379
|
-
paginate again while the refresh is in flight. */
|
|
380
|
-
.kj-table-loading {
|
|
381
|
-
position: absolute;
|
|
382
|
-
inset: 0;
|
|
383
|
-
background: color-mix(in srgb, var(--kj-bg-surface) 70%, transparent);
|
|
384
|
-
pointer-events: none;
|
|
385
|
-
}
|
|
386
|
-
.kj-table-loading[data-has-rows] {
|
|
387
|
-
inset: 0 0 auto 0;
|
|
388
|
-
height: 2px;
|
|
389
|
-
background: var(--kj-bg-primary);
|
|
390
|
-
padding: 0;
|
|
391
|
-
animation: kj-table-loading-pulse 1.4s ease-in-out infinite;
|
|
392
|
-
}
|
|
393
|
-
.kj-table-loading[data-has-rows] .kj-table-loading-fallback,
|
|
394
|
-
.kj-table-loading[data-has-rows] ::ng-deep [kjLoading] {
|
|
395
|
-
display: none;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
@keyframes kj-table-loading-pulse {
|
|
399
|
-
0%, 100% { opacity: 0.55; }
|
|
400
|
-
50% { opacity: 1; }
|
|
401
|
-
}
|
|
402
|
-
.kj-table-error {
|
|
403
|
-
color: var(--kj-fg-error, var(--kj-fg-default));
|
|
404
|
-
}
|
|
405
|
-
.kj-table-loading-fallback {
|
|
406
|
-
font-size: var(--kj-text-sm);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
/* Row expansion. */
|
|
410
|
-
.kj-table-expansion-row > td {
|
|
411
|
-
background: var(--kj-bg-elevated);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/* ── Pinned-row tbody segments ──────────────────────────────────
|
|
415
|
-
Use the brand accent so pinned rows visually pop out of the center
|
|
416
|
-
body; sticky positioning lets them stay anchored at the top/bottom
|
|
417
|
-
even when the body scrolls. */
|
|
418
|
-
.kj-table-tbody-pinned[data-pin="top"] > tr > td {
|
|
419
|
-
background: var(--kj-bg-elevated);
|
|
420
|
-
border-bottom: 2px solid var(--kj-border-primary, var(--kj-border-strong, var(--kj-border-default)));
|
|
421
|
-
box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.25);
|
|
422
|
-
position: sticky;
|
|
423
|
-
top: 0;
|
|
424
|
-
z-index: 2;
|
|
425
|
-
}
|
|
426
|
-
.kj-table-tbody-pinned[data-pin="bottom"] > tr > td {
|
|
427
|
-
background: var(--kj-bg-elevated);
|
|
428
|
-
border-top: 2px solid var(--kj-border-primary, var(--kj-border-strong, var(--kj-border-default)));
|
|
429
|
-
box-shadow: 0 -4px 6px -4px rgba(0, 0, 0, 0.25);
|
|
430
|
-
position: sticky;
|
|
431
|
-
bottom: 0;
|
|
432
|
-
z-index: 2;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
/* ── Grouping row ───────────────────────────────────────────────
|
|
436
|
-
Rows where a column is grouped show a toggle-able header chip on the
|
|
437
|
-
grouped cell + count of subRows. */
|
|
438
|
-
.kj-table-group-toggle {
|
|
439
|
-
display: inline-flex;
|
|
440
|
-
align-items: center;
|
|
441
|
-
gap: var(--kj-base-space-xs, 0.25rem);
|
|
442
|
-
background: transparent;
|
|
443
|
-
border: 0;
|
|
444
|
-
padding: 0;
|
|
445
|
-
font: inherit;
|
|
446
|
-
color: inherit;
|
|
447
|
-
cursor: pointer;
|
|
448
|
-
}
|
|
449
|
-
.kj-table-group-toggle__chevron {
|
|
450
|
-
display: inline-block;
|
|
451
|
-
width: 0.75rem;
|
|
452
|
-
font-family: var(--kj-font-mono);
|
|
453
|
-
color: var(--kj-fg-muted);
|
|
454
|
-
transition: transform var(--kj-transition);
|
|
455
|
-
}
|
|
456
|
-
.kj-table-group-toggle[aria-expanded="true"] .kj-table-group-toggle__chevron {
|
|
457
|
-
transform: rotate(90deg);
|
|
458
|
-
}
|
|
459
|
-
.kj-table-group-toggle__count {
|
|
460
|
-
margin-inline-start: var(--kj-base-space-xs, 0.25rem);
|
|
461
|
-
font-size: 0.75em;
|
|
462
|
-
color: var(--kj-fg-muted);
|
|
463
|
-
font-variant-numeric: tabular-nums;
|
|
464
|
-
}
|
|
465
|
-
:host tbody tr[data-row-grouped] td {
|
|
466
|
-
background: var(--kj-bg-elevated);
|
|
467
|
-
font-weight: 600;
|
|
468
|
-
}
|
package/src/table/table.spec.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
-
import { render } from '@testing-library/angular';
|
|
3
|
-
import { axe, toHaveNoViolations } from 'jest-axe';
|
|
4
|
-
import { beforeAll, describe, expect, it, vi } from 'vitest';
|
|
5
|
-
import { KjTableComponent } from './table';
|
|
6
|
-
import { KJ_TABLE_STORAGE, inMemoryAdapter, kjColumn, type KjStorageAdapter } from '@kouji-ui/core';
|
|
7
|
-
|
|
8
|
-
expect.extend(toHaveNoViolations);
|
|
9
|
-
|
|
10
|
-
// jsdom shims for the virtualizer (used by table when virtualization is on).
|
|
11
|
-
class StubResizeObserver {
|
|
12
|
-
observe(): void {}
|
|
13
|
-
unobserve(): void {}
|
|
14
|
-
disconnect(): void {}
|
|
15
|
-
}
|
|
16
|
-
beforeAll(() => {
|
|
17
|
-
vi.stubGlobal('ResizeObserver', StubResizeObserver);
|
|
18
|
-
Object.defineProperty(HTMLElement.prototype, 'offsetWidth', {
|
|
19
|
-
configurable: true,
|
|
20
|
-
get(): number {
|
|
21
|
-
return 400;
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(HTMLElement.prototype, 'offsetHeight', {
|
|
25
|
-
configurable: true,
|
|
26
|
-
get(): number {
|
|
27
|
-
return 200;
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
interface User {
|
|
33
|
-
id: string;
|
|
34
|
-
name: string;
|
|
35
|
-
email: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@Component({
|
|
39
|
-
standalone: true,
|
|
40
|
-
imports: [KjTableComponent],
|
|
41
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
42
|
-
template: `<kj-table [kjData]="data()" [kjColumns]="cols" />`,
|
|
43
|
-
})
|
|
44
|
-
class Host {
|
|
45
|
-
protected readonly data = signal<User[]>([{ id: '1', name: 'A', email: 'a@x' }]);
|
|
46
|
-
protected readonly cols = [
|
|
47
|
-
kjColumn<User>({ accessorKey: 'name', header: 'Name' }),
|
|
48
|
-
kjColumn<User>({ accessorKey: 'email', header: 'Email' }),
|
|
49
|
-
];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
describe('KjTableComponent', () => {
|
|
53
|
-
it('renders the data + columns', async () => {
|
|
54
|
-
const { getByText } = await render(Host);
|
|
55
|
-
expect(getByText('A')).toBeInTheDocument();
|
|
56
|
-
expect(getByText('a@x')).toBeInTheDocument();
|
|
57
|
-
expect(getByText('Name')).toBeInTheDocument();
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('host carries role="grid"', async () => {
|
|
61
|
-
const { container } = await render(Host);
|
|
62
|
-
expect(container.querySelector('[role="grid"]')).toBeTruthy();
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('default playground is axe-clean', async () => {
|
|
66
|
-
const { container } = await render(Host);
|
|
67
|
-
const results = await axe(container);
|
|
68
|
-
expect(results).toHaveNoViolations();
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
// ── Empty slot ─────────────────────────────────────────────────────────────
|
|
73
|
-
@Component({
|
|
74
|
-
standalone: true,
|
|
75
|
-
imports: [KjTableComponent],
|
|
76
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
77
|
-
template: ` <kj-table [kjData]="data" [kjColumns]="cols">
|
|
78
|
-
<div kjEmpty>No data</div>
|
|
79
|
-
</kj-table>`,
|
|
80
|
-
})
|
|
81
|
-
class EmptyHost {
|
|
82
|
-
protected readonly data: User[] = [];
|
|
83
|
-
protected readonly cols = [kjColumn<User>({ accessorKey: 'name', header: 'Name' })];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
describe('KjTableComponent — slots', () => {
|
|
87
|
-
it('renders the empty slot when data is empty', async () => {
|
|
88
|
-
const { getByText } = await render(EmptyHost);
|
|
89
|
-
expect(getByText('No data')).toBeInTheDocument();
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// ── Filter row ─────────────────────────────────────────────────────────────
|
|
94
|
-
@Component({
|
|
95
|
-
standalone: true,
|
|
96
|
-
imports: [KjTableComponent],
|
|
97
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
98
|
-
template: `<kj-table [kjData]="data" [kjColumns]="cols" [kjEnableFilters]="true" />`,
|
|
99
|
-
})
|
|
100
|
-
class FilterRowHost {
|
|
101
|
-
protected readonly data: User[] = [{ id: '1', name: 'A', email: 'a@x' }];
|
|
102
|
-
protected readonly cols = [
|
|
103
|
-
kjColumn<User>({ accessorKey: 'name', header: 'Name', kjType: 'text', kjFilterable: true }),
|
|
104
|
-
kjColumn<User>({ accessorKey: 'email', header: 'Email', kjType: 'text', kjFilterable: true }),
|
|
105
|
-
];
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
describe('KjTableComponent — filter row', () => {
|
|
109
|
-
it('renders a second header row with filter cells when kjEnableFilters=true', async () => {
|
|
110
|
-
const { container } = await render(FilterRowHost);
|
|
111
|
-
const filterRow = container.querySelector('.kj-table-filter-row');
|
|
112
|
-
expect(filterRow).toBeTruthy();
|
|
113
|
-
const anchors = container.querySelectorAll('.kj-table-filter-anchor');
|
|
114
|
-
expect(anchors.length).toBeGreaterThan(0);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
// ── getRowId ────────────────────────────────────────────────────────────────
|
|
119
|
-
@Component({
|
|
120
|
-
standalone: true,
|
|
121
|
-
imports: [KjTableComponent],
|
|
122
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
123
|
-
template: ` <kj-table [kjData]="data" [kjColumns]="cols" [kjGetRowId]="rowId" />`,
|
|
124
|
-
})
|
|
125
|
-
class GetRowIdHost {
|
|
126
|
-
protected readonly data: User[] = [
|
|
127
|
-
{ id: 'user-1', name: 'Alice', email: 'a@x' },
|
|
128
|
-
{ id: 'user-2', name: 'Bob', email: 'b@x' },
|
|
129
|
-
];
|
|
130
|
-
protected readonly cols = [kjColumn<User>({ accessorKey: 'name', header: 'Name' })];
|
|
131
|
-
protected readonly rowId = (r: User): string => r.id;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
describe('KjTableComponent — kjGetRowId', () => {
|
|
135
|
-
it('keys row selection by the user-supplied id', async () => {
|
|
136
|
-
const { fixture } = await render(GetRowIdHost);
|
|
137
|
-
const dataTable = fixture.debugElement.children[0].componentInstance as KjTableComponent<User>;
|
|
138
|
-
const tbl = dataTable.tableRef();
|
|
139
|
-
tbl.setState({ rowSelection: { 'user-1': true } });
|
|
140
|
-
fixture.detectChanges();
|
|
141
|
-
const row = tbl.table().getRow('user-1');
|
|
142
|
-
expect(row.getIsSelected()).toBe(true);
|
|
143
|
-
expect(tbl.table().getRow('user-2').getIsSelected()).toBe(false);
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
// ── kjStorageKey persistence ───────────────────────────────────────────────
|
|
148
|
-
@Component({
|
|
149
|
-
standalone: true,
|
|
150
|
-
imports: [KjTableComponent],
|
|
151
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
152
|
-
template: ` <kj-table [kjData]="data" [kjColumns]="cols" kjStorageKey="kj.test.dt" />`,
|
|
153
|
-
})
|
|
154
|
-
class StorageHost {
|
|
155
|
-
protected readonly data: User[] = [{ id: '1', name: 'A', email: 'a@x' }];
|
|
156
|
-
protected readonly cols = [kjColumn<User>({ accessorKey: 'name', header: 'Name' })];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
describe('KjTableComponent — kjStorageKey', () => {
|
|
160
|
-
it('persists state to the injected KJ_TABLE_STORAGE adapter', async () => {
|
|
161
|
-
const adapter: KjStorageAdapter = inMemoryAdapter();
|
|
162
|
-
const writeSpy = vi.spyOn(adapter, 'write');
|
|
163
|
-
const { fixture } = await render(StorageHost, {
|
|
164
|
-
providers: [{ provide: KJ_TABLE_STORAGE, useValue: adapter }],
|
|
165
|
-
});
|
|
166
|
-
const dataTable = fixture.debugElement.children[0].componentInstance as KjTableComponent<User>;
|
|
167
|
-
dataTable.tableRef().setState({ globalFilter: 'foo' });
|
|
168
|
-
fixture.detectChanges();
|
|
169
|
-
await fixture.whenStable();
|
|
170
|
-
expect(writeSpy).toHaveBeenCalled();
|
|
171
|
-
const lastCall = writeSpy.mock.calls.at(-1)!;
|
|
172
|
-
expect(lastCall[0]).toBe('kj.test.dt');
|
|
173
|
-
expect((lastCall[1] as { globalFilter: string }).globalFilter).toBe('foo');
|
|
174
|
-
});
|
|
175
|
-
});
|