Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Jul 17, 2023
1 parent 313ab4f commit e4bb0e1
Show file tree
Hide file tree
Showing 74 changed files with 759 additions and 773 deletions.
1 change: 0 additions & 1 deletion src/API/chat-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import ItemPileSocket from "../socket.js";
import * as PileUtilities from "../helpers/pile-utilities.js";
import * as Utilities from "../helpers/utilities.js";
import TradeAPI from "./trade-api.js";
import * as Util from "util";

export default class ChatAPI {

Expand Down
4 changes: 2 additions & 2 deletions src/applications/components/BasicItemDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<header class="sheet-header">
<img data-edit="img" src={item.img}>
<div class="details">
<input name="name" placeholder="Name" spellcheck="false" type="text" value={item.name} disabled/>
<input disabled name="name" placeholder="Name" spellcheck="false" type="text" value={item.name}/>

<span class="level">
<span>Item</span>
<input data-property="system.level.value" type="text" value="?" disabled>
<input data-property="system.level.value" disabled type="text" value="?">
</span>
<template class="traits-extra"></template>
<!-- showTraits true -->
Expand Down
28 changes: 15 additions & 13 deletions src/applications/components/CurrencyListEntry.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,31 @@
let text = "";
$: {
let number = options.abbreviateNumbers ? Helpers.abbreviateNumbers($quantity) : $quantity;
if($abbreviation){
if(options.abbreviations){
if ($abbreviation) {
if (options.abbreviations) {
text = $abbreviation.replace("{#}", number);
}else{
} else {
text = number;
}
}else{
} else {
text = `${$name} (x${$quantity})`;
}
}
</script>

<div class="item-piles-flexrow{options.reverse ? '-reverse' : ''} item-piles-item-row" style="flex:0 1 auto;" data-fast-tooltip={$name} data-fast-tooltip-activation-speed="0" data-fast-tooltip-deactivation-speed="0">
<div class="item-piles-flexrow{options.reverse ? '-reverse' : ''} item-piles-item-row" data-fast-tooltip={$name}
data-fast-tooltip-activation-speed="0" data-fast-tooltip-deactivation-speed="0" style="flex:0 1 auto;">

<div class="item-piles-img-container" style="min-height: {options.imgSize}px; min-width: {options.imgSize}px; max-width: {options.imgSize}px; max-height: {options.imgSize}px;">
<img class="item-piles-img" src="{$img}"/>
</div>
<div class="item-piles-img-container"
style="min-height: {options.imgSize}px; min-width: {options.imgSize}px; max-width: {options.imgSize}px; max-height: {options.imgSize}px;">
<img class="item-piles-img" src="{$img}"/>
</div>

<div class="item-piles-name item-piles-text" style="flex:0 1 auto; margin: 0 0.25rem;">
<div class="item-piles-name-container">
{text}
</div>
</div>
<div class="item-piles-name item-piles-text" style="flex:0 1 auto; margin: 0 0.25rem;">
<div class="item-piles-name-container">
{text}
</div>
</div>

</div>
26 changes: 13 additions & 13 deletions src/applications/components/CustomDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@

<div>

{#if icon}
<p class="header-icon"><i class="{icon}"></i></p>
{/if}
{#if header}
<p class="header"><strong>{header}</strong></p>
{/if}
{#if Array.isArray(content)}
{#each content as part}
<p>{@html part}</p>
{/each}
{:else}
<p>{@html content}</p>
{/if}
{#if icon}
<p class="header-icon"><i class="{icon}"></i></p>
{/if}
{#if header}
<p class="header"><strong>{header}</strong></p>
{/if}
{#if Array.isArray(content)}
{#each content as part}
<p>{@html part}</p>
{/each}
{:else}
<p>{@html content}</p>
{/if}

</div>

Expand Down
14 changes: 7 additions & 7 deletions src/applications/components/DropZone.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
</script>

<div
on:dragenter={enter}
on:dragleave={leave}
on:dragstart|preventDefault
on:dragover={overCallback}
on:drop|preventDefault={dropData}
style={$$props.style}
on:dragenter={enter}
on:dragleave={leave}
on:dragover={overCallback}
on:dragstart|preventDefault
on:drop|preventDefault={dropData}
style={$$props.style}
>
<slot/>
<slot/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


<div class="item-piles-floting-element" style={elementStyle}>
<svelte:component this={component} {...componentData}/>
<svelte:component {...componentData} this={component}/>
</div>


Expand Down
88 changes: 44 additions & 44 deletions src/applications/components/Grid/Grid.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,51 +84,51 @@

<div class=item-piles-grid-container>

<div
class="item-piles-grid {options.class}"
bind:this={gridContainer}
style={containerStyle}
>
{#if dropGhost && dropGhost?.active}
{@const dropElem = calcPosition(dropGhost, options)}
<div
style={`position: absolute; left:${dropElem.left}px; top:${dropElem.top}px;
<div
bind:this={gridContainer}
class="item-piles-grid {options.class}"
style={containerStyle}
>
{#if dropGhost && dropGhost?.active}
{@const dropElem = calcPosition(dropGhost, options)}
<div
style={`position: absolute; left:${dropElem.left}px; top:${dropElem.top}px;
width: ${dropElem.width}px; height: ${dropElem.height}px;`}
class={options.previewClass}
/>
{/if}
{#each items as item (item.id)}
<GridItem
bind:item={item}
bind:items={items}
bind:options={options}
{gridContainer}
on:itemdoubleclick={itemDoubleClickEvent}
on:itemchange={itemChangeEvent}
on:itemhover={itemHoverEvent}
on:itembegindrag={itemBeginDrag}
on:itemstopdrag={itemStopDrag}
on:itemmove={itemMove}
on:itemhoverleave={itemHoverLeaveEvent}
on:itemrightclick={itemRightClickEvent}
>
<slot {item}/>
</GridItem>
{/each}
</div>

{#if options.backgroundGrid}

<div class="item-piles-inner-grid" style={backgroundGridStyle}>
{#each Array(options.rows) as _, rowIndex (rowIndex)}
{#each Array(options.cols) as _, colIndex (colIndex)}
<div class:grid-disabled={colIndex >= options.enabledCols || rowIndex >= options.enabledRows}
style="width: {options.gridSize + (options.gap/2)}px; height: {options.gridSize + (options.gap/2)}"></div>
{/each}
{/each}
</div>

{/if}
class={options.previewClass}
/>
{/if}
{#each items as item (item.id)}
<GridItem
bind:item={item}
bind:items={items}
bind:options={options}
{gridContainer}
on:itemdoubleclick={itemDoubleClickEvent}
on:itemchange={itemChangeEvent}
on:itemhover={itemHoverEvent}
on:itembegindrag={itemBeginDrag}
on:itemstopdrag={itemStopDrag}
on:itemmove={itemMove}
on:itemhoverleave={itemHoverLeaveEvent}
on:itemrightclick={itemRightClickEvent}
>
<slot {item}/>
</GridItem>
{/each}
</div>

{#if options.backgroundGrid}

<div class="item-piles-inner-grid" style={backgroundGridStyle}>
{#each Array(options.rows) as _, rowIndex (rowIndex)}
{#each Array(options.cols) as _, colIndex (colIndex)}
<div class:grid-disabled={colIndex >= options.enabledCols || rowIndex >= options.enabledRows}
style="width: {options.gridSize + (options.gap/2)}px; height: {options.gridSize + (options.gap/2)}"></div>
{/each}
{/each}
</div>

{/if}

</div>

Expand Down
14 changes: 7 additions & 7 deletions src/applications/components/MacroSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,23 @@
</script>

<div class="item-piles-flexrow">
<input type="text"
<input bind:value={macro}
list={id}
bind:value={macro}
style="flex:1; margin-right:5px;"
placeholder={localize("ITEM-PILES.Applications.ItemPileConfig.Main.MacroPlaceholder")}
on:keyup={() => { filterMacros() }}
on:change={() => { filterMacros() }}
on:keyup={() => { filterMacros() }}
placeholder={localize("ITEM-PILES.Applications.ItemPileConfig.Main.MacroPlaceholder")}
style="flex:1; margin-right:5px;"
type="text"
/>
<datalist id={id}>
{#each $macros as m (m.id)}
<option value={m.name}>{m.text ?? ""}</option>
{/each}
</datalist>
<i
data-fast-tooltip="Open Macro"
style="margin-top: 5px; font-size: 1rem; flex:0;"
class="fas fa-edit item-piles-clickable-link"
data-fast-tooltip="Open Macro"
on:click={() => openMacro()}
style="margin-top: 5px; font-size: 1rem; flex:0;"
></i>
</div>
8 changes: 4 additions & 4 deletions src/applications/components/PriceList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import { dndzone, SOURCES, TRIGGERS } from 'svelte-dnd-action';
import DropZone from "./DropZone.svelte";
import * as Helpers from "../../helpers/helpers.js";
import { getSetting } from "../../helpers/helpers.js";
import * as Utilities from "../../helpers/utilities.js";
import CONSTANTS from "../../constants/constants.js";
import { getSetting } from "../../helpers/helpers.js";
import SETTINGS from "../../constants/settings.js";
import { getActorFlagData } from "../../helpers/pile-utilities.js";
Expand Down Expand Up @@ -175,7 +175,7 @@
</script>
<DropZone callback={dropData} bind:isHovering={isHovering}>
<DropZone bind:isHovering={isHovering} callback={dropData}>
<div class="table-container item-piles-top-divider">
<div class="item-piles-sortable-list-columns header">
<div></div>
Expand All @@ -193,9 +193,9 @@
</div>
</div>
<section
use:dndzone="{{ items: prices, dragDisabled, flipDurationMs }}"
on:consider="{handleConsider}"
on:finalize="{handleFinalize}"
use:dndzone="{{ items: prices, dragDisabled, flipDurationMs }}"
>
{#if isHovering}
<div class="drop-to-add">Drop to add</div>
Expand Down Expand Up @@ -235,7 +235,7 @@
{/each}
<div class="item-piles-sortable-list-columns" style="margin-top: 0.5rem;">
<div class="full-span">
<a on:click={() => addAttribute()} class:invisible={isHovering}>
<a class:invisible={isHovering} on:click={() => addAttribute()}>
{localize("ITEM-PILES.Applications.ItemEditor.DropMeClickMe")}
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/applications/components/PropertyPathInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</script>

<input type="text" list={id} bind:value required={required}/>
<input bind:value list={id} required={required} type="text"/>
<datalist id={id}>
{#each suggestions as suggestion}
<option>{suggestion}</option>
Expand Down
6 changes: 3 additions & 3 deletions src/applications/components/SliderInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</script>

<div class="slider-group" style={$$props.style}>
<input type="range" {min} {step} {max} bind:value="{displayValue}"/>
<input type="number" {min} {step} max={maxInput} required bind:value="{displayValue}"/>
<input bind:value="{displayValue}" {max} {min} {step} type="range"/>
<input bind:value="{displayValue}" max={maxInput} {min} required {step} type="number"/>
</div>

<style lang="scss">
Expand All @@ -39,4 +39,4 @@
}
}
</style>
</style>
32 changes: 16 additions & 16 deletions src/applications/components/Tabs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
</script>

<nav class="tabs" data-group="primary" style={$$props.style}>
{#each tabs.filter(tab => !tab.hidden) as tab, index (tab.value)}
{#if separateElements && index > 0}
<div style="border-right: 1px solid rgba(0,0,0,0.5); margin: 0 10px;"></div>
{/if}
<div on:click={() => { activeTab = tab.value}}
class="item item-piles-flexrow item-piles-clickable-link"
class:underscore={underscore}
class:active={activeTab === tab.value}
data-tab="rest">
{#if tab.icon} <i class="icon {tab.icon}"></i> {/if}
{localize(tab.label)}
{#if tab.highlight}
<div class="blob"><i class="fas fa-exclamation"></i></div>
{/if}
</div>
{/each}
{#each tabs.filter(tab => !tab.hidden) as tab, index (tab.value)}
{#if separateElements && index > 0}
<div style="border-right: 1px solid rgba(0,0,0,0.5); margin: 0 10px;"></div>
{/if}
<div on:click={() => { activeTab = tab.value}}
class="item item-piles-flexrow item-piles-clickable-link"
class:underscore={underscore}
class:active={activeTab === tab.value}
data-tab="rest">
{#if tab.icon} <i class="icon {tab.icon}"></i> {/if}
{localize(tab.label)}
{#if tab.highlight}
<div class="blob"><i class="fas fa-exclamation"></i></div>
{/if}
</div>
{/each}
</nav>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
<ApplicationShell bind:elementRoot>
<form class="item-piles-flexcol" bind:this={form} on:submit|once|preventDefault={submit} style="padding:0.5rem;"
autocomplete="off">
<form autocomplete="off" bind:this={form} class="item-piles-flexcol" on:submit|once|preventDefault={submit}
style="padding:0.5rem;">
{#if attributes.length || items.length}
Expand Down Expand Up @@ -223,7 +223,7 @@
</button>
{/if}
<button type="button" on:click|once={() => { application.close() }}>
<button on:click|once={() => { application.close() }} type="button">
<i class="fas fa-times"></i>
{localize("Cancel")}
</button>
Expand Down
Loading

0 comments on commit e4bb0e1

Please sign in to comment.