Skip to content

Commit

Permalink
apply linter
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberDex committed Feb 1, 2025
1 parent f6f7d01 commit 3d3a2f0
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 27 deletions.
18 changes: 8 additions & 10 deletions src/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ export class List<C extends ContainerChild = ContainerChild> extends Container<C

if (options)
{
if (options.maxWidth) {
if (options.maxWidth)
{
this._maxWidth = options.maxWidth;
}

this.init(options);
}


options?.items?.forEach((item) => this.addChild(item));

this.on('added', () => this.arrangeChildren());
Expand Down Expand Up @@ -359,18 +359,16 @@ export class List<C extends ContainerChild = ContainerChild> extends Container<C
this.arrangeChildren();
}

/**
* Set width of area to fit elements when arrange. (If not set parent width will be used).
*/
set maxWidth(width: number) {
/** Set width of area to fit elements when arrange. (If not set parent width will be used). */
set maxWidth(width: number)
{
this._maxWidth = width;
this.arrangeChildren();
}

/**
* Get width of area to fit elements when arrange. (If not set parent width will be used).
*/
get maxWidth(): number {
/** Get width of area to fit elements when arrange. (If not set parent width will be used). */
get maxWidth(): number
{
return this._maxWidth;
}
}
1 change: 0 additions & 1 deletion src/ScrollBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -954,5 +954,4 @@ export class ScrollBox extends Container

return type === 'bidirectional';
}

}
4 changes: 2 additions & 2 deletions src/stories/list/ListGraphics.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { FancyButton } from '../../FancyButton';
import { List, ListType } from '../../List';
import { centerElement } from '../../utils/helpers/resize';
import { defaultTextStyle } from '../../utils/helpers/styles';
import { LIST_TYPE } from '../../utils/HelpTypes';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { action } from '@storybook/addon-actions';
import { LIST_TYPE } from '../../utils/HelpTypes';

const args = {
type: [null, ...LIST_TYPE],
Expand All @@ -25,7 +25,7 @@ const args = {
onPress: action('Button pressed'),
};

export const UseGraphics: StoryFn<typeof args & { type:ListType }> = (
export const UseGraphics: StoryFn<typeof args & { type: ListType }> = (
{
type,
fontColor,
Expand Down
4 changes: 2 additions & 2 deletions src/stories/list/ListSprite.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { FancyButton } from '../../FancyButton';
import { List, ListType } from '../../List';
import { centerElement } from '../../utils/helpers/resize';
import { defaultTextStyle } from '../../utils/helpers/styles';
import { LIST_TYPE } from '../../utils/HelpTypes';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { getColor } from '../utils/color';
import { preload } from '../utils/loader';
import { action } from '@storybook/addon-actions';
import { LIST_TYPE } from '../../utils/HelpTypes';

const args = {
type: LIST_TYPE.reverse(),
Expand All @@ -19,7 +19,7 @@ const args = {
onPress: action('Button pressed'),
};

export const UseSprite: StoryFn<typeof args & { type:ListType }> = (
export const UseSprite: StoryFn<typeof args & { type: ListType }> = (
{
fontColor,
elementsMargin,
Expand Down
6 changes: 3 additions & 3 deletions src/stories/scrollBox/ScrollBoxDynamicDimensions.stories.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Graphics, Text } from 'pixi.js';
import { PixiStory, StoryFn } from '@pixi/storybook-renderer';
import { FancyButton } from '../../FancyButton';
import { ListType } from '../../List';
import { ScrollBox } from '../../ScrollBox';
import { centerElement } from '../../utils/helpers/resize';
import { defaultTextStyle } from '../../utils/helpers/styles';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { LIST_TYPE } from '../../utils/HelpTypes';
import { ListType } from '../../List';
import { argTypes, getDefaultArgs } from '../utils/argTypes';

const args = {
fontColor: '#000000',
Expand All @@ -15,7 +15,7 @@ const args = {
type: [...LIST_TYPE],
};

export const UseDynamicDimensions: StoryFn<typeof args & { type:ListType }> = (
export const UseDynamicDimensions: StoryFn<typeof args & { type: ListType }> = (
{ fontColor, itemsAmount, backgroundColor, type },
context,
) =>
Expand Down
6 changes: 3 additions & 3 deletions src/stories/scrollBox/ScrollBoxGraphics.stories.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Graphics, Text } from 'pixi.js';
import { PixiStory, StoryFn } from '@pixi/storybook-renderer';
import { FancyButton } from '../../FancyButton';
import { ListType } from '../../List';
import { ScrollBox } from '../../ScrollBox';
import { centerElement } from '../../utils/helpers/resize';
import { defaultTextStyle } from '../../utils/helpers/styles';
import { LIST_TYPE } from '../../utils/HelpTypes';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { action } from '@storybook/addon-actions';
import { LIST_TYPE } from '../../utils/HelpTypes';
import { ListType } from '../../List';

const args = {
fontColor: '#000000',
Expand All @@ -28,7 +28,7 @@ const args = {
onPress: action('Button pressed'),
};

export const UseGraphics: StoryFn<typeof args & { type:ListType }> = (
export const UseGraphics: StoryFn<typeof args & { type: ListType }> = (
{
fontColor,
elementsMargin,
Expand Down
6 changes: 3 additions & 3 deletions src/stories/scrollBox/ScrollBoxProximity.stories.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Graphics, Text } from 'pixi.js';
import { PixiStory, StoryFn } from '@pixi/storybook-renderer';
import { FancyButton } from '../../FancyButton';
import { ListType } from '../../List';
import { ScrollBox } from '../../ScrollBox';
import { centerElement } from '../../utils/helpers/resize';
import { defaultTextStyle } from '../../utils/helpers/styles';
import { LIST_TYPE } from '../../utils/HelpTypes';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { action } from '@storybook/addon-actions';
import { ListType } from '../../List';
import { LIST_TYPE } from '../../utils/HelpTypes';

const args = {
proximityRange: 100,
Expand All @@ -28,7 +28,7 @@ const items: FancyButton[] = [];
const inRangeCache: boolean[] = [];

export const ProximityEvent: StoryFn<
typeof args & { type:ListType }
typeof args & { type: ListType }
> = (
{
width,
Expand Down
6 changes: 3 additions & 3 deletions src/stories/scrollBox/ScrollBoxSprite.stories.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { ColorSource, Container, Sprite, Text } from 'pixi.js';
import { PixiStory, StoryFn } from '@pixi/storybook-renderer';
import { FancyButton } from '../../FancyButton';
import { ListType } from '../../List';
import { ScrollBox } from '../../ScrollBox';
import { centerElement } from '../../utils/helpers/resize';
import { defaultTextStyle } from '../../utils/helpers/styles';
import { LIST_TYPE } from '../../utils/HelpTypes';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { preload } from '../utils/loader';
import { action } from '@storybook/addon-actions';
import { ListType } from '../../List';
import { LIST_TYPE } from '../../utils/HelpTypes';

const args = {
fontColor: '#000000',
Expand All @@ -21,7 +21,7 @@ const args = {
shiftScroll: false,
};

export const UseSprite: StoryFn<typeof args & { type:ListType }> = (
export const UseSprite: StoryFn<typeof args & { type: ListType }> = (
{
fontColor,
elementsMargin,
Expand Down

0 comments on commit 3d3a2f0

Please sign in to comment.