@adaptabletools/adaptable-cjs 23.0.0-canary.2 → 23.0.0-canary.4
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 +68 -73
- package/package.json +1 -1
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -4
- package/src/AdaptableOptions/FilterOptions.d.ts +0 -7
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -3
- package/src/AdaptableState/Common/AdaptableForm.d.ts +18 -1
- package/src/AdaptableState/Common/AdaptableForm.js +34 -0
- package/src/AdaptableState/Common/AdaptableFormat.d.ts +1 -1
- package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +3 -2
- package/src/AdaptableState/Common/Enums.d.ts +0 -5
- package/src/AdaptableState/Common/Enums.js +1 -7
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/ReportScheduleRan.d.ts +4 -0
- package/src/Api/Implementation/LayoutHelpers.js +12 -0
- package/src/Api/Internal/EventInternalApi.js +2 -1
- package/src/Strategy/CalculatedColumnModule.js +3 -1
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +1 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +7 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +4 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +120 -0
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +1 -0
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +8 -16
- 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/ColumnFilterWindow.js +1 -1
- 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/Selectors/ColumnSelector.js +5 -0
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +3 -1
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +3 -8
- package/src/View/GridFilter/GridFilterViewPanel.js +1 -1
- package/src/View/Layout/LayoutViewPanel.js +23 -21
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +3 -3
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +1 -1
- 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/View/renderWithAdaptableContext.js +1 -2
- package/src/agGrid/AdaptableAgGrid.d.ts +0 -1
- package/src/agGrid/AdaptableAgGrid.js +3 -18
- package/src/agGrid/AgGridColumnAdapter.js +1 -4
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +10 -5
- package/src/components/Card/index.js +1 -1
- package/src/components/Combobox/VirtualizedList.js +5 -5
- package/src/components/Combobox/comboboxUtils.d.ts +4 -1
- package/src/components/Combobox/comboboxUtils.js +2 -0
- package/src/components/Combobox/index.d.ts +1 -0
- package/src/components/Combobox/index.js +39 -13
- 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 +5 -13
- package/src/components/ui/button.d.ts +5 -2
- package/src/components/ui/button.js +8 -6
- 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 +5 -1
- package/src/lib/utils.d.ts +20 -0
- package/src/lib/utils.js +48 -1
- package/src/metamodel/adaptable.metamodel.d.ts +7 -19
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade23.d.ts +2 -3
- package/src/migration/VersionUpgrade23.js +4 -16
- package/src/types.d.ts +0 -1
- package/themes/dark.css +7 -17
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/FilterActionOnDataChange.d.ts +0 -17
- package/src/AdaptableState/Common/FilterActionOnDataChange.js +0 -5
- package/src/View/AdaptableComputedCSSVarsContext.d.ts +0 -12
- package/src/View/AdaptableComputedCSSVarsContext.js +0 -36
- package/src/components/Select/CSSNumericVariableWatch.d.ts +0 -11
- package/src/components/Select/CSSNumericVariableWatch.js +0 -51
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GridFilterCombobox = exports.MultiCombobox = exports.SingleCombobox = void 0;
|
|
3
|
+
exports.GridFilterCombobox = exports.GRID_FILTER_COMBBOX_ADJUSTMENTS_CLASSNAME = exports.MultiCombobox = exports.SingleCombobox = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
@@ -35,9 +35,13 @@ const AdaptableComboboxList = (props) => {
|
|
|
35
35
|
const label = isUncreatedCreatable ? `Create "${item.label}"` : item.label;
|
|
36
36
|
const itemLabel = props.renderItemLabel ? props.renderItemLabel(label, item) : label;
|
|
37
37
|
const itemContent = isUncreatedCreatable ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.PlusIcon, {}), " ", itemLabel] })) : (itemLabel);
|
|
38
|
-
const
|
|
39
|
-
const tooltipText =
|
|
40
|
-
|
|
38
|
+
const itemText = (0, comboboxUtils_1.getItemTextLabel)(item);
|
|
39
|
+
const tooltipText = props.showItemTooltip && itemText != null
|
|
40
|
+
? isUncreatedCreatable
|
|
41
|
+
? `Create "${itemText}"`
|
|
42
|
+
: itemText
|
|
43
|
+
: undefined;
|
|
44
|
+
const itemElement = ((0, jsx_runtime_1.jsx)(combobox_1.ComboboxItem, { value: item, "aria-label": itemText ?? undefined, className: 'ab-Combobox-Row', disabled: item.disabled, renderCheckboxIndicator: props.renderCheckboxIndicator, children: itemContent }, item.value));
|
|
41
45
|
if (tooltipText != null) {
|
|
42
46
|
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));
|
|
43
47
|
}
|
|
@@ -93,9 +97,15 @@ const AdaptableCombobox_Root = (props) => {
|
|
|
93
97
|
const internalDefaultValue = props.multiple
|
|
94
98
|
? (0, comboboxUtils_1.valueToItems)(props.defaultValue, itemByValue)
|
|
95
99
|
: (0, comboboxUtils_1.valueToItem)(props.defaultValue, itemByValue);
|
|
96
|
-
const handleValueChange = (next) => {
|
|
100
|
+
const handleValueChange = (next, eventDetails) => {
|
|
97
101
|
if (!props.onValueChange)
|
|
98
102
|
return;
|
|
103
|
+
// base-ui clears the selected value when Escape is pressed
|
|
104
|
+
// we only want to allow this if the clearOnEscape prop is true
|
|
105
|
+
if (eventDetails?.reason === 'escape-key' && !props.clearOnEscape) {
|
|
106
|
+
eventDetails.cancel?.();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
99
109
|
if (Array.isArray(next)) {
|
|
100
110
|
props.onValueChange((0, comboboxUtils_1.toStringValues)(next), next);
|
|
101
111
|
}
|
|
@@ -103,6 +113,15 @@ const AdaptableCombobox_Root = (props) => {
|
|
|
103
113
|
props.onValueChange((0, comboboxUtils_1.toStringValue)(next), next);
|
|
104
114
|
}
|
|
105
115
|
};
|
|
116
|
+
const handleInputValueChange = (next, eventDetails) => {
|
|
117
|
+
// base-ui blanks the input text (and then the selected value) when Escape is pressed
|
|
118
|
+
// we only want to allow this if the clearOnEscape prop is true
|
|
119
|
+
if (eventDetails?.reason === 'escape-key' && !props.clearOnEscape) {
|
|
120
|
+
eventDetails.cancel?.();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
props.onInputValueChange?.(next);
|
|
124
|
+
};
|
|
106
125
|
let comboboxItems = props.groups ?? props.items;
|
|
107
126
|
if (props.isCreatable && allItems[allItems.length - 1]?.creatable) {
|
|
108
127
|
// let's detect all "creatable" items and add them to the combobox items
|
|
@@ -118,7 +137,7 @@ const AdaptableCombobox_Root = (props) => {
|
|
|
118
137
|
}
|
|
119
138
|
comboboxItems = [...comboboxItems, ...creatableItems];
|
|
120
139
|
}
|
|
121
|
-
return ((0, jsx_runtime_1.jsx)(combobox_1.Combobox, { ...props, items: comboboxItems, isItemEqualToValue: isItemEqualToValue, itemToStringLabel: comboboxUtils_1.getItemTextLabel, value: internalValue, defaultValue: internalDefaultValue, onValueChange: handleValueChange, "aria-label": props.ariaLabel || props['aria-label'], "data-name": props['data-name'], disabled: props.disabled, open: props.open, onOpenChange: props.onOpenChange, multiple: props.multiple, filter: props.filter, autoHighlight: true, children: props.children }));
|
|
140
|
+
return ((0, jsx_runtime_1.jsx)(combobox_1.Combobox, { ...props, items: comboboxItems, isItemEqualToValue: isItemEqualToValue, itemToStringLabel: comboboxUtils_1.getItemTextLabel, value: internalValue, defaultValue: internalDefaultValue, onValueChange: handleValueChange, onInputValueChange: handleInputValueChange, "aria-label": props.ariaLabel || props['aria-label'], "data-name": props['data-name'], disabled: props.disabled, open: props.open, onOpenChange: props.onOpenChange, multiple: props.multiple, filter: props.filter, autoHighlight: true, children: props.children }));
|
|
122
141
|
};
|
|
123
142
|
const useGetAllItems = (props) => {
|
|
124
143
|
const allItems = props.groups
|
|
@@ -390,7 +409,7 @@ const MultiCombobox_SimpleSearchable = (props) => {
|
|
|
390
409
|
const shouldKeepTrigger = props.searchable === false && selectedItems.length > 0;
|
|
391
410
|
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
411
|
? '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": "
|
|
412
|
+
: '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
413
|
? ''
|
|
395
414
|
: '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
415
|
} }) }), (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 +498,11 @@ const MultiCombobox_MenuListSearchable = (props) => {
|
|
|
479
498
|
props.onBlur?.();
|
|
480
499
|
}
|
|
481
500
|
}, 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": "
|
|
501
|
+
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
502
|
// we already have the role="combobox" on the parent
|
|
484
503
|
// so we want to avoid the same role twice in the component,
|
|
485
504
|
// hence we use the role="widget" here.
|
|
486
|
-
role: "widget" }), "data-slot": "
|
|
505
|
+
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
506
|
} }) }));
|
|
488
507
|
};
|
|
489
508
|
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'
|
|
@@ -501,6 +520,16 @@ const MultiCombobox = (props) => {
|
|
|
501
520
|
return searchable === 'menulist' ? ((0, jsx_runtime_1.jsx)(MultiCombobox_MenuListSearchable, { renderInput: false, ...props, multiple: true, open: open, onOpenChange: onOpenChange, searchable: searchable, showItemTooltip: showItemTooltip })) : ((0, jsx_runtime_1.jsx)(MultiCombobox_SimpleSearchable, { ...props, open: open, multiple: true, onOpenChange: onOpenChange, searchable: searchable, showItemTooltip: showItemTooltip }));
|
|
502
521
|
};
|
|
503
522
|
exports.MultiCombobox = MultiCombobox;
|
|
523
|
+
exports.GRID_FILTER_COMBBOX_ADJUSTMENTS_CLASSNAME = (0, utils_1.cn)(
|
|
524
|
+
// remove the border/shadow and position it properly
|
|
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!',
|
|
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]');
|
|
504
533
|
const GridFilterCombobox = (props) => {
|
|
505
534
|
const { showSelectedCount = false, placeholder = 'Select...', ...comboboxProps } = props;
|
|
506
535
|
const sharedProps = {
|
|
@@ -520,10 +549,7 @@ const GridFilterCombobox = (props) => {
|
|
|
520
549
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { className: "twa:text-ellipsis twa:overflow-hidden twa:whitespace-nowrap twa:flex-1000", "data-slot": "combobox-selected-values", children: [showSelectedCount && items.length > 0 && ((0, jsx_runtime_1.jsxs)("span", { "data-name": "multiple-values-count", className: "twa:mr-0.5", children: ["(", items.length, ")"] })), children] }) }));
|
|
521
550
|
},
|
|
522
551
|
};
|
|
523
|
-
const className = (0, utils_1.cn)(
|
|
524
|
-
// remove the border/shadow and position it properly
|
|
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!', comboboxProps.className);
|
|
552
|
+
const className = (0, utils_1.cn)(exports.GRID_FILTER_COMBBOX_ADJUSTMENTS_CLASSNAME, comboboxProps.className);
|
|
527
553
|
const mergedProps = {
|
|
528
554
|
...sharedProps,
|
|
529
555
|
...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
|
},
|
|
@@ -527,10 +523,6 @@ function GridFilterTreeDropdown(props) {
|
|
|
527
523
|
}
|
|
528
524
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "twa:text-ellipsis twa:overflow-hidden twa:whitespace-nowrap twa:flex-1000", "data-slot": "combobox-selected-values", children: [showSelectedCount && selectedLeafPaths.length > 0 && ((0, jsx_runtime_1.jsxs)("span", { "data-name": "multiple-values-count", className: "twa:mr-0.5", children: ["(", selectedLeafPaths.length, ")"] })), children] }));
|
|
529
525
|
}, [placeholder, showSelectedCount]);
|
|
530
|
-
const mergedClassName = (0, utils_1.cn)(
|
|
531
|
-
// Match the restyling GridFilterCombobox uses: remove the field border,
|
|
532
|
-
// flatten the shadow and absolutely position so the component fits the
|
|
533
|
-
// grid's floating-filter input box.
|
|
534
|
-
'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!', className);
|
|
526
|
+
const mergedClassName = (0, utils_1.cn)(Combobox_1.GRID_FILTER_COMBBOX_ADJUSTMENTS_CLASSNAME, className);
|
|
535
527
|
return ((0, jsx_runtime_1.jsx)(TreeDropdown, { ...rest, placeholder: placeholder, className: mergedClassName, showClear: rest.showClear ?? false, resizable: rest.resizable ?? true, renderSelectedValues: renderSelectedValues }));
|
|
536
528
|
}
|
|
@@ -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;
|
|
@@ -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, };
|