@crisp-ui-kit/crisp 0.31.6 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +88 -0
- package/README.md +22 -0
- package/dist/accordion.css +13 -13
- package/dist/accordion.layered.css +23 -0
- package/dist/appshell.css +11 -11
- package/dist/appshell.layered.css +25 -0
- package/dist/authshell.css +23 -23
- package/dist/authshell.layered.css +59 -0
- package/dist/avatar.css +23 -23
- package/dist/avatar.layered.css +41 -0
- package/dist/avatargroup.css +2 -2
- package/dist/avatargroup.layered.css +7 -0
- package/dist/badge.css +31 -31
- package/dist/badge.layered.css +51 -0
- package/dist/barchart.css +15 -15
- package/dist/barchart.layered.css +25 -0
- package/dist/base.css +4 -4
- package/dist/board.css +20 -20
- package/dist/board.layered.css +34 -0
- package/dist/breadcrumb.css +8 -8
- package/dist/breadcrumb.layered.css +13 -0
- package/dist/bulkbar.css +13 -13
- package/dist/bulkbar.layered.css +23 -0
- package/dist/button.css +21 -21
- package/dist/button.layered.css +46 -0
- package/dist/callout.css +15 -15
- package/dist/callout.layered.css +18 -0
- package/dist/card.css +14 -14
- package/dist/card.layered.css +30 -0
- package/dist/checkbox.css +9 -9
- package/dist/checkbox.layered.css +21 -0
- package/dist/cjs/components/accordion/accordion.js +1 -1
- package/dist/cjs/components/accordion/accordion.recipe.js +10 -10
- package/dist/cjs/components/badge/badge.js +1 -1
- package/dist/cjs/components/badge/badge.recipe.js +1 -1
- package/dist/cjs/components/barchart/barchart.js +3 -3
- package/dist/cjs/components/barchart/barchart.recipe.js +14 -14
- package/dist/cjs/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/cjs/components/breadcrumb/breadcrumb.recipe.js +6 -6
- package/dist/cjs/components/bulkbar/bulkbar.js +2 -2
- package/dist/cjs/components/bulkbar/bulkbar.recipe.js +10 -10
- package/dist/cjs/components/callout/callout.js +1 -1
- package/dist/cjs/components/callout/callout.recipe.js +9 -9
- package/dist/cjs/components/card/card.js +3 -3
- package/dist/cjs/components/card/card.recipe.js +5 -5
- package/dist/cjs/components/columncalc/columncalc.js +1 -1
- package/dist/cjs/components/columncalc/columncalc.recipe.js +16 -9
- package/dist/cjs/components/contextmenu/contextmenu.js +4 -4
- package/dist/cjs/components/contextmenu/contextmenu.recipe.js +9 -9
- package/dist/cjs/components/datatable/datatable.js +32 -22
- package/dist/cjs/components/datatable/datatable.recipe.js +57 -57
- package/dist/cjs/components/datepicker/datepicker.js +12 -12
- package/dist/cjs/components/datepicker/datepicker.recipe.js +45 -45
- package/dist/cjs/components/datepickerfield/datepickerfield.js +2 -2
- package/dist/cjs/components/datepickerfield/datepickerfield.recipe.js +9 -9
- package/dist/cjs/components/dialog/dialog.js +5 -5
- package/dist/cjs/components/dialog/dialog.recipe.js +16 -16
- package/dist/cjs/components/donutchart/donutchart.js +1 -1
- package/dist/cjs/components/donutchart/donutchart.recipe.js +12 -12
- package/dist/cjs/components/drawer/drawer.js +3 -3
- package/dist/cjs/components/drawer/drawer.recipe.js +14 -14
- package/dist/cjs/components/emptystate/emptystate.js +1 -1
- package/dist/cjs/components/emptystate/emptystate.recipe.js +9 -9
- package/dist/cjs/components/fileupload/fileupload.js +3 -3
- package/dist/cjs/components/fileupload/fileupload.recipe.js +23 -23
- package/dist/cjs/components/formfield/formfield.js +1 -1
- package/dist/cjs/components/formfield/formfield.recipe.js +5 -5
- package/dist/cjs/components/input/input.js +1 -1
- package/dist/cjs/components/input/input.recipe.js +6 -6
- package/dist/cjs/components/linechart/linechart.js +4 -4
- package/dist/cjs/components/linechart/linechart.recipe.js +14 -14
- package/dist/cjs/components/menu/menu.js +6 -6
- package/dist/cjs/components/menu/menu.recipe.js +19 -19
- package/dist/cjs/components/multiselect/multiselect.js +5 -5
- package/dist/cjs/components/multiselect/multiselect.recipe.js +29 -29
- package/dist/cjs/components/popover/popover.js +1 -1
- package/dist/cjs/components/popover/popover.recipe.js +3 -3
- package/dist/cjs/components/progress/progress.js +2 -2
- package/dist/cjs/components/progress/progress.recipe.js +3 -3
- package/dist/cjs/components/quantitypicker/quantitypicker.js +2 -2
- package/dist/cjs/components/quantitypicker/quantitypicker.recipe.js +16 -16
- package/dist/cjs/components/radiogroup/radiogroup.js +1 -1
- package/dist/cjs/components/radiogroup/radiogroup.recipe.js +14 -14
- package/dist/cjs/components/resizablepanel/resizablepanel.js +3 -3
- package/dist/cjs/components/resizablepanel/resizablepanel.recipe.js +24 -24
- package/dist/cjs/components/segmented/segmented.js +4 -4
- package/dist/cjs/components/segmented/segmented.recipe.js +7 -7
- package/dist/cjs/components/select/select.js +3 -3
- package/dist/cjs/components/select/select.recipe.js +25 -25
- package/dist/cjs/components/slider/slider.js +2 -2
- package/dist/cjs/components/slider/slider.recipe.js +15 -15
- package/dist/cjs/components/stagebar/stagebar.js +1 -1
- package/dist/cjs/components/stagebar/stagebar.recipe.js +1 -1
- package/dist/cjs/components/statcard/statcard.js +1 -1
- package/dist/cjs/components/statcard/statcard.recipe.js +9 -9
- package/dist/cjs/components/switch/switch.js +1 -1
- package/dist/cjs/components/switch/switch.recipe.js +2 -2
- package/dist/cjs/components/table/table.js +1 -1
- package/dist/cjs/components/table/table.recipe.js +1 -1
- package/dist/cjs/components/tabletoolbar/tabletoolbar.chrome.js +65 -64
- package/dist/cjs/components/tabletoolbar/tabletoolbar.js +13 -13
- package/dist/cjs/components/tabs/tabs.js +4 -4
- package/dist/cjs/components/tabs/tabs.recipe.js +12 -12
- package/dist/cjs/components/textarea/textarea.js +2 -2
- package/dist/cjs/components/textarea/textarea.recipe.js +11 -11
- package/dist/cjs/components/toast/toast.js +4 -4
- package/dist/cjs/components/toast/toast.recipe.js +14 -14
- package/dist/cjs/components/wheelpicker/wheelpicker.js +2 -2
- package/dist/cjs/components/wheelpicker/wheelpicker.recipe.js +19 -19
- package/dist/cjs/core/namespace.js +17 -0
- package/dist/cjs/core/resolve.js +5 -3
- package/dist/cjs/product/appshell/appshell.js +2 -2
- package/dist/cjs/product/appshell/appshell.recipe.js +8 -8
- package/dist/cjs/product/authshell/authshell.js +1 -1
- package/dist/cjs/product/authshell/authshell.recipe.js +20 -20
- package/dist/cjs/product/board/board.js +3 -3
- package/dist/cjs/product/board/board.recipe.js +17 -17
- package/dist/cjs/product/command/command.js +3 -3
- package/dist/cjs/product/command/command.recipe.js +25 -25
- package/dist/cjs/product/entitycard/entitycard.js +1 -1
- package/dist/cjs/product/entitycard/entitycard.recipe.js +7 -7
- package/dist/cjs/product/flowcanvas/flowcanvas.js +5 -5
- package/dist/cjs/product/flowcanvas/flowcanvas.recipe.js +11 -11
- package/dist/cjs/product/inbox/inbox.js +1 -1
- package/dist/cjs/product/inbox/inbox.recipe.js +22 -22
- package/dist/cjs/product/listpage/listpage.js +3 -3
- package/dist/cjs/product/listpage/listpage.recipe.js +18 -18
- package/dist/cjs/product/navitem/navitem.js +1 -1
- package/dist/cjs/product/navitem/navitem.recipe.js +2 -2
- package/dist/cjs/product/onboarding/onboarding.js +1 -1
- package/dist/cjs/product/onboarding/onboarding.recipe.js +19 -19
- package/dist/cjs/product/recordpage/recordpage.js +24 -24
- package/dist/cjs/product/recordpage/recordpage.recipe.js +117 -117
- package/dist/cjs/product/recordpanel/recordpanel.js +4 -4
- package/dist/cjs/product/recordpanel/recordpanel.recipe.js +15 -15
- package/dist/cjs/product/recordstable/recordstable.js +48 -48
- package/dist/cjs/product/recordstable/recordstable.recipe.js +87 -87
- package/dist/cjs/product/recordstable/recordstable.tag.js +8 -8
- package/dist/cjs/product/richtext/richtext.js +4 -4
- package/dist/cjs/product/richtext/richtext.recipe.js +21 -21
- package/dist/cjs/product/settingssection/settingssection.js +1 -1
- package/dist/cjs/product/settingssection/settingssection.recipe.js +6 -6
- package/dist/cjs/product/settingsshell/settingsshell.js +1 -1
- package/dist/cjs/product/settingsshell/settingsshell.recipe.js +20 -20
- package/dist/cjs/product/sidebar/sidebar.js +2 -2
- package/dist/cjs/product/sidebar/sidebar.recipe.js +21 -21
- package/dist/cjs/product/tasklist/tasklist.js +2 -2
- package/dist/cjs/product/tasklist/tasklist.recipe.js +14 -14
- package/dist/cjs/product/trialbanner/trialbanner.js +1 -1
- package/dist/cjs/product/trialbanner/trialbanner.recipe.js +6 -6
- package/dist/cjs/product/viewtoggle/viewtoggle.js +1 -1
- package/dist/cjs/product/viewtoggle/viewtoggle.recipe.js +4 -4
- package/dist/cjs/tokens/contract.js +3 -2
- package/dist/columncalc.css +19 -12
- package/dist/columncalc.layered.css +35 -0
- package/dist/command.css +28 -28
- package/dist/command.layered.css +44 -0
- package/dist/contextmenu.css +12 -12
- package/dist/contextmenu.layered.css +22 -0
- package/dist/datatable.css +66 -66
- package/dist/datatable.layered.css +108 -0
- package/dist/datepicker.css +86 -86
- package/dist/datepicker.layered.css +179 -0
- package/dist/datepickerfield.css +19 -19
- package/dist/datepickerfield.layered.css +29 -0
- package/dist/dialog.css +19 -19
- package/dist/dialog.layered.css +29 -0
- package/dist/divider.css +2 -2
- package/dist/divider.layered.css +7 -0
- package/dist/donutchart.css +15 -15
- package/dist/donutchart.layered.css +26 -0
- package/dist/drawer.css +17 -17
- package/dist/drawer.layered.css +27 -0
- package/dist/emptystate.css +15 -15
- package/dist/emptystate.layered.css +22 -0
- package/dist/entitycard.css +14 -14
- package/dist/entitycard.layered.css +28 -0
- package/dist/esm/components/accordion/accordion.js +1 -1
- package/dist/esm/components/accordion/accordion.recipe.js +10 -10
- package/dist/esm/components/badge/badge.js +1 -1
- package/dist/esm/components/badge/badge.recipe.js +1 -1
- package/dist/esm/components/barchart/barchart.js +3 -3
- package/dist/esm/components/barchart/barchart.recipe.js +14 -14
- package/dist/esm/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/esm/components/breadcrumb/breadcrumb.recipe.js +6 -6
- package/dist/esm/components/bulkbar/bulkbar.js +2 -2
- package/dist/esm/components/bulkbar/bulkbar.recipe.js +10 -10
- package/dist/esm/components/callout/callout.js +1 -1
- package/dist/esm/components/callout/callout.recipe.js +9 -9
- package/dist/esm/components/card/card.js +3 -3
- package/dist/esm/components/card/card.recipe.js +5 -5
- package/dist/esm/components/columncalc/columncalc.js +1 -1
- package/dist/esm/components/columncalc/columncalc.recipe.js +16 -9
- package/dist/esm/components/contextmenu/contextmenu.js +4 -4
- package/dist/esm/components/contextmenu/contextmenu.recipe.js +9 -9
- package/dist/esm/components/datatable/datatable.js +32 -22
- package/dist/esm/components/datatable/datatable.recipe.js +57 -57
- package/dist/esm/components/datepicker/datepicker.js +12 -12
- package/dist/esm/components/datepicker/datepicker.recipe.js +45 -45
- package/dist/esm/components/datepickerfield/datepickerfield.js +2 -2
- package/dist/esm/components/datepickerfield/datepickerfield.recipe.js +9 -9
- package/dist/esm/components/dialog/dialog.js +5 -5
- package/dist/esm/components/dialog/dialog.recipe.js +16 -16
- package/dist/esm/components/donutchart/donutchart.js +1 -1
- package/dist/esm/components/donutchart/donutchart.recipe.js +12 -12
- package/dist/esm/components/drawer/drawer.js +3 -3
- package/dist/esm/components/drawer/drawer.recipe.js +14 -14
- package/dist/esm/components/emptystate/emptystate.js +1 -1
- package/dist/esm/components/emptystate/emptystate.recipe.js +9 -9
- package/dist/esm/components/fileupload/fileupload.js +3 -3
- package/dist/esm/components/fileupload/fileupload.recipe.js +23 -23
- package/dist/esm/components/formfield/formfield.js +1 -1
- package/dist/esm/components/formfield/formfield.recipe.js +5 -5
- package/dist/esm/components/input/input.js +1 -1
- package/dist/esm/components/input/input.recipe.js +6 -6
- package/dist/esm/components/linechart/linechart.js +4 -4
- package/dist/esm/components/linechart/linechart.recipe.js +14 -14
- package/dist/esm/components/menu/menu.js +6 -6
- package/dist/esm/components/menu/menu.recipe.js +19 -19
- package/dist/esm/components/multiselect/multiselect.js +5 -5
- package/dist/esm/components/multiselect/multiselect.recipe.js +29 -29
- package/dist/esm/components/popover/popover.js +1 -1
- package/dist/esm/components/popover/popover.recipe.js +3 -3
- package/dist/esm/components/progress/progress.js +2 -2
- package/dist/esm/components/progress/progress.recipe.js +3 -3
- package/dist/esm/components/quantitypicker/quantitypicker.js +2 -2
- package/dist/esm/components/quantitypicker/quantitypicker.recipe.js +16 -16
- package/dist/esm/components/radiogroup/radiogroup.js +1 -1
- package/dist/esm/components/radiogroup/radiogroup.recipe.js +14 -14
- package/dist/esm/components/resizablepanel/resizablepanel.js +3 -3
- package/dist/esm/components/resizablepanel/resizablepanel.recipe.js +24 -24
- package/dist/esm/components/segmented/segmented.js +4 -4
- package/dist/esm/components/segmented/segmented.recipe.js +7 -7
- package/dist/esm/components/select/select.js +3 -3
- package/dist/esm/components/select/select.recipe.js +25 -25
- package/dist/esm/components/slider/slider.js +2 -2
- package/dist/esm/components/slider/slider.recipe.js +15 -15
- package/dist/esm/components/stagebar/stagebar.js +1 -1
- package/dist/esm/components/stagebar/stagebar.recipe.js +1 -1
- package/dist/esm/components/statcard/statcard.js +1 -1
- package/dist/esm/components/statcard/statcard.recipe.js +9 -9
- package/dist/esm/components/switch/switch.js +1 -1
- package/dist/esm/components/switch/switch.recipe.js +2 -2
- package/dist/esm/components/table/table.js +1 -1
- package/dist/esm/components/table/table.recipe.js +1 -1
- package/dist/esm/components/tabletoolbar/tabletoolbar.chrome.js +65 -64
- package/dist/esm/components/tabletoolbar/tabletoolbar.js +13 -13
- package/dist/esm/components/tabs/tabs.js +4 -4
- package/dist/esm/components/tabs/tabs.recipe.js +12 -12
- package/dist/esm/components/textarea/textarea.js +2 -2
- package/dist/esm/components/textarea/textarea.recipe.js +11 -11
- package/dist/esm/components/toast/toast.js +4 -4
- package/dist/esm/components/toast/toast.recipe.js +14 -14
- package/dist/esm/components/wheelpicker/wheelpicker.js +2 -2
- package/dist/esm/components/wheelpicker/wheelpicker.recipe.js +19 -19
- package/dist/esm/core/namespace.js +14 -0
- package/dist/esm/core/resolve.js +5 -3
- package/dist/esm/product/appshell/appshell.js +2 -2
- package/dist/esm/product/appshell/appshell.recipe.js +8 -8
- package/dist/esm/product/authshell/authshell.js +1 -1
- package/dist/esm/product/authshell/authshell.recipe.js +20 -20
- package/dist/esm/product/board/board.js +3 -3
- package/dist/esm/product/board/board.recipe.js +17 -17
- package/dist/esm/product/command/command.js +3 -3
- package/dist/esm/product/command/command.recipe.js +25 -25
- package/dist/esm/product/entitycard/entitycard.js +1 -1
- package/dist/esm/product/entitycard/entitycard.recipe.js +7 -7
- package/dist/esm/product/flowcanvas/flowcanvas.js +5 -5
- package/dist/esm/product/flowcanvas/flowcanvas.recipe.js +11 -11
- package/dist/esm/product/inbox/inbox.js +1 -1
- package/dist/esm/product/inbox/inbox.recipe.js +22 -22
- package/dist/esm/product/listpage/listpage.js +3 -3
- package/dist/esm/product/listpage/listpage.recipe.js +18 -18
- package/dist/esm/product/navitem/navitem.js +1 -1
- package/dist/esm/product/navitem/navitem.recipe.js +2 -2
- package/dist/esm/product/onboarding/onboarding.js +1 -1
- package/dist/esm/product/onboarding/onboarding.recipe.js +19 -19
- package/dist/esm/product/recordpage/recordpage.js +24 -24
- package/dist/esm/product/recordpage/recordpage.recipe.js +117 -117
- package/dist/esm/product/recordpanel/recordpanel.js +4 -4
- package/dist/esm/product/recordpanel/recordpanel.recipe.js +15 -15
- package/dist/esm/product/recordstable/recordstable.js +48 -48
- package/dist/esm/product/recordstable/recordstable.recipe.js +87 -87
- package/dist/esm/product/recordstable/recordstable.tag.js +8 -8
- package/dist/esm/product/richtext/richtext.js +4 -4
- package/dist/esm/product/richtext/richtext.recipe.js +21 -21
- package/dist/esm/product/settingssection/settingssection.js +1 -1
- package/dist/esm/product/settingssection/settingssection.recipe.js +6 -6
- package/dist/esm/product/settingsshell/settingsshell.js +1 -1
- package/dist/esm/product/settingsshell/settingsshell.recipe.js +20 -20
- package/dist/esm/product/sidebar/sidebar.js +2 -2
- package/dist/esm/product/sidebar/sidebar.recipe.js +21 -21
- package/dist/esm/product/tasklist/tasklist.js +2 -2
- package/dist/esm/product/tasklist/tasklist.recipe.js +14 -14
- package/dist/esm/product/trialbanner/trialbanner.js +1 -1
- package/dist/esm/product/trialbanner/trialbanner.recipe.js +6 -6
- package/dist/esm/product/viewtoggle/viewtoggle.js +1 -1
- package/dist/esm/product/viewtoggle/viewtoggle.recipe.js +4 -4
- package/dist/esm/tokens/contract.js +3 -2
- package/dist/fileupload.css +46 -46
- package/dist/fileupload.layered.css +91 -0
- package/dist/flowcanvas.css +13 -13
- package/dist/flowcanvas.layered.css +17 -0
- package/dist/formfield.css +7 -7
- package/dist/formfield.layered.css +10 -0
- package/dist/inbox.css +26 -26
- package/dist/inbox.layered.css +41 -0
- package/dist/input.css +17 -17
- package/dist/input.layered.css +45 -0
- package/dist/kbd.css +2 -2
- package/dist/kbd.layered.css +5 -0
- package/dist/linechart.css +14 -14
- package/dist/linechart.layered.css +17 -0
- package/dist/listpage.css +22 -22
- package/dist/listpage.layered.css +41 -0
- package/dist/menu.css +29 -29
- package/dist/menu.layered.css +48 -0
- package/dist/multiselect.css +42 -42
- package/dist/multiselect.layered.css +63 -0
- package/dist/navitem.css +14 -14
- package/dist/navitem.layered.css +25 -0
- package/dist/onboarding.css +24 -24
- package/dist/onboarding.layered.css +39 -0
- package/dist/popover.css +6 -6
- package/dist/popover.layered.css +16 -0
- package/dist/progress.css +7 -7
- package/dist/progress.layered.css +17 -0
- package/dist/quantitypicker.css +34 -34
- package/dist/quantitypicker.layered.css +80 -0
- package/dist/radiogroup.css +18 -18
- package/dist/radiogroup.layered.css +33 -0
- package/dist/recordpage.css +122 -122
- package/dist/recordpage.layered.css +153 -0
- package/dist/recordpanel.css +31 -31
- package/dist/recordpanel.layered.css +50 -0
- package/dist/recordstable.css +162 -162
- package/dist/recordstable.layered.css +222 -0
- package/dist/resizablepanel.css +26 -26
- package/dist/resizablepanel.layered.css +55 -0
- package/dist/richtext.css +24 -24
- package/dist/richtext.layered.css +38 -0
- package/dist/segmented.css +10 -10
- package/dist/segmented.layered.css +20 -0
- package/dist/select.css +43 -43
- package/dist/select.layered.css +72 -0
- package/dist/settingssection.css +8 -8
- package/dist/settingssection.layered.css +11 -0
- package/dist/settingsshell.css +23 -23
- package/dist/settingsshell.layered.css +44 -0
- package/dist/sidebar.css +27 -27
- package/dist/sidebar.layered.css +40 -0
- package/dist/skeleton.css +4 -4
- package/dist/skeleton.layered.css +15 -0
- package/dist/slider.css +23 -23
- package/dist/slider.layered.css +58 -0
- package/dist/spinner.css +3 -3
- package/dist/spinner.layered.css +14 -0
- package/dist/stagebar.css +4 -4
- package/dist/stagebar.layered.css +14 -0
- package/dist/statcard.css +14 -14
- package/dist/statcard.layered.css +21 -0
- package/dist/styles.css +1816 -1725
- package/dist/styles.layered.css +2932 -0
- package/dist/switch.css +7 -7
- package/dist/switch.layered.css +22 -0
- package/dist/table.css +16 -16
- package/dist/table.layered.css +36 -0
- package/dist/tabletoolbar.css +67 -67
- package/dist/tabletoolbar.layered.css +80 -0
- package/dist/tabs.css +15 -15
- package/dist/tabs.layered.css +29 -0
- package/dist/tasklist.css +17 -17
- package/dist/tasklist.layered.css +34 -0
- package/dist/textarea.css +18 -18
- package/dist/textarea.layered.css +42 -0
- package/dist/toast.css +17 -17
- package/dist/toast.layered.css +27 -0
- package/dist/tokens.css +199 -115
- package/dist/tooltip.css +3 -3
- package/dist/tooltip.layered.css +13 -0
- package/dist/trialbanner.css +13 -13
- package/dist/trialbanner.layered.css +28 -0
- package/dist/types/core/namespace.d.ts +2 -0
- package/dist/viewtoggle.css +10 -10
- package/dist/viewtoggle.layered.css +23 -0
- package/dist/wheelpicker.css +29 -29
- package/dist/wheelpicker.layered.css +70 -0
- package/licenses/Apache-2.0.txt +201 -0
- package/package.json +5 -2
|
@@ -7,15 +7,15 @@ import { recordpanelRecipe } from "./recordpanel.recipe.js";
|
|
|
7
7
|
function FieldValue({ col, row, emptyLabel, }) {
|
|
8
8
|
const v = row[col.key];
|
|
9
9
|
if (v == null || v === "" || (Array.isArray(v) && !v.length)) {
|
|
10
|
-
return _jsx("span", { className: "recordpanel-empty", children: emptyLabel });
|
|
10
|
+
return _jsx("span", { className: "crisp-recordpanel-empty", children: emptyLabel });
|
|
11
11
|
}
|
|
12
12
|
switch (col.type) {
|
|
13
13
|
case "tags":
|
|
14
|
-
return (_jsx(_Fragment, { children: v.map((t) => (_jsx("span", { className: "recordstable-tag", "data-tone": tagTone(t), children: t }, t))) }));
|
|
14
|
+
return (_jsx(_Fragment, { children: v.map((t) => (_jsx("span", { className: "crisp-recordstable-tag", "data-tone": tagTone(t), children: t }, t))) }));
|
|
15
15
|
case "number":
|
|
16
16
|
return _jsx(_Fragment, { children: typeof v === "number" ? v.toLocaleString() : v });
|
|
17
17
|
case "url":
|
|
18
|
-
return (_jsx("a", { className: "recordpanel-link", href: `https://${v}`, target: "_blank", rel: "noreferrer", children: v }));
|
|
18
|
+
return (_jsx("a", { className: "crisp-recordpanel-link", href: `https://${v}`, target: "_blank", rel: "noreferrer", children: v }));
|
|
19
19
|
default:
|
|
20
20
|
return _jsx(_Fragment, { children: String(v) });
|
|
21
21
|
}
|
|
@@ -42,6 +42,6 @@ export function RecordPanel({ record, columns, onClose, className, closeLabel =
|
|
|
42
42
|
? record[entityCol.key]
|
|
43
43
|
: undefined;
|
|
44
44
|
const fields = columns.filter((c) => c.type !== "entity");
|
|
45
|
-
return (_jsxs("div", { className: recordpanelRecipe({ className }), ...rest, role: "dialog", "aria-label": entity?.name ?? "Record", children: [_jsxs("div", { className: "recordpanel-header", children: [entity?.avatar ? (_jsx("img", { className: "recordpanel-fav", src: entity.avatar, alt: "" })) : entity ? (_jsx(Avatar, { size: "md", shape: "rounded", tone: "brand", children: entity.name.charAt(0) })) : null, _jsx("span", { className: "recordpanel-title", children: entity?.name ?? "Record" }), _jsx("button", { type: "button", className: "recordpanel-iconbtn", "aria-label": closeLabel, onClick: onClose, children: _jsx(X, { size: 18, strokeWidth: 1.75 }) })] }), _jsxs("div", { className: "recordpanel-body", children: [_jsx("div", { className: "recordpanel-sectionlabel", children: detailsLabel }), fields.map((col) => (_jsxs("div", { className: "recordpanel-field", children: [_jsxs("span", { className: "recordpanel-field-label", children: [col.icon ? _jsx(col.icon, { size: 15, strokeWidth: 1.75 }) : null, col.label] }), _jsx("span", { className: "recordpanel-field-value", children: _jsx(FieldValue, { col: col, row: record, emptyLabel: emptyLabel }) })] }, col.key)))] })] }));
|
|
45
|
+
return (_jsxs("div", { className: recordpanelRecipe({ className }), ...rest, role: "dialog", "aria-label": entity?.name ?? "Record", children: [_jsxs("div", { className: "crisp-recordpanel-header", children: [entity?.avatar ? (_jsx("img", { className: "crisp-recordpanel-fav", src: entity.avatar, alt: "" })) : entity ? (_jsx(Avatar, { size: "md", shape: "rounded", tone: "brand", children: entity.name.charAt(0) })) : null, _jsx("span", { className: "crisp-recordpanel-title", children: entity?.name ?? "Record" }), _jsx("button", { type: "button", className: "crisp-recordpanel-iconbtn", "aria-label": closeLabel, onClick: onClose, children: _jsx(X, { size: 18, strokeWidth: 1.75 }) })] }), _jsxs("div", { className: "crisp-recordpanel-body", children: [_jsx("div", { className: "crisp-recordpanel-sectionlabel", children: detailsLabel }), fields.map((col) => (_jsxs("div", { className: "crisp-recordpanel-field", children: [_jsxs("span", { className: "crisp-recordpanel-field-label", children: [col.icon ? _jsx(col.icon, { size: 15, strokeWidth: 1.75 }) : null, col.label] }), _jsx("span", { className: "crisp-recordpanel-field-value", children: _jsx(FieldValue, { col: col, row: record, emptyLabel: emptyLabel }) })] }, col.key)))] })] }));
|
|
46
46
|
}
|
|
47
47
|
RecordPanel.displayName = "RecordPanel";
|
|
@@ -18,24 +18,24 @@ const config = defineRecipe({
|
|
|
18
18
|
@starting-style { transform: translateX(calc(100% + ${c.space["2"]})); }
|
|
19
19
|
& * { box-sizing: border-box; }
|
|
20
20
|
|
|
21
|
-
& .recordpanel-header { display: flex; align-items: center; gap: ${c.space["2"]}; height: 52px; flex-shrink: 0; padding: 0 ${c.space["3"]}; border-bottom: 1px solid ${c.borderSubtle}; }
|
|
22
|
-
& .recordpanel-fav { width: 22px; height: ${c.size.chip}; border-radius: ${c.radius.sm}; flex-shrink: 0; object-fit: cover; background: ${c.bgRaised}; }
|
|
23
|
-
& .recordpanel-title { flex: 1; min-width: 0; font-size: ${c.text.xl}; font-weight: ${c.weight.semibold}; letter-spacing: -0.2px; color: ${c.fgPrimary}; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
24
|
-
& .recordpanel-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; padding: 0; border: none; border-radius: ${c.radius.md}; background: transparent; color: ${c.fgMuted}; font-family: inherit; cursor: pointer; transition: background-color .12s; }
|
|
25
|
-
& .recordpanel-iconbtn:hover { background: ${c.bgRaised}; color: ${c.fgPrimary}; }
|
|
21
|
+
& .crisp-recordpanel-header { display: flex; align-items: center; gap: ${c.space["2"]}; height: 52px; flex-shrink: 0; padding: 0 ${c.space["3"]}; border-bottom: 1px solid ${c.borderSubtle}; }
|
|
22
|
+
& .crisp-recordpanel-fav { width: 22px; height: ${c.size.chip}; border-radius: ${c.radius.sm}; flex-shrink: 0; object-fit: cover; background: ${c.bgRaised}; }
|
|
23
|
+
& .crisp-recordpanel-title { flex: 1; min-width: 0; font-size: ${c.text.xl}; font-weight: ${c.weight.semibold}; letter-spacing: -0.2px; color: ${c.fgPrimary}; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
24
|
+
& .crisp-recordpanel-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; padding: 0; border: none; border-radius: ${c.radius.md}; background: transparent; color: ${c.fgMuted}; font-family: inherit; cursor: pointer; transition: background-color .12s; }
|
|
25
|
+
& .crisp-recordpanel-iconbtn:hover { background: ${c.bgRaised}; color: ${c.fgPrimary}; }
|
|
26
26
|
|
|
27
|
-
& .recordpanel-body { flex: 1; min-height: 0; overflow-y: auto; padding: ${c.space["2"]} ${c.space["3"]}; }
|
|
28
|
-
& .recordpanel-sectionlabel { font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; padding: ${c.space["2"]} ${c.space["1"]} ${c.space["1"]}; }
|
|
29
|
-
& .recordpanel-field { display: flex; align-items: flex-start; gap: ${c.space["2"]}; min-height: 32px; padding: ${c.space["1"]} ${c.space["1"]}; border-radius: ${c.radius.md}; }
|
|
30
|
-
& .recordpanel-field:hover { background: color-mix(in srgb, ${c.fgPrimary} 3%, transparent); }
|
|
31
|
-
& .recordpanel-field-label { display: flex; align-items: center; gap: ${c.space["1.5"]}; width: 132px; flex-shrink: 0; padding-top: 3px; color: ${c.fgMuted}; font-size: ${c.text.md}; }
|
|
32
|
-
& .recordpanel-field-label svg { flex-shrink: 0; }
|
|
33
|
-
& .recordpanel-field-value { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: ${c.space["1"]}; padding-top: 3px; font-size: ${c.text.lg}; color: ${c.fgPrimary}; }
|
|
34
|
-
& .recordpanel-empty { color: ${c.fgMuted}; }
|
|
27
|
+
& .crisp-recordpanel-body { flex: 1; min-height: 0; overflow-y: auto; padding: ${c.space["2"]} ${c.space["3"]}; }
|
|
28
|
+
& .crisp-recordpanel-sectionlabel { font-size: ${c.text.sm}; font-weight: ${c.weight.medium}; color: ${c.fgMuted}; padding: ${c.space["2"]} ${c.space["1"]} ${c.space["1"]}; }
|
|
29
|
+
& .crisp-recordpanel-field { display: flex; align-items: flex-start; gap: ${c.space["2"]}; min-height: 32px; padding: ${c.space["1"]} ${c.space["1"]}; border-radius: ${c.radius.md}; }
|
|
30
|
+
& .crisp-recordpanel-field:hover { background: color-mix(in srgb, ${c.fgPrimary} 3%, transparent); }
|
|
31
|
+
& .crisp-recordpanel-field-label { display: flex; align-items: center; gap: ${c.space["1.5"]}; width: 132px; flex-shrink: 0; padding-top: 3px; color: ${c.fgMuted}; font-size: ${c.text.md}; }
|
|
32
|
+
& .crisp-recordpanel-field-label svg { flex-shrink: 0; }
|
|
33
|
+
& .crisp-recordpanel-field-value { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: ${c.space["1"]}; padding-top: 3px; font-size: ${c.text.lg}; color: ${c.fgPrimary}; }
|
|
34
|
+
& .crisp-recordpanel-empty { color: ${c.fgMuted}; }
|
|
35
35
|
|
|
36
36
|
${recordTagCss}
|
|
37
|
-
& .recordpanel-link { color: ${c.bgBrandSolid}; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
|
|
38
|
-
& .recordpanel-link:hover { text-decoration: underline; }
|
|
37
|
+
& .crisp-recordpanel-link { color: ${c.bgBrandSolid}; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
|
|
38
|
+
& .crisp-recordpanel-link:hover { text-decoration: underline; }
|
|
39
39
|
`,
|
|
40
40
|
variants: {},
|
|
41
41
|
defaultVariants: {},
|
|
@@ -217,10 +217,10 @@ function EntityCell({ value, pinned, onOpenPage, avatarTone = "brand", labels, }
|
|
|
217
217
|
// 404s or the row has no avatar
|
|
218
218
|
const [imgFailed, setImgFailed] = React.useState(false);
|
|
219
219
|
const showImg = Boolean(value.avatar) && !imgFailed;
|
|
220
|
-
return (_jsxs("span", { className: "recordstable-entity", children: [showImg ? (_jsx("img", { className: "recordstable-fav", src: value.avatar, alt: "", onError: () => setImgFailed(true) })) : (_jsx(Avatar, { size: "sm", shape: "rounded", tone: avatarTone === "hashed" ? avatarToneFor(value.name) : "brand", children: value.name.charAt(0) })), onOpenPage ? (_jsx("button", { type: "button", className: "recordstable-entity-name recordstable-entity-name--link", onClick: (e) => {
|
|
220
|
+
return (_jsxs("span", { className: "crisp-recordstable-entity", children: [showImg ? (_jsx("img", { className: "crisp-recordstable-fav", src: value.avatar, alt: "", onError: () => setImgFailed(true) })) : (_jsx(Avatar, { size: "sm", shape: "rounded", tone: avatarTone === "hashed" ? avatarToneFor(value.name) : "brand", children: value.name.charAt(0) })), onOpenPage ? (_jsx("button", { type: "button", className: "crisp-recordstable-entity-name crisp-recordstable-entity-name--link", onClick: (e) => {
|
|
221
221
|
e.stopPropagation();
|
|
222
222
|
onOpenPage();
|
|
223
|
-
}, children: value.name })) : (_jsx("span", { className: "recordstable-entity-name", children: value.name })), pinned ? (_jsx(Star, { className: "recordstable-pin", size: 13, strokeWidth: 2, "aria-label": labels.inAList })) : null] }));
|
|
223
|
+
}, children: value.name })) : (_jsx("span", { className: "crisp-recordstable-entity-name", children: value.name })), pinned ? (_jsx(Star, { className: "crisp-recordstable-pin", size: 13, strokeWidth: 2, "aria-label": labels.inAList })) : null] }));
|
|
224
224
|
}
|
|
225
225
|
function CellView({ column, row, pinned, onOpenPage, avatarTone = "brand", labels, }) {
|
|
226
226
|
const value = row[column.key];
|
|
@@ -232,7 +232,7 @@ function CellView({ column, row, pinned, onOpenPage, avatarTone = "brand", label
|
|
|
232
232
|
if (value == null ||
|
|
233
233
|
value === "" ||
|
|
234
234
|
(Array.isArray(value) && !value.length)) {
|
|
235
|
-
return _jsx("span", { className: "recordstable-muted", children: "\u2014" });
|
|
235
|
+
return _jsx("span", { className: "crisp-recordstable-muted", children: "\u2014" });
|
|
236
236
|
}
|
|
237
237
|
// `format` keeps the type renderer's chrome below and only replaces the
|
|
238
238
|
// text it displays.
|
|
@@ -241,32 +241,32 @@ function CellView({ column, row, pinned, onOpenPage, avatarTone = "brand", label
|
|
|
241
241
|
case "entity":
|
|
242
242
|
return (_jsx(EntityCell, { labels: labels, value: value, pinned: pinned, onOpenPage: onOpenPage, avatarTone: avatarTone }));
|
|
243
243
|
case "tags":
|
|
244
|
-
return (_jsx("span", { className: "recordstable-cell recordstable-cell--tags", children: value.map((t) => (_jsx("span", { className: "recordstable-tag", "data-tone": tagTone(t), children: t }, t))) }));
|
|
244
|
+
return (_jsx("span", { className: "crisp-recordstable-cell crisp-recordstable-cell--tags", children: value.map((t) => (_jsx("span", { className: "crisp-recordstable-tag", "data-tone": tagTone(t), children: t }, t))) }));
|
|
245
245
|
case "number":
|
|
246
|
-
return (_jsx("span", { className: "recordstable-cell recordstable-cell--num", children: display ??
|
|
246
|
+
return (_jsx("span", { className: "crisp-recordstable-cell crisp-recordstable-cell--num", children: display ??
|
|
247
247
|
(typeof value === "number" ? value.toLocaleString() : value) }));
|
|
248
248
|
case "url":
|
|
249
|
-
return (_jsx("a", { className: "recordstable-link", href: `https://${value}`, target: "_blank", rel: "noreferrer", onClick: (e) => e.stopPropagation(), children: display ?? value }));
|
|
249
|
+
return (_jsx("a", { className: "crisp-recordstable-link", href: `https://${value}`, target: "_blank", rel: "noreferrer", onClick: (e) => e.stopPropagation(), children: display ?? value }));
|
|
250
250
|
case "date":
|
|
251
|
-
return _jsx("span", { className: "recordstable-muted", children: display ?? value });
|
|
251
|
+
return (_jsx("span", { className: "crisp-recordstable-muted", children: display ?? value }));
|
|
252
252
|
case "currency": {
|
|
253
253
|
const n = typeof value === "number" ? value : Number(value);
|
|
254
|
-
return (_jsx("span", { className: "recordstable-cell recordstable-cell--num", children: display ??
|
|
254
|
+
return (_jsx("span", { className: "crisp-recordstable-cell crisp-recordstable-cell--num", children: display ??
|
|
255
255
|
`${column.symbol ?? "$"}${Number.isFinite(n) ? n.toLocaleString() : value}` }));
|
|
256
256
|
}
|
|
257
257
|
case "status": {
|
|
258
258
|
const opt = column.options?.find((o) => o.value === value);
|
|
259
259
|
if (!opt)
|
|
260
|
-
return _jsx("span", { className: "recordstable-muted", children: "\u2014" });
|
|
261
|
-
return (_jsxs("span", { className: "recordstable-status", children: [_jsx("span", { className: "recordstable-status-dot", style: { background: opt.color } }), display ?? opt.label] }));
|
|
260
|
+
return _jsx("span", { className: "crisp-recordstable-muted", children: "\u2014" });
|
|
261
|
+
return (_jsxs("span", { className: "crisp-recordstable-status", children: [_jsx("span", { className: "crisp-recordstable-status-dot", style: { background: opt.color } }), display ?? opt.label] }));
|
|
262
262
|
}
|
|
263
263
|
case "reference": {
|
|
264
264
|
const opt = column.refOptions?.find((o) => o.value === value);
|
|
265
265
|
const label = display ?? opt?.label ?? String(value);
|
|
266
|
-
return (_jsxs("span", { className: "recordstable-entity", children: [_jsx(Avatar, { size: "sm", shape: "rounded", tone: avatarTone === "hashed" ? avatarToneFor(label) : "brand", children: label.charAt(0) }), _jsx("span", { className: "recordstable-entity-name", children: label })] }));
|
|
266
|
+
return (_jsxs("span", { className: "crisp-recordstable-entity", children: [_jsx(Avatar, { size: "sm", shape: "rounded", tone: avatarTone === "hashed" ? avatarToneFor(label) : "brand", children: label.charAt(0) }), _jsx("span", { className: "crisp-recordstable-entity-name", children: label })] }));
|
|
267
267
|
}
|
|
268
268
|
default:
|
|
269
|
-
return (_jsx("span", { className: "recordstable-entity-name", children: display ?? value }));
|
|
269
|
+
return (_jsx("span", { className: "crisp-recordstable-entity-name", children: display ?? value }));
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
// Always-interactive cell editors for the picker column types (status / date /
|
|
@@ -372,10 +372,10 @@ function CreateRecordDialog({ open, onOpenChange, columns, entityLabel, onCreate
|
|
|
372
372
|
};
|
|
373
373
|
const entityCol = columns.find((c) => c.type === "entity");
|
|
374
374
|
const EntityIcon = entityCol?.icon;
|
|
375
|
-
return (_jsxs(Dialog, { open: open, onOpenChange: onOpenChange, title: labels.newRecordTitle(entityLabel), icon: EntityIcon ? _jsx(EntityIcon, { size: 16, strokeWidth: 1.75 }) : undefined, width: 720, children: [_jsx(DialogBody, { children: columns.map((col, i) => (_jsxs("div", { className: "dialog-field", children: [_jsx("label", { className: "dialog-field-label", htmlFor: `create-${col.key}`, children: col.label }), _jsx(Input, { id: `create-${col.key}`, ref: i === 0 ? firstRef : undefined, value: values[col.key] ?? "", onChange: (e) => set(col.key, e.currentTarget.value), placeholder: labels.setFieldPlaceholder(col.label), onKeyDown: (e) => {
|
|
375
|
+
return (_jsxs(Dialog, { open: open, onOpenChange: onOpenChange, title: labels.newRecordTitle(entityLabel), icon: EntityIcon ? _jsx(EntityIcon, { size: 16, strokeWidth: 1.75 }) : undefined, width: 720, children: [_jsx(DialogBody, { children: columns.map((col, i) => (_jsxs("div", { className: "crisp-dialog-field", children: [_jsx("label", { className: "crisp-dialog-field-label", htmlFor: `create-${col.key}`, children: col.label }), _jsx(Input, { id: `create-${col.key}`, ref: i === 0 ? firstRef : undefined, value: values[col.key] ?? "", onChange: (e) => set(col.key, e.currentTarget.value), placeholder: labels.setFieldPlaceholder(col.label), onKeyDown: (e) => {
|
|
376
376
|
if (e.key === "Enter" && (e.metaKey || e.ctrlKey))
|
|
377
377
|
submit();
|
|
378
|
-
} })] }, col.key))) }), _jsxs(DialogFooter, { children: [_jsxs("span", { className: "dialog-more", children: [labels.createMore, _jsx(Switch, { checked: createMore, onCheckedChange: setCreateMore, "aria-label": labels.createMore })] }), _jsxs("button", { type: "button", className: "dialog-submit", onClick: submit, children: [labels.createRecord, _jsx("span", { className: "dialog-submit-key", children: "\u2318\u21B5" })] })] })] }));
|
|
378
|
+
} })] }, col.key))) }), _jsxs(DialogFooter, { children: [_jsxs("span", { className: "crisp-dialog-more", children: [labels.createMore, _jsx(Switch, { checked: createMore, onCheckedChange: setCreateMore, "aria-label": labels.createMore })] }), _jsxs("button", { type: "button", className: "crisp-dialog-submit", onClick: submit, children: [labels.createRecord, _jsx("span", { className: "crisp-dialog-submit-key", children: "\u2318\u21B5" })] })] })] }));
|
|
379
379
|
}
|
|
380
380
|
/**
|
|
381
381
|
* A measured-style record grid — fully featured. Toolbar (search / sort status /
|
|
@@ -449,7 +449,7 @@ export function RecordsTable({ labels, columns: columnsProp = defaultColumns, ro
|
|
|
449
449
|
const onWheel = (e) => {
|
|
450
450
|
// don't hijack the wheel when it's over an open cell popover (its own list
|
|
451
451
|
// scrolls) — only map vertical wheel to horizontal for the table itself
|
|
452
|
-
if (e.target?.closest?.(".select-listbox, .multiselect-listbox, .datepicker-cal, .recordstable-menu"))
|
|
452
|
+
if (e.target?.closest?.(".crisp-select-listbox, .crisp-multiselect-listbox, .datepicker-cal, .crisp-recordstable-menu"))
|
|
453
453
|
return;
|
|
454
454
|
const canH = el.scrollWidth > el.clientWidth;
|
|
455
455
|
const canV = el.scrollHeight > el.clientHeight;
|
|
@@ -468,7 +468,7 @@ export function RecordsTable({ labels, columns: columnsProp = defaultColumns, ro
|
|
|
468
468
|
return;
|
|
469
469
|
const onDown = (e) => {
|
|
470
470
|
const t = e.target;
|
|
471
|
-
if (!t.closest(".recordstable-menu, [data-menu-trigger]"))
|
|
471
|
+
if (!t.closest(".crisp-recordstable-menu, [data-menu-trigger]"))
|
|
472
472
|
setOpenMenu(null);
|
|
473
473
|
};
|
|
474
474
|
const onKey = (e) => e.key === "Escape" && setOpenMenu(null);
|
|
@@ -484,7 +484,7 @@ export function RecordsTable({ labels, columns: columnsProp = defaultColumns, ro
|
|
|
484
484
|
if (!ctxMenu)
|
|
485
485
|
return;
|
|
486
486
|
const onDown = (e) => {
|
|
487
|
-
if (!e.target.closest(".recordstable-ctx"))
|
|
487
|
+
if (!e.target.closest(".crisp-recordstable-ctx"))
|
|
488
488
|
setCtxMenu(null);
|
|
489
489
|
};
|
|
490
490
|
const onKey = (e) => e.key === "Escape" && setCtxMenu(null);
|
|
@@ -959,47 +959,47 @@ export function RecordsTable({ labels, columns: columnsProp = defaultColumns, ro
|
|
|
959
959
|
window.addEventListener("pointermove", onMove);
|
|
960
960
|
window.addEventListener("pointerup", onUp);
|
|
961
961
|
};
|
|
962
|
-
return (_jsxs("div", { className: recordstableRecipe({ className }), ref: rootRef, ...rest, children: [_jsxs("div", { className: "recordstable-toolbar", children: [_jsxs("span", { className: "recordstable-toolgroup", children: [_jsxs("button", { type: "button", className: `recordstable-tool${sorts.length ? " recordstable-tool--active" : ""}`, onClick: () => setOpenMenu(openMenu === "sort" ? null : "sort"), "aria-haspopup": "dialog", "aria-expanded": openMenu === "sort", "data-menu-trigger": true, children: [_jsx(ArrowUpDown, { size: 14, strokeWidth: 1.75, "aria-hidden": "true" }), sorts.length
|
|
962
|
+
return (_jsxs("div", { className: recordstableRecipe({ className }), ref: rootRef, ...rest, children: [_jsxs("div", { className: "crisp-recordstable-toolbar", children: [_jsxs("span", { className: "crisp-recordstable-toolgroup", children: [_jsxs("button", { type: "button", className: `crisp-recordstable-tool${sorts.length ? " crisp-recordstable-tool--active" : ""}`, onClick: () => setOpenMenu(openMenu === "sort" ? null : "sort"), "aria-haspopup": "dialog", "aria-expanded": openMenu === "sort", "data-menu-trigger": true, children: [_jsx(ArrowUpDown, { size: 14, strokeWidth: 1.75, "aria-hidden": "true" }), sorts.length
|
|
963
963
|
? t.sortedBy(cols.find((c) => c.key === sorts[0].key)?.label ?? "", sorts.length - 1)
|
|
964
|
-
: t.sort] }), openMenu === "sort" && (_jsxs("div", { className: "recordstable-menu recordstable-sortpop", role: "dialog", "aria-label": t.sort, children: [sorts.length === 0 ? (_jsx("div", { className: "recordstable-sort-empty", children: t.noSorts })) : (sorts.map((s, i) => (_jsxs("div", { className: "recordstable-sort-row", onDragOver: (e) => {
|
|
964
|
+
: t.sort] }), openMenu === "sort" && (_jsxs("div", { className: "crisp-recordstable-menu crisp-recordstable-sortpop", role: "dialog", "aria-label": t.sort, children: [sorts.length === 0 ? (_jsx("div", { className: "crisp-recordstable-sort-empty", children: t.noSorts })) : (sorts.map((s, i) => (_jsxs("div", { className: "crisp-recordstable-sort-row", onDragOver: (e) => {
|
|
965
965
|
if (dragSort !== null)
|
|
966
966
|
e.preventDefault();
|
|
967
967
|
}, onDrop: () => {
|
|
968
968
|
if (dragSort !== null)
|
|
969
969
|
moveSort(dragSort, i);
|
|
970
970
|
setDragSort(null);
|
|
971
|
-
}, children: [_jsx("button", { type: "button", className: "recordstable-sort-grip", "aria-label": t.reorderSort, draggable: true, onDragStart: () => setDragSort(i), onDragEnd: () => setDragSort(null), children: _jsx(GripVertical, { size: 15, strokeWidth: 1.75 }) }), _jsx(Select, { className: "recordstable-sort-field", searchable: true, value: s.key, onValueChange: (k) => setSortField(i, k), options: cols.map((c) => ({
|
|
971
|
+
}, children: [_jsx("button", { type: "button", className: "crisp-recordstable-sort-grip", "aria-label": t.reorderSort, draggable: true, onDragStart: () => setDragSort(i), onDragEnd: () => setDragSort(null), children: _jsx(GripVertical, { size: 15, strokeWidth: 1.75 }) }), _jsx(Select, { className: "crisp-recordstable-sort-field", searchable: true, value: s.key, onValueChange: (k) => setSortField(i, k), options: cols.map((c) => ({
|
|
972
972
|
value: c.key,
|
|
973
|
-
label: c.icon ? (_jsxs("span", { className: "recordstable-sort-optlabel", children: [_jsx(c.icon, { size: 15, strokeWidth: 1.75 }), c.label] })) : (c.label),
|
|
973
|
+
label: c.icon ? (_jsxs("span", { className: "crisp-recordstable-sort-optlabel", children: [_jsx(c.icon, { size: 15, strokeWidth: 1.75 }), c.label] })) : (c.label),
|
|
974
974
|
keywords: c.label,
|
|
975
|
-
})), "aria-label": t.sortField }), _jsx(Select, { className: "recordstable-sort-dir", value: s.dir, onValueChange: (d) => setSortDir(i, d), options: [
|
|
975
|
+
})), "aria-label": t.sortField }), _jsx(Select, { className: "crisp-recordstable-sort-dir", value: s.dir, onValueChange: (d) => setSortDir(i, d), options: [
|
|
976
976
|
{
|
|
977
977
|
value: "asc",
|
|
978
|
-
label: (_jsxs("span", { className: "recordstable-sort-optlabel", children: [_jsx(ArrowUpNarrowWide, { size: 15, strokeWidth: 1.75 }), t.ascending] })),
|
|
978
|
+
label: (_jsxs("span", { className: "crisp-recordstable-sort-optlabel", children: [_jsx(ArrowUpNarrowWide, { size: 15, strokeWidth: 1.75 }), t.ascending] })),
|
|
979
979
|
keywords: t.ascending,
|
|
980
980
|
},
|
|
981
981
|
{
|
|
982
982
|
value: "desc",
|
|
983
|
-
label: (_jsxs("span", { className: "recordstable-sort-optlabel", children: [_jsx(ArrowDownWideNarrow, { size: 15, strokeWidth: 1.75 }), t.descending] })),
|
|
983
|
+
label: (_jsxs("span", { className: "crisp-recordstable-sort-optlabel", children: [_jsx(ArrowDownWideNarrow, { size: 15, strokeWidth: 1.75 }), t.descending] })),
|
|
984
984
|
keywords: t.descending,
|
|
985
985
|
},
|
|
986
|
-
], "aria-label": t.sortDirection }), _jsx("button", { type: "button", className: "recordstable-sort-remove", onClick: () => removeSort(i), "aria-label": t.removeSort, children: _jsx(X, { size: 15, strokeWidth: 1.75 }) })] }, s.key)))), _jsx("div", { className: "recordstable-sort-addrow", children: _jsxs("button", { type: "button", className: "recordstable-sort-add", onClick: addSort, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75 }), t.addSort] }) }), _jsx("div", { className: "recordstable-sort-foot", children: t.learnSortingHref ? (_jsxs("a", { className: "recordstable-sort-learn", href: t.learnSortingHref, target: "_blank", rel: "noreferrer", children: [_jsx(CircleHelp, { size: 14, strokeWidth: 1.75 }), t.learnSorting] })) : (_jsxs("span", { className: "recordstable-sort-learn", children: [_jsx(CircleHelp, { size: 14, strokeWidth: 1.75 }), t.learnSorting] })) })] }))] }), _jsxs("span", { className: "recordstable-toolgroup", children: [_jsxs("button", { type: "button", className: `recordstable-tool recordstable-tool--ghost${activeFilters ? " recordstable-tool--active" : ""}`, onClick: () => setOpenMenu(openMenu === "filter" ? null : "filter"), "aria-haspopup": "dialog", "aria-expanded": openMenu === "filter", "data-menu-trigger": true, children: [_jsx(ListFilter, { size: 14, strokeWidth: 1.75, "aria-hidden": "true" }), t.filterCount(activeFilters)] }), openMenu === "filter" && (_jsxs("div", { className: "recordstable-menu", role: "dialog", "aria-label": t.addFilter, children: [_jsx("input", { className: "recordstable-menu-input", placeholder: t.filterByPlaceholder, "aria-label": t.filterByField,
|
|
986
|
+
], "aria-label": t.sortDirection }), _jsx("button", { type: "button", className: "crisp-recordstable-sort-remove", onClick: () => removeSort(i), "aria-label": t.removeSort, children: _jsx(X, { size: 15, strokeWidth: 1.75 }) })] }, s.key)))), _jsx("div", { className: "crisp-recordstable-sort-addrow", children: _jsxs("button", { type: "button", className: "crisp-recordstable-sort-add", onClick: addSort, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75 }), t.addSort] }) }), _jsx("div", { className: "crisp-recordstable-sort-foot", children: t.learnSortingHref ? (_jsxs("a", { className: "crisp-recordstable-sort-learn", href: t.learnSortingHref, target: "_blank", rel: "noreferrer", children: [_jsx(CircleHelp, { size: 14, strokeWidth: 1.75 }), t.learnSorting] })) : (_jsxs("span", { className: "crisp-recordstable-sort-learn", children: [_jsx(CircleHelp, { size: 14, strokeWidth: 1.75 }), t.learnSorting] })) })] }))] }), _jsxs("span", { className: "crisp-recordstable-toolgroup", children: [_jsxs("button", { type: "button", className: `crisp-recordstable-tool crisp-recordstable-tool--ghost${activeFilters ? " crisp-recordstable-tool--active" : ""}`, onClick: () => setOpenMenu(openMenu === "filter" ? null : "filter"), "aria-haspopup": "dialog", "aria-expanded": openMenu === "filter", "data-menu-trigger": true, children: [_jsx(ListFilter, { size: 14, strokeWidth: 1.75, "aria-hidden": "true" }), t.filterCount(activeFilters)] }), openMenu === "filter" && (_jsxs("div", { className: "crisp-recordstable-menu", role: "dialog", "aria-label": t.addFilter, children: [_jsx("input", { className: "crisp-recordstable-menu-input", placeholder: t.filterByPlaceholder, "aria-label": t.filterByField,
|
|
987
987
|
// biome-ignore lint/a11y/noAutofocus: focus the picker on open
|
|
988
988
|
autoFocus: true, value: filterQuery, onChange: (e) => setFilterQuery(e.target.value) }), cols
|
|
989
989
|
.filter((col) => col.label
|
|
990
990
|
.toLowerCase()
|
|
991
991
|
.includes(filterQuery.trim().toLowerCase()))
|
|
992
|
-
.map((col) => (_jsxs("button", { type: "button", className: "recordstable-menu-item", onClick: () => addFilter(col.key), children: [col.icon ? (_jsx(col.icon, { size: 15, strokeWidth: 1.75 })) : (_jsx("span", { style: { width: 15 } })), col.label] }, col.key)))] }))] }), filterConds.map((cond) => {
|
|
992
|
+
.map((col) => (_jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", onClick: () => addFilter(col.key), children: [col.icon ? (_jsx(col.icon, { size: 15, strokeWidth: 1.75 })) : (_jsx("span", { style: { width: 15 } })), col.label] }, col.key)))] }))] }), filterConds.map((cond) => {
|
|
993
993
|
const col = cols.find((c) => c.key === cond.key);
|
|
994
994
|
const open = openMenu === `fcond:${cond.id}`;
|
|
995
995
|
const hasValue = !opNeedsValue(cond.op) || cond.value.trim();
|
|
996
|
-
return (_jsxs("span", { className: "recordstable-toolgroup", children: [_jsxs("span", { className: "recordstable-fchip", children: [_jsxs("button", { type: "button", className: "recordstable-fchip-main", "data-menu-trigger": true, "aria-haspopup": "dialog", "aria-expanded": open, onClick: () => setOpenMenu(open ? null : `fcond:${cond.id}`), children: [_jsx("span", { className: "recordstable-fchip-field", children: col?.label }), hasValue ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "recordstable-fchip-op", children: t.op[cond.op] }), opNeedsValue(cond.op) && (_jsx("span", { className: "recordstable-fchip-val", children: cond.value }))] })) : (_jsx("span", { className: "recordstable-fchip-op", children: t.selectCondition }))] }), _jsx("button", { type: "button", className: "recordstable-fchip-x", "aria-label": `Remove ${col?.label} filter`, onClick: () => removeFilter(cond.id), children: _jsx(X, { size: 13, strokeWidth: 2 }) })] }), open && (_jsxs("div", { className: "recordstable-menu", role: "dialog", "aria-label": `${col?.label} condition`, children: [_jsxs("div", { className: "recordstable-menu-head", children: [col?.label, " condition"] }), OP_ORDER.map((op) => (_jsxs("button", { type: "button", className: "recordstable-menu-item", "data-on": cond.op === op ? "" : undefined, onClick: () => patchFilter(cond.id, { op }), children: [t.op[op], cond.op === op ? (_jsx(Check, { className: "recordstable-menu-check", size: 15, strokeWidth: 1.75 })) : null] }, op))), opNeedsValue(cond.op) && (_jsx("input", { className: "recordstable-menu-input", placeholder: t.filterValuePlaceholder, "aria-label": `${col?.label} filter value`,
|
|
996
|
+
return (_jsxs("span", { className: "crisp-recordstable-toolgroup", children: [_jsxs("span", { className: "crisp-recordstable-fchip", children: [_jsxs("button", { type: "button", className: "crisp-recordstable-fchip-main", "data-menu-trigger": true, "aria-haspopup": "dialog", "aria-expanded": open, onClick: () => setOpenMenu(open ? null : `fcond:${cond.id}`), children: [_jsx("span", { className: "crisp-recordstable-fchip-field", children: col?.label }), hasValue ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "crisp-recordstable-fchip-op", children: t.op[cond.op] }), opNeedsValue(cond.op) && (_jsx("span", { className: "crisp-recordstable-fchip-val", children: cond.value }))] })) : (_jsx("span", { className: "crisp-recordstable-fchip-op", children: t.selectCondition }))] }), _jsx("button", { type: "button", className: "crisp-recordstable-fchip-x", "aria-label": `Remove ${col?.label} filter`, onClick: () => removeFilter(cond.id), children: _jsx(X, { size: 13, strokeWidth: 2 }) })] }), open && (_jsxs("div", { className: "crisp-recordstable-menu", role: "dialog", "aria-label": `${col?.label} condition`, children: [_jsxs("div", { className: "crisp-recordstable-menu-head", children: [col?.label, " condition"] }), OP_ORDER.map((op) => (_jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", "data-on": cond.op === op ? "" : undefined, onClick: () => patchFilter(cond.id, { op }), children: [t.op[op], cond.op === op ? (_jsx(Check, { className: "crisp-recordstable-menu-check", size: 15, strokeWidth: 1.75 })) : null] }, op))), opNeedsValue(cond.op) && (_jsx("input", { className: "crisp-recordstable-menu-input", placeholder: t.filterValuePlaceholder, "aria-label": `${col?.label} filter value`,
|
|
997
997
|
// biome-ignore lint/a11y/noAutofocus: focus the value field
|
|
998
998
|
autoFocus: true, value: cond.value, onChange: (e) => patchFilter(cond.id, { value: e.target.value }) }))] }))] }, cond.id));
|
|
999
|
-
}), _jsx("span", { className: "recordstable-spacer" }), _jsx("span", { className: "recordstable-count", children: t.recordCount(visibleRows.length) }), showNew && (_jsxs("button", { type: "button", className: "recordstable-new", onClick: () => setCreating(true), children: [_jsx(Plus, { size: 15, strokeWidth: 2, "aria-hidden": "true" }), t.newButton] }))] }), _jsxs("div", { ref: scrollRef, className: "recordstable-scroll", tabIndex: -1, "data-scrolled": scrolledX ? "" : undefined, onKeyDown: onGridKeyDown, onScroll: (e) => {
|
|
999
|
+
}), _jsx("span", { className: "crisp-recordstable-spacer" }), _jsx("span", { className: "crisp-recordstable-count", children: t.recordCount(visibleRows.length) }), showNew && (_jsxs("button", { type: "button", className: "crisp-recordstable-new", onClick: () => setCreating(true), children: [_jsx(Plus, { size: 15, strokeWidth: 2, "aria-hidden": "true" }), t.newButton] }))] }), _jsxs("div", { ref: scrollRef, className: "crisp-recordstable-scroll", tabIndex: -1, "data-scrolled": scrolledX ? "" : undefined, onKeyDown: onGridKeyDown, onScroll: (e) => {
|
|
1000
1000
|
const left = e.currentTarget.scrollLeft > 0;
|
|
1001
1001
|
setScrolledX((prev) => (prev === left ? prev : left));
|
|
1002
|
-
}, children: [_jsxs("table", { className: "recordstable-table", style: {
|
|
1002
|
+
}, children: [_jsxs("table", { className: "crisp-recordstable-table", style: {
|
|
1003
1003
|
// fill the container; the trailing add-column absorbs the slack (a
|
|
1004
1004
|
// flexible filler). minWidth keeps real column widths and drives the
|
|
1005
1005
|
// horizontal scroll once the columns outgrow the container.
|
|
@@ -1007,10 +1007,10 @@ export function RecordsTable({ labels, columns: columnsProp = defaultColumns, ro
|
|
|
1007
1007
|
minWidth: CHECK_W +
|
|
1008
1008
|
ADDCOL_W +
|
|
1009
1009
|
cols.reduce((sum, c) => sum + colWidth(c), 0),
|
|
1010
|
-
}, children: [_jsxs("colgroup", { children: [_jsx("col", { style: { width: CHECK_W } }), cols.map((col) => (_jsx("col", { style: { width: colWidth(col) } }, col.key))), _jsx("col", {})] }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: "recordstable-th recordstable-col-check", children: _jsx("span", { className: "recordstable-check-inner", children: _jsx(Checkbox, { "aria-label": t.selectAll, checked: allSelected, indeterminate: someSelected, onChange: toggleAll }) }) }), cols.map((col, i) => {
|
|
1010
|
+
}, children: [_jsxs("colgroup", { children: [_jsx("col", { style: { width: CHECK_W } }), cols.map((col) => (_jsx("col", { style: { width: colWidth(col) } }, col.key))), _jsx("col", {})] }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: "crisp-recordstable-th crisp-recordstable-col-check", children: _jsx("span", { className: "crisp-recordstable-check-inner", children: _jsx(Checkbox, { "aria-label": t.selectAll, checked: allSelected, indeterminate: someSelected, onChange: toggleAll }) }) }), cols.map((col, i) => {
|
|
1011
1011
|
const Icon = col.icon;
|
|
1012
1012
|
const sc = sorts.find((s) => s.key === col.key);
|
|
1013
|
-
return (_jsxs("th", { className: `recordstable-th${i === 0 ? " recordstable-col-entity" : ""}`, "data-sorted": sc?.dir, "aria-sort": sorts[0]?.key === col.key
|
|
1013
|
+
return (_jsxs("th", { className: `crisp-recordstable-th${i === 0 ? " crisp-recordstable-col-entity" : ""}`, "data-sorted": sc?.dir, "aria-sort": sorts[0]?.key === col.key
|
|
1014
1014
|
? sorts[0].dir === "asc"
|
|
1015
1015
|
? "ascending"
|
|
1016
1016
|
: "descending"
|
|
@@ -1019,35 +1019,35 @@ export function RecordsTable({ labels, columns: columnsProp = defaultColumns, ro
|
|
|
1019
1019
|
e.preventDefault();
|
|
1020
1020
|
reorderColumn(dragCol, col.key);
|
|
1021
1021
|
}
|
|
1022
|
-
: undefined, children: [renamingCol === col.key ? (_jsx("input", { className: "recordstable-th-rename",
|
|
1022
|
+
: undefined, children: [renamingCol === col.key ? (_jsx("input", { className: "crisp-recordstable-th-rename",
|
|
1023
1023
|
// biome-ignore lint/a11y/noAutofocus: focus the rename field the moment it opens
|
|
1024
1024
|
autoFocus: true, defaultValue: col.label, "aria-label": t.columnLabel, onKeyDown: (e) => {
|
|
1025
1025
|
if (e.key === "Enter")
|
|
1026
1026
|
renameColumn(col.key, e.currentTarget.value);
|
|
1027
1027
|
else if (e.key === "Escape")
|
|
1028
1028
|
setRenamingCol(null);
|
|
1029
|
-
}, onBlur: (e) => renameColumn(col.key, e.currentTarget.value) })) : (_jsxs("button", { type: "button", className: "recordstable-th-inner", "data-menu-trigger": true, "aria-haspopup": "menu", draggable: i >= 1, onDragStart: i >= 1
|
|
1029
|
+
}, onBlur: (e) => renameColumn(col.key, e.currentTarget.value) })) : (_jsxs("button", { type: "button", className: "crisp-recordstable-th-inner", "data-menu-trigger": true, "aria-haspopup": "menu", draggable: i >= 1, onDragStart: i >= 1
|
|
1030
1030
|
? (e) => {
|
|
1031
1031
|
setDragCol(col.key);
|
|
1032
1032
|
e.dataTransfer.effectAllowed = "move";
|
|
1033
1033
|
}
|
|
1034
|
-
: undefined, onDragEnd: () => setDragCol(null), onClick: (e) => openColumnMenu(col.key, e.currentTarget), children: [Icon ? _jsx(Icon, { size: 14, strokeWidth: 1.75 }) : null, _jsx("span", { className: "recordstable-th-label", children: col.label }), _jsx("span", { className: "recordstable-sort", children: _jsx("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: _jsx("path", { d: "m4 6 4 4 4-4" }) }) })] })), openMenu === `col:${col.key}` &&
|
|
1034
|
+
: undefined, onDragEnd: () => setDragCol(null), onClick: (e) => openColumnMenu(col.key, e.currentTarget), children: [Icon ? _jsx(Icon, { size: 14, strokeWidth: 1.75 }) : null, _jsx("span", { className: "crisp-recordstable-th-label", children: col.label }), _jsx("span", { className: "crisp-recordstable-sort", children: _jsx("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: _jsx("path", { d: "m4 6 4 4 4-4" }) }) })] })), openMenu === `col:${col.key}` &&
|
|
1035
1035
|
rootRef.current &&
|
|
1036
|
-
createPortal(_jsxs("div", { ref: menuRef, className: "recordstable-menu recordstable-menu--fixed recordstable-menu--hdr", role: "menu", "aria-label": `${col.label} column`, style: menuPos ?? undefined, onKeyDown: onMenuKeyDown, children: [_jsxs("button", { type: "button", className: "recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => sortBy(col.key, "asc"), children: [_jsx(ArrowUp, { size: 15, strokeWidth: 1.75 }), t.sortAscending] }), _jsxs("button", { type: "button", className: "recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => sortBy(col.key, "desc"), children: [_jsx(ArrowDown, { size: 15, strokeWidth: 1.75 }), t.sortDescending] }), _jsxs("button", { type: "button", className: "recordstable-menu-item", role: "menuitem", tabIndex: -1, disabled: i <= 1, onClick: () => moveColumn(col.key, -1), children: [_jsx(ArrowLeft, { "data-rtl-flip": "", size: 15, strokeWidth: 1.75 }), t.moveLeft] }), _jsxs("button", { type: "button", className: "recordstable-menu-item", role: "menuitem", tabIndex: -1, disabled: i === 0 || i >= cols.length - 1, onClick: () => moveColumn(col.key, 1), children: [_jsx(ArrowRight, { "data-rtl-flip": "", size: 15, strokeWidth: 1.75 }), t.moveRight] }), _jsx("div", { className: "recordstable-menu-sep" }), _jsxs("button", { type: "button", className: "recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => {
|
|
1036
|
+
createPortal(_jsxs("div", { ref: menuRef, className: "crisp-recordstable-menu crisp-recordstable-menu--fixed crisp-recordstable-menu--hdr", role: "menu", "aria-label": `${col.label} column`, style: menuPos ?? undefined, onKeyDown: onMenuKeyDown, children: [_jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => sortBy(col.key, "asc"), children: [_jsx(ArrowUp, { size: 15, strokeWidth: 1.75 }), t.sortAscending] }), _jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => sortBy(col.key, "desc"), children: [_jsx(ArrowDown, { size: 15, strokeWidth: 1.75 }), t.sortDescending] }), _jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", role: "menuitem", tabIndex: -1, disabled: i <= 1, onClick: () => moveColumn(col.key, -1), children: [_jsx(ArrowLeft, { "data-rtl-flip": "", size: 15, strokeWidth: 1.75 }), t.moveLeft] }), _jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", role: "menuitem", tabIndex: -1, disabled: i === 0 || i >= cols.length - 1, onClick: () => moveColumn(col.key, 1), children: [_jsx(ArrowRight, { "data-rtl-flip": "", size: 15, strokeWidth: 1.75 }), t.moveRight] }), _jsx("div", { className: "crisp-recordstable-menu-sep" }), _jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => {
|
|
1037
1037
|
setRenamingCol(col.key);
|
|
1038
1038
|
setOpenMenu(null);
|
|
1039
|
-
}, children: [_jsx(Pencil, { size: 15, strokeWidth: 1.75 }), t.editColumnLabel] }), cols.length > 1 && (_jsxs("button", { type: "button", className: "recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => hideColumn(col.key), children: [_jsx(EyeOff, { size: 15, strokeWidth: 1.75 }), t.hideFromView] }))] }), rootRef.current), _jsx("span", { className: "recordstable-resize", "aria-hidden": "true", onPointerDown: (e) => {
|
|
1039
|
+
}, children: [_jsx(Pencil, { size: 15, strokeWidth: 1.75 }), t.editColumnLabel] }), cols.length > 1 && (_jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => hideColumn(col.key), children: [_jsx(EyeOff, { size: 15, strokeWidth: 1.75 }), t.hideFromView] }))] }), rootRef.current), _jsx("span", { className: "crisp-recordstable-resize", "aria-hidden": "true", onPointerDown: (e) => {
|
|
1040
1040
|
e.preventDefault();
|
|
1041
1041
|
e.stopPropagation();
|
|
1042
1042
|
const th = e.currentTarget
|
|
1043
1043
|
.parentElement;
|
|
1044
1044
|
resizeCol(col.key, e.clientX, th ? th.getBoundingClientRect().width : 180, e.currentTarget);
|
|
1045
1045
|
}, onClick: (e) => e.stopPropagation() })] }, col.key));
|
|
1046
|
-
}), _jsx("th", { className: "recordstable-th recordstable-addcol", children: allowAddColumn && (_jsx("button", { type: "button", onClick: addColumn, "aria-label": t.addColumn, children: _jsx(Plus, { size: 15, strokeWidth: 1.75 }) })) })] }) }), _jsx("tbody", { children: visibleRows.map((row) => (_jsxs("tr", { "data-selected": selected.has(row.id) ? "" : undefined, onContextMenu: (e) => {
|
|
1046
|
+
}), _jsx("th", { className: "crisp-recordstable-th crisp-recordstable-addcol", children: allowAddColumn && (_jsx("button", { type: "button", onClick: addColumn, "aria-label": t.addColumn, children: _jsx(Plus, { size: 15, strokeWidth: 1.75 }) })) })] }) }), _jsx("tbody", { children: visibleRows.map((row) => (_jsxs("tr", { "data-selected": selected.has(row.id) ? "" : undefined, onContextMenu: (e) => {
|
|
1047
1047
|
e.preventDefault();
|
|
1048
1048
|
ctxReturn.current = document.activeElement;
|
|
1049
1049
|
setCtxMenu({ x: e.clientX, y: e.clientY, id: row.id });
|
|
1050
|
-
}, children: [_jsx("td", { className: "recordstable-td recordstable-col-check", children: _jsx("span", { className: "recordstable-check-inner", children: _jsx(Checkbox, { "aria-label": `Select ${row.id}`, checked: selected.has(row.id), onClick: (e) => {
|
|
1050
|
+
}, children: [_jsx("td", { className: "crisp-recordstable-td crisp-recordstable-col-check", children: _jsx("span", { className: "crisp-recordstable-check-inner", children: _jsx(Checkbox, { "aria-label": `Select ${row.id}`, checked: selected.has(row.id), onClick: (e) => {
|
|
1051
1051
|
shiftHeld.current = e.shiftKey;
|
|
1052
1052
|
}, onChange: () => toggleRow(row.id) }) }) }), cols.map((col, i) => {
|
|
1053
1053
|
const canEdit = canEditCol(col);
|
|
@@ -1059,7 +1059,7 @@ export function RecordsTable({ labels, columns: columnsProp = defaultColumns, ro
|
|
|
1059
1059
|
// row instead of a bare "182,000", and the same header is
|
|
1060
1060
|
// repeated in every cell's context (#231).
|
|
1061
1061
|
const Cell = (i === 0 ? "th" : "td");
|
|
1062
|
-
return (_jsxs(Cell, { scope: i === 0 ? "row" : undefined, "data-cell": `${row.id}:${col.key}`, className: `recordstable-td${i === 0 ? " recordstable-col-entity" : ""}${canEdit ? " recordstable-td--editable" : ""}${isPicker ? " recordstable-td--picker" : ""}`, "data-enriched": col.enriched ? "" : undefined, "data-selected": selCell?.id === row.id && selCell?.key === col.key
|
|
1062
|
+
return (_jsxs(Cell, { scope: i === 0 ? "row" : undefined, "data-cell": `${row.id}:${col.key}`, className: `crisp-recordstable-td${i === 0 ? " crisp-recordstable-col-entity" : ""}${canEdit ? " crisp-recordstable-td--editable" : ""}${isPicker ? " crisp-recordstable-td--picker" : ""}`, "data-enriched": col.enriched ? "" : undefined, "data-selected": selCell?.id === row.id && selCell?.key === col.key
|
|
1063
1063
|
? ""
|
|
1064
1064
|
: undefined, onClick: () => {
|
|
1065
1065
|
if (isPicker)
|
|
@@ -1068,7 +1068,7 @@ export function RecordsTable({ labels, columns: columnsProp = defaultColumns, ro
|
|
|
1068
1068
|
scrollRef.current?.focus({ preventScroll: true });
|
|
1069
1069
|
}, onDoubleClick: canEdit
|
|
1070
1070
|
? () => setEditing({ id: row.id, key: col.key })
|
|
1071
|
-
: undefined, children: [isPicker ? (col.type === "status" ? (_jsx(StatusCell, { column: col, row: row, onChange: (v) => setCell(row.id, col.key, v) })) : col.type === "reference" ? (_jsx(ReferenceCell, { labels: t, column: col, row: row, onChange: (v) => setCell(row.id, col.key, v) })) : col.type === "tags" ? (_jsx(TagsCell, { labels: t, column: col, row: row, options: tagOptionsFor(col.key), onChange: (v) => setCell(row.id, col.key, v) })) : (_jsx(DateCell, { column: col, row: row, onChange: (v) => setCell(row.id, col.key, v) }))) : isEditing ? (_jsx("input", { className: `recordstable-edit${col.type === "number" ? " recordstable-edit--num" : ""}`,
|
|
1071
|
+
: undefined, children: [isPicker ? (col.type === "status" ? (_jsx(StatusCell, { column: col, row: row, onChange: (v) => setCell(row.id, col.key, v) })) : col.type === "reference" ? (_jsx(ReferenceCell, { labels: t, column: col, row: row, onChange: (v) => setCell(row.id, col.key, v) })) : col.type === "tags" ? (_jsx(TagsCell, { labels: t, column: col, row: row, options: tagOptionsFor(col.key), onChange: (v) => setCell(row.id, col.key, v) })) : (_jsx(DateCell, { column: col, row: row, onChange: (v) => setCell(row.id, col.key, v) }))) : isEditing ? (_jsx("input", { className: `crisp-recordstable-edit${col.type === "number" ? " crisp-recordstable-edit--num" : ""}`,
|
|
1072
1072
|
// biome-ignore lint/a11y/noAutofocus: focusing the just-opened editor is the expected behavior
|
|
1073
1073
|
autoFocus: true, defaultValue: cellText(col, row), onBlur: (e) => commitEdit(row.id, col.key, e.target.value), onKeyDown: (e) => {
|
|
1074
1074
|
if (e.key === "Enter")
|
|
@@ -1077,15 +1077,15 @@ export function RecordsTable({ labels, columns: columnsProp = defaultColumns, ro
|
|
|
1077
1077
|
setEditing(null);
|
|
1078
1078
|
} })) : (_jsx(CellView, { labels: t, column: col, row: row, pinned: i === 0 && pinned.has(row.id), onOpenPage: i === 0 && onOpenRecordPage
|
|
1079
1079
|
? () => onOpenRecordPage(row)
|
|
1080
|
-
: undefined, avatarTone: avatarTone })), i === 0 && onOpenRecord && !isEditing && (_jsx("button", { type: "button", className: "recordstable-open", "aria-label": `Open ${cellText(col, row)}`, onClick: (e) => {
|
|
1080
|
+
: undefined, avatarTone: avatarTone })), i === 0 && onOpenRecord && !isEditing && (_jsx("button", { type: "button", className: "crisp-recordstable-open", "aria-label": `Open ${cellText(col, row)}`, onClick: (e) => {
|
|
1081
1081
|
e.stopPropagation();
|
|
1082
1082
|
onOpenRecord(row);
|
|
1083
1083
|
}, children: _jsx(ArrowUpRight, { "data-rtl-flip": "", size: 15, strokeWidth: 1.75 }) }))] }, col.key));
|
|
1084
|
-
}), _jsx("td", { className: "recordstable-td recordstable-addcol" })] }, row.id))) }), _jsx("tfoot", { children: _jsxs("tr", { children: [_jsx("td", { className: "recordstable-sum recordstable-col-check" }), cols.map((col, i) => {
|
|
1084
|
+
}), _jsx("td", { className: "crisp-recordstable-td crisp-recordstable-addcol" })] }, row.id))) }), _jsx("tfoot", { children: _jsxs("tr", { children: [_jsx("td", { className: "crisp-recordstable-sum crisp-recordstable-col-check" }), cols.map((col, i) => {
|
|
1085
1085
|
const a = agg[col.key] ?? "none";
|
|
1086
1086
|
const res = summarize(col, a, visibleRows);
|
|
1087
1087
|
const sumOpen = openMenu === `sum:${col.key}`;
|
|
1088
|
-
return (_jsx("td", { className: `recordstable-sum${i === 0 ? " recordstable-col-entity" : ""}`, children: _jsxs("span", { className: "recordstable-toolgroup recordstable-sumgroup", children: [_jsx("button", { type: "button", className: "recordstable-sum-btn", "data-empty": res ? undefined : "", "data-menu-trigger": true, "aria-haspopup": "menu", onClick: (e) => {
|
|
1088
|
+
return (_jsx("td", { className: `crisp-recordstable-sum${i === 0 ? " crisp-recordstable-col-entity" : ""}`, children: _jsxs("span", { className: "crisp-recordstable-toolgroup crisp-recordstable-sumgroup", children: [_jsx("button", { type: "button", className: "crisp-recordstable-sum-btn", "data-empty": res ? undefined : "", "data-menu-trigger": true, "aria-haspopup": "menu", onClick: (e) => {
|
|
1089
1089
|
if (sumOpen) {
|
|
1090
1090
|
setOpenMenu(null);
|
|
1091
1091
|
return;
|
|
@@ -1097,13 +1097,13 @@ export function RecordsTable({ labels, columns: columnsProp = defaultColumns, ro
|
|
|
1097
1097
|
});
|
|
1098
1098
|
menuReturn.current = e.currentTarget;
|
|
1099
1099
|
setOpenMenu(`sum:${col.key}`);
|
|
1100
|
-
}, children: res ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "recordstable-sum-label", children: t.agg[a] }), _jsx("span", { className: "recordstable-sum-value", children: res.value })] })) : (_jsx("span", { className: "recordstable-sum-label", children: t.calculate })) }), sumOpen &&
|
|
1100
|
+
}, children: res ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "crisp-recordstable-sum-label", children: t.agg[a] }), _jsx("span", { className: "crisp-recordstable-sum-value", children: res.value })] })) : (_jsx("span", { className: "crisp-recordstable-sum-label", children: t.calculate })) }), sumOpen &&
|
|
1101
1101
|
rootRef.current &&
|
|
1102
|
-
createPortal(_jsx("div", { ref: menuRef, className: "recordstable-menu recordstable-menu--fixed recordstable-menu--up", role: "menu", "aria-label": `${col.label} summary`, style: menuPos ?? undefined, onKeyDown: onMenuKeyDown, children: aggOptions(col).map((opt) => (_jsxs("button", { type: "button", className: "recordstable-menu-item", role: "menuitemradio", tabIndex: -1, "aria-checked": a === opt, "data-on": a === opt ? "" : undefined, onClick: () => setAggValue(col.key, opt), children: [t.agg[opt], a === opt ? (_jsx(Check, { className: "recordstable-menu-check", size: 15, strokeWidth: 1.75 })) : null] }, opt))) }), rootRef.current)] }) }, col.key));
|
|
1103
|
-
}), _jsx("td", { className: "recordstable-sum recordstable-addcol" })] }) })] }), visibleRows.length === 0 ? (_jsx("div", { className: "recordstable-empty", children: _jsx(EmptyState, { variant: "page", icon: activeFilters ? (_jsx(ListFilter, { size: 18, strokeWidth: 1.75, "aria-hidden": "true" })) : (_jsx(Inbox, { size: 18, strokeWidth: 1.75, "aria-hidden": "true" })), title: activeFilters ? "No records match that filter" : t.noRecords, description: activeFilters
|
|
1102
|
+
createPortal(_jsx("div", { ref: menuRef, className: "crisp-recordstable-menu crisp-recordstable-menu--fixed crisp-recordstable-menu--up", role: "menu", "aria-label": `${col.label} summary`, style: menuPos ?? undefined, onKeyDown: onMenuKeyDown, children: aggOptions(col).map((opt) => (_jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", role: "menuitemradio", tabIndex: -1, "aria-checked": a === opt, "data-on": a === opt ? "" : undefined, onClick: () => setAggValue(col.key, opt), children: [t.agg[opt], a === opt ? (_jsx(Check, { className: "crisp-recordstable-menu-check", size: 15, strokeWidth: 1.75 })) : null] }, opt))) }), rootRef.current)] }) }, col.key));
|
|
1103
|
+
}), _jsx("td", { className: "crisp-recordstable-sum crisp-recordstable-addcol" })] }) })] }), visibleRows.length === 0 ? (_jsx("div", { className: "crisp-recordstable-empty", children: _jsx(EmptyState, { variant: "page", icon: activeFilters ? (_jsx(ListFilter, { size: 18, strokeWidth: 1.75, "aria-hidden": "true" })) : (_jsx(Inbox, { size: 18, strokeWidth: 1.75, "aria-hidden": "true" })), title: activeFilters ? "No records match that filter" : t.noRecords, description: activeFilters
|
|
1104
1104
|
? "None of your records match the filters that are set."
|
|
1105
|
-
: `Create your first ${cols.find((c) => c.type === "entity")?.label?.toLowerCase() ?? "record"} to get started.`, action: activeFilters ? (_jsxs(Button, { intent: "primary", size: "sm", onClick: () => setFilterConds([]), children: [_jsx(ListFilter, { size: 15, strokeWidth: 1.75 }), t.clearFilter] })) : (_jsxs(Button, { intent: "primary", size: "sm", onClick: addRow, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75 }), t.newRecord] })) }) })) : (_jsxs("button", { type: "button", className: "recordstable-addrow", onClick: addRow, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75, "aria-hidden": "true" }), t.newRecord] }))] }), _jsx("div", { className: "recordstable-live", role: "status", "aria-live": "polite", children: selectionAnnouncement }), selected.size > 0 && (_jsxs(BulkBar, { count: selected.size, countLabel: t.selectedCount, onClear: () => setSelected(new Set()), children: [_jsx(BulkBarButton, { icon: _jsx(ListPlus, { size: 15, strokeWidth: 1.75 }), onClick: addToList, children: t.addToList }), _jsx(BulkBarButton, { icon: _jsx(Mail, { size: 15, strokeWidth: 1.75 }), onClick: sendEmail, children: t.sendEmail }), _jsx(BulkBarButton, { icon: _jsx(Workflow, { size: 15, strokeWidth: 1.75 }), onClick: runWorkflow, children: t.runWorkflow }), _jsxs(Menu, { align: "end", "aria-label": t.moreActions, trigger: _jsx(BulkBarButton, { icon: _jsx(MoreHorizontal, { size: 15, strokeWidth: 1.75 }), children: t.more }), children: [_jsx(MenuItem, { icon: _jsx(Download, { size: 15, strokeWidth: 1.75 }), onSelect: exportSelected, children: t.exportCsv }), _jsx(MenuItem, { icon: _jsx(Trash2, { size: 15, strokeWidth: 1.75 }), danger: true, onSelect: deleteSelected, children: t.delete })] })] })), _jsx(CreateRecordDialog, { labels: t, open: creating, onOpenChange: setCreating, columns: cols, entityLabel: cols.find((c) => c.type === "entity")?.label ?? "record", onCreate: (row) => setData((prev) => [...prev, row]) }), ctxMenu &&
|
|
1106
|
-
createPortal(_jsxs("div", { ref: ctxRef, className: "recordstable-menu recordstable-ctx", role: "menu", "aria-label": t.recordActions, style: { position: "fixed", top: ctxMenu.y, left: ctxMenu.x }, onKeyDown: onCtxKeyDown, children: [_jsxs("button", { type: "button", className: "recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => copyRow(ctxMenu.id), children: [_jsx(Copy, { size: 15, strokeWidth: 1.75 }), t.copy] }), _jsxs("button", { type: "button", className: "recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => duplicateRow(ctxMenu.id), children: [_jsx(CopyPlus, { size: 15, strokeWidth: 1.75 }), t.duplicate] }), _jsxs("button", { type: "button", className: "recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => pinRow(ctxMenu.id), children: [_jsx(Star, { size: 15, strokeWidth: 1.75 }), t.addToList] }), _jsxs("button", { type: "button", className: "recordstable-menu-item recordstable-menu-item--danger", role: "menuitem", tabIndex: -1, onClick: () => deleteRow(ctxMenu.id), children: [_jsx(Trash2, { size: 15, strokeWidth: 1.75 }), t.delete] })] }), rootRef.current ?? document.body)] }));
|
|
1105
|
+
: `Create your first ${cols.find((c) => c.type === "entity")?.label?.toLowerCase() ?? "record"} to get started.`, action: activeFilters ? (_jsxs(Button, { intent: "primary", size: "sm", onClick: () => setFilterConds([]), children: [_jsx(ListFilter, { size: 15, strokeWidth: 1.75 }), t.clearFilter] })) : (_jsxs(Button, { intent: "primary", size: "sm", onClick: addRow, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75 }), t.newRecord] })) }) })) : (_jsxs("button", { type: "button", className: "crisp-recordstable-addrow", onClick: addRow, children: [_jsx(Plus, { size: 15, strokeWidth: 1.75, "aria-hidden": "true" }), t.newRecord] }))] }), _jsx("div", { className: "crisp-recordstable-live", role: "status", "aria-live": "polite", children: selectionAnnouncement }), selected.size > 0 && (_jsxs(BulkBar, { count: selected.size, countLabel: t.selectedCount, onClear: () => setSelected(new Set()), children: [_jsx(BulkBarButton, { icon: _jsx(ListPlus, { size: 15, strokeWidth: 1.75 }), onClick: addToList, children: t.addToList }), _jsx(BulkBarButton, { icon: _jsx(Mail, { size: 15, strokeWidth: 1.75 }), onClick: sendEmail, children: t.sendEmail }), _jsx(BulkBarButton, { icon: _jsx(Workflow, { size: 15, strokeWidth: 1.75 }), onClick: runWorkflow, children: t.runWorkflow }), _jsxs(Menu, { align: "end", "aria-label": t.moreActions, trigger: _jsx(BulkBarButton, { icon: _jsx(MoreHorizontal, { size: 15, strokeWidth: 1.75 }), children: t.more }), children: [_jsx(MenuItem, { icon: _jsx(Download, { size: 15, strokeWidth: 1.75 }), onSelect: exportSelected, children: t.exportCsv }), _jsx(MenuItem, { icon: _jsx(Trash2, { size: 15, strokeWidth: 1.75 }), danger: true, onSelect: deleteSelected, children: t.delete })] })] })), _jsx(CreateRecordDialog, { labels: t, open: creating, onOpenChange: setCreating, columns: cols, entityLabel: cols.find((c) => c.type === "entity")?.label ?? "record", onCreate: (row) => setData((prev) => [...prev, row]) }), ctxMenu &&
|
|
1106
|
+
createPortal(_jsxs("div", { ref: ctxRef, className: "crisp-recordstable-menu crisp-recordstable-ctx", role: "menu", "aria-label": t.recordActions, style: { position: "fixed", top: ctxMenu.y, left: ctxMenu.x }, onKeyDown: onCtxKeyDown, children: [_jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => copyRow(ctxMenu.id), children: [_jsx(Copy, { size: 15, strokeWidth: 1.75 }), t.copy] }), _jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => duplicateRow(ctxMenu.id), children: [_jsx(CopyPlus, { size: 15, strokeWidth: 1.75 }), t.duplicate] }), _jsxs("button", { type: "button", className: "crisp-recordstable-menu-item", role: "menuitem", tabIndex: -1, onClick: () => pinRow(ctxMenu.id), children: [_jsx(Star, { size: 15, strokeWidth: 1.75 }), t.addToList] }), _jsxs("button", { type: "button", className: "crisp-recordstable-menu-item crisp-recordstable-menu-item--danger", role: "menuitem", tabIndex: -1, onClick: () => deleteRow(ctxMenu.id), children: [_jsx(Trash2, { size: 15, strokeWidth: 1.75 }), t.delete] })] }), rootRef.current ?? document.body)] }));
|
|
1107
1107
|
}
|
|
1108
1108
|
export const defaultColumns = [
|
|
1109
1109
|
{ key: "company", label: "Company", type: "entity", icon: Building2 },
|