Skip to content

Commit

Permalink
fix: picker header overflow and preview button font
Browse files Browse the repository at this point in the history
  • Loading branch information
yangxiaolang committed Jun 17, 2024
1 parent 1a36f0f commit 6ac2798
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .storybook/global.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import './reset-browser';
@import '../src/theme/style.scss';
92 changes: 92 additions & 0 deletions .storybook/reset-browser.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
@import '../src/theme/var';
@import '../src/theme/mixin';

* {
&,
&:before,
&:after {
margin: 0;
padding: 0;
border: 0;
font: inherit;
box-sizing: border-box;
vertical-align: baseline;
}

&:focus {
outline: none;
}
}

em {
font-style: italic;
}

ol {
list-style: decimal;
margin-left: 16px;
}

ul {
list-style: none;
}

blockquote,
q {
quotes: none;

&:before,
&:after {
content: '';
content: none;
}
}

table {
border-collapse: collapse;
border-spacing: 0;
}

body {
-webkit-font-smoothing: auto;
-moz-osx-font-smoothing: auto;
display: flex;
align-items: center;
justify-content: center;
min-width: 100%;
min-height: 100%;
color: use-text-color(main);
background-color: use-rgb(main-bg);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
Arial, 'Microsoft YaHei', sans-serif;
font-size: 14px;
font-weight: 400;
line-height: 1.43;
}

pre,
code {
font-family: Menlo, Monaco, 'Courier New', monospace;
white-space: pre-wrap;
font-size: 14px;
line-height: 20px;
padding: 12px;
background: use-rgb(n-9);
border-radius: 2px;

&[ngCodeColorize] {
padding: 0 12px;
}
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
-webkit-text-fill-color: #{use-text-color(main)} !important;
box-shadow: 0 0 0 3000px #{use-rgb(main-bg)} inset !important;
}

[hidden] {
display: none !important;
}
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"browserTarget": "storybook:build",
"compodoc": true,
"compodocArgs": ["-e", "json", "-d", "."],
"port": 6006
"port": 6006,
"styles": [".storybook/global.scss"]
}
},
"build-storybook": {
Expand Down
6 changes: 6 additions & 0 deletions src/date-picker/calendar/header/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import '../../../theme/var';

$block: aui-calendar-header;
$prev-next-icon-button-width: 24px;

.#{$block} {
&__container {
Expand All @@ -12,6 +13,7 @@ $block: aui-calendar-header;

&__nav-content {
flex: 1;
max-width: calc(100% - $prev-next-icon-button-width * 4);
display: flex;
flex-wrap: wrap;
justify-content: center;
Expand Down Expand Up @@ -43,6 +45,10 @@ $block: aui-calendar-header;
margin-left: 0;
}
}

.aui-button--text.header-range {
max-width: 100%;
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/date-picker/calendar/header/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
<ng-template #yearTemplate>
<button
aui-button="text"
class="header-range"
[title]="headerRange?.start?.year() + ('year_suffix' | auiI18n)"
(click)="clickNav(DateNavRange.Year)"
>
{{ headerRange?.start?.year() }}{{ 'year_suffix' | auiI18n }}
Expand All @@ -133,6 +135,8 @@
<ng-template #monthTemplate>
<button
aui-button="text"
class="header-range"
[title]="headerRange?.start?.month() + 1 + ('month_suffix' | auiI18n)"
(click)="clickNav(DateNavRange.Month)"
>
{{ headerRange?.start?.month() + 1 }}{{ 'month_suffix' | auiI18n }}
Expand Down
2 changes: 1 addition & 1 deletion src/date-picker/date-picker/date-picker.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ng-template #template>
<aui-date-picker-panel
[type]="type"
style="padding-top: 9px; display: inline-block"
style="padding-top: 9px; display: inline-block; max-width: 100%"
[(ngModel)]="value"
[showTime]="showTime"
[showFooter]="showFooter"
Expand Down

0 comments on commit 6ac2798

Please sign in to comment.