Merge branch 'next' into norbert/sb-798-figure-out-plan-for-package-structure-rework

This commit is contained in:
Norbert de Langen 2022-11-22 14:23:21 +01:00
commit ec73fa036b
No known key found for this signature in database
GPG Key ID: FD0E78AF9A837762
2 changed files with 6 additions and 2 deletions

View File

@ -9,7 +9,9 @@ addons.register(ADDON_ID, (api: API) => {
addons.addPanel(ADDON_ID, {
title() {
const rows = useArgTypes();
const controlsCount = Object.values(rows).filter((argType) => argType?.control).length;
const controlsCount = Object.values(rows).filter(
(argType) => argType?.control && !argType?.table?.disable
).length;
const suffix = controlsCount === 0 ? '' : ` (${controlsCount})`;
return `Controls${suffix}`;
},

View File

@ -18,5 +18,7 @@ export const DisableTable = {
export const DisableControl = {
args: { a: 'a', b: 'b' },
b: { control: { disable: true } },
argTypes: {
b: { control: { disable: true } },
},
};