Skip to content

Commit

Permalink
style(*): bump prettier to 3.1.0 (#1708)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Nov 13, 2023
1 parent 2f85357 commit 7f9e861
Show file tree
Hide file tree
Showing 22 changed files with 388 additions and 360 deletions.
3 changes: 0 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ packages/theme/system/mixins/_functions.less
theme-default.less
theme-dark.less
theme-compact.less

# TODO: https://github.com/prettier/prettier/pull/15606
# packages/**/*
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"mustache": "^4.2.0",
"ng-packagr": "^17.0.0",
"parse5": "^7.1.2",
"prettier": "^3.0.3",
"prettier": "^3.1.0",
"readline-sync": "^1.4.10",
"stream": "0.0.2",
"stylelint": "^15.11.0",
Expand Down
102 changes: 59 additions & 43 deletions packages/abc/cell/cell.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,56 +39,72 @@ import type { CellDefaultText, CellOptions, CellTextResult, CellValue, CellWidge
selector: 'cell, [cell]',
template: `
<ng-template #text>
@switch(safeOpt.type) { @case('checkbox') {
<label nz-checkbox [nzDisabled]="disabled" [ngModel]="value" (ngModelChange)="change($event)">
{{ safeOpt.checkbox?.label }}
</label>
} @case('radio') {
<label nz-radio [nzDisabled]="disabled" [ngModel]="value" (ngModelChange)="change($event)">
{{ safeOpt.radio?.label }}
</label>
} @case('link') {
<a (click)="_link($event)" [attr.target]="safeOpt.link?.target" [attr.title]="value" [innerHTML]="_text"></a>
} @case('tag') {
<nz-tag [nzColor]="res?.result?.color">
<span [innerHTML]="_text"></span>
</nz-tag>
} @case('badge') {
<nz-badge [nzStatus]="res?.result?.color" nzText="{{ _text }}" />
} @case('widget') {
<ng-template cell-widget-host [data]="hostData" />
} @case('img') { @for (i of $any(_text); track $index) {
<img
[attr.src]="i"
[attr.height]="safeOpt.img?.size"
[attr.width]="safeOpt.img?.size"
(click)="_showImg(i)"
class="img"
[class.point]="safeOpt.img?.big"
/>
} } @default { @if(isText) {
<span [innerText]="_text" [attr.title]="value"></span>
} @else {
<span [innerHTML]="_text" [attr.title]="value"></span>
} @if(_unit) {
<span class="unit">{{ _unit }}</span>
} } }
@switch (safeOpt.type) {
@case ('checkbox') {
<label nz-checkbox [nzDisabled]="disabled" [ngModel]="value" (ngModelChange)="change($event)">
{{ safeOpt.checkbox?.label }}
</label>
}
@case ('radio') {
<label nz-radio [nzDisabled]="disabled" [ngModel]="value" (ngModelChange)="change($event)">
{{ safeOpt.radio?.label }}
</label>
}
@case ('link') {
<a (click)="_link($event)" [attr.target]="safeOpt.link?.target" [attr.title]="value" [innerHTML]="_text"></a>
}
@case ('tag') {
<nz-tag [nzColor]="res?.result?.color">
<span [innerHTML]="_text"></span>
</nz-tag>
}
@case ('badge') {
<nz-badge [nzStatus]="res?.result?.color" nzText="{{ _text }}" />
}
@case ('widget') {
<ng-template cell-widget-host [data]="hostData" />
}
@case ('img') {
@for (i of $any(_text); track $index) {
<img
[attr.src]="i"
[attr.height]="safeOpt.img?.size"
[attr.width]="safeOpt.img?.size"
(click)="_showImg(i)"
class="img"
[class.point]="safeOpt.img?.big"
/>
}
}
@default {
@if (isText) {
<span [innerText]="_text" [attr.title]="value"></span>
} @else {
<span [innerHTML]="_text" [attr.title]="value"></span>
}
@if (_unit) {
<span class="unit">{{ _unit }}</span>
}
}
}
</ng-template>
<ng-template #textWrap>
@if (showDefault) {
{{ safeOpt.default?.text }}
} @else { @if (safeOpt.tooltip) {
<span [nz-tooltip]="safeOpt.tooltip">
<ng-template [ngTemplateOutlet]="text" />
</span>
{{ safeOpt.default?.text }}
} @else {
<ng-template [ngTemplateOutlet]="text" />
} }
@if (safeOpt.tooltip) {
<span [nz-tooltip]="safeOpt.tooltip">
<ng-template [ngTemplateOutlet]="text" />
</span>
} @else {
<ng-template [ngTemplateOutlet]="text" />
}
}
</ng-template>
@if (loading) {
<span nz-icon nzType="loading"></span>
<span nz-icon nzType="loading"></span>
} @else {
<ng-template [ngTemplateOutlet]="textWrap" />
<ng-template [ngTemplateOutlet]="textWrap" />
}
`,
exportAs: 'cell',
Expand Down
23 changes: 12 additions & 11 deletions packages/abc/reuse-tab/reuse-tab-context-menu.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ul nz-menu>
@if (item.active) {
<li nz-menu-item (click)="click($event, 'refresh')" data-type="refresh" [innerHTML]="i18n.refresh"></li>
<li nz-menu-item (click)="click($event, 'refresh')" data-type="refresh" [innerHTML]="i18n.refresh"></li>
}
<li
nz-menu-item
Expand All @@ -18,14 +18,15 @@
[innerHTML]="i18n.closeRight"
></li>
@if (customContextMenu!.length > 0) {
<li nz-menu-divider></li>
@for (i of customContextMenu; track $index) {
<li
nz-menu-item
[attr.data-type]="i.id"
[nzDisabled]="isDisabled(i)"
(click)="click($event, 'custom', i)"
[innerHTML]="i.title"
></li>
} }
<li nz-menu-divider></li>
@for (i of customContextMenu; track $index) {
<li
nz-menu-item
[attr.data-type]="i.id"
[nzDisabled]="isDisabled(i)"
(click)="click($event, 'custom', i)"
[innerHTML]="i.title"
></li>
}
}
</ul>
42 changes: 21 additions & 21 deletions packages/abc/reuse-tab/reuse-tab.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@
[nzTabBarStyle]="tabBarStyle"
>
@for (i of list; track $index) {
<nz-tab [nzTitle]="titleTemplate" (nzClick)="_to($index)">
<ng-template #titleTemplate>
<div
[reuse-tab-context-menu]="i"
[customContextMenu]="customContextMenu"
class="reuse-tab__name"
[attr.title]="i.title"
>
<span [class.reuse-tab__name-width]="tabMaxWidth" [style.max-width.px]="tabMaxWidth">
@if (titleRender) {
<ng-template [ngTemplateOutlet]="titleRender" [ngTemplateOutletContext]="{ $implicit: i }" />
} @else {
{{ i.title }}
}
</span>
</div>
@if (i.closable) {
<i nz-icon nzType="close" class="reuse-tab__op" (click)="_close($event, $index, false)"></i>
}
</ng-template>
</nz-tab>
<nz-tab [nzTitle]="titleTemplate" (nzClick)="_to($index)">
<ng-template #titleTemplate>
<div
[reuse-tab-context-menu]="i"
[customContextMenu]="customContextMenu"
class="reuse-tab__name"
[attr.title]="i.title"
>
<span [class.reuse-tab__name-width]="tabMaxWidth" [style.max-width.px]="tabMaxWidth">
@if (titleRender) {
<ng-template [ngTemplateOutlet]="titleRender" [ngTemplateOutletContext]="{ $implicit: i }" />
} @else {
{{ i.title }}
}
</span>
</div>
@if (i.closable) {
<i nz-icon nzType="close" class="reuse-tab__op" (click)="_close($event, $index, false)"></i>
}
</ng-template>
</nz-tab>
}
</nz-tabset>
<reuse-tab-context [i18n]="i18n" (change)="contextMenuChange($event)" />
2 changes: 1 addition & 1 deletion packages/form/widgets/autocomplete/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import type { SFAutoCompleteWidgetSchema } from './schema';
(selectionChange)="updateValue($event)"
>
@for (i of list | async; track i) {
<nz-auto-option [nzValue]="i" [nzLabel]="i.label"> {{ i.label }} </nz-auto-option>
<nz-auto-option [nzValue]="i" [nzLabel]="i.label"> {{ i.label }} </nz-auto-option>
}
</nz-autocomplete>
</sf-item-wrap>`,
Expand Down
32 changes: 16 additions & 16 deletions packages/form/widgets/color/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ import type { SFColorWidgetSchema } from './schema';
[showTitle]="schema.title"
>
@if (ui.block) {
<nz-color-block [nzColor]="value" [nzSize]="$any(ui.size)" />
<nz-color-block [nzColor]="value" [nzSize]="$any(ui.size)" />
} @else {
<nz-color-picker
[ngModel]="value"
(ngModelChange)="setValue($event)"
[nzDisabled]="disabled"
[nzSize]="$any(ui.size)"
[nzDefaultValue]="ui.defaultValue ?? ''"
[nzFormat]="ui.format ?? null"
[nzTrigger]="ui.trigger ?? 'click'"
[nzTitle]="ui.title ?? ''"
[nzFlipFlop]="$any(ui.flipFlop)"
[nzShowText]="ui.showText"
[nzAllowClear]="ui.allowClear"
(nzOnChange)="_change($event)"
(nzOnFormatChange)="_formatChange($event)"
/>
<nz-color-picker
[ngModel]="value"
(ngModelChange)="setValue($event)"
[nzDisabled]="disabled"
[nzSize]="$any(ui.size)"
[nzDefaultValue]="ui.defaultValue ?? ''"
[nzFormat]="ui.format ?? null"
[nzTrigger]="ui.trigger ?? 'click'"
[nzTitle]="ui.title ?? ''"
[nzFlipFlop]="$any(ui.flipFlop)"
[nzShowText]="ui.showText"
[nzAllowClear]="ui.allowClear"
(nzOnChange)="_change($event)"
(nzOnFormatChange)="_formatChange($event)"
/>
}
</sf-item-wrap>`,
preserveWhitespaces: false,
Expand Down
54 changes: 27 additions & 27 deletions packages/form/widgets/mention/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,34 @@ import type { SFMentionWidgetSchema } from './schema';
(nzOnSearchChange)="_search($event)"
>
@if (ui.inputStyle === 'textarea') {
<textarea
nzMentionTrigger
nz-input
[attr.id]="id"
[disabled]="disabled"
[attr.disabled]="disabled"
[nzSize]="ui.size!"
[ngModel]="value"
(ngModelChange)="setValue($event)"
[attr.maxLength]="schema.maxLength || null"
[attr.placeholder]="ui.placeholder"
[nzAutosize]="i.autosize"
>
</textarea>
<textarea
nzMentionTrigger
nz-input
[attr.id]="id"
[disabled]="disabled"
[attr.disabled]="disabled"
[nzSize]="ui.size!"
[ngModel]="value"
(ngModelChange)="setValue($event)"
[attr.maxLength]="schema.maxLength || null"
[attr.placeholder]="ui.placeholder"
[nzAutosize]="i.autosize"
>
</textarea>
} @else {
<input
nzMentionTrigger
nz-input
[attr.id]="id"
[disabled]="disabled"
[attr.disabled]="disabled"
[nzSize]="ui.size!"
[ngModel]="value"
(ngModelChange)="setValue($event)"
[attr.maxLength]="schema.maxLength || null"
[attr.placeholder]="ui.placeholder"
autocomplete="off"
/>
<input
nzMentionTrigger
nz-input
[attr.id]="id"
[disabled]="disabled"
[attr.disabled]="disabled"
[nzSize]="ui.size!"
[ngModel]="value"
(ngModelChange)="setValue($event)"
[attr.maxLength]="schema.maxLength || null"
[attr.placeholder]="ui.placeholder"
autocomplete="off"
/>
}
</nz-mention>
</sf-item-wrap>`,
Expand Down
2 changes: 1 addition & 1 deletion packages/form/widgets/rate/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import type { SFRateWidgetSchema } from './schema';
[nzCount]="$any(count)"
/>
@if (hasText && formProperty.value) {
<span class="ant-rate-text">{{ text }}</span>
<span class="ant-rate-text">{{ text }}</span>
}
</sf-item-wrap>`,
preserveWhitespaces: false,
Expand Down
28 changes: 14 additions & 14 deletions packages/form/widgets/tag/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ import type { SFTagWidgetSchema } from './schema';
></i>
</ng-template>
@for (i of data; track $index) {
<nz-tag
[nzMode]="ui.mode || 'checkable'"
[nzChecked]="i.checked"
(nzOnClose)="_close($event)"
(nzCheckedChange)="onChange(i)"
>
@if (i.prefixIcon) {
<ng-template [ngTemplateOutlet]="icon" [ngTemplateOutletContext]="{ $implicit: i.prefixIcon }" />
}
<span>{{ i.label }}</span>
@if (i.suffixIcon) {
<ng-template [ngTemplateOutlet]="icon" [ngTemplateOutletContext]="{ $implicit: i.suffixIcon }" />
}
</nz-tag>
<nz-tag
[nzMode]="ui.mode || 'checkable'"
[nzChecked]="i.checked"
(nzOnClose)="_close($event)"
(nzCheckedChange)="onChange(i)"
>
@if (i.prefixIcon) {
<ng-template [ngTemplateOutlet]="icon" [ngTemplateOutletContext]="{ $implicit: i.prefixIcon }" />
}
<span>{{ i.label }}</span>
@if (i.suffixIcon) {
<ng-template [ngTemplateOutlet]="icon" [ngTemplateOutletContext]="{ $implicit: i.suffixIcon }" />
}
</nz-tag>
}
</sf-item-wrap>`,
preserveWhitespaces: false,
Expand Down
Loading

0 comments on commit 7f9e861

Please sign in to comment.