mirror of
https://github.com/xiaoshi930/xiaoshi-pad-card.git
synced 2026-02-12 14:43:49 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
513a906231 | ||
|
|
bcc4585278 | ||
|
|
b5598387a1 | ||
|
|
fbdece70f9 | ||
|
|
85c7123854 | ||
|
|
daae901d1b | ||
|
|
b221bacb78 | ||
|
|
7b7f0c632d | ||
|
|
1523dc76d3 | ||
|
|
20eae200c1 |
@@ -327,13 +327,13 @@ class XiaoshiBalanceButtonEditor extends LitElement {
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>按钮图标大小:支持像素(px),默认15px</label>
|
||||
<label>按钮图标大小:支持像素(px),默认13px</label>
|
||||
<input
|
||||
type="text"
|
||||
@change=${this._entityChanged}
|
||||
.value=${this.config.button_icon_size !== undefined ? this.config.button_icon_size : '15px'}
|
||||
.value=${this.config.button_icon_size !== undefined ? this.config.button_icon_size : '13px'}
|
||||
name="button_icon_size"
|
||||
placeholder="默认15px"
|
||||
placeholder="默认13px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -624,7 +624,7 @@ class XiaoshiBalanceButtonEditor extends LitElement {
|
||||
} else if (name === 'button_font_size') {
|
||||
finalValue = value || '11px';
|
||||
} else if (name === 'button_icon_size') {
|
||||
finalValue = value || '15px';
|
||||
finalValue = value || '13px';
|
||||
} else if (name === 'width') {
|
||||
finalValue = value || '100%';
|
||||
} else if (name === 'display_mode') {
|
||||
@@ -955,8 +955,9 @@ class XiaoshiBalanceButton extends LitElement {
|
||||
}
|
||||
|
||||
.status-icon {
|
||||
--mdc-icon-size: var(--button-icon-size, 15px);
|
||||
--mdc-icon-size: var(--button-icon-size, 13px);
|
||||
color: var(--fg-color, #000);
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
/*button新元素 结束*/
|
||||
@@ -1806,7 +1807,7 @@ class XiaoshiBalanceButton extends LitElement {
|
||||
if (config.button_icon_size) {
|
||||
this.style.setProperty('--button-icon-size', config.button_icon_size);
|
||||
} else {
|
||||
this.style.setProperty('--button-icon-size', '15px');
|
||||
this.style.setProperty('--button-icon-size', '13px');
|
||||
}
|
||||
|
||||
// 设置卡片宽度(控制原来的 UI)
|
||||
|
||||
@@ -375,13 +375,13 @@ class XiaoshiConsumablesButtonEditor extends LitElement {
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>按钮图标大小:支持像素(px),默认15px</label>
|
||||
<label>按钮图标大小:支持像素(px),默认13px</label>
|
||||
<input
|
||||
type="text"
|
||||
@change=${this._entityChanged}
|
||||
.value=${this.config.button_icon_size !== undefined ? this.config.button_icon_size : '15px'}
|
||||
.value=${this.config.button_icon_size !== undefined ? this.config.button_icon_size : '13px'}
|
||||
name="button_icon_size"
|
||||
placeholder="默认15px"
|
||||
placeholder="默认13px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -691,7 +691,7 @@ class XiaoshiConsumablesButtonEditor extends LitElement {
|
||||
} else if (name === 'button_font_size') {
|
||||
finalValue = value || '11px';
|
||||
} else if (name === 'button_icon_size') {
|
||||
finalValue = value || '15px';
|
||||
finalValue = value || '13px';
|
||||
} else if (name === 'width') {
|
||||
finalValue = value || '100%';
|
||||
} else if (name === 'tap_action') {
|
||||
@@ -940,8 +940,9 @@ class XiaoshiConsumablesButton extends LitElement {
|
||||
}
|
||||
|
||||
.status-icon {
|
||||
--mdc-icon-size: var(--button-icon-size, 15px);
|
||||
--mdc-icon-size: var(--button-icon-size, 13px);
|
||||
color: var(--fg-color, #000);
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
/* 角标模式样式 */
|
||||
@@ -1896,7 +1897,7 @@ class XiaoshiConsumablesButton extends LitElement {
|
||||
|
||||
buttonHtml = html`
|
||||
<div class="consumables-status" style="--fg-color: ${fgColor}; --bg-color: ${buttonBgColor};" @click=${this._handleButtonClick}>
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" style="color: ${fgColor};" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${displayText}
|
||||
</div>
|
||||
`;
|
||||
@@ -1936,7 +1937,7 @@ class XiaoshiConsumablesButton extends LitElement {
|
||||
|
||||
buttonHtml = html`
|
||||
<div class="consumables-status" style="--fg-color: ${textColor}; --bg-color: ${buttonBgColor};" @click=${this._handleButtonClick}>
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" style="color: ${fgColor};" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${displayText}
|
||||
</div>
|
||||
`;
|
||||
@@ -2013,7 +2014,7 @@ class XiaoshiConsumablesButton extends LitElement {
|
||||
if (config.button_icon_size) {
|
||||
this.style.setProperty('--button-icon-size', config.button_icon_size);
|
||||
} else {
|
||||
this.style.setProperty('--button-icon-size', '15px');
|
||||
this.style.setProperty('--button-icon-size', '13px');
|
||||
}
|
||||
|
||||
// 设置卡片宽度(控制原来的 UI)
|
||||
|
||||
@@ -206,13 +206,13 @@ class XiaoshiHaInfoButtonEditor extends LitElement {
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>按钮图标大小:支持像素(px),默认15px</label>
|
||||
<label>按钮图标大小:支持像素(px),默认13px</label>
|
||||
<input
|
||||
type="text"
|
||||
@change=${this._entityChanged}
|
||||
.value=${this.config.button_icon_size !== undefined ? this.config.button_icon_size : '15px'}
|
||||
.value=${this.config.button_icon_size !== undefined ? this.config.button_icon_size : '13px'}
|
||||
name="button_icon_size"
|
||||
placeholder="默认15px"
|
||||
placeholder="默认13px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -354,7 +354,7 @@ template: 测试模板(最好引用模板,否则大概率会报错)'>
|
||||
} else if (name === 'button_font_size') {
|
||||
finalValue = value || '11px';
|
||||
} else if (name === 'button_icon_size') {
|
||||
finalValue = value || '15px';
|
||||
finalValue = value || '13px';
|
||||
} else if (name === 'width') {
|
||||
finalValue = value || '100%';
|
||||
} else if (name === 'exclude_entities') {
|
||||
@@ -438,8 +438,9 @@ export class XiaoshiHaInfoButton extends LitElement {
|
||||
}
|
||||
|
||||
.status-icon {
|
||||
--mdc-icon-size: var(--button-icon-size, 15px);
|
||||
--mdc-icon-size: var(--button-icon-size, 13px);
|
||||
color: var(--fg-color, #000);
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
/* 角标模式样式 */
|
||||
@@ -1826,7 +1827,7 @@ export class XiaoshiHaInfoButton extends LitElement {
|
||||
|
||||
buttonHtml = html`
|
||||
<div class="ha-info-status" style="--fg-color: ${fgColor}; --bg-color: ${buttonBgColor};" @click=${this._handleButtonClick}>
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" style="color: ${fgColor};" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${displayText}
|
||||
</div>
|
||||
`;
|
||||
@@ -1866,7 +1867,7 @@ export class XiaoshiHaInfoButton extends LitElement {
|
||||
|
||||
buttonHtml = html`
|
||||
<div class="ha-info-status" style="--fg-color: ${textColor}; --bg-color: ${buttonBgColor};" @click=${this._handleButtonClick}>
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" style="color: ${fgColor};" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${displayText}
|
||||
</div>
|
||||
`;
|
||||
@@ -2073,7 +2074,7 @@ export class XiaoshiHaInfoButton extends LitElement {
|
||||
if (config.button_icon_size) {
|
||||
this.style.setProperty('--button-icon-size', config.button_icon_size);
|
||||
} else {
|
||||
this.style.setProperty('--button-icon-size', '15px');
|
||||
this.style.setProperty('--button-icon-size', '13px');
|
||||
}
|
||||
|
||||
// 设置卡片宽度(控制原来的 UI)
|
||||
|
||||
@@ -326,13 +326,13 @@ class XiaoshiTodoButtonEditor extends LitElement {
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>按钮图标大小:支持像素(px),默认15px</label>
|
||||
<label>按钮图标大小:支持像素(px),默认13px</label>
|
||||
<input
|
||||
type="text"
|
||||
@change=${this._entityChanged}
|
||||
.value=${this.config.button_icon_size !== undefined ? this.config.button_icon_size : '15px'}
|
||||
.value=${this.config.button_icon_size !== undefined ? this.config.button_icon_size : '13px'}
|
||||
name="button_icon_size"
|
||||
placeholder="默认15px"
|
||||
placeholder="默认13px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -491,7 +491,7 @@ class XiaoshiTodoButtonEditor extends LitElement {
|
||||
} else if (name === 'button_font_size') {
|
||||
finalValue = value || '11px';
|
||||
} else if (name === 'button_icon_size') {
|
||||
finalValue = value || '15px';
|
||||
finalValue = value || '13px';
|
||||
} else if (name === 'width') {
|
||||
finalValue = value || '100%';
|
||||
} else if (name === 'tap_action') {
|
||||
@@ -654,8 +654,9 @@ class XiaoshiTodoButton extends LitElement {
|
||||
}
|
||||
|
||||
.status-icon {
|
||||
--mdc-icon-size: var(--button-icon-size, 15px);
|
||||
--mdc-icon-size: var(--button-icon-size, 13px);
|
||||
color: var(--fg-color, #000);
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
/* 角标模式样式 */
|
||||
@@ -1663,7 +1664,7 @@ class XiaoshiTodoButton extends LitElement {
|
||||
|
||||
buttonHtml = html`
|
||||
<div class="todo-status" style="--fg-color: ${fgColor}; --bg-color: ${buttonBgColor};" @click=${this._handleButtonClick}>
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" style="color: ${fgColor};" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${displayText}
|
||||
</div>
|
||||
`;
|
||||
@@ -1703,7 +1704,7 @@ class XiaoshiTodoButton extends LitElement {
|
||||
|
||||
buttonHtml = html`
|
||||
<div class="todo-status" style="--fg-color: ${textColor}; --bg-color: ${buttonBgColor};" @click=${this._handleButtonClick}>
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${!hideIcon ? html`<ha-icon class="status-icon" style="color: ${fgColor};" icon="${buttonIcon}"></ha-icon>` : ''}
|
||||
${displayText}
|
||||
</div>
|
||||
`;
|
||||
@@ -1996,7 +1997,7 @@ class XiaoshiTodoButton extends LitElement {
|
||||
if (config.button_icon_size) {
|
||||
this.style.setProperty('--button-icon-size', config.button_icon_size);
|
||||
} else {
|
||||
this.style.setProperty('--button-icon-size', '15px');
|
||||
this.style.setProperty('--button-icon-size', '13px');
|
||||
}
|
||||
|
||||
// 设置卡片宽度(控制原来的 UI)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
console.info("%c 消逝卡-平板端 \n%c v 0.1.7 ", "color: red; font-weight: bold; background: black", "color: white; font-weight: bold; background: black");
|
||||
console.info("%c 消逝卡-平板端 \n%c v 0.1.9 ", "color: red; font-weight: bold; background: black", "color: white; font-weight: bold; background: black");
|
||||
|
||||
const loadCards = async () => {
|
||||
await import('./xiaoshi-pad-grid-card.js');
|
||||
|
||||
Reference in New Issue
Block a user