@adaptabletools/adaptable-cjs 23.0.0-canary.1 → 23.0.0-canary.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/index.css +130 -137
- package/package.json +1 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -3
- package/src/AdaptableState/Common/AdaptableFormat.d.ts +1 -1
- package/src/AdaptableState/LayoutState.d.ts +5 -4
- package/src/AdaptableState/StyledColumnState.d.ts +7 -16
- package/src/AdaptableState/StyledColumnState.js +10 -0
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/ReportScheduleRan.d.ts +4 -0
- package/src/Api/Internal/EventInternalApi.js +2 -1
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/Components/Buttons/ButtonInfo.d.ts +1 -1
- package/src/View/Components/Buttons/ButtonInfo.js +4 -4
- package/src/View/Components/ColumnFilter/AdaptableColumnFilter.js +1 -1
- package/src/View/Components/ColumnFilter/ColumnFilter.js +15 -5
- package/src/View/Components/ColumnFilter/FloatingFilter.js +57 -59
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -1
- package/src/View/Components/Forms/AdaptableFormControlTextClear.js +2 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +2 -2
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +3 -8
- package/src/View/GridFilter/GridFilterViewPanel.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +4 -4
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +6 -2
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +1 -1
- package/src/View/Layout/Wizard/sections/SettingsSection.js +1 -1
- package/src/View/License/LicenseWatermark.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +1 -1
- package/src/View/Wizard/OnePageWizards.js +1 -1
- package/src/agGrid/AdaptableAgGrid.js +2 -2
- package/src/components/Card/index.js +1 -1
- package/src/components/Combobox/index.js +10 -4
- package/src/components/Datepicker/index.js +2 -2
- package/src/components/Dialog/index.js +1 -1
- package/src/components/DragAndDropContext/TabList.js +1 -1
- package/src/components/Dropdown/Arrows.js +0 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/ExpressionEditor/index.js +1 -1
- package/src/components/Input/index.js +1 -1
- package/src/components/NewDropdownButton/index.d.ts +1 -0
- package/src/components/NewDropdownButton/index.js +2 -2
- package/src/components/NewSelect/index.d.ts +2 -0
- package/src/components/NewSelect/index.js +10 -7
- package/src/components/Panel/index.js +1 -1
- package/src/components/SimpleButton/index.js +1 -1
- package/src/components/Tabs/index.js +1 -1
- package/src/components/Tree/TreeDropdown/index.js +4 -8
- package/src/components/ui/button.d.ts +5 -2
- package/src/components/ui/button.js +8 -6
- package/src/components/ui/calendar.d.ts +1 -1
- package/src/components/ui/combobox.d.ts +16 -16
- package/src/components/ui/combobox.js +48 -49
- package/src/components/ui/input-group.d.ts +10 -9
- package/src/components/ui/input-group.js +19 -16
- package/src/components/ui/input.d.ts +2 -2
- package/src/components/ui/input.js +7 -4
- package/src/components/ui/popover.d.ts +5 -5
- package/src/components/ui/popover.js +5 -5
- package/src/components/ui/select.d.ts +7 -6
- package/src/components/ui/select.js +19 -17
- package/src/components/ui/textarea.d.ts +2 -2
- package/src/components/ui/textarea.js +7 -4
- package/src/components/ui/tooltip.d.ts +6 -5
- package/src/components/ui/tooltip.js +10 -7
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +2 -2
- package/src/layout-manager/src/index.js +5 -4
- package/src/layout-manager/src/normalizeLayoutModel.js +5 -1
- package/src/layout-manager/src/rowGroupDisplayType.d.ts +6 -0
- package/src/layout-manager/src/rowGroupDisplayType.js +29 -0
- package/src/lib/utils.d.ts +20 -0
- package/src/lib/utils.js +48 -1
- package/src/metamodel/adaptable.metamodel.d.ts +7 -26
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade23.d.ts +2 -3
- package/src/migration/VersionUpgrade23.js +4 -16
- package/themes/dark.css +7 -17
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -86,7 +86,7 @@ const OnePageWizard = (props) => {
|
|
|
86
86
|
if (section === '-') {
|
|
87
87
|
return (0, jsx_runtime_1.jsx)(React.Fragment, {}, index);
|
|
88
88
|
}
|
|
89
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", "data-name": `section-${index}`, className: "twa:min-h-full twa:mr-2", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "ab-OnePageWizard__section twa:flex-1 twa:rounded-standard twa:overflow-auto twa:bg-
|
|
89
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", "data-name": `section-${index}`, className: "twa:min-h-full twa:mr-2", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "ab-OnePageWizard__section twa:flex-1 twa:rounded-standard twa:overflow-auto twa:bg-background", children: section.render(props.data, index) }) }, index));
|
|
90
90
|
};
|
|
91
91
|
const handleNavigation = (0, useKeyboardNavigation_1.useKeyboardNavigation)(setCurrentSection, visibleSections);
|
|
92
92
|
const selectedNodeRef = (0, react_1.useRef)(null);
|
|
@@ -100,6 +100,7 @@ const FlashingCellService_1 = require("../Utilities/Services/FlashingCellService
|
|
|
100
100
|
const AgGridExportAdapter_1 = require("./AgGridExportAdapter");
|
|
101
101
|
const LayoutHelpers_1 = require("../Api/Implementation/LayoutHelpers");
|
|
102
102
|
const src_1 = require("../layout-manager/src");
|
|
103
|
+
const rowGroupDisplayType_1 = require("../layout-manager/src/rowGroupDisplayType");
|
|
103
104
|
const isPivotLayoutModel_1 = require("../layout-manager/src/isPivotLayoutModel");
|
|
104
105
|
const AdaptableColumn_1 = require("../AdaptableState/Common/AdaptableColumn");
|
|
105
106
|
const agGridDataTypeDefinitions_1 = require("./agGridDataTypeDefinitions");
|
|
@@ -465,8 +466,7 @@ class AdaptableAgGrid {
|
|
|
465
466
|
if ((0, isPivotLayoutModel_1.isPivotLayoutModel)(layoutModel)) {
|
|
466
467
|
gridOptions.pivotDefaultExpanded = layoutModel.PivotExpandLevel;
|
|
467
468
|
}
|
|
468
|
-
gridOptions.groupDisplayType =
|
|
469
|
-
layoutModel.RowGroupDisplayType === 'multi' ? 'multipleColumns' : 'singleColumn';
|
|
469
|
+
gridOptions.groupDisplayType = (0, rowGroupDisplayType_1.rowGroupDisplayTypeToGridOption)(layoutModel.RowGroupDisplayType);
|
|
470
470
|
// fixes issue #3053
|
|
471
471
|
gridOptions.suppressAggFuncInHeader = !!layoutModel.SuppressAggFuncInHeader;
|
|
472
472
|
if (!(0, isPivotLayoutModel_1.isPivotLayoutModel)(layoutModel) &&
|
|
@@ -8,7 +8,7 @@ const clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
|
8
8
|
const Flex_1 = require("../Flex");
|
|
9
9
|
function Card(props) {
|
|
10
10
|
const { shadow = true, children, className, style, gap = 2 } = props;
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: (0, clsx_1.default)('twa:bg-
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: (0, clsx_1.default)('twa:bg-background twa:text-foreground', 'ab-Card', 'twa:text-3', 'twa:rounded-standard twa:p-2', 'twa:flex twa:flex-col', {
|
|
12
12
|
'twa:shadow-sm': shadow,
|
|
13
13
|
'twa:gap-0': gap === 0,
|
|
14
14
|
'twa:gap-1': gap === 1,
|
|
@@ -390,7 +390,7 @@ const MultiCombobox_SimpleSearchable = (props) => {
|
|
|
390
390
|
const shouldKeepTrigger = props.searchable === false && selectedItems.length > 0;
|
|
391
391
|
return ((0, jsx_runtime_1.jsxs)(React.Fragment, { children: [props.renderInputValues ? (props.renderInputValues(selectedItems)) : ((0, jsx_runtime_1.jsx)(MultiComboboxChips, { selectedItems: selectedItems, showClear: showClear })), props.renderInput !== false ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(combobox_1.ComboboxChipsInput, { placeholder: selectedItems.length > 0 ? '' : props.placeholder, readOnly: props.searchable === false, onFocus: props.onFocus, onBlur: props.onBlur, className: props.searchable === false && selectedItems.length > 0
|
|
392
392
|
? 'twa:absolute! twa:inset-0 twa:min-h-auto! twa:max-h-auto!' // so we fill the parent container and on click we can open the combobox as usual
|
|
393
|
-
: 'twa:flex-1' }), props.searchable === false && selectedItems.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "twa:flex-1" })) : null, (0, jsx_runtime_1.jsx)("div", { "data-slot": "input-group", role: "group", className: "twa:group/input-group twa:z-10", children: (0, jsx_runtime_1.jsxs)(input_group_1.InputGroupAddon, { align: "inline-end", className: "twa:p-0 px twa:gap-0.5", children: [props.isLoading && ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), (0, jsx_runtime_1.jsx)(input_group_1.InputGroupButton, { size: "icon-xs", variant: "ghost", render: (0, jsx_runtime_1.jsx)(combobox_1.ComboboxTrigger, { className: "twa:min-h-auto!" }), "data-slot": "
|
|
393
|
+
: 'twa:flex-1' }), props.searchable === false && selectedItems.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "twa:flex-1" })) : null, (0, jsx_runtime_1.jsx)("div", { "data-slot": "input-group", role: "group", className: "twa:group/input-group twa:z-10", children: (0, jsx_runtime_1.jsxs)(input_group_1.InputGroupAddon, { align: "inline-end", className: "twa:p-0 px twa:gap-0.5", children: [props.isLoading && ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), (0, jsx_runtime_1.jsx)(input_group_1.InputGroupButton, { size: "icon-xs", variant: "ghost", render: (0, jsx_runtime_1.jsx)(combobox_1.ComboboxTrigger, { className: "twa:min-h-auto!" }), "data-slot": "combobox-toggle", className: (0, clsx_1.default)(`twa:data-pressed:bg-transparent`, shouldKeepTrigger
|
|
394
394
|
? ''
|
|
395
395
|
: 'twa:group-has-data-[slot=combobox-clear]/input-group:hidden'), disabled: isDisabled }), showClear && (0, jsx_runtime_1.jsx)(combobox_1.ComboboxClear, { disabled: isDisabled })] }) })] })) : null] }));
|
|
396
396
|
} }) }), (0, jsx_runtime_1.jsx)(combobox_1.ComboboxContent, { anchor: anchor, style: getContentStyle({ maxLabelLength }), resizable: props.resizable, children: (0, jsx_runtime_1.jsx)(AdaptableComboboxList, { searchable: props.searchable, emptyText: emptyText, renderItemLabel: props.renderItemLabel, showSelectAllCheckbox: props.showSelectAllCheckbox, renderCheckboxIndicator: props.renderCheckboxIndicator ?? true, onCheckAllChange: onCheckAllChange, totalCount: allItems.length, groups: props.groups, virtualized: !!props.virtualized, showItemTooltip: !!props.showItemTooltip, open: props.open, isLoading: props.isLoading }) })] }));
|
|
@@ -479,11 +479,11 @@ const MultiCombobox_MenuListSearchable = (props) => {
|
|
|
479
479
|
props.onBlur?.();
|
|
480
480
|
}
|
|
481
481
|
}, className: (0, clsx_1.default)('twa:relative', props.className, _props?.className), children: (0, jsx_runtime_1.jsx)(combobox_1.ComboboxValue, { children: (selectedItems) => {
|
|
482
|
-
return ((0, jsx_runtime_1.jsxs)(React.Fragment, { children: [props.renderInputValues ? (props.renderInputValues(selectedItems)) : ((0, jsx_runtime_1.jsx)(MultiComboboxChips, { selectedItems: selectedItems, showClear: showClear })), props.renderInput !== false ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(combobox_1.ComboboxChipsInput, { ref: chipsInputRef, placeholder: selectedItems.length > 0 ? '' : props.placeholder, readOnly: true, value: '', className: 'twa:flex-1' }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "twa:flex-1" })), (0, jsx_runtime_1.jsx)("div", { "data-slot": "input-group", role: "group", className: "twa:group/input-group", children: (0, jsx_runtime_1.jsxs)(input_group_1.InputGroupAddon, { align: "inline-end", className: "twa:p-0 px", children: [props.isLoading && ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), (0, jsx_runtime_1.jsx)(input_group_1.InputGroupButton, { size: "icon-xs", variant: "ghost", render: (0, jsx_runtime_1.jsx)(combobox_1.ComboboxTrigger, { className: "twa:min-h-auto!", ref: chevronRef, "data-slot": "
|
|
482
|
+
return ((0, jsx_runtime_1.jsxs)(React.Fragment, { children: [props.renderInputValues ? (props.renderInputValues(selectedItems)) : ((0, jsx_runtime_1.jsx)(MultiComboboxChips, { selectedItems: selectedItems, showClear: showClear })), props.renderInput !== false ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(combobox_1.ComboboxChipsInput, { ref: chipsInputRef, placeholder: selectedItems.length > 0 ? '' : props.placeholder, readOnly: true, value: '', className: 'twa:flex-1' }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "twa:flex-1" })), (0, jsx_runtime_1.jsx)("div", { "data-slot": "input-group", role: "group", className: "twa:group/input-group", children: (0, jsx_runtime_1.jsxs)(input_group_1.InputGroupAddon, { align: "inline-end", className: "twa:p-0 px", children: [props.isLoading && ((0, jsx_runtime_1.jsx)(lucide_react_1.Loader2Icon, { className: "twa:size-4 twa:text-muted-foreground twa:animate-spin" })), (0, jsx_runtime_1.jsx)(input_group_1.InputGroupButton, { size: "icon-xs", variant: "ghost", render: (0, jsx_runtime_1.jsx)(combobox_1.ComboboxTrigger, { className: "twa:min-h-auto!", ref: chevronRef, "data-slot": "combobox-toggle",
|
|
483
483
|
// we already have the role="combobox" on the parent
|
|
484
484
|
// so we want to avoid the same role twice in the component,
|
|
485
485
|
// hence we use the role="widget" here.
|
|
486
|
-
role: "widget" }), "data-slot": "
|
|
486
|
+
role: "widget" }), "data-slot": "combobox-toggle", className: (0, clsx_1.default)(`twa:data-pressed:bg-transparent`, 'twa:group-has-data-[slot=combobox-clear]/input-group:hidden'), disabled: isDisabled }), showClear && (0, jsx_runtime_1.jsx)(combobox_1.ComboboxClear, { disabled: isDisabled })] }) })] }));
|
|
487
487
|
} }) }));
|
|
488
488
|
};
|
|
489
489
|
return ((0, jsx_runtime_1.jsxs)(AdaptableCombobox_Root, { ...props, value: value, multiple: true, allItems: allItems, itemByValue: itemByValue, inputValue: inputValue, onInputValueChange: onInputValueChange, onValueChange: onValueChange, onOpenChange: onOpenChange, children: [props.renderInput === false ? ((0, jsx_runtime_1.jsx)(combobox_1.ComboboxTrigger, { nativeButton: false, render: renderChips })) : (renderChips(undefined)), (0, jsx_runtime_1.jsxs)(combobox_1.ComboboxContent, { anchor: anchor, style: getContentStyle({ maxLabelLength }), resizable: props.resizable, contentRef: contentRefCallback, children: [(0, jsx_runtime_1.jsx)(combobox_1.ComboboxInput, { placeholder: 'Filter...', showClear: false, ref: searchInputRef, showTrigger: false, disabled: isDisabled, onFocus: handleFocus, onBlur: handleBlur, role: "searchbox", className: 'twa:min-h-input', children: typeof props.renderSearchInputTrailing === 'function'
|
|
@@ -523,7 +523,13 @@ const GridFilterCombobox = (props) => {
|
|
|
523
523
|
const className = (0, utils_1.cn)(
|
|
524
524
|
// remove the border/shadow and position it properly
|
|
525
525
|
// to adjust for outline on the input
|
|
526
|
-
'twa:[.ab-FloatingFilter_&]:border-none twa:[.ab-FloatingFilter_&]:inset-y-0.5 twa:[.ab-FloatingFilter_&]:inset-x-0 twa:[.ab-FloatingFilter_&]:absolute twa:[.ab-FloatingFilter_&]:shadow-none twa:[.ab-FloatingFilter_&]:min-h-auto!',
|
|
526
|
+
'twa:[.ab-FloatingFilter_&]:border-none twa:[.ab-FloatingFilter_&]:inset-y-0.5 twa:[.ab-FloatingFilter_&]:inset-x-0 twa:[.ab-FloatingFilter_&]:absolute twa:[.ab-FloatingFilter_&]:shadow-none twa:[.ab-FloatingFilter_&]:min-h-auto!',
|
|
527
|
+
// more adjustments for very compact ag grid themes
|
|
528
|
+
'twa:[.ab-FloatingFilter_&]:[line-height:1]', 'twa:[.ab-FloatingFilter_[data-slot=combobox-trigger]]:py-0',
|
|
529
|
+
// also for very compact ag grid themes
|
|
530
|
+
// make the floating-filter combobox a size container so the toggle can
|
|
531
|
+
// shrink purely via CSS when the control is small in height (see ColumnFilter/base.css)
|
|
532
|
+
'twa:[.ab-FloatingFilter_&]:[container-type:size]', comboboxProps.className);
|
|
527
533
|
const mergedProps = {
|
|
528
534
|
...sharedProps,
|
|
529
535
|
...comboboxProps,
|
|
@@ -253,12 +253,12 @@ exports.Datepicker = React.forwardRef((props, ref) => {
|
|
|
253
253
|
width: style?.width,
|
|
254
254
|
maxWidth: style?.maxWidth,
|
|
255
255
|
border: style?.border,
|
|
256
|
-
}, tabIndex: -1, className: (0, utils_1.cn)('ab-Datepicker twa:flex twa:flex-row', 'twa:bg-
|
|
256
|
+
}, tabIndex: -1, className: (0, utils_1.cn)('ab-Datepicker twa:flex twa:flex-row twa:shadow-none', 'twa:bg-input-background', twUtils_1.targetOwn.focusWithinOutline, open && 'twa:border-ring twa:ring-3 twa:ring-ring/50', className), children: [(0, jsx_runtime_1.jsx)(AdaptableDateInlineInput_1.AdaptableDateInlineInput, { ref: ref, "data-slot": "input-group-control", value: inputValue, placeholder: placeholder ?? '', onChange: (v) => {
|
|
257
257
|
const date = new Date(v);
|
|
258
258
|
if ((0, date_fns_1.isValid)(date)) {
|
|
259
259
|
updateValue(date);
|
|
260
260
|
}
|
|
261
|
-
}, className: "twa:h-auto twa:min-w-0 twa:outline-none twa:min-h-auto twa:py-0 twa:flex-1 twa:rounded-none twa:border-0 twa:bg-transparent twa:shadow-none twa:ring-0 twa:focus-visible:ring-0 twa:dark:bg-transparent", style: style, disabled: disabled }), (0, jsx_runtime_1.jsxs)(input_group_1.InputGroupAddon, { align: "inline-end", children: [inputValue ? clearButton : null, calendarButton] })] }) }), (0, jsx_runtime_1.jsx)(popover_1.PopoverContent, { className: "twa:w-auto twa:p-0", align: "start", sideOffset:
|
|
261
|
+
}, className: "twa:h-auto twa:min-w-0 twa:outline-none twa:min-h-auto twa:py-0 twa:flex-1 twa:rounded-none twa:border-0 twa:bg-transparent twa:shadow-none twa:ring-0 twa:focus-visible:ring-0 twa:dark:bg-transparent", style: style, disabled: disabled }), (0, jsx_runtime_1.jsxs)(input_group_1.InputGroupAddon, { align: "inline-end", children: [inputValue ? clearButton : null, calendarButton] })] }) }), (0, jsx_runtime_1.jsx)(popover_1.PopoverContent, { className: "twa:w-auto twa:p-0", align: "start", sideOffset: 8, children: (0, jsx_runtime_1.jsx)("div", { ref: popupRefCallback, tabIndex: -1, role: "region", "aria-label": "Calendar", className: (0, utils_1.cn)('twa:relative twa:isolate twa:overflow-visible twa:outline-none twa:rounded-standard', twUtils_1.targetOwn.focusWithinOutline), onKeyDown: () => {
|
|
262
262
|
// console.log('onKeyDown', e.key);
|
|
263
263
|
// return;
|
|
264
264
|
// if (e.key === 'Tab') {
|
|
@@ -110,7 +110,7 @@ exports.Dialog = React.forwardRef((props, dialogRef) => {
|
|
|
110
110
|
if (boxProps && boxProps.onClick) {
|
|
111
111
|
boxProps.onClick(e);
|
|
112
112
|
}
|
|
113
|
-
}, onKeyDown: onKeyDown, className: (0, clsx_1.default)('twa:relative', 'twa:bg-
|
|
113
|
+
}, onKeyDown: onKeyDown, className: (0, clsx_1.default)('twa:relative', 'twa:bg-background', 'twa:text-foreground', 'twa:fill-foreground', 'twa:rounded-standard', 'twa:flex twa:flex-col', twUtils_1.targetOwn.focusOutline, twUtils_1.targetOwn.focusWithinOutline, baseClassName, modal ? `${baseClassName}--modal` : `${baseClassName}--not-modal`, className), ref: boxRef, children: [children, closeButton] }));
|
|
114
114
|
const content = fixed ? ((0, jsx_runtime_1.jsx)("div", { onClick: setPreventDismissFlag, className: (0, clsx_1.default)(`${baseClassName}-fixed-wrapper`, 'twa:fixed twa:inset-0', 'twa:m-auto', 'twa:flex twa:items-center twa:justify-center'), children: box })) : (box);
|
|
115
115
|
if (windowModal) {
|
|
116
116
|
return (0, jsx_runtime_1.jsx)(WindowModal_1.WindowModal, { ...windowModalProps, children: content });
|
|
@@ -44,7 +44,7 @@ function TabItem({ tab, tabId, tabIndex, tabs, onTabsChange, onRemove, onRemoveT
|
|
|
44
44
|
!context.permittedActions.deleteTab) {
|
|
45
45
|
showHeader = false;
|
|
46
46
|
}
|
|
47
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ...restDomProps, className: (0, clsx_1.default)('twa:bg-
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ...restDomProps, className: (0, clsx_1.default)('twa:bg-background', 'twa:select-none', 'ab-ModuleSelector__TabItem twa:min-w-32', restDomProps.className), "data-name": "dashboard-tab", children: [showHeader ? ((0, jsx_runtime_1.jsxs)("div", { className: "ab-ModuleSelector__TabItem__header", children: [(0, jsx_runtime_1.jsx)("div", { ...(!isDragDisabled ? { onPointerDown } : {}), style: context.permittedActions.dragAndDropTab ? {} : { display: 'none' }, children: (0, jsx_runtime_1.jsx)(icons_1.Icon, { name: "drag" }) }), context.permittedActions.editTabName ? ((0, jsx_runtime_1.jsx)("input", { className: "ab-ModuleSelector__TabItem__header-input", type: "text", disabled: disabled, value: tab.Name, onChange: (event) => {
|
|
48
48
|
onChangeTabName(event.target.value);
|
|
49
49
|
} })) : (tab.Name), context.permittedActions.deleteTab && ((0, jsx_runtime_1.jsx)(SimpleButton_1.default, { disabled: disabled, icon: "delete", variant: "text", onClick: onRemove }))] })) : null, (0, jsx_runtime_1.jsx)(ToolbarList, { disabled: disabled, toolbars: tab.Items, tabIndex: tabIndex, tabs: tabs, onTabsChange: onTabsChange, onRemove: onRemoveToolbar })] }));
|
|
50
50
|
} }));
|
|
@@ -120,7 +120,7 @@ const FunctionsDropdown = ({ expressionFunctions, baseClassName }) => {
|
|
|
120
120
|
* - mouse leaves
|
|
121
121
|
* - a function is inserted
|
|
122
122
|
*/
|
|
123
|
-
return ((0, jsx_runtime_1.jsx)(OverlayTrigger_1.default, { ref: dropdownRef, showEvent: "mouseenter", hideEvent: "mouseleave", targetOffset: 5, render: () => ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: `${baseClassName}__dropdown-functions-list-wrapper twa:max-w-[60vw] twa:shadow-md twa:bg-
|
|
123
|
+
return ((0, jsx_runtime_1.jsx)(OverlayTrigger_1.default, { ref: dropdownRef, showEvent: "mouseenter", hideEvent: "mouseleave", targetOffset: 5, render: () => ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: `${baseClassName}__dropdown-functions-list-wrapper twa:max-w-[60vw] twa:shadow-md twa:bg-background twa:text-foreground twa:text-3 twa:rounded-standard twa:p-3`, flexDirection: "column", onMouseLeave: () => hidePopup(), children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: "twa:md:gap-3 twa:gap-2 twa:pb-2 twa:md:justify-between twa:justify-start twa:flex-wrap twa:border-b twa:border-primarydark/30 twa:mb-2", children: categoryOptions.map((option, index) => {
|
|
124
124
|
return ((0, jsx_runtime_1.jsx)(Radio_1.default, { onFocus: (event) => {
|
|
125
125
|
event.preventDefault();
|
|
126
126
|
event.stopPropagation();
|
|
@@ -81,7 +81,7 @@ function ExpressionEditor(props) {
|
|
|
81
81
|
}
|
|
82
82
|
}, children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: "twa:flex-1 twa:text-2", flexDirection: "row", "data-name": "expression-editor", style: { minHeight: 0 }, children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: "twa:flex-1 twa:pr-2 twa:overflow-auto twa:min-h-0", "data-name": "expression-builder", flexDirection: "column", children: [editorInput, StringExtensions_1.default.IsNotNullOrEmpty(expressionText?.trim()) && ((0, jsx_runtime_1.jsx)(ExpressionFunctionDocumentation_1.ExpressionFunctionDocumentation, { expressionFunction: selectedFunction })),
|
|
83
83
|
/* displayed for advanced queries (observable&Aggregation) to give the users a starting point */
|
|
84
|
-
StringExtensions_1.default.IsNullOrEmpty(expressionText?.trim()) && renderQueryHints(type), showDocumentationLinks && ((0, jsx_runtime_1.jsxs)(HelpBlock_1.default, { "data-name": "query-documentation", className: "twa:my-2 twa:p-2 twa:text-3", children: [(0, jsx_runtime_1.jsx)(ButtonInfo_1.ButtonInfo, { className: "twa:mr-2", onClick: () => window.open(queryDocumentationLink, '_blank') }), "See documentation for more details and examples"] })), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1" }), showNamedQueryStuff && saveAsNamedQueryElement] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: `${exports.baseClassName}__sidebar twa:pb-2 twa:px-2 twa:overflow-auto twa:h-full twa:w-[280px]`, "data-name": "expression-sidebar", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:h-full twa:p-2 twa:rounded-standard twa:shadow-md twa:bg-
|
|
84
|
+
StringExtensions_1.default.IsNullOrEmpty(expressionText?.trim()) && renderQueryHints(type), showDocumentationLinks && ((0, jsx_runtime_1.jsxs)(HelpBlock_1.default, { "data-name": "query-documentation", className: "twa:my-2 twa:p-2 twa:text-3", children: [(0, jsx_runtime_1.jsx)(ButtonInfo_1.ButtonInfo, { className: "twa:mr-2", onClick: () => window.open(queryDocumentationLink, '_blank') }), "See documentation for more details and examples"] })), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1" }), showNamedQueryStuff && saveAsNamedQueryElement] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: `${exports.baseClassName}__sidebar twa:pb-2 twa:px-2 twa:overflow-auto twa:h-full twa:w-[280px]`, "data-name": "expression-sidebar", children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:h-full twa:p-2 twa:rounded-standard twa:shadow-md twa:bg-background twa:text-foreground", children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { className: "twa:h-full", children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { value: "column", children: "Columns" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { value: "field", children: "Fields" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Tab, { value: "named-query", children: "Named Queries" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tabs.Content, { className: "twa:flex-1 twa:h-full", children: (0, jsx_runtime_1.jsx)(DataTableEditor_1.DataTableEditor, { type: "column", dataFormatter: (value) => `[${value}]`, fields: queryableColumns.map((column) => ({
|
|
85
85
|
label: column.friendlyName,
|
|
86
86
|
value: column.columnId,
|
|
87
87
|
dataType: column.dataType,
|
|
@@ -18,7 +18,7 @@ const Input = React.forwardRef((props, ref) => {
|
|
|
18
18
|
type = 'text';
|
|
19
19
|
}
|
|
20
20
|
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { as: as ?? 'input', ref: ref, ...inputProps, type: type, disabled: disabled, className: (0, utils_1.cn)(exports.baseClassName, 'twa:min-h-input', 'twa:rounded-input', twUtils_1.targetOwn.focusOutline, type ? `${exports.baseClassName}--type-${type}` : '', disabled ? `${exports.baseClassName}--disabled` : '', {
|
|
21
|
-
'twa:bg-
|
|
21
|
+
'twa:bg-input-background': !disabled,
|
|
22
22
|
'twa:bg-(--ab-cmp-input--disabled__background)': disabled,
|
|
23
23
|
}, className) }));
|
|
24
24
|
});
|
|
@@ -22,5 +22,6 @@ export type NewDropdownButtonProps = {
|
|
|
22
22
|
align?: 'start' | 'center' | 'end';
|
|
23
23
|
'data-name'?: string;
|
|
24
24
|
tone?: SimpleButtonProps['tone'];
|
|
25
|
+
showDivider?: boolean;
|
|
25
26
|
};
|
|
26
27
|
export declare const NewDropdownButton: React.ForwardRefExoticComponent<NewDropdownButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -10,11 +10,11 @@ const utils_1 = require("../../lib/utils");
|
|
|
10
10
|
const lucide_react_1 = require("lucide-react");
|
|
11
11
|
const SimpleButton_1 = tslib_1.__importDefault(require("../SimpleButton"));
|
|
12
12
|
exports.NewDropdownButton = React.forwardRef((props, ref) => {
|
|
13
|
-
const { items, children, className, disabled, tooltip, variant = 'text', accessLevel, side = 'bottom', align = 'start', 'data-name': dataName, tone = 'neutral', } = props;
|
|
13
|
+
const { items, children, className, disabled, tooltip, variant = 'text', accessLevel, side = 'bottom', align = 'start', 'data-name': dataName, tone = 'neutral', showDivider = true, } = props;
|
|
14
14
|
const isHidden = accessLevel === 'Hidden';
|
|
15
15
|
const isReadOnly = accessLevel === 'ReadOnly';
|
|
16
16
|
const isDisabled = disabled || isHidden || isReadOnly;
|
|
17
|
-
const trigger = ((0, jsx_runtime_1.jsxs)(dropdown_menu_1.DropdownMenuTrigger, { render: (0, jsx_runtime_1.jsx)(SimpleButton_1.default, { ref: ref, tone: tone, variant: variant, disabled: isDisabled, className: (0, utils_1.cn)(className, 'twa:pr-1 twa:active:translate-y-0 twa:flex-row twa:flex-none', variant !== 'text' ? 'twa:gap-1' : 'twa:gap-0.5'), "data-name": dataName }), children: [children, (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('twa:h-full twa:my-1', variant !== 'text' ? 'twa:border-l twa:border-border' : '') }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDownIcon, { className: "twa:size-3.5 twa:opacity-60 twa:transition-transform twa:duration-200 twa:[[data-popup-open]_&]:rotate-180" })] }));
|
|
17
|
+
const trigger = ((0, jsx_runtime_1.jsxs)(dropdown_menu_1.DropdownMenuTrigger, { render: (0, jsx_runtime_1.jsx)(SimpleButton_1.default, { ref: ref, tone: tone, variant: variant, disabled: isDisabled, className: (0, utils_1.cn)(className, 'twa:pr-1 twa:active:translate-y-0 twa:flex-row twa:flex-none', variant !== 'text' ? 'twa:gap-1' : 'twa:gap-0.5'), "data-name": dataName }), children: [children, showDivider && ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('twa:h-full twa:my-1', variant !== 'text' ? 'twa:border-l twa:border-border' : '') })), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDownIcon, { className: "twa:size-3.5 twa:opacity-60 twa:transition-transform twa:duration-200 twa:[[data-popup-open]_&]:rotate-180" })] }));
|
|
18
18
|
const maxLabelLength = items.reduce((max, item) => Math.max(max, typeof item.label === 'string' ? item.label.length : 0), 0);
|
|
19
19
|
return ((0, jsx_runtime_1.jsxs)(dropdown_menu_1.DropdownMenu, { children: [tooltip ? (0, jsx_runtime_1.jsx)(NewTooltip_1.NewTooltip, { label: tooltip, children: trigger }) : trigger, (0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuContent, { side: side, align: align, style: {
|
|
20
20
|
// minWidth: `min(max(${maxLabelLength + 5}ch, calc(var(--ab-base-space) * 32)),80vw)`,
|
|
@@ -9,10 +9,12 @@ type SelectGroupType<T extends SelectItemType> = {
|
|
|
9
9
|
items: T[];
|
|
10
10
|
};
|
|
11
11
|
type NewSelectBaseProps<T extends SelectItemType> = {
|
|
12
|
+
chevronIcon?: React.ReactNode;
|
|
12
13
|
'data-name'?: string;
|
|
13
14
|
open?: boolean;
|
|
14
15
|
onOpenChange?: (open: boolean) => void;
|
|
15
16
|
showClear?: boolean;
|
|
17
|
+
extraWidthChars?: number;
|
|
16
18
|
multiple?: boolean;
|
|
17
19
|
disabled?: boolean;
|
|
18
20
|
value?: T['value'] | T['value'][];
|
|
@@ -34,9 +34,13 @@ const NewSelect = (props) => {
|
|
|
34
34
|
];
|
|
35
35
|
allItems = props.items;
|
|
36
36
|
}
|
|
37
|
-
const maxLabelLength = allItems.reduce((max, item) => Math.max(max, typeof item.label === 'string'
|
|
37
|
+
const maxLabelLength = allItems.reduce((max, item) => Math.max(max, typeof item.label === 'string'
|
|
38
|
+
? item.label.length
|
|
39
|
+
: typeof item.tooltip === 'string'
|
|
40
|
+
? item.tooltip.length
|
|
41
|
+
: 0), 0);
|
|
38
42
|
const contentStyle = {
|
|
39
|
-
width: `max(${maxLabelLength + 3}ch, calc(var(--ab-base-space) * 20), var(--anchor-width))`,
|
|
43
|
+
width: `max(${maxLabelLength + (props.extraWidthChars ?? 3)}ch, calc(var(--ab-base-space) * 20), var(--anchor-width))`,
|
|
40
44
|
};
|
|
41
45
|
const renderValueProp = props.renderValue;
|
|
42
46
|
const renderValueChild = renderValueProp
|
|
@@ -52,13 +56,12 @@ const NewSelect = (props) => {
|
|
|
52
56
|
return item !== undefined ? renderValueProp(item) : undefined;
|
|
53
57
|
}
|
|
54
58
|
: undefined;
|
|
55
|
-
return ((0, jsx_runtime_1.jsxs)(select_1.Select, { multiple: props.multiple, open: props.open, onOpenChange: props.onOpenChange, isItemEqualToValue: isItemEqualToValue, items: allItems, disabled: props.disabled, value: props.value, onValueChange: props.onValueChange, "aria-label": props.ariaLabel, defaultValue: props.defaultValue, children: [(0, jsx_runtime_1.jsx)(select_1.SelectTrigger, { size: props.size === 'small' ? 'sm' : 'default', className: (0, utils_1.cn)('twa:max-w-80 ab-Select', props.className), "aria-invalid": isInvalid, "aria-label": props.ariaLabel, "data-name": props['data-name'], children: (0, jsx_runtime_1.jsx)(select_1.SelectValue, { placeholder: props.placeholder, className: 'twa:truncate twa:block!', children: renderValueChild }) }), (0, jsx_runtime_1.jsx)(select_1.SelectContent, { alignItemWithTrigger: false, container: props.container, stopMouseDownPropagation: props.stopMouseDownPropagation, style: contentStyle, children: groups.map((group, index) => {
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)(select_1.Select, { multiple: props.multiple, open: props.open, onOpenChange: props.onOpenChange, isItemEqualToValue: isItemEqualToValue, items: allItems, disabled: props.disabled, value: props.value, onValueChange: props.onValueChange, "aria-label": props.ariaLabel, defaultValue: props.defaultValue, children: [(0, jsx_runtime_1.jsx)(select_1.SelectTrigger, { size: props.size === 'small' ? 'sm' : 'default', className: (0, utils_1.cn)('twa:max-w-80 ab-Select', props.className), "aria-invalid": isInvalid, "aria-label": props.ariaLabel, "data-name": props['data-name'], icon: props.chevronIcon, children: (0, jsx_runtime_1.jsx)(select_1.SelectValue, { placeholder: props.placeholder, className: 'twa:truncate twa:block!', children: renderValueChild }) }), (0, jsx_runtime_1.jsx)(select_1.SelectContent, { "aria-label": props.ariaLabel ? `${props.ariaLabel} content` : undefined, alignItemWithTrigger: false, container: props.container, stopMouseDownPropagation: props.stopMouseDownPropagation, style: contentStyle, children: groups.map((group, index) => {
|
|
56
60
|
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsxs)(select_1.SelectGroup, { children: [group.label && (0, jsx_runtime_1.jsx)(select_1.SelectLabel, { children: group.label }), group.items.map((item) => {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
: undefined;
|
|
61
|
+
const itemTitle = getItemTitle(item.label, item.value);
|
|
62
|
+
const tooltipText = props.showItemTooltip ? itemTitle : undefined;
|
|
60
63
|
const itemContent = item.label;
|
|
61
|
-
const itemElement = ((0, jsx_runtime_1.jsx)(select_1.SelectItem, { value: item.value, className: 'ab-Select-Row', disabled: item.disabled, children: itemContent }, item.value));
|
|
64
|
+
const itemElement = ((0, jsx_runtime_1.jsx)(select_1.SelectItem, { value: item.value, "aria-label": itemTitle || undefined, className: 'ab-Select-Row', disabled: item.disabled, children: itemContent }, item.value));
|
|
62
65
|
if (tooltipText != null) {
|
|
63
66
|
return ((0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { render: itemElement, children: itemContent }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { side: "right", children: tooltipText })] }, item.value));
|
|
64
67
|
}
|
|
@@ -8,7 +8,7 @@ const clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
|
8
8
|
const Flex_1 = require("../Flex");
|
|
9
9
|
const twMerge_1 = require("../../twMerge");
|
|
10
10
|
exports.baseClassName = 'ab-Panel';
|
|
11
|
-
const DEFAULT_BODY_CLS = 'twa:relative twa:flex-1 twa:p-2 twa:bg-
|
|
11
|
+
const DEFAULT_BODY_CLS = 'twa:relative twa:flex-1 twa:p-2 twa:bg-background twa:text-foreground';
|
|
12
12
|
const Header = ({ children, variant = 'default', className, style, onClick, ...flexProps }) => {
|
|
13
13
|
if (!children) {
|
|
14
14
|
return null;
|
|
@@ -96,7 +96,7 @@ const SimpleButton = React.forwardRef((givenProps, theRef) => {
|
|
|
96
96
|
}, variant === 'text' ? 'twa:bg-transparent' : '', variant === 'ghost'
|
|
97
97
|
? 'twa:hover:bg-muted twa:hover:text-foreground twa:aria-expanded:bg-muted twa:aria-expanded:text-foreground twa:dark:hover:bg-muted/50'
|
|
98
98
|
: '', variant === 'outlined'
|
|
99
|
-
? 'twa:bg-
|
|
99
|
+
? 'twa:bg-background twa:border-input-border twa:border'
|
|
100
100
|
: '', variant === 'raised'
|
|
101
101
|
? {
|
|
102
102
|
'twa:text-text-on-primary twa:shadow-(--ab-cmp-simple-button__box-shadow) twa:hover:not-disabled:shadow-(--ab-cmp-simple-button__hover-box-shadow) twa:transition-(--ab-cmp-simple-button__transition) twa:duration-200 twa:focus:shadow-(--ab-focus__box-shadow)': true,
|
|
@@ -70,7 +70,7 @@ const Tabs = (props) => {
|
|
|
70
70
|
selectedIndex,
|
|
71
71
|
tabCount: tabs.length,
|
|
72
72
|
setSelectedIndex,
|
|
73
|
-
}, children: (0, jsx_runtime_1.jsxs)(Flex_1.Box, { ...boxProps, className: (0, join_1.default)(boxProps.className, 'ab-Tabs twa:flex twa:flex-col'), "data-selected-index": selectedIndex, children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", className: (0, clsx_1.default)('ab-Tabs__Strip', 'twa:bg-(--ab-cmp-tabs-strip__background)'), children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: fillerClassName }), tabs, (0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: (0, clsx_1.default)(fillerClassName, 'twa:flex-1') })] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { ...contentProps, className: `ab-Tabs__Body twa:p-2 twa:flex-1 ${contentProps.className || ''} `, children: currentContent })] }) }));
|
|
73
|
+
}, children: (0, jsx_runtime_1.jsxs)(Flex_1.Box, { ...boxProps, className: (0, join_1.default)(boxProps.className, 'ab-Tabs twa:flex twa:flex-col'), "data-selected-index": selectedIndex, children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", className: (0, clsx_1.default)('ab-Tabs__Strip', 'twa:bg-(--ab-cmp-tabs-strip__background)', 'twa:pt-0.5'), children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: fillerClassName }), tabs, (0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: (0, clsx_1.default)(fillerClassName, 'twa:flex-1') })] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { ...contentProps, className: `ab-Tabs__Body twa:p-2 twa:flex-1 ${contentProps.className || ''} `, children: currentContent })] }) }));
|
|
74
74
|
};
|
|
75
75
|
exports.Tabs = Tabs;
|
|
76
76
|
const Tab = (props) => {
|
|
@@ -64,15 +64,9 @@ function TreeItemLabel(props) {
|
|
|
64
64
|
// that base-ui's boolean indicator can't.
|
|
65
65
|
const indent = node.depth > 0 ? `calc(${node.depth} * var(--ab-tree-indent-size))` : 0;
|
|
66
66
|
const iconProps = {
|
|
67
|
-
style: {
|
|
68
|
-
// override this explicitly since the parent ComboboxItem
|
|
69
|
-
// sets this on highlighted items, but the color is not appropriate
|
|
70
|
-
//@ts-ignore ignore
|
|
71
|
-
'--ab-color-accent-foreground': 'var(--ab-color-accent)',
|
|
72
|
-
},
|
|
73
67
|
className: 'twa:size-4',
|
|
74
68
|
};
|
|
75
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [node.hasChildren ? ((0, jsx_runtime_1.jsx)("button", { type: "button", tabIndex: -1, "aria-label": isExpanded ? 'Collapse' : 'Expand', "data-name": "expand-collapse-icon", onMouseDown: handleChevronMouseDown, onClick: handleChevronClick, style: { order: -1, marginLeft: indent }, className: (0, utils_1.cn)('twa:inline-flex twa:shrink-0 twa:items-center twa:justify-center twa:rounded', 'twa:cursor-pointer'), children: isExpanded ? (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDownIcon, { ...iconProps }) : (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRightIcon, { ...iconProps }) })) : reserveExpandSpace ? ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", style: { order: -1, marginLeft: indent }, className: "twa:inline-block twa:size-4 twa:shrink-0" })) : null, (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { checked: selected, checkSquareClassName: (0, clsx_1.default)(selected === true && 'twa:ring-1 twa:ring-accent-foreground') }), (0, jsx_runtime_1.jsx)("span", { className: "twa:truncate twa:min-w-0 twa:flex-1", children: node.label })] }));
|
|
69
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [node.hasChildren ? ((0, jsx_runtime_1.jsx)("button", { type: "button", tabIndex: -1, "aria-label": isExpanded ? 'Collapse' : 'Expand', "data-name": "expand-collapse-icon", onMouseDown: handleChevronMouseDown, onClick: handleChevronClick, style: { order: -1, marginLeft: indent }, className: (0, utils_1.cn)('twa:bg-transparent twa:text-foreground', 'twa:inline-flex twa:shrink-0 twa:items-center twa:justify-center twa:rounded', 'twa:cursor-pointer'), children: isExpanded ? (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDownIcon, { ...iconProps }) : (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRightIcon, { ...iconProps }) })) : reserveExpandSpace ? ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", style: { order: -1, marginLeft: indent }, className: "twa:inline-block twa:size-4 twa:shrink-0" })) : null, (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { checked: selected, checkSquareClassName: (0, clsx_1.default)(selected === true && 'twa:ring-1 twa:ring-accent-foreground') }), (0, jsx_runtime_1.jsx)("span", { className: "twa:truncate twa:min-w-0 twa:flex-1", children: node.label })] }));
|
|
76
70
|
}
|
|
77
71
|
function TreeDropdown(props) {
|
|
78
72
|
const { isLoading = false } = props;
|
|
@@ -461,7 +455,7 @@ function TreeDropdown(props) {
|
|
|
461
455
|
}, onClick: (e) => {
|
|
462
456
|
e.preventDefault();
|
|
463
457
|
toggleExpandAll();
|
|
464
|
-
}, className: (0, utils_1.cn)('ab-NewTreeDropdown-expand-all', 'twa:inline-flex twa:shrink-0 twa:items-center twa:justify-center', 'twa:bg-
|
|
458
|
+
}, className: (0, utils_1.cn)('ab-NewTreeDropdown-expand-all', 'twa:inline-flex twa:shrink-0 twa:items-center twa:justify-center', 'twa:bg-background', 'twa:size-6 twa:rounded-md twa:text-muted-foreground', 'twa:hover:text-foreground twa:hover:bg-ring/50 twa:cursor-pointer'
|
|
465
459
|
// 'twa:-mr-1'
|
|
466
460
|
), children: anyBranchExpanded ? ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronsDownUpIcon, { className: "twa:size-4" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronsUpDownIcon, { className: "twa:size-4" })) }));
|
|
467
461
|
}, [branchNodes.length, anyBranchExpanded, toggleExpandAll]);
|
|
@@ -486,6 +480,8 @@ function TreeDropdown(props) {
|
|
|
486
480
|
resizable: props.resizable,
|
|
487
481
|
placeholder: props.placeholder,
|
|
488
482
|
showClear: showRemoveChip,
|
|
483
|
+
//@ts-ignore ignore
|
|
484
|
+
'data-name': props['data-name'] ?? 'Select Values',
|
|
489
485
|
renderItemLabel: (defaultLabel) => {
|
|
490
486
|
return defaultLabel;
|
|
491
487
|
},
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: {
|
|
4
4
|
variant?: "link" | "secondary" | "default" | "ghost" | "outline" | "destructive";
|
|
5
5
|
size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
7
|
-
declare
|
|
7
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/button").ButtonProps & VariantProps<(props?: {
|
|
8
|
+
variant?: "link" | "secondary" | "default" | "ghost" | "outline" | "destructive";
|
|
9
|
+
size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
10
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
11
|
export { Button, buttonVariants };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buttonVariants = void 0;
|
|
4
|
-
|
|
3
|
+
exports.buttonVariants = exports.Button = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
7
|
const button_1 = require("@base-ui/react/button");
|
|
7
8
|
const class_variance_authority_1 = require("class-variance-authority");
|
|
8
9
|
const utils_1 = require("../../lib/utils");
|
|
@@ -10,7 +11,7 @@ const buttonVariants = (0, class_variance_authority_1.cva)('twa:group/button twa
|
|
|
10
11
|
variants: {
|
|
11
12
|
variant: {
|
|
12
13
|
default: 'twa:bg-primary twa:text-primary-foreground twa:hover:bg-primary/80',
|
|
13
|
-
outline: 'twa:border-border twa:bg-background twa:shadow-xs twa:hover:bg-muted twa:hover:text-foreground twa:aria-expanded:bg-muted twa:aria-expanded:text-foreground twa:dark:border-input
|
|
14
|
+
outline: 'twa:border-border twa:bg-background twa:shadow-xs twa:hover:bg-muted twa:hover:text-foreground twa:aria-expanded:bg-muted twa:aria-expanded:text-foreground twa:dark:border-input twa:dark:hover:bg-input/50',
|
|
14
15
|
secondary: 'twa:bg-secondary twa:text-secondary-foreground twa:hover:bg-secondary/80 twa:aria-expanded:bg-secondary twa:aria-expanded:text-secondary-foreground',
|
|
15
16
|
ghost: 'twa:bg-transparent twa:hover:bg-muted twa:hover:text-foreground twa:aria-expanded:bg-muted twa:aria-expanded:text-foreground twa:dark:hover:bg-muted/50',
|
|
16
17
|
destructive: 'twa:bg-destructive/10 twa:text-destructive twa:hover:bg-destructive/20 twa:focus-visible:border-destructive/40 twa:focus-visible:ring-destructive/20 twa:dark:bg-destructive/20 twa:dark:hover:bg-destructive/30 twa:dark:focus-visible:ring-destructive/40',
|
|
@@ -33,6 +34,7 @@ const buttonVariants = (0, class_variance_authority_1.cva)('twa:group/button twa
|
|
|
33
34
|
},
|
|
34
35
|
});
|
|
35
36
|
exports.buttonVariants = buttonVariants;
|
|
36
|
-
function Button({ className, variant = 'default', size = 'default', ...props }) {
|
|
37
|
-
return ((0, jsx_runtime_1.jsx)(button_1.Button, { "data-slot": "button", className: (0, utils_1.cn)(buttonVariants({ variant, size, className })), ...props }));
|
|
38
|
-
}
|
|
37
|
+
const Button = React.forwardRef(function Button({ className, variant = 'default', size = 'default', ...props }, ref) {
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(button_1.Button, { "data-slot": "button", className: (0, utils_1.cn)(buttonVariants({ variant, size, className })), ref: ref, ...props }));
|
|
39
|
+
});
|
|
40
|
+
exports.Button = Button;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DayPicker } from 'react-day-picker';
|
|
3
|
-
import { Button } from
|
|
3
|
+
import { Button } from './button';
|
|
4
4
|
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
|
|
5
5
|
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
6
6
|
}): React.JSX.Element;
|
|
@@ -6,32 +6,32 @@ declare const Combobox: typeof ComboboxPrimitive.Root;
|
|
|
6
6
|
declare const RESIZABLE_VIRTUALIZED_LIST_CLASS = "twa:group-data-resizable/combobox-content:max-h-none twa:group-data-resizable/combobox-content:flex-1 twa:group-data-resizable/combobox-content:min-h-0 twa:group-data-resizable/combobox-content:flex twa:group-data-resizable/combobox-content:flex-col";
|
|
7
7
|
declare const RESIZABLE_VIRTUALIZED_SCROLL_CLASS = "twa:group-data-resizable/combobox-content:h-auto twa:group-data-resizable/combobox-content:max-h-none twa:group-data-resizable/combobox-content:flex-1 twa:group-data-resizable/combobox-content:min-h-0";
|
|
8
8
|
declare function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props): React.JSX.Element;
|
|
9
|
-
declare
|
|
10
|
-
export declare
|
|
11
|
-
declare
|
|
9
|
+
declare const ComboboxTrigger: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export declare const ComboboxClear: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteClearProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
declare const ComboboxInput: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteInputProps & {
|
|
12
12
|
isLoading?: boolean;
|
|
13
13
|
showTrigger?: boolean;
|
|
14
14
|
showClear?: boolean;
|
|
15
15
|
/** Ref to the visible `InputGroup` wrapper. Use as the popup anchor so the popup
|
|
16
16
|
* lines up with the perceived combobox box (input + buttons), not just the bare input. */
|
|
17
17
|
groupRef?: React.Ref<HTMLDivElement>;
|
|
18
|
-
}
|
|
18
|
+
}, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
19
19
|
declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, resizable, contentRef, style, ...props }: ComboboxPrimitive.Popup.Props & Pick<ComboboxPrimitive.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'> & {
|
|
20
20
|
resizable?: boolean;
|
|
21
21
|
contentRef?: (el: HTMLDivElement | null) => void;
|
|
22
22
|
maxLabelLength?: number;
|
|
23
23
|
}): React.JSX.Element;
|
|
24
|
-
declare
|
|
25
|
-
declare
|
|
26
|
-
renderCheckboxIndicator?: boolean | null | ComboboxPrimitive.ItemIndicator.Props[
|
|
27
|
-
}
|
|
28
|
-
declare
|
|
29
|
-
declare
|
|
24
|
+
declare const ComboboxList: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteListProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const ComboboxItem: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxItemProps & {
|
|
26
|
+
renderCheckboxIndicator?: boolean | null | ComboboxPrimitive.ItemIndicator.Props["render"];
|
|
27
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const ComboboxGroup: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
declare const ComboboxLabel: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteGroupLabelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
30
|
declare function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props): React.JSX.Element;
|
|
31
|
-
declare
|
|
32
|
-
declare
|
|
33
|
-
declare
|
|
34
|
-
declare
|
|
31
|
+
declare const ComboboxEmpty: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteEmptyProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
declare const ComboboxSeparator: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
declare const ComboboxChips: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxChipsProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
declare const ComboboxChip: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").ComboboxChipProps & {
|
|
35
35
|
showRemove?: boolean;
|
|
36
36
|
/**
|
|
37
37
|
* Optional override for the remove action. When provided, a plain button
|
|
@@ -42,7 +42,7 @@ declare function ComboboxChip({ className, children, showRemove, onRemove, ...pr
|
|
|
42
42
|
* the chip's composite list index and would target the wrong value.
|
|
43
43
|
*/
|
|
44
44
|
onRemove?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
45
|
-
}
|
|
46
|
-
declare
|
|
45
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
declare const ComboboxChipsInput: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
47
47
|
declare function useComboboxAnchor(): React.RefObject<HTMLDivElement>;
|
|
48
48
|
export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, useComboboxAnchor, RESIZABLE_VIRTUALIZED_LIST_CLASS, RESIZABLE_VIRTUALIZED_SCROLL_CLASS, };
|