Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
pantaflex44 committed Feb 12, 2025
2 parents 328cbe4 + ef26235 commit 25045a9
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 13 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@



## [2.0.5] - 2025-02-12

### Ajouts

- Pour améliorer la compatibilité avec les anciens tableaux électriques, il est désormais possible de régler la largeur des étiquettes. 17.5mm ou 18mm par module.

### Corrections

- Légère correction de bugs dans l'interface.



## [2.0.4] - 2025-01-27

### Ajouts
Expand Down
Binary file added docs/_module_width.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tiquettes",
"title": "Tiquettes",
"version": "2.0.4",
"version": "2.0.5",
"description": "Générateur d'étiquettes pour tableaux et armoires électriques.",
"keywords": [
"tableau",
Expand Down
44 changes: 41 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ function App() {
appversion: pkg.version,
height: defaultHRow,
stepsPerRows: defaultStepsPerRows,
stepSize: stepSize,
rows: createRow(defaultStepsPerRows, defaultNpRows),
db: {...defaultProjectProperties.db},
withDb: false,
Expand Down Expand Up @@ -389,6 +390,8 @@ function App() {
summaryColumnFunction: swb.summaryColumnFunction === true || swb.summaryColumnFunction === false ? swb.summaryColumnFunction : true,
summaryColumnLabel: swb.summaryColumnLabel === true || swb.summaryColumnLabel === false ? swb.summaryColumnLabel : true,
summaryColumnDescription: swb.summaryColumnDescription === true || swb.summaryColumnDescription === false ? swb.summaryColumnDescription : true,
// <2.0.5
stepSize: swb.stepSize ?? stepSize,
};

console.log("Switchboard loaded from this session.");
Expand Down Expand Up @@ -446,6 +449,7 @@ function App() {
prjname: name,
height: height,
stepsPerRows,
stepSize,
rows: createRow(stepsPerRows, rowsCount)
});
});
Expand Down Expand Up @@ -531,6 +535,8 @@ function App() {
summaryColumnFunction: swb.summaryColumnFunction === true || swb.summaryColumnFunction === false ? swb.summaryColumnFunction : true,
summaryColumnLabel: swb.summaryColumnLabel === true || swb.summaryColumnLabel === false ? swb.summaryColumnLabel : true,
summaryColumnDescription: swb.summaryColumnDescription === true || swb.summaryColumnDescription === false ? swb.summaryColumnDescription : true,
// <2.0.5
stepSize: swb.stepSize ?? stepSize,

rows
};
Expand Down Expand Up @@ -1415,6 +1421,38 @@ function App() {
</div>
</div>

<div className="tabPageBandGroup">
<div className="tabPageBandCol">
<span style={{
fontSize: 'smaller',
lineHeight: 1.2
}}>Largeur des<br/>étiquettes:</span>
</div>
<div className="tabPageBandCol">
<select
value={switchboard.stepSize ?? stepSize}
onChange={(e) => {
const value = parseFloat(e.target.value);
if (value === 17.5 || value === 18) setSwitchboard((old) => ({...old, stepSize: value}));
}}
style={{
maxWidth: '100%',
width: 'max-content',
overflowX: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis'
}}
disabled={UIFrozen}
>
<option>17.5</option>
<option>18</option>
</select>
</div>
<div className="tabPageBandCol">
<span>mm</span>
</div>
</div>

<div className="tabPageBandNL"></div>

<div className="tabPageBandGroup">
Expand Down Expand Up @@ -1496,10 +1534,10 @@ function App() {
theme={theme}

style={{
"--w": `${switchboard.stepsPerRows * stepSize}mm`,
"--w": `${switchboard.stepsPerRows * switchboard.stepSize}mm`,
"--h": `calc(${switchboard.height}mm + 1mm)`, // 30mm -> 117.16px
"--c": switchboard.stepsPerRows,
"--sw": `calc(${stepSize}mm + 1px)` // 18mm -> 70.03px
"--sw": `calc(${switchboard.stepSize}mm + 1px)` // 18mm -> 70.03px
}}

onScrollLeft={() => handleScrollLeft()}
Expand Down Expand Up @@ -1563,7 +1601,7 @@ function App() {
{editor && <Editor
theme={theme}
switchboard={switchboard}
stepSize={stepSize}
stepSize={switchboard.stepSize}
schemaFunctions={schemaFunctions}
getFilteredModulesBySchemaFuncs={getFilteredModulesBySchemaFuncs}
getModuleById={getModuleById}
Expand Down
21 changes: 12 additions & 9 deletions src/Module.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function Module({
overflowX: isDemo ? 'hidden' : 'initial',
}}
tabIndex={!canPaste && !hasClipboard ? 0 : null}
title={`(${item.id}) R${rowPosition} | P${modulePosition} | L${item.span}`}
title={`${item.id ? '(' + item.id + ') ' : ''}R${rowPosition} | P${modulePosition} | L${item.span}`}
ref={moduleRef}
data-id={`${rowPosition}-${modulePosition}`}
onKeyUp={(e) => {
Expand All @@ -160,8 +160,8 @@ function Module({
: (!isFree && themedModule
? <div className={`module_content half-${item.half}`.trim()} style={{
width: isDemo ? 'calc(100% + 1px)' : (`calc(100% - (${item.half === "none" ? '0px' : `calc(${style['--sw']} / 2)`}))`),
minWidth: isDemo ? 'calc(100% + 1px)' : (`calc(100% - (${item.half === "none" ? '0px' : `calc(${style['--sw']} / 2)`}))`),
maxWidth: isDemo ? 'calc(100% + 1px)' : (`calc(100% - (${item.half === "none" ? '0px' : `calc(${style['--sw']} / 2)`}))`),
minWidth: isDemo ? 'calc(100% + 1px)' : (`calc(100% - (${item.half === "none" ? '0px' : `calc(${style['--sw']} / 2)`}))`),
maxWidth: isDemo ? 'calc(100% + 1px)' : (`calc(100% - (${item.half === "none" ? '0px' : `calc(${style['--sw']} / 2)`}))`),
marginLeft: item.half === "left" ? `calc(${style['--sw']} / 2)` : '0px',
marginRight: item.half === "right" ? `calc(${style['--sw']} / 2)` : '0px',
borderLeftWidth: item.half === "left" ? '1px' : '0px',
Expand Down Expand Up @@ -222,9 +222,10 @@ function Module({
}

{
canPaste && <div className="module_top button">
<div className="tool paste" title="Coller ici ou [Echap] pour annuler" onClick={() => onPaste(item)}><img
src={pasteIcon} alt="Coller" width={18} height={18} style={{marginTop: '2px'}}/><span>Coller ici</span>
canPaste && <div className="module_top button" title="Coller ici">
<div className="tool paste" onClick={() => onPaste(item)}
style={{width: '100%', height: '100%'}}>
<img src={pasteIcon} alt="Coller" width={18} height={18} style={{marginTop: '2px'}}/>
</div>
</div>
}
Expand All @@ -248,9 +249,11 @@ function Module({
}

{
canPaste && <div className="module_bottom">
<div className="tool paste" title="Cliquer ici ou [Echap] pour annuler" onClick={() => cancelPaste()}><img
src={cancelredIcon} alt="Annuler" width={16} height={16} style={{marginTop: '2px'}}/></div>
canPaste && <div className="module_bottom" title="Cliquer ici pour annuler">
<div className="tool paste" onClick={() => cancelPaste()}
style={{width: '100%', height: '100%', display: 'inline-flex', flexDirection: 'row', justifyContent: 'center', alignItems: 'center'}}>
<img src={cancelredIcon} alt="Annuler" width={16} height={16} style={{marginTop: '-4px'}}/>
</div>
</div>
}

Expand Down

0 comments on commit 25045a9

Please sign in to comment.