@economic/taco 2.18.0 → 2.19.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Select2/Select2.d.ts +2 -0
- package/dist/components/Select2/components/Context.d.ts +2 -0
- package/dist/components/Select2/components/Group.d.ts +2 -0
- package/dist/components/Select2/components/Option.d.ts +3 -0
- package/dist/components/Table3/Table3.d.ts +1 -1
- package/dist/components/Table3/components/toolbar/FontSize.d.ts +0 -4
- package/dist/components/Table3/hooks/useCssGrid.d.ts +2 -2
- package/dist/components/Table3/hooks/useCssVars.d.ts +3 -2
- package/dist/components/Table3/types.d.ts +4 -4
- package/dist/esm/index.css +12 -12
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +2 -0
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Group.js +4 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +8 -2
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +4 -5
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +3 -3
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js +5 -9
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js +3 -3
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js +10 -10
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFontSize.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js +7 -7
- package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js +4 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/types.js +7 -1
- package/dist/esm/packages/taco/src/types.js.map +1 -1
- package/dist/index.css +12 -12
- package/dist/primitives/Table/types.d.ts +0 -6
- package/dist/primitives/Table/useTable/features/useTableFontSize.d.ts +2 -2
- package/dist/primitives/Table/useTable/util/columns.d.ts +2 -2
- package/dist/taco.cjs.development.js +67 -64
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/package.json +2 -2
- package/types.json +10671 -10529
- package/dist/esm/packages/taco/src/primitives/Table/types.js +0 -10
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +0 -1
@@ -9908,6 +9908,13 @@ const Colours = props => {
|
|
9908
9908
|
const mobiles = /iPhone|iPad|iPod|Android/i;
|
9909
9909
|
const isMobileDevice = navigator => !!(navigator !== null && navigator !== void 0 && navigator.userAgent) && mobiles.test(navigator.userAgent);
|
9910
9910
|
|
9911
|
+
(function (FontSizes) {
|
9912
|
+
FontSizes["small"] = "small";
|
9913
|
+
FontSizes["medium"] = "medium";
|
9914
|
+
FontSizes["large"] = "large";
|
9915
|
+
})(exports.FontSizes || (exports.FontSizes = {}));
|
9916
|
+
const fixedForwardRef = React__default.forwardRef;
|
9917
|
+
|
9911
9918
|
const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(props, ref) {
|
9912
9919
|
var _window;
|
9913
9920
|
const {
|
@@ -9928,9 +9935,14 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
9928
9935
|
setOpen,
|
9929
9936
|
shouldPauseHoverState,
|
9930
9937
|
tags,
|
9931
|
-
value
|
9938
|
+
value,
|
9939
|
+
fontSize = exports.FontSizes.medium
|
9932
9940
|
} = useSelect2Context();
|
9933
|
-
const className = cn(createOptionClassName(shouldPauseHoverState),
|
9941
|
+
const className = cn(createOptionClassName(shouldPauseHoverState), {
|
9942
|
+
'text-xs': fontSize === exports.FontSizes.small,
|
9943
|
+
'text-sm': fontSize === exports.FontSizes.medium,
|
9944
|
+
'text-base': fontSize === exports.FontSizes.large
|
9945
|
+
}, cName);
|
9934
9946
|
const hasValue = Array.isArray(value) ? !!value.length : value !== undefined;
|
9935
9947
|
const isTag = tags && !!color;
|
9936
9948
|
const handleClick = () => {
|
@@ -10002,9 +10014,12 @@ const Group$2 = /*#__PURE__*/React__default.forwardRef(function Select2Group(pro
|
|
10002
10014
|
const {
|
10003
10015
|
children,
|
10004
10016
|
heading,
|
10017
|
+
hasSeparator,
|
10005
10018
|
...attributes
|
10006
10019
|
} = props;
|
10007
|
-
const className = cn(createCollectionClassName(),
|
10020
|
+
const className = cn(createCollectionClassName(), {
|
10021
|
+
"last:after:content-none after:content-[''] after:bg-grey-300 after:mx-2 after:my-1 after:h-px": hasSeparator && children.length
|
10022
|
+
}, props.className);
|
10008
10023
|
return /*#__PURE__*/React__default.createElement(Group$1, Object.assign({}, attributes, {
|
10009
10024
|
className: className,
|
10010
10025
|
ref: ref
|
@@ -10428,7 +10443,7 @@ const Search$1 = /*#__PURE__*/React__default.forwardRef(function ListboxSearch(p
|
|
10428
10443
|
})));
|
10429
10444
|
});
|
10430
10445
|
|
10431
|
-
const isGroup = child => !!child.props.heading;
|
10446
|
+
const isGroup = child => !!child.props.heading || !!child.props.hasSeparator;
|
10432
10447
|
const useChildren = ({
|
10433
10448
|
children: initialChildren,
|
10434
10449
|
emptyValue,
|
@@ -10611,6 +10626,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
10611
10626
|
readOnly = false,
|
10612
10627
|
tags = false,
|
10613
10628
|
value: prop,
|
10629
|
+
fontSize,
|
10614
10630
|
...otherProps
|
10615
10631
|
} = props;
|
10616
10632
|
const emptyOption = React__default.useMemo(() => {
|
@@ -10688,6 +10704,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
10688
10704
|
shouldPauseHoverState,
|
10689
10705
|
setShouldPauseHoverState,
|
10690
10706
|
tags,
|
10707
|
+
fontSize,
|
10691
10708
|
validationError,
|
10692
10709
|
value
|
10693
10710
|
};
|
@@ -13016,30 +13033,6 @@ const MemoedFooter = /*#__PURE__*/React__default.memo(function MemoedFooter(prop
|
|
13016
13033
|
}, meta.footer(table.getRowModel().rows.map(row => row.original[id])))) : null);
|
13017
13034
|
});
|
13018
13035
|
|
13019
|
-
const FONT_SIZE = {
|
13020
|
-
small: 'small',
|
13021
|
-
medium: 'medium',
|
13022
|
-
large: 'large'
|
13023
|
-
};
|
13024
|
-
function FontSize$1(props) {
|
13025
|
-
const {
|
13026
|
-
texts
|
13027
|
-
} = useLocalization();
|
13028
|
-
const meta = props.table.options.meta;
|
13029
|
-
const handleChange = value => meta.fontSize.setSize(value);
|
13030
|
-
return /*#__PURE__*/React__default.createElement(Menu$1.SubMenu, null, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup, {
|
13031
|
-
onChange: handleChange,
|
13032
|
-
value: meta.fontSize.size
|
13033
|
-
}, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
|
13034
|
-
value: FONT_SIZE.small
|
13035
|
-
}, texts.table3.fontSize.sizes.small), /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
|
13036
|
-
value: FONT_SIZE.medium
|
13037
|
-
}, texts.table3.fontSize.sizes.medium), /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
|
13038
|
-
disabled: meta.rowHeight.height === 'short',
|
13039
|
-
value: FONT_SIZE.large
|
13040
|
-
}, texts.table3.fontSize.sizes.large)));
|
13041
|
-
}
|
13042
|
-
|
13043
13036
|
var IndicatorReason;
|
13044
13037
|
(function (IndicatorReason) {
|
13045
13038
|
IndicatorReason["SEARCH"] = "SEARCH";
|
@@ -13161,8 +13154,8 @@ const MemoedCell = /*#__PURE__*/React__default.memo(function MemoedCell(props) {
|
|
13161
13154
|
const actionsInMenu = visibleActions.slice(visibleActions.length === actionsLength ? actionsLength : actionsLength - 1);
|
13162
13155
|
const className = cn('-mb-2 flex justify-end pl-2 text-right', {
|
13163
13156
|
// Adjust negative margin on row actions cell to ensure that the cell aligns vertically.
|
13164
|
-
'-mt-2': fontSize ===
|
13165
|
-
'-mt-1.5': fontSize !==
|
13157
|
+
'-mt-2': fontSize === exports.FontSizes.small,
|
13158
|
+
'-mt-1.5': fontSize !== exports.FontSizes.small
|
13166
13159
|
}, props.className);
|
13167
13160
|
content = /*#__PURE__*/React__default.createElement("span", {
|
13168
13161
|
className: className,
|
@@ -13284,23 +13277,15 @@ function getCellValueAsString(value, dataType) {
|
|
13284
13277
|
return String(value);
|
13285
13278
|
}
|
13286
13279
|
|
13287
|
-
// settings
|
13288
|
-
var TableFontSizes;
|
13289
|
-
(function (TableFontSizes) {
|
13290
|
-
TableFontSizes["small"] = "small";
|
13291
|
-
TableFontSizes["medium"] = "medium";
|
13292
|
-
TableFontSizes["large"] = "large";
|
13293
|
-
})(TableFontSizes || (TableFontSizes = {}));
|
13294
|
-
|
13295
13280
|
// column widths
|
13296
13281
|
const getCellMinWidth = (fontSize = 'medium') => {
|
13297
13282
|
switch (fontSize) {
|
13298
|
-
case
|
13283
|
+
case exports.FontSizes.small:
|
13299
13284
|
return 57;
|
13300
|
-
case
|
13285
|
+
case exports.FontSizes.large:
|
13301
13286
|
return 83;
|
13302
13287
|
default:
|
13303
|
-
case
|
13288
|
+
case exports.FontSizes.medium:
|
13304
13289
|
return 72;
|
13305
13290
|
}
|
13306
13291
|
};
|
@@ -14973,7 +14958,7 @@ const TextareaControl = /*#__PURE__*/React__default.forwardRef(function Textarea
|
|
14973
14958
|
handleTextareaKeyDown(e);
|
14974
14959
|
},
|
14975
14960
|
onBlur: handleBlur,
|
14976
|
-
className: cn(getCellAlignmentClasses(align), `h-fit resize-none`, {
|
14961
|
+
className: cn(getCellAlignmentClasses(align), `h-fit resize-none overflow-y-hidden focus:overflow-y-auto`, {
|
14977
14962
|
[`!min-h-[${minMaxHeight.min}px]`]: columnMeta === null || columnMeta === void 0 ? void 0 : columnMeta.enableTruncate,
|
14978
14963
|
'!yt-focus-dark': isCellInDetailMode,
|
14979
14964
|
[`h-[${minMaxHeight.min}px]`]: !isCellInDetailMode && (columnMeta === null || columnMeta === void 0 ? void 0 : columnMeta.enableTruncate),
|
@@ -15105,6 +15090,7 @@ const EditingControl = /*#__PURE__*/React__default.forwardRef(function Control(p
|
|
15105
15090
|
handleChange(nextValue);
|
15106
15091
|
}
|
15107
15092
|
},
|
15093
|
+
fontSize: tableMeta.fontSize.size,
|
15108
15094
|
value
|
15109
15095
|
}, data);
|
15110
15096
|
} else if (controlRenderer === 'datepicker') {
|
@@ -16295,15 +16281,15 @@ function useTableFontSizeListener(table) {
|
|
16295
16281
|
}
|
16296
16282
|
function getCellWidthDifference(fontSizeKey) {
|
16297
16283
|
switch (fontSizeKey) {
|
16298
|
-
case `${
|
16299
|
-
case `${
|
16284
|
+
case `${exports.FontSizes.small}-${exports.FontSizes.medium}`:
|
16285
|
+
case `${exports.FontSizes.medium}-${exports.FontSizes.large}`:
|
16300
16286
|
return 8;
|
16301
|
-
case `${
|
16302
|
-
case `${
|
16287
|
+
case `${exports.FontSizes.medium}-${exports.FontSizes.small}`:
|
16288
|
+
case `${exports.FontSizes.large}-${exports.FontSizes.medium}`:
|
16303
16289
|
return -8;
|
16304
|
-
case `${
|
16290
|
+
case `${exports.FontSizes.small}-${exports.FontSizes.large}`:
|
16305
16291
|
return 16;
|
16306
|
-
case `${
|
16292
|
+
case `${exports.FontSizes.large}-${exports.FontSizes.small}`:
|
16307
16293
|
return -16;
|
16308
16294
|
default:
|
16309
16295
|
return 0;
|
@@ -17950,8 +17936,8 @@ function RowHeight(props) {
|
|
17950
17936
|
const handleChange = value => {
|
17951
17937
|
const height = value;
|
17952
17938
|
meta.rowHeight.setHeight(height);
|
17953
|
-
if (height === 'short' && meta.fontSize.size ===
|
17954
|
-
meta.fontSize.setSize(
|
17939
|
+
if (height === 'short' && meta.fontSize.size === exports.FontSizes.large) {
|
17940
|
+
meta.fontSize.setSize(exports.FontSizes.medium);
|
17955
17941
|
}
|
17956
17942
|
};
|
17957
17943
|
return /*#__PURE__*/React__default.createElement(Menu$1.SubMenu, null, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup, {
|
@@ -18180,6 +18166,25 @@ function ColumnSettingsPopover(props) {
|
|
18180
18166
|
})) : texts.table3.columnSettings.noResults)))));
|
18181
18167
|
}
|
18182
18168
|
|
18169
|
+
function FontSize$1(props) {
|
18170
|
+
const {
|
18171
|
+
texts
|
18172
|
+
} = useLocalization();
|
18173
|
+
const meta = props.table.options.meta;
|
18174
|
+
const handleChange = value => meta.fontSize.setSize(value);
|
18175
|
+
return /*#__PURE__*/React__default.createElement(Menu$1.SubMenu, null, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup, {
|
18176
|
+
onChange: handleChange,
|
18177
|
+
value: meta.fontSize.size
|
18178
|
+
}, /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
|
18179
|
+
value: exports.FontSizes.small
|
18180
|
+
}, texts.table3.fontSize.sizes.small), /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
|
18181
|
+
value: exports.FontSizes.medium
|
18182
|
+
}, texts.table3.fontSize.sizes.medium), /*#__PURE__*/React__default.createElement(Menu$1.RadioGroup.Item, {
|
18183
|
+
disabled: meta.rowHeight.height === 'short',
|
18184
|
+
value: exports.FontSizes.large
|
18185
|
+
}, texts.table3.fontSize.sizes.large)));
|
18186
|
+
}
|
18187
|
+
|
18183
18188
|
function SettingsButton(props) {
|
18184
18189
|
const {
|
18185
18190
|
customSettings,
|
@@ -18346,7 +18351,7 @@ const getCellHeightPadding = (height, fontSize) => {
|
|
18346
18351
|
case 'short':
|
18347
18352
|
{
|
18348
18353
|
switch (fontSize) {
|
18349
|
-
case
|
18354
|
+
case exports.FontSizes.small:
|
18350
18355
|
return '8px';
|
18351
18356
|
default:
|
18352
18357
|
return '6px';
|
@@ -18356,9 +18361,9 @@ const getCellHeightPadding = (height, fontSize) => {
|
|
18356
18361
|
case 'tall':
|
18357
18362
|
{
|
18358
18363
|
switch (fontSize) {
|
18359
|
-
case
|
18364
|
+
case exports.FontSizes.small:
|
18360
18365
|
return '16px';
|
18361
|
-
case
|
18366
|
+
case exports.FontSizes.large:
|
18362
18367
|
return '12px';
|
18363
18368
|
default:
|
18364
18369
|
return '14px';
|
@@ -18367,9 +18372,9 @@ const getCellHeightPadding = (height, fontSize) => {
|
|
18367
18372
|
case 'extra-tall':
|
18368
18373
|
{
|
18369
18374
|
switch (fontSize) {
|
18370
|
-
case
|
18375
|
+
case exports.FontSizes.small:
|
18371
18376
|
return '22px';
|
18372
|
-
case
|
18377
|
+
case exports.FontSizes.large:
|
18373
18378
|
return '18px';
|
18374
18379
|
default:
|
18375
18380
|
return '20px';
|
@@ -18378,9 +18383,9 @@ const getCellHeightPadding = (height, fontSize) => {
|
|
18378
18383
|
default:
|
18379
18384
|
{
|
18380
18385
|
switch (fontSize) {
|
18381
|
-
case
|
18386
|
+
case exports.FontSizes.small:
|
18382
18387
|
return '12px';
|
18383
|
-
case
|
18388
|
+
case exports.FontSizes.large:
|
18384
18389
|
return '8px';
|
18385
18390
|
default:
|
18386
18391
|
return '10px';
|
@@ -18390,9 +18395,9 @@ const getCellHeightPadding = (height, fontSize) => {
|
|
18390
18395
|
};
|
18391
18396
|
const getCellWidthPadding = fontSize => {
|
18392
18397
|
switch (fontSize) {
|
18393
|
-
case
|
18398
|
+
case exports.FontSizes.small:
|
18394
18399
|
return '8px';
|
18395
|
-
case
|
18400
|
+
case exports.FontSizes.medium:
|
18396
18401
|
return '12px';
|
18397
18402
|
default:
|
18398
18403
|
return '16px';
|
@@ -18572,8 +18577,6 @@ function FilterResetDialog(props) {
|
|
18572
18577
|
}, texts.table3.validation.resetFiltersDialog.confirm)))));
|
18573
18578
|
}
|
18574
18579
|
|
18575
|
-
const fixedForwardRef = React__default.forwardRef;
|
18576
|
-
|
18577
18580
|
function useTable3DataLoader(fetch, fetchAll, options = {
|
18578
18581
|
pageSize: 100
|
18579
18582
|
}) {
|
@@ -18796,9 +18799,9 @@ const Table$1 = /*#__PURE__*/fixedForwardRef(function Table3(props, ref) {
|
|
18796
18799
|
}
|
18797
18800
|
};
|
18798
18801
|
const className = cn('border-grey-300 relative grid h-full w-full flex-grow overflow-auto rounded border bg-white scroll-mt-[41px] focus-visible:outline-none', '[&[data-resizing="true"]]:select-none', {
|
18799
|
-
'text-xs': tableMeta.fontSize.size ===
|
18800
|
-
'text-sm': tableMeta.fontSize.size ===
|
18801
|
-
'text-base': tableMeta.fontSize.size ===
|
18802
|
+
'text-xs': tableMeta.fontSize.size === exports.FontSizes.small,
|
18803
|
+
'text-sm': tableMeta.fontSize.size === exports.FontSizes.medium,
|
18804
|
+
'text-base': tableMeta.fontSize.size === exports.FontSizes.large
|
18802
18805
|
});
|
18803
18806
|
// Print tables have "_print" as the postfix for the table id, so we can use the it to determine
|
18804
18807
|
// if the table is a print table or not.
|